This file is a merged representation of a subset of the codebase, containing files not matching ignore patterns, combined into a single document by Repomix.
The content has been processed where comments have been removed, empty lines have been removed, content has been compressed (code blocks are separated by ⋮---- delimiter).

<file_summary>
This section contains a summary of this file.

<purpose>
This file contains a packed representation of a subset of the repository's contents that is considered the most important context.
It is designed to be easily consumable by AI systems for analysis, code review,
or other automated processes.
</purpose>

<file_format>
The content is organized as follows:
1. This summary section
2. Repository information
3. Directory structure
4. Repository files (if enabled)
5. Multiple file entries, each consisting of:
  - File path as an attribute
  - Full contents of the file
</file_format>

<usage_guidelines>
- This file should be treated as read-only. Any changes should be made to the
  original repository files, not this packed version.
- When processing this file, use the file path to distinguish
  between different files in the repository.
- Be aware that this file may contain sensitive information. Handle it with
  the same level of security as you would the original repository.
</usage_guidelines>

<notes>
- Some files may have been excluded based on .gitignore rules and Repomix's configuration
- Binary files are not included in this packed representation. Please refer to the Repository Structure section for a complete list of file paths, including binary files
- Files matching these patterns are excluded: **/.git/**, **/.github/**, **/node_modules/**, **/vendor/**, **/third_party/**, **/external/**, **/libs/**, **/lib/**, **/bin/**, **/obj/**, **/build/**, **/dist/**, **/target/**, **/out/**, **/release/**, **/debug/**, **/wwwroot/**, **/public/**, **/assets/**, **/static/**, **/[tT]est/**, **/[tT]ests/**, **/__tests__/**, **/[lL]ogs/**, **/[mM]igrations/**, **/.vs/**, **/.vscode/**, **/.idea/**, **/.pnpm-store/**, **/.yarn/**, **/.npm/**, **/__pycache__/**, **/.pytest_cache/**, **/.mypy_cache/**, **/.gradle/**, **/.mvn/**, **/coverage/**, **/.coverage/**, **/reports/**, **/report/**, **/TestResults/**, **/tmp/**, **/temp/**, **/.tmp/**, **/.cache/**, **/.history/**, **/.DS_Store, **/Thumbs.db, **/*.log, **/*.out, **/*.err, **/*.trace, **/*.trc, **/*.tmp, **/*.cache, **/*.dmp, **/*.dump, **/*.core, **/*.binlog, **/*.ndjson, **/*.jsonl, **/*.csv, **/*.evtx, **/*.etl, **/*.access, **/*.error, **/*.exe, **/*.dll, **/*.so, **/*.dylib, **/*.bin, **/*.app, **/*.msi, **/*.apk, **/*.ipa, **/*.lib, **/*.a, **/*.o, **/*.obj, **/*.lo, **/*.lai, **/*.class, **/*.jar, **/*.war, **/*.ear, **/*.pdb, **/*.idb, **/*.ilk, **/*.nupkg, **/*.snupkg, **/*.gem, **/*.whl, **/*.egg, **/*.deb, **/*.rpm, **/*.zip, **/*.tar, **/*.gz, **/*.tgz, **/*.rar, **/*.bz2, **/*.xz, **/*.7z, **/*.lz, **/*.lzma, **/*.min.js, **/*.min.css, **/*.map, **/*.css, **/*.scss, **/*.sass, **/*.less, **/*.jpg, **/*.jpeg, **/*.png, **/*.gif, **/*.bmp, **/*.tif, **/*.tiff, **/*.webp, **/*.heif, **/*.heic, **/*.svg, **/*.eps, **/*.ai, **/*.raw, **/*.cr2, **/*.cr3, **/*.nef, **/*.arw, **/*.dng, **/*.orf, **/*.rw2, **/*.avif, **/*.apng, **/*.ico, **/*.psd, **/*.psb, **/*.xcf, **/*.hdr, **/*.exr, **/*.dcm, **/*.dicom, **/*.fits, **/*.ppm, **/*.pgm, **/*.pbm, **/*.j2k, **/*.jp2, **/*.pcx, **/*.tga, **/*.iff, **/*.sgi, **/*.ras, **/*.coverage, **/*.lcov, **/*.gcov, **/*.gcda, **/*.gcno, **/*.generated, **/*.g.cs, **/*.designer.cs, **/*.lock, **/*.lock.json, **/*.eot, **/*.ttf, **/*.woff, **/*.woff2, **/*.pfx, **/*.p12, **/*.cer, **/*.crt, **/*.key, **/*.editorconfig, **/*.tool-versions, **/*.onnx, **/*.pt, **/*.pth, **/*.h5, **/*.ckpt, **/*.sln, **/*.csproj, **/*.config, **/*.user, **/*.vsidx, **/*.v2, **/*.db*, **/.*ignore, **/.git*, **/*.config.*, **/*.gradle, **/*.gradle.kts, **/*.properties, **/*.patch, **/*.lock, **/.env*, **/.editorconfig, **/.gitattributes, **/.gitignore, **/.watchmanconfig, **/*.yml, **/*.yaml, **/*.json, **/*.png, **/*.svg, **/assets/**, **/locales/**, **/pdf/**, **/imgs/**, **/fonts/**, **/animated-pictograms/**, **/scripts/**, **/patches/**, **/generated/**, **/gen/**, **/out/**, **/auto/**, **/*.bzl, **/*.pdl, **/*.cddl, **/*.thrift, **/*.avsc, **/*.smithy, **/.idea/**, **/.vscode/**, **/.eclipse/**, **/.settings/**, **/node_modules/**, **/vendor/**, **/*.podspec, **/*.xcprivacy, **/*.production, **/*.local
- Files matching patterns in .gitignore are excluded
- Files matching default ignore patterns are excluded
- Code comments have been removed from supported file types
- Empty lines have been removed from all files
- Content has been compressed - code blocks are separated by ⋮---- delimiter
- Files are sorted by Git change count (files with more changes are at the bottom)
</notes>

</file_summary>

<directory_structure>
apps/
  dev-api-server/
    scratch/
      payments
      wallets
    src/
      features/
        cdc/
          persistence/
            index.ts
          routers/
            index.ts
            router.ts
            status.ts
          services/
            statusService.ts
        cgn/
          utils/
            index.ts
        fastLogin/
          fastLoginHandler.ts
          nonceHandler.ts
        fci/
          qtspNonceStore.ts
        fims/
          routers/
            historyRouter.ts
            providerRouter.ts
            relyingPartyRouter.ts
          services/
            configurationService.ts
            historyService.ts
            providerService.ts
            relyingPartyService.ts
          types/
            authentication.ts
            config.ts
            lastExportRequest.ts
            relyingParty.ts
        messages/
          persistence/
            messagesDatabase.ts
            messagesPayload.ts
          routers/
            ioSendRouter.ts
            messagesRouter.ts
            productionCrawlerRouter.ts
          services/
            ioSendService.ts
            messagesService.ts
          types/
            attachmentCategory.ts
            LegacyGreenPass.ts
            liveModeMessages.ts
            messagesConfig.ts
            messageTemplate.ts
            messageTemplateWrapper.ts
          utils/
            index.ts
        payments/
          payloads/
            paymentMethods.ts
            payments.ts
            transactions.ts
          persistence/
            notices.ts
            paymentMethods.ts
            userWallet.ts
          routers/
            index.ts
            notices.ts
            payment.ts
            platform.ts
            router.ts
            wallets.ts
          types/
            configuration.ts
            failure.ts
          utils/
            onboarding.ts
            payment.ts
            platform.ts
            transactions.ts
          index.ts
        pn/
          middlewares/
            authenticationMiddleware.ts
            initializationMiddleware.ts
          models/
            AAR.ts
            APIKey.ts
            Document.ts
            Mandate.ts
            Notification.ts
            ValidationCode.ts
          repositories/
            aarRepository.ts
            documentRepository.ts
            mandateRepository.ts
            notificationRepository.ts
            prevalidatedUrisRepository.ts
          routers/
            aarRouter.ts
            documentsRouter.ts
            lollipopLambda.ts
            mandatesRouter.ts
            notificationsRouter.ts
            prevalidatedUrisRouter.ts
            serviceRouter.ts
          services/
            aarService.ts
            commonService.ts
            dataService.ts
            documentsService.ts
            lollipopLambdaService.ts
            lollipopService.ts
            mandateService.ts
            notificationsService.ts
            prevalidatedUrisService.ts
          types/
            notificationPaymentInfo.ts
            sendConfig.ts
        services/
          payloads/
            get-featured-institutions.ts
            get-featured-services.ts
            get-institutions.ts
            get-services.ts
          persistence/
            services/
              special/
                cdc-service.ts
                cgn-service.ts
                fci-service.ts
              factory.ts
            servicesDatabase.ts
          routers/
            index.ts
            institutions.ts
            router.ts
            services.ts
          types/
            configuration.ts
          utils/
            institutions.ts
          index.ts
        trialSystem/
          routers/
            index.ts
      middleware/
        authorizationMiddleware.ts
        errorMiddleware.ts
        fastLoginMiddleware.ts
        lollipopMiddleware.ts
      payloads/
        features/
          cgn/
            merchants.ts
            utils.ts
          fci/
            create-signature-body.ts
            metadata.ts
            qtsp-clauses.ts
            qtsp-filled-document.ts
            signature-detail-request.ts
            signature-request.ts
            signature-requests.ts
          idpay/
            check-prerequisites.ts
            error.ts
            generateIDPayServices.ts
            get-iban-list.ts
            get-iban.ts
            get-initiative-beneficiary-detail.ts
            get-initiative-data.ts
            get-initiatives-with-instrument.ts
            get-instrument-list.ts
            get-onboarding-initiative-user-status.ts
            get-timeline-detail.ts
            get-timeline.ts
            get-wallet-detail.ts
            get-wallet-status.ts
            get-wallet.ts
            onboarding-status.ts
            types.ts
            utils.ts
        utils/
          random.ts
        backend.ts
        error.ts
        login.ts
        municipality.ts
        profile.ts
        response.ts
        session.ts
        success.ts
        wallet_v2.ts
        wallet.ts
      persistence/
        profile/
          profile.ts
          userMetadata.ts
        appInfo.ts
        idpay.ts
        lollipop.ts
        payments.ts
        sessionInfo.ts
      routers/
        configHomeDashboard/
          configHomeDashboard.ts
        features/
          cgn/
            geocoding.ts
            index.ts
            merchants.ts
          fastLogin/
            index.ts
          fci/
            index.ts
          idpay/
            barcode.ts
            iban.ts
            index.ts
            onboarding.ts
            payment.ts
            router.ts
            staticCode.ts
            timeline.ts
            wallet.ts
          lollipop/
            index.ts
          featureFlagUtils.ts
        walletsV2/
          methods/
            bancomat.ts
            bpay.ts
            cobadge.ts
            satispay.ts
          configDashboard.ts
          index.ts
        misc.ts
        profile.ts
        public.ts
        service.ts
        services_metadata.ts
        session.ts
        wallet.ts
      types/
        allowRandomValue.ts
        config.ts
        httpResponseCode.ts
        parameters.ts
        PatchedWalletV2.ts
        PatchedWalletV2ListResponse.ts
        PatchedWalletV2Response.ts
        PaymentStatus.ts
      utils/
        date.ts
        delay_middleware.ts
        error.ts
        expressDTO.ts
        file.ts
        guards.ts
        httpSignature.ts
        id.ts
        logging.ts
        login.ts
        payment.ts
        random.ts
        responseTypes.ts
        server.ts
        strings.ts
        types.ts
        validator.ts
        variables.ts
        wallet.ts
      config.ts
      index.html
      populate-persistence.ts
      server.ts
      start.ts
    .oxlintrc.jsonc
    eslint.config.mjs
    jest.uuid.cjs
    README.MD
  main-app/
    android/
      app/
        src/
          canary/
            res/
              drawable/
                ic_launcher_background.xml
              mipmap-anydpi-v26/
                ic_launcher_round.xml
                ic_launcher.xml
          main/
            java/
              it/
                pagopa/
                  io/
                    app/
                      MainActivity.kt
                      MainApplication.kt
            res/
              drawable/
                eu_next_logo.xml
                ic_launcher_foreground.xml
                io_app_icon_foreground.xml
                logo_io.xml
                logo_pagopa.xml
                rn_edit_text_material.xml
                splash_bg.xml
              layout/
                launch_screen.xml
              mipmap-anydpi-v26/
                ic_launcher_round.xml
                ic_launcher.xml
              values/
                bools.xml
                colors.xml
                ic_launcher_background.xml
                strings.xml
                styles.xml
              values-it/
                strings.xml
              values-sw600dp/
                bools.xml
            AndroidManifest.xml
        proguard-rules.pro
      fastlane/
        Appfile
        Fastfile
      gradlew
      gradlew.bat
    img/
      features/
        itWallet/
          credential/
            trustmark-stamp.svg.html
    ios/
      fastlane/
        metadata/
          it/
            description.txt
            keywords.txt
            marketing_url.txt
            name.txt
            privacy_url.txt
            promotional_text.txt
            release_notes.txt
            subtitle.txt
            support_url.txt
          review_information/
            demo_password.txt
            demo_user.txt
            email_address.txt
            first_name.txt
            last_name.txt
            notes.txt
            phone_number.txt
          trade_representative_contact_information/
            address_line1.txt
            address_line2.txt
            address_line3.txt
            city_name.txt
            country.txt
            email_address.txt
            first_name.txt
            is_displayed_on_app_store.txt
            last_name.txt
            phone_number.txt
            postal_code.txt
            state.txt
            trade_name.txt
          copyright.txt
          primary_category.txt
          primary_first_sub_category.txt
          primary_second_sub_category.txt
          secondary_category.txt
          secondary_first_sub_category.txt
          secondary_second_sub_category.txt
        Appfile
        Fastfile
        Matchfile
        Matchfile_canary
        README.md
      IO/
        de.lproj/
          InfoPlist.strings
          Localizable.strings
        en.lproj/
          InfoPlist.strings
          LaunchScreen.strings
          Localizable.strings
        it.lproj/
          InfoPlist.strings
          LaunchScreen.strings
          Localizable.strings
        Info.plist
        IO-Canary.entitlements
        IO.entitlements
        LaunchScreen.storyboard
      IO.xcodeproj/
        xcshareddata/
          xcschemes/
            IO-tvOS.xcscheme
            IO.xcscheme
        project.pbxproj
      IO.xcworkspace/
        xcshareddata/
          IDEWorkspaceChecks.plist
          WorkspaceSettings.xcsettings
        contents.xcworkspacedata
      .xcode.env
      AppDelegate.swift
      IO-Bridging-Header.h
      Podfile
      README.md
    jest/
      TimezoneEnvironment.js
    ts/
      __mocks__/
        @gorhom/
          bottom-sheet.ts
        expo-file-system.js
        initializedProfile.ts
        io-react-native-zendesk.ts
        react-native-background-timer.ts
        react-native-config.ts
        react-native-device-info.ts
        react-native-fingerprint-scanner.ts
        react-native-fs.ts
        react-native-keychain.ts
        svgMock.js
      @types/
        i18next.d.ts
        json-imports.d.ts
        react-native-barcode-builder.d.ts
        react-native-open-maps.d.ts
      api/
        __mocks__/
          CommunicationClientManager.ts
          IdentityClientManager.ts
          ServicesClientManager.ts
          SessionManagerClientManager.ts
        ApiClientManager.ts
        backendPublic.ts
        CommunicationClientManager.ts
        content.ts
        IdentityClientManager.ts
        pagopa.ts
        ServicesClientManager.ts
        SessionManagerClientManager.ts
      boot/
        configureReactotron.ts
        configureStoreAndPersistor.ts
        reduxStartupGate.ts
      common/
        context/
          DSExperimentalContext/
            index.tsx
          DSTypefaceContext/
            index.tsx
        model/
          RemoteValue.ts
        versionInfo/
          saga/
            versionInfo.ts
          store/
            actions/
              versionInfo.ts
            reducers/
              __mock__/
                ioVersionInfo.ts
                testVersion.ts
              __test__/
                versionInfo.test.tsx
              versionInfo.ts
          types/
            IOVersionInfo.ts
      components/
        animatedNumericText/
          AnimatedNumericText.ios.tsx
          AnimatedNumericText.tsx
          BaselineNumericText.tsx
          index.ts
          types.ts
        BonusCard/
          BonusCard.tsx
          BonusCardCounter.tsx
          BonusCardScreenComponent.tsx
          BonusCardShape.tsx
          BonusCardStatus.tsx
          index.ts
        bottomSheet/
          BottomSheetHeader.tsx
        core/
          __mock__/
            fontMocks.ts
          __test__/
            fontsiOS.test.ts
          fonts.ts
          README.md
        countdown/
          CountdownProvider.tsx
        error/
          ErrorBoundary.tsx
          OfflineFailure.tsx
          WorkunitGenericFailure.tsx
        helpers/
          withAppRequiredUpdate.tsx
        IOMarkdown/
          __mocks__/
            index.tsx
            markdownRenderer.test.ts
          index.tsx
          markdownRenderer.ts
          renderRules.tsx
          types.ts
        screens/
          LoadingScreenContent.tsx
          OperationResultScreenContent.tsx
          WhatsNewScreenContent.tsx
        SectionStatus/
          modal/
            index.tsx
          index.tsx
        StatusMessages/
          IOAlertVisibleContext.tsx
          StatusMessages.tsx
        ui/
          __test__/
            __snapshots__/
              BoxedRefreshIndicator.test.tsx.snap
              IOScrollViewCentredContent.test.tsx.snap
              IOScrollViewWithListItems.test.tsx.snap
            BoxedRefreshIndicator.test.tsx
            IOListView.test.tsx
            IOScrollViewCentredContent.test.tsx
            IOScrollViewWithListItems.test.tsx
          Markdown/
            handlers/
              __test__/
                link.test.ts
              link.ts
            script.ts
            types.ts
          utils/
            components/
              LogoPaymentWithFallback.tsx
            buttons.ts
            strings.ts
          AlertModal.tsx
          AlertModalOverlay.tsx
          AnimatedPictogram.tsx
          BoxedRefreshIndicator.tsx
          CircularProgress.tsx
          FocusAwareStatusBar.tsx
          IOListView.tsx
          IOListViewWithLargeHeader.tsx
          IOScrollView.tsx
          IOScrollViewCentredContent.tsx
          IOScrollViewWithLargeHeader.tsx
          IOScrollViewWithListItems.tsx
          LightModal.tsx
          LoadingIndicator.tsx
          LoadingSkeleton.tsx
          LogoPaymentExtended.tsx
          ProgressIndicator.tsx
          TabIconComponent.tsx
        AnimatedImage.tsx
        AppVersion.tsx
        CalendarList.tsx
        CalendarsListContainer.tsx
        Carousel.tsx
        GifImage.tsx
        LandingCardComponent.tsx
        ListItemSwipeAction.tsx
        LoadingSpinnerOverlay.tsx
        PagoPATestIndicator.tsx
        PagoPATestIndicatorOverlay.tsx
        QrCodeImage.tsx
        RotationSensor.tsx
        TouchableDefaultOpacity.tsx
        UpdateAppAlert.tsx
        WebviewComponent.tsx
      features/
        appearanceSettings/
          store/
            actions/
              index.ts
            reducers/
              __test__/
                index.test.ts
              index.ts
            selectors/
              __test__/
                index.test.ts
              index.ts
        appReviews/
          analytics/
            index.ts
          components/
            AppFeedbackProvider.tsx
          store/
            actions/
              index.ts
            reducers/
              index.ts
            selectors/
              index.ts
          utils/
            date.ts
            storeReview.ts
        authentication/
          activeSessionLogin/
            analytics/
              __test__/
                index.test.ts
              index.ts
            components/
              __test__/
                LoginExpirationBanner.test.tsx
              LoginExpirationBanner.tsx
            saga/
              forceLogoutActiveSessionLoginSaga.ts
              index.ts
              navigateToActiveSessionLogin.ts
            screens/
              analytics/
                index.ts
              cie/
                ActiveSessionLoginCieCardReaderScreen.tsx
                ActiveSessionLoginCieConsentDataUsageScreen.tsx
                OneIdentityActiveSessionLoginCieAuthorizationWebView.tsx
              cieId/
                ActiveSessionCieIdLoginScreen.tsx
                OneIdentityActiveSessionCieIdLoginScreen.tsx
              spid/
                ActiveSessionIdpLoginScreen.tsx
                OneIdentityActiveSessionIdpLoginScreen.tsx
              ActiveSessionLandingScreen.tsx
              DifferentCFErrorScreen.tsx
            shared/
              components/
                LoaderComponent.tsx
              utils/
                index.tsx
              CieContentDataUsageCommonSuite.tsx
            store/
              actions/
                index.ts
              reducer/
                index.ts
              selectors/
                index.ts
            utils/
              useActiveSessionLoginNavigation.tsx
          common/
            analytics/
              carouselAnalytics.ts
              cieAnalytics.ts
              index.ts
              spidAnalytics.ts
            components/
              AuthErrorComponent.tsx
              Carousel.tsx
              CieIdWebViewLogin.tsx
              CieWebViewLogin.tsx
              IdpSuccessfulAuthentication.tsx
              IdpWebViewLogin.tsx
              LoginConfigScreenContent.tsx
            hooks/
              useCieIdApp.ts
              useCieIdWebViewLoginNavigation.ts
              useCieLoginMethodSelection.tsx
              useOneIdentityPosteIDApp2AppEducational.tsx
            navigation/
              __test__/
                __snapshots__/
                  AuthenticationNavigator.test.tsx.snap
                AuthenticationNavigator.test.tsx
              params/
                AuthenticationParamsList.ts
              AuthenticationNavigator.tsx
              routes.ts
            saga/
              __test__/
                authenticationSaga.test.ts
                loadSessionInformationSaga.test.ts
                testLoginSaga.test.ts
                watchCheckSessionSaga.test.ts
                watchForceLogoutSaga.test.ts
                watchLogoutSaga.test.ts
              authenticationSaga.ts
              loadSessionInformationSaga.ts
              testLoginSaga.ts
              watchCheckSessionSaga.ts
              watchForceLogoutSaga.ts
              watchLogoutSaga.ts
            screens/
              __test__/
                LoginConfigScreen.test.tsx
                TestAuthenticationScreen.test.tsx
              LoginConfigScreen.tsx
              TestAuthenticationScreen.tsx
            store/
              __test__/
                reducers.test.ts
                selectors.test.ts
              actions/
                index.ts
                loginConfig.ts
              models/
                index.ts
              reducers/
                index.ts
                loginConfig.ts
                loginFlow.ts
                testLogin.ts
              selectors/
                index.ts
                loginConfig.ts
                loginFlow.ts
                remoteConfig.ts
              utils/
                guards.ts
            utils/
              authError.ts
              cie.ts
              constants.tsx
              fetch.ts
              index.tsx
              jsonFetchToSchema.ts
              loginErrorDebugInfo.ts
          fastLogin/
            analytics/
              __test__/
                index.test.ts
                optinAnalytics.test.ts
              index.ts
              optinAnalytics.ts
            backend/
              __test__/
                index.test.ts
              index.ts
              mockedFunctionsAndTypes.ts
            components/
              __test__/
                SecuritySuggestions.test.tsx
              SecuritySuggestions.tsx
            saga/
              __test__/
                pendingActionsSaga.test.ts
                tokenRefreshSaga.test.ts
                utils.test.ts
              utils/
                index.ts
              pendingActionsSaga.ts
              tokenRefreshSaga.ts
            screens/
              AskUserInteractionScreen.tsx
              FastLoginModals.tsx
              RefreshTokenLoadingScreen.tsx
            store/
              __test__/
                optInReducer.test.ts
                securityAdviceReducer.test.ts
                selectors.test.ts
                sessionRefreshReducer.test.ts
                tokenRefreshReducer.test.ts
              actions/
                index.ts
                optInActions.ts
                securityAdviceActions.ts
                sessionRefreshActions.ts
                tokenRefreshActions.ts
              reducers/
                index.ts
                optInReducer.ts
                securityAdviceReducer.ts
                sessionRefreshReducer.ts
                tokenRefreshReducer.ts
              selectors/
                index.ts
            utils/
              pinPolicy.ts
          login/
            authError/
              __test__/
                AuthErrorScreen.test.tsx
              screens/
                AuthErrorScreen.tsx
            cie/
              analytics/
                __test__/
                  analytics.test.ts
                index.ts
              components/
                __test__/
                  __snapshots__/
                    CieCardReadingAnimation.test.tsx.snap
                    CieIdNotInstalled.test.tsx.snap
                    CieRequestAuthenticationOverlay.test.tsx.snap
                  CieCardReadingAnimation.test.tsx
                  CieIdNotInstalled.test.tsx
                  CieRequestAuthenticationOverlay.test.tsx
                  CieWrongPin.test.tsx
                  OneIdentityCieAuthenticationWebView.test.tsx
                  OneIdentityCieAuthorizationWebView.test.tsx
                  OneIdentityCieCardReader.test.tsx
                  OneIdentityCieCardReaderFailure.test.tsx
                  OneIdentityCieCardReaderProgress.test.tsx
                  OneIdentityCieCardReaderProgressContent.test.tsx
                CieCardReadingAnimation.tsx
                CieIdNotInstalled.tsx
                CieRequestAuthenticationOverlay.tsx
                CieWrongPin.tsx
                OneIdentityCieAuthenticationWebView.tsx
                OneIdentityCieAuthorizationWebView.tsx
                OneIdentityCieCardReader.tsx
                OneIdentityCieCardReaderFailure.tsx
                OneIdentityCieCardReaderProgress.tsx
                OneIdentityCieCardReaderProgressContent.tsx
              hooks/
                useCieInfoBottomSheet.tsx
                useCieManager.tsx
              sagas/
                __test__/
                  cie.test.ts
                  trackLevelSecuritySaga.test.ts
                cie.ts
                trackLevelSecuritySaga.ts
              screens/
                __test__/
                  __snapshots__/
                    ActivateNfcScreen.test.tsx.snap
                    CieCardReaderScreenWrapper.test.tsx.snap
                    CieExpiredOrInvalidScreen.test.tsx.snap
                    CieExtendedApduNotSupportedScreen.test.tsx.snap
                    CieIdAuthUrlErrorScreen.test.tsx.snap
                    CieIdErrorScreen.test.tsx.snap
                    CieIdLoginScreen.test.tsx.snap
                    CieIdNotInstalledScreen.test.tsx.snap
                    CiePinScreen.test.tsx.snap
                    CieUnexpectedErrorScreen.test.tsx.snap
                    CieWrongCardScreen.test.tsx.snap
                    wizards.test.tsx.snap
                  ActivateNfcScreen.test.tsx
                  CieCardReaderScreenWrapper.test.tsx
                  CieConsentDataUsageScreen.test.tsx
                  CieExpiredOrInvalidScreen.test.tsx
                  CieExtendedApduNotSupportedScreen.test.tsx
                  CieIdAuthUrlErrorScreen.test.tsx
                  CieIdErrorScreen.test.tsx
                  CieIdLoginScreen.test.tsx
                  CieIdNotInstalledScreen.test.tsx
                  CiePinScreen.test.tsx
                  CieUnexpectedErrorScreen.test.tsx
                  CieWrongCardScreen.test.tsx
                  CieWrongCiePinScreen.test.tsx
                  OneIdentityCieAuthScreen.test.tsx
                  OneIdentityCieIdLoginScreen.test.tsx
                  OneIdentityCiePinScreen.test.tsx
                  wizards.test.tsx
                wizards/
                  CieIdWizard.tsx
                  CiePinWizard.tsx
                  IDActivationWizard.tsx
                  SpidWizard.tsx
                ActivateNfcScreen.tsx
                CieCardReaderScreen.tsx
                CieConsentDataUsageScreen.tsx
                CieExpiredOrInvalidScreen.tsx
                CieExtendedApduNotSupportedScreen.tsx
                CieIdAuthUrlError.tsx
                CieIdErrorScreen.tsx
                CieIdLoginScreen.tsx
                CieIdNotInstalledScreen.tsx
                CiePinScreen.tsx
                CieUnexpectedErrorScreen.tsx
                CieWrongCardScreen.tsx
                CieWrongCiePinScreen.tsx
                OneIdentityCieAuthScreen.tsx
                OneIdentityCieIdLoginScreen.tsx
                OneIdentityCiePinScreen.tsx
              shared/
                LoadingSpinnerOverlay.tsx
              store/
                __test__/
                  cieLoginReducer.test.ts
                  cieReducer.test.ts
                  cieSelectors.test.ts
                actions/
                  cie.ts
                  cieLogin.ts
                  index.ts
                reducers/
                  cie.ts
                  cieLogin.ts
                  index.ts
                selectors/
                  index.ts
              utils/
                cie.ts
                endpoints.ts
                index.ts
            hooks/
              useNavigateToLoginMethod.tsx
            idp/
              components/
                __test__/
                  IdpsGrid.test.tsx
                  OneIdentityIdpSelectionFailureContent.test.tsx
                IdpsGrid.tsx
                OneIdentityIdpSelectionFailureContent.tsx
              hooks/
                __test__/
                  useGetIdps.test.tsx
                  usePosteIDApp2AppEducational.test.tsx
                useGetIdps.ts
                usePosteIDApp2AppEducational.tsx
              screens/
                __test__/
                  __snapshots__/
                    IdpLoginScreen.test.tsx.snap
                    IdpSelectionScreen.test.tsx.snap
                  IdpLoginScreen.test.tsx
                  IdpSelectionScreen.test.tsx
                  OneIdentityIdpLoginScreen.test.tsx
                  OneIdentityIdpSelectionScreen.test.tsx
                IdpLoginScreen.tsx
                IdpSelectionScreen.tsx
                OneIdentityIdpLoginScreen.tsx
                OneIdentityIdpSelectionScreen.tsx
              store/
                __test__/
                  reducer.test.tsx
                actions/
                  index.ts
                reducers/
                  index.ts
                selectors/
                  index.ts
                types/
                  index.ts
              types/
                idps.ts
              utils/
                idps.ts
                spidErrorCode.ts
            landing/
              components/
                LandingSessionExpiredComponent.tsx
              hooks/
                useInfoBottomsheetComponent.tsx
              screens/
                LandingScreen.tsx
            optIn/
              screens/
                OptInScreen.tsx
            unlockAccess/
              components/
                UnlockAccessComponent.tsx
              screens/
                UnlockAccessScreen.tsx
          loginInfo/
            store/
              __test__/
                reducer.test.ts
                selector.test.ts
              reducers/
                index.ts
              selectors/
                index.ts
          playgrounds/
            components/
              SessionSection.tsx
            screens/
              AuthenticationPlayground.tsx
          README.md
        barcode/
          analytics/
            index.ts
          components/
            AnimatedCameraMarker.tsx
            BarcodeScanBaseScreenComponent.tsx
            CameraPermissionView.tsx
          hooks/
            useCameraPermissionStatus.ts
            useIOBarcodeCameraScanner.tsx
            useIOBarcodeFileReader.tsx
          screens/
            BarcodeScanScreen.tsx
          types/
            decoders.ts
            failure.ts
            IOBarcode.ts
          utils/
            barcodeDetectionTask.ts
            getBarcodesByType.ts
            getUniqueBarcodes.ts
            imageDecodingTask.ts
            imageGenerationTask.ts
          index.ts
        bonus/
          __mock__/
            availableBonuses.ts
          cdc/
            activation/
              screens/
                CdcBonusRequestInformationTos.tsx
            analytics/
              index.ts
            common/
              api/
                client.ts
              hooks/
                useSpecialCtaCdc.tsx
              navigation/
                navigator.tsx
                params.ts
                routes.ts
              saga/
                index.ts
              store/
                actions/
                  index.ts
                reducers/
                  index.ts
                selectors/
                  remoteConfig.ts
            wallet/
              components/
                CdcCard.tsx
                CdcWalletCard.tsx
              saga/
                handleGetCdcStatusWallet.ts
                index.ts
              store/
                actions/
                  index.ts
                reducers/
                  index.ts
                selectors/
                  index.ts
          cgn/
            analytics/
              index.ts
            api/
              backendCgn.ts
              backendCgnMerchants.ts
            components/
              detail/
                __test__/
                  CgnCardComponent.test.tsx
                  CgnOwnershipInformation.test.tsx
                  CgnStatusDetail.test.tsx
                  CgnUnsubscribe.test.tsx
                eyca/
                  __test__/
                    EycaDetailComponent.test.tsx
                  EycaDetailComponent.tsx
                  EycaInformationComponent.tsx
                  EycaStatusDetailsComponent.tsx
                CgnOwnershipInformation.tsx
                CgnStatusDetail.tsx
                CgnUnsubscribe.tsx
              merchants/
                discount/
                  ___tests___/
                    CgnDiscountExpireProgressBar.test.tsx
                    CgnDiscountHeader.test.tsx
                  CgnDiscountContent.tsx
                  CgnDiscountExpireProgressBar.tsx
                  CgnDiscountHeader.tsx
                utils/
                  ___tests___/
                    index.test.tsx
                  index.tsx
                CgnAddressListItem.tsx
                CgnMerchantCard.tsx
                CgnMerchantCategoriesSocialLinks.tsx
                CgnMerchantListSkeleton.tsx
                CgnMerchantsDiscountItem.tsx
                CgnMerchantsListView.tsx
                MerchantSearchResultListItem.tsx
                ModuleCgnDiscount.tsx
              CgnAnimatedBackground.tsx
              CgnAnimatedHeader.tsx
              CgnCard.tsx
              CgnCardStatus.tsx
              CgnDiscoveryBanner.tsx
              CgnWalletCard.tsx
            hooks/
              useCgnStyle.tsx
              useCgnUnsubscribe.tsx
              useDisableRootNavigatorGesture.tsx
              useSpecialCtaCgn.tsx
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            saga/
              networking/
                __test__/
                  getEycaStatus.test.ts
                activation/
                  getBonusActivationSaga.ts
                  handleCgnStatusPolling.ts
                bucket/
                  index.ts
                categories/
                  cgnCategoriesSaga.ts
                details/
                  getCgnInformationSaga.ts
                eyca/
                  activation/
                    getActivation.ts
                    getEycaActivationStatus.ts
                    handleEycaActivationSaga.ts
                    handleStartActivation.ts
                  details/
                    getEycaStatus.ts
                merchants/
                  cgnGetMerchantsCountSaga.ts
                  cgnMerchantDetail.ts
                  cgnOfflineMerchantsSaga.ts
                  cgnOnlineMerchantsSaga.ts
                  cgnSearchMerchantsSaga.ts
                otp/
                  index.ts
                unsubscribe/
                  index.ts
              orchestration/
                activation/
                  activationSaga.ts
                  cgnActivationWorker.ts
                  handleActivationSaga.ts
                eyca/
                  eycaActivationSaga.ts
                  eycaActivationWorker.ts
                navigation/
                  actions.ts
              index.ts
            screens/
              __test__/
                CgnDetailScreen.test.tsx
                CgnMerchantSearchScreen.test.tsx
                highlightText.test.ts
              activation/
                CgnActivationCompletedScreen.tsx
                CgnActivationIneligibleScreen.tsx
                CgnActivationLoadingScreen.tsx
                CgnActivationPendingScreen.tsx
                CgnActivationTimeoutScreen.tsx
                CgnAlreadyActiveScreen.tsx
                CgnCTAStartActivationScreen.tsx
                CgnInformationScreen.tsx
              discount/
                ___tests___/
                  __snapshots__/
                    CgnDiscountCodeScreen.test.tsx.snap
                    CgnDiscountDetailScreen.test.tsx.snap
                    CGNDiscountExpiredScreen.test.tsx.snap
                  CgnDiscountCodeScreen.test.tsx
                  CgnDiscountDetailScreen.test.tsx
                  CGNDiscountExpiredScreen.test.tsx
                CgnDiscountCodeScreen.tsx
                CgnDiscountDetailScreen.tsx
                CGNDiscountExpiredScreen.tsx
              eyca/
                activation/
                  EycaActivationLoading.tsx
              merchants/
                CgnMerchantCategoriesListScreen.tsx
                CgnMerchantDetailScreen.tsx
                CgnMerchantLandingWebview.tsx
                CgnMerchantsCategoriesSelectionScreen.tsx
                CgnMerchantSearchScreen.tsx
                CgnMerchantsListByCategory.tsx
                CgnMerchantsListScreen.tsx
              CgnDetailScreen.tsx
            store/
              actions/
                eyca/
                  activation.ts
                  details.ts
                activation.ts
                banners.ts
                bucket.ts
                categories.ts
                details.ts
                index.ts
                merchants.ts
                otp.ts
                unsubscribe.ts
              reducers/
                __test__/
                  otp.test.ts
                eyca/
                  activation.ts
                  details.ts
                  index.ts
                activation.ts
                banners.ts
                bucket.ts
                categories.ts
                details.ts
                index.ts
                merchants.ts
                otp.ts
                unsubscribe.ts
              selectors/
                banners.ts
            types/
              DiscountBucketCodeResponse.ts
            utils/
              __test__/
                dates.test.ts
                eyca.test.ts
                filters.test.ts
                merchants.test.ts
              dates.ts
              eyca.ts
              filters.ts
              merchants.ts
          common/
            components/
              alert/
                ActionWithAlert.ts
              AvailableBonusItem.tsx
              BonusInformationComponent.tsx
              ProgressBar.tsx
              TosBonusComponent.tsx
            store/
              actions/
                availableBonusesTypes.ts
                index.ts
              reducers/
                availableBonusesTypes.ts
                index.ts
              selectors/
                index.ts
            utils/
              index.ts
        common/
          components/
            cie/
              CieCardReadContent.tsx
            IOMarkdown/
              __test__/
                customRules.test.tsx
              customRules.tsx
          store/
            reducers/
              index.ts
          utils/
            cie/
              index.ts
            index.ts
        connectivity/
          api/
            client.ts
          saga/
            index.ts
          store/
            actions/
              index.ts
            reducers/
              index.ts
            selectors/
              index.ts
          utils/
            index.ts
        design-system/
          components/
            DesignSystemScreen.tsx
            DesignSystemSection.tsx
            DSAssetViewerBox.tsx
            DSComponentViewerBox.tsx
            DSFullWidthComponent.tsx
            DSIconViewerBox.tsx
            DSLogoPaymentViewerBox.tsx
            DSSpacerViewerBox.tsx
          core/
            DSAdvice.tsx
            DSAlert.tsx
            DSAnimatedNumericText.tsx
            DSAnimatedPictograms.tsx
            DSBadges.tsx
            DSBonusCardScreen.tsx
            DSBottomSheet.tsx
            DSButtons.tsx
            DSCards.tsx
            DSCollapsible.tsx
            DSColors.tsx
            DSDynamicBackground.tsx
            DSDynamicCardRotation.tsx
            DSEdgeToEdgeArea.tsx
            DSFooterActions.tsx
            DSFooterActionsInline.tsx
            DSFooterActionsInlineNotFixed.tsx
            DSFooterActionsNotFixed.tsx
            DSFooterActionsSticky.tsx
            DSForceScrollDownView.tsx
            DSForceScrollDownViewCustomSlot.tsx
            DSForceScrollDownViewTitleTransition.tsx
            DSFullScreenModal.tsx
            DSHapticFeedback.tsx
            DSHeaderFirstLevel.tsx
            DSHeaderSecondLevel.tsx
            DSHeaderSecondLevelWithSectionTitle.tsx
            DSIcons.tsx
            DSIOListViewWithLargeHeader.tsx
            DSIOMarkdown.tsx
            DSIOScrollView.tsx
            DSIOScrollViewCentredContent.tsx
            DSIOScrollViewWithLargeHeader.tsx
            DSIOScrollViewWithListItems.tsx
            DSIOScrollViewWithoutActions.tsx
            DSIridescentTrustmark.tsx
            DSItwBrandExploration.tsx
            DSLayout.tsx
            DSListItems.tsx
            DSLoaders.tsx
            DSLoadingScreen.tsx
            DSLoadingScreenExtendedProps.tsx
            DSLogos.tsx
            DSModules.tsx
            DSNativeBottomSheet.tsx
            DSNativeBottomSheetContent.tsx
            DSNumberPad.tsx
            DSOTPInput.tsx
            DSPictograms.tsx
            DSSafeArea.tsx
            DSSafeAreaCentered.tsx
            DSScreenEndMargin.tsx
            DSScreenOperationResult.tsx
            DSScreenOperationResultAnimated.tsx
            DSSelection.tsx
            DSServicePreferences.tsx
            DSStepper.tsx
            DSTabNavigation.tsx
            DSTextFields.tsx
            DSToastNotifications.tsx
            DSTypography.tsx
            DSWallet.tsx
          navigation/
            navigator.tsx
            params.ts
            routes.ts
          DesignSystem.tsx
        fci/
          analytics/
            index.ts
          api/
            backendFci.ts
          components/
            DocumentsNavigationBar.tsx
            DocumentViewer.tsx
            DocumentWithSignature.tsx
            LinkedText.tsx
            LoadingComponent.tsx
            QtspClauseListItem.tsx
            SignatureFieldItem.tsx
            SignatureRequestItem.tsx
            SignatureStatusComponent.tsx
            SuccessComponent.tsx
          hooks/
            useFciAbortSignatureFlow.tsx
            useFciCheckService.tsx
            useFciNoSignatureFields.tsx
            useFciSignatureFieldInfo.tsx
          navigation/
            FciStackNavigator.tsx
            params.ts
            routes.ts
          saga/
            networking/
              handleCreateFilledDocument.ts
              handleCreateSignature.ts
              handleDownloadDocument.ts
              handleGetMetadata.ts
              handleGetQtspMetadata.ts
              handleGetSignatureRequestById.ts
              handleGetSignatureRequests.ts
            handleDrawSignatureBox.ts
            index.ts
          screens/
            failure/
              FciDocumentUnavailableScreen.tsx
              FciQtspErrorScreen.tsx
            loginL3/
              FciLoginL3Screen.tsx
              FciNfcNotAvailableScreen.tsx
              LoginOptInScreen.tsx
            valid/
              FciDataSharingScreen.tsx
              FciDocumentPreviewScreen.tsx
              FciDocumentsScreen.tsx
              FciQtspClausesScreen.tsx
              FciSignatureFieldsScreen.tsx
              FciSignatureRequestsScreen.tsx
              FciThankyouScreen.tsx
            FciRouterScreen.tsx
          store/
            actions/
              index.ts
            reducers/
              fciDocumentSignatures.ts
              fciDownloadPreview.ts
              fciEnvironment.ts
              fciMetadata.ts
              fciPollFilledDocument.ts
              fciQtspClauses.ts
              fciQtspFilledDocument.ts
              fciSignature.ts
              fciSignatureFieldDrawing.ts
              fciSignatureRequest.ts
              fciSignaturesList.ts
              index.ts
            selectors/
              fciErrors.ts
              remoteConfig.ts
          types/
            __mocks__/
              CreateFilledDocumentBody.mock.ts
              CreateSignatureBody.mock.ts
              Metadata.mock.ts
              QtspClausesMetadata.mock.ts
              SignatureDetailView.mock.ts
              SignatureRequestDetailView.mock.ts
              SignaturesList.mock.ts
              utils.ts
          utils/
            dates.ts
            errors.ts
            fciHeaders.ts
            signature.ts
            signatureFields.ts
        fims/
          common/
            analytics/
              index.ts
            components/
              FimsUpdateAppAlert.tsx
            hooks/
              __test__/
                index.test.tsx
              index.tsx
            navigation/
              index.tsx
            saga/
              index.ts
            store/
              actions.ts
              reducer.ts
            utils/
              index.ts
          history/
            api/
              client.ts
            components/
              __mocks__/
                FimsHistoryHeaderComponent.tsx
                FimsHistoryListItemPicker.tsx
                FimsHistoryListItems.tsx
                FimsHistoryLoaders.tsx
              FimsHistoryEmptyContent.tsx
              FimsHistoryHeaderComponent.tsx
              FimsHistoryKoScreen.tsx
              FimsHistoryListItemPicker.tsx
              FimsHistoryListItems.tsx
              FimsHistoryLoaders.tsx
              FimsHistoryNonEmptyContent.tsx
            hooks/
              __mocks__/
                useFimsHistoryResultToasts.tsx
              useFimsHistoryResultToasts.tsx
            saga/
              handleExportFimsHistorySaga.ts
              handleGetFimsHistorySaga.ts
              index.ts
            screens/
              HistoryScreen.tsx
            store/
              actions/
                index.ts
              reducer/
                index.ts
              selectors/
                index.ts
            utils/
              styles.ts
          singleSignOn/
            components/
              FimsClaims.tsx
              FimsFullScreenErrors.tsx
              FimsPrivacyInfo.tsx
              FimsSuccessBody.tsx
            saga/
              handleFimsAbortOrCancel.ts
              handleFIMSAcceptedConsents.ts
              handleFimsAuthorizationOrImplicitCodeFlow.ts
              handleFimsGetConsentsList.ts
              index.ts
              sagaUtils.ts
            screens/
              __test__/
                FimsFlowHandlerScreen.test.tsx
              FimsFlowHandlerScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
            utils/
              __test__/
                index.test.ts
              index.ts
        identification/
          analytics/
            index.ts
          components/
            IdentificationNumberPad.tsx
          sagas/
            index.ts
          screens/
            IdentificationLockModal.tsx
            IdentificationModal.tsx
          store/
            actions/
              index.ts
            reducers/
              index.ts
            selectors/
              index.ts
          utils/
            index.tsx
          README.md
        idpay/
          barcode/
            components/
              IdPayBarcodeExpireProgressBar.tsx
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            saga/
              __test__/
                handleGenerateBarcode.test.ts
              handleGenerateBarcode.ts
              handleGenerateStaticCode.ts
              index.ts
            screens/
              IdPayBarcodeResultScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                barcodeReducer.ts
                staticCodeReducer.ts
              selectors/
                index.ts
              types/
                index.ts
            utils.ts
          code/
            components/
              IdPayCodeCieBanner.tsx
              IdPayInfoCieBottomSheet.tsx
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            saga/
              handleIdPayEnrollCode.ts
              handleIdPayGenerateCode.ts
              handleIdPayGetCodeStatus.ts
              index.ts
            screens/
              IdPayCodeDisplayScreen.tsx
              IdPayCodeOnboardingScreen.tsx
              IdPayCodeRenewScreen.tsx
              IdPayCodeResultScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
          common/
            analytics/
              index.ts
            api/
              __mocks__/
                client.ts
              client.ts
            components/
              IdPayDisabledSubFeatureAlert.tsx
              IdPayEnabledFeatureFlagGuard.tsx
              IdPayFeatureFlagGuard.tsx
            hooks/
              useIDPayFailureSupportModal.tsx
              useIDPayStaticCodeModal.tsx
              useIdPaySupportModal.tsx
            machine/
              selectors.ts
              tags.ts
            navigation/
              linking.ts
            saga/
              index.ts
            screens/
              IdPayDisabledScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
            utils/
              strings.ts
            labels.ts
          configuration/
            components/
              IdPayDiscountInstrumentEnrollmentSwitch.tsx
              IdPayInstrumentEnrollmentSwitch.tsx
            machine/
              actions.ts
              actors.ts
              context.ts
              events.ts
              machine.ts
              provider.tsx
              selectors.ts
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            saga/
              handleDeleteInitiativeInstrument.ts
              handleGetInitiativeInstruments.ts
              index.ts
            screens/
              IdPayConfigurationSuccessScreen.tsx
              IdPayDiscountInstrumentsScreen.tsx
              IdPayIbanConfigurationLandingScreen.tsx
              IdPayIbanEnrollmentScreen.tsx
              IdPayIbanOnboardingScreen.tsx
              IdPayInitiativeConfigurationIntroScreen.tsx
              IdPayInstrumentsEnrollmentScreen.tsx
            store/
              actions/
                index.ts
              index.ts
            types/
              failure.ts
              index.ts
          details/
            analytics/
              index.ts
            components/
              IdPayBeneficiaryDetailsContent.tsx
              IdPayInitiativeDiscountSettingsComponent.tsx
              IdPayInitiativeLastUpdateCounter.tsx
              IdPayInitiativeRefundSettingsComponent.tsx
              IdPayInitiativeRulesInfoBox.tsx
              IdPayInitiativeStatusItem.tsx
              IdPayInitiativeTimelineComponent.tsx
              IdPayMissingConfigurationAlert.tsx
              IdPayRemoveFromWalletButton.tsx
              IdPayTimelineOperationListItem.tsx
            hooks/
              useIdPayDiscountDetailsBottomSheet.tsx
              useInitiativeTimelineFetcher.tsx
            navigation/
              index.tsx
            saga/
              __test__/
                handleGetBeneficiaryDetails.test.ts
                handleGetInitiativeDetails.test.ts
                handleGetOnboardingStatus.test.ts
                handleGetTimelinePage.test.ts
              handleGetBeneficiaryDetails.ts
              handleGetInitiativeDetails.ts
              handleGetOnboardingStatus.ts
              handleGetTimelinePage.ts
              index.ts
            screens/
              IdPayBeneficiaryDetailsScreen.tsx
              IdPayInitiativeDetailsScreen.tsx
              IdPayOperationsListScreen.tsx
            store/
              __test__/
                store.test.ts
              actions/
                index.ts
              index.ts
            utils/
              index.tsx
          onboarding/
            analytics/
              index.ts
            components/
              IdPayOnboardingDescriptionSkeleton.tsx
              IdPayOnboardingServiceHeader.tsx
              IdPayOnboardingStepper.tsx
            machine/
              actions.ts
              actors.ts
              context.ts
              events.ts
              machine.ts
              provider.tsx
              selectors.ts
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            screens/
              IdPayBoolValuePrerequisitesScreen.tsx
              IdPayCompletionScreen.tsx
              IdPayEnableMessageScreen.tsx
              IdPayEnableNotificationScreen.tsx
              IdPayFailToRetryScreen.tsx
              IdPayFailureScreen.tsx
              IdPayInitiativeDetailsScreen.tsx
              IdPayInputFormVerificationScreen.tsx
              IdPayLoadingScreen.tsx
              IdPayMultiValuePrerequisitesScreen.tsx
              IdPayPDNDPrerequisitesScreen.tsx
            types/
              OnboardingFailure.ts
            utils/
              markdown.ts
              strings.ts
          payment/
            common/
              types.ts
            machine/
              actions.ts
              actors.ts
              context.ts
              events.ts
              machine.ts
              provider.tsx
              selectors.ts
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            screens/
              IDPayPaymentAuthorizationScreen.tsx
              IDPayPaymentCodeInputScreen.tsx
              IDPayPaymentCodeScanScreen.tsx
              IDPayPaymentResultScreen.tsx
            types/
              PaymentFailure.ts
          timeline/
            components/
              IdPayTimelineDetailsBottomSheet.tsx
              IdPayTimelineDiscountTransactionDetailsComponent.tsx
              IdPayTimelineRefundDetailsComponent.tsx
              IdPayTimelineTransactionDetailsComponent.tsx
            saga/
              handleGetTimelineDetails.ts
              index.ts
            store/
              __test__/
                store.test.ts
              actions/
                index.ts
              index.ts
            utils/
              strings.ts
          unsubscription/
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            saga/
              handleUnsubscribe.ts
              index.ts
            screens/
              IdPayUnsubscriptionConfirmationScreen.tsx
              IdPayUnsubscriptionResultScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
          wallet/
            analytics/
              index.ts
            components/
              IdPayCard.tsx
              IdPayInitiativeWaitingList.tsx
              IdPayInstrumentInitiativesList.tsx
              IdPayWalletCard.tsx
            saga/
              __test__/
                handleGetWallet.test.ts
              handleGetInitiativesFromInstrument.ts
              handleGetInitiativeWaitingList.ts
              handleGetWallet.ts
              handleInitiativeInstrumentDelete.ts
              handleInitiativeInstrumentEnrollment.ts
              index.ts
            screens/
              IdPayInstrumentInitiativesScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                __test__/
                  reducer.test.ts
                index.ts
        ingress/
          __test__/
            __snapshots__/
              IngressScreen.test.tsx.snap
            IngressScreen.test.tsx
          analytics/
            index.ts
          saga/
            index.ts
          screens/
            IngressScreen.tsx
          store/
            actions/
              index.ts
            reducer/
              index.ts
            selectors/
              index.ts
        itwallet/
          analytics/
            properties/
              basePropertyBuilder.ts
              profileProperties.ts
              propertyTypes.ts
              propertyUpdaters.ts
              superProperties.ts
            saga/
              credentialAnalyticsHandlers.ts
              index.ts
            store/
              selectors/
                index.ts
            utils/
              index.ts
              types.ts
            enum.ts
            index.ts
          api/
            __mocks__/
              itWalletClient.ts
            client.ts
          common/
            components/
              discoveryBanner/
                ItwDiscoveryBanner.tsx
                ItwDiscoveryBannerOnboarding.tsx
                ItwDiscoveryBannerStandalone.tsx
              ItwCredentialCard/
                backgroundUtils.ts
                CardBackground.tsx
                CardOverlay.tsx
                config.ts
                DigitalVersionBadge.tsx
                GradientBackground.tsx
                index.tsx
                SkiaCardBackground.tsx
                types.ts
              ItwSkeumorphicCard/
                CardBackground.tsx
                CardClaim.tsx
                CardData.tsx
                CardWidthContext.ts
                ClaimImage.tsx
                ClaimLabel.tsx
                FlipGestureDetector.tsx
                FlippableCard.tsx
                index.tsx
                types.ts
              ItwActivationSuccessFeedbackBanner.tsx
              ItWalletIdLogo.tsx
              ItWalletLogo.tsx
              ItwBrandedBox.tsx
              ItwBrandedSkiaBorder.tsx
              ItwBrandedSkiaGradient.tsx
              ItwCredentialClaim.tsx
              ItwCredentialClaimsCard.tsx
              ItwCredentialDetailCard.tsx
              ItwCredentialMultiClaim.tsx
              ItwCredentialNotFound.tsx
              ItwDataExchangeIcons.tsx
              ItwEidInfoBottomSheetContent.tsx
              ItwEidLifecycleAlert.tsx
              ItwEngagementBanner.tsx
              ItwEnvironmentAlert.tsx
              ItwGenericErrorContent.tsx
              ItwIssuanceMetadata.tsx
              ItwL2EngagementBanner.tsx
              ItwNestedClaimsListItem.tsx
              ItwReissuanceFeedbackBanner.tsx
              ItwRetryableQRCode.tsx
              ItwWalletNotAvailableBanner.tsx
              ItwWalletReadyBanner.tsx
              PoweredByItWalletText.tsx
              RequiresConnectivity.tsx
            hooks/
              useIoWallet.ts
              useItwActivationExitSurveyBottomSheet.tsx
              useItwAuthSourceName.ts
              useItwCredentialExitSurveyBottomSheet.tsx
              useItwCredentialName.ts
              useItwDisableGestureNavigation.ts
              useItwDiscoveryBannerType.ts
              useItwDismissalDialog.tsx
              useItwEidFeedbackBottomSheet.tsx
              useItwEidInvalidBottomSheet.tsx
              useItwEidLifecycleAlertTracking.ts
              useItwFailureSupportModal.tsx
              useItwInfoBottomSheet.tsx
              useItwStatusIconColor.ts
              useItwZendeskSupport.ts
              useLayoutSize.ts
              useNotAvailableToastGuard.ts
              useOfflineAlertDetailModal.tsx
            saga/
              environment.ts
              index.ts
              linking.ts
              offlineAccess.ts
              utils.ts
            store/
              actions/
                banners.ts
                environment.ts
                index.ts
                preferences.ts
                securePreferences.ts
                ui.ts
              reducers/
                banners.ts
                environment.ts
                index.ts
                preferences.ts
                remoteConfig.ts
                securePreferences.ts
                ui.ts
              selectors/
                banners.ts
                environment.ts
                index.ts
                preferences.ts
                remoteConfig.ts
                securePreferences.ts
                ui.ts
                zendesk.ts
            utils/
              constants.ts
              environment.ts
              imageCache.ts
              itwAttestationUtils.ts
              itwClaimsUtils.ts
              itwCredentialIssuanceUtils.ts
              itwCredentialsCatalogueUtils.ts
              itwCredentialStatusAssertionUtils.ts
              itwCredentialStatusUtils.ts
              itwCredentialUtils.ts
              itwCryptoContextUtils.ts
              ItwFailureTypes.ts
              itwFailureUtils.ts
              itwIntegrityUtils.ts
              itwIoWallet.ts
              itwIssuanceUtils.ts
              itwMetadataUtils.ts
              itwMocksUtils.ts
              itwRevocationUtils.ts
              itwSchemaUtils.ts
              itwStoreUtils.ts
              itwStyleUtils.ts
              itwTypesUtils.ts
              linking.ts
              markdown.tsx
              mrtd.ts
              mrtdUrl.ts
              theme.ts
          credentials/
            analytics/
              enum.ts
              index.ts
            hooks/
              useCredentialStatusMessage.ts
            saga/
              checkCredentialsBatchRefill.ts
              checkCredentialsStatusAssertion.ts
              handleItwCredentialsBatchRefillSaga.ts
              handleItwCredentialsConsumeInstanceSaga.ts
              handleItwCredentialsRemoveByTypeSaga.ts
              handleItwCredentialsReplaceByTypeSaga.ts
              handleItwCredentialsStoreBundleSaga.ts
              handleItwCredentialsStoreSaga.ts
              handleItwCredentialsVaultCoherenceSaga.ts
              handleItwCredentialsVaultMigrationSaga.ts
              handleKeyAttestationsCleanUp.ts
              handleWalletCredentialsRehydration.ts
              index.ts
            store/
              actions/
                index.ts
              reducers/
                index.ts
                migrations.ts
              selectors/
                index.ts
            utils/
              format.ts
              vault.ts
          credentialsCatalogue/
            saga/
              fetchCatalogueTranslations.ts
              fetchCredentialsCatalogue.ts
              index.ts
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
          discovery/
            analytics/
              enum.ts
              index.ts
            components/
              ItwDiscoveryBanner.tsx
              ItwDiscoveryInfoComponent.tsx
              ItwDiscoveryInfoFallbackComponent.tsx
              ItwDiscoveryInfoLegacyComponent.tsx
              ItwL2FallbackComponent.tsx
              ItwNfcNotSupportedComponent.tsx
              ItwPrivacyWebViewComponent.tsx
            screens/
              ItwAlreadyActiveScreen.tsx
              ItwDiscoveryInfoScreen.tsx
              ItwDiscoveryLandingScreen.tsx
              ItwIpzsPrivacyScreen.tsx
          identification/
            analytics/
              enum.ts
              index.ts
              types.ts
            cie/
              components/
                ItwCieCardReadFailureContent.tsx
                ItwCieCardReadProgressContent.tsx
                ItwCiePreparationScreenContent.tsx
                ItwCieWebView.tsx
              hooks/
                useCieInfoBottomSheet.tsx
                useCieManager.tsx
                useCieNfcInfoBottomSheet.tsx
              screens/
                ItwActivateNfcScreen.tsx
                ItwCieAuthenticationScreen.tsx
                ItwCieCanScreen.tsx
                ItwCieInternalAuthAndMrtdScreen.tsx
                ItwCiePinScreen.tsx
                ItwCiePreparationCanScreen.tsx
                ItwCiePreparationCardScreen.tsx
                ItwCiePreparationNfcScreen.tsx
                ItwCiePreparationPinScreen.tsx
                ItwIdentificationCieWarningScreen.tsx
              utils/
                constants.ts
                endpoints.ts
                error.ts
                strings.ts
                types.ts
            cieId/
              hooks/
                useCieIdApp.ts
              screens/
                ItwCieIdLoginScreen.tsx
            common/
              components/
                CieIdMethodModule.tsx
                CiePinMethodModule.tsx
                SpidMethodModule.tsx
              hooks/
                useContinueWithBottomSheet.tsx
              saga/
                index.ts
              screens/
                ItwIdentificationModeSelectionScreen.tsx
              store/
                actions/
                  index.ts
                reducers/
                  index.ts
                selectors/
                  index.ts
            spid/
              screens/
                ItwIdentificationIdpSelectionScreen.tsx
                ItwSpidIdpLoginScreen.tsx
          issuance/
            analytics/
              enum.ts
              index.ts
              types.ts
            components/
              ItwCredentialPreviewClaimsCard.tsx
              ItwCredentialPreviewClaimsList.tsx
              ItwRequestedClaimsList.tsx
            hooks/
              useCredentialEventsTracking.ts
              useCredentialIssuanceStatusMessage.ts
              useEidEventsTracking.ts
              useItwSomethingWrongBottomSheet.tsx
            screens/
              ItwIssuanceCredentialAsyncContinuationScreen.tsx
              ItwIssuanceCredentialFailureScreen.tsx
              ItwIssuanceCredentialIntroductionScreen.tsx
              ItwIssuanceCredentialLandingScreen.tsx
              ItwIssuanceCredentialPreviewScreen.tsx
              ItwIssuanceCredentialTrustIssuerScreen.tsx
              ItwIssuanceEidFailureScreen.tsx
              ItwIssuanceEidPreviewScreen.tsx
              ItwIssuanceEidReissuanceLandingScreen.tsx
              ItwIssuanceEidResultScreen.tsx
              ItwIssuanceUpcomingCredentialScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
                migrations.ts
              selectors/
                index.ts
            utils/
              authSourceContacts.ts
          lifecycle/
            analytics/
              enum.ts
              index.ts
            saga/
              checkCurrentWalletInstanceStateSaga.ts
              checkIntegrityServiceReadySaga.ts
              checkWalletInstanceStateSaga.ts
              handleWalletInstanceResetSaga.ts
              index.ts
            screens/
              ItwIdentityNotMatchingScreen.tsx
              ItwLifecycleWalletRevocationScreen.tsx
            store/
              actions/
                index.ts
              selectors/
                index.ts
          machine/
            credential/
              state/
                issuance.ts
              actions.ts
              actors.ts
              context.ts
              events.ts
              failure.ts
              guards.ts
              input.ts
              machine.ts
              provider.tsx
              selectors.ts
              setup.ts
            eid/
              state/
                cieId.ts
                ciePin.ts
                cieWarning.ts
                credentialsUpgrade.ts
                issuance.ts
                mrtdPoP.ts
                spid.ts
                userIdentification.ts
              actions.ts
              actors.ts
              context.ts
              events.ts
              failure.ts
              guards.ts
              input.ts
              machine.ts
              provider.tsx
              selectors.ts
              setup.ts
            upgrade/
              actions.ts
              actors.ts
              context.ts
              events.ts
              failure.ts
              input.ts
              machine.ts
              output.ts
              setup.ts
            utils/
              actors.ts
              deps.ts
              testDeps.ts
            tags.ts
          navigation/
            ItwParamsList.ts
            ItwStackNavigator.tsx
            linking.ts
            routes.ts
          offer/
            screens/
              ItwIssuanceCredentialOfferIntro.tsx
            utils/
              index.ts
          onboarding/
            components/
              AsyncCredentialsCatalogueWrapper.tsx
              ItwOnboardingModuleCredential.tsx
              ItwOnboardingModuleCredentialsList.tsx
            screens/
              ItwCardOnboardingL2Screen.tsx
              ItwCardOnboardingL3Screen.tsx
              WalletCardOnboardingScreen.tsx
          playgrounds/
            components/
              ItwBatchCredentialsSection.tsx
              ItwCardsHeaderSection.tsx
              ItwCardsSection.tsx
              ItwComponentsSection.tsx
              ItwCredentialStatusOverrideSection.tsx
              ItwEnvironmentSection.tsx
              ItwIdentificationScreensSection.tsx
              ItwIso18013Section.tsx
              ItwL3ScreensSection.tsx
              ItwLifecycleSection.tsx
              ItwMiscSection.tsx
              ItwPidIssuanceSection.tsx
              ItwSpecsVersionSection.tsx
              ItwStatusListSection.tsx
            hooks/
              useItwProximityFlow.ts
            mocks/
              proximity.ts
            navigation/
              ItwPlaygroundParamsList.ts
              routes.ts
            screens/
              ItwL3CredentialDetailScreen.tsx
              ItwPlayground.tsx
              ItwProximityPlaygroundScreen.tsx
            utils/
              itwDebugCredentialUtils.ts
          presentation/
            common/
              components/
                ItwClaimsSelector/
                  ClaimItem.tsx
                  index.tsx
                ItwPresentationMissingCredentialsFailureContent.tsx
              hooks/
                useClaimsDetailsBottomSheet.tsx
            details/
              analytics/
                enum.ts
                index.ts
                types.ts
              components/
                ItwDiscoveryInfoBanner.tsx
                ItwPresentationAdditionalInfoSection.tsx
                ItwPresentationAgeVerificationUsageBanner.tsx
                ItwPresentationClaimsSection.tsx
                ItwPresentationCredentialCard.tsx
                ItwPresentationCredentialCardFlipButton.tsx
                ItwPresentationCredentialCardHideValuesButton.tsx
                ItwPresentationCredentialInfoAlert.tsx
                ItwPresentationCredentialStatusAlert.tsx
                ItwPresentationCredentialUnknownStatus.tsx
                ItwPresentationDetailsFooter.tsx
                ItwPresentationDetailsHeader.tsx
                ItwPresentationDetailsScreenBase.tsx
                ItwPresentationFiscalCode.tsx
                ItwPresentationNewCredentialValidityAlert.tsx
                ItwPresentationPidDetail.tsx
                ItwPresentationPidDetailFooter.tsx
                ItwPresentationWalletUpgradeMDLDetailsBanner.tsx
              hooks/
                useItwCopyClaimValue.ts
                useItwDisplayCredentialStatus.tsx
                useItwExpiredDocumentBottomSheet.tsx
                useItwIssuerDynamicErrorBottomSheet.tsx
                useItwRemoveCredentialWithConfirm.tsx
                useItwStartCredentialSupportRequest.tsx
              screens/
                ItwPresentationCredentialAttachmentScreen.tsx
                ItwPresentationCredentialCardModal.tsx
                ItwPresentationCredentialDetailScreen.tsx
                ItwPresentationCredentialFiscalCodeModal.tsx
                ItwPresentationEidVerificationExpiredScreen.tsx
                ItwPresentationPidDetailScreen.tsx
              utils/
                index.ts
            proximity/
              __mocks__/
                credentials.ts
              analytics/
                enum.ts
                index.ts
                types.ts
                utils.ts
              components/
                ItwConsentClaims.tsx
                ItwConsentManagementListItem.tsx
                ItwProximityConnectionLoadingComponent.tsx
                ItwProximityPresentationDetails.tsx
                ItwProximityQrCodeImage.tsx
                ItwProximityQrCodeInfoBanner.tsx
                ItwProximitySendLoadingComponent.tsx
              hooks/
                useItwProximityEventsTracking.ts
              machine/
                state/
                  bluetooth.ts
                  nfc.ts
                  presentment.ts
                actions.ts
                actors.ts
                context.ts
                events.ts
                failure.ts
                guards.ts
                input.ts
                machine.ts
                provider.tsx
                selectors.ts
                setup.ts
                tags.ts
              navigation/
                ItwProximityParamsList.ts
                ItwProximityStackNavigator.tsx
                routes.ts
              screens/
                ItwBluetoothActivationScreen.tsx
                ItwBluetoothPermissionsScreen.tsx
                ItwConsentManagementDetailScreen.tsx
                ItwConsentManagementScreen.tsx
                ItwConsentRevocationSuccessScreen.tsx
                ItwNfcActivationScreen.tsx
                ItwProximityClaimsDisclosureScreen.tsx
                ItwProximityFailureScreen.tsx
                ItwProximityNfcPresentmentScreen.tsx
                ItwProximityPresentmentScreen.tsx
                ItwProximityStoreConsentScreen.tsx
                ItwProximitySuccessScreen.tsx
              store/
                actions/
                  index.ts
                reducers/
                  index.ts
                selectors/
                  consents.ts
                  credentials.ts
                types.ts
                utils.ts
              utils/
                ble.ts
                errors.ts
                nfc.ts
                presentation.ts
                types.ts
            remote/
              analytics/
                utils/
                  index.ts
                  types.ts
                enum.ts
                index.ts
              components/
                ItwRemoteDeepLinkFailure.tsx
                ItwRemoteLoadingScreen.tsx
                ItwRemotePresentationDetails.tsx
              hooks/
                useItwRemoteEventsTracking.ts
                useItwRemoteUntrustedRPBottomSheet.tsx
                useItwSendAuthorizationErrorResponse.tsx
              machine/
                actions.ts
                actors.ts
                context.ts
                events.ts
                failure.ts
                guards.ts
                input.ts
                machine.ts
                provider.tsx
                selectors.ts
                setup.ts
                tags.ts
              navigation/
                ItwRemoteParamsList.ts
                ItwRemoteStackNavigator.tsx
                routes.ts
              screens/
                ItwRemoteAuthResponseScreen.tsx
                ItwRemoteClaimsDisclosureScreen.tsx
                ItwRemoteFailureScreen.tsx
                ItwRemoteRequestValidationScreen.tsx
              utils/
                itwRemotePresentationUtils.ts
                itwRemoteTypeUtils.ts
          settings/
            screens/
              ItwSettingsScreen.tsx
          statusList/
            analytics/
              index.ts
            saga/
              checkStatusListCoherenceSaga.ts
              index.ts
              registerStatusListFetchTaskSaga.ts
              storeItwSpecsVersionSaga.ts
              updateCredentialsStatusSaga.ts
            store/
              selectors/
                index.ts
            tasks/
              index.ts
            utils/
              consts.ts
              errors.ts
              index.ts
              refresh.ts
              repository.ts
              schemas.ts
              storage.ts
              types.ts
              validity.ts
          tour/
            hooks/
              useItwGuidedTour.ts
            utils/
              constants.ts
          trialSystem/
            saga/
              checkFiscalCodeIsEnabledSaga.ts
              handleGetWhitelistedStatus.ts
          trustmark/
            components/
              ItwCredentialTrustmark.tsx
              ItwTrustmarkExpirationTimer.tsx
              ItwTrustmarkQrCode.tsx
            machine/
              state/
                displayingTrustmark.ts
              actions.ts
              actors.ts
              context.ts
              events.ts
              failure.ts
              guards.ts
              input.ts
              machine.ts
              provider.tsx
              selectors.ts
              setup.ts
            screens/
              ItwCredentialTrustmarkScreen.tsx
            utils/
              index.ts
          wallet/
            analytics/
              enum.ts
              index.ts
              types.ts
            components/
              ItwCredentialWalletCard.tsx
              ItwOfflineAccessGate.tsx
              ItwWalletCardsContainer.tsx
              ItwWalletIdCard.tsx
            hooks/
              useAppRestartAction.ts
            screens/
              ItwOfflineWalletScreen.tsx
            utils/
              index.ts
          walletInstance/
            hook/
              useItwWalletInstanceRevocationAlert.ts
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
        landingScreenMultiBanner/
          components/
            __mocks__/
              LandingScreenBannerPicker.tsx
            LandingScreenBannerPicker.tsx
          store/
            actions.ts
            reducer.ts
            selectors.ts
          utils/
            index.ts
            landingScreenBannerMap.tsx
            tracking.ts
        linking/
          actions/
            __test__/
              __snapshots__/
                index.test.ts.snap
              index.test.ts
            index.ts
          analytics/
            __test__/
              index.test.ts
            index.ts
          reducers/
            __test__/
              index.test.ts
            index.ts
          sagas/
            __test__/
              index.test.ts
            index.ts
        lollipop/
          hooks/
            useLollipopLoginSource.tsx
            useOneIdentityLoginSource.tsx
          httpSignature/
            __mocks__/
              mockSigners.ts
            types/
              SignatureAlgorithms.ts
              SignatureComponents.ts
              SignatureConfig.ts
              Signer.ts
            constants.ts
            digest.ts
            signature.ts
          navigation/
            index.ts
          playgrounds/
            LollipopPlayground.tsx
            LollipopPlaygroundContent.tsx
          saga/
            index.ts
          screens/
            UnsupportedDeviceScreen.tsx
          store/
            actions/
              __test__/
                lollipop.test.ts
              lollipop.ts
            reducers/
              lollipop.ts
            index.ts
          types/
            index.ts
            LollipopCheckStatus.ts
          utils/
            crypto.ts
            fetch.ts
            login.ts
          index.ts
        mailCheck/
          analytics/
            index.ts
          navigation/
            CheckEmailNavigator.tsx
          sagas/
            checkAcknowledgedEmailSaga.ts
            checkEmailNotificationPreferencesSaga.ts
            checkEmailSaga.ts
            emailValidationPollingSaga.ts
          screens/
            EmailAlreadyTakenScreen.tsx
            ValidateEmailScreen.tsx
          store/
            actions/
              profileEmailValidationChange.ts
            reducers/
              emailValidation.ts
            selectors/
              emailValidation.ts
        messages/
          __mocks__/
            attachment.ts
            message.ts
            messages.ts
          analytics/
            __test__/
              index.test.ts
            index.ts
          components/
            Home/
              __mocks__/
                PagerViewContainer.tsx
                Preconditions.tsx
                PreconditionsContent.tsx
                SecuritySuggestions.tsx
                TabNavigationContainer.tsx
                Toasts.tsx
              DS/
                __mocks__/
                  ListItemMessage.tsx
                AvatarDouble.tsx
                ListItemMessage.tsx
                ListItemMessageSkeleton.tsx
              ArchiveRestoreBar.tsx
              EmptyList.tsx
              Footer.tsx
              homeUtils.ts
              MessageList.tsx
              PagerViewContainer.tsx
              Preconditions.tsx
              PreconditionsContent.tsx
              PreconditionsFeedback.tsx
              PreconditionsFooter.tsx
              PreconditionsTitle.tsx
              SecuritySuggestions.tsx
              TabNavigationContainer.tsx
              Toasts.tsx
              WrappedListItemMessage.tsx
            MessageAttachment/
              __test__/
                __snapshots__/
                  MessageAttachmentsAlert.test.tsx.snap
                  PdfViewer.test.tsx.snap
                MessageAttachment.test.tsx
                MessageAttachmentsAlert.test.tsx
                PdfViewer.test.tsx
              MessageAttachment.tsx
              MessageAttachmentsAlert.tsx
              PdfViewer.tsx
            MessageDetail/
              __mocks__/
                ContactsListItem.tsx
                MessageDetailsAttachmentItem.tsx
                MessageDetailsAttachments.tsx
                ShowMoreListItem.tsx
              ContactsListItem.tsx
              detailsUtils.ts
              MessageDetailsAttachmentItem.tsx
              MessageDetailsAttachments.tsx
              MessageDetailsBody.tsx
              MessageDetailsFooter.tsx
              MessageDetailsHeader.tsx
              MessageDetailsPayment.tsx
              MessageDetailsReminder.tsx
              MessageDetailsReminderExpiring.tsx
              MessagePaymentItem.tsx
              OrganizationHeader.tsx
              RemoteContentBanner.tsx
              ShowMoreListItem.tsx
            MessageRouter/
              __mocks__/
                MessageRouterScreenErrorComponent.tsx
              MessageRouterScreenErrorComponent.tsx
            Search/
              EmptyList.tsx
            MessageSurveyBanner.tsx
          hooks/
            useAttachmentDownload.ts
            useMessageCalendar.ts
            useMessageDetailsFooterActions.ts
            useMessageReminder.ts
          navigation/
            MessagesNavigator.tsx
            params.ts
            routes.ts
          saga/
            __mocks__/
              commons.ts
            __test__/
              commons.test.ts
              handleClearAttachments.test.ts
              handleDownloadAttachment.test.ts
              handleLoadMessageById.test.ts
              handleLoadMessageData.test.ts
              handleLoadMessageDetails.test.ts
              handleLoadNextPageMessages.test.ts
              handleLoadPreviousPageMessages.test.ts
              handleMessagePrecondition.test.ts
              handlePaymentStatusForAnalyticsTracking.test.ts
              handlePaymentUpdateRequests.test.ts
              handleReloadAllMessages.test.ts
              handleRequestInit.test.ts
              handleThirdPartyMessage.test.ts
              handleUpsertMessageStatusAttribues.test.ts
              index.test.ts
            commons.ts
            handleClearAttachments.ts
            handleDownloadAttachment.ts
            handleLoadMessageById.ts
            handleLoadMessageData.ts
            handleLoadMessageDetails.ts
            handleLoadNextPageMessages.ts
            handleLoadPreviousPageMessages.ts
            handleMessagePrecondition.ts
            handlePaymentStatusForAnalyticsTracking.ts
            handlePaymentUpdateRequests.ts
            handleReloadAllMessages.ts
            handleRequestInit.ts
            handleThirdPartyMessage.ts
            handleUpsertMessageStatusAttributes.ts
            index.ts
          screens/
            MessageAttachmentScreen.tsx
            MessageCalendarScreen.tsx
            MessageDetailsScreen.tsx
            MessageGreenPassScreen.tsx
            MessageRouterScreen.tsx
            MessagesHomeScreen.tsx
            MessagesSearchScreen.tsx
          store/
            actions/
              archiving.ts
              index.ts
              preconditions.ts
            reducers/
              allPaginated/
                automaticMessagesRefresh.ts
                index.ts
                loadNextPage.ts
                loadPreviousPage.ts
                reloadAll.ts
                types.ts
                upsertMessageStatusAttributes.ts
              archiving.ts
              detailsById.ts
              downloads.ts
              index.ts
              messageGetStatus.ts
              messagePrecondition.ts
              messageSectionStatus.ts
              paginatedById.ts
              payments.ts
              thirdPartyById.ts
              transformers.ts
          types/
            __test__/
              paymentErrors.test.ts
            attachmentCategory.ts
            index.ts
            messageListCategory.ts
            paymentErrors.ts
            thirdPartyById.ts
          utils/
            attachments.ts
            convertDateToWordDistance.ts
            ctas.ts
            index.ts
            responseHandling.ts
            strings.ts
            testUtils.tsx
            thirdPartyById.ts
        mixpanel/
          store/
            actions/
              index.ts
            reducer/
              index.ts
            selectors/
              index.ts
        onboarding/
          hooks/
            __test__/
              useOnbardingAbortAlert.test.ts
            useOnboardingAbortAlert.ts
          navigation/
            __test__/
              __snapshots__/
                OnboardingNavigator.test.tsx.snap
              OnboardingNavigator.test.tsx
            params/
              OnboardingParamsList.ts
            OnboardingNavigator.tsx
          saga/
            __test__/
              watchAbortOnboardingSaga.test.ts
            biometric/
              __test__/
                biometricStateSagas.test.ts
                checkAcknowledgedFingerprintSaga.test.ts
              biometricStateSagas.ts
              checkAcknowledgedFingerprintSaga.ts
            completeOnboardingSaga.ts
            watchAbortOnboardingSaga.ts
          screens/
            biometric&securityChecks/
              __test__/
                FingerprintScreen.test.tsx
                MissingDeviceBiometricScreen.test.tsx
                MissingDevicePinScreen.test.tsx
              analytics/
                index.ts
              FingerprintScreen.tsx
              MissingDeviceBiometricScreen.tsx
              MissingDevicePinScreen.tsx
            OnboardingCompletedScreen.tsx
            OnboardingPinScreen.tsx
            OnboardingServicesPreferenceScreen.tsx
            OnboardingShareDataScreen.tsx
            OnboardingTosScreen.tsx
            ServicePreferenceCompleteScreen.tsx
          store/
            __test__/
              index.test.ts
            actions/
              index.ts
            reducers/
              index.ts
            selectors/
              index.ts
          README.md
        osDismission/
          components/
            OsDismissionBanner.tsx
          store/
            selectors/
              index.ts
        pageNotFound/
          analytics/
            index.ts
          screens/
            index.tsx
        payments/
          barcode/
            components/
              PaymentNoticeListItem.tsx
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            screens/
              PaymentsBarcodeChoiceScreen.tsx
              PaymentsBarcodeScanScreen.tsx
          checkout/
            analytics/
              index.ts
            components/
              CheckoutPaymentMethodsList.tsx
              WalletPaymentFailureDetail.tsx
              WalletPaymentFeedbackBanner.tsx
              WalletPaymentHeader.tsx
              WalletPaymentPspBanner.tsx
              WalletPaymentTotalAmount.tsx
              WalletPspListSkeleton.tsx
            hooks/
              useInputFocus.ts
              usePagoPaPayment.ts
              usePaymentFailureSupportModal.tsx
              usePaymentReversedInfoBottomSheet.tsx
              useSortPspBottomSheet.tsx
              useWalletPaymentAuthorizationModal.tsx
              useWalletPaymentGoBackHandler.tsx
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            saga/
              networking/
                handleWalletPaymentAuthorization.ts
                handleWalletPaymentCalculateFees.ts
                handleWalletPaymentCreateTransaction.ts
                handleWalletPaymentDeleteTransaction.ts
                handleWalletPaymentGetAllMethods.ts
                handleWalletPaymentGetContextualOnboardingUrl.ts
                handleWalletPaymentGetDetails.ts
                handleWalletPaymentGetRecentMethod.ts
                handleWalletPaymentGetTransactionInfo.ts
                handleWalletPaymentGetUserWallets.ts
              index.ts
            screens/
              WalletPaymentConfirmScreen.tsx
              WalletPaymentDetailScreen.tsx
              WalletPaymentFailureScreen.tsx
              WalletPaymentInputFiscalCodeScreen.tsx
              WalletPaymentInputNoticeNumberScreen.tsx
              WalletPaymentMakeScreen.tsx
              WalletPaymentOutcomeScreen.tsx
              WalletPaymentPickMethodScreen.tsx
              WalletPaymentPickPspScreen.tsx
              WalletPaymentWebViewScreen.tsx
            store/
              actions/
                index.ts
                networking.ts
                orchestration.ts
              reducers/
                index.ts
              selectors/
                index.ts
                paymentMethods.ts
                psps.ts
                transaction.ts
            tempWorkaround/
              pagoPaPaymentWorkaround.ts
            types/
              index.ts
              PaymentGenericErrorAfterUserCancellationProblemJson.ts
              PaymentOutcomeEnum.ts
              PaymentSlowdownErrorProblemJson.ts
              PaymentVerifyGenericErrorProblemJson.ts
              PspPaymentMethodNotAvailableProblemJson.ts
              WalletPaymentFailure.ts
            utils/
              index.ts
          common/
            api/
              client.ts
            components/
              utils/
                BankLogoOrLoadingSkeleton.tsx
              PaymentCard.tsx
              PaymentCardSmall.tsx
              PaymentListItemInfo.tsx
              PaymentWebView.tsx
            hooks/
              usePaymentsBackoffRetry.tsx
            saga/
              cleanExpiredPaymentsOngoingFailed.ts
              handlePaymentsSessionToken.ts
              handleResumePaymentsPendingActions.ts
              index.ts
            store/
              actions/
                index.ts
              reducers/
                index.ts
                pagoPaPlatformReducer.ts
                paymentsBackoffRetryReducer.ts
              selectors/
                index.ts
            types/
              PaymentAnalytics.ts
              PaymentsBackoffRetry.ts
              UIWalletInfoDetails.ts
            utils/
              __test__/
                index.test.ts
              backoffRetry.ts
              const.ts
              index.ts
              types.ts
              validation.ts
              withPaymentsSessionToken.ts
          details/
            analytics/
              index.ts
            components/
              PaymentsMethodDetailsBaseScreenComponent.tsx
              PaymentsMethodDetailsDeleteButton.tsx
              PaymentsMethodDetailsErrorContent.tsx
              PaymentsMethodDetailsUpdateDataButton.tsx
              PaymentsMethodPspDetailsAlert.tsx
              PaymentsMethodPspDetailsBottomSheet.tsx
              PaymentsMethodPspPayPalBanner.tsx
              WalletDetailsPagoPaPaymentCapability.tsx
              WalletDetailsPaymentMethodFeatures.tsx
              WalletDetailsPaymentMethodInitiatives.tsx
              WalletDetailsPaymentMethodSettings.tsx
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            saga/
              handleDeleteWalletDetails.ts
              handleGetWalletDetails.ts
              handleTogglePagoPaCapability.ts
              index.ts
            screens/
              PaymentsMethodDetailsScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
          history/
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
            types/
              index.ts
          home/
            analytics/
              index.ts
            components/
              PaymentsAlertStatus.tsx
              PaymentsCardsCarousel.tsx
              PaymentsHomeEmptyScreenContent.tsx
              PaymentsHomeTransactionsList.tsx
              PaymentsHomeUserMethodsList.tsx
            screens/
              PaymentsHomeScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
          onboarding/
            analytics/
              index.ts
            components/
              PaymentsOnboardingAuthErrorBottomSheet.tsx
              WalletOnboardingPaymentMethodsList.tsx
              WalletPaymentMethodItemSkeleton.tsx
            hooks/
              useWalletOnboardingWebView.tsx
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            saga/
              handleGetPaymentMethods.ts
              handleStartWalletOnboarding.ts
              index.ts
            screens/
              PaymentsContextualOnboardingWebViewScreen.tsx
              PaymentsOnboardingFeedbackScreen.tsx
              PaymentsOnboardingSelectMethodScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
            types/
              OnboardingOutcomeEnum.ts
            utils/
              index.ts
          receipts/
            analytics/
              index.ts
              utils.ts
            components/
              ___tests___/
                HideReceiptButton.test.tsx
                ReceiptCartList.test.tsx
                ReceiptFeeAmountSection.test.tsx
                ReceiptFilterTabs.test.tsx
                ReceiptHeadingSection.test.tsx
                ReceiptInfoSection.test.tsx
                ReceiptListItemTransaction.test.tsx
                ReceiptLoadingList.test.tsx
                ReceiptTotalAmount.test.tsx
              HideReceiptButton.tsx
              ReceiptCartList.tsx
              ReceiptDivider.tsx
              ReceiptFadeInOutAnimationView.tsx
              ReceiptFeeAmountSection.tsx
              ReceiptFilterTabs.tsx
              ReceiptHeadingSection.tsx
              ReceiptInfoSection.tsx
              ReceiptListItemTransaction.tsx
              ReceiptLoadingList.tsx
              ReceiptSectionListHeader.tsx
              ReceiptTotalAmount.tsx
            hooks/
              useReceiptFailureSupportModal.tsx
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            saga/
              handleDisableReceipt.ts
              handleGetLatestReceipt.ts
              handleGetReceipt.ts
              handleGetReceiptDetails.ts
              handleGetReceiptPdf.ts
              index.ts
            screens/
              ReceiptCartItemDetailsScreen.tsx
              ReceiptDetailsScreen.tsx
              ReceiptDownloadErrorScreen.tsx
              ReceiptListScreen.tsx
              ReceiptPreviewScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
            types/
              index.ts
            utils/
              index.ts
              types.ts
          wallet/
            components/
              PaymentWalletCard.tsx
            saga/
              handleGetPaymentsWalletUserMethods.ts
              index.ts
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
        pn/
          __mocks__/
            pnMessage.ts
          aar/
            analytics/
              index.ts
            api/
              client.ts
            components/
              __mocks__/
                SendAarCieCardReadingComponent.tsx
                SendAarMessageDetailBottomSheet.tsx
                SendAarMessageDetailBottomSheetComponent.tsx
                SendEngagementComponent.tsx
                SendQRScanFlowHandlerComponent.tsx
              errors/
                hooks/
                  useAarGenericErrorBottomSheet.ts
                  useAarStartSendZendeskSupport.ts
                SendAarCieValidationErrorComponent.tsx
                SendAarErrorComponent.tsx
                sendAarErrorSupportBottomSheetComponent.tsx
                SendAarNfcNotSupportedComponent.tsx
                SendAarNotAddresseeKoComponent.tsx
                SendAarPendingDelegationErrorComponent.tsx
              SendAarActivateNfcComponent.tsx
              SendAarCieCardReadingComponent.tsx
              SendAarFeedbackBanner.tsx
              SendAarMessageDetailBottomSheet.tsx
              SendAarMessageDetailBottomSheetComponent.tsx
              SendAarTosComponent.tsx
              SendEngagementComponent.tsx
              SendQRScanFlowHandlerComponent.tsx
            hooks/
              useCieInternalAuthAndMrtdReading.ts
              useIsNfcFeatureAvailable.tsx
              useIsNfcFeatureEnabled.ts
              useSendAarDelegationProposalScreenBottomSheet.tsx
              useSendAarFlowManager.tsx
              useTrackCieReadingEvents.ts
            saga/
              createAarMandateSaga.ts
              downloadAarAttachmentSaga.ts
              fetchNotificationDataSaga.ts
              fetchQrCodeSaga.ts
              initiateAarFlowSaga.ts
              testSendNisMrtdSaga.ts
              validateMandateSaga.ts
              watchAarFlowSaga.ts
            screen/
              SendAarActivateNfcScreen.tsx
              SendAarCanEducationalScreen.tsx
              SendAarCieCanInsertionScreen.tsx
              SendAarCieCardReadingEducationalScreen.tsx
              SendAarCieCardReadingScreen.tsx
              SendAarDelegationProposalScreen.tsx
              SendAarErrorScreen.tsx
              SendAarInitialFlowScreen.tsx
              SendEngagementScreen.tsx
              SendQRScanFlowScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
                tempAarMandate.ts
              selectors/
                index.ts
            utils/
              aarErrorMappings.ts
              deepLinking.ts
              stateUtils.ts
              testUtils.ts
          analytics/
            __test__/
              activationReminderBanner.test.ts
              index.test.ts
              send.test.ts
            activationReminderBanner.ts
            index.ts
            send.ts
          api/
            client.ts
          components/
            __mocks__/
              F24ListBottomSheetLink.tsx
              F24Section.tsx
              MessageBottomMenu.tsx
              MessageCancelledContent.tsx
              MessageDetails.tsx
              MessageDetailsContent.tsx
              MessagePaymentBottomSheet.tsx
              MessagePayments.tsx
              NeedHelp.tsx
              Timeline.tsx
              TimelineListItem.tsx
            __test__/
              __snapshots__/
                BannerAttachments.test.tsx.snap
                F24ListBottomSheetLink.test.tsx.snap
                F24Section.test.tsx.snap
                MessageBottomMenu.test.tsx.snap
                MessageCancelledContent.test.tsx.snap
                MessageDetailsContent.test.tsx.snap
                MessagePaymentBottomSheet.test.tsx.snap
                MessagePayments.test.tsx.snap
                NeedHelp.test.tsx.snap
                Timeline.test.tsx.snap
                TimelineListItem.test.tsx.snap
              BannerAttachments.test.tsx
              F24ListBottomSheetLink.test.tsx
              F24Section.test.tsx
              MessageBottomMenu.test.tsx
              MessageCancelledContent.test.tsx
              MessageDetails.test.tsx
              MessageDetailsContent.test.tsx
              MessagePaymentBottomSheet.test.tsx
              MessagePayments.test.tsx
              NeedHelp.test.tsx
              Timeline.test.tsx
              TimelineListItem.test.tsx
            BannerAttachments.tsx
            F24ListBottomSheetLink.tsx
            F24Section.tsx
            MessageBottomMenu.tsx
            MessageCancelledContent.tsx
            MessageDetails.tsx
            MessageDetailsContent.tsx
            MessagePaymentBottomSheet.tsx
            MessagePayments.tsx
            NeedHelp.tsx
            Timeline.tsx
            TimelineListItem.tsx
          hooks/
            useMessageFooterActions.ts
            usePnPreferencesFetcher.ts
            useSpecialCtaPn.ts
          loginEngagement/
            hooks/
              useSendActivationBottomSheet.tsx
              useSendActivationFlow.tsx
              useSendAreYouSureBottomSheet.tsx
            sagas/
              checkShouldDisplaySendEngagementScreen.ts
            screens/
              SendActivationErrorScreen.tsx
              SendEngagementOnFirstAppOpenScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
          lollipopLambda/
            api/
              index.ts
            saga/
              index.ts
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
          navigation/
            navigator.tsx
            params.ts
            routes.ts
          reminderBanner/
            components/
              __test__/
                __snapshots__/
                  PNActivationReminderBanner.test.tsx.snap
                  PnBannerFlowComponents.test.tsx.snap
                PNActivationReminderBanner.test.tsx
                PnBannerFlowComponents.test.tsx
              PNActivationReminderBanner.tsx
              PnBannerFlowComponents.tsx
            reducer/
              __test__/
                __snapshots__/
                  bannerDismiss.test.ts.snap
                bannerDismiss.test.ts
              bannerDismiss.ts
            screens/
              __test__/
                __snapshots__/
                  PnReminderBannerFlow.test.tsx.snap
                PnReminderBannerFlow.test.tsx
              PnReminderBannerFlow.tsx
          screens/
            __test__/
              __snapshots__/
                MessageDetailsScreen.test.tsx.snap
                PaidPaymentScreen.test.tsx.snap
              MessageDetailsScreen.test.tsx
              PaidPaymentScreen.test.tsx
            MessageAttachmentScreen.tsx
            MessageDetailsScreen.tsx
            PaidPaymentScreen.tsx
          store/
            actions/
              index.ts
            reducers/
              __test__/
                __snapshots__/
                  index.test.ts.snap
                activation.test.ts
                index.test.ts
                payments.test.ts
              activation.ts
              index.ts
              payments.ts
            sagas/
              watchPaymentStatusSaga.ts
              watchPnSaga.ts
            types/
              __test__/
                transformers.test.ts
                types.test.ts
              transformers.ts
              types.ts
          utils/
            index.ts
            rptId.ts
        profileSettings/
          store/
            reducers/
              index.ts
        pushNotifications/
          analytics/
            index.ts
          components/
            NotificationPreviewSample.tsx
            NotificationsPreferencesPreview.tsx
            ProfileNotificationsSettings.tsx
            PushNotificationsBanner.tsx
          hooks/
            useEngagementScreen.tsx
            usePreviewMoreInfo.tsx
            usePushNotificationEngagement.tsx
            usePushNotificationsBannerTracking.tsx
          navigation/
            routes.ts
          sagas/
            common.ts
            notificationPermissionsListener.ts
            profileAndSystemNotificationsPermissions.ts
            pushNotificationTokenUpload.ts
          screens/
            OnboardingNotificationsInfoScreenConsent.tsx
            OnboardingNotificationsPreferencesScreen.tsx
            PushNotificationEngagementScreen.tsx
            SystemNotificationPermissionsScreen.tsx
          store/
            actions/
              environment.ts
              installation.ts
              pendingMessage.ts
              profileNotificationPermissions.ts
              userBehaviour.ts
            reducers/
              environment.ts
              index.ts
              installation.ts
              pendingMessage.ts
              userBehaviour.ts
            selectors/
              index.ts
              notificationsBannerDismissed.ts
          utils/
            configurePushNotification.ts
            index.ts
            navigation.ts
            pushNotificationHandlers.ts
        services/
          common/
            analytics/
              index.ts
            components/
              CardPressableBase.tsx
              EmptyState.tsx
              ListItemSearchInstitution.tsx
              ServiceContactListItem.tsx
              ServiceListSkeleton.tsx
              ServicesHeader.tsx
              ServicesHeaderSection.tsx
            hooks/
              useFirstRender.ts
            navigation/
              navigator.tsx
              params.ts
              routes.ts
            saga/
              getServiceDetails.ts
              index.ts
              specialServicePreferencesSaga.ts
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                remoteConfig.ts
            utils/
              index.ts
              serviceContactMap.ts
          details/
            components/
              CardWithMarkdownContent.tsx
              FavouriteServiceButton.tsx
              ServiceDetailsFailure.tsx
              ServiceDetailsMetadata.tsx
              ServiceDetailsPreferences.tsx
              ServiceDetailsScreenCdc.tsx
              ServiceDetailsScreenCgn.tsx
              ServiceDetailsScreenComponent.tsx
              ServiceDetailsScreenDefault.tsx
              ServiceDetailsScreenPn.tsx
              ServiceDetailsTosAndPrivacy.tsx
            hooks/
              useServicePreference.ts
            saga/
              handleGetServicePreference.ts
              handleServiceDetails.ts
              handleUpsertServicePreference.ts
              index.ts
            screens/
              ServiceDetailsScreen.tsx
            store/
              actions/
                details.ts
                preference.ts
              reducers/
                index.ts
              selectors/
                index.ts
            types/
              index.tsx
              ServicePreferenceResponse.ts
            utils/
              index.ts
          favouriteServices/
            __mocks__/
              favouriteServicesMocks.ts
            hooks/
              useSortFavouriteServicesBottomSheet.tsx
            saga/
              handleAddFavouriteService.ts
              handleSyncFavouriteService.ts
              index.ts
            screens/
              FavouriteServicesScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
            types/
              index.tsx
          fseDiscoveryBanner/
            components/
              FseDiscoveryBanner.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
          home/
            components/
              EmailNotificationBanner.tsx
              FeaturedInstitutionCard.tsx
              FeaturedInstitutionList.tsx
              FeaturedInstitutionsCarousel.tsx
              FeaturedServiceCard.tsx
              FeaturedServiceList.tsx
              FeaturedServicesCarousel.tsx
              InstitutionList.tsx
              InstitutionListItem.tsx
            hooks/
              useInstitutionsFetcher.tsx
              useServiceCardStyle.tsx
              useServicesHomeBottomSheet.tsx
            saga/
              handleFindInstitutions.ts
              handleGetFeaturedInstitutions.ts
              handleGetFeaturedServices.ts
              index.ts
            screens/
              ServicesHomeScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
            utils/
              index.ts
          institution/
            components/
              InstitutionServicesFailure.tsx
            hooks/
              useServicesFetcher.tsx
            saga/
              handleFindInstitutionServices.ts
              index.ts
            screens/
              InstitutionServicesScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
          search/
            hooks/
              useInstitutionsFetcher.tsx
            saga/
              handleFindInstitutions.ts
              index.ts
            screens/
              SearchScreen.tsx
            store/
              actions/
                index.ts
              reducers/
                index.ts
              selectors/
                index.ts
        settings/
          aboutApp/
            __test__/
              __snapshots__/
                ProfileAboutApp.test.tsx.snap
              ProfileAboutApp.test.tsx
            screens/
              ProfileAboutApp.tsx
          common/
            analytics/
              __test__/
                index.test.ts
                mixpanelAnalytics.test.ts
              mixpanel/
                mixpanelAnalytics.ts
              index.ts
            components/
              ProfileMainScreenTopBanner.tsx
            navigation/
              __test__/
                __snapshots__/
                  SettingsNavigator.test.tsx.snap
                SettingsNavigator.test.tsx
              params/
                SettingsParamsList.ts
              routes.ts
              SettingsNavigator.tsx
            sagas/
              profile.ts
              userDataProcessing.ts
            screens/
              LogoutScreen.tsx
              ProfileMainScreen.tsx
            store/
              actions/
                index.ts
                userDataProcessing.ts
              reducers/
                index.ts
                userDataProcessing.ts
              selectors/
                index.ts
                userDataProcessing.ts
              types/
                index.ts
              utils/
                guards.ts
          devMode/
            components/
              __test__/
                DeveloperModeSection.test.tsx
              DeveloperModeSection.tsx
              ExperimentalDesignEnableSwitch.tsx
            playgrounds/
              Cie/
                components/
                  ReadStatusComponent.tsx
                navigation/
                  CiePlaygroundsNavigator.tsx
                  CiePlaygroundsParamsList.ts
                  routes.ts
                screens/
                  CieAttributesScreen.tsx
                  CieAuthenticationScreen.tsx
                  CieCertificateScreen.tsx
                  CieInternalAuthMrtdScreen.tsx
                  CieInternalAuthScreen.tsx
                  CieMrtdScreen.tsx
                  CiePlaygrounds.tsx
                  CieResultScreen.tsx
                types/
                  ReadStatus.ts
                utils/
                  encoding.ts
              AppFeedbackPlayground.tsx
              BottomSheetPlayground.tsx
              CgnLandingPlayground.tsx
              GuidedTourPlayground.tsx
              IdPayCodePlayground.tsx
              IdPayOnboardingPlayground.tsx
              IOMarkdownPlayground.tsx
              IOMarkdownSuggestions.tsx
              NfcPlayground.tsx
              SendPlaygroundScreen.tsx
          preferences/
            screens/
              AppearancePreferenceScreen.tsx
              CalendarsPreferencesScreen.tsx
              EmailForwardingScreen.tsx
              LanguagesPreferencesScreen.tsx
              NotificationsPreferencesScreen.tsx
              PreferencesScreen.tsx
              ServicesPreferenceScreen.tsx
            shared/
              __test__/
                __snapshots__/
                  useManualConfigBottomSheet.test.tsx.snap
                ServicesContactComponent.test.tsx
                useManualConfigBottomSheet.test.tsx
              components/
                ServicesContactComponent.tsx
              hooks/
                useManualConfigBottomSheet.tsx
          privacy/
            components/
              __test__/
                TosWebviewErrorComponent.test.tsx
              TosWebviewErrorComponent.tsx
            screens/
              DownloadProfileDataScreen.tsx
              PrivacyMainScreen.tsx
              RemoveAccountDetailsScreen.tsx
              RemoveAccountInfoScreen.tsx
              RemoveAccountSuccessScreen.tsx
              ShareDataScreen.tsx
              TosScreen.tsx
            shared/
              analytics/
                __test__/
                  analytics.test.ts
                index.ts
              components/
                __test__/
                  __snapshots__/
                    TosWebviewComponent.test.tsx.snap
                  ShareDataComponent.test.tsx
                  TosWebviewComponent.test.tsx
                ShareDataComponent/
                  index.tsx
                  ShareDataFeatureInfos.tsx
                TosWebviewComponent.tsx
              hooks/
                useConfirmOptOutBottomSheet.tsx
          security/
            components/
              PinCarouselItem.tsx
            hooks/
              __test__/
                __snapshots__/
                  useCreatePin.test.tsx.snap
                useCreatePin.test.tsx
              useCreatePin.tsx
              usePinValidationBottomSheet.tsx
            screens/
              PinScreen.tsx
              SecurityScreen.tsx
            shared/
              analytics/
                __test__/
                  analytics.test.ts
                index.ts
              components/
                PinCreation.tsx
            store/
              actions/
                pinset.ts
          userData/
            components/
              __test__/
                __snapshots__/
                  CountdownComponent.test.tsx.snap
                CountdownComponent.test.tsx
              CountdownComponent.tsx
            screens/
              FiscalCodeScreen.tsx
              ProfileDataScreen.tsx
            shared/
              __test__/
                EmailInsertScreen.test.tsx
                EmailValidationSendEmailScreen.test.tsx
              screens/
                EmailInsertScreen.tsx
                EmailValidationSendEmailScreen.tsx
          README.md
        startup/
          analytics/
            index.ts
          sagas/
            index.ts
          screens/
            errors/
              GetProfileEndpointTransientError.tsx
              GetSessionEndpointTransientError.tsx
        tos/
          store/
            selectors/
              index.ts
          index.ts
        tour/
          analytics/
            index.ts
          components/
            GuidedTour.tsx
            TourOverlay.tsx
            TourProvider.tsx
            TourStepIndicator.tsx
            TourTooltip.tsx
            useGuidedTourRegion.ts
          sagas/
            index.ts
          store/
            actions/
              index.ts
            reducers/
              index.ts
            selectors/
              index.ts
          types/
            index.ts
        utmLink/
          analytics/
            index.ts
          saga/
            index.ts
          store/
            actions/
              index.ts
            reducers/
              index.ts
            selectors/
              index.ts
          index.ts
        wallet/
          components/
            WalletCardBaseComponent.tsx
            WalletCardPressableBase.tsx
            WalletCardsCategoryContainer.tsx
            WalletCardsCategoryRetryErrorBanner.tsx
            WalletCardsContainer.tsx
            WalletCardSkeleton.tsx
            WalletCategoryFilterTabs.tsx
            WalletEmptyScreenContent.tsx
          saga/
            handleRemoveMissingCards.ts
            handleWalletAnalyticsSaga.ts
            handleWalletLoadingPlaceholdersTimeout.ts
            handleWalletLoadingStateSaga.ts
            handleWalletUpdateSaga.ts
            index.ts
          screens/
            WalletHomeScreen.tsx
          store/
            actions/
              cards.ts
              index.ts
              placeholders.ts
              preferences.ts
            reducers/
              cards.ts
              index.ts
              placeholders.ts
              preferences.ts
            selectors/
              index.ts
          types/
            index.ts
          utils/
            index.tsx
        whatsnew/
          analytics/
            index.ts
          store/
            actions/
              index.ts
            reducers/
              index.ts
          versions.ts
        zendesk/
          analytics/
            index.ts
          navigation/
            navigator.tsx
            params.ts
            routes.ts
          saga/
            networking/
              handleGetZendeskConfig.ts
              handleGetZendeskPaymentConfig.ts
              handleHasOpenedTickets.ts
            orchestration/
              index.ts
            index.ts
          screens/
            RequestZandeskTokenErrorScreen.tsx
            ZendeskAskPermissions.tsx
            ZendeskAskSeeReportsPermissions.tsx
            ZendeskChooseCategory.tsx
            ZendeskChooseSubCategory.tsx
            ZendeskPanicMode.tsx
            ZendeskSeeReportsRouters.tsx
            ZendeskSupportHelpCenter.tsx
          store/
            actions/
              index.ts
            reducers/
              index.ts
          utils/
            index.ts
      hooks/
        useAnimationPlayback.ts
        useAppStateActive.ts
        useAppThemeConfiguration.tsx
        useBottomTabNavigatorStyle.ts
        useConfirmationChecks.ts
        useDebouncedValue.ts
        useDebugInfo.ts
        useDetectSmallScreen.ts
        useFooterActionsMargin.tsx
        useHardwareBackButton.ts
        useHeaderFirstLevel.tsx
        useHeaderFirstLevelActionPropHelp.ts
        useHeaderFirstLevelActionPropSettings.ts
        useHeaderProps.tsx
        useHeaderSecondLevel.tsx
        useIsScreenFocused.ts
        useOfflineToastGuard.ts
        useOpenDeepLink.ts
        useReduceMotionEnabled.ts
        useRotationSensor.ts
        useScreenEndMargin.tsx
        useScrollHeaderAnimation.tsx
        useSecuritySuggestionBottomSheet.tsx
        useStartSupportRequest.ts
        useStatusAlertProps.tsx
        useTabItemPressWhenScreenActive.tsx
      mixpanelConfig/
        ___tests___/
          mixpanelPropertyUtils.test.tsx
          profileProperties.test.ts
          superProperties.test.ts
        mixpanelPropertyUtils.ts
        profileProperties.ts
        superProperties.ts
      navigation/
        __test__/
          __snapshots__/
            AppStackNavigator.test.tsx.snap
          AppStackNavigator.test.tsx
          linkingSubscription.test.ts
          navigationSagas.test.ts
        analytics/
          navigation.ts
        components/
          CloseButton.tsx
        params/
          AppParamsList.ts
          CheckEmailParamsList.ts
          MainTabParamsList.ts
        saga/
          navigation.ts
        AppStackNavigator.tsx
        AuthenticatedStackNavigator.tsx
        IngressStackNavigator.tsx
        linkingSubscription.ts
        NavigationService.ts
        NotAuthenticatedStackNavigator.tsx
        OfflineStackNavigator.tsx
        routes.ts
        TabNavigator.tsx
        theme.ts
      sagas/
        commons/
          index.ts
        services/
          servicesOptinSaga.ts
        startup/
          appVersionHistorySaga.ts
          checkAcceptedTosSaga.ts
          checkConfiguredPinSaga.ts
          checkItWalletIdentitySaga.ts
          checkProfileEnabledSaga.ts
          watchApplicationActivitySaga.ts
        workUnit/
          index.ts
        backendStatus.ts
        backgroundActions.ts
        contentLoaders.ts
        index.ts
        installation.ts
        mixpanel.ts
        preferences.ts
        removePersistedStates.ts
        startup.diagram.README.md
        startup.ts
      screens/
        modal/
          __test__/
            RootModal.test.tsx
          analytics/
            index.ts
          RootedDeviceModal.tsx
          RootModal.tsx
          SystemOffModal.tsx
          UpdateAppModal.tsx
      store/
        actions/
          analytics.ts
          application.ts
          backendStatus.ts
          calendarEvents.ts
          content.ts
          crossSessions.ts
          debug.ts
          installation.ts
          mixpanel.ts
          navigation.ts
          persistedPreferences.ts
          preferences.ts
          search.ts
          startup.ts
          types.ts
        helpers/
          indexer.ts
        middlewares/
          analytics.ts
          contentAnalytics.ts
          index.ts
          navigation.ts
        reducers/
          __mock__/
            backendStatus.ts
            idps.ts
          backendStatus/
            backendInfo.ts
            remoteConfig.ts
            sectionStatus.ts
            statusMessages.ts
          entities/
            calendarEvents/
              calendarEventsByMessageId.ts
              index.ts
            index.ts
            payments.ts
          appState.ts
          assistanceTools.ts
          content.ts
          crossSessions.ts
          debug.ts
          featureFlagWithMinAppVersionStatus.ts
          index.ts
          IndexedByIdPot.ts
          installation.ts
          persistedPreferences.ts
          preferences.ts
          search.ts
          startup.ts
          types.ts
        storages/
          keychain.ts
          secureStorage.ts
        transforms/
          dateISO8601Tranform.ts
          potTransform.ts
          setTransform.ts
        hooks.ts
      types/
        helpers.ts
        LocalizedCTAs.ts
        MunicipalityCodiceCatastale.ts
        pagopa.ts
        paymentMethodCapabilities.ts
        PinString.ts
        utils.ts
        WithTestID.ts
      utils/
        __mocks__/
          municipality.ts
          paypalAccountPsp.ts
          platform.ts
        hooks/
          bottomSheet.tsx
          useBiometricType.ts
          useModalStyle.tsx
          useOnFirstRender.ts
          useOnFocus.tsx
          usePreventScreenCapture.ts
          usePrevious.ts
        jest/
          withStore.tsx
        accessibility.ts
        analytics.ts
        api.ts
        appSettings.ts
        appVersion.ts
        assert.ts
        biometrics.ts
        brightness.ts
        calendar.ts
        card.ts
        clipboard.ts
        constants.ts
        contextualHelp.ts
        creditCard.ts
        dates.ts
        deepLinkUtils.ts
        device.ts
        environment.ts
        errors.ts
        failureReason.ts
        featureRollout.ts
        fetch.ts
        guards.ts
        hash.ts
        highlightSearchText.tsx
        idps.ts
        image.ts
        input.ts
        internalLink.ts
        keyboard.tsx
        keychain.ts
        locale.ts
        markdown.ts
        navigation.ts
        nfc.ts
        number.ts
        object.ts
        openMaps.ts
        options.ts
        payment.ts
        paymentMethodCapabilities.ts
        paypal.ts
        permission.ts
        platform.ts
        pmLookUpId.ts
        pot.ts
        profile.ts
        reporters.ts
        SessionManager.ts
        share.ts
        stringBuilder.ts
        strings.ts
        supportAssistance.ts
        testAccessibility.tsx
        tests.ts
        testWrapper.tsx
        timer.ts
        url.ts
        useAvoidHardwareBackButton.ts
        wallet.ts
        walletv2.ts
        webview.ts
      App.tsx
      config.ts
      i18n.ts
      images.d.ts
      mixpanel.ts
      RootContainer.tsx
      svg.d.ts
      urls.ts
    .oxlintrc.jsonc
    .ruby-version
    babel.config.js
    CHANGELOG.md
    eslint.config.mjs
    Gemfile
    index.js
    jest.config.js
    jestAfterEnvSetup.js
    jestGlobalSetup.js
    jestSetup.js
    metro.config.js
    react-native.config.js
    README.md
docs/
  messages/
    add-remove-reminder.puml
    load-next-page-message-list.puml
    messages-autorefresh.puml
    view-message-list.puml
  wallet/
    routes.puml
    saga.puml
    states.puml
.node-version
.oxlintrc.jsonc
AGENTS.md
CODE_OF_CONDUCT.md
CODEOWNERS
CODING_STANDARDS.md
CONTRIBUTING.md
eslint.config.mjs
jest.config.ts
jest.preset.js
knip.jsonc
LICENSE
README.md
</directory_structure>

<files>
This section contains the contents of the repository's files.

<file path="apps/dev-api-server/scratch/payments">
{"payments":[]}
</file>

<file path="apps/dev-api-server/scratch/wallets">
{"wallets":[{"idWallet":1111,"type":"CREDIT_CARD","favourite":false,"creditCard":{"id":1464,"holder":"Mario Rossi","pan":"************1111","expireMonth":"05","expireYear":"22","brand":"MASTERCARD","brandLogo":"https://wisp2.pagopa.gov.it/wallet/assets/img/creditcard/carta_mc.png","flag3dsVerified":true},"psp":{"id":1713323,"idPsp":"UNCRITMM","businessName":"UniCredit S.p.A","paymentType":"CP","idIntermediary":"00348170101","idChannel":"00348170101_01_ONUS","logoPSP":"https://wisp2.pagopa.gov.it/pp-restapi/v2/resources/psp/1713322","serviceLogo":"https://wisp2.pagopa.gov.it/pp-restapi/v2/resources/service/1713322","serviceName":"Pagamento con carte","fixedCost":{"currency":"EUR","amount":95,"decimalDigits":2},"appChannel":false,"tags":["VISA","MASTERCARD","MAESTRO"],"serviceDescription":"Il Servizio consente di effettuare pagamenti con carte emesse a valere sui circuiti VISA, MASTERCARD,MAESTRO","serviceAvailability":"Il Servizio è disponibile on line h24, 7 giorni su 7. Sono consentite operazioni di pagamento fino ad un limite massimo di € 1000 ciascuna","urlInfoChannel":"https://www.unicredit.it/it/privati.html","paymentModel":1,"flagStamp":false,"idCard":2535,"lingua":"EN","codiceAbi":"02008","isPspOnus":true},"idPsp":1713323,"pspEditable":true,"lastUsage":"2018-08-07T15:50:08.000Z"},{"idWallet":2222,"type":"CREDIT_CARD","favourite":true,"creditCard":{"id":1464,"holder":"Mario Rossi","pan":"************2222","expireMonth":"05","expireYear":"22","brand":"MAESTRO","brandLogo":"https://wisp2.pagopa.gov.it/wallet/assets/img/creditcard/carta_maestro.png","flag3dsVerified":true},"psp":{"id":1713323,"idPsp":"UNCRITMM","businessName":"UniCredit S.p.A","paymentType":"CP","idIntermediary":"00348170101","idChannel":"00348170101_01_ONUS","logoPSP":"https://wisp2.pagopa.gov.it/pp-restapi/v2/resources/psp/1713322","serviceLogo":"https://wisp2.pagopa.gov.it/pp-restapi/v2/resources/service/1713322","serviceName":"Pagamento con carte","fixedCost":{"currency":"EUR","amount":95,"decimalDigits":2},"appChannel":false,"tags":["VISA","MASTERCARD","MAESTRO"],"serviceDescription":"Il Servizio consente di effettuare pagamenti con carte emesse a valere sui circuiti VISA, MASTERCARD,MAESTRO","serviceAvailability":"Il Servizio è disponibile on line h24, 7 giorni su 7. Sono consentite operazioni di pagamento fino ad un limite massimo di € 1000 ciascuna","urlInfoChannel":"https://www.unicredit.it/it/privati.html","paymentModel":1,"flagStamp":false,"idCard":2535,"lingua":"EN","codiceAbi":"02008","isPspOnus":true},"idPsp":1713323,"pspEditable":true,"lastUsage":"2018-08-07T15:50:08.000Z"}]}
</file>

<file path="apps/dev-api-server/src/features/cdc/persistence/index.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { CitizenStatus } from "@io-app/api-types/generated/definitions/cdc/CitizenStatus";
</file>

<file path="apps/dev-api-server/src/features/cdc/routers/index.ts">

</file>

<file path="apps/dev-api-server/src/features/cdc/routers/router.ts">
import { Request, Response, Router } from "express";
⋮----
import { addHandler, SupportedMethod } from "../../../payloads/response";
⋮----
const addCdcPrefix = (path: string) => `$
⋮----
export const addCdcHandler = (
  method: SupportedMethod,
  path: string,
  handleRequest: (request: Request, response: Response) => void
)
</file>

<file path="apps/dev-api-server/src/features/cdc/routers/status.ts">
import { handleLeftEitherIfNeeded } from "../../../utils/error";
import { getCdcStatus } from "../services/statusService";
import { addCdcHandler } from "./router";
</file>

<file path="apps/dev-api-server/src/features/cdc/services/statusService.ts">
import { CitizenStatus } from "@io-app/api-types/generated/definitions/cdc/CitizenStatus";
import { Either, left, right } from "fp-ts/lib/Either";
⋮----
import { ioDevServerConfig } from "../../../config";
import { getProblemJson } from "../../../payloads/error";
import { ExpressFailure } from "../../../utils/expressDTO";
import { CDC_CURRENT_STATUS } from "../persistence";
⋮----
export const getCdcStatus = (): Either<ExpressFailure, CitizenStatus> =>
</file>

<file path="apps/dev-api-server/src/features/cgn/utils/index.ts">
import { OtpCode } from "@io-app/api-types/generated/definitions/cgn/OtpCode";
import { randomBytes } from "crypto";
⋮----
export function genRandomOtpCode(length: number = BONUSCODE_LENGTH): OtpCode
</file>

<file path="apps/dev-api-server/src/features/fastLogin/fastLoginHandler.ts">
import { Request } from "express";
⋮----
import { createOrRefreshEverySessionToken } from "../../persistence/sessionInfo";
import { checkNonceFromRequest, getNonceInfo } from "./nonceHandler";
⋮----
export const refreshTokenWithFastLogin = (
  request: Request
): string | undefined =>
</file>

<file path="apps/dev-api-server/src/features/fastLogin/nonceHandler.ts">
import { randomUUID } from "crypto";
import { Request } from "express";
import { pipe } from "fp-ts/lib/function";
⋮----
import { getDateMsDifference } from "../../utils/date";
⋮----
export type NonceInfo = {
  instantiationDate: Date;
  nonce: string;
};
⋮----
export const getNonceInfo = ()
⋮----
const setNonceInfo = (nonce: string, instantiationDate: Date) =>
⋮----
export const generateNewNonce = ()
⋮----
const extractNonceFromRequest = (request: Request): string | undefined =>
⋮----
export const checkNonceFromRequest = (
  request: Request,
  inputNonceInfo: NonceInfo
): boolean =>
</file>

<file path="apps/dev-api-server/src/features/fci/qtspNonceStore.ts">
import { randomUUID } from "crypto";
⋮----
import { ioDevServerConfig } from "../../config";
⋮----
const cleanupExpiredQtspNonces = () =>
⋮----
const generateQtspNonce = ()
⋮----
export const generateAndStoreQtspNonce = (now = new Date()) =>
⋮----
export const validateQtspNonce = (nonce: string): boolean =>
⋮----
export const getQtspNonceExpirations = ()
</file>

<file path="apps/dev-api-server/src/features/fims/routers/historyRouter.ts">
import { Access } from "@io-app/api-types/generated/definitions/fims_history/Access";
import { ExportRequest } from "@io-app/api-types/generated/definitions/fims_history/ExportRequest";
import { Router } from "express";
⋮----
import { ulid } from "ulid";
⋮----
import { getProblemJson } from "../../../payloads/error";
import { addHandler } from "../../../payloads/response";
import { addApiFimsV1Prefix } from "../../../utils/strings";
import { RouteHandler } from "../../../utils/types";
import { getFimsConfig } from "../services/configurationService";
import {
  generateAccessHistoryData,
  isProcessingExport,
  nextAccessHistoryPageFromRequest
} from "../services/historyService";
import { FIMSConfig } from "../types/config";
import { LastExportRequest } from "../types/lastExportRequest";
⋮----
const handleGetFimsAccesses: RouteHandler = (req, res) =>
⋮----
const handlePostFimsExportRequests: RouteHandler = (_req, res) =>
⋮----
const initializeIfNeeded = (config: FIMSConfig) =>
</file>

<file path="apps/dev-api-server/src/features/fims/routers/providerRouter.ts">
import { Consent } from "@io-app/api-types/generated/definitions/fims_sso/Consent";
import { Request, Response, Router } from "express";
⋮----
import { TokenSigner } from "jsontokens";
import { v4 } from "uuid";
⋮----
import { addHandler } from "../../../payloads/response";
import { FIMSToken } from "../../../payloads/session";
import { isSessionTokenValid } from "../../../persistence/sessionInfo";
import {
  baseProviderPath,
  generateIdTokenRedirectHTML,
  providerConfig,
  translationForScope
} from "../services/providerService";
import {
  InteractionData,
  OIdCData,
  OIDCErrorCodes,
  SessionData
} from "../types/authentication";
import { getRelyingParty } from "./relyingPartyRouter";
⋮----
const responseFromOAuthAuthorizeFirstInteraction = (
  requestInteractionId: string,
  currentOIdCData: OIdCData,
  res: Response
) =>
⋮----
const responseFromOAuthAuthorizeSecondInteraction = (
  requestInteractionId: string,
  currentOIdCData: OIdCData,
  req: Request,
  res: Response
) =>
⋮----
const validateFIMSToken = (cookies: Record<string, unknown>, res: Response) =>
⋮----
const sameSitePolicyForSessionCookie = ()
⋮----
const validateCookies = (
  mandatoryCookies: Record<string, string>,
  requestCookies: Record<string, unknown>,
  res: Response
) =>
⋮----
const validateAndHandleAuthorizeRequestParameters = (
  req: Request,
  res: Response
) =>
⋮----
const replyWithOIDCError = (
  errorCode: OIDCErrorCodes,
  description: string,
  res: Response
)
⋮----
const commonRedirectToGivenConsents = (
  requestInteractionId: string,
  res: Response
) =>
</file>

<file path="apps/dev-api-server/src/features/fims/routers/relyingPartyRouter.ts">
import { Router } from "express";
import { v4 } from "uuid";
⋮----
import { addHandler } from "../../../payloads/response";
import { serverUrl } from "../../../utils/server";
import ServicesDB from "../../services/persistence/servicesDatabase";
import { baseProviderPath } from "../services/providerService";
import {
  baseRelyingPartyPath,
  commonRedirectionValidation,
  generateUserProfileHTML,
  relyingPartiesConfig
} from "../services/relyingPartyService";
import { RelyingParty, RelyingPartyRequest } from "../types/relyingParty";
⋮----
export const getRelyingParty = (id: string)
⋮----
const findOrLazyLoadRelyingParty = (id: string) =>
⋮----
const randomServiceId = () =>
</file>

<file path="apps/dev-api-server/src/features/fims/services/configurationService.ts">
import { ioDevServerConfig } from "../../../config";
import { IoDevServerConfig } from "../../../types/config";
import { FIMSConfig } from "../types/config";
⋮----
export const getFimsConfig = (
  config: IoDevServerConfig = ioDevServerConfig
): FIMSConfig
</file>

<file path="apps/dev-api-server/src/features/fims/services/historyService.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { Access } from "@io-app/api-types/generated/definitions/fims_history/Access";
import { AccessHistoryPage } from "@io-app/api-types/generated/definitions/fims_history/AccessHistoryPage";
import { Redirect } from "@io-app/api-types/generated/definitions/fims_history/Redirect";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
import { Request } from "express";
⋮----
import { ulid } from "ulid";
⋮----
import ServicesDB from "../../services/persistence/servicesDatabase";
import { FIMSConfig } from "../types/config";
import { LastExportRequest } from "../types/lastExportRequest";
⋮----
export const generateAccessHistoryData = (
  config: FIMSConfig
): ReadonlyArray<Access> =>
⋮----
const generateAccess = (
  index: number,
  services: Array<ServiceDetails>,
  relyingPartyNameForService: Map<string, Redirect>
): Access =>
⋮----
export const nextAccessHistoryPageFromRequest = (
  config: FIMSConfig,
  maybeHistory: O.Option<ReadonlyArray<Access>>,
  req: Request
): E.Either<string, AccessHistoryPage> =>
⋮----
const generateAccessHistoryPage = (
  history: ReadonlyArray<Access>,
  sliceStart: number,
  sliceEnd: number
): E.Either<string, AccessHistoryPage> =>
⋮----
export const isProcessingExport = (
  config: FIMSConfig,
  lastExportRequestMaybe: O.Option<LastExportRequest>
)
</file>

<file path="apps/dev-api-server/src/features/fims/services/providerService.ts">
import escapeHTML from "escape-html";
⋮----
import { ioDevServerConfig } from "../../../config";
import { IoDevServerConfig } from "../../../types/config";
import { ProviderConfig } from "../types/config";
⋮----
export const providerConfig = (
  config: IoDevServerConfig = ioDevServerConfig
): ProviderConfig
⋮----
export const baseProviderPath = ()
⋮----
export const generateIdTokenRedirectHTML = (
⋮----
export const translationForScope = (scope: string) =>
</file>

<file path="apps/dev-api-server/src/features/fims/services/relyingPartyService.ts">
import { Request, Response } from "express";
import { decodeToken, TokenVerifier } from "jsontokens";
import { ParsedQs } from "qs";
⋮----
import { ioDevServerConfig } from "../../../config";
import { IoDevServerConfig } from "../../../types/config";
import { RelyingPartiesConfig } from "../types/config";
import { RelyingPartyRequest } from "../types/relyingParty";
import { providerConfig } from "./providerService";
⋮----
export const relyingPartiesConfig = (
  config: IoDevServerConfig = ioDevServerConfig
): ReadonlyArray<RelyingPartiesConfig>
⋮----
export const baseRelyingPartyPath = ()
⋮----
const tokenPayloadToUrl = (
  tokenPayload: Record<string, unknown>,
  baseUrl: string
) =>
⋮----
export const generateUserProfileHTML = (query: ParsedQs) =>
⋮----
export const commonRedirectionValidation = (
  idToken: string,
  relyingPartyId: string,
  state: string,
  relyingPartyRequests: Map<string, Map<string, RelyingPartyRequest>>,
  req: Request,
  res: Response
) =>
</file>

<file path="apps/dev-api-server/src/features/fims/types/authentication.ts">
export type InteractionData = {
  interaction: string;
  interactionResume: string;
  interactionResumeSignature: string;
  interactionSignature: string;
};
⋮----
export type OIdCData = {
  firstInteraction?: InteractionData;
  id: () => string;
  nonce: string;
  redirectUri: string;
  relyingPartyId: string;
  scopes: ReadonlyArray<string>;
  secondInteraction?: InteractionData;
  session?: SessionData;
  state: string;
};
⋮----
export type OIDCErrorCodes =
  | "access_denied"
  | "invalid_scope"
  | "server_error"
  | "temporarily_unavailable"
  | "unauthorized_client"
  | "unsupported_response_type";
⋮----
export type SessionData = {
  session: string;
  sessionLegacy: string;
  sessionLegacySignature: string;
  sessionSignature: string;
};
</file>

<file path="apps/dev-api-server/src/features/fims/types/config.ts">
import { FailureHttpResponseCode } from "../../../types/httpResponseCode";
⋮----
export type FIMSConfig = t.TypeOf<typeof FIMSConfig>;
export type ProviderConfig = t.TypeOf<typeof ProviderConfig>;
export type RelyingPartiesConfig = t.TypeOf<typeof RelyingPartiesConfig>;
</file>

<file path="apps/dev-api-server/src/features/fims/types/lastExportRequest.ts">
export type LastExportRequest = {
  id: string;
  timestamp: number;
};
</file>

<file path="apps/dev-api-server/src/features/fims/types/relyingParty.ts">
export type RelyingParty = {
  displayName: string;
  id: string;
  isInternal: boolean;
  redirectUris: ReadonlyArray<string>;
  responseMode: "form_post";
  responseType: "id_token";
  scopes: ReadonlyArray<"openid" | "profile">;
  serviceId: string;
};
⋮----
export type RelyingPartyRequest = {
  nonce: string;
  relyingPartyId: string;
  state: string;
};
</file>

<file path="apps/dev-api-server/src/features/messages/persistence/messagesDatabase.ts">
import { CreatedMessageWithContentAndAttachments } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndAttachments";
import { sequenceT } from "fp-ts/lib/Apply";
⋮----
import { identity, pipe } from "fp-ts/lib/function";
⋮----
const addNewMessage = (message: CreatedMessageWithContentAndAttachments)
⋮----
function archive(id: string): boolean
⋮----
function findAllArchived(): ReadonlyArray<CreatedMessageWithContentAndAttachments>
⋮----
function findAllInbox(): ReadonlyArray<CreatedMessageWithContentAndAttachments>
⋮----
function persist(
  messages: Array<CreatedMessageWithContentAndAttachments>
): void
⋮----
function replaceMessages(
  archived: boolean,
  messages: ReadonlyArray<CreatedMessageWithContentAndAttachments>
): void
⋮----
function unarchive(id: string): boolean
⋮----
const getMessageById = (
  id: string
): CreatedMessageWithContentAndAttachments | undefined
⋮----
function dropAll(): void
⋮----
function setReadMessage(id: string)
⋮----
function updateMessages(
  id: string,
  messages: Array<CreatedMessageWithContentAndAttachments>
)
⋮----
const addBooleanPropertyIfNeeded = (
  message: CreatedMessageWithContentAndAttachments,
  property: string
) =>
</file>

<file path="apps/dev-api-server/src/features/messages/persistence/messagesPayload.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { CreatedMessageWithContent } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContent";
import { CreatedMessageWithoutContent } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithoutContent";
import { FiscalCode } from "@io-app/api-types/generated/definitions/communication/FiscalCode";
import { HasPreconditionEnum } from "@io-app/api-types/generated/definitions/communication/HasPrecondition";
import { NewMessageContent } from "@io-app/api-types/generated/definitions/communication/NewMessageContent";
import { PaymentAmount } from "@io-app/api-types/generated/definitions/communication/PaymentAmount";
import { PaymentNoticeNumber } from "@io-app/api-types/generated/definitions/communication/PaymentNoticeNumber";
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { ThirdPartyMessagePrecondition } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessagePrecondition";
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { constUndefined, pipe } from "fp-ts/lib/function";
⋮----
import { assetsFolder } from "../../../config";
import { PaymentsDatabase } from "../../../persistence/payments";
import { contentTypeMapping, listDir } from "../../../utils/file";
import { getRandomIntInRange } from "../../../utils/id";
import { rptIdFromPaymentDataWithRequiredPayee } from "../../../utils/payment";
import { validatePayload } from "../../../utils/validator";
import ServicesDB from "../../services/persistence/servicesDatabase";
import { AttachmentCategory } from "../types/attachmentCategory";
import { LegacyGreenPass } from "../types/LegacyGreenPass";
import {
  MessageTemplate,
  MessageTemplatePreconditions
} from "../types/messageTemplate";
import { nextMessageIdAndCreationDate } from "../utils";
⋮----
export const createMessage = (
  fiscalCode: FiscalCode,
  senderServiceId: string,
  timeToLive = 3600
): CreatedMessageWithoutContent =>
⋮----
export const withDueDate = (
  message: CreatedMessageWithContent,
  dueDate: Date
): CreatedMessageWithContent => (
⋮----
export const withRemoteContent = (
  template: MessageTemplate,
  message: CreatedMessageWithContent,
  markdown: string
): ThirdPartyMessageWithContent => (
⋮----
const serviceFromMessage = (
  message: CreatedMessageWithContent
): E.Either<Error, Readonly<ServiceDetails>>
⋮----
export const withPaymentData = (
  message: CreatedMessageWithContent,
  invalidAfterDueDate = false,
  noticeNumber = `0${faker.string.numeric(17)}`,
  amount: number = getRandomIntInRange(1, 10000)
): E.Either<Error, CreatedMessageWithContent>
⋮----
export const withContent = (
  message: CreatedMessageWithoutContent,
  subject: string,
  markdown: string,
  legacyGreenPass?: LegacyGreenPass
): CreatedMessageWithContent =>
⋮----
const thirdPartyAttachmentFromAbsolutePathArray =
(count: number, idOffset = 0, category: AttachmentCategory = "DOCUMENT")
⋮----
const contentTypeFromParsedFile = (parsedFile: path.ParsedPath)
⋮----
const attachmentUrlFromAbsolutePath = (absolutePath: string)
⋮----
const getRemoteAttachments = (
  attachmentCount: number
): ReadonlyArray<ThirdPartyAttachment>
⋮----
export const getThirdPartyMessagePrecondition =
(): ThirdPartyMessagePrecondition => (
⋮----
const fromTemplateHasPreconditionsToEnumHasPreconditions = (
  preconditions: MessageTemplatePreconditions | undefined
): HasPreconditionEnum =>
</file>

<file path="apps/dev-api-server/src/features/messages/routers/ioSendRouter.ts">
import { Request, Response, Router } from "express";
⋮----
import { lollipopMiddleware } from "../../../middleware/lollipopMiddleware";
import { getProblemJson } from "../../../payloads/error";
import { addHandler } from "../../../payloads/response";
import {
  handleLeftEitherIfNeeded,
  unknownToString
} from "../../../utils/error";
import { logWarning } from "../../../utils/logging";
import { serverUrl } from "../../../utils/server";
import { generateCheckQRPath } from "../../pn/routers/aarRouter";
import { generateLollipopLambdaGetPath } from "../../pn/routers/lollipopLambda";
import {
  generateAcceptMandatePath,
  generateCreateMandatePath
} from "../../pn/routers/mandatesRouter";
import { generateNotificationPath } from "../../pn/routers/notificationsRouter";
import {
  generateRequestHeaders,
  isTestOrUndefinedFromQuery,
  mandateIdOrUndefinedFromQuery
} from "../services/ioSendService";
import MessagesService from "../services/messagesService";
import { bodyToString } from "../utils";
⋮----
const sendQRCodeFetch = ()
⋮----
const sendNotificationFetch = ()
⋮----
const sendAttachmentFetch = ()
⋮----
const sendCreateMandateFetch = ()
⋮----
const sendLollipopLambdaGetFetch = ()
⋮----
const sendLambdaLollipopPostFetch = ()
⋮----
const fetchSENDDataAndForwardResponse = async (
  fetchFunction: () => Promise<globalThis.Response>,
  endpointName: string,
  res: Response
) =>
⋮----
const commonHandleIsTestQueryParam = (req: Request) =>
</file>

<file path="apps/dev-api-server/src/features/messages/routers/messagesRouter.ts">
import { HasPreconditionEnum } from "@io-app/api-types/generated/definitions/communication/HasPrecondition";
import { PartyConfigurationFaultPaymentProblemJson as PaymentInfoUnavailableResponse } from "@io-app/api-types/generated/definitions/communication/PartyConfigurationFaultPaymentProblemJson";
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { PaymentInfoBadGatewayResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoBadGatewayResponse";
import { PaymentInfoConflictResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoConflictResponse";
import { PaymentInfoNotFoundResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoNotFoundResponse";
import { PaymentInfoResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoResponse";
import { ThirdPartyMessagePrecondition } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessagePrecondition";
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { NotificationAttachmentDownloadMetadataResponse } from "@io-app/api-types/generated/definitions/pn/NotificationAttachmentDownloadMetadataResponse";
import { ThirdPartyMessage } from "@io-app/api-types/generated/definitions/pn/ThirdPartyMessage";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { Request, Response, Router } from "express";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import _ from "lodash";
⋮----
import { ioDevServerConfig } from "../../../config";
import { lollipopMiddleware } from "../../../middleware/lollipopMiddleware";
import { getProblemJson } from "../../../payloads/error";
import { addHandler } from "../../../payloads/response";
import { PaymentsDatabase } from "../../../persistence/payments";
import { GetMessagesParameters } from "../../../types/parameters";
import {
  isProcessedPayment,
  ProcessablePayment,
  ProcessedPayment
} from "../../../types/PaymentStatus";
import {
  handleLeftEitherIfNeeded,
  unknownToString
} from "../../../utils/error";
import { sendFileFromRootPath } from "../../../utils/file";
import { serverUrl } from "../../../utils/server";
import {
  addApiCommunicationV1Prefix,
  addApiV1Prefix
} from "../../../utils/strings";
import { RouteHandler } from "../../../utils/types";
import {
  httpStatusCodeFromDetailV2Enum,
  payloadFromDetailV2Enum
} from "../../payments/types/failure";
import {
  generateNotificationDisclaimerPath,
  generateNotificationPath
} from "../../pn/routers/notificationsRouter";
import { sendServiceId } from "../../pn/services/dataService";
import MessagesDB from "../persistence/messagesDatabase";
import {
  defaultContentType,
  getThirdPartyMessagePrecondition
} from "../persistence/messagesPayload";
import MessagesService from "../services/messagesService";
⋮----
const handleGetMessages: RouteHandler = (req, res) =>
⋮----
const handleGetMessage: RouteHandler = (req, res) =>
⋮----
const handlePutMessageStatus: RouteHandler = (req, res) =>
⋮----
const handleGetPaymentInfo: RouteHandler = (req, res) =>
⋮----
const handleCreateMessage: RouteHandler = (_, res)
⋮----
const processablePaymentToStatusCodeAndPayload = (
  payment: ProcessablePayment
): [number, PaymentInfoResponse | string]
⋮----
const processedPaymentToStatusCodeAndPayload = (
  payment: ProcessedPayment
): [number, ReturnType<typeof payloadFromDetailV2Enum> | string] =>
⋮----
const handleSENDAttachment = async (
  attachmentUrl: string,
  req: Request,
  res: Response
) =>
⋮----
const handlePutInstallation: RouteHandler = (_, res)
</file>

<file path="apps/dev-api-server/src/features/messages/routers/productionCrawlerRouter.ts">
import { CreatedMessageWithContentAndAttachments } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndAttachments";
import { PaginatedPublicMessagesCollection } from "@io-app/api-types/generated/definitions/communication/PaginatedPublicMessagesCollection";
import { PublicMessage } from "@io-app/api-types/generated/definitions/communication/PublicMessage";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import axios from "axios";
import { Router } from "express";
⋮----
import { promises as fsPromises } from "fs";
⋮----
import { getProblemJson } from "../../../payloads/error";
import { addHandler } from "../../../payloads/response";
⋮----
export type AggregatedMessage = {
  inboxMessage: PublicMessage;
  message: CreatedMessageWithContentAndAttachments;
};
⋮----
export const productionMessagesFileRelativePath = (archived: boolean)
⋮----
const downloadMessageList = async (
  accumulator: ReadonlyArray<PublicMessage>,
  archived: boolean,
  bearerToken: string,
  maximumId: string | undefined
): Promise<ReadonlyArray<PublicMessage>> =>
⋮----
const downloadMessagesDetails = async (
  bearerToken: string,
  index: number,
  messageList: ReadonlyArray<PublicMessage>,
  outputMessageList: ReadonlyArray<AggregatedMessage>
): Promise<ReadonlyArray<AggregatedMessage>> =>
</file>

<file path="apps/dev-api-server/src/features/messages/services/ioSendService.ts">
import { IncomingHttpHeaders } from "http";
import { ParsedQs } from "qs";
⋮----
import { ioDevServerConfig } from "../../../config";
import MessagesService from "../services/messagesService";
⋮----
export const mandateIdOrUndefinedFromQuery = (
  query: ParsedQs
): string | undefined =>
⋮----
export const isTestOrUndefinedFromQuery = (
  query: ParsedQs
): boolean | undefined =>
⋮----
export const generateRequestHeaders = (
  headers: IncomingHttpHeaders,
  contentType = "application/json",
  excludeTaxId = false
): Record<string, string> => (
⋮----
const ioSourceHeaderFromRequestHeaders = (
  headers: IncomingHttpHeaders
): Record<string, string> =>
⋮----
const contentTypeHeaderFromHeaders = (
  headers: IncomingHttpHeaders,
  defaultValue = "application/json"
) =>
</file>

<file path="apps/dev-api-server/src/features/messages/services/messagesService.ts">
import { CreatedMessageWithContent } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContent";
import { CreatedMessageWithContentAndAttachments } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndAttachments";
import { CreatedMessageWithContentAndEnrichedData } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndEnrichedData";
import { HasPreconditionEnum } from "@io-app/api-types/generated/definitions/communication/HasPrecondition";
import { MessageCategory } from "@io-app/api-types/generated/definitions/communication/MessageCategory";
import { TagEnum as TagEnumBase } from "@io-app/api-types/generated/definitions/communication/MessageCategoryBase";
import { TagEnum as TagEnumPayment } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPayment";
import {
  MessageCategoryPN,
  TagEnum as TagEnumPN
} from "@io-app/api-types/generated/definitions/communication/MessageCategoryPN";
import { PublicMessage } from "@io-app/api-types/generated/definitions/communication/PublicMessage";
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { Either, isLeft, isRight, left, right } from "fp-ts/lib/Either";
import { pipe } from "fp-ts/lib/function";
import { IncomingHttpHeaders } from "node:http";
import path from "path";
import { ParsedQs } from "qs";
import { __, match, not } from "ts-pattern";
⋮----
import { ioDevServerConfig } from "../../../config";
import { getProblemJson } from "../../../payloads/error";
import { IoDevServerConfig } from "../../../types/config";
import { GetMessagesParameters } from "../../../types/parameters";
import { unknownToString } from "../../../utils/error";
import { ExpressFailure } from "../../../utils/expressDTO";
import { fileExists, isPDFFile } from "../../../utils/file";
import { rptIdFromServiceAndPaymentData } from "../../../utils/payment";
import { APIKey } from "../../pn/models/APIKey";
import {
  generateDocumentPath,
  generatePaymentDocumentPath
} from "../../pn/routers/documentsRouter";
import { sendServiceId } from "../../pn/services/dataService";
import ServicesDB from "../../services/persistence/servicesDatabase";
import { nextMessageIdAndCreationDate } from "../utils";
⋮----
const getMessageCategory = (
  message: CreatedMessageWithContent
): MessageCategory =>
⋮----
const getPublicMessages = (
  messages: ReadonlyArray<CreatedMessageWithContentAndAttachments>,
  withEnrichedData: boolean,
  withContent: boolean,
  config: IoDevServerConfig
): ReadonlyArray<CreatedMessageWithContentAndAttachments | PublicMessage>
⋮----
const computeGetMessagesQueryIndexes = (
  params: GetMessagesParameters,
  orderedList: ReadonlyArray<CreatedMessageWithContentAndAttachments>
) =>
⋮----
const createMessage = ()
⋮----
const verifyAttachment = (
  message: CreatedMessageWithContentAndAttachments,
  attachmentUrl: string
): Either<ExpressFailure, ThirdPartyAttachment> =>
⋮----
const lollipopClientHeadersFromHeaders = (
  headers: IncomingHttpHeaders
): Record<string, string>
⋮----
const generateFakeLollipopServerHeaders = (
  fiscalCode: string
): Record<string, string> => (
⋮----
const sendAPIKeyHeader = (): Record<string, string> => (
⋮----
const sendTaxIdHeader = (fiscalCode: string): Record<string, string> => (
⋮----
const sendDefaultIOSourceHeader = (): Record<
  "x-pagopa-pn-io-src",
  "DEFAULT"
> => ({
  "x-pagopa-pn-io-src": "DEFAULT"
});
⋮----
const checkAndBuildSENDAttachmentEndpoint = (
  attachmentUrl: string,
  mandateId?: string
): Either<ExpressFailure, string> =>
⋮----
const stringCategoryToPaymentDocumentCategory = (
  category: string
): "F24" | "PAGOPA" | undefined =>
⋮----
const appendAttachmentIdxToAttachmentUrlIfNeeded = (
  attachmentUrlPath: string,
  query: ParsedQs
) =>
⋮----
const urlAttachmentFromUrlEncodedBase64UrlIfNeeded = (
  urlEncodedBase64Url: string
): Either<ExpressFailure, string> =>
</file>

<file path="apps/dev-api-server/src/features/messages/types/attachmentCategory.ts">
export type AttachmentCategory = "DOCUMENT" | "F24";
</file>

<file path="apps/dev-api-server/src/features/messages/types/LegacyGreenPass.ts">
export type LegacyGreenPass = {
  auth_code: string;
};
</file>

<file path="apps/dev-api-server/src/features/messages/types/liveModeMessages.ts">

</file>

<file path="apps/dev-api-server/src/features/messages/types/messagesConfig.ts">
import { AllowRandomValue } from "../../../types/allowRandomValue";
import { HttpResponseCode } from "../../../types/httpResponseCode";
import { LiveModeMessages } from "./liveModeMessages";
import { MessageTemplateWrapper } from "./messageTemplateWrapper";
⋮----
export type MessagesConfig = t.TypeOf<typeof MessagesConfig>;
</file>

<file path="apps/dev-api-server/src/features/messages/types/messageTemplate.ts">
export type MessageTemplatePreconditions = t.TypeOf<
  typeof MessageTemplatePreconditions
>;
⋮----
export type MessageTemplate = t.TypeOf<typeof MessageTemplate>;
</file>

<file path="apps/dev-api-server/src/features/messages/types/messageTemplateWrapper.ts">
import { MessageTemplate } from "./messageTemplate";
⋮----
export type MessageTemplateWrapper = t.TypeOf<typeof MessageTemplateWrapper>;
</file>

<file path="apps/dev-api-server/src/features/messages/utils/index.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { Either, left, right } from "fp-ts/lib/Either";
⋮----
import { getProblemJson } from "../../../payloads/error";
import { unknownToString } from "../../../utils/error";
import { ExpressFailure } from "../../../utils/expressDTO";
⋮----
export const nextMessageIdAndCreationDate = () =>
⋮----
export const bodyToString = (
  body: unknown
): Either<ExpressFailure, string | undefined> =>
</file>

<file path="apps/dev-api-server/src/features/payments/payloads/paymentMethods.ts">
import { PaymentMethodsResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodsResponse";
⋮----
import { paymentMethodsDB } from "../persistence/paymentMethods";
</file>

<file path="apps/dev-api-server/src/features/payments/payloads/payments.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { PaymentRequestsGetResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentRequestsGetResponse";
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { pipe } from "fp-ts/lib/function";
⋮----
import ServicesDB from "../../services/persistence/servicesDatabase";
⋮----
export const getPaymentRequestsGetResponse = (
  rptId: RptId
): O.Option<PaymentRequestsGetResponse>
</file>

<file path="apps/dev-api-server/src/features/payments/payloads/transactions.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { Bundle } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/Bundle";
import { CalculateFeeResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/CalculateFeeResponse";
import {
  ClientIdEnum,
  NewTransactionResponse,
  SendPaymentResultOutcomeEnum
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/NewTransactionResponse";
import { PaymentInfo } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentInfo";
import { PaymentMethodStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentMethodStatus";
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import { TransactionInfo } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/TransactionInfo";
import { TransactionStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/TransactionStatus";
⋮----
import { ulid } from "ulid";
⋮----
export const getNewTransactionResponsePayload = (
  payments: ReadonlyArray<PaymentInfo>
): O.Option<NewTransactionResponse>
⋮----
export const getTransactionInfoPayload = (
  transactionId: string
): O.Option<TransactionInfo>
⋮----
export const getCalculateFeeResponsePayload = (
  _walletId: string | undefined,
  _amount: number,
  idPspList?: ReadonlyArray<string>
): O.Option<CalculateFeeResponse>
</file>

<file path="apps/dev-api-server/src/features/payments/persistence/notices.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { NoticeDetailResponse } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeDetailResponse";
import { NoticeListItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeListItem";
import { TransactionInfo } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/TransactionInfo";
import { pipe } from "fp-ts/lib/function";
⋮----
import { ioDevServerConfig } from "../../../config";
import { generateRandomInfoNotice } from "../utils/transactions";
⋮----
type EventId = NoticeListItem["eventId"];
⋮----
const getUserNotices = ()
⋮----
const getNoticeDetails = (eventId: EventId)
⋮----
const addUserNotice = (transaction: NoticeListItem) =>
⋮----
const removeUserNotice = (eventId: EventId) =>
⋮----
const addNoticeDetails = (eventId: EventId, notice: NoticeDetailResponse) =>
⋮----
const removeNoticeDetails = (eventId: EventId) =>
⋮----
const generateUserNotice = (
  eventId: EventId,
  idx: number,
  additionalTransactionInfo: Partial<TransactionInfo> = {}
) =>
⋮----
const generateUserNoticeData = () =>
</file>

<file path="apps/dev-api-server/src/features/payments/persistence/paymentMethods.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { PaymentMethodManagementTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodManagementType";
import { PaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodResponse";
import { PaymentMethodStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodStatus";
import { Range } from "@io-app/api-types/generated/definitions/pagopa/walletv3/Range";
import { WalletInfoDetails } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfoDetails";
import { format } from "date-fns";
⋮----
import { mockAvailablePspList } from "../payloads/transactions";
⋮----
export const generateRandomCardBrand = ()
⋮----
export const generateWalletDetailsByPaymentMethod = (
  paymentMethodId: number
):
</file>

<file path="apps/dev-api-server/src/features/payments/persistence/userWallet.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { GuestMethodLastUsageType } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/GuestMethodLastUsageType";
import { UserLastPaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/UserLastPaymentMethodResponse";
import {
  WalletLastUsageType,
  WalletLastUsageTypeEnum
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletLastUsageType";
import { WalletApplication } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletApplication";
import { WalletApplicationInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletApplicationInfo";
import { WalletApplicationStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletApplicationStatus";
import { WalletClientStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletClientStatus";
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
import { WalletInfoDetails } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfoDetails";
import { WalletStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletStatus";
import { format } from "date-fns";
⋮----
import _ from "lodash";
⋮----
import { uuidv4 } from "../../../utils/strings";
import { generateWalletDetailsByPaymentMethod } from "./paymentMethods";
⋮----
const getUserWallets = ()
⋮----
const getUserWalletInfo = (walletId: WalletInfo["walletId"])
⋮----
const addUserWallet = (wallet: WalletInfo) =>
⋮----
const removeUserWallet = (walletId: WalletInfo["walletId"]) =>
⋮----
const generateUserWallet = (
  paymentMethodId: number,
  extraDetails: Partial<WalletInfoDetails> = {}
) =>
⋮----
const generateWalletData = () =>
⋮----
const updateUserWalletApplication = (
  walletId: string,
  applications?: ReadonlyArray<WalletApplication>
) =>
⋮----
const setRecentUsedPaymentMethod = (
  id: string,
  type: GuestMethodLastUsageType | WalletLastUsageType
) =>
⋮----
const getRecentusedPaymentMethod = ()
</file>

<file path="apps/dev-api-server/src/features/payments/routers/index.ts">

</file>

<file path="apps/dev-api-server/src/features/payments/routers/notices.ts">
import { NoticeListWrapResponse } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeListWrapResponse";
import { pipe } from "fp-ts/lib/function";
⋮----
import { ioDevServerConfig } from "../../../config";
import { sendFileFromRootPath } from "../../../utils/file";
import NoticesDB from "../persistence/notices";
import { addNoticesHandler } from "./router";
</file>

<file path="apps/dev-api-server/src/features/payments/routers/payment.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { CalculateFeeRequest } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/CalculateFeeRequest";
import { FaultCategoryEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/FaultCategory";
import { GuestMethodLastUsageTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/GuestMethodLastUsageType";
import { NewTransactionRequest } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/NewTransactionRequest";
import { RedirectUrlResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RedirectUrlResponse";
import { RequestAuthorizationRequest } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RequestAuthorizationRequest";
import { RequestAuthorizationResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RequestAuthorizationResponse";
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import { WalletDetailTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletDetailType";
import { WalletLastUsageTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletLastUsageType";
import { sequenceS } from "fp-ts/lib/Apply";
import { flow, pipe } from "fp-ts/lib/function";
⋮----
import { ulid } from "ulid";
⋮----
import { ioDevServerConfig } from "../../../config";
import { getProblemJson } from "../../../payloads/error";
import { PaymentsDatabase } from "../../../persistence/payments";
import { fold } from "../../../types/PaymentStatus";
import { serverUrl } from "../../../utils/server";
import { getPaymentRequestsGetResponse } from "../payloads/payments";
import {
  getCalculateFeeResponsePayload,
  getNewTransactionResponsePayload,
  getTransactionInfoPayload
} from "../payloads/transactions";
import NoticesDB from "../persistence/notices";
import WalletDB from "../persistence/userWallet";
import {
  getStatusCodeForWalletFailure,
  httpStatusCodeFromDetailV2Enum,
  payloadFromDetailV2Enum,
  WalletPaymentFailure
} from "../types/failure";
import {
  generateOnboardablePaymentMethods,
  generateOnboardingWalletData
} from "../utils/onboarding";
import { WALLET_PAYMENT_PATH } from "../utils/payment";
import { addPaymentHandler } from "./router";
⋮----
// Create new transaction
⋮----
const mapOutcomeCodeToDetailsV2Enum = (outcome: number): PaymentFaultV2Enum =>
</file>

<file path="apps/dev-api-server/src/features/payments/routers/platform.ts">
import { PAGOPA_PLATFORM_SESSION_TOKEN } from "../utils/platform";
import { addPlatformHandler } from "./router";
</file>

<file path="apps/dev-api-server/src/features/payments/routers/router.ts">
import { Request, Response, Router } from "express";
⋮----
import { addHandler, SupportedMethod } from "../../../payloads/response";
⋮----
const addPaymentWalletPrefix = (path: string)
⋮----
const addECommercePrefix = (path: string) => `$
⋮----
const addNoticesPrefix = (path: string) => `$
⋮----
const addPlatformPrefix = (path: string) => `$
⋮----
export const addPaymentWalletHandler = (
  method: SupportedMethod,
  path: string,
  handleRequest: (request: Request, response: Response) => void
)
⋮----
export const addPaymentHandler = (
  method: SupportedMethod,
  path: string,
  handleRequest: (request: Request, response: Response) => void
)
⋮----
export const addNoticesHandler = (
  method: SupportedMethod,
  path: string,
  handleRequest: (request: Request, response: Response) => void
)
⋮----
export const addPlatformHandler = (
  method: SupportedMethod,
  path: string,
  handleRequest: (request: Request, response: Response) => void
)
</file>

<file path="apps/dev-api-server/src/features/payments/routers/wallets.ts">
import { WalletApplicationUpdateRequest } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletApplicationUpdateRequest";
import { WalletCreateRequest } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletCreateRequest";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { uuidv4 } from "../../../utils/strings";
import WalletDB from "../persistence/userWallet";
import {
  generateOnboardablePaymentMethods,
  generateOnboardingWalletData
} from "../utils/onboarding";
import { addPaymentWalletHandler } from "./router";
</file>

<file path="apps/dev-api-server/src/features/payments/types/configuration.ts">
import { WalletPaymentFailure } from "./failure";
⋮----
export type WalletConfiguration = t.TypeOf<typeof WalletConfiguration>;
</file>

<file path="apps/dev-api-server/src/features/payments/types/failure.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import {
  FaultCodeCategoryEnum as GatewayEnum,
  GatewayFaultPaymentProblemJson
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/GatewayFaultPaymentProblemJson";
import { PartyConfigurationFaultEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PartyConfigurationFault";
import {
  PartyConfigurationFaultPaymentProblemJson,
  FaultCodeCategoryEnum as PartyEnum
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PartyConfigurationFaultPaymentProblemJson";
import { PaymentCanceledStatusFaultEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentCanceledStatusFault";
import {
  FaultCodeCategoryEnum as CancelledEnum,
  PaymentCanceledStatusFaultPaymentProblemJson
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentCanceledStatusFaultPaymentProblemJson";
import { PaymentDuplicatedStatusFaultEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentDuplicatedStatusFault";
import {
  FaultCodeCategoryEnum as DuplicatedEnum,
  PaymentDuplicatedStatusFaultPaymentProblemJson
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentDuplicatedStatusFaultPaymentProblemJson";
import { PaymentExpiredStatusFaultEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentExpiredStatusFault";
import {
  FaultCodeCategoryEnum as ExpiredEnum,
  PaymentExpiredStatusFaultPaymentProblemJson
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentExpiredStatusFaultPaymentProblemJson";
import { PaymentOngoingStatusFaultEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentOngoingStatusFault";
import {
  FaultCodeCategoryEnum as OngoingEnum,
  PaymentOngoingStatusFaultPaymentProblemJson
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentOngoingStatusFaultPaymentProblemJson";
import { ValidationFaultPaymentDataErrorProblemJson } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/ValidationFaultPaymentDataErrorProblemJson";
import { ValidationFaultPaymentUnavailableEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/ValidationFaultPaymentUnavailable";
import {
  FaultCodeCategoryEnum as ValidationEnum,
  ValidationFaultPaymentUnavailableProblemJson
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/ValidationFaultPaymentUnavailableProblemJson";
import { ValidationFaultPaymentUnknownEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/ValidationFaultPaymentUnknown";
import {
  FaultCodeCategoryEnum as UnknownEnum,
  ValidationFaultPaymentUnknownProblemJson
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/ValidationFaultPaymentUnknownProblemJson";
⋮----
export type WalletPaymentFailure = t.TypeOf<typeof WalletPaymentFailure>;
⋮----
export const getStatusCodeForWalletFailure = (
  failure: WalletPaymentFailure
): 400 | 404 | 409 | 502 | 503 =>
⋮----
export const httpStatusCodeFromDetailV2Enum = (input: PaymentFaultV2Enum) =>
⋮----
export const payloadFromDetailV2Enum = (input: PaymentFaultV2Enum) =>
</file>

<file path="apps/dev-api-server/src/features/payments/utils/onboarding.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { PaymentMethodsResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodsResponse";
import { WalletCreateResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletCreateResponse";
⋮----
import { serverUrl } from "../../../utils/server";
import { allPaymentMethods } from "../payloads/paymentMethods";
⋮----
type GenerateOnboardingWalletDataParams = {
  contextualOnboarding: boolean;
  paymentMethodId: string;
};
⋮----
export const generateOnboardablePaymentMethods = (): PaymentMethodsResponse
⋮----
export const generateOnboardingWalletData = ({
  paymentMethodId,
  contextualOnboarding = false
}: GenerateOnboardingWalletDataParams): WalletCreateResponse => (
</file>

<file path="apps/dev-api-server/src/features/payments/utils/payment.ts">

</file>

<file path="apps/dev-api-server/src/features/payments/utils/platform.ts">

</file>

<file path="apps/dev-api-server/src/features/payments/utils/transactions.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { CartItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/CartItem";
import {
  InfoNotice,
  OriginEnum,
  PaymentMethodEnum
} from "@io-app/api-types/generated/definitions/pagopa/biz-events/InfoNotice";
import { ulid } from "ulid";
⋮----
export const generateRandomInfoNotice = (
  cartList: Array<CartItem>,
  eventId?: string
): InfoNotice =>
</file>

<file path="apps/dev-api-server/src/features/payments/index.ts">

</file>

<file path="apps/dev-api-server/src/features/pn/middlewares/authenticationMiddleware.ts">
import { Request, Response } from "express";
⋮----
import { ioDevServerConfig } from "../../../config";
import { getProblemJson } from "../../../payloads/error";
import { logExpressResponseWarning } from "../../../utils/logging";
import { APIKey } from "../models/APIKey";
⋮----
export const authenticationMiddleware =
(nextRequest: (_req: Request, _res: Response)
</file>

<file path="apps/dev-api-server/src/features/pn/middlewares/initializationMiddleware.ts">
import { OrganizationFiscalCode } from "@pagopa/ts-commons/lib/strings";
import { Request, Response } from "express";
import { Either, isLeft, right } from "fp-ts/lib/Either";
⋮----
import { ioDevServerConfig } from "../../../config";
import { getProblemJson } from "../../../payloads/error";
import { PaymentsDatabase } from "../../../persistence/payments";
import { logExpressResponseWarning } from "../../../utils/logging";
import {
  ioOrganizationFiscalCode,
  ioOrganizationName
} from "../../services/persistence/services/factory";
import { AARRepository } from "../repositories/aarRepository";
import { DocumentsRepository } from "../repositories/documentRepository";
import { MandateRepository } from "../repositories/mandateRepository";
import { NotificationRepository } from "../repositories/notificationRepository";
import { PrevalidatedUrisRepository } from "../repositories/prevalidatedUrisRepository";
import { SendConfig } from "../types/sendConfig";
⋮----
export const initializationMiddleware =
(nextRequest: (_req: Request, res: Response)
⋮----
const initializeSENDRepositoriesIfNeeded = (
  organizationFiscalCode: OrganizationFiscalCode = ioOrganizationFiscalCode,
  organizationName: string = ioOrganizationName,
  sendConfig: SendConfig = ioDevServerConfig.send,
  userFiscalCode: string = ioDevServerConfig.profile.attrs.fiscal_code
): Either<string, boolean> =>
</file>

<file path="apps/dev-api-server/src/features/pn/models/AAR.ts">
export interface AAR {
  internalId: string;
  notificationIUN: string;
  qrCodeContent: string;
}
</file>

<file path="apps/dev-api-server/src/features/pn/models/APIKey.ts">

</file>

<file path="apps/dev-api-server/src/features/pn/models/Document.ts">
export interface Document {
  availableFrom?: Date;
  availableUntil?: Date;
  category: DocumentCategory;
  contentLength: number;
  contentType: string;
  filename: string;
  index: number;
  relativePath: string;
  sha256: string;
}
⋮----
export type DocumentCategory = "DOCUMENT" | "F24" | "PAGOPA";
</file>

<file path="apps/dev-api-server/src/features/pn/models/Mandate.ts">
export interface Mandate {
  mandateId: string;
  notificationIUN: string;
  representativeFiscalCode: string;
  timeToLive: Date;
}
</file>

<file path="apps/dev-api-server/src/features/pn/models/Notification.ts">
import { Document } from "./Document";
⋮----
export interface Notification {
  abstract: string;
  acknowledged: boolean;
  attachments: ReadonlyArray<Document> | undefined;
  cancelled: boolean;
  history: ReadonlyArray<NotificationHistory>;
  iun: string;
  recipientFiscalCode: string;
  recipients: ReadonlyArray<NotificationRecipient> | undefined;
  senderDenomination: string;
  subject: string;
}
⋮----
export interface NotificationHistory {
  activeFrom: Date;
  relatedTimelineElements: Array<string>;
  status: NotificationHistoryStatus;
}
export interface NotificationRecipient {
  denomination: string;
  paymentId: string | undefined;
  recipientFiscalCode: string;
  type: NotificationRecipientType;
}
⋮----
type NotificationHistoryStatus =
  | "ACCEPTED"
  | "CANCELLED"
  | "DELIVERED"
  | "DELIVERING"
  | "EFFECTIVE_DATE"
  | "IN_VALIDATION"
  | "PAID"
  | "REFUSED"
  | "UNREACHABLE"
  | "VIEWED";
⋮----
type NotificationRecipientType = "PF" | "PG";
</file>

<file path="apps/dev-api-server/src/features/pn/models/ValidationCode.ts">
export interface ValidationCode {
  mandateId: string;
  mandateTimeToLive: Date;
  notificationIUN: string;
  qrCodeContent: string;
  validationCode: string;
  validationCodeTimeToLive: Date;
}
</file>

<file path="apps/dev-api-server/src/features/pn/repositories/aarRepository.ts">
import { v4 as uuid } from "uuid";
⋮----
import { AAR } from "../models/AAR";
import { SendConfig } from "../types/sendConfig";
⋮----
export interface IAARRepository {
  getAAR: (qrCodeContent: string) => AAR | undefined;
  getAARByQRCodeContent: (qrCodeContent: string) => AAR | undefined;
  getAARList: () => ReadonlyArray<AAR>;
  initializeIfNeeded: (configuration: SendConfig) => void;
}
⋮----
const initializeIfNeeded = (configuration: SendConfig) =>
⋮----
const getAAR = (qrCodeContent: string)
⋮----
const getAARList = (): ReadonlyArray<AAR> => aars.map(aar => (
⋮----
const getAARByQRCodeContent = (qrCodeContent: string): AAR | undefined
</file>

<file path="apps/dev-api-server/src/features/pn/repositories/documentRepository.ts">
import { createHash } from "crypto";
import { Either, isLeft, left, right } from "fp-ts/lib/Either";
import { readdirSync, readFileSync } from "fs";
import path from "path";
import { cwd } from "process";
⋮----
import { unknownToString } from "../../../utils/error";
import { Document, DocumentCategory } from "../models/Document";
import { SendConfig } from "../types/sendConfig";
⋮----
const getPaymentDocumentGenerationTimeSeconds = ()
const getPaymentDocumentExpirationTimeSeconds = ()
const getPaymentDocumentRetryAfterSeconds = ()
⋮----
export interface IDocumentsRepository {
  documentAtIndex: (index: number) => Either<string, Document>;
  getPaymentDocumentRetryAfterSeconds: () => number;
  initializeIfNeeded: (configuration: SendConfig) => Either<string, boolean>;
  paymentDocumentAtIndex: (index: number) => Either<string, Document>;
  updateAvailabilityRangeForPaymentDocumentAtIndex: (
    index: number
  ) => Either<string, Document>;
}
⋮----
const documentAtIndex = (index: number): Either<string, Document> =>
⋮----
const paymentDocumentAtIndex = (index: number): Either<string, Document> =>
⋮----
const updateAvailabilityRangeForPaymentDocumentAtIndex = (
  index: number
): Either<string, Document> =>
⋮----
const initializeIfNeeded = (
  configuration: SendConfig
): Either<string, boolean> =>
⋮----
const populateDocumentsFromFolder = (
  category: DocumentCategory,
  workingDirectory: string,
  baseRelativePath: string,
  folder: string,
  array: Array<Document>
): void =>
⋮----
interface CustomFileInfo {
  byteSize: number;
  sha256: string;
}
⋮----
const getFileSizeAndSHA256 = (filePath: string): CustomFileInfo =>
⋮----
const removeExtension = (filename: string): string =>
</file>

<file path="apps/dev-api-server/src/features/pn/repositories/mandateRepository.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { v4 } from "uuid";
⋮----
import { Mandate } from "../models/Mandate";
import { ValidationCode } from "../models/ValidationCode";
import { SendConfig } from "../types/sendConfig";
⋮----
export interface IMandateRepository {
  createTemporaryMandate: (
    mandateId: string,
    notificationIun: string,
    taxId: string,
    timeToLive: Date
  ) => Mandate;
  createValidationCode: (
    notificationIun: string,
    qrCodeContent: string
  ) => ValidationCode;
  deleteValidationCode: (mandateId: string) => void;
  getActiveMandates: (
    notificationIUN: string,
    representativeFiscalCode: string
  ) => ReadonlyArray<Mandate>;
  getFirstValidMandate: (
    mandateId: string,
    notificationIUN: string,
    representativeFiscalCode: string
  ) => Mandate | undefined;
  getMandateList: () => ReadonlyArray<Mandate>;
  getMandateTimeToLiveSeconds: () => number;
  getValidationCode: (mandateId: string) => undefined | ValidationCode;
  getValidationCodeTimeToLiveSeconds: () => number;
  initializeIfNeeded: (
    configuration: SendConfig,
    profileFiscalCode: string
  ) => void;
}
⋮----
const getMandateTimeToLiveSeconds = (): number
⋮----
const getValidationCodeTimeToLiveSeconds = (): number
⋮----
const createTemporaryMandate = (
  mandateId: string,
  notificationIun: string,
  taxId: string,
  timeToLive: Date
): Mandate =>
⋮----
const createValidationCode = (
  notificationIun: string,
  qrCodeContent: string
): ValidationCode =>
⋮----
const deleteValidationCode = (mandateId: string): void =>
⋮----
const initializeIfNeeded = (
  configuration: SendConfig,
  profileFiscalCode: string
): void =>
⋮----
const getActiveMandates = (
  notificationIUN: string,
  representativeFiscalCode: string
): ReadonlyArray<Mandate>
⋮----
const getFirstValidMandate = (
  mandateId: string,
  notificationIUN: string,
  representativeFiscalCode: string
): Mandate | undefined
⋮----
const getMandateList = (): ReadonlyArray<Mandate>
⋮----
const getValidationCode = (mandateId: string): undefined | ValidationCode
</file>

<file path="apps/dev-api-server/src/features/pn/repositories/notificationRepository.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { OrganizationFiscalCode } from "@pagopa/ts-commons/lib/strings";
import { Either, isLeft, left, right } from "fp-ts/lib/Either";
import { ulid } from "ulid";
⋮----
import { IPaymentsDatabase } from "../../../persistence/payments";
import { rptIdFromPaymentDataWithRequiredPayee } from "../../../utils/payment";
import { Document, DocumentCategory } from "../models/Document";
import {
  Notification,
  NotificationHistory,
  NotificationRecipient
} from "../models/Notification";
import {
  SendConfig,
  SendPaymentConfig,
  SendTimelineConfig
} from "../types/sendConfig";
import { IDocumentsRepository } from "./documentRepository";
⋮----
export interface INotificationRepository {
  getNotification: (iun: string) => Notification | undefined;
  initializeIfNeeded: (
    config: SendConfig,
    devServerUserFiscalCode: string,
    documentsRepository: IDocumentsRepository,
    organizationFiscalCode: OrganizationFiscalCode,
    organizationName: string,
    paymentsRepository: IPaymentsDatabase
  ) => Either<string, boolean>;
}
⋮----
const getNotification = (iun: string): Notification | undefined
⋮----
const initializeIfNeeded = (
  config: SendConfig,
  devServerUserFiscalCode: string,
  documentsRepository: IDocumentsRepository,
  organizationFiscalCode: OrganizationFiscalCode,
  organizationName: string,
  paymentsRepository: IPaymentsDatabase
): Either<string, boolean> =>
⋮----
const generateFiscalCodePlaceholder = (): string
⋮----
const attachmentsFromAttachmentConfig = (
  attachmentsConfig: ReadonlyArray<DocumentCategory> | undefined,
  documentsRepository: IDocumentsRepository
): Either<string, ReadonlyArray<Document> | undefined> =>
⋮----
const recipientsFromPaymentsConfig = (
  organizationFiscalCode: OrganizationFiscalCode,
  organizationName: string,
  paymentsConfig: ReadonlyArray<SendPaymentConfig> | undefined,
  paymentsDatabase: IPaymentsDatabase,
  recipientFiscalCode: string
): Either<string, ReadonlyArray<NotificationRecipient> | undefined> =>
⋮----
const timelineFromTimelineConfig = (
  timelineConfig: ReadonlyArray<SendTimelineConfig> | undefined
): ReadonlyArray<NotificationHistory> =>
⋮----
const addMinutesToDate = (date: Date, minutesToAdd: number): Date =>
</file>

<file path="apps/dev-api-server/src/features/pn/repositories/prevalidatedUrisRepository.ts">
import { SendConfig } from "../types/sendConfig";
⋮----
interface IPrevalidatedUrisRepository {
  deleteExpiredPrevalidatedUris: () => void;
  getPrevalidatedUriExpirationDate: (uri: string) => Date | undefined;
  initializeIfNeeded: (config: SendConfig) => void;
  setPrevalidatedUri: (uri: string) => void;
}
⋮----
const initializeIfNeeded = (configuration: SendConfig): void =>
⋮----
const durationInSeconds = ()
⋮----
const setPrevalidatedUri = (uri: string) =>
⋮----
const getPrevalidatedUriExpirationDate = (uri: string): Date | undefined
⋮----
const deleteExpiredPrevalidatedUris = () =>
</file>

<file path="apps/dev-api-server/src/features/pn/routers/aarRouter.ts">
import { Request, Response, Router } from "express";
⋮----
import { ioDevServerConfig } from "../../../config";
import { getProblemJson } from "../../../payloads/error";
import { addHandler } from "../../../payloads/response";
import { handleLeftEitherIfNeeded } from "../../../utils/error";
import { logExpressResponseWarning } from "../../../utils/logging";
import { authenticationMiddleware } from "../middlewares/authenticationMiddleware";
import { initializationMiddleware } from "../middlewares/initializationMiddleware";
import { AARRepository } from "../repositories/aarRepository";
import { notificationOrMandateDataFromQRCode } from "../services/aarService";
import { checkAndValidateLollipopAndTaxId } from "../services/commonService";
⋮----
export const generateCheckQRPath = ()
</file>

<file path="apps/dev-api-server/src/features/pn/routers/documentsRouter.ts">
import { Request, Response, Router } from "express";
⋮----
import { ioDevServerConfig } from "../../../config";
import { addHandler } from "../../../payloads/response";
import { handleLeftEitherIfNeeded } from "../../../utils/error";
import { authenticationMiddleware } from "../middlewares/authenticationMiddleware";
import { initializationMiddleware } from "../middlewares/initializationMiddleware";
import { DocumentCategory } from "../models/Document";
import {
  checkAndValidateLollipopAndTaxId,
  checkSourceHeaderNonBlocking,
  mandateIdFromQuery
} from "../services/commonService";
import {
  checkAndValidateAttachmentIndex,
  checkAndValidateAttachmentName,
  notificationAttachmentDownloadMetadataResponseForAttachment
} from "../services/documentsService";
import { checkAndVerifyExistingMandate } from "../services/mandateService";
import { notificationFromIUN } from "../services/notificationsService";
⋮----
export const generateDocumentPath = (
  iun: string,
  index: string,
  mandateId?: string
) =>
export const generatePaymentDocumentPath = (
  iun: string,
  index: string,
  category: Extract<DocumentCategory, "F24" | "PAGOPA">,
  mandateId?: string
) =>
</file>

<file path="apps/dev-api-server/src/features/pn/routers/lollipopLambda.ts">
import { Request, Response, Router } from "express";
⋮----
import { ioDevServerConfig } from "../../../config";
import { addHandler } from "../../../payloads/response";
import { handleLeftEitherIfNeeded } from "../../../utils/error";
import { authenticationMiddleware } from "../middlewares/authenticationMiddleware";
import { initializationMiddleware } from "../middlewares/initializationMiddleware";
import { lollipopLambdaResponseFromBodyAndConfig } from "../services/lollipopLambdaService";
import { checkAndValidateLollipopHeaders } from "../services/lollipopService";
⋮----
export const generateLollipopLambdaGetPath = ()
⋮----
const commonLollipopLambdaHandling = (
  requestVerb: "GET" | "POST",
  req: Request,
  res: Response
) =>
</file>

<file path="apps/dev-api-server/src/features/pn/routers/mandatesRouter.ts">
import { Request, Response, Router } from "express";
⋮----
import { ioDevServerConfig } from "../../../config";
import { addHandler } from "../../../payloads/response";
import { handleLeftEitherIfNeeded } from "../../../utils/error";
import { authenticationMiddleware } from "../middlewares/authenticationMiddleware";
import { initializationMiddleware } from "../middlewares/initializationMiddleware";
import { MandateRepository } from "../repositories/mandateRepository";
import { checkAndValidateLollipopAndTaxId } from "../services/commonService";
import {
  checkAndCreateTemporaryMandate,
  checkAndCreateValidationCode,
  validationCodeToMandateCreationResponse
} from "../services/mandateService";
⋮----
export const generateCreateMandatePath = ()
⋮----
export const generateAcceptMandatePath = (mandateId: string)
</file>

<file path="apps/dev-api-server/src/features/pn/routers/notificationsRouter.ts">
import { Request, Response, Router } from "express";
⋮----
import { ioDevServerConfig } from "../../../config";
import { getProblemJson } from "../../../payloads/error";
import { addHandler } from "../../../payloads/response";
import { handleLeftEitherIfNeeded } from "../../../utils/error";
import { logExpressResponseWarning } from "../../../utils/logging";
import { authenticationMiddleware } from "../middlewares/authenticationMiddleware";
import { initializationMiddleware } from "../middlewares/initializationMiddleware";
import {
  checkAndValidateLollipopAndTaxId,
  checkSourceHeaderNonBlocking,
  mandateIdFromQuery
} from "../services/commonService";
import {
  notificationFromIUN,
  preconditionsForNotification,
  thirdPartyMessageFromIUNTaxIdAndMandateId
} from "../services/notificationsService";
⋮----
export const generateNotificationDisclaimerPath = (iun: string)
export const generateNotificationPath = (iun: string, mandateId?: string) =>
</file>

<file path="apps/dev-api-server/src/features/pn/routers/prevalidatedUrisRouter.ts">
import { Request, Response, Router } from "express";
⋮----
import { addHandler } from "../../../payloads/response";
import { handleLeftEitherIfNeeded } from "../../../utils/error";
import { initializationMiddleware } from "../middlewares/initializationMiddleware";
import { checkValidateAndGetRelativePath } from "../services/prevalidatedUrisService";
⋮----
export const generatePrevalidatedUriPath = (uri: string)
</file>

<file path="apps/dev-api-server/src/features/pn/routers/serviceRouter.ts">
import { SendActivation } from "@io-app/api-types/generated/definitions/communication/SendActivation";
import { PNActivation } from "@io-app/api-types/generated/definitions/pn/PNActivation";
import { NonNegativeInteger } from "@pagopa/ts-commons/lib/numbers";
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
import { Request, Response, Router } from "express";
⋮----
import { ioDevServerConfig } from "../../../config";
import { getProblemJson } from "../../../payloads/error";
import { addHandler } from "../../../payloads/response";
import { logExpressResponseWarning } from "../../../utils/logging";
import { addApiCommunicationV1Prefix } from "../../../utils/strings";
import ServicesDB from "../../services/persistence/servicesDatabase";
import { sendServiceId } from "../services/dataService";
⋮----
const handlePostSendActivation = (req: Request, res: Response) =>
</file>

<file path="apps/dev-api-server/src/features/pn/services/aarService.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { AARQRCodeCheckResponse } from "@io-app/api-types/generated/definitions/pn/aar/AARQRCodeCheckResponse";
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
import { Either, isLeft, isRight, left } from "fp-ts/lib/Either";
⋮----
import { ioDevServerConfig } from "../../../config";
import { getProblemJson } from "../../../payloads/error";
import { getProfile } from "../../../persistence/profile/profile";
import { ExpressFailure } from "../../../utils/expressDTO";
import { AARRepository } from "../repositories/aarRepository";
import { MandateRepository } from "../repositories/mandateRepository";
import { NotificationRepository } from "../repositories/notificationRepository";
⋮----
export const notificationOrMandateDataFromQRCode = (
  inputQRCodeContent: string,
  taxId: string
): Either<ExpressFailure, AARQRCodeCheckResponse> =>
⋮----
const fakeDenominationFromFiscalCode = (fiscalCode: string) =>
⋮----
const fakeNameFromCharacter = (character: string) =>
⋮----
const fakeSurnameFromCharacter = (character: string) =>
⋮----
const profileFullnameOrDefault = () =>
⋮----
const aarQRCodeCheckResponseFromData = (
  iun: string,
  denomination: string,
  fiscalCode: string,
  mandateId?: string
): Either<ExpressFailure, AARQRCodeCheckResponse> =>
</file>

<file path="apps/dev-api-server/src/features/pn/services/commonService.ts">
import { Request } from "express";
import { Either, isLeft, left, right } from "fp-ts/lib/Either";
import { IncomingHttpHeaders } from "node:http";
⋮----
import { getProblemJson } from "../../../payloads/error";
import { ExpressFailure } from "../../../utils/expressDTO";
import { logWarning } from "../../../utils/logging";
import { SendConfig } from "../types/sendConfig";
import { checkAndValidateLollipopHeaders } from "./lollipopService";
⋮----
export const checkAndValidateLollipopAndTaxId = (
  configuration: SendConfig,
  request: Request
): Either<ExpressFailure, string> =>
⋮----
const checkTaxIdHeader = (
  headers: IncomingHttpHeaders
): Either<ExpressFailure, string> =>
⋮----
const compareTaxIdToLollipopUserId = (
  lollipopTaxId: string,
  taxId: string
): Either<ExpressFailure, true> =>
⋮----
export const checkSourceHeaderNonBlocking = (
  headers: IncomingHttpHeaders
): void =>
⋮----
export const mandateIdFromQuery = (req: Request): string | undefined =>
</file>

<file path="apps/dev-api-server/src/features/pn/services/dataService.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { CreatedMessageWithContentAndAttachments } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndAttachments";
import { HasPreconditionEnum } from "@io-app/api-types/generated/definitions/communication/HasPrecondition";
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { SpecialServiceCategoryEnum } from "@io-app/api-types/generated/definitions/services/SpecialServiceCategory";
import { StandardServiceCategoryEnum } from "@io-app/api-types/generated/definitions/services/StandardServiceCategory";
⋮----
import { getNewMessage } from "../../../populate-persistence";
import { IoDevServerConfig } from "../../../types/config";
import { validatePayload } from "../../../utils/validator";
import { nextMessageIdAndCreationDate } from "../../messages/utils";
import {
  ioOrganizationFiscalCode,
  ioOrganizationName
} from "../../services/persistence/services/factory";
⋮----
export const createSENDService = (): ServiceDetails =>
⋮----
export const createSENDOptInService = (): ServiceDetails =>
⋮----
export const createSENDOptInMessage = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments> =>
⋮----
export const createSENDMessagesOnIO = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments> =>
</file>

<file path="apps/dev-api-server/src/features/pn/services/documentsService.ts">
import { NotificationAttachmentDownloadMetadataResponse } from "@io-app/api-types/generated/definitions/pn/NotificationAttachmentDownloadMetadataResponse";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { Request } from "express";
import { Either, isLeft, left, right } from "fp-ts/lib/Either";
⋮----
import { getProblemJson } from "../../../payloads/error";
import { ExpressFailure } from "../../../utils/expressDTO";
import { serverUrl } from "../../../utils/server";
import { Document, DocumentCategory } from "../models/Document";
import { Notification } from "../models/Notification";
import { DocumentsRepository } from "../repositories/documentRepository";
import { PrevalidatedUrisRepository } from "../repositories/prevalidatedUrisRepository";
import { generatePrevalidatedUriPath } from "../routers/prevalidatedUrisRouter";
import { generateUriForRelativePath } from "./prevalidatedUrisService";
⋮----
export const checkAndValidateAttachmentName = (
  req: Request
): Either<ExpressFailure, Extract<DocumentCategory, "F24" | "PAGOPA">> =>
⋮----
export const checkAndValidateAttachmentIndex = (
  documentCategory: DocumentCategory,
  notification: Notification,
  req: Request
): Either<ExpressFailure, number> =>
⋮----
export const notificationAttachmentDownloadMetadataResponseForAttachment = (
  index: number,
  category: DocumentCategory
): Either<ExpressFailure, NotificationAttachmentDownloadMetadataResponse> =>
⋮----
const notificationAttachmentDownloadMetadataResponseForDocument = (
  index: number
): Either<ExpressFailure, NotificationAttachmentDownloadMetadataResponse> =>
⋮----
const notificationAttachmentDownloadMetadataResponseForPaymentDocument = (
  index: number
): Either<ExpressFailure, NotificationAttachmentDownloadMetadataResponse> =>
⋮----
const documentToNotificationAttachmentDownloadMetadataResponse = (
  document: Document,
  isRetryAfter: boolean
): Either<ExpressFailure, NotificationAttachmentDownloadMetadataResponse> =>
</file>

<file path="apps/dev-api-server/src/features/pn/services/lollipopLambdaService.ts">
import { ErrorResponse } from "@io-app/api-types/generated/definitions/pn/lollipop-lambda/ErrorResponse";
import { SuccessResponse } from "@io-app/api-types/generated/definitions/pn/lollipop-lambda/SuccessResponse";
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
import { Either, isLeft, left } from "fp-ts/lib/Either";
⋮----
import { getProblemJson } from "../../../payloads/error";
import { ExpressFailure } from "../../../utils/expressDTO";
import { SendConfig } from "../types/sendConfig";
⋮----
export const lollipopLambdaResponseFromBodyAndConfig = (
  requestVerb: "GET" | "POST",
  requestBody: unknown,
  sendConfig: SendConfig
): Either<ExpressFailure, SuccessResponse> =>
⋮----
const stringOrUndefinedToByteLengthOrUndefined = (
  input: string | undefined
): number | undefined
⋮----
const unknownBodyToStringOrUndefined = (body: unknown): string | undefined =>
</file>

<file path="apps/dev-api-server/src/features/pn/services/lollipopService.ts">
import { Either, left, right } from "fp-ts/lib/Either";
import { IncomingHttpHeaders } from "node:http";
⋮----
import { getProblemJson } from "../../../payloads/error";
import { ExpressFailure } from "../../../utils/expressDTO";
⋮----
export type LollipopHeaders = {
  signature: string;
  "signature-input": string;
  "x-pagopa-lollipop-assertion-ref": string;
  "x-pagopa-lollipop-assertion-type": string;
  "x-pagopa-lollipop-auth-jwt": string;
  "x-pagopa-lollipop-original-method":
    | "DELETE"
    | "GET"
    | "PATCH"
    | "POST"
    | "PUT";
  "x-pagopa-lollipop-original-url": string;
  "x-pagopa-lollipop-public-key": string;
  "x-pagopa-lollipop-user-id": string;
};
⋮----
export const checkAndValidateLollipopHeaders = (
  headers: IncomingHttpHeaders
): Either<ExpressFailure, LollipopHeaders> =>
⋮----
const isStringHeaderValue = (input: Array<string> | string | undefined)
⋮----
const lollipopFailureResponse = (reason: string): ExpressFailure => (
</file>

<file path="apps/dev-api-server/src/features/pn/services/mandateService.ts">
import { CIEValidationData } from "@io-app/api-types/generated/definitions/pn/aar/CIEValidationData";
import { MandateCreationResponse } from "@io-app/api-types/generated/definitions/pn/aar/MandateCreationResponse";
import { RequestCheckQrMandateDto } from "@io-app/api-types/generated/definitions/pn/aar/RequestCheckQrMandateDto";
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
import { Either, isLeft, left, right } from "fp-ts/lib/Either";
⋮----
import { getProblemJson } from "../../../payloads/error";
import { ExpressFailure } from "../../../utils/expressDTO";
import { Mandate } from "../models/Mandate";
import { ValidationCode } from "../models/ValidationCode";
import { AARRepository } from "../repositories/aarRepository";
import { MandateRepository } from "../repositories/mandateRepository";
import { NotificationRepository } from "../repositories/notificationRepository";
⋮----
export const checkAndVerifyExistingMandate = (
  iun: string,
  mandateId: string | undefined,
  taxId: string
): Either<ExpressFailure, Mandate> =>
⋮----
export const checkAndCreateTemporaryMandate = (
  body: object,
  mandateId: string,
  taxId: string
): Either<ExpressFailure, Mandate> =>
⋮----
export const checkAndCreateValidationCode = (
  body: object,
  taxId: string
): Either<ExpressFailure, ValidationCode> =>
⋮----
export const validationCodeToMandateCreationResponse = (
  validationCode: ValidationCode
): Either<ExpressFailure, MandateCreationResponse> =>
</file>

<file path="apps/dev-api-server/src/features/pn/services/notificationsService.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { PreconditionContent } from "@io-app/api-types/generated/definitions/pn/PreconditionContent";
import { ThirdPartyMessage } from "@io-app/api-types/generated/definitions/pn/ThirdPartyMessage";
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
import { Either, isLeft, left, right } from "fp-ts/lib/Either";
import { isSome } from "fp-ts/lib/Option";
⋮----
import { getProblemJson } from "../../../payloads/error";
import { PaymentsDatabase } from "../../../persistence/payments";
import { isProcessedPayment } from "../../../types/PaymentStatus";
import { ExpressFailure } from "../../../utils/expressDTO";
import { NotificationRepository } from "../repositories/notificationRepository";
import {
  Notification,
  NotificationHistory,
  NotificationRecipient
} from "./../models/Notification";
import { checkAndVerifyExistingMandate } from "./mandateService";
⋮----
export const notificationFromIUN = (
  iun: string
): Either<ExpressFailure,
⋮----
export const preconditionsForNotification = (
  notification: Notification
): PreconditionContent =>
⋮----
export const thirdPartyMessageFromIUNTaxIdAndMandateId = (
  iun: string,
  taxId: string,
  mandateId?: string
): Either<ExpressFailure, ThirdPartyMessage> =>
⋮----
const notificationToThirdPartyMessage = (
  notification: Notification
): Either<string, ThirdPartyMessage> =>
⋮----
const completedPaymentsFromNotification = (notification: Notification)
⋮----
const attachmentsFromNotification = (notification: Notification)
⋮----
const notificationStatusHistoryFromHistory = (
  history: ReadonlyArray<NotificationHistory>
)
⋮----
const recipientsFromRecipients = (
  recipients: ReadonlyArray<NotificationRecipient> | undefined
)
</file>

<file path="apps/dev-api-server/src/features/pn/services/prevalidatedUrisService.ts">
import { Request } from "express";
import { Either, left, right } from "fp-ts/lib/Either";
import { ulid } from "ulid";
⋮----
import { getProblemJson } from "../../../payloads/error";
import { ExpressFailure } from "../../../utils/expressDTO";
import { PrevalidatedUrisRepository } from "../repositories/prevalidatedUrisRepository";
⋮----
export const generateUriForRelativePath = (relativePath: string)
⋮----
export const checkValidateAndGetRelativePath = (
  request: Request
): Either<ExpressFailure, string> =>
</file>

<file path="apps/dev-api-server/src/features/pn/types/notificationPaymentInfo.ts">
import { OrganizationFiscalCode } from "@io-app/api-types/generated/definitions/communication/OrganizationFiscalCode";
import { PaymentNoticeNumber } from "@io-app/api-types/generated/definitions/communication/PaymentNoticeNumber";
⋮----
export type NotificationPaymentInfo = {
  creditorTaxId: OrganizationFiscalCode;
  noticeCode: PaymentNoticeNumber;
};
</file>

<file path="apps/dev-api-server/src/features/pn/types/sendConfig.ts">
export type SendPaymentConfig = t.TypeOf<typeof SendPaymentConfig>;
⋮----
export type SendTimelineConfig = t.TypeOf<typeof SendTimelineConfig>;
⋮----
export type SendConfig = t.TypeOf<typeof SendConfig>;
</file>

<file path="apps/dev-api-server/src/features/services/payloads/get-featured-institutions.ts">
import { Institutions } from "@io-app/api-types/generated/definitions/services/Institutions";
⋮----
import { pipe } from "fp-ts/lib/function";
import _ from "lodash";
⋮----
import { ioDevServerConfig } from "../../../config";
import ServicesDB from "../persistence/servicesDatabase";
import { getInstitutions } from "../utils/institutions";
⋮----
export const getFeaturedInstitutionsResponsePayload = (): Institutions =>
</file>

<file path="apps/dev-api-server/src/features/services/payloads/get-featured-services.ts">
import { FeaturedService } from "@io-app/api-types/generated/definitions/services/FeaturedService";
import { FeaturedServices } from "@io-app/api-types/generated/definitions/services/FeaturedServices";
⋮----
import { pipe } from "fp-ts/lib/function";
import _ from "lodash";
⋮----
import { ioDevServerConfig } from "../../../config";
import { cgnServiceId } from "../persistence/services/special/cgn-service";
import ServicesDB from "../persistence/servicesDatabase";
⋮----
export const getFeaturedServicesResponsePayload = (): FeaturedServices =>
</file>

<file path="apps/dev-api-server/src/features/services/payloads/get-institutions.ts">
import { Institution } from "@io-app/api-types/generated/definitions/services/Institution";
import { InstitutionsResource } from "@io-app/api-types/generated/definitions/services/InstitutionsResource";
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
⋮----
import { identity, pipe } from "fp-ts/lib/function";
⋮----
import _ from "lodash";
⋮----
import ServicesDB from "../persistence/servicesDatabase";
import { getInstitutions, InstitutionWithScope } from "../utils/institutions";
⋮----
const filterByScope = (
  institution: InstitutionWithScope,
  scope?: ScopeTypeEnum
) =>
⋮----
const filterBySearch = (institution: InstitutionWithScope, search?: string) =>
⋮----
export const getInstitutionsResponsePayload = (
  limit = 20,
  offset = 0,
  scope?: ScopeTypeEnum,
  search?: string
): O.Option<InstitutionsResource> =>
</file>

<file path="apps/dev-api-server/src/features/services/payloads/get-services.ts">
import { InstitutionServicesResource } from "@io-app/api-types/generated/definitions/services/InstitutionServicesResource";
import { ServiceMinified } from "@io-app/api-types/generated/definitions/services/ServiceMinified";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import _ from "lodash";
⋮----
import ServicesDB from "../persistence/servicesDatabase";
⋮----
export const getServicesByInstitutionIdResponsePayload = (
  institutionId: string,
  limit = 20,
  offset = 0
): O.Option<InstitutionServicesResource> =>
</file>

<file path="apps/dev-api-server/src/features/services/persistence/services/special/cdc-service.ts">
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ServiceMetadata } from "@io-app/api-types/generated/definitions/services/ServiceMetadata";
import { SpecialServiceCategoryEnum } from "@io-app/api-types/generated/definitions/services/SpecialServiceCategory";
import { SpecialServiceMetadata } from "@io-app/api-types/generated/definitions/services/SpecialServiceMetadata";
import {
  NonEmptyString,
  OrganizationFiscalCode
} from "@pagopa/ts-commons/lib/strings";
⋮----
import { SpecialServiceGenerator } from "../factory";
⋮----
export const createCdcService: SpecialServiceGenerator = (
  createService: (serviceId: string) => ServiceDetails,
  createServiceMetadata: (scope: ScopeTypeEnum) => ServiceMetadata,
  organizationFiscalCode: OrganizationFiscalCode
): ServiceDetails => (
</file>

<file path="apps/dev-api-server/src/features/services/persistence/services/special/cgn-service.ts">
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ServiceMetadata } from "@io-app/api-types/generated/definitions/services/ServiceMetadata";
import { SpecialServiceCategoryEnum } from "@io-app/api-types/generated/definitions/services/SpecialServiceCategory";
import { SpecialServiceMetadata } from "@io-app/api-types/generated/definitions/services/SpecialServiceMetadata";
import {
  NonEmptyString,
  OrganizationFiscalCode
} from "@pagopa/ts-commons/lib/strings";
⋮----
import { SpecialServiceGenerator } from "../factory";
⋮----
export const createCgnService: SpecialServiceGenerator = (
  createService: (serviceId: string) => ServiceDetails,
  createServiceMetadata: (scope: ScopeTypeEnum) => ServiceMetadata,
  organizationFiscalCode: OrganizationFiscalCode
): ServiceDetails => (
</file>

<file path="apps/dev-api-server/src/features/services/persistence/services/special/fci-service.ts">
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ServiceMetadata } from "@io-app/api-types/generated/definitions/services/ServiceMetadata";
import {
  NonEmptyString,
  OrganizationFiscalCode
} from "@pagopa/ts-commons/lib/strings";
⋮----
import { SpecialServiceGenerator } from "../factory";
⋮----
export const createFciService: SpecialServiceGenerator = (
  createService: (serviceId: string) => ServiceDetails,
  createServiceMetadata: (scope: ScopeTypeEnum) => ServiceMetadata,
  organizationFiscalCode: OrganizationFiscalCode
): ServiceDetails => (
</file>

<file path="apps/dev-api-server/src/features/services/persistence/services/factory.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { ServicePreference } from "@io-app/api-types/generated/definitions/identity/ServicePreference";
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ServiceMetadata } from "@io-app/api-types/generated/definitions/services/ServiceMetadata";
import { StandardServiceCategoryEnum } from "@io-app/api-types/generated/definitions/services/StandardServiceCategory";
import {
  NonEmptyString,
  OrganizationFiscalCode
} from "@pagopa/ts-commons/lib/strings";
⋮----
import { getRandomValue } from "../../../../utils/random";
import { validatePayload } from "../../../../utils/validator";
import { frontMatter2CTA2 } from "../../../../utils/variables";
⋮----
const createLocalServices = (
  count: number,
  serviceStartIndex: number,
  aggregationCount = 3
): Array<ServiceDetails>
⋮----
const createNationalServices = (
  count: number,
  serviceStartIndex: number,
  aggregationCount = 3
): Array<ServiceDetails>
⋮----
const createSpecialServices = (
  specialServiceGeneratorTuples: Array<[boolean, SpecialServiceGenerator]>,
  serviceStartIndex: number,
  aggregationCount = 3
): Array<ServiceDetails>
⋮----
const createServicePreferenceSource = (
  serviceId: ServiceId,
  isSpecialService = false
): ServicePreferenceSource => (
⋮----
const createServicePreferences = (
  servicesSources: ReadonlyArray<ServicePreferenceSource>,
  customPreferenceEnabledGenerators: Map<ServiceId, () => boolean>
) =>
⋮----
const preferenceGenerator = (
      shouldUseServicesConfigForRandomValues: boolean
)
⋮----
const createServices = (
  scope: ScopeTypeEnum,
  count: number,
  serviceStartIndex: number,
  aggregationCount: number
): Array<ServiceDetails>
⋮----
export const createServiceFromFactory = (serviceId: string): ServiceDetails =>
⋮----
export const createServiceMetadataFromFactory = (
  scope: ScopeTypeEnum
): ServiceMetadata => (
⋮----
const createSpecialServicesInternal = (
  specialServiceGeneratorTuples: Array<[boolean, SpecialServiceGenerator]>,
  serviceStartIndex: number,
  aggregationCount: number
): Array<ServiceDetails> =>
⋮----
const getOrganizationIndex = (serviceIndex: number, aggregationCount: number)
⋮----
const getOrganizationFiscalCode = (organizationsCount: number)
⋮----
export type SpecialServiceGenerator = (
  createService: (serviceId: string) => ServiceDetails,
  createServiceMetadata: (scope: ScopeTypeEnum) => ServiceMetadata,
  organizationFiscalCode: OrganizationFiscalCode
) => ServiceDetails;
⋮----
type ServicePreferenceSource = {
  isSpecialService: boolean;
  serviceId: ServiceId;
};
</file>

<file path="apps/dev-api-server/src/features/services/persistence/servicesDatabase.ts">
import { ServicePreference } from "@io-app/api-types/generated/definitions/identity/ServicePreference";
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { generateIDPayServices } from "../../../payloads/features/idpay/generateIDPayServices";
import { isCgnActivated } from "../../../routers/features/cgn";
import { IoDevServerConfig } from "../../../types/config";
import {
  createSENDOptInService,
  createSENDService
} from "../../pn/services/dataService";
import ServiceFactory, { SpecialServiceGenerator } from "./services/factory";
import { createCdcService } from "./services/special/cdc-service";
import { cgnServiceId, createCgnService } from "./services/special/cgn-service";
import { createFciService } from "./services/special/fci-service";
⋮----
type ServiceSummary = {
  scope: ScopeTypeEnum;
  service_id: ServiceId;
};
⋮----
const createServices = (config: IoDevServerConfig) =>
⋮----
const deleteServices = () =>
⋮----
const getAllServices = ()
⋮----
const getLocalServices = () => localServices.map(ls => (
const getNationalServices = () => nationalServices.map(ls => (
const getSpecialServices = () => specialServices.map(ls => (
⋮----
const getPreference = (
  serviceId: ServiceId
): Readonly<ServicePreference> | undefined
⋮----
const getService = (
  serviceId: ServiceId
): Readonly<ServiceDetails> | undefined =>
⋮----
const getSummaries = (
  excludeSpecialServices = false
): ReadonlyArray<ServiceSummary> =>
⋮----
const isSpecialService = (serviceId: ServiceId)
⋮----
const updatePreference = (
  serviceId: ServiceId,
  updatedPreference: ServicePreference
): ServicePreference | undefined =>
</file>

<file path="apps/dev-api-server/src/features/services/routers/index.ts">

</file>

<file path="apps/dev-api-server/src/features/services/routers/institutions.ts">
import { ScopeType } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { sequenceT } from "fp-ts/lib/Apply";
import { pipe } from "fp-ts/lib/function";
⋮----
import { ioDevServerConfig } from "../../../config";
import { authorizationMiddleware } from "../../../middleware/authorizationMiddleware";
import { addHandler } from "../../../payloads/response";
import { addApiCatalogV1Prefix } from "../../../utils/strings";
import { RouteHandler } from "../../../utils/types";
import { getFeaturedInstitutionsResponsePayload } from "../payloads/get-featured-institutions";
import { getInstitutionsResponsePayload } from "../payloads/get-institutions";
import { getServicesByInstitutionIdResponsePayload } from "../payloads/get-services";
import { serviceRouter } from "./router";
⋮----
type Query =
  | Array<qs.ParsedQs>
  | Array<string>
  | qs.ParsedQs
  | string
  | undefined;
⋮----
const extractQuery = (query: Query)
⋮----
const findInstitutionsHandler: RouteHandler = (req, res)
⋮----
const findInstitutionServicesHandler: RouteHandler = (req, res)
⋮----
const getFeaturedInstitutionsHandler: RouteHandler = (_, res)
</file>

<file path="apps/dev-api-server/src/features/services/routers/router.ts">
import { Router } from "express";
</file>

<file path="apps/dev-api-server/src/features/services/routers/services.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { pipe } from "fp-ts/lib/function";
⋮----
import { ioDevServerConfig } from "../../../config";
import { authorizationMiddleware } from "../../../middleware/authorizationMiddleware";
import { addHandler } from "../../../payloads/response";
import { addApiCatalogV1Prefix } from "../../../utils/strings";
import { RouteHandler } from "../../../utils/types";
import { getFeaturedServicesResponsePayload } from "../payloads/get-featured-services";
import ServicesDB from "../persistence/servicesDatabase";
import { serviceRouter } from "./router";
⋮----
const getFeaturedServicesHandler: RouteHandler = (_, res)
⋮----
const getServiceByIdHandler: RouteHandler = (req, res)
</file>

<file path="apps/dev-api-server/src/features/services/types/configuration.ts">
import { WithinRangeNumber } from "@pagopa/ts-commons/lib/numbers";
⋮----
import { HttpResponseCode } from "../../../types/httpResponseCode";
⋮----
export type ServiceConfiguration = t.TypeOf<typeof ServiceConfiguration>;
</file>

<file path="apps/dev-api-server/src/features/services/utils/institutions.ts">
import { Institution } from "@io-app/api-types/generated/definitions/services/Institution";
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
export type InstitutionWithScope = Institution & { scope?: ScopeTypeEnum };
⋮----
export const getInstitutions = (
  services: Array<ServiceDetails>
): Array<InstitutionWithScope>
</file>

<file path="apps/dev-api-server/src/features/services/index.ts">

</file>

<file path="apps/dev-api-server/src/features/trialSystem/routers/index.ts">
import { Subscription } from "@io-app/api-types/generated/definitions/trial_system/Subscription";
import { SubscriptionStateEnum } from "@io-app/api-types/generated/definitions/trial_system/SubscriptionState";
import { TrialId } from "@io-app/api-types/generated/definitions/trial_system/TrialId";
import { Router } from "express";
⋮----
import { ioDevServerConfig } from "../../../config";
import { addHandler } from "../../../payloads/response";
import { addApiV1Prefix } from "../../../utils/strings";
⋮----
const addPrefix = (path: string) => addApiV1Prefix(`/trials$
⋮----
const loadTrials = ()
</file>

<file path="apps/dev-api-server/src/middleware/authorizationMiddleware.ts">
import { Request, Response } from "express";
⋮----
import { getProblemJson } from "../payloads/error";
import { logExpressResponseWarning } from "../utils/logging";
⋮----
export const authorizationMiddleware =
(nextRequest: (_req: Request, _res: Response)
</file>

<file path="apps/dev-api-server/src/middleware/errorMiddleware.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { NextFunction, Request, Response } from "express-serve-static-core";
⋮----
import { ioDevServerConfig } from "../config";
⋮----
export const errorMiddleware = (
  _: Request,
  res: Response,
  next: NextFunction
) =>
</file>

<file path="apps/dev-api-server/src/middleware/fastLoginMiddleware.ts">
import { ProblemJson } from "@pagopa/ts-commons/lib/responses";
import { NextFunction, Request, Response } from "express-serve-static-core";
⋮----
import { ErrorDTO } from "../payloads/features/idpay/error";
import { isSessionTokenValid } from "../persistence/sessionInfo";
⋮----
type FastLoginMiddleware401Response = ErrorDTO & ProblemJson;
⋮----
export const fastLoginMiddleware = (
  req: Request,
  res: Response,
  next: NextFunction
) =>
</file>

<file path="apps/dev-api-server/src/middleware/lollipopMiddleware.ts">
import { verifySignatureHeader } from "@mattrglobal/http-signatures";
import { Request, Response } from "express-serve-static-core";
⋮----
import { ioDevServerConfig } from "../config";
import { getProblemJson } from "../payloads/error";
import {
  getPublicKey,
  isAssertionRefStillValid
} from "../persistence/lollipop";
import { unknownToString } from "../utils/error";
import { signAlgorithmToVerifierMap } from "../utils/httpSignature";
import { serverUrl } from "../utils/server";
⋮----
type LollipopHTTPStatusError = {
  code: number;
  problemJson: string;
};
⋮----
const isLollipopConfigEnabled = ()
⋮----
export const lollipopMiddleware =
(nextMiddleware: (embeddedRequest: Request, _: Response)
⋮----
const verifyLollipopSignatureHeader = async (
  req: Request,
  _: Response
): Promise<E.Either<LollipopHTTPStatusError, true>> =>
⋮----
const toVerifySignatureHeaderOptions = (req: Request, publicKey: jose.JWK) =>
⋮----
const brokenVerifier = (_: jose.JWK) =>
⋮----
const toSuccessEither = (): E.Either<LollipopHTTPStatusError, true>
⋮----
const toFailureEither = (
  code: number,
  title?: string,
  detail?: string
): E.Either<LollipopHTTPStatusError, true>
</file>

<file path="apps/dev-api-server/src/payloads/features/cgn/merchants.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { Address } from "@io-app/api-types/generated/definitions/cgn/merchants/Address";
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import {
  DiscountCodeType,
  DiscountCodeTypeEnum
} from "@io-app/api-types/generated/definitions/cgn/merchants/DiscountCodeType";
import { Merchant } from "@io-app/api-types/generated/definitions/cgn/merchants/Merchant";
import { OfflineMerchant } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchant";
import { OfflineMerchants } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchants";
import { OnlineMerchant } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchant";
import { OnlineMerchants } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchants";
import {
  ProductCategory,
  ProductCategoryEnum
} from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategory";
import { NonNegativeInteger } from "@pagopa/ts-commons/lib/numbers";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { range } from "fp-ts/lib/NonEmptyArray";
⋮----
import { getRandomValue } from "../../../utils/random";
import { serverUrl } from "../../../utils/server";
import { ALL_NATIONAL_ADDRESSES_TEXT } from "./utils";
⋮----
const generateRandomCategoriesList = (): ReadonlyArray<ProductCategoryEnum> =>
⋮----
const generateDiscountMethod = (discountCodeType: DiscountCodeTypeEnum) =>
⋮----
const generateDiscount = (
  productCategories: ReadonlyArray<ProductCategoryEnum>,
  discountCodeType?: DiscountCodeTypeEnum
) =>
⋮----
const generateMerchantDetail = (
  merchant: OfflineMerchant | OnlineMerchant
): Merchant =>
⋮----
export const generateMerchantsAll = (): ReadonlyArray<Merchant> =>
</file>

<file path="apps/dev-api-server/src/payloads/features/cgn/utils.ts">

</file>

<file path="apps/dev-api-server/src/payloads/features/fci/create-signature-body.ts">
import { CreateSignatureBody } from "@io-app/api-types/generated/definitions/fci/CreateSignatureBody";
import { DocumentToSign } from "@io-app/api-types/generated/definitions/fci/DocumentToSign";
import { QtspClauses } from "@io-app/api-types/generated/definitions/fci/QtspClauses";
⋮----
import { qtspClauses } from "./qtsp-clauses";
import { qtspFilledDocument } from "./qtsp-filled-document";
import { documents, SIGNATURE_REQUEST_ID } from "./signature-request";
</file>

<file path="apps/dev-api-server/src/payloads/features/fci/metadata.ts">
import { Metadata } from "@io-app/api-types/generated/definitions/fci/Metadata";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
</file>

<file path="apps/dev-api-server/src/payloads/features/fci/qtsp-clauses.ts">
import { QtspClause } from "@io-app/api-types/generated/definitions/fci/QtspClause";
import { QtspClausesMetadataDetailView } from "@io-app/api-types/generated/definitions/fci/QtspClausesMetadataDetailView";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { templateUrl } from "./qtsp-filled-document";
</file>

<file path="apps/dev-api-server/src/payloads/features/fci/qtsp-filled-document.ts">
import { CreateFilledDocument } from "@io-app/api-types/generated/definitions/fci/CreateFilledDocument";
import { FilledDocumentDetailView } from "@io-app/api-types/generated/definitions/fci/FilledDocumentDetailView";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
</file>

<file path="apps/dev-api-server/src/payloads/features/fci/signature-detail-request.ts">
import {
  SignatureDetailView,
  StatusEnum as SignatureRequestStatus
} from "@io-app/api-types/generated/definitions/fci/SignatureDetailView";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
</file>

<file path="apps/dev-api-server/src/payloads/features/fci/signature-request.ts">
import { TypeEnum as ClausesTypeEnum } from "@io-app/api-types/generated/definitions/fci/Clause";
import { DocumentDetailView } from "@io-app/api-types/generated/definitions/fci/DocumentDetailView";
import { DocumentMetadata } from "@io-app/api-types/generated/definitions/fci/DocumentMetadata";
import { DossierTitle } from "@io-app/api-types/generated/definitions/fci/DossierTitle";
import { IssuerEnvironmentEnum } from "@io-app/api-types/generated/definitions/fci/IssuerEnvironment";
import { SignatureFieldToBeCreatedAttrs } from "@io-app/api-types/generated/definitions/fci/SignatureFieldToBeCreatedAttrs";
import { SignatureRequestDetailView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestDetailView";
import { SignatureRequestStatusEnum } from "@io-app/api-types/generated/definitions/fci/SignatureRequestStatus";
import { EmailString, NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { ulid } from "ulid";
⋮----
import { staticContentRootPath } from "../../../config";
import { serverUrl } from "../../../utils/server";
</file>

<file path="apps/dev-api-server/src/payloads/features/fci/signature-requests.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { DossierTitle } from "@io-app/api-types/generated/definitions/fci/DossierTitle";
import { SignatureRequestList } from "@io-app/api-types/generated/definitions/fci/SignatureRequestList";
import { SignatureRequestListView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestListView";
import { SignatureRequestStatusEnum } from "@io-app/api-types/generated/definitions/fci/SignatureRequestStatus";
import { ulid } from "ulid";
⋮----
import { getRandomEnumValue } from "../../utils/random";
⋮----
const createRandomSignatureRequest = (): SignatureRequestListView => (
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/check-prerequisites.ts">
import { fakerIT as faker } from "@faker-js/faker";
import {
  CodeEnum as AutomatedCriteriaCodeEnum,
  AutomatedCriteriaDTO,
  OperatorEnum
} from "@io-app/api-types/generated/definitions/idpay/AutomatedCriteriaDTO";
import {
  CodeEnum as OnboardingErrorCodeEnum,
  OnboardingErrorDTO
} from "@io-app/api-types/generated/definitions/idpay/OnboardingErrorDTO";
import { OnboardingInitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/OnboardingInitiativeDTO";
import { RowDataDTO } from "@io-app/api-types/generated/definitions/idpay/RowDataDTO";
import {
  SelfCriteriaBoolDTO,
  _typeEnum as SelfDeclarationBoolType
} from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaBoolDTO";
import {
  CodeEnum as SelfCriteriaInformativeCodeEnum,
  SelfCriteriaInformativeDTO,
  _typeEnum as SelfCriteriaInformativeTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaInformativeDTO";
import {
  CodeEnum as SelfCriteriaMultiCodeEnum,
  SelfCriteriaMultiTypeDTO,
  _typeEnum as SelfCriteriaMultiTypeVariationEnum
} from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaMultiTypeDTO";
import { _typeEnum as SelfDeclaratioTextType } from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaTextDTO";
⋮----
import { ulid } from "ulid";
⋮----
import { getRandomEnumValue } from "../../utils/random";
import { IDPayInitiativeID } from "./types";
⋮----
export const getCheckPrerequisitesResponseByInitiativeId = (
  id: IDPayInitiativeID
): O.Option<OnboardingInitiativeDTO>
⋮----
export const getPrerequisitesErrorByInitiativeId = (
  id: IDPayInitiativeID
): O.Option<OnboardingErrorDTO>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/error.ts">
export type ErrorDTO = {
  code: number;
  message?: string;
};
⋮----
type ErrorCodes = 400 | 401 | 403 | 404;
⋮----
export const getIdPayError = (code: ErrorCodes, message = ""): ErrorDTO => (
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/generateIDPayServices.ts">
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import {
  NonEmptyString,
  OrganizationFiscalCode
} from "@pagopa/ts-commons/lib/strings";
import _ from "lodash";
⋮----
import {
  createServiceFromFactory,
  createServiceMetadataFromFactory
} from "../../../features/services/persistence/services/factory";
import { backendStatus } from "../../backend";
import { IDPayServiceID } from "./types";
⋮----
export const generateIDPayServices = (): Array<ServiceDetails> =>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-iban-list.ts">
import { IbanListDTO } from "@io-app/api-types/generated/definitions/idpay/IbanListDTO";
⋮----
import { ibanList } from "../../../persistence/idpay";
⋮----
export const getIbanListResponse = (): IbanListDTO => (
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-iban.ts">
import { IbanDTO } from "@io-app/api-types/generated/definitions/idpay/IbanDTO";
⋮----
import { ibanList } from "../../../persistence/idpay";
⋮----
export const getIbanResponse = (input: string): O.Option<IbanDTO>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-initiative-beneficiary-detail.ts">
import { fakerIT as faker } from "@faker-js/faker";
import {
  InitiativeDetailDTO,
  StatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDetailDTO";
import { InitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import ServicesDB from "../../../features/services/persistence/servicesDatabase";
import { initiatives } from "../../../persistence/idpay";
⋮----
const generateRandomInitiativeDetailDTO = (
  initiative: InitiativeDTO
): InitiativeDetailDTO =>
⋮----
export const getInitiativeBeneficiaryDetailResponse = (
  initiativeId: string
): O.Option<InitiativeDetailDTO>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-initiative-data.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { InitiativeDataDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDataDTO";
⋮----
import { ulid } from "ulid";
⋮----
import {
  IDPayInitiativeID,
  IDPayServiceID,
  InitiativeDataDTOWithServiceId
} from "./types";
import { initiativeIdToString } from "./utils";
⋮----
const createRandomInitiativeDataDTO = (): InitiativeDataDTO => (
⋮----
export const getInitiativeDataResponseByServiceId = (
  id: IDPayServiceID
): O.Option<InitiativeDataDTO>
⋮----
export const getInitiativeDataResponseByInitiativeId = (
  initiativeId: number
): InitiativeDataDTOWithServiceId | undefined =>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-initiatives-with-instrument.ts">
import {
  InitiativesStatusDTO,
  StatusEnum as InitiativeStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativesStatusDTO";
import { InitiativesWithInstrumentDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativesWithInstrumentDTO";
import { EnableableFunctionsEnum } from "@io-app/api-types/generated/definitions/pagopa/EnableableFunctions";
import { WalletV2 } from "@io-app/api-types/generated/definitions/pagopa/WalletV2";
import { CardInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv2/CardInfo";
import { pipe } from "fp-ts/lib/function";
⋮----
import { initiatives, instruments } from "../../../persistence/idpay";
import { getWalletV2 } from "../../../routers/walletsV2";
⋮----
const initiativesStatusByWalletId = (
  idWallet: string
): ReadonlyArray<InitiativesStatusDTO>
⋮----
const getWalletById = (id: number): O.Option<WalletV2>
⋮----
export const getInitiativeWithInstrumentResponse = (
  idWallet: string
): O.Option<InitiativesWithInstrumentDTO>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-instrument-list.ts">
import { InstrumentDTO } from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
import { InstrumentListDTO } from "@io-app/api-types/generated/definitions/idpay/InstrumentListDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import { instruments } from "../../../persistence/idpay";
⋮----
export const getInstrumentListResponse = (
  initiativeId: string
): O.Option<InstrumentListDTO>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-onboarding-initiative-user-status.ts">
import { UserOnboardingStatusDTO } from "@io-app/api-types/generated/definitions/idpay/UserOnboardingStatusDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import { onboardedInitiativeStatuses } from "../../../persistence/idpay";
⋮----
export const getOnboardingInitiativeUserStatus = (): O.Option<
  Array<UserOnboardingStatusDTO>
> =>
  pipe(
    onboardedInitiativeStatuses,
    O.fromNullable,
    O.map(el => el)
  );
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-timeline-detail.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { OperationDTO } from "@io-app/api-types/generated/definitions/idpay/OperationDTO";
import { OperationListDTO } from "@io-app/api-types/generated/definitions/idpay/OperationListDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import { ulid } from "ulid";
⋮----
import { initiativeTimeline } from "../../../persistence/idpay";
⋮----
const generateRandomOperationDetailDTO = (
  operation: OperationListDTO
): OperationDTO | undefined =>
⋮----
export const getTimelineDetailResponse = (
  initiativeId: string,
  operationId: string
): O.Option<OperationDTO>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-timeline.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { TimelineDTO } from "@io-app/api-types/generated/definitions/idpay/TimelineDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import _ from "lodash";
⋮----
import { initiativeTimeline } from "../../../persistence/idpay";
⋮----
export const getTimelineResponse = (
  initiativeId: string,
  pageNo = 1,
  pageSize = 3
): O.Option<TimelineDTO>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-wallet-detail.ts">
import { InitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import { initiatives, instruments } from "../../../persistence/idpay";
⋮----
export const getWalletDetailResponse = (
  initiativeId: string
): O.Option<InitiativeDTO>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-wallet-status.ts">
import { WalletStatusDTO } from "@io-app/api-types/generated/definitions/idpay/WalletStatusDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import { initiatives } from "../../../persistence/idpay";
⋮----
export const getWalletStatusResponse = (
  initiativeId: string
): O.Option<WalletStatusDTO>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/get-wallet.ts">
import { WalletDTO } from "@io-app/api-types/generated/definitions/idpay/WalletDTO";
⋮----
import { initiatives } from "../../../persistence/idpay";
⋮----
export const getWalletResponse = (): WalletDTO => (
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/onboarding-status.ts">
import { fakerIT as faker } from "@faker-js/faker";
import {
  OnboardingStatusDTO,
  StatusEnum as OnboardingStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/OnboardingStatusDTO";
import { flow, pipe } from "fp-ts/lib/function";
⋮----
import { IDPayInitiativeID } from "./types";
import { initiativeIdFromString } from "./utils";
⋮----
export const getOnboardingStatusResponseByInitiativeId = (
  id: string
): O.Option<OnboardingStatusDTO>
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/types.ts">
import { InitiativeDataDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDataDTO";
⋮----
export enum IDPayInitiativeID {
  OK = 1,
  OK_INVITED,
  OK_NO_PREREQUISITES,
  OK_PDND_ONLY,
  OK_SELF_ONLY,
  OK_GUIDONIA,
  OK_BONUS_ELETTRODOMESTICI,
  KO_GENERIC,
  KO_NOT_STARTED,
  KO_ENDED,
  KO_BUDGET_EXHAUSTED,
  KO_STATUS_NO_REQUIREMENTS,
  KO_STATUS_NOT_IN_WHITELIST,
  KO_STATUS_ON_EVALUATION,
  KO_STATUS_NOT_ELIGIBLE,
  KO_STATUS_ONBOARDED,
  KO_STATUS_UNSUBSCRIBED,
  KO_ONBOARDING_WAITING_LIST,
  KO_FAMILY_UNIT_ALREADY_JOINED,
  KO_TOO_MANY_REQUESTS,
  KO_USER_BONUS_ALREADY_USED,
  OK_BONUS_DECODER
}
⋮----
export enum IDPayServiceID {
  OK = 1,
  OK_INVITED,
  OK_NO_PREREQUISITES,
  OK_PDND_ONLY,
  OK_SELF_ONLY,
  OK_GUIDONIA,
  OK_BONUS_ELETTRODOMESTICI,
  KO_GENERIC,
  KO_NOT_STARTED,
  KO_ENDED,
  KO_BUDGET_EXHAUSTED,
  KO_STATUS_NO_REQUIREMENTS,
  KO_STATUS_NOT_IN_WHITELIST,
  KO_STATUS_ON_EVALUATION,
  KO_STATUS_NOT_ELIGIBLE,
  KO_STATUS_ONBOARDED,
  KO_STATUS_UNSUBSCRIBED,
  KO_ONBOARDING_WAITING_LIST,
  KO_FAMILY_UNIT_ALREADY_JOINED,
  KO_TOO_MANY_REQUESTS,
  KO_USER_BONUS_ALREADY_USED,
  OK_BONUS_DECODER
}
⋮----
export type InitiativeDataDTOWithServiceId = InitiativeDataDTO & {
  serviceId: string;
};
</file>

<file path="apps/dev-api-server/src/payloads/features/idpay/utils.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { IDPayInitiativeID, IDPayServiceID } from "./types";
⋮----
export const serviceIdToString = (id: number): string
⋮----
export const initiativeIdToString = (id: number): string
⋮----
export const serviceIdFromString = (input: string): O.Option<IDPayServiceID>
⋮----
export const initiativeIdFromString = (
  input: string
): O.Option<IDPayInitiativeID>
</file>

<file path="apps/dev-api-server/src/payloads/utils/random.ts">
export const getRandomEnumValue = <T extends object>(
  enumObj: T
): T[keyof T] =>
</file>

<file path="apps/dev-api-server/src/payloads/backend.ts">
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { LevelEnum } from "@io-app/api-types/generated/definitions/content/SectionStatus";
⋮----
import { baseRelyingPartyPath } from "../features/fims/services/relyingPartyService";
import {
  sendOptInServiceId,
  sendServiceId
} from "../features/pn/services/dataService";
import { serverUrl } from "../utils/server";
</file>

<file path="apps/dev-api-server/src/payloads/error.ts">
import { ProblemJson } from "@pagopa/ts-commons/lib/responses";
⋮----
export const getProblemJson = (
  status: number,
  title?: string,
  detail?: string,
  type?: string,
  instance?: string
): ProblemJson => (
</file>

<file path="apps/dev-api-server/src/payloads/login.ts">
export enum AppUrlLoginScheme {
  native = "iologin",
  webview = "http"
}
</file>

<file path="apps/dev-api-server/src/payloads/municipality.ts">
import { Municipality } from "@io-app/api-types/generated/definitions/content/Municipality";
⋮----
import { validatePayload } from "../utils/validator";
</file>

<file path="apps/dev-api-server/src/payloads/profile.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { PushNotificationsContentTypeEnum } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatusEnum } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
import { DateFromString } from "@pagopa/ts-commons/lib/dates";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { ioDevServerConfig } from "../config";
⋮----
const optInOutputSelector =
(reminderStatus: ReminderStatusEnum)
⋮----
type OptInProps = {
  push_notifications_content_type?: PushNotificationsContentTypeEnum;
  reminder_status?: ReminderStatusEnum;
};
⋮----
export type AuthenticationProvider =
  typeof ioDevServerConfig.profile.authenticationProvider;
⋮----
export const getProfileInitialData = (
  authenticationProvider: AuthenticationProvider
)
</file>

<file path="apps/dev-api-server/src/payloads/response.ts">
import chalk from "chalk";
import { Request, Response, Router } from "express";
⋮----
export type IOResponse<T> = {
  isJson?: boolean;
  payload: T;
  status?: number;
};
⋮----
export type SupportedMethod = "delete" | "get" | "patch" | "post" | "put";
⋮----
type Route = { description?: string; method: SupportedMethod; path: string };
⋮----
const addNewRoute = (
  method: SupportedMethod,
  path: string,
  description?: string
) =>
⋮----
type HandlerOptions = {
  description?: string;
};
⋮----
export const addHandler = (
  router: Router,
  method: SupportedMethod,
  path: string,
  handleRequest: (request: Request, response: Response) => void,
  delay: () => number = () => 0,
  options?: HandlerOptions
) =>
</file>

<file path="apps/dev-api-server/src/payloads/session.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
import { SpidLevel } from "@io-app/api-types/generated/definitions/session_manager/SpidLevel";
import QueryString from "qs";
⋮----
import { getRandomValue } from "../utils/random";
import { validatePayload } from "../utils/validator";
import { IOResponse } from "./response";
⋮----
const getToken = (defaultValue: string)
⋮----
const getExpirationDate = (days: number) =>
⋮----
export const FIMSToken = () =>
⋮----
const generateSessionTokens = (): PublicSession => (
⋮----
const generateCustomObjectSessionTokens = (
  tokenString: string
): Partial<PublicSession> =>
⋮----
.replace(/[()]/g, "") // Remove parentheses
.split(",") as Array<keyof PublicSession>; // Split by comma
⋮----
// Return a filtered object based on customSession
⋮----
export const createOrRefreshSessionTokens = () =>
⋮----
export const clearSessionTokens = () =>
⋮----
export const getCustomSession = (
  query?: QueryString.ParsedQs
): IOResponse<PublicSession> | undefined
⋮----
export const shouldAddLollipopAssertionRef = (query?: QueryString.ParsedQs)
</file>

<file path="apps/dev-api-server/src/payloads/success.ts">
import { SuccessResponse } from "@io-app/api-types/generated/definitions/communication/SuccessResponse";
⋮----
import { validatePayload } from "../utils/validator";
import { IOResponse } from "./response";
⋮----
export const getSuccessResponse = (
  message?: string
): IOResponse<SuccessResponse> => (
</file>

<file path="apps/dev-api-server/src/payloads/wallet_v2.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { EnableableFunctionsEnum } from "@io-app/api-types/generated/definitions/pagopa/EnableableFunctions";
import { PayPalAccountPspInfo } from "@io-app/api-types/generated/definitions/pagopa/PayPalAccountPspInfo";
import { PayPalInfo } from "@io-app/api-types/generated/definitions/pagopa/PayPalInfo";
import {
  Wallet,
  TypeEnum as WalletV1TypeEnum
} from "@io-app/api-types/generated/definitions/pagopa/Wallet";
import {
  WalletTypeEnum,
  WalletV2
} from "@io-app/api-types/generated/definitions/pagopa/WalletV2";
import { Abi } from "@io-app/api-types/generated/definitions/pagopa/walletv2/Abi";
import { BPay } from "@io-app/api-types/generated/definitions/pagopa/walletv2/BPay";
import { BPayInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv2/BPayInfo";
import {
  Card,
  ProductTypeEnum,
  ValidityStateEnum
} from "@io-app/api-types/generated/definitions/pagopa/walletv2/Card";
import {
  CardInfo,
  TypeEnum
} from "@io-app/api-types/generated/definitions/pagopa/walletv2/CardInfo";
import { SatispayInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv2/SatispayInfo";
import { format } from "date-fns";
⋮----
import { pipe } from "fp-ts/lib/function";
import { range } from "fp-ts/lib/NonEmptyArray";
⋮----
import sha256 from "sha256";
import { match } from "ts-pattern";
⋮----
import { assetsFolder, ioDevServerConfig } from "../config";
import { getAuthenticationProvider } from "../persistence/sessionInfo";
import { readFileAsJSON } from "../utils/file";
import { isDefined } from "../utils/guards";
import {
  CreditCardBrandEnum,
  creditCardBrands,
  getCreditCardLogo
} from "../utils/payment";
import { getRandomValue } from "../utils/random";
import { validatePayload } from "../utils/validator";
import { getProfileInitialData } from "./profile";
⋮----
type CardConfig = {
  index: number;
  prefix: string;
};
⋮----
const getNextIdWallet = (): number =>
⋮----
export const resetCardConfig = () =>
⋮----
export const generateSatispayInfo = (
  count: number
): ReadonlyArray<SatispayInfo>
⋮----
export const generatePaypalInfo = (count: number): ReadonlyArray<PayPalInfo>
⋮----
export const generateBancomatPay = (
  abis: ReadonlyArray<Abi>,
  count: number
): ReadonlyArray<BPay> =>
⋮----
export const isCobadge = (wallet: WalletV2, card: CardInfo)
⋮----
export const isPrivative = (wallet: WalletV2, card: CardInfo)
⋮----
export const generateCards = (
  abis: ReadonlyArray<Abi>,
  count = 10,
  cardType: WalletTypeEnum.Bancomat | WalletTypeEnum.Card
): ReadonlyArray<CardInfo> =>
⋮----
export const convertWalletV2toV1 = (wallet: WalletV2): undefined | Wallet
⋮----
// a favourite method can be only a CreditCard, PayPal or BancomatPay
⋮----
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
⋮----
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
⋮----
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
⋮----
export const generateWalletV2FromCard = (
  card: Card,
  walletType: WalletTypeEnum,
  canMethodPay: boolean,
  enableableFunctions: ReadonlyArray<EnableableFunctionsEnum> = [
    EnableableFunctionsEnum.FA,
    EnableableFunctionsEnum.pagoPA,
    EnableableFunctionsEnum.BPD
  ]
): WalletV2 =>
⋮----
export const generatePrivativeFromWalletV2 = (
  w2: WalletV2,
  idx: number
... (36 lines truncated)
</file>

<file path="apps/dev-api-server/src/payloads/wallet.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { PspDataListResponse } from "@io-app/api-types/generated/definitions/pagopa/PspDataListResponse";
import { Transaction } from "@io-app/api-types/generated/definitions/pagopa/Transaction";
import { CreditCard } from "@io-app/api-types/generated/definitions/pagopa/walletv2/CreditCard";
import {
  LinguaEnum,
  Psp
} from "@io-app/api-types/generated/definitions/pagopa/walletv2/Psp";
import { SessionResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv2/SessionResponse";
import {
  TypeEnum,
  Wallet
} from "@io-app/api-types/generated/definitions/pagopa/walletv2/Wallet";
import { WalletListResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv2/WalletListResponse";
import { pipe } from "fp-ts/lib/function";
import { range } from "fp-ts/lib/NonEmptyArray";
⋮----
import { assetsFolder } from "../config";
import { readFileAsJSON } from "../utils/file";
import { creditCardBrands, getCreditCardLogo } from "../utils/payment";
import { getRandomValue } from "../utils/random";
import { validatePayload } from "../utils/validator";
⋮----
export const getWallets = (count = 4): WalletListResponse =>
⋮----
const generateCreditCard = (): CreditCard =>
⋮----
const generateWallet = (): Wallet =>
⋮----
export const getTransactions = (
  count: number,
  confirmed = true,
  wallets?: ReadonlyArray<Wallet>
): ReadonlyArray<Transaction> =>
</file>

<file path="apps/dev-api-server/src/persistence/profile/profile.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { Profile } from "@io-app/api-types/generated/definitions/identity/Profile";
import { UpdateProfile412ErrorTypesEnum } from "@io-app/api-types/generated/definitions/identity/UpdateProfile412ErrorTypes";
import { Request } from "express";
⋮----
import { getProblemJson } from "../../payloads/error";
import { getProfileInitialData } from "../../payloads/profile";
import { getRandomValue } from "../../utils/random";
import { CustomResponse, ResponseProblem } from "../../utils/responseTypes";
import { getAuthenticationProvider } from "../sessionInfo";
⋮----
export const getProfile = (): ProfileOperationsType["get"] =>
⋮----
export const updateProfile = (req: Request): ProfileOperationsType["post"] =>
⋮----
export const resetUserProfile = ()
⋮----
const initProfile = () =>
⋮----
export const setProfileEmailValidated = (value: boolean) =>
⋮----
export const setProfileEmailAlreadyTaken = (value: boolean) =>
⋮----
const checkProfileVersion = (profile: ReturnType<typeof Profile.decode>) =>
⋮----
const handleAlreadyTakenTestEmail = (
  email?: string
): CustomResponse | undefined =>
⋮----
type ProfileProblemDetail =
  | "BodyMalformed"
  | "Conflict"
  | "Precondition Failed";
⋮----
type ProfileProblems = {
  bodyMalformed: ResponseProblem<ProfileProblemDetail>;
  conflict: ResponseProblem<ProfileProblemDetail>;
  emailAlreadyTaken: ResponseProblem<ProfileProblemDetail>;
};
⋮----
type ProfileOperationsType = {
  get: CustomResponse;
  post: CustomResponse;
};
⋮----
const isEmptyRecord = (input: Record<string, unknown>): boolean
</file>

<file path="apps/dev-api-server/src/persistence/profile/userMetadata.ts">
import { UserDataProcessing } from "@io-app/api-types/generated/definitions/identity/UserDataProcessing";
import {
  UserDataProcessingChoice,
  UserDataProcessingChoiceEnum
} from "@io-app/api-types/generated/definitions/identity/UserDataProcessingChoice";
import { UserDataProcessingChoiceRequest } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingChoiceRequest";
import { UserDataProcessingStatusEnum } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingStatus";
import { Request } from "express";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { getProblemJson } from "../../payloads/error";
import { CustomResponse, ResponseProblem } from "../../utils/responseTypes";
import { validatePayload } from "../../utils/validator";
⋮----
export const getUserChoice = (
  req: Request
): UserMetadataOperationsType["get"] =>
⋮----
export const userDataProcessingUpdate = (
  req: Request
): UserMetadataOperationsType["post"] =>
⋮----
export const userDataProcessingDelete = (
  req: Request
): UserMetadataOperationsType["deleteData" | "deleteDownload" | "pending"] =>
⋮----
export const resetUserChoice = ()
⋮----
type UserDeleteDownloadData = {
  [key in keyof typeof UserDataProcessingChoiceEnum]:
    | undefined
    | UserDataProcessing;
};
⋮----
type UserMetadataProblemDetail = "User choice undefined";
⋮----
type UserMetadataProblems = {
  userChoiceUndefinedForDelete: ResponseProblem<UserMetadataProblemDetail>;
  userChoiceUndefinedForPost: ResponseProblem<UserMetadataProblemDetail>;
};
⋮----
type UserMetadataOperationsType = {
  deleteData: CustomResponse;
  deleteDownload: CustomResponse;
  get: CustomResponse;
  pending: CustomResponse;
  post: CustomResponse;
};
</file>

<file path="apps/dev-api-server/src/persistence/appInfo.ts">
import { Request } from "express";
⋮----
type DeviceOS = {
  Android: osPlatform;
  Darwin: osPlatform;
  iPhone: osPlatform;
};
⋮----
type osPlatform = "android" | "ios";
⋮----
type AppInfo = {
  appOs: osPlatform | undefined;
  appVersion: string | undefined;
};
⋮----
export function getAppVersion()
export const getAppOs = ()
⋮----
export const clearAppInfo = () =>
⋮----
export function setAppInfo(req: Request)
⋮----
const getOsFromUserAgent = (req: Request) =>
</file>

<file path="apps/dev-api-server/src/persistence/idpay.ts">
import { fakerIT as faker } from "@faker-js/faker";
import {
  CheckIbanStatusEnum,
  IbanDTO
} from "@io-app/api-types/generated/definitions/idpay/IbanDTO";
import {
  ChannelEnum,
  IbanOperationDTO,
  OperationTypeEnum as IbanOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/IbanOperationDTO";
import {
  InitiativeDTO,
  InitiativeRewardTypeEnum,
  StatusEnum as InitiativeStatusEnum,
  VoucherStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import {
  InstrumentDTO,
  StatusEnum as InstrumentStatus,
  InstrumentTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
import {
  InstrumentOperationDTO,
  InstrumentTypeEnum as InstrumentOperationInstrumentTypeEnum,
  OperationTypeEnum as InstrumentOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/InstrumentOperationDTO";
import {
  OnboardingOperationDTO,
  OperationTypeEnum as OnboardingOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/OnboardingOperationDTO";
import { OperationListDTO } from "@io-app/api-types/generated/definitions/idpay/OperationListDTO";
import {
  ReadmittedOperationDTO,
  OperationTypeEnum as ReadmittedOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/ReadmittedOperationDTO";
import {
  RefundOperationDTO,
  OperationTypeEnum as RefundOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/RefundOperationDTO";
import {
  InstrumentTypeEnum as OperationInstrumentTypeEnum,
  RejectedInstrumentOperationDTO,
  OperationTypeEnum as RejectedInstrumentOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/RejectedInstrumentOperationDTO";
import {
  SuspendOperationDTO,
  OperationTypeEnum as SuspendOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/SuspendOperationDTO";
import {
  StatusEnum,
  TransactionBarCodeResponse
} from "@io-app/api-types/generated/definitions/idpay/TransactionBarCodeResponse";
import {
  ChannelEnum as TransactionChannelEnum,
  TransactionOperationDTO,
  OperationTypeEnum as TransactionOperationTypeEnum,
  StatusEnum as TransactionStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/TransactionOperationDTO";
import {
  StatusEnum as OnboardedInitiativeStatusEnum,
  UserOnboardingStatusDTO
} from "@io-app/api-types/generated/definitions/idpay/UserOnboardingStatusDTO";
import { WalletV2 } from "@io-app/api-types/generated/definitions/pagopa/WalletV2";
⋮----
import { range } from "lodash";
import { ulid } from "ulid";
⋮----
import { ioDevServerConfig } from "../config";
import { InitiativeDataDTOWithServiceId } from "../payloads/features/idpay/types";
import { getRandomEnumValue } from "../payloads/utils/random";
import { getWalletV2 } from "../routers/walletsV2";
import { creditCardBrands, getCreditCardLogo } from "../utils/payment";
import { serverUrl } from "../utils/server";
⋮----
const generateRandomInitiativeDTO = (): InitiativeDTO =>
⋮----
const generateRandomIbanDTO = (): IbanDTO => (
⋮----
const generateRandomTransactionOperationDTO = (
  withInfo?: Partial<TransactionOperationDTO>
): TransactionOperationDTO =>
⋮----
const generateRandomTransactionOperationExpenseDTO = (
  withInfo?: Partial<TransactionOperationDTO>
): TransactionOperationDTO => (
⋮----
const generateRandomRefundOperationDTO = (
  withInfo?: Partial<RefundOperationDTO>
): RefundOperationDTO => (
⋮----
const generateRandomIbanOperationDTO = (): IbanOperationDTO => (
⋮----
const generateRandomOnboardingOperationDTO = (): OnboardingOperationDTO => (
⋮----
const generateRandomInstrumentOperationDTO = (
  withInfo?: Partial<InstrumentOperationDTO>
): InstrumentOperationDTO =>
⋮----
const generateRandomRejectedInstrumentOperationDTO = (
  withInfo?: Partial<RejectedInstrumentOperationDTO>
... (48 lines truncated)
</file>

<file path="apps/dev-api-server/src/persistence/lollipop.ts">
import { AssertionRef } from "@io-app/api-types/generated/definitions/session_manager/AssertionRef";
⋮----
import { ioDevServerConfig } from "../config";
import { DEFAULT_LOLLIPOP_HASH_ALGORITHM } from "../routers/public";
import { getDateMsDifference } from "../utils/date";
⋮----
type LollipopInfo = {
  instantiationDate: Date | undefined;
  lollipopAssertionRef: AssertionRef | undefined;
  lollipopPublicKey: jose.JWK | undefined;
};
⋮----
export function getAssertionRef()
⋮----
export function getPublicKey()
⋮----
export const clearLollipopInfo = ()
⋮----
export function setLollipopInfo(
  assertionRef: string | undefined,
  publicKey: jose.JWK | undefined
)
⋮----
export function setLollipopInfoEphemeral(
  assertionRef: string | undefined,
  publicKey: jose.JWK | undefined
)
⋮----
export const clearEphemeralLollipopInfo = ()
⋮----
export function concretizeEphemeralInfo()
⋮----
export const isAssertionRefStillValid = () =>
</file>

<file path="apps/dev-api-server/src/persistence/payments.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { PaymentAmount } from "@io-app/api-types/generated/definitions/communication/PaymentAmount";
import { PaymentDataWithRequiredPayee } from "@io-app/api-types/generated/definitions/communication/PaymentDataWithRequiredPayee";
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { PaymentInfoResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoResponse";
import { PaymentNoticeNumber } from "@io-app/api-types/generated/definitions/communication/PaymentNoticeNumber";
import { OrganizationFiscalCode } from "@pagopa/ts-commons/lib/strings";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import {
  PaymentStatus,
  processablePayment,
  processedPayment
} from "../types/PaymentStatus";
import { getRandomIntInRange } from "../utils/id";
import {
  detailV2EnumToPaymentProblemJSON,
  rptIdFromPaymentDataWithRequiredPayee
} from "../utils/payment";
import { decodePayload } from "../utils/validator";
⋮----
const addOrUpdatePayment = (
  paymentDataWithRequiredPayee: PaymentDataWithRequiredPayee
): PaymentDataWithRequiredPayee
⋮----
const addOrUpdatePaymentStatus = (
  rptId: string,
  paymentStatus: PaymentStatus
): PaymentStatus
⋮----
const createPaymentData = (
  organizationFiscalCode: OrganizationFiscalCode,
  invalidAfterDueDate = false,
  noticeNumber: PaymentNoticeNumber = `0${faker.string.numeric(
    17
  )}` as PaymentNoticeNumber,
  amount: PaymentAmount = getRandomIntInRange(1, 10000) as PaymentAmount
): E.Either<Array<string>, PaymentDataWithRequiredPayee>
⋮----
const createProcessablePayment = (
  rptId: string,
  amount: PaymentAmount,
  organizationFiscalCode: OrganizationFiscalCode,
  organizationName: string,
  nativeDueDate: Date = faker.date.soon()
): PaymentStatus
⋮----
const createProcessedPayment = (
  rptId: string,
  details: PaymentFaultV2Enum
): PaymentStatus
⋮----
const getPaymentStatus = (rptId: string): O.Option<PaymentStatus>
⋮----
export interface IPaymentsDatabase {
  createPaymentData: (
    organizationFiscalCode: OrganizationFiscalCode,
    invalidAfterDueDate?: boolean,
    noticeNumber?: PaymentNoticeNumber,
    amount?: PaymentAmount
  ) => E.Either<Array<string>, PaymentDataWithRequiredPayee>;
  createProcessablePayment: (
    rptId: string,
    amount: PaymentAmount,
    organizationFiscalCode: OrganizationFiscalCode,
    organizationName: string,
    nativeDueDate?: Date
  ) => PaymentStatus;
  createProcessedPayment: (
    rptId: string,
    details: PaymentFaultV2Enum
  ) => PaymentStatus;
  getPaymentStatus: (rptId: string) => O.Option<PaymentStatus>;
}
</file>

<file path="apps/dev-api-server/src/persistence/sessionInfo.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { Request } from "express";
⋮----
import { ioDevServerConfig } from "../config";
import { oneIdentityCieIdpIds } from "../payloads/login";
import { AuthenticationProvider } from "../payloads/profile";
import { createOrRefreshSessionTokens } from "../payloads/session";
import { isFeatureFlagWithMinVersionEnabled } from "../routers/features/featureFlagUtils";
import { getDateMsDifference } from "../utils/date";
⋮----
enum LoginEnum {
  fastLogin = "LV",
  standard = "STANDARD"
}
⋮----
type LoginSessionTokenInfo = {
  authenticationProvider: AuthenticationProvider | undefined;
  instantiationDate: Date | undefined;
  loginSessionToken: string | undefined;
  loginType: LoginEnum | undefined;
};
⋮----
export const getAuthenticationProvider = ()
⋮----
export const getLoginSessionToken = ()
⋮----
export const clearLoginSessionTokenInfo = ()
⋮----
const setLoginSessionToken = (newToken: string) =>
⋮----
const generateNewLoginToken = ()
⋮----
export const createOrRefreshEverySessionToken = () =>
⋮----
export const setSessionLoginType = (req: Request) =>
⋮----
export const setSessionLoginTypeFromReserve = (loginType: unknown) =>
⋮----
export const setSessionAuthenticationProvider = (req: Request) =>
⋮----
export const setSessionAuthenticationProviderFromIdp = (idp: unknown) =>
⋮----
export const isSessionTokenValid = (requestOrUndefined?: Request) =>
</file>

<file path="apps/dev-api-server/src/routers/configHomeDashboard/configHomeDashboard.ts">
import { Router } from "express";
import fs from "fs";
⋮----
import { addHandler } from "../../payloads/response";
⋮----
function extractPathsFromInclude(data: string): Array<string>
</file>

<file path="apps/dev-api-server/src/routers/features/cgn/geocoding.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { AutocompleteResultItem } from "@io-app/api-types/generated/definitions/cgn/geo/AutocompleteResultItem";
import { LookupResponse } from "@io-app/api-types/generated/definitions/cgn/geo/LookupResponse";
import { Router } from "express";
import { range } from "fp-ts/lib/NonEmptyArray";
⋮----
import { addHandler } from "../../../payloads/response";
import { addApiV1Prefix } from "../../../utils/strings";
⋮----
const addPrefix = (path: string) => addApiV1Prefix(`/geo$
</file>

<file path="apps/dev-api-server/src/routers/features/cgn/index.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { Card } from "@io-app/api-types/generated/definitions/cgn/Card";
import { StatusEnum as ActivatedStatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import {
  CardPending,
  StatusEnum as PendingStatusEnum
} from "@io-app/api-types/generated/definitions/cgn/CardPending";
import { CcdbNumber } from "@io-app/api-types/generated/definitions/cgn/CcdbNumber";
import { StatusEnum } from "@io-app/api-types/generated/definitions/cgn/CgnActivationDetail";
import {
  EycaActivationDetail,
  StatusEnum as EycaStatusEnum
} from "@io-app/api-types/generated/definitions/cgn/EycaActivationDetail";
import { EycaCard } from "@io-app/api-types/generated/definitions/cgn/EycaCard";
import { Otp } from "@io-app/api-types/generated/definitions/cgn/Otp";
import { ServicePreference } from "@io-app/api-types/generated/definitions/identity/ServicePreference";
import { NonNegativeInteger } from "@pagopa/ts-commons/lib/numbers";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { Router } from "express";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { ioDevServerConfig } from "../../../config";
import { genRandomOtpCode } from "../../../features/cgn/utils";
import { cgnServiceId } from "../../../features/services/persistence/services/special/cgn-service";
import ServicesDB from "../../../features/services/persistence/servicesDatabase";
import { addHandler } from "../../../payloads/response";
import { getRandomStringId } from "../../../utils/id";
import { getRandomValue } from "../../../utils/random";
⋮----
const addPrefix = (path: string) => `$
⋮----
export const isCgnActivated = ()
⋮----
export const resetCgn = () =>
</file>

<file path="apps/dev-api-server/src/routers/features/cgn/merchants.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { DiscountBucketCode } from "@io-app/api-types/generated/definitions/cgn/merchants/DiscountBucketCode";
import { OfflineMerchant } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchant";
import { OfflineMerchantSearchRequest } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchantSearchRequest";
import { OnlineMerchant } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchant";
import { OnlineMerchantSearchRequest } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchantSearchRequest";
import { ProductCategoryEnum } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategory";
import { SearchRequest } from "@io-app/api-types/generated/definitions/cgn/merchants/SearchRequest";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { Router } from "express";
import { reverse, sortBy } from "fp-ts/lib/Array";
import { Ord } from "fp-ts/lib/boolean";
import { pipe } from "fp-ts/lib/function";
⋮----
import { contramap } from "fp-ts/lib/Ord";
⋮----
import { getProblemJson } from "../../../payloads/error";
import {
  generateMerchantsAll,
  offlineMerchants,
  onlineMerchants
} from "../../../payloads/features/cgn/merchants";
import { addHandler } from "../../../payloads/response";
import { sendFileFromRootPath } from "../../../utils/file";
import { publicRouter } from "../../public";
⋮----
const addPrefix = (path: string) => `$
⋮----
const filterMerchants = <T extends OfflineMerchant | OnlineMerchant>(
  merchants: ReadonlyArray<T>,
  productCategories?: ReadonlyArray<ProductCategoryEnum>,
  merchantName?: string
): ReadonlyArray<T> =>
⋮----
const filters = (merchant: T): boolean
</file>

<file path="apps/dev-api-server/src/routers/features/fastLogin/index.ts">
import { FastLoginResponse } from "@io-app/api-types/generated/definitions/session_manager/FastLoginResponse";
import { Router } from "express";
⋮----
import { refreshTokenWithFastLogin } from "../../../features/fastLogin/fastLoginHandler";
import {
  generateNewNonce,
  getNonceInfo
} from "../../../features/fastLogin/nonceHandler";
import { lollipopMiddleware } from "../../../middleware/lollipopMiddleware";
import { addHandler } from "../../../payloads/response";
import { addApiAuthV1Prefix } from "../../../utils/strings";
</file>

<file path="apps/dev-api-server/src/routers/features/fci/index.ts">
import { EnvironmentEnum } from "@io-app/api-types/generated/definitions/fci/Environment";
import { SignatureRequestStatusEnum } from "@io-app/api-types/generated/definitions/fci/SignatureRequestStatus";
import { Router } from "express";
⋮----
import { pipe } from "fp-ts/lib/pipeable";
import { isEqual } from "lodash";
⋮----
import { ioDevServerConfig, staticContentRootPath } from "../../../config";
import {
  generateAndStoreQtspNonce,
  validateQtspNonce
} from "../../../features/fci/qtspNonceStore";
import { getProblemJson } from "../../../payloads/error";
import { mockFciMetadata } from "../../../payloads/features/fci/metadata";
import { qtspClauses } from "../../../payloads/features/fci/qtsp-clauses";
import { qtspFilledDocument } from "../../../payloads/features/fci/qtsp-filled-document";
import { mockSignatureDetailView } from "../../../payloads/features/fci/signature-detail-request";
import {
  CANCELED_SIGNATURE_REQUEST_ID,
  EXPIRED_SIGNATURE_REQUEST_ID,
  NO_FIELDS_SIGNATURE_REQUEST_ID,
  signatureRequestDetailViewDoc as originalSignatureRequestDetailViewDoc,
  REJECTED_SIGNATURE_REQUEST_ID,
  SIGNATURE_REQUEST_ID,
  SIGNED_EXPIRED_SIGNATURE_REQUEST_ID,
  SIGNED_SIGNATURE_REQUEST_ID,
  WAIT_QTSP_SIGNATURE_REQUEST_ID
} from "../../../payloads/features/fci/signature-request";
import { signatureRequestList } from "../../../payloads/features/fci/signature-requests";
import { addHandler } from "../../../payloads/response";
import { sendFileFromRootPath } from "../../../utils/file";
import { addApiSignV1Prefix } from "../../../utils/strings";
import { RouteHandler } from "../../../utils/types";
⋮----
const handleGetSignatureRequest: RouteHandler = (req, res) =>
⋮----
const handleGetQtspClauses: RouteHandler = (_, res) =>
⋮----
const handlePostQtspClausesFilledDocument: RouteHandler = (req, res) =>
⋮----
const handlePostSignatures: RouteHandler = (req, res) =>
⋮----
const handleGetFciDocument: RouteHandler = (req, res) =>
⋮----
const handleGetFciMetadata: RouteHandler = (_, res) =>
⋮----
const handleGetSignatureRequests: RouteHandler = (_, res) =>
</file>

<file path="apps/dev-api-server/src/routers/features/idpay/barcode.ts">
import { TransactionBarCodeRequest } from "@io-app/api-types/generated/definitions/idpay/TransactionBarCodeRequest";
import { pipe } from "fp-ts/lib/function";
⋮----
import { getIdPayError } from "../../../payloads/features/idpay/error";
import { getWalletDetailResponse } from "../../../payloads/features/idpay/get-wallet-detail";
import { getIdPayBarcodeTransaction } from "../../../persistence/idpay";
import { addIdPayHandler } from "./router";
</file>

<file path="apps/dev-api-server/src/routers/features/idpay/iban.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { getIbanResponse } from "../../../payloads/features/idpay/get-iban";
import { getIbanListResponse } from "../../../payloads/features/idpay/get-iban-list";
import { addIdPayHandler } from "./router";
</file>

<file path="apps/dev-api-server/src/routers/features/idpay/index.ts">

</file>

<file path="apps/dev-api-server/src/routers/features/idpay/onboarding.ts">
import { OnboardingDTO } from "@io-app/api-types/generated/definitions/idpay/OnboardingDTO";
import {
  CodeEnum as OnboardingErrorCodeEnum,
  OnboardingErrorDTO
} from "@io-app/api-types/generated/definitions/idpay/OnboardingErrorDTO";
import { StatusEnum as OnboardedInitiativeStatusEnum } from "@io-app/api-types/generated/definitions/idpay/UserOnboardingStatusDTO";
import { flow, pipe } from "fp-ts/lib/function";
⋮----
import {
  getCheckPrerequisitesResponseByInitiativeId,
  getPrerequisitesErrorByInitiativeId
} from "../../../payloads/features/idpay/check-prerequisites";
import { getIdPayError } from "../../../payloads/features/idpay/error";
import {
  getInitiativeDataResponseByInitiativeId,
  getInitiativeDataResponseByServiceId
} from "../../../payloads/features/idpay/get-initiative-data";
import { getOnboardingInitiativeUserStatus } from "../../../payloads/features/idpay/get-onboarding-initiative-user-status";
import { getOnboardingStatusResponseByInitiativeId } from "../../../payloads/features/idpay/onboarding-status";
import {
  initiativeIdFromString,
  serviceIdFromString
} from "../../../payloads/features/idpay/utils";
import { addOnboardedInitiativeStatus } from "../../../persistence/idpay";
import { addIdPayHandler } from "./router";
⋮----
/** Check the initiative prerequisites */
</file>

<file path="apps/dev-api-server/src/routers/features/idpay/payment.ts">
import { fakerIT as faker } from "@faker-js/faker";
import {
  AuthPaymentResponseDTO,
  StatusEnum as PaymentStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/AuthPaymentResponseDTO";
import {
  CodeEnum,
  TransactionErrorDTO
} from "@io-app/api-types/generated/definitions/idpay/TransactionErrorDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import { ulid } from "ulid";
⋮----
import { getRandomEnumValue } from "../../../payloads/utils/random";
import { initiatives } from "../../../persistence/idpay";
import { addIdPayHandler } from "./router";
⋮----
const generateRandomAuthPaymentResponseDTO = (): AuthPaymentResponseDTO =>
⋮----
const generateRandomTransactionError = (
  code: CodeEnum
): TransactionErrorDTO => (
</file>

<file path="apps/dev-api-server/src/routers/features/idpay/router.ts">
import { Request, Response, Router } from "express";
⋮----
import { addHandler, SupportedMethod } from "../../../payloads/response";
⋮----
export const addIdPayPrefix = (path: string) => `/idpay-itn$
⋮----
export const addIdPayHandler = (
  method: SupportedMethod,
  path: string,
  handleRequest: (request: Request, response: Response) => void
)
</file>

<file path="apps/dev-api-server/src/routers/features/idpay/staticCode.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { getIdPayError } from "../../../payloads/features/idpay/error";
import { getIDPayStaticCode } from "../../../persistence/idpay";
import { addIdPayHandler } from "./router";
</file>

<file path="apps/dev-api-server/src/routers/features/idpay/timeline.ts">
import { sequenceT } from "fp-ts/lib/Apply";
import { pipe } from "fp-ts/lib/function";
⋮----
import { getIdPayError } from "../../../payloads/features/idpay/error";
import { getTimelineResponse } from "../../../payloads/features/idpay/get-timeline";
import { getTimelineDetailResponse } from "../../../payloads/features/idpay/get-timeline-detail";
import { getWalletDetailResponse } from "../../../payloads/features/idpay/get-wallet-detail";
import { addIdPayHandler } from "./router";
⋮----
type Query =
  | Array<qs.ParsedQs>
  | Array<string>
  | qs.ParsedQs
  | string
  | undefined;
⋮----
const extractQuery = (query: Query)
</file>

<file path="apps/dev-api-server/src/routers/features/idpay/wallet.ts">
import { IbanPutDTO } from "@io-app/api-types/generated/definitions/idpay/IbanPutDTO";
import { StatusEnum as InitiativeStatusEnum } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { flow, pipe } from "fp-ts/lib/function";
⋮----
import { getIdPayError } from "../../../payloads/features/idpay/error";
import { getInitiativeBeneficiaryDetailResponse } from "../../../payloads/features/idpay/get-initiative-beneficiary-detail";
import { getInitiativeWithInstrumentResponse } from "../../../payloads/features/idpay/get-initiatives-with-instrument";
import { getInstrumentListResponse } from "../../../payloads/features/idpay/get-instrument-list";
import { getWalletResponse } from "../../../payloads/features/idpay/get-wallet";
import { getWalletDetailResponse } from "../../../payloads/features/idpay/get-wallet-detail";
import { getWalletStatusResponse } from "../../../payloads/features/idpay/get-wallet-status";
import {
  deleteInstrumentFromInitiative,
  enrollCodeToInitiative,
  enrollInstrumentToInitiative,
  generateIdPayCode,
  idPayCode,
  initiatives,
  storeIban,
  updateInitiative
} from "../../../persistence/idpay";
import { getWalletV2 } from "../../walletsV2";
import { addIdPayHandler } from "./router";
⋮----
const getWalletInstrument = (id: string)
</file>

<file path="apps/dev-api-server/src/routers/features/lollipop/index.ts">
import { Router } from "express";
⋮----
import { lollipopMiddleware } from "../../../middleware/lollipopMiddleware";
import { addHandler } from "../../../payloads/response";
import { getAssertionRef } from "../../../persistence/lollipop";
import { addApiIdentityV1Prefix } from "../../../utils/strings";
</file>

<file path="apps/dev-api-server/src/routers/features/featureFlagUtils.ts">
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { VersionPerPlatform } from "@io-app/api-types/generated/definitions/content/VersionPerPlatform";
import { PatternString } from "@pagopa/ts-commons/lib/strings";
import { compare } from "compare-versions";
⋮----
import { backendStatus } from "../../payloads/backend";
import { getAppOs, getAppVersion } from "../../persistence/appInfo";
⋮----
type FeatureFlagWithMinAppVersion<T> = Extract<
  keyof T,
  {
    [K in keyof T]: T[K] extends
      | undefined
      | { min_app_version?: VersionPerPlatform }
      ? K
      : never;
  }[keyof T]
>;
⋮----
const isVersionValidAndActive = (version: string | undefined): boolean =>
⋮----
export const isFeatureFlagWithMinVersionEnabled = (
  featureFlag: FeatureFlagWithMinAppVersion<BackendStatus["config"]>
): boolean =>
</file>

<file path="apps/dev-api-server/src/routers/walletsV2/methods/bancomat.ts">
import { EnableableFunctionsEnum } from "@io-app/api-types/generated/definitions/pagopa/EnableableFunctions";
import { BancomatCardsRequest } from "@io-app/api-types/generated/definitions/pagopa/walletv2/BancomatCardsRequest";
import { Card } from "@io-app/api-types/generated/definitions/pagopa/walletv2/Card";
import { Message } from "@io-app/api-types/generated/definitions/pagopa/walletv2/Message";
import { WalletTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv2/WalletV2";
import { Router } from "express";
⋮----
import { constUndefined, pipe } from "fp-ts/lib/function";
⋮----
import fs from "fs";
⋮----
import { assetsFolder } from "../../../config";
import { addHandler } from "../../../payloads/response";
import { generateWalletV2FromCard } from "../../../payloads/wallet_v2";
import { appendWalletV1Prefix } from "../../../utils/wallet";
import { abiResponse, addWalletV2, getWalletV2, pansResponse } from "../index";
⋮----
const findBancomat = (card: Card): Card | undefined
</file>

<file path="apps/dev-api-server/src/routers/walletsV2/methods/bpay.ts">
import { EnableableFunctionsEnum } from "@io-app/api-types/generated/definitions/pagopa/EnableableFunctions";
import { BPay } from "@io-app/api-types/generated/definitions/pagopa/walletv2/BPay";
import { BPayInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv2/BPayInfo";
import { BPayRequest } from "@io-app/api-types/generated/definitions/pagopa/walletv2/BPayRequest";
import { WalletTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv2/WalletV2";
import { Router } from "express";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { addHandler } from "../../../payloads/response";
import { generateWalletV2FromSatispayOrBancomatPay } from "../../../payloads/wallet_v2";
import { appendWalletV1Prefix } from "../../../utils/wallet";
import { addWalletV2, bPayResponse, getWalletV2 } from "../index";
</file>

<file path="apps/dev-api-server/src/routers/walletsV2/methods/cobadge.ts">
import { CardInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv2/CardInfo";
import { CobadegPaymentInstrumentsRequest } from "@io-app/api-types/generated/definitions/pagopa/walletv2/CobadegPaymentInstrumentsRequest";
import { CobadgeResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv2/CobadgeResponse";
import {
  PaymentInstrument,
  PaymentNetworkEnum,
  ProductTypeEnum,
  ValidityStatusEnum
} from "@io-app/api-types/generated/definitions/pagopa/walletv2/PaymentInstrument";
import { RestCobadgeResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv2/RestCobadgeResponse";
import { WalletTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv2/WalletV2";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { Request, Response, Router } from "express";
⋮----
import fs from "fs";
⋮----
import { assetsFolder } from "../../../config";
import { addHandler } from "../../../payloads/response";
import { readFileAsJSON } from "../../../utils/file";
import { appendWalletV1Prefix } from "../../../utils/wallet";
import {
  addWalletV2,
  citizenCreditCardCoBadge,
  citizenPrivativeCard,
  getWalletV2
} from "../index";
import { bancomatRouter } from "./bancomat";
⋮----
const fromCardInfoToCardBadge = (
  idWallet: number,
  card: CardInfo
): PaymentInstrument => (
⋮----
const handleCobadge = (req: Request, res: Response) =>
⋮----
const handlePrivative = (req: Request, res: Response) =>
</file>

<file path="apps/dev-api-server/src/routers/walletsV2/methods/satispay.ts">
import { Satispay } from "@io-app/api-types/generated/definitions/pagopa/walletv2/Satispay";
import { WalletTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv2/WalletV2";
import { Router } from "express";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { addHandler } from "../../../payloads/response";
import {
  generateWalletV2FromSatispayOrBancomatPay,
  satispay
} from "../../../payloads/wallet_v2";
import { appendWalletV1Prefix } from "../../../utils/wallet";
import { addWalletV2, getWalletV2, walletV2Config } from "../index";
</file>

<file path="apps/dev-api-server/src/routers/walletsV2/configDashboard.ts">
import { BPayInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv2/BPayInfo";
import { CardInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv2/CardInfo";
import { SatispayInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv2/SatispayInfo";
import { WalletTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv2/WalletV2";
import { Router } from "express";
⋮----
import { ioDevServerConfig } from "../../config";
import { addHandler } from "../../payloads/response";
import {
  isCobadge,
  isPrivative,
  resetCardConfig
} from "../../payloads/wallet_v2";
import {
  generateWalletV2Data,
  getWalletV2,
  updateWalletV2Config,
  walletV2Config
} from "./index";
⋮----
const getBPDPaymentMethod = ()
</file>

<file path="apps/dev-api-server/src/routers/walletsV2/index.ts">
import { DeletedWalletsResponse } from "@io-app/api-types/generated/definitions/pagopa/DeletedWalletsResponse";
import { EnableableFunctionsEnum } from "@io-app/api-types/generated/definitions/pagopa/EnableableFunctions";
import {
  WalletTypeEnum,
  WalletV2
} from "@io-app/api-types/generated/definitions/pagopa/WalletV2";
import { AbiListResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv2/AbiListResponse";
import { RestBPayResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv2/RestBPayResponse";
import { RestPanResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv2/RestPanResponse";
import { WalletV2ListResponse } from "@io-app/api-types/generated/definitions/pagopa/WalletV2ListResponse";
import { Router } from "express";
⋮----
import { ioDevServerConfig } from "../../config";
import { addHandler } from "../../payloads/response";
import { pspListV1, pspListV2 } from "../../payloads/wallet";
import {
  abiData,
  convertWalletV2toV1,
  generateBancomatPay,
  generateCards,
  generatePaypalInfo,
  generatePrivativeFromWalletV2,
  generateSatispayInfo,
  generateWalletV2FromCard,
  generateWalletV2FromPaypal,
  generateWalletV2FromSatispayOrBancomatPay,
  privativeIssuers
} from "../../payloads/wallet_v2";
import { WalletMethodConfig } from "../../types/config";
import { appendWalletV2Prefix, appendWalletV3Prefix } from "../../utils/wallet";
⋮----
export const getWalletV2 = (): ReadonlyArray<WalletV2>
⋮----
export const removeWalletV2 = (idWallet: number): boolean =>
⋮----
export const findWalletById = (idWallet: number): undefined | WalletV2 =>
⋮----
export const updateWalletV2Config = (config: WalletMethodConfig) =>
⋮----
const citizenBancomat = ()
⋮----
export const addWalletV2 = (
  wallets: ReadonlyArray<WalletV2>,
  append = true
) =>
⋮----
export const generateWalletV2Data = () =>
⋮----
export const resetWalletV2 = () =>
</file>

<file path="apps/dev-api-server/src/routers/misc.ts">
import { Router } from "express";
⋮----
import { ioDevServerConfig } from "../config";
import { addHandler } from "../payloads/response";
import { sendFileFromRootPath } from "../utils/file";
import { addApiV1Prefix } from "../utils/strings";
</file>

<file path="apps/dev-api-server/src/routers/profile.ts">
import { Router } from "express";
⋮----
import { addHandler } from "../payloads/response";
import {
  getProfile,
  resetUserProfile,
  updateProfile
} from "../persistence/profile/profile";
import {
  getUserChoice,
  resetUserChoice,
  userDataProcessingDelete,
  userDataProcessingUpdate
} from "../persistence/profile/userMetadata";
import { addApiIdentityV1Prefix } from "../utils/strings";
import { RouteHandler } from "../utils/types";
⋮----
const handleGetProfile: RouteHandler = (_, res) =>
⋮----
const handlePostProfile: RouteHandler = (req, res) =>
⋮----
const handleGetUserDataProcessing: RouteHandler = (req, res) =>
⋮----
const handlePostUserDataProcessing: RouteHandler = (req, res) =>
⋮----
const handleDeleteUserDataProcessing: RouteHandler = (req, res) =>
⋮----
const handlePostEmailValidationProcess: RouteHandler = (_, res) =>
⋮----
export const resetProfile = () =>
</file>

<file path="apps/dev-api-server/src/routers/public.ts">
import { JwkPublicKey, parseJwkOrError } from "@pagopa/ts-commons/lib/jwk";
import chalk from "chalk";
import { Response, Router } from "express";
⋮----
import { calculateJwkThumbprint } from "jose";
import { parseStringPromise } from "xml2js";
⋮----
import { assetsFolder, ioDevServerConfig } from "../config";
import { WALLET_ONBOARDING_PATH } from "../features/payments/utils/onboarding";
import { WALLET_PAYMENT_PATH } from "../features/payments/utils/payment";
import { backendInfo } from "../payloads/backend";
import {
  AppUrlLoginScheme,
  authorizePath,
  errorRedirectUrl,
  ioRedirectPath,
  loginLolliPopRedirect,
  redirectUrl
} from "../payloads/login";
import { addHandler } from "../payloads/response";
import { clearSessionTokens } from "../payloads/session";
import { clearAppInfo, setAppInfo } from "../persistence/appInfo";
import {
  clearEphemeralLollipopInfo,
  clearLollipopInfo,
  concretizeEphemeralInfo,
  setLollipopInfo,
  setLollipopInfoEphemeral
} from "../persistence/lollipop";
import {
  setProfileEmailAlreadyTaken,
  setProfileEmailValidated
} from "../persistence/profile/profile";
import {
  clearLoginSessionTokenInfo,
  createOrRefreshEverySessionToken,
  getLoginSessionToken,
  setSessionAuthenticationProvider,
  setSessionAuthenticationProviderFromIdp,
  setSessionLoginType,
  setSessionLoginTypeFromReserve
} from "../persistence/sessionInfo";
import { readFileAsJSON, sendFileFromRootPath } from "../utils/file";
import { getSamlRequest } from "../utils/login";
import { addApiAuthV1Prefix, uuidv4 } from "../utils/strings";
import { resetCgn } from "./features/cgn";
import { isFeatureFlagWithMinVersionEnabled } from "./features/featureFlagUtils";
import { resetProfile } from "./profile";
import { resetWalletV2 } from "./walletsV2";
⋮----
type emptyFunc = () => void;
⋮----
const handleLollipopLoginRedirect = (
  res: Response,
  samlRequest: string,
  thumbprint?: string
) =>
⋮----
const debugSamlRequestIfNeeded = async (
  samlReq: string,
  thumbprint?: string
) =>
</file>

<file path="apps/dev-api-server/src/routers/service.ts">
import { ServicePreference } from "@io-app/api-types/generated/definitions/identity/ServicePreference";
import { UpsertServicePreference } from "@io-app/api-types/generated/definitions/identity/UpsertServicePreference";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { Router } from "express";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { ioDevServerConfig } from "../config";
import ServicesDB from "../features/services/persistence/servicesDatabase";
import { addHandler } from "../payloads/response";
import { sendFileFromRootPath } from "../utils/file";
import { addApiIdentityV1Prefix } from "../utils/strings";
import { RouteHandler } from "../utils/types";
import { publicRouter } from "./public";
⋮----
const handleGetServicePreference: RouteHandler = (req, res)
⋮----
const handlePostServicePreference: RouteHandler = (req, res) =>
⋮----
const handleGetServicesWebView: RouteHandler = (req, res) =>
⋮----
const handleGetLocalServices: RouteHandler = (_, res) =>
</file>

<file path="apps/dev-api-server/src/routers/services_metadata.ts">
import { SpidIdps } from "@io-app/api-types/generated/definitions/content/SpidIdps";
import { VersionInfo } from "@io-app/api-types/generated/definitions/content/VersionInfo";
import { Zendesk } from "@io-app/api-types/generated/definitions/content/Zendesk";
import { ZendeskSubcategoriesErrors } from "@io-app/api-types/generated/definitions/content/ZendeskSubcategoriesErrors";
import { CoBadgeServices } from "@io-app/api-types/generated/definitions/pagopa/cobadge/configuration/CoBadgeServices";
import { PrivativeServices } from "@io-app/api-types/generated/definitions/pagopa/privative/configuration/PrivativeServices";
⋮----
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { Router } from "express";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { assetsFolder, staticContentRootPath } from "../config";
import { sendServiceId } from "../features/pn/services/dataService";
import { cgnServiceId } from "../features/services/persistence/services/special/cgn-service";
import { backendStatus } from "../payloads/backend";
import { municipality } from "../payloads/municipality";
import { addHandler } from "../payloads/response";
import {
  fileExists,
  isPngOrJpegExtension,
  listDir,
  readFileAndDecode,
  readFileAsJSON,
  sendFileFromRootPath
} from "../utils/file";
import { serverUrl } from "../utils/server";
import { validatePayload } from "../utils/validator";
⋮----
const addRoutePrefix = (path: string) => `$
⋮----
const serviceLogoBaseRelativePathGenerator = ()
const fallbackServiceLogoRelativePathGenerator = ()
⋮----
const organizationLogoBaseRelativePathGenerator = ()
const fallbackOrganizationLogoRelativePathGenerator = ()
⋮----
export const initializeServiceLogoMap = () =>
⋮----
const getOrLoadAndInitializeLogoRelativePath = (
  fileNameWithExtension: string,
  map: Map<string, string>,
  sourceDirRelativePath: string,
  fallbackRelativePathFunction: () => string
) =>
</file>

<file path="apps/dev-api-server/src/routers/session.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { Router } from "express";
⋮----
import { addHandler } from "../payloads/response";
import {
  getCustomSession,
  shouldAddLollipopAssertionRef
} from "../payloads/session";
import { getAssertionRef } from "../persistence/lollipop";
import { getRandomValue } from "../utils/random";
import { addApiAuthV1Prefix, addApiV1Prefix } from "../utils/strings";
</file>

<file path="apps/dev-api-server/src/routers/wallet.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { CardInfo } from "@io-app/api-types/generated/definitions/pagopa/CardInfo";
import { EnableableFunctionsEnum } from "@io-app/api-types/generated/definitions/pagopa/EnableableFunctions";
import { Transaction } from "@io-app/api-types/generated/definitions/pagopa/Transaction";
import { TransactionListResponse } from "@io-app/api-types/generated/definitions/pagopa/TransactionListResponse";
import { TypeEnum } from "@io-app/api-types/generated/definitions/pagopa/Wallet";
import { WalletPaymentStatusRequest } from "@io-app/api-types/generated/definitions/pagopa/WalletPaymentStatusRequest";
import { WalletResponse } from "@io-app/api-types/generated/definitions/pagopa/WalletResponse";
import {
  WalletTypeEnum,
  WalletV2
} from "@io-app/api-types/generated/definitions/pagopa/WalletV2";
⋮----
import { Router } from "express";
import { takeRight } from "fp-ts/lib/Array";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { ioDevServerConfig } from "../config";
import { addHandler } from "../payloads/response";
import {
  getTransactions,
  getWallets,
  sessionToken,
  validPsp
} from "../payloads/wallet";
import {
  abiData,
  convertWalletV2toV1,
  generateCards,
  generateWalletV2FromCard
} from "../payloads/wallet_v2";
import { isOutcomeCodeSuccessfully } from "../utils/payment";
import { serverUrl } from "../utils/server";
import { validatePayload } from "../utils/validator";
import { appendWalletV1Prefix, appendWalletV2Prefix } from "../utils/wallet";
import {
  addWalletV2,
  findWalletById,
  getWalletV2,
  removeWalletV2,
  walletV2Config
} from "./walletsV2";
⋮----
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
</file>

<file path="apps/dev-api-server/src/types/allowRandomValue.ts">

</file>

<file path="apps/dev-api-server/src/types/config.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { EmailAddress } from "@io-app/api-types/generated/definitions/identity/EmailAddress";
import { PreferredLanguages } from "@io-app/api-types/generated/definitions/identity/PreferredLanguages";
import { PushNotificationsContentType } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatus } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
import { AmountEuroCents as ImportoEuroCents } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/AmountEuroCents";
import { SubscriptionState } from "@io-app/api-types/generated/definitions/trial_system/SubscriptionState";
import { TrialId } from "@io-app/api-types/generated/definitions/trial_system/TrialId";
import {
  NonNegativeNumber,
  WithinRangeInteger,
  WithinRangeNumber
} from "@pagopa/ts-commons/lib/numbers";
import { FiscalCode, NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
import { FIMSConfig } from "../features/fims/types/config";
import { MessagesConfig } from "../features/messages/types/messagesConfig";
import { WalletConfiguration } from "../features/payments/types/configuration";
import { SendConfig } from "../features/pn/types/sendConfig";
import { ServiceConfiguration } from "../features/services/types/configuration";
import { AllowRandomValue } from "./allowRandomValue";
import { HttpResponseCode } from "./httpResponseCode";
⋮----
export type ProfileAttrs = t.TypeOf<typeof ProfileAttrs>;
⋮----
export type WalletMethodConfig = t.TypeOf<typeof WalletMethodConfig>;
⋮----
type PaymentConfig = t.TypeOf<typeof PaymentConfig>;
⋮----
type ErrorCodes = t.TypeOf<typeof ErrorCodes>;
⋮----
export type AllorRandomValueKeys = keyof IoDevServerConfig;
export type IoDevServerConfig = t.TypeOf<typeof IoDevServerConfig>;
type SpecialServicesConfig = t.TypeOf<typeof SpecialServicesConfig>;
</file>

<file path="apps/dev-api-server/src/types/httpResponseCode.ts">

</file>

<file path="apps/dev-api-server/src/types/parameters.ts">
import { NumberFromString } from "@pagopa/ts-commons/lib/numbers";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
export type GetMessagesParameters = t.TypeOf<typeof GetMessagesParameters>;
</file>

<file path="apps/dev-api-server/src/types/PatchedWalletV2.ts">
import { BPayInfo } from "@io-app/api-types/generated/definitions/pagopa/BPayInfo";
import { CardInfo } from "@io-app/api-types/generated/definitions/pagopa/CardInfo";
import { EnableableFunctions } from "@io-app/api-types/generated/definitions/pagopa/EnableableFunctions";
import { SatispayInfo } from "@io-app/api-types/generated/definitions/pagopa/SatispayInfo";
import { WalletTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/WalletV2";
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
export type PatchedWalletV2 = t.TypeOf<typeof PatchedWalletV2>;
</file>

<file path="apps/dev-api-server/src/types/PatchedWalletV2ListResponse.ts">
import { PatchedWalletV2 } from "./PatchedWalletV2";
⋮----
export type PatchedWalletV2ListResponse = t.TypeOf<
  typeof PatchedWalletV2ListResponse
>;
</file>

<file path="apps/dev-api-server/src/types/PatchedWalletV2Response.ts">
import { PatchedWalletV2 } from "./PatchedWalletV2";
⋮----
export type PatchedWalletV2Response = t.TypeOf<typeof PatchedWalletV2Response>;
</file>

<file path="apps/dev-api-server/src/types/PaymentStatus.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { PaymentInfoResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoResponse";
⋮----
export declare type PaymentStatus = ProcessablePayment | ProcessedPayment;
⋮----
export interface ProcessablePayment {
  readonly data: PaymentInfoResponse;
  readonly type: "processable";
}
⋮----
export interface ProcessedPayment {
  readonly status: { detail_v2: PaymentFaultV2Enum };
  readonly type: "processed";
}
⋮----
export const isProcessedPayment = (
  paymentStatus: PaymentStatus
): paymentStatus is ProcessedPayment
⋮----
export const processablePayment = (
  data: PaymentInfoResponse
): ProcessablePayment => (
export const processedPayment = (status: {
  detail_v2: PaymentFaultV2Enum;
}): ProcessedPayment => (
⋮----
const foldW =
  <A, B>(
    onProcessed: (processedPayment: ProcessedPayment) => A,
    onProcessable: (processablePayment: ProcessablePayment) => B
)
</file>

<file path="apps/dev-api-server/src/utils/date.ts">
export const getDateMsDifference = (firstDate: Date, secondDate: Date)
</file>

<file path="apps/dev-api-server/src/utils/delay_middleware.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { NextFunction, Request, Response } from "express";
⋮----
export const delayer =
(delay: Millisecond) => (_: Request, __: Response, next: NextFunction) =>
</file>

<file path="apps/dev-api-server/src/utils/error.ts">
import { Response } from "express";
import { Either, isLeft, Left } from "fp-ts/lib/Either";
⋮----
import { ExpressFailure } from "./expressDTO";
import { logExpressResponseWarning } from "./logging";
⋮----
export const handleLeftEitherIfNeeded = (
  inputEither: Either<ExpressFailure, unknown>,
  res: Response
): inputEither is Left<ExpressFailure> =>
⋮----
export const unknownToString = (input: unknown): string =>
</file>

<file path="apps/dev-api-server/src/utils/expressDTO.ts">
import { ProblemJson } from "@pagopa/ts-commons/lib/responses";
⋮----
export type ExpressFailure = {
  httpStatusCode: number;
  reason: object | ProblemJson;
};
</file>

<file path="apps/dev-api-server/src/utils/file.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { Response } from "express";
⋮----
import fs from "fs";
import { Validation } from "io-ts";
⋮----
import { unknownToString } from "./error";
⋮----
export const sendFileFromRootPath = (filePath: string, res: Response) =>
⋮----
const readBinaryFileSegment = (
  filename: string,
  length: number
): E.Either<string, Buffer> =>
⋮----
export const isPDFFile = (fileName: string): E.Either<string, boolean> =>
⋮----
export const readFileAsJSON = (fileName: string): any
⋮----
export const fileExists = (filePath: string)
⋮----
export const listDir = (directoryPath: string): Array<string> =>
⋮----
export const readFileAndDecode = <T>(
  filename: string,
  decode: (i: T) => Validation<T>,
  res: Response
) =>
⋮----
export const isPngOrJpegExtension = (inputString?: string) =>
</file>

<file path="apps/dev-api-server/src/utils/guards.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
export const isDefined = <T, O extends NonNullable<T>>(value: T): value is O
</file>

<file path="apps/dev-api-server/src/utils/httpSignature.ts">
import { AlgorithmTypes } from "@mattrglobal/http-signatures";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
export const verifyCustomContentChallenge = (
  signatureBase: string | undefined,
  signatureToVerify: string,
  publicKey: jose.JWK
)
⋮----
const toDigestAlgo = (jwk: jose.JWK)
⋮----
export const toPem = (jwk: jose.JWK)
⋮----
export type SignatureBaseInfo = {
  signatureBase: string;
  signatureLabel: string;
};
⋮----
export const getCustomContentSignatureBase = (
  signatureInput: string,
  challengeHex: string,
  headerName: string
): SignatureBaseInfo | undefined
⋮----
export const getCustomContentChallenge = (
  signatureLabel: string,
  signature: string
)
⋮----
export type SignatureAlgorithm = "ecdsa-p256-sha256" | "rsa-pss-sha256";
⋮----
export const getSignatureInfo = (
  signatureBase: string
): O.Option<SignatureAlgorithm>
⋮----
export const isSignAlgorithmValid = (
  signAlghorithm: O.Option<SignatureAlgorithm>
)
⋮----
const signatureVerifier =
(publicKey: JsonWebKey)
⋮----
type VerifyFunction = (
  signatureParams: { alg: AlgorithmTypes; keyid: string },
  data: Uint8Array,
  signature: Uint8Array
) => Promise<boolean>;
⋮----
type VerifyFunctionWrapper = (privateKey: JsonWebKey) => VerifyFunction;
</file>

<file path="apps/dev-api-server/src/utils/id.ts">
import { randomInt } from "fp-ts/lib/Random";
⋮----
export const getRandomStringId = (chars = 26): string =>
⋮----
const randomSlice = ()
⋮----
export const getRandomIntInRange = (min: number, max: number)
</file>

<file path="apps/dev-api-server/src/utils/logging.ts">
import { ProblemJson } from "@pagopa/ts-commons/lib/responses";
⋮----
import { unknownToString } from "./error";
⋮----
export const logExpressResponseWarning = (
  statusCode: number,
  problemJson: object | ProblemJson
) =>
⋮----
export const logWarning = (
  message: string
) => console.warn(`\x1b[1;38;5;202m$
</file>

<file path="apps/dev-api-server/src/utils/login.ts">
export const getSamlRequest = (
</file>

<file path="apps/dev-api-server/src/utils/payment.ts">
import { PaymentDataBase } from "@io-app/api-types/generated/definitions/communication/PaymentDataBase";
import { PaymentDataWithRequiredPayee } from "@io-app/api-types/generated/definitions/communication/PaymentDataWithRequiredPayee";
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
⋮----
export const enum CreditCardBrandEnum {
  AMEX = "AMEX",
  DINERS = "DINERS",
  MAESTRO = "MAESTRO",
  MASTERCARD = "MASTERCARD",
  POSTEPAY = "POSTEPAY",
  VISA = "VISA",
  VISAELECTRON = "VISAELECTRON",
  VPAY = "VPAY"
}
⋮----
export const getCreditCardLogo = (cc: CreditCardBrandEnum)
⋮----
export const isOutcomeCodeSuccessfully = (
  outcome: number | undefined
): boolean
⋮----
export const rptIdFromPaymentDataWithRequiredPayee = (
  paymentDataWithRequiredPayee: PaymentDataWithRequiredPayee
): string
⋮----
export const rptIdFromServiceAndPaymentData = (
  service: ServiceDetails,
  paymentData: PaymentDataBase
) => `$
⋮----
export const detailV2EnumToPaymentProblemJSON = (
  details: PaymentFaultV2Enum
):
</file>

<file path="apps/dev-api-server/src/utils/random.ts">
import { ioDevServerConfig } from "../config";
import { AllorRandomValueKeys } from "../types/config";
⋮----
type RandomValueFunc = <T>(
  defaultValue: T,
  randomValue: T,
  configSectionKey: AllorRandomValueKeys
) => T;
⋮----
const getValueGlobalRandomOff: RandomValueFunc = <T>(defaultValue: T)
⋮----
const getValueGlobalRandomOn: RandomValueFunc = <T>(
  defaultValue: T,
  randomValue: T,
  configSectionKey: AllorRandomValueKeys
) =>
</file>

<file path="apps/dev-api-server/src/utils/responseTypes.ts">
export type CustomResponse = {
  payload?: object;
  status: number;
};
⋮----
export type ResponseProblem<T extends string> = {
  detail: T;
  status: number;
};
</file>

<file path="apps/dev-api-server/src/utils/server.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import os from "os";
⋮----
const getIpv4Addresses = (
  nets: ReadonlyArray<os.NetworkInterfaceInfo>
): ReadonlyArray<os.NetworkInterfaceInfo>
</file>

<file path="apps/dev-api-server/src/utils/strings.ts">
import { basePath } from "../payloads/response";
⋮----
export const uuidv4 = ()
⋮----
const createNamespaceVersionPrefixer =
(namespace: string, version = "v1")
⋮----
export const addApiV1Prefix = (path: string) => `$
</file>

<file path="apps/dev-api-server/src/utils/types.ts">
import { addHandler } from "../payloads/response";
⋮----
export type RouteHandler = Parameters<typeof addHandler>[3];
</file>

<file path="apps/dev-api-server/src/utils/validator.ts">
import { identity, pipe } from "fp-ts/lib/function";
⋮----
import { failure, PathReporter } from "io-ts/lib/PathReporter";
⋮----
import { IOResponse } from "../payloads/response";
⋮----
export const validatePayload = <T, O, I>(codec: t.Type<T, O, I>, payload: I)
⋮----
export const decodePayload = <T, O, I>(codec: t.Type<T, O, I>, payload: I)
⋮----
export const validateAndCreatePayload = <T, O, I>(
  codec: t.Type<T, O, I>,
  payload: I,
  statusCode = 200
): IOResponse<T> =>
⋮----
export const toPayload = <T>(payload: T, statusCode = 200): IOResponse<T> => (
</file>

<file path="apps/dev-api-server/src/utils/variables.ts">
import {
  CANCELED_SIGNATURE_REQUEST_ID,
  EXPIRED_SIGNATURE_REQUEST_ID,
  NO_FIELDS_SIGNATURE_REQUEST_ID,
  REJECTED_SIGNATURE_REQUEST_ID,
  SIGNATURE_REQUEST_ID,
  SIGNED_EXPIRED_SIGNATURE_REQUEST_ID,
  SIGNED_SIGNATURE_REQUEST_ID,
  WAIT_QTSP_SIGNATURE_REQUEST_ID
} from "../payloads/features/fci/signature-request";
import { serverUrl } from "./server";
</file>

<file path="apps/dev-api-server/src/utils/wallet.ts">
export const appendWalletV1Prefix = (path: string) => `$
⋮----
export const appendWalletV2Prefix = (path: string) => `$
⋮----
export const appendWalletV3Prefix = (path: string) => `$
</file>

<file path="apps/dev-api-server/src/config.ts">
import { EmailAddress } from "@io-app/api-types/generated/definitions/identity/EmailAddress";
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { PushNotificationsContentTypeEnum } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatusEnum } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
import { TrialId } from "@io-app/api-types/generated/definitions/trial_system/TrialId";
import { NonNegativeNumber } from "@pagopa/ts-commons/lib/numbers";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { FiscalCode, NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import chalk from "chalk";
⋮----
import _ from "lodash";
⋮----
import {
  IoDevServerConfig,
  ProfileAttrs,
  WalletMethodConfig
} from "./types/config";
import { readFileAsJSON } from "./utils/file";
import { serverUrl } from "./utils/server";
</file>

<file path="apps/dev-api-server/src/index.html">
<!doctype html>
<html lang="it">
  <head>
    <script>
      function sendSuccess() {
        const payload = {
          it: "Richiesta avvenuta con successo",
          en: "Request successfully sent"
        };
        showSuccess(payload);
      }
      function sendError() {
        const payload = {
          it: "È avvenuto un errore!",
          en: "An error occurred!"
        };
        showErrorMessage(payload);
      }
      function sendAlertBox() {
        const payload = {
          it: {
            title: "Attenzione",
            description: "Sembra che ci sia qualcosa che non va!"
          },
          en: {
            title: "Warning",
            description: "Seems there's something wrong!"
          }
        };
        showAlertBox(payload);
      }
    </script>
  </head>
  <body>
    <h1>TEST</h1>
    <button onclick="closeModal()">CLOSE MODAL</button>
    <button onclick="showLoader()">SHOW LOADER</button>
    <button onclick="hideLoader()">HIDE LOADER</button>
    <button onclick="sendSuccess()">SEND SUCCESS</button>
    <button onclick="sendError()">SEND ERROR</button>
    <button onclick="sendAlertBox()">SEND ALERT</button>
  </body>
</html>
</file>

<file path="apps/dev-api-server/src/populate-persistence.ts">
import { fakerIT as faker } from "@faker-js/faker";
import { CreatedMessageWithContent } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContent";
import { CreatedMessageWithContentAndAttachments } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndAttachments";
import { FiscalCode } from "@io-app/api-types/generated/definitions/communication/FiscalCode";
import { MessageStatusAttributes } from "@io-app/api-types/generated/definitions/communication/MessageStatusAttributes";
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import fs from "fs";
import _ from "lodash";
⋮----
import { ioDevServerConfig } from "./config";
import MessagesDB from "./features/messages/persistence/messagesDatabase";
import {
  createMessage,
  withContent,
  withDueDate,
  withPaymentData,
  withRemoteContent
} from "./features/messages/persistence/messagesPayload";
import {
  AggregatedMessage,
  productionMessagesFileRelativePath
} from "./features/messages/routers/productionCrawlerRouter";
import { LegacyGreenPass } from "./features/messages/types/LegacyGreenPass";
import { MessageTemplate } from "./features/messages/types/messageTemplate";
import { MessageTemplateWrapper } from "./features/messages/types/messageTemplateWrapper";
import {
  createSENDMessagesOnIO,
  createSENDOptInMessage
} from "./features/pn/services/dataService";
import ServicesDB from "./features/services/persistence/servicesDatabase";
import { initializeServiceLogoMap } from "./routers/services_metadata";
import { IoDevServerConfig } from "./types/config";
import { getRandomValue } from "./utils/random";
import {
  frontMatter1CTABonusCgn,
  frontMatter1CTAFims,
  frontMatter1CTAV2BonusCgnDetails,
  frontMatter2CTA2,
  frontMatterCTAFCISignatureRequest,
  frontMatterCTAFCISignatureRequestCancelled,
  frontMatterCTAFCISignatureRequestExpired,
  frontMatterCTAFCISignatureRequestNoFields,
  frontMatterCTAFCISignatureRequestRejected,
  frontMatterCTAFCISignatureRequestSigned,
  frontMatterCTAFCISignatureRequestSignedExpired,
  frontMatterCTAFCISignatureRequestWaitQtsp,
  messageFciMarkdown,
  messageFciSignedMarkdown,
  messageMarkdown
} from "./utils/variables";
⋮----
const getServiceId = (): string =>
⋮----
export const getNewMessage = (
  customConfig: IoDevServerConfig,
  subject: string,
  markdown: string,
  legacyGreenPass?: LegacyGreenPass,
  serviceId?: string
): CreatedMessageWithContentAndAttachments
⋮----
const createMessagesWithCTA = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments>
⋮----
const createMessagesWithLegacyGreenPass = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments>
⋮----
const createMessagesWithFirmaConIOWaitForSignature = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments>
⋮----
const createMessagesWithFirmaConIOExpired = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments>
⋮----
const createMessagesWithFirmaConIOQTSP = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments>
⋮----
const createMessagesWithFirmaConIOExpired90 = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments>
⋮----
const createMessagesWithFirmaConIOSigned = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments>
⋮----
const createMessagesWithFirmaConIORejected = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments>
⋮----
const createMessagesWithFirmaConIONoSignatureFields = (
  customConfig: IoDevServerConfig
): Array<CreatedMessageWithContentAndAttachments>
... (72 lines truncated)
</file>

<file path="apps/dev-api-server/src/server.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import bodyParser from "body-parser";
import cookieParser from "cookie-parser";
import express, { Application } from "express";
import morgan from "morgan";
⋮----
import { ioDevServerConfig } from "./config";
import { cdcRouter } from "./features/cdc/routers";
import { fimsHistoryRouter } from "./features/fims/routers/historyRouter";
import { fimsProviderRouter } from "./features/fims/routers/providerRouter";
import { fimsRelyingPartyRouter } from "./features/fims/routers/relyingPartyRouter";
import { ioSendRouter } from "./features/messages/routers/ioSendRouter";
import {
  communicationRouter,
  messageRouter
} from "./features/messages/routers/messagesRouter";
import { productionCrawlerRouter } from "./features/messages/routers/productionCrawlerRouter";
import { walletRouter as newWalletRouter } from "./features/payments";
import { sendAARRouter } from "./features/pn/routers/aarRouter";
import { sendDocumentsRouter } from "./features/pn/routers/documentsRouter";
import { sendLollipopLambdaRouter } from "./features/pn/routers/lollipopLambda";
import { sendMandatesRouter } from "./features/pn/routers/mandatesRouter";
import { sendNotificationsRouter } from "./features/pn/routers/notificationsRouter";
import { sendPrevalidatedUrisRouter } from "./features/pn/routers/prevalidatedUrisRouter";
import { sendServiceRouter } from "./features/pn/routers/serviceRouter";
import { serviceRouter as newServiceRouter } from "./features/services";
import { trialSystemRouter } from "./features/trialSystem/routers";
import { errorMiddleware } from "./middleware/errorMiddleware";
import { fastLoginMiddleware } from "./middleware/fastLoginMiddleware";
import { dashboardHomeRouter } from "./routers/configHomeDashboard/configHomeDashboard";
import { cgnRouter } from "./routers/features/cgn";
import { cgnGeoRouter } from "./routers/features/cgn/geocoding";
import { cgnMerchantsRouter } from "./routers/features/cgn/merchants";
import { fastLoginRouter } from "./routers/features/fastLogin";
import { fciRouter } from "./routers/features/fci";
import { idpayRouter } from "./routers/features/idpay";
import { lollipopRouter } from "./routers/features/lollipop";
import { miscRouter } from "./routers/misc";
import { profileRouter } from "./routers/profile";
import { publicRouter } from "./routers/public";
import { serviceRouter } from "./routers/service";
import { servicesMetadataRouter } from "./routers/services_metadata";
import { sessionRouter } from "./routers/session";
import { walletRouter } from "./routers/wallet";
import { wallet2Router } from "./routers/walletsV2";
import { dashboardWalletV2Router } from "./routers/walletsV2/configDashboard";
import { bancomatRouter } from "./routers/walletsV2/methods/bancomat";
import { bpayRouter } from "./routers/walletsV2/methods/bpay";
import { cobadgeRouter } from "./routers/walletsV2/methods/cobadge";
import { satispayRouter } from "./routers/walletsV2/methods/satispay";
import { delayer } from "./utils/delay_middleware";
</file>

<file path="apps/dev-api-server/src/start.ts">
import chalk from "chalk";
import child_process from "child_process";
import Table from "cli-table3";
import figlet from "figlet";
import { pipe } from "fp-ts/lib/function";
⋮----
import { routes } from "./payloads/response";
import populatePersistence from "./populate-persistence";
import app from "./server";
import { readFileAsJSON } from "./utils/file";
import { interfaces, serverHostname, serverPort } from "./utils/server";
⋮----
// eslint-disable-next-line no-console
⋮----
// eslint-disable-next-line no-console
⋮----
// eslint-disable-next-line no-console
</file>

<file path="apps/dev-api-server/.oxlintrc.jsonc">
{
  "$schema": "../../node_modules/oxlint/configuration_schema.json",
  "extends": ["../main-app/.oxlintrc.jsonc"],
  // `extends` replaces `ignorePatterns` rather than merging it
  "ignorePatterns": ["**/*.js", "**/*.cjs", "**/*.mjs", "scratch/**"]
}
</file>

<file path="apps/dev-api-server/eslint.config.mjs">
// ESLint sees disables for rules moved to oxlint as unused, and `--fix`
// would delete them although oxlint still needs them. oxlint reports its own.
⋮----
// Must stay last: turns off every rule that oxlint already runs, so the two
// linters never report the same problem.
</file>

<file path="apps/dev-api-server/jest.uuid.cjs">

</file>

<file path="apps/dev-api-server/README.MD">
<h1 align="center">
  <img src="assets/imgs/readme/main_screen.png" alt="io-dev-api-server">
  <br>
  IO dev API server
  <br>
</h1>

<h4 align="center">Mock server of <a href="https://github.com/pagopa/io-backend">io-backend</a> for <a href="https://github.com/pagopa/io-app">io-app</a> development.</h4>

<p align="center">
  <a href="https://app.codecov.io/gh/pagopa/io-dev-api-server">
    <img src="https://codecov.io/gh/pagopa/io-dev-api-server/branch/master/graph/badge.svg"
         alt="codecov">
  </a>
</p>

## Table of contents
* [Features](#features)
* [Local setup](#local-setup)
* [Docker setup](#docker-setup)
* [Usage with the app](#usage-with-the-app)

## Features
The test server has been created to make the app development process easier and more productive. Therefore you can:
- Run it on local machines without an internet connection;
- Change response payloads to test and stress the app;
- Add new paths and handlers to integrate and test features not yet released;
- Understand flows and data exchanged between app and backend.

<details>
   <summary>Login</summary>
   The current login implementation by-passes SPID authentication: when the user asks for a login with a certain SPID Identity Provider, the server responses with a redirect containing the session token. The user will be immediately logged in.
   <br><br>
   <img src="assets/imgs/readme/login.gif" height="400" />
</details>

<details>
   <summary>Session</summary>
   When the client asks for a session, a valid session is always returned. Of course the developer could implement a logic to return an expired session response to test different scenarios.
</details>


## Local setup
We recommend the use of a virtual environment, [nodenv](https://github.com/nodenv/nodenv) is the chosen virtual environment for this guide, along with [pnpm](https://pnpm.io/) for managing dependencies. From your command line, run:

```bash
# Clone io-app monorepo
$ git clone https://github.com/pagopa/io-app

# CD into the monorepo
$ cd io-app

# Install node with nodenv, the returned version should match the one in the .node-version file
$ nodenv install && nodenv version

# Install pnpm and rehash to install shims
$ npm install -g pnpm && nodenv rehash

# Install dependencies
# Run this only while setting up and when dependencies change
$ pnpm nx run @io-app/main-app:setup

# Generate API definitions
# Run this only while setting up and when io-backend specs change
$ pnpm nx run @io-app/api-types:generate

# Start the server
$ pnpm nx run @io-app/dev-api-server:start
```
***Note***: The default port (3000) can be changed in the [server.ts](src/utils/server.ts) file.
## Docker setup
A [Docker](https://www.docker.com/get-started) image is also available for local dev purposes. From your command line, run:
```bash
# Login into the GitHub container registry
# Reference: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
$ echo <GITHUB_TOKEN> | docker login ghcr.io -u <YOUR_GITHUB_USERNAME> --password-stdin

# Pull the latest Docker image 
# Other versions can be found here: https://github.com/pagopa/io-dev-api-server/pkgs/container/io-dev-api-server%2Fio-dev-api-server
$ docker pull ghcr.io/pagopa/io-dev-api-server/io-dev-api-server:latest

# Run the Docker container at http://127.0.0.1:<YOUR_HOST_PORT>/
$ docker run -d -p <YOUR_HOST_PORT>:3000 ghcr.io/pagopa/io-dev-api-server/io-dev-api-server:latest
```

## Usage with the app
Run the server, either locally on via Docker. Then, from your command line:
```bash
# CD into the app folder
$ cd io-app

# Use the local env 
# You can edit the server endpoint on your needs
$ cp .env.local .env 

# Run the app on iOS or Android
$ pnpm nx run @io-app/main-app:run-ios (or pnpm nx run @io-app/main-app:dev-run-android)
```

## Lollipop
... (95 lines truncated)
</file>

<file path="apps/main-app/android/app/src/canary/res/drawable/ic_launcher_background.xml">
<?xml version="1.0" encoding="utf-8"?>
<vector
    android:height="108dp"
    android:width="108dp"
    android:viewportHeight="108"
    android:viewportWidth="108"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#3DDC84"
          android:pathData="M0,0h108v108h-108z"/>
    <path android:fillColor="#00000000" android:pathData="M9,0L9,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,0L19,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M29,0L29,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M39,0L39,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M49,0L49,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M59,0L59,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M69,0L69,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M79,0L79,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M89,0L89,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M99,0L99,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,9L108,9"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,19L108,19"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,29L108,29"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,39L108,39"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,49L108,49"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,59L108,59"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,69L108,69"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,79L108,79"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,89L108,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,99L108,99"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,29L89,29"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,39L89,39"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,49L89,49"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,59L89,59"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,69L89,69"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,79L89,79"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M29,19L29,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M39,19L39,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M49,19L49,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M59,19L59,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M69,19L69,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M79,19L79,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
</file>

<file path="apps/main-app/android/app/src/canary/res/mipmap-anydpi-v26/ic_launcher_round.xml">
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background"/>
    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
</file>

<file path="apps/main-app/android/app/src/canary/res/mipmap-anydpi-v26/ic_launcher.xml">
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background"/>
    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
</file>

<file path="apps/main-app/android/app/src/main/java/it/pagopa/io/app/MainActivity.kt">
package it.pagopa.io.app;
import expo.modules.ReactActivityDelegateWrapper
import android.content.pm.ActivityInfo;
import android.os.Build;
import android.os.Bundle;
import androidx.appcompat.app.AlertDialog;
import androidx.core.view.WindowCompat;
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
import org.devio.rn.splashscreen.SplashScreen;
class MainActivity : ReactActivity() {
    override fun getMainComponentName(): String = "IO"
    override fun createReactActivityDelegate(): ReactActivityDelegate =
        ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled))
    override fun onCreate(savedInstanceState: Bundle?) {
        WindowCompat.setDecorFitsSystemWindows(window, false)
        SplashScreen.show(this, R.style.SplashScreenTheme);
        super.onCreate(null);
    }
}
</file>

<file path="apps/main-app/android/app/src/main/java/it/pagopa/io/app/MainApplication.kt">
package it.pagopa.io.app
import android.content.res.Configuration
import expo.modules.ApplicationLifecycleDispatcher
import expo.modules.ExpoReactHostFactory
import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import it.ipzs.cieidsdk.native_bridge.CiePackage
class MainApplication : Application(), ReactApplication {
  override val reactHost: ReactHost by lazy {
    ExpoReactHostFactory.getDefaultReactHost(
      context = applicationContext,
      packageList =
        PackageList(this).packages.apply {
          add(CiePackage())
        },
    )
  }
  override fun onCreate() {
    super.onCreate()
    loadReactNative(this)
    ApplicationLifecycleDispatcher.onApplicationCreate(this)
  }
  override fun onConfigurationChanged(newConfig: Configuration) {
    super.onConfigurationChanged(newConfig)
    ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)
  }
}
</file>

<file path="apps/main-app/android/app/src/main/res/drawable/eu_next_logo.xml">
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="110dp"
    android:height="26dp"
    android:viewportWidth="110"
    android:viewportHeight="26">
  <path
      android:pathData="M36.63,24.44H1.66V1.2H36.63V24.44ZM0.96,0.52V25.15H37.33V0.52H0.96Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M18.4,6.26L19.14,5.72L19.88,6.26L19.6,5.39L20.35,4.86H19.42L19.14,3.98L18.86,4.86L17.93,4.86L18.68,5.39L18.4,6.26Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M14.58,7.28L15.32,6.75L16.06,7.28L15.78,6.42L16.53,5.88H15.6L15.32,5L15.04,5.88L14.11,5.88L14.86,6.42L14.58,7.28Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M12.53,7.79L12.24,8.67L11.32,8.67L12.07,9.21L11.79,10.08L12.53,9.54L13.26,10.08L12.98,9.21L13.73,8.67H12.81L12.53,7.79Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M11.5,13.34L12.24,13.88L11.96,13.01L12.71,12.47H11.78L11.5,11.59L11.22,12.48L10.3,12.47L11.05,13.01L10.76,13.88L11.5,13.34Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M12.81,16.29L12.53,15.41L12.24,16.29L11.32,16.29L12.07,16.83L11.79,17.69L12.53,17.16L13.26,17.69L12.98,16.83L13.73,16.29H12.81Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M15.61,19.08L15.33,18.2L15.04,19.08L14.12,19.08L14.87,19.62L14.59,20.49L15.33,19.95L16.06,20.49L15.78,19.62L16.53,19.08H15.61Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M19.42,20.09L19.14,19.21L18.86,20.09L17.93,20.09L18.68,20.63L18.4,21.5L19.14,20.96L19.88,21.5L19.6,20.63L20.35,20.09H19.42Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M23.24,19.08L22.95,18.2L22.67,19.08L21.75,19.08L22.5,19.62L22.22,20.49L22.95,19.95L23.69,20.49L23.41,19.62L24.16,19.08H23.24Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M26.04,16.29L25.75,15.41L25.47,16.29L24.55,16.29L25.3,16.83L25.01,17.69L25.75,17.16L26.49,17.69L26.21,16.83L26.96,16.29H26.04Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M27.97,12.46H27.05L26.77,11.58L26.48,12.46L25.56,12.46L26.31,13L26.03,13.87L26.77,13.33L27.5,13.87L27.22,13L27.97,12.46Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M25.01,10.07L25.75,9.53L26.49,10.07L26.21,9.2L26.96,8.66H26.04L25.75,7.78L25.47,8.66L24.55,8.66L25.3,9.2L25.01,10.07Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M22.96,5L22.68,5.88L21.76,5.88L22.51,6.42L22.23,7.29L22.97,6.75L23.7,7.29L23.42,6.42L24.17,5.88H23.25L22.96,5Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M40.96,6.76V1.56H44.53V2.44H42.01V3.67H44.18V4.55H42.01V6.76H40.96Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M45.39,6.76V2.99H46.38V6.76H45.39ZM45.39,2.48V1.56H46.38V2.48H45.39Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M50.84,6.76H49.84V4.84C49.84,4.43 49.82,4.17 49.78,4.05C49.73,3.93 49.67,3.84 49.57,3.77C49.47,3.7 49.36,3.67 49.22,3.67C49.05,3.67 48.9,3.72 48.76,3.81C48.62,3.91 48.53,4.03 48.48,4.19C48.42,4.34 48.4,4.63 48.4,5.05V6.76H47.4V2.99H48.33V3.55C48.66,3.12 49.07,2.91 49.57,2.91C49.79,2.91 49.99,2.95 50.17,3.03C50.36,3.11 50.5,3.21 50.59,3.33C50.68,3.45 50.75,3.59 50.78,3.75C50.82,3.91 50.84,4.13 50.84,4.42V6.76Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M53.93,4.95C53.8,4.99 53.6,5.04 53.33,5.1C53.05,5.16 52.87,5.22 52.78,5.28C52.65,5.37 52.59,5.49 52.59,5.63C52.59,5.77 52.64,5.89 52.74,5.99C52.85,6.09 52.98,6.14 53.14,6.14C53.32,6.14 53.49,6.08 53.66,5.96C53.78,5.87 53.86,5.76 53.89,5.63C53.92,5.55 53.93,5.39 53.93,5.15V4.95ZM52.6,4.14L51.69,3.98C51.79,3.62 51.97,3.35 52.22,3.17C52.47,3 52.84,2.91 53.33,2.91C53.77,2.91 54.1,2.96 54.32,3.07C54.54,3.17 54.69,3.31 54.78,3.47C54.87,3.63 54.91,3.93 54.91,4.36L54.9,5.52C54.9,5.85 54.92,6.09 54.95,6.25C54.98,6.41 55.04,6.58 55.13,6.76H54.14C54.12,6.69 54.08,6.59 54.05,6.46C54.03,6.4 54.02,6.36 54.01,6.35C53.84,6.51 53.66,6.64 53.46,6.72C53.27,6.8 53.06,6.84 52.84,6.84C52.45,6.84 52.15,6.74 51.92,6.53C51.7,6.32 51.59,6.05 51.59,5.73C51.59,5.52 51.64,5.33 51.74,5.16C51.84,4.99 51.99,4.87 52.17,4.78C52.35,4.69 52.62,4.61 52.96,4.55C53.43,4.46 53.75,4.38 53.93,4.3V4.2C53.93,4.01 53.89,3.88 53.79,3.79C53.7,3.71 53.52,3.67 53.25,3.67C53.08,3.67 52.94,3.71 52.84,3.78C52.74,3.85 52.66,3.97 52.6,4.14Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M59.33,6.76H58.33V4.84C58.33,4.43 58.31,4.17 58.27,4.05C58.22,3.93 58.15,3.84 58.06,3.77C57.96,3.7 57.85,3.67 57.71,3.67C57.54,3.67 57.38,3.72 57.25,3.81C57.11,3.91 57.02,4.03 56.96,4.19C56.91,4.34 56.89,4.63 56.89,5.05V6.76H55.89V2.99H56.82V3.55C57.15,3.12 57.56,2.91 58.06,2.91C58.28,2.91 58.48,2.95 58.66,3.03C58.85,3.11 58.98,3.21 59.08,3.33C59.17,3.45 59.24,3.59 59.27,3.75C59.31,3.91 59.33,4.13 59.33,4.42V6.76Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M59.94,6.76V5.98L61.35,4.36C61.58,4.1 61.76,3.91 61.87,3.8C61.75,3.81 61.6,3.81 61.41,3.81L60.08,3.82V2.99H63.2V3.7L61.75,5.36L61.25,5.91C61.52,5.89 61.69,5.88 61.76,5.88H63.31V6.76H59.94Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M63.98,6.76V2.99H64.98V6.76H63.98ZM63.98,2.48V1.56H64.98V2.48H63.98Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M68.08,4.95C67.95,4.99 67.75,5.04 67.47,5.1C67.2,5.16 67.01,5.22 66.93,5.28C66.8,5.37 66.73,5.49 66.73,5.63C66.73,5.77 66.79,5.89 66.89,5.99C66.99,6.09 67.13,6.14 67.29,6.14C67.47,6.14 67.64,6.08 67.8,5.96C67.92,5.87 68,5.76 68.04,5.63C68.07,5.55 68.08,5.39 68.08,5.15V4.95ZM66.74,4.14L65.84,3.98C65.94,3.62 66.12,3.35 66.36,3.17C66.61,3 66.98,2.91 67.47,2.91C67.92,2.91 68.25,2.96 68.47,3.07C68.68,3.17 68.84,3.31 68.93,3.47C69.02,3.63 69.06,3.93 69.06,4.36L69.05,5.52C69.05,5.85 69.07,6.09 69.1,6.25C69.13,6.41 69.19,6.58 69.28,6.76H68.29C68.26,6.69 68.23,6.59 68.19,6.46C68.18,6.4 68.17,6.36 68.16,6.35C67.99,6.51 67.81,6.64 67.61,6.72C67.42,6.8 67.21,6.84 66.99,6.84C66.6,6.84 66.3,6.74 66.07,6.53C65.85,6.32 65.74,6.05 65.74,5.73C65.74,5.52 65.79,5.33 65.89,5.16C65.99,4.99 66.13,4.87 66.32,4.78C66.5,4.69 66.76,4.61 67.11,4.55C67.58,4.46 67.9,4.38 68.08,4.3V4.2C68.08,4.01 68.03,3.88 67.94,3.79C67.84,3.71 67.66,3.67 67.4,3.67C67.22,3.67 67.09,3.71 66.99,3.78C66.89,3.85 66.81,3.97 66.74,4.14Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M71.77,2.99V3.79H71.09V5.3C71.09,5.61 71.1,5.79 71.11,5.84C71.12,5.89 71.15,5.93 71.2,5.97C71.25,6 71.3,6.02 71.37,6.02C71.46,6.02 71.59,5.98 71.77,5.92L71.86,6.69C71.62,6.79 71.36,6.84 71.07,6.84C70.89,6.84 70.72,6.81 70.58,6.75C70.44,6.69 70.33,6.61 70.26,6.52C70.19,6.42 70.15,6.29 70.12,6.13C70.1,6.01 70.09,5.78 70.09,5.43V3.79H69.63V2.99H70.09V2.25L71.09,1.67V2.99H71.77Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M73.26,4.88C73.26,5.25 73.35,5.53 73.52,5.73C73.7,5.93 73.92,6.03 74.18,6.03C74.44,6.03 74.66,5.93 74.84,5.73C75.01,5.53 75.1,5.25 75.1,4.87C75.1,4.5 75.01,4.22 74.84,4.02C74.66,3.82 74.44,3.72 74.18,3.72C73.92,3.72 73.7,3.82 73.52,4.02C73.35,4.22 73.26,4.5 73.26,4.88ZM72.24,4.82C72.24,4.49 72.32,4.17 72.48,3.86C72.64,3.55 72.88,3.32 73.17,3.15C73.47,2.99 73.81,2.91 74.18,2.91C74.75,2.91 75.22,3.09 75.58,3.46C75.95,3.83 76.13,4.3 76.13,4.87C76.13,5.43 75.94,5.91 75.58,6.28C75.21,6.65 74.74,6.84 74.19,6.84C73.84,6.84 73.51,6.76 73.2,6.61C72.88,6.45 72.64,6.22 72.48,5.92C72.32,5.62 72.24,5.25 72.24,4.82Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M41.74,13.5C41.74,13.9 41.8,14.19 41.91,14.37C42.07,14.63 42.29,14.76 42.58,14.76C42.81,14.76 43.01,14.66 43.17,14.47C43.33,14.27 43.41,13.98 43.41,13.6C43.41,13.16 43.33,12.85 43.17,12.66C43.02,12.47 42.82,12.38 42.57,12.38C42.34,12.38 42.14,12.47 41.98,12.66C41.82,12.85 41.74,13.13 41.74,13.5ZM44.4,15.46H43.48V14.91C43.32,15.12 43.14,15.28 42.93,15.39C42.72,15.49 42.51,15.55 42.3,15.55C41.86,15.55 41.49,15.37 41.18,15.02C40.87,14.68 40.72,14.19 40.72,13.57C40.72,12.93 40.87,12.44 41.17,12.11C41.47,11.78 41.85,11.61 42.31,11.61C42.73,11.61 43.1,11.79 43.41,12.14V10.27H44.4V15.46Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M47.47,13.66C47.34,13.7 47.14,13.75 46.86,13.81C46.58,13.87 46.4,13.92 46.32,13.98C46.19,14.07 46.12,14.19 46.12,14.33C46.12,14.47 46.17,14.59 46.28,14.69C46.38,14.79 46.52,14.85 46.68,14.85C46.86,14.85 47.03,14.79 47.19,14.67C47.31,14.58 47.39,14.47 47.43,14.34C47.46,14.25 47.47,14.09 47.47,13.85V13.66ZM46.13,12.85L45.23,12.68C45.33,12.32 45.5,12.05 45.75,11.88C46,11.7 46.37,11.61 46.86,11.61C47.31,11.61 47.64,11.67 47.86,11.77C48.07,11.88 48.23,12.01 48.32,12.17C48.4,12.33 48.45,12.63 48.45,13.06L48.44,14.23C48.44,14.56 48.45,14.8 48.49,14.96C48.52,15.11 48.58,15.28 48.67,15.46H47.68C47.65,15.4 47.62,15.3 47.58,15.17C47.57,15.11 47.55,15.07 47.55,15.05C47.38,15.22 47.19,15.34 47,15.42C46.81,15.51 46.6,15.55 46.38,15.55C45.99,15.55 45.68,15.44 45.46,15.23C45.24,15.02 45.12,14.76 45.12,14.43C45.12,14.22 45.18,14.03 45.28,13.87C45.38,13.7 45.52,13.57 45.71,13.48C45.89,13.4 46.15,13.32 46.5,13.25C46.97,13.16 47.29,13.08 47.47,13.01V12.91C47.47,12.72 47.42,12.58 47.33,12.5C47.23,12.42 47.05,12.38 46.79,12.38C46.61,12.38 46.47,12.41 46.37,12.48C46.28,12.55 46.19,12.67 46.13,12.85Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M49.43,15.46V10.27H50.43V15.46H49.43Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M51.45,15.46V10.27H52.45V15.46H51.45Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M53.47,12.11L53.28,11.15V10.27H54.37V11.15L54.2,12.11H53.47Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M55.2,10.27H56.26V13.08C56.26,13.53 56.27,13.82 56.29,13.95C56.34,14.16 56.45,14.33 56.62,14.46C56.79,14.59 57.02,14.65 57.31,14.65C57.61,14.65 57.83,14.59 57.99,14.47C58.14,14.35 58.23,14.2 58.26,14.02C58.29,13.85 58.31,13.55 58.31,13.14V10.27H59.36V13C59.36,13.62 59.33,14.06 59.27,14.32C59.21,14.57 59.11,14.79 58.96,14.97C58.8,15.15 58.6,15.29 58.34,15.39C58.09,15.5 57.75,15.55 57.34,15.55C56.85,15.55 56.47,15.49 56.21,15.38C55.95,15.26 55.75,15.12 55.6,14.93C55.45,14.75 55.35,14.56 55.31,14.36C55.24,14.06 55.2,13.62 55.2,13.04V10.27Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M63.89,15.46H62.89V13.54C62.89,13.14 62.87,12.87 62.83,12.75C62.78,12.63 62.71,12.54 62.62,12.48C62.52,12.41 62.41,12.38 62.27,12.38C62.1,12.38 61.94,12.42 61.81,12.52C61.67,12.61 61.58,12.74 61.53,12.89C61.47,13.05 61.45,13.34 61.45,13.76V15.46H60.45V11.7H61.38V12.25C61.71,11.83 62.12,11.62 62.62,11.62C62.84,11.62 63.04,11.65 63.22,11.73C63.41,11.81 63.54,11.91 63.64,12.04C63.73,12.16 63.8,12.3 63.83,12.45C63.87,12.61 63.89,12.83 63.89,13.12V15.46Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M64.9,15.46V11.7H65.9V15.46H64.9ZM64.9,11.19V10.27H65.9V11.19H64.9Z"
      android:fillColor="#ffffff"/>
  <path
      android:pathData="M67.71,13.58C67.71,13.95 67.8,14.24 67.98,14.44C68.16,14.64 68.38,14.74 68.64,14.74C68.9,14.74 69.12,14.64 69.29,14.44C69.47,14.24 69.56,13.95 69.56,13.57C69.56,13.21 69.47,12.92 69.29,12.72C69.12,12.53 68.9,12.43 68.64,12.43C68.38,12.43 68.16,12.53 67.98,12.72C67.8,12.92 67.71,13.21 67.71,13.58ZM66.69,13.53C66.69,13.2 66.77,12.88 66.94,12.57C67.1,12.26 67.33,12.02 67.63,11.86C67.93,11.7 68.26,11.61 68.63,11.61C69.2,11.61 69.67,11.8 70.04,12.17C70.4,12.54 70.58,13.01 70.58,13.57C70.58,14.14 70.4,14.61 70.03,14.99C69.66,15.36 69.2,15.55 68.64,15.55C68.3,15.55 67.97,15.47 67.65,15.31C67.34,15.16 67.1,14.93 66.94,14.63C66.77,14.33 66.69,13.96 66.69,13.53Z"
... (78 lines truncated)
</file>

<file path="apps/main-app/android/app/src/main/res/drawable/ic_launcher_foreground.xml">
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="1024"
    android:viewportHeight="1024">
  <group android:scaleX="0.65"
      android:scaleY="0.65"
      android:translateX="179.2"
      android:translateY="179.2">
    <group>
      <clip-path
          android:pathData="M0,0h1024v1024h-1024z"/>
      <path
          android:pathData="M303,265.5C335.3,265.5 361.5,291.7 361.5,324C361.5,356.3 335.3,382.5 303,382.5C270.7,382.5 244.5,356.3 244.5,324C244.5,291.7 270.7,265.5 303,265.5Z"
          android:fillColor="#ffffff"/>
      <path
          android:pathData="M794.5,546.3C794.5,649.7 710.7,733.5 616.2,733.5C503.9,733.5 420,649.7 420,546.3C420,442.9 503.9,359.1 616.2,359.1C710.7,359.1 794.5,442.9 794.5,546.3ZM653.3,526.7H678.2V502.1H653.4V472.5H626.4V571.1C626.4,586.7 628.5,597.4 633,603.1C637.3,609 645.5,611.8 657.7,611.8C662.4,611.8 669.4,610.7 678.4,608.6L677.1,585.8L661.7,586.2C659,586.2 657,585.6 655.8,584.3C654.5,582.9 653.8,581.4 653.6,579.7C653.4,577.8 653.3,575 653.3,570.6V526.7ZM571.7,502.3V609.4H598.7V502.3H571.7ZM531,499.7C535.8,499.7 539.8,501.3 542.9,504.4C546,507.6 547.4,511.5 547.4,516.3C547.4,521.1 546,524.8 542.9,528C539.9,530.8 536.1,532.4 531.2,532.4C526.5,532.4 522.5,530.8 519.4,527.6C516.3,524.5 514.6,520.6 514.6,516C514.6,511.3 516.3,507.5 519.2,504.3C522.3,501.1 526.3,499.7 531,499.7Z"
          android:fillColor="#ffffff"
          android:fillType="evenOdd"/>
      <path
          android:pathData="M349.8,487.8C349.8,461.9 328.9,441 303,441C277.2,441 256.2,461.9 256.2,487.8V686.7C256.2,712.6 277.2,733.5 303,733.5C328.9,733.5 349.8,712.6 349.8,686.7V487.8Z"
          android:fillColor="#ffffff"/>
    </group>
  </group>
</vector>
</file>

<file path="apps/main-app/android/app/src/main/res/drawable/io_app_icon_foreground.xml">
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="1024dp"
    android:height="1024dp"
    android:viewportWidth="1024"
    android:viewportHeight="1024">
  <group>
    <clip-path
        android:pathData="M0,0h1024v1024h-1024z"/>
    <path
        android:pathData="M303,265.5C335.3,265.5 361.5,291.7 361.5,324C361.5,356.3 335.3,382.5 303,382.5C270.7,382.5 244.5,356.3 244.5,324C244.5,291.7 270.7,265.5 303,265.5Z"
        android:fillColor="#ffffff"/>
    <path
        android:pathData="M794.5,546.3C794.5,649.7 710.7,733.5 616.2,733.5C503.9,733.5 420,649.7 420,546.3C420,442.9 503.9,359.1 616.2,359.1C710.7,359.1 794.5,442.9 794.5,546.3ZM653.3,526.7H678.2V502.1H653.4V472.5H626.4V571.1C626.4,586.7 628.5,597.4 633,603.1C637.3,609 645.5,611.8 657.7,611.8C662.4,611.8 669.4,610.7 678.4,608.6L677.1,585.8L661.7,586.2C659,586.2 657,585.6 655.8,584.3C654.5,582.9 653.8,581.4 653.6,579.7C653.4,577.8 653.3,575 653.3,570.6V526.7ZM571.7,502.3V609.4H598.7V502.3H571.7ZM531,499.7C535.8,499.7 539.8,501.3 542.9,504.4C546,507.6 547.4,511.5 547.4,516.3C547.4,521.1 546,524.8 542.9,528C539.9,530.8 536.1,532.4 531.2,532.4C526.5,532.4 522.5,530.8 519.4,527.6C516.3,524.5 514.6,520.6 514.6,516C514.6,511.3 516.3,507.5 519.2,504.3C522.3,501.1 526.3,499.7 531,499.7Z"
        android:fillColor="#ffffff"
        android:fillType="evenOdd"/>
    <path
        android:pathData="M349.8,487.8C349.8,461.9 328.9,441 303,441C277.2,441 256.2,461.9 256.2,487.8V686.7C256.2,712.6 277.2,733.5 303,733.5C328.9,733.5 349.8,712.6 349.8,686.7V487.8Z"
        android:fillColor="#ffffff"/>
  </group>
</vector>
</file>

<file path="apps/main-app/android/app/src/main/res/drawable/logo_io.xml">
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="64dp"
    android:height="52dp"
    android:viewportWidth="64"
    android:viewportHeight="52">
  <group>
    <clip-path
        android:pathData="M6.403,12.971C2.867,12.971 0,10.067 0,6.486C0,2.904 2.867,0 6.403,0C9.939,0 12.806,2.904 12.806,6.486C12.806,10.067 9.939,12.971 6.403,12.971ZM6.403,18.958C9.395,18.958 11.821,21.398 11.821,24.409V45.58C11.821,48.591 9.395,51.032 6.403,51.032C3.411,51.032 0.985,48.591 0.985,45.58V24.409C0.985,21.398 3.411,18.958 6.403,18.958ZM33.972,29.925C33.441,29.925 32.992,29.735 32.644,29.355C32.297,28.975 32.113,28.51 32.113,27.961C32.113,27.412 32.297,26.947 32.624,26.567C32.971,26.187 33.421,26.017 33.952,26.017C34.483,26.017 34.933,26.208 35.28,26.588C35.627,26.968 35.791,27.433 35.791,28.003C35.791,28.573 35.627,29.017 35.28,29.397C34.953,29.735 34.524,29.925 33.972,29.925ZM50.727,29.017H47.907V33.896C47.907,34.382 47.928,34.699 47.948,34.91C47.969,35.1 48.05,35.269 48.193,35.417C48.336,35.565 48.561,35.628 48.868,35.628L50.625,35.586L50.768,38.121C49.746,38.353 48.95,38.48 48.418,38.48C47.029,38.48 46.089,38.163 45.599,37.508C45.088,36.875 44.843,35.692 44.843,33.96V22.997H47.928V26.292H50.748V29.017H50.727ZM38.611,38.184V26.313H41.696V38.205H38.611V38.184ZM43.961,52C54.58,52 64,42.53 64,30.847C64,19.165 54.58,9.695 43.961,9.695C31.338,9.695 21.918,19.165 21.918,30.847C21.918,42.53 31.338,52 43.961,52Z"
        android:fillType="evenOdd"/>
    <path
        android:pathData="M-11.888,-13h100v100h-100z"
        android:fillColor="#ffffff"/>
  </group>
</vector>
</file>

<file path="apps/main-app/android/app/src/main/res/drawable/logo_pagopa.xml">
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="101dp"
    android:height="28dp"
    android:viewportWidth="101"
    android:viewportHeight="28">
  <group>
    <clip-path
        android:pathData="M0,0h100.17v28h-100.17z"/>
    <path
        android:pathData="M100.17,1.97V21.3H97.01L97.01,18.78C95.3,20.34 93.01,21.3 90.51,21.3C87.43,21.3 84.68,19.85 82.91,17.61C83.64,16.57 84.18,15.39 84.49,14.12C85.47,16.48 87.79,18.14 90.51,18.14C94.1,18.14 97.01,15.23 97.01,11.63C97.01,8.04 94.1,5.13 90.51,5.13C87.79,5.13 85.47,6.79 84.49,9.15C84.18,7.88 83.64,6.7 82.91,5.66C84.68,3.41 87.43,1.97 90.51,1.97C93.01,1.97 95.3,2.93 97.01,4.49L97.01,1.97H100.17Z"
        android:fillColor="#ffffff"/>
    <path
        android:pathData="M3.15,1.97L3.15,4.49C4.87,2.93 7.16,1.97 9.66,1.97C12.74,1.97 15.49,3.41 17.26,5.66C16.53,6.7 15.99,7.88 15.68,9.15C14.7,6.79 12.38,5.13 9.66,5.13C6.07,5.13 3.15,8.04 3.15,11.63C3.15,15.23 6.07,18.14 9.66,18.14C12.38,18.14 14.7,16.48 15.68,14.12C15.99,15.39 16.53,16.57 17.26,17.61C15.49,19.85 12.74,21.3 9.66,21.3C7.16,21.3 4.87,20.34 3.15,18.78L3.15,26.82H0V1.97H3.15Z"
        android:fillColor="#ffffff"/>
    <path
        android:pathData="M35.49,1.97V3.46C33.71,4.88 32.4,6.87 31.85,9.15C30.87,6.79 28.54,5.13 25.83,5.13C22.24,5.13 19.32,8.04 19.32,11.63C19.32,15.23 22.24,18.14 25.83,18.14C28.54,18.14 30.87,16.48 31.85,14.12C32.4,16.4 33.71,18.39 35.49,19.81V21.3H32.34L32.34,18.78C30.62,20.34 28.34,21.3 25.83,21.3C20.49,21.3 16.17,16.97 16.17,11.63C16.17,6.3 20.49,1.97 25.83,1.97C28.34,1.97 30.62,2.93 32.34,4.49L32.34,1.97H35.49Z"
        android:fillColor="#ffffff"/>
    <path
        android:pathData="M67.83,1.97L67.83,4.49C69.55,2.93 71.83,1.97 74.34,1.97C79.67,1.97 84,6.3 84,11.63C84,16.97 79.67,21.3 74.34,21.3C71.83,21.3 69.55,20.34 67.83,18.78L67.83,26.82H64.68L64.68,19.81C66.46,18.39 67.77,16.4 68.32,14.12C69.3,16.48 71.62,18.14 74.34,18.14C77.93,18.14 80.85,15.23 80.85,11.63C80.85,8.04 77.93,5.13 74.34,5.13C71.62,5.13 69.3,6.79 68.32,9.15C67.77,6.87 66.46,4.88 64.68,3.46L64.68,1.97H67.83Z"
        android:fillColor="#ffffff"/>
    <path
        android:pathData="M51.66,0V4.49C53.38,2.93 55.66,1.97 58.17,1.97C63.51,1.97 67.83,6.3 67.83,11.63C67.83,16.97 63.51,21.3 58.17,21.3C55.66,21.3 53.38,20.34 51.66,18.78V21.34C51.66,23.8 50.68,26.11 48.95,27.87L48.82,28L46.61,25.74C47.79,24.59 48.46,23.09 48.5,21.5L48.51,21.34L48.51,18.81C46.79,20.38 44.51,21.34 42,21.34C36.66,21.34 32.34,17 32.34,11.66C32.34,6.31 36.66,1.98 42,1.98C44.51,1.98 46.79,2.93 48.51,4.5L48.51,0H51.66ZM42,5.14C38.41,5.14 35.49,8.06 35.49,11.66C35.49,15.26 38.41,18.18 42,18.18C45.59,18.18 48.51,15.26 48.51,11.66C48.51,8.06 45.59,5.14 42,5.14ZM58.17,5.13C54.58,5.13 51.66,8.04 51.66,11.63C51.66,15.23 54.58,18.14 58.17,18.14C61.76,18.14 64.68,15.23 64.68,11.63C64.68,8.04 61.76,5.13 58.17,5.13Z"
        android:fillColor="#ffffff"/>
  </group>
</vector>
</file>

<file path="apps/main-app/android/app/src/main/res/drawable/rn_edit_text_material.xml">
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
       android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
       android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
       android:insetTop="@dimen/abc_edit_text_inset_top_material"
       android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
       >
    <selector>
        <item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
        <item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
    </selector>
</inset>
</file>

<file path="apps/main-app/android/app/src/main/res/drawable/splash_bg.xml">
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <gradient
        android:endColor="#0073E6"
        android:startColor="#0C00D3"
        android:angle="90" />
</shape>
</file>

<file path="apps/main-app/android/app/src/main/res/layout/launch_screen.xml">
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@color/ic_launcher_background"
  android:fitsSystemWindows="false"
>
  <ImageView
    android:id="@+id/ioLogo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/logo_io"
    app:layout_constraintBottom_toTopOf="@+id/logoConsiglioMinistri"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />
  <TextView
    android:id="@+id/splashTitle"
    android:layout_width="match_parent"
    android:layout_height="30dp"
    android:layout_marginTop="16dp"
    android:gravity="center"
    android:text="@string/splash_io_name"
    android:textColor="#FFFFFF"
    android:textSize="16sp"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/ioLogo" />
  <ImageView
    android:id="@+id/logoPagopa"
    android:layout_width="wrap_content"
    android:layout_height="28dp"
    android:src="@drawable/logo_pagopa"
    app:layout_constraintBottom_toBottomOf="@+id/logoConsiglioMinistri"
    app:layout_constraintEnd_toStartOf="@+id/logoConsiglioMinistri"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="@+id/logoConsiglioMinistri" />
  <ImageView
    android:id="@+id/logoConsiglioMinistri"
    android:layout_width="wrap_content"
    android:layout_height="48dp"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:layout_marginBottom="48dp"
    android:src="@mipmap/logo_consiglio_ministri"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent" />
  <ImageView
    android:id="@+id/logoEuNext"
    android:layout_width="wrap_content"
    android:layout_height="25dp"
    android:layout_centerVertical="true"
    android:src="@drawable/eu_next_logo"
    app:layout_constraintBottom_toBottomOf="@+id/logoConsiglioMinistri"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toEndOf="@+id/logoConsiglioMinistri"
    app:layout_constraintTop_toTopOf="@+id/logoConsiglioMinistri" />
</androidx.constraintlayout.widget.ConstraintLayout>
</file>

<file path="apps/main-app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml">
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/ic_launcher_background"/>
    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
    <monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
</file>

<file path="apps/main-app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml">
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/ic_launcher_background"/>
    <foreground android:drawable="@drawable/ic_launcher_foreground"/>
    <monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
</file>

<file path="apps/main-app/android/app/src/main/res/values/bools.xml">
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <bool name="isTablet">false</bool>
</resources>
</file>

<file path="apps/main-app/android/app/src/main/res/values/colors.xml">
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="primary">#0073E6</color>
    <color name="white">#FFFFFF</color>
</resources>
</file>

<file path="apps/main-app/android/app/src/main/res/values/ic_launcher_background.xml">
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="ic_launcher_background">#0B3EE3</color>
</resources>
</file>

<file path="apps/main-app/android/app/src/main/res/values/strings.xml">
<resources>
    <string name="splash_io_name">the app of public services</string>
    <string name="app_name" translatable="false">IO</string>
    <string name="notification_channel_name">Messages</string>
    <string name="notification_channel_description">Receive notification for new messages</string>
    <string name="alert_device_rooted_title">Device rooted</string>
    <string name="alert_device_rooted_desc">This device is rooted, you can\'t use this app for security reasons</string>
    <string name="dialog_attention">Attention</string>
    <string name="tablet_not_supported">Tablet devices are not currently supported</string>
    <string name="default_notification_channel_id" translatable="false">io_default_notification_channel</string>
</resources>
</file>

<file path="apps/main-app/android/app/src/main/res/values/styles.xml">
<resources>
    <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
        <item name="android:forceDarkAllowed">false</item>
        <item name="android:navigationBarColor">@android:color/transparent</item>
    </style>
    <style name="SplashScreenTheme" parent="SplashScreen_SplashTheme">
        <item name="android:statusBarColor">@color/ic_launcher_background</item>
        <item name="android:navigationBarColor">@color/ic_launcher_background</item>
        <item name="android:windowLightStatusBar">false</item>
        <item name="android:windowIsTranslucent">false</item>
        <item name="android:textColor">#FFFFFF</item>
        <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
    </style>
    <style  name="ZendeskTheme"  parent="Theme.MaterialComponents.Light">
      <item  name="colorPrimary">@color/primary</item>
      <item  name="colorPrimaryDark">@color/primary</item>
      <item  name="colorAccent">@color/primary</item>
    </style>
</resources>
</file>

<file path="apps/main-app/android/app/src/main/res/values-it/strings.xml">
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="splash_io_name">l\'app dei servizi pubblici</string>
    <string name="notification_channel_name">Messaggi</string>
    <string name="notification_channel_description">Ricevi la notifica per i nuovi messaggi</string>
    <string name="alert_device_rooted_title">Dispositivo rootato</string>
    <string name="alert_device_rooted_desc">Questo dispositivo dispone di permessi di root, non puoi usare questa app per motivi di sicurezza</string>
    <string name="dialog_attention">Attenzione</string>
    <string name="tablet_not_supported">I dispositivi tablet non sono al momento supportati</string>
</resources>
</file>

<file path="apps/main-app/android/app/src/main/res/values-sw600dp/bools.xml">
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <bool name="isTablet">true</bool>
</resources>
</file>

<file path="apps/main-app/android/app/src/main/AndroidManifest.xml">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="it.pagopa.io.app"
  xmlns:tools="http://schemas.android.com/tools" android:installLocation="auto">
  <queries>
    <intent>
      <action android:name="android.intent.action.VIEW" />
      <data android:scheme="http" android:host="*" />
    </intent>
    <intent>
      <action android:name="android.intent.action.VIEW" />
      <data android:scheme="https" android:host="*" />
    </intent>
  </queries>
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="false"/>
  <uses-permission android:name="android.permission.NFC" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.VIBRATE" />
  <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
  <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" tools:node="remove" />
  <uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove" />
  <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" tools:node="remove"/>
  <uses-permission android:name="android.permission.READ_CALENDAR" />
  <uses-permission android:name="android.permission.WRITE_CALENDAR" />
  <uses-permission android:name="android.permission.CAMERA" />
  <uses-permission android:name="android.permission.USE_FINGERPRINT" />
  <uses-permission android:name="android.permission.USE_BIOMETRIC" />
  <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
  <uses-permission
    android:name="android.permission.BLUETOOTH_SCAN"
    android:usesPermissionFlags="neverForLocation" />
  <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
  <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
  <uses-permission
    android:name="android.permission.BLUETOOTH"
    android:maxSdkVersion="30" />
  <uses-permission
    android:name="android.permission.BLUETOOTH_ADMIN"
    android:maxSdkVersion="30" />
  <uses-permission-sdk-23
    android:name="android.permission.ACCESS_FINE_LOCATION"
    android:maxSdkVersion="30" />
  <application android:name=".MainApplication" android:label="@string/app_name"
    android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="${usesCleartextTraffic}"
    android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false"
    android:requestLegacyExternalStorage="true" android:theme="@style/AppTheme"
    android:supportsRtl="true" android:largeHeap="true">
    <meta-data android:name="com.mixpanel.android.MPConfig.UseIpAddressForGeolocation" android:value="false" />
    <meta-data android:name="com.mixpanel.android.MPConfig.DisableGestureBindingUI" android:value="true" />
    <meta-data android:name="com.mixpanel.android.MPConfig.DisableEmulatorBindingUI" android:value="true" />
    <activity android:name="zendesk.support.guide.HelpCenterActivity" android:theme="@style/ZendeskTheme" />
    <activity android:name="zendesk.support.guide.ViewArticleActivity" android:theme="@style/ZendeskTheme" />
    <activity android:name="zendesk.support.request.RequestActivity" android:theme="@style/ZendeskTheme" />
    <activity android:name="zendesk.support.requestlist.RequestListActivity" android:theme="@style/ZendeskTheme" />
    <activity android:name="zendesk.messaging.MessagingActivity" android:theme="@style/ZendeskTheme" />
    <activity android:name=".MainActivity" android:launchMode="singleTop" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:windowSoftInputMode="adjustResize" android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="ioit" />
      </intent-filter>
      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="iowalletcie" />
      </intent-filter>
      <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" />
        <data android:host="continua.io.pagopa.it" />
      </intent-filter>
      <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" />
        <data android:host="continua.ioapp.it" />
      </intent-filter>
      <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" />
        <data android:host="cittadini.uat.notifichedigitali.it" />
        <data android:host="cittadini.notifichedigitali.it" />
        <data android:pathPrefix="/io" />
      </intent-filter>
      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="openid-credential-offer" />
... (28 lines truncated)
</file>

<file path="apps/main-app/android/app/proguard-rules.pro">
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# [Lines 26-67] Official Proguard by Facebook
# See https://github.com/facebook/react-native/blob/master/ReactAndroid/proguard-rules.pro

# Disabling obfuscation is useful if you collect stack traces from production crashes
# (unless you are using a system that supports de-obfuscate the stack traces).
#-dontobfuscate

# React Native

# Keep our interfaces so they can be used by other ProGuard rules.
# See http://sourceforge.net/p/proguard/bugs/466/
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip

# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
    @com.facebook.proguard.annotations.DoNotStrip *;
    @com.facebook.common.internal.DoNotStrip *;
}

-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
  void set*(***);
  *** get*();
}

-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
-keepclassmembers class *  { @com.facebook.react.uimanager.UIProp <fields>; }
-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }

-dontwarn com.facebook.react.**

# okhttp
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
# This is also needed by Picasso
-dontwarn com.squareup.okhttp.**

-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
# This is also needed by Picasso
-dontwarn okhttp3.**

# okio
-keep class sun.misc.Unsafe { *; }
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**

# Additional rules

# devsupport
-keep class com.facebook.react.devsupport.** { *; }
-dontwarn com.facebook.react.devsupport.**

# MixPanel
-keep class com.kevinejohn.RNMixpanel.** { *; }
-dontwarn com.kevinejohn.RNMixpanel.**

# React Native Config must referencing to BuildConfig
-keep class it.pagopa.io.app.BuildConfig { *; }

# React-native svg
-keep public class com.horcrux.svg.** {*;}
-dontwarn com.horcrux.svg.**


# React-native cie
-keep public class it.ipzs.** {*;}
-dontwarn it.ipzs.**

-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

# React-native Keychain
... (10 lines truncated)
</file>

<file path="apps/main-app/android/fastlane/Appfile">
json_key_file "/tmp/json-key.json" # Path to the json secret file - Follow https://github.com/fastlane/supply#setup to get one
package_name "it.pagopa.io.app" # e.g. com.krausefx.app
</file>

<file path="apps/main-app/android/fastlane/Fastfile">
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://docs.fastlane.tools/actions
# can also be listed using the `fastlane actions` command

# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`

# If you want to automatically update fastlane if a new version is available:
# update_fastlane

# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "2.233.1"

default_platform :android

platform :android do
  desc "Get current canary version code from Google Play"
  lane :current_canary_version_code do
    version_codes = google_play_track_version_codes(
      package_name: "it.pagopa.io.app.canary",
      track: "internal"
    ) || []

    current_code = (version_codes.map(&:to_i).max || 0)

    if ENV["GITHUB_OUTPUT"]
      File.open(ENV["GITHUB_OUTPUT"], "a") do |file|
        file.puts("CURRENT_CANARY_VERSION_CODE=#{current_code}")
      end
    end

    UI.message("CURRENT_CANARY_VERSION_CODE=#{current_code}")
  end

  desc "Build the App in release mode"
  lane :build_release do
    # Ensure that your git status is not dirty
    #ensure_git_status_clean

    gradle(
      task: "bundle",
      flavor: "production",
      build_type: "Release",
      # flags: "-x bundleReleaseJsAndAssets --no-daemon"
    )
  end

  desc "Build the App in release mode for Canary"
  lane :build_canary_release do
    # Ensure that your git status is not dirty
    #ensure_git_status_clean

    gradle(
      task: "bundle",
      flavor: "canary",
      build_type: "Release",
      # flags: "-x bundleReleaseJsAndAssets --no-daemon"
    )
  end

  desc "Build the App in release mode and deploy a new alpha version to the Google Play Store"
  lane :alpha do
    build_release

    # Generate the changelog from the last commit message
    changelog_from_git_commits(
      commits_count: 1
    )

    upload_to_play_store(
      track: "internal",
      skip_upload_screenshots: true,
      skip_upload_images: true
    )
  end

  desc "Build the App in release mode and deploy a new alpha version to the Google Play Store (Canary)"
  lane :alpha_canary do
    build_canary_release

    # Generate the changelog from the last commit message
    changelog_from_git_commits(
      commits_count: 1
    )

    upload_to_play_store(
      track: "internal",
      package_name: "it.pagopa.io.app.canary",
      skip_upload_screenshots: true,
      skip_upload_images: true
    )
  end

  desc "Promote the internal version to alpha"
  lane :promote_internal_to_alpha do
    upload_to_play_store(track: "internal", track_promote_to: "alpha")
  end

... (28 lines truncated)
</file>

<file path="apps/main-app/android/gradlew">
#!/bin/sh

#
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
#   Gradle start up script for POSIX generated by Gradle.
#
#   Important for running:
#
#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
#       noncompliant, but you have some other compliant shell such as ksh or
#       bash, then to run this script, type that shell name before the whole
#       command line, like:
#
#           ksh Gradle
#
#       Busybox and similar reduced shells will NOT work, because this script
#       requires all of these POSIX shell features:
#         * functions;
#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;
#         * compound commands having a testable exit status, especially «case»;
#         * various built-in commands including «command», «set», and «ulimit».
#
#   Important for patching:
#
#   (2) This script targets any POSIX shell, so it avoids extensions provided
#       by Bash, Ksh, etc; in particular arrays are avoided.
#
#       The "traditional" practice of packing multiple parameters into a
#       space-separated string is a well documented source of bugs and security
#       problems, so this is (mostly) avoided, by progressively accumulating
#       options in "$@", and eventually passing that to Java.
#
#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
#       see the in-line comments for details.
#
#       There are tweaks for specific operating systems such as AIX, CygWin,
#       Darwin, MinGW, and NonStop.
#
#   (3) This script is generated from the Groovy template
#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
#       within the Gradle project.
#
#       You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################

# Attempt to set APP_HOME

# Resolve links: $0 may be a link
app_path=$0

# Need this for daisy-chained symlinks.
while
    APP_HOME=${app_path%"${app_path##*/}"}  # leaves a trailing /; empty if no leading path
    [ -h "$app_path" ]
do
    ls=$( ls -ld "$app_path" )
    link=${ls#*' -> '}
    case $link in             #(
      /*)   app_path=$link ;; #(
      *)    app_path=$APP_HOME$link ;;
    esac
done

# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

warn () {
    echo "$*"
} >&2

die () {
    echo
    echo "$*"
... (152 lines truncated)
</file>

<file path="apps/main-app/android/gradlew.bat">
@REM Copyright (c) Meta Platforms, Inc. and affiliates.
@REM
@REM This source code is licensed under the MIT license found in the
@REM LICENSE file in the root directory of this source tree.

@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem      https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

:execute
@rem Setup the command line

set CLASSPATH=


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
</file>

<file path="apps/main-app/img/features/itWallet/credential/trustmark-stamp.svg.html">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 62 75">
  <g clip-path="url(#a)">
    <path
      fill="url(#b)"
      d="M59.078 12.368a15.537 15.537 0 0 0-7.67-5.686L31.98.164a2.981 2.981 0 0 0-1.948 0l-19.44 6.518a15.478 15.478 0 0 0-7.67 5.686A15.682 15.682 0 0 0 0 21.504V37.5c0 23.632 28.518 36.682 29.749 37.227.392.177.825.273 1.258.273.433 0 .866-.096 1.258-.273 1.217-.545 29.748-13.595 29.748-37.227V21.505c0-3.287-1.014-6.478-2.922-9.137h-.013Zm2.72 25.132c0 23.59-28.41 36.504-29.628 37.036a2.94 2.94 0 0 1-2.354 0c-.324-.136-7.887-3.545-15.273-9.927C5.033 56.4.203 47.277.203 37.5V21.505c0-3.26.987-6.382 2.881-9.014a15.143 15.143 0 0 1 7.576-5.605L30.087.355c.297-.096.609-.15.92-.15.31 0 .622.054.92.15l19.426 6.531c3.071 1.023 5.682 2.973 7.576 5.605a15.367 15.367 0 0 1 2.882 9.014V37.5h-.014Z"
    />
    <path
      fill="url(#c)"
      d="m50.352 8.086-18.425-6.19a3.042 3.042 0 0 0-.934-.15c-.324 0-.622.054-.933.15l-18.425 6.19a14.633 14.633 0 0 0-7.279 5.387 14.959 14.959 0 0 0-2.773 8.672v15.178c0 22.418 27.057 34.8 28.22 35.318.379.163.785.259 1.19.259.406 0 .812-.082 1.19-.26 1.164-.517 28.22-12.9 28.22-35.317V22.145c0-3.109-.973-6.15-2.772-8.672a14.692 14.692 0 0 0-7.279-5.387Zm9.781 14.1V37.31c0 22.323-26.907 34.555-28.057 35.073-.108.04-.203.081-.311.122a2.539 2.539 0 0 1-.785.11c-.379 0-.744-.082-1.11-.246-.378-.177-7.508-3.395-14.448-9.395-8.915-7.705-13.555-16.337-13.555-25.65V22.2c0-.355 0-.75.04-1.105a14.459 14.459 0 0 1 2.666-7.418c.108-.15.216-.3.338-.45a14.404 14.404 0 0 1 6.818-4.854l18.412-6.205c.176-.054.379-.109.568-.123.095 0 .19-.013.298-.013.284 0 .568.04.839.136L50.27 8.36c2.706.9 5.033 2.564 6.791 4.814.122.163.257.327.38.504a14.345 14.345 0 0 1 2.65 7.268c.028.396.055.846.055 1.255l-.014-.014Z"
    />
    <path
      fill="url(#d)"
      d="M49.31 9.477 31.872 3.614a2.77 2.77 0 0 0-.879-.15 2.77 2.77 0 0 0-.88.15L12.677 9.477a13.871 13.871 0 0 0-6.886 5.1 14.128 14.128 0 0 0-2.624 8.196v14.345c0 21.218 25.595 32.932 26.69 33.41a2.75 2.75 0 0 0 2.273 0c1.096-.492 26.692-12.205 26.692-33.41V22.773c0-2.946-.92-5.81-2.625-8.196a13.872 13.872 0 0 0-6.886-5.1Zm9.159 13.391v14.264c0 21.054-25.406 32.604-26.488 33.095-.095.041-.19.082-.298.11a2.53 2.53 0 0 1-.717.095 2.37 2.37 0 0 1-1.028-.246c-.447-.204-7.116-3.245-13.623-8.863-8.32-7.187-12.798-15.328-12.798-24.191V22.868c0-.327 0-.723.04-1.05a13.645 13.645 0 0 1 2.504-6.995c.108-.15.202-.287.31-.423a13.456 13.456 0 0 1 6.427-4.582l17.397-5.85a2.46 2.46 0 0 1 .528-.123c.094 0 .175-.013.27-.013.257 0 .514.04.771.123l17.438 5.863a13.42 13.42 0 0 1 6.386 4.541c.121.15.243.314.351.477a13.579 13.579 0 0 1 2.53 8.032Z"
    />
    <path
      fill="url(#e)"
      d="M48.269 10.882 31.832 5.359a2.494 2.494 0 0 0-.825-.136c-.27 0-.555.04-.826.136l-16.436 5.523a13.112 13.112 0 0 0-6.494 4.813 13.308 13.308 0 0 0-2.476 7.732v13.528c0 20.004 24.135 31.05 25.177 31.513.338.15.703.232 1.068.232.366 0 .73-.082 1.069-.232 1.028-.464 25.176-11.509 25.176-31.514V23.428c0-2.782-.866-5.482-2.476-7.732a13.112 13.112 0 0 0-6.493-4.813h-.027Zm8.55 12.668v13.405c0 19.8-23.905 30.668-24.92 31.118-.094.04-.189.068-.284.095a1.773 1.773 0 0 1-.649.082c-.311 0-.636-.082-.96-.232-.501-.232-6.724-3.082-12.798-8.332C9.483 53.005 5.195 45.355 5.195 36.955V23.55c0-.286 0-.695.027-.982a12.694 12.694 0 0 1 2.327-6.573c.094-.136.19-.272.297-.395a12.571 12.571 0 0 1 6.034-4.31l16.383-5.508c.148-.055.351-.096.5-.11.081 0 .162-.013.257-.013.23 0 .474.04.69.11l16.437 5.522a12.627 12.627 0 0 1 5.993 4.268l.325.45a12.796 12.796 0 0 1 2.313 6.45c.027.327.04.777.04 1.105v-.014Z"
    />
    <path
      fill="url(#f)"
      d="M47.227 12.273 31.792 7.077a2.55 2.55 0 0 0-1.57 0l-15.436 5.196a12.325 12.325 0 0 0-6.1 4.513 12.488 12.488 0 0 0-2.328 7.269v12.709c0 18.79 22.674 29.168 23.648 29.604.31.137.65.218 1 .218.353 0 .69-.068 1.002-.218.974-.436 23.647-10.813 23.647-29.604v-12.71c0-2.604-.811-5.154-2.327-7.268a12.325 12.325 0 0 0-6.1-4.513Zm7.928 11.959v12.545c0 18.532-22.403 28.719-23.35 29.141-.081.041-.176.068-.257.096-.19.054-.392.082-.595.068-.27 0-.582-.082-.893-.232-.568-.259-6.331-2.932-11.96-7.8C10.972 51.886 6.86 44.727 6.86 36.777V24.232c0-.246 0-.668.027-.914a11.865 11.865 0 0 1 2.151-6.15c.095-.122.176-.259.27-.382a11.831 11.831 0 0 1 5.628-4.036l15.368-5.168c.122-.041.325-.096.46-.11.081 0 .163-.013.23-.013.217 0 .42.041.623.096L47.05 12.75a11.742 11.742 0 0 1 5.601 3.995c.108.137.203.273.311.423a11.886 11.886 0 0 1 2.138 6.041c.027.287.04.736.04 1.023h.014Z"
    />
    <path
      fill="url(#g)"
      d="M46.172 13.677 31.724 8.823a2.22 2.22 0 0 0-1.461 0l-14.448 4.854c-2.3.764-4.289 2.25-5.71 4.227a11.657 11.657 0 0 0-2.177 6.791v11.891c0 17.578 21.212 27.287 22.118 27.696.298.136.61.204.934.204.325 0 .636-.068.933-.204.907-.41 22.119-10.118 22.119-27.696v-11.89c0-2.442-.757-4.814-2.178-6.792a11.505 11.505 0 0 0-5.709-4.227h.027Zm7.305 11.237v11.672c0 17.264-20.887 26.769-21.78 27.164a.858.858 0 0 1-.244.082 1.74 1.74 0 0 1-.527.054c-.244 0-.528-.082-.825-.218-.623-.3-5.953-2.782-11.134-7.268-6.534-5.66-10.471-12.327-10.471-19.814V24.9c0-.218 0-.641.027-.845.108-2.06.798-4.037 1.975-5.728a10.83 10.83 0 0 1 5.492-4.105l14.354-4.827c.108-.04.311-.095.42-.109.067 0 .148-.013.216-.013.19 0 .365.027.541.095l14.448 4.855a10.795 10.795 0 0 1 5.209 3.722c.094.123.189.26.284.396a10.98 10.98 0 0 1 1.961 5.632c.014.245.027.695.027.94h.027Z"
    />
    <path
      fill="url(#h)"
      d="m45.13 15.068-13.447-4.527a2.266 2.266 0 0 0-.676-.11c-.23 0-.46.042-.677.11l-13.447 4.527a10.766 10.766 0 0 0-5.316 3.941 10.934 10.934 0 0 0-2.03 6.327V36.41c0 16.364 19.752 25.405 20.604 25.787.27.122.568.19.866.19.298 0 .595-.068.866-.19.852-.382 20.603-9.423 20.603-25.787V25.336c0-2.277-.703-4.486-2.029-6.327a10.765 10.765 0 0 0-5.317-3.94Zm6.697 10.528v10.813c0 16.01-19.386 24.818-20.211 25.187a1.13 1.13 0 0 1-.23.068 1.29 1.29 0 0 1-.46.04c-.217 0-.46-.081-.758-.218-.69-.327-5.56-2.631-10.308-6.736-5.94-5.14-9.7-11.318-9.7-18.355V25.569c0-.177 0-.613.013-.79.095-1.91.717-3.737 1.813-5.305.081-.11.149-.218.23-.328a9.915 9.915 0 0 1 4.83-3.477l13.339-4.486c.094-.027.297-.082.392-.096.068 0 .135-.013.203-.013.162 0 .325.027.473.082l13.448 4.527c1.92.64 3.584 1.84 4.816 3.463.094.123.175.246.257.369a10.214 10.214 0 0 1 1.799 5.222c.013.205.027.669.027.86h.027Z"
    />
    <path
      fill="url(#i)"
      d="m44.089 16.473-12.46-4.187a1.996 1.996 0 0 0-.622-.109c-.203 0-.42.041-.623.11l-12.46 4.186a9.98 9.98 0 0 0-4.923 3.64 10.114 10.114 0 0 0-1.88 5.864v10.255c0 15.15 18.29 23.523 19.074 23.877.257.11.528.177.812.177.284 0 .554-.054.811-.177.785-.355 19.075-8.714 19.075-23.877V25.977c0-2.1-.65-4.159-1.88-5.863a9.9 9.9 0 0 0-4.924-3.641Zm6.074 9.804v9.955c0 14.74-17.885 22.868-18.642 23.209a1.187 1.187 0 0 1-.596.095c-.175 0-.405-.081-.676-.204-.744-.355-5.168-2.468-9.47-6.205-5.343-4.636-8.915-10.309-8.915-16.895v-9.955c0-.136 0-.586.014-.723a9.275 9.275 0 0 1 1.637-4.881c.067-.096.135-.205.216-.3a9.144 9.144 0 0 1 4.437-3.205l12.325-4.145c.067-.028.27-.082.351-.096.054 0 .122-.013.176-.013.136 0 .27.027.406.068l12.46 4.186a9.144 9.144 0 0 1 4.667 3.532 9.189 9.189 0 0 1 1.623 4.814c0 .163.014.627.014.79l-.027-.027Z"
    />
    <path
      fill="url(#j)"
      d="m43.033 17.863-11.458-3.845a1.68 1.68 0 0 0-.582-.095 1.68 1.68 0 0 0-.582.095l-11.458 3.845a9.16 9.16 0 0 0-4.532 3.355 9.173 9.173 0 0 0-1.718 5.386v9.437c0 13.95 16.829 21.654 17.546 21.968.23.11.487.164.744.164s.514-.055.744-.164c.717-.327 17.546-8.018 17.546-21.968v-9.437a9.239 9.239 0 0 0-1.718-5.386 9.16 9.16 0 0 0-4.532-3.355ZM48.5 26.96v9.095c0 13.487-16.383 20.932-17.087 21.232a.984.984 0 0 1-.189.055.708.708 0 0 1-.338 0c-.149-.014-.352-.082-.609-.205-.812-.395-4.789-2.318-8.645-5.672-4.748-4.119-8.143-9.314-8.143-15.437v-9.75a8.332 8.332 0 0 1 1.46-4.459c.068-.095.122-.177.19-.273a8.326 8.326 0 0 1 4.045-2.932l11.31-3.804s.257-.082.31-.082c.055 0 .109-.014.163-.014.108 0 .216.014.325.055l11.458 3.86a8.349 8.349 0 0 1 4.032 2.917c.08.096.148.205.216.314a8.406 8.406 0 0 1 1.447 4.404c0 .123.014.587.014.71l.04-.014Z"
    />
    <path
      fill="url(#k)"
      d="M41.992 19.268 31.52 15.75a1.774 1.774 0 0 0-.528-.082c-.176 0-.351.027-.527.082l-10.471 3.518a8.318 8.318 0 0 0-4.14 3.068 8.324 8.324 0 0 0-1.57 4.923v8.618c0 12.737 15.369 19.773 16.032 20.06.216.095.446.15.676.15.23 0 .46-.055.677-.15.663-.287 16.03-7.323 16.03-20.06V27.26c0-1.773-.554-3.49-1.569-4.923a8.4 8.4 0 0 0-4.14-3.068Zm4.843 8.373v8.223c0 12.218-14.881 18.982-15.517 19.268a.372.372 0 0 1-.176.04.902.902 0 0 1-.27 0c-.109-.013-.298-.081-.542-.204-.865-.423-4.396-2.168-7.819-5.14-4.153-3.6-7.373-8.305-7.373-13.978v-8.836a7.558 7.558 0 0 1 1.475-4.282 7.412 7.412 0 0 1 3.639-2.66l10.295-3.463s.243-.082.284-.082c.04 0 .095-.013.149-.013.08 0 .176.013.257.04l10.47 3.519a7.47 7.47 0 0 1 3.64 2.645c.067.096.135.191.203.273a7.462 7.462 0 0 1 1.271 3.982v.627l.014.04Z"
    />
    <path
      fill="url(#l)"
      d="m40.95 20.659-9.47-3.177a1.385 1.385 0 0 0-.473-.082c-.163 0-.325.027-.474.082l-9.47 3.177a7.612 7.612 0 0 0-3.747 2.768 7.599 7.599 0 0 0-1.42 4.46v7.8c0 11.522 13.907 17.89 14.502 18.15.19.081.406.136.609.136.202 0 .419-.041.608-.137.596-.259 14.503-6.627 14.503-18.15v-7.8c0-1.595-.5-3.163-1.42-4.459a7.553 7.553 0 0 0-3.748-2.768Zm4.22 7.664v7.363c0 10.95-13.379 17.032-13.947 17.291a.307.307 0 0 1-.149.041c-.067 0-.135 0-.203-.014-.08-.013-.243-.081-.473-.19-.934-.45-4.005-2.019-6.98-4.61-3.559-3.095-6.603-7.309-6.603-12.518v-7.909a6.62 6.62 0 0 1 1.123-3.614c.054-.068.095-.15.15-.218a6.557 6.557 0 0 1 3.246-2.386l9.28-3.123s.23-.068.244-.082c.04 0 .08-.013.122-.013.067 0 .121 0 .175.027l9.47 3.177a6.59 6.59 0 0 1 3.247 2.373c.054.082.122.164.176.245a6.697 6.697 0 0 1 1.11 3.573v.56l.013.027Z"
    />
    <path
      fill="url(#m)"
      d="m39.909 22.05-8.483-2.85a1.513 1.513 0 0 0-.433-.068c-.148 0-.284.027-.432.068l-8.483 2.85a6.793 6.793 0 0 0-3.355 2.482 6.77 6.77 0 0 0-1.271 3.982v6.982c0 10.309 12.446 16.009 12.973 16.24a1.314 1.314 0 0 0 1.11 0c.527-.231 12.973-5.931 12.973-16.24v-6.982a6.865 6.865 0 0 0-1.272-3.982 6.734 6.734 0 0 0-3.354-2.482h.027Zm3.612 13.445c0 9.696-11.865 15.082-12.379 15.314a.479.479 0 0 1-.135.027c-.04 0-.095 0-.135-.027-.5-.218-12.379-5.618-12.379-15.313v-6.982c0-1.228.38-2.4 1.083-3.396a5.704 5.704 0 0 1 2.854-2.113l8.469-2.85s.067-.014.108-.014c.04 0 .068 0 .108.014l8.482 2.85a5.65 5.65 0 0 1 2.841 2.113 5.855 5.855 0 0 1 1.083 3.396v6.982Z"
    />
    <path
      fill="url(#n)"
      d="m36.35 31.05-6.615 6.532-4.085-4.023a.52.52 0 0 0-.717 0 .517.517 0 0 0 0 .723l4.437 4.377c.095.095.23.15.352.15a.513.513 0 0 0 .351-.15l6.968-6.886a.505.505 0 0 0 0-.723.496.496 0 0 0-.717 0h.027Z"
    />
  </g>
  <defs>
    <linearGradient
      id="b"
      x1="31.007"
      x2="31.007"
      y1="0"
      y2="75"
      gradientUnits="userSpaceOnUse"
    >
      <stop stop-color="#C3CFEF" />
      <stop offset=".165" stop-color="#BCC3D8" />
      <stop offset=".37" stop-color="#BBCAF5" />
      <stop offset=".705" stop-color="#5A6585" />
      <stop offset="1" stop-color="#9DAEE0" />
    </linearGradient>
    <linearGradient
      id="c"
      x1="30.993"
      x2="30.993"
      y1="1.745"
      y2="72.9"
      gradientUnits="userSpaceOnUse"
    >
      <stop stop-color="#C3CFEF" />
      <stop offset=".165" stop-color="#BCC3D8" />
      <stop offset=".37" stop-color="#BBCAF5" />
      <stop offset=".705" stop-color="#5A6585" />
      <stop offset="1" stop-color="#9DAEE0" />
    </linearGradient>
    <linearGradient
      id="d"
      x1="30.993"
      x2="30.993"
      y1="3.464"
      y2="70.773"
      gradientUnits="userSpaceOnUse"
    >
      <stop stop-color="#C3CFEF" />
      <stop offset=".165" stop-color="#BCC3D8" />
      <stop offset=".37" stop-color="#BBCAF5" />
      <stop offset=".705" stop-color="#5A6585" />
      <stop offset="1" stop-color="#9DAEE0" />
    </linearGradient>
    <linearGradient
      id="e"
... (144 lines truncated)
</file>

<file path="apps/main-app/ios/fastlane/metadata/it/description.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/it/keywords.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/it/marketing_url.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/it/name.txt">
IO
</file>

<file path="apps/main-app/ios/fastlane/metadata/it/privacy_url.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/it/promotional_text.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/it/release_notes.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/it/subtitle.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/it/support_url.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/review_information/demo_password.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/review_information/demo_user.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/review_information/email_address.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/review_information/first_name.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/review_information/last_name.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/review_information/notes.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/review_information/phone_number.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/address_line1.txt">
Piazza Colonna 370
</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/address_line2.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/address_line3.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/city_name.txt">
Roma
</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/country.txt">
Italy
</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/email_address.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/first_name.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/is_displayed_on_app_store.txt">
false
</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/last_name.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/phone_number.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/postal_code.txt">
00189
</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/state.txt">
ROMA
</file>

<file path="apps/main-app/ios/fastlane/metadata/trade_representative_contact_information/trade_name.txt">
Team per la Trasformazione Digitale
</file>

<file path="apps/main-app/ios/fastlane/metadata/copyright.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/primary_category.txt">
MZGenre.Productivity
</file>

<file path="apps/main-app/ios/fastlane/metadata/primary_first_sub_category.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/primary_second_sub_category.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/secondary_category.txt">
MZGenre.Utilities
</file>

<file path="apps/main-app/ios/fastlane/metadata/secondary_first_sub_category.txt">

</file>

<file path="apps/main-app/ios/fastlane/metadata/secondary_second_sub_category.txt">

</file>

<file path="apps/main-app/ios/fastlane/Appfile">
# team digitale
#app_identifier "it.teamdigitale.app.IO" # The bundle identifier of your app
# pago pa
app_identifier "it.pagopa.app.io" # The bundle identifier of your app

# team_id "4RV73SN38W" # Developer Portal Team ID

# pagopa
team_id "M2X5YQ4BJ7"

# team digitale
#team_id "BC8NKY5TF7"

# you can even provide different app identifiers, Apple IDs and team names per lane:
# More information: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md
</file>

<file path="apps/main-app/ios/fastlane/Fastfile">
# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://docs.fastlane.tools/actions
# can also be listed using the `fastlane actions` command

# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`

# If you want to automatically update fastlane if a new version is available:
# update_fastlane

# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "2.233.1"

default_platform :ios

platform :ios do
  before_all do
    setup_ci()
  end

  # Temporary disables automatic code signing so the matched profile is used.
  # @param build_configuration [String] Xcode signing settings (e.g. "Release", "Canary").
  # @param profile_name [String] Name of the matched provisioning profile to sign the build with (e.g. "match AppStore it.pagopa.app.io").
  private_lane :disable_automatic_code_signing do |options|
    update_code_signing_settings(
      use_automatic_signing: false,
      path: "IO.xcodeproj",
      team_id: "M2X5YQ4BJ7",
      targets: ["IO"],
      build_configurations: [options[:build_configuration]],
      profile_name: options[:profile_name],
      code_sign_identity: "iPhone Distribution",
      sdk: "iphoneos*",
    )
  end

  # Generates the changelog from every commit since the last tag ending with
  # @param tag_suffix [String] Release type which can be a release candidate or a canary (e.g. "rc", "canary").
  private_lane :changelog_since_last_tag do |options|
    previous_tag = sh("git tag --sort=-taggerdate | grep \\\\-#{options[:tag_suffix]}\\\\. | sed -n '2 p' | tr -d '\n'")

    changelog_from_git_commits(
      tag_match_pattern: "*" + previous_tag + "*",
      pretty: "- %s",
      merge_commit_filtering: "exclude_merges"
    )
  end

  # Authenticates with the App Store Connect API key, returning it so it can
  # be reused by `sync_code_signing`/`pilot`. Requires `setup_ci` (run in
  # `before_all`) so the CI keychain is ready for credential access.
  private_lane :authenticate_app_store_connect do
    app_store_connect_api_key(
      key_id: "#{ENV['APP_STORE_API_KEY_ID']}",
      issuer_id: "#{ENV['APP_STORE_API_KEY_ISSUER_ID']}",
      key_filepath: "./fastlane/AuthKey_#{ENV['APP_STORE_API_KEY_ID']}.p8",
      duration: 1200,
    )
  end

  desc "Submit a new Beta Build to TestFlight"
  lane :beta_testflight do |options|

    # xCode 14.2, prevents altool to fail with error "Could not
    # determine the package’s bundle ID" during the "pilot" step
    # See https://github.com/fastlane/fastlane/issues/20741
    ENV['ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD'] = 'false'

    # use the App Store API Key to authenticate
    api_key = authenticate_app_store_connect

    sync_code_signing(type: "appstore", api_key: api_key)

    # Install pods
    cocoapods

    # Temporary disables automatic code signing to avoid issues during build
    disable_automatic_code_signing(
      build_configuration: "Release",
      profile_name: "match AppStore it.pagopa.app.io"
    )

    # build the app
    gym(
      scheme: "IO",
      clean: true,
      export_method: "app-store",
      workspace: "IO.xcworkspace",
      include_symbols: false
    )

    # generate the changelog based on last commits
    changelog = changelog_since_last_tag(tag_suffix: "rc")

    # upload to App store
    pilot(
      api_key: api_key,
      changelog: changelog,
... (77 lines truncated)
</file>

<file path="apps/main-app/ios/fastlane/Matchfile">
git_url "git@github.com:pagopa/IO-App-certs.git"

type "development" # The default type, can be: appstore, adhoc, enterprise or development

# app_identifier ["tools.fastlane.app", "tools.fastlane.app2"]
# username "user@fastlane.tools" # Your Apple Developer Portal username

# For all available options run `fastlane match --help`
# Remove the # in the beginning of the line to enable the other options
</file>

<file path="apps/main-app/ios/fastlane/Matchfile_canary">
git_url "git@github.com:pagopa/IO-App-canary-certs.git"

type "development" # The default type, can be: appstore, adhoc, enterprise or development

# app_identifier ["tools.fastlane.app", "tools.fastlane.app2"]
# username "user@fastlane.tools" # Your Apple Developer Portal username

# For all available options run `fastlane match --help`
# Remove the # in the beginning of the line to enable the other options
</file>

<file path="apps/main-app/ios/fastlane/README.md">
fastlane documentation
----

# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```sh
xcode-select --install
```

For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)

# Available Actions

## iOS

### ios beta_testflight

```sh
[bundle exec] fastlane ios beta_testflight
```

Submit a new Beta Build to TestFlight

### ios canary_testflight

```sh
[bundle exec] fastlane ios canary_testflight
```

Submit a new Canary Build to TestFlight

### ios distribute_beta_testflight

```sh
[bundle exec] fastlane ios distribute_beta_testflight
```

Distribute previously uploaded beta to TestFlight, using GA

---

This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).

The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
</file>

<file path="apps/main-app/ios/IO/de.lproj/InfoPlist.strings">
"NSCameraUsageDescription" = "Du kannst QR-Codes lesen und pagoPA-Mitteilungen bezahlen."; 
"NSCalendarsUsageDescription" = "Du kannst Fälligkeiten in deinem Kalender eintragen und eine Benachrichtigung einstellen."; 
"NSContactsUsageDescription" = "IO benötigt Zugriff auf deine Kontakte, damit du sie als Teilnehmer zu Terminen hinzufügen kannst."; 
"NSFaceIDUsageDescription" = "Du kannst dich direkt in der App einloggen ohne den Entsperrcode einzugeben."; 
"NSPhotoLibraryUsageDescription" = "Du kannst Gutscheine und Zertifikate speichern und Screenshots und Zahlungsmitteilungen hochladen.";
"NSMicrophoneUsageDescription" = "IO benötigt Zugriff auf das Mikrofon, wenn du eine Sprachnachricht senden möchtest."; 
"NSPhotoLibraryAddUsageDescription" = "Du kannst Bilder aus der App auf deinem Gerät speichern.";
</file>

<file path="apps/main-app/ios/IO/de.lproj/Localizable.strings">
"ALERT_DEVICE_ROOTED_TITLE" = "Gerät mit Jailbreak";
"ALERT_DEVICE_ROOTED_DESC" = "Dieses Gerät ist gejailbreakt, du kannst diese App aus Sicherheitsgründen nicht verwenden";
</file>

<file path="apps/main-app/ios/IO/en.lproj/InfoPlist.strings">

</file>

<file path="apps/main-app/ios/IO/en.lproj/LaunchScreen.strings">

</file>

<file path="apps/main-app/ios/IO/en.lproj/Localizable.strings">
"ALERT_DEVICE_ROOTED_TITLE" = "Device jailbroken";
"ALERT_DEVICE_ROOTED_DESC" = "This device is jailbroken, you can't use this app for security reasons";
</file>

<file path="apps/main-app/ios/IO/it.lproj/InfoPlist.strings">
"NSBluetoothAlwaysUsageDescription" = "IO richiede l'accesso al Bluetooth per completare la verifica dei documenti";
"NSBluetoothPeripheralUsageDescription" = "IO richiede l'accesso al Bluetooth per completare la verifica dei documenti";
"NSCameraUsageDescription" = "Potrai leggere codici QR e pagare gli avvisi pagoPA.";
"NSCalendarsUsageDescription" = "Se acconsenti, potrai aggiungere le scadenze al tuo calendario e impostare un promemoria.";
"NSContactsUsageDescription" = "IO ha necessità di accedere ai tuoi contatti per permetterti di aggiungerli come partecipanti alle scadenze";
"NSFaceIDUsageDescription" = "Potrai accedere più facilmente in app senza digitare il codice di sblocco.";
"NSPhotoLibraryUsageDescription" = "Potrai salvare bonus e certificati, caricare screenshot e avvisi di pagamento.";
"NSMicrophoneUsageDescription" = "IO ha necessità di accedere al microfono nel caso in cui desideri mandare una nota vocale";
"NSPhotoLibraryAddUsageDescription" = "Potrai salvare immagini dall'app sul tuo dispositivo.";
</file>

<file path="apps/main-app/ios/IO/it.lproj/LaunchScreen.strings">

</file>

<file path="apps/main-app/ios/IO/it.lproj/Localizable.strings">
"ALERT_DEVICE_ROOTED_TITLE" = "Dispositivo jailbroken";
"ALERT_DEVICE_ROOTED_DESC" = "Questo dispositivo dispone di jailbreak, non puoi usare questa app per motivi di sicurezza";
</file>

<file path="apps/main-app/ios/IO/Info.plist">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>BGTaskSchedulerPermittedIdentifiers</key>
    <array>
      <string>com.expo.modules.backgroundtask.processing</string>
    </array>
    <key>CADisableMinimumFrameDurationOnPhone</key>
    <true/>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>IO</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>3.43.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleURLTypes</key>
    <array>
      <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>ioit</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>ioit</string>
          <string>iowalletcie</string>
          <string>iologincie</string>
          <string>openid-credential-offer</string>
          <string>haip-vci</string>
        </array>
      </dict>
    </array>
    <key>CFBundleVersion</key>
    <string>7</string>
    <key>ITSAppUsesNonExemptEncryption</key>
    <false/>
    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>http</string>
      <string>https</string>
      <string>CIEID</string>
    </array>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>LSSupportsOpeningDocumentsInPlace</key>
    <true/>
    <key>NFCReaderUsageDescription</key>
    <string>NFC tag to read EIC cards</string>
    <key>NSAppTransportSecurity</key>
    <dict>
      <key>NSAllowsArbitraryLoads</key>
      <false/>
      <key>NSAllowsLocalNetworking</key>
      <true/>
      <key>NSExceptionDomains</key>
      <dict>
        <key>localhost</key>
        <dict>
          <key>NSExceptionAllowsInsecureHTTPLoads</key>
          <true/>
        </dict>
      </dict>
    </dict>
    <key>NSAppleMusicUsageDescription</key>
    <string>The app needs NSAppleMusicUsageDescription permission</string>
    <key>NSBluetoothAlwaysUsageDescription</key>
    <string>IO richiede l'accesso al Bluetooth per completare la verifica dei documenti</string>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>IO richiede l'accesso al Bluetooth per completare la verifica dei documenti</string>
    <key>NSCalendarsFullAccessUsageDescription</key>
    <string>So that you’ll be able to add deadlines to your calendar and set a reminder.</string>
    <key>NSCalendarsUsageDescription</key>
    <string>So that you’ll be able to add deadlines to your calendar and set a reminder.</string>
    <key>NSCameraUsageDescription</key>
    <string>You’ll be able to read QR codes and pay pagoPA notices.</string>
    <key>NSContactsUsageDescription</key>
    <string>IO needs access to your contacts to let you add them in calendar events</string>
    <key>NSFaceIDUsageDescription</key>
    <string>You'll be able to access the app more easily without having to enter the unlock code.</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>The app needs NSLocationAlwaysUsageDescription permission</string>
    <key>NSLocationUsageDescription</key>
    <string>The app needs NSLocationUsageDescription permission</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>The app needs NSLocationWhenInUseUsageDescription permission</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>IO needs access to the microphone in case you want to leave a voice note</string>
... (98 lines truncated)
</file>

<file path="apps/main-app/ios/IO/IO-Canary.entitlements">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>aps-environment</key>
	<string>development</string>
	<key>com.apple.developer.associated-domains</key>
	<array>
		<string>applinks:continua.io.pagopa.it</string>
		<string>applinks:continua.ioapp.it</string>
		<string>applinks:cittadini.uat.notifichedigitali.it</string>
		<string>applinks:cittadini.notifichedigitali.it</string>
	</array>
	<key>com.apple.developer.nfc.readersession.formats</key>
	<array>
		<string>TAG</string>
	</array>
</dict>
</plist>
</file>

<file path="apps/main-app/ios/IO/IO.entitlements">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>aps-environment</key>
	<string>development</string>
	<key>com.apple.developer.associated-domains</key>
	<array>
		<string>applinks:continua.io.pagopa.it</string>
		<string>applinks:continua.ioapp.it</string>
		<string>applinks:cittadini.uat.notifichedigitali.it</string>
		<string>applinks:cittadini.notifichedigitali.it</string>
	</array>
	<key>com.apple.developer.nfc.hce</key>
	<true/>
	<key>com.apple.developer.nfc.hce.iso7816.select-identifier-prefixes</key>
	<array>
		<string>A0000002480400</string>
		<string>D2760000850101</string>
	</array>
	<key>com.apple.developer.nfc.readersession.formats</key>
	<array>
		<string>TAG</string>
	</array>
</dict>
</plist>
</file>

<file path="apps/main-app/ios/IO/LaunchScreen.storyboard">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
    <device id="retina4_7" orientation="portrait" appearance="light"/>
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <scenes>
        <!--View Controller-->
        <scene sceneID="EHf-IW-A2E">
            <objects>
                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
                    <layoutGuides>
                        <viewControllerLayoutGuide type="top" id="Dji-FG-dfn"/>
                        <viewControllerLayoutGuide type="bottom" id="BW8-EI-1Nz"/>
                    </layoutGuides>
                    <view key="view" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Ze5-6b-2t3">
                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                        <subviews>
                            <stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" spacing="32" translatesAutoresizingMaskIntoConstraints="NO" id="aL7-ys-jhQ">
                                <rect key="frame" x="28.5" y="571" width="318" height="48"/>
                                <subviews>
                                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="logo_pagopa" translatesAutoresizingMaskIntoConstraints="NO" id="ur6-nk-fTh" userLabel="PagoPa logo">
                                        <rect key="frame" x="0.0" y="0.0" width="101" height="48"/>
                                    </imageView>
                                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="logo_consiglio_ministri" translatesAutoresizingMaskIntoConstraints="NO" id="Tei-FP-Id0">
                                        <rect key="frame" x="133" y="0.0" width="43" height="48"/>
                                    </imageView>
                                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="euNextLogo" translatesAutoresizingMaskIntoConstraints="NO" id="BYK-0Z-U9E">
                                        <rect key="frame" x="208" y="0.0" width="110" height="48"/>
                                    </imageView>
                                </subviews>
                            </stackView>
                            <stackView opaque="NO" contentMode="center" preservesSuperviewLayoutMargins="YES" axis="vertical" distribution="equalSpacing" alignment="center" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="HOS-XJ-5yj">
                                <rect key="frame" x="97" y="237.5" width="181.5" height="92.5"/>
                                <subviews>
                                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="logo_io" translatesAutoresizingMaskIntoConstraints="NO" id="pdm-K5-7Ya">
                                        <rect key="frame" x="58.5" y="0.0" width="64" height="52"/>
                                    </imageView>
                                    <label opaque="NO" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JZQ-jS-lo4">
                                        <rect key="frame" x="0.0" y="72" width="181.5" height="20.5"/>
                                        <attributedString key="attributedText">
                                            <fragment content="l’app dei servizi pubblici">
                                                <attributes>
                                                    <color key="NSColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                    <font key="NSFont" metaFont="system" size="17"/>
                                                    <paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural" tighteningFactorForTruncation="0.0"/>
                                                </attributes>
                                            </fragment>
                                        </attributedString>
                                        <nil key="highlightedColor"/>
                                    </label>
                                </subviews>
                            </stackView>
                        </subviews>
                        <color key="backgroundColor" red="0.109803915" green="0.23921570180000001" blue="0.85490196939999996" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
                        <constraints>
                            <constraint firstAttribute="bottomMargin" secondItem="aL7-ys-jhQ" secondAttribute="bottom" constant="48" id="1g8-n7-WYZ"/>
                            <constraint firstItem="HOS-XJ-5yj" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="9ZI-w2-W7r"/>
                            <constraint firstItem="HOS-XJ-5yj" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" constant="-50" id="iLY-zI-7Jw"/>
                            <constraint firstItem="aL7-ys-jhQ" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="nr1-zv-P1U"/>
                        </constraints>
                    </view>
                </viewController>
                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
            </objects>
            <point key="canvasLocation" x="52" y="374.66266866566718"/>
        </scene>
    </scenes>
    <resources>
        <image name="euNextLogo" width="110" height="26"/>
        <image name="logo_consiglio_ministri" width="43" height="48"/>
        <image name="logo_io" width="64" height="52"/>
        <image name="logo_pagopa" width="101" height="28"/>
    </resources>
</document>
</file>

<file path="apps/main-app/ios/IO.xcodeproj/xcshareddata/xcschemes/IO-tvOS.xcscheme">
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
   LastUpgradeVersion = "1160"
   version = "1.3">
   <BuildAction
      parallelizeBuildables = "NO"
      buildImplicitDependencies = "YES">
      <BuildActionEntries>
         <BuildActionEntry
            buildForTesting = "YES"
            buildForRunning = "YES"
            buildForProfiling = "YES"
            buildForArchiving = "YES"
            buildForAnalyzing = "YES">
            <BuildableReference
               BuildableIdentifier = "primary"
               BlueprintIdentifier = "2D2A28121D9B038B00D4039D"
               BuildableName = "libReact.a"
               BlueprintName = "React-tvOS"
               ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
            </BuildableReference>
         </BuildActionEntry>
         <BuildActionEntry
            buildForTesting = "YES"
            buildForRunning = "YES"
            buildForProfiling = "YES"
            buildForArchiving = "YES"
            buildForAnalyzing = "YES">
            <BuildableReference
               BuildableIdentifier = "primary"
               BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
               BuildableName = "IO-tvOS.app"
               BlueprintName = "IO-tvOS"
               ReferencedContainer = "container:IO.xcodeproj">
            </BuildableReference>
         </BuildActionEntry>
         <BuildActionEntry
            buildForTesting = "YES"
            buildForRunning = "YES"
            buildForProfiling = "NO"
            buildForArchiving = "NO"
            buildForAnalyzing = "YES">
            <BuildableReference
               BuildableIdentifier = "primary"
               BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
               BuildableName = "IO-tvOSTests.xctest"
               BlueprintName = "IO-tvOSTests"
               ReferencedContainer = "container:IO.xcodeproj">
            </BuildableReference>
         </BuildActionEntry>
      </BuildActionEntries>
   </BuildAction>
   <TestAction
      buildConfiguration = "Debug"
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      shouldUseLaunchSchemeArgsEnv = "YES">
      <MacroExpansion>
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
            BuildableName = "IO-tvOS.app"
            BlueprintName = "IO-tvOS"
            ReferencedContainer = "container:IO.xcodeproj">
         </BuildableReference>
      </MacroExpansion>
      <Testables>
         <TestableReference
            skipped = "NO">
            <BuildableReference
               BuildableIdentifier = "primary"
               BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
               BuildableName = "IO-tvOSTests.xctest"
               BlueprintName = "IO-tvOSTests"
               ReferencedContainer = "container:IO.xcodeproj">
            </BuildableReference>
         </TestableReference>
      </Testables>
   </TestAction>
   <LaunchAction
      buildConfiguration = "Debug"
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      launchStyle = "0"
      useCustomWorkingDirectory = "NO"
      ignoresPersistentStateOnLaunch = "NO"
      debugDocumentVersioning = "YES"
      debugServiceExtension = "internal"
      allowLocationSimulation = "YES">
      <BuildableProductRunnable
         runnableDebuggingMode = "0">
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
            BuildableName = "IO-tvOS.app"
            BlueprintName = "IO-tvOS"
            ReferencedContainer = "container:IO.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
   </LaunchAction>
... (26 lines truncated)
</file>

<file path="apps/main-app/ios/IO.xcodeproj/xcshareddata/xcschemes/IO.xcscheme">
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
   LastUpgradeVersion = "1160"
   version = "1.3">
   <BuildAction
      parallelizeBuildables = "NO"
      buildImplicitDependencies = "YES">
      <BuildActionEntries>
         <BuildActionEntry
            buildForTesting = "YES"
            buildForRunning = "YES"
            buildForProfiling = "YES"
            buildForArchiving = "YES"
            buildForAnalyzing = "YES">
            <BuildableReference
               BuildableIdentifier = "primary"
               BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
               BuildableName = "libReact.a"
               BlueprintName = "React"
               ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
            </BuildableReference>
         </BuildActionEntry>
         <BuildActionEntry
            buildForTesting = "YES"
            buildForRunning = "YES"
            buildForProfiling = "YES"
            buildForArchiving = "YES"
            buildForAnalyzing = "YES">
            <BuildableReference
               BuildableIdentifier = "primary"
               BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
               BuildableName = "IO.app"
               BlueprintName = "IO"
               ReferencedContainer = "container:IO.xcodeproj">
            </BuildableReference>
         </BuildActionEntry>
      </BuildActionEntries>
   </BuildAction>
   <TestAction
      buildConfiguration = "Debug"
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      shouldUseLaunchSchemeArgsEnv = "YES">
      <MacroExpansion>
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
            BuildableName = "IO.app"
            BlueprintName = "IO"
            ReferencedContainer = "container:IO.xcodeproj">
         </BuildableReference>
      </MacroExpansion>
      <Testables>
      </Testables>
   </TestAction>
   <LaunchAction
      buildConfiguration = "Debug"
      selectedDebuggerIdentifier = ""
      selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
      launchStyle = "0"
      useCustomWorkingDirectory = "NO"
      ignoresPersistentStateOnLaunch = "NO"
      debugDocumentVersioning = "YES"
      debugServiceExtension = "internal"
      allowLocationSimulation = "YES">
      <BuildableProductRunnable
         runnableDebuggingMode = "0">
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
            BuildableName = "IO.app"
            BlueprintName = "IO"
            ReferencedContainer = "container:IO.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
   </LaunchAction>
   <ProfileAction
      buildConfiguration = "Release"
      shouldUseLaunchSchemeArgsEnv = "YES"
      savedToolIdentifier = ""
      useCustomWorkingDirectory = "NO"
      debugDocumentVersioning = "YES">
      <BuildableProductRunnable
         runnableDebuggingMode = "0">
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
            BuildableName = "IO.app"
            BlueprintName = "IO"
            ReferencedContainer = "container:IO.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
   </ProfileAction>
   <AnalyzeAction
      buildConfiguration = "Debug">
   </AnalyzeAction>
   <ArchiveAction
      buildConfiguration = "Release"
      revealArchiveInOrganizer = "YES">
   </ArchiveAction>
... (2 lines truncated)
</file>

<file path="apps/main-app/ios/IO.xcodeproj/project.pbxproj">
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 54;
	objects = {

/* Begin PBXBuildFile section */
		1024B7E387E34295AFBA19B6 /* TitilliumSansPro-LightItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3CA5B0F4CFD44E78900FE43A /* TitilliumSansPro-LightItalic.otf */; };
		133638FA213D788900B0C079 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 133638FC213D788900B0C079 /* InfoPlist.strings */; };
		13F005FA91AA4EF5BAD12096 /* Titillio-Black.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9205B2AD16D94BDAA69E880E /* Titillio-Black.otf */; };
		16471906574A44719FD557C5 /* TitilliumSansPro-BoldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 872A6A79E0CF4C4DA0AEAF3E /* TitilliumSansPro-BoldItalic.otf */; };
		194A5D2B1F027F5A0078620E /* Podfile in Resources */ = {isa = PBXBuildFile; fileRef = 194A5D2A1F027F5A0078620E /* Podfile */; };
		1CB9A62CD91A4933BB5021C6 /* Titillio-ThinItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3E5721DADB56490699700FBF /* Titillio-ThinItalic.otf */; };
		2A46841EACB44850AD32CBA1 /* Titillio-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 6B0E3E090B0347B6BD0A41A2 /* Titillio-Semibold.otf */; };
		2AD40B9924CB049500E4124A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2AD40B9824CB049500E4124A /* LaunchScreen.storyboard */; };
		45678F6126F1401FB03B1B02 /* TitilliumSansPro-ThinItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = F820513E31C7443CB7F5A99E /* TitilliumSansPro-ThinItalic.otf */; };
		58585030D26943298D52B5A5 /* Titillio-LightItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 7206342A24764B138D864DFF /* Titillio-LightItalic.otf */; };
		65FE1313CE69411888425831 /* Titillio-ExtrablackItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 96C2E93186814D36AD451D83 /* Titillio-ExtrablackItalic.otf */; };
		68CE798678EF43669BE56D51 /* Titillio-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = B58BBAC865EA4651B828C92B /* Titillio-Bold.otf */; };
		697EE758195E4C198755B4EE /* Titillio-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = C9E629838F224B4F9823D692 /* Titillio-Thin.otf */; };
		72B66C3DDD7D46A08B942038 /* Titillio-BoldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 4F54E8E3A56A4E139D5DC82D /* Titillio-BoldItalic.otf */; };
		73C78AB456BA498FA470EE9E /* FiraCode-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F9BF48C6EC30493DBDB754CA /* FiraCode-Medium.ttf */; };
		76D9756A42724A6C9E607D7F /* Titillio-RegularItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 18809C19D0B945658C774D0D /* Titillio-RegularItalic.otf */; };
		7C18455047A64AC0A9DD442A /* TitilliumSansPro-BlackItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 132CADD7BDBB46C7AB1DC348 /* TitilliumSansPro-BlackItalic.otf */; };
		8D51BCD77547410BBC7E6050 /* TitilliumSansPro-Italic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 148E8F80A1D5448DAD5263B7 /* TitilliumSansPro-Italic.otf */; };
		8DCB405D579147AAB059BEE6 /* Titillio-BlackItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = E8C4B91357FA47018EE5ACF0 /* Titillio-BlackItalic.otf */; };
		A5C4E8CE93074865A66DFAC1 /* TitilliumSansPro-SemiboldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 015E4FBE7D1D4C2485C73321 /* TitilliumSansPro-SemiboldItalic.otf */; };
		B551AC412DA55A0E00A4E30F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B551AC402DA55A0E00A4E30F /* AppDelegate.swift */; };
		B572E1E42DC12161009BA244 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
		B7B71EAAE496484488FE3751 /* Titillio-Extrabold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 59423B676D254801BFAA4C5E /* Titillio-Extrabold.otf */; };
		B851B29045D067562CDFD92D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34D8E6D4B7FD8B878BBDC56E /* ExpoModulesProvider.swift */; };
		D2245B924B42442CAF4944D5 /* Titillio-SemiboldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = D688263BB87C4DFBA007CD92 /* Titillio-SemiboldItalic.otf */; };
		D3577FD00169492CB2980CE3 /* Titillio-Extrablack.otf in Resources */ = {isa = PBXBuildFile; fileRef = 71A3E9FDB4AD4D74AB491DA4 /* Titillio-Extrablack.otf */; };
		EC056373020AA03F7D8532D9 /* libPods-IO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22DB90684FEFB1CA71467FD6 /* libPods-IO.a */; };
		EE925F079133484AB8E0D5D8 /* Titillio-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = 710E428774CA4C718ED747ED /* Titillio-Light.otf */; };
		F0625E7F2326825600EDEF90 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; };
		F09FEB3C231818E3007071DB /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F09FEB0D231818E3007071DB /* Localizable.strings */; };
		F2B1630E2B753C9D00F6E487 /* TitilliumSansPro-Black.otf in Resources */ = {isa = PBXBuildFile; fileRef = F2B163022B753C9D00F6E487 /* TitilliumSansPro-Black.otf */; };
		F2B1630F2B753C9D00F6E487 /* TitilliumSansPro-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = F2B163032B753C9D00F6E487 /* TitilliumSansPro-Semibold.otf */; };
		F2B163132B753C9D00F6E487 /* TitilliumSansPro-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = F2B163072B753C9D00F6E487 /* TitilliumSansPro-Thin.otf */; };
		F2B163152B753C9D00F6E487 /* TitilliumSansPro-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = F2B163092B753C9D00F6E487 /* TitilliumSansPro-Light.otf */; };
		F2B163162B753C9D00F6E487 /* TitilliumSansPro-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = F2B1630A2B753C9D00F6E487 /* TitilliumSansPro-Regular.otf */; };
		F2B163182B753C9D00F6E487 /* TitilliumSansPro-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = F2B1630C2B753C9D00F6E487 /* TitilliumSansPro-Bold.otf */; };
		F6095D192BC6E01F000EA253 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = F6095D182BC6E01F000EA253 /* PrivacyInfo.xcprivacy */; };
		FA71BB1E6520449EBC6545D5 /* Titillio-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = A245EDE7064D4143BF1857DB /* Titillio-Regular.otf */; };
		FFED86DEE24140A79B50B6A5 /* Titillio-ExtraboldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 094EE36E37734495BB363E62 /* Titillio-ExtraboldItalic.otf */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
		61CC933C2135818C00206602 /* Embed Frameworks */ = {
			isa = PBXCopyFilesBuildPhase;
			buildActionMask = 2147483647;
			dstPath = "";
			dstSubfolderSpec = 10;
			files = (
			);
			name = "Embed Frameworks";
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
		015E4FBE7D1D4C2485C73321 /* TitilliumSansPro-SemiboldItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "TitilliumSansPro-SemiboldItalic.otf"; path = "../assets/fonts/TitilliumSansPro/TitilliumSansPro-SemiboldItalic.otf"; sourceTree = "<group>"; };
		094EE36E37734495BB363E62 /* Titillio-ExtraboldItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-ExtraboldItalic.otf"; path = "../assets/fonts/Titillio/Titillio-ExtraboldItalic.otf"; sourceTree = "<group>"; };
		132CADD7BDBB46C7AB1DC348 /* TitilliumSansPro-BlackItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "TitilliumSansPro-BlackItalic.otf"; path = "../assets/fonts/TitilliumSansPro/TitilliumSansPro-BlackItalic.otf"; sourceTree = "<group>"; };
		133638FB213D788900B0C079 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
		133638FD213D78DB00B0C079 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = "<group>"; };
		13B07F961A680F5B00A75B9A /* IO.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IO.app; sourceTree = BUILT_PRODUCTS_DIR; };
		13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = IO/Images.xcassets; sourceTree = "<group>"; };
		13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = IO/Info.plist; sourceTree = "<group>"; };
		148E8F80A1D5448DAD5263B7 /* TitilliumSansPro-Italic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "TitilliumSansPro-Italic.otf"; path = "../assets/fonts/TitilliumSansPro/TitilliumSansPro-Italic.otf"; sourceTree = "<group>"; };
		18809C19D0B945658C774D0D /* Titillio-RegularItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-RegularItalic.otf"; path = "../assets/fonts/Titillio/Titillio-RegularItalic.otf"; sourceTree = "<group>"; };
		194A5D2A1F027F5A0078620E /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
		22DB90684FEFB1CA71467FD6 /* libPods-IO.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-IO.a"; sourceTree = BUILT_PRODUCTS_DIR; };
		2AD40B9824CB049500E4124A /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = IO/LaunchScreen.storyboard; sourceTree = "<group>"; };
		2AFAC65324C9B7C300E85199 /* IO-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "IO-Bridging-Header.h"; sourceTree = "<group>"; };
		34D8E6D4B7FD8B878BBDC56E /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-IO/ExpoModulesProvider.swift"; sourceTree = "<group>"; };
		3CA5B0F4CFD44E78900FE43A /* TitilliumSansPro-LightItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "TitilliumSansPro-LightItalic.otf"; path = "../assets/fonts/TitilliumSansPro/TitilliumSansPro-LightItalic.otf"; sourceTree = "<group>"; };
		3E5721DADB56490699700FBF /* Titillio-ThinItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-ThinItalic.otf"; path = "../assets/fonts/Titillio/Titillio-ThinItalic.otf"; sourceTree = "<group>"; };
		4F54E8E3A56A4E139D5DC82D /* Titillio-BoldItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-BoldItalic.otf"; path = "../assets/fonts/Titillio/Titillio-BoldItalic.otf"; sourceTree = "<group>"; };
		59423B676D254801BFAA4C5E /* Titillio-Extrabold.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-Extrabold.otf"; path = "../assets/fonts/Titillio/Titillio-Extrabold.otf"; sourceTree = "<group>"; };
		63C062964A43B2B6E44AA4D0 /* Pods-IO.canary.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IO.canary.xcconfig"; path = "Target Support Files/Pods-IO/Pods-IO.canary.xcconfig"; sourceTree = "<group>"; };
		6B0E3E090B0347B6BD0A41A2 /* Titillio-Semibold.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-Semibold.otf"; path = "../assets/fonts/Titillio/Titillio-Semibold.otf"; sourceTree = "<group>"; };
		710E428774CA4C718ED747ED /* Titillio-Light.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-Light.otf"; path = "../assets/fonts/Titillio/Titillio-Light.otf"; sourceTree = "<group>"; };
		71A3E9FDB4AD4D74AB491DA4 /* Titillio-Extrablack.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-Extrablack.otf"; path = "../assets/fonts/Titillio/Titillio-Extrablack.otf"; sourceTree = "<group>"; };
		7206342A24764B138D864DFF /* Titillio-LightItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-LightItalic.otf"; path = "../assets/fonts/Titillio/Titillio-LightItalic.otf"; sourceTree = "<group>"; };
		7A83F0572152B12C000C6389 /* IO.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = IO.entitlements; path = IO/IO.entitlements; sourceTree = "<group>"; };
		7A83F0582152B12C000C6390 /* IO-Canary.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = "IO-Canary.entitlements"; path = "IO/IO-Canary.entitlements"; sourceTree = "<group>"; };
		872A6A79E0CF4C4DA0AEAF3E /* TitilliumSansPro-BoldItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "TitilliumSansPro-BoldItalic.otf"; path = "../assets/fonts/TitilliumSansPro/TitilliumSansPro-BoldItalic.otf"; sourceTree = "<group>"; };
		9205B2AD16D94BDAA69E880E /* Titillio-Black.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-Black.otf"; path = "../assets/fonts/Titillio/Titillio-Black.otf"; sourceTree = "<group>"; };
		96C2E93186814D36AD451D83 /* Titillio-ExtrablackItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-ExtrablackItalic.otf"; path = "../assets/fonts/Titillio/Titillio-ExtrablackItalic.otf"; sourceTree = "<group>"; };
		A245EDE7064D4143BF1857DB /* Titillio-Regular.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-Regular.otf"; path = "../assets/fonts/Titillio/Titillio-Regular.otf"; sourceTree = "<group>"; };
		B242A588B065130DE65386E4 /* Pods-IO.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-IO.debug.xcconfig"; path = "Target Support Files/Pods-IO/Pods-IO.debug.xcconfig"; sourceTree = "<group>"; };
		B551AC402DA55A0E00A4E30F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
		B57593872B70FFA400674515 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = "<group>"; };
		B57593882B70FFA400674515 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = IO/de.lproj/Localizable.strings; sourceTree = "<group>"; };
		B58BBAC865EA4651B828C92B /* Titillio-Bold.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-Bold.otf"; path = "../assets/fonts/Titillio/Titillio-Bold.otf"; sourceTree = "<group>"; };
		C9E629838F224B4F9823D692 /* Titillio-Thin.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Titillio-Thin.otf"; path = "../assets/fonts/Titillio/Titillio-Thin.otf"; sourceTree = "<group>"; };
... (854 lines truncated)
</file>

<file path="apps/main-app/ios/IO.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>IDEDidComputeMac32BitWarning</key>
	<true/>
</dict>
</plist>
</file>

<file path="apps/main-app/ios/IO.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>BuildSystemType</key>
	<string>Latest</string>
	<key>PreviewsEnabled</key>
	<false/>
</dict>
</plist>
</file>

<file path="apps/main-app/ios/IO.xcworkspace/contents.xcworkspacedata">
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
   version = "1.0">
   <FileRef
      location = "group:IO.xcodeproj">
   </FileRef>
   <FileRef
      location = "group:Pods/Pods.xcodeproj">
   </FileRef>
</Workspace>
</file>

<file path="apps/main-app/ios/.xcode.env">
# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.
# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)
</file>

<file path="apps/main-app/ios/AppDelegate.swift">
class AppDelegate: ExpoAppDelegate {
var window: UIWindow?
⋮----
var reactNativeDelegate: ReactNativeDelegate?
var reactNativeFactory: RCTReactNativeFactory?
⋮----
override func application(
⋮----
let delegate = ReactNativeDelegate()
let factory = ExpoReactNativeFactory(delegate: delegate)
⋮----
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
⋮----
override func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
⋮----
class ReactNativeDelegate: ExpoReactNativeFactoryDelegate {
override func sourceURL(for bridge: RCTBridge) -> URL? {
⋮----
override func bundleURL() -> URL? {
⋮----
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
⋮----
func scene(
⋮----
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
</file>

<file path="apps/main-app/ios/IO-Bridging-Header.h">

</file>

<file path="apps/main-app/ios/Podfile">
ENV['RCT_NEW_ARCH_ENABLED'] = '1'

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")

def node_require(script)
  # Resolve script with node to allow for hoisting
  require Pod::Executable.execute_command('node', ['-p',
    "require.resolve(
      '#{script}',
      {paths: [process.argv[1]]},
    )", __dir__]).strip
end

# Use it to require both react-native's and this package's scripts:
node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')

min_ios_versions_supported = ['14.0', min_ios_version_supported]  
index_of_max = min_ios_versions_supported.each_with_index.max_by { |number, _| number.to_f }[1]

platform :ios, min_ios_versions_supported[index_of_max] 

prepare_react_native_project!
 
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

# Required by react-native-permissions
# https://github.com/zoontek/react-native-permissions?tab=readme-ov-file#ios
setup_permissions([
  'PhotoLibrary', # Required for Gallery read permission
  'Bluetooth' # Required for proximity-based presentation (BLE)
])

production = ENV["PRODUCTION"] == "1"
# This env is used to check whether
# we are in a CI environment or not.
IS_CI = ENV['CI']

target 'IO' do
  use_expo_modules!
 
  if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'
    config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
  else
    config_command = [
      'node',
      '--no-warnings',
      '--eval',
      'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
      'react-native-config',
      '--json',
      '--platform',
      'ios'
    ]
  end
 
  config = use_native_modules!(config_command)

  use_react_native!(
    :path => config[:reactNativePath],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  post_install do |installer|
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
      # :ccache_enabled => true
    )

    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |build_configuration|
        build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = min_ios_versions_supported[index_of_max]
      end
    end
  end
  # TODO: Remove when https://github.com/expo/expo/issues/44229 gets resolved.
  # Workaround for fmt compilation error with Xcode 26 / newer Apple Clang
  post_integrate do |installer|
    fmt_base_h = File.join(installer.sandbox.root, 'fmt', 'include', 'fmt', 'base.h')
    if File.exist?(fmt_base_h)
      content = File.read(fmt_base_h)
      workaround = "#elif defined(__apple_build_version__)\n#  define FMT_USE_CONSTEVAL 0  // consteval is broken in newer Apple clang too\n"
      patched = content.include?(workaround) ? content : content.sub(
        '#elif defined(__cpp_consteval)',
        "#{workaround}#elif defined(__cpp_consteval)"
      )
      if patched != content
        File.chmod(0644, fmt_base_h)
        File.write(fmt_base_h, patched)
      end
    end
  end
end
... (1 lines truncated)
</file>

<file path="apps/main-app/ios/README.md">
# iOS How-To

## Configure push notifications

### Generate certificates for APM

We use [fastlane pem](https://docs.fastlane.tools/actions/pem/) to generate the
certificates:

For development:

```
$ fastlane pem --development -p "PASSWORD"
```

For production:

```
$ fastlane pem -p "PASSWORD"
```

Where `PASSWORD` is the password for the certificate.

### Configure Notification Hub

Got to the Azure Notification Hub config dashboard and upload the new
certificate.
</file>

<file path="apps/main-app/jest/TimezoneEnvironment.js">
class TimezoneEnvironment extends NodeEnvironment
⋮----
async teardown()
</file>

<file path="apps/main-app/ts/__mocks__/@gorhom/bottom-sheet.ts">
import { Component, PropsWithChildren } from "react";
⋮----
const NOOP = () =>
⋮----
const BottomSheetModalProvider = (
⋮----
const BottomSheetComponent = (props: PropsWithChildren)
⋮----
class BottomSheet extends Component<PropsWithChildren>
⋮----
close()
collapse()
expand()
forceClose()
render()
snapToIndex()
⋮----
snapToPosition()
⋮----
class BottomSheetModal extends Component<PropsWithChildren>
⋮----
dismiss()
⋮----
present()
⋮----
const useBottomSheet = () => (
⋮----
const useBottomSheetModal = () => (
⋮----
const useBottomSheetAnimationConfigs = (configs: unknown)
⋮----
get(target: Record<string, unknown>, prop: string)
⋮----
const useBottomSheetInternal = ()
⋮----
const useBottomSheetModalInternal = ()
⋮----
const useBottomSheetDynamicSnapPoints = () => (
</file>

<file path="apps/main-app/ts/__mocks__/expo-file-system.js">
class FileSystemFile
⋮----
validatePath()
textSync()
base64Sync()
bytesSync()
open()
info()
write()
delete()
create()
copy()
move()
rename()
async text()
async base64()
async bytes()
⋮----
class FileSystemDirectory
⋮----
listAsRecords()
createFile()
createDirectory()
</file>

<file path="apps/main-app/ts/__mocks__/initializedProfile.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
import { Version } from "@io-app/api-types/generated/definitions/identity/Version";
import { EmailString, FiscalCode } from "@pagopa/ts-commons/lib/strings";
</file>

<file path="apps/main-app/ts/__mocks__/io-react-native-zendesk.ts">

</file>

<file path="apps/main-app/ts/__mocks__/react-native-background-timer.ts">

</file>

<file path="apps/main-app/ts/__mocks__/react-native-config.ts">

</file>

<file path="apps/main-app/ts/__mocks__/react-native-device-info.ts">

</file>

<file path="apps/main-app/ts/__mocks__/react-native-fingerprint-scanner.ts">

</file>

<file path="apps/main-app/ts/__mocks__/react-native-fs.ts">

</file>

<file path="apps/main-app/ts/__mocks__/react-native-keychain.ts">
export type KeychainDB = {
  [key: string]: {
    password: string;
    service: string;
    username: string;
  };
};
⋮----
type Options = {
  service: string;
};
</file>

<file path="apps/main-app/ts/__mocks__/svgMock.js">

</file>

<file path="apps/main-app/ts/@types/i18next.d.ts">
import type it from "../../locales/it/index.json";
⋮----
import { type TranslationKeys } from "../i18n";
⋮----
interface CustomTypeOptions {
    defaultNS: "index";
    resources: {
      index: typeof it;
    };
    returnEmptyString: false;
    returnNull: false;
  }
⋮----
interface TFunction {
    (key: Array<TranslationKeys> | TranslationKeys, options?: any): string;
  }
</file>

<file path="apps/main-app/ts/@types/json-imports.d.ts">

</file>

<file path="apps/main-app/ts/@types/react-native-barcode-builder.d.ts">
export interface BarcodeProps {
    background?: string;
    format?: barcodeTypes;
    height?: number;
    lineColor?: string;
    onError?: () => void;
    text?: string;
    value: string;
    width?: number;
  }
⋮----
type barcodeTypes = "CODE39" | "CODE128" | "CODE128A" | "CODE128B";
⋮----
export default class Barcode extends React.PureComponent<BarcodeProps>
⋮----
constructor(props);
</file>

<file path="apps/main-app/ts/@types/react-native-open-maps.d.ts">

</file>

<file path="apps/main-app/ts/api/__mocks__/CommunicationClientManager.ts">
import { CommunicationClient } from "../CommunicationClientManager";
</file>

<file path="apps/main-app/ts/api/__mocks__/IdentityClientManager.ts">
import { IdentityClient } from "../IdentityClientManager";
</file>

<file path="apps/main-app/ts/api/__mocks__/ServicesClientManager.ts">
import { ServicesClient } from "../ServicesClientManager";
</file>

<file path="apps/main-app/ts/api/__mocks__/SessionManagerClientManager.ts">
import { SessionManagerClient } from "../SessionManagerClientManager";
</file>

<file path="apps/main-app/ts/api/ApiClientManager.ts">
import { Nullable } from "@io-app/design-system";
import _ from "lodash";
⋮----
export type BaseClientOptions = { readonly token: string };
⋮----
export abstract class ApiClientManager<TClient, TOptions>
⋮----
getClient(baseUrl: string, clientOptions: TOptions): TClient
⋮----
protected abstract createClient(
    baseUrl: string,
    clientOptions: TOptions
  ): TClient;
⋮----
protected isCacheValid(clientOptions: TOptions): boolean
</file>

<file path="apps/main-app/ts/api/backendPublic.ts">
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { AccessToken } from "@io-app/api-types/generated/definitions/session_manager/AccessToken";
import { PasswordLogin } from "@io-app/api-types/generated/definitions/session_manager/PasswordLogin";
import { PublicKey } from "@pagopa/io-react-native-crypto";
import {
  ApiHeaderJson,
  basicResponseDecoder,
  BasicResponseType,
  createFetchRequestForApi,
  IGetApiRequestType,
  IPostApiRequestType
} from "@pagopa/ts-commons/lib/requests";
⋮----
import { getLoginHeaders } from "../features/authentication/common/utils";
import { defaultRetryingFetch } from "../utils/fetch";
⋮----
type GetStatusT = IGetApiRequestType<
  Record<string, unknown>,
  never,
  never,
  BasicResponseType<BackendStatus>
>;
⋮----
type PostTestLoginT = IPostApiRequestType<
  PasswordLogin,
  "Content-Type",
  never,
  BasicResponseType<AccessToken>
>;
⋮----
export function BackendPublicClient(
  baseUrl: string,
  fetchApi: typeof fetch = defaultRetryingFetch()
)
⋮----
const getPostLoginTestT = (
    publicKey?: PublicKey,
    hashAlgorithm?: string,
    isFastLogin?: boolean,
    idpId?: string
): PostTestLoginT => (
⋮----
export function CdnBackendStatusClient(
  baseUrl: string,
  fetchApi: typeof fetch = defaultRetryingFetch()
)
</file>

<file path="apps/main-app/ts/api/CommunicationClientManager.ts">
import {
  Client,
  createClient
} from "@io-app/api-types/generated/definitions/communication/client";
import { v4 as uuid } from "uuid";
⋮----
import { KeyInfo } from "../features/lollipop/utils/crypto";
import { lollipopFetch } from "../features/lollipop/utils/fetch";
import { isTestEnv } from "../utils/environment";
import { ApiClientManager, BaseClientOptions } from "./ApiClientManager";
⋮----
export type CommunicationClient = Client<"Bearer">;
type CommunicationClientOptions = BaseClientOptions & {
  keyInfo: KeyInfo;
};
⋮----
class CommunicationClientManager extends ApiClientManager<
⋮----
protected createClient(
    baseUrl: string,
    { token, keyInfo }: CommunicationClientOptions
): CommunicationClient
</file>

<file path="apps/main-app/ts/api/content.ts">
import { BonusesAvailable } from "@io-app/api-types/generated/definitions/content/BonusesAvailable";
import { ContextualHelp } from "@io-app/api-types/generated/definitions/content/ContextualHelp";
import { Municipality as MunicipalityMedadata } from "@io-app/api-types/generated/definitions/content/Municipality";
import { SpidIdps } from "@io-app/api-types/generated/definitions/content/SpidIdps";
import { VersionInfo } from "@io-app/api-types/generated/definitions/content/VersionInfo";
import { Zendesk } from "@io-app/api-types/generated/definitions/content/Zendesk";
import { ZendeskSubcategoriesErrors } from "@io-app/api-types/generated/definitions/content/ZendeskSubcategoriesErrors";
import { CoBadgeServices } from "@io-app/api-types/generated/definitions/pagopa/cobadge/configuration/CoBadgeServices";
import { AbiListResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv2/AbiListResponse";
⋮----
import {
  basicResponseDecoder,
  BasicResponseType,
  createFetchRequestForApi,
  IGetApiRequestType
} from "@pagopa/ts-commons/lib/requests";
⋮----
import { contentRepoUrl } from "../config";
import { CodiceCatastale } from "../types/MunicipalityCodiceCatastale";
import { defaultRetryingFetch } from "../utils/fetch";
⋮----
type GetMunicipalityT = IGetApiRequestType<
  {
    codiceCatastale: CodiceCatastale;
  },
  never,
  never,
  BasicResponseType<MunicipalityMedadata>
>;
⋮----
type GetContextualHelpT = IGetApiRequestType<
  void,
  never,
  never,
  BasicResponseType<ContextualHelp>
>;
⋮----
type GetBonusListT = IGetApiRequestType<
  Record<string, unknown>,
  never,
  never,
  BasicResponseType<BonusesAvailable>
>;
⋮----
type GetAbisListT = IGetApiRequestType<
  void,
  never,
  never,
  BasicResponseType<AbiListResponse>
>;
⋮----
type GetCoBadgeServicesT = IGetApiRequestType<
  void,
  never,
  never,
  BasicResponseType<CoBadgeServices>
>;
⋮----
type GetVersionInfoT = IGetApiRequestType<
  void,
  never,
  never,
  BasicResponseType<VersionInfo>
>;
⋮----
type GetIdpsListT = IGetApiRequestType<
  void,
  never,
  never,
  BasicResponseType<SpidIdps>
>;
⋮----
type GetZendeskConfigT = IGetApiRequestType<
  void,
  never,
  never,
  BasicResponseType<Zendesk>
>;
⋮----
type GetZendeskPaymentConfigT = IGetApiRequestType<
  void,
  never,
  never,
  BasicResponseType<ZendeskSubcategoriesErrors>
>;
⋮----
export function ContentClient(fetchApi: typeof fetch = defaultRetryingFetch())
</file>

<file path="apps/main-app/ts/api/IdentityClientManager.ts">
import {
  Client,
  createClient
} from "@io-app/api-types/generated/definitions/identity/client";
import { v4 as uuid } from "uuid";
⋮----
import { KeyInfo } from "../features/lollipop/utils/crypto";
import { lollipopFetch } from "../features/lollipop/utils/fetch";
import { isTestEnv } from "../utils/environment";
import { ApiClientManager, BaseClientOptions } from "./ApiClientManager";
⋮----
export type IdentityClient = Client<"Bearer">;
⋮----
type IdentityClientOptions = BaseClientOptions & {
  keyInfo: KeyInfo;
  signBody?: boolean;
};
⋮----
class IdentityClientManager extends ApiClientManager<
⋮----
protected createClient(
    baseUrl: string,
    { token, keyInfo, signBody = false }: IdentityClientOptions
): IdentityClient
</file>

<file path="apps/main-app/ts/api/pagopa.ts">
import {
  addWalletCreditCardUsingPOSTDecoder,
  AddWalletCreditCardUsingPOSTT,
  changePayOptionDecoder,
  checkPaymentUsingGETDefaultDecoder,
  CheckPaymentUsingGETT,
  DeleteBySessionCookieExpiredUsingDELETET,
  deleteWalletsByServiceUsingDELETEDecoder,
  DeleteWalletUsingDELETET,
  favouriteWalletUsingPOSTDecoder,
  FavouriteWalletUsingPOSTT,
  GetAllPspsUsingGETT,
  getPaypalPspsUsingGETDefaultDecoder,
  GetPaypalPspsUsingGETT,
  getPspListUsingGETDecoder,
  GetPspListUsingGETT,
  getPspListV2UsingGETDefaultDecoder,
  GetPspListV2UsingGETT,
  getPspUsingGETDecoder,
  GetPspUsingGETT,
  getTransactionsUsingGETDecoder,
  getTransactionUsingGETDecoder,
  GetTransactionUsingGETT,
  GetWalletsUsingGETT,
  startSessionUsingGETDecoder,
  StartSessionUsingGETT,
  updateWalletUsingPUTV2Decoder,
  UpdateWalletUsingPUTV2T
} from "@io-app/api-types/generated/definitions/pagopa/requestTypes";
import { WalletPaymentStatusRequest } from "@io-app/api-types/generated/definitions/pagopa/WalletPaymentStatusRequest";
import { BancomatCardsRequest } from "@io-app/api-types/generated/definitions/pagopa/walletv2/BancomatCardsRequest";
import { BPayRequest } from "@io-app/api-types/generated/definitions/pagopa/walletv2/BPayRequest";
import { CobadegPaymentInstrumentsRequest } from "@io-app/api-types/generated/definitions/pagopa/walletv2/CobadegPaymentInstrumentsRequest";
import {
  addWalletsBancomatCardUsingPOSTDecoder,
  addWalletsBPayUsingPOSTDecoder,
  addWalletsCobadgePaymentInstrumentAsCreditCardUsingPOSTDecoder,
  getAbiListUsingGETDefaultDecoder,
  GetAbiListUsingGETT,
  getBpayListUsingGETDefaultDecoder,
  GetBpayListUsingGETT,
  getCobadgeByRequestIdUsingGETDefaultDecoder,
  GetCobadgeByRequestIdUsingGETT,
  getCobadgesUsingGETDefaultDecoder,
  GetCobadgesUsingGETT,
  getPansUsingGETDefaultDecoder,
  GetPansUsingGETT,
  getWalletsV2UsingGETDecoder
} from "@io-app/api-types/generated/definitions/pagopa/walletv2/requestTypes";
⋮----
import {
  AddResponseType,
  ApiHeaderJson,
  composeHeaderProducers,
  composeResponseDecoders,
  constantResponseDecoder,
  createFetchRequestForApi,
  ioResponseDecoder,
  MapResponseType,
  ReplaceRequestParams,
  RequestHeaderProducer,
  RequestHeaders,
  TypeofApiParams
} from "@pagopa/ts-commons/lib/requests";
import { Omit } from "@pagopa/ts-commons/lib/types";
import { pipe } from "fp-ts/lib/function";
⋮----
import _ from "lodash";
⋮----
import {
  NullableWallet,
  PagoPAErrorResponse,
  PatchedDeleteWalletResponse,
  PatchedWalletV2ListResponse,
  PatchedWalletV2Response,
  PaymentManagerToken,
  PspListResponse,
  PspResponse,
  SessionResponse,
  TransactionListResponse,
  TransactionResponse,
  WalletListResponse,
  WalletResponse
} from "../types/pagopa";
import { format } from "../utils/dates";
import { getLocalePrimaryWithFallback } from "../utils/locale";
import { getLookUpId, pmLookupHeaderKey } from "../utils/pmLookUpId";
import { fixWalletPspTagsValues } from "../utils/wallet";
⋮----
type GetTransactionsUsingGETT = r.IGetApiRequestType<
  { readonly Bearer: string; readonly start: number },
  "Authorization",
  never,
  | r.IResponseType<200, TransactionListResponse>
  | r.IResponseType<401, undefined>
  | r.IResponseType<403, undefined>
  | r.IResponseType<404, undefined>
>;
⋮----
type GetTransactionsUsingGETTExtra = MapResponseType<
... (171 lines truncated)
</file>

<file path="apps/main-app/ts/api/ServicesClientManager.ts">
import {
  Client,
  createClient
} from "@io-app/api-types/generated/definitions/services/client";
⋮----
import { isTestEnv } from "../utils/environment";
import { defaultRetryingFetch } from "../utils/fetch";
import { ApiClientManager, BaseClientOptions } from "./ApiClientManager";
⋮----
export type ServicesClient = Client<"Bearer">;
⋮----
class ServicesClientManager extends ApiClientManager<
⋮----
protected createClient(
    baseUrl: string,
    { token }: BaseClientOptions
): ServicesClient
</file>

<file path="apps/main-app/ts/api/SessionManagerClientManager.ts">
import {
  Client,
  createClient
} from "@io-app/api-types/generated/definitions/session_manager/client";
⋮----
import { isTestEnv } from "../utils/environment";
import { defaultRetryingFetch } from "../utils/fetch";
import { ApiClientManager, BaseClientOptions } from "./ApiClientManager";
⋮----
export type SessionManagerClient = Client<"Bearer">;
⋮----
type SessionManagerClientOptions = BaseClientOptions;
⋮----
class SessionManagerClientManager extends ApiClientManager<
⋮----
protected createClient(
    baseUrl: string,
    { token }: SessionManagerClientOptions
): SessionManagerClient
</file>

<file path="apps/main-app/ts/boot/configureReactotron.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import ReactotronReactNative from "reactotron-react-native";
import { reactotronRedux } from "reactotron-redux";
⋮----
export const configureReactotron = () =>
</file>

<file path="apps/main-app/ts/boot/configureStoreAndPersistor.ts">
import { SpidIdps } from "@io-app/api-types/generated/definitions/content/SpidIdps";
⋮----
import AsyncStorage from "@react-native-async-storage/async-storage";
⋮----
import { get, merge, omit, set } from "lodash";
import {
  applyMiddleware,
  compose,
  createStore,
  Middleware,
  Reducer,
  StoreEnhancer
} from "redux";
import { createLogger } from "redux-logger";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  Persistor,
  persistReducer,
  persistStore
} from "redux-persist";
import createSagaMiddleware from "redux-saga";
⋮----
import {
  isReady,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../common/model/RemoteValue";
import { CURRENT_REDUX_LOLLIPOP_STORE_VERSION } from "../features/lollipop/store";
import {
  initialLollipopState,
  LollipopState
} from "../features/lollipop/store/reducers/lollipop";
import {
  NOTIFICATIONS_STORE_VERSION,
  NotificationsState
} from "../features/pushNotifications/store/reducers";
import { generateInitialState } from "../features/pushNotifications/store/reducers/installation";
import rootSaga from "../sagas";
import { Action, Store } from "../store/actions/types";
import { analytics } from "../store/middlewares";
import {
  authenticationPersistConfig,
  createRootReducer
} from "../store/reducers";
import { ContentState } from "../store/reducers/content";
import { entitiesPersistConfig } from "../store/reducers/entities";
import {
  INSTALLATION_INITIAL_STATE,
  InstallationState
} from "../store/reducers/installation";
import { PersistedPreferencesState } from "../store/reducers/persistedPreferences";
import { GlobalState, PersistedGlobalState } from "../store/reducers/types";
import { DateISO8601Transform } from "../store/transforms/dateISO8601Tranform";
import { PotTransform } from "../store/transforms/potTransform";
import { isDevEnv, isTestEnv } from "../utils/environment";
import { fromGeneratedToLocalSpidIdp } from "../utils/idps";
import { configureReactotron } from "./configureReactotron";
import { createReduxStartupGate } from "./reduxStartupGate";
⋮----
function configureStoreAndPersistor():
</file>

<file path="apps/main-app/ts/boot/reduxStartupGate.ts">
import { AppState, type NativeEventSubscription } from "react-native";
import { type Middleware } from "redux";
⋮----
export const createReduxStartupGate = () =>
⋮----
const middleware: Middleware = () => next => action =>
⋮----
const startWhenAppIsActive = (startPersistenceAndSagas: () => void) =>
⋮----
const startOnce = () =>
</file>

<file path="apps/main-app/ts/common/context/DSExperimentalContext/index.tsx">
import { useIOExperimentalDesign } from "@io-app/design-system";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { useLayoutEffect } from "react";
⋮----
export const useStoredExperimentalDesign = () =>
</file>

<file path="apps/main-app/ts/common/context/DSTypefaceContext/index.tsx">
import { useIONewTypeface } from "@io-app/design-system";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { useLayoutEffect } from "react";
⋮----
export const useStoredFontPreference = () =>
</file>

<file path="apps/main-app/ts/common/model/RemoteValue.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
export type RemoteValue<V, E> =
  | RemoteError<E>
  | RemoteLoading
  | RemoteReady<V>
  | RemoteUndefined;
⋮----
type RemoteError<E> = {
  error: E;
  readonly kind: "error";
};
⋮----
type RemoteLoading = {
  readonly kind: "loading";
};
⋮----
type RemoteReady<V> = {
  readonly kind: "ready";
  value: V;
};
⋮----
type RemoteUndefined = {
  readonly kind: "undefined";
};
⋮----
export const isUndefined = <V>(
  rv: RemoteValue<V, any>
): rv is RemoteUndefined
⋮----
export const isLoading = <V>(rv: RemoteValue<V, any>): rv is RemoteLoading
⋮----
export const isReady = <V>(rv: RemoteValue<V, any>): rv is RemoteReady<V>
⋮----
export const isError = <V, E>(rv: RemoteValue<V, E>): rv is RemoteError<E>
⋮----
export const getValue = <V>(rv: RemoteValue<V, any>)
⋮----
export const getValueOrElse = <V>(
  rv: RemoteValue<V, any>,
  defaultValue: V
): V
⋮----
export const remoteReady = <V>(v: V): RemoteReady<V> => (
⋮----
export const remoteError = <E>(e: E): RemoteError<E> => (
⋮----
export const foldW = <T, E, B, C>(
  rm: RemoteValue<T, E>,
  onUndefined: () => B,
  onLoading: () => B,
  onReady: (value: T) => B,
  onError: (error: E) => C
): B | C =>
⋮----
export const fold = <T, E, B>(
  rm: RemoteValue<T, E>,
  onUndefined: () => B,
  onLoading: () => B,
  onReady: (value: T) => B,
  onError: (error: E) => B
): B
⋮----
export const foldK =
  <T, E, B>(
    onUndefined: () => B,
    onLoading: () => B,
    onReady: (value: T) => B,
    onError: (error: E) => B
)
⋮----
export const foldKW =
  <T, E, B, C>(
    onUndefined: () => B,
    onLoading: () => B,
    onReady: (value: T) => B,
    onError: (error: E) => C
)
</file>

<file path="apps/main-app/ts/common/versionInfo/saga/versionInfo.ts">
import { VersionInfo } from "@io-app/api-types/generated/definitions/content/VersionInfo";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { BasicResponseType } from "@pagopa/ts-commons/lib/requests";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { call, fork, put } from "typed-redux-saga/macro";
⋮----
import { ContentClient } from "../../../api/content";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../types/utils";
import { convertUnknownToError } from "../../../utils/errors";
import { startTimer } from "../../../utils/timer";
import {
  versionInfoLoadFailure,
  versionInfoLoadSuccess
} from "../store/actions/versionInfo";
⋮----
function getVersionInfo(): Promise<
    t.Validation<BasicResponseType<VersionInfo>>
  > {
return new Promise((resolve, _) =>
</file>

<file path="apps/main-app/ts/common/versionInfo/store/actions/versionInfo.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { IOVersionInfo } from "../../types/IOVersionInfo";
⋮----
export type VersionInfoActions = ActionType<
  typeof versionInfoLoadFailure | typeof versionInfoLoadSuccess
>;
</file>

<file path="apps/main-app/ts/common/versionInfo/store/reducers/__mock__/ioVersionInfo.ts">
import { IOVersionInfo } from "../../../types/IOVersionInfo";
</file>

<file path="apps/main-app/ts/common/versionInfo/store/reducers/__mock__/testVersion.ts">
import { ITuple3, Tuple3 } from "@pagopa/ts-commons/lib/tuples";
</file>

<file path="apps/main-app/ts/common/versionInfo/store/reducers/__test__/versionInfo.test.tsx">
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { IOVersionInfo } from "../../../types/IOVersionInfo";
import {
  versionInfoLoadFailure,
  versionInfoLoadSuccess
} from "../../actions/versionInfo";
import { mockIoVersionInfo } from "../__mock__/ioVersionInfo";
import { minAppVersionAppVersionTestCases } from "../__mock__/testVersion";
import {
  isAppSupportedSelector,
  isPagoPaSupportedSelector
} from "../versionInfo";
⋮----
const testIsAppSupportedSelector = (
  minVersion: string,
  appVersion: string,
  isSupported: boolean,
  key: Extract<
    keyof IOVersionInfo,
    "min_app_version" | "min_app_version_pagopa"
  >
) =>
</file>

<file path="apps/main-app/ts/common/versionInfo/store/reducers/versionInfo.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { Platform } from "react-native";
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import {
  getAppVersion,
  isVersionSupported
} from "../../../../utils/appVersion";
import { IOVersionInfo, IOVersionPerPlatform } from "../../types/IOVersionInfo";
import {
  versionInfoLoadFailure,
  versionInfoLoadSuccess
} from "../actions/versionInfo";
⋮----
export type VersionInfoState = IOVersionInfo | null;
⋮----
export const versionInfoReducer = (
  state: VersionInfoState = null,
  action: Action
): VersionInfoState =>
⋮----
export const versionInfoDataSelector = (state: GlobalState)
⋮----
const selectVersion = (
  versionPerPlatform: IOVersionPerPlatform | undefined
): O.Option<string>
⋮----
const isSupported = (versionPerPlatform: IOVersionPerPlatform | undefined)
⋮----
export const isPagoPaSupportedSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/common/versionInfo/types/IOVersionInfo.ts">
export type IOVersionInfo = {
  latest_released_app_version: IOVersionPerPlatform;
  min_app_version: IOVersionPerPlatform;
  min_app_version_pagopa?: IOVersionPerPlatform;
  rollout_app_version: IOVersionPerPlatform;
};
⋮----
export type IOVersionPerPlatform = {
  android: string;
  ios: string;
};
</file>

<file path="apps/main-app/ts/components/animatedNumericText/AnimatedNumericText.ios.tsx">
import { Host, Text } from "@expo/ui/swift-ui";
import {
  accessibilityLabel as accessibilityLabelModifier,
  Animation,
  animation,
  contentTransition,
  fixedSize,
  font,
  foregroundStyle,
  monospacedDigit
} from "@expo/ui/swift-ui/modifiers";
import {
  getBolderFontWeight,
  IOColors,
  IOMaxFontSizeMultiplier,
  IOTypography,
  makeFontPostScriptName,
  useBoldTextEnabled,
  useIONewTypeface,
  useIOTheme
} from "@io-app/design-system";
import { useMemo } from "react";
import { Platform, useWindowDimensions } from "react-native";
⋮----
import { BaselineNumericText } from "./BaselineNumericText";
import { AnimatedNumericTextProps } from "./types";
⋮----
const supportsNumericTextTransition = ()
⋮----
const SwiftUINumericText = ({
  accessibilityLabel,
  allowFontScaling = true,
  color,
  countsDown = true,
  formatValue,
  maxFontSizeMultiplier,
  size = h1.size,
  value,
  weight = h1.weight
}: AnimatedNumericTextProps) =>
⋮----
export const AnimatedNumericText = (props: AnimatedNumericTextProps)
</file>

<file path="apps/main-app/ts/components/animatedNumericText/AnimatedNumericText.tsx">

</file>

<file path="apps/main-app/ts/components/animatedNumericText/BaselineNumericText.tsx">
import { IOText, IOTypography, useIOTheme } from "@io-app/design-system";
⋮----
import { AnimatedNumericTextProps } from "./types";
</file>

<file path="apps/main-app/ts/components/animatedNumericText/index.ts">

</file>

<file path="apps/main-app/ts/components/animatedNumericText/types.ts">
import { IOFontSize, IOTextProps } from "@io-app/design-system";
⋮----
export type AnimatedNumericTextProps = InheritedTextProps & {
  countsDown?: boolean;
  formatValue?: (value: number) => string;
  value: number;
};
⋮----
type InheritedTextProps = Pick<
  IOTextProps,
  "allowFontScaling" | "color" | "maxFontSizeMultiplier" | "weight"
> & {
  accessibilityLabel: NonNullable<IOTextProps["accessibilityLabel"]>;
  size?: IOFontSize;
};
</file>

<file path="apps/main-app/ts/components/BonusCard/BonusCard.tsx">
import {
  Avatar,
  BodySmall,
  H2,
  HSpacer,
  IODimensions,
  IOSkeleton,
  VSpacer
} from "@io-app/design-system";
import {
  createRef,
  Fragment,
  ReactNode,
  useLayoutEffect,
  useMemo
} from "react";
import { ImageURISource, StyleSheet, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { setAccessibilityFocus } from "../../utils/accessibility";
import { BonusCardCounter } from "./BonusCardCounter";
import { BonusCardColorSchemeValues } from "./BonusCardScreenComponent";
import { BonusCardShape } from "./BonusCardShape";
import { BonusCardStatus } from "./BonusCardStatus";
⋮----
export type BonusCard = BaseProps & LoadingStateProps;
⋮----
export type BonusCardWithColorSchemeValues = BonusCard & {
  cardColorSchemeValues: BonusCardColorSchemeValues;
};
⋮----
type BaseProps = {
  hideLogo?: boolean;
};
⋮----
type ContentProps = {
  cardBackground?: ReactNode;
  cardFooter?: ReactNode;
  counters?: ReadonlyArray<BonusCardCounter>;
  logoUris?: Array<ImageURISource | number>;
  name: string;
  organizationName: string;
  status: ReactNode;
};
⋮----
type LoadingStateProps =
  | (ContentProps & { isLoading?: never })
  | { isLoading: true };
</file>

<file path="apps/main-app/ts/components/BonusCard/BonusCardCounter.tsx">
import {
  H3,
  IOColors,
  IOSkeleton,
  LabelMini,
  useIOTheme,
  useIOThemeContext,
  VSpacer
} from "@io-app/design-system";
import { useEffect } from "react";
import { ColorValue, StyleSheet, View } from "react-native";
import Animated, {
  useAnimatedStyle,
  useSharedValue,
  withTiming
} from "react-native-reanimated";
⋮----
export type BonusCardCounter = BaseProps & LoadingProps;
⋮----
type AmountProps = {
  type: "Value";
  value: string;
};
⋮----
type AmountWithProgressProps = {
  progress: number;
  type: "ValueWithProgress";
  value: string;
};
⋮----
type BaseProps = {
  type: CounterType;
};
⋮----
type CounterType = "Value" | "ValueWithProgress";
⋮----
type LoadingProps =
  | ((AmountProps | AmountWithProgressProps) & {
      isLoading?: false;
      label: string;
    })
  | { isLoading: true; label?: string; skeletonColor: ColorValue };
⋮----
const theme = useIOTheme();
⋮----
const width = useSharedValue(100);
useEffect(() =>
const scalingWidth = useAnimatedStyle(() => (
return (
    <View
      style={styles.progressBarContainer}
      testID="BonusCardCounterProgressTestID"
    >
      <Animated.View
        style={[
          {
            width: `${width.value}%`,
            backgroundColor: progressBarColor,
            flex: 1
          },
          scalingWidth
        ]}
      />
    </View>
  );
</file>

<file path="apps/main-app/ts/components/BonusCard/BonusCardScreenComponent.tsx">
import {
  HeaderActionProps,
  hexToRgba,
  IOColors,
  useIOThemeContext
} from "@io-app/design-system";
import { ReactNode } from "react";
import { ColorSchemeName } from "react-native";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import { useDetectSmallScreen } from "../../hooks/useDetectSmallScreen";
import { useHeaderSecondLevel } from "../../hooks/useHeaderSecondLevel";
import { useIOSelector } from "../../store/hooks";
import { isScreenReaderEnabledSelector } from "../../store/reducers/preferences";
import { IOScrollView, IOScrollViewActions } from "../ui/IOScrollView";
import { BonusCard } from "./BonusCard";
⋮----
export type BonusCardColorSchemeValues = {
  background: string;
  foreground: string;
  text: IOColors;
};
⋮----
export type BonusScreenComponentProps = BaseProps &
  Exclude<BonusCard, "cardSpecificColors">;
⋮----
type BaseProps = {
  actions?: IOScrollViewActions;
  cardColors?: CardThemeColors;
  children?: ReactNode;
  headerAction?: HeaderActionProps;
  title?: string;
};
⋮----
type CardThemeColors = Record<
  NonNullable<Exclude<ColorSchemeName, "unspecified">>,
  BonusCardColorSchemeValues
>;
⋮----
const BonusCardScreenComponent = ({
  title,
  headerAction,
  actions,
  children,
  cardColors,
  ...cardProps
}: BonusScreenComponentProps) =>
</file>

<file path="apps/main-app/ts/components/BonusCard/BonusCardShape.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import { ColorValue, StyleSheet, View } from "react-native";
import { Circle, ClipPath, Defs, Path, Rect, Svg } from "react-native-svg";
⋮----
type Props = {
  backgroundColor: ColorValue;
  mode: "draw-on-top" | "mask";
};
⋮----
const BonusCardShape = (
</file>

<file path="apps/main-app/ts/components/BonusCard/BonusCardStatus.tsx">
import { IOSkeleton } from "@io-app/design-system";
import { ReactNode } from "react";
import { ColorValue, StyleSheet, View } from "react-native";
⋮----
export type BonusCardStatus = BaseProps | LoadingProps;
⋮----
type BaseProps = {
  children: ReactNode;
  isLoading?: never;
};
⋮----
type LoadingProps = {
  isLoading: true;
  skeletonColor: ColorValue;
};
⋮----
export const BonusCardStatus = (props: BonusCardStatus)
⋮----
export const BonusCardStatusContent = ({ children }: BaseProps) => (
  <View style={styles.container} testID="BonusCardStatusTestID">
    {children}
  </View>
);
</file>

<file path="apps/main-app/ts/components/BonusCard/index.ts">

</file>

<file path="apps/main-app/ts/components/bottomSheet/BottomSheetHeader.tsx">
import { H4, IconButton, IODimensions } from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import I18n from "i18next";
import {
  createRef,
  FunctionComponent,
  isValidElement,
  ReactNode,
  useEffect
} from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { setAccessibilityFocus } from "../../utils/accessibility";
⋮----
type Props = {
  onClose: () => void;
  title: ReactNode | string;
};
</file>

<file path="apps/main-app/ts/components/core/__mock__/fontMocks.ts">
import { IOFontWeight } from "../fonts";
</file>

<file path="apps/main-app/ts/components/core/__test__/fontsiOS.test.ts">
import { makeFontStyleObject } from "@io-app/design-system";
import { Platform } from "react-native";
⋮----
import { fontWeightsMocks, italics } from "../__mock__/fontMocks";
import { FontStyle, fontWeights } from "../fonts";
</file>

<file path="apps/main-app/ts/components/core/fonts.ts">
import { Platform } from "react-native";
⋮----
type IOFontFamily = keyof typeof fonts;
⋮----
export type IOFontWeight = (typeof weights)[number];
⋮----
export type FontWeightValue = (typeof weightValues)[number];
⋮----
export enum FontStyle {
  italic = "italic",
  normal = "normal"
}
⋮----
const makeFontFamilyName = (
  font: IOFontFamily,
  weight?: IOFontWeight,
  isItalic = false
): string
</file>

<file path="apps/main-app/ts/components/core/README.md">
# Core Components

- [Fonts](#fonts)
- [Vector graphics](#vector-graphics)

## Fonts

The application uses the font _Titillium Sans Pro_. Fonts are handled differently than Android and iOS. To use the font, `TitilliumSansPro-SemiboldItalic` example, you must apply the following properties for Android:

```js
const androidStyle = {
  fontFamily: "TitilliumSansPro-SemiboldItalic"
};
```

while in iOS the code to be applied is:

```js
const iosStyle = {
  fontFamily: "Titillium Sans Pro",
  fontWeight: "600",
  fontStyle: "italic"
};
```

To manage fonts and variants more easily, we have created utility functions within the file [fonts.ts](fonts.ts).

## Vector graphics

Most of the images used in the app can be rendered as vector assets using SVG image format. Currently we have these groups:

- **Pictograms**: assets with an intended size greather than `56px`
- **Icons**: assets with an intended size between `16px` and `56px`
- **Logos**

Once you understand which group you must put the asset in, you must take into consideration the following instructions for the best result in terms of quality and future maintenance:

1. In your user interface design app (Figma/Sketch) make the vector path as simple as possible:
   - Detach the symbol instance to avoid destructive actions to the original source component. Feel free to use a draft or disposable project document.
   - Outline all the present strokes (unless required for dynamic stroke width, but we don't manage this case at the moment)
   - Select all the different paths and flatten into one. Now you should have a single vector layer.
   - Make sure your vector path is centered (both vertically and horizontally) in a square
2. Export your SVG with `1×` preset
3. Delete `width` and `height` attributes and leave the original `viewBox` attribute. You could easily process the image using online editors like [SVGOmg](https://jakearchibald.github.io/svgomg/) (enable `Prefer viewBox to width/height`)
4. To easily preview the available SVG assets, include the original SVG in the `originals` subfolder **with the same filename of your corresponding React component**.
5. Copy all the `<path>` elements into a new React component and replace the original `<path>` with the element `<Path>` (capital P) from the `react-native-svg` package. Replace all the harcoded fill values with the generic `currentColor` value.
6. Add the dynamic size and colour (if required), replacing the hardcoded values with the corresponding props:

```jsx
import { Svg, Path } from "react-native-svg";

const IconSpid = ({ size, style }: SVGIconProps) => (
  <Svg width={size} height={size} viewBox="0 0 24 24" style={style}>
    <Path
      d="M13.615 …"
      fill="currentColor"
    />
  </Svg>
);
```

**Note:** The icon inherit the color from the parent `Svg` container

7. Add the key associated to the single pictogram/icon in the corresponding set. If you want to learn more, read the contextual documentation:
   - [Pictograms](pictograms/README.md)
   - [Icons](icons/README.md)
   - [Logos](logos/README.md)

8. There's no need to add the new pictogram/icon in the `Design System` specific page because it happens automatically.
</file>

<file path="apps/main-app/ts/components/countdown/CountdownProvider.tsx">
import {
  createContext,
  ReactNode,
  useCallback,
  useContext,
  useMemo,
  useRef,
  useState
} from "react";
import BackgroundTimer from "react-native-background-timer";
⋮----
type CountdownContextType = {
  isRunning?: () => boolean;
  resetTimer?: () => void;
  startTimer?: () => void;
  timerCount: number;
};
⋮----
interface CountdownProviderProps {
  children: ReactNode;
  intervalDuration: number;
  timerTiming: number;
}
⋮----
export const CountdownProvider = (props: CountdownProviderProps) =>
⋮----
export const useCountdown = ()
</file>

<file path="apps/main-app/ts/components/error/ErrorBoundary.tsx">
import { Component, ErrorInfo, PropsWithChildren, ReactNode } from "react";
⋮----
type Props = PropsWithChildren<{
  fallback: ReactNode;
  onError?: (error: unknown, componentStack: string | undefined) => void;
}>;
⋮----
type State = {
  hasError: boolean;
};
⋮----
class ErrorBoundary extends Component<Props, State>
⋮----
constructor(props: Props)
⋮----
static getDerivedStateFromError(_: unknown)
⋮----
componentDidCatch(error: unknown, info: ErrorInfo)
⋮----
render()
</file>

<file path="apps/main-app/ts/components/error/OfflineFailure.tsx">
import I18n from "i18next";
⋮----
import { useHeaderSecondLevel } from "../../hooks/useHeaderSecondLevel";
import { OperationResultScreenContent } from "../screens/OperationResultScreenContent";
⋮----
type OfflineFailureComponentProps = {
  isHeaderVisible?: boolean;
  onRetry?: () => void;
};
⋮----
export const OfflineFailureComponent = ({
  onRetry,
  isHeaderVisible
}: OfflineFailureComponentProps) =>
</file>

<file path="apps/main-app/ts/components/error/WorkunitGenericFailure.tsx">
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { ReactElement } from "react";
import { connect } from "react-redux";
⋮----
import { useHeaderSecondLevel } from "../../hooks/useHeaderSecondLevel";
import { OperationResultScreenContent } from "../screens/OperationResultScreenContent";
</file>

<file path="apps/main-app/ts/components/helpers/withAppRequiredUpdate.tsx">
import { useIOSelector } from "../../store/hooks";
import {
  fimsRequiresAppUpdateSelector,
  idPayDetailsRequiresAppUpdateSelector,
  idPayOnboardingRequiresAppUpdateSelector,
  isFciEnabledSelector,
  isPnAppVersionSupportedSelector
} from "../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../store/reducers/types";
⋮----
export type AppUpdateFeatureKey =
  | "fci"
  | "fims"
  | "idpay.initiative_details"
  | "idpay.onboarding"
  | "send";
⋮----
export type RequiredUpdateMixPanelTracking = {
  onConfirm: () => void;
  onLanding: () => void;
};
⋮----
export const useAppRequiredUpdate = (featureKey: AppUpdateFeatureKey)
</file>

<file path="apps/main-app/ts/components/IOMarkdown/__mocks__/index.tsx">
import { Text, View } from "react-native";
⋮----
import { IOMarkdownProps } from "..";
⋮----
const IOMarkdown = (props: IOMarkdownProps) => (
  <View>
    <Text>{props.content}</Text>
  </View>
);
</file>

<file path="apps/main-app/ts/components/IOMarkdown/__mocks__/markdownRenderer.test.ts">
import { convertReferenceLinksToInline } from "../markdownRenderer";
⋮----
// Test 17: Only link definitions (no references)
</file>

<file path="apps/main-app/ts/components/IOMarkdown/index.tsx">
import { Body } from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../store/hooks";
import { isScreenReaderEnabledSelector } from "../../store/reducers/preferences";
import ErrorBoundary from "../error/ErrorBoundary";
import {
  convertReferenceLinksToInline,
  getRenderMarkdown,
  parse,
  sanitizeMarkdownForImages,
  sanitizeMarkdownFromFormFeed
} from "./markdownRenderer";
import { DEFAULT_RULES } from "./renderRules";
import { IOMarkdownRenderRules } from "./types";
⋮----
export type IOMarkdownProps = {
  content: string;
  onError?: (error: unknown, componentStack: string | undefined) => void;
  rules?: Partial<IOMarkdownRenderRules>;
};
⋮----
type UnsafeProps = Omit<IOMarkdownProps, "onError">;
⋮----
const UnsafeIOMarkdown = (
⋮----
const IOMarkdownComponent = ({ content, rules, onError }: IOMarkdownProps) => (
  <ErrorBoundary
    fallback={
      <View>
        <Body>{I18n.t("global.markdown.decodeError")}</Body>
      </View>
    }
    onError={onError}
  >
    <UnsafeIOMarkdown content={content} rules={rules} />
  </ErrorBoundary>
);
⋮----
<Body>
</file>

<file path="apps/main-app/ts/components/IOMarkdown/markdownRenderer.ts">
import {
  AnyTxtNode,
  TxtHeaderNode,
  TxtLinkNode,
  TxtListNode,
  TxtNode,
  TxtParagraphNode,
  TxtParentNode,
  TxtStrNode
} from "@textlint/ast-node-types";
import { parse as textLintParse } from "@textlint/markdown-to-ast";
import { omit } from "lodash";
⋮----
import { isIos } from "../../utils/platform";
import { AnyTxtNodeWithSpacer, IOMarkdownRenderRules, Renderer } from "./types";
⋮----
export function getRenderMarkdown(
  rules: IOMarkdownRenderRules,
  screenReaderEnabled: boolean
): Renderer
⋮----
export function parse(content: string): Array<AnyTxtNodeWithSpacer>
⋮----
function integrateParent<T extends AnyTxtNode>(
  node: T,
  parent?: TxtParentNode
): T
⋮----
export const convertReferenceLinksToInline = (markdownText: string): string =>
⋮----
// Title is not supported but we capture it in case it will be in the future
⋮----
// Remove all link definitions from the text
⋮----
// Replace reference-style links [text][label] with inline links [text](url)
⋮----
// If label is empty, use the link text as the label
⋮----
// At the moment, we do not support title
⋮----
// If no matching definition found, return original
⋮----
export const sanitizeMarkdownForImages = (
  inputMarkdownContent: string
): string =>
⋮----
// eslint-disable-next-line functional/no-let
⋮----
// eslint-disable-next-line functional/immutable-data
⋮----
// Even if markdown parser handle form feed characters (\f), iOS text parser causes a blank page after the character due to own parsing rules.
// To prevent this, we replace all form feed characters with a space character before parsing the markdown.
export const sanitizeMarkdownFromFormFeed = (
  inputMarkdownContent: string
): string
⋮----
export const insertNewLinesIfNeededOnMatch = (
  markdownContent: string,
  imageMatch: RegExpExecArray
): string =>
⋮----
export const isTxtParentNode = (node: TxtNode): node is TxtParentNode
export const isTxtLinkNode = (node: TxtNode): node is TxtLinkNode
export const isTxtStrNode = (node: TxtNode): node is TxtStrNode
export const isTxtParagraphNode = (node: TxtNode): node is TxtParagraphNode
⋮----
export type LinkData = {
  text: string;
  url: string;
};
⋮----
export const extractAllLinksFromRootNode = (
  node: TxtHeaderNode | TxtListNode | TxtParagraphNode,
  screenReaderEnabled: boolean
): ReadonlyArray<LinkData> =>
⋮----
export const extractAllLinksFromNodeWithChildren = (
  nodeWithChildren: Readonly<TxtParentNode>,
  allLinks: Array<LinkData>
) =>
⋮----
export const extractLinkDataFromRootNode = (
  inputNode: Readonly<TxtParentNode>,
  links: Array<string>
): void
⋮----
export const isParagraphNodeInHierarchy = (
  input: TxtNode | undefined
): boolean =>
</file>

<file path="apps/main-app/ts/components/IOMarkdown/renderRules.tsx">
import {
  Banner,
  Body,
  BodyMonospace,
  BodySmall,
  Divider,
  H1,
  H2,
  H3,
  H4,
  H5,
  H6,
  HSpacer,
  IODimensions,
  IOPictogramsBleed,
  IOSpace,
  IOText,
  IOToast,
  Nullable,
  VSpacer
} from "@io-app/design-system";
import {
  AnyTxtNode,
  TxtBlockQuoteNode,
  TxtBreakNode,
  TxtCodeBlockNode,
  TxtCodeNode,
  TxtEmphasisNode,
  TxtHeaderNode,
  TxtHorizontalRuleNode,
  TxtHtmlNode,
  TxtImageNode,
  TxtLinkNode,
  TxtListItemNode,
  TxtListNode,
  TxtParagraphNode,
  TxtParentNode,
  TxtStrNode,
  TxtStrongNode
} from "@textlint/ast-node-types";
import I18n from "i18next";
import {
  ComponentType,
  Fragment,
  ReactNode,
  useLayoutEffect,
  useState
} from "react";
import { Dimensions, Image, Pressable, View } from "react-native";
⋮----
import { isAndroid } from "../../utils/platform";
import { openWebUrl } from "../../utils/url";
import {
  extractAllLinksFromRootNode,
  isParagraphNodeInHierarchy,
  LinkData
} from "./markdownRenderer";
import { IOMarkdownRenderRules, Renderer } from "./types";
⋮----
export type ParagraphSize = "default" | "small";
⋮----
export function getPictogramName(value?: Nullable<string>): IOPictogramsBleed
⋮----
export function getStrValue(
⋮----
/**
 * Used to get a valid key
 *
 * @param txtNode Any Txt node
 * @returns A string to be used as component key inside of map loops.
 */
export function getTxtNodeKey(txtNode: AnyTxtNode): string
⋮----
function getNodeNestingLevel<T extends AnyTxtNode | undefined>(
  node: T,
  nodeType?: AnyTxtNode["type"]
): number
⋮----
export const generateAccesibilityLinkViewsIfNeeded = (
  allLinkData: ReadonlyArray<LinkData>,
  nodeKey: string,
  onPress: (url: string) => void,
  screenReaderEnabled: boolean
) =>
⋮----
onPress=
⋮----
export const handleOpenLink = (url: string) =>
⋮----
Header(
    header: TxtHeaderNode,
    render: Renderer,
    screenReaderEnabled: boolean
)
⋮----
Paragraph(
    paragraph: TxtParagraphNode,
    render: Renderer,
    screenReaderEnabled: boolean
)
... (28 lines truncated)
</file>

<file path="apps/main-app/ts/components/IOMarkdown/types.ts">
import { VSpacer } from "@io-app/design-system";
import {
  AnyTxtNode,
  ASTNodeTypes,
  TxtBlockQuoteNode,
  TxtBreakNode,
  TxtCodeBlockNode,
  TxtCodeNode,
  TxtEmphasisNode,
  TxtHeaderNode,
  TxtHorizontalRuleNode,
  TxtHtmlNode,
  TxtImageNode,
  TxtLinkNode,
  TxtListItemNode,
  TxtListNode,
  TxtParagraphNode,
  TxtStrNode,
  TxtStrongNode
} from "@textlint/ast-node-types";
import { ComponentProps, ReactNode } from "react";
⋮----
export type AnyTxtNodeWithSpacer =
  | AnyTxtNode
  | { key: string; size: number; type: "Spacer" };
export type IOMarkdownRenderRules = RendererMap;
export type Renderer = (txtNode: AnyTxtNodeWithSpacer) => ReactNode;
⋮----
type RendererMap = {
  [ASTNodeTypes.Comment]: RuleRenderer<null>;
  Spacer: RuleRenderer<ComponentProps<typeof VSpacer> & { key: string }>;
} & {
  [K in keyof TxtNodeMap]: RuleRenderer<TxtNodeMap[K], Renderer>;
};
type RuleRenderer<P, F extends Renderer | void = void> = (
  param: P,
  renderer: F,
  screenReaderEnabled: boolean
) => ReactNode;
⋮----
type TxtNodeMap = {
  [ASTNodeTypes.BlockQuote]: TxtBlockQuoteNode;
  [ASTNodeTypes.Break]: TxtBreakNode;
  [ASTNodeTypes.Code]: TxtCodeNode;
  [ASTNodeTypes.CodeBlock]: TxtCodeBlockNode;
  [ASTNodeTypes.Emphasis]: TxtEmphasisNode;
  [ASTNodeTypes.Header]: TxtHeaderNode;
  [ASTNodeTypes.HorizontalRule]: TxtHorizontalRuleNode;
  [ASTNodeTypes.Html]: TxtHtmlNode;
  [ASTNodeTypes.Image]: TxtImageNode;
  [ASTNodeTypes.Link]: TxtLinkNode;
  [ASTNodeTypes.List]: TxtListNode;
  [ASTNodeTypes.ListItem]: TxtListItemNode;
  [ASTNodeTypes.Paragraph]: TxtParagraphNode;
  [ASTNodeTypes.Str]: TxtStrNode;
  [ASTNodeTypes.Strong]: TxtStrongNode;
};
</file>

<file path="apps/main-app/ts/components/screens/LoadingScreenContent.tsx">
import {
  Banner,
  ContentWrapper,
  H3,
  IOButton,
  IOButtonProps,
  IOColors,
  IODimensions,
  IOMarkdownLite,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { ComponentProps, useEffect } from "react";
import { AccessibilityInfo, Platform, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { LoadingIndicator } from "../../components/ui/LoadingIndicator";
import { WithTestID } from "../../types/WithTestID";
import {
  AnimatedPictogram,
  IOAnimatedPictograms
} from "../ui/AnimatedPictogram";
⋮----
type ButtonProps = Pick<
  IOButtonProps,
  "accessibilityLabel" | "icon" | "label" | "onPress" | "testID"
>;
⋮----
type LoadingScreenContentProps = WithTestID<{
  action?: ButtonProps;
  animatedPictogramSource?: IOAnimatedPictograms;
  banner?: ComponentProps<typeof Banner>;
  headerVisible?: boolean;
  subtitle?: string;
  title: string;
}>;
</file>

<file path="apps/main-app/ts/components/screens/OperationResultScreenContent.tsx">
import {
  H3,
  IOButton,
  IOButtonProps,
  IODimensions,
  IOMarkdownLite,
  IOPictograms,
  Pictogram,
  VSpacer,
  WithTestID
} from "@io-app/design-system";
import {
  cloneElement,
  isValidElement,
  PropsWithChildren,
  ReactNode,
  Ref
} from "react";
import { Platform, ScrollView, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import {
  AnimatedPictogram,
  IOAnimatedPictograms,
  IOAnimatedPictogramsAssets
} from "../ui/AnimatedPictogram";
⋮----
type ButtonProps = Pick<
  IOButtonProps,
  | "accessibilityLabel"
  | "color"
  | "icon"
  | "iconPosition"
  | "label"
  | "onPress"
  | "testID"
>;
⋮----
type OperationResultScreenContentProps = WithTestID<{
  action?: ButtonProps;
  disableAnimatedPictogram?: boolean;
  isHeaderVisible?: boolean;
  onSubtitleLinkPress?: (url: string) => void;
  pictogram: IOAnimatedPictograms | IOPictograms;
  ref?: Ref<View>;
  secondaryAction?: ButtonProps;
  subtitle?: string;
  title: string;
  topElement?: ReactNode;
}>;
⋮----
const hasAnimatedVersion = (
  pictogram: IOAnimatedPictograms | IOPictograms
): pictogram is IOAnimatedPictograms
</file>

<file path="apps/main-app/ts/components/screens/WhatsNewScreenContent.tsx">
import {
  Badge,
  H3,
  IOButton,
  IOButtonProps,
  IODimensions,
  IOPictograms,
  Pictogram,
  VStack,
  WithTestID
} from "@io-app/design-system";
import { PropsWithChildren, Ref } from "react";
import { ScrollView, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import {
  AnimatedPictogram,
  IOAnimatedPictograms
} from "../ui/AnimatedPictogram";
⋮----
export type WhatsNewScreenContentProps = WithTestID<
  GraphicAssetProps & {
    action?: ButtonProps<"fullWidth">;
    badge?: Badge;
    ref?: Ref<View>;
    secondaryAction?: ButtonProps;
    title: string;
  }
>;
⋮----
type ButtonProps<ExtraProps extends keyof IOButtonProps | never = never> = Pick<
  IOButtonProps,
  "accessibilityLabel" | "icon" | "label" | "onPress" | "testID" | ExtraProps
>;
⋮----
type GraphicAssetProps =
  | {
      enableAnimatedPictogram: true;
      loop?: AnimatedPictogram["loop"];
      pictogram: IOAnimatedPictograms;
    }
  | {
      enableAnimatedPictogram?: false;
      loop?: never;
      pictogram?: IOPictograms;
    };
</file>

<file path="apps/main-app/ts/components/SectionStatus/modal/index.tsx">
import { LevelEnum } from "@io-app/api-types/generated/definitions/content/SectionStatus";
import { Alert, IOColors } from "@io-app/design-system";
import I18n from "i18next";
import {
  ComponentProps,
  RefObject,
  useCallback,
  useEffect,
  useRef
} from "react";
import { AccessibilityInfo, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { isMixpanelInitializedSelector } from "../../../features/mixpanel/store/selectors";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../store/hooks";
import {
  isSectionVisibleSelector,
  levelForSectionSelector,
  messageForSectionSelector,
  SectionStatusKey,
  webUrlForSectionSelector
} from "../../../store/reducers/backendStatus/sectionStatus";
import { isMixpanelEnabled as isMixpanelEnabledSelector } from "../../../store/reducers/persistedPreferences";
import { getFullLocale } from "../../../utils/locale";
import { openWebUrl } from "../../../utils/url";
⋮----
type Props = {
  onSectionRef?: (ref: RefObject<null | View>) => void;
  sectionKey: SectionStatusKey;
  sticky?: boolean;
  trackingAction?: () => void;
};
</file>

<file path="apps/main-app/ts/components/SectionStatus/index.tsx">
import { LevelEnum } from "@io-app/api-types/generated/definitions/content/SectionStatus";
import { Alert } from "@io-app/design-system";
import I18n from "i18next";
import {
  ComponentProps,
  RefObject,
  useCallback,
  useEffect,
  useRef
} from "react";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../navigation/params/AppParamsList";
import { useIOSelector } from "../../store/hooks";
import {
  isSectionVisibleSelector,
  levelForSectionSelector,
  messageForSectionSelector,
  SectionStatusKey,
  webUrlForSectionSelector
} from "../../store/reducers/backendStatus/sectionStatus";
import { getFullLocale } from "../../utils/locale";
import { openWebUrl } from "../../utils/url";
⋮----
type Props = {
  onSectionRef?: (ref: RefObject<null | View>) => void;
  sectionKey: SectionStatusKey;
};
⋮----
const SectionStatusComponent = (
</file>

<file path="apps/main-app/ts/components/StatusMessages/IOAlertVisibleContext.tsx">
import React, { PropsWithChildren, useMemo, useState } from "react";
⋮----
type IOAlertVisibleContext = {
  isAlertVisible: boolean;
  setAlertVisible: (isAlertVisible: boolean) => void;
};
⋮----
export const useIOAlertVisible = ()
⋮----
export const IOAlertVisibleContextProvider = ({
  children
}: PropsWithChildren) =>
</file>

<file path="apps/main-app/ts/components/StatusMessages/StatusMessages.tsx">
import {
  AlertEdgeToEdgeProps,
  AlertEdgeToEdgeWrapper,
  IOColors
} from "@io-app/design-system";
import { PropsWithChildren } from "react";
import { StatusBar } from "react-native";
⋮----
import { useStatusAlertProps } from "../../hooks/useStatusAlertProps";
⋮----
type StatusMessagesProps = PropsWithChildren;
⋮----
export const StatusMessages = (
</file>

<file path="apps/main-app/ts/components/ui/__test__/BoxedRefreshIndicator.test.tsx">
import { render } from "@testing-library/react-native";
import { ReactNode } from "react";
import { Text } from "react-native";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
⋮----
import { applicationChangeState } from "../../../store/actions/application";
import { appReducer } from "../../../store/reducers";
import { GlobalState } from "../../../store/reducers/types";
import BoxedRefreshIndicator from "../BoxedRefreshIndicator";
⋮----
const renderComponent = (action?: ReactNode, caption?: ReactNode) =>
</file>

<file path="apps/main-app/ts/components/ui/__test__/IOListView.test.tsx">
import { Body } from "@io-app/design-system";
import { ComponentProps } from "react";
import { createStore } from "redux";
⋮----
import ROUTES from "../../../navigation/routes";
import { applicationChangeState } from "../../../store/actions/application";
import { appReducer } from "../../../store/reducers";
import { GlobalState } from "../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../utils/testWrapper";
import { IOListView } from "../IOListView";
⋮----
type Data = { id: string; name: string };
const renderComponent = (props: ComponentProps<typeof IOListView<Data>>) =>
</file>

<file path="apps/main-app/ts/components/ui/__test__/IOScrollViewCentredContent.test.tsx">
import { constUndefined } from "fp-ts/lib/function";
import { ComponentProps } from "react";
import { createStore } from "redux";
⋮----
import ROUTES from "../../../navigation/routes";
import { applicationChangeState } from "../../../store/actions/application";
import { appReducer } from "../../../store/reducers";
import { GlobalState } from "../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../utils/testWrapper";
import { IOScrollViewActions } from "../IOScrollView";
import {
  IOScrollViewCentredContent,
  IOScrollViewCentredContentProps
} from "../IOScrollViewCentredContent";
⋮----
const propsFromAction = (
  action: IOScrollViewActions,
  description?: string,
  additionalLink?: IOScrollViewCentredContentProps["additionalLink"]
): IOScrollViewCentredContentProps => (
⋮----
function renderComponent(
  props: ComponentProps<typeof IOScrollViewCentredContent>
)
</file>

<file path="apps/main-app/ts/components/ui/__test__/IOScrollViewWithListItems.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../store/actions/application";
import { appReducer } from "../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../utils/testWrapper";
import { IOScrollViewWithListItems } from "../IOScrollViewWithListItems";
⋮----
const renderComponent = (props: IOScrollViewWithListItems) =>
</file>

<file path="apps/main-app/ts/components/ui/Markdown/handlers/__test__/link.test.ts">
import {
  deriveCustomHandledLink,
  isCustomHandledLink,
  isHttpLink,
  isHttpsLink,
  isIoInternalLink
} from "../link";
</file>

<file path="apps/main-app/ts/components/ui/Markdown/handlers/link.ts">
import { IO_INTERNAL_LINK_PREFIX } from "../../../../utils/navigation";
⋮----
export const isIoInternalLink = (href: string): boolean
⋮----
export const isHttpsLink = (href: string): boolean
export const isHttpLink = (href: string): boolean
export const isCustomHandledLink = (href: string): boolean =>
⋮----
export const deriveCustomHandledLink = (href: string): string | undefined =>
</file>

<file path="apps/main-app/ts/components/ui/Markdown/script.ts">

</file>

<file path="apps/main-app/ts/components/ui/Markdown/types.ts">

</file>

<file path="apps/main-app/ts/components/ui/utils/components/LogoPaymentWithFallback.tsx">
import {
  Icon,
  IOColors,
  IOIconSizeScale,
  IOLogoPaymentExtType,
  IOLogoPaymentType,
  IOPaymentExtLogos,
  IOPaymentLogos,
  LogoPayment,
  LogoPaymentExt,
  useIOTheme
} from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import { findFirstCaseInsensitive } from "../../../../utils/object";
⋮----
export type LogoPaymentWithFallback = {
  brand?: string;
  fallbackIconColor?: IOColors;
  isExtended?: boolean;
  size?: IOIconSizeScale;
};
</file>

<file path="apps/main-app/ts/components/ui/utils/buttons.ts">
import { IOButtonBlockSpecificProps, IOToast } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { GuidedTourProps } from "../../../features/tour/components/GuidedTour";
import { openWebUrl } from "../../../utils/url";
import { OperationResultScreenContentProps } from "../../screens/OperationResultScreenContent";
⋮----
export type ButtonBlockProps = Omit<
  IOButtonBlockSpecificProps,
  "fullWidth" | "variant"
>;
⋮----
export type ButtonBlockWithTourGuideProps = ButtonBlockProps & {
  tourGuideProps?: GuidedTourProps;
};
⋮----
export const getInstructionsButtonConfig = (
  url: string
): OperationResultScreenContentProps["secondaryAction"] => (
</file>

<file path="apps/main-app/ts/components/ui/utils/strings.ts">
import Config from "react-native-config";
⋮----
export const getBankLogosCdnUri = (abi: string)
</file>

<file path="apps/main-app/ts/components/ui/AlertModal.tsx">
import { Body, hexToRgba, IOColors, IODimensions } from "@io-app/design-system";
import { StyleSheet, View } from "react-native";
⋮----
import { useHardwareBackButton } from "../../hooks/useHardwareBackButton";
import { useModalStyle } from "../../utils/hooks/useModalStyle";
import { AlertModalOverlay } from "./AlertModalOverlay";
⋮----
type AlertModalProps = Readonly<{
  message: string;
}>;
</file>

<file path="apps/main-app/ts/components/ui/AlertModalOverlay.tsx">
import { IOColors } from "@io-app/design-system";
import { ReactNode } from "react";
import { ColorValue, StyleSheet, View } from "react-native";
⋮----
type Props = Readonly<{
  backgroundColor?: ColorValue;
  children?: ReactNode;
  foreground?: ReactNode;
  opacity?: number;
}>;
</file>

<file path="apps/main-app/ts/components/ui/AnimatedPictogram.tsx">
import {
  IOPictograms,
  IOPictogramSizeScale,
  Pictogram,
  useIOThemeContext
} from "@io-app/design-system";
import {
  Canvas,
  Group,
  Skia,
  Skottie,
  useClock
} from "@shopify/react-native-skia";
import { useEffect, useMemo } from "react";
import {
  useDerivedValue,
  useReducedMotion,
  useSharedValue
} from "react-native-reanimated";
⋮----
import accessDenied from "../../../assets/animated-pictograms/AccessDenied.json";
import accessDeniedDark from "../../../assets/animated-pictograms/AccessDeniedDark.json";
import attention from "../../../assets/animated-pictograms/Attention.json";
import attentionDark from "../../../assets/animated-pictograms/AttentionDark.json";
⋮----
import empty from "../../../assets/animated-pictograms/Empty.json";
import emptyDark from "../../../assets/animated-pictograms/EmptyDark.json";
import fatalError from "../../../assets/animated-pictograms/FatalError.json";
import fatalErrorDark from "../../../assets/animated-pictograms/FatalErrorDark.json";
import lock from "../../../assets/animated-pictograms/Lock.json";
import lockDark from "../../../assets/animated-pictograms/LockDark.json";
import scanCardAndroid from "../../../assets/animated-pictograms/ScanCardAndroid.json";
import scanCardAndroidDark from "../../../assets/animated-pictograms/ScanCardAndroidDark.json";
import scanCardiOS from "../../../assets/animated-pictograms/ScanCardiOS.json";
import scanCardiOSDark from "../../../assets/animated-pictograms/ScanCardiOSDark.json";
import searchLens from "../../../assets/animated-pictograms/SearchLens.json";
import searchLensDark from "../../../assets/animated-pictograms/SearchLensDark.json";
import success from "../../../assets/animated-pictograms/Success.json";
import successDark from "../../../assets/animated-pictograms/SuccessDark.json";
import umbrella from "../../../assets/animated-pictograms/Umbrella.json";
import umbrellaDark from "../../../assets/animated-pictograms/UmbrellaDark.json";
import waiting from "../../../assets/animated-pictograms/Waiting.json";
import waitingDark from "../../../assets/animated-pictograms/WaitingDark.json";
import welcome from "../../../assets/animated-pictograms/Welcome.json";
import welcomeDark from "../../../assets/animated-pictograms/WelcomeDark.json";
⋮----
export type AnimatedPictogram = {
  loop?: boolean;
  name: IOAnimatedPictograms;
  size: IOPictogramSizeScale;
};
⋮----
export type IOAnimatedPictograms = keyof typeof IOAnimatedPictogramsAssets;
⋮----
export const AnimatedPictogram = (
</file>

<file path="apps/main-app/ts/components/ui/BoxedRefreshIndicator.tsx">
import { ReactNode } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { LoadingIndicator } from "./LoadingIndicator";
⋮----
type Props = {
  action?: ReactNode;
  caption?: ReactNode;
};
⋮----
const BoxedRefreshIndicator = ({ action, caption }: Props) => (
  <View style={styles.refreshBox}>
    <LoadingIndicator testID="refreshIndicator" />
    {caption ? caption : null}
    {action ? action : null}
  </View>
);
</file>

<file path="apps/main-app/ts/components/ui/CircularProgress.tsx">
import { ReactNode, useEffect } from "react";
import { ColorValue, StyleSheet, View } from "react-native";
import Animated, {
  useAnimatedProps,
  useSharedValue
} from "react-native-reanimated";
import Svg, { Circle, G } from "react-native-svg";
⋮----
type CircularProgressProps = {
  children?: ReactNode;
  progress: number;
  radius: number;
  size: number;
  strokeBgColor: ColorValue;
  strokeColor: ColorValue;
  strokeWidth: number;
};
</file>

<file path="apps/main-app/ts/components/ui/FocusAwareStatusBar.tsx">
import { useIsFocused } from "@react-navigation/native";
import { StatusBar, StatusBarProps } from "react-native";
⋮----
import { useIOAlertVisible } from "../StatusMessages/IOAlertVisibleContext";
⋮----
const FocusAwareStatusBar = (props: StatusBarProps) =>
</file>

<file path="apps/main-app/ts/components/ui/IOListView.tsx">
import {
  hexToRgba,
  IOColors,
  IODimensions,
  IODimensionScale,
  useIOTheme
} from "@io-app/design-system";
import { LinearGradient } from "expo-linear-gradient";
import { ComponentProps, ReactElement, useState } from "react";
import {
  ColorValue,
  LayoutChangeEvent,
  LayoutRectangle,
  ListRenderItemInfo,
  RefreshControl,
  StyleSheet,
  View
} from "react-native";
import Animated, { AnimatedRef } from "react-native-reanimated";
⋮----
import { useFooterActionsMargin } from "../../hooks/useFooterActionsMargin";
import { useScrollHeaderAnimation } from "../../hooks/useScrollHeaderAnimation";
import { IOScrollView, renderActionButtons } from "./IOScrollView";
⋮----
type IOListView<T> = ComponentProps<typeof Animated.FlatList<T>> &
  ComponentProps<typeof IOScrollView> & {
    animatedRef?: AnimatedRef<Animated.FlatList<T>>;
    data: Array<T>;
    keyExtractor: ((item: T, index: number) => string) | undefined;
    loading?: boolean;
    renderItem: (item: ListRenderItemInfo<T>) => null | ReactElement;
    skeleton?: ReactElement;
  };
⋮----
const getActionBlockHeight = (event: LayoutChangeEvent) =>
</file>

<file path="apps/main-app/ts/components/ui/IOListViewWithLargeHeader.tsx">
import {
  BodySmall,
  Divider,
  H2,
  HeaderSecondLevel,
  IOMarkdownLite,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { useFocusEffect, useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { ComponentProps, createRef, JSX, useCallback, useState } from "react";
import { LayoutChangeEvent, View } from "react-native";
⋮----
import { useHeaderProps } from "../../hooks/useHeaderProps";
import { setAccessibilityFocus } from "../../utils/accessibility";
import { IOListView } from "./IOListView";
import { IOScrollViewWithLargeHeader } from "./IOScrollViewWithLargeHeader";
⋮----
type Props<T> = ComponentProps<typeof IOListView<T>> &
  ComponentProps<typeof IOScrollViewWithLargeHeader> & {
    subtitle?: string;
  };
⋮----
const getTitleHeight = (event: LayoutChangeEvent) =>
</file>

<file path="apps/main-app/ts/components/ui/IOScrollView.tsx">
import {
  HeaderSecondLevel,
  hexToRgba,
  IOButton,
  IOButtonLinkSpecificProps,
  IOColors,
  IODimensions,
  IODimensionScale,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import { LinearGradient } from "expo-linear-gradient";
import {
  ComponentProps,
  Fragment,
  PropsWithChildren,
  useLayoutEffect,
  useMemo,
  useState
} from "react";
import {
  ColorValue,
  LayoutChangeEvent,
  LayoutRectangle,
  RefreshControl,
  RefreshControlProps,
  StyleSheet,
  View,
  ViewStyle
} from "react-native";
import { easeGradient } from "react-native-easing-gradient";
import Animated, {
  AnimatedRef,
  Easing,
  Extrapolation,
  interpolate,
  useAnimatedScrollHandler,
  useAnimatedStyle,
  useSharedValue
} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { GuidedTour } from "../../features/tour/components/GuidedTour";
import { useFooterActionsMargin } from "../../hooks/useFooterActionsMargin";
import { WithTestID } from "../../types/WithTestID";
import { useIOAlertVisible } from "../StatusMessages/IOAlertVisibleContext";
import {
  ButtonBlockProps,
  ButtonBlockWithTourGuideProps
} from "./utils/buttons";
⋮----
export type IOScrollViewActions =
  | {
      primary: ButtonBlockWithTourGuideProps;
      secondary: ButtonBlockProps;
      tertiary: ButtonLinkProps;
      type: "ThreeButtons";
    }
  | {
      primary: ButtonBlockWithTourGuideProps;
      secondary: ButtonLinkProps;
      tertiary?: never;
      type: "TwoButtons";
    }
  | {
      primary: ButtonBlockWithTourGuideProps;
      secondary?: never;
      tertiary?: never;
      type: "SingleButton";
    };
⋮----
export type IOScrollViewProps = WithTestID<
  PropsWithChildren<{
    actions?: WithTestID<IOScrollViewActions>;
    alwaysBounceVertical?: boolean;
    animatedRef?: AnimatedRef<Animated.ScrollView>;
    centerContent?: boolean;
    contentContainerStyle?: ViewStyle;
    debugMode?: boolean;
    excludeEndContentMargin?: boolean;
    excludeSafeAreaMargins?: boolean;
    headerConfig?: ComponentProps<typeof HeaderSecondLevel>;
    includeContentMargins?: boolean;
    refreshControlProps?: RefreshControlProps;
    snapOffset?: number;
    topElement?: React.ReactNode;
  }>
>;
⋮----
type ButtonLinkProps = Omit<IOButtonLinkSpecificProps, "color" | "variant">;
⋮----
type IOSCrollViewHeaderScrollValues = ComponentProps<
  typeof HeaderSecondLevel
>["scrollValues"];
⋮----
const getActionBlockHeight = (event: LayoutChangeEvent) =>
</file>

<file path="apps/main-app/ts/components/ui/IOScrollViewCentredContent.tsx">
import {
  H3,
  IOButton,
  IODimensions,
  IOMarkdownLite,
  IOPictograms,
  Pictogram,
  VStack
} from "@io-app/design-system";
import { ComponentProps } from "react";
import { View } from "react-native";
⋮----
import {
  IOScrollView,
  IOScrollViewActions,
  IOScrollViewProps
} from "./IOScrollView";
⋮----
export type IOScrollViewCentredContentProps = Omit<
  IOScrollViewProps,
  "actions" | "centerContent"
> & {
  actions: IOScrollViewActions;
  additionalLink?: Pick<
    ComponentProps<typeof IOButton>,
    "accessibilityLabel" | "label" | "onPress" | "testID"
  >;
  description?: string;
  pictogram: IOPictograms;
  title: string;
};
</file>

<file path="apps/main-app/ts/components/ui/IOScrollViewWithLargeHeader.tsx">
import {
  BodySmall,
  ContentWrapper,
  H2,
  HeaderSecondLevel,
  IOMarkdownLite,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { ComponentProps, ReactNode, Ref, useMemo, useState } from "react";
import { LayoutChangeEvent, View } from "react-native";
import Animated, { AnimatedRef } from "react-native-reanimated";
⋮----
import {
  BackProps,
  HeaderActionsProps,
  useHeaderProps
} from "../../hooks/useHeaderProps";
import { WithTestID } from "../../types/WithTestID";
import { useIOAlertVisible } from "../StatusMessages/IOAlertVisibleContext";
import { IOScrollView } from "./IOScrollView";
⋮----
type LargeHeaderTitleProps = {
  accessibilityLabel?: string;
  label: string;
  section?: string;
  testID?: string;
};
⋮----
type Props = WithTestID<{
  actions?: ComponentProps<typeof IOScrollView>["actions"];
  alwaysBounceVertical?: boolean;
  animatedRef?: AnimatedRef<Animated.ScrollView>;
  canGoback?: boolean;
  children?: ReactNode;
  contentContainerStyle?: ComponentProps<
    typeof IOScrollView
  >["contentContainerStyle"];
  description?: string;
  excludeEndContentMargin?: boolean;
  goBack?: BackProps["goBack"];
  headerActionsProp?: HeaderActionsProps;
  ignoreAccessibilityCheck?: ComponentProps<
    typeof HeaderSecondLevel
  >["ignoreAccessibilityCheck"];
  ignoreSafeAreaMargin?: ComponentProps<
    typeof HeaderSecondLevel
  >["ignoreSafeAreaMargin"];
  includeContentMargins?: boolean;
  onDescriptionLinkPress?: (url: string) => void;
  ref?: Ref<View>;
  title: LargeHeaderTitleProps;
  topElement?: ReactNode;
}>;
⋮----
const getTitleHeight = (event: LayoutChangeEvent) =>
⋮----
</file>

<file path="apps/main-app/ts/components/ui/IOScrollViewWithListItems.tsx">
import {
  Divider,
  H2,
  IOMarkdownLite,
  ListItemHeader,
  ListItemInfo,
  VSpacer
} from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { IOScrollView, IOScrollViewActions } from "./IOScrollView";
⋮----
export type IOScrollViewWithListItems = {
  actions: IOScrollViewActions;
  isHeaderVisible?: boolean;
  listItemHeaderLabel?: string;
  renderItems: Array<ListItemInfo>;
  subtitle?: string;
  title?: string;
};
⋮----
const ItemsList = (
</file>

<file path="apps/main-app/ts/components/ui/LightModal.tsx">
import {
  createContext,
  PropsWithChildren,
  ReactNode,
  useCallback,
  useEffect,
  useMemo,
  useRef,
  useState
} from "react";
import {
  Animated,
  Dimensions,
  Easing,
  Modal,
  StyleSheet,
  View
} from "react-native";
⋮----
import { isScreenReaderEnabled } from "../../utils/accessibility";
export type LightModalContextInterface = Readonly<{
  component: ReactNode;
  hideModal: () => void;
  onHiddenModal: () => void;
  setOnHiddenModal: (callback: () => void) => void;
  showAnimatedModal: (
    component: ReactNode,
    animatedValue?: AnimationLightModal
  ) => void;
  showModal: (component: ReactNode) => void;
  showModalFadeInAnimation: (component: ReactNode) => void;
}>;
⋮----
type Props = Record<string, unknown>;
⋮----
const animationCallback = ()
⋮----
export type AnimationLightModal =
  | typeof BottomTopAnimation
  | typeof LeftRightAnimation
  | typeof RightLeftAnimation
  | typeof ScaleAnimation
  | typeof TopBottomAnimation;
⋮----
</file>

<file path="apps/main-app/ts/components/ui/LoadingIndicator.tsx">
import { LoadingSpinner } from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps } from "react";
⋮----
import { WithTestID } from "../../types/WithTestID";
⋮----
export type LoadingIndicator = WithTestID<
  Exclude<ComponentProps<typeof LoadingSpinner>, "color" | "duration" | "size">
>;
⋮----
export const LoadingIndicator = ({
  accessibilityHint = I18n.t("global.accessibility.activityIndicator.hint"),
  accessibilityLabel = I18n.t("global.accessibility.activityIndicator.label"),
  testID = "LoadingIndicator"
}: LoadingIndicator) => (
  <LoadingSpinner
    accessibilityHint={accessibilityHint}
    accessibilityLabel={accessibilityLabel}
    size={48}
    testID={testID}
  />
);
</file>

<file path="apps/main-app/ts/components/ui/LoadingSkeleton.tsx">
import { IOSkeleton, VStack } from "@io-app/design-system";
import I18n from "i18next";
import { DimensionValue, View } from "react-native";
⋮----
type LoadingSkeletonProps = {
  lines?: number;
  testID?: string;
};
</file>

<file path="apps/main-app/ts/components/ui/LogoPaymentExtended.tsx">
import I18n from "i18next";
⋮----
import BpayLogo from "../../../img/wallet/payment-methods/bpay_logo_full.svg";
import PaypalLogo from "../../../img/wallet/payment-methods/paypal/paypal_logo_ext.svg";
import { BankLogoOrSkeleton } from "../../features/payments/common/components/utils/BankLogoOrLoadingSkeleton";
export type LogoPaymentExtendedProps = (
  | {
      abiCode: string | undefined;
      icon?: never;
      imageA11yLabel?: string;
    }
  | {
      icon: "bpay" | "payPal";
    }
) & {
  dimensions: { height: number; width: number };
};
⋮----
export const LogoPaymentExtended = (props: LogoPaymentExtendedProps) =>
</file>

<file path="apps/main-app/ts/components/ui/ProgressIndicator.tsx">
import { ProgressLoader, useIOTheme } from "@io-app/design-system";
import { ComponentProps } from "react";
⋮----
export type ProgressIndicator = Exclude<
  ComponentProps<typeof ProgressLoader>,
  "color"
>;
⋮----
export const ProgressIndicator = (props: ProgressIndicator) =>
</file>

<file path="apps/main-app/ts/components/ui/TabIconComponent.tsx">
import { AnimatedIcon, IONavIcons } from "@io-app/design-system";
import { memo } from "react";
import { ColorValue, View } from "react-native";
⋮----
type TabIconComponent = {
  color?: ColorValue;
  focused: boolean;
  iconName: IONavIcons;
  iconNameFocused: IONavIcons;
};
</file>

<file path="apps/main-app/ts/components/AnimatedImage.tsx">
import { ComponentProps } from "react";
import { Image } from "react-native";
import Animated, {
  Easing,
  useAnimatedStyle,
  useSharedValue,
  withTiming
} from "react-native-reanimated";
⋮----
export type AnimatedImageProps = ComponentProps<typeof Image>;
⋮----
export const AnimatedImage = (
⋮----
const handleOnLoad = () =>
</file>

<file path="apps/main-app/ts/components/AppVersion.tsx">
import { BodySmall, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { GestureResponderEvent, Pressable, View } from "react-native";
⋮----
import { WithTestID } from "../types/WithTestID";
import { getAppVersion } from "../utils/appVersion";
⋮----
type AppVersion = WithTestID<{
  onPress: (event: GestureResponderEvent) => void;
}>;
</file>

<file path="apps/main-app/ts/components/CalendarList.tsx">
import { ContentWrapper, RadioGroup, RadioItem } from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { useIOSelector } from "../store/hooks";
import { preferredCalendarSelector } from "../store/reducers/persistedPreferences";
import { convertLocalCalendarName } from "../utils/calendar";
⋮----
type CalendarListProps = {
  calendars: Array<Calendar.Calendar>;
  isLoading: boolean;
  onCalendarSelected: (calendar: Calendar.Calendar) => void;
};
⋮----
const getCalendarsByAccount = (
  calendars: Array<Calendar.Calendar>
): Array<RadioItem<string>>
⋮----
const handleSelectCalendar = (calendarId: string)
</file>

<file path="apps/main-app/ts/components/CalendarsListContainer.tsx">
import {
  ListItemHeader,
  RadioGroup,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import _ from "lodash";
import { Fragment, memo, useCallback, useEffect, useState } from "react";
⋮----
import { useIOSelector } from "../store/hooks";
import { preferredCalendarSelector } from "../store/reducers/persistedPreferences";
⋮----
type CalendarByAccount = Readonly<{
  data: ReadonlyArray<Calendar.Calendar>;
  title: string;
}>;
⋮----
type CalendarsByAccount = ReadonlyArray<CalendarByAccount>;
⋮----
type FetchError = {
  kind: "FETCH_ERROR";
};
⋮----
type Props = {
  onCalendarRemove?: () => void;
  onCalendarSelected: (calendar: Calendar.Calendar) => void;
  onCalendarsLoaded: () => void;
};
⋮----
type ResourceError = FetchError;
⋮----
const getCalendarsByAccount = (calendars: ReadonlyArray<Calendar.Calendar>) =>
⋮----
const CalendarsListContainer = ({
  onCalendarSelected,
  onCalendarsLoaded,
  onCalendarRemove
}: Props) =>
⋮----
items=
</file>

<file path="apps/main-app/ts/components/Carousel.tsx">
import { IOScreenPadding, WithTestID } from "@io-app/design-system";
import {
  JSXElementConstructor,
  ReactElement,
  Ref,
  useCallback,
  useMemo
} from "react";
import {
  Dimensions,
  FlatList,
  FlatListProps,
  StyleSheet,
  View
} from "react-native";
⋮----
type Nullable<T> = null | T;
⋮----
type Props<T> = Pick<
  FlatListProps<T>,
  | "contentContainerStyle"
  | "decelerationRate"
  | "initialScrollIndex"
  | "keyExtractor"
  | "onViewableItemsChanged"
  | "pagingEnabled"
  | "scrollEnabled"
  | "snapToAlignment"
  | "style"
  | "viewabilityConfig"
> & {
  Component: JSXElementConstructor<T>;
  data: Array<T>;
  itemsGap?: 0 | IOScreenPadding;
  itemsPerTime?: number;
};
</file>

<file path="apps/main-app/ts/components/GifImage.tsx">
import { BodySmall, Icon, useIOTheme, VStack } from "@io-app/design-system";
import { useIsFocused } from "@react-navigation/native";
import {
  Image,
  ImageProps,
  ImageSourcePropType,
  Pressable,
  StyleSheet,
  View
} from "react-native";
import { useReducedMotion } from "react-native-reanimated";
⋮----
import { useAnimationPlayback } from "../hooks/useAnimationPlayback";
⋮----
type Props = Omit<ImageProps, "source"> & {
  autoPlay?: boolean;
  maxDurationMs?: number;
  pauseAccessibilityLabel: string;
  playAccessibilityLabel: string;
  source: ImageSourcePropType;
  staticSource: ImageSourcePropType;
};
⋮----
export const GifImage = (props: Props) =>
</file>

<file path="apps/main-app/ts/components/LandingCardComponent.tsx">
import {
  Body,
  ContentWrapper,
  H3,
  IOPictograms,
  Pictogram,
  VStack
} from "@io-app/design-system";
import { Ref } from "react";
import { ScrollView, useWindowDimensions, View } from "react-native";
⋮----
type Props = {
  accessibilityHint?: string;
  accessibilityLabel?: string;
  content: string;
  id: number;
  pictogramName: IOPictograms;
  ref?: Ref<View>;
  title: string;
};
</file>

<file path="apps/main-app/ts/components/ListItemSwipeAction.tsx">
import {
  ContentWrapper,
  IconButton,
  IOColors,
  IODimensions,
  IOSpringValues,
  triggerHaptic,
  useIOThemeContext
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import { memo, ReactNode, RefObject, useCallback, useMemo } from "react";
import { StyleSheet, useWindowDimensions } from "react-native";
import {
  Gesture,
  GestureDetector,
  GestureHandlerRootView
} from "react-native-gesture-handler";
import Animated, {
  SharedValue,
  useAnimatedStyle,
  useSharedValue,
  withSpring,
  withTiming
} from "react-native-reanimated";
import { scheduleOnRN, scheduleOnUI } from "react-native-worklets";
⋮----
type RightActionsProps = Pick<IconButton, "color" | "icon"> & {
  accessibilityLabel: string;
  onRightActionPressed: () => void;
  translateX: SharedValue<number>;
};
⋮----
export type SwipeControls = {
  resetSwipePosition: () => void;
  triggerSwipeAction: () => void;
};
⋮----
type ListItemSwipeActionProps = {
  accessibilityLabel?: string;
  children: ReactNode;
  color: IconButton["color"];
  icon: IconButton["icon"];
  onRightActionPressed: (controls: SwipeControls) => void;
  openedItemRef?: RefObject<(() => void) | null>;
};
⋮----
const ListItemSwipeAction = ({
  children,
  icon,
  color,
  accessibilityLabel = "",
  onRightActionPressed,
  openedItemRef
}: ListItemSwipeActionProps) =>
⋮----
const handleSwipeStart = () =>
⋮----
const handleSwipeEnd = () =>
</file>

<file path="apps/main-app/ts/components/LoadingSpinnerOverlay.tsx">
import {
  H3,
  hexToRgba,
  IOButton,
  IOColors,
  useIOTheme
} from "@io-app/design-system";
import I18n from "i18next";
import { ReactNode } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import BoxedRefreshIndicator from "./ui/BoxedRefreshIndicator";
⋮----
type Props = Readonly<{
  children?: ReactNode;
  isLoading: boolean;
  loadingCaption?: string;
  loadingOpacity?: number;
  onCancel?: () => void;
}>;
</file>

<file path="apps/main-app/ts/components/PagoPATestIndicator.tsx">
import { hexToRgba, Icon, IOColors } from "@io-app/design-system";
import { StyleSheet, Text, View } from "react-native";
</file>

<file path="apps/main-app/ts/components/PagoPATestIndicatorOverlay.tsx">
import { StyleSheet } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import PagoPATestIndicator from "./PagoPATestIndicator";
⋮----
const PagoPATestIndicatorOverlay = () => (
  <SafeAreaView pointerEvents="box-none" style={styles.indicatorContainer}>
    <PagoPATestIndicator />
  </SafeAreaView>
);
</file>

<file path="apps/main-app/ts/components/QrCodeImage.tsx">
import { IOColors, IOSkeleton } from "@io-app/design-system";
import { memo, useMemo } from "react";
import { useWindowDimensions, View } from "react-native";
import QRCode, { QRCodeProps } from "react-native-qrcode-svg";
⋮----
export type QrCodeImageProps = {
  accessibilityLabel?: string;
  backgroundColor?: string;
  color?: string;
  correctionLevel?: QRCodeProps["ecl"];
  inverted?: boolean;
  onError?: (error: Error) => void;
  size?: `${number}%` | number;
  value?: string;
};
</file>

<file path="apps/main-app/ts/components/RotationSensor.tsx">
import { ReactNode } from "react";
import { SharedValue } from "react-native-reanimated";
⋮----
import { useRotationSensor } from "../hooks/useRotationSensor";
⋮----
type RenderRoll = (roll?: SharedValue<number>) => ReactNode;
⋮----
type RotationSensorProps = {
  children: RenderRoll;
  enabled: boolean;
};
⋮----
const SensorRoll = (
⋮----
export const RotationSensor = (
</file>

<file path="apps/main-app/ts/components/TouchableDefaultOpacity.tsx">
import { ComponentPropsWithRef, FunctionComponent } from "react";
import { TouchableOpacity, TouchableOpacityProps } from "react-native";
⋮----
type TouchableDefaultOpacityProps = ComponentPropsWithRef<
  TouchableOpacityProps & typeof TouchableOpacity
>;
⋮----
const TouchableDefaultOpacity: FunctionComponent<
  TouchableDefaultOpacityProps
> = props => (
  <TouchableOpacity
    {...{
      ...props,
      activeOpacity: props.activeOpacity || defaultActiveOpacity
    }}
  >
    {props.children}
  </TouchableOpacity>
);
</file>

<file path="apps/main-app/ts/components/UpdateAppAlert.tsx">
import { HeaderActionProps, HeaderSecondLevel } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { useStartSupportRequest } from "../hooks/useStartSupportRequest";
import { useIONavigation } from "../navigation/params/AppParamsList";
import { useOnFirstRender } from "../utils/hooks/useOnFirstRender";
import { openAppStoreUrl } from "../utils/url";
import { RequiredUpdateMixPanelTracking } from "./helpers/withAppRequiredUpdate";
import { OperationResultScreenContent } from "./screens/OperationResultScreenContent";
⋮----
type Props = {
  mixPanelTracking?: RequiredUpdateMixPanelTracking;
};
</file>

<file path="apps/main-app/ts/components/WebviewComponent.tsx">
import I18n from "i18next";
import { createRef, useEffect, useState } from "react";
import WebView from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent,
  WebViewSourceUri
} from "react-native-webview/lib/WebViewTypes";
⋮----
import { mixpanelTrack } from "../mixpanel";
import { resetDebugData, setDebugData } from "../store/actions/debug";
import { useIODispatch } from "../store/hooks";
import LoadingSpinnerOverlay from "./LoadingSpinnerOverlay";
import { OperationResultScreenContent } from "./screens/OperationResultScreenContent";
⋮----
type Props = {
  playgroundEnabled?: boolean;
  source: WebViewSourceUri;
};
⋮----
const handleReload = () =>
⋮----
const handleError = (event: WebViewErrorEvent | WebViewHttpErrorEvent) =>
</file>

<file path="apps/main-app/ts/features/appearanceSettings/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type AppearanceSettingsActions = ActionType<
  typeof setShowAppearanceSettingsBanner
>;
</file>

<file path="apps/main-app/ts/features/appearanceSettings/store/reducers/__test__/index.test.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { createStore } from "redux";
import { persistStore } from "redux-persist";
⋮----
import {
  appearanceSettingsReducerInitialState,
  appearanceSettingsReducerPersistor,
  AppearanceSettingsState
} from "..";
import { differentProfileLoggedIn } from "../../../../../store/actions/crossSessions";
import { setShowAppearanceSettingsBanner } from "../../actions";
</file>

<file path="apps/main-app/ts/features/appearanceSettings/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { differentProfileLoggedIn } from "../../../../store/actions/crossSessions";
import { Action } from "../../../../store/actions/types";
import { setShowAppearanceSettingsBanner } from "../actions";
⋮----
export type AppearanceSettingsState = {
  showAppearanceBanner: boolean;
};
⋮----
const appearanceSettingsReducer = (
  state: AppearanceSettingsState = appearanceSettingsReducerInitialState,
  action: Action
): AppearanceSettingsState =>
</file>

<file path="apps/main-app/ts/features/appearanceSettings/store/selectors/__test__/index.test.ts">
import { settingsBannerToShowSelector } from "..";
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
const getState = (notifs: boolean, appearanceBanner: boolean)
</file>

<file path="apps/main-app/ts/features/appearanceSettings/store/selectors/index.ts">
import { GlobalState } from "../../../../store/reducers/types";
import { areNotificationPermissionsEnabledSelector } from "../../../pushNotifications/store/reducers/environment";
⋮----
export const showAppearanceSettingsBannerSelector = (state: GlobalState)
⋮----
export const settingsBannerToShowSelector = (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/appReviews/analytics/index.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
⋮----
export const trackAppReviewRequestAttempt = ()
⋮----
export const trackAppReviewRequestFailure = ()
</file>

<file path="apps/main-app/ts/features/appReviews/components/AppFeedbackProvider.tsx">
import {
  Body,
  FooterActions,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import { openAuthSessionAsync } from "expo-web-browser";
import I18n from "i18next";
import {
  createContext,
  PropsWithChildren,
  useContext,
  useEffect,
  useMemo,
  useState
} from "react";
import { Alert } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import {
  appFeedbackEnabledSelector,
  appFeedbackUriConfigSelector
} from "../../../store/reducers/backendStatus/remoteConfig";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { isAndroid } from "../../../utils/platform";
import {
  appReviewNegativeFeedback,
  appReviewPositiveFeedback,
  TopicKeys
} from "../store/actions";
import { canAskFeedbackSelector } from "../store/selectors";
import { requestAppReview } from "../utils/storeReview";
⋮----
type AppFeedbackContextType = {
  requestFeedback: (topic: TopicKeys) => void;
};
⋮----
export const useAppFeedbackContext = ()
</file>

<file path="apps/main-app/ts/features/appReviews/store/actions/index.ts">
import { AppFeedbackUri } from "@io-app/api-types/generated/definitions/content/AppFeedbackUri";
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type TopicKeys = keyof AppFeedbackUri;
⋮----
export type AppFeedbackActions =
  | ActionType<typeof appReviewNegativeFeedback>
  | ActionType<typeof appReviewPositiveFeedback>
  | ActionType<typeof clearFeedbackDatas>;
</file>

<file path="apps/main-app/ts/features/appReviews/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import {
  logoutFailure,
  logoutSuccess
} from "../../../authentication/common/store/actions";
import {
  appReviewNegativeFeedback,
  appReviewPositiveFeedback,
  clearFeedbackDatas,
  TopicKeys
} from "../actions";
⋮----
export type AppFeedbackState = {
  negativeFeedbackDate:
    | Record<string, never>
    | Record<TopicKeys, string | undefined>;
  positiveFeedbackDate: string;
};
⋮----
const appFeedbackReducer = (
  state: AppFeedbackState = appFeedbackInitialState,
  action: Action
): AppFeedbackState =>
</file>

<file path="apps/main-app/ts/features/appReviews/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../store/reducers/types";
import { checkFourMonthPeriod } from "../../utils/date";
import { TopicKeys } from "../actions";
⋮----
export const appFeedbackSelector = (state: GlobalState)
⋮----
export const appReviewPositiveFeedbackLogSelector = (state: GlobalState)
⋮----
export const appReviewNegativeFeedbackLogSelector =
(topic: TopicKeys)
⋮----
export const canAskFeedbackSelector = (topic: TopicKeys = "general")
</file>

<file path="apps/main-app/ts/features/appReviews/utils/date.ts">
import { addMonths, isPast } from "date-fns";
⋮----
export const checkFourMonthPeriod = (date?: string) =>
</file>

<file path="apps/main-app/ts/features/appReviews/utils/storeReview.ts">
import {
  trackAppReviewRequestAttempt,
  trackAppReviewRequestFailure
} from "../analytics";
⋮----
export const requestAppReview = async () =>
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/analytics/__test__/index.test.ts">
import { helpCenterHowToDoWhenSessionIsExpiredUrl } from "../../../../../config";
⋮----
import { MESSAGES_ROUTES } from "../../../../messages/navigation/routes";
import {
  BANNER_ID,
  trackLoginExpirationBannerClosure,
  trackLoginExpirationBannerPrompt,
  trackLoginExpirationBannerTap
} from "../../analytics";
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
⋮----
export function trackLoginExpirationBannerClosure(banner_landing: string)
⋮----
export function trackLoginExpirationBannerPrompt(banner_landing: string)
⋮----
export function trackLoginExpirationBannerTap(banner_landing: string)
⋮----
export function trackSessionCorrupted()
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/components/__test__/LoginExpirationBanner.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../../store/reducers";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
⋮----
import { LoginExpirationBanner } from "../LoginExpirationBanner";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/components/LoginExpirationBanner.tsx">
import { Banner, IODimensions, useIOToast } from "@io-app/design-system";
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { helpCenterHowToDoWhenSessionIsExpiredUrl } from "../../../../config";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { trackHelpCenterCtaTapped } from "../../../../utils/analytics";
import { openWebUrl } from "../../../../utils/url";
import { SETTINGS_ROUTES } from "../../../settings/common/navigation/routes";
import {
  closeSessionExpirationBanner,
  setStartActiveSessionLogin
} from "../../activeSessionLogin/store/actions";
import { isActiveSessionLoginEnabledSelector } from "../../activeSessionLogin/store/selectors";
import { AUTHENTICATION_ROUTES } from "../../common/navigation/routes";
import { formattedExpirationDateSelector } from "../../common/store/selectors";
import {
  BANNER_ID,
  trackLoginExpirationBannerClosure,
  trackLoginExpirationBannerPrompt,
  trackLoginExpirationBannerTap
} from "../analytics";
⋮----
type Props = {
  handleOnClose: () => void;
};
⋮----
export const LoginExpirationBanner = (
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/saga/forceLogoutActiveSessionLoginSaga.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put, select, takeLatest } from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import { sessionManagerClientManager } from "../../../../api/SessionManagerClientManager";
import { apiUrlPrefix } from "../../../../config";
import { resetMixpanelSaga } from "../../../../sagas/mixpanel";
import { startApplicationInitialization } from "../../../../store/actions/application";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../../types/utils";
import { convertUnknownToError } from "../../../../utils/errors";
import { resetAssistanceData } from "../../../../utils/supportAssistance";
import { deleteCurrentLollipopKeyAndGenerateNewKeyTag } from "../../../lollipop/saga";
import {
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../../../messages/analytics";
import { trackLogoutFailure, trackLogoutSuccess } from "../../common/analytics";
import { sessionCorrupted } from "../../common/store/actions";
import { sessionTokenSelector } from "../../common/store/selectors";
import {
  logoutBeforeSessionCorrupted,
  setFinalizeLoggedOutUserWithDifferentCF,
  setLoggedOutUserWithDifferentCF
} from "../store/actions";
import { cieLoginFlowSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/saga/index.ts">
import { StackActions } from "@react-navigation/native";
import {
  call,
  fork,
  put,
  race,
  select,
  take,
  takeLatest
} from "typed-redux-saga/macro";
import { getType } from "typesafe-actions";
⋮----
import { updateMixpanelSuperProperties } from "../../../../mixpanelConfig/superProperties";
import NavigationService from "../../../../navigation/NavigationService";
import ROUTES from "../../../../navigation/routes";
import {
  analyticsAuthenticationCompleted,
  analyticsAuthenticationStarted
} from "../../../../store/actions/analytics";
import { startApplicationInitialization } from "../../../../store/actions/application";
import { GlobalState } from "../../../../store/reducers/types";
import { ReduxSagaEffect } from "../../../../types/utils";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
import {
  trackCieIDLoginSuccess,
  trackCieLoginSuccess,
  trackSpidLoginSuccess
} from "../../common/analytics";
import { updateLoginMethodProfileAndSuperProperties } from "../../common/analytics/spidAnalytics";
import { isOneIdentityLoginEnabledSelector } from "../../common/store/selectors/loginConfig";
import { updateLoginSessionProfileAndSuperProperties } from "../../fastLogin/analytics/optinAnalytics";
import { watchCieAuthenticationSaga } from "../../login/cie/sagas/cie";
import { IdpCIE, IdpCIE_ID } from "../../login/hooks/useNavigateToLoginMethod";
import {
  activeSessionLoginFailure,
  activeSessionLoginSuccess,
  consolidateActiveSessionLoginData,
  setRetryActiveSessionLogin,
  setStartActiveSessionLogin
} from "../store/actions";
import {
  activeSessionLoginFlowSelector,
  cieIDSelectedSecurityLevelActiveSessionLoginSelector,
  cieLoginFlowSelector,
  idpSelectedActiveSessionLoginSelector,
  isActiveSessionFastLoginEnabledSelector,
  newTokenActiveSessionLoginSelector
} from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/saga/navigateToActiveSessionLogin.ts">
import { StackActions } from "@react-navigation/native";
import { call, put } from "typed-redux-saga/macro";
⋮----
import NavigationService from "../../../../navigation/NavigationService";
import { SETTINGS_ROUTES } from "../../../settings/common/navigation/routes";
import { AUTHENTICATION_ROUTES } from "../../common/navigation/routes";
import { setStartActiveSessionLogin } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/screens/analytics/index.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { buildEventProperties } from "../../../../../utils/analytics";
import { SpidIdp } from "../../../../../utils/idps";
import { LoginType } from "../../../common/utils";
⋮----
export function trackLoginReauthEngagement()
⋮----
export function trackLoginReauthEngagementCieSelected()
⋮----
export function trackLoginReauthEngagementDismissed()
⋮----
export function trackLoginReauthEngagementSpidSelected()
⋮----
export function trackLoginWithNewCF()
⋮----
export function trackLoginWithNewCFConfirm()
⋮----
export function trackSpidLoginIntent(
  idpName: SpidIdp | undefined,
  flow: LoginType = "auth"
)
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/screens/cie/ActiveSessionLoginCieCardReaderScreen.tsx">
import {
  Body,
  ContentWrapper,
  H3,
  IOButton,
  IOColors,
  IOPictograms,
  triggerHaptic,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import cieManager, { Event as CEvent } from "@pagopa/react-native-cie";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import {
  AccessibilityInfo,
  Platform,
  ScrollView,
  StyleSheet,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { isScreenReaderEnabledSelector } from "../../../../../store/reducers/preferences";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { isDevEnv } from "../../../../../utils/environment";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import {
  assistanceToolRemoteConfig,
  handleSendAssistanceLog
} from "../../../../../utils/supportAssistance";
import {
  trackLoginCieCardReaderScreen,
  trackLoginCieCardReadingError,
  trackLoginCieCardReadingSuccess
} from "../../../common/analytics/cieAnalytics";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import {
  accessibityTimeout,
  cieErrorMessagesMap,
  WAIT_TIMEOUT_NAVIGATION,
  WAIT_TIMEOUT_NAVIGATION_ACCESSIBILITY
} from "../../../common/utils/constants";
import { ReauthLoginType } from "../../../common/utils/index";
import CieCardReadingAnimation, {
  ReadingState
} from "../../../login/cie/components/CieCardReadingAnimation";
import {
  cieAuthenticationError,
  CieAuthenticationErrorReason
} from "../../../login/cie/store/actions";
import { isCieLoginUatEnabledSelector } from "../../../login/cie/store/selectors";
import { getCieUatEndpoint } from "../../../login/cie/utils/endpoints";
import { getTextForState, TextForState } from "../../shared/utils";
⋮----
export type ActiveSessionCieCardReaderScreenNavigationParams = {
  authorizationUri: string;
  ciePin: string;
  loginType: ReauthLoginType;
};
⋮----
const getPictogramName = (state: ReadingState): IOPictograms =>
⋮----
type ActiveSessionLoginCieCardReaderScreenProps = IOStackNavigationRouteProps<
  AuthenticationParamsList,
  "CIE_CARD_READER_SCREEN_ACTIVE_SESSION_LOGIN"
>;
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/screens/cie/ActiveSessionLoginCieConsentDataUsageScreen.tsx">
import { Route, StackActions, useRoute } from "@react-navigation/native";
import { useCallback, useState } from "react";
import { SafeAreaView } from "react-native-safe-area-context";
import WebView from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent,
  WebViewNavigation
} from "react-native-webview/lib/WebViewTypes";
⋮----
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../../navigation/routes";
import { useIODispatch } from "../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { MESSAGES_ROUTES } from "../../../../messages/navigation/routes";
import { trackLoginFailure } from "../../../common/analytics";
import {
  trackLoginCieConsentDataUsageScreen,
  trackLoginCieDataSharingError
} from "../../../common/analytics/cieAnalytics";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import {
  AUTH_LEVELS,
  onLoginUriChanged,
  originSchemasWhiteList
} from "../../../common/utils";
import { AUTH_ERRORS } from "../../../common/utils/authError";
import { ReauthLoginType } from "../../../common/utils/index";
import { LoaderComponent } from "../../shared/components/LoaderComponent";
import { ACS_PATH } from "../../shared/utils";
import {
  activeSessionLoginFailure,
  activeSessionLoginSuccess,
  setFinishedActiveSessionLoginFlow
} from "../../store/actions";
import useActiveSessionLoginNavigation from "../../utils/useActiveSessionLoginNavigation";
⋮----
export type ActiveSessionLoginCieConsentDataUsageScreenNavigationParams = {
  cieConsentUri: string;
  errorCodeDebugMode?: string;
  loginType: ReauthLoginType;
};
⋮----
const navigateBack = () =>
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/screens/cie/OneIdentityActiveSessionLoginCieAuthorizationWebView.tsx">
import { useNavigation } from "@react-navigation/native";
import { useCallback } from "react";
⋮----
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../../navigation/routes";
import { useIODispatch } from "../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { MESSAGES_ROUTES } from "../../../../messages/navigation/routes";
import { trackLoginFailure } from "../../../common/analytics";
import {
  trackLoginCieConsentDataUsageScreen,
  trackLoginCieDataSharingError
} from "../../../common/analytics/cieAnalytics";
import {
  CieWebViewLogin,
  CieWebViewLoginEvent
} from "../../../common/components/CieWebViewLogin";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import {
  AUTH_LEVELS,
  isValidCallbackUrl,
  LOGIN_TYPES
} from "../../../common/utils";
import { AUTH_ERRORS } from "../../../common/utils/authError";
import { LoginFailureData } from "../../../common/utils/loginErrorDebugInfo";
import {
  activeSessionLoginFailure,
  activeSessionLoginSuccess,
  logoutBeforeSessionCorrupted,
  setFinishedActiveSessionLoginFlow
} from "../../store/actions";
⋮----
type OneIdentityActiveSessionLoginCieAuthorizationWebViewProps = {
  authorizationUrl: string;
};
⋮----
export const OneIdentityActiveSessionLoginCieAuthorizationWebView = ({
  authorizationUrl
}: OneIdentityActiveSessionLoginCieAuthorizationWebViewProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/screens/cieId/ActiveSessionCieIdLoginScreen.tsx">
import { openCieIdApp } from "@pagopa/io-react-native-cieid";
import { StackActions } from "@react-navigation/native";
import { useCallback, useEffect, useRef, useState } from "react";
import { Linking, Platform, StyleSheet } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { URL } from "react-native-url-polyfill";
import WebView, { type WebViewNavigation } from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent
} from "react-native-webview/lib/WebViewTypes";
⋮----
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { useLollipopLoginSource } from "../../../../lollipop/hooks/useLollipopLoginSource";
import { trackLoginFailure } from "../../../common/analytics";
import { trackLoginSpidError } from "../../../common/analytics/spidAnalytics";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import {
  AUTH_LEVELS,
  onLoginUriChanged,
  originSchemasWhiteList
} from "../../../common/utils";
import { AUTH_ERRORS } from "../../../common/utils/authError";
import {
  defaultUserAgent,
  WHITELISTED_DOMAINS
} from "../../../common/utils/cie";
import { LoadingOverlay } from "../../../login/cie/shared/LoadingSpinnerOverlay";
import { isCieLoginUatEnabledSelector } from "../../../login/cie/store/selectors";
import {
  getCieIdEnvironment,
  getCieIDLoginUri,
  isAuthenticationUrl
} from "../../../login/cie/utils";
import {
  CIE_ID_ERROR,
  CIE_ID_ERROR_MESSAGE,
  IO_LOGIN_CIE_SOURCE_APP,
  IO_LOGIN_CIE_URL_SCHEME
} from "../../../login/cie/utils/cie";
import { IdpCIE_ID } from "../../../login/hooks/useNavigateToLoginMethod";
import { ACS_PATH } from "../../shared/utils";
import {
  activeSessionLoginFailure,
  activeSessionLoginSuccess,
  setFinishedActiveSessionLoginFlow
} from "../../store/actions";
import {
  cieIDSelectedSecurityLevelActiveSessionLoginSelector,
  remoteApiLoginUrlPrefixSelector
} from "../../store/selectors";
import useActiveSessionLoginNavigation from "../../utils/useActiveSessionLoginNavigation";
⋮----
const ActiveSessionCieIdLoginScreen = () =>
⋮----
const handleOnShouldStartLoadWithRequest = (
    event: WebViewNavigation
): boolean =>
⋮----
// TODO: evaluate if use this screen in this task https://pagopa.atlassian.net/browse/IOPID-3574
// if (activeSessionUserLogged) {
//   return <IdpSuccessfulAuthentication />;
// }
⋮----
renderLoading=
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/screens/cieId/OneIdentityActiveSessionCieIdLoginScreen.tsx">
import { useCallback } from "react";
⋮----
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { trackLoginFailure } from "../../../common/analytics";
import { trackLoginSpidError } from "../../../common/analytics/spidAnalytics";
import {
  CieIdWebViewLogin,
  CieIdWebViewLoginEvent
} from "../../../common/components/CieIdWebViewLogin";
import { useCieIdWebViewLoginNavigation } from "../../../common/hooks/useCieIdWebViewLoginNavigation";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import {
  AUTH_LEVELS,
  isValidCallbackUrl,
  LOGIN_TYPES
} from "../../../common/utils";
import { AUTH_ERRORS } from "../../../common/utils/authError";
import { CANCELLED_LOGIN_FAILURE_DATA } from "../../../common/utils/loginErrorDebugInfo";
import { isCieLoginUatEnabledSelector } from "../../../login/cie/store/selectors";
import { IdpCIE_ID } from "../../../login/hooks/useNavigateToLoginMethod";
import {
  activeSessionLoginFailure,
  activeSessionLoginSuccess,
  setFinishedActiveSessionLoginFlow
} from "../../store/actions";
import { cieIDSelectedSecurityLevelActiveSessionLoginSelector } from "../../store/selectors";
import useActiveSessionLoginNavigation from "../../utils/useActiveSessionLoginNavigation";
⋮----
type OneIdentityActiveSessionCieIdLoginScreenProps =
  IOStackNavigationRouteProps<
    AuthenticationParamsList,
    typeof AUTHENTICATION_ROUTES.CIE_ID_ACTIVE_SESSION_LOGIN
  >;
⋮----
export const OneIdentityActiveSessionCieIdLoginScreen = ({
  navigation
}: OneIdentityActiveSessionCieIdLoginScreenProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/screens/spid/ActiveSessionIdpLoginScreen.tsx">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
⋮----
import { useNavigation } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import _isEqual from "lodash/isEqual";
import { memo, useCallback, useEffect, useMemo, useState } from "react";
import { Linking, StyleSheet, View } from "react-native";
import { WebView } from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent,
  WebViewNavigation
} from "react-native-webview/lib/WebViewTypes";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
import { LoadingIndicator } from "../../../../../components/ui/LoadingIndicator";
import {
  HeaderSecondLevelHookProps,
  useHeaderSecondLevel
} from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import {
  assistanceToolRemoteConfig,
  handleSendAssistanceLog
} from "../../../../../utils/supportAssistance";
import { getUrlBasepath } from "../../../../../utils/url";
import { useLollipopLoginSource } from "../../../../lollipop/hooks/useLollipopLoginSource";
import { trackLoginFailure } from "../../../common/analytics";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { idpLoginUrlChanged } from "../../../common/store/actions";
import {
  AUTH_LEVELS,
  getIdpLoginUri,
  getIntentFallbackUrl,
  onLoginUriChanged,
  originSchemasWhiteList
} from "../../../common/utils";
import { AUTH_ERRORS } from "../../../common/utils/authError";
import { usePosteIDApp2AppEducational } from "../../../login/idp/hooks/usePosteIDApp2AppEducational";
import { ErrorType as SpidLoginErrorType } from "../../../login/idp/store/types";
import { getSpidErrorCodeDescription } from "../../../login/idp/utils/spidErrorCode";
import { ACS_PATH } from "../../shared/utils";
import {
  activeSessionLoginFailure,
  activeSessionLoginSuccess
} from "../../store/actions";
import {
  activeSessionUserLoggedSelector,
  idpSelectedActiveSessionLoginSelector,
  remoteApiLoginUrlPrefixSelector
} from "../../store/selectors";
import useActiveSessionLoginNavigation from "../../utils/useActiveSessionLoginNavigation";
import { trackSpidLoginIntent } from "../analytics";
⋮----
const renderMask = () =>
⋮----
// Wrapped with `useMemo` to prevent unnecessary re-renders, it seemed to cause bugs when attempting to open certain Idps.
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/screens/spid/OneIdentityActiveSessionIdpLoginScreen.tsx">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { LoadingScreenContent } from "../../../../../components/screens/LoadingScreenContent";
import {
  HeaderSecondLevelHookProps,
  useHeaderSecondLevel
} from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { SpidIdp } from "../../../../../utils/idps";
import { trackLoginFailure } from "../../../common/analytics";
import {
  IdpWebViewLogin,
  WebViewLoginEvent
} from "../../../common/components/IdpWebViewLogin";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import {
  AUTH_LEVELS,
  isValidCallbackUrl,
  LOGIN_TYPES
} from "../../../common/utils";
import { AUTH_ERRORS } from "../../../common/utils/authError";
import {
  FailureData,
  LoginFailureData
} from "../../../common/utils/loginErrorDebugInfo";
import {
  activeSessionLoginFailure,
  activeSessionLoginSuccess
} from "../../store/actions";
import {
  activeSessionUserLoggedSelector,
  idpSelectedActiveSessionLoginSelector
} from "../../store/selectors";
import useActiveSessionLoginNavigation from "../../utils/useActiveSessionLoginNavigation";
⋮----
export const OneIdentityActiveSessionIdpLoginScreen = () =>
⋮----
type OneIdentityActiveSessionIdpLoginScreenContentProps = {
  idp: SpidIdp;
};
⋮----
const OneIdentityActiveSessionIdpLoginScreenContent = ({
  idp
}: OneIdentityActiveSessionIdpLoginScreenContentProps) =>
⋮----
// `replace` drops the failed login webview, so it doesn't stay
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/screens/ActiveSessionLandingScreen.tsx">
import {
  ContentWrapper,
  HeaderSecondLevel,
  IOButton,
  VSpacer
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useLayoutEffect, useRef } from "react";
import { View } from "react-native";
import {
  SafeAreaView,
  useSafeAreaInsets
} from "react-native-safe-area-context";
⋮----
import SectionStatusComponent from "../../../../components/SectionStatus";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../utils/accessibility";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { useCieLoginMethodSelection } from "../../common/hooks/useCieLoginMethodSelection";
import { LOGIN_TYPES } from "../../common/utils";
import { isCieLoginUatEnabledSelector } from "../../login/cie/store/selectors";
import useNavigateToLoginMethod from "../../login/hooks/useNavigateToLoginMethod";
import { LandingSessionExpiredComponent } from "../../login/landing/components/LandingSessionExpiredComponent";
import { setActiveSessionLoginBlockingScreenHasBeenVisualized } from "../store/actions";
import {
  trackLoginReauthEngagement,
  trackLoginReauthEngagementCieSelected,
  trackLoginReauthEngagementDismissed,
  trackLoginReauthEngagementSpidSelected
} from "./analytics";
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/screens/DifferentCFErrorScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { startApplicationInitialization } from "../../../../store/actions/application";
import { startupLoadSuccess } from "../../../../store/actions/startup";
import { useIODispatch } from "../../../../store/hooks";
import { StartupStatusEnum } from "../../../../store/reducers/startup";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { setLoggedOutUserWithDifferentCF } from "../store/actions";
import { trackLoginWithNewCF, trackLoginWithNewCFConfirm } from "./analytics";
⋮----
export const DifferentCFErrorScreen = () =>
⋮----
const handleNavigateToLandingScreen = () =>
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/shared/components/LoaderComponent.tsx">
import { VSpacer } from "@io-app/design-system";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
⋮----
export const LoaderComponent = () => (
  <LoadingSpinnerOverlay isLoading={true} loadingOpacity={1.0}>
    <VSpacer size={16} />
  </LoadingSpinnerOverlay>
);
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/shared/utils/index.tsx">
import I18n from "i18next";
import { Platform } from "react-native";
⋮----
import { ReadingState } from "../../../login/cie/components/CieCardReadingAnimation";
⋮----
export type TextForState = {
  content: string;
  subtitle?: string;
  title: string;
};
⋮----
export const getTextForState = (
  state: ReadingState.error | ReadingState.waiting_card,
  errorMessage = ""
): TextForState =>
⋮----
// the native alert hides the screen content and shows a message it self
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/shared/CieContentDataUsageCommonSuite.tsx">
import type { WebViewHttpErrorEvent } from "react-native-webview/lib/WebViewTypes";
⋮----
import { StackActions } from "@react-navigation/native";
import { act, fireEvent, RenderAPI } from "@testing-library/react-native";
⋮----
import { AUTHENTICATION_ROUTES } from "../../common/navigation/routes";
import { AUTH_LEVELS } from "../../common/utils";
⋮----
export type ConsentSuiteConfig = {
  makeHttpError: () => WebViewHttpErrorEvent;
  mockNavigation: {
    dispatch: jest.Mock;
    navigate: jest.Mock;
    replace: jest.Mock;
  };
  name: string;
  onLoginUriChangedSpy: jest.SpyInstance;
  render: () => RenderAPI;
};
⋮----
export const runConsentScreenSuite = (cfg: ConsentSuiteConfig) =>
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { SpidIdp } from "../../../../../utils/idps";
import { AuthLevel } from "../../../common/utils";
import { ActiveSessionLoginState } from "../reducer";
⋮----
export type LoginInfoActions =
  | ActionType<typeof activeSessionLoginFailure>
  | ActionType<typeof activeSessionLoginSuccess>
  | ActionType<typeof closeSessionExpirationBanner>
  | ActionType<typeof consolidateActiveSessionLoginData>
  | ActionType<typeof logoutBeforeSessionCorrupted>
  | ActionType<typeof setActiveSessionLoginBlockingScreenHasBeenVisualized>
  | ActionType<typeof setActiveSessionLoginFlow>
  | ActionType<typeof setActiveSessionLoginLocalFlag>
  | ActionType<typeof setCieIDSelectedSecurityLevelActiveSessionLogin>
  | ActionType<typeof setFastLoginOptSessionLogin>
  | ActionType<typeof setFinalizeLoggedOutUserWithDifferentCF>
  | ActionType<typeof setFinishedActiveSessionLoginFlow>
  | ActionType<typeof setIdpSelectedActiveSessionLogin>
  | ActionType<typeof setLoggedOutUserWithDifferentCF>
  | ActionType<typeof setRetryActiveSessionLogin>
  | ActionType<typeof setStartActiveSessionLogin>;
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/store/reducer/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { isTestEnv } from "../../../../../utils/environment";
import { SpidIdp } from "../../../../../utils/idps";
import {
  logoutFailure,
  logoutSuccess,
  sessionCorrupted
} from "../../../common/store/actions";
import { AuthLevel } from "../../../common/utils";
import { SpidLoginRequestInfo } from "../../../login/idp/store/types";
import {
  activeSessionLoginFailure,
  activeSessionLoginSuccess,
  closeSessionExpirationBanner,
  consolidateActiveSessionLoginData,
  setActiveSessionLoginBlockingScreenHasBeenVisualized,
  setActiveSessionLoginFlow,
  setActiveSessionLoginLocalFlag,
  setCieIDSelectedSecurityLevelActiveSessionLogin,
  setFastLoginOptSessionLogin,
  setFinishedActiveSessionLoginFlow,
  setIdpSelectedActiveSessionLogin,
  setLoggedOutUserWithDifferentCF,
  setStartActiveSessionLogin
} from "../actions";
⋮----
export type ActiveSessionLoginState = {
  activeSessionLoginLocalFlag: boolean;
  engagement: {
    hasBlockingScreenBeenVisualized: boolean;
    showSessionExpirationBanner: boolean;
  };
  flow?: "FCI";
  isActiveSessionLogin: boolean;
  isUserLoggedIn: boolean;
  loginInfo?: {
    cieIDSelectedSecurityLevel?: AuthLevel;
    fastLoginOptIn?: boolean;
    idp?: SpidIdp;
    spidLoginInfo?: SpidLoginRequestInfo;
    token?: string;
  };
};
⋮----
const activeSessionLoginReducer = (
  state: ActiveSessionLoginState = activeSessionLoginInitialState,
  action: Action
): ActiveSessionLoginState =>
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/store/selectors/index.ts">
import { differenceInDays } from "date-fns";
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
⋮----
import { apiLoginUrlPrefix } from "../../../../../config";
import { remoteConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { isMinAppVersionSupported } from "../../../../../store/reducers/featureFlagWithMinAppVersionStatus";
import { GlobalState } from "../../../../../store/reducers/types";
import { sessionInfoSelector } from "../../../common/store/selectors";
import { LoginType } from "../../../common/utils";
import { isFastLoginEnabledSelector } from "../../../fastLogin/store/selectors";
⋮----
export const isActiveSessionLoginLocallyEnabledSelector = (
  state: GlobalState
)
⋮----
export const isActiveSessionLoginSelector = (state: GlobalState)
⋮----
export const activeSessionUserLoggedSelector = (state: GlobalState)
⋮----
export const idpSelectedActiveSessionLoginSelector = (state: GlobalState)
⋮----
export const newTokenActiveSessionLoginSelector = (state: GlobalState)
⋮----
export const isActiveSessionFastLoginEnabledSelector = (state: GlobalState)
⋮----
export const activeSessionLoginFlowSelector = (state: GlobalState)
⋮----
export const cieLoginFlowSelector = (state: GlobalState): LoginType =>
⋮----
export const cieIDSelectedSecurityLevelActiveSessionLoginSelector = (
  state: GlobalState
)
⋮----
export const activeSessionLoginInfoSelector = (state: GlobalState)
⋮----
export const hasBlockingScreenBeenVisualizedSelector = (state: GlobalState)
⋮----
export const showSessionExpirationBannerSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/authentication/activeSessionLogin/utils/useActiveSessionLoginNavigation.tsx">
import { useCallback } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
import { AUTHENTICATION_ROUTES } from "../../common/navigation/routes";
import { CieCardReaderScreenNavigationParams } from "../../login/cie/screens/CieCardReaderScreen";
import { CieConsentDataUsageScreenNavigationParams } from "../../login/cie/screens/CieConsentDataUsageScreen";
import {
  logoutBeforeSessionCorrupted,
  setFinishedActiveSessionLoginFlow
} from "../store/actions";
import {
  cieLoginFlowSelector,
  isActiveSessionLoginSelector
} from "../store/selectors";
⋮----
const useActiveSessionLoginNavigation = () =>
⋮----
const navigateToCieCardReaderScreen = ({
    ciePin,
    authorizationUri
}: CieCardReaderScreenNavigationParams) =>
⋮----
const navigateToCieConsentDataUsage = ({
    cieConsentUri
}: CieConsentDataUsageScreenNavigationParams) =>
⋮----
const forceLogoutAndNavigateToLanding = () =>
</file>

<file path="apps/main-app/ts/features/authentication/common/analytics/carouselAnalytics.ts">
import { JSX } from "react";
⋮----
import { LandingCardComponent } from "../../../../components/LandingCardComponent";
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
⋮----
export function trackCarousel(
  index: number,
  cards: ReadonlyArray<JSX.Element>
)
⋮----
function trackCarouselMessageScreen()
⋮----
function trackCarouselPaymentMethodScreen()
⋮----
function trackCarouselPaymentScreen()
</file>

<file path="apps/main-app/ts/features/authentication/common/analytics/cieAnalytics.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { LoginType } from "../utils/index";
⋮----
export function trackLoginCieCardReaderScreen(flow: LoginType = "auth")
⋮----
export function trackLoginCieCardReadingError(flow: LoginType = "auth")
⋮----
export function trackLoginCieCardReadingSuccess(flow: LoginType = "auth")
⋮----
export function trackLoginCieConsentDataUsageScreen(flow: LoginType = "auth")
⋮----
export function trackLoginCieDataSharingError(flow: LoginType = "auth")
⋮----
export function trackLoginCiePinInfo(flow: LoginType = "auth")
⋮----
export function trackLoginCiePinScreen(flow: LoginType = "auth")
</file>

<file path="apps/main-app/ts/features/authentication/common/analytics/index.ts">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../mixpanelConfig/profileProperties";
import { GlobalState } from "../../../../store/reducers/types";
import { buildEventProperties, FlowType } from "../../../../utils/analytics";
import { safeUrlParse } from "../../../../utils/url";
import { LoginSessionDuration } from "../../fastLogin/analytics/optinAnalytics";
import { IdpCIE, IdpCIE_ID } from "../../login/hooks/useNavigateToLoginMethod";
import { AuthLevel } from "../utils";
import { LoginType } from "../utils/index";
⋮----
export async function loginCieWizardSelected(flow: LoginType = "auth")
export async function trackCieBottomSheetScreenView(flow: LoginType = "auth")
export async function trackCieIDLoginSelected(
  state: GlobalState,
  authLevel: AuthLevel,
  flow: LoginType = "auth"
)
⋮----
export function trackCieIDLoginSuccess(
  login_session: LoginSessionDuration,
  flow: LoginType = "auth"
)
⋮----
export async function trackCieLoginSelected()
export function trackCieLoginSuccess(
  login_session: LoginSessionDuration,
  flow: LoginType = "auth"
)
export async function trackCiePinLoginSelected(
  state: GlobalState,
  flow: LoginType = "auth"
)
⋮----
export function trackLoginEnded(
  fastLogin: boolean,
  idp: string,
  flow: FlowType,
  screenName: string
)
⋮----
export function trackLoginFailure(props: {
  flow: LoginType;
  idp: keyof IdpData | undefined;
  reason: string;
})
⋮----
export function trackLoginFlowStarting()
export function trackLoginInfoResourceTap(
  resource_selected: "app_features" | "manage_access" | "privacy_policy"
)
⋮----
export function trackLoginInfoTap()
⋮----
export function trackLoginOIConfigurationError(
  url: string,
  flow: LoginType = "auth"
)
⋮----
export function trackLoginUserExit()
⋮----
export function trackLogoutFailure(
  reason?: Error | string,
  flow: LoginType = "auth"
)
⋮----
export function trackLogoutSuccess(flow: LoginType = "auth")
⋮----
export function trackMethodInfo()
⋮----
export function trackSessionTokenFragmentFailure(reason: string)
⋮----
export function trackSessionTokenSource(source: "fragment" | "queryParam")
⋮----
export function trackSpidLoginIdpSelection(flow: LoginType = "auth")
⋮----
export function trackSpidLoginSelected()
⋮----
export function trackSpidLoginSuccess(
  login_session: LoginSessionDuration,
  idp: string,
  flow: LoginType = "auth"
)
⋮----
export function trackTosUserExit(flow: FlowType)
</file>

<file path="apps/main-app/ts/features/authentication/common/analytics/spidAnalytics.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../mixpanelConfig/profileProperties";
import { updateMixpanelSuperProperties } from "../../../../mixpanelConfig/superProperties";
import { GlobalState } from "../../../../store/reducers/types";
import { buildEventProperties } from "../../../../utils/analytics";
import { AUTH_ERRORS } from "../utils/authError";
import { LoginType } from "../utils/index";
⋮----
export type EventProperties = {
  "error message"?: string;
  flow: LoginType;
  idp: string;
};
⋮----
export function trackLoginSpidError(
  errorCode?: string,
  properties?: EventProperties
)
⋮----
export async function trackLoginSpidIdpSelected(
  idp: string,
  state: GlobalState,
  flow: LoginType = "auth"
)
⋮----
export async function updateLoginMethodProfileAndSuperProperties(
  state: GlobalState,
  value: string
)
⋮----
function trackLoginSpid2StepError(properties?: EventProperties)
⋮----
function trackLoginSpidAttemptsError(properties?: EventProperties)
⋮----
function trackLoginSpidCancelError(properties?: EventProperties)
⋮----
function trackLoginSpidDataSharingError(properties?: EventProperties)
function trackLoginSpidGenericError(properties?: EventProperties)
function trackLoginSpidIdentityError(properties?: EventProperties)
function trackLoginSpidTimeoutError(properties?: EventProperties)
function trackMissingSAMLResponseError(properties?: EventProperties)
</file>

<file path="apps/main-app/ts/features/authentication/common/components/AuthErrorComponent.tsx">
import I18n from "i18next";
import { useMemo } from "react";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { DifferentCFErrorScreen } from "../../activeSessionLogin/screens/DifferentCFErrorScreen";
import UnlockAccessComponent, {
  UnlockAccessProps
} from "../../login/unlockAccess/components/UnlockAccessComponent";
import { AUTH_ERRORS, getAuthErrorDetails } from "../utils/authError";
⋮----
export type AuthErrorComponentProps = UnlockAccessProps & {
  errorCodeOrMessage?: string;
  onCancel: () => void;
  onRetry: () => void;
};
⋮----
const AuthErrorComponent = ({
  errorCodeOrMessage = AUTH_ERRORS.GENERIC_ERROR,
  authLevel,
  onRetry,
  onCancel
}: AuthErrorComponentProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/components/Carousel.tsx">
import { IOColors, useIOTheme, VSpacer } from "@io-app/design-system";
import { ComponentProps, Ref, useCallback, useRef } from "react";
import {
  Animated,
  GestureResponderEvent,
  ScrollView,
  StyleSheet,
  useWindowDimensions,
  View
} from "react-native";
⋮----
import { LandingCardComponent } from "../../../../components/LandingCardComponent";
import { trackCarousel } from "../analytics/carouselAnalytics";
⋮----
export type CarouselProps = {
  carouselCards: ReadonlyArray<ComponentProps<typeof LandingCardComponent>>;
  dotEasterEggCallback?: () => void;
  ref?: Ref<View>;
};
⋮----
type CarouselDotsProps = CarouselProps & { scrollX: Animated.Value };
</file>

<file path="apps/main-app/ts/features/authentication/common/components/CieIdWebViewLogin.tsx">
import { memo, useCallback, useState } from "react";
import { StyleSheet } from "react-native";
import WebView, { type WebViewNavigation } from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent
} from "react-native-webview/lib/WebViewTypes";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { useIOStore } from "../../../../store/hooks";
import { useOneIdentityLoginSource } from "../../../lollipop/hooks/useOneIdentityLoginSource";
import { trackLoginOIConfigurationError } from "../../common/analytics";
import { LoadingOverlay } from "../../login/cie/shared/LoadingSpinnerOverlay";
import { getCieIdpId, isAuthenticationUrl } from "../../login/cie/utils";
import { useCieIdApp } from "../hooks/useCieIdApp";
import { oneIdentityAllowedCieOriginsSelector } from "../store/selectors/remoteConfig";
import {
  AUTH_LEVELS,
  isOneIdentityErrorUrl,
  LOGIN_TYPES,
  onLoginUriChanged
} from "../utils";
import {
  defaultUserAgent,
  isAllowedUrl,
  originSchemasWhiteList
} from "../utils/cie";
import { LoginType } from "../utils/index";
import {
  getWebViewFailureData,
  LoginFailureData,
  WebViewFailureData
} from "../utils/loginErrorDebugInfo";
⋮----
export type CieIdWebViewLoginEvent =
  | {
      payload: { code?: string; message?: string; reason: string };
      type: "LOGIN_FAILURE";
    }
  | {
      payload: { failureData: LoginFailureData };
      type: "ONE_IDENTITY_LOGIN_FAILURE";
    }
  | {
      payload: {
        failureData: WebViewFailureData;
        statusCode: number;
        url: string;
      };
      type: "WEBVIEW_HTTP_ERROR";
    }
  | {
      payload: { failureData: WebViewFailureData; url: string };
      type: "WEBVIEW_ERROR";
    }
  | { payload: { token: string }; type: "LOGIN_SUCCESS" }
  | { payload: { url: string }; type: "NOT_ALLOWED_URL" }
  | { type: "CANCEL" };
⋮----
export type CieIdWebViewLoginProps = {
  flow?: LoginType;
  isUat: boolean;
  onEvent: (event: CieIdWebViewLoginEvent) => void;
};
⋮----
const styles = StyleSheet.create({
  container: {
    flex: 1
  }
});
</file>

<file path="apps/main-app/ts/features/authentication/common/components/CieWebViewLogin.tsx">
import I18n from "i18next";
import { memo, useCallback } from "react";
import { StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import WebView, { type WebViewNavigation } from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent
} from "react-native-webview/lib/WebViewTypes";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { trackLoginOIConfigurationError } from "../../common/analytics";
import {
  isOneIdentityErrorUrl,
  LOGIN_TYPES,
  onLoginUriChanged
} from "../utils";
import { defaultUserAgent, originSchemasWhiteList } from "../utils/cie";
import { LoginType } from "../utils/index";
import {
  getWebViewFailureData,
  WebViewFailureData
} from "../utils/loginErrorDebugInfo";
⋮----
export type CieWebViewLoginEvent =
  | {
      payload: { code?: string; message?: string; reason: string };
      type: "LOGIN_FAILURE";
    }
  | {
      payload: {
        failureData: WebViewFailureData;
        statusCode: number;
        url: string;
      };
      type: "WEBVIEW_HTTP_ERROR";
    }
  | {
      payload: { failureData: WebViewFailureData; url: string };
      type: "WEBVIEW_ERROR";
    }
  | { payload: { token: string }; type: "LOGIN_SUCCESS" };
⋮----
export type CieWebViewLoginProps = {
  flow?: LoginType;
  onEvent: (event: CieWebViewLoginEvent) => void;
  url: string;
};
</file>

<file path="apps/main-app/ts/features/authentication/common/components/IdpSuccessfulAuthentication.tsx">
import I18n from "i18next";
import { useEffect } from "react";
import { AccessibilityInfo } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { trackIdpAuthenticationSuccessScreen } from "../../../settings/common/analytics";
import { profileNameSelector } from "../../../settings/common/store/selectors";
import { loggedInIdpSelector } from "../store/selectors";
⋮----
export const IdpSuccessfulAuthentication = () =>
</file>

<file path="apps/main-app/ts/features/authentication/common/components/IdpWebViewLogin.tsx">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
import { memo, useCallback, useMemo, useRef } from "react";
import { Linking } from "react-native";
import { WebView } from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent,
  WebViewNavigation
} from "react-native-webview/lib/WebViewTypes";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { trackLoginError } from "../../../../utils/analytics";
import { SpidIdp } from "../../../../utils/idps";
import {
  assistanceToolRemoteConfig,
  handleSendAssistanceLog
} from "../../../../utils/supportAssistance";
import { getUrlBasepath } from "../../../../utils/url";
import { useOneIdentityLoginSource } from "../../../lollipop/hooks/useOneIdentityLoginSource";
import { trackSpidLoginIntent } from "../../activeSessionLogin/screens/analytics";
import { trackLoginOIConfigurationError } from "../../common/analytics";
import { LoadingOverlay } from "../../login/cie/shared/LoadingSpinnerOverlay";
import { getSpidErrorCodeDescription } from "../../login/idp/utils/spidErrorCode";
import { useOneIdentityPosteIDApp2AppEducational } from "../hooks/useOneIdentityPosteIDApp2AppEducational";
import { idpLoginUrlChanged } from "../store/actions";
import {
  AUTH_LEVELS,
  getIntentFallbackUrl,
  isOneIdentityErrorUrl,
  LOGIN_TYPES,
  LoginType,
  onLoginUriChanged,
  originSchemasWhiteList
} from "../utils";
import {
  getWebViewFailureData,
  LoginFailureData,
  WebViewFailureData
} from "../utils/loginErrorDebugInfo";
⋮----
export type IdpWebViewLoginProps = {
  flow?: LoginType;
  idp: SpidIdp;
  onEvent: (event: WebViewLoginEvent) => void;
};
⋮----
export type WebViewLoginEvent =
  | {
      payload: {
        code?: string;
        failureData: LoginFailureData;
        message?: string;
      };
      type: "LOGIN_FAILURE";
    }
  | {
      payload: {
        failureData: WebViewFailureData;
        statusCode: number;
        url: string;
      };
      type: "WEBVIEW_HTTP_ERROR";
    }
  | {
      payload: { failureData: WebViewFailureData; url: string };
      type: "WEBVIEW_ERROR";
    }
  | { payload: { token: string }; type: "LOGIN_SUCCESS" };
</file>

<file path="apps/main-app/ts/features/authentication/common/components/LoginConfigScreenContent.tsx">
import {
  ListItemCheckbox,
  ListItemHeader,
  ListItemSwitch,
  RadioGroup,
  RadioItem,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { updateMixpanelSuperProperties } from "../../../../mixpanelConfig/superProperties";
import { setDebugModeEnabled } from "../../../../store/actions/debug";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import { isDebugModeEnabledSelector } from "../../../../store/reducers/debug";
import {
  cieLoginDisableUat,
  cieLoginEnableUat
} from "../../login/cie/store/actions";
import { isCieLoginUatEnabledSelector } from "../../login/cie/store/selectors";
import {
  setOneIdentityEnv,
  setOneIdentityLocalFeatureFlag
} from "../store/actions/loginConfig";
import { ONE_IDENTITY_ENVS } from "../store/reducers/loginConfig";
import {
  oneIdentityEnvSelector,
  oneIdentityLocalFeatureFlagSelector
} from "../store/selectors/loginConfig";
⋮----
type OneIdentityLocalFeatureFlag = boolean | undefined;
⋮----
type LoginConfigScreenContentProps = {
  disabled?: boolean;
};
⋮----
export const LoginConfigScreenContent = ({
  disabled = false
}: LoginConfigScreenContentProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/hooks/useCieIdApp.ts">
import { openCieIdApp } from "@pagopa/io-react-native-cieid";
import { useCallback, useEffect } from "react";
import { Linking } from "react-native";
⋮----
import { isAndroid, isIos } from "../../../../utils/platform";
import { getCieIdEnvironment } from "../../login/cie/utils";
import {
  CIE_ID_ERROR,
  CIE_ID_ERROR_MESSAGE,
  IO_LOGIN_CIE_SOURCE_APP,
  IO_LOGIN_CIE_URL_SCHEME
} from "../../login/cie/utils/cie";
⋮----
const extractCieIdErrorFromUrl = (url: string): string | undefined =>
⋮----
type UseCieIdApp = (params: {
  onFailure: (error: string) => void;
  onSuccess: (authenticationUrl: string) => void;
  useUat?: boolean;
}) => {
  startCieIdApp: (url: string) => void;
};
⋮----
export const useCieIdApp: UseCieIdApp = ({
  useUat = false,
  onFailure,
  onSuccess
}) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/hooks/useCieIdWebViewLoginNavigation.ts">
import { StackActions } from "@react-navigation/native";
import { useCallback } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { AuthLevel } from "../../common/utils";
import { FailureData } from "../../common/utils/loginErrorDebugInfo";
import { AUTHENTICATION_ROUTES } from "../navigation/routes";
⋮----
type UseCieIdWebViewLoginNavigationProps = {
  authLevel: AuthLevel;
};
⋮----
export const useCieIdWebViewLoginNavigation = ({
  authLevel
}: UseCieIdWebViewLoginNavigationProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/hooks/useCieLoginMethodSelection.tsx">
import { Banner, ModuleNavigation, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOStore } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import useNavigateToLoginMethod from "../../login/hooks/useNavigateToLoginMethod";
import {
  loginCieWizardSelected,
  trackCieBottomSheetScreenView,
  trackCieIDLoginSelected,
  trackCiePinLoginSelected
} from "../analytics";
import { AUTHENTICATION_ROUTES } from "../navigation/routes";
import { AUTH_LEVELS, AuthLevel, LoginType } from "../utils";
⋮----
type UseCieLoginMethodSelectionParams = {
  flow: LoginType;
};
</file>

<file path="apps/main-app/ts/features/authentication/common/hooks/useOneIdentityPosteIDApp2AppEducational.tsx">
import {
  Body,
  FeatureInfo,
  IOMarkdownLite,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo, useRef } from "react";
import { View } from "react-native";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { SpidIdp } from "../../../../utils/idps";
⋮----
export const useOneIdentityPosteIDApp2AppEducational = (idp: SpidIdp) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/navigation/__test__/AuthenticationNavigator.test.tsx">
import { InitialState, NavigationContainer } from "@react-navigation/native";
import { render } from "@testing-library/react-native";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { GlobalState } from "../../../../../store/reducers/types";
import AuthenticationNavigator from "../AuthenticationNavigator";
import { AUTHENTICATION_ROUTES } from "../routes";
⋮----
const createMockStore = () =>
⋮----
const renderComponent = (initialState?: InitialState) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/navigation/params/AuthenticationParamsList.ts">
import { ActiveSessionCieCardReaderScreenNavigationParams } from "../../../activeSessionLogin/screens/cie/ActiveSessionLoginCieCardReaderScreen.tsx";
import { ActiveSessionLoginCieConsentDataUsageScreenNavigationParams } from "../../../activeSessionLogin/screens/cie/ActiveSessionLoginCieConsentDataUsageScreen.tsx";
import { AuthErrorScreenParams } from "../../../login/authError/screens/AuthErrorScreen";
import { CieIdNotInstalledProps } from "../../../login/cie/components/CieIdNotInstalled";
import { CieCardReaderScreenNavigationParams } from "../../../login/cie/screens/CieCardReaderScreen";
import { CieConsentDataUsageScreenNavigationParams } from "../../../login/cie/screens/CieConsentDataUsageScreen";
import { CieIdAuthUrlErrorScreenParams } from "../../../login/cie/screens/CieIdAuthUrlError";
import { CieIdErrorScreenParams } from "../../../login/cie/screens/CieIdErrorScreen";
import { CieWrongCiePinScreenNavigationParams } from "../../../login/cie/screens/CieWrongCiePinScreen";
import { OneIdentityCieAuthRouteParams } from "../../../login/cie/screens/OneIdentityCieAuthScreen";
import { ChosenIdentifier } from "../../../login/optIn/screens/OptInScreen";
import { UnlockAccessProps } from "../../../login/unlockAccess/components/UnlockAccessComponent";
import { AUTHENTICATION_ROUTES } from "../routes";
⋮----
export type AuthenticationParamsList = {
  [AUTHENTICATION_ROUTES.AUTH_ERROR_SCREEN]: AuthErrorScreenParams;
  [AUTHENTICATION_ROUTES.CIE_ACTIVATE_NFC_SCREEN]: CieCardReaderScreenNavigationParams;
  [AUTHENTICATION_ROUTES.CIE_AUTH_SCREEN]: OneIdentityCieAuthRouteParams;
  [AUTHENTICATION_ROUTES.CIE_CARD_READER_SCREEN]: CieCardReaderScreenNavigationParams;
  [AUTHENTICATION_ROUTES.CIE_CARD_READER_SCREEN_ACTIVE_SESSION_LOGIN]: ActiveSessionCieCardReaderScreenNavigationParams;
  [AUTHENTICATION_ROUTES.CIE_CONSENT_DATA_USAGE]: CieConsentDataUsageScreenNavigationParams;
  [AUTHENTICATION_ROUTES.CIE_CONSENT_DATA_USAGE_ACTIVE_SESSION_LOGIN]: ActiveSessionLoginCieConsentDataUsageScreenNavigationParams;
  [AUTHENTICATION_ROUTES.CIE_EXPIRED_SCREEN]: undefined;
  [AUTHENTICATION_ROUTES.CIE_EXTENDED_APDU_NOT_SUPPORTED_SCREEN]: undefined;
  [AUTHENTICATION_ROUTES.CIE_ID_ACTIVE_SESSION_LOGIN]: undefined;
  [AUTHENTICATION_ROUTES.CIE_ID_ERROR]: CieIdErrorScreenParams | undefined;
  [AUTHENTICATION_ROUTES.CIE_ID_INCORRECT_URL]: CieIdAuthUrlErrorScreenParams;
  [AUTHENTICATION_ROUTES.CIE_ID_LOGIN]: undefined;
  [AUTHENTICATION_ROUTES.CIE_ID_WIZARD]: undefined;
  [AUTHENTICATION_ROUTES.CIE_NOT_INSTALLED]: CieIdNotInstalledProps;
  [AUTHENTICATION_ROUTES.CIE_PIN_SCREEN]: undefined;
  [AUTHENTICATION_ROUTES.CIE_PIN_WIZARD]: undefined;
  [AUTHENTICATION_ROUTES.CIE_UNEXPECTED_ERROR]: undefined;
  [AUTHENTICATION_ROUTES.CIE_WRONG_CARD_SCREEN]: undefined;
  [AUTHENTICATION_ROUTES.CIE_WRONG_PIN_SCREEN]: CieWrongCiePinScreenNavigationParams;
  [AUTHENTICATION_ROUTES.ID_ACTIVATION_WIZARD]: undefined;
  [AUTHENTICATION_ROUTES.IDP_LOGIN]: undefined;
  [AUTHENTICATION_ROUTES.IDP_LOGIN_ACTIVE_SESSION_LOGIN]: undefined;
  [AUTHENTICATION_ROUTES.IDP_SELECTION]: undefined;
  [AUTHENTICATION_ROUTES.IDP_TEST]: undefined;
  [AUTHENTICATION_ROUTES.LANDING]: undefined;
  [AUTHENTICATION_ROUTES.LANDING_ACTIVE_SESSION_LOGIN]: undefined;
  [AUTHENTICATION_ROUTES.LOGIN_CONFIG_SCREEN]: undefined;
  [AUTHENTICATION_ROUTES.OPT_IN]: ChosenIdentifier;
  [AUTHENTICATION_ROUTES.ROOTED_DEVICE]: undefined;
  [AUTHENTICATION_ROUTES.SPID_WIZARD]: undefined;
  [AUTHENTICATION_ROUTES.UNLOCK_ACCESS_SCREEN]: UnlockAccessProps;
};
</file>

<file path="apps/main-app/ts/features/authentication/common/navigation/AuthenticationNavigator.tsx">
import { IODimensions } from "@io-app/design-system";
import {
  createStackNavigator,
  TransitionPresets
} from "@react-navigation/stack";
import { Platform } from "react-native";
⋮----
import CloseButton from "../../../../navigation/components/CloseButton";
import RootedDeviceModal from "../../../../screens/modal/RootedDeviceModal";
import { useIOSelector } from "../../../../store/hooks";
import { isGestureEnabled } from "../../../../utils/navigation";
import { ActiveSessionLandingScreen } from "../../activeSessionLogin/screens/ActiveSessionLandingScreen";
import ActiveSessionLoginCieCardReaderScreen from "../../activeSessionLogin/screens/cie/ActiveSessionLoginCieCardReaderScreen";
import ActiveSessionLoginCieConsentDataUsageScreen from "../../activeSessionLogin/screens/cie/ActiveSessionLoginCieConsentDataUsageScreen";
import ActiveSessionCieIdLoginScreen from "../../activeSessionLogin/screens/cieId/ActiveSessionCieIdLoginScreen";
import { OneIdentityActiveSessionCieIdLoginScreen } from "../../activeSessionLogin/screens/cieId/OneIdentityActiveSessionCieIdLoginScreen";
import ActiveSessionIdpLoginScreen from "../../activeSessionLogin/screens/spid/ActiveSessionIdpLoginScreen";
import { OneIdentityActiveSessionIdpLoginScreen } from "../../activeSessionLogin/screens/spid/OneIdentityActiveSessionIdpLoginScreen";
import AuthErrorScreen from "../../login/authError/screens/AuthErrorScreen";
import ActivateNfcScreen from "../../login/cie/screens/ActivateNfcScreen";
import CieCardReaderScreen from "../../login/cie/screens/CieCardReaderScreen";
import CieConsentDataUsageScreen from "../../login/cie/screens/CieConsentDataUsageScreen";
import CieExpiredOrInvalidScreen from "../../login/cie/screens/CieExpiredOrInvalidScreen";
import CieExtendedApduNotSupportedScreen from "../../login/cie/screens/CieExtendedApduNotSupportedScreen";
import CieIdAuthUrlErrorScreen from "../../login/cie/screens/CieIdAuthUrlError";
import CieIdErrorScreen from "../../login/cie/screens/CieIdErrorScreen";
import CieIdLoginScreen from "../../login/cie/screens/CieIdLoginScreen";
import CieIdNotInstalledScreen from "../../login/cie/screens/CieIdNotInstalledScreen";
import CiePinScreen from "../../login/cie/screens/CiePinScreen";
import CieUnexpectedErrorScreen from "../../login/cie/screens/CieUnexpectedErrorScreen";
import CieWrongCardScreen from "../../login/cie/screens/CieWrongCardScreen";
import CieWrongCiePinScreen from "../../login/cie/screens/CieWrongCiePinScreen";
import { OneIdentityCieAuthScreen } from "../../login/cie/screens/OneIdentityCieAuthScreen";
import { OneIdentityCieIdLoginScreen } from "../../login/cie/screens/OneIdentityCieIdLoginScreen";
import { OneIdentityCiePinScreen } from "../../login/cie/screens/OneIdentityCiePinScreen";
import CieIdWizard from "../../login/cie/screens/wizards/CieIdWizard";
import CiePinWizard from "../../login/cie/screens/wizards/CiePinWizard";
import IDActivationWizard from "../../login/cie/screens/wizards/IDActivationWizard";
import SpidWizard from "../../login/cie/screens/wizards/SpidWizard";
import IdpLoginScreen from "../../login/idp/screens/IdpLoginScreen";
import IdpSelectionScreen from "../../login/idp/screens/IdpSelectionScreen";
import { OneIdentityIdpLoginScreen } from "../../login/idp/screens/OneIdentityIdpLoginScreen";
import { OneIdentityIdpSelectionScreen } from "../../login/idp/screens/OneIdentityIdpSelectionScreen";
import { LandingScreen } from "../../login/landing/screens/LandingScreen";
import OptInScreen from "../../login/optIn/screens/OptInScreen";
import { LoginConfigScreen } from "../screens/LoginConfigScreen";
import TestAuthenticationScreen from "../screens/TestAuthenticationScreen";
import { isOneIdentityLoginEnabledSelector } from "../store/selectors/loginConfig";
import { AuthenticationParamsList } from "./params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "./routes";
</file>

<file path="apps/main-app/ts/features/authentication/common/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/authentication/common/saga/__test__/authenticationSaga.test.ts">
import { createMockTask } from "@redux-saga/testing-utils";
⋮----
import { Task } from "redux-saga";
import { testSaga } from "redux-saga-test-plan";
⋮----
import { updateMixpanelSuperProperties } from "../../../../../mixpanelConfig/superProperties";
import {
  analyticsAuthenticationCompleted,
  analyticsAuthenticationStarted
} from "../../../../../store/actions/analytics";
import { startupLoadSuccess } from "../../../../../store/actions/startup";
import { StartupStatusEnum } from "../../../../../store/reducers/startup";
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
import {
  stopCieManager,
  watchCieAuthenticationSaga
} from "../../../login/cie/sagas/cie";
import {
  IdpCIE,
  IdpCIE_ID
} from "../../../login/hooks/useNavigateToLoginMethod";
import {
  trackCieIDLoginSuccess,
  trackCieLoginSuccess,
  trackSpidLoginSuccess
} from "../../analytics";
import { loginSuccess } from "../../store/actions";
⋮----
import { authenticationSaga } from "../authenticationSaga";
import { watchTestLoginRequestSaga } from "../testLoginSaga";
⋮----
const baseSteps = (idpMock: any, trackFn: jest.Mock) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/__test__/loadSessionInformationSaga.test.ts">
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
⋮----
import { expectSaga } from "redux-saga-test-plan";
⋮----
import {
  sessionInformationLoadFailure,
  sessionInformationLoadSuccess
} from "../../store/actions";
import { loadSessionInformationSaga } from "../loadSessionInformationSaga";
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/__test__/testLoginSaga.test.ts">
import { PasswordLogin } from "@io-app/api-types/generated/definitions/session_manager/PasswordLogin";
import { PublicKey } from "@pagopa/io-react-native-crypto";
⋮----
import { testSaga } from "redux-saga-test-plan";
⋮----
import { ephemeralPublicKeySelector } from "../../../../lollipop/store/reducers/lollipop";
import {
  isActiveSessionFastLoginEnabledSelector,
  isActiveSessionLoginSelector
} from "../../../activeSessionLogin/store/selectors";
import { isFastLoginEnabledSelector } from "../../../fastLogin/store/selectors";
import {
  loginFailure,
  loginSuccess,
  testLoginRequest
} from "../../store/actions";
import { handleTestLogin } from "../testLoginSaga";
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/__test__/watchCheckSessionSaga.test.ts">
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
⋮----
import { testSaga } from "redux-saga-test-plan";
⋮----
import { handleSessionExpiredSaga } from "../../../fastLogin/saga/utils";
import { isFastLoginEnabledSelector } from "../../../fastLogin/store/selectors";
import {
  checkCurrentSession,
  sessionExpired,
  sessionInformationLoadSuccess
} from "../../store/actions";
import { sessionInfoSelector } from "../../store/selectors";
import {
  checkSessionResult,
  testableCheckSession
} from "../watchCheckSessionSaga";
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/__test__/watchForceLogoutSaga.test.ts">
import { takeLatest } from "typed-redux-saga/macro";
import { getType } from "typesafe-actions";
⋮----
import { restartCleanApplication } from "../../../../../sagas/commons";
import { sessionExpired } from "../../store/actions";
import { watchForceLogoutSaga } from "../watchForceLogoutSaga";
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/__test__/watchLogoutSaga.test.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { resetMixpanelSaga } from "../../../../../sagas/mixpanel";
import { startApplicationInitialization } from "../../../../../store/actions/application";
import { startupLoadSuccess } from "../../../../../store/actions/startup";
import { StartupStatusEnum } from "../../../../../store/reducers/startup";
⋮----
import {
  logoutFailure,
  logoutRequest,
  logoutSuccess
} from "../../store/actions";
import { bareSessionTokenSelector } from "../../store/selectors";
import { logoutSaga, watchLogoutSaga } from "../watchLogoutSaga";
⋮----
*deleteCurrentLollipopKeyAndGenerateNewKeyTag()
⋮----
*getKeyInfo()
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/authenticationSaga.ts">
import { call, cancel, fork, put, select, take } from "typed-redux-saga/macro";
⋮----
import { updateMixpanelSuperProperties } from "../../../../mixpanelConfig/superProperties";
import {
  analyticsAuthenticationCompleted,
  analyticsAuthenticationStarted
} from "../../../../store/actions/analytics";
import { startupLoadSuccess } from "../../../../store/actions/startup";
import { StartupStatusEnum } from "../../../../store/reducers/startup";
import { GlobalState } from "../../../../store/reducers/types";
import { ReduxSagaEffect } from "../../../../types/utils";
import { isFastLoginEnabledSelector } from "../../fastLogin/store/selectors";
import {
  stopCieManager,
  watchCieAuthenticationSaga
} from "../../login/cie/sagas/cie";
import { IdpCIE, IdpCIE_ID } from "../../login/hooks/useNavigateToLoginMethod";
import {
  trackCieIDLoginSuccess,
  trackCieLoginSuccess,
  trackLoginFlowStarting,
  trackSpidLoginSuccess
} from "../analytics";
import { loginSuccess } from "../store/actions";
import { idpSelector } from "../store/selectors";
import { watchTestLoginRequestSaga } from "./testLoginSaga";
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/loadSessionInformationSaga.ts">
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put } from "typed-redux-saga/macro";
⋮----
import { SessionManagerClient } from "../../../../api/SessionManagerClientManager";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../../types/utils";
import { convertUnknownToError } from "../../../../utils/errors";
import {
  sessionInformationLoadFailure,
  sessionInformationLoadSuccess
} from "../store/actions";
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/testLoginSaga.ts">
import { AccessToken } from "@io-app/api-types/generated/definitions/session_manager/AccessToken";
import { PasswordLogin } from "@io-app/api-types/generated/definitions/session_manager/PasswordLogin";
import { PublicKey } from "@pagopa/io-react-native-crypto";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { BasicResponseType } from "@pagopa/ts-commons/lib/requests";
⋮----
import { call, put, select, takeLatest } from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import { BackendPublicClient } from "../../../../api/backendPublic";
import { apiUrlPrefix } from "../../../../config";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../../types/utils";
import { convertUnknownToError } from "../../../../utils/errors";
import { ephemeralPublicKeySelector } from "../../../lollipop/store/reducers/lollipop";
import { DEFAULT_LOLLIPOP_HASH_ALGORITHM_SERVER } from "../../../lollipop/utils/login";
import {
  isActiveSessionFastLoginEnabledSelector,
  isActiveSessionLoginSelector
} from "../../activeSessionLogin/store/selectors";
import { isFastLoginEnabledSelector } from "../../fastLogin/store/selectors";
import { loginFailure, loginSuccess, testLoginRequest } from "../store/actions";
⋮----
function postTestLogin(
    login: PasswordLogin,
    publicKey?: PublicKey,
    hashAlgorithm?: string,
    isFastLogin?: boolean
): Promise<t.Validation<BasicResponseType<AccessToken>>>
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/watchCheckSessionSaga.ts">
import { GetSessionStateT } from "@io-app/api-types/generated/definitions/session_manager/requestTypes";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { TypeOfApiResponseStatus } from "@pagopa/ts-commons/lib/requests";
⋮----
import { SagaIterator } from "redux-saga";
import { call, put, select, takeLatest } from "typed-redux-saga/macro";
import { getType } from "typesafe-actions";
⋮----
import { SessionManagerClient } from "../../../../api/SessionManagerClientManager";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../../types/utils";
import { isTestEnv } from "../../../../utils/environment";
import { convertUnknownToError } from "../../../../utils/errors";
import { getOnlyNotAlreadyExistentValues } from "../../../zendesk/utils";
import { handleSessionExpiredSaga } from "../../fastLogin/saga/utils";
import {
  checkCurrentSession,
  sessionInformationLoadSuccess
} from "../store/actions";
import { sessionInfoSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/watchForceLogoutSaga.ts">
import { takeLatest } from "typed-redux-saga/macro";
import { getType } from "typesafe-actions";
⋮----
import { restartCleanApplication } from "../../../../sagas/commons";
import { ReduxSagaEffect } from "../../../../types/utils";
import { sessionExpired } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/authentication/common/saga/watchLogoutSaga.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put, select, takeLatest } from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import { sessionManagerClientManager } from "../../../../api/SessionManagerClientManager";
import { apiUrlPrefix } from "../../../../config";
import { setMainNavigatorReady } from "../../../../navigation/NavigationService";
import { resetMixpanelSaga } from "../../../../sagas/mixpanel";
import { startApplicationInitialization } from "../../../../store/actions/application";
import { startupLoadSuccess } from "../../../../store/actions/startup";
import { StartupStatusEnum } from "../../../../store/reducers/startup";
import { SagaCallReturnType } from "../../../../types/utils";
import { convertUnknownToError } from "../../../../utils/errors";
import { resetAssistanceData } from "../../../../utils/supportAssistance";
import { deleteCurrentLollipopKeyAndGenerateNewKeyTag } from "../../../lollipop/saga";
import {
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../../../messages/analytics";
import { logoutFailure, logoutRequest, logoutSuccess } from "../store/actions";
import { bareSessionTokenSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/authentication/common/screens/__test__/LoginConfigScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import MockDate from "mockdate";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { LoginConfigScreen } from "../LoginConfigScreen";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/authentication/common/screens/__test__/TestAuthenticationScreen.test.tsx">
import { fireEvent, RenderAPI } from "@testing-library/react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { GlobalState } from "../../../../../store/reducers/types";
import { getAppVersion } from "../../../../../utils/appVersion";
import { getTimeoutError } from "../../../../../utils/errors";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { AUTHENTICATION_ROUTES } from "../../navigation/routes";
import { TestLoginState } from "../../store/reducers/testLogin";
import TestAuthenticationScreen from "../TestAuthenticationScreen";
⋮----
const render = (state: TestLoginState) =>
⋮----
const checkVersionView = (component: RenderAPI) =>
⋮----
const checkErrorView = (component: RenderAPI, errorMessage: string) =>
⋮----
const checkSuccessView = (component: RenderAPI) =>
⋮----
const checkInput = (
  component: RenderAPI,
  inputTestID: string,
  enabled: boolean
) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/screens/LoginConfigScreen.tsx">
import { OTPInput } from "@io-app/design-system";
import { useIsFocused } from "@react-navigation/native";
import I18n from "i18next";
import { useState } from "react";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { LoginConfigScreenContent } from "../components/LoginConfigScreenContent";
⋮----
const handleChangePin = (newPin: string) =>
⋮----
const handleValidatePin = (newPin: string): boolean =>
⋮----
// eslint-disable-next-line i18next/no-literal-string
</file>

<file path="apps/main-app/ts/features/authentication/common/screens/TestAuthenticationScreen.tsx">
import { PasswordLogin } from "@io-app/api-types/generated/definitions/session_manager/PasswordLogin";
import {
  Alert,
  Body,
  LoadingSpinner,
  TextInputPassword,
  TextInputValidation,
  VSpacer
} from "@io-app/design-system";
import { FiscalCode } from "@pagopa/ts-commons/lib/strings";
import { useFocusEffect } from "@react-navigation/native";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback, useState } from "react";
import { View } from "react-native";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isMixpanelEnabled } from "../../../../store/reducers/persistedPreferences";
import { getAppVersion } from "../../../../utils/appVersion";
import { handleRegenerateEphemeralKey } from "../../../lollipop";
import { ephemeralKeyTagSelector } from "../../../lollipop/store/reducers/lollipop";
import { testLoginCleanUp, testLoginRequest } from "../../common/store/actions";
import { testLoginSelector } from "../store/reducers/testLogin";
⋮----
const checkUsernameValid = (username: string): boolean
⋮----
const isConfirmButtonDisabled = (
  username: string,
  password: string,
  isLoading: boolean
)
</file>

<file path="apps/main-app/ts/features/authentication/common/store/__test__/reducers.test.ts">
import { refreshSessionToken } from "../../../fastLogin/store/actions/tokenRefreshActions";
import {
  clearCurrentSession,
  logoutFailure,
  logoutRequest,
  logoutSuccess,
  resetAuthenticationState,
  sessionExpired,
  sessionInformationLoadSuccess,
  sessionInvalid
} from "../actions";
import authenticationReducer, { INITIAL_STATE } from "../reducers";
</file>

<file path="apps/main-app/ts/features/authentication/common/store/__test__/selectors.test.ts">
import { SpidLevelEnum } from "@io-app/api-types/generated/definitions/session_manager/SpidLevel";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { format } from "../../../../../utils/dates";
import {
  authenticationStateSelector,
  bpdTokenSelector,
  extractSpidLevel,
  fimsTokenSelector,
  formattedExpirationDateSelector,
  idpSelector,
  loggedOutWithIdpAuthSelector,
  selectedIdentityProviderSelector,
  sessionInfoSelector,
  spidLevelFromSessionInfoSelector,
  walletTokenSelector,
  zendeskTokenSelector
} from "../selectors";
import { isLogoutRequested } from "../utils/guards";
⋮----
const createLoggedInState = (): GlobalState
⋮----
const createLoggedOutWithIdpState = (): GlobalState
⋮----
const createLoggedInWithSessionInfoState = (): GlobalState
</file>

<file path="apps/main-app/ts/features/authentication/common/store/actions/index.ts">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
import { PasswordLogin } from "@io-app/api-types/generated/definitions/session_manager/PasswordLogin";
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
import {
  ActionType,
  createAction,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { SpidIdp } from "../../../../../utils/idps";
import { LoginConfigActions } from "./loginConfig";
⋮----
export type CheckSessionResult = {
  isSessionValid: boolean;
};
⋮----
export type LogoutError = {
  error: Error;
};
⋮----
export type AuthenticationActions =
  | ActionType<typeof checkCurrentSession>
  | ActionType<typeof clearCurrentSession>
  | ActionType<typeof idpLoginUrlChanged>
  | ActionType<typeof idpSelected>
  | ActionType<typeof loginFailure>
  | ActionType<typeof loginSuccess>
  | ActionType<typeof logoutFailure>
  | ActionType<typeof logoutRequest>
  | ActionType<typeof logoutSuccess>
  | ActionType<typeof resetAuthenticationState>
  | ActionType<typeof sessionCorrupted>
  | ActionType<typeof sessionExpired>
  | ActionType<typeof sessionInformationLoadFailure>
  | ActionType<typeof sessionInformationLoadSuccess>
  | ActionType<typeof sessionInvalid>
  | ActionType<typeof testLoginCleanUp>
  | ActionType<typeof testLoginRequest>
  | LoginConfigActions;
</file>

<file path="apps/main-app/ts/features/authentication/common/store/actions/loginConfig.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { OneIdentityEnv } from "../reducers/loginConfig";
⋮----
export type LoginConfigActions =
  | ActionType<typeof setOneIdentityEnv>
  | ActionType<typeof setOneIdentityLocalFeatureFlag>;
</file>

<file path="apps/main-app/ts/features/authentication/common/store/models/index.ts">
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
⋮----
import { SpidIdp } from "../../../../../utils/idps";
⋮----
export type AuthenticationState =
  | LoggedInWithoutSessionInfo
  | LoggedInWithSessionInfo
  | LoggedOutWithIdp
  | LoggedOutWithoutIdp
  | LogoutRequested;
⋮----
export type AuthenticationStateWithIdp =
  | LoggedInWithoutSessionInfo
  | LoggedInWithSessionInfo
  | LoggedOutWithIdp
  | LogoutRequested;
⋮----
export type LoggedInWithoutSessionInfo = Readonly<{
  idp: SpidIdp;
  kind: "LoggedInWithoutSessionInfo";
  sessionToken: string;
}>;
⋮----
export type LoggedInWithSessionInfo = Readonly<{
  idp: SpidIdp;
  kind: "LoggedInWithSessionInfo";
  sessionInfo: PublicSession;
  sessionToken: string;
}>;
⋮----
export type LoggedOutWithIdp = Readonly<{
  idp: SpidIdp;
  kind: "LoggedOutWithIdp";
  reason: LoggedOutReason;
}>;
⋮----
export type LoggedOutWithoutIdp = Readonly<{
  kind: "LoggedOutWithoutIdp";
  reason: LoggedOutReason;
}>;
⋮----
export type LogoutRequested = Readonly<{
  idp: SpidIdp;
  kind: "LogoutRequested";
  reason: LoggedOutReason;
  sessionToken: string;
}>;
⋮----
type LoggedOutReason =
  | "NOT_LOGGED_IN"
  | "SESSION_CORRUPTED"
  | "SESSION_EXPIRED";
</file>

<file path="apps/main-app/ts/features/authentication/common/store/reducers/index.ts">
import { PersistPartial } from "redux-persist";
import { isActionOf } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import {
  consolidateActiveSessionLoginData,
  setFinalizeLoggedOutUserWithDifferentCF
} from "../../../activeSessionLogin/store/actions";
import { refreshSessionToken } from "../../../fastLogin/store/actions/tokenRefreshActions";
import {
  clearCurrentSession,
  idpSelected,
  loginFailure,
  loginSuccess,
  logoutFailure,
  logoutRequest,
  logoutSuccess,
  resetAuthenticationState,
  sessionCorrupted,
  sessionExpired,
  sessionInformationLoadSuccess,
  sessionInvalid
} from "../actions";
import { AuthenticationState, LoggedOutWithoutIdp } from "../models";
import {
  isLoggedIn,
  isLoggedOutWithIdp,
  isSessionExpired
} from "../utils/guards";
⋮----
type PersistedAuthenticationState = AuthenticationState & PersistPartial;
⋮----
const authenticationReducer = (
  state: AuthenticationState = INITIAL_STATE,
  action: Action
): AuthenticationState =>
</file>

<file path="apps/main-app/ts/features/authentication/common/store/reducers/loginConfig.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import {
  setOneIdentityEnv,
  setOneIdentityLocalFeatureFlag
} from "../actions/loginConfig";
⋮----
export type LoginConfigState = {
  oneIdentityEnv: OneIdentityEnv;
  oneIdentityLocalFeatureFlag: boolean | undefined;
};
⋮----
export type OneIdentityEnv =
  (typeof ONE_IDENTITY_ENVS)[keyof typeof ONE_IDENTITY_ENVS];
⋮----
export const loginConfigReducer = (
  state: LoginConfigState = loginConfigInitialState,
  action: Action
): LoginConfigState =>
</file>

<file path="apps/main-app/ts/features/authentication/common/store/reducers/loginFlow.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import {
  consolidateActiveSessionLoginData,
  setLoggedOutUserWithDifferentCF
} from "../../../activeSessionLogin/store/actions";
import {
  loginFailure,
  loginSuccess,
  logoutFailure,
  logoutSuccess,
  sessionCorrupted,
  sessionExpired,
  sessionInvalid
} from "../actions";
⋮----
export type LoginFlowState = {
  isOneIdentityLogin: boolean | undefined;
};
⋮----
export const loginFlowReducer = (
  state: LoginFlowState = loginFlowInitialState,
  action: Action
): LoginFlowState =>
</file>

<file path="apps/main-app/ts/features/authentication/common/store/reducers/testLogin.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import {
  loginFailure,
  loginSuccess,
  testLoginCleanUp,
  testLoginRequest
} from "../actions";
⋮----
export type TestLoginState =
  | TestLoginFailedState
  | TestLoginInitialState
  | TestLoginRequestedState
  | TestLoginSuccessState;
⋮----
type TestLoginFailedState = {
  errorMessage: string;
  kind: "failed";
};
⋮----
type TestLoginInitialState = {
  kind: "idle";
};
⋮----
type TestLoginRequestedState = {
  kind: "requested";
};
⋮----
type TestLoginSuccessState = {
  kind: "succedeed";
};
⋮----
export const testLoginSelector = (state: GlobalState): TestLoginState
⋮----
export const testLoginReducer = (
  state: TestLoginState = { kind: "idle" },
  action: Action
): TestLoginState =>
</file>

<file path="apps/main-app/ts/features/authentication/common/store/selectors/index.ts">
import {
  SpidLevel,
  SpidLevelEnum
} from "@io-app/api-types/generated/definitions/session_manager/SpidLevel";
import { Optional } from "@io-app/design-system";
⋮----
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { format } from "../../../../../utils/dates";
import { SpidIdp } from "../../../../../utils/idps";
import { AuthenticationState, AuthenticationStateWithIdp } from "../models";
import {
  isLoggedIn,
  isLoggedInWithSessionInfo,
  isLoggedOutWithIdp,
  isLogoutRequested,
  isSessionCorrupted,
  isSessionExpired
} from "../utils/guards";
⋮----
type AuthLevel = "L1" | "L2" | "L3";
⋮----
export const authenticationStateSelector = (
  state: GlobalState
): AuthenticationState
⋮----
export const isSessionExpiredSelector = (state: GlobalState)
⋮----
export const isSessionCorruptedSelector = (state: GlobalState)
⋮----
export const sessionTokenSelector = (state: GlobalState): string | undefined
⋮----
export const bareSessionTokenSelector = (
  state: GlobalState
): Optional<string>
⋮----
export const fimsTokenSelector = (state: GlobalState): string | undefined
⋮----
export const zendeskTokenSelector = (state: GlobalState): string | undefined
⋮----
export const spidLevelSelector = (state: GlobalState): SpidLevel | undefined
⋮----
export const extractSpidLevel = (
  spidLevel?: SpidLevelEnum
): AuthLevel | undefined
⋮----
export const spidLevelFromSessionInfoSelector = (
  state: GlobalState
): AuthLevel | undefined =>
⋮----
export const walletTokenSelector = (state: GlobalState): string | undefined
⋮----
export const bpdTokenSelector = (state: GlobalState): string | undefined
⋮----
export const loggedInIdpSelector = (state: GlobalState)
⋮----
export const isLoggedInWithTestIdpSelector = (state: GlobalState)
⋮----
function matchWithIdp<I>(
  state: AuthenticationState,
  whenWithoutIdp: I,
  whenWithIdp: (state: AuthenticationStateWithIdp) => I
): I
⋮----
export const idpSelector = ({
  authentication
}: GlobalState): O.Option<SpidIdp>
⋮----
export const loggedInAuthSelector = (
</file>

<file path="apps/main-app/ts/features/authentication/common/store/selectors/loginConfig.ts">
import { GlobalState } from "../../../../../store/reducers/types";
import { getDeviceId } from "../../../../../utils/device";
import { isFeatureEnabled } from "../../../../../utils/featureRollout";
import { oneIdentityRolloutPercentageSelector } from "./remoteConfig";
⋮----
export const oneIdentityEnvSelector = (state: GlobalState)
⋮----
export const oneIdentityLocalFeatureFlagSelector = (state: GlobalState)
⋮----
export const isOneIdentityLoginEnabledSelector = (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/store/selectors/loginFlow.ts">
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const isOneIdentityLoginSelector = (
  state: GlobalState
): boolean | undefined
</file>

<file path="apps/main-app/ts/features/authentication/common/store/selectors/remoteConfig.ts">
import { remoteConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../../store/reducers/types";
import { isTestEnv } from "../../../../../utils/environment";
import { OneIdentityEnv } from "../reducers/loginConfig";
import { oneIdentityEnvSelector } from "./loginConfig";
⋮----
const oneIdentityRemoteConfigSelector = (state: GlobalState)
⋮----
export const oneIdentityRolloutPercentageSelector = (state: GlobalState) =>
⋮----
export const oneIdentityAllowedCieOriginsSelector = (state: GlobalState) =>
⋮----
export const oneIdentityCieNativeRedirectsEnabledSelector = (
  state: GlobalState
)
⋮----
export const oneIdentityCieAndroidClearSessionCookiesEnabledSelector = (
  state: GlobalState
)
⋮----
type OneIdentityEnvConfig = {
  idpFriendlyNamesUrl: string;
  idpsUrl: string;
};
⋮----
const makeOneIdentityEnvFieldSelector =
(field: keyof OneIdentityEnvConfig) => (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/store/utils/guards.ts">
import {
  AuthenticationState,
  LoggedInWithoutSessionInfo,
  LoggedInWithSessionInfo,
  LoggedOutWithIdp,
  LoggedOutWithoutIdp,
  LogoutRequested
} from "../models";
⋮----
export function isLoggedIn(
  state: AuthenticationState
): state is LoggedInWithoutSessionInfo | LoggedInWithSessionInfo
⋮----
export function isLoggedInWithSessionInfo(
  state: AuthenticationState
): state is LoggedInWithSessionInfo
⋮----
export function isLoggedOutWithIdp(
  state: AuthenticationState
): state is LoggedOutWithIdp
⋮----
export function isLogoutRequested(
  state: AuthenticationState
): state is LogoutRequested
⋮----
export function isSessionCorrupted(
  state: AuthenticationState
): state is LoggedOutWithIdp | LoggedOutWithoutIdp
⋮----
export function isSessionExpired(
  state: AuthenticationState
): state is LoggedOutWithIdp | LoggedOutWithoutIdp
⋮----
function isLoggedInWithoutSessionInfo(
  state: AuthenticationState
): state is LoggedInWithoutSessionInfo
</file>

<file path="apps/main-app/ts/features/authentication/common/utils/authError.ts">
import { IOPictograms } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { IOAnimatedPictograms } from "../../../../components/ui/AnimatedPictogram";
⋮----
export enum AUTH_ERRORS {
  CIEID_IOS_INVALID_OPERATION_MESSAGE = "Operazione_non_valida",
  CIEID_IOS_OPERATION_CANCELED_MESSAGE = "Operazione_annullata_dall'utente",
  CIEID_OPERATION_CANCEL = "CIEID_OPERATION_CANCEL",
  ERROR_19 = "19",
  ERROR_20 = "20",
  ERROR_21 = "21",
  ERROR_22 = "22",
  ERROR_23 = "23",
  ERROR_25 = "25",
  ERROR_1001 = "1001",
  ERROR_1002 = "1002",
  ERROR_1004 = "1004",
  GENERIC_ERROR = "GENERIC_ERROR",
  MISSING_IDP_ISSUER = "Error: Missing idpIssuer inside configuration",
  MISSING_SAML_RESPONSE = "Missing SAMLResponse in ACS"
}
⋮----
export type AuthErrorDetails = {
  pictogram: IOAnimatedPictograms | IOPictograms;
  subtitle: string;
  title: string;
};
⋮----
const getAuthErrorDetailsMap = ():
⋮----
export const getAuthErrorDetails = (
  errorCodeOrMessage?: string
): AuthErrorDetails =>
</file>

<file path="apps/main-app/ts/features/authentication/common/utils/cie.ts">
import { Platform } from "react-native";
⋮----
import { isDevEnv } from "../../../../utils/environment";
⋮----
export const isAllowedUrl = (
  url: string,
  allowedOrigins: ReadonlyArray<string> = WHITELISTED_DOMAINS
) =>
</file>

<file path="apps/main-app/ts/features/authentication/common/utils/constants.tsx">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import I18n from "i18next";
⋮----
import { CieAuthenticationErrorReason } from "../../login/cie/store/actions";
</file>

<file path="apps/main-app/ts/features/authentication/common/utils/fetch.ts">
import { unknownToString } from "../../../../utils/errors";
⋮----
export type FetchFailureReason =
  | "aborted"
  | "network-error"
  | "no-attempts"
  | "retryable-status"
  | "timeout";
⋮----
export type FetchFailureResponse = {
  message: string;
  reason: FetchFailureReason;
  response?: Response;
  type: "failure";
};
⋮----
export type FetchResponse = FetchFailureResponse | FetchSuccessResponse;
⋮----
export type FetchSuccessResponse = {
  response: Response;
  type: "success";
};
⋮----
export const isFailureResponse = (
  response: FetchResponse
): response is FetchFailureResponse
⋮----
export const isSuccessResponse = (
  response: FetchResponse
): response is FetchSuccessResponse
⋮----
export const isAbortedResponse = (
  response: FetchResponse
): response is FetchFailureResponse
⋮----
export const isTimeoutResponse = (
  response: FetchResponse
): response is FetchFailureResponse
⋮----
export const isNetworkErrorResponse = (
  response: FetchResponse
): response is FetchFailureResponse
⋮----
export const isRetryableStatusResponse = (
  response: FetchResponse
): response is FetchFailureResponse
⋮----
export const isNoAttemptsResponse = (
  response: FetchResponse
): response is FetchFailureResponse
⋮----
export type RetriableFetchOptions = {
  readonly maxAttempts?: number;
  readonly retryOnStatusCodes?: ReadonlyArray<number>;
  readonly timeoutMs?: number;
};
⋮----
const exponentialBackoffDelay = (attempt: number): number
⋮----
const getRetryAfterMs = (response: Response): number | undefined =>
⋮----
const addAbortListener = (
  signal: AbortSignal | undefined,
  listener: () => void
): (() => void) =>
⋮----
const onAbort = (): void =>
⋮----
const isRequestInput = (value: Request | string): value is Request
⋮----
const sleep = (delayMs: number, signal?: AbortSignal): Promise<void>
⋮----
export function createRetriableFetch(
  options: RetriableFetchOptions = {}
): (input: RequestInfo, init?: RequestInit) => Promise<FetchResponse>
⋮----
const performAttempt = async (
      attemptIndex: number
): Promise<FetchResponse> =>
⋮----
const handleFailure = async (
        reason: "network-error" | "retryable-status" | "timeout",
        message: string,
        retryContext?: {
          readonly response?: Response;
          readonly retryAfterMs?: number;
        }
): Promise<FetchResponse> =>
</file>

<file path="apps/main-app/ts/features/authentication/common/utils/index.tsx">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
import { PublicKey } from "@pagopa/io-react-native-crypto";
import { WebViewNavigation } from "react-native-webview/lib/WebViewTypes";
import URLParse from "url-parse";
⋮----
import { apiUrlPrefix, spidRelayState } from "../../../../config";
import { getAppVersion } from "../../../../utils/appVersion";
import { isDevEnv, isLocalEnv } from "../../../../utils/environment";
import { isStringNullyOrEmpty } from "../../../../utils/strings";
import { safeUrlParse } from "../../../../utils/url";
import {
  trackSessionTokenFragmentFailure,
  trackSessionTokenSource
} from "../analytics";
import { trackLoginSpidError } from "../analytics/spidAnalytics";
⋮----
export type LoginType = (typeof LOGIN_TYPES)[keyof typeof LOGIN_TYPES];
export type ReauthLoginType = Exclude<LoginType, typeof LOGIN_TYPES.AUTH>;
⋮----
export type AuthLevel = (typeof AUTH_LEVELS)[keyof typeof AUTH_LEVELS];
⋮----
export type SpidAuthLevel = `Spid${AuthLevel}`;
⋮----
type LoginFailure = {
  errorCode?: string;
  errorMessage?: string;
  success: false;
};
⋮----
type LoginResult = LoginFailure | LoginSuccess;
⋮----
type LoginSuccess = {
  success: true;
  token: string;
};
⋮----
export const getIntentFallbackUrl = (intentUrl: string): string | undefined =>
⋮----
const getTokenFromUrlParse = (urlParse: URLParse): string | undefined =>
⋮----
export const extractLoginResult = (
  url: string,
  idp?: keyof IdpData,
  flow: LoginType = "auth"
): LoginResult | undefined =>
⋮----
export const getIdpLoginUri = (
  idpId: string,
  authLevel: AuthLevel,
  apiLoginUrlPrefix: string
)
⋮----
export const onLoginUriChanged =
  (
    onFailure: (errorCode?: string, errorMessage?: string) => void,
    onSuccess: (_: string) => void,
    idp?: keyof IdpData,
    flow: LoginType = "auth"
)
⋮----
export const getLoginHeaders = (
  publicKey: PublicKey,
  hashAlgorithm: string,
  isFastLogin: boolean,
  idpId?: string,
  hashedFiscalCode?: string
) => (
⋮----
export const isValidCallbackUrl = (url: string) =>
⋮----
export const isOneIdentityErrorUrl = (url?: string): url is string =>
</file>

<file path="apps/main-app/ts/features/authentication/common/utils/jsonFetchToSchema.ts">
import { err, ok, Result } from "neverthrow";
import { z } from "zod";
⋮----
import { unknownToString } from "../../../../utils/errors";
import { FetchResponse, isFailureResponse } from "./fetch";
⋮----
const parseWithSchema = <S extends z.ZodType>(
  schema: S,
  value: unknown
): Result<z.output<S>, string> =>
⋮----
export const jsonFetchToSchema = async <TSchema extends z.ZodType>(
  requestPromise: Promise<FetchResponse>,
  schema: TSchema
): Promise<Result<z.infer<TSchema>, string>> =>
</file>

<file path="apps/main-app/ts/features/authentication/common/utils/loginErrorDebugInfo.ts">
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent
} from "react-native-webview/lib/WebViewTypes";
⋮----
export type FailureData = LoginFailureData | WebViewFailureData;
⋮----
export type LoginFailureData = Record<string, unknown> & { reason: string };
⋮----
export type WebViewFailureData = {
  code: number;
  description: string;
  url: string;
};
⋮----
export const getWebViewFailureData = ({
  nativeEvent
}: WebViewErrorEvent | WebViewHttpErrorEvent): WebViewFailureData
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/analytics/__test__/index.test.ts">
import {
  trackLoginSessionTimeoutPostPin,
  trackLoginSessionTimeoutPrePin
} from "..";
import { mixpanelTrack } from "../../../../../mixpanel";
import { buildEventProperties } from "../../../../../utils/analytics";
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/analytics/__test__/optinAnalytics.test.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../../mixpanelConfig/profileProperties";
import { updateMixpanelSuperProperties } from "../../../../../mixpanelConfig/superProperties";
import { buildEventProperties } from "../../../../../utils/analytics";
import {
  trackLoginSessionOptIn,
  trackLoginSessionOptIn30,
  trackLoginSessionOptIn365,
  trackLoginSessionOptInInfo
} from "../optinAnalytics";
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
⋮----
export function trackLoginSessionTimeoutPostPin()
⋮----
export function trackLoginSessionTimeoutPrePin()
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/analytics/optinAnalytics.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../mixpanelConfig/profileProperties";
import { updateMixpanelSuperProperties } from "../../../../mixpanelConfig/superProperties";
import { GlobalState } from "../../../../store/reducers/types";
import { buildEventProperties } from "../../../../utils/analytics";
import { LoginType } from "../../common/utils/index";
⋮----
export type LoginSessionDuration = "30" | "365" | "not set";
⋮----
export function trackLoginSessionOptIn(flow: LoginType = "auth")
export async function trackLoginSessionOptIn30(
  state: GlobalState,
  flow: LoginType = "auth"
)
export async function trackLoginSessionOptIn365(
  state: GlobalState,
  flow: LoginType = "auth"
)
export function trackLoginSessionOptInInfo(flow: LoginType = "auth")
⋮----
export async function updateLoginSessionProfileAndSuperProperties(
  state: GlobalState,
  value: LoginSessionDuration
)
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/backend/__test__/index.test.ts">
import { LollipopMethodEnum } from "@io-app/api-types/generated/definitions/identity/LollipopMethod";
import { createClient } from "@io-app/api-types/generated/definitions/session_manager/client";
⋮----
import { defaultRetryingFetch } from "../../../../../utils/fetch";
import { LollipopConfig } from "../../../../lollipop";
import { KeyInfo } from "../../../../lollipop/utils/crypto";
import { lollipopFetch } from "../../../../lollipop/utils/fetch";
import {
  createFastLoginClient,
  createNonceClient,
  performFastLogin,
  performGetNonce
} from "../index";
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/backend/index.ts">
import { LollipopMethodEnum } from "@io-app/api-types/generated/definitions/identity/LollipopMethod";
import { LollipopOriginalURL } from "@io-app/api-types/generated/definitions/identity/LollipopOriginalURL";
import { LollipopSignature } from "@io-app/api-types/generated/definitions/identity/LollipopSignature";
import { LollipopSignatureInput } from "@io-app/api-types/generated/definitions/identity/LollipopSignatureInput";
import { createClient } from "@io-app/api-types/generated/definitions/session_manager/client";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
⋮----
import { fetchMaxRetries, fetchTimeout } from "../../../../config";
import { defaultRetryingFetch } from "../../../../utils/fetch";
import { LollipopConfig } from "../../../lollipop";
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { lollipopFetch } from "../../../lollipop/utils/fetch";
⋮----
export const performFastLogin = async (fastLoginClient: FastLoginClient)
⋮----
type FastLoginClient = ReturnType<typeof createFastLoginClient>;
⋮----
export const createFastLoginClient = (
  baseUrl: string,
  keyInfo: KeyInfo = {},
  lollipopConfig: LollipopConfig
)
⋮----
export const performGetNonce = async (nonceClient: GetNonceClient)
⋮----
type GetNonceClient = ReturnType<typeof createNonceClient>;
⋮----
export const createNonceClient = (baseUrl: string)
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/backend/mockedFunctionsAndTypes.ts">
import { ProblemJson } from "@io-app/api-types/generated/definitions/backend/ProblemJson";
import {
  composeResponseDecoders as compD,
  ioResponseDecoder as ioD,
  IResponseType,
  ResponseDecoder
} from "@pagopa/ts-commons/lib/requests";
⋮----
export type NonceBaseResponseType<R> =
  | IResponseType<200, R>
  | IResponseType<404, ProblemJson>
  | IResponseType<500, ProblemJson>;
⋮----
export type NonceResponse = t.TypeOf<typeof NonceResponse>;
⋮----
export function getFastLoginNonceDecoder<R, O = R>(
  type: t.Type<R, O>
): ResponseDecoder<NonceBaseResponseType<R>>
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/components/__test__/SecuritySuggestions.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { useIOSelector } from "../../../../../store/hooks";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { openWebUrl } from "../../../../../utils/url";
import SecuritySuggestions from "../SecuritySuggestions";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/components/SecuritySuggestions.tsx">
import { FeatureInfo, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { absolutePortalLinksSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../utils/url";
import { trackWhatsNewScreen } from "../../../whatsnew/analytics";
import { setSecurityAdviceAcknowledged } from "../store/actions/securityAdviceActions";
⋮----
body=
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/saga/__test__/pendingActionsSaga.test.ts">
import {
  delay,
  put,
  race,
  select,
  take,
  takeLatest
} from "typed-redux-saga/macro";
⋮----
import { applicationInitialized } from "../../../../../store/actions/application";
import { clearPendingAction } from "../../store/actions/tokenRefreshActions";
import { fastLoginPendingActionsSelector } from "../../store/selectors";
import {
  testableHandleApplicationInitialized,
  watchPendingActionsSaga
} from "../pendingActionsSaga";
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/saga/__test__/tokenRefreshSaga.test.ts">
import { call, delay, put, take, takeLatest } from "typed-redux-saga/macro";
⋮----
import { fastLoginMaxRetries } from "../../../../../config";
import NavigationService from "../../../../../navigation/NavigationService";
import ROUTES from "../../../../../navigation/routes";
import { getPin } from "../../../../../utils/keychain";
import { dismissSupport } from "../../../../../utils/supportAssistance";
import {
  identificationFailure,
  identificationRequest,
  identificationSuccess
} from "../../../../identification/store/actions";
import { MESSAGES_ROUTES } from "../../../../messages/navigation/routes";
import { logoutRequest, sessionExpired } from "../../../common/store/actions";
import {
  askUserToRefreshSessionToken,
  refreshSessionToken,
  refreshTokenNoPinError,
  testable
} from "../../store/actions/tokenRefreshActions";
import {
  testableTokenRefreshSaga,
  watchTokenRefreshSaga
} from "../tokenRefreshSaga";
⋮----
type RequestStateType = NonNullable<
    typeof testableTokenRefreshSaga
  >["types"]["RequestStateType"];
⋮----
type RefreshSessionTokenRequestPayload = NonNullable<
    typeof testable
  >["types"]["RefreshSessionTokenRequestPayload"];
⋮----
const createAction = (
      withUserInteraction: RefreshSessionTokenRequestPayload
)
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/saga/__test__/utils.test.ts">
import { never } from "io-ts";
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { Action } from "../../../../../store/actions/types";
import {
  checkCurrentSession,
  logoutRequest,
  sessionExpired
} from "../../../common/store/actions";
import {
  refreshSessionToken,
  savePendingAction
} from "../../store/actions/tokenRefreshActions";
import { isFastLoginEnabledSelector } from "../../store/selectors";
import {
  handleSessionExpiredSaga,
  ThirdPartyTokenError,
  utilsExport,
  withRefreshApiCall,
  withThirdPartyRefreshApiCall
} from "../utils";
⋮----
const fakeApiCall = ()
const fakeApiCall401 = ()
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/saga/utils/index.ts">
import { IResponseType } from "@pagopa/ts-commons/lib/requests";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
⋮----
import { SagaIterator } from "redux-saga";
import { call, delay, put, race, select, take } from "typed-redux-saga/macro";
import { isActionOf } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { isDevEnv } from "../../../../../utils/environment";
import {
  checkCurrentSession,
  sessionExpired
} from "../../../common/store/actions";
import {
  refreshSessionToken,
  savePendingAction
} from "../../store/actions/tokenRefreshActions";
import { isFastLoginEnabledSelector } from "../../store/selectors";
⋮----
export type RefreshApiCallErrorHandlingType = Omit<
  RefreshApiCallErrorHandlingTypeWithTypeField,
  "type"
>;
⋮----
export type RefreshThirdPartyApiCallOptions =
  | {
      action: never;
      errorHandling?: RefreshThirdPartyApiCallErrorHandling;
    }
  | {
      action?: Action;
      errorHandling: never;
    };
⋮----
type RefreshApiCallErrorHandlingTypeWithTypeField = {
  errorMessage?: string;
  skipThrowingError?: boolean;
  type?: never;
};
⋮----
type RefreshThirdPartyApiCallErrorHandling = {
  errorMessage?: string;
  skipThrowingError?: boolean;
};
⋮----
type ThirdPartyTokenErrorType = "SESSION_IS_STILL_VALID";
⋮----
export class ThirdPartyTokenError extends Error
⋮----
constructor(
    message: string | undefined,
    type: ThirdPartyTokenErrorType = "SESSION_IS_STILL_VALID"
)
⋮----
function isReduxAction<A extends Action>(
  obj?: A | RefreshApiCallErrorHandlingType
): obj is A
⋮----
function isSessionInvalid(resultAction: Action)
⋮----
function isSessionValidOrWeFailedToCheck(resultAction: Action)
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/saga/pendingActionsSaga.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { SagaIterator } from "redux-saga";
import {
  delay,
  put,
  race,
  select,
  take,
  takeLatest
} from "typed-redux-saga/macro";
⋮----
import { applicationInitialized } from "../../../../store/actions/application";
import { isDevEnv } from "../../../../utils/environment";
import { clearPendingAction } from "../store/actions/tokenRefreshActions";
import { fastLoginPendingActionsSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/saga/tokenRefreshSaga.ts">
import { FastLoginT } from "@io-app/api-types/generated/definitions/session_manager/requestTypes";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { RequestResponseTypes } from "@pagopa/ts-commons/lib/requests";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { ValidationError } from "io-ts";
import { SagaIterator } from "redux-saga";
import { call, delay, put, take, takeLatest } from "typed-redux-saga/macro";
import { getType } from "typesafe-actions";
⋮----
import { apiUrlPrefix, fastLoginMaxRetries } from "../../../../config";
import NavigationService from "../../../../navigation/NavigationService";
import ROUTES from "../../../../navigation/routes";
import { startApplicationInitialization } from "../../../../store/actions/application";
import { SagaCallReturnType } from "../../../../types/utils";
import { isDevEnv } from "../../../../utils/environment";
import { getPin } from "../../../../utils/keychain";
import { dismissSupport } from "../../../../utils/supportAssistance";
import {
  logoutRequest,
  sessionExpired
} from "../../../authentication/common/store/actions";
import {
  identificationFailure,
  identificationRequest,
  identificationSuccess
} from "../../../identification/store/actions";
import { LollipopConfig } from "../../../lollipop";
import { getKeyInfo } from "../../../lollipop/saga";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
import {
  createFastLoginClient,
  createNonceClient,
  performFastLogin,
  performGetNonce
} from "../backend";
import {
  NonceBaseResponseType,
  NonceResponse
} from "../backend/mockedFunctionsAndTypes";
import {
  askUserToRefreshSessionToken,
  refreshSessionToken,
  refreshTokenNoPinError,
  refreshTokenTransientError,
  showRefreshTokenLoader
} from "../store/actions/tokenRefreshActions";
⋮----
type RequestStateType = {
  counter: number;
  error: string | undefined;
  status: "in-progress" | "max-retries" | "session-expired" | "success";
};
⋮----
const handleRequestError = (
  requestState: RequestStateType,
  response?: E.Either<
    ReadonlyArray<ValidationError>,
    NonceBaseResponseType<NonceResponse> | RequestResponseTypes<FastLoginT>
  >
) =>
⋮----
type FastLoginTokenRefreshError = {
  description: string;
  status?: number;
};
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/screens/AskUserInteractionScreen.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import { Modal } from "react-native";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
⋮----
const AskUserInteractionScreen = (props: OperationResultScreenContentProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/screens/FastLoginModals.tsx">
import I18n from "i18next";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { setOfflineAccessReason } from "../../../ingress/store/actions";
import { OfflineAccessReasonEnum } from "../../../ingress/store/reducer";
import { itwOfflineAccessAvailableSelector } from "../../../itwallet/common/store/selectors";
import { logoutRequest } from "../../common/store/actions";
import {
  askUserToRefreshSessionToken,
  clearTokenRefreshError
} from "../store/actions/tokenRefreshActions";
import { TokenRefreshState } from "../store/reducers/tokenRefreshReducer";
import AskUserInteractionScreen from "./AskUserInteractionScreen";
import RefreshTokenLoadingScreen from "./RefreshTokenLoadingScreen";
⋮----
if (isOfflineAccessAvailable)
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/screens/RefreshTokenLoadingScreen.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { Modal } from "react-native";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
⋮----
const RefreshTokenLoadingScreen = () =>
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/__test__/optInReducer.test.ts">
import {
  logoutFailure,
  logoutSuccess
} from "../../../../authentication/common/store/actions";
import { setFastLoginOptIn } from "../actions/optInActions";
import {
  fastLoginOptInInitialState,
  FastLoginOptInState,
  testableFastLoginOptInReducer
} from "../reducers/optInReducer";
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/__test__/securityAdviceReducer.test.ts">
import { differentProfileLoggedIn } from "../../../../../store/actions/crossSessions";
import {
  setSecurityAdviceAcknowledged,
  setSecurityAdviceReadyToShow
} from "../actions/securityAdviceActions";
import {
  INITIAL_STATE,
  SecurityAdviceAcknowledgedState,
  testableSecurityAdviceAcknowledgedReducer
} from "../reducers/securityAdviceReducer";
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/__test__/selectors.test.ts">
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { Config } from "@io-app/api-types/generated/definitions/content/Config";
import { ITuple2, Tuple2 } from "@pagopa/ts-commons/lib/tuples";
⋮----
import { DeepPartial } from "redux";
⋮----
import { baseRawBackendStatus } from "../../../../../store/reducers/__mock__/backendStatus";
import { GlobalState } from "../../../../../store/reducers/types";
import { getAppVersion } from "../../../../../utils/appVersion";
import {
  fastLoginOptInSelector,
  fastLoginPendingActionsSelector,
  hasTwoMinutesElapsedSinceLastActivitySelector,
  isFastLoginEnabledSelector,
  isFastLoginUserInteractionNeededForSessionExpiredSelector,
  isSecurityAdviceAcknowledgedEnabled,
  isSecurityAdviceReadyToShow,
  tokenRefreshSelector
} from "../selectors";
⋮----
function checkFastLoginFlagWithBrokenStatus(expectedValue: boolean)
⋮----
function checkBrokenFastLoginFlagTest(
    minAppVersion: string | undefined,
    appVersion: string,
    expectedValue: boolean
)
⋮----
function checkIfFastLoginFlagIsEnableForThisAppVersion(
    minAppVersion: string | undefined,
    expectedValue: boolean
)
⋮----
function checkFastLoginFlagTest(
    minAppVersion: string | undefined,
    appVersion: string,
    expectedValue: boolean
)
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/__test__/sessionRefreshReducer.test.ts">
import { logoutFailure, logoutSuccess } from "../../../common/store/actions";
import { setSecurityAdviceReadyToShow } from "../actions/securityAdviceActions";
import { areTwoMinElapsedFromLastActivity } from "../actions/sessionRefreshActions";
import {
  automaticSessionRefreshInitialState,
  AutomaticSessionRefreshState,
  testableAutomaticSessionRefreshReducer
} from "../reducers/sessionRefreshReducer";
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/__test__/tokenRefreshReducer.test.ts">
import {
  askUserToRefreshSessionToken,
  clearPendingAction,
  clearTokenRefreshError,
  refreshSessionToken,
  refreshTokenNoPinError,
  refreshTokenTransientError,
  savePendingAction,
  showRefreshTokenLoader
} from "../actions/tokenRefreshActions";
import {
  FastLoginTokenRefreshReducer,
  testableFastLoginTokenRefreshReducer
} from "../reducers/tokenRefreshReducer";
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/actions/index.ts">
import { fastLoginOptInActions } from "./optInActions";
import { SecurityAdviceActions } from "./securityAdviceActions";
import { automaticSessionRefreshActions } from "./sessionRefreshActions";
import { FastLoginTokenRefreshActions } from "./tokenRefreshActions";
⋮----
export type FastLoginActions =
  | automaticSessionRefreshActions
  | fastLoginOptInActions
  | FastLoginTokenRefreshActions
  | SecurityAdviceActions;
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/actions/optInActions.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { FastLoginOptInState } from "../reducers/optInReducer";
⋮----
export type fastLoginOptInActions = ActionType<typeof setFastLoginOptIn>;
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/actions/securityAdviceActions.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type SecurityAdviceActions =
  | ActionType<typeof setSecurityAdviceAcknowledged>
  | ActionType<typeof setSecurityAdviceReadyToShow>;
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/actions/sessionRefreshActions.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type automaticSessionRefreshActions = ActionType<
  typeof areTwoMinElapsedFromLastActivity
>;
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/actions/tokenRefreshActions.ts">
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { isDevEnv } from "../../../../../utils/environment";
⋮----
type PendingActionPayload = { pendingAction: Action };
⋮----
type RefreshSessionTokenRequestPayload = {
  showIdentificationModalAtStartup: boolean;
  showLoader: boolean;
  withUserInteraction: boolean;
};
⋮----
type SessionTokenRefreshChoice = "no" | "yes";
⋮----
export type FastLoginTokenRefreshActions =
  | ActionType<PendingActionTypes>
  | ActionType<typeof askUserToRefreshSessionToken>
  | ActionType<typeof clearTokenRefreshError>
  | ActionType<typeof refreshSessionToken>;
⋮----
type PendingActionTypes = typeof clearPendingAction | typeof savePendingAction;
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/reducers/index.ts">
import { combineReducers } from "redux";
import { PersistPartial } from "redux-persist";
⋮----
import { Action } from "../../../../../store/actions/types";
import { fastLoginOptInPersistor, FastLoginOptInState } from "./optInReducer";
import {
  securityAdviceAcknowledgedPersistor,
  SecurityAdviceAcknowledgedState
} from "./securityAdviceReducer";
import {
  automaticSessionRefreshPersistor,
  AutomaticSessionRefreshState
} from "./sessionRefreshReducer";
import {
  FastLoginTokenRefreshReducer,
  FastLoginTokenRefreshState
} from "./tokenRefreshReducer";
⋮----
export type FastLoginState = {
  automaticSessionRefresh: AutomaticSessionRefreshState & PersistPartial;
  optIn: FastLoginOptInState & PersistPartial;
  securityAdviceAcknowledged: PersistPartial & SecurityAdviceAcknowledgedState;
  tokenRefreshHandler: FastLoginTokenRefreshState;
};
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/reducers/optInReducer.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { isDevEnv } from "../../../../../utils/environment";
import {
  logoutFailure,
  logoutSuccess
} from "../../../../authentication/common/store/actions";
import { consolidateActiveSessionLoginData } from "../../../activeSessionLogin/store/actions";
import { setFastLoginOptIn } from "../actions/optInActions";
⋮----
export type FastLoginOptInState = {
  enabled: boolean | undefined;
};
⋮----
const fastLoginOptInReducer = (
  state: FastLoginOptInState = fastLoginOptInInitialState,
  action: Action
): FastLoginOptInState =>
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/reducers/securityAdviceReducer.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { differentProfileLoggedIn } from "../../../../../store/actions/crossSessions";
import { Action } from "../../../../../store/actions/types";
import { isDevEnv } from "../../../../../utils/environment";
import {
  setSecurityAdviceAcknowledged,
  setSecurityAdviceReadyToShow
} from "../actions/securityAdviceActions";
⋮----
export type SecurityAdviceAcknowledgedState = {
  acknowledged: boolean | undefined;
  readyToShow: boolean | undefined;
};
⋮----
const securityAdviceAcknowledgedReducer = (
  state: SecurityAdviceAcknowledgedState = INITIAL_STATE,
  action: Action
): SecurityAdviceAcknowledgedState =>
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/reducers/sessionRefreshReducer.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import _ from "lodash";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  persistReducer
} from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { isDevEnv } from "../../../../../utils/environment";
import { logoutFailure, logoutSuccess } from "../../../common/store/actions";
import { areTwoMinElapsedFromLastActivity } from "../actions/sessionRefreshActions";
⋮----
export type AutomaticSessionRefreshState = {
  areAlreadyTwoMinAfterLastActivity: boolean;
};
⋮----
const AutomaticSessionRefreshReducer = (
  state: AutomaticSessionRefreshState = automaticSessionRefreshInitialState,
  action: Action
): AutomaticSessionRefreshState =>
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/reducers/tokenRefreshReducer.ts">
import { Action, getType } from "typesafe-actions";
⋮----
import { isDevEnv } from "../../../../../utils/environment";
import {
  askUserToRefreshSessionToken,
  clearPendingAction,
  clearTokenRefreshError,
  refreshSessionToken,
  refreshTokenNoPinError,
  refreshTokenTransientError,
  savePendingAction,
  showRefreshTokenLoader
} from "../actions/tokenRefreshActions";
⋮----
export type FastLoginTokenRefreshState = {
  pendingActions: Array<Action>;
  tokenRefresh: TokenRefreshState;
  userInteractionForSessionExpiredNeeded: boolean;
};
export type TokenRefreshState =
  | TokenRefreshErrorState
  | TokenRefreshIdleState
  | TokenRefreshNoPinErrorState
  | TokenRefreshProgressState
  | TokenRefreshSuccessState
  | TokenRefreshTransientErrorState;
type TokenRefreshErrorState = {
  kind: "error";
};
type TokenRefreshIdleState = {
  kind: "idle";
};
⋮----
type TokenRefreshNoPinErrorState = {
  kind: "no-pin-error";
};
⋮----
type TokenRefreshProgressState = {
  kind: "in-progress";
};
type TokenRefreshSuccessState = {
  kind: "success";
  timestamp: number;
};
⋮----
type TokenRefreshTransientErrorState = {
  kind: "transient-error";
};
⋮----
export const FastLoginTokenRefreshReducer = (
  state: FastLoginTokenRefreshState = FastLoginTokenRefreshHandlerInitialState,
  action: Action
): FastLoginTokenRefreshState =>
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/store/selectors/index.ts">
import { isEqual, uniqWith } from "lodash";
import { createSelector } from "reselect";
⋮----
import { fastLoginEnabled, fastLoginOptIn } from "../../../../../config";
import { remoteConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { isPropertyWithMinAppVersionEnabled } from "../../../../../store/reducers/featureFlagWithMinAppVersionStatus";
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const fastLoginOptInSelector = (state: GlobalState)
⋮----
export const hasTwoMinutesElapsedSinceLastActivitySelector = (
  state: GlobalState
)
⋮----
const securityAdviceAcknowledgedSelector = (state: GlobalState)
⋮----
export const isSecurityAdviceReadyToShow = (state: GlobalState)
⋮----
const fastLoginTokenRefreshHandlerSelector = (state: GlobalState)
⋮----
export const isFastLoginUserInteractionNeededForSessionExpiredSelector = (
  state: GlobalState
)
⋮----
export const tokenRefreshSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/authentication/fastLogin/utils/pinPolicy.ts">
type SequenceOrder = "ASCENDING" | "DESCENDING";
⋮----
const checkSequence =
(sequenceOrder: SequenceOrder)
⋮----
export function isValidPinNumber(input: number | string): boolean
</file>

<file path="apps/main-app/ts/features/authentication/login/authError/__test__/AuthErrorScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { ComponentProps } from "react";
import { BackHandler } from "react-native";
import { createStore } from "redux";
⋮----
import ROUTES from "../../../../../navigation/routes";
import { applicationChangeState } from "../../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { MESSAGES_ROUTES } from "../../../../messages/navigation/routes";
import {
  setFinishedActiveSessionLoginFlow,
  setRetryActiveSessionLogin
} from "../../../activeSessionLogin/store/actions";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { AUTH_LEVELS } from "../../../common/utils";
import {
  resetSpidLoginState,
  setSpidLoginInLoadingState
} from "../../idp/store/actions";
import AuthErrorScreen, {
  AuthErrorScreenParams
} from "../screens/AuthErrorScreen";
⋮----
const mockIsActiveSessionLogin = (value: boolean) =>
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/authError/screens/AuthErrorScreen.tsx">
import { useCallback, useMemo } from "react";
⋮----
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { useAvoidHardwareBackButton } from "../../../../../utils/useAvoidHardwareBackButton";
import { MESSAGES_ROUTES } from "../../../../messages/navigation/routes";
import {
  setFinishedActiveSessionLoginFlow,
  setRetryActiveSessionLogin
} from "../../../activeSessionLogin/store/actions";
import { isActiveSessionLoginSelector } from "../../../activeSessionLogin/store/selectors";
import AuthErrorComponent from "../../../common/components/AuthErrorComponent";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { AuthLevel } from "../../../common/utils";
import { FailureData } from "../../../common/utils/loginErrorDebugInfo";
import {
  resetSpidLoginState,
  setSpidLoginInLoadingState
} from "../../idp/store/actions";
⋮----
export type AuthErrorScreenParams = {
  authLevel: AuthLevel;
  authMethod: AuthMethod;
  errorCodeOrMessage?: string;
  failureData?: FailureData;
};
⋮----
export type AuthMethod = "CIE" | "CIE_ID" | "SPID";
⋮----
type AuthErrorScreenProps = IOStackNavigationRouteProps<
  AuthenticationParamsList,
  typeof AUTHENTICATION_ROUTES.AUTH_ERROR_SCREEN
>;
⋮----
const AuthErrorScreen = (
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/analytics/__test__/analytics.test.ts">
import {
  trackCieIdErrorCiePinFallbackScreen,
  trackCieIdErrorCiePinSelected,
  trackCieIdErrorSpidFallbackScreen,
  trackCieIdErrorSpidSelected,
  trackCieIdNotInstalledDownloadAction,
  trackCieIdNotInstalledScreen,
  trackCieIdNoWhitelistUrl,
  trackCieIdSecurityLevelMismatch,
  trackCieIdWizardScreen,
  trackCiePinWizardScreen,
  trackIdpActivationWizardScreen,
  trackSpidWizardScreen,
  trackWizardCieIdSelected,
  trackWizardCiePinInfoSelected,
  trackWizardCiePinSelected,
  trackWizardSpidSelected
} from "..";
import { mixpanelTrack } from "../../../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../../../mixpanelConfig/profileProperties";
import { GlobalState } from "../../../../../../store/reducers/types";
import { AUTH_LEVELS, AuthLevel } from "../../../../common/utils";
import { IdpCIE, IdpCIE_ID } from "../../../hooks/useNavigateToLoginMethod";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/analytics/index.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../../mixpanelConfig/profileProperties";
import { GlobalState } from "../../../../../store/reducers/types";
import { buildEventProperties } from "../../../../../utils/analytics";
import { AuthLevel } from "../../../common/utils";
import { LoginType } from "../../../common/utils/index";
import { IdpCIE, IdpCIE_ID } from "../../hooks/useNavigateToLoginMethod";
⋮----
export const trackCieIdNoWhitelistUrl = (
  url: string,
  flow: LoginType = "auth"
) =>
⋮----
export const trackCieIdSecurityLevelMismatch = (flow: LoginType = "auth") =>
⋮----
export const trackCieIdWizardScreen = async (flow: LoginType = "auth") =>
export const trackCiePinWizardScreen = async (flow: LoginType = "auth") =>
export const trackSpidWizardScreen = async (flow: LoginType = "auth") =>
export const trackIdpActivationWizardScreen = async (
  flow: LoginType = "auth"
) =>
⋮----
export function trackLoginCieWizardCieIdSelected(
  authLevel: AuthLevel,
  flow: LoginType = "auth"
)
⋮----
export const trackWizardCieIdSelected = async (
  state: GlobalState,
  authLevel: AuthLevel,
  flow: LoginType = "auth"
) =>
export const trackWizardCiePinSelected = async (
  state: GlobalState,
  flow: LoginType = "auth"
) =>
export const trackWizardCiePinInfoSelected = async (
  flow: LoginType = "auth"
) =>
export const trackWizardSpidSelected = async (flow: LoginType = "auth") =>
⋮----
export const trackCieIdNotInstalledScreen = async (
  flow: LoginType = "auth"
) =>
⋮----
export const trackCieIdNotInstalledDownloadAction = async (
  flow: LoginType = "auth"
) =>
⋮----
export const trackCieIdErrorCiePinFallbackScreen = async (
  flow: LoginType = "auth"
) =>
export const trackCieIdErrorSpidFallbackScreen = async (
  flow: LoginType = "auth"
) =>
⋮----
export const trackCieIdErrorCiePinSelected = async (
  flow: LoginType = "auth"
) =>
export const trackCieIdErrorSpidSelected = async (flow: LoginType = "auth") =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/__test__/CieCardReadingAnimation.test.tsx">
import React from "react";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import CieCardReadingAnimation, {
  ReadingState,
  testableCieCardReadingAnimation
} from "../CieCardReadingAnimation";
⋮----
type CieCardReadingAnimationProps = NonNullable<
  typeof testableCieCardReadingAnimation
>["types"]["CieCardReadingAnimationProps"];
⋮----
const renderComponent = (
  propsOverride?: Partial<React.ComponentProps<typeof CieCardReadingAnimation>>
) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/__test__/CieIdNotInstalled.test.tsx">
import { fireEvent, render } from "@testing-library/react-native";
import { Platform } from "react-native";
⋮----
import { withStore } from "../../../../../../utils/jest/withStore";
⋮----
import CieIdNotInstalledScreen, {
  CIE_ID_ANDROID_COLL_LINK,
  CIE_ID_ANDROID_LINK,
  CIE_ID_IOS_LINK
} from "../CieIdNotInstalled";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/__test__/CieRequestAuthenticationOverlay.test.tsx">
import { fireEvent } from "@testing-library/react-native";
⋮----
import I18n from "i18next";
import { ok } from "neverthrow";
import React from "react";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { useIOSelector } from "../../../../../../store/hooks";
import { appReducer } from "../../../../../../store/reducers";
import { isMixpanelEnabled } from "../../../../../../store/reducers/persistedPreferences";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { lollipopKeyTagSelector } from "../../../../../lollipop/store/reducers/lollipop";
⋮----
import { selectedIdentityProviderSelector } from "../../../../common/store/selectors";
import { isFastLoginEnabledSelector } from "../../../../fastLogin/store/selectors";
import { isCieLoginUatEnabledSelector } from "../../store/selectors";
import { CieRequestAuthenticationOverlay } from "../CieRequestAuthenticationOverlay";
⋮----
const renderComponent = (
  propsOverride?: Partial<
    React.ComponentProps<typeof CieRequestAuthenticationOverlay>
  >
) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/__test__/CieWrongPin.test.tsx">
import { StackActions } from "@react-navigation/native";
import { fireEvent, render } from "@testing-library/react-native";
import I18n from "i18next";
import { Linking } from "react-native";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { CieWrongPin } from "../CieWrongPin";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/__test__/OneIdentityCieAuthenticationWebView.test.tsx">
import { act, fireEvent, render } from "@testing-library/react-native";
import I18n from "i18next";
import { Platform } from "react-native";
⋮----
import { withStore } from "../../../../../../utils/jest/withStore";
⋮----
import { LOGIN_TYPES } from "../../../../common/utils";
import { OneIdentityCieAuthenticationWebView as OneIdentityCieAuthenticationWebViewComponent } from "../OneIdentityCieAuthenticationWebView";
⋮----
const mockUseOneIdentityLoginSource = (
  overrides?: Partial<
    ReturnType<typeof useOneIdentityLoginSourceModule.useOneIdentityLoginSource>
  >
)
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/__test__/OneIdentityCieAuthorizationWebView.test.tsx">
import { render } from "@testing-library/react-native";
⋮----
import ROUTES from "../../../../../../navigation/routes";
⋮----
import { MESSAGES_ROUTES } from "../../../../../messages/navigation/routes";
import { OneIdentityActiveSessionLoginCieAuthorizationWebView } from "../../../../activeSessionLogin/screens/cie/OneIdentityActiveSessionLoginCieAuthorizationWebView";
import {
  activeSessionLoginFailure,
  activeSessionLoginSuccess,
  logoutBeforeSessionCorrupted,
  setFinishedActiveSessionLoginFlow
} from "../../../../activeSessionLogin/store/actions";
⋮----
import { CieWebViewLogin } from "../../../../common/components/CieWebViewLogin";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
⋮----
import { AUTH_LEVELS, LOGIN_TYPES } from "../../../../common/utils";
import { AUTH_ERRORS } from "../../../../common/utils/authError";
import { OneIdentityCieAuthorizationWebView } from "../OneIdentityCieAuthorizationWebView";
⋮----
const renderComponent = ()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/__test__/OneIdentityCieCardReader.test.tsx">
import { fireEvent, render } from "@testing-library/react-native";
⋮----
import { withStore } from "../../../../../../utils/jest/withStore";
⋮----
import { LOGIN_TYPES } from "../../../../common/utils";
⋮----
import { OneIdentityCieCardReader as OneIdentityCieCardReaderComponent } from "../OneIdentityCieCardReader";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/__test__/OneIdentityCieCardReaderFailure.test.tsx">
import { Event as CEvent } from "@pagopa/react-native-cie";
import { render, screen } from "@testing-library/react-native";
⋮----
import { OneIdentityCieCardReaderFailure } from "../OneIdentityCieCardReaderFailure";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/__test__/OneIdentityCieCardReaderProgress.test.tsx">
import { render } from "@testing-library/react-native";
import I18n from "i18next";
⋮----
import { OneIdentityCieCardReaderProgress } from "../OneIdentityCieCardReaderProgress";
import { OneIdentityCieCardReaderProgressContentProps } from "../OneIdentityCieCardReaderProgressContent";
⋮----
get isIos()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/__test__/OneIdentityCieCardReaderProgressContent.test.tsx">
import { AccessibilityInfo } from "react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import {
  OneIdentityCieCardReaderProgressContent,
  OneIdentityCieCardReaderProgressContentProps
} from "../OneIdentityCieCardReaderProgressContent";
⋮----
const renderComponent = (
  props: OneIdentityCieCardReaderProgressContentProps
) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/CieCardReadingAnimation.tsx">
import {
  IOColors,
  IOPictograms,
  IOPictogramSizeScale,
  Pictogram
} from "@io-app/design-system";
import { useCallback, useEffect, useRef, useState } from "react";
import { Animated, Easing, StyleSheet, View } from "react-native";
⋮----
import { CircularProgress } from "../../../../../components/ui/CircularProgress";
import { isDevEnv } from "../../../../../utils/environment";
⋮----
export enum ReadingState {
  completed = "completed",
  error = "error",
  reading = "reading",
  waiting_card = "waiting_card"
}
⋮----
type CieCardReadingAnimationProps = Readonly<{
  circleColor: string;
  pictogramName: IOPictograms;
  readingState: ReadingState;
}>;
⋮----
const CieCardReadingAnimation = ({
  readingState,
  pictogramName,
  circleColor
}: CieCardReadingAnimationProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/CieIdNotInstalled.tsx">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { Platform } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../store/hooks";
import { openWebUrl } from "../../../../../utils/url";
import { isActiveSessionLoginSelector } from "../../../activeSessionLogin/store/selectors";
import { trackCieIdNotInstalledDownloadAction } from "../analytics";
⋮----
export type CieIdNotInstalledProps = {
  isUat: boolean;
};
⋮----
const CieIdNotInstalled = (
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/CieRequestAuthenticationOverlay.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import CookieManager from "@react-native-cookies/cookies";
import I18n from "i18next";
import {
  createRef,
  Dispatch,
  ReactElement,
  SetStateAction,
  useCallback,
  useEffect,
  useState
} from "react";
import { Platform, View } from "react-native";
import WebView from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent,
  WebViewNavigation,
  WebViewNavigationEvent,
  WebViewSource
} from "react-native-webview/lib/WebViewTypes";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { selectedIdentityProviderSelector } from "../../../../../features/authentication/common/store/selectors";
import { ephemeralKeyTagSelector } from "../../../../../features/lollipop/store/reducers/lollipop";
import { regenerateKeyGetRedirectsAndVerifySaml } from "../../../../../features/lollipop/utils/login";
import { useHardwareBackButton } from "../../../../../hooks/useHardwareBackButton";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { hashedProfileFiscalCodeSelector } from "../../../../../store/reducers/crossSessions";
import { isMixpanelEnabled } from "../../../../../store/reducers/persistedPreferences";
import { trackLoginError } from "../../../../../utils/analytics";
import { closeInjectedScript } from "../../../../../utils/webview";
import {
  isActiveSessionFastLoginEnabledSelector,
  isActiveSessionLoginSelector,
  remoteApiLoginUrlPrefixSelector
} from "../../../activeSessionLogin/store/selectors";
import { AUTH_LEVELS, getIdpLoginUri } from "../../../common/utils";
import { isFastLoginEnabledSelector } from "../../../fastLogin/store/selectors";
import { isCieLoginUatEnabledSelector } from "../store/selectors";
import { cieFlowForDevServerEnabled } from "../utils";
⋮----
type InternalState = {
  authUrl: string | undefined;
  error: boolean;
  key: number;
};
⋮----
type Props = {
  onClose: () => void;
  onSuccess: (authorizationUri: string) => void;
};
⋮----
const generateResetState: () => InternalState = () => (
⋮----
const generateFoundAuthUrlState: (
  authUr: string,
  state: InternalState
) => InternalState = (authUrl: string, state: InternalState) => (
⋮----
const generateErrorState: (state: InternalState) => InternalState = (
  state: InternalState
) => (
⋮----
const generateRetryState: (state: InternalState) => InternalState = (
  state: InternalState
) => (
⋮----
export enum CieEntityIds {
  DEV = "xx_servizicie_coll",
  PROD = "xx_servizicie"
}
⋮----
type RequestInfo = RequestInfoAuthorizedState | RequestInfoLoadingState;
⋮----
type RequestInfoAuthorizedState = {
  nativeAttempts: number;
  requestState: "AUTHORIZED";
  url: string;
};
⋮----
type RequestInfoLoadingState = {
  nativeAttempts: number;
  requestState: "LOADING";
};
⋮----
function retryRequest(
  setInternalState: Dispatch<SetStateAction<InternalState>>,
  setRequestInfo: Dispatch<SetStateAction<RequestInfo>>
)
⋮----
const handleOnShouldStartLoadWithRequest = (
    event: WebViewNavigation
): boolean =>
⋮----
const handleOnLoadEnd = (e: WebViewErrorEvent | WebViewNavigationEvent) =>
⋮----
export const CieRequestAuthenticationOverlay = (props: Props): ReactElement =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/CieWrongPin.tsx">
import { StackActions } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { Linking } from "react-native";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import useActiveSessionLoginNavigation from "../../../activeSessionLogin/utils/useActiveSessionLoginNavigation";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
⋮----
export type CieWrongPinProps = {
  remainingCount: number;
};
⋮----
export const CieWrongPin = (
⋮----
const getOperationResultScreenContentProps =
(): OperationResultScreenContentProps =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/OneIdentityCieAuthenticationWebView.tsx">
import I18n from "i18next";
import { useCallback, useMemo, useState } from "react";
import { Platform } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import WebView from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent,
  WebViewNavigation,
  WebViewNavigationEvent
} from "react-native-webview/lib/WebViewTypes";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../store/hooks";
import { trackLoginError } from "../../../../../utils/analytics";
import { useOneIdentityLoginSource } from "../../../../lollipop/hooks/useOneIdentityLoginSource";
import { trackLoginOIConfigurationError } from "../../../common/analytics";
import {
  oneIdentityCieAndroidClearSessionCookiesEnabledSelector,
  oneIdentityCieNativeRedirectsEnabledSelector
} from "../../../common/store/selectors/remoteConfig";
import {
  AUTH_LEVELS,
  isOneIdentityErrorUrl,
  onLoginUriChanged
} from "../../../common/utils";
import { defaultUserAgent } from "../../../common/utils/cie";
import { LoginType } from "../../../common/utils/index";
import {
  getWebViewFailureData,
  LoginFailureData
} from "../../../common/utils/loginErrorDebugInfo";
import { isCieLoginUatEnabledSelector } from "../store/selectors";
import { getCieIdpId } from "../utils";
⋮----
const isAuthUrl = (url: string)
⋮----
const isErrorPage = (title?: string): boolean =>
⋮----
export type OneIdentityCieAuthenticationWebViewProps = {
  flow: LoginType;
  onAuthenticationUrlReceived: (url: string) => void;
};
⋮----
type WebViewState =
  | { failureData: LoginFailureData; status: "failure" }
  | { status: "authenticating" };
⋮----
const handleLoadEnd = (event: WebViewErrorEvent | WebViewNavigationEvent) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/OneIdentityCieAuthorizationWebView.tsx">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
import { useNavigation } from "@react-navigation/native";
import { useCallback } from "react";
⋮----
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { useOnboardingAbortAlert } from "../../../../onboarding/hooks/useOnboardingAbortAlert";
import { OneIdentityActiveSessionLoginCieAuthorizationWebView } from "../../../activeSessionLogin/screens/cie/OneIdentityActiveSessionLoginCieAuthorizationWebView";
import {
  trackLoginCieConsentDataUsageScreen,
  trackLoginCieDataSharingError
} from "../../../common/analytics/cieAnalytics";
import {
  CieWebViewLogin,
  CieWebViewLoginEvent
} from "../../../common/components/CieWebViewLogin";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { loginFailure, loginSuccess } from "../../../common/store/actions";
import { AUTH_LEVELS, LOGIN_TYPES } from "../../../common/utils";
import { AUTH_ERRORS } from "../../../common/utils/authError";
import { LoginType } from "../../../common/utils/index";
import { LoginFailureData } from "../../../common/utils/loginErrorDebugInfo";
⋮----
type OneIdentityCieAuthorizationWebViewProps = {
  authorizationUrl: string;
  flow: LoginType;
};
⋮----
export const OneIdentityCieAuthorizationWebView = ({
  authorizationUrl,
  flow
}: OneIdentityCieAuthorizationWebViewProps) =>
⋮----
type OneIdentityCieAuthorizationWebViewContentProps = {
  authorizationUrl: string;
};
⋮----
const OneIdentityCieAuthorizationWebViewContent = ({
  authorizationUrl
}: OneIdentityCieAuthorizationWebViewContentProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/OneIdentityCieCardReader.tsx">
import { useCallback } from "react";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { trackLoginCieCardReaderScreen } from "../../../common/analytics/cieAnalytics";
import { LoginType } from "../../../common/utils/index";
import { useCieManager } from "../hooks/useCieManager";
import { OneIdentityCieCardReaderFailure } from "./OneIdentityCieCardReaderFailure";
import { OneIdentityCieCardReaderProgress } from "./OneIdentityCieCardReaderProgress";
⋮----
type OneIdentityCieCardReaderProps = {
  authenticationUrl: string;
  flow: LoginType;
  onAuthorizationUrlReceived: (authorizationUrl: string) => void;
  pin: string;
};
⋮----
export const OneIdentityCieCardReader = ({
  flow,
  onAuthorizationUrlReceived,
  pin,
  authenticationUrl
}: OneIdentityCieCardReaderProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/OneIdentityCieCardReaderFailure.tsx">
import { Event as CEvent } from "@pagopa/react-native-cie";
import { useMemo } from "react";
⋮----
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import CieExpiredOrInvalidScreen from "../screens/CieExpiredOrInvalidScreen";
import CieExtendedApduNotSupportedScreen from "../screens/CieExtendedApduNotSupportedScreen";
import CieUnexpectedErrorScreen from "../screens/CieUnexpectedErrorScreen";
import CieWrongCardScreen from "../screens/CieWrongCardScreen";
import { CieWrongPin } from "./CieWrongPin";
⋮----
export type OneIdentityCieCardReaderFailureProps = {
  failure: CEvent;
};
⋮----
export const OneIdentityCieCardReaderFailure = ({
  failure
}: OneIdentityCieCardReaderFailureProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/OneIdentityCieCardReaderProgress.tsx">
import I18n from "i18next";
import { ComponentProps } from "react";
⋮----
import { isIos } from "../../../../../utils/platform";
import { CieManagerState } from "../hooks/useCieManager";
import { OneIdentityCieCardReaderProgressContent } from "./OneIdentityCieCardReaderProgressContent";
⋮----
type OneIdentityCieCardReaderProgressProps = {
  onCancel: () => void;
  onRetry: () => void;
  state: Exclude<CieManagerState, { status: "failure" }>;
};
⋮----
export const OneIdentityCieCardReaderProgress = ({
  onRetry,
  onCancel,
  state
}: OneIdentityCieCardReaderProgressProps) =>
⋮----
const getContentProps = (): ComponentProps<
    typeof OneIdentityCieCardReaderProgressContent
  > => {
switch (state.status)
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/components/OneIdentityCieCardReaderProgressContent.tsx">
import {
  Body,
  ContentWrapper,
  H3,
  IOButton,
  IOButtonBlockSpecificProps,
  IOButtonLinkSpecificProps,
  IOColors,
  IOPictograms,
  IOPictogramSizeScale,
  Pictogram,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import { useCallback, useEffect, useRef, useState } from "react";
import {
  AccessibilityInfo,
  Platform,
  ScrollView,
  StyleSheet,
  View
} from "react-native";
import {
  cancelAnimation,
  Easing,
  useAnimatedReaction,
  useSharedValue,
  withRepeat,
  withSequence,
  withTiming
} from "react-native-reanimated";
import { SafeAreaView } from "react-native-safe-area-context";
import { scheduleOnRN } from "react-native-worklets";
⋮----
import { CircularProgress } from "../../../../../components/ui/CircularProgress";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { accessibityTimeout } from "../../../common/utils/constants";
⋮----
export type OneIdentityCieCardReaderProgressContentProps = {
  content?: string;
  pictogram: IOPictograms;
  primaryAction?: Omit<IOButtonBlockSpecificProps, "variant">;
  secondaryAction?: Omit<IOButtonLinkSpecificProps, "variant">;
  status: OneIdentityCieCardReaderContentStatus;
  subtitle?: string;
  title: string;
};
⋮----
type OneIdentityCieCardReaderContentStatus =
  | "error"
  | "idle"
  | "reading"
  | "success";
⋮----
if (subtitle === undefined)
⋮----
const ReaderAnimation = ({
  status,
  pictogram
}: Pick<
  OneIdentityCieCardReaderProgressContentProps,
  "pictogram" | "status"
>) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/hooks/useCieInfoBottomSheet.tsx">
import { Body, IOMarkdown, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { View } from "react-native";
⋮----
import { pinPukHelpUrl } from "../../../../../config";
import { useIOStore } from "../../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { openWebUrl } from "../../../../../utils/url";
import { cieLoginFlowSelector } from "../../../activeSessionLogin/store/selectors";
import { trackLoginCiePinInfo } from "../../../common/analytics/cieAnalytics";
⋮----
export const useCieInfoBottomSheet = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/hooks/useCieManager.tsx">
import { triggerHaptic } from "@io-app/design-system";
import cieManager, { Event as CEvent } from "@pagopa/react-native-cie";
import I18n from "i18next";
import { useCallback, useEffect, useState } from "react";
import { Platform } from "react-native";
⋮----
import { useIODispatch, useIOStore } from "../../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { isScreenReaderEnabledSelector } from "../../../../../store/reducers/preferences";
import { isDevEnv } from "../../../../../utils/environment";
import { unknownToString } from "../../../../../utils/errors";
import {
  assistanceToolRemoteConfig,
  handleSendAssistanceLog
} from "../../../../../utils/supportAssistance";
import { cieLoginFlowSelector } from "../../../activeSessionLogin/store/selectors";
import {
  trackLoginCieCardReadingError,
  trackLoginCieCardReadingSuccess
} from "../../../common/analytics/cieAnalytics";
import {
  cieErrorMessagesMap,
  WAIT_TIMEOUT_NAVIGATION,
  WAIT_TIMEOUT_NAVIGATION_ACCESSIBILITY
} from "../../../common/utils/constants";
import { cieAuthenticationError } from "../store/actions";
import { isCieLoginUatEnabledSelector } from "../store/selectors";
import { getCieUatEndpoint } from "../utils/endpoints";
⋮----
const safeDecodeURIComponent = (url: string): string =>
⋮----
export type CieManagerState =
  | { failure: CEvent; status: "failure" }
  | { failure: string; status: "reading-failure" }
  | { status: "idle" }
  | { status: "reading" }
  | { status: "success" };
⋮----
type UseCieManager = (params: { onSuccess: (authUrl: string) => void }) => {
  startReading: (pin: string, authUrl: string) => Promise<void>;
  state: CieManagerState;
};
⋮----
export const useCieManager: UseCieManager = (
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/sagas/__test__/cie.test.ts">
import cieManager from "@pagopa/react-native-cie";
import { expectSaga } from "redux-saga-test-plan";
⋮----
import { convertUnknownToError } from "../../../../../../utils/errors";
import { startTimer } from "../../../../../../utils/timer";
import { cieIsSupported, nfcIsEnabled } from "../../store/actions";
import {
  checkCieAvailabilitySaga,
  checkNfcEnablementSaga,
  stopCieManager,
  watchCieAuthenticationSaga
} from "../cie";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/sagas/__test__/trackLevelSecuritySaga.test.ts">
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
import { SpidLevelEnum } from "@io-app/api-types/generated/definitions/session_manager/SpidLevel";
⋮----
import { expectSaga } from "redux-saga-test-plan";
import { select } from "redux-saga/effects";
⋮----
import { idpSelector } from "../../../../common/store/selectors";
import { AUTH_LEVELS } from "../../../../common/utils";
import { IdpCIE_ID } from "../../../hooks/useNavigateToLoginMethod";
import { trackCieIdSecurityLevelMismatch } from "../../analytics";
import { cieIDSelectedSecurityLevelSelector } from "../../store/selectors";
import { shouldTrackLevelSecurityMismatchSaga } from "../trackLevelSecuritySaga";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/sagas/cie.ts">
import cieManager from "@pagopa/react-native-cie";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { SagaIterator } from "redux-saga";
import { call, put, takeLatest } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../../types/utils";
import { convertUnknownToError } from "../../../../../utils/errors";
import { startTimer } from "../../../../../utils/timer";
import { cieIsSupported, nfcIsEnabled } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/sagas/trackLevelSecuritySaga.ts">
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
⋮----
import { select } from "typed-redux-saga/macro";
⋮----
import { extractSpidLevel, idpSelector } from "../../../common/store/selectors";
import { IdpCIE_ID } from "../../hooks/useNavigateToLoginMethod";
import { trackCieIdSecurityLevelMismatch } from "../analytics";
import { cieIDSelectedSecurityLevelSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/ActivateNfcScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { Alert } from "react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { useIOSelector } from "../../../../../../store/hooks";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { openNFCSettings } from "../../utils/cie";
import ActivateNfcScreen from "../ActivateNfcScreen";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieCardReaderScreenWrapper.test.tsx">
import { Platform } from "react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import CieCardReaderScreen from "../CieCardReaderScreen";
⋮----
function renderComponent()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieConsentDataUsageScreen.test.tsx">
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { runConsentScreenSuite } from "../../../../activeSessionLogin/shared/CieContentDataUsageCommonSuite";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
⋮----
import CieConsentDataUsageScreen from "../CieConsentDataUsageScreen";
⋮----
const WebView = (props: any) => <View
⋮----
const renderStd = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieExpiredOrInvalidScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import CieExpiredOrInvalidScreen from "../CieExpiredOrInvalidScreen";
⋮----
function renderComponent()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieExtendedApduNotSupportedScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import CieExtendedApduNotSupportedScreen from "../CieExtendedApduNotSupportedScreen";
⋮----
function renderComponent()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieIdAuthUrlErrorScreen.test.tsx">
import { fireEvent, render } from "@testing-library/react-native";
import I18n from "i18next";
import { ComponentProps } from "react";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
⋮----
import CieIdAuthUrlErrorScreen from "../CieIdAuthUrlError";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieIdErrorScreen.test.tsx">
import { fireEvent, render } from "@testing-library/react-native";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
⋮----
import CieIdErrorScreen, { CieIdErrorScreenParams } from "../CieIdErrorScreen";
⋮----
type Props = Parameters<typeof CieIdErrorScreen>[0];
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieIdLoginScreen.test.tsx">
import { SpidLevelEnum } from "@io-app/api-types/generated/definitions/session_manager/SpidLevel";
import { StackActions } from "@react-navigation/native";
import { act, fireEvent, render } from "@testing-library/react-native";
import { ComponentProps } from "react";
import { EmitterSubscription, Linking } from "react-native";
⋮----
import { withStore } from "../../../../../../utils/jest/withStore";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { loginFailure, loginSuccess } from "../../../../common/store/actions";
⋮----
import { AUTH_LEVELS } from "../../../../common/utils";
import CieIdLoginScreen from "../CieIdLoginScreen";
⋮----
const WebView = (props: any) => <View
⋮----
const authErrorReplaceAction = (errorCodeOrMessage?: string)
⋮----
function renderComponent()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieIdNotInstalledScreen.test.tsx">
import { render } from "@testing-library/react-native";
⋮----
import { withStore } from "../../../../../../utils/jest/withStore";
import CieIdNotInstalledScreen from "../CieIdNotInstalledScreen";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CiePinScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../../../store/reducers";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import CiePinScreen from "../CiePinScreen";
⋮----
function renderComponent()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieUnexpectedErrorScreen.test.tsx">
import { StackActions } from "@react-navigation/native";
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import CieUnexpectedErrorScreen from "../CieUnexpectedErrorScreen";
⋮----
function renderComponent()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieWrongCardScreen.test.tsx">
import { StackActions } from "@react-navigation/native";
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import CieWrongCardScreen from "../CieWrongCardScreen";
⋮----
function renderComponent()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/CieWrongCiePinScreen.test.tsx">
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import CieWrongCiePinScreen from "../CieWrongCiePinScreen";
⋮----
type Test = {
  actionLabel: string;
  actionTestID: string;
  remainingCount: number;
  secondaryActionLabel: string;
  secondaryActionTestID: string;
  subtitle: string;
  title: string;
};
⋮----
const renderComponent = (remainingCount: number) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/OneIdentityCieAuthScreen.test.tsx">
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { LOGIN_TYPES } from "../../../../common/utils";
import { LoginType } from "../../../../common/utils/index";
⋮----
import { OneIdentityCieAuthScreen } from "../OneIdentityCieAuthScreen";
⋮----
const renderComponent = (flow: LoginType = LOGIN_TYPES.AUTH) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/OneIdentityCieIdLoginScreen.test.tsx">
import { StackActions } from "@react-navigation/native";
import { fireEvent } from "@testing-library/react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { loginFailure, loginSuccess } from "../../../../common/store/actions";
⋮----
import { AUTH_LEVELS } from "../../../../common/utils";
import { OneIdentityCieIdLoginScreen } from "../OneIdentityCieIdLoginScreen";
⋮----
const authErrorReplaceAction = (
  errorCodeOrMessage: string | undefined,
  failureData: Record<string, unknown>
)
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/OneIdentityCiePinScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { merge } from "lodash";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { LOGIN_TYPES } from "../../../../common/utils";
⋮----
import { nfcIsEnabled } from "../../store/actions";
import { OneIdentityCiePinScreen } from "../OneIdentityCiePinScreen";
⋮----
function renderComponent(useUat = false)
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/__test__/wizards.test.tsx">
import { fireEvent, render } from "@testing-library/react-native";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { AUTH_LEVELS } from "../../../../common/utils";
import CieIdWizard, { CIE_ID_LINK } from "../wizards/CieIdWizard";
import CiePinWizard, { CIE_PIN_LINK } from "../wizards/CiePinWizard";
import IDActivationWizard, {
  ACTIVATE_CIE_URL,
  ACTIVATE_SPID_URL,
  REQUEST_CIE_URL
} from "../wizards/IDActivationWizard";
import SpidWizard from "../wizards/SpidWizard";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/wizards/CieIdWizard.tsx">
import {
  ContentWrapper,
  IOButton,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { IOScrollViewActions } from "../../../../../../components/ui/IOScrollView";
import { IOScrollViewWithLargeHeader } from "../../../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../../../navigation/params/AppParamsList";
import { useIOSelector, useIOStore } from "../../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../../../utils/url";
import { isActiveSessionLoginSelector } from "../../../../activeSessionLogin/store/selectors";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { AUTH_LEVELS, AuthLevel } from "../../../../common/utils";
import useNavigateToLoginMethod from "../../../hooks/useNavigateToLoginMethod";
import {
  trackCieIdWizardScreen,
  trackWizardCieIdSelected
} from "../../analytics";
⋮----
const screenActions = (): IOScrollViewActions => (
⋮----
actions=
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/wizards/CiePinWizard.tsx">
import {
  ContentWrapper,
  IOButton,
  IOMarkdown,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useRef } from "react";
import { View } from "react-native";
⋮----
import { IOScrollViewActions } from "../../../../../../components/ui/IOScrollView";
import { IOScrollViewWithLargeHeader } from "../../../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../../../navigation/params/AppParamsList";
import { useIOSelector, useIOStore } from "../../../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../../../utils/accessibility";
import { useIOBottomSheetModal } from "../../../../../../utils/hooks/bottomSheet";
import { useOnFirstRender } from "../../../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../../../utils/url";
import { isActiveSessionLoginSelector } from "../../../../activeSessionLogin/store/selectors";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import useNavigateToLoginMethod from "../../../hooks/useNavigateToLoginMethod";
import {
  trackCiePinWizardScreen,
  trackWizardCiePinInfoSelected,
  trackWizardCiePinSelected
} from "../../analytics";
⋮----
openWebUrl(CIE_PIN_LINK, () =>
⋮----
setAccessibilityFocus(buttonRef);
⋮----
actions=
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/wizards/IDActivationWizard.tsx">
import {
  ContentWrapper,
  H6,
  ListItemAction,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../../../utils/url";
import { isActiveSessionLoginSelector } from "../../../../activeSessionLogin/store/selectors";
import { trackIdpActivationWizardScreen } from "../../analytics";
⋮----
const handleOpenLink = (url: string) => () =>
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/wizards/SpidWizard.tsx">
import I18n from "i18next";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../../utils/hooks/useOnFirstRender";
import { isActiveSessionLoginSelector } from "../../../../activeSessionLogin/store/selectors";
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import useNavigateToLoginMethod from "../../../hooks/useNavigateToLoginMethod";
import {
  trackSpidWizardScreen,
  trackWizardSpidSelected
} from "../../analytics";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/ActivateNfcScreen.tsx">
import { ListItemInfo } from "@io-app/design-system";
⋮----
import { Route, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { Alert } from "react-native";
⋮----
import { IOScrollViewWithListItems } from "../../../../../components/ui/IOScrollViewWithListItems";
import { useIOSelector } from "../../../../../store/hooks";
import useActiveSessionLoginNavigation from "../../../activeSessionLogin/utils/useActiveSessionLoginNavigation";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { isNfcEnabledSelector } from "../store/selectors";
⋮----
import { CieCardReaderScreenNavigationParams } from "./CieCardReaderScreen";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieCardReaderScreen.tsx">
import {
  Body,
  ContentWrapper,
  H3,
  IOButton,
  IOColors,
  IOPictograms,
  triggerHaptic,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import cieManager, { Event as CEvent } from "@pagopa/react-native-cie";
import {
  RouteProp,
  useFocusEffect,
  useNavigation,
  useRoute
} from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import {
  AccessibilityInfo,
  Platform,
  ScrollView,
  StyleSheet,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { isScreenReaderEnabledSelector } from "../../../../../store/reducers/preferences";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { isDevEnv } from "../../../../../utils/environment";
import {
  assistanceToolRemoteConfig,
  handleSendAssistanceLog
} from "../../../../../utils/supportAssistance";
import { getTextForState } from "../../../activeSessionLogin/shared/utils";
import {
  trackLoginCieCardReaderScreen,
  trackLoginCieCardReadingError,
  trackLoginCieCardReadingSuccess
} from "../../../common/analytics/cieAnalytics";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import {
  accessibityTimeout,
  cieErrorMessagesMap,
  WAIT_TIMEOUT_NAVIGATION,
  WAIT_TIMEOUT_NAVIGATION_ACCESSIBILITY
} from "../../../common/utils/constants";
import CieCardReadingAnimation, {
  ReadingState
} from "../components/CieCardReadingAnimation";
import {
  cieAuthenticationError,
  CieAuthenticationErrorPayload,
  CieAuthenticationErrorReason
} from "../store/actions";
import { isCieLoginUatEnabledSelector } from "../store/selectors";
import { getCieUatEndpoint } from "../utils/endpoints";
⋮----
export type CieCardReaderScreenNavigationParams = {
  authorizationUri: string;
  ciePin: string;
};
⋮----
type SetErrorParameter = {
  errorDescription?: string;
  eventReason: CieAuthenticationErrorReason;
  navigation?: () => void;
};
⋮----
const getPictogramName = (state: ReadingState): IOPictograms =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieConsentDataUsageScreen.tsx">
import { Route, StackActions, useRoute } from "@react-navigation/native";
import { useCallback, useEffect, useState } from "react";
import { SafeAreaView } from "react-native-safe-area-context";
import WebView from "react-native-webview";
import {
  WebViewHttpErrorEvent,
  WebViewNavigation
} from "react-native-webview/lib/WebViewTypes";
⋮----
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { useOnboardingAbortAlert } from "../../../../onboarding/hooks/useOnboardingAbortAlert";
import { LoaderComponent } from "../../../activeSessionLogin/shared/components/LoaderComponent";
import {
  trackLoginCieConsentDataUsageScreen,
  trackLoginCieDataSharingError
} from "../../../common/analytics/cieAnalytics";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { loginFailure, loginSuccess } from "../../../common/store/actions";
import {
  AUTH_LEVELS,
  onLoginUriChanged,
  originSchemasWhiteList
} from "../../../common/utils";
⋮----
export type CieConsentDataUsageScreenNavigationParams = {
  cieConsentUri: string;
  errorCodeDebugMode?: string;
};
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieExpiredOrInvalidScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
⋮----
const CieExpiredOrInvalidScreen = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieExtendedApduNotSupportedScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import useActiveSessionLoginNavigation from "../../../activeSessionLogin/utils/useActiveSessionLoginNavigation";
⋮----
const CieExtendedApduNotSupportedScreen = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieIdAuthUrlError.tsx">
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { setFinishedActiveSessionLoginFlow } from "../../../activeSessionLogin/store/actions";
import { isActiveSessionLoginSelector } from "../../../activeSessionLogin/store/selectors";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { trackCieIdNoWhitelistUrl } from "../analytics";
⋮----
export type CieIdAuthUrlErrorScreenParams = {
  url: string;
};
⋮----
type CieIdAuthUrlErrorProps = IOStackNavigationRouteProps<
  AuthenticationParamsList,
  typeof AUTHENTICATION_ROUTES.CIE_ID_INCORRECT_URL
>;
⋮----
const CieIdAuthUrlErrorScreen = ({
  navigation,
  route
}: CieIdAuthUrlErrorProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieIdErrorScreen.tsx">
import I18n from "i18next";
import { useEffect, useMemo } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { useAvoidHardwareBackButton } from "../../../../../utils/useAvoidHardwareBackButton";
import {
  setFinishedActiveSessionLoginFlow,
  setIdpSelectedActiveSessionLogin
} from "../../../activeSessionLogin/store/actions";
import { isActiveSessionLoginSelector } from "../../../activeSessionLogin/store/selectors";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { idpSelected } from "../../../common/store/actions";
import { FailureData } from "../../../common/utils/loginErrorDebugInfo";
import useNavigateToLoginMethod, {
  IdpCIE
} from "../../hooks/useNavigateToLoginMethod";
import {
  trackCieIdErrorCiePinFallbackScreen,
  trackCieIdErrorCiePinSelected,
  trackCieIdErrorSpidFallbackScreen,
  trackCieIdErrorSpidSelected
} from "../analytics";
⋮----
export type CieIdErrorScreenParams = {
  failureData?: FailureData;
};
⋮----
type CieIdErrorScreenProps = IOStackNavigationRouteProps<
  AuthenticationParamsList,
  typeof AUTHENTICATION_ROUTES.CIE_ID_ERROR
>;
⋮----
const CieIdErrorScreen = (
⋮----
const navigateToLandingScreen = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieIdLoginScreen.tsx">
import { openCieIdApp } from "@pagopa/io-react-native-cieid";
import { StackActions } from "@react-navigation/native";
import _isEqual from "lodash/isEqual";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Linking, Platform, StyleSheet } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { URL } from "react-native-url-polyfill";
import WebView, { type WebViewNavigation } from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent
} from "react-native-webview/lib/WebViewTypes";
⋮----
import {
  HeaderSecondLevelHookProps,
  useHeaderSecondLevel
} from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { useLollipopLoginSource } from "../../../../lollipop/hooks/useLollipopLoginSource";
import { useOnboardingAbortAlert } from "../../../../onboarding/hooks/useOnboardingAbortAlert";
import { remoteApiLoginUrlPrefixSelector } from "../../../activeSessionLogin/store/selectors";
import { trackLoginSpidError } from "../../../common/analytics/spidAnalytics";
import { IdpSuccessfulAuthentication } from "../../../common/components/IdpSuccessfulAuthentication";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { loginFailure, loginSuccess } from "../../../common/store/actions";
import { loggedInAuthSelector } from "../../../common/store/selectors";
import {
  AUTH_LEVELS,
  onLoginUriChanged,
  originSchemasWhiteList
} from "../../../common/utils";
import {
  defaultUserAgent,
  WHITELISTED_DOMAINS
} from "../../../common/utils/cie";
import { IdpCIE_ID } from "../../hooks/useNavigateToLoginMethod";
import { LoadingOverlay } from "../shared/LoadingSpinnerOverlay";
import {
  cieIDSelectedSecurityLevelSelector,
  isCieLoginUatEnabledSelector
} from "../store/selectors";
import {
  getCieIdEnvironment,
  getCieIDLoginUri,
  isAuthenticationUrl
} from "../utils";
import {
  CIE_ID_ERROR,
  CIE_ID_ERROR_MESSAGE,
  IO_LOGIN_CIE_SOURCE_APP,
  IO_LOGIN_CIE_URL_SCHEME
} from "../utils/cie";
⋮----
type CieIdLoginScreenProps = IOStackNavigationRouteProps<
  AuthenticationParamsList,
  typeof AUTHENTICATION_ROUTES.CIE_ID_LOGIN
>;
⋮----
const CieIdLoginScreen = (
⋮----
const handleOnShouldStartLoadWithRequest = (
    event: WebViewNavigation
): boolean =>
⋮----
renderLoading=
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieIdNotInstalledScreen.tsx">
import { RouteProp, useRoute } from "@react-navigation/native";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { isActiveSessionLoginSelector } from "../../../activeSessionLogin/store/selectors";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { trackCieIdNotInstalledScreen } from "../analytics";
import CieIdNotInstalled from "../components/CieIdNotInstalled";
⋮----
const CieIdNotInstalledScreen = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CiePinScreen.tsx">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
import {
  Banner,
  Body,
  ContentWrapper,
  H2,
  IOMarkdown,
  OTPInput,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
⋮----
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { useHeaderHeight } from "@react-navigation/elements";
import {
  useFocusEffect,
  useIsFocused,
  useNavigation,
  useRoute
} from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useContext, useEffect, useRef, useState } from "react";
import {
  Keyboard,
  KeyboardAvoidingView,
  Platform,
  ScrollView,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import {
  BottomTopAnimation,
  LightModalContext
} from "../../../../../components/ui/LightModal";
import {
  helpCenterHowToLoginWithEicUrl,
  pinPukHelpUrl
} from "../../../../../config";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { trackHelpCenterCtaTapped } from "../../../../../utils/analytics";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture";
import { withTrailingPoliceCarLightEmojii } from "../../../../../utils/strings";
import { openWebUrl } from "../../../../../utils/url";
import {
  cieLoginFlowSelector,
  isActiveSessionLoginSelector,
  remoteApiLoginUrlPrefixSelector
} from "../../../activeSessionLogin/store/selectors";
import useActiveSessionLoginNavigation from "../../../activeSessionLogin/utils/useActiveSessionLoginNavigation";
import {
  trackLoginCiePinInfo,
  trackLoginCiePinScreen
} from "../../../common/analytics/cieAnalytics";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { loginSuccess } from "../../../common/store/actions";
import { AUTH_LEVELS, getIdpLoginUri } from "../../../common/utils";
import {
  CieEntityIds,
  CieRequestAuthenticationOverlay
} from "../components/CieRequestAuthenticationOverlay";
import { nfcIsEnabled } from "../store/actions";
import {
  isCieLoginUatEnabledSelector,
  isNfcEnabledSelector
} from "../store/selectors";
import { cieFlowForDevServerEnabled } from "../utils";
⋮----
const onOpenForgotPinPage = ()
⋮----
trackLoginCiePinInfo(loginType);
present();
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieUnexpectedErrorScreen.tsx">
import { StackActions } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import useActiveSessionLoginNavigation from "../../../activeSessionLogin/utils/useActiveSessionLoginNavigation";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
⋮----
const CieUnexpectedErrorScreen = () =>
⋮----
const navigateToCiePinScreen = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieWrongCardScreen.tsx">
import { StackActions } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import useActiveSessionLoginNavigation from "../../../activeSessionLogin/utils/useActiveSessionLoginNavigation";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
⋮----
const CieWrongCardScreen = () =>
⋮----
const navigateToCiePinScreen = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/CieWrongCiePinScreen.tsx">
import { IOPictograms } from "@io-app/design-system";
import { Route, StackActions, useRoute } from "@react-navigation/native";
import { constNull } from "fp-ts/lib/function";
import I18n from "i18next";
⋮----
import { useCallback, useMemo } from "react";
import { Linking } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { WithTestID } from "../../../../../types/WithTestID";
import useActiveSessionLoginNavigation from "../../../activeSessionLogin/utils/useActiveSessionLoginNavigation";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
⋮----
export type CieWrongCiePinScreenNavigationParams = {
  remainingCount: number;
};
⋮----
const CieWrongCiePinScreen = () =>
⋮----
type MessageAction<T extends string> = {
    accessibilityLabel: T;
    label: T;
    onPress: () => void;
  };
⋮----
type Message = {
    action: MessageAction<string>;
    pictogram: IOPictograms;
    secondaryAction: MessageAction<string>;
    subtitle: string;
    title: string;
  };
⋮----
type Messages = {
    [key: number]: Message;
  };
⋮----
const getMessage = (key: number)
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/OneIdentityCieAuthScreen.tsx">
import { useCallback, useState } from "react";
⋮----
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { LoginType } from "../../../common/utils/index";
import { OneIdentityCieAuthenticationWebView } from "../components/OneIdentityCieAuthenticationWebView";
import { OneIdentityCieAuthorizationWebView } from "../components/OneIdentityCieAuthorizationWebView";
import { OneIdentityCieCardReader } from "../components/OneIdentityCieCardReader";
⋮----
export type OneIdentityCieAuthRouteParams = {
  flow: LoginType;
  pin: string;
};
⋮----
type AuthState =
  | { authenticationUrl: string; status: "02_reading_card_data" }
  | { authorizationUrl: string; status: "03_user_authentication" }
  | { status: "01_authentication_url_retrieval" };
⋮----
type OneIdentityCieAuthScreenProps = IOStackNavigationRouteProps<
  AuthenticationParamsList,
  "CIE_AUTH_SCREEN"
>;
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/OneIdentityCieIdLoginScreen.tsx">
import { useCallback, useMemo } from "react";
⋮----
import { apiUrlPrefix } from "../../../../../config";
import {
  HeaderSecondLevelHookProps,
  useHeaderSecondLevel
} from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { useOnboardingAbortAlert } from "../../../../onboarding/hooks/useOnboardingAbortAlert";
import { trackLoginSpidError } from "../../../common/analytics/spidAnalytics";
import {
  CieIdWebViewLogin,
  CieIdWebViewLoginEvent
} from "../../../common/components/CieIdWebViewLogin";
import { IdpSuccessfulAuthentication } from "../../../common/components/IdpSuccessfulAuthentication";
import { useCieIdWebViewLoginNavigation } from "../../../common/hooks/useCieIdWebViewLoginNavigation";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { loginFailure, loginSuccess } from "../../../common/store/actions";
import { loggedInAuthSelector } from "../../../common/store/selectors";
import { AUTH_LEVELS, AuthLevel, LOGIN_TYPES } from "../../../common/utils";
import { CANCELLED_LOGIN_FAILURE_DATA } from "../../../common/utils/loginErrorDebugInfo";
import {
  cieIDSelectedSecurityLevelSelector,
  isCieLoginUatEnabledSelector
} from "../../cie/store/selectors";
import { IdpCIE_ID } from "../../hooks/useNavigateToLoginMethod";
⋮----
type OneIdentityCieIdLoginScreenProps = IOStackNavigationRouteProps<
  AuthenticationParamsList,
  typeof AUTHENTICATION_ROUTES.CIE_ID_LOGIN
>;
⋮----
export const OneIdentityCieIdLoginScreen = ({
  navigation
}: OneIdentityCieIdLoginScreenProps) =>
⋮----
type OneIdentityCieIdLoginScreenContentProps = {
  authLevel: AuthLevel;
  isUat: boolean;
};
⋮----
const OneIdentityCieIdLoginScreenContent = ({
  isUat,
  authLevel
}: OneIdentityCieIdLoginScreenContentProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/screens/OneIdentityCiePinScreen.tsx">
import {
  Banner,
  Body,
  ContentWrapper,
  H2,
  OTPInput,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { useHeaderHeight } from "@react-navigation/elements";
import {
  useFocusEffect,
  useIsFocused,
  useRoute
} from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useRef, useState } from "react";
import {
  Keyboard,
  KeyboardAvoidingView,
  Platform,
  ScrollView,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { helpCenterHowToLoginWithEicUrl } from "../../../../../config";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { trackHelpCenterCtaTapped } from "../../../../../utils/analytics";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture";
import { withTrailingPoliceCarLightEmojii } from "../../../../../utils/strings";
import { openWebUrl } from "../../../../../utils/url";
import { cieLoginFlowSelector } from "../../../activeSessionLogin/store/selectors";
import { trackLoginCiePinScreen } from "../../../common/analytics/cieAnalytics";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { useCieInfoBottomSheet } from "../hooks/useCieInfoBottomSheet";
import { nfcIsEnabled } from "../store/actions";
import { isCieLoginUatEnabledSelector } from "../store/selectors";
⋮----
const handlePinChanged = (value: string) =>
⋮----
cieInfoBottomSheet.present();
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/shared/LoadingSpinnerOverlay.tsx">
import { ComponentProps } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
⋮----
type LoadingOverlayProps = Omit<
  ComponentProps<typeof LoadingSpinnerOverlay>,
  "children" | "isLoading"
>;
⋮----
export const LoadingOverlay = (props: LoadingOverlayProps) => (
  <View style={StyleSheet.absoluteFill}>
    <LoadingSpinnerOverlay isLoading {...props} />
  </View>
);
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/store/__test__/cieLoginReducer.test.ts">
import { PersistedState } from "redux-persist";
⋮----
import { AUTH_LEVELS } from "../../../../common/utils";
import {
  cieIDDisableTourGuide,
  cieIDSetSelectedSecurityLevel,
  cieLoginDisableUat,
  cieLoginEnableUat
} from "../actions";
import {
  cieLoginInitialState,
  testableCieLoginReducer
} from "../reducers/cieLogin";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/store/__test__/cieReducer.test.ts">
import { cieIsSupported, nfcIsEnabled } from "../../store/actions";
import { cieReducer, CieState } from "../../store/reducers/cie";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/store/__test__/cieSelectors.test.ts">
import { AUTH_LEVELS } from "../../../../common/utils";
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/store/actions/cie.ts">
import { Event as CEvent } from "@pagopa/react-native-cie";
⋮----
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { LoginType } from "../../../../common/utils/index";
⋮----
export type CieAuthenticationErrorPayload = {
  cieDescription?: string;
  flow: LoginType;
  reason: CieAuthenticationErrorReason;
};
⋮----
export type CieAuthenticationErrorReason = "GENERIC" | CEvent["event"];
⋮----
export type CieAuthenticationActions =
  | ActionType<typeof cieAuthenticationError>
  | ActionType<typeof cieIsSupported>
  | ActionType<typeof nfcIsEnabled>;
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/store/actions/cieLogin.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { AuthLevel } from "../../../../common/utils";
⋮----
export type CieLoginConfigActions =
  | ActionType<typeof cieIDDisableTourGuide>
  | ActionType<typeof cieIDSetSelectedSecurityLevel>
  | ActionType<typeof cieLoginDisableUat>
  | ActionType<typeof cieLoginEnableUat>;
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/store/actions/index.ts">

</file>

<file path="apps/main-app/ts/features/authentication/login/cie/store/reducers/cie.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../../store/actions/types";
import { cieIsSupported, nfcIsEnabled } from "../actions";
⋮----
export type CieState = {
  isCieSupported: pot.Pot<boolean, Error>;
  isNfcEnabled: pot.Pot<boolean, Error>;
};
⋮----
export function cieReducer(
  state: CieState = INITIAL_STATE,
  action: Action
): CieState
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/store/reducers/cieLogin.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { omit } from "lodash";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  persistReducer
} from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../../store/actions/types";
import { isDevEnv } from "../../../../../../utils/environment";
import { consolidateActiveSessionLoginData } from "../../../../activeSessionLogin/store/actions";
import { AuthLevel } from "../../../../common/utils";
import {
  cieIDDisableTourGuide,
  cieIDSetSelectedSecurityLevel,
  cieLoginDisableUat,
  cieLoginEnableUat
} from "../actions";
⋮----
export type CieLoginState = {
  cieIDSelectedSecurityLevel?: AuthLevel;
  isCieIDTourGuideEnabled: boolean;
  useUat: boolean;
};
⋮----
const cieLoginReducer = (
  state: CieLoginState = cieLoginInitialState,
  action: Action
): CieLoginState =>
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/store/reducers/index.ts">

</file>

<file path="apps/main-app/ts/features/authentication/login/cie/store/selectors/index.ts">
import { GlobalState } from "../../../../../../store/reducers/types";
⋮----
export const isCieLoginUatEnabledSelector = (state: GlobalState)
⋮----
export const isCieIDTourGuideEnabledSelector = (state: GlobalState)
⋮----
export const cieIDSelectedSecurityLevelSelector = (state: GlobalState)
⋮----
export const isCieSupportedSelector = (state: GlobalState)
⋮----
export const isNfcEnabledSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/utils/cie.ts">
import cieSdk from "@pagopa/react-native-cie";
import { Platform } from "react-native";
⋮----
const realIsNfcEnabled = ()
const mockIsNfcEnabled = ()
⋮----
const mockOpenNfcSettings = ()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/utils/endpoints.ts">
import { Platform } from "react-native";
⋮----
export const getCieUatEndpoint = ()
</file>

<file path="apps/main-app/ts/features/authentication/login/cie/utils/index.ts">
import { CieIdEnvironment } from "@pagopa/io-react-native-cieid";
import { Platform } from "react-native";
⋮----
import { cieLoginFlowWithDevServerEnabled } from "../../../../../config";
import { isDevEnv } from "../../../../../utils/environment";
import { AuthLevel, SPID_AUTH_LEVEL_MAP } from "../../../common/utils";
⋮----
export const getCieIdpId = (useUat: boolean)
⋮----
export const getCieIdEnvironment = (isUat: boolean): CieIdEnvironment
⋮----
export const getCieIDLoginUri = (
  authLevel: AuthLevel,
  isUat: boolean,
  apiLoginUrlPrefix: string
)
⋮----
export const isAuthenticationUrl = (url: string)
</file>

<file path="apps/main-app/ts/features/authentication/login/hooks/useNavigateToLoginMethod.tsx">
import { isCieIdAvailable } from "@pagopa/io-react-native-cieid";
⋮----
import { useCallback } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { SpidIdp } from "../../../../utils/idps";
import {
  setCieIDSelectedSecurityLevelActiveSessionLogin,
  setIdpSelectedActiveSessionLogin
} from "../../activeSessionLogin/store/actions";
import { isActiveSessionLoginSelector } from "../../activeSessionLogin/store/selectors";
import { AUTHENTICATION_ROUTES } from "../../common/navigation/routes";
import { idpSelected } from "../../common/store/actions";
import { AUTH_LEVELS, AuthLevel } from "../../common/utils";
import { fastLoginOptInFFEnabled } from "../../fastLogin/store/selectors";
import {
  isCieLoginUatEnabledSelector,
  isCieSupportedSelector
} from "../../login/cie/store/selectors";
import {
  cieFlowForDevServerEnabled,
  getCieIdEnvironment
} from "../../login/cie/utils";
import {
  ChosenIdentifier,
  Identifier
} from "../../login/optIn/screens/OptInScreen";
import { cieIDSetSelectedSecurityLevel } from "../cie/store/actions";
⋮----
const useNavigateToLoginMethod = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/components/__test__/IdpsGrid.test.tsx">
import { fireEvent, render } from "@testing-library/react-native";
import React from "react";
import { Text } from "react-native";
⋮----
import { SpidIdp } from "../../../../../../utils/idps";
import IdpsGrid from "../../components/IdpsGrid";
⋮----
const EmptyComponent = ()
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/components/__test__/OneIdentityIdpSelectionFailureContent.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { LOGIN_TYPES, LoginType } from "../../../../common/utils";
import { OneIdentityIdpSelectionFailureContent } from "../OneIdentityIdpSelectionFailureContent";
⋮----
const renderComponent = (flow: LoginType = LOGIN_TYPES.AUTH) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/components/IdpsGrid.tsx">
import {
  IODimensions,
  IODimensionScale,
  ModuleIDP,
  VSpacer,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps, ReactElement } from "react";
import {
  FlatList,
  ListRenderItemInfo,
  StyleProp,
  StyleSheet,
  ViewStyle
} from "react-native";
⋮----
import { SpidIdp } from "../../../../../utils/idps";
⋮----
type IdpsGridProps = {
  contentContainerStyle?: StyleProp<ViewStyle>;
  emptyComponent?: ComponentProps<typeof FlatList>["ListEmptyComponent"];
  footerComponent?: ComponentProps<typeof FlatList>["ListFooterComponent"];
  headerComponent?: ComponentProps<typeof FlatList>["ListHeaderComponent"];
  headerComponentStyle?: StyleProp<ViewStyle>;
  idps: ReadonlyArray<SpidIdp>;
  onIdpSelected: (_: SpidIdp) => void;
  testID?: string;
};
⋮----
const onPress = ()
⋮----
loadingAccessibilityLabel=
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/components/OneIdentityIdpSelectionFailureContent.tsx">
import { useFocusEffect } from "@react-navigation/core";
import I18n from "i18next";
import { useCallback, useRef } from "react";
import { View } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { trackLoginReauthEngagementCieSelected } from "../../../activeSessionLogin/screens/analytics";
import { trackCieLoginSelected } from "../../../common/analytics";
import { useCieLoginMethodSelection } from "../../../common/hooks/useCieLoginMethodSelection";
import { LOGIN_TYPES, LoginType } from "../../../common/utils";
⋮----
type OneIdentityIdpSelectionFailureContentProps = {
  flow: LoginType;
};
⋮----
export const OneIdentityIdpSelectionFailureContent = ({
  flow
}: OneIdentityIdpSelectionFailureContentProps) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/hooks/__test__/useGetIdps.test.tsx">
import { renderHook, waitFor } from "@testing-library/react-native";
⋮----
import { merge } from "lodash";
import { Provider } from "react-redux";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
import {
  ONE_IDENTITY_ENVS,
  OneIdentityEnv
} from "../../../../common/store/reducers/loginConfig";
import {
  createRetriableFetch,
  FetchResponse
} from "../../../../common/utils/fetch";
import { Idps } from "../../types/idps";
import { useGetIdps } from "../useGetIdps";
⋮----
const mockFetchIdpsByUrl = (responses: Record<string, FetchResponse>) =>
⋮----
const successResponse = (status: number, body: unknown): FetchResponse => (
⋮----
const networkFailureResponse = (message: string): FetchResponse => (
⋮----
const renderUseGetIdpsHook = (
  oneIdentityEnv: OneIdentityEnv = ONE_IDENTITY_ENVS.PROD
) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/hooks/__test__/usePosteIDApp2AppEducational.test.tsx">
import { render } from "@testing-library/react-native";
⋮----
import { SpidIdp } from "../../../../../../utils/idps";
import { usePosteIDApp2AppEducational } from "../../hooks/usePosteIDApp2AppEducational";
import { ErrorType, SpidLoginRequestInfo } from "../../store/types";
⋮----
const WrapperComponent = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/hooks/useGetIdps.ts">
import { useEffect, useState } from "react";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import {
  oneIdentityIdpFriendlyNamesUrlSelector,
  oneIdentityIdpsUrlSelector
} from "../../../common/store/selectors/remoteConfig";
import { createRetriableFetch } from "../../../common/utils/fetch";
import { jsonFetchToSchema } from "../../../common/utils/jsonFetchToSchema";
import { IdpFriendlyNamesSchema, Idps, IdpsSchema } from "../types/idps";
⋮----
export type IdpsState =
  | { data: Idps; status: "success" }
  | {
      error: string;
      status: "failure";
      url: string;
    }
  | { status: "loading" };
⋮----
export type UseGetIdps = () => {
  state: IdpsState;
};
⋮----
export const useGetIdps: UseGetIdps = () =>
⋮----
const fetchIdpList = async () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/hooks/usePosteIDApp2AppEducational.tsx">
import {
  Body,
  FeatureInfo,
  IOMarkdownLite,
  VSpacer
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef } from "react";
import { View } from "react-native";
⋮----
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { SpidIdp } from "../../../../../utils/idps";
import { SpidLoginRequestInfo } from "../store/types";
⋮----
type Props = {
  requestState: SpidLoginRequestInfo["requestState"];
  selectedIdp?: SpidIdp;
};
⋮----
export const usePosteIDApp2AppEducational = ({
  selectedIdp,
  requestState
}: Props) =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/screens/__test__/IdpLoginScreen.test.tsx">
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
⋮----
import { AUTH_LEVELS } from "../../../../common/utils";
⋮----
import { ErrorType } from "../../store/types";
import IdpLoginScreen from "../IdpLoginScreen";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/screens/__test__/IdpSelectionScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { loadIdps } from "../../../../../../store/actions/content";
⋮----
import { appReducer } from "../../../../../../store/reducers";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { idpSelected } from "../../../../common/store/actions";
import IdpSelectionScreen from "../IdpSelectionScreen";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/screens/__test__/OneIdentityIdpLoginScreen.test.tsx">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
import { fireEvent } from "@testing-library/react-native";
import { createStore } from "redux";
⋮----
import { apiUrlPrefix } from "../../../../../../config";
import { applicationChangeState } from "../../../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { loginFailure, loginSuccess } from "../../../../common/store/actions";
⋮----
import { AUTH_LEVELS } from "../../../../common/utils";
import { OneIdentityIdpLoginScreen } from "../OneIdentityIdpLoginScreen";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/screens/__test__/OneIdentityIdpSelectionScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import _, { merge } from "lodash";
import { ComponentProps } from "react";
import { View } from "react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { setIdpSelectedActiveSessionLogin } from "../../../../activeSessionLogin/store/actions";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../../common/navigation/routes";
import { idpSelected } from "../../../../common/store/actions";
import { OneIdentityIdpSelectionFailureContent } from "../../components/OneIdentityIdpSelectionFailureContent";
import { Idps } from "../../types/idps";
import { OneIdentityIdpSelectionScreen } from "../OneIdentityIdpSelectionScreen";
⋮----
const renderComponent = ({
  isActiveSessionLogin = false
}:
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/screens/IdpLoginScreen.tsx">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
⋮----
import { useNavigation } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import _isEqual from "lodash/isEqual";
import { memo, useCallback, useEffect, useMemo, useState } from "react";
import { Linking, StyleSheet, View } from "react-native";
import { WebView } from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent,
  WebViewNavigation
} from "react-native-webview/lib/WebViewTypes";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
import { LoadingIndicator } from "../../../../../components/ui/LoadingIndicator";
import { apiUrlPrefix } from "../../../../../config";
import {
  HeaderSecondLevelHookProps,
  useHeaderSecondLevel
} from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { trackLoginError } from "../../../../../utils/analytics";
import {
  assistanceToolRemoteConfig,
  handleSendAssistanceLog
} from "../../../../../utils/supportAssistance";
import { getUrlBasepath } from "../../../../../utils/url";
import { useLollipopLoginSource } from "../../../../lollipop/hooks/useLollipopLoginSource";
import { trackSpidLoginIntent } from "../../../activeSessionLogin/screens/analytics";
import { remoteApiLoginUrlPrefixSelector } from "../../../activeSessionLogin/store/selectors";
import { IdpSuccessfulAuthentication } from "../../../common/components/IdpSuccessfulAuthentication";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import {
  idpLoginUrlChanged,
  loginFailure,
  loginSuccess
} from "../../../common/store/actions";
import {
  loggedInAuthSelector,
  loggedOutWithIdpAuthSelector,
  selectedIdentityProviderSelector
} from "../../../common/store/selectors";
import {
  AUTH_LEVELS,
  getIdpLoginUri,
  getIntentFallbackUrl,
  onLoginUriChanged,
  originSchemasWhiteList
} from "../../../common/utils";
import { usePosteIDApp2AppEducational } from "../hooks/usePosteIDApp2AppEducational";
import { setSpidLoginRequestState } from "../store/actions";
import { spidLoginRequestInfoSelector } from "../store/selectors";
import { ErrorType as SpidLoginErrorType } from "../store/types";
import { getSpidErrorCodeDescription } from "../utils/spidErrorCode";
⋮----
const IdpLoginScreen = () =>
⋮----
const renderMask = () =>
⋮----
// Wrapped with `useMemo` to prevent unnecessary re-renders, it seemed to cause bugs when attempting to open certain Idps.
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/screens/IdpSelectionScreen.tsx">
import { Banner, useIOToast, VSpacer } from "@io-app/design-system";
import { useNavigation, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import _ from "lodash";
import { createRef, ReactElement, useCallback, useEffect, useRef } from "react";
import { View } from "react-native";
⋮----
import { isReady } from "../../../../../common/model/RemoteValue";
import { helpCenterHowToLoginWithSpidUrl } from "../../../../../config";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { loadIdps } from "../../../../../store/actions/content";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { idpsRemoteValueSelector } from "../../../../../store/reducers/content";
import { trackHelpCenterCtaTapped } from "../../../../../utils/analytics";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { idps as idpsFallback, SpidIdp } from "../../../../../utils/idps";
import {
  assistanceToolRemoteConfig,
  handleSendAssistanceLog
} from "../../../../../utils/supportAssistance";
import { openWebUrl } from "../../../../../utils/url";
import { setIdpSelectedActiveSessionLogin } from "../../../activeSessionLogin/store/actions";
import { isActiveSessionLoginSelector } from "../../../activeSessionLogin/store/selectors";
import { trackSpidLoginIdpSelection } from "../../../common/analytics";
import { trackLoginSpidIdpSelected } from "../../../common/analytics/spidAnalytics";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { idpSelected } from "../../../common/store/actions";
import IdpsGrid from "../components/IdpsGrid";
⋮----
export const randomOrderIdps = <T extends object>(
  array: Array<T> | ReadonlyArray<T>
): Array<T>
⋮----
const onIdpSelected = (idp: SpidIdp) =>
⋮----
trackHelpCenterCtaTapped(
              "LOGIN_SPID_IDP_SELECTION",
              helpCenterHowToLoginWithSpidUrl,
              routeName
            );
openWebUrl(helpCenterHowToLoginWithSpidUrl, () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/screens/OneIdentityIdpLoginScreen.tsx">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { LoadingScreenContent } from "../../../../../components/screens/LoadingScreenContent";
import { apiUrlPrefix } from "../../../../../config";
import {
  HeaderSecondLevelHookProps,
  useHeaderSecondLevel
} from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { SpidIdp } from "../../../../../utils/idps";
import { IdpSuccessfulAuthentication } from "../../../common/components/IdpSuccessfulAuthentication";
import {
  IdpWebViewLogin,
  WebViewLoginEvent
} from "../../../common/components/IdpWebViewLogin";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { loginFailure, loginSuccess } from "../../../common/store/actions";
import {
  loggedInAuthSelector,
  loggedOutWithIdpAuthSelector
} from "../../../common/store/selectors";
import { AUTH_LEVELS } from "../../../common/utils";
import {
  FailureData,
  LoginFailureData
} from "../../../common/utils/loginErrorDebugInfo";
⋮----
export const OneIdentityIdpLoginScreen = () =>
⋮----
type OneIdentityIdpLoginScreenContentProps = {
  idp: SpidIdp;
};
⋮----
const OneIdentityIdpLoginScreenContent = ({
  idp
}: OneIdentityIdpLoginScreenContentProps) =>
⋮----
// `replace` drops the failed login webview, so it doesn't stay
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/screens/OneIdentityIdpSelectionScreen.tsx">
import { Banner, useIOToast, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { helpCenterHowToLoginWithSpidUrl } from "../../../../../config";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { trackHelpCenterCtaTapped } from "../../../../../utils/analytics";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { SpidIdp } from "../../../../../utils/idps";
import {
  assistanceToolRemoteConfig,
  handleSendAssistanceLog
} from "../../../../../utils/supportAssistance";
import { openWebUrl } from "../../../../../utils/url";
import { setIdpSelectedActiveSessionLogin } from "../../../activeSessionLogin/store/actions";
import { isActiveSessionLoginSelector } from "../../../activeSessionLogin/store/selectors";
import { trackSpidLoginIdpSelection } from "../../../common/analytics";
import { trackLoginSpidIdpSelected } from "../../../common/analytics/spidAnalytics";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { idpSelected } from "../../../common/store/actions";
import { LOGIN_TYPES } from "../../../common/utils";
import IdpsGrid, { IdpsGridSkeleton } from "../components/IdpsGrid";
import { OneIdentityIdpSelectionFailureContent } from "../components/OneIdentityIdpSelectionFailureContent";
import { useGetIdps } from "../hooks/useGetIdps";
import { fromIdpToLocalSpidIdp, randomOrderIdps } from "../utils/idps";
⋮----
type OneIdentityIdpSelectionScreenProps = IOStackNavigationRouteProps<
  AuthenticationParamsList,
  "AUTHENTICATION_IDP_SELECTION"
>;
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/store/__test__/reducer.test.tsx">
import {
  resetSpidLoginState,
  setSpidLoginInLoadingState,
  setSpidLoginRequestState
} from "../actions";
import { spidLoginReducer, SpidLoginState } from "../reducers";
import { ErrorType } from "../types";
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { ErrorType } from "../types";
⋮----
export type SpidConfigActions =
  | ActionType<typeof resetSpidLoginState>
  | ActionType<typeof setSpidLoginInLoadingState>
  | ActionType<typeof setSpidLoginRequestState>;
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/store/reducers/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../../store/actions/types";
import {
  resetSpidLoginState,
  setSpidLoginInLoadingState,
  setSpidLoginRequestState
} from "../actions";
import { SpidLoginRequestInfo } from "../types";
⋮----
export type SpidLoginState = {
  requestInfo: SpidLoginRequestInfo;
};
⋮----
export const spidLoginReducer = (
  state: SpidLoginState = spidLoginInitialState,
  action: Action
): SpidLoginState =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/store/selectors/index.ts">
import { GlobalState } from "../../../../../../store/reducers/types";
⋮----
export const spidLoginRequestInfoSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/store/types/index.ts">
export enum ErrorType {
  LOADING_ERROR = "LOADING_ERROR",
  LOGIN_ERROR = "LOGIN_ERROR"
}
⋮----
export type SpidLoginRequestInfo = {
  requestState: pot.Pot<true, ErrorType>;
};
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/types/idps.ts">
import { z } from "zod";
⋮----
export type Idp = z.infer<typeof IdpSchema>;
⋮----
export type Idps = z.infer<typeof IdpsSchema>;
⋮----
export type IdpFriendlyNames = z.infer<typeof IdpFriendlyNamesSchema>;
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/utils/idps.ts">
import { SpidIdp } from "../../../../../utils/idps";
import { Idp, Idps } from "../types/idps";
⋮----
const getIdpLogos = (entityID: Idp["entityID"]) =>
⋮----
export const fromIdpToLocalSpidIdp = (idps: Idps): ReadonlyArray<SpidIdp>
⋮----
export const randomOrderIdps = <T>(array: ReadonlyArray<T>): Array<T> =>
</file>

<file path="apps/main-app/ts/features/authentication/login/idp/utils/spidErrorCode.ts">
export const getSpidErrorCodeDescription = (errorCode: string)
</file>

<file path="apps/main-app/ts/features/authentication/login/landing/components/LandingSessionExpiredComponent.tsx">
import {
  Body,
  ContentWrapper,
  H3,
  IOButton,
  IOButtonLinkSpecificProps,
  IOPictograms,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
import { Ref } from "react";
import { ScrollView, useWindowDimensions, View } from "react-native";
⋮----
type Props = {
  accessibilityHint?: string;
  accessibilityLabel?: string;
  buttonLink?: Pick<
    IOButtonLinkSpecificProps,
    | "accessibilityHint"
    | "accessibilityLabel"
    | "color"
    | "icon"
    | "label"
    | "onPress"
    | "testID"
  >;
  content: string;
  pictogramName: IOPictograms;
  ref?: Ref<View>;
  title: string;
};
</file>

<file path="apps/main-app/ts/features/authentication/login/landing/hooks/useInfoBottomsheetComponent.tsx">
import { IdpData } from "@io-app/api-types/generated/definitions/content/IdpData";
import { Divider, ListItemAction } from "@io-app/design-system";
import I18n from "i18next";
import _isEqual from "lodash/isEqual";
import { useCallback, useRef } from "react";
import { View } from "react-native";
⋮----
import AppVersion from "../../../../../components/AppVersion";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { SpidIdp } from "../../../../../utils/idps";
import { openWebUrl } from "../../../../../utils/url";
import { tosConfigSelector } from "../../../../tos/store/selectors";
import {
  trackLoginInfoResourceTap,
  trackLoginInfoTap
} from "../../../common/analytics";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { idpSelected } from "../../../common/store/actions";
import { isFastLoginFFEnabledSelector } from "../../../fastLogin/store/selectors";
import { Identifier } from "../../optIn/screens/OptInScreen";
⋮----
const onTapAppVersion = () =>
</file>

<file path="apps/main-app/ts/features/authentication/login/landing/screens/LandingScreen.tsx">
import {
  ContentWrapper,
  IOButton,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
⋮----
import I18n from "i18next";
import JailMonkey from "jail-monkey";
import {
  ComponentProps,
  useCallback,
  useEffect,
  useMemo,
  useRef,
  useState
} from "react";
import { Alert, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { LandingCardComponent } from "../../../../../components/LandingCardComponent";
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
import SectionStatusComponent from "../../../../../components/SectionStatus";
import { helpCenterHowToDoWhenSessionIsExpiredUrl } from "../../../../../config";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { mixpanelTrack } from "../../../../../mixpanel";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { startupLoadSuccess } from "../../../../../store/actions/startup";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { continueWithRootOrJailbreakSelector } from "../../../../../store/reducers/persistedPreferences";
import { StartupStatusEnum } from "../../../../../store/reducers/startup";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { trackHelpCenterCtaTapped } from "../../../../../utils/analytics";
import { isTablet } from "../../../../../utils/device";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../../utils/url";
import { identificationRequest } from "../../../../identification/store/actions";
import { setOfflineAccessReason } from "../../../../ingress/store/actions";
import { OfflineAccessReasonEnum } from "../../../../ingress/store/reducer";
import { itwOfflineAccessAvailableSelector } from "../../../../itwallet/common/store/selectors";
import {
  trackCieLoginSelected,
  trackSpidLoginSelected
} from "../../../common/analytics";
import { Carousel } from "../../../common/components/Carousel";
import { useCieLoginMethodSelection } from "../../../common/hooks/useCieLoginMethodSelection";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import {
  sessionCorrupted,
  sessionExpired
} from "../../../common/store/actions";
import {
  isSessionCorruptedSelector,
  isSessionExpiredSelector
} from "../../../common/store/selectors";
import { LOGIN_TYPES } from "../../../common/utils";
import { isCieLoginUatEnabledSelector } from "../../cie/store/selectors";
import useNavigateToLoginMethod from "../../hooks/useNavigateToLoginMethod";
import { LandingSessionExpiredComponent } from "../components/LandingSessionExpiredComponent";
import { useInfoBottomsheetComponent } from "../hooks/useInfoBottomsheetComponent";
⋮----
const navigateToWallet = () =>
⋮----
if (isTablet())
</file>

<file path="apps/main-app/ts/features/authentication/login/optIn/screens/OptInScreen.tsx">
import {
  ContentWrapper,
  FeatureInfo,
  H3,
  IODimensions,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
import {
  NavigatorScreenParams,
  Route,
  useFocusEffect,
  useRoute
} from "@react-navigation/native";
import I18n from "i18next";
import { useRef } from "react";
import { View } from "react-native";
⋮----
import { IOScrollView } from "../../../../../components/ui/IOScrollView";
import { useDetectSmallScreen } from "../../../../../hooks/useDetectSmallScreen";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useSecuritySuggestionsBottomSheet } from "../../../../../hooks/useSecuritySuggestionBottomSheet";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { setFastLoginOptSessionLogin } from "../../../activeSessionLogin/store/actions";
import { isActiveSessionLoginSelector } from "../../../activeSessionLogin/store/selectors";
import { AuthenticationParamsList } from "../../../common/navigation/params/AuthenticationParamsList";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import {
  trackLoginSessionOptIn,
  trackLoginSessionOptIn30,
  trackLoginSessionOptIn365,
  trackLoginSessionOptInInfo
} from "../../../fastLogin/analytics/optinAnalytics";
import { setFastLoginOptIn } from "../../../fastLogin/store/actions/optInActions";
⋮----
export enum Identifier {
  CIE = "CIE",
  CIE_ID = "CIE_ID",
  SPID = "SPID",
  TEST = "TEST"
}
⋮----
export type ChosenIdentifier = {
  identifier: Identifier;
};
⋮----
const getNavigationParams =
(): NavigatorScreenParams<AuthenticationParamsList> => (
⋮----
const navigateToIdpPage = (isLV: boolean) =>
⋮----
body=
</file>

<file path="apps/main-app/ts/features/authentication/login/unlockAccess/components/UnlockAccessComponent.tsx">
import {
  FeatureInfo,
  H6,
  IOMarkdownLite,
  VSpacer
} from "@io-app/design-system";
import { StackActions } from "@react-navigation/native";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { IOScrollViewCentredContent } from "../../../../../components/ui/IOScrollViewCentredContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../store/hooks";
import { absolutePortalLinksSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { openWebUrl } from "../../../../../utils/url";
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import { AUTH_LEVELS, AuthLevel } from "../../../common/utils";
⋮----
export type UnlockAccessProps = {
  authLevel: AuthLevel;
};
⋮----
body=
⋮----
const onPressActionButton = () =>
⋮----
isL2
</file>

<file path="apps/main-app/ts/features/authentication/login/unlockAccess/screens/UnlockAccessScreen.tsx">
import { Route, useRoute } from "@react-navigation/native";
⋮----
import { AUTHENTICATION_ROUTES } from "../../../common/navigation/routes";
import UnlockAccessComponent, {
  UnlockAccessProps
} from "../components/UnlockAccessComponent";
⋮----
const UnlockAccessScreen = () =>
</file>

<file path="apps/main-app/ts/features/authentication/loginInfo/store/__test__/reducer.test.ts">
import { loginSuccess } from "../../../common/store/actions";
import { loginInfoReducer } from "../reducers";
</file>

<file path="apps/main-app/ts/features/authentication/loginInfo/store/__test__/selector.test.ts">
import { userFromSuccessLoginSelector } from "../selectors";
</file>

<file path="apps/main-app/ts/features/authentication/loginInfo/store/reducers/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { loginSuccess } from "../../../common/store/actions";
⋮----
export type LoginInfoState = {
  userFromSuccessLogin: boolean;
};
⋮----
export const loginInfoReducer = (
  state: LoginInfoState = { userFromSuccessLogin: false },
  action: Action
): LoginInfoState =>
</file>

<file path="apps/main-app/ts/features/authentication/loginInfo/store/selectors/index.ts">
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const userFromSuccessLoginSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/authentication/playgrounds/components/SessionSection.tsx">
import { ListItemHeader, ListItemInfo } from "@io-app/design-system";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { spidLevelFromSessionInfoSelector } from "../../common/store/selectors";
⋮----
export const SessionSection = () =>
</file>

<file path="apps/main-app/ts/features/authentication/playgrounds/screens/AuthenticationPlayground.tsx">
import { TabItem, TabNavigation, VStack } from "@io-app/design-system";
import { ReactNode, useState } from "react";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { LoginConfigScreenContent } from "../../common/components/LoginConfigScreenContent";
import { SessionSection } from "../components/SessionSection";
⋮----
type PlaygroundTab = {
  content: ReactNode;
  label: string;
};
⋮----
export const AuthenticationPlayground = () =>
</file>

<file path="apps/main-app/ts/features/authentication/README.md">
# Authentication Domain

## Purpose

This directory encapsulates all code **exclusively** related to user authentication and session management within the application. This includes processes like login, token handling, session validation, and secure credential storage.

## Rationale (Refactoring Context)

As part of a codebase refactoring initiative, these files were grouped together to:

1.  **Improve Cohesion:** Keep tightly related authentication logic (UI, state, services, types) in one place.
2.  **Enhance Discoverability:** Make it easier and faster for developers to find authentication-specific code.
3.  **Simplify Maintenance:** Streamline bug fixing and future enhancements related to authentication flows.

## Contents

This module typically includes:

- Authentication-related UI screens.
- State management logic for user session, tokens, and auth status.
- Custom hooks specific to authentication.
- Analytics event tracking specific to authentication flows
- Type definitions relevant to authentication data structures.
- Utility functions for tasks like token handling or validation.

## Guideline

All new code **strictly** concerning user sign-in, sign-up, sign-out, session persistence, token management, or related authentication flows should reside within this module.
</file>

<file path="apps/main-app/ts/features/barcode/analytics/index.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
import { isTestEnv } from "../../../utils/environment";
import { BarcodeFailure } from "../types/failure";
import { IOBarcode, IOBarcodeOrigin } from "../types/IOBarcode";
⋮----
export type BarcodeAnalyticsCode =
  | "avviso"
  | "data_matrix"
  | "firma con IO"
  | "idpay"
  | "ITW aggiunta documento"
  | "ITW presentazione remota"
  | "SEND";
⋮----
export type BarcodeAnalyticsDataEntry = "file" | "qr code";
export type BarcodeAnalyticsFlow = "avviso" | "home" | "idpay";
⋮----
const getEventCodeFromBarcode = (
  barcode: IOBarcode
): BarcodeAnalyticsCode | undefined =>
⋮----
const getDataEntryFromBarcodeOrigin = (
  origin: IOBarcodeOrigin
): BarcodeAnalyticsDataEntry | undefined =>
⋮----
export const trackZendeskSupport = (
  screenName: string,
  flow: BarcodeAnalyticsFlow
) =>
⋮----
export const trackBarcodeCameraAuthorizationNotDetermined = () =>
⋮----
export const trackBarcodeCameraAuthorizationDenied = () =>
⋮----
export const trackBarcodeCameraAuthorized = () =>
⋮----
export const trackBarcodeCameraAuthorizedFromSettings = () =>
⋮----
export const trackBarcodeScanScreenView = (flow: BarcodeAnalyticsFlow) =>
⋮----
export const trackBarcodeScanSuccess = (
  flow: BarcodeAnalyticsFlow,
  barcode: IOBarcode,
  origin: IOBarcodeOrigin
) =>
⋮----
export const trackBarcodeNotFound = () =>
⋮----
export const trackBarcodeScanFailure = (
  flow: BarcodeAnalyticsFlow,
  failure: BarcodeFailure
) =>
⋮----
const trackFn = (internalFlow: BarcodeAnalyticsFlow, reason: string) =>
⋮----
export const trackBarcodeMultipleCodesScreenView = () =>
⋮----
export const trackBarcodeMultipleCodesSelection = () =>
⋮----
export const trackBarcodeScanTorch = () =>
⋮----
export const trackBarcodeManualEntryPath = (flow: BarcodeAnalyticsFlow) =>
⋮----
export const trackBarcodePaymentManualEntry = () =>
⋮----
export const trackBarcodeUploadPath = (flow: BarcodeAnalyticsFlow) =>
⋮----
export const trackBarcodeImageUpload = (flow: BarcodeAnalyticsFlow) =>
⋮----
export const trackBarcodeFileUpload = (flow: BarcodeAnalyticsFlow) =>
</file>

<file path="apps/main-app/ts/features/barcode/components/AnimatedCameraMarker.tsx">
import { IOEasingCurves } from "@io-app/design-system";
import { StyleSheet, View } from "react-native";
import Animated, { AnimatedStyle, FadeIn } from "react-native-reanimated";
⋮----
import CameraMarkerCorner from "../../../../img/camera-marker-corner.svg";
import CameraMarkerLine from "../../../../img/camera-marker-line.svg";
⋮----
type Props = {
  cornerSize?: number;
  isAnimated?: boolean;
  size?: number;
};
</file>

<file path="apps/main-app/ts/features/barcode/components/BarcodeScanBaseScreenComponent.tsx">
import {
  HeaderActionProps,
  HStack,
  IconButton,
  IOColors,
  IODimensions,
  LoadingSpinner,
  TabItem,
  TabNavigation
} from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import {
  useFocusEffect,
  useIsFocused,
  useNavigation
} from "@react-navigation/native";
import { LinearGradient } from "expo-linear-gradient";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { AppState, StyleSheet, View } from "react-native";
import {
  SafeAreaView,
  useSafeAreaInsets
} from "react-native-safe-area-context";
⋮----
import FocusAwareStatusBar from "../../../components/ui/FocusAwareStatusBar";
import { useOfflineToastGuard } from "../../../hooks/useOfflineToastGuard";
import { useStartSupportRequest } from "../../../hooks/useStartSupportRequest";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../store/hooks";
import { canShowHelpSelector } from "../../../store/reducers/assistanceTools";
import { setAccessibilityFocus } from "../../../utils/accessibility";
import { isTestEnv } from "../../../utils/environment";
import {
  BarcodeAnalyticsFlow,
  trackBarcodeCameraAuthorizationDenied,
  trackBarcodeCameraAuthorizationNotDetermined,
  trackBarcodeCameraAuthorized,
  trackBarcodeCameraAuthorizedFromSettings,
  trackBarcodeScanScreenView,
  trackBarcodeScanTorch
} from "../analytics";
import { useCameraPermissionStatus } from "../hooks/useCameraPermissionStatus";
import { useIOBarcodeCameraScanner } from "../hooks/useIOBarcodeCameraScanner";
import { BarcodeFailure } from "../types/failure";
import {
  IOBarcode,
  IOBarcodeFormat,
  IOBarcodeOrigin,
  IOBarcodeType
} from "../types/IOBarcode";
import { CameraPermissionView } from "./CameraPermissionView";
⋮----
type HelpProps = {
  hideHelpButton?: boolean;
};
⋮----
type Props = HelpProps & {
  barcodeAnalyticsFlow: BarcodeAnalyticsFlow;
  barcodeFormats?: Array<IOBarcodeFormat>;
  barcodeTypes?: Array<IOBarcodeType>;
  isDisabled?: boolean;
  isLoading?: boolean;
  onBarcodeError: (failure: BarcodeFailure, origin: IOBarcodeOrigin) => void;
  onBarcodeSuccess: (
    barcodes: Array<IOBarcode>,
    origin: IOBarcodeOrigin
  ) => void;
  onFileInputPressed: () => void;
  onManualInputPressed: () => void;
};
⋮----
const handleTorchToggle = () =>
</file>

<file path="apps/main-app/ts/features/barcode/components/CameraPermissionView.tsx">
import {
  BodySmall,
  H6,
  IOButton,
  IOButtonBlockSpecificProps,
  IODimensions,
  IOPictograms,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
import { StyleSheet, View } from "react-native";
⋮----
type Props = {
  action: Pick<
    IOButtonBlockSpecificProps,
    "accessibilityLabel" | "label" | "onPress"
  >;
  body: string;
  pictogram: IOPictograms;
  title: string;
};
⋮----
const CameraPermissionView = (props: Props) => (
  <View style={styles.container}>
    <Pictogram name={props.pictogram} pictogramStyle="light-content" />
    <VSpacer size={24} />
    <H6 color="white" style={styles.text}>
      {props.title}
    </H6>
    <VSpacer size={8} />
    <BodySmall color="white" style={styles.text} weight="Regular">
      {props.body}
    </BodySmall>
    <VSpacer size={32} />
    <IOButton
      color="contrast"
      fullWidth
      label={props.action.label}
      onPress={props.action.onPress}
      variant="solid"
    />
  </View>
);
</file>

<file path="apps/main-app/ts/features/barcode/hooks/useCameraPermissionStatus.ts">
import { useIsFocused } from "@react-navigation/native";
import { useCallback, useEffect, useState } from "react";
import { AppState, Linking } from "react-native";
import { Camera, CameraPermissionStatus } from "react-native-vision-camera";
⋮----
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { isAndroid } from "../../../utils/platform";
⋮----
export const useCameraPermissionStatus = () =>
</file>

<file path="apps/main-app/ts/features/barcode/hooks/useIOBarcodeCameraScanner.tsx">
import { IOColors, LoadingSpinner } from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import {
  ReactNode,
  useCallback,
  useEffect,
  useMemo,
  useRef,
  useState
} from "react";
import { StyleSheet, View } from "react-native";
import Animated, { FadeIn } from "react-native-reanimated";
import {
  Camera,
  Code,
  CodeType,
  useCameraDevice,
  useCodeScanner
} from "react-native-vision-camera";
⋮----
import { useIOStore } from "../../../store/hooks";
import { AnimatedCameraMarker } from "../components/AnimatedCameraMarker";
import { decodeIOBarcode } from "../types/decoders";
import { BarcodeFailure } from "../types/failure";
import {
  BarcodeFormat,
  IOBarcode,
  IOBarcodeFormat,
  IOBarcodeOrigin,
  IOBarcodeType
} from "../types/IOBarcode";
⋮----
type IOBarcodeFormatsType = {
  [K in IOBarcodeFormat]: BarcodeFormat;
};
⋮----
export type IOBarcodeCameraScanner = {
  cameraComponent: ReactNode;
  hasTorch: boolean;
  isTorchOn: boolean;
  toggleTorch: () => void;
};
⋮----
export type IOBarcodeCameraScannerConfiguration = {
  barcodeFormats?: Array<IOBarcodeFormat>;
  barcodeTypes?: Array<IOBarcodeType>;
  isDisabled?: boolean;
  isLoading?: boolean;
  onBarcodeError: (failure: BarcodeFailure, origin: IOBarcodeOrigin) => void;
  onBarcodeSuccess: (
    barcodes: Array<IOBarcode>,
    origin: IOBarcodeOrigin
  ) => void;
};
⋮----
const convertToIOBarcodeFormat = (
  format: BarcodeFormat
): O.Option<IOBarcodeFormat>
⋮----
const convertFromIOBarcodeFormat = (format: IOBarcodeFormat): CodeType
⋮----
export const retrieveNextBarcode = (barcodes: Array<Code>): O.Option<Code>
⋮----
const toggleTorch = ()
</file>

<file path="apps/main-app/ts/features/barcode/hooks/useIOBarcodeFileReader.tsx">
import { Divider, ListItemNav, VSpacer } from "@io-app/design-system";
import {
  DocumentPickerAsset,
  DocumentPickerOptions,
  getDocumentAsync
} from "expo-document-picker";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { JSX, useState } from "react";
import { Alert, Linking, View } from "react-native";
⋮----
import { useIOStore } from "../../../store/hooks";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import {
  BarcodeAnalyticsFlow,
  trackBarcodeFileUpload,
  trackBarcodeImageUpload,
  trackBarcodeUploadPath
} from "../analytics";
import { BarcodeFailure } from "../types/failure";
import {
  IOBarcode,
  IOBarcodeFormat,
  IOBarcodeOrigin,
  IOBarcodeType
} from "../types/IOBarcode";
import { getUniqueBarcodes } from "../utils/getUniqueBarcodes";
import { imageDecodingTask } from "../utils/imageDecodingTask";
import { imageGenerationTask } from "../utils/imageGenerationTask";
⋮----
type IOBarcodeFileReader = {
  filePickerBottomSheet: JSX.Element;
  isFilePickerVisible: boolean;
  isLoading: boolean;
  showDocumentPicker: () => void;
  showFilePicker: () => void;
  showImagePicker: () => void;
};
⋮----
type IOBarcodeFileReaderConfiguration = {
  barcodeAnalyticsFlow: BarcodeAnalyticsFlow;
  barcodeFormats?: Array<IOBarcodeFormat>;
  barcodeTypes?: Array<IOBarcodeType>;
  onBarcodeError: (failure: BarcodeFailure, origin: IOBarcodeOrigin) => void;
  onBarcodeSuccess: (
    barcodes: Array<IOBarcode>,
    origin: IOBarcodeOrigin
  ) => void;
};
⋮----
const useIOBarcodeFileReader = ({
  onBarcodeError,
  onBarcodeSuccess,
  barcodeFormats,
  barcodeTypes,
  barcodeAnalyticsFlow
}: IOBarcodeFileReaderConfiguration): IOBarcodeFileReader =>
⋮----
const handleBarcodeSuccess = (barcodes: Array<IOBarcode>) =>
⋮----
const handleBarcodeError = (failure: BarcodeFailure) =>
⋮----
const onImageSelected = async (result: ImagePicker.ImagePickerResult) =>
⋮----
const showImagePicker = async () =>
⋮----
const onDocumentSelected = async (asset: DocumentPickerAsset) =>
⋮----
const showDocumentPicker = async () =>
⋮----
const handleImageUploadPressed = async () =>
⋮----
const handleFileUploadPressed = async () =>
⋮----
onPress=
⋮----
const handleShowFilePickerPressed = () =>
</file>

<file path="apps/main-app/ts/features/barcode/screens/BarcodeScanScreen.tsx">
import {
  Divider,
  IOToast,
  ListItemNav,
  triggerHaptic,
  VSpacer
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { Alert, View } from "react-native";
⋮----
import { useHardwareBackButtonWhenFocused } from "../../../hooks/useHardwareBackButton";
import { useOpenDeepLink } from "../../../hooks/useOpenDeepLink";
import { mixpanelTrack } from "../../../mixpanel";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../store/hooks";
import {
  barcodesScannerConfigSelector,
  isIdPayEnabledInScanScreenSelector,
  isPnRemoteEnabledSelector
} from "../../../store/reducers/backendStatus/remoteConfig";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { FCI_ROUTES } from "../../fci/navigation/routes";
import { IdPayPaymentRoutes } from "../../idpay/payment/navigation/routes";
import { ITW_ROUTES } from "../../itwallet/navigation/routes";
import { ITW_REMOTE_ROUTES } from "../../itwallet/presentation/remote/navigation/routes.ts";
import { MESSAGES_ROUTES } from "../../messages/navigation/routes.ts";
import { PaymentsBarcodeRoutes } from "../../payments/barcode/navigation/routes";
import { usePagoPaPayment } from "../../payments/checkout/hooks/usePagoPaPayment";
import { PaymentsCheckoutRoutes } from "../../payments/checkout/navigation/routes";
import { paymentAnalyticsDataSelector } from "../../payments/history/store/selectors";
⋮----
import PN_ROUTES from "../../pn/navigation/routes.ts";
⋮----
import { BarcodeScanBaseScreenComponent } from "../components/BarcodeScanBaseScreenComponent";
import { useIOBarcodeFileReader } from "../hooks/useIOBarcodeFileReader";
import { BarcodeFailure } from "../types/failure";
import {
  IO_BARCODE_ALL_FORMATS,
  IO_BARCODE_ALL_TYPES,
  IOBarcode,
  IOBarcodeFormat,
  IOBarcodeOrigin,
  IOBarcodeType,
  PagoPaBarcode
} from "../types/IOBarcode";
import { getIOBarcodesByType } from "../utils/getBarcodesByType";
⋮----
const BarcodeScanScreen = () =>
⋮----
const handleMultipleBarcodes = (
    barcodes: Array<IOBarcode>,
    origin: IOBarcodeOrigin
) =>
⋮----
const handleSingleBarcode = (barcode: IOBarcode, origin: IOBarcodeOrigin) =>
⋮----
const handleBarcodeSuccess = (
    barcodes: Array<IOBarcode>,
    origin: IOBarcodeOrigin
) =>
⋮----
const handleBarcodeError = (failure: BarcodeFailure) =>
⋮----
const handleIdPayPaymentCodeInput = () =>
⋮----
const handlePagoPACodeInput = () =>
⋮----
const handleManualInputPressed = () =>
</file>

<file path="apps/main-app/ts/features/barcode/types/decoders.ts">
import { SignatureRequestDetailView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestDetailView";
import {
  AmountInEuroCents,
  PaymentNoticeQrCodeFromString,
  RptId,
  rptIdFromPaymentNoticeQrCode
} from "@pagopa/io-pagopa-commons/lib/pagopa";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { pnAarQRCodeRegexSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../store/reducers/types";
import { decodePosteDataMatrix } from "../../../utils/payment";
import { selectItwSpecsVersion } from "../../itwallet/common/store/selectors/environment";
import { parseCredentialOfferLink } from "../../itwallet/offer/utils";
import { validateItwPresentationQrCodeParams } from "../../itwallet/presentation/remote/utils/itwRemotePresentationUtils";
import { ItwRemoteRequestPayload } from "../../itwallet/presentation/remote/utils/itwRemoteTypeUtils";
import { IOBarcodeType } from "./IOBarcode";
⋮----
export type DecodedIOBarcode = RuntimeDecodedIOBarcode | StaticDecodedIOBarcode;
⋮----
type IOBarcodeDecoderFn = IOBarcodeRuntimeDecoderFn | IOBarcodeStaticDecoderFn;
type IOBarcodeRuntimeDecoderFn = (
  state: GlobalState,
  data: string
) => O.Option<DecodedIOBarcode>;
type IOBarcodeRuntimeDecodersType = {
  [K in RuntimeDecodedIOBarcode["type"]]: IOBarcodeRuntimeDecoderFn;
};
⋮----
type IOBarcodeStaticDecoderFn = (data: string) => O.Option<DecodedIOBarcode>;
type IOBarcodeStaticDecodersType = {
  [K in StaticDecodedIOBarcode["type"]]: IOBarcodeStaticDecoderFn;
};
type ItwCredentialOfferDecodedIOBarcode = Extract<
  RuntimeDecodedIOBarcode,
  { type: "ITW_CREDENTIAL_OFFER" }
>;
⋮----
type RuntimeDecodedIOBarcode =
  | {
      itwCredentialOfferUri: string;
      type: "ITW_CREDENTIAL_OFFER";
    }
  | {
      itwRemoteRequestPayload: ItwRemoteRequestPayload;
      type: "ITW_REMOTE";
    }
  | {
      qrCodeContent: string;
      type: "SEND";
    };
⋮----
type StaticDecodedIOBarcode =
  | {
      amount: AmountInEuroCents;
      rptId: RptId;
      type: "PAGOPA";
    }
  | {
      authUrl: string;
      trxCode: string;
      type: "IDPAY";
    }
  | {
      signatureRequestId: SignatureRequestDetailView["id"];
      type: "FCI";
    };
⋮----
const decodeIdPayBarcode: IOBarcodeStaticDecoderFn = (data: string)
⋮----
const decodePagoPAQRCode: IOBarcodeStaticDecoderFn = (data: string)
⋮----
const decodePagoPADataMatrix: IOBarcodeStaticDecoderFn = (data: string)
⋮----
const decodePagoPABarcode: IOBarcodeStaticDecoderFn = (data: string)
⋮----
const decodeFciBarcode: IOBarcodeStaticDecoderFn = (data: string)
⋮----
const decodeItwRemoteBarcode: IOBarcodeRuntimeDecoderFn = (
  state: GlobalState,
  data: string
)
⋮----
const decodeItwCredentialOfferBarcode: IOBarcodeRuntimeDecoderFn = (
  _state: GlobalState,
  data: string
): O.Option<ItwCredentialOfferDecodedIOBarcode> =>
⋮----
const decodeSENDAarBarcode: IOBarcodeRuntimeDecoderFn = (
  state: GlobalState,
  data: string
)
⋮----
type DecodeOptions = {
  barcodeTypes?: ReadonlyArray<IOBarcodeType>;
};
⋮----
export const decodeIOBarcode = (
... (14 lines truncated)
</file>

<file path="apps/main-app/ts/features/barcode/types/failure.ts">
import { IOBarcodeFormat } from "./IOBarcode";
⋮----
export type BarcodeFailure =
  | {
      content?: string;
      format: IOBarcodeFormat;
      reason: "UNKNOWN_CONTENT";
    }
  | {
      reason: Exclude<BarcodeFailureType, "UNKNOWN_CONTENT">;
    };
⋮----
type BarcodeFailureType =
  | "BARCODE_NOT_FOUND"
  | "INVALID_FILE"
  | "UNEXPECTED"
  | "UNKNOWN_CONTENT"
  | "UNSUPPORTED_FORMAT";
</file>

<file path="apps/main-app/ts/features/barcode/types/IOBarcode.ts">
import { DecodedIOBarcode, IOBarcodeDecoders } from "./decoders";
⋮----
export enum BarcodeFormat {
  CODE_39 = "code-39",
  CODE_128 = "code-128",
  DATA_MATRIX = "data-matrix",
  ITF = "itf",
  QR_CODE = "qr"
}
export type IOBarcodeFormat = (typeof IO_BARCODE_ALL_FORMATS)[number];
⋮----
export type IOBarcodeOrigin = "camera" | "file";
⋮----
export type IOBarcodeType = DecodedIOBarcode["type"];
⋮----
export type IOBarcode = DecodedIOBarcode & {
  format: IOBarcodeFormat;
};
⋮----
export type PagoPaBarcode = IOBarcode & { type: "PAGOPA" };
</file>

<file path="apps/main-app/ts/features/barcode/utils/barcodeDetectionTask.ts">
import RNQRGenerator, {
  QRCodeDetectOptions,
  QRCodeScanResult
} from "rn-qr-generator";
⋮----
import { BarcodeFailure } from "../types/failure";
⋮----
export const barcodeDetectionTask = (
  detectOptions: QRCodeDetectOptions
): TE.TaskEither<BarcodeFailure, QRCodeScanResult>
</file>

<file path="apps/main-app/ts/features/barcode/utils/getBarcodesByType.ts">
import { IOBarcode, IOBarcodeType } from "../types/IOBarcode";
⋮----
export type IOBarcodesByType = { [type in IOBarcodeType]?: Array<IOBarcode> };
⋮----
export const getIOBarcodesByType = (
  barcodes: Array<IOBarcode>
): IOBarcodesByType
</file>

<file path="apps/main-app/ts/features/barcode/utils/getUniqueBarcodes.ts">
import { IOBarcode } from "../types/IOBarcode";
⋮----
export const getUniqueBarcodes = (
  barcodes: Array<IOBarcode>
): Array<IOBarcode>
</file>

<file path="apps/main-app/ts/features/barcode/utils/imageDecodingTask.ts">
import { sequenceS } from "fp-ts/lib/Apply";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { Eq } from "fp-ts/lib/string";
⋮----
import { QRCodeDetectOptions, CodeType as RNQRCodeType } from "rn-qr-generator";
⋮----
import { GlobalState } from "../../../store/reducers/types";
import { decodeMultipleIOBarcodes } from "../types/decoders";
import { BarcodeFailure } from "../types/failure";
import { IOBarcode, IOBarcodeFormat, IOBarcodeType } from "../types/IOBarcode";
import { barcodeDetectionTask } from "./barcodeDetectionTask";
⋮----
const convertToIOBarcodeFormat = (
  format: RNQRCodeType
): O.Option<IOBarcodeFormat>
⋮----
const checkDetectedBarcodesFormat = (
  type: RNQRCodeType,
  barcodeFormats?: Array<IOBarcodeFormat>
): TE.TaskEither<BarcodeFailure, IOBarcodeFormat>
⋮----
const checkDetectedBarcodesArray = (
  barcodes: Array<string>
): TE.TaskEither<BarcodeFailure, Array<string>>
⋮----
const decodeDetectedBarcodes = (
  barcodes: Array<string>,
  format: IOBarcodeFormat,
  state: GlobalState,
  barcodeTypes?: Array<IOBarcodeType>
): TE.TaskEither<BarcodeFailure, Array<IOBarcode>>
⋮----
export const imageDecodingTask = (
  state: GlobalState,
  detectOptions: QRCodeDetectOptions,
  barcodeFormats?: Array<IOBarcodeFormat>,
  barcodeTypes?: Array<IOBarcodeType>
): TE.TaskEither<BarcodeFailure, Array<IOBarcode>>
</file>

<file path="apps/main-app/ts/features/barcode/utils/imageGenerationTask.ts">
import { generatePdfHighResImages } from "@io-app/expo-pdf-high-res-generator";
⋮----
import { BarcodeFailure } from "../types/failure";
⋮----
export const imageGenerationTask = (
  pdfUri: string
): TE.TaskEither<BarcodeFailure, Array<
</file>

<file path="apps/main-app/ts/features/barcode/index.ts">
import { BarcodeScanBaseScreenComponent } from "./components/BarcodeScanBaseScreenComponent";
import { useIOBarcodeFileReader } from "./hooks/useIOBarcodeFileReader";
import { BarcodeFailure } from "./types/failure";
import { IOBarcode, IOBarcodeFormat, IOBarcodeType } from "./types/IOBarcode";
</file>

<file path="apps/main-app/ts/features/bonus/__mock__/availableBonuses.ts">
import { BonusesAvailable } from "@io-app/api-types/generated/definitions/content/BonusesAvailable";
import { BonusVisibilityEnum } from "@io-app/api-types/generated/definitions/content/BonusVisibility";
⋮----
import { ID_CGN_TYPE } from "../common/utils";
</file>

<file path="apps/main-app/ts/features/bonus/cdc/activation/screens/CdcBonusRequestInformationTos.tsx">
import { IODimensions, IOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useRef } from "react";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { isMixpanelEnabled as isMixpanelEnabledSelector } from "../../../../../store/reducers/persistedPreferences";
import { getDeviceId } from "../../../../../utils/device";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { useFIMSRemoteServiceConfiguration } from "../../../../fims/common/hooks";
import BonusInformationComponent, {
  BonusInformationComponentRef
} from "../../../common/components/BonusInformationComponent";
import { availableBonusTypesSelectorFromId } from "../../../common/store/selectors";
import { ID_CDC_TYPE } from "../../../common/utils";
⋮----
import { cdcCtaConfigSelector } from "../../common/store/selectors/remoteConfig";
⋮----
const CdcBonusRequestInformationTos = () =>
⋮----
const onStartCdcFlow = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cdc/analytics/index.ts">
import { select } from "typed-redux-saga/macro";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { cdcStatusHandler } from "../../../../mixpanelConfig/mixpanelPropertyUtils.ts";
import { updateMixpanelProfileProperties } from "../../../../mixpanelConfig/profileProperties.ts";
import { GlobalState } from "../../../../store/reducers/types.ts";
import { buildEventProperties } from "../../../../utils/analytics";
⋮----
export const trackCdcRequestIntro = ()
⋮----
export const trackCdcRequestIntroContinue = ()
⋮----
export const trackCdcGoToService = ()
⋮----
export const trackCdcCardError = ()
</file>

<file path="apps/main-app/ts/features/bonus/cdc/common/api/client.ts">
import { createClient } from "@io-app/api-types/generated/definitions/cdc/client";
⋮----
import { defaultRetryingFetch } from "../../../../../utils/fetch";
⋮----
export const createCdcClient = (baseUrl: string, sessionToken: string)
⋮----
export type CdcClient = ReturnType<typeof createCdcClient>;
</file>

<file path="apps/main-app/ts/features/bonus/cdc/common/hooks/useSpecialCtaCdc.tsx">
import { IOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { IOScrollViewActions } from "../../../../../components/ui/IOScrollView";
import { useIOSelector } from "../../../../../store/hooks";
import { isCdcAppVersionSupportedSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { isMixpanelEnabled as isMixpanelEnabledSelector } from "../../../../../store/reducers/persistedPreferences.ts";
import { getDeviceId } from "../../../../../utils/device.ts";
import { useFIMSRemoteServiceConfiguration } from "../../../../fims/common/hooks";
⋮----
import { cdcWalletVisibilityConfigSelector } from "../store/selectors/remoteConfig.ts";
⋮----
const useCdcGoToService = () =>
⋮----
export const useSpecialCtaCdc = ():
  | IOScrollViewActions["primary"]
  | undefined => {
  const isCdcEnabled = useIOSelector(isCdcAppVersionSupportedSelector);
</file>

<file path="apps/main-app/ts/features/bonus/cdc/common/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../../utils/navigation";
import CdcBonusRequestInformationTos from "../../activation/screens/CdcBonusRequestInformationTos";
import { CdcBonusRequestParamsList } from "./params";
import { CDC_ROUTES } from "./routes";
⋮----
export const CdcNavigator = () => (
  <Stack.Navigator
    initialRouteName={CDC_ROUTES.CDC_INFORMATION_TOS}
    screenOptions={{ gestureEnabled: isGestureEnabled, headerShown: true }}
  >
    <Stack.Screen
      component={CdcBonusRequestInformationTos}
      name={CDC_ROUTES.CDC_INFORMATION_TOS}
    />
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/features/bonus/cdc/common/navigation/params.ts">
import { CDC_ROUTES } from "./routes";
⋮----
export type CdcBonusRequestParamsList = {
  [CDC_ROUTES.CDC_INFORMATION_TOS]: undefined;
  [CDC_ROUTES.CDC_MAIN]: undefined;
};
</file>

<file path="apps/main-app/ts/features/bonus/cdc/common/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/bonus/cdc/common/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { fork, select } from "typed-redux-saga/macro";
⋮----
import { apiUrlPrefix } from "../../../../../config";
import { watchCdcWalletSaga } from "../../wallet/saga";
import { createCdcClient } from "../api/client";
import { isCdCWalletVisibilityEnabledSelector } from "../store/selectors/remoteConfig";
</file>

<file path="apps/main-app/ts/features/bonus/cdc/common/store/actions/index.ts">
import { CdcWalletActions } from "../../../wallet/store/actions";
⋮----
export type CdcActions = CdcWalletActions;
</file>

<file path="apps/main-app/ts/features/bonus/cdc/common/store/reducers/index.ts">
import { combineReducers } from "redux";
⋮----
import cdcWalletReducer, {
  CdcWalletState
} from "../../../wallet/store/reducers";
⋮----
export type CdcState = {
  wallet: CdcWalletState;
};
</file>

<file path="apps/main-app/ts/features/bonus/cdc/common/store/selectors/remoteConfig.ts">
import { createSelector } from "reselect";
⋮----
import { remoteConfigSelector } from "../../../../../../store/reducers/backendStatus/remoteConfig";
import { isPropertyWithMinAppVersionEnabled } from "../../../../../../store/reducers/featureFlagWithMinAppVersionStatus";
import { GlobalState } from "../../../../../../store/reducers/types";
⋮----
const cdcRemoteConfigSelector = (state: GlobalState) =>
⋮----
export const isCdCWalletVisibilityEnabledSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/bonus/cdc/wallet/components/CdcCard.tsx">
import { CitizenStatus } from "@io-app/api-types/generated/definitions/cdc/CitizenStatus";
import {
  Avatar,
  Body,
  H6,
  HStack,
  Icon,
  useIOThemeContext,
  VSpacer
} from "@io-app/design-system";
import { format } from "date-fns";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import WalletCardShape from "../../../../../../img/features/cdc/cdc_wallet_card.svg";
import DarkModeWalletCardShape from "../../../../../../img/features/cdc/cdc_wallet_card_dark.svg";
import { contentRepoUrl } from "../../../../../config.ts";
⋮----
export type CdcCardProps = CitizenStatus;
⋮----
export const CdcCard = (props: CdcCardProps) =>
</file>

<file path="apps/main-app/ts/features/bonus/cdc/wallet/components/CdcWalletCard.tsx">
import { IOToast } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { isMixpanelEnabled as isMixpanelEnabledSelector } from "../../../../../store/reducers/persistedPreferences";
import { getDeviceId } from "../../../../../utils/device";
import { useFIMSRemoteServiceConfiguration } from "../../../../fims/common/hooks";
import { withWalletCardBaseComponent } from "../../../../wallet/components/WalletCardBaseComponent";
import { WalletCardPressableBase } from "../../../../wallet/components/WalletCardPressableBase";
import { cdcWalletVisibilityConfigSelector } from "../../common/store/selectors/remoteConfig";
import { CdcCard, CdcCardProps } from "./CdcCard";
⋮----
const WrappedCdcCard = (props: CdcCardProps) =>
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cdc/wallet/saga/handleGetCdcStatusWallet.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../../types/utils";
import { getNetworkError } from "../../../../../utils/errors";
import { withRefreshApiCall } from "../../../../authentication/fastLogin/saga/utils";
import { walletAddCards } from "../../../../wallet/store/actions/cards";
⋮----
import { CdcClient } from "../../common/api/client";
import { getCdcStatusWallet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/bonus/cdc/wallet/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { CdcClient } from "../../common/api/client";
import { getCdcStatusWallet } from "../store/actions";
import { handleGetCdcStatusWallet } from "./handleGetCdcStatusWallet";
</file>

<file path="apps/main-app/ts/features/bonus/cdc/wallet/store/actions/index.ts">
import { CitizenStatus } from "@io-app/api-types/generated/definitions/cdc/CitizenStatus";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../../utils/errors";
⋮----
export type CdcWalletActions = ActionType<typeof getCdcStatusWallet>;
</file>

<file path="apps/main-app/ts/features/bonus/cdc/wallet/store/reducers/index.ts">
import { CitizenStatus } from "@io-app/api-types/generated/definitions/cdc/CitizenStatus";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../../store/actions/types";
import { NetworkError } from "../../../../../../utils/errors";
import { getCdcStatusWallet } from "../actions";
⋮----
export type CdcWalletState = {
  cdcStatus: pot.Pot<CitizenStatus, NetworkError>;
};
⋮----
const cdcWalletReducer = (
  state: CdcWalletState = INITIAL_STATE,
  action: Action
): CdcWalletState =>
</file>

<file path="apps/main-app/ts/features/bonus/cdc/wallet/store/selectors/index.ts">
import { GlobalState } from "../../../../../../store/reducers/types";
⋮----
export const cdcStatusSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/analytics/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { Action } from "../../../../store/actions/types";
import { buildEventProperties } from "../../../../utils/analytics";
import { getNetworkErrorMessage } from "../../../../utils/errors";
import CGN_ROUTES from "../navigation/routes";
import {
  cgnActivationBack,
  cgnActivationCancel,
  cgnActivationComplete,
  cgnActivationFailure,
  cgnActivationStart,
  cgnActivationStatus,
  cgnRequestActivation
} from "../store/actions/activation";
import { cgnCodeFromBucket } from "../store/actions/bucket";
import { cgnCategories } from "../store/actions/categories";
import { cgnDetails } from "../store/actions/details";
import {
  cgnEycaActivation,
  cgnEycaActivationCancel,
  cgnEycaActivationStatusRequest
} from "../store/actions/eyca/activation";
import { cgnEycaStatus } from "../store/actions/eyca/details";
import {
  cgnOfflineMerchants,
  cgnOnlineMerchants,
  cgnSelectedMerchant
} from "../store/actions/merchants";
import { cgnGenerateOtp } from "../store/actions/otp";
import { cgnUnsubscribe } from "../store/actions/unsubscribe";
⋮----
export type TrackCgnStatus = "active" | "not_active";
⋮----
const trackCgnAction = (action: Action): void =>
⋮----
type TrackCgnEngagementBannerEvent = "BANNER" | "CLOSE_BANNER" | "TAP_BANNER";
⋮----
export const trackCgnEngagementBanner = (
  event: TrackCgnEngagementBannerEvent
)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/api/backendCgn.ts">
import {
  generateOtpDefaultDecoder,
  GenerateOtpT,
  getCgnActivationDefaultDecoder,
  GetCgnActivationT,
  getCgnStatusDefaultDecoder,
  GetCgnStatusT,
  getEycaActivationDefaultDecoder,
  GetEycaActivationT,
  getEycaStatusDefaultDecoder,
  GetEycaStatusT,
  startCgnActivationDefaultDecoder,
  StartCgnActivationT,
  startCgnUnsubscriptionDefaultDecoder,
  StartCgnUnsubscriptionT,
  startEycaActivationDefaultDecoder,
  StartEycaActivationT
} from "@io-app/api-types/generated/definitions/cgn/requestTypes";
import {
  ApiHeaderJson,
  composeHeaderProducers,
  createFetchRequestForApi,
  RequestHeaderProducer,
  RequestHeaders
} from "@pagopa/ts-commons/lib/requests";
⋮----
import { withBearerToken as withToken } from "../../../../utils/api";
import { defaultRetryingFetch } from "../../../../utils/fetch";
⋮----
export function BackendCGN(
  baseUrl: string,
  token: string,
  fetchApi: typeof fetch = defaultRetryingFetch()
)
⋮----
function ParamAuthorizationBearerHeaderProducer<
  P extends { readonly Bearer: string }
>(): RequestHeaderProducer<P, "Authorization">
</file>

<file path="apps/main-app/ts/features/bonus/cgn/api/backendCgnMerchants.ts">
import {
  countDefaultDecoder,
  CountT,
  getDiscountBucketCodeDefaultDecoder,
  GetDiscountBucketCodeT,
  getMerchantDefaultDecoder,
  GetMerchantT,
  getOfflineMerchantsDefaultDecoder,
  GetOfflineMerchantsT,
  getOnlineMerchantsDefaultDecoder,
  GetOnlineMerchantsT,
  getPublishedProductCategoriesDefaultDecoder,
  GetPublishedProductCategoriesT,
  searchDefaultDecoder,
  SearchT
} from "@io-app/api-types/generated/definitions/cgn/merchants/requestTypes";
import {
  ApiHeaderJson,
  composeHeaderProducers,
  createFetchRequestForApi
} from "@pagopa/ts-commons/lib/requests";
⋮----
import { tokenHeaderProducer, withBearerToken } from "../../../../utils/api";
import { defaultRetryingFetch } from "../../../../utils/fetch";
⋮----
export function BackendCgnMerchants(
  baseUrl: string,
  token: string,
  fetchApi: typeof fetch = defaultRetryingFetch()
)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/__test__/CgnCardComponent.test.tsx">
import { Card } from "@io-app/api-types/generated/definitions/cgn/Card";
import { StatusEnum as CgnActivatedStatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import { StatusEnum as CgnExpiredStatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardExpired";
import { StatusEnum as CgnPendingStatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardPending";
import {
  CardRevoked,
  StatusEnum as CgnRevokedStatusEnum
} from "@io-app/api-types/generated/definitions/cgn/CardRevoked";
import { render } from "@testing-library/react-native";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
import { CgnCardStatus } from "../../CgnCardStatus";
⋮----
const getComponent = (card: Card) =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/__test__/CgnOwnershipInformation.test.tsx">
import { render } from "@testing-library/react-native";
import I18n from "i18next";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
⋮----
import mockedProfile from "../../../../../../__mocks__/initializedProfile";
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
import CgnOwnershipInformation from "../CgnOwnershipInformation";
⋮----
const renderComponent = (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/__test__/CgnStatusDetail.test.tsx">
import { Card } from "@io-app/api-types/generated/definitions/cgn/Card";
import { StatusEnum as CgnActivatedStatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import { StatusEnum as CgnExpiredStatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardExpired";
import { StatusEnum as CgnPendingStatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardPending";
import {
  CardRevoked,
  StatusEnum as CgnRevokedStatusEnum
} from "@io-app/api-types/generated/definitions/cgn/CardRevoked";
import { render } from "@testing-library/react-native";
import I18n from "i18next";
⋮----
import { formatDateAsShortFormat } from "../../../../../../utils/dates";
import CgnStatusDetail from "../CgnStatusDetail";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/__test__/CgnUnsubscribe.test.tsx">
import { fireEvent, render } from "@testing-library/react-native";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
import CgnUnsubscribe from "../CgnUnsubscribe";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/eyca/__test__/EycaDetailComponent.test.tsx">
import { StatusEnum as AcivatedStatus } from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import { StatusEnum as PendingStatus } from "@io-app/api-types/generated/definitions/cgn/CardPending";
import { CcdbNumber } from "@io-app/api-types/generated/definitions/cgn/CcdbNumber";
import { EycaCard } from "@io-app/api-types/generated/definitions/cgn/EycaCard";
import { fireEvent, render } from "@testing-library/react-native";
import I18n from "i18next";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
⋮----
import { applicationChangeState } from "../../../../../../../store/actions/application";
import { appReducer } from "../../../../../../../store/reducers";
import { GlobalState } from "../../../../../../../store/reducers/types";
import { cgnEycaActivation } from "../../../../store/actions/eyca/activation";
import { cgnEycaStatus } from "../../../../store/actions/eyca/details";
import { CgnEycaActivationStatus } from "../../../../store/reducers/eyca/activation";
import EycaDetailComponent from "../EycaDetailComponent";
⋮----
const mockEYCAState = (
  card?: EycaCard,
  activation?: CgnEycaActivationStatus,
  activationLoading?: boolean
) =>
⋮----
const getComponent = (store: any)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/eyca/EycaDetailComponent.tsx">
import { CardPending } from "@io-app/api-types/generated/definitions/cgn/CardPending";
import { EycaCard } from "@io-app/api-types/generated/definitions/cgn/EycaCard";
import { Alert, ListItemHeader, LoadingSpinner } from "@io-app/design-system";
import I18n from "i18next";
import { JSX, useCallback, useEffect } from "react";
import { View } from "react-native";
⋮----
import { isLoading } from "../../../../../../common/model/RemoteValue";
import { useIODispatch, useIOSelector } from "../../../../../../store/hooks";
import {
  cgnEycaActivation,
  cgnEycaActivationStatusRequest
} from "../../../store/actions/eyca/activation";
import {
  cgnEycaActivationLoading,
  cgnEycaActivationStatus
} from "../../../store/reducers/eyca/activation";
import {
  eycaCardSelector,
  eycaDetailSelector
} from "../../../store/reducers/eyca/details";
import { useEycaInformationBottomSheet } from "./EycaInformationComponent";
import EycaStatusDetailsComponent from "./EycaStatusDetailsComponent";
⋮----
const renderComponentEycaStatus = (
    eycaCard: EycaCard
): JSX.Element | null =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/eyca/EycaInformationComponent.tsx">
import {
  IOButton,
  IOMarkdownLite,
  IOToast,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOSelector } from "../../../../../../store/hooks";
import { getEYCABaseUrl } from "../../../../../../store/reducers/backendStatus/remoteConfig";
import { useIOBottomSheetModal } from "../../../../../../utils/hooks/bottomSheet";
import { openWebUrl } from "../../../../../../utils/url";
⋮----
export const useEycaInformationBottomSheet = ()
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/eyca/EycaStatusDetailsComponent.tsx">
import { EycaCardActivated } from "@io-app/api-types/generated/definitions/cgn/EycaCardActivated";
import { EycaCardExpired } from "@io-app/api-types/generated/definitions/cgn/EycaCardExpired";
import { EycaCardRevoked } from "@io-app/api-types/generated/definitions/cgn/EycaCardRevoked";
import { Divider, ListItemInfo, ListItemInfoCopy } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { clipboardSetStringWithFeedback } from "../../../../../../utils/clipboard";
import { formatDateAsShortFormat } from "../../../../../../utils/dates";
import { getAccessibleExpirationDate } from "../../../utils/dates";
⋮----
type Props = {
  eycaCard: EycaCardActivated | EycaCardExpired | EycaCardRevoked;
};
⋮----
onPress=
⋮----
accessibilityLabel=
⋮----
value=
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/CgnOwnershipInformation.tsx">
import { Divider, ListItemHeader, ListItemInfo } from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { ReactElement } from "react";
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { capitalizeTextName } from "../../../../../utils/strings";
import { profileSelector } from "../../../../settings/common/store/selectors";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/CgnStatusDetail.tsx">
import { Card } from "@io-app/api-types/generated/definitions/cgn/Card";
import { CardActivated } from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import { CardExpired } from "@io-app/api-types/generated/definitions/cgn/CardExpired";
import { CardPending } from "@io-app/api-types/generated/definitions/cgn/CardPending";
import { CardRevoked } from "@io-app/api-types/generated/definitions/cgn/CardRevoked";
import { Divider, ListItemHeader, ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { FunctionComponent } from "react";
import { View } from "react-native";
⋮----
import { formatDateAsShortFormat } from "../../../../../utils/dates";
import { getAccessibleExpirationDate } from "../../utils/dates";
⋮----
type Props = {
  cgnDetail: Card;
};
⋮----
value=
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/detail/CgnUnsubscribe.tsx">
import { ListItemAction } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useCgnUnsubscribe } from "../../hooks/useCgnUnsubscribe";
⋮----
const CgnUnsubscribe = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/discount/___tests___/CgnDiscountExpireProgressBar.test.tsx">
import { act, render } from "@testing-library/react-native";
import I18n from "i18next";
⋮----
import { CgnDiscountExpireProgressBar } from "../CgnDiscountExpireProgressBar";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/discount/___tests___/CgnDiscountHeader.test.tsx">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import { ProductCategoryEnum } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategory";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { render } from "@testing-library/react-native";
import I18n from "i18next";
⋮----
import { CgnDiscountHeader } from "../CgnDiscountHeader";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/discount/CgnDiscountContent.tsx">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import { ContentWrapper, Divider, ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { formatDateAsShortFormat } from "../../../../../../utils/dates";
⋮----
type CgnDiscountContentProps = {
  discountDetails: Discount;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/discount/CgnDiscountExpireProgressBar.tsx">
import { BodySmall, VSpacer } from "@io-app/design-system";
import { format } from "date-fns";
import I18n from "i18next";
import { useEffect, useState } from "react";
import { View } from "react-native";
⋮----
import { ProgressBar } from "../../../../common/components/ProgressBar";
⋮----
type Props = {
  secondsExpirationTotal: number;
  secondsToExpiration: number;
  setIsExpired: (isExpired: boolean) => void;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/discount/CgnDiscountHeader.tsx">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import {
  Badge,
  H3,
  HStack,
  IODimensions,
  VSpacer
} from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import I18n from "i18next";
import { useEffect, useRef } from "react";
import { View } from "react-native";
⋮----
import { setAccessibilityFocus } from "../../../../../../utils/accessibility";
import { useCgnStyle } from "../../../hooks/useCgnStyle";
import { CategoryTag } from "../ModuleCgnDiscount";
import { isValidDiscount, normalizedDiscountPercentage } from "../utils";
⋮----
type CgnDiscountHeaderProps = {
  discountDetails: Discount;
};
⋮----
text=
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/utils/___tests___/index.test.tsx">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import { ProductCategoryEnum } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategory";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import I18n from "i18next";
⋮----
import { getCategoryName } from "../../../../utils/filters";
import {
  isValidDiscount,
  moduleCGNaccessibilityLabel,
  normalizedDiscountPercentage
} from "../index";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/utils/index.tsx">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import { WithinRangeInteger } from "@pagopa/ts-commons/lib/numbers";
import I18n from "i18next";
⋮----
import { getCategoryName, getCategorySpecs } from "../../../utils/filters";
⋮----
export const normalizedDiscountPercentage = (discount?: number) =>
⋮----
export const isValidDiscount = (discount?: number)
⋮----
export const moduleCGNaccessibilityLabel = (discountData: Discount) =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/CgnAddressListItem.tsx">
import { Address } from "@io-app/api-types/generated/definitions/cgn/merchants/Address";
import { ListItemInfo, ListItemInfoCopy } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { clipboardSetStringWithFeedback } from "../../../../../utils/clipboard";
⋮----
type CgnAddressListItemProps = {
  isAllNationalAddress: boolean;
  item: Address;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/CgnMerchantCard.tsx">
import {
  H6,
  Icon,
  IOCategoryIcons,
  IOColors,
  IODimensions,
  IODimensionScale,
  IOText
} from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { WithTestID } from "../../../../../types/WithTestID";
import { CardPressableBase } from "../../../../services/common/components/CardPressableBase";
⋮----
type CgnMerchantCardProps = WithTestID<{
  accessibilityLabel?: string;
  backgroundColor: string;
  icon: IOCategoryIcons;
  isNew?: boolean;
  name: string;
  onPress?: () => void;
  textColor: "black" | "white";
}>;
⋮----
const CgnMerchantCard = ({
  onPress,
  testID,
  accessibilityLabel,
  isNew,
  backgroundColor,
  icon,
  name,
  textColor
}: CgnMerchantCardProps) => (
  <CardPressableBase
    accessibilityLabel={accessibilityLabel}
    onPress={onPress}
    testID={testID ? `${testID}-pressable` : undefined}
  >
    <View
      style={[
        styles.cardContainer,
        {
          backgroundColor,
          borderColor: IOColors["hanPurple-100"]
        }
      ]}
      testID={testID}
    >
      <View style={styles.cardTitle}>
        <H6 color={textColor} numberOfLines={3}>
          {name}
        </H6>
      </View>
      <View style={styles.cardFooter}>
        {isNew && (
          <View accessible={false} style={styles.newsBadge}>
            <IOText
              color="hanPurple-500"
              lineHeight={badgeTextLineHeight}
              numberOfLines={1}
              size={badgeTextSize}
              style={styles.newsBadgeText}
              weight="Semibold"
            >
              {I18n.t("bonus.cgn.merchantsList.news")}
            </IOText>
          </View>
        )}
        <Icon color={textColor} name={icon} size={iconSize} />
      </View>
    </View>
  </CardPressableBase>
);
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/CgnMerchantCategoriesSocialLinks.tsx">
import {
  ContentWrapper,
  IOColors,
  ListItemAction,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { openWebUrl } from "../../../../../utils/url";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/CgnMerchantListSkeleton.tsx">
import { Divider, IODimensions, IOSkeleton } from "@io-app/design-system";
import { View } from "react-native";
⋮----
type Props = {
  count?: number;
  hasIcons?: boolean;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/CgnMerchantsDiscountItem.tsx">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import { useNavigation } from "@react-navigation/native";
import { FunctionComponent } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../../store/hooks";
import { CgnDetailsParamsList } from "../../navigation/params";
import CGN_ROUTES from "../../navigation/routes";
import { selectMerchantDiscount } from "../../store/actions/merchants";
import { ModuleCgnDiscount } from "./ModuleCgnDiscount";
⋮----
type Props = {
  discount: Discount;
};
⋮----
export const CgnMerchantDiscountItem: FunctionComponent<Props> = ({
  discount
}: Props) =>
⋮----
const onDiscountPress = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/CgnMerchantsListView.tsx">
import { Merchant } from "@io-app/api-types/generated/definitions/cgn/merchants/Merchant";
import { OfflineMerchant } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchant";
import { OnlineMerchant } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchant";
import {
  Badge,
  ContentWrapper,
  H6,
  HSpacer,
  ListItemNav
} from "@io-app/design-system";
import I18n from "i18next";
import { ListRenderItem, View } from "react-native";
⋮----
import { getListItemAccessibilityLabelCount } from "../../../../../utils/accessibility";
⋮----
type Props = {
  count: number;
  onItemPress: (id: Merchant["id"]) => void;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/MerchantSearchResultListItem.tsx">
import { SearchItem } from "@io-app/api-types/generated/definitions/cgn/merchants/SearchItem";
import {
  Badge,
  Body,
  ContentWrapper,
  H6,
  IOColors,
  ListItemNav
} from "@io-app/design-system";
import I18n from "i18next";
import { Keyboard, StyleSheet, Text, View } from "react-native";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { highlightSearchText } from "../../../../../utils/highlightSearchText";
import CGN_ROUTES from "../../navigation/routes";
⋮----
text=
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/merchants/ModuleCgnDiscount.tsx">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import { ProductCategory } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategory";
import {
  Badge,
  H6,
  HStack,
  Icon,
  IODimensions,
  IOModuleStyles,
  Tag,
  useIOTheme,
  useScaleAnimation,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { Pressable, View } from "react-native";
import Animated from "react-native-reanimated";
⋮----
import { useCgnStyle } from "../../hooks/useCgnStyle";
import { getCategoryName, getCategorySpecs } from "../../utils/filters";
import {
  isValidDiscount,
  moduleCGNaccessibilityLabel,
  normalizedDiscountPercentage
} from "./utils";
⋮----
export type ModuleCgnDiscount = {
  discount: Discount;
  onPress: () => void;
};
⋮----
type CategoryTagProps = {
  category: ProductCategory;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/CgnAnimatedBackground.tsx">
import { useIOThemeContext } from "@io-app/design-system";
import { Canvas, Path, Skia } from "@shopify/react-native-skia";
import { useEffect } from "react";
import { StyleSheet } from "react-native";
import {
  cancelAnimation,
  Easing,
  interpolate,
  useDerivedValue,
  useSharedValue,
  withRepeat,
  withTiming
} from "react-native-reanimated";
⋮----
import { cgnCardColors } from "../screens/CgnDetailScreen";
⋮----
interface AnimatedBlobProps {
  canvasSize: { value: { height: number; width: number } };
  color: string;
  index: number;
}
⋮----
const organicWobble = (
  pointIndex: number,
  time: number,
  seed: number
): number =>
⋮----
const generateBlobPath = (
  seed: number,
  time: number,
  centerX: number,
  centerY: number,
  scale: number
): ReturnType<typeof Skia.Path.Make> =>
⋮----
const getPoint = (index: number)
⋮----
export const CgnAnimatedBackground = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/CgnAnimatedHeader.tsx">
import {
  Avatar,
  ContentWrapper,
  H3,
  HStack,
  IOColors,
  IODimensions,
  useIOThemeContext,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useRef } from "react";
import { ActivityIndicator, Platform, StyleSheet, View } from "react-native";
import Animated, {
  SharedValue,
  useAnimatedStyle,
  useSharedValue
} from "react-native-reanimated";
⋮----
import cgnLogo from "../../../../../img/bonus/cgn/cgn_logo.png";
import { setAccessibilityFocus } from "../../../../utils/accessibility";
import { CgnAnimatedBackground } from "./CgnAnimatedBackground";
⋮----
type CgnAnimatedHeaderProps = {
  children?: React.ReactNode;
  isRefreshingValue?: SharedValue<number>;
  pullProgress?: SharedValue<number>;
  ref?: React.Ref<View>;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/CgnCard.tsx">
import {
  BodySmall,
  H6,
  IOColors,
  IODimensions,
  Tag,
  useIOThemeContext
} from "@io-app/design-system";
import I18n from "i18next";
import { Image, StyleSheet, View } from "react-native";
⋮----
import cgnLogo from "../../../../../img/bonus/cgn/cgn_logo.png";
import eycaLogo from "../../../../../img/bonus/cgn/eyca_logo.png";
import CgnCardShapeDarkMode from "../../../../../img/features/cgn/cgn-card-dark.svg";
import CgnCardShapeLightMode from "../../../../../img/features/cgn/cgn-card.svg";
import { format } from "../../../../utils/dates";
⋮----
export type CgnCardProps = {
  expireDate?: Date;
  withEycaLogo?: boolean;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/CgnCardStatus.tsx">
import { Card } from "@io-app/api-types/generated/definitions/cgn/Card";
import { CardActivated } from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import { CardExpired } from "@io-app/api-types/generated/definitions/cgn/CardExpired";
import { CardRevoked } from "@io-app/api-types/generated/definitions/cgn/CardRevoked";
import { LabelMini, Tag, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { Fragment } from "react";
⋮----
import { formatDateAsShortFormat } from "../../../../utils/dates";
⋮----
export function CgnCardStatus(
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/CgnDiscoveryBanner.tsx">
import { Banner, IODimensions, VSpacer } from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { useCallback } from "react";
import Animated, {
  FadeIn,
  FadeOut,
  LinearTransition
} from "react-native-reanimated";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  engagementCGNDiscoveryBannerSelector,
  isCGNDiscoveryBannerEnabledSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender.ts";
import {
  fallbackForLocalizedMessageKeys,
  getFullLocale
} from "../../../../utils/locale";
import { loadAvailableBonuses } from "../../common/store/actions/availableBonusesTypes";
import { trackCgnEngagementBanner } from "../analytics/index.ts";
import { cgnActivationStart } from "../store/actions/activation";
import { closeCgnDiscoveryBanner } from "../store/actions/banners.ts";
import { cgnDetails } from "../store/actions/details.ts";
import {
  cgnDetailSelector,
  isCgnDetailsAlreadyFetchedSelector
} from "../store/reducers/details";
⋮----
type Props = {
  handleOnClose: () => void;
};
⋮----
const CgnDiscoveryBanner = (
⋮----
entering=
</file>

<file path="apps/main-app/ts/features/bonus/cgn/components/CgnWalletCard.tsx">
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { profileSelector } from "../../../settings/common/store/selectors";
import { withWalletCardBaseComponent } from "../../../wallet/components/WalletCardBaseComponent";
import { WalletCardPressableBase } from "../../../wallet/components/WalletCardPressableBase";
import CGN_ROUTES from "../navigation/routes";
import { CgnCard, CgnCardProps } from "./CgnCard";
⋮----
export type CgnWalletCardProps = CgnCardProps;
⋮----
const WrappedCgnCard = (props: CgnWalletCardProps) =>
⋮----
const handleCardPress = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/hooks/useCgnStyle.tsx">
import {
  hexToRgba,
  IOColors,
  useIOTheme,
  useIOThemeContext
} from "@io-app/design-system";
import { ColorValue } from "react-native";
⋮----
type CgnStyleProps = {
  header: {
    default: {
      backgroundColor: string;
      foreground: IOColors;
    };
    new: {
      backgroundColor: string;
      foreground: IOColors;
    };
  };
  module: {
    default: {
      backgroundColor: ColorValue;
      borderColor: ColorValue;
    };
    new: {
      backgroundColor: ColorValue;
      borderColor: ColorValue;
    };
  };
};
⋮----
export const useCgnStyle = (): CgnStyleProps =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/hooks/useCgnUnsubscribe.tsx">
import { IOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useRef } from "react";
import { Alert } from "react-native";
⋮----
import { isError, isReady } from "../../../../common/model/RemoteValue";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { cgnUnsubscribe } from "../store/actions/unsubscribe";
import { cgnUnsubscribeSelector } from "../store/reducers/unsubscribe";
⋮----
export function useCgnUnsubscribe()
⋮----
const requestUnsubscription = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/hooks/useDisableRootNavigatorGesture.tsx">
import { useEffect } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
⋮----
export const useDisableRootNavigatorGesture = (): void =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/hooks/useSpecialCtaCgn.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { IOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef } from "react";
import { Alert } from "react-native";
⋮----
import {
  fold,
  isLoading as isRemoteLoading
} from "../../../../common/model/RemoteValue";
import { IOScrollViewActions } from "../../../../components/ui/IOScrollView";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isCGNEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
⋮----
import { useServicePreferenceByChannel } from "../../../services/details/hooks/useServicePreference";
import { loadServicePreference } from "../../../services/details/store/actions/preference";
import { loadAvailableBonuses } from "../../common/store/actions/availableBonusesTypes";
import { cgnActivationStart } from "../store/actions/activation";
import { cgnUnsubscribe } from "../store/actions/unsubscribe";
import { cgnUnsubscribeSelector } from "../store/reducers/unsubscribe";
⋮----
const useCgnActivation = (serviceId: ServiceId) =>
⋮----
export const useSpecialCtaCgn = (
  serviceId: ServiceId
): IOScrollViewActions["primary"] | undefined =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/navigation/navigator.tsx">
import { PathConfigMap } from "@react-navigation/core";
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { AppParamsList } from "../../../../navigation/params/AppParamsList";
import { isGestureEnabled } from "../../../../utils/navigation";
import CgnActivationCompletedScreen from "../screens/activation/CgnActivationCompletedScreen";
import CgnActivationIneligibleScreen from "../screens/activation/CgnActivationIneligibleScreen";
import CgnActivationLoadingScreen from "../screens/activation/CgnActivationLoadingScreen";
import CgnActivationPendingScreen from "../screens/activation/CgnActivationPendingScreen";
import CgnActivationTimeoutScreen from "../screens/activation/CgnActivationTimeoutScreen";
import CgnAlreadyActiveScreen from "../screens/activation/CgnAlreadyActiveScreen";
import CgnCTAStartActivationScreen from "../screens/activation/CgnCTAStartActivationScreen";
import CgnInformationScreen from "../screens/activation/CgnInformationScreen";
import CgnDetailScreen from "../screens/CgnDetailScreen";
import CgnDiscountCodeScreen from "../screens/discount/CgnDiscountCodeScreen";
import CgnDiscountDetailScreen from "../screens/discount/CgnDiscountDetailScreen";
import CGNDiscountExpiredScreen from "../screens/discount/CGNDiscountExpiredScreen";
import EycaActivationLoading from "../screens/eyca/activation/EycaActivationLoading";
import CgnMerchantDetailScreen from "../screens/merchants/CgnMerchantDetailScreen";
import CgnMerchantLandingWebview from "../screens/merchants/CgnMerchantLandingWebview";
import CgnMerchantsCategoriesSelectionScreen from "../screens/merchants/CgnMerchantsCategoriesSelectionScreen";
import { CgnMerchantSearchScreen } from "../screens/merchants/CgnMerchantSearchScreen";
import CgnMerchantsListByCategory from "../screens/merchants/CgnMerchantsListByCategory";
import {
  CgnActivationParamsList,
  CgnDetailsParamsList,
  CgnEYCAActivationParamsList
} from "./params";
import CGN_ROUTES from "./routes";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/navigation/params.ts">
import { CgnMerchantDetailScreenNavigationParams } from "../screens/merchants/CgnMerchantDetailScreen";
import { CgnMerchantLandingWebviewNavigationParams } from "../screens/merchants/CgnMerchantLandingWebview";
import { CgnMerchantListByCategoryScreenNavigationParams } from "../screens/merchants/CgnMerchantsListByCategory";
import CGN_ROUTES from "./routes";
⋮----
export type CgnActivationParamsList = {
  [CGN_ROUTES.ACTIVATION.COMPLETED]: undefined;
  [CGN_ROUTES.ACTIVATION.CTA_START_CGN]: undefined;
  [CGN_ROUTES.ACTIVATION.EXISTS]: undefined;
  [CGN_ROUTES.ACTIVATION.INELIGIBLE]: undefined;
  [CGN_ROUTES.ACTIVATION.INFORMATION_TOS]: undefined;
  [CGN_ROUTES.ACTIVATION.LOADING]: undefined;
  [CGN_ROUTES.ACTIVATION.PENDING]: undefined;
  [CGN_ROUTES.ACTIVATION.TIMEOUT]: undefined;
};
⋮----
export type CgnDetailsParamsList = {
  [CGN_ROUTES.DETAILS.DETAILS]: undefined;
  [CGN_ROUTES.DETAILS.MERCHANTS.CATEGORIES]: undefined;
  [CGN_ROUTES.DETAILS.MERCHANTS
    .DETAIL]: CgnMerchantDetailScreenNavigationParams;
  [CGN_ROUTES.DETAILS.MERCHANTS.DISCOUNT]: undefined;
  [CGN_ROUTES.DETAILS.MERCHANTS.DISCOUNT_CODE]: undefined;
  [CGN_ROUTES.DETAILS.MERCHANTS.DISCOUNT_CODE_FAILURE]: undefined;
  [CGN_ROUTES.DETAILS.MERCHANTS
    .LANDING_WEBVIEW]: CgnMerchantLandingWebviewNavigationParams;
  [CGN_ROUTES.DETAILS.MERCHANTS
    .LIST_BY_CATEGORY]: CgnMerchantListByCategoryScreenNavigationParams;
  [CGN_ROUTES.DETAILS.MERCHANTS.SEARCH]: undefined;
};
⋮----
export type CgnEYCAActivationParamsList = {
  [CGN_ROUTES.EYCA.ACTIVATION.LOADING]: undefined;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/__test__/getEycaStatus.test.ts">
import { StatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import { StatusEnum as ExpiredStatus } from "@io-app/api-types/generated/definitions/cgn/CardExpired";
import { StatusEnum as PendingStatus } from "@io-app/api-types/generated/definitions/cgn/CardPending";
import { StatusEnum as RevokedStatus } from "@io-app/api-types/generated/definitions/cgn/CardRevoked";
import { CcdbNumber } from "@io-app/api-types/generated/definitions/cgn/CcdbNumber";
import { EycaCard } from "@io-app/api-types/generated/definitions/cgn/EycaCard";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { ValidationError } from "io-ts";
import { expectSaga } from "redux-saga-test-plan";
⋮----
import {
  remoteError,
  remoteReady
} from "../../../../../../common/model/RemoteValue";
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
import { getGenericError } from "../../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../../utils/reporters";
import { cgnEycaStatus } from "../../../store/actions/eyca/details";
import { handleGetEycaStatus } from "../eyca/details/getEycaStatus";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/activation/getBonusActivationSaga.ts">
import { call } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import {
  ReduxSagaEffect,
  SagaCallReturnType
} from "../../../../../../types/utils";
import { getError } from "../../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../../utils/reporters";
import { BackendCGN } from "../../../api/backendCgn";
import { cgnActivationStatus } from "../../../store/actions/activation";
import { CgnActivationProgressEnum } from "../../../store/reducers/activation";
import { handleCgnStatusPolling } from "./handleCgnStatusPolling";
⋮----
type CgnStatusPollingSaga = ReturnType<typeof handleCgnStatusPolling>;
⋮----
export const cgnActivationSaga = (
  startCgnActivation: ReturnType<typeof BackendCGN>["startCgnActivation"],
  handleCgnStatusPolling: CgnStatusPollingSaga
)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/activation/handleCgnStatusPolling.ts">
import { StatusEnum } from "@io-app/api-types/generated/definitions/cgn/CgnActivationDetail";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { call } from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import { mixpanelTrack } from "../../../../../../mixpanel";
import {
  ReduxSagaEffect,
  SagaCallReturnType
} from "../../../../../../types/utils";
import { startTimer } from "../../../../../../utils/timer";
import { BackendCGN } from "../../../api/backendCgn";
import { cgnActivationStatus } from "../../../store/actions/activation";
import { CgnActivationProgressEnum } from "../../../store/reducers/activation";
⋮----
export const handleCgnStatusPolling = (
  getCgnActivation: ReturnType<typeof BackendCGN>["getCgnActivation"]
)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/bucket/index.ts">
import { call, put } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import { getNetworkError } from "../../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../../utils/reporters";
import { withRefreshApiCall } from "../../../../../authentication/fastLogin/saga/utils";
import { BackendCgnMerchants } from "../../../api/backendCgnMerchants";
import { cgnCodeFromBucket } from "../../../store/actions/bucket";
import { setMerchantDiscountCode } from "../../../store/actions/merchants";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/categories/cgnCategoriesSaga.ts">
import { PublishedProductCategories } from "@io-app/api-types/generated/definitions/cgn/merchants/PublishedProductCategories";
import { PublishedProductCategoriesWithNewDiscountsCount } from "@io-app/api-types/generated/definitions/cgn/merchants/PublishedProductCategoriesWithNewDiscountsCount";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import {
  getGenericError,
  getNetworkError
} from "../../../../../../utils/errors";
import { withRefreshApiCall } from "../../../../../authentication/fastLogin/saga/utils";
import { BackendCgnMerchants } from "../../../api/backendCgnMerchants";
import { cgnCategories } from "../../../store/actions/categories";
⋮----
const checkIsCategoriesWithCount = (
  cl:
    | PublishedProductCategories
    | PublishedProductCategoriesWithNewDiscountsCount
): cl is PublishedProductCategoriesWithNewDiscountsCount
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/details/getCgnInformationSaga.ts">
import { StatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import { getNetworkError } from "../../../../../../utils/errors";
import { withRefreshApiCall } from "../../../../../authentication/fastLogin/saga/utils";
import { walletAddCards } from "../../../../../wallet/store/actions/cards";
import { BackendCGN } from "../../../api/backendCgn";
import { cgnDetails } from "../../../store/actions/details";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/eyca/activation/getActivation.ts">
import { StatusEnum } from "@io-app/api-types/generated/definitions/cgn/EycaActivationDetail";
import { err, ok, Result } from "neverthrow";
import { call } from "typed-redux-saga/macro";
⋮----
import {
  ReduxSagaEffect,
  SagaCallReturnType
} from "../../../../../../../types/utils";
import {
  getGenericError,
  getNetworkError,
  NetworkError
} from "../../../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../../../utils/reporters";
import { withRefreshApiCall } from "../../../../../../authentication/fastLogin/saga/utils";
import { BackendCGN } from "../../../../api/backendCgn";
import { cgnEycaActivation } from "../../../../store/actions/eyca/activation";
⋮----
export type GetActivationResult = Result<GetEycaStatus, NetworkError>;
⋮----
type GetEycaStatus = "COMPLETED" | "ERROR" | "NOT_FOUND" | "PROCESSING";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/eyca/activation/getEycaActivationStatus.ts">
import { call, put } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../../../../types/utils";
import { getNetworkError } from "../../../../../../../utils/errors";
import { BackendCGN } from "../../../../api/backendCgn";
import { cgnEycaActivation } from "../../../../store/actions/eyca/activation";
import { getActivation } from "./getActivation";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/eyca/activation/handleEycaActivationSaga.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { call, put } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../../../../types/utils";
import { startTimer } from "../../../../../../../utils/timer";
import { BackendCGN } from "../../../../api/backendCgn";
import { cgnEycaActivation } from "../../../../store/actions/eyca/activation";
import { getActivation } from "./getActivation";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/eyca/activation/handleStartActivation.ts">
import { err, ok, Result } from "neverthrow";
import { call } from "typed-redux-saga/macro";
⋮----
import {
  ReduxSagaEffect,
  SagaCallReturnType
} from "../../../../../../../types/utils";
import {
  getNetworkError,
  NetworkError
} from "../../../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../../../utils/reporters";
import { withRefreshApiCall } from "../../../../../../authentication/fastLogin/saga/utils";
import { BackendCGN } from "../../../../api/backendCgn";
import { cgnEycaActivation } from "../../../../store/actions/eyca/activation";
⋮----
export type StartActivationResult = Result<StartEycaStatus, NetworkError>;
⋮----
type StartEycaStatus = "ALREADY_ACTIVE" | "INELIGIBLE" | "PROCESSING";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/eyca/details/getEycaStatus.ts">
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import {
  ReduxSagaEffect,
  SagaCallReturnType
} from "../../../../../../../types/utils";
import {
  getGenericError,
  getNetworkError
} from "../../../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../../../utils/reporters";
import { withRefreshApiCall } from "../../../../../../authentication/fastLogin/saga/utils";
import { BackendCGN } from "../../../../api/backendCgn";
import { cgnEycaStatus } from "../../../../store/actions/eyca/details";
import { EycaDetailKOStatus } from "../../../../store/reducers/eyca/details";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/merchants/cgnGetMerchantsCountSaga.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { call, put } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import {
  getGenericError,
  getNetworkError
} from "../../../../../../utils/errors";
import { withRefreshApiCall } from "../../../../../authentication/fastLogin/saga/utils";
import { BackendCgnMerchants } from "../../../api/backendCgnMerchants";
import {
  cgnMerchantsCount,
  cgnSearchMerchants
} from "../../../store/actions/merchants";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/merchants/cgnMerchantDetail.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { call, put } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import {
  getGenericError,
  getNetworkError
} from "../../../../../../utils/errors";
import { withRefreshApiCall } from "../../../../../authentication/fastLogin/saga/utils";
import { BackendCgnMerchants } from "../../../api/backendCgnMerchants";
import { cgnSelectedMerchant } from "../../../store/actions/merchants";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/merchants/cgnOfflineMerchantsSaga.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { call, put } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import {
  getGenericError,
  getNetworkError
} from "../../../../../../utils/errors";
import { withRefreshApiCall } from "../../../../../authentication/fastLogin/saga/utils";
import { BackendCgnMerchants } from "../../../api/backendCgnMerchants";
import { cgnOfflineMerchants } from "../../../store/actions/merchants";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/merchants/cgnOnlineMerchantsSaga.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { call, put } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import {
  getGenericError,
  getNetworkError
} from "../../../../../../utils/errors";
import { withRefreshApiCall } from "../../../../../authentication/fastLogin/saga/utils";
import { BackendCgnMerchants } from "../../../api/backendCgnMerchants";
import { cgnOnlineMerchants } from "../../../store/actions/merchants";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/merchants/cgnSearchMerchantsSaga.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { call, put } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import {
  getGenericError,
  getNetworkError
} from "../../../../../../utils/errors";
import { withRefreshApiCall } from "../../../../../authentication/fastLogin/saga/utils";
import { BackendCgnMerchants } from "../../../api/backendCgnMerchants";
import { cgnSearchMerchants } from "../../../store/actions/merchants";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/otp/index.ts">
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import { getNetworkError } from "../../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../../utils/reporters";
import { withRefreshApiCall } from "../../../../../authentication/fastLogin/saga/utils";
import { BackendCGN } from "../../../api/backendCgn";
import { setMerchantDiscountCode } from "../../../store/actions/merchants";
import { cgnGenerateOtp as cgnGenerateOtpAction } from "../../../store/actions/otp";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/networking/unsubscribe/index.ts">
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import {
  getGenericError,
  getNetworkError
} from "../../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../../utils/reporters";
import { withRefreshApiCall } from "../../../../../authentication/fastLogin/saga/utils";
import { walletRemoveCardsByType } from "../../../../../wallet/store/actions/cards";
import { BackendCGN } from "../../../api/backendCgn";
import { cgnUnsubscribe } from "../../../store/actions/unsubscribe";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/orchestration/activation/activationSaga.ts">
import { CommonActions } from "@react-navigation/native";
import { SagaIterator } from "redux-saga";
import { call, take } from "typed-redux-saga/macro";
import { ActionType, isActionOf } from "typesafe-actions";
⋮----
import NavigationService from "../../../../../../navigation/NavigationService";
import ROUTES from "../../../../../../navigation/routes";
import { ITW_ROUTES } from "../../../../../itwallet/navigation/routes";
import { MESSAGES_ROUTES } from "../../../../../messages/navigation/routes";
import CGN_ROUTES from "../../../navigation/routes";
import {
  cgnActivationBack,
  cgnActivationCancel,
  cgnActivationComplete,
  cgnActivationFailure
} from "../../../store/actions/activation";
import {
  navigateToCgnActivationInformationTos,
  navigateToCgnDetails
} from "../navigation/actions";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/orchestration/activation/cgnActivationWorker.ts">
import { call, put } from "typed-redux-saga/macro";
import { ActionType, isActionOf } from "typesafe-actions";
⋮----
import NavigationService from "../../../../../../navigation/NavigationService";
import CGN_ROUTES from "../../../navigation/routes";
import { cgnActivationStatus } from "../../../store/actions/activation";
import { CgnActivationProgressEnum } from "../../../store/reducers/activation";
import { cgnActivationSaga } from "../../networking/activation/getBonusActivationSaga";
import {
  navigateToCgnActivationCompleted,
  navigateToCgnActivationIneligible,
  navigateToCgnActivationLoading,
  navigateToCgnActivationPending,
  navigateToCgnActivationTimeout,
  navigateToCgnAlreadyActive
} from "../navigation/actions";
⋮----
export type CgnActivationType = ReturnType<typeof cgnActivationSaga>;
⋮----
const getNextNavigationStep = (
  action: ActionType<typeof cgnActivationStatus>
): (()
⋮----
const isLoadingScreen = (screenName: string)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/orchestration/activation/handleActivationSaga.ts">
import { CommonActions } from "@react-navigation/native";
import { call, race, take } from "typed-redux-saga/macro";
⋮----
import NavigationService from "../../../../../../navigation/NavigationService";
import { cgnActivationCancel } from "../../../store/actions/activation";
import { CgnActivationType, cgnActivationWorker } from "./cgnActivationWorker";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/orchestration/eyca/eycaActivationSaga.ts">
import { CommonActions } from "@react-navigation/native";
import { call, race, take } from "typed-redux-saga/macro";
⋮----
import NavigationService from "../../../../../../navigation/NavigationService";
import { BackendCGN } from "../../../api/backendCgn";
import { cgnEycaActivationCancel } from "../../../store/actions/eyca/activation";
import { eycaActivationWorker } from "./eycaActivationWorker";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/orchestration/eyca/eycaActivationWorker.ts">
import { call, put } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../../../types/utils";
import { BackendCGN } from "../../../api/backendCgn";
import { cgnEycaActivation } from "../../../store/actions/eyca/activation";
import { cgnEycaStatus } from "../../../store/actions/eyca/details";
import { getActivation } from "../../networking/eyca/activation/getActivation";
import { handleEycaActivationSaga } from "../../networking/eyca/activation/handleEycaActivationSaga";
import { handleStartActivation } from "../../networking/eyca/activation/handleStartActivation";
import {
  navigateToCgnDetails,
  navigateToEycaActivationLoading
} from "../navigation/actions";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/orchestration/navigation/actions.ts">
import { CommonActions } from "@react-navigation/native";
⋮----
import NavigationService from "../../../../../../navigation/NavigationService";
import CGN_ROUTES from "../../../navigation/routes";
⋮----
export const navigateToCgnActivationInformationTos = ()
⋮----
export const navigateToCgnActivationLoading = ()
⋮----
export const navigateToEycaActivationLoading = ()
⋮----
export const navigateToCgnAlreadyActive = ()
⋮----
export const navigateToCgnActivationPending = ()
⋮----
export const navigateToCgnActivationTimeout = ()
⋮----
export const navigateToCgnActivationIneligible = ()
⋮----
export const navigateToCgnActivationCompleted = ()
⋮----
export const navigateToCgnDetails = ()
</file>

<file path="apps/main-app/ts/features/bonus/cgn/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
import { getType } from "typesafe-actions";
⋮----
import { apiUrlPrefix } from "../../../../config";
import { BackendCGN } from "../api/backendCgn";
import { BackendCgnMerchants } from "../api/backendCgnMerchants";
import {
  cgnActivationStart,
  cgnRequestActivation
} from "../store/actions/activation";
import { cgnCodeFromBucket } from "../store/actions/bucket";
import { cgnCategories } from "../store/actions/categories";
import { cgnDetails } from "../store/actions/details";
import {
  cgnEycaActivation,
  cgnEycaActivationStatusRequest
} from "../store/actions/eyca/activation";
import { cgnEycaStatus } from "../store/actions/eyca/details";
import {
  cgnMerchantsCount,
  cgnOfflineMerchants,
  cgnOnlineMerchants,
  cgnSearchMerchants,
  cgnSelectedMerchant
} from "../store/actions/merchants";
import { cgnGenerateOtp as cgnGenerateOtpAction } from "../store/actions/otp";
import { cgnUnsubscribe } from "../store/actions/unsubscribe";
import { cgnActivationSaga } from "./networking/activation/getBonusActivationSaga";
import { handleCgnStatusPolling } from "./networking/activation/handleCgnStatusPolling";
import { cgnBucketConsuption } from "./networking/bucket";
import { cgnCategoriesSaga } from "./networking/categories/cgnCategoriesSaga";
import { cgnGetInformationSaga } from "./networking/details/getCgnInformationSaga";
import { getEycaActivationStatusSaga } from "./networking/eyca/activation/getEycaActivationStatus";
import { handleGetEycaStatus } from "./networking/eyca/details/getEycaStatus";
import { cgnGetMerchantsCountSaga } from "./networking/merchants/cgnGetMerchantsCountSaga";
import { cgnMerchantDetail } from "./networking/merchants/cgnMerchantDetail";
import { cgnOfflineMerchantsSaga } from "./networking/merchants/cgnOfflineMerchantsSaga";
import { cgnOnlineMerchantsSaga } from "./networking/merchants/cgnOnlineMerchantsSaga";
import { cgnSearchMerchantsSaga } from "./networking/merchants/cgnSearchMerchantsSaga";
import { cgnGenerateOtp } from "./networking/otp";
import { cgnUnsubscriptionHandler } from "./networking/unsubscribe";
import { handleCgnStartActivationSaga } from "./orchestration/activation/activationSaga";
import { handleCgnActivationSaga } from "./orchestration/activation/handleActivationSaga";
import { eycaActivationSaga } from "./orchestration/eyca/eycaActivationSaga";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/__test__/CgnDetailScreen.test.tsx">
import { Card } from "@io-app/api-types/generated/definitions/cgn/Card";
import { StatusEnum as ActivatedStatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import { StatusEnum as ExpiredStatusEnum } from "@io-app/api-types/generated/definitions/cgn/CardExpired";
import {
  CardRevoked,
  StatusEnum as RevokedStatusEnum
} from "@io-app/api-types/generated/definitions/cgn/CardRevoked";
import { CcdbNumber } from "@io-app/api-types/generated/definitions/cgn/CcdbNumber";
⋮----
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { useHardwareBackButton } from "../../../../../hooks/useHardwareBackButton";
import { applicationChangeState } from "../../../../../store/actions/application";
import { backendStatusLoadSuccess } from "../../../../../store/actions/backendStatus";
import { useIODispatch } from "../../../../../store/hooks";
import { appReducer } from "../../../../../store/reducers";
import { baseRawBackendStatus } from "../../../../../store/reducers/__mock__/backendStatus";
import { GlobalState } from "../../../../../store/reducers/types";
import { formatDateAsShortFormat } from "../../../../../utils/dates";
import { getGenericError } from "../../../../../utils/errors";
import { useActionOnFocus } from "../../../../../utils/hooks/useOnFocus";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
⋮----
import { loadAvailableBonuses } from "../../../common/store/actions/availableBonusesTypes";
import CGN_ROUTES from "../../navigation/routes";
import { cgnActivationStart } from "../../store/actions/activation";
import { cgnDetails } from "../../store/actions/details";
import { cgnEycaStatus } from "../../store/actions/eyca/details";
import CgnDetailScreen from "../CgnDetailScreen";
⋮----
const renderComponent = (state: GlobalState)
⋮----
const buildBaseState = (cgnEnabled = true, card?: Card) =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/__test__/CgnMerchantSearchScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { applyMiddleware, createStore } from "redux";
import createSagaMiddleware from "redux-saga";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import CGN_ROUTES from "../../navigation/routes";
import { watchBonusCgnSaga } from "../../saga";
import { CgnMerchantSearchScreen } from "../merchants/CgnMerchantSearchScreen";
⋮----
const mockFetch: typeof fetch = async (input, init) =>
⋮----
function renderScreen()
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/__test__/highlightText.test.ts">
import { highlightSearchText } from "../../../../../utils/highlightSearchText";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/activation/CgnActivationCompletedScreen.tsx">
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIODispatch } from "../../../../../store/hooks";
import { cgnActivationComplete } from "../../store/actions/activation";
⋮----
const CgnActivationCompletedScreen = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/activation/CgnActivationIneligibleScreen.tsx">
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIODispatch } from "../../../../../store/hooks";
import { cgnActivationCancel } from "../../store/actions/activation";
⋮----
const CgnActivationIneligibleScreen = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/activation/CgnActivationLoadingScreen.tsx">
import { Body, ContentWrapper, H3, VStack } from "@io-app/design-system";
import I18n from "i18next";
import { useRef } from "react";
import { View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { LoadingIndicator } from "../../../../../components/ui/LoadingIndicator";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { cgnActivationCancel } from "../../store/actions/activation";
import { isCgnActivationLoading } from "../../store/reducers/activation";
⋮----
const onCancel = ()
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/activation/CgnActivationPendingScreen.tsx">
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIODispatch } from "../../../../../store/hooks";
import { cgnActivationCancel } from "../../store/actions/activation";
⋮----
const CgnActivationPendingScreen = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/activation/CgnActivationTimeoutScreen.tsx">
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIODispatch } from "../../../../../store/hooks";
import { cgnActivationCancel } from "../../store/actions/activation";
⋮----
const CgnActivationTimeoutScreen = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/activation/CgnAlreadyActiveScreen.tsx">
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../../store/hooks";
import CGN_ROUTES from "../../navigation/routes";
import { cgnActivationCancel } from "../../store/actions/activation";
⋮----
const CgnAlreadyActiveScreen = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/activation/CgnCTAStartActivationScreen.tsx">
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { FC, useCallback, useEffect, useRef } from "react";
import { Alert } from "react-native";
⋮----
import { LoadingScreenContent } from "../../../../../components/screens/LoadingScreenContent";
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { isCGNEnabledSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { useActionOnFocus } from "../../../../../utils/hooks/useOnFocus";
import { loadAvailableBonuses } from "../../../common/store/actions/availableBonusesTypes";
import {
  availableBonusTypesSelectorFromId,
  isAvailableBonusErrorSelector,
  supportedAvailableBonusSelector
} from "../../../common/store/selectors";
import { ID_CGN_TYPE } from "../../../common/utils";
import { cgnActivationStart } from "../../store/actions/activation";
⋮----
const CgnCTAStartOnboardingComponent: FC = () =>
⋮----
const CgnCTAStartOnboardingScreen = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/activation/CgnInformationScreen.tsx">
import I18n from "i18next";
import { FunctionComponent, useCallback } from "react";
⋮----
import { useHardwareBackButton } from "../../../../../hooks/useHardwareBackButton";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import BonusInformationComponent from "../../../common/components/BonusInformationComponent";
import { availableBonusTypesSelectorFromId } from "../../../common/store/selectors";
import { ID_CGN_TYPE } from "../../../common/utils";
import {
  cgnActivationBack,
  cgnActivationCancel,
  cgnRequestActivation
} from "../../store/actions/activation";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/discount/___tests___/CgnDiscountCodeScreen.test.tsx">
import { OtpCode } from "@io-app/api-types/generated/definitions/cgn/OtpCode";
import { fireEvent } from "@testing-library/react-native";
import { createStore } from "redux";
⋮----
import { remoteReady } from "../../../../../../common/model/RemoteValue";
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import CGN_ROUTES from "../../../navigation/routes";
import CgnDiscountCodeScreen from "../CgnDiscountCodeScreen";
⋮----
const renderComponent = (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/discount/___tests___/CgnDiscountDetailScreen.test.tsx">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import { DiscountCodeTypeEnum } from "@io-app/api-types/generated/definitions/cgn/merchants/DiscountCodeType";
import { Merchant } from "@io-app/api-types/generated/definitions/cgn/merchants/Merchant";
import { SupportTypeEnum } from "@io-app/api-types/generated/definitions/cgn/merchants/SupportType";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { act, fireEvent, userEvent } from "@testing-library/react-native";
import { createStore } from "redux";
⋮----
import { remoteReady } from "../../../../../../common/model/RemoteValue";
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import CGN_ROUTES from "../../../navigation/routes";
import { setMerchantDiscountCode } from "../../../store/actions/merchants";
import CgnDiscountDetailScreen from "../CgnDiscountDetailScreen";
⋮----
const renderComponent = (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/discount/___tests___/CGNDiscountExpiredScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import CGN_ROUTES from "../../../navigation/routes";
import CGNDiscountExpiredScreen from "../CGNDiscountExpiredScreen";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/discount/CgnDiscountCodeScreen.tsx">
import { Otp } from "@io-app/api-types/generated/definitions/cgn/Otp";
import {
  FooterActions,
  H2,
  H4,
  Icon,
  IOColors,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Second } from "@pagopa/ts-commons/lib/units";
import I18n from "i18next";
import { useEffect, useState } from "react";
import { Platform, StyleSheet, View } from "react-native";
import Barcode from "react-native-barcode-builder";
⋮----
import { isReady } from "../../../../../common/model/RemoteValue";
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { IOScrollView } from "../../../../../components/ui/IOScrollView";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { clipboardSetStringWithFeedback } from "../../../../../utils/clipboard";
import { CgnDiscountExpireProgressBar } from "../../components/merchants/discount/CgnDiscountExpireProgressBar";
import CGN_ROUTES from "../../navigation/routes";
import { resetMerchantDiscountCode } from "../../store/actions/merchants";
import { cgnGenerateOtp } from "../../store/actions/otp";
import { cgnSelectedDiscountCodeSelector } from "../../store/reducers/merchants";
import { cgnOtpDataSelector } from "../../store/reducers/otp";
⋮----
const getOtpTTL = (otp: Otp): Second =>
⋮----
const getOtpExpirationTotal = (otp: Otp): Second
⋮----
const generateNewDiscountCode = () =>
const onClose = () =>
⋮----
const handleOnPressCopy = () =>
⋮----
<H4 textStyle=
⋮----
secondsExpirationTotal=
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/discount/CgnDiscountDetailScreen.tsx">
import { DiscountCodeTypeEnum } from "@io-app/api-types/generated/definitions/cgn/merchants/DiscountCodeType";
import { IOToast } from "@io-app/design-system";
⋮----
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useMemo } from "react";
import { Platform, View } from "react-native";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import { isLoading, isReady } from "../../../../../common/model/RemoteValue";
import FocusAwareStatusBar from "../../../../../components/ui/FocusAwareStatusBar";
import {
  IOScrollView,
  IOScrollViewActions
} from "../../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { mixpanelTrack } from "../../../../../mixpanel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { buildEventProperties } from "../../../../../utils/analytics";
import { openWebUrl } from "../../../../../utils/url";
import { profileSelector } from "../../../../settings/common/store/selectors";
import { CgnDiscountContent } from "../../components/merchants/discount/CgnDiscountContent";
import { CgnDiscountHeader } from "../../components/merchants/discount/CgnDiscountHeader";
import { useCgnStyle } from "../../hooks/useCgnStyle";
import { CgnDetailsParamsList } from "../../navigation/params";
import CGN_ROUTES from "../../navigation/routes";
import { cgnCodeFromBucket } from "../../store/actions/bucket";
import {
  resetMerchantDiscountCode,
  setMerchantDiscountCode
} from "../../store/actions/merchants";
import { cgnGenerateOtp, resetOtpState } from "../../store/actions/otp";
import { cgnBucketSelector } from "../../store/reducers/bucket";
import {
  cgnSelectedDiscountCodeSelector,
  cgnSelectedDiscountSelector,
  cgnSelectedMerchantSelector
} from "../../store/reducers/merchants";
import { cgnOtpDataSelector } from "../../store/reducers/otp";
import { getCgnUserAgeRange } from "../../utils/dates";
⋮----
const getDiscountCodeCtaLabel = (
  discountCodeType: DiscountCodeTypeEnum
): string =>
⋮----
const onNavigateToDiscountUrl = () =>
⋮----
const navigateToDiscountCode = () =>
⋮----
const showErrorToast = () =>
⋮----
const onPressDiscountCode = () =>
⋮----
const renderActions = (): IOScrollViewActions | undefined =>
⋮----
actions=
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/discount/CGNDiscountExpiredScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
⋮----
const onPress = ()
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/eyca/activation/EycaActivationLoading.tsx">
import I18n from "i18next";
import { FunctionComponent, useCallback } from "react";
⋮----
import { isError, isLoading } from "../../../../../../common/model/RemoteValue";
import { LoadingScreenContent } from "../../../../../../components/screens/LoadingScreenContent";
import { OperationResultScreenContent } from "../../../../../../components/screens/OperationResultScreenContent";
import { useIODispatch, useIOSelector } from "../../../../../../store/hooks";
import {
  cgnEycaActivation,
  cgnEycaActivationCancel
} from "../../../store/actions/eyca/activation";
import { eycaActivationStatusSelector } from "../../../store/reducers/eyca/activation";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/merchants/CgnMerchantCategoriesListScreen.tsx">
import { ProductCategoryWithNewDiscountsCount } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategoryWithNewDiscountsCount";
import {
  Body,
  ContentWrapper,
  Divider,
  HSpacer,
  IODimensionScale,
  IOSkeleton,
  IOToast,
  ListItemAction,
  VSpacer
} from "@io-app/design-system";
⋮----
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { Fragment, useEffect, useMemo, useState } from "react";
import { StyleSheet, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { cgnMerchantsModalSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { getListItemAccessibilityLabelCount } from "../../../../../utils/accessibility";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { CgnMerchantCard } from "../../components/merchants/CgnMerchantCard";
import { CgnMerchantCategoriesSocialLinks } from "../../components/merchants/CgnMerchantCategoriesSocialLinks";
import { CgnDetailsParamsList } from "../../navigation/params";
import CGN_ROUTES from "../../navigation/routes";
import { cgnCategories } from "../../store/actions/categories";
import { cgnCategoriesListSelector } from "../../store/reducers/categories";
import { getCategoryName, getCategorySpecs } from "../../utils/filters";
⋮----
export type CategoryRow = {
  categories: ReadonlyArray<RenderableCategory>;
  id: string;
};
⋮----
type CategorySpecs = NonNullable<ReturnType<typeof getCategorySpecs>>;
⋮----
type RenderableCategory = {
  category: ProductCategoryWithNewDiscountsCount;
  specs: CategorySpecs;
};
⋮----
const getRenderableCategories = (
  categories: ReadonlyArray<ProductCategoryWithNewDiscountsCount>
): ReadonlyArray<RenderableCategory>
⋮----
const getCategoryRows = (
  categories: ReadonlyArray<RenderableCategory>
): ReadonlyArray<CategoryRow> =>
⋮----
const loadCategories = () =>
⋮----
const onPullRefresh = () =>
⋮----
const renderCategoryCard = (
    renderable: RenderableCategory,
    index: number,
    totalCategories: number
) =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/merchants/CgnMerchantDetailScreen.tsx">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import { Merchant } from "@io-app/api-types/generated/definitions/cgn/merchants/Merchant";
import {
  ContentWrapper,
  Divider,
  H1,
  IODimensions,
  IOSkeleton,
  IOToast,
  ListItemAction,
  ListItemHeader,
  ListItemInfo,
  VSpacer
} from "@io-app/design-system";
import { Route, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Image, LayoutChangeEvent, StyleSheet, View } from "react-native";
import Animated, {
  useAnimatedScrollHandler,
  useSharedValue
} from "react-native-reanimated";
import {
  SafeAreaView,
  useSafeAreaInsets
} from "react-native-safe-area-context";
⋮----
import { isReady } from "../../../../../common/model/RemoteValue";
import { IOScrollView } from "../../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../../utils/url";
import { CgnAddressListItem } from "../../components/merchants/CgnAddressListItem";
import { CgnMerchantDiscountItem } from "../../components/merchants/CgnMerchantsDiscountItem";
import { cgnSelectedMerchant } from "../../store/actions/merchants";
import { cgnSelectedMerchantSelector } from "../../store/reducers/merchants";
⋮----
export type CgnMerchantDetailScreenNavigationParams = Readonly<{
  merchantID: Merchant["id"];
}>;
⋮----
const DiscountListItem = (
⋮----
handlePressMerchantWebsite(merchantDetail.value.websiteUrl)
⋮----
// ------------------------ styles - consts - export
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/merchants/CgnMerchantLandingWebview.tsx">
import { Route, useRoute } from "@react-navigation/core";
import { FunctionComponent } from "react";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import WebviewComponent from "../../../../../components/WebviewComponent";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { CgnDetailsParamsList } from "../../navigation/params";
⋮----
export type CgnMerchantLandingWebviewNavigationParams = Readonly<{
  landingPageReferrer: string;
  landingPageUrl: string;
}>;
⋮----
type Props = {
  navigation: IOStackNavigationProp<
    CgnDetailsParamsList,
    "CGN_MERCHANTS_LANDING_WEBVIEW"
  >;
};
⋮----
const CgnMerchantLandingWebview: FunctionComponent<Props> = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/merchants/CgnMerchantsCategoriesSelectionScreen.tsx">
import {
  IOColors,
  IODimensions,
  IOIcons,
  TabItem,
  TabNavigation,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useMemo, useState } from "react";
import { Platform, RefreshControl, View } from "react-native";
import Animated, {
  useAnimatedRef,
  useAnimatedScrollHandler,
  useDerivedValue,
  useSharedValue
} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import CgnAnimatedHeader from "../../components/CgnAnimatedHeader";
import { useDisableRootNavigatorGesture } from "../../hooks/useDisableRootNavigatorGesture";
import CGN_ROUTES from "../../navigation/routes";
import {
  CategoryRow,
  CgnMerchantCategoriesListScreen
} from "./CgnMerchantCategoriesListScreen";
import { CgnMerchantsListScreen, MerchantsAll } from "./CgnMerchantsListScreen";
⋮----
type CgnMerchantsHomeTabParamsList = {
  [CgnMerchantsHomeTabRoutes.CGN_CATEGORIES]: undefined;
  [CgnMerchantsHomeTabRoutes.CGN_MERCHANTS_ALL]: undefined;
};
⋮----
type CgnMerchantsListItem = CategoryRow | MerchantsAll;
⋮----
type TabOption = {
  icon: IOIcons;
  title: string;
};
⋮----
const isCategoryRow = (item: CgnMerchantsListItem): item is CategoryRow
⋮----
onPress()
⋮----
const onPress = ()
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/merchants/CgnMerchantSearchScreen.tsx">
import { SearchItem } from "@io-app/api-types/generated/definitions/cgn/merchants/SearchItem";
import {
  Body,
  ContentWrapper,
  Divider,
  H6,
  IODimensions,
  IODimensionScale,
  Pictogram,
  SearchInput,
  SearchInputRef,
  VSpacer
} from "@io-app/design-system";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import {
  FlatList,
  ListRenderItemInfo,
  Platform,
  StyleSheet,
  View,
  ViewStyle
} from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { getValue } from "../../../../../common/model/RemoteValue";
import { useDebouncedValue } from "../../../../../hooks/useDebouncedValue";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { MerchantSearchResultListItem } from "../../components/merchants/MerchantSearchResultListItem";
import {
  cgnMerchantsCount,
  cgnSearchMerchants
} from "../../store/actions/merchants";
import {
  cgnMerchantsCountSelector,
  cgnSearchMerchantsSelector
} from "../../store/reducers/merchants";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/merchants/CgnMerchantsListByCategory.tsx">
import { Merchant } from "@io-app/api-types/generated/definitions/cgn/merchants/Merchant";
import { ProductCategoryEnum } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategory";
import {
  ContentWrapper,
  Divider,
  H3,
  hexToRgba,
  HSpacer,
  Icon,
  IOColors,
  IODimensions
} from "@io-app/design-system";
import { Route, useNavigation, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useState } from "react";
import { Platform, RefreshControl, View } from "react-native";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import { isError, isLoading } from "../../../../../common/model/RemoteValue";
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import FocusAwareStatusBar from "../../../../../components/ui/FocusAwareStatusBar";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationProp } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { CgnMerchantListSkeleton } from "../../components/merchants/CgnMerchantListSkeleton";
import { CgnMerchantListViewRenderItem } from "../../components/merchants/CgnMerchantsListView";
import { CgnDetailsParamsList } from "../../navigation/params";
import CGN_ROUTES from "../../navigation/routes";
import {
  cgnOfflineMerchants,
  cgnOnlineMerchants
} from "../../store/actions/merchants";
import {
  cgnOfflineMerchantsSelector,
  cgnOnlineMerchantsSelector
} from "../../store/reducers/merchants";
import { getCategoryName, getCategorySpecs } from "../../utils/filters";
import { useMixedSortedMerchants } from "../../utils/merchants";
⋮----
export type CgnMerchantListByCategoryScreenNavigationParams = Readonly<{
  category: ProductCategoryEnum;
}>;
⋮----
const initLoadingLists = () =>
⋮----
onPress()
⋮----
accessibilityLabel=
⋮----
initLoadingLists();
setIsPullRefresh(true);
⋮----
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/merchants/CgnMerchantsListScreen.tsx">
import { Merchant } from "@io-app/api-types/generated/definitions/cgn/merchants/Merchant";
import { OfflineMerchant } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchant";
import { OnlineMerchant } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchant";
import {
  Badge,
  ContentWrapper,
  Divider,
  H6,
  HSpacer,
  ListItemNav
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { View } from "react-native";
import { useDispatch, useSelector } from "react-redux";
⋮----
import { isError, isLoading } from "../../../../../common/model/RemoteValue";
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { getListItemAccessibilityLabelCount } from "../../../../../utils/accessibility";
import { CgnMerchantListSkeleton } from "../../components/merchants/CgnMerchantListSkeleton";
import CGN_ROUTES from "../../navigation/routes";
import {
  cgnOfflineMerchants,
  cgnOnlineMerchants
} from "../../store/actions/merchants";
import {
  cgnOfflineMerchantsSelector,
  cgnOnlineMerchantsSelector
} from "../../store/reducers/merchants";
import { useMixedSortedMerchants } from "../../utils/merchants";
⋮----
export type MerchantsAll = OfflineMerchant | OnlineMerchant;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/screens/CgnDetailScreen.tsx">
import { Card } from "@io-app/api-types/generated/definitions/cgn/Card";
import {
  CardActivated,
  StatusEnum
} from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import { CardExpired } from "@io-app/api-types/generated/definitions/cgn/CardExpired";
import { CardRevoked } from "@io-app/api-types/generated/definitions/cgn/CardRevoked";
import {
  Alert,
  ContentWrapper,
  H4,
  hexToRgba,
  IOColors,
  IOToast,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
⋮----
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { ReactElement, useCallback } from "react";
⋮----
import cgnLogo from "../../../../../img/bonus/cgn/cgn_logo.png";
import eycaLogo from "../../../../../img/bonus/cgn/eyca_logo.png";
import { isLoading } from "../../../../common/model/RemoteValue";
import {
  BonusCardScreenComponent,
  BonusScreenComponentProps
} from "../../../../components/BonusCard";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import SectionStatusComponent from "../../../../components/SectionStatus";
import { IOScrollViewActions } from "../../../../components/ui/IOScrollView";
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton";
import { IOStackNavigationProp } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  getEYCADiscountUrl,
  isCGNEnabledSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import { formatDateAsShortFormat } from "../../../../utils/dates";
import { useActionOnFocus } from "../../../../utils/hooks/useOnFocus";
import { capitalizeTextName } from "../../../../utils/strings";
import { openWebUrl } from "../../../../utils/url";
import { profileSelector } from "../../../settings/common/store/selectors";
import { loadAvailableBonuses } from "../../common/store/actions/availableBonusesTypes";
import { CgnAnimatedBackground } from "../components/CgnAnimatedBackground";
import { CgnCardStatus } from "../components/CgnCardStatus";
import CgnOwnershipInformation from "../components/detail/CgnOwnershipInformation";
import CgnStatusDetail from "../components/detail/CgnStatusDetail";
import CgnUnsubscribe from "../components/detail/CgnUnsubscribe";
import EycaDetailComponent from "../components/detail/eyca/EycaDetailComponent";
import { useCgnUnsubscribe } from "../hooks/useCgnUnsubscribe";
import { CgnDetailsParamsList } from "../navigation/params";
import CGN_ROUTES from "../navigation/routes";
import { cgnActivationStart } from "../store/actions/activation";
import { cgnDetails as cgnDetailsAction } from "../store/actions/details";
import { cgnEycaStatus } from "../store/actions/eyca/details";
import {
  cgnDetailSelector,
  cgnDetailsInformationSelector,
  isCgnDetailsLoading
} from "../store/reducers/details";
import {
  eycaDetailSelector,
  EycaDetailsState
} from "../store/reducers/eyca/details";
import { cgnUnsubscribeSelector } from "../store/reducers/unsubscribe";
import { canEycaCardBeShown } from "../utils/eyca";
⋮----
function getLogoUris(card: Card | undefined, eycaDetails: EycaDetailsState)
⋮----
const startCgnActivation = () =>
⋮----
const onPressShowCgnDiscounts = () =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/eyca/activation.ts">
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../../utils/errors";
import { CgnEycaActivationStatus } from "../../reducers/eyca/activation";
⋮----
export type CgnEycaActivationActions =
  | ActionType<typeof cgnEycaActivation>
  | ActionType<typeof cgnEycaActivationCancel>
  | ActionType<typeof cgnEycaActivationStatusRequest>;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/eyca/details.ts">
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../../utils/errors";
import { EycaDetail } from "../../reducers/eyca/details";
⋮----
export type CgnEycaStatusActions = ActionType<typeof cgnEycaStatus>;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/activation.ts">
import { CgnActivationDetail } from "@io-app/api-types/generated/definitions/cgn/CgnActivationDetail";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { CgnActivationProgressEnum } from "../reducers/activation";
⋮----
type ActivationStatus = {
  activation?: CgnActivationDetail;
  status: CgnActivationProgressEnum;
};
⋮----
export type CgnActivationActions =
  | ActionType<typeof cgnActivationBack>
  | ActionType<typeof cgnActivationCancel>
  | ActionType<typeof cgnActivationComplete>
  | ActionType<typeof cgnActivationFailure>
  | ActionType<typeof cgnActivationStart>
  | ActionType<typeof cgnActivationStatus>
  | ActionType<typeof cgnRequestActivation>;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/banners.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type CgnBannersActions = ActionType<typeof closeCgnDiscoveryBanner>;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/bucket.ts">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
import { DiscountBucketCodeResponse } from "../../types/DiscountBucketCodeResponse";
⋮----
type CgnCodeBucketPayload = {
  discountId: Discount["id"];
  onError: () => void;
  onSuccess: () => void;
};
⋮----
export type CgnBucketActions =
  | ActionType<typeof cgnCodeFromBucket>
  | ActionType<typeof cgnCodeFromBucketReset>;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/categories.ts">
import { ProductCategoryWithNewDiscountsCount } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategoryWithNewDiscountsCount";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type CgnCategoriesActions = ActionType<typeof cgnCategories>;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/details.ts">
import { Card } from "@io-app/api-types/generated/definitions/cgn/Card";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type CgnDetailsActions = ActionType<typeof cgnDetails>;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/index.ts">
import { CgnActivationActions } from "./activation";
import { CgnBannersActions } from "./banners";
import { CgnBucketActions } from "./bucket";
import { CgnCategoriesActions } from "./categories";
import { CgnDetailsActions } from "./details";
import { CgnEycaActivationActions } from "./eyca/activation";
import { CgnEycaStatusActions } from "./eyca/details";
import { CgnMerchantsAction } from "./merchants";
import { CgnOtpActions } from "./otp";
import { CgnUnsubscribeActions } from "./unsubscribe";
⋮----
export type CgnActions =
  | CgnActivationActions
  | CgnBannersActions
  | CgnBucketActions
  | CgnCategoriesActions
  | CgnDetailsActions
  | CgnEycaActivationActions
  | CgnEycaStatusActions
  | CgnMerchantsAction
  | CgnOtpActions
  | CgnUnsubscribeActions;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/merchants.ts">
import { CountResult } from "@io-app/api-types/generated/definitions/cgn/merchants/CountResult";
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import { Merchant } from "@io-app/api-types/generated/definitions/cgn/merchants/Merchant";
import { OfflineMerchants } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchants";
import { OfflineMerchantSearchRequest } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchantSearchRequest";
import { OnlineMerchants } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchants";
import { OnlineMerchantSearchRequest } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchantSearchRequest";
import { SearchRequest } from "@io-app/api-types/generated/definitions/cgn/merchants/SearchRequest";
import { SearchResult } from "@io-app/api-types/generated/definitions/cgn/merchants/SearchResult";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type CgnMerchantsAction =
  | ActionType<typeof cgnMerchantsCount>
  | ActionType<typeof cgnOfflineMerchants>
  | ActionType<typeof cgnOnlineMerchants>
  | ActionType<typeof cgnSearchMerchants>
  | ActionType<typeof cgnSelectedMerchant>
  | ActionType<typeof resetMerchantDiscountCode>
  | ActionType<typeof selectMerchantDiscount>
  | ActionType<typeof setMerchantDiscountCode>;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/otp.ts">
import { Otp } from "@io-app/api-types/generated/definitions/cgn/Otp";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
type CgnRequestOtpPayload = {
  onError: () => void;
  onSuccess: () => void;
};
⋮----
export type CgnOtpActions =
  | ActionType<typeof cgnGenerateOtp>
  | ActionType<typeof resetOtpState>;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/actions/unsubscribe.ts">
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type CgnUnsubscribeActions = ActionType<typeof cgnUnsubscribe>;
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/__test__/otp.test.ts">
import { OtpCode } from "@io-app/api-types/generated/definitions/cgn/OtpCode";
⋮----
import {
  isReady,
  remoteError,
  remoteLoading,
  remoteReady
} from "../../../../../../common/model/RemoteValue";
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
import { getGenericError } from "../../../../../../utils/errors";
import { cgnGenerateOtp } from "../../actions/otp";
import { cgnOtpDataSelector } from "../otp";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/eyca/activation.ts">
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import {
  getValueOrElse,
  isLoading,
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../../../../../common/model/RemoteValue";
import { Action } from "../../../../../../store/actions/types";
import { GlobalState } from "../../../../../../store/reducers/types";
import { NetworkError } from "../../../../../../utils/errors";
import {
  cgnEycaActivation,
  cgnEycaActivationStatusRequest
} from "../../actions/eyca/activation";
⋮----
export type CgnEycaActivationStatus =
  | "ALREADY_ACTIVE"
  | "COMPLETED"
  | "ERROR"
  | "INELIGIBLE"
  | "NOT_FOUND"
  | "POLLING"
  | "POLLING_TIMEOUT"
  | "PROCESSING";
⋮----
export type EycaActivationState = RemoteValue<
  CgnEycaActivationStatus,
  NetworkError
>;
⋮----
const reducer = (
  state: EycaActivationState = INITIAL_STATE,
  action: Action
): EycaActivationState =>
⋮----
export const eycaActivationStatusSelector = (
  state: GlobalState
): EycaActivationState
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/eyca/details.ts">
import { EycaCard } from "@io-app/api-types/generated/definitions/cgn/EycaCard";
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import {
  isReady,
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../../../../../common/model/RemoteValue";
import { Action } from "../../../../../../store/actions/types";
import { GlobalState } from "../../../../../../store/reducers/types";
import { NetworkError } from "../../../../../../utils/errors";
import { cgnEycaStatus } from "../../actions/eyca/details";
⋮----
export type EycaDetail =
  | {
      card: EycaCard;
      status: Extract<EycaDetailStatus, "FOUND">;
    }
  | {
      status: EycaDetailKOStatus;
    };
export type EycaDetailKOStatus = Exclude<EycaDetailStatus, "FOUND">;
⋮----
export type EycaDetailsState = RemoteValue<EycaDetail, NetworkError>;
export type EycaDetailStatus = "ERROR" | "FOUND" | "INELIGIBLE" | "NOT_FOUND";
⋮----
const reducer = (
  state: EycaDetailsState = INITIAL_STATE,
  action: Action
): EycaDetailsState =>
⋮----
export const eycaDetailSelector = (state: GlobalState): EycaDetailsState
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/eyca/index.ts">
import { Action, combineReducers } from "redux";
⋮----
import eycaActivationReducer, { EycaActivationState } from "./activation";
import eycaDetailsReducer, { EycaDetailsState } from "./details";
⋮----
export type EycaState = {
  activation: EycaActivationState;
  details: EycaDetailsState;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/activation.ts">
import { CgnActivationDetail } from "@io-app/api-types/generated/definitions/cgn/CgnActivationDetail";
import { createSelector } from "reselect";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import {
  cgnActivationStatus,
  cgnRequestActivation
} from "../actions/activation";
⋮----
export enum CgnActivationProgressEnum {
  ERROR = "ERROR",
  EXISTS = "EXISTS",
  INELIGIBLE = "INELIGIBLE",
  PENDING = "PENDING",
  PROGRESS = "PROGRESS",
  SUCCESS = "SUCCESS",
  TIMEOUT = "TIMEOUT",
  UNDEFINED = "UNDEFINED"
}
⋮----
export type ActivationState = {
  status: CgnActivationProgressEnum;
  value?: CgnActivationDetail;
};
⋮----
const reducer = (
  state: ActivationState = INITIAL_STATE,
  action: Action
): ActivationState =>
⋮----
const activationSelector = (state: GlobalState): ActivationState
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/banners.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { differentProfileLoggedIn } from "../../../../../store/actions/crossSessions";
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import { closeCgnDiscoveryBanner } from "../actions/banners";
⋮----
export type CgnBannersState = {
  discoveryBannerClosed: boolean;
};
⋮----
const cgnBannersReducer = (
  state: CgnBannersState = initialState,
  action: Action
): CgnBannersState =>
⋮----
export const isCgnDiscoveryBannerClosedSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/bucket.ts">
import { getType } from "typesafe-actions";
⋮----
import {
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../../../../common/model/RemoteValue";
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import { NetworkError } from "../../../../../utils/errors";
import { DiscountBucketCodeResponse } from "../../types/DiscountBucketCodeResponse";
import { cgnCodeFromBucket, cgnCodeFromBucketReset } from "../actions/bucket";
⋮----
export type CgnBucketState = {
  data: RemoteValue<DiscountBucketCodeResponse, NetworkError>;
};
⋮----
const reducer = (
  state: CgnBucketState = INITIAL_STATE,
  action: Action
): CgnBucketState =>
⋮----
export const cgnBucketSelector = (state: GlobalState): CgnBucketState["data"]
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/categories.ts">
import { ProductCategoryWithNewDiscountsCount } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategoryWithNewDiscountsCount";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import { NetworkError } from "../../../../../utils/errors";
import { orderCategoriesByNameKey } from "../../utils/filters";
import { cgnCategories } from "../actions/categories";
⋮----
export type CgnCategoriesState = {
  list: pot.Pot<
    ReadonlyArray<ProductCategoryWithNewDiscountsCount>,
    NetworkError
  >;
};
⋮----
const reducer = (
  state: CgnCategoriesState = INITIAL_STATE,
  action: Action
): CgnCategoriesState =>
⋮----
const cgnCategoriesSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/details.ts">
import { Card } from "@io-app/api-types/generated/definitions/cgn/Card";
import { CardPending } from "@io-app/api-types/generated/definitions/cgn/CardPending";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import { NetworkError } from "../../../../../utils/errors";
import { isStrictSome } from "../../../../../utils/pot";
import { cgnDetails } from "../actions/details";
import { cgnUnsubscribe } from "../actions/unsubscribe";
⋮----
export type CgnDetailsState = {
  fetched: boolean;
  information: pot.Pot<Card, NetworkError>;
};
⋮----
const reducer = (
  state: CgnDetailsState = INITIAL_STATE,
  action: Action
): CgnDetailsState =>
⋮----
export const cgnDetailSelector = (state: GlobalState)
⋮----
const isNotPending = (cgn: Card)
⋮----
export const isCgnDetailsAlreadyFetchedSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/index.ts">
import { Action, combineReducers } from "redux";
import { PersistPartial } from "redux-persist";
⋮----
import cgnActivationReducer, { ActivationState } from "./activation";
import { cgnBannersPersistent, CgnBannersState } from "./banners";
import cgnBucketReducer, { CgnBucketState } from "./bucket";
import cgnCategoriesReducer, { CgnCategoriesState } from "./categories";
import cgnDetailsReducer, { CgnDetailsState } from "./details";
import eycaReducer, { EycaState } from "./eyca";
import cgnMerchantsReducer, { CgnMerchantsState } from "./merchants";
import cgnOtpReducer, { CgnOtpState } from "./otp";
import cgnUnsubscribeReducer, { CgnUnsubscribeState } from "./unsubscribe";
⋮----
export type CgnState = {
  activation: ActivationState;
  banners: CgnBannersState & PersistPartial;
  bucket: CgnBucketState;
  categories: CgnCategoriesState;
  detail: CgnDetailsState;
  eyca: EycaState;
  merchants: CgnMerchantsState;
  otp: CgnOtpState;
  unsubscribe: CgnUnsubscribeState;
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/merchants.ts">
import { Discount } from "@io-app/api-types/generated/definitions/cgn/merchants/Discount";
import { Merchant } from "@io-app/api-types/generated/definitions/cgn/merchants/Merchant";
import { OfflineMerchants } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchants";
import { OnlineMerchants } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchants";
import { SearchResult } from "@io-app/api-types/generated/definitions/cgn/merchants/SearchResult";
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import {
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../../../../common/model/RemoteValue";
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import { NetworkError } from "../../../../../utils/errors";
import {
  cgnMerchantsCount,
  cgnOfflineMerchants,
  cgnOnlineMerchants,
  cgnSearchMerchants,
  cgnSelectedMerchant,
  resetMerchantDiscountCode,
  selectMerchantDiscount,
  setMerchantDiscountCode
} from "../actions/merchants";
⋮----
export type CgnMerchantsState = {
  merchantsCount: RemoteValue<number, NetworkError>;
  offlineMerchants: RemoteValue<OfflineMerchants["items"], NetworkError>;
  onlineMerchants: RemoteValue<OnlineMerchants["items"], NetworkError>;
  searchMerchants: RemoteValue<SearchResult["items"], NetworkError>;
  selectedDiscount: RemoteValue<Discount, NetworkError>;
  selectedDiscountCode?: string;
  selectedMerchant: RemoteValue<Merchant, NetworkError>;
};
⋮----
const reducer = (
  state: CgnMerchantsState = INITIAL_STATE,
  action: Action
): CgnMerchantsState =>
⋮----
const cgnMerchantsSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/otp.ts">
import { Otp } from "@io-app/api-types/generated/definitions/cgn/Otp";
import { getType } from "typesafe-actions";
⋮----
import {
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../../../../common/model/RemoteValue";
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import { NetworkError } from "../../../../../utils/errors";
import { cgnGenerateOtp, resetOtpState } from "../actions/otp";
⋮----
export type CgnOtpState = {
  data: RemoteValue<Otp, NetworkError>;
};
⋮----
const reducer = (
  state: CgnOtpState = INITIAL_STATE,
  action: Action
): CgnOtpState =>
⋮----
export const cgnOtpDataSelector = (state: GlobalState): CgnOtpState["data"]
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/reducers/unsubscribe.ts">
import { getType } from "typesafe-actions";
⋮----
import {
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../../../../common/model/RemoteValue";
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import { NetworkError } from "../../../../../utils/errors";
import { cgnActivationComplete } from "../actions/activation";
import { cgnDetails } from "../actions/details";
import { cgnUnsubscribe } from "../actions/unsubscribe";
⋮----
export type CgnUnsubscribeState = RemoteValue<true, NetworkError>;
⋮----
const reducer = (
  state: CgnUnsubscribeState = remoteUndefined,
  action: Action
): RemoteValue<true, NetworkError> =>
⋮----
export const cgnUnsubscribeSelector = (
  state: GlobalState
): CgnUnsubscribeState
</file>

<file path="apps/main-app/ts/features/bonus/cgn/store/selectors/banners.ts">
import {
  engagementCGNDiscoveryBannerSelector,
  isCGNDiscoveryBannerEnabledSelector
} from "../../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../../store/reducers/types";
import { profileSelector } from "../../../../settings/common/store/selectors";
import { canAccessCgn } from "../../utils/dates";
import { isCgnDiscoveryBannerClosedSelector } from "../reducers/banners";
import { cgnDetailSelector, isCgnEnrolledSelector } from "../reducers/details";
⋮----
export const isCgnEligibleByAgeSelector = (state: GlobalState): boolean
⋮----
export const shouldFetchCgnDetailsSelector = (state: GlobalState): boolean
⋮----
export const isCgnEngagementBannerRenderableSelector = (
  state: GlobalState
): boolean
</file>

<file path="apps/main-app/ts/features/bonus/cgn/types/DiscountBucketCodeResponse.ts">
import { DiscountBucketCode } from "@io-app/api-types/generated/definitions/cgn/merchants/DiscountBucketCode";
⋮----
export type DiscountBucketCodeResponse =
  | DiscountBucketCodeResponseFailure
  | DiscountBucketCodeResponseSuccess;
⋮----
type DiscountBucketCodeNotFound = {
  kind: "notFound";
};
⋮----
type DiscountBucketCodeResponseFailure =
  | DiscountBucketCodeNotFound
  | DiscountBucketCodeUnhandled;
⋮----
type DiscountBucketCodeResponseSuccess = {
  kind: "success";
  value: DiscountBucketCode;
};
⋮----
type DiscountBucketCodeUnhandled = {
  kind: "unhandled";
};
</file>

<file path="apps/main-app/ts/features/bonus/cgn/utils/__test__/dates.test.ts">
import { AppVersion } from "@io-app/api-types/generated/definitions/identity/AppVersion";
import { EmailAddress } from "@io-app/api-types/generated/definitions/identity/EmailAddress";
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { PushNotificationsContentTypeEnum } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatusEnum } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
import { FiscalCode } from "@pagopa/ts-commons/lib/strings";
import MockDate from "mockdate";
⋮----
import { canAccessCgn, getCgnUserAgeRange } from "../dates";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/utils/__test__/eyca.test.ts">
import { StatusEnum as AcivatedStatus } from "@io-app/api-types/generated/definitions/cgn/CardActivated";
import { CcdbNumber } from "@io-app/api-types/generated/definitions/cgn/CcdbNumber";
import { EycaCard } from "@io-app/api-types/generated/definitions/cgn/EycaCard";
⋮----
import {
  remoteLoading,
  remoteReady
} from "../../../../../common/model/RemoteValue";
import { EycaDetailsState } from "../../store/reducers/eyca/details";
import { canEycaCardBeShown } from "../eyca";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/utils/__test__/filters.test.ts">
import {
  ProductCategory,
  ProductCategoryEnum
} from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategory";
import { ProductCategoryWithNewDiscountsCount } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategoryWithNewDiscountsCount";
⋮----
import { Locales, setLocale } from "../../../../../i18n";
import { orderCategoriesByNameKey } from "../filters";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/utils/__test__/merchants.test.ts">
import { DiscountCodeTypeEnum } from "@io-app/api-types/generated/definitions/cgn/merchants/DiscountCodeType";
import { OfflineMerchants } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchants";
import { OnlineMerchants } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchants";
import { ProductCategoryEnum } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategory";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { renderHook } from "@testing-library/react-native";
⋮----
import {
  remoteError,
  remoteLoading,
  remoteReady
} from "../../../../../common/model/RemoteValue";
import { mixAndSortMerchants, useMixedSortedMerchants } from "../merchants";
</file>

<file path="apps/main-app/ts/features/bonus/cgn/utils/dates.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import I18n from "i18next";
⋮----
import { formatDateAsShortFormat } from "../../../../utils/dates";
⋮----
type CgnUserAgeRange = "18-25" | "26-30" | "31-35" | "unrecognized";
⋮----
export const getCgnUserAgeRange = (
  profileBDay: InitializedProfile["date_of_birth"]
): CgnUserAgeRange =>
⋮----
type CGNBadgeStatus = "active" | "expired" | "revoked";
⋮----
const getStatusLabel = (status: CGNBadgeStatus) =>
⋮----
const getBadgeLabel = (status: CGNBadgeStatus) =>
⋮----
export const getAccessibleExpirationDate = (
  expirationDate: Date,
  status: CGNBadgeStatus
)
⋮----
const ageFromDate = (birthDate: Date, today: Date = new Date()): number =>
⋮----
const birthDateFromTaxCode = (cf: string): Date =>
⋮----
export const canAccessCgn = (profile?: InitializedProfile) =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/utils/eyca.ts">
import { isLoading, isReady } from "../../../../common/model/RemoteValue";
import {
  EycaDetailsState,
  EycaDetailStatus
} from "../store/reducers/eyca/details";
⋮----
export const canEycaCardBeShown = (card: EycaDetailsState): boolean =>
⋮----
const evaluateReady = (status: EycaDetailStatus): boolean =>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/utils/filters.ts">
import {
  ProductCategory,
  ProductCategoryEnum
} from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategory";
import { ProductCategoryWithNewDiscountsCount } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategoryWithNewDiscountsCount";
import { HeaderSecondLevel, IOCategoryIcons } from "@io-app/design-system";
import I18n from "i18next";
import { StatusBarProps } from "react-native";
⋮----
type Category = {
  colors: string;
  headerVariant: HeaderSecondLevel["variant"];
  icon: IOCategoryIcons;
  statusBarStyle: StatusBarProps["barStyle"];
  textColor: "black" | "white";
  type: ProductCategory;
};
⋮----
export const getCategorySpecs = (
  category: ProductCategory
): Category | undefined
⋮----
export const getCategoryName = (category: ProductCategory): string =>
⋮----
export const orderCategoriesByNameKey = (
  categoriesList: ReadonlyArray<ProductCategoryWithNewDiscountsCount>
): ReadonlyArray<ProductCategoryWithNewDiscountsCount>
</file>

<file path="apps/main-app/ts/features/bonus/cgn/utils/merchants.ts">
import { OfflineMerchant } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchant";
import { OfflineMerchants } from "@io-app/api-types/generated/definitions/cgn/merchants/OfflineMerchants";
import { OnlineMerchant } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchant";
import { OnlineMerchants } from "@io-app/api-types/generated/definitions/cgn/merchants/OnlineMerchants";
import { useMemo } from "react";
⋮----
import {
  getValueOrElse,
  isError,
  isReady,
  RemoteValue
} from "../../../../common/model/RemoteValue";
import { MerchantsAll } from "../screens/merchants/CgnMerchantsListScreen";
⋮----
export const mixAndSortMerchants = (
  onlineMerchants: OnlineMerchants["items"],
  offlineMerchants: OfflineMerchants["items"]
) =>
⋮----
export const useMixedSortedMerchants = (
  onlineMerchants: RemoteValue<OnlineMerchants["items"], unknown>,
  offlineMerchants: RemoteValue<OfflineMerchants["items"], unknown>
) =>
</file>

<file path="apps/main-app/ts/features/bonus/common/components/alert/ActionWithAlert.ts">
import { IOToast } from "@io-app/design-system";
import { Alert } from "react-native";
⋮----
type ConfirmConfig = {
  body?: string;
  cancelText: string;
  completedFeedbackText?: string;
  confirmText: string;
  onConfirmAction: () => void;
  title: string;
};
⋮----
export const actionWithAlert = (confirmConfig: ConfirmConfig) =>
</file>

<file path="apps/main-app/ts/features/bonus/common/components/AvailableBonusItem.tsx">
import { BonusAvailable } from "@io-app/api-types/generated/definitions/content/BonusAvailable";
import { BonusAvailableContent } from "@io-app/api-types/generated/definitions/content/BonusAvailableContent";
import { Badge, Body, H6, HSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { FunctionComponent } from "react";
import { Image, Pressable, StyleSheet, View, ViewStyle } from "react-native";
⋮----
import { getRemoteLocale } from "../../../messages/utils/ctas";
⋮----
type AvailableBonusItemState = "active" | "completed" | "incoming";
⋮----
type Props = {
  bonusItem: BonusAvailable;
  onPress: () => void;
  state: AvailableBonusItemState;
};
⋮----
const renderBadge = (state: AvailableBonusItemState) =>
⋮----
text=
⋮----
<Badge text=
</file>

<file path="apps/main-app/ts/features/bonus/common/components/BonusInformationComponent.tsx">
import { BonusAvailable } from "@io-app/api-types/generated/definitions/content/BonusAvailable";
import { BonusAvailableContent } from "@io-app/api-types/generated/definitions/content/BonusAvailableContent";
import {
  Body,
  ContentWrapper,
  H2,
  IOButtonBlockSpecificProps,
  IOMarkdown,
  useIOThemeContext,
  VSpacer
} from "@io-app/design-system";
⋮----
import { constNull, pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { Ref, useContext, useImperativeHandle } from "react";
import { Image, ImageStyle, StyleProp } from "react-native";
import Animated, {
  useAnimatedRef,
  useSharedValue
} from "react-native-reanimated";
⋮----
import {
  IOScrollView,
  IOScrollViewActions
} from "../../../../components/ui/IOScrollView";
import { LightModalContext } from "../../../../components/ui/LightModal";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { maybeNotNullyString } from "../../../../utils/strings";
import { getRemoteLocale } from "../../../messages/utils/ctas";
import TosBonusComponent from "./TosBonusComponent";
⋮----
export type BonusInformationComponentRef = {
  scrollTo: (y: number) => void;
};
⋮----
type Props = {
  bonus: BonusAvailable;
  imageStyle?: StyleProp<ImageStyle>;
  onBack?: () => void;
  onCancel?: () => void;
  onConfirm?: () => void;
  primaryCtaText: string;
  ref?: Ref<BonusInformationComponentRef>;
  secondaryAction?: SecondaryAction;
};
⋮----
type SecondaryAction = { text: string; type: "back" };
⋮----
// bonus rules url should be the first one in the urls list
</file>

<file path="apps/main-app/ts/features/bonus/common/components/ProgressBar.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import { FunctionComponent } from "react";
import { DimensionValue, StyleSheet, View } from "react-native";
⋮----
type Props = {
  progressPercentage: number;
};
⋮----
const calculateStylePercentage = (
  progressPercentage: number
): DimensionValue =>
</file>

<file path="apps/main-app/ts/features/bonus/common/components/TosBonusComponent.tsx">
import {
  FooterActions,
  H2,
  IconButton,
  IOButton,
  IOColors,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { FunctionComponent, useEffect, useState } from "react";
import { BackHandler, ScrollView, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import WebView from "react-native-webview";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { AVOID_ZOOM_JS, closeInjectedScript } from "../../../../utils/webview";
⋮----
type Props = {
  onClose: () => void;
  tos_url: string;
};
⋮----
const handleBackPressed = () =>
⋮----
const handleLoadEnd = ()
⋮----
const handleError = () =>
⋮----
label=
⋮----
setOnLoadEnd(false);
setHasError(false);
</file>

<file path="apps/main-app/ts/features/bonus/common/store/actions/availableBonusesTypes.ts">
import { BonusesAvailable } from "@io-app/api-types/generated/definitions/content/BonusesAvailable";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
export type AvailableBonusesActions = ActionType<typeof loadAvailableBonuses>;
</file>

<file path="apps/main-app/ts/features/bonus/common/store/actions/index.ts">
import { CgnActions } from "../../../cgn/store/actions";
import { AvailableBonusesActions } from "./availableBonusesTypes";
⋮----
export type BonusActions = AvailableBonusesActions | CgnActions;
</file>

<file path="apps/main-app/ts/features/bonus/common/store/reducers/availableBonusesTypes.ts">
import { BonusesAvailable } from "@io-app/api-types/generated/definitions/content/BonusesAvailable";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { clearCache } from "../../../../settings/common/store/actions";
import { loadAvailableBonuses } from "../actions/availableBonusesTypes";
⋮----
export type AvailableBonusTypesState = pot.Pot<BonusesAvailable, Error>;
⋮----
const reducer = (
  state: AvailableBonusTypesState = INITIAL_STATE,
  action: Action
): AvailableBonusTypesState =>
</file>

<file path="apps/main-app/ts/features/bonus/common/store/reducers/index.ts">
import { combineReducers } from "redux";
⋮----
import { Action } from "../../../../../store/actions/types";
import cgnReducer, { CgnState } from "../../../cgn/store/reducers";
import availableBonusesReducer, {
  AvailableBonusTypesState
} from "./availableBonusesTypes";
⋮----
export type BonusState = Readonly<{
  availableBonusTypes: AvailableBonusTypesState;
  cgn: CgnState;
}>;
</file>

<file path="apps/main-app/ts/features/bonus/common/store/selectors/index.ts">
import { BonusAvailable } from "@io-app/api-types/generated/definitions/content/BonusAvailable";
import { BonusesAvailable } from "@io-app/api-types/generated/definitions/content/BonusesAvailable";
import { BonusVisibilityEnum } from "@io-app/api-types/generated/definitions/content/BonusVisibility";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { mapBonusIdFeatureFlag } from "../../utils";
import { AvailableBonusTypesState } from "../reducers/availableBonusesTypes";
⋮----
const allAvailableBonusTypesSelector = (
  state: GlobalState
): AvailableBonusTypesState
⋮----
const experimentalAndVisibleBonus = (bonus: BonusAvailable): boolean
⋮----
export const availableBonusTypesSelectorFromId = (idBonusType: number)
</file>

<file path="apps/main-app/ts/features/bonus/common/utils/index.ts">
import { cdcEnabled } from "../../../../config";
⋮----
export const mapBonusIdFeatureFlag = ()
</file>

<file path="apps/main-app/ts/features/common/components/cie/CieCardReadContent.tsx">
import {
  Body,
  ContentWrapper,
  H3,
  H4,
  HStack,
  IOButton,
  IOButtonBlockSpecificProps,
  IOButtonLinkSpecificProps,
  IOColors,
  IODimensions,
  IOPictograms,
  IOSpringValues,
  Pictogram,
  VSpacer,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useState } from "react";
import { AccessibilityInfo, View } from "react-native";
import Animated, {
  useAnimatedStyle,
  useDerivedValue,
  withSpring
} from "react-native-reanimated";
⋮----
import { CircularProgress } from "../../../../components/ui/CircularProgress";
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { isDevEnv } from "../../../../utils/environment";
import { platformSelect } from "../../utils";
⋮----
export type CieCardReadContentProps = {
  hiddenProgressBar?: boolean;
  pictogram: IOPictograms;
  primaryAction?: Omit<IOButtonBlockSpecificProps, "variant">;
  progress?: number;
  secondaryAction?: Omit<IOButtonLinkSpecificProps, "variant">;
  subtitle?: string;
  title: string;
};
⋮----
onLayout=
</file>

<file path="apps/main-app/ts/features/common/components/IOMarkdown/__test__/customRules.test.tsx">
import { Body, IOToast, MdH1, MdH2, MdH3 } from "@io-app/design-system";
import I18n from "i18next";
import { Linking } from "react-native";
⋮----
import { unknownToString } from "../../../../../utils/errors";
⋮----
import { testable } from "../customRules";
</file>

<file path="apps/main-app/ts/features/common/components/IOMarkdown/customRules.tsx">
import {
  Body,
  IOSpace,
  IOToast,
  MdH1,
  MdH2,
  MdH3
} from "@io-app/design-system";
import {
  TxtHeaderNode,
  TxtHtmlNode,
  TxtLinkNode,
  TxtStrNode
} from "@textlint/ast-node-types";
import I18n from "i18next";
import { Linking } from "react-native";
⋮----
import {
  accessibleLinkNodeToReactNative,
  headerNodeToReactNative,
  htmlNodeToReactNative,
  linkNodeToReactNative,
  strNodeToReactNative
} from "../../../../components/IOMarkdown/renderRules";
import {
  IOMarkdownRenderRules,
  Renderer
} from "../../../../components/IOMarkdown/types";
import {
  isCustomHandledLink,
  isHttpLink,
  isHttpsLink,
  isIoInternalLink
} from "../../../../components/ui/Markdown/handlers/link";
import { trackAppCaughtError } from "../../../../utils/analytics";
import { isTestEnv } from "../../../../utils/environment";
import { unknownToString } from "../../../../utils/errors";
import { handleInternalLink } from "../../../../utils/internalLink";
import { openWebUrl } from "../../../../utils/url";
⋮----
type HeadingMargins = {
  marginEnd: IOSpace;
  marginStart: IOSpace;
};
⋮----
export const handleOpenLink = (linkTo: (path: string) => void, url: string) =>
⋮----
export const generateMessagesAndServicesRules = (
  linkTo: (path: string) => void
): Partial<IOMarkdownRenderRules> => (
⋮----
Header(
    header: TxtHeaderNode,
    render: Renderer,
    screenReaderEnabled: boolean
)
Link(link: TxtLinkNode, render: Renderer)
⋮----
Str(str: TxtStrNode)
⋮----
const replaceBrWithNewline = (input: string): string
⋮----
export const generateAccessibleLinkRule =
(): Partial<IOMarkdownRenderRules> => (
</file>

<file path="apps/main-app/ts/features/common/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { combineReducers } from "redux";
import { PersistConfig, PersistPartial, persistReducer } from "redux-persist";
⋮----
import { Action } from "../../../../store/actions/types";
import {
  appearanceSettingsReducerPersistor,
  AppearanceSettingsState
} from "../../../appearanceSettings/store/reducers";
import {
  appFeedbackPersistor,
  AppFeedbackState
} from "../../../appReviews/store/reducers";
import {
  activeSessionLoginPersistor,
  ActiveSessionLoginState
} from "../../../authentication/activeSessionLogin/store/reducer";
import {
  loginConfigPersistor,
  LoginConfigState
} from "../../../authentication/common/store/reducers/loginConfig";
import {
  loginFlowPersistor,
  LoginFlowState
} from "../../../authentication/common/store/reducers/loginFlow";
import {
  testLoginReducer,
  TestLoginState
} from "../../../authentication/common/store/reducers/testLogin";
import {
  fastLoginReducer,
  FastLoginState
} from "../../../authentication/fastLogin/store/reducers";
import {
  cieLoginPersistor,
  CieLoginState
} from "../../../authentication/login/cie/store/reducers/cieLogin";
import {
  spidLoginReducer,
  SpidLoginState
} from "../../../authentication/login/idp/store/reducers";
import {
  loginInfoReducer,
  LoginInfoState
} from "../../../authentication/loginInfo/store/reducers";
import cdcReducer, { CdcState } from "../../../bonus/cdc/common/store/reducers";
import connectivityStateReducer, {
  ConnectivityState
} from "../../../connectivity/store/reducers";
import fciReducer, { FciState } from "../../../fci/store/reducers";
import fimsReducer, { FimsState } from "../../../fims/common/store/reducer";
import idPayReducer, { IDPayState } from "../../../idpay/common/store/reducers";
import {
  ingressScreenReducer,
  IngressScreenState
} from "../../../ingress/store/reducer";
import itWalletReducer, {
  PersistedItWalletState
} from "../../../itwallet/common/store/reducers";
import {
  landingScreenBannersReducer,
  LandingScreenBannerState
} from "../../../landingScreenMultiBanner/store/reducer";
import {
  backgroundLinkingReducer,
  BackgroundLinkingState
} from "../../../linking/reducers";
import {
  mixpanelReducer,
  MixpanelState
} from "../../../mixpanel/store/reducer";
import paymentsReducer, {
  PaymentsState
} from "../../../payments/common/store/reducers";
import { pnReducer, PnState } from "../../../pn/store/reducers";
import {
  profileSettingsReducerPersistor,
  ProfileSettingsState
} from "../../../profileSettings/store/reducers";
import servicesReducer, {
  ServicesState
} from "../../../services/common/store/reducers";
import tourReducer, { TourState } from "../../../tour/store/reducers";
import { utmLinkReducer, UtmLinkState } from "../../../utmLink/store/reducers";
import walletReducer, { WalletState } from "../../../wallet/store/reducers";
import {
  whatsNewPersistor,
  WhatsNewState
} from "../../../whatsnew/store/reducers";
⋮----
export type FeaturesState = {
  appearanceSettings: AppearanceSettingsState & PersistPartial;
  appFeedback: AppFeedbackState & PersistPartial;
  backgroundLinking: BackgroundLinkingState;
  cdc: CdcState;
  connectivityStatus: ConnectivityState;
  fci: FciState;
  fims: FimsState;
  idPay: IDPayState;
  ingress: IngressScreenState;
... (27 lines truncated)
</file>

<file path="apps/main-app/ts/features/common/utils/cie/index.ts">
export const getProgressEmojis = (progress: number) =>
</file>

<file path="apps/main-app/ts/features/common/utils/index.ts">
import { Platform } from "react-native";
⋮----
export const platformSelect: typeof Platform.select = specifics =>
  Platform.select(specifics);
</file>

<file path="apps/main-app/ts/features/connectivity/api/client.ts">
import { createClient } from "@io-app/api-types/generated/definitions/connectivity/client";
⋮----
import { defaultRetryingFetch } from "../../../utils/fetch";
⋮----
export const createConnectivityClient = (baseUrl: string)
⋮----
export type ConnectivityClient = ReturnType<typeof createConnectivityClient>;
</file>

<file path="apps/main-app/ts/features/connectivity/saga/index.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
⋮----
import { Action } from "redux";
import {
  call,
  delay,
  fork,
  put,
  race,
  select,
  take
} from "typed-redux-saga/macro";
import { isActionOf } from "typesafe-actions";
⋮----
import { apiUrlPrefix } from "../../../config";
import { updateMixpanelSuperProperties } from "../../../mixpanelConfig/superProperties";
import { applicationChangeState } from "../../../store/actions/application";
import { appCurrentStateSelector } from "../../../store/reducers/appState";
import { GlobalState } from "../../../store/reducers/types";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../types/utils";
import { ConnectivityClient, createConnectivityClient } from "../api/client";
import { setConnectionStatus } from "../store/actions";
import { fetchNetInfoState } from "../utils";
</file>

<file path="apps/main-app/ts/features/connectivity/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type ConnectivityActions =
  | ActionType<typeof requestConnectionStatus>
  | ActionType<typeof setConnectionStatus>;
</file>

<file path="apps/main-app/ts/features/connectivity/store/reducers/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { setConnectionStatus } from "../actions";
⋮----
export type ConnectivityState = {
  isConnected?: boolean;
};
⋮----
const connectivityStateReducer = (
  state: ConnectivityState = initialState,
  action: Action
): ConnectivityState =>
</file>

<file path="apps/main-app/ts/features/connectivity/store/selectors/index.ts">
import { GlobalState } from "../../../../store/reducers/types";
⋮----
export const connectivityStatusSelector = (state: GlobalState)
⋮----
export const isConnectedSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/connectivity/utils/index.ts">
import { fetch } from "@react-native-community/netinfo";
import { pipe } from "fp-ts/lib/function";
⋮----
export const fetchNetInfoState = ()
</file>

<file path="apps/main-app/ts/features/design-system/components/DesignSystemScreen.tsx">
import { ContentWrapper, IODimensions } from "@io-app/design-system";
import { ReactNode } from "react";
import { ScrollView, View } from "react-native";
⋮----
import { useScreenEndMargin } from "../../../hooks/useScreenEndMargin";
⋮----
type Props = {
  children: ReactNode;
  noMargin?: boolean;
  title: string;
};
</file>

<file path="apps/main-app/ts/features/design-system/components/DesignSystemSection.tsx">
import { H3, useIOTheme, VStack } from "@io-app/design-system";
import { PropsWithChildren } from "react";
import { View } from "react-native";
⋮----
type OwnProps = PropsWithChildren<{
  title: string;
}>;
⋮----
export const DesignSystemSection = (props: OwnProps) =>
</file>

<file path="apps/main-app/ts/features/design-system/components/DSAssetViewerBox.tsx">
import { hexToRgba, IOColors, useIOTheme } from "@io-app/design-system";
⋮----
import { ReactNode } from "react";
import {
  ImageBackground,
  ImageSourcePropType,
  Image as NativeImage,
  StyleSheet,
  Text,
  View
} from "react-native";
⋮----
import FakeTransparentBg from "../../../../img/utils/transparent-background-pattern.png";
⋮----
type DSAssetViewerBoxProps = {
  colorMode?: "dark" | "light";
  image: ReactNode;
  name: string;
  size?: "medium" | "small";
  spacing?: "large" | "small";
  type?: "bleed" | "hasBleed" | "raster" | "vector";
};
⋮----
export const renderRasterImage = (image: ImageSourcePropType) => (
  <NativeImage
    resizeMode={"contain"}
    source={image}
    style={styles.image}
    testID={"rasterImage"}
  />
);
</file>

<file path="apps/main-app/ts/features/design-system/components/DSComponentViewerBox.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import { ReactNode } from "react";
import { StyleSheet, Text, View } from "react-native";
⋮----
type DSComponentViewerBoxProps = {
  children: ReactNode;
  colorMode?: "dark" | "light";
  fullWidth?: boolean;
  name: string;
  reverse?: boolean;
};
</file>

<file path="apps/main-app/ts/features/design-system/components/DSFullWidthComponent.tsx">
import { IODimensions } from "@io-app/design-system";
import { ReactNode } from "react";
import { StyleSheet, View } from "react-native";
⋮----
type Props = {
  children: ReactNode;
};
⋮----
export const DSFullWidthComponent = ({ children }: Props) => (
  <View style={styles.container}>{children}</View>
);
</file>

<file path="apps/main-app/ts/features/design-system/components/DSIconViewerBox.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import { ReactNode } from "react";
import { StyleSheet, Text, View } from "react-native";
⋮----
type DSIconViewerBoxProps = {
  fullWidth?: boolean;
  image: ReactNode;
  name: string;
  size?: "large" | "medium" | "small" | undefined;
  withDot?: boolean;
};
</file>

<file path="apps/main-app/ts/features/design-system/components/DSLogoPaymentViewerBox.tsx">
import { hexToRgba, IOColors, useIOTheme } from "@io-app/design-system";
⋮----
import { ReactNode } from "react";
import { ImageBackground, StyleSheet, Text, View } from "react-native";
⋮----
import FakeTransparentBg from "../../../../img/utils/transparent-background-pattern.png";
⋮----
type DSLogoPaymentViewerBoxProps = {
  image: ReactNode;
  name: string;
  size: "full" | "large" | "medium";
};
</file>

<file path="apps/main-app/ts/features/design-system/components/DSSpacerViewerBox.tsx">
import {
  HSpacer,
  IOColors,
  IOSpace,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Text, View } from "react-native";
⋮----
type DSSpacerLabelProps = {
  value: IOSpace;
};
⋮----
type DSSpacerViewerBoxProps = {
  orientation?: "horizontal" | "vertical";
  size: IOSpace;
};
⋮----
const DSSpacerLabel = (
</file>

<file path="apps/main-app/ts/features/design-system/core/DSAdvice.tsx">
import {
  Banner,
  bannerBackgroundColours,
  BannerErrorState,
  FeatureInfo,
  H4,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { Alert } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
⋮----
const onLinkPress = () =>
⋮----
const onClose = () =>
⋮----
export const DSAdvice = () =>
⋮----
⋮----
const renderBannerErrorState = () => (
  <VStack space={componentMargin}>
    <DSComponentViewerBox name="BannerErrorState, default icon">
      <BannerErrorState
        actionText={"Riprova"}
        label="Il caricamento delle ricevute è fallito."
        onPress={onLinkPress}
      />
    </DSComponentViewerBox>
    <DSComponentViewerBox name="BannerErrorState, custom icon">
      <BannerErrorState
        actionText={"Riprova"}
        icon="errorFilled"
        label="Il caricamento delle ricevute è fallito."
        onPress={onLinkPress}
      />
    </DSComponentViewerBox>
  </VStack>
);
</file>

<file path="apps/main-app/ts/features/design-system/core/DSAlert.tsx">
import { Alert, H4, useIOTheme, VStack } from "@io-app/design-system";
import { Alert as RNAlert } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSFullWidthComponent } from "../components/DSFullWidthComponent";
⋮----
const onPress = () =>
⋮----
export const DSAlert = () =>
⋮----
⋮----
const renderContentOnly = () => (
  <VStack space={componentInnerMargin}>
    <Alert
      content="Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquid"
      variant="error"
    />
    <Alert
      content="Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquid"
      variant="warning"
    />
    <Alert
      content="Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquid"
      variant="info"
    />
    <Alert
      content="Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquid"
      variant="success"
    />
  </VStack>
);
⋮----
const renderContentPlusAction = () => (
  <VStack space={componentInnerMargin}>
    <Alert
      action="Alert action"
      content="Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquid"
      onPress={onPress}
      variant="error"
    />
    <Alert
      action="Alert action"
      content="Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquid"
      onPress={onPress}
      variant="warning"
    />
    <Alert
      action="Alert action"
      content="Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquid"
      onPress={onPress}
      variant="info"
    />
    <Alert
      action="Alert action"
      content="Ut enim ad minim veniam, quis ullamco laboris nisi ut aliquid"
      onPress={onPress}
      variant="success"
    />
  </VStack>
);
⋮----
const renderFullWidth = () => (
  <DSFullWidthComponent>
    <VStack space={componentInnerMargin}>
      <Alert
        content="Ut enim ad minim veniam, quis ullamco labo nisi ut aliquid ad minim veniam"
        fullWidth
        variant="error"
      />
      <Alert
        content="Ut enim ad minim veniam, quis ullamco labo nisi ut aliquid ad minim veniam"
        fullWidth
        variant="warning"
      />
      <Alert
        content="Ut enim ad minim veniam, quis ullamco labo nisi ut aliquid ad minim veniam"
        fullWidth
        variant="info"
      />
      <Alert
        content="Ut enim ad minim veniam, quis ullamco labo nisi ut aliquid ad minim veniam"
        fullWidth
        variant="success"
      />
      <Alert
        action="Alert action"
        content="Ut enim ad minim veniam, quis ullamco labo nisi ut aliquid ad minim veniam"
        fullWidth
onPress=
</file>

<file path="apps/main-app/ts/features/design-system/core/DSAnimatedNumericText.tsx">
import {
  H3,
  HStack,
  IOButton,
  IOColors,
  IODimensions,
  IOText,
  IOTypography,
  LabelMini,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { useCallback, useEffect, useState } from "react";
import { View, ViewStyle } from "react-native";
⋮----
import { AnimatedNumericText } from "../../../components/animatedNumericText";
import { formatNumberCentsToAmount } from "../../../utils/stringBuilder";
import { DesignSystemScreen } from "../components/DesignSystemScreen";
⋮----
const formatAsTimer = (seconds: number)
⋮----
const formatAsAmount = (cents: number)
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/design-system/core/DSAnimatedPictograms.tsx">
import {
  ContentWrapper,
  hexToRgba,
  IOColors,
  IODimensions,
  IOPictogramSizeScale,
  RadioGroup,
  useIOTheme
} from "@io-app/design-system";
import { LinearGradient } from "expo-linear-gradient";
import { useCallback, useState } from "react";
import { ScrollView, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import {
  AnimatedPictogram,
  IOAnimatedPictograms
} from "../../../components/ui/AnimatedPictogram";
⋮----
type AnimatedPictogramType = {
  label: string;
  name: IOAnimatedPictograms;
};
⋮----
const getCurrentPictogram = ()
⋮----
key=
name=
</file>

<file path="apps/main-app/ts/features/design-system/core/DSBadges.tsx">
import {
  Badge,
  H4,
  HStack,
  IOColors,
  IODimensions,
  Tag,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
⋮----
export const DSBadges = () =>
⋮----
</file>

<file path="apps/main-app/ts/features/design-system/core/DSBonusCardScreen.tsx">
import { Body, ContentWrapper, Tag, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { Alert } from "react-native";
⋮----
import {
  BonusCardScreenComponent,
  defaultBonusCardColors
} from "../../../components/BonusCard";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSBottomSheet.tsx">
import {
  Body,
  ContentWrapper,
  Divider,
  H4,
  IOButton,
  ListItemNav,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import DESIGN_SYSTEM_ROUTES from "../navigation/routes";
⋮----
const handlePressDismiss = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSButtons.tsx">
import {
  H2,
  H3,
  H4,
  hexToRgba,
  HStack,
  IconButton,
  IconButtonSolid,
  IOButton,
  IOButtonColor,
  IOButtonVariant,
  IOColors,
  IOIcons,
  ListItemSwitch,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { Fragment, useState } from "react";
import { Alert, StyleSheet, View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
⋮----
const onButtonPress = () =>
⋮----
const capitalize = (str: string)
⋮----
export const DSButtons = () =>
⋮----
⋮----
const toggleSwitch = ()
</file>

<file path="apps/main-app/ts/features/design-system/core/DSCards.tsx">
import {
  ContentWrapper,
  HStack,
  IODimensions,
  TabItem,
  TabNavigation,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { useState } from "react";
import { Alert, Pressable, ScrollView } from "react-native";
⋮----
import { CgnCard } from "../../bonus/cgn/components/CgnCard";
import { IdPayCard } from "../../idpay/wallet/components/IdPayCard";
import { ItwCredentialCard } from "../../itwallet/common/components/ItwCredentialCard";
import {
  ItwSkeumorphicCard,
  ItwSkeumorphicCardProps
} from "../../itwallet/common/components/ItwSkeumorphicCard";
import {
  CredentialType,
  ItwStoredCredentialsMocks
} from "../../itwallet/common/utils/itwMocksUtils";
import { PaymentCard } from "../../payments/common/components/PaymentCard";
import { PaymentCardSmall } from "../../payments/common/components/PaymentCardSmall";
import {
  PaymentCardsCarousel,
  PaymentCardsCarouselProps,
  PaymentCardsCarouselSkeleton
} from "../../payments/home/components/PaymentsCardsCarousel";
import {
  FeaturedInstitutionsCarousel,
  FeaturedInstitutionsCarouselProps,
  FeaturedInstitutionsCarouselSkeleton
} from "../../services/home/components/FeaturedInstitutionsCarousel";
import {
  FeaturedServicesCarousel,
  FeaturedServicesCarouselProps,
  FeaturedServicesCarouselSkeleton
} from "../../services/home/components/FeaturedServicesCarousel";
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DesignSystemSection } from "../components/DesignSystemSection";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
⋮----
const onPress = () =>
⋮----
expireDate=
</file>

<file path="apps/main-app/ts/features/design-system/core/DSCollapsible.tsx">
import {
  AccordionItem,
  Body,
  H4,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { FlatList, ListRenderItemInfo, View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSColors.tsx">
import {
  H3,
  H6,
  hexToRgba,
  IOColors,
  IOColorsExtra,
  IOColorsNeutral,
  IOColorsStatus,
  IOColorsTints,
  IODimensions,
  IOThemeDark,
  IOThemeLight,
  themeStatusColorsDarkMode,
  themeStatusColorsLightMode,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { ColorValue, Dimensions, StyleSheet, Text, View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
⋮----
type ColorThemeGroupProps = {
  colorObjectDarkMode: Record<string, string>;
  colorObjectLightMode: Record<string, string>;
  name: string;
};
</file>

<file path="apps/main-app/ts/features/design-system/core/DSDynamicBackground.tsx">
import {
  Avatar,
  Body,
  BodySmall,
  ContentWrapper,
  H3,
  hexToRgba,
  HStack,
  IOColors,
  IODimensions,
  RadioGroup,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import {
  Blur,
  Canvas,
  Group,
  Image,
  Mask,
  Rect,
  LinearGradient as SkiaLinearGradient,
  useImage,
  vec
} from "@shopify/react-native-skia";
import { LinearGradient } from "expo-linear-gradient";
import { useCallback, useMemo, useState } from "react";
import { Dimensions, Platform, ScrollView, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import FocusAwareStatusBar from "../../../components/ui/FocusAwareStatusBar";
import { DEFAULT_CONTENT_REPO_URL } from "../../../config";
⋮----
start=
</file>

<file path="apps/main-app/ts/features/design-system/core/DSDynamicCardRotation.tsx">
import { H6, hexToRgba, IOColors, VSpacer } from "@io-app/design-system";
import {
  Canvas,
  Color,
  DiffRect,
  Image,
  LinearGradient,
  Mask,
  rect,
  RoundedRect,
  rrect,
  Circle as SkiaCircle,
  Group as SkiaGroup,
  RadialGradient as SkiaRadialGradient,
  useImage,
  vec
} from "@shopify/react-native-skia";
import { useState } from "react";
import {
  ColorValue,
  LayoutChangeEvent,
  LayoutRectangle,
  StyleSheet,
  Text,
  View,
  ViewStyle
} from "react-native";
import Animated, {
  Extrapolation,
  interpolate,
  SensorType,
  useAnimatedReaction,
  useAnimatedSensor,
  useAnimatedStyle,
  useDerivedValue,
  useSharedValue,
  withSpring
} from "react-native-reanimated";
import Svg, { Circle, Defs, RadialGradient, Stop } from "react-native-svg";
⋮----
import { ROTATION_SENSOR_CONFIG } from "../../../hooks/useRotationSensor";
⋮----
type CardSize = {
  height: LayoutRectangle["height"];
  width: LayoutRectangle["width"];
};
⋮----
type LightSize = {
  value: LayoutRectangle["width"];
};
⋮----
const getCardSize = (event: LayoutChangeEvent) =>
⋮----
const getLightSize = (event: LayoutChangeEvent) =>
⋮----
const CardInnerMask = () => (
    <RoundedRect
      color={IOColors.black}
      height={(cardSize?.height ?? 0) - cardBorderWidth * 2}
      r={cardBorderRadius - cardBorderWidth}
      width={(cardSize?.width ?? 0) - cardBorderWidth * 2}
      x={cardBorderWidth}
      y={cardBorderWidth}
    />
  );
⋮----
c=
⋮----
color=
</file>

<file path="apps/main-app/ts/features/design-system/core/DSEdgeToEdgeArea.tsx">
import {
  Body,
  H4,
  hexToRgba,
  IOColors,
  IODimensions
} from "@io-app/design-system";
import { ScrollView, Text, View } from "react-native";
import {
  SafeAreaView,
  useSafeAreaInsets
} from "react-native-safe-area-context";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSFooterActions.tsx">
import {
  FooterActions,
  IOColors,
  useFooterActionsMeasurements,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Fragment } from "react";
import { Alert, ScrollView, StyleSheet, Text, View } from "react-native";
⋮----
const onButtonPress = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSFooterActionsInline.tsx">
import {
  Body,
  ContentWrapper,
  FooterActionsInline,
  H1,
  useFooterActionsInlineMeasurements
} from "@io-app/design-system";
import { Alert, ScrollView, View } from "react-native";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSFooterActionsInlineNotFixed.tsx">
import {
  FooterActionsInline,
  IOColors,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Fragment } from "react";
import { Alert, ScrollView, StyleSheet, Text, View } from "react-native";
⋮----
const onButtonPress = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSFooterActionsNotFixed.tsx">
import {
  FooterActions,
  IOColors,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Fragment } from "react";
import { Alert, ScrollView, StyleSheet, Text, View } from "react-native";
⋮----
const onButtonPress = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSFooterActionsSticky.tsx">
import {
  IOColors,
  ScrollViewWithStickyFooterActions,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Fragment } from "react";
import { Alert, StyleSheet, Text, View } from "react-native";
⋮----
const onButtonPress = () =>
⋮----
export const DSFooterActionsSticky = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSForceScrollDownView.tsx">
import {
  Body,
  ContentWrapper,
  FooterActions,
  ForceScrollDownView,
  IOButton,
  IODimensions,
  VStack
} from "@io-app/design-system";
import { ComponentProps, useState } from "react";
import { Alert } from "react-native";
⋮----
type FooterActionsProps = ComponentProps<typeof FooterActions>;
</file>

<file path="apps/main-app/ts/features/design-system/core/DSForceScrollDownViewCustomSlot.tsx">
import {
  Body,
  ContentWrapper,
  ForceScrollDownView,
  IOColors,
  IODimensions,
  VStack
} from "@io-app/design-system";
import { View } from "react-native";
⋮----
export const DSForceScrollDownViewCustomSlot = () => (
  <ForceScrollDownView
    buttonAccessibilityLabel="Scroll to bottom"
    contentContainerStyle={{
      paddingTop: IODimensions.padding.screen.default
    }}
    threshold={CUSTOM_SLOT_HEIGHT}
  >
    <VStack space={24}>
      <ContentWrapper>
        <VStack space={8}>
          {[...Array(5)].map((_el, i) => (
            <Body key={`body-${i}`}>
              Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nec
              nulla semper, elementum leo nec, euismod ligula. Phasellus varius,
              sem fringilla rutrum rutrum, ante erat convallis dolor, a
              porttitor justo purus a dolor. Mauris ultrices dui magna, et
              efficitur augue sollicitudin a. Curabitur dapibus mollis tempus.
              Quisque lobortis arcu vitae efficitur scelerisque.
            </Body>
          ))}
        </VStack>
      </ContentWrapper>
      <View
        style={{
          height: CUSTOM_SLOT_HEIGHT,
          backgroundColor: IOColors["success-100"]
        }}
      />
    </VStack>
  </ForceScrollDownView>
);
</file>

<file path="apps/main-app/ts/features/design-system/core/DSForceScrollDownViewTitleTransition.tsx">
import {
  Body,
  ContentWrapper,
  ForceScrollDownView,
  IOColors,
  IODimensions,
  VStack
} from "@io-app/design-system";
import { View } from "react-native";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSFullScreenModal.tsx">
import {
  Body,
  ContentWrapper,
  H4,
  hexToRgba,
  IOColors,
  IODimensions
} from "@io-app/design-system";
import { ScrollView, Text, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSHapticFeedback.tsx">
import {
  H4,
  HapticType,
  IOButton,
  triggerHaptic,
  useIOTheme,
  VStack
} from "@io-app/design-system";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
⋮----
export const DSHapticFeedback = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSHeaderFirstLevel.tsx">
import { Body, H4 } from "@io-app/design-system";
import { Alert } from "react-native";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import { IOScrollView } from "../../../components/ui/IOScrollView";
import { useHeaderFirstLevel } from "../../../hooks/useHeaderFirstLevel";
import ROUTES from "../../../navigation/routes";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSHeaderSecondLevel.tsx">
import { Body, VSpacer } from "@io-app/design-system";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../components/ui/IOScrollViewWithLargeHeader";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSHeaderSecondLevelWithSectionTitle.tsx">
import { Body, VSpacer } from "@io-app/design-system";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../components/ui/IOScrollViewWithLargeHeader";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSIcons.tsx">
import {
  H4,
  Icon,
  IOBiometricIcons,
  IOCategoryIcons,
  IOIcons,
  IOIconSizeScale,
  IOIconsNew,
  IONavIcons,
  IOProductIcons,
  IOSystemIcons,
  SVGIconProps,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { JSX, useCallback } from "react";
import { FlatList, ListRenderItemInfo, StyleSheet, View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSIconViewerBox, iconItemGutter } from "../components/DSIconViewerBox";
⋮----
interface IconSetObject {
  [key: string]: ({ size, style }: SVGIconProps) => JSX.Element;
}
⋮----
type IconSubsetObject = Record<
  string,
  ({ size, style }: SVGIconProps) => JSX.Element
>;
const filterIconSet = (
  iconSubsetObject: IconSubsetObject,
  iconSetObject: IconSetObject
): IconSetObject
⋮----
// Just for demo purposes
// Once we defined a general set of icon sizes,
// just replace the following array:
⋮----
const keyExtractor = (item: string, index: number)
⋮----
withDot=
</file>

<file path="apps/main-app/ts/features/design-system/core/DSIOListViewWithLargeHeader.tsx">
import { ListItemHeader, ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { useState } from "react";
import { Alert } from "react-native";
⋮----
import { IOListViewWithLargeHeader } from "../../../components/ui/IOListViewWithLargeHeader";
⋮----
const pullAction = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSIOMarkdown.tsx">
import { IOMarkdown } from "@io-app/design-system";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
⋮----
export const DSIOMarkdown = () => (
  <DesignSystemScreen title="IOMarkdown">
    <IOMarkdown content={MARKDOWN} />
  </DesignSystemScreen>
);
</file>

<file path="apps/main-app/ts/features/design-system/core/DSIOScrollView.tsx">
import {
  Body,
  H2,
  IOButton,
  IOColors,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Alert, View } from "react-native";
⋮----
import { IOScrollView } from "../../../components/ui/IOScrollView";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSIOScrollViewCentredContent.tsx">
import { Alert } from "react-native";
⋮----
import { IOScrollViewCentredContent } from "../../../components/ui/IOScrollViewCentredContent";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
⋮----
const onButtonPress = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSIOScrollViewWithLargeHeader.tsx">
import {
  Body,
  ContentWrapper,
  H3,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Alert } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../components/ui/IOScrollViewWithLargeHeader";
⋮----
export const DSIOScrollViewScreenWithLargeHeader = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSIOScrollViewWithListItems.tsx">
import { ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { Alert } from "react-native";
⋮----
import { IOScrollViewWithListItems } from "../../../components/ui/IOScrollViewWithListItems";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
⋮----
const onButtonPress = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSIOScrollViewWithoutActions.tsx">
import { Body, H2, useIOTheme, VSpacer } from "@io-app/design-system";
⋮----
import { IOScrollView } from "../../../components/ui/IOScrollView";
⋮----
export const DSIOScrollViewWithoutActions = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSIridescentTrustmark.tsx">
import { H4, useIOTheme, VSpacer } from "@io-app/design-system";
⋮----
import { ItwStoredCredentialsMocks } from "../../itwallet/common/utils/itwMocksUtils";
import { ItwCredentialTrustmark } from "../../itwallet/trustmark/components/ItwCredentialTrustmark";
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import DESIGN_SYSTEM_ROUTES from "../navigation/routes";
⋮----
export const DSIridescentTrustmark = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSItwBrandExploration.tsx">
import { Body, ContentWrapper } from "@io-app/design-system";
import { Dimensions, Platform, StyleSheet, View } from "react-native";
import Animated, {
  SharedValue,
  useAnimatedRef,
  useAnimatedStyle,
  useScrollOffset,
  withSpring,
  WithSpringConfig
} from "react-native-reanimated";
⋮----
import FocusAwareStatusBar from "../../../components/ui/FocusAwareStatusBar";
⋮----
export const DSItwBrandExploration = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSLayout.tsx">
import {
  Body,
  BodySmall,
  ContentWrapper,
  Divider,
  H2,
  H6,
  HStack,
  IOColors,
  IODimensions,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
import { DSSpacerViewerBox } from "../components/DSSpacerViewerBox";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSListItems.tsx">
import {
  Badge,
  Divider,
  H4,
  H6,
  Icon,
  ListItemAction,
  ListItemHeader,
  ListItemInfo,
  ListItemInfoCopy,
  ListItemNav,
  ListItemNavAlert,
  ListItemTransaction,
  ListItemTransactionLogo,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { Fragment } from "react";
import { Alert, View } from "react-native";
⋮----
import { DEFAULT_CONTENT_REPO_URL } from "../../../config";
import {
  ListItemMessage,
  ListItemMessageProps
} from "../../messages/components/Home/DS/ListItemMessage";
import { ListItemMessageSkeleton } from "../../messages/components/Home/DS/ListItemMessageSkeleton";
import { getBadgePropsByTransactionStatus } from "../../payments/common/utils";
import { ListItemTransactionStatus } from "../../payments/common/utils/types";
import { ListItemSearchInstitution } from "../../services/common/components/ListItemSearchInstitution";
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
⋮----
const onButtonPress = () =>
⋮----
const onCopyButtonPress = () =>
⋮----
export const DSListItems = () =>
⋮----
</file>

<file path="apps/main-app/ts/features/design-system/core/DSLoaders.tsx">
import {
  H4,
  hexToRgba,
  IOColors,
  LoadingSpinner,
  Pictogram,
  ProgressLoader,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { ReactNode, useEffect, useState } from "react";
import { ActivityIndicator, StyleSheet, View } from "react-native";
⋮----
import { CircularProgress } from "../../../components/ui/CircularProgress";
import { LoadingIndicator } from "../../../components/ui/LoadingIndicator";
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
⋮----
type SpinnerViewerBox = {
  children: ReactNode;
  name: string;
  variant?: "default" | "primary";
};
⋮----
const SpinnerViewerBox = ({
  name,
  children,
  variant = "default"
}: SpinnerViewerBox) => (
  <DSComponentViewerBox name={name}>
    <View
      style={[
        styles.spinnerOuter,
        { backgroundColor: IOColors[viewerBackgroundMap[variant]] }
      ]}
    >
      {children}
    </View>
  </DSComponentViewerBox>
);
⋮----
const ProgressLoaderViewerBox = () =>
⋮----
const CircularProgressViewerBox = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSLoadingScreen.tsx">
import { LoadingScreenContent } from "../../../components/screens/LoadingScreenContent";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSLoadingScreenExtendedProps.tsx">
import { Alert } from "react-native";
⋮----
import { LoadingScreenContent } from "../../../components/screens/LoadingScreenContent";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSLogos.tsx">
import {
  Avatar,
  AvatarSearch,
  H4,
  hexToRgba,
  HSpacer,
  HStack,
  IOColors,
  IODimensions,
  IOLogoPaymentCardType,
  IOLogoPaymentExtType,
  IOLogoPaymentType,
  IOPaymentCardLogos,
  IOPaymentExtLogos,
  IOPaymentLogos,
  LogoPayment,
  LogoPaymentCard,
  LogoPaymentExt,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { ScrollView, StyleSheet, View } from "react-native";
⋮----
import { LogoPaymentExtended } from "../../../components/ui/LogoPaymentExtended";
import { DEFAULT_CONTENT_REPO_URL } from "../../../config";
import { AvatarDouble } from "../../messages/components/Home/DS/AvatarDouble";
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
import {
  DSLogoPaymentViewerBox,
  logoItemGutter
} from "../components/DSLogoPaymentViewerBox";
⋮----
export const DSLogos = () =>
⋮----
</file>

<file path="apps/main-app/ts/features/design-system/core/DSModules.tsx">
import { ProductCategoryEnum } from "@io-app/api-types/generated/definitions/cgn/merchants/ProductCategory";
import {
  H4,
  ModuleAttachment,
  ModuleCheckout,
  ModuleCredential,
  ModuleIDP,
  ModuleNavigation,
  ModuleNavigationAlt,
  ModulePaymentNotice,
  ModuleSummary,
  PaymentNoticeStatus,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { Alert } from "react-native";
⋮----
import CgnLogo from "../../../../img/bonus/cgn/cgn_logo.png";
import { ModuleCgnDiscount } from "../../bonus/cgn/components/merchants/ModuleCgnDiscount";
import { getBadgeTextByPaymentNoticeStatus } from "../../messages/utils/strings";
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
⋮----
const onButtonPress = () =>
⋮----
type PaymentNoticeStatusWithoutDefault = Exclude<
  PaymentNoticeStatus,
  "default"
>;
⋮----
export const DSModules = () =>
⋮----
⋮----
const renderModuleAttachment = () => (
  <VStack space={componentMargin}>
    <DSComponentViewerBox name="ModuleAttachment, loading">
      <ModuleAttachment
        format="pdf"
        isLoading={true}
        onPress={onButtonPress}
        title="Nome del documento.pdf"
      />
    </DSComponentViewerBox>
    <DSComponentViewerBox name="ModuleAttachment, default variant">
      <VStack space={componentInnerMargin}>
        <ModuleAttachment
          format="pdf"
          onPress={onButtonPress}
          title="Nome del documento.pdf"
        />
      </VStack>
    </DSComponentViewerBox>
    <DSComponentViewerBox name="ModuleAttachment, stress test">
      <ModuleAttachment
        format="pdf"
        onPress={onButtonPress}
        title="This is a very loooooooooooooooooooooong title"
      />
    </DSComponentViewerBox>
    <DSComponentViewerBox name="ModuleAttachment, fetching">
      <ModuleAttachment
        format="pdf"
        isFetching={true}
        onPress={onButtonPress}
        title="Nome del documento.pdf"
      />
    </DSComponentViewerBox>
    <DSComponentViewerBox name="ModuleAttachment, disabled">
      <ModuleAttachment
        disabled={true}
        format="pdf"
        onPress={onButtonPress}
        title="Nome del documento.pdf"
      />
    </DSComponentViewerBox>
  </VStack>
);
⋮----
badgeText=
</file>

<file path="apps/main-app/ts/features/design-system/core/DSNativeBottomSheet.tsx">
import { Divider, ListItemNav } from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import DESIGN_SYSTEM_ROUTES from "../navigation/routes";
⋮----
export const DSNativeBottomSheet = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSNativeBottomSheetContent.tsx">
import {
  Body,
  ContentWrapper,
  H4,
  IOButton,
  IODimensions,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import { ScrollView, StyleSheet, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
const ShortContent = () => (
  <Body>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
    quis nostrud exercitation ullamco laboris.
  </Body>
);
</file>

<file path="apps/main-app/ts/features/design-system/core/DSNumberPad.tsx">
import {
  Body,
  BodySmall,
  CodeInput,
  H2,
  hexToRgba,
  IOButton,
  IOColors,
  IODimensions,
  ListItemSwitch,
  NumberPad,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import { useCallback, useEffect, useState } from "react";
import { Alert, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSOTPInput.tsx">
import {
  Body,
  ContentWrapper,
  H4,
  H5,
  HStack,
  IconButton,
  IOButton,
  IODimensions,
  OTPInput,
  OTPInputProps,
  RadioGroup,
  RadioItem,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { useHeaderHeight } from "@react-navigation/elements";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { RefObject, useCallback, useMemo, useRef, useState } from "react";
import { KeyboardAvoidingView, Platform, ScrollView, View } from "react-native";
⋮----
import { useScreenEndMargin } from "../../../hooks/useScreenEndMargin";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
⋮----
type OtpID = typeof OTP_LENGTH_6 | typeof OTP_LENGTH_8;
⋮----
type WrapperProps = {
  autoFocus?: boolean;
  otpCompare: string;
  otpLength: number;
  secret?: boolean;
  validation?: boolean;
};
⋮----
const scrollVerticallyToView = (
  scrollViewRef: RefObject<null | ScrollView>,
  targetViewRef: RefObject<null | View>
) =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSPictograms.tsx">
import {
  H4,
  hexToRgba,
  HSpacer,
  IOColors,
  IOPictograms,
  IOPictogramsBleed,
  IOPictogramsObject,
  Pictogram,
  PictogramBleed,
  SVGPictogramProps,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { JSX } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import {
  assetItemGutter,
  DSAssetViewerBox
} from "../components/DSAssetViewerBox";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
⋮----
interface PictogramSetObject {
  [key: string]: ({ size }: SVGPictogramProps) => JSX.Element;
}
⋮----
type PictogramSubsetObject = Record<
  string,
  ({ size }: SVGPictogramProps) => JSX.Element
>;
⋮----
const filterPictogramSet = (
  pictogramSubsetObject: PictogramSubsetObject,
  pictogramSetObject: PictogramSetObject
): PictogramSetObject
</file>

<file path="apps/main-app/ts/features/design-system/core/DSSafeArea.tsx">
import {
  Body,
  H4,
  hexToRgba,
  IOColors,
  IODimensions
} from "@io-app/design-system";
import { ScrollView, Text, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSSafeAreaCentered.tsx">
import {
  Body,
  H4,
  hexToRgba,
  IOColors,
  IODimensions,
  VStack
} from "@io-app/design-system";
import { Platform, ScrollView, Text, View } from "react-native";
import {
  SafeAreaView,
  useSafeAreaInsets
} from "react-native-safe-area-context";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSScreenEndMargin.tsx">
import { Body, IODimensions } from "@io-app/design-system";
import { ScrollView } from "react-native";
⋮----
import { useScreenEndMargin } from "../../../hooks/useScreenEndMargin";
⋮----
export const DSScreenEndMargin = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSScreenOperationResult.tsx">
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSScreenOperationResultAnimated.tsx">
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
</file>

<file path="apps/main-app/ts/features/design-system/core/DSSelection.tsx">
import {
  BodySmall,
  CheckboxLabel,
  Divider,
  H4,
  HSpacer,
  IOColors,
  ListItemCheckbox,
  ListItemRadioWithAmount,
  ListItemSwitch,
  MessageCheckbox,
  RadioGroup,
  RadioItem,
  Switch,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { ComponentProps, useState } from "react";
import { Alert, Text, View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
⋮----
export const DSSelection = () =>
⋮----
⋮----
const renderCheckboxLabel = () => (
  <VStack space={componentMargin}>
    <DSComponentViewerBox name="CheckboxLabel">
      <VStack space={componentInnerMargin}>
        <CheckboxLabel label="This is a test" />
        <CheckboxLabel label="This is a test with a very loooong looooooooong loooooooong text" />
      </VStack>
    </DSComponentViewerBox>
    <DSComponentViewerBox name="CheckboxLabel (disabled)">
      <VStack space={componentInnerMargin}>
        <CheckboxLabel checked={true} disabled label="This is a test" />
        <CheckboxLabel disabled label="This is a test" />
      </VStack>
    </DSComponentViewerBox>
  </VStack>
);
⋮----
items=
⋮----
const toggleSwitch = ()
</file>

<file path="apps/main-app/ts/features/design-system/core/DSServicePreferences.tsx">
import {
  Body,
  Divider,
  IOButton,
  IOColors,
  IOSpringValues,
  ListItemHeader,
  ListItemSwitch,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { ComponentProps, useCallback, useState } from "react";
import { StyleSheet } from "react-native";
import Animated, {
  LayoutAnimationConfig,
  LinearTransition,
  useReducedMotion,
  withDelay,
  withSpring
} from "react-native-reanimated";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import DESIGN_SYSTEM_ROUTES from "../navigation/routes";
⋮----
const enterToggleTransition = (delay: number) => () =>
⋮----
const exitToggleTransition = () =>
⋮----
const PlaceholderBox = ({
  label,
  layout
}: {
  label: string;
  layout?: ComponentProps<typeof Animated.View>["layout"];
}) =>
⋮----
const getEnterTransition = (index: number)
⋮----
entering=
</file>

<file path="apps/main-app/ts/features/design-system/core/DSStepper.tsx">
import {
  H4,
  IODimensions,
  Stepper,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
⋮----
export const DSStepper = () =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSTabNavigation.tsx">
import {
  BodyMonospace,
  ContentWrapper,
  H4,
  H6,
  HStack,
  IOColors,
  TabItem,
  TabNavigation,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { useState } from "react";
import { View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
import DESIGN_SYSTEM_ROUTES from "../navigation/routes";
⋮----
</file>

<file path="apps/main-app/ts/features/design-system/core/DSTextFields.tsx">
import {
  H4,
  TextInput,
  TextInputPassword,
  TextInputValidation,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { ComponentProps, useState } from "react";
import { View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DSComponentViewerBox } from "../components/DSComponentViewerBox";
⋮----
export const DSTextFields = () =>
⋮----
const InputComponentWrapper = (
  props: Omit<ComponentProps<typeof TextInput>, "onChangeText" | "value"> & {
    value?: string;
  }
) =>
⋮----
const InputValidationComponentWrapper = (
  props: Omit<
    ComponentProps<typeof TextInputValidation>,
    "errorMessage" | "onChangeText" | "value"
  > & { errorMessage?: string; value?: string }
) =>
⋮----
const InputPasswordComponentWrapper = (
  props: Omit<
    ComponentProps<typeof TextInputPassword>,
    "buttonAccessibilityLabel" | "onChangeText" | "value"
  > & { value?: string }
) =>
</file>

<file path="apps/main-app/ts/features/design-system/core/DSToastNotifications.tsx">
import {
  H4,
  IOButton,
  IOToast,
  ToastNotification,
  useIOTheme,
  VStack
} from "@io-app/design-system";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
⋮----
export const DSToastNotifications = () =>
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/design-system/core/DSTypography.tsx">
import {
  Body,
  BodyMonospace,
  BodySmall,
  ButtonText,
  Caption,
  Divider,
  H1,
  H2,
  H3,
  H4,
  H5,
  H6,
  Hero,
  HStack,
  IOColors,
  LabelMini,
  MdH1,
  MdH2,
  MdH3,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { Alert, View } from "react-native";
⋮----
import { DesignSystemScreen } from "../components/DesignSystemScreen";
⋮----
const linkOnPress = ()
⋮----
const getLongerTitle = (element: string)
</file>

<file path="apps/main-app/ts/features/design-system/core/DSWallet.tsx">
import { ListItemHeader, VStack } from "@io-app/design-system";
⋮----
import { CredentialType } from "../../itwallet/common/utils/itwMocksUtils";
import { WalletCardsCategoryContainer } from "../../wallet/components/WalletCardsCategoryContainer";
import { WalletCard, WalletCardCategory } from "../../wallet/types";
import { DesignSystemScreen } from "../components/DesignSystemScreen";
import { DesignSystemSection } from "../components/DesignSystemSection";
⋮----
export const DSWallet = () =>
</file>

<file path="apps/main-app/ts/features/design-system/navigation/navigator.tsx">
import {
  IconButton,
  IOColors,
  makeFontStyleObject,
  useIOExperimentalDesign,
  useIOTheme,
  useIOThemeContext
} from "@io-app/design-system";
import { ThemeProvider, useNavigation } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { Platform } from "react-native";
⋮----
import {
  IONavigationDarkTheme,
  IONavigationLightTheme
} from "../../../navigation/theme";
import { isGestureEnabled } from "../../../utils/navigation";
import { DSAdvice } from "../core/DSAdvice";
import { DSAlert } from "../core/DSAlert";
import { DSAnimatedNumericText } from "../core/DSAnimatedNumericText";
import { DSAnimatedPictograms } from "../core/DSAnimatedPictograms";
import { DSBadges } from "../core/DSBadges";
import { DSBonusCardScreen } from "../core/DSBonusCardScreen";
import { DSBottomSheet } from "../core/DSBottomSheet";
import { DSButtons } from "../core/DSButtons";
import { DSCards } from "../core/DSCards";
import { DSCollapsible } from "../core/DSCollapsible";
import { DSColors } from "../core/DSColors";
import { DSDynamicBackground } from "../core/DSDynamicBackground";
import { DSDynamicCardRotation } from "../core/DSDynamicCardRotation";
import { DSEdgeToEdgeArea } from "../core/DSEdgeToEdgeArea";
import { DSFooterActions } from "../core/DSFooterActions";
import { DSFooterActionsInline } from "../core/DSFooterActionsInline";
import { DSFooterActionsInlineNotFixed } from "../core/DSFooterActionsInlineNotFixed";
import { DSFooterActionsNotFixed } from "../core/DSFooterActionsNotFixed";
import { DSFooterActionsSticky } from "../core/DSFooterActionsSticky";
import { DSForceScrollDownView } from "../core/DSForceScrollDownView";
import { DSForceScrollDownViewCustomSlot } from "../core/DSForceScrollDownViewCustomSlot";
import { DSForceScrollDownViewTitleTransition } from "../core/DSForceScrollDownViewTitleTransition";
import { DSFullScreenModal } from "../core/DSFullScreenModal";
import { DSHapticFeedback } from "../core/DSHapticFeedback";
import { DSHeaderFirstLevel } from "../core/DSHeaderFirstLevel";
import { DSHeaderSecondLevel } from "../core/DSHeaderSecondLevel";
import { DSHeaderSecondLevelWithSectionTitle } from "../core/DSHeaderSecondLevelWithSectionTitle";
import { DSIcons } from "../core/DSIcons";
import { DSIOListViewWithLargeHeader } from "../core/DSIOListViewWithLargeHeader";
import { DSIOMarkdown } from "../core/DSIOMarkdown";
import { DSIOScrollView } from "../core/DSIOScrollView";
import { DSIOScrollViewCentredContent } from "../core/DSIOScrollViewCentredContent";
import { DSIOScrollViewScreenWithLargeHeader } from "../core/DSIOScrollViewWithLargeHeader";
import { DSIOScrollViewWithListItems } from "../core/DSIOScrollViewWithListItems";
import { DSIOScrollViewWithoutActions } from "../core/DSIOScrollViewWithoutActions";
import { DSIridescentTrustmark } from "../core/DSIridescentTrustmark";
import { DSItwBrandExploration } from "../core/DSItwBrandExploration";
import { DSLayout } from "../core/DSLayout";
import { DSListItems } from "../core/DSListItems";
import { DSLoaders } from "../core/DSLoaders";
import { DSLoadingScreen } from "../core/DSLoadingScreen";
import { DSLoadingScreenExtendedProps } from "../core/DSLoadingScreenExtendedProps";
import { DSLogos } from "../core/DSLogos";
import { DSModules } from "../core/DSModules";
import { DSNativeBottomSheet } from "../core/DSNativeBottomSheet";
import {
  NativeSheetFitToContents,
  NativeSheetHalf,
  NativeSheetTwoDetents
} from "../core/DSNativeBottomSheetContent";
import { DSNumberPad } from "../core/DSNumberPad";
import { DSOTPInput } from "../core/DSOTPInput";
import { DSPictograms } from "../core/DSPictograms";
import { DSSafeArea } from "../core/DSSafeArea";
import { DSSafeAreaCentered } from "../core/DSSafeAreaCentered";
import { DSScreenEndMargin } from "../core/DSScreenEndMargin";
import { DSScreenOperationResult } from "../core/DSScreenOperationResult";
import { DSScreenOperationResultAnimated } from "../core/DSScreenOperationResultAnimated";
import { DSSelection } from "../core/DSSelection";
import { DSServicePreferences } from "../core/DSServicePreferences";
import { DSStepper } from "../core/DSStepper";
import { DSTabNavigation } from "../core/DSTabNavigation";
import { DSTextFields } from "../core/DSTextFields";
import { DSToastNotifications } from "../core/DSToastNotifications";
import { DSTypography } from "../core/DSTypography";
import { DSWallet } from "../core/DSWallet";
import { DesignSystem } from "../DesignSystem";
import { DesignSystemParamsList } from "./params";
import DESIGN_SYSTEM_ROUTES from "./routes";
⋮----
const RNNCloseButton = () =>
⋮----
navigation.goBack();
⋮----
export const DesignSystemNavigator = () =>
⋮----
...makeFontStyleObject(
</file>

<file path="apps/main-app/ts/features/design-system/navigation/params.ts">
import DESIGN_SYSTEM_ROUTES from "./routes";
⋮----
export type DesignSystemParamsList = {
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.ADVICE.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.ALERT.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.BADGE.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.BOTTOM_SHEET.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.BUTTONS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.CARDS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.COLLAPSIBLE.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.IO_MARKDOWN.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.LIST_ITEMS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.MODULES.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.OTP_INPUT.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.SELECTION.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.STEPPER.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.TAB_NAVIGATION.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.TEXT_FIELDS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.TOASTS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.COMPONENTS.WALLET.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.DEBUG.EDGE_TO_EDGE_AREA.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.DEBUG.FOOTER_ACTIONS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.DEBUG.FOOTER_ACTIONS_INLINE.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.DEBUG.FOOTER_ACTIONS_INLINE_NOT_FIXED.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.DEBUG.FOOTER_ACTIONS_NOT_FIXED.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.DEBUG.FOOTER_ACTIONS_STICKY.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.DEBUG.SAFE_AREA.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.DEBUG.SAFE_AREA_CENTERED.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.DEBUG.SCREEN_END_MARGIN.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.EXPERIMENTAL_LAB.ANIMATED_NUMERIC_TEXT
    .route]: undefined;
  [DESIGN_SYSTEM_ROUTES.EXPERIMENTAL_LAB.ANIMATED_PICTOGRAMS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.EXPERIMENTAL_LAB.DYNAMIC_BACKGROUND.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.EXPERIMENTAL_LAB.DYNAMIC_CARD_ROTATION
    .route]: undefined;
  [DESIGN_SYSTEM_ROUTES.EXPERIMENTAL_LAB.IRIDESCENT_TRUSTMARK.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.EXPERIMENTAL_LAB.ITW_BRAND_EXPLORATION
    .route]: undefined;
  [DESIGN_SYSTEM_ROUTES.EXPERIMENTAL_LAB.SERVICE_PREFERENCES.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.FOUNDATION.COLOR.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.FOUNDATION.HAPTIC_FEEDBACK.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.FOUNDATION.ICONS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.FOUNDATION.LAYOUT.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.FOUNDATION.LOADERS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.FOUNDATION.LOGOS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.FOUNDATION.PICTOGRAMS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.FOUNDATION.TYPOGRAPHY.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.HEADERS.FIRST_LEVEL.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.HEADERS.SECOND_LEVEL.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.HEADERS.SECOND_LEVEL_SECTION_TITLE.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.MAIN.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.NATIVE.BOTTOM_SHEET.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.NATIVE.FULL_SCREEN_MODAL.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.NATIVE_SHEETS.FIT_TO_CONTENTS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.NATIVE_SHEETS.HALF_SCREEN.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.NATIVE_SHEETS.TWO_DETENTS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.BONUS_CARD_SCREEN.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.FORSCESCROLLDOWNVIEW_ACTIONS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.FORSCESCROLLDOWNVIEW_CUSTOM_SLOT
    .route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.FORSCESCROLLDOWNVIEW_TITLE_TRANSITION
    .route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.IOLISTVIEW_LARGE_HEADER.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.IOSCROLLVIEW.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.IOSCROLLVIEW_CENTRED_CONTENT.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.IOSCROLLVIEW_LARGEHEADER.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.IOSCROLLVIEW_WITH_LIST_ITEMS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.IOSCROLLVIEW_WO_ACTIONS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.LOADING_SCREEN.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.LOADING_SCREEN_EXTENDED_PROPS.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.NUMBERPAD.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.OPERATION_RESULT.route]: undefined;
  [DESIGN_SYSTEM_ROUTES.SCREENS.OPERATION_RESULT_ANIMATED.route]: undefined;
};
</file>

<file path="apps/main-app/ts/features/design-system/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/design-system/DesignSystem.tsx">
import {
  BodySmall,
  Divider,
  H2,
  IODimensions,
  ListItemNav,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import {
  NativeStackNavigationOptions,
  NativeStackNavigationProp
} from "@react-navigation/native-stack";
import { useLayoutEffect, useMemo, useState } from "react";
import { Platform, SectionList } from "react-native";
import { isSearchBarAvailableForCurrentPlatform } from "react-native-screens";
⋮----
import { useScreenEndMargin } from "../../hooks/useScreenEndMargin";
import { useIONavigation } from "../../navigation/params/AppParamsList";
import { DesignSystemParamsList } from "./navigation/params";
import DESIGN_SYSTEM_ROUTES from "./navigation/routes";
⋮----
type RoutesProps = Array<SingleSectionProps>;
⋮----
type SingleSectionProps = {
  description?: string;
  route: string;
  title: string;
};
⋮----
type SectionDataProps = {
  data: RoutesProps;
  description?: string;
  title: string;
};
⋮----
const renderDSNavItem = ({
    item: { title, route }
  }: {
    item: { route: string; title: string };
  }) => (
    <ListItemNav
      accessibilityLabel={`Go to the ${title} page`}
      label={title}
      onPress={() => navigation.navigate(route as any)}
    />
  );
⋮----
onPress=
⋮----
const renderDSSection = ({
    section: { title, description }
  }: {
    section: { description?: string; title: string };
  }) => (
    <VStack space={4}>
      <H2 color={theme["textHeading-default"]} weight="Bold">
        {title}
      </H2>
      {description && (
        <BodySmall color={theme["textBody-tertiary"]} weight={"Regular"}>
          {description}
        </BodySmall>
      )}
    </VStack>
  );
⋮----
const renderDSSectionFooter = (
⋮----
const renderListEmpty = () => (
    <VStack space={8}>
      <BodySmall color={theme["textBody-tertiary"]} weight="Regular">
        No components found.
      </BodySmall>
    </VStack>
  );
⋮----
keyExtractor=
</file>

<file path="apps/main-app/ts/features/fci/analytics/index.ts">
import { SignatureRequestDetailView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestDetailView";
import { SignatureRequestStatusEnum } from "@io-app/api-types/generated/definitions/fci/SignatureRequestStatus";
import { getType } from "typesafe-actions";
⋮----
import { mixpanelTrack } from "../../../mixpanel";
import { Action } from "../../../store/actions/types";
import { buildEventProperties } from "../../../utils/analytics";
import { getNetworkErrorMessage } from "../../../utils/errors";
import {
  fciClearStateRequest,
  fciLoadQtspClauses,
  fciLoadQtspFilledDocument,
  fciPollFilledDocument,
  fciSignatureRequestFromId,
  fciSigningRequest,
  fciStartRequest,
  fciUpdateDocumentSignaturesRequest
} from "../store/actions";
import { FciQtspErrorKind } from "../store/selectors/fciErrors";
⋮----
export const trackFciLoginRequest = ()
⋮----
export const trackFciLoginRequestContinue = ()
⋮----
export const trackFciLoginRequestClose = ()
⋮----
export const trackFciNfcNotSupported = ()
⋮----
export const trackFciNfcNotSupportedClose = ()
⋮----
export const trackFciSignatureCancelled = ()
⋮----
export const trackFciSignatureExpired = ()
⋮----
export const trackFciDocSignatureInProgress = ()
⋮----
export const trackFciSignatureRejected = ()
⋮----
export const trackFciDocAlreadySigned = ()
⋮----
export const trackFciSignatureMismatch = ()
⋮----
export const trackFciSignatureGenericFailure = (reason: string)
⋮----
export const trackFciSignatureRequestStatus = (
  params:
    | {
        environment: string;
        expiresAt: Date;
        status: SignatureRequestStatusEnum.WAIT_FOR_SIGNATURE;
        totalDocCount: number;
      }
    | {
        status: Exclude<
          SignatureRequestStatusEnum,
          SignatureRequestStatusEnum.WAIT_FOR_SIGNATURE
        >;
      }
) =>
⋮----
export const trackFciSignatureDetailFailureAction = (
  reason: string,
  cta_category: "custom_1" | "custom_2",
  cta_id: string
)
⋮----
export const trackFciDocOpening = (
  expire_date: SignatureRequestDetailView["expires_at"],
  total_doc_count: number,
  environment: string
)
⋮----
export const trackFciDocumentsView = ()
⋮----
export const trackFciDocOpeningFailure = (
  reason: "expired" | "generic_error"
)
⋮----
export const trackFciDocOpeningFailureAction = (
  cta_category: "custom_1" | "custom_2",
  cta_id: string,
  reason: "expired" | "generic_error"
)
⋮----
export const trackFciSignatureFieldsView = ()
⋮----
export const trackFciUserDataShare = ()
⋮----
export const trackFciChangeEmail = ()
⋮----
export const trackFciQtspTos = ()
⋮----
export const trackFciTosDocPreview = ()
⋮----
export const trackFciTosDocPreviewSuccess = ()
⋮----
export const trackFciTosDocPreviewFailure = ()
⋮----
export const trackFciTosDocPreviewFailureAction = (
  cta_category: "custom_1" | "custom_2",
... (61 lines truncated)
</file>

<file path="apps/main-app/ts/features/fci/api/backendFci.ts">
import { createClient } from "@io-app/api-types/generated/definitions/fci/client";
⋮----
import { defaultRetryingFetch } from "../../../utils/fetch";
import { LollipopConfig } from "../../lollipop";
import { KeyInfo } from "../../lollipop/utils/crypto";
import { lollipopFetch } from "../../lollipop/utils/fetch";
⋮----
const createFciClient = (baseUrl: string)
⋮----
const createFciClientWithLollipop = (
  baseUrl: string,
  keyInfo: KeyInfo = {},
  lollipopConfig: LollipopConfig
)
⋮----
export type FciClient = ReturnType<typeof createFciClient>;
</file>

<file path="apps/main-app/ts/features/fci/components/DocumentsNavigationBar.tsx">
import {
  ContentWrapper,
  H6,
  hexToRgba,
  HSpacer,
  HStack,
  IconButton,
  IOColors,
  useIOTheme,
  WithTestID
} from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
export type IndicatorPositionEnum = "left" | "right";
⋮----
type Props = WithTestID<{
  disabled?: boolean;
  iconLeftDisabled?: boolean;
  iconRightDisabled?: boolean;
  indicatorPosition: IndicatorPositionEnum;
  onNext: () => void;
  onPrevious: () => void;
  titleLeft: string;
  titleRight: string;
}>;
⋮----
</file>

<file path="apps/main-app/ts/features/fci/components/DocumentViewer.tsx">
import {
  FooterActions,
  FooterActionsInline,
  IOColors,
  IOToast
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { ComponentProps, ReactElement, useEffect, useState } from "react";
import { StyleSheet } from "react-native";
import ReactNativeBlobUtil from "react-native-blob-util";
import Pdf from "react-native-pdf";
⋮----
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { isIos } from "../../../utils/platform";
import { share } from "../../../utils/share";
import { trackFciTosDocPreviewSuccess } from "../analytics";
import { FciDownloadPreviewDirectoryPath } from "../saga/networking/handleDownloadDocument";
import { fciDownloadPreview } from "../store/actions";
import {
  fciDownloadPathSelector,
  fciDownloadPreviewSelector
} from "../store/reducers/fciDownloadPreview";
import LoadingComponent from "./LoadingComponent";
⋮----
export const getFileNameFromUrl = (url: string)
⋮----
</file>

<file path="apps/main-app/ts/features/fci/components/DocumentWithSignature.tsx">
import { ExistingSignatureFieldAttrs } from "@io-app/api-types/generated/definitions/fci/ExistingSignatureFieldAttrs";
import { SignatureFieldToBeCreatedAttrs } from "@io-app/api-types/generated/definitions/fci/SignatureFieldToBeCreatedAttrs";
import {
  ContentWrapper,
  FooterActions,
  H5,
  HSpacer,
  IconButton,
  IOColors,
  IODimensions,
  IODimensionScale,
  useFooterActionsMeasurements,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
⋮----
import { constNull, pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback, useRef, useState } from "react";
import { StyleSheet, View } from "react-native";
import Pdf, { PdfRef } from "react-native-pdf";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { ButtonBlockProps } from "../../../components/ui/utils/buttons";
import { useHardwareBackButton } from "../../../hooks/useHardwareBackButton.ts";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { WithTestID } from "../../../types/WithTestID";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { fciDocumentSignatureFields } from "../store/actions";
import { fciSignatureFieldDrawingSelector } from "../store/reducers/fciSignatureFieldDrawing";
import { fciSignatureDetailDocumentsSelector } from "../store/reducers/fciSignatureRequest";
import DocumentsNavigationBar from "./DocumentsNavigationBar";
import LoadingComponent from "./LoadingComponent";
⋮----
export type SignatureFieldAttrType =
  | ExistingSignatureFieldAttrs
  | SignatureFieldToBeCreatedAttrs;
⋮----
type Props = WithTestID<{
  attrs: SignatureFieldAttrType;
  currentDoc: number;
  onClose: () => void;
  onError: () => void;
}>;
⋮----
const onContinuePress = ()
⋮----
const pointToPage = (page: number)
⋮----
setTotalPages(numberOfPages);
⋮----
const onPrevious = () =>
</file>

<file path="apps/main-app/ts/features/fci/components/LinkedText.tsx">
import { Body, H4, H6, WithTestID } from "@io-app/design-system";
⋮----
import { Fragment } from "react";
⋮----
type Props = WithTestID<{
  onPress: (holder: string) => void;
  replacementUrl: string;
  text: string;
}>;
⋮----
const getMatchedLinks = (text: string)
⋮----
const getOrReplaceTagWithLink = (tagLink: string, replacementUrl: string) =>
</file>

<file path="apps/main-app/ts/features/fci/components/LoadingComponent.tsx">
import {
  Body,
  H3,
  useIOTheme,
  VSpacer,
  WithTestID
} from "@io-app/design-system";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { LoadingIndicator } from "../../../components/ui/LoadingIndicator";
⋮----
type Props = WithTestID<
  Readonly<{
    captionSubtitle?: string;
    captionTitle?: string;
  }>
>;
</file>

<file path="apps/main-app/ts/features/fci/components/QtspClauseListItem.tsx">
import { QtspClause } from "@io-app/api-types/generated/definitions/fci/QtspClause";
import { CheckboxLabel } from "@io-app/design-system";
import { useState } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { fciQtspFilledDocumentUrlSelector } from "../store/reducers/fciQtspFilledDocument";
import LinkedText from "./LinkedText";
⋮----
type Props = {
  checked?: boolean;
  clause: QtspClause;
  onChange: (_: boolean) => void;
  onLinkPress: (url: string) => void;
};
⋮----
const onChange = (value: boolean) =>
⋮----
const onPressLinkedText = (url: string) =>
</file>

<file path="apps/main-app/ts/features/fci/components/SignatureFieldItem.tsx">
import { Body, ListItemCheckbox } from "@io-app/design-system";
import I18n from "i18next";
import { useState } from "react";
import { StyleSheet, View } from "react-native";
⋮----
type Props = {
  disabled?: boolean;
  onChange: (_: boolean) => void;
  onPressDetail: () => void;
  title: string;
  value?: boolean;
};
⋮----
const onChange = (value: boolean) =>
</file>

<file path="apps/main-app/ts/features/fci/components/SignatureRequestItem.tsx">
import { SignatureRequestListView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestListView";
import { SignatureRequestStatusEnum } from "@io-app/api-types/generated/definitions/fci/SignatureRequestStatus";
import { Badge, BodySmall, Divider, H6, HSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import TouchableDefaultOpacity from "../../../components/TouchableDefaultOpacity";
⋮----
type Props = {
  item: SignatureRequestListView;
  onPress: () => void;
};
</file>

<file path="apps/main-app/ts/features/fci/components/SignatureStatusComponent.tsx">
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
import { IOPictograms } from "@io-app/design-system";
import { EmailString } from "@pagopa/ts-commons/lib/strings";
import I18n from "i18next";
import { Linking } from "react-native";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../components/screens/OperationResultScreenContent";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { WithTestID } from "../../../types/WithTestID";
import {
  addTicketCustomField,
  assistanceToolRemoteConfig,
  defaultZendeskBonusesCategory,
  resetCustomFields,
  zendeskBonusAndInitiativeCategoryId,
  zendeskCategoryId,
  zendeskFCICategory,
  zendeskFciId
} from "../../../utils/supportAssistance";
import {
  zendeskSelectedCategory,
  zendeskSelectedSubcategory,
  zendeskSupportStart
} from "../../zendesk/store/actions";
import { fciSignatureRequestIdSelector } from "../store/reducers/fciSignatureRequest";
⋮----
export type Props = WithTestID<{
  assistance?: boolean;
  email?: EmailString;
  onPress: () => void;
  onPressAssistance?: () => void;
  pictogram: IOPictograms;
  retry?: boolean;
  subTitle: string;
  title: string;
}>;
const SignatureStatusComponent = ({
  title,
  subTitle,
  email,
  pictogram,
  retry,
  assistance,
  onPress,
  testID,
  onPressAssistance
}: Props) =>
⋮----
const zendeskAssistanceLogAndStart = () =>
⋮----
const handleAskAssistance = () =>
⋮----
type OperationResultButtons = Pick<
    OperationResultScreenContentProps,
    "action" | "secondaryAction"
  >;
⋮----
const operationResultActions = (): OperationResultButtons =>
</file>

<file path="apps/main-app/ts/features/fci/components/SuccessComponent.tsx">
import { SignatureRequestDetailView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestDetailView";
import { SignatureRequestStatusEnum } from "@io-app/api-types/generated/definitions/fci/SignatureRequestStatus";
import { useIsFocused } from "@react-navigation/native";
import I18n from "i18next";
import { useEffect, useMemo } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import {
  trackFciSignatureExpired,
  trackFciSignatureRequestStatus
} from "../analytics";
import { fciEndRequest, fciStartRequest } from "../store/actions";
import { fciEnvironmentSelector } from "../store/reducers/fciEnvironment";
import { fciSignatureDetailDocumentsSelector } from "../store/reducers/fciSignatureRequest";
import SignatureStatusComponent from "./SignatureStatusComponent";
⋮----
onPress=
⋮----
subTitle=
</file>

<file path="apps/main-app/ts/features/fci/hooks/useFciAbortSignatureFlow.tsx">
import {
  FooterActions,
  IOMarkdownLite,
  useIOExperimentalDesign
} from "@io-app/design-system";
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { Alert } from "react-native";
⋮----
import { useHardwareBackButtonWhenFocused } from "../../../hooks/useHardwareBackButton.ts";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { trackFciUserExit } from "../analytics";
import { fciEndRequest } from "../store/actions";
import { fciEnvironmentSelector } from "../store/reducers/fciEnvironment";
import { fciSignatureRequestDossierTitleSelector } from "../store/reducers/fciSignatureRequest";
⋮----
type Props = {
  onBackPress?: () => void;
  showDialogOnBack?: boolean;
};
⋮----
const abortSignatureFlow = () =>
</file>

<file path="apps/main-app/ts/features/fci/hooks/useFciCheckService.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { Body, ContentWrapper, IOButton, VSpacer } from "@io-app/design-system";
⋮----
import I18n from "i18next";
⋮----
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { upsertServicePreference } from "../../services/details/store/actions/preference";
import { servicePreferencePotByIdSelector } from "../../services/details/store/selectors";
import { isServicePreferenceResponseSuccess } from "../../services/details/types/ServicePreferenceResponse";
import {
  trackFciBottomsheetMessagePermissionAccepted,
  trackFciBottomsheetMessagePermissionDeclined,
  trackFciBottomsheetMessagePermissionRequest,
  trackFciUxConversion
} from "../analytics";
import { fciStartSigningRequest } from "../store/actions";
import { fciEnvironmentSelector } from "../store/reducers/fciEnvironment";
import { fciMetadataServiceIdSelector } from "../store/reducers/fciMetadata";
⋮----
export const useFciCheckService = () =>
⋮----
const handleDismiss = () =>
⋮----
const handleConfirm = () =>
⋮----
label=
⋮----
const present = () =>
</file>

<file path="apps/main-app/ts/features/fci/hooks/useFciNoSignatureFields.tsx">
import { Body, FooterActionsInline } from "@io-app/design-system";
import { StackActions } from "@react-navigation/native";
import { increment } from "fp-ts/lib/function";
import I18n from "i18next";
import { ComponentProps } from "react";
⋮----
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../store/hooks";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { trackFciStartSignature } from "../analytics";
import { FCI_ROUTES } from "../navigation/routes";
import { fciEnvironmentSelector } from "../store/reducers/fciEnvironment";
import { fciSignatureDetailDocumentsSelector } from "../store/reducers/fciSignatureRequest";
⋮----
type Props = {
  currentDoc: number;
};
⋮----
export const useFciNoSignatureFields = (props: Props) =>
</file>

<file path="apps/main-app/ts/features/fci/hooks/useFciSignatureFieldInfo.tsx">
import { Body } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
⋮----
export const useFciSignatureFieldInfo = () =>
</file>

<file path="apps/main-app/ts/features/fci/navigation/FciStackNavigator.tsx">
import { PathConfigMap } from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { AppParamsList } from "../../../navigation/params/AppParamsList";
import { isGestureEnabled } from "../../../utils/navigation";
import FciDocumentUnavailableScreen from "../screens/failure/FciDocumentUnavailableScreen";
import FciQtspErrorScreen from "../screens/failure/FciQtspErrorScreen";
import FciRouterScreen from "../screens/FciRouterScreen";
import { FciLoginL3Screen } from "../screens/loginL3/FciLoginL3Screen";
import { FciNfcNotAvailableScreen } from "../screens/loginL3/FciNfcNotAvailableScreen";
import { LoginOptInScreen } from "../screens/loginL3/LoginOptInScreen";
import FciDataSharingScreen from "../screens/valid/FciDataSharingScreen";
import { FciDocumentPreviewScreen } from "../screens/valid/FciDocumentPreviewScreen";
import FciDocumentsScreen from "../screens/valid/FciDocumentsScreen";
import FciQtspClausesScreen from "../screens/valid/FciQtspClausesScreen";
import FciSignatureFieldsScreen from "../screens/valid/FciSignatureFieldsScreen";
import FciSignatureRequestsScreen from "../screens/valid/FciSignatureRequestsScreen";
import FciThankyouScreen from "../screens/valid/FciThankyouScreen";
import { FciParamsList } from "./params";
import { FCI_ROUTES } from "./routes";
⋮----
export const FciStackNavigator = () => (
  <Stack.Navigator
    initialRouteName={FCI_ROUTES.ROUTER}
    screenOptions={{ gestureEnabled: isGestureEnabled, headerMode: "screen" }}
  >
    <Stack.Screen
      component={FciRouterScreen}
      name={FCI_ROUTES.ROUTER}
      options={{
        headerShown: false
      }}
    />
    <Stack.Screen component={FciDocumentsScreen} name={FCI_ROUTES.DOCUMENTS} />
    <Stack.Screen
      component={FciSignatureFieldsScreen}
      name={FCI_ROUTES.SIGNATURE_FIELDS}
    />
    <Stack.Screen
      component={FciDataSharingScreen}
      name={FCI_ROUTES.USER_DATA_SHARE}
    />
    <Stack.Screen component={FciQtspClausesScreen} name={FCI_ROUTES.QTSP_TOS} />
    <Stack.Screen
      component={FciThankyouScreen}
      name={FCI_ROUTES.TYP}
      options={{
        headerShown: false
      }}
    />
    <Stack.Screen
      component={FciDocumentPreviewScreen}
      name={FCI_ROUTES.DOC_PREVIEW}
    />
    <Stack.Screen
      component={FciSignatureRequestsScreen}
      name={FCI_ROUTES.SIGNATURE_REQUESTS}
    />
    <Stack.Screen
      component={FciDocumentUnavailableScreen}
      name={FCI_ROUTES.DOCUMENT_UNAVAILABLE}
      options={{
        headerShown: false
      }}
    />
    <Stack.Screen
      component={FciQtspErrorScreen}
      name={FCI_ROUTES.QTSP_ERROR}
      options={{ headerShown: false }}
    />
    <Stack.Screen
      component={FciNfcNotAvailableScreen}
      name={FCI_ROUTES.NFC_NOT_AVAILABLE}
      options={{ headerShown: false }}
    />
    <Stack.Screen component={FciLoginL3Screen} name={FCI_ROUTES.FCI_LOGIN_L3} />
    <Stack.Screen component={LoginOptInScreen} name={FCI_ROUTES.LOGIN_OPTIN} />
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/features/fci/navigation/params.ts">
import { FciRouterScreenNavigationParams } from "../screens/FciRouterScreen";
import { FciDocumentPreviewScreenNavigationParams } from "../screens/valid/FciDocumentPreviewScreen";
import { FciDocumentsScreenNavigationParams } from "../screens/valid/FciDocumentsScreen";
import { FciSignatureFieldsScreenNavigationParams } from "../screens/valid/FciSignatureFieldsScreen";
import { FciNetworkError } from "../utils/errors";
import { FCI_ROUTES } from "./routes";
⋮----
export type FciDocumentUnavailableScreenNavigationParams = {
  errorKind?: FciNetworkError["kind"];
};
⋮----
export type FciParamsList = {
  [FCI_ROUTES.DOC_PREVIEW]: FciDocumentPreviewScreenNavigationParams;
  [FCI_ROUTES.DOCUMENT_UNAVAILABLE]: FciDocumentUnavailableScreenNavigationParams;
  [FCI_ROUTES.DOCUMENTS]: FciDocumentsScreenNavigationParams;
  [FCI_ROUTES.FCI_LOGIN_L3]: undefined;
  [FCI_ROUTES.LOGIN_OPTIN]: undefined;
  [FCI_ROUTES.NFC_NOT_AVAILABLE]: undefined;
  [FCI_ROUTES.QTSP_ERROR]: undefined;
  [FCI_ROUTES.QTSP_TOS]: undefined;
  [FCI_ROUTES.ROUTER]: FciRouterScreenNavigationParams;
  [FCI_ROUTES.SIGNATURE_FIELDS]: FciSignatureFieldsScreenNavigationParams;
  [FCI_ROUTES.SIGNATURE_REQUESTS]: undefined;
  [FCI_ROUTES.TYP]: undefined;
  [FCI_ROUTES.USER_DATA_SHARE]: undefined;
};
</file>

<file path="apps/main-app/ts/features/fci/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/fci/saga/networking/handleCreateFilledDocument.ts">
import { FilledDocumentDetailView } from "@io-app/api-types/generated/definitions/fci/FilledDocumentDetailView";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
⋮----
import { SagaIterator } from "redux-saga";
import {
  call,
  cancelled,
  delay,
  put,
  race,
  select,
  take
} from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { FciClient } from "../../api/backendFci";
import {
  fciLoadQtspFilledDocument,
  fciPollFilledDocument
} from "../../store/actions";
import { fciPollFilledDocumentSettledSelector } from "../../store/reducers/fciPollFilledDocument";
</file>

<file path="apps/main-app/ts/features/fci/saga/networking/handleCreateSignature.ts">
import { LollipopMethodEnum } from "@io-app/api-types/generated/definitions/fci/LollipopMethod";
import { LollipopOriginalURL } from "@io-app/api-types/generated/definitions/fci/LollipopOriginalURL";
import { LollipopSignature } from "@io-app/api-types/generated/definitions/fci/LollipopSignature";
import { LollipopSignatureInput } from "@io-app/api-types/generated/definitions/fci/LollipopSignatureInput";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { SagaIterator } from "redux-saga";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { LollipopConfig } from "../../../lollipop";
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { createFciClientWithLollipop } from "../../api/backendFci";
import { fciSigningRequest } from "../../store/actions";
import { fciQtspFilledDocumentUrlSelector } from "../../store/reducers/fciQtspFilledDocument";
import { fciDocumentsWithUrlSelector } from "../../store/reducers/fciSignatureRequest";
import { getCustomSignature, getTosSignature } from "../../utils/signature";
⋮----
// To avoid a type error on createSignature TypeCallApi
// we need to initializa the following values to the correct type
// and the correct values will be setted by the client
// using custom fetchApi (lollipopFetch)
</file>

<file path="apps/main-app/ts/features/fci/saga/networking/handleDownloadDocument.ts">
import { Paths } from "expo-file-system";
import ReactNativeBlobUtil from "react-native-blob-util";
import { call, cancelled, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { fetchTimeout } from "../../../../config";
import { getNetworkError } from "../../../../utils/errors";
import { getFileNameFromUrl } from "../../components/DocumentViewer";
import { fciDownloadPreview } from "../../store/actions";
⋮----
export const savePath = (url: string)
</file>

<file path="apps/main-app/ts/features/fci/saga/networking/handleGetMetadata.ts">
import { SagaIterator } from "redux-saga";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { FciClient } from "../../api/backendFci";
import { fciMetadataRequest } from "../../store/actions";
</file>

<file path="apps/main-app/ts/features/fci/saga/networking/handleGetQtspMetadata.ts">
import { SagaIterator } from "redux-saga";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { FciClient } from "../../api/backendFci";
import { fciLoadQtspClauses } from "../../store/actions";
import { fciIssuerEnvironmentSelector } from "../../store/reducers/fciSignatureRequest";
</file>

<file path="apps/main-app/ts/features/fci/saga/networking/handleGetSignatureRequestById.ts">
import { Environment } from "@io-app/api-types/generated/definitions/fci/Environment";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { SagaIterator } from "redux-saga";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { FciClient } from "../../api/backendFci";
import {
  fciEnvironmentSet,
  fciSignatureRequestFromId
} from "../../store/actions";
import { FciHeaders } from "../../utils/fciHeaders";
</file>

<file path="apps/main-app/ts/features/fci/saga/networking/handleGetSignatureRequests.ts">
import { SagaIterator } from "redux-saga";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { FciClient } from "../../api/backendFci";
import { fciSignaturesListRequest } from "../../store/actions";
</file>

<file path="apps/main-app/ts/features/fci/saga/handleDrawSignatureBox.ts">
import { SagaIterator } from "redux-saga";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getError } from "../../../utils/errors";
import { fciDocumentSignatureFields } from "../store/actions";
import { fciSignatureFieldDrawingSelector } from "../store/reducers/fciSignatureFieldDrawing";
import { drawSignatureField, parsePdfAsBase64 } from "../utils/signatureFields";
</file>

<file path="apps/main-app/ts/features/fci/saga/index.ts">
import { CreateSignatureBody } from "@io-app/api-types/generated/definitions/fci/CreateSignatureBody";
⋮----
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { CommonActions, StackActions } from "@react-navigation/native";
import { Directory, File } from "expo-file-system";
import I18n from "i18next";
import { SagaIterator } from "redux-saga";
import {
  call,
  delay,
  put,
  select,
  take,
  takeLatest
} from "typed-redux-saga/macro";
import { ActionType, isActionOf } from "typesafe-actions";
⋮----
import { apiUrlPrefix } from "../../../config";
import NavigationService from "../../../navigation/NavigationService";
import ROUTES from "../../../navigation/routes";
import { appCurrentStateSelector } from "../../../store/reducers/appState";
import { isTestEnv } from "../../../utils/environment";
import { setActiveSessionLoginFlow } from "../../authentication/activeSessionLogin/store/actions";
import { activeSessionLoginFlowSelector } from "../../authentication/activeSessionLogin/store/selectors";
import { spidLevelFromSessionInfoSelector } from "../../authentication/common/store/selectors";
import {
  identificationPinReset,
  identificationRequest,
  identificationSuccess
} from "../../identification/store/actions";
import { KeyInfo } from "../../lollipop/utils/crypto";
import { toFileUri } from "../../messages/utils/attachments";
import { createFciClient } from "../api/backendFci";
import { FCI_ROUTES } from "../navigation/routes";
import {
  fciClearAllFiles,
  fciClearStateRequest,
  fciDocumentSignatureFields,
  fciDownloadPreview,
  fciDownloadPreviewClear,
  fciEndRequest,
  fciLoadQtspClauses,
  fciLoadQtspFilledDocument,
  fciMetadataRequest,
  fciSignatureRequestFromId,
  fciSignatureRequestRetryFromId,
  fciSignaturesListRequest,
  fciSigningRequest,
  fciStartRequest,
  fciStartSigningRequest
} from "../store/actions";
import { fciDocumentSignaturesSelector } from "../store/reducers/fciDocumentSignatures";
import {
  fciQtspClausesMetadataSelector,
  FciQtspClausesState,
  fciQtspNonceSelector
} from "../store/reducers/fciQtspClauses";
import { fciQtspFilledDocumentUrlSelector } from "../store/reducers/fciQtspFilledDocument";
import {
  fciSignatureRequestIdSelector,
  fciSignatureRequestSelector,
  FciSignatureRequestState
} from "../store/reducers/fciSignatureRequest";
import { isFciSecurityLevelCheckRemoteFFEnabledSelector } from "../store/selectors/remoteConfig";
import { handleDrawSignatureBox } from "./handleDrawSignatureBox";
import { handleCreateFilledDocument } from "./networking/handleCreateFilledDocument";
import { handleCreateSignature } from "./networking/handleCreateSignature";
import {
  FciDownloadPreviewDirectoryPath,
  handleDownloadDocument
} from "./networking/handleDownloadDocument";
import { handleGetMetadata } from "./networking/handleGetMetadata";
import { handleGetQtspMetadata } from "./networking/handleGetQtspMetadata";
import { handleGetSignatureRequestById } from "./networking/handleGetSignatureRequestById";
import { handleGetSignatureRequests } from "./networking/handleGetSignatureRequests";
</file>

<file path="apps/main-app/ts/features/fci/screens/failure/FciDocumentUnavailableScreen.tsx">
import { RouteProp, useRoute } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender.ts";
import {
  trackFciDocOpeningFailure,
  trackFciDocOpeningFailureAction
} from "../../analytics";
import { FciParamsList } from "../../navigation/params";
import { FCI_ROUTES } from "../../navigation/routes";
import {
  fciEndRequest,
  fciSignatureRequestRetryFromId
} from "../../store/actions";
import { fciSignatureRequestIdSelector } from "../../store/reducers/fciSignatureRequest.ts";
⋮----
const FciDocumentUnavailableScreen = () =>
⋮----
type OperationResultButtons = Pick<
    OperationResultScreenContentProps,
    "action" | "secondaryAction"
  >;
⋮----
const operationResultActions = (): OperationResultButtons =>
⋮----
</file>

<file path="apps/main-app/ts/features/fci/screens/failure/FciQtspErrorScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender.ts";
import {
  trackFciPollingFailureAction,
  trackFciPollingFailureScreenView
} from "../../analytics";
import {
  fciEndRequest,
  fciSignatureRequestRetryFromId
} from "../../store/actions";
import { fciSignatureRequestIdSelector } from "../../store/reducers/fciSignatureRequest.ts";
import { fciQtspErrorKindSelector } from "../../store/selectors/fciErrors";
⋮----
const FciQtspErrorScreen = () =>
⋮----
const operationResultActions = () => (
</file>

<file path="apps/main-app/ts/features/fci/screens/loginL3/FciLoginL3Screen.tsx">
import { Body, HeaderSecondLevel } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { WhatsNewScreenContent } from "../../../../components/screens/WhatsNewScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender.ts";
import {
  setActiveSessionLoginFlow,
  setFinishedActiveSessionLoginFlow,
  setIdpSelectedActiveSessionLogin,
  setStartActiveSessionLogin
} from "../../../authentication/activeSessionLogin/store/actions";
import { AUTHENTICATION_ROUTES } from "../../../authentication/common/navigation/routes.ts";
import { fastLoginOptInFFEnabled } from "../../../authentication/fastLogin/store/selectors/index.ts";
import { IdpCIE } from "../../../authentication/login/hooks/useNavigateToLoginMethod";
import { useIsNfcFeatureAvailable } from "../../../pn/aar/hooks/useIsNfcFeatureAvailable";
import { SETTINGS_ROUTES } from "../../../settings/common/navigation/routes.ts";
import {
  trackFciLoginRequest,
  trackFciLoginRequestClose,
  trackFciLoginRequestContinue
} from "../../analytics";
import { FCI_ROUTES } from "../../navigation/routes";
import { fciEndRequest } from "../../store/actions";
⋮----
const onPressContinue = () =>
</file>

<file path="apps/main-app/ts/features/fci/screens/loginL3/FciNfcNotAvailableScreen.tsx">
import { FeatureInfo, IODimensions, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { IOScrollViewCentredContent } from "../../../../components/ui/IOScrollViewCentredContent";
import { useIODispatch } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender.ts";
import {
  trackFciNfcNotSupported,
  trackFciNfcNotSupportedClose
} from "../../analytics";
import { fciEndRequest } from "../../store/actions";
</file>

<file path="apps/main-app/ts/features/fci/screens/loginL3/LoginOptInScreen.tsx">
import { Body, FeatureInfo, IOToast, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { WhatsNewScreenContent } from "../../../../components/screens/WhatsNewScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOStore } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender.ts";
import { openWebUrl } from "../../../../utils/url";
import { setFastLoginOptSessionLogin } from "../../../authentication/activeSessionLogin/store/actions";
import { AUTHENTICATION_ROUTES } from "../../../authentication/common/navigation/routes";
import {
  trackLoginSessionOptIn,
  trackLoginSessionOptIn30,
  trackLoginSessionOptIn365,
  trackLoginSessionOptInInfo
} from "../../../authentication/fastLogin/analytics/optinAnalytics.ts";
import { SETTINGS_ROUTES } from "../../../settings/common/navigation/routes";
⋮----
body=
⋮----
const navigateToLoginPage = (isLV: boolean) =>
⋮----
trackLoginSessionOptInInfo("FCI_auth");
presentFciSecurityBottomSheet();
</file>

<file path="apps/main-app/ts/features/fci/screens/valid/FciDataSharingScreen.tsx">
import { Banner, Divider, ListItemInfo, VStack } from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { ComponentProps, ReactElement } from "react";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { formatFiscalCodeBirthdayAsShortFormat } from "../../../../utils/dates";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { capitalize } from "../../../../utils/strings";
import { SETTINGS_ROUTES } from "../../../settings/common/navigation/routes";
import {
  profileEmailSelector,
  profileFiscalCodeSelector,
  profileNameSelector,
  profileSelector
} from "../../../settings/common/store/selectors";
import {
  trackFciChangeEmail,
  trackFciUserDataConfirmed,
  trackFciUserDataShare
} from "../../analytics";
import { useFciAbortSignatureFlow } from "../../hooks/useFciAbortSignatureFlow";
import { FCI_ROUTES } from "../../navigation/routes";
import { fciEnvironmentSelector } from "../../store/reducers/fciEnvironment";
</file>

<file path="apps/main-app/ts/features/fci/screens/valid/FciDocumentPreviewScreen.tsx">
import I18n from "i18next";
import { ReactElement, useEffect, useState } from "react";
⋮----
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton.ts";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  trackFciTosDocPreview,
  trackFciTosDocPreviewFailure,
  trackFciTosDocPreviewFailureAction
} from "../../analytics";
import { DocumentViewer } from "../../components/DocumentViewer";
import SignatureStatusComponent from "../../components/SignatureStatusComponent";
import { FciParamsList } from "../../navigation/params";
import { fciDownloadPreviewClear, fciEndRequest } from "../../store/actions";
import { fciDownloadPathSelector } from "../../store/reducers/fciDownloadPreview";
⋮----
export type FciDocumentPreviewScreenNavigationParams = Readonly<{
  documentUrl: string;
}>;
⋮----
trackFciTosDocPreviewFailureAction(
            "custom_1",
            I18n.t("features.fci.errors.buttons.close")
          );
dispatch(fciEndRequest());
⋮----
</file>

<file path="apps/main-app/ts/features/fci/screens/valid/FciDocumentsScreen.tsx">
import { TypeEnum as ClauseType } from "@io-app/api-types/generated/definitions/fci/Clause";
import { DocumentToSign } from "@io-app/api-types/generated/definitions/fci/DocumentToSign";
import {
  FooterActionsInline,
  IOColors,
  IODimensions,
  useFooterActionsInlineMeasurements
} from "@io-app/design-system";
⋮----
import {
  RouteProp,
  StackActions,
  useIsFocused,
  useRoute
} from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { ComponentProps, useEffect, useRef, useState } from "react";
import { StyleSheet, View } from "react-native";
import Pdf, { PdfRef } from "react-native-pdf";
⋮----
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList.ts";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import {
  trackFciDocOpeningSuccess,
  trackFciDocumentsView,
  trackFciSigningDoc
} from "../../analytics";
import DocumentsNavigationBar from "../../components/DocumentsNavigationBar";
import LoadingComponent from "../../components/LoadingComponent";
import { useFciAbortSignatureFlow } from "../../hooks/useFciAbortSignatureFlow";
import { useFciNoSignatureFields } from "../../hooks/useFciNoSignatureFields";
import { FciParamsList } from "../../navigation/params";
import { FCI_ROUTES } from "../../navigation/routes";
import {
  fciDownloadPreview,
  fciUpdateDocumentSignaturesRequest
} from "../../store/actions";
import { fciDocumentSignaturesSelector } from "../../store/reducers/fciDocumentSignatures";
import {
  fciDownloadPathSelector,
  fciDownloadPreviewSelector
} from "../../store/reducers/fciDownloadPreview";
import { fciEnvironmentSelector } from "../../store/reducers/fciEnvironment";
import {
  fciSignatureDetailDocumentsSelector,
  fciSignatureRequestSelector
} from "../../store/reducers/fciSignatureRequest";
import {
  getOptionalSignatureFields,
  getRequiredSignatureFields,
  getSignatureFieldsLength
} from "../../utils/signatureFields";
⋮----
export type FciDocumentsScreenNavigationParams = Readonly<{
  currentDoc: number;
}>;
⋮----
const onContinuePress = () =>
⋮----
const onCancelPress = ()
⋮----
const pointToPage = (page: number)
⋮----
const renderPager = () => (
    <Pdf
      enablePaging
      key={`${
        documents[currentDoc]?.id ?? "doc"
      }:${downloadPath}:${focusEpoch}`}
      onError={_ => setHasDocumentLoadError(true)}
onLoadComplete=
⋮----
const onNext = () =>
⋮----
titleLeft=
⋮----
</file>

<file path="apps/main-app/ts/features/fci/screens/valid/FciQtspClausesScreen.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { Divider, IODimensions, VSpacer } from "@io-app/design-system";
⋮----
import { StackActions } from "@react-navigation/native";
import I18n from "i18next";
import { ComponentProps, useEffect, useState } from "react";
import { FlatList } from "react-native";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { loadServicePreference } from "../../../services/details/store/actions/preference";
import { servicePreferencePotByIdSelector } from "../../../services/details/store/selectors";
import { isServicePreferenceResponseSuccess } from "../../../services/details/types/ServicePreferenceResponse";
import { trackFciQtspTos, trackFciUxConversion } from "../../analytics";
import LinkedText from "../../components/LinkedText";
import LoadingComponent from "../../components/LoadingComponent";
import QtspClauseListItem from "../../components/QtspClauseListItem";
import { useFciAbortSignatureFlow } from "../../hooks/useFciAbortSignatureFlow";
import { useFciCheckService } from "../../hooks/useFciCheckService";
import { FCI_ROUTES } from "../../navigation/routes";
import { fciStartSigningRequest } from "../../store/actions";
import { fciEnvironmentSelector } from "../../store/reducers/fciEnvironment";
import { fciMetadataServiceIdSelector } from "../../store/reducers/fciMetadata";
import { fciPollFilledDocumentReadySelector } from "../../store/reducers/fciPollFilledDocument";
import {
  fciQtspClausesSelector,
  fciQtspPrivacyTextSelector,
  fciQtspPrivacyUrlSelector
} from "../../store/reducers/fciQtspClauses";
import { fciQtspErrorKindSelector } from "../../store/selectors/fciErrors";
⋮----
const openUrl = (url: string) =>
⋮----
</file>

<file path="apps/main-app/ts/features/fci/screens/valid/FciSignatureFieldsScreen.tsx">
import {
  Clause,
  TypeEnum as ClausesTypeEnum
} from "@io-app/api-types/generated/definitions/fci/Clause";
import { DocumentDetailView } from "@io-app/api-types/generated/definitions/fci/DocumentDetailView";
import { DocumentToSign } from "@io-app/api-types/generated/definitions/fci/DocumentToSign";
import { SignatureField } from "@io-app/api-types/generated/definitions/fci/SignatureField";
import {
  Divider,
  FooterActions,
  H2,
  IODimensions,
  ListItemHeader,
  useFooterActionsMeasurements,
  VSpacer
} from "@io-app/design-system";
import { Route, StackActions, useRoute } from "@react-navigation/native";
import { constFalse, increment, pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { isEqual } from "lodash";
import {
  ComponentProps,
  useCallback,
  useContext,
  useEffect,
  useMemo,
  useState
} from "react";
import { SectionList, View } from "react-native";
⋮----
import { LightModalContext } from "../../../../components/ui/LightModal";
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton.ts";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import {
  trackFciShowSignatureFields,
  trackFciSignatureFieldsView,
  trackFciStartSignature
} from "../../analytics";
import DocumentWithSignature from "../../components/DocumentWithSignature";
import SignatureFieldItem from "../../components/SignatureFieldItem";
import SignatureStatusComponent from "../../components/SignatureStatusComponent";
import { useFciAbortSignatureFlow } from "../../hooks/useFciAbortSignatureFlow";
import { useFciSignatureFieldInfo } from "../../hooks/useFciSignatureFieldInfo";
import { FCI_ROUTES } from "../../navigation/routes";
import {
  fciEndRequest,
  fciUpdateDocumentSignaturesRequest
} from "../../store/actions";
import { fciDocumentSignaturesSelector } from "../../store/reducers/fciDocumentSignatures";
import { fciEnvironmentSelector } from "../../store/reducers/fciEnvironment";
import {
  fciDocumentSignatureFieldsSelector,
  fciSignatureDetailDocumentsSelector
} from "../../store/reducers/fciSignatureRequest";
import {
  getClauseLabel,
  getRequiredSignatureFields,
  getSectionListData,
  orderSignatureFields
} from "../../utils/signatureFields";
⋮----
export type FciSignatureFieldsScreenNavigationParams = Readonly<{
  currentDoc: number;
  documentId: DocumentDetailView["id"];
}>;
⋮----
const onPressDetail = (signatureField: SignatureField) =>
⋮----
const onError = () =>
⋮----
const updateDocumentSignatures = (fn: (doc: DocumentToSign)
⋮----
const onChange = (value: boolean, item: SignatureField)
⋮----
keyExtractor=
⋮----
onPress=
⋮----
subTitle=
</file>

<file path="apps/main-app/ts/features/fci/screens/valid/FciSignatureRequestsScreen.tsx">
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
import { SignatureRequestListView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestListView";
import { H2, IODimensions } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
import { ScrollView, SectionList } from "react-native";
⋮----
import { useAppRequiredUpdate } from "../../../../components/helpers/withAppRequiredUpdate";
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { UpdateAppAlert } from "../../../../components/UpdateAppAlert";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  addTicketCustomField,
  assistanceToolRemoteConfig,
  defaultZendeskBonusesCategory,
  resetCustomFields,
  zendeskBonusAndInitiativeCategoryId,
  zendeskCategoryId,
  zendeskFCICategory,
  zendeskFciId
} from "../../../../utils/supportAssistance";
import {
  zendeskSelectedCategory,
  zendeskSelectedSubcategory,
  zendeskSupportStart
} from "../../../zendesk/store/actions";
import { trackFciAppUpdateRequested } from "../../analytics";
import SignatureRequestItem from "../../components/SignatureRequestItem";
import { fciSignaturesListRequest } from "../../store/actions";
import { fciSignaturesListSelector } from "../../store/reducers/fciSignaturesList";
⋮----
const zendeskAssistanceLogAndStart = (
    signatureRequestId: SignatureRequestListView["id"]
) =>
⋮----
const handleAskAssistance = (
    signatureRequestId: SignatureRequestListView["id"]
) =>
⋮----
</file>

<file path="apps/main-app/ts/features/fci/screens/valid/FciThankyouScreen.tsx">
import { TypeEnum as ClauseTypeEnum } from "@io-app/api-types/generated/definitions/fci/Clause";
⋮----
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { getNetworkErrorMessage, NetworkError } from "../../../../utils/errors";
import {
  trackFciDocSignatureFailure,
  trackFciDocSignatureFailureAction,
  trackFciUxSuccess
} from "../../analytics";
import LoadingComponent from "../../components/LoadingComponent";
import SignatureStatusComponent from "../../components/SignatureStatusComponent";
import {
  fciEndRequest,
  fciSignatureRequestRetryFromId
} from "../../store/actions";
import { fciDocumentSignaturesSelector } from "../../store/reducers/fciDocumentSignatures";
import { fciEnvironmentSelector } from "../../store/reducers/fciEnvironment";
import { fciSignatureSelector } from "../../store/reducers/fciSignature";
import { fciSignatureRequestIdSelector } from "../../store/reducers/fciSignatureRequest";
import { getClausesCountByTypes } from "../../utils/signatureFields";
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/fci/screens/FciRouterScreen.tsx">
import { ProblemJson } from "@io-app/api-types/generated/definitions/fci/ProblemJson";
import { SignatureRequestDetailView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestDetailView";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { ReactElement, useEffect } from "react";
⋮----
import { useAppRequiredUpdate } from "../../../components/helpers/withAppRequiredUpdate";
import { UpdateAppAlert } from "../../../components/UpdateAppAlert";
import { IOStackNavigationRouteProps } from "../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import {
  getErrorFromNetworkError,
  getGenericError,
  NetworkError
} from "../../../utils/errors";
import {
  trackFciAppUpdateRequested,
  trackFciSignatureDetailFailureAction,
  trackFciSignatureGenericFailure,
  trackFciSignatureMismatch
} from "../analytics";
import LoadingComponent from "../components/LoadingComponent";
import {
  default as ErrorComponent,
  default as SignatureStatusComponent
} from "../components/SignatureStatusComponent";
import SuccessComponent from "../components/SuccessComponent";
import { FciParamsList } from "../navigation/params";
import { fciEndRequest, fciSignatureRequestFromId } from "../store/actions";
import { fciSignatureRequestSelector } from "../store/reducers/fciSignatureRequest";
⋮----
export type FciRouterScreenNavigationParams = Readonly<{
  signatureRequestId: SignatureRequestDetailView["id"];
}>;
⋮----
onPress=
⋮----
trackFciSignatureDetailFailureAction(
            errorReason,
            "custom_1",
            I18n.t("features.fci.errors.buttons.close")
          );
dispatch(fciEndRequest());
⋮----
trackFciSignatureDetailFailureAction(
            errorReason,
            "custom_2",
            I18n.t("features.fci.errors.buttons.assistance")
          );
</file>

<file path="apps/main-app/ts/features/fci/store/actions/index.ts">
import { CreateFilledDocument } from "@io-app/api-types/generated/definitions/fci/CreateFilledDocument";
import { CreateSignatureBody } from "@io-app/api-types/generated/definitions/fci/CreateSignatureBody";
import { DocumentToSign } from "@io-app/api-types/generated/definitions/fci/DocumentToSign";
import { EnvironmentEnum } from "@io-app/api-types/generated/definitions/fci/Environment";
import { FilledDocumentDetailView } from "@io-app/api-types/generated/definitions/fci/FilledDocumentDetailView";
import { Metadata } from "@io-app/api-types/generated/definitions/fci/Metadata";
import { QtspClausesMetadataDetailView } from "@io-app/api-types/generated/definitions/fci/QtspClausesMetadataDetailView";
import { SignatureDetailView } from "@io-app/api-types/generated/definitions/fci/SignatureDetailView";
import { SignatureRequestDetailView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestDetailView";
import { SignatureRequestList } from "@io-app/api-types/generated/definitions/fci/SignatureRequestList";
⋮----
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../utils/errors";
import { SignatureFieldAttrType } from "../../components/DocumentWithSignature";
import { FciNetworkError } from "../../utils/errors.ts";
import { Document } from "../reducers/fciSignatureFieldDrawing";
⋮----
export type FciActions =
  | ActionType<typeof fciClearAllFiles>
  | ActionType<typeof fciClearStateRequest>
  | ActionType<typeof fciDocumentSignatureFields>
  | ActionType<typeof fciDownloadPreview>
  | ActionType<typeof fciDownloadPreviewClear>
  | ActionType<typeof fciEndRequest>
  | ActionType<typeof fciEnvironmentSet>
  | ActionType<typeof fciLoadQtspClauses>
  | ActionType<typeof fciLoadQtspFilledDocument>
  | ActionType<typeof fciMetadataRequest>
  | ActionType<typeof fciPollFilledDocument>
  | ActionType<typeof fciSignatureRequestFromId>
  | ActionType<typeof fciSignatureRequestRetryFromId>
  | ActionType<typeof fciSignaturesListRequest>
  | ActionType<typeof fciSigningRequest>
  | ActionType<typeof fciStartRequest>
  | ActionType<typeof fciStartSigningRequest>
  | ActionType<typeof fciUpdateDocumentSignaturesRequest>;
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciDocumentSignatures.ts">
import { DocumentToSign } from "@io-app/api-types/generated/definitions/fci/DocumentToSign";
import { pipe } from "fp-ts/lib/function";
⋮----
import { updateAt } from "fp-ts/lib/ReadonlyArray";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import {
  fciClearStateRequest,
  fciUpdateDocumentSignaturesRequest
} from "../actions";
⋮----
export type FciDocumentSignaturesState = {
  documents: ReadonlyArray<DocumentToSign>;
};
⋮----
const reducer = (
  state: FciDocumentSignaturesState = emptyState,
  action: Action
): FciDocumentSignaturesState =>
⋮----
export const fciDocumentSignaturesSelector = (
  state: GlobalState
): FciDocumentSignaturesState["documents"]
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciDownloadPreview.ts">
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { FciNetworkError } from "../../utils/errors.ts";
import { fciClearStateRequest, fciDownloadPreview } from "../actions";
⋮----
export type FciDownloadPreviewState = pot.Pot<FciDownload, FciNetworkError>;
⋮----
type FciDownload = {
  path: string;
};
⋮----
const fciDownloadPreviewReducer = (
  state: FciDownloadPreviewState = initialState,
  action: Action
): FciDownloadPreviewState =>
⋮----
export const fciDownloadPreviewSelector = (
  state: GlobalState
): FciDownloadPreviewState
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciEnvironment.ts">
import { EnvironmentEnum } from "@io-app/api-types/generated/definitions/fci/Environment";
import { pipe } from "fp-ts/lib/function";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { fciClearStateRequest, fciEnvironmentSet } from "../actions";
⋮----
export type FciEnvironmentState = O.Option<EnvironmentEnum>;
⋮----
const fciEnvironmentReducer = (
  state: FciEnvironmentState = initialState,
  action: Action
): FciEnvironmentState =>
⋮----
export const fciEnvironmentSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciMetadata.ts">
import { Metadata } from "@io-app/api-types/generated/definitions/fci/Metadata";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import { fciClearStateRequest, fciMetadataRequest } from "../actions";
⋮----
export type FciMetadataRequestState = pot.Pot<Metadata, NetworkError>;
⋮----
const reducer = (
  state: FciMetadataRequestState = emptyState,
  action: Action
): FciMetadataRequestState =>
⋮----
export const fciMetadataSelector = (
  state: GlobalState
): FciMetadataRequestState
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciPollFilledDocument.ts">
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import { fciClearStateRequest, fciPollFilledDocument } from "../actions";
⋮----
export type FciPollFilledDocumentState = pot.Pot<
  { isReady: boolean },
  NetworkError
>;
⋮----
const reducer = (
  state: FciPollFilledDocumentState = initialState,
  action: Action
): FciPollFilledDocumentState =>
⋮----
export const fciPollFilledDocumentSelector = (
  state: GlobalState
): FciPollFilledDocumentState
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciQtspClauses.ts">
import { QtspClausesMetadataDetailView } from "@io-app/api-types/generated/definitions/fci/QtspClausesMetadataDetailView";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import { fciClearStateRequest, fciLoadQtspClauses } from "../actions";
⋮----
export type FciQtspClausesState = pot.Pot<
  QtspClausesMetadataDetailView,
  NetworkError
>;
⋮----
const reducer = (
  state: FciQtspClausesState = emptyState,
  action: Action
): FciQtspClausesState =>
⋮----
export const fciQtspClausesMetadataSelector = (
  state: GlobalState
): FciQtspClausesState
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciQtspFilledDocument.ts">
import { FilledDocumentDetailView } from "@io-app/api-types/generated/definitions/fci/FilledDocumentDetailView";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import { fciClearStateRequest, fciLoadQtspFilledDocument } from "../actions";
⋮----
export type FciQtspFilledDocumentState = pot.Pot<
  FilledDocumentDetailView,
  NetworkError
>;
⋮----
const reducer = (
  state: FciQtspFilledDocumentState = emptyState,
  action: Action
): FciQtspFilledDocumentState =>
⋮----
export const fciQtspFilledDocumentSelector = (
  state: GlobalState
): FciQtspFilledDocumentState
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciSignature.ts">
import { SignatureDetailView } from "@io-app/api-types/generated/definitions/fci/SignatureDetailView";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import { fciClearStateRequest, fciSigningRequest } from "../actions";
⋮----
export type FciSignatureState = pot.Pot<SignatureDetailView, NetworkError>;
⋮----
const reducer = (
  state: FciSignatureState = emptyState,
  action: Action
): FciSignatureState =>
⋮----
export const fciSignatureSelector = (state: GlobalState): FciSignatureState
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciSignatureFieldDrawing.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { fciDocumentSignatureFields } from "../actions";
⋮----
export type Document = {
  drawnBase64: string;
  rawBase64: string;
  signaturePage: number;
  uri: string;
};
⋮----
export type FciSignatureFieldDrawingState = pot.Pot<Document, Error>;
⋮----
const fciSignatureFieldDrawingReducer = (
  state: FciSignatureFieldDrawingState = emptyState,
  action: Action
): FciSignatureFieldDrawingState =>
⋮----
export const fciSignatureFieldDrawingSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciSignatureRequest.ts">
import { DocumentDetailView } from "@io-app/api-types/generated/definitions/fci/DocumentDetailView";
import { DocumentToSign } from "@io-app/api-types/generated/definitions/fci/DocumentToSign";
import { IssuerEnvironmentEnum } from "@io-app/api-types/generated/definitions/fci/IssuerEnvironment";
import { SignatureRequestDetailView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestDetailView";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import { QtspDocumentToSign } from "../../utils/signature";
import { fciClearStateRequest, fciSignatureRequestFromId } from "../actions";
⋮----
export type FciSignatureRequestState = pot.Pot<
  SignatureRequestDetailView,
  NetworkError
>;
⋮----
const reducer = (
  state: FciSignatureRequestState = emptyState,
  action: Action
): FciSignatureRequestState =>
⋮----
export const fciSignatureRequestSelector = (
  state: GlobalState
): FciSignatureRequestState
⋮----
export const fciDocumentSignatureFieldsSelector = (
  documentId: DocumentDetailView["id"]
)
⋮----
export const fciDocumentsWithUrlSelector = (
  documents: ReadonlyArray<DocumentToSign>
)
⋮----
export const fciSignatureRequestDossierTitleSelector = (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/fciSignaturesList.ts">
import { SignatureRequestList } from "@io-app/api-types/generated/definitions/fci/SignatureRequestList";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import { fciClearStateRequest, fciSignaturesListRequest } from "../actions";
⋮----
export type FciSignaturesListRequestState = pot.Pot<
  SignatureRequestList,
  NetworkError
>;
⋮----
const reducer = (
  state: FciSignaturesListRequestState = emptyState,
  action: Action
): FciSignaturesListRequestState =>
⋮----
export const fciSignaturesListRequestSelector = (
  state: GlobalState
): FciSignaturesListRequestState
</file>

<file path="apps/main-app/ts/features/fci/store/reducers/index.ts">
import { combineReducers } from "redux";
⋮----
import { Action } from "../../../../store/actions/types";
import fciDocumentSignaturesReducer, {
  FciDocumentSignaturesState
} from "./fciDocumentSignatures";
import fciDownloadPreviewReducer, {
  FciDownloadPreviewState
} from "./fciDownloadPreview";
import fciEnvironmentReducer, { FciEnvironmentState } from "./fciEnvironment";
import fciMetadataReducer, { FciMetadataRequestState } from "./fciMetadata";
import fciPollFilledDocumentReducer, {
  FciPollFilledDocumentState
} from "./fciPollFilledDocument";
import fciQtspClausesReducer, { FciQtspClausesState } from "./fciQtspClauses";
import fciLoadQtspFilledDocumentReducer, {
  FciQtspFilledDocumentState
} from "./fciQtspFilledDocument";
import fciSignatureReducer, { FciSignatureState } from "./fciSignature";
import fciSignatureFieldDrawingReducer, {
  FciSignatureFieldDrawingState
} from "./fciSignatureFieldDrawing";
import fciSignatureRequestReducer, {
  FciSignatureRequestState
} from "./fciSignatureRequest";
import fciSignaturesListRequestReducer, {
  FciSignaturesListRequestState
} from "./fciSignaturesList";
⋮----
export type FciState = {
  documentPreview: FciDownloadPreviewState;
  documentSignatures: FciDocumentSignaturesState;
  environment: FciEnvironmentState;
  metadata: FciMetadataRequestState;
  pollFilledDocument: FciPollFilledDocumentState;
  qstpFilledDocument: FciQtspFilledDocumentState;
  qtspClauses: FciQtspClausesState;
  signature: FciSignatureState;
  signatureFieldDrawing: FciSignatureFieldDrawingState;
  signatureRequest: FciSignatureRequestState;
  signaturesList: FciSignaturesListRequestState;
};
</file>

<file path="apps/main-app/ts/features/fci/store/selectors/fciErrors.ts">
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import {
  fciLoadQtspClauses,
  fciLoadQtspFilledDocument,
  fciPollFilledDocument
} from "../actions";
import { fciPollFilledDocumentSelector } from "../reducers/fciPollFilledDocument";
import { fciQtspClausesMetadataSelector } from "../reducers/fciQtspClauses";
import { fciQtspFilledDocumentSelector } from "../reducers/fciQtspFilledDocument";
⋮----
export type FciQtspErrorKind =
  (typeof FCI_QTSP_ERROR_KIND)[keyof typeof FCI_QTSP_ERROR_KIND];
</file>

<file path="apps/main-app/ts/features/fci/store/selectors/remoteConfig.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
⋮----
import { isMinAppVersionSupported } from "../../../../store/reducers/featureFlagWithMinAppVersionStatus.ts";
import { GlobalState } from "../../../../store/reducers/types.ts";
⋮----
const fciRemoteConfigSelector = (state: GlobalState)
⋮----
export const isFciSecurityLevelCheckRemoteFFEnabledSelector = (
  state: GlobalState
)
</file>

<file path="apps/main-app/ts/features/fci/types/__mocks__/CreateFilledDocumentBody.mock.ts">
import { CreateFilledDocument } from "@io-app/api-types/generated/definitions/fci/CreateFilledDocument";
import { FilledDocumentDetailView } from "@io-app/api-types/generated/definitions/fci/FilledDocumentDetailView";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
</file>

<file path="apps/main-app/ts/features/fci/types/__mocks__/CreateSignatureBody.mock.ts">
import { CreateSignatureBody } from "@io-app/api-types/generated/definitions/fci/CreateSignatureBody";
import { DocumentToSign } from "@io-app/api-types/generated/definitions/fci/DocumentToSign";
import { QtspClauses } from "@io-app/api-types/generated/definitions/fci/QtspClauses";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { mockQtspClausesMetadata } from "./QtspClausesMetadata.mock";
import { mockDocuments } from "./SignatureRequestDetailView.mock";
</file>

<file path="apps/main-app/ts/features/fci/types/__mocks__/Metadata.mock.ts">
import { Metadata } from "@io-app/api-types/generated/definitions/fci/Metadata";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
</file>

<file path="apps/main-app/ts/features/fci/types/__mocks__/QtspClausesMetadata.mock.ts">
import { QtspClause } from "@io-app/api-types/generated/definitions/fci/QtspClause";
import { QtspClausesMetadataDetailView } from "@io-app/api-types/generated/definitions/fci/QtspClausesMetadataDetailView";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
</file>

<file path="apps/main-app/ts/features/fci/types/__mocks__/SignatureDetailView.mock.ts">
import {
  SignatureDetailView,
  StatusEnum as SignatureRequestStatus
} from "@io-app/api-types/generated/definitions/fci/SignatureDetailView";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
</file>

<file path="apps/main-app/ts/features/fci/types/__mocks__/SignatureRequestDetailView.mock.ts">
import { TypeEnum as ClausesTypeEnum } from "@io-app/api-types/generated/definitions/fci/Clause";
import { DocumentDetailView } from "@io-app/api-types/generated/definitions/fci/DocumentDetailView";
import { IssuerEnvironmentEnum } from "@io-app/api-types/generated/definitions/fci/IssuerEnvironment";
import { ProblemJson } from "@io-app/api-types/generated/definitions/fci/ProblemJson";
import { SignatureField } from "@io-app/api-types/generated/definitions/fci/SignatureField";
import {
  SignatureRequestDetailView,
  SignatureRequestDetailViewIssuer
} from "@io-app/api-types/generated/definitions/fci/SignatureRequestDetailView";
import { SignatureRequestStatusEnum } from "@io-app/api-types/generated/definitions/fci/SignatureRequestStatus";
import { EmailString, NonEmptyString } from "@pagopa/ts-commons/lib/strings";
</file>

<file path="apps/main-app/ts/features/fci/types/__mocks__/SignaturesList.mock.ts">
import { DossierTitle } from "@io-app/api-types/generated/definitions/fci/DossierTitle";
import { SignatureRequestList } from "@io-app/api-types/generated/definitions/fci/SignatureRequestList";
import { SignatureRequestListView } from "@io-app/api-types/generated/definitions/fci/SignatureRequestListView";
import { SignatureRequestStatusEnum } from "@io-app/api-types/generated/definitions/fci/SignatureRequestStatus";
⋮----
import { getRandomEnumValue } from "./utils";
⋮----
export const createRandomSignatureRequest = (): SignatureRequestListView => (
</file>

<file path="apps/main-app/ts/features/fci/types/__mocks__/utils.ts">
export const getRandomEnumValue = <T extends object>(
  enumObj: T
): T[keyof T] =>
</file>

<file path="apps/main-app/ts/features/fci/utils/dates.ts">
export const daysBetweenDate = (d1: Date, d2: Date)
</file>

<file path="apps/main-app/ts/features/fci/utils/errors.ts">
import { GenericError, TimeoutError } from "../../../utils/errors.ts";
⋮----
export type FciNetworkError = ExpiredError | GenericError | TimeoutError;
type ExpiredError = { readonly kind: "expired" };
</file>

<file path="apps/main-app/ts/features/fci/utils/fciHeaders.ts">
export type FciHeaders = t.TypeOf<typeof FciHeaders>;
</file>

<file path="apps/main-app/ts/features/fci/utils/signature.ts">
import { DocumentToSign } from "@io-app/api-types/generated/definitions/fci/DocumentToSign";
import { QtspClauses } from "@io-app/api-types/generated/definitions/fci/QtspClauses";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import ReactNativeBlobUtil from "react-native-blob-util";
import sha from "sha.js";
⋮----
import { constants } from "../../lollipop/httpSignature/constants";
import { savePath } from "../saga/networking/handleDownloadDocument";
⋮----
export type QtspDocumentToSign = DocumentToSign &
  t.TypeOf<typeof QtspDocumentToSign>;
⋮----
const getFileDigest = (url: string)
⋮----
export const getTosSignature = (qtspClauses: QtspClauses)
⋮----
export const getCustomSignature = (
  documentsToSign: Array<QtspDocumentToSign>
)
</file>

<file path="apps/main-app/ts/features/fci/utils/signatureFields.ts">
import { TypeEnum as ClauseTypeEnum } from "@io-app/api-types/generated/definitions/fci/Clause";
import { DocumentDetailView } from "@io-app/api-types/generated/definitions/fci/DocumentDetailView";
import { DocumentToSign } from "@io-app/api-types/generated/definitions/fci/DocumentToSign";
import { ExistingSignatureFieldAttrs } from "@io-app/api-types/generated/definitions/fci/ExistingSignatureFieldAttrs";
import { SignatureField } from "@io-app/api-types/generated/definitions/fci/SignatureField";
import { SignatureFieldToBeCreatedAttrs } from "@io-app/api-types/generated/definitions/fci/SignatureFieldToBeCreatedAttrs";
import { pipe } from "fp-ts/lib/function";
⋮----
import { contramap } from "fp-ts/lib/Ord";
⋮----
import I18n from "i18next";
import { PDFDocument, rgb } from "pdf-lib";
import ReactNativeBlobUtil from "react-native-blob-util";
⋮----
import { SignatureFieldAttrType } from "../components/DocumentWithSignature";
import { savePath } from "../saga/networking/handleDownloadDocument";
⋮----
export const getClauseLabel = (clauseType: ClauseTypeEnum): string =>
⋮----
export type LIST_DATA_TYPE = {
  data: ReadonlyArray<SignatureField>;
  title: string;
};
⋮----
export const getRequiredSignatureFields = (
  signatureFields: ReadonlyArray<SignatureField>
)
⋮----
export const getOptionalSignatureFields = (
  signatureFields: ReadonlyArray<SignatureField>
)
⋮----
export const clausesByType = (
  signatureFields: ReadonlyArray<SignatureField>,
  clauseType: ReadonlyArray<string>
)
⋮----
export const getAllTypes = (signatureFields: ReadonlyArray<SignatureField>)
⋮----
export const getSectionListData = (
  signatureFields: ReadonlyArray<SignatureField>
): ReadonlyArray<LIST_DATA_TYPE>
⋮----
export const orderSignatureFields = (
  signatureFields: ReadonlyArray<SignatureField>
): ReadonlyArray<SignatureField>
⋮----
export const getClausesCountByTypes = (
  documentsToSign: ReadonlyArray<DocumentToSign>,
  clausesType: ReadonlyArray<string>
): number
⋮----
export const getSignatureFieldsLength = (doc: DocumentDetailView)
⋮----
const addBase64PdfUriScheme = (r: string) => `data:application/pdf;base64,$
⋮----
export const parsePdfAsBase64 = async (uri: string) =>
⋮----
const savePdfDocumentoAsBase64 = async (parsedPdf: PDFDocument) =>
⋮----
const drawRectangleOverSignatureFieldById = async (
  bytes: string,
  uniqueName: string
) =>
⋮----
const drawRectangleOverSignatureFieldByCoordinates = async (
  bytes: string,
  attrs: SignatureFieldToBeCreatedAttrs
) =>
⋮----
export const drawSignatureField = async (
  bytes: string,
  attrs: ExistingSignatureFieldAttrs | SignatureFieldToBeCreatedAttrs
) =>
⋮----
export const hasUniqueName = (
  f: SignatureFieldAttrType
): f is ExistingSignatureFieldAttrs
</file>

<file path="apps/main-app/ts/features/fims/common/analytics/index.ts">
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { GlobalState } from "../../../../store/reducers/types";
import { buildEventProperties } from "../../../../utils/analytics";
import { serviceDetailsByIdSelector } from "../../../services/details/store/selectors";
import { fimsCtaTextSelector } from "../../singleSignOn/store/selectors";
⋮----
export const trackAuthenticationStart = (
  serviceId: ServiceId,
  serviceName: string | undefined,
  organizationName: string | undefined,
  organizationFiscalCode: string | undefined,
  ctaLabel: string,
  source: string,
  ephemeralSessionOniOS: boolean
) =>
⋮----
export const trackDataShare = (
  serviceId: ServiceId,
  serviceName: string | undefined,
  organizationName: string | undefined,
  organizationFiscalCode: string | undefined,
  ctaLabel: string | undefined
) =>
⋮----
export const trackDataShareAccepted = (
  serviceId: ServiceId,
  serviceName: string | undefined,
  organizationName: string | undefined,
  organizationFiscalCode: string | undefined,
  ctaLabel: string | undefined
) =>
⋮----
export const trackInAppBrowserOpening = (
  serviceId: ServiceId | undefined,
  serviceName: string | undefined,
  organizationName: string | undefined,
  organizationFiscalCode: string | undefined,
  ctaLabel: string | undefined
) =>
⋮----
export const trackAuthenticationError = (
  serviceId: ServiceId | undefined,
  serviceName: string | undefined,
  organizationName: string | undefined,
  organizationFiscalCode: string | undefined,
  reason: string
) =>
⋮----
export const trackHistoryScreen = () =>
⋮----
export const trackExportHistory = () =>
⋮----
export const trackExportSucceeded = () =>
⋮----
export const trackHistoryFailure = (reason: string) =>
⋮----
export const computeAndTrackDataShare = (
  service: ServiceDetails,
  state: GlobalState
) =>
⋮----
export const computeAndTrackDataShareAccepted = (
  serviceId: ServiceId,
  state: GlobalState
) =>
</file>

<file path="apps/main-app/ts/features/fims/common/components/FimsUpdateAppAlert.tsx">
import { HeaderSecondLevel } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useStartSupportRequest } from "../../../../hooks/useStartSupportRequest";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { openAppStoreUrl } from "../../../../utils/url";
</file>

<file path="apps/main-app/ts/features/fims/common/hooks/__test__/index.test.tsx">
import { FimsServiceConfiguration } from "@io-app/api-types/generated/definitions/content/FimsServiceConfiguration";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { ComponentType } from "react";
import { createStore } from "redux";
⋮----
import {
  FIMSServiceData,
  testable,
  useAutoFetchingServiceByIdPot,
  useFIMSAuthenticationFlow,
  useFIMSFromServiceId,
  useFIMSRemoteServiceConfiguration
} from "..";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../../navigation/params/AppParamsList";
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { GlobalState } from "../../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { MESSAGES_ROUTES } from "../../../../messages/navigation/routes";
import { loadServiceDetail } from "../../../../services/details/store/actions/details";
import { FIMS_ROUTES } from "../../navigation";
⋮----
const renderAutoFetchHook = (
  hookServiceId: ServiceId,
  servicePot: pot.Pot<ServiceDetails, Error>,
  storeServiceId: ServiceId
) =>
⋮----
const renderFromServiceIdHook = (
  hookServiceId: ServiceId,
  servicePot: pot.Pot<ServiceDetails, Error>,
  storeServiceId: ServiceId
) =>
⋮----
const renderFromAuthenticationFlowHook = (
  servicePot: pot.Pot<ServiceDetails, Error>,
  storeServiceId: ServiceId
) =>
⋮----
const renderFromRemoteConfigurationHook = (
  configuration: FimsServiceConfiguration,
  hookConfigurationId: string
) =>
⋮----
const renderFromServiceDataHook = (
  internalServiceData: FIMSServiceData | undefined
) =>
⋮----
const AutoFetchHookWrapper = (serviceId: ServiceId) =>
const FromServiceIdHookWrapper = (serviceId: ServiceId) =>
const AuthenticationFlowHookWrapper = () =>
const FromRemoteConfigurationHookWrapper = (configurationId: string) =>
const FromServiceDataHookWrapper = (
  internalServiceData: FIMSServiceData | undefined
) =>
⋮----
const genericRender = (
  hookWrapper: ComponentType<any>,
  appState: GlobalState
) =>
</file>

<file path="apps/main-app/ts/features/fims/common/hooks/index.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { useCallback, useEffect, useMemo } from "react";
⋮----
import {
  AppParamsList,
  IOStackNavigationProp,
  useIONavigation
} from "../../../../navigation/params/AppParamsList";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import {
  fimsServiceConfiguration,
  fimsServiceIdInCookieDisabledListSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../store/reducers/types";
import { isTestEnv } from "../../../../utils/environment";
import { isStrictNone } from "../../../../utils/pot";
import { loadServiceDetail } from "../../../services/details/store/actions/details";
import {
  serviceDetailsByIdPotSelector,
  serviceDetailsByIdSelector
} from "../../../services/details/store/selectors";
import { removeFIMSPrefixFromUrl } from "../../singleSignOn/utils";
import { FIMS_ROUTES } from "../navigation";
⋮----
export type FIMSServiceData = {
  ephemeralSessionOniOS: boolean;
  organizationFiscalCode?: string;
  organizationName?: string;
  serviceId: ServiceId;
  serviceName?: string;
};
⋮----
export const useAutoFetchingServiceByIdPot = (serviceId: ServiceId) =>
⋮----
export const useFIMSFromServiceId = (serviceId: ServiceId) =>
⋮----
export const useFIMSAuthenticationFlow = () =>
⋮----
export const useFIMSRemoteServiceConfiguration = (configurationId: string) =>
⋮----
const serviceDataFromServiceId = (
  serviceId: ServiceId,
  state: GlobalState
): FIMSServiceData =>
⋮----
const serviceDataFromConfigurationId = (
  configurationId: string,
  state: GlobalState
): FIMSServiceData | undefined =>
⋮----
const useFIMSFromServiceData = (
  serviceData: FIMSServiceData | undefined
): ((label: string, url: string) => void) =>
⋮----
const navigateToFIMSAuthorizationFlow = (
  label: string,
  navigation: IOStackNavigationProp<AppParamsList, keyof AppParamsList>,
  serviceData: FIMSServiceData,
  url: string
): void =>
</file>

<file path="apps/main-app/ts/features/fims/common/navigation/index.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { FimsHistoryScreen } from "../../history/screens/HistoryScreen";
import {
  FimsFlowHandlerScreen,
  FimsFlowHandlerScreenRouteParams
} from "../../singleSignOn/screens/FimsFlowHandlerScreen";
⋮----
export type FimsParamsList = {
  [FIMS_ROUTES.CONSENTS]: FimsFlowHandlerScreenRouteParams;
  [FIMS_ROUTES.HISTORY]: undefined;
  [FIMS_ROUTES.MAIN]: undefined;
};
⋮----
export const FimsNavigator = () => (
  <Stack.Navigator
    initialRouteName={FIMS_ROUTES.CONSENTS}
    screenOptions={{ gestureEnabled: false, headerShown: true }}
  >
    <Stack.Screen
      component={FimsFlowHandlerScreen}
      name={FIMS_ROUTES.CONSENTS}
    />
    <Stack.Screen component={FimsHistoryScreen} name={FIMS_ROUTES.HISTORY} />
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/features/fims/common/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { fork } from "typed-redux-saga/macro";
⋮----
import { watchFimsHistorySaga } from "../../history/saga";
import { watchFimsSSOSaga } from "../../singleSignOn/saga";
</file>

<file path="apps/main-app/ts/features/fims/common/store/actions.ts">
import { FimsHistoryActions } from "../../history/store/actions";
import { FimsSSOActions } from "../../singleSignOn/store/actions";
⋮----
export type FimsActions = FimsHistoryActions | FimsSSOActions;
</file>

<file path="apps/main-app/ts/features/fims/common/store/reducer.ts">
import { combineReducers } from "redux";
⋮----
import fimsHistoryReducer, {
  FimsHistoryState
} from "../../history/store/reducer";
import fimsSSOReducer, {
  FimsSSOState
} from "../../singleSignOn/store/reducers/index";
⋮----
export type FimsState = {
  history: FimsHistoryState;
  sso: FimsSSOState;
};
</file>

<file path="apps/main-app/ts/features/fims/common/utils/index.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { Locales } from "../../../../i18n";
⋮----
export const preferredLanguageToString = (
  preferredLanguageMaybe: O.Option<Locales>
)
</file>

<file path="apps/main-app/ts/features/fims/history/api/client.ts">
import { createClient } from "@io-app/api-types/generated/definitions/fims_history/client";
⋮----
import { defaultRetryingFetch } from "../../../../utils/fetch";
⋮----
export const createFimsClient = (baseUrl: string)
⋮----
export type FimsHistoryClient = ReturnType<typeof createFimsClient>;
</file>

<file path="apps/main-app/ts/features/fims/history/components/__mocks__/FimsHistoryHeaderComponent.tsx">
import { Text } from "react-native";
</file>

<file path="apps/main-app/ts/features/fims/history/components/__mocks__/FimsHistoryListItemPicker.tsx">
import { Text } from "react-native";
⋮----
export const FimsHistoryListItemPicker = () => (
  <Text>TESTING LIST ITEM FROM PICKER</Text>
);
</file>

<file path="apps/main-app/ts/features/fims/history/components/__mocks__/FimsHistoryListItems.tsx">
import { Text } from "react-native";
export const FimsHistorySuccessListItem = () => (
  <Text testID="success">SUCCESS_LIST_ITEM</Text>
);
⋮----
export const FimsHistoryFailureListItem = () => (
  <Text testID="failure">FAILURE_LIST_ITEM</Text>
);
</file>

<file path="apps/main-app/ts/features/fims/history/components/__mocks__/FimsHistoryLoaders.tsx">
import { Text } from "react-native";
⋮----
export const LoadingFimsHistoryListItem = ()
⋮----
export const LoadingFimsHistoryItemsFooter = () => (
  <Text testID="testing-footer">LOADING_FOOTER</Text>
);
</file>

<file path="apps/main-app/ts/features/fims/history/components/FimsHistoryEmptyContent.tsx">
import {
  Body,
  ContentWrapper,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { FimsHistoryHeaderComponent } from "./FimsHistoryHeaderComponent";
</file>

<file path="apps/main-app/ts/features/fims/history/components/FimsHistoryHeaderComponent.tsx">
import { Body, H2, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
export const FimsHistoryHeaderComponent = () => (
  <View>
    <H2 accessibilityRole="header">
      {I18n.t("FIMS.history.historyScreen.header")}
    </H2>
    <VSpacer size={16} />
    <Body>{I18n.t("FIMS.history.historyScreen.body")}</Body>
    <VSpacer size={16} />
  </View>
);
</file>

<file path="apps/main-app/ts/features/fims/history/components/FimsHistoryKoScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { fimsHistoryGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/fims/history/components/FimsHistoryListItemPicker.tsx">
import { Access } from "@io-app/api-types/generated/definitions/fims_history/Access";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { potFoldWithDefault } from "../../../../utils/pot";
import { useAutoFetchingServiceByIdPot } from "../../common/hooks";
import {
  FimsHistoryFailureListItem,
  FimsHistorySuccessListItem
} from "./FimsHistoryListItems";
import { LoadingFimsHistoryListItem } from "./FimsHistoryLoaders";
⋮----
type BaseHistoryListItemProps = {
  item: Access;
};
⋮----
export const FimsHistoryListItemPicker = ({
  item
}: BaseHistoryListItemProps) =>
</file>

<file path="apps/main-app/ts/features/fims/history/components/FimsHistoryListItems.tsx">
import { Access } from "@io-app/api-types/generated/definitions/fims_history/Access";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import {
  BodySmall,
  Caption,
  H6,
  HSpacer,
  Icon,
  IOListItemStyles,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { dateToAccessibilityReadableFormat } from "../../../../utils/accessibility";
import { FimsHistorySharedStyles } from "../utils/styles";
⋮----
export type FimsHistoryBaseListItemProps = {
  item: Access;
};
export type FimsHistorySuccessListItemProps = {
  consent: Access;
  serviceData: ServiceDetails;
};
</file>

<file path="apps/main-app/ts/features/fims/history/components/FimsHistoryLoaders.tsx">
import { Divider, IOSkeleton, VSpacer } from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { FimsHistorySharedStyles } from "../utils/styles";
</file>

<file path="apps/main-app/ts/features/fims/history/components/FimsHistoryNonEmptyContent.tsx">
import { AccessHistoryPage } from "@io-app/api-types/generated/definitions/fims_history/AccessHistoryPage";
import {
  Divider,
  FooterActions,
  IODimensions,
  useFooterActionsMeasurements
} from "@io-app/design-system";
import { FlashList } from "@shopify/flash-list";
import I18n from "i18next";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { useFimsHistoryExport } from "../hooks/useFimsHistoryResultToasts";
import {
  isFimsHistoryExportingSelector,
  isFimsHistoryLoadingSelector
} from "../store/selectors";
import { FimsHistoryHeaderComponent } from "./FimsHistoryHeaderComponent";
import { FimsHistoryListItemPicker } from "./FimsHistoryListItemPicker";
import { LoadingFimsHistoryItemsFooter } from "./FimsHistoryLoaders";
⋮----
export type FimsHistoryNonEmptyContentProps = {
  accesses?: AccessHistoryPage;
  fetchMore: () => void;
};
</file>

<file path="apps/main-app/ts/features/fims/history/hooks/__mocks__/useFimsHistoryResultToasts.tsx">
export const useFimsHistoryExport = () => (
</file>

<file path="apps/main-app/ts/features/fims/history/hooks/useFimsHistoryResultToasts.tsx">
import { IOToast } from "@io-app/design-system";
import { constVoid } from "fp-ts/lib/function";
import I18n from "i18next";
import { useEffect, useRef } from "react";
import { Alert } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { trackExportHistory } from "../../common/analytics";
import {
  fimsHistoryExport,
  resetFimsHistoryExportState
} from "../store/actions";
import { fimsHistoryExportStateSelector } from "../store/selectors";
⋮----
const showFimsExportError = ()
⋮----
const showFimsExportSuccess = ()
⋮----
const showFimsAlreadyExportingAlert = (onPress: ()
⋮----
export const useFimsHistoryExport = () =>
⋮----
const handleExportOnPress = () =>
</file>

<file path="apps/main-app/ts/features/fims/history/saga/handleExportFimsHistorySaga.ts">
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { trackExportSucceeded } from "../../common/analytics";
import { FimsHistoryClient } from "../api/client";
import { fimsHistoryExport } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/fims/history/saga/handleGetFimsHistorySaga.ts">
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType, isActionOf } from "typesafe-actions";
⋮----
import { preferredLanguageSelector } from "../../../../store/reducers/persistedPreferences";
import { SagaCallReturnType } from "../../../../types/utils";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { trackHistoryFailure } from "../../common/analytics";
import { preferredLanguageToString } from "../../common/utils";
import { FimsHistoryClient } from "../api/client";
import { fimsHistoryGet } from "../store/actions";
⋮----
export const extractFimsHistoryResponseAction = (
  historyResult: SagaCallReturnType<FimsHistoryClient["getAccessHistory"]>
)
⋮----
const trackFailureIfNeeded = (
  action: ActionType<
    typeof fimsHistoryGet.failure | typeof fimsHistoryGet.success
  >
) =>
</file>

<file path="apps/main-app/ts/features/fims/history/saga/index.ts">
import { call, takeLatest } from "typed-redux-saga/macro";
⋮----
import { apiUrlPrefix } from "../../../../config";
import { createFimsClient } from "../api/client";
import { fimsHistoryExport, fimsHistoryGet } from "../store/actions";
import { handleExportFimsHistorySaga } from "./handleExportFimsHistorySaga";
import { handleGetFimsHistorySaga } from "./handleGetFimsHistorySaga";
</file>

<file path="apps/main-app/ts/features/fims/history/screens/HistoryScreen.tsx">
import { IOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect, useRef } from "react";
⋮----
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { fimsRequiresAppUpdateSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  trackHistoryFailure,
  trackHistoryScreen
} from "../../common/analytics";
import { FimsUpdateAppAlert } from "../../common/components/FimsUpdateAppAlert";
import { FimsHistoryEmptyContent } from "../components/FimsHistoryEmptyContent";
import { FimsHistoryKoScreen } from "../components/FimsHistoryKoScreen";
import { FimsHistoryNonEmptyContent } from "../components/FimsHistoryNonEmptyContent";
import { fimsHistoryGet, resetFimsHistoryState } from "../store/actions";
import {
  fimsHistoryErrorSelector,
  fimsHistoryToUndefinedSelector,
  isFimsHistoryLoadingSelector
} from "../store/selectors";
⋮----
export const FimsHistoryScreen = () =>
</file>

<file path="apps/main-app/ts/features/fims/history/store/actions/index.ts">
import { AccessHistoryPage } from "@io-app/api-types/generated/definitions/fims_history/AccessHistoryPage";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { FimsExportSuccessStates } from "../reducer";
⋮----
export type FimsHistoryGetPayloadType = {
  continuationToken?: string;
  shouldReloadFromScratch?: boolean;
};
⋮----
export type FimsHistoryActions =
  | ActionType<typeof fimsHistoryExport>
  | ActionType<typeof fimsHistoryGet>
  | ActionType<typeof resetFimsHistoryExportState>
  | ActionType<typeof resetFimsHistoryState>;
</file>

<file path="apps/main-app/ts/features/fims/history/store/reducer/index.ts">
import { AccessHistoryPage } from "@io-app/api-types/generated/definitions/fims_history/AccessHistoryPage";
⋮----
import { getType } from "typesafe-actions";
⋮----
import {
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../../../../common/model/RemoteValue";
import { Action } from "../../../../../store/actions/types";
import {
  fimsHistoryExport,
  fimsHistoryGet,
  resetFimsHistoryExportState,
  resetFimsHistoryState
} from "../actions";
⋮----
export type FimsExportSuccessStates = "ALREADY_EXPORTING" | "SUCCESS";
export type FimsHistoryState = {
  consentsList: pot.Pot<AccessHistoryPage, string>;
  historyExportState: FimsHistoryExportState;
};
⋮----
type FimsHistoryExportState = RemoteValue<FimsExportSuccessStates, null>;
⋮----
const reducer = (
  state: FimsHistoryState = INITIAL_STATE,
  action: Action
): FimsHistoryState =>
</file>

<file path="apps/main-app/ts/features/fims/history/store/selectors/index.ts">
import { constUndefined, pipe } from "fp-ts/lib/function";
⋮----
import { isLoading } from "../../../../../common/model/RemoteValue";
import { remoteConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../../store/reducers/types";
import { potFoldWithDefault } from "../../../../../utils/pot";
⋮----
export const fimsHistoryPotSelector = (state: GlobalState)
⋮----
export const isFimsHistoryLoadingSelector = (state: GlobalState)
⋮----
export const fimsHistoryToUndefinedSelector = (state: GlobalState)
⋮----
export type FimsHistoryErrorState = "ALERT_ONLY" | "FULL_KO";
export const fimsHistoryErrorSelector = (
  state: GlobalState
): FimsHistoryErrorState | undefined
⋮----
export const fimsIsHistoryEnabledSelector = (state: GlobalState)
⋮----
export const fimsHistoryExportStateSelector = (state: GlobalState)
⋮----
export const isFimsHistoryExportingSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/fims/history/utils/styles.ts">
import { StyleSheet } from "react-native";
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/components/FimsClaims.tsx">
import { Claim } from "@io-app/api-types/generated/definitions/fims_sso/Claim";
import { Divider, H6, Icon, IOColors, useIOTheme } from "@io-app/design-system";
import { Fragment } from "react";
import { StyleSheet, View } from "react-native";
⋮----
export const FimsClaimsList = (
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/components/FimsFullScreenErrors.tsx">
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { fimsCancelOrAbortAction } from "../store/actions";
import {
  fimsAuthenticationErrorTagSelector,
  fimsDebugDataSelector
} from "../store/selectors";
⋮----
export const FimsSSOFullScreenError = () =>
⋮----
const getErrorComponentProps = (): OperationResultScreenContentProps =>
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/components/FimsPrivacyInfo.tsx">
import { IOMarkdownLite } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { LoadingSkeleton } from "../../../../components/ui/LoadingSkeleton";
import { openWebUrl } from "../../../../utils/url";
⋮----
export const FimsPrivacyInfo = (
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/components/FimsSuccessBody.tsx">
import { Consent } from "@io-app/api-types/generated/definitions/fims_sso/Consent";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  Avatar,
  Body,
  ContentWrapper,
  ForceScrollDownView,
  H2,
  hexToRgba,
  HStack,
  Icon,
  IOButton,
  IOColors,
  IODimensions,
  IOMarkdownLite,
  ListItemHeader,
  VSpacer
} from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { LoadingSkeleton } from "../../../../components/ui/LoadingSkeleton";
import { useIODispatch, useIOStore } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { openWebUrl } from "../../../../utils/url";
import { logoForService } from "../../../services/home/utils";
import {
  computeAndTrackDataShare,
  computeAndTrackDataShareAccepted
} from "../../common/analytics";
import { useAutoFetchingServiceByIdPot } from "../../common/hooks";
import { fimsAcceptConsentsAction } from "../store/actions";
import { FimsClaimsList } from "./FimsClaims";
import { FimsSSOFullScreenError } from "./FimsFullScreenErrors";
import { FimsPrivacyInfo } from "./FimsPrivacyInfo";
⋮----
type FimsSuccessBodyProps = { consents: Consent; onAbort: () => void };
⋮----
// -------- ERROR LOGIC
⋮----
const generateBottomSheetProps = (privacyUrl: string): BSPropType => (
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/saga/handleFimsAbortOrCancel.ts">
import {
  cancelAllRunningRequests,
  isFailureResponse,
  nativeRequest
} from "@pagopa/io-react-native-http-client";
import { call, select } from "typed-redux-saga/macro";
⋮----
import { oidcProviderDomainSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { fimsPartialAbortUrl } from "../store/selectors";
import {
  absoluteRedirectUrl,
  computeAndTrackAuthenticationError,
  formatHttpClientResponseForMixPanel,
  handleFimsBackNavigation,
  handleFimsResourcesDeallocation
} from "./sagaUtils";
⋮----
const abortTimeoutMillisecondsGenerator = ()
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/saga/handleFIMSAcceptedConsents.ts">
import { isCancelledFailure } from "@pagopa/io-react-native-http-client";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { oidcProviderDomainSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  fimsAcceptConsentsAction,
  fimsAcceptConsentsFailureAction,
  fimsSignAndRetrieveInAppBrowserUrlAction
} from "../store/actions";
import {
  absoluteRedirectUrl,
  computeAndTrackAuthenticationError,
  deallocateFimsAndRenewFastLoginSession,
  followProviderRedirects,
  formatHttpClientResponseForMixPanel,
  isFastLoginFailure
} from "./sagaUtils";
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/saga/handleFimsAuthorizationOrImplicitCodeFlow.ts">
import { IOToast } from "@io-app/design-system";
import {
  HttpClientResponse,
  HttpClientSuccessResponse,
  isCancelledFailure,
  nativeRequest
} from "@pagopa/io-react-native-http-client";
import { openAuthSessionAsync } from "expo-web-browser";
⋮----
import { Parser as HTMLParser2 } from "htmlparser2";
import I18n from "i18next";
import {
  URL as PolyfillURL,
  URLSearchParams as PolyfillURLSearchParams
} from "react-native-url-polyfill";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { fimsTrackingEnrichedUrlsSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isMixpanelEnabled } from "../../../../store/reducers/persistedPreferences";
import { ReduxSagaEffect } from "../../../../types/utils";
import { getDeviceId } from "../../../../utils/device";
import { LollipopConfig } from "../../../lollipop";
import { generateKeyInfo } from "../../../lollipop/saga";
import {
  lollipopKeyTagSelector,
  lollipopPublicKeySelector
} from "../../../lollipop/store/reducers/lollipop";
import { lollipopRequestInit } from "../../../lollipop/utils/fetch";
import { serviceDetailsByIdSelector } from "../../../services/details/store/selectors";
import { trackInAppBrowserOpening } from "../../common/analytics";
import { fimsSignAndRetrieveInAppBrowserUrlAction } from "../store/actions";
import {
  fimsCtaTextSelector,
  fimsEphemeralSessionOniOSSelector,
  relyingPartyServiceIdSelector
} from "../store/selectors";
import { enrichFimsDestinationUrl } from "../utils";
import {
  absoluteRedirectUrlFromHttpClientResponse,
  computeAndTrackAuthenticationError,
  handleFimsBackNavigation,
  handleFimsResourcesDeallocation,
  isRedirectStatusCode
} from "./sagaUtils";
⋮----
const getLollipopParamsFromUrlString = (url: string) =>
⋮----
export type RelyingPartyOutput = {
  relyingPartyUrl: string;
  response: HttpClientResponse;
};
⋮----
type PostData = {
  params: Map<string, string>;
  state: string;
  url: string;
};
⋮----
const extractFormPostDataFromHTML = (
  html: string
): E.Either<string, PostData> =>
⋮----
onopentag(name, attributes)
⋮----
const processHtmlFormTag = (
  name: string,
  attributes: Record<string, string>,
  formData: Map<string, string>
) =>
⋮----
const validateAndProcessExtractedFormData = (
  formData: Map<string, string>
): E.Either<string, PostData> =>
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/saga/handleFimsGetConsentsList.ts">
import { Consent } from "@io-app/api-types/generated/definitions/fims_sso/Consent";
import { OIDCError } from "@io-app/api-types/generated/definitions/fims_sso/OIDCError";
import {
  HttpClientFailureResponse,
  HttpClientSuccessResponse,
  isCancelledFailure,
  nativeRequest,
  setCookie
} from "@pagopa/io-react-native-http-client";
import { getCustomTabsSupportingBrowsersAsync } from "expo-web-browser";
⋮----
import { identity, pipe } from "fp-ts/lib/function";
import { Platform } from "react-native";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType, isActionOf } from "typesafe-actions";
⋮----
import { oidcProviderDomainSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { preferredLanguageSelector } from "../../../../store/reducers/persistedPreferences";
import { trackAppCaughtError } from "../../../../utils/analytics";
import { isTestEnv } from "../../../../utils/environment";
import { unknownToString } from "../../../../utils/errors";
import { fimsTokenSelector } from "../../../authentication/common/store/selectors";
import { preferredLanguageToString } from "../../common/utils";
import {
  fimsGetConsentsListAction,
  fimsSignAndRetrieveInAppBrowserUrlAction
} from "../store/actions";
import { FimsErrorStateType } from "../store/reducers";
import {
  computeAndTrackAuthenticationError,
  deallocateFimsAndRenewFastLoginSession,
  followProviderRedirects,
  formatHttpClientResponseForMixPanel,
  isFastLoginFailure,
  isSuccessfulStatusCode,
  isValidRedirectResponse,
  responseContentContainsJson
} from "./sagaUtils";
⋮----
const decodeSuccessfulConsentsResponse = (
  getConsentsResult: HttpClientSuccessResponse
)
⋮----
const extractConsentsError = (
  failureResponse: HttpClientFailureResponse
): FimsErrorStateType =>
⋮----
const safeParseFailureResponseBody = (failureResponseBody: string) =>
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { put, select, takeLatest } from "typed-redux-saga/macro";
⋮----
import {
  fimsAcceptConsentsAction,
  fimsCancelOrAbortAction,
  fimsGetConsentsListAction,
  fimsSignAndRetrieveInAppBrowserUrlAction
} from "../store/actions";
import {
  fimsCtaTextSelector,
  fimsEphemeralSessionOniOSSelector,
  fimsRelyingPartyUrlIfFastLoginSelector
} from "../store/selectors";
import { handleFimsAbortOrCancel } from "./handleFimsAbortOrCancel";
import { handleFimsAcceptedConsents } from "./handleFIMSAcceptedConsents";
import { handleFimsAuthorizationOrImplicitCodeFlow } from "./handleFimsAuthorizationOrImplicitCodeFlow";
import { handleFimsGetConsentsList } from "./handleFimsGetConsentsList";
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/saga/sagaUtils.ts">
import {
  deallocate,
  HttpCallConfig,
  HttpClientFailureResponse,
  HttpClientResponse,
  HttpClientSuccessResponse,
  nativeRequest,
  removeAllCookiesForDomain
} from "@pagopa/io-react-native-http-client";
import { StackActions } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
import { URL as PolyfillURL } from "react-native-url-polyfill";
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import NavigationService from "../../../../navigation/NavigationService";
import { oidcProviderDomainSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { refreshSessionToken } from "../../../authentication/fastLogin/store/actions/tokenRefreshActions";
import { serviceDetailsByIdSelector } from "../../../services/details/store/selectors";
import { trackAuthenticationError } from "../../common/analytics";
import {
  fimsRelyingPartyDomainSelector,
  relyingPartyServiceIdSelector
} from "../store/selectors";
⋮----
export const absoluteRedirectUrlFromHttpClientResponse = (
  data: HttpClientResponse,
  originalRequestUrl: string
)
⋮----
export const absoluteRedirectUrl = (
  redirect: string | undefined = undefined,
  originalRequestUrl: string
) =>
⋮----
export const getDomainFromUrl = (url: string) =>
⋮----
export const foldNativeHttpClientResponse =
  <T>(
    foldSuccess: (res: HttpClientSuccessResponse) => T,
    foldFailure: (res: HttpClientFailureResponse) => T
)
⋮----
export const formatHttpClientResponseForMixPanel = (
  resData: HttpClientResponse
)
⋮----
export const isValidRedirectResponse = (
  res: HttpClientResponse
): res is HttpClientSuccessResponse &
⋮----
export const isSuccessfulStatusCode = (statusCode: number)
export const isRedirectStatusCode = (statusCode: number)
export const isFastLoginFailure = (res: HttpClientFailureResponse)
⋮----
export const responseContentContainsJson = (
  res: HttpClientResponse
): boolean =>
⋮----
export const followProviderRedirects = async (
  httpClientConfig: HttpCallConfig,
  fimsDomain: string
): Promise<HttpClientResponse> =>
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/screens/__test__/FimsFlowHandlerScreen.test.tsx">
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
⋮----
import { FIMS_ROUTES } from "../../../common/navigation";
import { fimsGetConsentsListAction } from "../../store/actions";
import { FimsFlowHandlerScreen } from "../FimsFlowHandlerScreen";
⋮----
const renderComponent = (minAppVersion: string) =>
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/screens/FimsFlowHandlerScreen.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { constTrue, pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback, useEffect } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { fimsRequiresAppUpdateSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  trackAuthenticationError,
  trackAuthenticationStart
} from "../../common/analytics";
import { FimsUpdateAppAlert } from "../../common/components/FimsUpdateAppAlert";
import { FimsParamsList } from "../../common/navigation";
import { FimsSSOFullScreenError } from "../components/FimsFullScreenErrors";
import { FimsFlowSuccessBody } from "../components/FimsSuccessBody";
import {
  fimsCancelOrAbortAction,
  fimsGetConsentsListAction
} from "../store/actions/";
import { FimsFlowStateTags } from "../store/reducers";
import {
  fimsAuthenticationFailedSelector,
  fimsConsentsDataSelector,
  fimsLoadingStateSelector
} from "../store/selectors";
⋮----
export type FimsFlowHandlerScreenRouteParams = {
  ctaText: string;
  ctaUrl: string;
  ephemeralSessionOniOS: boolean;
  organizationFiscalCode: string | undefined;
  organizationName: string | undefined;
  serviceId: ServiceId;
  serviceName: string | undefined;
  source: string;
};
⋮----
type FimsFlowHandlerScreenRouteProps = IOStackNavigationRouteProps<
  FimsParamsList,
  "FIMS_SSO_CONSENTS"
>;
⋮----
// Force users on Android to use UI buttons to go back, since
// there are cases where a modal may be displayed on top of
// the screen (like the assistance one) and the hardware back
// button event is not stopped by such screen but is instead
// propagated to this UI, causing a back loop
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/store/actions/index.ts">
import { Consent } from "@io-app/api-types/generated/definitions/fims_sso/Consent";
import { HttpClientSuccessResponse } from "@pagopa/io-react-native-http-client";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { FimsErrorStateType } from "../reducers";
⋮----
export type FimsGetConsentsListRequestType = {
  ctaText: string;
  ctaUrl: string;
  ephemeralSessionOniOS: boolean;
};
⋮----
type FimsAcceptConsentsRequestType = {
  acceptUrl?: string;
};
⋮----
export type FimsSSOActions =
  | ActionType<typeof fimsAcceptConsentsAction>
  | ActionType<typeof fimsAcceptConsentsFailureAction>
  | ActionType<typeof fimsCancelOrAbortAction>
  | ActionType<typeof fimsGetConsentsListAction>
  | ActionType<typeof fimsSignAndRetrieveInAppBrowserUrlAction>;
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/store/reducers/index.ts">
import { Consent } from "@io-app/api-types/generated/definitions/fims_sso/Consent";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { startApplicationInitialization } from "../../../../../store/actions/application";
import { Action } from "../../../../../store/actions/types";
import { shouldRestartFimsAuthAfterFastLoginFailure } from "../../utils";
import {
  fimsAcceptConsentsAction,
  fimsAcceptConsentsFailureAction,
  fimsCancelOrAbortAction,
  fimsGetConsentsListAction,
  fimsSignAndRetrieveInAppBrowserUrlAction
} from "../actions";
import { abortUrlFromConsentsPot } from "../selectors";
⋮----
export type FIMS_SSO_ERROR_TAGS =
  | "AUTHENTICATION"
  | "GENERIC"
  | "MISSING_INAPP_BROWSER";
⋮----
export type FimsErrorStateType = {
  debugMessage: string;
  errorTag: FIMS_SSO_ERROR_TAGS;
};
export type FimsFlowStateTags =
  | "abort"
  | "consents"
  | "fastLogin_forced_restart"
  | "idle"
  | "in-app-browser-loading";
⋮----
export type FimsSSOState = {
  ctaText?: string;
  currentFlowState: FimsFlowStateTags;
  ephemeralSessionOniOS: boolean;
  relyingPartyServiceId?: ServiceId;
  relyingPartyUrl?: string;
  ssoData: pot.Pot<Consent, FimsErrorStateType>;
};
⋮----
const reducer = (
  state: FimsSSOState = INITIAL_STATE,
  action: Action
): FimsSSOState =>
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/store/selectors/index.ts">
import { Consent } from "@io-app/api-types/generated/definitions/fims_sso/Consent";
⋮----
import { identity, pipe } from "fp-ts/lib/function";
⋮----
import { isDebugModeEnabledSelector } from "../../../../../store/reducers/debug";
import { GlobalState } from "../../../../../store/reducers/types";
import { isStrictNone } from "../../../../../utils/pot";
import { getDomainFromUrl } from "../../saga/sagaUtils";
import { foldFimsFlowStateK } from "../../utils";
import { FimsErrorStateType } from "../reducers";
⋮----
export const fimsConsentsDataSelector = (state: GlobalState)
⋮----
export const fimsRelyingPartyDomainSelector = (state: GlobalState)
export const fimsRelyingPartyUrlSelector = (state: GlobalState)
export const fimsCtaTextSelector = (state: GlobalState)
export const relyingPartyServiceIdSelector = (state: GlobalState)
export const fimsEphemeralSessionOniOSSelector = (state: GlobalState)
⋮----
export const fimsPartialAbortUrl = (state: GlobalState)
⋮----
export const abortUrlFromConsentsPot = (
  consentsPot: pot.Pot<Consent, FimsErrorStateType>
)
⋮----
export const fimsAuthenticationFailedSelector = (state: GlobalState)
⋮----
export const fimsAuthenticationErrorTagSelector = (state: GlobalState) =>
⋮----
export const fimsDebugDataSelector = (state: GlobalState) =>
⋮----
export const fimsLoadingStateSelector = (state: GlobalState)
⋮----
export const fimsRelyingPartyUrlIfFastLoginSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/utils/__test__/index.test.ts">
import {
  enrichFimsDestinationUrl,
  isFIMSLink,
  removeFIMSPrefixFromUrl
} from "..";
</file>

<file path="apps/main-app/ts/features/fims/singleSignOn/utils/index.ts">
import { URL as PolyfillURL } from "react-native-url-polyfill";
import { ActionType } from "typesafe-actions";
⋮----
import { startApplicationInitialization } from "../../../../store/actions/application";
import { isStrictSome } from "../../../../utils/pot";
import { FimsFlowStateTags, FimsSSOState } from "../store/reducers";
⋮----
export const foldFimsFlowState = <A>(
  flowState: FimsFlowStateTags,
  onConsents: (state: "consents") => A,
  onInAppBrowser: (state: "in-app-browser-loading") => A,
  onAbort: (state: "abort") => A,
  onShouldRestart: (state: "fastLogin_forced_restart") => A,
  onIdle: (state: "idle") => A
) =>
⋮----
export const foldFimsFlowStateK =
  <A>(
    onConsents: (state: "consents") => A,
    onInAppBrowser: (state: "in-app-browser-loading") => A,
    onAbort: (state: "abort") => A,
    onShouldRestart: (state: "fastLogin_forced_restart") => A,
    onIdle: (state: "idle") => A
)
⋮----
export const shouldRestartFimsAuthAfterFastLoginFailure = (
  state: FimsSSOState,
  action: ActionType<typeof startApplicationInitialization>
) =>
⋮----
export const removeFIMSPrefixFromUrl = (fimsUrlWithProtocol: string) =>
⋮----
export const isFIMSLink = (href: string): boolean
⋮----
const normalizeUrl = (rawUrl: string): string =>
⋮----
/**
 * Adds the Mixpanel device ID only when the redirect destination is explicitly
 * allowed by remote configuration. Query parameters and fragments do not take
 * part in the allowlist comparison.
 */
export const enrichFimsDestinationUrl = (
  destinationUrl: string,
  trackingEnrichedUrls: ReadonlyArray<string>,
  mixpanelDeviceId: string
): string =>
</file>

<file path="apps/main-app/ts/features/identification/analytics/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { mixpanelTrack } from "../../../mixpanel";
import { Action } from "../../../store/actions/types";
import { buildEventProperties } from "../../../utils/analytics";
import {
  identificationCancel,
  identificationFailure,
  identificationForceLogout,
  identificationPinReset,
  identificationRequest,
  identificationStart,
  identificationSuccess
} from "../store/actions";
⋮----
export const trackIdentificationAction = (
  action: Action
): ReadonlyArray<null> | void =>
</file>

<file path="apps/main-app/ts/features/identification/components/IdentificationNumberPad.tsx">
import {
  BiometricsValidType,
  CodeInput,
  IconButton,
  NumberPad,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps, useCallback, useState } from "react";
import { View } from "react-native";
⋮----
import { isDevEnv } from "../../../utils/environment";
⋮----
type BiometricConfigType =
  | {
      biometricAccessibilityLabel: string;
      biometricType: BiometricsValidType;
      onBiometricPress: () => Promise<void>;
    }
  | {
      biometricAccessibilityLabel?: undefined;
      biometricType?: undefined;
      onBiometricPress?: undefined;
    };
type IdentificationNumberPadProps = {
  biometricsConfig: BiometricConfigType;
  numberPadVariant: ComponentProps<typeof NumberPad>["variant"];
  pin: string;
  pinValidation: (success: boolean) => void;
};
⋮----
// Calling pinValidation after a timeout is neeed
// to allow code input to refresh correctly,
// and in case of error to see the shake animation.
⋮----
// We don't need to handle the value change on code input,
// only on number pad.
</file>

<file path="apps/main-app/ts/features/identification/sagas/index.ts">
import { call, put, select, take, takeLatest } from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import { maybeHandlePendingBackgroundActions } from "../../../sagas/backgroundActions";
import { startApplicationInitialization } from "../../../store/actions/application";
import { PinString } from "../../../types/PinString";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../types/utils";
import { isDevEnv } from "../../../utils/environment";
import { deletePin, getPin } from "../../../utils/keychain";
import {
  checkCurrentSession,
  sessionInvalid
} from "../../authentication/common/store/actions";
import { isFastLoginEnabledSelector } from "../../authentication/fastLogin/store/selectors/index";
import {
  identificationCancel,
  identificationForceLogout,
  identificationPinReset,
  identificationRequest,
  identificationReset,
  identificationStart,
  identificationSuccess
} from "../store/actions";
import {
  IdentificationBackActionType,
  IdentificationCancelData,
  IdentificationGenericData,
  IdentificationResult,
  IdentificationSuccessData
} from "../store/reducers";
⋮----
type ResultAction =
  | ActionType<typeof identificationCancel>
  | ActionType<typeof identificationForceLogout>
  | ActionType<typeof identificationPinReset>
  | ActionType<typeof identificationSuccess>;
</file>

<file path="apps/main-app/ts/features/identification/screens/IdentificationLockModal.tsx">
import {
  BodySmall,
  ContentWrapper,
  H4,
  IOColors,
  Pictogram,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
import { Modal, View } from "react-native";
⋮----
import {
  CountdownProvider,
  useCountdown
} from "../../../components/countdown/CountdownProvider";
import { ProgressIndicator } from "../../../components/ui/ProgressIndicator";
import { useIODispatch } from "../../../store/hooks";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { identificationHideLockModal } from "../store/actions";
⋮----
type Props = {
  countdownInMs: Millisecond;
  timeSpanInSeconds: number;
};
⋮----
type CountdownProps = {
  onElapsedTimer: () => void;
  timeSpanInSeconds: number;
};
⋮----
const Countdown = (props: CountdownProps) =>
</file>

<file path="apps/main-app/ts/features/identification/screens/IdentificationModal.tsx">
import {
  ContentWrapper,
  H2,
  IconButton,
  IOButton,
  IOColors,
  IOPictograms,
  Pictogram,
  ToastNotification,
  useIOFontDynamicScale,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import I18n from "i18next";
import { memo, useCallback, useMemo, useRef, useState } from "react";
import {
  Alert,
  Modal,
  Platform,
  ScrollView,
  StatusBar,
  StyleSheet,
  View
} from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { useDispatch } from "react-redux";
⋮----
import { useDetectSmallScreen } from "../../../hooks/useDetectSmallScreen";
import { useIOSelector } from "../../../store/hooks";
import { appCurrentStateSelector } from "../../../store/reducers/appState";
import { setAccessibilityFocus } from "../../../utils/accessibility";
import { biometricAuthenticationRequest } from "../../../utils/biometrics";
import { useBiometricType } from "../../../utils/hooks/useBiometricType";
import { usePrevious } from "../../../utils/hooks/usePrevious";
import { areTwoMinElapsedFromLastActivity } from "../../authentication/fastLogin/store/actions/sessionRefreshActions";
import { refreshSessionToken } from "../../authentication/fastLogin/store/actions/tokenRefreshActions";
import {
  hasTwoMinutesElapsedSinceLastActivitySelector,
  isFastLoginEnabledSelector
} from "../../authentication/fastLogin/store/selectors";
import { profileNameSelector } from "../../settings/common/store/selectors";
import { IdentificationNumberPad } from "../components/IdentificationNumberPad";
import {
  identificationCancel,
  identificationFailure,
  identificationPinReset,
  identificationSuccess
} from "../store/actions";
import { IdentificationCancelData, maxAttempts } from "../store/reducers";
import {
  identificationFailSelector,
  progressSelector
} from "../store/selectors";
import {
  FAIL_ATTEMPTS_TO_SHOW_ALERT,
  getBiometryIconName,
  handleAndroidBackNavigation,
  IdentificationInstructionsComponent
} from "../utils";
import { IdentificationLockModal } from "./IdentificationLockModal";
⋮----
// eslint-disable-next-line functional/no-let
⋮----
// eslint-disable-next-line functional/no-let
⋮----
handleAndroidBackNavigation(
</file>

<file path="apps/main-app/ts/features/identification/store/actions/index.ts">
import {
  ActionType,
  createAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { PinString } from "../../../../types/PinString";
import {
  IdentificationBackActionType,
  IdentificationCancelData,
  IdentificationGenericData,
  IdentificationSuccessData
} from "../reducers";
⋮----
export type IdentificationActions =
  | ActionType<typeof identificationCancel>
  | ActionType<typeof identificationFailure>
  | ActionType<typeof identificationForceLogout>
  | ActionType<typeof identificationHideLockModal>
  | ActionType<typeof identificationPinReset>
  | ActionType<typeof identificationRequest>
  | ActionType<typeof identificationReset>
  | ActionType<typeof identificationStart>
  | ActionType<typeof identificationSuccess>;
</file>

<file path="apps/main-app/ts/features/identification/store/reducers/index.ts">
import { PersistPartial } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { PinString } from "../../../../types/PinString";
import {
  identificationCancel,
  identificationFailure,
  identificationHideLockModal,
  identificationReset,
  identificationStart,
  identificationSuccess
} from "../actions";
⋮----
export enum IdentificationBackActionType {
  CLOSE_APP = "CLOSE_APP",
  DEFAULT = "DEFAULT"
}
⋮----
export enum IdentificationResult {
  cancel = "cancel",
  failure = "failure",
  pinreset = "pinreset",
  success = "success"
}
⋮----
export type IdentificationCancelData = { label: string; onCancel: () => void };
⋮----
export type IdentificationFailData = {
  nextLegalAttempt: Date;
  remainingAttempts: number;
  showLockModal?: boolean;
  timespanBetweenAttempts: number;
};
⋮----
export type IdentificationGenericData = {
  message: string;
};
⋮----
export type IdentificationState = {
  fail?: IdentificationFailData;
  progress: IdentificationProgressState;
};
⋮----
export type IdentificationSuccessData = { onSuccess: () => void };
⋮----
export type PersistedIdentificationState = IdentificationState & PersistPartial;
⋮----
type IdentificationIdentifiedState = {
  kind: "identified";
};
⋮----
type IdentificationProgressState =
  | IdentificationIdentifiedState
  | IdentificationStartedState
  | IdentificationUnidentifiedState;
⋮----
type IdentificationStartedState = {
  canResetPin: boolean;
  identificationCancelData?: IdentificationCancelData;
  identificationContext?: IdentificationBackActionType;
  identificationGenericData?: IdentificationGenericData;
  identificationSuccessData?: IdentificationSuccessData;
  isValidatingTask: boolean;
  kind: "started";
  pin: PinString;
  shufflePad?: boolean;
};
⋮----
type IdentificationUnidentifiedState = {
  kind: "unidentified";
};
⋮----
export const fillShowLockModal = (actualErrorData: IdentificationFailData) =>
⋮----
const nextErrorData = (
  errorData: IdentificationFailData
): IdentificationFailData =>
⋮----
export const identificationReducer = (
  state: IdentificationState = INITIAL_STATE,
  action: Action
): IdentificationState =>
</file>

<file path="apps/main-app/ts/features/identification/store/selectors/index.ts">
import { GlobalState } from "../../../../store/reducers/types";
⋮----
export const identificationFailSelector = (state: GlobalState)
⋮----
export const progressSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/identification/utils/index.tsx">
import { BiometricsValidType, Body } from "@io-app/design-system";
import { TxtParagraphNode } from "@textlint/ast-node-types";
import I18n from "i18next";
import { BackHandler, Platform, View } from "react-native";
⋮----
import IOMarkdown from "../../../components/IOMarkdown";
import { getTxtNodeKey } from "../../../components/IOMarkdown/renderRules";
import { Renderer } from "../../../components/IOMarkdown/types";
import { IdentificationBackActionType } from "../store/reducers";
⋮----
export const getBiometryIconName = (
  biometryPrintableSimpleType: BiometricsValidType
) =>
⋮----
export const getAccessibiliyIdentificationInstructions = (
  biometricType: BiometricsValidType | undefined,
  isBimoetricIdentificatoinFailed = false
) =>
⋮----
const generatePragraphRule = () => (
⋮----
Paragraph(paragraph: TxtParagraphNode, render: Renderer)
⋮----
export const handleAndroidBackNavigation = (
  identificationContext: IdentificationBackActionType | undefined,
  defaultCloseAction: () => void
) =>
</file>

<file path="apps/main-app/ts/features/identification/README.md">
# Identification Feature

## Purpose

This directory encapsulates code related to the application's user identification functionality. This includes biometric authentication, PIN-based identification, and other mechanisms used to verify the user's identity.

## Rationale (Refactoring Context)

As part of a codebase refactoring initiative, these files were grouped together to:

1. **Improve Cohesion:** Consolidate identification logic (UI, state, navigation, services, types, etc.) into one logical location.
2. **Enhance Discoverability:** Make it easier and faster for developers to locate and understand code related to user identification.
3. **Simplify Maintenance:** Streamline bug fixing, updates, and future enhancements by isolating identification-related code.

## Contents

This feature module typically includes:

- Identification-related UI screens (e.g., `IdentificationModal`, `IdentificationLockModal`).
- State management logic specific to user identification (actions, reducers, selectors).
- Utility functions and components used exclusively within the identification flows.
- Sagas for handling asynchronous identification-related logic.

## Guideline

- All **new** code **strictly** concerning user identification functionality (new screens, identification-specific logic, state management for identification, etc.) should reside directly within this `identification` feature module.
- Avoid creating unnecessary subdirectories unless the codebase grows significantly and requires further organization.

## Folder structure

The current folder structure is as follows:

```bash
identification/
├── components/ # UI components specific to identification
├── screens/    # Screens for identification flows
├── store/      # State management (actions, reducers, selectors)
│   ├── actions/
│   ├── reducers/
│   ├── selectors/
├── sagas/      # Asynchronous logic and side effects
├── utils/      # Utility functions specific to identification
└── __tests__/  # Unit tests for identification logic
```

This structure ensures that all identification-related code is organized and easy to navigate.
</file>

<file path="apps/main-app/ts/features/idpay/barcode/components/IdPayBarcodeExpireProgressBar.tsx">
import { TransactionBarCodeResponse } from "@io-app/api-types/generated/definitions/idpay/TransactionBarCodeResponse";
import { BodySmall, VSpacer } from "@io-app/design-system";
import { format } from "date-fns";
import I18n from "i18next";
import { useEffect, useState } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { ProgressBar } from "../../../bonus/common/components/ProgressBar";
import { calculateIdPayBarcodeSecondsToExpire } from "../utils";
⋮----
type Props = {
  barcode: TransactionBarCodeResponse;
  secondsExpirationTotal: number;
  setIsExpired: (isExpired: boolean) => void;
};
</file>

<file path="apps/main-app/ts/features/idpay/barcode/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { IdPayFeatureFlagGuard } from "../../common/components/IdPayFeatureFlagGuard";
import { IdPayBarcodeResultScreen } from "../screens/IdPayBarcodeResultScreen";
import { IdPayBarcodeParamsList } from "./params";
import { IdPayBarcodeRoutes } from "./routes";
⋮----
export const IdPayBarcodeNavigator = () => (
  <IdPayFeatureFlagGuard>
    <Stack.Navigator
      initialRouteName={IdPayBarcodeRoutes.IDPAY_BARCODE_RESULT}
      screenOptions={{ gestureEnabled: true }}
    >
      <Stack.Screen
        component={IdPayBarcodeResultScreen}
        name={IdPayBarcodeRoutes.IDPAY_BARCODE_RESULT}
        options={{
          headerShown: false
        }}
      />
    </Stack.Navigator>
  </IdPayFeatureFlagGuard>
);
</file>

<file path="apps/main-app/ts/features/idpay/barcode/navigation/params.ts">
import { IdPayBarcodeResultRouteParams } from "../screens/IdPayBarcodeResultScreen";
import { IdPayBarcodeRoutes } from "./routes";
⋮----
export type IdPayBarcodeParamsList = {
  [IdPayBarcodeRoutes.IDPAY_BARCODE_MAIN]: undefined;
  [IdPayBarcodeRoutes.IDPAY_BARCODE_RESULT]: IdPayBarcodeResultRouteParams;
};
</file>

<file path="apps/main-app/ts/features/idpay/barcode/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/idpay/barcode/saga/__test__/handleGenerateBarcode.test.ts">
import {
  StatusEnum,
  TransactionBarCodeResponse
} from "@io-app/api-types/generated/definitions/idpay/TransactionBarCodeResponse";
import {
  CodeEnum,
  TransactionErrorDTO
} from "@io-app/api-types/generated/definitions/idpay/TransactionErrorDTO";
⋮----
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { getNetworkError } from "../../../../../utils/errors";
import { withRefreshApiCall } from "../../../../authentication/fastLogin/saga/utils";
import { mockIDPayClient } from "../../../common/api/__mocks__/client";
import { idPayGenerateBarcode } from "../../store/actions";
import { handleGenerateBarcode } from "../handleGenerateBarcode";
</file>

<file path="apps/main-app/ts/features/idpay/barcode/saga/handleGenerateBarcode.ts">
import {
  CodeEnum,
  TransactionErrorDTO
} from "@io-app/api-types/generated/definitions/idpay/TransactionErrorDTO";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getNetworkError } from "../../../../utils/errors";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idPayGenerateBarcode } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/barcode/saga/handleGenerateStaticCode.ts">
import {
  CodeEnum,
  TransactionErrorDTO
} from "@io-app/api-types/generated/definitions/idpay/TransactionErrorDTO";
import { IOToast } from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
import I18n from "i18next";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idPayGenerateStaticCode } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/barcode/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { IDPayClient } from "../../common/api/client";
import {
  idPayGenerateBarcode,
  idPayGenerateStaticCode
} from "../store/actions";
import { handleGenerateBarcode } from "./handleGenerateBarcode";
import { handleGenerateStaticCode } from "./handleGenerateStaticCode";
</file>

<file path="apps/main-app/ts/features/idpay/barcode/screens/IdPayBarcodeResultScreen.tsx">
import { TransactionBarCodeResponse } from "@io-app/api-types/generated/definitions/idpay/TransactionBarCodeResponse";
import {
  Body,
  H3,
  IOColors,
  IODimensions,
  IOText,
  IOTypography,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
⋮----
import { RouteProp, useRoute } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect, useState } from "react";
import { StyleSheet, View } from "react-native";
import Barcode from "react-native-barcode-builder";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { LoadingIndicator } from "../../../../components/ui/LoadingIndicator";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import {
  trackIDPayDetailCodeExpired,
  trackIDPayDetailCodeGenerateNew,
  trackIDPayDetailCodeGenerationConversion,
  trackIDPayDetailCodeGenerationCopy,
  trackIDPayDetailCodeGenerationError
} from "../../details/analytics";
import { IDPayDetailsRoutes } from "../../details/navigation";
import { idpayInitiativeDetailsSelector } from "../../details/store";
import { IdPayBarcodeExpireProgressBar } from "../components/IdPayBarcodeExpireProgressBar";
import { IdPayBarcodeParamsList } from "../navigation/params";
import { idPayGenerateBarcode } from "../store/actions";
import { idPayBarcodeByInitiativeIdSelector } from "../store/selectors";
⋮----
type BarcodeExpiredContentProps = {
  initiativeId: string;
  initiativeName?: string;
};
type IdPayBarcodeResultRouteParams = {
  initiativeId: string;
};
type IdPayBarcodeResultRouteProps = RouteProp<
  IdPayBarcodeParamsList,
  "IDPAY_BARCODE_RESULT"
>;
type SuccessContentProps = {
  barcode: TransactionBarCodeResponse;
  initiativeId: string;
  initiativeName?: string;
};
⋮----
const IdPayBarcodeResultScreen = () =>
⋮----
// -------------------- result screens --------------------
⋮----
const FailureContent = ({
  initiativeId,
  initiativeName
}: Omit<SuccessContentProps, "barcode">) =>
⋮----
const navigateToInitiativeDetails = ()
⋮----
const ctaClickHandler = () =>
</file>

<file path="apps/main-app/ts/features/idpay/barcode/store/actions/index.ts">
import { TransactionBarCodeResponse } from "@io-app/api-types/generated/definitions/idpay/TransactionBarCodeResponse";
import { TransactionErrorDTO } from "@io-app/api-types/generated/definitions/idpay/TransactionErrorDTO";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
type IdPayGenerateBarcodePayload = {
  initiativeId: string;
};
⋮----
export type IdPayBarcodeActions = ActionType<typeof idPayGenerateBarcode>;
⋮----
export type IdPayStaticCodeActions = ActionType<typeof idPayGenerateStaticCode>;
</file>

<file path="apps/main-app/ts/features/idpay/barcode/store/reducers/barcodeReducer.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { idPayGenerateBarcode } from "../actions";
import { IdPayBarcodeState } from "../types";
⋮----
const barcodeReducer = (
  state: IdPayBarcodeState = INITIAL_STATE,
  action: Action
): IdPayBarcodeState =>
</file>

<file path="apps/main-app/ts/features/idpay/barcode/store/reducers/staticCodeReducer.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { idPayGenerateStaticCode } from "../actions";
import { IdPayStaticCodeState } from "../types";
⋮----
const staticCodeReducer = (
  state: IdPayStaticCodeState = INITIAL_STATIC_CODE_STATE,
  action: Action
): IdPayStaticCodeState =>
</file>

<file path="apps/main-app/ts/features/idpay/barcode/store/selectors/index.ts">
import { pipe } from "fp-ts/lib/function";
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { calculateIdPayBarcodeSecondsToExpire } from "../../utils";
import { IdPayBarcodeState, IdPayStaticCodeState } from "../types";
⋮----
const idPayBarcodeSelector = (state: GlobalState): IdPayBarcodeState
⋮----
const idPayStaticCodeSelector = (state: GlobalState): IdPayStaticCodeState
</file>

<file path="apps/main-app/ts/features/idpay/barcode/store/types/index.ts">
import { TransactionBarCodeResponse } from "@io-app/api-types/generated/definitions/idpay/TransactionBarCodeResponse";
import { TransactionErrorDTO } from "@io-app/api-types/generated/definitions/idpay/TransactionErrorDTO";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type IdPayBarcodeState = {
  [initiativeId: string]: pot.Pot<
    TransactionBarCodeResponse,
    NetworkError | TransactionErrorDTO
  >;
};
⋮----
export type IdPayStaticCodeState = {
  [initiativeId: string]: pot.Pot<
    TransactionBarCodeResponse,
    NetworkError | TransactionErrorDTO
  >;
};
</file>

<file path="apps/main-app/ts/features/idpay/barcode/utils.ts">
import { TransactionBarCodeResponse } from "@io-app/api-types/generated/definitions/idpay/TransactionBarCodeResponse";
⋮----
export const calculateIdPayBarcodeSecondsToExpire = (
  barcode: TransactionBarCodeResponse
) =>
</file>

<file path="apps/main-app/ts/features/idpay/code/components/IdPayCodeCieBanner.tsx">
import { Banner, VSpacer } from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { useEffect, useRef } from "react";
import { View } from "react-native";
⋮----
import { IOStackNavigationProp } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isIdPayCiePaymentCodeEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isLoadingDiscountInitiativeInstrumentsSelector } from "../../configuration/store";
import { idpayInitiativeInstrumentsGet } from "../../configuration/store/actions";
import { IdPayCodeParamsList } from "../navigation/params";
import { IdPayCodeRoutes } from "../navigation/routes";
import { idPayCodeCieBannerClose } from "../store/actions";
import { showIdPayCodeBannerSelector } from "../store/selectors";
⋮----
type IdPayCodeCIEBannerParams = {
  initiativeId: string;
};
⋮----
const handleOnCloseBanner = () =>
⋮----
const handleNavigateToOnboardingStart = () =>
</file>

<file path="apps/main-app/ts/features/idpay/code/components/IdPayInfoCieBottomSheet.tsx">
import { FeatureInfo, H4, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import {
  IOBottomSheetModal,
  useIOBottomSheetModal
} from "../../../../utils/hooks/bottomSheet";
⋮----
body=
</file>

<file path="apps/main-app/ts/features/idpay/code/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { IdPayFeatureFlagGuard } from "../../common/components/IdPayFeatureFlagGuard";
import { IdPayCodeDisplayScreen } from "../screens/IdPayCodeDisplayScreen";
import { IdPayCodeOnboardingScreen } from "../screens/IdPayCodeOnboardingScreen";
import { IdPayCodeRenewScreen } from "../screens/IdPayCodeRenewScreen";
import { IdPayCodeResultScreen } from "../screens/IdPayCodeResultScreen";
import { IdPayCodeParamsList } from "./params";
import { IdPayCodeRoutes } from "./routes";
⋮----
export const IdPayCodeNavigator = () => (
  <IdPayFeatureFlagGuard>
    <Stack.Navigator
      initialRouteName={IdPayCodeRoutes.IDPAY_CODE_ONBOARDING}
      screenOptions={{ gestureEnabled: false }}
    >
      <Stack.Screen
        component={IdPayCodeOnboardingScreen}
        name={IdPayCodeRoutes.IDPAY_CODE_ONBOARDING}
        options={{ gestureEnabled: true }}
      />
      <Stack.Screen
        component={IdPayCodeDisplayScreen}
        name={IdPayCodeRoutes.IDPAY_CODE_DISPLAY}
      />
      <Stack.Screen
        component={IdPayCodeRenewScreen}
        name={IdPayCodeRoutes.IDPAY_CODE_RENEW}
      />
      <Stack.Screen
        component={IdPayCodeResultScreen}
        name={IdPayCodeRoutes.IDPAY_CODE_RESULT}
        options={{ headerShown: false }}
      />
    </Stack.Navigator>
  </IdPayFeatureFlagGuard>
);
</file>

<file path="apps/main-app/ts/features/idpay/code/navigation/params.ts">
import { IdPayCodeDisplayRouteParams } from "../screens/IdPayCodeDisplayScreen";
import { IdPayCodeOnboardingRouteParams } from "../screens/IdPayCodeOnboardingScreen";
import { IdPayCodeRoutes } from "./routes";
⋮----
export type IdPayCodeParamsList = {
  [IdPayCodeRoutes.IDPAY_CODE_DISPLAY]: IdPayCodeDisplayRouteParams;
  [IdPayCodeRoutes.IDPAY_CODE_ONBOARDING]: IdPayCodeOnboardingRouteParams;
  [IdPayCodeRoutes.IDPAY_CODE_RENEW]: undefined;
  [IdPayCodeRoutes.IDPAY_CODE_RESULT]: undefined;
};
</file>

<file path="apps/main-app/ts/features/idpay/code/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/idpay/code/saga/handleIdPayEnrollCode.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idPayEnrollCode } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/code/saga/handleIdPayGenerateCode.ts">
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import {
  RefreshThirdPartyApiCallOptions,
  withThirdPartyRefreshApiCall
} from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idPayGenerateCode } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/code/saga/handleIdPayGetCodeStatus.ts">
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idPayGetCodeStatus } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/code/saga/index.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { SagaIterator } from "redux-saga";
import { put, takeLatest } from "typed-redux-saga/macro";
⋮----
import { IDPayClient } from "../../common/api/client";
import {
  idPayEnrollCode,
  idPayGenerateCode,
  idPayGetCodeStatus
} from "../store/actions";
import { handleIdPayEnrollCode } from "./handleIdPayEnrollCode";
import { handleIdPayGenerateCode } from "./handleIdPayGenerateCode";
import { handleIdPayGetCodeStatus } from "./handleIdPayGetCodeStatus";
</file>

<file path="apps/main-app/ts/features/idpay/code/screens/IdPayCodeDisplayScreen.tsx">
import {
  Banner,
  Body,
  H3,
  IOColors,
  IOMarkdownLite,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { RouteProp, useNavigation, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useEffect } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { useIdPayInfoCieBottomSheet } from "../components/IdPayInfoCieBottomSheet";
import { IdPayCodeParamsList } from "../navigation/params";
import { IdPayCodeRoutes } from "../navigation/routes";
import {
  idPayCodeSelector,
  isIdPayCodeFailureSelector,
  isIdPayCodeLoadingSelector
} from "../store/selectors";
⋮----
type IdPayCodeDisplayRouteParams = {
  isOnboarding?: boolean;
};
⋮----
type IdPayCodeDisplayRouteProps = RouteProp<
  IdPayCodeParamsList,
  "IDPAY_CODE_DISPLAY"
>;
⋮----
const handleContinue = () =>
</file>

<file path="apps/main-app/ts/features/idpay/code/screens/IdPayCodeOnboardingScreen.tsx">
import { RouteProp, useNavigation, useRoute } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import { IOScrollViewCentredContent } from "../../../../components/ui/IOScrollViewCentredContent";
import { shufflePinPadOnPayment } from "../../../../config";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { identificationRequest } from "../../../identification/store/actions";
import { useIdPayInfoCieBottomSheet } from "../components/IdPayInfoCieBottomSheet";
import { IdPayCodeParamsList } from "../navigation/params";
import { IdPayCodeRoutes } from "../navigation/routes";
import { idPayEnrollCode, idPayGenerateCode } from "../store/actions";
import { isIdPayCodeOnboardedSelector } from "../store/selectors";
⋮----
type IdPayCodeOnboardingRouteParams = {
  initiativeId?: string;
};
⋮----
type IdPayCodeOnboardingRouteProps = RouteProp<
  IdPayCodeParamsList,
  "IDPAY_CODE_ONBOARDING"
>;
⋮----
const IdPayCodeOnboardingScreen = () =>
⋮----
const onBiometricAuthenticationSuccess = () =>
⋮----
const requestBiometricAuthentication = () =>
⋮----
const handleContinue = () =>
</file>

<file path="apps/main-app/ts/features/idpay/code/screens/IdPayCodeRenewScreen.tsx">
import { Body, ListItemAction } from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { Alert } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { identificationRequest } from "../../../identification/store/actions";
import { useIdPayInfoCieBottomSheet } from "../components/IdPayInfoCieBottomSheet";
import { IdPayCodeRoutes } from "../navigation/routes";
import { idPayGenerateCode } from "../store/actions";
⋮----
const handleContinue = () =>
⋮----
const handleConfirm = () =>
⋮----
const customAlert = (handleConfirm: ()
</file>

<file path="apps/main-app/ts/features/idpay/code/screens/IdPayCodeResultScreen.tsx">
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { idPayResetCode } from "../store/actions";
import {
  isIdPayCodeEnrollmentRequestFailureSelector,
  isIdPayCodeEnrollmentRequestLoadingSelector,
  isIdPayCodeFailureSelector
} from "../store/selectors";
⋮----
const handleClose = () =>
</file>

<file path="apps/main-app/ts/features/idpay/code/store/actions/index.ts">
import { CheckEnrollmentDTO } from "@io-app/api-types/generated/definitions/idpay/CheckEnrollmentDTO";
import { GenerateCodeRespDTO } from "@io-app/api-types/generated/definitions/idpay/GenerateCodeRespDTO";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
type IdPayGenerateCodePayload = {
  initiativeId?: string;
};
⋮----
type IdPayEnrollCodePayload = {
  initiativeId: string;
};
⋮----
type IdPayCodeCieBannerClosePayloadType = {
  initiativeId: string;
};
⋮----
export type IdPayCodeActions =
  | ActionType<typeof idPayCodeCieBannerClose>
  | ActionType<typeof idPayEnrollCode>
  | ActionType<typeof idPayGenerateCode>
  | ActionType<typeof idPayGetCodeStatus>
  | ActionType<typeof idPayResetCode>;
</file>

<file path="apps/main-app/ts/features/idpay/code/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import {
  idPayCodeCieBannerClose,
  idPayEnrollCode,
  idPayGenerateCode,
  idPayGetCodeStatus,
  idPayResetCode
} from "../actions";
⋮----
export type IdPayCodeState = {
  code: pot.Pot<string, NetworkError>;
  enrollmentRequest: pot.Pot<void, NetworkError>;
  isIdPayInitiativeBannerClosed: Record<string, boolean>;
  isOnboarded: pot.Pot<boolean, NetworkError>;
};
⋮----
const reducer = (
  state: IdPayCodeState = INITIAL_STATE,
  action: Action
): IdPayCodeState =>
</file>

<file path="apps/main-app/ts/features/idpay/code/store/selectors/index.ts">
import { InstrumentTypeEnum } from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
⋮----
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { idpayDiscountInitiativeInstrumentsSelector } from "../../../configuration/store";
import { idpayInitiativeIdSelector } from "../../../details/store";
import { IdPayCodeState } from "../reducers";
⋮----
const idPayCodeStateSelector = (state: GlobalState): IdPayCodeState
⋮----
const isIdPayInitiativeBannerClosedSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/idpay/common/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { IdPayFeatureKey } from "../components/IdPayEnabledFeatureFlagGuard";
⋮----
type EventProperties = {
  featureKey: IdPayFeatureKey;
};
⋮----
export const trackIDPayDisabledFeatureIngressScreen = (
  props: EventProperties
) =>
⋮----
type StaticCodeEventProperties = {
  initiativeId?: string;
  initiativeName?: string;
};
export const trackIDPayStaticCodeGeneration = (
  props: StaticCodeEventProperties
) =>
export const trackIDPayStaticCodeGenerationSuccess = (
  props: StaticCodeEventProperties
) =>
export const trackIDPayStaticCodeGenerationCopy = (
  props: StaticCodeEventProperties
) =>
export const trackIDPayStaticCodeGenerationError = (
  props: StaticCodeEventProperties & {
    reason?: string;
    technicalMessage?: string;
  }
) =>
⋮----
export const trackIDPayFeatureDisabledScreen = () =>
</file>

<file path="apps/main-app/ts/features/idpay/common/api/__mocks__/client.ts">

</file>

<file path="apps/main-app/ts/features/idpay/common/api/client.ts">
import { createClient } from "@io-app/api-types/generated/definitions/idpay/client";
⋮----
import { defaultRetryingFetch } from "../../../../utils/fetch";
⋮----
const createIDPayClient = (baseUrl: string, apiVersion: string)
⋮----
export type IDPayClient = ReturnType<typeof createIDPayClient>;
</file>

<file path="apps/main-app/ts/features/idpay/common/components/IdPayDisabledSubFeatureAlert.tsx">
import I18n from "i18next";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { trackIDPayDisabledFeatureIngressScreen } from "../analytics";
import { IdPayFeatureKey } from "./IdPayEnabledFeatureFlagGuard";
⋮----
type Props = {
  featureKey: IdPayFeatureKey;
};
⋮----
export const IdPayDisabledSubFeatureAlert = (
⋮----
const handleOnPressBack = () =>
</file>

<file path="apps/main-app/ts/features/idpay/common/components/IdPayEnabledFeatureFlagGuard.tsx">
import { PropsWithChildren } from "react";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import {
  isIdPayDetailsEnabledSelector,
  isIdPayOnboardingEnabledSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../store/reducers/types";
import { IdPayDisabledSubFeatureAlert } from "./IdPayDisabledSubFeatureAlert";
⋮----
export type IdPayFeatureKey = "idpay.initiative_details" | "idpay.onboarding";
⋮----
type IdPayEnabledSubFeatureGuardProps = {
  featureKey: IdPayFeatureKey;
};
⋮----
export function IdPayEnabledSubFeatureGuard({
  children,
  featureKey
}: PropsWithChildren<IdPayEnabledSubFeatureGuardProps>)
</file>

<file path="apps/main-app/ts/features/idpay/common/components/IdPayFeatureFlagGuard.tsx">
import { PropsWithChildren } from "react";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { isIdPayEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { IdPayDisabledScreen } from "../screens/IdPayDisabledScreen";
⋮----
export function IdPayFeatureFlagGuard(
</file>

<file path="apps/main-app/ts/features/idpay/common/hooks/useIDPayFailureSupportModal.tsx">
import {
  ListItemAction,
  ListItemHeader,
  ListItemInfoCopy,
  VSpacer
} from "@io-app/design-system";
import {
  addTicketCustomField,
  appendLog,
  resetCustomFields
} from "@io-app/expo-zendesk";
import I18n from "i18next";
import { JSX, useState } from "react";
⋮----
import { useIODispatch } from "../../../../store/hooks";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import {
  defaultZendeskBonusesCategory,
  defaultZendeskIDPayCategory,
  zendeskBonusAndInitiativeCategoryId,
  zendeskCategoryId
} from "../../../../utils/supportAssistance";
import {
  zendeskSelectedCategory,
  zendeskSupportStart
} from "../../../zendesk/store/actions";
import { OnboardingFailureEnum } from "../../onboarding/types/OnboardingFailure";
import { PaymentFailureEnum } from "../../payment/types/PaymentFailure";
⋮----
type IDPayFailureSupportModal = {
  bottomSheet: JSX.Element;
  present: (failure: OnboardingFailureEnum | PaymentFailureEnum) => void;
};
⋮----
const zendeskAssistanceLogAndStart = () =>
⋮----
// attach the main zendesk category to the ticket
⋮----
const handleCopyAllToClipboard = () =>
⋮----
dismiss();
zendeskAssistanceLogAndStart();
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/idpay/common/hooks/useIDPayStaticCodeModal.tsx">
import { TransactionBarCodeResponse } from "@io-app/api-types/generated/definitions/idpay/TransactionBarCodeResponse";
import { TransactionErrorDTO } from "@io-app/api-types/generated/definitions/idpay/TransactionErrorDTO";
import {
  Body,
  ContentWrapper,
  H2,
  Icon,
  IOButton,
  IOColors,
  IOSkeleton,
  IOText,
  IOTypography,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
⋮----
import { flow, pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { JSX } from "react";
import { StyleSheet, View } from "react-native";
import Barcode from "react-native-barcode-builder";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { idPayStaticCodeByInitiativeIdSelector } from "../../barcode/store/selectors";
import {
  trackIDPayStaticCodeGenerationCopy,
  trackIDPayStaticCodeGenerationError,
  trackIDPayStaticCodeGenerationSuccess
} from "../analytics";
⋮----
type IDPayFailureSupportModal = {
  bottomSheet: JSX.Element;
  present: () => void;
};
⋮----
type Props = {
  initiativeId: string;
  initiativeName: string;
  onDismiss: () => void;
};
⋮----
const StaticCodeBottomSheetContent = () =>
⋮----
label=
⋮----
trackIDPayStaticCodeGenerationCopy({
                  initiativeId,
                  initiativeName
                });
clipboardSetStringWithFeedback(barcode.trxCode);
</file>

<file path="apps/main-app/ts/features/idpay/common/hooks/useIdPaySupportModal.tsx">
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  addTicketCustomField,
  assistanceToolRemoteConfig,
  defaultIdPayExpenseCategory,
  resetCustomFields,
  zendeskBonusAndInitiativeCategoryId
} from "../../../../utils/supportAssistance";
import {
  zendeskSelectedCategory,
  zendeskSupportStart
} from "../../../zendesk/store/actions";
⋮----
type PaymentFailureSupportModal = {
  startIdPaySupport: (startingRoute?: string) => void;
};
⋮----
const useIdPaySupportModal = (): PaymentFailureSupportModal =>
⋮----
const zendeskAssistanceLogAndStart = (startingRoute?: string) =>
⋮----
const startIdPaySupport = (startingRoute?: string) =>
</file>

<file path="apps/main-app/ts/features/idpay/common/machine/selectors.ts">
import { AnyMachineSnapshot } from "xstate";
⋮----
import { IdPayTags } from "./tags";
⋮----
export const isLoadingSelector = (snapshot: AnyMachineSnapshot)
⋮----
export const isUpsertingSelector = (snapshot: AnyMachineSnapshot)
</file>

<file path="apps/main-app/ts/features/idpay/common/machine/tags.ts">
export enum IdPayTags {
  DisableButtons = "DisableButtons",
  Loading = "Loading",
  Upserting = "Upserting"
}
</file>

<file path="apps/main-app/ts/features/idpay/common/navigation/linking.ts">
import { PathConfigMap } from "@react-navigation/native";
⋮----
import { AppParamsList } from "../../../../navigation/params/AppParamsList";
import { IDPayDetailsRoutes } from "../../details/navigation";
import { IdPayOnboardingRoutes } from "../../onboarding/navigation/routes";
import { IdPayPaymentRoutes } from "../../payment/navigation/routes";
</file>

<file path="apps/main-app/ts/features/idpay/common/saga/index.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { pipe } from "fp-ts/lib/function";
⋮----
import { SagaIterator } from "redux-saga";
import { fork, select } from "typed-redux-saga/macro";
⋮----
import {
  idPayApiBaseUrl,
  idPayApiUatBaseUrl,
  idPayApiUatVersion,
  idPayApiVersion,
  idPayTestToken
} from "../../../../config";
import { isIdPayCiePaymentCodeEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  isPagoPATestEnabledSelector,
  preferredLanguageSelector
} from "../../../../store/reducers/persistedPreferences";
import { fromLocaleToPreferredLanguage } from "../../../../utils/locale";
import { watchIDPayBarcodeSaga } from "../../barcode/saga";
import { watchIdPayCodeSaga } from "../../code/saga";
import { watchIDPayInitiativeConfigurationSaga } from "../../configuration/saga";
import { watchIDPayInitiativeDetailsSaga } from "../../details/saga";
import { watchIDPayTimelineSaga } from "../../timeline/saga";
import { watchIdPayUnsubscriptionSaga } from "../../unsubscription/saga";
import { watchIDPayWalletSaga } from "../../wallet/saga";
import { createIDPayClient } from "../api/client";
</file>

<file path="apps/main-app/ts/features/idpay/common/screens/IdPayDisabledScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { trackIDPayFeatureDisabledScreen } from "../analytics";
⋮----
export const IdPayDisabledScreen = () =>
⋮----
const handleOnPressClose = () =>
</file>

<file path="apps/main-app/ts/features/idpay/common/store/actions/index.ts">
import {
  IdPayBarcodeActions,
  IdPayStaticCodeActions
} from "../../../barcode/store/actions";
import { IdPayCodeActions } from "../../../code/store/actions";
import { IDPayInitiativeConfigurationActions } from "../../../configuration/store/actions";
import { IdPayInitiativeActions } from "../../../details/store/actions";
import { IdPayTimelineActions } from "../../../timeline/store/actions";
import { IdPayUnsubscriptionActions } from "../../../unsubscription/store/actions";
import { IdPayWalletActions } from "../../../wallet/store/actions";
⋮----
export type IdPayActions =
  | IdPayBarcodeActions
  | IdPayCodeActions
  | IdPayInitiativeActions
  | IDPayInitiativeConfigurationActions
  | IdPayStaticCodeActions
  | IdPayTimelineActions
  | IdPayUnsubscriptionActions
  | IdPayWalletActions;
</file>

<file path="apps/main-app/ts/features/idpay/common/store/reducers/index.ts">
import { combineReducers } from "redux";
import { PersistPartial } from "redux-persist";
⋮----
import { barcodeReducer } from "../../../barcode/store/reducers/barcodeReducer";
import { staticCodeReducer } from "../../../barcode/store/reducers/staticCodeReducer";
import {
  IdPayBarcodeState,
  IdPayStaticCodeState
} from "../../../barcode/store/types";
import codePersistor, { IdPayCodeState } from "../../../code/store/reducers";
import configurationReducer, {
  IdPayInitiativeConfigurationState
} from "../../../configuration/store";
import initiativeDetailsReducer, {
  IdPayInitiativeState
} from "../../../details/store/index";
import timelineReducer, { IdPayTimelineState } from "../../../timeline/store";
import unsubscriptionReducer, {
  IdPayUnsubscriptionState
} from "../../../unsubscription/store/reducers";
import walletReducer, {
  IdPayWalletState
} from "../../../wallet/store/reducers/index";
⋮----
export type IDPayState = {
  barcode: IdPayBarcodeState;
  code: IdPayCodeState & PersistPartial;
  configuration: IdPayInitiativeConfigurationState;
  initiative: IdPayInitiativeState;
  staticCode: IdPayStaticCodeState;
  timeline: IdPayTimelineState;
  unsubscription: IdPayUnsubscriptionState;
  wallet: IdPayWalletState;
};
</file>

<file path="apps/main-app/ts/features/idpay/common/utils/strings.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { format } from "../../../../utils/dates";
import {
  formatNumberAmount,
  formatNumberCentsToAmount
} from "../../../../utils/stringBuilder";
⋮----
export const formatNumberCurrency = (amount: number)
⋮----
export const formatNumberCurrencyCents = (cents: number)
⋮----
export const formatNumberCurrencyOrDefault = (
  input: number | undefined,
  defaultValue = "-"
)
⋮----
export const formatNumberCurrencyCentsOrDefault = (
  input: number | undefined,
  defaultValue = "-"
)
⋮----
export const formatAbsNumberAmountCentsOrDefault = (
  amount: number | undefined,
  defaultValue = "-"
)
⋮----
export const formatDateOrDefault = (
  input?: Date,
  defaultValue = "-",
  dateFormat = "D MMMM YYYY, HH:mm"
)
</file>

<file path="apps/main-app/ts/features/idpay/common/labels.ts">
import { StatusEnum } from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
type InstrumentStatusLabels = {
  [key in StatusEnum]: string;
};
⋮----
const getInstrumentStatusLabel = (status: StatusEnum): string =>
⋮----
type OperationTypeLabels = {
  [key: string]: string;
};
⋮----
export const getLabelForCircuitType = (circuitType: string | undefined)
</file>

<file path="apps/main-app/ts/features/idpay/configuration/components/IdPayDiscountInstrumentEnrollmentSwitch.tsx">
import {
  InstrumentTypeEnum,
  StatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
import {
  Badge,
  IOIcons,
  ListItemSwitch,
  SwitchAction
} from "@io-app/design-system";
import I18n from "i18next";
⋮----
type PaymentMethodSwitchProps = (
  | {
      instrumentType: InstrumentTypeEnum.APP_IO_PAYMENT;
      onValueChange?: never;
      value?: never;
    }
  | {
      instrumentType: ValidInstrumentType;
      onValueChange: (value: boolean) => void;
      value: boolean;
    }
) & {
  isLoading?: boolean;
  onPressAction?: () => void;
  status?: StatusEnum;
};
⋮----
type ValidInstrumentType =
  | InstrumentTypeEnum.APP_IO_PAYMENT
  | InstrumentTypeEnum.IDPAYCODE;
⋮----
const getInstrumentPaymentMethodIcon = (
  paymentType: InstrumentTypeEnum
): IOIcons =>
⋮----
const getInstrumentPaymentMethodBage = (
  instrumentType: InstrumentTypeEnum,
  status?: StatusEnum
) =>
⋮----
const getInstrumentPaymentMethodCopy = (
  instrumentType: ValidInstrumentType
):
⋮----
const IdPayDiscountInstrumentEnrollmentSwitch = (
  props: PaymentMethodSwitchProps
) =>
⋮----
const renderSwitchAction = () =>
⋮----
action=
⋮----
onSwitchValueChange=
</file>

<file path="apps/main-app/ts/features/idpay/configuration/components/IdPayInstrumentEnrollmentSwitch.tsx">
import { StatusEnum as InstrumentStatusEnum } from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
import {
  Badge,
  IOIcons,
  IOLogoPaymentType,
  ListItemSwitch
} from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { CreditCardType, Wallet } from "../../../../types/pagopa";
import { getInstrumentStatusLabel } from "../../common/labels";
import { IdPayConfigurationMachineContext } from "../machine/provider";
import { instrumentStatusByIdWalletSelector } from "../machine/selectors";
⋮----
type InstrumentEnrollmentSwitchProps = {
  isStaged: boolean;
  onValueChange: (value: boolean) => void;
  wallet: Wallet;
};
⋮----
type ListItemSwitchIconProps =
  | { icon: IOIcons; paymentLogo?: never }
  | { icon?: never; paymentLogo: IOLogoPaymentType }
  | { icon?: never; paymentLogo?: never };
⋮----
const IdPayInstrumentEnrollmentSwitch = (
  props: InstrumentEnrollmentSwitchProps
) =>
⋮----
onSwitchValueChange=
⋮----
const getPaymentMaskedPan = (wallet: Wallet): string =>
</file>

<file path="apps/main-app/ts/features/idpay/configuration/machine/actions.ts">
import { IOToast } from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { refreshSessionToken } from "../../../authentication/fastLogin/store/actions/tokenRefreshActions";
import { IDPayDetailsRoutes } from "../../details/navigation";
import { IdPayConfigurationRoutes } from "../navigation/routes";
import { InitiativeFailure, InitiativeFailureType } from "../types/failure";
⋮----
const getFailureMessage = (failure: InitiativeFailure): string =>
⋮----
const createActionsImplementation = (
  navigation: ReturnType<typeof useIONavigation>,
  dispatch: ReturnType<typeof useIODispatch>
) =>
⋮----
const navigateToConfigurationIntro = () =>
const navigateToIbanEnrollmentScreen = ()
const navigateToIbanOnboardingScreen = ()
const navigateToIbanOnboardingFormScreen = ()
const navigateToInstrumentsEnrollmentScreen = ()
const navigateToConfigurationSuccessScreen = () =>
⋮----
const navigateToInitiativeDetailScreen = (args: {
    context: Context.Context;
}) =>
⋮----
const showUpdateIbanToast = () =>
⋮----
const showFailureToast = (args:
⋮----
const exitConfiguration = () =>
⋮----
const handleSessionExpired = () =>
</file>

<file path="apps/main-app/ts/features/idpay/configuration/machine/actors.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { IbanDTO } from "@io-app/api-types/generated/definitions/idpay/IbanDTO";
import { IbanListDTO } from "@io-app/api-types/generated/definitions/idpay/IbanListDTO";
import { IbanPutDTO } from "@io-app/api-types/generated/definitions/idpay/IbanPutDTO";
import { InitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { InstrumentDTO } from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
import { TypeEnum } from "@io-app/api-types/generated/definitions/pagopa/Wallet";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { fromCallback, fromPromise } from "xstate";
⋮----
import { PaymentManagerClient } from "../../../../api/pagopa";
import { PaymentManagerToken, Wallet } from "../../../../types/pagopa";
import { SessionManager } from "../../../../utils/SessionManager";
import { convertWalletV2toWalletV1 } from "../../../../utils/walletv2";
import { IDPayClient } from "../../common/api/client";
import { InitiativeFailureType } from "../types/failure";
import { IdPayConfigurationEvents } from "./events";
⋮----
export const createActorsImplementation = (
  idPayClient: IDPayClient,
  paymentManagerClient: PaymentManagerClient,
  pmSessionManager: SessionManager<PaymentManagerToken>,
  bearerToken: string,
  language: PreferredLanguageEnum
) =>
⋮----
const enrollInstrument = async (initiativeId?: string, idWallet?: string) =>
⋮----
const deleteInstrument = async (
    initiativeId?: string,
    instrumentId?: string
) =>
</file>

<file path="apps/main-app/ts/features/idpay/configuration/machine/context.ts">
import { IbanDTO } from "@io-app/api-types/generated/definitions/idpay/IbanDTO";
import { InitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { InstrumentDTO } from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
⋮----
import { Wallet } from "../../../../types/pagopa";
import { ConfigurationMode, InstrumentStatusByIdWallet } from "../types";
import { InitiativeFailureType } from "../types/failure";
⋮----
export type Context = {
  readonly areInstrumentsSkipped: boolean;
  readonly failure: O.Option<InitiativeFailureType>;
  readonly ibanList: ReadonlyArray<IbanDTO>;
  readonly initiative: O.Option<InitiativeDTO>;
  readonly initiativeId: string;
  readonly initiativeInstruments: ReadonlyArray<InstrumentDTO>;
  readonly instrumentStatuses: InstrumentStatusByIdWallet;
  readonly mode: ConfigurationMode;
  readonly walletInstruments: ReadonlyArray<Wallet>;
};
</file>

<file path="apps/main-app/ts/features/idpay/configuration/machine/events.ts">
import { IbanDTO } from "@io-app/api-types/generated/definitions/idpay/IbanDTO";
import { IbanPutDTO } from "@io-app/api-types/generated/definitions/idpay/IbanPutDTO";
⋮----
import { ConfigurationMode } from "../types";
⋮----
export type IdPayConfigurationEvents =
  | Back
  | Close
  | ConfirmIbanOnboarding
  | DeleteInstrument
  | EnrollIban
  | EnrollInstrument
  | NewIbanOnboarding
  | Next
  | SkipInstruments
  | StartConfiguration
  | UpdateInstrumentFailure
  | UpdateInstrumentSuccess;
⋮----
type Back = {
  readonly type: "back";
};
⋮----
type Close = {
  readonly type: "close";
};
⋮----
type ConfirmIbanOnboarding = {
  readonly ibanBody: IbanPutDTO;
  readonly type: "confirm-iban-onboarding";
};
⋮----
type DeleteInstrument = {
  readonly instrumentId: string;
  readonly type: "delete-instrument";
  readonly walletId: string;
};
⋮----
type EnrollIban = {
  readonly iban: IbanDTO;
  readonly type: "enroll-iban";
};
⋮----
type EnrollInstrument = {
  readonly type: "enroll-instrument";
  readonly walletId: string;
};
⋮----
type NewIbanOnboarding = {
  readonly type: "new-iban-onboarding";
};
⋮----
type Next = {
  readonly type: "next";
};
⋮----
type SkipInstruments = {
  readonly type: "skip-instruments";
};
⋮----
type StartConfiguration = {
  readonly initiativeId: string;
  readonly mode: ConfigurationMode;
  readonly type: "start-configuration";
};
⋮----
type UpdateInstrumentFailure = {
  readonly type: "update-instrument-failure";
  readonly walletId: string;
};
⋮----
type UpdateInstrumentSuccess = {
  readonly enrolling: boolean;
  readonly type: "update-instrument-success";
  readonly walletId: string;
};
</file>

<file path="apps/main-app/ts/features/idpay/configuration/machine/machine.ts">
import { IbanDTO } from "@io-app/api-types/generated/definitions/idpay/IbanDTO";
import { IbanListDTO } from "@io-app/api-types/generated/definitions/idpay/IbanListDTO";
import { IbanPutDTO } from "@io-app/api-types/generated/definitions/idpay/IbanPutDTO";
import {
  InitiativeDTO,
  StatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import {
  InstrumentDTO,
  StatusEnum as InstrumentStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
⋮----
import { flow, pipe } from "fp-ts/lib/function";
⋮----
import {
  assertEvent,
  assign,
  forwardTo,
  fromCallback,
  fromPromise,
  setup
} from "xstate";
⋮----
import { Wallet } from "../../../../types/pagopa";
import { IdPayTags } from "../../common/machine/tags";
import { ConfigurationMode, InstrumentStatusByIdWallet } from "../types";
import { InitiativeFailure, InitiativeFailureType } from "../types/failure";
import { Context, InitialContext } from "./context";
import { IdPayConfigurationEvents } from "./events";
⋮----
const notImplementedStub = () =>
⋮----
export type IdPayConfigurationMachine = typeof idPayConfigurationMachine;
</file>

<file path="apps/main-app/ts/features/idpay/configuration/machine/provider.tsx">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { createActorContext } from "@xstate/react";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { ReactNode } from "react";
⋮----
import { PaymentManagerClient } from "../../../../api/pagopa";
import {
  fetchPaymentManagerLongTimeout,
  idPayApiBaseUrl,
  idPayApiUatBaseUrl,
  idPayApiUatVersion,
  idPayApiVersion,
  idPayTestToken,
  pagoPaApiUrlPrefix,
  pagoPaApiUrlPrefixTest
} from "../../../../config";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  isPagoPATestEnabledSelector,
  preferredLanguageSelector
} from "../../../../store/reducers/persistedPreferences";
import { defaultRetryingFetch } from "../../../../utils/fetch";
import { fromLocaleToPreferredLanguage } from "../../../../utils/locale";
import { SessionManager } from "../../../../utils/SessionManager";
import {
  bpdTokenSelector,
  walletTokenSelector
} from "../../../authentication/common/store/selectors";
import { createIDPayClient } from "../../common/api/client";
import { createActionsImplementation } from "./actions";
import { createActorsImplementation } from "./actors";
import { idPayConfigurationMachine } from "./machine";
⋮----
type Props = {
  children: ReactNode;
};
⋮----
export const IDPayConfigurationMachineProvider = (
⋮----
const getPaymentManagerSession = async () =>
</file>

<file path="apps/main-app/ts/features/idpay/configuration/machine/selectors.ts">
import { InstrumentDTO } from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
⋮----
import { createSelector } from "reselect";
import { StateFrom } from "xstate";
⋮----
import { ConfigurationMode } from "../types";
import { IdPayConfigurationMachine } from "./machine";
⋮----
type IDPayInstrumentsByIdWallet = {
  [idWallet: string]: InstrumentDTO;
};
⋮----
type MachineSnapshot = StateFrom<IdPayConfigurationMachine>;
⋮----
const selectInitiativeDetails = (snapshot: MachineSnapshot)
⋮----
const selectIsInstrumentsOnlyMode = (snapshot: MachineSnapshot)
⋮----
const selectIsIbanOnlyMode = (snapshot: MachineSnapshot)
⋮----
const isLoadingIbanListSelector = (snapshot: MachineSnapshot)
⋮----
const ibanListSelector = (snapshot: MachineSnapshot)
⋮----
const selectAreInstrumentsSkipped = (snapshot: MachineSnapshot)
⋮----
const selectWalletInstruments = (snapshot: MachineSnapshot)
⋮----
const selectInitiativeInstruments = (snapshot: MachineSnapshot)
⋮----
const selectInstrumentStatuses = (snapshot: MachineSnapshot)
⋮----
const instrumentStatusByIdWalletSelector = (idWallet: number)
⋮----
const failureSelector = (snapshot: MachineSnapshot)
</file>

<file path="apps/main-app/ts/features/idpay/configuration/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../utils/navigation";
import { IdPayFeatureFlagGuard } from "../../common/components/IdPayFeatureFlagGuard";
import {
  IdPayConfigurationMachineContext,
  IDPayConfigurationMachineProvider
} from "../machine/provider";
import { IdPayConfigurationSuccessScreen } from "../screens/IdPayConfigurationSuccessScreen";
import { IdPayDiscountInstrumentsScreen } from "../screens/IdPayDiscountInstrumentsScreen";
import { IdPayIbanConfigurationLandingScreen } from "../screens/IdPayIbanConfigurationLandingScreen";
import { IdPayIbanEnrollmentScreen } from "../screens/IdPayIbanEnrollmentScreen";
import { IdPayIbanOnboardingScreen } from "../screens/IdPayIbanOnboardingScreen";
import { IdPayInitiativeConfigurationIntroScreen } from "../screens/IdPayInitiativeConfigurationIntroScreen";
import { IdPayInstrumentsEnrollmentScreen } from "../screens/IdPayInstrumentsEnrollmentScreen";
import { IdPayConfigurationParamsList } from "./params";
import { IdPayConfigurationRoutes } from "./routes";
</file>

<file path="apps/main-app/ts/features/idpay/configuration/navigation/params.ts">
import { IdPayDiscountInstrumentsScreenRouteParams } from "../screens/IdPayDiscountInstrumentsScreen";
import { IdPayIbanEnrollmentScreenParams } from "../screens/IdPayIbanEnrollmentScreen";
import { IdPayInitiativeConfigurationIntroScreenParams } from "../screens/IdPayInitiativeConfigurationIntroScreen";
import { IdPayInstrumentsEnrollmentScreenParams } from "../screens/IdPayInstrumentsEnrollmentScreen";
import { IdPayConfigurationRoutes } from "./routes";
⋮----
export type IdPayConfigurationParamsList = {
  [IdPayConfigurationRoutes.IDPAY_CONFIGURATION_DISCOUNT_INSTRUMENTS]: IdPayDiscountInstrumentsScreenRouteParams;
  [IdPayConfigurationRoutes.IDPAY_CONFIGURATION_IBAN_ENROLLMENT]: IdPayIbanEnrollmentScreenParams;
  [IdPayConfigurationRoutes.IDPAY_CONFIGURATION_IBAN_LANDING]: undefined;
  [IdPayConfigurationRoutes.IDPAY_CONFIGURATION_IBAN_ONBOARDING]: undefined;
  [IdPayConfigurationRoutes.IDPAY_CONFIGURATION_INSTRUMENTS_ENROLLMENT]: IdPayInstrumentsEnrollmentScreenParams;
  [IdPayConfigurationRoutes.IDPAY_CONFIGURATION_INTRO]: IdPayInitiativeConfigurationIntroScreenParams;
  [IdPayConfigurationRoutes.IDPAY_CONFIGURATION_SUCCESS]: undefined;
};
</file>

<file path="apps/main-app/ts/features/idpay/configuration/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/idpay/configuration/saga/handleDeleteInitiativeInstrument.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import {
  idpayInitiativeInstrumentDelete,
  idpayInitiativeInstrumentsGet
} from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/configuration/saga/handleGetInitiativeInstruments.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, delay, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idpayInitiativeInstrumentsGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/configuration/saga/index.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { channel, SagaIterator } from "redux-saga";
import {
  call,
  put,
  race,
  take,
  takeEvery,
  takeLatest
} from "typed-redux-saga/macro";
⋮----
import { IDPayClient } from "../../common/api/client";
import {
  idpayInitiativeInstrumentDelete,
  idpayInitiativeInstrumentsGet,
  IdPayInitiativeInstrumentsGetPayloadType,
  idPayInitiativeInstrumentsRefreshStart,
  idPayInitiativeInstrumentsRefreshStop
} from "../store/actions";
import { handleDeleteInitiativeInstruments } from "./handleDeleteInitiativeInstrument";
import {
  handleGetInitiativeInstruments,
  handleInitiativeInstrumentsRefresh
} from "./handleGetInitiativeInstruments";
</file>

<file path="apps/main-app/ts/features/idpay/configuration/screens/IdPayConfigurationSuccessScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { PaymentsOnboardingRoutes } from "../../../payments/onboarding/navigation/routes";
import { IdPayConfigurationMachineContext } from "../machine/provider";
import {
  selectAreInstrumentsSkipped,
  selectInitiativeDetails
} from "../machine/selectors";
⋮----
export const IdPayConfigurationSuccessScreen = () =>
⋮----
const handleNavigateToInitiativePress = () => machine.send(
⋮----
const handleAddPaymentMethodButtonPress = ()
⋮----
const renderActionsProps = () =>
</file>

<file path="apps/main-app/ts/features/idpay/configuration/screens/IdPayDiscountInstrumentsScreen.tsx">
import { InstrumentTypeEnum } from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
import { Divider } from "@io-app/design-system";
⋮----
import {
  RouteProp,
  useFocusEffect,
  useNavigation,
  useRoute
} from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { IOStackNavigationProp } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useIdPayInfoCieBottomSheet } from "../../code/components/IdPayInfoCieBottomSheet";
import { IdPayCodeParamsList } from "../../code/navigation/params";
import { IdPayCodeRoutes } from "../../code/navigation/routes";
import { IdPayDiscountInstrumentEnrollmentSwitch } from "../components/IdPayDiscountInstrumentEnrollmentSwitch";
import { IdPayConfigurationParamsList } from "../navigation/params";
import {
  idpayDiscountInitiativeInstrumentsSelector,
  idPayIsLoadingInitiativeInstrumentSelector,
  isLoadingDiscountInitiativeInstrumentsSelector
} from "../store";
import {
  idpayInitiativeInstrumentDelete,
  idPayInitiativeInstrumentsRefreshStart,
  idPayInitiativeInstrumentsRefreshStop
} from "../store/actions";
⋮----
export type IdPayDiscountInstrumentsScreenRouteParams = {
  initiativeId: string;
  initiativeName?: string;
};
⋮----
type IdPayDiscountInstrumentsScreenRouteProps = RouteProp<
  IdPayConfigurationParamsList,
  "IDPAY_CONFIGURATION_DISCOUNT_INSTRUMENTS"
>;
⋮----
const handleCieValueChange = (value: boolean) =>
</file>

<file path="apps/main-app/ts/features/idpay/configuration/screens/IdPayIbanConfigurationLandingScreen.tsx">
import { Body, ContentWrapper, IOButton, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { IdPayConfigurationMachineContext } from "../machine/provider";
⋮----
export const IdPayIbanConfigurationLandingScreen = () =>
⋮----
const customGoBack = () => machine.send(
⋮----
label=
</file>

<file path="apps/main-app/ts/features/idpay/configuration/screens/IdPayIbanEnrollmentScreen.tsx">
import { FeatureInfo, RadioGroup, VSpacer } from "@io-app/design-system";
import { RouteProp, useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { ComponentProps, useCallback, useEffect, useState } from "react";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import {
  isLoadingSelector,
  isUpsertingSelector
} from "../../common/machine/selectors";
import { IdPayConfigurationMachineContext } from "../machine/provider";
import {
  ibanListSelector,
  selectEnrolledIban,
  selectIsIbanOnlyMode
} from "../machine/selectors";
import { IdPayConfigurationParamsList } from "../navigation/params";
import { ConfigurationMode } from "../types";
⋮----
export type IdPayIbanEnrollmentScreenParams = {
  initiativeId?: string;
};
⋮----
type RouteProps = RouteProp<
  IdPayConfigurationParamsList,
  "IDPAY_CONFIGURATION_IBAN_ENROLLMENT"
>;
⋮----
const handleBackPress = () =>
⋮----
const handleContinuePress = () =>
⋮----
const handleAddNewIbanPress = () =>
⋮----
const renderActionProps = (): ComponentProps<
    typeof IOScrollView
  >["actions"] => {
if (isIbanOnly)
⋮----
actions=
⋮----
body=
</file>

<file path="apps/main-app/ts/features/idpay/configuration/screens/IdPayIbanOnboardingScreen.tsx">
import {
  FeatureInfo,
  TextInputValidation,
  VSpacer
} from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useState } from "react";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { isLoadingSelector } from "../../common/machine/selectors";
import { IdPayConfigurationMachineContext } from "../machine/provider";
import { IbanSchema } from "../types";
⋮----
onChangeText=
⋮----
body=
</file>

<file path="apps/main-app/ts/features/idpay/configuration/screens/IdPayInitiativeConfigurationIntroScreen.tsx">
import {
  BodySmall,
  H6,
  Icon,
  IOColors,
  IOIcons,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { RouteProp, useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { View } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { isLoadingSelector } from "../../common/machine/selectors";
import { IdPayConfigurationMachineContext } from "../machine/provider";
import { IdPayConfigurationParamsList } from "../navigation/params";
import { ConfigurationMode } from "../types";
⋮----
export type IdPayInitiativeConfigurationIntroScreenParams = {
  initiativeId?: string;
  mode?: ConfigurationMode;
};
⋮----
type RouteProps = RouteProp<
  IdPayConfigurationParamsList,
  "IDPAY_CONFIGURATION_INTRO"
>;
⋮----
const handleContinuePress = () =>
</file>

<file path="apps/main-app/ts/features/idpay/configuration/screens/IdPayInstrumentsEnrollmentScreen.tsx">
import {
  Body,
  FeatureInfo,
  FooterActionsInline,
  VSpacer
} from "@io-app/design-system";
import { RouteProp, useFocusEffect, useRoute } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { ComponentProps, useCallback, useEffect, useState } from "react";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { Wallet } from "../../../../types/pagopa";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { PaymentsOnboardingRoutes } from "../../../payments/onboarding/navigation/routes";
import { isLoadingSelector } from "../../common/machine/selectors";
import { IdPayInstrumentEnrollmentSwitch } from "../components/IdPayInstrumentEnrollmentSwitch";
import { IdPayConfigurationMachineContext } from "../machine/provider";
import {
  failureSelector,
  initiativeInstrumentsByIdWalletSelector,
  isUpsertingInstrumentSelector,
  selectInitiativeDetails,
  selectIsInstrumentsOnlyMode,
  selectWalletInstruments
} from "../machine/selectors";
import { IdPayConfigurationParamsList } from "../navigation/params";
import { ConfigurationMode } from "../types";
import { InitiativeFailureType } from "../types/failure";
⋮----
export type IdPayInstrumentsEnrollmentScreenParams = {
  initiativeId?: string;
};
⋮----
type RouteProps = RouteProp<
  IdPayConfigurationParamsList,
  "IDPAY_CONFIGURATION_INSTRUMENTS_ENROLLMENT"
>;
⋮----
const handleBackPress = () => machine.send(
⋮----
const handleSkipButton = () => machine.send(
⋮----
const handleContinueButton = () => machine.send(
⋮----
const handleAddPaymentMethodButton = ()
⋮----
const handleEnrollConfirm = () =>
⋮----
actions=
⋮----
body=
</file>

<file path="apps/main-app/ts/features/idpay/configuration/store/actions/index.ts">
import { InstrumentListDTO } from "@io-app/api-types/generated/definitions/idpay/InstrumentListDTO";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type IdPayInitiativeInstrumentsGetPayloadType = {
  initiativeId: string;
  isRefreshing?: boolean;
};
⋮----
type IdPayInitiativeInstrumentsDeleteErrorPayloadType = {
  error: NetworkError;
  instrumentId: string;
};
⋮----
type IdPayInitiativeInstrumentsDeletePayloadType = {
  initiativeId: string;
  instrumentId: string;
};
⋮----
export type IDPayInitiativeConfigurationActions = ActionType<
  | typeof idpayInitiativeInstrumentDelete
  | typeof idpayInitiativeInstrumentsGet
  | typeof idPayInitiativeInstrumentsRefreshStart
  | typeof idPayInitiativeInstrumentsRefreshStop
>;
</file>

<file path="apps/main-app/ts/features/idpay/configuration/store/index.ts">
import { StatusEnum } from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
import { InstrumentListDTO } from "@io-app/api-types/generated/definitions/idpay/InstrumentListDTO";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import {
  idpayInitiativeInstrumentDelete,
  idpayInitiativeInstrumentsGet
} from "./actions";
⋮----
export type IdPayInitiativeConfigurationState = {
  instruments: pot.Pot<InstrumentListDTO, NetworkError>;
  instrumentStatus: Record<string, pot.Pot<StatusEnum, NetworkError>>;
};
⋮----
const reducer = (
  state: IdPayInitiativeConfigurationState = INITIAL_STATE,
  action: Action
): IdPayInitiativeConfigurationState =>
⋮----
const idpayInitativeConfigurationSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/idpay/configuration/types/failure.ts">
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
export enum InitiativeFailureType {
  GENERIC = "GENERIC",
  IBAN_ENROLL_FAILURE = "IBAN_ENROLL_FAILURE",
  IBAN_LIST_LOAD_FAILURE = "IBAN_LIST_LOAD_FAILURE",
  INITIATIVE_ERROR = "INITIATIVE_ERROR",
  INSTRUMENT_DELETE_FAILURE = "INSTRUMENT_DELETE_FAILURE",
  INSTRUMENT_ENROLL_FAILURE = "INSTRUMENT_ENROLL_FAILURE",
  INSTRUMENTS_LIST_LOAD_FAILURE = "INSTRUMENTS_LIST_LOAD_FAILURE",
  SESSION_EXPIRED = "SESSION_EXPIRED",
  TOO_MANY_REQUESTS = "TOO_MANY_REQUESTS"
}
export type InitiativeFailure = t.TypeOf<typeof InitiativeFailure>;
</file>

<file path="apps/main-app/ts/features/idpay/configuration/types/index.ts">
import { StatusEnum as InstrumentStatusEnum } from "@io-app/api-types/generated/definitions/idpay/InstrumentDTO";
⋮----
import { z } from "zod";
⋮----
export enum ConfigurationMode {
  COMPLETE = "COMPLETE",
  IBAN = "IBAN",
  INSTRUMENTS = "INSTRUMENTS"
}
⋮----
export type InstrumentStatusByIdWallet = {
  [idWallet: string]: pot.Pot<InstrumentStatusEnum | undefined, Error>;
};
</file>

<file path="apps/main-app/ts/features/idpay/details/analytics/index.ts">
import { VoucherStatusEnum } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { NetworkError } from "../../../../utils/errors";
import { getNetworkErrorFailureReason } from "../../../../utils/failureReason";
⋮----
type DefaultOnboardingEventProperties = {
  initiativeId?: string;
  initiativeName?: string;
};
⋮----
const mapIDPayDetailStatusToMixpanel = (
  status?: VoucherStatusEnum
): "about_to_expire" | "expired" | "spent" | "valid" | undefined =>
⋮----
export const trackIDPayDetailLanding = (
  props: DefaultOnboardingEventProperties & {
    status?: VoucherStatusEnum;
  }
) =>
⋮----
export const trackIDPayDetailRetailersClick = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailAuthorizationStart = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailInfoAction = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailBottomSheetLanding = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailQRCodeScan = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailCodeGeneration = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailManualEntryLanding = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailManualEntryConfirm = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailAuthorizationSummary = (
  props: DefaultOnboardingEventProperties & {
    data_entry: "manual" | "qr_code";
  }
) =>
⋮----
export const trackIDPayDetailAuthorizationConversion = (
  props: DefaultOnboardingEventProperties & {
    data_entry: "manual" | "qr_code";
  }
) =>
⋮----
export const trackIDPayDetailAuthorizationCancel = (
  props: DefaultOnboardingEventProperties & {
    data_entry: "manual" | "qr_code";
  }
) =>
⋮----
export const trackIDPayDetailAuthorizationUXSuccess = (
  props: DefaultOnboardingEventProperties & {
    data_entry: "manual" | "qr_code";
  }
) =>
⋮----
export const trackIDPayDetailAuthorizationError = (
  props: DefaultOnboardingEventProperties & {
    data_entry: "manual" | "qr_code";
    reason?: string;
  }
) =>
⋮----
export const trackIDPayDetailCodeGenerationError = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailCodeGenerationCopy = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailCodeGenerationConversion = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayDetailCodeExpired = (
  props: DefaultOnboardingEventProperties
) =>
... (19 lines truncated)
</file>

<file path="apps/main-app/ts/features/idpay/details/components/IdPayBeneficiaryDetailsContent.tsx">
import { InitiativeDetailDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDetailDTO";
import {
  InitiativeDTO,
  InitiativeRewardTypeEnum,
  VoucherStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import {
  RewardValueDTO,
  RewardValueTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/RewardValueDTO";
import {
  Divider,
  IOSkeleton,
  ListItemAction,
  ListItemHeader,
  ListItemInfo,
  ListItemTransaction,
  VSpacer,
  WithTestID
} from "@io-app/design-system";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { useNavigation } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback } from "react";
import { View } from "react-native";
⋮----
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { format } from "../../../../utils/dates";
import { SERVICES_ROUTES } from "../../../services/common/navigation/routes";
import { idPayGenerateStaticCode } from "../../barcode/store/actions";
import { trackIDPayStaticCodeGeneration } from "../../common/analytics";
import { useIDPayStaticCodeModal } from "../../common/hooks/useIDPayStaticCodeModal";
import { useIdPaySupportModal } from "../../common/hooks/useIdPaySupportModal";
import { formatNumberCurrencyCentsOrDefault } from "../../common/utils/strings";
import { IDPayDetailsRoutes } from "../navigation";
import {
  idPayBeneficiaryDetailsGet,
  idPayOnboardingStatusGet
} from "../store/actions";
import {
  IdPayInitiativeRulesInfoBox,
  IdPayInitiativeRulesInfoBoxSkeleton
} from "./IdPayInitiativeRulesInfoBox";
import { IdPayInitiativeStatusItem } from "./IdPayInitiativeStatusItem";
⋮----
export type BeneficiaryDetailsProps =
  | {
      beneficiaryDetails: InitiativeDetailDTO;
      initiativeDetails: InitiativeDTO;
      isLoading?: false;
    }
  | {
      beneficiaryDetails?: never;
      initiativeDetails?: never;
      isLoading: true;
    };
⋮----
type TableRow = WithTestID<{
  label: string;
  value?: string;
}>;
⋮----
const formatDate = (fmt: string)
⋮----
const getTypeDependantTableRows = (): Array<TableRow> =>
⋮----
const handlePrivacyLinkPress = ()
⋮----
const handleRequestHelpPress = () =>
⋮----
const renderTableRow = (data: Array<TableRow>)
⋮----
const handleGenerateStaticCode = () =>
⋮----
</file>

<file path="apps/main-app/ts/features/idpay/details/components/IdPayInitiativeDiscountSettingsComponent.tsx">
import { InitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { IOSkeleton, ListItemHeader, ListItemNav } from "@io-app/design-system";
import { useNavigation } from "@react-navigation/core";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { IOStackNavigationProp } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { isIdPayCiePaymentCodeEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { IdPayConfigurationParamsList } from "../../configuration/navigation/params";
import { IdPayConfigurationRoutes } from "../../configuration/navigation/routes";
⋮----
type Props = {
  initiative: InitiativeDTO;
};
⋮----
const IdPayInitiativeDiscountSettingsComponent = (props: Props) =>
⋮----
const navigateToInstrumentsConfiguration = ({
    initiativeId,
    initiativeName
}: InitiativeDTO) =>
</file>

<file path="apps/main-app/ts/features/idpay/details/components/IdPayInitiativeLastUpdateCounter.tsx">
import { BodySmall, IOSkeleton } from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { format } from "../../../../utils/dates";
⋮----
type Props = { isLoading: true } | { isLoading?: false; lastUpdateDate?: Date };
⋮----
const IdPayInitiativeLastUpdateCounter = (props: Props) =>
</file>

<file path="apps/main-app/ts/features/idpay/details/components/IdPayInitiativeRefundSettingsComponent.tsx">
import {
  InitiativeDTO,
  StatusEnum as InitiativeStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import {
  IOSkeleton,
  ListItemHeader,
  ListItemNav,
  ListItemNavAlert
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/core";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { View } from "react-native";
⋮----
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { IdPayConfigurationRoutes } from "../../configuration/navigation/routes";
⋮----
type Props = {
  initiative?: InitiativeDTO;
};
⋮----
const IdPayInitiativeRefundSettingsComponent = (props: Props) =>
⋮----
const navigateToInstrumentsConfiguration = (initiativeId: string) =>
⋮----
const navigateToIbanConfiguration = (initiativeId: string) =>
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/idpay/details/components/IdPayInitiativeRulesInfoBox.tsx">
import {
  Body,
  H6,
  IOButton,
  IOColors,
  IOSkeleton,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { markdownToPlainText } from "../../../../utils/markdown";
import { isAndroid } from "../../../../utils/platform";
⋮----
type Props = {
  content: string;
};
⋮----
label=
</file>

<file path="apps/main-app/ts/features/idpay/details/components/IdPayInitiativeStatusItem.tsx">
import {
  StatusEnum,
  VoucherStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { Badge, Divider, H6, IOListItemStyles } from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps } from "react";
import { View } from "react-native";
⋮----
const getStatusBadgeVariant = (
  status: StatusEnum | VoucherStatusEnum
): ComponentProps<typeof Badge>["variant"] =>
⋮----
const getStatusLabel = (status: StatusEnum | VoucherStatusEnum): string =>
⋮----
type IdPayInitiativeStatusItemProps = {
  status: StatusEnum;
  voucherStatus?: VoucherStatusEnum;
};
</file>

<file path="apps/main-app/ts/features/idpay/details/components/IdPayInitiativeTimelineComponent.tsx">
import { InitiativeRewardTypeEnum } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import {
  BannerErrorState,
  Body,
  BodySmall,
  Divider,
  H6,
  ListItemHeader,
  VSpacer
} from "@io-app/design-system";
⋮----
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { ComponentProps, Fragment, useEffect } from "react";
import { View } from "react-native";
⋮----
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useIdPayTimelineDetailsBottomSheet } from "../../timeline/components/IdPayTimelineDetailsBottomSheet";
import { trackIDPayDetailTimelineError } from "../analytics";
import { IDPayDetailsRoutes } from "../navigation";
import {
  idpayInitiativeDetailsSelector,
  idpayOperationListSelector,
  idpayPaginatedTimelineSelector
} from "../store";
import { idpayTimelinePageGet } from "../store/actions";
import { IdPayTimelineOperationListItem } from "./IdPayTimelineOperationListItem";
⋮----
type Props = {
  initiativeId: string;
  size?: number;
};
⋮----
const IdPayInitiativeTimelineComponent = ({
  initiativeId,
  size = 3
}: Props) =>
⋮----
const navigateToOperationsList = () =>
⋮----
const fetchTimelineData = ()
⋮----
const renderTimelineContent = () =>
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/idpay/details/components/IdPayMissingConfigurationAlert.tsx">
import { StatusEnum as InitiativeStatusEnum } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { Alert, VSpacer } from "@io-app/design-system";
import { NavigatorScreenParams } from "@react-navigation/native";
import I18n from "i18next";
import { createRef } from "react";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { IdPayConfigurationParamsList } from "../../configuration/navigation/params";
import { IdPayConfigurationRoutes } from "../../configuration/navigation/routes";
⋮----
type Props = {
  initiativeId: string;
  status: InitiativeStatusEnum;
};
⋮----
type StatusWithAlert = Exclude<
  InitiativeStatusEnum,
  | InitiativeStatusEnum.REFUNDABLE
  | InitiativeStatusEnum.SUSPENDED
  | InitiativeStatusEnum.UNSUBSCRIBED
>;
⋮----
const getAlertCopy = (
  status: StatusWithAlert
):
⋮----
const IdPayMissingConfigurationAlert = (props: Props) =>
⋮----
const handleNavigation = () =>
</file>

<file path="apps/main-app/ts/features/idpay/details/components/IdPayRemoveFromWalletButton.tsx">
import {
  InitiativeDTO,
  VoucherStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { ListItemAction } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
import { Alert, Platform } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { IdPayUnsubscriptionRoutes } from "../../unsubscription/navigation/routes";
import { idPayUnsubscribeAction } from "../../unsubscription/store/actions";
import {
  isFailureSelector,
  isUnsubscriptionSuccessSelector
} from "../../unsubscription/store/selectors";
⋮----
const IdPayRemoveFromWalletButton = (initiative: InitiativeDTO) =>
⋮----
const showAlert = () =>
</file>

<file path="apps/main-app/ts/features/idpay/details/components/IdPayTimelineOperationListItem.tsx">
import {
  IbanOperationDTO,
  OperationTypeEnum as IbanOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/IbanOperationDTO";
import {
  InstrumentOperationDTO,
  OperationTypeEnum as InstrumentOperationTypeEnum,
  InstrumentTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/InstrumentOperationDTO";
import {
  OnboardingOperationDTO,
  OperationTypeEnum as OnboardingOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/OnboardingOperationDTO";
import { OperationListDTO } from "@io-app/api-types/generated/definitions/idpay/OperationListDTO";
import {
  ReadmittedOperationDTO,
  OperationTypeEnum as ReadmittedOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/ReadmittedOperationDTO";
import {
  RefundOperationDTO,
  OperationTypeEnum as RefundOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/RefundOperationDTO";
import {
  RejectedInstrumentOperationDTO,
  OperationTypeEnum as RejectedInstrumentOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/RejectedInstrumentOperationDTO";
import {
  SuspendOperationDTO,
  OperationTypeEnum as SuspendOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/SuspendOperationDTO";
import {
  ChannelEnum,
  TransactionOperationDTO,
  OperationTypeEnum as TransactionOperationTypeEnum,
  StatusEnum as TransactionStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/TransactionOperationDTO";
import {
  UnsubscribeOperationDTO,
  OperationTypeEnum as UnsubscribeOperationTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/UnsubscribeOperationDTO";
import {
  Icon,
  ListItemTransaction,
  ListItemTransactionLogo,
  WithTestID
} from "@io-app/design-system";
import I18n from "i18next";
⋮----
import {
  getAccessibleAmountText,
  hoursAndMinutesToAccessibilityReadableFormat
} from "../../../../utils/accessibility";
import { getBadgePropsByTransactionStatus } from "../../../payments/common/utils";
import { formatAbsNumberAmountCentsOrDefault } from "../../common/utils/strings";
⋮----
type TimelineOperationListItemProps = WithTestID<
  | { isLoading: true; onPress?: never; operation?: never; pressable?: never }
  | {
      isLoading?: false;
      onPress?: () => void;
      operation: OperationListDTO;
      pressable?: boolean;
    }
>;
⋮----
switch (operation.operationType)
⋮----
const getAccruedString = () =>
⋮----
const getTitle = (): string =>
⋮----
if (instrumentType === InstrumentTypeEnum.IDPAYCODE)
⋮----
const getIbanOperationProps = (
  operation: IbanOperationDTO
): ListItemTransaction => (
</file>

<file path="apps/main-app/ts/features/idpay/details/hooks/useIdPayDiscountDetailsBottomSheet.tsx">
import { Divider, ListItemNav, VSpacer } from "@io-app/design-system";
⋮----
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isIdPayQrCodeFeatureEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { IdPayBarcodeRoutes } from "../../barcode/navigation/routes";
import { idPayGenerateBarcode } from "../../barcode/store/actions";
import { idPayBarcodeSecondsTillExpireSelector } from "../../barcode/store/selectors";
import { IdPayPaymentRoutes } from "../../payment/navigation/routes";
import {
  trackIDPayDetailCodeGeneration,
  trackIDPayDetailQRCodeScan
} from "../analytics";
import { idpayInitiativeDetailsSelector } from "../store";
⋮----
const navigateToPaymentAuthorization = () =>
⋮----
const barcodePressHandler = () =>
⋮----
bottomSheet.dismiss();
navigateToPaymentAuthorization();
trackIDPayDetailQRCodeScan({
                initiativeId,
                initiativeName
              });
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/idpay/details/hooks/useInitiativeTimelineFetcher.tsx">
import { useEffect, useState } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  idpayOperationListSelector,
  idpayPaginatedTimelineSelector,
  idpayTimelineCurrentPageSelector,
  idpayTimelineIsLastPageSelector,
  idpayTimelineLastUpdateSelector
} from "../store";
import { idpayTimelinePageGet } from "../store/actions";
⋮----
export const useInitiativeTimelineFetcher = (
  initiativeId: string,
  pageSize: number,
  onError: () => void
) =>
⋮----
const refresh = () =>
⋮----
const fetchPage = (page: number)
⋮----
const fetchNextPage = () =>
⋮----
const retryFetchLastPage = () =>
</file>

<file path="apps/main-app/ts/features/idpay/details/navigation/index.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../utils/navigation";
import { IdPayFeatureFlagGuard } from "../../common/components/IdPayFeatureFlagGuard";
import {
  IdPayBeneficiaryDetailsScreen,
  IdPayBeneficiaryDetailsScreenParams
} from "../screens/IdPayBeneficiaryDetailsScreen";
import {
  IdPayInitiativeDetailsScreen,
  IdPayInitiativeDetailsScreenParams
} from "../screens/IdPayInitiativeDetailsScreen";
import {
  IdPayOperationsListScreen,
  IdPayOperationsListScreenParams
} from "../screens/IdPayOperationsListScreen";
⋮----
export type IDPayDetailsParamsList = {
  [IDPayDetailsRoutes.IDPAY_DETAILS_BENEFICIARY]: IdPayBeneficiaryDetailsScreenParams;
  [IDPayDetailsRoutes.IDPAY_DETAILS_MONITORING]: IdPayInitiativeDetailsScreenParams;
  [IDPayDetailsRoutes.IDPAY_DETAILS_TIMELINE]: IdPayOperationsListScreenParams;
};
⋮----
export const IDpayDetailsNavigator = () => (
  <IdPayFeatureFlagGuard>
    <Stack.Navigator
      initialRouteName={IDPayDetailsRoutes.IDPAY_DETAILS_MONITORING}
      screenOptions={{ gestureEnabled: isGestureEnabled }}
    >
      <Stack.Screen
        component={IdPayInitiativeDetailsScreen}
        name={IDPayDetailsRoutes.IDPAY_DETAILS_MONITORING}
      />
      <Stack.Screen
        component={IdPayOperationsListScreen}
        name={IDPayDetailsRoutes.IDPAY_DETAILS_TIMELINE}
      />
      <Stack.Screen
        component={IdPayBeneficiaryDetailsScreen}
        name={IDPayDetailsRoutes.IDPAY_DETAILS_BENEFICIARY}
      />
    </Stack.Navigator>
  </IdPayFeatureFlagGuard>
);
</file>

<file path="apps/main-app/ts/features/idpay/details/saga/__test__/handleGetBeneficiaryDetails.test.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { InitiativeDetailDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDetailDTO";
⋮----
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { withRefreshApiCall } from "../../../../authentication/fastLogin/saga/utils";
import { idPayBeneficiaryDetailsGet } from "../../store/actions";
import { handleGetBeneficiaryDetails } from "../handleGetBeneficiaryDetails";
</file>

<file path="apps/main-app/ts/features/idpay/details/saga/__test__/handleGetInitiativeDetails.test.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import {
  InitiativeDTO,
  StatusEnum as InitiativeStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
⋮----
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { withRefreshApiCall } from "../../../../authentication/fastLogin/saga/utils";
import { idpayInitiativeGet } from "../../store/actions";
import { handleGetInitiativeDetails } from "../handleGetInitiativeDetails";
</file>

<file path="apps/main-app/ts/features/idpay/details/saga/__test__/handleGetOnboardingStatus.test.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import {
  OnboardingStatusDTO,
  StatusEnum as OnboardingStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/OnboardingStatusDTO";
⋮----
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { withRefreshApiCall } from "../../../../authentication/fastLogin/saga/utils";
import { idPayOnboardingStatusGet } from "../../store/actions";
import { handleGetOnboardingStatus } from "../handleGetOnboardingStatus";
</file>

<file path="apps/main-app/ts/features/idpay/details/saga/__test__/handleGetTimelinePage.test.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { OperationDTO } from "@io-app/api-types/generated/definitions/idpay/OperationDTO";
import { TimelineDTO } from "@io-app/api-types/generated/definitions/idpay/TimelineDTO";
import {
  OperationTypeEnum,
  StatusEnum
} from "@io-app/api-types/generated/definitions/idpay/TransactionOperationDTO";
⋮----
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import {
  FailureReason,
  FailureReasonError
} from "../../../../../utils/failureReason";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { withRefreshApiCall } from "../../../../authentication/fastLogin/saga/utils";
import { idpayTimelinePageGet } from "../../store/actions";
import { handleGetTimelinePage } from "../handleGetTimelinePage";
⋮----
const startSaga = () =>
</file>

<file path="apps/main-app/ts/features/idpay/details/saga/handleGetBeneficiaryDetails.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idPayBeneficiaryDetailsGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/details/saga/handleGetInitiativeDetails.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idpayInitiativeGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/details/saga/handleGetOnboardingStatus.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idPayOnboardingStatusGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/details/saga/handleGetTimelinePage.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { err, ok } from "neverthrow";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import {
  decodeFailureReason,
  FailureReason,
  FailureReasonError
} from "../../../../utils/failureReason";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idpayTimelinePageGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/details/saga/index.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { IDPayClient } from "../../common/api/client";
import {
  idPayBeneficiaryDetailsGet,
  idpayInitiativeGet,
  idPayOnboardingStatusGet,
  idpayTimelinePageGet
} from "../store/actions";
import { handleGetBeneficiaryDetails } from "./handleGetBeneficiaryDetails";
import { handleGetInitiativeDetails } from "./handleGetInitiativeDetails";
import { handleGetOnboardingStatus } from "./handleGetOnboardingStatus";
import { handleGetTimelinePage } from "./handleGetTimelinePage";
</file>

<file path="apps/main-app/ts/features/idpay/details/screens/IdPayBeneficiaryDetailsScreen.tsx">
import { VSpacer } from "@io-app/design-system";
⋮----
import { RouteProp, useRoute } from "@react-navigation/native";
import { sequenceS } from "fp-ts/lib/Apply";
import { pipe } from "fp-ts/lib/function";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { IdPayBeneficiaryDetailsContent } from "../components/IdPayBeneficiaryDetailsContent";
import { IDPayDetailsParamsList } from "../navigation";
import {
  idPayBeneficiaryDetailsSelector,
  idpayInitiativeDetailsSelector
} from "../store";
import {
  idPayBeneficiaryDetailsGet,
  idPayOnboardingStatusGet
} from "../store/actions";
⋮----
export type IdPayBeneficiaryDetailsScreenParams = {
  initiativeId: string;
  initiativeName?: string;
};
⋮----
type IdPayBeneficiaryDetailsScreenRouteProps = RouteProp<
  IDPayDetailsParamsList,
  "IDPAY_DETAILS_BENEFICIARY"
>;
⋮----
const IdPayBeneficiaryDetailsScreen = () =>
</file>

<file path="apps/main-app/ts/features/idpay/details/screens/IdPayInitiativeDetailsScreen.tsx">
import {
  InitiativeDTO,
  InitiativeRewardTypeEnum,
  VoucherStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  Body,
  ContentWrapper,
  H6,
  IOButton,
  IODimensions,
  IOToast,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
⋮----
import { useRoute } from "@react-navigation/core";
import { RouteProp, useFocusEffect } from "@react-navigation/native";
import { sequenceS } from "fp-ts/lib/Apply";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback, useLayoutEffect } from "react";
import { Linking, View } from "react-native";
import Animated, { LinearTransition } from "react-native-reanimated";
⋮----
import { BonusCardScreenComponent } from "../../../../components/BonusCard";
import { BonusCardCounter } from "../../../../components/BonusCard/BonusCardCounter";
import { useAppRequiredUpdate } from "../../../../components/helpers/withAppRequiredUpdate";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { IOScrollViewActions } from "../../../../components/ui/IOScrollView";
import { UpdateAppAlert } from "../../../../components/UpdateAppAlert";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { getNetworkErrorMessage } from "../../../../utils/errors";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { formatNumberCentsToAmount } from "../../../../utils/stringBuilder";
import { useFIMSAuthenticationFlow } from "../../../fims/common/hooks";
import { IdPayCodeCieBanner } from "../../code/components/IdPayCodeCieBanner";
import { IdPayConfigurationRoutes } from "../../configuration/navigation/routes";
import { ConfigurationMode } from "../../configuration/types";
import {
  trackIDPayDetailAuthorizationStart,
  trackIDPayDetailBottomSheetLanding,
  trackIDPayDetailError,
  trackIDPayDetailInfoAction,
  trackIDPayDetailLanding,
  trackIDPayDetailRetailersClick
} from "../analytics";
import { IdPayInitiativeDiscountSettingsComponent } from "../components/IdPayInitiativeDiscountSettingsComponent";
import { IdPayInitiativeLastUpdateCounter } from "../components/IdPayInitiativeLastUpdateCounter";
import { IdPayInitiativeRefundSettingsComponent } from "../components/IdPayInitiativeRefundSettingsComponent";
import {
  IdPayInitiativeTimelineComponent,
  IdPayInitiativeTimelineComponentSkeleton
} from "../components/IdPayInitiativeTimelineComponent";
import { IdPayMissingConfigurationAlert } from "../components/IdPayMissingConfigurationAlert";
import { useIdPayDiscountDetailsBottomSheet } from "../hooks/useIdPayDiscountDetailsBottomSheet";
import { IDPayDetailsParamsList, IDPayDetailsRoutes } from "../navigation";
import {
  idpayInitiativeDetailsSelector,
  initiativeNeedsConfigurationSelector
} from "../store";
import { idpayInitiativeGet, idpayTimelinePageGet } from "../store/actions";
import { IdPayCardStatus } from "../utils";
⋮----
export type IdPayInitiativeDetailsScreenParams = {
  initiativeId: string;
};
⋮----
type IdPayInitiativeDetailsScreenRouteProps = RouteProp<
  IDPayDetailsParamsList,
  "IDPAY_DETAILS_MONITORING"
>;
⋮----
const navigateToBeneficiaryDetails = () =>
⋮----
const onAddExpense = () =>
⋮----
const navigateToConfiguration = () =>
⋮----
label=
⋮----
switch (rewardType)
⋮----
actions=
</file>

<file path="apps/main-app/ts/features/idpay/details/screens/IdPayOperationsListScreen.tsx">
import { OperationListDTO } from "@io-app/api-types/generated/definitions/idpay/OperationListDTO";
import {
  Body,
  Divider,
  HSpacer,
  IODimensions,
  IOSkeleton,
  IOToast,
  LoadingSpinner,
  VSpacer
} from "@io-app/design-system";
import { useRoute } from "@react-navigation/core";
import { RouteProp } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useRef } from "react";
import { View } from "react-native";
⋮----
import { IOListViewWithLargeHeader } from "../../../../components/ui/IOListViewWithLargeHeader";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { useIdPayTimelineDetailsBottomSheet } from "../../timeline/components/IdPayTimelineDetailsBottomSheet";
import { IdPayTimelineOperationListItem } from "../components/IdPayTimelineOperationListItem";
import { useInitiativeTimelineFetcher } from "../hooks/useInitiativeTimelineFetcher";
import { IDPayDetailsParamsList } from "../navigation";
⋮----
export type IdPayOperationsListScreenParams = { initiativeId: string };
⋮----
type IdPayOperationsListScreenRouteProps = RouteProp<
  IDPayDetailsParamsList,
  "IDPAY_DETAILS_TIMELINE"
>;
⋮----
const handleOnError = () =>
⋮----
const showOperationDetailsBottomSheet = (operation: OperationListDTO)
⋮----
ItemSeparatorComponent=
ListFooterComponent=
⋮----
</file>

<file path="apps/main-app/ts/features/idpay/details/store/__test__/store.test.ts">
import {
  StatusEnum as InitativeStatusEnum,
  InitiativeDTO
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { OperationDTO } from "@io-app/api-types/generated/definitions/idpay/OperationDTO";
import { TimelineDTO } from "@io-app/api-types/generated/definitions/idpay/TimelineDTO";
import {
  StatusEnum,
  OperationTypeEnum as TransactionOperationType
} from "@io-app/api-types/generated/definitions/idpay/TransactionOperationDTO";
⋮----
import { createStore } from "redux";
⋮----
import {
  idPayBeneficiaryDetailsSelector,
  idpayInitiativeDetailsSelector,
  idpayOperationListSelector,
  idpayTimelineCurrentPageSelector,
  idpayTimelineIsLastPageSelector,
  idpayTimelineLastUpdateSelector
} from "..";
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { GlobalState } from "../../../../../store/reducers/types";
import { NetworkError } from "../../../../../utils/errors";
import { idpayInitiativeGet, idpayTimelinePageGet } from "../actions";
</file>

<file path="apps/main-app/ts/features/idpay/details/store/actions/index.ts">
import { InitiativeDetailDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDetailDTO";
import { InitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { OnboardingStatusDTO } from "@io-app/api-types/generated/definitions/idpay/OnboardingStatusDTO";
import { TimelineDTO } from "@io-app/api-types/generated/definitions/idpay/TimelineDTO";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
type IdPayInitiativeGetPayloadType = { initiativeId: string };
⋮----
type IdpayTimelinePageGetPayloadType = {
  initiativeId: string;
  page?: number;
  pageSize?: number;
};
⋮----
type IdPayTimelinePageGetSuccessPayloadType = {
  page: number;
  timeline: TimelineDTO;
};
⋮----
type IdPayBeneficiaryDetailsGetPayloadType = {
  initiativeId: InitiativeDTO["initiativeId"];
};
⋮----
type IdPayOnboardingStatusGetPayloadType = {
  initiativeId: InitiativeDTO["initiativeId"];
};
⋮----
export type IdPayInitiativeActions =
  | ActionType<typeof idPayBeneficiaryDetailsGet>
  | ActionType<typeof idpayInitiativeGet>
  | ActionType<typeof idPayOnboardingStatusGet>
  | ActionType<typeof idpayTimelinePageGet>;
</file>

<file path="apps/main-app/ts/features/idpay/details/store/index.ts">
import { InitiativeDetailDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDetailDTO";
import {
  InitiativeDTO,
  StatusEnum as InitiativeStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { OnboardingStatusDTO } from "@io-app/api-types/generated/definitions/idpay/OnboardingStatusDTO";
import { TimelineDTO } from "@io-app/api-types/generated/definitions/idpay/TimelineDTO";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import {
  idPayBeneficiaryDetailsGet,
  idpayInitiativeGet,
  idPayOnboardingStatusGet,
  idpayTimelinePageGet
} from "./actions";
⋮----
export type IdPayInitiativeState = {
  beneficiaryDetails: pot.Pot<InitiativeDetailDTO, NetworkError>;
  details: pot.Pot<InitiativeDTO, NetworkError>;
  onboardingStatus: pot.Pot<OnboardingStatusDTO, NetworkError>;
  timeline: pot.Pot<PaginatedTimelineDTO, NetworkError>;
};
⋮----
export type PaginatedTimelineDTO = Record<number, TimelineDTO>;
⋮----
const reducer = (
  state: IdPayInitiativeState = INITIAL_STATE,
  action: Action
): IdPayInitiativeState =>
⋮----
const idpayInitativeSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/idpay/details/utils/index.tsx">
import {
  InitiativeDTO,
  VoucherStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { LabelMini, Tag, useIOThemeContext } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { format } from "../../../../utils/dates";
⋮----
type InitiativeProps = {
  initiative: InitiativeDTO;
};
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { OnboardingFailureEnum } from "../types/OnboardingFailure";
⋮----
type DefaultOnboardingEventProperties = {
  initiativeId?: string;
};
⋮----
export const trackIDPayOnboardingIntro = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingStart = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingNotificationPermission = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingNotificationOK = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingNotificationCancel = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingNotificationError = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
const mapOptionToReason = (
  reason: O.Option<OnboardingFailureEnum>
): OnboardingFailureEnum
⋮----
export const trackIDPayOnboardingFailure = (
  props: DefaultOnboardingEventProperties & {
    reason: O.Option<OnboardingFailureEnum>;
  }
) =>
⋮----
export const trackIDPayOnboardingErrorHelp = (
  props: DefaultOnboardingEventProperties & {
    flow: "authorization" | "onboarding";
    reason: O.Option<OnboardingFailureEnum>;
  }
) =>
⋮----
export const trackIDPayIngressScreenLoading = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayIngressScreenTimeout = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayIngressScreenCTA = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingAlert = (
  props: DefaultOnboardingEventProperties & {
    screen: "intent_declaration" | "multi_self_declaration";
  }
) =>
⋮----
export const trackIDPayOnboardingPDNDAcceptance = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingSelfDeclaration = (
  props: DefaultOnboardingEventProperties
) =>
export const trackIDPayOnboardingMultiSelfDeclaration = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingConversionRate = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingSuccess = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingNotificationDenied = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingNotificationActivation = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingNotificationAccepted = (
  props: DefaultOnboardingEventProperties
) =>
⋮----
export const trackIDPayOnboardingNotificationSuccess = (
  props: DefaultOnboardingEventProperties
... (13 lines truncated)
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/components/IdPayOnboardingDescriptionSkeleton.tsx">
import { IOSkeleton, VSpacer } from "@io-app/design-system";
import { View } from "react-native";
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/components/IdPayOnboardingServiceHeader.tsx">
import { InitiativeDataDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDataDTO";
import {
  ContentWrapper,
  H1,
  IOImage,
  IOSkeleton,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
type Props = {
  initiative: O.Option<InitiativeDataDTO>;
};
⋮----
const IdPayOnboardingServiceHeader = (props: Props) =>
⋮----
alt=
⋮----
const Skeleton = () => (
  <VStack>
    <IOSkeleton height={270} shape="rectangle" width="auto" />
    <ContentWrapper>
      <VSpacer size={24} />
      <IOSkeleton height={16} radius={4} shape="rectangle" width="80%" />
    </ContentWrapper>
  </VStack>
);
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/components/IdPayOnboardingStepper.tsx">
import { Stepper, VSpacer } from "@io-app/design-system";
⋮----
import { IdPayOnboardingMachineContext } from "../machine/provider";
import { stepperCountSelector } from "../machine/selectors";
⋮----
const IdPayOnboardingStepper = () =>
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/machine/actions.ts">
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { refreshSessionToken } from "../../../authentication/fastLogin/store/actions/tokenRefreshActions";
import { SERVICES_ROUTES } from "../../../services/common/navigation/routes";
import { IDPayDetailsRoutes } from "../../details/navigation";
import { IdPayOnboardingRoutes } from "../navigation/routes";
⋮----
export const createActionsImplementation = (
  navigation: ReturnType<typeof useIONavigation>,
  dispatch: ReturnType<typeof useIODispatch>
) =>
⋮----
const navigateToInitiativeDetailsScreen = ()
const navigateToPdndCriteriaScreen = ()
const navigateToBoolSelfDeclarationListScreen = ()
const navigateToMultiSelfDeclarationListScreen = ()
const navigateToInputFormScreen = ()
⋮----
const navigateToCompletionScreen = ()
⋮----
const navigateToFailureScreen = ()
⋮----
const navigateToFailureToRetryScreen = ()
⋮----
const navigateToInitiativeMonitoringScreen = (args: {
    context: Context.Context;
}) =>
⋮----
const navigateToEnableNotificationScreen = ()
⋮----
const navigateToEnableMessageScreen = ()
⋮----
const closeOnboarding = ()
⋮----
const closeOnboardingSuccess = ()
⋮----
const navigateToLoadingScreen = ()
⋮----
const handleSessionExpired = () =>
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/machine/actors.ts">
import { PreferredLanguage } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { InitiativeDataDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDataDTO";
import { CodeEnum as OnboardingErrorCodeEnum } from "@io-app/api-types/generated/definitions/idpay/OnboardingErrorDTO";
import { OnboardingInitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/OnboardingInitiativeDTO";
import { StatusEnum as OnboardingStatusEnum } from "@io-app/api-types/generated/definitions/idpay/OnboardingStatusDTO";
import { SelfConsentDTO } from "@io-app/api-types/generated/definitions/idpay/SelfConsentDTO";
import { TransientError } from "@pagopa/ts-commons/lib/tasks";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { fromPromise } from "xstate";
⋮----
import { IDPayClient } from "../../common/api/client";
import {
  OnboardingFailure,
  OnboardingFailureEnum
} from "../types/OnboardingFailure";
⋮----
import { getBooleanSelfDeclarationListFromContext } from "./selectors";
⋮----
const isTooManyRequestsError = (error: unknown): boolean
⋮----
const handleApiError = (error: unknown): Promise<never> =>
⋮----
export const createActorsImplementation = (
  client: IDPayClient,
  token: string,
  language: PreferredLanguage
) =>
⋮----
const mapOnboardingStatusToFailure = (
  status: OnboardingStatusEnum
): OnboardingFailure | undefined =>
⋮----
const mapErrorCodeToFailure = (
  code: OnboardingErrorCodeEnum
): OnboardingFailure =>
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/machine/context.ts">
import { InitiativeDataDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDataDTO";
import { OnboardingInitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/OnboardingInitiativeDTO";
import { StatusEnum } from "@io-app/api-types/generated/definitions/idpay/OnboardingStatusDTO";
import { SelfConsentMultiTypeDTO } from "@io-app/api-types/generated/definitions/idpay/SelfConsentMultiTypeDTO";
import { SelfConsentTextDTO } from "@io-app/api-types/generated/definitions/idpay/SelfConsentTextDTO";
⋮----
import { OnboardingFailure } from "../types/OnboardingFailure";
⋮----
export type Context = {
  readonly activeTextConsentPage: number;
  readonly currentStep: number;
  readonly failure: O.Option<OnboardingFailure>;
  readonly hasInbox: boolean;
  readonly initiative: O.Option<InitiativeDataDTO>;
  readonly isPushNotificationsEnabled: boolean;
  readonly onboardingStatus: O.Option<StatusEnum>;
  readonly requiredCriteria: O.Option<OnboardingInitiativeDTO>;
  readonly selfDeclarationsBoolAnswers: Record<string, boolean>;
  readonly selfDeclarationsMultiAnswers: Record<
    number,
    SelfConsentMultiTypeDTO
  >;
  readonly selfDeclarationsMultiPage: number;
  readonly selfDeclarationsTextAnswers: Record<string, SelfConsentTextDTO>;
  readonly serviceId: string;
};
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/machine/events.ts">
import { SelfConsentBoolDTO } from "@io-app/api-types/generated/definitions/idpay/SelfConsentBoolDTO";
import { SelfConsentMultiTypeDTO } from "@io-app/api-types/generated/definitions/idpay/SelfConsentMultiTypeDTO";
import { SelfConsentTextDTO } from "@io-app/api-types/generated/definitions/idpay/SelfConsentTextDTO";
⋮----
export type IdPayOnboardingEvents =
  | Back
  | CheckDetails
  | Close
  | InputTextCriteria
  | Next
  | RetryConnectionEvent
  | SelectMultiConsent
  | StartOnboarding
  | ToggleBoolCriteria
  | UpdatePushNotificationSetting;
⋮----
type Back = {
  readonly type: "back";
};
⋮----
type CheckDetails = {
  readonly type: "check-details";
};
⋮----
type Close = {
  readonly type: "close";
};
⋮----
type InputTextCriteria = {
  readonly criteria: SelfConsentTextDTO;
  readonly type: "input-text-criteria";
};
⋮----
type Next = {
  readonly type: "next";
};
⋮----
type RetryConnectionEvent = {
  readonly type: "retryConnection";
};
⋮----
type SelectMultiConsent = {
  readonly data: SelfConsentMultiTypeDTO;
  readonly type: "select-multi-consent";
};
⋮----
type StartOnboarding = {
  readonly hasInbox: boolean;
  readonly serviceId: string;
  readonly type: "start-onboarding";
};
⋮----
type ToggleBoolCriteria = {
  readonly criteria: SelfConsentBoolDTO;
  readonly type: "toggle-bool-criteria";
};
⋮----
type UpdatePushNotificationSetting = {
  readonly isPushNotificationEnabled: boolean;
  readonly type: "update-notification-status";
};
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/machine/machine.ts">
import { InitiativeDataDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDataDTO";
import { OnboardingInitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/OnboardingInitiativeDTO";
import { StatusEnum as OnboardingStatusEnum } from "@io-app/api-types/generated/definitions/idpay/OnboardingStatusDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import { and, assertEvent, assign, fromPromise, setup } from "xstate";
⋮----
import { IdPayTags } from "../../common/machine/tags";
import { InitiativeFailureType } from "../../configuration/types/failure";
import {
  OnboardingFailure,
  OnboardingFailureEnum
} from "../types/OnboardingFailure";
import { Context, InitialContext } from "./context";
import { IdPayOnboardingEvents } from "./events";
import {
  getBooleanSelfDeclarationListFromContext,
  getInformativeSelfDeclarationListFromContext,
  getInputFormSelfDeclarationFromContext,
  getMultiSelfDeclarationListFromContext
} from "./selectors";
⋮----
const notImplementedStub = () =>
⋮----
const selectInitiativeId = (context: Context)
⋮----
export type IdPayOnboardingMachine = typeof idPayOnboardingMachine;
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/machine/provider.tsx">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { createActorContext } from "@xstate/react";
import { pipe } from "fp-ts/lib/function";
⋮----
import { ReactNode } from "react";
⋮----
import {
  idPayApiBaseUrl,
  idPayApiUatBaseUrl,
  idPayApiUatVersion,
  idPayApiVersion,
  idPayTestToken
} from "../../../../config";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  isPagoPATestEnabledSelector,
  preferredLanguageSelector
} from "../../../../store/reducers/persistedPreferences";
import { fromLocaleToPreferredLanguage } from "../../../../utils/locale";
import { bpdTokenSelector } from "../../../authentication/common/store/selectors";
import { createIDPayClient } from "../../common/api/client";
import { createActionsImplementation } from "./actions";
import { createActorsImplementation } from "./actors";
import { idPayOnboardingMachine } from "./machine";
⋮----
type Props = {
  children: ReactNode;
};
⋮----
export const IdPayOnboardingMachineProvider = (
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/machine/selectors.ts">
import { OnboardingInitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/OnboardingInitiativeDTO";
import { SelfCriteriaBoolDTO } from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaBoolDTO";
import { SelfCriteriaInformativeDTO } from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaInformativeDTO";
import { SelfCriteriaMultiTypeDTO } from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaMultiTypeDTO";
import { SelfCriteriaTextDTO } from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaTextDTO";
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
import { StateFrom } from "xstate";
⋮----
import { IdPayOnboardingMachine } from "./machine";
⋮----
type MachineSnapshot = StateFrom<IdPayOnboardingMachine>;
⋮----
export const selectOnboardingFailure = (snapshot: MachineSnapshot)
⋮----
const selectRequiredCriteria = (snapshot: MachineSnapshot)
⋮----
export const selectSelfDeclarationBoolAnswers = (snapshot: MachineSnapshot)
⋮----
export const selectCurrentMultiSelfDeclarationPage = (
  snapshot: MachineSnapshot
)
⋮----
export const selectCurrentInputTextNumber = (snapshot: MachineSnapshot)
⋮----
export const selectInitiative = (snapshot: MachineSnapshot)
⋮----
export const selectServiceId = (snapshot: MachineSnapshot)
⋮----
const filterMultiCriteria = <T>(criteria: O.Option<OnboardingInitiativeDTO>)
⋮----
const filterCriteria = <T>(
  criteria: O.Option<OnboardingInitiativeDTO>,
  filterFunc:
    | typeof SelfCriteriaBoolDTO
    | typeof SelfCriteriaInformativeDTO
    | typeof SelfCriteriaTextDTO
)
⋮----
export const getMultiSelfDeclarationListFromContext = (
  context: Context.Context
)
⋮----
export const getBooleanSelfDeclarationListFromContext = (
  context: Context.Context
)
⋮----
export const getInformativeSelfDeclarationListFromContext = (
  context: Context.Context
)
⋮----
export const getInputFormSelfDeclarationFromContext = (
  context: Context.Context
)
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../utils/navigation";
import { IdPayFeatureFlagGuard } from "../../common/components/IdPayFeatureFlagGuard";
import {
  IdPayOnboardingMachineContext,
  IdPayOnboardingMachineProvider
} from "../machine/provider";
import IdPayBoolValuePrerequisitesScreen from "../screens/IdPayBoolValuePrerequisitesScreen";
import IdPayCompletionScreen from "../screens/IdPayCompletionScreen";
import IdPayEnableMessageScreen from "../screens/IdPayEnableMessageScreen";
import IdPayEnableNotificationScreen from "../screens/IdPayEnableNotificationScreen";
import { IdPayFailToRetryScreen } from "../screens/IdPayFailToRetryScreen";
import IdPayFailureScreen from "../screens/IdPayFailureScreen";
import { IdPayInitiativeDetailsScreen } from "../screens/IdPayInitiativeDetailsScreen";
import IdPayInputFormVerificationScreen from "../screens/IdPayInputFormVerificationScreen";
import IdPayLoadingScreen from "../screens/IdPayLoadingScreen";
import IdPayMultiValuePrerequisitesScreen from "../screens/IdPayMultiValuePrerequisitesScreen";
import IdPayPDNDPrerequisitesScreen from "../screens/IdPayPDNDPrerequisitesScreen";
import { IdPayOnboardingParamsList } from "./params";
import { IdPayOnboardingRoutes } from "./routes";
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/navigation/params.ts">
import { InitiativeDetailsScreenParams } from "../screens/IdPayInitiativeDetailsScreen";
import { IdPayOnboardingRoutes } from "./routes";
⋮----
export type IdPayOnboardingParamsList = {
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_BOOL_SELF_DECLARATIONS]: undefined;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_COMPLETION]: undefined;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_ENABLE_MESSAGE]: undefined;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_ENABLE_NOTIFICATIONS]: undefined;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_FAILURE]: undefined;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_FAILURE_TO_RETRY]: undefined;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_INITIATIVE_DETAILS]: InitiativeDetailsScreenParams;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_INPUT_FORM]: undefined;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_LOADING]: undefined;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_MULTI_SELF_DECLARATIONS]: undefined;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_PDNDACCEPTANCE]: undefined;
};
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayBoolValuePrerequisitesScreen.tsx">
import { _typeEnum as SelfConsentBoolTypeEnum } from "@io-app/api-types/generated/definitions/idpay/SelfConsentBoolDTO";
import { SelfCriteriaBoolDTO } from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaBoolDTO";
import {
  Divider,
  IOToast,
  ListItemSwitch,
  VSpacer
} from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { View } from "react-native";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { isLoadingSelector } from "../../common/machine/selectors";
import {
  trackIDPayOnboardingAlert,
  trackIDPayOnboardingSelfDeclaration
} from "../analytics";
import IdPayOnboardingStepper from "../components/IdPayOnboardingStepper";
import { IdPayOnboardingMachineContext } from "../machine/provider";
import {
  areAllSelfDeclarationsToggledSelector,
  boolRequiredCriteriaSelector,
  selectInitiative,
  selectSelfDeclarationBoolAnswers
} from "../machine/selectors";
⋮----
const continueOnPress = () =>
⋮----
const goBackOnPress = () => machine.send(
⋮----
const toggleCriteria =
(criteria: SelfCriteriaBoolDTO) => (value: boolean) =>
⋮----
const getSelfCriteriaBoolAnswer = (criteria: SelfCriteriaBoolDTO)
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayCompletionScreen.tsx">
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { areNotificationPermissionsEnabledSelector } from "../../../pushNotifications/store/reducers/environment";
import { isLoadingSelector } from "../../common/machine/selectors";
import {
  idPayInitiativeWaitingListGet,
  setIdPayOnboardingSucceeded
} from "../../wallet/store/actions";
import { trackIDPayOnboardingSuccess } from "../analytics";
import { IdPayOnboardingMachineContext } from "../machine/provider";
import { selectInitiative } from "../machine/selectors";
⋮----
const handleClosePress = () =>
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayEnableMessageScreen.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { useFirstRender } from "../../../services/common/hooks/useFirstRender";
import { upsertServicePreference } from "../../../services/details/store/actions/preference";
import {
  isErrorServicePreferenceSelector,
  isLoadingServicePreferenceSelector,
  servicePreferenceResponseSuccessByIdSelector
} from "../../../services/details/store/selectors";
import {
  trackIDPayOnboardingNotificationCancel,
  trackIDPayOnboardingNotificationError,
  trackIDPayOnboardingNotificationOK,
  trackIDPayOnboardingNotificationPermission
} from "../analytics";
import { IdPayOnboardingMachineContext } from "../machine/provider";
import { selectInitiative } from "../machine/selectors";
⋮----
const IdPayEnableMessageScreen = () =>
⋮----
const onActivate = () =>
⋮----
const onCancel = () =>
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayEnableNotificationScreen.tsx">
import { Badge, IOToast, VSpacer } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback } from "react";
import { View } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { areNotificationPermissionsEnabledSelector } from "../../../pushNotifications/store/reducers/environment";
import { openSystemNotificationSettingsScreen } from "../../../pushNotifications/utils";
import {
  trackIDPayOnboardingNotificationAccepted,
  trackIDPayOnboardingNotificationActivation,
  trackIDPayOnboardingNotificationDenied,
  trackIDPayOnboardingNotificationSuccess
} from "../analytics";
import { IdPayOnboardingMachineContext } from "../machine/provider";
import { selectInitiative } from "../machine/selectors";
⋮----
const handleClosePress = () =>
⋮----
text=
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayFailToRetryScreen.tsx">
import { IOToast } from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { memo, useEffect, useRef, useState } from "react";
import { AccessibilityInfo, View } from "react-native";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import ModalSectionStatusComponent from "../../../../components/SectionStatus/modal";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { idPayInitiativeConfigSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { setAccessibilityFocus } from "../../../../utils/accessibility";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { getFullLocale } from "../../../../utils/locale";
import { openWebUrl } from "../../../../utils/url";
import { trackIngressServicesSlowDown } from "../../../ingress/analytics";
import {
  trackIDPayIngressScreenCTA,
  trackIDPayIngressScreenLoading,
  trackIDPayIngressScreenTimeout
} from "../analytics";
import { IdPayOnboardingMachineContext } from "../machine/provider";
⋮----
const handleNavigateToWebsite = () =>
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayFailureScreen.tsx">
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect, useMemo } from "react";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { getInstructionsButtonConfig } from "../../../../components/ui/utils/buttons";
import { useIOSelector } from "../../../../store/hooks";
import { idPayInitiativeConfigSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { getFullLocale } from "../../../../utils/locale";
import useIDPayFailureSupportModal from "../../common/hooks/useIDPayFailureSupportModal";
import {
  trackIDPayOnboardingErrorHelp,
  trackIDPayOnboardingFailure
} from "../analytics";
import { IdPayOnboardingMachineContext } from "../machine/provider";
import {
  selectInitiative,
  selectOnboardingFailure,
  selectServiceId
} from "../machine/selectors";
import { OnboardingFailureEnum } from "../types/OnboardingFailure";
⋮----
const IdPayFailureScreen = () =>
⋮----
const mapFailureToContentProps = (
    failure: OnboardingFailureEnum
): OperationResultScreenContentProps =>
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayInitiativeDetailsScreen.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  ContentWrapper,
  ForceScrollDownView,
  VSpacer
} from "@io-app/design-system";
import { INonEmptyStringTag } from "@pagopa/ts-commons/lib/strings";
import { RouteProp, useLinkTo, useRoute } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { useAppRequiredUpdate } from "../../../../components/helpers/withAppRequiredUpdate";
import IOMarkdown from "../../../../components/IOMarkdown";
import { UpdateAppAlert } from "../../../../components/UpdateAppAlert";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { generateMessagesAndServicesRules } from "../../../common/components/IOMarkdown/customRules";
import { loadServicePreference } from "../../../services/details/store/actions/preference";
import { servicePreferenceResponseSuccessByIdSelector } from "../../../services/details/store/selectors";
import { IdPayEnabledSubFeatureGuard } from "../../common/components/IdPayEnabledFeatureFlagGuard";
import { isLoadingSelector } from "../../common/machine/selectors";
import {
  trackIDPayOnboardingAppUpdateConfirm,
  trackIDPayOnboardingAppUpdateRequired,
  trackIDPayOnboardingIntro,
  trackIDPayOnboardingStart
} from "../analytics";
import { IdPayOnboardingDescriptionSkeleton } from "../components/IdPayOnboardingDescriptionSkeleton";
import { IdPayOnboardingServiceHeader } from "../components/IdPayOnboardingServiceHeader";
import { IdPayOnboardingMachineContext } from "../machine/provider";
import { selectInitiative } from "../machine/selectors";
import { IdPayOnboardingParamsList } from "../navigation/params";
import { generateSmallTosMarkdownRules } from "../utils/markdown";
⋮----
export type InitiativeDetailsScreenParams = {
  serviceId?: string;
};
⋮----
type InitiativeDetailsScreenParamsRouteProps = RouteProp<
  IdPayOnboardingParamsList,
  "IDPAY_ONBOARDING_INITIATIVE_DETAILS"
>;
⋮----
const handleGoBackPress = () => machine.send(
const handleContinuePress = () =>
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayInputFormVerificationScreen.tsx">
import {
  SelfCriteriaTextDTO,
  _typeEnum as SelfCriteriaTextTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaTextDTO";
import { H6, IOToast, TextInput, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useRef, useState } from "react";
import PagerView from "react-native-pager-view";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { isLoadingSelector } from "../../common/machine/selectors";
import IdPayOnboardingStepper from "../components/IdPayOnboardingStepper";
import { IdPayOnboardingMachineContext } from "../machine/provider";
import {
  selectCurrentInputTextNumber,
  textRequiredCriteriaSelector
} from "../machine/selectors";
⋮----
const handleContinuePress = () =>
⋮----
const goBackOnPress = () => machine.send(
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayLoadingScreen.tsx">
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { isLoadingSelector } from "../../common/machine/selectors";
import { trackIDPayOnboardingConversionRate } from "../analytics";
import { IdPayOnboardingMachineContext } from "../machine/provider";
import { selectInitiative } from "../machine/selectors";
⋮----
const IdPayLoadingScreen = () =>
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayMultiValuePrerequisitesScreen.tsx">
import {
  SelfCriteriaMultiTypeDTO,
  _typeEnum as SelfCriteriaMultiTypeVariationEnum
} from "@io-app/api-types/generated/definitions/idpay/SelfCriteriaMultiTypeDTO";
import { IOToast, RadioGroup, VSpacer } from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect, useRef, useState } from "react";
import { View } from "react-native";
import PagerView from "react-native-pager-view";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import {
  trackIDPayOnboardingAlert,
  trackIDPayOnboardingMultiSelfDeclaration
} from "../analytics";
import IdPayOnboardingStepper from "../components/IdPayOnboardingStepper";
import { IdPayOnboardingMachineContext } from "../machine/provider";
import {
  multiRequiredCriteriaSelector,
  selectCurrentMultiSelfDeclarationPage,
  selectInitiative
} from "../machine/selectors";
⋮----
const handleContinuePress = () =>
⋮----
const handleGoBack = () => machine.send(
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/screens/IdPayPDNDPrerequisitesScreen.tsx">
import { CodeEnum } from "@io-app/api-types/generated/definitions/idpay/AutomatedCriteriaDTO";
import { IOMarkdownLite, ModuleSummary, VSpacer } from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { Fragment, useState } from "react";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { trackIDPayOnboardingPDNDAcceptance } from "../analytics";
import IdPayOnboardingStepper from "../components/IdPayOnboardingStepper";
import { IdPayOnboardingMachineContext } from "../machine/provider";
import {
  informativeCriteriaSelector,
  pdndCriteriaSelector,
  selectInitiative
} from "../machine/selectors";
import { getPDNDCriteriaDescription } from "../utils/strings";
⋮----
const getPDNDCriteriaCodeLabel = (code: CodeEnum): string =>
⋮----
const continueOnPress = () => machine.send(
const goBackOnPress = () => machine.send(
⋮----
I18n.t(
⋮----
setInformativeValue(undefined);
setAuthority(criteriaAuthority);
present();
⋮----
setAuthority(undefined);
setInformativeValue(value);
⋮----
description=
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/types/OnboardingFailure.ts">
import { CodeEnum } from "@io-app/api-types/generated/definitions/idpay/OnboardingErrorDTO";
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
enum OnboardingStatusEnum {
  NOT_ELIGIBLE = "NOT_ELIGIBLE",
  SESSION_EXPIRED = "SESSION_EXPIRED"
}
⋮----
export type OnboardingFailureEnum = CodeEnum | OnboardingStatusEnum;
⋮----
export type OnboardingFailure = t.TypeOf<typeof OnboardingFailure>;
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/utils/markdown.ts">
import { BodySmall } from "@io-app/design-system";
import { createElement } from "react";
⋮----
import { getTxtNodeKey } from "../../../../components/IOMarkdown/renderRules";
import { IOMarkdownRenderRules } from "../../../../components/IOMarkdown/types";
import { handleOpenLink } from "../../../common/components/IOMarkdown/customRules";
⋮----
export const generateSmallTosMarkdownRules = (
  linkTo: (path: string) => void
): Partial<IOMarkdownRenderRules> => (
⋮----
Link(link, render)
Str(str)
</file>

<file path="apps/main-app/ts/features/idpay/onboarding/utils/strings.ts">
import {
  AutomatedCriteriaDTO,
  CodeEnum,
  OperatorEnum
} from "@io-app/api-types/generated/definitions/idpay/AutomatedCriteriaDTO";
import { NumberFromString } from "@pagopa/ts-commons/lib/numbers";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
import { formatNumberCentsToAmount } from "../../../../utils/stringBuilder";
⋮----
const getPDNDCriteriaValueString = (
  code?: CodeEnum,
  value?: string
): string =>
⋮----
const getPDNDCriteriaOperatorDescription = (
  operator: OperatorEnum,
  values: { value: string; value2: string }
): string =>
⋮----
const getPDNDCriteriaDescription = (criteria: AutomatedCriteriaDTO)
</file>

<file path="apps/main-app/ts/features/idpay/payment/common/types.ts">
interface IDPayTransactionCodeBrand {
  readonly IDPayTransactionCode: unique symbol;
}
⋮----
export type IDPayTransactionCode = t.TypeOf<typeof IDPayTransactionCode>;
</file>

<file path="apps/main-app/ts/features/idpay/payment/machine/actions.ts">
import { IOToast } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { IdPayPaymentRoutes } from "../navigation/routes";
⋮----
export const createActionsImplementation = (
  navigation: ReturnType<typeof useIONavigation>
) =>
⋮----
const navigateToAuthorizationScreen = () =>
⋮----
const navigateToResultScreen = ()
⋮----
const showErrorToast = ()
⋮----
const closeAuthorization = () =>
</file>

<file path="apps/main-app/ts/features/idpay/payment/machine/actors.ts">
import { AuthPaymentResponseDTO } from "@io-app/api-types/generated/definitions/idpay/AuthPaymentResponseDTO";
import { CodeEnum as TransactionErrorCodeEnum } from "@io-app/api-types/generated/definitions/idpay/TransactionErrorDTO";
⋮----
import { flow, pipe } from "fp-ts/lib/function";
⋮----
import { fromPromise } from "xstate";
⋮----
import { useIODispatch } from "../../../../store/hooks";
import { refreshSessionToken } from "../../../authentication/fastLogin/store/actions/tokenRefreshActions";
import { IDPayClient } from "../../common/api/client";
import { PaymentFailure, PaymentFailureEnum } from "../types/PaymentFailure";
⋮----
export const createActorsImplementation = (
  client: IDPayClient,
  token: string,
  dispatch: ReturnType<typeof useIODispatch>
) =>
⋮----
const handleSessionExpired = () =>
⋮----
const putPreAuthPaymentTask = (trxCode: string)
⋮----
const authPaymentTask = (trxCode: string)
⋮----
const deletePaymentTask = (trxCode: string)
⋮----
const mapErrorCodeToFailure = (
  code: TransactionErrorCodeEnum
): PaymentFailureEnum =>
⋮----
const mapFetchError = (error: unknown): PaymentFailure =>
</file>

<file path="apps/main-app/ts/features/idpay/payment/machine/context.ts">
import { AuthPaymentResponseDTO } from "@io-app/api-types/generated/definitions/idpay/AuthPaymentResponseDTO";
⋮----
import { PaymentFailure } from "../types/PaymentFailure";
⋮----
export interface Context {
  readonly data_entry?: "manual" | "qr_code";
  readonly failure: O.Option<PaymentFailure>;
  readonly transactionData: O.Option<AuthPaymentResponseDTO>;
  readonly trxCode: string;
}
</file>

<file path="apps/main-app/ts/features/idpay/payment/machine/events.ts">
export type Events = AuthorizePayment | Back | Close | Next;
⋮----
type AuthorizePayment = {
  readonly data_entry?: "manual" | "qr_code";
  readonly trxCode: string;
  readonly type: "authorize-payment";
};
⋮----
type Back = {
  readonly type: "back";
};
⋮----
type Close = {
  readonly type: "close";
};
⋮----
type Next = {
  readonly type: "next";
};
</file>

<file path="apps/main-app/ts/features/idpay/payment/machine/machine.ts">
import { AuthPaymentResponseDTO } from "@io-app/api-types/generated/definitions/idpay/AuthPaymentResponseDTO";
⋮----
import { flow, pipe } from "fp-ts/lib/function";
⋮----
import { assertEvent, assign, fromPromise, setup } from "xstate";
⋮----
import { IdPayTags } from "../../common/machine/tags";
import { IDPayTransactionCode } from "../common/types";
import { PaymentFailure, PaymentFailureEnum } from "../types/PaymentFailure";
⋮----
const notImplementedStub = () =>
</file>

<file path="apps/main-app/ts/features/idpay/payment/machine/provider.tsx">
import { createActorContext } from "@xstate/react";
import { ReactNode } from "react";
⋮----
import {
  idPayApiBaseUrl,
  idPayApiUatBaseUrl,
  idPayApiUatVersion,
  idPayApiVersion,
  idPayTestToken
} from "../../../../config";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isPagoPATestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { bpdTokenSelector } from "../../../authentication/common/store/selectors";
import { createIDPayClient } from "../../common/api/client";
import { createActionsImplementation } from "./actions";
import { createActorsImplementation } from "./actors";
import { idPayPaymentMachine } from "./machine";
⋮----
type Props = {
  children: ReactNode;
};
⋮----
export const IdPayPaymentMachineProvider = (props: Props) =>
</file>

<file path="apps/main-app/ts/features/idpay/payment/machine/selectors.ts">
import { SnapshotFrom } from "xstate";
⋮----
import { IdPayTags } from "../../common/machine/tags";
import { idPayPaymentMachine } from "./machine";
⋮----
type MachineSnapshot = SnapshotFrom<typeof idPayPaymentMachine>;
⋮----
export const isAuthorizingSelector = (snapshot: MachineSnapshot)
⋮----
export const isCancellingSelector = (snapshot: MachineSnapshot)
⋮----
export const isCancelledSelector = (snapshot: MachineSnapshot)
⋮----
export const failureSelector = (snapshot: MachineSnapshot)
⋮----
export const transactionDataSelector = (snapshot: MachineSnapshot)
⋮----
export const areButtonsDisabledSelector = (snapshot: MachineSnapshot)
⋮----
export const dataEntrySelector = (
  snapshot: MachineSnapshot
): "manual" | "qr_code"
</file>

<file path="apps/main-app/ts/features/idpay/payment/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { IdPayFeatureFlagGuard } from "../../common/components/IdPayFeatureFlagGuard";
import {
  IdPayPaymentMachineContext,
  IdPayPaymentMachineProvider
} from "../machine/provider";
import { IDPayPaymentAuthorizationScreen } from "../screens/IDPayPaymentAuthorizationScreen";
import { IDPayPaymentCodeInputScreen } from "../screens/IDPayPaymentCodeInputScreen";
import { IDPayPaymentResultScreen } from "../screens/IDPayPaymentResultScreen";
import { IdPayPaymentParamsList } from "./params";
import { IdPayPaymentRoutes } from "./routes";
</file>

<file path="apps/main-app/ts/features/idpay/payment/navigation/params.ts">
import { IDPayPaymentAuthorizationScreenRouteParams } from "../screens/IDPayPaymentAuthorizationScreen";
import { IdPayPaymentRoutes } from "./routes";
⋮----
export type IdPayPaymentParamsList = {
  [IdPayPaymentRoutes.IDPAY_PAYMENT_AUTHORIZATION]: IDPayPaymentAuthorizationScreenRouteParams;
  [IdPayPaymentRoutes.IDPAY_PAYMENT_CODE_INPUT]: undefined;
  [IdPayPaymentRoutes.IDPAY_PAYMENT_MAIN]: undefined;
  [IdPayPaymentRoutes.IDPAY_PAYMENT_RESULT]: undefined;
};
</file>

<file path="apps/main-app/ts/features/idpay/payment/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/idpay/payment/screens/IDPayPaymentAuthorizationScreen.tsx">
import { AuthPaymentResponseDTO } from "@io-app/api-types/generated/definitions/idpay/AuthPaymentResponseDTO";
import {
  Divider,
  H3,
  H6,
  IOSkeleton,
  ListItemInfo,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { RouteProp, useRoute } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect } from "react";
import { View } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIODispatch } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { identificationRequest } from "../../../identification/store/actions";
import { isLoadingSelector } from "../../common/machine/selectors";
import {
  formatDateOrDefault,
  formatNumberCurrencyCents,
  formatNumberCurrencyCentsOrDefault
} from "../../common/utils/strings";
import {
  trackIDPayDetailAuthorizationCancel,
  trackIDPayDetailAuthorizationConversion,
  trackIDPayDetailAuthorizationSummary
} from "../../details/analytics";
import { IdPayPaymentMachineContext } from "../machine/provider";
import {
  areButtonsDisabledSelector,
  dataEntrySelector,
  isAuthorizingSelector,
  transactionDataSelector
} from "../machine/selectors";
import { IdPayPaymentParamsList } from "../navigation/params";
⋮----
export type IDPayPaymentAuthorizationScreenRouteParams = {
  data_entry?: "manual" | "qr_code";
  trxCode?: string;
};
⋮----
type IDPayPaymentAuthorizationRouteProps = RouteProp<
  IdPayPaymentParamsList,
  "IDPAY_PAYMENT_AUTHORIZATION"
>;
⋮----
const handleCancel = () =>
⋮----
const handleConfirm = () =>
⋮----
const renderContent = () =>
⋮----
value={formatNumberCurrencyCents(data.amountCents)}
      />
      <Divider />
      <ListItemInfo
        accessibilityLabel={I18n.t("idpay.payment.authorization.businessName")}
        label={I18n.t("idpay.payment.authorization.businessName")}
        value={data.businessName || "-"}
      />
      <Divider />
      <ListItemInfo
        accessibilityLabel={I18n.t("idpay.payment.authorization.dateTime")}
        label={I18n.t("idpay.payment.authorization.dateTime")}
        value={formatDateOrDefault(data.trxDate)}
      />
      <Divider />
      <ListItemInfo
        accessibilityLabel={I18n.t(
          "idpay.payment.authorization.initiativeName"
        )}
        label={I18n.t("idpay.payment.authorization.initiativeName")}
        value={data.initiativeName || "-"}
      />
    </>
  );
</file>

<file path="apps/main-app/ts/features/idpay/payment/screens/IDPayPaymentCodeInputScreen.tsx">
import { TextInput } from "@io-app/design-system";
⋮----
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useState } from "react";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { isLoadingSelector } from "../../common/machine/selectors";
import {
  trackIDPayDetailManualEntryConfirm,
  trackIDPayDetailManualEntryLanding
} from "../../details/analytics";
import { idpayInitiativeDetailsSelector } from "../../details/store";
import { IDPayTransactionCode } from "../common/types";
import { IdPayPaymentMachineContext } from "../machine/provider";
⋮----
type InputState = {
  code: O.Option<E.Either<unknown, string>>;
  value?: string;
};
⋮----
const navigateToPaymentAuthorization = ()
</file>

<file path="apps/main-app/ts/features/idpay/payment/screens/IDPayPaymentCodeScanScreen.tsx">
import { IOToast, triggerHaptic } from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { Alert, View } from "react-native";
⋮----
import { useOpenDeepLink } from "../../../../hooks/useOpenDeepLink";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import {
  BarcodeFailure,
  BarcodeScanBaseScreenComponent,
  IOBarcode,
  IOBarcodeFormat,
  IOBarcodeType,
  useIOBarcodeFileReader
} from "../../../barcode";
⋮----
import { IOBarcodeOrigin } from "../../../barcode/types/IOBarcode";
import { IdPayFeatureFlagGuard } from "../../common/components/IdPayFeatureFlagGuard";
import { IdPayPaymentRoutes } from "../navigation/routes";
⋮----
const IDPayPaymentCodeScan = () =>
⋮----
const handleBarcodeSuccess = (
    barcodes: Array<IOBarcode>,
    origin: IOBarcodeOrigin
) =>
⋮----
const handleBarcodeError = (failure: BarcodeFailure) =>
⋮----
const navigateToCodeInputScreen = () =>
</file>

<file path="apps/main-app/ts/features/idpay/payment/screens/IDPayPaymentResultScreen.tsx">
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useMemo } from "react";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import useIDPayFailureSupportModal from "../../common/hooks/useIDPayFailureSupportModal";
import {
  trackIDPayDetailAuthorizationError,
  trackIDPayDetailAuthorizationUXSuccess
} from "../../details/analytics";
import { idpayInitiativeDetailsSelector } from "../../details/store";
import { IdPayPaymentMachineContext } from "../machine/provider";
import {
  dataEntrySelector,
  failureSelector,
  isCancelledSelector
} from "../machine/selectors";
import { PaymentFailureEnum } from "../types/PaymentFailure";
⋮----
const mapFailureToContentProps = (
  failure: PaymentFailureEnum
): OperationResultScreenContentProps =>
</file>

<file path="apps/main-app/ts/features/idpay/payment/types/PaymentFailure.ts">
import { CodeEnum } from "@io-app/api-types/generated/definitions/idpay/TransactionErrorDTO";
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
enum SessionExpiredEnum {
  SESSION_EXPIRED = "SESSION_EXPIRED"
}
⋮----
export type PaymentFailureEnum = CodeEnum | SessionExpiredEnum;
⋮----
export type PaymentFailure = t.TypeOf<typeof PaymentFailure>;
</file>

<file path="apps/main-app/ts/features/idpay/timeline/components/IdPayTimelineDetailsBottomSheet.tsx">
import { InitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { OperationListDTO } from "@io-app/api-types/generated/definitions/idpay/OperationListDTO";
import { OperationTypeEnum as RefundOperationTypeEnum } from "@io-app/api-types/generated/definitions/idpay/RefundOperationDTO";
import { OperationTypeEnum as TransactionOperationTypeEnum } from "@io-app/api-types/generated/definitions/idpay/TransactionDetailDTO";
import { ChannelEnum } from "@io-app/api-types/generated/definitions/idpay/TransactionOperationDTO";
import {
  H6,
  IODimensions,
  IOSkeleton,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
⋮----
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
import { useState } from "react";
import { View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  IOBottomSheetModal,
  useIOBottomSheetModal
} from "../../../../utils/hooks/bottomSheet";
import { idpayTimelineDetailsSelector } from "../store";
import { idpayTimelineDetailsGet } from "../store/actions";
import { IdPayTimelineDiscountTransactionDetailsComponent } from "./IdPayTimelineDiscountTransactionDetailsComponent";
import { IdPayTimelineRefundDetailsComponent } from "./IdPayTimelineRefundDetailsComponent";
import { IdPayTimelineTransactionDetailsComponent } from "./IdPayTimelineTransactionDetailsComponent";
⋮----
type OperationWithDetailsType = t.TypeOf<typeof OperationWithDetailsType>;
⋮----
const getOperationDetailsTitle = (type: OperationWithDetailsType): string =>
⋮----
type IdPayTimelineDetailsBottomSheetModal = Omit<
  IOBottomSheetModal,
  "present"
> & {
  present: (operation: OperationListDTO) => void;
};
⋮----
const useIdPayTimelineDetailsBottomSheet = (
  initiativeId: InitiativeDTO["initiativeId"]
): IdPayTimelineDetailsBottomSheetModal =>
⋮----
const getModalContent = () =>
⋮----
const present = (operation: OperationListDTO)
</file>

<file path="apps/main-app/ts/features/idpay/timeline/components/IdPayTimelineDiscountTransactionDetailsComponent.tsx">
import {
  TransactionDetailDTO,
  StatusEnum as TransactionStatusEnum
} from "@io-app/api-types/generated/definitions/idpay/TransactionDetailDTO";
import {
  Alert,
  Divider,
  ListItemHeader,
  ListItemInfo,
  ListItemInfoCopy,
  VSpacer
} from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { format } from "../../../../utils/dates";
import { formatNumberCentsToAmount } from "../../../../utils/stringBuilder";
⋮----
type Props = {
  transaction: TransactionDetailDTO;
};
⋮----
const getTransactionStatusLabel = (status: TransactionStatusEnum): string =>
</file>

<file path="apps/main-app/ts/features/idpay/timeline/components/IdPayTimelineRefundDetailsComponent.tsx">
import { useBottomSheet } from "@gorhom/bottom-sheet";
import { RefundDetailDTO } from "@io-app/api-types/generated/definitions/idpay/RefundDetailDTO";
import { OperationTypeEnum } from "@io-app/api-types/generated/definitions/idpay/RefundOperationDTO";
import {
  Alert,
  Divider,
  ListItemHeader,
  ListItemInfo,
  ListItemInfoCopy,
  VSpacer
} from "@io-app/design-system";
import { CommonActions } from "@react-navigation/native";
import { format } from "date-fns";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
import NavigationService from "../../../../navigation/NavigationService";
import { useIOSelector } from "../../../../store/hooks";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { formatNumberCentsToAmount } from "../../../../utils/stringBuilder";
import { IdPayConfigurationRoutes } from "../../configuration/navigation/routes";
import { idpayInitiativeIdSelector } from "../../details/store";
import { getRefundPeriodDateString } from "../utils/strings";
⋮----
type Props = {
  refund: RefundDetailDTO;
};
⋮----
const handleEditIbanPress = () =>
</file>

<file path="apps/main-app/ts/features/idpay/timeline/components/IdPayTimelineTransactionDetailsComponent.tsx">
import {
  TransactionDetailDTO,
  OperationTypeEnum as TransactionTypeEnum
} from "@io-app/api-types/generated/definitions/idpay/TransactionDetailDTO";
import {
  Alert,
  Divider,
  IOLogoPaymentType,
  ListItemHeader,
  ListItemInfo,
  ListItemInfoCopy,
  VSpacer
} from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { format } from "../../../../utils/dates";
import { formatNumberCentsToAmount } from "../../../../utils/stringBuilder";
import { getLabelForCircuitType } from "../../common/labels";
⋮----
type Props = {
  transaction: TransactionDetailDTO;
};
⋮----
getLabelForCircuitType(transaction.circuitType) as IOLogoPaymentType
⋮----
clipboardSetStringWithFeedback(idTrxAcquirer);
</file>

<file path="apps/main-app/ts/features/idpay/timeline/saga/handleGetTimelineDetails.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idpayTimelineDetailsGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/timeline/saga/index.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { IDPayClient } from "../../common/api/client";
import { idpayTimelineDetailsGet } from "../store/actions";
import { handleGetTimelineDetails } from "./handleGetTimelineDetails";
</file>

<file path="apps/main-app/ts/features/idpay/timeline/store/__test__/store.test.ts">
import {
  StatusEnum,
  TransactionDetailDTO
} from "@io-app/api-types/generated/definitions/idpay/TransactionDetailDTO";
import { OperationTypeEnum as TransactionOperationType } from "@io-app/api-types/generated/definitions/idpay/TransactionOperationDTO";
⋮----
import { createStore } from "redux";
⋮----
import { idpayTimelineDetailsSelector } from "..";
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { NetworkError } from "../../../../../utils/errors";
import { idpayTimelineDetailsGet } from "../actions";
</file>

<file path="apps/main-app/ts/features/idpay/timeline/store/actions/index.ts">
import { InitiativeDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { OperationDTO } from "@io-app/api-types/generated/definitions/idpay/OperationDTO";
import { OperationListDTO } from "@io-app/api-types/generated/definitions/idpay/OperationListDTO";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
type IdPayTimelineDetailsGetPayloadType = {
  initiativeId: InitiativeDTO["initiativeId"];
  operationId: OperationListDTO["operationId"];
};
⋮----
export type IdPayTimelineActions = ActionType<typeof idpayTimelineDetailsGet>;
</file>

<file path="apps/main-app/ts/features/idpay/timeline/store/index.ts">
import { OperationDTO } from "@io-app/api-types/generated/definitions/idpay/OperationDTO";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import { idpayTimelineDetailsGet } from "./actions";
⋮----
export type IdPayTimelineState = {
  details: pot.Pot<OperationDTO, NetworkError>;
};
⋮----
const reducer = (
  state: IdPayTimelineState = INITIAL_STATE,
  action: Action
): IdPayTimelineState =>
⋮----
const idpayTimelineSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/idpay/timeline/utils/strings.ts">
import { RefundDetailDTO } from "@io-app/api-types/generated/definitions/idpay/RefundDetailDTO";
import { format } from "date-fns";
import { sequenceS } from "fp-ts/lib/Apply";
import { pipe } from "fp-ts/lib/function";
⋮----
const getRefundPeriodDateString = (refund: RefundDetailDTO)
</file>

<file path="apps/main-app/ts/features/idpay/unsubscription/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { IdPayFeatureFlagGuard } from "../../common/components/IdPayFeatureFlagGuard";
import IdPayUnsubscriptionConfirmationScreen from "../screens/IdPayUnsubscriptionConfirmationScreen";
import IdPayUnsubscriptionResultScreen from "../screens/IdPayUnsubscriptionResultScreen";
import { IdPayUnsubscriptionParamsList } from "./params";
import { IdPayUnsubscriptionRoutes } from "./routes";
⋮----
export const IdPayUnsubscriptionNavigator = () => (
  <IdPayFeatureFlagGuard>
    <Stack.Navigator
      initialRouteName={
        IdPayUnsubscriptionRoutes.IDPAY_UNSUBSCRIPTION_CONFIRMATION
      }
    >
      <Stack.Screen
        component={IdPayUnsubscriptionConfirmationScreen}
        name={IdPayUnsubscriptionRoutes.IDPAY_UNSUBSCRIPTION_CONFIRMATION}
      />
      <Stack.Screen
        component={IdPayUnsubscriptionResultScreen}
        name={IdPayUnsubscriptionRoutes.IDPAY_UNSUBSCRIPTION_RESULT}
        options={{ headerShown: false }}
      />
    </Stack.Navigator>
  </IdPayFeatureFlagGuard>
);
</file>

<file path="apps/main-app/ts/features/idpay/unsubscription/navigation/params.ts">
import { IdPayUnsubscriptionConfirmationScreenParams } from "../screens/IdPayUnsubscriptionConfirmationScreen";
import { IdPayUnsubscriptionRoutes } from "./routes";
⋮----
export type IdPayUnsubscriptionParamsList = {
  [IdPayUnsubscriptionRoutes.IDPAY_UNSUBSCRIPTION_CONFIRMATION]: IdPayUnsubscriptionConfirmationScreenParams;
  [IdPayUnsubscriptionRoutes.IDPAY_UNSUBSCRIPTION_RESULT]: undefined;
};
</file>

<file path="apps/main-app/ts/features/idpay/unsubscription/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/idpay/unsubscription/saga/handleUnsubscribe.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { walletRemoveCards } from "../../../wallet/store/actions/cards";
import { IDPayClient } from "../../common/api/client";
import { idPayUnsubscribeAction } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/unsubscription/saga/index.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { IDPayClient } from "../../common/api/client";
import { idPayUnsubscribeAction } from "../store/actions";
import { handleUnsubscribe } from "./handleUnsubscribe";
</file>

<file path="apps/main-app/ts/features/idpay/unsubscription/screens/IdPayUnsubscriptionConfirmationScreen.tsx">
import { InitiativeRewardTypeEnum } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import {
  Body,
  FooterActionsInline,
  ListItemCheckbox,
  VSpacer
} from "@io-app/design-system";
import { RouteProp, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useEffect } from "react";
import { View } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useConfirmationChecks } from "../../../../hooks/useConfirmationChecks";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { IdPayUnsubscriptionParamsList } from "../navigation/params";
import { IdPayUnsubscriptionRoutes } from "../navigation/routes";
import { idPayUnsubscribeAction } from "../store/actions";
import {
  isFailureSelector,
  isLoadingSelector,
  isUnsubscriptionSuccessSelector
} from "../store/selectors";
⋮----
export type IdPayUnsubscriptionConfirmationScreenParams = {
  initiativeId: string;
  initiativeName: string;
  initiativeType: InitiativeRewardTypeEnum;
};
⋮----
type RouteProps = RouteProp<
  IdPayUnsubscriptionParamsList,
  "IDPAY_UNSUBSCRIPTION_CONFIRMATION"
>;
⋮----
const handleClosePress = () =>
⋮----
const handleConfirmPress = () =>
</file>

<file path="apps/main-app/ts/features/idpay/unsubscription/screens/IdPayUnsubscriptionResultScreen.tsx">
import { IOPictograms } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { idPayUnsubscribeAction } from "../store/actions";
import { isFailureSelector } from "../store/selectors";
⋮----
type ScreenContentType = {
  buttonLabel: string;
  pictogram: IOPictograms;
  subtitle: string;
  title: string;
};
⋮----
const handleButtonPress = () =>
</file>

<file path="apps/main-app/ts/features/idpay/unsubscription/store/actions/index.ts">
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type IdPayUnsubscriptionActions = ActionType<
  typeof idPayUnsubscribeAction
>;
</file>

<file path="apps/main-app/ts/features/idpay/unsubscription/store/reducers/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import { idPayUnsubscribeAction } from "../actions";
⋮----
export type IdPayUnsubscriptionState = pot.Pot<undefined, NetworkError>;
⋮----
const reducer = (
  state: IdPayUnsubscriptionState = INITIAL_STATE,
  action: Action
): IdPayUnsubscriptionState =>
</file>

<file path="apps/main-app/ts/features/idpay/unsubscription/store/selectors/index.ts">
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const isUnsubscriptionSuccessSelector = (state: GlobalState)
⋮----
export const isLoadingSelector = (state: GlobalState)
⋮----
export const isFailureSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/idpay/wallet/analytics/index.ts">
import { StatusEnum as InitiativeOnboardingStatus } from "@io-app/api-types/generated/definitions/idpay/UserOnboardingStatusDTO";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
⋮----
type DefaultEventProperties = {
  initiativeId?: string;
  status: InitiativeOnboardingStatus;
};
⋮----
const toMixpanelStatus = (status: InitiativeOnboardingStatus) =>
⋮----
export const trackIDPayOnWaitingListInfoButtonTap = ({
  status,
  ...props
}: DefaultEventProperties) =>
</file>

<file path="apps/main-app/ts/features/idpay/wallet/components/IdPayCard.tsx">
import { InitiativeRewardTypeEnum } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import {
  Avatar,
  Body,
  H3,
  H6,
  IOColors,
  useIOThemeContext,
  VSpacer
} from "@io-app/design-system";
⋮----
import { format } from "date-fns";
import I18n from "i18next";
import {
  ColorSchemeName,
  ImageURISource,
  StyleSheet,
  View
} from "react-native";
⋮----
import WalletCardShape from "../../../../../img/features/idpay/wallet_card.svg";
import DarkModeWalletCardShape from "../../../../../img/features/idpay/wallet_card_dark.svg";
import { useIOSelector } from "../../../../store/hooks";
import { formatNumberCentsToAmount } from "../../../../utils/stringBuilder";
import { idPayWalletInitiativeListSelector } from "../store/reducers";
⋮----
export type IdPayCardProps = {
  amount: number;
  avatarSource: ImageURISource;
  expireDate: Date;
  name: string;
};
⋮----
</file>

<file path="apps/main-app/ts/features/idpay/wallet/components/IdPayInitiativeWaitingList.tsx">
import {
  StatusEnum as InitiativeOnboardingStatus,
  UserOnboardingStatusDTO
} from "@io-app/api-types/generated/definitions/idpay/UserOnboardingStatusDTO";
import {
  Divider,
  IOMarkdown,
  ListItemHeader,
  ListItemInfo,
  VSpacer
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { useState } from "react";
import { FlatList } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isIdPayEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { isAndroid } from "../../../../utils/platform";
import { trackIDPayOnWaitingListInfoButtonTap } from "../analytics";
import { idPayInitiativeWaitingListGet } from "../store/actions";
import { idPayInitiativeWaitingListSelector } from "../store/reducers";
⋮----
switch (initiativeStatus)
</file>

<file path="apps/main-app/ts/features/idpay/wallet/components/IdPayInstrumentInitiativesList.tsx">
import {
  InitiativesStatusDTO,
  StatusEnum
} from "@io-app/api-types/generated/definitions/idpay/InitiativesStatusDTO";
import { Badge, Divider, ListItemSwitch } from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { Fragment, useCallback } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  idpayInitiativesInstrumentDelete,
  idpayInitiativesInstrumentEnroll
} from "../store/actions";
import { idPayInitiativeFromInstrumentPotSelector } from "../store/reducers";
⋮----
type Props = {
  idWallet: string;
  initiatives: ReadonlyArray<InitiativesStatusDTO>;
};
⋮----
const IdPayInitiativeListItemSwitch = ({
  item,
  idWallet
}: IdPayInitiativeListItemSwitchProps) =>
⋮----
onSwitchValueChange=
</file>

<file path="apps/main-app/ts/features/idpay/wallet/components/IdPayWalletCard.tsx">
import { Pressable } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { withWalletCardBaseComponent } from "../../../wallet/components/WalletCardBaseComponent";
import { IDPayDetailsRoutes } from "../../details/navigation";
import { IdPayCard, IdPayCardProps } from "./IdPayCard";
⋮----
export type IdPayWalletCardProps = IdPayCardProps & {
  initiativeId: string;
};
⋮----
const WrappedIdPayCard = (props: IdPayWalletCardProps) =>
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/idpay/wallet/saga/__test__/handleGetWallet.test.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { WalletDTO } from "@io-app/api-types/generated/definitions/idpay/WalletDTO";
⋮----
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { withRefreshApiCall } from "../../../../authentication/fastLogin/saga/utils";
import { walletAddCards } from "../../../../wallet/store/actions/cards";
import { idPayWalletGet } from "../../store/actions";
import { handleGetIDPayWallet } from "../handleGetWallet";
</file>

<file path="apps/main-app/ts/features/idpay/wallet/saga/handleGetInitiativesFromInstrument.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, delay, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idPayInitiativesFromInstrumentGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/wallet/saga/handleGetInitiativeWaitingList.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idPayInitiativeWaitingListGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/wallet/saga/handleGetWallet.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { handleRemoveMissingCards } from "../../../wallet/saga/handleRemoveMissingCards";
import { walletAddCards } from "../../../wallet/store/actions/cards";
import { IDPayClient } from "../../common/api/client";
import { idPayWalletGet } from "../store/actions";
⋮----
// Create set of keys from latest API response and remove stored cards
</file>

<file path="apps/main-app/ts/features/idpay/wallet/saga/handleInitiativeInstrumentDelete.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
⋮----
import { pipe } from "fp-ts/lib/function";
import I18n from "i18next";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idpayInitiativesInstrumentDelete } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/wallet/saga/handleInitiativeInstrumentEnrollment.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { IOToast } from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
import I18n from "i18next";
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { IDPayClient } from "../../common/api/client";
import { idpayInitiativesInstrumentEnroll } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/idpay/wallet/saga/index.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { channel, SagaIterator } from "redux-saga";
import {
  call,
  put,
  race,
  take,
  takeEvery,
  takeLatest
} from "typed-redux-saga/macro";
⋮----
import { IDPayClient } from "../../common/api/client";
import {
  idPayInitiativesFromInstrumentGet,
  IdPayInitiativesFromInstrumentPayloadType,
  idPayInitiativesFromInstrumentRefreshStart,
  idPayInitiativesFromInstrumentRefreshStop,
  idpayInitiativesInstrumentDelete,
  idpayInitiativesInstrumentEnroll,
  idPayInitiativeWaitingListGet,
  idPayWalletGet
} from "../store/actions";
import {
  handleGetIDPayInitiativesFromInstrument,
  handleInitiativesFromInstrumentRefresh
} from "./handleGetInitiativesFromInstrument";
import { handleGetInitiativeWaitingList } from "./handleGetInitiativeWaitingList";
import { handleGetIDPayWallet } from "./handleGetWallet";
import { handleInitiativeInstrumentDelete } from "./handleInitiativeInstrumentDelete";
import { handleInitiativeInstrumentEnrollment } from "./handleInitiativeInstrumentEnrollment";
</file>

<file path="apps/main-app/ts/features/idpay/wallet/screens/IdPayInstrumentInitiativesScreen.tsx">
import { H2, H6, HSpacer, IODimensions, VSpacer } from "@io-app/design-system";
⋮----
import { Route, useRoute } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect } from "react";
import { ScrollView, View } from "react-native";
⋮----
import { LogoPaymentWithFallback } from "../../../../components/ui/utils/components/LogoPaymentWithFallback";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { IdPayInstrumentInitiativesList } from "../components/IdPayInstrumentInitiativesList";
import {
  idPayInitiativesFromInstrumentRefreshStart,
  idPayInitiativesFromInstrumentRefreshStop
} from "../store/actions";
import { idPayInitiativesFromInstrumentSelector } from "../store/reducers";
⋮----
export type IdPayInstrumentInitiativesScreenRouteParams = {
  idWallet: string;
};
</file>

<file path="apps/main-app/ts/features/idpay/wallet/store/actions/index.ts">
import { InitiativesWithInstrumentDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativesWithInstrumentDTO";
import { ListUsersOnboardingStatusDTO } from "@io-app/api-types/generated/definitions/idpay/ListUsersOnboardingStatusDTO";
import { WalletDTO } from "@io-app/api-types/generated/definitions/idpay/WalletDTO";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type IdPayInitiativesFromInstrumentPayloadType = {
  idWallet: string;
  isRefreshing?: boolean;
};
⋮----
export type IdpayInitiativesInstrumentDeletePayloadType = {
  initiativeId: string;
  instrumentId: string;
};
⋮----
export type IdpayInitiativesInstrumentEnrollPayloadType = {
  idWallet: string;
  initiativeId: string;
};
⋮----
type InitiativeId = { initiativeId: string };
type NetworkErrorWithInitiativeId = {
  error: NetworkError;
  initiativeId: string;
};
⋮----
export type IdPayWalletActions =
  | ActionType<typeof idPayInitiativesFromInstrumentGet>
  | ActionType<typeof idPayInitiativesFromInstrumentRefreshStart>
  | ActionType<typeof idPayInitiativesFromInstrumentRefreshStop>
  | ActionType<typeof idpayInitiativesInstrumentDelete>
  | ActionType<typeof idpayInitiativesInstrumentEnroll>
  | ActionType<typeof idPayInitiativeWaitingListGet>
  | ActionType<typeof idPayWalletGet>
  | ActionType<typeof setIdPayOnboardingSucceeded>;
</file>

<file path="apps/main-app/ts/features/idpay/wallet/store/reducers/__test__/reducer.test.ts">
import { InitiativesWithInstrumentDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativesWithInstrumentDTO";
import { WalletDTO } from "@io-app/api-types/generated/definitions/idpay/WalletDTO";
⋮----
import { createStore } from "redux";
⋮----
import {
  idPayAreInitiativesFromInstrumentLoadingSelector,
  idPayEnabledInitiativesFromInstrumentSelector,
  idPayInitiativesAwaitingUpdateSelector,
  idPayInitiativesFromInstrumentSelector,
  idPayWalletInitiativeListSelector
} from "..";
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { isIdPayEnabledSelector } from "../../../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../../../store/reducers/types";
import { NetworkError } from "../../../../../../utils/errors";
import {
  idPayInitiativesFromInstrumentGet,
  idpayInitiativesInstrumentDelete,
  idpayInitiativesInstrumentEnroll,
  idPayWalletGet
} from "../../actions";
</file>

<file path="apps/main-app/ts/features/idpay/wallet/store/reducers/index.ts">
import { StatusEnum as InitiativeStatus } from "@io-app/api-types/generated/definitions/idpay/InitiativeDTO";
import { StatusEnum as InstrumentInitiativeStatus } from "@io-app/api-types/generated/definitions/idpay/InitiativesStatusDTO";
import { InitiativesWithInstrumentDTO } from "@io-app/api-types/generated/definitions/idpay/InitiativesWithInstrumentDTO";
import { ListUsersOnboardingStatusDTO } from "@io-app/api-types/generated/definitions/idpay/ListUsersOnboardingStatusDTO";
import { WalletDTO } from "@io-app/api-types/generated/definitions/idpay/WalletDTO";
⋮----
import { pipe } from "fp-ts/lib/function";
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { isIdPayEnabledSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../../store/reducers/types";
import { NetworkError } from "../../../../../utils/errors";
import {
  idPayInitiativesFromInstrumentGet,
  idpayInitiativesInstrumentDelete,
  idpayInitiativesInstrumentEnroll,
  idPayInitiativeWaitingListGet,
  idPayWalletGet,
  setIdPayOnboardingSucceeded
} from "../actions";
⋮----
export type IdPayWalletState = {
  initiatives: pot.Pot<WalletDTO, NetworkError>;
  initiativesAwaitingStatusUpdate: Record<string, boolean>;
  initiativesWithInstrument: pot.Pot<
    InitiativesWithInstrumentDTO,
    NetworkError
  >;
  initiativeWaitingList: pot.Pot<ListUsersOnboardingStatusDTO, NetworkError>;
  onboardingSucceeded: boolean;
};
⋮----
const reducer = (
  state: IdPayWalletState = INITIAL_STATE,
  action: Action
): IdPayWalletState =>
⋮----
const selectIdPayWallet = (state: GlobalState)
⋮----
export const idPayInitiativeFromInstrumentPotSelector = (
  initiativeId: string
)
</file>

<file path="apps/main-app/ts/features/ingress/__test__/IngressScreen.test.tsx">
import { act, waitFor } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import {
  applicationChangeState,
  startApplicationInitialization
} from "../../../store/actions/application";
⋮----
import { appReducer } from "../../../store/reducers";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../utils/testWrapper";
import { setConnectionStatus } from "../../connectivity/store/actions";
⋮----
import { identificationRequest } from "../../identification/store/actions";
import { IdentificationBackActionType } from "../../identification/store/reducers";
⋮----
import { IngressScreen } from "../screens/IngressScreen";
import { isBlockingScreenSelector } from "../store/selectors";
⋮----
const renderComponentWithSlowdowns = async () =>
⋮----
const getFirstText = ()
const getSecondText = ()
const getDeviceBlockingScreen = ()
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/ingress/analytics/index.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
import { ITW_ROUTES } from "../../itwallet/navigation/routes";
⋮----
export function trackIngressCdnSystemError()
⋮----
export function trackIngressNoInternetConnection()
⋮----
export function trackIngressServicesSlowDown()
⋮----
export function trackIngressTimeout(API_failure: string)
⋮----
export function trackIngressOfflineWalletBannerCTAClicked()
⋮----
export function trackSettingsDiscoverBannerVisualized()
</file>

<file path="apps/main-app/ts/features/ingress/saga/index.ts">
import { call, put, select, take, takeLatest } from "typed-redux-saga/macro";
import { getType } from "typesafe-actions";
⋮----
import { startupLoadSuccess } from "../../../store/actions/startup";
import { StartupStatusEnum } from "../../../store/reducers/startup";
import { setConnectionStatus } from "../../connectivity/store/actions";
import { isConnectedSelector } from "../../connectivity/store/selectors";
import { itwOfflineAccessAvailableSelector } from "../../itwallet/common/store/selectors";
import { setOfflineAccessReason } from "../store/actions";
import { OfflineAccessReasonEnum } from "../store/reducer";
import { offlineAccessReasonSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/ingress/screens/IngressScreen.tsx">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
⋮----
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import I18n from "i18next";
import { isEqual } from "lodash";
import { memo, useCallback, useEffect, useRef, useState } from "react";
import { AccessibilityInfo, View } from "react-native";
⋮----
import { versionInfoDataSelector } from "../../../common/versionInfo/store/reducers/versionInfo";
import { IOVersionInfo } from "../../../common/versionInfo/types/IOVersionInfo";
import { LoadingScreenContent } from "../../../components/screens/LoadingScreenContent";
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import ModalSectionStatusComponent from "../../../components/SectionStatus/modal";
import { startApplicationInitialization } from "../../../store/actions/application";
import { startupLoadSuccess } from "../../../store/actions/startup";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { isBackendStatusLoadedSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { isMixpanelEnabled as isMixpanelEnabledSelector } from "../../../store/reducers/persistedPreferences";
import { StartupStatusEnum } from "../../../store/reducers/startup";
import { setAccessibilityFocus } from "../../../utils/accessibility";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { sessionInfoSelector } from "../../authentication/common/store/selectors";
import { isConnectedSelector } from "../../connectivity/store/selectors";
import { identificationRequest } from "../../identification/store/actions";
import { IdentificationBackActionType } from "../../identification/store/reducers";
import { itwOfflineAccessAvailableSelector } from "../../itwallet/common/store/selectors";
import { isMixpanelInitializedSelector } from "../../mixpanel/store/selectors";
import { trackIngressScreen } from "../../settings/common/analytics";
import { profileSelector } from "../../settings/common/store/selectors";
import { ProfileError } from "../../settings/common/store/types";
import {
  trackIngressCdnSystemError,
  trackIngressNoInternetConnection,
  trackIngressOfflineWalletBannerCTAClicked,
  trackIngressServicesSlowDown,
  trackIngressTimeout,
  trackSettingsDiscoverBannerVisualized
} from "../analytics";
import { setIsBlockingScreen, setOfflineAccessReason } from "../store/actions";
import { OfflineAccessReasonEnum } from "../store/reducer";
import {
  checkSessionErrorSelector,
  isBlockingScreenSelector
} from "../store/selectors";
⋮----
const getApiFailureValue = (
  isConnected: boolean | undefined,
  sessionLoaded: PublicSession | undefined,
  profileLoaded: pot.Pot<InitializedProfile, ProfileError>,
  checkSession: boolean,
  versionInfo: IOVersionInfo | null
): string =>
⋮----
trackIngressOfflineWalletBannerCTAClicked();
navigateOnOfflineMiniApp(OfflineAccessReasonEnum.TIMEOUT);
</file>

<file path="apps/main-app/ts/features/ingress/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { OfflineAccessReasonEnum } from "../reducer";
⋮----
export type IngressScreenActions = ActionType<
  | typeof resetOfflineAccessReason
  | typeof setIsBlockingScreen
  | typeof setOfflineAccessReason
>;
</file>

<file path="apps/main-app/ts/features/ingress/store/reducer/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { checkCurrentSession } from "../../../authentication/common/store/actions";
import {
  resetOfflineAccessReason,
  setIsBlockingScreen,
  setOfflineAccessReason
} from "../actions";
⋮----
export enum OfflineAccessReasonEnum {
  DEVICE_OFFLINE = "device_offline",
  SESSION_EXPIRED = "session_expired",
  SESSION_REFRESH = "session_refresh",
  TIMEOUT = "timeout"
}
export type IngressScreenState = {
  checkSession: {
    hasError: boolean;
  };
  isBlockingScreen: boolean;
  offlineAccessReason?: OfflineAccessReasonEnum;
};
⋮----
export const ingressScreenReducer = (
  state = initialIngressScreenState,
  action: Action
): IngressScreenState =>
</file>

<file path="apps/main-app/ts/features/ingress/store/selectors/index.ts">
import { GlobalState } from "../../../../store/reducers/types";
⋮----
export const isBlockingScreenSelector = (state: GlobalState)
⋮----
export const offlineAccessReasonSelector = (state: GlobalState)
⋮----
export const checkSessionErrorSelector = (state: GlobalState): boolean
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/properties/basePropertyBuilder.ts">
import { GlobalState } from "../../../../store/reducers/types";
import { itwShouldUpgradeCredentialSelector } from "../../common/store/selectors";
import {
  itwAuthLevelSelector,
  itwIdentificationModeSelector
} from "../../common/store/selectors/preferences";
import { getCredentialStatus } from "../../common/utils/itwCredentialStatusUtils";
import { validCredentialStatuses } from "../../common/utils/itwCredentialUtils.ts";
import { CredentialType } from "../../common/utils/itwMocksUtils";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import {
  itwCredentialsEidStatusSelector,
  itwCredentialsSelector
} from "../../credentials/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { mapPIDStatusToMixpanel } from "../utils";
import {
  CREDENTIAL_STATUS_MAP,
  ItwCredentialMixpanelStatus,
  ItwStatus,
  ItwThirdPartyCredentials,
  ItwWalletListCredential
} from "../utils/types";
import { ItwBaseProperties } from "./propertyTypes";
⋮----
export const buildItwBaseProperties = (
  state: GlobalState
): ItwBaseProperties =>
⋮----
export const buildPidProperties = (state: GlobalState) =>
⋮----
export const buildCredentialProperties = (state: GlobalState) =>
⋮----
const getMixpanelCredentialStatus = (
  type: CredentialType,
  state: GlobalState,
  isItwL3?: boolean
): ItwCredentialMixpanelStatus =>
⋮----
export const computeItwStatus = (
  authLevel: "L2" | "L3" | undefined,
  identificationMode: "cieId" | "ciePin" | "spid" | undefined,
  isItwL3?: boolean
): ItwStatus =>
⋮----
export const buildThirdPartyCredentialProperty = (
  state: GlobalState
): ItwThirdPartyCredentials
⋮----
export const buildWalletListCredentialProperty = (
  state: GlobalState
): ItwWalletListCredential
⋮----
const buildAggregateCredentialProperty = (
  state: GlobalState,
  belongsToProperty: (credential: CredentialMetadata) => boolean
): ItwThirdPartyCredentials & ItwWalletListCredential =>
⋮----
const isUsable = (credential: CredentialMetadata)
⋮----
const isThirdPartyCredential = ({
  credentialType,
  origin
}: CredentialMetadata)
⋮----
const isWalletListCredential = ({
  credentialType,
  origin
}: CredentialMetadata)
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/properties/profileProperties.ts">
import { getPeople, isMixpanelInstanceInitialized } from "../../../../mixpanel";
import { GlobalState } from "../../../../store/reducers/types";
import { buildItwBaseProperties } from "./basePropertyBuilder";
import { ItwBaseProperties } from "./propertyTypes";
⋮----
export type ItwProfileProperties = ItwBaseProperties;
⋮----
export const updateItwProfileProperties = (state: GlobalState) =>
⋮----
export const forceUpdateItwProfileProperties = (
  partialProps: Partial<ItwProfileProperties>
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/properties/propertyTypes.ts">
import {
  ItwCredentialMixpanelStatus,
  ItwPIDStatus,
  ItwStatus,
  ItwThirdPartyCredentials,
  ItwWalletListCredential
} from "../utils/types";
⋮----
export type ItwBaseProperties = {
  ITW_CED_V2?: ItwCredentialMixpanelStatus;
  ITW_CED_V3: ItwCredentialMixpanelStatus;
  ITW_ID_V2?: ItwPIDStatus;
  ITW_PG_V2?: ItwCredentialMixpanelStatus;
  ITW_PG_V3: ItwCredentialMixpanelStatus;
  ITW_PID: ItwPIDStatus;
  ITW_STATUS_V2: ItwStatus;
  ITW_THIRD_PARTY_CREDENTIAL: ItwThirdPartyCredentials;
  ITW_TS_V2?: ItwCredentialMixpanelStatus;
  ITW_TS_V3: ItwCredentialMixpanelStatus;
  ITW_WALLET_LIST_CREDENTIAL: ItwWalletListCredential;
};
⋮----
export type ItwAnalyticsCredential = (typeof ITW_ANALYTICS_CREDENTIALS)[number];
⋮----
export type WalletRevokedAnalyticsEvent = Record<
  ItwAnalyticsCredential,
  "not_available"
> & {
  ITW_STATUS_V2: "not_active";
  ITW_THIRD_PARTY_CREDENTIAL: "not_available";
  ITW_WALLET_LIST_CREDENTIAL: "not_available";
};
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/properties/propertyUpdaters.ts">
import { getType } from "typesafe-actions";
⋮----
import {
  getPeople,
  isMixpanelInstanceInitialized,
  registerSuperProperties
} from "../../../../mixpanel";
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import {
  resetOfflineAccessReason,
  setOfflineAccessReason
} from "../../../ingress/store/actions";
import {
  itwAuthLevelSelector,
  itwIdentificationModeSelector
} from "../../common/store/selectors/preferences";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { isItwAnalyticsCredential } from "../utils";
import { MixPanelCredential } from "../utils/types";
import {
  buildItwBaseProperties,
  buildPidProperties,
  buildThirdPartyCredentialProperty,
  buildWalletListCredentialProperty,
  computeItwStatus
} from "./basePropertyBuilder";
import {
  forceUpdateItwProfileProperties,
  ItwProfileProperties
} from "./profileProperties";
import {
  ITW_ANALYTICS_CREDENTIALS,
  ItwAnalyticsCredential,
  WalletRevokedAnalyticsEvent
} from "./propertyTypes";
import {
  buildItwSuperProperties,
  forceUpdateItwSuperProperties,
  ItwSuperProperties
} from "./superProperties";
⋮----
export const updateItwAnalyticsProperties = (state: GlobalState) =>
⋮----
const updateItwProfilePropertiesWithProps = (props: ItwProfileProperties) =>
⋮----
const updateItwSuperPropertiesWithProps = (props: ItwSuperProperties) =>
⋮----
export const updateItwStatusAndPIDProperties = (state: GlobalState) =>
⋮----
export const updatePropertiesWalletRevoked = () =>
⋮----
export const updateCredentialProperties = (
  credential: MixPanelCredential,
  status: "not_available" | "valid"
) =>
⋮----
export const updateOfflineAccessReason = (
  action: Action
): ReadonlyArray<null> | void =>
⋮----
export const updateThirdPartyCredentialProperty = (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/properties/superProperties.ts">
import {
  isMixpanelInstanceInitialized,
  registerSuperProperties
} from "../../../../mixpanel";
import { GlobalState } from "../../../../store/reducers/types";
import { OfflineAccessReasonEnum } from "../../../ingress/store/reducer";
import { offlineAccessReasonSelector } from "../../../ingress/store/selectors";
import { buildItwBaseProperties } from "./basePropertyBuilder";
import { ItwBaseProperties } from "./propertyTypes";
⋮----
export type ItwSuperProperties = ItwBaseProperties & {
  OFFLINE_ACCESS_REASON: string;
};
⋮----
export const updateItwSuperProperties = (state: GlobalState) =>
⋮----
export const forceUpdateItwSuperProperties = (
  partialProps: Partial<ItwSuperProperties>
) =>
⋮----
export const buildItwSuperProperties = (
  state: GlobalState
): Pick<ItwSuperProperties, "OFFLINE_ACCESS_REASON"> => (
⋮----
const offlineReasonHandler = (
  state: GlobalState
): "not_available" | OfflineAccessReasonEnum =>
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/saga/credentialAnalyticsHandlers.ts">
import { SagaIterator } from "redux-saga";
import { select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { GlobalState } from "../../../../store/reducers/types";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import {
  itwCredentialsRemove,
  itwCredentialsStore
} from "../../credentials/store/actions";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import {
  updateCredentialProperties,
  updateItwStatusAndPIDProperties,
  updateThirdPartyCredentialProperty
} from "../properties/propertyUpdaters";
import { getMixPanelCredential } from "../utils";
import { MixPanelCredential } from "../utils/types";
⋮----
function getAnalyticsCredentialFromStored(
  credentials: ReadonlyArray<CredentialMetadata>,
  isItwL3: boolean
): MixPanelCredential | undefined
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { call, fork, select, takeEvery } from "typed-redux-saga/macro";
⋮----
import { registerSuperProperties } from "../../../../mixpanel.ts";
import { GlobalState } from "../../../../store/reducers/types";
import { getNfcAntennaInfo, isHceSupported } from "../../../../utils/nfc";
import { itwSetCredentialUpgradeFailed } from "../../common/store/actions/preferences";
import {
  itwCredentialsRemove,
  itwCredentialsStore
} from "../../credentials/store/actions";
import { itwFetchCredentialsCatalogue } from "../../credentialsCatalogue/store/actions";
import { updateItwAnalyticsProperties } from "../properties/propertyUpdaters";
import {
  handleAggregateCredentialPropertiesRefresh,
  handleCredentialRemovedAnalytics,
  handleCredentialStoredAnalytics
} from "./credentialAnalyticsHandlers";
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import { getCredentialStatus } from "../../../common/utils/itwCredentialStatusUtils";
import { isCredentialIssuedBeforePid } from "../../../common/utils/itwCredentialUtils";
import {
  itwCredentialsEidIssuedAtSelector,
  itwCredentialsSelector
} from "../../../credentials/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { getMixPanelCredential } from "../../utils";
import { CREDENTIAL_STATUS_MAP, ItwCredentialDetails } from "../../utils/types";
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/utils/index.ts">
import { ItwEidStatus } from "../../common/utils/itwTypesUtils";
import { IdentificationContext } from "../../machine/eid/context";
import {
  ITW_ANALYTICS_CREDENTIALS,
  ItwAnalyticsCredential
} from "../properties/propertyTypes";
import { CREDENTIALS_MAP, ItwPIDStatus, MixPanelCredential } from "./types";
⋮----
export const toSurveyAuthMethod = (
  identification: IdentificationContext | undefined
): string =>
⋮----
export const mapPIDStatusToMixpanel = (
  status: ItwEidStatus | undefined
): ItwPIDStatus =>
⋮----
export function getMixPanelCredential(
  credentialType: string,
  isItwL3: boolean
): MixPanelCredential
⋮----
export const isItwAnalyticsCredential = (
  c: MixPanelCredential
): c is ItwAnalyticsCredential
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/utils/types.ts">
import { ItwCredentialStatus } from "../../common/utils/itwTypesUtils";
import { IdentificationContext } from "../../machine/eid/context";
⋮----
export type KoState = {
  cta_category: "custom_1" | "custom_2";
  cta_id: string;
  reason: unknown;
};
⋮----
export type MixPanelCredentialVersion = "V2" | "V3";
⋮----
export type MixPanelCredential = (typeof mixPanelCredentials)[number];
⋮----
export type NewCredential = MixPanelCredential | OtherMixPanelCredential;
⋮----
type OtherMixPanelCredential = "CGN" | "payment_method" | "welfare";
⋮----
export type CredentialStatusAssertionFailure = {
  credential: MixPanelCredential;
  credential_status: string;
  reason?: unknown;
};
⋮----
export type ItwIdMethod =
  | "cieid_L2"
  | "cieid_L3"
  | IdentificationContext["mode"];
⋮----
export const toItwIdMethod = (ctx: IdentificationContext): ItwIdMethod =>
⋮----
export type ItwCredentialActionPosition = "bottom_sheet" | "screen";
⋮----
export type ItwCredentialMixpanelStatus =
  | "expired"
  | "expiring"
  | "expiring_verification"
  | "not_available"
  | "not_valid"
  | "unknown"
  | "valid"
  | "verification_expired";
⋮----
export type ItwPIDStatus = Extract<
  ItwCredentialMixpanelStatus,
  "expired" | "expiring" | "not_available" | "not_valid" | "valid"
>;
⋮----
export type ItwStatus =
  | "L2"
  | "L2+ (spid_can)"
  | "L3"
  | "L3 (cie_pin)"
  | "L3 (cieid_can)"
  | "L3 (cieid_pin)"
  | "not_active";
⋮----
export type ItwThirdPartyCredentials = "not_available" | "not_valid" | "valid";
⋮----
export type ItwWalletListCredential = "not_available" | "not_valid" | "valid";
⋮----
export type TrackITWalletIDMethodSelected = {
  itw_flow: ItwFlow;
  ITW_ID_method: ItwIdMethod;
};
⋮----
export type TrackItwBannerProperties = {
  banner_campaign?: string;
  banner_id: string;
  banner_landing: string;
  banner_page: string;
};
⋮----
export type ItwCopyListItem = {
  credential: MixPanelCredential;
  item_copied: string;
};
⋮----
export type ItwCredentialDetails = {
  [K in MixPanelCredential]?: ItwCredentialMixpanelStatus;
};
⋮----
export type ItwCredentialInfoDetails = {
  credential: MixPanelCredential;
  credential_screen_type: "detail" | "preview";
};
⋮----
export type ItwDismissalAction = {
  itw_flow: ItwFlow;
  screen_name: string;
  user_action: string;
};
⋮----
export type ItwFlow = "L2" | "L3" | "not_available" | "reissuing_eID";
⋮----
export type ItwScreenFlowContext = {
  itw_flow: ItwFlow;
  screen_name: string;
};
⋮----
export type ItwWalletDataShare = {
... (36 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/enum.ts">
export enum ITW_ACTIONS_EVENTS {
  CLOSE_BANNER = "CLOSE_BANNER",
  ITW_CLOSE_BANNER = "ITW_CLOSE_BANNER",
  ITW_CREDENTIAL_COPY_LIST_ITEM = "ITW_CREDENTIAL_COPY_LIST_ITEM",
  ITW_CREDENTIAL_QUALIFICATION_DETAIL = "ITW_CREDENTIAL_QUALIFICATION_DETAIL",
  ITW_CREDENTIAL_RENEW_START = "ITW_CREDENTIAL_RENEW_START",
  ITW_CREDENTIAL_SHOW_AUTH_SOURCE = "ITW_CREDENTIAL_SHOW_AUTH_SOURCE",
  ITW_CREDENTIAL_SHOW_ISSUER = "ITW_CREDENTIAL_SHOW_ISSUER",
  ITW_CREDENTIAL_START_REISSUING = "ITW_CREDENTIAL_START_REISSUING",
  ITW_DATA_SHARE_ACCEPTED = "ITW_DATA_SHARE_ACCEPTED",
  ITW_ID_METHOD_SELECTED = "ITW_ID_METHOD_SELECTED",
  ITW_KO_STATE_ACTION_SELECTED = "ITW_KO_STATE_ACTION_SELECTED",
  ITW_OPERATION_BLOCK_ACTION = "ITW_OPERATION_BLOCK_ACTION",
  ITW_START_ACTIVATION = "ITW_START_ACTIVATION",
  ITW_START_DEACTIVATION = "ITW_START_DEACTIVATION",
  ITW_TAP_BANNER = "ITW_TAP_BANNER",
  ITW_TOS = "ITW_TOS",
  SURVEY_REQUEST_ACCEPTED = "SURVEY_REQUEST_ACCEPTED",
  SURVEY_REQUEST_DECLINED = "SURVEY_REQUEST_DECLINED",
  TAP_BANNER = "TAP_BANNER",
  WALLET_ADD = "WALLET_ADD",
  WALLET_ADD_START = "WALLET_ADD_START",
  WALLET_CATEGORY_FILTER = "WALLET_CATEGORY_FILTER"
}
⋮----
export enum ITW_CONFIRM_EVENTS {
  ITW_DEACTIVATED = "ITW_DEACTIVATED",
  ITW_UX_SUCCESS = "ITW_UX_SUCCESS"
}
⋮----
export enum ITW_ERRORS_EVENTS {
  ITW_ADD_CREDENTIAL_TIMEOUT = "ITW_ADD_CREDENTIAL_TIMEOUT",
  ITW_STATUS_CREDENTIAL_ATTESTATION_FAILURE = "ITW_STATUS_CREDENTIAL_ATTESTATION_FAILURE",
  ITW_TRUSTMARK_RENEW_FAILURE = "ITW_TRUSTMARK_RENEW_FAILURE"
}
⋮----
export enum ITW_SCREENVIEW_EVENTS {
  BANNER = "BANNER",
  ITW_BANNER = "ITW_BANNER",
  ITW_DATA_SHARE = "ITW_DATA_SHARE",
  ITW_INTRO = "ITW_INTRO",
  ITW_OPERATION_BLOCK = "ITW_OPERATION_BLOCK",
  ITW_PRIVACY = "ITW_PRIVACY",
  ITW_SETTINGS = "ITW_SETTINGS",
  SURVEY_REQUEST = "SURVEY_REQUEST",
  WALLET = "WALLET",
  WALLET_ADD_LIST_ITEM = "WALLET_ADD_LIST_ITEM"
}
⋮----
export enum ITW_TECH_EVENTS {
  ITW_BACKGROUND_TASK_REGISTER_FAILURE = "ITW_BACKGROUND_TASK_REGISTER_FAILURE",
  ITW_BACKGROUND_TASK_REGISTERED = "ITW_BACKGROUND_TASK_REGISTERED",
  ITW_ID_AUTHENTICATION_COMPLETED = "ITW_ID_AUTHENTICATION_COMPLETED",
  ITW_ID_REQUEST = "ITW_ID_REQUEST",
  ITW_ID_VERIFIED_DOCUMENT = "ITW_ID_VERIFIED_DOCUMENT"
}
</file>

<file path="apps/main-app/ts/features/itwallet/analytics/index.ts">
import type { IdentificationContext } from "../machine/eid/context";
⋮----
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
import {
  ITW_ACTIONS_EVENTS,
  ITW_CONFIRM_EVENTS,
  ITW_ERRORS_EVENTS,
  ITW_SCREENVIEW_EVENTS,
  ITW_TECH_EVENTS
} from "./enum";
import {
  CredentialStatusAssertionFailure,
  ItwCopyListItem,
  ItwCredentialDetails,
  ItwCredentialInfoDetails,
  ItwDismissalAction,
  ItwFlow,
  ItwIdMethod,
  ItwScreenFlowContext,
  ItwWalletDataShare,
  KoState,
  MixPanelCredential,
  NewCredential,
  TrackITWalletIDMethodSelected,
  TrackItwBannerProperties,
  TrackItwDeactivation,
  TrackQualtricsSurvey,
  TrackSaveCredentialSuccess,
  TrackStartCredentialUpgradeProperties
} from "./utils/types";
⋮----
export const trackItwBannerVisualized = (
  properties: TrackItwBannerProperties
) =>
⋮----
export const trackItWalletIntroScreen = (itw_flow: ItwFlow) =>
⋮----
export const trackItwPrivacyScreen = (itw_flow: ItwFlow) =>
⋮----
export const trackOpenWalletScreen = (
  credential_details: ItwCredentialDetails
) =>
⋮----
export const trackShowCredentialsList = () =>
⋮----
export const trackWalletDataShare = (properties: ItwWalletDataShare) =>
⋮----
export const trackItwDismissalContext = (
  screenFlowContext: ItwScreenFlowContext
) =>
⋮----
export const trackItwDiscoveryBanner = (
  properties: TrackItwBannerProperties
) =>
⋮----
export const trackItwSurveyRequest = (properties: TrackQualtricsSurvey) =>
⋮----
export const trackItwSettings = () =>
⋮----
export const trackItwBannerTap = (properties: TrackItwBannerProperties) =>
⋮----
export const trackItwBannerClosure = (properties: TrackItwBannerProperties) =>
⋮----
export const trackOpenItwTos = () =>
⋮----
export const trackWalletDataShareAccepted = (
  properties: ItwWalletDataShare
) =>
⋮----
export const trackStartAddNewCredential = (wallet_item: NewCredential) =>
⋮----
export const trackItwKoStateAction = (params: KoState) =>
⋮----
export const trackItWalletIDMethodSelected = (
  properties: TrackITWalletIDMethodSelected
) =>
⋮----
export const trackWalletAdd = () =>
⋮----
export const trackWalletCategoryFilter = (wallet_category: string) =>
⋮----
export const trackWalletCredentialShowIssuer = (
  properties: ItwCredentialInfoDetails
) =>
⋮----
export const trackWalletCredentialShowAuthSource = (
  properties: ItwCredentialInfoDetails
) =>
⋮----
export const trackItwStartActivation = (screen_name: string) =>
⋮----
export const trackItwStartDeactivation = (props: TrackItwDeactivation) =>
⋮----
export const trackCopyListItem = (properties: ItwCopyListItem) =>
⋮----
export const trackItwDismissalAction = (
  dismissalAction: ItwDismissalAction
) =>
⋮----
... (51 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/api/__mocks__/itWalletClient.ts">
import { ItWalletClient } from "../client.ts";
</file>

<file path="apps/main-app/ts/features/itwallet/api/client.ts">
import { createClient } from "@io-app/api-types/generated/definitions/itw/client";
import { URL as PolyfillURL } from "react-native-url-polyfill";
⋮----
import { toFetchTimeout } from "../../../utils/fetch";
⋮----
type AuthHeaders = {
  Authorization?: string;
};
⋮----
export class ItwSessionExpiredError extends Error
⋮----
const addAuthHeaders = (authHeaders: AuthHeaders, init?: RequestInit) => (
⋮----
const getAuthHeadersForWalletProvider = (
  sessionToken: string,
  walletProviderBaseUrl: string,
  url: string
) =>
⋮----
export function createItWalletFetch(
  sessionToken: string,
  walletProviderBaseUrl: string,
  url: string
): typeof fetch
⋮----
const throwSessionExpiredOrContinue = (response: Response) =>
⋮----
export const createItWalletClient = (
  sessionToken: string,
  walletProviderBaseUrl: string,
  baseUrl: string
)
⋮----
export type ItWalletClient = ReturnType<typeof createItWalletClient>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/discoveryBanner/ItwDiscoveryBanner.tsx">
import { Banner, IODimensions } from "@io-app/design-system";
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { createRef, useMemo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useOfflineToastGuard } from "../../../../../hooks/useOfflineToastGuard";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import {
  trackItwBannerClosure,
  trackItwBannerTap,
  trackItwBannerVisualized
} from "../../../analytics";
import { ITW_ROUTES } from "../../../navigation/routes";
import { useItwDiscoveryBannerType } from "../../hooks/useItwDiscoveryBannerType";
import { itwCloseBanner } from "../../store/actions/banners";
⋮----
export type ItwDiscoveryBannerProps = {
  closable?: boolean;
  handleOnClose?: () => void;
  ignoreMargins?: boolean;
  withTitle?: boolean;
};
⋮----
export const ItwDiscoveryBannerLegacy = ({
  withTitle = true,
  ignoreMargins = false,
  closable,
  handleOnClose
}: ItwDiscoveryBannerProps) =>
⋮----
const handleOnPress = () =>
⋮----
const handleClose = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/discoveryBanner/ItwDiscoveryBannerOnboarding.tsx">
import { Banner } from "@io-app/design-system";
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { memo, useCallback, useMemo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import {
  trackItwBannerTap,
  trackItwBannerVisualized
} from "../../../analytics";
import { ITW_ROUTES } from "../../../navigation/routes";
import { useItwDiscoveryBannerType } from "../../hooks/useItwDiscoveryBannerType.ts";
import { isItwDiscoveryBannerRenderableSelector } from "../../store/selectors";
⋮----
const ItwDiscoveryBannerOnboarding = () =>
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/discoveryBanner/ItwDiscoveryBannerStandalone.tsx">
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { isItwDiscoveryBannerRenderableSelector } from "../../store/selectors";
import { ItwDiscoveryBannerLegacy } from "./ItwDiscoveryBanner";
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/backgroundUtils.ts">
import { ImageStyle, PlatformOSType, ViewStyle } from "react-native";
⋮----
export type CardGradient = GradientColors &
  (
    | {
        center: readonly [number, number];
        radius: number;
        type: "radial";
      }
    | {
        angle: number;
        type: "linear";
      }
  );
⋮----
type BackgroundImage = NonNullable<ViewStyle["experimental_backgroundImage"]>;
⋮----
type GradientColors = {
  colors: ReadonlyArray<string>;
  positions?: ReadonlyArray<number>;
};
⋮----
const toPercentage = (value: number) => `$
⋮----
const getColorStopPositions = ({
  colors,
  positions
}: GradientColors): Array<number>
⋮----
export const getCardBackgroundImage = (
  gradient: CardGradient
): BackgroundImage =>
⋮----
export const supportsMixBlendMode = (
  os: PlatformOSType,
  version: number | string
)
⋮----
const isBetterLegacyAndroidDensity = (
  density: number,
  otherDensity: number,
  requested: number
) =>
⋮----
export const getDecodedAndroidAssetScale = (
  version: number | string,
  pixelRatio: number,
  asset: { scale: number; uri: string }
)
⋮----
export const getPatternTileStyle = (
  os: PlatformOSType,
  pixelRatio: number,
  decodedAssetScale: number
): ImageStyle =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/CardBackground.tsx">
import { IOColors } from "@io-app/design-system";
import { memo } from "react";
import {
  Image,
  ImageRequireSource,
  PixelRatio,
  Platform,
  StyleSheet,
  View
} from "react-native";
⋮----
import { CredentialType } from "../../utils/itwMocksUtils";
import {
  CREDENTIAL_CARD_ASPECT_RATIO,
  getCardBackgroundImage,
  getDecodedAndroidAssetScale,
  getPatternTileStyle,
  supportsMixBlendMode
} from "./backgroundUtils";
import { CREDENTIAL_CARD_CORNER_OVERLAY, CredentialCardConfig } from "./config";
import { SkiaCardBackground } from "./SkiaCardBackground";
import { CardColorScheme } from "./types";
⋮----
export const canBlendNatively = ()
⋮----
const getPatternStyle = (source: ImageRequireSource) =>
⋮----
export const CardPattern = ({ source }: { source: ImageRequireSource }) => (
  <View style={[styles.fill, styles.softLight]}>
    <Image
      accessibilityIgnoresInvertColors
      fadeDuration={0}
      resizeMode="repeat"
      source={source}
      style={getPatternStyle(source)}
      testID="itwCredentialCardPatternTestID"
    />
  </View>
);
⋮----
style=
⋮----
type Props = Pick<CredentialCardConfig, "background" | "color" | "overlay">;
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/CardOverlay.tsx">
import {
  BlendColor,
  DataSourceParam,
  Rect,
  Size,
  Image as SkiaImage,
  ImageShader as SkiaImageShader
} from "@shopify/react-native-skia";
import { memo, useEffect } from "react";
import { Easing, useSharedValue, withTiming } from "react-native-reanimated";
⋮----
import { useCachedImage } from "../../utils/imageCache";
import { CREDENTIAL_CARD_CORNER_OVERLAY, CredentialCardConfig } from "./config";
⋮----
type CardOverlayProps = Size & { src: DataSourceParam };
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/config.ts">
import { useIOThemeContext } from "@io-app/design-system";
import Color from "color";
import { useMemo } from "react";
import { ColorSchemeName, ImageRequireSource } from "react-native";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { XOR } from "../../../../../types/utils";
import { fnv1a } from "../../../../../utils/hash";
import { itwCredentialsCatalogueByTypesSelector } from "../../../credentialsCatalogue/store/selectors";
import { CredentialType } from "../../utils/itwMocksUtils";
import { ItWalletThemes } from "../../utils/theme";
⋮----
export type CredentialCardBackground<L extends number = 1 | 2 | 3 | 4 | 5> =
  XOR<
    {
      angle: number;
      type: "linear";
    },
    {
      center: [number, number];
      radius: number;
      type: "radial";
    }
  > & {
    colors: [string, ...Array<string>] & { length: L };
    positions?: [number, ...Array<number>] & { length: L };
  };
⋮----
export type CredentialCardConfig = {
  background: CredentialCardBackground;
  borderColor: string;
  color: string;
  overlay?: CredentialCardOverlay;
  titleColor: string;
};
⋮----
export type CredentialCardOverlay = XOR<
  {
    card: ImageRequireSource;
    header?: ImageRequireSource;
  },
  {
    pattern: ImageRequireSource;
    showCornerOverlay?: boolean;
  }
>;
⋮----
type ThemeAwareCredentialCardConfig = Record<
  "dark" | "light",
  CredentialCardConfig
>;
⋮----
const isThemeAwareCredentialCardConfig = (
  config: CredentialCardConfig | ThemeAwareCredentialCardConfig
): config is ThemeAwareCredentialCardConfig
⋮----
const generateBaseColorFromCredentialType = (
  credentialType: string
): string =>
⋮----
const getOverlayPatterForCredentialType = (
  credentialType: string,
  credentialDomain?: string
): ImageRequireSource =>
⋮----
const generateCredentialCardConfig = (
  credentialType: string,
  colorScheme: ColorSchemeName,
  credentialColor?: string,
  credentialDomain?: string
): CredentialCardConfig =>
⋮----
export const getCredentialCardConfig = (
  credentialType: string,
  colorScheme: ColorSchemeName,
  credentialColor?: string,
  credentialDomain?: string
): CredentialCardConfig =>
⋮----
export const useCredentialCardConfig = (
  credentialType: string,
  themeOverride?: ColorSchemeName
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/DigitalVersionBadge.tsx">
import {
  IOColors,
  IODimensions,
  makeFontStyleObject
} from "@io-app/design-system";
import Color from "color";
import I18n from "i18next";
import { memo } from "react";
import { Platform, StyleSheet, Text, View } from "react-native";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { fontPreferenceSelector } from "../../../../../store/reducers/persistedPreferences";
import { getCardBackgroundImage } from "./backgroundUtils";
import { CardColorScheme } from "./types";
⋮----
type CredentialTypesProps = {
  background: Array<string> | string;
  foreground: string;
};
⋮----
type DigitalVersionBadgeProps = {
  colorScheme: CardColorScheme;
  credentialType: string;
};
⋮----
const getColorPropsByScheme = (
  credentialType: string,
  colorScheme: CardColorScheme
) =>
⋮----
...makeFontStyleObject(
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/GradientBackground.tsx">
import {
  LinearGradient,
  RadialGradient,
  Rect,
  vec
} from "@shopify/react-native-skia";
import { memo, useMemo } from "react";
⋮----
import { CredentialCardConfig } from "./config";
⋮----
const getGradientVectors = (
  angle: number,
  width: number,
  height: number
):
⋮----
type CredentialCardSkiaBackgroundProps = {
  bg: CredentialCardConfig["background"];
  height: number;
  width: number;
};
⋮----
c=
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/index.tsx">
import {
  HStack,
  IOColors,
  IOText,
  Tag,
  useIOThemeContext
} from "@io-app/design-system";
import Color from "color";
import I18n from "i18next";
import { memo, useMemo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { fontPreferenceSelector } from "../../../../../store/reducers/persistedPreferences";
import { useItwDisplayCredentialStatus } from "../../../presentation/details/hooks/useItwDisplayCredentialStatus";
import { useItwCredentialName } from "../../hooks/useItwCredentialName";
import { itwShouldUpgradeCredentialSelector } from "../../store/selectors";
import {
  useBorderColorByStatus,
  useTagPropsByStatus,
  validCredentialStatuses
} from "../../utils/itwCredentialUtils";
import { CredentialType } from "../../utils/itwMocksUtils";
import { getLegacyThemeColorByCredentialType } from "../../utils/itwStyleUtils";
import { ItwCredentialStatus } from "../../utils/itwTypesUtils";
import { ItWalletIdLogo } from "../ItWalletIdLogo";
import { CREDENTIAL_CARD_ASPECT_RATIO } from "./backgroundUtils";
import { CardBackground, LegacyCardBackground } from "./CardBackground";
import { useCredentialCardConfig } from "./config";
import { DigitalVersionBadge } from "./DigitalVersionBadge";
import { CardColorScheme } from "./types";
⋮----
export type ItwCredentialCard = {
  credentialStatus?: ItwCredentialStatus;
  credentialType: string;
  issuedAt?: string;
};
⋮----
type StyleProps = {
  titleColor: string;
  titleOpacity: number;
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/SkiaCardBackground.tsx">
import { IOColors } from "@io-app/design-system";
import { Canvas } from "@shopify/react-native-skia";
import { memo } from "react";
import { ImageRequireSource, StyleSheet, View } from "react-native";
⋮----
import { useIsScreenFocused } from "../../../../../hooks/useIsScreenFocused";
import { useLayoutSize } from "../../hooks/useLayoutSize";
import { SkiaCardCornerOverlay, SkiaCardPatternOverlay } from "./CardOverlay";
import { CredentialCardConfig } from "./config";
import { SkiaGradientBackground } from "./GradientBackground";
⋮----
type Props = Pick<CredentialCardConfig, "background" | "color"> & {
  pattern: ImageRequireSource;
  showCornerOverlay?: boolean;
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialCard/types.ts">
export type CardColorScheme = "default" | "faded" | "greyscale";
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/CardBackground.tsx">
import { IOColors } from "@io-app/design-system";
import { memo } from "react";
import { ImageSourcePropType, StyleSheet, View } from "react-native";
⋮----
import { AnimatedImage } from "../../../../../components/AnimatedImage";
import { CredentialMetadata } from "../../utils/itwTypesUtils";
import { CardSide } from "./types";
⋮----
type CardBackgroundProps = {
  credentialType: CredentialMetadata["credentialType"];
  side: CardSide;
};
⋮----
const CardBackground = (
⋮----
type CardAssets = Record<CardSide, ImageSourcePropType>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/CardClaim.tsx">
import { WithTestID } from "@io-app/design-system";
import { memo, ReactElement, ReactNode, useMemo } from "react";
import { StyleSheet, View, ViewStyle } from "react-native";
⋮----
import { Either, Prettify } from "../../../../../types/helpers";
import {
  ClaimValueKind,
  ClaimValueOfKind,
  parseClaimValue,
  SimpleDateFormat
} from "../../utils/itwClaimsUtils";
import { ParsedCredential } from "../../utils/itwTypesUtils";
import { ClaimImage } from "./ClaimImage";
import { ClaimLabel, ClaimLabelProps } from "./ClaimLabel";
⋮----
const renderNothing = ()
⋮----
type CardClaimProps = Prettify<
  ClaimLabelProps & {
    claim?: ParsedCredential[number];
    dateFormat?: SimpleDateFormat;
    dimensions?: ClaimDimensions;
    position?: ClaimPosition;
  }
>;
⋮----
type ClaimDimensions = Prettify<
  Partial<Record<"height" | "width", PercentPosition>> &
    Pick<ViewStyle, "aspectRatio">
>;
⋮----
type ClaimPosition = HorizontalClaimPosition & VerticalClaimPosition;
⋮----
type HorizontalClaimPosition = Either<
  { left: PercentPosition },
  { right: PercentPosition }
>;
⋮----
type PercentPosition = `${number}%`;
⋮----
type VerticalClaimPosition = Either<
  { top: PercentPosition },
  { bottom: PercentPosition }
>;
⋮----
const CardClaim = ({
  claim,
  position,
  dimensions,
  testID,
  dateFormat = "DD/MM/YY",
  ...labelProps
}: WithTestID<CardClaimProps>) =>
⋮----
type CardClaimRendererProps<K extends ClaimValueKind> = {
  claim?: ParsedCredential[number];
  component: (
    value: ClaimValueOfKind<K>
  ) => Iterable<ReactElement> | ReactElement;
  kinds: ReadonlyArray<K>;
};
⋮----
const CardClaimRenderer = <K extends ClaimValueKind>({
  claim,
  kinds,
  component
}: CardClaimRendererProps<K>)
⋮----
type CardClaimContainerProps = WithTestID<{
  children?: ReactNode;
  dimensions?: ClaimDimensions;
  position?: ClaimPosition;
}>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/CardData.tsx">
import { hexToRgba } from "@io-app/design-system";
import { ElementType, Fragment, memo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { QrCodeImage } from "../../../../../components/QrCodeImage";
import { DrivingPrivilegesClaimType } from "../../utils/itwClaimsUtils";
import {
  CredentialMetadata,
  ParsedCredential
} from "../../utils/itwTypesUtils";
import { ACCOMPANYING_PERSON_BACKGROUND_COLOR } from "../ItwCredentialCard/config";
import { CardClaim, CardClaimContainer, CardClaimRenderer } from "./CardClaim";
import { ClaimLabel } from "./ClaimLabel";
import { CardSide } from "./types";
⋮----
type DataComponentProps = {
  claims: ParsedCredential;
  valuesHidden: boolean;
};
⋮----
const getClaim = (claimName: string)
⋮----
claim=
⋮----
const CardData = (
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/CardWidthContext.ts">
import { createContext } from "react";
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/ClaimImage.tsx">
import {
  Blur,
  Canvas,
  Skia,
  Image as SkiaImage
} from "@shopify/react-native-skia";
import { useMemo, useState } from "react";
import { View } from "react-native";
⋮----
type ClaimImageProps = {
  base64: string;
  blur?: number;
};
⋮----
export const ClaimImage = (
⋮----
setDimensions({
          width: event.nativeEvent.layout.width,
          height: event.nativeEvent.layout.height
        });
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/ClaimLabel.tsx">
import {
  IOColors,
  IOFontWeight,
  makeFontStyleObject
} from "@io-app/design-system";
import { FunctionComponent, PropsWithChildren, useContext } from "react";
import { Text, TextStyle, useWindowDimensions } from "react-native";
⋮----
import { HIDDEN_CLAIM_TEXT } from "../../utils/constants.ts";
import { CardWidthContext } from "./CardWidthContext";
⋮----
export type ClaimLabelProps = {
  fontSize?: number;
  fontWeight?: IOFontWeight;
  hidden?: boolean;
  textTransform?: TextStyle["textTransform"];
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/FlipGestureDetector.tsx">
import { ReactNode } from "react";
import {
  Directions,
  Gesture,
  GestureDetector
} from "react-native-gesture-handler";
import { scheduleOnRN } from "react-native-worklets";
⋮----
type FlipsGestureDetectorProps = {
  children: ReactNode;
  direction?: keyof typeof directions;
  isFlipped: boolean;
  setIsFlipped: (isFlipped: boolean) => void;
};
⋮----
export const FlipGestureDetector = ({
  isFlipped,
  setIsFlipped,
  children,
  direction = "leftright"
}: FlipsGestureDetectorProps) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/FlippableCard.tsx">
import { memo, ReactElement } from "react";
import { StyleProp, StyleSheet, View, ViewStyle } from "react-native";
import { createCSSAnimatedComponent } from "react-native-reanimated";
⋮----
type FlippableCardProps = {
  BackComponent: ReactElement;
  containerStyle?: StyleProp<ViewStyle>;
  duration?: number;
  flipAxis?: "x" | "y";
  FrontComponent: ReactElement;
  isFlipped?: boolean;
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/index.tsx">
import {
  hexToRgba,
  IOColors,
  Tag,
  useScaleAnimation
} from "@io-app/design-system";
import { Canvas } from "@shopify/react-native-skia";
import I18n from "i18next";
import { ReactNode, useMemo } from "react";
import {
  AccessibilityProps,
  Pressable,
  StyleProp,
  StyleSheet,
  View,
  ViewStyle
} from "react-native";
import Animated from "react-native-reanimated";
⋮----
import { RotationSensor } from "../../../../../components/RotationSensor";
import { useRotationEffectEnabled } from "../../../../../hooks/useRotationSensor";
import { useItwCredentialName } from "../../hooks/useItwCredentialName";
import { useLayoutSize } from "../../hooks/useLayoutSize";
import {
  isItwCredential,
  useBorderColorByStatus,
  useTagPropsByStatus,
  validCredentialStatuses
} from "../../utils/itwCredentialUtils";
import {
  CredentialMetadata,
  ItwCredentialStatus
} from "../../utils/itwTypesUtils";
import {
  ItwBrandedSkiaBorder,
  ItwIridescentBorderVariant
} from "../ItwBrandedSkiaBorder";
import { CardBackground } from "./CardBackground";
import { CardData } from "./CardData";
import { CardWidthContext } from "./CardWidthContext";
import { FlippableCard } from "./FlippableCard";
⋮----
export type ItwSkeumorphicCardProps = {
  credential: CredentialMetadata;
  flipAxis?: "x" | "y";
  isFlipped?: boolean;
  onPress?: () => void;
  status: ItwCredentialStatus;
  valuesHidden: boolean;
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwSkeumorphicCard/types.ts">
export type CardSide = "back" | "front";
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwActivationSuccessFeedbackBanner.tsx">
import { Banner } from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { memo, useCallback, useMemo, useState } from "react";
import { View } from "react-native";
⋮----
import { useIODispatch } from "../../../../store/hooks";
import { openWebUrl } from "../../../../utils/url";
import {
  trackItwSurveyRequest,
  trackItwSurveyRequestAccepted
} from "../../analytics";
import { TrackQualtricsSurvey } from "../../analytics/utils/types";
import { itwCloseBanner } from "../store/actions/banners";
import { itwClearWalletActivationFeedbackBannerData } from "../store/actions/preferences";
import { IT_WALLET_SURVEY_EID_ACTIVATION_SUCCESS } from "../utils/constants";
⋮----
type Props = {
  authMethod: string;
  docStatus: "active" | "not_active";
  style?: React.ComponentProps<typeof View>["style"];
};
⋮----
const ItwActivationSuccessFeedbackBanner = ({
  docStatus,
  authMethod,
  style: customStyle
}: Props) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItWalletIdLogo.tsx">
import { useIOThemeContext } from "@io-app/design-system";
import { SvgProps } from "react-native-svg";
⋮----
import Logo from "../../../../../img/features/itWallet/brand/itw_id_logo.svg";
import LogoDark from "../../../../../img/features/itWallet/brand/itw_id_logo_dark.svg";
⋮----
export const ItWalletIdLogo = (props: SvgProps) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItWalletLogo.tsx">
import { useIOThemeContext } from "@io-app/design-system";
import { SvgProps } from "react-native-svg";
⋮----
import Logo from "../../../../../img/features/itWallet/brand/itw_logo.svg";
import LogoDark from "../../../../../img/features/itWallet/brand/itw_logo_dark.svg";
⋮----
export const ItWalletLogo = (props: SvgProps) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwBrandedBox.tsx">
import { useIOThemeContext } from "@io-app/design-system";
import {
  Canvas,
  Circle as SkiaCircle,
  Group as SkiaGroup,
  RadialGradient as SkiaRadialGradient,
  vec
} from "@shopify/react-native-skia";
import { LinearGradient } from "expo-linear-gradient";
import { PropsWithChildren } from "react";
import { LayoutRectangle, StyleSheet, View } from "react-native";
import {
  Extrapolation,
  interpolate,
  SharedValue,
  useDerivedValue
} from "react-native-reanimated";
⋮----
import { RotationSensor } from "../../../../components/RotationSensor";
import { useRotationEffectEnabled } from "../../../../hooks/useRotationSensor";
import { useLayoutSize } from "../hooks/useLayoutSize";
import { useItWalletTheme } from "../utils/theme";
import { ItwBrandedSkiaBorder } from "./ItwBrandedSkiaBorder";
import { ItwSkiaBrandedGradientVariant } from "./ItwBrandedSkiaGradient";
⋮----
type ItwIridescentBorderProps = {
  backgroundVariant?: "gradient" | "solid";
  borderRadius?: number;
  borderThickness?: number;
  style?: React.ComponentProps<typeof View>["style"];
  variant?: ItwSkiaBrandedGradientVariant;
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwBrandedSkiaBorder.tsx">
import { RoundedRect } from "@shopify/react-native-skia";
import { ColorSchemeName, LayoutRectangle } from "react-native";
import { SharedValue } from "react-native-reanimated";
⋮----
import { ItwBrandedSkiaGradient } from "./ItwBrandedSkiaGradient";
⋮----
export type ItwIridescentBorderVariant = "default" | "error" | "warning";
⋮----
type ItwIridescentBorderProps = {
  borderRadius?: number;
  height: LayoutRectangle["height"];
  roll?: SharedValue<number>;
  themeType?: ColorSchemeName;
  thickness?: number;
  variant?: ItwIridescentBorderVariant;
  width: LayoutRectangle["width"];
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwBrandedSkiaGradient.tsx">
import {
  LinearGradient as SkiaLinearGradient,
  vec
} from "@shopify/react-native-skia";
import { LayoutRectangle } from "react-native";
import {
  Extrapolation,
  interpolate,
  SharedValue,
  useDerivedValue
} from "react-native-reanimated";
⋮----
import {
  ITW_BRAND_GRADIENT,
  ITW_BRAND_GRADIENT_ERROR,
  ITW_BRAND_GRADIENT_WARNING
} from "../utils/theme";
⋮----
export type ItwSkiaBrandedGradientVariant = "default" | "error" | "warning";
⋮----
type ItwBrandedSkiaGradientProps = {
  height: LayoutRectangle["height"];
  roll?: SharedValue<number>;
  variant?: ItwSkiaBrandedGradientVariant;
  width: LayoutRectangle["width"];
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialClaim.tsx">
import { Divider, ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { Fragment, useMemo } from "react";
import { Image } from "react-native";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { HIDDEN_CLAIM_TEXT } from "../utils/constants.ts";
import {
  ClaimDisplayFormat,
  DrivingPrivilegeClaimType,
  extractFiscalCode,
  getSafeText,
  isExpirationDateClaim,
  parseClaims,
  parseClaimValue,
  PlaceOfBirthClaimType,
  SimpleDate
} from "../utils/itwClaimsUtils";
import { ItwCredentialStatus } from "../utils/itwTypesUtils";
import { ItwCredentialMultiClaim } from "./ItwCredentialMultiClaim.tsx";
⋮----
export type ItwClaimLongPressHandler = (label: string, value: string) => void;
⋮----
const getHiddenClaimAccessibilityText = ()
⋮----
const PlaceOfBirthClaimItem = ({
  label,
  claim,
  hidden
}: {
  claim: PlaceOfBirthClaimType;
  hidden?: boolean;
  label: string;
}) =>
⋮----
const BoolClaimItem = ({
  label,
  claim,
  hidden
}: {
  claim: boolean;
  hidden?: boolean;
  label: string;
}) =>
⋮----
const PlainTextClaimItem = ({
  label,
  claim,
  hidden,
  onLongPress
}: {
  claim: string;
  hidden?: boolean;
  label: string;
  onLongPress?: ItwClaimLongPressHandler;
}) =>
⋮----
const DateClaimItem = ({
  label,
  claim,
  status,
  hidden,
  onLongPress
}: {
  claim: SimpleDate;
  hidden?: boolean;
  label: string;
  onLongPress?: ItwClaimLongPressHandler;
  status?: ItwCredentialStatus;
}) =>
⋮----
const UnknownClaimItem = ({ label }: { _claim?: unknown; label: string }) => (
  <PlainTextClaimItem
    claim={I18n.t("features.itWallet.generic.placeholders.claimNotAvailable")}
    label={label}
  />
);
⋮----
const ImageClaimItem = ({
  label,
  claim,
  hidden
}: {
  claim: string;
  hidden?: boolean;
  label: string;
})
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialClaimsCard.tsx">
import {
  H6,
  IOColors,
  IODimensions,
  useIOThemeContext
} from "@io-app/design-system";
import { LinearGradient } from "expo-linear-gradient";
import { PropsWithChildren, ReactNode } from "react";
import {
  AccessibilityState,
  StyleProp,
  StyleSheet,
  TouchableWithoutFeedback,
  View,
  ViewStyle
} from "react-native";
import Animated, { AnimatedStyle } from "react-native-reanimated";
⋮----
import { useItWalletTheme } from "../utils/theme";
⋮----
type ItwCredentialClaimsCardProps = PropsWithChildren<{
  gradientEndColor: string;
  headerAccessibilityLabel?: string;
  headerAccessibilityRole?: "header";
  headerAccessibilityState?: AccessibilityState;
  headerAccessory?: ReactNode;
  headerStyle?: StyleProp<AnimatedStyle<ViewStyle>>;
  onHeaderPress?: () => void;
  title: string;
}>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialDetailCard.tsx">
import { IODimensions } from "@io-app/design-system";
import { Canvas, Rect } from "@shopify/react-native-skia";
import { memo, PropsWithChildren } from "react";
import { Image, StyleSheet, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { RotationSensor } from "../../../../components/RotationSensor";
import { useRotationEffectEnabled } from "../../../../hooks/useRotationSensor";
import { useLayoutSize } from "../hooks/useLayoutSize";
import { borderVariantByStatus } from "../utils/itwCredentialUtils";
import { ItwCredentialStatus } from "../utils/itwTypesUtils";
import { ItwBrandedSkiaBorder } from "./ItwBrandedSkiaBorder";
import { getCardBackgroundImage } from "./ItwCredentialCard/backgroundUtils";
import {
  canBlendNatively,
  CardPattern
} from "./ItwCredentialCard/CardBackground";
import { SkiaCardPatternOverlay } from "./ItwCredentialCard/CardOverlay";
import {
  CredentialCardConfig,
  useCredentialCardConfig
} from "./ItwCredentialCard/config";
⋮----
type ItwCredentialDetailCardProps = PropsWithChildren<{
  credentialStatus?: ItwCredentialStatus;
  credentialType: string;
}>;
⋮----
type DetailCardBackgroundProps = Pick<
  CredentialCardConfig,
  "background" | "color" | "overlay"
>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialMultiClaim.tsx">
import { Divider } from "@io-app/design-system";
import { Fragment } from "react";
⋮----
import { HIDDEN_CLAIM_TEXT } from "../utils/constants.ts";
import { ClaimDisplayFormat } from "../utils/itwClaimsUtils.ts";
import { ItwCredentialStatus } from "../utils/itwTypesUtils.ts";
import {
  ItwClaimLongPressHandler,
  ItwCredentialClaim
} from "./ItwCredentialClaim.tsx";
import { ItwNestedClaimsListItem } from "./ItwNestedClaimsListItem.tsx";
⋮----
interface ItwCredentialMultiClaimProps {
  claim: ClaimDisplayFormat;
  credentialStatus?: ItwCredentialStatus;
  credentialType?: string;
  hidden?: boolean;
  isPreview?: boolean;
  nestedClaims: Array<Array<ClaimDisplayFormat>>;
  onLongPress?: ItwClaimLongPressHandler;
}
⋮----
type NestedCredentialSummaryConfig = {
  summaryLabelId: string;
  summaryValueId: string;
};
⋮----
export const getNestedItemSummary = (
  claimId: string,
  singleItemClaims: Array<ClaimDisplayFormat>
):
⋮----
export const ItwCredentialMultiClaim = ({
  nestedClaims,
  claim,
  hidden,
  isPreview,
  credentialType,
  credentialStatus,
  onLongPress
}: ItwCredentialMultiClaimProps) =>
⋮----
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwCredentialNotFound.tsx">
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { ItwCredentialIssuanceMachineContext } from "../../machine/credential/provider";
import { useItwDisableGestureNavigation } from "../hooks/useItwDisableGestureNavigation";
⋮----
const ItwCredentialNotFound = ({
  credentialType
}: {
  credentialType: string;
}) =>
⋮----
const navigateToCredential = () =>
⋮----
const handleClose = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwDataExchangeIcons.tsx">
import type { ImageURISource } from "react-native";
⋮----
import { Avatar, HStack, Icon, useIOTheme } from "@io-app/design-system";
import { memo } from "react";
⋮----
type Props = {
  requesterLogoUri: ImageURISource | undefined;
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwEidInfoBottomSheetContent.tsx">
import {
  Divider,
  H4,
  HStack,
  Icon,
  IOButton,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { Fragment, memo, useEffect } from "react";
import { View } from "react-native";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { trackItwStartDeactivation } from "../../analytics";
import { mapPIDStatusToMixpanel } from "../../analytics/utils";
import {
  itwCredentialsEidSelector,
  itwCredentialsEidStatusSelector
} from "../../credentials/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
import { trackCredentialDetail } from "../../presentation/details/analytics";
import { ITW_PRESENTATION_DETAILS_SCREENVIEW_EVENTS } from "../../presentation/details/analytics/enum";
import { useItwStatusIconColor } from "../hooks/useItwStatusIconColor";
import { parseClaims, WellKnownClaim } from "../utils/itwClaimsUtils";
import { CredentialMetadata } from "../utils/itwTypesUtils";
import { ItwCredentialClaim } from "./ItwCredentialClaim";
import { ItwEidLifecycleAlert } from "./ItwEidLifecycleAlert";
⋮----
type ItwEidInfoBottomSheetTitleProps = {
  isExpired: boolean;
};
⋮----
export const ItwEidInfoBottomSheetTitle = ({
  isExpired
}: ItwEidInfoBottomSheetTitleProps) =>
⋮----
type ItwEidInfoBottomSheetContentProps = {
  currentScreenName?: string;
  navigation: ReturnType<typeof useIONavigation>;
};
⋮----
const navigateToWalletRevocationScreen = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwEidLifecycleAlert.tsx">
import { Alert } from "@io-app/design-system";
import { format } from "date-fns";
import I18n from "i18next";
import { ComponentProps, useMemo } from "react";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { offlineAccessReasonSelector } from "../../../ingress/store/selectors";
import {
  itwAreAllCredentialsExpiredSelector,
  itwCredentialsEidSelector,
  itwCredentialsEidStatusSelector
} from "../../credentials/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
import { useItwEidInvalidBottomSheet } from "../hooks/useItwEidInvalidBottomSheet";
import { useItwEidLifecycleAlertTracking } from "../hooks/useItwEidLifecycleAlertTracking";
import { CredentialMetadata, ItwEidStatus } from "../utils/itwTypesUtils";
⋮----
type Props = {
  currentScreenName?: string;
  lifecycleStatus?: Array<ItwEidStatus>;
  navigation: ReturnType<typeof useIONavigation>;
  skipViewTracking?: boolean;
};
⋮----
const navigateToEidReissuing = ()
⋮----
const startEidReissuing = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwEngagementBanner.tsx">
import {
  BodySmall,
  H4,
  IconButton,
  IOButton,
  VSpacer,
  VStack,
  WithTestID
} from "@io-app/design-system";
import { TxtParagraphNode, TxtStrongNode } from "@textlint/ast-node-types";
import I18n from "i18next";
import { ComponentProps, useMemo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import ItWalletDeck from "../../../../../img/features/itWallet/brand/itw_deck_engagement.svg";
import IOMarkdown from "../../../../components/IOMarkdown";
import { getTxtNodeKey } from "../../../../components/IOMarkdown/renderRules";
import { Renderer } from "../../../../components/IOMarkdown/types";
import { ItwBrandedBox } from "./ItwBrandedBox";
import { PoweredByItWalletText } from "./PoweredByItWalletText";
⋮----
type Props = {
  action: string;
  description: string;
  dismissable?: boolean;
  onDismiss: () => void;
  onPress: () => void;
  style?: ComponentProps<typeof View>["style"];
  title: string;
};
⋮----
Paragraph(paragraph: TxtParagraphNode, render: Renderer)
⋮----
<BodySmall key=
⋮----
Strong(strong: TxtStrongNode, render: Renderer)
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwEnvironmentAlert.tsx">
import { Alert, Body, IOButton, VStack } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks.ts";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet.tsx";
import { itwResetEnv } from "../store/actions/environment.ts";
import { selectItwEnv } from "../store/selectors/environment.ts";
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwGenericErrorContent.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwIssuanceMetadata.tsx">
import { Divider, ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { generateDynamicUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { ITW_IPZS_PRIVACY_URL_BODY } from "../../../../urls";
import {
  trackWalletCredentialShowAuthSource,
  trackWalletCredentialShowIssuer
} from "../../analytics";
import { getMixPanelCredential } from "../../analytics/utils";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { useItwAuthSourceName } from "../hooks/useItwAuthSourceName";
import { useItwInfoBottomSheet } from "../hooks/useItwInfoBottomSheet";
import { itwIpzsItwalletPrivacyUrlSelector } from "../store/selectors/remoteConfig";
import { isItwCredential } from "../utils/itwCredentialUtils.ts";
import { CredentialType } from "../utils/itwMocksUtils";
import { CredentialMetadata } from "../utils/itwTypesUtils.ts";
⋮----
type ItwIssuanceMetadataProps = {
  credential: CredentialMetadata;
  isPreview?: boolean;
};
⋮----
type ItwMetadataIssuanceListItemProps = {
  bottomSheet: {
    contentBody: string;
    contentTitle: string;
    onPress: () => void;
  };
  isPreview?: boolean;
  label: string;
  value: string;
};
⋮----
const ItwMetadataIssuanceListItem = ({
  label,
  value,
  bottomSheet: bottomSheetProps,
  isPreview
}: ItwMetadataIssuanceListItemProps) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwL2EngagementBanner.tsx">
import { Banner } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useOfflineToastGuard } from "../../../../hooks/useOfflineToastGuard";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { itwIsWalletEmptySelector } from "../../credentials/store/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
⋮----
export const ItwL2EngagementBanner = () =>
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwNestedClaimsListItem.tsx">
import { Divider, ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { Fragment } from "react";
⋮----
import { useIOSelector } from "../../../../store/hooks.ts";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet.tsx";
import { trackItwCredentialQualificationDetail } from "../../analytics";
import { getMixPanelCredential } from "../../analytics/utils/index.ts";
import { CREDENTIALS_MAP } from "../../analytics/utils/types.ts";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { ClaimDisplayFormat } from "../utils/itwClaimsUtils";
import { ItwCredentialStatus } from "../utils/itwTypesUtils.ts";
import {
  ItwClaimLongPressHandler,
  ItwCredentialClaim
} from "./ItwCredentialClaim.tsx";
⋮----
type ItwNestedClaimsListItemProps = {
  credentialStatus?: ItwCredentialStatus;
  credentialType?: string;
  hidden?: boolean;
  isPreview?: boolean;
  itemClaims: Array<ClaimDisplayFormat>;
  onLongPress?: ItwClaimLongPressHandler;
  summaryLabel?: string;
  summaryValue?: string;
};
⋮----
itemBottomSheet.present();
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwReissuanceFeedbackBanner.tsx">
import { Banner } from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { memo, useCallback, useMemo } from "react";
import { View } from "react-native";
⋮----
import { openWebUrl } from "../../../../utils/url";
import {
  trackItwSurveyRequest,
  trackItwSurveyRequestAccepted
} from "../../analytics";
import { TrackQualtricsSurvey } from "../../analytics/utils/types.ts";
import { IT_WALLET_SURVEY_EID_REISSUANCE_SUCCESS } from "../utils/constants.ts";
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwRetryableQRCode.tsx">
import { Body, Icon, IOButton, IOColors, IOIcons } from "@io-app/design-system";
import { memo } from "react";
import { Appearance, StyleSheet, View } from "react-native";
⋮----
import {
  QrCodeImage,
  QrCodeImageProps
} from "../../../../components/QrCodeImage";
⋮----
type Props = QrCodeImageProps & {
  isRetrying?: boolean;
  onRetry: () => void;
  retryDescription: string;
  retryIcon?: Extract<IOIcons, "noticeFilled" | "warningFilled">;
  retryLabel: string;
  shouldRetry?: boolean;
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwWalletNotAvailableBanner.tsx">
import { BodySmall, Icon, IOColors, IODimensions } from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { withWalletCategoryFilter } from "../../../wallet/utils";
import { itwIsWalletInstanceStatusFailureSelector } from "../../walletInstance/store/selectors";
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/ItwWalletReadyBanner.tsx">
import { Banner } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIOSelector } from "../../../../store/hooks";
import { trackItwBannerTap, trackItwBannerVisualized } from "../../analytics";
import { ITW_ROUTES } from "../../navigation/routes";
import {
  itwShouldRenderNewItWalletSelector,
  itwShouldRenderWalletReadyBannerSelector
} from "../store/selectors";
⋮----
export const ItwWalletReadyBanner = () =>
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/PoweredByItWalletText.tsx">
import { BodySmall } from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { ItWalletLogo } from "./ItWalletLogo";
</file>

<file path="apps/main-app/ts/features/itwallet/common/components/RequiresConnectivity.tsx">
import { useRoute } from "@react-navigation/native";
import { ReactNode, useEffect } from "react";
⋮----
import { OfflineFailureComponent } from "../../../../components/error/OfflineFailure";
import { useIOSelector } from "../../../../store/hooks";
import { trackContentNotAvailable } from "../../../../utils/analytics";
import { isConnectedSelector } from "../../../connectivity/store/selectors";
import { offlineAccessReasonSelector } from "../../../ingress/store/selectors";
⋮----
type RequiresConnectivityProps = {
  children: ReactNode;
  failureComponent?: ReactNode;
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useIoWallet.ts">
import { useIOSelector } from "../../../../store/hooks";
import { selectItwSpecsVersion } from "../store/selectors/environment";
import { getIoWallet } from "../utils/itwIoWallet";
⋮----
export const useIoWallet = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwActivationExitSurveyBottomSheet.tsx">
import { Body, IOButton, VStack } from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo, useRef } from "react";
import { View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { openWebUrl } from "../../../../utils/url";
import {
  trackItwSurveyRequest,
  trackItwSurveyRequestAccepted,
  trackItwSurveyRequestDeclined
} from "../../analytics";
import { TrackQualtricsSurvey } from "../../analytics/utils/types";
import { itwLifecycleIsValidSelector } from "../../lifecycle/store/selectors";
import { itwSetActivationExitSurvey } from "../store/actions/ui";
import { itwActivationExitSurveySelector } from "../store/selectors/ui";
import { IT_WALLET_SURVEY_EID_ACTIVATION_EXIT } from "../utils/constants";
⋮----
export type EidActivationExitStep =
  | "cie_preparation"
  | "disambiguation"
  | "intro"
  | "pid_preview"
  | "select_method";
⋮----
label=
⋮----
trackItwSurveyRequestAccepted(trackingProps);
dismiss();
openWebUrl(surveyUrl);
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwAuthSourceName.ts">
import { useIOSelector } from "../../../../store/hooks";
import {
  itwCatalogueTranslationsByLocaleSelector,
  itwCredentialsCatalogueByTypesSelector
} from "../../credentialsCatalogue/store/selectors";
import {
  getAuthSource,
  getForcedItwAuthSource,
  getItwAuthSource
} from "../utils/itwMetadataUtils";
import { CredentialMetadata } from "../utils/itwTypesUtils";
⋮----
export const useItwAuthSourceName = (
  credentialType: string,
  credential?: CredentialMetadata
): string | undefined =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwCredentialExitSurveyBottomSheet.tsx">
import { Body, IOButton, VStack } from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo, useRef } from "react";
import { View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { openWebUrl } from "../../../../utils/url";
import {
  trackItwSurveyRequest,
  trackItwSurveyRequestAccepted,
  trackItwSurveyRequestDeclined
} from "../../analytics";
import {
  MixPanelCredential,
  TrackQualtricsSurvey
} from "../../analytics/utils/types";
import { itwSetCredentialExitSurvey } from "../store/actions/ui";
import { itwCredentialExitSurveySelector } from "../store/selectors/ui";
import { IT_WALLET_SURVEY_CREDENTIAL_EXIT } from "../utils/constants";
⋮----
export type CredentialExitStep = "data_share" | "doc_preview";
⋮----
label=
⋮----
trackItwSurveyRequestAccepted(trackingProps);
dismiss();
openWebUrl(surveyUrl);
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwCredentialName.ts">
import { useIOSelector } from "../../../../store/hooks";
import { itwCredentialNameResolverSelector } from "../../credentialsCatalogue/store/selectors";
⋮----
export const useItwCredentialName = (
  credentialType: string | undefined
): string =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwDisableGestureNavigation.ts">
import { useFocusEffect } from "@react-navigation/core";
import { useCallback } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
⋮----
export const useItwDisableGestureNavigation = (disabled = true) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwDiscoveryBannerType.ts">
import { useIOSelector } from "../../../../store/hooks.ts";
import { itwIsRemotelyActiveSelector } from "../../walletInstance/store/selectors";
⋮----
export type DiscoveryBannerType = "onboarding" | "reactivating";
⋮----
export const useItwDiscoveryBannerType = ():
  | DiscoveryBannerType
  | undefined => {
  const isRemotelyActive = useIOSelector(itwIsRemotelyActiveSelector);
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwDismissalDialog.tsx">
import { useIsFocused } from "@react-navigation/core";
import I18n from "i18next";
import { useEffect, useState } from "react";
import { Alert } from "react-native";
⋮----
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import {
  trackItwDismissalAction,
  trackItwDismissalContext
} from "../../analytics";
import { ItwScreenFlowContext } from "../../analytics/utils/types";
import { useItwDisableGestureNavigation } from "./useItwDisableGestureNavigation";
⋮----
type ItwDismissalDialogProps = {
  customLabels?: {
    body?: string;
    cancelLabel?: string;
    confirmLabel?: string;
    title?: string;
  };
  dismissalContext?: ItwScreenFlowContext;
  enabled?: boolean;
  handleDismiss?: () => void;
};
⋮----
export const useItwDismissalDialog = ({
  handleDismiss,
  dismissalContext,
  enabled = true,
  customLabels = {}
}: ItwDismissalDialogProps =
⋮----
const trackUserAction = (label: string) =>
⋮----
const show = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwEidFeedbackBottomSheet.tsx">
import { Body, IOButton, VStack } from "@io-app/design-system";
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useMemo, useRef } from "react";
import { View } from "react-native";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet.tsx";
import { openWebUrl } from "../../../../utils/url.ts";
import {
  trackItwSurveyRequestAccepted,
  trackItwSurveyRequestDeclined
} from "../../analytics";
import { TrackQualtricsSurvey } from "../../analytics/utils/types.ts";
import { IT_WALLET_SURVEY_EID_REISSUANCE_FAILURE } from "../utils/constants.ts";
⋮----
type ItwEidFeedbackBottomSheetProps = {
  onPrimaryAction?: () => void;
  onSecondaryAction?: () => void;
};
⋮----
label=
⋮----
trackItwSurveyRequestAccepted(trackingProps);
openWebUrl(IT_WALLET_SURVEY_EID_REISSUANCE_FAILURE);
onPrimaryAction?.();
dismiss();
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwEidInvalidBottomSheet.tsx">
import { IOButton, IOMarkdownLite, VStack } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { useCredentialStatusMessage } from "../../credentials/hooks/useCredentialStatusMessage";
import { CredentialType } from "../utils/itwMocksUtils";
⋮----
export const useItwEidInvalidBottomSheet = (onUpdatePress: () => void) =>
⋮----
label=
⋮----
bottomSheet.dismiss();
onUpdatePress();
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwEidLifecycleAlertTracking.ts">
import { useCallback, useEffect, useMemo, useRef } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { trackItwBannerTap, trackItwBannerVisualized } from "../../analytics";
import { ITW_IDENTIFICATION_SCREENVIEW_EVENTS } from "../../identification/analytics/enum";
import { ItwEidStatus } from "../utils/itwTypesUtils";
⋮----
type Props = {
  currentScreenName?: string;
  isItwCredential: boolean;
  isOffline?: boolean;
  maybeEidStatus: ItwEidStatus | undefined;
  navigation: ReturnType<typeof useIONavigation>;
  skipViewTracking?: boolean;
};
⋮----
const getLifecycleBannerId = (
  status: ItwEidStatus | undefined,
  isItwCredential: boolean
) =>
⋮----
export const useItwEidLifecycleAlertTracking = ({
  isItwCredential,
  maybeEidStatus,
  navigation,
  skipViewTracking = false,
  currentScreenName,
  isOffline = false
}: Props) =>
⋮----
const onFocus = () =>
⋮----
const onBlur = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwFailureSupportModal.tsx">
import { ZendeskCategory } from "@io-app/api-types/generated/definitions/content/ZendeskCategory";
import {
  Divider,
  ListItemAction,
  ListItemHeader,
  ListItemInfo,
  ListItemInfoCopy,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { Errors } from "@pagopa/io-react-native-wallet";
import I18n from "i18next";
import { Fragment, JSX } from "react";
import { Linking, View } from "react-native";
⋮----
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { isDefined } from "../../../../utils/guards.ts";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { CredentialIssuanceFailure } from "../../machine/credential/failure";
import { IssuanceFailure } from "../../machine/eid/failure";
import { RemoteFailure } from "../../presentation/remote/machine/failure.ts";
import { ItwFailure } from "../utils/ItwFailureTypes.ts";
import {
  useItwZendeskSupport,
  ZendeskSubcategoryValue
} from "./useItwZendeskSupport";
⋮----
type SupportContactMethods = Partial<{
  email: string;
  landline: string;
  mobile: string;
  website: string;
}>;
⋮----
const extractErrorCode = (failure: Props["failure"]) =>
⋮----
type Props = {
  credentialType?: string;
  failure:
    | CredentialIssuanceFailure
    | IssuanceFailure
    | ItwFailure
    | RemoteFailure;
  supportChatEnabled: boolean;
  supportLink?: string;
  zendeskCategory?: ZendeskCategory;
  zendeskSubcategory: ZendeskSubcategoryValue;
};
⋮----
const handleAskAssistance = () =>
⋮----
dismiss();
handleAskAssistance();
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwInfoBottomSheet.tsx">
import { H6, IOMarkdownLite, VSpacer, VStack } from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
⋮----
type ItwInfoFlowContentType = {
  body: string;
  title?: string;
};
⋮----
type ItwInfoFlowProps = {
  content: Array<ItwInfoFlowContentType>;
  title: string;
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwStatusIconColor.ts">
import { IOColors, useIOTheme } from "@io-app/design-system";
⋮----
export const useItwStatusIconColor = (expired: boolean): IOColors =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useItwZendeskSupport.ts">
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
import { ZendeskCategory } from "@io-app/api-types/generated/definitions/content/ZendeskCategory";
import { useRoute } from "@react-navigation/native";
import { useCallback } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  addTicketCustomField,
  appendLog,
  assistanceToolRemoteConfig,
  resetCustomFields,
  resetLog,
  zendeskCategoryId,
  zendeskItWalletCategory,
  zendeskItWalletFailureCode,
  zendeskItWalletSubcategoryId
} from "../../../../utils/supportAssistance";
import {
  zendeskSelectedCategory,
  zendeskSupportStart
} from "../../../zendesk/store/actions";
import { itwZendeskCategorySelector } from "../store/selectors/zendesk";
⋮----
export enum ZendeskSubcategoryValue {
  IT_WALLET_AGGIUNTA_DOCUMENTI = "it_wallet_aggiunta_documenti",
  IT_WALLET_PRESENTAZIONE_REMOTA = "it_wallet_presentazione_remota"
}
⋮----
const getSubcategoryValue = (
  category: ZendeskCategory,
  subcategory: ZendeskSubcategoryValue
)
⋮----
export type ItwZendeskSupportParams = {
  category?: ZendeskCategory;
  errorCode?: string;
  logData?: string;
  subcategory: ZendeskSubcategoryValue;
};
⋮----
export const useItwZendeskSupport = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useLayoutSize.ts">
import { useCallback, useState } from "react";
import { LayoutChangeEvent, LayoutRectangle } from "react-native";
⋮----
type LayoutSize = Pick<LayoutRectangle, "height" | "width">;
⋮----
export const useLayoutSize = (
  initialSize: LayoutSize = { width: 0, height: 0 }
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useNotAvailableToastGuard.ts">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { useIOSelector } from "../../../../store/hooks.ts";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
⋮----
export const useNotAvailableToastGuard = (
  fn: (...args: Array<any>) => Promise<void> | void
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/hooks/useOfflineAlertDetailModal.tsx">
import { IOButton, IOMarkdown, VStack } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { startupLoadSuccess } from "../../../../store/actions/startup";
import { useIODispatch } from "../../../../store/hooks";
import { StartupStatusEnum } from "../../../../store/reducers/startup";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { resetOfflineAccessReason } from "../../../ingress/store/actions";
import { OfflineAccessReasonEnum } from "../../../ingress/store/reducer";
import { trackItwOfflineRicaricaAppIO } from "../../wallet/analytics";
import { useAppRestartAction } from "../../wallet/hooks/useAppRestartAction";
⋮----
export type OfflineModalAccessReason = Exclude<
  OfflineAccessReasonEnum,
  OfflineAccessReasonEnum.TIMEOUT
>;
⋮----
const getOfflineModalLocales = (reason: OfflineModalAccessReason) =>
⋮----
export const useOfflineAlertDetailModal = (
  offlineAccessReason: OfflineModalAccessReason
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/saga/environment.ts">
import { SagaIterator } from "redux-saga";
import { put, takeLatest } from "typed-redux-saga/macro";
⋮----
import { walletRemoveCardsByCategory } from "../../../wallet/store/actions/cards";
import { itwLifecycleStoresReset } from "../../lifecycle/store/actions";
import { itwResetEnv, itwSetEnv } from "../store/actions/environment";
</file>

<file path="apps/main-app/ts/features/itwallet/common/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { call, fork, select, take } from "typed-redux-saga/macro";
import { Action, isActionOf } from "typesafe-actions";
⋮----
import { setConnectionStatus } from "../../../connectivity/store/actions";
import { isConnectedSelector } from "../../../connectivity/store/selectors";
import {
  syncItwAnalyticsProperties,
  updateNfcInfoTrackingProperties,
  watchItwAnalyticsSaga
} from "../../analytics/saga";
import { watchItwCredentialsSaga } from "../../credentials/saga";
import { checkCredentialsBatchRefill } from "../../credentials/saga/checkCredentialsBatchRefill";
import { checkCredentialsStatusAssertion } from "../../credentials/saga/checkCredentialsStatusAssertion";
import { handleItwCredentialsVaultCoherenceSaga } from "../../credentials/saga/handleItwCredentialsVaultCoherenceSaga";
import { handleItwCredentialsVaultMigrationSaga } from "../../credentials/saga/handleItwCredentialsVaultMigrationSaga";
import { handleKeyAttestationsCleanUp } from "../../credentials/saga/handleKeyAttestationsCleanUp";
import { handleWalletCredentialsRehydration } from "../../credentials/saga/handleWalletCredentialsRehydration";
import { watchItwCredentialsCatalogueSaga } from "../../credentialsCatalogue/saga/index";
import { checkHasNfcFeatureSaga } from "../../identification/common/saga/index";
import { watchItwLifecycleSaga } from "../../lifecycle/saga";
import { checkCurrentWalletInstanceStateSaga } from "../../lifecycle/saga/checkCurrentWalletInstanceStateSaga";
import { warmUpIntegrityServiceSaga } from "../../lifecycle/saga/checkIntegrityServiceReadySaga";
import {
  checkWalletInstanceInconsistencySaga,
  checkWalletInstanceStateSaga
} from "../../lifecycle/saga/checkWalletInstanceStateSaga";
import {
  handleItwOfflineStatusListSaga,
  handleItwStatusListSaga,
  watchItwStatusListAuthenticatedSaga
} from "../../statusList/saga";
import { checkFiscalCodeEnabledSaga } from "../../trialSystem/saga/checkFiscalCodeIsEnabledSaga";
import { watchItwEnvironment } from "./environment";
import { watchItwOfflineSaga } from "./offlineAccess";
</file>

<file path="apps/main-app/ts/features/itwallet/common/saga/linking.ts">
import { getActionFromState, getStateFromPath } from "@react-navigation/native";
import { call } from "typed-redux-saga/macro";
⋮----
import type { ItwDeepLink } from "../utils/linking";
⋮----
import NavigationService from "../../../../navigation/NavigationService";
import { itwLinkingConfig } from "../../navigation/linking";
</file>

<file path="apps/main-app/ts/features/itwallet/common/saga/offlineAccess.ts">
import { AppStateStatus } from "react-native";
import {
  call,
  fork,
  put,
  select,
  take,
  takeLatest
} from "typed-redux-saga/macro";
import { Action, ActionType, getType, isActionOf } from "typesafe-actions";
⋮----
import { backgroundActivityTimeout } from "../../../../config";
import {
  applicationChangeState,
  startApplicationInitialization
} from "../../../../store/actions/application";
import { startupLoadSuccess } from "../../../../store/actions/startup";
import {
  isStartupLoaded,
  StartupStatusEnum
} from "../../../../store/reducers/startup";
import {
  resetOfflineAccessReason,
  setOfflineAccessReason
} from "../../../ingress/store/actions";
import { offlineAccessReasonSelector } from "../../../ingress/store/selectors";
import { checkWalletInstanceStateOfflineSaga } from "../../lifecycle/saga/checkWalletInstanceStateSaga";
import { itwUpdateWalletInstanceStatus } from "../../walletInstance/store/actions";
import {
  itwOfflineAccessCounterReset,
  itwOfflineAccessCounterUp
} from "../store/actions/securePreferences";
</file>

<file path="apps/main-app/ts/features/itwallet/common/saga/utils.ts">
import semver from "semver";
import { take } from "typed-redux-saga/macro";
import { Action, isActionOf } from "typesafe-actions";
⋮----
import { itwCredentialsStore } from "../../credentials/store/actions";
import { CredentialType } from "../utils/itwMocksUtils";
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/actions/banners.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { ItwBannerId } from "../reducers/banners";
⋮----
export type ItwBannersActions =
  | ActionType<typeof itwCloseBanner>
  | ActionType<typeof itwShowBanner>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/actions/environment.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { EnvType } from "../../utils/environment.ts";
⋮----
export type ItwEnvironmentActions =
  | ActionType<typeof itwResetEnv>
  | ActionType<typeof itwSetEnv>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/actions/index.ts">
import { ItwCredentialsActions } from "../../../credentials/store/actions";
import { ItwCredentialsCatalogueActions } from "../../../credentialsCatalogue/store/actions";
import { ItwIdentificationActions } from "../../../identification/common/store/actions";
import { ItwIssuanceActions } from "../../../issuance/store/actions";
import { ItwLifecycleActions } from "../../../lifecycle/store/actions";
import { ItwProximityActions } from "../../../presentation/proximity/store/actions";
import { ItwWalletInstanceActions } from "../../../walletInstance/store/actions";
import { ItwBannersActions } from "./banners";
import { ItwEnvironmentActions } from "./environment";
import { ItwPreferencesActions } from "./preferences";
import { ItwSecurePreferencesActions } from "./securePreferences";
import { ItwUiActions } from "./ui";
⋮----
export type ItwActions =
  | ItwBannersActions
  | ItwCredentialsActions
  | ItwCredentialsCatalogueActions
  | ItwEnvironmentActions
  | ItwIdentificationActions
  | ItwIssuanceActions
  | ItwLifecycleActions
  | ItwPreferencesActions
  | ItwProximityActions
  | ItwSecurePreferencesActions
  | ItwUiActions
  | ItwWalletInstanceActions;
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/actions/preferences.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { IdentificationContext } from "../../../machine/eid/context.ts";
import { CredentialMetadata, ItwAuthLevel } from "../../utils/itwTypesUtils.ts";
⋮----
export type ItwWalletActivationFeedbackBannerData = {
  authMethod: string;
  docStatus: "active" | "not_active";
};
⋮----
export type ItwPreferencesActions =
  | ActionType<typeof itwClearCredentialUpgradeFailed>
  | ActionType<typeof itwClearWalletActivationFeedbackBannerData>
  | ActionType<typeof itwDisableItwActivation>
  | ActionType<typeof itwSetAuthLevel>
  | ActionType<typeof itwSetClaimValuesHidden>
  | ActionType<typeof itwSetCredentialUpgradeFailed>
  | ActionType<typeof itwSetDiscoverMoreCEDEnabled>
  | ActionType<typeof itwSetFiscalCodeWhitelisted>
  | ActionType<typeof itwSetIdentificationMode>
  | ActionType<typeof itwSetL2Fallback>
  | ActionType<typeof itwSetPidReissuingSurveyHidden>
  | ActionType<typeof itwSetProximityNfcLocallyEnabled>
  | ActionType<typeof itwSetWalletActivationFeedbackBannerData>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/actions/securePreferences.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type ItwSecurePreferencesActions =
  | ActionType<typeof itwOfflineAccessCounterReset>
  | ActionType<typeof itwOfflineAccessCounterUp>
  | ActionType<typeof itwUnverifiedCredentialsCounterReset>
  | ActionType<typeof itwUnverifiedCredentialsCounterUp>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/actions/ui.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { MixPanelCredential } from "../../../analytics/utils/types";
import { EidActivationExitStep } from "../../hooks/useItwActivationExitSurveyBottomSheet.tsx";
import { CredentialExitStep } from "../../hooks/useItwCredentialExitSurveyBottomSheet.tsx";
⋮----
export type ItwUiActions = ActionType<
  | typeof itwSetActivationExitSurvey
  | typeof itwSetCredentialExitSurvey
  | typeof itwSetFeedbackBottomSheetVisible
>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/reducers/banners.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NonEmptyArray } from "../../../../../types/helpers";
import { itwLifecycleStoresReset } from "../../../lifecycle/store/actions";
import { itwCloseBanner, itwShowBanner } from "../actions/banners";
⋮----
export type ItwCredentialValidityBannerId = `newCredentialValidity:${string}`;
⋮----
export const getNewCredentialValidityBannerId = (
  credentialType: string
): ItwCredentialValidityBannerId => `newCredentialValidity:$
⋮----
export type ItwBannerId =
  | "activationSuccessFeedback"
  | "ageVerificationUsageDetails"
  | "discovery"
  | "discovery_messages_inbox"
  | "discovery_wallet"
  | "itw_pid_info"
  | "mdlDetailsInfo"
  | "proximity_qr_code_info"
  | "tsDetailsInfo"
  | "upgradeMDLDetails"
  | ItwCredentialValidityBannerId;
⋮----
export type ItwBannersState = Partial<
  Record<
    ItwBannerId,
    {
      dismissCount?: number;
      dismissedOn?: string;
      shownOn?: string;
    }
  >
>;
⋮----
const reducer = (
  state: ItwBannersState = itwBannersInitialState,
  action: Action
): ItwBannersState =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/reducers/environment.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { EnvType } from "../../utils/environment.ts";
import { itwResetEnv, itwSetEnv } from "../actions/environment.ts";
⋮----
export type ItwEnvironmentState = {
  env?: EnvType;
};
⋮----
const reducer = (
  state: ItwEnvironmentState = initialState,
  action: Action
): ItwEnvironmentState =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { addMonths } from "date-fns";
import _ from "lodash";
import { combineReducers } from "redux";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  PersistPartial,
  persistReducer
} from "redux-persist";
⋮----
import { Action } from "../../../../../store/actions/types";
import { isDevEnv } from "../../../../../utils/environment";
import itwCredentialsReducer, {
  ItwCredentialsState
} from "../../../credentials/store/reducers";
import itwCredentialsCatalogueReducer, {
  ItwCredentialsCatalogueState
} from "../../../credentialsCatalogue/store/reducers";
import identificationReducer, {
  ItwIdentificationState
} from "../../../identification/common/store/reducers";
import issuanceReducer, {
  ItwIssuanceState
} from "../../../issuance/store/reducers";
import itwProximityReducer, {
  ItwProximityState
} from "../../../presentation/proximity/store/reducers";
import wiaReducer, {
  ItwWalletInstanceState
} from "../../../walletInstance/store/reducers";
import bannersReducer, { ItwBannersState } from "./banners";
import environmentReducer, { ItwEnvironmentState } from "./environment";
import preferencesReducer, { ItwPreferencesState } from "./preferences";
import remoteConfigReducer, { ItwRemoteConfigState } from "./remoteConfig";
import securePreferencesReducer, {
  ItwSecurePreferencesState
} from "./securePreferences";
import uiReducer, { ItwUiState } from "./ui";
⋮----
export type ItWalletState = {
  banners: ItwBannersState;
  credentials: ItwCredentialsState & PersistPartial;
  credentialsCatalogue: ItwCredentialsCatalogueState;
  environment: ItwEnvironmentState;
  identification: ItwIdentificationState;
  issuance: ItwIssuanceState & PersistPartial;
  preferences: ItwPreferencesState;
  proximity: ItwProximityState & PersistPartial;
  remoteConfig: ItwRemoteConfigState & PersistPartial;
  securePreferences: ItwSecurePreferencesState & PersistPartial;
  ui: ItwUiState;
  walletInstance: ItwWalletInstanceState & PersistPartial;
};
⋮----
export type PersistedItWalletState = ReturnType<typeof persistedReducer>;
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/reducers/preferences.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { itwLifecycleStoresReset } from "../../../lifecycle/store/actions";
import { IdentificationContext } from "../../../machine/eid/context.ts";
import { CredentialMetadata, ItwAuthLevel } from "../../utils/itwTypesUtils.ts";
import {
  itwClearCredentialUpgradeFailed,
  itwClearWalletActivationFeedbackBannerData,
  itwDisableItwActivation,
  itwSetAuthLevel,
  itwSetClaimValuesHidden,
  itwSetCredentialUpgradeFailed,
  itwSetDiscoverMoreCEDEnabled,
  itwSetFiscalCodeWhitelisted,
  itwSetIdentificationMode,
  itwSetL2Fallback,
  itwSetPidReissuingSurveyHidden,
  itwSetProximityNfcLocallyEnabled,
  itwSetWalletActivationFeedbackBannerData,
  ItwWalletActivationFeedbackBannerData
} from "../actions/preferences";
⋮----
export type ItwPreferencesState = {
  authLevel?: ItwAuthLevel;
  claimValuesHidden?: boolean;
  credentialUpgradeFailed?: ReadonlyArray<CredentialMetadata["credentialType"]>;
  identificationMode?: IdentificationContext["mode"];
  isDiscoverMoreCEDEnabled?: boolean;
  isFiscalCodeWhitelisted?: boolean;
  isItwActivationDisabled?: boolean;
  isL2Fallback?: boolean;
  isPidReissuingSurveyHidden?: boolean;
  isProximityNfcLocallyEnabled?: boolean;
  walletActivationFeedbackBannerData?: ItwWalletActivationFeedbackBannerData;
};
⋮----
const reducer = (
  state: ItwPreferencesState = itwPreferencesInitialState,
  action: Action
): ItwPreferencesState =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/reducers/remoteConfig.ts">
import { ItwConfig } from "@io-app/api-types/generated/definitions/content/ItwConfig";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  persistReducer
} from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { backendStatusLoadSuccess } from "../../../../../store/actions/backendStatus";
import { Action } from "../../../../../store/actions/types";
import createSecureStorage from "../../../../../store/storages/secureStorage";
import { isDevEnv } from "../../../../../utils/environment";
⋮----
export type ItwRemoteConfigState = Partial<ItwConfig>;
⋮----
const reducer = (
  state: ItwRemoteConfigState = itwRemoteConfigInitialState,
  action: Action
): ItwRemoteConfigState =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/reducers/securePreferences.ts">
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import createSecureStorage from "../../../../../store/storages/secureStorage";
import {
  itwOfflineAccessCounterReset,
  itwOfflineAccessCounterUp,
  itwUnverifiedCredentialsCounterReset,
  itwUnverifiedCredentialsCounterUp
} from "../actions/securePreferences";
⋮----
export type ItwSecurePreferencesState = {
  offlineAccessCounter: number;
  unverifiedCredentialsAccessCounter: number;
};
⋮----
const reducer = (
  state: ItwSecurePreferencesState = itwSecurePreferencesInitialState,
  action: Action
): ItwSecurePreferencesState =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/reducers/ui.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { MixPanelCredential } from "../../../analytics/utils/types";
import { EidActivationExitStep } from "../../hooks/useItwActivationExitSurveyBottomSheet.tsx";
import { CredentialExitStep } from "../../hooks/useItwCredentialExitSurveyBottomSheet.tsx";
import {
  itwSetActivationExitSurvey,
  itwSetCredentialExitSurvey,
  itwSetFeedbackBottomSheetVisible
} from "../actions/ui";
⋮----
export type ItwUiState = Readonly<{
  activationExitSurvey: undefined | { step: EidActivationExitStep };
  credentialExitSurvey:
    | undefined
    | { credential: MixPanelCredential; step: CredentialExitStep };
  itwFeedbackBottomSheet: boolean;
}>;
⋮----
const reducer = (
  state: ItwUiState = itwUiInitialState,
  action: Action
): ItwUiState =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/selectors/banners.ts">
import { addDays, isPast } from "date-fns";
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import {
  bannerHideDurations,
  bannerVisibleDurations,
  defaultBannerHideDuration,
  ItwBannerId
} from "../reducers/banners";
⋮----
const itwBannersSelector = (state: GlobalState)
⋮----
export const itwIsBannerVisibleSelector = (id: ItwBannerId)
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/selectors/environment.ts">
import { CieIdEnvironment } from "@pagopa/io-react-native-cieid";
import { ItwVersion } from "@pagopa/io-react-native-wallet";
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { itwCredentialsEidSelector } from "../../../credentials/store/selectors";
import { CURRENT_ITW_SPECS_VERSION } from "../../utils/constants";
import { itwIsL3EnabledSelector } from "./index";
⋮----
export const selectItwEnv = (state: GlobalState)
⋮----
export const selectItwCieIdEnvironment = (
  state: GlobalState
): CieIdEnvironment
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/selectors/index.ts">
import { GlobalState } from "../../../../../store/reducers/types";
import { isConnectedSelector } from "../../../../connectivity/store/selectors";
import { OfflineAccessReasonEnum } from "../../../../ingress/store/reducer";
import { offlineAccessReasonSelector } from "../../../../ingress/store/selectors";
import {
  itwCredentialsEidIssuedAtSelector,
  itwCredentialsEidStatusSelector,
  itwIsWalletEmptySelector
} from "../../../credentials/store/selectors";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsOperationalOrValid,
  itwLifecycleIsValidSelector
} from "../../../lifecycle/store/selectors";
import { hasPresentableCredentialsSelector } from "../../../presentation/proximity/store/selectors/credentials";
import {
  itwIsRemotelyActiveSelector,
  itwIsWalletInstanceStatusFailureSelector
} from "../../../walletInstance/store/selectors";
import { isCredentialIssuedBeforePid } from "../../utils/itwCredentialUtils";
import {
  itwIsAgeVerificationUsageDetailsBannerVisibleSelector,
  itwIsBannerVisibleSelector,
  itwIsDiscoveryBannerVisibleSelector,
  itwIsWalletDiscoveryBannerVisibleSelector,
  itwIsWalletUpgradeMDLDetailsBannerVisibleSelector
} from "./banners";
import {
  itwCredentialUpgradeFailedSelector,
  itwIsActivationDisabledSelector,
  itwIsFiscalCodeWhitelisted,
  itwIsProximityNfcLocallyEnabledSelector
} from "./preferences";
import {
  isItwEnabledSelector,
  isItwMinAppVersionSupportedSelector,
  isItwProximityMinAppVersionSupportedSelector,
  isItwProximityNfcMinAppVersionSupportedSelector
} from "./remoteConfig";
⋮----
export const itwIsL3EnabledSelector = (state: GlobalState)
⋮----
export const itwIsL2FallbackSelector = (state: GlobalState)
⋮----
export const isItwDiscoveryBannerRenderableSelector = (state: GlobalState)
⋮----
export const isItwPersistedDiscoveryBannerRenderableSelector = (
  state: GlobalState
)
⋮----
export const itwShouldRenderWalletReadyBannerSelector = (state: GlobalState)
⋮----
export const itwOfflineAccessAvailableSelector = (state: GlobalState)
⋮----
export const itwShouldRenderL3UpgradeBannerSelector = (state: GlobalState)
⋮----
export const itwShouldUpgradeCredentialSelector =
(credentialType: string, issuedAt?: string) => (state: GlobalState) =>
⋮----
export const itwShouldRenderNewItWalletSelector = (state: GlobalState) =>
⋮----
export const itwShouldRenderWalletUpgradeMDLDetailsBannerSelector = (
  state: GlobalState
): boolean
⋮----
export const itwShouldRenderAgeVerificationUsageDetailsBannerSelector = (
  state: GlobalState
): boolean
⋮----
export const itwShouldHideEidLifecycleAlert = (state: GlobalState): boolean =>
⋮----
export const itwShouldRenderDiscoveryBannerSelector = (state: GlobalState)
⋮----
export const itwShouldRenderInboxDiscoveryBannerSelector = (
  state: GlobalState
) =>
⋮----
export const itwShouldRenderWalletDiscoveryBannerSelector = (
  state: GlobalState
)
⋮----
export const itwShouldRenderUpgradeBannerSelector = (state: GlobalState)
⋮----
export const itwShouldRenderL2EngagementBannerForInactiveWalletSelector = (
  state: GlobalState
)
⋮----
export const itwShouldRenderL2EngagementBannerSelector = (state: GlobalState)
⋮----
export const isItwProximityEnabledSelector = (state: GlobalState)
⋮----
export const isItwProximityNfcEnabledSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/selectors/preferences.ts">
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const itwPreferencesSelector = (state: GlobalState)
⋮----
export const itwAuthLevelSelector = (state: GlobalState)
⋮----
export const itwIsClaimValueHiddenSelector = (state: GlobalState)
⋮----
export const itwIsFiscalCodeWhitelisted = (state: GlobalState)
⋮----
export const itwIsPidReissuingSurveyHiddenSelector = (state: GlobalState)
⋮----
export const itwCredentialUpgradeFailedSelector = (state: GlobalState)
⋮----
export const itwIdentificationModeSelector = (state: GlobalState)
⋮----
export const itwIsProximityNfcLocallyEnabledSelector = (state: GlobalState)
⋮----
export const itwIsActivationDisabledSelector = (state: GlobalState)
⋮----
export const itwWalletActivationFeedbackBannerDataSelector = (
  state: GlobalState
)
⋮----
export const itwIsDiscoverMoreCEDLocallyEnabledSelector = (
  state: GlobalState
)
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/selectors/remoteConfig.ts">
import { Platform } from "react-native";
import { createSelector } from "reselect";
⋮----
import { isMinAppVersionSupported } from "../../../../../store/reducers/featureFlagWithMinAppVersionStatus";
import { GlobalState } from "../../../../../store/reducers/types";
import {
  getAppVersion,
  isVersionSupported
} from "../../../../../utils/appVersion";
⋮----
const itwRemoteConfigSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/selectors/securePreferences.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { progressSelector } from "../../../../identification/store/selectors";
import { ItwSecurePreferencesState } from "../reducers/securePreferences";
⋮----
const selectSecurePreferencesSlice = (
  state: GlobalState
): ItwSecurePreferencesState
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/selectors/ui.ts">
import { GlobalState } from "../../../../../store/reducers/types";
import { ItwUiState } from "../reducers/ui";
⋮----
export const itwFeedbackBottomSheetVisibleSelector = (
  state: GlobalState
): boolean
⋮----
export const itwActivationExitSurveySelector = (
  state: GlobalState
): ItwUiState["activationExitSurvey"]
⋮----
export const itwCredentialExitSurveySelector = (
  state: GlobalState
): ItwUiState["credentialExitSurvey"]
</file>

<file path="apps/main-app/ts/features/itwallet/common/store/selectors/zendesk.ts">
import { GlobalState } from "../../../../../store/reducers/types";
import {
  zendeskDocumentiSuIoCategory,
  zendeskItWalletCategory
} from "../../../../../utils/supportAssistance";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../../lifecycle/store/selectors";
⋮----
export enum ItwZendeskWalletStatus {
  DOCUMENTI_SU_IO = "documenti_su_io",
  IT_WALLET = "it_wallet",
  NOT_ACTIVE = "not_active"
}
⋮----
export const itwZendeskWalletStatusSelector = (
  state: GlobalState
): ItwZendeskWalletStatus =>
⋮----
export const itwZendeskCategorySelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/constants.ts">
import { type ItwVersion } from "@pagopa/io-react-native-wallet";
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/environment.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
import Config from "react-native-config";
import { z } from "zod";
⋮----
export type Env = {
  BYPASS_IDENTITY_MATCH: boolean;
  GOOGLE_CLOUD_PROJECT_NUMBER: string;
  ISSUANCE_REDIRECT_URI: string;
  REDIRECT_URI: string;
  type: EnvType;
  VERIFIER_BASE_URL: string;
  WALLET_EAA_PROVIDER_BASE_URL: ItwSpecsEnvVar;
  WALLET_PID_PROVIDER_BASE_URL: ItwSpecsEnvVar;
  WALLET_PROVIDER_BASE_URL: string;
  WALLET_TA_BASE_URL: string;
  X509_CERT_ROOT: string;
};
⋮----
export type EnvType = z.infer<typeof EnvTypeSchema>;
⋮----
class ItwSpecsEnvVar
⋮----
constructor(private values: Record<ItwVersion, string>)
⋮----
value(version: ItwVersion)
⋮----
export const getEnv = (env: EnvType): Env =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/imageCache.ts">
import {
  DataSourceParam,
  Skia,
  type SkImage
} from "@shopify/react-native-skia";
import { useEffect, useState } from "react";
import { Image as RNImage } from "react-native";
⋮----
const loadImageAsync = (source: number): Promise<null | SkImage> =>
⋮----
export const useCachedImage = (source: DataSourceParam): null | SkImage =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwAttestationUtils.ts">
import {
  createCryptoContextFor,
  type ItwVersion
} from "@pagopa/io-react-native-wallet";
⋮----
import { getAppVersion } from "../../../../utils/appVersion";
import { assert } from "../../../../utils/assert";
import { createItWalletFetch } from "../../api/client";
import { WALLET_SOLUTION_ID } from "./constants";
import { Env } from "./environment.ts";
import {
  createKeyAttestationCryptoContextFor,
  regenerateCryptoKey,
  WIA_KEYTAG
} from "./itwCryptoContextUtils";
import {
  generateIntegrityHardwareKeyTag,
  getIntegrityContext
} from "./itwIntegrityUtils";
import { getIoWallet } from "./itwIoWallet";
import { WalletInstanceAttestations } from "./itwTypesUtils.ts";
⋮----
export const getIntegrityHardwareKeyTag = async (): Promise<string>
⋮----
export const registerWalletInstance = async (
  { WALLET_PROVIDER_BASE_URL }: Env,
  itwVersion: ItwVersion,
  hardwareKeyTag: string,
  sessionToken: string,
  options?: { isRenewal?: boolean }
) =>
⋮----
export const getWalletInstanceAttestation = async (
  { WALLET_PROVIDER_BASE_URL }: Env,
  itwVersion: ItwVersion,
  hardwareKeyTag: string,
  sessionToken: string
): Promise<WalletInstanceAttestations> =>
⋮----
export const isWalletInstanceAttestationValid = (
  itwVersion: ItwVersion,
  attestation: string
): boolean =>
⋮----
export const isWalletInstanceAttestationForSpecs = (
  itwVersion: ItwVersion,
  attestation: string
): boolean =>
⋮----
export const getWalletInstanceStatus = (
  { WALLET_PROVIDER_BASE_URL }: Env,
  itwVersion: ItwVersion,
  hardwareKeyTag: string,
  sessionToken: string
)
⋮----
export const getCurrentWalletInstanceStatus = (
  { WALLET_PROVIDER_BASE_URL }: Env,
  itwVersion: ItwVersion,
  sessionToken: string
) =>
⋮----
export const getKeyAttestation = async (
  { WALLET_PROVIDER_BASE_URL }: Env,
  itwVersion: ItwVersion,
  keyTags: ReadonlyArray<string>,
  hardwareKeyTag: string,
  sessionToken: string
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwClaimsUtils.ts">
import { addPadding } from "@pagopa/io-react-native-jwt";
import { differenceInCalendarDays, isValid } from "date-fns";
import I18n from "i18next";
import { truncate } from "lodash";
import { Result } from "neverthrow";
import { z } from "zod";
⋮----
import { Locales } from "../../../../i18n";
import { parseWithSchema } from "./itwSchemaUtils";
import { CredentialMetadata, ParsedCredential } from "./itwTypesUtils";
⋮----
export enum WellKnownClaim {
  content = "content",
  date_of_expiry = "date_of_expiry",
  document_number = "document_number",
  driving_privileges = "driving_privileges",
  expiry_date = "expiry_date",
  family_name = "family_name",
  given_name = "given_name",
  issuing_authority = "issuing_authority",
  link_qr_code = "link_qr_code",
  portrait = "portrait",
  tax_id_code = "tax_id_code",
  unique_id = "unique_id"
}
⋮----
export type ClaimDisplayFormat =
  | FlatClaimDisplayFormat
  | NestedArrayClaimDisplayFormat;
⋮----
export type DisclosureClaim = {
  claim: ClaimDisplayFormat;
  source: string;
};
⋮----
type FlatClaimDisplayFormat = {
  id: string;
  label: string;
  value: unknown;
};
⋮----
type NestedArrayClaimDisplayFormat = {
  id: string;
  label: string;
  value: Array<ParsedCredential>;
};
⋮----
export const parseClaims = (
  parsedCredential: ParsedCredential,
  options: { exclude?: Array<string> } = {}
): Array<ClaimDisplayFormat> =>
⋮----
export enum ClaimsLocales {
  en = "en-US",
  it = "it-IT"
}
⋮----
export type SimpleDateFormat =
  (typeof SimpleDateFormat)[keyof typeof SimpleDateFormat];
⋮----
export class SimpleDate
⋮----
constructor(year: number, month: number, day: number)
⋮----
getDate(): number
⋮----
getFullYear(): number
⋮----
getMonth(): number
⋮----
toDate(): Date
⋮----
toDateWithoutTimezone(): Date
⋮----
toString(format: SimpleDateFormat = "DD/MM/YYYY"): string
⋮----
export const getClaimsFullLocale = (): ClaimsLocales
⋮----
export type PlaceOfBirthClaimType = z.infer<typeof PlaceOfBirthClaim>;
⋮----
export type DrivingPrivilegeClaimType = z.infer<typeof DrivingPrivilegeClaim>;
⋮----
export type DrivingPrivilegesClaimType = Array<DrivingPrivilegeClaimType>;
⋮----
/** Alias for the string claim field of the credential. */
⋮----
/** Schema for an URL image in base64 format */
⋮----
/** Schema for a simple list of string claims (for instance, nationality codes) */
⋮----
/**
 * Record of string keys and ParsedAttribute values. This is used to parse
 * nested claims.
 */
⋮----
/**
 * Array of records of string keys and ParsedAttribute values. This is used to
 * parse nested claims.
 */
⋮----
... (97 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwCredentialIssuanceUtils.ts">
import { getRedirects } from "@io-app/login-utils";
import { generate } from "@pagopa/io-react-native-crypto";
import { type CryptoContext } from "@pagopa/io-react-native-jwt";
import {
  createCryptoContextFor,
  type CredentialIssuance,
  type ItwVersion,
  RemotePresentation
} from "@pagopa/io-react-native-wallet";
import last from "lodash/last";
import { v4 as uuidv4 } from "uuid";
⋮----
import { assert } from "../../../../utils/assert";
import { getCredentialStatusFromStatusList } from "../../statusList/utils";
import { Env } from "./environment";
import { getKeyAttestation } from "./itwAttestationUtils";
import { getCredentialStatusAssertion } from "./itwCredentialStatusAssertionUtils";
import {
  extractVerification,
  getCredentialKeyTags,
  isBatchCredential
} from "./itwCredentialUtils";
import {
  DPOP_KEYTAG,
  regenerateCryptoKey,
  WIA_KEYTAG
} from "./itwCryptoContextUtils";
import { enrichErrorWithMetadata } from "./itwFailureUtils";
import { getIoWallet } from "./itwIoWallet";
import { CredentialType } from "./itwMocksUtils";
import {
  CredentialAccessToken,
  CredentialBundle,
  CredentialFormat,
  CredentialMetadata,
  CredentialOfferResolved,
  EvaluatedDcqlQueryResult,
  IssuerConfiguration,
  RequestObject
} from "./itwTypesUtils";
⋮----
export const getBatchRefillThreshold = (
  credentialType: string
): number | undefined
⋮----
export const shouldRefillBatch = (
  credential: Pick<CredentialMetadata, "credentialType" | "keyTag" | "keyTags">
): boolean =>
⋮----
export const getEffectiveBatchSize = (
  credentialType: string,
  issuerBatchSize: number | undefined
): number =>
⋮----
export type RequestCredential = (args: {
  credentialType: string;
  env: Env;
  issuerConf?: IssuerConfiguration;
  itwVersion: ItwVersion;
  pid: CredentialBundle;
  resolvedCredentialOffer?: CredentialOfferResolved;
  skipMdocIssuance: boolean;
  walletInstanceAttestation: string;
}) => Promise<{
  clientId: string;
  codeVerifier: string;
  evaluatedDcqlQuery: EvaluatedDcqlQueryResult;
  issuerConf: IssuerConfiguration;
  requestedCredential: RequestObject;
  responseMode?: string;
}>;
⋮----
export const requestCredential: RequestCredential = async ({
  env,
  itwVersion,
  credentialType,
  issuerConf: resolvedIssuerConf,
  walletInstanceAttestation,
  skipMdocIssuance,
  resolvedCredentialOffer,
  pid
}) =>
⋮----
export type CompleteAuthFlow = (args: {
  codeVerifier: string;
  env: Env;
  evaluatedDcqlQuery: EvaluatedDcqlQueryResult;
  issuerConf: IssuerConfiguration;
  itwVersion: ItwVersion;
  requestedCredential: RequestObject;
  responseMode?: string;
  walletInstanceAttestation: string;
}) => Promise<{ accessToken: CredentialAccessToken }>;
⋮----
export const completeAuthFlow: CompleteAuthFlow = async ({
  env,
  itwVersion,
  requestedCredential: requestObject,
  issuerConf,
  evaluatedDcqlQuery,
... (175 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwCredentialsCatalogueUtils.ts">
import {
  CredentialsCatalogue,
  ItwVersion
} from "@pagopa/io-react-native-wallet";
⋮----
import { Env } from "./environment";
import { getIoWallet } from "./itwIoWallet";
⋮----
export type CatalogueTranslations = CredentialsCatalogue.CatalogueTranslations;
⋮----
export type DigitalCredentialMetadata =
  DigitalCredentialsCatalogue["credentials"][number];
⋮----
export type DigitalCredentialsCatalogue =
  CredentialsCatalogue.DigitalCredentialsCatalogue;
⋮----
export const fetchCredentialsCatalogue = (env: Env, itwVersion: ItwVersion)
⋮----
export const fetchCatalogueTranslations = async (
  itwVersion: ItwVersion,
  catalogue: DigitalCredentialsCatalogue,
  locales: Array<string>
): Promise<CatalogueTranslations> =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwCredentialStatusAssertionUtils.ts">
import {
  createCryptoContextFor,
  ItwVersion
} from "@pagopa/io-react-native-wallet";
import { isAfter } from "date-fns";
⋮----
import { assert } from "../../../../utils/assert";
import { Env } from "./environment";
import { WIA_KEYTAG } from "./itwCryptoContextUtils";
import { getIoWallet } from "./itwIoWallet";
import {
  CredentialBundle,
  CredentialFormat,
  CredentialMetadata,
  IssuerConfiguration
} from "./itwTypesUtils";
⋮----
export const getCredentialStatusAssertion = async (
  { credential, metadata }: CredentialBundle,
  env: Env,
  itwVersion: ItwVersion
) =>
⋮----
export const shouldRequestStatusAssertion = ({
  validity,
  jwt,
  spec_version
}: CredentialMetadata) =>
⋮----
function createIssuerConfSharedFetch(maxAge = 86400)
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwCredentialStatusUtils.ts">
import { Errors, IoWallet } from "@pagopa/io-react-native-wallet";
import { differenceInCalendarDays } from "date-fns";
⋮----
import { getClaimsFullLocale, getCredentialExpireDate } from "./itwClaimsUtils";
import { DigitalCredentialMetadata } from "./itwCredentialsCatalogueUtils";
import { CredentialType } from "./itwMocksUtils";
import {
  CredentialFormat,
  CredentialMetadata,
  IssuerConfiguration,
  ItwCredentialStatus
} from "./itwTypesUtils";
⋮----
type GetCredentialStatusOptions = {
  expiringDays?: number;
};
⋮----
export const getCredentialStatus = (
  credential: CredentialMetadata,
  options: GetCredentialStatusOptions = {}
): ItwCredentialStatus =>
⋮----
export type CredentialStatusMessage = {
  description?: string;
  title?: string;
};
⋮----
export const getCredentialStatusMessageFromCatalog = ({
  ioWallet,
  rawStatus,
  catalogMetadata,
  catalogTranslations
}: {
  catalogMetadata?: DigitalCredentialMetadata;
  catalogTranslations?: Record<string, string>;
  ioWallet: IoWallet;
  rawStatus?: string;
}): CredentialStatusMessage | undefined =>
⋮----
export const getCredentialStatusMessageFromIssuerConf = ({
  errorCode,
  credentialId,
  issuerConf
}: {
  credentialId: string;
  errorCode?: string;
  issuerConf?: IssuerConfiguration;
}): CredentialStatusMessage | undefined =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwCredentialUtils.ts">
import { IOColors, Tag, useIOTheme } from "@io-app/design-system";
import { Mdoc, SdJwt } from "@pagopa/io-react-native-wallet";
import { isBefore } from "date-fns";
import I18n from "i18next";
⋮----
import { ItwIridescentBorderVariant } from "../components/ItwBrandedSkiaBorder";
import { CredentialType } from "./itwMocksUtils";
import {
  CredentialBundle,
  CredentialFormat,
  CredentialMetadata,
  ItwCredentialStatus,
  StoredVerification
} from "./itwTypesUtils";
⋮----
export const isBatchCredential = (
  credential: Pick<CredentialMetadata, "keyTags">
): boolean
⋮----
export const getCredentialKeyTags = (
  credential: Pick<CredentialMetadata, "keyTag" | "keyTags">
): ReadonlyArray<string>
⋮----
export const getCredentialVaultIds = (
  credential: Pick<CredentialMetadata, "credentialId" | "keyTags">
): ReadonlyArray<string>
⋮----
export const getRepresentativeVaultId = (
  credential: Pick<CredentialMetadata, "credentialId" | "keyTags">
): string
⋮----
export type L2Credential = (typeof l2Credentials)[number];
⋮----
export type NewCredential = (typeof newCredentials)[number];
⋮----
export const isUpcomingCredential = (type: string): boolean
⋮----
export const isNewCredential = (type: string): type is NewCredential
⋮----
export const isL2Credential = (
  type: string | undefined
): type is L2Credential
⋮----
const getCredentialNameByType = (
  isItwCredential: boolean
): Record<string, string> => (
⋮----
export const getCredentialNameFromType = (
  type: string | undefined,
  isItwCredential = false,
  withDefault = ""
): string =>
⋮----
export const useBorderColorByStatus: () =>
⋮----
export const useTagPropsByStatus = ():
⋮----
type ExtractVerification = (args: {
  credential: CredentialBundle["credential"];
  format: CredentialMetadata["format"];
  parsedCredential: CredentialMetadata["parsedCredential"];
}) => StoredVerification | undefined;
⋮----
export const extractVerification: ExtractVerification = ({
  format,
  parsedCredential,
  credential
}) =>
⋮----
export const isItwCredential = ({
  verification,
  spec_version
}: CredentialMetadata): boolean =>
⋮----
export const isCredentialIssuedBeforePid = (
  credentialIssuedAt?: string,
  pidIssuedAt?: string
): boolean =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwCryptoContextUtils.ts">
import { deleteKey, generate } from "@pagopa/io-react-native-crypto";
import { getAttestation as getAttestationIntegrity } from "@pagopa/io-react-native-integrity";
import {
  createCryptoContextFor,
  KeyAttestationCryptoContext
} from "@pagopa/io-react-native-wallet";
import { Platform } from "react-native";
⋮----
export const regenerateCryptoKey = (keyTag: string)
⋮----
export const createKeyAttestationCryptoContextFor = (
  keyTag: string
): KeyAttestationCryptoContext => (
⋮----
generateKeyWithAttestation(challenge)
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/ItwFailureTypes.ts">
export enum ItwFailureType {
  ITW_REMOTE_PAYLOAD_INVALID = "ITW_REMOTE_PAYLOAD_INVALID"
}
⋮----
export type ItwFailure = TypedRemoteFailures[keyof TypedRemoteFailures];
⋮----
export type WithCredentialMetadata<E = Error> = E & {
  metadata?: { credentialId: string; credentialType: string };
};
⋮----
type ReasonTypeByFailure = {
  [ItwFailureType.ITW_REMOTE_PAYLOAD_INVALID]: Error;
};
⋮----
type TypedRemoteFailures = {
  [K in ItwFailureType]: { reason: ReasonTypeByFailure[K]; type: K };
};
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwFailureUtils.ts">
import { CryptoErrorCodes } from "@pagopa/io-react-native-crypto";
import {
  IntegrityError,
  IntegrityErrorCodes
} from "@pagopa/io-react-native-integrity";
import { Errors, Trust } from "@pagopa/io-react-native-wallet";
import { z } from "zod";
⋮----
import {
  WEBVIEW_ERROR_CODE_PREFIX,
  WEBVIEW_HTTP_ERROR_CODE_PREFIX
} from "../../identification/cie/utils/constants";
import {
  type WebViewError,
  webViewError
} from "../../identification/cie/utils/error";
import { WithCredentialMetadata } from "./ItwFailureTypes";
⋮----
export const isFederationError = (
  error: unknown
): error is Trust.Errors.FederationError
⋮----
export const isLocalIntegrityError = (e: unknown): e is IntegrityError
⋮----
export const isAssertionGenerationError = (e: unknown): e is IntegrityError
⋮----
export const isAnprPid404Failure = (
  e: unknown
): e is Errors.IssuerResponseError
⋮----
export const enrichErrorWithMetadata =
(metadata: WithCredentialMetadata["metadata"]) => (err: unknown) =>
⋮----
export const isMrtdTaxIdCodeMismatchFailure = (
  e: unknown
): e is Errors.IssuerResponseError
⋮----
export const isWebViewError = (e: unknown): e is Error | WebViewError =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwIntegrityUtils.ts">
import { sign } from "@pagopa/io-react-native-crypto";
import {
  generateHardwareKey,
  generateHardwareSignatureWithAssertion,
  getAttestation as getAttestationIntegrity,
  isAttestationServiceAvailable,
  isPlayServicesAvailable,
  prepareIntegrityToken,
  requestIntegrityToken
} from "@pagopa/io-react-native-integrity";
import { CBOR } from "@pagopa/io-react-native-iso18013";
import { addPadding, removePadding } from "@pagopa/io-react-native-jwt";
import { IntegrityContext } from "@pagopa/io-react-native-wallet";
import { Platform } from "react-native";
import sha from "sha.js";
import { v4 as uuidv4 } from "uuid";
import { z } from "zod";
⋮----
import { Env } from "./environment";
⋮----
type HardwareSignatureWithAuthData = {
  authenticatorData: string;
  signature: string;
};
⋮----
const decodeAssertion = async (
  assertion: string
): Promise<HardwareSignatureWithAuthData>
⋮----
const getHardwareSignatureWithAuthData = (
  hardwareKeyTag: string,
  clientData: string
): Promise<HardwareSignatureWithAuthData>
⋮----
const generateIntegrityHardwareKeyTag = ()
⋮----
const ensureIntegrityServiceIsReady = (
⋮----
const getAttestation = (challenge: string, hardwareKeyTag: string)
⋮----
const getIntegrityContext = (hardwareKeyTag: string): IntegrityContext => (
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwIoWallet.ts">
import { IoWallet, ItwVersion } from "@pagopa/io-react-native-wallet";
⋮----
export function getIoWallet(version: ItwVersion)
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwIssuanceUtils.ts">
import {
  AuthorizationDetail,
  createCryptoContextFor,
  CredentialIssuance,
  ItwVersion
} from "@pagopa/io-react-native-wallet";
⋮----
import {
  type EidIssuanceLevel,
  type EidIssuanceMode,
  type IdentificationContext
} from "../../machine/eid/context";
import { CURRENT_ITW_SPECS_VERSION, pidScopes } from "./constants";
import { Env } from "./environment";
import { AuthorizedCredentialMetadata } from "./itwCredentialIssuanceUtils";
import { extractVerification } from "./itwCredentialUtils";
import {
  DPOP_KEYTAG,
  regenerateCryptoKey,
  WIA_KEYTAG
} from "./itwCryptoContextUtils";
import { getIoWallet } from "./itwIoWallet";
import { CredentialType } from "./itwMocksUtils";
import {
  CredentialAccessToken,
  CredentialBundle,
  IssuerConfiguration
} from "./itwTypesUtils";
⋮----
type StartAuthFlow = (params: {
  env: Env;
  identification: IdentificationContext;
  itwVersion: ItwVersion;
  walletAttestation: string;
  withMRTDPoP: boolean;
}) => Promise<{
  authUrl: string;
  clientId: string;
  codeVerifier: string;
  credentialDefinition: AuthorizationDetail;
  issuerConf: IssuerConfiguration;
  redirectUri: string;
}>;
⋮----
const startAuthFlow: StartAuthFlow = async ({
  env,
  itwVersion,
  walletAttestation,
  identification,
  withMRTDPoP
}) =>
⋮----
type CompleteAuthFlow = (args: {
  callbackUrl: string;
  codeVerifier: string;
  issuerConf: IssuerConfiguration;
  itwVersion: ItwVersion;
  redirectUri: string;
  walletAttestation: string;
}) => Promise<{
  accessToken: CredentialAccessToken;
}>;
⋮----
const completeAuthFlow: CompleteAuthFlow = async ({
  callbackUrl,
  codeVerifier,
  issuerConf,
  walletAttestation,
  redirectUri,
  itwVersion
}) =>
⋮----
type GetPid = (args: {
  accessToken: CredentialAccessToken;
  authorizedCredential: AuthorizedCredentialMetadata;
  clientId: string;
  env: Env;
  issuerConf: IssuerConfiguration;
  itwVersion: ItwVersion;
}) => Promise<CredentialBundle>;
⋮----
const getPid: GetPid = async ({
  itwVersion,
  env,
  issuerConf,
  clientId,
  accessToken,
  authorizedCredential
}) =>
⋮----
export const getIdpHint = (idCtx: IdentificationContext, env: Env) =>
⋮----
export const getSpidProductionIdpHint = (spidIdpId: string) =>
⋮----
const getPidSdJwtConfigurationId = (
  issuerConf: CredentialIssuance.IssuerConfig
): string =>
⋮----
export const getIssuanceItwVersion = (
  mode: EidIssuanceMode,
... (3 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwMetadataUtils.ts">
import { DigitalCredentialMetadata } from "./itwCredentialsCatalogueUtils.ts";
import { CredentialType } from "./itwMocksUtils.ts";
import { CredentialMetadata } from "./itwTypesUtils.ts";
⋮----
export const getForcedItwAuthSource = (
  credentialType: string
): string | undefined
⋮----
export const getItwAuthSource = (
  credential: DigitalCredentialMetadata,
  translations?: Record<string, string>
) =>
⋮----
export const getAuthSource = (credential: CredentialMetadata)
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwMocksUtils.ts">
import dc from "../../__mocks__/dc.json";
import eid from "../../__mocks__/eid.json";
import avL3 from "../../__mocks__/L3/avL3.json";
import dcL3 from "../../__mocks__/L3/dcL3.json";
import edatL3 from "../../__mocks__/L3/edatL3.json";
import edipL3 from "../../__mocks__/L3/edipL3.json";
import edL3 from "../../__mocks__/L3/edL3.json";
import eeL3 from "../../__mocks__/L3/eeL3.json";
import mdlL3 from "../../__mocks__/L3/mdlL3.json";
import resL3 from "../../__mocks__/L3/resL3.json";
import tsL3 from "../../__mocks__/L3/tsL3.json";
import mdl from "../../__mocks__/mdl.json";
import statusAssertion from "../../__mocks__/statusAssertion.json";
import ts from "../../__mocks__/ts.json";
import { WellKnownClaim } from "./itwClaimsUtils";
import {
  DigitalCredentialMetadata,
  DigitalCredentialsCatalogue
} from "./itwCredentialsCatalogueUtils";
import { CredentialMetadata, ParsedStatusAssertion } from "./itwTypesUtils";
⋮----
export enum CredentialType {
  DRIVING_LICENSE = "mDL",
  EDUCATION_ATTENDANCE = "education_attendance",
  EDUCATION_DEGREE = "education_degree",
  EDUCATION_DIPLOMA = "education_diploma",
  EDUCATION_ENROLLMENT = "education_enrollment",
  EUROPEAN_DISABILITY_CARD = "EuropeanDisabilityCard",
  EUROPEAN_HEALTH_INSURANCE_CARD = "EuropeanHealthInsuranceCard",
  PID = "pid",
  PROOF_OF_AGE = "proof_of_age",
  RESIDENCY = "residency"
}
⋮----
export type CredentialL3Key = keyof typeof ItwStoredCredentialsMocks.L3;
⋮----
export const withIssuingAuthorityClaimMock = (
  credential: CredentialMetadata
): CredentialMetadata => (
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwRevocationUtils.ts">
import { type ItwVersion } from "@pagopa/io-react-native-wallet";
⋮----
import { createItWalletFetch } from "../../api/client";
import { Env } from "./environment";
import { getIoWallet } from "./itwIoWallet";
⋮----
export const revokeCurrentWalletInstance = async (
  { WALLET_PROVIDER_BASE_URL }: Env,
  itwVersion: ItwVersion,
  sessionToken: string,
  integrityKeyTag: string
): Promise<void> =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwSchemaUtils.ts">
import { err, ok, Result } from "neverthrow";
import { z } from "zod";
⋮----
export const parseWithSchema = <S extends z.ZodType>(
  schema: S,
  value: unknown
): Result<z.output<S>, z.ZodError> =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwStoreUtils.ts">
import { GlobalState } from "../../../../store/reducers/types";
import { itwIntegrityServiceStatusSelector } from "../../issuance/store/selectors";
import { type CredentialIssuanceFailure } from "../../machine/credential/failure";
import { type IssuanceFailure } from "../../machine/eid/failure";
import { ProximityFailure } from "../../presentation/proximity/machine/failure.ts";
import { RemoteFailure } from "../../presentation/remote/machine/failure.ts";
⋮----
interface PollForStoreValueOptions<T> {
  condition: (value: T) => boolean;
  getState: () => GlobalState;
  interval?: number;
  selector: (state: GlobalState) => T;
  timeout?: number;
}
⋮----
export const pollForStoreValue = <T>({
  getState,
  selector,
  condition,
  interval = 1000,
  timeout = 10000
}: PollForStoreValueOptions<T>): Promise<T>
⋮----
export const shouldSerializeReason = (failure:
⋮----
export const serializeFailureReason = (
  failure:
    | CredentialIssuanceFailure
    | IssuanceFailure
    | ProximityFailure
    | RemoteFailure
) => (
⋮----
const createReasonObject = (message: string) => (
⋮----
const mapFailureReason = (reason: unknown) =>
⋮----
export const ensureIntegrityServiceIsStoreReadyOrThrow = async (store: {
  getState(): GlobalState;
⋮----
getState(): GlobalState;
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwStyleUtils.ts">
import { IOColors } from "@io-app/design-system";
import Color from "color";
import { StatusBarStyle } from "react-native";
⋮----
import { HeaderSecondLevelHookProps } from "../../../../hooks/useHeaderSecondLevel";
import { CredentialType } from "./itwMocksUtils";
⋮----
export type CredentialTheme = {
  backgroundColor: string;
  statusBarStyle: StatusBarStyle;
  textColor: string;
  variant: HeaderSecondLevelHookProps["variant"];
};
⋮----
type BaseCredentialColors = Pick<
  CredentialTheme,
  "backgroundColor" | "textColor"
>;
⋮----
export const getLegacyThemeColorByCredentialType = (
  credentialType: string
): CredentialTheme =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/itwTypesUtils.ts">
import {
  CredentialIssuance,
  CredentialOffer,
  CredentialStatus,
  RemotePresentation,
  SdJwt,
  WalletInstance
} from "@pagopa/io-react-native-wallet";
⋮----
import { CredentialType } from "./itwMocksUtils.ts";
⋮----
export const enum CredentialFormat {
  LEGACY_SD_JWT = "vc+sd-jwt",
  MDOC = "mso_mdoc",
  SD_JWT = "dc+sd-jwt"
}
⋮----
export type CredentialAccessToken = Awaited<
  ReturnType<CredentialIssuance.IssuanceApi["authorizeAccess"]>
>["accessToken"];
⋮----
export type CredentialBundle = {
  credential: string;
  metadata: CredentialMetadata;
  statusList?: { payload: CredentialStatus.StatusList; uri: string };
};
⋮----
export type CredentialMetadata = {
  credentialId: string;
  credentialType: string;
  format: string;
  issuerConf: IssuerConfiguration;
  jwt: {
    expiration: string;
    issuedAt?: string;
  };
  keyAttestationId?: string;
  keyTag: string;
  keyTags?: ReadonlyArray<string>;
  origin?: "catalogue" | "credentialOffer";
  parsedCredential: ParsedCredential;
  spec_version: string;
  validity?: CredentialValidity | LegacyCredentialValidity;
  verification?: StoredVerification;
};
⋮----
export type CredentialOfferResolved = {
  grantDetails: CredentialOffer.ExtractGrantDetailsResult;
  offer: CredentialOffer.CredentialOffer;
};
⋮----
export type EvaluatedDcqlQueryResult = Awaited<
  ReturnType<RemotePresentation.RemotePresentationApi["evaluateDcqlQuery"]>
>;
⋮----
export type IssuerConfiguration = CredentialIssuance.IssuerConfig;
⋮----
export type ItwAuthLevel = "L2" | "L3";
⋮----
export type ItwCredentialStatus =
  | "expired"
  | "expiring"
  | "invalid"
  | "suspended"
  | "unknown"
  | "valid"
  | ItwJwtCredentialStatus;
⋮----
export type ItwEidStatus = "invalid" | ItwJwtCredentialStatus;
⋮----
export type ItwJwtCredentialStatus = "jwtExpired" | "jwtExpiring" | "valid";
⋮----
export type MdocSupportedCredentialConfiguration = Extract<
  IssuerConfiguration["credential_configurations_supported"][string],
  { format: "mso_mdoc" }
>;
⋮----
export type ParsedCredential = CredentialIssuance.ParsedCredential;
⋮----
export type ParsedStatusAssertion = CredentialStatus.ParsedStatusAssertion;
⋮----
export type RequestObject = RemotePresentation.RequestObject;
⋮----
export type StoredVerification = Pick<
  Verification,
  "assurance_level" | "trust_framework"
>;
⋮----
export type WalletInstanceAttestations = {
  [CredentialFormat.MDOC]?: string;
  [CredentialFormat.SD_JWT]?: string;
  jwt: string;
};
⋮----
export type WalletInstanceRevocationReason =
  WalletInstanceStatus["revocation_reason"];
⋮----
export type WalletInstanceStatus = WalletInstance.WalletInstanceStatus;
⋮----
type Verification = NonNullable<ReturnType<typeof SdJwt.getVerification>>;
... (24 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/linking.ts">
import { getStateFromPath } from "@react-navigation/native";
⋮----
import {
  IO_INTERNAL_LINK_PREFIX,
  IO_UNIVERSAL_LINK_PREFIX
} from "../../../../utils/navigation";
import { extractPathFromURL } from "../../../../utils/url";
import { itwLinkingConfig } from "../../navigation/linking";
import { parseCredentialOfferLink } from "../../offer/utils";
⋮----
export type ItwDeepLink = { path: string };
⋮----
export const parseItwDeepLink = (url: string): ItwDeepLink | undefined =>
⋮----
const extractItwPath = (url: string): string | undefined =>
⋮----
const isSupportedItwPath = (path: string): boolean =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/markdown.tsx">
import { IOToast } from "@io-app/design-system";
import { TxtLinkNode, TxtParagraphNode } from "@textlint/ast-node-types";
import I18n from "i18next";
⋮----
import {
  linkNodeToReactNative,
  paragraphNodeToReactNative,
  ParagraphSize
} from "../../../../components/IOMarkdown/renderRules";
import { Renderer } from "../../../../components/IOMarkdown/types";
import { openWebUrl } from "../../../../utils/url";
⋮----
type Options = {
  linkCallback: () => void;
  paragraphSize?: ParagraphSize;
};
⋮----
export const generateItwIOMarkdownRules = ({
  paragraphSize,
  linkCallback
}: Options) => (
⋮----
Link(link: TxtLinkNode, render: Renderer)
Paragraph(
    paragraph: TxtParagraphNode,
    render: Renderer,
    screenReaderEnabled: boolean
)
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/mrtd.ts">
import {
  createCryptoContextFor,
  CredentialIssuance,
  ItwVersion
} from "@pagopa/io-react-native-wallet";
⋮----
import { WIA_KEYTAG } from "./itwCryptoContextUtils";
import { getIoWallet } from "./itwIoWallet";
import { IssuerConfiguration } from "./itwTypesUtils";
⋮----
export type InitMrtdPoPChallengeParams = {
  authRedirectUrl: string;
  issuerConf: IssuerConfiguration;
  itwVersion: ItwVersion;
  walletInstanceAttestation: string;
};
⋮----
export type ValidateMrtdPoPChallengeParams = {
  ias: CredentialIssuance.MRTDPoP.IasPayload;
  issuerConf: IssuerConfiguration;
  itwVersion: ItwVersion;
  mrtd: CredentialIssuance.MRTDPoP.MrtdPayload;
  mrtd_auth_session: string;
  mrtd_pop_nonce: string;
  validationUrl: string;
  walletInstanceAttestation: string;
};
⋮----
export const initMrtdPoPChallenge = async ({
  itwVersion,
  authRedirectUrl,
  issuerConf,
  walletInstanceAttestation
}: InitMrtdPoPChallengeParams) =>
⋮----
export const validateMrtdPoPChallenge = async ({
  itwVersion,
  validationUrl,
  mrtd_auth_session,
  mrtd_pop_nonce,
  issuerConf,
  walletInstanceAttestation,
  ias,
  mrtd
}: ValidateMrtdPoPChallengeParams) =>
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/mrtdUrl.ts">
const getRedirectQuery = (url: string): URLSearchParams =>
⋮----
/**
 * Checks if the PID Provider requires the MRTD PoP step by looking for
 * `challenge_info` in the post-auth redirect URL. This is a pure URL-parsing
 * utility with no native dependencies, safe to import from the XState machine
 * definition.
 */
export const isMrtdPoPChallengeRequired = (authRedirectUrl: string): boolean
</file>

<file path="apps/main-app/ts/features/itwallet/common/utils/theme.ts">
import { useIOThemeContext } from "@io-app/design-system";
⋮----
type ItWalletTheme = {
  [K in (typeof themeKeys)[number]]: string;
};
⋮----
export const useItWalletTheme = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/analytics/enum.ts">
export enum ITW_CREDENTIALS_ERRORS_EVENTS {
  ITW_VAULT_COHERENCE_CHECK_FAILED = "ITW_VAULT_COHERENCE_CHECK_FAILED",
  ITW_VAULT_CREDENTIAL_REMOVE_FAILED = "ITW_VAULT_CREDENTIAL_REMOVE_FAILED",
  ITW_VAULT_CREDENTIAL_STORE_FAILED = "ITW_VAULT_CREDENTIAL_STORE_FAILED",
  ITW_VAULT_MIGRATION_FAILED = "ITW_VAULT_MIGRATION_FAILED",
  ITW_VAULT_ORPHANED_CREDENTIALS_FOUND = "ITW_VAULT_ORPHANED_CREDENTIALS_FOUND"
}
⋮----
export enum ITW_CREDENTIALS_TECH_EVENTS {
  ITW_VAULT_MIGRATION_REQUEST = "ITW_VAULT_MIGRATION_REQUEST",
  ITW_VAULT_MIGRATION_SUCCESS = "ITW_VAULT_MIGRATION_SUCCESS"
}
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/analytics/index.ts">
import {
  enqueueMixpanelEvent,
  isMixpanelInstanceInitialized,
  mixpanelTrack
} from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import {
  ITW_CREDENTIALS_ERRORS_EVENTS,
  ITW_CREDENTIALS_TECH_EVENTS
} from "./enum";
⋮----
type TrackVaultFailureProps = {
  credential_ids: ReadonlyArray<string>;
  reason: string;
};
⋮----
type TrackVaultOrphanedCredentialsProps = {
  credential_ids: ReadonlyArray<string>;
  origin: "redux" | "vault";
};
⋮----
const buildEnqueuedEventId = (
  eventName: string,
  ...parts: ReadonlyArray<string>
)
⋮----
const trackBootTimeVaultEvent = (
  eventName: string,
  properties: Record<string, unknown>,
  isMixpanelEnabled: boolean | null,
  eventId?: string
) =>
⋮----
export const trackItwVaultCredentialStoreFailed = ({
  credential_ids,
  reason
}: TrackVaultFailureProps) =>
⋮----
export const trackItwVaultCredentialRemoveFailed = ({
  credential_ids,
  reason
}: TrackVaultFailureProps) =>
⋮----
export const trackItwVaultMigrationFailed = (
  { credential_ids, reason }: TrackVaultFailureProps,
  isMixpanelEnabled: boolean | null
) =>
⋮----
export const trackItwVaultCoherenceCheckFailed = (
  reason: string,
  isMixpanelEnabled: boolean | null
) =>
⋮----
export const trackItwVaultOrphanedCredentialsFound = (
  { credential_ids, origin }: TrackVaultOrphanedCredentialsProps,
  isMixpanelEnabled: boolean | null
) =>
⋮----
export const trackItwVaultMigrationRequest = (
  isMixpanelEnabled: boolean | null
) =>
⋮----
export const trackItwVaultMigrationSuccess = (
  isMixpanelEnabled: boolean | null
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/hooks/useCredentialStatusMessage.ts">
import { useMemo } from "react";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { useIoWallet } from "../../common/hooks/useIoWallet";
import {
  CredentialStatusMessage,
  getCredentialStatusMessageFromCatalog,
  getCredentialStatusMessageFromIssuerConf
} from "../../common/utils/itwCredentialStatusUtils";
import {
  itwCatalogueTranslationsByLocaleSelector,
  itwCredentialsCatalogueByTypesSelector
} from "../../credentialsCatalogue/store/selectors";
import { itwCredentialSelector } from "../store/selectors";
⋮----
export const useCredentialStatusMessage = (
  credentialType: string
): CredentialStatusMessage | undefined =>
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/checkCredentialsBatchRefill.ts">
import { put, select } from "typed-redux-saga/macro";
⋮----
import { itwLifecycleIsValidSelector } from "../../lifecycle/store/selectors";
import { itwCredentialsBatchRefillRequest } from "../store/actions";
import { itwCredentialsToRefillSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/checkCredentialsStatusAssertion.ts">
import { Errors } from "@pagopa/io-react-native-wallet";
import { all, call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { ReduxSagaEffect } from "../../../../types/utils";
import { trackItwStatusCredentialAssertionFailure } from "../../analytics";
import { syncItwAnalyticsProperties } from "../../analytics/saga";
import { getMixPanelCredential } from "../../analytics/utils";
import {
  itwUnverifiedCredentialsCounterReset,
  itwUnverifiedCredentialsCounterUp
} from "../../common/store/actions/securePreferences";
import {
  selectItwEnv,
  selectItwSpecsVersion
} from "../../common/store/selectors/environment";
import { itwUnverifiedCredentialsCounterLimitReached } from "../../common/store/selectors/securePreferences";
import { getEnv } from "../../common/utils/environment";
import {
  getCredentialStatusAssertion,
  shouldRequestStatusAssertion
} from "../../common/utils/itwCredentialStatusAssertionUtils";
import { getRepresentativeVaultId } from "../../common/utils/itwCredentialUtils";
import { statusAssertionFailure } from "../../common/utils/itwFailureUtils";
import { getIoWallet } from "../../common/utils/itwIoWallet";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../lifecycle/store/selectors";
import {
  itwCredentialsRefreshStatusByType,
  itwCredentialsStore
} from "../store/actions";
import {
  itwCredentialSelector,
  itwCredentialsSelector
} from "../store/selectors";
import { CredentialsVault } from "../utils/vault";
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/handleItwCredentialsBatchRefillSaga.ts">
import { deleteKey } from "@pagopa/io-react-native-crypto";
import { all, call, put, select } from "typed-redux-saga/macro";
⋮----
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { isConnectedSelector } from "../../../connectivity/store/selectors";
import {
  selectItwEnv,
  selectItwSpecsVersion
} from "../../common/store/selectors/environment";
import { getEnv } from "../../common/utils/environment";
import {
  getWalletInstanceAttestation,
  isWalletInstanceAttestationValid
} from "../../common/utils/itwAttestationUtils";
import {
  attachCredentialsStatus,
  completeAuthFlow,
  generateBatchKeysWithKeyAttestation,
  getBatchRefillThreshold,
  getEffectiveBatchSize,
  obtainCredentialsBatch,
  requestCredential,
  shouldRefillBatch
} from "../../common/utils/itwCredentialIssuanceUtils";
import {
  getCredentialKeyTags,
  getCredentialVaultIds
} from "../../common/utils/itwCredentialUtils";
import { getIoWallet } from "../../common/utils/itwIoWallet";
import {
  CredentialBundle,
  CredentialMetadata,
  IssuerConfiguration
} from "../../common/utils/itwTypesUtils";
import {
  itwIntegrityKeyTagSelector,
  itwIntegrityServiceStatusSelector
} from "../../issuance/store/selectors";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../lifecycle/store/selectors";
import {
  itwKeyAttestationsStore,
  itwWalletInstanceAttestationStore
} from "../../walletInstance/store/actions";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/selectors";
import {
  itwCredentialsBatchRefillRequest,
  itwCredentialsRemove,
  itwCredentialsStoreBundle
} from "../store/actions";
import {
  itwCredentialsEidSelector,
  itwCredentialsListByTypeSelector
} from "../store/selectors";
import { CredentialsVault } from "../utils/vault";
import { handleItwCredentialsStoreBundleSaga } from "./handleItwCredentialsStoreBundleSaga";
⋮----
type AuthorizedCredentials = Awaited<
  ReturnType<typeof generateBatchKeysWithKeyAttestation>
>;
⋮----
const extractKeyAttestations = (
  authorizedCredentials: ReadonlyArray<{
    keyAttestation?: string;
    keyAttestationId?: string;
  }>
): Record<string, string>
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/handleItwCredentialsConsumeInstanceSaga.ts">
import { deleteKey } from "@pagopa/io-react-native-crypto";
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { walletRemoveCards } from "../../../wallet/store/actions/cards";
import { shouldRefillBatch } from "../../common/utils/itwCredentialIssuanceUtils";
import { getCredentialKeyTags } from "../../common/utils/itwCredentialUtils";
import { trackItwVaultCredentialRemoveFailed } from "../analytics";
import {
  itwCredentialsBatchRefillRequest,
  itwCredentialsConsumeInstance,
  itwCredentialsRemove,
  itwCredentialsStore
} from "../store/actions";
import { itwAllStoredCredentialsSelector } from "../store/selectors";
import { CredentialsVault } from "../utils/vault";
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/handleItwCredentialsRemoveByTypeSaga.ts">
import { deleteKey } from "@pagopa/io-react-native-crypto";
import { all, call, put, select } from "typed-redux-saga/macro";
⋮----
import { walletRemoveCards } from "../../../wallet/store/actions/cards";
import {
  getCredentialKeyTags,
  getCredentialVaultIds
} from "../../common/utils/itwCredentialUtils";
import { trackItwVaultCredentialRemoveFailed } from "../analytics";
import {
  itwCredentialsRemove,
  itwCredentialsRemoveByType
} from "../store/actions";
import { itwCredentialsListByTypeSelector } from "../store/selectors";
import { CredentialsVault } from "../utils/vault";
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/handleItwCredentialsReplaceByTypeSaga.ts">
import { call } from "typed-redux-saga/macro";
⋮----
import {
  itwCredentialsRemoveByType,
  itwCredentialsReplaceByType,
  itwCredentialsStoreBundle
} from "../store/actions";
import { handleItwCredentialsRemoveByTypeSaga } from "./handleItwCredentialsRemoveByTypeSaga";
import { handleItwCredentialsStoreBundleSaga } from "./handleItwCredentialsStoreBundleSaga";
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/handleItwCredentialsStoreBundleSaga.ts">
import { type CredentialStatus } from "@pagopa/io-react-native-wallet";
import { call, put } from "typed-redux-saga/macro";
⋮----
import {
  CredentialBundle,
  CredentialMetadata
} from "../../common/utils/itwTypesUtils";
import { StatusListRepository } from "../../statusList/utils/repository";
import { trackItwVaultCredentialStoreFailed } from "../analytics";
import {
  itwCredentialsStore,
  itwCredentialsStoreBundle
} from "../store/actions";
import { CredentialsVault } from "../utils/vault";
⋮----
type VaultWrite = { credential: string; vaultId: string };
⋮----
const collapseBundles = (bundles: ReadonlyArray<CredentialBundle>) =>
⋮----
const hasStatusList = (
  bundle: CredentialBundle
): bundle is Required<CredentialBundle>
⋮----
const collectStatusLists = (
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/handleItwCredentialsStoreSaga.ts">
import { put } from "typed-redux-saga/macro";
⋮----
import { walletAddCards } from "../../../wallet/store/actions/cards";
import { CredentialType } from "../../common/utils/itwMocksUtils";
import { mapCredentialToWalletCard } from "../../wallet/utils";
import { itwCredentialsStore } from "../store/actions";
import { pickCredentialsToDisplay } from "../utils/format";
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/handleItwCredentialsVaultCoherenceSaga.ts">
import { deleteKey } from "@pagopa/io-react-native-crypto";
import { all, call, put, select } from "typed-redux-saga/macro";
⋮----
import { isMixpanelEnabled as isMixpanelEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { GlobalState } from "../../../../store/reducers/types";
import {
  getCredentialKeyTags,
  getCredentialVaultIds,
  getRepresentativeVaultId
} from "../../common/utils/itwCredentialUtils";
import {
  trackItwVaultCoherenceCheckFailed,
  trackItwVaultOrphanedCredentialsFound
} from "../analytics";
import { itwCredentialsRemove } from "../store/actions";
import { itwAllStoredCredentialsSelector } from "../store/selectors";
import { CredentialsVault } from "../utils/vault";
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/handleItwCredentialsVaultMigrationSaga.ts">
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { isMixpanelEnabled as isMixpanelEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { GlobalState } from "../../../../store/reducers/types";
import {
  trackItwVaultMigrationFailed,
  trackItwVaultMigrationRequest,
  trackItwVaultMigrationSuccess
} from "../analytics";
import { itwCredentialsVaultMigrationComplete } from "../store/actions";
import { CredentialsVault } from "../utils/vault";
⋮----
type VaultMigrationResult =
  | {
      credentialId: string;
      reason: string;
      success: false;
    }
  | {
      credentialId: string;
      success: true;
    };
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/handleKeyAttestationsCleanUp.ts">
import { put, select } from "typed-redux-saga/macro";
⋮----
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { itwKeyAttestationsRemoveById } from "../../walletInstance/store/actions";
import { itwKeyAttestationsSelector } from "../../walletInstance/store/selectors";
import { itwCredentialsByTypeSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/handleWalletCredentialsRehydration.ts">
import { put, select } from "typed-redux-saga/macro";
⋮----
import { walletAddCards } from "../../../wallet/store/actions/cards";
import { itwLifecycleIsValidSelector } from "../../lifecycle/store/selectors";
import { mapCredentialToWalletCard } from "../../wallet/utils";
import {
  itwCredentialsEidSelector,
  itwCredentialsSelector
} from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLeading } from "typed-redux-saga/macro";
⋮----
import {
  itwCredentialsBatchRefillRequest,
  itwCredentialsConsumeInstance,
  itwCredentialsRefreshStatusByType,
  itwCredentialsRemoveByType,
  itwCredentialsReplaceByType,
  itwCredentialsStore,
  itwCredentialsStoreBundle
} from "../store/actions";
import { handleCredentialStatusAssertionRetry } from "./checkCredentialsStatusAssertion";
import { handleItwCredentialsBatchRefillSaga } from "./handleItwCredentialsBatchRefillSaga";
import { handleItwCredentialsConsumeInstanceSaga } from "./handleItwCredentialsConsumeInstanceSaga";
import { handleItwCredentialsRemoveByTypeSaga } from "./handleItwCredentialsRemoveByTypeSaga";
import { handleItwCredentialsReplaceByTypeSaga } from "./handleItwCredentialsReplaceByTypeSaga";
import { handleItwCredentialsStoreBundleSaga } from "./handleItwCredentialsStoreBundleSaga";
import { handleItwCredentialsStoreSaga } from "./handleItwCredentialsStoreSaga";
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import {
  CredentialBundle,
  CredentialMetadata
} from "../../../common/utils/itwTypesUtils";
⋮----
type CallbackActionMeta = {
  onComplete?: () => void;
  onError?: (error: Error) => void;
};
⋮----
export type ItwCredentialsActions =
  | ActionType<typeof itwCredentialsBatchRefillRequest>
  | ActionType<typeof itwCredentialsConsumeInstance>
  | ActionType<typeof itwCredentialsRefreshStatusByType>
  | ActionType<typeof itwCredentialsRemove>
  | ActionType<typeof itwCredentialsRemoveByType>
  | ActionType<typeof itwCredentialsReplaceByType>
  | ActionType<typeof itwCredentialsStore>
  | ActionType<typeof itwCredentialsStoreBundle>
  | ActionType<typeof itwCredentialsVaultMigrationComplete>;
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/store/reducers/index.ts">
import { createMigrate, PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import createSecureStorage from "../../../../../store/storages/secureStorage";
import { isDevEnv } from "../../../../../utils/environment";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils";
import { itwLifecycleStoresReset } from "../../../lifecycle/store/actions";
import {
  itwCredentialsRemove,
  itwCredentialsStore,
  itwCredentialsVaultMigrationComplete
} from "../actions";
import {
  CURRENT_REDUX_ITW_CREDENTIALS_STORE_VERSION,
  itwCredentialsStateMigrations
} from "./migrations";
⋮----
export type ItwCredentialsState = {
  credentials: CredentialsRecord;
  legacyCredentials: {
    [credentialKey: string]: CredentialMetadata & { credential: string };
  };
};
⋮----
type CredentialsRecord = {
  [credentialId: string]: CredentialMetadata;
};
⋮----
const reducer = (
  state: ItwCredentialsState = itwCredentialsInitialState,
  action: Action
): ItwCredentialsState =>
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/store/reducers/migrations.ts">
import { SdJwt } from "@pagopa/io-react-native-wallet";
import { pipe } from "fp-ts/lib/function";
⋮----
import { MigrationManifest, PersistedState } from "redux-persist";
⋮----
import { extractVerification } from "../../../common/utils/itwCredentialUtils";
import { IssuerConfiguration } from "../../../common/utils/itwTypesUtils";
⋮----
type AnyRecord = Record<string, any>;
⋮----
type MigrationState = PersistedState & Record<string, any>;
⋮----
const addStoredStatusAttestation = (credential: AnyRecord) => (
⋮----
const addIatExpProperties = (credential: AnyRecord) =>
⋮----
const mapCredential = (credential: O.Option<AnyRecord>)
⋮----
const mapStatusAttestationToAssertion = (statusAttObj?: AnyRecord)
⋮----
const addSpecVersionAndVerification = (cred: AnyRecord) => (
⋮----
const mapClaims = (claims: AnyRecord)
⋮----
const mapIssuerConfig = (config: AnyRecord): IssuerConfiguration =>
⋮----
// Version 9
// Split `credentials` into two fields:
// - `legacyCredentials`: full copy of the pre-migration credentials (including
//   the `credential` JWT), used as a staging area for the async vault write
//   performed by handleItwCredentialsVaultMigrationSaga at boot time.
// - `credentials`: same entries but with `credential: undefined`, so Redux is
//   JWT-free immediately after upgrade.
⋮----
const replaceLegacyPidCredentialType = (credentials: AnyRecord)
⋮----
const migrateStatusAssertionToValidity = (credentials: AnyRecord)
⋮----
const addOrigin = (credentials: AnyRecord)
⋮----
const migrateSpecVersion = (credentials: AnyRecord)
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/store/selectors/index.ts">
import _, { partition } from "lodash";
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import {
  getFamilyNameFromCredential,
  getFirstNameFromCredential,
  getFiscalCodeFromCredential
} from "../../../common/utils/itwClaimsUtils";
import { shouldRefillBatch } from "../../../common/utils/itwCredentialIssuanceUtils";
import { getCredentialStatus } from "../../../common/utils/itwCredentialStatusUtils";
import { CredentialType } from "../../../common/utils/itwMocksUtils";
import {
  CredentialFormat,
  CredentialMetadata,
  ItwEidStatus,
  ItwJwtCredentialStatus
} from "../../../common/utils/itwTypesUtils";
import { DISPLAY_FORMAT_PRIORITY } from "../../utils/format";
⋮----
type CredentialsByType = {
  [K: string]: Record<CredentialFormat, CredentialMetadata>;
};
⋮----
const withDisplayFormatFallback = (
  credential: CredentialsByType[string] | undefined,
  format: CredentialFormat
) =>
⋮----
export const makeSelectAllCredentials = (format: CredentialFormat)
⋮----
export const itwCredentialSelector = (
  key: string,
  format = CredentialFormat.SD_JWT
)
⋮----
/**
 * Returns the name and surname from the stored eID.
 *
 * @param state - The global state.
 * @returns The name and surname.
 */
⋮----
/**
 * Returns the number of credentials in the credentials object, excluding the
 * eID credential.
 *
 * @param state - The global state.
 * @returns The number of credentials.
 */
⋮----
/**
 * Returns whether the wallet is empty, i.e. it does not have any credential.
 * The eID is not considered, only other (Q)EAAs.
 *
 * Note: this selector does not check the wallet validity.
 *
 * @param state - The global state.
 * @returns Whether the wallet is empty.
 */
⋮----
/**
 * Returns whether the wallet has at least 2 credentials. The eID is not
 * considered, only other (Q)EAAs.
 *
 * Note: this selector does not check the wallet validity.
 *
 * @param state - The global state.
 * @returns Whether the wallet has at least 2 credentials.
 */
⋮----
/**
 * Returns whether the wallet has at least one credential and all of them are
 * expired. The eID is not considered, only other (Q)EAAs.
 *
 * @param state - The global state.
 * @returns Whether all the credentials are expired.
 */
⋮----
export const itwCredentialsListByTypeSelector = (key: string)
⋮----
export const makeItwCredentialsByPresenceSelector = <
  T extends { type: string }
>(
  credentials: ReadonlyArray<T>
)
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/utils/format.ts">
import {
  CredentialFormat,
  CredentialMetadata
} from "../../common/utils/itwTypesUtils";
⋮----
const getFormatRank = (format: string) =>
⋮----
export const pickCredentialsToDisplay = (
  credentials: ReadonlyArray<CredentialMetadata>
): Array<CredentialMetadata> => [
  ...credentials
.reduce<Map<string, CredentialMetadata>>((acc, credential) =>
</file>

<file path="apps/main-app/ts/features/itwallet/credentials/utils/vault.ts">
const getStorageKeyFromVaultId = (vaultId: string): string
⋮----
const getVaultIdFromStorageKey = (key: string): string =>
⋮----
const isValueNotFoundError = (e: unknown): e is Error
⋮----
const list = async (): Promise<ReadonlyArray<string>> =>
⋮----
const store = async (vaultId: string, credential: string): Promise<void> =>
⋮----
const storeAll = async (
  credentials: ReadonlyArray<{ credential: string; vaultId: string }>
) =>
⋮----
const get = async (vaultId: string): Promise<string | undefined> =>
⋮----
const remove = async (vaultId: string): Promise<void> =>
⋮----
const removeAll = async (vaultIds: ReadonlyArray<string>) =>
⋮----
const clear = async () =>
</file>

<file path="apps/main-app/ts/features/itwallet/credentialsCatalogue/saga/fetchCatalogueTranslations.ts">
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { Locales } from "../../../../i18n";
import { persistedPreferencesSelector } from "../../../../store/reducers/persistedPreferences";
import { getNetworkError } from "../../../../utils/errors";
import { selectItwSpecsVersion } from "../../common/store/selectors/environment";
import { fetchCatalogueTranslations } from "../../common/utils/itwCredentialsCatalogueUtils";
import { itwFetchCatalogueTranslations } from "../store/actions";
import { itwCredentialsCatalogueSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/itwallet/credentialsCatalogue/saga/fetchCredentialsCatalogue.ts">
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { getNetworkError } from "../../../../utils/errors";
import {
  selectItwEnv,
  selectItwSpecsVersion
} from "../../common/store/selectors/environment";
import { getEnv } from "../../common/utils/environment";
import { fetchCredentialsCatalogue } from "../../common/utils/itwCredentialsCatalogueUtils";
import {
  itwFetchCatalogueTranslations,
  itwFetchCredentialsCatalogue
} from "../store/actions";
</file>

<file path="apps/main-app/ts/features/itwallet/credentialsCatalogue/saga/index.ts">
import { put, takeLatest } from "typed-redux-saga/macro";
⋮----
import { itwSetFiscalCodeWhitelisted } from "../../common/store/actions/preferences";
import { itwFetchCredentialsCatalogue } from "../store/actions";
import { fetchCatalogueTranslationsSaga } from "./fetchCatalogueTranslations";
import { fetchCredentialsCatalogueSaga } from "./fetchCredentialsCatalogue";
</file>

<file path="apps/main-app/ts/features/itwallet/credentialsCatalogue/store/actions/index.ts">
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
import {
  CatalogueTranslations,
  DigitalCredentialsCatalogue
} from "../../../common/utils/itwCredentialsCatalogueUtils";
⋮----
export type ItwCredentialsCatalogueActions =
  | ActionType<typeof itwFetchCatalogueTranslations>
  | ActionType<typeof itwFetchCredentialsCatalogue>;
</file>

<file path="apps/main-app/ts/features/itwallet/credentialsCatalogue/store/reducers/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import {
  CatalogueTranslations,
  DigitalCredentialsCatalogue
} from "../../../common/utils/itwCredentialsCatalogueUtils";
import {
  itwFetchCatalogueTranslations,
  itwFetchCredentialsCatalogue
} from "../actions";
⋮----
export type ItwCredentialsCatalogueState = {
  catalogue: pot.Pot<DigitalCredentialsCatalogue, NetworkError>;
  translations: pot.Pot<CatalogueTranslations, NetworkError>;
};
⋮----
const reducer = (
  state = itwCredentialsCatalogueState,
  action: Action
): ItwCredentialsCatalogueState =>
</file>

<file path="apps/main-app/ts/features/itwallet/credentialsCatalogue/store/selectors/index.ts">
import { isAfter } from "date-fns";
import { createSelector } from "reselect";
⋮----
import { Locales } from "../../../../../i18n";
import { persistedPreferencesSelector } from "../../../../../store/reducers/persistedPreferences";
import { GlobalState } from "../../../../../store/reducers/types";
import { itwIsDiscoverMoreCEDLocallyEnabledSelector } from "../../../common/store/selectors/preferences";
import {
  itwHiddenCredentialsSelector,
  itwIsDiscoverMoreCEDRemotelyEnabledSelector,
  itwNewCredentialsSelector,
  itwPinnedCredentialsSelector
} from "../../../common/store/selectors/remoteConfig";
import { pidScopes } from "../../../common/utils/constants";
import {
  DigitalCredentialMetadata,
  DigitalCredentialsCatalogue
} from "../../../common/utils/itwCredentialsCatalogueUtils";
import {
  getCredentialNameFromType,
  l2Credentials,
  newCredentials,
  upcomingCredentials
} from "../../../common/utils/itwCredentialUtils";
import { CredentialType } from "../../../common/utils/itwMocksUtils";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
⋮----
export type CredentialsListEntry = {
  name: string;
  type: string;
};
⋮----
export const itwIsCredentialsCatalogueStale = (state: GlobalState) =>
⋮----
export const itwIsCredentialsCatalogueLoading = (state: GlobalState)
⋮----
export const itwIsCredentialsCataloguePending = (state: GlobalState) =>
⋮----
export const itwIsCredentialsCatalogueUnavailable = (state: GlobalState)
⋮----
export const itwDiscoverMoreCEDSelector = (state: GlobalState)
⋮----
export const itwCatalogueTranslationsSelector = (state: GlobalState) =>
⋮----
const getCatalogueCredentialName = (
  metadata: DigitalCredentialMetadata | undefined,
  translations: Record<string, string>
): string | undefined =>
⋮----
const selectCredentials = () =>
⋮----
export const itwCredentialIntroContentSelector =
(credentialType: string | undefined)
⋮----
export const itwAuthenticSourceContactsSelector =
(credentialType: string) => (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/analytics/enum.ts">
export enum ITW_DISCOVERY_ACTIONS_EVENTS {
  ITW_DISCOVERY_PLUS = "ITW_DISCOVERY_PLUS",
  ITW_ID_START = "ITW_ID_START",
  ITW_INTRO_BACK = "ITW_INTRO_BACK",
  ITW_TOS_ACCEPTED = "ITW_TOS_ACCEPTED"
}
⋮----
export enum ITW_DISCOVERY_ERRORS_EVENTS {
  ITW_ALREADY_ACTIVATED = "ITW_ALREADY_ACTIVATED",
  ITW_NFC_NOT_SUPPORTED = "ITW_NFC_NOT_SUPPORTED"
}
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { ItwCredentialDetails, ItwFlow } from "../../analytics/utils/types";
import {
  ITW_DISCOVERY_ACTIONS_EVENTS,
  ITW_DISCOVERY_ERRORS_EVENTS
} from "./enum";
⋮----
export const trackItWalletActivationStart = (
  itw_flow: ItwFlow,
  credential_details: ItwCredentialDetails
) =>
⋮----
export const trackItwIntroBack = (itw_flow: ItwFlow) =>
⋮----
export const trackOpenItwTosAccepted = (itw_flow: ItwFlow) =>
⋮----
export const trackItwDiscoveryPlus = () =>
⋮----
export const trackItwAlreadyActivated = (itw_flow: ItwFlow) =>
⋮----
export const trackItwNfcNotSupported = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/components/ItwDiscoveryBanner.tsx">
import { Banner, IOSkeleton } from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { ComponentProps, useCallback, useMemo } from "react";
⋮----
import { useOfflineToastGuard } from "../../../../hooks/useOfflineToastGuard";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  trackItwDiscoveryBanner,
  trackItwDiscoveryBannerClosure,
  trackItwDiscoveryBannerTap
} from "../../analytics";
import { ITW_SCREENVIEW_EVENTS } from "../../analytics/enum";
import { ItwEngagementBanner } from "../../common/components/ItwEngagementBanner";
import { itwCloseBanner } from "../../common/store/actions/banners";
import {
  itwIsMdlPresentSelector,
  itwIsWalletEmptySelector
} from "../../credentials/store/selectors";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
import { itwIsRemotelyActiveSelector } from "../../walletInstance/store/selectors";
⋮----
type Props = {
  flow?: "messages_inbox" | "wallet";
  onDismiss?: () => void;
  style?: ComponentProps<typeof ItwEngagementBanner>["style"];
};
⋮----
export const ItwDiscoveryBanner = ({
  flow = "wallet",
  onDismiss,
  style
}: Props) =>
⋮----
const navigateToDiscoveryScreen = () =>
⋮----
const handleOnDismiss = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/components/ItwDiscoveryInfoComponent.tsx">
import {
  BodySmall,
  ContentWrapper,
  Divider,
  FooterActions,
  ForceScrollDownView,
  H2,
  H4,
  HStack,
  Icon,
  IOColors,
  IOIcons,
  IOMarkdownLite,
  IOToast,
  useIOTheme,
  useIOThemeContext,
  VSpacer,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import Feature1Image from "../../../../../img/features/itWallet/discovery/feature_1.svg";
import Feature2Image from "../../../../../img/features/itWallet/discovery/feature_2.svg";
import Feature3Image from "../../../../../img/features/itWallet/discovery/feature_3.svg";
import Feature4Image from "../../../../../img/features/itWallet/discovery/feature_4.svg";
import Feature5Image from "../../../../../img/features/itWallet/discovery/feature_5.svg";
import { AnimatedImage } from "../../../../components/AnimatedImage.tsx";
import IOMarkdown from "../../../../components/IOMarkdown/index.tsx";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel.tsx";
import { useIOSelector } from "../../../../store/hooks.ts";
import { ITW_PRIVACY_URL, ITW_TOS_URL } from "../../../../urls.ts";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet.tsx";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender.ts";
import { openWebUrl } from "../../../../utils/url";
import { trackOpenItwTos } from "../../analytics";
import { itwMixPanelCredentialDetailsSelector } from "../../analytics/store/selectors";
import { itwIsActivationDisabledSelector } from "../../common/store/selectors/remoteConfig.ts";
import { itwLifecycleIsValidSelector } from "../../lifecycle/store/selectors/index.ts";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider.tsx";
import { selectIsLoading } from "../../machine/eid/selectors.ts";
import {
  trackItWalletActivationStart,
  trackItwDiscoveryPlus,
  trackItwIntroBack
} from "../analytics";
⋮----
type Props = {
  credentialOfferUri?: string;
  credentialType?: string;
};
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/components/ItwDiscoveryInfoFallbackComponent.tsx">
import {
  BodySmall,
  ContentWrapper,
  FeatureInfo,
  H3,
  VSpacer,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { StyleSheet } from "react-native";
⋮----
import { AnimatedImage } from "../../../../components/AnimatedImage.tsx";
import IOMarkdown from "../../../../components/IOMarkdown/index.tsx";
import { IOScrollView } from "../../../../components/ui/IOScrollView.tsx";
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton.ts";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel.tsx";
import { useIOSelector } from "../../../../store/hooks.ts";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender.ts";
import { tosConfigSelector } from "../../../tos/store/selectors/index.ts";
import { trackOpenItwTos } from "../../analytics";
import { ITW_SCREENVIEW_EVENTS } from "../../analytics/enum.ts";
import { itwMixPanelCredentialDetailsSelector } from "../../analytics/store/selectors";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation.ts";
import { useItwDismissalDialog } from "../../common/hooks/useItwDismissalDialog.tsx";
import { itwIsActivationDisabledSelector } from "../../common/store/selectors/remoteConfig.ts";
import { generateItwIOMarkdownRules } from "../../common/utils/markdown.tsx";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider.tsx";
import {
  selectCanGoBackToL3Identification,
  selectIsLoading
} from "../../machine/eid/selectors.ts";
import { trackItWalletActivationStart, trackItwIntroBack } from "../analytics";
⋮----
body=
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/components/ItwDiscoveryInfoLegacyComponent.tsx">
import { ContentWrapper, H1, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { StyleSheet } from "react-native";
⋮----
import { AnimatedImage } from "../../../../components/AnimatedImage.tsx";
import IOMarkdown from "../../../../components/IOMarkdown/index.tsx";
import { IOScrollView } from "../../../../components/ui/IOScrollView.tsx";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel.tsx";
import { useIOSelector } from "../../../../store/hooks.ts";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender.ts";
import { tosConfigSelector } from "../../../tos/store/selectors/index.ts";
import { trackOpenItwTos } from "../../analytics";
import { ITW_SCREENVIEW_EVENTS } from "../../analytics/enum.ts";
import { itwMixPanelCredentialDetailsSelector } from "../../analytics/store/selectors";
import { useItwDismissalDialog } from "../../common/hooks/useItwDismissalDialog.tsx";
import { itwIsActivationDisabledSelector } from "../../common/store/selectors/remoteConfig.ts";
import { generateItwIOMarkdownRules } from "../../common/utils/markdown.tsx";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider.tsx";
import { selectIsLoading } from "../../machine/eid/selectors.ts";
import { trackItWalletActivationStart, trackItwIntroBack } from "../analytics";
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/components/ItwL2FallbackComponent.tsx">
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { itwDisableItwActivation } from "../../common/store/actions/preferences";
import {
  trackItwFallbackL2Flow,
  trackItwFallbackL2FlowExit,
  trackItwFallbackL2FlowStart
} from "../../identification/analytics";
import { itwLifecycleIsValidSelector } from "../../lifecycle/store/selectors";
import { ItwCredentialIssuanceMachineContext } from "../../machine/credential/provider";
import { ITW_ROUTES } from "../../navigation/routes";
⋮----
type Props = {
  credentialType?: string;
};
export const ItwL2FallbackComponent = (
⋮----
const handleDocIOIssuing = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/components/ItwNfcNotSupportedComponent.tsx">
import { IOToast } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIODispatch } from "../../../../store/hooks";
import { openWebUrl } from "../../../../utils/url";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { itwDisableItwActivation } from "../../common/store/actions/preferences";
import { trackItwNfcNotSupported } from "../analytics";
⋮----
export const ItwNfcNotSupportedComponent = () =>
⋮----
const handleOpenFaq = ()
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/components/ItwPrivacyWebViewComponent.tsx">
import { useState } from "react";
import WebView from "react-native-webview";
import {
  WebViewMessageEvent,
  WebViewSource
} from "react-native-webview/lib/WebViewTypes";
⋮----
import {
  AVOID_ZOOM_JS,
  closeInjectedScript,
  GET_CONTENT_HEIGHT_SCRIPT
} from "../../../../utils/webview";
⋮----
type Props = {
  onError: () => void;
  onLoadEnd: () => void;
  source: WebViewSource;
};
⋮----
const handleWebViewMessage = (event: WebViewMessageEvent) =>
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/screens/ItwAlreadyActiveScreen.tsx">
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIOSelector } from "../../../../store/hooks";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { ItwFlow } from "../../analytics/utils/types";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { itwAuthLevelSelector } from "../../common/store/selectors/preferences";
import { trackItwAlreadyActivated } from "../analytics";
⋮----
export const ItwAlreadyActiveScreen = () =>
⋮----
const navigateToWallet = () =>
⋮----
const handleClose = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/screens/ItwDiscoveryInfoScreen.tsx">
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList.ts";
import { useIOSelector } from "../../../../store/hooks.ts";
import { itwIsActivationDisabledSelector } from "../../common/store/selectors/preferences.ts";
import { isL2Credential } from "../../common/utils/itwCredentialUtils.ts";
import { itwHasNfcFeatureSelector } from "../../identification/common/store/selectors/index.ts";
import { EidIssuanceLevel } from "../../machine/eid/context.ts";
import { ItwParamsList } from "../../navigation/ItwParamsList.ts";
import { ItwDiscoveryInfoComponent } from "../components/ItwDiscoveryInfoComponent.tsx";
import { ItwDiscoveryInfoFallbackComponent } from "../components/ItwDiscoveryInfoFallbackComponent.tsx";
import { ItwDiscoveryInfoLegacyComponent } from "../components/ItwDiscoveryInfoLegacyComponent.tsx";
import { ItwL2FallbackComponent } from "../components/ItwL2FallbackComponent.tsx";
import { ItwNfcNotSupportedComponent } from "../components/ItwNfcNotSupportedComponent.tsx";
⋮----
export type ItwDiscoveryInfoScreenNavigationParams = {
  animationEnabled?: boolean;
  credentialOfferUri?: string;
  credentialType?: string;
  level?: EidIssuanceLevel;
};
⋮----
export type ItwDiscoveryInfoScreenProps = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_DISCOVERY_INFO"
>;
⋮----
export const ItwDiscoveryInfoScreen = ({
  route
}: ItwDiscoveryInfoScreenProps) =>
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/screens/ItwDiscoveryLandingScreen.tsx">
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import {
  isStartupLoaded,
  StartupStatusEnum
} from "../../../../store/reducers/startup";
import { itwIsL3EnabledSelector } from "../../common/store/selectors";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../lifecycle/store/selectors";
import { useItwNavigation } from "../../navigation/ItwParamsList";
import { ITW_ROUTES } from "../../navigation/routes";
⋮----
export const ItwDiscoveryLandingScreen = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/discovery/screens/ItwIpzsPrivacyScreen.tsx">
import { ContentWrapper, IOMarkdownLite, VSpacer } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useState } from "react";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIOSelector } from "../../../../store/hooks";
import { trackItwPrivacyScreen } from "../../analytics";
import { ItwFlow } from "../../analytics/utils/types";
import {
  itwIpzsItwalletPrivacyUrlSelector,
  itwIpzsPrivacyUrlSelector
} from "../../common/store/selectors/remoteConfig";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider";
import {
  isL3FeaturesEnabledSelector,
  selectIsLoading
} from "../../machine/eid/selectors";
import { trackOpenItwTosAccepted } from "../analytics";
import ItwPrivacyWebViewComponent from "../components/ItwPrivacyWebViewComponent";
⋮----
const handleContinuePress = () =>
⋮----
const onLoadEnd = () =>
⋮----
const onError = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/analytics/enum.ts">
export enum ITW_IDENTIFICATION_ACTIONS_EVENTS {
  ITW_CIE_NFC_GO_TO_SETTINGS = "ITW_CIE_NFC_GO_TO_SETTINGS",
  ITW_CIE_PIN_FORGOTTEN = "ITW_CIE_PIN_FORGOTTEN",
  ITW_CIE_PUK_FORGOTTEN = "ITW_CIE_PUK_FORGOTTEN",
  ITW_FALLBACK_L2_FLOW_EXIT = "ITW_FALLBACK_L2_FLOW_EXIT",
  ITW_FALLBACK_L2_FLOW_START = "ITW_FALLBACK_L2_FLOW_START",
  ITW_ID_METHOD_BOTTOMSHEET_CLOSE = "ITW_ID_METHOD_BOTTOMSHEET_CLOSE",
  ITW_ID_METHOD_BOTTOMSHEET_CONTINUE = "ITW_ID_METHOD_BOTTOMSHEET_CONTINUE",
  ITW_SPID_IDP_SELECTED = "ITW_SPID_IDP_SELECTED",
  ITW_USER_WITHOUT_CIE = "ITW_USER_WITHOUT_CIE"
}
⋮----
export enum ITW_IDENTIFICATION_ERRORS_EVENTS {
  ITW_CIE_CAN_ERROR = "ITW_CIE_CAN_ERROR",
  ITW_CIE_CARD_READING_CLOSE = "ITW_CIE_CARD_READING_CLOSE",
  ITW_CIE_CARD_READING_ERROR = "ITW_CIE_CARD_READING_ERROR",
  ITW_CIE_CARD_READING_FAILURE = "ITW_CIE_CARD_READING_FAILURE",
  ITW_CIE_CARD_READING_UNEXPECTED_FAILURE = "ITW_CIE_CARD_READING_UNEXPECTED_FAILURE",
  ITW_CIE_CARD_VERIFY_FAILURE = "ITW_CIE_CARD_VERIFY_FAILURE",
  ITW_CIE_PIN_ERROR = "ITW_CIE_PIN_ERROR",
  ITW_CIE_PIN_LAST_ERROR = "ITW_CIE_PIN_LAST_ERROR",
  ITW_CIE_PIN_SECOND_ERROR = "ITW_CIE_PIN_SECOND_ERROR",
  ITW_USER_WITHOUT_L3_REQUIREMENTS = "ITW_USER_WITHOUT_L3_REQUIREMENTS"
}
⋮----
export enum ITW_IDENTIFICATION_SCREENVIEW_EVENTS {
  ITW_CARD_READING_SUCCESS = "ITW_CARD_READING_SUCCESS",
  ITW_CIE_CARD_READING = "ITW_CIE_CARD_READING",
  ITW_CIE_INFO_BOTTOMSHEET = "ITW_CIE_INFO_BOTTOMSHEET",
  ITW_CIE_NFC_ACTIVATION = "ITW_CIE_NFC_ACTIVATION",
  ITW_CIE_PIN_ENTER = "ITW_CIE_PIN_ENTER",
  ITW_CIE_PIN_TUTORIAL_CIE = "ITW_CIE_PIN_TUTORIAL_CIE",
  ITW_CIE_PIN_TUTORIAL_PIN = "ITW_CIE_PIN_TUTORIAL_PIN",
  ITW_FALLBACK_L2_FLOW = "ITW_FALLBACK_L2_FLOW",
  ITW_ID_CIE_CAN_TUTORIAL_CAN = "ITW_ID_CIE_CAN_TUTORIAL_CAN",
  ITW_ID_ENTER_CAN = "ITW_ID_ENTER_CAN",
  ITW_ID_METHOD = "ITW_ID_METHOD",
  ITW_ID_METHOD_BOTTOMSHEET = "ITW_ID_METHOD_BOTTOMSHEET",
  ITW_PIN_INFO_BOTTOMSHEET = "ITW_PIN_INFO_BOTTOMSHEET",
  ITW_SPID_IDP_SELECTION = "ITW_SPID_IDP_SELECTION",
  ITW_USER_WITHOUT_L3_BOTTOMSHEET = "ITW_USER_WITHOUT_L3_BOTTOMSHEET"
}
</file>

<file path="apps/main-app/ts/features/itwallet/identification/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import {
  ItwFlow,
  ItwIdMethod,
  ItwScreenFlowContext
} from "../../analytics/utils/types";
import {
  ITW_IDENTIFICATION_ACTIONS_EVENTS,
  ITW_IDENTIFICATION_ERRORS_EVENTS,
  ITW_IDENTIFICATION_SCREENVIEW_EVENTS
} from "./enum";
import {
  ItwFallbackL2Flow,
  ItwUserWithoutL3requirements,
  TrackCieCanProperties,
  TrackCieScreenProperties,
  TrackIdMethodBottomsheetProperties,
  TrackItWalletCardReadingClose,
  TrackItWalletCieCardReadingFailure,
  TrackItWalletCieCardReadingUnexpectedFailure,
  TrackItWalletCieCardVerifyFailure,
  TrackItWalletErrorCardReading,
  TrackITWalletSpidIDPSelected
} from "./types";
⋮----
export const trackItWalletIDMethod = (itw_flow: ItwFlow) =>
⋮----
export const trackItWalletSpidIDPSelection = (itw_flow: ItwFlow) =>
⋮----
export const trackItWalletCiePinEnter = (itw_flow: ItwFlow) =>
⋮----
export const trackItWalletCieNfcActivation = (itw_flow: ItwFlow) =>
⋮----
export const trackItWalletCieCardReading = (
  properties: TrackCieScreenProperties
) =>
⋮----
export const trackItWalletCieCardReadingSuccess = (
  properties: TrackCieScreenProperties
) =>
⋮----
export const trackItwPinInfoBottomSheet = (
  screenFlowContext: ItwScreenFlowContext
) =>
⋮----
export const trackItwCieInfoBottomSheet = (
  screenFlowContext: ItwScreenFlowContext
) =>
⋮----
export const trackItwCiePinTutorialCie = (
  properties: TrackCieScreenProperties
) =>
⋮----
export const trackItwCiePinTutorialPin = (itw_flow: ItwFlow) =>
⋮----
export const trackItwIdCieCanTutorialCan = (
  properties: TrackCieCanProperties
) =>
⋮----
export const trackItwIdEnterCan = (properties: TrackCieCanProperties) =>
⋮----
export const trackItwUserWithoutL3Bottomsheet = () =>
⋮----
export const trackItwIdMethodBottomsheet = (
  properties: TrackIdMethodBottomsheetProperties
) =>
⋮----
export const trackItWalletSpidIDPSelected = (
  properties: TrackITWalletSpidIDPSelected
) =>
⋮----
export const trackItWalletCiePinForgotten = (itw_flow: ItwFlow) =>
⋮----
export const trackItWalletCiePukForgotten = (itw_flow: ItwFlow) =>
⋮----
export const trackItWalletCieNfcGoToSettings = (itw_flow: ItwFlow) =>
⋮----
export const trackItwIdMethodBottomsheetClose = (
  properties: TrackIdMethodBottomsheetProperties
) =>
⋮----
export const trackItwIdMethodBottomsheetContinue = (
  properties: TrackIdMethodBottomsheetProperties
) =>
⋮----
export const trackItWalletErrorCardReading = (
  properties: TrackItWalletErrorCardReading
) =>
⋮----
export const trackItWalletErrorPin = (
  itw_flow: ItwFlow,
  cie_reading_progress: number
) =>
⋮----
export const trackItWalletSecondErrorPin = (
  itw_flow: ItwFlow,
  cie_reading_progress: number
) =>
⋮----
... (44 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/identification/analytics/types.ts">
import { ItwFlow, ItwIdMethod } from "../../analytics/utils/types";
⋮----
export enum CieCardReadingFailureReason {
  APDU_ERROR = "APDU_ERROR",
  AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
  GENERIC_ERROR = "GENERIC_ERROR",
  KO = "KO",
  NO_INTERNET_CONNECTION = "NO_INTERNET_CONNECTION",
  ON_TAG_DISCOVERED_NOT_CIE = "ON_TAG_DISCOVERED_NOT_CIE",
  START_NFC_ERROR = "START_NFC_ERROR",
  STOP_NFC_ERROR = "STOP_NFC_ERROR"
}
⋮----
export type ItwFallbackL2Flow = {
  fallback_reason: "nfc_not_supported" | "user_without_cie";
};
⋮----
export type ItwUserWithoutL3requirements = {
  position: "bottom_sheet" | "screen";
  reason: "user_without_cie" | "user_without_pin";
  screen_name: string;
};
⋮----
export type TrackCieCanProperties = {
  ITW_ID_method?: ItwIdMethod;
};
⋮----
export type TrackCieScreenProperties = {
  itw_flow: ItwFlow;
  ITW_ID_method?: ItwIdMethod;
};
⋮----
export type TrackIdMethodBottomsheetProperties = {
  itw_flow: ItwFlow;
  ITW_ID_method?: ItwIdMethod;
};
⋮----
export type TrackItWalletCardReadingClose = {
  cie_reading_progress: number;
  itw_flow: ItwFlow;
  ITW_ID_method?: ItwIdMethod;
};
⋮----
export type TrackItWalletCieCardReadingFailure = {
  cie_reading_progress: number;
  itw_flow: ItwFlow;
  ITW_ID_method?: ItwIdMethod;
  reason: CieCardReadingFailureReason;
};
⋮----
export type TrackItWalletCieCardReadingUnexpectedFailure = {
  cie_reading_progress: number;
  itw_flow: ItwFlow;
  ITW_ID_method?: ItwIdMethod;
  origin: string | undefined;
  reason: string | undefined;
};
⋮----
export type TrackItWalletCieCardVerifyFailure = {
  cie_reading_progress: number;
  itw_flow: ItwFlow;
  ITW_ID_method?: ItwIdMethod;
  reason: CieCardVerifyFailureReason;
};
⋮----
export type TrackItWalletErrorCardReading = {
  cie_reading_progress: number;
  itw_flow: ItwFlow;
  ITW_ID_method?: ItwIdMethod;
};
⋮----
export type TrackITWalletSpidIDPSelected = {
  idp: string;
  itw_flow: ItwFlow;
};
⋮----
type CieCardVerifyFailureReason = "CERTIFICATE_EXPIRED" | "CERTIFICATE_REVOKED";
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/components/ItwCieCardReadFailureContent.tsx">
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { Linking } from "react-native";
⋮----
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import {
  CieCardReadContent,
  CieCardReadContentProps
} from "../../../../common/components/cie/CieCardReadContent.tsx";
import { ItwFlow } from "../../../analytics/utils/types.ts";
import { useItwDismissalDialog } from "../../../common/hooks/useItwDismissalDialog";
import { type IdentificationContext } from "../../../machine/eid/context.ts";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import {
  isL3FeaturesEnabledSelector,
  selectIdentification
} from "../../../machine/eid/selectors";
import {
  trackItWalletCardReadingClose,
  trackItWalletCieCardReadingFailure,
  trackItWalletCieCardReadingUnexpectedFailure,
  trackItWalletCieCardVerifyFailure,
  trackItWalletCiePinForgotten,
  trackItWalletCiePukForgotten,
  trackItWalletErrorCan,
  trackItWalletErrorCardReading,
  trackItWalletErrorPin,
  trackItWalletLastErrorPin,
  trackItWalletSecondErrorPin
} from "../../analytics";
import { CieCardReadingFailureReason } from "../../analytics/types";
import { CieManagerFailure, CieManagerState } from "../hooks/useCieManager";
import { isNfcError } from "../utils/error";
⋮----
type ItwCieCardReadFailureContentProps = Extract<
  CieManagerState,
  { state: "failure" }
> & {
  onRetry: () => void;
};
⋮----
export const ItwCieCardReadFailureContent = ({
  failure,
  progress,
  onRetry,
  origin
}: ItwCieCardReadFailureContentProps) =>
⋮----
type TrackErrorParams = {
  failure: CieManagerFailure;
  identification?: IdentificationContext;
  isL3: boolean;
  origin?: string;
  readProgress?: number;
};
⋮----
const trackError = ({
  failure,
  isL3,
  readProgress,
  identification,
  origin
}: TrackErrorParams) =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/components/ItwCieCardReadProgressContent.tsx">
import { IOButtonProps } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
import { Platform } from "react-native";
⋮----
import { CieCardReadContent } from "../../../../common/components/cie/CieCardReadContent";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import {
  isL3FeaturesEnabledSelector,
  selectIdentification
} from "../../../machine/eid/selectors";
import {
  trackItWalletCardReadingClose,
  trackItWalletCieCardReadingSuccess
} from "../../analytics";
import { CieManagerState } from "../hooks/useCieManager";
⋮----
type ItwCieCardReadProgressContentProps = Exclude<
  CieManagerState,
  { state: "failure" }
>;
⋮----
export const ItwCieCardReadProgressContent = (
  props: ItwCieCardReadProgressContentProps
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/components/ItwCiePreparationScreenContent.tsx">
import { ContentWrapper, VStack } from "@io-app/design-system";
import { PropsWithChildren, ReactElement } from "react";
import {
  Dimensions,
  Image,
  ImageSourcePropType,
  StyleSheet,
  View
} from "react-native";
⋮----
import { IOScrollViewActions } from "../../../../../components/ui/IOScrollView";
import { IOScrollViewWithLargeHeader } from "../../../../../components/ui/IOScrollViewWithLargeHeader";
⋮----
type Props = {
  actions?: IOScrollViewActions;
  description: string;
  goBack?: () => void;
  title: string;
} & (
  | { imageComponent: ReactElement; imageSrc?: never }
  | { imageComponent?: never; imageSrc: ImageSourcePropType }
);
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/components/ItwCieWebView.tsx">
import I18n from "i18next";
import { ComponentProps, createRef } from "react";
import { Platform, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import WebView, {
  WebViewMessageEvent,
  WebViewNavigation
} from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent,
  WebViewNavigationEvent
} from "react-native-webview/lib/WebViewTypes";
⋮----
import { LoadingScreenContent } from "../../../../../components/screens/LoadingScreenContent";
import { useIOSelector } from "../../../../../store/hooks";
import { selectItwEnv } from "../../../common/store/selectors/environment";
import { getEnv } from "../../../common/utils/environment";
import { WebViewError } from "../utils/error";
⋮----
const isL3AuthUrl = (url: string)
⋮----
type ItwCieWebViewProps = ComponentProps<typeof WebView> & {
  onWebViewError: (error: WebViewError) => void;
};
⋮----
const ItwCieWebView = (
⋮----
const getWebViewErrorMessage = (
    err: Error | WebViewErrorEvent | WebViewHttpErrorEvent
): string =>
⋮----
const handleOnError = (
    err: Error | WebViewErrorEvent | WebViewHttpErrorEvent
): void
⋮----
const handleOnLoadEnd = (e: WebViewErrorEvent | WebViewNavigationEvent) =>
⋮----
type ItwCieAuthenticationWebviewProps = {
  authenticationUrl: string;
  onServiceProviderUrlReceived: (url: string) => void;
  onWebViewError: (error: WebViewError) => void;
};
⋮----
const handleMessage = async (event: WebViewMessageEvent) =>
⋮----
const handleShouldStartLoadWithRequest = (
    event: WebViewNavigation
): boolean =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/hooks/useCieInfoBottomSheet.tsx">
import { IOMarkdown, VStack } from "@io-app/design-system";
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useMemo } from "react";
import { Alert, StyleSheet, View } from "react-native";
⋮----
import { AnimatedImage } from "../../../../../components/AnimatedImage";
import { renderActionButtons } from "../../../../../components/ui/IOScrollView";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { trackItwKoStateAction } from "../../../analytics";
import { ItwFlow } from "../../../analytics/utils/types";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { isL3FeaturesEnabledSelector } from "../../../machine/eid/selectors";
import {
  trackItwCieInfoBottomSheet,
  trackItwPinInfoBottomSheet,
  trackItwUserWithoutL3Requirements
} from "../../analytics";
import { CieWarningType } from "../utils/types";
⋮----
type Props = { showSecondaryAction?: boolean; type: CieWarningType };
⋮----
const getCieBottomSheetLocales = (type: CieWarningType) =>
⋮----
const trackBottomSheetView = (
  type: CieWarningType,
  screenName: string,
  itw_flow: ItwFlow
) =>
⋮----
const showPinNotFoundAlert = ()
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/hooks/useCieManager.tsx">
import { triggerHaptic } from "@io-app/design-system";
import {
  CieError,
  CieManager,
  InternalAuthAndMrtdResponse,
  NfcError,
  NfcEvent
} from "@pagopa/io-react-native-cie";
import I18n from "i18next";
import { useCallback, useEffect, useState } from "react";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { isScreenReaderEnabledSelector } from "../../../../../store/reducers/preferences";
import {
  WAIT_TIMEOUT_NAVIGATION,
  WAIT_TIMEOUT_NAVIGATION_ACCESSIBILITY
} from "../utils/constants";
import { cieUatEndpoint } from "../utils/endpoints";
import { getCieProgressEmojis } from "../utils/strings";
⋮----
export type CieManagerFailure = CieError | NfcError;
⋮----
export type CieManagerState =
  | {
      failure: CieManagerFailure;
      origin?: string;
      progress?: number;
      state: "failure";
    }
  | { progress: number; state: "reading" }
  | { state: "idle" }
  | { state: "success" };
⋮----
type UseCieManager = (params: {
  onInternalAuthAndMRTDWithPaceSuccess?: (
    data: InternalAuthAndMrtdResponse
  ) => void;
  onSuccess?: (authorizationUrl: string) => void;
  useUat?: boolean;
}) => {
  startInternalAuthAndMRTDReading: (
    can: string,
    challenge: string
  ) => Promise<void>;
  startReading: (pin: string, serviceProviderUrl: string) => Promise<void>;
  state: CieManagerState;
};
⋮----
export const useCieManager: UseCieManager = ({
  onSuccess,
  onInternalAuthAndMRTDWithPaceSuccess,
  useUat
}) =>
⋮----
const onErrorListener = (error: NfcError) =>
⋮----
const startReading = async (pin: string, serviceProviderUrl: string) =>
⋮----
const startInternalAuthAndMRTDReading = async (
    can: string,
    challenge: string
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/hooks/useCieNfcInfoBottomSheet.tsx">
import { IOMarkdown, VStack } from "@io-app/design-system";
import I18n from "i18next";
import { Platform, View } from "react-native";
⋮----
import { renderActionButtons } from "../../../../../components/ui/IOScrollView";
import { helpCenterHowToReadCieUrl } from "../../../../../config";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { openWebUrl } from "../../../../../utils/url";
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/screens/ItwActivateNfcScreen.tsx">
import {
  ContentWrapper,
  Divider,
  ListItemHeader,
  ListItemInfo
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { Alert } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../../components/ui/IOScrollViewWithLargeHeader";
⋮----
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { isL3FeaturesEnabledSelector } from "../../../machine/eid/selectors";
import {
  trackItWalletCieNfcActivation,
  trackItWalletCieNfcGoToSettings
} from "../../analytics";
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/screens/ItwCieAuthenticationScreen.tsx">
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useState } from "react";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { LoadingScreenContent } from "../../../../../components/screens/LoadingScreenContent";
import { useIOSelector } from "../../../../../store/hooks";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { selectItwEnv } from "../../../common/store/selectors/environment";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import {
  isL3FeaturesEnabledSelector,
  selectAuthUrl,
  selectCiePin,
  selectIdentification
} from "../../../machine/eid/selectors";
import { trackItWalletCieCardReading } from "../../analytics";
import { ItwCieCardReadFailureContent } from "../components/ItwCieCardReadFailureContent";
import { ItwCieCardReadProgressContent } from "../components/ItwCieCardReadProgressContent";
import {
  ItwCieAuthenticationWebview,
  ItwCieAuthorizationWebview
} from "../components/ItwCieWebView";
import { useCieManager } from "../hooks/useCieManager";
import { WebViewError } from "../utils/error";
⋮----
export const ItwCieAuthenticationScreen = () =>
⋮----
type CieManagerComponentProps = {
  onAuthorizationUrlReceived: (url: string) => void;
  pin: string;
  serviceProviderUrl: string;
};
⋮----
const CieManagerComponent = ({
  pin,
  serviceProviderUrl,
  onAuthorizationUrlReceived
}: CieManagerComponentProps) =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/screens/ItwCieCanScreen.tsx">
import {
  Body,
  ContentWrapper,
  H2,
  OTPInput,
  VSpacer
} from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { useHeaderHeight } from "@react-navigation/elements";
import { useFocusEffect, useIsFocused } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useRef, useState } from "react";
import {
  Keyboard,
  KeyboardAvoidingView,
  Platform,
  ScrollView,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIOSelector } from "../../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture";
import { withTrailingPoliceCarLightEmojii } from "../../../../../utils/strings";
import { isCieLoginUatEnabledSelector } from "../../../../authentication/login/cie/store/selectors";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { selectIdentification } from "../../../machine/eid/selectors";
import { trackItwIdEnterCan } from "../../analytics";
⋮----
// Reset the pin when the user leaves the screen.
⋮----
const onCanChanged = (value: string) =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/screens/ItwCieInternalAuthAndMrtdScreen.tsx">
import { InternalAuthAndMrtdResponse } from "@pagopa/io-react-native-cie";
import { useFocusEffect } from "@react-navigation/native";
import { useCallback } from "react";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import {
  selectIdentification,
  selectMrtdCallbackUrl
} from "../../../machine/eid/selectors";
import { ItwParamsList } from "../../../navigation/ItwParamsList";
import { trackItWalletCieCardReading } from "../../analytics";
import { ItwCieCardReadFailureContent } from "../components/ItwCieCardReadFailureContent";
import { ItwCieCardReadProgressContent } from "../components/ItwCieCardReadProgressContent";
import { ItwCieAuthorizationWebview } from "../components/ItwCieWebView";
import { useCieManager } from "../hooks/useCieManager";
import { WebViewError } from "../utils/error";
⋮----
export type ItwCieInternalAuthAndMrtdScreenParams = {
  can: string;
  challenge: string;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_IDENTIFICATION_CIE_INTERNAL_AUTH_MRTD_SCREEN"
>;
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/screens/ItwCiePinScreen.tsx">
import {
  ContentWrapper,
  H2,
  IOButton,
  OTPInput,
  VSpacer
} from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { useHeaderHeight } from "@react-navigation/elements";
import { useFocusEffect, useIsFocused } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useRef, useState } from "react";
import {
  Keyboard,
  KeyboardAvoidingView,
  Platform,
  ScrollView,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import {
  HeaderSecondLevelHookProps,
  useHeaderSecondLevel
} from "../../../../../hooks/useHeaderSecondLevel";
import { useIOSelector } from "../../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture";
import { withTrailingPoliceCarLightEmojii } from "../../../../../utils/strings";
import { isCieLoginUatEnabledSelector } from "../../../../authentication/login/cie/store/selectors";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { isL3FeaturesEnabledSelector } from "../../../machine/eid/selectors";
import { trackItWalletCiePinEnter } from "../../analytics";
import { useCieInfoBottomSheet } from "../hooks/useCieInfoBottomSheet";
⋮----
// The contextual help (?) icon is only removed for the IT-Wallet (L3) flow;
// the L2 "Documenti su IO" flow keeps the support request entry point.
⋮----
const onPinChanged = (value: string) =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/screens/ItwCiePreparationCanScreen.tsx">
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { useItwDismissalDialog } from "../../../common/hooks/useItwDismissalDialog";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { selectIdentification } from "../../../machine/eid/selectors";
import { trackItwIdCieCanTutorialCan } from "../../analytics";
import { ItwCiePreparationScreenContent } from "../components/ItwCiePreparationScreenContent";
⋮----
export const ItwCiePreparationCanScreen = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/screens/ItwCiePreparationCardScreen.tsx">
import I18n from "i18next";
⋮----
import { useItwDismissalDialog } from "../../../common/hooks/useItwDismissalDialog";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { ItwCiePreparationScreenContent } from "../components/ItwCiePreparationScreenContent";
⋮----
export const ItwCiePreparationCardScreen = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/screens/ItwCiePreparationNfcScreen.tsx">
import { IOButton } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { GifImage } from "../../../../../components/GifImage";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import {
  isL3FeaturesEnabledSelector,
  selectIdentification
} from "../../../machine/eid/selectors";
import { trackItwCiePinTutorialCie } from "../../analytics";
import { ItwCiePreparationScreenContent } from "../components/ItwCiePreparationScreenContent";
import { useCieInfoBottomSheet } from "../hooks/useCieInfoBottomSheet";
import { useCieNfcInfoBottomSheet } from "../hooks/useCieNfcInfoBottomSheet";
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/screens/ItwCiePreparationPinScreen.tsx">
import { IOButton } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { GifImage } from "../../../../../components/GifImage";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { isL3FeaturesEnabledSelector } from "../../../machine/eid/selectors";
import { trackItwCiePinTutorialPin } from "../../analytics";
import { ItwCiePreparationScreenContent } from "../components/ItwCiePreparationScreenContent";
import { useCieInfoBottomSheet } from "../hooks/useCieInfoBottomSheet";
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/screens/ItwIdentificationCieWarningScreen.tsx">
import I18n from "i18next";
import { useEffect, useMemo } from "react";
import { Linking } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { trackItwKoStateAction } from "../../../analytics";
import { isL2Credential } from "../../../common/utils/itwCredentialUtils";
import { ItwCredentialIssuanceMachineContext } from "../../../machine/credential/provider";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import {
  isL3FeaturesEnabledSelector,
  selectCredentialType
} from "../../../machine/eid/selectors";
import { ItwParamsList } from "../../../navigation/ItwParamsList";
import {
  trackItwFallbackL2Flow,
  trackItwFallbackL2FlowExit,
  trackItwFallbackL2FlowStart,
  trackItwUserWithoutL3Requirements
} from "../../analytics";
import { CieWarningType } from "../utils/types";
⋮----
export type ItwIdentificationCieWarningScreenNavigationParams = {
  routeName: string;
  type: CieWarningType;
};
⋮----
type ScreenProps = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_IDENTIFICATION_CIE_WARNING"
>;
⋮----
const handlePrimaryActionPress = () =>
⋮----
const handleSecondaryActionPress = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/utils/constants.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/utils/endpoints.ts">
import { Platform } from "react-native";
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/utils/error.ts">
import { NfcError } from "@pagopa/io-react-native-cie";
import z from "zod";
⋮----
export type WebViewError = z.output<typeof webViewError>;
⋮----
export const isNfcError = (
  failure: unknown
): failure is NfcError | WebViewError
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/utils/strings.ts">
export const getCieProgressEmojis = (progress: number) =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cie/utils/types.ts">
export type CieWarningType = "card" | "pin";
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cieId/hooks/useCieIdApp.ts">
import { CieIdErrorResult, openCieIdApp } from "@pagopa/io-react-native-cieid";
import { useCallback, useEffect, useState } from "react";
import { Linking } from "react-native";
import { z } from "zod";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { convertUnknownToError } from "../../../../../utils/errors";
import { isAndroid, isIos } from "../../../../../utils/platform";
import {
  CIE_ID_ERROR,
  CIE_ID_ERROR_MESSAGE,
  IO_LOGIN_CIE_SOURCE_APP,
  IO_LOGIN_CIE_URL_SCHEME
} from "../../../../authentication/login/cie/utils/cie";
import { selectItwCieIdEnvironment } from "../../../common/store/selectors/environment";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
⋮----
type CieIdHookResult = {
  authUrl: string | undefined;
  handleAuthenticationFailure: (error: unknown) => void;
  isAppLaunched: boolean;
  startCieIdAppAuthentication: (url: string) => void;
};
⋮----
const isCieIdAppError = (e: unknown): e is CieIdErrorResult
⋮----
const extractCieIdErrorFromUrl = (url: string)
⋮----
export const useCieIdApp = (): CieIdHookResult =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/cieId/screens/ItwCieIdLoginScreen.tsx">
import { isCieIdAvailable } from "@pagopa/io-react-native-cieid";
import I18n from "i18next";
import { memo, useCallback, useMemo, useState } from "react";
import { StyleSheet, View } from "react-native";
import { WebView, WebViewNavigation } from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent
} from "react-native-webview/lib/WebViewTypes";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIOSelector } from "../../../../../store/hooks";
import { originSchemasWhiteList } from "../../../../authentication/common/utils";
import { useItwDismissalDialog } from "../../../common/hooks/useItwDismissalDialog";
import {
  selectItwCieIdEnvironment,
  selectItwEnv
} from "../../../common/store/selectors/environment";
import { getEnv } from "../../../common/utils/environment";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { selectAuthUrl } from "../../../machine/eid/selectors";
import {
  WEBVIEW_ERROR_CODE_PREFIX,
  WEBVIEW_HTTP_ERROR_CODE_PREFIX
} from "../../cie/utils/constants";
import { useCieIdApp } from "../hooks/useCieIdApp";
⋮----
const isAuthenticationUrl = (url: string) =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/common/components/CieIdMethodModule.tsx">
import { ModuleNavigationAlt } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { trackItWalletIDMethodSelected } from "../../../analytics";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { useContinueWithBottomSheet } from "../hooks/useContinueWithBottomSheet";
⋮----
type Props = {
  isL3: boolean;
  isReissuanceMode?: boolean;
};
⋮----
trackItWalletIDMethodSelected({
              ITW_ID_method: "cieId",
              itw_flow: "L3"
            });
cieIdBottomSheet.present();
⋮----
subtitle=
</file>

<file path="apps/main-app/ts/features/itwallet/identification/common/components/CiePinMethodModule.tsx">
import { ModuleNavigationAlt } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { trackItWalletIDMethodSelected } from "../../../analytics";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { useContinueWithBottomSheet } from "../hooks/useContinueWithBottomSheet";
⋮----
type Props = {
  isL3: boolean;
  isReissuanceMode?: boolean;
};
⋮----
trackItWalletIDMethodSelected({
              ITW_ID_method: "ciePin",
              itw_flow: "L3"
            });
ciePinBottomSheet.present();
</file>

<file path="apps/main-app/ts/features/itwallet/identification/common/components/SpidMethodModule.tsx">
import { ModuleNavigationAlt } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { trackItWalletIDMethodSelected } from "../../../analytics";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { useContinueWithBottomSheet } from "../hooks/useContinueWithBottomSheet";
⋮----
type Props = {
  isL3: boolean;
  isReissuanceMode?: boolean;
};
⋮----
trackItWalletIDMethodSelected({
              ITW_ID_method: "spid",
              itw_flow: "L3"
            });
spidBottomSheet.present();
⋮----
subtitle=
</file>

<file path="apps/main-app/ts/features/itwallet/identification/common/hooks/useContinueWithBottomSheet.tsx">
import {
  Alert,
  Body,
  BodySmall,
  HStack,
  Icon,
  IODimensions,
  IOIcons,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { useMemo, useRef } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { renderActionButtons } from "../../../../../components/ui/IOScrollView";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import {
  trackItwIdMethodBottomsheet,
  trackItwIdMethodBottomsheetClose,
  trackItwIdMethodBottomsheetContinue
} from "../../analytics";
import { TrackIdMethodBottomsheetProperties } from "../../analytics/types";
⋮----
type ModeType = "cieId" | "ciePin" | "spid";
⋮----
type Props = {
  isL3: boolean;
  onPrimaryAction: () => void;
  type: "cieId" | "ciePin" | "spid";
};
⋮----
trackItwIdMethodBottomsheet(trackingProps);
bottomSheet.present();
⋮----
const theme = useIOTheme();
</file>

<file path="apps/main-app/ts/features/itwallet/identification/common/saga/index.ts">
import { CieUtils } from "@pagopa/io-react-native-cie";
import { call, put } from "typed-redux-saga/macro";
⋮----
import {
  ReduxSagaEffect,
  SagaCallReturnType
} from "../../../../../types/utils";
import { convertUnknownToError } from "../../../../../utils/errors";
import { itwHasNfcFeature } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/itwallet/identification/common/screens/ItwIdentificationModeSelectionScreen.tsx">
import {
  ContentWrapper,
  IOButton,
  ListItemHeader,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../../components/ui/IOScrollViewWithLargeHeader";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../store/hooks";
import { useItwDismissalDialog } from "../../../common/hooks/useItwDismissalDialog";
import { itwDisabledIdentificationMethodsSelector } from "../../../common/store/selectors/remoteConfig";
import { isL2Credential } from "../../../common/utils/itwCredentialUtils";
import { itwLifecycleIsValidSelector } from "../../../lifecycle/store/selectors";
import { EidIssuanceLevel } from "../../../machine/eid/context";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import {
  isL3FeaturesEnabledSelector,
  selectCredentialType,
  selectIsLoading,
  selectIssuanceLevel,
  selectIssuanceMode
} from "../../../machine/eid/selectors";
import { ItwParamsList } from "../../../navigation/ItwParamsList";
import { trackItWalletIDMethod, trackItwUserWithoutCie } from "../../analytics";
import { CieIdMethodModule } from "../components/CieIdMethodModule";
import { CiePinMethodModule } from "../components/CiePinMethodModule";
import { SpidMethodModule } from "../components/SpidMethodModule";
import { itwHasNfcFeatureSelector } from "../store/selectors";
⋮----
export type ItwIdentificationModeSelectionScreenProps =
  IOStackNavigationRouteProps<
    ItwParamsList,
    "ITW_IDENTIFICATION_MODE_SELECTION"
  >;
⋮----
export type ItwIdentificationNavigationParams = {
  animationEnabled?: boolean;
  credentialOfferUri?: string;
  credentialType?: string;
  eidReissuing?: boolean;
  level?: EidIssuanceLevel;
};
</file>

<file path="apps/main-app/ts/features/itwallet/identification/common/store/actions/index.ts">
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
export type ItwIdentificationActions = ActionType<typeof itwHasNfcFeature>;
</file>

<file path="apps/main-app/ts/features/itwallet/identification/common/store/reducers/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../../store/actions/types";
import { itwHasNfcFeature } from "../actions";
⋮----
export type ItwIdentificationState = {
  hasNfcFeature: pot.Pot<boolean, Error>;
};
⋮----
const reducer = (
  state: ItwIdentificationState = itwIdentificationInitialState,
  action: Action
): ItwIdentificationState =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/common/store/selectors/index.ts">
import { GlobalState } from "../../../../../../store/reducers/types";
⋮----
export const itwHasNfcFeatureSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/itwallet/identification/spid/screens/ItwIdentificationIdpSelectionScreen.tsx">
import { VSpacer } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import { useCallback, useRef } from "react";
⋮----
import { isReady } from "../../../../../common/model/RemoteValue";
import { IOScrollViewWithLargeHeader } from "../../../../../components/ui/IOScrollViewWithLargeHeader";
import { loadIdps } from "../../../../../store/actions/content";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { idpsRemoteValueSelector } from "../../../../../store/reducers/content";
import { idps as idpsFallback, SpidIdp } from "../../../../../utils/idps";
import IdpsGrid from "../../../../authentication/login/idp/components/IdpsGrid";
import { randomOrderIdps } from "../../../../authentication/login/idp/screens/IdpSelectionScreen";
import { ItwFlow } from "../../../analytics/utils/types";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { isL3FeaturesEnabledSelector } from "../../../machine/eid/selectors";
import {
  trackItWalletSpidIDPSelected,
  trackItWalletSpidIDPSelection
} from "../../analytics";
⋮----
const onIdpSelected = (idp: SpidIdp) =>
</file>

<file path="apps/main-app/ts/features/itwallet/identification/spid/screens/ItwSpidIdpLoginScreen.tsx">
import I18n from "i18next";
import { memo, useCallback, useMemo, useState } from "react";
import { Linking, StyleSheet, View } from "react-native";
import { WebView, WebViewNavigation } from "react-native-webview";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent
} from "react-native-webview/lib/WebViewTypes";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
import {
  HeaderSecondLevelHookProps,
  useHeaderSecondLevel
} from "../../../../../hooks/useHeaderSecondLevel";
import { useIOSelector } from "../../../../../store/hooks";
import {
  getIntentFallbackUrl,
  originSchemasWhiteList
} from "../../../../authentication/common/utils";
import { useItwDismissalDialog } from "../../../common/hooks/useItwDismissalDialog";
import { selectItwEnv } from "../../../common/store/selectors/environment";
import { getEnv } from "../../../common/utils/environment";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import {
  selectAuthUrl,
  selectIsLoading,
  selectIssuanceLevel
} from "../../../machine/eid/selectors";
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/analytics/enum.ts">
export enum ITW_ISSUANCE_ACTIONS_EVENTS {
  ITW_ADD_FIRST_CREDENTIAL = "ITW_ADD_FIRST_CREDENTIAL",
  ITW_CREDENTIAL_START_ISSUING = "ITW_CREDENTIAL_START_ISSUING",
  ITW_ISSUANCE_CREDENTIAL_SCROLL = "ITW_ISSUANCE_CREDENTIAL_SCROLL",
  ITW_UX_CONVERSION = "ITW_UX_CONVERSION"
}
⋮----
export enum ITW_ISSUANCE_ERRORS_EVENTS {
  ITW_ADD_CREDENTIAL_FAILURE = "ITW_ADD_CREDENTIAL_FAILURE",
  ITW_ADD_CREDENTIAL_INVALID_STATUS = "ITW_ADD_CREDENTIAL_INVALID_STATUS",
  ITW_ADD_CREDENTIAL_NOT_ENTITLED_FAILURE = "ITW_ADD_CREDENTIAL_NOT_ENTITLED_FAILURE",
  ITW_ADD_CREDENTIAL_NOT_TRUSTED_ISSUER = "ITW_ADD_CREDENTIAL_NOT_TRUSTED_ISSUER",
  ITW_ADD_CREDENTIAL_UNEXPECTED_FAILURE = "ITW_ADD_CREDENTIAL_UNEXPECTED_FAILURE",
  ITW_ALREADY_HAS_CREDENTIAL = "ITW_ALREADY_HAS_CREDENTIAL",
  ITW_CIEID_CIE_NOT_REGISTERED = "ITW_CIEID_CIE_NOT_REGISTERED",
  ITW_CREDENTIAL_ISSUING_FROM_MSG_FAILURE = "ITW_CREDENTIAL_ISSUING_FROM_MSG_FAILURE",
  ITW_CREDENTIAL_REISSUING_FAILED = "ITW_CREDENTIAL_REISSUING_FAILED",
  ITW_DEVICE_NOT_SUPPORTED = "ITW_DEVICE_NOT_SUPPORTED",
  ITW_GET_CHALLENGE_INFO_FAILED = "ITW_GET_CHALLENGE_INFO_FAILED",
  ITW_ID_NOT_MATCH = "ITW_ID_NOT_MATCH",
  ITW_ID_REQUEST_FAILURE = "ITW_ID_REQUEST_FAILURE",
  ITW_ID_REQUEST_FEDERATION_FAILED = "ITW_ID_REQUEST_FEDERATION_FAILED",
  ITW_ID_REQUEST_UNEXPECTED_FAILURE = "ITW_ID_REQUEST_UNEXPECTED_FAILURE",
  ITW_WALLET_INSTANCE_RENEWAL_FAILURE = "ITW_WALLET_INSTANCE_RENEWAL_FAILURE"
}
⋮----
export enum ITW_ISSUANCE_EXIT_EVENTS {
  ITW_BACK_TO_WALLET = "ITW_BACK_TO_WALLET",
  ITW_USER_EXIT = "ITW_USER_EXIT"
}
⋮----
export enum ITW_ISSUANCE_SCREENVIEW_EVENTS {
  ITW_CREDENTIAL_INTRO = "ITW_CREDENTIAL_INTRO",
  ITW_CREDENTIAL_PREVIEW = "ITW_CREDENTIAL_PREVIEW"
}
⋮----
export enum ITW_ISSUANCE_TECH_EVENTS {
  ITW_ID_REQUEST_SUCCESS = "ITW_ID_REQUEST_SUCCESS",
  ITW_WALLET_INSTANCE_RENEWAL_SUCCESS = "ITW_WALLET_INSTANCE_RENEWAL_SUCCESS"
}
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import {
  ItwFlow,
  ItwIdMethod,
  ItwStatus,
  MixPanelCredential
} from "../../analytics/utils/types";
import { IssuanceFailure } from "../../machine/eid/failure";
import {
  ITW_ISSUANCE_ACTIONS_EVENTS,
  ITW_ISSUANCE_ERRORS_EVENTS,
  ITW_ISSUANCE_EXIT_EVENTS,
  ITW_ISSUANCE_SCREENVIEW_EVENTS,
  ITW_ISSUANCE_TECH_EVENTS
} from "./enum";
import {
  AddCredentialFailure,
  BackToWallet,
  CredentialUnexpectedFailure,
  IdRequestFailure,
  IdRequestFederationFailure,
  IdUnexpectedFailure,
  ItwCredentialReissuingFailedProperties,
  ItwExit,
  TrackCredentialPreview,
  TrackGetChallengeInfoFailure
} from "./types";
⋮----
export const trackCredentialPreview = (
  credentialPreview: TrackCredentialPreview
) =>
⋮----
export const trackItwCredentialIntro = (credential: MixPanelCredential) =>
⋮----
export const trackAddFirstCredential = () =>
⋮----
export const trackSaveCredentialToWallet = (credential: MixPanelCredential) =>
⋮----
export const trackItwCredentialStartIssuing = (
  credential: MixPanelCredential
) =>
⋮----
export const trackIssuanceCredentialScrollToBottom = (
  credential: MixPanelCredential,
  screenRoute: string
) =>
⋮----
export const trackIdNotMatch = (
  ITW_ID_method: ItwIdMethod,
  itw_flow: ItwFlow
) =>
⋮----
export const trackItwIdRequestFailure = (properties: IdRequestFailure) =>
⋮----
export const trackItwUnsupportedDevice = (properties: IssuanceFailure) =>
⋮----
export const trackAddCredentialFailure = ({
  credential,
  reason,
  type
}: AddCredentialFailure) =>
⋮----
export const trackAddCredentialUnexpectedFailure = ({
  credential,
  origin,
  reason,
  type
}: CredentialUnexpectedFailure) =>
⋮----
export const trackCredentialNotEntitledFailure = ({
  credential,
  reason,
  type
}: AddCredentialFailure) =>
⋮----
export const trackCredentialInvalidStatusFailure = ({
  credential,
  reason,
  type
}: AddCredentialFailure) =>
⋮----
export const trackItwIdRequestUnexpectedFailure = ({
  origin,
  reason,
  type,
  itw_flow
}: IdUnexpectedFailure) =>
⋮----
export const trackItwCieIdCieNotRegistered = (itwFlow: ItwFlow) =>
⋮----
export const trackItwAddCredentialNotTrustedIssuer = (
  properties: CredentialUnexpectedFailure
) =>
⋮----
export const trackItwCredentialReissuingFailed = (
  properties: ItwCredentialReissuingFailedProperties
) =>
⋮----
export const trackItwAlreadyHasCredential = (
... (29 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/analytics/types.ts">
import {
  ItwFlow,
  ItwIdMethod,
  MixPanelCredential
} from "../../analytics/utils/types";
⋮----
export type AddCredentialFailure = {
  caused_by: ItwFailureCause;
  credential: MixPanelCredential;
  reason: unknown;
  type: string;
};
⋮----
export type BackToWallet = {
  credential: Extract<MixPanelCredential, "ITW_ID_V2" | "ITW_PID">;
  exit_page: string;
};
⋮----
export type CredentialUnexpectedFailure = {
  credential: MixPanelCredential;
  origin?: string;
  reason: unknown;
  type: string;
};
⋮----
export type IdRequestFailure = {
  caused_by: ItwFailureCause;
  itw_flow: ItwFlow;
  ITW_ID_method: ItwIdMethod;
  reason: unknown;
  type: string;
};
⋮----
export type IdRequestFederationFailure = {
  credential: "ITW_ID" | "ITW_PID";
  reason: unknown;
  type: string;
};
⋮----
export type IdUnexpectedFailure = {
  itw_flow: ItwFlow;
  origin?: string;
  reason: unknown;
  type: string;
};
⋮----
export type ItwCredentialReissuingFailedProperties = {
  credential_failed: MixPanelCredential;
  itw_flow: ItwFlow;
  reason: unknown;
  type: string;
};
⋮----
export type ItwExit = {
  credential: MixPanelCredential;
  exit_page: string;
};
⋮----
export type TrackCredentialPreview = {
  credential: MixPanelCredential;
  credential_type?: "multiple" | "unique";
};
⋮----
export type TrackGetChallengeInfoFailure = {
  ITW_ID_method: ItwIdMethod;
  reason?: string;
};
⋮----
type ItwFailureCause = "CredentialIssuer" | "WalletProvider";
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/components/ItwCredentialPreviewClaimsCard.tsx">
import { IODimensions } from "@io-app/design-system";
import { StyleSheet, View } from "react-native";
⋮----
import { useCredentialCardConfig } from "../../common/components/ItwCredentialCard/config";
import { ItwCredentialClaimsCard } from "../../common/components/ItwCredentialClaimsCard";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { ItwCredentialPreviewClaimsList } from "./ItwCredentialPreviewClaimsList";
⋮----
type Props = {
  data: CredentialMetadata;
  title: string;
};
⋮----
export const ItwCredentialPreviewClaimsCard = (
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/components/ItwCredentialPreviewClaimsList.tsx">
import { Divider } from "@io-app/design-system";
import { memo } from "react";
import { View } from "react-native";
⋮----
import { ItwCredentialClaim } from "../../common/components/ItwCredentialClaim";
import { ItwIssuanceMetadata } from "../../common/components/ItwIssuanceMetadata";
import { parseClaims, WellKnownClaim } from "../../common/utils/itwClaimsUtils";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
⋮----
type ItwCredentialClaimsListProps = {
  data: CredentialMetadata;
  releaserVisible?: boolean;
};
⋮----
const ItwCredentialPreviewClaimsList = ({
  data,
  releaserVisible = true
}: ItwCredentialClaimsListProps) =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/components/ItwRequestedClaimsList.tsx">
import {
  BodySmall,
  Divider,
  H6,
  HStack,
  Icon,
  IOColors,
  useIOTheme
} from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { isStringNullyOrEmpty } from "../../../../utils/strings";
import {
  ClaimDisplayFormat,
  DisclosureClaim,
  getClaimDisplayValue,
  getSafeText
} from "../../common/utils/itwClaimsUtils";
⋮----
type ItwRequiredClaimsListProps = {
  items: ReadonlyArray<DisclosureClaim>;
};
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/hooks/useCredentialEventsTracking.ts">
import { useEffect } from "react";
⋮----
import { getMixPanelCredential } from "../../analytics/utils";
import {
  serializeFailureReason,
  shouldSerializeReason
} from "../../common/utils/itwStoreUtils";
import {
  CredentialIssuanceFailure,
  CredentialIssuanceFailureType
} from "../../machine/credential/failure";
import {
  trackAddCredentialFailure,
  trackAddCredentialUnexpectedFailure,
  trackCredentialInvalidStatusFailure,
  trackCredentialNotEntitledFailure,
  trackItwAddCredentialNotTrustedIssuer
} from "../analytics";
⋮----
type Params = {
  credentialType?: string;
  failure: CredentialIssuanceFailure;
  invalidErrorCode?: string;
  isItwL3: boolean;
};
⋮----
export const useCredentialEventsTracking = ({
  failure,
  isItwL3,
  credentialType,
  invalidErrorCode
}: Params) =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/hooks/useCredentialIssuanceStatusMessage.ts">
import { useIOSelector } from "../../../../store/hooks";
import { useIoWallet } from "../../common/hooks/useIoWallet";
import {
  CredentialStatusMessage,
  getCredentialStatusMessageFromCatalog,
  getCredentialStatusMessageFromIssuerConf
} from "../../common/utils/itwCredentialStatusUtils";
import { statusAssertionFailure } from "../../common/utils/itwFailureUtils";
import { IssuerConfiguration } from "../../common/utils/itwTypesUtils";
import {
  itwCatalogueTranslationsByLocaleSelector,
  itwCredentialsCatalogueByTypesSelector
} from "../../credentialsCatalogue/store/selectors";
import {
  CredentialIssuanceFailure,
  CredentialIssuanceFailureType
} from "../../machine/credential/failure";
⋮----
export const useCredentialIssuanceStatusMessage = (
  failure: CredentialIssuanceFailure,
  issuerConf?: IssuerConfiguration
):
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/hooks/useEidEventsTracking.ts">
import { useEffect } from "react";
⋮----
import { ItwFlow } from "../../analytics/utils/types";
import {
  serializeFailureReason,
  shouldSerializeReason
} from "../../common/utils/itwStoreUtils";
import {
  EidIssuanceLevel,
  IdentificationContext
} from "../../machine/eid/context";
import {
  IssuanceFailure,
  IssuanceFailureType
} from "../../machine/eid/failure";
import {
  trackIdNotMatch,
  trackItwCieIdCieNotRegistered,
  trackItwIdRequestFailure,
  trackItwIdRequestFederationFailed,
  trackItwIdRequestUnexpectedFailure,
  trackItwUnsupportedDevice,
  trackMrtdPoPChallengeInfoFailed
} from "../analytics";
⋮----
type EidTrackedCredential = "ITW_ID" | "ITW_PID";
⋮----
type Params = {
  credential: EidTrackedCredential;
  failure: IssuanceFailure;
  identification?: IdentificationContext;
  issuanceLevel?: EidIssuanceLevel;
};
⋮----
const mapIssuanceLevelToFlow = (issuanceLevel?: EidIssuanceLevel): ItwFlow =>
⋮----
export const useEidEventsTracking = ({
  failure,
  identification,
  issuanceLevel,
  credential
}: Params) =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/hooks/useItwSomethingWrongBottomSheet.tsx">
import { FooterActions, IOMarkdown, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { useItwAuthSourceName } from "../../common/hooks/useItwAuthSourceName";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { itwAuthenticSourceContactsSelector } from "../../credentialsCatalogue/store/selectors";
import { getAuthSourceContactsMarkdown } from "../utils/authSourceContacts";
⋮----
type Props = {
  credential: CredentialMetadata;
};
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceCredentialAsyncContinuationScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import { getCredentialStatus } from "../../common/utils/itwCredentialStatusUtils";
import { CredentialType } from "../../common/utils/itwMocksUtils";
import { itwCredentialSelector } from "../../credentials/store/selectors";
import { useItwNavigation } from "../../navigation/ItwParamsList";
import { ITW_ROUTES } from "../../navigation/routes";
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceCredentialFailureScreen.tsx">
import I18n from "i18next";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { useIOSelector } from "../../../../store/hooks";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { trackItwKoStateAction } from "../../analytics";
import { useItwCredentialName } from "../../common/hooks/useItwCredentialName";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { useItwFailureSupportModal } from "../../common/hooks/useItwFailureSupportModal";
import { ZendeskSubcategoryValue } from "../../common/hooks/useItwZendeskSupport";
import { serializeFailureReason } from "../../common/utils/itwStoreUtils";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import {
  CredentialIssuanceFailure,
  CredentialIssuanceFailureType
} from "../../machine/credential/failure";
import { ItwCredentialIssuanceMachineContext } from "../../machine/credential/provider";
import {
  selectCredentialType,
  selectFailure,
  selectIssuerConfiguration
} from "../../machine/credential/selectors";
import { useCredentialEventsTracking } from "../hooks/useCredentialEventsTracking";
import { useCredentialIssuanceStatusMessage } from "../hooks/useCredentialIssuanceStatusMessage";
⋮----
export const ItwIssuanceCredentialFailureScreen = () =>
⋮----
type ContentViewProps = { failure: CredentialIssuanceFailure };
⋮----
const ContentView = (
⋮----
const closeIssuance = () =>
⋮----
const getOperationResultScreenContentProps =
(): OperationResultScreenContentProps =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceCredentialIntroductionScreen.tsx">
import {
  ContentWrapper,
  H2,
  IOColors,
  IOMarkdown,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { Image, StyleSheet, View } from "react-native";
⋮----
import type { CredentialIssuanceMode } from "../../machine/credential/context";
⋮----
import introHeroSource from "../../../../../img/features/itWallet/issuance/intro_hero.png";
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { getMixPanelCredential } from "../../analytics/utils";
import { ItwGenericErrorContent } from "../../common/components/ItwGenericErrorContent";
import { useItwCredentialName } from "../../common/hooks/useItwCredentialName";
import { useItwDismissalDialog } from "../../common/hooks/useItwDismissalDialog";
import { itwCredentialIntroContentSelector } from "../../credentialsCatalogue/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { ItwCredentialIssuanceMachineContext } from "../../machine/credential/provider";
import {
  selectCredentialType,
  selectIsLoading
} from "../../machine/credential/selectors";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider";
import { selectCredentialType as selectEidCredentialType } from "../../machine/eid/selectors";
import { ItwParamsList } from "../../navigation/ItwParamsList";
import {
  trackItwCredentialIntro,
  trackItwCredentialStartIssuing
} from "../analytics";
⋮----
export type ItwIssuanceCredentialIntroductionNavigationParams = {
  animationEnabled?: boolean;
  credentialType?: string;
  mode?: CredentialIssuanceMode;
};
⋮----
type ScreenProps = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_ISSUANCE_CREDENTIAL_INTRODUCTION"
>;
⋮----
export const ItwIssuanceCredentialIntroductionScreen = (props: ScreenProps) =>
⋮----
// Send the requested credential type to the machine when the issuance flow
// directly starts from this screen and not from the credentials catalog.
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceCredentialLandingScreen.tsx">
import I18n from "i18next";
import { useEffect, useMemo } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIOSelector } from "../../../../store/hooks";
import {
  isStartupLoaded,
  StartupStatusEnum
} from "../../../../store/reducers/startup";
import { getMixPanelCredential } from "../../analytics/utils";
import { useItwCredentialName } from "../../common/hooks/useItwCredentialName";
import { itwIsL3EnabledSelector } from "../../common/store/selectors";
import {
  itwCredentialsEidStatusSelector,
  itwCredentialStatusSelector
} from "../../credentials/store/selectors";
import { itwCredentialIntroContentSelector } from "../../credentialsCatalogue/store/selectors";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../lifecycle/store/selectors";
import {
  ItwParamsList,
  useItwNavigation
} from "../../navigation/ItwParamsList";
import { ITW_ROUTES } from "../../navigation/routes";
import {
  trackItwAlreadyHasCredential,
  trackItwIssuanceFromMsgFailure
} from "../analytics";
⋮----
export type ItwIssuanceCredentialLandingScreenNavigationParams = {
  credentialType: string;
};
⋮----
export type ItwIssuanceCredentialLandingScreenProps =
  IOStackNavigationRouteProps<
    ItwParamsList,
    "ITW_LANDING_SCREEN_CREDENTIAL_ISSUANCE"
  >;
⋮----
export const ItwIssuanceCredentialLandingScreen = ({
  route
}: ItwIssuanceCredentialLandingScreenProps) =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceCredentialPreviewScreen.tsx">
import {
  Body,
  ContentWrapper,
  ForceScrollDownView,
  H2,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { usePreventScreenCapture } from "../../../../utils/hooks/usePreventScreenCapture";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { identificationRequest } from "../../../identification/store/actions";
import { getMixPanelCredential } from "../../analytics/utils";
import { useItwCredentialName } from "../../common/hooks/useItwCredentialName";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { useItwDismissalDialog } from "../../common/hooks/useItwDismissalDialog";
import {
  CredentialMetadata,
  isMultiLevelCredential
} from "../../common/utils/itwTypesUtils";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { ItwCredentialIssuanceMachineContext } from "../../machine/credential/provider";
import { selectCredential } from "../../machine/credential/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
import {
  trackCredentialPreview,
  trackIssuanceCredentialScrollToBottom,
  trackItwExit,
  trackSaveCredentialToWallet
} from "../analytics";
import { ItwCredentialPreviewClaimsCard } from "../components/ItwCredentialPreviewClaimsCard";
import { useItwSomethingWrongBottomSheet } from "../hooks/useItwSomethingWrongBottomSheet";
⋮----
export const ItwIssuanceCredentialPreviewScreen = () =>
⋮----
type ContentViewProps = {
  credential: CredentialMetadata;
};
⋮----
const handleSaveToWallet = () =>
⋮----
const trackScrollToBottom = (crossed: boolean) =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceCredentialTrustIssuerScreen.tsx">
import {
  ContentWrapper,
  ForceScrollDownView,
  H2,
  IOMarkdownLite,
  ListItemHeader,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useRef } from "react";
⋮----
import type { CredentialIssuanceMode } from "../../machine/credential/context";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import { handleOpenLink } from "../../../../components/IOMarkdown/renderRules";
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { generateDynamicUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { ITW_IPZS_PRIVACY_URL_BODY } from "../../../../urls";
import { usePreventScreenCapture } from "../../../../utils/hooks/usePreventScreenCapture";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { trackOpenItwTos } from "../../analytics";
import { getMixPanelCredential } from "../../analytics/utils";
import { ItwDataExchangeIcons } from "../../common/components/ItwDataExchangeIcons";
import { ItwGenericErrorContent } from "../../common/components/ItwGenericErrorContent";
import { RequiresConnectivity } from "../../common/components/RequiresConnectivity";
import { useItwCredentialName } from "../../common/hooks/useItwCredentialName";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { useItwDismissalDialog } from "../../common/hooks/useItwDismissalDialog";
import { itwIpzsItwalletPrivacyUrlSelector } from "../../common/store/selectors/remoteConfig";
import { parseClaims, WellKnownClaim } from "../../common/utils/itwClaimsUtils";
import { ISSUER_MOCK_NAME } from "../../common/utils/itwMocksUtils";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { itwCredentialsEidSelector } from "../../credentials/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { ItwCredentialIssuanceMachineContext } from "../../machine/credential/provider";
import {
  selectCredentialType,
  selectIsIssuing,
  selectIsLoading,
  selectRequiredClaims
} from "../../machine/credential/selectors";
import { ItwParamsList } from "../../navigation/ItwParamsList";
import { ITW_ROUTES } from "../../navigation/routes";
import {
  trackIssuanceCredentialScrollToBottom,
  trackItwExit
} from "../analytics";
import { ItwRequestedClaimsList } from "../components/ItwRequestedClaimsList";
⋮----
export type ItwIssuanceCredentialTrustIssuerNavigationParams = {
  animationEnabled?: boolean;
  credentialType?: string;
  isUpgrade?: boolean;
  mode?: CredentialIssuanceMode;
};
⋮----
type ScreenProps =
  | IOStackNavigationRouteProps<
      ItwParamsList,
      "ITW_ISSUANCE_CREDENTIAL_TRUST_ISSUER"
    >
  | ItwIssuanceCredentialTrustIssuerNavigationParams;
⋮----
const ItwIssuanceCredentialTrustIssuer = (props: ScreenProps) =>
⋮----
type ContentViewProps = {
  credentialType: string;
  eid: CredentialMetadata;
  requiredClaimNames: ReadonlyArray<string>;
};
⋮----
const handleContinuePress = () =>
⋮----
// Added hasScrolledToBottom ref to avoid sending multiple scroll-to-bottom events when navigating between screens
const trackScrollToBottom = (crossed: boolean) =>
⋮----
content={I18n.t("features.itWallet.issuance.credentialAuth.tos", {
            privacyUrl: ipzsPrivacyUrl
          })}
          onLinkPress={url => {
            handleOpenLink(url);
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceEidFailureScreen.tsx">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { Linking } from "react-native";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { useIOSelector } from "../../../../store/hooks";
import { generateDynamicUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { DOCUMENTS_ON_IO_FAQ_12_URL_BODY } from "../../../../urls";
import {
  zendeskDocumentiSuIoCategory,
  zendeskItWalletCategory
} from "../../../../utils/supportAssistance";
import { openWebUrl } from "../../../../utils/url";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { trackItwKoStateAction } from "../../analytics";
import { KoState } from "../../analytics/utils/types";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { useItwFailureSupportModal } from "../../common/hooks/useItwFailureSupportModal";
import { ZendeskSubcategoryValue } from "../../common/hooks/useItwZendeskSupport";
import { serializeFailureReason } from "../../common/utils/itwStoreUtils";
import {
  IssuanceFailure,
  IssuanceFailureType
} from "../../machine/eid/failure";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider";
import {
  isL3FeaturesEnabledSelector,
  selectFailure,
  selectIdentification,
  selectIssuanceLevel
} from "../../machine/eid/selectors";
import { useEidEventsTracking } from "../hooks/useEidEventsTracking";
⋮----
export const ItwIssuanceEidFailureScreen = () =>
⋮----
type ContentViewProps = { failure: IssuanceFailure };
⋮----
const ContentView = (
⋮----
const closeIssuance = (errorConfig: KoState) =>
⋮----
const getOperationResultScreenContentProps =
(): OperationResultScreenContentProps =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceEidPreviewScreen.tsx">
import {
  BodySmall,
  ContentWrapper,
  ForceScrollDownView,
  H2,
  HStack,
  Icon,
  IOMarkdownLite,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIODispatch } from "../../../../store/hooks";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { identificationRequest } from "../../../identification/store/actions";
import { toItwIdMethod } from "../../analytics/utils/types";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { useItwDismissalDialog } from "../../common/hooks/useItwDismissalDialog";
import { isItwCredential } from "../../common/utils/itwCredentialUtils";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider";
import {
  isL3FeaturesEnabledSelector,
  selectCanRenderEidPreview,
  selectEid,
  selectIdentification,
  selectIsLoading,
  selectIssuanceMode
} from "../../machine/eid/selectors";
import {
  trackCredentialPreview,
  trackItwExit,
  trackItwRequestSuccess,
  trackSaveCredentialToWallet
} from "../analytics";
import { ItwCredentialPreviewClaimsList } from "../components/ItwCredentialPreviewClaimsList";
⋮----
export const ItwIssuanceEidPreviewScreen = () =>
⋮----
type ContentViewProps = {
  eid: CredentialMetadata;
};
⋮----
const handleSaveToWallet = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceEidReissuanceLandingScreen.tsx">
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import ROUTES from "../../../../navigation/routes";
import { useIOSelector } from "../../../../store/hooks";
import {
  isStartupLoaded,
  StartupStatusEnum
} from "../../../../store/reducers/startup";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { itwIsL3EnabledSelector } from "../../common/store/selectors";
import { itwCredentialsEidStatusSelector } from "../../credentials/store/selectors";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../lifecycle/store/selectors";
import { useItwNavigation } from "../../navigation/ItwParamsList";
import { ITW_ROUTES } from "../../navigation/routes";
⋮----
const NavigateToEidIssuanceMachine = (
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceEidResultScreen.tsx">
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useEffect, useRef } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks.ts";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import {
  getMixPanelCredential,
  toSurveyAuthMethod
} from "../../analytics/utils";
import ItwActivationSuccessFeedbackBanner from "../../common/components/ItwActivationSuccessFeedbackBanner";
import { ItwReissuanceFeedbackBanner } from "../../common/components/ItwReissuanceFeedbackBanner.tsx";
import { useItwCredentialName } from "../../common/hooks/useItwCredentialName";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils.ts";
import { itwIsWalletEmptySelector } from "../../credentials/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { ItwCredentialIssuanceMachineContext } from "../../machine/credential/provider";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider";
import {
  hasCredentialsToUpgrade,
  isL3FeaturesEnabledSelector,
  selectCredentialOfferUri,
  selectCredentialType,
  selectIdentification,
  selectIsLoading,
  selectIssuanceMode,
  selectUpgradeFailedCredentials
} from "../../machine/eid/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
import {
  trackAddFirstCredential,
  trackBackToWallet,
  trackItwCredentialReissuingFailed
} from "../analytics";
⋮----
const handleAddCredential = () =>
⋮----
const handleBackToWallet = () => machineRef.send(
⋮----
const handleGoToWalletWithTracking = () =>
⋮----
const ItwIssuanceEidCredentialTriggerContent = () => (
  <LoadingScreenContent title={I18n.t("global.genericWaiting")} />
);
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/screens/ItwIssuanceUpcomingCredentialScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
⋮----
export const ItwIssuanceUpcomingCredentialScreen = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { IntegrityServiceStatus } from "../reducers";
⋮----
export type ItwIssuanceActions =
  | ActionType<typeof itwRemoveIntegrityKeyTag>
  | ActionType<typeof itwSetIntegrityServiceStatus>
  | ActionType<typeof itwStoreIntegrityKeyTag>;
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { createMigrate, PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { isDevEnv } from "../../../../../utils/environment";
import { itwLifecycleStoresReset } from "../../../lifecycle/store/actions";
import {
  itwRemoveIntegrityKeyTag,
  itwSetIntegrityServiceStatus,
  itwStoreIntegrityKeyTag
} from "../actions";
import {
  CURRENT_REDUX_ITW_ISSUANCE_STORE_VERSION,
  itwIssuanceStateMigrations
} from "./migrations";
⋮----
export type IntegrityServiceStatus = "error" | "ready" | "unavailable";
⋮----
export type ItwIssuanceState = {
  integrityKeyTag: string | undefined;
  integrityServiceStatus?: IntegrityServiceStatus;
};
⋮----
const reducer = (
  state: ItwIssuanceState = itwIssuanceInitialState,
  action: Action
): ItwIssuanceState =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/store/reducers/migrations.ts">
import { MigrationManifest, PersistedState } from "redux-persist";
⋮----
type MigrationState = PersistedState & Record<string, any>;
⋮----
type SerializedOption =
  | { [OPTION_TAG]: "None" }
  | { [OPTION_TAG]: "Some"; value: unknown };
⋮----
const isSerializedOption = (value: unknown): value is SerializedOption =>
⋮----
const unwrapPersistedOption = (value: unknown): unknown =>
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/store/selectors/index.ts">
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const itwIntegrityKeyTagSelector = (state: GlobalState)
⋮----
export const itwIntegrityServiceStatusSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/itwallet/issuance/utils/authSourceContacts.ts">
export type AuthSourceContact = Readonly<{
  type: string;
  value: string;
}>;
⋮----
type GetAuthSourceContactsMarkdownParams = Readonly<{
  authSource: string | undefined;
  contacts: ReadonlyArray<AuthSourceContact> | undefined;
  websiteLabel: string;
}>;
⋮----
const sanitizeMarkdownString = (value: string): string
⋮----
/** Sort contacts so that those linking to a website are displayed at the top. */
const sortContactsByUrl = (contacts: ReadonlyArray<AuthSourceContact>)
⋮----
/**
 * Formats the Authentic Source's contacts as a Markdown list ready to be
 * consumed by `IOMarkdown`. This is deliberately pure so that each contact type
 * and its ordering can be tested without rendering React components.
 */
export const getAuthSourceContactsMarkdown = ({
  authSource,
  contacts,
  websiteLabel
}: GetAuthSourceContactsMarkdownParams): string =>
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/analytics/enum.ts">
export enum ITW_LIFECYCLE_ACTIONS_EVENTS {
  ITW_NEW_ID_RESET = "ITW_NEW_ID_RESET"
}
⋮----
export enum ITW_LIFECYCLE_ERRORS_EVENTS {
  ITW_BAD_STATE_WALLET_DEACTIVATED = "ITW_BAD_STATE_WALLET_DEACTIVATED",
  ITW_INSTANCE_REVOKED = "ITW_INSTANCE_REVOKED",
  ITW_LOGIN_ID_NOT_MATCH = "ITW_LOGIN_ID_NOT_MATCH",
  ITW_STATUS_WALLET_ATTESTATION_FAILURE = "ITW_STATUS_WALLET_ATTESTATION_FAILURE"
}
⋮----
export enum ITW_LIFECYCLE_TECH_EVENTS {
  ITW_WALLET_INSTANCE_RESET_FAILURE = "ITW_WALLET_INSTANCE_RESET_FAILURE"
}
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { updatePropertiesWalletRevoked } from "../../analytics/properties/propertyUpdaters";
import { WalletInstanceRevocationReason } from "../../common/utils/itwTypesUtils";
import {
  ITW_LIFECYCLE_ACTIONS_EVENTS,
  ITW_LIFECYCLE_ERRORS_EVENTS,
  ITW_LIFECYCLE_TECH_EVENTS
} from "./enum";
⋮----
export const trackWalletNewIdReset = () =>
⋮----
export const trackItwIdNotMatch = () =>
⋮----
export const trackItwStatusWalletAttestationFailure = () =>
⋮----
export const trackItwWalletInstanceRevocation = (
  reason: WalletInstanceRevocationReason
) =>
⋮----
export const trackItwWalletBadState = () =>
⋮----
export const trackItwWalletInstanceResetFailure = (reason: unknown) =>
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/saga/checkCurrentWalletInstanceStateSaga.ts">
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { ReduxSagaEffect } from "../../../../types/utils";
import { assert } from "../../../../utils/assert";
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import {
  selectItwEnv,
  selectItwSpecsVersion
} from "../../common/store/selectors/environment.ts";
import { getEnv } from "../../common/utils/environment.ts";
import { getCurrentWalletInstanceStatus } from "../../common/utils/itwAttestationUtils.ts";
import { itwSetWalletInstanceRemotelyActive } from "../../walletInstance/store/actions";
import { itwLifecycleIsOperationalOrValid } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/saga/checkIntegrityServiceReadySaga.ts">
import { call, delay, put, race, select, take } from "typed-redux-saga/macro";
⋮----
import { ReduxSagaEffect } from "../../../../types/utils";
import { selectItwEnv } from "../../common/store/selectors/environment.ts";
import { getEnv } from "../../common/utils/environment.ts";
import { ensureIntegrityServiceIsReady } from "../../common/utils/itwIntegrityUtils";
import { itwSetIntegrityServiceStatus } from "../../issuance/store/actions";
import { itwIntegrityServiceStatusSelector } from "../../issuance/store/selectors";
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/saga/checkWalletInstanceStateSaga.ts">
import { Errors } from "@pagopa/io-react-native-wallet";
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { ReduxSagaEffect } from "../../../../types/utils";
import { assert } from "../../../../utils/assert";
import { getNetworkError } from "../../../../utils/errors";
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import {
  selectItwEnv,
  selectItwSpecsVersion
} from "../../common/store/selectors/environment";
import { getEnv } from "../../common/utils/environment";
import { getWalletInstanceStatus } from "../../common/utils/itwAttestationUtils";
import { getIoWallet } from "../../common/utils/itwIoWallet";
import { WalletInstanceRevocationReason } from "../../common/utils/itwTypesUtils";
import { itwCredentialsEidSelector } from "../../credentials/store/selectors";
import { itwIntegrityKeyTagSelector } from "../../issuance/store/selectors";
import { StatusListRepository } from "../../statusList/utils/repository";
import { isStale } from "../../statusList/utils/validity";
import { itwUpdateWalletInstanceStatus } from "../../walletInstance/store/actions";
import { ItwWalletInstanceState } from "../../walletInstance/store/reducers";
import { itwWalletInstanceStatusListSelector } from "../../walletInstance/store/selectors";
import {
  trackItwStatusWalletAttestationFailure,
  trackItwWalletBadState,
  trackItwWalletInstanceRevocation
} from "../analytics";
import {
  itwLifecycleIsOperationalOrValid,
  itwLifecycleIsValidSelector
} from "../store/selectors";
import { checkIntegrityServiceReadySaga } from "./checkIntegrityServiceReadySaga";
import { handleWalletInstanceResetSaga } from "./handleWalletInstanceResetSaga";
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/saga/handleWalletInstanceResetSaga.ts">
import { deleteKey } from "@pagopa/io-react-native-crypto";
import { all, call, put, select } from "typed-redux-saga/macro";
⋮----
import { isIos } from "../../../../utils/platform";
import { walletRemoveCardsByCategory } from "../../../wallet/store/actions/cards";
import { updatePropertiesWalletRevoked } from "../../analytics/properties/propertyUpdaters.ts";
import {
  itwCredentialsEidSelector,
  itwCredentialsSelector
} from "../../credentials/store/selectors";
import { CredentialsVault } from "../../credentials/utils/vault";
import { itwIntegrityKeyTagSelector } from "../../issuance/store/selectors";
import { itwSetWalletInstanceRemotelyActive } from "../../walletInstance/store/actions";
import { trackItwWalletInstanceResetFailure } from "../analytics";
import { itwLifecycleStoresReset } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLeading } from "typed-redux-saga/macro";
⋮----
import { itwLifecycleWalletReset } from "../store/actions";
import { handleWalletInstanceResetSaga } from "./handleWalletInstanceResetSaga";
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/screens/ItwIdentityNotMatchingScreen.tsx">
import {
  Banner,
  ContentWrapper,
  IOMarkdown,
  VStack
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { Alert } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIODispatch } from "../../../../store/hooks";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { logoutRequest } from "../../../authentication/common/store/actions";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { trackItwIdNotMatch, trackWalletNewIdReset } from "../analytics";
import {
  itwLifecycleIdentityCheckCompleted,
  itwLifecycleWalletReset
} from "../store/actions";
⋮----
const resetWallet = () =>
⋮----
const handleCancel = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/screens/ItwLifecycleWalletRevocationScreen.tsx">
import I18n from "i18next";
import { useMemo } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useOfflineToastGuard } from "../../../../hooks/useOfflineToastGuard";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOStore } from "../../../../store/hooks";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider";
import { selectIsLoading } from "../../machine/eid/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../store/selectors/index";
⋮----
const RevocationLoadingScreen = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type ItwLifecycleActions =
  | ActionType<typeof itwLifecycleIdentityCheckCompleted>
  | ActionType<typeof itwLifecycleStoresReset>
  | ActionType<typeof itwLifecycleWalletReset>;
</file>

<file path="apps/main-app/ts/features/itwallet/lifecycle/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { itwIsFiscalCodeWhitelisted } from "../../../common/store/selectors/preferences";
import { isItwMinAppVersionSupportedSelector } from "../../../common/store/selectors/remoteConfig";
import { isItwCredential } from "../../../common/utils/itwCredentialUtils";
import { itwCredentialsEidSelector } from "../../../credentials/store/selectors";
import { itwIntegrityKeyTagSelector } from "../../../issuance/store/selectors";
⋮----
export const itwLifecycleIsInstalledSelector = (state: GlobalState)
⋮----
export const itwLifecycleIsOperationalSelector = (state: GlobalState)
⋮----
export const itwLifecycleIsValidSelector = (state: GlobalState)
⋮----
export const itwLifecycleIsOperationalOrValid = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/state/issuance.ts">
import { assign } from "xstate";
⋮----
import { ItwTags } from "../../tags";
import { itwCredentialSetup } from "../setup";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/actions.ts">
import I18n from "i18next";
import { ActionArgs, assertEvent, assign } from "xstate";
⋮----
import ROUTES from "../../../../navigation/routes";
import { assert } from "../../../../utils/assert";
import { isRouteInNavigationState } from "../../../../utils/navigation";
import { checkCurrentSession } from "../../../authentication/common/store/actions";
import {
  trackSaveCredentialSuccess,
  trackStartAddNewCredential,
  trackStartCredentialUpgrade,
  trackWalletDataShare,
  trackWalletDataShareAccepted
} from "../../analytics";
import { itwMixPanelCredentialDetailsSelector } from "../../analytics/store/selectors";
import { getMixPanelCredential } from "../../analytics/utils";
import { itwClearCredentialUpgradeFailed } from "../../common/store/actions/preferences";
import { itwSetCredentialExitSurvey } from "../../common/store/actions/ui";
import { selectItwSpecsVersion } from "../../common/store/selectors/environment";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { itwCredentialsReplaceByType } from "../../credentials/store/actions";
import { itwCredentialSelector } from "../../credentials/store/selectors";
import { itwCredentialsCatalogueByTypesSelector } from "../../credentialsCatalogue/store/selectors";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
import {
  itwKeyAttestationsStore,
  itwWalletInstanceAttestationStore
} from "../../walletInstance/store/actions";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/selectors";
import { Context } from "./context";
import { CredentialIssuanceEvents } from "./events";
⋮----
type CredentialIssuanceActionArgs = ActionArgs<
  Context,
  CredentialIssuanceEvents,
  CredentialIssuanceEvents
>;
⋮----
export const navigateToCredentialIntroductionScreenAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
export const navigateToTrustIssuerScreenAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
export const navigateToCredentialPreviewScreenAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
export const navigateToFailureScreenAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
export const navigateToWalletAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
export const navigateToEidVerificationExpiredScreenAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
export const navigateToCardOnboardingScreenAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
export const closeIssuanceAction = ({
  context,
  event
}: CredentialIssuanceActionArgs) =>
⋮----
export const storeWalletInstanceAttestationAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
export const storeCredentialAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
const resolveCredentialOrigin = (
  context: Context
): CredentialMetadata["origin"] =>
⋮----
export const trackStartAddCredentialAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
export const trackAddCredentialAction = ({
  context
}: CredentialIssuanceActionArgs) =>
⋮----
export const handleSessionExpiredAction = ({
  context
}: CredentialIssuanceActionArgs)
⋮----
export const trackCredentialIssuingDataShareAction = ({
... (13 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/actors.ts">
import type { CredentialOffer } from "@pagopa/io-react-native-wallet";
⋮----
import { fromCallback, fromPromise } from "xstate";
⋮----
import { assert } from "../../../../utils/assert";
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
⋮----
import { isAssertionGenerationError } from "../../common/utils/itwFailureUtils";
import { getIoWallet } from "../../common/utils/itwIoWallet";
import { ensureIntegrityServiceIsStoreReadyOrThrow } from "../../common/utils/itwStoreUtils";
import {
  CredentialAccessToken,
  CredentialBundle,
  IssuerConfiguration
} from "../../common/utils/itwTypesUtils";
import { itwCredentialsEidSelector } from "../../credentials/store/selectors";
import { CredentialsVault } from "../../credentials/utils/vault";
import { itwIsCredentialsCataloguePending } from "../../credentialsCatalogue/store/selectors";
import {
  trackWalletInstanceRenewalFailure,
  trackWalletInstanceRenewalSuccess
} from "../../issuance/analytics";
import { itwStoreIntegrityKeyTag } from "../../issuance/store/actions";
import { itwIntegrityKeyTagSelector } from "../../issuance/store/selectors";
import { itwSetWalletInstanceRenewalError } from "../../walletInstance/store/actions";
import { itwWalletInstanceRenewalErrorSelector } from "../../walletInstance/store/selectors";
import { Context } from "./context";
import { CredentialIssuanceEvents } from "./events";
import { CredentialIssuanceMachineDeps } from "./input";
⋮----
export type GetWalletAttestationActorInput = {
  deps: CredentialIssuanceMachineDeps;
};
⋮----
export type GetWalletAttestationActorOutput = Awaited<
  ReturnType<typeof itwAttestationUtils.getWalletInstanceAttestation>
>;
⋮----
export type ObtainAccessTokenActorInput = Partial<
  Omit<
    Parameters<credentialIssuanceUtils.CompleteAuthFlow>[0],
    "env" | "itwVersion" | "pid"
  >
> & {
  deps: CredentialIssuanceMachineDeps;
};
⋮----
export type ObtainCredentialActorInput = Partial<
  Parameters<credentialIssuanceUtils.ObtainCredential>[0]
> & {
  deps: CredentialIssuanceMachineDeps;
};
⋮----
export type ObtainCredentialActorOutput = {
  credentials: ReadonlyArray<CredentialBundle>;
  keyAttestations: Record<string, string>;
};
⋮----
export type ObtainCredentialStatusActorInput = Pick<
  Context,
  "credentials" | "issuerConf"
> & {
  deps: CredentialIssuanceMachineDeps;
};
⋮----
export type ProcessCredentialOfferActorInput = {
  credentialOfferUri: Context["credentialOfferUri"];
  deps: CredentialIssuanceMachineDeps;
};
⋮----
export type ProcessCredentialOfferActorOutput = {
  credentialType: string;
  grantDetails: CredentialOffer.ExtractGrantDetailsResult;
  issuerConf: IssuerConfiguration;
  offer: CredentialOffer.CredentialOffer;
};
⋮----
export type RequestCredentialActorInput = Partial<
  Parameters<credentialIssuanceUtils.RequestCredential>[0]
> & {
  deps: CredentialIssuanceMachineDeps;
};
⋮----
export type RequestCredentialActorOutput = Awaited<
  ReturnType<typeof credentialIssuanceUtils.requestCredential>
>;
⋮----
export type VerifyTrustFederationActorInput = Pick<
  Context,
  "resolvedCredentialOffer"
> & {
  deps: CredentialIssuanceMachineDeps;
};
⋮----
const extractKeyAttestations = (
  authorizedCredentials: ReadonlyArray<{
    keyAttestation?: string;
    keyAttestationId?: string;
  }>
): Record<string, string>
... (3 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/context.ts">
import { CryptoContext } from "@pagopa/io-react-native-jwt";
⋮----
import {
  CredentialAccessToken,
  CredentialBundle,
  CredentialOfferResolved,
  EvaluatedDcqlQueryResult,
  IssuerConfiguration,
  RequestObject,
  WalletInstanceAttestations
} from "../../common/utils/itwTypesUtils";
import { CredentialIssuanceFailure } from "./failure";
import { CredentialIssuanceMachineDeps } from "./input";
⋮----
export type Context = {
  accessToken: CredentialAccessToken | undefined;
  clientId: string | undefined;
  codeVerifier: string | undefined;
  credentialOfferUri: string | undefined;
  credentials: ReadonlyArray<CredentialBundle> | undefined;
  credentialType: string | undefined;
  deps: CredentialIssuanceMachineDeps;
  evaluatedDcqlQuery: EvaluatedDcqlQueryResult | undefined;
  failure: CredentialIssuanceFailure | undefined;
  isItWalletValid: boolean;
  issuerConf: IssuerConfiguration | undefined;
  isWalletValid: boolean;
  keyAttestations?: Record<string, string>;
  mode: CredentialIssuanceMode;
  requestedCredential: RequestObject | undefined;
  resolvedCredentialOffer: CredentialOfferResolved | undefined;
  responseMode: string | undefined;
  walletInstanceAttestation: undefined | WalletInstanceAttestations;
  wiaCryptoContext: CryptoContext | undefined;
};
⋮----
export type CredentialIssuanceMode = "issuance" | "reissuance" | "upgrade";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/events.ts">
import { ErrorActorEvent } from "xstate";
⋮----
import { MixPanelCredential } from "../../analytics/utils/types";
import { CredentialExitStep } from "../../common/hooks/useItwCredentialExitSurveyBottomSheet";
import { CredentialIssuanceMode } from "./context";
⋮----
export type CredentialIssuanceEvents =
  | AddToWallet
  | Back
  | Close
  | ConfirmCredentialOffer
  | ConfirmTrustData
  | Continue
  | CredentialsCatalogueReady
  | ErrorActorEvent
  | Retry
  | SelectCredential
  | SessionRefreshComplete
  | StartCredentialOffer;
⋮----
type AddToWallet = {
  type: "add-to-wallet";
};
⋮----
type Back = {
  type: "back";
};
⋮----
type Close = {
  surveyCredential?: MixPanelCredential;
  surveyStep?: CredentialExitStep;
  type: "close";
};
⋮----
type ConfirmCredentialOffer = {
  type: "confirm-credential-offer";
};
⋮----
type ConfirmTrustData = {
  type: "confirm-trust-data";
};
⋮----
type Continue = {
  type: "continue";
};
⋮----
type CredentialsCatalogueReady = {
  type: "credentials-catalogue-ready";
};
⋮----
type Retry = {
  type: "retry";
};
⋮----
type SelectCredential = {
  credentialType: string;
  mode: CredentialIssuanceMode;
  type: "select-credential";
};
⋮----
type SessionRefreshComplete = {
  type: "session-refresh-complete";
};
⋮----
type StartCredentialOffer = {
  itwCredentialOfferUri: string;
  type: "start-credential-offer";
};
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/failure.ts">
import { type IntegrityError } from "@pagopa/io-react-native-integrity";
import { Errors, Trust } from "@pagopa/io-react-native-wallet";
⋮----
import { WithCredentialMetadata } from "../../common/utils/ItwFailureTypes.ts";
import {
  isAssertionGenerationError,
  isFederationError
} from "../../common/utils/itwFailureUtils.ts";
import { InvalidTslCredentialStatus } from "../../statusList/utils/errors.ts";
import { CredentialIssuanceEvents } from "./events";
⋮----
export enum CredentialIssuanceFailureType {
  HARDWARE_KEY_INVALID = "HARDWARE_KEY_INVALID",
  INVALID_STATUS_BY_ASSERTION = "INVALID_STATUS_BY_ASSERTION",
  INVALID_STATUS_BY_TSL = "INVALID_STATUS_BY_TSL",
  ISSUER_GENERIC = "ISSUER_GENERIC",
  UNEXPECTED = "UNEXPECTED",
  UNTRUSTED_ISS = "UNTRUSTED_ISS",
  WALLET_PROVIDER_GENERIC = "WALLET_PROVIDER_GENERIC"
}
⋮----
export type CredentialIssuanceFailure =
  TypedCredentialIssuanceFailures[keyof TypedCredentialIssuanceFailures];
⋮----
type ReasonTypeByFailure = {
  [CredentialIssuanceFailureType.HARDWARE_KEY_INVALID]: IntegrityError;
  [CredentialIssuanceFailureType.INVALID_STATUS_BY_ASSERTION]: WithCredentialMetadata<Errors.IssuerResponseError>;
  [CredentialIssuanceFailureType.INVALID_STATUS_BY_TSL]: WithCredentialMetadata<InvalidTslCredentialStatus>;
  [CredentialIssuanceFailureType.ISSUER_GENERIC]: Errors.IssuerResponseError;
  [CredentialIssuanceFailureType.UNEXPECTED]: unknown;
  [CredentialIssuanceFailureType.UNTRUSTED_ISS]: Trust.Errors.FederationError;
  [CredentialIssuanceFailureType.WALLET_PROVIDER_GENERIC]: Errors.WalletProviderResponseError;
};
⋮----
type TypedCredentialIssuanceFailures = {
  [K in CredentialIssuanceFailureType]: {
    reason?: ReasonTypeByFailure[K];
    type: K;
  };
};
⋮----
export const mapEventToFailure = (
  event: CredentialIssuanceEvents
): CredentialIssuanceFailure =>
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/guards.ts">
import { ItwSessionExpiredError } from "../../api/client";
import { isWalletInstanceAttestationValid } from "../../common/utils/itwAttestationUtils";
import { itwCredentialsEidStatusSelector } from "../../credentials/store/selectors";
import { itwCredentialIntroContentSelector } from "../../credentialsCatalogue/store/selectors";
import { Context } from "./context";
import { CredentialIssuanceEvents } from "./events";
⋮----
type GuardArgs = {
  context: Context;
  event: CredentialIssuanceEvents;
};
⋮----
export const isSessionExpiredGuard = (
⋮----
export const hasValidWalletInstanceAttestationGuard = ({
  context
}: GuardArgs) =>
⋮----
export const isEidExpiredGuard = (
⋮----
export const hasCredentialIntroContentGuard = (
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/input.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
⋮----
import { Env } from "../../common/utils/environment";
import { MachineNavigation, MachineStore, MachineToast } from "../utils/deps";
⋮----
export type CredentialIssuanceMachineDeps = {
  env: Env;
  itwVersion: ItwVersion;
  navigation: MachineNavigation;
  store: MachineStore;
  toast: MachineToast;
};
⋮----
export type Input = { deps: CredentialIssuanceMachineDeps };
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/machine.ts">
import { and, assign, not } from "xstate";
⋮----
import { ItwTags } from "../tags";
import { InitialContext } from "./context";
import { itwCredentialSetup } from "./setup";
import { issuanceState } from "./state/issuance";
⋮----
export type ItwCredentialIssuanceMachine = typeof itwCredentialIssuanceMachine;
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/provider.tsx">
import { useIOToast } from "@io-app/design-system";
import { createActorContext } from "@xstate/react";
import { PropsWithChildren } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector, useIOStore } from "../../../../store/hooks";
import {
  selectItwEnv,
  selectItwSpecsVersion
} from "../../common/store/selectors/environment";
import { getEnv } from "../../common/utils/environment";
import { itwCredentialIssuanceMachine } from "./machine.ts";
⋮----
export const ItwCredentialIssuanceMachineProvider = (
  props: PropsWithChildren
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/selectors.ts">
import { StateFrom } from "xstate";
⋮----
import { CredentialFormat } from "../../common/utils/itwTypesUtils";
import { ItwTags } from "../tags";
import { ItwCredentialIssuanceMachine } from "./machine";
⋮----
type MachineSnapshot = StateFrom<ItwCredentialIssuanceMachine>;
⋮----
export const selectIsLoading = (snapshot: MachineSnapshot)
⋮----
export const selectIsIssuing = (snapshot: MachineSnapshot)
⋮----
export const selectCredentialType = (snapshot: MachineSnapshot)
⋮----
export const selectIssuerConfiguration = (snapshot: MachineSnapshot)
⋮----
export const selectRequestedCredential = (snapshot: MachineSnapshot)
⋮----
export const selectEvaluatedDcqlQuery = (snapshot: MachineSnapshot)
⋮----
export const selectRequiredClaims = (snapshot: MachineSnapshot)
⋮----
export const selectCredential = (snapshot: MachineSnapshot) =>
⋮----
export const selectFailure = (snapshot: MachineSnapshot)
⋮----
export const selectResolvedCredentialOffer = (snapshot: MachineSnapshot)
</file>

<file path="apps/main-app/ts/features/itwallet/machine/credential/setup.ts">
import { assign, setup } from "xstate";
⋮----
import { waitForSessionRefreshActor } from "../utils/actors";
import {
  closeIssuanceAction,
  handleSessionExpiredAction,
  navigateToCardOnboardingScreenAction,
  navigateToCredentialIntroductionScreenAction,
  navigateToCredentialPreviewScreenAction,
  navigateToEidVerificationExpiredScreenAction,
  navigateToFailureScreenAction,
  navigateToTrustIssuerScreenAction,
  navigateToWalletAction,
  onInitAction,
  storeCredentialAction,
  storeWalletInstanceAttestationAction,
  trackAddCredentialAction,
  trackCredentialIssuingDataShareAcceptedAction,
  trackCredentialIssuingDataShareAction,
  trackStartAddCredentialAction,
  trackStartCredentialReissuingAction
} from "./actions";
import {
  getWalletAttestationActor,
  obtainAccessTokenActor,
  obtainCredentialActor,
  obtainCredentialStatusActor,
  processCredentialOfferActor,
  requestCredentialActor,
  verifyTrustFederationActor,
  waitForCredentialsCatalogueActor
} from "./actors";
import { Context } from "./context";
import { CredentialIssuanceEvents } from "./events";
import { mapEventToFailure } from "./failure";
import {
  hasCredentialIntroContentGuard,
  hasValidWalletInstanceAttestationGuard,
  isEidExpiredGuard,
  isSessionExpiredGuard
} from "./guards";
import { Input } from "./input";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/state/cieId.ts">
import { assign } from "xstate";
⋮----
import { itwEidIssuanceMachineSetup } from "../setup";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/state/ciePin.ts">
import _ from "lodash";
import { assign } from "xstate";
⋮----
import { ItwTags } from "../../tags";
import { itwEidIssuanceMachineSetup } from "../setup";
import { cieWarningState } from "./cieWarning";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/state/cieWarning.ts">
import { itwEidIssuanceMachineSetup } from "../setup";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/state/credentialsUpgrade.ts">
import { assign } from "xstate";
⋮----
import { assert } from "../../../../../utils/assert.ts";
import { ItwTags } from "../../tags";
import { itwEidIssuanceMachineSetup } from "../setup";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/state/issuance.ts">
import { and, assign, or } from "xstate";
⋮----
import { ItwTags } from "../../tags";
import { IssuanceFailureType } from "../failure";
import { itwEidIssuanceMachineSetup } from "../setup";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/state/mrtdPoP.ts">
import { assign } from "xstate";
⋮----
import { assert } from "../../../../../utils/assert.ts";
import { ItwTags } from "../../tags";
import { itwEidIssuanceMachineSetup } from "../setup";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/state/spid.ts">
import { assign } from "xstate";
⋮----
import { ItwTags } from "../../tags";
import { itwEidIssuanceMachineSetup } from "../setup";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/state/userIdentification.ts">
import { itwEidIssuanceMachineSetup } from "../setup";
import { cieIdState } from "./cieId";
import { ciePinState } from "./ciePin";
import { spidState } from "./spid";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/actions.ts">
import I18n from "i18next";
import { ActionArgs, assertEvent, assign } from "xstate";
⋮----
import ROUTES from "../../../../navigation/routes";
import { assert } from "../../../../utils/assert";
import { isRouteInNavigationState } from "../../../../utils/navigation";
import { checkCurrentSession } from "../../../authentication/common/store/actions";
import {
  trackItWalletIDMethodSelected,
  trackItWalletIntroScreen,
  trackItwDeactivated,
  trackItwIdAuthenticationCompleted as trackItwIdAuthenticationCompletedEvent,
  trackItwIdVerifiedDocument as trackItwIdVerifiedDocumentEvent,
  trackSaveCredentialSuccess
} from "../../analytics";
import { itwMixPanelCredentialDetailsSelector } from "../../analytics/store/selectors";
import { toSurveyAuthMethod } from "../../analytics/utils";
import { toItwIdMethod } from "../../analytics/utils/types";
import { itwShowBanner } from "../../common/store/actions/banners";
import {
  itwSetAuthLevel,
  itwSetCredentialUpgradeFailed,
  itwSetIdentificationMode,
  itwSetL2Fallback,
  itwSetWalletActivationFeedbackBannerData
} from "../../common/store/actions/preferences";
import {
  itwSetActivationExitSurvey,
  itwSetFeedbackBottomSheetVisible
} from "../../common/store/actions/ui";
import { selectItwSpecsVersion } from "../../common/store/selectors/environment";
import { itwIsPidReissuingSurveyHiddenSelector } from "../../common/store/selectors/preferences";
import { itwCredentialsSelector } from "../../credentials/store/selectors";
import { itwFetchCredentialsCatalogue } from "../../credentialsCatalogue/store/actions";
import {
  itwRemoveIntegrityKeyTag,
  itwStoreIntegrityKeyTag
} from "../../issuance/store/actions";
import { itwIntegrityKeyTagSelector } from "../../issuance/store/selectors";
import { itwLifecycleWalletReset } from "../../lifecycle/store/actions";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
import { itwWalletInstanceAttestationStore } from "../../walletInstance/store/actions";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/selectors";
import { Context } from "./context";
import { EidIssuanceEvents } from "./events";
⋮----
type EidActionArgs = ActionArgs<Context, EidIssuanceEvents, EidIssuanceEvents>;
⋮----
export const navigateToTosScreenAction = (
⋮----
export const navigateToIpzsPrivacyScreenAction = ({
  context
}: EidActionArgs) =>
⋮----
export const navigateToIdentificationScreenAction = ({
  context
}: EidActionArgs) =>
⋮----
export const navigateToIdpSelectionScreenAction = ({
  context
}: EidActionArgs) =>
⋮----
export const navigateToSpidLoginScreenAction = (
⋮----
export const navigateToCieIdLoginScreenAction = ({
  context
}: EidActionArgs) =>
⋮----
export const navigateToEidPreviewScreenAction = ({
  context
}: EidActionArgs) =>
⋮----
export const navigateToSuccessScreenAction = (
⋮----
export const navigateToFailureScreenAction = (
⋮----
export const navigateToNfcInstructionsScreenAction = ({
  context
}: EidActionArgs) =>
⋮----
export const navigateToWalletAction = (
⋮----
export const navigateToCredentialCatalogAction = ({
  context
}: EidActionArgs) =>
⋮----
export const navigateToCieNfcPreparationScreenAction = ({
  context
}: EidActionArgs) =>
⋮----
export const navigateToCiePinPreparationScreenAction = ({
  context
}: EidActionArgs) =>
⋮----
export const navigateToCiePinScreenAction = (
⋮----
export const navigateToCieCardPreparationScreenAction = ({
  context
}: EidActionArgs) =>
... (78 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/actors.ts">
import { CieUtils } from "@pagopa/io-react-native-cie";
import { CredentialIssuance, ItwVersion } from "@pagopa/io-react-native-wallet";
import { fromPromise } from "xstate";
⋮----
import type {
  AuthenticationContext,
  CieContext,
  Context,
  EidIssuanceLevel,
  IdentificationContext,
  MrtdPoPContext
} from "./context";
⋮----
import { assert } from "../../../../utils/assert";
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
⋮----
import { trackItwRequest } from "../../analytics";
import { toItwIdMethod } from "../../analytics/utils/types";
import {
  getIntegrityHardwareKeyTag,
  getWalletInstanceAttestation,
  registerWalletInstance
} from "../../common/utils/itwAttestationUtils";
import { generateKeysWithKeyAttestation } from "../../common/utils/itwCredentialIssuanceUtils";
import { isAssertionGenerationError } from "../../common/utils/itwFailureUtils";
import { getIoWallet } from "../../common/utils/itwIoWallet";
⋮----
import { revokeCurrentWalletInstance } from "../../common/utils/itwRevocationUtils";
import { ensureIntegrityServiceIsStoreReadyOrThrow } from "../../common/utils/itwStoreUtils";
import {
  CredentialAccessToken,
  CredentialBundle,
  WalletInstanceAttestations
} from "../../common/utils/itwTypesUtils";
⋮----
import { itwCredentialsReplaceByType } from "../../credentials/store/actions";
import { CredentialsVault } from "../../credentials/utils/vault";
import {
  trackWalletInstanceRenewalFailure,
  trackWalletInstanceRenewalSuccess
} from "../../issuance/analytics";
import { itwStoreIntegrityKeyTag } from "../../issuance/store/actions";
import { itwIntegrityKeyTagSelector } from "../../issuance/store/selectors";
import { itwLifecycleStoresReset } from "../../lifecycle/store/actions";
import {
  getCredentialStatusFromStatusList,
  getKeysForStatusListToken
} from "../../statusList/utils";
import { StatusListRepository } from "../../statusList/utils/repository";
import {
  itwKeyAttestationsStore,
  itwSetWalletInstanceRenewalError,
  itwStoreWalletInstanceStatusList
} from "../../walletInstance/store/actions";
import { itwWalletInstanceRenewalErrorSelector } from "../../walletInstance/store/selectors";
import { EidIssuanceMachineDeps } from "./input";
⋮----
export type CreateWalletInstanceActorParams = WithItwVersion<{
  deps: EidIssuanceMachineDeps;
  isRenewal: boolean;
}>;
⋮----
export type GetWalletAttestationActorParams = WithItwVersion<{
  deps: EidIssuanceMachineDeps;
  integrityKeyTag: string | undefined;
}>;
⋮----
export type InitMrtdPoPChallengeActorParams = WithItwVersion<{
  authenticationContext: AuthenticationContext | undefined;
  deps: EidIssuanceMachineDeps;
  walletInstanceAttestation: string | undefined;
}>;
⋮----
export type ObtainEidStatusListActorInput = WithItwVersion<{
  eid: CredentialBundle | undefined;
}>;
⋮----
export type ObtainStatusListActorInput = Pick<
  Context,
  "itwVersion" | "keyAttestations"
> & {
  deps: EidIssuanceMachineDeps;
};
⋮----
export type ObtainStatusListActorOutput = Context["walletInstanceStatusList"];
⋮----
export type RequestAccessTokenActorParams = WithItwVersion<{
  authenticationContext: AuthenticationContext | undefined;
  deps: EidIssuanceMachineDeps;
  walletInstanceAttestation: string | undefined;
}>;
⋮----
export type RequestEidActorOutput = {
  credential: CredentialBundle;
  keyAttestations: Record<string, string>;
};
⋮----
export type RequestEidActorParams = WithItwVersion<{
  accessToken: CredentialAccessToken | undefined;
  authenticationContext: AuthenticationContext | undefined;
... (33 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/context.ts">
import type {
  AuthorizationDetail,
  CredentialIssuance,
  CredentialStatus,
  ItwVersion
} from "@pagopa/io-react-native-wallet";
⋮----
import type {
  CredentialAccessToken,
  CredentialBundle,
  CredentialMetadata,
  IssuerConfiguration,
  WalletInstanceAttestations
} from "../../common/utils/itwTypesUtils";
⋮----
import { IssuanceFailure } from "./failure";
import { EidIssuanceMachineDeps } from "./input";
⋮----
export type AuthenticationContext = {
  authUrl: string;
  callbackUrl: string;
  clientId: string;
  codeVerifier: string;
  credentialDefinition: AuthorizationDetail;
  issuerConf: IssuerConfiguration;
  redirectUri: string;
};
⋮----
export type CieContext = {
  isCIEAuthenticationSupported: boolean;
  isNFCEnabled: boolean;
};
⋮----
export type Context = {
  accessToken: CredentialAccessToken | undefined;
  authenticationContext: AuthenticationContext | undefined;
  cieContext: CieContext | undefined;
  credentialOfferUri: string | undefined;
  credentialsToUpgrade: ReadonlyArray<CredentialMetadata>;
  credentialType: string | undefined;
  deps: EidIssuanceMachineDeps;
  eid: CredentialBundle | undefined;
  failedCredentials: ReadonlyArray<CredentialMetadata> | undefined;
  failure: IssuanceFailure | undefined;
  identification: IdentificationContext | undefined;
  integrityKeyTag: string | undefined;
  itwVersion: ItwVersion;
  keyAttestations?: Record<string, string>;
  l2FallbackOrigin: undefined | { credentialType: string | undefined };
  level: EidIssuanceLevel | undefined;
  mode: EidIssuanceMode | undefined;
  mrtdContext: MrtdPoPContext | undefined;
  walletInstanceAttestation: undefined | WalletInstanceAttestations;
  walletInstanceStatusList?: {
    idx: number;
    parsedStatusList: CredentialStatus.StatusList;
    uri: string;
  };
};
⋮----
export type EidIssuanceLevel = "l2" | "l2-fallback" | "l3";
⋮----
export type EidIssuanceMode = "issuance" | "reissuance" | "upgrade";
⋮----
export type IdentificationContext =
  | { idpId: string; level: "L2"; mode: "spid" }
  | { level: "L2" | "L3"; mode: "cieId" }
  | { level: "L3"; mode: "ciePin"; pin: string };
⋮----
export type MrtdPoPContext = {
  callbackUrl?: string;
  can?: string | undefined;
  challenge: string;
  ias?: CredentialIssuance.MRTDPoP.IasPayload | undefined;
  mrtd?: CredentialIssuance.MRTDPoP.MrtdPayload | undefined;
  mrtd_auth_session: string;
  mrtd_pop_nonce: string;
  validationUrl: string;
};
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/events.ts">
import { InternalAuthAndMrtdResponse } from "@pagopa/io-react-native-cie";
import { DoneActorEvent, ErrorActorEvent } from "xstate";
⋮----
import type { IssuanceFailure } from "./failure";
⋮----
import { SpidIdp } from "../../../../utils/idps";
import { EidActivationExitStep } from "../../common/hooks/useItwActivationExitSurveyBottomSheet";
import { CieWarningType } from "../../identification/cie/utils/types";
import { Output } from "../upgrade/output";
import { EidIssuanceLevel, EidIssuanceMode } from "./context";
⋮----
export type EidIssuanceEvents =
  | Abort
  | AcceptIpzsPrivacy
  | AcceptTos
  | AddNewCredential
  | AddToWallet
  | Back
  | CieCanEntered
  | CiePinEntered
  | Close
  | DoneActorEvent<Output, "credentialUpgradeMachine">
  | ErrorActorEvent
  | ExternalErrorEvent
  | GoToCieWarning
  | GoToWallet
  | MrtdChallengedSigned
  | MrtdPoPVerificationCompleted
  | Next
  | NfcEnabled
  | Reset
  | Retry
  | RevokeWalletInstance
  | SelectIdentificationMode
  | SelectSpidIdp
  | SessionRefreshComplete
  | SimulateFailure
  | Start
  | UserIdentificationCompleted;
⋮----
type Abort = {
  type: "abort";
};
⋮----
type AcceptIpzsPrivacy = {
  type: "accept-ipzs-privacy";
};
⋮----
type AcceptTos = {
  type: "accept-tos";
};
⋮----
type AddNewCredential = {
  type: "add-new-credential";
};
⋮----
type AddToWallet = {
  type: "add-to-wallet";
};
⋮----
type Back = {
  type: "back";
};
⋮----
type CieCanEntered = {
  can: string;
  type: "cie-can-entered";
};
⋮----
type CiePinEntered = {
  pin: string;
  type: "cie-pin-entered";
};
⋮----
type Close = {
  surveyStep?: EidActivationExitStep;
  type: "close";
};
⋮----
type ExternalErrorEvent = {
  error?: Error;
  scope:
    | "cie-auth"
    | "cie-mrtd-pop"
    | "cieid-login"
    | "ipzs-privacy"
    | "spid-login";
  type: "error";
};
⋮----
type GoToCieWarning = {
  routeName: string;
  type: "go-to-cie-warning";
  warning: CieWarningType;
};
⋮----
type GoToWallet = {
  type: "go-to-wallet";
};
⋮----
... (64 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/failure.ts">
import { CryptoError } from "@pagopa/io-react-native-crypto";
import { type IntegrityError } from "@pagopa/io-react-native-integrity";
import { Errors, Trust } from "@pagopa/io-react-native-wallet";
⋮----
import {
  isAnprPid404Failure,
  isAssertionGenerationError,
  isFederationError,
  isLocalIntegrityError,
  isMrtdTaxIdCodeMismatchFailure,
  isWebViewError
} from "../../common/utils/itwFailureUtils";
import { type WebViewError } from "../../identification/cie/utils/error";
import { type EidIssuanceEvents } from "./events";
⋮----
export enum IssuanceFailureType {
  CIE_NOT_MATCHING_AUTHENTICATION_IDENTITY = "CIE_NOT_MATCHING_AUTHENTICATION_IDENTITY",
  CIE_NOT_REGISTERED = "CIE_NOT_REGISTERED",
  HARDWARE_KEY_INVALID = "HARDWARE_KEY_INVALID",
  ISSUER_GENERIC = "ISSUER_GENERIC",
  MRTD_CHALLENGE_INIT_ERROR = "MRTD_CHALLENGE_INIT_ERROR",
  NOT_MATCHING_IDENTITY = "NOT_MATCHING_IDENTITY",
  PID_ANPR_CREDENTIAL_NOT_FOUND = "PID_ANPR_CREDENTIAL_NOT_FOUND",
  UNEXPECTED = "UNEXPECTED",
  UNSUPPORTED_DEVICE = "UNSUPPORTED_DEVICE",
  UNTRUSTED_ISS = "UNTRUSTED_ISS",
  WALLET_PROVIDER_GENERIC = "WALLET_PROVIDER_GENERIC",
  WALLET_REVOCATION_ERROR = "WALLET_REVOCATION_ERROR"
}
⋮----
export type IssuanceFailure =
  TypedIssuanceFailures[keyof TypedIssuanceFailures];
⋮----
type ReasonTypeByFailure = {
  [IssuanceFailureType.CIE_NOT_MATCHING_AUTHENTICATION_IDENTITY]: Errors.IssuerResponseError;
  [IssuanceFailureType.CIE_NOT_REGISTERED]: string;
  [IssuanceFailureType.HARDWARE_KEY_INVALID]: IntegrityError;
  [IssuanceFailureType.ISSUER_GENERIC]:
    | Error
    | Errors.IssuerResponseError
    | WebViewError;
  [IssuanceFailureType.MRTD_CHALLENGE_INIT_ERROR]: Errors.IssuerResponseError;
  [IssuanceFailureType.NOT_MATCHING_IDENTITY]: string;
  [IssuanceFailureType.PID_ANPR_CREDENTIAL_NOT_FOUND]: Errors.IssuerResponseError;
  [IssuanceFailureType.UNEXPECTED]: unknown;
  [IssuanceFailureType.UNSUPPORTED_DEVICE]:
    | CryptoError
    | Errors.WalletProviderResponseError
    | IntegrityError;
  [IssuanceFailureType.UNTRUSTED_ISS]: Trust.Errors.FederationError;
  [IssuanceFailureType.WALLET_PROVIDER_GENERIC]: Errors.WalletProviderResponseError;
  [IssuanceFailureType.WALLET_REVOCATION_ERROR]: unknown;
};
⋮----
type TypedIssuanceFailures = {
  [K in IssuanceFailureType]: { reason: ReasonTypeByFailure[K]; type: K };
};
⋮----
export const mapEventToFailure = (
  event: EidIssuanceEvents
): IssuanceFailure =>
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/guards.ts">
import { profileFiscalCodeSelector } from "../../../settings/common/store/selectors";
import { ItwSessionExpiredError } from "../../api/client";
import {
  isWalletInstanceAttestationForSpecs,
  isWalletInstanceAttestationValid
} from "../../common/utils/itwAttestationUtils";
import { getFiscalCodeFromCredential } from "../../common/utils/itwClaimsUtils";
import { itwLifecycleIsValidSelector } from "../../lifecycle/store/selectors";
import { Context } from "./context";
import { EidIssuanceEvents } from "./events";
⋮----
type GuardArgs = {
  context: Context;
  event: EidIssuanceEvents;
};
⋮----
export const issuedEidMatchesAuthenticatedUserGuard = ({
  context
}: GuardArgs) =>
⋮----
export const isSessionExpiredGuard = (
⋮----
export const hasValidWalletInstanceAttestationGuard = ({
  context
}: GuardArgs) =>
⋮----
export const hasWalletInstanceForSpecsGuard = (
⋮----
export const isWalletValidGuard = (
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/input.ts">
import { Env } from "../../common/utils/environment";
import { MachineNavigation, MachineStore, MachineToast } from "../utils/deps";
⋮----
export type EidIssuanceMachineDeps = {
  env: Env;
  navigation: MachineNavigation;
  store: MachineStore;
  toast: MachineToast;
};
⋮----
export type Input = {
  deps: EidIssuanceMachineDeps;
};
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/machine.ts">
import { and, assertEvent, assign, not, or, raise } from "xstate";
⋮----
import { CURRENT_ITW_SPECS_VERSION } from "../../common/utils/constants";
import { getIssuanceItwVersion } from "../../common/utils/itwIssuanceUtils";
import { ItwTags } from "../tags";
import { InitialContext } from "./context";
import { IssuanceFailureType } from "./failure";
import { itwEidIssuanceMachineSetup } from "./setup";
import { credentialsUpgradeState } from "./state/credentialsUpgrade";
import { issuanceState } from "./state/issuance";
import { mrtdPoPState } from "./state/mrtdPoP";
import { userIdentificationState } from "./state/userIdentification";
⋮----
export type ItwEidIssuanceMachine = typeof itwEidIssuanceMachine;
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/provider.tsx">
import { useIOToast } from "@io-app/design-system";
import { createActorContext } from "@xstate/react";
import { PropsWithChildren } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector, useIOStore } from "../../../../store/hooks";
import { selectItwEnv } from "../../common/store/selectors/environment";
import { getEnv } from "../../common/utils/environment";
import { itwEidIssuanceMachine } from "./../eid/machine";
⋮----
export const ItwEidIssuanceMachineProvider = (props: PropsWithChildren) =>
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/selectors.ts">
import { StateFrom } from "xstate";
⋮----
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { ItwTags } from "../tags";
import { IdentificationContext } from "./context";
import { ItwEidIssuanceMachine } from "./machine";
⋮----
type MachineSnapshot = StateFrom<ItwEidIssuanceMachine>;
⋮----
export const selectIssuanceMode = (snapshot: MachineSnapshot)
⋮----
export const selectIssuanceLevel = (snapshot: MachineSnapshot)
⋮----
export const selectCanGoBackToL3Identification = (snapshot: MachineSnapshot)
⋮----
export const isL3FeaturesEnabledSelector = (snapshot: MachineSnapshot)
⋮----
export const selectEid = (snapshot: MachineSnapshot)
⋮----
export const selectFailure = (snapshot: MachineSnapshot)
⋮----
export const isNFCEnabledSelector = (snapshot: MachineSnapshot)
⋮----
export const isCIEAuthenticationSupportedSelector = (
  snapshot: MachineSnapshot
)
⋮----
export const selectIdentification = (snapshot: MachineSnapshot)
⋮----
export const selectCiePin = (snapshot: MachineSnapshot) =>
⋮----
export const selectAuthUrl = (snapshot: MachineSnapshot)
⋮----
export const selectMrtdCallbackUrl = (snapshot: MachineSnapshot)
⋮----
export const selectIsLoading = (snapshot: MachineSnapshot)
⋮----
export const selectCanRenderEidPreview = (snapshot: MachineSnapshot)
⋮----
export const selectUpgradeFailedCredentials = (
⋮----
export const selectCredentialType = (snapshot: MachineSnapshot)
⋮----
export const selectCredentialOfferUri = (snapshot: MachineSnapshot)
⋮----
export const hasCredentialsToUpgrade = (snapshot: MachineSnapshot)
</file>

<file path="apps/main-app/ts/features/itwallet/machine/eid/setup.ts">
import { assertEvent, assign, setup } from "xstate";
⋮----
import { assert } from "../../../../utils/assert";
import { isMrtdPoPChallengeRequired } from "../../common/utils/mrtdUrl";
import { itwCredentialUpgradeMachine } from "../upgrade/machine";
import { waitForSessionRefreshActor } from "../utils/actors";
import {
  cleanupIntegrityKeyTagAction,
  closeIssuanceAction,
  handleSessionExpiredAction,
  navigateToCieAuthenticationScreenAction,
  navigateToCieCanPreparationScreenAction,
  navigateToCieCanScreenAction,
  navigateToCieCardPreparationScreenAction,
  navigateToCieIdLoginScreenAction,
  navigateToCieInternalAuthAndMrtdScreenAction,
  navigateToCieNfcPreparationScreenAction,
  navigateToCiePinPreparationScreenAction,
  navigateToCiePinScreenAction,
  navigateToCieWarningScreenAction,
  navigateToCredentialCatalogAction,
  navigateToEidPreviewScreenAction,
  navigateToFailureScreenAction,
  navigateToIdentificationScreenAction,
  navigateToIdpSelectionScreenAction,
  navigateToIpzsPrivacyScreenAction,
  navigateToNfcInstructionsScreenAction,
  navigateToSpidLoginScreenAction,
  navigateToSuccessScreenAction,
  navigateToTosScreenAction,
  navigateToWalletAction,
  navigateToWalletRevocationScreenAction,
  onInitAction,
  refreshCredentialsCatalogueAction,
  resetWalletInstanceAction,
  storeAuthLevelAction,
  storeCredentialUpgradeFailuresAction,
  storeIntegrityKeyTagAction,
  storeL2FallbackAction,
  storeWalletActivationFeedbackBannerDataAction,
  storeWalletInstanceAttestationAction,
  trackIdentificationMethodSelectedAction,
  trackIntroScreenAction,
  trackItwIdAuthenticationCompletedAction,
  trackItwIdVerifiedDocumentAction,
  trackWalletInstanceCreationAction,
  trackWalletInstanceRevocationAction
} from "./actions";
import {
  createWalletInstanceActor,
  getCieStatusActor,
  getWalletAttestationActor,
  initMrtdPoPChallengeActor,
  obtainEidStatusListActor,
  obtainStatusListActor,
  requestAccessTokenActor,
  requestEidActor,
  revokeWalletInstanceActor,
  startAuthFlowActor,
  storeEidCredentialActor,
  validateMrtdPoPChallengeActor,
  verifyTrustFederationActor
} from "./actors";
import { Context, IdentificationContext } from "./context";
import { EidIssuanceEvents } from "./events";
import { mapEventToFailure } from "./failure";
import {
  hasValidWalletInstanceAttestationGuard,
  hasWalletInstanceForSpecsGuard,
  isSessionExpiredGuard,
  issuedEidMatchesAuthenticatedUserGuard,
  isWalletValidGuard
} from "./guards";
import { Input } from "./input";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/upgrade/actions.ts">
import { ActionArgs, assertEvent } from "xstate";
⋮----
import { checkCurrentSession } from "../../../authentication/common/store/actions";
import { itwCredentialsReplaceByType } from "../../credentials/store/actions";
import { itwKeyAttestationsStore } from "../../walletInstance/store/actions";
import { Context } from "./context";
import { CredentialUpgradeEvents } from "./events";
⋮----
export const storeCredentialAction = ({
  context,
  event
}: ActionArgs<Context, CredentialUpgradeEvents, CredentialUpgradeEvents>) =>
⋮----
export const handleSessionExpiredAction = ({
  context
}: ActionArgs<Context, CredentialUpgradeEvents, CredentialUpgradeEvents>)
</file>

<file path="apps/main-app/ts/features/itwallet/machine/upgrade/actors.ts">
import type {
  CredentialIssuance,
  ItwVersion
} from "@pagopa/io-react-native-wallet";
⋮----
import { fromPromise } from "xstate";
⋮----
import { assert } from "../../../../utils/assert";
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
⋮----
import { getRepresentativeVaultId } from "../../common/utils/itwCredentialUtils";
import { getIoWallet } from "../../common/utils/itwIoWallet";
import { ensureIntegrityServiceIsStoreReadyOrThrow } from "../../common/utils/itwStoreUtils";
import {
  CredentialAccessToken,
  CredentialBundle,
  CredentialFormat,
  CredentialMetadata,
  IssuerConfiguration,
  WalletInstanceAttestations
} from "../../common/utils/itwTypesUtils";
import { itwCredentialsEidSelector } from "../../credentials/store/selectors";
import { CredentialsVault } from "../../credentials/utils/vault";
import { itwIntegrityKeyTagSelector } from "../../issuance/store/selectors";
import { getCredentialStatusFromStatusList } from "../../statusList/utils";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/selectors";
import { EidIssuanceMode } from "../eid/context";
import { CredentialUpgradeMachineDeps } from "./input";
⋮----
export type LoadContextInput = {
  deps: CredentialUpgradeMachineDeps;
};
⋮----
export type LoadContextOutput = {
  integrityKeyTag: string;
  pid: CredentialBundle;
  walletInstanceAttestation: WalletInstanceAttestations;
};
⋮----
export type RequestAccessTokenOutput = {
  accessToken: CredentialAccessToken;
  clientId: string;
  issuerConf: IssuerConfiguration;
};
⋮----
export type RequestAccessTokenParams = WithItwVersion<{
  credential: CredentialMetadata;
  deps: CredentialUpgradeMachineDeps;
  issuanceMode: EidIssuanceMode;
  pid: CredentialBundle | undefined;
  walletInstanceAttestation: string | undefined;
}>;
⋮----
export type UpgradeCredentialOutput = {
  credentials: ReadonlyArray<CredentialBundle>;
  credentialType: string;
  keyAttestations: Record<string, string>;
};
⋮----
export type UpgradeCredentialParams = WithItwVersion<
  Partial<RequestAccessTokenOutput> & {
    credential: CredentialMetadata;
    deps: CredentialUpgradeMachineDeps;
    integrityKeyTag: string | undefined;
  }
>;
⋮----
type WithItwVersion<T = { [K: string]: any }> = T & {
  itwVersion: ItwVersion;
};
⋮----
const enrichBundlesWithStatusList = async (
  itwVersion: ItwVersion,
  issuerConf: IssuerConfiguration,
  bundles: ReadonlyArray<CredentialBundle>
): Promise<ReadonlyArray<CredentialBundle>> =>
</file>

<file path="apps/main-app/ts/features/itwallet/machine/upgrade/context.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
⋮----
import {
  CredentialAccessToken,
  CredentialBundle,
  CredentialMetadata,
  IssuerConfiguration,
  WalletInstanceAttestations
} from "../../common/utils/itwTypesUtils";
import { EidIssuanceMode } from "../eid/context";
import { CredentialUpgradeMachineDeps, Input } from "./input";
⋮----
export type Context = {
  accessToken: CredentialAccessToken | undefined;
  clientId: string | undefined;
  credentialIndex: number;
  credentials: ReadonlyArray<CredentialMetadata>;
  deps: CredentialUpgradeMachineDeps;
  failedCredentials: ReadonlyArray<CredentialMetadata>;
  integrityKeyTag: string | undefined;
  issuanceMode: EidIssuanceMode;
  issuerConf: IssuerConfiguration | undefined;
  itwVersion: ItwVersion;
  pid: CredentialBundle | undefined;
  walletInstanceAttestation: undefined | WalletInstanceAttestations;
};
⋮----
export const getInitialContext = (input: Input): Context => (
</file>

<file path="apps/main-app/ts/features/itwallet/machine/upgrade/events.ts">
import { DoneActorEvent, ErrorActorEvent } from "xstate";
⋮----
import { UpgradeCredentialOutput } from "./actors";
⋮----
export type CredentialUpgradeEvents =
  | DoneActorEvent<UpgradeCredentialOutput, "upgradeCredential">
  | ErrorActorEvent
  | SessionRefreshComplete;
⋮----
type SessionRefreshComplete = {
  type: "session-refresh-complete";
};
</file>

<file path="apps/main-app/ts/features/itwallet/machine/upgrade/failure.ts">
import { Errors } from "@pagopa/io-react-native-wallet";
⋮----
import {
  CredentialIssuanceFailure,
  CredentialIssuanceFailureType
} from "../credential/failure";
import { CredentialUpgradeEvents } from "../upgrade/events";
⋮----
export const mapUpgradeEventToFailure = (
  event: CredentialUpgradeEvents
): CredentialIssuanceFailure =>
</file>

<file path="apps/main-app/ts/features/itwallet/machine/upgrade/input.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
⋮----
import { Env } from "../../common/utils/environment";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { EidIssuanceMode } from "../eid/context";
import { MachineStore } from "../utils/deps";
⋮----
export type CredentialUpgradeMachineDeps = {
  env: Env;
  store: MachineStore;
};
⋮----
export type Input = {
  credentials: ReadonlyArray<CredentialMetadata>;
  deps: CredentialUpgradeMachineDeps;
  issuanceMode: EidIssuanceMode;
  itwVersion: ItwVersion;
};
</file>

<file path="apps/main-app/ts/features/itwallet/machine/upgrade/machine.ts">
import { assign } from "xstate";
⋮----
import { getInitialContext } from "./context";
import { itwUpgradeSetup } from "./setup";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/upgrade/output.ts">
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
⋮----
export type Output = {
  failedCredentials: ReadonlyArray<
    CredentialMetadata & {
      failure?: {
        reason: unknown;
        type: string;
      };
    }
  >;
};
</file>

<file path="apps/main-app/ts/features/itwallet/machine/upgrade/setup.ts">
import { assign, setup } from "xstate";
⋮----
import { ItwSessionExpiredError } from "../../api/client";
import { waitForSessionRefreshActor } from "../utils/actors";
import { handleSessionExpiredAction, storeCredentialAction } from "./actions";
import {
  loadContextActor,
  requestAccessTokenActor,
  upgradeCredentialActor
} from "./actors";
import { Context } from "./context";
import { CredentialUpgradeEvents } from "./events";
import { mapUpgradeEventToFailure } from "./failure";
import { Input } from "./input";
import { Output } from "./output";
</file>

<file path="apps/main-app/ts/features/itwallet/machine/utils/actors.ts">
import { fromCallback } from "xstate";
⋮----
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { MachineStore } from "./deps";
⋮----
export type WaitForSessionRefreshInput = {
  deps: {
    store: MachineStore;
  };
};
</file>

<file path="apps/main-app/ts/features/itwallet/machine/utils/deps.ts">
import { IOToast } from "@io-app/design-system";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { GlobalState } from "../../../../store/reducers/types";
⋮----
export type MachineNavigation = Pick<
  IONavigation,
  | "canGoBack"
  | "getState"
  | "goBack"
  | "navigate"
  | "pop"
  | "popTo"
  | "popToTop"
  | "replace"
  | "reset"
>;
⋮----
export type MachineStore = {
  dispatch(action: unknown): unknown;
  getState(): GlobalState;
  subscribe(listener: () => void): () => void;
};
⋮----
dispatch(action: unknown): unknown;
getState(): GlobalState;
subscribe(listener: ()
⋮----
export type MachineToast = Pick<IOToast, "error" | "success">;
⋮----
type IONavigation = ReturnType<typeof useIONavigation>;
</file>

<file path="apps/main-app/ts/features/itwallet/machine/utils/testDeps.ts">
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { getEnv } from "../../common/utils/environment";
import { ProximityMachineDeps } from "../../presentation/proximity/machine/input";
import { RemoteMachineDeps } from "../../presentation/remote/machine/input";
import { TrustmarkMachineDeps } from "../../trustmark/machine/input";
import { CredentialIssuanceMachineDeps } from "../credential/input";
import { EidIssuanceMachineDeps } from "../eid/input";
import { CredentialUpgradeMachineDeps } from "../upgrade/input";
import { MachineNavigation, MachineStore, MachineToast } from "./deps";
⋮----
const noop = ()
⋮----
export const testMachineStore = (
  store: Partial<MachineStore> = {}
): MachineStore => (
⋮----
const testMachineNavigation = (
  navigation: Partial<MachineNavigation> = {}
): MachineNavigation => (
⋮----
export const testMachineToast = (
  toast: Partial<MachineToast> = {}
): MachineToast => (
⋮----
export const testEidIssuanceDeps = (
  overrides: Partial<EidIssuanceMachineDeps> = {}
): EidIssuanceMachineDeps => (
⋮----
export const testCredentialIssuanceDeps = (
  overrides: Partial<CredentialIssuanceMachineDeps> = {}
): CredentialIssuanceMachineDeps => (
⋮----
export const testCredentialUpgradeDeps = (
  overrides: Partial<CredentialUpgradeMachineDeps> = {}
): CredentialUpgradeMachineDeps => (
⋮----
export const testProximityDeps = (
  overrides: Partial<ProximityMachineDeps> = {}
): ProximityMachineDeps => (
⋮----
export const testRemoteDeps = (
  overrides: Partial<RemoteMachineDeps> = {}
): RemoteMachineDeps => (
⋮----
export const testTrustmarkDeps = (
  overrides: Partial<TrustmarkMachineDeps> = {}
): TrustmarkMachineDeps => (
</file>

<file path="apps/main-app/ts/features/itwallet/machine/tags.ts">
export enum ItwTags {
  Issuing = "Issuing",
  Loading = "Loading"
}
</file>

<file path="apps/main-app/ts/features/itwallet/navigation/ItwParamsList.ts">
import { useNavigation } from "@react-navigation/native";
⋮----
import { IOStackNavigationProp } from "../../../navigation/params/AppParamsList";
import { ItwDiscoveryInfoScreenNavigationParams } from "../discovery/screens/ItwDiscoveryInfoScreen";
import { ItwCieInternalAuthAndMrtdScreenParams } from "../identification/cie/screens/ItwCieInternalAuthAndMrtdScreen.tsx";
import { ItwIdentificationCieWarningScreenNavigationParams } from "../identification/cie/screens/ItwIdentificationCieWarningScreen.tsx";
import { ItwIdentificationNavigationParams } from "../identification/common/screens/ItwIdentificationModeSelectionScreen.tsx";
import { ItwIssuanceCredentialIntroductionNavigationParams } from "../issuance/screens/ItwIssuanceCredentialIntroductionScreen.tsx";
import { ItwIssuanceCredentialLandingScreenNavigationParams } from "../issuance/screens/ItwIssuanceCredentialLandingScreen.tsx";
import { ItwIssuanceCredentialTrustIssuerNavigationParams } from "../issuance/screens/ItwIssuanceCredentialTrustIssuerScreen";
import { ItwIssuanceCredentialOfferScreenNavigationParams } from "../offer/screens/ItwIssuanceCredentialOfferIntro.tsx";
import { ItwCardOnboardingL3NavigationParams } from "../onboarding/screens/ItwCardOnboardingL3Screen.tsx";
import { ItwPlaygroundParamsList } from "../playgrounds/navigation/ItwPlaygroundParamsList.ts";
import { ItwPresentationCredentialAttachmentNavigationParams } from "../presentation/details/screens/ItwPresentationCredentialAttachmentScreen";
import { ItwPresentationCredentialCardModalNavigationParams } from "../presentation/details/screens/ItwPresentationCredentialCardModal";
import { ItwPresentationCredentialDetailNavigationParams } from "../presentation/details/screens/ItwPresentationCredentialDetailScreen";
import { ItwConsentManagementDetailScreenNavigationParams } from "../presentation/proximity/screens/ItwConsentManagementDetailScreen";
import { ItwConsentManagementScreenNavigationParams } from "../presentation/proximity/screens/ItwConsentManagementScreen";
import { ItwConsentRevocationSuccessScreenNavigationParams } from "../presentation/proximity/screens/ItwConsentRevocationSuccessScreen";
import { ItwCredentialTrustmarkScreenNavigationParams } from "../trustmark/screens/ItwCredentialTrustmarkScreen";
import { ITW_ROUTES } from "./routes";
⋮----
export type ItwParamsList = ItwPlaygroundParamsList & {
  [ITW_ROUTES.DISCOVERY.ALREADY_ACTIVE_SCREEN]: undefined;
  [ITW_ROUTES.DISCOVERY.INFO]:
    | ItwDiscoveryInfoScreenNavigationParams
    | undefined;
  [ITW_ROUTES.DISCOVERY.IPZS_PRIVACY]: undefined;
  [ITW_ROUTES.IDENTIFICATION.CIE.ACTIVATE_NFC]: undefined;
  [ITW_ROUTES.IDENTIFICATION.CIE.AUTH_SCREEN]: undefined;
  [ITW_ROUTES.IDENTIFICATION.CIE.CAN_SCREEN]: undefined;
  [ITW_ROUTES.IDENTIFICATION.CIE
    .INTERNAL_AUTH_MRTD_SCREEN]: ItwCieInternalAuthAndMrtdScreenParams;
  [ITW_ROUTES.IDENTIFICATION.CIE.PIN_SCREEN]: undefined;
  [ITW_ROUTES.IDENTIFICATION.CIE.PREPARATION.CAN_SCREEN]: undefined;
  [ITW_ROUTES.IDENTIFICATION.CIE.PREPARATION.CARD_SCREEN]: undefined;
  [ITW_ROUTES.IDENTIFICATION.CIE.PREPARATION.NFC_SCREEN]: undefined;
  [ITW_ROUTES.IDENTIFICATION.CIE.PREPARATION.PIN_SCREEN]: undefined;
  [ITW_ROUTES.IDENTIFICATION.CIE_ID.LOGIN]: undefined;
  [ITW_ROUTES.IDENTIFICATION
    .CIE_WARNING]: ItwIdentificationCieWarningScreenNavigationParams;
  [ITW_ROUTES.IDENTIFICATION.IDP_SELECTION]: undefined;
  [ITW_ROUTES.IDENTIFICATION.MODE_SELECTION]: ItwIdentificationNavigationParams;
  [ITW_ROUTES.IDENTIFICATION.SPID.LOGIN]: undefined;
  [ITW_ROUTES.IDENTITY_NOT_MATCHING_SCREEN]: undefined;
  [ITW_ROUTES.ISSUANCE.CREDENTIAL_FAILURE]: undefined;
  [ITW_ROUTES.ISSUANCE.CREDENTIAL_INTRODUCTION]:
    | ItwIssuanceCredentialIntroductionNavigationParams
    | undefined;
  [ITW_ROUTES.ISSUANCE
    .CREDENTIAL_OFFER_INTRO]: ItwIssuanceCredentialOfferScreenNavigationParams;
  [ITW_ROUTES.ISSUANCE.CREDENTIAL_PREVIEW]: undefined;
  [ITW_ROUTES.ISSUANCE.CREDENTIAL_TRUST_ISSUER]:
    | ItwIssuanceCredentialTrustIssuerNavigationParams
    | undefined;
  [ITW_ROUTES.ISSUANCE.EID_FAILURE]: undefined;
  [ITW_ROUTES.ISSUANCE.EID_PREVIEW]: undefined;
  [ITW_ROUTES.ISSUANCE.EID_RESULT]: undefined;
  [ITW_ROUTES.ISSUANCE.UPCOMING_CREDENTIAL]: undefined;
  [ITW_ROUTES.L2_ONBOARDING]: undefined;
  [ITW_ROUTES.L3_ONBOARDING]: ItwCardOnboardingL3NavigationParams | undefined;
  [ITW_ROUTES.LANDING.CREDENTIAL_ASYNC_FLOW_CONTINUATION]: undefined;
  [ITW_ROUTES.LANDING
    .CREDENTIAL_ISSUANCE]: ItwIssuanceCredentialLandingScreenNavigationParams;
  [ITW_ROUTES.LANDING.DISCOVERY]: undefined;
  [ITW_ROUTES.LANDING.EID_REISSUANCE]: undefined;
  [ITW_ROUTES.OFFLINE.WALLET]: undefined;
  [ITW_ROUTES.ONBOARDING]: undefined;
  [ITW_ROUTES.PRESENTATION
    .CONSENT_MANAGEMENT]: ItwConsentManagementScreenNavigationParams;
  [ITW_ROUTES.PRESENTATION
    .CONSENT_MANAGEMENT_DETAIL]: ItwConsentManagementDetailScreenNavigationParams;
  [ITW_ROUTES.PRESENTATION
    .CONSENT_REVOCATION_SUCCESS]: ItwConsentRevocationSuccessScreenNavigationParams;
  [ITW_ROUTES.PRESENTATION
    .CREDENTIAL_ATTACHMENT]: ItwPresentationCredentialAttachmentNavigationParams;
  [ITW_ROUTES.PRESENTATION
    .CREDENTIAL_CARD_MODAL]: ItwPresentationCredentialCardModalNavigationParams;
  [ITW_ROUTES.PRESENTATION
    .CREDENTIAL_DETAIL]: ItwPresentationCredentialDetailNavigationParams;
  [ITW_ROUTES.PRESENTATION.CREDENTIAL_FISCAL_CODE_MODAL]: undefined;
  [ITW_ROUTES.PRESENTATION
    .CREDENTIAL_TRUSTMARK]: ItwCredentialTrustmarkScreenNavigationParams;
  [ITW_ROUTES.PRESENTATION.EID_VERIFICATION_EXPIRED]: undefined;
  [ITW_ROUTES.PRESENTATION.PID_DETAIL]: undefined;
  [ITW_ROUTES.SETTINGS]: undefined;
  [ITW_ROUTES.WALLET_REVOCATION_SCREEN]: undefined;
};
⋮----
export const useItwNavigation = ()
</file>

<file path="apps/main-app/ts/features/itwallet/navigation/ItwStackNavigator.tsx">
import {
  createStackNavigator,
  TransitionPresets
} from "@react-navigation/stack";
import { ComponentType, memo } from "react";
⋮----
import { useIOSelector } from "../../../store/hooks";
import {
  isBackNavigationAction,
  isGestureEnabled
} from "../../../utils/navigation";
import { ItwGenericErrorContent } from "../common/components/ItwGenericErrorContent";
import { isItwEnabledSelector } from "../common/store/selectors/remoteConfig";
import { ItwDiscoveryInfoFallbackComponent } from "../discovery/components/ItwDiscoveryInfoFallbackComponent.tsx";
import { ItwAlreadyActiveScreen } from "../discovery/screens/ItwAlreadyActiveScreen.tsx";
import { ItwDiscoveryInfoScreen } from "../discovery/screens/ItwDiscoveryInfoScreen";
import { ItwDiscoveryLandingScreen } from "../discovery/screens/ItwDiscoveryLandingScreen.tsx";
import ItwIpzsPrivacyScreen from "../discovery/screens/ItwIpzsPrivacyScreen";
import { ItwActivateNfcScreen } from "../identification/cie/screens/ItwActivateNfcScreen.tsx";
import { ItwCieAuthenticationScreen } from "../identification/cie/screens/ItwCieAuthenticationScreen.tsx";
import { ItwCieCanScreen } from "../identification/cie/screens/ItwCieCanScreen.tsx";
import { ItwCieInternalAuthAndMrtdScreen } from "../identification/cie/screens/ItwCieInternalAuthAndMrtdScreen.tsx";
import { ItwCiePinScreen } from "../identification/cie/screens/ItwCiePinScreen.tsx";
import { ItwCiePreparationCanScreen } from "../identification/cie/screens/ItwCiePreparationCanScreen.tsx";
import { ItwCiePreparationCardScreen } from "../identification/cie/screens/ItwCiePreparationCardScreen.tsx";
import { ItwCiePreparationNfcScreen } from "../identification/cie/screens/ItwCiePreparationNfcScreen.tsx";
import { ItwCiePreparationPinScreen } from "../identification/cie/screens/ItwCiePreparationPinScreen.tsx";
import { ItwIdentificationCieWarningScreen } from "../identification/cie/screens/ItwIdentificationCieWarningScreen.tsx";
import ItwCieIdLoginScreen from "../identification/cieId/screens/ItwCieIdLoginScreen.tsx";
import { ItwIdentificationModeSelectionScreen } from "../identification/common/screens/ItwIdentificationModeSelectionScreen.tsx";
import { ItwIdentificationIdpSelectionScreen } from "../identification/spid/screens/ItwIdentificationIdpSelectionScreen.tsx";
import ItwSpidIdpLoginScreen from "../identification/spid/screens/ItwSpidIdpLoginScreen.tsx";
import { ItwIssuanceCredentialAsyncContinuationScreen } from "../issuance/screens/ItwIssuanceCredentialAsyncContinuationScreen";
import { ItwIssuanceCredentialFailureScreen } from "../issuance/screens/ItwIssuanceCredentialFailureScreen";
import { ItwIssuanceCredentialIntroductionScreen } from "../issuance/screens/ItwIssuanceCredentialIntroductionScreen";
import { ItwIssuanceCredentialLandingScreen } from "../issuance/screens/ItwIssuanceCredentialLandingScreen";
import { ItwIssuanceCredentialPreviewScreen } from "../issuance/screens/ItwIssuanceCredentialPreviewScreen";
import { ItwIssuanceCredentialTrustIssuerScreen } from "../issuance/screens/ItwIssuanceCredentialTrustIssuerScreen";
import { ItwIssuanceEidFailureScreen } from "../issuance/screens/ItwIssuanceEidFailureScreen";
import { ItwIssuanceEidPreviewScreen } from "../issuance/screens/ItwIssuanceEidPreviewScreen";
import { ItwIssuanceEidReissuanceLandingScreen } from "../issuance/screens/ItwIssuanceEidReissuanceLandingScreen";
import { ItwIssuanceEidResultScreen } from "../issuance/screens/ItwIssuanceEidResultScreen";
import { ItwIssuanceUpcomingCredentialScreen } from "../issuance/screens/ItwIssuanceUpcomingCredentialScreen";
import { ItwIdentityNotMatchingScreen } from "../lifecycle/screens/ItwIdentityNotMatchingScreen.tsx";
import { ItwLifecycleWalletRevocationScreen } from "../lifecycle/screens/ItwLifecycleWalletRevocationScreen.tsx";
import {
  ItwCredentialIssuanceMachineContext,
  ItwCredentialIssuanceMachineProvider
} from "../machine/credential/provider";
import {
  ItwEidIssuanceMachineContext,
  ItwEidIssuanceMachineProvider
} from "../machine/eid/provider";
import { ItwIssuanceCredentialOfferIntroScreen } from "../offer/screens/ItwIssuanceCredentialOfferIntro.tsx";
import { ItwCardOnboardingL2Screen } from "../onboarding/screens/ItwCardOnboardingL2Screen.tsx";
import { ItwCardOnboardingL3Screen } from "../onboarding/screens/ItwCardOnboardingL3Screen.tsx";
import { WalletCardOnboardingScreen } from "../onboarding/screens/WalletCardOnboardingScreen";
import { ItwL3CredentialDetailScreen } from "../playgrounds/screens/ItwL3CredentialDetailScreen.tsx";
import ItwPlayground from "../playgrounds/screens/ItwPlayground.tsx";
import { ItwProximityPlaygroundScreen } from "../playgrounds/screens/ItwProximityPlaygroundScreen.tsx";
import { ItwPresentationCredentialAttachmentScreen } from "../presentation/details/screens/ItwPresentationCredentialAttachmentScreen";
import { ItwPresentationCredentialCardModal } from "../presentation/details/screens/ItwPresentationCredentialCardModal";
import { ItwPresentationCredentialDetailScreen } from "../presentation/details/screens/ItwPresentationCredentialDetailScreen";
import { ItwPresentationCredentialFiscalCodeModal } from "../presentation/details/screens/ItwPresentationCredentialFiscalCodeModal";
import { ItwPresentationEidVerificationExpiredScreen } from "../presentation/details/screens/ItwPresentationEidVerificationExpiredScreen";
import { ItwPresentationPidDetailScreen } from "../presentation/details/screens/ItwPresentationPidDetailScreen.tsx";
import { ItwConsentManagementDetailScreen } from "../presentation/proximity/screens/ItwConsentManagementDetailScreen.tsx";
import { ItwConsentManagementScreen } from "../presentation/proximity/screens/ItwConsentManagementScreen.tsx";
import { ItwConsentRevocationSuccessScreen } from "../presentation/proximity/screens/ItwConsentRevocationSuccessScreen";
import { ItwSettingsScreen } from "../settings/screens/ItwSettingsScreen.tsx";
import { ItwCredentialTrustmarkScreen } from "../trustmark/screens/ItwCredentialTrustmarkScreen";
import { ItwOfflineWalletScreen } from "../wallet/screens/ItwOfflineWalletScreen";
import { ItwParamsList } from "./ItwParamsList";
import { ITW_ROUTES } from "./routes";
⋮----
component=
</file>

<file path="apps/main-app/ts/features/itwallet/navigation/linking.ts">
import { PathConfigMap } from "@react-navigation/native";
⋮----
import { AppParamsList } from "../../../navigation/params/AppParamsList.ts";
import { ITW_CREDENTIAL_OFFER_LINKING_PATH } from "../offer/utils/index.ts";
import { ITW_REMOTE_ROUTES } from "../presentation/remote/navigation/routes.ts";
import { ITW_ROUTES } from "./routes.ts";
⋮----
const safeDecodeURIComponent = (value: string): string =>
</file>

<file path="apps/main-app/ts/features/itwallet/navigation/routes.ts">
import { ITW_PLAYGROUND_ROUTES } from "../playgrounds/navigation/routes";
import { ITW_PROXIMITY_ROUTES } from "../presentation/proximity/navigation/routes";
</file>

<file path="apps/main-app/ts/features/itwallet/offer/screens/ItwIssuanceCredentialOfferIntro.tsx">
import {
  ContentWrapper,
  H2,
  IOColors,
  IOMarkdown,
  VSpacer
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
import { Image, StyleSheet, View } from "react-native";
⋮----
import introHeroSource from "../../../../../img/features/itWallet/issuance/intro_hero.png";
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import {
  isStartupLoaded,
  StartupStatusEnum
} from "../../../../store/reducers/startup";
import { useItwCredentialName } from "../../common/hooks/useItwCredentialName";
import { useItwDisableGestureNavigation } from "../../common/hooks/useItwDisableGestureNavigation";
import { itwIsL3EnabledSelector } from "../../common/store/selectors";
import { getCredentialStatus } from "../../common/utils/itwCredentialStatusUtils";
import {
  itwCredentialsEidStatusSelector,
  itwCredentialSelector
} from "../../credentials/store/selectors";
import {
  itwCredentialIntroContentSelector,
  itwCredentialNameResolverSelector
} from "../../credentialsCatalogue/store/selectors";
import { itwLifecycleIsValidSelector } from "../../lifecycle/store/selectors";
import { ItwCredentialIssuanceMachineContext } from "../../machine/credential/provider";
import {
  selectCredentialType,
  selectIsLoading,
  selectResolvedCredentialOffer
} from "../../machine/credential/selectors";
import {
  ItwParamsList,
  useItwNavigation
} from "../../navigation/ItwParamsList";
import { ITW_ROUTES } from "../../navigation/routes";
import {
  trackItwUpgradeL3Mandatory,
  trackItwUpgradeL3MandatoryCancel,
  trackItwUpgradeL3MandatoryConfirm
} from "../../presentation/remote/analytics";
import { ItwL3UpgradeTrigger } from "../../presentation/remote/analytics/utils/types";
⋮----
export type ItwIssuanceCredentialOfferScreenNavigationParams = {
  itwCredentialOfferUri: string;
};
⋮----
type ScreenProps = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_ISSUANCE_CREDENTIAL_OFFER_INTRO"
>;
⋮----
const ItwIssuanceCredentialOfferIntroScreen = (
⋮----
type ContentViewProps = {
  credentialOfferUri: string;
};
⋮----
const ContentView = (
⋮----
// Continuing the offer flow would silently overwrite the stored credential,
// so it is blocked when the credential is already in the wallet and valid.
</file>

<file path="apps/main-app/ts/features/itwallet/offer/utils/index.ts">
import {
  IO_INTERNAL_LINK_PREFIX,
  IO_UNIVERSAL_LINK_PREFIX
} from "../../../../utils/navigation";
⋮----
export type CredentialOfferLink = {
  credentialOfferUri: string;
  internalRoute: string;
};
⋮----
export const parseCredentialOfferLink = (
  value: string
): CredentialOfferLink | undefined =>
</file>

<file path="apps/main-app/ts/features/itwallet/onboarding/components/AsyncCredentialsCatalogueWrapper.tsx">
import {
  BannerErrorState,
  ModuleCredential,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { PropsWithChildren } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { itwFetchCredentialsCatalogue } from "../../credentialsCatalogue/store/actions";
import {
  itwIsCredentialsCatalogueLoading,
  itwIsCredentialsCatalogueUnavailable
} from "../../credentialsCatalogue/store/selectors";
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/itwallet/onboarding/components/ItwOnboardingModuleCredential.tsx">
import { Badge, IOIcons, ModuleCredential } from "@io-app/design-system";
import I18n from "i18next";
import { memo, useMemo } from "react";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { itwIsL3EnabledSelector } from "../../common/store/selectors";
import { CredentialType } from "../../common/utils/itwMocksUtils";
⋮----
type Props = {
  credentialName: string;
  isActive?: boolean;
  isCredentialIssuancePending?: boolean;
  isDisabled?: boolean;
  isNew?: boolean;
  isRequested?: boolean;
  isSelectedCredential?: boolean;
  isUpcoming?: boolean;
  onPress: (type: string) => void;
  showIcon?: boolean;
  type: string;
};
⋮----
const ItwOnboardingModuleCredential = ({
  type,
  onPress,
  showIcon = true,
  isActive,
  isDisabled,
  isUpcoming,
  isNew,
  isSelectedCredential,
  isCredentialIssuancePending,
  isRequested = false,
  credentialName
}: Props) =>
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/onboarding/components/ItwOnboardingModuleCredentialsList.tsx">
import { useCallback } from "react";
⋮----
import { useOfflineToastGuard } from "../../../../hooks/useOfflineToastGuard";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { itwIsL3EnabledSelector } from "../../common/store/selectors";
import {
  itwDisabledCredentialsSelector,
  itwNewCredentialsSelector
} from "../../common/store/selectors/remoteConfig";
import { isUpcomingCredential } from "../../common/utils/itwCredentialUtils";
import { itwCredentialsTypesSelector } from "../../credentials/store/selectors";
import { type CredentialsListEntry } from "../../credentialsCatalogue/store/selectors";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../lifecycle/store/selectors";
import { ItwCredentialIssuanceMachineContext } from "../../machine/credential/provider";
import {
  selectCredentialType,
  selectIsLoading
} from "../../machine/credential/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
import { ItwOnboardingModuleCredential } from "./ItwOnboardingModuleCredential";
⋮----
type Props = {
  credentialsToDisplay: ReadonlyArray<CredentialsListEntry>;
  isL2Credential?: boolean;
};
⋮----
export const ItwOnboardingModuleCredentialsList = ({
  credentialsToDisplay,
  isL2Credential
}: Props) =>
⋮----
const sendSelectCredential = () =>
⋮----
isUpcoming=
</file>

<file path="apps/main-app/ts/features/itwallet/onboarding/screens/ItwCardOnboardingL2Screen.tsx">
import { Divider, IOButton, IODimensions, VStack } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIOSelector } from "../../../../store/hooks";
import { trackShowCredentialsList } from "../../analytics";
import { isL2Credential } from "../../common/utils/itwCredentialUtils.ts";
import { makeItwCredentialsByPresenceSelector } from "../../credentials/store/selectors/index.ts";
import { itwAvailableCredentialsListSelector } from "../../credentialsCatalogue/store/selectors/index.ts";
import { useItwNavigation } from "../../navigation/ItwParamsList.ts";
import { ITW_ROUTES } from "../../navigation/routes.ts";
import { AsyncCredentialsCatalogue } from "../components/AsyncCredentialsCatalogueWrapper.tsx";
import { ItwOnboardingModuleCredentialsList } from "../components/ItwOnboardingModuleCredentialsList.tsx";
</file>

<file path="apps/main-app/ts/features/itwallet/onboarding/screens/ItwCardOnboardingL3Screen.tsx">
import {
  Alert,
  Badge,
  Banner,
  ContentWrapper,
  Divider,
  H6,
  IOButton,
  IODimensions,
  ListItemHeader,
  ModuleCredential,
  TabItem,
  TabNavigation,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { clamp } from "lodash";
import { useCallback, useMemo, useState } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useOfflineToastGuard } from "../../../../hooks/useOfflineToastGuard";
import {
  IOStackNavigationRouteProps,
  useIONavigation
} from "../../../../navigation/params/AppParamsList.ts";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { openWebUrl } from "../../../../utils/url.ts";
import { cgnActivationStart } from "../../../bonus/cgn/store/actions/activation.ts";
import {
  isCgnDetailsLoading,
  isCgnInformationAvailableSelector
} from "../../../bonus/cgn/store/reducers/details.ts";
import { loadAvailableBonuses } from "../../../bonus/common/store/actions/availableBonusesTypes.ts";
import { PaymentsOnboardingRoutes } from "../../../payments/onboarding/navigation/routes.ts";
import {
  trackItwDiscoveryBanner,
  trackItwDiscoveryBannerTap,
  trackShowCredentialsList,
  trackStartAddNewCredential
} from "../../analytics";
import { ITW_SCREENVIEW_EVENTS } from "../../analytics/enum";
import { PoweredByItWalletText } from "../../common/components/PoweredByItWalletText.tsx";
import { selectItwEnv } from "../../common/store/selectors/environment.ts";
import {
  itwIsL2FallbackSelector,
  itwIsL3EnabledSelector,
  itwShouldRenderL3UpgradeBannerSelector
} from "../../common/store/selectors/index.ts";
import { itwIsActivationDisabledSelector } from "../../common/store/selectors/preferences.ts";
import {
  isL2Credential,
  isUpcomingCredential
} from "../../common/utils/itwCredentialUtils.ts";
import { makeItwCredentialsByPresenceSelector } from "../../credentials/store/selectors";
import { itwAvailableCredentialsListSelector } from "../../credentialsCatalogue/store/selectors";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../lifecycle/store/selectors";
import {
  ItwParamsList,
  useItwNavigation
} from "../../navigation/ItwParamsList.ts";
import { ITW_ROUTES } from "../../navigation/routes.ts";
import { AsyncCredentialsCatalogue } from "../components/AsyncCredentialsCatalogueWrapper.tsx";
import { ItwOnboardingModuleCredentialsList } from "../components/ItwOnboardingModuleCredentialsList.tsx";
⋮----
export type ItwCardOnboardingL3NavigationParams = {
  page?: number;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_CARD_L3_ONBOARDING"
>;
⋮----
onPress=
⋮----
const navigateToPaymentMethodOnboarding = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/onboarding/screens/WalletCardOnboardingScreen.tsx">
import {
  Badge,
  ListItemHeader,
  ModuleCredential,
  VStack
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { View } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { cgnActivationStart } from "../../../bonus/cgn/store/actions/activation";
import {
  isCgnDetailsLoading,
  isCgnInformationAvailableSelector
} from "../../../bonus/cgn/store/reducers/details";
import { loadAvailableBonuses } from "../../../bonus/common/store/actions/availableBonusesTypes";
import { PaymentsOnboardingRoutes } from "../../../payments/onboarding/navigation/routes";
import {
  trackShowCredentialsList,
  trackStartAddNewCredential
} from "../../analytics";
import { ItwDiscoveryBannerOnboarding } from "../../common/components/discoveryBanner/ItwDiscoveryBannerOnboarding";
import { itwIsL3EnabledSelector } from "../../common/store/selectors";
import { selectItwEnv } from "../../common/store/selectors/environment";
import { isItwEnabledSelector } from "../../common/store/selectors/remoteConfig";
import {
  isL2Credential,
  isUpcomingCredential
} from "../../common/utils/itwCredentialUtils";
import { itwAvailableCredentialsListSelector } from "../../credentialsCatalogue/store/selectors";
import { itwLifecycleIsValidSelector } from "../../lifecycle/store/selectors";
import { AsyncCredentialsCatalogue } from "../components/AsyncCredentialsCatalogueWrapper.tsx";
import { ItwOnboardingModuleCredentialsList } from "../components/ItwOnboardingModuleCredentialsList.tsx";
⋮----
const navigateToPaymentMethodOnboarding = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwBatchCredentialsSection.tsx">
import {
  Divider,
  IOButton,
  ListItemHeader,
  ListItemInfo,
  ListItemInfoCopy,
  useIOToast,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { useMemo } from "react";
import { View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import {
  BATCH_ISSUANCE_CREDENTIALS,
  shouldRefillBatch
} from "../../common/utils/itwCredentialIssuanceUtils";
import { getCredentialKeyTags } from "../../common/utils/itwCredentialUtils";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import {
  itwCredentialsBatchRefillRequest,
  itwCredentialsConsumeInstance
} from "../../credentials/store/actions";
import {
  itwAllStoredCredentialsSelector,
  itwCredentialsToRefillSelector
} from "../../credentials/store/selectors";
⋮----
export const ItwBatchCredentialsSection = () =>
⋮----
const requestRefill = (
    credentialType: string,
    trigger: "app-start" | "presentation"
) =>
⋮----
const runAppStartCheck = () =>
⋮----
type BatchCredentialItemProps = {
  credentialType: string;
  instances: ReadonlyArray<CredentialMetadata>;
  onRefillRequest: () => void;
};
⋮----
const consumeInstance = (credential: CredentialMetadata) =>
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwCardsHeaderSection.tsx">
import { IODimensions, ListItemHeader, VStack } from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { ItwCredentialDetailCard } from "../../common/components/ItwCredentialDetailCard";
import { getCredentialNameFromType } from "../../common/utils/itwCredentialUtils";
import { CredentialType } from "../../common/utils/itwMocksUtils";
⋮----
<ListItemHeader label=
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwCardsSection.tsx">
import {
  HStack,
  IODimensions,
  ListItemHeader,
  VStack
} from "@io-app/design-system";
import { ScrollView, View } from "react-native";
⋮----
import { DSComponentViewerBox } from "../../../design-system/components/DSComponentViewerBox";
import {
  ItwCredentialCard,
  ItwCredentialCardLegacy
} from "../../common/components/ItwCredentialCard";
import { getCredentialNameFromType } from "../../common/utils/itwCredentialUtils";
import { CredentialType } from "../../common/utils/itwMocksUtils";
import { ItwCredentialStatus } from "../../common/utils/itwTypesUtils";
import { ItwCredentialWalletCard } from "../../wallet/components/ItwCredentialWalletCard";
⋮----
<ListItemHeader label=
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwComponentsSection.tsx">
import {
  Body,
  ListItemHeader,
  ListItemSwitch,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { Canvas, Rect } from "@shopify/react-native-skia";
import I18n from "i18next";
import { useState } from "react";
import { Alert, useWindowDimensions, View } from "react-native";
⋮----
import { RotationSensor } from "../../../../components/RotationSensor";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { DSComponentViewerBox } from "../../../design-system/components/DSComponentViewerBox";
import { ItwBrandedBox } from "../../common/components/ItwBrandedBox";
import { ItwBrandedSkiaGradient } from "../../common/components/ItwBrandedSkiaGradient";
import { ItwEngagementBanner } from "../../common/components/ItwEngagementBanner";
import { ItwSkeumorphicCard } from "../../common/components/ItwSkeumorphicCard";
import { FlipGestureDetector } from "../../common/components/ItwSkeumorphicCard/FlipGestureDetector";
import { getCredentialStatus } from "../../common/utils/itwCredentialStatusUtils";
import {
  CredentialType,
  ItwStoredCredentialsMocks
} from "../../common/utils/itwMocksUtils";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { ItwRequestedClaimsList } from "../../issuance/components/ItwRequestedClaimsList";
import { ITW_ROUTES } from "../../navigation/routes";
import { ItwClaimsSelector } from "../../presentation/common/components/ItwClaimsSelector";
import { ItwPresentationCredentialCardFlipButton } from "../../presentation/details/components/ItwPresentationCredentialCardFlipButton";
⋮----
onDismiss=
⋮----
const handleOnPress = () =>
⋮----
handleOnPress=
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwCredentialStatusOverrideSection.tsx">
import {
  ListItemHeader,
  ListItemNav,
  RadioGroup,
  RadioItem,
  VSpacer
} from "@io-app/design-system";
import { useState } from "react";
import { View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { selectItwEnv } from "../../common/store/selectors/environment";
import { getCredentialStatus } from "../../common/utils/itwCredentialStatusUtils";
import { ItwCredentialStatus } from "../../common/utils/itwTypesUtils";
import { itwCredentialsStore } from "../../credentials/store/actions";
import {
  itwCredentialsAllSelector,
  itwCredentialsByTypeSelector
} from "../../credentials/store/selectors";
import {
  applyStatusToCredential,
  getAvailableStatusOverrides
} from "../utils/itwDebugCredentialUtils";
⋮----
type CredentialStatusPickerProps = {
  credentialType: string;
  currentStatus: ItwCredentialStatus;
  onSelect: (status: ItwCredentialStatus) => void;
};
⋮----
const CredentialStatusPicker = ({
  credentialType,
  currentStatus,
  onSelect
}: CredentialStatusPickerProps) =>
⋮----
const applyCredentialOverride = (
    credentialType: string,
    status: ItwCredentialStatus
) =>
⋮----
currentStatus=
⋮----
description=
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwEnvironmentSection.tsx">
import { ListItemHeader, RadioGroup, RadioItem } from "@io-app/design-system";
import I18n from "i18next";
import { Alert, View } from "react-native";
⋮----
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { itwSetEnv } from "../../common/store/actions/environment";
import { selectItwEnv } from "../../common/store/selectors/environment";
import { EnvType, getEnv } from "../../common/utils/environment";
⋮----
export const ItwEnvironmentSection = () =>
⋮----
const toggleEnvironment = (selected: EnvType) =>
const envRadioItems = (): ReadonlyArray<RadioItem<EnvType>>
⋮----
items=
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwIdentificationScreensSection.tsx">
import { ListItemHeader, ListItemNav } from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { ITW_ROUTES } from "../../navigation/routes";
⋮----
export const ItwIdentificationScreensSection = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwIso18013Section.tsx">
import {
  Body,
  ListItemHeader,
  ListItemInfo,
  ListItemNav,
  ListItemSwitch,
  VStack
} from "@io-app/design-system";
import { Alert, View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { itwSetProximityNfcLocallyEnabled } from "../../common/store/actions/preferences";
import { itwIsProximityNfcLocallyEnabledSelector } from "../../common/store/selectors/preferences";
import { ITW_ROUTES } from "../../navigation/routes";
import { itwRevokeProximityConsentByKey } from "../../presentation/proximity/store/actions";
import { itwProximityConsentsEntriesSelector } from "../../presentation/proximity/store/selectors/consents";
⋮----
const handleRevokeConsent = (key: string) =>
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwL3ScreensSection.tsx">
import { ListItemHeader, ListItemNav } from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { CredentialL3Key } from "../../common/utils/itwMocksUtils";
import { itwLifecycleIsValidSelector } from "../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
⋮----
export const ItwL3ScreensSection = () =>
⋮----
const handleCredentialPress = (credentialType: CredentialL3Key) =>
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwLifecycleSection.tsx">
import { IOButton, ListItemHeader, ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { Alert, View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { itwSetFiscalCodeWhitelisted } from "../../common/store/actions/preferences";
import { itwIsFiscalCodeWhitelisted } from "../../common/store/selectors/preferences";
import { itwLifecycleWalletReset } from "../../lifecycle/store/actions";
import {
  itwLifecycleIsInstalledSelector,
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsOperationalSelector,
  itwLifecycleIsValidSelector
} from "../../lifecycle/store/selectors";
⋮----
export const ItwLifecycleSection = () =>
⋮----
const getLifecycleStateLabel = () =>
⋮----
const confirmDisableL3Whitelist = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwMiscSection.tsx">
import {
  IOButton,
  ListItemHeader,
  ListItemInfo,
  ListItemSwitch,
  ListItemSwitchProps
} from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { resetTourCompletedAction } from "../../../tour/store/actions";
import { isTourCompletedSelector } from "../../../tour/store/selectors";
import { itwSetDiscoverMoreCEDEnabled } from "../../common/store/actions/preferences.ts";
import { itwIsDiscoverMoreCEDLocallyEnabledSelector } from "../../common/store/selectors/preferences";
import { ITW_TOUR_GROUP_ID } from "../../tour/utils/constants";
⋮----
const resetTourGuide = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwPidIssuanceSection.tsx">
import { ListItemHeader, ListItemNav } from "@io-app/design-system";
import { IntegrityError } from "@pagopa/io-react-native-integrity";
import I18n from "i18next";
import { useCallback } from "react";
import { Alert, View } from "react-native";
⋮----
import { EidIssuanceLevel } from "../../machine/eid/context";
import { IssuanceFailureType } from "../../machine/eid/failure";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider";
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwSpecsVersionSection.tsx">
import { ListItemHeader, ListItemInfo, VSpacer } from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { selectItwSpecsVersion } from "../../common/store/selectors/environment";
⋮----
export const ItwSpecsVersionSection = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/components/ItwStatusListSection.tsx">
import {
  BodyMonospace,
  Divider,
  IOButton,
  ListItemHeader,
  ListItemInfo,
  ListItemInfoCopy,
  ListItemNav,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import { type CredentialStatus } from "@pagopa/io-react-native-wallet";
import { format } from "date-fns";
⋮----
import { useCallback, useEffect, useState } from "react";
import { FlatList, Text, View } from "react-native";
⋮----
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { isDevEnv } from "../../../../utils/environment";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { ITW_STATUS_LIST_FETCH_TASK } from "../../statusList/tasks";
import { StatusListRepository } from "../../statusList/utils/repository";
import { getLastStatusListCheckTimestamps } from "../../statusList/utils/storage";
⋮----
const formatDate = (timestamp: number | undefined): string
⋮----
const formatAge = (lastFetchTime: number | undefined): string =>
⋮----
const formatTslTimestamp = (timestamp: number | undefined): string
⋮----
const getAlertMessage = (error: unknown)
⋮----
const getTaskRegistrationLabel = (isRegistered?: boolean) =>
⋮----
value={getTaskRegistrationLabel(isTaskRegistered)}
      />
      <Divider />
      <ListItemInfoCopy
        label="Task name"
onPress=
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/hooks/useItwProximityFlow.ts">
import {
  type CryptoError,
  deleteKey,
  generate
} from "@pagopa/io-react-native-crypto";
import {
  CBOR,
  COSE,
  ISO18013_5,
  ISO18013_7
} from "@pagopa/io-react-native-iso18013";
import { useCallback, useEffect, useRef, useState } from "react";
import { Alert, Platform } from "react-native";
import {
  checkMultiple,
  type Permission,
  PERMISSIONS,
  requestMultiple,
  RESULTS
} from "react-native-permissions";
⋮----
import { getEnv } from "../../common/utils/environment";
import { KEYTAG, WELL_KNOWN_CREDENTIALS } from "../mocks/proximity";
⋮----
interface NestedBooleanMap {
  [key: string]: boolean | NestedBooleanMap;
}
⋮----
const acceptAllFields = <T extends NestedBooleanMap>(input: T): T
⋮----
const generateAcceptedFields = (
  request: ISO18013_5.VerifierRequest["request"]
): ISO18013_5.AcceptedFields
⋮----
const generateKeyIfNotExists = async (keyTag: string) =>
⋮----
const isRequestMdl = (requestKeys: Array<string>) =>
⋮----
const requestBlePermissions = async (): Promise<boolean> =>
⋮----
const parseAndPrintError = (
  schema:
    | typeof CBOR.ModuleErrorSchema
    | typeof COSE.ModuleErrorSchema
    | typeof ISO18013_5.ModuleErrorSchema
    | typeof ISO18013_5.OnErrorPayloadSchema
    | typeof ISO18013_7.ModuleErrorSchema,
  error: unknown,
  prefix?: string
) =>
⋮----
export enum PROXIMITY_STATUS {
  ENGAGEMENT = "ENGAGEMENT",
  ERROR = "ERROR",
  IDLE = "IDLE",
  PRESENTING = "PRESENTING",
  READY = "READY"
}
⋮----
export const useItwProximityFlow = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/mocks/proximity.ts">

</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/navigation/ItwPlaygroundParamsList.ts">
import { ItwL3CredentialDetailScreenNavigationParams } from "../screens/ItwL3CredentialDetailScreen.tsx";
import { ITW_PLAYGROUND_ROUTES } from "./routes.ts";
⋮----
export type ItwPlaygroundParamsList = {
  [ITW_PLAYGROUND_ROUTES.CREDENTIAL_DETAIL]: ItwL3CredentialDetailScreenNavigationParams;
  [ITW_PLAYGROUND_ROUTES.DISCOVERY_INFO_NEW]: undefined;
  [ITW_PLAYGROUND_ROUTES.ISO_18013_PROXIMITY]: undefined;
  [ITW_PLAYGROUND_ROUTES.LANDING]: undefined;
};
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/screens/ItwL3CredentialDetailScreen.tsx">
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList.ts";
import {
  CredentialL3Key,
  ItwStoredCredentialsMocks
} from "../../common/utils/itwMocksUtils";
import { ItwPresentationCredentialDetail } from "../../presentation/details/screens/ItwPresentationCredentialDetailScreen";
import { ItwPlaygroundParamsList } from "../navigation/ItwPlaygroundParamsList.ts";
⋮----
export type ItwL3CredentialDetailScreenNavigationParams = {
  credentialType: CredentialL3Key;
};
⋮----
type ScreenProps = IOStackNavigationRouteProps<
  ItwPlaygroundParamsList,
  "ITW_PLAYGROUND_CREDENTIAL_DETAIL"
>;
⋮----
export const ItwL3CredentialDetailScreen = (params: ScreenProps) =>
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/screens/ItwPlayground.tsx">
import {
  ContentWrapper,
  TabItem,
  TabNavigation,
  VStack
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import { ReactNode, useCallback, useState } from "react";
import { ScrollView } from "react-native";
⋮----
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useScreenEndMargin } from "../../../../hooks/useScreenEndMargin";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider";
import { ItwBatchCredentialsSection } from "../components/ItwBatchCredentialsSection";
import { ItwCardsHeaderSection } from "../components/ItwCardsHeaderSection";
import { ItwCardsSection } from "../components/ItwCardsSection";
import { ItwComponentsSection } from "../components/ItwComponentsSection";
import { ItwCredentialStatusOverrideSection } from "../components/ItwCredentialStatusOverrideSection";
import { ItwEnvironmentSection } from "../components/ItwEnvironmentSection";
import { ItwIdentificationScreensSection } from "../components/ItwIdentificationScreensSection";
import { ItwIso18013Section } from "../components/ItwIso18013Section";
import { ItwL3ScreensSection } from "../components/ItwL3ScreensSection";
import { ItwLifecycleSection } from "../components/ItwLifecycleSection";
import { ItwMiscSection } from "../components/ItwMiscSection";
import { ItwPidIssuanceSection } from "../components/ItwPidIssuanceSection";
import { ItwSpecsVersionSection } from "../components/ItwSpecsVersionSection";
import { ItwStatusListSection } from "../components/ItwStatusListSection";
⋮----
type PlaygroundTab = {
  content: ReactNode;
  label: string;
};
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/screens/ItwProximityPlaygroundScreen.tsx">
import { Body, IOButton, ListItemSwitch, VStack } from "@io-app/design-system";
import { ISO18013_5 } from "@pagopa/io-react-native-iso18013";
import { useEffect, useState } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { QrCodeImage } from "../../../../components/QrCodeImage";
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import {
  PROXIMITY_STATUS,
  useItwProximityFlow
} from "../hooks/useItwProximityFlow";
import { MDL_BASE64, MDL_BASE64URL } from "../mocks/proximity";
⋮----
onSwitchValueChange=
</file>

<file path="apps/main-app/ts/features/itwallet/playgrounds/utils/itwDebugCredentialUtils.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
import { addDays, format, subDays } from "date-fns";
⋮----
import { WellKnownClaim } from "../../common/utils/itwClaimsUtils";
import { getIoWallet } from "../../common/utils/itwIoWallet";
import { CredentialType } from "../../common/utils/itwMocksUtils";
import {
  CredentialMetadata,
  CredentialValidity,
  ItwCredentialStatus,
  ItwEidStatus
} from "../../common/utils/itwTypesUtils";
⋮----
const toSimpleDate = (date: Date)
⋮----
const normalizeCredentialAsValid = (
  credential: CredentialMetadata,
  now: Date
): CredentialMetadata =>
⋮----
export const getAvailableStatusOverrides = (
  credentialType: string
): ReadonlyArray<ItwCredentialStatus>
⋮----
export const applyStatusToCredential = (
  credential: CredentialMetadata,
  status: ItwCredentialStatus
): CredentialMetadata =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/common/components/ItwClaimsSelector/ClaimItem.tsx">
import { Divider, ListItemCheckbox, ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { Fragment } from "react";
import { Image, StyleSheet } from "react-native";
⋮----
import { getNestedItemSummary } from "../../../../common/components/ItwCredentialMultiClaim";
import {
  ClaimDisplayFormat,
  drivingPrivilegeToClaims,
  getClaimDisplayValue,
  getSafeText
} from "../../../../common/utils/itwClaimsUtils";
⋮----
type Props = {
  isSelected?: boolean;
  item: ClaimDisplayFormat;
  onItemSelected?: (item: ClaimDisplayFormat, selected: boolean) => void;
  present?: (claims: Array<ClaimDisplayFormat>, title?: string) => void;
  selectionEnabled: boolean;
};
⋮----
const buildInfoEndElement = (
  present: Props["present"],
  claims: Array<ClaimDisplayFormat>,
  title?: string
): ListItemInfo["endElement"] =>
⋮----
onItemSelected
⋮----
endElement=
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/common/components/ItwClaimsSelector/index.tsx">
import {
  Divider,
  Icon,
  IODimensions,
  useAccordionAnimation,
  useIOThemeContext
} from "@io-app/design-system";
import I18n from "i18next";
import { Fragment } from "react";
import { AccessibilityInfo, StyleSheet, View } from "react-native";
import Animated, { useAnimatedStyle } from "react-native-reanimated";
⋮----
import { getCredentialCardConfig } from "../../../../common/components/ItwCredentialCard/config";
import { ItwCredentialClaimsCard } from "../../../../common/components/ItwCredentialClaimsCard";
import { useItwCredentialName } from "../../../../common/hooks/useItwCredentialName";
import { ClaimDisplayFormat } from "../../../../common/utils/itwClaimsUtils";
import { useClaimsDetailsBottomSheet } from "../../hooks/useClaimsDetailsBottomSheet";
import { ClaimItem } from "./ClaimItem";
⋮----
type Props = {
  accessibilityLabel?: string;
  credentialType: string;
  defaultExpanded?: boolean;
  items: Array<ClaimDisplayFormat>;
  onItemSelected?: (item: ClaimDisplayFormat, selected: boolean) => void;
  onToggle?: (expanded: boolean) => void;
  selectedItemIds?: Array<string>;
  selectionEnabled?: boolean;
};
⋮----
export const ItwClaimsSelector = ({
  credentialType,
  items,
  defaultExpanded,
  onItemSelected,
  onToggle,
  accessibilityLabel,
  selectedItemIds,
  selectionEnabled = false
}: Props) =>
⋮----
const onItemPress = () =>
⋮----
isSelected=
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/common/components/ItwPresentationMissingCredentialsFailureContent.tsx">
import {
  Body,
  Divider,
  IOButton,
  ListItemInfo,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { Fragment } from "react";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../../components/screens/OperationResultScreenContent.tsx";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet.tsx";
import { itwCredentialNameResolverSelector } from "../../../credentialsCatalogue/store/selectors/index.ts";
import { ITW_ROUTES } from "../../../navigation/routes.ts";
⋮----
type Props = {
  missingCredentials: ReadonlyArray<string>;
  onClose: () => void;
};
⋮----
export const ItwPresentationMissingCredentialsFailureContent = ({
  missingCredentials,
  onClose
}: Props) =>
⋮----
label=
⋮----
dismiss();
navigation.replace(ITW_ROUTES.MAIN, {
              screen: ITW_ROUTES.L3_ONBOARDING
            });
⋮----
const getOperationResultScreenContentProps =
(): OperationResultScreenContentProps =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/common/hooks/useClaimsDetailsBottomSheet.tsx">
import { Divider } from "@io-app/design-system";
import I18n from "i18next";
import { Fragment, useCallback, useMemo, useState } from "react";
import { View } from "react-native";
⋮----
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { ItwCredentialClaim } from "../../../common/components/ItwCredentialClaim";
import { ClaimDisplayFormat } from "../../../common/utils/itwClaimsUtils";
⋮----
type ClaimsDetails = null | {
  claims: Array<ClaimDisplayFormat>;
  title?: string;
};
⋮----
export const useClaimsDetailsBottomSheet = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/analytics/enum.ts">
export enum ITW_PRESENTATION_DETAILS_ACTIONS_EVENTS {
  ITW_CREDENTIAL_BOTTOMSHEET_ACTION = "ITW_CREDENTIAL_BOTTOMSHEET_ACTION",
  ITW_CREDENTIAL_CARD_MODAL = "ITW_CREDENTIAL_CARD_MODAL",
  ITW_CREDENTIAL_DELETE = "ITW_CREDENTIAL_DELETE",
  ITW_CREDENTIAL_OPPORTUNITIES = "ITW_CREDENTIAL_OPPORTUNITIES",
  ITW_CREDENTIAL_SHOW_BACK = "ITW_CREDENTIAL_SHOW_BACK",
  "ITW_CREDENTIAL_SHOW_FAC-SIMILE" = "ITW_CREDENTIAL_SHOW_FAC-SIMILE",
  ITW_CREDENTIAL_SHOW_TRUSTMARK = "ITW_CREDENTIAL_SHOW_TRUSTMARK",
  ITW_CREDENTIAL_SUPPORT = "ITW_CREDENTIAL_SUPPORT",
  ITW_CREDENTIAL_TAP_BANNER = "ITW_CREDENTIAL_TAP_BANNER",
  ITW_REISSUING_EID_MANDATORY = "ITW_REISSUING_EID_MANDATORY",
  ITW_REISSUING_EID_MANDATORY_CANCEL = "ITW_REISSUING_EID_MANDATORY_CANCEL",
  ITW_REISSUING_EID_MANDATORY_CONFIRM = "ITW_REISSUING_EID_MANDATORY_CONFIRM"
}
⋮----
export enum ITW_PRESENTATION_DETAILS_SCREENVIEW_EVENTS {
  ITW_CREDENTIAL_BOTTOMSHEET = "ITW_CREDENTIAL_BOTTOMSHEET",
  ITW_CREDENTIAL_DETAIL = "ITW_CREDENTIAL_DETAIL",
  "ITW_CREDENTIAL_FAC-SIMILE" = "ITW_CREDENTIAL_FAC-SIMILE"
}
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/analytics/index.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { buildEventProperties } from "../../../../../utils/analytics";
import { MixPanelCredential } from "../../../analytics/utils/types";
import {
  ITW_PRESENTATION_DETAILS_ACTIONS_EVENTS,
  ITW_PRESENTATION_DETAILS_SCREENVIEW_EVENTS
} from "./enum";
import {
  ItwEidReissuingTrigger,
  TrackCredentialAction,
  TrackCredentialDetail
} from "./types";
⋮----
export const trackCredentialDetail = (
  credentialDetails: TrackCredentialDetail
) =>
⋮----
export const trackWalletCredentialFAC_SIMILE = (
  credential: MixPanelCredential
) =>
⋮----
export const trackItwCredentialBottomSheet = (
  properties: TrackCredentialDetail
) =>
⋮----
export const trackWalletCredentialOpportunities = (
  credential: MixPanelCredential
) =>
⋮----
export const trackItwCredentialDelete = (
  credential: MixPanelCredential,
  properties?: Omit<TrackCredentialAction, "credential">
) =>
⋮----
export const trackItwCredentialBottomSheetAction = (
  properties: TrackCredentialDetail
) =>
⋮----
export const trackWalletShowBack = (credential: MixPanelCredential) =>
⋮----
export const trackWalletCredentialSupport = (
  credential: MixPanelCredential
) =>
⋮----
export const trackWalletCredentialShowFAC_SIMILE = () =>
⋮----
export const trackWalletCredentialShowTrustmark = (
  credential: MixPanelCredential
) =>
⋮----
export const trackCredentialCardModal = (credential: MixPanelCredential) =>
⋮----
export const trackItwCredentialTapBanner = (
  properties: TrackCredentialDetail
) =>
⋮----
export const trackItwEidReissuingMandatory = (
  action: ItwEidReissuingTrigger
) =>
export const trackItwEidReissuingMandatoryConfirm = (
  action: ItwEidReissuingTrigger
) =>
⋮----
export const trackItwEidReissuingMandatoryCancel = (
  action: ItwEidReissuingTrigger
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/analytics/types.ts">
import {
  ItwCredentialActionPosition,
  MixPanelCredential
} from "../../../analytics/utils/types";
⋮----
export enum ItwEidReissuingTrigger {
  ADD_CREDENTIAL = "add_credential"
}
⋮----
export type TrackCredentialAction = Pick<
  TrackCredentialDetail,
  "credential" | "credential_status"
> & {
  position: ItwCredentialActionPosition;
};
⋮----
export type TrackCredentialDetail = {
  credential: MixPanelCredential;
  credential_status: string;
  credential_type?: "multiple" | "unique";
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwDiscoveryInfoBanner.tsx">
import { Banner, useIOToast } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { useIODispatch } from "../../../../../store/hooks";
import { openWebUrl } from "../../../../../utils/url";
import {
  trackItwBannerClosure,
  trackItwBannerTap,
  trackItwBannerVisualized
} from "../../../analytics";
import { itwCloseBanner } from "../../../common/store/actions/banners";
⋮----
const ItwDiscoveryInfoBanner = () =>
⋮----
const handleOnPress = () =>
⋮----
const handleOnClose = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationAdditionalInfoSection.tsx">
import { memo } from "react";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { itwShouldRenderWalletUpgradeMDLDetailsBannerSelector } from "../../../common/store/selectors";
import { CredentialType } from "../../../common/utils/itwMocksUtils.ts";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils.ts";
import { ItwPresentationAgeVerificationUsageBanner } from "./ItwPresentationAgeVerificationUsageBanner";
import { ItwPresentationFiscalCode } from "./ItwPresentationFiscalCode.tsx";
import { ItwPresentationNewCredentialValidityAlert } from "./ItwPresentationNewCredentialValidityAlert";
import { ItwPresentationWalletUpgradeMDLDetailsBanner } from "./ItwPresentationWalletUpgradeMDLDetailsBanner";
⋮----
type Props = {
  credential: CredentialMetadata;
};
⋮----
const ItwPresentationAdditionalInfoSection = (
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationAgeVerificationUsageBanner.tsx">
import { Banner, IOToast } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { openWebUrl } from "../../../../../utils/url";
import { itwCloseBanner } from "../../../common/store/actions/banners";
import { itwShouldRenderAgeVerificationUsageDetailsBannerSelector } from "../../../common/store/selectors";
⋮----
export const ItwPresentationAgeVerificationUsageBanner = () =>
⋮----
const handleOnPress = ()
⋮----
onClose=
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationClaimsSection.tsx">
import { Divider, H6, IconButton, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { Fragment, useMemo } from "react";
import { View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../../store/hooks.ts";
import { ItwCredentialClaim } from "../../../common/components/ItwCredentialClaim.tsx";
import { ItwIssuanceMetadata } from "../../../common/components/ItwIssuanceMetadata.tsx";
import { itwSetClaimValuesHidden } from "../../../common/store/actions/preferences.ts";
import { itwIsClaimValueHiddenSelector } from "../../../common/store/selectors/preferences.ts";
import {
  parseClaims,
  WellKnownClaim
} from "../../../common/utils/itwClaimsUtils.ts";
import { getCredentialStatus } from "../../../common/utils/itwCredentialStatusUtils.ts";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils.ts";
import { useItwCopyClaimValue } from "../hooks/useItwCopyClaimValue.ts";
⋮----
type ItwPresentationClaimsSectionProps = {
  credential: CredentialMetadata;
};
⋮----
const handleToggleClaimVisibility = () =>
⋮----
const renderHideValuesToggle = () => (
    <IconButton
      accessibilityLabel={I18n.t(
        "features.itWallet.presentation.credentialDetails.actions.hideClaimValues"
      )}
      icon={valuesHidden ? "eyeHide" : "eyeShow"}
      onPress={handleToggleClaimVisibility}
      testID="toggle-claim-visibility"
    />
  );
⋮----
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationCredentialCard.tsx">
import {
  ContentWrapper,
  IODimensionScale,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { PropsWithChildren, useCallback, useState } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { getMixPanelCredential } from "../../../analytics/utils/index.ts";
import { ItwSkeumorphicCard } from "../../../common/components/ItwSkeumorphicCard";
import { FlipGestureDetector } from "../../../common/components/ItwSkeumorphicCard/FlipGestureDetector.tsx";
import { itwIsClaimValueHiddenSelector } from "../../../common/store/selectors/preferences.ts";
import { getLegacyThemeColorByCredentialType } from "../../../common/utils/itwStyleUtils.ts";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils.ts";
import { itwCredentialStatusSelector } from "../../../credentials/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../../navigation/routes.ts";
import { trackWalletShowBack } from "../analytics";
import { useItwDisplayCredentialStatus } from "../hooks/useItwDisplayCredentialStatus";
import { ItwPresentationCredentialCardFlipButton } from "./ItwPresentationCredentialCardFlipButton.tsx";
⋮----
type Props = {
  credential: CredentialMetadata;
};
⋮----
const ItwPresentationCredentialCard = (
⋮----
const handleCardPress = () =>
⋮----
type CardContainerProps = {
  backgroundColor: string;
};
⋮----
const CardContainer = ({
  children,
  backgroundColor
}: PropsWithChildren<CardContainerProps>) => (
  <View style={styles.cardContainer}>
    {children}
    <View style={[styles.cardBackdrop, { backgroundColor }]} />
  </View>
);
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationCredentialCardFlipButton.tsx">
import { IOButton } from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
type ItwPresentationCredentialCardFlipButtonProps = {
  fullScreen?: boolean;
  handleOnPress: () => void;
  isFlipped: boolean;
};
⋮----
const ItwPresentationCredentialCardFlipButton = ({
  isFlipped,
  handleOnPress,
  fullScreen = false
}: ItwPresentationCredentialCardFlipButtonProps) => (
  <View style={fullScreen ? styles.fullWidthButton : styles.button}>
    <IOButton
      icon="switchCard"
      iconPosition="end"
      label={I18n.t(
        isFlipped
          ? "features.itWallet.presentation.credentialDetails.card.showFront"
          : "features.itWallet.presentation.credentialDetails.card.showBack"
      )}
      onPress={handleOnPress}
      variant={fullScreen ? "solid" : "link"}
    />
  </View>
);
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationCredentialCardHideValuesButton.tsx">
import { IOButton } from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
type ItwPresentationCredentialCardHideValuesButtonProps = {
  handleOnPress: () => void;
  valuesHidden: boolean;
};
⋮----
const ItwPresentationCredentialCardHideValuesButton = ({
  valuesHidden,
  handleOnPress
}: ItwPresentationCredentialCardHideValuesButtonProps) => (
  <View style={styles.button}>
    <IOButton
      icon={valuesHidden ? "eyeShow" : "eyeHide"}
      iconPosition="end"
      label={I18n.t(
        valuesHidden
          ? "features.itWallet.presentation.credentialDetails.card.showValues"
          : "features.itWallet.presentation.credentialDetails.card.hideValues"
      )}
      onPress={handleOnPress}
      variant="link"
    />
  </View>
);
⋮----
label=
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationCredentialInfoAlert.tsx">
import { Alert, Banner } from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../../store/hooks.ts";
import { itwCloseBanner } from "../../../common/store/actions/banners";
import {
  itwIsMdlDetailsInfoBannerVisibleSelector,
  itwIsTsDetailsInfoBannerVisibleSelector
} from "../../../common/store/selectors/banners";
import { CredentialType } from "../../../common/utils/itwMocksUtils.ts";
import {
  CredentialMetadata,
  ItwCredentialStatus
} from "../../../common/utils/itwTypesUtils.ts";
import { itwCredentialStatusSelector } from "../../../credentials/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
⋮----
type Props = {
  credential: CredentialMetadata;
};
⋮----
const ItwPresentationCredentialInfoAlert = (
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationCredentialStatusAlert.tsx">
import {
  Alert,
  IOButton,
  IOMarkdownLite,
  IOToast,
  VStack
} from "@io-app/design-system";
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { memo, useCallback, useMemo } from "react";
import { View } from "react-native";
⋮----
import { useOfflineToastGuard } from "../../../../../hooks/useOfflineToastGuard.ts";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { format } from "../../../../../utils/dates.ts";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet.tsx";
import { openWebUrl } from "../../../../../utils/url";
import { offlineAccessReasonSelector } from "../../../../ingress/store/selectors";
import { getMixPanelCredential } from "../../../analytics/utils";
import { CREDENTIAL_STATUS_MAP } from "../../../analytics/utils/types.ts";
import { ItwEidLifecycleAlert } from "../../../common/components/ItwEidLifecycleAlert";
import { itwShouldUpgradeCredentialSelector } from "../../../common/store/selectors";
import { getCredentialExpireDays } from "../../../common/utils/itwClaimsUtils.ts";
import { CredentialStatusMessage } from "../../../common/utils/itwCredentialStatusUtils";
import { CredentialType } from "../../../common/utils/itwMocksUtils.ts";
import {
  CredentialMetadata,
  ItwCredentialStatus,
  ItwEidStatus
} from "../../../common/utils/itwTypesUtils.ts";
import { useCredentialStatusMessage } from "../../../credentials/hooks/useCredentialStatusMessage";
import {
  itwCredentialsEidStatusSelector,
  itwCredentialStatusSelector
} from "../../../credentials/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { ItwCredentialIssuanceMachineContext } from "../../../machine/credential/provider";
import { ITW_ROUTES } from "../../../navigation/routes.ts";
import {
  trackItwCredentialBottomSheet,
  trackItwCredentialBottomSheetAction,
  trackItwCredentialTapBanner
} from "../analytics";
import { useItwExpiredDocumentBottomSheet } from "../hooks/useItwExpiredDocumentBottomSheet.tsx";
import { useItwIssuerDynamicErrorBottomSheet } from "../hooks/useItwIssuerDynamicErrorBottomSheet";
import { isMdlSuspendedIssuerError } from "../utils";
⋮----
type Props = {
  credential: CredentialMetadata;
};
⋮----
export enum CredentialAlertType {
  DOCUMENT_EXPIRED = "DOCUMENT_EXPIRED",
  DOCUMENT_EXPIRING = "DOCUMENT_EXPIRING",
  EID_LIFECYCLE = "EID_LIFECYCLE",
  INVALID_CREDENTIAL = "INVALID_CREDENTIAL",
  ISSUER_DYNAMIC_ERROR = "ISSUER_DYNAMIC_ERROR",
  JWT_VERIFICATION = "JWT_VERIFICATION",
  MDL_SUSPENDED = "MDL_SUSPENDED"
}
⋮----
type CredentialAlertEvents = "open_bottom_sheet" | "press_cta" | "tap_banner";
⋮----
type CredentialAlertProps = {
  credentialStatus: ItwCredentialStatus | undefined;
  eidStatus: ItwEidStatus | undefined;
  isItwL3: boolean;
  isMdlSuspended?: boolean;
  isOffline: boolean;
  message?: CredentialStatusMessage;
};
⋮----
type CredentialStatusAlertProps = {
  credential: CredentialMetadata;
  onTrack: TrackCredentialAlert;
  status?: ItwCredentialStatus;
};
⋮----
type TrackCredentialAlert = (action: CredentialAlertEvents) => void;
⋮----
const useAlertPressHandler =
(onTrack: TrackCredentialAlert, bottomSheet:
⋮----
type JwtInvalidAlertProps = {
  isCredentialJwtExpired: boolean;
  isCredentialJwtExpiring: boolean;
  isEidExpired: boolean;
  isEidInvalid: boolean;
  isItwL3: boolean;
  isOffline: boolean;
};
⋮----
const deriveJwtInvalidAlertType = ({
  isEidExpired,
  isEidInvalid,
  isCredentialJwtExpiring,
  isCredentialJwtExpired,
  isOffline,
  isItwL3
... (28 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationCredentialUnknownStatus.tsx">
import I18n from "i18next";
import { useEffect, useRef, useState } from "react";
⋮----
import { LoadingScreenContent } from "../../../../../components/screens/LoadingScreenContent.tsx";
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent.tsx";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel.tsx";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { useIODispatch } from "../../../../../store/hooks.ts";
import { useItwCredentialName } from "../../../common/hooks/useItwCredentialName";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils.ts";
import { itwCredentialsRefreshStatusByType } from "../../../credentials/store/actions";
import { ItwCredentialIssuanceMachineContext } from "../../../machine/credential/provider.tsx";
import {
  selectCredentialType,
  selectIsLoading
} from "../../../machine/credential/selectors.ts";
⋮----
type Props = {
  credential: CredentialMetadata;
};
⋮----
export const ItwPresentationCredentialUnknownStatus = ({
  credential
}: Props) =>
⋮----
// To determine whether the retry is complete we compare the two status assertion objects:
// when their references change, the store was updated with the result.
// This approach avoids storing additional data in the global store and ensures this logic
// can be removed in the future with minimal impact.
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationDetailsFooter.tsx">
import { ListItemAction } from "@io-app/design-system";
import I18n from "i18next";
import { memo, ReactNode, useMemo } from "react";
import { View } from "react-native";
⋮----
import { useOfflineToastGuard } from "../../../../../hooks/useOfflineToastGuard.ts";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { useFIMSRemoteServiceConfiguration } from "../../../../fims/common/hooks";
import { useNotAvailableToastGuard } from "../../../common/hooks/useNotAvailableToastGuard.ts";
import { itwIPatenteCtaConfigSelector } from "../../../common/store/selectors/remoteConfig.ts";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils.ts";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../../navigation/routes.ts";
import { getCredentialDocumentNumber } from "../../../trustmark/utils";
import { trackItwCredentialManageConsent } from "../../proximity/analytics";
import { itwProximityConsentsByCredentialTypeSelector } from "../../proximity/store/selectors/consents";
import { useItwRemoveCredentialWithConfirm } from "../hooks/useItwRemoveCredentialWithConfirm";
import { useItwStartCredentialSupportRequest } from "../hooks/useItwStartCredentialSupportRequest.tsx";
⋮----
type IPatenteListItemActionProps = {
  docNumber?: string;
};
⋮----
type ItwPresentationDetailFooterProps = {
  credential: CredentialMetadata;
};
⋮----
const ItwPresentationDetailsFooter = ({
  credential
}: ItwPresentationDetailFooterProps) =>
⋮----
const getCredentialActions = (credential: CredentialMetadata): ReactNode =>
⋮----
const IPatenteListItemAction = (
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationDetailsHeader.tsx">
import {
  Body,
  ContentWrapper,
  H2,
  makeFontStyleObject,
  Tag,
  useIOExperimentalDesign
} from "@io-app/design-system";
import Color from "color";
import I18n from "i18next";
import { memo, useMemo } from "react";
import { StyleSheet, Text, View } from "react-native";
⋮----
import ItwAvatar from "../../../../../../img/features/itWallet/brand/itw_avatar.svg";
import FocusAwareStatusBar from "../../../../../components/ui/FocusAwareStatusBar.tsx";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { useCredentialCardConfig } from "../../../common/components/ItwCredentialCard/config.ts";
import { ItwCredentialDetailCard } from "../../../common/components/ItwCredentialDetailCard.tsx";
import { useItwAuthSourceName } from "../../../common/hooks/useItwAuthSourceName.ts";
import { useItwCredentialName } from "../../../common/hooks/useItwCredentialName.ts";
import { itwShouldUpgradeCredentialSelector } from "../../../common/store/selectors";
import { useTagPropsByStatus } from "../../../common/utils/itwCredentialUtils.ts";
import { CredentialType } from "../../../common/utils/itwMocksUtils.ts";
import { getLegacyThemeColorByCredentialType } from "../../../common/utils/itwStyleUtils.ts";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils.ts";
import {
  itwCredentialsEidStatusSelector,
  itwCredentialStatusSelector
} from "../../../credentials/store/selectors";
import { useItwDisplayCredentialStatus } from "../hooks/useItwDisplayCredentialStatus";
import { ItwPresentationCredentialCard } from "./ItwPresentationCredentialCard.tsx";
⋮----
type ItwPresentationDetailsHeaderProps = {
  credential: CredentialMetadata;
};
⋮----
const ItwPresentationDetailsHeader = ({
  credential
}: ItwPresentationDetailsHeaderProps) =>
⋮----
const ItwPresentationDetailsHeaderLegacy = ({
  credential
}: ItwPresentationDetailsHeaderProps) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationDetailsScreenBase.tsx">
import Color from "color";
import { ReactNode, useMemo } from "react";
import Animated, {
  useAnimatedRef,
  useSharedValue
} from "react-native-reanimated";
⋮----
import {
  IOScrollView,
  IOScrollViewActions
} from "../../../../../components/ui/IOScrollView.tsx";
import { ButtonBlockProps } from "../../../../../components/ui/utils/buttons.ts";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel.tsx";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { isScreenReaderEnabledSelector } from "../../../../../store/reducers/preferences";
import { useCredentialCardConfig } from "../../../common/components/ItwCredentialCard/config.ts";
import { useItwCredentialName } from "../../../common/hooks/useItwCredentialName.ts";
import { getLegacyThemeColorByCredentialType } from "../../../common/utils/itwStyleUtils.ts";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils.ts";
import { itwDiscoverMoreCEDSelector } from "../../../credentialsCatalogue/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors/index.ts";
⋮----
export type CredentialCtaProps = ButtonBlockProps;
⋮----
export type CredentialDiscoverMoreProps = Extract<
  IOScrollViewActions,
  { type: "TwoButtons" }
>["secondary"];
⋮----
type ItwPresentationDetailsScreenBaseProps = {
  children?: ReactNode;
  credential: CredentialMetadata;
  ctaProps?: CredentialCtaProps;
  discoverMoreProps?: CredentialDiscoverMoreProps;
  headerTransparent?: boolean;
};
⋮----
const ItwPresentationDetailsScreenBase = ({
  credential,
  children,
  ctaProps,
  discoverMoreProps,
  headerTransparent = false
}: ItwPresentationDetailsScreenBaseProps) =>
⋮----
const check = (): IOScrollViewActions | undefined =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationFiscalCode.tsx">
import {
  H3,
  IOColors,
  IODimensions,
  useScaleAnimation
} from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
import { Dimensions, Pressable, StyleSheet } from "react-native";
import Barcode from "react-native-barcode-builder";
import Animated from "react-native-reanimated";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { selectFiscalCodeFromEid } from "../../../credentials/store/selectors";
import { ITW_ROUTES } from "../../../navigation/routes.ts";
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationNewCredentialValidityAlert.tsx">
import { Banner } from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { itwCloseBanner } from "../../../common/store/actions/banners";
import { getNewCredentialValidityBannerId } from "../../../common/store/reducers/banners";
import { itwIsBannerVisibleSelector } from "../../../common/store/selectors/banners";
import { NewCredential } from "../../../common/utils/itwCredentialUtils";
import { CredentialType } from "../../../common/utils/itwMocksUtils";
⋮----
type Props = {
  credentialType: ValidityAlertCredential;
};
⋮----
type ValidityAlertCredential = Exclude<
  NewCredential,
  CredentialType.PROOF_OF_AGE
>;
⋮----
export const ItwPresentationNewCredentialValidityAlert = ({
  credentialType
}: Props) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationPidDetail.tsx">
import { Divider, ListItemHeader } from "@io-app/design-system";
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useMemo } from "react";
import { View } from "react-native";
import { Fragment } from "react/jsx-runtime";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { ItwCredentialClaim } from "../../../common/components/ItwCredentialClaim";
import { ItwEidLifecycleAlert } from "../../../common/components/ItwEidLifecycleAlert";
import { ItwIssuanceMetadata } from "../../../common/components/ItwIssuanceMetadata";
import { itwSetClaimValuesHidden } from "../../../common/store/actions/preferences";
import { itwIsClaimValueHiddenSelector } from "../../../common/store/selectors/preferences";
import {
  parseClaims,
  WellKnownClaim
} from "../../../common/utils/itwClaimsUtils";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils";
⋮----
type Props = {
  credential: CredentialMetadata;
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationPidDetailFooter.tsx">
import { ListItemAction, useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
import { Alert, View } from "react-native";
⋮----
import { useOfflineToastGuard } from "../../../../../hooks/useOfflineToastGuard";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { openWebUrl } from "../../../../../utils/url.ts";
import { trackItwStartDeactivation } from "../../../analytics";
import { itwShowcaseUrlSelector } from "../../../common/store/selectors/remoteConfig.ts";
import { ItwEidIssuanceMachineContext } from "../../../machine/eid/provider";
import { ITW_PRESENTATION_DETAILS_SCREENVIEW_EVENTS } from "../analytics/enum";
⋮----
const handleRevokePress = () =>
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/components/ItwPresentationWalletUpgradeMDLDetailsBanner.tsx">
import { Banner } from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../../store/hooks";
import {
  trackItwBannerClosure,
  trackItwBannerTap,
  trackItwBannerVisualized
} from "../../../analytics";
import { ITW_SCREENVIEW_EVENTS } from "../../../analytics/enum";
import { itwCloseBanner } from "../../../common/store/actions/banners";
import { ITW_ROUTES } from "../../../navigation/routes";
⋮----
export const ItwPresentationWalletUpgradeMDLDetailsBanner = () =>
⋮----
const handleOnPress = () =>
⋮----
const handleOnClose = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/hooks/useItwCopyClaimValue.ts">
import { useIOSelector } from "../../../../../store/hooks";
import { clipboardSetStringWithFeedback } from "../../../../../utils/clipboard";
import { trackCopyListItem } from "../../../analytics";
import { getMixPanelCredential } from "../../../analytics/utils";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
⋮----
export const useItwCopyClaimValue = (credentialType: string) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/hooks/useItwDisplayCredentialStatus.tsx">
import { useIOSelector } from "../../../../../store/hooks";
import { offlineAccessReasonSelector } from "../../../../ingress/store/selectors";
import { CredentialType } from "../../../common/utils/itwMocksUtils";
import { ItwCredentialStatus } from "../../../common/utils/itwTypesUtils";
import { itwCredentialsEidStatusSelector } from "../../../credentials/store/selectors";
import { getItwDisplayCredentialStatus } from "../utils";
⋮----
export const useItwDisplayCredentialStatus = (
  credentialStatus: ItwCredentialStatus,
  credentialType: string
): ItwCredentialStatus =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/hooks/useItwExpiredDocumentBottomSheet.tsx">
import { IOButton, IOMarkdown, VStack } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { trackCredentialRenewStart } from "../../../analytics";
import { getMixPanelCredential } from "../../../analytics/utils";
import { CREDENTIAL_STATUS_MAP } from "../../../analytics/utils/types";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../../navigation/routes";
import { useItwRemoveCredentialWithConfirm } from "./useItwRemoveCredentialWithConfirm";
⋮----
type UseItwExpiredDocumentBottomSheetParams = {
  actionsShown?: boolean;
  credential: CredentialMetadata;
  localizedMessage: { description: string; title: string };
};
⋮----
const handleUpdateCredential = () =>
⋮----
label=
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/hooks/useItwIssuerDynamicErrorBottomSheet.tsx">
import { IOButton, IOMarkdown, VStack } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { trackCredentialRenewStart } from "../../../analytics";
import { getMixPanelCredential } from "../../../analytics/utils";
import { CREDENTIAL_STATUS_MAP } from "../../../analytics/utils/types";
import { CredentialType } from "../../../common/utils/itwMocksUtils";
import {
  CredentialMetadata,
  ItwCredentialStatus
} from "../../../common/utils/itwTypesUtils";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../../navigation/routes";
import { shouldShowMdlUpdateDigitalCredential } from "../utils";
import { useItwRemoveCredentialWithConfirm } from "./useItwRemoveCredentialWithConfirm";
⋮----
type IssuerDynamicErrorBottomSheetActionMode =
  | "none"
  | "removeOnly"
  | "updateAndRemove";
⋮----
type IssuerDynamicErrorBottomSheetContentConfig = {
  actionMode: IssuerDynamicErrorBottomSheetActionMode;
  showDrivingLicenseExtraContent: boolean;
};
⋮----
type UseItwIssuerDynamicErrorBottomSheetParams = {
  credential: CredentialMetadata;
  localizedMessage: { description: string; title: string };
  status?: ItwCredentialStatus;
};
⋮----
export const getIssuerDynamicErrorBottomSheetContentConfig = (
  credential: CredentialMetadata,
  status?: ItwCredentialStatus
): IssuerDynamicErrorBottomSheetContentConfig =>
⋮----
const handleUpdateCredential = () =>
⋮----
label=
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/hooks/useItwRemoveCredentialWithConfirm.tsx">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { Alert } from "react-native";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { getMixPanelCredential } from "../../../analytics/utils";
import {
  CREDENTIAL_STATUS_MAP,
  ItwCredentialActionPosition
} from "../../../analytics/utils/types";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils";
import { itwCredentialsRemoveByType } from "../../../credentials/store/actions";
import { itwCredentialStatusSelector } from "../../../credentials/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { trackItwCredentialDelete } from "../analytics";
⋮----
export const useItwRemoveCredentialWithConfirm = (
  credential: CredentialMetadata,
  position: ItwCredentialActionPosition = "screen"
) =>
⋮----
const handleRemoveCredential = () =>
⋮----
const confirmAndRemoveCredential = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/hooks/useItwStartCredentialSupportRequest.tsx">
import { useCallback } from "react";
⋮----
import { useIOSelector } from "../../../../../store/hooks.ts";
import { getMixPanelCredential } from "../../../analytics/utils/index.ts";
import {
  useItwZendeskSupport,
  ZendeskSubcategoryValue
} from "../../../common/hooks/useItwZendeskSupport";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils.ts";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { trackWalletCredentialSupport } from "../analytics";
⋮----
const getErrorCodeFromCredential = (
  credential: CredentialMetadata
): string | undefined =>
⋮----
export const useItwStartCredentialSupportRequest = (
  credential: CredentialMetadata
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/screens/ItwPresentationCredentialAttachmentScreen.tsx">
import {
  FooterActions,
  FooterActionsMeasurements,
  IOColors,
  useIOToast
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import { File, Paths } from "expo-file-system";
⋮----
import I18n from "i18next";
import { useCallback, useState } from "react";
import { StyleSheet, View } from "react-native";
import Pdf from "react-native-pdf";
⋮----
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel.tsx";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList.ts";
import { useIOSelector } from "../../../../../store/hooks";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture.ts";
import { ItwGenericErrorContent } from "../../../common/components/ItwGenericErrorContent.tsx";
import {
  getClaimsFullLocale,
  isPdfClaim
} from "../../../common/utils/itwClaimsUtils.ts";
import { ParsedCredential } from "../../../common/utils/itwTypesUtils.ts";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { ItwParamsList } from "../../../navigation/ItwParamsList.ts";
import { trackWalletCredentialFAC_SIMILE } from "../analytics";
⋮----
export type ItwPresentationCredentialAttachmentNavigationParams = {
  attachmentClaim: ParsedCredential[string];
};
⋮----
type AttachmentData = {
  fileName: string;
  type: SupportedAttachmentType;
  uri: string;
};
⋮----
type ScreenProps = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_PRESENTATION_CREDENTIAL_ATTACHMENT"
>;
⋮----
type SupportedAttachmentType = "application/pdf";
⋮----
const handleOnShare =
(
⋮----
const handleFooterActionsMeasurements = (
    values: FooterActionsMeasurements
) =>
⋮----
const getAttachmentData = ({
  name,
  value
}: ParsedCredential[string]): AttachmentData | undefined =>
⋮----
// TODO: Dark mode: Replace with theme values
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/screens/ItwPresentationCredentialCardModal.tsx">
import { HeaderSecondLevel, useIOTheme, VSpacer } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { memo, useCallback, useLayoutEffect, useState } from "react";
import { StyleSheet, useWindowDimensions, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList.ts";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks.ts";
import { useMaxBrightness } from "../../../../../utils/brightness.ts";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture.ts";
import { getMixPanelCredential } from "../../../analytics/utils";
import {
  ItwSkeumorphicCard,
  SKEUMORPHIC_CARD_ASPECT_RATIO
} from "../../../common/components/ItwSkeumorphicCard";
import { FlipGestureDetector } from "../../../common/components/ItwSkeumorphicCard/FlipGestureDetector.tsx";
import { itwSetClaimValuesHidden } from "../../../common/store/actions/preferences.ts";
import { itwIsClaimValueHiddenSelector } from "../../../common/store/selectors/preferences.ts";
import {
  CredentialMetadata,
  ItwCredentialStatus
} from "../../../common/utils/itwTypesUtils.ts";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { ItwParamsList } from "../../../navigation/ItwParamsList.ts";
import { trackCredentialCardModal } from "../analytics";
import { ItwPresentationCredentialCardFlipButton } from "../components/ItwPresentationCredentialCardFlipButton.tsx";
import { ItwPresentationCredentialCardHideValuesButton } from "../components/ItwPresentationCredentialCardHideValuesButton.tsx";
⋮----
export type ItwPresentationCredentialCardModalNavigationParams = {
  credential: CredentialMetadata;
  status: ItwCredentialStatus;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_PRESENTATION_CREDENTIAL_CARD_MODAL"
>;
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/screens/ItwPresentationCredentialDetailScreen.tsx">
import {
  ContentWrapper,
  IOButton,
  Optional,
  VStack
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { View } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { useOfflineToastGuard } from "../../../../../hooks/useOfflineToastGuard.ts";
import {
  IOStackNavigationRouteProps,
  useIONavigation
} from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture";
import { useFIMSRemoteServiceConfiguration } from "../../../../fims/common/hooks";
import { identificationRequest } from "../../../../identification/store/actions";
import { getMixPanelCredential } from "../../../analytics/utils";
import { CREDENTIAL_STATUS_MAP } from "../../../analytics/utils/types";
import ItwCredentialNotFound from "../../../common/components/ItwCredentialNotFound";
import { PoweredByItWalletText } from "../../../common/components/PoweredByItWalletText";
import { isItwProximityEnabledSelector } from "../../../common/store/selectors";
import { itwIsL3EnabledSelector } from "../../../common/store/selectors/index";
import { WellKnownClaim } from "../../../common/utils/itwClaimsUtils";
import { CredentialType } from "../../../common/utils/itwMocksUtils";
import {
  CredentialMetadata,
  isMultiLevelCredential
} from "../../../common/utils/itwTypesUtils";
import {
  itwCredentialSelector,
  itwCredentialStatusSelector
} from "../../../credentials/store/selectors";
import {
  itwLifecycleIsITWalletValidSelector,
  itwLifecycleIsValidSelector
} from "../../../lifecycle/store/selectors";
import { ItwParamsList } from "../../../navigation/ItwParamsList";
import { ITW_ROUTES } from "../../../navigation/routes";
import { ItwCredentialTrustmark } from "../../../trustmark/components/ItwCredentialTrustmark";
import { trackItwProximityShowQrCode } from "../../proximity/analytics";
import { ITW_PROXIMITY_ROUTES } from "../../proximity/navigation/routes";
import { isPresentableCredentialSelector } from "../../proximity/store/selectors/credentials";
import {
  trackCredentialDetail,
  trackWalletCredentialOpportunities,
  trackWalletCredentialShowFAC_SIMILE,
  trackWalletCredentialShowTrustmark
} from "../analytics";
import { ItwPresentationAdditionalInfoSection } from "../components/ItwPresentationAdditionalInfoSection";
import { ItwPresentationClaimsSection } from "../components/ItwPresentationClaimsSection";
import { ItwPresentationCredentialInfoAlert } from "../components/ItwPresentationCredentialInfoAlert";
import { ItwPresentationCredentialStatusAlert } from "../components/ItwPresentationCredentialStatusAlert";
import { ItwPresentationCredentialUnknownStatus } from "../components/ItwPresentationCredentialUnknownStatus";
import { ItwPresentationDetailsFooter } from "../components/ItwPresentationDetailsFooter";
import {
  ItwPresentationDetailsHeader,
  ItwPresentationDetailsHeaderLegacy
} from "../components/ItwPresentationDetailsHeader";
import {
  CredentialCtaProps,
  CredentialDiscoverMoreProps,
  ItwPresentationDetailsScreenBase
} from "../components/ItwPresentationDetailsScreenBase";
import { useItwDisplayCredentialStatus } from "../hooks/useItwDisplayCredentialStatus";
⋮----
export type ItwPresentationCredentialDetailNavigationParams = {
  credentialType: string;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_PRESENTATION_CREDENTIAL_DETAIL"
>;
⋮----
isL3
⋮----
const handleTrustmarkPress = () =>
⋮----
const handleDiscoverMoreOpportunities = () =>
⋮----
const handleOpenCard = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/screens/ItwPresentationCredentialFiscalCodeModal.tsx">
import {
  BodySmall,
  H3,
  HeaderSecondLevel,
  IOColors,
  IODimensions
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { memo, useCallback, useLayoutEffect } from "react";
import { Dimensions, StyleSheet, View } from "react-native";
import Barcode from "react-native-barcode-builder";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { useMaxBrightness } from "../../../../../utils/brightness.ts";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture.ts";
import {
  selectFiscalCodeFromEid,
  selectNameSurnameFromEid
} from "../../../credentials/store/selectors";
import { trackCredentialCardModal } from "../analytics";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/screens/ItwPresentationEidVerificationExpiredScreen.tsx">
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent.tsx";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { trackItwSurveyRequest } from "../../../analytics";
import { useItwEidFeedbackBottomSheet } from "../../../common/hooks/useItwEidFeedbackBottomSheet.tsx";
import { ITW_ROUTES } from "../../../navigation/routes.ts";
import {
  trackItwEidReissuingMandatory,
  trackItwEidReissuingMandatoryCancel,
  trackItwEidReissuingMandatoryConfirm
} from "../analytics";
import { ItwEidReissuingTrigger } from "../analytics/types";
⋮----
export const ItwPresentationEidVerificationExpiredScreen = () =>
⋮----
const startEidReissuing = () =>
⋮----
trackItwEidReissuingMandatoryCancel(
              ItwEidReissuingTrigger.ADD_CREDENTIAL
            );
trackItwSurveyRequest({
              survey_id: "confirm_eid_flow_exit",
              survey_page: routeName
            });
eidFeedbackBottomSheet.present();
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/screens/ItwPresentationPidDetailScreen.tsx">
import { ContentWrapper, VStack } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import { useCallback } from "react";
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import { mapPIDStatusToMixpanel } from "../../../analytics/utils";
import { PoweredByItWalletText } from "../../../common/components/PoweredByItWalletText";
import { itwIsBannerVisibleSelector } from "../../../common/store/selectors/banners";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils";
import {
  itwCredentialsEidSelector,
  itwCredentialsEidStatusSelector
} from "../../../credentials/store/selectors";
import { trackCredentialDetail } from "../analytics";
import { ItwDiscoveryInfoBanner } from "../components/ItwDiscoveryInfoBanner";
import { ItwPresentationDetailsHeader } from "../components/ItwPresentationDetailsHeader";
import { ItwPresentationDetailsScreenBase } from "../components/ItwPresentationDetailsScreenBase";
import { ItwPresentationPidDetail } from "../components/ItwPresentationPidDetail";
import { ItwPresentationPidDetailFooter } from "../components/ItwPresentationPidDetailFooter";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/details/utils/index.ts">
import { CredentialType } from "../../../common/utils/itwMocksUtils";
import {
  CredentialMetadata,
  ItwCredentialStatus,
  ItwEidStatus
} from "../../../common/utils/itwTypesUtils";
⋮----
export const getItwDisplayCredentialStatus = (
  credentialStatus: ItwCredentialStatus,
  eidStatus: ItwEidStatus | undefined,
  isOffline: boolean,
  isEid: boolean
): ItwCredentialStatus =>
⋮----
export const isMdlSuspendedIssuerError = ({
  credentialType,
  validity
}: CredentialMetadata) =>
⋮----
export const shouldShowMdlUpdateDigitalCredential = (
  credential: CredentialMetadata,
  status?: ItwCredentialStatus
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/__mocks__/credentials.ts">
import {
  CredentialBundle,
  CredentialMetadata
} from "../../../common/utils/itwTypesUtils";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/analytics/enum.ts">
export enum ITW_PROXIMITY_ACTIONS_EVENTS {
  ITW_BLUETOOTH_ACCESS_CLOSE = "ITW_BLUETOOTH_ACCESS_CLOSE",
  ITW_BLUETOOTH_ACCESS_GO_TO_SETTINGS = "ITW_BLUETOOTH_ACCESS_GO_TO_SETTINGS",
  ITW_BLUETOOTH_ACTIVATION_CLOSE = "ITW_BLUETOOTH_ACTIVATION_CLOSE",
  ITW_BLUETOOTH_ACTIVATION_GO_TO_SETTINGS = "ITW_BLUETOOTH_ACTIVATION_GO_TO_SETTINGS",
  ITW_BLUETOOTH_BLOCK_ACTION = "ITW_BLUETOOTH_BLOCK_ACTION",
  ITW_CREDENTIAL_MANAGE_CONSENT = "ITW_CREDENTIAL_MANAGE_CONSENT",
  ITW_PROXIMITY_NFC_ACTIVATION_CLOSE = "ITW_PROXIMITY_NFC_ACTIVATION_CLOSE",
  ITW_PROXIMITY_NFC_GO_TO_SETTINGS = "ITW_PROXIMITY_NFC_GO_TO_SETTINGS",
  ITW_PROXIMITY_NFC_START = "ITW_PROXIMITY_NFC_START",
  ITW_PROXIMITY_QR_CODE_LOADING_RETRY = "ITW_PROXIMITY_QR_CODE_LOADING_RETRY",
  ITW_PROXIMITY_RP_NOT_TRUSTED_BOTTOMSHEET = "ITW_PROXIMITY_RP_NOT_TRUSTED_BOTTOMSHEET",
  ITW_PROXIMITY_RP_NOT_TRUSTED_DISCOVER_MORE = "ITW_PROXIMITY_RP_NOT_TRUSTED_DISCOVER_MORE",
  ITW_PROXIMITY_SAVE_PREFERENCES_CONFIRM = "ITW_PROXIMITY_SAVE_PREFERENCES_CONFIRM",
  ITW_PROXIMITY_SAVE_PREFERENCES_DISMISS = "ITW_PROXIMITY_SAVE_PREFERENCES_DISMISS",
  ITW_PROXIMITY_SHOW_QR_CODE = "ITW_PROXIMITY_SHOW_QR_CODE",
  ITW_PROXIMITY_UX_CONVERSION = "ITW_PROXIMITY_UX_CONVERSION",
  ITW_REVOKE_CONSENT = "ITW_REVOKE_CONSENT",
  ITW_REVOKE_CONSENT_OPERATION_BLOCK_ACTION = "ITW_REVOKE_CONSENT_OPERATION_BLOCK_ACTION",
  ITW_START_REISSUING_PID = "ITW_START_REISSUING_PID"
}
⋮----
export enum ITW_PROXIMITY_ERRORS_EVENTS {
  ITW_PROXIMITY_GENERIC_ERROR = "ITW_PROXIMITY_GENERIC_ERROR",
  ITW_PROXIMITY_MANDATORY_CREDENTIAL_MISSING = "ITW_PROXIMITY_MANDATORY_CREDENTIAL_MISSING",
  ITW_PROXIMITY_NFC_SESSION_ERROR = "ITW_PROXIMITY_NFC_SESSION_ERROR",
  ITW_PROXIMITY_NFC_SESSION_TIMEOUT = "ITW_PROXIMITY_NFC_SESSION_TIMEOUT",
  ITW_PROXIMITY_QR_CODE_LOADING_FAILURE = "ITW_PROXIMITY_QR_CODE_LOADING_FAILURE",
  ITW_PROXIMITY_REQUEST_OBJECT_FAILURE = "ITW_PROXIMITY_REQUEST_OBJECT_FAILURE",
  ITW_PROXIMITY_RP_NOT_TRUSTED = "ITW_PROXIMITY_RP_NOT_TRUSTED",
  ITW_PROXIMITY_TIMEOUT = "ITW_PROXIMITY_TIMEOUT",
  ITW_PROXIMITY_UNEXPECTED_FAILURE = "ITW_PROXIMITY_UNEXPECTED_FAILURE"
}
⋮----
export enum ITW_PROXIMITY_SCREENVIEW_EVENTS {
  ITW_BLUETOOTH_ACCESS = "ITW_BLUETOOTH_ACCESS",
  ITW_BLUETOOTH_ACCESS_DENIED = "ITW_BLUETOOTH_ACCESS_DENIED",
  ITW_BLUETOOTH_ACTIVATION = "ITW_BLUETOOTH_ACTIVATION",
  ITW_BLUETOOTH_BLOCK = "ITW_BLUETOOTH_BLOCK",
  ITW_BLUETOOTH_NOT_ACTIVATED = "ITW_BLUETOOTH_NOT_ACTIVATED",
  ITW_CONSENT_MANAGEMENT = "ITW_CONSENT_MANAGEMENT",
  ITW_CONSENT_MANAGEMENT_DETAIL = "ITW_CONSENT_MANAGEMENT_DETAIL",
  ITW_PROXIMITY_DATA_SHARE = "ITW_PROXIMITY_DATA_SHARE",
  ITW_PROXIMITY_NFC_ACTIVATION = "ITW_PROXIMITY_NFC_ACTIVATION",
  ITW_PROXIMITY_QR_CODE = "ITW_PROXIMITY_QR_CODE",
  ITW_PROXIMITY_SAVE_PREFERENCES = "ITW_PROXIMITY_SAVE_PREFERENCES",
  ITW_PROXIMITY_UX_SUCCESS = "ITW_PROXIMITY_UX_SUCCESS",
  ITW_REVOKE_CONSENT_OPERATION_BLOCK = "ITW_REVOKE_CONSENT_OPERATION_BLOCK"
}
⋮----
export enum ITW_PROXIMITY_TECH_EVENTS {
  ITW_PROXIMITY_START = "ITW_PROXIMITY_START"
}
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/analytics/index.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { buildEventProperties } from "../../../../../utils/analytics";
import {
  ITW_PROXIMITY_ACTIONS_EVENTS,
  ITW_PROXIMITY_ERRORS_EVENTS,
  ITW_PROXIMITY_SCREENVIEW_EVENTS,
  ITW_PROXIMITY_TECH_EVENTS
} from "./enum";
import {
  ItwProximityFailure,
  ItwProximityFlowFailure,
  ItwProximityFlowProperties,
  ItwProximityGenericFailure,
  ItwProximityHttpFailure,
  ItwProximityQrCode,
  ItwProximityShowQrCode,
  ItwRevokeConsentUserAction,
  ItwStartReissuingPID
} from "./types";
⋮----
export const trackItwProximityBluetoothBlock = () =>
⋮----
export const trackItwProximityBluetoothAccess = () =>
⋮----
export const trackItwProximityBluetoothAccessDenied = () =>
⋮----
export const trackItwProximityBluetoothActivation = () =>
⋮----
export const trackItwProximityBluetoothNotActivated = () =>
⋮----
export const trackItwConsentManagement = () =>
⋮----
export const trackItwConsentManagementDetail = () =>
⋮----
export const trackItwRevokeConsentOperationBlock = () =>
⋮----
export const trackItwProximityQrCode = ({
  source,
  qr_code_status
}: ItwProximityQrCode) =>
⋮----
export const trackItwProximityDataShare = ({
  proximity_flow
}: ItwProximityFlowProperties) =>
⋮----
export const trackItwProximityPresentationCompleted = ({
  proximity_flow
}: ItwProximityFlowProperties) =>
⋮----
export const trackItwProximityRpNotTrustedBottomSheet = () =>
⋮----
export const trackItwProximitySavePreferences = () =>
⋮----
export const trackItwProximityRpNotTrustedDiscoverMore = () =>
⋮----
export const trackItwProximityNfcActivation = () =>
⋮----
export const trackItwProximityShowQrCode = ({
  credential,
  position
}: ItwProximityShowQrCode) =>
⋮----
export const trackItwCredentialManageConsent = () =>
⋮----
export const trackItwRevokeConsent = () =>
⋮----
export const trackItwRevokeConsentOperationBlockAction = (
  user_action: ItwRevokeConsentUserAction
) =>
⋮----
export const trackItwProximityBluetoothBlockAction = (user_action: string) =>
⋮----
export const trackItwProximityBluetoothAccessGoToSettings = () =>
⋮----
export const trackItwProximityBluetoothAccessClose = () =>
⋮----
export const trackItwProximityBluetoothActivationClose = () =>
⋮----
export const trackItwProximityBluetoothActivationGoToSettings = () =>
⋮----
export const trackItwProximityQrCodeLoadingRetry = () =>
⋮----
export const trackItwProximityContinuePresentation = ({
  proximity_flow
}: ItwProximityFlowProperties) =>
⋮----
export const trackItwProximityNfcStart = () =>
⋮----
export const trackItwProximityNfcActivationClose = () =>
⋮----
export const trackItwProximityNfcGoToSettings = () =>
⋮----
export const trackItwProximitySavePreferencesConfirm = () =>
⋮----
export const trackItwProximitySavePreferencesDismiss = () =>
⋮----
export const trackItwStartReissuingPID = ({
  position
}: ItwStartReissuingPID) =>
⋮----
... (53 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/analytics/types.ts">
import { MixPanelCredential } from "../../../analytics/utils/types";
⋮----
export type ItwProximityFailure = {
  origin?: string;
  reason: unknown;
  type: string;
};
⋮----
export type ItwProximityFlowFailure = ItwProximityFailure &
  ItwProximityFlowProperties;
⋮----
export type ItwProximityFlowProperties = {
  proximity_flow: ProximityFlow;
};
⋮----
export type ItwProximityGenericFailure = ItwProximityFlowFailure & {
  proximity_sharing_status: "post" | "pre";
};
⋮----
export type ItwProximityHttpFailure = {
  reason: unknown;
};
⋮----
export type ItwProximityQrCode = {
  qr_code_status: "generation_failed" | "PID_expired" | "valid";
  source: "ITW_CREDENTIAL_DETAIL" | "WALLET_HOME";
};
⋮----
export type ItwProximityShowQrCode = {
  credential: "general" | MixPanelCredential;
  position:
    | "ITW_CREDENTIAL_CARD_MODAL"
    | "ITW_CREDENTIAL_DETAIL"
    | "WALLET_HOME";
};
⋮----
export type ItwRevokeConsentUserAction = "cancel" | "confirm";
⋮----
export type ItwStartReissuingPID = {
  position:
    | "ITW_CREDENTIAL_DETAIL"
    | "ITW_PRESENTATION_PID_DETAIL"
    | "ITW_QR_CODE";
};
⋮----
export type ProximityFlow = "nfc_ble" | "nfc_nfc" | "qr_code";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/analytics/utils.ts">
import type { Context } from "../machine/context";
⋮----
import { ProximityFlow } from "./types";
⋮----
export const getProximityFlow = ({
  engagementMode,
  retrievalMethod
}: Pick<Context, "engagementMode" | "retrievalMethod">): ProximityFlow =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/components/ItwConsentClaims.tsx">
import { VStack } from "@io-app/design-system";
import { useMemo } from "react";
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../../../../store/hooks";
import {
  ClaimDisplayFormat,
  parseClaims
} from "../../../common/utils/itwClaimsUtils";
import {
  CredentialFormat,
  CredentialMetadata
} from "../../../common/utils/itwTypesUtils";
import { makeSelectAllCredentials } from "../../../credentials/store/selectors";
import { ItwClaimsSelector } from "../../common/components/ItwClaimsSelector";
import { StoredConsentData } from "../store/types";
⋮----
type Props = {
  consent: StoredConsentData;
};
⋮----
export const getConsentClaimsByCredential = (
  consent: StoredConsentData,
  credentialsByType: Partial<Record<string, CredentialMetadata>>
)
⋮----
export const ItwConsentClaims = (
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/components/ItwConsentManagementListItem.tsx">
import { ListItemNav } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { format } from "../../../../../utils/dates";
import { StoredConsentData } from "../store/types";
⋮----
type Props = {
  consent: StoredConsentData;
  onPress: () => void;
};
⋮----
export const getConsentSavedAtDescription = (
  savedAt: string | undefined
): string | undefined =>
⋮----
export const ItwConsentManagementListItem = ({ consent, onPress }: Props) => (
  <ListItemNav
    accessibilityLabel={I18n.t(
      "features.itWallet.presentation.proximity.consentManagement.accessibility.openDetail",
      {
        relyingParty: consent.rpDisplayName ?? consent.rpId
      }
    )}
    description={getConsentSavedAtDescription(consent.savedAt)}
    icon="institution"
    label={consent.rpDisplayName ?? consent.rpId}
    onPress={onPress}
  />
);
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/components/ItwProximityConnectionLoadingComponent.tsx">
import { HeaderSecondLevel } from "@io-app/design-system";
import I18n from "i18next";
import { useLayoutEffect } from "react";
⋮----
import { LoadingScreenContent } from "../../../../../components/screens/LoadingScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
⋮----
export const ItwProximityConnectionLoadingComponent = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/components/ItwProximityPresentationDetails.tsx">
import { VStack } from "@io-app/design-system";
import { memo } from "react";
import { View } from "react-native";
⋮----
import { ItwClaimsSelector } from "../../common/components/ItwClaimsSelector";
import { ProximityDetails } from "../utils/types";
⋮----
type ItwProximityPresentationDetailsProps = {
  data: ProximityDetails;
};
⋮----
const ItwProximityPresentationDetails = ({
  data
}: ItwProximityPresentationDetailsProps) => (
  <View>
    <VStack space={24}>
      {data.map(({ claimsToDisplay, credentialType }) => (
        <ItwClaimsSelector
          credentialType={credentialType}
          defaultExpanded
          items={claimsToDisplay}
          key={credentialType}
          selectionEnabled={false}
        />
      ))}
    </VStack>
  </View>
);
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/components/ItwProximityQrCodeImage.tsx">
import {
  Body,
  Icon,
  IOButton,
  IOColors,
  IODimensions,
  IOSkeleton,
  useIOTheme
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { Dimensions, StyleSheet, View } from "react-native";
import QRCode from "react-native-qrcode-skia";
import Animated, { FadeIn } from "react-native-reanimated";
⋮----
import ItwIcon from "../../../../../../img/features/itWallet/brand/itw_icon.svg";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { useIOSelector } from "../../../../../store/hooks";
import { ITW_BRANDED_BOX_PADDING } from "../../../common/components/ItwBrandedBox";
import {
  trackItwProximityQrCode,
  trackItwProximityQrCodeLoadingRetry
} from "../analytics";
import { ItwProximityQrCode as ItwProximityQrCodeTracking } from "../analytics/types";
import { ItwProximityMachineContext } from "../machine/provider";
import { selectFailure, selectQRCodeString } from "../machine/selectors";
import { shouldShowExpiredProximityCredentialsBannerSelector } from "../store/selectors/credentials";
⋮----
type Props = {
  source?: ItwProximityQrCodeTracking["source"];
};
⋮----
const handleRetry = () =>
⋮----
label=
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/components/ItwProximityQrCodeInfoBanner.tsx">
import { Banner, IOToast } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { useIODispatch } from "../../../../../store/hooks";
import { openWebUrl } from "../../../../../utils/url";
import {
  trackItwBannerClosure,
  trackItwBannerTap,
  trackItwBannerVisualized
} from "../../../analytics";
import { itwCloseBanner } from "../../../common/store/actions/banners";
⋮----
const ItwProximityQrCodeInfoBanner = () =>
⋮----
const handleOnPress = () =>
⋮----
const handleOnClose = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/components/ItwProximitySendLoadingComponent.tsx">
import { HeaderSecondLevel } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useLayoutEffect, useMemo, useState } from "react";
⋮----
import { LoadingScreenContent } from "../../../../../components/screens/LoadingScreenContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
⋮----
type LoadingStep = 0 | 1 | 2;
⋮----
export const ItwProximitySendLoadingComponent = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/hooks/useItwProximityEventsTracking.ts">
import { useEffect } from "react";
⋮----
import {
  serializeFailureReason,
  shouldSerializeReason
} from "../../../common/utils/itwStoreUtils";
import {
  trackItwProximityMandatoryCredentialMissing,
  trackItwProximityNfcSessionError,
  trackItwProximityNfcSessionTimeout,
  trackItwProximityRPGenericFailure,
  trackItwProximityRpNotTrusted,
  trackItwProximityTimeout,
  trackItwProximityUnexpectedFailure
} from "../analytics";
import { ProximityFailure, ProximityFailureType } from "../machine/failure";
import { ItwProximityMachineContext } from "../machine/provider";
import {
  hasGivenConsentSelector,
  selectIsNfcRetrieval,
  selectProximityFlow
} from "../machine/selectors";
⋮----
type Params = {
  failure: ProximityFailure;
};
⋮----
export const useItwProximityEventsTracking = (
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/state/bluetooth.ts">
import { itwProximityMachineSetup } from "../setup";
import { ItwPresentationTags } from "../tags";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/state/nfc.ts">
import { assign } from "xstate";
⋮----
import { itwProximityMachineSetup } from "../setup";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/state/presentment.ts">
import { State } from "react-native-ble-plx";
import { and, assign, enqueueActions, not, or, stateIn } from "xstate";
⋮----
import { ProximityFailureType } from "../failure";
import { itwProximityMachineSetup } from "../setup";
import { ItwPresentationTags } from "../tags";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/actions.ts">
import { ActionArgs, assign } from "xstate";
⋮----
import { assert } from "../../../../../utils/assert";
import {
  trackItwProximityPresentationCompleted,
  trackItwProximityQrCodeLoadingFailure,
  trackItwProximityStart
} from "../analytics";
import { getProximityFlow } from "../analytics/utils";
import { ITW_PROXIMITY_ROUTES } from "../navigation/routes";
import { itwGrantProximityConsent } from "../store/actions";
import { itwPresentableCredentialsByDocTypeSelector } from "../store/selectors/credentials";
import {
  generateConsentKey,
  getConsentDataFromProximityDetails
} from "../store/utils";
import { Context } from "./context";
import { ProximityEvents } from "./events";
import { mapEventToFailure } from "./failure";
⋮----
export const navigateToBluetoothPermissionsScreenAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const navigateToBluetoothActivationScreenAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const navigateToNfcActivationScreenAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const navigateToNfcPresentmentScreenAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const navigateToPresentmentScreenAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const navigateToClaimsDisclosureScreenAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const navigateToStoreconsentScreenAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const navigateToSuccessScreenAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const navigateToFailureScreenAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const closeProximityAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const storeConsentAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const trackProximityStartAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const trackProximitySuccessAction = ({
  context
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
⋮----
export const trackQrCodeLoadingFailureAction = ({
  context,
  event
}: ActionArgs<Context, ProximityEvents, ProximityEvents>) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/actors.ts">
import { ISO18013_5 } from "@pagopa/io-react-native-iso18013";
import { fromCallback, fromPromise } from "xstate";
⋮----
import type { EventsPayload } from "../utils/types";
⋮----
import { assert } from "../../../../../utils/assert";
import { CredentialsVault } from "../../../credentials/utils/vault";
import {
  checkBluetoothActivation as checkBluetoothActivationUtil,
  checkBluetoothPermissions as checkBluetoothPermissionsUtil,
  subscribeBluetoothState
} from "../utils/ble";
import { checkNfcActivation as checkNfcActivationUtil } from "../utils/nfc";
import {
  generateAcceptedFields,
  getDocuments,
  getProximityDetails,
  promiseWithTimeout
} from "../utils/presentation";
import { Context } from "./context";
import { ProximityEvents } from "./events";
import { ProximityMachineDeps } from "./input";
⋮----
export type ProximityCommunicationLogicInput = Pick<Context, "credentials"> & {
  deps: ProximityMachineDeps;
};
⋮----
export type SendDocumentsActorInput = Pick<
  Context,
  "credentials" | "verifierRequest"
>;
⋮----
export type SendDocumentsActorOutput = Awaited<
  ReturnType<typeof ISO18013_5.sendResponse>
>;
⋮----
export type SendErrorResponseActorOutput = Awaited<
  ReturnType<typeof ISO18013_5.sendErrorResponse>
>;
⋮----
export type StartEngagementActorInput = {
  deps: ProximityMachineDeps;
  engagementMode: ISO18013_5.EngagementMode;
};
⋮----
const handleNfcStarted = () =>
⋮----
const handleNfcStopped = () =>
⋮----
const handleQrCodeString = (
    eventPayload: EventsPayload["onQrCodeString"]
) =>
⋮----
const handleDeviceConnecting = () =>
⋮----
const handleDeviceConnected = () =>
⋮----
const handleDeviceDisconnected = () =>
⋮----
const handleError = (eventPayload: EventsPayload["onError"]) =>
⋮----
const handleDocumentRequestReceived = (
    eventPayload: EventsPayload["onDocumentRequestReceived"]
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/context.ts">
import { ISO18013_5 } from "@pagopa/io-react-native-iso18013";
⋮----
import type { ProximityDetails, VerifierRequest } from "../utils/types";
⋮----
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils";
import { ProximityFailure } from "./failure";
import { ProximityMachineDeps } from "./input";
⋮----
export type Context = {
  credentials: Record<string, CredentialMetadata> | undefined;
  deps: ProximityMachineDeps;
  engagementMode: ISO18013_5.EngagementMode;
  failure?: ProximityFailure;
  grantedConsentKey?: string;
  proximityDetails?: ProximityDetails;
  qrCodeString?: string;
  retrievalMethod?: ISO18013_5.RetrievalMethod;
  sessionTerminated: boolean;
  verifierRequest?: VerifierRequest;
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/events.ts">
import { ISO18013_5 } from "@pagopa/io-react-native-iso18013";
import { State } from "react-native-ble-plx";
⋮----
import type { ProximityDetails, VerifierRequest } from "../utils/types";
⋮----
export type ProximityEvents =
  | BluetoothStateChanged
  | Close
  | Consent
  | Continue
  | DeviceConnected
  | DeviceConnecting
  | DeviceDisconnected
  | DeviceDocumentRequestReceived
  | DeviceError
  | NfcStarted
  | NfcStopped
  | QrCodeString
  | Retry
  | Start
  | StartNfcPresentment
  | StoreConsent;
⋮----
type BluetoothStateChanged = {
  state: State;
  type: "bluetooth-state-changed";
};
⋮----
type Close = {
  type: "close";
};
⋮----
type Consent = {
  type: "holder-consent";
};
⋮----
type Continue = {
  type: "continue";
};
⋮----
type DeviceConnected = {
  type: "device-connected";
};
⋮----
type DeviceConnecting = {
  type: "device-connecting";
};
⋮----
type DeviceDisconnected = {
  type: "device-disconnected";
};
⋮----
type DeviceDocumentRequestReceived = {
  proximityDetails: ProximityDetails;
  retrievalMethod: ISO18013_5.RetrievalMethod;
  type: "device-document-request-received";
  verifierRequest: VerifierRequest;
};
⋮----
type DeviceError = {
  error: Error;
  type: "device-error";
};
⋮----
type NfcStarted = {
  type: "nfc-started";
};
⋮----
type NfcStopped = {
  type: "nfc-stopped";
};
⋮----
type QrCodeString = {
  payload: string;
  type: "qr-code-string";
};
⋮----
type Retry = {
  type: "retry";
};
⋮----
type Start = {
  type: "start";
};
⋮----
type StartNfcPresentment = {
  type: "start-nfc-presentment";
};
⋮----
type StoreConsent = {
  type: "store-consent";
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/failure.ts">
import {
  MissingCredentialError,
  TimeoutError,
  UntrustedRpError
} from "../utils/errors";
import { ProximityEvents } from "./events";
⋮----
export enum ProximityFailureType {
  CONSENT_DENIED = "CONSENT_DENIED",
  MISSING_CREDENTIALS = "MISSING_CREDENTIALS",
  RELYING_PARTY_GENERIC = "RELYING_PARTY_GENERIC",
  TIMEOUT = "TIMEOUT",
  UNEXPECTED = "UNEXPECTED",
  UNTRUSTED_RP = "UNTRUSTED_RP"
}
⋮----
export type ProximityFailure =
  TypedProximityFailures[keyof TypedProximityFailures];
⋮----
type ReasonTypeByFailure = {
  [ProximityFailureType.CONSENT_DENIED]: undefined;
  [ProximityFailureType.MISSING_CREDENTIALS]: MissingCredentialError;
  [ProximityFailureType.RELYING_PARTY_GENERIC]: Error;
  [ProximityFailureType.TIMEOUT]: TimeoutError;
  [ProximityFailureType.UNEXPECTED]: unknown;
  [ProximityFailureType.UNTRUSTED_RP]: UntrustedRpError;
};
⋮----
type TypedProximityFailures = {
  [K in ProximityFailureType]: { reason: ReasonTypeByFailure[K]; type: K };
};
⋮----
export const mapEventToFailure = (event: ProximityEvents): ProximityFailure =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/guards.ts">
import { isItwProximityNfcEnabledSelector } from "../../../common/store/selectors";
import { itwProximityConsentExistsSelector } from "../store/selectors/consents";
import {
  generateConsentKey,
  getConsentDataFromProximityDetails
} from "../store/utils";
import { Context } from "./context";
⋮----
type GuardArgs = {
  context: Context;
};
⋮----
export const isNfcPresentmentSupportedGuard = (
⋮----
export const hasGrantedConsentGuard = (
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/input.ts">
import { Env } from "../../../common/utils/environment";
import { MachineNavigation, MachineStore } from "../../../machine/utils/deps";
⋮----
export type Input = {
  deps: ProximityMachineDeps;
};
⋮----
export type ProximityMachineDeps = {
  env: Env;
  navigation: MachineNavigation;
  store: MachineStore;
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/machine.ts">
import { not } from "xstate";
⋮----
import { InitialContext } from "./context";
import { itwProximityMachineSetup } from "./setup";
import { bluetoothState } from "./state/bluetooth";
import { nfcState } from "./state/nfc";
import { presentmentState } from "./state/presentment";
⋮----
export type ItwProximityMachine = typeof itwProximityMachine;
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/provider.tsx">
import { createActorContext } from "@xstate/react";
import { PropsWithChildren } from "react";
⋮----
import { useDebugInfo } from "../../../../../hooks/useDebugInfo.ts";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { useIOSelector, useIOStore } from "../../../../../store/hooks.ts";
import { isDebugModeEnabledSelector } from "../../../../../store/reducers/debug.ts";
import { selectItwEnv } from "../../../common/store/selectors/environment.ts";
import { getEnv } from "../../../common/utils/environment.ts";
import { itwProximityMachine } from "./machine.ts";
⋮----
export const ItwProximityMachineProvider = ({
  children
}: PropsWithChildren) =>
⋮----
const MachineDebugData = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/selectors.ts">
import { StateFrom } from "xstate";
⋮----
import { ProximityFlow } from "../analytics/types";
import { getProximityFlow } from "../analytics/utils";
import { ItwProximityMachine } from "./machine";
import { ItwPresentationTags } from "./tags";
⋮----
type MachineSnapshot = StateFrom<ItwProximityMachine>;
⋮----
export const selectIsLoading = (snapshot: MachineSnapshot)
⋮----
export const selectIsSending = (snapshot: MachineSnapshot)
⋮----
export const selectIsSuccess = (snapshot: MachineSnapshot)
⋮----
export const selectIsNfcRetrieval = (snapshot: MachineSnapshot)
⋮----
export const selectProximityFlow = (snapshot: MachineSnapshot): ProximityFlow
⋮----
export const selectQRCodeString = (snapshot: MachineSnapshot)
⋮----
export const selectFailure = (snapshot: MachineSnapshot)
⋮----
export const selectProximityDetails = (snapshot: MachineSnapshot)
⋮----
export const hasGivenConsentSelector = (snapshot: MachineSnapshot)
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/setup.ts">
import { assign, setup } from "xstate";
⋮----
import {
  closeProximityAction,
  grantConsentAction,
  navigateToBluetoothActivationScreenAction,
  navigateToBluetoothPermissionsScreenAction,
  navigateToClaimsDisclosureScreenAction,
  navigateToFailureScreenAction,
  navigateToNfcActivationScreenAction,
  navigateToNfcPresentmentScreenAction,
  navigateToPresentmentScreenAction,
  navigateToStoreconsentScreenAction,
  navigateToSuccessScreenAction,
  onInitAction,
  storeConsentAction,
  trackProximityStartAction,
  trackProximitySuccessAction,
  trackQrCodeLoadingFailureAction
} from "./actions";
import {
  checkBluetoothActivationActor,
  checkBluetoothPermissionsActor,
  checkNfcActivationActor,
  proximityCommunicationLogicActor,
  sendDocumentsActor,
  startEngagementActor,
  terminateSessionActor
} from "./actors";
import { Context } from "./context";
import { ProximityEvents } from "./events";
import { mapEventToFailure } from "./failure";
import {
  hasGrantedConsentGuard,
  isNfcPresentmentSupportedGuard
} from "./guards";
import { Input } from "./input";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/machine/tags.ts">
export enum ItwPresentationTags {
  Loading = "Loading",
  Presenting = "Presenting",
  Sending = "Sending"
}
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/navigation/ItwProximityParamsList.ts">
import { ItwProximityPresentmentScreenNavigationParams } from "../screens/ItwProximityPresentmentScreen";
import { ITW_PROXIMITY_ROUTES } from "./routes";
⋮----
export type ItwProximityParamsList = {
  [ITW_PROXIMITY_ROUTES.BLUETOOTH_ACTIVATION]: undefined;
  [ITW_PROXIMITY_ROUTES.BLUETOOTH_PERMISSIONS]: undefined;
  [ITW_PROXIMITY_ROUTES.CLAIMS_DISCLOSURE]: undefined;
  [ITW_PROXIMITY_ROUTES.FAILURE]: undefined;
  [ITW_PROXIMITY_ROUTES.NFC_ACTIVATION]: undefined;
  [ITW_PROXIMITY_ROUTES.NFC_PRESENTMENT]: undefined;
  [ITW_PROXIMITY_ROUTES.PRESENTMENT]: ItwProximityPresentmentScreenNavigationParams;
  [ITW_PROXIMITY_ROUTES.STORE_CONSENT]: undefined;
  [ITW_PROXIMITY_ROUTES.SUCCESS]: undefined;
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/navigation/ItwProximityStackNavigator.tsx">
import {
  createStackNavigator,
  TransitionPresets
} from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../../utils/navigation";
import { ItwProximityMachineProvider } from "../machine/provider";
import { ItwBluetoothActivationScreen } from "../screens/ItwBluetoothActivationScreen.tsx";
import { ItwBluetoothPermissionsScreen } from "../screens/ItwBluetoothPermissionsScreen.tsx";
import { ItwNfcActivationScreen } from "../screens/ItwNfcActivationScreen.tsx";
import { ItwProximityClaimsDisclosureScreen } from "../screens/ItwProximityClaimsDisclosureScreen";
import { ItwProximityFailureScreen } from "../screens/ItwProximityFailureScreen";
import { ItwProximityNfcPresentmentScreen } from "../screens/ItwProximityNfcPresentmentScreen.tsx";
import { ItwProximityPresentmentScreen } from "../screens/ItwProximityPresentmentScreen.tsx";
import { ItwProximityStoreConsentScreen } from "../screens/ItwProximityStoreConsentScreen.tsx";
import { ItwProximitySuccessScreen } from "../screens/ItwProximitySuccessScreen.tsx";
import { ItwProximityParamsList } from "./ItwProximityParamsList";
import { ITW_PROXIMITY_ROUTES } from "./routes";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwBluetoothActivationScreen.tsx">
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { Alert, Platform } from "react-native";
⋮----
import { IOScrollViewWithListItems } from "../../../../../components/ui/IOScrollViewWithListItems";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import {
  trackItwProximityBluetoothActivation,
  trackItwProximityBluetoothActivationClose,
  trackItwProximityBluetoothActivationGoToSettings,
  trackItwProximityBluetoothNotActivated
} from "../analytics";
import { ItwProximityMachineContext } from "../machine/provider";
import {
  checkBluetoothActivation,
  openBluetoothPreferences
} from "../utils/ble";
⋮----
export const ItwBluetoothActivationScreen = () =>
⋮----
const handleContinue = async () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwBluetoothPermissionsScreen.tsx">
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { Alert, Platform } from "react-native";
⋮----
import { IOScrollViewWithListItems } from "../../../../../components/ui/IOScrollViewWithListItems";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { openAppSettings } from "../../../../../utils/appSettings";
import {
  trackItwProximityBluetoothAccess,
  trackItwProximityBluetoothAccessClose,
  trackItwProximityBluetoothAccessDenied,
  trackItwProximityBluetoothAccessGoToSettings
} from "../analytics";
import { ItwProximityMachineContext } from "../machine/provider";
import { checkBluetoothPermissions } from "../utils/ble";
⋮----
export const ItwBluetoothPermissionsScreen = () =>
⋮----
const handleContinue = async () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwConsentManagementDetailScreen.tsx">
import {
  ContentWrapper,
  IOMarkdownLite,
  useIOToast,
  VStack
} from "@io-app/design-system";
import { StackActions, useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef } from "react";
import { Alert } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../../components/ui/IOScrollViewWithLargeHeader";
import {
  IOStackNavigationRouteProps,
  useIONavigation
} from "../../../../../navigation/params/AppParamsList";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../../store/hooks";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture";
import { ItwParamsList } from "../../../navigation/ItwParamsList";
import { ITW_ROUTES } from "../../../navigation/routes";
import {
  trackItwConsentManagementDetail,
  trackItwRevokeConsent,
  trackItwRevokeConsentOperationBlock,
  trackItwRevokeConsentOperationBlockAction
} from "../analytics";
import { ItwConsentClaims } from "../components/ItwConsentClaims";
import { getConsentSavedAtDescription } from "../components/ItwConsentManagementListItem";
import { itwRevokeProximityConsentByKey } from "../store/actions";
import {
  itwProximityConsentByKeySelector,
  itwProximityConsentsByCredentialTypeSelector
} from "../store/selectors/consents";
⋮----
export type ItwConsentManagementDetailScreenNavigationParams = {
  consentKey: string;
  credentialType: string;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_PRESENTATION_CONSENT_MANAGEMENT_DETAIL"
>;
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwConsentManagementScreen.tsx">
import {
  ContentWrapper,
  Divider,
  ListItemAction,
  ListItemHeader,
  VStack
} from "@io-app/design-system";
import { StackActions, useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo, useRef } from "react";
import { Alert, View } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../../components/ui/IOScrollViewWithLargeHeader";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { useItwCredentialName } from "../../../common/hooks/useItwCredentialName";
import { ItwParamsList } from "../../../navigation/ItwParamsList";
import { ITW_ROUTES } from "../../../navigation/routes";
import {
  trackItwConsentManagement,
  trackItwRevokeConsent,
  trackItwRevokeConsentOperationBlock,
  trackItwRevokeConsentOperationBlockAction
} from "../analytics";
import { ItwConsentManagementListItem } from "../components/ItwConsentManagementListItem";
import { itwRevokeProximityConsentsByCredentialType } from "../store/actions";
import { itwProximityConsentsEntriesByCredentialTypeSelector } from "../store/selectors/consents";
⋮----
export type ItwConsentManagementScreenNavigationParams = {
  credentialType: string;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_PRESENTATION_CONSENT_MANAGEMENT"
>;
⋮----
const showRevokeAllAlert = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwConsentRevocationSuccessScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList";
import { useAvoidHardwareBackButton } from "../../../../../utils/useAvoidHardwareBackButton";
import { useItwCredentialName } from "../../../common/hooks/useItwCredentialName";
import { useItwDisableGestureNavigation } from "../../../common/hooks/useItwDisableGestureNavigation";
import { ItwParamsList } from "../../../navigation/ItwParamsList";
import { ITW_ROUTES } from "../../../navigation/routes";
⋮----
export type ItwConsentRevocationSuccessScreenNavigationParams = {
  credentialType: string;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_PRESENTATION_CONSENT_REVOCATION_SUCCESS"
>;
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwNfcActivationScreen.tsx">
import I18n from "i18next";
import { useEffect, useRef } from "react";
import { Alert, Platform } from "react-native";
⋮----
import { IOScrollViewWithListItems } from "../../../../../components/ui/IOScrollViewWithListItems";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import {
  trackItwProximityNfcActivation,
  trackItwProximityNfcActivationClose,
  trackItwProximityNfcGoToSettings
} from "../analytics";
import { ItwProximityMachineContext } from "../machine/provider";
import { selectIsLoading } from "../machine/selectors";
import { checkNfcActivation, openNfcPreferences } from "../utils/nfc";
⋮----
export const ItwNfcActivationScreen = () =>
⋮----
const handleContinue = async () =>
⋮----
const showNfcActivationAlert = (onClose: ()
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwProximityClaimsDisclosureScreen.tsx">
import {
  ContentWrapper,
  ForceScrollDownView,
  H2,
  HeaderSecondLevel,
  IOMarkdownLite,
  VStack
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useLayoutEffect } from "react";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { useIODispatch } from "../../../../../store/hooks.ts";
import { ITW_PRIVACY_URL, ITW_TOS_URL } from "../../../../../urls.ts";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture.ts";
import { useAvoidHardwareBackButton } from "../../../../../utils/useAvoidHardwareBackButton.ts";
import { identificationRequest } from "../../../../identification/store/actions";
import { ItwDataExchangeIcons } from "../../../common/components/ItwDataExchangeIcons.tsx";
import { useItwDisableGestureNavigation } from "../../../common/hooks/useItwDisableGestureNavigation.ts";
import { useItwDismissalDialog } from "../../../common/hooks/useItwDismissalDialog.tsx";
import { ISSUER_MOCK_NAME } from "../../../common/utils/itwMocksUtils.ts";
import {
  trackItwProximityContinuePresentation,
  trackItwProximityDataShare
} from "../analytics";
import { ITW_PROXIMITY_SCREENVIEW_EVENTS } from "../analytics/enum";
import { ItwProximityConnectionLoadingComponent } from "../components/ItwProximityConnectionLoadingComponent.tsx";
import { ItwProximityPresentationDetails } from "../components/ItwProximityPresentationDetails.tsx";
import { ItwProximitySendLoadingComponent } from "../components/ItwProximitySendLoadingComponent.tsx";
import { ItwProximityMachineContext } from "../machine/provider.tsx";
import {
  selectIsLoading,
  selectIsNfcRetrieval,
  selectIsSending,
  selectProximityDetails,
  selectProximityFlow
} from "../machine/selectors.ts";
import { ProximityDetails } from "../utils/types.ts";
⋮----
export const ItwProximityClaimsDisclosureScreen = () =>
⋮----
type ContentViewProps = {
  proximityDetails: ProximityDetails;
};
⋮----
const handleConfirm = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwProximityFailureScreen.tsx">
import { Body, FooterActions, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../../components/screens/OperationResultScreenContent.tsx";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo.ts";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { generateDynamicUrlSelector } from "../../../../../store/reducers/backendStatus/remoteConfig.ts";
import { DOCUMENTS_ON_IO_FAQ_12_URL_BODY } from "../../../../../urls.ts";
import { isDefined } from "../../../../../utils/guards.ts";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet.tsx";
import { openWebUrl } from "../../../../../utils/url.ts";
import { useAvoidHardwareBackButton } from "../../../../../utils/useAvoidHardwareBackButton.ts";
import { useItwDisableGestureNavigation } from "../../../common/hooks/useItwDisableGestureNavigation.ts";
import { serializeFailureReason } from "../../../common/utils/itwStoreUtils.ts";
import { itwCredentialTypeFromDocTypeSelector } from "../../../credentialsCatalogue/store/selectors/index.ts";
import { ItwPresentationMissingCredentialsFailureContent } from "../../common/components/ItwPresentationMissingCredentialsFailureContent.tsx";
import {
  trackItwProximityRpNotTrustedBottomSheet,
  trackItwProximityRpNotTrustedDiscoverMore
} from "../analytics/index.ts";
import { useItwProximityEventsTracking } from "../hooks/useItwProximityEventsTracking";
import { ProximityFailure, ProximityFailureType } from "../machine/failure.ts";
import { ItwProximityMachineContext } from "../machine/provider.tsx";
import { selectFailure } from "../machine/selectors.ts";
⋮----
export const ItwProximityFailureScreen = () =>
⋮----
type ContentViewProps = { failure: ProximityFailure };
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwProximityNfcPresentmentScreen.tsx">
import {
  H4,
  HStack,
  IOButton,
  IOColors,
  IODimensions,
  Pictogram
} from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
import { Platform, StyleSheet, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { CircularProgress } from "../../../../../components/ui/CircularProgress.tsx";
import { IOScrollView } from "../../../../../components/ui/IOScrollView.tsx";
import { ItwProximityMachineContext } from "../machine/provider.tsx";
import { selectIsLoading, selectIsSuccess } from "../machine/selectors.ts";
⋮----
export const ItwProximityNfcPresentmentScreen = ()
⋮----
const handleDismiss = () =>
⋮----
⋮----
isSuccess
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwProximityPresentmentScreen.tsx">
import {
  Alert,
  BodySmall,
  H6,
  HeaderSecondLevel,
  hexToRgba,
  IOButton,
  IOColors,
  IODimensions,
  VSpacer,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useLayoutEffect } from "react";
import { StyleSheet, View } from "react-native";
import Animated, {
  LinearTransition,
  useAnimatedRef
} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { IOScrollView } from "../../../../../components/ui/IOScrollView.tsx";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo.ts";
import {
  IOStackNavigationRouteProps,
  useIONavigation
} from "../../../../../navigation/params/AppParamsList.ts";
import { useIOSelector } from "../../../../../store/hooks.ts";
import { useMaxBrightness } from "../../../../../utils/brightness.ts";
import { ItwBrandedBox } from "../../../common/components/ItwBrandedBox.tsx";
import { isItwProximityNfcEnabledSelector } from "../../../common/store/selectors";
import { itwIsBannerVisibleSelector } from "../../../common/store/selectors/banners.ts";
import { ITW_ROUTES } from "../../../navigation/routes.ts";
import {
  trackItwProximityNfcStart,
  trackItwStartReissuingPID
} from "../analytics";
import { ItwProximityQrCode as ItwProximityQrCodeTracking } from "../analytics/types.ts";
import { ItwProximityQrCodeImage } from "../components/ItwProximityQrCodeImage.tsx";
import { ItwProximityQrCodeInfoBanner } from "../components/ItwProximityQrCodeInfoBanner.tsx";
import { ItwProximityMachineContext } from "../machine/provider.tsx";
import { selectFailure, selectIsLoading } from "../machine/selectors.ts";
import { ItwProximityParamsList } from "../navigation/ItwProximityParamsList.ts";
import { shouldShowExpiredProximityCredentialsBannerSelector } from "../store/selectors/credentials.ts";
⋮----
export type ItwProximityPresentmentScreenNavigationParams = {
  source?: ItwProximityQrCodeTracking["source"];
};
⋮----
type ItwProximityPresentmentScreenProps = IOStackNavigationRouteProps<
  ItwProximityParamsList,
  "ITW_PROXIMITY_PRESENTMENT"
>;
⋮----
const handleReissuePress = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwProximityStoreConsentScreen.tsx">
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIODispatch } from "../../../../../store/hooks";
import { identificationRequest } from "../../../../identification/store/actions";
import {
  trackItwProximitySavePreferences,
  trackItwProximitySavePreferencesConfirm,
  trackItwProximitySavePreferencesDismiss
} from "../analytics";
import { ItwProximityMachineContext } from "../machine/provider";
import { selectIsLoading } from "../machine/selectors";
⋮----
const handleContinue =
(storeConsent = false)
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/screens/ItwProximitySuccessScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useAvoidHardwareBackButton } from "../../../../../utils/useAvoidHardwareBackButton";
import { useItwDisableGestureNavigation } from "../../../common/hooks/useItwDisableGestureNavigation";
import { ItwProximityMachineContext } from "../machine/provider";
⋮----
export const ItwProximitySuccessScreen = () =>
⋮----
const closeMachine = () => machineRef.send(
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { ConsentData, StoredConsentData } from "../types";
⋮----
export type ItwProximityActions =
  | ActionType<typeof itwGrantProximityConsent>
  | ActionType<typeof itwRevokeProximityConsentByKey>
  | ActionType<typeof itwRevokeProximityConsentsByCredentialType>
  | ActionType<typeof itwRevokeProximityConsentsByRpId>;
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/store/reducers/index.ts">
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../../store/actions/types";
import createSecureStorage from "../../../../../../store/storages/secureStorage";
import { itwCredentialsRemove } from "../../../../credentials/store/actions";
import { itwLifecycleStoresReset } from "../../../../lifecycle/store/actions";
import {
  itwGrantProximityConsent,
  itwRevokeProximityConsentByKey,
  itwRevokeProximityConsentsByCredentialType,
  itwRevokeProximityConsentsByRpId
} from "../actions";
import { ProximityConsents, StoredConsentData } from "../types";
import { generateConsentKey } from "../utils";
⋮----
export type ItwProximityState = {
  consents: ProximityConsents;
};
⋮----
const reducer = (
  state: ItwProximityState = itwProximityInitialState,
  action: Action
): ItwProximityState =>
⋮----
const filterConsentsByCredentialTypes = (
  consents: Record<string, StoredConsentData>,
  credentialTypes: ReadonlySet<string>
): Record<string, StoredConsentData>
⋮----
const filterConsentsByRpId = (
  consents: Record<string, StoredConsentData>,
  rpId: string
): Record<string, StoredConsentData>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/store/selectors/consents.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../../store/reducers/types";
import { ConsentData, StoredConsentData } from "../types";
import { generateConsentKey } from "../utils";
⋮----
export const itwProximityConsentsRecordSelector = (state: GlobalState)
⋮----
export const itwProximityConsentsEntriesByCredentialTypeSelector = (
  credentialType: string
)
⋮----
export const itwProximityConsentByKeySelector = (consentKey: string)
⋮----
export const itwProximityConsentsByCredentialTypeSelector = (
  credentialType: string
)
⋮----
export const itwProximityConsentExistsSelector = (consentData: ConsentData)
⋮----
export const itwProximityConsentsByRpIdSelector = (rpId: string)
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/store/selectors/credentials.ts">
import { createSelector } from "reselect";
⋮----
import type { GlobalState } from "../../../../../../store/reducers/types";
⋮----
import { getCredentialStatus } from "../../../../common/utils/itwCredentialStatusUtils";
import { CredentialType } from "../../../../common/utils/itwMocksUtils";
import {
  CredentialFormat,
  CredentialMetadata,
  ItwEidStatus,
  MdocSupportedCredentialConfiguration
} from "../../../../common/utils/itwTypesUtils";
import {
  itwCredentialsEidStatusSelector,
  makeSelectAllCredentials
} from "../../../../credentials/store/selectors";
⋮----
type PresentableCredentialsByDocType = Record<string, CredentialMetadata>;
⋮----
const isExpiredPresentableCredential = (credential: CredentialMetadata) =>
⋮----
export const areAllPresentableCredentialsExpired = (
  presentableCredentialsByDocType: PresentableCredentialsByDocType
) =>
⋮----
export const isPresentableCredentialSelector =
(credentialType: string)
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/store/types.ts">
export type ConsentData = ConsentIdentityData & {
  rpDisplayName?: string;
};
⋮----
export type ConsentIdentityData = {
  credentials: Array<ConsentCredentialInfo>;
  rpId: string;
};
⋮----
export type ProximityConsents = Record<string, StoredConsentData>;
⋮----
export type StoredConsentData = ConsentData & {
  savedAt?: string;
};
⋮----
type ConsentCredentialInfo = {
  claimNames: Array<string>;
  credentialType: string;
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/store/utils.ts">
import sha from "sha.js";
⋮----
import { ProximityDetails } from "../utils/types";
import { ConsentData, ConsentIdentityData } from "./types";
⋮----
const getCanonicalConsentPayload = (consent: ConsentIdentityData): string =>
⋮----
export const generateConsentKey = (consent: ConsentIdentityData): string
⋮----
export const getConsentDataFromProximityDetails = (
  proximityDetails: ProximityDetails
): ConsentData => (
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/utils/ble.ts">
import { Linking, Platform } from "react-native";
import AndroidOpenSettings from "react-native-android-open-settings";
import { BleManager, State } from "react-native-ble-plx";
import {
  checkMultiple,
  Permission,
  PERMISSIONS,
  requestMultiple,
  RESULTS
} from "react-native-permissions";
⋮----
import { promiseWithTimeout } from "./presentation";
⋮----
const getBleManager = () =>
⋮----
export const subscribeBluetoothState = (listener: (state: State)
⋮----
export const checkBluetoothPermissions = async () =>
⋮----
const getSettledBluetoothState = ()
⋮----
export const checkBluetoothActivation = async () =>
⋮----
export const openBluetoothPreferences = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/utils/errors.ts">
export class MissingCredentialError extends Error
⋮----
constructor(public credentialsDocType: Array<string>)
⋮----
export class TimeoutError extends Error
⋮----
constructor(message?: string)
⋮----
export class UntrustedRpError extends Error
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/utils/nfc.ts">
import { CieUtils } from "@pagopa/io-react-native-cie";
import { Platform } from "react-native";
⋮----
import { openAppSettings } from "../../../../../utils/appSettings";
⋮----
export const checkNfcActivation = async ()
⋮----
export const openNfcPreferences = ()
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/utils/presentation.ts">
import type {
  AcceptedFields,
  ProximityDetails,
  RequestedDocument,
  VerifierRequest
} from "./types";
⋮----
import { assert } from "../../../../../utils/assert";
import {
  parseClaims,
  WellKnownClaim
} from "../../../common/utils/itwClaimsUtils";
import { getRepresentativeVaultId } from "../../../common/utils/itwCredentialUtils";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils";
import {
  MissingCredentialError,
  TimeoutError,
  UntrustedRpError
} from "./errors";
⋮----
export const promiseWithTimeout = <T>(
  promise: Promise<T>,
  timeoutMs: number
) =>
⋮----
type GetProximityDetails = (params: {
  credentials: Partial<Record<string, CredentialMetadata>>;
  request: VerifierRequest["request"];
  requireAuthenticated?: boolean;
}) => ProximityDetails;
⋮----
export const getVerifierIdentity = (
  certificateData: VerifierRequest["request"][string]["certificateData"],
  requireAuthenticated?: boolean
): string =>
⋮----
export const getVerifierDisplayName = (
  certificateData: VerifierRequest["request"][string]["certificateData"]
): string | undefined
⋮----
export const getProximityDetails: GetProximityDetails = ({
  request,
  credentials: credentialsByType,
  requireAuthenticated = true
}) =>
⋮----
export const getDocuments = async (
  request: VerifierRequest["request"],
  credentials: Partial<Record<string, CredentialMetadata>>,
  getCredential: (vaultId: string) => Promise<string | undefined>
): Promise<Array<RequestedDocument>> =>
⋮----
interface NestedBooleanMap {
  [key: string]: boolean | NestedBooleanMap;
}
⋮----
const acceptAllFields = <T extends NestedBooleanMap>(input: T): T
⋮----
export const generateAcceptedFields = (
  request: VerifierRequest["request"],
  includedDocTypes?: ReadonlySet<string>
): AcceptedFields
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/proximity/utils/types.ts">
import { ISO18013_5 } from "@pagopa/io-react-native-iso18013";
⋮----
import { NonEmptyArray } from "../../../../../types/helpers";
import { ClaimDisplayFormat } from "../../../common/utils/itwClaimsUtils";
⋮----
export type AcceptedFields = ISO18013_5.AcceptedFields;
⋮----
export type EventsPayload = ISO18013_5.EventsPayload;
⋮----
export type ProximityDetails = NonEmptyArray<{
  claimsToDisplay: Array<ClaimDisplayFormat>;
  credentialType: string;
  rpDisplayName?: string;
  rpId: string;
}>;
⋮----
export type RequestedDocument = ISO18013_5.RequestedDocument;
⋮----
export type VerifierRequest = ISO18013_5.VerifierRequest;
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/analytics/utils/index.ts">
import { ItwScreenFlowContext } from "../../../../analytics/utils/types";
import { RemoteFailureType } from "../../machine/failure";
import { ITW_REMOTE_ERRORS_EVENTS } from "../enum";
⋮----
export const getDismissalContextFromFailure = (
  failureType: RemoteFailureType
): ItwScreenFlowContext | undefined =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/analytics/utils/types.ts">
export enum ItwL3UpgradeTrigger {
  ADD_CREDENTIAL = "add_credential",
  REMOTE_QR_CODE = "remote_qr_code"
}
⋮----
export type ItwRemoteCredentialCombination =
  | "other_credentials"
  | "PID"
  | "PID_and_credentials";
⋮----
export type ItwRemoteDataShare = {
  credential_type: ItwRemoteCredentialCombination;
  data_type: "optional" | "required";
  request_type: "multiple_purpose" | "no_purpose" | "unique_purpose";
};
⋮----
export type ItwRemoteFailure = {
  origin?: string;
  reason: unknown;
  type: string;
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/analytics/enum.ts">
export enum ITW_REMOTE_ACTIONS_EVENTS {
  ITW_REMOTE_UX_CONVERSION = "ITW_REMOTE_UX_CONVERSION",
  ITW_UPGRADE_L3_MANDATORY_CANCEL = "ITW_UPGRADE_L3_MANDATORY_CANCEL",
  ITW_UPGRADE_L3_MANDATORY_CONFIRM = "ITW_UPGRADE_L3_MANDATORY_CONFIRM"
}
⋮----
export enum ITW_REMOTE_ERRORS_EVENTS {
  ITW_REMOTE_GENERIC_FAILURE = "ITW_REMOTE_GENERIC_FAILURE",
  ITW_REMOTE_IDENTITY_NEEDS_VERIFICATION = "ITW_REMOTE_IDENTITY_NEEDS_VERIFICATION",
  ITW_REMOTE_INVALID_AUTH_RESPONSE = "ITW_REMOTE_INVALID_AUTH_RESPONSE",
  ITW_REMOTE_LINK_FAILURE = "ITW_REMOTE_LINK_FAILURE",
  ITW_REMOTE_MANDATORY_CREDENTIAL_MISSING = "ITW_REMOTE_MANDATORY_CREDENTIAL_MISSING",
  ITW_REMOTE_MANDATORY_CREDENTIAL_NOT_VALID = "ITW_REMOTE_MANDATORY_CREDENTIAL_NOT_VALID",
  ITW_REMOTE_REQUEST_OBJECT_FAILURE = "ITW_REMOTE_REQUEST_OBJECT_FAILURE",
  ITW_REMOTE_RP_NOT_TRUSTED = "ITW_REMOTE_RP_NOT_TRUSTED",
  ITW_REMOTE_UNEXPECTED_FAILURE = "ITW_REMOTE_UNEXPECTED_FAILURE",
  ITW_UPGRADE_L3_MANDATORY = "ITW_UPGRADE_L3_MANDATORY"
}
⋮----
export enum ITW_REMOTE_SCREENVIEW_EVENTS {
  ITW_REMOTE_DATA_SHARE = "ITW_REMOTE_DATA_SHARE",
  ITW_REMOTE_INVALID_AUTH_RESPONSE_BOTTOMSHEET = "ITW_REMOTE_INVALID_AUTH_RESPONSE_BOTTOMSHEET",
  ITW_REMOTE_RP_NOT_TRUSTED_BOTTOMSHEET = "ITW_REMOTE_RP_NOT_TRUSTED_BOTTOMSHEET",
  ITW_REMOTE_UX_SUCCESS = "ITW_REMOTE_UX_SUCCESS"
}
⋮----
export enum ITW_REMOTE_TECH_EVENTS {
  ITW_REMOTE_START = "ITW_REMOTE_START"
}
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/analytics/index.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { buildEventProperties } from "../../../../../utils/analytics";
import {
  ITW_REMOTE_ACTIONS_EVENTS,
  ITW_REMOTE_ERRORS_EVENTS,
  ITW_REMOTE_SCREENVIEW_EVENTS,
  ITW_REMOTE_TECH_EVENTS
} from "./enum";
import {
  ItwL3UpgradeTrigger,
  ItwRemoteCredentialCombination,
  ItwRemoteDataShare,
  ItwRemoteFailure
} from "./utils/types";
⋮----
export const trackItwRemoteUntrustedRPBottomSheet = () =>
⋮----
export const trackItwRemoteDataShare = ({
  data_type,
  request_type,
  credential_type
}: ItwRemoteDataShare) =>
⋮----
export const trackItwRemoteInvalidAuthResponseBottomSheet = () =>
⋮----
export const trackItwRemotePresentationCompleted = (
  redirect_url: boolean,
  credential_type: ItwRemoteCredentialCombination
) =>
⋮----
export const trackItwRemoteContinuePresentation = (
  credential_type: ItwRemoteCredentialCombination
) =>
⋮----
export const trackItwRemoteUnexpectedFailure = ({
  origin,
  reason,
  type
}: ItwRemoteFailure) =>
⋮----
export const trackItwRemoteIdentityNeedsVerification = () =>
⋮----
export const trackItwRemoteUntrustedRP = () =>
⋮----
export const trackItwRemoteRequestObjectFailure = ({
  reason,
  type
}: ItwRemoteFailure) =>
⋮----
export const trackItwRemoteMandatoryCredentialMissing = () =>
⋮----
export const trackItwRemoteInvalidMandatoryCredential = () =>
⋮----
export const trackItwRemoteRPInvalidAuthResponse = ({
  reason,
  type
}: ItwRemoteFailure) =>
⋮----
export const trackItwRemoteRPGenericFailure = ({
  reason,
  type
}: ItwRemoteFailure) =>
⋮----
export const trackItwRemoteDeepLinkFailure = (reason: Error) =>
⋮----
export const trackItwUpgradeL3Mandatory = (action: ItwL3UpgradeTrigger) =>
⋮----
export const trackItwUpgradeL3MandatoryConfirm = (
  action: ItwL3UpgradeTrigger
) =>
⋮----
export const trackItwUpgradeL3MandatoryCancel = (
  action: ItwL3UpgradeTrigger
) =>
⋮----
export const trackItwRemoteStart = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/components/ItwRemoteDeepLinkFailure.tsx">
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent.tsx";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo.ts";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { zendeskItWalletCategory } from "../../../../../utils/supportAssistance";
import { trackItwKoStateAction } from "../../../analytics";
import { useItwFailureSupportModal } from "../../../common/hooks/useItwFailureSupportModal.tsx";
import { ZendeskSubcategoryValue } from "../../../common/hooks/useItwZendeskSupport";
import {
  ItwFailure,
  ItwFailureType
} from "../../../common/utils/ItwFailureTypes.ts";
import { trackItwRemoteDeepLinkFailure } from "../analytics";
import { ItwRemoteRequestPayload } from "../utils/itwRemoteTypeUtils.ts";
⋮----
type Props = {
  failure: Error;
  payload: Partial<ItwRemoteRequestPayload>;
};
⋮----
export const ItwRemoteDeepLinkFailure = (
⋮----
trackItwKoStateAction({
              reason: failure,
              cta_category: "custom_2",
              cta_id: I18n.t(
                "features.itWallet.presentation.remote.deepLinkValidationErrorScreen.secondaryAction"
              )
            });
navigation.popToTop();
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/components/ItwRemoteLoadingScreen.tsx">
import I18n from "i18next";
⋮----
import { LoadingScreenContent } from "../../../../../components/screens/LoadingScreenContent";
⋮----
type Props = {
  message?: string;
  testID?: string;
  title: string;
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/components/ItwRemotePresentationDetails.tsx">
import {
  Alert,
  ListItemCheckbox,
  ListItemHeader,
  useIOTheme,
  VSpacer,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { memo, useMemo } from "react";
import { View } from "react-native";
⋮----
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { ItwClaimsSelector } from "../../common/components/ItwClaimsSelector";
import { ItwRemoteMachineContext } from "../machine/provider";
import { selectPresentationDetails } from "../machine/selectors";
import {
  getCredentialTypeByVct,
  groupCredentialsByPurpose
} from "../utils/itwRemotePresentationUtils";
import { EnrichedPresentationDetails } from "../utils/itwRemoteTypeUtils";
⋮----
const RequestedCredentialsBlock = ({
  credentials
}: {
  credentials: EnrichedPresentationDetails;
}) => (
  <VStack space={24}>
    {credentials
      .filter(c => c.format === "dc+sd-jwt")
      .filter(c => c.claimsToDisplay.length > 0)
      .flatMap(c => {
        const credentialType = getCredentialTypeByVct(c.vct);
⋮----
const sendCredentialsToMachine = (
    credentials: EnrichedPresentationDetails
) =>
⋮----
purpose
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/hooks/useItwRemoteEventsTracking.ts">
import { useEffect } from "react";
⋮----
import {
  serializeFailureReason,
  shouldSerializeReason
} from "../../../common/utils/itwStoreUtils";
import {
  trackItwRemoteIdentityNeedsVerification,
  trackItwRemoteInvalidMandatoryCredential,
  trackItwRemoteMandatoryCredentialMissing,
  trackItwRemoteRequestObjectFailure,
  trackItwRemoteRPGenericFailure,
  trackItwRemoteRPInvalidAuthResponse,
  trackItwRemoteUnexpectedFailure,
  trackItwRemoteUntrustedRP,
  trackItwUpgradeL3Mandatory
} from "../analytics";
import { ItwL3UpgradeTrigger } from "../analytics/utils/types";
import { RemoteFailure, RemoteFailureType } from "../machine/failure";
⋮----
type Params = {
  failure: RemoteFailure;
};
⋮----
export const useItwRemoteEventsTracking = (
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/hooks/useItwRemoteUntrustedRPBottomSheet.tsx">
import { Body, ListItemHeader, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
import { View } from "react-native";
⋮----
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet.tsx";
import { trackItwRemoteUntrustedRPBottomSheet } from "../analytics";
⋮----
export const useItwRemoteUntrustedRPBottomSheet = () =>
⋮----
const presentWithTrack = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/hooks/useItwSendAuthorizationErrorResponse.tsx">
import { Nullable } from "@io-app/design-system";
import { useEffect, useMemo } from "react";
⋮----
import { OperationResultScreenContentProps } from "../../../../../components/screens/OperationResultScreenContent";
import { useIoWallet } from "../../../common/hooks/useIoWallet";
import { RemoteFailure, RemoteFailureType } from "../machine/failure";
import { ItwRemoteMachineContext } from "../machine/provider";
import { selectUnverifiedRequestObject } from "../machine/selectors";
import { AuthErrorResponseBody } from "../utils/itwRemoteTypeUtils";
⋮----
type Props = {
  failure: RemoteFailure;
  resultScreenProps: OperationResultScreenContentProps;
};
⋮----
export const useItwSendAuthorizationErrorResponse = ({
  failure,
  resultScreenProps
}: Props) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/actions.ts">
import { type ActionArgs, assign, type DoneActorEvent } from "xstate";
⋮----
import type { WalletInstanceAttestations } from "../../../common/utils/itwTypesUtils";
⋮----
import ROUTES from "../../../../../navigation/routes";
import { checkCurrentSession } from "../../../../authentication/common/store/actions/index";
import { BATCH_ISSUANCE_CREDENTIALS } from "../../../common/utils/itwCredentialIssuanceUtils";
import {
  getCredentialKeyTags,
  isBatchCredential
} from "../../../common/utils/itwCredentialUtils";
import { itwCredentialsConsumeInstance } from "../../../credentials/store/actions/index";
import {
  itwAllStoredCredentialsSelector,
  itwCredentialsAllSelector
} from "../../../credentials/store/selectors/index";
import { ITW_ROUTES } from "../../../navigation/routes";
import { itwWalletInstanceAttestationStore } from "../../../walletInstance/store/actions/index";
import { itwWalletInstanceAttestationSelector } from "../../../walletInstance/store/selectors/index";
import { trackItwRemoteDataShare } from "../analytics";
import { ITW_REMOTE_ROUTES } from "../navigation/routes";
import {
  getRemoteCredentialCombination,
  groupCredentialsByPurpose
} from "../utils/itwRemotePresentationUtils";
import { Context } from "./context";
import { RemoteEvents } from "./events";
⋮----
export const navigateToFailureScreenAction = ({
  context
}: ActionArgs<Context, RemoteEvents, RemoteEvents>) =>
⋮----
export const navigateToDiscoveryScreenAction = ({
  context
}: ActionArgs<Context, RemoteEvents, RemoteEvents>) =>
⋮----
export const navigateToClaimsDisclosureScreenAction = ({
  context
}: ActionArgs<Context, RemoteEvents, RemoteEvents>) =>
⋮----
export const navigateToBarcodeScanScreenAction = ({
  context
}: ActionArgs<Context, RemoteEvents, RemoteEvents>) =>
⋮----
export const navigateToAuthResponseScreenAction = ({
  context
}: ActionArgs<Context, RemoteEvents, RemoteEvents>) =>
⋮----
export const closePresentationAction = ({
  context
}: ActionArgs<Context, RemoteEvents, RemoteEvents>) =>
⋮----
export const trackRemoteDataShareAction = ({
  context
}: ActionArgs<Context, RemoteEvents, RemoteEvents>) =>
⋮----
export const storeWalletInstanceAttestationAction = ({
  context,
  event
}: ActionArgs<Context, RemoteEvents, RemoteEvents>) =>
⋮----
export const consumePresentedBatchCredentialsAction = ({
  context
}: ActionArgs<Context, RemoteEvents, RemoteEvents>) =>
⋮----
export const handleSessionExpiredAction = ({
  context
}: ActionArgs<Context, RemoteEvents, RemoteEvents>)
⋮----
export const navigateToIdentificationScreenAction = ({
  context
}: ActionArgs<Context, RemoteEvents, RemoteEvents>) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/actors.ts">
import { RemotePresentation } from "@pagopa/io-react-native-wallet";
import { fromPromise } from "xstate";
⋮----
import { assert } from "../../../../../utils/assert";
import { IO_UNIVERSAL_LINK_PREFIX } from "../../../../../utils/navigation";
import { sessionTokenSelector } from "../../../../authentication/common/store/selectors";
import { getWalletInstanceAttestation } from "../../../common/utils/itwAttestationUtils";
import { getRepresentativeVaultId } from "../../../common/utils/itwCredentialUtils";
import { getIoWallet } from "../../../common/utils/itwIoWallet";
import { ensureIntegrityServiceIsStoreReadyOrThrow } from "../../../common/utils/itwStoreUtils";
import {
  CredentialFormat,
  CredentialMetadata,
  RequestObject,
  WalletInstanceAttestations
} from "../../../common/utils/itwTypesUtils";
import { CredentialsVault } from "../../../credentials/utils/vault";
import { itwIntegrityKeyTagSelector } from "../../../issuance/store/selectors";
import {
  ClientIdPrefix,
  enrichPresentationDetails,
  getInvalidCredentials
} from "../utils/itwRemotePresentationUtils";
import {
  DcqlQuery,
  EnrichedPresentationDetails,
  ItwRemoteRequestPayload,
  RelyingPartyConfiguration
} from "../utils/itwRemoteTypeUtils";
import { InvalidCredentialsStatusError } from "./failure";
import { RemoteMachineDeps } from "./input";
⋮----
export type EvaluateRelyingPartyTrustInput = Partial<{
  qrCodePayload: ItwRemoteRequestPayload;
}> & {
  deps: RemoteMachineDeps;
};
⋮----
export type EvaluateRelyingPartyTrustOutput = {
  rpConf: RelyingPartyConfiguration;
};
⋮----
export type GetPresentationDetailsInput = Partial<{
  credentials: Record<string, CredentialMetadata>;
  qrCodePayload: ItwRemoteRequestPayload;
  requestObjectEncodedJwt: string;
  rpConf: RelyingPartyConfiguration;
  walletInstanceAttestation: WalletInstanceAttestations;
}> & {
  deps: RemoteMachineDeps;
};
export type GetPresentationDetailsOutput = {
  presentationDetails: EnrichedPresentationDetails;
  requestObject: RequestObject;
};
export type GetRequestObjectInput = Partial<{
  qrCodePayload: ItwRemoteRequestPayload;
}> & {
  deps: RemoteMachineDeps;
};
export type GetRequestObjectOutput = string;
⋮----
export type GetWalletAttestationInput = {
  deps: RemoteMachineDeps;
};
⋮----
export type SendAuthorizationResponseInput = {
  deps: RemoteMachineDeps;
  optionalCredentials: Set<string>;
  presentationDetails?: EnrichedPresentationDetails;
  requestObject?: RequestObject;
  rpConf?: RelyingPartyConfiguration;
};
⋮----
export type SendAuthorizationResponseOutput = {
  presentedKeyTags: ReadonlyArray<string>;
  redirectUri?: string;
};
⋮----
type CredentialsByFormat = {
  mdoc: CredentialsForDcql;
  sdJwt: CredentialsForDcql;
};
type CredentialsForDcql = Array<RemotePresentation.Credential4Dcql>;
⋮----
// Create the trust chain for the Relying Party
⋮----
// Perform full validation on the built chainW
⋮----
// Determine the Relying Party configuration and subject
⋮----
// The retrieval of the Request Object is managed by a dedicated actor to enable access
// to the `response_uri` parameter in the event of a validation failure during its processing.
⋮----
const prepareCredentialsForDcqlEvaluation = (
  credentials: Array<{ credential: string; format: string; keyTag: string }>
): CredentialsByFormat =>
⋮----
const isMdoc = (c:
const toEntry = (c: {
... (4 lines truncated)
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/context.ts">
import {
  CredentialMetadata,
  RequestObject,
  WalletInstanceAttestations
} from "../../../common/utils/itwTypesUtils";
import {
  EnrichedPresentationDetails,
  ItwRemoteFlowType,
  ItwRemoteRequestPayload,
  RelyingPartyConfiguration
} from "../utils/itwRemoteTypeUtils";
import { RemoteFailure } from "./failure";
import { RemoteMachineDeps } from "./input";
⋮----
export type Context = {
  credentials: Record<string, CredentialMetadata> | undefined;
  deps: RemoteMachineDeps;
  failure?: RemoteFailure;
  flowType: ItwRemoteFlowType | undefined;
  payload: ItwRemoteRequestPayload | undefined;
  presentationDetails: EnrichedPresentationDetails | undefined;
  presentedKeyTags: ReadonlyArray<string>;
  redirectUri?: string;
  requestObject: RequestObject | undefined;
  requestObjectEncodedJwt: string | undefined;
  rpConf: RelyingPartyConfiguration | undefined;
  selectedOptionalCredentials: Set<string>;
  walletInstanceAttestation: undefined | WalletInstanceAttestations;
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/events.ts">
import type { DoneActorEvent } from "xstate";
⋮----
import {
  ItwRemoteFlowType,
  ItwRemoteRequestPayload
} from "../utils/itwRemoteTypeUtils.ts";
⋮----
export type RemoteEvents =
  | Back
  | Close
  | Consent
  | DoneActorEvent
  | GoToBarcodeScan
  | GoToIdentificationMode
  | GoToWalletActivation
  | Reset
  | Start
  | ToggleCredential;
⋮----
type Back = {
  type: "back";
};
⋮----
type Close = {
  type: "close";
};
⋮----
type Consent = {
  type: "holder-consent";
};
⋮----
type GoToBarcodeScan = {
  type: "go-to-barcode-scan";
};
⋮----
type GoToIdentificationMode = {
  type: "go-to-identification-mode";
};
⋮----
type GoToWalletActivation = {
  type: "go-to-wallet-activation";
};
⋮----
type Reset = {
  type: "reset";
};
⋮----
type Start = {
  flowType: ItwRemoteFlowType;
  payload: ItwRemoteRequestPayload;
  type: "start";
};
⋮----
type ToggleCredential = {
  credentialIds: Array<string>;
  type: "toggle-credential";
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/failure.ts">
import {
  Errors,
  RemotePresentation,
  Trust
} from "@pagopa/io-react-native-wallet";
⋮----
import { isDefined } from "../../../../../utils/guards.ts";
import { isFederationError } from "../../../common/utils/itwFailureUtils.ts";
import { CredentialType } from "../../../common/utils/itwMocksUtils.ts";
import { getCredentialTypeByVct } from "../utils/itwRemotePresentationUtils.ts";
import { RemoteEvents } from "./events.ts";
⋮----
export enum RemoteFailureType {
  EID_EXPIRED = "EID_EXPIRED",
  INVALID_CREDENTIALS_STATUS = "INVALID_CREDENTIALS_STATUS",
  INVALID_REQUEST_OBJECT = "INVALID_REQUEST_OBJECT",
  MISSING_CREDENTIALS = "MISSING_CREDENTIALS",
  RELYING_PARTY_GENERIC = "RELYING_PARTY_GENERIC",
  RELYING_PARTY_INVALID_AUTH_RESPONSE = "RELYING_PARTY_INVALID_AUTH_RESPONSE",
  UNEXPECTED = "UNEXPECTED",
  UNTRUSTED_RP = "UNTRUSTED_RP",
  WALLET_INACTIVE = "WALLET_INACTIVE"
}
⋮----
type InvalidRequestObjectError =
  | RemotePresentation.Errors.DcqlError
  | RemotePresentation.Errors.InvalidRequestObjectError;
⋮----
export class InvalidCredentialsStatusError extends Error
⋮----
constructor(public invalidCredentials: Array<string>)
⋮----
const isRequestObjectInvalidError = (
  error: unknown
): error is InvalidRequestObjectError
⋮----
export type RemoteFailure = TypedRemoteFailures[keyof TypedRemoteFailures];
⋮----
type ReasonTypeByFailure = {
  [RemoteFailureType.EID_EXPIRED]: string;
  [RemoteFailureType.INVALID_CREDENTIALS_STATUS]: {
    invalidCredentials: Array<string>;
  };
  [RemoteFailureType.INVALID_REQUEST_OBJECT]: InvalidRequestObjectError;
  [RemoteFailureType.MISSING_CREDENTIALS]: {
    missingCredentials: Array<string>;
  };
  [RemoteFailureType.RELYING_PARTY_GENERIC]: Errors.RelyingPartyResponseError;
  [RemoteFailureType.RELYING_PARTY_INVALID_AUTH_RESPONSE]: Errors.RelyingPartyResponseError;
  [RemoteFailureType.UNEXPECTED]: unknown;
  [RemoteFailureType.UNTRUSTED_RP]: Trust.Errors.FederationError;
  [RemoteFailureType.WALLET_INACTIVE]: string;
};
⋮----
type TypedRemoteFailures = {
  [K in RemoteFailureType]: { reason: ReasonTypeByFailure[K]; type: K };
};
⋮----
export const mapEventToFailure = (event: RemoteEvents): RemoteFailure =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/guards.ts">
import { ItwSessionExpiredError } from "../../../api/client.ts";
import { itwIsL3EnabledSelector } from "../../../common/store/selectors";
import { isItwEnabledSelector } from "../../../common/store/selectors/remoteConfig.ts";
import { isWalletInstanceAttestationValid } from "../../../common/utils/itwAttestationUtils.ts";
import { itwLifecycleIsITWalletValidSelector } from "../../../lifecycle/store/selectors";
import { itwWalletInstanceAttestationSelector } from "../../../walletInstance/store/selectors/index.ts";
import { ClientIdPrefix } from "../utils/itwRemotePresentationUtils";
import { Context } from "./context.ts";
import { RemoteEvents } from "./events.ts";
⋮----
type GuardArgs = {
  context: Context;
  event: RemoteEvents;
};
⋮----
export const isItWalletL3ActiveGuard = (
⋮----
export const hasValidWalletInstanceAttestationGuard = ({
  context
}: GuardArgs) =>
⋮----
export const isSessionExpiredGuard = (
⋮----
export const isOpenIdFederationClientGuard = (
⋮----
export const isX509HashClientGuard = (
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/input.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
⋮----
import { Env } from "../../../common/utils/environment";
import { MachineNavigation, MachineStore } from "../../../machine/utils/deps";
⋮----
export type Input = {
  deps: RemoteMachineDeps;
};
⋮----
export type RemoteMachineDeps = {
  env: Env;
  itwVersion: ItwVersion;
  navigation: MachineNavigation;
  store: MachineStore;
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/machine.ts">
import { assign, not } from "xstate";
⋮----
import { InitialContext } from "./context";
import { RemoteFailureType } from "./failure";
import { itwRemoteMachineSetup } from "./setup";
import { ItwPresentationTags } from "./tags";
⋮----
export type ItwRemoteMachine = typeof itwRemoteMachine;
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/provider.tsx">
import { createActorContext } from "@xstate/react";
import { JSX } from "react";
⋮----
import { useIONavigation } from "../../../../../navigation/params/AppParamsList.ts";
import { useIOSelector, useIOStore } from "../../../../../store/hooks.ts";
import {
  selectItwEnv,
  selectItwSpecsVersion
} from "../../../common/store/selectors/environment.ts";
import { getEnv } from "../../../common/utils/environment.ts";
import { itwRemoteMachine } from "./machine.ts";
⋮----
type Props = {
  children: JSX.Element;
};
⋮----
export const ItwRemoteMachineProvider = (props: Props) =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/selectors.ts">
import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
import { createSelector } from "reselect";
import { StateFrom } from "xstate";
⋮----
import { RequestObject } from "../../../common/utils/itwTypesUtils";
import { getRemoteCredentialCombination } from "../utils/itwRemotePresentationUtils";
import { ItwRemoteMachine } from "./machine";
import { ItwPresentationTags } from "./tags";
⋮----
type MachineSnapshot = StateFrom<ItwRemoteMachine>;
⋮----
export const selectIsLoading = (snapshot: MachineSnapshot)
⋮----
export const selectIsSuccess = (snapshot: MachineSnapshot)
⋮----
export const selectIsClaimsDisclosure = (snapshot: MachineSnapshot)
⋮----
export const selectFailure = (snapshot: MachineSnapshot)
⋮----
export const selectPresentationDetails = (snapshot: MachineSnapshot)
⋮----
export const selectRelyingPartyData = (snapshot: MachineSnapshot)
⋮----
export const selectUserSelectedOptionalCredentials = (
  snapshot: MachineSnapshot
)
⋮----
export const selectRedirectUri = (snapshot: MachineSnapshot)
⋮----
export const selectRemoteCredentialCombination = (
  snapshot: MachineSnapshot
) =>
⋮----
export const selectFlowType = (snapshot: MachineSnapshot)
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/setup.ts">
import { assign, setup } from "xstate";
⋮----
import {
  closePresentationAction,
  consumePresentedBatchCredentialsAction,
  handleSessionExpiredAction,
  navigateToAuthResponseScreenAction,
  navigateToBarcodeScanScreenAction,
  navigateToClaimsDisclosureScreenAction,
  navigateToDiscoveryScreenAction,
  navigateToFailureScreenAction,
  navigateToIdentificationScreenAction,
  onInitAction,
  storeWalletInstanceAttestationAction,
  trackRemoteDataShareAction
} from "./actions";
import {
  evaluateRelyingPartyTrustActor,
  getPresentationDetailsActor,
  getRequestObjectActor,
  getWalletAttestationActor,
  sendAuthorizationResponseActor
} from "./actors";
import { Context } from "./context";
import { RemoteEvents } from "./events";
import { mapEventToFailure } from "./failure";
import {
  hasValidWalletInstanceAttestationGuard,
  isItWalletL3ActiveGuard,
  isOpenIdFederationClientGuard,
  isSessionExpiredGuard,
  isX509HashClientGuard
} from "./guards";
import { Input } from "./input";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/machine/tags.ts">
export enum ItwPresentationTags {
  Loading = "Loading"
}
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/navigation/ItwRemoteParamsList.ts">
import { ItwRemoteRequestValidationScreenNavigationParams } from "../screens/ItwRemoteRequestValidationScreen.tsx";
import { ITW_REMOTE_ROUTES } from "./routes.ts";
⋮----
export type ItwRemoteParamsList = {
  [ITW_REMOTE_ROUTES.AUTH_RESPONSE]: undefined;
  [ITW_REMOTE_ROUTES.CLAIMS_DISCLOSURE]: undefined;
  [ITW_REMOTE_ROUTES.FAILURE]: undefined;
  [ITW_REMOTE_ROUTES.REQUEST_VALIDATION]: ItwRemoteRequestValidationScreenNavigationParams;
};
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/navigation/ItwRemoteStackNavigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import {
  isBackNavigationAction,
  isGestureEnabled
} from "../../../../../utils/navigation.ts";
import {
  ItwRemoteMachineContext,
  ItwRemoteMachineProvider
} from "../machine/provider.tsx";
import { ItwRemoteAuthResponseScreen } from "../screens/ItwRemoteAuthResponseScreen.tsx";
import { ItwRemoteClaimsDisclosureScreen } from "../screens/ItwRemoteClaimsDisclosureScreen.tsx";
import { ItwRemoteFailureScreen } from "../screens/ItwRemoteFailureScreen.tsx";
import { ItwRemoteRequestValidationScreen } from "../screens/ItwRemoteRequestValidationScreen.tsx";
import { ItwRemoteParamsList } from "./ItwRemoteParamsList.ts";
import { ITW_REMOTE_ROUTES } from "./routes.ts";
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/screens/ItwRemoteAuthResponseScreen.tsx">
import { IOToast } from "@io-app/design-system";
import I18n from "i18next";
import { Linking } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { useItwDisableGestureNavigation } from "../../../common/hooks/useItwDisableGestureNavigation";
import { trackItwRemotePresentationCompleted } from "../analytics";
import { ItwRemoteLoadingScreen } from "../components/ItwRemoteLoadingScreen";
import { ItwRemoteMachineContext } from "../machine/provider";
import {
  selectFlowType,
  selectIsLoading,
  selectIsSuccess,
  selectRedirectUri,
  selectRelyingPartyData,
  selectRemoteCredentialCombination
} from "../machine/selectors";
⋮----
export const ItwRemoteAuthResponseScreen = () =>
⋮----
const closeMachine = () => machineRef.send(
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/screens/ItwRemoteClaimsDisclosureScreen.tsx">
import {
  ContentWrapper,
  ForceScrollDownView,
  H2,
  IOMarkdownLite,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel.tsx";
import { useIODispatch } from "../../../../../store/hooks.ts";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture.ts";
import { useAvoidHardwareBackButton } from "../../../../../utils/useAvoidHardwareBackButton.ts";
import { identificationRequest } from "../../../../identification/store/actions";
import { ItwDataExchangeIcons } from "../../../common/components/ItwDataExchangeIcons.tsx";
import { useItwDisableGestureNavigation } from "../../../common/hooks/useItwDisableGestureNavigation.ts";
import { useItwDismissalDialog } from "../../../common/hooks/useItwDismissalDialog";
import { trackItwRemoteContinuePresentation } from "../analytics";
import { ITW_REMOTE_SCREENVIEW_EVENTS } from "../analytics/enum";
import { ItwRemoteLoadingScreen } from "../components/ItwRemoteLoadingScreen.tsx";
import { ItwRemotePresentationDetails } from "../components/ItwRemotePresentationDetails.tsx";
import { ItwRemoteMachineContext } from "../machine/provider.tsx";
import {
  selectIsLoading,
  selectRelyingPartyData,
  selectRemoteCredentialCombination
} from "../machine/selectors.ts";
⋮----
const ItwRemoteClaimsDisclosureScreen = () =>
⋮----
const closePresentation = () => machineRef.send(
⋮----
const confirmVerifiablePresentation = ()
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/screens/ItwRemoteFailureScreen.tsx">
import I18n from "i18next";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../../components/screens/OperationResultScreenContent";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { useIOSelector } from "../../../../../store/hooks";
import { zendeskItWalletCategory } from "../../../../../utils/supportAssistance";
import { useAvoidHardwareBackButton } from "../../../../../utils/useAvoidHardwareBackButton";
import { trackItwKoStateAction } from "../../../analytics";
import { useItwDisableGestureNavigation } from "../../../common/hooks/useItwDisableGestureNavigation";
import { useItwDismissalDialog } from "../../../common/hooks/useItwDismissalDialog";
import { useItwFailureSupportModal } from "../../../common/hooks/useItwFailureSupportModal";
import { ZendeskSubcategoryValue } from "../../../common/hooks/useItwZendeskSupport";
import { itwIsL3EnabledSelector } from "../../../common/store/selectors/index";
import { serializeFailureReason } from "../../../common/utils/itwStoreUtils";
import { itwCredentialNameResolverSelector } from "../../../credentialsCatalogue/store/selectors";
import { ItwPresentationMissingCredentialsFailureContent } from "../../common/components/ItwPresentationMissingCredentialsFailureContent";
import {
  trackItwRemoteInvalidAuthResponseBottomSheet,
  trackItwUpgradeL3MandatoryCancel,
  trackItwUpgradeL3MandatoryConfirm
} from "../analytics";
import { getDismissalContextFromFailure } from "../analytics/utils";
import { ItwL3UpgradeTrigger } from "../analytics/utils/types";
import { useItwRemoteEventsTracking } from "../hooks/useItwRemoteEventsTracking";
import { useItwRemoteUntrustedRPBottomSheet } from "../hooks/useItwRemoteUntrustedRPBottomSheet";
import { useItwSendAuthorizationErrorResponse } from "../hooks/useItwSendAuthorizationErrorResponse";
import { RemoteFailure, RemoteFailureType } from "../machine/failure";
import { ItwRemoteMachineContext } from "../machine/provider";
import { selectFailure } from "../machine/selectors";
⋮----
export const ItwRemoteFailureScreen = () =>
⋮----
type ContentViewProps = { failure: RemoteFailure };
⋮----
const ContentView = (
⋮----
const closeMachine = () => machineRef.send(
⋮----
const getOperationResultScreenContentProps =
(): OperationResultScreenContentProps =>
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/screens/ItwRemoteRequestValidationScreen.tsx">
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useLayoutEffect, useRef, useState } from "react";
⋮----
import { IOStackNavigationRouteProps } from "../../../../../navigation/params/AppParamsList.ts";
import { useIOSelector } from "../../../../../store/hooks.ts";
import {
  isStartupLoaded,
  StartupStatusEnum
} from "../../../../../store/reducers/startup.ts";
import { useItwDisableGestureNavigation } from "../../../common/hooks/useItwDisableGestureNavigation.ts";
import { selectItwSpecsVersion } from "../../../common/store/selectors/environment.ts";
import { trackItwRemoteStart } from "../analytics";
import { ItwRemoteDeepLinkFailure } from "../components/ItwRemoteDeepLinkFailure.tsx";
import { ItwRemoteLoadingScreen } from "../components/ItwRemoteLoadingScreen.tsx";
import { ItwRemoteMachineContext } from "../machine/provider.tsx";
import { ItwRemoteParamsList } from "../navigation/ItwRemoteParamsList.ts";
import { validateItwPresentationQrCodeParams } from "../utils/itwRemotePresentationUtils.ts";
import {
  ItwRemoteFlowType,
  ItwRemoteRequestPayload
} from "../utils/itwRemoteTypeUtils.ts";
⋮----
export type ItwRemoteRequestValidationScreenNavigationParams =
  Partial<ItwRemoteRequestPayload> & {
    flowType: ItwRemoteFlowType;
  };
⋮----
type ScreenProps = IOStackNavigationRouteProps<
  ItwRemoteParamsList,
  "ITW_REMOTE_REQUEST_VALIDATION"
>;
⋮----
const ItwRemoteRequestValidationScreen = (
⋮----
type ContentViewProps = {
  flowType: ItwRemoteFlowType;
  payload: ItwRemoteRequestPayload;
};
⋮----
const ContentView = (
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/utils/itwRemotePresentationUtils.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
import { Result } from "neverthrow";
⋮----
import { isDefined } from "../../../../../utils/guards";
import {
  parseClaims,
  WellKnownClaim
} from "../../../common/utils/itwClaimsUtils";
import { getCredentialStatus } from "../../../common/utils/itwCredentialStatusUtils";
import { validCredentialStatuses } from "../../../common/utils/itwCredentialUtils";
import { getIoWallet } from "../../../common/utils/itwIoWallet";
import { CredentialType } from "../../../common/utils/itwMocksUtils";
import { CredentialMetadata } from "../../../common/utils/itwTypesUtils";
import { ItwRemoteCredentialCombination } from "../analytics/utils/types";
import {
  EnrichedPresentationDetails,
  ItwRemoteQrRawPayload,
  PresentationDetails
} from "./itwRemoteTypeUtils";
⋮----
const isPresentationDetailSdJwt = <T extends PresentationDetails[number]>(
  input: T
): input is Extract<T,
⋮----
export const getCredentialTypeByVct = (vct: string): string | undefined =>
⋮----
export const validateItwPresentationQrCodeParams = (
  itwVersion: ItwVersion,
  params: ItwRemoteQrRawPayload
)
⋮----
export const enrichPresentationDetails = (
  presentationDetails: PresentationDetails,
  credentialsByType: Record<string, CredentialMetadata | undefined>
): EnrichedPresentationDetails
⋮----
export const groupCredentialsByPurpose = (
  presentationDetails: EnrichedPresentationDetails
) =>
⋮----
type Group = Record<string, EnrichedPresentationDetails>;
⋮----
// eslint-disable-next-line functional/immutable-data
⋮----
/**
 * Determines whether a requested credential cannot be presented REMOTELY.
 *
 * Realigned presentation rules (proximity is never inhibited):
 *
 * - A non-valid PID (expired/jwtExpired/revoked/unknown) cannot be presented
 *   remotely. It remains presentable in proximity, where the verifier decides.
 * - For any other credential only revocation (`invalid`) blocks: expiry never
 *   does, as the Relying Party is responsible for verifying it.
 */
const isInvalidForRemotePresentation = (
  credential: CredentialMetadata
): boolean =>
⋮----
export const getInvalidCredentials = (
  presentationDetails: PresentationDetails,
  credentialsByType: Record<string, CredentialMetadata | undefined>
)
⋮----
export const getRemoteCredentialCombination = (
  presentationDetails: EnrichedPresentationDetails
): ItwRemoteCredentialCombination =>
⋮----
export const enum ClientIdPrefix {
  OPENID_FEDERATION = "openid_federation:",
  X509_HASH = "x509_hash:"
}
</file>

<file path="apps/main-app/ts/features/itwallet/presentation/remote/utils/itwRemoteTypeUtils.ts">
import { RemotePresentation } from "@pagopa/io-react-native-wallet";
⋮----
import { ClaimDisplayFormat } from "../../../common/utils/itwClaimsUtils";
⋮----
export type AuthErrorResponseBody = Parameters<
  RemotePresentationApi["sendAuthorizationErrorResponse"]
>[1];
⋮----
export type DcqlQuery = Parameters<
  RemotePresentationApi["evaluateDcqlQuery"]
>[0];
⋮----
export type EnrichedPresentationDetails = Array<
  PresentationDetails[number] & { claimsToDisplay: Array<ClaimDisplayFormat> }
>;
⋮----
export type ItwRemoteFlowType = "cross-device" | "same-device";
⋮----
export type ItwRemoteQrRawPayload = Parameters<
  RemotePresentationApi["startFlowFromQR"]
>[number];
⋮----
export type ItwRemoteRequestPayload = RemotePresentation.PresentationParams;
⋮----
export type PresentationDetails = Awaited<
  ReturnType<RemotePresentationApi["evaluateDcqlQuery"]>
>;
⋮----
export type RelyingPartyConfiguration = RemotePresentation.RelyingPartyConfig;
⋮----
type RemotePresentationApi = RemotePresentation.RemotePresentationApi;
</file>

<file path="apps/main-app/ts/features/itwallet/settings/screens/ItwSettingsScreen.tsx">
import { ContentWrapper, IOMarkdown, VStack } from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { Alert, View } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { ButtonBlockProps } from "../../../../components/ui/utils/buttons";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import {
  trackItwSettings,
  trackItwStartActivation,
  trackItwStartDeactivation
} from "../../analytics";
import { ITW_SCREENVIEW_EVENTS } from "../../analytics/enum";
import { ItwEidLifecycleAlert } from "../../common/components/ItwEidLifecycleAlert";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { ItwEidIssuanceMachineContext } from "../../machine/eid/provider";
import { ITW_ROUTES } from "../../navigation/routes";
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/analytics/index.ts">
import { mixpanelTrack, registerSuperProperties } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { ITW_TECH_EVENTS } from "../../analytics/enum";
import { getLastStatusListCheckTimestamps } from "../utils/storage";
⋮----
export const trackItwStatusListFetchRegisterFailure = (reason: unknown) =>
⋮----
export const trackItwStatusListFetchRegistered = () =>
⋮----
export const registerStatusListProperties = async () =>
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/saga/checkStatusListCoherenceSaga.ts">
import { call, select } from "typed-redux-saga/macro";
⋮----
import { itwStatusListReferencedUrisSelector } from "../store/selectors";
import { StatusListRepository } from "../utils/repository";
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { call, fork, select } from "typed-redux-saga/macro";
⋮----
import {
  selectItwEnv,
  selectItwSpecsVersion
} from "../../common/store/selectors/environment";
import { getEnv } from "../../common/utils/environment";
import { getIoWallet } from "../../common/utils/itwIoWallet";
import { registerStatusListProperties } from "../analytics";
import { refreshStaleEntries } from "../utils/refresh";
import { checkStatusListCoherenceSaga } from "./checkStatusListCoherenceSaga";
import { registerStatusListFetchTaskSaga } from "./registerStatusListFetchTaskSaga";
import { watchItwSpecsVersionStorageSaga } from "./storeItwSpecsVersionSaga";
import { updateCredentialsStatusSaga } from "./updateCredentialsStatusSaga";
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/saga/registerStatusListFetchTaskSaga.ts">
import { SagaIterator } from "redux-saga";
import { call, select, take } from "typed-redux-saga/macro";
⋮----
import { waitForItWalletActivation } from "../../common/saga/utils";
import {
  selectItwEnv,
  selectItwSpecsVersion
} from "../../common/store/selectors/environment";
import { itwLifecycleStoresReset } from "../../lifecycle/store/actions";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import {
  registerItwStatusListFetchTask,
  unregisterItwStatusListFetchTask
} from "../tasks";
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/saga/storeItwSpecsVersionSaga.ts">
import { type ItwVersion } from "@pagopa/io-react-native-wallet";
import { SagaIterator } from "redux-saga";
import { call, takeLatest } from "typed-redux-saga/macro";
import { Action, isActionOf } from "typesafe-actions";
⋮----
import { CredentialType } from "../../common/utils/itwMocksUtils";
import { itwCredentialsStore } from "../../credentials/store/actions";
import { storeItwSpecsVersion } from "../utils/storage";
⋮----
export const isItwCredentialsStoreWithEid = (
  action: Action
): action is ReturnType<typeof itwCredentialsStore>
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/saga/updateCredentialsStatusSaga.ts">
import { all, call, put, select } from "typed-redux-saga/macro";
⋮----
import { getIoWallet } from "../../common/utils/itwIoWallet";
import {
  CredentialMetadata,
  CredentialValidity
} from "../../common/utils/itwTypesUtils";
import { itwCredentialsStore } from "../../credentials/store/actions";
import { itwAllStoredCredentialsSelector } from "../../credentials/store/selectors";
import { StatusListRepository } from "../utils/repository";
import { StatusListContext } from "../utils/types";
⋮----
const hasStatusListValidity = (
  credential: CredentialMetadata
): credential is CredentialMetadata &
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/store/selectors/index.ts">
import { GlobalState } from "../../../../../store/reducers/types";
import { selectItwSpecsVersion } from "../../../common/store/selectors/environment";
import { getIoWallet } from "../../../common/utils/itwIoWallet";
import { CredentialValidity } from "../../../common/utils/itwTypesUtils";
import { itwAllStoredCredentialsSelector } from "../../../credentials/store/selectors";
import { itwKeyAttestationsSelector } from "../../../walletInstance/store/selectors";
⋮----
export const itwStatusListReferencedUrisSelector = (
  state: GlobalState
): ReadonlyArray<string> =>
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/tasks/index.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
⋮----
import { EnvType, getEnv } from "../../common/utils/environment";
import {
  trackItwStatusListFetchRegistered,
  trackItwStatusListFetchRegisterFailure
} from "../analytics";
import { refreshStaleEntries } from "../utils/refresh";
import {
  getItwEnv,
  getItwSpecsVersion,
  storeItwEnv,
  storeItwSpecsVersion
} from "../utils/storage";
⋮----
export const registerItwStatusListFetchTask = async (
  itwVersion: ItwVersion,
  env: EnvType
): Promise<void> =>
⋮----
export const unregisterItwStatusListFetchTask = async (): Promise<void> =>
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/utils/consts.ts">

</file>

<file path="apps/main-app/ts/features/itwallet/statusList/utils/errors.ts">
export class InvalidTslCredentialStatus extends Error
⋮----
constructor(credentialId: string, rawStatus: string)
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/utils/index.ts">
import {
  verifyCertificateChain,
  X509CertificateOptions
} from "@pagopa/io-react-native-crypto";
import { decode as decodeJwt } from "@pagopa/io-react-native-jwt";
import {
  CredentialIssuance,
  getJwkFromCertificateChain,
  ItwVersion
} from "@pagopa/io-react-native-wallet";
⋮----
import { assert } from "../../../../utils/assert";
import { getIoWallet } from "../../common/utils/itwIoWallet";
import { IssuerConfiguration } from "../../common/utils/itwTypesUtils";
import { InvalidTslCredentialStatus } from "./errors";
import { StatusListX5cSchema } from "./schemas";
⋮----
export const getKeysForStatusListToken = async (
  statusListToken: string,
  x509CertRoot: string
): Promise<IssuerConfiguration["keys"]> =>
⋮----
export const getCredentialStatusFromStatusList = async (
  itwVersion: ItwVersion,
  credential: string,
  credentialId: string,
  credentialFormat: CredentialIssuance.CredentialFormat,
  keys: IssuerConfiguration["keys"]
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/utils/refresh.ts">
import { getKeysForStatusListToken } from ".";
import { assert } from "../../../../utils/assert";
import { getIoWallet } from "../../common/utils/itwIoWallet";
import { StatusListRepository } from "./repository";
import { storeLastStatusListCheckTimestamp } from "./storage";
import { StatusListVerificationContext } from "./types";
import { isStale } from "./validity";
⋮----
export const refreshStatusListToken = async (
  { itwVersion, x509CertRoot }: StatusListVerificationContext,
  uri: string
): Promise<boolean> =>
⋮----
export const refreshWithBoundedParallelism = async (
  context: StatusListVerificationContext,
  uris: Array<string>
): Promise<void> =>
⋮----
export const refreshStaleEntries = async (
  context: StatusListVerificationContext
): Promise<void> =>
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/utils/repository.ts">
import { CredentialStatus } from "@pagopa/io-react-native-wallet";
import AsyncStorage from "@react-native-async-storage/async-storage";
⋮----
import { STORAGE_PREFIX } from "./consts";
⋮----
const entryKey = (uri: string): string
⋮----
const readEntryKeys = async (): Promise<Array<string>> =>
⋮----
const list = async (): Promise<Array<CredentialStatus.StatusList>> =>
⋮----
const get = async (
  uri: string
): Promise<CredentialStatus.StatusList | undefined> =>
⋮----
const upsert = async (
  uri: string,
  payload: CredentialStatus.StatusList
): Promise<void> =>
⋮----
const upsertMany = async (
  items: Array<[uri: string, payload: CredentialStatus.StatusList]>
): Promise<void> =>
⋮----
const remove = async (uri: string): Promise<void> =>
⋮----
const removeMany = async (uris: Array<string>): Promise<void> =>
⋮----
const clear = async (): Promise<void> =>
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/utils/schemas.ts">
import { z } from "zod";
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/utils/storage.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { z } from "zod";
⋮----
import { EnvType, EnvTypeSchema } from "../../common/utils/environment";
import {
  STORAGE_KEY_ITW_ENV,
  STORAGE_KEY_ITW_SPECS_VERSION,
  STORAGE_KEY_LAST_CHECK_TIME
} from "./consts";
⋮----
export const storeItwSpecsVersion = async (
  itwVersion: ItwVersion
): Promise<void>
⋮----
export const getItwSpecsVersion = async (): Promise<ItwVersion> =>
⋮----
export const storeItwEnv = async (env: EnvType): Promise<void>
⋮----
export const getItwEnv = async (): Promise<EnvType>
⋮----
export const storeLastStatusListCheckTimestamp = async (
  timestamp: number
): Promise<void> =>
⋮----
export const getLastStatusListCheckTimestamps = async (): Promise<
  Array<number>
> => {
  try {
    const raw = await AsyncStorage.getItem(STORAGE_KEY_LAST_CHECK_TIME);
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/utils/types.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
⋮----
export type StatusListContext = {
  itwVersion: ItwVersion;
};
⋮----
export type StatusListVerificationContext = StatusListContext & {
  x509CertRoot: string;
};
</file>

<file path="apps/main-app/ts/features/itwallet/statusList/utils/validity.ts">
import { type CredentialStatus } from "@pagopa/io-react-native-wallet";
⋮----
export const isStale = (
  payload: CredentialStatus.StatusList,
  now: number
): boolean =>
</file>

<file path="apps/main-app/ts/features/itwallet/tour/hooks/useItwGuidedTour.ts">
import { useHeaderHeight } from "@react-navigation/elements";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
import { Dimensions, Platform } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { offlineAccessReasonSelector } from "../../../ingress/store/selectors";
import { useGuidedTourRegion } from "../../../tour/components/useGuidedTourRegion";
import { startTourAction } from "../../../tour/store/actions";
import { isTourCompletedSelector } from "../../../tour/store/selectors";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import {
  ITW_TOUR_GROUP_ID,
  ITW_TOUR_STEP_ADD_BUTTON
} from "../utils/constants";
⋮----
export const useItwGuidedTour = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/tour/utils/constants.ts">

</file>

<file path="apps/main-app/ts/features/itwallet/trialSystem/saga/checkFiscalCodeIsEnabledSaga.ts">
import { SagaIterator } from "redux-saga";
import { call, select } from "typed-redux-saga/macro";
⋮----
import { apiUrlPrefix } from "../../../../config.ts";
import { assert } from "../../../../utils/assert.ts";
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { createItWalletClient } from "../../api/client.ts";
import { selectItwEnv } from "../../common/store/selectors/environment.ts";
import { getEnv } from "../../common/utils/environment.ts";
import { handleGetWhitelistedStatus } from "./handleGetWhitelistedStatus.ts";
</file>

<file path="apps/main-app/ts/features/itwallet/trialSystem/saga/handleGetWhitelistedStatus.ts">
import { SagaIterator } from "redux-saga";
import { call, put } from "typed-redux-saga/macro";
⋮----
import { ItWalletClient } from "../../api/client.ts";
import { itwSetFiscalCodeWhitelisted } from "../../common/store/actions/preferences.ts";
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/components/ItwCredentialTrustmark.tsx">
import {
  Caption,
  hexToRgba,
  useIOThemeContext,
  useScaleAnimation,
  WithTestID
} from "@io-app/design-system";
import {
  Canvas,
  ColorMatrix,
  Group,
  ImageSVG,
  Mask,
  OpacityMatrix,
  Paint,
  Rect,
  Circle as SkiaCircle,
  Group as SkiaGroup,
  LinearGradient as SkiaLinearGradient,
  RadialGradient as SkiaRadialGradient,
  useSVG,
  vec
} from "@shopify/react-native-skia";
import { LinearGradient } from "expo-linear-gradient";
import I18n from "i18next";
import { useState } from "react";
import {
  ColorValue,
  Image,
  LayoutChangeEvent,
  LayoutRectangle,
  Pressable,
  StyleSheet,
  View
} from "react-native";
import Animated, {
  Extrapolation,
  interpolate,
  SharedValue,
  useDerivedValue
} from "react-native-reanimated";
⋮----
import { RotationSensor } from "../../../../components/RotationSensor";
import { useReduceMotionEnabled } from "../../../../hooks/useReduceMotionEnabled";
import { useRotationEffectEnabled } from "../../../../hooks/useRotationSensor";
import { useIOSelector } from "../../../../store/hooks";
import { validCredentialStatuses } from "../../common/utils/itwCredentialUtils";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { itwCredentialStatusSelector } from "../../credentials/store/selectors";
⋮----
type ItwCredentialTrustmarkProps = WithTestID<{
  credential: CredentialMetadata;
  onPress?: () => void;
}>;
⋮----
export const ItwCredentialTrustmark = ({
  testID,
  credential,
  onPress
}: ItwCredentialTrustmarkProps) =>
⋮----
const getButtonWidth = (event: LayoutChangeEvent)
⋮----
<ColorMatrix matrix=
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/components/ItwTrustmarkExpirationTimer.tsx">
import {
  Body,
  HSpacer,
  Icon,
  IOMarkdownLite,
  IOSkeleton
} from "@io-app/design-system";
import { format } from "date-fns";
import I18n from "i18next";
import { useMemo } from "react";
import { View } from "react-native";
⋮----
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { ItwTrustmarkMachineContext } from "../machine/provider";
import { selectExpirationSeconds, selectFailure } from "../machine/selectors";
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/components/ItwTrustmarkQrCode.tsx">
import { IODimensions } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { ItwRetryableQRCode } from "../../common/components/ItwRetryableQRCode";
import { ItwTrustmarkMachineContext } from "../machine/provider";
import { selectFailure, selectTrustmarkUrl } from "../machine/selectors";
⋮----
const ItwTrustmarkQrCode = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/state/displayingTrustmark.ts">
import { itwTrustmarkMachineSetup } from "../setup";
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/actions.ts">
import { differenceInSeconds } from "date-fns";
import I18n from "i18next";
import { ActionArgs, assign } from "xstate";
⋮----
import { assert } from "../../../../utils/assert";
import { checkCurrentSession } from "../../../authentication/common/store/actions";
import { trackItwTrustmarkRenewFailure } from "../../analytics";
import { getMixPanelCredential } from "../../analytics/utils";
import { itwCredentialSelector } from "../../credentials/store/selectors";
import { itwWalletInstanceAttestationStore } from "../../walletInstance/store/actions";
import { itwWalletInstanceAttestationSelector } from "../../walletInstance/store/selectors";
import { Context } from "./context";
import { TrustmarkEvents } from "./events";
⋮----
export const storeWalletInstanceAttestationAction = ({
  context
}: ActionArgs<Context, TrustmarkEvents, TrustmarkEvents>) =>
⋮----
export const handleSessionExpiredAction = ({
  context
}: ActionArgs<Context, TrustmarkEvents, TrustmarkEvents>) =>
⋮----
export const showRetryFailureToastAction = ({
  context
}: ActionArgs<Context, TrustmarkEvents, TrustmarkEvents>) =>
⋮----
export const trackTrustmarkFailureAction = ({
  context
}: ActionArgs<Context, TrustmarkEvents, TrustmarkEvents>) =>
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/actors.ts">
import { fromPromise } from "xstate";
⋮----
import { assert } from "../../../../utils/assert";
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
⋮----
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
import { itwIntegrityKeyTagSelector } from "../../issuance/store/selectors";
⋮----
import { TrustmarkMachineDeps } from "./input";
⋮----
export type GetCredentialTrustmarkUrlActorInput = {
  credential?: CredentialMetadata;
  deps: TrustmarkMachineDeps;
  walletInstanceAttestation?: string;
};
⋮----
export type GetCredentialTrustmarkUrlActorOutput = Awaited<
  ReturnType<typeof itwTrustmarkUtils.getCredentialTrustmark>
>;
⋮----
export type GetWalletAttestationActorInput = {
  deps: TrustmarkMachineDeps;
};
⋮----
export type GetWalletAttestationActorOutput = Awaited<
  ReturnType<typeof itwAttestationUtils.getWalletInstanceAttestation>
>;
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/context.ts">
import {
  CredentialMetadata,
  WalletInstanceAttestations
} from "../../common/utils/itwTypesUtils";
import { TrustmarkFailure } from "./failure";
import { TrustmarkMachineDeps } from "./input";
⋮----
export type Context = {
  attempts?: number;
  credential?: CredentialMetadata;
  credentialType: string;
  deps: TrustmarkMachineDeps;
  expirationDate?: Date;
  expirationSeconds?: number;
  failure?: TrustmarkFailure;
  nextAttemptAt?: Date;
  trustmarkUrl?: string;
  walletInstanceAttestation?: WalletInstanceAttestations;
};
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/events.ts">
import { ErrorActorEvent } from "xstate";
⋮----
export type TrustmarkEvents = ErrorActorEvent | Retry;
⋮----
type Retry = {
  type: "retry";
};
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/failure.ts">
import { Errors } from "@pagopa/io-react-native-wallet";
⋮----
import { TrustmarkEvents } from "./events";
⋮----
enum TrustmarkFailureType {
  UNEXPECTED = "UNEXPECTED",
  WALLET_PROVIDER_GENERIC = "WALLET_PROVIDER_GENERIC"
}
⋮----
export type TrustmarkFailure = {
  reason: unknown;
  type: TrustmarkFailureType;
};
⋮----
export const mapEventToFailure = (event: TrustmarkEvents): TrustmarkFailure =>
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/guards.ts">
import { AnyEventObject } from "xstate";
⋮----
import { ItwSessionExpiredError } from "../../api/client";
import { isWalletInstanceAttestationValid } from "../../common/utils/itwAttestationUtils";
import { Context } from "./context";
⋮----
type GuardArgs = {
  context: Context;
  event: AnyEventObject;
};
⋮----
export const isSessionExpiredGuard = (
⋮----
export const hasValidWalletInstanceAttestationGuard = ({
  context
}: GuardArgs) =>
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/input.ts">
import { ItwVersion } from "@pagopa/io-react-native-wallet";
⋮----
import { Env } from "../../common/utils/environment";
import {
  MachineNavigation,
  MachineStore,
  MachineToast
} from "../../machine/utils/deps";
⋮----
export type Input = {
  credentialType: string;
  deps: TrustmarkMachineDeps;
};
⋮----
export type TrustmarkMachineDeps = {
  env: Env;
  itwVersion: ItwVersion;
  navigation: MachineNavigation;
  store: MachineStore;
  toast: MachineToast;
};
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/machine.ts">
import { assign, not } from "xstate";
⋮----
import { ItwTags } from "../../machine/tags";
import { itwTrustmarkMachineSetup } from "./setup";
import { displayingTrustmarkState } from "./state/displayingTrustmark";
⋮----
export type ItwTrustmarkMachine = typeof itwTrustmarkMachine;
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/provider.tsx">
import { useIOToast } from "@io-app/design-system";
import { createActorContext } from "@xstate/react";
import { PropsWithChildren } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector, useIOStore } from "../../../../store/hooks";
import {
  selectItwEnv,
  selectItwSpecsVersion
} from "../../common/store/selectors/environment";
import { getEnv } from "../../common/utils/environment";
import { itwTrustmarkMachine } from "./machine";
⋮----
type Props = PropsWithChildren<{
  credentialType: string;
}>;
⋮----
export const ItwTrustmarkMachineProvider = ({
  credentialType,
  children
}: Props) =>
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/selectors.ts">
import { StateFrom } from "xstate";
⋮----
import { ItwTrustmarkMachine } from "./machine";
⋮----
type MachineSnapshot = StateFrom<ItwTrustmarkMachine>;
⋮----
export const selectTrustmarkUrl = (
⋮----
export const selectExpirationSeconds = (
⋮----
export const selectFailure = (
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/machine/setup.ts">
import { addSeconds, differenceInSeconds, isPast } from "date-fns";
import { assign, setup } from "xstate";
⋮----
import {
  handleSessionExpiredAction,
  onInitAction,
  showRetryFailureToastAction,
  storeWalletInstanceAttestationAction,
  trackTrustmarkFailureAction
} from "./actions";
import {
  getCredentialTrustmarkActor,
  getWalletAttestationActor
} from "./actors";
import { Context } from "./context";
import { TrustmarkEvents } from "./events";
import { mapEventToFailure } from "./failure";
import {
  hasValidWalletInstanceAttestationGuard,
  isSessionExpiredGuard
} from "./guards";
import { Input } from "./input";
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/screens/ItwCredentialTrustmarkScreen.tsx">
import { Body, ContentWrapper, VStack } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useMaxBrightness } from "../../../../utils/brightness";
import { usePreventScreenCapture } from "../../../../utils/hooks/usePreventScreenCapture";
import { RequiresConnectivity } from "../../common/components/RequiresConnectivity";
import { useItwCredentialName } from "../../common/hooks/useItwCredentialName";
import { ItwParamsList } from "../../navigation/ItwParamsList";
import { ItwTrustmarkExpirationTimer } from "../components/ItwTrustmarkExpirationTimer";
import { ItwTrustmarkQrCode } from "../components/ItwTrustmarkQrCode";
import { ItwTrustmarkMachineProvider } from "../machine/provider";
⋮----
export type ItwCredentialTrustmarkScreenNavigationParams = {
  credentialType: string;
};
⋮----
type ScreenProps = IOStackNavigationRouteProps<
  ItwParamsList,
  "ITW_PRESENTATION_CREDENTIAL_TRUSTMARK"
>;
</file>

<file path="apps/main-app/ts/features/itwallet/trustmark/utils/index.ts">
import {
  createCryptoContextFor,
  ItwVersion
} from "@pagopa/io-react-native-wallet";
⋮----
import { Env } from "../../common/utils/environment";
import { WellKnownClaim } from "../../common/utils/itwClaimsUtils";
import { WIA_KEYTAG } from "../../common/utils/itwCryptoContextUtils";
import { getIoWallet } from "../../common/utils/itwIoWallet";
import {
  CredentialMetadata,
  ParsedCredential
} from "../../common/utils/itwTypesUtils";
⋮----
export const getCredentialDocumentNumber = (
  parsedCredential: ParsedCredential
): string | undefined =>
⋮----
const getCredentialTypeForTrustmark = ({
  credentialType
}: CredentialMetadata) =>
⋮----
export const getCredentialTrustmark = async (
  { VERIFIER_BASE_URL }: Env,
  itwVersion: ItwVersion,
  walletInstanceAttestation: string,
  metadata: CredentialMetadata
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/wallet/analytics/enum.ts">
export enum ITW_OFFLINE_ACTIONS_EVENTS {
  ITW_OFFLINE_RICARICA_APP_IO = "ITW_OFFLINE_RICARICA_APP_IO"
}
⋮----
export enum ITW_OFFLINE_ERRORS_EVENTS {
  ITW_OFFLINE_RELOAD_FAILURE = "ITW_OFFLINE_RELOAD_FAILURE"
}
⋮----
export enum ITW_OFFLINE_SCREENVIEW_EVENTS {
  ITW_OFFLINE_ACCESS_EXPIRED = "ITW_OFFLINE_ACCESS_EXPIRED",
  ITW_OFFLINE_ACCESS_EXPIRING = "ITW_OFFLINE_ACCESS_EXPIRING",
  ITW_OFFLINE_BOTTOM_SHEET = "ITW_OFFLINE_BOTTOM_SHEET",
  ITW_OFFLINE_WALLET = "ITW_OFFLINE_WALLET"
}
</file>

<file path="apps/main-app/ts/features/itwallet/wallet/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import {
  ITW_OFFLINE_ACTIONS_EVENTS,
  ITW_OFFLINE_ERRORS_EVENTS,
  ITW_OFFLINE_SCREENVIEW_EVENTS
} from "./enum";
import { ItwOfflineRicaricaAppIOSource } from "./types";
⋮----
export const trackItwOfflineWallet = () =>
⋮----
export const trackItwOfflineBottomSheet = () =>
⋮----
export const trackItwOfflineAccessExpiring = () =>
⋮----
export const trackItwOfflineAccessExpired = () =>
⋮----
export const trackItwOfflineRicaricaAppIO = (
  source: ItwOfflineRicaricaAppIOSource
) =>
⋮----
export const trackItwOfflineReloadFailure = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/wallet/analytics/types.ts">
export type ItwOfflineRicaricaAppIOSource =
  | "access_expired_screen"
  | "banner"
  | "bottom_sheet";
</file>

<file path="apps/main-app/ts/features/itwallet/wallet/components/ItwCredentialWalletCard.tsx">
import { Body, VStack } from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
import { View } from "react-native";
⋮----
import { renderActionButtons } from "../../../../components/ui/IOScrollView";
import { useOfflineToastGuard } from "../../../../hooks/useOfflineToastGuard";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { withWalletCardBaseComponent } from "../../../wallet/components/WalletCardBaseComponent";
import { WalletCardPressableBase } from "../../../wallet/components/WalletCardPressableBase";
import {
  ItwCredentialCard,
  ItwCredentialCardLegacy
} from "../../common/components/ItwCredentialCard";
import { useItwCredentialName } from "../../common/hooks/useItwCredentialName";
import { itwShouldUpgradeCredentialSelector } from "../../common/store/selectors";
import { CredentialType } from "../../common/utils/itwMocksUtils";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
⋮----
export type ItwCredentialWalletCardProps = ItwCredentialCard & {
  onPress?: () => void;
  withItwDesign?: boolean;
};
⋮----
type PressableCredentialCardProps = ItwCredentialCard & {
  accessibilityLabel: string;
  onPress: () => void;
  withItwDesign: boolean;
};
⋮----
const WrappedItwCredentialCard = ({
  onPress,
  withItwDesign: forceItwDesign,
  ...cardProps
}: ItwCredentialWalletCardProps) =>
⋮----
const navigateToDetails = ()
</file>

<file path="apps/main-app/ts/features/itwallet/wallet/components/ItwOfflineAccessGate.tsx">
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { PropsWithChildren, useState } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import {
  itwIsOfflineAccessLimitReached,
  itwShouldDisplayOfflineAccessLimitWarning
} from "../../common/store/selectors/securePreferences";
import {
  trackItwOfflineAccessExpired,
  trackItwOfflineAccessExpiring
} from "../analytics";
import { useAppRestartAction } from "../hooks/useAppRestartAction";
⋮----
export const ItwOfflineAccessGate = (
⋮----
const LimitReachedScreenContent = () =>
</file>

<file path="apps/main-app/ts/features/itwallet/wallet/components/ItwWalletCardsContainer.tsx">
import { ListItemHeader, VStack } from "@io-app/design-system";
import { useFocusEffect, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { StyleSheet, View } from "react-native";
import { shallowEqual } from "react-redux";
⋮----
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { GuidedTour } from "../../../tour/components/GuidedTour.tsx";
import { WalletCardsCategoryContainer } from "../../../wallet/components/WalletCardsCategoryContainer";
import { selectWalletCardsByCategory } from "../../../wallet/store/selectors";
import { withWalletCategoryFilter } from "../../../wallet/utils";
import {
  ItwEidInfoBottomSheetContent,
  ItwEidInfoBottomSheetTitle
} from "../../common/components/ItwEidInfoBottomSheetContent";
import { ItwEidLifecycleAlert } from "../../common/components/ItwEidLifecycleAlert";
import { ItwL2EngagementBanner } from "../../common/components/ItwL2EngagementBanner.tsx";
import { ItwWalletReadyBanner } from "../../common/components/ItwWalletReadyBanner";
import { useItwStatusIconColor } from "../../common/hooks/useItwStatusIconColor.ts";
import {
  itwShouldHideEidLifecycleAlert,
  itwShouldRenderL2EngagementBannerSelector,
  itwShouldRenderNewItWalletSelector,
  itwShouldRenderUpgradeBannerSelector
} from "../../common/store/selectors";
import { ItwEidStatus } from "../../common/utils/itwTypesUtils.ts";
import {
  itwCredentialsEidExpirationSelector,
  itwCredentialsEidStatusSelector
} from "../../credentials/store/selectors";
import { ItwDiscoveryBanner } from "../../discovery/components/ItwDiscoveryBanner.tsx";
import { itwLifecycleIsITWalletValidSelector } from "../../lifecycle/store/selectors";
import { useItwGuidedTour } from "../../tour/hooks/useItwGuidedTour.ts";
import {
  ITW_TOUR_GROUP_ID,
  ITW_TOUR_STEP_CREDENTIALS
} from "../../tour/utils/constants.ts";
import { ItwWalletIdCard } from "./ItwWalletIdCard.tsx";
</file>

<file path="apps/main-app/ts/features/itwallet/wallet/components/ItwWalletIdCard.tsx">
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { GuidedTour } from "../../../tour/components/GuidedTour";
import { CredentialType } from "../../common/utils/itwMocksUtils";
import {
  itwCredentialsEidIssuedAtSelector,
  itwCredentialsEidStatusSelector
} from "../../credentials/store/selectors";
import { ITW_ROUTES } from "../../navigation/routes";
import {
  ITW_TOUR_GROUP_ID,
  ITW_TOUR_STEP_ID
} from "../../tour/utils/constants.ts";
import { ItwCredentialWalletCard } from "./ItwCredentialWalletCard.tsx";
⋮----
export const ItwWalletIdCard = (
</file>

<file path="apps/main-app/ts/features/itwallet/wallet/hooks/useAppRestartAction.ts">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { startApplicationInitialization } from "../../../../store/actions/application";
import { startupLoadSuccess } from "../../../../store/actions/startup";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { StartupStatusEnum } from "../../../../store/reducers/startup";
import { isConnectedSelector } from "../../../connectivity/store/selectors";
import { resetOfflineAccessReason } from "../../../ingress/store/actions";
import {
  trackItwOfflineReloadFailure,
  trackItwOfflineRicaricaAppIO
} from "../analytics";
import { ItwOfflineRicaricaAppIOSource } from "../analytics/types";
⋮----
export const useAppRestartAction = (source: ItwOfflineRicaricaAppIOSource) =>
</file>

<file path="apps/main-app/ts/features/itwallet/wallet/screens/ItwOfflineWalletScreen.tsx">
import { HeaderFirstLevel } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import {
  IOScrollView,
  IOScrollViewActions
} from "../../../../components/ui/IOScrollView";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { isItwProximityEnabledSelector } from "../../common/store/selectors";
import { trackItwProximityShowQrCode } from "../../presentation/proximity/analytics";
import { ITW_PROXIMITY_ROUTES } from "../../presentation/proximity/navigation/routes";
import { trackItwOfflineWallet } from "../analytics";
import { ItwOfflineAccessGate } from "../components/ItwOfflineAccessGate";
import { ItwWalletCardsContainer } from "../components/ItwWalletCardsContainer";
</file>

<file path="apps/main-app/ts/features/itwallet/wallet/utils/index.ts">
import { WalletCard } from "../../../wallet/types";
import { getCredentialStatus } from "../../common/utils/itwCredentialStatusUtils";
import { CredentialMetadata } from "../../common/utils/itwTypesUtils";
⋮----
export const mapCredentialToWalletCard = (
  credential: CredentialMetadata
): WalletCard => (
</file>

<file path="apps/main-app/ts/features/itwallet/walletInstance/hook/useItwWalletInstanceRevocationAlert.ts">
import I18n from "i18next";
import { useCallback } from "react";
import { Alert } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { generateDynamicUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  DOCUMENTS_ON_IO_FAQ_12_URL_BODY,
  DOCUMENTS_ON_IO_FAQ_14_URL_BODY
} from "../../../../urls";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../utils/url";
import { WalletInstanceRevocationReason } from "../../common/utils/itwTypesUtils";
import { itwUpdateWalletInstanceStatus } from "../store/actions";
import { itwWalletInstanceStatusSelector } from "../store/selectors";
⋮----
export const useItwWalletInstanceRevocationAlert = () =>
⋮----
const showWalletRevocationAlert = (
  itwMinIntegrityReqUrl: string,
  itwDocsOnIOMultipleDevicesUrl: string,
  revocationReason?: WalletInstanceRevocationReason
) =>
</file>

<file path="apps/main-app/ts/features/itwallet/walletInstance/store/actions/index.ts">
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
import {
  WalletInstanceAttestations,
  WalletInstanceStatus
} from "../../../common/utils/itwTypesUtils";
import { ItwWalletInstanceState } from "../reducers";
⋮----
export type ItwWalletInstanceActions =
  | ActionType<typeof itwKeyAttestationsRemoveById>
  | ActionType<typeof itwKeyAttestationsStore>
  | ActionType<typeof itwSetWalletInstanceRemotelyActive>
  | ActionType<typeof itwSetWalletInstanceRenewalError>
  | ActionType<typeof itwStoreWalletInstanceStatusList>
  | ActionType<typeof itwUpdateWalletInstanceStatus>
  | ActionType<typeof itwWalletInstanceAttestationStore>;
</file>

<file path="apps/main-app/ts/features/itwallet/walletInstance/store/reducers/index.ts">
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  persistReducer
} from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import createSecureStorage from "../../../../../store/storages/secureStorage";
import { isDevEnv } from "../../../../../utils/environment";
import { NetworkError } from "../../../../../utils/errors";
import {
  WalletInstanceAttestations,
  WalletInstanceStatus
} from "../../../common/utils/itwTypesUtils";
import { itwLifecycleStoresReset } from "../../../lifecycle/store/actions";
import {
  itwKeyAttestationsRemoveById,
  itwKeyAttestationsStore,
  itwSetWalletInstanceRemotelyActive,
  itwSetWalletInstanceRenewalError,
  itwStoreWalletInstanceStatusList,
  itwUpdateWalletInstanceStatus,
  itwWalletInstanceAttestationStore
} from "../actions";
⋮----
export type ItwWalletInstanceState = {
  attestation: undefined | WalletInstanceAttestations;
  isRemotelyActive: boolean | undefined;
  keyAttestations: Record<string, string>;
  renewalError: boolean;
  status: pot.Pot<WalletInstanceStatus, NetworkError>;
  statusList: undefined | { idx: number; uri: string };
};
⋮----
type MigrationState = PersistedState & Record<string, any>;
⋮----
const reducer = (
  state: ItwWalletInstanceState = itwWalletInstanceInitialState,
  action: Action
): ItwWalletInstanceState =>
</file>

<file path="apps/main-app/ts/features/itwallet/walletInstance/store/selectors/index.ts">
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const itwWalletInstanceAttestationSelector = (state: GlobalState)
⋮----
export const itwWalletInstanceStatusSelector = (state: GlobalState)
⋮----
export const itwIsWalletInstanceStatusFailureSelector = (state: GlobalState)
⋮----
export const itwWalletInstanceRenewalErrorSelector = (state: GlobalState)
⋮----
export const itwKeyAttestationsSelector = (state: GlobalState)
⋮----
export const itwIsRemotelyActiveSelector = (state: GlobalState)
⋮----
export const itwWalletInstanceStatusListSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/landingScreenMultiBanner/components/__mocks__/LandingScreenBannerPicker.tsx">
import { View } from "react-native";
⋮----
export const LandingScreenBannerPicker = () => (
  <View testID="mock_landing_screen_banner_picker">
    This is a mock for LandingScreenBannerPicker
  </View>
);
</file>

<file path="apps/main-app/ts/features/landingScreenMultiBanner/components/LandingScreenBannerPicker.tsx">
import { useMemo } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { usePushNotificationsBannerTracking } from "../../pushNotifications/hooks/usePushNotificationsBannerTracking";
import { updateLandingScreenBannerVisibility } from "../store/actions";
import { landingScreenBannerToRenderSelector } from "../store/selectors";
import { landingScreenBannerMap } from "../utils/landingScreenBannerMap";
⋮----
export const LandingScreenBannerPicker = () =>
⋮----
const closeHandler = () =>
</file>

<file path="apps/main-app/ts/features/landingScreenMultiBanner/store/actions.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { LandingScreenBannerId } from "../utils/landingScreenBannerMap";
⋮----
type UpdateBannerVisibilityPayloadType = {
  enabled: boolean;
  id: LandingScreenBannerId;
};
⋮----
export type LandingScreenBannerActions = ActionType<
  typeof updateLandingScreenBannerVisibility
>;
</file>

<file path="apps/main-app/ts/features/landingScreenMultiBanner/store/reducer.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../store/actions/types";
import {
  LANDING_SCREEN_BANNERS_ENABLED_MAP,
  LandingScreenBannerId
} from "../utils/landingScreenBannerMap";
import { updateLandingScreenBannerVisibility } from "./actions";
⋮----
export type LandingScreenBannerState = {
  [key in LandingScreenBannerId]: boolean;
};
⋮----
export const landingScreenBannersReducer = (
  state: LandingScreenBannerState = INITIAL_STATE,
  action: Action
) =>
</file>

<file path="apps/main-app/ts/features/landingScreenMultiBanner/store/selectors.ts">
import { createSelector, createStructuredSelector } from "reselect";
⋮----
import { landingScreenBannerOrderSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../store/reducers/types";
import { renderabilitySelectorsFromBannerMap } from "../utils";
import {
  LandingScreenBannerId,
  landingScreenBannerMap
} from "../utils/landingScreenBannerMap";
⋮----
export const localBannerVisibilitySelector = (state: GlobalState)
⋮----
type StructuredSelectorOutput = {
  [key in LandingScreenBannerId]: boolean;
};
</file>

<file path="apps/main-app/ts/features/landingScreenMultiBanner/utils/index.ts">
import { mapValues } from "lodash";
⋮----
import { BannerMapById } from "./landingScreenBannerMap";
⋮----
export const renderabilitySelectorsFromBannerMap = (bannerMap: BannerMapById)
</file>

<file path="apps/main-app/ts/features/landingScreenMultiBanner/utils/landingScreenBannerMap.tsx">
import { ReactElement } from "react";
⋮----
import { GlobalState } from "../../../store/reducers/types";
import { LoginExpirationBanner } from "../../authentication/activeSessionLogin/components/LoginExpirationBanner";
import { showSessionExpirationBannerRenderableSelector } from "../../authentication/activeSessionLogin/store/selectors";
import CgnDiscoveryBanner from "../../bonus/cgn/components/CgnDiscoveryBanner";
import { isCgnEngagementBannerRenderableSelector } from "../../bonus/cgn/store/selectors/banners";
import { ItwDiscoveryBannerLegacy } from "../../itwallet/common/components/discoveryBanner/ItwDiscoveryBanner";
import {
  isItwPersistedDiscoveryBannerRenderableSelector,
  itwShouldRenderInboxDiscoveryBannerSelector
} from "../../itwallet/common/store/selectors";
import { ItwDiscoveryBanner } from "../../itwallet/discovery/components/ItwDiscoveryBanner";
import OsDismissionBanner from "../../osDismission/components/OsDismissionBanner";
import { isOsDismissionBannerRenderableSelector } from "../../osDismission/store/selectors";
import { PNActivationReminderBanner } from "../../pn/reminderBanner/components/PNActivationReminderBanner";
import { isPnActivationReminderBannerRenderableSelector } from "../../pn/reminderBanner/reducer/bannerDismiss";
import { PushNotificationsBanner } from "../../pushNotifications/components/PushNotificationsBanner";
import { isPushNotificationsBannerRenderableSelector } from "../../pushNotifications/store/selectors";
import { FseDiscoveryBanner } from "../../services/fseDiscoveryBanner/components/FseDiscoveryBanner";
import { isFseDiscoveryBannerRenderableSelector } from "../../services/fseDiscoveryBanner/store/selectors";
⋮----
export type BannerMapById = {
  [key in LandingScreenBannerId]: ComponentAndLogic;
};
export type LandingScreenBannerId =
  keyof typeof LANDING_SCREEN_BANNERS_ENABLED_MAP;
⋮----
type ComponentAndLogic = {
  component: ComponentWithCloseHandler;
  isRenderableSelector: (state: GlobalState) => boolean;
};
type ComponentWithCloseHandler = (closeHandler: () => void) => ReactElement;
</file>

<file path="apps/main-app/ts/features/landingScreenMultiBanner/utils/tracking.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
import { MESSAGES_ROUTES } from "../../messages/navigation/routes";
⋮----
export const trackLandingScreenMultiBannerImpression = (
  bannerId: string,
  bannerLanding: string
) =>
⋮----
export const trackLandingScreenMultiBannerTap = (
  bannerId: string,
  bannerLanding: string
) =>
export const trackLandingScreenMultiBannerClosure = (
  bannerId: string,
  bannerLanding: string
) =>
</file>

<file path="apps/main-app/ts/features/linking/actions/__test__/index.test.ts">
import { clearLinkingUrl, storeLinkingUrl } from "..";
</file>

<file path="apps/main-app/ts/features/linking/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type BackgroundLinkingActions = ActionType<
  typeof clearLinkingUrl | typeof storeLinkingUrl
>;
</file>

<file path="apps/main-app/ts/features/linking/analytics/__test__/index.test.ts">
import { trackIOOpenedFromUniversalAppLink } from "..";
</file>

<file path="apps/main-app/ts/features/linking/analytics/index.ts">
import {
  isHttpLink,
  isHttpsLink
} from "../../../components/ui/Markdown/handlers/link";
import {
  enqueueMixpanelEvent,
  isMixpanelInstanceInitialized,
  mixpanelTrack
} from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
import { getUrlBasepath } from "../../../utils/url";
⋮----
export function trackIOOpenedFromUniversalAppLink(
  link_id: string,
  mixpanelUserOptedIn?: boolean | null
)
</file>

<file path="apps/main-app/ts/features/linking/reducers/__test__/index.test.ts">
import { backgroundLinkingReducer, storedLinkingUrlSelector } from "..";
import { clearLinkingUrl, storeLinkingUrl } from "../../actions";
</file>

<file path="apps/main-app/ts/features/linking/reducers/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../store/actions/types";
import { GlobalState } from "../../../store/reducers/types";
import { clearLinkingUrl, storeLinkingUrl } from "../actions";
⋮----
export type BackgroundLinkingState = {
  linkingUrl?: string;
};
⋮----
export const backgroundLinkingReducer = (
  state: BackgroundLinkingState = INITIAL_STATE,
  action: Action
) =>
⋮----
export const storedLinkingUrlSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/linking/sagas/__test__/index.test.ts">
import { testSaga } from "redux-saga-test-plan";
⋮----
import { handleStoredLinkingUrlIfNeeded } from "..";
import { waitForMainNavigator } from "../../../../navigation/saga/navigation";
import { handleItwStoredDeepLink } from "../../../itwallet/common/saga/linking";
import { initiateAarFlow } from "../../../pn/aar/store/actions";
import { isSendAarLink } from "../../../pn/aar/utils/deepLinking";
import { clearLinkingUrl } from "../../actions";
import { storedLinkingUrlSelector } from "../../reducers";
</file>

<file path="apps/main-app/ts/features/linking/sagas/index.ts">
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { waitForMainNavigator } from "../../../navigation/saga/navigation";
import {
  isCGNLinking,
  shouldTriggerWalletUpdate
} from "../../../utils/deepLinkUtils";
import { cgnEycaStatus } from "../../bonus/cgn/store/actions/eyca/details";
import { handleItwStoredDeepLink } from "../../itwallet/common/saga/linking";
import { parseItwDeepLink } from "../../itwallet/common/utils/linking";
import { initiateAarFlow } from "../../pn/aar/store/actions";
import { isSendAarLink } from "../../pn/aar/utils/deepLinking";
import { walletUpdate } from "../../wallet/store/actions";
import { clearLinkingUrl } from "../actions";
import { storedLinkingUrlSelector } from "../reducers";
</file>

<file path="apps/main-app/ts/features/lollipop/hooks/useLollipopLoginSource.tsx">
import { PublicKey } from "@pagopa/io-react-native-crypto";
import { useCallback, useState } from "react";
import { WebViewSource } from "react-native-webview/lib/WebViewTypes";
import URLParse from "url-parse";
⋮----
import { handleRegenerateEphemeralKey } from "..";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { hashedProfileFiscalCodeSelector } from "../../../store/reducers/crossSessions";
import { isMixpanelEnabled } from "../../../store/reducers/persistedPreferences";
import { trackLollipopIdpLoginFailure } from "../../../utils/analytics";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import {
  isActiveSessionFastLoginEnabledSelector,
  isActiveSessionLoginSelector
} from "../../authentication/activeSessionLogin/store/selectors";
import { selectedIdentityProviderSelector } from "../../authentication/common/store/selectors";
import { getLoginHeaders } from "../../authentication/common/utils";
import { isFastLoginEnabledSelector } from "../../authentication/fastLogin/store/selectors";
import { cieFlowForDevServerEnabled } from "../../authentication/login/cie/utils";
import {
  ephemeralKeyTagSelector,
  ephemeralPublicKeySelector
} from "../store/reducers/lollipop";
import { LollipopCheckStatus } from "../types/LollipopCheckStatus";
import {
  DEFAULT_LOLLIPOP_HASH_ALGORITHM_SERVER,
  lollipopSamlVerify
} from "../utils/login";
⋮----
export const useLollipopLoginSource = (
  onLollipopCheckFailure: () => void,
  loginUri?: string
) =>
</file>

<file path="apps/main-app/ts/features/lollipop/hooks/useOneIdentityLoginSource.tsx">
import { PublicKey } from "@pagopa/io-react-native-crypto";
import CookieManager from "@react-native-cookies/cookies";
import { useCallback, useEffect, useRef, useState } from "react";
import { WebViewSourceUri } from "react-native-webview/lib/WebViewTypes";
import URLParse from "url-parse";
⋮----
import { handleRegenerateEphemeralKey } from "..";
import { apiUrlPrefix } from "../../../config";
import { useIODispatch, useIOSelector, useIOStore } from "../../../store/hooks";
import { hashedProfileFiscalCodeSelector } from "../../../store/reducers/crossSessions";
import { isMixpanelEnabled } from "../../../store/reducers/persistedPreferences";
import { trackLollipopIdpLoginFailure } from "../../../utils/analytics";
import { getAppVersion } from "../../../utils/appVersion";
import { isLocalEnv } from "../../../utils/environment";
import { isActiveSessionFastLoginEnabledSelector } from "../../authentication/activeSessionLogin/store/selectors";
import { trackLoginOIConfigurationError } from "../../authentication/common/analytics";
import { oneIdentityEnvSelector } from "../../authentication/common/store/selectors/loginConfig";
import {
  AUTH_LEVELS,
  AuthLevel,
  isOneIdentityErrorUrl,
  LOGIN_TYPES,
  SPID_AUTH_LEVEL_MAP
} from "../../authentication/common/utils";
import { createRetriableFetch } from "../../authentication/common/utils/fetch";
import { LoginType } from "../../authentication/common/utils/index";
import { jsonFetchToSchema } from "../../authentication/common/utils/jsonFetchToSchema";
import { LoginFailureData } from "../../authentication/common/utils/loginErrorDebugInfo";
import { isFastLoginEnabledSelector } from "../../authentication/fastLogin/store/selectors";
import {
  ephemeralKeyTagSelector,
  ephemeralPublicKeySelector
} from "../store/reducers/lollipop";
import { Reserve, ReserveSchema } from "../types";
import { toBase64EncodedThumbprint } from "../utils/crypto";
import {
  DEFAULT_LOLLIPOP_HASH_ALGORITHM_SERVER,
  followNativeRedirectsAndVerifySaml,
  lollipopSamlVerify
} from "../utils/login";
⋮----
type LoginSourceState =
  | { error: string; status: "failure" }
  | {
      status: "assertion-ref-verified" | "one-identity-authorize";
      webviewSource: WebViewSourceUri;
    }
  | { status: "following-redirects" }
  | { status: "reserving-public-key" }
  | {
      status: "verifying-assertion-ref";
      url: string;
      webviewSource: WebViewSourceUri;
    };
⋮----
const buildReserveRequestBody = (
  env: string,
  minAuthLevel: AuthLevel,
  publicKey: PublicKey,
  hashAlgorithm: string,
  isFastLogin: boolean,
  hashedFiscalCode?: string
) => (
⋮----
const buildAuthorizationUrl = (
  {
    acr_values,
    authorization_endpoint,
    client_id,
    nonce,
    redirect_uri,
    state
  }: Reserve,
  idp: string
) =>
⋮----
const buildAuthorizeHeaders = (publicKey: PublicKey) => (
⋮----
const buildWebviewSource = (
  uri: string,
  publicKey: PublicKey
): WebViewSourceUri => (
⋮----
export type UseOneIdentityLoginSource = (params: {
  clearSessionCookies?: boolean;
  flow: LoginType;
  followRedirectsNatively?: boolean;
  idpId: string;
  minAuthLevel?: AuthLevel;
  onFailure: (failureData: LoginFailureData) => void;
}) => {
  generateLoginSource: () => Promise<void>;
  loginSourceState: LoginSourceState;
  shouldBlockUrlNavigationWhileCheckingLollipop: (url: string) => boolean;
};
⋮----
export const useOneIdentityLoginSource: UseOneIdentityLoginSource = ({
  clearSessionCookies = false,
  followRedirectsNatively = false,
  flow,
... (5 lines truncated)
</file>

<file path="apps/main-app/ts/features/lollipop/httpSignature/__mocks__/mockSigners.ts">
import sha from "sha.js";
⋮----
import { constants } from "../constants";
import { Signer } from "../types/Signer";
⋮----
sign(payload: string, keyTag: string): Promise<string>
</file>

<file path="apps/main-app/ts/features/lollipop/httpSignature/types/SignatureAlgorithms.ts">
export type SignatureAlgorithm = "ecdsa-p256-sha256" | "rsa-pss-sha256";
</file>

<file path="apps/main-app/ts/features/lollipop/httpSignature/types/SignatureComponents.ts">
export interface SignatureComponents {
  authority: string;
  method: string;
  originalUrl: string;
  path: string;
  scheme: string;
  targetUri: string;
}
</file>

<file path="apps/main-app/ts/features/lollipop/httpSignature/types/SignatureConfig.ts">
import { SignatureAlgorithm } from "./SignatureAlgorithms";
import { SignatureComponents } from "./SignatureComponents";
⋮----
export interface SignatureConfig {
  nonce: string;
  signAlgorithm: SignatureAlgorithm;
  signatureComponents: SignatureComponents;
  signatureParams: Array<string>;
  signKeyId: string;
  signKeyTag: string;
}
</file>

<file path="apps/main-app/ts/features/lollipop/httpSignature/types/Signer.ts">
export interface Signer {
  sign(payload: string, keyTag: string): Promise<string>;
}
⋮----
sign(payload: string, keyTag: string): Promise<string>;
</file>

<file path="apps/main-app/ts/features/lollipop/httpSignature/constants.ts">

</file>

<file path="apps/main-app/ts/features/lollipop/httpSignature/digest.ts">
import sha from "sha.js";
⋮----
import { constants } from "./constants";
⋮----
function generateDigestHeader(body: string): string
⋮----
// Validate the input payload
⋮----
// Calculate the SHA-256 digest
⋮----
/**
 * Validates the 'Content-Digest' header value.
 *
 * @param {string} contentDigestHeader - The Content-Digest header value.
 * @param {string} body - The HTTP request body.
 * @throws {Error} If the Content-Digest header value is invalid.
 */
function validateDigestHeader(contentDigestHeader: string, body: string): void
</file>

<file path="apps/main-app/ts/features/lollipop/httpSignature/signature.ts">
import { getError } from "../../../utils/errors";
import { constants } from "./constants";
import { SignatureConfig } from "./types/SignatureConfig";
import { Signer } from "./types/Signer";
⋮----
export type SignatureBaseResult = {
  signatureBase: string;
  signatureInput: string;
};
⋮----
function contentRelatedHeaderParameterMissing(
  headerParameter: string,
  headers: Record<string, string>
)
⋮----
async function generateSignature(
  headers: Record<string, string>,
  config: SignatureConfig,
  signer: Signer,
  signatureOrdinal = 1
): Promise<string>
⋮----
function generateSignatureBase(
  headers: Record<string, string>,
  config: SignatureConfig,
  signatureOrdinal = 1
): SignatureBaseResult
⋮----
/**
 * Generates the 'Signature-Input' header value for provided config and headers.
 * https://www.ietf.org/archive/id/draft-ietf-httpbis-message-signatures-15.html#name-the-signature-input-http-fi
 *
 * @param {Record<string, string>} headers - The HTTP headers.
 * @param {SignatureConfig} config - The input config.
 * @returns {string} - The 'Signature-Input' header value.
 */
function generateSignatureInput(
  headers: Record<string, string>,
  config: SignatureConfig,
  signatureOrdinal = 1
): string
⋮----
// eslint-disable-next-line functional/no-let
⋮----
/**
 * Generates the 'Signature-Input' header value for a string payload.
 *
 * @param {string} payload
 * @param {number} signatureOrdinal
 * @returns The 'Signature-Input' header value.
 */
function generateSignatureInputValue(
  payload: string,
  config: SignatureConfig,
  signatureOrdinal = 1
): string
⋮----
// https://github.com/pagopa/io-backend/pull/973
⋮----
/**
 * Generate the 'Signature' header value for a string payload.
 *
 * @param {string} payload - The string payload to sign.
 * @param {string} keyTag - The tag name of the private key to be used to sign
 *   the payload.
 * @param {number} signatureOrdinal - The signature ordinal.
 * @returns A Promise that resolves to the signature header value.
 */
async function generateSignatureValue(
  payload: string,
  keyTag: string,
  signer: Signer,
  signatureOrdinal = 1
): Promise<string>
⋮----
/**
 * Extract the header parameter value from config
 *
 * @param {string} headerParameter - The name of the header parameter.
 * @param {SignatureConfig} config - The config.
 * @returns {string} The string value of the header parameter.
 * @throws {Error} If an unknown header parameter is found.
 */
function getHttpSignatureHeaderParameterFromConfig(
  headerParameter: string,
  config: SignatureConfig
): string
⋮----
// eslint-disable-next-line functional/no-let
⋮----
function getUnixTimestamp(): number
⋮----
function toSignatureHeaderValue(
  signature: string,
  signatureOrdinal = 1
): string
</file>

<file path="apps/main-app/ts/features/lollipop/navigation/index.ts">
import { put, select } from "typed-redux-saga/macro";
⋮----
import { lollipopSetSupportedDevice } from "../store/actions/lollipop";
import { lollipopPublicKeySelector } from "../store/reducers/lollipop";
</file>

<file path="apps/main-app/ts/features/lollipop/playgrounds/LollipopPlayground.tsx">
import { LollipopContentDigest } from "@io-app/api-types/generated/definitions/identity/LollipopContentDigest";
import { LollipopMethodEnum } from "@io-app/api-types/generated/definitions/identity/LollipopMethod";
import { LollipopOriginalURL } from "@io-app/api-types/generated/definitions/identity/LollipopOriginalURL";
import { LollipopSignature } from "@io-app/api-types/generated/definitions/identity/LollipopSignature";
import { LollipopSignatureInput } from "@io-app/api-types/generated/definitions/identity/LollipopSignatureInput";
import { ProblemJson } from "@io-app/api-types/generated/definitions/identity/ProblemJson";
import { ContentWrapper } from "@io-app/design-system";
⋮----
import { useCallback, useState } from "react";
import { ScrollView } from "react-native";
⋮----
import { identityClientManager } from "../../../api/IdentityClientManager";
import { apiUrlPrefix } from "../../../config";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { useIOSelector } from "../../../store/hooks";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import {
  lollipopKeyTagSelector,
  lollipopPublicKeySelector
} from "../store/reducers/lollipop";
import { toThumbprint } from "../utils/crypto";
import LollipopPlaygroundContent from "./LollipopPlaygroundContent";
⋮----
export type LollipopPlaygroundState = {
  doSignBody: boolean;
  isVerificationSuccess: boolean | undefined;
  verificationResult: string | undefined;
};
⋮----
const LollipopPlayground = () =>
</file>

<file path="apps/main-app/ts/features/lollipop/playgrounds/LollipopPlaygroundContent.tsx">
import {
  Alert,
  CheckboxLabel,
  HSpacer,
  IOButton,
  IOColors,
  VSpacer
} from "@io-app/design-system";
import { useState } from "react";
import { StyleSheet, TextInput, View } from "react-native";
⋮----
import { WithTestID } from "../../../types/WithTestID";
import { LollipopPlaygroundState } from "./LollipopPlayground";
⋮----
type Props = WithTestID<{
  onCheckBoxPress: (value: boolean) => void;
  onClearButtonPress: () => void;
  onSignButtonPress: (httpRequestBodyText: string) => void;
  playgroundState: LollipopPlaygroundState;
}>;
⋮----
const LollipopPlaygroundContent = (props: Props) =>
⋮----
onPress={() => props.onSignButtonPress(httpRequestBodyText)}
          variant="solid"
        />
        <HSpacer size={16} />
        <IOButton
          disabled={!isMessageBodySet}
          label={"Clear"}
onPress=
</file>

<file path="apps/main-app/ts/features/lollipop/saga/index.ts">
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
import {
  deleteKey,
  generate,
  getPublicKey,
  PublicKey
} from "@pagopa/io-react-native-crypto";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { call, delay, put, select } from "typed-redux-saga/macro";
import { v4 as uuid } from "uuid";
⋮----
import { mixpanelTrack } from "../../../mixpanel";
import { restartCleanApplication } from "../../../sagas/commons";
import { isMixpanelEnabled } from "../../../store/reducers/persistedPreferences";
import {
  buildEventProperties,
  trackLollipopKeyGenerationFailure,
  trackLollipopKeyGenerationSuccess
} from "../../../utils/analytics";
import { isTestEnv } from "../../../utils/environment";
import { sessionInvalid } from "../../authentication/common/store/actions";
import {
  lollipopKeyTagSave,
  lollipopRemovePublicKey,
  lollipopSetPublicKey
} from "../store/actions/lollipop";
import {
  lollipopKeyTagSelector,
  lollipopPublicKeySelector
} from "../store/reducers/lollipop";
import {
  KeyInfo,
  toBase64EncodedThumbprint,
  toCryptoError
} from "../utils/crypto";
import { DEFAULT_LOLLIPOP_HASH_ALGORITHM_SERVER } from "../utils/login";
⋮----
export const generateKeyInfo = (
  keyTag: string | undefined,
  maybePublicKey: PublicKey | undefined
) =>
⋮----
const keyInfoFromKeyTagAndPublicKey = (
  keyTag: string,
  publicKey: PublicKey
): KeyInfo => (
⋮----
const defaultKeyInfo = (): KeyInfo => (
</file>

<file path="apps/main-app/ts/features/lollipop/screens/UnsupportedDeviceScreen.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { Modal } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../store/hooks";
import { generateDynamicUrlSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { UNSUPPORTED_DEVICE_FAQ_URL_BODY } from "../../../urls";
import { openWebUrl } from "../../../utils/url";
import { useAvoidHardwareBackButton } from "../../../utils/useAvoidHardwareBackButton";
⋮----
const handleLearnMorePress = () =>
</file>

<file path="apps/main-app/ts/features/lollipop/store/actions/__test__/lollipop.test.ts">
import { PublicKey } from "@pagopa/io-react-native-crypto";
⋮----
import {
  lollipopKeyTagSave,
  lollipopRemoveEphemeralPublicKey,
  lollipopRemovePublicKey,
  lollipopSetEphemeralPublicKey,
  lollipopSetPublicKey,
  lollipopSetSupportedDevice
} from "../lollipop";
</file>

<file path="apps/main-app/ts/features/lollipop/store/actions/lollipop.ts">
import { PublicKey } from "@pagopa/io-react-native-crypto";
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
type KeyTagSavePayload = {
  keyTag: string;
};
⋮----
type SetPublicKeyPayload = {
  publicKey: PublicKey;
};
⋮----
export type LollipopActions = ActionType<
  | typeof lollipopKeyTagSave
  | typeof lollipopRemoveEphemeralPublicKey
  | typeof lollipopRemovePublicKey
  | typeof lollipopSetEphemeralPublicKey
  | typeof lollipopSetPublicKey
  | typeof lollipopSetSupportedDevice
>;
</file>

<file path="apps/main-app/ts/features/lollipop/store/reducers/lollipop.ts">
import { PublicKey } from "@pagopa/io-react-native-crypto";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
import { v4 as uuid } from "uuid";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import {
  activeSessionLoginFailure,
  activeSessionLoginSuccess
} from "../../../authentication/activeSessionLogin/store/actions";
import {
  loginFailure,
  loginSuccess
} from "../../../authentication/common/store/actions";
import {
  lollipopKeyTagSave,
  lollipopRemoveEphemeralPublicKey,
  lollipopRemovePublicKey,
  lollipopSetEphemeralPublicKey,
  lollipopSetPublicKey,
  lollipopSetSupportedDevice
} from "../actions/lollipop";
import { isDevEnv } from "./../../../../utils/environment";
⋮----
type EphemeralKey = {
  ephemeralKeyTag: string;
  ephemeralPublicKey: PublicKey | undefined;
};
⋮----
const ephemeralInitialState = () => (
⋮----
export type InMemoryLollipopData = {
  ephemeralKey: EphemeralKey;
  publicKey: PublicKey | undefined;
  supportedDevice: boolean;
};
export type LollipopState = InMemoryLollipopData & PersistedLollipopData;
⋮----
export type PersistedLollipopData = {
  keyTag: string | undefined;
};
⋮----
export default function lollipopReducer(
  state: LollipopState = initialLollipopState,
  action: Action
): LollipopState
⋮----
export const ephemeralKeyTagSelector = (state: GlobalState)
export const ephemeralPublicKeySelector = (state: GlobalState)
⋮----
const lollipopSelector = (state: GlobalState)
export const lollipopKeyTagSelector = (state: GlobalState)
export const lollipopPublicKeySelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/lollipop/store/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  PersistPartial,
  persistReducer
} from "redux-persist";
⋮----
import { Action } from "../../../store/actions/types";
import { isDevEnv, isTestEnv } from "../../../utils/environment";
import lollipopReducer, {
  InMemoryLollipopData,
  LollipopState,
  PersistedLollipopData
} from "./reducers/lollipop";
⋮----
type SerializedOption<T> = { _tag: "None" } | { _tag: "Some"; value: T };
⋮----
const some = <T>(value: T): SerializedOption<T> => (
⋮----
const isSome = <T>(
  option: SerializedOption<T>
): option is
⋮----
const toUndefined = <T>(option: SerializedOption<T>): T | undefined
⋮----
const fromNullable = <T>(value: null | T | undefined): SerializedOption<T>
⋮----
export type PersistedLollipopStateV0V1 = PersistPartial & {
  keyTag: SerializedOption<string>;
};
⋮----
export const migrationKeyTagFunctional = (
  state: PersistedState
): PersistedLollipopStateV0V1 =>
⋮----
export const migrationKeyTagToStringUndefined = (
  state: PersistedState
): PersistedLollipopState =>
⋮----
type PreviousPersistedLollipopState = PersistPartial & { keyTag?: string };
⋮----
export type LollipopReducerState = InMemoryLollipopData &
  PersistedLollipopState;
⋮----
type PersistedLollipopState = PersistedLollipopData & PersistPartial;
</file>

<file path="apps/main-app/ts/features/lollipop/types/index.ts">
import { z } from "zod";
⋮----
export type Reserve = z.infer<typeof ReserveSchema>;
</file>

<file path="apps/main-app/ts/features/lollipop/types/LollipopCheckStatus.ts">
export type LollipopCheckStatus =
  | {
      status: "checking" | "trusted" | "untrusted";
      url: string;
    }
  | { status: "none" };
</file>

<file path="apps/main-app/ts/features/lollipop/utils/crypto.ts">
import {
  CryptoError,
  isKeyStrongboxBacked,
  PublicKey
} from "@pagopa/io-react-native-crypto";
import { jwkThumbprintByEncoding } from "jwk-thumbprint";
⋮----
import {
  trackLollipopIsKeyStrongboxBackedFailure,
  trackLollipopIsKeyStrongboxBackedSuccess
} from "../../../utils/analytics";
import { isAndroid } from "../../../utils/platform";
import { DEFAULT_LOLLIPOP_HASH_ALGORITHM_CLIENT } from "./login";
⋮----
export type KeyInfo = {
  keyTag?: string;
  publicKey?: PublicKey;
  publicKeyThumbprint?: string;
};
⋮----
export const toCryptoError = (e: unknown)
⋮----
export const toBase64EncodedThumbprint = (key: PublicKey)
⋮----
export const toThumbprint = (key: PublicKey | undefined) =>
⋮----
export const handleIsKeyStrongboxBacked = async (keyTag?: string) =>
</file>

<file path="apps/main-app/ts/features/lollipop/utils/fetch.ts">
import { PublicKey, sign } from "@pagopa/io-react-native-crypto";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import URLParse from "url-parse";
⋮----
import {
  getSignAlgorithm,
  LollipopConfig,
  SignPromiseResult,
  toSignatureComponents
} from "..";
import { toFetchTimeout, toRetriableFetch } from "../../../utils/fetch";
import { generateDigestHeader } from "../httpSignature/digest";
import {
  generateSignatureBase,
  SignatureBaseResult,
  toSignatureHeaderValue
} from "../httpSignature/signature";
import { SignatureConfig } from "../httpSignature/types/SignatureConfig";
import { KeyInfo } from "./crypto";
⋮----
export const lollipopFetch = (
  lollipopConfig: LollipopConfig,
  keyInfo: KeyInfo,
  maxRetries?: number,
  timeout?: Millisecond
) =>
⋮----
export const lollipopRequestInit = async (
  lollipopConfig: LollipopConfig,
  keyInfo: KeyInfo,
  input: RequestInfo | URL,
  init?: RequestInit
) =>
⋮----
export const customContentSignatureBases = (
  customContent: CutsomContentToSignInput
): Array<CustomContentBaseSignature> =>
⋮----
export const customContentToSignPromises = async (
  customContent: CutsomContentToSignInput
): Promise<Array<SignPromiseResult>> =>
⋮----
export type CustomContentBaseSignature = SignatureBaseResult & {
  headerIndex: number;
  headerName: string;
  headerPrefix: string;
  headerValue: string;
};
⋮----
export type CutsomContentToSignInput = Required<Pick<KeyInfo, "keyTag">> & {
  customContentToSign: Record<string, string> | undefined;
  keyInfo: KeyInfo;
  signatureConfigForgeInput: SignatureConfigForgeInput;
};
⋮----
export type SignatureConfigForgeInput = {
  inputUrl: URLParse;
  keyTag: string;
  lollipopConfig: LollipopConfig;
  method: string;
  publicKey: PublicKey;
};
⋮----
type RequestAndKeyInfoForLPFetch = Pick<
  SignatureConfigForgeInput,
  "keyTag" | "method" | "publicKey"
> & {
  headers: HeadersInit;
  init: RequestInit;
  input: string;
};
⋮----
function addHeader(
  init: RequestInit,
  headerName: string,
  headerValue: number | string
)
⋮----
function extractHttpRequestComponents(input: string, init: RequestInit)
⋮----
function forgeSignatureConfig(
  forgeInput: SignatureConfigForgeInput,
  keyInfo: KeyInfo,
  signatureParams: Array<string>
): SignatureConfig
⋮----
/**
 * Check if the keyInfo and Request properties are properly initialized for
 * fetching
 */
function toRequestAndKeyInfoForLPFetch(
  keyInfo: KeyInfo,
  input: RequestInfo | URL,
  init?: RequestInit
): RequestAndKeyInfoForLPFetch | undefined
</file>

<file path="apps/main-app/ts/features/lollipop/utils/login.ts">
import { getRedirects } from "@io-app/login-utils";
import { PublicKey } from "@pagopa/io-react-native-crypto";
import { err, ok, Result, ResultAsync } from "neverthrow";
import pako from "pako";
import URLParse from "url-parse";
import { parseStringPromise, processors } from "xml2js";
⋮----
import { handleRegenerateEphemeralKey } from "..";
import { AppDispatch } from "../../../App";
import { trackLollipopIdpLoginFailure } from "../../../utils/analytics";
import { unknownToString } from "../../../utils/errors";
import { getLoginHeaders } from "../../authentication/common/utils";
import { toBase64EncodedThumbprint } from "./crypto";
⋮----
export const lollipopSamlVerify = (
  urlEncodedSamlRequest: string,
  publicKey: PublicKey,
  onSuccess: () => void,
  onFailure: (reason: string) => void
) =>
⋮----
export const verifyLollipopSamlRequestTask = (
  url: string,
  urlEncodedSamlRequest: string,
  publicKey: PublicKey
): Promise<string>
⋮----
type RedirectsResult = Result<string, { reason: string; url?: string }>;
⋮----
export const regenerateKeyGetRedirectsAndVerifySaml = async (
  loginUri: string,
  keyTag: string,
  isMixpanelEnabled: boolean | null,
  isFastLogin: boolean,
  dispatch: AppDispatch,
  idpId?: string,
  hashedFiscalCode?: string
): Promise<RedirectsResult> =>
⋮----
export const getLastRedirect = async (
  url: string,
  headers: Record<string, string | undefined>
) =>
⋮----
export const followNativeRedirectsAndVerifySaml = async (
  url: string,
  headers: Record<string, string | undefined>,
  publicKey: PublicKey
): Promise<RedirectsResult> =>
</file>

<file path="apps/main-app/ts/features/lollipop/index.ts">
import { deleteKey, generate, PublicKey } from "@pagopa/io-react-native-crypto";
import URLParse from "url-parse";
⋮----
import { AppDispatch } from "../../App";
import {
  trackLollipopIdpLoginFailure,
  trackLollipopKeyGenerationFailure,
  trackLollipopKeyGenerationSuccess
} from "../../utils/analytics";
import { SignatureAlgorithm } from "./httpSignature/types/SignatureAlgorithms";
import { SignatureComponents } from "./httpSignature/types/SignatureComponents";
import {
  lollipopRemoveEphemeralPublicKey,
  lollipopSetEphemeralPublicKey
} from "./store/actions/lollipop";
import { toCryptoError } from "./utils/crypto";
⋮----
export type LollipopConfig = {
  customContentToSign?: Record<string, string>;
  nonce: string;
  signBody?: boolean;
};
⋮----
export type SignPromiseResult = {
  headerIndex: number;
  headerName: string;
  headerPrefix: string;
  headerValue: string;
  signature: string;
  signatureInput: string;
};
⋮----
export function getSignAlgorithm(publicKey: PublicKey): SignatureAlgorithm
⋮----
export function toSignatureComponents(
  method: string,
  inputUrl: URLParse
): SignatureComponents
⋮----
export const handleRegenerateEphemeralKey = async (
  keyTag: string,
  isMixpanelEnabled: boolean | null,
  dispatch: AppDispatch
) =>
</file>

<file path="apps/main-app/ts/features/mailCheck/analytics/index.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties, FlowType } from "../../../utils/analytics";
⋮----
export function trackEmailAlreadyTaken(flow: FlowType)
⋮----
export function trackEmailDuplicateEditing(flow: FlowType)
⋮----
export function trackEmailDuplicateEditingConfirm(flow: FlowType)
export function trackEmailEditing(flow: FlowType)
⋮----
export function trackEmailEditingError(flow: FlowType)
⋮----
export function trackEmailNotAlreadyConfirmed(flow: FlowType)
⋮----
export function trackEmailValidation(flow: FlowType)
⋮----
export function trackEmailValidationSuccess(flow: FlowType)
⋮----
export function trackEmailValidationSuccessConfirmed(flow: FlowType)
⋮----
export function trackResendValidationEmail(flow: FlowType)
⋮----
export function trackSendValidationEmail(flow: FlowType)
</file>

<file path="apps/main-app/ts/features/mailCheck/navigation/CheckEmailNavigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import ROUTES from "../../../navigation/routes";
import { isGestureEnabled } from "../../../utils/navigation";
import EmailAlreadyTakenScreen from "../screens/EmailAlreadyTakenScreen";
import ValidateEmailScreen from "../screens/ValidateEmailScreen";
</file>

<file path="apps/main-app/ts/features/mailCheck/sagas/checkAcknowledgedEmailSaga.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { CommonActions } from "@react-navigation/native";
import { call, take } from "typed-redux-saga/macro";
⋮----
import NavigationService from "../../../navigation/NavigationService";
import ROUTES from "../../../navigation/routes";
import { ReduxSagaEffect } from "../../../types/utils";
import { emailAcknowledged } from "../../onboarding/store/actions";
import {
  hasProfileEmail,
  isProfileEmailValidated,
  isProfileFirstOnBoarding
} from "../../settings/common/store/utils/guards";
</file>

<file path="apps/main-app/ts/features/mailCheck/sagas/checkEmailNotificationPreferencesSaga.ts">
import { SagaIterator } from "redux-saga";
import {
  cancel,
  fork,
  put,
  select,
  take,
  takeEvery
} from "typed-redux-saga/macro";
import { getType } from "typesafe-actions";
⋮----
import { customEmailChannelSetEnabled } from "../../../store/actions/persistedPreferences";
import { isCustomEmailChannelEnabledSelector } from "../../../store/reducers/persistedPreferences";
import { ReduxSagaEffect } from "../../../types/utils";
import { profileLoadSuccess } from "../../settings/common/store/actions";
</file>

<file path="apps/main-app/ts/features/mailCheck/sagas/checkEmailSaga.ts">
import { CommonActions } from "@react-navigation/native";
⋮----
import { call, put, select, take } from "typed-redux-saga/macro";
⋮----
import NavigationService from "../../../navigation/NavigationService";
import ROUTES from "../../../navigation/routes";
import { emailAcknowledged } from "../../onboarding/store/actions";
import { setEmailCheckAtStartupFailure } from "../../settings/common/store/actions";
import { profileSelector } from "../../settings/common/store/selectors";
import {
  isProfileEmailAlreadyTaken,
  isProfileEmailValidated
} from "../../settings/common/store/utils/guards";
⋮----
// Wait for the user to press "Continue" button after having checked out
</file>

<file path="apps/main-app/ts/features/mailCheck/sagas/emailValidationPollingSaga.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
⋮----
import { call, put, select, take, takeLatest } from "typed-redux-saga/macro";
⋮----
import { startTimer } from "../../../utils/timer";
import {
  emailValidationPollingStart,
  profileLoadRequest,
  profileLoadSuccess
} from "../../settings/common/store/actions";
import { emailValidationSelector } from "../store/selectors/emailValidation";
</file>

<file path="apps/main-app/ts/features/mailCheck/screens/EmailAlreadyTakenScreen.tsx">
import { Route, useRoute } from "@react-navigation/native";
⋮----
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import ROUTES from "../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { getFlowType } from "../../../utils/analytics";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { acknowledgeOnEmailValidation } from "../../settings/common/store/actions";
import { isProfileFirstOnBoardingSelector } from "../../settings/common/store/selectors";
import {
  trackEmailAlreadyTaken,
  trackEmailDuplicateEditingConfirm
} from "../analytics";
⋮----
export type EmailAlreadyUsedScreenParamList = {
  email: string;
};
⋮----
const EmailAlreadyTakenScreen = () =>
</file>

<file path="apps/main-app/ts/features/mailCheck/screens/ValidateEmailScreen.tsx">
import { Route, useRoute } from "@react-navigation/native";
⋮----
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import ROUTES from "../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { getFlowType } from "../../../utils/analytics";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { acknowledgeOnEmailValidation } from "../../settings/common/store/actions";
import { isProfileFirstOnBoardingSelector } from "../../settings/common/store/selectors";
import {
  trackEmailNotAlreadyConfirmed,
  trackSendValidationEmail
} from "../analytics";
⋮----
export type EmailNotVerifiedScreenParamList = {
  email: string;
};
⋮----
const ValidateEmailScreen = () =>
</file>

<file path="apps/main-app/ts/features/mailCheck/store/actions/profileEmailValidationChange.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type ProfileEmailValidationAction = ActionType<
  typeof profileEmailValidationChanged
>;
</file>

<file path="apps/main-app/ts/features/mailCheck/store/reducers/emailValidation.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import {
  acknowledgeOnEmailValidation,
  emailValidationPollingStart,
  emailValidationPollingStop,
  setEmailCheckAtStartupFailure,
  startEmailValidation
} from "../../../settings/common/store/actions";
⋮----
export type EmailValidationState = {
  acknowledgeOnEmailValidated: O.Option<boolean>;
  emailCheckAtStartupFailed: O.Option<boolean>;
  isEmailValidationPollingRunning: boolean;
  sendEmailValidationRequest: pot.Pot<void, Error>;
};
⋮----
const reducer = (
  state: EmailValidationState = INITIAL_STATE,
  action: Action
): EmailValidationState =>
</file>

<file path="apps/main-app/ts/features/mailCheck/store/selectors/emailValidation.ts">
import { GlobalState } from "../../../../store/reducers/types";
import { EmailValidationState } from "../reducers/emailValidation";
⋮----
export const emailValidationSelector = (
  state: GlobalState
): EmailValidationState
</file>

<file path="apps/main-app/ts/features/messages/__mocks__/attachment.ts">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { ATTACHMENT_CATEGORY } from "../types/attachmentCategory";
</file>

<file path="apps/main-app/ts/features/messages/__mocks__/message.ts">
import { CreatedMessageWithContentAndAttachments } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndAttachments";
import { FiscalCode } from "@io-app/api-types/generated/definitions/communication/FiscalCode";
import { PaymentDataWithRequiredPayee } from "@io-app/api-types/generated/definitions/communication/PaymentDataWithRequiredPayee";
⋮----
import { toUIMessageDetails } from "../store/reducers/transformers";
import { UIMessageDetails } from "../types";
import { service_1 } from "./messages";
</file>

<file path="apps/main-app/ts/features/messages/__mocks__/messages.ts">
import { MessageCategory } from "@io-app/api-types/generated/definitions/communication/MessageCategory";
import { OrganizationFiscalCode } from "@io-app/api-types/generated/definitions/communication/OrganizationFiscalCode";
import { TimeToLiveSeconds } from "@io-app/api-types/generated/definitions/communication/TimeToLiveSeconds";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import {
  NextPageMessagesSuccessPayload,
  PreviousPageMessagesSuccessPayload,
  ReloadMessagesPayload
} from "../store/actions";
</file>

<file path="apps/main-app/ts/features/messages/analytics/__test__/index.test.ts">
import { TagEnum as BaseTagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryBase";
import { TagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPN";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import {
  trackCTAFrontMatterDecodingError,
  trackDisclaimerLoadError,
  trackMessageNotFoundScreen,
  trackMessageNotificationParsingFailure,
  trackMessageNotificationTap,
  trackMessagePaymentFailure,
  trackOpenMessage
} from "..";
</file>

<file path="apps/main-app/ts/features/messages/analytics/index.ts">
import { MessageCategory } from "@io-app/api-types/generated/definitions/communication/MessageCategory";
import { TagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPN";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { pageSize } from "../../../config";
import {
  enqueueMixpanelEvent,
  isMixpanelInstanceInitialized,
  mixpanelTrack
} from "../../../mixpanel";
import { Action } from "../../../store/actions/types";
import { GlobalState } from "../../../store/reducers/types";
import {
  booleanToYesNo,
  buildEventProperties,
  dateToUTCISOString
} from "../../../utils/analytics";
import { readablePrivacyReport } from "../../../utils/reporters";
import {
  loadNextPageMessages,
  loadPreviousPageMessages,
  reloadAllMessages
} from "../store/actions";
import {
  messageCountForCategorySelector,
  shownMessageCategorySelector
} from "../store/reducers/allPaginated";
import { MessageGetStatusFailurePhaseType } from "../store/reducers/messageGetStatus";
import { MessageListCategory } from "../types/messageListCategory";
import { SendFailureReason } from "../utils";
⋮----
export const trackMessagesActionsPostDispatch = (
  action: Action,
  state: GlobalState
) =>
⋮----
export const trackOpenMessage = (
  serviceId: ServiceId,
  serviceName: string,
  organizationName: string,
  organizationFiscalCode: string,
  firstTimeOpening: boolean,
  containsPayment: boolean | undefined,
  hasRemoteContent: boolean,
  containsAttachments: boolean,
  fromPushNotification: boolean,
  hasFIMSCTA: boolean,
  createdAt: Date,
  fciMessageType: "not_set" | "request" | "result",
  fciResult: "failure" | "not_set" | "success"
) =>
⋮----
export const trackMessageNotFoundScreen = () =>
⋮----
export const trackCTAFrontMatterDecodingError = (
  reason: string,
  serviceId: ServiceId
) =>
⋮----
export const trackMessageNotificationParsingFailure = (
  id: string,
  reason: string | t.Errors,
  userOptedIn: boolean
) =>
⋮----
export const trackMessageNotificationTap = (
  messageId: string,
  userOptedIn: boolean
) =>
⋮----
export const trackThirdPartyMessageAttachmentCount = (
  attachmentCount: number
) =>
⋮----
export const trackThirdPartyMessageAttachmentUnavailable = (
  messageId: string,
  serviceId: ServiceId | undefined
) =>
⋮----
export const trackThirdPartyMessageAttachmentDownloadFailed = (
  messageId: string,
  serviceId: ServiceId | undefined
) =>
⋮----
export const trackThirdPartyMessageAttachmentBadFormat = (
  messageId: string,
  serviceId: ServiceId | undefined
) =>
⋮----
export const trackThirdPartyMessageAttachmentCorruptedFile = (
  messageId: string,
  serviceId?: ServiceId
) =>
⋮----
export const trackThirdPartyMessageAttachmentPreviewSuccess = () =>
⋮----
export const trackThirdPartyMessageAttachmentShowPreview = () =>
⋮----
... (146 lines truncated)
</file>

<file path="apps/main-app/ts/features/messages/components/Home/__mocks__/PagerViewContainer.tsx">
import { Ref } from "react";
import { View } from "react-native";
import PagerView from "react-native-pager-view";
⋮----
export const PagerViewContainer = ({ ref }: { ref?: Ref<PagerView> }) => (
  <PagerView ref={ref} testID="mock_pager_view_container">
    <View>Mock Inbox</View>
    <View>Mock Archive</View>
  </PagerView>
);
</file>

<file path="apps/main-app/ts/features/messages/components/Home/__mocks__/Preconditions.tsx">
import { View } from "react-native";
⋮----
export const Preconditions = () => (
  <View testID="mock_preconditions">This is a mock for Preconditions</View>
);
</file>

<file path="apps/main-app/ts/features/messages/components/Home/__mocks__/PreconditionsContent.tsx">
import { View } from "react-native";
⋮----
export const PreconditionsContent = () => (
  <View>Mock Preconditions Content</View>
);
</file>

<file path="apps/main-app/ts/features/messages/components/Home/__mocks__/SecuritySuggestions.tsx">
import { View } from "react-native";
⋮----
export const SecuritySuggestions = () => (
  <View testID="mock_security_suggestions">
    This is a mock for Security Suggestions
  </View>
);
</file>

<file path="apps/main-app/ts/features/messages/components/Home/__mocks__/TabNavigationContainer.tsx">
import { Ref } from "react";
import { View } from "react-native";
import PagerView from "react-native-pager-view";
⋮----
export const TabNavigationContainer = ({
  ref: _ref
}: {
  ref?: Ref<PagerView>;
}) => (
  <View testID="mock_tab_navigation_container">
    This is a mock for TabNavigationContainer
  </View>
);
</file>

<file path="apps/main-app/ts/features/messages/components/Home/__mocks__/Toasts.tsx">
import { View } from "react-native";
⋮----
export const Toasts = () => (
  <View testID="mock_toasts">This is a mock for Toasts</View>
);
</file>

<file path="apps/main-app/ts/features/messages/components/Home/DS/__mocks__/ListItemMessage.tsx">
import { Pressable, Text } from "react-native";
⋮----
import { ListItemMessageProps } from "../ListItemMessage";
⋮----
export const ListItemMessage = (props: ListItemMessageProps) => (
  <Pressable
    accessibilityRole={props.accessibilityRole}
    onLongPress={props.onLongPress}
    onPress={props.onPress}
    testID={props.testID}
  >
    <>
      <Text>{props.accessibilityLabel}</Text>
      <Text>{props.accessibilityRole}</Text>
      <Text>{`${props.avatarDouble}`}</Text>
      <Text>{props.formattedDate}</Text>
      <Text>{props.isRead}</Text>
      <Text>{props.messageTitle}</Text>
      <Text>{props.organizationName}</Text>
      <Text>{`${props.selected}`}</Text>
      <Text>{`${JSON.stringify(props.serviceLogos)}`}</Text>
      <Text>{props.serviceName}</Text>
      <Text>{`${JSON.stringify(props.tag)}`}</Text>
      <Text>{`${JSON.stringify(props.testID)}`}</Text>
    </>
  </Pressable>
);
</file>

<file path="apps/main-app/ts/features/messages/components/Home/DS/AvatarDouble.tsx">
import {
  hexToRgba,
  Icon,
  IOColors,
  IODimensions,
  useIOTheme
} from "@io-app/design-system";
import { useCallback, useRef, useState } from "react";
import {
  Image,
  ImageSourcePropType,
  ImageURISource,
  StyleSheet,
  View
} from "react-native";
⋮----
import { addCacheTimestampToUri } from "../../../../../utils/image";
⋮----
type AvatarDoubleProps = {
  backgroundLogoUri?: ImageSourcePropType;
};
⋮----
const getImageState = (backgroundLogoUri?: ImageSourcePropType) =>
⋮----
const onError = () =>
</file>

<file path="apps/main-app/ts/features/messages/components/Home/DS/ListItemMessage.tsx">
import {
  Avatar,
  BodySmall,
  H6,
  hexToRgba,
  HStack,
  IOColors,
  IODimensions,
  IOListItemStyles,
  MessageCheckbox,
  Tag,
  triggerHaptic,
  useIOTheme,
  useIOThemeContext,
  useListItemAnimation,
  WithTestID
} from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps, useCallback } from "react";
import {
  ColorValue,
  GestureResponderEvent,
  ImageSourcePropType,
  Pressable,
  StyleSheet,
  View
} from "react-native";
import Animated from "react-native-reanimated";
import Svg, { Circle } from "react-native-svg";
⋮----
import { AvatarDouble } from "./AvatarDouble";
⋮----
export type ListItemMessageProps = Pick<
  ComponentProps<typeof Pressable>,
  "accessibilityLabel" | "accessibilityRole" | "onLongPress" | "onPress"
> &
  WithTestID<{
    avatarDouble?: boolean;
    formattedDate: string;
    isRead: boolean;
    messageTitle: string;
    organizationName: string;
    selected?: boolean;
    serviceLogos?: ImageSourcePropType;
    serviceName: string;
    tag?: ListItemMessageTag;
  }>;
⋮----
type ListItemMessageTag = {
  text: string;
  variant: Extract<Tag["variant"], "legalMessage" | "success">;
};
⋮----
type UnreadBadgeProps = {
  color: ColorValue;
  width?: number;
};
⋮----
const UnreadBadge = ({ color, width = 14 }: UnreadBadgeProps) => (
  <Svg height={width} width={width}>
    <Circle cx={"50%"} cy={"50%"} fill={color} r={width / 2} />
  </Svg>
);
</file>

<file path="apps/main-app/ts/features/messages/components/Home/DS/ListItemMessageSkeleton.tsx">
import { IODimensions, IOSkeleton, WithTestID } from "@io-app/design-system";
import { StyleSheet, View } from "react-native";
⋮----
import { ListItemMessageStandardHeight } from "./ListItemMessage";
⋮----
type ListItemMessageSkeletonProps = WithTestID<{
  accessibilityLabel: string;
}>;
</file>

<file path="apps/main-app/ts/features/messages/components/Home/ArchiveRestoreBar.tsx">
import { IOButton } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
import { StyleSheet, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { useBottomTabNavigatorStyle } from "../../../../hooks/useBottomTabNavigatorStyle";
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton";
import { useIOTabNavigation } from "../../../../navigation/params/AppParamsList";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import {
  resetMessageArchivingAction,
  startProcessingMessageArchivingAction
} from "../../store/actions/archiving";
import { shownMessageCategorySelector } from "../../store/reducers/allPaginated";
import {
  areThereEntriesForShownMessageListCategorySelector,
  isArchivingDisabledSelector,
  isArchivingInProcessingModeSelector
} from "../../store/reducers/archiving";
import { MessageListCategory } from "../../types/messageListCategory";
⋮----
type ArchiveRestoreCTAsProps = {
  category: MessageListCategory;
};
⋮----
export const ArchiveRestoreBar = () =>
⋮----
label=
</file>

<file path="apps/main-app/ts/features/messages/components/Home/EmptyList.tsx">
import { IOPictograms } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { ButtonBlockProps } from "../../../../components/ui/utils/buttons";
import { pageSize } from "../../../../config";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import { reloadAllMessages } from "../../store/actions";
import { emptyListReasonSelector } from "../../store/reducers/allPaginated";
import { isArchivingInProcessingModeSelector } from "../../store/reducers/archiving";
import { MessageListCategory } from "../../types/messageListCategory";
⋮----
export type EmptyListProps = {
  category: MessageListCategory;
};
⋮----
type ScreenDataType = {
  action?: Pick<
    ButtonBlockProps,
    "accessibilityLabel" | "label" | "onPress" | "testID"
  >;
  pictogram: IOPictograms;
  subtitle?: string;
  title: string;
};
⋮----
export const EmptyList = (
</file>

<file path="apps/main-app/ts/features/messages/components/Home/Footer.tsx">
import I18n from "i18next";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { shouldShowFooterListComponentSelector } from "../../store/reducers/allPaginated";
import { MessageListCategory } from "../../types/messageListCategory";
import { ListItemMessageSkeleton } from "./DS/ListItemMessageSkeleton";
⋮----
type FooterProps = {
  category: MessageListCategory;
};
⋮----
export const Footer = (
</file>

<file path="apps/main-app/ts/features/messages/components/Home/homeUtils.ts">
import { TagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPN";
⋮----
import I18n from "i18next";
import { StyleSheet } from "react-native";
import { ActionType } from "typesafe-actions";
⋮----
import { maximumItemsFromAPI, pageSize } from "../../../../config";
import NavigationService from "../../../../navigation/NavigationService";
import { GlobalState } from "../../../../store/reducers/types";
import {
  isLoadingOrUpdating,
  isSomeOrSomeError,
  isStrictNone,
  isStrictSomeError
} from "../../../../utils/pot";
import { trackMessageListEndReached, trackMessagesPage } from "../../analytics";
import { MESSAGES_ROUTES } from "../../navigation/routes";
import {
  loadNextPageMessages,
  loadPreviousPageMessages,
  reloadAllMessages
} from "../../store/actions";
import {
  isPaymentMessageWithPaidNoticeSelector,
  messagePagePotFromCategorySelector,
  shownMessageCategorySelector
} from "../../store/reducers/allPaginated";
import { isArchivingInProcessingModeSelector } from "../../store/reducers/archiving";
import { areMessageSagasRegisteredSelector } from "../../store/reducers/messageSectionStatus";
import { UIMessage } from "../../types";
import { MessageListCategory } from "../../types/messageListCategory";
import { convertReceivedDateToAccessible } from "../../utils/convertDateToWordDistance";
import {
  ListItemMessageEnhancedHeight,
  ListItemMessageStandardHeight
} from "./DS/ListItemMessage";
import { SkeletonHeight } from "./DS/ListItemMessageSkeleton";
⋮----
export type LayoutInfo = {
  index: number;
  length: number;
  offset: number;
};
⋮----
export const nextPageLoadingWaitMillisecondsGenerator = ()
export const refreshIntervalMillisecondsGenerator = ()
⋮----
export const getInitialReloadAllMessagesActionIfNeeded = (
  state: GlobalState
): ActionType<typeof reloadAllMessages.request> | undefined =>
⋮----
export const getMessagesViewPagerInitialPageIndex = (state: GlobalState) =>
⋮----
export const messageListCategoryToViewPageIndex = (
  category: MessageListCategory
)
export const messageViewPageIndexToListCategory = (
  pageIndex: number
): MessageListCategory
⋮----
export const accessibilityLabelForMessageItem = (
  message: UIMessage,
  source: "SEARCH" | MessageListCategory,
  isSelected?: boolean
): string
⋮----
export const archiveUnarchiveAccessibilityInstructions = (
  source: "SEARCH" | MessageListCategory,
  isSelected?: boolean
): string =>
⋮----
// When selected, a message can only be deselected,
// it does not matter if it is archived or not
⋮----
export const getLoadNextPageMessagesActionIfAllowed = (
  state: GlobalState,
  category: MessageListCategory,
  comparisonTimeInCaseOfError: Date
): ActionType<typeof loadNextPageMessages.request> | undefined =>
⋮----
export const getReloadAllMessagesActionForRefreshIfAllowed = (
  state: GlobalState,
  category: MessageListCategory
): ActionType<typeof reloadAllMessages.request> | undefined =>
⋮----
const shouldBlockPreviousPageMessagesLoading = (state: GlobalState)
⋮----
export const getLoadPreviousPageMessagesActionIfAllowed = (
  state: GlobalState
) =>
⋮----
const initialReloadAllMessagesFromCategory = (
  category: MessageListCategory,
  fromUserAction: boolean
)
⋮----
const isDoingAnAsyncOperationOnMessages = (state: GlobalState) =>
⋮----
export const generateMessageListLayoutInfo = (
  loadingList: ReadonlyArray<number>,
... (12 lines truncated)
</file>

<file path="apps/main-app/ts/features/messages/components/Home/MessageList.tsx">
import { Divider } from "@io-app/design-system";
import I18n from "i18next";
import { Ref, useCallback, useMemo } from "react";
import { FlatList, RefreshControl, StyleSheet } from "react-native";
import {
  useSafeAreaFrame,
  useSafeAreaInsets
} from "react-native-safe-area-context";
⋮----
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import { LandingScreenBannerPicker } from "../../../landingScreenMultiBanner/components/LandingScreenBannerPicker";
import { trackPullToRefresh } from "../../analytics";
import {
  messageListForCategorySelector,
  shouldShowRefreshControllOnListSelector
} from "../../store/reducers/allPaginated";
import { UIMessage } from "../../types";
import { MessageListCategory } from "../../types/messageListCategory";
import {
  ListItemMessageSkeleton,
  SkeletonHeight
} from "./DS/ListItemMessageSkeleton";
import { EmptyList } from "./EmptyList";
import { Footer } from "./Footer";
import {
  generateMessageListLayoutInfo,
  getLoadNextPageMessagesActionIfAllowed,
  getReloadAllMessagesActionForRefreshIfAllowed,
  LayoutInfo,
  trackMessageListEndReachedIfAllowed
} from "./homeUtils";
import { WrappedListItemMessage } from "./WrappedListItemMessage";
⋮----
type MessageListProps = {
  category: MessageListCategory;
  ref?: Ref<FlatList>;
};
</file>

<file path="apps/main-app/ts/features/messages/components/Home/PagerViewContainer.tsx">
import { useFocusEffect } from "@react-navigation/native";
import { Ref, useCallback, useRef } from "react";
import { FlatList, NativeSyntheticEvent } from "react-native";
import PagerView from "react-native-pager-view";
import { OnPageSelectedEventData } from "react-native-pager-view/lib/typescript/PagerViewNativeComponent";
⋮----
import SectionStatusComponent from "../../../../components/SectionStatus";
import { pageSize } from "../../../../config";
import { useTabItemPressWhenScreenActive } from "../../../../hooks/useTabItemPressWhenScreenActive";
import { useIODispatch, useIOStore } from "../../../../store/hooks";
import { GlobalState } from "../../../../store/reducers/types";
import { trackAutoRefresh, trackMessagesPage } from "../../analytics";
import { setShownMessageCategoryAction } from "../../store/actions";
import {
  messageCountForCategorySelector,
  shownMessageCategorySelector
} from "../../store/reducers/allPaginated";
import { ArchiveRestoreBar } from "./ArchiveRestoreBar";
import {
  getInitialReloadAllMessagesActionIfNeeded,
  getLoadPreviousPageMessagesActionIfAllowed,
  getMessagesViewPagerInitialPageIndex,
  messageViewPageIndexToListCategory,
  trackMessagePageOnFocusEventIfAllowed
} from "./homeUtils";
import { MessageList } from "./MessageList";
⋮----
export const PagerViewContainer = (
</file>

<file path="apps/main-app/ts/features/messages/components/Home/Preconditions.tsx">
import { useLinkTo } from "@react-navigation/native";
import { useCallback, useEffect, useState } from "react";
import { Keyboard } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { trackDisclaimerOpened } from "../../analytics";
import { MESSAGES_ROUTES } from "../../navigation/routes";
import {
  idlePreconditionStatusAction,
  retrievingDataPreconditionStatusAction,
  toIdlePayload,
  toRetrievingDataPayload,
  toUpdateRequiredPayload,
  updateRequiredPreconditionStatusAction
} from "../../store/actions/preconditions";
import {
  preconditionsCategoryTagSelector,
  preconditionsRequireAppUpdateSelector,
  shouldPresentPreconditionsBottomSheetSelector
} from "../../store/reducers/messagePrecondition";
import { PreconditionsContent } from "./PreconditionsContent";
import { PreconditionsFooter } from "./PreconditionsFooter";
import { PreconditionsTitle } from "./PreconditionsTitle";
⋮----
onDismiss=
</file>

<file path="apps/main-app/ts/features/messages/components/Home/PreconditionsContent.tsx">
import { IOSkeleton, VStack } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { View } from "react-native";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import { pnMinAppVersionSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { generateMessagesAndServicesRules } from "../../../common/components/IOMarkdown/customRules";
import { trackDisclaimerLoadError } from "../../analytics";
import {
  errorPreconditionStatusAction,
  toErrorPayload
} from "../../store/actions/preconditions";
import {
  preconditionsCategoryTagSelector,
  preconditionsContentMarkdownSelector,
  preconditionsContentSelector
} from "../../store/reducers/messagePrecondition";
import { PreconditionsFeedback } from "./PreconditionsFeedback";
⋮----
type PreconditionsContentProps = {
  footerHeight: number;
  linkTo: (path: string) => void;
};
⋮----
export const PreconditionsContent = ({
  footerHeight,
  linkTo
}: PreconditionsContentProps) =>
⋮----
const PreconditionsContentMarkdown = ({
  footerHeight,
  linkTo
}: PreconditionsContentProps) =>
⋮----
rules=
⋮----
const PreconditionsContentError = () => (
  <PreconditionsFeedback
    pictogram="umbrella"
    title={I18n.t("global.genericError")}
  />
);
⋮----
const PreconditionsContentSkeleton = () => (
  <View accessible={false}>
    {Array.from({ length: 3 }).map((_, i) => (
      <VStack key={`pre_content_ske_${i}`} space={8}>
        <IOSkeleton height={20} radius={4} shape="rectangle" width={"100%"} />
        <IOSkeleton height={20} radius={4} shape="rectangle" width={"100%"} />
        <IOSkeleton height={20} radius={4} shape="rectangle" width={"90%"} />
      </VStack>
    ))}
  </View>
);
⋮----
const PreconditionsContentUpdate = () =>
</file>

<file path="apps/main-app/ts/features/messages/components/Home/PreconditionsFeedback.tsx">
import {
  BodySmall,
  H3,
  IODimensions,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { StyleSheet, View } from "react-native";
⋮----
import {
  AnimatedPictogram,
  IOAnimatedPictograms
} from "../../../../components/ui/AnimatedPictogram";
⋮----
type Props = {
  pictogram: IOAnimatedPictograms;
  subtitle?: string;
  title: string;
};
⋮----
export const PreconditionsFeedback = ({
  pictogram,
  title,
  subtitle
}: Props) =>
</file>

<file path="apps/main-app/ts/features/messages/components/Home/PreconditionsFooter.tsx">
import { FooterActions } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { View } from "react-native";
⋮----
import { useIOSelector, useIOStore } from "../../../../store/hooks";
import { openAppStoreUrl } from "../../../../utils/url";
import { trackNotificationRejected, trackUxConversion } from "../../analytics";
import {
  preconditionsCategoryTagSelector,
  preconditionsFooterSelector,
  preconditionsMessageIdSelector
} from "../../store/reducers/messagePrecondition";
⋮----
export type PreconditionsFooterProps = {
  onDismiss: () => void;
  onFooterHeightAvailable: (height: number) => void;
  onNavigation: (messageId: string) => void;
};
⋮----
export const PreconditionsFooter = ({
  onNavigation,
  onDismiss,
  onFooterHeightAvailable
}: PreconditionsFooterProps) =>
</file>

<file path="apps/main-app/ts/features/messages/components/Home/PreconditionsTitle.tsx">
import { H3, IOSkeleton } from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import {
  preconditionsTitleContentSelector,
  preconditionsTitleSelector
} from "../../store/reducers/messagePrecondition";
⋮----
export const PreconditionsTitle = () =>
⋮----
const PreconditionsSkeleton = () => (
  <View accessible={false} style={{ flex: 1 }}>
    <IOSkeleton height={20} radius={4} shape="rectangle" width={182} />
  </View>
);
⋮----
const PreconditionsHeader = () =>
</file>

<file path="apps/main-app/ts/features/messages/components/Home/SecuritySuggestions.tsx">
import { useSecuritySuggestionsBottomSheet } from "../../../../hooks/useSecuritySuggestionBottomSheet";
⋮----
export const SecuritySuggestions = () =>
</file>

<file path="apps/main-app/ts/features/messages/components/Home/TabNavigationContainer.tsx">
import { TabItem, TabNavigation } from "@io-app/design-system";
import I18n from "i18next";
import { RefObject, useCallback } from "react";
import { StyleSheet, View } from "react-native";
import PagerView from "react-native-pager-view";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { shownMessageCategorySelector } from "../../store/reducers/allPaginated";
import { messageListCategoryToViewPageIndex } from "./homeUtils";
⋮----
export const TabNavigationContainer = ({
  pagerViewRef
}: {
  pagerViewRef: RefObject<null | PagerView>;
}) =>
</file>

<file path="apps/main-app/ts/features/messages/components/Home/Toasts.tsx">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
import { AccessibilityInfo } from "react-native";
⋮----
import { useIOSelector, useIOStore } from "../../../../store/hooks";
import { isScreenReaderEnabledSelector } from "../../../../store/reducers/preferences";
import {
  archiveMessagesErrorReasonSelector,
  inboxMessagesErrorReasonSelector
} from "../../store/reducers/allPaginated";
import {
  processingResultReasonSelector,
  processingResultTypeSelector
} from "../../store/reducers/archiving";
⋮----
export const Toasts = () =>
</file>

<file path="apps/main-app/ts/features/messages/components/Home/WrappedListItemMessage.tsx">
import { TagEnum as PaymentTagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPayment";
import { TagEnum as SENDTagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPN";
import I18n from "i18next";
import { useCallback, useMemo, useRef } from "react";
import { AccessibilityInfo } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import { isScreenReaderEnabledSelector } from "../../../../store/reducers/preferences";
import { isAndroid } from "../../../../utils/platform";
import { logoForService } from "../../../services/home/utils";
import { trackMessageSearchSelection } from "../../analytics";
import { MESSAGES_ROUTES } from "../../navigation/routes";
import { toggleScheduledMessageArchivingAction } from "../../store/actions/archiving";
import {
  scheduledPreconditionStatusAction,
  toScheduledPayload
} from "../../store/actions/preconditions";
import { isPaymentMessageWithPaidNoticeSelector } from "../../store/reducers/allPaginated";
import {
  isArchivingDisabledSelector,
  isArchivingInProcessingModeSelector,
  isArchivingInSchedulingModeSelector,
  isMessageScheduledForArchivingSelector
} from "../../store/reducers/archiving";
import { UIMessage } from "../../types";
import { MessageListCategory } from "../../types/messageListCategory";
import { convertDateToWordDistance } from "../../utils/convertDateToWordDistance";
import { ListItemMessage, ListItemMessageProps } from "./DS/ListItemMessage";
import {
  accessibilityLabelForMessageItem,
  minDelayBetweenNavigationMilliseconds
} from "./homeUtils";
⋮----
type WrappedListItemMessage = {
  index: number;
  message: UIMessage;
  source: "SEARCH" | MessageListCategory;
};
⋮----
export const WrappedListItemMessage = ({
  index,
  message,
  source
}: WrappedListItemMessage) =>
⋮----
export const isInboxOrArchiveSource = (
  source: WrappedListItemMessage["source"]
)
export const isInboxSource = (source: WrappedListItemMessage["source"])
export const isSearchSource = (source: WrappedListItemMessage["source"])
</file>

<file path="apps/main-app/ts/features/messages/components/MessageAttachment/__test__/MessageAttachment.test.tsx">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { IOToast } from "@io-app/design-system";
import { fireEvent, waitFor } from "@testing-library/react-native";
⋮----
import I18n from "i18next";
import { ComponentProps } from "react";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import {
  trackPNAttachmentOpeningSuccess,
  trackPNAttachmentSave,
  trackPNAttachmentSaveShare,
  trackPNAttachmentShare
} from "../../../../pn/analytics";
import {
  trackThirdPartyMessageAttachmentCorruptedFile,
  trackThirdPartyMessageAttachmentPreviewSuccess,
  trackThirdPartyMessageAttachmentUserAction
} from "../../../analytics";
import { MESSAGES_ROUTES } from "../../../navigation/routes";
import { downloadAttachment } from "../../../store/actions";
import { MessageAttachment, testable } from "../MessageAttachment";
⋮----
const createTestStore = (downloadedAttachment?: ThirdPartyAttachment) =>
⋮----
type RenderOptions = {
  downloadedAttachment?: ThirdPartyAttachment;
  isPN?: boolean;
};
⋮----
const renderComponent = ({
  isPN = false,
  downloadedAttachment
}: RenderOptions =
⋮----
const renderFooter = (
  props: Partial<ComponentProps<typeof MessageAttachmentFooter>> = {}
)
</file>

<file path="apps/main-app/ts/features/messages/components/MessageAttachment/__test__/MessageAttachmentsAlert.test.tsx">
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { MESSAGES_ROUTES } from "../../../navigation/routes";
import { MessageAttachmentsAlert } from "../MessageAttachmentsAlert";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/messages/components/MessageAttachment/__test__/PdfViewer.test.tsx">
import { render } from "@testing-library/react-native";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { GlobalState } from "../../../../../store/reducers/types";
import { PdfViewer } from "../PdfViewer";
</file>

<file path="apps/main-app/ts/features/messages/components/MessageAttachment/MessageAttachment.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  FooterActions,
  FooterActionsInline,
  IOToast
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useState } from "react";
import ReactNativeBlobUtil from "react-native-blob-util";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import { isTestEnv } from "../../../../utils/environment";
import { isIos } from "../../../../utils/platform";
import { share } from "../../../../utils/share";
import {
  trackPNAttachmentOpeningSuccess,
  trackPNAttachmentSave,
  trackPNAttachmentSaveShare,
  trackPNAttachmentShare
} from "../../../pn/analytics";
import {
  trackThirdPartyMessageAttachmentCorruptedFile,
  trackThirdPartyMessageAttachmentPreviewSuccess,
  trackThirdPartyMessageAttachmentUserAction
} from "../../analytics";
import { downloadedMessageAttachmentSelector } from "../../store/reducers/downloads";
import {
  attachmentContentType,
  attachmentDisplayName,
  toFileUri
} from "../../utils/attachments";
import { PdfViewer } from "./PdfViewer";
⋮----
type MessageAttachmentFooterProps = {
  attachmentCategory?: string;
  downloadPath: string;
  isPN: boolean;
  mimeType: string;
  name: string;
};
⋮----
if (isPN)
</file>

<file path="apps/main-app/ts/features/messages/components/MessageAttachment/MessageAttachmentsAlert.tsx">
import { Alert, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
</file>

<file path="apps/main-app/ts/features/messages/components/MessageAttachment/PdfViewer.tsx">
import { IOColors } from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps, useState } from "react";
import { StyleSheet, View } from "react-native";
import Pdf from "react-native-pdf";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
⋮----
type OwnProps = {
  downloadPath: string;
  onLoadComplete?: () => void;
};
⋮----
type Props = Omit<ComponentProps<typeof Pdf>, "onLoadComplete" | "source"> &
  OwnProps;
⋮----
const commonOnLoadingCompleted = () =>
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/__mocks__/ContactsListItem.tsx">
import { View } from "react-native";
⋮----
import { ContactsListItemProps } from "../ContactsListItem";
⋮----
export const ContactsListItem = ({ email, phone }: ContactsListItemProps) => (
  <>
    <View>Mock ContactsListItem</View>
    {email && <View>{email}</View>}
    {phone && <View>{phone}</View>}
  </>
);
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/__mocks__/MessageDetailsAttachmentItem.tsx">
import { Pressable, View } from "react-native";
⋮----
import { MessageDetailsAttachmentItemProps } from "../MessageDetailsAttachmentItem";
⋮----
export const MessageDetailsAttachmentItem = ({
  attachment,
  bottomSpacer,
  disabled,
  sendOpeningSource,
  sendUserType,
  messageId,
  onPreNavigate,
  serviceId
}: MessageDetailsAttachmentItemProps) => (
  <>
    <View>Mock MessageDetailsAttachmentItem</View>
    <View>
      <View>{`Attachment category:     ${attachment.category}`}</View>
      <View>{`Attachment content-type: ${attachment.content_type}`}</View>
      <View>{`Attachment id:           ${attachment.id}`}</View>
      <View>{`Attachment name:         ${attachment.name}`}</View>
      <View>{`Attachment url:          ${attachment.url}`}</View>
    </View>
    <View>{`Has${bottomSpacer ? "" : " no"} bottom spacer`}</View>
    <View>{`Is ${disabled ? "" : "not "}disabled`}</View>
    <View>{`Send Opening Source ${sendOpeningSource}`}</View>
    <View>{`Send User Type ${sendUserType}`}</View>
    <View>{`Message Id: ${messageId}`}</View>
    <View>{`Service Id: ${serviceId}`}</View>
    <Pressable accessibilityLabel="" onPress={onPreNavigate}>
      {`Has${onPreNavigate != null ? "" : " no"} onPreNavigate callback`}
    </Pressable>
  </>
);
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/__mocks__/MessageDetailsAttachments.tsx">
import { View } from "react-native";
⋮----
import { MessageDetailsAttachmentsProps } from "../MessageDetailsAttachments";
⋮----
export const MessageDetailsAttachments = ({
  banner,
  disabled,
  messageId,
  serviceId,
  sendOpeningSource,
  sendUserType
}: MessageDetailsAttachmentsProps) => (
  <>
    <View>Mock MessageDetailsAttachments</View>
    <View>{`${banner ? "Has" : "Does not have"} Banner`}</View>
    <View>{`Is ${disabled ? "" : "not "}disabled`}</View>
    <View>{`Send Opening Source ${sendOpeningSource}`}</View>
    <View>{`Send User Type ${sendUserType}`}</View>
    <View>{`Message Id: ${messageId}`}</View>
    <View>{`Service Id: ${serviceId}`}</View>
  </>
);
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/__mocks__/ShowMoreListItem.tsx">
import { View } from "react-native";
⋮----
import { ShowMoreListItemProps } from "../ShowMoreListItem";
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/ContactsListItem.tsx">
import { Body, ListItemAction, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { ServiceContactListItem } from "../../../services/common/components/ServiceContactListItem";
⋮----
export type ContactsListItemProps = {
  email?: string;
  pec?: string;
  phone?: string;
  support_url?: string;
  web_url?: string;
};
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/detailsUtils.ts">
import { PaymentInfoResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoResponse";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { isReady, RemoteValue } from "../../../../common/model/RemoteValue";
import { GlobalState } from "../../../../store/reducers/types";
import { CTA } from "../../../../types/LocalizedCTAs";
import { serviceDetailsByIdSelector } from "../../../services/details/store/selectors";
import { trackCTAPressed, trackPaymentStart } from "../../analytics";
import {
  isTimeoutOrGenericOrOngoingPaymentError,
  MessagePaymentError
} from "../../types/paymentErrors";
⋮----
export const computeAndTrackCTAPressAnalytics = (
  isFirstCTA: boolean,
  cta: CTA,
  serviceId: ServiceId,
  state: GlobalState
) =>
⋮----
export const computeAndTrackPaymentStart = (
  serviceId: ServiceId,
  state: GlobalState
) =>
⋮----
export const shouldUpdatePaymentUponReturning = (
  payment: RemoteValue<PaymentInfoResponse, MessagePaymentError>
)
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/MessageDetailsAttachmentItem.tsx">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ModuleAttachment, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
import { useAttachmentDownload } from "../../hooks/useAttachmentDownload";
⋮----
export type MessageDetailsAttachmentItemProps = {
  attachment: ThirdPartyAttachment;
  bottomSpacer?: boolean;
  disabled?: boolean;
  messageId: string;
  onPreNavigate?: () => void;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
  serviceId: ServiceId;
};
⋮----
export const MessageDetailsAttachmentItem = ({
  attachment,
  bottomSpacer,
  disabled = false,
  sendOpeningSource,
  sendUserType,
  messageId,
  onPreNavigate = undefined,
  serviceId
}: MessageDetailsAttachmentItemProps) =>
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/MessageDetailsAttachments.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ListItemHeader } from "@io-app/design-system";
import I18n from "i18next";
import { ReactNode } from "react";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
import { thirdPartyMessageAttachmentsSelector } from "../../store/reducers/thirdPartyById";
import { ATTACHMENT_CATEGORY } from "../../types/attachmentCategory";
import { MessageDetailsAttachmentItem } from "./MessageDetailsAttachmentItem";
⋮----
export type MessageDetailsAttachmentsProps = {
  banner?: ReactNode;
  disabled?: boolean;
  messageId: string;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
  serviceId: ServiceId;
};
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/MessageDetailsBody.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { Alert, Body, VSpacer } from "@io-app/design-system";
import { useLinkTo } from "@react-navigation/native";
import I18n from "i18next";
import { useMemo, useState } from "react";
import Animated, { FadeInUp } from "react-native-reanimated";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import { trackAppCaughtError } from "../../../../utils/analytics";
import { unknownToString } from "../../../../utils/errors";
import { generateMessagesAndServicesRules } from "../../../common/components/IOMarkdown/customRules";
import { removeCTAsFromMarkdown } from "../../utils/ctas";
⋮----
export type MessageDetailsBodyProps = {
  messageMarkdown: string;
  serviceId: ServiceId;
};
⋮----
setShowRawContent(innerShowRawContent
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/MessageDetailsFooter.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  ContentWrapper,
  IOColors,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { formatStringToSpacedString } from "../../../../utils/accessibility.ts";
import { formatPaymentNoticeNumber } from "../../../payments/common/utils";
import { serviceMetadataByIdSelector } from "../../../services/details/store/selectors";
import { ContactsListItem } from "./ContactsListItem";
import {
  ShowMoreItem,
  ShowMoreListItem,
  ShowMoreSection
} from "./ShowMoreListItem";
⋮----
export type MessageDetailsFooterProps = {
  messageId: string;
  noticeNumber?: string;
  payeeFiscalCode?: string;
  serviceId: ServiceId;
};
⋮----
const generateMessageSectionData = (
  messageId: string,
  noticeNumber?: string,
  payeeFiscalCode?: string
) =>
⋮----
export const MessageDetailsFooter = ({
  messageId,
  noticeNumber,
  payeeFiscalCode,
  serviceId
}: MessageDetailsFooterProps) =>
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/MessageDetailsHeader.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { BodySmall, H3, VStack } from "@io-app/design-system";
import { PropsWithChildren } from "react";
import { ImageSourcePropType, StyleSheet, View } from "react-native";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { logosForService } from "../../../services/common/utils";
import { serviceDetailsByIdSelector } from "../../../services/details/store/selectors";
import { OrganizationHeader } from "./OrganizationHeader";
⋮----
export type MessageDetailsHeaderProps = PropsWithChildren<{
  canNavigateToServiceDetails?: boolean;
  createdAt: Date | undefined;
  messageId: string;
  serviceId: ServiceId;
  subject: string;
  thirdPartySenderDenomination?: string;
}>;
⋮----
const MessageDetailsHeaderContent = ({
  subject,
  createdAt
}: Pick<MessageDetailsHeaderProps, "createdAt" | "subject">) => (
  <VStack space={8}>
    <H3 accessibilityRole="header" testID="message-header-subject">
      {subject}
    </H3>
    {createdAt && (
      <BodySmall testID="date" weight="Regular">
        {`${messageDateFormatter.format(
          createdAt
        )}, ${messageTimeFormatter.format(createdAt)}`}
      </BodySmall>
    )}
  </VStack>
);
⋮----
export const MessageDetailsHeader = ({
  children,
  messageId,
  serviceId,
  thirdPartySenderDenomination,
  canNavigateToServiceDetails = true,
  ...rest
}: MessageDetailsHeaderProps) =>
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/MessageDetailsPayment.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ListItemHeader, useIOTheme, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { messagePaymentDataSelector } from "../../store/reducers/detailsById";
import { getRptIdStringFromPaymentData } from "../../utils";
import { MessagePaymentItem } from "./MessagePaymentItem";
⋮----
type MessageDetailsPaymentProps = {
  messageId: string;
  serviceId: ServiceId;
};
⋮----
export const MessageDetailsPayment = ({
  messageId,
  serviceId
}: MessageDetailsPaymentProps) =>
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/MessageDetailsReminder.tsx">
import { Alert, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { MessageDetailsReminderExpiring } from "./MessageDetailsReminderExpiring";
⋮----
export type MessageDetailsReminderProps = {
  dueDate?: Date;
  messageId: string;
  title: string;
};
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/MessageDetailsReminderExpiring.tsx">
import { Alert } from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useRef } from "react";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { preferredCalendarSelector } from "../../../../store/reducers/persistedPreferences";
import { setAccessibilityFocus } from "../../../../utils/accessibility";
import { formatDateAsShortFormat } from "../../../../utils/dates";
import { useMessageReminder } from "../../hooks/useMessageReminder";
⋮----
type MessageDetailsReminderExpiringProps = {
  dueDate: Date;
  messageId: string;
  title: string;
};
⋮----
export const MessageDetailsReminderExpiring = ({
  dueDate,
  messageId,
  title
}: MessageDetailsReminderExpiringProps) =>
⋮----
isEventInDeviceCalendar
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/MessagePaymentItem.tsx">
import { PaymentAmount } from "@io-app/api-types/generated/definitions/communication/PaymentAmount";
import { PaymentInfoResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoResponse";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  ModulePaymentNotice,
  PaymentNoticeStatus,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
import { View } from "react-native";
⋮----
import { RemoteValue } from "../../../../common/model/RemoteValue";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import {
  cleanTransactionDescription,
  getV2ErrorMainType
} from "../../../../utils/payment";
import {
  centsToAmount,
  formatNumberAmount
} from "../../../../utils/stringBuilder";
import { formatAndValidateDueDate } from "../../../payments/checkout/utils";
import { formatPaymentNoticeNumber } from "../../../payments/common/utils";
import { trackPNPaymentStart } from "../../../pn/analytics";
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
import { updatePaymentForMessage } from "../../store/actions";
import {
  canNavigateToPaymentFromMessageSelector,
  paymentStatusForUISelector,
  shouldRetrievePaymentDataSelector
} from "../../store/reducers/payments";
import {
  isMessagePaymentSpecificError,
  MessagePaymentError
} from "../../types/paymentErrors";
import { initializeAndNavigateToWalletForPayment } from "../../utils";
import { getBadgeTextByPaymentNoticeStatus } from "../../utils/strings";
import {
  computeAndTrackPaymentStart,
  shouldUpdatePaymentUponReturning
} from "./detailsUtils";
⋮----
type MessagePaymentItemProps = {
  hideExpirationDate?: boolean;
  index?: number;
  isPNPayment?: boolean;
  messageId: string;
  noSpaceOnTop?: boolean;
  noticeNumber: string;
  paymentAmount?: PaymentAmount;
  rptId: string;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
  serviceId: ServiceId;
  willNavigateToPayment?: () => void;
};
⋮----
type ProcessedPaymentUIData = {
  badgeText: string;
  paymentNoticeStatus: Exclude<PaymentNoticeStatus, "default">;
};
⋮----
const paymentNoticeStatusFromPaymentError = (
  reason: MessagePaymentError
): Exclude<PaymentNoticeStatus, "default"> =>
⋮----
const processedUIPaymentFromPaymentError = (
  reason: MessagePaymentError
): ProcessedPaymentUIData =>
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/OrganizationHeader.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  Avatar,
  Body,
  BodySmall,
  IOColors,
  IODimensionScale,
  useIOTheme
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { ImageSourcePropType, StyleSheet, View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { SERVICES_ROUTES } from "../../../services/common/navigation/routes";
import { messagePaymentDataSelector } from "../../store/reducers/detailsById";
import { AvatarDouble } from "../Home/DS/AvatarDouble";
⋮----
export type OrganizationHeaderProps = {
  canNavigateToServiceDetails?: boolean;
  logoUri?: ImageSourcePropType;
  messageId: string;
  organizationName: string;
  serviceId: ServiceId;
  serviceName: string;
  thirdPartySenderDenomination?: string;
};
⋮----
export const OrganizationHeader = ({
  messageId,
  logoUri,
  serviceId,
  organizationName,
  serviceName,
  thirdPartySenderDenomination,
  canNavigateToServiceDetails = true
}: OrganizationHeaderProps) =>
⋮----
const OrganizationNameComponent = ()
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/RemoteContentBanner.tsx">
import { Banner, IOMarkdownLite, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { trackRemoteContentInfo } from "../../analytics";
⋮----
export const RemoteContentBanner = () =>
⋮----
trackRemoteContentInfo();
present();
</file>

<file path="apps/main-app/ts/features/messages/components/MessageDetail/ShowMoreListItem.tsx">
import {
  Divider,
  IOIcons,
  ListItemAction,
  ListItemHeader,
  ListItemInfoCopy
} from "@io-app/design-system";
import I18n from "i18next";
import { Fragment } from "react";
⋮----
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
⋮----
export type ShowMoreItem = {
  accessibilityLabel: string;
  icon?: IOIcons;
  label: string;
  value: string;
  valueToCopy?: string;
};
⋮----
export type ShowMoreListItemProps = {
  sections: ReadonlyArray<ShowMoreSection>;
};
⋮----
export type ShowMoreSection = {
  items: ReadonlyArray<ShowMoreItem>;
  title: string;
};
</file>

<file path="apps/main-app/ts/features/messages/components/MessageRouter/__mocks__/MessageRouterScreenErrorComponent.tsx">
import { IOButton } from "@io-app/design-system";
import { View } from "react-native";
</file>

<file path="apps/main-app/ts/features/messages/components/MessageRouter/MessageRouterScreenErrorComponent.tsx">
import I18n from "i18next";
import { useEffect, useMemo } from "react";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import { GlobalState } from "../../../../store/reducers/types";
import { isTestEnv } from "../../../../utils/environment";
import { trackMessageNotFoundScreen } from "../../analytics";
import {
  MessageRouterScreenErrorVariant,
  messageRouterScreenErrorVariantSelector
} from "../../store/reducers/messageGetStatus";
⋮----
export const MessageRouterScreenErrorComponent = ({
  onRetry,
  onCancel,
  messageId
}: {
  messageId: string;
onCancel: ()
⋮----
const getMessageRouterErrorMap = (
  onRetry: () => void,
  onCancel: () => void
):
</file>

<file path="apps/main-app/ts/features/messages/components/Search/EmptyList.tsx">
import {
  ContentWrapper,
  H6,
  IODimensions,
  VStack,
  WithTestID
} from "@io-app/design-system";
⋮----
import {
  AnimatedPictogram,
  IOAnimatedPictograms
} from "../../../../components/ui/AnimatedPictogram";
⋮----
export type EmptyListProps = WithTestID<{
  pictogram: IOAnimatedPictograms;
  title: string;
}>;
⋮----
export const EmptyList = ({ pictogram, title, testID }: EmptyListProps) => (
  <ContentWrapper testID={testID}>
    <VStack space={24} style={{ alignItems: "center" }}>
      <AnimatedPictogram
        name={pictogram}
        size={IODimensions.size.pictogram.screen}
      />
      <H6 style={{ textAlign: "center" }}>{title}</H6>
    </VStack>
  </ContentWrapper>
);
</file>

<file path="apps/main-app/ts/features/messages/components/MessageSurveyBanner.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { Banner, VSpacer } from "@io-app/design-system";
⋮----
import I18n from "i18next";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { messageSurveyBannerUriSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { isTestEnv } from "../../../utils/environment";
import { openWebUrl } from "../../../utils/url";
import { PNMessage } from "../../pn/store/types/types";
import { serviceDetailsByIdSelector } from "../../services/details/store/selectors";
import { messageDetailsByIdSelector } from "../store/reducers/detailsById";
import { hasAttachmentsSelector } from "../store/reducers/thirdPartyById";
import { UIMessage, UIMessageDetails } from "../types";
⋮----
type MessageKind = (typeof MessageKind)[keyof typeof MessageKind];
⋮----
type QualtricsParameters = {
  messageType: MessageKind;
  organizationFiscalCode: string;
  sendingDate: string;
  serviceId: ServiceId;
};
⋮----
messageType=
⋮----
onPress=
⋮----
if (messageDetails.hasRemoteContent)
</file>

<file path="apps/main-app/ts/features/messages/hooks/useAttachmentDownload.ts">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { useIOToast } from "@io-app/design-system";
import { File } from "expo-file-system";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
⋮----
import NavigationService from "../../../navigation/NavigationService";
import { useIODispatch, useIOSelector, useIOStore } from "../../../store/hooks";
import { isAarAttachmentTtlError } from "../../pn/aar/utils/aarErrorMappings";
import {
  trackPNAttachmentDownloadFailure,
  trackPNAttachmentOpening
} from "../../pn/analytics";
import PN_ROUTES from "../../pn/navigation/routes";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
import { trackThirdPartyMessageAttachmentShowPreview } from "../analytics";
import { MESSAGES_ROUTES } from "../navigation/routes";
import {
  cancelPreviousAttachmentDownload,
  clearRequestedAttachmentDownload,
  downloadAttachment
} from "../store/actions";
import {
  downloadedMessageAttachmentSelector,
  isDownloadingMessageAttachmentSelector,
  isRequestedAttachmentDownloadSelector,
  requestedDownloadErrorSelector
} from "../store/reducers/downloads";
import { decodeSendFailureReason, WrappedSendError } from "../utils";
import { attachmentDisplayName, toFileUri } from "../utils/attachments";
⋮----
export const useAttachmentDownload = (
  messageId: string,
  attachment: ThirdPartyAttachment,
  sendOpeningSource: SendOpeningSource,
  sendUserType: SendUserType,
  serviceId: ServiceId,
  onPreNavigate?: () => void
) =>
</file>

<file path="apps/main-app/ts/features/messages/hooks/useMessageCalendar.ts">
import { IOToast } from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback } from "react";
import { Alert } from "react-native";
⋮----
import {
  addCalendarEvent,
  AddCalendarEventPayload,
  removeCalendarEvent
} from "../../../store/actions/calendarEvents";
import { preferredCalendarSaveSuccess } from "../../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { CalendarEvent } from "../../../store/reducers/entities/calendarEvents/calendarEventsByMessageId";
import { preferredCalendarSelector } from "../../../store/reducers/persistedPreferences";
import {
  convertLocalCalendarName,
  removeEventFromDeviceCalendarTask,
  saveEventToDeviceCalendarTask,
  searchEventInCalendar
} from "../../../utils/calendar";
⋮----
export const useMessageCalendar = (messageId: string) =>
⋮----
const onAddEventToCalendar = (
    calendar: Calendar.Calendar,
    dueDate: Date,
    title: string
) =>
⋮----
const handleConfirmAddEventToCalendar = (
    dueDate: Date,
    eventId: string,
    calendar: Calendar.Calendar,
    title: string
) =>
⋮----
const addEventToCalendar = (
    dueDate: Date,
    eventTitle: string,
    calendar: Calendar.Calendar
) =>
⋮----
const removeEventFromCalendar = (
    calendarEvent: CalendarEvent | undefined
) =>
</file>

<file path="apps/main-app/ts/features/messages/hooks/useMessageDetailsFooterActions.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { FooterActions, useIOToast } from "@io-app/design-system";
import { useLinkTo } from "@react-navigation/native";
import I18n from "i18next";
import { ComponentProps, useCallback } from "react";
⋮----
import { useIODispatch, useIOSelector, useIOStore } from "../../../store/hooks";
import { CTA, CTAS } from "../../../types/LocalizedCTAs";
import { useFIMSFromServiceId } from "../../fims/common/hooks";
import { trackPNOptInMessageAccepted } from "../../pn/analytics";
import {
  computeAndTrackCTAPressAnalytics,
  computeAndTrackPaymentStart
} from "../components/MessageDetail/detailsUtils";
import { messagePaymentDataSelector } from "../store/reducers/detailsById";
import {
  canNavigateToPaymentFromMessageSelector,
  paymentsButtonStateSelector
} from "../store/reducers/payments";
import { PaymentData } from "../types";
import {
  getRptIdStringFromPaymentData,
  initializeAndNavigateToWalletForPayment
} from "../utils";
import { handleCtaAction } from "../utils/ctas";
⋮----
export type UseMessageDetailsFooterActionsProps = {
  ctas?: CTAS;
  firstCTAIsPNOptInMessage: boolean;
  messageId: string;
  secondCTAIsPNOptInMessage: boolean;
  serviceId: ServiceId;
};
⋮----
type FooterCTA = {
  cta1: CTA;
  tag: "CTA";
};
⋮----
type FooterData =
  | FooterCTA
  | FooterDoubleCTA
  | FooterNone
  | FooterPayment
  | FooterPaymentWithCTA
  | FooterPaymentWithDoubleCTA;
⋮----
type FooterDoubleCTA = {
  cta1: CTA;
  cta2: CTA;
  tag: "DoubleCTA";
};
type FooterNone = {
  tag: "None";
};
type FooterPayment = {
  paymentData: PaymentData;
  tag: "Payment";
};
type FooterPaymentWithCTA = {
  cta1: CTA;
  paymentData: PaymentData;
  tag: "PaymentWithCTA";
};
type FooterPaymentWithDoubleCTA = {
  cta1: CTA;
  cta2: CTA;
  paymentData: PaymentData;
  tag: "PaymentWithDoubleCTA";
};
⋮----
const computeFooterData = (
  paymentData: PaymentData | undefined,
  paymentButtonStatus: "enabled" | "hidden" | "loading",
  ctas: CTAS | undefined
): FooterData =>
⋮----
const mapFooterDataToActions = (
  footerData: FooterData,
  onCTAPress: (
    isFirstCTA: boolean,
    cta: CTA,
    isPNOptInMessage: boolean
  ) => void,
  firstCTAIsPNOptInMessage: boolean,
  secondCTAIsPNOptInMessage: boolean,
  canNavigateToPayment: boolean,
  isLoadingPayment: boolean,
  handlePaymentPress: () => void
): ComponentProps<typeof FooterActions>["actions"] | undefined =>
⋮----
export const useMessageDetailsFooterActions = ({
  ctas,
  firstCTAIsPNOptInMessage,
  messageId,
  secondCTAIsPNOptInMessage,
  serviceId
}: UseMessageDetailsFooterActionsProps): ComponentProps<
  typeof FooterActions
>["actions"] => {
... (2 lines truncated)
</file>

<file path="apps/main-app/ts/features/messages/hooks/useMessageReminder.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect, useState } from "react";
import { Alert } from "react-native";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { calendarEventByMessageIdSelector } from "../../../store/reducers/entities/calendarEvents/calendarEventsByMessageId";
import { openAppSettings } from "../../../utils/appSettings";
import {
  isEventInCalendar,
  requestCalendarPermission
} from "../../../utils/calendar";
import { useMessageCalendar } from "./useMessageCalendar";
⋮----
export const useMessageReminder = (
  messageId: string,
  selectCalendar: () => void
) =>
⋮----
const upsertReminder = async (
    dueDate: Date,
    subject: string,
    preferredCalendar: Calendar.Calendar | undefined
) =>
</file>

<file path="apps/main-app/ts/features/messages/navigation/MessagesNavigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { isPnRemoteEnabledSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { PnStackNavigator } from "../../pn/navigation/navigator";
import PN_ROUTES from "../../pn/navigation/routes";
import { MessageAttachmentScreen } from "../screens/MessageAttachmentScreen";
import { MessageCalendarScreen } from "../screens/MessageCalendarScreen";
import { MessageDetailsScreen } from "../screens/MessageDetailsScreen";
import { MessageGreenPassScreen } from "../screens/MessageGreenPassScreen";
import { MessageRouterScreen } from "../screens/MessageRouterScreen";
import { MessagesParamsList } from "./params";
import { MESSAGES_ROUTES } from "./routes";
⋮----
export const MessagesStackNavigator = () =>
</file>

<file path="apps/main-app/ts/features/messages/navigation/params.ts">
import { NavigatorScreenParams } from "@react-navigation/native";
⋮----
import { PnParamsList } from "../../pn/navigation/params";
import PN_ROUTES from "../../pn/navigation/routes";
import { MessageAttachmentScreenRouteParams } from "../screens/MessageAttachmentScreen";
import { MessageCalendarScreenRouteParams } from "../screens/MessageCalendarScreen";
import { MessageDetailsScreenRouteParams } from "../screens/MessageDetailsScreen";
import { MessageRouterScreenRouteParams } from "../screens/MessageRouterScreen";
import { MESSAGES_ROUTES } from "./routes";
⋮----
export type MessagesParamsList = {
  [MESSAGES_ROUTES.MESSAGE_DETAIL]: MessageDetailsScreenRouteParams;
  [MESSAGES_ROUTES.MESSAGE_DETAIL_ATTACHMENT]: MessageAttachmentScreenRouteParams;
  [MESSAGES_ROUTES.MESSAGE_DETAIL_CALENDAR]: MessageCalendarScreenRouteParams;
  [MESSAGES_ROUTES.MESSAGE_GREEN_PASS]: undefined;
  [MESSAGES_ROUTES.MESSAGE_ROUTER]: MessageRouterScreenRouteParams;
  [PN_ROUTES.MAIN]: NavigatorScreenParams<PnParamsList>;
};
</file>

<file path="apps/main-app/ts/features/messages/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/messages/saga/__mocks__/commons.ts">
import { mockCommunicationClient } from "../../../../api/__mocks__/CommunicationClientManager";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/commons.test.ts">
import { testSaga } from "redux-saga-test-plan";
⋮----
import { communicationClientManager } from "../../../../api/CommunicationClientManager";
import { apiUrlPrefix } from "../../../../config";
import { getKeyInfo } from "../../../lollipop/saga";
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { getCommunicationClient } from "../commons";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleClearAttachments.test.ts">
import { File } from "expo-file-system";
import { testSaga } from "redux-saga-test-plan";
⋮----
import { removeCachedAttachment } from "../../store/actions";
import { AttachmentsDirectoryPath } from "../../utils/attachments";
import {
  handleClearAllAttachments,
  handleClearAttachment
} from "../handleClearAttachments";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleDownloadAttachment.test.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { PublicKey } from "@pagopa/io-react-native-crypto";
⋮----
import I18n from "i18next";
import ReactNativeBlobUtil from "react-native-blob-util";
import { expectSaga, testSaga } from "redux-saga-test-plan";
⋮----
import { Effect } from "redux-saga/effects";
import { call, take } from "typed-redux-saga/macro";
⋮----
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { getKeyInfo } from "../../../lollipop/saga";
import {
  lollipopKeyTagSelector,
  lollipopPublicKeySelector
} from "../../../lollipop/store/reducers/lollipop";
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { downloadAarAttachmentSaga } from "../../../pn/aar/saga/downloadAarAttachmentSaga";
import { mockPdfAttachment } from "../../__mocks__/attachment";
⋮----
import {
  cancelPreviousAttachmentDownload,
  downloadAttachment
} from "../../store/actions";
import { thirdPartyMessageSelector } from "../../store/reducers/thirdPartyById";
import { SendFailureReason, WrappedSendError } from "../../utils";
import {
  handleDownloadAttachment,
  testable
} from "../handleDownloadAttachment";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleLoadMessageById.test.ts">
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { paymentValidInvalidAfterDueDate } from "../../__mocks__/message";
import {
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../../analytics";
import { loadMessageById as action } from "../../store/actions";
import { toUIMessage } from "../../store/reducers/transformers";
import { getCommunicationClient } from "../commons";
import { handleLoadMessageById } from "../handleLoadMessageById";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleLoadMessageData.test.ts">
import { TagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPN";
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { ThirdPartyMessage } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessage";
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { testSaga } from "redux-saga-test-plan";
import { Effect } from "redux-saga/effects";
import { call, take } from "typed-redux-saga/macro";
⋮----
import { isPnRemoteEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { getServiceDetails } from "../../../services/common/saga/getServiceDetails";
⋮----
import { trackMessageDataLoadFailure } from "../../analytics";
import {
  cancelGetMessageDataAction,
  getMessageDataAction,
  loadMessageById,
  loadMessageDetails,
  loadThirdPartyMessage,
  upsertMessageStatusAttributes
} from "../../store/actions";
import { isLoadingOrUpdatingInbox } from "../../store/reducers/allPaginated";
import { messageDetailsByIdSelector } from "../../store/reducers/detailsById";
import { MessageGetStatusFailurePhaseType } from "../../store/reducers/messageGetStatus";
import { getPaginatedMessageById } from "../../store/reducers/paginatedById";
import { thirdPartyFromIdSelector } from "../../store/reducers/thirdPartyById";
import { UIMessage, UIMessageDetails } from "../../types";
import { ThirdPartyMessageUnion } from "../../types/thirdPartyById";
import { handleLoadMessageData, testable } from "../handleLoadMessageData";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleLoadMessageDetails.test.ts">
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import {
  apiPayload,
  paymentValidInvalidAfterDueDate,
  successLoadMessageDetails
} from "../../__mocks__/message";
import { loadMessageDetails as action } from "../../store/actions";
import { getCommunicationClient } from "../commons";
import { handleLoadMessageDetails } from "../handleLoadMessageDetails";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleLoadNextPageMessages.test.ts">
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import {
  apiPayload,
  defaultRequestPayload,
  successLoadNextPageMessagesPayload
} from "../../__mocks__/messages";
import { loadNextPageMessages as action } from "../../store/actions";
import { getCommunicationClient } from "../commons";
import { handleLoadNextPageMessages } from "../handleLoadNextPageMessages";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleLoadPreviousPageMessages.test.ts">
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import {
  apiPayload,
  defaultRequestPayload,
  successLoadPreviousPageMessagesPayload
} from "../../__mocks__/messages";
import {
  loadPreviousPageMessages as action,
  loadPreviousPageMessages
} from "../../store/actions";
import { getCommunicationClient } from "../commons";
import { handleLoadPreviousPageMessages } from "../handleLoadPreviousPageMessages";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleMessagePrecondition.test.ts">
import { testSaga } from "redux-saga-test-plan";
⋮----
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import {
  loadingContentPreconditionStatusAction,
  retrievingDataPreconditionStatusAction,
  toLoadingContentPayload
} from "../../store/actions/preconditions";
import {
  getMessageIdAndCategoryTag,
  testMessagePreconditionWorker
} from "../handleMessagePrecondition";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handlePaymentStatusForAnalyticsTracking.test.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { testSaga } from "redux-saga-test-plan";
import { Effect } from "redux-saga/effects";
import { call, take } from "typed-redux-saga/macro";
⋮----
import { serviceDetailsByIdSelector } from "../../../services/details/store/selectors";
import { trackPaymentStatus } from "../../analytics";
import {
  cancelPaymentStatusTracking,
  startPaymentStatusTracking,
  updatePaymentForMessage,
  UpdatePaymentForMessageSuccess
} from "../../store/actions";
import {
  toGenericMessagePaymentError,
  toSpecificMessagePaymentError,
  toTimeoutMessagePaymentError
} from "../../types/paymentErrors";
import {
  handlePaymentStatusForAnalyticsTracking,
  paymentStatusFromPaymentUpdateResult,
  testable
} from "../handlePaymentStatusForAnalyticsTracking";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handlePaymentUpdateRequests.test.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { Channel, channel } from "redux-saga";
import { testSaga } from "redux-saga-test-plan";
import { fork } from "redux-saga/effects";
import { ActionType } from "typesafe-actions";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { Action } from "../../../../store/actions/types";
import { isPagoPATestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import {
  cancelQueuedPaymentUpdates,
  updatePaymentForMessage,
  UpdatePaymentForMessageSuccess
} from "../../store/actions";
import {
  toGenericMessagePaymentError,
  toSpecificMessagePaymentError,
  toTimeoutMessagePaymentError
} from "../../types/paymentErrors";
import { getCommunicationClient } from "../commons";
import {
  handlePaymentUpdateRequests,
  testable
} from "../handlePaymentUpdateRequests";
⋮----
const tryCatchErrorOrUndefined = (callback: () => void) =>
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleReloadAllMessages.test.ts">
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import {
  apiPayload,
  defaultRequestError,
  defaultRequestPayload,
  successReloadMessagesPayload
} from "../../__mocks__/messages";
import { reloadAllMessages as action } from "../../store/actions";
import { getCommunicationClient } from "../commons";
import { handleReloadAllMessages } from "../handleReloadAllMessages";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleRequestInit.test.ts">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { PublicKey } from "@pagopa/io-react-native-crypto";
⋮----
import { testSaga } from "redux-saga-test-plan";
⋮----
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { lollipopRequestInit } from "../../../lollipop/utils/fetch";
import { messageId_1 } from "../../__mocks__/messages";
import {
  handleRequestInit,
  testableHandleRequestInitFactory
} from "../handleRequestInit";
⋮----
const fetchParametersCommonInputData = () =>
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleThirdPartyMessage.test.ts">
import {
  TagEnum,
  TagEnum as TEBASE
} from "@io-app/api-types/generated/definitions/communication/MessageCategoryBase";
import { TagEnum as TEPAYMENT } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPayment";
import { TagEnum as TESEND } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPN";
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { testSaga } from "redux-saga-test-plan";
⋮----
import { sessionTokenSelector } from "../../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
⋮----
import { serviceDetailsByIdSelector } from "../../../services/details/store/selectors";
⋮----
import { loadThirdPartyMessage } from "../../store/actions";
import { ThirdPartyMessageUnion } from "../../types/thirdPartyById";
import { getCommunicationClient } from "../commons";
import { handleThirdPartyMessage, testable } from "../handleThirdPartyMessage";
⋮----
const generateMessages = (attachmentCount: number | undefined) =>
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/handleUpsertMessageStatusAttribues.test.ts">
import { testSaga } from "redux-saga-test-plan";
import { getType } from "typesafe-actions";
⋮----
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { successReloadMessagesPayload } from "../../__mocks__/messages";
import {
  upsertMessageStatusAttributes as action,
  UpsertMessageStatusAttributesPayload
} from "../../store/actions";
import { handleUpsertMessageStatusAttributes } from "../handleUpsertMessageStatusAttributes";
</file>

<file path="apps/main-app/ts/features/messages/saga/__test__/index.test.ts">
import { testSaga } from "redux-saga-test-plan";
⋮----
import { watchMessagesSaga } from "..";
import { logoutSuccess } from "../../../authentication/common/store/actions";
import { clearCache } from "../../../settings/common/store/actions";
import {
  downloadAttachment,
  getMessageDataAction,
  loadMessageById,
  loadMessageDetails,
  loadNextPageMessages,
  loadPreviousPageMessages,
  loadThirdPartyMessage,
  reloadAllMessages,
  removeCachedAttachment,
  setMessageSagasRegisteredAction,
  startPaymentStatusTracking,
  upsertMessageStatusAttributes
} from "../../store/actions";
import { startProcessingMessageArchivingAction } from "../../store/actions/archiving";
import { retrievingDataPreconditionStatusAction } from "../../store/actions/preconditions";
import { retryDataAfterFastLoginSessionExpirationSelector } from "../../store/reducers/messageGetStatus";
import {
  handleClearAllAttachments,
  handleClearAttachment
} from "../handleClearAttachments";
import { handleDownloadAttachment } from "../handleDownloadAttachment";
import { handleLoadMessageById } from "../handleLoadMessageById";
import { handleLoadMessageData } from "../handleLoadMessageData";
import { handleLoadMessageDetails } from "../handleLoadMessageDetails";
import { handleLoadNextPageMessages } from "../handleLoadNextPageMessages";
import { handleLoadPreviousPageMessages } from "../handleLoadPreviousPageMessages";
import { handleMessagePrecondition } from "../handleMessagePrecondition";
import { handlePaymentStatusForAnalyticsTracking } from "../handlePaymentStatusForAnalyticsTracking";
import { handlePaymentUpdateRequests } from "../handlePaymentUpdateRequests";
import { handleReloadAllMessages } from "../handleReloadAllMessages";
import { handleThirdPartyMessage } from "../handleThirdPartyMessage";
import {
  handleMessageArchivingRestoring,
  raceUpsertMessageStatusAttributes
} from "../handleUpsertMessageStatusAttributes";
</file>

<file path="apps/main-app/ts/features/messages/saga/commons.ts">
import { call } from "typed-redux-saga/macro";
⋮----
import { communicationClientManager } from "../../../api/CommunicationClientManager";
import { apiUrlPrefix } from "../../../config";
import { getKeyInfo } from "../../lollipop/saga";
</file>

<file path="apps/main-app/ts/features/messages/saga/handleClearAttachments.ts">
import { File } from "expo-file-system";
import { call } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { removeCachedAttachment } from "../store/actions";
import { AttachmentsDirectoryPath, toFileUri } from "../utils/attachments";
</file>

<file path="apps/main-app/ts/features/messages/saga/handleDownloadAttachment.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import I18n from "i18next";
import ReactNativeBlobUtil from "react-native-blob-util";
import {
  call,
  cancelled,
  delay,
  put,
  race,
  select,
  take
} from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { fetchTimeout } from "../../../config";
import { ReduxSagaEffect } from "../../../types/utils";
import { isTestEnv } from "../../../utils/environment";
import { getError } from "../../../utils/errors";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import { getKeyInfo } from "../../lollipop/saga";
import { KeyInfo } from "../../lollipop/utils/crypto";
import { downloadAarAttachmentSaga } from "../../pn/aar/saga/downloadAarAttachmentSaga";
import {
  trackThirdPartyMessageAttachmentBadFormat,
  trackThirdPartyMessageAttachmentDownloadFailed,
  trackThirdPartyMessageAttachmentUnavailable,
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../analytics";
import {
  cancelPreviousAttachmentDownload,
  downloadAttachment
} from "../store/actions";
import { thirdPartyMessageSelector } from "../store/reducers/thirdPartyById";
import {
  decodeSendFailureReason,
  SendFailureReason,
  WrappedSendError
} from "../utils";
import {
  attachmentDisplayName,
  getHeaderValueByKey,
  pdfSavePath,
  restrainRetryAfterIntervalInMilliseconds
} from "../utils/attachments";
import { isEphemeralAarThirdPartyMessage } from "../utils/thirdPartyById";
import { handleRequestInit } from "./handleRequestInit";
⋮----
const getDelayMilliseconds = (headers: Record<string, string>): number =>
⋮----
const trackFailureEvent = (
  skipMixpanelTrackingOnFailure: boolean,
  httpStatusCode: number,
  messageId: string,
  serviceId: ServiceId | undefined
): void =>
</file>

<file path="apps/main-app/ts/features/messages/saga/handleLoadMessageById.ts">
import { CreatedMessageWithContentAndAttachments } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndAttachments";
import { isRight } from "fp-ts/lib/Either";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../types/utils";
import { convertUnknownToError } from "../../../utils/errors";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../authentication/fastLogin/saga/utils";
import {
  trackLoadMessageByIdFailure,
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../analytics";
import { loadMessageById, LoadMessageByIdFailureKind } from "../store/actions";
import { toUIMessage } from "../store/reducers/transformers";
import { errorToReason, unknownToReason } from "../utils";
import { handleResponse } from "../utils/responseHandling";
import { getCommunicationClient } from "./commons";
</file>

<file path="apps/main-app/ts/features/messages/saga/handleLoadMessageData.ts">
import { TagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPN";
import { RemoteContentDetails } from "@io-app/api-types/generated/definitions/communication/RemoteContentDetails";
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { call, delay, put, race, select, take } from "typed-redux-saga/macro";
import { ActionType, isActionOf } from "typesafe-actions";
⋮----
import { isPnRemoteEnabledSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { isTestEnv } from "../../../utils/environment";
import { isFIMSLink } from "../../fims/singleSignOn/utils";
import { trackPNPushOpened } from "../../pn/analytics";
import { getServiceDetails } from "../../services/common/saga/getServiceDetails";
import {
  trackMessageDataLoadFailure,
  trackMessageDataLoadPending,
  trackMessageDataLoadRequest,
  trackMessageDataLoadSuccess,
  trackRemoteContentMessageDecodingWarning
} from "../analytics";
import {
  cancelGetMessageDataAction,
  getMessageDataAction,
  loadMessageById,
  loadMessageDetails,
  loadThirdPartyMessage,
  RequestGetMessageDataActionType,
  upsertMessageStatusAttributes
} from "../store/actions";
import { isLoadingOrUpdatingInbox } from "../store/reducers/allPaginated";
import { messageDetailsByIdSelector } from "../store/reducers/detailsById";
import { MessageGetStatusFailurePhaseType } from "../store/reducers/messageGetStatus";
import { getPaginatedMessageById } from "../store/reducers/paginatedById";
import { thirdPartyFromIdSelector } from "../store/reducers/thirdPartyById";
import { UIMessage, UIMessageDetails } from "../types";
import { extractContentFromMessageSources } from "../utils";
import {
  ctasFromLocalizedCTAs,
  localizedCTAsFromFrontMatter
} from "../utils/ctas";
⋮----
const decodeAndTrackThirdPartyMessageDetailsIfNeeded = (
  isPNMessage: boolean,
  thirdPartyMessageOrUndefined: ThirdPartyMessageWithContent | undefined,
  service: ServiceDetails,
  tag: string
) =>
⋮----
const computeHasFIMSCTA = (
  messageDetails: UIMessageDetails,
  serviceId: ServiceId,
  thirdPartyMessage: ThirdPartyMessageWithContent | undefined
) =>
⋮----
const computeHasFCICTA = (
  messageDetails: UIMessageDetails,
  serviceId: ServiceId,
  thirdPartyMessage: ThirdPartyMessageWithContent | undefined
) =>
⋮----
const isFCILink = (href: string): boolean =>
</file>

<file path="apps/main-app/ts/features/messages/saga/handleLoadMessageDetails.ts">
import { CreatedMessageWithContentAndAttachments } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndAttachments";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../types/utils";
import { getError } from "../../../utils/errors";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../authentication/fastLogin/saga/utils";
import {
  trackLoadMessageDetailsFailure,
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../analytics";
import { loadMessageDetails } from "../store/actions";
import { toUIMessageDetails } from "../store/reducers/transformers";
import { errorToReason, unknownToReason } from "../utils";
import { handleResponse } from "../utils/responseHandling";
import { getCommunicationClient } from "./commons";
</file>

<file path="apps/main-app/ts/features/messages/saga/handleLoadNextPageMessages.ts">
import { PaginatedPublicMessagesCollection } from "@io-app/api-types/generated/definitions/communication/PaginatedPublicMessagesCollection";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../types/utils";
import { convertUnknownToError, getError } from "../../../utils/errors";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../authentication/fastLogin/saga/utils";
import {
  trackLoadNextPageMessagesFailure,
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../analytics";
import {
  loadNextPageMessages,
  loadNextPageMessages as loadNextPageMessagesAction
} from "../store/actions";
import { toUIMessage } from "../store/reducers/transformers";
import { errorToReason, unknownToReason } from "../utils";
import { handleResponse } from "../utils/responseHandling";
import { getCommunicationClient } from "./commons";
</file>

<file path="apps/main-app/ts/features/messages/saga/handleLoadPreviousPageMessages.ts">
import { PaginatedPublicMessagesCollection } from "@io-app/api-types/generated/definitions/communication/PaginatedPublicMessagesCollection";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../types/utils";
import { convertUnknownToError, getError } from "../../../utils/errors";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../authentication/fastLogin/saga/utils";
import {
  trackLoadPreviousPageMessagesFailure,
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../analytics";
import { loadPreviousPageMessages as loadPreviousPageMessagesAction } from "../store/actions";
import { toUIMessage } from "../store/reducers/transformers";
import { errorToReason, unknownToReason } from "../utils";
import { handleResponse } from "../utils/responseHandling";
import { getCommunicationClient } from "./commons";
</file>

<file path="apps/main-app/ts/features/messages/saga/handleMessagePrecondition.ts">
import { MessageCategory } from "@io-app/api-types/generated/definitions/communication/MessageCategory";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put, race, select, take } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { CommunicationClient } from "../../../api/CommunicationClientManager";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../types/utils";
import { isTestEnv } from "../../../utils/environment";
import { convertUnknownToError } from "../../../utils/errors";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../authentication/fastLogin/saga/utils";
import {
  trackDisclaimerLoadError,
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../analytics";
import {
  errorPreconditionStatusAction,
  idlePreconditionStatusAction,
  loadingContentPreconditionStatusAction,
  retrievingDataPreconditionStatusAction,
  toErrorPayload,
  toLoadingContentPayload
} from "../store/actions/preconditions";
import {
  preconditionsCategoryTagSelector,
  preconditionsMessageIdSelector
} from "../store/reducers/messagePrecondition";
import {
  decodeSendFailureReason,
  SendFailureReason,
  WrappedSendError
} from "../utils";
import { getCommunicationClient } from "./commons";
</file>

<file path="apps/main-app/ts/features/messages/saga/handlePaymentStatusForAnalyticsTracking.ts">
import { call, race, select, take } from "typed-redux-saga/macro";
import { ActionType, isActionOf } from "typesafe-actions";
⋮----
import { isTestEnv } from "../../../utils/environment";
import {
  isExpiredPaymentFromDetailV2Enum,
  isOngoingPaymentFromDetailV2Enum,
  isPaidPaymentFromDetailV2Enum,
  isRevokedPaymentFromDetailV2Enum
} from "../../../utils/payment";
import { serviceDetailsByIdSelector } from "../../services/details/store/selectors";
import { trackPaymentStatus } from "../analytics";
import {
  cancelPaymentStatusTracking,
  startPaymentStatusTracking,
  updatePaymentForMessage
} from "../store/actions";
import { isMessagePaymentSpecificError } from "../types/paymentErrors";
⋮----
export const paymentStatusFromPaymentUpdateResult = (
  action: ActionType<
    | typeof updatePaymentForMessage.failure
    | typeof updatePaymentForMessage.success
  >
) =>
</file>

<file path="apps/main-app/ts/features/messages/saga/handlePaymentUpdateRequests.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
⋮----
import { Channel } from "redux-saga";
import {
  actionChannel,
  all,
  call,
  flush,
  fork,
  put,
  race,
  select,
  take
} from "typed-redux-saga/macro";
import { ActionType, isActionOf } from "typesafe-actions";
⋮----
import { Action } from "../../../store/actions/types";
import { isPagoPATestEnabledSelector } from "../../../store/reducers/persistedPreferences";
import { SagaCallReturnType } from "../../../types/utils";
import { isTestEnv } from "../../../utils/environment";
import { readablePrivacyReport } from "../../../utils/reporters";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../authentication/fastLogin/saga/utils";
import {
  trackMessagePaymentFailure,
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../analytics";
import {
  cancelQueuedPaymentUpdates,
  updatePaymentForMessage
} from "../store/actions";
import {
  isMessagePaymentGenericError,
  MessagePaymentError,
  toGenericMessagePaymentError,
  toSpecificMessagePaymentError,
  toTimeoutMessagePaymentError
} from "../types/paymentErrors";
import { getCommunicationClient } from "./commons";
⋮----
const unknownErrorToPaymentError = (e: unknown): MessagePaymentError =>
⋮----
const unknownErrorToString = (e: unknown): string =>
⋮----
const trackPaymentErrorIfNeeded = (error: MessagePaymentError) =>
</file>

<file path="apps/main-app/ts/features/messages/saga/handleReloadAllMessages.ts">
import { PaginatedPublicMessagesCollection } from "@io-app/api-types/generated/definitions/communication/PaginatedPublicMessagesCollection";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../types/utils";
import { getError } from "../../../utils/errors";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../authentication/fastLogin/saga/utils";
import {
  trackReloadAllMessagesFailure,
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../analytics";
import {
  reloadAllMessages,
  reloadAllMessages as reloadAllMessagesAction
} from "../store/actions";
import { toUIMessage } from "../store/reducers/transformers";
import { errorToReason, unknownToReason } from "../utils";
import { handleResponse } from "../utils/responseHandling";
import { getCommunicationClient } from "./commons";
</file>

<file path="apps/main-app/ts/features/messages/saga/handleRequestInit.ts">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { call } from "typed-redux-saga/macro";
import { v4 as uuid } from "uuid";
⋮----
import { isTestEnv } from "../../../utils/environment";
import { LollipopConfig } from "../../lollipop";
import { KeyInfo } from "../../lollipop/utils/crypto";
import { lollipopRequestInit } from "../../lollipop/utils/fetch";
import { attachmentDownloadUrl } from "../utils/attachments";
⋮----
type HeaderType = Record<string, string>;
⋮----
const handleRequestInitFactory = (
  method: "GET",
  attachmentFullUrl: string,
  headers: HeaderType
) => (
</file>

<file path="apps/main-app/ts/features/messages/saga/handleThirdPartyMessage.ts">
import { TagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPN";
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../types/utils";
import { isTestEnv } from "../../../utils/environment";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../authentication/fastLogin/saga/utils";
import {
  trackPNNotificationLoadError,
  trackPNNotificationLoadSuccess
} from "../../pn/analytics";
import { toSENDMessage } from "../../pn/store/types/transformers";
import { serviceDetailsByIdSelector } from "../../services/details/store/selectors";
import {
  trackRemoteContentLoadFailure,
  trackRemoteContentLoadRequest,
  trackRemoteContentLoadSuccess,
  trackThirdPartyMessageAttachmentCount,
  trackUndefinedBearerToken,
  UndefinedBearerTokenPhase
} from "../analytics";
import { loadThirdPartyMessage } from "../store/actions";
import { thirdPartyKind } from "../types/thirdPartyById";
import { unknownToReason } from "../utils";
import { getCommunicationClient } from "./commons";
⋮----
const trackSuccess = (
  messageFromApi: ThirdPartyMessageWithContent,
  serviceDetails: ServiceDetails | undefined,
  tag: string
) =>
⋮----
const trackFailure = (
  reason: string,
  serviceDetails: ServiceDetails | undefined,
  tag: string
) =>
</file>

<file path="apps/main-app/ts/features/messages/saga/handleUpsertMessageStatusAttributes.ts">
import { MessageStatusArchivingChange } from "@io-app/api-types/generated/definitions/communication/MessageStatusArchivingChange";
import { MessageStatusBulkChange } from "@io-app/api-types/generated/definitions/communication/MessageStatusBulkChange";
import { MessageStatusChange } from "@io-app/api-types/generated/definitions/communication/MessageStatusChange";
import { MessageStatusReadingChange } from "@io-app/api-types/generated/definitions/communication/MessageStatusReadingChange";
import I18n from "i18next";
import {
  call,
  cancelled,
  put,
  race,
  select,
  take
} from "typed-redux-saga/macro";
import { ActionType, isActionOf } from "typesafe-actions";
⋮----
import { CommunicationClient } from "../../../api/CommunicationClientManager";
import { SagaCallReturnType } from "../../../types/utils";
import { getError } from "../../../utils/errors";
import { sessionTokenSelector } from "../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../authentication/fastLogin/saga/utils";
import {
  trackArchivedRestoredMessages,
  trackUndefinedBearerToken,
  trackUpsertMessageStatusAttributesFailure,
  UndefinedBearerTokenPhase
} from "../analytics";
import {
  upsertMessageStatusAttributes,
  UpsertMessageStatusAttributesPayload
} from "../store/actions";
import {
  interruptMessageArchivingProcessingAction,
  removeScheduledMessageArchivingAction,
  resetMessageArchivingAction,
  startProcessingMessageArchivingAction
} from "../store/actions/archiving";
import { paginatedMessageFromIdForCategorySelector } from "../store/reducers/allPaginated";
import { nextQueuedMessageDataUncachedSelector } from "../store/reducers/archiving";
import { MessageListCategory } from "../types/messageListCategory";
import { errorToReason, unknownToReason } from "../utils";
import { handleResponse } from "../utils/responseHandling";
import { getCommunicationClient } from "./commons";
⋮----
function validatePayload(
  payload: UpsertMessageStatusAttributesPayload
): MessageStatusChange
⋮----
const generateArchiveRestoreAnalyticsData = () =>
⋮----
const updateAnalyticsData = (
  analyticsData: Map<string, number>,
  archiving: boolean
) =>
⋮----
const trackAnalyticsData = (analyticsData: Map<string, number>) =>
</file>

<file path="apps/main-app/ts/features/messages/saga/index.ts">
import { SagaIterator } from "redux-saga";
import {
  fork,
  put,
  select,
  takeEvery,
  takeLatest
} from "typed-redux-saga/macro";
⋮----
import { logoutSuccess } from "../../authentication/common/store/actions";
import { clearCache } from "../../settings/common/store/actions";
import {
  downloadAttachment,
  getMessageDataAction,
  loadMessageById,
  loadMessageDetails,
  loadNextPageMessages,
  loadPreviousPageMessages,
  loadThirdPartyMessage,
  reloadAllMessages,
  removeCachedAttachment,
  setMessageSagasRegisteredAction,
  startPaymentStatusTracking,
  upsertMessageStatusAttributes
} from "../store/actions";
import { startProcessingMessageArchivingAction } from "../store/actions/archiving";
import { retrievingDataPreconditionStatusAction } from "../store/actions/preconditions";
import { retryDataAfterFastLoginSessionExpirationSelector } from "../store/reducers/messageGetStatus";
import {
  handleClearAllAttachments,
  handleClearAttachment
} from "./handleClearAttachments";
import { handleDownloadAttachment } from "./handleDownloadAttachment";
import { handleLoadMessageById } from "./handleLoadMessageById";
import { handleLoadMessageData } from "./handleLoadMessageData";
import { handleLoadMessageDetails } from "./handleLoadMessageDetails";
import { handleLoadNextPageMessages } from "./handleLoadNextPageMessages";
import { handleLoadPreviousPageMessages } from "./handleLoadPreviousPageMessages";
import { handleMessagePrecondition } from "./handleMessagePrecondition";
import { handlePaymentStatusForAnalyticsTracking } from "./handlePaymentStatusForAnalyticsTracking";
import { handlePaymentUpdateRequests } from "./handlePaymentUpdateRequests";
import { handleReloadAllMessages } from "./handleReloadAllMessages";
import { handleThirdPartyMessage } from "./handleThirdPartyMessage";
import {
  handleMessageArchivingRestoring,
  raceUpsertMessageStatusAttributes
} from "./handleUpsertMessageStatusAttributes";
</file>

<file path="apps/main-app/ts/features/messages/screens/MessageAttachmentScreen.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../navigation/params/AppParamsList";
import { MessageAttachment } from "../components/MessageAttachment/MessageAttachment";
import { MessagesParamsList } from "../navigation/params";
⋮----
export type MessageAttachmentScreenRouteParams = {
  attachmentId: string;
  messageId: string;
  serviceId?: ServiceId;
};
⋮----
type MessageAttachmentScreenProps = IOStackNavigationRouteProps<
  MessagesParamsList,
  "MESSAGE_DETAIL_ATTACHMENT"
>;
⋮----
export const MessageAttachmentScreen = (
  props: MessageAttachmentScreenProps
) =>
</file>

<file path="apps/main-app/ts/features/messages/screens/MessageCalendarScreen.tsx">
import { FooterActions, ModalBSHeader, VSpacer } from "@io-app/design-system";
⋮----
import { RouteProp, useRoute } from "@react-navigation/native";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback, useEffect, useState } from "react";
import { ScrollView, View } from "react-native";
⋮----
import { CalendarList } from "../../../components/CalendarList";
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../store/hooks";
import { findDeviceCalendarsTask } from "../../../utils/calendar";
import { useMessageCalendar } from "../hooks/useMessageCalendar";
import { MessagesParamsList } from "../navigation/params";
import { messageDetailsByIdSelector } from "../store/reducers/detailsById";
⋮----
export type MessageCalendarScreenRouteParams = {
  messageId: string;
};
⋮----
type MessageCalendarRouteProps = RouteProp<
  MessagesParamsList,
  "MESSAGE_DETAIL_CALENDAR"
>;
⋮----
const MessageCalendarHeaderComponent = () =>
⋮----
calendars=
</file>

<file path="apps/main-app/ts/features/messages/screens/MessageDetailsScreen.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  ContentWrapper,
  Icon,
  ScrollViewWithStickyFooterActions,
  VSpacer
} from "@io-app/design-system";
⋮----
import { useFocusEffect } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback, useEffect, useMemo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector, useIOStore } from "../../../store/hooks";
import {
  trackPNOptInMessageCTADisplaySuccess,
  trackPNOptInMessageOpened
} from "../../pn/analytics";
import { extractPNOptInMessageInfoIfAvailable } from "../../pn/utils";
import { MessageAttachmentsAlert } from "../components/MessageAttachment/MessageAttachmentsAlert";
import { MessageDetailsAttachments } from "../components/MessageDetail/MessageDetailsAttachments";
import { MessageDetailsBody } from "../components/MessageDetail/MessageDetailsBody";
import { MessageDetailsFooter } from "../components/MessageDetail/MessageDetailsFooter";
import { MessageDetailsHeader } from "../components/MessageDetail/MessageDetailsHeader";
import { MessageDetailsPayment } from "../components/MessageDetail/MessageDetailsPayment";
import { MessageDetailsReminder } from "../components/MessageDetail/MessageDetailsReminder";
import { RemoteContentBanner } from "../components/MessageDetail/RemoteContentBanner";
import { StandardMessageSurveyBanner } from "../components/MessageSurveyBanner";
import { useMessageDetailsFooterActions } from "../hooks/useMessageDetailsFooterActions";
import { MessagesParamsList } from "../navigation/params";
import {
  cancelPaymentStatusTracking,
  cancelPreviousAttachmentDownload,
  cancelQueuedPaymentUpdates,
  resetGetMessageDataAction,
  startPaymentStatusTracking,
  updatePaymentForMessage
} from "../store/actions";
import { messageDetailsByIdSelector } from "../store/reducers/detailsById";
import { getPaginatedMessageById } from "../store/reducers/paginatedById";
import { userSelectedPaymentRptIdSelector } from "../store/reducers/payments";
import {
  hasAttachmentsSelector,
  messageMarkdownSelector,
  messageTitleSelector
} from "../store/reducers/thirdPartyById";
import { getMessageCTAs } from "../utils/ctas";
⋮----
export type MessageDetailsScreenRouteParams = {
  messageId: string;
  serviceId: ServiceId;
};
⋮----
type MessageDetailsScreenProps = IOStackNavigationRouteProps<
  MessagesParamsList,
  "MESSAGE_DETAIL"
>;
⋮----
// Use the store since `isPNOptInMessage` is not a selector but an utility
// that uses a backend status configuration that is normally updated every
// minute. We do not want to cause a re-rendering or recompute the value
</file>

<file path="apps/main-app/ts/features/messages/screens/MessageGreenPassScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
</file>

<file path="apps/main-app/ts/features/messages/screens/MessageRouterScreen.tsx">
import I18n from "i18next";
import { ReactElement, useCallback, useEffect, useRef } from "react";
⋮----
import { LoadingScreenContent } from "../../../components/screens/LoadingScreenContent";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import {
  IOStackNavigationRouteProps,
  useIONavigation
} from "../../../navigation/params/AppParamsList";
import ROUTES from "../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import PN_ROUTES from "../../pn/navigation/routes";
import { trackOpenMessage } from "../analytics";
import { MessageRouterScreenErrorComponent } from "../components/MessageRouter/MessageRouterScreenErrorComponent";
import { MessagesParamsList } from "../navigation/params";
import { MESSAGES_ROUTES } from "../navigation/routes";
import {
  cancelGetMessageDataAction,
  getMessageDataAction,
  SuccessGetMessageDataActionType
} from "../store/actions";
import {
  blockedFromPushNotificationSelector,
  messageSuccessDataSelector,
  showSpinnerFromMessageGetStatusSelector
} from "../store/reducers/messageGetStatus";
⋮----
export type MessageRouterScreenRouteParams = {
  fromNotification: boolean;
  messageId: string;
};
⋮----
type NavigationProps = IOStackNavigationRouteProps<
  MessagesParamsList,
  "MESSAGE_ROUTER"
>;
⋮----
subtitle=
</file>

<file path="apps/main-app/ts/features/messages/screens/MessagesHomeScreen.tsx">
import { HeaderActionProps } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo, useRef } from "react";
import { View } from "react-native";
import PagerView from "react-native-pager-view";
⋮----
import { useHeaderFirstLevel } from "../../../hooks/useHeaderFirstLevel";
import {
  useHeaderFirstLevelActionPropSettings,
  useNavigateToSettingMainScreen
} from "../../../hooks/useHeaderFirstLevelActionPropSettings";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIODispatch, useIOStore } from "../../../store/hooks";
import { useEngagementScreen } from "../../pushNotifications/hooks/useEngagementScreen";
import { PagerViewContainer } from "../components/Home/PagerViewContainer";
import { Preconditions } from "../components/Home/Preconditions";
import { SecuritySuggestions } from "../components/Home/SecuritySuggestions";
import { TabNavigationContainer } from "../components/Home/TabNavigationContainer";
import { Toasts } from "../components/Home/Toasts";
import { MESSAGES_ROUTES } from "../navigation/routes";
import { resetMessageArchivingAction } from "../store/actions/archiving";
import {
  isArchivingInProcessingModeSelector,
  isArchivingInSchedulingModeSelector
} from "../store/reducers/archiving";
</file>

<file path="apps/main-app/ts/features/messages/screens/MessagesSearchScreen.tsx">
import {
  ContentWrapper,
  Divider,
  IODimensionScale,
  SearchInput,
  SearchInputRef,
  VSpacer
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import {
  FlatList,
  ListRenderItemInfo,
  Platform,
  View,
  ViewStyle
} from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIOStore } from "../../../store/hooks";
import {
  trackMessageSearchClosing,
  trackMessageSearchPage,
  trackMessageSearchResult
} from "../analytics";
import { WrappedListItemMessage } from "../components/Home/WrappedListItemMessage";
import { EmptyList } from "../components/Search/EmptyList";
import { searchMessagesUncachedSelector } from "../store/reducers/allPaginated";
import { UIMessage } from "../types";
⋮----
export const MessagesSearchScreen = () =>
</file>

<file path="apps/main-app/ts/features/messages/store/actions/archiving.ts">
import { createStandardAction } from "typesafe-actions";
⋮----
import { ProcessingResult } from "../reducers/archiving";
⋮----
type ScheduleMessageArchivingType = {
  fromInboxToArchive: boolean;
  messageId: string;
};
</file>

<file path="apps/main-app/ts/features/messages/store/actions/index.ts">
import { PaymentInfoResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoResponse";
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  ActionType,
  createAction,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { UIMessage, UIMessageDetails } from "../../types";
import { MessageListCategory } from "../../types/messageListCategory";
import { MessagePaymentError } from "../../types/paymentErrors";
import { ThirdPartyMessageUnion } from "../../types/thirdPartyById";
import { MessageGetStatusFailurePhaseType } from "../reducers/messageGetStatus";
import {
  interruptMessageArchivingProcessingAction,
  removeScheduledMessageArchivingAction,
  resetMessageArchivingAction,
  startProcessingMessageArchivingAction,
  toggleScheduledMessageArchivingAction
} from "./archiving";
import {
  errorPreconditionStatusAction,
  idlePreconditionStatusAction,
  loadingContentPreconditionStatusAction,
  retrievingDataPreconditionStatusAction,
  scheduledPreconditionStatusAction,
  updateRequiredPreconditionStatusAction
} from "./preconditions";
⋮----
export type RequestGetMessageDataActionType = {
  fromPushNotification: boolean;
  messageId: string;
};
⋮----
export type SuccessGetMessageDataActionType = {
  containsAttachments: boolean;
  containsPayment?: boolean;
  createdAt: Date;
  fciMessageType: "not_set" | "request" | "result";
  fciResult: "failure" | "not_set" | "success";
  firstTimeOpening: boolean;
  hasFIMSCTA: boolean;
  hasRemoteContent: boolean;
  isLegacyGreenPass?: boolean;
  isPNMessage: boolean;
  messageId: string;
  organizationFiscalCode: string;
  organizationName: string;
  serviceId: ServiceId;
  serviceName: string;
};
⋮----
type FailureGetMessageDataActionType = {
  blockedFromPushNotificationOpt?: boolean;
  phase: MessageGetStatusFailurePhaseType;
};
⋮----
export type LoadMessageByIdFailureKind = "generic" | "messageNotFound";
⋮----
export type LoadMessagesRequestPayload = {
  cursor?: string;
  filter: Filter;
  fromUserAction: boolean;
  pageSize: number;
};
⋮----
export type MessagesFailurePayload = {
  error: Error;
  filter: Filter;
};
⋮----
export type NextPageMessagesSuccessPayload = PaginatedMessagesSuccessPayload & {
  filter: Filter;
  pagination: { next?: string };
};
⋮----
type Filter = { getArchived?: boolean };
⋮----
type PaginatedMessagesSuccessPayload = {
  filter: Filter;
  fromUserAction: boolean;
  messages: ReadonlyArray<UIMessage>;
};
⋮----
export type PreviousPageMessagesSuccessPayload =
  PaginatedMessagesSuccessPayload & {
    filter: Filter;
    pagination: { previous?: string };
  };
⋮----
export type ReloadMessagesPayload = PaginatedMessagesSuccessPayload & {
  pagination: { next?: string; previous?: string };
};
⋮----
export type UpsertMessageStatusAttributesPayload = {
  message: UIMessage;
  update:
    | { isArchived: boolean; tag: "archiving" }
... (84 lines truncated)
</file>

<file path="apps/main-app/ts/features/messages/store/actions/preconditions.ts">
import { MessageCategory } from "@io-app/api-types/generated/definitions/communication/MessageCategory";
import { ThirdPartyMessagePrecondition } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessagePrecondition";
import { createStandardAction } from "typesafe-actions";
⋮----
export type NPSError = {
  nextStatus: "error";
  reason: string;
};
export type NPSIdle = {
  nextStatus: "idle";
};
export type NPSLoadingContent = {
  content: ThirdPartyMessagePrecondition;
  nextStatus: "loadingContent";
};
export type NPSRetrievingData = {
  nextStatus: "retrievingData";
};
export type NPSScheduled = {
  categoryTag: MessageCategory["tag"];
  messageId: string;
  nextStatus: "scheduled";
};
export type NPSUpdateRequired = {
  nextStatus: "updateRequired";
};
⋮----
export const toErrorPayload = (reason: string): NPSError => (
export const toIdlePayload = (): NPSIdle => (
export const toLoadingContentPayload = (
  content: ThirdPartyMessagePrecondition
): NPSLoadingContent => (
export const toRetrievingDataPayload = (): NPSRetrievingData => (
export const toScheduledPayload = (
  messageId: string,
  categoryTag: MessageCategory["tag"]
): NPSScheduled => (
export const toUpdateRequiredPayload = (): NPSUpdateRequired => (
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/allPaginated/automaticMessagesRefresh.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { requestAutomaticMessagesRefresh } from "../../actions";
import { AllPaginated } from "./types";
⋮----
export const reduceAutomaticMessageRefreshRequest = (
  state: AllPaginated,
  action: Action
): AllPaginated =>
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/allPaginated/index.ts">
import { MessageCategory } from "@io-app/api-types/generated/definitions/communication/MessageCategory";
⋮----
import { getType } from "typesafe-actions";
⋮----
import type {
  AllPaginated,
  Collection,
  LastRequestValues,
  MessagePage,
  MessagePagePot
} from "./types.ts";
⋮----
import { Action } from "../../../../../store/actions/types";
import { paymentsByRptIdSelector } from "../../../../../store/reducers/entities/payments";
import { GlobalState } from "../../../../../store/reducers/types";
import {
  isLoadingOrUpdating,
  isSomeLoadingOrSomeUpdating
} from "../../../../../utils/pot";
import { isTextIncludedCaseInsensitive } from "../../../../../utils/strings";
import { clearCache } from "../../../../settings/common/store/actions";
import { MessageListCategory } from "../../../types/messageListCategory";
import { emptyMessageArray } from "../../../utils";
import {
  loadNextPageMessages,
  loadPreviousPageMessages,
  reloadAllMessages,
  requestAutomaticMessagesRefresh,
  setShownMessageCategoryAction,
  upsertMessageStatusAttributes
} from "../../actions";
import { reduceAutomaticMessageRefreshRequest } from "./automaticMessagesRefresh.ts";
import { reduceLoadNextPage } from "./loadNextPage.ts";
import { reduceLoadPreviousPage } from "./loadPreviousPage.ts";
import { reduceReloadAll } from "./reloadAll.ts";
import { reduceUpsertMessageStatusAttributes } from "./upsertMessageStatusAttributes.ts";
⋮----
const reducer = (
  state: AllPaginated = ALL_PAGINATED_INITIAL_STATE,
  action: Action
): AllPaginated =>
⋮----
export const isLoadingOrUpdatingInbox = (state: GlobalState) =>
⋮----
export const shownMessageCategorySelector = (state: GlobalState)
⋮----
export const messageListForCategorySelector = (
  state: GlobalState,
  category: MessageListCategory
) =>
⋮----
export const messageCountForCategorySelector = (
  state: GlobalState,
  shownCategory: MessageListCategory
) =>
export const emptyListReasonSelector = (
  state: GlobalState,
  category: MessageListCategory
): "error" | "noData" | "notEmpty" =>
⋮----
export const shouldShowFooterListComponentSelector = (
  state: GlobalState,
  category: MessageListCategory
) =>
⋮----
export const shouldShowRefreshControllOnListSelector = (
  state: GlobalState,
  category: MessageListCategory
) =>
⋮----
export const messagePagePotFromCategorySelector = (
  category: MessageListCategory,
  state: GlobalState
) =>
⋮----
export const isPaymentMessageWithPaidNoticeSelector = (
  state: GlobalState,
  category: MessageCategory
) =>
⋮----
const messageCollectionFromCategory = (
  category: MessageListCategory,
  state: GlobalState
) =>
⋮----
const reasonFromMessagePageContainer = (container: MessagePage)
⋮----
export const inboxMessagesErrorReasonSelector = (state: GlobalState) =>
⋮----
export const archiveMessagesErrorReasonSelector = (state: GlobalState) =>
⋮----
export const paginatedMessageFromIdForCategorySelector = (
  state: GlobalState,
  messageId: string,
  messageCategory: MessageListCategory
) =>
⋮----
export const searchMessagesUncachedSelector = (
  state: GlobalState,
  searchText: string,
... (12 lines truncated)
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/allPaginated/loadNextPage.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { loadNextPageMessages } from "../../actions";
import { AllPaginated, Collection } from "./types";
⋮----
const stateKeyFrom = (getArchived?: boolean): "archive" | "inbox"
⋮----
const getNextData = (
  current: Collection,
  action: ReturnType<typeof loadNextPageMessages.success>
) =>
⋮----
export const reduceLoadNextPage = (
  state: AllPaginated,
  action: Action
): AllPaginated =>
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/allPaginated/loadPreviousPage.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { loadPreviousPageMessages } from "../../actions";
import { AllPaginated, Collection } from "./types";
⋮----
const stateKeyFrom = (getArchived?: boolean): "archive" | "inbox"
⋮----
const getPreviousData = (
  current: Collection,
  action: ReturnType<typeof loadPreviousPageMessages.success>
) =>
⋮----
export const reduceLoadPreviousPage = (
  state: AllPaginated,
  action: Action
): AllPaginated =>
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/allPaginated/reloadAll.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { reloadAllMessages } from "../../actions";
import { AllPaginated } from "./types";
⋮----
export const reduceReloadAll = (
  state: AllPaginated,
  action: Action
): AllPaginated =>
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/allPaginated/types.ts">
import { UIMessage } from "../../../types";
import { MessageListCategory } from "../../../types/messageListCategory";
⋮----
export type AllPaginated = {
  archive: Collection;
  inbox: Collection;
  shownCategory: MessageListCategory;
};
⋮----
export type Collection = {
  data: MessagePagePot;
  lastRequest?: LastRequestValues;
  lastUpdateTime: Date;
};
⋮----
export type LastRequestValues = "all" | "next" | "previous";
⋮----
export type MessageError = {
  reason: string;
  time: Date;
};
⋮----
export type MessagePage = {
  next?: string;
  page: ReadonlyArray<UIMessage>;
  previous?: string;
};
⋮----
export type MessagePagePot = pot.Pot<MessagePage, MessageError>;
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/allPaginated/upsertMessageStatusAttributes.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { UIMessage } from "../../../types";
import { upsertMessageStatusAttributes } from "../../actions";
import { AllPaginated, Collection } from "./types";
⋮----
export const reduceUpsertMessageStatusAttributes = (
  state: AllPaginated,
  action: Action
): AllPaginated =>
⋮----
const remove = (message: UIMessage, from: Collection)
⋮----
const insert = (message: UIMessage, to: Collection)
⋮----
const replace = (message: UIMessage, collection: Collection): Collection => (
⋮----
const refreshCursors = (of: Collection): Collection => (
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/archiving.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { MessageListCategory } from "../../types/messageListCategory";
import { duplicateSetAndRemove, duplicateSetAndToggle } from "../../utils";
import {
  interruptMessageArchivingProcessingAction,
  removeScheduledMessageArchivingAction,
  resetMessageArchivingAction,
  startProcessingMessageArchivingAction,
  toggleScheduledMessageArchivingAction
} from "../actions/archiving";
⋮----
export type Archiving = {
  fromArchiveToInbox: Set<string>;
  fromInboxToArchive: Set<string>;
  processingResult: ProcessingResult | undefined;
  status: ArchivingStatus;
};
⋮----
export type ArchivingStatus = "disabled" | "enabled" | "processing";
⋮----
export type ProcessingResult = {
  reason: string;
  type: "error" | "success";
};
⋮----
export const archivingReducer = (
  state: Archiving = INITIAL_STATE,
  action: Action
): Archiving =>
⋮----
export const isArchivingDisabledSelector = (state: GlobalState)
export const isArchivingInSchedulingModeSelector = (state: GlobalState)
export const isArchivingInProcessingModeSelector = (state: GlobalState)
export const isMessageScheduledForArchivingSelector = (
  state: GlobalState,
  messageId: string
) =>
export const areThereEntriesForShownMessageListCategorySelector = (
  state: GlobalState,
  category: MessageListCategory
) =>
export const nextQueuedMessageDataUncachedSelector = (state: GlobalState) =>
export const processingResultTypeSelector = (state: GlobalState)
export const processingResultReasonSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/detailsById.ts">
import _ from "lodash";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import {
  populateStoresWithEphemeralAarMessageData,
  terminateAarFlow
} from "../../../pn/aar/store/actions";
import { clearCache } from "../../../settings/common/store/actions";
import { UIMessageDetails } from "../../types";
import { loadMessageDetails, reloadAllMessages } from "../actions";
⋮----
export type DetailsById = {
  [id: string]: pot.Pot<UIMessageDetails, string>;
};
⋮----
export const detailsByIdReducer = (
  state: DetailsById = INITIAL_STATE,
  action: Action
): DetailsById =>
⋮----
export const messageDetailsByIdSelector = (
  state: GlobalState,
  id: string
): pot.Pot<UIMessageDetails, string>
⋮----
export const messagePaymentDataSelector = (state: GlobalState, id: string) =>
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/downloads.ts">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { IndexedById } from "../../../../store/helpers/indexer";
import {
  toError,
  toLoading,
  toNone,
  toSome
} from "../../../../store/reducers/IndexedByIdPot";
import { GlobalState } from "../../../../store/reducers/types";
import {
  clearRequestedAttachmentDownload,
  downloadAttachment,
  DownloadAttachmentCancel,
  removeCachedAttachment
} from "../actions";
⋮----
export type Download = {
  attachment: ThirdPartyAttachment;
  path: string;
};
⋮----
export type Downloads = {
  requestedDownload?: RequestedDownload;
  statusById: Record<string, IndexedById<pot.Pot<Download, Error>> | undefined>;
};
⋮----
type RequestedDownload = {
  attachmentId: string;
  messageId: string;
};
⋮----
export const downloadsReducer = (
  state: Downloads = INITIAL_STATE,
  action: Action
): Downloads =>
⋮----
export const isRequestedAttachmentDownloadSelector = (
  state: GlobalState,
  messageId: string,
  attachmentId: string
)
⋮----
export const isDownloadingMessageAttachmentSelector = (
  state: GlobalState,
  messageId: string,
  attachmentId: string
) =>
⋮----
export const requestedDownloadErrorSelector = (
  state: GlobalState,
  messageId: string,
  attachmentId: string
) =>
⋮----
export const downloadedMessageAttachmentSelector = (
  state: GlobalState,
  messageId: string,
  attachmentId: string
) =>
⋮----
const isRequestedDownloadMatch = (
  requestedDownload: RequestedDownload | undefined,
  messageId: string,
  attachmentId: string
)
const requestDownloadAfterCancelledAction = (
  state: Downloads,
  cancelActionPayload: DownloadAttachmentCancel
)
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/index.ts">
import { combineReducers } from "redux";
⋮----
import { Action } from "../../../../store/actions/types";
import allPaginatedReducer from "./allPaginated";
import { AllPaginated } from "./allPaginated/types";
import { Archiving, archivingReducer } from "./archiving";
import { DetailsById, detailsByIdReducer } from "./detailsById";
import { Downloads, downloadsReducer } from "./downloads";
import { MessageGetStatus, messageGetStatusReducer } from "./messageGetStatus";
import {
  MessagePreconditionStatus,
  preconditionReducer
} from "./messagePrecondition";
import {
  messageSectionStatusReducer,
  MessageSectionStatusType
} from "./messageSectionStatus";
import paginatedByIdReducer, { PaginatedById } from "./paginatedById";
import { MultiplePaymentState, paymentsReducer } from "./payments";
import { ThirdPartyById, thirdPartyByIdReducer } from "./thirdPartyById";
⋮----
export type MessagesState = Readonly<{
  allPaginated: AllPaginated;
  archiving: Archiving;
  detailsById: DetailsById;
  downloads: Downloads;
  messageGetStatus: MessageGetStatus;
  paginatedById: PaginatedById;
  payments: MultiplePaymentState;
  precondition: MessagePreconditionStatus;
  sectionStatus: MessageSectionStatusType;
  thirdPartyById: ThirdPartyById;
}>;
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/messageGetStatus.ts">
import { getType } from "typesafe-actions";
⋮----
import { startApplicationInitialization } from "../../../../store/actions/application";
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import {
  getMessageDataAction,
  reloadAllMessages,
  resetGetMessageDataAction,
  SuccessGetMessageDataActionType
} from "../actions";
import { getPaginatedMessageById } from "./paginatedById";
⋮----
export type MessageGetStatus =
  | BlockedOrErrorState
  | IdleState
  | LoadingOrRetryState
  | SuccessState;
⋮----
export type MessageGetStatusFailurePhaseType =
  | "messageDetails"
  | "none"
  | "paginatedMessage"
  | "preconditions"
  | "readStatusUpdate"
  | "serviceDetails"
  | "thirdPartyMessageDetails";
⋮----
type BlockedOrErrorState = {
  failurePhase: MessageGetStatusFailurePhaseType;
  status: "blocked" | "error";
};
⋮----
type IdleState = {
  status: "idle";
};
⋮----
type LoadingOrRetryState = {
  data: {
    fromPushNotification: boolean;
    messageId: string;
  };
  status: "loading" | "retry";
};
⋮----
type SuccessState = {
  status: "success";
  successData: SuccessGetMessageDataActionType;
};
⋮----
export const messageGetStatusReducer = (
  state: MessageGetStatus = INITIAL_STATE,
  action: Action
): MessageGetStatus =>
⋮----
const isLoadingStatus = (
  messageGetStatus: MessageGetStatus
): messageGetStatus is LoadingOrRetryState
const isRetryStatus = (
  messageGetStatus: MessageGetStatus
): messageGetStatus is LoadingOrRetryState
const isSuccessStatus = (
  messageGetStatus: MessageGetStatus
): messageGetStatus is SuccessState
⋮----
export const showSpinnerFromMessageGetStatusSelector = (state: GlobalState)
⋮----
export const messageGetStatusErrorPhaseSelector = (state: GlobalState)
⋮----
export const messageSuccessDataSelector = (state: GlobalState)
⋮----
export const blockedFromPushNotificationSelector = (state: GlobalState)
⋮----
export const retryDataAfterFastLoginSessionExpirationSelector = (
  state: GlobalState
)
⋮----
export type MessageRouterScreenErrorVariant =
  | "genericError"
  | "messageNotFound"
  | "thirdPartyError";
export const messageRouterScreenErrorVariantSelector = (
  state: GlobalState,
  messageId: string
): MessageRouterScreenErrorVariant =>
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/messagePrecondition.ts">
import { MessageCategory } from "@io-app/api-types/generated/definitions/communication/MessageCategory";
import { TagEnum as SENDTagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryPN";
import { ThirdPartyMessagePrecondition } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessagePrecondition";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { isPnAppVersionSupportedSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../store/reducers/types";
import {
  errorPreconditionStatusAction,
  idlePreconditionStatusAction,
  loadingContentPreconditionStatusAction,
  retrievingDataPreconditionStatusAction,
  scheduledPreconditionStatusAction,
  updateRequiredPreconditionStatusAction
} from "../actions/preconditions";
⋮----
export type MessagePreconditionStatus =
  | ErrorPreconditionStatus
  | IdlePreconditionStatus
  | RetrievingDataPreconditionStatus
  | ScheduledPreconditionStatus
  | ShownPreconditionStatus
  | UpdateRequiredPreconditionStatus;
⋮----
type ErrorPreconditionStatus = MessagePreconditionData & {
  reason: string;
  state: "error";
};
type IdlePreconditionStatus = {
  state: "idle";
};
type MessagePreconditionData = {
  categoryTag: MessageCategory["tag"];
  messageId: string;
};
type MessagePreconditionState = MessagePreconditionStatus["state"];
type MessagePreconditionStatusWithData = Exclude<
  MessagePreconditionStatus,
  IdlePreconditionStatus | UpdateRequiredPreconditionStatus
>;
⋮----
type PreconditionContent = "content" | "error" | "loading" | "update";
⋮----
type PreconditionContentLayout = {
  content: PreconditionContent;
  footer: PreconditionFooter;
  title: PreconditionTitleContent;
};
type PreconditionFooter = "content" | "update" | "view";
type PreconditionTitleContent = "empty" | "header" | "loading";
type RetrievingDataPreconditionStatus = MessagePreconditionData & {
  state: "retrievingData";
};
type ScheduledPreconditionStatus = MessagePreconditionData & {
  state: "scheduled";
};
type ShownPreconditionStatus = MessagePreconditionData & {
  content: ThirdPartyMessagePrecondition;
  state: "shown";
};
type UpdateRequiredPreconditionStatus = {
  state: "updateRequired";
};
⋮----
export const preconditionReducer = (
  state: MessagePreconditionStatus = INITIAL_STATE,
  action: Action
): MessagePreconditionStatus =>
⋮----
const hasPreconditionContent = (
  precondition: MessagePreconditionStatus
): precondition is ShownPreconditionStatus
⋮----
const hasPreconditionMessage = (
  precondition: MessagePreconditionStatus
): precondition is MessagePreconditionStatusWithData
⋮----
const getMessagePrecondition = (state: GlobalState)
⋮----
export const shouldPresentPreconditionsBottomSheetSelector = (
  state: GlobalState
)
⋮----
export const preconditionsRequireAppUpdateSelector = (state: GlobalState) =>
⋮----
export const preconditionsTitleSelector = (state: GlobalState) =>
⋮----
export const preconditionsContentMarkdownSelector = (state: GlobalState) =>
⋮----
export const preconditionsCategoryTagSelector = (state: GlobalState) =>
⋮----
export const preconditionsMessageIdSelector = (state: GlobalState) =>
⋮----
const getPreconditionContentByState = (state: GlobalState)
export const preconditionsTitleContentSelector = (state: GlobalState)
export const preconditionsContentSelector = (state: GlobalState)
export const preconditionsFooterSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/messageSectionStatus.ts">
import { getType } from "typesafe-actions";
⋮----
import { startApplicationInitialization } from "../../../../store/actions/application";
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { setMessageSagasRegisteredAction } from "../actions";
⋮----
export type MessageSectionStatusType = {
  messageSagasRegistered: boolean;
};
⋮----
export const messageSectionStatusReducer = (
  state: MessageSectionStatusType = messageSectionStatusInitialState,
  action: Action
): MessageSectionStatusType =>
⋮----
export const areMessageSagasRegisteredSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/paginatedById.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { clearCache } from "../../../settings/common/store/actions";
import { UIMessage } from "../../types";
import {
  loadMessageById,
  LoadMessageByIdFailureKind,
  loadNextPageMessages,
  loadPreviousPageMessages,
  reloadAllMessages,
  upsertMessageStatusAttributes,
  UpsertMessageStatusAttributesPayload
} from "../actions";
⋮----
export type PaginatedById = Readonly<{
  [key: string]: pot.Pot<
    UIMessage,
    { error: Error; kind: LoadMessageByIdFailureKind }
  >;
}>;
⋮----
const reducer = (
  state: PaginatedById = INITIAL_STATE,
  action: Action
): PaginatedById =>
⋮----
const reduceLoadMessageById = (
  state: PaginatedById = INITIAL_STATE,
  action: Action
): PaginatedById =>
⋮----
const reduceLoadMessages = (
  state: PaginatedById = INITIAL_STATE,
  messages: ReadonlyArray<UIMessage>
): PaginatedById
⋮----
const reduceUpsertMessageStatusAttributes = (
  state: PaginatedById = INITIAL_STATE,
  payload: UpsertMessageStatusAttributesPayload
): PaginatedById =>
⋮----
export const getPaginatedMessageById = (
  state: GlobalState,
  messageId: string
)
⋮----
export const getPaginatedMessageErrorKindById = (
  state: GlobalState,
  messageId: string
) =>
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/payments.ts">
import { PaymentInfoResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoResponse";
import { getType } from "typesafe-actions";
⋮----
import {
  isError,
  isLoading,
  isReady,
  isUndefined,
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../../../common/model/RemoteValue";
import { isPagoPaSupportedSelector } from "../../../../common/versionInfo/store/reducers/versionInfo";
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { isTestEnv } from "../../../../utils/environment";
import {
  isExpiredPaymentFromDetailV2Enum,
  isOngoingPaymentFromDetailV2Enum,
  isPaidPaymentFromDetailV2Enum,
  isRevokedPaymentFromDetailV2Enum
} from "../../../../utils/payment";
import { isProfileEmailValidatedSelector } from "../../../settings/common/store/selectors";
import { UIMessageDetails } from "../../types";
import {
  isMessagePaymentSpecificError,
  isTimeoutOrGenericOrOngoingPaymentError,
  MessagePaymentError
} from "../../types/paymentErrors";
import {
  duplicateSetAndAdd,
  duplicateSetAndRemove,
  getRptIdStringFromPaymentData
} from "../../utils";
import {
  addUserSelectedPaymentRptId,
  cancelQueuedPaymentUpdates,
  reloadAllMessages,
  updatePaymentForMessage
} from "../actions";
import { messagePaymentDataSelector } from "./detailsById";
⋮----
export type MultiplePaymentState = {
  paymentStatusListById: {
    [key: string]: SinglePaymentState | undefined;
  };
  userSelectedPayments: Set<string>;
};
⋮----
export type PaymentStatistics = {
  errorCount: number;
  expiredCount: number;
  ongoingCount: number;
  paidCount: number;
  paymentCount: number;
  revokedCount: number;
  unpaidCount: number;
};
⋮----
export type SinglePaymentState = {
  [key: string]:
    | RemoteValue<PaymentInfoResponse, MessagePaymentError>
    | undefined;
};
⋮----
const initialPaymentStatistics = (paymentCount: number): PaymentStatistics => (
⋮----
export const paymentsReducer = (
  state: MultiplePaymentState = initialState,
  action: Action
): MultiplePaymentState =>
⋮----
export const shouldRetrievePaymentDataSelector = (
  state: GlobalState,
  messageId: string,
  paymentId: string
)
⋮----
export const paymentStatusForUISelector = (
  state: GlobalState,
  messageId: string,
  paymentId: string
): RemoteValue<PaymentInfoResponse, MessagePaymentError> =>
⋮----
export const isUserSelectedPaymentSelector = (
  state: GlobalState,
  rptId: string
)
⋮----
export const userSelectedPaymentRptIdSelector = (
  state: GlobalState,
  messageOrUndefined: UIMessageDetails | undefined
) =>
⋮----
export const canNavigateToPaymentFromMessageSelector = (state: GlobalState)
⋮----
export const paymentsButtonStateSelector = (
  state: GlobalState,
... (28 lines truncated)
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/thirdPartyById.ts">
import { HasPreconditionEnum } from "@io-app/api-types/generated/definitions/communication/HasPrecondition";
import { RemoteContentDetails } from "@io-app/api-types/generated/definitions/communication/RemoteContentDetails";
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
⋮----
import { FiscalCode } from "@pagopa/ts-commons/lib/strings";
import _ from "lodash";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { IndexedById } from "../../../../store/helpers/indexer";
import {
  toError,
  toLoading,
  toSome
} from "../../../../store/reducers/IndexedByIdPot";
import { GlobalState } from "../../../../store/reducers/types";
import { isTestEnv } from "../../../../utils/environment";
import { toUndefinedOptional } from "../../../../utils/pot";
import {
  populateStoresWithEphemeralAarMessageData,
  terminateAarFlow
} from "../../../pn/aar/store/actions";
import { UIMessageDetails } from "../../types";
import { ThirdPartyMessageUnion } from "../../types/thirdPartyById";
import { extractContentFromMessageSources } from "../../utils";
import { loadThirdPartyMessage, reloadAllMessages } from "../actions";
⋮----
export type ThirdPartyById = IndexedById<
  pot.Pot<ThirdPartyMessageUnion, Error>
>;
⋮----
export const thirdPartyByIdReducer = (
  state: ThirdPartyById = initialState,
  action: Action
): ThirdPartyById =>
⋮----
export const thirdPartyFromIdSelector = (
  state: GlobalState,
  ioMessageId: string
)
⋮----
export const thirdPartyMessageSelector = (
  state: GlobalState,
  ioMessageId: string
) =>
⋮----
export const messageTitleSelector = (state: GlobalState, ioMessageId: string)
⋮----
export const messageMarkdownSelector = (
  state: GlobalState,
  ioMessageId: string
)
⋮----
export const hasAttachmentsSelector = (
  state: GlobalState,
  ioMessageId: string
)
⋮----
export const thirdPartyMessageAttachmentsSelector = (
  state: GlobalState,
  ioMessageId: string
): ReadonlyArray<ThirdPartyAttachment> =>
⋮----
const messageContentSelector = <T>(
  state: GlobalState,
  ioMessageId: string,
  extractionFunction: (input: RemoteContentDetails | UIMessageDetails) => T
) =>
</file>

<file path="apps/main-app/ts/features/messages/store/reducers/transformers.ts">
import { CreatedMessageWithContentAndAttachments } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndAttachments";
import { EnrichedMessage } from "@io-app/api-types/generated/definitions/communication/EnrichedMessage";
import { MessageCategory } from "@io-app/api-types/generated/definitions/communication/MessageCategory";
import { TagEnum } from "@io-app/api-types/generated/definitions/communication/MessageCategoryBase";
import { MessageStatusAttributes } from "@io-app/api-types/generated/definitions/communication/MessageStatusAttributes";
import { PublicMessage } from "@io-app/api-types/generated/definitions/communication/PublicMessage";
⋮----
import {
  EUCovidCertificate,
  PaymentData,
  UIMessage,
  UIMessageDetails
} from "../../types";
⋮----
export const toUIMessage = (
  messageFromApi: CreatedMessageWithContentAndAttachments | PublicMessage
): UIMessage =>
⋮----
const getPaymentData = ({
  payment_data
}: CreatedMessageWithContentAndAttachments["content"]):
  | PaymentData
  | undefined => {
if (payment_data)
⋮----
const getEUCovidCertificate = ({
  eu_covid_cert
}: CreatedMessageWithContentAndAttachments["content"]):
  | EUCovidCertificate
  | undefined => {
if (eu_covid_cert)
⋮----
export const toUIMessageDetails = (
  messageFromApi: CreatedMessageWithContentAndAttachments
): UIMessageDetails =>
</file>

<file path="apps/main-app/ts/features/messages/types/__test__/paymentErrors.test.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
⋮----
import { remoteError } from "../../../../common/model/RemoteValue";
import {
  isMessagePaymentGenericError,
  isMessagePaymentSpecificError,
  isMessagePaymentTimeoutError,
  isTimeoutOrGenericOrOngoingPaymentError,
  MessagePaymentError,
  toGenericMessagePaymentError,
  toSpecificMessagePaymentError,
  toTimeoutMessagePaymentError
} from "../paymentErrors";
</file>

<file path="apps/main-app/ts/features/messages/types/attachmentCategory.ts">

</file>

<file path="apps/main-app/ts/features/messages/types/index.ts">
import { MessageBodyMarkdown } from "@io-app/api-types/generated/definitions/communication/MessageBodyMarkdown";
import { MessageCategory } from "@io-app/api-types/generated/definitions/communication/MessageCategory";
import { OrganizationFiscalCode } from "@io-app/api-types/generated/definitions/communication/OrganizationFiscalCode";
import { PaymentAmount } from "@io-app/api-types/generated/definitions/communication/PaymentAmount";
import { PaymentNoticeNumber } from "@io-app/api-types/generated/definitions/communication/PaymentNoticeNumber";
import { TimeToLiveSeconds } from "@io-app/api-types/generated/definitions/communication/TimeToLiveSeconds";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
export type EUCovidCertificate = { authCode: string };
⋮----
export type PaymentData = {
  amount: PaymentAmount;
  invalidAfterDueDate?: boolean;
  noticeNumber: PaymentNoticeNumber;
  payee: {
    fiscalCode: OrganizationFiscalCode;
  };
};
⋮----
export type UIMessage = {
  category: MessageCategory;
  createdAt: Date;
  hasPrecondition: boolean;
  id: string;
  isArchived: boolean;
  isRead: boolean;
  organizationFiscalCode: string;
  organizationName: string;
  serviceId: ServiceId;
  serviceName: string;
  timeToLive?: TimeToLiveSeconds;
  title: string;
};
⋮----
export type UIMessageDetails = {
  dueDate?: Date;
  euCovidCertificate?: EUCovidCertificate;
  hasRemoteContent: boolean;
  hasThirdPartyData: boolean;
  id: string;
  markdown: MessageBodyMarkdown;
  paymentData?: PaymentData;
  serviceId: ServiceId;
  subject: string;
};
</file>

<file path="apps/main-app/ts/features/messages/types/messageListCategory.ts">
export type MessageListCategory = "ARCHIVE" | "INBOX";
</file>

<file path="apps/main-app/ts/features/messages/types/paymentErrors.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
⋮----
import { isError, RemoteValue } from "../../../common/model/RemoteValue";
import { isOngoingPaymentFromDetailV2Enum } from "../../../utils/payment";
⋮----
export type MessagePaymentError =
  | MessagePaymentGenericError
  | MessagePaymentSpecificError
  | MessagePaymentTimeoutError;
export type MessagePaymentGenericError = { message: string; type: "generic" };
export type MessagePaymentSpecificError = {
  details: PaymentFaultV2Enum;
  type: "specific";
};
export type MessagePaymentTimeoutError = { type: "timeout" };
⋮----
export const isMessagePaymentGenericError = (
  error: MessagePaymentError
): error is MessagePaymentGenericError
export const isMessagePaymentSpecificError = (
  error: MessagePaymentError
): error is MessagePaymentSpecificError
export const isMessagePaymentTimeoutError = (
  error: MessagePaymentError
): error is MessagePaymentTimeoutError
⋮----
export const isTimeoutOrGenericOrOngoingPaymentError = (
  input: RemoteValue<unknown, MessagePaymentError>
)
⋮----
export const toGenericMessagePaymentError = (
  message: string
): MessagePaymentError => (
export const toSpecificMessagePaymentError = (
  details: PaymentFaultV2Enum
): MessagePaymentError => (
export const toTimeoutMessagePaymentError = (): MessagePaymentError => (
</file>

<file path="apps/main-app/ts/features/messages/types/thirdPartyById.ts">
import type { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
⋮----
export type EphemeralAarThirdPartyMessage = ThirdPartyMessageWithContent & {
  kind: ThirdPartyKind["AAR"];
  mandateId?: string;
};
export type ThirdPartyMessageUnion =
  | EphemeralAarThirdPartyMessage
  | StandardThirdPartyMessage;
type StandardThirdPartyMessage = ThirdPartyMessageWithContent & {
  kind: ThirdPartyKind["TPM"];
};
⋮----
type ThirdPartyKind = typeof thirdPartyKind;
</file>

<file path="apps/main-app/ts/features/messages/utils/attachments.ts">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { Paths } from "expo-file-system";
⋮----
import { apiUrlPrefix } from "../../../config";
⋮----
export const toFileUri = (path: string)
⋮----
export const pdfSavePath = (
  messageId: string,
  attachmentId: string,
  name: string
) =>
⋮----
export const attachmentDisplayName = (attachment: ThirdPartyAttachment)
export const attachmentContentType = (attachment: ThirdPartyAttachment)
export const attachmentDownloadUrl = (
  messageId: string,
  attachment: ThirdPartyAttachment
)
⋮----
/^\//g, // note that attachmentUrl might contain a / at the beginning, so let's strip it
⋮----
export const restrainRetryAfterIntervalInMilliseconds = (
  input: number,
  upperBoundSeconds = 24
) =>
⋮----
export const getHeaderValueByKey = (
  headers: Record<string, string>,
  key: string
) =>
</file>

<file path="apps/main-app/ts/features/messages/utils/convertDateToWordDistance.ts">
import { differenceInCalendarDays } from "date-fns";
import I18n from "i18next";
⋮----
import { dateToAccessibilityReadableFormat } from "../../../utils/accessibility";
import { format, formatDateAsLocal } from "../../../utils/dates";
⋮----
export function convertDateToWordDistance(
  date: Date,
  lastDayLabel: string,
  invalidDateLabel?: string,
  todayAtLabel?: string
): string
⋮----
export const convertReceivedDateToAccessible = (date: Date) =>
</file>

<file path="apps/main-app/ts/features/messages/utils/ctas.ts">
import { MessageBodyMarkdown } from "@io-app/api-types/generated/definitions/communication/MessageBodyMarkdown";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ServiceMetadata } from "@io-app/api-types/generated/definitions/services/ServiceMetadata";
import FM, { FrontMatterResult } from "front-matter";
import { Linking } from "react-native";
⋮----
import {
  deriveCustomHandledLink,
  isIoInternalLink
} from "../../../components/ui/Markdown/handlers/link";
import { localeFallback } from "../../../i18n";
import {
  CTA,
  CTAS,
  LocalizedCTALocales,
  LocalizedCTAs
} from "../../../types/LocalizedCTAs";
import { isTestEnv } from "../../../utils/environment";
import {
  getInternalRoute,
  handleInternalLink
} from "../../../utils/internalLink";
import { getLocalePrimaryWithFallback } from "../../../utils/locale";
import { isFIMSLink } from "../../fims/singleSignOn/utils";
import { trackCTAFrontMatterDecodingError } from "../analytics";
⋮----
export const handleCtaAction = (
  cta: CTA,
  linkTo: (path: string) => void,
  fimsCallback: (label: string, url: string) => void
) =>
⋮----
export const getRemoteLocale = (): LocalizedCTALocales =>
⋮----
export const getMessageCTAs = (
  markdown: MessageBodyMarkdown | string,
  serviceId: ServiceId
): CTAS | undefined
⋮----
export const getServiceCTAs = (
  serviceId: ServiceId,
  serviceMetadata?: ServiceMetadata
): CTAS | undefined =>
⋮----
export const removeCTAsFromMarkdown = (
  markdownText: MessageBodyMarkdown | string,
  serviceId: ServiceId
) =>
⋮----
const getCTAsIfValid = (
  frontMatterText: string | undefined,
  serviceId: ServiceId
): CTAS | undefined =>
⋮----
export const localizedCTAsFromFrontMatter = (
  frontMatterText: string | undefined,
  serviceId: ServiceId
): LocalizedCTAs | undefined =>
⋮----
export const ctasFromLocalizedCTAs = (
  localizedCTAs: LocalizedCTAs | undefined,
  serviceId: ServiceId
): CTAS | undefined =>
⋮----
const areCTAsActionsValid = (ctas: CTAS, serviceId: ServiceId): boolean =>
⋮----
const isCtaActionValid = (cta: CTA): boolean =>
⋮----
type FrontMatterParseResult<T> =
  | { frontMatter: FrontMatterResult<T>; status: "success" }
  | { status: "failure" }
  | { status: "no-header" };
⋮----
const parseFrontMatter = <T>(
  input: string,
  serviceId: ServiceId
): FrontMatterParseResult<T> =>
</file>

<file path="apps/main-app/ts/features/messages/utils/index.ts">
import { RemoteContentDetails } from "@io-app/api-types/generated/definitions/communication/RemoteContentDetails";
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { RptIdFromString } from "@pagopa/io-pagopa-commons/lib/pagopa";
⋮----
import { pipe } from "fp-ts/lib/function";
import { Dispatch } from "redux";
⋮----
import NavigationService from "../../../navigation/NavigationService";
import ROUTES from "../../../navigation/routes";
import { Action } from "../../../store/actions/types";
import {
  getNetworkError,
  isTimeoutError,
  NetworkError
} from "../../../utils/errors";
import { startPaymentFlowWithRptIdWorkaround } from "../../payments/checkout/tempWorkaround/pagoPaPaymentWorkaround";
import { addUserSelectedPaymentRptId } from "../store/actions";
import { PaymentData, UIMessage, UIMessageDetails } from "../types";
⋮----
const networkErrorToError = (networkError: NetworkError)
⋮----
export const errorToReason = (error: Error)
⋮----
export const unknownToReason = (e: unknown)
⋮----
export enum SendFailureReason {
  BAD_FORMAT = "BAD_FORMAT",
  DECODE_ERROR = "DECODE_ERROR",
  HTTP_STATUS_ERROR = "HTTP_STATUS_ERROR",
  MALFORMED_RESPONSE = "MALFORMED_RESPONSE",
  NETWORK_ERROR = "NETWORK_ERROR",
  RATE_LIMITED = "RATE_LIMITED",
  SESSION_EXPIRED = "SESSION_EXPIRED",
  TIMEOUT = "TIMEOUT"
}
⋮----
export type DecodableSendFailure =
  | { error: unknown; kind: "caught" }
  | { kind: "http_status"; status: number };
⋮----
export const decodeSendFailureReason = (
  failure: DecodableSendFailure
): SendFailureReason =>
⋮----
export class WrappedSendError extends Error
⋮----
constructor(
    public readonly reason: SendFailureReason,
    message: string
)
⋮----
export const getRptIdStringFromPaymentData = (
  paymentData: PaymentData
): string => `$
⋮----
export const initializeAndNavigateToWalletForPayment = (
  paymentId: string,
  shouldUpdateAgainAfterPaymentProcedure: boolean,
  canNavigateToPayment: boolean,
  dispatch: Dispatch<Action>,
  analyticsCallback: (() => void) | undefined,
  decodeErrorCallback: (() => void) | undefined,
  preNavigationCallback: (() => void) | undefined = undefined
) =>
⋮----
export const duplicateSetAndAdd = <T>(inputSet: Set<T>, item: T) =>
⋮----
export const duplicateSetAndRemove = <T>(inputSet: Set<T>, item: T) =>
⋮----
export const duplicateSetAndToggle = <A>(inputSet: Set<A>, id: A)
⋮----
export const extractContentFromMessageSources = <T>(
  extractionFunction: (input: RemoteContentDetails | UIMessageDetails) => T,
  messageDetails: UIMessageDetails | undefined,
  thirdPartyMessage: ThirdPartyMessageWithContent | undefined
): T | undefined =>
</file>

<file path="apps/main-app/ts/features/messages/utils/responseHandling.ts">
import { IResponseType } from "@pagopa/ts-commons/lib/requests";
⋮----
import { ValidationError } from "io-ts";
⋮----
import { Action } from "../../../store/actions/types";
import { readablePrivacyReport } from "../../../utils/reporters";
⋮----
export type ResponseType<T> =
  | IResponseType<200, T>
  | IResponseType<
      400 | 401 | 403 | 404 | 429 | 500,
      undefined | { title?: string }
    >;
⋮----
export function handleResponse<T>(
  response: E.Either<Array<ValidationError>, ResponseType<T>>,
  onSuccess: (payload: T) => Action,
  onFailure: (e: Error) => Action
): Action | undefined
</file>

<file path="apps/main-app/ts/features/messages/utils/strings.ts">
import { PaymentNoticeStatus } from "@io-app/design-system";
import I18n from "i18next";
⋮----
export const getBadgeTextByPaymentNoticeStatus = (
  paymentNoticeStatus: Exclude<PaymentNoticeStatus, "default">
): string =>
</file>

<file path="apps/main-app/ts/features/messages/utils/testUtils.tsx">
import { NavigationContext } from "@react-navigation/native";
import { render } from "@testing-library/react-native";
import { PropsWithChildren } from "react";
import { Provider } from "react-redux";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../store/actions/application";
import { appReducer } from "../../../store/reducers";
⋮----
export const renderComponentWithStoreAndNavigationContextForFocus = <T,>(
  component: React.ReactElement<T>,
  isFocused: boolean
) =>
⋮----
const Wrapper = ({ children }: PropsWithChildren<any>) => (
    <Provider store={store}>
      {
}
      {}
      <NavigationContext.Provider value={{ ...navContext }}>
        {children}
      </NavigationContext.Provider>
    </Provider>
  );
</file>

<file path="apps/main-app/ts/features/messages/utils/thirdPartyById.ts">
import {
  EphemeralAarThirdPartyMessage,
  thirdPartyKind,
  ThirdPartyMessageUnion
} from "../types/thirdPartyById";
⋮----
export const isEphemeralAarThirdPartyMessage = (
  message: ThirdPartyMessageUnion
): message is EphemeralAarThirdPartyMessage
</file>

<file path="apps/main-app/ts/features/mixpanel/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type MixpanelFeatureActions = ActionType<
  typeof setIsMixpanelInitialized
>;
</file>

<file path="apps/main-app/ts/features/mixpanel/store/reducer/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { setIsMixpanelInitialized } from "../actions";
⋮----
export type MixpanelState = {
  isMixpanelInitialized: boolean;
};
⋮----
export const mixpanelReducer = (
  state = initialMixpanelState,
  action: Action
): MixpanelState =>
</file>

<file path="apps/main-app/ts/features/mixpanel/store/selectors/index.ts">
import { GlobalState } from "../../../../store/reducers/types";
⋮----
export const isMixpanelInitializedSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/onboarding/hooks/__test__/useOnbardingAbortAlert.test.ts">
import { Alert } from "react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import { abortOnboarding } from "../../store/actions";
import { useOnboardingAbortAlert } from "../useOnboardingAbortAlert";
⋮----
const renderHook = (callback?: () => void) =>
⋮----
const Component = () =>
</file>

<file path="apps/main-app/ts/features/onboarding/hooks/useOnboardingAbortAlert.ts">
import I18n from "i18next";
import { useCallback } from "react";
import { Alert } from "react-native";
⋮----
import { useIODispatch } from "../../../store/hooks";
import { abortOnboarding } from "../store/actions";
⋮----
type OnboardingAbortAlertUtils = {
  showAlert: (callback?: () => void) => void;
};
⋮----
export const useOnboardingAbortAlert = (): OnboardingAbortAlertUtils =>
</file>

<file path="apps/main-app/ts/features/onboarding/navigation/__test__/OnboardingNavigator.test.tsx">
import { InitialState, NavigationContainer } from "@react-navigation/native";
import { render } from "@testing-library/react-native";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
⋮----
import ROUTES from "../../../../navigation/routes";
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { GlobalState } from "../../../../store/reducers/types";
import OnboardingNavigator from "../OnboardingNavigator";
⋮----
const createMockStore = () =>
⋮----
const renderComponent = (initialState?: InitialState) =>
</file>

<file path="apps/main-app/ts/features/onboarding/navigation/params/OnboardingParamsList.ts">
import ROUTES from "../../../../navigation/routes";
import { OnboardingNotificationsPreferencesScreenNavigationParams } from "../../../pushNotifications/screens/OnboardingNotificationsPreferencesScreen";
import { EmailInsertScreenNavigationParams } from "../../../settings/userData/shared/screens/EmailInsertScreen";
import { SendEmailValidationScreenProp } from "../../../settings/userData/shared/screens/EmailValidationSendEmailScreen";
import { OnboardingServicesPreferenceScreenNavigationParams } from "../../screens/OnboardingServicesPreferenceScreen";
⋮----
export type OnboardingParamsList = {
  [ROUTES.ONBOARDING_COMPLETED]: undefined;
  [ROUTES.ONBOARDING_EMAIL_VERIFICATION_SCREEN]: SendEmailValidationScreenProp;
  [ROUTES.ONBOARDING_FINGERPRINT]: undefined;
  [ROUTES.ONBOARDING_INSERT_EMAIL_SCREEN]: EmailInsertScreenNavigationParams;
  [ROUTES.ONBOARDING_MISSING_DEVICE_BIOMETRIC]: undefined;
  [ROUTES.ONBOARDING_MISSING_DEVICE_PIN]: undefined;
  [ROUTES.ONBOARDING_NOTIFICATIONS_INFO_SCREEN_CONSENT]: undefined;
  [ROUTES.ONBOARDING_NOTIFICATIONS_PREFERENCES]: OnboardingNotificationsPreferencesScreenNavigationParams;
  [ROUTES.ONBOARDING_PIN]: undefined;
  [ROUTES.ONBOARDING_SERVICES_PREFERENCE]: OnboardingServicesPreferenceScreenNavigationParams;
  [ROUTES.ONBOARDING_SERVICES_PREFERENCE_COMPLETE]: undefined;
  [ROUTES.ONBOARDING_SHARE_DATA]: undefined;
  [ROUTES.ONBOARDING_TOS]: undefined;
};
</file>

<file path="apps/main-app/ts/features/onboarding/navigation/OnboardingNavigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import ROUTES from "../../../navigation/routes";
import { isGestureEnabled } from "../../../utils/navigation";
import { OnboardingNotificationsInfoScreenConsent } from "../../pushNotifications/screens/OnboardingNotificationsInfoScreenConsent";
import { OnboardingNotificationsPreferencesScreen } from "../../pushNotifications/screens/OnboardingNotificationsPreferencesScreen";
import EmailInsertScreen from "../../settings/userData/shared/screens/EmailInsertScreen";
import EmailValidationSendEmailScreen from "../../settings/userData/shared/screens/EmailValidationSendEmailScreen";
import FingerprintScreen from "../screens/biometric&securityChecks/FingerprintScreen";
import MissingDeviceBiometricScreen from "../screens/biometric&securityChecks/MissingDeviceBiometricScreen";
import MissingDevicePinScreen from "../screens/biometric&securityChecks/MissingDevicePinScreen";
import OnboardingCompletedScreen from "../screens/OnboardingCompletedScreen";
import OnboardingPinScreen from "../screens/OnboardingPinScreen";
import OnboardingServicesPreferenceScreen from "../screens/OnboardingServicesPreferenceScreen";
import OnboardingShareDataScreen from "../screens/OnboardingShareDataScreen";
import OnboardingTosScreen from "../screens/OnboardingTosScreen";
import ServicePreferenceCompleteScreen from "../screens/ServicePreferenceCompleteScreen";
import { OnboardingParamsList } from "./params/OnboardingParamsList";
⋮----
const OnboardingNavigator = () => (
  <Stack.Navigator
    initialRouteName={ROUTES.ONBOARDING_SHARE_DATA}
    screenOptions={{ gestureEnabled: isGestureEnabled, headerMode: "screen" }}
  >
    <Stack.Screen
      component={OnboardingShareDataScreen}
      name={ROUTES.ONBOARDING_SHARE_DATA}
    />
    <Stack.Screen
      component={OnboardingServicesPreferenceScreen}
      name={ROUTES.ONBOARDING_SERVICES_PREFERENCE}
    />
    <Stack.Screen
      component={ServicePreferenceCompleteScreen}
      name={ROUTES.ONBOARDING_SERVICES_PREFERENCE_COMPLETE}
      options={{ headerShown: false }}
    />
    <Stack.Screen
      component={OnboardingTosScreen}
      name={ROUTES.ONBOARDING_TOS}
      options={{ headerShown: true }}
    />
    <Stack.Screen
      component={OnboardingPinScreen}
      name={ROUTES.ONBOARDING_PIN}
    />
    <Stack.Screen
      component={FingerprintScreen}
      name={ROUTES.ONBOARDING_FINGERPRINT}
      options={{ headerShown: false }}
    />
    <Stack.Screen
      component={MissingDevicePinScreen}
      name={ROUTES.ONBOARDING_MISSING_DEVICE_PIN}
      options={{ headerShown: false }}
    />
    <Stack.Screen
      component={MissingDeviceBiometricScreen}
      name={ROUTES.ONBOARDING_MISSING_DEVICE_BIOMETRIC}
      options={{ headerShown: false }}
    />
    <Stack.Screen
      component={EmailInsertScreen}
      name={ROUTES.ONBOARDING_INSERT_EMAIL_SCREEN}
      options={{ gestureEnabled: false }}
    />
    <Stack.Screen
      component={EmailValidationSendEmailScreen}
      name={ROUTES.ONBOARDING_EMAIL_VERIFICATION_SCREEN}
      options={{ gestureEnabled: false, headerShown: false }}
    />
    <Stack.Screen
      component={OnboardingCompletedScreen}
      name={ROUTES.ONBOARDING_COMPLETED}
      options={{ headerShown: false }}
    />
    <Stack.Screen
      component={OnboardingNotificationsPreferencesScreen}
      name={ROUTES.ONBOARDING_NOTIFICATIONS_PREFERENCES}
    />
    <Stack.Group
      screenOptions={{
        gestureEnabled: false,
        headerShown: false,
        presentation: "modal"
      }}
    >
      <Stack.Screen
        component={OnboardingNotificationsInfoScreenConsent}
        name={ROUTES.ONBOARDING_NOTIFICATIONS_INFO_SCREEN_CONSENT}
      />
    </Stack.Group>
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/features/onboarding/saga/__test__/watchAbortOnboardingSaga.test.ts">
import { testSaga } from "redux-saga-test-plan";
⋮----
import { startApplicationInitialization } from "../../../../store/actions/application";
import { deletePin } from "../../../../utils/keychain";
import { sessionInvalid } from "../../../authentication/common/store/actions";
import { watchAbortOnboardingSaga } from "../../saga/watchAbortOnboardingSaga";
import { abortOnboarding } from "../../store/actions";
</file>

<file path="apps/main-app/ts/features/onboarding/saga/biometric/__test__/biometricStateSagas.test.ts">
import { testSaga } from "redux-saga-test-plan";
⋮----
import { preferenceFingerprintIsEnabledSaveSuccess } from "../../../../../store/actions/persistedPreferences";
import {
  handleBiometricAvailable,
  handleBiometricNotSupported,
  hanldeBiometricNotEnrolled,
  hanldeMissingDevicePin
} from "../biometricStateSagas";
</file>

<file path="apps/main-app/ts/features/onboarding/saga/biometric/__test__/checkAcknowledgedFingerprintSaga.test.ts">
import { testSaga } from "redux-saga-test-plan";
⋮----
import { fingerprintAcknowledged } from "../../../../../features/onboarding/store/actions";
import { isFingerprintAcknowledgedSelector } from "../../../../../features/onboarding/store/selectors";
import { isFingerprintEnabledSelector } from "../../../../../store/reducers/persistedPreferences";
import { getBiometricState } from "../../../../../utils/biometrics";
import { isScreenLockSet } from "../../../../../utils/device";
import {
  handleBiometricAvailable,
  handleBiometricNotSupported,
  hanldeBiometricNotEnrolled,
  hanldeMissingDevicePin
} from "../biometricStateSagas";
import {
  checkAcknowledgedFingerprintSaga,
  testable
} from "../checkAcknowledgedFingerprintSaga";
</file>

<file path="apps/main-app/ts/features/onboarding/saga/biometric/biometricStateSagas.ts">
import { CommonActions, StackActions } from "@react-navigation/native";
import { call, put, take } from "typed-redux-saga/macro";
⋮----
import NavigationService from "../../../../navigation/NavigationService";
import ROUTES from "../../../../navigation/routes";
import { preferenceFingerprintIsEnabledSaveSuccess } from "../../../../store/actions/persistedPreferences";
⋮----
const buildBiometricNavigator = (route: string)
⋮----
const removeBiometricScreen = ()
</file>

<file path="apps/main-app/ts/features/onboarding/saga/biometric/checkAcknowledgedFingerprintSaga.ts">
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { fingerprintAcknowledged } from "../../../../features/onboarding/store/actions";
import { isFingerprintAcknowledgedSelector } from "../../../../features/onboarding/store/selectors";
import { isFingerprintEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { ReduxSagaEffect } from "../../../../types/utils";
import { getBiometricState } from "../../../../utils/biometrics";
import { isScreenLockSet } from "../../../../utils/device";
import { isDevEnv } from "../../../../utils/environment";
import {
  handleBiometricAvailable,
  handleBiometricNotSupported,
  hanldeBiometricNotEnrolled,
  hanldeMissingDevicePin
} from "./biometricStateSagas";
</file>

<file path="apps/main-app/ts/features/onboarding/saga/completeOnboardingSaga.ts">
import { CommonActions, StackActions } from "@react-navigation/native";
import { call, take } from "typed-redux-saga/macro";
⋮----
import NavigationService from "../../../navigation/NavigationService";
import ROUTES from "../../../navigation/routes";
import { completeOnboarding } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/onboarding/saga/watchAbortOnboardingSaga.ts">
import { call, put, take } from "typed-redux-saga/macro";
⋮----
import { startApplicationInitialization } from "../../../store/actions/application";
import { ReduxSagaEffect } from "../../../types/utils";
import { deletePin } from "../../../utils/keychain";
import { trackLoginUserExit } from "../../authentication/common/analytics";
import { sessionInvalid } from "../../authentication/common/store/actions";
import { abortOnboarding } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/onboarding/screens/biometric&securityChecks/__test__/FingerprintScreen.test.tsx">
import { fireEvent, waitFor } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import ROUTES from "../../../../../navigation/routes";
import { applicationChangeState } from "../../../../../store/actions/application";
import { preferenceFingerprintIsEnabledSaveSuccess } from "../../../../../store/actions/persistedPreferences";
⋮----
import { appReducer } from "../../../../../store/reducers";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
⋮----
import FingerprintScreen from "../FingerprintScreen";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/onboarding/screens/biometric&securityChecks/__test__/MissingDeviceBiometricScreen.test.tsx">
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import ROUTES from "../../../../../navigation/routes";
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import MissingDeviceBiometricScreen from "../MissingDeviceBiometricScreen";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/onboarding/screens/biometric&securityChecks/__test__/MissingDevicePinScreen.test.tsx">
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import ROUTES from "../../../../../navigation/routes";
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import MissingDevicePinScreen from "../MissingDevicePinScreen";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/onboarding/screens/biometric&securityChecks/analytics/index.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { buildEventProperties, FlowType } from "../../../../../utils/analytics";
⋮----
export function trackBiometricActivationEducationalScreen(flow: FlowType)
⋮----
export function trackBiometricConfigurationEducationalScreen(flow: FlowType)
⋮----
export function trackPinEducationalScreen(flow: FlowType)
</file>

<file path="apps/main-app/ts/features/onboarding/screens/biometric&securityChecks/FingerprintScreen.tsx">
import { Banner, Body, H2, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps, useMemo } from "react";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { preferenceFingerprintIsEnabledSaveSuccess } from "../../../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { getFlowType } from "../../../../utils/analytics";
import {
  BiometriActivationUserType,
  mayUserActivateBiometric
} from "../../../../utils/biometrics";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { isProfileFirstOnBoardingSelector } from "../../../settings/common/store/selectors";
import {
  trackBiometricActivationAccepted,
  trackBiometricActivationDeclined
} from "../../../settings/security/shared/analytics";
import { useOnboardingAbortAlert } from "../../hooks/useOnboardingAbortAlert";
import { trackBiometricActivationEducationalScreen } from "./analytics";
⋮----
type IOScrollViewActions = ComponentProps<typeof IOScrollView>["actions"];
⋮----
const FingerprintScreen = () =>
</file>

<file path="apps/main-app/ts/features/onboarding/screens/biometric&securityChecks/MissingDeviceBiometricScreen.tsx">
import { ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
⋮----
import { IOScrollViewActions } from "../../../../components/ui/IOScrollView";
import { IOScrollViewWithListItems } from "../../../../components/ui/IOScrollViewWithListItems";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { preferenceFingerprintIsEnabledSaveSuccess } from "../../../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { getFlowType } from "../../../../utils/analytics";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { isProfileFirstOnBoardingSelector } from "../../../settings/common/store/selectors";
import { useOnboardingAbortAlert } from "../../hooks/useOnboardingAbortAlert";
import { trackBiometricConfigurationEducationalScreen } from "./analytics";
⋮----
const MissingDeviceBiometricScreen = () =>
</file>

<file path="apps/main-app/ts/features/onboarding/screens/biometric&securityChecks/MissingDevicePinScreen.tsx">
import { ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
import { Platform } from "react-native";
⋮----
import { IOScrollViewActions } from "../../../../components/ui/IOScrollView";
import { IOScrollViewWithListItems } from "../../../../components/ui/IOScrollViewWithListItems";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { preferenceFingerprintIsEnabledSaveSuccess } from "../../../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { getFlowType } from "../../../../utils/analytics";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { isProfileFirstOnBoardingSelector } from "../../../settings/common/store/selectors";
import { useOnboardingAbortAlert } from "../../hooks/useOnboardingAbortAlert";
import { trackPinEducationalScreen } from "./analytics";
⋮----
const MissingDevicePinScreen = () =>
</file>

<file path="apps/main-app/ts/features/onboarding/screens/OnboardingCompletedScreen.tsx">
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { getFlowType } from "../../../utils/analytics";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { trackLoginEnded } from "../../authentication/common/analytics";
import { loggedInIdpSelector } from "../../authentication/common/store/selectors";
import { isFastLoginEnabledSelector } from "../../authentication/fastLogin/store/selectors";
import { trackThankYouPageScreen } from "../../settings/common/analytics";
import { completeOnboarding } from "../store/actions";
⋮----
const OnboardingCompletedScreen = () =>
⋮----
const handleContinue = () =>
</file>

<file path="apps/main-app/ts/features/onboarding/screens/OnboardingPinScreen.tsx">
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { PinCreation } from "../../settings/security/shared/components/PinCreation";
⋮----
const OnboardingPinScreen = () => (
  <SafeAreaView edges={["bottom"]} style={{ flex: 1 }}>
    <PinCreation isOnboarding />
  </SafeAreaView>
);
</file>

<file path="apps/main-app/ts/features/onboarding/screens/OnboardingServicesPreferenceScreen.tsx">
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
import {
  Banner,
  ContentWrapper,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { ReactElement, useCallback, useEffect, useState } from "react";
⋮----
import LoadingSpinnerOverlay from "../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../components/ui/IOScrollViewWithLargeHeader";
import {
  IOStackNavigationRouteProps,
  useIONavigation
} from "../../../navigation/params/AppParamsList";
import ROUTES from "../../../navigation/routes";
import { useIODispatch, useIOSelector, useIOStore } from "../../../store/hooks";
import { getFlowType } from "../../../utils/analytics";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { usePrevious } from "../../../utils/hooks/usePrevious";
import {
  trackServiceConfiguration,
  trackServiceConfigurationScreen
} from "../../settings/common/analytics";
import { profileUpsert } from "../../settings/common/store/actions";
import {
  profileSelector,
  profileServicePreferencesModeSelector
} from "../../settings/common/store/selectors";
import { isServicesPreferenceModeSet } from "../../settings/common/store/utils/guards";
import ServicesContactComponent from "../../settings/preferences/shared/components/ServicesContactComponent";
import { useManualConfigBottomSheet } from "../../settings/preferences/shared/hooks/useManualConfigBottomSheet";
import { OnboardingParamsList } from "../navigation/params/OnboardingParamsList";
import { servicesOptinCompleted } from "../store/actions";
⋮----
export type OnboardingServicesPreferenceScreenNavigationParams = {
  isFirstOnboarding: boolean;
};
type Props = IOStackNavigationRouteProps<
  OnboardingParamsList,
  "ONBOARDING_SERVICES_PREFERENCE"
>;
</file>

<file path="apps/main-app/ts/features/onboarding/screens/OnboardingShareDataScreen.tsx">
import { Banner, ContentWrapper, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { ReactElement, useCallback, useMemo } from "react";
⋮----
import { IOScrollViewActions } from "../../../components/ui/IOScrollView";
import { IOScrollViewWithLargeHeader } from "../../../components/ui/IOScrollViewWithLargeHeader";
import { setMixpanelEnabled } from "../../../store/actions/mixpanel";
import { useIODispatch, useIOSelector, useIOStore } from "../../../store/hooks";
import { getFlowType } from "../../../utils/analytics";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { trackMixpanelScreen } from "../../settings/common/analytics";
import {
  TrackingInfo,
  trackMixpanelDeclined,
  trackMixpanelNotNowSelected,
  trackMixpanelSetEnabled,
  trackMixPanelTrackingInfo
} from "../../settings/common/analytics/mixpanel/mixpanelAnalytics";
import { isProfileFirstOnBoardingSelector } from "../../settings/common/store/selectors";
import { ShareDataComponent } from "../../settings/privacy/shared/components/ShareDataComponent";
import { useConfirmOptOutBottomSheet } from "../../settings/privacy/shared/hooks/useConfirmOptOutBottomSheet";
import { useOnboardingAbortAlert } from "../hooks/useOnboardingAbortAlert";
</file>

<file path="apps/main-app/ts/features/onboarding/screens/OnboardingTosScreen.tsx">
import {
  Alert as AlertDS,
  ContentWrapper,
  H2,
  IOToast,
  VSpacer
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { useCallback, useEffect, useState } from "react";
import { Alert } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../components/LoadingSpinnerOverlay";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { useIODispatch, useIOSelector, useIOStore } from "../../../store/hooks";
import { getFlowType } from "../../../utils/analytics";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { trackTosUserExit } from "../../authentication/common/analytics";
import {
  isProfileFirstOnBoardingSelector,
  profileSelector
} from "../../settings/common/store/selectors";
import { isProfileFirstOnBoarding } from "../../settings/common/store/utils/guards";
import {
  trackTosAccepted,
  trackTosScreen
} from "../../settings/privacy/shared/analytics";
import TosWebviewComponent from "../../settings/privacy/shared/components/TosWebviewComponent";
import { tosConfigSelector } from "../../tos/store/selectors";
import { abortOnboarding, tosAccepted } from "../store/actions";
⋮----
const handleLoadEnd = () =>
⋮----
const handleReload = () =>
⋮----
const handleGoBack = ()
</file>

<file path="apps/main-app/ts/features/onboarding/screens/ServicePreferenceCompleteScreen.tsx">
import I18n from "i18next";
import { ReactElement } from "react";
import { connect } from "react-redux";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { Dispatch } from "../../../store/actions/types";
import { GlobalState } from "../../../store/reducers/types";
import { servicesOptinCompleted } from "../store/actions";
⋮----
type Props = ReturnType<typeof mapDispatchToProps> &
  ReturnType<typeof mapStateToProps>;
⋮----
const ServicePreferenceCompleteScreen = (props: Props): ReactElement => (
  <OperationResultScreenContent
    action={{
      label: I18n.t("global.buttons.continue"),
      onPress: props.onContinue
    }}
    pictogram="success"
    subtitle={I18n.t("services.optIn.preferences.completed.body")}
    title={I18n.t("services.optIn.preferences.completed.title")}
  />
);
⋮----
const mapStateToProps = (_: GlobalState) => (
⋮----
const mapDispatchToProps = (dispatch: Dispatch) => (
</file>

<file path="apps/main-app/ts/features/onboarding/store/__test__/index.test.ts">
import { sessionExpired } from "../../../authentication/common/store/actions";
import { fingerprintAcknowledged } from "../actions";
import reducer, { OnboardingState } from "../reducers";
import { isFingerprintAcknowledgedSelector } from "../selectors";
</file>

<file path="apps/main-app/ts/features/onboarding/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type OnboardingActions = ActionType<OnboardingActionTypes>;
⋮----
type OnboardingActionTypes =
  | typeof abortOnboarding
  | typeof completeOnboarding
  | typeof emailAcknowledged
  | typeof emailInsert
  | typeof fingerprintAcknowledged
  | typeof servicesOptinCompleted
  | typeof tosAccepted;
</file>

<file path="apps/main-app/ts/features/onboarding/store/reducers/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { sessionExpired } from "../../../authentication/common/store/actions";
import { fingerprintAcknowledged } from "../actions";
⋮----
export type OnboardingState = Readonly<{
  isFingerprintAcknowledged: boolean;
}>;
⋮----
const reducer = (
  state: OnboardingState = INITIAL_STATE,
  action: Action
): OnboardingState =>
</file>

<file path="apps/main-app/ts/features/onboarding/store/selectors/index.ts">
import { GlobalState } from "../../../../store/reducers/types";
⋮----
export const isFingerprintAcknowledgedSelector = (
  state: GlobalState
): boolean
</file>

<file path="apps/main-app/ts/features/onboarding/README.md">
# Onboarding Feature

## Purpose

This directory encapsulates code related to the application's user onboarding functionality. This includes user registration, initial setup flows, and other mechanisms used to guide new users through the application.

## Rationale (Refactoring Context)

As part of a codebase refactoring initiative, these files were grouped together to:

1. **Improve Cohesion:** Consolidate onboarding logic (UI, state, navigation, services, types, etc.) into one logical location.
2. **Enhance Discoverability:** Make it easier and faster for developers to locate and understand code related to user onboarding.
3. **Simplify Maintenance:** Streamline bug fixing, updates, and future enhancements by isolating onboarding-related code.

## Contents

This feature module typically includes:

- Onboarding-related UI screens.
- State management logic specific to user onboarding (actions, reducers, selectors).
- Utility functions and components used exclusively within the onboarding flows.
- Sagas for handling asynchronous onboarding-related logic.

## Guideline

- All **new** code **strictly** concerning user onboarding functionality (new screens, onboarding-specific logic, state management for onboarding, etc.) should reside directly within this `onboarding` feature module.
- Avoid creating unnecessary subdirectories unless the codebase grows significantly and requires further organization.

## Folder structure

The current folder structure is as follows:

```bash
onboarding/
├── components/ # UI components specific to onboarding
├── screens/    # Screens for onboarding flows
├── store/      # State management (actions, reducers, selectors)
│   ├── actions/
│   ├── reducers/
│   ├── selectors/
├── sagas/      # Asynchronous logic and side effects
├── utils/      # Utility functions specific to onboarding
└── __tests__/  # Unit tests for onboarding logic
```

This structure ensures that all onboarding-related code is organized and easy to navigate.
</file>

<file path="apps/main-app/ts/features/osDismission/components/OsDismissionBanner.tsx">
import { Banner, IODimensions } from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { openWebUrl } from "../../../utils/url";
⋮----
type Props = {
  handleOnClose: () => void;
};
⋮----
const OsDismissionBanner = ({ handleOnClose }: Props) => (
  <View style={styles.margins} testID="osDismissionBannerContainer">
    <Banner
      action={I18n.t("features.osDismission.banner.action")}
      color="neutral"
      content={I18n.t("features.osDismission.banner.body")}
      labelClose={I18n.t("global.buttons.close")}
      onClose={handleOnClose}
onPress=
</file>

<file path="apps/main-app/ts/features/osDismission/store/selectors/index.ts">
import { Platform } from "react-native";
⋮----
import { minOsSupportedSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../store/reducers/types";
⋮----
export const isOsDismissionBannerRenderableSelector = (
  state: GlobalState
): boolean =>
</file>

<file path="apps/main-app/ts/features/pageNotFound/analytics/index.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
⋮----
export const track404ErrorScreen = async () =>
⋮----
export const track404ErrorScreenUpdateAppButton = async () =>
⋮----
export const track404ErrorScreenCloseButton = async () =>
</file>

<file path="apps/main-app/ts/features/pageNotFound/screens/index.tsx">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { openAppStoreUrl } from "../../../utils/url";
import {
  track404ErrorScreen,
  track404ErrorScreenCloseButton,
  track404ErrorScreenUpdateAppButton
} from "../analytics";
</file>

<file path="apps/main-app/ts/features/payments/barcode/components/PaymentNoticeListItem.tsx">
import { ListItemTransaction } from "@io-app/design-system";
import { AmountInEuroCents } from "@pagopa/io-pagopa-commons/lib/pagopa";
import { pipe } from "fp-ts/lib/function";
⋮----
import { toInteger } from "lodash";
⋮----
import { getAccessibleAmountText } from "../../../../utils/accessibility";
import {
  centsToAmount,
  formatNumberAmount
} from "../../../../utils/stringBuilder";
⋮----
type Props = {
  amountInEuroCents: AmountInEuroCents;
  onPress: () => void;
  organizationFiscalCode: string;
  paymentNoticeNumber: string;
};
</file>

<file path="apps/main-app/ts/features/payments/barcode/navigation/navigator.tsx">
import {
  createStackNavigator,
  TransitionPresets
} from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../utils/navigation";
import { PaymentsBarcodeChoiceScreen } from "../screens/PaymentsBarcodeChoiceScreen";
import { PaymentsBarcodeScanScreen } from "../screens/PaymentsBarcodeScanScreen";
import { PaymentsBarcodeParamsList } from "./params";
import { PaymentsBarcodeRoutes } from "./routes";
⋮----
export const WalletBarcodeNavigator = () => (
  <Stack.Navigator
    initialRouteName={PaymentsBarcodeRoutes.PAYMENT_BARCODE_SCAN}
    screenOptions={{ gestureEnabled: isGestureEnabled }}
  >
    <Stack.Screen
      component={PaymentsBarcodeScanScreen}
      name={PaymentsBarcodeRoutes.PAYMENT_BARCODE_SCAN}
      options={{
        ...TransitionPresets.ModalSlideFromBottomIOS,
        headerShown: false,
        gestureEnabled: isGestureEnabled
      }}
    />
    <Stack.Screen
      component={PaymentsBarcodeChoiceScreen}
      name={PaymentsBarcodeRoutes.PAYMENT_BARCODE_CHOICE}
      options={{
        gestureEnabled: isGestureEnabled
      }}
    />
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/features/payments/barcode/navigation/params.ts">
import { PaymentsBarcodeChoiceScreenParams } from "../screens/PaymentsBarcodeChoiceScreen";
import { PaymentsBarcodeRoutes } from "./routes";
⋮----
export type PaymentsBarcodeParamsList = {
  [PaymentsBarcodeRoutes.PAYMENT_BARCODE_CHOICE]: PaymentsBarcodeChoiceScreenParams;
  [PaymentsBarcodeRoutes.PAYMENT_BARCODE_NAVIGATOR]: undefined;
  [PaymentsBarcodeRoutes.PAYMENT_BARCODE_SCAN]: undefined;
};
</file>

<file path="apps/main-app/ts/features/payments/barcode/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/payments/barcode/screens/PaymentsBarcodeChoiceScreen.tsx">
import { Divider } from "@io-app/design-system";
import { PaymentNoticeNumberFromString } from "@pagopa/io-pagopa-commons/lib/pagopa";
import { RouteProp, useFocusEffect, useRoute } from "@react-navigation/native";
⋮----
import { pipe } from "fp-ts/lib/function";
import { contramap } from "fp-ts/lib/Ord";
⋮----
import I18n from "i18next";
import { Fragment, useCallback } from "react";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
⋮----
import { PagoPaBarcode } from "../../../barcode/types/IOBarcode";
import { usePagoPaPayment } from "../../checkout/hooks/usePagoPaPayment";
import { PaymentNoticeListItem } from "../components/PaymentNoticeListItem";
import { PaymentsBarcodeParamsList } from "../navigation/params";
⋮----
type PaymentsBarcodeChoiceScreenParams = {
  barcodes: Array<PagoPaBarcode>;
};
⋮----
const handleBarcodeSelected = (barcode: PagoPaBarcode) =>
⋮----
const renderBarcodeItem = (barcode: PagoPaBarcode) =>
⋮----
{renderBarcodeItem(item)}
          {index <= sortedBarcodes.length - 2 && <Divider />}
        </Fragment>
      ))}
    </IOScrollViewWithLargeHeader>
  );
</file>

<file path="apps/main-app/ts/features/payments/barcode/screens/PaymentsBarcodeScanScreen.tsx">
import { IOToast, triggerHaptic } from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
⋮----
import { pipe } from "fp-ts/lib/function";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { barcodesScannerConfigSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  BarcodeFailure,
  BarcodeScanBaseScreenComponent,
  IOBarcode,
  useIOBarcodeFileReader
} from "../../../barcode";
⋮----
import {
  IO_BARCODE_ALL_FORMATS,
  IOBarcodeFormat,
  IOBarcodeOrigin,
  IOBarcodeType,
  PagoPaBarcode
} from "../../../barcode/types/IOBarcode";
import { usePagoPaPayment } from "../../checkout/hooks/usePagoPaPayment";
import { PaymentsCheckoutRoutes } from "../../checkout/navigation/routes";
import { PaymentsBarcodeRoutes } from "../navigation/routes";
⋮----
const PaymentsBarcodeScanScreen = () =>
⋮----
const handleBarcodeSuccess = (
    barcodes: Array<IOBarcode>,
    origin: IOBarcodeOrigin
) =>
⋮----
const handleBarcodeError = (failure: BarcodeFailure) =>
⋮----
const handleManualInputPressed = () =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/analytics/index.ts">
import { getPeople, mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import {
  PaymentAnalyticsBrowserType,
  PaymentAnalyticsEditingType,
  PaymentAnalyticsPhase,
  PaymentAnalyticsPspFlag,
  PaymentAnalyticsSelectedMethodFlag
} from "../../common/types/PaymentAnalytics";
import { WalletPaymentOutcomeEnum } from "../types/PaymentOutcomeEnum";
import { WalletPaymentFailure } from "../types/WalletPaymentFailure";
⋮----
export type PaymentAnalyticsProps = {
  amount: string;
  attempt: number;
  browser_type: PaymentAnalyticsBrowserType;
  data_entry: string;
  editing: PaymentAnalyticsEditingType;
  expiration_date: string;
  first_time_opening: string;
  is_onboarded: boolean;
  last_used_payment_method: string;
  organization_fiscal_code: string;
  organization_name: string;
  payment_method_selected: string;
  payment_method_selected_flag: PaymentAnalyticsSelectedMethodFlag;
  payment_phase: PaymentAnalyticsPhase;
  preselected_psp_flag: PaymentAnalyticsPspFlag;
  psp_selected: string;
  saved_payment_method: number;
  saved_payment_method_unavailable: number;
  selected_psp_flag: PaymentAnalyticsPspFlag;
  service_name: string;
};
⋮----
const getPaymentAnalyticsEventFromFailureOutcome = (
  outcome: WalletPaymentOutcomeEnum
) =>
⋮----
const getPaymentAnalyticsEventFromRequestFailure = (
  failure: WalletPaymentFailure
) =>
⋮----
export const trackPaymentSummaryLoading = () =>
⋮----
export const trackPaymentSummaryInfoScreen = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentSummaryNoticeCopy = (
  props: Partial<PaymentAnalyticsProps> & { code: string }
) =>
⋮----
export const trackPaymentSummaryAmountInfo = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentMethodSelection = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentMethodSelected = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentBack = (screen: string) =>
⋮----
export const trackPaymentMethodSelectionBackExit = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentMethodSelectionBackContinue = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentMethodVerificaFatalError = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentFeeSelection = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentFeeSelected = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentSummaryScreen = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentSummaryEditing = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentConversion = (
  props: Partial<PaymentAnalyticsProps>
) =>
⋮----
export const trackPaymentOutcomeSuccess = (
... (61 lines truncated)
</file>

<file path="apps/main-app/ts/features/payments/checkout/components/CheckoutPaymentMethodsList.tsx">
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletInfo";
import { WalletStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletStatus";
import { PaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodResponse";
import {
  Alert,
  ListItemHeader,
  RadioGroup,
  RadioItem
} from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import _, { capitalize } from "lodash";
import { useEffect, useMemo, useState } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { centsToAmount } from "../../../../utils/stringBuilder";
import { UIWalletInfoDetails } from "../../common/types/UIWalletInfoDetails";
import { getPaymentLogoFromWalletDetails } from "../../common/utils";
import { selectPaymentMethodAction } from "../store/actions/orchestration";
import { walletPaymentAmountSelector } from "../store/selectors";
import {
  walletPaymentAllMethodsSelector,
  walletPaymentEnabledUserWalletsSelector,
  walletPaymentSelectedPaymentMethodIdOptionSelector,
  walletPaymentSelectedWalletIdOptionSelector,
  walletRecentPaymentMethodSelector
} from "../store/selectors/paymentMethods";
⋮----
const handleSelectUserWallet = (walletId: string)
⋮----
const handleSelectPaymentMethod = (paymentMethodId: string)
⋮----
const handleOnSelectRecentPaymentMethod = (walletId: string)
⋮----
const mapUserWalletToRadioItem = (
  method: WalletInfo
): RadioItem<string> | undefined =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/components/WalletPaymentFailureDetail.tsx">
import { IOToast } from "@io-app/design-system";
import { useNavigation, useRoute } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { trackHelpCenterCtaTapped } from "../../../../utils/analytics";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../utils/url";
import {
  paymentAnalyticsDataSelector,
  selectOngoingPaymentHistory,
  selectPaymentsOngoingFailed
} from "../../history/store/selectors";
⋮----
import { usePaymentFailureSupportModal } from "../hooks/usePaymentFailureSupportModal";
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import { paymentsCalculatePaymentFeesAction } from "../store/actions/networking";
import { paymentCompletedSuccess } from "../store/actions/orchestration";
import { selectWalletPaymentCurrentStep } from "../store/selectors";
import { WalletPaymentFailure } from "../types/WalletPaymentFailure";
import { CHECKOUT_ASSISTANCE_ARTICLE, getPaymentPhaseFromStep } from "../utils";
⋮----
type Props = {
  failure: WalletPaymentFailure;
};
⋮----
const WalletPaymentFailureDetail = (
⋮----
const handleClose = () =>
⋮----
const handleContactSupport = () =>
⋮----
const handleChangePaymentMethod = () =>
⋮----
const handleDiscoverMore = () =>
⋮----
const getPaymentOngoingMinutesToWait = () =>
⋮----
const getPropsFromFailure = ({
    faultCodeCategory,
    faultCodeDetail
}: WalletPaymentFailure): OperationResultScreenContentProps =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/components/WalletPaymentFeedbackBanner.tsx">
import { Banner, VSpacer } from "@io-app/design-system";
import { openAuthSessionAsync } from "expo-web-browser";
import { useRef } from "react";
import { View } from "react-native";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { useIOSelector } from "../../../../store/hooks";
import {
  isPaymentsFeedbackBannerEnabledSelector,
  paymentsFeedbackBannerConfigSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  fallbackForLocalizedMessageKeys,
  getFullLocale
} from "../../../../utils/locale";
⋮----
const WalletPaymentFeebackBanner = () =>
⋮----
const handleBannerPress = () =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/components/WalletPaymentHeader.tsx">
import {
  HeaderActionProps,
  HeaderSecondLevel,
  Stepper,
  VSpacer
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton";
import { useStartSupportRequest } from "../../../../hooks/useStartSupportRequest";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isPaymentsWebViewFlowEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
⋮----
import { useWalletPaymentGoBackHandler } from "../hooks/useWalletPaymentGoBackHandler";
import { walletPaymentSetCurrentStep } from "../store/actions/orchestration";
import { WALLET_PAYMENT_STEP_MAX } from "../store/reducers";
import {
  walletContextualOnboardingWebViewPayloadSelector,
  walletPaymentWebViewPayloadSelector
} from "../store/selectors";
import { walletPaymentPspListSelector } from "../store/selectors/psps";
import { WalletPaymentStepEnum } from "../types";
import { WalletPaymentStepScreenNames } from "../utils";
⋮----
type WalletPaymentHeaderProps = {
  currentStep: number;
};
⋮----
const WalletPaymentHeader = (
</file>

<file path="apps/main-app/ts/features/payments/checkout/components/WalletPaymentPspBanner.tsx">
import { Banner, VSpacer } from "@io-app/design-system";
import { openAuthSessionAsync } from "expo-web-browser";
⋮----
import I18n from "i18next";
import { useRef } from "react";
import { View } from "react-native";
import Animated, {
  FadeIn,
  FadeOut,
  LinearTransition
} from "react-native-reanimated";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  isPaymentsPspBannerEnabledSelector,
  paymentsPspBannerConfigSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import {
  fallbackForLocalizedMessageKeys,
  getFullLocale
} from "../../../../utils/locale";
⋮----
import { paymentMethodPspBannerClose } from "../store/actions/orchestration";
import {
  isPaymentsPspBannerClosedSelector,
  walletPaymentSelectedPaymentMethodOptionSelector
} from "../store/selectors/paymentMethods";
⋮----
const WalletPaymentPspBanner = () =>
⋮----
const handleBannerPress = () =>
⋮----
const handleBannerClose = () =>
⋮----
entering=
</file>

<file path="apps/main-app/ts/features/payments/checkout/components/WalletPaymentTotalAmount.tsx">
import { Divider, H3, H6, IOSkeleton, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { formatNumberCurrencyCentsOrDefault } from "../../../idpay/common/utils/strings";
⋮----
type TotalAmountSectionProps = {
  loading?: boolean;
  totalAmount?: number;
};
⋮----
export const WalletPaymentTotalAmount = ({
  totalAmount,
  loading
}: TotalAmountSectionProps) =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/components/WalletPspListSkeleton.tsx">
import { Divider, HSpacer, IOSkeleton, VSpacer } from "@io-app/design-system";
import { View } from "react-native";
</file>

<file path="apps/main-app/ts/features/payments/checkout/hooks/useInputFocus.ts">
import { TextInputValidationRefProps } from "@io-app/design-system";
import { useIsFocused } from "@react-navigation/native";
import { RefObject, useEffect, useRef } from "react";
import { TextInput } from "react-native";
⋮----
const useInputFocus = (
  inputRef: RefObject<null | TextInput | TextInputValidationRefProps>,
  delayMs = 500,
  canAutoFocus = true
) =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/hooks/usePagoPaPayment.ts">
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import {
  RptId as PagoPaRptId,
  RptIdFromString as PagoPaRptIdFromString,
  PaymentNoticeNumberFromString
} from "@pagopa/io-pagopa-commons/lib/pagopa";
import { OrganizationFiscalCode } from "@pagopa/ts-commons/lib/strings";
import { sequenceS } from "fp-ts/lib/Apply";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import {
  initPaymentStateAction,
  PaymentInitStateParams
} from "../store/actions/orchestration";
⋮----
type PagoPaPaymentParams = Omit<PaymentInitStateParams, "startRoute">;
⋮----
type PaymentData = {
  organizationFiscalCode: string;
  paymentNoticeNumber: string;
};
⋮----
type UsePagoPaPayment = {
  startPaymentFlow: (rptId: RptId, params?: PagoPaPaymentParams) => void;
  startPaymentFlowWithData: (
    data: PaymentData,
    params?: PagoPaPaymentParams
  ) => void;
  startPaymentFlowWithRptId: (
    rptId: PagoPaRptId,
    params?: PagoPaPaymentParams
  ) => void;
};
⋮----
const usePagoPaPayment = (): UsePagoPaPayment =>
⋮----
const initPaymentState = (params: PagoPaPaymentParams) =>
⋮----
const startPaymentFlow = (
    rptId: RptId,
    params: PagoPaPaymentParams = DEFAULT_PAYMENT_PARAMS
) =>
⋮----
const startPaymentFlowWithRptId = (
    rptId: PagoPaRptId,
    params: PagoPaPaymentParams = DEFAULT_PAYMENT_PARAMS
) =>
⋮----
const startPaymentFlowWithData = (
    data: PaymentData,
    params: PagoPaPaymentParams = DEFAULT_PAYMENT_PARAMS
) =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/hooks/usePaymentFailureSupportModal.tsx">
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
import {
  ListItemAction,
  ListItemHeader,
  ListItemInfoCopy,
  VSpacer
} from "@io-app/design-system";
import {
  PaymentNoticeNumberFromString,
  RptIdFromString
} from "@pagopa/io-pagopa-commons/lib/pagopa";
import { OrganizationFiscalCode } from "@pagopa/ts-commons/lib/strings";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { JSX, useEffect } from "react";
import { Linking } from "react-native";
⋮----
import { isReady } from "../../../../common/model/RemoteValue";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import {
  addTicketCustomField,
  appendLog,
  assistanceToolRemoteConfig,
  defaultZendeskPaymentCategory,
  PAGOPA_SUPPORT_PHONE_NUMBER,
  resetCustomFields,
  zendeskCategoryId,
  zendeskPaymentFailure,
  zendeskPaymentNav,
  zendeskPaymentOrgFiscalCode,
  zendeskPaymentStartOrigin
} from "../../../../utils/supportAssistance";
import {
  getZendeskPaymentConfig,
  zendeskSelectedCategory,
  zendeskSupportStart
} from "../../../zendesk/store/actions";
import { zendeskMapSelector } from "../../../zendesk/store/reducers";
import { formatPaymentNoticeNumber } from "../../common/utils";
import { selectOngoingPaymentHistory } from "../../history/store/selectors";
import {
  getWalletOnboardingOutcomeEnumByValue,
  WalletOnboardingOutcome
} from "../../onboarding/types/OnboardingOutcomeEnum";
import { walletPaymentRptIdSelector } from "../store/selectors";
import {
  getWalletPaymentOutcomeEnumByValue,
  WalletPaymentOutcome
} from "../types/PaymentOutcomeEnum";
import { WalletPaymentFailure } from "../types/WalletPaymentFailure";
import { getSubCategoryFromFaultCode } from "../utils";
⋮----
type PaymentFailureSupportModal = {
  bottomSheet: JSX.Element;
  present: () => void;
};
⋮----
type PaymentFailureSupportModalParams = {
  failure?: WalletPaymentFailure;
  isOnboarding?: boolean;
  outcome?: WalletOnboardingOutcome | WalletPaymentOutcome;
  withPhoneAssistance?: boolean;
};
⋮----
const zendeskAssistanceLogAndStart = () =>
⋮----
// attach the main zendesk category to the ticket
⋮----
// if a subcategory is found, we attach its id and value to the ticket
⋮----
const handleAskAssistance = () =>
⋮----
const handleCopyAllToClipboard = () =>
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/payments/checkout/hooks/usePaymentReversedInfoBottomSheet.tsx">
import { IOMarkdownLite, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { WALLET_PAYMENT_SHOW_OTHER_CHANNELS_URL } from "../utils";
⋮----
content=
</file>

<file path="apps/main-app/ts/features/payments/checkout/hooks/useSortPspBottomSheet.tsx">
import { RadioGroup, RadioItem } from "@io-app/design-system";
import I18n from "i18next";
import { useState } from "react";
import { AccessibilityInfo } from "react-native";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { WalletPaymentPspSortType } from "../types";
⋮----
type WalletPaymentSortPspBottomSheetProps = {
  onSortChange: (sortType: WalletPaymentPspSortType) => void;
};
⋮----
const useSortPspBottomSheet = ({
  onSortChange
}: WalletPaymentSortPspBottomSheetProps) =>
⋮----
const handleChangeSort = (changedSortType: WalletPaymentPspSortType) =>
⋮----
const present = () =>
⋮----
const getModalContent = () => (
    <RadioGroup<WalletPaymentPspSortType>
      items={sortPspListOptions}
      onPress={handleChangeSort}
      selectedItem={sortType}
      type="radioListItem"
    />
  );
</file>

<file path="apps/main-app/ts/features/payments/checkout/hooks/useWalletPaymentAuthorizationModal.tsx">
import { openAuthSessionAsync } from "expo-web-browser";
⋮----
import { pipe } from "fp-ts/lib/function";
import { useCallback, useEffect, useState } from "react";
import URLParse from "url-parse";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isPaymentsWebViewFlowEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { WALLET_WEBVIEW_OUTCOME_SCHEMA } from "../../common/utils/const";
import {
  storePaymentOutcomeToHistory,
  storePaymentsBrowserTypeAction
} from "../../history/store/actions";
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import {
  paymentsStartPaymentAuthorizationAction,
  WalletPaymentAuthorizePayload
} from "../store/actions/networking";
import { paymentStartWebViewFlow } from "../store/actions/orchestration";
import { walletPaymentAuthorizationUrlSelector } from "../store/selectors/transaction";
import {
  WalletPaymentOutcome,
  WalletPaymentOutcomeEnum
} from "../types/PaymentOutcomeEnum";
⋮----
type Props = {
  onAuthorizationOutcome: (outcome: WalletPaymentOutcome) => void;
};
⋮----
type WalletPaymentAuthorizationModal = {
  isError: boolean;
  isLoading: boolean;
  isPendingAuthorization: boolean;
  startPaymentAuthorizaton: (payload: WalletPaymentAuthorizePayload) => void;
};
⋮----
export const useWalletPaymentAuthorizationModal = ({
  onAuthorizationOutcome
}: Props): WalletPaymentAuthorizationModal =>
⋮----
const startPaymentAuthorizaton = (payload: WalletPaymentAuthorizePayload) =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/hooks/useWalletPaymentGoBackHandler.tsx">
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { Alert } from "react-native";
⋮----
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
⋮----
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import { paymentsDeleteTransactionAction } from "../store/actions/networking";
import { walletPaymentTransactionSelector } from "../store/selectors/transaction";
import { WalletPaymentOutcomeEnum } from "../types/PaymentOutcomeEnum";
⋮----
const useWalletPaymentGoBackHandler = () =>
⋮----
const handleConfirmAbort = () =>
⋮----
const handleCancel = () =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../utils/navigation";
import PaymentsContextualOnboardingWebViewScreen from "../../onboarding/screens/PaymentsContextualOnboardingWebViewScreen";
import { WalletPaymentDetailScreen } from "../screens/WalletPaymentDetailScreen";
import { WalletPaymentFailureScreen } from "../screens/WalletPaymentFailureScreen";
import { WalletPaymentInputFiscalCodeScreen } from "../screens/WalletPaymentInputFiscalCodeScreen";
import { WalletPaymentInputNoticeNumberScreen } from "../screens/WalletPaymentInputNoticeNumberScreen";
import { WalletPaymentMakeScreen } from "../screens/WalletPaymentMakeScreen";
import { WalletPaymentOutcomeScreen } from "../screens/WalletPaymentOutcomeScreen";
import WalletPaymentWebViewScreen from "../screens/WalletPaymentWebViewScreen";
import { PaymentsCheckoutParamsList } from "./params";
import { PaymentsCheckoutRoutes } from "./routes";
⋮----
export const PaymentsCheckoutNavigator = () => (
  <Stack.Navigator
    initialRouteName={
      PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_INPUT_NOTICE_NUMBER
    }
    screenOptions={{ gestureEnabled: isGestureEnabled, headerMode: "screen" }}
  >
    <Stack.Screen
      component={WalletPaymentInputNoticeNumberScreen}
      name={PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_INPUT_NOTICE_NUMBER}
      options={{
        gestureEnabled: isGestureEnabled
      }}
    />
    <Stack.Screen
      component={WalletPaymentInputFiscalCodeScreen}
      name={PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_INPUT_FISCAL_CODE}
      options={{
        gestureEnabled: isGestureEnabled
      }}
    />
    <Stack.Screen
      component={WalletPaymentDetailScreen}
      name={PaymentsCheckoutRoutes.PAYMENT_NOTICE_SUMMARY}
      options={{
        gestureEnabled: isGestureEnabled,
        headerShown: false
      }}
    />
    <Stack.Screen
      component={WalletPaymentMakeScreen}
      name={PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_MAKE}
      options={{
        gestureEnabled: isGestureEnabled,
        headerShown: false
      }}
    />
    <Stack.Screen
      component={WalletPaymentOutcomeScreen}
      name={PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_OUTCOME}
      options={{
        gestureEnabled: false,
        headerShown: false
      }}
    />
    <Stack.Screen
      component={WalletPaymentFailureScreen}
      name={PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_FAILURE}
      options={{
        gestureEnabled: isGestureEnabled,
        headerShown: false
      }}
    />
    <Stack.Screen
      component={WalletPaymentWebViewScreen}
      name={PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_WEB_VIEW}
      options={{
        gestureEnabled: false
      }}
    />
    <Stack.Screen
      component={PaymentsContextualOnboardingWebViewScreen}
      name={PaymentsCheckoutRoutes.PAYMENT_ONBOARDING_WEB_VIEW}
      options={{
        gestureEnabled: false
      }}
    />
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/features/payments/checkout/navigation/params.ts">
import { WalletPaymentDetailScreenNavigationParams } from "../screens/WalletPaymentDetailScreen";
import { WalletPaymentFailureScreenNavigationParams } from "../screens/WalletPaymentFailureScreen";
import { WalletPaymentInputFiscalCodeScreenNavigationParams } from "../screens/WalletPaymentInputFiscalCodeScreen";
import { WalletPaymentOutcomeScreenNavigationParams } from "../screens/WalletPaymentOutcomeScreen";
import { PaymentsCheckoutRoutes } from "./routes";
⋮----
export type PaymentsCheckoutParamsList = {
  [PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_FAILURE]: WalletPaymentFailureScreenNavigationParams;
  [PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_INPUT_FISCAL_CODE]: WalletPaymentInputFiscalCodeScreenNavigationParams;
  [PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_INPUT_NOTICE_NUMBER]: undefined;
  [PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_MAKE]: undefined;
  [PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_NAVIGATOR]: undefined;
  [PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_OUTCOME]: WalletPaymentOutcomeScreenNavigationParams;
  [PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_WEB_VIEW]: undefined;
  [PaymentsCheckoutRoutes.PAYMENT_NOTICE_SUMMARY]: WalletPaymentDetailScreenNavigationParams;
  [PaymentsCheckoutRoutes.PAYMENT_ONBOARDING_WEB_VIEW]: undefined;
};
</file>

<file path="apps/main-app/ts/features/payments/checkout/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/networking/handleWalletPaymentAuthorization.ts">
import { ApmDetailTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/ApmDetailType";
import { AuthorizationDetails } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/AuthorizationDetails";
import { CardsDetailTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/CardsDetailType";
import { PaymentMethodManagementTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentMethodManagementType";
import { RedirectDetailTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RedirectDetailType";
import { RequestAuthorizationRequest } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RequestAuthorizationRequest";
import { WalletDetailTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletDetailType";
⋮----
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../../utils/errors";
import { getLanguageEnumFromPreferredLocale } from "../../../../../utils/locale";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { PaymentClient } from "../../../common/api/client";
import { withPaymentsSessionToken } from "../../../common/utils/withPaymentsSessionToken";
import { paymentsStartPaymentAuthorizationAction } from "../../store/actions/networking";
⋮----
type WalletAuthorizationAction = ActionType<
  (typeof paymentsStartPaymentAuthorizationAction)["request"]
>;
⋮----
const buildAuthorizationDetailsBody = (
  payload: WalletAuthorizationAction["payload"]
): AuthorizationDetails =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/networking/handleWalletPaymentCalculateFees.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { toUpper } from "lodash";
import { put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { preferredLanguageSelector } from "../../../../../store/reducers/persistedPreferences";
import { getGenericError, getNetworkError } from "../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { PaymentClient } from "../../../common/api/client";
import { withPaymentsSessionToken } from "../../../common/utils/withPaymentsSessionToken";
import { paymentAnalyticsDataSelector } from "../../../history/store/selectors";
⋮----
import { paymentsCalculatePaymentFeesAction } from "../../store/actions/networking";
</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/networking/handleWalletPaymentCreateTransaction.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { PaymentClient } from "../../../common/api/client";
import { withPaymentsSessionToken } from "../../../common/utils/withPaymentsSessionToken";
import { paymentsCreateTransactionAction } from "../../store/actions/networking";
</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/networking/handleWalletPaymentDeleteTransaction.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { PaymentClient } from "../../../common/api/client";
import { withPaymentsSessionToken } from "../../../common/utils/withPaymentsSessionToken";
import { paymentsDeleteTransactionAction } from "../../store/actions/networking";
</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/networking/handleWalletPaymentGetAllMethods.ts">
import { Platform } from "react-native";
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getDeviceAppVersion } from "../../../../../utils/device";
import { getGenericError, getNetworkError } from "../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { PaymentClient } from "../../../common/api/client";
import { withPaymentsSessionToken } from "../../../common/utils/withPaymentsSessionToken";
import { paymentsGetPaymentMethodsAction } from "../../store/actions/networking";
</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/networking/handleWalletPaymentGetContextualOnboardingUrl.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { PaymentClient } from "../../../common/api/client";
import { withPaymentsSessionToken } from "../../../common/utils/withPaymentsSessionToken";
import { paymentsGetContextualOnboardingUrlAction } from "../../store/actions/networking";
</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/networking/handleWalletPaymentGetDetails.ts">
import { FaultCodeCategoryEnum as EcommerceFaultCodeCategoryEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/GatewayFaultPaymentProblemJson";
⋮----
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { PaymentClient } from "../../../common/api/client";
import { withPaymentsSessionToken } from "../../../common/utils/withPaymentsSessionToken";
import { paymentsGetPaymentDetailsAction } from "../../store/actions/networking";
import { FaultCodeCategoryEnum as VerifyFaultCodeCategoryEnum } from "../../types/PaymentVerifyGenericErrorProblemJson";
</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/networking/handleWalletPaymentGetRecentMethod.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { PaymentClient } from "../../../common/api/client";
import { withPaymentsSessionToken } from "../../../common/utils/withPaymentsSessionToken";
import { paymentsGetRecentPaymentMethodUsedAction } from "../../store/actions/networking";
</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/networking/handleWalletPaymentGetTransactionInfo.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { PaymentClient } from "../../../common/api/client";
import { withPaymentsSessionToken } from "../../../common/utils/withPaymentsSessionToken";
import { paymentsGetPaymentTransactionInfoAction } from "../../store/actions/networking";
</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/networking/handleWalletPaymentGetUserWallets.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../../utils/errors";
import { readablePrivacyReport } from "../../../../../utils/reporters";
import { PaymentClient } from "../../../common/api/client";
import { withPaymentsSessionToken } from "../../../common/utils/withPaymentsSessionToken";
import { paymentsGetPaymentUserMethodsAction } from "../../store/actions/networking";
</file>

<file path="apps/main-app/ts/features/payments/checkout/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { PaymentClient } from "../../common/api/client";
import {
  paymentsCalculatePaymentFeesAction,
  paymentsCreateTransactionAction,
  paymentsDeleteTransactionAction,
  paymentsGetContextualOnboardingUrlAction,
  paymentsGetPaymentDetailsAction,
  paymentsGetPaymentMethodsAction,
  paymentsGetPaymentTransactionInfoAction,
  paymentsGetPaymentUserMethodsAction,
  paymentsGetRecentPaymentMethodUsedAction,
  paymentsStartPaymentAuthorizationAction
} from "../store/actions/networking";
import { handleWalletPaymentAuthorization } from "./networking/handleWalletPaymentAuthorization";
import { handleWalletPaymentCalculateFees } from "./networking/handleWalletPaymentCalculateFees";
import { handleWalletPaymentCreateTransaction } from "./networking/handleWalletPaymentCreateTransaction";
import { handleWalletPaymentDeleteTransaction } from "./networking/handleWalletPaymentDeleteTransaction";
import { handleWalletPaymentGetAllMethods } from "./networking/handleWalletPaymentGetAllMethods";
import { handleWalletPaymentGetContextualOnboardingUrl } from "./networking/handleWalletPaymentGetContextualOnboardingUrl";
import { handleWalletPaymentGetDetails } from "./networking/handleWalletPaymentGetDetails";
import { handleWalletPaymentGetRecentMethod } from "./networking/handleWalletPaymentGetRecentMethod";
import { handleWalletPaymentGetTransactionInfo } from "./networking/handleWalletPaymentGetTransactionInfo";
import { handleWalletPaymentGetUserWallets } from "./networking/handleWalletPaymentGetUserWallets";
</file>

<file path="apps/main-app/ts/features/payments/checkout/screens/WalletPaymentConfirmScreen.tsx">
import { AmountEuroCents } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/AmountEuroCents";
import {
  Body,
  ListItemHeader,
  ModuleCheckout,
  VSpacer
} from "@io-app/design-system";
⋮----
import { useFocusEffect } from "@react-navigation/native";
import { openAuthSessionAsync } from "expo-web-browser";
import { sequenceS } from "fp-ts/lib/Apply";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback, useEffect } from "react";
import { AccessibilityInfo } from "react-native";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import { getTxtNodeKey } from "../../../../components/IOMarkdown/renderRules";
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { formatNumberCentsToAmount } from "../../../../utils/stringBuilder";
import { capitalize } from "../../../../utils/strings";
import { UIWalletInfoDetails } from "../../common/types/UIWalletInfoDetails";
import { getPaymentLogoFromWalletDetails } from "../../common/utils";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
⋮----
import { WalletPaymentTotalAmount } from "../components/WalletPaymentTotalAmount";
import { useWalletPaymentAuthorizationModal } from "../hooks/useWalletPaymentAuthorizationModal";
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import { walletPaymentSetCurrentStep } from "../store/actions/orchestration";
import {
  selectPaymentsOnboardedWalletId,
  selectPaymentsOrderId,
  selectWalletPaymentCurrentStep,
  walletPaymentDetailsSelector
} from "../store/selectors";
import {
  walletPaymentSelectedPaymentMethodIdOptionSelector,
  walletPaymentSelectedPaymentMethodManagementOptionSelector,
  walletPaymentSelectedPaymentMethodOptionSelector,
  walletPaymentSelectedWalletIdOptionSelector,
  walletPaymentSelectedWalletOptionSelector
} from "../store/selectors/paymentMethods";
import {
  walletPaymentPspListSelector,
  walletPaymentSelectedPspSelector
} from "../store/selectors/psps";
import { walletPaymentTransactionSelector } from "../store/selectors/transaction";
import { WalletPaymentStepEnum } from "../types";
import {
  WalletPaymentOutcome,
  WalletPaymentOutcomeEnum
} from "../types/PaymentOutcomeEnum";
⋮----
const handleStartPaymentAuthorization = ()
⋮----
// should be called only when the current step is the confirm screen
// eslint-disable-next-line react-hooks/exhaustive-deps
⋮----
const handleOnPress = () =>
⋮----
title={formatNumberCentsToAmount(taxFee, true, "right")}
    />
  );
</file>

<file path="apps/main-app/ts/features/payments/checkout/screens/WalletPaymentDetailScreen.tsx">
import { OrganizationFiscalCode } from "@io-app/api-types/generated/definitions/communication/OrganizationFiscalCode";
import { PaymentRequestsGetResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentRequestsGetResponse";
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import {
  Divider,
  H3,
  IODimensionScale,
  IOMarkdown,
  ListItemInfo,
  ListItemInfoCopy,
  VSpacer
} from "@io-app/design-system";
import {
  PaymentNoticeNumberFromString,
  RptIdFromString
} from "@pagopa/io-pagopa-commons/lib/pagopa";
⋮----
import {
  RouteProp,
  useFocusEffect,
  useNavigation,
  useRoute
} from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { ComponentProps, useCallback, useLayoutEffect, useState } from "react";
import { AccessibilityInfo, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { LoadingIndicator } from "../../../../components/ui/LoadingIndicator";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { cleanTransactionDescription } from "../../../../utils/payment";
import {
  centsToAmount,
  formatNumberAmount
} from "../../../../utils/stringBuilder";
import { formatPaymentNoticeNumber } from "../../common/utils";
import { storeNewPaymentAttemptAction } from "../../history/store/actions";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
⋮----
import { WalletPaymentFailureDetail } from "../components/WalletPaymentFailureDetail";
import { PaymentsCheckoutParamsList } from "../navigation/params";
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import {
  paymentsGetPaymentDetailsAction,
  paymentsGetPaymentUserMethodsAction
} from "../store/actions/networking";
import { walletPaymentSetCurrentStep } from "../store/actions/orchestration";
import { walletPaymentDetailsSelector } from "../store/selectors";
import { walletPaymentEnabledUserWalletsSelector } from "../store/selectors/paymentMethods";
import { WalletPaymentStepEnum } from "../types";
import { FaultCodeCategoryEnum as FaultCodeSlowdownCategoryEnum } from "../types/PaymentSlowdownErrorProblemJson";
import { WalletPaymentFailure } from "../types/WalletPaymentFailure";
import { formatAndValidateDueDate } from "../utils";
⋮----
type WalletPaymentDetailRouteProps = RouteProp<
  PaymentsCheckoutParamsList,
  "PAYMENT_NOTICE_SUMMARY"
>;
⋮----
type WalletPaymentDetailScreenNavigationParams = {
  rptId: RptId;
};
⋮----
const navigateToMakePaymentScreen = () =>
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/payments/checkout/screens/WalletPaymentFailureScreen.tsx">
import { RouteProp, useRoute } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import { NetworkError } from "../../../../utils/errors";
import { WalletPaymentFailureDetail } from "../components/WalletPaymentFailureDetail";
import { PaymentsCheckoutParamsList } from "../navigation/params";
import { FaultCodeCategoryEnum } from "../types/PaymentSlowdownErrorProblemJson";
import { WalletPaymentFailure } from "../types/WalletPaymentFailure";
⋮----
export type WalletPaymentFailureScreenNavigationParams = {
  error: NetworkError | WalletPaymentFailure;
};
⋮----
type WalletPaymentFailureRouteProps = RouteProp<
  PaymentsCheckoutParamsList,
  "PAYMENT_CHECKOUT_FAILURE"
>;
⋮----
const WalletPaymentFailureScreen = () =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/screens/WalletPaymentInputFiscalCodeScreen.tsx">
import { IOButton, TextInputValidation } from "@io-app/design-system";
import {
  PaymentNoticeNumberFromString,
  RptId
} from "@pagopa/io-pagopa-commons/lib/pagopa";
import { OrganizationFiscalCode } from "@pagopa/ts-commons/lib/strings";
import { RouteProp, useNavigation, useRoute } from "@react-navigation/native";
import { sequenceS } from "fp-ts/lib/Apply";
import { flow, pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { ComponentRef, useEffect, useRef, useState } from "react";
import { Keyboard, Platform, View } from "react-native";
import { KeyboardStickyView } from "react-native-keyboard-controller";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useFooterActionsMargin } from "../../../../hooks/useFooterActionsMargin";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { isScreenReaderEnabledSelector } from "../../../../store/reducers/preferences";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import {
  decodeOrganizationFiscalCode,
  validateOrganizationFiscalCode
} from "../../common/utils/validation";
⋮----
import { useInputFocus } from "../hooks/useInputFocus";
import { usePagoPaPayment } from "../hooks/usePagoPaPayment";
import { PaymentsCheckoutParamsList } from "../navigation/params";
⋮----
export type WalletPaymentInputFiscalCodeScreenNavigationParams = {
  paymentNoticeNumber: O.Option<PaymentNoticeNumberFromString>;
};
⋮----
type InputState = {
  fiscalCode: O.Option<OrganizationFiscalCode>;
  fiscalCodeText: string;
};
⋮----
type WalletPaymentInputFiscalCodeRouteProps = RouteProp<
  PaymentsCheckoutParamsList,
  "PAYMENT_CHECKOUT_INPUT_FISCAL_CODE"
>;
⋮----
const navigateToTransactionSummary = () =>
⋮----
const handleContinueClick = ()
⋮----
label=
</file>

<file path="apps/main-app/ts/features/payments/checkout/screens/WalletPaymentInputNoticeNumberScreen.tsx">
import { IOButton, TextInputValidation } from "@io-app/design-system";
import { PaymentNoticeNumberFromString } from "@pagopa/io-pagopa-commons/lib/pagopa";
import { useNavigation } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { ComponentRef, useRef, useState } from "react";
import { Keyboard, View } from "react-native";
import { KeyboardStickyView } from "react-native-keyboard-controller";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useFooterActionsMargin } from "../../../../hooks/useFooterActionsMargin";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import {
  decodePaymentNoticeNumber,
  validatePaymentNoticeNumber
} from "../../common/utils/validation";
⋮----
import { useInputFocus } from "../hooks/useInputFocus";
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import { trimAndLimitValue } from "../utils";
⋮----
type InputState = {
  noticeNumber: O.Option<PaymentNoticeNumberFromString>;
  noticeNumberText: string;
};
⋮----
const navigateToFiscalCodeInput = () =>
⋮----
const handleContinueClick = ()
⋮----
label=
</file>

<file path="apps/main-app/ts/features/payments/checkout/screens/WalletPaymentMakeScreen.tsx">
import { useEffect, useLayoutEffect, useRef } from "react";
import { View } from "react-native";
import PagerView from "react-native-pager-view";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { WalletPaymentHeader } from "../components/WalletPaymentHeader";
import { selectWalletPaymentCurrentStep } from "../store/selectors";
import { WalletPaymentConfirmScreen } from "./WalletPaymentConfirmScreen";
import { WalletPaymentPickMethodScreen } from "./WalletPaymentPickMethodScreen";
import { WalletPaymentPickPspScreen } from "./WalletPaymentPickPspScreen";
</file>

<file path="apps/main-app/ts/features/payments/checkout/screens/WalletPaymentOutcomeScreen.tsx">
import { RouteProp, useRoute } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { formatNumberCentsToAmount } from "../../../../utils/stringBuilder";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { useAppFeedbackContext } from "../../../appReviews/components/AppFeedbackProvider";
import { profileEmailSelector } from "../../../settings/common/store/selectors";
import {
  paymentAnalyticsDataSelector,
  selectOngoingPaymentHistory
} from "../../history/store/selectors";
import { getPaymentsLatestReceiptAction } from "../../receipts/store/actions";
import { getPaymentsWalletUserMethods } from "../../wallet/store/actions";
⋮----
import { WalletPaymentFeebackBanner } from "../components/WalletPaymentFeedbackBanner";
import { usePaymentFailureSupportModal } from "../hooks/usePaymentFailureSupportModal";
import { usePaymentReversedInfoBottomSheet } from "../hooks/usePaymentReversedInfoBottomSheet";
import { PaymentsCheckoutParamsList } from "../navigation/params";
import { paymentCompletedSuccess } from "../store/actions/orchestration";
import {
  selectWalletPaymentCurrentStep,
  walletPaymentDetailsSelector,
  walletPaymentOnSuccessActionSelector
} from "../store/selectors";
import { walletPaymentSelectedPspSelector } from "../store/selectors/psps";
import {
  WalletPaymentOutcome,
  WalletPaymentOutcomeEnum
} from "../types/PaymentOutcomeEnum";
import { getPaymentPhaseFromStep, getPreselectedPspFlagType } from "../utils";
⋮----
type WalletPaymentOutcomeRouteProps = RouteProp<
  PaymentsCheckoutParamsList,
  "PAYMENT_CHECKOUT_OUTCOME"
>;
⋮----
type WalletPaymentOutcomeScreenNavigationParams = {
  outcome: WalletPaymentOutcome;
};
⋮----
const WalletPaymentOutcomeScreen = () =>
⋮----
const handleContactSupport = () =>
⋮----
const handleClose = () =>
⋮----
const handleSuccessClose = () =>
⋮----
const handleShowMoreOnReversedPayment = () =>
⋮----
const trackOutcomeScreen = () =>
⋮----
const getPropsForOutcome = (): OperationResultScreenContentProps =>
⋮----
<OperationResultScreenContent isHeaderVisible
</file>

<file path="apps/main-app/ts/features/payments/checkout/screens/WalletPaymentPickMethodScreen.tsx">
import { AmountEuroCents } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/AmountEuroCents";
import { FaultCodeCategoryEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/GatewayFaultPaymentProblemJson";
import { H2, IOToast, VSpacer } from "@io-app/design-system";
⋮----
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { useFocusEffect } from "@react-navigation/native";
import { sequenceT } from "fp-ts/lib/Apply";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback, useEffect, useRef, useState } from "react";
import { AccessibilityInfo, View } from "react-native";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../utils/accessibility";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { PaymentAnalyticsSelectedMethodFlag } from "../../common/types/PaymentAnalytics";
import { UIWalletInfoDetails } from "../../common/types/UIWalletInfoDetails";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
import {
  useWalletOnboardingWebView,
  WalletOnboardingOutcomeParams
} from "../../onboarding/hooks/useWalletOnboardingWebView";
import { PaymentsOnboardingRoutes } from "../../onboarding/navigation/routes";
import { WalletOnboardingOutcomeEnum } from "../../onboarding/types/OnboardingOutcomeEnum";
⋮----
import {
  CheckoutPaymentMethodsList,
  CheckoutPaymentMethodsListSkeleton
} from "../components/CheckoutPaymentMethodsList";
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import {
  paymentsCalculatePaymentFeesAction,
  paymentsCreateTransactionAction,
  paymentsGetContextualOnboardingUrlAction,
  paymentsGetPaymentMethodsAction,
  paymentsGetPaymentTransactionInfoAction,
  paymentsGetRecentPaymentMethodUsedAction
} from "../store/actions/networking";
import { paymentClearWebViewFlow } from "../store/actions/orchestration.ts";
import {
  selectPaymentsOrderId,
  selectWalletPaymentCurrentStep,
  walletPaymentAmountSelector,
  walletPaymentDetailsSelector
} from "../store/selectors";
import {
  walletPaymentAllMethodsSelector,
  walletPaymentContextualOnboardingUrlSelector,
  walletPaymentEnabledUserWalletsSelector,
  walletPaymentSelectedPaymentMethodIdOptionSelector,
  walletPaymentSelectedPaymentMethodOptionSelector,
  walletPaymentSelectedWalletIdOptionSelector
} from "../store/selectors/paymentMethods";
import { walletPaymentPspListSelector } from "../store/selectors/psps";
import {
  walletPaymentIsTransactionActivatedSelector,
  walletPaymentTransactionSelector
} from "../store/selectors/transaction";
import { WalletPaymentStepEnum } from "../types";
import { PAYMENT_STEPS_TOTAL_PAGES } from "../utils";
⋮----
const handleOnboardingOutcome = ({
    outcome,
    walletId,
    orderId,
    transactionId
}: WalletOnboardingOutcomeParams) =>
⋮----
const getSelectedPaymentMethodFlag = ()
⋮----
const handleOnCreateTransactionError = () =>
⋮----
const handleStartContextualOnboarding = (redirectUrl: string) =>
⋮----
const handleContinue = () =>
⋮----
const createTransaction = (orderId?: string) =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/screens/WalletPaymentPickPspScreen.tsx">
import { Bundle } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/Bundle";
import {
  Body,
  H2,
  ListItemHeader,
  RadioGroup,
  RadioItemWithAmount,
  VSpacer
} from "@io-app/design-system";
⋮----
import { useFocusEffect } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useState } from "react";
import Animated, { LinearTransition } from "react-native-reanimated";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { formatNumberCentsToAmount } from "../../../../utils/stringBuilder";
import { getSortedPspList } from "../../common/utils";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
⋮----
import { WalletPaymentPspBanner } from "../components/WalletPaymentPspBanner";
import { WalletPspListSkeleton } from "../components/WalletPspListSkeleton";
import { useSortPspBottomSheet } from "../hooks/useSortPspBottomSheet";
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import {
  selectPaymentPspAction,
  walletPaymentSetCurrentStep
} from "../store/actions/orchestration";
import { selectWalletPaymentCurrentStep } from "../store/selectors";
import {
  walletPaymentPspListSelector,
  walletPaymentSelectedPspSelector
} from "../store/selectors/psps";
import { WalletPaymentPspSortType, WalletPaymentStepEnum } from "../types";
import { FaultCodeCategoryEnum } from "../types/PspPaymentMethodNotAvailableProblemJson";
import { WalletPaymentFailure } from "../types/WalletPaymentFailure";
import { getPreselectedPspFlagType } from "../utils";
⋮----
const handleChangePspSorting = (sortType: WalletPaymentPspSortType) =>
⋮----
const handleContinue = () =>
⋮----
items=
⋮----
const getRadioItemsFromPspList = (
  pspList?: Array<Bundle>,
  showFeaturedPsp?: boolean
)
</file>

<file path="apps/main-app/ts/features/payments/checkout/screens/WalletPaymentWebViewScreen.tsx">
import { HeaderSecondLevel } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useLayoutEffect } from "react";
import { Alert } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import PaymentWebView from "../../common/components/PaymentWebView";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
⋮----
import { walletPaymentWebViewPayloadSelector } from "../store/selectors";
import { WalletPaymentOutcomeEnum } from "../types/PaymentOutcomeEnum";
⋮----
const handleConfirmClose = () =>
⋮----
const handleCloseAlert = () =>
⋮----
const promptUserToClose = () =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/store/actions/index.ts">
import { PaymentsCheckoutNetworkingActions } from "./networking";
import { PaymentsCheckoutOrchestrationActions } from "./orchestration";
⋮----
export type PaymentsCheckoutActions =
  | PaymentsCheckoutNetworkingActions
  | PaymentsCheckoutOrchestrationActions;
</file>

<file path="apps/main-app/ts/features/payments/checkout/store/actions/networking.ts">
import { AmountEuroCents } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/AmountEuroCents";
import { CalculateFeeRequest } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/CalculateFeeRequest";
import { CalculateFeeResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/CalculateFeeResponse";
import { NewTransactionRequest } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/NewTransactionRequest";
import { NewTransactionResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/NewTransactionResponse";
import { PaymentMethodManagementTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentMethodManagementType";
import { PaymentMethodsResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentMethodsResponse";
import { PaymentRequestsGetResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentRequestsGetResponse";
import { RedirectUrlResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RedirectUrlResponse";
import { RequestAuthorizationResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RequestAuthorizationResponse";
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import { TransactionInfo } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/TransactionInfo";
import { UserLastPaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/UserLastPaymentMethodResponse";
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletInfo";
import { Wallets } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/Wallets";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
import { WalletPaymentFailure } from "../../types/WalletPaymentFailure";
⋮----
type CalculateFeeResponseWithOrderId = CalculateFeeResponse & {
  orderId?: string;
};
⋮----
type GetPaymentTransactionInfoPayload = {
  transactionId: string;
  walletId?: string;
};
⋮----
type NotFound = { kind: "notFound" };
⋮----
type PaymentMethodsRequest = {
  amount?: number;
};
⋮----
type PaymentGetPaymentUserMethodsPayload = {
  onResponse?: (wallets: ReadonlyArray<WalletInfo> | undefined) => void;
};
⋮----
type CalculateFeePayload = {
  idPsp?: string;
  orderId?: string;
  paymentMethodId: string;
};
⋮----
type GetContextualOnboardingUrlPayload = {
  amount: AmountEuroCents;
  onSuccess?: (redirectUrl: string) => void;
  paymentMethodId: string;
  rptId: RptId;
};
⋮----
export type WalletPaymentCreateTransactionPayload = {
  data: NewTransactionRequest;
  onError?: () => void;
  orderId?: string;
};
⋮----
export type WalletPaymentAuthorizePayload = {
  isAllCCP: boolean;
  orderId?: string;
  paymentAmount: AmountEuroCents;
  paymentFees: AmountEuroCents;
  paymentMethodId: string;
  paymentMethodManagement?: PaymentMethodManagementTypeEnum;
  pspId: string;
  transactionId: string;
  walletId?: string;
};
⋮----
export type PaymentsCheckoutNetworkingActions =
  | ActionType<typeof paymentsCalculatePaymentFeesAction>
  | ActionType<typeof paymentsCreateTransactionAction>
  | ActionType<typeof paymentsDeleteTransactionAction>
  | ActionType<typeof paymentsGetContextualOnboardingUrlAction>
  | ActionType<typeof paymentsGetPaymentDetailsAction>
  | ActionType<typeof paymentsGetPaymentMethodsAction>
  | ActionType<typeof paymentsGetPaymentTransactionInfoAction>
  | ActionType<typeof paymentsGetPaymentUserMethodsAction>
  | ActionType<typeof paymentsGetRecentPaymentMethodUsedAction>
  | ActionType<typeof paymentsStartPaymentAuthorizationAction>;
</file>

<file path="apps/main-app/ts/features/payments/checkout/store/actions/orchestration.ts">
import { Bundle } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/Bundle";
import { PaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentMethodResponse";
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletInfo";
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { PaymentStartOrigin, WalletPaymentStepEnum } from "../../types";
import { WalletPaymentOutcomeEnum } from "../../types/PaymentOutcomeEnum";
⋮----
export type OnPaymentSuccessAction =
  | "showAarMessage"
  | "showHome"
  | "showTransaction";
⋮----
export type PaymentInitStateParams = {
  onSuccess?: OnPaymentSuccessAction;
  serviceName?: string;
  startOrigin?: PaymentStartOrigin;
};
⋮----
export type PaymentStartWebViewPayload = {
  onCancel?: (outcome?: WalletPaymentOutcomeEnum) => void;
  onError?: (outcome?: WalletPaymentOutcomeEnum) => void;
  onSuccess?: (url: string) => void;
  url: string;
};
⋮----
type PaymentCompletedSuccessPayload = {
  kind: "COMPLETED" | "DUPLICATED";
  rptId: RptId;
};
⋮----
export type PaymentsCheckoutOrchestrationActions =
  | ActionType<typeof initPaymentStateAction>
  | ActionType<typeof paymentClearWebViewFlow>
  | ActionType<typeof paymentCompletedSuccess>
  | ActionType<typeof paymentMethodPspBannerClose>
  | ActionType<typeof paymentStartWebViewFlow>
  | ActionType<typeof selectPaymentMethodAction>
  | ActionType<typeof selectPaymentPspAction>
  | ActionType<typeof walletPaymentSetCurrentStep>;
</file>

<file path="apps/main-app/ts/features/payments/checkout/store/reducers/index.ts">
import { Bundle } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/Bundle";
import { PaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentMethodResponse";
import { PaymentMethodsResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentMethodsResponse";
import { PaymentRequestsGetResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentRequestsGetResponse";
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import { TransactionInfo } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/TransactionInfo";
import { UserLastPaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/UserLastPaymentMethodResponse";
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletInfo";
import { Wallets } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/Wallets";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import _ from "lodash";
import { getType, isActionOf } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import { getSortedPspList } from "../../../common/utils";
import {
  contextualOnboardingStartWebViewFlow,
  ContextualOnboardingWebViewPayload
} from "../../../onboarding/store/actions";
import { WalletPaymentStepEnum } from "../../types";
import { FaultCodeCategoryEnum as PaymentMethodNotAvailableEnum } from "../../types/PspPaymentMethodNotAvailableProblemJson";
import { WalletPaymentFailure } from "../../types/WalletPaymentFailure";
import {
  paymentsCalculatePaymentFeesAction,
  paymentsCreateTransactionAction,
  paymentsDeleteTransactionAction,
  paymentsGetContextualOnboardingUrlAction,
  paymentsGetPaymentDetailsAction,
  paymentsGetPaymentMethodsAction,
  paymentsGetPaymentTransactionInfoAction,
  paymentsGetPaymentUserMethodsAction,
  paymentsGetRecentPaymentMethodUsedAction,
  paymentsStartPaymentAuthorizationAction
} from "../actions/networking";
import {
  initPaymentStateAction,
  OnPaymentSuccessAction,
  paymentClearWebViewFlow,
  paymentMethodPspBannerClose,
  paymentStartWebViewFlow,
  PaymentStartWebViewPayload,
  selectPaymentMethodAction,
  selectPaymentPspAction,
  walletPaymentSetCurrentStep
} from "../actions/orchestration";
⋮----
export type PaymentsCheckoutState = {
  allPaymentMethods: pot.Pot<PaymentMethodsResponse, NetworkError>;
  authorizationUrl: pot.Pot<string, NetworkError>;
  contextualPayment: ContextualPayment;
  currentStep: WalletPaymentStepEnum;
  onSuccess?: OnPaymentSuccessAction;
  paymentDetails: pot.Pot<
    PaymentRequestsGetResponse,
    NetworkError | WalletPaymentFailure
  >;
  pspBannerClosed: Set<string>;
  pspList: pot.Pot<ReadonlyArray<Bundle>, NetworkError | WalletPaymentFailure>;
  recentUsedPaymentMethod: pot.Pot<UserLastPaymentMethodResponse, NetworkError>;
  rptId?: RptId;
  selectedPaymentMethod: O.Option<PaymentMethodResponse>;
  selectedPsp: O.Option<Bundle>;
  selectedWallet: O.Option<WalletInfo>;
  transaction: pot.Pot<TransactionInfo, NetworkError | WalletPaymentFailure>;
  userWallets: pot.Pot<Wallets, NetworkError>;
  webViewPayload?: PaymentStartWebViewPayload;
};
⋮----
type ContextualPayment = {
  onboardedWalletId?: string;
  onboardingUrl: pot.Pot<string, NetworkError>;
  orderId?: string;
  webViewPayload?: ContextualOnboardingWebViewPayload;
};
⋮----
const reducer = (
  state: PaymentsCheckoutState = INITIAL_STATE,
  action: Action
): PaymentsCheckoutState =>
⋮----
// PSP list
⋮----
// We choose the next step based on the PSP list lenght
// If only 1 PSP we do not have the need to selected one
⋮----
// Bundles are stored sorted by default sort rule
</file>

<file path="apps/main-app/ts/features/payments/checkout/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const selectPaymentsCheckoutState = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/payments/checkout/store/selectors/paymentMethods.ts">
import { WalletApplicationNameEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletApplicationName";
import { WalletApplicationStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletApplicationStatus";
import { WalletLastUsageTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletLastUsageType";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import _ from "lodash";
import { createSelector } from "reselect";
⋮----
import { selectPaymentsCheckoutState } from ".";
import { UIWalletInfoDetails } from "../../../common/types/UIWalletInfoDetails";
import { isPaymentMethodExpired } from "../../../common/utils";
import { isValidPaymentMethod } from "../../utils";
⋮----
export const isPaymentsPspBannerClosedSelector = (paymentMethodName: string)
</file>

<file path="apps/main-app/ts/features/payments/checkout/store/selectors/psps.ts">
import { createSelector } from "reselect";
⋮----
import { selectPaymentsCheckoutState } from ".";
</file>

<file path="apps/main-app/ts/features/payments/checkout/store/selectors/transaction.ts">
import { TransactionStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/TransactionStatus";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
⋮----
import { selectPaymentsCheckoutState } from ".";
</file>

<file path="apps/main-app/ts/features/payments/checkout/tempWorkaround/pagoPaPaymentWorkaround.ts">
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import {
  RptId as PagoPaRptId,
  RptIdFromString as PagoPaRptIdFromString
} from "@pagopa/io-pagopa-commons/lib/pagopa";
import { pipe } from "fp-ts/lib/function";
⋮----
import { Dispatch } from "redux";
⋮----
import { NavigationParams } from "../../../../navigation/NavigationService";
import { AppParamsList } from "../../../../navigation/params/AppParamsList";
import { Action } from "../../../../store/actions/types";
import { PaymentsCheckoutRoutes } from "../navigation/routes";
import {
  initPaymentStateAction,
  PaymentInitStateParams
} from "../store/actions/orchestration";
⋮----
type PagoPaPaymentParams = Omit<PaymentInitStateParams, "startRoute">;
⋮----
export const startPaymentFlowWithRptIdWorkaround = (
  rptId: PagoPaRptId,
  dispatch: Dispatch<Action>,
  navigate: <T extends keyof AppParamsList>(
    ...args: NavigationParams<T>
  ) => void,
  params: PagoPaPaymentParams = {}
) =>
⋮----
const initPaymentStateWorkaround = (
  params: PagoPaPaymentParams,
  dispatch: Dispatch<Action>
) =>
⋮----
const startPaymentFlowWorkaround = (
  rptId: RptId,
  dispatch: Dispatch<Action>,
  navigate: <T extends keyof AppParamsList>(
    ...args: NavigationParams<T>
  ) => void,
  params: PagoPaPaymentParams
) =>
</file>

<file path="apps/main-app/ts/features/payments/checkout/types/index.ts">
export enum WalletPaymentStepEnum {
  NONE = 0,
  PICK_PAYMENT_METHOD = 1,
  PICK_PSP = 2,
  CONFIRM_TRANSACTION = 3
}
⋮----
export type PaymentStartOrigin =
  | "donation"
  | "manual_insertion"
  | "message"
  | "poste_datamatrix_scan"
  | "qrcode_scan";
⋮----
export type WalletPaymentPspSortType = "amount" | "default" | "name";
</file>

<file path="apps/main-app/ts/features/payments/checkout/types/PaymentGenericErrorAfterUserCancellationProblemJson.ts">
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
enum FaultCodeCategoryEnum {
  PAYMENT_GENERIC_ERROR_AFTER_USER_CANCELLATION = "PAYMENT_GENERIC_ERROR_AFTER_USER_CANCELLATION"
}
⋮----
export type PaymentGenericErrorAfterUserCancellationProblemJson = t.TypeOf<
  typeof PaymentGenericErrorAfterUserCancellationProblemJson
>;
</file>

<file path="apps/main-app/ts/features/payments/checkout/types/PaymentOutcomeEnum.ts">
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
export enum WalletPaymentOutcomeEnum {
  AUTH_ERROR = "2",
  AUTH_REQUEST_ERROR = "1000",
  BE_NODE_KO = "99",
  CANCELED_BY_USER = "8",
  CIRCUIT_ERROR = "5",
  CVV_ERROR = "117",
  DUPLICATE_ORDER = "9",
  EXCESSIVE_AMOUNT = "10",
  GENERIC_ERROR = "1",
  IN_APP_BROWSER_CLOSED_BY_USER = "24",
  INSUFFICIENT_AVAILABILITY_ERROR = "116",
  INVALID_CARD = "7",
  INVALID_DATA = "3",
  INVALID_METHOD = "12",
  INVALID_SESSION = "14",
  KO_RETRIABLE = "13",
  METHOD_NOT_ENABLED = "15",
  MISSING_FIELDS = "6",
  ORDER_NOT_PRESENT = "11",
  PAYMENT_REVERSED = "18",
  PAYPAL_REMOVED_ERROR = "19",
  PLAFOND_LIMIT_ERROR = "121",
  PSP_ERROR = "25",
  SUCCESS = "0",
  TIMEOUT = "4",
  WAITING_CONFIRMATION_EMAIL = "17"
}
⋮----
export type WalletPaymentOutcome = t.TypeOf<typeof WalletPaymentOutcome>;
⋮----
export function getWalletPaymentOutcomeEnumByValue(
  value: string
): string | undefined
</file>

<file path="apps/main-app/ts/features/payments/checkout/types/PaymentSlowdownErrorProblemJson.ts">
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
export enum FaultCodeCategoryEnum {
  PAYMENT_SLOWDOWN_ERROR = "PAYMENT_SLOWDOWN_ERROR"
}
⋮----
export type PaymentSlowdownErrorProblemJson = t.TypeOf<
  typeof PaymentSlowdownErrorProblemJson
>;
</file>

<file path="apps/main-app/ts/features/payments/checkout/types/PaymentVerifyGenericErrorProblemJson.ts">
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
export enum FaultCodeCategoryEnum {
  PAYMENT_VERIFY_GENERIC_ERROR = "PAYMENT_VERIFY_GENERIC_ERROR"
}
⋮----
export type PaymentVerifyGenericErrorProblemJson = t.TypeOf<
  typeof PaymentVerifyGenericErrorProblemJson
>;
</file>

<file path="apps/main-app/ts/features/payments/checkout/types/PspPaymentMethodNotAvailableProblemJson.ts">
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
export enum FaultCodeCategoryEnum {
  PSP_PAYMENT_METHOD_NOT_AVAILABLE_ERROR = "PSP_PAYMENT_METHOD_NOT_AVAILABLE_ERROR"
}
⋮----
export type PspPaymentMethodNotAvailableProblemJson = t.TypeOf<
  typeof PspPaymentMethodNotAvailableProblemJson
>;
</file>

<file path="apps/main-app/ts/features/payments/checkout/types/WalletPaymentFailure.ts">
import { GatewayFaultPaymentProblemJson } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/GatewayFaultPaymentProblemJson";
import { PartyConfigurationFaultPaymentProblemJson } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PartyConfigurationFaultPaymentProblemJson";
import { PaymentCanceledStatusFaultPaymentProblemJson } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentCanceledStatusFaultPaymentProblemJson";
import { PaymentDuplicatedStatusFaultPaymentProblemJson } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentDuplicatedStatusFaultPaymentProblemJson";
import { PaymentExpiredStatusFaultPaymentProblemJson } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentExpiredStatusFaultPaymentProblemJson";
import { PaymentOngoingStatusFaultPaymentProblemJson } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentOngoingStatusFaultPaymentProblemJson";
import { ValidationFaultPaymentDataErrorProblemJson } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/ValidationFaultPaymentDataErrorProblemJson";
import { ValidationFaultPaymentUnavailableProblemJson } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/ValidationFaultPaymentUnavailableProblemJson";
import { ValidationFaultPaymentUnknownProblemJson } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/ValidationFaultPaymentUnknownProblemJson";
⋮----
import { PaymentGenericErrorAfterUserCancellationProblemJson } from "./PaymentGenericErrorAfterUserCancellationProblemJson";
import { PaymentSlowdownErrorProblemJson } from "./PaymentSlowdownErrorProblemJson";
import { PaymentVerifyGenericErrorProblemJson } from "./PaymentVerifyGenericErrorProblemJson";
import { PspPaymentMethodNotAvailableProblemJson } from "./PspPaymentMethodNotAvailableProblemJson";
⋮----
export type WalletPaymentFailure = t.TypeOf<typeof WalletPaymentFailure>;
</file>

<file path="apps/main-app/ts/features/payments/checkout/utils/index.ts">
import { ZendeskSubCategoriesMap } from "@io-app/api-types/generated/definitions/content/ZendeskSubCategoriesMap";
import { Bundle } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/Bundle";
import { PaymentMethodManagementTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentMethodManagementType";
import { PaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentMethodResponse";
import { PaymentMethodStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentMethodStatus";
⋮----
import { format } from "../../../../utils/dates";
import {
  PaymentAnalyticsPhase,
  PaymentAnalyticsPspFlag
} from "../../common/types/PaymentAnalytics";
import { WalletPaymentStepEnum } from "../types";
⋮----
export const isValidPaymentMethod = (method: PaymentMethodResponse)
⋮----
export const getPspFlagType = (
  psp: Bundle,
  pspList?: ReadonlyArray<Bundle>
): PaymentAnalyticsPspFlag =>
⋮----
export const getPreselectedPspFlagType = (
  pspList?: ReadonlyArray<Bundle>
): PaymentAnalyticsPspFlag =>
⋮----
export const getPaymentPhaseFromStep = (
  step: WalletPaymentStepEnum
): PaymentAnalyticsPhase =>
⋮----
export const trimAndLimitValue = (value: string, maxLength: number): string =>
⋮----
export const formatAndValidateDueDate = (date: string): string | undefined =>
⋮----
export const getSubCategoryFromFaultCode = (
  data: ZendeskSubCategoriesMap,
  statusCode: string
) =>
</file>

<file path="apps/main-app/ts/features/payments/common/api/client.ts">
import { createClient as createBizEventsClient } from "@io-app/api-types/generated/definitions/pagopa/biz-events/client";
import { createClient as createECommerceClient } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/client";
import { createClient as createPagoPaPlatformClient } from "@io-app/api-types/generated/definitions/pagopa/platform/client";
import { createClient } from "@io-app/api-types/generated/definitions/pagopa/walletv3/client";
⋮----
import { defaultRetryingFetch } from "../../../../utils/fetch";
⋮----
export const createWalletClient = (baseUrl: string)
⋮----
export const createPaymentClient = (baseUrl: string)
⋮----
export const createTransactionClient = (baseUrl: string)
⋮----
export const createPagoPaClient = (baseUrl: string, walletToken: string)
⋮----
export type PagoPaClient = ReturnType<typeof createPagoPaClient>;
export type PaymentClient = ReturnType<typeof createPaymentClient>;
export type TransactionClient = ReturnType<typeof createTransactionClient>;
export type WalletClient = ReturnType<typeof createWalletClient>;
</file>

<file path="apps/main-app/ts/features/payments/common/components/utils/BankLogoOrLoadingSkeleton.tsx">
import { IOColors, IOSkeleton } from "@io-app/design-system";
import { useEffect, useState } from "react";
import { Image } from "react-native";
⋮----
import { getBankLogosCdnUri } from "../../../../../components/ui/utils/strings";
⋮----
type BankLogoOrSkeletonProps = {
  abiCode?: string;
  dimensions: { height: number; width: number };
  imageA11yLabel?: string;
  placeHolderColor?: IOColors;
};
</file>

<file path="apps/main-app/ts/features/payments/common/components/PaymentCard.tsx">
import {
  BodySmall,
  H6,
  hexToRgba,
  IOColors,
  IODimensions,
  IOSkeleton,
  Tag,
  useIOTheme,
  useIOThemeContext,
  VStack,
  WithTestID
} from "@io-app/design-system";
import { format } from "date-fns";
import I18n from "i18next";
import { capitalize } from "lodash";
import { StyleSheet, View } from "react-native";
⋮----
import BPayLogo from "../../../../../img/wallet/payment-methods/bpay_logo_full.svg";
import PayPalLogo from "../../../../../img/wallet/payment-methods/paypal/paypal_logo_ext.svg";
import { LogoPaymentWithFallback } from "../../../../components/ui/utils/components/LogoPaymentWithFallback";
⋮----
export type PaymentCardComponentProps = WithTestID<
  | (PaymentCardProps & {
      isLoading?: false;
    })
  | {
      isLoading: true;
    }
>;
⋮----
export type PaymentCardProps = {
  brand?: string;
  expireDate?: Date;
  holderEmail?: string;
  holderName?: string;
  holderPhone?: string;
  hpan?: string;
  isExpired?: boolean;
};
⋮----
const usePaymentCardStyles = () =>
⋮----
accessibilityLabel=
⋮----
</file>

<file path="apps/main-app/ts/features/payments/common/components/PaymentCardSmall.tsx">
import {
  hexToRgba,
  Icon,
  IOColors,
  IODimensions,
  IOSkeleton,
  LabelMini,
  useIOTheme,
  useIOThemeContext,
  VSpacer
} from "@io-app/design-system";
import { useMemo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { LogoPaymentWithFallback } from "../../../../components/ui/utils/components/LogoPaymentWithFallback";
import { WithTestID } from "../../../../types/WithTestID";
import { WalletCardPressableBase } from "../../../wallet/components/WalletCardPressableBase";
import { PaymentCardProps } from "./PaymentCard";
⋮----
export type PaymentCardSmallProps = WithTestID<
  PaymentCardProps & {
    accessibilityLabel?: string;
    bankName?: string;
    onPress?: () => void;
  }
>;
⋮----
const usePaymentCardStyles = () =>
</file>

<file path="apps/main-app/ts/features/payments/common/components/PaymentListItemInfo.tsx">
import { ListItemInfo } from "@io-app/design-system";
import { ComponentProps } from "react";
⋮----
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
⋮----
type Props = ComponentProps<typeof ListItemInfo> & {
  copyable?: boolean;
  copyableValue?: string;
};
⋮----
export const PaymentListItemInfo = ({
  copyable = true,
  copyableValue,
  value,
  ...rest
}: Props) =>
⋮----
const handleOnCopy = () =>
</file>

<file path="apps/main-app/ts/features/payments/common/components/PaymentWebView.tsx">
import { useRef, useState } from "react";
import { Linking } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import WebView from "react-native-webview";
⋮----
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton";
import { isDevEnv } from "../../../../utils/environment";
import { getIntentFallbackUrl } from "../../../authentication/common/utils";
import { WALLET_WEBVIEW_OUTCOME_SCHEMA } from "../../common/utils/const";
⋮----
type PaymentWebViewProps<T> = {
  cancelOutcome: T;
  errorOutcome: T;
  onCancel?: (outcome: T) => void;
  onError?: (outcome: T) => void;
  onSuccess?: (url: string) => void;
  originWhiteList?: Array<string>;
  url: string;
};
⋮----
if (url === "about:blank" && isTopFrame)
</file>

<file path="apps/main-app/ts/features/payments/common/hooks/usePaymentsBackoffRetry.tsx">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { increasePaymentsBackoffRetry } from "../store/actions";
import { paymentsBackoffRetrySelector } from "../store/selectors";
import { PaymentsBackoffRetry } from "../types/PaymentsBackoffRetry";
import {
  getTimeRemainingText,
  isBackoffRetryTimeElapsed
} from "../utils/backoffRetry";
⋮----
export const usePaymentsBackoffRetry = (id: PaymentsBackoffRetry) =>
⋮----
const canRetryRequest = (showToast = true) =>
</file>

<file path="apps/main-app/ts/features/payments/common/saga/cleanExpiredPaymentsOngoingFailed.ts">
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import { SagaIterator } from "redux-saga";
import { put, select } from "typed-redux-saga/macro";
⋮----
import { removeExpiredPaymentsOngoingFailedAction } from "../../history/store/actions";
import { selectPaymentsOngoingFailed } from "../../history/store/selectors";
</file>

<file path="apps/main-app/ts/features/payments/common/saga/handlePaymentsSessionToken.ts">
import { call, put, race, select, take } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import {
  RefreshThirdPartyApiCallOptions,
  ThirdPartyTokenError,
  withThirdPartyRefreshApiCall
} from "../../../authentication/fastLogin/saga/utils";
import { PagoPaClient } from "../../common/api/client";
import {
  paymentsGetPagoPaPlatformSessionTokenAction,
  savePaymentsPendingAction
} from "../store/actions";
import { selectPagoPaPlatformSessionToken } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/payments/common/saga/handleResumePaymentsPendingActions.ts">
import { put, select } from "typed-redux-saga/macro";
⋮----
import { clearPaymentsPendingActions } from "../store/actions";
import { selectPagoPaPlatformPendingActions } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/payments/common/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { fork, select, takeLatest } from "typed-redux-saga/macro";
⋮----
import { walletApiBaseUrl, walletApiUatBaseUrl } from "../../../../config";
import { isPagoPATestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { watchPaymentsCheckoutSaga } from "../../checkout/saga";
import { watchPaymentsMethodDetailsSaga } from "../../details/saga";
import { watchPaymentsOnboardingSaga } from "../../onboarding/saga";
import { watchPaymentsReceiptSaga } from "../../receipts/saga";
import { watchPaymentsWalletSaga } from "../../wallet/saga";
import {
  createPagoPaClient,
  createPaymentClient,
  createTransactionClient,
  createWalletClient
} from "../api/client";
import { paymentsGetPagoPaPlatformSessionTokenAction } from "../store/actions";
import { cleanExpiredPaymentsOngoingFailed } from "./cleanExpiredPaymentsOngoingFailed";
import { handlePaymentsSessionToken } from "./handlePaymentsSessionToken";
import { handleResumePaymentsPendingActions } from "./handleResumePaymentsPendingActions";
</file>

<file path="apps/main-app/ts/features/payments/common/store/actions/index.ts">
import { SessionTokenResponse } from "@io-app/api-types/generated/definitions/pagopa/platform/SessionTokenResponse";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import { PaymentsCheckoutActions } from "../../../checkout/store/actions";
import { PaymentsMethodDetailsActions } from "../../../details/store/actions";
import { PaymentsHistoryActions } from "../../../history/store/actions";
import { PaymentsHomeActions } from "../../../home/store/actions";
import { PaymentsOnboardingActions } from "../../../onboarding/store/actions";
import { PaymentsReceiptActions } from "../../../receipts/store/actions";
import { PaymentsWalletActions } from "../../../wallet/store/actions";
import { PaymentsBackoffRetry } from "../../types/PaymentsBackoffRetry";
⋮----
type PaymentsPendingActionPayload = { pendingAction: Action };
⋮----
export type PaymentsActions =
  | ActionType<typeof clearPaymentsBackoffRetry>
  | ActionType<typeof clearPaymentsPendingActions>
  | ActionType<typeof increasePaymentsBackoffRetry>
  | ActionType<typeof paymentsGetPagoPaPlatformSessionTokenAction>
  | ActionType<typeof paymentsResetPagoPaPlatformSessionTokenAction>
  | ActionType<typeof savePaymentsPendingAction>
  | PaymentsCheckoutActions
  | PaymentsHistoryActions
  | PaymentsHomeActions
  | PaymentsMethodDetailsActions
  | PaymentsOnboardingActions
  | PaymentsReceiptActions
  | PaymentsWalletActions;
</file>

<file path="apps/main-app/ts/features/payments/common/store/reducers/index.ts">
import { combineReducers } from "redux";
import { PersistPartial } from "redux-persist";
⋮----
import paymentReducer, {
  PaymentsCheckoutState
} from "../../../checkout/store/reducers";
import detailsReducer, {
  PaymentsMethodDetailsState
} from "../../../details/store/reducers";
import historyReducer, {
  PaymentsHistoryState
} from "../../../history/store/reducers";
import homeReducer, { PaymentsHomeState } from "../../../home/store/reducers";
import onboardingReducer, {
  PaymentsOnboardingState
} from "../../../onboarding/store/reducers";
import receiptReducer, {
  ReceiptTransactionState
} from "../../../receipts/store/reducers";
import paymentsWalletReducer, {
  PaymentsWalletState
} from "../../../wallet/store/reducers";
import paymentsPagoPaPlatformReducer, {
  PaymentsPagoPaPlatformState
} from "./pagoPaPlatformReducer";
import paymentsBackoffRetryReducer, {
  PaymentsBackoffRetryState
} from "./paymentsBackoffRetryReducer";
⋮----
export type PaymentsState = {
  checkout: PaymentsCheckoutState;
  details: PaymentsMethodDetailsState & PersistPartial;
  history: PaymentsHistoryState & PersistPartial;
  home: PaymentsHomeState & PersistPartial;
  onboarding: PaymentsOnboardingState;
  pagoPaPlatform: PaymentsPagoPaPlatformState;
  paymentsBackoffRetry: PaymentsBackoffRetryState;
  receipt: ReceiptTransactionState;
  wallet: PaymentsWalletState;
};
</file>

<file path="apps/main-app/ts/features/payments/common/store/reducers/pagoPaPlatformReducer.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import {
  clearPaymentsPendingActions,
  paymentsGetPagoPaPlatformSessionTokenAction,
  paymentsResetPagoPaPlatformSessionTokenAction,
  savePaymentsPendingAction
} from "../actions";
⋮----
export type PaymentsPagoPaPlatformState = {
  pendingActions: Array<Action>;
  sessionToken: pot.Pot<string, NetworkError>;
};
⋮----
const reducer = (
  state: PaymentsPagoPaPlatformState = INITIAL_STATE,
  action: Action
): PaymentsPagoPaPlatformState =>
</file>

<file path="apps/main-app/ts/features/payments/common/store/reducers/paymentsBackoffRetryReducer.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import {
  PAYMENTS_BACKOFF_SECONDS_DELAYS,
  SECONDS_TO_MILLISECONDS
} from "../../utils/backoffRetry";
import { PaymentsBackoffRetryValue } from "../../utils/types";
import {
  clearPaymentsBackoffRetry,
  increasePaymentsBackoffRetry
} from "../actions";
⋮----
export type PaymentsBackoffRetryState = {
  [key: string]: PaymentsBackoffRetryValue | undefined;
};
⋮----
const reducer = (
  state: PaymentsBackoffRetryState = INITIAL_STATE,
  action: Action
): PaymentsBackoffRetryState =>
</file>

<file path="apps/main-app/ts/features/payments/common/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { PaymentsBackoffRetry } from "../../types/PaymentsBackoffRetry";
⋮----
export const selectPaymentsCheckoutState = (state: GlobalState)
⋮----
export const selectPaymentsBackoffRetryState = (state: GlobalState)
⋮----
export const paymentsBackoffRetrySelector = (id: PaymentsBackoffRetry)
</file>

<file path="apps/main-app/ts/features/payments/common/types/PaymentAnalytics.ts">
import { Bundle } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/Bundle";
import { PaymentRequestsGetResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentRequestsGetResponse";
import { WalletInfo as EcommerceWalletInfo } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletInfo";
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
⋮----
import { PaymentStartOrigin } from "../../checkout/types";
⋮----
export type PaymentAnalyticsBrowserType = "inapp_browser" | "webview";
⋮----
export type PaymentAnalyticsData = {
  attempt?: number;
  browserType?: PaymentAnalyticsBrowserType;
  formattedAmount?: string;
  is_onboarded?: boolean;
  paymentsHomeStatus?: PaymentsAnalyticsHomeStatus;
  pspList?: ReadonlyArray<Bundle>;
  receiptEventId?: string;
  receiptFirstTimeOpening?: boolean;
  receiptFirstTimeOpeningPDF?: boolean;
  receiptOrganizationFiscalCode?: string;
  receiptOrganizationName?: string;
  receiptPayerFiscalCode?: string;
  receiptUser?: PaymentsAnalyticsReceiptUser;
  savedPaymentMethods?: ReadonlyArray<EcommerceWalletInfo | WalletInfo>;
  savedPaymentMethodsUnavailable?: ReadonlyArray<
    EcommerceWalletInfo | WalletInfo
  >;
  selectedPaymentMethod?: string;
  selectedPsp?: string;
  selectedPspFlag?: PaymentAnalyticsPspFlag;
  serviceName?: string;
  startOrigin?: PaymentStartOrigin;
  transactionsHomeLength?: number;
  verifiedData?: PaymentRequestsGetResponse;
};
⋮----
export type PaymentAnalyticsEditingType = "payment_method" | "psp";
⋮----
export type PaymentAnalyticsPhase = "attiva" | "pagamento" | "verifica";
⋮----
export type PaymentAnalyticsPspFlag =
  | "cheaper"
  | "customer"
  | "none"
  | "unique";
⋮----
export type PaymentAnalyticsSelectedMethodFlag = "last_used" | "none" | "saved";
⋮----
export type PaymentsAnalyticsHomeAddWalletEntryPoint =
  | "payments_home"
  | "wallet_home";
⋮----
export type PaymentsAnalyticsHomeStatus =
  | "complete"
  | "empty"
  | "empty method"
  | "empty receipts";
⋮----
export type PaymentsAnalyticsReceiptUser = "payee" | "payer";
</file>

<file path="apps/main-app/ts/features/payments/common/types/PaymentsBackoffRetry.ts">
export type PaymentsBackoffRetry =
  | "PAYMENTS_HOME_TRANSACTIONS_LIST_BACKOFF"
  | "PAYMENTS_HOME_USER_METHODS_BACKOFF"
  | "WALLET_OTHER_CARDS_CATEGORY_BACKOFF";
</file>

<file path="apps/main-app/ts/features/payments/common/types/UIWalletInfoDetails.ts">
import {
  WalletInfoDetails1,
  WalletInfoDetails2,
  WalletInfoDetails3
} from "@io-app/api-types/generated/definitions/pagopa/ecommerce/WalletInfoDetails";
⋮----
export type UIWalletInfoDetails = t.TypeOf<typeof UIWalletInfoDetails>;
</file>

<file path="apps/main-app/ts/features/payments/common/utils/__test__/index.test.ts">
import { formatPaymentNoticeNumber } from "..";
</file>

<file path="apps/main-app/ts/features/payments/common/utils/backoffRetry.ts">
import I18n from "i18next";
⋮----
export const getTimeRemainingText = (targetDate: Date | number): string =>
⋮----
export const isBackoffRetryTimeElapsed = (
  allowRetryTimestamp?: number
): boolean
</file>

<file path="apps/main-app/ts/features/payments/common/utils/const.ts">

</file>

<file path="apps/main-app/ts/features/payments/common/utils/index.ts">
import { LevelEnum } from "@io-app/api-types/generated/definitions/content/SectionStatus";
import { NoticeListItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeListItem";
import { Bundle } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/Bundle";
import { WalletApplicationStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletApplicationStatus";
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
import {
  IOLogoPaymentType,
  IOPaymentLogos,
  ListItemTransactionBadge
} from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import _ from "lodash";
⋮----
import { contentRepoUrl } from "../../../../config";
import { getDateFromExpiryDate, isExpiredDate } from "../../../../utils/dates";
import { findFirstCaseInsensitive } from "../../../../utils/object";
import { WalletCard } from "../../../wallet/types";
import { WalletPaymentPspSortType } from "../../checkout/types";
import { PaymentCardProps } from "../components/PaymentCard";
import { UIWalletInfoDetails } from "../types/UIWalletInfoDetails";
import { AlertVariant, ListItemTransactionStatus } from "./types";
⋮----
export const getBadgePropsByTransactionStatus = (
  transactionStatus: ListItemTransactionStatus
): ListItemTransactionBadge =>
⋮----
export const isPaymentMethodExpired = (
  details?: UIWalletInfoDetails
): boolean
⋮----
const hasApplicationEnabled = (
  paymentMethod: undefined | WalletInfo,
  walletApplication: string
): boolean
⋮----
export const hasPaymentFeature = (paymentMethod: WalletInfo): boolean
⋮----
export const getSortedPspList = (
  pspList: ReadonlyArray<Bundle>,
  sortType: WalletPaymentPspSortType
) =>
⋮----
export const getPaymentCardPropsFromWalletInfo = (
  wallet: WalletInfo
): PaymentCardProps =>
⋮----
export const getPaymentLogoFromWalletDetails = (
  details: UIWalletInfoDetails
): IOLogoPaymentType | undefined =>
⋮----
export const getTransactionLogo = (transaction: NoticeListItem)
⋮----
export const mapWalletIdToCardKey = (walletId: string) => `method_$
⋮----
export const mapWalletsToCards = (
  wallets: ReadonlyArray<WalletInfo>
): ReadonlyArray<WalletCard>
⋮----
export const formatPaymentNoticeNumber = (noticeNumber: string)
⋮----
export const getAlertVariant = (level: LevelEnum): AlertVariant =>
</file>

<file path="apps/main-app/ts/features/payments/common/utils/types.ts">
export type AlertVariant = "error" | "info" | "success" | "warning";
⋮----
export type ListItemTransactionStatus =
  | "cancelled"
  | "failure"
  | "pending"
  | "refunded"
  | "reversal"
  | "success";
⋮----
export type PaymentsBackoffRetryValue = {
  allowedRetryTimestamp?: number;
  retryCount: number;
};
</file>

<file path="apps/main-app/ts/features/payments/common/utils/validation.ts">
import { PaymentNoticeNumberFromString } from "@pagopa/io-pagopa-commons/lib/pagopa";
import {
  NonEmptyString,
  OrganizationFiscalCode
} from "@pagopa/ts-commons/lib/strings";
import { pipe } from "fp-ts/lib/function";
⋮----
export const decodePaymentNoticeNumber = (
  value?: string
): O.Option<PaymentNoticeNumberFromString>
⋮----
export const validatePaymentNoticeNumber = (value?: string): boolean
⋮----
export const decodeOrganizationFiscalCode = (
  value?: string
): O.Option<OrganizationFiscalCode>
⋮----
export const validateOrganizationFiscalCode = (value?: string): boolean
</file>

<file path="apps/main-app/ts/features/payments/common/utils/withPaymentsSessionToken.ts">
import {
  TypeofApiCall,
  TypeofApiParams,
  TypeofApiResponse
} from "@pagopa/ts-commons/lib/requests";
⋮----
import { Validation } from "io-ts";
import { call, put } from "typed-redux-saga/macro";
⋮----
import { Action } from "../../../../store/actions/types";
import { getOrFetchPagoPaPlatformSessionToken } from "../saga/handlePaymentsSessionToken";
import { paymentsResetPagoPaPlatformSessionTokenAction } from "../store/actions";
⋮----
type TokenKey = "Authorization" | "pagoPAPlatformSessionToken";
</file>

<file path="apps/main-app/ts/features/payments/details/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
⋮----
type WalletPaymentRemoveAnalyticsProps = {
  payment_method_selected: string;
  payment_method_status: "invalid" | "valid";
};
⋮----
export const trackWalletPaymentRemoveMethodStart = (
  props: Partial<WalletPaymentRemoveAnalyticsProps>
)
⋮----
export const trackWalletPaymentRemoveMethodConfirm = (
  props: Partial<WalletPaymentRemoveAnalyticsProps>
)
⋮----
export const trackWalletPaymentRemoveMethodSuccess = (
  props: Partial<WalletPaymentRemoveAnalyticsProps>
)
⋮----
export const trackWalletPaymentRemoveMethodFailure = (
  props: Partial<WalletPaymentRemoveAnalyticsProps>
)
⋮----
export const trackWalletPaymentMethodUpdateTap = (
  props: Partial<
    Omit<WalletPaymentRemoveAnalyticsProps, "payment_method_status">
  >
)
</file>

<file path="apps/main-app/ts/features/payments/details/components/PaymentsMethodDetailsBaseScreenComponent.tsx">
import {
  ContentWrapper,
  IOColors,
  IODimensions,
  IODimensionScale,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { PropsWithChildren, useState } from "react";
import {
  AccessibilityInfo,
  ColorValue,
  LayoutChangeEvent,
  StyleSheet,
  View
} from "react-native";
import Animated, {
  useAnimatedRef,
  useAnimatedScrollHandler,
  useSharedValue
} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import FocusAwareStatusBar from "../../../../components/ui/FocusAwareStatusBar";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import {
  PaymentCard,
  PaymentCardComponentProps
} from "../../common/components/PaymentCard";
⋮----
type Props = {
  card: PaymentCardComponentProps;
  headerTitle?: string;
};
⋮----
const PaymentsMethodDetailsBaseScreenComponent = ({
  card,
  headerTitle = "",
  children
}: PropsWithChildren<Props>) =>
⋮----
const getTitleHeight = (event: LayoutChangeEvent) =>
</file>

<file path="apps/main-app/ts/features/payments/details/components/PaymentsMethodDetailsDeleteButton.tsx">
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
import { IOToast, ListItemAction } from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { Alert, Platform } from "react-native";
⋮----
import { updateMixpanelProfileProperties } from "../../../../mixpanelConfig/profileProperties";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import { isPaymentMethodExpired } from "../../common/utils";
import { selectPaymentOnboardingMethods } from "../../onboarding/store/selectors";
import { getPaymentsWalletUserMethods } from "../../wallet/store/actions";
⋮----
import { paymentsDeleteMethodAction } from "../store/actions";
⋮----
type PaymentsDetailsDeleteMethodButtonProps = {
  paymentMethod?: WalletInfo;
};
⋮----
const PaymentsMethodDetailsDeleteButton = ({
  paymentMethod
}: PaymentsDetailsDeleteMethodButtonProps) =>
⋮----
const deleteWallet = (walletId: string) =>
⋮----
const onDeleteMethod = () =>
</file>

<file path="apps/main-app/ts/features/payments/details/components/PaymentsMethodDetailsErrorContent.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
</file>

<file path="apps/main-app/ts/features/payments/details/components/PaymentsMethodDetailsUpdateDataButton.tsx">
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
import { FooterActions, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { isPaymentMethodExpired } from "../../common/utils";
import { useWalletOnboardingWebView } from "../../onboarding/hooks/useWalletOnboardingWebView";
import { PaymentsOnboardingRoutes } from "../../onboarding/navigation/routes";
import { trackWalletPaymentMethodUpdateTap } from "../analytics";
⋮----
type PaymentsDetailsDeleteMethodButtonProps = {
  paymentMethod?: WalletInfo;
};
⋮----
const handleUpdatePress = () =>
</file>

<file path="apps/main-app/ts/features/payments/details/components/PaymentsMethodPspDetailsAlert.tsx">
import { Alert } from "@io-app/design-system";
import I18n from "i18next";
import Animated, { LinearTransition } from "react-native-reanimated";
⋮----
import { usePaymentsMethodPspDetailsBottomSheet } from "./PaymentsMethodPspDetailsBottomSheet";
import { PaymentsMethodPspPayPalBanner } from "./PaymentsMethodPspPayPalBanner";
⋮----
type PaymentsMethodPspDetailsAlertProps = {
  pspBusinessName: string;
};
⋮----
export const PaymentsMethodPspDetailsAlert = ({
  pspBusinessName
}: PaymentsMethodPspDetailsAlertProps) =>
</file>

<file path="apps/main-app/ts/features/payments/details/components/PaymentsMethodPspDetailsBottomSheet.tsx">
import { Body, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
⋮----
type PaymentsMethodPspDetailsBottomSheetProps = {
  pspBusinessName: string;
};
⋮----
const PaymentsMethodPspDetailsBottomSheet = ({
  pspBusinessName
}: PaymentsMethodPspDetailsBottomSheetProps) => (
  <>
    <Body>
      {I18n.t("features.payments.details.pspAlert.explainationContent", {
        pspBusinessName
      })}
    </Body>
    <VSpacer size={16} />
  </>
);
⋮----
export const usePaymentsMethodPspDetailsBottomSheet = (
  pspBusinessName: string
)
</file>

<file path="apps/main-app/ts/features/payments/details/components/PaymentsMethodPspPayPalBanner.tsx">
import { Banner, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { useRef } from "react";
import { View } from "react-native";
import Animated, { FadeOut } from "react-native-reanimated";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { paymentsPayPalBannerSetIsClosedAction } from "../store/actions";
import { walletPayPalBannerClosedSelector } from "../store/selectors";
⋮----
const PaymentsMethodPspPayPalBanner = () =>
⋮----
const handleOnCloseBanner = () =>
⋮----
<Animated.View exiting=
</file>

<file path="apps/main-app/ts/features/payments/details/components/WalletDetailsPagoPaPaymentCapability.tsx">
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
import { IOToast, ListItemSwitch } from "@io-app/design-system";
import I18n from "i18next";
import { FC, useState } from "react";
⋮----
import { useIODispatch } from "../../../../store/hooks";
import { hasPaymentFeature } from "../../common/utils";
import { paymentsTogglePagoPaCapabilityAction } from "../../details/store/actions";
⋮----
type Props = { paymentMethod: WalletInfo };
⋮----
const WalletDetailsPagoPaPaymentCapability: FC<Props> = props => {
  const dispatch = useIODispatch();
⋮----
const handleSwitchSuccess = () =>
⋮----
const handleSwitchError = () =>
⋮----
const handleSwitchPagoPaCapability = () =>
</file>

<file path="apps/main-app/ts/features/payments/details/components/WalletDetailsPaymentMethodFeatures.tsx">
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
import { Alert } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { isIdPayEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isPaymentMethodExpired } from "../../common/utils";
import PaymentMethodInitiatives from "./WalletDetailsPaymentMethodInitiatives";
import PaymentMethodSettings from "./WalletDetailsPaymentMethodSettings";
⋮----
type Props = { paymentMethod: WalletInfo };
</file>

<file path="apps/main-app/ts/features/payments/details/components/WalletDetailsPaymentMethodInitiatives.tsx">
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
import { Body, H6, VSpacer } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { ComponentProps, ReactElement, useCallback } from "react";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { IdPayInstrumentInitiativesList } from "../../../idpay/wallet/components/IdPayInstrumentInitiativesList";
import {
  idPayInitiativesFromInstrumentRefreshStart,
  idPayInitiativesFromInstrumentRefreshStop
} from "../../../idpay/wallet/store/actions";
import { idPayEnabledInitiativesFromInstrumentSelector } from "../../../idpay/wallet/store/reducers";
import { PaymentsMethodDetailsRoutes } from "../navigation/routes";
⋮----
type Props = Pick<ComponentProps<typeof View>, "style"> & {
  paymentMethod: WalletInfo;
};
⋮----
const navigateToPairableInitiativesList = ()
</file>

<file path="apps/main-app/ts/features/payments/details/components/WalletDetailsPaymentMethodSettings.tsx">
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
import { Divider, ListItemHeader } from "@io-app/design-system";
import I18n from "i18next";
import { ReactElement } from "react";
⋮----
import WalletDetailsPagoPaPaymentCapability from "./WalletDetailsPagoPaPaymentCapability";
⋮----
type Props = { paymentMethod: WalletInfo };
</file>

<file path="apps/main-app/ts/features/payments/details/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../utils/navigation";
import { IdPayInstrumentInitiativesScreen } from "../../../idpay/wallet/screens/IdPayInstrumentInitiativesScreen";
import PaymentsMethodDetailsScreen from "../screens/PaymentsMethodDetailsScreen";
import { PaymentsMethodDetailsParamsList } from "./params";
import { PaymentsMethodDetailsRoutes } from "./routes";
⋮----
export const PaymentsMethodDetailsNavigator = () => (
  <Stack.Navigator
    initialRouteName={PaymentsMethodDetailsRoutes.PAYMENT_METHOD_DETAILS_SCREEN}
    screenOptions={{ gestureEnabled: isGestureEnabled, headerShown: false }}
  >
    <Stack.Screen
      component={PaymentsMethodDetailsScreen}
      name={PaymentsMethodDetailsRoutes.PAYMENT_METHOD_DETAILS_SCREEN}
      options={{ gestureEnabled: isGestureEnabled, headerShown: false }}
    />
    <Stack.Screen
      component={IdPayInstrumentInitiativesScreen}
      name={PaymentsMethodDetailsRoutes.IDPAY_INITIATIVE_DETAILS_LIST}
    />
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/features/payments/details/navigation/params.ts">
import { IdPayInstrumentInitiativesScreenRouteParams } from "../../../idpay/wallet/screens/IdPayInstrumentInitiativesScreen";
import { PaymentsMethodDetailsScreenNavigationParams } from "../screens/PaymentsMethodDetailsScreen";
import { PaymentsMethodDetailsRoutes } from "./routes";
⋮----
export type PaymentsMethodDetailsParamsList = {
  [PaymentsMethodDetailsRoutes.IDPAY_INITIATIVE_DETAILS_LIST]: IdPayInstrumentInitiativesScreenRouteParams;
  [PaymentsMethodDetailsRoutes.PAYMENT_METHOD_DETAILS_NAVIGATOR]: undefined;
  [PaymentsMethodDetailsRoutes.PAYMENT_METHOD_DETAILS_SCREEN]: PaymentsMethodDetailsScreenNavigationParams;
};
</file>

<file path="apps/main-app/ts/features/payments/details/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/payments/details/saga/handleDeleteWalletDetails.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import {
  walletHideCards,
  walletRemoveCards,
  walletRestoreCards
} from "../../../wallet/store/actions/cards";
import { WalletClient } from "../../common/api/client";
import { mapWalletIdToCardKey } from "../../common/utils";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import {
  paymentsDeleteMethodAction,
  paymentsGetMethodDetailsAction
} from "../store/actions";
</file>

<file path="apps/main-app/ts/features/payments/details/saga/handleGetWalletDetails.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { walletAddCards } from "../../../wallet/store/actions/cards";
import { WalletClient } from "../../common/api/client";
import { mapWalletsToCards } from "../../common/utils";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import { paymentsGetMethodDetailsAction } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/payments/details/saga/handleTogglePagoPaCapability.ts">
import { WalletApplication } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletApplication";
import { WalletApplicationStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletApplicationStatus";
⋮----
import { put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { WalletClient } from "../../common/api/client";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import {
  paymentsGetMethodDetailsAction,
  paymentsTogglePagoPaCapabilityAction
} from "../store/actions";
import { selectPaymentMethodDetails } from "../store/selectors";
⋮----
const updatePagoPaApplicationStatus = (
  application: WalletApplication
): undefined | WalletApplicationStatusEnum =>
</file>

<file path="apps/main-app/ts/features/payments/details/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { WalletClient } from "../../common/api/client";
import {
  paymentsDeleteMethodAction,
  paymentsGetMethodDetailsAction,
  paymentsTogglePagoPaCapabilityAction
} from "../store/actions";
import { handleDeleteWalletDetails } from "./handleDeleteWalletDetails";
import { handleGetWalletDetails } from "./handleGetWalletDetails";
import { handleTogglePagoPaCapability } from "./handleTogglePagoPaCapability";
</file>

<file path="apps/main-app/ts/features/payments/details/screens/PaymentsMethodDetailsScreen.tsx">
import { VSpacer } from "@io-app/design-system";
⋮----
import { RouteProp, useRoute } from "@react-navigation/native";
import { useEffect } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isIdPayEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { capitalize } from "../../../../utils/strings";
import { idPayInitiativesFromInstrumentGet } from "../../../idpay/wallet/store/actions";
import { idPayAreInitiativesFromInstrumentLoadingSelector } from "../../../idpay/wallet/store/reducers";
import { UIWalletInfoDetails } from "../../common/types/UIWalletInfoDetails";
import { getPaymentCardPropsFromWalletInfo } from "../../common/utils";
import { PaymentsMethodDetailsBaseScreenComponent } from "../components/PaymentsMethodDetailsBaseScreenComponent";
import { PaymentsMethodDetailsDeleteButton } from "../components/PaymentsMethodDetailsDeleteButton";
import { PaymentsMethodDetailsErrorContent } from "../components/PaymentsMethodDetailsErrorContent";
import { PaymentsMethodDetailsUpdateDataButton } from "../components/PaymentsMethodDetailsUpdateDataButton";
import { PaymentsMethodPspDetailsAlert } from "../components/PaymentsMethodPspDetailsAlert";
import WalletDetailsPaymentMethodFeatures from "../components/WalletDetailsPaymentMethodFeatures";
import { PaymentsMethodDetailsParamsList } from "../navigation/params";
import { paymentsGetMethodDetailsAction } from "../store/actions";
import { selectPaymentMethodDetails } from "../store/selectors";
⋮----
export type PaymentsMethodDetailsScreenNavigationParams = Readonly<{
  walletId: string;
}>;
⋮----
type PaymentsMethodDetailsScreenRouteProps = RouteProp<
  PaymentsMethodDetailsParamsList,
  "PAYMENT_METHOD_DETAILS_SCREEN"
>;
⋮----
const getCardHeaderTitle = (details?: UIWalletInfoDetails) =>
</file>

<file path="apps/main-app/ts/features/payments/details/store/actions/index.ts">
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
type DeleteMethodPayload = {
  onFailure?: () => void;
  onSuccess?: () => void;
  walletId: string;
};
⋮----
type TogglePagoPaCapabilityPayload = {
  onFailure?: () => void;
  onSuccess?: () => void;
  walletId: string;
};
⋮----
export type PaymentsMethodDetailsActions =
  | ActionType<typeof paymentsDeleteMethodAction>
  | ActionType<typeof paymentsGetMethodDetailsAction>
  | ActionType<typeof paymentsPayPalBannerSetIsClosedAction>
  | ActionType<typeof paymentsTogglePagoPaCapabilityAction>;
</file>

<file path="apps/main-app/ts/features/payments/details/store/reducers/index.ts">
import { WalletApplicationStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletApplicationStatus";
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
⋮----
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import {
  paymentsGetMethodDetailsAction,
  paymentsPayPalBannerSetIsClosedAction,
  paymentsTogglePagoPaCapabilityAction
} from "../actions";
⋮----
export type PaymentsMethodDetailsState = {
  isWalletPayPalBannerClosed: boolean;
  walletDetails: pot.Pot<WalletInfo, NetworkError>;
};
⋮----
const reducer = (
  state: PaymentsMethodDetailsState = INITIAL_STATE,
  action: Action
): PaymentsMethodDetailsState =>
</file>

<file path="apps/main-app/ts/features/payments/details/store/selectors/index.ts">
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const selectPaymentMethodDetails = (state: GlobalState)
⋮----
export const walletPayPalBannerClosedSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/payments/history/store/actions/index.ts">
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { WalletPaymentOutcome } from "../../../checkout/types/PaymentOutcomeEnum";
import { PaymentAnalyticsBrowserType } from "../../../common/types/PaymentAnalytics";
⋮----
export type PaymentsHistoryActions =
  | ActionType<typeof removeExpiredPaymentsOngoingFailedAction>
  | ActionType<typeof storeNewPaymentAttemptAction>
  | ActionType<typeof storePaymentIsOnboardedAction>
  | ActionType<typeof storePaymentOutcomeToHistory>
  | ActionType<typeof storePaymentsBrowserTypeAction>;
</file>

<file path="apps/main-app/ts/features/payments/history/store/reducers/index.ts">
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
import AsyncStorage from "@react-native-async-storage/async-storage";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import _ from "lodash";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { differentProfileLoggedIn } from "../../../../../store/actions/crossSessions";
import { Action } from "../../../../../store/actions/types";
import { createSetTransform } from "../../../../../store/transforms/setTransform";
import { getLookUpId } from "../../../../../utils/pmLookUpId";
import {
  centsToAmount,
  formatNumberAmount
} from "../../../../../utils/stringBuilder";
import { clearCache } from "../../../../settings/common/store/actions";
⋮----
import {
  paymentsCalculatePaymentFeesAction,
  paymentsCreateTransactionAction,
  paymentsGetPaymentDetailsAction,
  paymentsGetPaymentTransactionInfoAction,
  paymentsGetPaymentUserMethodsAction
} from "../../../checkout/store/actions/networking";
import {
  initPaymentStateAction,
  selectPaymentMethodAction,
  selectPaymentPspAction
} from "../../../checkout/store/actions/orchestration";
import { WalletPaymentFailure } from "../../../checkout/types/WalletPaymentFailure";
import { getPspFlagType } from "../../../checkout/utils";
import {
  PaymentAnalyticsData,
  PaymentsAnalyticsHomeStatus
} from "../../../common/types/PaymentAnalytics";
⋮----
import {
  getPaymentsLatestReceiptAction,
  getPaymentsReceiptDetailsAction,
  getPaymentsReceiptDownloadAction
} from "../../../receipts/store/actions";
import { getPaymentsWalletUserMethods } from "../../../wallet/store/actions";
import { PaymentHistory } from "../../types";
import {
  removeExpiredPaymentsOngoingFailedAction,
  storeNewPaymentAttemptAction,
  storePaymentIsOnboardedAction,
  storePaymentOutcomeToHistory,
  storePaymentsBrowserTypeAction
} from "../actions";
⋮----
export type PaymentsHistoryState = {
  analyticsData?: PaymentAnalyticsData;
  archive: ReadonlyArray<PaymentHistory>;
  ongoingPayment?: PaymentHistory;
  paymentsOngoingFailed?: Record<RptId, PaymentsOngoingFailedClockTime>;
  PDFsOpened: Set<string>;
  receiptsOpened: Set<string>;
};
⋮----
type PaymentsOngoingFailedClockTime = {
  appClock: number;
  wallClock: number;
};
⋮----
const reducer = (
  state: PaymentsHistoryState = INITIAL_STATE,
  action: Action
): PaymentsHistoryState =>
⋮----
const getPaymentsHomeStatus = (
  savedPaymentMethods: number,
  transactions: number
): PaymentsAnalyticsHomeStatus =>
⋮----
const getPaymentAttemptByRptId = (state: PaymentsHistoryState, rptId: RptId)
⋮----
const appendItemToArchive = (
  archive: ReadonlyArray<PaymentHistory>,
  item: PaymentHistory
): ReadonlyArray<PaymentHistory>
⋮----
const updatePaymentHistory = (
  state: PaymentsHistoryState,
  data: PaymentHistory,
  newAttempt = false
): PaymentsHistoryState =>
</file>

<file path="apps/main-app/ts/features/payments/history/store/selectors/index.ts">
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const selectPaymentsHistoryArchive = (state: GlobalState)
⋮----
export const selectPaymentsOngoingFailed = (state: GlobalState)
⋮----
export const selectOngoingPaymentHistory = (state: GlobalState)
⋮----
export const paymentAnalyticsDataSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/payments/history/types/index.ts">
import { NewTransactionResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/NewTransactionResponse";
import { PaymentRequestsGetResponse } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/PaymentRequestsGetResponse";
import { RptId } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RptId";
⋮----
import { PaymentStartOrigin } from "../../checkout/types";
import { WalletPaymentOutcomeEnum } from "../../checkout/types/PaymentOutcomeEnum";
import { WalletPaymentFailure } from "../../checkout/types/WalletPaymentFailure";
⋮----
export type PaymentHistory = {
  attempt?: number;
  failure?: WalletPaymentFailure;
  lookupId?: string;
  outcome?: WalletPaymentOutcomeEnum;
  rptId?: RptId;
  startedAt?: Date;
  startOrigin?: PaymentStartOrigin;
  success?: true;
  transaction?: NewTransactionResponse;
  verifiedData?: PaymentRequestsGetResponse;
};
</file>

<file path="apps/main-app/ts/features/payments/home/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import {
  PaymentsAnalyticsHomeAddWalletEntryPoint,
  PaymentsAnalyticsHomeStatus
} from "../../common/types/PaymentAnalytics";
⋮----
type PaymentHomeAnalyticsProps = {
  add_entry_point: PaymentsAnalyticsHomeAddWalletEntryPoint;
  payments_home_status: PaymentsAnalyticsHomeStatus;
  saved_payment_method: number;
  wallet_item: "payment_method";
};
⋮----
type PaymentMethodAnalyticsProps = {
  payment_method_selected: string;
  payment_method_status: "invalid" | "valid";
  source: "payments" | "wallet";
};
⋮----
export const trackPaymentsHome = (
  props: Partial<PaymentHomeAnalyticsProps>
) =>
⋮----
export const trackPaymentsOpenReceiptListing = () =>
⋮----
export const trackPaymentStartDataEntry = (
  props: Partial<PaymentHomeAnalyticsProps>
) =>
⋮----
export const trackPaymentWalletAddStart = (
  props: Partial<PaymentHomeAnalyticsProps>
) =>
⋮----
export const trackPaymentWalletMethodDetail = (
  props: Partial<PaymentMethodAnalyticsProps>
) =>
</file>

<file path="apps/main-app/ts/features/payments/home/components/PaymentsAlertStatus.tsx">
import { Alert } from "@io-app/design-system";
import { constVoid } from "fp-ts/lib/function";
import I18n from "i18next";
import { GestureResponderEvent } from "react-native";
import Animated, {
  FadeIn,
  FadeOut,
  LinearTransition
} from "react-native-reanimated";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { sectionStatusByKeySelector } from "../../../../store/reducers/backendStatus/sectionStatus";
import {
  fallbackForLocalizedMessageKeys,
  getFullLocale
} from "../../../../utils/locale";
import { openWebUrl } from "../../../../utils/url";
import { getAlertVariant } from "../../common/utils";
⋮----
export const PaymentsAlertStatus = () =>
⋮----
const handleOnPressAlertStatusInfo = (_: GestureResponderEvent) =>
⋮----
entering=
</file>

<file path="apps/main-app/ts/features/payments/home/components/PaymentsCardsCarousel.tsx">
import { HSpacer, IODimensions, IODimensionScale } from "@io-app/design-system";
import { FlatList, FlatListProps, StyleSheet } from "react-native";
⋮----
import { WithTestID } from "../../../../types/WithTestID";
import {
  PAYMENT_CARD_SMALL_WIDTH,
  PaymentCardSmall,
  PaymentCardSmallProps,
  PaymentCardSmallSkeleton
} from "../../common/components/PaymentCardSmall";
⋮----
export type PaymentCardsCarouselProps = WithTestID<{
  cards: Array<PaymentCardSmallProps>;
}>;
</file>

<file path="apps/main-app/ts/features/payments/home/components/PaymentsHomeEmptyScreenContent.tsx">
import {
  Body,
  H4,
  IOButton,
  IODimensions,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { PaymentsBarcodeRoutes } from "../../barcode/navigation/routes";
⋮----
type Props = {
  withPictogram?: boolean;
};
⋮----
const handleOnAddMethodPress = () =>
⋮----
label=
</file>

<file path="apps/main-app/ts/features/payments/home/components/PaymentsHomeTransactionsList.tsx">
import { NoticeListItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeListItem";
import {
  BannerErrorState,
  ContentWrapper,
  Divider,
  ListItemHeader,
  ListItemTransaction
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { Fragment, useCallback, useEffect, useRef } from "react";
import { View } from "react-native";
import Animated, { LinearTransition } from "react-native-reanimated";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { usePaymentsBackoffRetry } from "../../common/hooks/usePaymentsBackoffRetry";
import { clearPaymentsBackoffRetry } from "../../common/store/actions";
import { PaymentsBackoffRetry } from "../../common/types/PaymentsBackoffRetry";
import { ReceiptListItemTransaction } from "../../receipts/components/ReceiptListItemTransaction";
import { PaymentsReceiptRoutes } from "../../receipts/navigation/routes";
import { getPaymentsLatestReceiptAction } from "../../receipts/store/actions";
import { walletLatestReceiptListPotSelector } from "../../receipts/store/selectors";
⋮----
import { isPaymentsLatestTransactionsEmptySelector } from "../store/selectors";
import { PaymentsHomeEmptyScreenContent } from "./PaymentsHomeEmptyScreenContent";
⋮----
type Props = {
  enforcedLoadingState?: boolean;
};
⋮----
const handleOnRetry = () =>
⋮----
const handleNavigateToTransactionList = () =>
⋮----
handleNavigateToTransactionDetails(latestTransaction)
</file>

<file path="apps/main-app/ts/features/payments/home/components/PaymentsHomeUserMethodsList.tsx">
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
import {
  Banner,
  BannerErrorState,
  IODimensions,
  IOToast,
  ListItemHeader,
  VSpacer
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { createRef, useCallback, useEffect, useMemo } from "react";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../utils/url";
import { PaymentCardSmallProps } from "../../common/components/PaymentCardSmall";
import { usePaymentsBackoffRetry } from "../../common/hooks/usePaymentsBackoffRetry";
import { clearPaymentsBackoffRetry } from "../../common/store/actions";
import { getPaymentCardPropsFromWalletInfo } from "../../common/utils";
import { PaymentsMethodDetailsRoutes } from "../../details/navigation/routes";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
import { PaymentsOnboardingRoutes } from "../../onboarding/navigation/routes";
import { getPaymentsWalletUserMethods } from "../../wallet/store/actions";
import { paymentsWalletUserMethodsSelector } from "../../wallet/store/selectors";
⋮----
import { paymentsSetAddMethodsBannerVisible } from "../store/actions";
import { isAddMethodsBannerVisibleSelector } from "../store/selectors";
import {
  PaymentCardsCarousel,
  PaymentCardsCarouselSkeleton
} from "./PaymentsCardsCarousel";
⋮----
type Props = {
  enforcedLoadingState?: boolean;
};
⋮----
const handleOnMethodPress =
(walletId: string, isExpired: boolean, payment_method_selected?: string)
⋮----
const handleOnAddMethodPress = () =>
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/payments/home/screens/PaymentsHomeScreen.tsx">
import { ContentWrapper } from "@io-app/design-system";
⋮----
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useState } from "react";
import Animated, {
  LinearTransition,
  useAnimatedRef
} from "react-native-reanimated";
⋮----
import {
  IOScrollView,
  IOScrollViewActions
} from "../../../../components/ui/IOScrollView";
import { useHeaderFirstLevel } from "../../../../hooks/useHeaderFirstLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { PaymentsBarcodeRoutes } from "../../barcode/navigation/routes";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
import { getPaymentsLatestReceiptAction } from "../../receipts/store/actions";
import { walletLatestReceiptListPotSelector } from "../../receipts/store/selectors";
import { getPaymentsWalletUserMethods } from "../../wallet/store/actions";
import { paymentsWalletUserMethodsSelector } from "../../wallet/store/selectors";
⋮----
import { PaymentsAlertStatus } from "../components/PaymentsAlertStatus";
import { PaymentsHomeEmptyScreenContent } from "../components/PaymentsHomeEmptyScreenContent";
import { PaymentsHomeTransactionsList } from "../components/PaymentsHomeTransactionsList";
import { PaymentsHomeUserMethodsList } from "../components/PaymentsHomeUserMethodsList";
import {
  isPaymentsLatestTransactionsEmptySelector,
  isPaymentsSectionEmptySelector,
  isPaymentsSectionLoadingFirstTimeSelector,
  isPaymentsSectionLoadingSelector
} from "../store/selectors";
⋮----
const PaymentsHomeScreen = () =>
⋮----
const handleOnPayNoticedPress = () =>
⋮----
const handleRefreshPaymentsHome = () =>
⋮----
const PaymentsHomeScreenContent = () =>
</file>

<file path="apps/main-app/ts/features/payments/home/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type PaymentsHomeActions = ActionType<
  typeof paymentsSetAddMethodsBannerVisible
>;
</file>

<file path="apps/main-app/ts/features/payments/home/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { paymentsSetAddMethodsBannerVisible } from "../actions";
⋮----
export type PaymentsHomeState = {
  shouldShowAddMethodsBanner: boolean;
};
⋮----
const reducer = (
  state: PaymentsHomeState = INITIAL_STATE,
  action: Action
): PaymentsHomeState =>
</file>

<file path="apps/main-app/ts/features/payments/home/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import {
  walletLatestReceiptListPotSelector,
  walletReceiptListPotSelector
} from "../../../receipts/store/selectors";
import { paymentsWalletUserMethodsSelector } from "../../../wallet/store/selectors";
⋮----
export const isAddMethodsBannerVisibleSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/payments/onboarding/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { WalletOnboardingOutcomeEnum } from "../types/OnboardingOutcomeEnum";
⋮----
type PaymentOnboardingAnalyticsProps = {
  payment_method_selected: string;
};
⋮----
type PaymentOnboardingContextualCardProps = {
  savedPaymentMethods: number;
};
⋮----
export const getOnboardingPaymentMethodOutcomeEvent = (
  outcome: WalletOnboardingOutcomeEnum
) =>
⋮----
export const trackAddOnboardingPaymentMethod = (
  outcome: WalletOnboardingOutcomeEnum,
  payment_method_selected: string | undefined
) =>
⋮----
export const trackPaymentOnboardingErrorHelp = (
  props: Partial<PaymentOnboardingAnalyticsProps> & { error: string }
) =>
⋮----
export const trackPaymentOnboardingContextualCard = (props: {
  is_onboarded: boolean;
}) =>
⋮----
export const trackPaymentOnboardingUserCancellationRequest = (
  props: Partial<PaymentOnboardingContextualCardProps>
) =>
⋮----
export const trackPaymentOnboardingUserCancellationBack = (
  props: Partial<PaymentOnboardingContextualCardProps>
) =>
⋮----
export const trackPaymentOnboardingUserCancellationContinue = (
  props: Partial<PaymentOnboardingContextualCardProps>
) =>
</file>

<file path="apps/main-app/ts/features/payments/onboarding/components/PaymentsOnboardingAuthErrorBottomSheet.tsx">
import { IOMarkdown, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
⋮----
export const usePaymentOnboardingAuthErrorBottomSheet = () =>
</file>

<file path="apps/main-app/ts/features/payments/onboarding/components/WalletOnboardingPaymentMethodsList.tsx">
import { PaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodResponse";
⋮----
import {
  Divider,
  IODimensions,
  ListItemNav,
  VSpacer
} from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import { FlatList } from "react-native";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { selectPaymentOnboardingSelectedMethod } from "../store/selectors";
import { WalletPaymentMethodItemSkeleton } from "./WalletPaymentMethodItemSkeleton";
⋮----
type OwnProps = Readonly<{
  isLoadingMethods?: boolean;
  isLoadingWebView?: boolean;
  onSelectPaymentMethod: (paymentMethod: PaymentMethodResponse) => void;
  paymentMethods: ReadonlyArray<PaymentMethodResponse>;
}>;
⋮----
type PaymentMethodItemProps = {
  isLoading?: boolean;
  onPress: () => void;
  paymentMethod: PaymentMethodResponse;
};
⋮----
const PaymentMethodItem = ({
  paymentMethod,
  isLoading,
  onPress
}: PaymentMethodItemProps) =>
⋮----
const WalletOnboardingPaymentMethodsList = ({
  paymentMethods,
  onSelectPaymentMethod,
  isLoadingMethods,
  isLoadingWebView
}: OwnProps) =>
⋮----
const isMethodLoading = (itemId: string)
const ListFooter = ()
⋮----
ItemSeparatorComponent=
⋮----
renderItem=
⋮----
isLoading=
</file>

<file path="apps/main-app/ts/features/payments/onboarding/components/WalletPaymentMethodItemSkeleton.tsx">
import { IODimensions, IOSkeleton, VSpacer } from "@io-app/design-system";
import { View } from "react-native";
⋮----
export const WalletPaymentMethodItemSkeleton = () => (
  <>
    <VSpacer />
    <View style={{ flexDirection: "row" }}>
      <View>
        <IOSkeleton
          radius={8}
          shape="square"
          size={IODimensions.size.icon.listItem}
        />
      </View>
      <View
        style={{
          flex: 1,
          paddingLeft: IODimensions.gap.listItem.default.leading
        }}
      >
        <IOSkeleton height={24} radius={8} shape="rectangle" width={"100%"} />
      </View>
    </View>
    <VSpacer />
  </>
);
</file>

<file path="apps/main-app/ts/features/payments/onboarding/hooks/useWalletOnboardingWebView.tsx">
import { openAuthSessionAsync } from "expo-web-browser";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { useCallback, useEffect, useState } from "react";
import { Platform } from "react-native";
import URLParse from "url-parse";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { PaymentsCheckoutRoutes } from "../../checkout/navigation/routes";
import { storePaymentIsOnboardedAction } from "../../history/store/actions";
⋮----
import {
  contextualOnboardingStartWebViewFlow,
  paymentsStartOnboardingAction
} from "../store/actions";
import { selectPaymentOnboardingRequestResult } from "../store/selectors";
import {
  WalletOnboardingOutcome,
  WalletOnboardingOutcomeEnum
} from "../types/OnboardingOutcomeEnum";
import { ONBOARDING_CALLBACK_URL_SCHEMA } from "../utils";
⋮----
export type WalletOnboardingOutcomeParams = {
  orderId?: string;
  outcome: WalletOnboardingOutcome;
  transactionId?: string;
  walletId?: string;
};
⋮----
type WalletOnboardingWebView = {
  isError: boolean;
  isLoading: boolean;
  isPendingOnboarding: boolean;
  startContextualOnboarding: (url: string) => void;
  startOnboarding: (paymentMethodId: string) => void;
};
⋮----
type WalletOnboardingWebViewProps = {
  onOnboardingOutcome: (params: WalletOnboardingOutcomeParams) => void;
};
⋮----
export const useWalletOnboardingWebView = ({
  onOnboardingOutcome
}: WalletOnboardingWebViewProps): WalletOnboardingWebView =>
⋮----
const startOnboarding = (paymentMethodId: string) =>
⋮----
const startContextualOnboarding = async (url: string) =>
</file>

<file path="apps/main-app/ts/features/payments/onboarding/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../utils/navigation";
import { PaymentsOnboardingFeedbackScreen } from "../screens/PaymentsOnboardingFeedbackScreen";
import { PaymentsOnboardingSelectMethodScreen } from "../screens/PaymentsOnboardingSelectMethodScreen";
import { PaymentsOnboardingParamsList } from "./params";
import { PaymentsOnboardingRoutes } from "./routes";
⋮----
export const PaymentsOnboardingNavigator = () => (
  <Stack.Navigator
    initialRouteName={
      PaymentsOnboardingRoutes.PAYMENT_ONBOARDING_RESULT_FEEDBACK
    }
    screenOptions={{ gestureEnabled: isGestureEnabled, headerShown: false }}
  >
    <Stack.Screen
      component={PaymentsOnboardingSelectMethodScreen}
      name={PaymentsOnboardingRoutes.PAYMENT_ONBOARDING_SELECT_METHOD}
      options={{ gestureEnabled: false, headerShown: true }}
    />
    <Stack.Screen
      component={PaymentsOnboardingFeedbackScreen}
      name={PaymentsOnboardingRoutes.PAYMENT_ONBOARDING_RESULT_FEEDBACK}
      options={{ gestureEnabled: false }}
    />
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/features/payments/onboarding/navigation/params.ts">
import { PaymentsOnboardingFeedbackScreenParams } from "../screens/PaymentsOnboardingFeedbackScreen";
import { PaymentsOnboardingRoutes } from "./routes";
⋮----
export type PaymentsOnboardingParamsList = {
  [PaymentsOnboardingRoutes.PAYMENT_ONBOARDING_NAVIGATOR]: undefined;
  [PaymentsOnboardingRoutes.PAYMENT_ONBOARDING_RESULT_FEEDBACK]: PaymentsOnboardingFeedbackScreenParams;
  [PaymentsOnboardingRoutes.PAYMENT_ONBOARDING_SELECT_METHOD]: undefined;
};
</file>

<file path="apps/main-app/ts/features/payments/onboarding/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/payments/onboarding/saga/handleGetPaymentMethods.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { WalletClient } from "../../common/api/client";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import { paymentsOnboardingGetMethodsAction } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/payments/onboarding/saga/handleStartWalletOnboarding.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { WalletClient } from "../../common/api/client";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import { paymentsStartOnboardingAction } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/payments/onboarding/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { WalletClient } from "../../common/api/client";
import {
  paymentsOnboardingGetMethodsAction,
  paymentsStartOnboardingAction
} from "../store/actions";
import { handleGetPaymentMethods } from "./handleGetPaymentMethods";
import { handleStartWalletOnboarding } from "./handleStartWalletOnboarding";
</file>

<file path="apps/main-app/ts/features/payments/onboarding/screens/PaymentsContextualOnboardingWebViewScreen.tsx">
import { HeaderSecondLevel } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useLayoutEffect } from "react";
import { Alert } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { walletContextualOnboardingWebViewPayloadSelector } from "../../checkout/store/selectors";
import PaymentWebView from "../../common/components/PaymentWebView";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
⋮----
import { WalletOnboardingOutcomeEnum } from "../types/OnboardingOutcomeEnum";
⋮----
const handleConfirmClose = () =>
⋮----
const handleOnSuccess = (url: string) =>
⋮----
const handleOnError = (error?: WalletOnboardingOutcomeEnum) =>
⋮----
const handleCloseAlert = () =>
⋮----
const promptUserToClose = () =>
</file>

<file path="apps/main-app/ts/features/payments/onboarding/screens/PaymentsOnboardingFeedbackScreen.tsx">
import { IOPictograms } from "@io-app/design-system";
⋮----
import { RouteProp, useNavigation, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useEffect, useRef } from "react";
import { View } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import {
  IOAnimatedPictograms,
  IOAnimatedPictogramsAssets
} from "../../../../components/ui/AnimatedPictogram";
import { updateMixpanelProfileProperties } from "../../../../mixpanelConfig/profileProperties";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import { trackHelpCenterCtaTapped } from "../../../../utils/analytics";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../utils/url";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { usePaymentFailureSupportModal } from "../../checkout/hooks/usePaymentFailureSupportModal";
import { PaymentsMethodDetailsRoutes } from "../../details/navigation/routes";
import { getPaymentsWalletUserMethods } from "../../wallet/store/actions";
⋮----
import { PaymentsOnboardingParamsList } from "../navigation/params";
import {
  selectPaymentOnboardingMethods,
  selectPaymentOnboardingSelectedMethod
} from "../store/selectors";
import {
  WalletOnboardingOutcome,
  WalletOnboardingOutcomeEnum
} from "../types/OnboardingOutcomeEnum";
⋮----
export type PaymentsOnboardingFeedbackScreenParams = {
  outcome: WalletOnboardingOutcome;
  walletId?: string;
};
⋮----
type PaymentsOnboardingFeedbackScreenRouteProps = RouteProp<
  PaymentsOnboardingParamsList,
  "PAYMENT_ONBOARDING_RESULT_FEEDBACK"
>;
⋮----
type OutcomeCopy = {
  primaryAction: string;
  subtitle: string | undefined;
  title: string;
};
⋮----
const getOutcomeCopy = (outcome: WalletOnboardingOutcome): OutcomeCopy =>
⋮----
const handleContinueButton = () =>
⋮----
const handleContactSupport = () =>
⋮----
const onPress = () =>
⋮----
const renderSecondaryAction = () =>
⋮----
const hasAnimation = (value: IOAnimatedPictograms | IOPictograms): boolean
</file>

<file path="apps/main-app/ts/features/payments/onboarding/screens/PaymentsOnboardingSelectMethodScreen.tsx">
import { PaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodResponse";
⋮----
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { usePreventScreenCapture } from "../../../../utils/hooks/usePreventScreenCapture";
import WalletOnboardingPaymentMethodsList from "../components/WalletOnboardingPaymentMethodsList";
import { useWalletOnboardingWebView } from "../hooks/useWalletOnboardingWebView";
import { PaymentsOnboardingRoutes } from "../navigation/routes";
import { paymentsOnboardingGetMethodsAction } from "../store/actions";
import { selectPaymentOnboardingMethods } from "../store/selectors";
⋮----
const handleSelectedPaymentMethod = (
    selectedPaymentMethod: PaymentMethodResponse
) =>
</file>

<file path="apps/main-app/ts/features/payments/onboarding/store/actions/index.ts">
import { PaymentMethodsResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodsResponse";
import { WalletCreateResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletCreateResponse";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
import { WalletOnboardingOutcomeEnum } from "../../types/OnboardingOutcomeEnum";
⋮----
export type ContextualOnboardingWebViewPayload = {
  onCancel?: (outcome?: WalletOnboardingOutcomeEnum) => void;
  onError?: (outcome?: WalletOnboardingOutcomeEnum) => void;
  onSuccess?: (url: string) => void;
  url: string;
};
⋮----
export type PaymentsOnboardingActions =
  | ActionType<typeof contextualOnboardingStartWebViewFlow>
  | ActionType<typeof paymentsOnboardingGetMethodsAction>
  | ActionType<typeof paymentsStartOnboardingAction>;
</file>

<file path="apps/main-app/ts/features/payments/onboarding/store/reducers/index.ts">
import { PaymentMethodsResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodsResponse";
import { WalletCreateResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletCreateResponse";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import {
  paymentsOnboardingGetMethodsAction,
  paymentsStartOnboardingAction
} from "../actions";
⋮----
export type PaymentsOnboardingState = {
  paymentMethods: pot.Pot<PaymentMethodsResponse, NetworkError>;
  result: pot.Pot<WalletCreateResponse, NetworkError>;
  selectedPaymentMethodId?: string;
};
⋮----
const reducer = (
  state: PaymentsOnboardingState = INITIAL_STATE,
  action: Action
): PaymentsOnboardingState =>
</file>

<file path="apps/main-app/ts/features/payments/onboarding/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { isMethodOnboardable } from "../../utils";
⋮----
const walletOnboardingSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/payments/onboarding/types/OnboardingOutcomeEnum.ts">
import { enumType } from "@pagopa/ts-commons/lib/types";
⋮----
export enum WalletOnboardingOutcomeEnum {
  ALREADY_ONBOARDED = "15",
  AUTH_ERROR = "2",
  BE_KO = "99",
  BPAY_NOT_FOUND = "16",
  CANCELED_BY_USER = "8",
  GENERIC_ERROR = "1",
  INVALID_SESSION = "14",
  PSP_ERROR_ONBOARDING = "25",
  SUCCESS = "0",
  TIMEOUT = "4"
}
⋮----
export type WalletOnboardingOutcome = t.TypeOf<typeof WalletOnboardingOutcome>;
⋮----
export function getWalletOnboardingOutcomeEnumByValue(
  value: string
): string | undefined
</file>

<file path="apps/main-app/ts/features/payments/onboarding/utils/index.ts">
import { PaymentMethodManagementTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodManagementType";
import { PaymentMethodResponse } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodResponse";
import { PaymentMethodStatusEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv3/PaymentMethodStatus";
⋮----
export const isMethodOnboardable = ({
  methodManagement,
  status
}: PaymentMethodResponse)
</file>

<file path="apps/main-app/ts/features/payments/receipts/analytics/index.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { PaymentsAnalyticsReceiptUser } from "../../common/types/PaymentAnalytics";
import { ReceiptsCategoryFilter } from "../types";
⋮----
export type HideReceiptTrigger = "swipe" | "tap";
⋮----
type PaymentReceiptAnalyticsProps = {
  first_time_opening: boolean;
  organization_fiscal_code: string;
  organization_name: string;
  payment_status: string;
  reason?: string;
  trigger: HideReceiptTrigger;
  user: PaymentsAnalyticsReceiptUser;
};
⋮----
export const trackPaymentsReceiptListing = () =>
⋮----
export const trackPaymentsOpenReceipt = (
  props: Partial<PaymentReceiptAnalyticsProps>
) =>
⋮----
export const trackPaymentsDownloadReceiptAction = (
  props: Partial<PaymentReceiptAnalyticsProps>
) =>
⋮----
export const trackPaymentsOpenSubReceipt = () =>
⋮----
export const trackPaymentsSaveAndShareReceipt = (
  props: Partial<PaymentReceiptAnalyticsProps>
) =>
export const trackPaymentsDownloadReceiptSuccess = (
  props: Partial<PaymentReceiptAnalyticsProps>
) =>
⋮----
export const trackPaymentsDownloadReceiptError = (
  props: Partial<PaymentReceiptAnalyticsProps>
) =>
⋮----
export const trackHideReceipt = (
  props: Partial<PaymentReceiptAnalyticsProps>
) =>
⋮----
export const trackHideReceiptConfirm = (
  props: Partial<PaymentReceiptAnalyticsProps>
) =>
⋮----
export const trackHideReceiptSuccess = (
  props: Partial<PaymentReceiptAnalyticsProps>
) =>
⋮----
export const trackHideReceiptFailure = (
  props: Partial<PaymentReceiptAnalyticsProps>
) =>
⋮----
export const trackReceiptFilterUsage = (
  filter: Partial<ReceiptsCategoryFilter>
) =>
</file>

<file path="apps/main-app/ts/features/payments/receipts/analytics/utils.ts">
import { PaymentAnalyticsData } from "../../common/types/PaymentAnalytics";
⋮----
export const analyticsHideReceiptAction = (
  paymentAnalyticsData?: PaymentAnalyticsData,
  trigger?: analytics.HideReceiptTrigger
)
⋮----
export const analyticsHideReceiptConfirmAction = (
  paymentAnalyticsData?: PaymentAnalyticsData,
  trigger?: analytics.HideReceiptTrigger
)
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/___tests___/HideReceiptButton.test.tsx">
import { NavigationContainer } from "@react-navigation/native";
import { fireEvent, render } from "@testing-library/react-native";
import I18n from "i18next";
import { Alert } from "react-native";
⋮----
import HideReceiptButton from "../HideReceiptButton";
⋮----
const renderComponent = ()
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/___tests___/ReceiptCartList.test.tsx">
import { CartItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/CartItem";
import { fireEvent, render } from "@testing-library/react-native";
⋮----
import { ReceiptCartList } from "../ReceiptCartList";
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/___tests___/ReceiptFeeAmountSection.test.tsx">
import {
  InfoNotice,
  OriginEnum
} from "@io-app/api-types/generated/definitions/pagopa/biz-events/InfoNotice";
import { render } from "@testing-library/react-native";
import I18n from "i18next";
⋮----
import ReceiptFeeAmountSection from "../ReceiptFeeAmountSection";
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/___tests___/ReceiptFilterTabs.test.tsx">
import { fireEvent, render } from "@testing-library/react-native";
⋮----
import { ReceiptsCategoryFilter, receiptsCategoryFilters } from "../../types";
import { ReceiptFilterTabs } from "../ReceiptFilterTabs";
⋮----
const renderComponent = (selectedCategory: ReceiptsCategoryFilter)
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/___tests___/ReceiptHeadingSection.test.tsx">
import { OriginEnum } from "@io-app/api-types/generated/definitions/pagopa/biz-events/InfoNotice";
import { NoticeDetailResponse } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeDetailResponse";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { PaymentsReceiptRoutes } from "../../navigation/routes";
import { ReceiptHeadingSection } from "../ReceiptHeadingSection";
⋮----
const renderComponent = (
  isLoading: boolean,
  transaction?: NoticeDetailResponse
) =>
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/___tests___/ReceiptInfoSection.test.tsx">
import {
  OriginEnum,
  PaymentMethodEnum
} from "@io-app/api-types/generated/definitions/pagopa/biz-events/InfoNotice";
import { NoticeDetailResponse } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeDetailResponse";
import { fireEvent, render } from "@testing-library/react-native";
⋮----
import I18n from "i18next";
⋮----
import ReceiptInfoSection from "../ReceiptInfoSection";
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/___tests___/ReceiptListItemTransaction.test.tsx">
import { NoticeListItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeListItem";
import { NavigationContainer } from "@react-navigation/native";
import { fireEvent, render } from "@testing-library/react-native";
import { JSX } from "react";
⋮----
import { ReceiptListItemTransaction } from "../ReceiptListItemTransaction";
⋮----
const renderWithNavigation = (component: JSX.Element)
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/___tests___/ReceiptLoadingList.test.tsx">
import { render } from "@testing-library/react-native";
⋮----
import { ReceiptLoadingList } from "../ReceiptLoadingList";
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/___tests___/ReceiptTotalAmount.test.tsx">
import { render } from "@testing-library/react-native";
import I18n from "i18next";
⋮----
import { formatAmountText } from "../../utils";
import { ReceiptTotalAmount } from "../ReceiptTotalAmount";
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/HideReceiptButton.tsx">
import { ContentWrapper, ListItemAction } from "@io-app/design-system";
import I18n from "i18next";
import { Alert } from "react-native";
import { useDispatch } from "react-redux";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
import { HideReceiptTrigger } from "../analytics";
import {
  analyticsHideReceiptAction,
  analyticsHideReceiptConfirmAction
} from "../analytics/utils";
import { hidePaymentsReceiptAction } from "../store/actions";
⋮----
type Props = {
  isCart?: boolean;
  transactionId: string;
  trigger?: HideReceiptTrigger;
};
⋮----
const HideReceiptButton = (props: Props) =>
⋮----
const hideReceipt = () =>
⋮----
const handleHideFromList = () =>
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptCartList.tsx">
import { CartItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/CartItem";
import {
  HStack,
  IOSkeleton,
  ListItemTransaction,
  VStack
} from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { getAccessibleAmountText } from "../../../../utils/accessibility";
import { formatAmountText } from "../utils";
⋮----
type Props = {
  carts?: ReadonlyArray<CartItem>;
  loading: boolean;
  onPress: (cartItem: CartItem) => void;
};
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptDivider.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import Svg, { Path } from "react-native-svg";
⋮----
export const ReceiptDivider = () =>
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptFadeInOutAnimationView.tsx">
import { IODimensions } from "@io-app/design-system";
import { memo, ReactNode } from "react";
import Animated, { FadeIn, FadeOut } from "react-native-reanimated";
⋮----
entering=
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptFeeAmountSection.tsx">
import { InfoNotice } from "@io-app/api-types/generated/definitions/pagopa/biz-events/InfoNotice";
import { Body, IOSkeleton, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { formatAmountText, isValidPspName } from "../utils";
⋮----
type Props = {
  loading: boolean;
  transactionInfo?: InfoNotice;
};
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptFilterTabs.tsx">
import {
  IODimensions,
  TabItem,
  TabNavigation,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { ReceiptsCategoryFilter, receiptsCategoryFilters } from "../types";
⋮----
type Props = {
  onCategorySelected?: (category: ReceiptsCategoryFilter) => void;
  selectedCategory: ReceiptsCategoryFilter;
};
⋮----
const getCategoryLabel = (category: ReceiptsCategoryFilter): string =>
⋮----
const ReceiptFilterTabs = (
⋮----
const handleFilterSelected = (index: number) =>
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptHeadingSection.tsx">
import { CartItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/CartItem";
import { NoticeDetailResponse } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeDetailResponse";
import {
  ContentWrapper,
  IOColors,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
⋮----
import { Psp } from "../../../../types/pagopa";
import { ReceiptStackNavigation } from "../navigation/navigator";
import { PaymentsReceiptRoutes } from "../navigation/routes";
import { calculateTotalAmount } from "../utils";
import { ReceiptCartList } from "./ReceiptCartList";
import ReceiptFeeAmountSection from "./ReceiptFeeAmountSection";
import { ReceiptTotalAmount } from "./ReceiptTotalAmount";
⋮----
type Props = {
  isLoading: boolean;
  psp?: Psp;
  transaction?: NoticeDetailResponse;
};
⋮----
export const ReceiptHeadingSection = (
⋮----
const handlePressTransactionDetails = (cartItem: CartItem) =>
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptInfoSection.tsx">
import { NoticeDetailResponse } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeDetailResponse";
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/biz-events/WalletInfo";
import {
  Alert,
  ContentWrapper,
  Divider,
  IOColors,
  IODimensions,
  IOLogoPaymentType,
  IOSkeleton,
  ListItemHeader,
  ListItemInfo,
  ListItemInfoCopy,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { capitalize } from "lodash";
import { View } from "react-native";
⋮----
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { format } from "../../../../utils/dates";
import { capitalizeTextName } from "../../../../utils/strings";
import { PaymentListItemInfo } from "../../common/components/PaymentListItemInfo";
import { getPayerInfoLabel, isValidPspName, removeAsterisks } from "../utils";
import { ReceiptDivider } from "./ReceiptDivider";
⋮----
type Props = {
  loading?: boolean;
  showUnavailableReceiptBanner?: boolean;
  transaction?: NoticeDetailResponse;
};
⋮----
⋮----
// we space the hpan to make the screen reader read it digit by digit
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptListItemTransaction.tsx">
import { NoticeListItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeListItem";
import { Avatar, IOIcons, ListItemTransaction } from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { memo, RefObject, useMemo } from "react";
import { Alert } from "react-native";
⋮----
import ListItemSwipeAction, {
  SwipeControls
} from "../../../../components/ListItemSwipeAction";
import { useIODispatch } from "../../../../store/hooks";
import { getAccessibleAmountText } from "../../../../utils/accessibility";
import { format } from "../../../../utils/dates";
import { PaymentAnalyticsData } from "../../common/types/PaymentAnalytics";
import { getTransactionLogo } from "../../common/utils";
import {
  analyticsHideReceiptAction,
  analyticsHideReceiptConfirmAction
} from "../analytics/utils";
import { hidePaymentsReceiptAction } from "../store/actions";
import { formatAmountText } from "../utils";
⋮----
type Props = {
  onPress?: () => void;
  openedItemRef?: RefObject<(() => void) | null>;
  transaction: NoticeListItem;
};
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptLoadingList.tsx">
import {
  IOSkeleton,
  ListItemTransaction,
  VSpacer
} from "@io-app/design-system";
import { View } from "react-native";
⋮----
import { ReceiptFadeInOutAnimationView } from "./ReceiptFadeInOutAnimationView";
⋮----
type ReceiptLoadingListProps = {
  showSectionTitleSkeleton?: boolean;
};
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptSectionListHeader.tsx">
import { H2, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
import { LayoutChangeEvent, View } from "react-native";
⋮----
import { ReceiptsCategoryFilter } from "../types";
import { ReceiptFilterTabs } from "./ReceiptFilterTabs";
⋮----
type Props = {
  onCategorySelected: (category: ReceiptsCategoryFilter) => void;
  onLayout: (event: LayoutChangeEvent) => void;
  selectedCategory: ReceiptsCategoryFilter;
};
</file>

<file path="apps/main-app/ts/features/payments/receipts/components/ReceiptTotalAmount.tsx">
import { H3, H6, IOSkeleton, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { formatAmountText } from "../utils";
⋮----
type Props = {
  loading?: boolean;
  totalAmount?: string;
};
⋮----
export const ReceiptTotalAmount = (
</file>

<file path="apps/main-app/ts/features/payments/receipts/hooks/useReceiptFailureSupportModal.tsx">
import {
  ListItemAction,
  ListItemHeader,
  ListItemInfoCopy,
  VSpacer
} from "@io-app/design-system";
import { addTicketCustomField, resetCustomFields } from "@io-app/expo-zendesk";
import I18n from "i18next";
import { JSX } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { NetworkError } from "../../../../utils/errors";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import {
  defaultZendeskBonusesCategory,
  defaultZendeskIDPayCategory,
  zendeskBonusAndInitiativeCategoryId,
  zendeskCategoryId
} from "../../../../utils/supportAssistance";
import {
  zendeskSelectedCategory,
  zendeskSupportStart
} from "../../../zendesk/store/actions";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
import { ReceiptDownloadFailure } from "../types";
⋮----
type Props = {
  bottomSheet: JSX.Element;
  present: () => void;
};
⋮----
const getFaultCodeDetail = (): string
⋮----
const zendeskAssistanceLogAndStart = () =>
⋮----
// attach the main zendesk category to the ticket
⋮----
const handleCopyAllToClipboard = () =>
⋮----
dismiss();
zendeskAssistanceLogAndStart();
⋮----
presentModal();
</file>

<file path="apps/main-app/ts/features/payments/receipts/navigation/navigator.tsx">
import { ParamListBase } from "@react-navigation/native";
import {
  createStackNavigator,
  StackNavigationProp
} from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../utils/navigation";
import WalletTransactionCartItemDetailsScreen from "../screens/ReceiptCartItemDetailsScreen";
import { ReceiptDetailsScreen } from "../screens/ReceiptDetailsScreen";
import ReceiptDownloadErrorScreen from "../screens/ReceiptDownloadErrorScreen";
import { ReceiptListScreen } from "../screens/ReceiptListScreen";
import ReceiptPreviewScreen from "../screens/ReceiptPreviewScreen";
import { PaymentsReceiptParamsList } from "./params";
import { PaymentsReceiptRoutes } from "./routes";
⋮----
export const PaymentsReceiptNavigator = () => (
  <Stack.Navigator
    initialRouteName={PaymentsReceiptRoutes.PAYMENT_RECEIPT_DETAILS}
    screenOptions={{ gestureEnabled: isGestureEnabled, headerShown: true }}
  >
    <Stack.Screen
      component={ReceiptDetailsScreen}
      name={PaymentsReceiptRoutes.PAYMENT_RECEIPT_DETAILS}
      options={{ gestureEnabled: isGestureEnabled }}
    />
    <Stack.Screen
      component={WalletTransactionCartItemDetailsScreen}
      name={PaymentsReceiptRoutes.PAYMENT_RECEIPT_CART_ITEM_DETAILS}
      options={{ gestureEnabled: isGestureEnabled }}
    />
    <Stack.Screen
      component={ReceiptListScreen}
      name={PaymentsReceiptRoutes.PAYMENT_RECEIPT_LIST_SCREEN}
      options={{ gestureEnabled: isGestureEnabled }}
    />
    <Stack.Screen
      component={ReceiptPreviewScreen}
      name={PaymentsReceiptRoutes.PAYMENT_RECEIPT_PREVIEW_SCREEN}
      options={{ gestureEnabled: isGestureEnabled }}
    />
    <Stack.Screen
      component={ReceiptDownloadErrorScreen}
      name={PaymentsReceiptRoutes.PAYMENT_RECEIPT_ERROR_SCREEN}
      options={{ gestureEnabled: isGestureEnabled, headerShown: false }}
    />
  </Stack.Navigator>
);
⋮----
export type ReceiptStackNavigation = ReceiptStackNavigationProp<
  PaymentsReceiptParamsList,
  keyof PaymentsReceiptParamsList
>;
⋮----
type ReceiptStackNavigationProp<
  ParamList extends ParamListBase,
  RouteName extends keyof ParamList = string
> = StackNavigationProp<ParamList & PaymentsReceiptParamsList, RouteName>;
</file>

<file path="apps/main-app/ts/features/payments/receipts/navigation/params.ts">
import { ReceiptCartItemDetailsScreenParams } from "../screens/ReceiptCartItemDetailsScreen";
import { ReceiptDetailsScreenParams } from "../screens/ReceiptDetailsScreen";
import { PaymentsReceiptRoutes } from "./routes";
⋮----
export type PaymentsReceiptParamsList = {
  [PaymentsReceiptRoutes.PAYMENT_RECEIPT_CART_ITEM_DETAILS]: ReceiptCartItemDetailsScreenParams;
  [PaymentsReceiptRoutes.PAYMENT_RECEIPT_DETAILS]: ReceiptDetailsScreenParams;
  [PaymentsReceiptRoutes.PAYMENT_RECEIPT_ERROR_SCREEN]: undefined;
  [PaymentsReceiptRoutes.PAYMENT_RECEIPT_LIST_SCREEN]: undefined;
  [PaymentsReceiptRoutes.PAYMENT_RECEIPT_LOADING_SCREEN]: undefined;
  [PaymentsReceiptRoutes.PAYMENT_RECEIPT_NAVIGATOR]: undefined;
  [PaymentsReceiptRoutes.PAYMENT_RECEIPT_PREVIEW_SCREEN]: undefined;
};
</file>

<file path="apps/main-app/ts/features/payments/receipts/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/payments/receipts/saga/handleDisableReceipt.ts">
import { IOToast } from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { TransactionClient } from "../../common/api/client";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
⋮----
import {
  getPaymentsLatestReceiptAction,
  hidePaymentsReceiptAction,
  setNeedsHomeListRefreshAction
} from "../store/actions";
import {
  latestTransactionsContinuationTokenSelector,
  walletLatestReceiptListPotSelector
} from "../store/selectors";
⋮----
const handleHideReceiptFailure = () =>
⋮----
const handleHideReceiptSuccess = () =>
</file>

<file path="apps/main-app/ts/features/payments/receipts/saga/handleGetLatestReceipt.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { TransactionClient } from "../../common/api/client";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import { getPaymentsLatestReceiptAction } from "../store/actions";
import { getReceiptContinuationToken } from "../utils";
</file>

<file path="apps/main-app/ts/features/payments/receipts/saga/handleGetReceipt.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { TransactionClient } from "../../common/api/client";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import { getPaymentsReceiptAction } from "../store/actions";
import { getReceiptContinuationToken } from "../utils";
</file>

<file path="apps/main-app/ts/features/payments/receipts/saga/handleGetReceiptDetails.ts">
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { TransactionClient } from "../../common/api/client";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import { getPaymentsReceiptDetailsAction } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/payments/receipts/saga/handleGetReceiptPdf.ts">
import { pipe } from "fp-ts/lib/function";
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { TransactionClient } from "../../common/api/client";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import { getPaymentsReceiptDownloadAction } from "../store/actions";
import {
  DownloadReceiptOutcomeErrorEnum,
  ReceiptDownloadFailure
} from "../types";
import { byteArrayToBase64 } from "../utils";
import { DownloadReceiptHeaders } from "../utils/types";
</file>

<file path="apps/main-app/ts/features/payments/receipts/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { TransactionClient } from "../../common/api/client";
import {
  getPaymentsLatestReceiptAction,
  getPaymentsReceiptAction,
  getPaymentsReceiptDetailsAction,
  getPaymentsReceiptDownloadAction,
  hidePaymentsReceiptAction
} from "../store/actions";
import { handleDisableReceipt } from "./handleDisableReceipt";
import { handleGetLatestReceipt } from "./handleGetLatestReceipt";
import { handleGetReceipt } from "./handleGetReceipt";
import { handleGetReceiptDetails } from "./handleGetReceiptDetails";
import { handleGetReceiptPdf } from "./handleGetReceiptPdf";
</file>

<file path="apps/main-app/ts/features/payments/receipts/screens/ReceiptCartItemDetailsScreen.tsx">
import { CartItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/CartItem";
import { UserDetail } from "@io-app/api-types/generated/definitions/pagopa/biz-events/UserDetail";
import { Divider, H6, ListItemInfoCopy } from "@io-app/design-system";
import { RouteProp, useRoute } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { PaymentListItemInfo } from "../../common/components/PaymentListItemInfo";
⋮----
import { PaymentsReceiptParamsList } from "../navigation/params";
import { formatAmountText } from "../utils";
⋮----
export type ReceiptCartItemDetailsScreenParams = {
  cartItem: CartItem;
};
⋮----
type ReceiptCartItemDetailsScreenProps = RouteProp<
  PaymentsReceiptParamsList,
  "PAYMENT_RECEIPT_CART_ITEM_DETAILS"
>;
⋮----
const ReceiptCartItemDetailsScreen = () =>
⋮----
copyableValue=
</file>

<file path="apps/main-app/ts/features/payments/receipts/screens/ReceiptDetailsScreen.tsx">
import { OriginEnum } from "@io-app/api-types/generated/definitions/pagopa/biz-events/InfoNotice";
import {
  Alert,
  ContentWrapper,
  IOColors,
  useIOTheme,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
⋮----
import { RouteProp, useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { Dimensions, StyleSheet, View } from "react-native";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
⋮----
import HideReceiptButton from "../components/HideReceiptButton";
import { ReceiptHeadingSection } from "../components/ReceiptHeadingSection";
import WalletTransactionInfoSection from "../components/ReceiptInfoSection";
import { PaymentsReceiptParamsList } from "../navigation/params";
import { PaymentsReceiptRoutes } from "../navigation/routes";
import {
  getPaymentsReceiptDetailsAction,
  getPaymentsReceiptDownloadAction
} from "../store/actions";
import {
  walletReceiptDetailsPotSelector,
  walletReceiptPotSelector
} from "../store/selectors";
import { DownloadReceiptOutcomeErrorEnum } from "../types";
⋮----
export type ReceiptDetailsScreenParams = {
  isCart?: boolean;
  isDebtor?: boolean;
  isPayer?: boolean;
  transactionId: string;
};
⋮----
type ReceiptDetailsScreenProps = RouteProp<
  PaymentsReceiptParamsList,
  "PAYMENT_RECEIPT_DETAILS"
>;
⋮----
const fetchTransactionDetails = () =>
⋮----
const handlePdfReceiptGenerationError = () =>
⋮----
const handleOnDownloadPdfReceiptSuccess = () =>
⋮----
const navigateToPdfErrorScreen = () =>
⋮----
const handleDownloadPdfReceipt = () =>
</file>

<file path="apps/main-app/ts/features/payments/receipts/screens/ReceiptDownloadErrorScreen.tsx">
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { getNetworkError } from "../../../../utils/errors";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
⋮----
import useReceiptFailureSupportModal from "../hooks/useReceiptFailureSupportModal";
import { walletReceiptPotSelector } from "../store/selectors";
import { mapDownloadReceiptErrorToOutcomeProps } from "../utils";
</file>

<file path="apps/main-app/ts/features/payments/receipts/screens/ReceiptListScreen.tsx">
import { NoticeListItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeListItem";
import {
  ContentWrapper,
  Divider,
  IODimensions,
  ListItemHeader
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { useCallback, useEffect, useRef, useState } from "react";
import { LayoutChangeEvent, SectionList, SectionListData } from "react-native";
import Animated, {
  useAnimatedScrollHandler,
  useSharedValue
} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import {
  OperationResultScreenContent,
  OperationResultScreenContentProps
} from "../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { isPaymentsTransactionsEmptySelector } from "../../home/store/selectors";
⋮----
import { ReceiptFadeInOutAnimationView } from "../components/ReceiptFadeInOutAnimationView";
import { ReceiptListItemTransaction } from "../components/ReceiptListItemTransaction";
import { ReceiptLoadingList } from "../components/ReceiptLoadingList";
import { ReceiptSectionListHeader } from "../components/ReceiptSectionListHeader";
import { PaymentsReceiptRoutes } from "../navigation/routes";
import { getPaymentsReceiptAction } from "../store/actions";
import { walletReceiptListPotSelector } from "../store/selectors";
import { ReceiptsCategoryFilter } from "../types";
import { groupTransactionsByMonth } from "../utils";
⋮----
const handleNavigateToTransactionDetails = (transaction: NoticeListItem) =>
⋮----
const getTitleHeight = (event: LayoutChangeEvent) =>
⋮----
const fetchNextPage = () =>
⋮----
const handleOnSuccess = (paginationToken?: string) =>
⋮----
const handleOnRefreshTransactionsList = () =>
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/payments/receipts/screens/ReceiptPreviewScreen.tsx">
import {
  FooterActions,
  FooterActionsMeasurements,
  IOColors,
  useIOTheme
} from "@io-app/design-system";
⋮----
import { File, Paths } from "expo-file-system";
⋮----
import I18n from "i18next";
import { useState } from "react";
import { View } from "react-native";
import Pdf from "react-native-pdf";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { paymentAnalyticsDataSelector } from "../../history/store/selectors";
⋮----
import { walletReceiptPotSelector } from "../store/selectors";
import { RECEIPT_DOCUMENT_TYPE_PREFIX } from "../utils";
⋮----
const handleOnShare = async () =>
⋮----
const handleFooterActionsMeasurements = (
    values: FooterActionsMeasurements
) =>
</file>

<file path="apps/main-app/ts/features/payments/receipts/store/actions/index.ts">
import { NoticeDetailResponse } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeDetailResponse";
import { NoticeListWrapResponse } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeListWrapResponse";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
import { HideReceiptTrigger } from "../../analytics";
import { ReceiptDownloadFailure, ReceiptsCategoryFilter } from "../../types";
⋮----
type PaymentsLatestReceiptSuccessPayload = {
  continuationToken?: string;
  data: NoticeListWrapResponse["notices"];
};
⋮----
type PaymentsReceiptPayload = {
  continuationToken?: string;
  firstLoad?: boolean;
  noticeCategory?: ReceiptsCategoryFilter;
  onSuccess?: (continuationToken?: string) => void;
  size?: number;
};
⋮----
type PaymentsReceiptSuccessPayload = {
  appendElements?: boolean;
  data: NoticeListWrapResponse["notices"];
};
⋮----
type PaymentsTransactionDetailsPayload = {
  isPayer?: boolean;
  transactionId: string;
};
⋮----
export type PaymentsTransactionReceiptInfoPayload = {
  base64File: string;
  filename?: string;
};
⋮----
type PaymentsTransactionReceiptPayload = {
  onError?: () => void;
  onErrorGeneration?: () => void;
  onSuccess?: () => void;
  transactionId: string;
};
⋮----
type PaymentsTransactionReceiptDeletePayload = {
  transactionId: string;
  trigger: HideReceiptTrigger;
};
⋮----
export type PaymentsReceiptActions =
  | ActionType<typeof getPaymentsLatestReceiptAction>
  | ActionType<typeof getPaymentsReceiptAction>
  | ActionType<typeof getPaymentsReceiptDetailsAction>
  | ActionType<typeof getPaymentsReceiptDownloadAction>
  | ActionType<typeof hidePaymentsReceiptAction>
  | ActionType<typeof setNeedsHomeListRefreshAction>;
</file>

<file path="apps/main-app/ts/features/payments/receipts/store/reducers/index.ts">
import { NoticeDetailResponse } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeDetailResponse";
import { NoticeListItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeListItem";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import { ReceiptDownloadFailure } from "../../types";
import {
  filterTransactionsByIdAndGetIndex,
  restoreTransactionsToOriginalOrder
} from "../../utils";
import {
  getPaymentsLatestReceiptAction,
  getPaymentsReceiptAction,
  getPaymentsReceiptDetailsAction,
  getPaymentsReceiptDownloadAction,
  hidePaymentsReceiptAction,
  PaymentsTransactionReceiptInfoPayload,
  setNeedsHomeListRefreshAction
} from "../actions";
⋮----
export type ReceiptTransactionState = {
  cancelTransactionRecord: pot.Pot<CancelTransactionRecord, NetworkError>;
  details: pot.Pot<NoticeDetailResponse, NetworkError>;
  latestTransactions: pot.Pot<ReadonlyArray<NoticeListItem>, NetworkError>;
  latestTransactionsContinuationToken?: string;
  needsHomeListRefresh: boolean;
  receiptDocument: pot.Pot<
    PaymentsTransactionReceiptInfoPayload,
    NetworkError | ReceiptDownloadFailure
  >;
  transactions: pot.Pot<ReadonlyArray<NoticeListItem>, NetworkError>;
};
⋮----
type CancelTransactionRecord = {
  cancelType: "latestTransactions" | "transactions";
  removedIndices: Array<number>;
  removedItems: Array<NoticeListItem>;
};
⋮----
const reducer = (
  state: ReceiptTransactionState = INITIAL_STATE,
  action: Action
): ReceiptTransactionState =>
</file>

<file path="apps/main-app/ts/features/payments/receipts/store/selectors/index.ts">
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
const walletReceiptSelector = (state: GlobalState)
⋮----
export const walletReceiptDetailsPotSelector = (state: GlobalState)
⋮----
export const walletReceiptListPotSelector = (state: GlobalState)
⋮----
export const walletLatestReceiptListPotSelector = (state: GlobalState)
⋮----
export const walletReceiptPotSelector = (state: GlobalState)
⋮----
export const needsHomeListRefreshSelector = (state: GlobalState)
⋮----
export const latestTransactionsContinuationTokenSelector = (
  state: GlobalState
)
</file>

<file path="apps/main-app/ts/features/payments/receipts/types/index.ts">
import { ProblemJson } from "@io-app/api-types/generated/definitions/pagopa/biz-events/ProblemJson";
⋮----
export enum DownloadReceiptOutcomeErrorEnum {
  AT_404_001 = "AT_404_001",
  AT_404_002 = "AT_404_002",
  BZ_404_003 = "BZ_404_003",
  FG_000_001 = "FG_000_001",
  GN_400_003 = "GN_400_003",
  GN_500_001 = "GN_500_001",
  GN_500_002 = "GN_500_002",
  GN_500_003 = "GN_500_003",
  GN_500_004 = "GN_500_004",
  UN_500_000 = "UN_500_000"
}
export type ReceiptDownloadFailure = ProblemJson & {
  code?: DownloadReceiptOutcomeErrorEnum;
};
⋮----
export type ReceiptsCategoryFilter = (typeof receiptsCategoryFilters)[number];
</file>

<file path="apps/main-app/ts/features/payments/receipts/utils/index.ts">
import { InfoNotice } from "@io-app/api-types/generated/definitions/pagopa/biz-events/InfoNotice";
import { NoticeListItem } from "@io-app/api-types/generated/definitions/pagopa/biz-events/NoticeListItem";
⋮----
import { ResponseHeaders } from "@pagopa/ts-commons/lib/requests";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { SectionListData } from "react-native";
⋮----
import { OperationResultScreenContentProps } from "../../../../components/screens/OperationResultScreenContent";
import { NetworkError } from "../../../../utils/errors";
import { capitalizeTextName } from "../../../../utils/strings";
import {
  DownloadReceiptOutcomeErrorEnum,
  ReceiptDownloadFailure
} from "../types";
import { ReceiptsHeaders } from "./types";
⋮----
export const groupTransactionsByMonth = (
  transactions: ReadonlyArray<NoticeListItem>
): Array<SectionListData<NoticeListItem>> =>
⋮----
export const formatAmountText = (amount: string): string =>
⋮----
export const byteArrayToBase64 = (byteArray: Uint8Array): string =>
⋮----
export const getPayerInfoLabel = (payer: InfoNotice["payer"]): string =>
⋮----
/**
 * Function that calculates the total amount of a transaction by summing the
 * amount and the fee
 */
export const calculateTotalAmount = (
  transactionInfo?: InfoNotice
): string | undefined =>
⋮----
/**
 * Filters transactions by a given transaction ID and returns the filtered
 * transactions along with indices of removed transactions.
 *
 * For cart transactions:
 *
 * - Payer carts (eventId ends with _CART_): removes all transactions with that
 *   prefix
 * - Debtor carts (eventId contains _CART_<id-biz>): removes only the exact match
 *
 * @param transactions - A potential array of NoticeListItem objects wrapped in
 *   a Pot, which may contain a NetworkError.
 * @param transactionId - The ID of the transaction to filter out.
 * @returns An object containing:
 *
 *   - `filteredTransactions`: An array of NoticeListItem objects excluding the
 *     transaction(s) with the given ID.
 *   - `removedIndices`: Array of indices of removed transactions in the original
 *     array.
 */
export const filterTransactionsByIdAndGetIndex = (
  transactions: pot.Pot<ReadonlyArray<NoticeListItem>, NetworkError>,
  transactionId: string
):
⋮----
export const restoreTransactionsToOriginalOrder = (
  filteredTransactions: ReadonlyArray<NoticeListItem>,
  removedIndices: Array<number>,
  removedItems: Array<NoticeListItem>
): Array<NoticeListItem> =>
⋮----
export const removeAsterisks = (text: string): string
⋮----
export const isValidPspName = (pspName: string | undefined): boolean
⋮----
export const mapDownloadReceiptErrorToOutcomeProps = (
  error: NetworkError | ReceiptDownloadFailure | undefined,
  onClose: () => void,
  handleContactSupport: () => void
): OperationResultScreenContentProps =>
⋮----
export const getReceiptContinuationToken = (
  responseHeaders: ResponseHeaders<"x-continuation-token" | "X-Request-Id">
)
</file>

<file path="apps/main-app/ts/features/payments/receipts/utils/types.ts">
export type DownloadReceiptHeaders = t.TypeOf<typeof DownloadReceiptHeaders>;
</file>

<file path="apps/main-app/ts/features/payments/wallet/components/PaymentWalletCard.tsx">
import { pipe } from "fp-ts/lib/function";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { withWalletCardBaseComponent } from "../../../wallet/components/WalletCardBaseComponent";
import { WalletCardPressableBase } from "../../../wallet/components/WalletCardPressableBase";
import {
  PaymentCard,
  PaymentCardProps
} from "../../common/components/PaymentCard";
import { PaymentsMethodDetailsRoutes } from "../../details/navigation/routes";
⋮----
import { paymentsWalletUserMethodsSelector } from "../../wallet/store/selectors";
⋮----
export type PaymentWalletCardProps = PaymentCardProps & {
  walletId: string;
};
⋮----
const WrappedPaymentCard = (props: PaymentWalletCardProps) =>
⋮----
const getPaymentMethodSelected = (methodId: string): string | undefined
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/payments/wallet/saga/handleGetPaymentsWalletUserMethods.ts">
import { pipe } from "fp-ts/lib/function";
import { put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { handleRemoveMissingCards } from "../../../wallet/saga/handleRemoveMissingCards";
import { walletAddCards } from "../../../wallet/store/actions/cards";
import { WalletClient } from "../../common/api/client";
import { mapWalletsToCards } from "../../common/utils";
import { withPaymentsSessionToken } from "../../common/utils/withPaymentsSessionToken";
import { getPaymentsWalletUserMethods } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/payments/wallet/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { WalletClient } from "../../common/api/client";
import { getPaymentsWalletUserMethods } from "../store/actions";
import { handleGetPaymentsWalletUserMethods } from "./handleGetPaymentsWalletUserMethods";
</file>

<file path="apps/main-app/ts/features/payments/wallet/store/actions/index.ts">
import { Wallets } from "@io-app/api-types/generated/definitions/pagopa/walletv3/Wallets";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type PaymentsWalletActions = ActionType<
  typeof getPaymentsWalletUserMethods
>;
</file>

<file path="apps/main-app/ts/features/payments/wallet/store/reducers/index.ts">
import { Wallets } from "@io-app/api-types/generated/definitions/pagopa/walletv3/Wallets";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import { paymentsDeleteMethodAction } from "../../../details/store/actions";
import { getPaymentsWalletUserMethods } from "../actions";
⋮----
export type PaymentsWalletState = {
  userMethods: pot.Pot<Wallets, NetworkError>;
};
⋮----
const paymentsWalletReducer = (
  state: PaymentsWalletState = INITIAL_STATE,
  action: Action
): PaymentsWalletState =>
</file>

<file path="apps/main-app/ts/features/payments/wallet/store/selectors/index.ts">
import { WalletInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv3/WalletInfo";
⋮----
import _ from "lodash";
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
const selectPaymentsWallet = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/pn/__mocks__/pnMessage.ts">
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { Denomination } from "@io-app/api-types/generated/definitions/pn/Denomination";
import { noticeCode } from "@io-app/api-types/generated/definitions/pn/noticeCode";
import { paTaxId } from "@io-app/api-types/generated/definitions/pn/paTaxId";
import { TaxId } from "@io-app/api-types/generated/definitions/pn/TaxId";
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/pn/ThirdPartyAttachment";
import { ThirdPartyMessage } from "@io-app/api-types/generated/definitions/pn/ThirdPartyMessage";
⋮----
import { message_1 } from "../../messages/__mocks__/message";
import { ATTACHMENT_CATEGORY } from "../../messages/types/attachmentCategory";
</file>

<file path="apps/main-app/ts/features/pn/aar/analytics/index.ts">
import { AARProblemJson } from "@io-app/api-types/generated/definitions/pn/aar/AARProblemJson";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import { SendUserType } from "../../../pushNotifications/analytics";
import { SendAarFailurePhase } from "../utils/stateUtils";
⋮----
export type SendAarScreen = "CIE_PREPARATION" | "NFC_ACTIVATION";
⋮----
export const trackSendQRCodeScanRedirect = () =>
⋮----
export const trackSendQRCodeScanRedirectConfirmed = () =>
⋮----
export const trackSendQRCodeScanRedirectDismissed = () =>
⋮----
export const trackSendAarFailure = (
  phase: SendAarFailurePhase,
  reason: string,
  aarProblemJson: AARProblemJson | undefined
) =>
⋮----
export const trackSendAarToS = () =>
⋮----
export const trackSendAarToSAccepted = () =>
⋮----
export const trackSendAarToSDismissed = () =>
⋮----
export const trackSendAarAccessDeniedScreenView = () =>
⋮----
export const trackSendAarAccessDeniedDelegateInfo = () =>
⋮----
export const trackSendAarAccessDeniedDismissed = () =>
⋮----
export const aarProblemJsonAnalyticsReport = (
  responseCode: number,
  input: AARProblemJson
) =>
⋮----
export const trackSendAarNotificationClosure = (userType: SendUserType) =>
⋮----
export const trackSendAarNotificationClosureBack = (userType: SendUserType) =>
⋮----
export const trackSendAarNotificationClosureConfirm = (
  userType: SendUserType
) =>
⋮----
export const trackSendAarNotificationClosureExit = (userType: SendUserType) =>
⋮----
export const trackSendAarErrorScreenClosure = () =>
⋮----
export const trackSendAarErrorScreenDetails = () =>
⋮----
export const trackSendAarErrorScreenDetailsHelp = () =>
⋮----
export const trackSendAarErrorScreenDetailsCode = () =>
⋮----
export const trackSendAarNotificationOpeningMandateDisclaimer = () =>
⋮----
export const trackSendAarNotificationOpeningMandateDisclaimerAccepted = () =>
⋮----
export const trackSendAarNotificationOpeningMandateDisclaimerClosure = () =>
⋮----
export const trackSendAarNotificationOpeningMandateBottomSheet = () =>
⋮----
export const trackSendAarNotificationOpeningMandateBottomSheetAccepted = () =>
⋮----
export const trackSendAarNotificationOpeningMandateBottomSheetClosure = () =>
⋮----
export const trackSendAarNotificationOpeningNfcNotSupported = () =>
⋮----
export const trackSendAarNotificationOpeningNfcNotSupportedInfo = () =>
⋮----
export const trackSendAarNotificationOpeningNfcNotSupportedClosure = () =>
⋮----
export const trackSendAarMandateCiePreparation = () =>
⋮----
export const trackSendAarMandateCiePreparationContinue = () =>
⋮----
export const trackSendAarMandateCieReadingClosureAlert = (
  screen: SendAarScreen
) =>
⋮----
export const trackSendAarMandateCieReadingClosureAlertAccepted = (
  screen: SendAarScreen
) =>
⋮----
export const trackSendAarMandateCieReadingClosureAlertContinue = (
  screen: SendAarScreen
) =>
⋮----
export const trackSendAarMandateCieCanEnter = () =>
⋮----
export const trackSendAarMandateCieCardReadingDisclaimer = () =>
⋮----
export const trackSendAarMandateCieCardReadingDisclaimerContinue = () =>
⋮----
export const trackSendAarMandateCieCardReading = () =>
⋮----
export const trackSendAarMandateCieCardReadingSuccess = () =>
⋮----
... (46 lines truncated)
</file>

<file path="apps/main-app/ts/features/pn/aar/api/client.ts">
import { createClient } from "@io-app/api-types/generated/definitions/pn/aar/client";
import { v4 as uuid } from "uuid";
⋮----
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { lollipopFetch } from "../../../lollipop/utils/fetch";
⋮----
export const createSendAarClientWithLollipop = (
  baseUrl: string,
  keyInfo: KeyInfo = {}
)
⋮----
export type SendAarClient = ReturnType<typeof createSendAarClientWithLollipop>;
</file>

<file path="apps/main-app/ts/features/pn/aar/components/__mocks__/SendAarCieCardReadingComponent.tsx">
import { Text, View } from "react-native";
⋮----
import { SendAarCieCardReadingComponentProps } from "../SendAarCieCardReadingComponent";
⋮----
export const SendAarCieCardReadingComponent = ({
  can,
  verificationCode,
  iun,
  recipientInfo,
  mandateId
}: SendAarCieCardReadingComponentProps) => (
  <View>
    <Text>Mock SendAarCieCardReadingComponent</Text>
    <Text>{`can: ${can}`}</Text>
    <Text>{`varificationCode: ${verificationCode}`}</Text>
    <Text>{`iun: ${iun}`}</Text>
    <Text>{`recipientInfo.denomination: ${recipientInfo.denomination}`}</Text>
    <Text>{`recipientInfo.taxId: ${recipientInfo.taxId}`}</Text>
    <Text>{`mandateId: ${mandateId}`}</Text>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/aar/components/__mocks__/SendAarMessageDetailBottomSheet.tsx">
import { Pressable, View } from "react-native";
⋮----
import { SendAarMessageDetailBottomSheetProps } from "../SendAarMessageDetailBottomSheet";
⋮----
export const SendAarMessageDetailBottomSheet = ({
  onPrimaryActionPress,
  onSecondaryActionPress,
  sendUserType
}: SendAarMessageDetailBottomSheetProps) => (
  <View>
    <View>{`Mock SendAarMessageDetailBottomSheet`}</View>
    <View>{`Send user type: ${sendUserType}`}</View>
    <Pressable
      accessibilityLabel=""
      onPress={onPrimaryActionPress}
      testID="primary_button"
    >{`Mock Primary Action`}</Pressable>
    <Pressable
      accessibilityLabel=""
      onPress={onSecondaryActionPress}
      testID="secondary_button"
    >{`Mock Secondary Action`}</Pressable>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/aar/components/__mocks__/SendAarMessageDetailBottomSheetComponent.tsx">
import { View } from "react-native";
⋮----
import { SendAarMessageDetailBottomSheetComponentProps } from "../SendAarMessageDetailBottomSheetComponent";
⋮----
export const SendAarMessageDetailBottomSheetComponent = ({
  aarBottomSheetRef,
  sendUserType
}: SendAarMessageDetailBottomSheetComponentProps) =>
</file>

<file path="apps/main-app/ts/features/pn/aar/components/__mocks__/SendEngagementComponent.tsx">
import { Pressable, View } from "react-native";
⋮----
import { SendEngagementComponentProps } from "../SendEngagementComponent";
⋮----
export const SendEngagementComponent = ({
  isLoading,
  onClose,
  onPrimaryAction
}: SendEngagementComponentProps) => (
  <View>
    <View>{"Mock Send Engagement Component"}</View>
    <View>{`isLoading: ${isLoading}`}</View>
    <Pressable accessibilityLabel="" onPress={onClose} testID="close-button">
      {"onClose"}
    </Pressable>
    <Pressable
      accessibilityLabel=""
      onPress={onPrimaryAction}
      testID="primary-action"
    >
      {"onPrimaryAction"}
    </Pressable>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/aar/components/__mocks__/SendQRScanFlowHandlerComponent.tsx">
import { View } from "react-native";
⋮----
import { SendQRScanHandlerScreenProps } from "../SendQRScanFlowHandlerComponent";
⋮----
export const SendQRScanFlowHandlerComponent = ({
  aarUrl
}: SendQRScanHandlerScreenProps) => (
  <View>
    <View>{"Mock SendQRScanFlowHandlerComponent"}</View>
    <View>{aarUrl}</View>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/aar/components/errors/hooks/useAarGenericErrorBottomSheet.ts">
import { Optional } from "@io-app/design-system";
import { isFunction } from "lodash";
⋮----
import { useIOBottomSheetModal } from "../../../../../../utils/hooks/bottomSheet";
import { sendAarErrorSupportBottomSheetComponent } from "../sendAarErrorSupportBottomSheetComponent";
import {
  SendAarZendeskSecondLevelTag,
  useAarStartSendZendeskSupport
} from "./useAarStartSendZendeskSupport";
⋮----
type Props = {
  errorName: Optional<string>;
  onCopyToClipboard?: () => void;
  onStartAssistance?: () => void;
  zendeskSecondLevelTag: SendAarZendeskSecondLevelTag;
};
⋮----
export const useAarGenericErrorBottomSheet = ({
  errorName,
  zendeskSecondLevelTag,
  onCopyToClipboard,
  onStartAssistance
}: Props) =>
⋮----
const handleAssistance = () =>
⋮----
const handleCopyToClipboard = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/components/errors/hooks/useAarStartSendZendeskSupport.ts">
import { useCallback } from "react";
⋮----
import { useIODispatch } from "../../../../../../store/hooks";
import {
  addTicketCustomField,
  appendLog,
  resetCustomFields,
  resetLog,
  zendeskCategoryId,
  zendeskSendCategory
} from "../../../../../../utils/supportAssistance";
import {
  zendeskSelectedCategory,
  zendeskSupportStart
} from "../../../../../zendesk/store/actions";
⋮----
export const enum SendAarZendeskSecondLevelTag {
  IO_PROBLEMA_NOTIFICA_SEND_QR = "io_problema_notifica_send_qr",
  IO_PROBLEMA_NOTIFICA_SEND_QR_ALTRA_PERSONA = "io_problema_notifica_send_qr_altra_persona"
}
⋮----
export const useAarStartSendZendeskSupport = (
  secondLevelTag: SendAarZendeskSecondLevelTag
) =>
</file>

<file path="apps/main-app/ts/features/pn/aar/components/errors/SendAarCieValidationErrorComponent.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { sendAarInAppDelegationUrlSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { openWebUrl } from "../../../../../utils/url";
import {
  trackSendAarMandateCieErrorCac,
  trackSendAarMandateCieErrorClosure,
  trackSendAarMandateCieErrorDetail,
  trackSendAarMandateCieErrorDetailCode,
  trackSendAarMandateCieErrorDetailHelp,
  trackSendAarMandateCieErrorRetry
} from "../../analytics";
import { useSendAarFlowManager } from "../../hooks/useSendAarFlowManager";
import { setAarFlowState } from "../../store/actions";
import {
  currentAarFlowStateAssistanceErrorCode,
  currentAarFlowStateErrorDebugInfoSelector
} from "../../store/selectors";
import { sendAarFlowStates } from "../../utils/stateUtils";
import { useAarGenericErrorBottomSheet } from "./hooks/useAarGenericErrorBottomSheet";
import { SendAarZendeskSecondLevelTag } from "./hooks/useAarStartSendZendeskSupport";
⋮----
const handleRetry = () =>
⋮----
trackSendAarMandateCieErrorClosure(assistanceErrorCode ?? "");
terminateFlow();
⋮----
trackSendAarMandateCieErrorDetail(assistanceErrorCode ?? "");
present();
</file>

<file path="apps/main-app/ts/features/pn/aar/components/errors/SendAarErrorComponent.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useDebugInfo } from "../../../../../hooks/useDebugInfo";
import { useIOSelector } from "../../../../../store/hooks";
import {
  trackSendAarErrorScreenClosure,
  trackSendAarErrorScreenDetails,
  trackSendAarErrorScreenDetailsHelp
} from "../../analytics";
import { useSendAarFlowManager } from "../../hooks/useSendAarFlowManager";
import {
  currentAarFlowStateAssistanceErrorCode,
  currentAarFlowStateErrorDebugInfoSelector
} from "../../store/selectors";
import { useAarGenericErrorBottomSheet } from "./hooks/useAarGenericErrorBottomSheet";
import { SendAarZendeskSecondLevelTag } from "./hooks/useAarStartSendZendeskSupport";
⋮----
export const SendAarGenericErrorComponent = () =>
⋮----
trackSendAarErrorScreenClosure();
terminateFlow();
⋮----
trackSendAarErrorScreenDetails();
present();
</file>

<file path="apps/main-app/ts/features/pn/aar/components/errors/sendAarErrorSupportBottomSheetComponent.tsx">
import {
  Body,
  ListItemAction,
  ListItemHeader,
  ListItemInfoCopy,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { clipboardSetStringWithFeedback } from "../../../../../utils/clipboard";
import { trackSendAarErrorScreenDetailsCode } from "../../analytics";
⋮----
accessibilityLabel=
⋮----
trackSendAarErrorScreenDetailsCode();
onCopyToClipboardPress?.();
clipboardSetStringWithFeedback(assistanceErrorCode);
</file>

<file path="apps/main-app/ts/features/pn/aar/components/errors/SendAarNfcNotSupportedComponent.tsx">
import { FeatureInfo, IODimensions, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { IOScrollViewCentredContent } from "../../../../../components/ui/IOScrollViewCentredContent";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../store/hooks";
import { sendAarInAppDelegationUrlSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { openWebUrl } from "../../../../../utils/url";
import {
  trackSendAarNotificationOpeningNfcNotSupported,
  trackSendAarNotificationOpeningNfcNotSupportedClosure,
  trackSendAarNotificationOpeningNfcNotSupportedInfo
} from "../../analytics";
import { useSendAarFlowManager } from "../../hooks/useSendAarFlowManager";
</file>

<file path="apps/main-app/ts/features/pn/aar/components/errors/SendAarNotAddresseeKoComponent.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../../store/hooks";
import { sendAarDelegateUrlSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { openWebUrl } from "../../../../../utils/url";
import {
  trackSendAarAccessDeniedDelegateInfo,
  trackSendAarAccessDeniedDismissed
} from "../../analytics";
import { useSendAarFlowManager } from "../../hooks/useSendAarFlowManager";
⋮----
const handlePrimaryButton = () =>
const handleSecondaryAction = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/components/errors/SendAarPendingDelegationErrorComponent.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../../components/screens/OperationResultScreenContent";
import { useSendAarFlowManager } from "../../hooks/useSendAarFlowManager";
⋮----
export const SendAarPendingDelegationErrorComponent = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/components/SendAarActivateNfcComponent.tsx">
import { ListItemInfo } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { Alert } from "react-native";
⋮----
import { IOScrollViewWithListItems } from "../../../../components/ui/IOScrollViewWithListItems";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  trackSendAarMandateCieNfcActivationContinue,
  trackSendAarMandateCieNfcActivationControlAlert,
  trackSendAarMandateCieNfcActivationControlAlertClosure,
  trackSendAarMandateCieNfcActivationControlAlertGoToSettings,
  trackSendAarMandateCieNfcGoToSettings
} from "../analytics";
import { useIsNfcFeatureEnabled } from "../hooks/useIsNfcFeatureEnabled";
import { setAarFlowState } from "../store/actions";
import { currentAarFlowData } from "../store/selectors";
import { sendAarFlowStates } from "../utils/stateUtils";
</file>

<file path="apps/main-app/ts/features/pn/aar/components/SendAarCieCardReadingComponent.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect, useMemo } from "react";
import { Platform } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { useIODispatch } from "../../../../store/hooks";
import { isDefined } from "../../../../utils/guards";
import {
  CieCardReadContent,
  CieCardReadContentProps
} from "../../../common/components/cie/CieCardReadContent";
import {
  trackSendAarMandateCieErrorClosure,
  trackSendAarMandateCieErrorDetail,
  trackSendAarMandateCieErrorDetailCode,
  trackSendAarMandateCieErrorDetailHelp,
  trackSendAarMandateCieErrorRetry
} from "../analytics";
import {
  isErrorState,
  isReadingState,
  isSuccessState,
  ReadStatus,
  useCieInternalAuthAndMrtdReading
} from "../hooks/useCieInternalAuthAndMrtdReading";
import { useIsNfcFeatureAvailable } from "../hooks/useIsNfcFeatureAvailable";
import { useSendAarFlowManager } from "../hooks/useSendAarFlowManager";
import { useTrackCieReadingEvents } from "../hooks/useTrackCieReadingEvents";
import { setAarFlowState } from "../store/actions";
import { RecipientInfo, sendAarFlowStates } from "../utils/stateUtils";
import { useAarGenericErrorBottomSheet } from "./errors/hooks/useAarGenericErrorBottomSheet";
import { SendAarZendeskSecondLevelTag } from "./errors/hooks/useAarStartSendZendeskSupport";
⋮----
export type SendAarCieCardReadingComponentProps = {
  can: string;
  iun: string;
  mandateId: string;
  recipientInfo: RecipientInfo;
  verificationCode: string;
};
⋮----
type ScreenContentProps = Omit<CieCardReadContentProps, "progress">;
⋮----
export const SendAarCieCardReadingComponent = ({
  can,
  verificationCode,
  iun,
  recipientInfo,
  mandateId
}: SendAarCieCardReadingComponentProps) =>
⋮----
const generateErrorContent = (): ScreenContentProps =>
</file>

<file path="apps/main-app/ts/features/pn/aar/components/SendAarFeedbackBanner.tsx">
import { Banner, VSpacer } from "@io-app/design-system";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import {
  isPnFeedbackBannerEnabledSelector,
  pnFeedbackBannerConfigSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import {
  fallbackForLocalizedMessageKeys,
  getFullLocale
} from "../../../../utils/locale";
import { openWebUrl } from "../../../../utils/url";
⋮----
export const SendAArFeedbackBanner = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/components/SendAarMessageDetailBottomSheet.tsx">
import {
  FeatureInfo,
  IOButton,
  IOMarkdownLite,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { sendVisitTheWebsiteUrlSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { openWebUrl } from "../../../../utils/url";
import { SendUserType } from "../../../pushNotifications/analytics";
import { trackSendAarNotificationClosureExit } from "../analytics";
import { SendAArFeedbackBanner } from "./SendAarFeedbackBanner";
⋮----
export type SendAarMessageDetailBottomSheetProps = {
  onPrimaryActionPress: () => void;
  onSecondaryActionPress: () => void;
  sendUserType: SendUserType;
};
⋮----
const onLinkPress = (url: string) =>
⋮----
body=
⋮----
content=
</file>

<file path="apps/main-app/ts/features/pn/aar/components/SendAarMessageDetailBottomSheetComponent.tsx">
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { RefObject } from "react";
⋮----
import { IOStackNavigationProp } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { MessagesParamsList } from "../../../messages/navigation/params";
import { SendUserType } from "../../../pushNotifications/analytics";
import PN_ROUTES from "../../navigation/routes";
import { isPnServiceEnabled } from "../../reminderBanner/reducer/bannerDismiss";
import {
  trackSendAarNotificationClosureBack,
  trackSendAarNotificationClosureConfirm
} from "../analytics";
import { SendAarMessageDetailBottomSheet } from "./SendAarMessageDetailBottomSheet";
⋮----
export type SendAarMessageDetailBottomSheetComponentProps = {
  aarBottomSheetRef: RefObject<(() => void) | undefined>;
  sendUserType: SendUserType;
};
⋮----
export const SendAarMessageDetailBottomSheetComponent = ({
  aarBottomSheetRef,
  sendUserType
}: SendAarMessageDetailBottomSheetComponentProps) =>
⋮----
const onSecondaryActionPress = () =>
⋮----
trackSendAarNotificationClosureBack(sendUserType);
dismiss();
</file>

<file path="apps/main-app/ts/features/pn/aar/components/SendAarTosComponent.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import { pnPrivacyUrlsSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { openWebUrl } from "../../../../utils/url";
import { trackSendAarToSDismissed } from "../analytics";
import { useSendAarFlowManager } from "../hooks/useSendAarFlowManager";
⋮----
const onSecondaryAction = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/components/SendEngagementComponent.tsx">
import {
  FeatureInfo,
  H3,
  IODimensions,
  IOMarkdownLite,
  IOMaxFontSizeMultiplier,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useWindowDimensions, View } from "react-native";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useDetectSmallScreen } from "../../../../hooks/useDetectSmallScreen.ts";
import { useIOSelector } from "../../../../store/hooks";
import { pnPrivacyUrlsSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { openWebUrl } from "../../../../utils/url";
⋮----
export type SendEngagementComponentProps = {
  isLoading: boolean;
  onClose: () => void;
  onPrimaryAction: () => void;
};
⋮----
const openWebUrlIfNotLoading = (url: string) =>
</file>

<file path="apps/main-app/ts/features/pn/aar/components/SendQRScanFlowHandlerComponent.tsx">
import { HeaderSecondLevel } from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { IOStackNavigationProp } from "../../../../navigation/params/AppParamsList";
import { useIOSelector, useIOStore } from "../../../../store/hooks";
import { isAarRemoteEnabled } from "../../../../store/reducers/backendStatus/remoteConfig";
import { openWebUrl } from "../../../../utils/url";
import { NOTIFICATIONS_ROUTES } from "../../../pushNotifications/navigation/routes";
import { areNotificationPermissionsEnabledSelector } from "../../../pushNotifications/store/reducers/environment";
import { PnParamsList } from "../../navigation/params";
import PN_ROUTES from "../../navigation/routes";
import { isPnServiceEnabled } from "../../reminderBanner/reducer/bannerDismiss";
import {
  trackSendQRCodeScanRedirect,
  trackSendQRCodeScanRedirectConfirmed,
  trackSendQRCodeScanRedirectDismissed
} from "../analytics";
import { SendAarInitialFlowScreen } from "../screen/SendAarInitialFlowScreen";
⋮----
export type SendQRScanHandlerScreenProps = {
  aarUrl: string;
};
⋮----
export const SendQRScanFlowHandlerComponent = ({
  aarUrl
}: SendQRScanHandlerScreenProps) =>
</file>

<file path="apps/main-app/ts/features/pn/aar/hooks/useCieInternalAuthAndMrtdReading.ts">
import { triggerHaptic } from "@io-app/design-system";
import {
  CieManager,
  type InternalAuthAndMrtdResponse,
  type NfcError,
  ResultEncoding
} from "@pagopa/io-react-native-cie";
import { constNull } from "fp-ts/lib/function";
import I18n from "i18next";
import { useCallback, useEffect, useState } from "react";
import { Platform } from "react-native";
⋮----
import { getProgressEmojis } from "../../../common/utils/cie";
⋮----
export const enum ReadStatus {
  ERROR = "ERROR",
  IDLE = "IDLE",
  READING = "READING",
  SUCCESS = "SUCCESS"
}
⋮----
export type CieReadState = ErrorState | IdleState | ReadingState | SuccessState;
⋮----
type ErrorState = {
  error: NfcError;
  status: ReadStatus.ERROR;
};
⋮----
type IdleState = {
  status: ReadStatus.IDLE;
};
⋮----
type ReadingState = {
  progress: number;
  status: ReadStatus.READING;
};
⋮----
type SuccessState = {
  data: InternalAuthAndMrtdResponse;
  status: ReadStatus.SUCCESS;
};
⋮----
export const isIdleState = (state: CieReadState): state is IdleState
export const isReadingState = (state: CieReadState): state is ReadingState
export const isSuccessState = (state: CieReadState): state is SuccessState
export const isErrorState = (state: CieReadState): state is ErrorState
⋮----
export const useCieInternalAuthAndMrtdReading = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/hooks/useIsNfcFeatureAvailable.tsx">
import { CieUtils } from "@pagopa/io-react-native-cie";
import { useEffect, useState } from "react";
⋮----
export const useIsNfcFeatureAvailable = () =>
⋮----
const checkNfcAvailability = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/hooks/useIsNfcFeatureEnabled.ts">
import cieSdk from "@pagopa/react-native-cie";
import { constNull } from "fp-ts/lib/function";
import { useCallback, useState } from "react";
import { Platform } from "react-native";
⋮----
export const useIsNfcFeatureEnabled = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/hooks/useSendAarDelegationProposalScreenBottomSheet.tsx">
import { FeatureInfo, IOButton, VStack } from "@io-app/design-system";
import { constUndefined } from "fp-ts/lib/function";
import I18n from "i18next";
import { useRef } from "react";
⋮----
import { useIODispatch } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { identificationRequest } from "../../../identification/store/actions";
import {
  trackSendAarNotificationOpeningMandateBottomSheetAccepted,
  trackSendAarNotificationOpeningMandateBottomSheetClosure
} from "../analytics";
⋮----
type BsFooterButtonProps = {
  onContinuePress?: () => void;
  onIdentificationCancel?: () => void;
  onIdentificationSuccess?: () => void;
};
const BsFooterButton = ({
  onIdentificationCancel = constUndefined,
  onIdentificationSuccess = constUndefined,
  onContinuePress
}: BsFooterButtonProps) =>
⋮----
const handlePress = () =>
⋮----
label=
⋮----
type SendAarDelegationProposalBsProps = BsFooterButtonProps & {
  citizenName: string;
};
⋮----
export const useSendAarDelegationProposalScreenBottomSheet = ({
  citizenName,
  onIdentificationSuccess,
  onIdentificationCancel
}: SendAarDelegationProposalBsProps) =>
⋮----
onIdentificationCancel?.();
</file>

<file path="apps/main-app/ts/features/pn/aar/hooks/useSendAarFlowManager.tsx">
import { useNavigation } from "@react-navigation/native";
import { useCallback } from "react";
⋮----
import { IOStackNavigationProp } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { PnParamsList } from "../../navigation/params";
import { trackSendAarToSAccepted } from "../analytics";
import { setAarFlowState, terminateAarFlow } from "../store/actions";
import { currentAarFlowData } from "../store/selectors";
import {
  AarFlowState,
  maybeIunFromAarFlowState,
  sendAarFlowStates
} from "../utils/stateUtils";
⋮----
type SendAarFlowManager = {
  currentFlowData: AarFlowState;
  goToNextState: () => void;
  terminateFlow: () => void;
};
⋮----
export const useSendAarFlowManager = (): SendAarFlowManager =>
⋮----
const goToNextState = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/hooks/useTrackCieReadingEvents.ts">
import { useEffect } from "react";
⋮----
import {
  trackSendAarMandateCieCanCodeError,
  trackSendAarMandateCieCardReading,
  trackSendAarMandateCieCardReadingError,
  trackSendAarMandateCieCardReadingFailure,
  trackSendAarMandateCieCardReadingSuccess
} from "../analytics";
import {
  CieReadState,
  isErrorState,
  ReadStatus
} from "./useCieInternalAuthAndMrtdReading";
⋮----
const getNormalizedStatusCode = (readState: CieReadState) =>
⋮----
export const useTrackCieReadingEvents = (
  readState: CieReadState,
  nfcDetected: boolean | undefined
) =>
</file>

<file path="apps/main-app/ts/features/pn/aar/saga/createAarMandateSaga.ts">
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { isPnTestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { SagaCallReturnType } from "../../../../types/utils";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { unknownToReason } from "../../../messages/utils";
import {
  aarProblemJsonAnalyticsReport,
  trackSendAarFailure
} from "../analytics";
import { SendAarClient } from "../api/client";
import { setAarFlowState } from "../store/actions";
import { getAarErrorBehaviour } from "../utils/aarErrorMappings";
import {
  AarFlowState,
  SendAarFailurePhase,
  sendAarFlowStates
} from "../utils/stateUtils";
</file>

<file path="apps/main-app/ts/features/pn/aar/saga/downloadAarAttachmentSaga.ts">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { AARProblemJson } from "@io-app/api-types/generated/definitions/pn/aar/AARProblemJson";
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
import { isLeft } from "fp-ts/lib/Either";
import ReactNativeBlobUtil from "react-native-blob-util";
import { call, cancelled, delay, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { apiUrlPrefix, fetchTimeout } from "../../../../config";
import { isPnTestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../../types/utils";
import { isTestEnv } from "../../../../utils/environment";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { downloadAttachment } from "../../../messages/store/actions";
import {
  decodeSendFailureReason,
  SendFailureReason,
  unknownToReason,
  WrappedSendError
} from "../../../messages/utils";
import {
  attachmentDisplayName,
  pdfSavePath,
  restrainRetryAfterIntervalInMilliseconds
} from "../../../messages/utils/attachments";
import {
  aarProblemJsonAnalyticsReport,
  trackSendAarFailure,
  trackSendAarNotificationDetailTtlError
} from "../analytics";
import { createSendAarClientWithLollipop } from "../api/client";
import { isAarAttachmentTtlError } from "../utils/aarErrorMappings";
import { SendAarFailurePhase } from "../utils/stateUtils";
class SendServerError extends Error
⋮----
constructor(message: string, aarProblemJson: AARProblemJson, status: number)
⋮----
const isFastLoginError = (e: unknown)
⋮----
const encodeAttachmentUrl = (inputAttachmentUrl: string): string =>
</file>

<file path="apps/main-app/ts/features/pn/aar/saga/fetchNotificationDataSaga.ts">
import { MessageBodyMarkdown } from "@io-app/api-types/generated/definitions/communication/MessageBodyMarkdown";
import { MessageSubject } from "@io-app/api-types/generated/definitions/communication/MessageSubject";
import { ThirdPartyMessage } from "@io-app/api-types/generated/definitions/pn/aar/ThirdPartyMessage";
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { pnMessagingServiceIdSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isPnTestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../../types/utils";
import { isTestEnv } from "../../../../utils/environment";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { unknownToReason } from "../../../messages/utils";
import { SendUserType } from "../../../pushNotifications/analytics";
import { getServiceDetails } from "../../../services/common/saga/getServiceDetails";
import { profileFiscalCodeSelector } from "../../../settings/common/store/selectors";
import { trackPNNotificationLoadSuccess } from "../../analytics";
import {
  aarProblemJsonAnalyticsReport,
  trackSendAarFailure
} from "../analytics";
import { SendAarClient } from "../api/client";
import {
  EphemeralAarMessageDataActionPayload,
  populateStoresWithEphemeralAarMessageData,
  setAarFlowState
} from "../store/actions";
import { currentAarFlowData } from "../store/selectors";
import { SendAarFailurePhase, sendAarFlowStates } from "../utils/stateUtils";
</file>

<file path="apps/main-app/ts/features/pn/aar/saga/fetchQrCodeSaga.ts">
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { isAarInAppDelegationRemoteEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isPnTestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { SagaCallReturnType } from "../../../../types/utils";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { unknownToReason } from "../../../messages/utils";
import {
  aarProblemJsonAnalyticsReport,
  trackSendAarFailure
} from "../analytics";
import { SendAarClient } from "../api/client";
import { setAarFlowState } from "../store/actions";
import { currentAarFlowData } from "../store/selectors";
import {
  AarFlowState,
  SendAarFailurePhase,
  sendAarFlowStates
} from "../utils/stateUtils";
</file>

<file path="apps/main-app/ts/features/pn/aar/saga/initiateAarFlowSaga.ts">
import { StackActions } from "@react-navigation/native";
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import NavigationService from "../../../../navigation/NavigationService";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
import PN_ROUTES from "../../navigation/routes";
import { initiateAarFlow, terminateAarFlow } from "../store/actions";
import {
  currentAarFlowIunSelector,
  currentAarFlowStateType
} from "../store/selectors";
import { sendAarFlowStates } from "../utils/stateUtils";
</file>

<file path="apps/main-app/ts/features/pn/aar/saga/testSendNisMrtdSaga.ts">
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { SagaCallReturnType } from "../../../../types/utils";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { unknownToReason } from "../../../messages/utils";
import {
  aarProblemJsonAnalyticsReport,
  trackSendAarFailure
} from "../analytics";
import { SendAarClient } from "../api/client";
import { testAarAcceptMandate, testAarCreateMandate } from "../store/actions";
import { sendMandateIdSelector } from "../store/reducers/tempAarMandate";
</file>

<file path="apps/main-app/ts/features/pn/aar/saga/validateMandateSaga.ts">
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import { isPnTestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { SagaCallReturnType } from "../../../../types/utils";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { unknownToReason } from "../../../messages/utils";
import {
  aarProblemJsonAnalyticsReport,
  trackSendAarFailure
} from "../analytics";
import { SendAarClient } from "../api/client";
import { setAarFlowState } from "../store/actions";
import { getAarErrorBehaviour } from "../utils/aarErrorMappings";
import {
  AarFlowState,
  SendAarFailurePhase,
  sendAarFlowStates
} from "../utils/stateUtils";
⋮----
export type AcceptMandateSuccessfulResponse = Extract<
  Awaited<ReturnType<SendAarClient["acceptAARMandate"]>>,
  { _tag: "Right" }
>;
</file>

<file path="apps/main-app/ts/features/pn/aar/saga/watchAarFlowSaga.ts">
import { call, race, select, take, takeLatest } from "typed-redux-saga/macro";
⋮----
import { apiUrlPrefix } from "../../../../config";
import { isAarInAppDelegationRemoteEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isTestEnv } from "../../../../utils/environment";
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { createSendAarClientWithLollipop, SendAarClient } from "../api/client";
import {
  initiateAarFlow,
  setAarFlowState,
  terminateAarFlow,
  testAarAcceptMandate,
  testAarCreateMandate
} from "../store/actions";
import { sendAarFlowStates } from "../utils/stateUtils";
import { createAarMandateSaga } from "./createAarMandateSaga";
import { fetchAarDataSaga } from "./fetchNotificationDataSaga";
import { fetchAarQrCodeSaga } from "./fetchQrCodeSaga";
import { initiateAarFlowSaga } from "./initiateAarFlowSaga";
import {
  testAarAcceptMandateSaga,
  testAarCreateMandateSaga
} from "./testSendNisMrtdSaga";
import { validateMandateSaga } from "./validateMandateSaga";
</file>

<file path="apps/main-app/ts/features/pn/aar/screen/SendAarActivateNfcScreen.tsx">
import { HeaderSecondLevel } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useLayoutEffect } from "react";
import { Alert } from "react-native";
⋮----
import { useHardwareBackButtonWhenFocused } from "../../../../hooks/useHardwareBackButton";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { PnParamsList } from "../../navigation/params";
import PN_ROUTES from "../../navigation/routes";
import {
  trackSendAarMandateCieNfcActivation,
  trackSendAarMandateCieReadingClosureAlert,
  trackSendAarMandateCieReadingClosureAlertAccepted,
  trackSendAarMandateCieReadingClosureAlertContinue
} from "../analytics";
import { SendAarActivateNfcComponent } from "../components/SendAarActivateNfcComponent";
import { useSendAarFlowManager } from "../hooks/useSendAarFlowManager";
import { currentAarFlowData } from "../store/selectors";
import { sendAarFlowStates } from "../utils/stateUtils";
⋮----
export type SendAarActivateNfcScreenProps = IOStackNavigationRouteProps<
  PnParamsList,
  typeof PN_ROUTES.SEND_AAR_NFC_ACTIVATION
>;
</file>

<file path="apps/main-app/ts/features/pn/aar/screen/SendAarCanEducationalScreen.tsx">
import { VSpacer } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
import { Alert, Image } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import cieCanEducationalSource from "../../../../../img/features/pn/cieCanEducational.png";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useHardwareBackButtonWhenFocused } from "../../../../hooks/useHardwareBackButton";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { PnParamsList } from "../../navigation/params";
import PN_ROUTES from "../../navigation/routes";
import {
  trackSendAarMandateCiePreparation,
  trackSendAarMandateCiePreparationContinue,
  trackSendAarMandateCieReadingClosureAlert,
  trackSendAarMandateCieReadingClosureAlertAccepted,
  trackSendAarMandateCieReadingClosureAlertContinue
} from "../analytics";
import { useSendAarFlowManager } from "../hooks/useSendAarFlowManager";
import { setAarFlowState } from "../store/actions";
import {
  aarAdresseeDenominationSelector,
  currentAarFlowData
} from "../store/selectors";
import { sendAarFlowStates } from "../utils/stateUtils";
⋮----
export type SendAarCanEducationalScreenProps = IOStackNavigationRouteProps<
  PnParamsList,
  typeof PN_ROUTES.SEND_AAR_CIE_CAN_EDUCATIONAL
>;
⋮----
const handleGoBack = () =>
⋮----
const handleGoNext = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/screen/SendAarCieCanInsertionScreen.tsx">
import { Body, OTPInput, VSpacer, VStack } from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { useHeaderHeight } from "@react-navigation/elements";
import { useFocusEffect, useIsFocused } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useRef, useState } from "react";
import {
  Image,
  Keyboard,
  KeyboardAvoidingView,
  Platform,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import cieCanEducationalSource from "../../../../../img/features/pn/cieCanEducational.png";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useHardwareBackButtonWhenFocused } from "../../../../hooks/useHardwareBackButton";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../utils/accessibility";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { PnParamsList } from "../../navigation/params";
import PN_ROUTES from "../../navigation/routes";
import { trackSendAarMandateCieCanEnter } from "../analytics";
import { setAarFlowState } from "../store/actions";
import {
  aarAdresseeDenominationSelector,
  currentAarFlowData
} from "../store/selectors";
import { sendAarFlowStates } from "../utils/stateUtils";
⋮----
export type SendAarCieCanInsertionScreenProps = IOStackNavigationRouteProps<
  PnParamsList,
  typeof PN_ROUTES.SEND_AAR_CIE_CAN_INSERTION
>;
</file>

<file path="apps/main-app/ts/features/pn/aar/screen/SendAarCieCardReadingEducationalScreen.tsx">
import { VSpacer } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
import { Image } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import cieScanningEducationalSource from "../../../../../img/features/itWallet/identification/itw_cie_nfc.gif";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useHardwareBackButtonWhenFocused } from "../../../../hooks/useHardwareBackButton";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { PnParamsList } from "../../navigation/params";
import PN_ROUTES from "../../navigation/routes";
import {
  trackSendAarMandateCieCardReadingDisclaimer,
  trackSendAarMandateCieCardReadingDisclaimerContinue
} from "../analytics";
import { useIsNfcFeatureEnabled } from "../hooks/useIsNfcFeatureEnabled";
import { setAarFlowState } from "../store/actions";
import {
  aarAdresseeDenominationSelector,
  currentAarFlowData
} from "../store/selectors";
import { sendAarFlowStates } from "../utils/stateUtils";
⋮----
export type SendAarCieCardReadingEducationalScreenProps =
  IOStackNavigationRouteProps<
    PnParamsList,
    typeof PN_ROUTES.SEND_AAR_CIE_CARD_READING_EDUCATIONAL
  >;
⋮----
const handleGoBack = () =>
⋮----
const handleGoNext = async () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/screen/SendAarCieCardReadingScreen.tsx">
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import type { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import type { PnParamsList } from "../../navigation/params";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useHardwareBackButtonWhenFocused } from "../../../../hooks/useHardwareBackButton";
import { useIOSelector } from "../../../../store/hooks";
import PN_ROUTES from "../../navigation/routes";
import {
  SendAarCieCardReadingComponent,
  type SendAarCieCardReadingComponentProps
} from "../components/SendAarCieCardReadingComponent";
import { currentAarFlowData } from "../store/selectors";
import { sendAarFlowStates } from "../utils/stateUtils";
⋮----
export type SendAarCieCardReadingScreenProps = IOStackNavigationRouteProps<
  PnParamsList,
  typeof PN_ROUTES.SEND_AAR_CIE_CARD_READING
>;
⋮----
export type SendAarCieCardReadingScreenRouteParams =
  Readonly<SendAarCieCardReadingComponentProps>;
⋮----
export const SendAarCieCardReadingScreen = ({
  route,
  navigation
}: SendAarCieCardReadingScreenProps) =>
</file>

<file path="apps/main-app/ts/features/pn/aar/screen/SendAarDelegationProposalScreen.tsx">
import { useIOToast } from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import { StackNavigationProp } from "@react-navigation/stack";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIODispatch } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { PnParamsList } from "../../navigation/params";
import PN_ROUTES from "../../navigation/routes";
import {
  trackSendAarNotificationOpeningMandateBottomSheet,
  trackSendAarNotificationOpeningMandateDisclaimer,
  trackSendAarNotificationOpeningMandateDisclaimerAccepted,
  trackSendAarNotificationOpeningMandateDisclaimerClosure
} from "../analytics";
import { useIsNfcFeatureAvailable } from "../hooks/useIsNfcFeatureAvailable";
import { useSendAarDelegationProposalScreenBottomSheet } from "../hooks/useSendAarDelegationProposalScreenBottomSheet";
import { useSendAarFlowManager } from "../hooks/useSendAarFlowManager";
import { setAarFlowState } from "../store/actions";
import { AarStatesByName, sendAarFlowStates } from "../utils/stateUtils";
⋮----
export const SendAarDelegationProposalScreen = () =>
⋮----
type DelegationProposalContentProps = {
  notAdresseeData: AarStatesByName["notAddressee"];
  terminateFlow: () => void;
};
const DelegationProposalContent = ({
  notAdresseeData,
  terminateFlow
}: DelegationProposalContentProps) =>
⋮----
subtitle=
</file>

<file path="apps/main-app/ts/features/pn/aar/screen/SendAarErrorScreen.tsx">
import { useNavigation } from "@react-navigation/native";
import { StackNavigationProp } from "@react-navigation/stack";
import { useEffect } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import { PnParamsList } from "../../navigation/params";
import PN_ROUTES from "../../navigation/routes";
import { trackSendAarAccessDeniedScreenView } from "../analytics";
import { SendAarGenericErrorComponent } from "../components/errors/SendAarErrorComponent";
import { SendAarNfcNotSupportedComponent } from "../components/errors/SendAarNfcNotSupportedComponent";
import { SendAarNotAddresseeKoComponent } from "../components/errors/SendAarNotAddresseeKoComponent";
import { currentAarFlowData } from "../store/selectors";
import { getAarErrorBehaviour } from "../utils/aarErrorMappings";
import { sendAarFlowStates } from "../utils/stateUtils";
⋮----
export const SendAarErrorScreen = () =>
</file>

<file path="apps/main-app/ts/features/pn/aar/screen/SendAarInitialFlowScreen.tsx">
import { useNavigation } from "@react-navigation/native";
import { StackNavigationProp } from "@react-navigation/stack";
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { SendUserType } from "../../../pushNotifications/analytics";
import { PnParamsList } from "../../navigation/params";
import PN_ROUTES from "../../navigation/routes";
import { trackSendAarToS } from "../analytics";
import { SendAarTosComponent } from "../components/SendAarTosComponent";
import { setAarFlowState } from "../store/actions";
import { currentAarFlowData } from "../store/selectors";
import { sendAarFlowStates } from "../utils/stateUtils";
⋮----
type SendAarInitialFlowScreenT = {
  qrCode: string;
};
export const SendAarInitialFlowScreen = ({
  qrCode
}: SendAarInitialFlowScreenT) =>
</file>

<file path="apps/main-app/ts/features/pn/aar/screen/SendEngagementScreen.tsx">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect, useState } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import {
  IOStackNavigationRouteProps,
  useIONavigation
} from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  NotificationModalFlow,
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
import { NOTIFICATIONS_ROUTES } from "../../../pushNotifications/navigation/routes";
import { areNotificationPermissionsEnabledSelector } from "../../../pushNotifications/store/reducers/environment";
import { sendBannerMixpanelEvents } from "../../analytics/activationReminderBanner";
import {
  trackSendActivationModalDialog,
  trackSendActivationModalDialogActivationDismissed,
  trackSendActivationModalDialogActivationStart
} from "../../analytics/send";
import { PnParamsList } from "../../navigation/params";
import PN_ROUTES from "../../navigation/routes";
import { pnActivationUpsert } from "../../store/actions";
import { SendEngagementComponent } from "../components/SendEngagementComponent";
⋮----
export type SendEngagementScreenNavigationParams = Readonly<{
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
}>;
⋮----
type SendEngagementScreenProps = IOStackNavigationRouteProps<
  PnParamsList,
  typeof PN_ROUTES.ENGAGEMENT_SCREEN
>;
</file>

<file path="apps/main-app/ts/features/pn/aar/screen/SendQRScanFlowScreen.tsx">
import { RouteProp, useRoute } from "@react-navigation/native";
⋮----
import { useAppRequiredUpdate } from "../../../../components/helpers/withAppRequiredUpdate";
import { UpdateAppAlert } from "../../../../components/UpdateAppAlert";
import { PnParamsList } from "../../navigation/params";
import PN_ROUTES from "../../navigation/routes";
import { trackSendAarFailure } from "../analytics";
import { SendQRScanFlowHandlerComponent } from "../components/SendQRScanFlowHandlerComponent";
⋮----
export type SendQRScanFlowScreenProps = {
  aarUrl: string;
};
⋮----
type RouteProps = RouteProp<PnParamsList, typeof PN_ROUTES.QR_SCAN_FLOW>;
</file>

<file path="apps/main-app/ts/features/pn/aar/store/actions/index.ts">
import { MessageBodyMarkdown } from "@io-app/api-types/generated/definitions/communication/MessageBodyMarkdown";
import { MessageSubject } from "@io-app/api-types/generated/definitions/communication/MessageSubject";
import { MandateCreationResponse } from "@io-app/api-types/generated/definitions/pn/aar/MandateCreationResponse";
import { ThirdPartyMessage } from "@io-app/api-types/generated/definitions/pn/aar/ThirdPartyMessage";
import { InternalAuthAndMrtdResponse } from "@pagopa/io-react-native-cie";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { AarFlowState, AarFlowStateName } from "../../utils/stateUtils";
⋮----
export type EphemeralAarMessageDataActionPayload = {
  fiscalCode: string;
  iun: NonEmptyString;
  mandateId?: string;
  markdown: MessageBodyMarkdown;
  pnServiceID: NonEmptyString;
  subject: MessageSubject;
  thirdPartyMessage: ThirdPartyMessage;
};
export type InitiateAarFlowPayload = {
  aarUrl: string;
};
export type TerminateAarFlowPayload = {
  currentFlowState?: AarFlowStateName;
  messageId?: string;
};
⋮----
export type AarFlowStateActions = ActionType<
  | typeof initiateAarFlow
  | typeof populateStoresWithEphemeralAarMessageData
  | typeof setAarFlowState
  | typeof terminateAarFlow
  | typeof testAarAcceptMandate
  | typeof testAarClearData
  | typeof testAarCreateMandate
>;
</file>

<file path="apps/main-app/ts/features/pn/aar/store/reducers/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import {
  AarFlowState,
  isValidAarStateTransition
} from "../../utils/stateUtils";
import { setAarFlowState, terminateAarFlow } from "../actions";
⋮----
export const aarFlowReducer = (
  state: AarFlowState = INITIAL_AAR_FLOW_STATE,
  action: Action
): AarFlowState =>
</file>

<file path="apps/main-app/ts/features/pn/aar/store/reducers/tempAarMandate.ts">
import { MandateCreationResponse } from "@io-app/api-types/generated/definitions/pn/aar/MandateCreationResponse";
import { getType } from "typesafe-actions";
⋮----
import {
  getValue,
  isError,
  isLoading,
  isReady,
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../../../../common/model/RemoteValue";
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import {
  testAarAcceptMandate,
  testAarClearData,
  testAarCreateMandate
} from "../actions";
⋮----
export type TempAarMandateState = {
  mandate: RemoteValue<MandateCreationResponse, string>;
  validation: RemoteValue<void, string>;
};
⋮----
export const tempAarMandateReducer = (
  state: TempAarMandateState = INITIAL_TEMP_AAR_MANDATE_STATE,
  action: Action
): TempAarMandateState =>
⋮----
export const sendMandateErrorSelector = (state: GlobalState) =>
export const sendValidationErrorSelector = (state: GlobalState) =>
⋮----
export const isRequestingSendMandateSelector = (state: GlobalState)
export const sendVerificationCodeSelector = (
  state: GlobalState
): string | undefined
export const sendMandateIdSelector = (state: GlobalState): string | undefined
export const hasSendMandateSelector = (state: GlobalState) =>
export const sendValidationStatusSelector = (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/pn/aar/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { thirdPartyFromIdSelector } from "../../../../messages/store/reducers/thirdPartyById";
import { toSENDMessage } from "../../../store/types/transformers";
import {
  AarFlowState,
  maybeIunFromAarFlowState,
  sendAarFlowStates
} from "../../utils/stateUtils";
⋮----
export const thirdPartySenderDenominationSelector = (
  state: GlobalState,
  ioMessageId: string
) =>
⋮----
export const aarAdresseeDenominationSelector = (state: GlobalState) =>
export const currentAarFlowIunSelector = (
  state: GlobalState
): string | undefined =>
⋮----
export const currentAarFlowData = (state: GlobalState)
export const currentAarFlowStateType = (state: GlobalState)
⋮----
export const currentAarFlowStateAssistanceErrorCode = (
  state: GlobalState
): string | undefined =>
</file>

<file path="apps/main-app/ts/features/pn/aar/utils/aarErrorMappings.ts">
import { AARProblemJson } from "@io-app/api-types/generated/definitions/pn/aar/AARProblemJson";
import _ from "lodash";
import { ComponentType } from "react";
⋮----
import { isTestEnv } from "../../../../utils/environment";
import {
  trackSendAarMandateCieDataError,
  trackSendAarMandateCieExpiredError,
  trackSendAarMandateCieNotRelatedToDelegatorError,
  trackSendAarMandateRetryError,
  trackSendAarMandateTtlExpiredError
} from "../analytics";
import {
  CieExpiredComponent,
  CieValidationExpiredTtlComponent,
  GenericCieValidationErrorComponent,
  UnrelatedCieComponent
} from "../components/errors/SendAarCieValidationErrorComponent";
import { SendAarGenericErrorComponent } from "../components/errors/SendAarErrorComponent";
import { SendAarPendingDelegationErrorComponent } from "../components/errors/SendAarPendingDelegationErrorComponent";
⋮----
type SendAarErrorCodes = keyof typeof sendAARProblemJsonErrorCodes;
⋮----
const isCieErrorCode = (code: string): code is keyof typeof cieErrors
⋮----
export const getAarErrorBehaviour = (
  problemJson?: AARProblemJson
): AarErrorBehaviour =>
⋮----
type AarErrorBehaviour = {
  Component: ComponentType;
  track: (reason: string) => void;
};
⋮----
export const isAarAttachmentTtlError = (
  error?: string
): error is typeof deliveryErrors.PN_DELIVERY_MANDATENOTFOUND
</file>

<file path="apps/main-app/ts/features/pn/aar/utils/deepLinking.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { pnAarQRCodeRegexSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../store/reducers/types";
export const isSendAarLink = (state: GlobalState, url: string)
</file>

<file path="apps/main-app/ts/features/pn/aar/utils/stateUtils.ts">
import { AARProblemJson } from "@io-app/api-types/generated/definitions/pn/aar/AARProblemJson";
import { ThirdPartyMessage } from "@io-app/api-types/generated/definitions/pn/aar/ThirdPartyMessage";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
export type AarFlowStateName =
  SendAarFlowStatesType[keyof SendAarFlowStatesType];
export type RecipientInfo = {
  denomination: string;
  taxId: string;
};
⋮----
export type SendAarFailurePhase =
  | "Create Mandate"
  | "Download Attachment"
  | "Entry Point"
  | "Fetch Notification"
  | "Fetch QRCode"
  | "Playground"
  | "Show Notification"
  | "Validate Mandate";
⋮----
type AndroidNFCActivation = {
  can: string;
  iun: string;
  mandateId: string;
  recipientInfo: RecipientInfo;
  type: SendAarFlowStatesType["androidNFCActivation"];
  verificationCode: string;
};
⋮----
type CieCanAdvisory = {
  iun: string;
  mandateId: string;
  recipientInfo: RecipientInfo;
  type: SendAarFlowStatesType["cieCanAdvisory"];
  verificationCode: string;
};
⋮----
type CieCanInsertion = {
  iun: string;
  mandateId: string;
  recipientInfo: RecipientInfo;
  type: SendAarFlowStatesType["cieCanInsertion"];
  verificationCode: string;
};
⋮----
type CieScanning = {
  can: string;
  iun: string;
  mandateId: string;
  recipientInfo: RecipientInfo;
  type: SendAarFlowStatesType["cieScanning"];
  verificationCode: string;
};
⋮----
type CieScanningAdvisory = {
  can: string;
  iun: string;
  mandateId: string;
  recipientInfo: RecipientInfo;
  type: SendAarFlowStatesType["cieScanningAdvisory"];
  verificationCode: string;
};
⋮----
type CreateMandate = {
  iun: string;
  qrCode: string;
  recipientInfo: RecipientInfo;
  type: SendAarFlowStatesType["creatingMandate"];
};
⋮----
type DisplayingNotification = {
  iun: string;
  mandateId?: string;
  notification: ThirdPartyMessage;
  pnServiceId: ServiceId;
  recipientInfo: RecipientInfo;
  type: SendAarFlowStatesType["displayingNotificationData"];
};
⋮----
type DisplayingTos = {
  qrCode: string;
  type: SendAarFlowStatesType["displayingAarToS"];
};
⋮----
type ErrorState = {
  debugData: {
    phase: SendAarFailurePhase;
    reason: string;
  };
  error?: AARProblemJson;
  previousState: AarFlowState;
  type: SendAarFlowStatesType["ko"];
};
type FetchNotification = {
  iun: string;
  mandateId?: string;
  recipientInfo: RecipientInfo;
  type: SendAarFlowStatesType["fetchingNotificationData"];
};
... (91 lines truncated)
</file>

<file path="apps/main-app/ts/features/pn/aar/utils/testUtils.ts">
import { MessageBodyMarkdown } from "@io-app/api-types/generated/definitions/communication/MessageBodyMarkdown";
import { MessageSubject } from "@io-app/api-types/generated/definitions/communication/MessageSubject";
import { ThirdPartyMessage } from "@io-app/api-types/generated/definitions/pn/aar/ThirdPartyMessage";
import { FiscalCode, NonEmptyString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { EphemeralAarMessageDataActionPayload } from "../store/actions";
import { AarFlowState, RecipientInfo, sendAarFlowStates } from "./stateUtils";
</file>

<file path="apps/main-app/ts/features/pn/analytics/__test__/activationReminderBanner.test.ts">
import { mixpanelTrack } from "../../../../mixpanel";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
import { SendFailureReason } from "../../../messages/utils";
import PN_ROUTES from "../../navigation/routes";
import { sendBannerMixpanelEvents } from "../activationReminderBanner";
⋮----
const testBuildEventProperties = (
  category: string,
  type: string,
  properties?: Record<string, unknown>
) => (
</file>

<file path="apps/main-app/ts/features/pn/analytics/__test__/index.test.ts">
import {
  booleanOrUndefinedToPNServiceStatus,
  trackPNAttachmentOpening,
  trackPNNotificationLoadSuccess,
  trackPNPaymentStart,
  trackPNPaymentStatus,
  trackPNShowF24,
  trackPNShowTimeline,
  trackPNTimelineExternal,
  trackPNUxSuccess
} from "..";
⋮----
import { PaymentStatistics } from "../../../messages/store/reducers/payments";
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
</file>

<file path="apps/main-app/ts/features/pn/analytics/__test__/send.test.ts">
import type { SendActivationSource } from "../send";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { buildEventProperties } from "../../../../utils/analytics";
import {
  NotificationModalFlow,
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
</file>

<file path="apps/main-app/ts/features/pn/analytics/activationReminderBanner.ts">
import type { ErrorFlowStateKeys } from "../reminderBanner/components/PnBannerFlowComponents";
⋮----
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
import { MESSAGES_ROUTES } from "../../messages/navigation/routes";
import { SendFailureReason } from "../../messages/utils";
import PN_ROUTES from "../navigation/routes";
⋮----
const bannerShown = () =>
const bannerTap = () =>
const bannerClose = () =>
⋮----
const bannerKO = (
  reason: "aar" | ErrorFlowStateKeys,
  reasonType?: SendFailureReason
) =>
const alreadyActive = () =>
const activationSuccess = () =>
const activationStart = () =>
</file>

<file path="apps/main-app/ts/features/pn/analytics/index.ts">
import { NotificationStatus } from "@io-app/api-types/generated/definitions/pn/NotificationStatus";
⋮----
import { mixpanelTrack } from "../../../mixpanel";
import {
  booleanToYesNo,
  buildEventProperties,
  numberToYesNoOnThreshold
} from "../../../utils/analytics";
import { PaymentStatistics } from "../../messages/store/reducers/payments";
import { SendFailureReason } from "../../messages/utils";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
⋮----
export type PNServiceStatus = "active" | "not_active" | "unknown";
⋮----
export const booleanOrUndefinedToPNServiceStatus = (
  active: boolean | undefined
): PNServiceStatus
⋮----
const pnServiceActivationStatusBoolToString = (activated?: boolean)
⋮----
export const trackPNOptInMessageOpened = ()
⋮----
export const trackPNOptInMessageAccepted = ()
⋮----
export const trackPNServiceDeactivated = ()
⋮----
export const trackPNServiceActivated = ()
⋮----
export const trackPNPushSettings = (enabled: boolean)
⋮----
export const trackPNOptInMessageCTADisplaySuccess = ()
⋮----
export const trackPNServiceStatusChangeSuccess = (activated?: boolean)
⋮----
export const trackPNServiceStatusChangeError = (
  currentStatus: boolean,
  reason: string
)
⋮----
export function trackPNAttachmentDownloadFailure(
  category?: string,
  reason?: SendFailureReason
)
⋮----
export function trackPNAttachmentOpening(
  openingSource: SendOpeningSource,
  userType: SendUserType,
  category?: string
)
⋮----
export function trackPNAttachmentOpeningSuccess(
  previewStatus: "displayer" | "error",
  category?: string
)
⋮----
export function trackPNAttachmentSave(category?: string)
⋮----
export function trackPNAttachmentSaveShare(category?: string)
⋮----
export function trackPNAttachmentShare(category?: string)
⋮----
export function trackPNNotificationLoadError(errorCode?: string)
⋮----
export function trackPNNotificationLoadSuccess(
  hasAttachmens: boolean,
  status: NotificationStatus | undefined,
  openingSource: SendOpeningSource,
  userType: SendUserType
)
⋮----
export function trackPNPaymentStart(
  openingSource: SendOpeningSource,
  userType: SendUserType
)
⋮----
export function trackPNPaymentStatus(
  {
    paymentCount,
    unpaidCount,
    paidCount,
    errorCount,
    expiredCount,
    revokedCount,
    ongoingCount
  }: PaymentStatistics,
  openingSource: SendOpeningSource,
  userType: SendUserType
)
⋮----
export function trackPNPushOpened()
⋮----
export function trackPNShowAllPayments()
⋮----
export function trackPNShowF24(
  openingSource: SendOpeningSource,
  userType: SendUserType
)
... (20 lines truncated)
</file>

<file path="apps/main-app/ts/features/pn/analytics/send.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
import {
  NotificationModalFlow,
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
⋮----
export type SendActivationSource = "nurturing_bottomsheet" | "tos_bottomsheet";
⋮----
export const trackSendActivationModalDialog = (
  flow: NotificationModalFlow,
  sendSource: SendOpeningSource = "not_set",
  sendUser: SendUserType = "not_set"
) =>
⋮----
export const trackSendActivationModalDialogActivationStart = (
  flow: NotificationModalFlow,
  sendSource: SendOpeningSource = "not_set",
  sendUser: SendUserType = "not_set"
) =>
⋮----
export const trackSendActivationModalDialogActivationDismissed = (
  flow: NotificationModalFlow,
  sendSource: SendOpeningSource = "not_set",
  sendUser: SendUserType = "not_set"
) =>
⋮----
export const trackSendAcceptanceDialog = (
  flow: NotificationModalFlow,
  send_user: SendUserType = "not_set"
) =>
export const trackSendNurturingDialog = (
  flow: NotificationModalFlow,
  send_user: SendUserType = "not_set"
) =>
export const trackSendActivationAccepted = (
  source: SendActivationSource,
  flow: NotificationModalFlow,
  send_user: SendUserType = "not_set"
) =>
export const trackSendAcceptanceDialogClosure = (
  flow: NotificationModalFlow,
  send_user: SendUserType = "not_set"
) =>
export const trackSendActivationDeclined = (
  flow: NotificationModalFlow,
  send_user: SendUserType = "not_set"
) =>
export const trackSendNurturingDialogClosure = (
  flow: NotificationModalFlow,
  send_user: SendUserType = "not_set"
) =>
</file>

<file path="apps/main-app/ts/features/pn/api/client.ts">
import { createClient } from "@io-app/api-types/generated/definitions/communication/client";
⋮----
import { fetchMaxRetries, fetchTimeout } from "../../../config";
import { defaultRetryingFetch } from "../../../utils/fetch";
⋮----
export const createPnClient = (baseUrl: string, token: string)
⋮----
export type PnClient = ReturnType<typeof createPnClient>;
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/F24ListBottomSheetLink.tsx">
import { View } from "react-native";
⋮----
import { F24ListBottomSheetLinkProps } from "../F24ListBottomSheetLink";
⋮----
export const F24ListBottomSheetLink = ({
  f24List,
  messageId,
  serviceId,
  sendOpeningSource,
  sendUserType
}: F24ListBottomSheetLinkProps) => (
  <View>
    <View>{"Mock F24ListBottomSheetLink"}</View>
    <View>{`Item count:     ${f24List.length}`}</View>
    <View>{`Message Id:     ${messageId}`}</View>
    <View>{`Service Id:     ${serviceId}`}</View>
    <View>{`Opening Source: ${sendOpeningSource}`}</View>
    <View>{`User Type:      ${sendUserType}`}</View>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/F24Section.tsx">
import { View } from "react-native";
⋮----
import { F24SectionProps } from "../F24Section";
⋮----
export const F24Section = ({
  isCancelled,
  messageId,
  serviceId,
  sendOpeningSource,
  sendUserType
}: F24SectionProps) => (
  <View>
    <View>{`Mock F24Section`}</View>
    <View>{`Message Id:     ${messageId}`}</View>
    <View>{`Service Id:     ${serviceId}`}</View>
    <View>{`Cancelled:      ${isCancelled}`}</View>
    <View>{`Opening Source: ${sendOpeningSource}`}</View>
    <View>{`User Type:      ${sendUserType}`}</View>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/MessageBottomMenu.tsx">
import { View } from "react-native";
⋮----
import { MessageBottomMenuProps } from "../MessageBottomMenu";
⋮----
export const MessageBottomMenu = ({
  history,
  isCancelled,
  iun,
  messageId,
  paidNoticeCodes,
  payments,
  sendOpeningSource,
  sendUserType
}: MessageBottomMenuProps) => (
  <View testID="MessageBottomMenu">
    <View>Mock MessageBottomMenu</View>
    {history.map((pieceOfHistory, index) => (
      <View key={`poh_${index}`}>
        <View>{`Mock TimelineListItem at ${index}`}</View>
        <View>{`${pieceOfHistory.activeFrom}`}</View>
        <View>
          {pieceOfHistory.relatedTimelineElements.map(
            (relatedTimelineElement, rteIndex) => (
              <View key={`rte_${rteIndex}`}>{relatedTimelineElement}</View>
            )
          )}
        </View>
        <View>{`${pieceOfHistory.status}`}</View>
      </View>
    ))}
    {isCancelled && <View>{`${isCancelled}`}</View>}
    <View>{iun}</View>
    <View>{messageId}</View>
    {paidNoticeCodes &&
      paidNoticeCodes.map((paidNoticeCode, index) => (
        <View key={`pnc_${index}`}>{paidNoticeCode}</View>
      ))}
    {payments &&
      payments.map((payment, index) => (
        <View key={`p_${index}`}>
          <View>{payment.creditorTaxId}</View>
          <View>{payment.noticeCode}</View>
        </View>
      ))}
    <View>{`Opening Source: ${sendOpeningSource}`}</View>
    <View>{`User Type: ${sendUserType}`}</View>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/MessageCancelledContent.tsx">
import { View } from "react-native";
⋮----
import { MessageCancelledContentProps } from "../MessageCancelledContent";
⋮----
export const MessageCancelledContent = ({
  isCancelled,
  paidNoticeCodes,
  payments
}: MessageCancelledContentProps) => (
  <View>
    <View>{`Mock MessageCancelledContent`}</View>
    <View>{`Is cancelled:            ${isCancelled}`}</View>
    <View>{`Paid notice codes count: ${
      paidNoticeCodes?.length ?? "undefined"
    }`}</View>
    <View>{`Payments count:          ${payments?.length ?? "undefined"}`}</View>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/MessageDetails.tsx">
import { View } from "react-native";
⋮----
import { MessageDetailsProps } from "../MessageDetails";
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/MessageDetailsContent.tsx">
import { View } from "react-native";
⋮----
import { MessageDetailsContentProps } from "../MessageDetailsContent";
⋮----
export const MessageDetailsContent = ({
  message,
  sendUserType
}: MessageDetailsContentProps) => (
  <View>
    <View>{`Mock MessageDetailsContent`}</View>
    <View>${`Abstract:            ${message.abstract}`}</View>
    <View>${`IUN:                 ${message.iun}`}</View>
    <View>${`Sender Denomination: ${message.senderDenomination}`}</View>
    <View>${`Send User Type:      ${sendUserType}`}</View>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/MessagePaymentBottomSheet.tsx">
import { View } from "react-native";
⋮----
import { MessagePaymentBottomSheetProps } from "../MessagePaymentBottomSheet";
⋮----
export const MessagePaymentBottomSheet = ({
  messageId,
  payments,
  presentPaymentsBottomSheetRef,
  serviceId,
  sendOpeningSource,
  sendUserType
}: MessagePaymentBottomSheetProps) => (
  <View>
    <View>{`Mock MessagePaymentBottomSheet`}</View>
    <View>{`Message Id:       ${messageId}`}</View>
    <View>{`Payment Count:    ${payments.length}`}</View>
    <View>{`Bottom Sheet Ref: ${
      presentPaymentsBottomSheetRef ? "defined" : "undefined"
    }`}</View>
    <View>{`Service Id:       ${serviceId}`}</View>
    <View>{`Opening Source:   ${sendOpeningSource}`}</View>
    <View>{`User Type:        ${sendUserType}`}</View>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/MessagePayments.tsx">
import { View } from "react-native";
⋮----
import { MessagePaymentsProps } from "../MessagePayments";
⋮----
export const MessagePayments = ({
  completedPaymentNoticeCodes,
  isCancelled,
  maxVisiblePaymentCount,
  messageId,
  payments,
  presentPaymentsBottomSheetRef,
  serviceId,
  sendOpeningSource,
  sendUserType
}: MessagePaymentsProps) => (
  <View>
    <View>{`Mock MessagePayments`}</View>
    <View>{`Completed payments: ${
      completedPaymentNoticeCodes?.length ?? "none"
    }`}</View>
    <View>{`Cancelled:          ${isCancelled}`}</View>
    <View>{`Max Payment Count:  ${maxVisiblePaymentCount}`}</View>
    <View>{`Message Id:         ${messageId}`}</View>
    <View>{`Payments:           ${payments?.length ?? "none"}`}</View>
    <View>{`Bottom Sheet ref:   ${
      presentPaymentsBottomSheetRef ? "defined" : "undefined"
    }`}</View>
    <View>{`Service Id:         ${serviceId}`}</View>
    <View>{`Opening Source:     ${sendOpeningSource}`}</View>
    <View>{`User Type:          ${sendUserType}`}</View>
  </View>
);
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/NeedHelp.tsx">
import { View } from "react-native";
⋮----
export const NeedHelp = () => <View>
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/Timeline.tsx">
import { View } from "react-native";
⋮----
import { TimelineProps } from "../Timeline";
</file>

<file path="apps/main-app/ts/features/pn/components/__mocks__/TimelineListItem.tsx">
import { View } from "react-native";
⋮----
import { TimelineListItemProps } from "../TimelineListItem";
⋮----
export const TimelineListItem = ({
  history,
  sendOpeningSource,
  sendUserType
}: TimelineListItemProps) => (
  <>
    {history.map((pieceOfHistory, index) => (
      <View key={`poh_${index}`}>
        <View>{`Mock TimelineListItem at ${index}`}</View>
        <View>{`${pieceOfHistory.activeFrom}`}</View>
        {pieceOfHistory.relatedTimelineElements.map(
          (relatedTimelineElement, rteIndex) => (
            <View key={`rte_${rteIndex}`}>
              <View>{relatedTimelineElement}</View>
            </View>
          )
        )}
        <View>{pieceOfHistory.status}</View>
      </View>
    ))}
    <View>{`Opening Source: ${sendOpeningSource}`}</View>
    <View>{`User Type: ${sendUserType}`}</View>
  </>
);
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/BannerAttachments.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import { View } from "react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
⋮----
import { BannerAttachments } from "../BannerAttachments";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/F24ListBottomSheetLink.test.tsx">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { fireEvent } from "@testing-library/react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
⋮----
import PN_ROUTES from "../../navigation/routes";
import { F24ListBottomSheetLink } from "../F24ListBottomSheetLink";
⋮----
const numberToThirdPartyAttachment = (index: number)
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/F24Section.test.tsx">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
⋮----
import { ATTACHMENT_CATEGORY } from "../../../messages/types/attachmentCategory";
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
import PN_ROUTES from "../../navigation/routes";
import { F24Section } from "../F24Section";
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/MessageBottomMenu.test.tsx">
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { NotificationStatusHistory } from "@io-app/api-types/generated/definitions/pn/NotificationStatusHistory";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
import PN_ROUTES from "../../navigation/routes";
import { MessageBottomMenu } from "../MessageBottomMenu";
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/MessageCancelledContent.test.tsx">
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import PN_ROUTES from "../../navigation/routes";
import { MessageCancelledContent } from "../MessageCancelledContent";
⋮----
const renderComponent = (
  isCancelled?: boolean,
  paidNoticeCodes?: ReadonlyArray<string>,
  payments?: ReadonlyArray<NotificationPaymentInfo>
) =>
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/MessageDetails.test.tsx">
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ComponentProps } from "react";
import configureMockStore from "redux-mock-store";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { GlobalState } from "../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
⋮----
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
import { thirdPartyMessage } from "../../__mocks__/pnMessage";
import PN_ROUTES from "../../navigation/routes";
import { toSENDMessage } from "../../store/types/transformers";
import { PNMessage } from "../../store/types/types";
import { MessageDetails } from "../MessageDetails";
⋮----
const generateComponentProperties = (
  messageId: string,
  message: PNMessage,
  serviceId: ServiceId,
  sendOpeningSource: SendOpeningSource,
  sendUserType: SendUserType,
  payments?: ReadonlyArray<NotificationPaymentInfo>
): ComponentProps<typeof MessageDetails> => (
⋮----
const renderComponent = (props: ComponentProps<typeof MessageDetails>) =>
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/MessageDetailsContent.test.tsx">
import _ from "lodash";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import { SendUserType } from "../../../pushNotifications/analytics";
import { thirdPartyMessage } from "../../__mocks__/pnMessage";
import { aarAdresseeDenominationSelector } from "../../aar/store/selectors";
import PN_ROUTES from "../../navigation/routes";
import { toSENDMessage } from "../../store/types/transformers";
import {
  MessageDetailsContent,
  MessageDetailsContentProps,
  testable
} from "../MessageDetailsContent";
⋮----
const mockSelectors = (denomination: string | undefined) =>
⋮----
const runSnapshotTest = ({
    sendUserType,
    hasAarAdresseeDenomination,
    hasSenderDenomination,
    isAbstractEnabled
  }: {
    hasAarAdresseeDenomination: boolean;
    hasSenderDenomination: boolean;
    isAbstractEnabled: boolean;
    sendUserType: SendUserType;
}) =>
⋮----
const renderMessageDetails = (props: MessageDetailsContentProps) =>
⋮----
const renderAbstract = (props: string | undefined) =>
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/MessagePaymentBottomSheet.test.tsx">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { PaymentInfoResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoResponse";
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { createStore } from "redux";
⋮----
import { remoteError, remoteReady } from "../../../../common/model/RemoteValue";
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { GlobalState } from "../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import { toSpecificMessagePaymentError } from "../../../messages/types/paymentErrors";
import PN_ROUTES from "../../navigation/routes";
import { MessagePaymentBottomSheet } from "../MessagePaymentBottomSheet";
⋮----
const globalState = ()
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/MessagePayments.test.tsx">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { PaymentInfoResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoResponse";
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { createStore } from "redux";
⋮----
import { remoteError, remoteReady } from "../../../../common/model/RemoteValue";
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { GlobalState } from "../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import { toSpecificMessagePaymentError } from "../../../messages/types/paymentErrors";
import PN_ROUTES from "../../navigation/routes";
import { MessagePayments } from "../MessagePayments";
⋮----
const generatePayablePayment = (rptId: string, amount: number)
const notificationPaymentInfosFromPaymentIds = (paymentIds: Array<string>)
⋮----
const globalState = (): GlobalState
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/NeedHelp.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import { View } from "react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
⋮----
import PN_ROUTES from "../../navigation/routes";
import { NeedHelp } from "../NeedHelp";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/Timeline.test.tsx">
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import PN_ROUTES from "../../navigation/routes";
import { getNotificationStatusAccessibilityLabel } from "../../utils";
import { Timeline, TimelineItemProps, TimelineProps } from "../Timeline";
⋮----
const renderComponent = (
  data: ReadonlyArray<TimelineItemProps>,
  footerHeight: number
) =>
</file>

<file path="apps/main-app/ts/features/pn/components/__test__/TimelineListItem.test.tsx">
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { NotificationStatusHistory } from "@io-app/api-types/generated/definitions/pn/NotificationStatusHistory";
import { fireEvent, render } from "@testing-library/react-native";
⋮----
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
⋮----
import { GlobalState } from "../../../../store/reducers/types";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
⋮----
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
⋮----
import PN_ROUTES from "../../navigation/routes";
import { TimelineListItem } from "../TimelineListItem";
⋮----
const renderComponent = (
  history: NotificationStatusHistory,
  frontendUrlDefined: boolean,
  sendOpeningSource: SendOpeningSource,
  sendUserType: SendUserType
) =>
</file>

<file path="apps/main-app/ts/features/pn/components/BannerAttachments.tsx">
import { Alert, Body, IOButton, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { sendEstimateTimelinesUrlSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { openWebUrl } from "../../../utils/url";
⋮----
export const BannerAttachments = () =>
⋮----
const openExternalUrl = () =>
</file>

<file path="apps/main-app/ts/features/pn/components/F24ListBottomSheetLink.tsx">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { IOButton } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIODispatch } from "../../../store/hooks";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { MessageDetailsAttachmentItem } from "../../messages/components/MessageDetail/MessageDetailsAttachmentItem";
import { cancelPreviousAttachmentDownload } from "../../messages/store/actions";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
import { trackPNShowF24 } from "../analytics";
⋮----
export type F24ListBottomSheetLinkProps = {
  f24List: ReadonlyArray<ThirdPartyAttachment>;
  messageId: string;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
  serviceId: ServiceId;
};
⋮----
export const F24ListBottomSheetLink = ({
  f24List,
  messageId,
  serviceId,
  sendOpeningSource,
  sendUserType
}: F24ListBottomSheetLinkProps) =>
⋮----
{f24List.map((f24Attachment, index) => (
          <MessageDetailsAttachmentItem
            attachment={f24Attachment}
            bottomSpacer={index + 1 < f24List.length}
            key={`MessageF24_${index}`}
            messageId={messageId}
onPreNavigate=
⋮----
trackPNShowF24(sendOpeningSource, sendUserType);
present();
</file>

<file path="apps/main-app/ts/features/pn/components/F24Section.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { Body, ListItemHeader, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { MessageDetailsAttachmentItem } from "../../messages/components/MessageDetail/MessageDetailsAttachmentItem";
import { thirdPartyMessageAttachmentsSelector } from "../../messages/store/reducers/thirdPartyById";
import { ATTACHMENT_CATEGORY } from "../../messages/types/attachmentCategory";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
import { F24ListBottomSheetLink } from "./F24ListBottomSheetLink";
⋮----
export type F24SectionProps = {
  isCancelled?: boolean;
  messageId: string;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
  serviceId: ServiceId;
};
</file>

<file path="apps/main-app/ts/features/pn/components/MessageBottomMenu.tsx">
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { NotificationStatusHistory } from "@io-app/api-types/generated/definitions/pn/NotificationStatusHistory";
import { IOColors, IODimensions, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { formatStringToSpacedString } from "../../../utils/accessibility.ts";
import {
  ShowMoreListItem,
  ShowMoreSection
} from "../../messages/components/MessageDetail/ShowMoreListItem";
import { formatPaymentNoticeNumber } from "../../payments/common/utils";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
import { NeedHelp } from "./NeedHelp";
import { TimelineListItem } from "./TimelineListItem";
⋮----
export type MessageBottomMenuProps = {
  history: NotificationStatusHistory;
  isCancelled?: boolean;
  iun: string;
  messageId: string;
  paidNoticeCodes?: ReadonlyArray<string>;
  payments?: ReadonlyArray<NotificationPaymentInfo>;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
};
⋮----
const generateMessageSectionData = (
  iun: string,
  messageId: string | undefined,
  isCancelled?: boolean,
  paidNoticeCodes?: ReadonlyArray<string>,
  payments?: ReadonlyArray<NotificationPaymentInfo>
): ReadonlyArray<ShowMoreSection> =>
⋮----
export const MessageBottomMenu = ({
  history,
  isCancelled,
  iun,
  messageId,
  paidNoticeCodes,
  payments,
  sendOpeningSource,
  sendUserType
}: MessageBottomMenuProps) =>
</file>

<file path="apps/main-app/ts/features/pn/components/MessageCancelledContent.tsx">
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { Alert, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
⋮----
export type MessageCancelledContentProps = {
  isCancelled?: boolean;
  paidNoticeCodes?: ReadonlyArray<string>;
  payments?: ReadonlyArray<NotificationPaymentInfo>;
};
⋮----
export const MessageCancelledContent = ({
  isCancelled,
  paidNoticeCodes,
  payments
}: MessageCancelledContentProps) =>
</file>

<file path="apps/main-app/ts/features/pn/components/MessageDetails.tsx">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  ContentWrapper,
  Icon,
  ScrollViewWithStickyFooterActions,
  Tag,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { useRef } from "react";
⋮----
import { MessageDetailsAttachments } from "../../messages/components/MessageDetail/MessageDetailsAttachments";
import { MessageDetailsHeader } from "../../messages/components/MessageDetail/MessageDetailsHeader";
import { SendMessageSurveyBanner } from "../../messages/components/MessageSurveyBanner";
import { ATTACHMENT_CATEGORY } from "../../messages/types/attachmentCategory";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
import { useMessageFooterActions } from "../hooks/useMessageFooterActions";
import { PNMessage } from "../store/types/types";
import {
  maxVisiblePaymentCount,
  openingSourceIsAarMessage,
  shouldUseBottomSheetForPayments
} from "../utils";
import { BannerAttachments } from "./BannerAttachments";
import { F24Section } from "./F24Section";
import { MessageBottomMenu } from "./MessageBottomMenu";
import { MessageCancelledContent } from "./MessageCancelledContent";
import { MessageDetailsContent } from "./MessageDetailsContent";
import { MessagePaymentBottomSheet } from "./MessagePaymentBottomSheet";
import { MessagePayments } from "./MessagePayments";
⋮----
export type MessageDetailsProps = {
  message: PNMessage;
  messageId: string;
  payments?: ReadonlyArray<NotificationPaymentInfo>;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
  serviceId: ServiceId;
};
⋮----
text=
</file>

<file path="apps/main-app/ts/features/pn/components/MessageDetailsContent.tsx">
import { BodySmall } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { sendShowAbstractSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { isTestEnv } from "../../../utils/environment";
import { SendUserType } from "../../pushNotifications/analytics";
import { aarAdresseeDenominationSelector } from "../aar/store/selectors";
import { PNMessage } from "../store/types/types";
⋮----
export type MessageDetailsContentProps = {
  message: PNMessage;
  sendUserType: SendUserType;
};
export const MessageDetailsContent = ({
  message,
  sendUserType
}: MessageDetailsContentProps) => (
  <BodySmall>
    <MaybeDelegationText sendUserType={sendUserType} />
    <MaybeDenomination senderDenomination={message.senderDenomination} />
    {I18n.t(
      "features.pn.aar.flow.displayingNotificationData.abstract.title.checkDocuments"
    )}
    <MaybeAbstract abstract={message.abstract} />
  </BodySmall>
);
⋮----
type MaybeDenominationProps = { senderDenomination: string | undefined };
const MaybeDenomination = (
⋮----
type MaybeDelegationTextProps = { sendUserType: SendUserType };
⋮----
const shouldShowAbstract = useIOSelector(sendShowAbstractSelector);
</file>

<file path="apps/main-app/ts/features/pn/components/MessagePaymentBottomSheet.tsx">
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import I18n from "i18next";
import { RefObject } from "react";
import { Dimensions } from "react-native";
⋮----
import { useIODispatch } from "../../../store/hooks";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { MessagePaymentItem } from "../../messages/components/MessageDetail/MessagePaymentItem";
import { cancelQueuedPaymentUpdates } from "../../messages/store/actions";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
import { getRptIdStringFromPayment } from "../utils/rptId";
⋮----
export type MessagePaymentBottomSheetProps = {
  messageId: string;
  payments: ReadonlyArray<NotificationPaymentInfo>;
  presentPaymentsBottomSheetRef: RefObject<(() => void) | undefined>;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
  serviceId: ServiceId;
};
⋮----
export const MessagePaymentBottomSheet = ({
  messageId,
  payments,
  presentPaymentsBottomSheetRef,
  serviceId,
  sendOpeningSource,
  sendUserType
}: MessagePaymentBottomSheetProps) =>
⋮----
⋮----
willNavigateToPayment=
</file>

<file path="apps/main-app/ts/features/pn/components/MessagePayments.tsx">
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  IOButton,
  IOSkeleton,
  ListItemHeader,
  ModulePaymentNotice,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { CommonActions, useNavigation } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { RefObject } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { MessagePaymentItem } from "../../messages/components/MessageDetail/MessagePaymentItem";
import { MESSAGES_ROUTES } from "../../messages/navigation/routes";
import { getBadgeTextByPaymentNoticeStatus } from "../../messages/utils/strings";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
import { trackPNShowAllPayments } from "../analytics";
import PN_ROUTES from "../navigation/routes";
import { paymentsButtonStateSelector } from "../store/reducers/payments";
import { canShowMorePaymentsLink } from "../utils";
import { getRptIdStringFromPayment } from "../utils/rptId";
⋮----
export type MessagePaymentsProps = {
  completedPaymentNoticeCodes: ReadonlyArray<string> | undefined;
  isCancelled: boolean;
  maxVisiblePaymentCount: number;
  messageId: string;
  payments: ReadonlyArray<NotificationPaymentInfo> | undefined;
  presentPaymentsBottomSheetRef: RefObject<(() => void) | undefined>;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
  serviceId: ServiceId;
};
⋮----
const readonlyArrayHasNoData = <T,>(maybeArray: ReadonlyArray<T> | undefined)
⋮----
const paymentSectionShouldRenderNothing = (
  isCancelled: boolean,
  payments: ReadonlyArray<NotificationPaymentInfo> | undefined,
  completedPaymentNoticeCodes: ReadonlyArray<string> | undefined
)
⋮----
const generateNavigationToPaidPaymentScreenAction = (
  noticeCode: string,
  maybePayments: ReadonlyArray<NotificationPaymentInfo> | undefined
)
⋮----
</file>

<file path="apps/main-app/ts/features/pn/components/NeedHelp.tsx">
import { Body, IOButton, ListItemAction, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { sendCustomServiceCenterUrlSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { openWebUrl } from "../../../utils/url";
⋮----
export const NeedHelp = () =>
⋮----
const openCustomerServiceCenterUrl = () =>
</file>

<file path="apps/main-app/ts/features/pn/components/Timeline.tsx">
import { Caption, H6, IOColors, VSpacer } from "@io-app/design-system";
import { PropsWithChildren } from "react";
import { StyleSheet, View } from "react-native";
⋮----
export type TimelineItemProps = {
  accessibilityLabel: string;
  day: string;
  description: string;
  month: string;
  status: TimelineStatus;
  time: string;
};
⋮----
export type TimelineProps = {
  data: ReadonlyArray<TimelineItemProps>;
  footerHeight: number;
};
⋮----
export type TimelineStatus =
  | "cancelled"
  | "default"
  | "effective"
  | "unreachable"
  | "viewed";
⋮----
type ColorStates = {
  background: string;
};
⋮----
type Position = {
  isFirst: boolean;
  isLast: boolean;
};
</file>

<file path="apps/main-app/ts/features/pn/components/TimelineListItem.tsx">
import { NotificationStatusHistory } from "@io-app/api-types/generated/definitions/pn/NotificationStatusHistory";
import {
  Alert,
  IODimensions,
  IOMaxFontSizeMultiplier,
  ListItemAction
} from "@io-app/design-system";
import I18n from "i18next";
import { useMemo, useState } from "react";
import { Dimensions, useWindowDimensions, View } from "react-native";
⋮----
import { useIOSelector } from "../../../store/hooks";
import {
  isAarInAppDelegationRemoteEnabledSelector,
  pnFrontendUrlSelector
} from "../../../store/reducers/backendStatus/remoteConfig";
import { formatDateAsDay, formatDateAsMonth } from "../../../utils/dates";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import { handleItemOnPress } from "../../../utils/url";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
import { trackPNShowTimeline, trackPNTimelineExternal } from "../analytics";
import {
  getNotificationStatusAccessibilityLabel,
  getNotificationStatusInfo,
  notificationStatusToTimelineStatus
} from "../utils";
import { Timeline, TimelineItemProps } from "./Timeline";
⋮----
export type TimelineListItemProps = {
  history: NotificationStatusHistory;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
};
⋮----
const generateTimelineData = (
  history: NotificationStatusHistory
): ReadonlyArray<TimelineItemProps>
⋮----
setFooterHeight(layoutChangeEvent.nativeEvent.layout.height)
⋮----
sendExternalUrl
⋮----
trackPNShowTimeline(sendOpeningSource, sendUserType);
present();
</file>

<file path="apps/main-app/ts/features/pn/hooks/useMessageFooterActions.ts">
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { FooterActions, useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps, RefObject, useCallback } from "react";
import { useDispatch } from "react-redux";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { canNavigateToPaymentFromMessageSelector } from "../../messages/store/reducers/payments";
import { initializeAndNavigateToWalletForPayment } from "../../messages/utils";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
import { trackPNPaymentStart, trackPNShowAllPayments } from "../analytics";
import { paymentsButtonStateSelector } from "../store/reducers/payments";
import { shouldUseBottomSheetForPayments } from "../utils";
import { getRptIdStringFromPayment } from "../utils/rptId";
⋮----
export type UseMessageFooterActionsProps = {
  isCancelled: boolean;
  maxVisiblePaymentCount: number;
  messageId: string;
  payments: ReadonlyArray<NotificationPaymentInfo> | undefined;
  presentPaymentsBottomSheetRef: RefObject<(() => void) | undefined>;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
};
⋮----
export const useMessageFooterActions = ({
  messageId,
  payments,
  maxVisiblePaymentCount,
  isCancelled,
  presentPaymentsBottomSheetRef,
  sendOpeningSource,
  sendUserType
}: UseMessageFooterActionsProps): ComponentProps<
  typeof FooterActions
>["actions"] => {
  const dispatch = useDispatch();
</file>

<file path="apps/main-app/ts/features/pn/hooks/usePnPreferencesFetcher.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import React from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { loadServicePreference } from "../../services/details/store/actions/preference";
import { servicePreferencePotByIdSelector } from "../../services/details/store/selectors";
import { isServicePreferenceResponseSuccess } from "../../services/details/types/ServicePreferenceResponse";
⋮----
type PnStatus = {
  isEnabled: boolean;
  isError: boolean;
  isLoading: boolean;
};
⋮----
export const usePnPreferencesFetcher = (pnServiceId: ServiceId): PnStatus =>
</file>

<file path="apps/main-app/ts/features/pn/hooks/useSpecialCtaPn.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { IOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
⋮----
import { IOScrollViewActions } from "../../../components/ui/IOScrollView";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import {
  isPnAppVersionSupportedSelector,
  isPnRemoteEnabledSelector
} from "../../../store/reducers/backendStatus/remoteConfig";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { openAppStoreUrl } from "../../../utils/url";
⋮----
import { useServicePreferenceByChannel } from "../../services/details/hooks/useServicePreference";
import {
  trackPNServiceActivated,
  trackPNServiceDeactivated
} from "../analytics";
import { pnActivationUpsert } from "../store/actions";
import { isLoadingPnActivationSelector } from "../store/reducers/activation";
⋮----
const usePnActivation = (serviceId: ServiceId) =>
⋮----
export const useSpecialCtaPn = (
  serviceId: ServiceId,
  activate = false
): IOScrollViewActions["primary"] | undefined =>
</file>

<file path="apps/main-app/ts/features/pn/loginEngagement/hooks/useSendActivationBottomSheet.tsx">
import { IOButton, IOMarkdownLite, VStack } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useRef } from "react";
import { View } from "react-native";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { pnPrivacyUrlsSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { NotificationModalFlow } from "../../../pushNotifications/analytics";
import {
  trackSendAcceptanceDialogClosure,
  trackSendActivationAccepted
} from "../../analytics/send";
import { useSendActivationFlow } from "./useSendActivationFlow";
⋮----
export const useSendActivationBottomSheet = () =>
</file>

<file path="apps/main-app/ts/features/pn/loginEngagement/hooks/useSendActivationFlow.tsx">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { setSecurityAdviceReadyToShow } from "../../../authentication/fastLogin/store/actions/securityAdviceActions";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
import { NOTIFICATIONS_ROUTES } from "../../../pushNotifications/navigation/routes";
import { areNotificationPermissionsEnabledSelector } from "../../../pushNotifications/store/reducers/environment";
import PN_ROUTES from "../../navigation/routes";
import { pnActivationUpsert } from "../../store/actions";
import { isLoadingPnActivationSelector } from "../../store/reducers/activation";
import { setSendEngagementScreenHasBeenDismissed } from "../store/actions";
⋮----
export const useSendActivationFlow = () =>
⋮----
const handleRateLimitError = () =>
⋮----
const onSENDActivationSucceeded = () =>
const onSENDActivationFailed = (isRateLimitError?: boolean) =>
⋮----
const requestSendActivation = () =>
</file>

<file path="apps/main-app/ts/features/pn/loginEngagement/hooks/useSendAreYouSureBottomSheet.tsx">
import {
  FeatureInfo,
  IOButton,
  IOMarkdownLite,
  VSpacer,
  VStack
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useRef } from "react";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { pnPrivacyUrlsSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { setSecurityAdviceReadyToShow } from "../../../authentication/fastLogin/store/actions/securityAdviceActions";
import { NotificationModalFlow } from "../../../pushNotifications/analytics";
import {
  trackSendActivationAccepted,
  trackSendActivationDeclined,
  trackSendNurturingDialogClosure
} from "../../analytics/send";
import { setSendEngagementScreenHasBeenDismissed } from "../store/actions";
import { useSendActivationFlow } from "./useSendActivationFlow";
⋮----
label=
⋮----
trackSendActivationAccepted("nurturing_bottomsheet", flow);
requestSendActivation();
</file>

<file path="apps/main-app/ts/features/pn/loginEngagement/sagas/checkShouldDisplaySendEngagementScreen.ts">
import { StackActions } from "@react-navigation/native";
import {
  call,
  cancel,
  FixedTask,
  fork,
  put,
  select,
  take,
  takeEvery
} from "typed-redux-saga/macro";
import { v4 as uuidv4 } from "uuid";
⋮----
import NavigationService from "../../../../navigation/NavigationService";
import {
  isPnRemoteEnabledSelector as isSendRemoteEnabledSelector,
  pnMessagingServiceIdSelector as sendServiceIdSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import { isTestEnv } from "../../../../utils/environment";
import { setSecurityAdviceReadyToShow } from "../../../authentication/fastLogin/store/actions/securityAdviceActions";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
import { loadServicePreference } from "../../../services/details/store/actions/preference";
import PN_ROUTES from "../../navigation/routes";
import { isPnServiceEnabled as isSendServiceEnabledSelector } from "../../reminderBanner/reducer/bannerDismiss";
import { hasSendEngagementScreenBeenDismissedSelector } from "../store/reducers";
</file>

<file path="apps/main-app/ts/features/pn/loginEngagement/screens/SendActivationErrorScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIODispatch } from "../../../../store/hooks";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { setSecurityAdviceReadyToShow } from "../../../authentication/fastLogin/store/actions/securityAdviceActions";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
import PN_ROUTES from "../../navigation/routes";
</file>

<file path="apps/main-app/ts/features/pn/loginEngagement/screens/SendEngagementOnFirstAppOpenScreen.tsx">
import { Body } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import { getTxtNodeKey } from "../../../../components/IOMarkdown/renderRules";
import { IOMarkdownRenderRules } from "../../../../components/IOMarkdown/types";
import { WhatsNewScreenContent } from "../../../../components/screens/WhatsNewScreenContent";
import { useAvoidHardwareBackButton } from "../../../../utils/useAvoidHardwareBackButton";
import { NotificationModalFlow } from "../../../pushNotifications/analytics";
import {
  trackSendAcceptanceDialog,
  trackSendActivationModalDialog,
  trackSendActivationModalDialogActivationDismissed,
  trackSendActivationModalDialogActivationStart,
  trackSendNurturingDialog
} from "../../analytics/send";
import { useSendActivationBottomSheet } from "../hooks/useSendActivationBottomSheet";
import { useSendAreYouSureBottomSheet } from "../hooks/useSendAreYouSureBottomSheet";
⋮----
<Body key=
⋮----
export const SendEngagementOnFirstAppOpenScreen = () =>
⋮----
const trackAndPresentActivationBottomSheet = () =>
⋮----
const trackAndPresentAreYouSureBottomSheet = () =>
</file>

<file path="apps/main-app/ts/features/pn/loginEngagement/store/actions/index.ts">
import { ActionType, createAction } from "typesafe-actions";
⋮----
export type SENDLoginEngagementActions = ActionType<
  typeof setSendEngagementScreenHasBeenDismissed
>;
</file>

<file path="apps/main-app/ts/features/pn/loginEngagement/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  persistReducer
} from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { GlobalState } from "../../../../../store/reducers/types";
import { isDevEnv, isTestEnv } from "../../../../../utils/environment";
import { setSendEngagementScreenHasBeenDismissed } from "../actions";
⋮----
export type SENDLoginEngagementState = {
  hasSendEngagementScreenBeenDismissed: boolean;
};
⋮----
const sendLoginEngagementReducer = (
  state = SEND_LOGIN_ENGAGEMENT_INITIAL_STATE,
  action: Action
): SENDLoginEngagementState =>
⋮----
export const hasSendEngagementScreenBeenDismissedSelector = (
  state: GlobalState
)
</file>

<file path="apps/main-app/ts/features/pn/lollipopLambda/api/index.ts">
import { createClient } from "@io-app/api-types/generated/definitions/pn/lollipop-lambda/client";
import { v4 as uuid } from "uuid";
⋮----
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { lollipopFetch } from "../../../lollipop/utils/fetch";
⋮----
export const createSendLollipopLambdaClient = (
  baseUrl: string,
  sessionToken: string,
  keyInfo: KeyInfo
)
⋮----
export type SendLollipopLambdaClient = ReturnType<
  typeof createSendLollipopLambdaClient
>;
</file>

<file path="apps/main-app/ts/features/pn/lollipopLambda/saga/index.ts">
import { readableReportSimplified } from "@pagopa/ts-commons/lib/reporters";
import { Either, isLeft, left, right } from "fp-ts/lib/Either";
import {
  call,
  put,
  race,
  select,
  take,
  takeLatest
} from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { apiUrlPrefix } from "../../../../config";
import { isPnTestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { SagaCallReturnType } from "../../../../types/utils";
import { isTestEnv } from "../../../../utils/environment";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { unknownToReason } from "../../../messages/utils";
import {
  createSendLollipopLambdaClient,
  SendLollipopLambdaClient
} from "../api";
import { sendLollipopLambdaAction } from "../store/actions";
⋮----
const buildLambdaLollipopRequest = (
  httpVerb: "Get" | "Post",
  client: SendLollipopLambdaClient,
  useSendUATEnvironment: boolean,
  requestBody: string | undefined
): Either<
  string,
  ReturnType<typeof client.testLollipopPost | typeof client.testLollipopPost>
> => {
if (httpVerb === "Post")
⋮----
const bodyStringToObject = (
  input: string | undefined
): Either<string, object> =>
</file>

<file path="apps/main-app/ts/features/pn/lollipopLambda/store/actions/index.ts">
import { ErrorResponse } from "@io-app/api-types/generated/definitions/pn/lollipop-lambda/ErrorResponse";
import { SuccessResponse } from "@io-app/api-types/generated/definitions/pn/lollipop-lambda/SuccessResponse";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
type SENDLollipopLambdaActionFailure = {
  reason: string;
  type: "failure" | "invalidInput";
};
type SENDLollipopLambdaActionRequest = {
  body: string;
  httpVerb: "Get" | "Post";
};
type SENDLollipopLambdaActionSuccess = {
  responseBody: ErrorResponse | SuccessResponse | undefined;
  statusCode: number;
};
⋮----
export type SENDLollipopLambdaActions = ActionType<
  typeof sendLollipopLambdaAction
>;
</file>

<file path="apps/main-app/ts/features/pn/lollipopLambda/store/reducers/index.ts">
import { ErrorResponse } from "@io-app/api-types/generated/definitions/pn/lollipop-lambda/ErrorResponse";
import { SuccessResponse } from "@io-app/api-types/generated/definitions/pn/lollipop-lambda/SuccessResponse";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { sendLollipopLambdaAction } from "../actions";
⋮----
export type SENDLollipopLambdaState =
  | SENDLollipopLambdaFailure
  | SENDLollipopLambdaIdle
  | SENDLollipopLambdaLoading
  | SENDLollipopLambdaResponseReceived;
type SENDLollipopLambdaFailure = {
  reason: string;
  type: "failure" | "invalidInput";
};
type SENDLollipopLambdaIdle = {
  type: "idle";
};
type SENDLollipopLambdaLoading = {
  body: string;
  httpVerb: "Get" | "Post";
  type: "loading";
};
type SENDLollipopLambdaResponseReceived = {
  responseBody: ErrorResponse | SuccessResponse | undefined;
  statusCode: number;
  type: "responseReceived";
};
⋮----
export const lollipopLambdaReducer = (
  state: SENDLollipopLambdaState = INITIAL_LOLLIPOP_LAMBDA_STATE,
  action: Action
): SENDLollipopLambdaState =>
</file>

<file path="apps/main-app/ts/features/pn/lollipopLambda/store/selectors/index.ts">
import { GlobalState } from "../../../../../store/reducers/types";
import { unknownToReason } from "../../../../messages/utils";
⋮----
export const isSendLollipopLambdaLoading = (state: GlobalState): boolean
⋮----
export const sendLollipopLambdaErrorReason = (
  state: GlobalState
): string | undefined =>
⋮----
export const sendLollipopLambdaResponseStatusCode = (
  state: GlobalState
): number | undefined
⋮----
export const sendLollipopLambdaResponseBodyString = (
  state: GlobalState
): string | undefined =>
</file>

<file path="apps/main-app/ts/features/pn/navigation/navigator.tsx">
import {
  createStackNavigator,
  StackNavigationOptions
} from "@react-navigation/stack";
import _ from "lodash";
⋮----
import { SendAarActivateNfcScreen } from "../aar/screen/SendAarActivateNfcScreen";
import { SendAarCanEducationalScreen } from "../aar/screen/SendAarCanEducationalScreen";
import { SendAarCieCanInsertionScreen } from "../aar/screen/SendAarCieCanInsertionScreen";
import { SendAarCieCardReadingEducationalScreen } from "../aar/screen/SendAarCieCardReadingEducationalScreen";
import { SendAarCieCardReadingScreen } from "../aar/screen/SendAarCieCardReadingScreen";
import { SendAarDelegationProposalScreen } from "../aar/screen/SendAarDelegationProposalScreen";
import { SendAarErrorScreen } from "../aar/screen/SendAarErrorScreen";
import { SendEngagementScreen } from "../aar/screen/SendEngagementScreen";
import { SendQRScanFlowScreen } from "../aar/screen/SendQRScanFlowScreen";
import { SendActivationErrorScreen } from "../loginEngagement/screens/SendActivationErrorScreen";
import { SendEngagementOnFirstAppOpenScreen } from "../loginEngagement/screens/SendEngagementOnFirstAppOpenScreen";
import { PNActivationBannerFlowScreen } from "../reminderBanner/screens/PnReminderBannerFlow";
import { MessageAttachmentScreen } from "../screens/MessageAttachmentScreen";
import { MessageDetailsScreen } from "../screens/MessageDetailsScreen";
import { PaidPaymentScreen } from "../screens/PaidPaymentScreen";
import { PnParamsList } from "./params";
import PN_ROUTES from "./routes";
⋮----
export const PnStackNavigator = () => (
  <Stack.Navigator
    initialRouteName={PN_ROUTES.MESSAGE_DETAILS}
    screenOptions={{
      gestureEnabled: false
    }}
  >
    <Stack.Group>
      <Stack.Screen
        component={MessageDetailsScreen}
        name={PN_ROUTES.MESSAGE_DETAILS}
      />
      <Stack.Screen
        component={MessageAttachmentScreen}
        name={PN_ROUTES.MESSAGE_ATTACHMENT}
      />
      <Stack.Screen
        component={PaidPaymentScreen}
        name={PN_ROUTES.CANCELLED_MESSAGE_PAID_PAYMENT}
      />
      <Stack.Screen
        component={PNActivationBannerFlowScreen}
        name={PN_ROUTES.ACTIVATION_BANNER_FLOW}
        options={hiddenHeader}
      />
      <Stack.Screen
        component={SendEngagementScreen}
        name={PN_ROUTES.ENGAGEMENT_SCREEN}
      />
      <Stack.Screen
        component={SendEngagementOnFirstAppOpenScreen}
        name={PN_ROUTES.SEND_ENGAGEMENT_ON_FIRST_APP_OPENING}
        options={hiddenHeader}
      />
      <Stack.Screen
        component={SendActivationErrorScreen}
        name={PN_ROUTES.SEND_ENGAGEMENT_ACTIVATION_ERROR}
        options={hiddenHeader}
      />
    </Stack.Group>
    <Stack.Group
screenOptions=
⋮----
_.get(route, ["params", "animationTypeForReplace"], undefined);
</file>

<file path="apps/main-app/ts/features/pn/navigation/params.ts">
import { StackNavigationOptions } from "@react-navigation/stack";
⋮----
import { SendAarCieCardReadingScreenRouteParams } from "../aar/screen/SendAarCieCardReadingScreen";
import { SendEngagementScreenNavigationParams } from "../aar/screen/SendEngagementScreen";
import { SendQRScanFlowScreenProps } from "../aar/screen/SendQRScanFlowScreen";
import { MessageAttachmentScreenRouteParams } from "../screens/MessageAttachmentScreen";
import { MessageDetailsScreenRouteParams } from "../screens/MessageDetailsScreen";
import { PaidPaymentScreenRouteParams } from "../screens/PaidPaymentScreen";
import PN_ROUTES from "./routes";
⋮----
export type PnParamsList = {
  [PN_ROUTES.ACTIVATION_BANNER_FLOW]: undefined;
  [PN_ROUTES.CANCELLED_MESSAGE_PAID_PAYMENT]: PaidPaymentScreenRouteParams;
  [PN_ROUTES.ENGAGEMENT_SCREEN]: SendEngagementScreenNavigationParams;
  [PN_ROUTES.MESSAGE_ATTACHMENT]: MessageAttachmentScreenRouteParams;
  [PN_ROUTES.MESSAGE_DETAILS]: MessageDetailsScreenRouteParams;
  [PN_ROUTES.QR_SCAN_FLOW]: SendQRScanFlowScreenProps;
  [PN_ROUTES.SEND_AAR_CIE_CAN_EDUCATIONAL]: AnimationParamType;
  [PN_ROUTES.SEND_AAR_CIE_CAN_INSERTION]: AnimationParamType;
  [PN_ROUTES.SEND_AAR_CIE_CARD_READING]: AnimationParamType &
    SendAarCieCardReadingScreenRouteParams;
  [PN_ROUTES.SEND_AAR_CIE_CARD_READING_EDUCATIONAL]: AnimationParamType;
  [PN_ROUTES.SEND_AAR_DELEGATION_PROPOSAL]: undefined;
  [PN_ROUTES.SEND_AAR_ERROR]: undefined;
  [PN_ROUTES.SEND_AAR_NFC_ACTIVATION]: undefined;
  [PN_ROUTES.SEND_ENGAGEMENT_ACTIVATION_ERROR]: undefined;
  [PN_ROUTES.SEND_ENGAGEMENT_ON_FIRST_APP_OPENING]: undefined;
};
type AnimationParamType =
  | Pick<StackNavigationOptions, "animationTypeForReplace">
  | undefined;
</file>

<file path="apps/main-app/ts/features/pn/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/pn/reminderBanner/components/__test__/PNActivationReminderBanner.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { MESSAGES_ROUTES } from "../../../../messages/navigation/routes";
import { renderComponentWithStoreAndNavigationContextForFocus } from "../../../../messages/utils/testUtils";
⋮----
import PN_ROUTES from "../../../navigation/routes";
import { dismissPnActivationReminderBanner } from "../../../store/actions";
import { PNActivationReminderBanner } from "../PNActivationReminderBanner";
⋮----
const renderComponent = (closeHandler: () => void = () => null) =>
</file>

<file path="apps/main-app/ts/features/pn/reminderBanner/components/__test__/PnBannerFlowComponents.test.tsx">
import { fireEvent, RenderAPI } from "@testing-library/react-native";
⋮----
import { createStore } from "redux";
⋮----
import { IOScrollViewActions } from "../../../../../components/ui/IOScrollView";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../../navigation/routes";
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
⋮----
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { openWebUrl } from "../../../../../utils/url";
import { SendFailureReason } from "../../../../messages/utils";
import { sendBannerMixpanelEvents } from "../../../analytics/activationReminderBanner";
import PN_ROUTES from "../../../navigation/routes";
import { PnBannerFlowComponents } from "../PnBannerFlowComponents";
⋮----
const getMockScrollViewActions = (
  onPress = jest.fn()
): IOScrollViewActions => (
⋮----
type LoadingProps = React.ComponentProps<typeof LoadingScreen>;
const renderLoadingScreen = (
  flowState: LoadingProps["loadingState"] = "LOADING-ACTIVATION"
) => renderComponent(<LoadingScreen loadingState=
⋮----
type SuccessProps = React.ComponentProps<typeof SuccessScreen>;
const renderSuccessScreen = (
  flowState: SuccessProps["flowState"] = "ALREADY_ACTIVE"
) => renderComponent(<SuccessScreen flowState=
⋮----
type ErrorProps = React.ComponentProps<typeof ErrorScreen>;
const renderErrorScreen = (
  flowState: ErrorProps["flowState"] = "FAILURE_ACTIVATION"
) => renderComponent(<ErrorScreen flowState=
⋮----
const renderCtaScreen = ()
⋮----
renderComponent(<CtaScreen scrollViewAction=
⋮----
const globalState = appReducer(undefined, applicationChangeState("active"));
⋮----
const store = createStore(appReducer, globalState as any);
return renderScreenWithNavigationStoreContext(
    () => Component,
    PN_ROUTES.ACTIVATION_BANNER_FLOW,
    {},
    store
  );
</file>

<file path="apps/main-app/ts/features/pn/reminderBanner/components/PNActivationReminderBanner.tsx">
import { Banner, IODimensions } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useRef } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
import { sendBannerMixpanelEvents } from "../../analytics/activationReminderBanner";
import PN_ROUTES from "../../navigation/routes";
import { dismissPnActivationReminderBanner } from "../../store/actions";
⋮----
type Props = {
  handleOnClose: () => void;
};
⋮----
export const PNActivationReminderBanner = (
⋮----
const navigateToActivationFlow = () =>
</file>

<file path="apps/main-app/ts/features/pn/reminderBanner/components/PnBannerFlowComponents.tsx">
import { Body, ContentWrapper, H2, H6, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { Dimensions, Image, View } from "react-native";
⋮----
import landingHeroImage from "../../../../../img/features/pn/activationLandingHero.png";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import {
  IOScrollView,
  IOScrollViewActions
} from "../../../../components/ui/IOScrollView";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIOSelector } from "../../../../store/hooks";
import { pnPrivacyUrlsSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { openWebUrl } from "../../../../utils/url";
import LoadingComponent from "../../../fci/components/LoadingComponent";
import { SendFailureReason } from "../../../messages/utils";
import { sendBannerMixpanelEvents } from "../../analytics/activationReminderBanner";
import {
  pnBannerFlowStateEnum,
  PnBannerFlowStateKey
} from "../screens/PnReminderBannerFlow";
⋮----
export type ErrorFlowStateKeys =
  | "MISSING-SID"
  | Extract<
      PnBannerFlowStateKey,
      "FAILURE_ACTIVATION" | "FAILURE_DETAILS_FETCH"
    >;
type ErrorFlowStateProps = {
  flowState: ErrorFlowStateKeys;
  reason?: SendFailureReason;
};
⋮----
type LoadingStateProps = {
  loadingState: "LOADING-ACTIVATION" | "LOADING-DATA";
};
type ResultCopy = { body: string; title: string };
type SuccessFlowStateKeys = Extract<
  PnBannerFlowStateKey,
  "ALREADY_ACTIVE" | "SUCCESS_ACTIVATION"
>;
⋮----
type SuccessFlowStateProps = { flowState: SuccessFlowStateKeys };
⋮----
const getLoadingTitle = (
  loadingState: LoadingStateProps["loadingState"]
): string =>
⋮----
const getSuccessCopy = (flowState: SuccessFlowStateKeys): ResultCopy =>
⋮----
const getErrorCopy = (flowState: ErrorFlowStateKeys): ResultCopy =>
⋮----
captionTitle=
⋮----
onPress=
⋮----
<Body asLink=
</file>

<file path="apps/main-app/ts/features/pn/reminderBanner/reducer/__test__/bannerDismiss.test.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { createStore } from "redux";
import { PersistedState, PersistPartial } from "redux-persist";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { differentProfileLoggedIn } from "../../../../../store/actions/crossSessions";
import { GlobalState } from "../../../../../store/reducers/types";
import {
  loginSuccess,
  logoutSuccess
} from "../../../../authentication/common/store/actions";
import { ServicesState } from "../../../../services/common/store/reducers";
import { dismissPnActivationReminderBanner } from "../../../store/actions";
⋮----
type PnBannerDismissState = bannerDismiss.PnBannerDismissState & PersistPartial;
⋮----
const servicePreferencesGenerator = (inbox: boolean) => (
</file>

<file path="apps/main-app/ts/features/pn/reminderBanner/reducer/bannerDismiss.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  persistReducer
} from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { differentProfileLoggedIn } from "../../../../store/actions/crossSessions";
import { Action } from "../../../../store/actions/types";
import {
  isPnRemoteEnabledSelector,
  pnMessagingServiceIdSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../store/reducers/types";
import { isDevEnv, isTestEnv } from "../../../../utils/environment";
import { servicePreferenceByChannelPotSelector } from "../../../services/details/store/selectors";
import { dismissPnActivationReminderBanner } from "../../store/actions";
⋮----
export type PnBannerDismissState = {
  dismissed: boolean;
};
⋮----
const pnBannerDismissReducer = (
  state: PnBannerDismissState = INITIAL_STATE,
  action: Action
) =>
⋮----
export const isPnServiceEnabled = (state: GlobalState) =>
export const isPnActivationReminderBannerRenderableSelector = (
  state: GlobalState
) =>
</file>

<file path="apps/main-app/ts/features/pn/reminderBanner/screens/__test__/PnReminderBannerFlow.test.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { applyMiddleware, createStore } from "redux";
import createSagaMiddleware from "redux-saga";
import { put, takeLatest } from "typed-redux-saga";
import { ActionType } from "typesafe-actions";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
⋮----
import { appReducer } from "../../../../../store/reducers";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
⋮----
import PN_ROUTES from "../../../navigation/routes";
import { pnActivationUpsert } from "../../../store/actions";
⋮----
import {
  PNActivationBannerFlowScreen,
  pnBannerFlowStateEnum
} from "../PnReminderBannerFlow";
⋮----
const renderComponent = (sagaSuccess = true) =>
</file>

<file path="apps/main-app/ts/features/pn/reminderBanner/screens/PnReminderBannerFlow.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { HeaderSecondLevel } from "@io-app/design-system";
import I18n from "i18next";
import { useState } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { pnMessagingServiceIdSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { SendFailureReason } from "../../../messages/utils";
import { sendBannerMixpanelEvents } from "../../analytics/activationReminderBanner";
import { usePnPreferencesFetcher } from "../../hooks/usePnPreferencesFetcher";
import { pnActivationUpsert } from "../../store/actions";
import { isLoadingPnActivationSelector } from "../../store/reducers/activation";
import { PnBannerFlowComponents } from "../components/PnBannerFlowComponents";
⋮----
type FlowEnumT = typeof pnBannerFlowStateEnum;
⋮----
export type PnBannerFlowStateKey = FlowEnumT[keyof FlowEnumT];
export const PNActivationBannerFlowScreen = () =>
⋮----
const PNFlowScreenPicker = (
⋮----
type FlowScreenProps = {
  setActivationFailureReason: (reason: SendFailureReason | undefined) => void;
  setFlowState: (state: PnBannerFlowStateKey) => void;
};
⋮----
const enablePN = () =>
</file>

<file path="apps/main-app/ts/features/pn/screens/__test__/MessageDetailsScreen.test.tsx">
import { act, fireEvent } from "@testing-library/react-native";
⋮----
import { Action, Store } from "redux";
import configureMockStore from "redux-mock-store";
import { getType } from "typesafe-actions";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { GlobalState } from "../../../../store/reducers/types";
import { reproduceSequence } from "../../../../utils/tests";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import { message_1 } from "../../../messages/__mocks__/message";
import { service_1 } from "../../../messages/__mocks__/messages";
import {
  loadMessageById,
  loadMessageDetails,
  loadThirdPartyMessage
} from "../../../messages/store/actions";
import {
  toUIMessage,
  toUIMessageDetails
} from "../../../messages/store/reducers/transformers";
import { ATTACHMENT_CATEGORY } from "../../../messages/types/attachmentCategory";
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
import { loadServiceDetail } from "../../../services/details/store/actions/details";
⋮----
import { thirdPartyMessage } from "../../__mocks__/pnMessage";
⋮----
import { terminateAarFlow } from "../../aar/store/actions";
import { sendAarFlowStates } from "../../aar/utils/stateUtils";
import { sendAarMockStateFactory } from "../../aar/utils/testUtils";
⋮----
import PN_ROUTES from "../../navigation/routes";
import { startPNPaymentStatusTracking } from "../../store/actions";
⋮----
import { PNMessage } from "../../store/types/types";
import { MessageDetailsScreen } from "../MessageDetailsScreen";
⋮----
const getMockCurriedSelector = (response: PNMessage | undefined)
⋮----
const renderComponent = (
  store: Store<GlobalState>,
  firstTimeOpening: boolean,
  sendOpeningSource: SendOpeningSource,
  sendUserType: SendUserType
) =>
</file>

<file path="apps/main-app/ts/features/pn/screens/__test__/PaidPaymentScreen.test.tsx">
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { GlobalState } from "../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import PN_ROUTES from "../../navigation/routes";
import { PaidPaymentScreen } from "../PaidPaymentScreen";
⋮----
const renderScreen = () =>
</file>

<file path="apps/main-app/ts/features/pn/screens/MessageAttachmentScreen.tsx">
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../navigation/params/AppParamsList";
import { MessageAttachment } from "../../messages/components/MessageAttachment/MessageAttachment";
import { PnParamsList } from "../navigation/params";
⋮----
export type MessageAttachmentScreenRouteParams = Readonly<{
  attachmentId: string;
  messageId: string;
}>;
⋮----
type MessageAttachmentScreenProps = IOStackNavigationRouteProps<
  PnParamsList,
  "PN_ROUTES_MESSAGE_ATTACHMENT"
>;
⋮----
export const MessageAttachmentScreen = (
  props: MessageAttachmentScreenProps
) =>
</file>

<file path="apps/main-app/ts/features/pn/screens/MessageDetailsScreen.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { HeaderSecondLevel } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { RefObject, useCallback, useEffect, useMemo, useRef } from "react";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useHardwareBackButtonWhenFocused } from "../../../hooks/useHardwareBackButton";
import { useOfflineToastGuard } from "../../../hooks/useOfflineToastGuard";
import { useStartSupportRequest } from "../../../hooks/useStartSupportRequest";
import {
  IOStackNavigationRouteProps,
  useIONavigation
} from "../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector, useIOStore } from "../../../store/hooks";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import {
  cancelPreviousAttachmentDownload,
  cancelQueuedPaymentUpdates,
  updatePaymentForMessage
} from "../../messages/store/actions";
import {
  SendOpeningSource,
  SendUserType
} from "../../pushNotifications/analytics";
import { profileFiscalCodeSelector } from "../../settings/common/store/selectors";
import {
  trackSendAarFailure,
  trackSendAarNotificationClosure
} from "../aar/analytics";
import { SendAarMessageDetailBottomSheetComponent } from "../aar/components/SendAarMessageDetailBottomSheetComponent";
import { terminateAarFlow } from "../aar/store/actions";
import { sendAarFlowStates } from "../aar/utils/stateUtils";
import { trackPNUxSuccess } from "../analytics";
import { MessageDetails } from "../components/MessageDetails";
import { PnParamsList } from "../navigation/params";
import {
  cancelPNPaymentStatusTracking,
  startPNPaymentStatusTracking
} from "../store/actions";
import {
  curriedSendMessageFromIdSelector,
  sendUserSelectedPaymentRptIdSelector
} from "../store/reducers";
import {
  doesSENDMessageIncludeF24,
  isSENDMessageCancelled,
  openingSourceIsAarMessage,
  paymentsFromSendMessage
} from "../utils";
⋮----
export type MessageDetailsScreenRouteParams = {
  firstTimeOpening: boolean | undefined;
  messageId: string;
  serviceId: ServiceId;
} & (
  | {
      sendOpeningSource: Extract<SendOpeningSource, "aar">;
      sendUserType: Extract<SendUserType, "mandatory" | "recipient">;
    }
  | {
      sendOpeningSource: Extract<SendOpeningSource, "message">;
      sendUserType: Extract<SendUserType, "not_set">;
    }
);
⋮----
type MessageDetailsRouteProps = IOStackNavigationRouteProps<
  PnParamsList,
  "PN_ROUTES_MESSAGE_DETAILS"
>;
⋮----
const useCorrectHeader = (
  isAAr: boolean,
  aarBottomSheetRef: RefObject<(() => void) | undefined>,
  userType: SendUserType
) =>
⋮----
export const MessageDetailsScreen = (
</file>

<file path="apps/main-app/ts/features/pn/screens/PaidPaymentScreen.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import {
  IOStackNavigationRouteProps,
  useIONavigation
} from "../../../navigation/params/AppParamsList";
import { PnParamsList } from "../navigation/params";
⋮----
export type PaidPaymentScreenRouteParams = {
  creditorTaxId?: string;
  noticeCode: string;
};
⋮----
type PaidPaymentScreenProps = IOStackNavigationRouteProps<
  PnParamsList,
  "PN_CANCELLED_MESSAGE_PAID_PAYMENT"
>;
</file>

<file path="apps/main-app/ts/features/pn/store/actions/index.ts">
import {
  ActionType,
  createAction,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { SendFailureReason } from "../../../messages/utils";
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
⋮----
type CancelPnPaymentStatusTracking = {
  messageId: string;
};
⋮----
type PNPaymentStatusTracking = {
  messageId: string;
  openingSource: SendOpeningSource;
  userType: SendUserType;
};
type TogglePnActivationRequestPaylad = {
  onFailure?: (isRateLimitError?: boolean, reason?: SendFailureReason) => void;
  onSuccess?: () => void;
  value: boolean;
};
⋮----
export type PnActions =
  | ActionType<typeof cancelPNPaymentStatusTracking>
  | ActionType<typeof dismissPnActivationReminderBanner>
  | ActionType<typeof pnActivationUpsert>
  | ActionType<typeof startPNPaymentStatusTracking>;
</file>

<file path="apps/main-app/ts/features/pn/store/reducers/__test__/activation.test.ts">
import { applicationChangeState } from "../../../../../store/actions/application";
import { GlobalState } from "../../../../../store/reducers/types";
import { pnActivationUpsert } from "../../actions";
import {
  isLoadingPnActivationSelector,
  pnActivationReducer,
  PnActivationState
} from "../activation";
</file>

<file path="apps/main-app/ts/features/pn/store/reducers/__test__/index.test.ts">
import {
  curriedSendMessageFromIdSelector,
  pnReducer,
  sendUserSelectedPaymentRptIdSelector
} from "..";
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { GlobalState } from "../../../../../store/reducers/types";
import { PNMessage } from "../../types/types";
</file>

<file path="apps/main-app/ts/features/pn/store/reducers/__test__/payments.test.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { Action } from "../../../../../store/actions/types";
import { appReducer } from "../../../../../store/reducers";
import { GlobalState } from "../../../../../store/reducers/types";
import { reproduceSequence } from "../../../../../utils/tests";
import { updatePaymentForMessage } from "../../../../messages/store/actions";
import { toSpecificMessagePaymentError } from "../../../../messages/types/paymentErrors";
import { paymentsButtonStateSelector } from "../payments";
</file>

<file path="apps/main-app/ts/features/pn/store/reducers/activation.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { pnActivationUpsert } from "../actions";
⋮----
export type PnActivationState = {
  isActivating: boolean;
};
⋮----
export const pnActivationReducer = (
  state: PnActivationState = initialState,
  action: Action
): PnActivationState =>
⋮----
export const isLoadingPnActivationSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/pn/store/reducers/index.ts">
import { combineReducers } from "redux";
import { PersistPartial } from "redux-persist";
import { createSelector } from "reselect";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { isUserSelectedPaymentSelector } from "../../../messages/store/reducers/payments";
import { thirdPartyFromIdSelector } from "../../../messages/store/reducers/thirdPartyById";
import { aarFlowReducer } from "../../aar/store/reducers";
import {
  tempAarMandateReducer,
  TempAarMandateState
} from "../../aar/store/reducers/tempAarMandate";
import { AarFlowState } from "../../aar/utils/stateUtils";
import {
  persistedSendLoginEngagementReducer,
  type SENDLoginEngagementState
} from "../../loginEngagement/store/reducers";
import {
  lollipopLambdaReducer,
  SENDLollipopLambdaState
} from "../../lollipopLambda/store/reducers";
import {
  persistedPnBannerDismissReducer,
  PnBannerDismissState
} from "../../reminderBanner/reducer/bannerDismiss";
import { getRptIdStringFromPayment } from "../../utils/rptId";
import { toSENDMessage } from "../types/transformers";
import { PNMessage } from "../types/types";
import { pnActivationReducer, PnActivationState } from "./activation";
⋮----
export type PnState = {
  aarFlow: AarFlowState;
  activation: PnActivationState;
  bannerDismiss: PersistPartial & PnBannerDismissState;
  loginEngagement: PersistPartial & SENDLoginEngagementState;
  lollipopLambda: SENDLollipopLambdaState;
  tempAarMandate: TempAarMandateState;
};
⋮----
export const curriedSendMessageFromIdSelector = (messageId: string)
⋮----
export const sendUserSelectedPaymentRptIdSelector = (
  state: GlobalState,
  sendMessage: PNMessage | undefined
) =>
</file>

<file path="apps/main-app/ts/features/pn/store/reducers/payments.ts">
import { PaymentInfoResponse } from "@io-app/api-types/generated/definitions/communication/PaymentInfoResponse";
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import {
  isError,
  isReady,
  RemoteValue
} from "../../../../common/model/RemoteValue";
import { GlobalState } from "../../../../store/reducers/types";
import { SinglePaymentState } from "../../../messages/store/reducers/payments";
import { MessagePaymentError } from "../../../messages/types/paymentErrors";
import { getRptIdStringFromPayment } from "../../../pn/utils/rptId";
⋮----
export const paymentsButtonStateSelector = (
  state: GlobalState,
  messageId: string,
  payments: ReadonlyArray<NotificationPaymentInfo> | undefined,
  maxVisiblePaymentCount: number
)
⋮----
const computeUpdatedPaymentCount =
  (
    payments: ReadonlyArray<NotificationPaymentInfo> | undefined,
    maxVisiblePaymentCount: number
)
⋮----
type PaymentStatistics = {
  errorPaymentCount: number;
  updatedPaymentCount: number;
};
⋮----
const initialPaymentStatistics: () => PaymentStatistics = () => (
⋮----
const updatedPaymentStatistics = (previousStatistics: PaymentStatistics) => (
const errorPaymentStatistics = (previousStatistics: PaymentStatistics) => (
⋮----
const computePaymentStatistics =
(previousStatistics: PaymentStatistics)
⋮----
const buttonStateFromUpdatedPaymentCount =
  (
    payments: ReadonlyArray<NotificationPaymentInfo> | undefined,
    maxVisiblePaymentCount: number
)
</file>

<file path="apps/main-app/ts/features/pn/store/sagas/watchPaymentStatusSaga.ts">
import { call, delay, race, select, take } from "typed-redux-saga/macro";
import { ActionType, isActionOf } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { isTestEnv } from "../../../../utils/environment";
import { paymentStatisticsForMessageUncachedSelector } from "../../../messages/store/reducers/payments";
import {
  SendOpeningSource,
  SendUserType
} from "../../../pushNotifications/analytics";
import { profileFiscalCodeSelector } from "../../../settings/common/store/selectors";
import { trackPNPaymentStatus } from "../../analytics";
import { maxVisiblePaymentCount, paymentsFromSendMessage } from "../../utils";
import { getRptIdStringFromPayment } from "../../utils/rptId";
import {
  cancelPNPaymentStatusTracking,
  startPNPaymentStatusTracking
} from "../actions";
import { curriedSendMessageFromIdSelector } from "../reducers";
</file>

<file path="apps/main-app/ts/features/pn/store/sagas/watchPnSaga.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { SagaIterator } from "redux-saga";
import { all, call, put, select, takeLatest } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { apiUrlPrefix } from "../../../../config";
import { pnMessagingServiceIdSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isPnTestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { isTestEnv } from "../../../../utils/environment";
import {
  decodeSendFailureReason,
  SendFailureReason,
  unknownToReason,
  WrappedSendError
} from "../../../messages/utils";
import { loadServicePreference } from "../../../services/details/store/actions/preference";
import { servicePreferencePotByIdSelector } from "../../../services/details/store/selectors";
import { isServicePreferenceResponseSuccess } from "../../../services/details/types/ServicePreferenceResponse";
import {
  trackPNServiceStatusChangeError,
  trackPNServiceStatusChangeSuccess
} from "../../analytics";
import { createPnClient, PnClient } from "../../api/client";
import { pnActivationUpsert, startPNPaymentStatusTracking } from "../actions";
import { watchPaymentStatusForMixpanelTracking } from "./watchPaymentStatusSaga";
</file>

<file path="apps/main-app/ts/features/pn/store/types/__test__/transformers.test.ts">
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
⋮----
import { toSENDMessage } from "../transformers";
</file>

<file path="apps/main-app/ts/features/pn/store/types/__test__/types.test.ts">
import { IOReceivedNotification } from "@io-app/api-types/generated/definitions/pn/IOReceivedNotification";
</file>

<file path="apps/main-app/ts/features/pn/store/types/transformers.ts">
import { ThirdPartyMessageWithContent } from "@io-app/api-types/generated/definitions/communication/ThirdPartyMessageWithContent";
import { ThirdPartyMessage } from "@io-app/api-types/generated/definitions/pn/ThirdPartyMessage";
import { isLeft } from "fp-ts/lib/Either";
⋮----
import { PNMessage } from "./types";
⋮----
export const toSENDMessage = (
  messageFromApi: ThirdPartyMessageWithContent
): PNMessage | undefined =>
</file>

<file path="apps/main-app/ts/features/pn/store/types/types.ts">
import { ThirdPartyAttachment } from "@io-app/api-types/generated/definitions/communication/ThirdPartyAttachment";
import { IOReceivedNotification } from "@io-app/api-types/generated/definitions/pn/IOReceivedNotification";
⋮----
export type PNMessage = IOReceivedNotification & {
  attachments?: ReadonlyArray<ThirdPartyAttachment>;
  created_at: Date;
};
</file>

<file path="apps/main-app/ts/features/pn/utils/index.ts">
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
import { NotificationStatus } from "@io-app/api-types/generated/definitions/pn/NotificationStatus";
import { NotificationStatusHistoryElement } from "@io-app/api-types/generated/definitions/pn/NotificationStatusHistoryElement";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { identity, pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
import { GlobalState } from "../../../store/reducers/types";
import { CTAS } from "../../../types/LocalizedCTAs";
import { format } from "../../../utils/dates.ts";
import { isServiceDetailNavigationLink } from "../../../utils/internalLink";
import { ATTACHMENT_CATEGORY } from "../../messages/types/attachmentCategory";
import { SendOpeningSource } from "../../pushNotifications/analytics";
import { TimelineStatus } from "../components/Timeline";
import { PNMessage } from "../store/types/types";
⋮----
export const getNotificationStatusInfo = (
  status: NotificationStatus
): string =>
⋮----
export const getNotificationStatusAccessibilityLabel = (
  historyItem: NotificationStatusHistoryElement
)
⋮----
export const notificationStatusToTimelineStatus = (
  status: NotificationStatus
): TimelineStatus =>
⋮----
export type PNOptInMessageInfo = {
  cta1LinksToPNService: boolean;
  cta2LinksToPNService: boolean;
  isPNOptInMessage: boolean;
};
⋮----
export const extractPNOptInMessageInfoIfAvailable = (
  ctasOpt: CTAS | undefined,
  serviceIdOpt: ServiceId | undefined,
  state: GlobalState
)
⋮----
export const paymentsFromSendMessage = (
  userFiscalCode: string | undefined,
  sendMessage: PNMessage | undefined
): ReadonlyArray<NotificationPaymentInfo> | undefined =>
⋮----
export const isSENDMessageCancelled = (sendMessage: PNMessage | undefined)
⋮----
export const doesSENDMessageIncludeF24 = (sendMessage: PNMessage | undefined)
⋮----
export const canShowMorePaymentsLink = (
  isCancelled: boolean,
  payments?: ReadonlyArray<NotificationPaymentInfo>
): payments is ReadonlyArray<NotificationPaymentInfo>
⋮----
export const shouldUseBottomSheetForPayments = (
  isCancelled: boolean,
  payments?: ReadonlyArray<NotificationPaymentInfo>
): payments is ReadonlyArray<NotificationPaymentInfo>
⋮----
export const openingSourceIsAarMessage = (openingSource: SendOpeningSource)
</file>

<file path="apps/main-app/ts/features/pn/utils/rptId.ts">
import { NotificationPaymentInfo } from "@io-app/api-types/generated/definitions/pn/NotificationPaymentInfo";
⋮----
export const getRptIdStringFromPayment = (
  payment: NotificationPaymentInfo
): string => `$
</file>

<file path="apps/main-app/ts/features/profileSettings/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import _ from "lodash";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistPartial,
  persistReducer
} from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { differentProfileLoggedIn } from "../../../../store/actions/crossSessions";
import { Action } from "../../../../store/actions/types";
import { isDevEnv } from "../../../../utils/environment";
⋮----
export type ProfileSettingsState = {};
⋮----
const profileSettingsReducer = (
  state: ProfileSettingsState = profileSettingsReducerInitialState,
  action: Action
): ProfileSettingsState =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/analytics/index.ts">
import { PushNotificationsContentTypeEnum } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatusEnum } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
⋮----
import {
  enqueueMixpanelEvent,
  isMixpanelInstanceInitialized,
  mixpanelTrack
} from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
⋮----
export type NotificationModalFlow =
  | "access"
  | "authentication"
  | "send_notification_opening";
export type SendOpeningSource = "aar" | "message" | "not_set";
export type SendUserType = "mandatory" | "not_set" | "recipient";
⋮----
export const trackNotificationInstallationTokenNotChanged = ()
⋮----
export const trackNotificationsOptInPreviewStatus = (
  contentType: PushNotificationsContentTypeEnum
)
⋮----
export const trackNotificationsOptInReminderStatus = (
  reminderStatus: ReminderStatusEnum
)
⋮----
export const trackNotificationsOptInReminderOnPermissionsOff = ()
⋮----
export const trackNotificationsOptInOpenSettings = ()
⋮----
export const trackNotificationsOptInSkipSystemPermissions = ()
⋮----
export const trackNewPushNotificationsTokenGenerated = (
  id: string,
  userOptedIn: boolean
) =>
⋮----
export const trackPushNotificationTokenUploadSucceeded = ()
⋮----
export const trackPushNotificationTokenUploadFailure = (reason: string)
⋮----
export const trackSystemNotificationPermissionScreenShown = (
  flow: NotificationModalFlow,
  sendOpeningSource: SendOpeningSource = "not_set",
  sendUser: SendUserType = "not_set"
) =>
⋮----
export const trackSystemNotificationPermissionScreenOutcome = (
  outcome: "activate" | "dismiss",
  flow: NotificationModalFlow,
  sendOpeningSource: SendOpeningSource = "not_set",
  sendUser: SendUserType = "not_set"
) =>
⋮----
export const trackNotificationPermissionsStatus = (
  systemNotificationPermissionsEnabled: boolean
) =>
⋮----
export const trackPushNotificationsBannerVisualized = (route: string) =>
⋮----
export const trackPushNotificationsBannerTap = (route: string) =>
⋮----
export const trackPushNotificationsBannerClosure = (route: string) =>
⋮----
export const trackPushNotificationSystemPopupShown = () =>
⋮----
export const trackPushNotificationBannerDismissAlert = () =>
⋮----
export const trackPushNotificationBannerDismissOutcome = (
  outcome: "deactivate" | "remind_later"
) =>
⋮----
export const trackPushNotificationBannerForceShow = () =>
⋮----
export const trackPushNotificationBannerStillHidden = (
  unreadMessagesCount: number
) =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/components/NotificationPreviewSample.tsx">
import {
  BodySmall,
  H6,
  HSpacer,
  Icon,
  IOColors,
  IODimensionScale,
  useIOTheme
} from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
type Props = {
  previewEnabled: boolean;
  remindersEnabled: boolean;
};
⋮----
const computeTitleAndMessage = (
  isPreviewEnabled: boolean,
  areRemindersEnabled: boolean
): Record<"message" | "title", string> =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/components/NotificationsPreferencesPreview.tsx">
import { ImageBackground, StyleSheet } from "react-native";
⋮----
import NotificationWhiteBg from "../../../../img/onboarding/notification_white.png";
import { NotificationPreviewSample } from "./NotificationPreviewSample";
⋮----
type Props = {
  previewEnabled: boolean;
  remindersEnabled: boolean;
};
⋮----
export const NotificationsPreferencesPreview = ({
  previewEnabled,
  remindersEnabled
}: Props) => (
  <ImageBackground
    resizeMode="contain"
    source={NotificationWhiteBg}
    style={styles.container}
  >
    <NotificationPreviewSample
      previewEnabled={previewEnabled}
      remindersEnabled={remindersEnabled}
    />
  </ImageBackground>
);
</file>

<file path="apps/main-app/ts/features/pushNotifications/components/ProfileNotificationsSettings.tsx">
import {
  Banner,
  Divider,
  ListItemSwitch,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { usePreviewMoreInfo } from "../hooks/usePreviewMoreInfo";
import { NotificationsPreferencesPreview } from "./NotificationsPreferencesPreview";
⋮----
type ProfileNotificationSettingsProps = {
  disablePreviewSetting: boolean;
  disableRemindersSetting: boolean;
  isUpdatingPreviewSetting: boolean;
  isUpdatingRemindersSetting: boolean;
  onPreviewValueChanged?: (value: boolean) => void;
  onReminderValueChanged?: (value: boolean) => void;
  previewSwitchValue: boolean;
  remindersSwitchValue: boolean;
  showSettingsPath: boolean;
};
</file>

<file path="apps/main-app/ts/features/pushNotifications/components/PushNotificationsBanner.tsx">
import {
  Banner,
  Body,
  FooterActions,
  IODimensions
} from "@io-app/design-system";
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { useIOBottomSheetModal } from "../../../utils/hooks/bottomSheet";
import {
  trackPushNotificationBannerDismissAlert,
  trackPushNotificationBannerDismissOutcome,
  trackPushNotificationBannerForceShow,
  trackPushNotificationsBannerClosure,
  trackPushNotificationsBannerTap,
  trackPushNotificationsBannerVisualized
} from "../analytics";
import {
  resetNotificationBannerDismissState,
  setPushNotificationBannerForceDismissed,
  setUserDismissedNotificationsBanner
} from "../store/actions/userBehaviour";
import {
  shouldResetNotificationBannerDismissStateSelector,
  timesPushNotificationBannerDismissedSelector
} from "../store/selectors/notificationsBannerDismissed";
import { openSystemNotificationSettingsScreen } from "../utils";
type Props = {
  closeHandler: () => void;
};
⋮----
export const PushNotificationsBanner = (
⋮----
const onClose = () =>
⋮----
const internalRemindLaterHandler = () =>
⋮----
const fullCloseHandler = () =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/hooks/useEngagementScreen.tsx">
import { useEffect } from "react";
⋮----
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../store/hooks";
import { NOTIFICATIONS_ROUTES } from "../navigation/routes";
import { shouldShowEngagementScreenSelector } from "../store/reducers";
⋮----
export const useEngagementScreen = () =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/hooks/usePreviewMoreInfo.tsx">
import { Body } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import {
  IOBottomSheetModal,
  useIOBottomSheetModal
} from "../../../utils/hooks/bottomSheet";
⋮----
export const usePreviewMoreInfo = (): IOBottomSheetModal =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/hooks/usePushNotificationEngagement.tsx">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useState } from "react";
import { AppState, AppStateStatus } from "react-native";
⋮----
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../store/hooks";
import { isTestEnv } from "../../../utils/environment";
import { setSecurityAdviceReadyToShow } from "../../authentication/fastLogin/store/actions/securityAdviceActions";
import {
  NotificationModalFlow,
  SendOpeningSource,
  SendUserType,
  trackSystemNotificationPermissionScreenOutcome
} from "../analytics";
import {
  checkNotificationPermissions,
  openSystemNotificationSettingsScreen
} from "../utils";
⋮----
export const usePushNotificationEngagement = (
  flow: NotificationModalFlow,
  sendOpeningSource: SendOpeningSource,
  sendUserType: SendUserType,
  shouldSetSecurityAdviceUponLeaving: boolean
) =>
⋮----
const onButtonPress = () =>
⋮----
type HandlerType = (
  onReturnToApp: () => void,
  onSuccess: () => void,
  isButtonPressed: boolean
) => (nextAppState: AppStateStatus) => Promise<void>;
⋮----
const appStateHandler: HandlerType =
(onReturnToApp, onSuccess, isButtonPressed) => async nextAppState =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/hooks/usePushNotificationsBannerTracking.tsx">
import { useEffect } from "react";
⋮----
import { useIOSelector, useIOStore } from "../../../store/hooks";
import { trackPushNotificationBannerStillHidden } from "../analytics";
import {
  isForceDismissAndNotUnreadMessagesHiddenSelector,
  unreadMessagesCountAfterForceDismissionSelector
} from "../store/selectors/notificationsBannerDismissed";
⋮----
export const usePushNotificationsBannerTracking = () =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/pushNotifications/sagas/common.ts">
import { call, put, select } from "typed-redux-saga/macro";
⋮----
import NavigationService from "../../../navigation/NavigationService";
import { navigateToMainNavigatorAction } from "../../../store/actions/navigation";
import { resetMessageArchivingAction } from "../../messages/store/actions/archiving";
import { isArchivingDisabledSelector } from "../../messages/store/reducers/archiving";
import { trackNotificationPermissionsStatus } from "../analytics";
import { updateSystemNotificationsEnabled } from "../store/actions/environment";
import { clearNotificationPendingMessage } from "../store/actions/pendingMessage";
import { areNotificationPermissionsEnabledSelector } from "../store/reducers/environment";
import { pendingMessageStateSelector } from "../store/reducers/pendingMessage";
import { checkNotificationPermissions } from "../utils";
import { navigateToMessageRouterAction } from "../utils/navigation";
</file>

<file path="apps/main-app/ts/features/pushNotifications/sagas/notificationPermissionsListener.ts">
import { call, takeLatest } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { applicationChangeState } from "../../../store/actions/application";
import { checkAndUpdateNotificationPermissionsIfNeeded } from "./common";
</file>

<file path="apps/main-app/ts/features/pushNotifications/sagas/profileAndSystemNotificationsPermissions.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { CommonActions, StackActions } from "@react-navigation/native";
import { call, put, select, take } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { updateMixpanelProfileProperties } from "../../../mixpanelConfig/profileProperties";
import { updateMixpanelSuperProperties } from "../../../mixpanelConfig/superProperties";
import NavigationService from "../../../navigation/NavigationService";
import ROUTES from "../../../navigation/routes";
import { GlobalState } from "../../../store/reducers/types";
import { profileUpsert } from "../../settings/common/store/actions";
import { isProfileFirstOnBoarding } from "../../settings/common/store/utils/guards";
import {
  trackNotificationsOptInPreviewStatus,
  trackNotificationsOptInReminderStatus,
  trackPushNotificationSystemPopupShown
} from "../analytics";
import { setPushPermissionsRequestDuration } from "../store/actions/environment";
import { notificationsInfoScreenConsent } from "../store/actions/profileNotificationPermissions";
import { hasUserSeenSystemNotificationsPromptSelector } from "../store/selectors";
import { requestNotificationPermissions } from "../utils";
import {
  checkAndUpdateNotificationPermissionsIfNeeded,
  updateNotificationPermissionsIfNeeded
} from "./common";
</file>

<file path="apps/main-app/ts/features/pushNotifications/sagas/pushNotificationTokenUpload.ts">
import { InstallationID } from "@io-app/api-types/generated/definitions/communication/InstallationID";
import { PlatformEnum } from "@io-app/api-types/generated/definitions/communication/Platform";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { Platform } from "react-native";
import { SagaIterator } from "redux-saga";
import { call, put, select, take } from "typed-redux-saga/macro";
⋮----
import { CommunicationClient } from "../../../api/CommunicationClientManager";
import { convertUnknownToError } from "../../../utils/errors";
import {
  trackNotificationInstallationTokenNotChanged,
  trackPushNotificationTokenUploadFailure,
  trackPushNotificationTokenUploadSucceeded
} from "../analytics";
import {
  newPushNotificationsToken,
  pushNotificationsTokenUploaded
} from "../store/actions/installation";
import {
  canSkipTokenRegistrationSelector,
  notificationsInstallationSelector
} from "../store/reducers/installation";
</file>

<file path="apps/main-app/ts/features/pushNotifications/screens/OnboardingNotificationsInfoScreenConsent.tsx">
import {
  Body,
  Divider,
  FooterActions,
  H2,
  H6,
  IconButton,
  IODimensions,
  ListItemInfo,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect, useMemo } from "react";
import { AppState, FlatList, Platform, StyleSheet, View } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import {
  pushNotificationPreviewEnabledSelector,
  pushNotificationRemindersEnabledSelector
} from "../../settings/common/store/selectors";
import {
  trackNotificationsOptInOpenSettings,
  trackNotificationsOptInReminderOnPermissionsOff,
  trackNotificationsOptInSkipSystemPermissions
} from "../analytics";
import { notificationsInfoScreenConsent } from "../store/actions/profileNotificationPermissions";
import {
  checkNotificationPermissions,
  openSystemNotificationSettingsScreen
} from "../utils";
</file>

<file path="apps/main-app/ts/features/pushNotifications/screens/OnboardingNotificationsPreferencesScreen.tsx">
import { PushNotificationsContentTypeEnum } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatusEnum } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
import {
  Body,
  ContentWrapper,
  H1,
  IOButton,
  IOStyles,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useState } from "react";
import { ScrollView, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { useHardwareBackButton } from "../../../hooks/useHardwareBackButton";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector, useIOStore } from "../../../store/hooks";
import { getFlowType } from "../../../utils/analytics";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { OnboardingParamsList } from "../../onboarding/navigation/params/OnboardingParamsList";
import {
  trackNotificationPreferenceConfiguration,
  trackNotificationScreen,
  trackNotificationsPreferencesPreviewStatus,
  trackNotificationsPreferencesReminderStatus
} from "../../settings/common/analytics";
import { profileUpsert } from "../../settings/common/store/actions";
import {
  profileHasErrorSelector,
  profileIsUpdatingSelector
} from "../../settings/common/store/selectors";
import { ProfileNotificationSettings } from "../components/ProfileNotificationsSettings";
⋮----
export type OnboardingNotificationsPreferencesScreenNavigationParams = {
  isFirstOnboarding: boolean;
};
⋮----
type Props = IOStackNavigationRouteProps<
  OnboardingParamsList,
  "ONBOARDING_NOTIFICATIONS_PREFERENCES"
>;
⋮----
export const OnboardingNotificationsPreferencesScreen = (props: Props) =>
⋮----
const upsertPreferences = () =>
⋮----
label=
</file>

<file path="apps/main-app/ts/features/pushNotifications/screens/PushNotificationEngagementScreen.tsx">
import { Body, HeaderSecondLevel } from "@io-app/design-system";
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
⋮----
import { WhatsNewScreenContent } from "../../../components/screens/WhatsNewScreenContent";
import {
  AppParamsList,
  useIONavigation
} from "../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../store/hooks";
import { setSecurityAdviceReadyToShow } from "../../authentication/fastLogin/store/actions/securityAdviceActions";
import {
  NotificationModalFlow,
  SendOpeningSource,
  SendUserType,
  trackSystemNotificationPermissionScreenOutcome,
  trackSystemNotificationPermissionScreenShown
} from "../analytics";
import { usePushNotificationEngagement } from "../hooks/usePushNotificationEngagement";
import { NOTIFICATIONS_ROUTES } from "../navigation/routes";
⋮----
export type PushNotificationEngagementScreenNavigationParams = {
  flow: NotificationModalFlow;
  sendOpeningSource: SendOpeningSource;
  sendUserType: SendUserType;
};
type PushNotificationEngagementScreenProps = NativeStackScreenProps<
  AppParamsList,
  typeof NOTIFICATIONS_ROUTES.PUSH_NOTIFICATION_ENGAGEMENT
>;
⋮----
export const PushNotificationEngagementScreen = ({
  route
}: PushNotificationEngagementScreenProps) =>
⋮----
type Props = PushNotificationEngagementScreenNavigationParams & {
  onPressActivate: () => void;
  shouldSetSecurityAdviceUponLeaving: boolean;
};
</file>

<file path="apps/main-app/ts/features/pushNotifications/screens/SystemNotificationPermissionsScreen.tsx">
import { HeaderSecondLevel } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
⋮----
import { IOScrollViewCentredContent } from "../../../components/ui/IOScrollViewCentredContent";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../store/hooks";
import {
  trackSystemNotificationPermissionScreenOutcome,
  trackSystemNotificationPermissionScreenShown
} from "../analytics";
import { setEngagementScreenShown } from "../store/actions/environment";
import { openSystemNotificationSettingsScreen } from "../utils";
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/actions/environment.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type NotificationPermissionsActions =
  | ActionType<typeof setEngagementScreenShown>
  | ActionType<typeof setPushPermissionsRequestDuration>
  | ActionType<typeof updateSystemNotificationsEnabled>;
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/actions/installation.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type NotificationsActions =
  | ActionType<typeof newPushNotificationsToken>
  | ActionType<typeof pushNotificationsTokenUploaded>;
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/actions/pendingMessage.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { PendingMessageState } from "../reducers/pendingMessage";
⋮----
export type PendingMessageActions =
  | ActionType<typeof clearNotificationPendingMessage>
  | ActionType<typeof updateNotificationsPendingMessage>;
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/actions/profileNotificationPermissions.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type ProfileNotificationPermissionsActions = ActionType<
  typeof notificationsInfoScreenConsent
>;
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/actions/userBehaviour.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type UserBehaviourActions =
  | ActionType<typeof resetNotificationBannerDismissState>
  | ActionType<typeof setPushNotificationBannerForceDismissed>
  | ActionType<typeof setUserDismissedNotificationsBanner>;
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/reducers/environment.ts">
import { getType } from "typesafe-actions";
⋮----
import { applicationInitialized } from "../../../../store/actions/application";
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import {
  setEngagementScreenShown,
  setPushPermissionsRequestDuration,
  updateSystemNotificationsEnabled
} from "../actions/environment";
import { notificationsInfoScreenConsent } from "../actions/profileNotificationPermissions";
⋮----
export type EnvironmentState = {
  applicationInitialized: boolean;
  engagementScreenShownThisSession: boolean;
  onboardingInstructionsShown: boolean;
  pushNotificationPermissionsRequestDuration?: number;
  systemNotificationsEnabled: boolean;
};
⋮----
export const environmentReducer = (
  state: EnvironmentState = INITIAL_STATE,
  action: Action
): EnvironmentState =>
⋮----
export const areNotificationPermissionsEnabledSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { combineReducers } from "redux";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  PersistPartial,
  persistReducer
} from "redux-persist";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { isDevEnv, isTestEnv } from "../../../../utils/environment";
import { userFromSuccessLoginSelector } from "../../../authentication/loginInfo/store/selectors";
import { generateTokenRegistrationTime } from "../../utils";
import { hasUserSeenSystemNotificationsPromptSelector } from "../selectors";
import { environmentReducer, EnvironmentState } from "./environment";
import {
  installationReducer,
  InstallationState,
  TokenRegistrationResendDelay,
  TokenStatus
} from "./installation";
import { pendingMessageReducer, PendingMessageState } from "./pendingMessage";
import { userBehaviourReducer, UserBehaviourState } from "./userBehaviour";
⋮----
export type PersistedNotificationsState = NotificationsState & PersistPartial;
⋮----
export type NotificationsState = {
  environment: EnvironmentState;
  installation: InstallationState;
  pendingMessage: PendingMessageState;
  userBehaviour: UserBehaviourState;
};
⋮----
export const shouldShowEngagementScreenSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/reducers/installation.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import { consolidateActiveSessionLoginData } from "../../../authentication/activeSessionLogin/store/actions";
import {
  logoutRequest,
  sessionCorrupted,
  sessionExpired,
  sessionInvalid
} from "../../../authentication/common/store/actions";
import { clearCache } from "../../../settings/common/store/actions";
import {
  generateInstallationId,
  generateTokenRegistrationTime
} from "../../utils";
import {
  newPushNotificationsToken,
  pushNotificationsTokenUploaded
} from "../actions/installation";
⋮----
export type InstallationState = Readonly<{
  id: string;
  registeredToken?: string;
  token?: string;
  tokenStatus: TokenStatus;
}>;
export type TokenStatus =
  | TokenStatusSentConfirmed
  | TokenStatusSentUnconfirmed
  | TokenStatusUnsent;
type TokenStatusSentConfirmed = {
  status: "sentConfirmed";
};
type TokenStatusSentUnconfirmed = {
  date: number;
  status: "sentUnconfirmed";
};
⋮----
type TokenStatusUnsent = {
  status: "unsent";
};
⋮----
export const generateInitialState = (): InstallationState => (
⋮----
export const installationReducer = (
  state: InstallationState = generateInitialState(),
  action: Action
): InstallationState =>
⋮----
export const notificationsInstallationSelector = (state: GlobalState)
⋮----
export const canSkipTokenRegistrationSelector = (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/reducers/pendingMessage.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import {
  clearNotificationPendingMessage,
  updateNotificationsPendingMessage
} from "../actions/pendingMessage";
⋮----
export type PendingMessageState = null | Readonly<{
  foreground: boolean;
  id: string;
}>;
⋮----
export const pendingMessageReducer = (
  state: PendingMessageState = INITIAL_STATE,
  action: Action
): PendingMessageState =>
⋮----
export const pendingMessageStateSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/reducers/userBehaviour.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import {
  resetNotificationBannerDismissState,
  setPushNotificationBannerForceDismissed,
  setUserDismissedNotificationsBanner
} from "../actions/userBehaviour";
⋮----
export type UserBehaviourState = {
  pushNotificationBannerDismissalCount: number;
  pushNotificationBannerForceDismissionDate?: number;
};
⋮----
export const userBehaviourReducer = (
  state: UserBehaviourState = INITIAL_STATE,
  action: Action
): UserBehaviourState =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/selectors/index.ts">
import { GlobalState } from "../../../../store/reducers/types";
import { userFromSuccessLoginSelector } from "../../../authentication/loginInfo/store/selectors";
import { areNotificationPermissionsEnabledSelector } from "../reducers/environment";
import {
  pushNotificationsBannerForceDismissionDateSelector,
  shouldResetNotificationBannerDismissStateSelector
} from "./notificationsBannerDismissed";
⋮----
export const hasUserSeenSystemNotificationsPromptSelector = (
  state: GlobalState
) =>
⋮----
export const isPushNotificationsBannerRenderableSelector = (
  state: GlobalState
) =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/store/selectors/notificationsBannerDismissed.ts">
import { GlobalState } from "../../../../store/reducers/types";
import { UIMessage } from "../../../messages/types";
⋮----
export const pushNotificationsBannerForceDismissionDateSelector = (
  state: GlobalState
)
⋮----
export const timesPushNotificationBannerDismissedSelector = (
  state: GlobalState
)
⋮----
export const unreadMessagesCountAfterForceDismissionSelector = (
  state: GlobalState
) =>
⋮----
export const isForceDismissAndNotUnreadMessagesHiddenSelector = (
  state: GlobalState
) =>
⋮----
export const shouldResetNotificationBannerDismissStateSelector = (
  state: GlobalState
) =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/utils/configurePushNotification.ts">
import { Platform } from "react-native";
⋮----
import { updateMixpanelProfileProperties } from "../../../mixpanelConfig/profileProperties";
import { Store } from "../../../store/actions/types";
import { isMixpanelEnabled } from "../../../store/reducers/persistedPreferences";
import { GlobalState } from "../../../store/reducers/types";
import { trackAppCaughtError } from "../../../utils/analytics";
import { isTestEnv } from "../../../utils/environment";
import { trackNewPushNotificationsTokenGenerated } from "../analytics";
import { newPushNotificationsToken } from "../store/actions/installation";
import { handleMessageNotificationInteraction } from "./pushNotificationHandlers";
⋮----
export const configurePushNotificationListeners = (store: Store) =>
⋮----
export const initializePushNotifications = () =>
⋮----
export const setupAndroidNotificationChannel = async (): Promise<void> =>
⋮----
const handleColdStartNotification = (store: Store) =>
⋮----
const onNotificationResponse = (
  response: Notifications.NotificationResponse,
  receivedInForeground: boolean,
  store: Store
) =>
const onPushNotificationTokenReceived =
(store: Store) => (token:
⋮----
const hasUserOptedInForAnalytics = (state: GlobalState)
⋮----
const removePushNotificationListeners = (
  subscriptions: Array<Notifications.EventSubscription>
) =>
</file>

<file path="apps/main-app/ts/features/pushNotifications/utils/index.ts">
import NotificationsUtils from "react-native-notifications-utils";
import { v4 as uuid } from "uuid";
⋮----
import { trackAppCaughtError } from "../../../utils/analytics";
import { isTestEnv } from "../../../utils/environment";
import { unknownToString } from "../../../utils/errors";
import { isIos } from "../../../utils/platform";
⋮----
const areNotificationsEnabled = (
  permissions: Notifications.NotificationPermissionsStatus
) =>
⋮----
export const checkNotificationPermissions = async (): Promise<boolean> =>
⋮----
export const requestNotificationPermissions = async (): Promise<boolean> =>
⋮----
export const generateInstallationId = () => `001$
⋮----
export const openSystemNotificationSettingsScreen = ()
⋮----
export const generateTokenRegistrationTime = ()
</file>

<file path="apps/main-app/ts/features/pushNotifications/utils/navigation.ts">
import { CommonActions } from "@react-navigation/native";
⋮----
import { MESSAGES_ROUTES } from "../../messages/navigation/routes";
import { MessageRouterScreenRouteParams } from "../../messages/screens/MessageRouterScreen";
⋮----
export const navigateToMessageRouterAction = (
  params: MessageRouterScreenRouteParams
)
</file>

<file path="apps/main-app/ts/features/pushNotifications/utils/pushNotificationHandlers.ts">
import _ from "lodash";
⋮----
import { maximumItemsFromAPI, pageSize } from "../../../config";
import { Store } from "../../../store/actions/types";
import { GlobalState } from "../../../store/reducers/types";
import { isTestEnv } from "../../../utils/environment";
import { isLoadingOrUpdating } from "../../../utils/pot";
import { trackMessageNotificationTap } from "../../messages/analytics";
import {
  loadPreviousPageMessages,
  reloadAllMessages
} from "../../messages/store/actions";
import { isArchivingInProcessingModeSelector } from "../../messages/store/reducers/archiving";
import { updateNotificationsPendingMessage } from "../store/actions/pendingMessage";
⋮----
export const handleMessageNotificationInteraction = (
  response: Notifications.NotificationResponse,
  receivedInForeground: boolean,
  store: Store,
  isAnalyticsOptedIn: boolean
) =>
⋮----
const handleForegroundMessageReload = (store: Store) =>
⋮----
const messageIdFromNotificationRequest = (
  notificationRequest: Notifications.NotificationRequest
): string | undefined
⋮----
const getArchiveAndInboxNextAndPreviousPageIndexes = (state: GlobalState) =>
</file>

<file path="apps/main-app/ts/features/services/common/analytics/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { Action } from "../../../../store/actions/types";
import { buildEventProperties } from "../../../../utils/analytics";
import { getNetworkErrorMessage } from "../../../../utils/errors";
import { loadServicePreference } from "../../details/store/actions/preference";
import { FavouriteServicesSortType } from "../../favouriteServices/types";
import {
  featuredInstitutionsGet,
  featuredServicesGet,
  paginatedInstitutionsGet
} from "../../home/store/actions";
import { paginatedServicesGet } from "../../institution/store/actions";
import { searchPaginatedInstitutionsGet } from "../../search/store/actions";
⋮----
type InstitutionBaseType = {
  organization_name: string;
};
⋮----
type ServiceBaseType = InstitutionBaseType & {
  service_id: string;
  service_name: string;
};
⋮----
type ServiceDetailsConsentType = {
  is_special_service: boolean;
  main_consent_status: boolean;
  push_consent_status: boolean;
  read_confirmation_consent_status: boolean;
  service_id: string;
};
⋮----
type ServiceDetailsType = ServiceBaseType & {
  bottom_cta_available: boolean;
  organization_fiscal_code: string;
  service_category: "special" | "standard";
};
⋮----
export type CtaCategoryType = "custom_1" | "custom_2";
⋮----
type InstitutionDetailsType = InstitutionBaseType & {
  organization_fiscal_code: string;
  services_count: number;
};
⋮----
type InstitutionSelectedType = InstitutionBaseType & {
  organization_fiscal_code: string;
  source:
    | "featured_organizations"
    | "main_list"
    | "recent_list"
    | "search_list";
};
⋮----
type SearchStartType = {
  source: "bottom_link" | "favourites" | "header_icon" | "search_bar";
};
⋮----
type ServiceConsentChangedType = {
  consent_status: boolean;
  consent_type: keyof typeof ConsentTypeLabels;
  service_id: string;
};
⋮----
type ServiceDetailsCtaTappedType = {
  cta_category: CtaCategoryType;
  service_id: string;
};
⋮----
type ServiceDetailsUserExitType = {
  link: string;
  service_id: string;
};
⋮----
type ServiceSelectedType = ServiceBaseType & {
  source: "favourites" | "featured_services" | "organization_detail";
};
⋮----
type SpecialServiceStatusChangedType = {
  is_active: boolean;
  service_id: string;
};
⋮----
export const trackServicesHome = ()
⋮----
export const trackServicesHomeError = (
  reason: string,
  source: "featured_organizations" | "featured_services" | "main_list"
)
⋮----
export const trackInstitutionsScroll = ()
⋮----
export const trackSearchStart = (props: SearchStartType)
⋮----
export const trackServiceSelected = ({
  organization_name,
  service_id,
  service_name,
  source
... (85 lines truncated)
</file>

<file path="apps/main-app/ts/features/services/common/components/CardPressableBase.tsx">
import {
  HapticType,
  triggerHaptic,
  useScaleAnimation,
  WithTestID
} from "@io-app/design-system";
import { PropsWithChildren, useCallback } from "react";
import { GestureResponderEvent, Pressable, PressableProps } from "react-native";
import Animated from "react-native-reanimated";
⋮----
type CardPressableBaseProps = WithTestID<
  Pick<PressableProps, "accessibilityLabel" | "onPress"> & {
    hapticType?: HapticType;
  }
>;
</file>

<file path="apps/main-app/ts/features/services/common/components/EmptyState.tsx">
import {
  Body,
  H6,
  IODimensions,
  VSpacer,
  VStack,
  WithTestID
} from "@io-app/design-system";
import { StyleSheet, View } from "react-native";
⋮----
import {
  AnimatedPictogram,
  IOAnimatedPictograms
} from "../../../../components/ui/AnimatedPictogram";
⋮----
export type EmptyStateProps = WithTestID<{
  pictogram: IOAnimatedPictograms;
  subtitle?: string;
  title: string;
}>;
</file>

<file path="apps/main-app/ts/features/services/common/components/ListItemSearchInstitution.tsx">
import {
  AvatarSearch,
  AvatarSearchProps,
  BodySmall,
  H6,
  HStack,
  Icon,
  IODimensions,
  IOListItemStyles,
  useIOTheme,
  useListItemAnimation,
  WithTestID
} from "@io-app/design-system";
import { ComponentProps, memo, ReactNode, useCallback } from "react";
import { GestureResponderEvent, Pressable, View } from "react-native";
import Animated from "react-native-reanimated";
⋮----
export type ListItemSearchInstitution = WithTestID<
  Pick<
    ComponentProps<typeof Pressable>,
    "accessibilityHint" | "accessibilityLabel"
  > & {
    avatarProps: AvatarSearchProps;
    description?: ReactNode | string;
    numberOfLines?: number;
    onPress: (event: GestureResponderEvent) => void;
    value: ReactNode | string;
  }
>;
</file>

<file path="apps/main-app/ts/features/services/common/components/ServiceContactListItem.tsx">
import { ListItemAction } from "@io-app/design-system";
import { useCallback } from "react";
⋮----
import {
  ServiceContactField,
  serviceContactMap
} from "../utils/serviceContactMap";
⋮----
export type ServiceContactListItemProps = {
  onPress?: (value: string) => void;
  testID?: string;
  value?: string;
  variant: ServiceContactField;
};
⋮----
export const ServiceContactListItem = ({
  onPress,
  testID,
  value,
  variant
}: ServiceContactListItemProps) =>
⋮----
accessibilityLabel=
</file>

<file path="apps/main-app/ts/features/services/common/components/ServiceListSkeleton.tsx">
import {
  Divider,
  IODimensions,
  IOListItemStyles,
  IOSkeleton,
  VSpacer
} from "@io-app/design-system";
import { Fragment } from "react";
import { View } from "react-native";
⋮----
type ServiceListSkeletonProps = {
  avatarShown?: boolean;
  sectionTitleShown?: boolean;
  size?: number;
};
</file>

<file path="apps/main-app/ts/features/services/common/components/ServicesHeader.tsx">
import {
  Avatar,
  BodySmall,
  H3,
  IOColors,
  IODimensions,
  IODimensionScale,
  IOSkeleton,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { ImageSourcePropType, StyleSheet, View } from "react-native";
⋮----
export type ServicesHeaderProps = {
  logoUri: ImageSourcePropType;
  subTitle: string;
  title: string;
};
</file>

<file path="apps/main-app/ts/features/services/common/components/ServicesHeaderSection.tsx">
import {
  ContentWrapper,
  IOColors,
  useIOTheme,
  VSpacer,
  WithTestID
} from "@io-app/design-system";
import { ComponentProps } from "react";
import { Dimensions, View } from "react-native";
⋮----
import { ServicesHeader, ServicesHeaderSkeleton } from "./ServicesHeader";
⋮----
export type ServicesHeaderSectionProps = WithTestID<
  | (ComponentProps<typeof ServicesHeader> & {
      extraBottomPadding?: number;
      isLoading?: false;
    })
  | {
      extraBottomPadding?: number;
      isLoading: true;
    }
>;
</file>

<file path="apps/main-app/ts/features/services/common/hooks/useFirstRender.ts">
import { useRef } from "react";
⋮----
export const useFirstRender = () =>
</file>

<file path="apps/main-app/ts/features/services/common/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../utils/navigation";
import { ServiceDetailsScreen } from "../../details/screens/ServiceDetailsScreen";
import { FavouriteServicesScreen } from "../../favouriteServices/screens/FavouriteServicesScreen";
import { InstitutionServicesScreen } from "../../institution/screens/InstitutionServicesScreen";
import { ServicesParamsList } from "./params";
import { SERVICES_ROUTES } from "./routes";
</file>

<file path="apps/main-app/ts/features/services/common/navigation/params.ts">
import { ServiceDetailsScreenRouteParams } from "../../details/screens/ServiceDetailsScreen";
import { InstitutionServicesScreenRouteParams } from "../../institution/screens/InstitutionServicesScreen";
import { SERVICES_ROUTES } from "./routes";
⋮----
export type ServicesParamsList = {
  [SERVICES_ROUTES.FAVOURITE_SERVICES]: undefined;
  [SERVICES_ROUTES.INSTITUTION_SERVICES]: InstitutionServicesScreenRouteParams;
  [SERVICES_ROUTES.SERVICE_DETAIL]: ServiceDetailsScreenRouteParams;
};
</file>

<file path="apps/main-app/ts/features/services/common/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/services/common/saga/getServiceDetails.ts">
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { put, select, take } from "typed-redux-saga/macro";
import { isActionOf } from "typesafe-actions";
⋮----
import { ReduxSagaEffect } from "../../../../types/utils";
import { loadServiceDetail } from "../../details/store/actions/details";
import { serviceDetailsByIdPotSelector } from "../../details/store/selectors";
</file>

<file path="apps/main-app/ts/features/services/common/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { call, fork, select, takeEvery } from "typed-redux-saga/macro";
⋮----
import { identityClientManager } from "../../../../api/IdentityClientManager";
import { servicesClientManager } from "../../../../api/ServicesClientManager";
import { apiUrlPrefix } from "../../../../config";
import { KeyInfo } from "../../../lollipop/utils/crypto";
import { watchServicesDetailsSaga } from "../../details/saga";
import { loadServicePreference } from "../../details/store/actions/preference";
import { watchFavouriteServicesSaga } from "../../favouriteServices/saga";
import { watchHomeSaga } from "../../home/saga";
import { watchInstitutionSaga } from "../../institution/saga";
import { watchSearchSaga } from "../../search/saga";
import { isFavouriteServicesEnabledSelector } from "../store/selectors/remoteConfig";
import { specialServicePreferencesSaga } from "./specialServicePreferencesSaga";
</file>

<file path="apps/main-app/ts/features/services/common/saga/specialServicePreferencesSaga.ts">
import { call, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { updateMixpanelProfileProperties } from "../../../../mixpanelConfig/profileProperties";
import { pnMessagingServiceIdSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { loadServicePreference } from "../../details/store/actions/preference";
import { isServicePreferenceResponseSuccess } from "../../details/types/ServicePreferenceResponse";
</file>

<file path="apps/main-app/ts/features/services/common/store/actions/index.ts">
import { ServiceDetailsActions } from "../../../details/store/actions/details";
import { ServicePreferenceActions } from "../../../details/store/actions/preference";
import { FavouriteServicesActions } from "../../../favouriteServices/store/actions";
import { FseDiscoveryBannerActions } from "../../../fseDiscoveryBanner/store/actions";
import { ServicesHomeActions } from "../../../home/store/actions";
import { InstitutionServicesActions } from "../../../institution/store/actions";
import { SearchActions } from "../../../search/store/actions";
⋮----
export type ServicesActions =
  | FavouriteServicesActions
  | FseDiscoveryBannerActions
  | InstitutionServicesActions
  | SearchActions
  | ServiceDetailsActions
  | ServicePreferenceActions
  | ServicesHomeActions;
</file>

<file path="apps/main-app/ts/features/services/common/store/reducers/index.ts">
import { combineReducers } from "redux";
import { PersistPartial } from "redux-persist";
⋮----
import servicesDetailsReducer, {
  ServicesDetailsState
} from "../../../details/store/reducers";
import favouriteServicesReducer, {
  FavouriteServicesState
} from "../../../favouriteServices/store/reducers";
import {
  fseDiscoveryBannerPersistor,
  FseDiscoveryBannerState
} from "../../../fseDiscoveryBanner/store/reducers";
import homeReducer, { ServicesHomeState } from "../../../home/store/reducers";
import institutionReducer, {
  InstitutionState
} from "../../../institution/store/reducers";
import searchReducer, { SearchState } from "../../../search/store/reducers";
⋮----
export type ServicesState = {
  details: ServicesDetailsState;
  favouriteServices: FavouriteServicesState & PersistPartial;
  fseDiscoveryBanner: FseDiscoveryBannerState & PersistPartial;
  home: ServicesHomeState;
  institution: InstitutionState;
  search: SearchState;
};
</file>

<file path="apps/main-app/ts/features/services/common/store/selectors/remoteConfig.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { remoteConfigSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { isMinAppVersionSupported } from "../../../../../store/reducers/featureFlagWithMinAppVersionStatus";
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
const servicesConfigSelector = (state: GlobalState)
⋮----
export const isFavouriteServicesEnabledSelector = (state: GlobalState)
⋮----
export const favouriteServicesLimitSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/services/common/utils/index.ts">
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ImageURISource } from "react-native";
⋮----
import { contentRepoUrl } from "../../../../config";
⋮----
export function getLogoForInstitution(
  institutionId: string,
  logosRepoUrl = `${contentRepoUrl}/logos`
)
⋮----
export function logosForService(
  service: ServiceDetails,
  logosRepoUrl = `${contentRepoUrl}/logos`
): ReadonlyArray<ImageURISource>
</file>

<file path="apps/main-app/ts/features/services/common/utils/serviceContactMap.ts">
import { ServiceMetadata } from "@io-app/api-types/generated/definitions/services/ServiceMetadata";
import { IOIcons } from "@io-app/design-system";
import I18n from "i18next";
⋮----
import { handleItemOnPress } from "../../../../utils/url";
⋮----
type ServiceContact = {
  accessibilityLabel: () => string;
  icon: IOIcons;
  label: () => string;
  openContact: (value: string) => void;
};
⋮----
export type ServiceContactField = keyof typeof serviceContactMap;
</file>

<file path="apps/main-app/ts/features/services/details/components/CardWithMarkdownContent.tsx">
import { IOColors, IODimensions, useIOTheme } from "@io-app/design-system";
import { useLinkTo } from "@react-navigation/native";
import { memo, ReactNode } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import { LoadingSkeleton } from "../../../../components/ui/LoadingSkeleton";
import { trackAppCaughtError } from "../../../../utils/analytics";
import { unknownToString } from "../../../../utils/errors";
import { generateMessagesAndServicesRules } from "../../../common/components/IOMarkdown/customRules";
⋮----
type CardWithMarkdownContentProps = {
  content: string;
};
⋮----
const CardWrapper = (
⋮----
const renderContent = () => (
      <IOMarkdown
        content={content}
onError=
</file>

<file path="apps/main-app/ts/features/services/details/components/FavouriteServiceButton.tsx">
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ListItemAction, useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps, memo } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
⋮----
import { isFavouriteServicesEnabledSelector } from "../../common/store/selectors/remoteConfig";
import {
  addFavouriteServiceRequest,
  removeFavouriteService
} from "../../favouriteServices/store/actions";
import { isFavouriteServiceSelector } from "../../favouriteServices/store/selectors";
⋮----
type FavouriteServiceButtonProps = {
  service: ServiceDetails;
};
⋮----
const FavouriteServiceButton = (
</file>

<file path="apps/main-app/ts/features/services/details/components/ServiceDetailsFailure.tsx">
import I18n from "i18next";
import { useCallback, useLayoutEffect } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { loadServiceDetail } from "../store/actions/details";
⋮----
export type ServiceDetailsFailureProps = {
  serviceId: string;
};
⋮----
const handleBack = ()
</file>

<file path="apps/main-app/ts/features/services/details/components/ServiceDetailsMetadata.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  Divider,
  IODimensions,
  ListItemAction,
  ListItemHeader,
  ListItemInfo,
  ListItemInfoCopy
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { FlatList, ListRenderItemInfo, Platform } from "react-native";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { handleItemOnPress } from "../../../../utils/url";
⋮----
import {
  ServiceContactListItem,
  ServiceContactListItemProps
} from "../../common/components/ServiceContactListItem";
import {
  ServiceContactField,
  serviceContactMap
} from "../../common/utils/serviceContactMap";
import { serviceMetadataByIdSelector } from "../store/selectors";
⋮----
export type ServiceDetailsMetadataProps = {
  organizationFiscalCode: string;
  serviceId: ServiceId;
};
⋮----
type MetadataListItem =
  | MetadataListItemAction
  | MetadataListItemInfo
  | MetadataListItemInfoCopy
  | MetadataListItemServiceContact;
⋮----
type MetadataListItemAction = MetadataListItemBase &
  Omit<ListItemAction, "variant"> & {
    kind: "ListItemAction";
  };
⋮----
type MetadataListItemBase = {
  condition?: boolean;
};
⋮----
type MetadataListItemInfo = ListItemInfo &
  MetadataListItemBase & {
    kind: "ListItemInfo";
    label: string;
  };
⋮----
type MetadataListItemInfoCopy = ListItemInfoCopy &
  MetadataListItemBase & {
    kind: "ListItemInfoCopy";
  };
⋮----
type MetadataListItemServiceContact = MetadataListItemBase &
  ServiceContactListItemProps & {
    kind: "ServiceContact";
  };
⋮----
export const ServiceDetailsMetadata = ({
  organizationFiscalCode,
  serviceId
}: ServiceDetailsMetadataProps) =>
⋮----
const toContactItem = (
    field: ServiceContactField
): MetadataListItemServiceContact => (
</file>

<file path="apps/main-app/ts/features/services/details/components/ServiceDetailsPreferences.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  Divider,
  IODimensions,
  IOToast,
  ListItemHeader,
  ListItemSwitch
} from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps, useCallback, useEffect } from "react";
import { FlatList, ListRenderItemInfo } from "react-native";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isPremiumMessagesOptInOutEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { EnabledChannels } from "../../../../utils/profile";
⋮----
import { useFirstRender } from "../../common/hooks/useFirstRender";
import { upsertServicePreference } from "../store/actions/preference";
import {
  isErrorServicePreferenceSelector,
  isLoadingServicePreferenceSelector,
  serviceMetadataInfoSelector,
  servicePreferenceResponseSuccessByIdSelector
} from "../store/selectors";
⋮----
export type ServiceDetailsPreferencesProps = {
  serviceId: ServiceId;
};
⋮----
type PreferenceSwitchListItem = ComponentProps<typeof ListItemSwitch> & {
  condition?: boolean;
};
⋮----
export const ServiceDetailsPreferences = ({
  serviceId
}: ServiceDetailsPreferencesProps) =>
</file>

<file path="apps/main-app/ts/features/services/details/components/ServiceDetailsScreenCdc.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useSpecialCtaCdc } from "../../../bonus/cdc/common/hooks/useSpecialCtaCdc";
import { ServiceDetailsScreenBase } from "../types";
import { getServiceActionsProps } from "../utils";
⋮----
export const ServiceDetailsScreenCdc = ({
  children,
  ctas,
  onPressCta,
  title = ""
}: ServiceDetailsScreenBase) =>
</file>

<file path="apps/main-app/ts/features/services/details/components/ServiceDetailsScreenCgn.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { IOColors, useIOTheme } from "@io-app/design-system";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useSpecialCtaCgn } from "../../../bonus/cgn/hooks/useSpecialCtaCgn";
import { ServiceDetailsScreenBase } from "../types";
import { getServiceActionsProps } from "../utils";
⋮----
export type ServiceDetailsScreenCgnProps = ServiceDetailsScreenBase & {
  serviceId: ServiceId;
};
⋮----
export const ServiceDetailsScreenCgn = ({
  children,
  serviceId,
  ctas,
  onPressCta,
  title = ""
}: ServiceDetailsScreenCgnProps) =>
</file>

<file path="apps/main-app/ts/features/services/details/components/ServiceDetailsScreenComponent.tsx">
import { ServiceDetailsScreenCdc } from "./ServiceDetailsScreenCdc";
import {
  ServiceDetailsScreenCgn,
  ServiceDetailsScreenCgnProps
} from "./ServiceDetailsScreenCgn";
import {
  ServiceDetailsScreenDefault,
  ServiceDetailsScreenDefaultProps
} from "./ServiceDetailsScreenDefault";
import {
  ServiceDetailsScreenPn,
  ServiceDetailsScreenPnProps
} from "./ServiceDetailsScreenPn";
⋮----
export type ServiceDetailsScreenComponent =
  | ServiceDetailsScreenCdc
  | ServiceDetailsScreenCgn
  | ServiceDetailsScreenDefault
  | ServiceDetailsScreenPn;
⋮----
export type ServiceKind = ServiceDetailsScreenComponent["kind"];
⋮----
type ServiceDetailsScreenCdc = ServiceDetailsScreenCgnProps & {
  kind: "cdc";
};
⋮----
type ServiceDetailsScreenCgn = ServiceDetailsScreenCgnProps & {
  kind: "cgn";
};
⋮----
type ServiceDetailsScreenDefault = ServiceDetailsScreenDefaultProps & {
  kind?: "default";
};
⋮----
type ServiceDetailsScreenPn = ServiceDetailsScreenPnProps & {
  kind: "pn";
};
⋮----
export const ServiceDetailsScreenComponent = ({
  children,
  ...rest
}: ServiceDetailsScreenComponent) =>
</file>

<file path="apps/main-app/ts/features/services/details/components/ServiceDetailsScreenDefault.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { ServiceDetailsScreenBase } from "../types";
import { getServiceActionsProps } from "../utils";
⋮----
export type ServiceDetailsScreenDefaultProps = ServiceDetailsScreenBase;
⋮----
export const ServiceDetailsScreenDefault = ({
  children,
  ctas,
  onPressCta,
  title = ""
}: ServiceDetailsScreenDefaultProps) =>
</file>

<file path="apps/main-app/ts/features/services/details/components/ServiceDetailsScreenPn.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { IOColors, useIOTheme } from "@io-app/design-system";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useSpecialCtaPn } from "../../../pn/hooks/useSpecialCtaPn";
import { ServiceDetailsScreenBase } from "../types";
import { getServiceActionsProps } from "../utils";
⋮----
export type ServiceDetailsScreenPnProps = ServiceDetailsScreenBase & {
  activate: boolean;
  serviceId: ServiceId;
};
⋮----
export const ServiceDetailsScreenPn = ({
  activate,
  children,
  serviceId,
  ctas,
  onPressCta,
  title = ""
}: ServiceDetailsScreenPnProps) =>
</file>

<file path="apps/main-app/ts/features/services/details/components/ServiceDetailsTosAndPrivacy.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import {
  Divider,
  IODimensions,
  ListItemAction,
  ListItemHeader
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { FlatList, ListRenderItemInfo } from "react-native";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { openWebUrl } from "../../../../utils/url";
import { serviceMetadataByIdSelector } from "../store/selectors";
⋮----
export type ServiceDetailsTosAndPrivacyProps = {
  serviceId: ServiceId;
};
⋮----
type TosAndPrivacyListItem = Omit<ListItemAction, "variant"> & {
  condition?: boolean;
};
⋮----
export const ServiceDetailsTosAndPrivacy = ({
  serviceId
}: ServiceDetailsTosAndPrivacyProps) =>
</file>

<file path="apps/main-app/ts/features/services/details/hooks/useServicePreference.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { useIOSelector } from "../../../../store/hooks";
import { EnabledChannels } from "../../../../utils/profile";
import { servicePreferenceByChannelPotSelector } from "../store/selectors";
⋮----
export const useServicePreferenceByChannel = (
  channel: keyof EnabledChannels,
  serviceId: ServiceId | undefined
) =>
</file>

<file path="apps/main-app/ts/features/services/details/saga/handleGetServicePreference.ts">
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { IdentityClient } from "../../../../api/IdentityClientManager";
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { tryLoadSENDPreferences } from "../../../pn/store/sagas/watchPnSaga";
import { loadServicePreference } from "../store/actions/preference";
import { ServicePreferenceResponseFailure } from "../types/ServicePreferenceResponse";
</file>

<file path="apps/main-app/ts/features/services/details/saga/handleServiceDetails.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { ServicesClient } from "../../../../api/ServicesClientManager";
import { SagaCallReturnType } from "../../../../types/utils";
import { convertUnknownToError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { loadServiceDetail } from "../store/actions/details";
</file>

<file path="apps/main-app/ts/features/services/details/saga/handleUpsertServicePreference.ts">
import { ServicePreference } from "@io-app/api-types/generated/definitions/identity/ServicePreference";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { IdentityClient } from "../../../../api/IdentityClientManager";
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { trackPNPushSettings } from "../../../pn/analytics";
import { upsertServicePreference } from "../store/actions/preference";
import { ServicePreferencePot } from "../store/reducers";
import {
  serviceMetadataInfoSelector,
  servicePreferencePotByIdSelector
} from "../store/selectors";
import { isServicePreferenceResponseSuccess } from "../types/ServicePreferenceResponse";
import { mapKinds } from "./handleGetServicePreference";
⋮----
const calculateUpdatingPreference = (
  currentServicePreferenceState: ServicePreferencePot,
  action: ActionType<typeof upsertServicePreference.request>
): ServicePreference =>
</file>

<file path="apps/main-app/ts/features/services/details/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeEvery, takeLatest } from "typed-redux-saga/macro";
⋮----
import { IdentityClient } from "../../../../api/IdentityClientManager";
import { ServicesClient } from "../../../../api/ServicesClientManager";
import { loadServiceDetail } from "../store/actions/details";
import {
  loadServicePreference,
  upsertServicePreference
} from "../store/actions/preference";
import { handleGetServicePreference } from "./handleGetServicePreference";
import { handleServiceDetails } from "./handleServiceDetails";
import { handleUpsertServicePreference } from "./handleUpsertServicePreference";
</file>

<file path="apps/main-app/ts/features/services/details/screens/ServiceDetailsScreen.tsx">
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ContentWrapper, VStack } from "@io-app/design-system";
import { useFocusEffect, useLinkTo } from "@react-navigation/native";
import { useCallback, useEffect, useMemo } from "react";
import { ImageSourcePropType, StyleSheet, View } from "react-native";
⋮----
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { CTA } from "../../../../types/LocalizedCTAs";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { useFIMSFromServiceId } from "../../../fims/common/hooks";
import { getServiceCTAs, handleCtaAction } from "../../../messages/utils/ctas";
⋮----
import { CtaCategoryType } from "../../common/analytics";
import { ServicesHeaderSection } from "../../common/components/ServicesHeaderSection";
import { useFirstRender } from "../../common/hooks/useFirstRender";
import { ServicesParamsList } from "../../common/navigation/params";
import { logosForService } from "../../common/utils";
import {
  CardWithMarkdownContent,
  CardWithMarkdownContentSkeleton
} from "../components/CardWithMarkdownContent";
import { FavouriteServiceButton } from "../components/FavouriteServiceButton";
import { ServiceDetailsFailure } from "../components/ServiceDetailsFailure";
import { ServiceDetailsMetadata } from "../components/ServiceDetailsMetadata";
import { ServiceDetailsPreferences } from "../components/ServiceDetailsPreferences";
import { ServiceDetailsScreenComponent } from "../components/ServiceDetailsScreenComponent";
import { ServiceDetailsTosAndPrivacy } from "../components/ServiceDetailsTosAndPrivacy";
import { loadServiceDetail } from "../store/actions/details";
import { loadServicePreference } from "../store/actions/preference";
import {
  isErrorServiceDetailsByIdSelector,
  isLoadingServiceDetailsByIdSelector,
  serviceDetailsByIdSelector,
  serviceMetadataInfoSelector
} from "../store/selectors";
⋮----
export type ServiceDetailsScreenRouteParams = {
  activate?: boolean;
  serviceId: ServiceId;
};
⋮----
type ServiceDetailsScreenProps = IOStackNavigationRouteProps<
  ServicesParamsList,
  "SERVICE_DETAIL"
>;
⋮----
export const ServiceDetailsScreen = (
⋮----
type ServiceDetailsContentProps = {
  activate: boolean;
  service: ServiceDetails;
};
⋮----
const ServiceDetailsContent = ({
  activate,
  service
}: ServiceDetailsContentProps) =>
⋮----
const handlePressCta = (cta: CTA, ctaType: CtaCategoryType) =>
</file>

<file path="apps/main-app/ts/features/services/details/store/actions/details.ts">
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
type ServiceLoadFailurePayload = {
  error: Error;
  service_id: string;
};
⋮----
export type ServiceDetailsActions = ActionType<typeof loadServiceDetail>;
</file>

<file path="apps/main-app/ts/features/services/details/store/actions/preference.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
import {
  ServicePreference,
  ServicePreferenceResponse,
  WithServiceID
} from "../../types/ServicePreferenceResponse";
⋮----
export type ServicePreferenceActions =
  | ActionType<typeof loadServicePreference>
  | ActionType<typeof upsertServicePreference>;
</file>

<file path="apps/main-app/ts/features/services/details/store/reducers/index.ts">
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import {
  logoutSuccess,
  sessionCorrupted,
  sessionExpired
} from "../../../../authentication/common/store/actions";
import {
  ServicePreferenceResponse,
  WithServiceID
} from "../../types/ServicePreferenceResponse";
import { loadServiceDetail } from "../actions/details";
import {
  loadServicePreference,
  upsertServicePreference
} from "../actions/preference";
⋮----
export type ServicePreferencePot = pot.Pot<
  ServicePreferenceResponse,
  WithServiceID<NetworkError>
>;
⋮----
export type ServicesDetailsState = {
  dataById: Record<string, pot.Pot<ServiceDetails, Error>>;
  preferencesById: Record<string, ServicePreferencePot>;
};
⋮----
const reducer = (
  state: ServicesDetailsState = INITIAL_STATE,
  action: Action
): ServicesDetailsState =>
</file>

<file path="apps/main-app/ts/features/services/details/store/selectors/index.ts">
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ServiceMetadata } from "@io-app/api-types/generated/definitions/services/ServiceMetadata";
import { SpecialServiceMetadata } from "@io-app/api-types/generated/definitions/services/SpecialServiceMetadata";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { NetworkError } from "../../../../../utils/errors";
import { isStrictSome } from "../../../../../utils/pot";
import { EnabledChannels } from "../../../../../utils/profile";
import { ServiceKind } from "../../components/ServiceDetailsScreenComponent";
import { ServiceMetadataInfo } from "../../types";
import {
  isServicePreferenceResponseSuccess,
  WithServiceID
} from "../../types/ServicePreferenceResponse";
⋮----
export const servicesDetailsSelector = (state: GlobalState)
⋮----
export const serviceDetailsByIdPotSelector = (
  state: GlobalState,
  id: ServiceId
): pot.Pot<ServiceDetails, Error>
⋮----
export const serviceDetailsByIdSelector = (
  state: GlobalState,
  id: ServiceId
): ServiceDetails | undefined
⋮----
export const isLoadingServiceDetailsByIdSelector = (
  state: GlobalState,
  id: ServiceId
)
⋮----
export const isErrorServiceDetailsByIdSelector = (
  state: GlobalState,
  id: ServiceId
)
⋮----
export const servicePreferencePotByIdSelector = (
  state: GlobalState,
  id: ServiceId | undefined
) =>
⋮----
export const isLoadingServicePreferenceSelector = (
  state: GlobalState,
  id: ServiceId | undefined
)
⋮----
export const isErrorServicePreferenceSelector = (
  state: GlobalState,
  id: ServiceId | undefined
)
⋮----
type PreferenceByChannelSelectorType = (
  state: GlobalState,
  serviceId: ServiceId | undefined,
  channel: keyof EnabledChannels
) => pot.Pot<boolean, WithServiceID<NetworkError>>;
</file>

<file path="apps/main-app/ts/features/services/details/types/index.tsx">
import { CTA, CTAS } from "../../../../types/LocalizedCTAs";
import { CtaCategoryType } from "../../common/analytics";
import { ServiceKind } from "../components/ServiceDetailsScreenComponent";
⋮----
export type ServiceDetailsScreenBase = {
  children: React.ReactNode;
  ctas?: CTAS;
  onPressCta?: (cta: CTA, ctaCategoryType: CtaCategoryType) => void;
  title?: string;
};
⋮----
export type ServiceMetadataInfo =
  | {
      isSpecialService: false;
      serviceKind?: never;
    }
  | {
      isSpecialService: true;
      serviceKind: NonNullable<ServiceKind>;
    };
</file>

<file path="apps/main-app/ts/features/services/details/types/ServicePreferenceResponse.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { EnabledChannels } from "../../../../utils/profile";
⋮----
export type ServicePreference = EnabledChannels & { settings_version: number };
⋮----
export type ServicePreferenceResponse = WithServiceID<
  ServicePreferenceResponseFailure | ServicePreferenceResponseSuccess
>;
⋮----
export type ServicePreferenceResponseFailure =
  | ServicePreferenceConflict
  | ServicePreferenceNotFound
  | ServicePreferenceTooManyRequests;
⋮----
export type WithServiceID<T> = T & {
  id: ServiceId;
};
⋮----
type ServicePreferenceConflict = {
  kind: "conflictingVersion";
};
⋮----
type ServicePreferenceNotFound = {
  kind: "notFound";
};
⋮----
type ServicePreferenceResponseSuccess = {
  kind: "success";
  value: ServicePreference;
};
⋮----
type ServicePreferenceTooManyRequests = {
  kind: "tooManyRequests";
};
⋮----
export const isServicePreferenceResponseSuccess = (
  sp: ServicePreferenceResponse
): sp is WithServiceID<ServicePreferenceResponseSuccess>
</file>

<file path="apps/main-app/ts/features/services/details/utils/index.ts">
import { IOScrollViewActions } from "../../../../components/ui/IOScrollView";
import { CTA, CTAS } from "../../../../types/LocalizedCTAs";
import { isDefined } from "../../../../utils/guards";
import { CtaCategoryType } from "../../common/analytics";
⋮----
export const getServiceActionsProps = (
  specialActionProps?: IOScrollViewActions["primary"],
  ctas?: CTAS,
  onPressCta?: (cta: CTA, ctaCategoryType: CtaCategoryType) => void
): IOScrollViewActions | undefined =>
⋮----
const toActionProps = (cta: CTA, category: CtaCategoryType) => (
</file>

<file path="apps/main-app/ts/features/services/favouriteServices/__mocks__/favouriteServicesMocks.ts">
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ServiceDetails } from "@io-app/api-types/generated/definitions/services/ServiceDetails";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { StandardServiceCategoryEnum } from "@io-app/api-types/generated/definitions/services/StandardServiceCategory";
import {
  NonEmptyString,
  OrganizationFiscalCode
} from "@pagopa/ts-commons/lib/strings";
import { merge } from "lodash";
⋮----
import { ServiceType } from "../types";
⋮----
export const createMockService = (
  props: Partial<ServiceType> = {}
): ServiceType
⋮----
export const createMockServiceDetails = (
  props: Partial<ServiceDetails> = {}
): ServiceDetails
</file>

<file path="apps/main-app/ts/features/services/favouriteServices/hooks/useSortFavouriteServicesBottomSheet.tsx">
import { RadioGroup, RadioItem } from "@io-app/design-system";
import I18n from "i18next";
import { AccessibilityInfo } from "react-native";
⋮----
import type { FavouriteServicesSortType } from "../types";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
⋮----
import { setFavouriteServicesSortType } from "../store/actions";
import { favouriteServicesSortTypeSelector } from "../store/selectors";
⋮----
const useSortFavouriteServicesBottomSheet = () =>
⋮----
const handlePress = (changedSortType: FavouriteServicesSortType) =>
⋮----
const present = () =>
</file>

<file path="apps/main-app/ts/features/services/favouriteServices/saga/handleAddFavouriteService.ts">
import { IOToast } from "@io-app/design-system";
import I18n from "i18next";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { favouriteServicesLimitSelector } from "../../common/store/selectors/remoteConfig";
import {
  addFavouriteServiceRequest,
  addFavouriteServiceSuccess
} from "../store/actions";
import { favouriteServicesCountSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/services/favouriteServices/saga/handleSyncFavouriteService.ts">
import { put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { loadServiceDetail } from "../../details/store/actions/details";
import { addFavouriteServiceSuccess } from "../store/actions";
import { favouriteServiceByIdSelector } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/services/favouriteServices/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { loadServiceDetail } from "../../details/store/actions/details";
import { addFavouriteServiceRequest } from "../store/actions";
import { handleAddFavouriteService } from "./handleAddFavouriteService";
import { handleSyncFavouriteService } from "./handleSyncFavouriteService";
</file>

<file path="apps/main-app/ts/features/services/favouriteServices/screens/FavouriteServicesScreen.tsx">
import {
  IODimensions,
  ListItemHeader,
  ListItemNav
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo, useRef } from "react";
import { Alert, ListRenderItemInfo, StyleSheet, View } from "react-native";
⋮----
import type { FavouriteServiceType } from "../types";
⋮----
import ListItemSwipeAction from "../../../../components/ListItemSwipeAction";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { IOListViewWithLargeHeader } from "../../../../components/ui/IOListViewWithLargeHeader";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
⋮----
import { SERVICES_ROUTES } from "../../common/navigation/routes";
import { useSortFavouriteServicesBottomSheet } from "../hooks/useSortFavouriteServicesBottomSheet";
import { removeFavouriteService } from "../store/actions";
import { sortedFavouriteServicesSelector } from "../store/selectors";
⋮----
onRightActionPressed={({
            triggerSwipeAction,
            resetSwipePosition
}) =>
</file>

<file path="apps/main-app/ts/features/services/favouriteServices/store/actions/index.ts">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import type {
  FavouriteServicesSortType,
  FavouriteServiceType
} from "../../../favouriteServices/types";
⋮----
export type FavouriteServicesActions =
  | ActionType<typeof addFavouriteServiceRequest>
  | ActionType<typeof addFavouriteServiceSuccess>
  | ActionType<typeof removeFavouriteService>
  | ActionType<typeof setFavouriteServicesSortType>;
</file>

<file path="apps/main-app/ts/features/services/favouriteServices/store/reducers/index.ts">
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import type {
  FavouriteServicesSortType,
  FavouriteServiceType
} from "../../../favouriteServices/types";
⋮----
import { differentProfileLoggedIn } from "../../../../../store/actions/crossSessions";
import { Action } from "../../../../../store/actions/types";
import createSecureStorage from "../../../../../store/storages/secureStorage";
import { clearCurrentSession } from "../../../../authentication/common/store/actions";
import {
  addFavouriteServiceSuccess,
  removeFavouriteService,
  setFavouriteServicesSortType
} from "../../../favouriteServices/store/actions";
⋮----
export type FavouriteServicesState = {
  dataById: Record<string, FavouriteServiceType>;
  sortType: FavouriteServicesSortType;
};
⋮----
const reducer = (
  state: FavouriteServicesState = INITIAL_STATE,
  action: Action
): FavouriteServicesState =>
</file>

<file path="apps/main-app/ts/features/services/favouriteServices/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import type { FavouriteServiceType } from "../../types";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const favouriteServicesSelector = (state: GlobalState)
⋮----
export const favouriteServicesSortTypeSelector = (state: GlobalState)
⋮----
export const favouriteServiceByIdSelector = (
  state: GlobalState,
  id: string
): FavouriteServiceType | undefined
⋮----
export const isFavouriteServiceSelector = (
  state: GlobalState,
  serviceId: string
)
</file>

<file path="apps/main-app/ts/features/services/favouriteServices/types/index.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { OrganizationFiscalCode } from "@pagopa/ts-commons/lib/strings";
⋮----
export type FavouriteServicesSortType =
  | "addedAt_asc"
  | "addedAt_desc"
  | "name_asc";
⋮----
export type FavouriteServiceType = ServiceType & {
  addedAt: number;
};
⋮----
export type ServiceType = {
  id: ServiceId;
  institution: InstitutionType;
  name: string;
};
⋮----
type InstitutionType = {
  fiscal_code: OrganizationFiscalCode;
  name: string;
};
</file>

<file path="apps/main-app/ts/features/services/fseDiscoveryBanner/components/FseDiscoveryBanner.tsx">
import { Banner, ContentWrapper } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  fseDiscoveryBannerWebUrlSelector,
  isFseDiscoveryBannerDismissableSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import { openWebUrl } from "../../../../utils/url";
import {
  trackLandingScreenMultiBannerClosure,
  trackLandingScreenMultiBannerImpression,
  trackLandingScreenMultiBannerTap
} from "../../../landingScreenMultiBanner/utils/tracking";
import { persistedDismissFseDiscoveryBanner } from "../store/actions";
⋮----
export const FseDiscoveryBanner = ({
  handleOnClose
}: {
handleOnClose: ()
</file>

<file path="apps/main-app/ts/features/services/fseDiscoveryBanner/store/actions/index.ts">
import { ActionType, createAction } from "typesafe-actions";
⋮----
export type FseDiscoveryBannerActions = ActionType<
  typeof persistedDismissFseDiscoveryBanner
>;
</file>

<file path="apps/main-app/ts/features/services/fseDiscoveryBanner/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { differentProfileLoggedIn } from "../../../../../store/actions/crossSessions";
import { Action } from "../../../../../store/actions/types";
import { persistedDismissFseDiscoveryBanner } from "../actions";
⋮----
export type FseDiscoveryBannerState = {
  isDismissed: boolean;
};
⋮----
export const fseDiscoveryBannerReducer = (
  state: FseDiscoveryBannerState = fseDiscoveryBannerInitialState,
  action: Action
): FseDiscoveryBannerState =>
</file>

<file path="apps/main-app/ts/features/services/fseDiscoveryBanner/store/selectors/index.ts">
import { fseDiscoveryBannerWebUrlSelector } from "../../../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../../../store/reducers/types";
import { isTestEnv } from "../../../../../utils/environment";
⋮----
const isFseDiscoveryBannerDismissedSelector = (state: GlobalState): boolean
⋮----
export const isFseDiscoveryBannerRenderableSelector = (
  state: GlobalState
): boolean
</file>

<file path="apps/main-app/ts/features/services/home/components/EmailNotificationBanner.tsx">
import { Banner, IOToast, VSpacer } from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { useEffect } from "react";
import Animated, {
  FadeIn,
  FadeOut,
  LinearTransition
} from "react-native-reanimated";
⋮----
import { mixpanelTrack } from "../../../../mixpanel";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isIdPayEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { buildEventProperties } from "../../../../utils/analytics";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { usePrevious } from "../../../../utils/hooks/usePrevious";
import {
  trackIDPayOnboardingEmailActivationError,
  trackIDPayOnboardingEmailActivationSuccess
} from "../../../idpay/onboarding/analytics";
import { setIdPayOnboardingSucceeded } from "../../../idpay/wallet/store/actions";
import { isIdPayOnboardingSucceededSelector } from "../../../idpay/wallet/store/reducers";
import { profileUpsert } from "../../../settings/common/store/actions";
import {
  isEmailEnabledSelector,
  profileSelector
} from "../../../settings/common/store/selectors";
import { SERVICES_ROUTES } from "../../common/navigation/routes";
⋮----
const mixPanelTracking = (type: "CLOSE_BANNER" | "TAP_BANNER")
⋮----
const handleOnEnableEmailChannel = () =>
⋮----
const handleOnCloseBanner = () =>
⋮----
entering=
</file>

<file path="apps/main-app/ts/features/services/home/components/FeaturedInstitutionCard.tsx">
import {
  Avatar,
  H6,
  IODimensions,
  IODimensionScale,
  IOSkeleton,
  VSpacer
} from "@io-app/design-system";
import { Dimensions, StyleSheet, View } from "react-native";
⋮----
import { WithTestID } from "../../../../types/WithTestID";
import { CardPressableBase } from "../../common/components/CardPressableBase";
import { getLogoForInstitution } from "../../common/utils";
import { useServiceCardStyle } from "../hooks/useServiceCardStyle";
⋮----
export type FeaturedInstitutionCardProps = WithTestID<{
  accessibilityLabel?: string;
  id: string;
  isNew?: boolean;
  name: string;
  onPress?: () => void;
}>;
⋮----
<Avatar logoUri=
</file>

<file path="apps/main-app/ts/features/services/home/components/FeaturedInstitutionList.tsx">
import { Institution } from "@io-app/api-types/generated/definitions/services/Institution";
import { BannerErrorState, ListItemHeader } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
⋮----
import { SERVICES_ROUTES } from "../../common/navigation/routes";
import { featuredInstitutionsGet } from "../store/actions";
import {
  featuredInstitutionsSelector,
  isErrorFeaturedInstitutionsSelector,
  isLoadingFeaturedInstitutionsSelector,
  shouldRenderFeaturedInstitutionListSelector
} from "../store/selectors";
import {
  FeaturedInstitutionsCarousel,
  FeaturedInstitutionsCarouselSkeleton
} from "./FeaturedInstitutionsCarousel";
⋮----
export const FeaturedInstitutionList = () =>
⋮----
const Content = () =>
</file>

<file path="apps/main-app/ts/features/services/home/components/FeaturedInstitutionsCarousel.tsx">
import { HSpacer, IODimensions, IODimensionScale } from "@io-app/design-system";
import { FlatList, FlatListProps, StyleSheet } from "react-native";
⋮----
import { TestID, WithTestID } from "../../../../types/WithTestID";
import {
  CARD_WIDTH,
  FeaturedInstitutionCard,
  FeaturedInstitutionCardProps,
  FeaturedInstitutionCardSkeleton
} from "./FeaturedInstitutionCard";
⋮----
export type FeaturedInstitutionsCarouselProps = WithTestID<{
  institutions: Array<FeaturedInstitutionCardProps>;
}>;
</file>

<file path="apps/main-app/ts/features/services/home/components/FeaturedServiceCard.tsx">
import {
  Avatar,
  Badge,
  BodySmall,
  H4,
  IODimensions,
  IODimensionScale,
  IOSkeleton,
  TestID,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import { WithTestID } from "../../../../types/WithTestID";
import { CardPressableBase } from "../../common/components/CardPressableBase";
import { useServiceCardStyle } from "../hooks/useServiceCardStyle";
import { logoForService } from "../utils";
⋮----
export type FeaturedServiceCardProps = WithTestID<{
  accessibilityLabel?: string;
  id: string;
  isNew?: boolean;
  name: string;
  onPress?: () => void;
  organizationName?: string;
}>;
⋮----
</file>

<file path="apps/main-app/ts/features/services/home/components/FeaturedServiceList.tsx">
import { FeaturedService } from "@io-app/api-types/generated/definitions/services/FeaturedService";
import { BannerErrorState, ListItemHeader } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
⋮----
import { SERVICES_ROUTES } from "../../common/navigation/routes";
import { featuredServicesGet } from "../store/actions";
import {
  featuredServicesSelector,
  isErrorFeaturedServicesSelector,
  isLoadingFeaturedServicesSelector,
  shouldRenderFeaturedServiceListSelector
} from "../store/selectors";
import {
  FeaturedServicesCarousel,
  FeaturedServicesCarouselSkeleton
} from "./FeaturedServicesCarousel";
⋮----
export const FeaturedServiceList = () =>
⋮----
const Content = () =>
</file>

<file path="apps/main-app/ts/features/services/home/components/FeaturedServicesCarousel.tsx">
import { HSpacer, IODimensions, IODimensionScale } from "@io-app/design-system";
import { FlatList, FlatListProps, StyleSheet } from "react-native";
⋮----
import { TestID, WithTestID } from "../../../../types/WithTestID";
import {
  CARD_WIDTH,
  FeaturedServiceCard,
  FeaturedServiceCardProps,
  FeaturedServiceCardSkeleton
} from "./FeaturedServiceCard";
⋮----
export type FeaturedServicesCarouselProps = WithTestID<{
  services: Array<FeaturedServiceCardProps>;
}>;
</file>

<file path="apps/main-app/ts/features/services/home/components/InstitutionList.tsx">
import { Institution } from "@io-app/api-types/generated/definitions/services/Institution";
import {
  BannerErrorState,
  Divider,
  IOButton,
  IODimensions,
  IOToast,
  ListItemHeader,
  SearchInput,
  VSpacer,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect, useMemo } from "react";
import { ListRenderItemInfo, View } from "react-native";
import Animated, {
  AnimatedRef,
  LinearTransition
} from "react-native-reanimated";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { IdPayInitiativeWaitingList } from "../../../idpay/wallet/components/IdPayInitiativeWaitingList";
⋮----
import { ServiceListSkeleton } from "../../common/components/ServiceListSkeleton";
import { SERVICES_ROUTES } from "../../common/navigation/routes";
import { useInstitutionsFetcher } from "../hooks/useInstitutionsFetcher";
import { featuredInstitutionsGet, featuredServicesGet } from "../store/actions";
import { EmailNotificationBanner } from "./EmailNotificationBanner";
import { FeaturedInstitutionList } from "./FeaturedInstitutionList";
import { FeaturedServiceList } from "./FeaturedServiceList";
import { InstitutionListItem } from "./InstitutionListItem";
⋮----
export type InstitutionListProps = {
  scrollViewContentRef: AnimatedRef<Animated.FlatList<Institution>>;
};
⋮----
analytics.trackSearchStart(
navigateToSearch();
</file>

<file path="apps/main-app/ts/features/services/home/components/InstitutionListItem.tsx">
import { Institution } from "@io-app/api-types/generated/definitions/services/Institution";
import { ListItemNav } from "@io-app/design-system";
import { memo } from "react";
⋮----
import { getListItemAccessibilityLabelCount } from "../../../../utils/accessibility";
import { getLogoForInstitution } from "../../common/utils";
⋮----
type InstitutionListItemProps = {
  count: number;
  index: number;
  institution: Institution;
  onPress: (institution: Institution) => void;
};
</file>

<file path="apps/main-app/ts/features/services/home/hooks/useInstitutionsFetcher.tsx">
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
⋮----
import { useCallback, useEffect, useState } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { paginatedInstitutionsGet } from "../store/actions";
import {
  paginatedInstitutionsCurrentPageSelector,
  paginatedInstitutionsLastPageSelector,
  paginatedInstitutionsPotSelector
} from "../store/selectors";
⋮----
export const useInstitutionsFetcher = () =>
</file>

<file path="apps/main-app/ts/features/services/home/hooks/useServiceCardStyle.tsx">
import {
  hexToRgba,
  IOColors,
  IODimensions,
  useIOTheme,
  useIOThemeContext
} from "@io-app/design-system";
import { ColorValue, ViewStyle } from "react-native";
⋮----
type ServiceCardStyleProps = {
  default: {
    card: ViewStyle;
    foreground: {
      primary: IOColors;
      secondary: IOColors;
    };
  };
  new: {
    card: ViewStyle;
    foreground: {
      primary: IOColors;
      secondary: IOColors;
    };
  };
  skeletonColor: ColorValue;
};
⋮----
export const useServiceCardStyle = (): ServiceCardStyleProps =>
</file>

<file path="apps/main-app/ts/features/services/home/hooks/useServicesHomeBottomSheet.tsx">
import {
  Divider,
  IODimensions,
  ListItemNav,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps, useCallback } from "react";
import { FlatList, StyleSheet } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { SETTINGS_ROUTES } from "../../../settings/common/navigation/routes";
</file>

<file path="apps/main-app/ts/features/services/home/saga/handleFindInstitutions.ts">
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { ServicesClient } from "../../../../api/ServicesClientManager";
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { paginatedInstitutionsGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/services/home/saga/handleGetFeaturedInstitutions.ts">
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { ServicesClient } from "../../../../api/ServicesClientManager";
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { featuredInstitutionsGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/services/home/saga/handleGetFeaturedServices.ts">
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { ServicesClient } from "../../../../api/ServicesClientManager";
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { featuredServicesGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/services/home/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { takeLatest } from "typed-redux-saga/macro";
⋮----
import { ServicesClient } from "../../../../api/ServicesClientManager";
import {
  featuredInstitutionsGet,
  featuredServicesGet,
  paginatedInstitutionsGet
} from "../store/actions";
import { handleFindInstitutions } from "./handleFindInstitutions";
import { handleGetFeaturedInstitutions } from "./handleGetFeaturedInstitutions";
import { handleGetFeaturedServices } from "./handleGetFeaturedServices";
</file>

<file path="apps/main-app/ts/features/services/home/screens/ServicesHomeScreen.tsx">
import { Institution } from "@io-app/api-types/generated/definitions/services/Institution";
import { HeaderActionProps } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { View } from "react-native";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import SectionStatusComponent from "../../../../components/SectionStatus";
import { useHeaderFirstLevel } from "../../../../hooks/useHeaderFirstLevel";
import { useTabItemPressWhenScreenActive } from "../../../../hooks/useTabItemPressWhenScreenActive";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
⋮----
import { SERVICES_ROUTES } from "../../common/navigation/routes";
import { isFavouriteServicesEnabledSelector } from "../../common/store/selectors/remoteConfig";
import { InstitutionList } from "../components/InstitutionList";
import { useServicesHomeBottomSheet } from "../hooks/useServicesHomeBottomSheet";
⋮----
export const ServicesHomeScreen = () =>
</file>

<file path="apps/main-app/ts/features/services/home/store/actions/index.ts">
import { FeaturedServices } from "@io-app/api-types/generated/definitions/services/FeaturedServices";
import { Institutions } from "@io-app/api-types/generated/definitions/services/Institutions";
import { InstitutionsResource } from "@io-app/api-types/generated/definitions/services/InstitutionsResource";
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type PaginatedInstitutionsGetPayload = {
  limit: number;
  offset: number;
  scope?: ScopeTypeEnum;
  search?: string;
};
⋮----
export type ServicesHomeActions = ActionType<
  | typeof featuredInstitutionsGet
  | typeof featuredServicesGet
  | typeof paginatedInstitutionsGet
>;
</file>

<file path="apps/main-app/ts/features/services/home/store/reducers/index.ts">
import { FeaturedServices } from "@io-app/api-types/generated/definitions/services/FeaturedServices";
import { Institution } from "@io-app/api-types/generated/definitions/services/Institution";
import { Institutions } from "@io-app/api-types/generated/definitions/services/Institutions";
import { InstitutionsResource } from "@io-app/api-types/generated/definitions/services/InstitutionsResource";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import {
  featuredInstitutionsGet,
  featuredServicesGet,
  paginatedInstitutionsGet
} from "../actions";
⋮----
export type ServicesHomeState = {
  featuredInstitutions: pot.Pot<Institutions, NetworkError>;
  featuredServices: pot.Pot<FeaturedServices, NetworkError>;
  paginatedInstitutions: pot.Pot<
    InstitutionsResource,
    PaginatedInstitutionsError
  >;
};
⋮----
type PaginatedInstitutionsError = {
  reason: NetworkError;
  time: Date;
};
⋮----
const reducer = (
  state: ServicesHomeState = INITIAL_STATE,
  action: Action
): ServicesHomeState =>
</file>

<file path="apps/main-app/ts/features/services/home/store/selectors/index.ts">
import { pipe } from "fp-ts/lib/function";
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { potFoldWithDefault } from "../../../../../utils/pot";
⋮----
export const paginatedInstitutionsPotSelector = (state: GlobalState)
⋮----
export const featuredServicesPotSelector = (state: GlobalState)
⋮----
export const isLoadingFeaturedServicesSelector = (state: GlobalState)
⋮----
export const isErrorFeaturedServicesSelector = (state: GlobalState)
⋮----
export const shouldRenderFeaturedServiceListSelector = (state: GlobalState)
⋮----
export const featuredInstitutionsPotSelector = (state: GlobalState)
⋮----
export const isLoadingFeaturedInstitutionsSelector = (state: GlobalState)
⋮----
export const isErrorFeaturedInstitutionsSelector = (state: GlobalState)
⋮----
export const shouldRenderFeaturedInstitutionListSelector = (
  state: GlobalState
)
</file>

<file path="apps/main-app/ts/features/services/home/utils/index.ts">
import { ImageSourcePropType } from "react-native";
⋮----
import { contentRepoUrl } from "../../../../config";
⋮----
export function logoForService(
  serviceId: string,
  organizationFiscalCode: string,
  logosRepoUrl = `${contentRepoUrl}/logos`
): ImageSourcePropType
</file>

<file path="apps/main-app/ts/features/services/institution/components/InstitutionServicesFailure.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
⋮----
export type InstitutionServicesFailureProps = {
  onRetry: () => void;
};
</file>

<file path="apps/main-app/ts/features/services/institution/hooks/useServicesFetcher.tsx">
import { useCallback, useEffect, useState } from "react";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { paginatedServicesGet } from "../store/actions";
import {
  isErrorPaginatedServicesSelector,
  isLoadingPaginatedServicesSelector,
  isUpdatingPaginatedServicesSelector,
  paginatedServicesCurrentPageSelector,
  paginatedServicesLastPageSelector,
  paginatedServicesSelector
} from "../store/selectors";
⋮----
export const useServicesFetcher = (institutionId: string) =>
</file>

<file path="apps/main-app/ts/features/services/institution/saga/handleFindInstitutionServices.ts">
import { call, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { ServicesClient } from "../../../../api/ServicesClientManager";
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { paginatedServicesGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/services/institution/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { call, race, take, takeLatest } from "typed-redux-saga/macro";
⋮----
import { ServicesClient } from "../../../../api/ServicesClientManager";
import { paginatedServicesGet } from "../store/actions";
import { handleFindInstitutionServices } from "./handleFindInstitutionServices";
</file>

<file path="apps/main-app/ts/features/services/institution/screens/InstitutionServicesScreen.tsx">
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { ServiceMinified } from "@io-app/api-types/generated/definitions/services/ServiceMinified";
import {
  Divider,
  IOColors,
  IODimensions,
  IOToast,
  ListItemNav,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useMemo } from "react";
import { ListRenderItemInfo, RefreshControl } from "react-native";
import Animated, { useAnimatedRef } from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import {
  HeaderSecondLevelHookProps,
  useHeaderSecondLevel
} from "../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { getListItemAccessibilityLabelCount } from "../../../../utils/accessibility";
⋮----
import { ServiceListSkeleton } from "../../common/components/ServiceListSkeleton";
import { ServicesHeaderSection } from "../../common/components/ServicesHeaderSection";
import { useFirstRender } from "../../common/hooks/useFirstRender";
import { ServicesParamsList } from "../../common/navigation/params";
import { SERVICES_ROUTES } from "../../common/navigation/routes";
import { getLogoForInstitution } from "../../common/utils";
import { InstitutionServicesFailure } from "../components/InstitutionServicesFailure";
import { useServicesFetcher } from "../hooks/useServicesFetcher";
import { paginatedServicesGet } from "../store/actions";
⋮----
export type InstitutionServicesScreenRouteParams = {
  institutionId: string;
  institutionName: string;
};
⋮----
type InstitutionServicesScreen = IOStackNavigationRouteProps<
  ServicesParamsList,
  "INSTITUTION_SERVICES"
>;
⋮----
logoUri=
</file>

<file path="apps/main-app/ts/features/services/institution/store/actions/index.ts">
import { InstitutionServicesResource } from "@io-app/api-types/generated/definitions/services/InstitutionServicesResource";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type PaginatedServicesGetPayload = {
  institutionId: string;
  limit: number;
  offset: number;
};
⋮----
export type WithInstitutionID<T> = T & {
  id: string;
};
⋮----
export type InstitutionServicesActions = ActionType<
  typeof paginatedServicesGet
>;
</file>

<file path="apps/main-app/ts/features/services/institution/store/reducers/index.ts">
import { InstitutionServicesResource } from "@io-app/api-types/generated/definitions/services/InstitutionServicesResource";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import { paginatedServicesGet, WithInstitutionID } from "../actions";
⋮----
export type InstitutionState = {
  paginatedServices: pot.Pot<
    InstitutionServicesResource,
    WithInstitutionID<NetworkError>
  >;
};
⋮----
const reducer = (
  state: InstitutionState = INITIAL_STATE,
  action: Action
): InstitutionState =>
</file>

<file path="apps/main-app/ts/features/services/institution/store/selectors/index.ts">
import { pipe } from "fp-ts/lib/function";
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const paginatedServicesPotSelector = (state: GlobalState)
⋮----
export const isLoadingPaginatedServicesSelector = (state: GlobalState)
⋮----
export const isUpdatingPaginatedServicesSelector = (state: GlobalState)
⋮----
export const isErrorPaginatedServicesSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/services/search/hooks/useInstitutionsFetcher.tsx">
import { useCallback, useEffect, useRef, useState } from "react";
import { v4 as uuid } from "uuid";
⋮----
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { searchPaginatedInstitutionsGet } from "../store/actions";
import {
  isErrorPaginatedInstitutionsSelector,
  isLoadingPaginatedInstitutionsSelector,
  isUpdatingPaginatedInstitutionsSelector,
  paginatedInstitutionsCurrentPageSelector,
  paginatedInstitutionsLastPageSelector,
  paginatedInstitutionsSelector
} from "../store/selectors";
⋮----
export const useInstitutionsFetcher = () =>
</file>

<file path="apps/main-app/ts/features/services/search/saga/handleFindInstitutions.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
⋮----
import { call, delay, put } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { ServicesClient } from "../../../../api/ServicesClientManager";
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { searchPaginatedInstitutionsGet } from "../store/actions";
</file>

<file path="apps/main-app/ts/features/services/search/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { call, race, take, takeLatest } from "typed-redux-saga/macro";
⋮----
import { ServicesClient } from "../../../../api/ServicesClientManager";
import { searchPaginatedInstitutionsGet } from "../store/actions";
import { handleFindInstitutions } from "./handleFindInstitutions";
</file>

<file path="apps/main-app/ts/features/services/search/screens/SearchScreen.tsx">
import { Institution } from "@io-app/api-types/generated/definitions/services/Institution";
import {
  AvatarSearchProps,
  ContentWrapper,
  Divider,
  IODimensions,
  IODimensionScale,
  IOToast,
  ListItemHeader,
  SearchInput,
  SearchInputRef
} from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import {
  FlashList,
  ListRenderItemInfo,
  useRecyclingState
} from "@shopify/flash-list";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Keyboard, Platform, ViewStyle } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { getListItemAccessibilityLabelCount } from "../../../../utils/accessibility";
⋮----
import { EmptyState } from "../../common/components/EmptyState";
import { ListItemSearchInstitution } from "../../common/components/ListItemSearchInstitution";
import { ServiceListSkeleton } from "../../common/components/ServiceListSkeleton";
import { SERVICES_ROUTES } from "../../common/navigation/routes";
import { getLogoForInstitution } from "../../common/utils";
import { useInstitutionsFetcher } from "../hooks/useInstitutionsFetcher";
import { searchPaginatedInstitutionsGet } from "../store/actions";
⋮----
type InstitutionListItemComponentProps = {
  index: number;
  item: Institution;
  onPress: (institution: Institution) => void;
  totalCount: number;
};
⋮----
const handleChangeText = (text: string) =>
</file>

<file path="apps/main-app/ts/features/services/search/store/actions/index.ts">
import { InstitutionsResource } from "@io-app/api-types/generated/definitions/services/InstitutionsResource";
import { ScopeTypeEnum } from "@io-app/api-types/generated/definitions/services/ScopeType";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../../utils/errors";
⋮----
export type SearchPaginatedInstitutionsGetPayload = {
  limit: number;
  offset: number;
  scope?: ScopeTypeEnum;
  search?: string;
  sessionId?: string;
};
⋮----
export type SearchActions = ActionType<typeof searchPaginatedInstitutionsGet>;
</file>

<file path="apps/main-app/ts/features/services/search/store/reducers/index.ts">
import { Institution } from "@io-app/api-types/generated/definitions/services/Institution";
import { InstitutionsResource } from "@io-app/api-types/generated/definitions/services/InstitutionsResource";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { NetworkError } from "../../../../../utils/errors";
import { searchPaginatedInstitutionsGet } from "../actions";
⋮----
export type SearchState = {
  paginatedInstitutions: pot.Pot<InstitutionsResource, NetworkError>;
};
⋮----
const reducer = (
  state: SearchState = INITIAL_STATE,
  action: Action
): SearchState =>
</file>

<file path="apps/main-app/ts/features/services/search/store/selectors/index.ts">
import { pipe } from "fp-ts/lib/function";
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const paginatedInstitutionsPotSelector = (state: GlobalState)
⋮----
export const isLoadingPaginatedInstitutionsSelector = (state: GlobalState)
⋮----
export const isUpdatingPaginatedInstitutionsSelector = (state: GlobalState)
⋮----
export const isErrorPaginatedInstitutionsSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/settings/aboutApp/__test__/ProfileAboutApp.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../store/actions/application";
import { appReducer } from "../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../utils/testWrapper";
import { openWebUrl } from "../../../../utils/url";
import { SETTINGS_ROUTES } from "../../common/navigation/routes";
import ProfileAboutApp from "../screens/ProfileAboutApp";
⋮----
const renderComponent = () =>
</file>

<file path="apps/main-app/ts/features/settings/aboutApp/screens/ProfileAboutApp.tsx">
import {
  Banner,
  ContentWrapper,
  H4,
  IOMarkdownLite,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIOSelector } from "../../../../store/hooks";
import { absolutePortalLinksSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { openWebUrl } from "../../../../utils/url";
</file>

<file path="apps/main-app/ts/features/settings/common/analytics/__test__/index.test.ts">
import { getType } from "typesafe-actions";
⋮----
import {
  getNotificationPermissionType,
  getNotificationPreferenceConfiguration,
  getNotificationTokenType,
  trackAppearancePreferenceScreenView,
  trackAppearancePreferenceTypefaceUpdate,
  trackCreatePinSuccess,
  trackIngressScreen,
  trackMixpanelScreen,
  trackNotificationPreferenceConfiguration,
  trackNotificationsPreferencesPreviewStatus,
  trackNotificationsPreferencesReminderStatus,
  trackPinError,
  trackProfileLoadSuccess,
  trackSettingsDiscoverBannerClosure,
  trackSettingsDiscoverBannerTap,
  trackSettingsDiscoverBannerVisualized
} from "..";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { profileLoadSuccess } from "../../store/actions";
⋮----
const getMockMixpanelTrack = ()
</file>

<file path="apps/main-app/ts/features/settings/common/analytics/__test__/mixpanelAnalytics.test.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../../mixpanelConfig/profileProperties";
import { FlowType } from "../../../../../utils/analytics";
import {
  TrackingInfo,
  trackMixpanelConsentBottomsheet,
  trackMixpanelConsentCancel,
  trackMixpanelDeclined,
  trackMixpanelNotNowSelected,
  trackMixpanelSetEnabled,
  trackMixPanelTrackingInfo
} from "../mixpanel/mixpanelAnalytics";
</file>

<file path="apps/main-app/ts/features/settings/common/analytics/mixpanel/mixpanelAnalytics.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../../mixpanelConfig/profileProperties";
import { GlobalState } from "../../../../../store/reducers/types";
import { buildEventProperties, FlowType } from "../../../../../utils/analytics";
⋮----
export enum TrackingInfo {
  FIND_OUT_MORE = "sicurezza",
  SUPPLIERS = "fornitori",
  TOS = "ToS",
  WHY = "finalità"
}
⋮----
export function trackMixpanelConsentBottomsheet(flow: FlowType)
⋮----
export function trackMixpanelConsentCancel(flow: FlowType)
⋮----
export function trackMixpanelDeclined(flow: FlowType)
⋮----
export function trackMixpanelNotNowSelected(flow: FlowType)
⋮----
export async function trackMixpanelSetEnabled(
  isEnabled: boolean,
  flow: FlowType,
  state: GlobalState
)
⋮----
export function trackMixPanelTrackingInfo(flow: FlowType, info: TrackingInfo)
</file>

<file path="apps/main-app/ts/features/settings/common/analytics/index.ts">
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
⋮----
import { ColorModeChoice } from "../../../../hooks/useAppThemeConfiguration";
import { mixpanelTrack } from "../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../mixpanelConfig/profileProperties";
import { updateMixpanelSuperProperties } from "../../../../mixpanelConfig/superProperties";
import { TypefaceChoice } from "../../../../store/actions/persistedPreferences";
import { GlobalState } from "../../../../store/reducers/types";
import { buildEventProperties, FlowType } from "../../../../utils/analytics";
import { MESSAGES_ROUTES } from "../../../messages/navigation/routes";
import { SETTINGS_ROUTES } from "../navigation/routes";
import { profileLoadSuccess } from "../store/actions";
⋮----
export type NotificationPermissionType = "disabled" | "enabled";
⋮----
export type NotificationPreferenceConfiguration =
  | "complete"
  | "none"
  | "not set"
  | "preview"
  | "reminder";
export type NotificationTokenType = "no" | "yes";
⋮----
export type ServiceConfigurationTrackingType =
  | "not set"
  | ServicesPreferencesModeEnum
  | undefined;
⋮----
export function getNotificationPreferenceConfiguration(
  isReminderEnabled: boolean | undefined,
  isPreviewEnabled: boolean | undefined
): NotificationPreferenceConfiguration
⋮----
export function trackCreatePinSuccess(flow: FlowType)
⋮----
export function trackIdpAuthenticationSuccessScreen(idpId: string | undefined)
⋮----
export function trackIngressScreen()
⋮----
export function trackMixpanelScreen(flow: FlowType)
⋮----
export function trackNotificationScreen(flow: FlowType)
⋮----
export function trackNotificationsPreferencesPreviewStatus(
  enabled: boolean,
  flow: FlowType
)
⋮----
export function trackNotificationsPreferencesReminderStatus(
  enabled: boolean,
  flow: FlowType
)
⋮----
export function trackPinError(error: "confirm" | "creation", flow: FlowType)
⋮----
export function trackPinScreen(flow: FlowType)
⋮----
export async function trackProfileLoadSuccess(state: GlobalState)
⋮----
export async function trackServiceConfiguration(
  mode: ServiceConfigurationTrackingType,
  flow: FlowType,
  state: GlobalState
)
⋮----
export function trackServiceConfigurationScreen(flow: FlowType)
export function trackThankYouPageScreen()
⋮----
export const getNotificationPermissionType = (
  hasPermission: boolean
): NotificationPermissionType
⋮----
export const getNotificationTokenType = (
  state: GlobalState
): NotificationTokenType
⋮----
export function trackAppearancePreferenceScreenView()
⋮----
export function trackAppearancePreferenceThemeUpdate(
  choice: ColorModeChoice,
  state: GlobalState
)
⋮----
export function trackAppearancePreferenceTypefaceUpdate(
  choice: TypefaceChoice,
  state: GlobalState
)
⋮----
export async function trackNotificationPreferenceConfiguration(
  isReminderEnabled: boolean,
  isPreviewEnabled: boolean,
  flow: FlowType,
  state: GlobalState
)
⋮----
export function trackPressLogoutCancelFromIO()
⋮----
export function trackPressLogoutConfirmFromIO()
⋮----
export function trackPressLogoutFromIO()
... (7 lines truncated)
</file>

<file path="apps/main-app/ts/features/settings/common/components/ProfileMainScreenTopBanner.tsx">
import { Alert, Banner, ContentWrapper, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { setShowAppearanceSettingsBanner } from "../../../appearanceSettings/store/actions";
import { settingsBannerToShowSelector } from "../../../appearanceSettings/store/selectors";
import {
  trackPushNotificationsBannerTap,
  trackPushNotificationsBannerVisualized
} from "../../../pushNotifications/analytics";
import { openSystemNotificationSettingsScreen } from "../../../pushNotifications/utils";
import { SETTINGS_ROUTES } from "../navigation/routes";
</file>

<file path="apps/main-app/ts/features/settings/common/navigation/__test__/SettingsNavigator.test.tsx">
import { InitialState, NavigationContainer } from "@react-navigation/native";
import { render } from "@testing-library/react-native";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { GlobalState } from "../../../../../store/reducers/types";
import { SETTINGS_ROUTES } from "../routes";
import SettingsNavigator from "../SettingsNavigator";
⋮----
const createMockStore = () =>
⋮----
const renderComponent = (initialState?: InitialState) =>
</file>

<file path="apps/main-app/ts/features/settings/common/navigation/params/SettingsParamsList.ts">
import { NavigatorScreenParams } from "@react-navigation/native";
⋮----
import { AuthenticationParamsList } from "../../../../authentication/common/navigation/params/AuthenticationParamsList";
import { EmailInsertScreenNavigationParams } from "../../../userData/shared/screens/EmailInsertScreen";
import { SendEmailValidationScreenProp } from "../../../userData/shared/screens/EmailValidationSendEmailScreen";
import { SETTINGS_ROUTES } from "../routes";
⋮----
export type SettingsParamsList = {
  [SETTINGS_ROUTES.APP_FEEDBACK_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.AUTHENTICATION]: NavigatorScreenParams<AuthenticationParamsList>;
  [SETTINGS_ROUTES.AUTHENTICATION_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.BOTTOM_SHEET_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.CGN_LANDING_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.CIE_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.DESIGN_SYSTEM]: undefined;
  [SETTINGS_ROUTES.EMAIL_VERIFICATION_SCREEN]: SendEmailValidationScreenProp;
  [SETTINGS_ROUTES.GUIDED_TOUR_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.IDPAY_CODE_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.IDPAY_ONBOARDING_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.INSERT_EMAIL_SCREEN]: EmailInsertScreenNavigationParams;
  [SETTINGS_ROUTES.IO_MARKDOWN_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.LOLLIPOP_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.NFC_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.PIN_SCREEN]: undefined;
  [SETTINGS_ROUTES.PROFILE_ABOUT_APP]: undefined;
  [SETTINGS_ROUTES.PROFILE_DATA]: undefined;
  [SETTINGS_ROUTES.PROFILE_DOWNLOAD_DATA]: undefined;
  [SETTINGS_ROUTES.PROFILE_FISCAL_CODE]: undefined;
  [SETTINGS_ROUTES.PROFILE_LOGOUT]: undefined;
  [SETTINGS_ROUTES.PROFILE_PREFERENCES_APPEARANCE]: undefined;
  [SETTINGS_ROUTES.PROFILE_PREFERENCES_CALENDAR]: undefined;
  [SETTINGS_ROUTES.PROFILE_PREFERENCES_EMAIL_FORWARDING]: undefined;
  [SETTINGS_ROUTES.PROFILE_PREFERENCES_HOME]: undefined;
  [SETTINGS_ROUTES.PROFILE_PREFERENCES_LANGUAGE]: undefined;
  [SETTINGS_ROUTES.PROFILE_PREFERENCES_NOTIFICATIONS]: undefined;
  [SETTINGS_ROUTES.PROFILE_PREFERENCES_SERVICES]: undefined;
  [SETTINGS_ROUTES.PROFILE_PRIVACY]: undefined;
  [SETTINGS_ROUTES.PROFILE_PRIVACY_MAIN]: undefined;
  [SETTINGS_ROUTES.PROFILE_PRIVACY_SHARE_DATA]: undefined;
  [SETTINGS_ROUTES.PROFILE_REMOVE_ACCOUNT_DETAILS]: undefined;
  [SETTINGS_ROUTES.PROFILE_REMOVE_ACCOUNT_INFO]: undefined;
  [SETTINGS_ROUTES.PROFILE_REMOVE_ACCOUNT_SUCCESS]: undefined;
  [SETTINGS_ROUTES.PROFILE_SECURITY]: undefined;
  [SETTINGS_ROUTES.SEND_PLAYGROUND]: undefined;
  [SETTINGS_ROUTES.SETTINGS_MAIN]: undefined;
  [SETTINGS_ROUTES.TRIALS_SYSTEM_PLAYGROUND]: undefined;
};
</file>

<file path="apps/main-app/ts/features/settings/common/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/settings/common/navigation/SettingsNavigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../../utils/navigation";
import AuthenticationNavigator from "../../../authentication/common/navigation/AuthenticationNavigator";
import { AuthenticationPlayground } from "../../../authentication/playgrounds/screens/AuthenticationPlayground";
import { DesignSystemNavigator } from "../../../design-system/navigation/navigator";
import LollipopPlayground from "../../../lollipop/playgrounds/LollipopPlayground";
import ProfileAboutApp from "../../aboutApp/screens/ProfileAboutApp";
import { AppFeedbackPlayground } from "../../devMode/playgrounds/AppFeedbackPlayground";
import { BottomSheetPlayground } from "../../devMode/playgrounds/BottomSheetPlayground";
import CgnLandingPlayground from "../../devMode/playgrounds/CgnLandingPlayground";
import { CiePlaygroundsNavigator } from "../../devMode/playgrounds/Cie/navigation/CiePlaygroundsNavigator";
import { GuidedTourPlayground } from "../../devMode/playgrounds/GuidedTourPlayground";
import { IdPayCodePlayGround } from "../../devMode/playgrounds/IdPayCodePlayground";
import IdPayOnboardingPlayground from "../../devMode/playgrounds/IdPayOnboardingPlayground";
import { IOMarkdownPlayground } from "../../devMode/playgrounds/IOMarkdownPlayground";
import { NfcPlayground } from "../../devMode/playgrounds/NfcPlayground";
import { SendPlaygroundScreen } from "../../devMode/playgrounds/SendPlaygroundScreen";
import AppearancePreferenceScreen from "../../preferences/screens/AppearancePreferenceScreen";
import CalendarsPreferencesScreen from "../../preferences/screens/CalendarsPreferencesScreen";
import EmailForwardingScreen from "../../preferences/screens/EmailForwardingScreen";
import LanguagesPreferencesScreen from "../../preferences/screens/LanguagesPreferencesScreen";
import { NotificationsPreferencesScreen } from "../../preferences/screens/NotificationsPreferencesScreen";
import PreferencesScreen from "../../preferences/screens/PreferencesScreen";
import ServicesPreferenceScreen from "../../preferences/screens/ServicesPreferenceScreen";
import DownloadProfileDataScreen from "../../privacy/screens/DownloadProfileDataScreen";
import PrivacyMainScreen from "../../privacy/screens/PrivacyMainScreen";
import RemoveAccountDetails from "../../privacy/screens/RemoveAccountDetailsScreen";
import RemoveAccountInfo from "../../privacy/screens/RemoveAccountInfoScreen";
import RemoveAccountSuccess from "../../privacy/screens/RemoveAccountSuccessScreen";
import ShareDataScreen from "../../privacy/screens/ShareDataScreen";
import TosScreen from "../../privacy/screens/TosScreen";
import PinScreen from "../../security/screens/PinScreen";
import SecurityScreen from "../../security/screens/SecurityScreen";
import FiscalCodeScreen from "../../userData/screens/FiscalCodeScreen";
import ProfileDataScreen from "../../userData/screens/ProfileDataScreen";
import EmailInsertScreen from "../../userData/shared/screens/EmailInsertScreen";
import EmailValidationSendEmailScreen from "../../userData/shared/screens/EmailValidationSendEmailScreen";
import LogoutScreen from "../screens/LogoutScreen";
import ProfileMainScreen from "../screens/ProfileMainScreen";
import { SettingsParamsList } from "./params/SettingsParamsList";
import { SETTINGS_ROUTES } from "./routes";
</file>

<file path="apps/main-app/ts/features/settings/common/sagas/profile.ts">
import { AppVersion } from "@io-app/api-types/generated/definitions/identity/AppVersion";
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
import { UpdateProfile412ErrorTypesEnum } from "@io-app/api-types/generated/definitions/identity/UpdateProfile412ErrorTypes";
import { UserDataProcessingChoiceEnum } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingChoice";
import { ExtendedProfile } from "@io-app/api-types/generated/definitions/session_manager/ExtendedProfile";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { call, put, select, take, takeLatest } from "typed-redux-saga/macro";
import { ActionType, getType, isActionOf } from "typesafe-actions";
⋮----
import { IdentityClient } from "../../../../api/IdentityClientManager";
import { mixpanelTrack } from "../../../../mixpanel";
import {
  differentProfileLoggedIn,
  setProfileHashedFiscalCode
} from "../../../../store/actions/crossSessions";
import { navigateToRemoveAccountSuccess } from "../../../../store/actions/navigation";
import { isCGNEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isDifferentFiscalCodeSelector } from "../../../../store/reducers/crossSessions";
import { GlobalState } from "../../../../store/reducers/types";
import { ReduxSagaEffect, SagaCallReturnType } from "../../../../types/utils";
import { getAppVersion } from "../../../../utils/appVersion";
import { isTestEnv } from "../../../../utils/environment";
import { convertUnknownToError } from "../../../../utils/errors";
import { deletePin } from "../../../../utils/keychain";
import {
  fromLocaleToPreferredLanguage,
  getLocalePrimaryWithFallback
} from "../../../../utils/locale";
import { readablePrivacyReport } from "../../../../utils/reporters";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import { cgnDetails } from "../../../bonus/cgn/store/actions/details";
import { cgnDetailSelector } from "../../../bonus/cgn/store/reducers/details";
import { paymentsResetPagoPaPlatformSessionTokenAction } from "../../../payments/common/store/actions";
import { tosConfigSelector } from "../../../tos/store/selectors";
import { trackProfileLoadSuccess } from "../analytics";
import {
  clearCache,
  loadBonusBeforeRemoveAccount,
  profileLoadFailure,
  profileLoadRequest,
  profileLoadSuccess,
  profileUpsert,
  removeAccountMotivation,
  startEmailValidation
} from "../store/actions";
import { upsertUserDataProcessing } from "../store/actions/userDataProcessing";
import { profileSelector } from "../store/selectors";
import { ProfileError } from "../store/types";
</file>

<file path="apps/main-app/ts/features/settings/common/sagas/userDataProcessing.ts">
import { UserDataProcessingChoiceEnum } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingChoice";
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { SagaIterator } from "redux-saga";
import { call, put, takeEvery } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { IdentityClient } from "../../../../api/IdentityClientManager";
import { SagaCallReturnType } from "../../../../types/utils";
import { convertUnknownToError, getError } from "../../../../utils/errors";
import { withRefreshApiCall } from "../../../authentication/fastLogin/saga/utils";
import {
  deleteUserDataProcessing,
  loadUserDataProcessing,
  upsertUserDataProcessing
} from "../store/actions/userDataProcessing";
</file>

<file path="apps/main-app/ts/features/settings/common/screens/LogoutScreen.tsx">
import I18n from "i18next";
import { useEffect } from "react";
⋮----
import { LoadingScreenContent } from "../../../../components/screens/LoadingScreenContent";
import { useIODispatch } from "../../../../store/hooks";
import { logoutRequest } from "../../../authentication/common/store/actions";
⋮----
const LogoutScreen = () =>
</file>

<file path="apps/main-app/ts/features/settings/common/screens/ProfileMainScreen.tsx">
import {
  ContentWrapper,
  Divider,
  IODimensions,
  ListItemAction,
  ListItemNav,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { openAuthSessionAsync } from "expo-web-browser";
import I18n from "i18next";
import {
  ComponentProps,
  memo,
  useCallback,
  useContext,
  useEffect,
  useMemo,
  useRef,
  useState
} from "react";
import {
  Alert,
  FlatList,
  ListRenderItemInfo,
  Platform,
  ScrollView
} from "react-native";
⋮----
import AppVersion from "../../../../components/AppVersion";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { LightModalContext } from "../../../../components/ui/LightModal";
import { useTabItemPressWhenScreenActive } from "../../../../hooks/useTabItemPressWhenScreenActive";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { setDebugModeEnabled } from "../../../../store/actions/debug";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import {
  appFeedbackEnabledSelector,
  appFeedbackUriConfigSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import { isDebugModeEnabledSelector } from "../../../../store/reducers/debug";
import { isDevEnv } from "../../../../utils/environment";
import { openWebUrl } from "../../../../utils/url";
import { itwIsL3EnabledSelector } from "../../../itwallet/common/store/selectors";
import { itwLifecycleIsOperationalOrValid } from "../../../itwallet/lifecycle/store/selectors";
import { ITW_ROUTES } from "../../../itwallet/navigation/routes";
import DeveloperModeSection from "../../devMode/components/DeveloperModeSection";
import {
  trackPressLogoutCancelFromIO,
  trackPressLogoutConfirmFromIO,
  trackPressLogoutFromIO
} from "../analytics";
import { ProfileMainScreenTopBanner } from "../components/ProfileMainScreenTopBanner";
import { SETTINGS_ROUTES } from "../navigation/routes";
⋮----
type ProfileNavListItem = Pick<
  ComponentProps<typeof ListItemNav>,
  "description" | "onPress" | "testID"
> & {
  isHidden?: boolean;
  label: string;
};
</file>

<file path="apps/main-app/ts/features/settings/common/store/actions/index.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { Omit } from "@pagopa/ts-commons/lib/types";
⋮----
import {
  ActionType,
  createAction,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { ProfileError } from "../types";
⋮----
type ProfileUpsertPayload = Partial<Omit<InitializedProfile, "version">>;
⋮----
type UpsertProfileSuccessPayload = {
  newValue: InitializedProfile;
  value: InitializedProfile;
};
⋮----
export enum RemoveAccountMotivationEnum {
  NEVER_USED = "neverUsed",
  NOT_SAFE = "notSafe",
  NOT_UTILS = "notUtils",
  OTHERS = "others",
  UNDEFINED = "undefined"
}
⋮----
export type RemoveAccountMotivationPayload = {
  reason: RemoveAccountMotivationEnum;
  userText?: string;
};
⋮----
export type ProfileActions =
  | ActionType<typeof acknowledgeOnEmailValidation>
  | ActionType<typeof clearCache>
  | ActionType<typeof emailValidationPollingStart>
  | ActionType<typeof emailValidationPollingStop>
  | ActionType<typeof loadBonusBeforeRemoveAccount>
  | ActionType<typeof profileFirstLogin>
  | ActionType<typeof profileLoadFailure>
  | ActionType<typeof profileLoadRequest>
  | ActionType<typeof profileLoadSuccess>
  | ActionType<typeof profileUpsert>
  | ActionType<typeof removeAccountMotivation>
  | ActionType<typeof resetProfileState>
  | ActionType<typeof setEmailCheckAtStartupFailure>
  | ActionType<typeof startEmailValidation>;
</file>

<file path="apps/main-app/ts/features/settings/common/store/actions/userDataProcessing.ts">
import { UserDataProcessing } from "@io-app/api-types/generated/definitions/identity/UserDataProcessing";
import { UserDataProcessingChoiceEnum } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingChoice";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
export type UserDataProcessingActions =
  | ActionType<typeof deleteUserDataProcessing>
  | ActionType<typeof loadUserDataProcessing>
  | ActionType<typeof resetDeleteUserDataProcessing>
  | ActionType<typeof resetUserDataProcessingRequest>
  | ActionType<typeof upsertUserDataProcessing>;
</file>

<file path="apps/main-app/ts/features/settings/common/store/reducers/index.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { isDevEnv } from "../../../../../utils/environment";
import { loginSuccess } from "../../../../authentication/common/store/actions";
import {
  profileLoadFailure,
  profileLoadRequest,
  profileLoadSuccess,
  profileUpsert,
  resetProfileState
} from "../actions";
import { ProfileError } from "../types";
import { isProfileFirstOnBoarding } from "../utils/guards";
⋮----
export type ProfileState = pot.Pot<InitializedProfile, ProfileError>;
⋮----
const reducer = (
  state: ProfileState = INITIAL_STATE,
  action: Action
): ProfileState =>
</file>

<file path="apps/main-app/ts/features/settings/common/store/reducers/userDataProcessing.ts">
import { UserDataProcessing } from "@io-app/api-types/generated/definitions/identity/UserDataProcessing";
import { UserDataProcessingChoiceEnum } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingChoice";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../../store/actions/types";
import { computedProp } from "../../../../../types/utils";
import { clearCache } from "../actions";
import {
  deleteUserDataProcessing,
  loadUserDataProcessing,
  resetDeleteUserDataProcessing,
  resetUserDataProcessingRequest,
  upsertUserDataProcessing
} from "../actions/userDataProcessing";
⋮----
export type UserDataProcessingState = {
  [key in keyof typeof UserDataProcessingChoiceEnum]: pot.Pot<
    undefined | UserDataProcessing,
    Error
  >;
};
⋮----
const userDataProcessingReducer = (
  state: UserDataProcessingState = INITIAL_STATE,
  action: Action
): UserDataProcessingState =>
</file>

<file path="apps/main-app/ts/features/settings/common/store/selectors/index.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { PushNotificationsContentTypeEnum } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatusEnum } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../../store/reducers/types";
import { capitalize } from "../../../../../utils/strings";
import { ProfileState } from "../reducers";
import {
  getProfileEmail,
  hasProfileEmail,
  isProfileEmailValidated,
  isProfileFirstOnBoarding
} from "../utils/guards";
⋮----
export const profileSelector = (state: GlobalState): ProfileState
⋮----
export const isProfileEmailValidatedSelector = (state: GlobalState)
⋮----
export const profileHasErrorSelector = (state: GlobalState)
⋮----
export const profileIsUpdatingSelector = (state: GlobalState)
⋮----
export const pushNotificationRemindersEnabledSelector = (state: GlobalState)
⋮----
export const pushNotificationPreviewEnabledSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/settings/common/store/selectors/userDataProcessing.ts">
import { GlobalState } from "../../../../../store/reducers/types";
⋮----
export const userDataProcessingSelector = (state: GlobalState)
⋮----
export const isUserDataProcessingDeleteLoadingSelector = (
  state: GlobalState
) =>
⋮----
export const isUserDataProcessingDeleteErrorSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/settings/common/store/types/index.ts">
type ProfileErrorType =
  | "PROFILE_EMAIL_IS_NOT_UNIQUE_ERROR"
  | "PROFILE_EMAIL_VALIDATION_ERROR"
  | "PROFILE_GENRIC_ERROR"
  | "PROFILE_LOAD_ERROR";
export class ProfileError extends Error
⋮----
constructor(
    message: string | undefined,
    type: ProfileErrorType = "PROFILE_GENRIC_ERROR"
)
</file>

<file path="apps/main-app/ts/features/settings/common/store/utils/guards.ts">
import { EmailAddress } from "@io-app/api-types/generated/definitions/identity/EmailAddress";
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
⋮----
export const isServicesPreferenceModeSet = (
  mode: ServicesPreferencesModeEnum | undefined
): boolean
⋮----
export const isProfileEmailValidated = (user: InitializedProfile): boolean
⋮----
export const isProfileEmailAlreadyTaken = (user: InitializedProfile): boolean
⋮----
export const isProfileFirstOnBoarding = (user: InitializedProfile): boolean
⋮----
export const hasProfileEmail = (user: InitializedProfile): boolean
⋮----
export const getProfileEmail = (
  user: InitializedProfile
): O.Option<EmailAddress>
⋮----
export const getProfileSpidEmail = (
  user: InitializedProfile
): O.Option<EmailAddress>
</file>

<file path="apps/main-app/ts/features/settings/devMode/components/__test__/DeveloperModeSection.test.tsx">
import { PublicKey } from "@pagopa/io-react-native-crypto";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { setDebugModeEnabled } from "../../../../../store/actions/debug";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import {
  lollipopRemovePublicKey,
  lollipopSetPublicKey
} from "../../../../lollipop/store/actions/lollipop";
import DeveloperModeSection from "../DeveloperModeSection";
⋮----
const renderComponent = (publicKey: PublicKey | undefined) =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/components/DeveloperModeSection.tsx">
import {
  ContentWrapper,
  Divider,
  H2,
  IOButton,
  IOButtonBlockSpecificProps,
  IODimensions,
  IOToast,
  ListItemHeader,
  ListItemInfoCopy,
  ListItemNav,
  ListItemSwitch,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import AsyncStorage from "@react-native-async-storage/async-storage";
import I18n from "i18next";
import { ComponentProps, useContext } from "react";
import { Alert, FlatList, ListRenderItemInfo, StyleSheet } from "react-native";
⋮----
import { AlertModal } from "../../../../components/ui/AlertModal";
import { LightModalContext } from "../../../../components/ui/LightModal";
import { isPlaygroundsEnabled } from "../../../../config";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { setDebugModeEnabled } from "../../../../store/actions/debug";
import {
  preferencesIdPayTestSetEnabled,
  preferencesPagoPaTestEnvironmentSetEnabled
} from "../../../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isPnRemoteEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig.ts";
import { isDebugModeEnabledSelector } from "../../../../store/reducers/debug";
import {
  isIdPayLocallyEnabledSelector,
  isPagoPATestEnabledSelector
} from "../../../../store/reducers/persistedPreferences";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { getDeviceId } from "../../../../utils/device";
import { isDevEnv, isLocalEnv } from "../../../../utils/environment";
import {
  setActiveSessionLoginLocalFlag,
  setStartActiveSessionLogin
} from "../../../authentication/activeSessionLogin/store/actions/index.ts";
import { isActiveSessionLoginLocallyEnabledSelector } from "../../../authentication/activeSessionLogin/store/selectors/index.ts";
import { AUTHENTICATION_ROUTES } from "../../../authentication/common/navigation/routes.ts";
import { sessionExpired } from "../../../authentication/common/store/actions";
import {
  sessionTokenSelector,
  walletTokenSelector
} from "../../../authentication/common/store/selectors";
import { isFastLoginEnabledSelector } from "../../../authentication/fastLogin/store/selectors";
import { ITW_ROUTES } from "../../../itwallet/navigation/routes.ts";
import { lollipopPublicKeySelector } from "../../../lollipop/store/reducers/lollipop";
import { toThumbprint } from "../../../lollipop/utils/crypto";
import { notificationsInstallationSelector } from "../../../pushNotifications/store/reducers/installation";
import { SETTINGS_ROUTES } from "../../common/navigation/routes";
import { clearCache } from "../../common/store/actions";
import ExperimentalDesignEnableSwitch from "./ExperimentalDesignEnableSwitch";
⋮----
type DevActionButton = Pick<
  IOButtonBlockSpecificProps,
  "color" | "label" | "onPress"
> & {
  condition: boolean;
};
⋮----
type DevDataCopyListItem = Pick<
  ComponentProps<typeof ListItemInfoCopy>,
  "label" | "onPress" | "testID"
> & {
  condition?: boolean;
  value: string;
};
⋮----
type PlaygroundsNavListItem = Pick<
  ComponentProps<typeof ListItemNav>,
  "description" | "onPress" | "testID"
> & {
  condition?: boolean;
  value: string;
};
⋮----
type TestEnvironmentsListItem = Pick<
  ComponentProps<typeof ListItemSwitch>,
  | "description"
  | "disabled"
  | "label"
  | "onSwitchValueChange"
  | "testID"
  | "value"
>;
⋮----
const handleClearCachePress = () =>
⋮----
const dumpAsyncStorage = () =>
⋮----
const renderDevActionButton = ({
    item: { color = "danger", label, onPress }
  }: ListRenderItemInfo<DevActionButton>) => (
    <IOButton
... (37 lines truncated)
</file>

<file path="apps/main-app/ts/features/settings/devMode/components/ExperimentalDesignEnableSwitch.tsx">
import { ListItemSwitch, useIOExperimentalDesign } from "@io-app/design-system";
import AsyncStorage from "@react-native-async-storage/async-storage";
import I18n from "i18next";
⋮----
import { DS_PERSISTENCE_KEY } from "../../../../common/context/DSExperimentalContext";
import { preferencesExperimentalDesignEnabled } from "../../../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isExperimentalDesignEnabledSelector } from "../../../../store/reducers/persistedPreferences";
⋮----
const ExperimentalDesignEnableSwitch = () =>
⋮----
const onSwitchValueChange = (
    internalIsExperimentalDesignEnabled: boolean
) =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/components/ReadStatusComponent.tsx">
import {
  IOColors,
  IOPictograms,
  IOText,
  Pictogram
} from "@io-app/design-system";
import { Platform, StyleSheet } from "react-native";
import Animated, { LinearTransition } from "react-native-reanimated";
⋮----
import { CircularProgress } from "../../../../../../components/ui/CircularProgress";
import { ReadStatus } from "../types/ReadStatus";
⋮----
type ReadStatusComponentProps = {
  progress?: number;
  status: ReadStatus;
  step?: string;
};
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/navigation/CiePlaygroundsNavigator.tsx">
import { CieLogger } from "@pagopa/io-react-native-cie";
import { useNavigation } from "@react-navigation/native";
import {
  createStackNavigator,
  StackNavigationProp
} from "@react-navigation/stack";
import { useEffect } from "react";
⋮----
import { isGestureEnabled } from "../../../../../../utils/navigation";
import { CieAttributesScreen } from "../screens/CieAttributesScreen";
import { CieAuthenticationScreen } from "../screens/CieAuthenticationScreen";
import { CieCertificateReadingScreen } from "../screens/CieCertificateScreen";
import { CieInternalAuthMrtdScreen } from "../screens/CieInternalAuthMrtdScreen";
import { CieInternalAuthScreen } from "../screens/CieInternalAuthScreen";
import { CieMrtdScreen } from "../screens/CieMrtdScreen";
import { CiePlaygrounds } from "../screens/CiePlaygrounds";
import { CieResultScreen } from "../screens/CieResultScreen";
import { CiePlaygroundsParamsList } from "./CiePlaygroundsParamsList";
import { CIE_PLAYGROUNDS_ROUTES } from "./routes";
⋮----
export const CiePlaygroundsNavigator = () =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/navigation/CiePlaygroundsParamsList.ts">
import { CIE_PLAYGROUNDS_ROUTES } from "./routes";
⋮----
export type CiePlaygroundsParamsList = {
  [CIE_PLAYGROUNDS_ROUTES.ATTRIBUTES]: undefined;
  [CIE_PLAYGROUNDS_ROUTES.AUTHENTICATION]: undefined;
  [CIE_PLAYGROUNDS_ROUTES.CERTIFICATE_READING]: undefined;
  [CIE_PLAYGROUNDS_ROUTES.INTERNAL_AUTH]: undefined;
  [CIE_PLAYGROUNDS_ROUTES.INTERNAL_AUTH_MRTD]: undefined;
  [CIE_PLAYGROUNDS_ROUTES.MAIN]: undefined;
  [CIE_PLAYGROUNDS_ROUTES.MRTD]: undefined;
  [CIE_PLAYGROUNDS_ROUTES.RESULT]: {
    data: any;
    isError?: boolean;
    title: string;
  };
};
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/screens/CieAttributesScreen.tsx">
import { IOButton, VSpacer } from "@io-app/design-system";
import { CieManager, type NfcEvent } from "@pagopa/io-react-native-cie";
import { useEffect, useState } from "react";
import { Alert, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { useHeaderSecondLevel } from "../../../../../../hooks/useHeaderSecondLevel";
import { ReadStatusComponent } from "../components/ReadStatusComponent";
import { useCieNavigation } from "../navigation/CiePlaygroundsNavigator";
import { CIE_PLAYGROUNDS_ROUTES } from "../navigation/routes";
import { ReadStatus } from "../types/ReadStatus";
⋮----
export const CieAttributesScreen = () =>
⋮----
const handleStartReading = async () =>
⋮----
const handleStopReading = () =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/screens/CieAuthenticationScreen.tsx">
import {
  IOButton,
  ListItemHeader,
  OTPInput,
  VSpacer
} from "@io-app/design-system";
import { CieManager, NfcEvent } from "@pagopa/io-react-native-cie";
import { useHeaderHeight } from "@react-navigation/elements";
import I18n from "i18next";
import { createRef, useEffect, useState } from "react";
import {
  Alert,
  Keyboard,
  KeyboardAvoidingView,
  Platform,
  StyleSheet,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import WebView, { WebViewNavigation } from "react-native-webview";
⋮----
import LoadingSpinnerOverlay from "../../../../../../components/LoadingSpinnerOverlay";
import { useHeaderSecondLevel } from "../../../../../../hooks/useHeaderSecondLevel";
import { useScreenEndMargin } from "../../../../../../hooks/useScreenEndMargin";
import { ReadStatusComponent } from "../components/ReadStatusComponent";
import { ReadStatus } from "../types/ReadStatus";
⋮----
type CiewWebViewProps = {
  onAuthUrlChange: (url: string) => void;
  uri: string;
};
⋮----
const AuthenticationUrlWebView = ({
  uri,
  onAuthUrlChange
}: CiewWebViewProps) =>
⋮----
setCode(value);
⋮----
I18n.t("global.accessibility.otpInput.valueText",
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/screens/CieCertificateScreen.tsx">
import {
  IOButton,
  ListItemHeader,
  OTPInput,
  VSpacer
} from "@io-app/design-system";
import { CieManager, type NfcEvent } from "@pagopa/io-react-native-cie";
import { useHeaderHeight } from "@react-navigation/elements";
import I18n from "i18next";
import { useEffect, useState } from "react";
import {
  Alert,
  Keyboard,
  KeyboardAvoidingView,
  StyleSheet,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { useHeaderSecondLevel } from "../../../../../../hooks/useHeaderSecondLevel";
import { useScreenEndMargin } from "../../../../../../hooks/useScreenEndMargin";
import { ReadStatusComponent } from "../components/ReadStatusComponent";
import { useCieNavigation } from "../navigation/CiePlaygroundsNavigator";
import { CIE_PLAYGROUNDS_ROUTES } from "../navigation/routes";
import { ReadStatus } from "../types/ReadStatus";
⋮----
const handleStartReading = async () =>
⋮----
const handleStopReading = () =>
⋮----
const onPinChanged = (value: string) =>
⋮----
I18n.t("global.accessibility.inputDigitCounter",
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/screens/CieInternalAuthMrtdScreen.tsx">
import {
  IOButton,
  ListItemHeader,
  ListItemSwitch,
  OTPInput,
  TextInput,
  VSpacer
} from "@io-app/design-system";
import {
  CieManager,
  InternalAuthAndMrtdResponse,
  type NfcEvent
} from "@pagopa/io-react-native-cie";
import { useHeaderHeight } from "@react-navigation/elements";
import { useEffect, useState } from "react";
import {
  Alert,
  Keyboard,
  KeyboardAvoidingView,
  StyleSheet,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { useDebugInfo } from "../../../../../../hooks/useDebugInfo";
import { useHeaderSecondLevel } from "../../../../../../hooks/useHeaderSecondLevel";
import { useScreenEndMargin } from "../../../../../../hooks/useScreenEndMargin";
import { useIODispatch, useIOSelector } from "../../../../../../store/hooks";
import { isAarInAppDelegationRemoteEnabledSelector } from "../../../../../../store/reducers/backendStatus/remoteConfig";
import { testAarCreateMandate } from "../../../../../pn/aar/store/actions";
import {
  isRequestingSendMandateSelector,
  sendMandateErrorSelector,
  sendVerificationCodeSelector
} from "../../../../../pn/aar/store/reducers/tempAarMandate";
import { ReadStatusComponent } from "../components/ReadStatusComponent";
import { useCieNavigation } from "../navigation/CiePlaygroundsNavigator";
import { CIE_PLAYGROUNDS_ROUTES } from "../navigation/routes";
import { ReadStatus } from "../types/ReadStatus";
import { encodeChallenge } from "../utils/encoding";
⋮----
const toggleEncodingSwitch = ()
⋮----
// Start listening for NFC events
⋮----
const handleStartReading = async () =>
⋮----
const handleStopReading = () =>
⋮----
const onCanChanged = (value: string) =>
⋮----
disabled=
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/screens/CieInternalAuthScreen.tsx">
import {
  IOButton,
  ListItemSwitch,
  TextInput,
  VSpacer
} from "@io-app/design-system";
import {
  CieManager,
  InternalAuthResponse,
  type NfcEvent
} from "@pagopa/io-react-native-cie";
import { useHeaderHeight } from "@react-navigation/elements";
import { useEffect, useState } from "react";
import {
  Alert,
  Keyboard,
  KeyboardAvoidingView,
  StyleSheet,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { useHeaderSecondLevel } from "../../../../../../hooks/useHeaderSecondLevel";
import { useScreenEndMargin } from "../../../../../../hooks/useScreenEndMargin";
import { ReadStatusComponent } from "../components/ReadStatusComponent";
import { useCieNavigation } from "../navigation/CiePlaygroundsNavigator";
import { CIE_PLAYGROUNDS_ROUTES } from "../navigation/routes";
import { ReadStatus } from "../types/ReadStatus";
import { encodeChallenge } from "../utils/encoding";
⋮----
const toggleEncodingSwitch = ()
⋮----
const handleStartReading = async () =>
⋮----
const handleStopReading = () =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/screens/CieMrtdScreen.tsx">
import {
  IOButton,
  ListItemHeader,
  ListItemSwitch,
  OTPInput,
  VSpacer
} from "@io-app/design-system";
import {
  CieManager,
  MrtdResponse,
  type NfcEvent
} from "@pagopa/io-react-native-cie";
import { useHeaderHeight } from "@react-navigation/elements";
import { useEffect, useState } from "react";
import {
  Alert,
  Keyboard,
  KeyboardAvoidingView,
  StyleSheet,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { useHeaderSecondLevel } from "../../../../../../hooks/useHeaderSecondLevel";
import { useScreenEndMargin } from "../../../../../../hooks/useScreenEndMargin";
import { ReadStatusComponent } from "../components/ReadStatusComponent";
import { useCieNavigation } from "../navigation/CiePlaygroundsNavigator";
import { CIE_PLAYGROUNDS_ROUTES } from "../navigation/routes";
import { ReadStatus } from "../types/ReadStatus";
⋮----
const toggleEncodingSwitch = ()
⋮----
const handleStartReading = async () =>
⋮----
const handleStopReading = () =>
⋮----
const onCanChanged = (value: string) =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/screens/CiePlaygrounds.tsx">
import {
  Divider,
  ListItemHeader,
  ListItemInfo,
  ListItemNav,
  useIOToast,
  VStack
} from "@io-app/design-system";
import { CieLogger, CieUtils } from "@pagopa/io-react-native-cie";
import { Fragment, useCallback, useState } from "react";
import { Platform } from "react-native";
⋮----
import { IOScrollView } from "../../../../../../components/ui/IOScrollView";
import { useAppStateActive } from "../../../../../../hooks/useAppStateActive";
import { useHeaderSecondLevel } from "../../../../../../hooks/useHeaderSecondLevel";
import { useCieNavigation } from "../navigation/CiePlaygroundsNavigator";
import { CIE_PLAYGROUNDS_ROUTES } from "../navigation/routes";
⋮----
const obtainLogs = async () =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/screens/CieResultScreen.tsx">
import { IOColors, IOText } from "@io-app/design-system";
⋮----
import { Alert, Platform, Share, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { IOScrollView } from "../../../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../../../hooks/useHeaderSecondLevel";
import { IOStackNavigationRouteProps } from "../../../../../../navigation/params/AppParamsList";
import { CiePlaygroundsParamsList } from "../navigation/CiePlaygroundsParamsList";
⋮----
export type Props = IOStackNavigationRouteProps<
  CiePlaygroundsParamsList,
  "CIE_PLAYGROUNDS_RESULT"
>;
⋮----
const handleCopy = () =>
⋮----
const handleShare = async () =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/types/ReadStatus.ts">
export type ReadStatus = "error" | "idle" | "reading" | "success";
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/Cie/utils/encoding.ts">
export function encodeChallenge(
  challenge: string,
  encoding: "base64" | "hex"
): string
⋮----
// eslint-disable-next-line functional/no-let
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/AppFeedbackPlayground.tsx">
import { Body, IOButton, VSpacer } from "@io-app/design-system";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useAppFeedbackContext } from "../../../appReviews/components/AppFeedbackProvider";
import { clearFeedbackDatas } from "../../../appReviews/store/actions";
import {
  appReviewNegativeFeedbackLogSelector,
  appReviewPositiveFeedbackLogSelector
} from "../../../appReviews/store/selectors";
⋮----
export const AppFeedbackPlayground = () =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/BottomSheetPlayground.tsx">
import {
  Body,
  FooterActions,
  H4,
  IOButton,
  IOColors,
  useFooterActionsMeasurements,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import { ModalBottomSheet } from "@swmansion/react-native-bottom-sheet";
import { useState } from "react";
import { ScrollView, StyleSheet, View } from "react-native";
import { useSafeAreaFrame } from "react-native-safe-area-context";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/CgnLandingPlayground.tsx">
import {
  ContentWrapper,
  FooterActionsInline,
  IODimensions,
  TextInput,
  useFooterActionsInlineMeasurements,
  VSpacer,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { useState } from "react";
import { View } from "react-native";
import { WebViewSourceUri } from "react-native-webview/lib/WebViewTypes";
⋮----
import WebviewComponent from "../../../../components/WebviewComponent";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/GuidedTourPlayground.tsx">
import {
  Body,
  H6,
  IOButton,
  IOColors,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { useHeaderHeight } from "@react-navigation/elements";
import { useCallback, useEffect } from "react";
import { Dimensions, Platform, StyleSheet, View } from "react-native";
import Animated, {
  useAnimatedRef,
  useScrollOffset
} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { GuidedTour } from "../../../tour/components/GuidedTour";
import { useTourContext } from "../../../tour/components/TourProvider";
import { useGuidedTourRegion } from "../../../tour/components/useGuidedTourRegion";
import {
  resetTourCompletedAction,
  startTourAction
} from "../../../tour/store/actions";
import { isTourCompletedSelector } from "../../../tour/store/selectors";
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/IdPayCodePlayground.tsx">
import {
  ContentWrapper,
  Divider,
  ListItemNav,
  TextInput,
  VSpacer
} from "@io-app/design-system";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { useNavigation } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import { useState } from "react";
import { ScrollView } from "react-native";
⋮----
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { IdPayCodeRoutes } from "../../../idpay/code/navigation/routes";
⋮----
const navigateToOnboarding = () =>
⋮----
const navigateToRenew = () =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/IdPayOnboardingPlayground.tsx">
import {
  Body,
  BodyMonospace,
  BodySmall,
  H4,
  IOColors,
  IODimensions,
  PressableListItemBase,
  TextInput,
  VSpacer
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import { useState } from "react";
import { Button, ScrollView, View } from "react-native";
⋮----
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../../navigation/params/AppParamsList";
import { isDevEnv } from "../../../../utils/environment";
import { IdPayOnboardingRoutes } from "../../../idpay/onboarding/navigation/routes";
⋮----
const navigateToIDPayOnboarding = (serviceId: string) =>
⋮----
const handleServiceSubmit = () =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/IOMarkdownPlayground.tsx">
import {
  ContentWrapper,
  HSpacer,
  IconButton,
  IOColors,
  IODimensions,
  ListItemSwitch,
  VSpacer
} from "@io-app/design-system";
import { useHeaderHeight } from "@react-navigation/elements";
import { LinearGradient } from "expo-linear-gradient";
import { useState } from "react";
import {
  Keyboard,
  KeyboardAvoidingView,
  Platform,
  ScrollView,
  StyleSheet,
  TextInput,
  View
} from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import IOMarkdown from "../../../../components/IOMarkdown";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
import { generateMessagesAndServicesRules } from "../../../common/components/IOMarkdown/customRules";
import IOMarkdownSuggestions from "./IOMarkdownSuggestions";
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/IOMarkdownSuggestions.tsx">
import { HSpacer, IOButton, VSpacer } from "@io-app/design-system";
import { Fragment } from "react";
import { View } from "react-native";
⋮----
type Props = {
  setContent: (content: string) => void;
  suggestions: Array<[Suggestion, Suggestion]>;
};
⋮----
type Suggestion = {
  content: string;
  label: string;
};
⋮----
setContent(first.content);
⋮----
setContent("");
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/NfcPlayground.tsx">
import {
  Divider,
  ListItemHeader,
  ListItemInfo,
  VStack
} from "@io-app/design-system";
import { useState } from "react";
import { Platform, View } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useDebugInfo } from "../../../../hooks/useDebugInfo";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import {
  getNfcAntennaInfo,
  isHceSupported,
  NfcAntennaInfo
} from "../../../../utils/nfc";
⋮----
export const NfcPlayground = () =>
</file>

<file path="apps/main-app/ts/features/settings/devMode/playgrounds/SendPlaygroundScreen.tsx">
import {
  Body,
  Divider,
  IOButton,
  IOColors,
  ListItemHeader,
  ListItemInfo,
  ListItemInfoCopy,
  ListItemSwitch,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useEffect, useState } from "react";
import {
  Appearance,
  TextInput as RNTextInput,
  StyleSheet,
  View
} from "react-native";
⋮----
import { IOScrollView } from "../../../../components/ui/IOScrollView";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { preferencesPnTestEnvironmentSetEnabled } from "../../../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isSendLollipopPlaygroundEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isPnTestEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import { sendLollipopLambdaAction } from "../../../pn/lollipopLambda/store/actions";
import {
  isSendLollipopLambdaLoading,
  sendLollipopLambdaErrorReason,
  sendLollipopLambdaResponseBodyString,
  sendLollipopLambdaResponseStatusCode
} from "../../../pn/lollipopLambda/store/selectors";
⋮----
const sendLollipopLambdaRequest = (httpVerb: "Get" | "Post") =>
</file>

<file path="apps/main-app/ts/features/settings/preferences/screens/AppearancePreferenceScreen.tsx">
import {
  IOColors,
  IOThemeDark,
  IOThemeLight,
  ListItemHeader,
  RadioGroup,
  useIONewTypeface,
  useIOThemeContext,
  VStack
} from "@io-app/design-system";
import { setNavigationBarColor } from "@io-app/expo-navigation-bar-manager";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { useFocusEffect } from "@react-navigation/native";
import { constVoid } from "fp-ts/lib/function";
import I18n from "i18next";
import { ReactElement, useState } from "react";
import { Appearance, Platform, useColorScheme, View } from "react-native";
⋮----
import { FONT_PERSISTENCE_KEY } from "../../../../common/context/DSTypefaceContext";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import {
  ColorModeChoice,
  THEME_PERSISTENCE_KEY
} from "../../../../hooks/useAppThemeConfiguration";
import {
  preferencesFontSet,
  preferencesThemeSet,
  TypefaceChoice
} from "../../../../store/actions/persistedPreferences";
import { useIODispatch, useIOStore } from "../../../../store/hooks";
import {
  trackAppearancePreferenceScreenView,
  trackAppearancePreferenceThemeUpdate,
  trackAppearancePreferenceTypefaceUpdate
} from "../../common/analytics";
⋮----
export const updateNavigationBarColor = (theme?: ColorModeChoice) =>
⋮----
const handleTypefaceChange = (choice: TypefaceChoice) =>
⋮----
const handleColorModeChange = (choice: ColorModeChoice) =>
</file>

<file path="apps/main-app/ts/features/settings/preferences/screens/CalendarsPreferencesScreen.tsx">
import I18n from "i18next";
import { useCallback, useState } from "react";
⋮----
import CalendarsListContainer from "../../../../components/CalendarsListContainer";
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import {
  preferredCalendarRemoveSuccess,
  preferredCalendarSaveSuccess
} from "../../../../store/actions/persistedPreferences";
import { useIODispatch } from "../../../../store/hooks";
</file>

<file path="apps/main-app/ts/features/settings/preferences/screens/EmailForwardingScreen.tsx">
import { ListItemSwitch, useIOToast } from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import _ from "lodash";
import { useCallback, useEffect, useRef, useState } from "react";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { customEmailChannelSetEnabled } from "../../../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { usePrevious } from "../../../../utils/hooks/usePrevious";
import { profileUpsert } from "../../common/store/actions";
import {
  isEmailEnabledSelector,
  profileEmailSelector,
  profileSelector
} from "../../common/store/selectors";
</file>

<file path="apps/main-app/ts/features/settings/preferences/screens/LanguagesPreferencesScreen.tsx">
import {
  BodySmall,
  ListItemHeader,
  RadioGroup,
  RadioItem,
  useIOToast,
  VSpacer,
  VStack
} from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import _ from "lodash";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { Alert, View } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { availableTranslations, Locales, setLocale } from "../../../../i18n";
import { preferredLanguageSaveSuccess } from "../../../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { preferredLanguageSelector } from "../../../../store/reducers/persistedPreferences";
import { usePrevious } from "../../../../utils/hooks/usePrevious";
import {
  fromLocaleToPreferredLanguage,
  fromPreferredLanguageToLocale
} from "../../../../utils/locale";
import { profileUpsert } from "../../common/store/actions";
import { profileSelector } from "../../common/store/selectors";
⋮----
type AppLocaleId = `app-locale-${Locales}`;
⋮----
const getLocaleNativeName = (locale: Locales): string =>
⋮----
const getLocaleName = (locale: Locales): string =>
</file>

<file path="apps/main-app/ts/features/settings/preferences/screens/NotificationsPreferencesScreen.tsx">
import { PushNotificationsContentTypeEnum } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatusEnum } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
import { ContentWrapper, useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect, useState } from "react";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { getFlowType } from "../../../../utils/analytics";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { ProfileNotificationSettings } from "../../../pushNotifications/components/ProfileNotificationsSettings";
import {
  trackNotificationScreen,
  trackNotificationsPreferencesPreviewStatus,
  trackNotificationsPreferencesReminderStatus
} from "../../common/analytics";
import { profileUpsert } from "../../common/store/actions";
import {
  profileHasErrorSelector,
  profileIsUpdatingSelector,
  pushNotificationPreviewEnabledSelector,
  pushNotificationRemindersEnabledSelector
} from "../../common/store/selectors";
</file>

<file path="apps/main-app/ts/features/settings/preferences/screens/PreferencesScreen.tsx">
import { Divider, IODimensions, ListItemNav } from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
⋮----
import { ComponentProps, useCallback, useRef } from "react";
import { Alert, FlatList, ListRenderItemInfo, View } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { setAccessibilityFocus } from "../../../../utils/accessibility";
import { openAppSettings } from "../../../../utils/appSettings";
import { checkAndRequestPermission } from "../../../../utils/calendar";
import { requestWriteCalendarPermission } from "../../../../utils/permission";
import { SETTINGS_ROUTES } from "../../common/navigation/routes";
⋮----
type PreferencesNavListItem = Pick<
  ComponentProps<typeof ListItemNav>,
  "description" | "onPress" | "testID"
> & {
  value: string;
};
⋮----
const checkPermissionThenGoCalendar = async () =>
⋮----
const renderPreferencesNavItem = ({
    item: { value, description, onPress, testID }
  }: ListRenderItemInfo<PreferencesNavListItem>) => (
    <ListItemNav
      accessibilityLabel={`${value} ${description}`}
      description={description}
      label={value}
      onPress={onPress}
      testID={testID}
    />
  );
⋮----
keyExtractor=
</file>

<file path="apps/main-app/ts/features/settings/preferences/screens/ServicesPreferenceScreen.tsx">
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
import { useIOToast } from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { ReactElement, useCallback, useEffect } from "react";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import { GlobalState } from "../../../../store/reducers/types";
import { getFlowType } from "../../../../utils/analytics";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { usePrevious } from "../../../../utils/hooks/usePrevious";
import {
  trackServiceConfiguration,
  trackServiceConfigurationScreen
} from "../../common/analytics";
import { profileUpsert } from "../../common/store/actions";
import {
  profileSelector,
  profileServicePreferencesModeSelector
} from "../../common/store/selectors";
import ServicesContactComponent from "../shared/components/ServicesContactComponent";
import { useManualConfigBottomSheet } from "../shared/hooks/useManualConfigBottomSheet";
</file>

<file path="apps/main-app/ts/features/settings/preferences/shared/__test__/ServicesContactComponent.test.tsx">
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import ServicesContactComponent from "../components/ServicesContactComponent";
⋮----
const renderComponent = (mode?: ServicesPreferencesModeEnum) =>
</file>

<file path="apps/main-app/ts/features/settings/preferences/shared/__test__/useManualConfigBottomSheet.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { useManualConfigBottomSheet } from "../hooks/useManualConfigBottomSheet";
⋮----
const renderComponent = (onConfirm?: () => void) =>
⋮----
const WrapperComponent = () =>
</file>

<file path="apps/main-app/ts/features/settings/preferences/shared/components/ServicesContactComponent.tsx">
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
import { IOMarkdownLite, RadioGroup } from "@io-app/design-system";
import I18n from "i18next";
import { ReactElement, useCallback, useEffect, useState } from "react";
⋮----
import { usePrevious } from "../../../../../utils/hooks/usePrevious";
⋮----
type Props = {
  mode?: ServicesPreferencesModeEnum;
  onSelectMode: (mode: ServicesPreferencesModeEnum) => void;
  showBadge?: boolean;
};
⋮----
const ServicesContactComponent = (props: Props): ReactElement =>
</file>

<file path="apps/main-app/ts/features/settings/preferences/shared/hooks/useManualConfigBottomSheet.tsx">
import { Body, FooterActionsInline } from "@io-app/design-system";
import I18n from "i18next";
import { ReactElement } from "react";
⋮----
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
⋮----
const ManualConfigConfirm = (): ReactElement => (
  <Body>
    {I18n.t("services.optIn.preferences.manualConfig.bottomSheet.body")}
  </Body>
);
</file>

<file path="apps/main-app/ts/features/settings/privacy/components/__test__/TosWebviewErrorComponent.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import TosWebviewErrorComponent from "../TosWebviewErrorComponent";
⋮----
const renderComponent = (handleRetryProp?: () => void) =>
</file>

<file path="apps/main-app/ts/features/settings/privacy/components/TosWebviewErrorComponent.tsx">
import {
  ContentWrapper,
  FooterActions,
  H3,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
⋮----
type TosWebviewErrorComponentProps = {
  handleRetry: () => void;
};
</file>

<file path="apps/main-app/ts/features/settings/privacy/screens/DownloadProfileDataScreen.tsx">
import { UserDataProcessingChoiceEnum } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingChoice";
import {
  ContentWrapper,
  IOMarkdown,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { useCallback, useEffect } from "react";
import { AccessibilityInfo } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isScreenReaderEnabledSelector } from "../../../../store/reducers/preferences";
import { usePrevious } from "../../../../utils/hooks/usePrevious";
import { SETTINGS_ROUTES } from "../../common/navigation/routes";
import { upsertUserDataProcessing } from "../../common/store/actions/userDataProcessing";
import { userDataProcessingSelector } from "../../common/store/selectors/userDataProcessing";
</file>

<file path="apps/main-app/ts/features/settings/privacy/screens/PrivacyMainScreen.tsx">
import { UserDataProcessingChoiceEnum } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingChoice";
import { UserDataProcessingStatusEnum } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingStatus";
import {
  Divider,
  IODimensions,
  IOToast,
  ListItemNav
} from "@io-app/design-system";
⋮----
import I18n from "i18next";
import {
  ComponentProps,
  useCallback,
  useEffect,
  useMemo,
  useRef,
  useState
} from "react";
import { Alert, AlertButton, FlatList, ListRenderItemInfo } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { IOStackNavigationProp } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { usePrevious } from "../../../../utils/hooks/usePrevious";
import { SettingsParamsList } from "../../common/navigation/params/SettingsParamsList";
import { SETTINGS_ROUTES } from "../../common/navigation/routes";
import {
  deleteUserDataProcessing,
  loadUserDataProcessing
} from "../../common/store/actions/userDataProcessing";
import { userDataProcessingSelector } from "../../common/store/selectors/userDataProcessing";
⋮----
type Props = {
  navigation: IOStackNavigationProp<SettingsParamsList, "PROFILE_PRIVACY_MAIN">;
};
⋮----
const getRequestProcessingAlertTitle = () => (
⋮----
const getRequestProcessingAlertSubtitle = () => (
⋮----
type PrivacyNavListItem = Pick<
  ComponentProps<typeof ListItemNav>,
  "description" | "onPress" | "testID" | "topElement"
> & {
  value: string;
};
⋮----
const prevIsLoading = (choice: UserDataProcessingChoiceEnum)
const someWereLoading = (choices: Array<UserDataProcessingChoiceEnum>)
const someHasError = (choices: Array<UserDataProcessingChoiceEnum>)
⋮----
const checkUpdate = (
      errorMessage: string,
      choices: Array<UserDataProcessingChoiceEnum>
) =>
</file>

<file path="apps/main-app/ts/features/settings/privacy/screens/RemoveAccountDetailsScreen.tsx">
import {
  ContentWrapper,
  H6,
  IOButton,
  IODimensions,
  RadioGroup,
  RadioItem,
  TextInput,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import { StackActions } from "@react-navigation/native";
import I18n from "i18next";
import {
  ComponentRef,
  memo,
  useCallback,
  useEffect,
  useRef,
  useState
} from "react";
import { AccessibilityInfo, Alert, Keyboard, View } from "react-native";
import { KeyboardStickyView } from "react-native-keyboard-controller";
import {
  SafeAreaView,
  useSafeAreaInsets
} from "react-native-safe-area-context";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { shufflePinPadOnPayment } from "../../../../config";
import NavigationService from "../../../../navigation/NavigationService";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../utils/accessibility";
import { withKeyboard } from "../../../../utils/keyboard";
import { isCgnEnrolledSelector } from "../../../bonus/cgn/store/reducers/details";
import { identificationRequest } from "../../../identification/store/actions";
import { useInputFocus } from "../../../payments/checkout/hooks/useInputFocus";
import {
  removeAccountMotivation,
  RemoveAccountMotivationEnum
} from "../../common/store/actions";
import { resetDeleteUserDataProcessing } from "../../common/store/actions/userDataProcessing";
import {
  isUserDataProcessingDeleteErrorSelector,
  isUserDataProcessingDeleteLoadingSelector
} from "../../common/store/selectors/userDataProcessing";
⋮----
type FooterButtonProps = {
  buttonRef?: React.RefObject<View>;
  isLoading: boolean;
  onPress: () => void;
};
</file>

<file path="apps/main-app/ts/features/settings/privacy/screens/RemoveAccountInfoScreen.tsx">
import {
  Banner,
  ContentWrapper,
  IOMarkdownLite,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
⋮----
import { IOScrollViewActions } from "../../../../components/ui/IOScrollView";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch } from "../../../../store/hooks";
import { SETTINGS_ROUTES } from "../../common/navigation/routes";
import { loadBonusBeforeRemoveAccount } from "../../common/store/actions";
</file>

<file path="apps/main-app/ts/features/settings/privacy/screens/RemoveAccountSuccessScreen.tsx">
import I18n from "i18next";
import { useMemo } from "react";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton";
import { useIODispatch } from "../../../../store/hooks";
import { logoutRequest } from "../../../authentication/common/store/actions";
⋮----
const RemoveAccountSuccess = () =>
</file>

<file path="apps/main-app/ts/features/settings/privacy/screens/ShareDataScreen.tsx">
import { ContentWrapper, useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useEffect, useMemo, useRef } from "react";
import { AccessibilityInfo, View } from "react-native";
⋮----
import { IOScrollViewActions } from "../../../../components/ui/IOScrollView";
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { setMixpanelEnabled } from "../../../../store/actions/mixpanel";
import {
  useIODispatch,
  useIOSelector,
  useIOStore
} from "../../../../store/hooks";
import { isMixpanelEnabled as isMixpanelEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { getFlowType } from "../../../../utils/analytics";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { trackMixpanelScreen } from "../../common/analytics";
import {
  TrackingInfo,
  trackMixpanelDeclined,
  trackMixpanelNotNowSelected,
  trackMixpanelSetEnabled,
  trackMixPanelTrackingInfo
} from "../../common/analytics/mixpanel/mixpanelAnalytics";
import { ShareDataComponent } from "../shared/components/ShareDataComponent";
import { useConfirmOptOutBottomSheet } from "../shared/hooks/useConfirmOptOutBottomSheet";
</file>

<file path="apps/main-app/ts/features/settings/privacy/screens/TosScreen.tsx">
import { ContentWrapper, H2 } from "@io-app/design-system";
import I18n from "i18next";
import { useState } from "react";
⋮----
import LoadingSpinnerOverlay from "../../../../components/LoadingSpinnerOverlay";
import { useHeaderSecondLevel } from "../../../../hooks/useHeaderSecondLevel";
import { useIOSelector } from "../../../../store/hooks";
import { getFlowType } from "../../../../utils/analytics";
import { useOnFirstRender } from "../../../../utils/hooks/useOnFirstRender";
import { tosConfigSelector } from "../../../tos/store/selectors";
import { trackTosScreen } from "../shared/analytics";
import TosWebviewComponent from "../shared/components/TosWebviewComponent";
⋮----
const handleLoadEnd = () =>
⋮----
const handleReload = () =>
</file>

<file path="apps/main-app/ts/features/settings/privacy/shared/analytics/__test__/analytics.test.ts">
import {
  trackTosAccepted,
  trackTosScreen,
  trackToSWebViewError,
  trackToSWebViewErrorRetry
} from "..";
import { mixpanelTrack } from "../../../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../../../mixpanelConfig/profileProperties";
import { GlobalState } from "../../../../../../store/reducers/types";
</file>

<file path="apps/main-app/ts/features/settings/privacy/shared/analytics/index.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { updateMixpanelProfileProperties } from "../../../../../mixpanelConfig/profileProperties";
import { GlobalState } from "../../../../../store/reducers/types";
import { buildEventProperties, FlowType } from "../../../../../utils/analytics";
⋮----
export async function trackTosAccepted(
  acceptedTosVersion: number,
  flow: FlowType,
  state: GlobalState
)
⋮----
export function trackTosScreen(flow: FlowType)
⋮----
export function trackToSWebViewError(flow: FlowType)
export function trackToSWebViewErrorRetry(flow: FlowType)
</file>

<file path="apps/main-app/ts/features/settings/privacy/shared/components/__test__/ShareDataComponent.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../../store/actions/application";
import { appReducer } from "../../../../../../store/reducers";
import { GlobalState } from "../../../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../../../utils/testWrapper";
import { openWebUrl } from "../../../../../../utils/url";
import { ShareDataComponent } from "../ShareDataComponent";
⋮----
const renderComponent = ()
</file>

<file path="apps/main-app/ts/features/settings/privacy/shared/components/__test__/TosWebviewComponent.test.tsx">
import { fireEvent, render } from "@testing-library/react-native";
⋮----
import { SafeAreaProvider } from "react-native-safe-area-context";
⋮----
import { FlowType } from "../../../../../../utils/analytics";
import TosWebviewComponent from "../TosWebviewComponent";
</file>

<file path="apps/main-app/ts/features/settings/privacy/shared/components/ShareDataComponent/index.tsx">
import { Body, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
⋮----
import { useIOSelector } from "../../../../../../store/hooks";
import { openWebUrl } from "../../../../../../utils/url";
import { tosConfigSelector } from "../../../../../tos/store/selectors";
import { TrackingInfo } from "../../../../common/analytics/mixpanel/mixpanelAnalytics";
import {
  AnalyticsFeatureInfo,
  FeatureProps,
  GDPRFeatureInfo,
  SecurityFeatureInfo
} from "./ShareDataFeatureInfos";
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/settings/privacy/shared/components/ShareDataComponent/ShareDataFeatureInfos.tsx">
import { FeatureInfo, IOMarkdownLite, VSpacer } from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import I18n from "i18next";
import { useCallback, useMemo, useRef } from "react";
import { View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { useIOSelector } from "../../../../../../store/hooks";
import { generateDynamicUrlSelector } from "../../../../../../store/reducers/backendStatus/remoteConfig";
import { IO_SUPPLIERS_URL_BODY } from "../../../../../../urls";
import { setAccessibilityFocus } from "../../../../../../utils/accessibility";
import { useIOBottomSheetModal } from "../../../../../../utils/hooks/bottomSheet";
import { openWebUrl } from "../../../../../../utils/url";
import { TrackingInfo } from "../../../../common/analytics/mixpanel/mixpanelAnalytics";
⋮----
export type FeatureProps = {
  trackAction: (info: TrackingInfo) => void;
};
⋮----
) // It removes all '*' characters associated with Markdown syntax.
⋮----
const bodyRef = useRef<View>(null);
⋮----
const SecurityFeatureInfo = (
⋮----
const handleOnPress = () =>
</file>

<file path="apps/main-app/ts/features/settings/privacy/shared/components/TosWebviewComponent.tsx">
import {
  FooterActions,
  IOColors,
  useFooterActionsMeasurements,
  useIOTheme
} from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
import I18n from "i18next";
import { FunctionComponent, memo, useCallback, useState } from "react";
import { ViewProps } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import WebView, { WebViewMessageEvent } from "react-native-webview";
import { WebViewSource } from "react-native-webview/lib/WebViewTypes";
⋮----
import { NOTIFY_LINK_CLICK_SCRIPT } from "../../../../../components/ui/Markdown/script";
import { WebViewMessage } from "../../../../../components/ui/Markdown/types";
import { FlowType } from "../../../../../utils/analytics";
import { openWebUrl } from "../../../../../utils/url";
import {
  AVOID_ZOOM_JS,
  closeInjectedScript
} from "../../../../../utils/webview";
import TosWebviewErrorComponent from "../../components/TosWebviewErrorComponent";
import { trackToSWebViewError, trackToSWebViewErrorRetry } from "../analytics";
⋮----
type Props = Pick<ViewProps, "testID"> & {
  flow: FlowType;
  handleLoadEnd: () => void;
  handleReload: () => void;
  onAcceptTos?: () => void;
  shouldRenderFooter?: boolean;
  webViewSource: WebViewSource;
};
⋮----
const handleWebViewMessage = (event: WebViewMessageEvent) =>
⋮----
injectedJavaScript=
</file>

<file path="apps/main-app/ts/features/settings/privacy/shared/hooks/useConfirmOptOutBottomSheet.tsx">
import { Body, FooterActions } from "@io-app/design-system";
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { getFlowType } from "../../../../../utils/analytics";
import { useIOBottomSheetModal } from "../../../../../utils/hooks/bottomSheet";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import {
  trackMixpanelConsentBottomsheet,
  trackMixpanelConsentCancel
} from "../../../common/analytics/mixpanel/mixpanelAnalytics";
</file>

<file path="apps/main-app/ts/features/settings/security/components/PinCarouselItem.tsx">
import {
  Body,
  CodeInput,
  ContentWrapper,
  H4,
  VSpacer,
  WithTestID
} from "@io-app/design-system";
import { memo, RefObject } from "react";
import { useWindowDimensions, View } from "react-native";
⋮----
import { useDetectSmallScreen } from "../../../../hooks/useDetectSmallScreen";
⋮----
export type PinCarouselItemProps = WithTestID<{
  description?: string;
  handleOnValidate: (val: string) => boolean;
  maxLength: number;
  onValueChange: (val: string) => void;
  title: string;
  titleRef?: RefObject<null | View>;
  value: string;
}>;
</file>

<file path="apps/main-app/ts/features/settings/security/hooks/__test__/useCreatePin.test.tsx">
import { fireEvent, render } from "@testing-library/react-native";
import I18n from "i18next";
import { Button, Text } from "react-native";
⋮----
import { PinString } from "../../../../../types/PinString";
⋮----
import { SETTINGS_ROUTES } from "../../../common/navigation/routes";
import { createPinSuccess } from "../../store/actions/pinset";
import { useCreatePin } from "../useCreatePin";
⋮----
onPress=
</file>

<file path="apps/main-app/ts/features/settings/security/hooks/useCreatePin.tsx">
import { useIOToast } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback, useMemo } from "react";
import { AccessibilityInfo, Platform } from "react-native";
⋮----
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { assistanceToolConfigSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { PinString } from "../../../../types/PinString";
import { getFlowType } from "../../../../utils/analytics";
import { setPin } from "../../../../utils/keychain";
import {
  assistanceToolRemoteConfig,
  handleSendAssistanceLog
} from "../../../../utils/supportAssistance";
import { trackCreatePinSuccess } from "../../common/analytics";
import { SETTINGS_ROUTES } from "../../common/navigation/routes";
import { isProfileFirstOnBoardingSelector } from "../../common/store/selectors";
import { createPinSuccess } from "../store/actions/pinset";
⋮----
export const useCreatePin = (props =
</file>

<file path="apps/main-app/ts/features/settings/security/hooks/usePinValidationBottomSheet.tsx">
import { IOMarkdown, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { memo } from "react";
import { View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { useIOBottomSheetModal } from "../../../../utils/hooks/bottomSheet";
</file>

<file path="apps/main-app/ts/features/settings/security/screens/PinScreen.tsx">
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { PinCreation } from "../shared/components/PinCreation";
</file>

<file path="apps/main-app/ts/features/settings/security/screens/SecurityScreen.tsx">
import {
  ContentWrapper,
  Divider,
  IOToast,
  ListItemNav,
  ListItemSwitch
} from "@io-app/design-system";
import I18n from "i18next";
import { ReactElement, useCallback, useEffect, useState } from "react";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { shufflePinPadOnPayment } from "../../../../config";
import { mixpanelTrack } from "../../../../mixpanel";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { preferenceFingerprintIsEnabledSaveSuccess } from "../../../../store/actions/persistedPreferences";
import { useIODispatch, useIOSelector } from "../../../../store/hooks";
import { isIdPayCiePaymentCodeEnabledSelector } from "../../../../store/reducers/backendStatus/remoteConfig";
import { isFingerprintEnabledSelector } from "../../../../store/reducers/persistedPreferences";
import { getFlowType } from "../../../../utils/analytics";
import {
  biometricAuthenticationRequest,
  getBiometricsType,
  isBiometricsValidType,
  mayUserActivateBiometric
} from "../../../../utils/biometrics";
import { FIMS_ROUTES } from "../../../fims/common/navigation";
import { fimsIsHistoryEnabledSelector } from "../../../fims/history/store/selectors";
import { identificationRequest } from "../../../identification/store/actions";
import { IdPayCodeRoutes } from "../../../idpay/code/navigation/routes";
import { isIdPayCodeOnboardedSelector } from "../../../idpay/code/store/selectors";
import { SETTINGS_ROUTES } from "../../common/navigation/routes";
import {
  trackBiometricActivationAccepted,
  trackBiometricActivationDeclined
} from "../shared/analytics";
⋮----
const onSuccess = () =>
</file>

<file path="apps/main-app/ts/features/settings/security/shared/analytics/__test__/analytics.test.ts">
import {
  trackBiometricActivationAccepted,
  trackBiometricActivationDeclined
} from "..";
import { mixpanelTrack } from "../../../../../../mixpanel";
</file>

<file path="apps/main-app/ts/features/settings/security/shared/analytics/index.ts">
import { mixpanelTrack } from "../../../../../mixpanel";
import { buildEventProperties, FlowType } from "../../../../../utils/analytics";
⋮----
export function trackBiometricActivationAccepted(flow: FlowType)
⋮----
export function trackBiometricActivationDeclined(flow: FlowType)
</file>

<file path="apps/main-app/ts/features/settings/security/shared/components/PinCreation.tsx">
import {
  ContentWrapper,
  IOButton,
  NumberPad,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import I18n from "i18next";
import { useCallback, useRef, useState } from "react";
import { FlatList, Alert as NativeAlert, View } from "react-native";
⋮----
import { Carousel } from "../../../../../components/Carousel";
import { defaultPin } from "../../../../../config";
import { isValidPinNumber } from "../../../../../features/authentication/fastLogin/utils/pinPolicy";
import {
  trackPinError,
  trackPinScreen
} from "../../../../../features/settings/common/analytics";
import { isProfileFirstOnBoardingSelector } from "../../../../../features/settings/common/store/selectors";
import { useDetectSmallScreen } from "../../../../../hooks/useDetectSmallScreen";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../../store/hooks";
import { PinString } from "../../../../../types/PinString";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { getFlowType } from "../../../../../utils/analytics";
import { PIN_LENGTH_SIX } from "../../../../../utils/constants";
import { isDevEnv } from "../../../../../utils/environment";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { usePreventScreenCapture } from "../../../../../utils/hooks/usePreventScreenCapture";
import { useOnboardingAbortAlert } from "../../../../onboarding/hooks/useOnboardingAbortAlert";
import {
  PinCarouselItem,
  PinCarouselItemProps
} from "../../components/PinCarouselItem";
import { useCreatePin } from "../../hooks/useCreatePin";
import usePinValidationBottomSheet from "../../hooks/usePinValidationBottomSheet";
⋮----
export type Props = {
  isOnboarding?: boolean;
};
⋮----
type PinMode = "confirmation" | "creation";
</file>

<file path="apps/main-app/ts/features/settings/security/store/actions/pinset.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { PinString } from "../../../../../types/PinString";
⋮----
export type PinSetActions = ActionType<typeof createPinSuccess>;
</file>

<file path="apps/main-app/ts/features/settings/userData/components/__test__/CountdownComponent.test.tsx">
import React from "react";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import Countdown from "../CountdownComponent";
⋮----
const renderComponent = (
  props?: Partial<React.ComponentProps<typeof Countdown>>
) =>
</file>

<file path="apps/main-app/ts/features/settings/userData/components/CountdownComponent.tsx">
import { Body, VSpacer } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
import { View } from "react-native";
⋮----
import { useCountdown } from "../../../../components/countdown/CountdownProvider";
import { ProgressIndicator } from "../../../../components/ui/ProgressIndicator";
⋮----
type CountdownProps = {
  onContdownCompleted?: () => void;
  visible: boolean;
};
</file>

<file path="apps/main-app/ts/features/settings/userData/screens/FiscalCodeScreen.tsx">
import {
  BodySmall,
  H3,
  IOColors,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useRef, useState } from "react";
import { StyleSheet, View } from "react-native";
import Barcode from "react-native-barcode-builder";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIOSelector } from "../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../utils/accessibility";
import { useMaxBrightness } from "../../../../utils/brightness";
import { clipboardSetStringWithFeedback } from "../../../../utils/clipboard";
import {
  profileFiscalCodeSelector,
  profileNameSurnameSelector
} from "../../common/store/selectors";
⋮----
accessibilityLabel=
</file>

<file path="apps/main-app/ts/features/settings/userData/screens/ProfileDataScreen.tsx">
import { ContentWrapper, Divider, ListItemInfo } from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { ComponentProps, useCallback, useMemo } from "react";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../../components/ui/IOScrollViewWithLargeHeader";
import { useIONavigation } from "../../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../../store/hooks";
import { SETTINGS_ROUTES } from "../../common/navigation/routes";
import {
  hasProfileEmailSelector,
  profileEmailSelector,
  profileFiscalCodeSelector,
  profileNameSurnameSelector
} from "../../common/store/selectors";
⋮----
type EndElementProps = ComponentProps<typeof ListItemInfo>["endElement"];
</file>

<file path="apps/main-app/ts/features/settings/userData/shared/__test__/EmailInsertScreen.test.tsx">
import { fireEvent, waitFor } from "@testing-library/react-native";
import I18n from "i18next";
import { Alert } from "react-native";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { SETTINGS_ROUTES } from "../../../common/navigation/routes";
import EmailInsertScreen from "../screens/EmailInsertScreen";
⋮----
const renderComponent = (emailValue?: string) =>
</file>

<file path="apps/main-app/ts/features/settings/userData/shared/__test__/EmailValidationSendEmailScreen.test.tsx">
import { fireEvent } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore, PreloadedState } from "redux";
⋮----
import { applicationChangeState } from "../../../../../store/actions/application";
import { appReducer } from "../../../../../store/reducers";
import { GlobalState } from "../../../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper";
import { SETTINGS_ROUTES } from "../../../common/navigation/routes";
import EmailValidationSendEmailScreen from "../screens/EmailValidationSendEmailScreen";
⋮----
const renderComponent = (customState?: Partial<GlobalState>) =>
</file>

<file path="apps/main-app/ts/features/settings/userData/shared/screens/EmailInsertScreen.tsx">
import {
  Body,
  ContentWrapper,
  H1,
  IOButton,
  IODimensions,
  IOToast,
  TextInputValidation,
  VSpacer
} from "@io-app/design-system";
⋮----
import { EmailString } from "@pagopa/ts-commons/lib/strings";
import { Route, useFocusEffect, useRoute } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import {
  ComponentRef,
  useCallback,
  useEffect,
  useMemo,
  useRef,
  useState
} from "react";
import {
  AccessibilityInfo,
  Alert,
  Keyboard,
  KeyboardAvoidingView,
  Platform,
  ScrollView,
  StyleSheet,
  View
} from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import validator from "validator";
⋮----
import LoadingSpinnerOverlay from "../../../../../components/LoadingSpinnerOverlay";
import { useDetectSmallScreen } from "../../../../../hooks/useDetectSmallScreen";
import { useHeaderSecondLevel } from "../../../../../hooks/useHeaderSecondLevel";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { getFlowType } from "../../../../../utils/analytics";
import { isDisplayZoomed } from "../../../../../utils/device";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { usePrevious } from "../../../../../utils/hooks/usePrevious";
import { areStringsEqual } from "../../../../../utils/options";
import { trackTosUserExit } from "../../../../authentication/common/analytics";
import {
  trackEmailDuplicateEditing,
  trackEmailEditing,
  trackEmailEditingError,
  trackSendValidationEmail
} from "../../../../mailCheck/analytics";
import { emailValidationSelector } from "../../../../mailCheck/store/selectors/emailValidation";
import { abortOnboarding } from "../../../../onboarding/store/actions";
import { useInputFocus } from "../../../../payments/checkout/hooks/useInputFocus";
import { SETTINGS_ROUTES } from "../../../common/navigation/routes";
import { profileUpsert } from "../../../common/store/actions";
import {
  isProfileEmailAlreadyTakenSelector,
  isProfileEmailValidatedSelector,
  isProfileFirstOnBoardingSelector,
  profileEmailSelector,
  profileSelector
} from "../../../common/store/selectors";
⋮----
const ContinueButton = (props: { onContinue: () => void }) => (
  <>
    <ContentWrapper>
      <IOButton
        fullWidth
        label={I18n.t("global.buttons.continue")}
        onPress={props.onContinue}
        testID="continue-button"
        variant="solid"
      />
    </ContentWrapper>
    <VSpacer size={16} />
  </>
);
⋮----
label=
⋮----
/**
 * Since we have some iOS users with a very large font size, that can't enter or
 * use this screen, we use this information to disable autofocus on the input
 * field.
 */
⋮----
/** A screen to allow user to insert an email address. */
⋮----
const getEmail = (email: O.Option<string>)
⋮----
const getAccessibilityErrorLabel = (): string | undefined
⋮----
const continueOnPress = () =>
⋮----
... (6 lines truncated)
</file>

<file path="apps/main-app/ts/features/settings/userData/shared/screens/EmailValidationSendEmailScreen.tsx">
import {
  Body,
  ContentWrapper,
  H3,
  IOButton,
  IOPictogramSizeScale,
  IOToast,
  Pictogram,
  VSpacer
} from "@io-app/design-system";
⋮----
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { Route, useFocusEffect, useRoute } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import _ from "lodash";
import { useCallback, useEffect, useRef, useState } from "react";
import { AppState, ScrollView, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
⋮----
import { CountdownProvider } from "../../../../../components/countdown/CountdownProvider";
import SectionStatusComponent from "../../../../../components/SectionStatus";
import { useIONavigation } from "../../../../../navigation/params/AppParamsList";
import ROUTES from "../../../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../../../store/hooks";
import { setAccessibilityFocus } from "../../../../../utils/accessibility";
import { getFlowType } from "../../../../../utils/analytics";
import { useOnFirstRender } from "../../../../../utils/hooks/useOnFirstRender";
import { usePrevious } from "../../../../../utils/hooks/usePrevious";
import { FCI_ROUTES } from "../../../../fci/navigation/routes";
import {
  trackEmailValidation,
  trackEmailValidationSuccess,
  trackEmailValidationSuccessConfirmed,
  trackResendValidationEmail
} from "../../../../mailCheck/analytics";
import { emailValidationSelector } from "../../../../mailCheck/store/selectors/emailValidation";
import { emailAcknowledged } from "../../../../onboarding/store/actions";
import { SETTINGS_ROUTES } from "../../../common/navigation/routes";
import {
  acknowledgeOnEmailValidation,
  emailValidationPollingStart,
  emailValidationPollingStop,
  setEmailCheckAtStartupFailure,
  startEmailValidation
} from "../../../common/store/actions";
import {
  isEmailValidatedSelector,
  isProfileFirstOnBoardingSelector,
  profileEmailSelector
} from "../../../common/store/selectors";
import Countdown from "../../components/CountdownComponent";
⋮----
export type SendEmailValidationScreenProp = {
  isEditingEmailMode?: boolean;
  isFciEditEmailFlow?: boolean;
  isOnboarding?: boolean;
  sendEmailAtFirstRender?: boolean;
};
⋮----
setShowCountdown(false);
</file>

<file path="apps/main-app/ts/features/settings/README.md">
# Settings Feature

## Purpose

This directory aims to encapsulate code primarily related to the application's user settings functionality. This includes user profile adjustments, notification preferences, appearance settings, data management options, and other configuration interfaces available to the user.

## Rationale (Refactoring Context)

As part of a codebase refactoring initiative, these files were grouped together to:

1.  **Improve Cohesion:** Keep related settings logic (UI, state, navigation, services, types, etc.) consolidated in one logical location.
2.  **Enhance Discoverability:** Make it significantly easier and faster for developers to locate and understand code pertaining to the settings section.
3.  **Simplify Maintenance:** Streamline bug fixing, updates, and future enhancements related to user settings by isolating their relevant code.

During this refactoring, it was identified that some components, hooks, or utility functions historically associated with 'Profile' are also utilized in other, unrelated parts of the application. Fully decoupling and refactoring all usages of these shared elements immediately was assessed as being too time-consuming and introducing unnecessary risk at this stage.

## Contents

This feature module typically includes:

- Settings-related UI screens.
- State management logic specific to user preferences and settings state.
- Navigation configuration specific to the settings section.
- Custom hooks used exclusively within the settings flows.

### Important Note on the `shared` Subdirectory

This feature contains a `shared` subdirectory (i.e., `features/settings/**/shared/`). This directory holds components, hooks, or utilities that, while potentially originating from or heavily used within the 'Settings' context, are **also consumed by other features** of the application.

## Guideline

- All **new** code **strictly** concerning user settings functionality (new screens, settings-specific logic, state management for preferences, etc.) should reside directly within this `settings` feature module (but outside the `shared` subdirectory unless explicitly intended for cross-feature use from the outset).
- Before adding code to the `settings/**/shared` directory, carefully consider if it's truly specific to settings but needed _elsewhere_, or if it's generic enough to potentially belong in a top-level shared location later.
- Treat the `settings/**/shared` directory primarily as a holding area for **existing** shared code identified during this refactor phase. Avoid using it as the default location for newly created shared components if a more appropriate global shared location exists or can be created.
- Aim to gradually reduce the contents of `settings/**/shared` over time by refactoring components into more appropriate locations (either fully within `settings` if usage becomes exclusive, or into a global `shared` directory).
-

## Folder structure

Each subfolder can have the following structure:

```bash
settings/
├── featureOne/
│   ├── screens/ # Screens specific to the feature
│   ├── components/ # Feature-specific UI components
│   ├── store/ # State, actions and reducers
│   ├── sagas/ # Async logic and side effects
│   ├── hooks/ # React hooks local to the feature
│   └── shared/ # Code reused only across all features
├── featureTwo/
│   └── ...
└── ...

```
</file>

<file path="apps/main-app/ts/features/startup/analytics/index.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
⋮----
const getErrorFlow = (afterIdentificationWithIdp: boolean)
export const trackGetProfileEndpointTransientErrorScreen = (
  afterIdentificationWithIdp: boolean
) =>
⋮----
export const trackGetSessionEndpointTransientErrorScreen = (
  afterIdentificationWithIdp: boolean
) =>
⋮----
export const trackGetProfileEndpointTransientError = () =>
⋮----
export const trackGetSessionEndpointTransientError = () =>
</file>

<file path="apps/main-app/ts/features/startup/sagas/index.ts">
import { delay, put, select } from "typed-redux-saga/macro";
⋮----
import { WAIT_INITIALIZE_SAGA } from "../../../sagas/startup";
import { startApplicationInitialization } from "../../../store/actions/application";
import { startupTransientError } from "../../../store/actions/startup";
import {
  StartupTransientError,
  startupTransientErrorSelector
} from "../../../store/reducers/startup";
import {
  trackGetProfileEndpointTransientError,
  trackGetSessionEndpointTransientError
} from "../analytics";
⋮----
type StartupTransientErrorKind = Exclude<
  StartupTransientError["kind"],
  "NOT_SET"
>;
⋮----
function getUpdateErrorAction(
  kind: StartupTransientErrorKind,
  transientError: StartupTransientError
)
</file>

<file path="apps/main-app/ts/features/startup/screens/errors/GetProfileEndpointTransientError.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
import { Modal } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import {
  isStartupLoaded,
  StartupStatusEnum
} from "../../../../store/reducers/startup";
import { trackGetProfileEndpointTransientErrorScreen } from "../../analytics";
⋮----
export const GetProfileEndpointTransientError = () =>
</file>

<file path="apps/main-app/ts/features/startup/screens/errors/GetSessionEndpointTransientError.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { useEffect } from "react";
import { Modal } from "react-native";
⋮----
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import { useIOSelector } from "../../../../store/hooks";
import {
  isStartupLoaded,
  StartupStatusEnum
} from "../../../../store/reducers/startup";
import { trackGetSessionEndpointTransientErrorScreen } from "../../analytics";
⋮----
export const GetSessionEndpointTransientError = () =>
</file>

<file path="apps/main-app/ts/features/tos/store/selectors/index.ts">
import { TosConfig } from "@io-app/api-types/generated/definitions/content/TosConfig";
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
⋮----
import {
  absolutePortalLinksSelector,
  remoteConfigSelector
} from "../../../../store/reducers/backendStatus/remoteConfig";
import { PRIVACY_URL_BODY } from "../../../../urls";
</file>

<file path="apps/main-app/ts/features/tos/index.ts">
import { TosConfig } from "@io-app/api-types/generated/definitions/content/TosConfig";
import { NonNegativeNumber } from "@pagopa/ts-commons/lib/numbers";
⋮----
export const getTosVersion = (tosData: TosConfig): NonNegativeNumber
⋮----
export const getTosUrl = (tosData: TosConfig): string
</file>

<file path="apps/main-app/ts/features/tour/analytics/index.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
⋮----
type TourGuideAction = "back" | "close" | "conclude" | "next" | "shown";
⋮----
export const trackTourGuideAction = (
  tour_guide_id: string,
  action: TourGuideAction
) =>
</file>

<file path="apps/main-app/ts/features/tour/components/GuidedTour.tsx">
import { PropsWithChildren, useEffect } from "react";
import Animated, {
  measure,
  useAnimatedRef,
  useFrameCallback
} from "react-native-reanimated";
⋮----
import { useIOSelector } from "../../../store/hooks";
import {
  activeGroupIdSelector,
  activeStepIndexSelector,
  tourItemsForActiveGroupSelector
} from "../store/selectors";
import { TourCutoutStyle } from "../types";
import { useTourContext } from "./TourProvider";
⋮----
export type GuidedTourProps = {
  cutoutStyle?: TourCutoutStyle;
  description: string;
  groupId: string;
  index: number;
  title: string;
};
⋮----
export const GuidedTour = (props: PropsWithChildren<GuidedTourProps>) =>
</file>

<file path="apps/main-app/ts/features/tour/components/TourOverlay.tsx">
import {
  Canvas,
  Group,
  Paint,
  Rect,
  RoundedRect
} from "@shopify/react-native-skia";
import { useCallback, useEffect, useRef, useState } from "react";
import { Dimensions, StyleSheet, View } from "react-native";
import Animated, {
  cancelAnimation,
  Easing,
  useAnimatedStyle,
  useSharedValue,
  withTiming
} from "react-native-reanimated";
import { scheduleOnRN } from "react-native-worklets";
⋮----
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { trackTourGuideAction } from "../analytics";
import {
  completeTourAction,
  nextTourStepAction,
  prevTourStepAction
} from "../store/actions";
import {
  activeGroupIdSelector,
  activeStepIndexSelector,
  isTourActiveSelector,
  tourItemsForActiveGroupSelector
} from "../store/selectors";
import { TourItemMeasurement } from "../types";
import { useTourContext } from "./TourProvider";
import { TourTooltip } from "./TourTooltip";
⋮----
const measureInWindow = (view: View): TourItemMeasurement | undefined =>
⋮----
const updateStep = () =>
⋮----
const positionCutout = () =>
</file>

<file path="apps/main-app/ts/features/tour/components/TourProvider.tsx">
import {
  createContext,
  PropsWithChildren,
  useCallback,
  useContext,
  useMemo,
  useRef
} from "react";
import Animated, {
  AnimatedRef,
  SharedValue,
  useAnimatedRef,
  useSharedValue
} from "react-native-reanimated";
⋮----
import { useIODispatch } from "../../../store/hooks";
import {
  registerTourItemAction,
  unregisterTourItemAction
} from "../store/actions";
import { TourCutoutStyle, TourItemMeasurement } from "../types";
import { TourOverlay } from "./TourOverlay";
⋮----
type ScrollRef = {
  headerHeight: number;
  scrollViewRef: AnimatedRef<Animated.ScrollView>;
  scrollY: SharedValue<number>;
};
⋮----
type TourContextValue = {
  cutoutH: SharedValue<number>;
  cutoutW: SharedValue<number>;
  cutoutX: SharedValue<number>;
  cutoutY: SharedValue<number>;
  getConfig: (
    groupId: string,
    index: number
  ) => undefined | { description: string; title: string };
  getCutoutStyle: (groupId: string, index: number) => { cornerRadius?: number };
  getMeasurement: (
    groupId: string,
    index: number
  ) => TourItemMeasurement | undefined;
  getScrollRef: (groupId: string) => ScrollRef | undefined;
  isRegionItem: (groupId: string, index: number) => boolean;
  isTracking: SharedValue<boolean>;
  overlayAnimatedRef: AnimatedRef<Animated.View>;
  registerItem: (
    groupId: string,
    index: number,
    viewRef: AnimatedRef<Animated.View>,
    config: {
      cutoutStyle?: TourCutoutStyle;
      description: string;
      title: string;
    }
  ) => void;
  registerRegion: (
    groupId: string,
    index: number,
    regionProvider: () => TourItemMeasurement | undefined,
    config: {
      cutoutStyle?: TourCutoutStyle;
      description: string;
      title: string;
    }
  ) => void;
  registerScrollRef: (
    groupId: string,
    ref: AnimatedRef<Animated.ScrollView>,
    scrollY: SharedValue<number>,
    headerHeight: number
  ) => void;
  unregisterItem: (groupId: string, index: number) => void;
  unregisterRegion: (groupId: string, index: number) => void;
  unregisterScrollRef: (groupId: string) => void;
};
⋮----
type TourItemConfig = {
  cutoutStyle?: TourCutoutStyle;
  description: string;
  ref?: AnimatedRef<Animated.View>;
  regionProvider?: () => TourItemMeasurement | undefined;
  title: string;
};
⋮----
export const useTourContext = () =>
⋮----
const makeKey = (groupId: string, index: number) => `$
⋮----
export const TourProvider = (
</file>

<file path="apps/main-app/ts/features/tour/components/TourStepIndicator.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
import Animated from "react-native-reanimated";
⋮----
type Props = {
  stepIndex: number;
  totalSteps: number;
};
⋮----
accessibilityLabel=
</file>

<file path="apps/main-app/ts/features/tour/components/TourTooltip.tsx">
import {
  Body,
  H6,
  hexToRgba,
  HStack,
  IconButton,
  IOButton,
  IOColors,
  useIOTheme,
  VStack
} from "@io-app/design-system";
import I18n from "i18next";
import { Dimensions, StyleSheet, View } from "react-native";
import Animated, {
  SharedValue,
  useAnimatedStyle,
  useSharedValue
} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { TourStepIndicator } from "./TourStepIndicator";
⋮----
type Props = {
  cutoutH: SharedValue<number>;
  cutoutW: SharedValue<number>;
  cutoutX: SharedValue<number>;
  cutoutY: SharedValue<number>;
  description: string;
  onBack: () => void;
  onNext: () => void;
  onSkip: () => void;
  opacity: SharedValue<number>;
  stepIndex: number;
  title: string;
  totalSteps: number;
};
⋮----
isLastStep
</file>

<file path="apps/main-app/ts/features/tour/components/useGuidedTourRegion.ts">
import { useEffect } from "react";
⋮----
import { TourCutoutStyle, TourItemMeasurement } from "../types";
import { useTourContext } from "./TourProvider";
⋮----
type UseGuidedTourRegionConfig = {
  cutoutStyle?: TourCutoutStyle;
  description: string;
  groupId: string;
  index: number;
  region: () => TourItemMeasurement | undefined;
  title: string;
};
⋮----
export const useGuidedTourRegion = ({
  groupId,
  index,
  title,
  description,
  region,
  cutoutStyle
}: UseGuidedTourRegionConfig) =>
</file>

<file path="apps/main-app/ts/features/tour/sagas/index.ts">
import { put, select, takeEvery } from "typed-redux-saga/macro";
⋮----
import { isTestEnv } from "../../../utils/environment";
import { trackTourGuideAction } from "../analytics";
import {
  completeTourAction,
  nextTourStepAction,
  startTourAction
} from "../store/actions";
import {
  activeGroupIdSelector,
  activeStepIndexSelector,
  tourItemsForActiveGroupSelector
} from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/tour/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { TourItem } from "../../types";
⋮----
export type TourActions =
  | ActionType<typeof completeTourAction>
  | ActionType<typeof nextTourStepAction>
  | ActionType<typeof prevTourStepAction>
  | ActionType<typeof registerTourItemAction>
  | ActionType<typeof resetTourCompletedAction>
  | ActionType<typeof startTourAction>
  | ActionType<typeof stopTourAction>
  | ActionType<typeof unregisterTourItemAction>;
</file>

<file path="apps/main-app/ts/features/tour/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types.ts";
import { TourItem } from "../../types/index.ts";
import {
  completeTourAction,
  nextTourStepAction,
  prevTourStepAction,
  registerTourItemAction,
  resetTourCompletedAction,
  startTourAction,
  stopTourAction,
  unregisterTourItemAction
} from "../actions/index.ts";
⋮----
export type TourState = {
  activeGroupId?: string;
  activeStepIndex: number;
  completed: ReadonlyArray<string>;
  items: { [groupId: string]: ReadonlyArray<TourItem> };
};
⋮----
const reducer = (
  state: TourState = tourInitialState,
  action: Action
): TourState =>
</file>

<file path="apps/main-app/ts/features/tour/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../store/reducers/types";
⋮----
const tourStateSelector = (state: GlobalState)
⋮----
export const isTourActiveSelector = (state: GlobalState)
⋮----
export const activeGroupIdSelector = (state: GlobalState)
⋮----
export const activeStepIndexSelector = (state: GlobalState)
⋮----
export const isTourCompletedSelector = (state: GlobalState, groupId: string)
</file>

<file path="apps/main-app/ts/features/tour/types/index.ts">
export type TourCutoutStyle = {
  cornerRadius?: number;
};
⋮----
export type TourItem = { groupId: string; index: number };
⋮----
export type TourItemMeasurement = {
  height: number;
  width: number;
  x: number;
  y: number;
};
</file>

<file path="apps/main-app/ts/features/utmLink/analytics/index.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
⋮----
export function trackUtmLink(
  utm_source: string,
  utm_medium: string,
  utm_campaign?: string
)
</file>

<file path="apps/main-app/ts/features/utmLink/saga/index.ts">
import { SagaIterator } from "redux-saga";
import { put, select, takeLatest } from "typed-redux-saga/macro";
⋮----
import { setIsMixpanelInitialized } from "../../mixpanel/store/actions";
import { isMixpanelInitializedSelector } from "../../mixpanel/store/selectors";
import { trackUtmLink } from "../analytics";
import { utmLinkClearParams, utmLinkSetParams } from "../store/actions";
import {
  utmLinkCampaignSelector,
  utmLinkMediumSelector,
  utmLinkSourceSelector
} from "../store/selectors";
import { isMixpanelEnabled as isMixpanelEnabledSelector } from "./../../../store/reducers/persistedPreferences";
</file>

<file path="apps/main-app/ts/features/utmLink/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type UtmLinkParams = {
  utmCampaign: string | undefined;
  utmMedium: string;
  utmSource: string;
};
⋮----
export type UtmLinkActions = ActionType<
  typeof utmLinkClearParams | typeof utmLinkSetParams
>;
</file>

<file path="apps/main-app/ts/features/utmLink/store/reducers/index.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { utmLinkClearParams, utmLinkSetParams } from "../actions";
⋮----
export type UtmLinkState = {
  utmCampaign: string | undefined;
  utmMedium: string | undefined;
  utmSource: string | undefined;
};
⋮----
export const utmLinkReducer = (
  state: UtmLinkState = utmLinkInitialState,
  action: Action
): UtmLinkState =>
</file>

<file path="apps/main-app/ts/features/utmLink/store/selectors/index.ts">
import { GlobalState } from "../../../../store/reducers/types";
⋮----
export const utmLinkCampaignSelector = (state: GlobalState)
⋮----
export const utmLinkSourceSelector = (state: GlobalState)
⋮----
export const utmLinkMediumSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/utmLink/index.ts">
import { URL } from "react-native-url-polyfill";
⋮----
import { AppDispatch } from "../../App";
import { utmLinkSetParams } from "./store/actions";
⋮----
export const processUtmLink = (url: string, dispatch: AppDispatch) =>
</file>

<file path="apps/main-app/ts/features/wallet/components/WalletCardBaseComponent.tsx">
import { WithTestID } from "@io-app/design-system";
import { ComponentType } from "react";
import { StyleSheet } from "react-native";
import Animated, {
  FadeIn,
  FadeOut,
  LinearTransition
} from "react-native-reanimated";
⋮----
export type WalletCardComponentBaseProps<P> = WithTestID<{
  cardProps: P;
  isStacked?: boolean;
}>;
⋮----
export const withWalletCardBaseComponent =
  <
    CardProps extends object,
    ContentProps extends WalletCardComponentBaseProps<CardProps>
  >(
    CardContent: ComponentType<CardProps>
)
</file>

<file path="apps/main-app/ts/features/wallet/components/WalletCardPressableBase.tsx">
import { useScaleAnimation, WithTestID } from "@io-app/design-system";
import { PropsWithChildren } from "react";
import { Pressable, PressableProps } from "react-native";
import Animated from "react-native-reanimated";
⋮----
export type WalletCardPressableBaseProps = WithTestID<
  Pick<PressableProps, "accessibilityLabel" | "onPress">
>;
⋮----
export const WalletCardPressableBase = ({
  onPress,
  testID,
  accessibilityLabel,
  children
}: PropsWithChildren<WalletCardPressableBaseProps>) =>
</file>

<file path="apps/main-app/ts/features/wallet/components/WalletCardsCategoryContainer.tsx">
import { WithTestID } from "@io-app/design-system";
import { Platform, StyleSheet } from "react-native";
import Animated, {
  FadeInDown,
  FadeOutDown,
  LinearTransition
} from "react-native-reanimated";
⋮----
import { WalletCard } from "../types";
import { renderWalletCardFn } from "../utils";
⋮----
export type WalletCardsCategoryContainerProps = WithTestID<{
  cards: ReadonlyArray<WalletCard>;
}>;
⋮----
renderWalletCardFn(item, index < cards.length - 1)
</file>

<file path="apps/main-app/ts/features/wallet/components/WalletCardsCategoryRetryErrorBanner.tsx">
import { BannerErrorState } from "@io-app/design-system";
⋮----
import I18n from "i18next";
import { View } from "react-native";
⋮----
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { cdcStatusSelector } from "../../bonus/cdc/wallet/store/selectors";
import { cgnDetailSelector } from "../../bonus/cgn/store/reducers/details";
import { idPayWalletInitiativeListSelector } from "../../idpay/wallet/store/reducers";
import { usePaymentsBackoffRetry } from "../../payments/common/hooks/usePaymentsBackoffRetry";
import { getPaymentsWalletUserMethods } from "../../payments/wallet/store/actions";
import { paymentsWalletUserMethodsSelector } from "../../payments/wallet/store/selectors";
import { SERVICES_ROUTES } from "../../services/common/navigation/routes";
⋮----
const handleOnAction = () =>
</file>

<file path="apps/main-app/ts/features/wallet/components/WalletCardsContainer.tsx">
import { ListItemHeader } from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
import { StyleSheet, View } from "react-native";
import Animated, { LinearTransition } from "react-native-reanimated";
import { shallowEqual } from "react-redux";
⋮----
import { useDebugInfo } from "../../../hooks/useDebugInfo";
import { useIOSelector } from "../../../store/hooks";
import { ItwDiscoveryBannerStandalone } from "../../itwallet/common/components/discoveryBanner/ItwDiscoveryBannerStandalone";
import ItwActivationSuccessFeedbackBanner from "../../itwallet/common/components/ItwActivationSuccessFeedbackBanner";
import { ItwEnvironmentAlert } from "../../itwallet/common/components/ItwEnvironmentAlert";
import { ItwL2EngagementBanner } from "../../itwallet/common/components/ItwL2EngagementBanner";
import { ItwWalletNotAvailableBanner } from "../../itwallet/common/components/ItwWalletNotAvailableBanner";
import {
  itwShouldRenderL2EngagementBannerForInactiveWalletSelector,
  itwShouldRenderWalletDiscoveryBannerSelector
} from "../../itwallet/common/store/selectors";
import { itwIsActivationSuccessFeedbackBannerVisibleSelector } from "../../itwallet/common/store/selectors/banners";
import { itwWalletActivationFeedbackBannerDataSelector } from "../../itwallet/common/store/selectors/preferences";
import { ItwDiscoveryBanner } from "../../itwallet/discovery/components/ItwDiscoveryBanner";
import { ItwWalletCardsContainer } from "../../itwallet/wallet/components/ItwWalletCardsContainer";
import { useItwWalletInstanceRevocationAlert } from "../../itwallet/walletInstance/hook/useItwWalletInstanceRevocationAlert";
import {
  selectWalletOtherCards,
  shouldRenderItwCardsContainerSelector,
  shouldRenderWalletEmptyStateSelector,
  shouldRenderWalletLoadingStateSelector
} from "../store/selectors";
import { withWalletCategoryFilter } from "../utils";
import { WalletCardsCategoryContainer } from "./WalletCardsCategoryContainer";
import { WalletCardsCategoryRetryErrorBanner } from "./WalletCardsCategoryRetryErrorBanner";
import { WalletCardSkeleton } from "./WalletCardSkeleton";
import { WalletEmptyScreenContent } from "./WalletEmptyScreenContent";
</file>

<file path="apps/main-app/ts/features/wallet/components/WalletCardSkeleton.tsx">
import {
  IOColors,
  IODimensions,
  IOSkeleton,
  useIOThemeContext,
  VStack
} from "@io-app/design-system";
import { StyleSheet, View } from "react-native";
⋮----
import { withWalletCardBaseComponent } from "./WalletCardBaseComponent";
</file>

<file path="apps/main-app/ts/features/wallet/components/WalletCategoryFilterTabs.tsx">
import { IODimensions, TabItem, TabNavigation } from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
import { StyleSheet, View } from "react-native";
⋮----
import { useDebugInfo } from "../../../hooks/useDebugInfo";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { trackWalletCategoryFilter } from "../../itwallet/analytics";
import { walletSetCategoryFilter } from "../store/actions/preferences";
import {
  isWalletCategoryFilteringEnabledSelector,
  selectWalletCategoryFilter
} from "../store/selectors";
import { walletCardCategoryFilters } from "../types";
⋮----
const handleFilterSelected = (index: number) =>
</file>

<file path="apps/main-app/ts/features/wallet/components/WalletEmptyScreenContent.tsx">
import { Body, IOButton, IODimensions, Pictogram } from "@io-app/design-system";
import I18n from "i18next";
import { StyleSheet, View } from "react-native";
⋮----
import ItwDeckImage from "../../../../img/features/itWallet/brand/itw_deck_wallet.svg";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../store/hooks";
import { trackWalletAdd } from "../../itwallet/analytics";
import { PoweredByItWalletText } from "../../itwallet/common/components/PoweredByItWalletText";
import { itwIsL3EnabledSelector } from "../../itwallet/common/store/selectors";
import { ITW_ROUTES } from "../../itwallet/navigation/routes";
⋮----
const WalletEmptyScreenContent = () =>
⋮----
const handleAddToWalletButtonPress = () =>
</file>

<file path="apps/main-app/ts/features/wallet/saga/handleRemoveMissingCards.ts">
import { put, select } from "typed-redux-saga/macro";
⋮----
import { GlobalState } from "../../../store/reducers/types";
import { walletRemoveCards } from "../store/actions/cards";
import { WalletCard } from "../types";
</file>

<file path="apps/main-app/ts/features/wallet/saga/handleWalletAnalyticsSaga.ts">
import { SagaIterator } from "redux-saga";
import { all, call, select, take } from "typed-redux-saga/macro";
⋮----
import { updateMixpanelProfileProperties } from "../../../mixpanelConfig/profileProperties";
import { updateMixpanelSuperProperties } from "../../../mixpanelConfig/superProperties";
import { isIdPayEnabledSelector } from "../../../store/reducers/backendStatus/remoteConfig";
import { GlobalState } from "../../../store/reducers/types";
import { cgnDetails } from "../../bonus/cgn/store/actions/details";
import { idPayWalletGet } from "../../idpay/wallet/store/actions";
import { getPaymentsWalletUserMethods } from "../../payments/wallet/store/actions";
</file>

<file path="apps/main-app/ts/features/wallet/saga/handleWalletLoadingPlaceholdersTimeout.ts">
import { delay, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import {
  walletResetPlaceholders,
  walletToggleLoadingState
} from "../store/actions/placeholders";
import { selectWalletCards } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/wallet/saga/handleWalletLoadingStateSaga.ts">
import { delay, put, race, select, take } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import { walletAddCards } from "../store/actions/cards";
import { walletToggleLoadingState } from "../store/actions/placeholders";
import { selectWalletCards } from "../store/selectors";
</file>

<file path="apps/main-app/ts/features/wallet/saga/handleWalletUpdateSaga.ts">
import { put, select } from "typed-redux-saga/macro";
⋮----
import { getCdcStatusWallet } from "../../bonus/cdc/wallet/store/actions";
import { cgnDetails } from "../../bonus/cgn/store/actions/details";
import { isCgnDetailsAlreadyFetchedSelector } from "../../bonus/cgn/store/reducers/details";
import { idPayWalletGet } from "../../idpay/wallet/store/actions";
import { getPaymentsWalletUserMethods } from "../../payments/wallet/store/actions";
</file>

<file path="apps/main-app/ts/features/wallet/saga/index.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { SagaIterator } from "redux-saga";
import {
  fork,
  put,
  select,
  takeLatest,
  takeLeading
} from "typed-redux-saga/macro";
⋮----
import { walletUpdate } from "../store/actions";
import { walletAddCards } from "../store/actions/cards";
import { walletToggleLoadingState } from "../store/actions/placeholders";
import { selectWalletPlaceholderCards } from "../store/selectors";
import { handleWalletAnalyticsSaga } from "./handleWalletAnalyticsSaga";
import { handleWalletPlaceholdersTimeout } from "./handleWalletLoadingPlaceholdersTimeout";
import { handleWalletLoadingStateSaga } from "./handleWalletLoadingStateSaga";
import { handleWalletUpdateSaga } from "./handleWalletUpdateSaga";
</file>

<file path="apps/main-app/ts/features/wallet/screens/WalletHomeScreen.tsx">
import { IOToast } from "@io-app/design-system";
import { useFocusEffect } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect, useRef, useState } from "react";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import {
  IOScrollView,
  IOScrollViewActions
} from "../../../components/ui/IOScrollView";
import { useHeaderFirstLevel } from "../../../hooks/useHeaderFirstLevel";
import { useOfflineToastGuard } from "../../../hooks/useOfflineToastGuard";
import { useTabItemPressWhenScreenActive } from "../../../hooks/useTabItemPressWhenScreenActive";
import {
  IOStackNavigationRouteProps,
  useIONavigation
} from "../../../navigation/params/AppParamsList";
import { MainTabParamsList } from "../../../navigation/params/MainTabParamsList";
import ROUTES from "../../../navigation/routes";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import {
  trackItwSurveyRequest,
  trackOpenWalletScreen,
  trackWalletAdd
} from "../../itwallet/analytics";
import { itwMixPanelCredentialDetailsSelector } from "../../itwallet/analytics/store/selectors";
import { useItwActivationExitSurveyBottomSheet } from "../../itwallet/common/hooks/useItwActivationExitSurveyBottomSheet";
import { useItwCredentialExitSurveyBottomSheet } from "../../itwallet/common/hooks/useItwCredentialExitSurveyBottomSheet";
import { useItwEidFeedbackBottomSheet } from "../../itwallet/common/hooks/useItwEidFeedbackBottomSheet";
import { itwSetPidReissuingSurveyHidden } from "../../itwallet/common/store/actions/preferences";
import { itwSetFeedbackBottomSheetVisible } from "../../itwallet/common/store/actions/ui";
import {
  isItwProximityEnabledSelector,
  itwIsL3EnabledSelector
} from "../../itwallet/common/store/selectors";
import { itwFeedbackBottomSheetVisibleSelector } from "../../itwallet/common/store/selectors/ui";
import { ITW_ROUTES } from "../../itwallet/navigation/routes";
import { trackItwProximityShowQrCode } from "../../itwallet/presentation/proximity/analytics";
import { ITW_PROXIMITY_ROUTES } from "../../itwallet/presentation/proximity/navigation/routes";
import {
  ITW_TOUR_GROUP_ID,
  ITW_TOUR_STEP_QR_BUTTON
} from "../../itwallet/tour/utils/constants";
import { WalletCardsContainer } from "../components/WalletCardsContainer";
import { WalletCategoryFilterTabs } from "../components/WalletCategoryFilterTabs";
import { walletUpdate } from "../store/actions";
import { walletToggleLoadingState } from "../store/actions/placeholders";
import {
  isWalletScreenRefreshingSelector,
  shouldRenderWalletEmptyStateSelector
} from "../store/selectors";
⋮----
export type WalletHomeNavigationParams = Readonly<{
  newMethodAdded?: boolean;
}>;
⋮----
type ScreenProps = IOStackNavigationRouteProps<
  MainTabParamsList,
  "WALLET_HOME"
>;
⋮----
const WalletHomeScreen = (
</file>

<file path="apps/main-app/ts/features/wallet/store/actions/cards.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { WalletCard, WalletCardCategory, WalletCardType } from "../../types";
⋮----
export type WalletCardsActions =
  | ActionType<typeof walletAddCards>
  | ActionType<typeof walletHideCards>
  | ActionType<typeof walletRemoveCards>
  | ActionType<typeof walletRemoveCardsByCategory>
  | ActionType<typeof walletRemoveCardsByType>
  | ActionType<typeof walletRestoreCards>
  | ActionType<typeof walletUpsertCard>;
</file>

<file path="apps/main-app/ts/features/wallet/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { WalletCardsActions } from "./cards";
import { WalletPlaceholdersActions } from "./placeholders";
import { WalletPreferencesActions } from "./preferences";
⋮----
export type WalletActions =
  | WalletBaseActions
  | WalletCardsActions
  | WalletPlaceholdersActions
  | WalletPreferencesActions;
⋮----
type WalletBaseActions = ActionType<typeof walletUpdate>;
</file>

<file path="apps/main-app/ts/features/wallet/store/actions/placeholders.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { WalletCard } from "../../types";
⋮----
export type WalletPlaceholdersActions =
  | ActionType<typeof walletResetPlaceholders>
  | ActionType<typeof walletToggleLoadingState>;
</file>

<file path="apps/main-app/ts/features/wallet/store/actions/preferences.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { WalletCardCategoryFilter } from "../../types";
⋮----
export type WalletPreferencesActions = ActionType<
  typeof walletSetCategoryFilter
>;
</file>

<file path="apps/main-app/ts/features/wallet/store/reducers/cards.ts">
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { WalletCard } from "../../types";
import {
  walletAddCards,
  walletHideCards,
  walletRemoveCards,
  walletRemoveCardsByCategory,
  walletRemoveCardsByType,
  walletRestoreCards,
  walletUpsertCard
} from "../actions/cards";
import { walletResetPlaceholders } from "../actions/placeholders";
⋮----
export type WalletCardsState = { [key: string]: WalletCard };
⋮----
const reducer = (
  state: WalletCardsState = INITIAL_STATE,
  action: Action
): WalletCardsState =>
</file>

<file path="apps/main-app/ts/features/wallet/store/reducers/index.ts">
import { combineReducers } from "redux";
import { PersistPartial } from "redux-persist";
⋮----
import cardsReducer, { WalletCardsState } from "./cards";
import placeholdersPersistor, { WalletPlaceholdersState } from "./placeholders";
import preferencesPersistor, { WalletPreferencesState } from "./preferences";
⋮----
export type WalletState = {
  cards: WalletCardsState;
  placeholders: PersistPartial & WalletPlaceholdersState;
  preferences: PersistPartial & WalletPreferencesState;
};
</file>

<file path="apps/main-app/ts/features/wallet/store/reducers/placeholders.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { WalletCard, WalletCardCategory } from "../../types";
import { walletAddCards, walletRemoveCards } from "../actions/cards";
import {
  walletResetPlaceholders,
  walletToggleLoadingState
} from "../actions/placeholders";
⋮----
export type WalletPlaceholdersState = {
  isLoading: boolean;
  items: WalletPlaceholders;
};
⋮----
type WalletPlaceholders = { [key: string]: WalletCardCategory };
⋮----
const reducer = (
  state: WalletPlaceholdersState = INITIAL_STATE,
  action: Action
): WalletPlaceholdersState =>
⋮----
const cardPlaceholderReducerFn = (
  acc: WalletPlaceholders,
  { category, key, type, hidden }: WalletCard
) =>
</file>

<file path="apps/main-app/ts/features/wallet/store/reducers/preferences.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import _ from "lodash";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  persistReducer
} from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { isDevEnv } from "../../../../utils/environment";
import { WalletCardCategoryFilter } from "../../types";
import { walletSetCategoryFilter } from "../actions/preferences";
⋮----
export type WalletPreferencesState = {
  categoryFilter?: WalletCardCategoryFilter;
};
⋮----
const reducer = (
  state: WalletPreferencesState = INITIAL_STATE,
  action: Action
): WalletPreferencesState =>
</file>

<file path="apps/main-app/ts/features/wallet/store/selectors/index.ts">
import { createSelector } from "reselect";
⋮----
import { GlobalState } from "../../../../store/reducers/types";
import { isSomeLoadingOrSomeUpdating } from "../../../../utils/pot";
import { cgnDetailSelector } from "../../../bonus/cgn/store/reducers/details";
import { isConnectedSelector } from "../../../connectivity/store/selectors";
import { idPayWalletInitiativeListSelector } from "../../../idpay/wallet/store/reducers";
import { isItwEnabledSelector } from "../../../itwallet/common/store/selectors/remoteConfig";
import { itwLifecycleIsValidSelector } from "../../../itwallet/lifecycle/store/selectors";
import { itwIsWalletInstanceStatusFailureSelector } from "../../../itwallet/walletInstance/store/selectors";
import { paymentsWalletUserMethodsSelector } from "../../../payments/wallet/store/selectors";
import {
  WalletCard,
  walletCardCategories,
  WalletCardCategory,
  WalletCardType
} from "../../types";
import { WalletCardCategoryFilter } from "../../types/index";
⋮----
export const selectWalletCardsByType = <T extends WalletCardType>(
  state: GlobalState,
  type: T
): Array<Extract<WalletCard,
⋮----
export const selectIsWalletLoading = (state: GlobalState)
⋮----
export const isWalletEmptySelector = (state: GlobalState)
⋮----
export const shouldRenderWalletLoadingStateSelector = (state: GlobalState)
⋮----
export const shouldRenderWalletEmptyStateSelector = (state: GlobalState)
⋮----
export const isWalletScreenRefreshingSelector = (state: GlobalState)
⋮----
export const selectWalletCategoryFilter = (state: GlobalState)
⋮----
export const shouldRenderItwCardsContainerSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/wallet/types/index.ts">
import { Prettify } from "../../../types/helpers";
import { CdcCardProps } from "../../bonus/cdc/wallet/components/CdcCard";
import { CgnWalletCardProps } from "../../bonus/cgn/components/CgnWalletCard";
import { IdPayWalletCardProps } from "../../idpay/wallet/components/IdPayWalletCard";
import { ItwCredentialCard } from "../../itwallet/common/components/ItwCredentialCard";
import { PaymentWalletCardProps } from "../../payments/wallet/components/PaymentWalletCard";
⋮----
export type WalletCardCategory = (typeof walletCardCategories)[number];
⋮----
export type WalletCard = WalletCardBase &
  (
    | WalletCardBonus
    | WalletCardCdc
    | WalletCardCgn
    | WalletCardItw
    | WalletCardPayment
    | WalletCardPlaceholder
  );
⋮----
export type WalletCardCategoryFilter =
  (typeof walletCardCategoryFilters)[number];
⋮----
export type WalletCardType = WalletCard["type"];
⋮----
type WalletCardBase = {
  category: WalletCardCategory;
  hidden?: true;
  key: string;
};
⋮----
type WalletCardBonus = Prettify<
  IdPayWalletCardProps & {
    type: "idPay";
  }
>;
⋮----
type WalletCardCdc = Prettify<
  CdcCardProps & {
    type: "cdc";
  }
>;
⋮----
type WalletCardCgn = Prettify<
  CgnWalletCardProps & {
    type: "cgn";
  }
>;
⋮----
type WalletCardItw = Prettify<
  ItwCredentialCard & {
    type: "itw";
  }
>;
⋮----
type WalletCardPayment = Prettify<
  PaymentWalletCardProps & {
    type: "payment";
  }
>;
⋮----
type WalletCardPlaceholder = {
  type: "placeholder";
};
</file>

<file path="apps/main-app/ts/features/wallet/utils/index.tsx">
import { ComponentType } from "react";
⋮----
import { useIOSelector } from "../../../store/hooks";
import { GlobalState } from "../../../store/reducers/types";
import { CdcWalletCard } from "../../bonus/cdc/wallet/components/CdcWalletCard";
import { CgnWalletCard } from "../../bonus/cgn/components/CgnWalletCard";
import { IdPayWalletCard } from "../../idpay/wallet/components/IdPayWalletCard";
import { ItwCredentialWalletCard } from "../../itwallet/wallet/components/ItwCredentialWalletCard";
import { PaymentWalletCard } from "../../payments/wallet/components/PaymentWalletCard";
import { WalletCardBaseComponent } from "../components/WalletCardBaseComponent";
import { WalletCardSkeleton } from "../components/WalletCardSkeleton";
import { shouldRenderWalletCategorySelector } from "../store/selectors";
import { WalletCard, WalletCardCategoryFilter, WalletCardType } from "../types";
⋮----
export const renderWalletCardFn = (card: WalletCard, stacked = false) =>
⋮----
export const withWalletCategoryFilter =
  <P extends Record<string, unknown>>(
    category: WalletCardCategoryFilter,
    WrappedComponent: ComponentType<P>
)
</file>

<file path="apps/main-app/ts/features/whatsnew/analytics/index.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
⋮----
export function trackWhatsNewScreen()
</file>

<file path="apps/main-app/ts/features/whatsnew/store/actions/index.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
type DisableWhatsNewPayload = {
  whatsNewVersion: number;
};
⋮----
export type WhatsNewActions = ActionType<WhatsNewActionsType>;
⋮----
type WhatsNewActionsType = typeof disableWhatsNew;
</file>

<file path="apps/main-app/ts/features/whatsnew/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { pipe } from "fp-ts/lib/function";
⋮----
import { PersistConfig, persistReducer } from "redux-persist";
import { getType } from "typesafe-actions";
⋮----
import { Action } from "../../../../store/actions/types";
import { GlobalState } from "../../../../store/reducers/types";
import {
  logoutFailure,
  logoutSuccess
} from "../../../authentication/common/store/actions";
import { ACTIVE_VERSION } from "../../versions";
import { disableWhatsNew } from "../actions";
⋮----
export type WhatsNewState = {
  lastVisualizedVersion?: number;
};
⋮----
export const isActiveVersionVisualizedWhatsNewSelector = (
  state: GlobalState
): boolean
⋮----
export const whatsNewReducer = (
  state: WhatsNewState = whatsNewInitialState,
  action: Action
): WhatsNewState =>
</file>

<file path="apps/main-app/ts/features/whatsnew/versions.ts">
import { JSX } from "react";
⋮----
type WhatsNew = {
  body: JSX.Element;
  title: string;
  version: number;
};
</file>

<file path="apps/main-app/ts/features/zendesk/analytics/index.ts">
import { constVoid } from "fp-ts/lib/function";
import { getType } from "typesafe-actions";
⋮----
import { zendeskEnabled } from "../../../config";
import { mixpanelTrack } from "../../../mixpanel";
import { Action } from "../../../store/actions/types";
import { buildEventProperties } from "../../../utils/analytics";
import { getNetworkErrorMessage } from "../../../utils/errors";
import {
  getZendeskConfig,
  getZendeskPaymentConfig,
  zendeskSelectedCategory,
  zendeskSupportCancel,
  zendeskSupportCompleted,
  zendeskSupportFailure,
  zendeskSupportStart
} from "../store/actions";
⋮----
const trackZendesk = (action: Action): void =>
⋮----
const emptyTracking = (__: Action)
⋮----
export const trackZendeskCaCBannerShow = (cacUrl: string)
⋮----
export const trackZendeskCaCBannerTap = (cacUrl: string) =>
</file>

<file path="apps/main-app/ts/features/zendesk/navigation/navigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { isGestureEnabled } from "../../../utils/navigation";
import RequestZandeskTokenErrorScreen from "../screens/RequestZandeskTokenErrorScreen";
import ZendeskAskPermissions from "../screens/ZendeskAskPermissions";
import ZendeskAskSeeReportsPermissions from "../screens/ZendeskAskSeeReportsPermissions";
import ZendeskChooseCategory from "../screens/ZendeskChooseCategory";
import ZendeskChooseSubCategory from "../screens/ZendeskChooseSubCategory";
import ZendeskPanicMode from "../screens/ZendeskPanicMode";
import ZendeskSeeReportsRouters from "../screens/ZendeskSeeReportsRouters";
import ZendeskSupportHelpCenter from "../screens/ZendeskSupportHelpCenter";
import { ZendeskParamsList } from "./params";
import ZENDESK_ROUTES from "./routes";
⋮----
export const ZendeskStackNavigator = () => (
  <Stack.Navigator
    initialRouteName={ZENDESK_ROUTES.HELP_CENTER}
    screenOptions={{ gestureEnabled: isGestureEnabled, headerShown: false }}
  >
    <Stack.Screen
      component={ZendeskPanicMode}
      name={ZENDESK_ROUTES.PANIC_MODE}
    />
    <Stack.Screen
      component={ZendeskSeeReportsRouters}
      name={ZENDESK_ROUTES.SEE_REPORTS_ROUTERS}
    />
    <Stack.Group screenOptions={{ headerShown: true }}>
      <Stack.Screen
        component={ZendeskSupportHelpCenter}
        name={ZENDESK_ROUTES.HELP_CENTER}
      />
      <Stack.Screen
        component={RequestZandeskTokenErrorScreen}
        name={ZENDESK_ROUTES.ERROR_REQUEST_ZENDESK_TOKEN}
        options={{ headerShown: false }}
      />
      <Stack.Screen
        component={ZendeskAskPermissions}
        name={ZENDESK_ROUTES.ASK_PERMISSIONS}
      />
      <Stack.Screen
        component={ZendeskChooseCategory}
        name={ZENDESK_ROUTES.CHOOSE_CATEGORY}
      />
      <Stack.Screen
        component={ZendeskChooseSubCategory}
        name={ZENDESK_ROUTES.CHOOSE_SUB_CATEGORY}
      />
      <Stack.Screen
        component={ZendeskAskSeeReportsPermissions}
        name={ZENDESK_ROUTES.ASK_SEE_REPORTS_PERMISSIONS}
      />
    </Stack.Group>
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/features/zendesk/navigation/params.ts">
import { ZendeskAskPermissionsNavigationParams } from "../screens/ZendeskAskPermissions";
import { ZendeskAskSeeReportsPermissionsNavigationParams } from "../screens/ZendeskAskSeeReportsPermissions";
import { ZendeskChooseCategoryNavigationParams } from "../screens/ZendeskChooseCategory";
import { ZendeskChooseSubCategoryNavigationParams } from "../screens/ZendeskChooseSubCategory";
import { ZendeskSeeReportsRoutersNavigationParams } from "../screens/ZendeskSeeReportsRouters";
import { ZendeskSupportHelpCenterNavigationParams } from "../screens/ZendeskSupportHelpCenter";
import ZENDESK_ROUTES from "./routes";
⋮----
export type ZendeskParamsList = {
  [ZENDESK_ROUTES.ASK_PERMISSIONS]: ZendeskAskPermissionsNavigationParams;
  [ZENDESK_ROUTES.ASK_SEE_REPORTS_PERMISSIONS]: ZendeskAskSeeReportsPermissionsNavigationParams;
  [ZENDESK_ROUTES.CHOOSE_CATEGORY]: ZendeskChooseCategoryNavigationParams;
  [ZENDESK_ROUTES.CHOOSE_SUB_CATEGORY]: ZendeskChooseSubCategoryNavigationParams;
  [ZENDESK_ROUTES.ERROR_REQUEST_ZENDESK_TOKEN]: undefined;
  [ZENDESK_ROUTES.HELP_CENTER]: ZendeskSupportHelpCenterNavigationParams;
  [ZENDESK_ROUTES.PANIC_MODE]: undefined;
  [ZENDESK_ROUTES.SEE_REPORTS_ROUTERS]: ZendeskSeeReportsRoutersNavigationParams;
};
</file>

<file path="apps/main-app/ts/features/zendesk/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/features/zendesk/saga/networking/handleGetZendeskConfig.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put } from "typed-redux-saga/macro";
⋮----
import { ContentClient } from "../../../../api/content";
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { getZendeskConfig } from "../../store/actions";
</file>

<file path="apps/main-app/ts/features/zendesk/saga/networking/handleGetZendeskPaymentConfig.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
⋮----
import { call, put } from "typed-redux-saga/macro";
⋮----
import { ContentClient } from "../../../../api/content";
import { SagaCallReturnType } from "../../../../types/utils";
import { getGenericError, getNetworkError } from "../../../../utils/errors";
import { getZendeskPaymentConfig } from "../../store/actions";
</file>

<file path="apps/main-app/ts/features/zendesk/saga/networking/handleHasOpenedTickets.ts">
import { call, put } from "typed-redux-saga/macro";
⋮----
import { getError } from "../../../../utils/errors";
import { hasOpenedTickets } from "../../../../utils/supportAssistance";
import { zendeskRequestTicketNumber } from "../../store/actions";
</file>

<file path="apps/main-app/ts/features/zendesk/saga/orchestration/index.ts">
import { CommonActions } from "@react-navigation/native";
import { call, put, select } from "typed-redux-saga/macro";
import { ActionType } from "typesafe-actions";
⋮----
import NavigationService from "../../../../navigation/NavigationService";
import {
  executeWorkUnit,
  withFailureHandling,
  withResetNavigationStack
} from "../../../../sagas/workUnit";
import { isLoggedIn } from "../../../authentication/common/store/utils/guards";
import ZENDESK_ROUTES from "../../navigation/routes";
import {
  getZendeskToken,
  zendeskSupportBack,
  zendeskSupportCancel,
  zendeskSupportCompleted,
  zendeskSupportFailure,
  zendeskSupportStart
} from "../../store/actions";
</file>

<file path="apps/main-app/ts/features/zendesk/saga/index.ts">
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
⋮----
import { call, put, select, takeLatest } from "typed-redux-saga/macro";
⋮----
import { ContentClient } from "../../../api/content";
import { SessionManagerClient } from "../../../api/SessionManagerClientManager";
import { checkSession } from "../../../features/authentication/common/saga/watchCheckSessionSaga";
import { SagaCallReturnType } from "../../../types/utils";
import { dismissSupport } from "../../../utils/supportAssistance";
import { startTimer } from "../../../utils/timer";
import { sessionInformationLoadSuccess } from "../../authentication/common/store/actions";
import { sessionInfoSelector } from "../../authentication/common/store/selectors";
import { withRefreshApiCall } from "../../authentication/fastLogin/saga/utils";
import { isFastLoginEnabledSelector } from "../../authentication/fastLogin/store/selectors";
import { identificationRequest } from "../../identification/store/actions";
import {
  getZendeskConfig,
  getZendeskPaymentConfig,
  getZendeskToken,
  zendeskPollingIteration,
  zendeskRequestTicketNumber,
  zendeskStartPolling,
  zendeskSupportCompleted,
  zendeskSupportStart
} from "../store/actions";
import { zendeskGetSessionPollingRunningSelector } from "../store/reducers";
import {
  formatRequestedTokenString,
  getOnlyNotAlreadyExistentValues
} from "../utils";
import { isDevEnv } from "./../../../utils/environment";
import { handleGetZendeskConfig } from "./networking/handleGetZendeskConfig";
import { handleGetZendeskPaymentConfig } from "./networking/handleGetZendeskPaymentConfig";
import { handleHasOpenedTickets } from "./networking/handleHasOpenedTickets";
import { zendeskSupport } from "./orchestration";
</file>

<file path="apps/main-app/ts/features/zendesk/screens/RequestZandeskTokenErrorScreen.tsx">
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useIODispatch } from "../../../store/hooks";
import { zendeskSupportCancel } from "../store/actions";
⋮----
const RequestZandeskTokenErrorScreen = () =>
</file>

<file path="apps/main-app/ts/features/zendesk/screens/ZendeskAskPermissions.tsx">
import {
  ContentWrapper,
  Divider,
  IOButton,
  IODimensions,
  IOToast,
  ListItemHeader,
  ListItemInfo,
  VSpacer
} from "@io-app/design-system";
import { RouteProp, useRoute } from "@react-navigation/native";
import { constNull, pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import _ from "lodash";
import { ComponentProps, useCallback, useEffect } from "react";
import { FlatList, ListRenderItemInfo, Platform } from "react-native";
⋮----
import LoadingSpinnerOverlay from "../../../components/LoadingSpinnerOverlay";
import { IOScrollViewWithLargeHeader } from "../../../components/ui/IOScrollViewWithLargeHeader";
import { zendeskPrivacyUrl } from "../../../config";
import { useHeaderSecondLevel } from "../../../hooks/useHeaderSecondLevel";
import { mixpanelTrack } from "../../../mixpanel";
import { useIONavigation } from "../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { appVersionHistorySelector } from "../../../store/reducers/installation";
import { getAppVersion } from "../../../utils/appVersion";
import {
  getFreeDiskStorage,
  getModel,
  getSystemVersion
} from "../../../utils/device";
import { getFullLocale } from "../../../utils/locale";
import { isIos } from "../../../utils/platform";
import { formatBytesWithUnit } from "../../../utils/strings";
import {
  addTicketCustomField,
  addTicketTag,
  anonymousAssistanceAddress,
  anonymousAssistanceAddressWithSubject,
  getZendeskConfig,
  getZendeskIdentity,
  initSupportAssistance,
  openSupportTicket,
  setUserIdentity,
  zendeskCurrentAppVersionId,
  zendeskDeviceAndOSId,
  zendeskidentityProviderId,
  zendeskItWalletStatusId,
  zendeskVersionsHistoryId
} from "../../../utils/supportAssistance";
import { handleItemOnPress, openWebUrl } from "../../../utils/url";
import {
  idpSelector,
  zendeskTokenSelector
} from "../../authentication/common/store/selectors";
import { isLoggedIn } from "../../authentication/common/store/utils/guards";
import {
  ItwZendeskWalletStatus,
  itwZendeskWalletStatusSelector
} from "../../itwallet/common/store/selectors/zendesk";
import {
  profileEmailSelector,
  profileFiscalCodeSelector,
  profileNameSurnameSelector
} from "../../settings/common/store/selectors";
import { ZendeskParamsList } from "../navigation/params";
import ZENDESK_ROUTES from "../navigation/routes";
import {
  type ZendeskAssistanceType,
  zendeskStopPolling,
  zendeskSupportCompleted,
  zendeskSupportFailure
} from "../store/actions";
import {
  getZendeskTokenStatusSelector,
  zendeskSelectedCategorySelector,
  zendeskSelectedSubcategorySelector,
  ZendeskTokenStatusEnum
} from "../store/reducers";
⋮----
const arrayToZendeskValue = (arr: Array<string>)
⋮----
const getWalletStatusLabel = (walletStatus: ItwZendeskWalletStatus) =>
⋮----
export type ItemPermissionProps = Pick<
  ComponentProps<typeof ListItemInfo>,
  "icon" | "label" | "testID" | "value"
> & {
  id?: string;
  zendeskID?: string;
};
⋮----
export type ZendeskAskPermissionsNavigationParams = {
  assistanceType: ZendeskAssistanceType;
};
⋮----
const workUnitCompleted = ()
⋮----
// It should never happens since it is selected in the previous screen
... (11 lines truncated)
</file>

<file path="apps/main-app/ts/features/zendesk/screens/ZendeskAskSeeReportsPermissions.tsx">
import {
  ContentWrapper,
  Divider,
  IOButton,
  IODimensions,
  IOToast,
  ListItemHeader,
  ListItemInfo,
  VSpacer
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { ComponentProps } from "react";
import { FlatList, ListRenderItemInfo, Platform } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../components/ui/IOScrollViewWithLargeHeader";
import { zendeskPrivacyUrl } from "../../../config";
import {
  AppParamsList,
  IOStackNavigationProp,
  IOStackNavigationRouteProps
} from "../../../navigation/params/AppParamsList";
import { useIOSelector } from "../../../store/hooks";
import { openWebUrl } from "../../../utils/url";
import {
  profileEmailSelector,
  profileFiscalCodeSelector,
  profileNameSurnameSelector
} from "../../settings/common/store/selectors";
import { ZendeskParamsList } from "../navigation/params";
import { type ZendeskAssistanceType } from "../store/actions";
import { ItemPermissionProps } from "./ZendeskAskPermissions";
⋮----
export type ZendeskAskSeeReportsPermissionsNavigationParams = {
  assistanceType: ZendeskAssistanceType;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ZendeskParamsList,
  "ZENDESK_ASK_SEE_REPORTS_PERMISSIONS"
>;
⋮----
ItemSeparatorComponent=
⋮----
keyExtractor=
</file>

<file path="apps/main-app/ts/features/zendesk/screens/ZendeskChooseCategory.tsx">
import { ZendeskCategory } from "@io-app/api-types/generated/definitions/content/ZendeskCategory";
import { Divider, IODimensions, ListItemNav } from "@io-app/design-system";
import I18n from "i18next";
import { FlatList, ListRenderItemInfo, Platform } from "react-native";
⋮----
import { isReady } from "../../../common/model/RemoteValue";
import { IOScrollViewWithLargeHeader } from "../../../components/ui/IOScrollViewWithLargeHeader";
import { IOStackNavigationRouteProps } from "../../../navigation/params/AppParamsList";
import { toArray } from "../../../store/helpers/indexer";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { getFullLocale } from "../../../utils/locale";
import {
  addTicketCustomField,
  hasSubCategories
} from "../../../utils/supportAssistance";
import { ZendeskParamsList } from "../navigation/params";
import ZENDESK_ROUTES from "../navigation/routes";
import {
  ZendeskAssistanceType,
  zendeskSelectedCategory,
  zendeskSupportFailure
} from "../store/actions";
import { zendeskConfigSelector } from "../store/reducers";
⋮----
export type ZendeskChooseCategoryNavigationParams = {
  assistanceType: ZendeskAssistanceType;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ZendeskParamsList,
  "ZENDESK_CHOOSE_CATEGORY"
>;
⋮----
const selectedCategory = (category: ZendeskCategory)
const zendeskWorkUnitFailure = (reason: string)
⋮----
const renderItem = ({
    item: category
  }: ListRenderItemInfo<ZendeskCategory>) => (
    <ListItemNav
      label={category.description[locale]}
onPress=
⋮----
onPress=
⋮----
ItemSeparatorComponent=
</file>

<file path="apps/main-app/ts/features/zendesk/screens/ZendeskChooseSubCategory.tsx">
import { ZendeskSubCategory } from "@io-app/api-types/generated/definitions/content/ZendeskSubCategory";
import {
  Banner,
  ContentWrapper,
  Divider,
  IODimensions,
  ListItemNav,
  useIOToast,
  VSpacer
} from "@io-app/design-system";
import I18n from "i18next";
import { FlatList, ListRenderItemInfo, Platform } from "react-native";
⋮----
import { IOScrollViewWithLargeHeader } from "../../../components/ui/IOScrollViewWithLargeHeader";
import { IOStackNavigationRouteProps } from "../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { trackHelpCenterCtaTapped } from "../../../utils/analytics";
import { getFullLocale } from "../../../utils/locale";
import { getOrFallback } from "../../../utils/object";
import {
  addTicketCustomField,
  hasSubCategories
} from "../../../utils/supportAssistance";
import { openWebUrl } from "../../../utils/url";
import { ZendeskParamsList } from "../navigation/params";
import {
  ZendeskAssistanceType,
  zendeskSelectedSubcategory,
  zendeskSupportFailure
} from "../store/actions";
import { zendeskSelectedCategorySelector } from "../store/reducers";
⋮----
export type ZendeskChooseSubCategoryNavigationParams = {
  assistanceType: ZendeskAssistanceType;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ZendeskParamsList,
  "ZENDESK_CHOOSE_SUB_CATEGORY"
>;
⋮----
const selectedSubcategory = (subcategory: ZendeskSubCategory)
const zendeskWorkUnitFailure = (reason: string)
⋮----
const renderItem = ({
    item: subCategory
  }: ListRenderItemInfo<ZendeskSubCategory>) => (
    <ListItemNav
      label={subCategory.description[locale]}
onPress=
⋮----
// Set sub-category as custom field
⋮----
ItemSeparatorComponent=
</file>

<file path="apps/main-app/ts/features/zendesk/screens/ZendeskPanicMode.tsx">
import I18n from "i18next";
⋮----
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import { useIODispatch } from "../../../store/hooks";
import { zendeskSupportCompleted } from "../store/actions";
⋮----
const workUnitCompleted = ()
</file>

<file path="apps/main-app/ts/features/zendesk/screens/ZendeskSeeReportsRouters.tsx">
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback, useEffect } from "react";
⋮----
import { LoadingScreenContent } from "../../../components/screens/LoadingScreenContent";
import { OperationResultScreenContent } from "../../../components/screens/OperationResultScreenContent";
import {
  AppParamsList,
  IOStackNavigationProp,
  IOStackNavigationRouteProps
} from "../../../navigation/params/AppParamsList";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import { isStrictSome } from "../../../utils/pot";
import {
  getZendeskConfig,
  getZendeskIdentity,
  initSupportAssistance,
  setUserIdentity,
  showSupportTickets
} from "../../../utils/supportAssistance";
import { zendeskTokenSelector } from "../../authentication/common/store/selectors";
import { ZendeskParamsList } from "../navigation/params";
import {
  ZendeskAssistanceType,
  zendeskRequestTicketNumber,
  zendeskStopPolling,
  zendeskSupportCompleted
} from "../store/actions";
import {
  zendeskConfigSelector,
  zendeskTicketNumberSelector
} from "../store/reducers";
import { handleContactSupport } from "../utils";
⋮----
export type ZendeskSeeReportsRoutersNavigationParams = {
  assistanceType: ZendeskAssistanceType;
};
⋮----
type Props = IOStackNavigationRouteProps<
  ZendeskParamsList,
  "ZENDESK_SEE_REPORTS_ROUTERS"
>;
⋮----
const ZendeskSeeReportsRouters = (props: Props) =>
</file>

<file path="apps/main-app/ts/features/zendesk/screens/ZendeskSupportHelpCenter.tsx">
import { Faq } from "@io-app/api-types/generated/definitions/content/Faq";
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import {
  AccordionItem,
  Banner,
  ContentWrapper,
  FooterActions,
  H4,
  HeaderSecondLevel,
  IOMarkdown,
  IOMarkdownLite,
  IOToast,
  ListItemInfo,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
⋮----
import { RouteProp, useNavigation, useRoute } from "@react-navigation/native";
⋮----
import I18n from "i18next";
import _ from "lodash";
import {
  useCallback,
  useEffect,
  useLayoutEffect,
  useMemo,
  useState
} from "react";
import { FlatList, ListRenderItemInfo, Platform } from "react-native";
import Animated, { useAnimatedRef } from "react-native-reanimated";
⋮----
import {
  IOScrollView,
  IOScrollViewActions
} from "../../../components/ui/IOScrollView";
import { mixpanelTrack } from "../../../mixpanel";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../navigation/params/AppParamsList";
import { loadContextualHelpData } from "../../../store/actions/content";
import { useIODispatch, useIOSelector } from "../../../store/hooks";
import {
  caCBannerConfigSelector,
  isCaCBannerEnabledSelector
} from "../../../store/reducers/backendStatus/remoteConfig";
import { getContextualHelpDataFromRouteSelector } from "../../../store/reducers/content";
import { reloadContextualHelpDataThreshold } from "../../../utils/contextualHelp";
import { useOnFirstRender } from "../../../utils/hooks/useOnFirstRender";
import { usePrevious } from "../../../utils/hooks/usePrevious";
import {
  fallbackForLocalizedMessageKeys,
  getFullLocale
} from "../../../utils/locale";
import { isStringNullyOrEmpty } from "../../../utils/strings";
import {
  addTicketCustomField,
  zendeskFciId
} from "../../../utils/supportAssistance";
import { openWebUrl } from "../../../utils/url";
import { isLoggedIn } from "../../authentication/common/store/utils/guards";
import { fciSignatureRequestIdSelector } from "../../fci/store/reducers/fciSignatureRequest";
import {
  isProfileEmailValidatedSelector,
  profileSelector
} from "../../settings/common/store/selectors";
import {
  trackZendeskCaCBannerShow,
  trackZendeskCaCBannerTap
} from "../analytics";
import { ZendeskParamsList } from "../navigation/params";
import ZENDESK_ROUTES from "../navigation/routes";
import {
  getZendeskConfig,
  getZendeskPaymentConfig,
  getZendeskToken,
  ZendeskStartPayload,
  zendeskSupportCancel
} from "../store/actions";
import {
  getZendeskTokenStatusSelector,
  zendeskConfigSelector,
  ZendeskTokenStatusEnum
} from "../store/reducers";
import { handleContactSupport } from "../utils";
⋮----
enum ButtonPressedEnum {
  ON_GOING_REQUEST = "ON_GOING_REQUEST",
  OPEN_NEW_REQUEST = "OPEN_NEW_REQUEST"
}
⋮----
export type ZendeskSupportHelpCenterNavigationParams = ZendeskStartPayload;
⋮----
type FaqManagerProps = Pick<ZendeskStartPayload, "startingRoute"> & {
  contentLoaded?: boolean;
};
⋮----
if (!bannerCaCConfig?.action)
⋮----
const ZendeskSupportHelpCenter = () =>
... (13 lines truncated)
</file>

<file path="apps/main-app/ts/features/zendesk/store/actions/index.ts">
import { Zendesk } from "@io-app/api-types/generated/definitions/content/Zendesk";
import { ZendeskCategory } from "@io-app/api-types/generated/definitions/content/ZendeskCategory";
import { ZendeskSubcategoriesErrors } from "@io-app/api-types/generated/definitions/content/ZendeskSubcategoriesErrors";
import { ZendeskSubCategory } from "@io-app/api-types/generated/definitions/content/ZendeskSubCategory";
import {
  ActionType,
  createAsyncAction,
  createStandardAction
} from "typesafe-actions";
⋮----
import { NetworkError } from "../../../../utils/errors";
⋮----
export type ZendeskAssistanceType = Partial<{
  card: boolean;
  fci: boolean;
  idPay: boolean;
  itWallet: boolean;
  payment: boolean;
  send: boolean;
}>;
⋮----
export type ZendeskStartPayload = {
  assistanceType: ZendeskAssistanceType;
  startingRoute: string;
};
⋮----
export type ZendeskSupportActions =
  | ActionType<typeof getZendeskConfig>
  | ActionType<typeof getZendeskPaymentConfig>
  | ActionType<typeof getZendeskToken>
  | ActionType<typeof zendeskPollingIteration>
  | ActionType<typeof zendeskRequestTicketNumber>
  | ActionType<typeof zendeskSelectedCategory>
  | ActionType<typeof zendeskSelectedSubcategory>
  | ActionType<typeof zendeskStartPolling>
  | ActionType<typeof zendeskStopPolling>
  | ActionType<typeof zendeskSupportBack>
  | ActionType<typeof zendeskSupportCancel>
  | ActionType<typeof zendeskSupportCompleted>
  | ActionType<typeof zendeskSupportFailure>
  | ActionType<typeof zendeskSupportStart>;
</file>

<file path="apps/main-app/ts/features/zendesk/store/reducers/index.ts">
import { ZendeskCategory } from "@io-app/api-types/generated/definitions/content/ZendeskCategory";
import { ZendeskSubcategoriesErrors } from "@io-app/api-types/generated/definitions/content/ZendeskSubcategoriesErrors";
import { ZendeskSubCategory } from "@io-app/api-types/generated/definitions/content/ZendeskSubCategory";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import {
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../../../common/model/RemoteValue";
import { Action } from "../../../../store/actions/types";
import { IndexedById, toIndexed } from "../../../../store/helpers/indexer";
import { GlobalState } from "../../../../store/reducers/types";
import { NetworkError } from "../../../../utils/errors";
import {
  getZendeskConfig,
  getZendeskPaymentConfig,
  getZendeskToken,
  zendeskRequestTicketNumber,
  zendeskSelectedCategory,
  zendeskSelectedSubcategory,
  zendeskStartPolling,
  zendeskStopPolling,
  zendeskSupportStart
} from "../actions";
⋮----
export enum ZendeskTokenStatusEnum {
  ERROR = "error",
  REQUEST = "request",
  SUCCESS = "success"
}
export type ZendeskConfig = RemoteValue<ZendeskValue, NetworkError>;
⋮----
export type ZendeskState = {
  getSessionPollingRunning?: boolean;
  getZendeskTokenStatus?: "401" | ZendeskTokenStatusEnum;
  selectedCategory?: ZendeskCategory;
  selectedSubcategory?: ZendeskSubCategory;
  ticketNumber: pot.Pot<number, Error>;
  zendeskConfig: ZendeskConfig;
  zendeskSubcategoriesErrorMap: ZendeskSubcategoriesErrorsConfig;
};
⋮----
export type ZendeskSubcategoriesErrorsConfig = RemoteValue<
  ZendeskSubcategoriesErrors,
  NetworkError
>;
⋮----
type ZendeskValue = {
  panicMode: boolean;
  zendeskCategories?: {
    categories: IndexedById<ZendeskCategory>;
    id: string;
  };
};
⋮----
const reducer = (
  state: ZendeskState = INITIAL_STATE,
  action: Action
): ZendeskState =>
⋮----
export const zendeskGetSessionPollingRunningSelector = (state: GlobalState)
⋮----
export const getZendeskTokenStatusSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/features/zendesk/utils/index.ts">
import { PublicSession } from "@io-app/api-types/generated/definitions/session_manager/PublicSession";
⋮----
import { isReady } from "../../../common/model/RemoteValue";
import {
  AppParamsList,
  IOStackNavigationProp
} from "../../../navigation/params/AppParamsList";
import { isPanicModeActive } from "../../../utils/supportAssistance";
import ZENDESK_ROUTES from "../navigation/routes";
import { type ZendeskAssistanceType } from "../store/actions";
import { ZendeskConfig } from "../store/reducers";
⋮----
export const handleContactSupport = (
  navigation: IOStackNavigationProp<AppParamsList>,
  assistanceType: ZendeskAssistanceType,
  zendeskRemoteConfig: ZendeskConfig
) =>
⋮----
type DefaultTokenType = Exclude<TokenType, "zendeskToken">;
⋮----
type TokenType = keyof PublicSession;
⋮----
export const formatRequestedTokenString = (
  needToRefreshZendeskToken = false,
  tokenType?: Array<TokenType>
): string =>
⋮----
export const getOnlyNotAlreadyExistentValues = (
  newValues: PublicSession,
  currentValues?: PublicSession
): PublicSession => (
</file>

<file path="apps/main-app/ts/hooks/useAnimationPlayback.ts">
import { useCallback, useEffect, useState } from "react";
⋮----
type UseAnimationPlaybackParams = {
  autoPlay: boolean;
  maxDurationMs: number;
  reduceMotion: boolean;
};
⋮----
export const useAnimationPlayback = ({
  autoPlay,
  maxDurationMs,
  reduceMotion
}: UseAnimationPlaybackParams) =>
</file>

<file path="apps/main-app/ts/hooks/useAppStateActive.ts">
import { useEffect, useRef } from "react";
import { AppState, type AppStateStatus } from "react-native";
⋮----
export const useAppStateActive = (onActive: () => void): void =>
</file>

<file path="apps/main-app/ts/hooks/useAppThemeConfiguration.tsx">
import { useIOThemeContext } from "@io-app/design-system";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { useEffect } from "react";
import { Appearance, ColorSchemeName, useColorScheme } from "react-native";
⋮----
import { updateNavigationBarColor } from "../features/settings/preferences/screens/AppearancePreferenceScreen";
⋮----
export type ColorModeChoice = "auto" | "dark" | "light";
⋮----
export const useAppThemeConfiguration = () =>
</file>

<file path="apps/main-app/ts/hooks/useBottomTabNavigatorStyle.ts">
import {
  hexToRgba,
  IOColors,
  useIOTheme,
  useIOThemeContext
} from "@io-app/design-system";
import { BottomTabNavigationOptions } from "@react-navigation/bottom-tabs";
import { useMemo } from "react";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
export const useBottomTabNavigatorStyle = () =>
</file>

<file path="apps/main-app/ts/hooks/useConfirmationChecks.ts">
import { useState } from "react";
⋮----
type ConfirmationChecks = {
  areFulfilled: boolean;
  setValue: (atIndex: number, value: boolean) => void;
  values: ReadonlyArray<boolean>;
};
⋮----
export const useConfirmationChecks = (length: number): ConfirmationChecks =>
⋮----
const setValue = (atIndex: number, value: boolean): void
</file>

<file path="apps/main-app/ts/hooks/useDebouncedValue.ts">
import { useEffect, useState } from "react";
⋮----
export function useDebouncedValue<Value>({
  delay,
  initial,
  value
}: {
  delay: number;
  initial: Value;
  value: Value;
})
</file>

<file path="apps/main-app/ts/hooks/useDebugInfo.ts">
import { useFocusEffect } from "@react-navigation/native";
import { useCallback } from "react";
⋮----
import { resetDebugData, setDebugData } from "../store/actions/debug";
import { useIODispatch, useIOSelector } from "../store/hooks";
import { isDebugModeEnabledSelector } from "../store/reducers/debug";
⋮----
export const useDebugInfo = (data: Record<string, unknown>) =>
</file>

<file path="apps/main-app/ts/hooks/useDetectSmallScreen.ts">
import { Dimensions } from "react-native";
⋮----
export const useDetectSmallScreen = () => (
</file>

<file path="apps/main-app/ts/hooks/useFooterActionsMargin.tsx">
import { IODimensions } from "@io-app/design-system";
import { Platform } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
type FooterActionsMargin = {
  bottomMargin: number;
  needSafeAreaMargin: boolean;
};
⋮----
export const useFooterActionsMargin = (
  excludeSafeAreaMargins?: boolean
): FooterActionsMargin =>
</file>

<file path="apps/main-app/ts/hooks/useHardwareBackButton.ts">
import { useFocusEffect } from "@react-navigation/native";
import { useCallback, useEffect, useRef } from "react";
import { BackHandler } from "react-native";
⋮----
export const useHardwareBackButton = (handler: () => boolean) =>
⋮----
export const useHardwareBackButtonToDismiss = (onDismiss: () => void) =>
⋮----
export const useHardwareBackButtonWhenFocused = (handler: () => boolean) =>
</file>

<file path="apps/main-app/ts/hooks/useHeaderFirstLevel.tsx">
import { HeaderFirstLevel } from "@io-app/design-system";
import { useLayoutEffect, useMemo } from "react";
⋮----
import { useIOAlertVisible } from "../components/StatusMessages/IOAlertVisibleContext";
import { useIONavigation } from "../navigation/params/AppParamsList";
import { MainTabParamsList } from "../navigation/params/MainTabParamsList";
import { useHeaderFirstLevelActionPropHelp } from "./useHeaderFirstLevelActionPropHelp";
import { useHeaderFirstLevelActionPropSettings } from "./useHeaderFirstLevelActionPropSettings";
⋮----
type HeaderFirstLevelHookProps = Omit<
  HeaderFirstLevel,
  "actions" | "ignoreSafeAreaMargin"
> & {
  actions?: HeaderFirstLevel["actions"];
};
⋮----
type useHeaderFirstLevelProps = {
  currentRoute: keyof MainTabParamsList;
  headerProps: HeaderFirstLevelHookProps;
};
⋮----
export const useHeaderFirstLevel = ({
  headerProps
}: useHeaderFirstLevelProps) =>
</file>

<file path="apps/main-app/ts/hooks/useHeaderFirstLevelActionPropHelp.ts">
import { HeaderActionProps } from "@io-app/design-system";
import I18n from "i18next";
import { useMemo } from "react";
⋮----
import { useStartSupportRequest } from "./useStartSupportRequest";
⋮----
export const useHeaderFirstLevelActionPropHelp = (): HeaderActionProps =>
</file>

<file path="apps/main-app/ts/hooks/useHeaderFirstLevelActionPropSettings.ts">
import { HeaderActionProps } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { SETTINGS_ROUTES } from "../features/settings/common/navigation/routes";
import { useIONavigation } from "../navigation/params/AppParamsList";
⋮----
export const useNavigateToSettingMainScreen = () =>
⋮----
export const useHeaderFirstLevelActionPropSettings = (): HeaderActionProps => (
</file>

<file path="apps/main-app/ts/hooks/useHeaderProps.tsx">
import {
  HeaderActionProps,
  HeaderSecondLevel,
  IOIcons
} from "@io-app/design-system";
import I18n from "i18next";
import { ComponentProps, useMemo } from "react";
⋮----
import { useStartSupportRequest } from "./useStartSupportRequest";
⋮----
export type BackProps =
  | {
      backAccessibilityLabel: string;
      goBack: () => void;
    }
  | {
      backAccessibilityLabel?: never;
      goBack?: never;
    };
export type HeaderActionsProps =
  | HeaderHelpActionProps
  | HeaderNoActionProps
  | HeaderThreeActionsProps
  | HeaderTwoActionsProps;
⋮----
type HeaderBaseProps = {
  headerType?: Exclude<HeaderSecondLevelProps["type"], "base" | "singleAction">;
  showHelp?: boolean;
};
⋮----
interface HeaderHelpActionProps extends HeaderBaseProps {
  headerType?: never;
  secondAction?: never;
  showHelp: true;
  thirdAction?: never;
}
⋮----
interface HeaderNoActionProps extends HeaderBaseProps {
  headerType?: never;
  secondAction?: never;
  showHelp?: false;
  thirdAction?: never;
}
⋮----
type HeaderProps = BackProps &
  HeaderActionsProps &
  Pick<HeaderSecondLevelProps, "scrollValues" | "title">;
⋮----
type HeaderSecondLevelProps = ComponentProps<typeof HeaderSecondLevel>;
⋮----
interface HeaderThreeActionsProps extends HeaderBaseProps {
  headerType: "threeActions";
  secondAction: HeaderActionProps;
  showHelp: true;
  thirdAction: HeaderActionProps;
}
⋮----
interface HeaderTwoActionsProps extends HeaderBaseProps {
  headerType: "twoActions";
  secondAction: HeaderActionProps;
  showHelp: true;
  thirdAction?: never;
}
⋮----
export const useHeaderProps = ({
  backAccessibilityLabel,
  goBack,
  title,
  headerType,
  scrollValues,
  showHelp,
  secondAction,
  thirdAction
}: HeaderProps): HeaderSecondLevelProps =>
</file>

<file path="apps/main-app/ts/hooks/useHeaderSecondLevel.tsx">
import { HeaderActionProps, HeaderSecondLevel } from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { ComponentProps, useCallback, useLayoutEffect, useMemo } from "react";
⋮----
import { useIOAlertVisible } from "../components/StatusMessages/IOAlertVisibleContext";
import { useOfflineToastGuard } from "./useOfflineToastGuard.ts";
import { useStartSupportRequest } from "./useStartSupportRequest";
⋮----
export type HeaderSecondLevelHookProps = PropsWithoutSupport | PropsWithSupport;
⋮----
type HeaderActionConfigProps = Pick<
  ComponentProps<typeof HeaderSecondLevel>,
  "firstAction" | "secondAction" | "thirdAction" | "type"
>;
⋮----
type HeaderHookManagedProps = Pick<
  ComponentProps<typeof HeaderSecondLevel>,
  | "animatedRef"
  | "backAccessibilityLabel"
  | "backgroundColor"
  | "backTestID"
  | "enableDiscreteTransition"
  | "goBack"
  | "scrollValues"
  | "title"
  | "transparent"
  | "variant"
>;
⋮----
type HeaderProps = ComponentProps<typeof HeaderSecondLevel>;
⋮----
type NoAdditionalActions = {
  secondAction?: never;
  thirdAction?: never;
};
⋮----
type PropsWithoutSupport = HeaderHookManagedProps &
  NoAdditionalActions &
  SpecificHookProps & {
    onStartSupportRequest?: never;
    supportRequest?: false;
  };
⋮----
type PropsWithSupport = HeaderHookManagedProps &
  SpecificHookProps &
  WithAdditionalActions & {
    onStartSupportRequest?: () => boolean;
    supportRequest: true;
  };
⋮----
type SpecificHookProps = {
  canGoBack?: boolean;
  headerShown?: boolean;
  ignoreAccessibilityCheck?: boolean;
};
⋮----
type WithAdditionalActions =
  | NoAdditionalActions
  | {
      secondAction: HeaderActionProps;
      thirdAction?: HeaderActionProps;
    };
⋮----
export const useHeaderSecondLevel = ({
  title,
  backAccessibilityLabel,
  backTestID,
  goBack,
  headerShown = true,
  canGoBack = true,
  supportRequest,
  onStartSupportRequest = () => true,
  secondAction,
  thirdAction,
  transparent = false,
  scrollValues,
  variant,
  backgroundColor,
  enableDiscreteTransition,
  ignoreAccessibilityCheck,
  animatedRef
}: HeaderSecondLevelHookProps) =>
</file>

<file path="apps/main-app/ts/hooks/useIsScreenFocused.ts">
import { NavigationContext } from "@react-navigation/native";
import { useContext, useEffect, useState } from "react";
⋮----
export const useIsScreenFocused = (): boolean =>
</file>

<file path="apps/main-app/ts/hooks/useOfflineToastGuard.ts">
import { useIOToast } from "@io-app/design-system";
import { useRoute } from "@react-navigation/native";
import I18n from "i18next";
import { useCallback } from "react";
⋮----
import { isConnectedSelector } from "../features/connectivity/store/selectors";
import { offlineAccessReasonSelector } from "../features/ingress/store/selectors";
import { useIOSelector } from "../store/hooks";
import { trackOfflineActionNotAllowed } from "../utils/analytics.ts";
⋮----
export const useOfflineToastGuard = (fn: (...args: Array<any>) => any) =>
</file>

<file path="apps/main-app/ts/hooks/useOpenDeepLink.ts">
import { useLinkTo } from "@react-navigation/native";
⋮----
import { handleInternalLink } from "../utils/internalLink";
⋮----
export const useOpenDeepLink = () =>
</file>

<file path="apps/main-app/ts/hooks/useReduceMotionEnabled.ts">
import { useEffect, useRef, useState } from "react";
import { AccessibilityInfo } from "react-native";
⋮----
export const useReduceMotionEnabled = (): boolean =>
</file>

<file path="apps/main-app/ts/hooks/useRotationSensor.ts">
import { useEffect, useState } from "react";
import { AppState } from "react-native";
import {
  SensorConfig,
  SensorType,
  SharedValue,
  useAnimatedReaction,
  useAnimatedSensor,
  useSharedValue
} from "react-native-reanimated";
⋮----
import { useIsScreenFocused } from "./useIsScreenFocused";
import { useReduceMotionEnabled } from "./useReduceMotionEnabled";
⋮----
export const useRotationSensor = (): SharedValue<number> =>
⋮----
export const useRotationEffectEnabled = (): boolean =>
</file>

<file path="apps/main-app/ts/hooks/useScreenEndMargin.tsx">
import { IODimensions } from "@io-app/design-system";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
type EndScreenSpacingValues = {
  screenEndMargin: number;
  screenEndSafeArea: number;
};
⋮----
export const useScreenEndMargin = (): EndScreenSpacingValues =>
</file>

<file path="apps/main-app/ts/hooks/useScrollHeaderAnimation.tsx">
import {
  HeaderSecondLevel,
  hexToRgba,
  IOColors,
  useIOTheme
} from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import { ComponentProps, useLayoutEffect, useMemo } from "react";
import { ColorValue } from "react-native";
import { easeGradient } from "react-native-easing-gradient";
import {
  Easing,
  Extrapolation,
  interpolate,
  useAnimatedScrollHandler,
  useAnimatedStyle,
  useSharedValue
} from "react-native-reanimated";
⋮----
import { useIOAlertVisible } from "../components/StatusMessages/IOAlertVisibleContext";
import { IOListView } from "../components/ui/IOListView";
⋮----
export type ScrollAnimationHookProps = {
  headerConfig?: ComponentProps<typeof IOListView>["headerConfig"];
  snapOffset?: number;
};
⋮----
type IOViewHeaderScrollValues = ComponentProps<
  typeof HeaderSecondLevel
>["scrollValues"];
⋮----
export const useScrollHeaderAnimation = ({
  snapOffset,
  headerConfig
}: ScrollAnimationHookProps) =>
</file>

<file path="apps/main-app/ts/hooks/useSecuritySuggestionBottomSheet.tsx">
import I18n from "i18next";
import { useCallback, useEffect } from "react";
⋮----
import SecuritySuggestions from "../features/authentication/fastLogin/components/SecuritySuggestions";
import {
  isFastLoginFFEnabledSelector,
  isSecurityAdviceAcknowledgedEnabled,
  isSecurityAdviceReadyToShow
} from "../features/authentication/fastLogin/store/selectors";
import { useIOSelector } from "../store/hooks";
import { useIOBottomSheetModal } from "../utils/hooks/bottomSheet";
⋮----
export const useSecuritySuggestionsBottomSheet = (
  useManualBottomsheetOpening = true
) =>
</file>

<file path="apps/main-app/ts/hooks/useStartSupportRequest.ts">
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
import { useRoute } from "@react-navigation/native";
import { useCallback } from "react";
⋮----
import { zendeskSupportStart } from "../features/zendesk/store/actions";
import { useIODispatch, useIOSelector } from "../store/hooks";
import { assistanceToolConfigSelector } from "../store/reducers/backendStatus/remoteConfig";
import {
  assistanceToolRemoteConfig,
  resetCustomFields
} from "../utils/supportAssistance";
⋮----
export const useStartSupportRequest = () =>
</file>

<file path="apps/main-app/ts/hooks/useStatusAlertProps.tsx">
import { LevelEnum } from "@io-app/api-types/generated/definitions/content/StatusMessage";
import {
  AlertEdgeToEdgeProps,
  IOButton,
  IOMarkdown,
  VStack
} from "@io-app/design-system";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { JSX, useCallback, useEffect, useMemo, useState } from "react";
import { GestureResponderEvent } from "react-native";
⋮----
import { useIOAlertVisible } from "../components/StatusMessages/IOAlertVisibleContext";
import { AUTHENTICATION_ROUTES } from "../features/authentication/common/navigation/routes";
import { isConnectedSelector } from "../features/connectivity/store/selectors";
import { OfflineAccessReasonEnum } from "../features/ingress/store/reducer";
import { offlineAccessReasonSelector } from "../features/ingress/store/selectors";
import { useOfflineAlertDetailModal } from "../features/itwallet/common/hooks/useOfflineAlertDetailModal";
import { ITW_ROUTES } from "../features/itwallet/navigation/routes";
import { ITW_PROXIMITY_ROUTES } from "../features/itwallet/presentation/proximity/navigation/routes";
import { trackItwOfflineBottomSheet } from "../features/itwallet/wallet/analytics";
import { useAppRestartAction } from "../features/itwallet/wallet/hooks/useAppRestartAction";
import { mixpanelTrack } from "../mixpanel";
import { useCurrentRouteName } from "../navigation/NavigationService";
import { useIOSelector } from "../store/hooks";
import { statusMessageByRouteSelector } from "../store/reducers/backendStatus/statusMessages";
import { isStartupLoaded, StartupStatusEnum } from "../store/reducers/startup";
import { buildEventProperties } from "../utils/analytics";
import { useIOBottomSheetModal } from "../utils/hooks/bottomSheet";
import { usePrevious } from "../utils/hooks/usePrevious";
import {
  fallbackForLocalizedMessageKeys,
  getFullLocale
} from "../utils/locale";
import { openWebUrl } from "../utils/url";
⋮----
type AlertActionProps =
  | {
      action?: never;
      onPress?: never;
    }
  | {
      action?: string;
      onPress: (event: GestureResponderEvent) => void;
    };
⋮----
type AlertProps = {
  alertProps?: AlertEdgeToEdgeProps;
  bottomSheet?: JSX.Element;
};
⋮----
const buildMPEventProperties = (
  eventType: "action" | "screen_view",
  banner_page: string,
  banner_landing?: string
)
⋮----
export const useDerivedConnectivityState = () =>
⋮----
export const useStatusAlertProps = (): AlertProps | undefined =>
</file>

<file path="apps/main-app/ts/hooks/useTabItemPressWhenScreenActive.tsx">
import { useFocusEffect, useNavigation } from "@react-navigation/native";
import { useCallback } from "react";
⋮----
export function useTabItemPressWhenScreenActive(
  callback: () => void,
  hasInternalTab: boolean
)
</file>

<file path="apps/main-app/ts/mixpanelConfig/___tests___/mixpanelPropertyUtils.test.tsx">
import { PushNotificationsContentTypeEnum } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatusEnum } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
import { SpidLevelEnum } from "@io-app/api-types/generated/definitions/session_manager/SpidLevel";
⋮----
import mockedProfile from "../../__mocks__/initializedProfile";
import { NotificationPreferenceConfiguration } from "../../features/settings/common/analytics";
import { applicationChangeState } from "../../store/actions/application";
import { appReducer } from "../../store/reducers";
import { GlobalState } from "../../store/reducers/types";
import { SpidIdp } from "../../utils/idps";
import {
  authSecurityLevelHandler,
  cgnStatusHandler,
  loginMethodHandler,
  loginSessionConfigHandler,
  mixpanelOptInHandler,
  notificationConfigurationHandler,
  paymentMethodsHandler,
  serviceConfigHandler,
  welfareStatusHandler
} from "../mixpanelPropertyUtils";
</file>

<file path="apps/main-app/ts/mixpanelConfig/___tests___/profileProperties.test.ts">
import { PushNotificationsContentTypeEnum } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatusEnum } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
⋮----
import { ServicesState } from "../../features/services/common/store/reducers";
import { ServicePreferenceResponse } from "../../features/services/details/types/ServicePreferenceResponse";
import { GlobalState } from "../../store/reducers/types";
⋮----
import { SpidIdp } from "../../utils/idps";
import { updateMixpanelProfileProperties } from "../profileProperties";
⋮----
let mockIsMixpanelInitialized: ()
⋮----
const generateBaseProfileProperties = () => (
⋮----
mockIsMixpanelInitialized = ()
⋮----
const generatePNServicePreferences = (
      inbox: boolean
): ServicePreferenceResponse => (
⋮----
const generateIdp = (id: string, name: string): SpidIdp => (
⋮----
mockIsMixpanelInitialized = () =>
⋮----
const generateMockedGlobalState = (
  notificationToken: string | undefined,
  pushContent: PushNotificationsContentTypeEnum | undefined,
  pushReminder: ReminderStatusEnum | undefined
): GlobalState
</file>

<file path="apps/main-app/ts/mixpanelConfig/___tests___/superProperties.test.ts">
import { PushNotificationsContentTypeEnum } from "@io-app/api-types/generated/definitions/identity/PushNotificationsContentType";
import { ReminderStatusEnum } from "@io-app/api-types/generated/definitions/identity/ReminderStatus";
⋮----
import { MixpanelProperties } from "mixpanel-react-native";
import { Appearance } from "react-native";
⋮----
import { GlobalState } from "../../store/reducers/types";
⋮----
import { SpidIdp } from "../../utils/idps";
import { updateMixpanelSuperProperties } from "../superProperties";
⋮----
let mockIsMixpanelInitialized: ()
⋮----
mockIsMixpanelInitialized = ()
⋮----
const generateIdp = (id: string, name: string): SpidIdp => (
⋮----
const registerWith = async (
      authentication: Record<string, unknown>,
      isOneIdentityEnabled: boolean,
      isOneIdentityLogin: boolean | undefined = undefined
) =>
⋮----
mockIsMixpanelInitialized = () =>
⋮----
const generateMockedGlobalState = (
  pushContent: PushNotificationsContentTypeEnum | undefined,
  pushReminder: ReminderStatusEnum | undefined
): GlobalState
</file>

<file path="apps/main-app/ts/mixpanelConfig/mixpanelPropertyUtils.ts">
import { ServicesPreferencesModeEnum } from "@io-app/api-types/generated/definitions/identity/ServicesPreferencesMode";
⋮----
import { createSelector } from "reselect";
⋮----
import {
  idpSelector,
  spidLevelFromSessionInfoSelector
} from "../features/authentication/common/store/selectors";
import { isOneIdentityLoginEnabledSelector } from "../features/authentication/common/store/selectors/loginConfig";
import { isOneIdentityLoginSelector } from "../features/authentication/common/store/selectors/loginFlow";
import { LoginSessionDuration } from "../features/authentication/fastLogin/analytics/optinAnalytics";
import { fastLoginOptInSelector } from "../features/authentication/fastLogin/store/selectors";
import { TrackCgnStatus } from "../features/bonus/cgn/analytics";
import { paymentsWalletUserMethodsSelector } from "../features/payments/wallet/store/selectors";
import {
  getNotificationPreferenceConfiguration,
  NotificationPreferenceConfiguration,
  ServiceConfigurationTrackingType
} from "../features/settings/common/analytics";
import {
  profileNotificationSettingsSelector,
  profileServicePreferencesModeSelector
} from "../features/settings/common/store/selectors";
import {
  selectWalletCardsByType,
  selectWalletPlaceholderCards
} from "../features/wallet/store/selectors";
import { GlobalState } from "../store/reducers/types";
import { isMixpanelEnabled } from "./../store/reducers/persistedPreferences";
⋮----
export type Property<K, T extends keyof K> = {
  property: T;
  value: K[T];
};
⋮----
export type PropertyToUpdate<K> = {
  [T in keyof K]: Property<K, T>;
}[keyof K];
⋮----
export const loginSessionConfigHandler = (
  state: GlobalState
): LoginSessionDuration =>
⋮----
export const notificationConfigurationHandler = (
  state: GlobalState
): NotificationPreferenceConfiguration =>
⋮----
export const serviceConfigHandler = (
  state: GlobalState
): ServiceConfigurationTrackingType =>
⋮----
export type MixpanelOptInTrackingType = "accepted" | "declined" | "not set";
export const mixpanelOptInHandler = (
  state: GlobalState
): MixpanelOptInTrackingType =>
⋮----
export const paymentMethodsHandler = (state: GlobalState): number =>
⋮----
export const cgnStatusHandler = (state: GlobalState): TrackCgnStatus =>
⋮----
export const welfareStatusHandler = (
  state: GlobalState
): ReadonlyArray<string> =>
⋮----
export const cdcStatusHandler = (state: GlobalState): number =>
⋮----
export const authSecurityLevelHandler = (state: GlobalState): string
⋮----
export const loginMethodHandler = (state: GlobalState): string =>
⋮----
export const loginFlowIsOneIdentityHandler = (state: GlobalState): boolean
</file>

<file path="apps/main-app/ts/mixpanelConfig/profileProperties.ts">
import { LoginSessionDuration } from "../features/authentication/fastLogin/analytics/optinAnalytics";
import { TrackCgnStatus } from "../features/bonus/cgn/analytics";
import {
  booleanOrUndefinedToPNServiceStatus,
  PNServiceStatus
} from "../features/pn/analytics/index.ts";
import { isPnServiceEnabled } from "../features/pn/reminderBanner/reducer/bannerDismiss.ts";
import { checkNotificationPermissions } from "../features/pushNotifications/utils";
import {
  getNotificationPermissionType,
  getNotificationTokenType,
  NotificationPermissionType,
  NotificationPreferenceConfiguration,
  NotificationTokenType,
  ServiceConfigurationTrackingType
} from "../features/settings/common/analytics/index.ts";
import { tosVersionSelector } from "../features/settings/common/store/selectors/index.ts";
import { getPeople, isMixpanelInstanceInitialized } from "../mixpanel.ts";
import {
  fontPreferenceSelector,
  themePreferenceSelector
} from "../store/reducers/persistedPreferences.ts";
import { GlobalState } from "../store/reducers/types";
import { trackAppCaughtError } from "../utils/analytics.ts";
import { BiometricsType, getBiometricsType } from "../utils/biometrics";
import { unknownToString } from "../utils/errors.ts";
import {
  authSecurityLevelHandler,
  cdcStatusHandler,
  cgnStatusHandler,
  loginMethodHandler,
  loginSessionConfigHandler,
  mixpanelOptInHandler,
  MixpanelOptInTrackingType,
  notificationConfigurationHandler,
  paymentMethodsHandler,
  Property,
  PropertyToUpdate,
  serviceConfigHandler,
  welfareStatusHandler
} from "./mixpanelPropertyUtils";
⋮----
type ProfileProperties = {
  AUTH_SECURITY_LEVEL: string;
  BIOMETRIC_TECHNOLOGY: BiometricsType;
  CDC_STATUS: number;
  CGN_STATUS: TrackCgnStatus;
  FONT_PREFERENCE: string;
  LOGIN_METHOD: string;
  LOGIN_SESSION: LoginSessionDuration;
  NOTIFICATION_CONFIGURATION: NotificationPreferenceConfiguration;
  NOTIFICATION_PERMISSION: NotificationPermissionType;
  NOTIFICATION_TOKEN: NotificationTokenType;
  SAVED_PAYMENT_METHOD: number;
  SEND_STATUS: PNServiceStatus;
  SERVICE_CONFIGURATION: ServiceConfigurationTrackingType;
  THEME_PREFERENCE: string;
  TOS_ACCEPTED_VERSION: number | string;
  TRACKING: MixpanelOptInTrackingType;
  WELFARE_STATUS: ReadonlyArray<string>;
};
⋮----
export const updateMixpanelProfileProperties = async (
  state: GlobalState,
  forceUpdateFor?: PropertyToUpdate<ProfileProperties>
) =>
⋮----
const forceUpdate = <T extends keyof ProfileProperties>(
  profilePropertiesObject: ProfileProperties,
  toUpdate: Property<ProfileProperties, T>
) =>
⋮----
const tosVersionHandler = (state: GlobalState): number | string =>
</file>

<file path="apps/main-app/ts/mixpanelConfig/superProperties.ts">
import { Appearance, ColorSchemeName } from "react-native";
⋮----
import { LoginSessionDuration } from "../features/authentication/fastLogin/analytics/optinAnalytics";
import { TrackCgnStatus } from "../features/bonus/cgn/analytics";
import { isConnectedSelector } from "../features/connectivity/store/selectors";
import { checkNotificationPermissions } from "../features/pushNotifications/utils";
import {
  getNotificationPermissionType,
  NotificationPermissionType,
  NotificationPreferenceConfiguration,
  ServiceConfigurationTrackingType
} from "../features/settings/common/analytics";
import {
  isMixpanelInstanceInitialized,
  registerSuperProperties
} from "../mixpanel.ts";
import { GlobalState } from "../store/reducers/types";
import { isScreenReaderEnabled } from "../utils/accessibility";
import { trackAppCaughtError } from "../utils/analytics.ts";
import { getAppVersion } from "../utils/appVersion";
import { BiometricsType, getBiometricsType } from "../utils/biometrics";
import {
  getFontScale,
  isScreenLockSet as isScreenLockSetFunc
} from "../utils/device";
import { unknownToString } from "../utils/errors.ts";
import {
  authSecurityLevelHandler,
  cdcStatusHandler,
  cgnStatusHandler,
  loginFlowIsOneIdentityHandler,
  loginMethodHandler,
  loginSessionConfigHandler,
  notificationConfigurationHandler,
  paymentMethodsHandler,
  Property,
  PropertyToUpdate,
  serviceConfigHandler,
  welfareStatusHandler
} from "./mixpanelPropertyUtils";
⋮----
type ConnectivityStatus = "offline" | "online";
⋮----
type SuperProperties = {
  appReadableVersion: string;
  AUTH_SECURITY_LEVEL: string;
  biometricTechnology: BiometricsType;
  CDC_STATUS: number;
  CGN_STATUS: TrackCgnStatus;
  colorScheme: ColorSchemeName | null | undefined;
  CONNECTION_STATUS: ConnectivityStatus;
  fontScale: number;
  isScreenLockSet: boolean;
  isScreenReaderEnabled: boolean;
  LOGIN_FLOW_IS_OI: boolean;
  LOGIN_METHOD: string;
  LOGIN_SESSION: LoginSessionDuration;
  NOTIFICATION_CONFIGURATION: NotificationPreferenceConfiguration;
  NOTIFICATION_PERMISSION: NotificationPermissionType;
  SAVED_PAYMENT_METHOD?: number;
  SERVICE_CONFIGURATION: ServiceConfigurationTrackingType;
  WELFARE_STATUS: ReadonlyArray<string>;
};
⋮----
export const updateMixpanelSuperProperties = async (
  state: GlobalState,
  forceUpdateFor?: PropertyToUpdate<SuperProperties>
) =>
⋮----
const forceUpdate = <T extends keyof SuperProperties>(
  superPropertiesObject: SuperProperties,
  toUpdate: Property<SuperProperties, T>
) =>
⋮----
const offlineStatusHandler = (state: GlobalState): ConnectivityStatus =>
</file>

<file path="apps/main-app/ts/navigation/__test__/AppStackNavigator.test.tsx">
import { NavigationContainer, NavigationState } from "@react-navigation/native";
import { render } from "@testing-library/react-native";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { Provider } from "react-redux";
import configureMockStore from "redux-mock-store";
⋮----
import { AUTHENTICATION_ROUTES } from "../../features/authentication/common/navigation/routes";
import { ITW_ROUTES } from "../../features/itwallet/navigation/routes";
import { applicationChangeState } from "../../store/actions/application";
import { appReducer } from "../../store/reducers";
import { StartupStatusEnum } from "../../store/reducers/startup";
import { GlobalState } from "../../store/reducers/types";
import { AppStackNavigator, isMainNavigatorReady } from "../AppStackNavigator";
import ROUTES from "../routes";
⋮----
const createNavState = (routeName: string): NavigationState => (
⋮----
function renderComponent(startupStatus: StartupStatusEnum)
</file>

<file path="apps/main-app/ts/navigation/__test__/linkingSubscription.test.ts">
import configureMockStore from "redux-mock-store";
⋮----
import { IO_LOGIN_CIE_URL_SCHEME } from "../../features/authentication/login/cie/utils/cie";
import { parseCredentialOfferLink } from "../../features/itwallet/offer/utils";
import { storeLinkingUrl } from "../../features/linking/actions";
⋮----
import { resetMessageArchivingAction } from "../../features/messages/store/actions/archiving";
⋮----
import { initiateAarFlow } from "../../features/pn/aar/store/actions";
⋮----
import { applicationChangeState } from "../../store/actions/application";
import { appReducer } from "../../store/reducers";
import { GlobalState } from "../../store/reducers/types";
import { linkingSubscription } from "../linkingSubscription";
⋮----
const runEventListenerCallback = (
  eventListenerSpy: jest.SpyInstance,
  event: { url: string }
) =>
⋮----
const initializeTests = () =>
</file>

<file path="apps/main-app/ts/navigation/__test__/navigationSagas.test.ts">
import { runSaga } from "redux-saga";
⋮----
import {
  waitForMainNavigator,
  waitForNavigatorServiceInitialization
} from "../saga/navigation";
</file>

<file path="apps/main-app/ts/navigation/analytics/navigation.ts">
import { mixpanelTrack } from "../../mixpanel";
⋮----
export const trackNavigationServiceInitializationTimeout = () =>
⋮----
export const trackNavigationServiceInitializationCompleted = (
  elapsedTime: number
) =>
⋮----
export const trackMainNavigatorStackReadyTimeout = () =>
⋮----
export const trackMainNavigatorStackReadyOk = (elapsedTime: number) =>
</file>

<file path="apps/main-app/ts/navigation/components/CloseButton.tsx">
import { IconButton, IODimensions } from "@io-app/design-system";
import { useNavigation } from "@react-navigation/native";
import I18n from "i18next";
import { View } from "react-native";
⋮----
const CloseButton = () =>
⋮----
onPress=
</file>

<file path="apps/main-app/ts/navigation/params/AppParamsList.ts">
import { BottomTabNavigationProp } from "@react-navigation/bottom-tabs";
import {
  NavigatorScreenParams,
  ParamListBase,
  RouteProp,
  useNavigation
} from "@react-navigation/native";
import { StackNavigationProp } from "@react-navigation/stack";
⋮----
import { AuthenticationParamsList } from "../../features/authentication/common/navigation/params/AuthenticationParamsList.ts";
import { AUTHENTICATION_ROUTES } from "../../features/authentication/common/navigation/routes.ts";
import { CdcBonusRequestParamsList } from "../../features/bonus/cdc/common/navigation/params.ts";
import { CDC_ROUTES } from "../../features/bonus/cdc/common/navigation/routes.ts";
import {
  CgnActivationParamsList,
  CgnDetailsParamsList,
  CgnEYCAActivationParamsList
} from "../../features/bonus/cgn/navigation/params";
import CGN_ROUTES from "../../features/bonus/cgn/navigation/routes";
import { FciParamsList } from "../../features/fci/navigation/params";
import { FCI_ROUTES } from "../../features/fci/navigation/routes";
import {
  FIMS_ROUTES,
  FimsParamsList
} from "../../features/fims/common/navigation";
import { IdPayBarcodeParamsList } from "../../features/idpay/barcode/navigation/params";
import { IdPayBarcodeRoutes } from "../../features/idpay/barcode/navigation/routes";
import { IdPayCodeParamsList } from "../../features/idpay/code/navigation/params";
import { IdPayCodeRoutes } from "../../features/idpay/code/navigation/routes";
import { IdPayConfigurationParamsList } from "../../features/idpay/configuration/navigation/params";
import { IdPayConfigurationRoutes } from "../../features/idpay/configuration/navigation/routes";
import {
  IDPayDetailsParamsList,
  IDPayDetailsRoutes
} from "../../features/idpay/details/navigation";
import { IdPayOnboardingParamsList } from "../../features/idpay/onboarding/navigation/params";
import { IdPayOnboardingRoutes } from "../../features/idpay/onboarding/navigation/routes";
import { IdPayPaymentParamsList } from "../../features/idpay/payment/navigation/params";
import { IdPayPaymentRoutes } from "../../features/idpay/payment/navigation/routes";
import { IdPayUnsubscriptionParamsList } from "../../features/idpay/unsubscription/navigation/params";
import { IdPayUnsubscriptionRoutes } from "../../features/idpay/unsubscription/navigation/routes";
import { ItwParamsList } from "../../features/itwallet/navigation/ItwParamsList";
import { ITW_ROUTES } from "../../features/itwallet/navigation/routes";
import { ItwProximityParamsList } from "../../features/itwallet/presentation/proximity/navigation/ItwProximityParamsList";
import { ITW_PROXIMITY_ROUTES } from "../../features/itwallet/presentation/proximity/navigation/routes";
import { ItwRemoteParamsList } from "../../features/itwallet/presentation/remote/navigation/ItwRemoteParamsList.ts";
import { ITW_REMOTE_ROUTES } from "../../features/itwallet/presentation/remote/navigation/routes.ts";
import { MessagesParamsList } from "../../features/messages/navigation/params";
import { MESSAGES_ROUTES } from "../../features/messages/navigation/routes";
import { OnboardingParamsList } from "../../features/onboarding/navigation/params/OnboardingParamsList.ts";
import { PaymentsBarcodeParamsList } from "../../features/payments/barcode/navigation/params";
import { PaymentsBarcodeRoutes } from "../../features/payments/barcode/navigation/routes";
import { PaymentsCheckoutParamsList } from "../../features/payments/checkout/navigation/params";
import { PaymentsCheckoutRoutes } from "../../features/payments/checkout/navigation/routes";
import { PaymentsMethodDetailsParamsList } from "../../features/payments/details/navigation/params";
import { PaymentsMethodDetailsRoutes } from "../../features/payments/details/navigation/routes";
import { PaymentsOnboardingParamsList } from "../../features/payments/onboarding/navigation/params";
import { PaymentsOnboardingRoutes } from "../../features/payments/onboarding/navigation/routes";
import { PaymentsReceiptParamsList } from "../../features/payments/receipts/navigation/params";
import { PaymentsReceiptRoutes } from "../../features/payments/receipts/navigation/routes";
import { NOTIFICATIONS_ROUTES } from "../../features/pushNotifications/navigation/routes";
import { PushNotificationEngagementScreenNavigationParams } from "../../features/pushNotifications/screens/PushNotificationEngagementScreen.tsx";
import { ServicesParamsList } from "../../features/services/common/navigation/params";
import { SERVICES_ROUTES } from "../../features/services/common/navigation/routes";
import { SettingsParamsList } from "../../features/settings/common/navigation/params/SettingsParamsList.ts";
import { SETTINGS_ROUTES } from "../../features/settings/common/navigation/routes.ts";
import { ZendeskParamsList } from "../../features/zendesk/navigation/params";
import ZENDESK_ROUTES from "../../features/zendesk/navigation/routes";
import ROUTES from "../routes";
import { CheckEmailParamsList } from "./CheckEmailParamsList";
import { MainTabParamsList } from "./MainTabParamsList";
⋮----
export type AppParamsList = {
  [AUTHENTICATION_ROUTES.MAIN]: NavigatorScreenParams<AuthenticationParamsList>;
  [CDC_ROUTES.CDC_MAIN]: NavigatorScreenParams<CdcBonusRequestParamsList>;
  [CGN_ROUTES.ACTIVATION.MAIN]: NavigatorScreenParams<CgnActivationParamsList>;
  [CGN_ROUTES.DETAILS.MAIN]: NavigatorScreenParams<CgnDetailsParamsList>;
  [CGN_ROUTES.EYCA.ACTIVATION
    .MAIN]: NavigatorScreenParams<CgnEYCAActivationParamsList>;
  [FCI_ROUTES.MAIN]: NavigatorScreenParams<FciParamsList>;
  [FIMS_ROUTES.MAIN]: NavigatorScreenParams<FimsParamsList>;
  [IdPayBarcodeRoutes.IDPAY_BARCODE_MAIN]: NavigatorScreenParams<IdPayBarcodeParamsList>;
  [IdPayCodeRoutes.IDPAY_CODE_MAIN]: NavigatorScreenParams<IdPayCodeParamsList>;
  [IdPayConfigurationRoutes.IDPAY_CONFIGURATION_NAVIGATOR]: NavigatorScreenParams<IdPayConfigurationParamsList>;
  [IDPayDetailsRoutes.IDPAY_DETAILS_MAIN]: NavigatorScreenParams<IDPayDetailsParamsList>;
  [IdPayOnboardingRoutes.IDPAY_ONBOARDING_MAIN]: NavigatorScreenParams<IdPayOnboardingParamsList>;
  [IdPayPaymentRoutes.IDPAY_PAYMENT_CODE_SCAN]: undefined;
  [IdPayPaymentRoutes.IDPAY_PAYMENT_MAIN]: NavigatorScreenParams<IdPayPaymentParamsList>;
  [IdPayUnsubscriptionRoutes.IDPAY_UNSUBSCRIPTION_MAIN]: NavigatorScreenParams<IdPayUnsubscriptionParamsList>;
  [ITW_PROXIMITY_ROUTES.MAIN]: NavigatorScreenParams<ItwProximityParamsList>;
  [ITW_REMOTE_ROUTES.MAIN]: NavigatorScreenParams<ItwRemoteParamsList>;
  [ITW_ROUTES.MAIN]: NavigatorScreenParams<ItwParamsList>;
  [MESSAGES_ROUTES.MESSAGES_NAVIGATOR]: NavigatorScreenParams<MessagesParamsList>;
  [MESSAGES_ROUTES.MESSAGES_SEARCH]: undefined;
  [NOTIFICATIONS_ROUTES.PUSH_NOTIFICATION_ENGAGEMENT]: PushNotificationEngagementScreenNavigationParams;
  [NOTIFICATIONS_ROUTES.SYSTEM_NOTIFICATION_PERMISSIONS]: undefined;
  [PaymentsBarcodeRoutes.PAYMENT_BARCODE_NAVIGATOR]: NavigatorScreenParams<PaymentsBarcodeParamsList>;
  [PaymentsCheckoutRoutes.PAYMENT_CHECKOUT_NAVIGATOR]: NavigatorScreenParams<PaymentsCheckoutParamsList>;
  [PaymentsMethodDetailsRoutes.PAYMENT_METHOD_DETAILS_NAVIGATOR]: NavigatorScreenParams<PaymentsMethodDetailsParamsList>;
  [PaymentsOnboardingRoutes.PAYMENT_ONBOARDING_NAVIGATOR]: NavigatorScreenParams<PaymentsOnboardingParamsList>;
... (39 lines truncated)
</file>

<file path="apps/main-app/ts/navigation/params/CheckEmailParamsList.ts">
import { EmailAlreadyUsedScreenParamList } from "../../features/mailCheck/screens/EmailAlreadyTakenScreen";
import { EmailNotVerifiedScreenParamList } from "../../features/mailCheck/screens/ValidateEmailScreen";
import ROUTES from "../routes";
⋮----
export type CheckEmailParamsList = {
  [ROUTES.CHECK_EMAIL_ALREADY_TAKEN]: EmailAlreadyUsedScreenParamList;
  [ROUTES.CHECK_EMAIL_NOT_VERIFIED]: EmailNotVerifiedScreenParamList;
};
</file>

<file path="apps/main-app/ts/navigation/params/MainTabParamsList.ts">
import { MESSAGES_ROUTES } from "../../features/messages/navigation/routes";
import { SERVICES_ROUTES } from "../../features/services/common/navigation/routes";
import { WalletHomeNavigationParams } from "../../features/wallet/screens/WalletHomeScreen";
import ROUTES from "../routes";
⋮----
export type MainTabParamsList = {
  [MESSAGES_ROUTES.MESSAGES_HOME]: undefined;
  [ROUTES.BARCODE_SCAN_TAB_EMPTY]: undefined;
  [ROUTES.PAYMENTS_HOME]: undefined;
  [ROUTES.WALLET_HOME]: WalletHomeNavigationParams;
  [SERVICES_ROUTES.SERVICES_HOME]: undefined;
};
</file>

<file path="apps/main-app/ts/navigation/saga/navigation.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { call, delay } from "typed-redux-saga/macro";
⋮----
import {
  trackMainNavigatorStackReadyOk,
  trackMainNavigatorStackReadyTimeout,
  trackNavigationServiceInitializationCompleted,
  trackNavigationServiceInitializationTimeout
} from "../analytics/navigation";
import NavigationService from "../NavigationService";
</file>

<file path="apps/main-app/ts/navigation/AppStackNavigator.tsx">
import { IOColors, useIOTheme, useIOThemeContext } from "@io-app/design-system";
import {
  LinkingOptions,
  NavigationContainer,
  NavigationContainerProps
} from "@react-navigation/native";
import { PropsWithChildren, ReactElement, useEffect, useRef } from "react";
import { Linking, View } from "react-native";
⋮----
import { useStoredExperimentalDesign } from "../common/context/DSExperimentalContext";
import { useStoredFontPreference } from "../common/context/DSTypefaceContext";
import LoadingSpinnerOverlay from "../components/LoadingSpinnerOverlay";
import FocusAwareStatusBar from "../components/ui/FocusAwareStatusBar";
import { cgnLinkingOptions } from "../features/bonus/cgn/navigation/navigator";
import { fciLinkingOptions } from "../features/fci/navigation/FciStackNavigator";
import { idPayLinkingOptions } from "../features/idpay/common/navigation/linking";
import { itwLinkingOptions } from "../features/itwallet/navigation/linking";
import { ITW_ROUTES } from "../features/itwallet/navigation/routes";
import { ITW_CREDENTIAL_OFFER_LINKING_PREFIXES } from "../features/itwallet/offer/utils";
import { storeLinkingUrl } from "../features/linking/actions";
import { trackIOOpenedFromUniversalAppLink } from "../features/linking/analytics";
import { MESSAGES_ROUTES } from "../features/messages/navigation/routes";
import { SERVICES_ROUTES } from "../features/services/common/navigation/routes";
import { SETTINGS_ROUTES } from "../features/settings/common/navigation/routes";
import { processUtmLink } from "../features/utmLink";
import { startApplicationInitialization } from "../store/actions/application";
import { useIODispatch, useIOSelector, useIOStore } from "../store/hooks";
import { trackScreen } from "../store/middlewares/navigation";
import { isCGNEnabledAfterLoadSelector } from "../store/reducers/backendStatus/remoteConfig";
import { isMixpanelEnabled } from "../store/reducers/persistedPreferences";
import { isStartupLoaded, StartupStatusEnum } from "../store/reducers/startup";
import { isTestEnv } from "../utils/environment";
import { useOnFirstRender } from "../utils/hooks/useOnFirstRender";
import {
  IO_INTERNAL_LINK_PREFIX,
  IO_UNIVERSAL_LINK_PREFIX
} from "../utils/navigation";
import AuthenticatedStackNavigator from "./AuthenticatedStackNavigator";
import IngressStackNavigator from "./IngressStackNavigator";
import { linkingSubscription } from "./linkingSubscription";
import NavigationService, {
  navigationRef,
  notifyCurrentRouteChanged,
  setMainNavigatorReady
} from "./NavigationService";
import NotAuthenticatedStackNavigator from "./NotAuthenticatedStackNavigator";
import OfflineStackNavigator from "./OfflineStackNavigator";
import { AppParamsList } from "./params/AppParamsList";
import ROUTES from "./routes";
import { IONavigationDarkTheme, IONavigationLightTheme } from "./theme";
⋮----
type OnStateChangeStateType = Parameters<
  NonNullable<NavigationContainerProps["onStateChange"]>
>[0];
export const isMainNavigatorReady = (state: OnStateChangeStateType) =>
⋮----
export const AppStackNavigator = (): ReactElement =>
⋮----
type InnerNavigationContainerProps = PropsWithChildren;
⋮----
NavigationService.setNavigationReady();
⋮----
if (isMainNavigatorReady(state))
</file>

<file path="apps/main-app/ts/navigation/AuthenticatedStackNavigator.tsx">
import {
  createStackNavigator,
  TransitionPresets
} from "@react-navigation/stack";
import { Platform } from "react-native";
⋮----
import WorkunitGenericFailure from "../components/error/WorkunitGenericFailure";
import { BarcodeScanScreen } from "../features/barcode/screens/BarcodeScanScreen";
import { CdcNavigator } from "../features/bonus/cdc/common/navigation/navigator.tsx";
import { CDC_ROUTES } from "../features/bonus/cdc/common/navigation/routes.ts";
import {
  CgnActivationNavigator,
  CgnDetailsNavigator,
  CgnEYCAActivationNavigator
} from "../features/bonus/cgn/navigation/navigator";
import CGN_ROUTES from "../features/bonus/cgn/navigation/routes";
import { FciStackNavigator } from "../features/fci/navigation/FciStackNavigator";
import { FCI_ROUTES } from "../features/fci/navigation/routes";
import { FIMS_ROUTES, FimsNavigator } from "../features/fims/common/navigation";
import { IdPayBarcodeNavigator } from "../features/idpay/barcode/navigation/navigator";
import { IdPayBarcodeRoutes } from "../features/idpay/barcode/navigation/routes";
import { IdPayCodeNavigator } from "../features/idpay/code/navigation/navigator";
import { IdPayCodeRoutes } from "../features/idpay/code/navigation/routes";
import { IdPayConfigurationNavigator } from "../features/idpay/configuration/navigation/navigator";
import { IdPayConfigurationRoutes } from "../features/idpay/configuration/navigation/routes";
import {
  IDpayDetailsNavigator,
  IDPayDetailsRoutes
} from "../features/idpay/details/navigation";
import { IdPayOnboardingNavigator } from "../features/idpay/onboarding/navigation/navigator";
import { IdPayOnboardingRoutes } from "../features/idpay/onboarding/navigation/routes";
import { IdPayPaymentNavigator } from "../features/idpay/payment/navigation/navigator";
import { IdPayPaymentRoutes } from "../features/idpay/payment/navigation/routes";
import { IDPayPaymentCodeScanScreen } from "../features/idpay/payment/screens/IDPayPaymentCodeScanScreen";
import { IdPayUnsubscriptionNavigator } from "../features/idpay/unsubscription/navigation/navigator";
import { IdPayUnsubscriptionRoutes } from "../features/idpay/unsubscription/navigation/routes";
import { ItwStackNavigator } from "../features/itwallet/navigation/ItwStackNavigator";
import { ITW_ROUTES } from "../features/itwallet/navigation/routes";
import { ItwProximityStackNavigator } from "../features/itwallet/presentation/proximity/navigation/ItwProximityStackNavigator";
import { ITW_PROXIMITY_ROUTES } from "../features/itwallet/presentation/proximity/navigation/routes";
import { ItwRemoteStackNavigator } from "../features/itwallet/presentation/remote/navigation/ItwRemoteStackNavigator.tsx";
import { ITW_REMOTE_ROUTES } from "../features/itwallet/presentation/remote/navigation/routes.ts";
import UnsupportedDeviceScreen from "../features/lollipop/screens/UnsupportedDeviceScreen";
import CheckEmailNavigator from "../features/mailCheck/navigation/CheckEmailNavigator.tsx";
import { MessagesStackNavigator } from "../features/messages/navigation/MessagesNavigator";
import { MESSAGES_ROUTES } from "../features/messages/navigation/routes";
import { MessagesSearchScreen } from "../features/messages/screens/MessagesSearchScreen";
import OnboardingNavigator from "../features/onboarding/navigation/OnboardingNavigator.tsx";
import { PageNotFound } from "../features/pageNotFound/screens";
import { WalletBarcodeNavigator } from "../features/payments/barcode/navigation/navigator";
import { PaymentsBarcodeRoutes } from "../features/payments/barcode/navigation/routes";
import { PaymentsCheckoutNavigator } from "../features/payments/checkout/navigation/navigator";
import { PaymentsCheckoutRoutes } from "../features/payments/checkout/navigation/routes";
import { PaymentsMethodDetailsNavigator } from "../features/payments/details/navigation/navigator";
import { PaymentsMethodDetailsRoutes } from "../features/payments/details/navigation/routes";
import { PaymentsOnboardingNavigator } from "../features/payments/onboarding/navigation/navigator";
import { PaymentsOnboardingRoutes } from "../features/payments/onboarding/navigation/routes";
import { PaymentsReceiptNavigator } from "../features/payments/receipts/navigation/navigator";
import { PaymentsReceiptRoutes } from "../features/payments/receipts/navigation/routes";
import { NOTIFICATIONS_ROUTES } from "../features/pushNotifications/navigation/routes";
import { PushNotificationEngagementScreen } from "../features/pushNotifications/screens/PushNotificationEngagementScreen.tsx";
import { SystemNotificationPermissionsScreen } from "../features/pushNotifications/screens/SystemNotificationPermissionsScreen";
import ServicesNavigator from "../features/services/common/navigation/navigator";
import { SERVICES_ROUTES } from "../features/services/common/navigation/routes";
import { SearchScreen } from "../features/services/search/screens/SearchScreen";
import { SETTINGS_ROUTES } from "../features/settings/common/navigation/routes.ts";
import SettingsStackNavigator from "../features/settings/common/navigation/SettingsNavigator.tsx";
import { ZendeskStackNavigator } from "../features/zendesk/navigation/navigator";
import ZENDESK_ROUTES from "../features/zendesk/navigation/routes";
import { useIOSelector } from "../store/hooks";
import {
  isCdcAppVersionSupportedSelector,
  isCGNEnabledSelector
} from "../store/reducers/backendStatus/remoteConfig";
import { isGestureEnabled } from "../utils/navigation";
import { AppParamsList } from "./params/AppParamsList";
import ROUTES from "./routes";
import { MainTabNavigator } from "./TabNavigator";
⋮----
const AuthenticatedStackNavigator = () =>
⋮----
...Platform.select(
</file>

<file path="apps/main-app/ts/navigation/IngressStackNavigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
⋮----
import { IngressScreen } from "../features/ingress/screens/IngressScreen";
import { AppParamsList } from "./params/AppParamsList";
import ROUTES from "./routes";
⋮----
const IngressStackNavigator = () => (
  <Stack.Navigator
    initialRouteName={ROUTES.INGRESS}
    screenOptions={{ headerShown: false, gestureEnabled: false }}
  >
    <Stack.Screen component={IngressScreen} name={ROUTES.INGRESS} />
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/navigation/linkingSubscription.ts">
import { Linking } from "react-native";
import { Action, Dispatch, Store } from "redux";
⋮----
import { isLoggedIn } from "../features/authentication/common/store/utils/guards";
import { IO_LOGIN_CIE_URL_SCHEME } from "../features/authentication/login/cie/utils/cie";
import { parseCredentialOfferLink } from "../features/itwallet/offer/utils";
import { storeLinkingUrl } from "../features/linking/actions";
import { trackIOOpenedFromUniversalAppLink } from "../features/linking/analytics";
import { resetMessageArchivingAction } from "../features/messages/store/actions/archiving";
import { isArchivingDisabledSelector } from "../features/messages/store/reducers/archiving";
import { initiateAarFlow } from "../features/pn/aar/store/actions";
import { isSendAarLink } from "../features/pn/aar/utils/deepLinking";
import { processUtmLink } from "../features/utmLink";
import { walletUpdate } from "../features/wallet/store/actions";
import { isMixpanelEnabled } from "../store/reducers/persistedPreferences";
import { GlobalState } from "../store/reducers/types";
import { shouldTriggerWalletUpdate } from "../utils/deepLinkUtils";
⋮----
const isDeepLinkBlackListed = (url: string): boolean
⋮----
export const linkingSubscription =
(dispatch: Dispatch<Action>, store: Store<Readonly<GlobalState>>)
</file>

<file path="apps/main-app/ts/navigation/NavigationService.ts">
import {
  NavigationAction,
  NavigationContainerRef
} from "@react-navigation/native";
import { Route } from "@react-navigation/routers";
import { createRef, RefObject, useSyncExternalStore } from "react";
⋮----
import { mixpanelTrack } from "../mixpanel";
import { AppParamsList } from "./params/AppParamsList";
⋮----
export const setMainNavigatorReady = (isReady?: boolean) =>
⋮----
export const setNavigationReady = () =>
⋮----
export const getIsNavigationReady = ()
⋮----
const withLogging =
<A extends Array<unknown>, R>(f: (...a: A)
⋮----
const getNavigator =
(): RefObject<NavigationContainerRef<AppParamsList> | null>
⋮----
export type NavigationParams<T extends keyof AppParamsList> = T extends unknown
  ?
    undefined extends AppParamsList[T]
    ? [screen: T, params: AppParamsList[T]] | [screen: T]
    : [screen: T, params: AppParamsList[T]]
  : never;
⋮----
const navigate = <T extends keyof AppParamsList>(
  ...args: NavigationParams<T>
) =>
⋮----
const dispatchNavigationAction = (action: NavigationAction) =>
⋮----
const getIsMainNavigatorReady = ()
⋮----
const getCurrentRouteName = (): string | undefined
⋮----
const getCurrentRouteKey = (): string | undefined
⋮----
const getCurrentRoute = (): Route<string> | undefined
⋮----
const getCurrentState = ()
⋮----
export const notifyCurrentRouteChanged = () =>
⋮----
const subscribeToCurrentRoute = (listener: () => void) =>
⋮----
export const useCurrentRouteName = (): string
</file>

<file path="apps/main-app/ts/navigation/NotAuthenticatedStackNavigator.tsx">
import { createStackNavigator } from "@react-navigation/stack";
import { Platform } from "react-native";
⋮----
import AuthenticationNavigator from "../features/authentication/common/navigation/AuthenticationNavigator";
import { AUTHENTICATION_ROUTES } from "../features/authentication/common/navigation/routes";
import { ZendeskStackNavigator } from "../features/zendesk/navigation/navigator";
import ZENDESK_ROUTES from "../features/zendesk/navigation/routes";
import { AppParamsList } from "./params/AppParamsList";
⋮----
const NotAuthenticatedStackNavigator = () => (
  <Stack.Navigator
    initialRouteName={AUTHENTICATION_ROUTES.MAIN}
    screenOptions={{ gestureEnabled: false, headerShown: false }}
  >
    <Stack.Screen
      component={AuthenticationNavigator}
      name={AUTHENTICATION_ROUTES.MAIN}
    />
    <Stack.Group
      screenOptions={{
        headerMode: "screen",
        presentation: Platform.OS === "ios" ? "modal" : "card"
      }}
    >
      <Stack.Screen
        component={ZendeskStackNavigator}
        name={ZENDESK_ROUTES.MAIN}
      />
    </Stack.Group>
  </Stack.Navigator>
);
</file>

<file path="apps/main-app/ts/navigation/OfflineStackNavigator.tsx">
import {
  createStackNavigator,
  TransitionPresets
} from "@react-navigation/stack";
⋮----
import { OfflineFailureScreen } from "../components/error/OfflineFailure";
import { ItwStackNavigator } from "../features/itwallet/navigation/ItwStackNavigator";
import { ITW_ROUTES } from "../features/itwallet/navigation/routes";
import { ItwProximityStackNavigator } from "../features/itwallet/presentation/proximity/navigation/ItwProximityStackNavigator";
import { ITW_PROXIMITY_ROUTES } from "../features/itwallet/presentation/proximity/navigation/routes";
import { isGestureEnabled } from "../utils/navigation";
import { AppParamsList } from "./params/AppParamsList";
import ROUTES from "./routes";
</file>

<file path="apps/main-app/ts/navigation/routes.ts">

</file>

<file path="apps/main-app/ts/navigation/TabNavigator.tsx">
import {
  IOColors,
  makeFontStyleObject,
  useIOTheme
} from "@io-app/design-system";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import I18n from "i18next";
⋮----
import LoadingSpinnerOverlay from "../components/LoadingSpinnerOverlay";
import { TabIconComponent } from "../components/ui/TabIconComponent";
import { MESSAGES_ROUTES } from "../features/messages/navigation/routes";
import { MessagesHomeScreen } from "../features/messages/screens/MessagesHomeScreen";
import { PaymentsHomeScreen } from "../features/payments/home/screens/PaymentsHomeScreen";
import { SERVICES_ROUTES } from "../features/services/common/navigation/routes";
import { ServicesHomeScreen } from "../features/services/home/screens/ServicesHomeScreen";
import { WalletHomeScreen } from "../features/wallet/screens/WalletHomeScreen";
import { useBottomTabNavigatorStyle } from "../hooks/useBottomTabNavigatorStyle";
import { useIOSelector } from "../store/hooks";
import { fontPreferenceSelector } from "../store/reducers/persistedPreferences";
import { isStartupLoaded, StartupStatusEnum } from "../store/reducers/startup";
import { getListItemAccessibilityLabelCount } from "../utils/accessibility";
import { useIONavigation } from "./params/AppParamsList";
import { MainTabParamsList } from "./params/MainTabParamsList";
import ROUTES from "./routes";
⋮----
const getTabAccessibilityLabel = (label: string, index: number)
⋮----
const navigateToBarcodeScanScreen = () =>
⋮----
preventDefault();
navigateToBarcodeScanScreen();
</file>

<file path="apps/main-app/ts/navigation/theme.ts">
import { IOColors, IOThemeDark, IOThemeLight } from "@io-app/design-system";
import { DarkTheme, DefaultTheme } from "@react-navigation/native";
</file>

<file path="apps/main-app/ts/sagas/commons/index.ts">
import { put } from "typed-redux-saga/macro";
⋮----
import { clearCache } from "../../features/settings/common/store/actions";
import { setMainNavigatorReady } from "../../navigation/NavigationService";
import { startApplicationInitialization } from "../../store/actions/application";
import { resetAssistanceData } from "../../utils/supportAssistance";
</file>

<file path="apps/main-app/ts/sagas/services/servicesOptinSaga.ts">
import { StackActions } from "@react-navigation/native";
import { call, select, take } from "typed-redux-saga/macro";
⋮----
import { servicesOptinCompleted } from "../../features/onboarding/store/actions";
import { profileServicePreferencesModeSelector } from "../../features/settings/common/store/selectors";
import { isServicesPreferenceModeSet } from "../../features/settings/common/store/utils/guards";
import NavigationService from "../../navigation/NavigationService";
import { navigateToServicesPreferenceModeSelectionScreen } from "../../store/actions/navigation";
</file>

<file path="apps/main-app/ts/sagas/startup/appVersionHistorySaga.ts">
import { put } from "typed-redux-saga/macro";
⋮----
import { appVersionHistory } from "../../store/actions/installation";
import { getAppVersion } from "../../utils/appVersion";
</file>

<file path="apps/main-app/ts/sagas/startup/checkAcceptedTosSaga.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { StackActions } from "@react-navigation/native";
import { call, put, select, take } from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import { tosAccepted } from "../../features/onboarding/store/actions";
import { profileUpsert } from "../../features/settings/common/store/actions";
import { isProfileFirstOnBoarding } from "../../features/settings/common/store/utils/guards";
import { tosConfigSelector } from "../../features/tos/store/selectors";
import NavigationService from "../../navigation/NavigationService";
import { navigateToTosScreen } from "../../store/actions/navigation";
import { ReduxSagaEffect } from "../../types/utils";
</file>

<file path="apps/main-app/ts/sagas/startup/checkConfiguredPinSaga.ts">
import { CommonActions } from "@react-navigation/native";
import { call, select, take } from "typed-redux-saga/macro";
⋮----
import { isFastLoginEnabledSelector } from "../../features/authentication/fastLogin/store/selectors";
import { isValidPinNumber } from "../../features/authentication/fastLogin/utils/pinPolicy";
import { createPinSuccess } from "../../features/settings/security/store/actions/pinset";
import NavigationService from "../../navigation/NavigationService";
import ROUTES from "../../navigation/routes";
import { navigateToOnboardingPinScreenAction } from "../../store/actions/navigation";
import { PinString } from "../../types/PinString";
import { ReduxSagaEffect } from "../../types/utils";
import { getPin } from "../../utils/keychain";
</file>

<file path="apps/main-app/ts/sagas/startup/checkItWalletIdentitySaga.ts">
import { CommonActions, StackActions } from "@react-navigation/native";
import { call, cancel, fork, select, take } from "typed-redux-saga/macro";
⋮----
import { selectItwEnv } from "../../features/itwallet/common/store/selectors/environment";
import { getEnv } from "../../features/itwallet/common/utils/environment";
import { selectFiscalCodeFromEid } from "../../features/itwallet/credentials/store/selectors";
import { watchItwLifecycleSaga } from "../../features/itwallet/lifecycle/saga";
import { itwLifecycleIdentityCheckCompleted } from "../../features/itwallet/lifecycle/store/actions";
import { itwLifecycleIsValidSelector } from "../../features/itwallet/lifecycle/store/selectors";
import { ITW_ROUTES } from "../../features/itwallet/navigation/routes";
import { profileFiscalCodeSelector } from "../../features/settings/common/store/selectors";
import NavigationService from "../../navigation/NavigationService";
</file>

<file path="apps/main-app/ts/sagas/startup/checkProfileEnabledSaga.ts">
import { InitializedProfile } from "@io-app/api-types/generated/definitions/identity/InitializedProfile";
import { pipe } from "fp-ts/lib/function";
⋮----
import { call, put, take } from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import {
  profileFirstLogin,
  profileUpsert
} from "../../features/settings/common/store/actions";
import {
  hasProfileEmail,
  isProfileFirstOnBoarding
} from "../../features/settings/common/store/utils/guards";
import { startApplicationInitialization } from "../../store/actions/application";
import { ReduxSagaEffect } from "../../types/utils";
</file>

<file path="apps/main-app/ts/sagas/startup/watchApplicationActivitySaga.ts">
import { AppStateStatus } from "react-native";
import { call, fork, put, select, takeLatest } from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import { backgroundActivityTimeout } from "../../config";
import { areTwoMinElapsedFromLastActivity } from "../../features/authentication/fastLogin/store/actions/sessionRefreshActions";
import { isFastLoginEnabledSelector } from "../../features/authentication/fastLogin/store/selectors";
import { identificationRequest } from "../../features/identification/store/actions";
import { IdentificationBackActionType } from "../../features/identification/store/reducers";
import NavigationService from "../../navigation/NavigationService";
import { applicationChangeState } from "../../store/actions/application";
import {
  isStartupLoaded,
  StartupStatusEnum
} from "../../store/reducers/startup";
import { ReduxSagaEffect } from "../../types/utils";
import { maybeHandlePendingBackgroundActions } from "../backgroundActions";
</file>

<file path="apps/main-app/ts/sagas/workUnit/index.ts">
import { CommonActions } from "@react-navigation/native";
import { call, take } from "typed-redux-saga/macro";
import {
  ActionCreator,
  ActionType,
  isActionOf,
  TypeConstant
} from "typesafe-actions";
⋮----
import NavigationService from "../../navigation/NavigationService";
import { navigateToWorkunitGenericFailureScreen } from "../../store/actions/navigation";
import { ReduxSagaEffect } from "../../types/utils";
⋮----
export type SagaResult = "back" | "cancel" | "completed" | "failure";
⋮----
export type WorkUnit = {
  back: ActionCreator<TypeConstant>;
  cancel: ActionCreator<TypeConstant>;
  complete: ActionCreator<TypeConstant>;
  failure: ActionCreator<TypeConstant>;
  startScreenName: string;
  startScreenNavigation: () => void;
};
</file>

<file path="apps/main-app/ts/sagas/backendStatus.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
⋮----
import { call, fork, put, select } from "typed-redux-saga/macro";
⋮----
import { CdnBackendStatusClient } from "../api/backendPublic";
import { contentRepoUrl } from "../config";
import { backendStatusLoadSuccess } from "../store/actions/backendStatus";
import {
  deadsCounterSelector,
  isBackendServicesStatusOffSelector
} from "../store/reducers/backendStatus/backendInfo";
import { ReduxSagaEffect, SagaCallReturnType } from "../types/utils";
import { startTimer } from "../utils/timer";
</file>

<file path="apps/main-app/ts/sagas/backgroundActions.ts">
import { call } from "typed-redux-saga/macro";
⋮----
import { handleStoredLinkingUrlIfNeeded } from "../features/linking/sagas";
import { handlePushNotificationIfNeeded } from "../features/pushNotifications/sagas/common";
</file>

<file path="apps/main-app/ts/sagas/contentLoaders.ts">
import { ContextualHelp } from "@io-app/api-types/generated/definitions/content/ContextualHelp";
import { Municipality as MunicipalityMedadata } from "@io-app/api-types/generated/definitions/content/Municipality";
⋮----
import { readableReport } from "@pagopa/ts-commons/lib/reporters";
import { BasicResponseType } from "@pagopa/ts-commons/lib/requests";
⋮----
import { SagaIterator } from "redux-saga";
import { call, put, takeEvery, takeLatest } from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import { ContentClient } from "../api/content";
import { loadAvailableBonuses } from "../features/bonus/common/store/actions/availableBonusesTypes";
import {
  contentMunicipalityLoad,
  loadContextualHelpData,
  loadIdps
} from "../store/actions/content";
import { CodiceCatastale } from "../types/MunicipalityCodiceCatastale";
import { ReduxSagaEffect, SagaCallReturnType } from "../types/utils";
import { convertUnknownToError } from "../utils/errors";
⋮----
function getContextualHelpData(): Promise<
  t.Validation<BasicResponseType<ContextualHelp>>
> {
return new Promise((resolve, _) =>
</file>

<file path="apps/main-app/ts/sagas/index.ts">
import { all, call } from "typed-redux-saga/macro";
⋮----
import versionInfoSaga from "../common/versionInfo/saga/versionInfo";
import { zendeskEnabled } from "../config";
import { watchForceLogoutActiveSessionLogin } from "../features/authentication/activeSessionLogin/saga/forceLogoutActiveSessionLoginSaga";
import { watchLogoutSaga } from "../features/authentication/common/saga/watchLogoutSaga";
import { watchPendingActionsSaga } from "../features/authentication/fastLogin/saga/pendingActionsSaga";
import { watchTokenRefreshSaga } from "../features/authentication/fastLogin/saga/tokenRefreshSaga";
import connectivityStatusSaga from "../features/connectivity/saga";
import { watchIdentification } from "../features/identification/sagas";
import { watchTourSaga } from "../features/tour/sagas";
import { watchUtmLinkSaga } from "../features/utmLink/saga";
import { watchZendeskSupportSaga } from "../features/zendesk/saga";
import backendStatusSaga from "./backendStatus";
import { watchContentSaga } from "./contentLoaders";
import { loadSystemPreferencesSaga } from "./preferences";
import { removePersistedStatesSaga } from "./removePersistedStates";
import { startupSaga } from "./startup";
import { watchApplicationActivitySaga } from "./startup/watchApplicationActivitySaga";
</file>

<file path="apps/main-app/ts/sagas/installation.ts">
import { put, select } from "typed-redux-saga/macro";
⋮----
import { clearCurrentSession } from "../features/authentication/common/store/actions";
import { previousInstallationDataDeleteSuccess } from "../store/actions/installation";
import { isFirstRunAfterInstallSelector } from "../store/reducers/installation";
import { ReduxSagaEffect } from "../types/utils";
</file>

<file path="apps/main-app/ts/sagas/mixpanel.ts">
import { CommonActions, StackActions } from "@react-navigation/native";
import { call, put, select, take, takeLatest } from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import {
  sessionExpired,
  sessionInvalid
} from "../features/authentication/common/store/actions";
import { setIsMixpanelInitialized } from "../features/mixpanel/store/actions";
import {
  identifyMixpanel,
  initializeMixPanel,
  resetMixpanel,
  terminateMixpanel
} from "../mixpanel";
import { updateMixpanelProfileProperties } from "../mixpanelConfig/profileProperties";
import { updateMixpanelSuperProperties } from "../mixpanelConfig/superProperties";
import NavigationService from "../navigation/NavigationService";
import ROUTES from "../navigation/routes";
import { setMixpanelEnabled } from "../store/actions/mixpanel";
import { isMixpanelEnabled } from "../store/reducers/persistedPreferences";
import { GlobalState } from "../store/reducers/types";
import { ReduxSagaEffect } from "../types/utils";
import { isTestEnv } from "../utils/environment";
</file>

<file path="apps/main-app/ts/sagas/preferences.ts">
import I18n from "i18next";
import { put } from "typed-redux-saga/macro";
⋮----
import { preferencesLanguagesLoadSuccess } from "../store/actions/preferences";
import { ReduxSagaEffect, SagaCallReturnType } from "../types/utils";
</file>

<file path="apps/main-app/ts/sagas/removePersistedStates.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { call } from "typed-redux-saga/macro";
</file>

<file path="apps/main-app/ts/sagas/startup.diagram.README.md">
```mermaid
sequenceDiagram
  participant App
  participant StartupSaga
  participant Mixpanel
  participant System
  participant Lollipop
  participant Session
  participant Profile
  participant Onboarding
  participant FeatureWatchers
  participant Wallet

  App->>StartupSaga: startApplicationInitialization

  %% --- Phase 1: Initial setup ---
  note over StartupSaga: Phase 1 – Initial setup
  StartupSaga->>System: Check ingress screen
  StartupSaga->>Mixpanel: initMixpanel
  StartupSaga->>System: Clear local notifications
  StartupSaga->>System: Delete old installation data

  %% --- Phase 2: Security setup (Lollipop key) ---
  note over StartupSaga: Phase 2 – Security setup (Lollipop key)
  StartupSaga->>Lollipop: Generate key
  StartupSaga->>Lollipop: Check if key is supported
  alt Device not supported
    StartupSaga-->>App: Exit early
  end

  %% --- Phase 3: Offline mode check ---
  note over StartupSaga: Phase 3 – Offline wallet check
  StartupSaga->>System: Wallet in offline mode check
  alt Offline mode
    StartupSaga-->>App: Exit early
  end

  %% --- Phase 4: Authentication ---
  note over StartupSaga: Phase 4 – Authentication
  StartupSaga->>Session: Track keychain failures
  StartupSaga->>Session: Authenticate user
  Session-->>StartupSaga: sessionToken
  StartupSaga->>Lollipop: Get key info
  StartupSaga->>Session: Validate session token
  alt Token expired
    StartupSaga->>Session: Refresh session token
  end

  %% --- Phase 5: Create backend client ---
  note over StartupSaga: Phase 5 – Create backend client
  StartupSaga->>Session: Create backendClient(apiUrlPrefix, sessionToken, keyInfo)

  %% --- Phase 6: Load session and profile ---
  note over StartupSaga: Phase 6 – Load session and profile
  StartupSaga->>Profile: Load session info
  alt Missing tokens (wallet or BPD)
    StartupSaga->>Profile: Retry loading session info
    alt Retry failed
      StartupSaga->>System: Handle startup error
      StartupSaga-->>App: Exit early
    end
  end

  StartupSaga->>Profile: Load user profile
  Profile-->>StartupSaga: userProfile

  %% --- Phase 7: Start onboarding ---
  note over StartupSaga: Phase 7 – startupLoadSuccess(ONBOARDING)
  StartupSaga->>StartupSaga: startupLoadSuccess(ONBOARDING)
  StartupSaga->>System: Wait for navigator ready
  StartupSaga->>Onboarding: Start identification (PIN)
  alt User resets PIN
    StartupSaga->>StartupSaga: Restart initialization
    StartupSaga-->>App: Exit
  end

  StartupSaga->>Onboarding: Set language, check Mixpanel opt-in
  StartupSaga->>Onboarding: Check fingerprint, email, PIN

  %% --- Phase 8: Feature watchers ---
  note over StartupSaga: Phase 8 – Feature watchers
  StartupSaga->>Wallet: watchWalletSaga
  StartupSaga->>FeatureWatchers: Messages, Services, IDPay, PN, CGN, TrialSystem
  StartupSaga->>FeatureWatchers: Watch payments with walletToken

  %% --- Phase 9: Completion ---
  note over StartupSaga: Phase 9 – Completion
  StartupSaga->>StartupSaga: startupLoadSuccess(AUTHENTICATED)
  StartupSaga->>App: App ready

```
</file>

<file path="apps/main-app/ts/sagas/startup.ts">
import { UserDataProcessingChoiceEnum } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingChoice";
import { UserDataProcessingStatusEnum } from "@io-app/api-types/generated/definitions/identity/UserDataProcessingStatus";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { Alert } from "react-native";
import { channel } from "redux-saga";
import {
  call,
  cancel,
  fork,
  put,
  select,
  take,
  takeEvery,
  takeLatest
} from "typed-redux-saga/macro";
import { ActionType, getType } from "typesafe-actions";
⋮----
import { communicationClientManager } from "../api/CommunicationClientManager";
import { identityClientManager } from "../api/IdentityClientManager";
import { sessionManagerClientManager } from "../api/SessionManagerClientManager";
import { versionInfoLoadSuccess } from "../common/versionInfo/store/actions/versionInfo";
import {
  isAppSupportedSelector,
  versionInfoDataSelector
} from "../common/versionInfo/store/reducers/versionInfo";
import { apiUrlPrefix, zendeskEnabled } from "../config";
import {
  handleNavigateAfterFinishedStandardActiveSessionLoginFlow,
  watchActiveSessionLoginSaga
} from "../features/authentication/activeSessionLogin/saga";
import { navigateToActiveSessionLogin } from "../features/authentication/activeSessionLogin/saga/navigateToActiveSessionLogin";
import { showSessionExpirationBlockingScreenSelector } from "../features/authentication/activeSessionLogin/store/selectors";
import { authenticationSaga } from "../features/authentication/common/saga/authenticationSaga";
import { loadSessionInformationSaga } from "../features/authentication/common/saga/loadSessionInformationSaga";
import {
  checkSession,
  watchCheckSessionSaga
} from "../features/authentication/common/saga/watchCheckSessionSaga";
import { watchForceLogoutSaga } from "../features/authentication/common/saga/watchForceLogoutSaga";
import { sessionExpired } from "../features/authentication/common/store/actions";
import {
  sessionInfoSelector,
  sessionTokenSelector
} from "../features/authentication/common/store/selectors";
import { refreshSessionToken } from "../features/authentication/fastLogin/store/actions/tokenRefreshActions";
import {
  isFastLoginEnabledSelector,
  tokenRefreshSelector
} from "../features/authentication/fastLogin/store/selectors";
import { shouldTrackLevelSecurityMismatchSaga } from "../features/authentication/login/cie/sagas/trackLevelSecuritySaga";
import { userFromSuccessLoginSelector } from "../features/authentication/loginInfo/store/selectors";
import { watchCdcSaga } from "../features/bonus/cdc/common/saga";
import { watchBonusCgnSaga } from "../features/bonus/cgn/saga";
import { cgnDetails } from "../features/bonus/cgn/store/actions/details";
import { shouldFetchCgnDetailsSelector } from "../features/bonus/cgn/store/selectors/banners";
import {
  navigateAfterFinishedFciActiveSessionLoginFlowSaga,
  watchFciSaga
} from "../features/fci/saga";
import { watchFimsSaga } from "../features/fims/common/saga";
import { startAndReturnIdentificationResult } from "../features/identification/sagas";
import {
  IdentificationBackActionType,
  IdentificationResult
} from "../features/identification/store/reducers";
import { watchIDPaySaga } from "../features/idpay/common/saga";
import {
  shouldExitForOfflineAccess,
  watchSessionRefreshInOfflineSaga
} from "../features/ingress/saga";
import { isBlockingScreenSelector } from "../features/ingress/store/selectors";
import {
  watchItwAuthenticatedSaga,
  watchItwSaga
} from "../features/itwallet/common/saga";
import { checkPublicKeyAndBlockIfNeeded } from "../features/lollipop/navigation";
import {
  checkLollipopSessionAssertionAndInvalidateIfNeeded,
  generateLollipopKeySaga,
  getKeyInfo
} from "../features/lollipop/saga";
import { lollipopPublicKeySelector } from "../features/lollipop/store/reducers/lollipop";
import { handleIsKeyStrongboxBacked } from "../features/lollipop/utils/crypto";
import { checkAcknowledgedEmailSaga } from "../features/mailCheck/sagas/checkAcknowledgedEmailSaga";
import { watchEmailNotificationPreferencesSaga } from "../features/mailCheck/sagas/checkEmailNotificationPreferencesSaga";
import { checkEmailSaga } from "../features/mailCheck/sagas/checkEmailSaga";
import { watchEmailValidationSaga } from "../features/mailCheck/sagas/emailValidationPollingSaga";
import { watchMessagesSaga } from "../features/messages/saga";
import { handleClearAllAttachments } from "../features/messages/saga/handleClearAttachments";
import { checkAcknowledgedFingerprintSaga } from "../features/onboarding/saga/biometric/checkAcknowledgedFingerprintSaga";
import { completeOnboardingSaga } from "../features/onboarding/saga/completeOnboardingSaga";
import { watchAbortOnboardingSaga } from "../features/onboarding/saga/watchAbortOnboardingSaga";
import { watchPaymentsSaga } from "../features/payments/common/saga";
import { watchAarFlowSaga } from "../features/pn/aar/saga/watchAarFlowSaga";
import { checkShouldDisplaySendEngagementScreen } from "../features/pn/loginEngagement/sagas/checkShouldDisplaySendEngagementScreen";
import { watchSendLollipopLambda } from "../features/pn/lollipopLambda/saga";
import { watchPnSaga } from "../features/pn/store/sagas/watchPnSaga";
... (68 lines truncated)
</file>

<file path="apps/main-app/ts/screens/modal/__test__/RootModal.test.tsx">
import { act } from "@testing-library/react-native";
import I18n from "i18next";
import { createStore } from "redux";
⋮----
import {
  versionInfoLoadFailure,
  versionInfoLoadSuccess
} from "../../../common/versionInfo/store/actions/versionInfo";
import { mockIoVersionInfo } from "../../../common/versionInfo/store/reducers/__mock__/ioVersionInfo";
import { minAppVersionAppVersionTestCases } from "../../../common/versionInfo/store/reducers/__mock__/testVersion";
import ROUTES from "../../../navigation/routes";
import { applicationChangeState } from "../../../store/actions/application";
import { appReducer } from "../../../store/reducers";
import { GlobalState } from "../../../store/reducers/types";
import { renderScreenWithNavigationStoreContext } from "../../../utils/testWrapper";
import RootModal from "../RootModal";
⋮----
const testRootModal = (
  minVersion: string,
  appVersion: string,
  isSupported: boolean
) =>
</file>

<file path="apps/main-app/ts/screens/modal/analytics/index.ts">
import { mixpanelTrack } from "../../../mixpanel";
import { buildEventProperties } from "../../../utils/analytics";
⋮----
export function trackForcedUpdateScreen()
⋮----
export function trackLoginRootedScreen()
⋮----
export function trackUpdateAppButton()
</file>

<file path="apps/main-app/ts/screens/modal/RootedDeviceModal.tsx">
import { IOMarkdownLite } from "@io-app/design-system";
import I18n from "i18next";
import { useCallback } from "react";
import { Platform } from "react-native";
import { useDispatch } from "react-redux";
⋮----
import { OperationResultScreenContent } from "../../components/screens/OperationResultScreenContent";
import { useIONavigation } from "../../navigation/params/AppParamsList";
import { continueWithRootOrJailbreak } from "../../store/actions/persistedPreferences";
import { useIOBottomSheetModal } from "../../utils/hooks/bottomSheet";
import { trackLoginRootedScreen } from "./analytics";
⋮----
const RootedDeviceModal = () =>
</file>

<file path="apps/main-app/ts/screens/modal/RootModal.tsx">
import { FunctionComponent } from "react";
import { connect } from "react-redux";
⋮----
import {
  isAppSupportedSelector,
  versionInfoDataSelector
} from "../../common/versionInfo/store/reducers/versionInfo";
import {
  trackLoginSessionTimeoutPostPin,
  trackLoginSessionTimeoutPrePin
} from "../../features/authentication/fastLogin/analytics";
import FastLoginModals from "../../features/authentication/fastLogin/screens/FastLoginModals";
import {
  isFastLoginUserInteractionNeededForSessionExpiredSelector,
  tokenRefreshSelector
} from "../../features/authentication/fastLogin/store/selectors";
import { IdentificationModal } from "../../features/identification/screens/IdentificationModal";
import UnsupportedDeviceScreen from "../../features/lollipop/screens/UnsupportedDeviceScreen";
import { isDeviceSupportedSelector } from "../../features/lollipop/store/reducers/lollipop";
import { GetProfileEndpointTransientError } from "../../features/startup/screens/errors/GetProfileEndpointTransientError";
import { GetSessionEndpointTransientError } from "../../features/startup/screens/errors/GetSessionEndpointTransientError";
import { mixpanelTrack } from "../../mixpanel";
import { isBackendServicesStatusOffSelector } from "../../store/reducers/backendStatus/backendInfo";
import { startupTransientErrorSelector } from "../../store/reducers/startup";
import { GlobalState } from "../../store/reducers/types";
import SystemOffModal from "./SystemOffModal";
import UpdateAppModal from "./UpdateAppModal";
⋮----
type Props = ReturnType<typeof mapStateToProps>;
⋮----
const RootModal: FunctionComponent<Props> = (props: Props) =>
⋮----
const mapStateToProps = (state: GlobalState) => (
</file>

<file path="apps/main-app/ts/screens/modal/SystemOffModal.tsx">
import { IOColors, useIOTheme } from "@io-app/design-system";
import I18n from "i18next";
import _ from "lodash";
import { memo, useMemo } from "react";
import { Modal } from "react-native";
import { useSelector } from "react-redux";
⋮----
import { OperationResultScreenContent } from "../../components/screens/OperationResultScreenContent";
import { backendInfoMessageSelector } from "../../store/reducers/backendStatus/backendInfo";
import { getFullLocale } from "../../utils/locale";
⋮----
const SystemOffModal = () =>
</file>

<file path="apps/main-app/ts/screens/modal/UpdateAppModal.tsx">
import {
  Dismissable,
  IOColors,
  IODimensions,
  ToastNotification,
  useIOTheme
} from "@io-app/design-system";
import I18n from "i18next";
import { FC, useCallback, useEffect, useRef, useState } from "react";
import { AccessibilityInfo, Modal, StyleSheet, View } from "react-native";
import Animated, {
  Easing,
  SequencedTransition,
  SlideInUp,
  SlideOutUp
} from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { OperationResultScreenContent } from "../../components/screens/OperationResultScreenContent";
import { useHardwareBackButton } from "../../hooks/useHardwareBackButton";
import { openAppStoreUrl } from "../../utils/url";
import { trackForcedUpdateScreen, trackUpdateAppButton } from "./analytics";
</file>

<file path="apps/main-app/ts/store/actions/analytics.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { LoginType } from "../../features/authentication/common/utils/index";
⋮----
export type AnalyticsActions =
  | ActionType<typeof analyticsAuthenticationCompleted>
  | ActionType<typeof analyticsAuthenticationStarted>;
</file>

<file path="apps/main-app/ts/store/actions/application.ts">
import { AppStateStatus } from "react-native";
⋮----
import { ActionPattern } from "redux-saga/effects";
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
type ApplicationInitializationPayload = void | {
  handleSessionExpiration?: boolean;
  isActiveLoginSuccess?: boolean;
  showIdentificationModalAtStartup?: boolean;
};
⋮----
type ApplicationInitializedPayload = {
  actionsToWaitFor: Array<ActionPattern>;
};
⋮----
export type ApplicationActions =
  | ActionType<typeof applicationChangeState>
  | ActionType<typeof applicationInitialized>
  | ActionType<typeof startApplicationInitialization>;
</file>

<file path="apps/main-app/ts/store/actions/backendStatus.ts">
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
⋮----
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type BackendStatusActions = ActionType<typeof backendStatusLoadSuccess>;
</file>

<file path="apps/main-app/ts/store/actions/calendarEvents.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type AddCalendarEventPayload = {
  eventId: string;
  messageId: string;
};
⋮----
export type RemoveCalendarEventPayload = {
  messageId: string;
};
⋮----
export type CalendarEventsActions = ActionType<
  typeof addCalendarEvent | typeof removeCalendarEvent
>;
</file>

<file path="apps/main-app/ts/store/actions/content.ts">
import { ContextualHelp } from "@io-app/api-types/generated/definitions/content/ContextualHelp";
import { Municipality as MunicipalityMetadata } from "@io-app/api-types/generated/definitions/content/Municipality";
import { SpidIdps } from "@io-app/api-types/generated/definitions/content/SpidIdps";
import { ActionType, createAsyncAction } from "typesafe-actions";
⋮----
import { CodiceCatastale } from "../../types/MunicipalityCodiceCatastale";
⋮----
type MunicipalityFailure = {
  codiceCatastale: string;
  error: Error;
};
⋮----
export type ContentActions =
  | ActionType<typeof contentMunicipalityLoad>
  | ActionType<typeof loadContextualHelpData>
  | ActionType<typeof loadIdps>;
</file>

<file path="apps/main-app/ts/store/actions/crossSessions.ts">
import { FiscalCode } from "@pagopa/ts-commons/lib/strings";
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
type DifferentProfileLoggedInType = {
  isNewInstall: boolean;
};
⋮----
export type CrossSessionsActions =
  | ActionType<typeof differentProfileLoggedIn>
  | ActionType<typeof setProfileHashedFiscalCode>;
</file>

<file path="apps/main-app/ts/store/actions/debug.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type DebugActions =
  | ActionType<typeof resetDebugData>
  | ActionType<typeof setDebugData>
  | ActionType<typeof setDebugModeEnabled>;
</file>

<file path="apps/main-app/ts/store/actions/installation.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type InstallationActions =
  | ActionType<typeof appVersionHistory>
  | ActionType<typeof previousInstallationDataDeleteSuccess>;
</file>

<file path="apps/main-app/ts/store/actions/mixpanel.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type MixpanelActions = ActionType<MixpanelActionsTypes>;
⋮----
type MixpanelActionsTypes = typeof setMixpanelEnabled;
</file>

<file path="apps/main-app/ts/store/actions/navigation.ts">
import { CommonActions } from "@react-navigation/native";
⋮----
import { OnboardingServicesPreferenceScreenNavigationParams } from "../../features/onboarding/screens/OnboardingServicesPreferenceScreen";
import { SETTINGS_ROUTES } from "../../features/settings/common/navigation/routes";
import NavigationService from "../../navigation/NavigationService";
import ROUTES from "../../navigation/routes";
⋮----
export const navigateToMainNavigatorAction = ()
⋮----
export const navigateToOnboardingPinScreenAction = ()
⋮----
export const navigateToTosScreen = ()
⋮----
export const navigateToServicesPreferenceModeSelectionScreen = (
  params: OnboardingServicesPreferenceScreenNavigationParams
)
⋮----
export const navigateToRemoveAccountSuccess = ()
⋮----
export const navigateToPrivacyScreen = ()
⋮----
export const navigateToWorkunitGenericFailureScreen = ()
</file>

<file path="apps/main-app/ts/store/actions/persistedPreferences.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { ColorModeChoice } from "../../hooks/useAppThemeConfiguration";
import { Locales } from "../../i18n";
⋮----
export type TypefaceChoice = "comfortable" | "standard";
⋮----
export type PersistedPreferencesActions = ActionType<
  | typeof continueWithRootOrJailbreak
  | typeof customEmailChannelSetEnabled
  | typeof preferenceFingerprintIsEnabledSaveSuccess
  | typeof preferencesExperimentalDesignEnabled
  | typeof preferencesFontSet
  | typeof preferencesIdPayTestSetEnabled
  | typeof preferencesPagoPaTestEnvironmentSetEnabled
  | typeof preferencesPnTestEnvironmentSetEnabled
  | typeof preferencesThemeSet
  | typeof preferredCalendarRemoveSuccess
  | typeof preferredCalendarSaveSuccess
  | typeof preferredLanguageSaveSuccess
  | typeof serviceAlertDisplayedOnceSuccess
>;
</file>

<file path="apps/main-app/ts/store/actions/preferences.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type PreferencesActions = ActionType<
  typeof preferencesLanguagesLoadSuccess | typeof setScreenReaderEnabled
>;
</file>

<file path="apps/main-app/ts/store/actions/search.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
export type SearchActions =
  | ActionType<typeof disableSearch>
  | ActionType<typeof searchMessagesEnabled>
  | ActionType<typeof updateSearchText>;
</file>

<file path="apps/main-app/ts/store/actions/startup.ts">
import { ActionType, createStandardAction } from "typesafe-actions";
⋮----
import { StartupStatusEnum, StartupTransientError } from "../reducers/startup";
⋮----
export type StartupActions =
  | ActionType<typeof startupLoadSuccess>
  | ActionType<typeof startupTransientError>;
</file>

<file path="apps/main-app/ts/store/actions/types.ts">
import {
  Dispatch as DispatchAPI,
  MiddlewareAPI as ReduxMiddlewareAPI,
  Store as ReduxStore
} from "redux";
⋮----
import { VersionInfoActions } from "../../common/versionInfo/store/actions/versionInfo";
import { AppearanceSettingsActions } from "../../features/appearanceSettings/store/actions";
import { AppFeedbackActions } from "../../features/appReviews/store/actions";
import { LoginInfoActions } from "../../features/authentication/activeSessionLogin/store/actions";
import { AuthenticationActions } from "../../features/authentication/common/store/actions";
import { FastLoginActions } from "../../features/authentication/fastLogin/store/actions";
import {
  CieAuthenticationActions,
  CieLoginConfigActions
} from "../../features/authentication/login/cie/store/actions";
import { SpidConfigActions } from "../../features/authentication/login/idp/store/actions";
import { CdcActions } from "../../features/bonus/cdc/common/store/actions";
import { BonusActions } from "../../features/bonus/common/store/actions";
import { ConnectivityActions } from "../../features/connectivity/store/actions";
import { FciActions } from "../../features/fci/store/actions";
import { FimsActions } from "../../features/fims/common/store/actions";
import { IdentificationActions } from "../../features/identification/store/actions";
import { IdPayActions } from "../../features/idpay/common/store/actions";
import { IngressScreenActions } from "../../features/ingress/store/actions";
import { ItwActions } from "../../features/itwallet/common/store/actions";
import { LandingScreenBannerActions } from "../../features/landingScreenMultiBanner/store/actions";
import { BackgroundLinkingActions } from "../../features/linking/actions";
import { LollipopActions } from "../../features/lollipop/store/actions/lollipop";
import { ProfileEmailValidationAction } from "../../features/mailCheck/store/actions/profileEmailValidationChange";
import { MessagesActions } from "../../features/messages/store/actions";
import { MixpanelFeatureActions } from "../../features/mixpanel/store/actions";
import { OnboardingActions } from "../../features/onboarding/store/actions";
import { PaymentsActions as PaymentsFeatureActions } from "../../features/payments/common/store/actions";
import { AarFlowStateActions } from "../../features/pn/aar/store/actions";
import { SENDLoginEngagementActions } from "../../features/pn/loginEngagement/store/actions";
import { SENDLollipopLambdaActions } from "../../features/pn/lollipopLambda/store/actions";
import { PnActions } from "../../features/pn/store/actions";
import { NotificationPermissionsActions } from "../../features/pushNotifications/store/actions/environment";
import { NotificationsActions } from "../../features/pushNotifications/store/actions/installation";
import { PendingMessageActions } from "../../features/pushNotifications/store/actions/pendingMessage";
import { ProfileNotificationPermissionsActions } from "../../features/pushNotifications/store/actions/profileNotificationPermissions";
import { UserBehaviourActions } from "../../features/pushNotifications/store/actions/userBehaviour";
import { ServicesActions } from "../../features/services/common/store/actions";
import { ProfileActions } from "../../features/settings/common/store/actions";
import { UserDataProcessingActions } from "../../features/settings/common/store/actions/userDataProcessing";
import { PinSetActions } from "../../features/settings/security/store/actions/pinset";
import { TourActions } from "../../features/tour/store/actions";
import { UtmLinkActions } from "../../features/utmLink/store/actions";
import { WalletActions } from "../../features/wallet/store/actions";
import { WhatsNewActions } from "../../features/whatsnew/store/actions";
import { ZendeskSupportActions } from "../../features/zendesk/store/actions";
import { GlobalState } from "../reducers/types";
import { AnalyticsActions } from "./analytics";
import { ApplicationActions } from "./application";
import { BackendStatusActions } from "./backendStatus";
import { CalendarEventsActions } from "./calendarEvents";
import { ContentActions } from "./content";
import { CrossSessionsActions } from "./crossSessions";
import { DebugActions } from "./debug";
import { InstallationActions } from "./installation";
import { MixpanelActions } from "./mixpanel";
import { PersistedPreferencesActions } from "./persistedPreferences";
import { PreferencesActions } from "./preferences";
import { SearchActions } from "./search";
import { StartupActions } from "./startup";
⋮----
export type Action =
  | AarFlowStateActions
  | AnalyticsActions
  | AppearanceSettingsActions
  | AppFeedbackActions
  | ApplicationActions
  | AuthenticationActions
  | BackendStatusActions
  | BackgroundLinkingActions
  | BonusActions
  | CalendarEventsActions
  | CdcActions
  | CieAuthenticationActions
  | CieLoginConfigActions
  | ConnectivityActions
  | ContentActions
  | CrossSessionsActions
  | DebugActions
  | FastLoginActions
  | FciActions
  | FimsActions
  | IdentificationActions
  | IdPayActions
  | IngressScreenActions
  | InstallationActions
  | ItwActions
  | LandingScreenBannerActions
  | LoginInfoActions
  | LollipopActions
  | MessagesActions
  | MixpanelActions
  | MixpanelFeatureActions
  | NotificationPermissionsActions
... (32 lines truncated)
</file>

<file path="apps/main-app/ts/store/helpers/indexer.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
export interface IndexedById<T> {
  [key: number]: T | undefined;
  [key: string]: T | undefined;
}
⋮----
export const toIndexed = <T>(
  lst: ReadonlyArray<T>,
  key: (_: T) => number | string
): IndexedById<T>
⋮----
export const toArray = <T>(indexedById: IndexedById<T>): ReadonlyArray<T>
</file>

<file path="apps/main-app/ts/store/middlewares/analytics.ts">
import { getType } from "typesafe-actions";
⋮----
import { trackSessionCorrupted } from "../../features/authentication/activeSessionLogin/analytics";
import {
  trackLoginFailure,
  trackLogoutFailure,
  trackLogoutSuccess
} from "../../features/authentication/common/analytics";
import {
  clearCurrentSession,
  idpLoginUrlChanged,
  idpSelected,
  loginFailure,
  loginSuccess,
  logoutFailure,
  logoutSuccess,
  sessionCorrupted,
  sessionExpired,
  sessionInformationLoadFailure,
  sessionInformationLoadSuccess,
  sessionInvalid
} from "../../features/authentication/common/store/actions";
import { cieAuthenticationError } from "../../features/authentication/login/cie/store/actions";
import trackCgnAction from "../../features/bonus/cgn/analytics/index";
import { loadAvailableBonuses } from "../../features/bonus/common/store/actions/availableBonusesTypes";
import trackFciAction from "../../features/fci/analytics";
import { fciEnvironmentSelector } from "../../features/fci/store/reducers/fciEnvironment";
import { trackIdentificationAction } from "../../features/identification/analytics";
import { updateOfflineAccessReason } from "../../features/itwallet/analytics/properties/propertyUpdaters";
import { profileEmailValidationChanged } from "../../features/mailCheck/store/actions/profileEmailValidationChange";
import { trackMessagesActionsPostDispatch } from "../../features/messages/analytics";
import { trackServicesAction } from "../../features/services/common/analytics";
import {
  profileFirstLogin,
  profileLoadFailure,
  profileLoadRequest,
  profileUpsert,
  removeAccountMotivation
} from "../../features/settings/common/store/actions";
import {
  deleteUserDataProcessing,
  upsertUserDataProcessing
} from "../../features/settings/common/store/actions/userDataProcessing";
import trackZendesk from "../../features/zendesk/analytics/index";
import { isMixpanelInstanceInitialized, mixpanelTrack } from "../../mixpanel";
import { buildEventProperties } from "../../utils/analytics";
import { isTestEnv } from "../../utils/environment";
import {
  analyticsAuthenticationCompleted,
  analyticsAuthenticationStarted
} from "../actions/analytics";
import { applicationChangeState } from "../actions/application";
import { contentMunicipalityLoad } from "../actions/content";
import { searchMessagesEnabled } from "../actions/search";
import { Action, Dispatch, MiddlewareAPI } from "../actions/types";
import { trackContentAction } from "./contentAnalytics";
⋮----
const trackAction = (action: Action): ReadonlyArray<null> | void =>
⋮----
export const actionTracking =
(middleware: MiddlewareAPI)
</file>

<file path="apps/main-app/ts/store/middlewares/contentAnalytics.ts">
import { getType } from "typesafe-actions";
⋮----
import { mixpanelTrack } from "../../mixpanel";
import { loadContextualHelpData, loadIdps } from "../actions/content";
import { Action } from "../actions/types";
⋮----
export const trackContentAction = (action: Action): void =>
</file>

<file path="apps/main-app/ts/store/middlewares/index.ts">

</file>

<file path="apps/main-app/ts/store/middlewares/navigation.ts">
import { mixpanelTrack } from "../../mixpanel";
⋮----
export const trackScreen = (
  previousScreen: string | undefined,
  currentScreen: string
) =>
</file>

<file path="apps/main-app/ts/store/reducers/__mock__/backendStatus.ts">
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { Config } from "@io-app/api-types/generated/definitions/content/Config";
import { LevelEnum } from "@io-app/api-types/generated/definitions/content/SectionStatus";
⋮----
import { absolutePortalLinksFallback } from "../backendStatus/remoteConfig";
</file>

<file path="apps/main-app/ts/store/reducers/__mock__/idps.ts">
import { SpidIdp } from "../../../utils/idps";
</file>

<file path="apps/main-app/ts/store/reducers/backendStatus/backendInfo.ts">
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { pipe } from "fp-ts/lib/function";
⋮----
import { getType } from "typesafe-actions";
⋮----
import { backendStatusLoadSuccess } from "../../actions/backendStatus";
import { Action } from "../../actions/types";
import { GlobalState } from "../types";
⋮----
export type BackedInfoState = {
  areSystemsDead: boolean;
  backendInfoMessage: O.Option<BackendStatus["message"]>;
  deadsCounter: number;
};
⋮----
export const backendInfoReducer = (
  state: BackedInfoState = initialBackendInfoState,
  action: Action
): BackedInfoState =>
⋮----
export const deadsCounterSelector = (state: GlobalState)
⋮----
export const isBackendServicesStatusOffSelector = (state: GlobalState)
⋮----
export const backendInfoMessageSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/store/reducers/backendStatus/remoteConfig.ts">
import { AppFeedbackConfig } from "@io-app/api-types/generated/definitions/content/AppFeedbackConfig";
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { BancomatPayConfig } from "@io-app/api-types/generated/definitions/content/BancomatPayConfig";
import { Banner } from "@io-app/api-types/generated/definitions/content/Banner";
import { BarcodesScannerConfig } from "@io-app/api-types/generated/definitions/content/BarcodesScannerConfig";
import { FimsServiceConfiguration } from "@io-app/api-types/generated/definitions/content/FimsServiceConfiguration";
import { OSPerPlatform } from "@io-app/api-types/generated/definitions/content/OSPerPlatform";
import { ServiceId } from "@io-app/api-types/generated/definitions/services/ServiceId";
import { pipe } from "fp-ts/lib/function";
⋮----
import { Platform } from "react-native";
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import {
  cdcEnabled,
  cgnMerchantsV2Enabled,
  premiumMessagesOptInEnabled,
  scanAdditionalBarcodesEnabled
} from "../../../config";
import { TopicKeys } from "../../../features/appReviews/store/actions";
import { getAppVersion, isVersionSupported } from "../../../utils/appVersion";
import { backendStatusLoadSuccess } from "../../actions/backendStatus";
import { Action } from "../../actions/types";
import {
  isMinAppVersionSupported,
  isPropertyWithMinAppVersionEnabled
} from "../featureFlagWithMinAppVersionStatus";
import { isIdPayLocallyEnabledSelector } from "../persistedPreferences";
import { GlobalState } from "../types";
⋮----
export type RemoteConfigState = O.Option<BackendStatus["config"]>;
⋮----
export default function remoteConfigReducer(
  state: RemoteConfigState = initialRemoteConfigState,
  action: Action
): RemoteConfigState
⋮----
export const remoteConfigSelector = (state: GlobalState)
⋮----
export const isBackendStatusLoadedSelector = (state: GlobalState)
⋮----
export const isCGNDiscoveryBannerEnabledSelector = (state: GlobalState)
⋮----
/**
 * Return the remote config about paypal enabled/disabled if there is no data,
 * false is the default value -> (paypal disabled)
 */
⋮----
/**
 * Return the remote config about BancomatPay if no data is available the
 * default is considering all flags set to false
 */
⋮----
/**
 * Return the remote config about CGN enabled/disabled if there is no data,
 * false is the default value -> (CGN disabled)
 */
export const isCGNEnabledSelector = (state: GlobalState)
⋮----
/**
 * Return true if CGN is enabled, but only after backend status is loaded. This
 * prevents CGN from being disabled by default when backend status is not yet
 * loaded.
 */
⋮----
export const fimsRequiresAppUpdateSelector = (state: GlobalState)
⋮----
export const fimsServiceIdInCookieDisabledListSelector = (
  state: GlobalState,
  serviceId: ServiceId
): boolean
⋮----
export const oidcProviderDomainSelector = (state: GlobalState)
⋮----
export const isPnRemoteEnabledSelector = (state: GlobalState)
⋮----
export const isPnAppVersionSupportedSelector = (state: GlobalState)
⋮----
export const pnMinAppVersionSelector = (state: GlobalState)
⋮----
export const pnFrontendUrlSelector = (state: GlobalState)
⋮----
export const pnAarQRCodeRegexSelector = (state: GlobalState)
⋮----
/**
 * Return the remote config about FCI enabled/disabled if there is no data or
 * the local Feature Flag is disabled, false is the default value -> (FCI
 * disabled)
 */
⋮----
export const isIdPayEnabledInScanScreenSelector = (state: GlobalState)
⋮----
export const isIdPayQrCodeFeatureEnabledSelector = (state: GlobalState)
⋮----
export const isIdPayCiePaymentCodeEnabledSelector = (state: GlobalState)
⋮----
export const idPayOnboardingRequiresAppUpdateSelector = (state: GlobalState)
⋮----
... (57 lines truncated)
</file>

<file path="apps/main-app/ts/store/reducers/backendStatus/sectionStatus.ts">
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { Sections } from "@io-app/api-types/generated/definitions/content/Sections";
import { SectionStatus } from "@io-app/api-types/generated/definitions/content/SectionStatus";
import { constFalse, pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { LocalizedMessageKeys } from "../../../i18n";
import { backendStatusLoadSuccess } from "../../actions/backendStatus";
import { Action } from "../../actions/types";
import { GlobalState } from "../types";
⋮----
export type SectionStatusKey = keyof Sections;
⋮----
export type SectionStatusState = O.Option<BackendStatus["sections"]>;
⋮----
export default function sectionStatusReducer(
  state: SectionStatusState = initialSectionStatusState,
  action: Action
): SectionStatusState
⋮----
export const sectionStatusSelector = (state: GlobalState)
⋮----
export const sectionStatusByKeySelector = (
  sectionStatusKey: SectionStatusKey
)
⋮----
export const sectionStatusUncachedSelector = (
  state: GlobalState,
  sectionStatusKey: SectionStatusKey
)
⋮----
export const isSectionVisibleSelector = (
  state: GlobalState,
  sectionStatusKey: SectionStatusKey
)
export const webUrlForSectionSelector = (
  state: GlobalState,
  sectionStatusKey: SectionStatusKey,
  locale: LocalizedMessageKeys
)
export const messageForSectionSelector = (
  state: GlobalState,
  sectionStatusKey: SectionStatusKey,
  locale: LocalizedMessageKeys
)
export const levelForSectionSelector = (
  state: GlobalState,
  sectionStatusKey: SectionStatusKey
)
</file>

<file path="apps/main-app/ts/store/reducers/backendStatus/statusMessages.ts">
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { StatusMessage } from "@io-app/api-types/generated/definitions/content/StatusMessage";
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import { backendStatusLoadSuccess } from "../../actions/backendStatus";
import { Action } from "../../actions/types";
import { GlobalState } from "../types";
⋮----
export type StatusMessagesState = O.Option<BackendStatus["statusMessages"]>;
⋮----
export default function statusMessagesReducer(
  state: StatusMessagesState = initialStatusMessagesState,
  action: Action
): StatusMessagesState
⋮----
const statusMessagesSelector = (state: GlobalState)
⋮----
export const statusMessageByRouteSelector = (currentRoute: string)
</file>

<file path="apps/main-app/ts/store/reducers/entities/calendarEvents/calendarEventsByMessageId.ts">
import { getType } from "typesafe-actions";
⋮----
import {
  addCalendarEvent,
  removeCalendarEvent
} from "../../../actions/calendarEvents";
import { Action } from "../../../actions/types";
import { GlobalState } from "../../types";
⋮----
export type CalendarEvent = {
  eventId: string;
  messageId: string;
};
⋮----
export type CalendarEventsByMessageIdState = {
  [key: string]: CalendarEvent | undefined;
};
⋮----
const reducer = (
  state: CalendarEventsByMessageIdState = INITIAL_STATE,
  action: Action
): CalendarEventsByMessageIdState =>
⋮----
export const calendarEventByMessageIdSelector = (
  state: GlobalState,
  messageId: string
)
</file>

<file path="apps/main-app/ts/store/reducers/entities/calendarEvents/index.ts">
import { combineReducers } from "redux";
⋮----
import { Action } from "../../../actions/types";
import calendarEventsByMessageIdReducer, {
  CalendarEventsByMessageIdState
} from "./calendarEventsByMessageId";
⋮----
export type CalendarEventsState = {
  byMessageId: CalendarEventsByMessageIdState;
};
</file>

<file path="apps/main-app/ts/store/reducers/entities/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { omit } from "lodash";
import { combineReducers } from "redux";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  PersistPartial
} from "redux-persist";
⋮----
import messagesReducer, {
  MessagesState
} from "../../../features/messages/store/reducers";
import { isDevEnv } from "../../../utils/environment";
import { Action } from "../../actions/types";
import { DateISO8601Transform } from "../../transforms/dateISO8601Tranform";
import { PotTransform } from "../../transforms/potTransform";
import calendarEventsReducer, { CalendarEventsState } from "./calendarEvents";
import { paymentByRptIdReducer, PaymentByRptIdState } from "./payments";
⋮----
export type EntitiesState = Readonly<{
  calendarEvents: CalendarEventsState;
  messages: MessagesState;
  paymentByRptId: PaymentByRptIdState;
}>;
⋮----
export type PersistedEntitiesState = EntitiesState & PersistPartial;
</file>

<file path="apps/main-app/ts/store/reducers/entities/payments.ts">
import { getType } from "typesafe-actions";
⋮----
import {
  updatePaymentForMessage,
  UpdatePaymentForMessageFailure
} from "../../../features/messages/store/actions";
import { isMessagePaymentSpecificError } from "../../../features/messages/types/paymentErrors";
import { paymentCompletedSuccess } from "../../../features/payments/checkout/store/actions/orchestration";
import { isPaidPaymentFromDetailV2Enum } from "../../../utils/payment";
import { differentProfileLoggedIn } from "../../actions/crossSessions";
import { Action } from "../../actions/types";
import { GlobalState } from "../types";
⋮----
export type PaidReason = Readonly<
  | {
      kind: "COMPLETED";
      transactionId: number | undefined;
    }
  | {
      kind: "DUPLICATED";
    }
>;
⋮----
export type PaymentByRptIdState = Readonly<{
  [key: string]: PaidReason | undefined;
}>;
⋮----
export const paymentByRptIdReducer = (
  state: PaymentByRptIdState = INITIAL_STATE,
  action: Action
): PaymentByRptIdState =>
⋮----
const paymentByRptIdStateFromUpdatePaymentForMessageFailure = (
  payload: UpdatePaymentForMessageFailure,
  state: PaymentByRptIdState
): PaymentByRptIdState =>
⋮----
export const paymentsByRptIdSelector = (
  state: GlobalState
): PaymentByRptIdState
</file>

<file path="apps/main-app/ts/store/reducers/appState.ts">
import { AppStateStatus } from "react-native";
import { isActionOf } from "typesafe-actions";
⋮----
import { applicationChangeState } from "../actions/application";
import { Action } from "../actions/types";
import { GlobalState } from "./types";
⋮----
export type AppState = Readonly<{
  appState: AppStateStatus;
}>;
⋮----
export const appStateSelector = (state: GlobalState): AppState
⋮----
export const appCurrentStateSelector = (state: GlobalState)
⋮----
export default function appState(
  state: AppState = initialAppState,
  action: Action
): AppState
</file>

<file path="apps/main-app/ts/store/reducers/assistanceTools.ts">
import { combineReducers } from "redux";
import { createSelector } from "reselect";
⋮----
import zendeskReducer, {
  ZendeskState
} from "../../features/zendesk/store/reducers";
import {
  assistanceToolRemoteConfig,
  canShowHelp
} from "../../utils/supportAssistance";
import { Action } from "../actions/types";
import { assistanceToolConfigSelector } from "./backendStatus/remoteConfig";
⋮----
export type AssistanceToolsState = {
  zendesk: ZendeskState;
};
</file>

<file path="apps/main-app/ts/store/reducers/content.ts">
import { ContextualHelp } from "@io-app/api-types/generated/definitions/content/ContextualHelp";
import { Municipality as MunicipalityMetadata } from "@io-app/api-types/generated/definitions/content/Municipality";
import { ScreenCHData } from "@io-app/api-types/generated/definitions/content/ScreenCHData";
⋮----
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import {
  isReady,
  remoteError,
  remoteLoading,
  remoteReady,
  remoteUndefined,
  RemoteValue
} from "../../common/model/RemoteValue";
import { clearCache } from "../../features/settings/common/store/actions";
import { CodiceCatastale } from "../../types/MunicipalityCodiceCatastale";
import {
  fromGeneratedToLocalSpidIdp,
  idps as idpsFallback,
  SpidIdp
} from "../../utils/idps";
import { getCurrentLocale } from "../../utils/locale";
import {
  contentMunicipalityLoad,
  loadContextualHelpData,
  loadIdps
} from "../actions/content";
import { Action } from "../actions/types";
import { GlobalState } from "./types";
⋮----
export type ContentState = Readonly<{
  contextualHelp: pot.Pot<ContextualHelp, Error>;
  idps: RemoteValue<ReadonlyArray<SpidIdp>, Error>;
  municipality: MunicipalityState;
}>;
⋮----
export type MunicipalityState = Readonly<{
  codiceCatastale: pot.Pot<CodiceCatastale, Error>;
  data: pot.Pot<MunicipalityMetadata, Error>;
}>;
⋮----
export const contentSelector = (state: GlobalState)
⋮----
export const municipalitySelector = (state: GlobalState)
⋮----
export const contextualHelpDataSelector = (
  state: GlobalState
): pot.Pot<ContextualHelp, Error>
⋮----
export const getContextualHelpDataFromRouteSelector = (route: string)
⋮----
export default function content(
  state: ContentState = initialContentState,
  action: Action
): ContentState
</file>

<file path="apps/main-app/ts/store/reducers/crossSessions.ts">
import { FiscalCode, NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { pipe } from "fp-ts/lib/function";
⋮----
import { createSelector } from "reselect";
import sha from "sha.js";
import { isActionOf } from "typesafe-actions";
⋮----
import { setProfileHashedFiscalCode } from "../actions/crossSessions";
import { Action } from "../actions/types";
import { GlobalState } from "./types";
⋮----
export type CrossSessionsState = {
  hashedFiscalCode: HashedFiscalCode;
};
type HashedFiscalCode = NonEmptyString | undefined;
⋮----
const hash = (value: FiscalCode): NonEmptyString
⋮----
const reducer = (
  state: CrossSessionsState = INITIAL_STATE,
  action: Action
): CrossSessionsState =>
⋮----
export const hashedProfileFiscalCodeSelector = (
  state: GlobalState
): HashedFiscalCode
⋮----
export const isDifferentFiscalCodeSelector = (
  state: GlobalState,
  fiscalCode: FiscalCode
)
</file>

<file path="apps/main-app/ts/store/reducers/debug.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { PersistConfig, PersistPartial, persistReducer } from "redux-persist";
import { createSelector } from "reselect";
import { getType } from "typesafe-actions";
⋮----
import {
  resetDebugData,
  setDebugData,
  setDebugModeEnabled
} from "../actions/debug";
import { Action } from "../actions/types";
import { GlobalState } from "./types";
⋮----
type DebugState = Readonly<{
  debugData: Record<string, unknown>;
  isDebugModeEnabled: boolean;
}>;
⋮----
function debugReducer(
  state: DebugState = INITIAL_STATE,
  action: Action
): DebugState
⋮----
export type PersistedDebugState = DebugState & PersistPartial;
⋮----
export const isDebugModeEnabledSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/store/reducers/featureFlagWithMinAppVersionStatus.ts">
import { BackendStatus } from "@io-app/api-types/generated/definitions/content/BackendStatus";
import { Config } from "@io-app/api-types/generated/definitions/content/Config";
import { VersionPerPlatform } from "@io-app/api-types/generated/definitions/content/VersionPerPlatform";
import { PatternString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { Platform } from "react-native";
⋮----
import { getAppVersion, isVersionSupported } from "../../utils/appVersion";
⋮----
type CheckPropertyWithMinAppVersionParameters<
  T extends KeysWithMinAppVersion<Config>
> = {
  configPropertyName: T;
  mainLocalFlag: boolean;
  remoteConfig: O.Option<Config>;
} & (
  | {
      optionalConfig: ExtractSecondLevelKeyWithMinAppVersion<Config, T>;
      optionalLocalFlag: boolean;
    }
  | { optionalConfig?: undefined; optionalLocalFlag?: undefined }
);
⋮----
type ExtractSecondLevelKeyWithMinAppVersion<
  T,
  FirstLevel extends keyof T
> = T[FirstLevel] extends infer U
  ? U extends object
    ? KeysWithMinAppVersion<U>
    : never
  : never;
⋮----
type KeysWithMinAppVersion<T> = Extract<
  keyof T,
  {
    [K in keyof T]: T[K] extends ObjectWithMinAppVersion ? K : never;
  }[keyof T]
>;
⋮----
type ObjectWithMinAppVersion =
  | undefined
  | { min_app_version?: VersionPerPlatform };
⋮----
export const isPropertyWithMinAppVersionEnabled = <
  T extends KeysWithMinAppVersion<Config>
>({
  remoteConfig,
  mainLocalFlag,
  configPropertyName,
  optionalLocalFlag,
  optionalConfig
}: CheckPropertyWithMinAppVersionParameters<T>): boolean
⋮----
type RemoteConfigMinAppVersion = O.Option<ObjectWithMinAppVersion>;
⋮----
function getObjectWithMinAppVersion<T extends KeysWithMinAppVersion<Config>>(
  remoteConfig: O.Option<BackendStatus["config"]>,
  mainLocalFlag: boolean,
  configPropertyName: T,
  optionalLocalFlag?: boolean,
  optionalConfig?: ExtractSecondLevelKeyWithMinAppVersion<Config, T>
): ObjectWithMinAppVersion
⋮----
export const isMinAppVersionSupported = (
  minAppVersionOption: RemoteConfigMinAppVersion
): boolean
</file>

<file path="apps/main-app/ts/store/reducers/index.ts">
import AsyncStorage from "@react-native-async-storage/async-storage";
import { combineReducers, Reducer } from "redux";
import {
  createMigrate,
  MigrationManifest,
  PersistConfig,
  PersistedState,
  PersistPartial,
  persistReducer,
  purgeStoredState
} from "redux-persist";
import { isActionOf } from "typesafe-actions";
⋮----
import { versionInfoReducer } from "../../common/versionInfo/store/reducers/versionInfo";
import { appearanceSettingsReducerInitialState } from "../../features/appearanceSettings/store/reducers";
import { appFeedbackInitialState } from "../../features/appReviews/store/reducers";
import { activeSessionLoginInitialState } from "../../features/authentication/activeSessionLogin/store/reducer";
import {
  logoutFailure,
  logoutSuccess,
  sessionExpired
} from "../../features/authentication/common/store/actions";
import authenticationReducer, {
  INITIAL_STATE as authenticationInitialState,
  AuthenticationState
} from "../../features/authentication/common/store/reducers";
import { loginFlowInitialState } from "../../features/authentication/common/store/reducers/loginFlow";
import { fastLoginOptInInitialState } from "../../features/authentication/fastLogin/store/reducers/optInReducer";
import { cieReducer } from "../../features/authentication/login/cie/store/reducers";
import { cieLoginInitialState } from "../../features/authentication/login/cie/store/reducers/cieLogin";
import bonusReducer from "../../features/bonus/common/store/reducers";
import { featuresPersistor } from "../../features/common/store/reducers";
import {
  fillShowLockModal,
  INITIAL_STATE as identificationInitialState,
  identificationReducer,
  IdentificationState
} from "../../features/identification/store/reducers";
import { lollipopPersistor } from "../../features/lollipop/store";
import { initialLollipopState } from "../../features/lollipop/store/reducers/lollipop";
import emailValidationReducer from "../../features/mailCheck/store/reducers/emailValidation";
import onboardingReducer from "../../features/onboarding/store/reducers";
import { profileSettingsReducerInitialState } from "../../features/profileSettings/store/reducers";
import { persistedNotificationsReducer } from "../../features/pushNotifications/store/reducers";
import profileReducer from "../../features/settings/common/store/reducers";
import userDataProcessingReducer from "../../features/settings/common/store/reducers/userDataProcessing";
import { whatsNewInitialState } from "../../features/whatsnew/store/reducers";
import { isDevEnv } from "../../utils/environment";
import { Action } from "../actions/types";
import createSecureStorage from "../storages/keychain";
import { DateISO8601Transform } from "../transforms/dateISO8601Tranform";
import appStateReducer from "./appState";
import assistanceToolsReducer from "./assistanceTools";
import { backendInfoReducer } from "./backendStatus/backendInfo";
import remoteConfigReducer from "./backendStatus/remoteConfig";
import sectionStatusReducer from "./backendStatus/sectionStatus";
import statusMessagesReducer from "./backendStatus/statusMessages";
import contentReducer, {
  initialContentState as contentInitialContentState
} from "./content";
import crossSessionsReducer from "./crossSessions";
import { debugPersistor } from "./debug";
import entitiesReducer, {
  entitiesPersistConfig,
  EntitiesState
} from "./entities";
import installationReducer from "./installation";
import persistedPreferencesReducer, {
  initialPreferencesState
} from "./persistedPreferences";
import preferencesReducer from "./preferences";
import searchReducer from "./search";
import startupReducer from "./startup";
import { GlobalState } from "./types";
⋮----
export function createRootReducer(
  persistConfigs: ReadonlyArray<PersistConfig>
)
</file>

<file path="apps/main-app/ts/store/reducers/IndexedByIdPot.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { IndexedById } from "../helpers/indexer";
⋮----
export const readPot = <T, E>(
  id: number | string,
  data: IndexedById<pot.Pot<T, E>>
): pot.Pot<T, E>
⋮----
export const toLoading = <T, E>(
  id: number | string,
  data: IndexedById<pot.Pot<T, E>>
): IndexedById<pot.Pot<T, E>> => (
⋮----
export const toSome = <T, E>(
  id: number | string,
  data: IndexedById<pot.Pot<T, E>>,
  value: T
): IndexedById<pot.Pot<T, E>> => (
⋮----
export const toError = <T, E>(
  id: number | string,
  data: IndexedById<pot.Pot<T, E>>,
  value: E
): IndexedById<pot.Pot<T, E>> => (
⋮----
export const toUpdating = <T, E>(
  id: number | string,
  data: IndexedById<pot.Pot<T, E>>,
  value: T
): IndexedById<pot.Pot<T, E>> => (
⋮----
export const toNone = <T, E>(
  id: number | string,
  data: IndexedById<pot.Pot<T, E>>
): IndexedById<pot.Pot<T, E>> => (
</file>

<file path="apps/main-app/ts/store/reducers/installation.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { getType } from "typesafe-actions";
⋮----
import {
  appVersionHistory,
  previousInstallationDataDeleteSuccess
} from "../actions/installation";
import { Action } from "../actions/types";
import { GlobalState } from "./types";
⋮----
export type InstallationState = Readonly<{
  appVersionHistory: Array<string>;
  isFirstRunAfterInstall: boolean;
}>;
⋮----
export const isFirstRunAfterInstallSelector = (state: GlobalState): boolean
⋮----
export const appVersionHistorySelector = (
  state: GlobalState
): InstallationState["appVersionHistory"]
⋮----
const reducer = (
  state: InstallationState = INSTALLATION_INITIAL_STATE,
  action: Action
): InstallationState =>
</file>

<file path="apps/main-app/ts/store/reducers/persistedPreferences.ts">
import { createSelector } from "reselect";
import { isActionOf } from "typesafe-actions";
⋮----
import { ColorModeChoice } from "../../hooks/useAppThemeConfiguration";
import { Locales } from "../../i18n";
import { differentProfileLoggedIn } from "../actions/crossSessions";
import { setMixpanelEnabled } from "../actions/mixpanel";
import {
  continueWithRootOrJailbreak,
  customEmailChannelSetEnabled,
  preferenceFingerprintIsEnabledSaveSuccess,
  preferencesExperimentalDesignEnabled,
  preferencesFontSet,
  preferencesIdPayTestSetEnabled,
  preferencesPagoPaTestEnvironmentSetEnabled,
  preferencesPnTestEnvironmentSetEnabled,
  preferencesThemeSet,
  preferredCalendarRemoveSuccess,
  preferredCalendarSaveSuccess,
  preferredLanguageSaveSuccess,
  serviceAlertDisplayedOnceSuccess,
  TypefaceChoice
} from "../actions/persistedPreferences";
import { Action } from "../actions/types";
import { GlobalState } from "./types";
⋮----
export type PersistedPreferencesState = Readonly<{
  continueWithRootOrJailbreak?: boolean;
  fontPreference: TypefaceChoice;
  isCustomEmailChannelEnabled: pot.Pot<boolean, undefined>;
  isExperimentalDesignEnabled: boolean;
  isFingerprintEnabled?: boolean;
  isIdPayTestEnabled?: boolean;
  isMixpanelEnabled: boolean | null;
  isPagoPATestEnabled: boolean;
  isPnTestEnabled: boolean;
  preferredCalendar?: Calendar.Calendar;
  preferredLanguage?: Locales;
  themePreference: ColorModeChoice;
  wasServiceAlertDisplayedOnce?: boolean;
}>;
⋮----
export default function preferencesReducer(
  state: PersistedPreferencesState = initialPreferencesState,
  action: Action
): PersistedPreferencesState
⋮----
export const isPagoPATestEnabledSelector = (state: GlobalState)
⋮----
export const wasServiceAlertDisplayedOnceSelector = (state: GlobalState)
⋮----
export const isCustomEmailChannelEnabledSelector = (state: GlobalState)
⋮----
export const preferredCalendarSelector = (state: GlobalState)
⋮----
export const isFingerprintEnabledSelector = (state: GlobalState)
⋮----
export const persistedPreferencesSelector = (state: GlobalState)
⋮----
export const continueWithRootOrJailbreakSelector = (state: GlobalState)
⋮----
export const isMixpanelEnabled = (state: GlobalState): boolean | null
⋮----
export const isPnTestEnabledSelector = (state: GlobalState)
⋮----
export const isIdPayLocallyEnabledSelector = (state: GlobalState)
⋮----
export const isExperimentalDesignEnabledSelector = (state: GlobalState)
⋮----
export const fontPreferenceSelector = (state: GlobalState): TypefaceChoice
⋮----
export const themePreferenceSelector = (state: GlobalState): ColorModeChoice
</file>

<file path="apps/main-app/ts/store/reducers/preferences.ts">
import { isActionOf } from "typesafe-actions";
⋮----
import {
  preferencesLanguagesLoadSuccess,
  setScreenReaderEnabled
} from "../actions/preferences";
import { Action } from "../actions/types";
import { GlobalState } from "./types";
⋮----
export type PreferencesState = Readonly<{
  languages?: ReadonlyArray<string>;
  screenReaderEnabled: boolean | undefined;
}>;
⋮----
export default function preferencesReducer(
  state: PreferencesState = initialPreferencesState,
  action: Action
): PreferencesState
⋮----
export const isScreenReaderEnabledSelector = (state: GlobalState): boolean
</file>

<file path="apps/main-app/ts/store/reducers/search.ts">
import { getType } from "typesafe-actions";
⋮----
import {
  disableSearch,
  searchMessagesEnabled,
  updateSearchText
} from "../actions/search";
import { Action } from "../actions/types";
import { GlobalState } from "./types";
⋮----
export type SearchState = Readonly<{
  isSearchEnabled: boolean;
  isSearchMessagesEnabled: boolean;
  searchText: O.Option<string>;
}>;
⋮----
export const searchTextSelector = (state: GlobalState): O.Option<string>
⋮----
export const isSearchEnabledSelector = (state: GlobalState): boolean
⋮----
export const isSearchMessagesEnabledSelector = (state: GlobalState): boolean
⋮----
const reducer = (
  state: SearchState = INITIAL_STATE,
  action: Action
): SearchState =>
</file>

<file path="apps/main-app/ts/store/reducers/startup.ts">
import { isActionOf } from "typesafe-actions";
⋮----
import {
  sessionCorrupted,
  sessionExpired,
  sessionInvalid
} from "../../features/authentication/common/store/actions";
import { startupLoadSuccess, startupTransientError } from "../actions/startup";
import { Action } from "../actions/types";
import { GlobalState } from "./types";
⋮----
export enum StartupStatusEnum {
  AUTHENTICATED = "authenticated",
  INITIAL = "initial",
  NOT_AUTHENTICATED = "notAuthenticated",
  OFFLINE = "offline",
  ONBOARDING = "onboarding"
}
⋮----
export type StartupState = {
  status: StartupStatusEnum;
  transientError: StartupTransientError;
};
⋮----
export type StartupTransientError =
  | StartupTransientErrorNotSet
  | StartupTransientErrorOnGetProfile
  | StartupTransientErrorOnGetSession;
⋮----
type StartupTransientErrorNotSet = {
  getProfileRetries: 0;
  getSessionRetries: 0;
  kind: "NOT_SET";
};
⋮----
type StartupTransientErrorOnGetProfile = {
  getProfileRetries: number;
  getSessionRetries: number;
  kind: "GET_PROFILE_DOWN";
  showError: boolean;
};
⋮----
type StartupTransientErrorOnGetSession = {
  getProfileRetries: number;
  getSessionRetries: number;
  kind: "GET_SESSION_DOWN";
  showError: boolean;
};
⋮----
export default function startupReducer(
  state: StartupState = initialStartupState,
  action: Action
): StartupState
⋮----
export const isStartupLoaded = (state: GlobalState): StartupStatusEnum
⋮----
export const startupTransientErrorSelector = (
  state: GlobalState
): StartupTransientError
⋮----
export const isTransientErrorNotSetSelector = (state: GlobalState)
⋮----
export const isTransientErrorOnGetProfileSelector = (state: GlobalState)
⋮----
export const isTransientErrorOnGetSessionSelector = (state: GlobalState)
</file>

<file path="apps/main-app/ts/store/reducers/types.ts">
import { PersistPartial } from "redux-persist";
⋮----
import { VersionInfoState } from "../../common/versionInfo/store/reducers/versionInfo";
import { PersistedAuthenticationState } from "../../features/authentication/common/store/reducers";
import { CieState } from "../../features/authentication/login/cie/store/reducers/cie";
import { BonusState } from "../../features/bonus/common/store/reducers";
import { PersistedFeaturesState } from "../../features/common/store/reducers";
import { PersistedIdentificationState } from "../../features/identification/store/reducers";
import { LollipopReducerState } from "../../features/lollipop/store";
import { EmailValidationState } from "../../features/mailCheck/store/reducers/emailValidation";
import { OnboardingState } from "../../features/onboarding/store/reducers";
import { PersistedNotificationsState } from "../../features/pushNotifications/store/reducers";
import { ProfileState } from "../../features/settings/common/store/reducers";
import { UserDataProcessingState } from "../../features/settings/common/store/reducers/userDataProcessing";
import { AppState } from "./appState";
import { AssistanceToolsState } from "./assistanceTools";
import { BackedInfoState } from "./backendStatus/backendInfo";
import { RemoteConfigState } from "./backendStatus/remoteConfig";
import { SectionStatusState } from "./backendStatus/sectionStatus";
import { StatusMessagesState } from "./backendStatus/statusMessages";
import { ContentState } from "./content";
import { CrossSessionsState } from "./crossSessions";
import { PersistedDebugState } from "./debug";
import { PersistedEntitiesState } from "./entities";
import { InstallationState } from "./installation";
import { PersistedPreferencesState } from "./persistedPreferences";
import { PreferencesState } from "./preferences";
import { SearchState } from "./search";
import { StartupState } from "./startup";
⋮----
export type GlobalState = Readonly<{
  appState: AppState;
  assistanceTools: AssistanceToolsState;
  authentication: PersistedAuthenticationState;
  backendInfo: BackedInfoState;
  bonus: BonusState;
  cie: CieState;
  content: ContentState;
  crossSessions: CrossSessionsState;
  debug: PersistedDebugState;
  emailValidation: EmailValidationState;
  entities: PersistedEntitiesState;
  features: PersistedFeaturesState;
  identification: PersistedIdentificationState;
  installation: InstallationState;
  lollipop: LollipopReducerState;
  notifications: PersistedNotificationsState;
  onboarding: OnboardingState;
  persistedPreferences: PersistedPreferencesState;
  preferences: PreferencesState;
  profile: ProfileState;
  remoteConfig: RemoteConfigState;
  search: SearchState;
  sectionStatus: SectionStatusState;
  startup: StartupState;
  statusMessages: StatusMessagesState;
  userDataProcessing: UserDataProcessingState;
  versionInfo: VersionInfoState;
}>;
⋮----
export type PersistedGlobalState = GlobalState & PersistPartial;
</file>

<file path="apps/main-app/ts/store/storages/keychain.ts">
import { Storage } from "redux-persist";
⋮----
import { setGenericPasswordWithDefaultAccessibleOption } from "../../utils/keychain";
⋮----
export default function createSecureStorage(): Storage
⋮----
export const clearKeychainError = () =>
</file>

<file path="apps/main-app/ts/store/storages/secureStorage.ts">
import { type SecureStorageError } from "@pagopa/io-react-native-secure-storage";
import { type Storage } from "redux-persist";
⋮----
import { trackAppCaughtError } from "../../utils/analytics";
import { unknownToString } from "../../utils/errors";
⋮----
const isSecureStorageError = (e: unknown): e is SecureStorageError =>
⋮----
export const isValueNotFoundError = (e: unknown): boolean
⋮----
export default function createSecureStorage(): Storage
</file>

<file path="apps/main-app/ts/store/transforms/dateISO8601Tranform.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { createTransform, TransformIn, TransformOut } from "redux-persist";
⋮----
import { DateFromISOString } from "../../utils/dates";
⋮----
const dataReplacer = (_: any, value: any): any =>
⋮----
const dateReviver = (key: any, value: any): any =>
⋮----
const encoder: TransformIn<any, string> = (value: any, _: string): any
⋮----
const decoder: TransformOut<string, any> = (value: any, _: string): any
</file>

<file path="apps/main-app/ts/store/transforms/potTransform.ts">
import { createTransform } from "redux-persist";
⋮----
const potReviver = (_: any, value: any) =>
</file>

<file path="apps/main-app/ts/store/transforms/setTransform.ts">
import { createTransform } from "redux-persist";
⋮----
export const createSetTransform = (whitelist?: Array<string>)
</file>

<file path="apps/main-app/ts/store/hooks.ts">
import {
  TypedUseSelectorHook,
  useDispatch,
  useSelector,
  useStore
} from "react-redux";
⋮----
import { AppDispatch } from "../App";
import { GlobalState } from "./reducers/types";
⋮----
export const useIODispatch = ()
⋮----
export const useIOStore = ()
</file>

<file path="apps/main-app/ts/types/helpers.ts">
export type Either<T, U> = Only<T, U> | Only<U, T>;
⋮----
export type NonEmptyArray<T> = [T, ...Array<T>];
⋮----
export type Prettify<T> = object & {
  [K in keyof T]: T[K];
};
⋮----
type Only<T, U> = {
  [P in keyof T]: T[P];
} & {
  [P in keyof U]?: never;
};
</file>

<file path="apps/main-app/ts/types/LocalizedCTAs.ts">
export type CTA = t.TypeOf<typeof CTA>;
⋮----
export type CTAS = t.TypeOf<typeof CTAS>;
⋮----
export type LocalizedCTAs = t.TypeOf<typeof LocalizedCTAs>;
⋮----
export type LocalizedCTALocales = t.TypeOf<typeof LocalizedCTALocales>;
</file>

<file path="apps/main-app/ts/types/MunicipalityCodiceCatastale.ts">
import { PatternString } from "@pagopa/ts-commons/lib/strings";
⋮----
export type CodiceCatastale = t.TypeOf<typeof CodiceCatastale>;
</file>

<file path="apps/main-app/ts/types/pagopa.ts">
import { Amount as AmountPagoPA } from "@io-app/api-types/generated/definitions/pagopa/Amount";
import { CreditCard as CreditCardPagoPA } from "@io-app/api-types/generated/definitions/pagopa/CreditCard";
import { EnableableFunctions } from "@io-app/api-types/generated/definitions/pagopa/EnableableFunctions";
import { Pay as PayPagoPA } from "@io-app/api-types/generated/definitions/pagopa/Pay";
import { PayPalInfo } from "@io-app/api-types/generated/definitions/pagopa/PayPalInfo";
import { PayRequest as PayRequestPagoPA } from "@io-app/api-types/generated/definitions/pagopa/PayRequest";
import { Psp as PspPagoPA } from "@io-app/api-types/generated/definitions/pagopa/Psp";
import { PspListResponseCD as PspListResponsePagoPA } from "@io-app/api-types/generated/definitions/pagopa/PspListResponseCD";
import { PspResponse as PspResponsePagoPA } from "@io-app/api-types/generated/definitions/pagopa/PspResponse";
import { Session as SessionPagoPA } from "@io-app/api-types/generated/definitions/pagopa/Session";
import { SessionResponse as SessionResponsePagoPA } from "@io-app/api-types/generated/definitions/pagopa/SessionResponse";
import {
  Transaction as TransactionPagoPA,
  Transaction as TTransactionPagoPA
} from "@io-app/api-types/generated/definitions/pagopa/Transaction";
import { TransactionListResponse as TransactionListResponsePagoPA } from "@io-app/api-types/generated/definitions/pagopa/TransactionListResponse";
import { TransactionResponse as TransactionResponsePagoPA } from "@io-app/api-types/generated/definitions/pagopa/TransactionResponse";
import { Wallet as WalletPagoPA } from "@io-app/api-types/generated/definitions/pagopa/Wallet";
import { WalletListResponse as WalletListResponsePagoPA } from "@io-app/api-types/generated/definitions/pagopa/WalletListResponse";
import { WalletResponse as WalletResponsePagoPA } from "@io-app/api-types/generated/definitions/pagopa/WalletResponse";
import { WalletTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/WalletV2";
import { Abi } from "@io-app/api-types/generated/definitions/pagopa/walletv2/Abi";
import { BPayInfo as BPayInfoPagoPa } from "@io-app/api-types/generated/definitions/pagopa/walletv2/BPayInfo";
import {
  CardInfo,
  TypeEnum as CreditCardTypeEnum
} from "@io-app/api-types/generated/definitions/pagopa/walletv2/CardInfo";
import {
  enumType,
  ReplaceProp1,
  replaceProp1 as repP,
  requiredProp1 as reqP,
  tag
} from "@pagopa/ts-commons/lib/types";
import { pipe } from "fp-ts/lib/function";
⋮----
import { ImageSourcePropType } from "react-native";
⋮----
import {
  CreditCardCVC,
  CreditCardExpirationMonth,
  CreditCardExpirationYear,
  CreditCardPan
} from "../utils/input";
⋮----
export type CreditCardType = t.TypeOf<typeof CreditCardType>;
⋮----
export type CreditCard = t.TypeOf<typeof CreditCard>;
⋮----
export type Amount = t.TypeOf<typeof Amount>;
⋮----
export type Psp = t.TypeOf<typeof Psp>;
⋮----
export type PatchedPaymentMethodInfo = t.TypeOf<
  typeof PatchedPaymentMethodInfo
>;
⋮----
export type PatchedWalletV2 = t.TypeOf<typeof PatchedWalletV2>;
⋮----
export type RawBPayPaymentMethod = WalletV2WithoutInfo & {
  info: BPayInfoPagoPa;
  kind: "BPay";
};
⋮----
export type RawPaymentMethod =
  | RawBancomatPaymentMethod
  | RawBPayPaymentMethod
  | RawCreditCardPaymentMethod
  | RawPayPalPaymentMethod;
⋮----
type RawBancomatPaymentMethod = WalletV2WithoutInfo & {
  info: CardInfo;
  kind: "Bancomat";
};
⋮----
type RawCreditCardPaymentMethod = WalletV2WithoutInfo & {
  info: CardInfo;
  kind: "CreditCard";
};
⋮----
type RawPayPalPaymentMethod = WalletV2WithoutInfo & {
  info: PayPalInfo;
  kind: "PayPal";
};
⋮----
type WalletV2WithoutInfo = Exclude<PatchedWalletV2, "info" | "walletType">;
⋮----
export const isRawBancomat = (
  pm: RawPaymentMethod | undefined
): pm is RawBancomatPaymentMethod
⋮----
export const isRawPayPal = (
  pm: RawPaymentMethod | undefined
): pm is RawPayPalPaymentMethod
⋮----
export const isRawCreditCard = (
  pm: RawPaymentMethod | undefined
): pm is RawCreditCardPaymentMethod
⋮----
export const isRawBPay = (
... (98 lines truncated)
</file>

<file path="apps/main-app/ts/types/paymentMethodCapabilities.ts">
export type PaymentSupportStatus =
  | "arriving"
  | "available"
  | "notAvailable"
  | "onboardableNotImplemented";
</file>

<file path="apps/main-app/ts/types/PinString.ts">
import { PatternString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { PIN_LENGTH, PIN_LENGTH_SIX } from "../utils/constants";
⋮----
export type PinString = t.TypeOf<typeof PinString>;
</file>

<file path="apps/main-app/ts/types/utils.ts">
import { Effect } from "redux-saga/effects";
⋮----
export type ReduxSagaEffect = Effect;
⋮----
export type SagaCallReturnType<
  T extends (...args: Array<any>) => any,
  R = ReturnType<T>
> =
  R extends Generator<infer _, infer B0, infer _>
    ? B0
    : R extends Iterator<Effect | (infer B)>
      ? B
      : R extends IterableIterator<Effect | (infer B1)>
        ? B1
        : R extends Promise<infer B2>
          ? B2
          : never;
⋮----
export type XOR<T, U> = T | U extends object
  ? (T & Without<U, T>) | (U & Without<T, U>)
  : T | U;
⋮----
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
⋮----
export function computedProp<K extends PropertyKey, V>(
  key: K,
  value: V
): K extends any ?
</file>

<file path="apps/main-app/ts/types/WithTestID.ts">
export type TestID = { testID?: string };
⋮----
export type WithTestID<T> = T & TestID;
</file>

<file path="apps/main-app/ts/utils/__mocks__/municipality.ts">
import { Municipality } from "@io-app/api-types/generated/definitions/content/Municipality";
</file>

<file path="apps/main-app/ts/utils/__mocks__/paypalAccountPsp.ts">
import { PayPalAccountPspInfo } from "@io-app/api-types/generated/definitions/pagopa/PayPalAccountPspInfo";
</file>

<file path="apps/main-app/ts/utils/__mocks__/platform.ts">
function test_setPlatform(p: "android" | "ios")
</file>

<file path="apps/main-app/ts/utils/hooks/bottomSheet.tsx">
import {
  BottomSheetBackdrop,
  BottomSheetBackdropProps,
  BottomSheetBackgroundProps,
  BottomSheetFooter,
  BottomSheetFooterProps,
  BottomSheetModal,
  BottomSheetScrollView,
  useBottomSheetModal
} from "@gorhom/bottom-sheet";
import {
  IOColors,
  IODimensions,
  useIOTheme,
  VSpacer
} from "@io-app/design-system";
import { NonEmptyArray } from "fp-ts/lib/NonEmptyArray";
import {
  JSX,
  PropsWithChildren,
  ReactElement,
  ReactNode,
  useCallback,
  useEffect,
  useRef,
  useState
} from "react";
import {
  AccessibilityInfo,
  Dimensions,
  Modal,
  Platform,
  StatusBar,
  StyleSheet,
  View
} from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
⋮----
import { BottomSheetHeader } from "../../components/bottomSheet/BottomSheetHeader";
import { useHardwareBackButtonToDismiss } from "../../hooks/useHardwareBackButton";
import { isScreenReaderEnabled } from "../accessibility";
import { useModalStyle } from "./useModalStyle";
⋮----
const NonAccessibleBottomSheetBackground = ({
  pointerEvents,
  style
}: BottomSheetBackgroundProps) => (
  <View accessible={false} pointerEvents={pointerEvents} style={style} />
);
⋮----
type BottomSheetOptions = {
  component: ReactNode;
  footer?: ReactElement;
  forceFullscreen?: boolean;
  onDismiss?: () => void;
  snapPoint?: NonEmptyArray<number | string>;
  title: ReactNode | string;
};
⋮----
const handleDismiss = () =>
⋮----
footerComponent=
</file>

<file path="apps/main-app/ts/utils/hooks/useBiometricType.ts">
import { BiometricsValidType } from "@io-app/design-system";
import { useEffect, useState } from "react";
⋮----
import { useIOSelector } from "../../store/hooks";
import { isFingerprintEnabledSelector } from "../../store/reducers/persistedPreferences";
import { getBiometricsType, isBiometricsValidType } from "../biometrics";
⋮----
export const useBiometricType = () =>
</file>

<file path="apps/main-app/ts/utils/hooks/useModalStyle.tsx">
import { IOColors, useIOTheme, useIOThemeContext } from "@io-app/design-system";
import { ColorValue, ViewStyle } from "react-native";
⋮----
type ModalStyleProps = {
  backdrop: {
    backgroundColor: ColorValue;
    opacity: number;
  };
  modal: {
    backgroundColor: ColorValue;
  };
};
⋮----
export const useModalStyle = (): ModalStyleProps =>
</file>

<file path="apps/main-app/ts/utils/hooks/useOnFirstRender.ts">
import { useEffect, useRef } from "react";
⋮----
export const useOnFirstRender = (
  callback: () => void,
  shouldRun: () => boolean = () => true
) =>
</file>

<file path="apps/main-app/ts/utils/hooks/useOnFocus.tsx">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { useNavigation } from "@react-navigation/native";
import { useEffect, useState } from "react";
⋮----
export const useActionOnFocus = (
  loadAction: () => void,
  dontExecuteBefore: Millisecond | undefined = undefined
) =>
</file>

<file path="apps/main-app/ts/utils/hooks/usePreventScreenCapture.ts">
import { useFocusEffect } from "@react-navigation/native";
import {
  allowScreenCaptureAsync,
  preventScreenCaptureAsync
} from "expo-screen-capture";
import { useCallback, useMemo, useRef } from "react";
import { v4 as uuidv4 } from "uuid";
⋮----
import { isDevEnv } from "../environment";
⋮----
const preventScreenCapture = (tag: string) =>
⋮----
const allowScreenCapture = (tag: string) =>
⋮----
export function usePreventScreenCapture(key?: string)
</file>

<file path="apps/main-app/ts/utils/hooks/usePrevious.ts">
import { useEffect, useRef } from "react";
⋮----
export function usePrevious<T>(value: T)
</file>

<file path="apps/main-app/ts/utils/jest/withStore.tsx">
import { JSXElementConstructor } from "react";
import { Provider } from "react-redux";
import { createStore } from "redux";
⋮----
import { applicationChangeState } from "../../store/actions/application";
import { appReducer } from "../../store/reducers";
⋮----
export function withStore<P extends Record<string, unknown>>(
  Component: JSXElementConstructor<P>
)
</file>

<file path="apps/main-app/ts/utils/accessibility.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import I18n from "i18next";
import { RefObject } from "react";
import { AccessibilityInfo, HostInstance } from "react-native";
⋮----
import { format } from "./dates";
⋮----
export const setAccessibilityFocus = (
  nodeReference: RefObject<HostInstance | null>,
  executionDelay: Millisecond = 0 as Millisecond,
  callback?: () => void
) =>
⋮----
export const isScreenReaderEnabled = async (): Promise<boolean> =>
⋮----
export const dateToAccessibilityReadableFormat = (
  date: Date,
  dateFormat: string = I18n.t("global.accessibility.dateFormat")
) => `$
⋮----
export const hoursAndMinutesToAccessibilityReadableFormat = (date: Date)
⋮----
export const formatStringToSpacedString = (str: string): string
⋮----
/**
 * This function is used to get the text that will be read by the screen reader
 * with the correct minus symbol pronunciation.
 */
export const getAccessibleAmountText = (amount?: string)
⋮----
export const getListItemAccessibilityLabelCount = (
  total: number,
  index: number,
  excludeComma = false
)
</file>

<file path="apps/main-app/ts/utils/analytics.ts">
import { pipe } from "fp-ts/lib/function";
import {
  WebViewErrorEvent,
  WebViewHttpErrorEvent
} from "react-native-webview/lib/WebViewTypes";
import URLParse from "url-parse";
⋮----
import { mixpanelTrack } from "../mixpanel";
import {
  clearKeychainError,
  getKeychainError,
  removeKeychainError,
  setKeychainError
} from "../store/storages/keychain";
import { unknownToString } from "./errors";
⋮----
const isWebViewErrorEvent = (
  e: Parameters<typeof trackLoginError>[1]
): e is WebViewErrorEvent
const isWebViewHttpErrorEvent = (
  e: Parameters<typeof trackLoginError>[1]
): e is WebViewHttpErrorEvent
⋮----
export type FlowType =
  | "browsing"
  | "firma con IO"
  | "firstOnboarding"
  | "onBoarding"
  | "preferenze";
⋮----
export const getFlowType = (
  isOnBoarding: boolean,
  isFirstOnBoarding?: boolean,
  isUserBrowsing?: boolean
): FlowType =>
⋮----
export const booleanToYesNo = (value: boolean): "no" | "yes"
⋮----
export const numberToYesNoOnThreshold = (value: number, threshold = 0)
⋮----
export const dateToUTCISOString = (date: Date)
⋮----
export const buildEventProperties = (
  eventCategory: "KO" | "TECH" | "UX",
  eventType:
    | "action"
    | "confirm"
    | "control"
    | "error"
    | "exit"
    | "micro_action"
    | "screen_view"
    | undefined,
  customProperties: Record<string, unknown> = {},
  flow?: FlowType
) => (
⋮----
export const trackAppCaughtError = (
  subject: string,
  message: string | undefined,
  exception: string | undefined
) =>
⋮----
export function extractLoginErrorPayload(
  error: Error | WebViewErrorEvent | WebViewHttpErrorEvent
)
⋮----
export function trackHelpCenterCtaTapped(
  hc_id?: string,
  hc_landing_url?: string,
  hc_source?: string
)
⋮----
export function trackKeychainFailures()
⋮----
export function trackLoginError(
  idpName: string | undefined,
  error: Error | WebViewErrorEvent | WebViewHttpErrorEvent
)
⋮----
export function trackLollipopIdpLoginFailure(reason: string)
⋮----
export function trackLollipopIsKeyStrongboxBackedFailure(reason: string)
⋮----
export function trackLollipopIsKeyStrongboxBackedSuccess(
  isStrongboxBacked: boolean
)
⋮----
export function trackLollipopKeyGenerationFailure(reason: string)
⋮----
export function trackLollipopKeyGenerationSuccess(keyType?: string)
⋮----
function toUrlWithoutQueryParams(url: string)
⋮----
export const trackOfflineActionNotAllowed = (screen: string) =>
⋮----
export const trackContentNotAvailable = (content: string) =>
</file>

<file path="apps/main-app/ts/utils/api.ts">
import {
  RequestHeaderProducer,
  RequestHeaders
} from "@pagopa/ts-commons/lib/requests";
import { Omit } from "@pagopa/ts-commons/lib/types";
⋮----
export const withBearerToken =
(token: string)
⋮----
function ParamAuthorizationBearerHeaderProducer<
  P extends { readonly Bearer: string }
>(): RequestHeaderProducer<P, "Authorization">
</file>

<file path="apps/main-app/ts/utils/appSettings.ts">
import { constUndefined } from "fp-ts/lib/function";
import { Linking, Platform } from "react-native";
import AndroidOpenSettings from "react-native-android-open-settings";
⋮----
export const openAppSettings = () =>
</file>

<file path="apps/main-app/ts/utils/appVersion.ts">
import { PatternString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { pipe } from "fp-ts/lib/function";
import { Platform } from "react-native";
import semver, { SemVer } from "semver";
⋮----
import { getDeviceAppVersion } from "./device";
import { NumberFromString } from "./number";
⋮----
const validateFormat = (value: string): E.Either<Error, SemVer>
⋮----
export const isVersionSupported = (
  minAppVersion: string,
  appVersion: string
): boolean =>
⋮----
export const getAppVersion = (): string
</file>

<file path="apps/main-app/ts/utils/assert.ts">
export function assert(
  condition: unknown,
  msg = "Assertion failed"
): asserts condition
</file>

<file path="apps/main-app/ts/utils/biometrics.ts">
import I18n from "i18next";
import { Alert, Platform } from "react-native";
⋮----
import { isDebugBiometricIdentificationEnabled } from "../config";
import { mixpanelTrack } from "../mixpanel";
⋮----
export type BiometricsType = BiometricsErrorType | BiometricsValidType;
⋮----
export type BiometricsValidType =
  "BIOMETRICS" | "FACE_ID" | "TOUCH_ID";
⋮----
type BiometricsErrorType = (typeof biometricErrors)[number];
⋮----
export const getBiometricsType = (
  shouldTrackError = true
): Promise<BiometricsType>
⋮----
export const isBiometricsValidType = (
  biometrics: BiometricsType
): biometrics is BiometricsValidType
⋮----
const biometricAuthenticationFailureHandler = (
  error: unknown,
  onError: (e: LocalAuthentication.LocalAuthenticationError) => void
) =>
⋮----
export const biometricAuthenticationRequest = (
  onSuccess: () => void,
  onError: (e: LocalAuthentication.LocalAuthenticationError) => void
): Promise<void>
⋮----
type BiometricState = "Available" | "NotEnrolled" | "NotSupported";
⋮----
export const getBiometricState = async (): Promise<BiometricState> =>
⋮----
export type BiometriActivationUserType =
  | "ACTIVATED"
  | "AUTH_FAILED"
  | "PERMISSION_DENIED"
  | "SENSOR_ERROR";
⋮----
const mayUserActivateBiometricWithDependency = (
  getBiometricsTypeInternal: Promise<BiometricsType>
): Promise<BiometriActivationUserType>
⋮----
export const mayUserActivateBiometric = ()
⋮----
function handleErrorDuringBiometricActivation(
  err: LocalAuthentication.LocalAuthenticationError
): BiometriActivationUserType
</file>

<file path="apps/main-app/ts/utils/brightness.ts">
import { useCallback, useEffect, useRef } from "react";
import { AppState, AppStateStatus, Platform } from "react-native";
⋮----
type UseMaxBrightnessOptions = {
  transitionDuration?: number;
  useSmoothTransition?: boolean;
};
⋮----
export function useMaxBrightness({
  useSmoothTransition = false,
  transitionDuration = DEFAULT_TRANSITION_DURATION
}: UseMaxBrightnessOptions =
⋮----
const animate = async () =>
⋮----
const handleAppStateChange = async (nextAppState: AppStateStatus) =>
⋮----
const initialize = async () =>
⋮----
export const MaxBrightness = (
  props: UseMaxBrightnessOptions = {}
): React.ReactNode =>
</file>

<file path="apps/main-app/ts/utils/calendar.ts">
import { CreatedMessageWithContentAndAttachments } from "@io-app/api-types/generated/definitions/communication/CreatedMessageWithContentAndAttachments";
import { IOToast } from "@io-app/design-system";
⋮----
import { identity, pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
import { Platform } from "react-native";
⋮----
import { AddCalendarEventPayload } from "../store/actions/calendarEvents";
import { CalendarEvent } from "../store/reducers/entities/calendarEvents/calendarEventsByMessageId";
⋮----
type CalendarAuthorization = { asked: boolean; authorized: boolean };
⋮----
export async function checkAndRequestPermission(): Promise<CalendarAuthorization>
⋮----
export function convertLocalCalendarName(calendarTitle: string)
⋮----
export const legacyIsEventInCalendar = (
  eventId: string
): TE.TaskEither<Error, boolean> =>
⋮----
export const searchEventInCalendar = async (
  ids: Array<Calendar.Calendar["id"]>,
  endDate: Date,
  title: string
): Promise<O.Option<string>> =>
⋮----
export const saveCalendarEvent = (
  calendar: Calendar.Calendar,
  message: CreatedMessageWithContentAndAttachments,
  dueDate: Date,
  title: string,
  onAddCalendarEvent?: (calendarEvent: AddCalendarEventPayload) => void
) =>
⋮----
export const removeCalendarEventFromDeviceCalendar = (
  calendarEvent: CalendarEvent | undefined,
  onRemoveEvent?: (calendarEvent: CalendarEvent) => void
) =>
⋮----
export const requestCalendarPermission = async (): Promise<boolean> =>
⋮----
export const isEventInCalendar = (eventId: string)
⋮----
export const saveEventToDeviceCalendarTask = (
  calendarId: string,
  dueDate: Date,
  title: string
)
⋮----
export const removeEventFromDeviceCalendarTask = (eventId: string)
</file>

<file path="apps/main-app/ts/utils/card.ts">
import { PaymentNetworkEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv2/PaymentInstrument";
import { pipe } from "fp-ts/lib/function";
⋮----
import defaultCardIcon from "../../img/wallet/cards-icons/unknown.png";
⋮----
export const getCardIconFromPaymentNetwork = (
  brand: PaymentNetworkEnum | undefined
)
⋮----
const sumNumbers = (sum: number, current: number): number
⋮----
export const luhnValidateCCN = (creditCard: string): boolean =>
⋮----
export const validateCVV = (creditCard: string, cvv: string): boolean =>
</file>

<file path="apps/main-app/ts/utils/clipboard.ts">
import { IOToast } from "@io-app/design-system";
⋮----
import I18n from "i18next";
⋮----
export const clipboardSetStringWithFeedback = (text: string) =>
</file>

<file path="apps/main-app/ts/utils/constants.ts">

</file>

<file path="apps/main-app/ts/utils/contextualHelp.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
</file>

<file path="apps/main-app/ts/utils/creditCard.ts">
import { IOIcons } from "@io-app/design-system";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { ImageURISource } from "react-native";
⋮----
export type SupportedBrand = {
  cvvLength: number;
  iconForm: IconSource;
  luhnVal: boolean;
  name: string;
  re: RegExp;
};
⋮----
type CreditCardDetector = {
  supportedBrands: Record<string, SupportedBrand>;
  validate: (pan: O.Option<string>) => SupportedBrand;
};
⋮----
type IconSource = ImageURISource | IOIcons | undefined;
</file>

<file path="apps/main-app/ts/utils/dates.ts">
import { format as dateFnsFormat } from "date-fns";
import dfns_de from "date-fns/locale/de";
import dfns_en from "date-fns/locale/en";
import dfns_it from "date-fns/locale/it";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
import { Errors } from "io-ts";
⋮----
import { Locales } from "../i18n";
import { CreditCardExpirationMonth, CreditCardExpirationYear } from "./input";
import { getLocalePrimary } from "./locale";
import { NumberFromString } from "./number";
⋮----
type DateFnsLocale = typeof import("date-fns/locale/it");
⋮----
type DFNSLocales = Record<Locales, DateFnsLocale>;
⋮----
export const pad = (n: number)
⋮----
export const formatFiscalCodeBirthdayAsShortFormat = (
  date: Date | undefined
): string
⋮----
export const formatDateAsShortFormat = (date: Date): string
⋮----
export function format(
  date: Date | number | string,
  dateFormat?: string
): ReturnType<typeof dateFnsFormat>
⋮----
export function formatDateAsDay(date: Date): ReturnType<typeof format>
⋮----
export function formatDateAsLocal(
  date: Date,
  includeYear = false,
  extendedYear = false
): ReturnType<typeof dateFnsFormat>
⋮----
export function formatDateAsMonth(date: Date): ReturnType<typeof format>
⋮----
export const decodeCreditCardMonth = (
  month: number | string | undefined
): E.Either<Error | Errors, number> =>
⋮----
export const decodeCreditCardYear = (
  year: number | string | undefined
): E.Either<Error | Errors, number> =>
⋮----
// if the year is 2 digits, convert it to 4 digits: 21 -> 2021
⋮----
// check that year is included matches the pattern (00-99)
⋮----
export const isExpired = (
  expireMonth: number | string | undefined,
  expireYear: number | string | undefined
): E.Either<Error, boolean> =>
⋮----
export const isExpiredDate = (expiryDate: Date): boolean =>
⋮----
export type ExpireStatus = "EXPIRED" | "EXPIRING" | "VALID";
⋮----
export const getExpireStatus = (date: Date): ExpireStatus =>
⋮----
export class DateFromISOStringType extends t.Type<Date, string, unknown>
⋮----
constructor()
⋮----
export const getTranslatedShortNumericMonthYear = (
  fullYear?: string,
  month?: string
): string | undefined =>
⋮----
export const toAndroidCacheTimestamp = ()
⋮----
/**
 * This function returns a Date object from a string in format "YYYYMM"
 *
 * @param expiryDate
 */
export const getDateFromExpiryDate = (expiryDate: string): Date | undefined =>
</file>

<file path="apps/main-app/ts/utils/deepLinkUtils.ts">
export const shouldTriggerWalletUpdate = (url: string): boolean
⋮----
export const isCGNLinking = (url: string): boolean
</file>

<file path="apps/main-app/ts/utils/device.ts">
import { getUniqueIdSync } from "@io-app/expo-device-internal";
⋮----
import { Paths } from "expo-file-system";
import {
  getEnrolledLevelAsync,
  SecurityLevel
} from "expo-local-authentication";
import { PixelRatio, Platform } from "react-native";
⋮----
export const getDeviceId = (): string
⋮----
export const getFontScale = (): number
⋮----
export const getModel = (): string
⋮----
export const getSystemVersion = (): string
⋮----
export const getFreeDiskStorage = (): number
⋮----
// true if at least one screen lock method is set
export const isScreenLockSet = (): Promise<boolean>
⋮----
export const getDeviceAppVersion = (): string
⋮----
export const isTablet = (): boolean
</file>

<file path="apps/main-app/ts/utils/environment.ts">
import { environment } from "../config";
</file>

<file path="apps/main-app/ts/utils/errors.ts">
import { isString as lodashIsString } from "lodash";
⋮----
import { MessagesFailurePayload } from "../features/messages/store/actions";
⋮----
export type GenericError = { readonly kind: "generic"; value: Error };
export type NetworkError = GenericError | TimeoutError;
export type TimeoutError = { readonly kind: "timeout" };
⋮----
export const getError = (error: unknown): Error =>
⋮----
export const getNetworkError = (error: unknown): NetworkError =>
⋮----
export const getGenericError = (error: Error): GenericError => (
⋮----
export const getTimeoutError = (): TimeoutError => (
⋮----
export const isTimeoutError = (error: NetworkError): error is TimeoutError
⋮----
export const getNetworkErrorMessage = (error: NetworkError): string
⋮----
export const getErrorFromNetworkError = (networkError: NetworkError): Error =>
⋮----
export const convertUnknownToError = (e: unknown): Error
⋮----
export const convertUnknownToMessagesFailure = (
  e: unknown
): MessagesFailurePayload =>
⋮----
export const serializeError = (error: Error) => (
⋮----
export const unknownToString = (input: unknown): string =>
</file>

<file path="apps/main-app/ts/utils/failureReason.ts">
import { getNetworkError, isTimeoutError, NetworkError } from "./errors";
⋮----
export enum FailureReason {
  BAD_FORMAT = "BAD_FORMAT",
  DECODE_ERROR = "DECODE_ERROR",
  HTTP_STATUS_ERROR = "HTTP_STATUS_ERROR",
  MALFORMED_RESPONSE = "MALFORMED_RESPONSE",
  NETWORK_ERROR = "NETWORK_ERROR",
  RATE_LIMITED = "RATE_LIMITED",
  SESSION_EXPIRED = "SESSION_EXPIRED",
  TIMEOUT = "TIMEOUT"
}
⋮----
enum HttpStatus {
  UNAUTHORIZED = 401,
  UNSUPPORTED_MEDIA_TYPE = 415,
  TOO_MANY_REQUESTS = 429
}
⋮----
export type DecodableFailure =
  | { error: unknown; kind: "caught" }
  | { kind: "http_status"; status: number };
⋮----
export const decodeFailureReason = (
  failure: DecodableFailure
): FailureReason =>
⋮----
export class FailureReasonError extends Error
⋮----
constructor(
    public readonly reason: FailureReason,
    message: string
)
⋮----
export const getNetworkErrorFailureReason = (
  error: NetworkError
): FailureReason =>
</file>

<file path="apps/main-app/ts/utils/featureRollout.ts">
import sha from "sha.js";
⋮----
export const isFeatureEnabled = (
  deviceId: string,
  rolloutPercentage: number,
  featureName: string
): boolean =>
⋮----
const computeDeviceRolloutRatio = (
  deviceId: string,
  featureName: string
): number =>
</file>

<file path="apps/main-app/ts/utils/fetch.ts">
import { calculateExponentialBackoffInterval } from "@pagopa/ts-commons/lib/backoff";
import {
  AbortableFetch,
  retriableFetch,
  setFetchTimeout,
  toFetch
} from "@pagopa/ts-commons/lib/fetch";
import {
  RetriableTask,
  TransientError,
  withRetries
} from "@pagopa/ts-commons/lib/tasks";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { fetchMaxRetries, fetchTimeout } from "../config";
⋮----
type FixedFetch = (
  input: RequestInfo | URL,
  init?: RequestInit | undefined
) => Promise<Response>;
⋮----
export function defaultRetryingFetch(
  timeout: Millisecond = fetchTimeout,
  maxRetries: number = fetchMaxRetries,
  retryOnStatusCode = 429
): typeof fetch
⋮----
export function toFetchTimeout(timeout: Millisecond = fetchTimeout)
⋮----
export function toRetriableFetch(
  maxRetries: number = fetchMaxRetries,
  retryOnStatusCode = 429,
  backoff: (n: number) => Millisecond = calculateExponentialBackoffInterval(),
  shouldAbort?: Promise<boolean>
): (fetch: FixedFetch) => typeof fetch
⋮----
function retryLogicForTransientResponseError(
  p: (r: Response) => boolean,
  retryLogic: (
    t: RetriableTask<Error, Response>,
    shouldAbort?: Promise<boolean>
  ) => TE.TaskEither<"max-retries" | "retry-aborted" | Error, Response>
): typeof retryLogic
⋮----
export const constantPollingFetch = (
  shouldAbort: Promise<boolean>,
  retries: number,
  delay: number,
  timeout: Millisecond = fetchTimeout
): typeof fetch =>
⋮----
const constantBackoff = ()
</file>

<file path="apps/main-app/ts/utils/guards.ts">
export function isDefined<T, O extends NonNullable<T>>(v: T): v is O
</file>

<file path="apps/main-app/ts/utils/hash.ts">
export const fnv1a = (input: string, seed = 0): number =>
</file>

<file path="apps/main-app/ts/utils/highlightSearchText.tsx">
type HighlightChunk = { highlighted: boolean; text: string };
⋮----
export function highlightSearchText({
  text,
  searchText,
  estimatedTextLengthToDisplay
}: {
  estimatedTextLengthToDisplay?: number;
  searchText: string;
  text: string;
}): Array<HighlightChunk>
</file>

<file path="apps/main-app/ts/utils/idps.ts">
import { SpidIdp as GeneratedSpidIdpType } from "@io-app/api-types/generated/definitions/content/SpidIdp";
import { ImageSourcePropType } from "react-native";
⋮----
export const fromGeneratedToLocalSpidIdp = (
  idps: ReadonlyArray<GeneratedSpidIdpType>
): ReadonlyArray<SpidIdp>
⋮----
export type SpidIdp = Omit<GeneratedSpidIdpType, "logo"> & {
  logo: {
    dark?: ImageSourcePropType;
    light: ImageSourcePropType;
  };
};
</file>

<file path="apps/main-app/ts/utils/image.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { ImageURISource, Platform } from "react-native";
⋮----
import { toAndroidCacheTimestamp } from "./dates";
⋮----
export const addCacheTimestampToUri = (source: ImageURISource) =>
</file>

<file path="apps/main-app/ts/utils/input.ts">
import { PatternString } from "@pagopa/ts-commons/lib/strings";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
import { CreditCard } from "../types/pagopa";
import { CreditCardDetector, SupportedBrand } from "./creditCard";
import { isStringNullyOrEmpty } from "./strings";
⋮----
export type CreditCardPan = t.TypeOf<typeof CreditCardPan>;
⋮----
export type CreditCardHolder = t.TypeOf<typeof CreditCardHolder>;
⋮----
export type CreditCardExpirationMonth = t.TypeOf<
  typeof CreditCardExpirationMonth
>;
⋮----
export type CreditCardExpirationYear = t.TypeOf<
  typeof CreditCardExpirationYear
>;
⋮----
export type CreditCardCVC = t.TypeOf<typeof CreditCardCVC>;
⋮----
export const isValidPan = (pan: O.Option<string>)
⋮----
export const isValidSecurityCode = (
  securityCode: O.Option<string>
): boolean | undefined
⋮----
export type CreditCardState = Readonly<{
  expirationDate: O.Option<string>;
  holder: O.Option<string>;
  pan: O.Option<string>;
  securityCode: O.Option<string>;
}>;
⋮----
export function getCreditCardFromState(
  state: CreditCardState
): E.Either<string, CreditCard>
⋮----
export const isValidCardHolder = (cardHolder: O.Option<string>): boolean
</file>

<file path="apps/main-app/ts/utils/internalLink.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import CGN_ROUTES from "../features/bonus/cgn/navigation/routes";
import { FCI_ROUTES } from "../features/fci/navigation/routes";
import { IO_FIMS_LINK_PREFIX } from "../features/fims/singleSignOn/utils";
import { MESSAGES_ROUTES } from "../features/messages/navigation/routes";
import { SERVICES_ROUTES } from "../features/services/common/navigation/routes";
import { SETTINGS_ROUTES } from "../features/settings/common/navigation/routes";
import ROUTES from "../navigation/routes";
import { isTestEnv } from "./environment";
import {
  IO_INTERNAL_LINK_PREFIX,
  IO_INTERNAL_LINK_PROTOCOL,
  IO_UNIVERSAL_LINK_PREFIX
} from "./navigation";
import { extractPathFromURL } from "./url";
⋮----
export const isServiceDetailNavigationLink = (
  internalOrUniversalLink: string
)
⋮----
export function getInternalRoute(href: string): string
⋮----
export function handleInternalLink(
  linkTo: (path: string) => void,
  href: string
)
</file>

<file path="apps/main-app/ts/utils/keyboard.tsx">
import { IODimensions } from "@io-app/design-system";
import { ReactNode } from "react";
import { KeyboardAvoidingView, Platform } from "react-native";
⋮----
export const withKeyboard = (
  content: ReactNode,
  insideSafeAreaView = false
) => (
  <KeyboardAvoidingView
    behavior={Platform.OS === "android" ? undefined : "padding"}
    keyboardVerticalOffset={Platform.select({
      ios: insideSafeAreaView ? 110 : 0,
      android: IODimensions.padding.screen.default
    })}
  >
    {content}
  </KeyboardAvoidingView>
);
</file>

<file path="apps/main-app/ts/utils/keychain.ts">
import { PinString } from "../types/PinString";
⋮----
export async function deletePin(): Promise<boolean>
⋮----
export async function getPin(): Promise<PinString | undefined>
⋮----
export async function setGenericPasswordWithDefaultAccessibleOption(
  username: string,
  password: string,
  options?: Keychain.SetOptions
)
⋮----
export async function setPin(pin: PinString): Promise<boolean>
</file>

<file path="apps/main-app/ts/utils/locale.ts">
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/identity/PreferredLanguage";
import { LanguageEnum } from "@io-app/api-types/generated/definitions/pagopa/ecommerce/RequestAuthorizationRequest";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
import {
  availableTranslations,
  localeFallback,
  Locales,
  localeToLocalizedMessageKey,
  localeToPreferredLanguageMapping,
  LocalizedMessageKeys
} from "../i18n";
⋮----
export const getFullLocale = (): LocalizedMessageKeys
⋮----
export function getLocalePrimary(
  locale: string,
  separator = "-"
): O.Option<string>
⋮----
export const getCurrentLocale = (): Locales
⋮----
export const getLocalePrimaryWithFallback = (): Locales
⋮----
export const fromLocaleToPreferredLanguage = (
  locale: Locales
): PreferredLanguageEnum
⋮----
export const fromPreferredLanguageToLocale = (
  preferredLanguage: PreferredLanguageEnum
): Locales
⋮----
export const fallbackForLocalizedMessageKeys = (
  locale: LocalizedMessageKeys
): Exclude<LocalizedMessageKeys, "de-DE">
⋮----
export const getLanguageEnumFromPreferredLocale = (): LanguageEnum
</file>

<file path="apps/main-app/ts/utils/markdown.ts">
export const markdownToPlainText = (md: string): string
⋮----
.replace(/[*_~>#-]+/gm, "") // remove markdown symbols
.replace(/<\/?[^>]+>/g, "") // remove HTML tags
.replace(/\s{2,}/g, " ") // collapse spaces
</file>

<file path="apps/main-app/ts/utils/navigation.ts">
import {
  NavigationAction,
  NavigationState,
  PartialState
} from "@react-navigation/native";
import { Platform } from "react-native";
⋮----
export const isBackNavigationAction = (
⋮----
type NavigationStateLike =
  | NavigationState
  | PartialState<NavigationState>
  | undefined;
⋮----
export const isRouteInNavigationState = (
  state: NavigationStateLike,
  routeName: string
): boolean =>
</file>

<file path="apps/main-app/ts/utils/nfc.ts">
import {
  isHceSupported as getNativeIsHceSupported,
  getNfcAntennaInfo as getNativeNfcAntennaInfo
} from "@io-app/expo-nfc-antenna-info";
import { Platform } from "react-native";
import { z } from "zod";
⋮----
export type NfcAntennaInfo = z.infer<typeof NfcAntennaInfoSchema>;
⋮----
function getUnsupportedPlatformHceInfo(): Promise<boolean>
⋮----
function getUnsupportedPlatformNfcInfo(): Promise<NfcAntennaInfo>
</file>

<file path="apps/main-app/ts/utils/number.ts">
export class NumberFromStringType extends t.Type<number, string>
⋮----
constructor()
⋮----
export const roundToThirdDecimal = (value: number)
</file>

<file path="apps/main-app/ts/utils/object.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
export const findFirstCaseInsensitive =
<T>(obj:
⋮----
export function getOrFallback<
  O extends object,
  K1 extends keyof O,
  K2 extends keyof O
>(obj: O, key: K1, fallback: K2)
</file>

<file path="apps/main-app/ts/utils/openMaps.ts">
import { IOToast } from "@io-app/design-system";
import I18n from "i18next";
import { Linking, Platform } from "react-native";
⋮----
export function openMaps(
  streetName: string,
  latitude?: number,
  longitude?: number
)
</file>

<file path="apps/main-app/ts/utils/options.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
export function areSetEqual<T>(a: O.Option<Set<T>>, b: O.Option<Set<T>>)
⋮----
export function areStringsEqual(
  aa: O.Option<string>,
  bb: O.Option<string>,
  caseInsensitive = false
): boolean
⋮----
export const maybeInnerProperty = <T, K extends keyof T, R>(
  item: T | undefined,
  key: K,
  extractor: (value: T[K]) => R
): O.Option<R>
</file>

<file path="apps/main-app/ts/utils/payment.ts">
import { PaymentFaultV2Enum } from "@io-app/api-types/generated/definitions/communication/PaymentFaultV2";
import { AmountInEuroCents, RptId } from "@pagopa/io-pagopa-commons/lib/pagopa";
import { ITuple2, Tuple2 } from "@pagopa/ts-commons/lib/tuples";
import { pipe } from "fp-ts/lib/function";
⋮----
import I18n from "i18next";
⋮----
import { maybeNotNullyString } from "./strings";
⋮----
export function decodePosteDataMatrix(
  data: string
): O.Option<ITuple2<RptId, AmountInEuroCents>>
⋮----
const hasDescriptionPrefix = (description: string)
⋮----
export const cleanTransactionDescription = (description: string): string =>
⋮----
export type DetailV2Keys = keyof typeof PaymentFaultV2Enum;
⋮----
export type ErrorTypes =
  | "DUPLICATED"
  | "EXPIRED"
  | "NOT_FOUND"
  | "ONGOING"
  | "REVOKED"
  | "UNCOVERED";
⋮----
export const getV2ErrorMainType = (
  error?: DetailV2Keys
): ErrorTypes | undefined =>
⋮----
export const getTransactionIUV = (
  transactionDescription: string
): O.Option<string> =>
⋮----
export const isPaidPaymentFromDetailV2Enum = (details: PaymentFaultV2Enum)
export const isRevokedPaymentFromDetailV2Enum = (details: PaymentFaultV2Enum)
export const isExpiredPaymentFromDetailV2Enum = (details: PaymentFaultV2Enum)
export const isOngoingPaymentFromDetailV2Enum = (details: PaymentFaultV2Enum)
</file>

<file path="apps/main-app/ts/utils/paymentMethodCapabilities.ts">
import { EnableableFunctionsEnum } from "@io-app/api-types/generated/definitions/pagopa/EnableableFunctions";
import { TypeEnum } from "@io-app/api-types/generated/definitions/pagopa/walletv2/CardInfo";
import { pipe } from "fp-ts/lib/function";
⋮----
import { CreditCardPaymentMethod, PaymentMethod } from "../types/pagopa";
import { PaymentSupportStatus } from "../types/paymentMethodCapabilities";
import { hasFunctionEnabled } from "./walletv2";
⋮----
export const hasPaymentFeature = (paymentMethod: PaymentMethod): boolean
⋮----
export const isEnabledToPay = (paymentMethod: PaymentMethod): boolean
⋮----
export const isDisabledToPay = (paymentMethod: PaymentMethod): boolean
⋮----
export const isCobadge = (paymentMethod: CreditCardPaymentMethod)
⋮----
const paymentNotSupportedCustomRepresentation = (
  paymentMethod: PaymentMethod
): PaymentSupportStatus =>
⋮----
export const isPaymentSupported = (
  paymentMethod: PaymentMethod
): PaymentSupportStatus =>
</file>

<file path="apps/main-app/ts/utils/paypal.ts">
import { PayPalInfo } from "@io-app/api-types/generated/definitions/pagopa/PayPalInfo";
import I18n from "i18next";
⋮----
export const getPaypalAccountEmail = (paypal: PayPalInfo): string
</file>

<file path="apps/main-app/ts/utils/permission.ts">
import { Platform } from "react-native";
⋮----
export const requestIOPermission = async (
  permission: RNPermissions.Permission,
  rationale?: RNPermissions.Rationale
): Promise<boolean> =>
⋮----
export const checkIOPermission = async (
  permission: RNPermissions.Permission
): Promise<boolean> =>
⋮----
export const requestWriteCalendarPermission = async (
  rationale?: RNPermissions.Rationale
) =>
</file>

<file path="apps/main-app/ts/utils/platform.ts">
import { Platform } from "react-native";
</file>

<file path="apps/main-app/ts/utils/pmLookUpId.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import { v4 as uuid } from "uuid";
⋮----
export type LookUpId = string | undefined;
⋮----
export const getLookUpId = (): LookUpId
⋮----
export const getLookUpIdPO = (): Record<string, string>
export const newLookUpId = (): LookUpId =>
export const resetLookUpId = (): void =>
</file>

<file path="apps/main-app/ts/utils/pot.ts">
interface Some<T> {
  readonly kind: "PotSome";
  readonly value: T;
}
⋮----
interface SomeError<T, E> {
  readonly error: E;
  readonly kind: "PotSomeError";
  readonly value: T;
}
⋮----
export const isStrictNone = <T, E>(p: pot.Pot<T, E>): boolean
⋮----
export const isStrictSome = <T, E>(p: pot.Pot<T, E>): p is Some<T>
⋮----
export const foldK =
  <A, E, O>(
    foldNone: () => O,
    foldNoneLoading: () => O,
    foldNoneUpdating: (newValue: A) => O,
    foldNoneError: (error: E) => O,
    foldSome: (value: A) => O,
    foldSomeLoading: (value: A) => O,
    foldSomeUpdating: (value: A, newValue: A) => O,
    foldSomeError: (value: A, error: E) => O
)
⋮----
export const isStrictSomeError = <A, E>(
  p: pot.Pot<A, E>
): p is SomeError<A, E>
export const isSomeLoadingOrSomeUpdating = <A, E>(p: pot.Pot<A, E>): boolean
export const isSomeOrSomeError = <A, E>(
  p: pot.Pot<A, E>
): p is Some<A> | SomeError<A, E>
export const isLoadingOrUpdating = <A, E>(p: pot.Pot<A, E>): boolean
⋮----
type PotFoldWithDefaultHandlers<A, E, O> = {
  default: (value?: A | E, secondValue?: A | E) => O;
} & {
  none?: () => O;
  noneError?: (error: E) => O;
  noneLoading?: () => O;
  noneUpdating?: (newValue: A) => O;
  some?: (value: A) => O;
  someError?: (value: A, error: E) => O;
  someLoading?: (value: A) => O;
  someUpdating?: (value: A, newValue: A) => O;
};
⋮----
export const potFoldWithDefault = <A, E, O>(
  value: pot.Pot<A, E>,
  handlers: PotFoldWithDefaultHandlers<A, E, O>
)
⋮----
export const toUndefinedOptional = <T, E>(input: pot.Pot<T, E> | undefined)
</file>

<file path="apps/main-app/ts/utils/profile.ts">
import { Municipality } from "@io-app/api-types/generated/definitions/content/Municipality";
import { FiscalCode } from "@io-app/api-types/generated/definitions/identity/FiscalCode";
⋮----
import { pad } from "./dates";
⋮----
type FiscalCodeDerivedData = Readonly<{
  birthDate?: Date;
  denominazione: string;
  gender?: GenderType;
  siglaProvincia: string;
}>;
⋮----
type GenderType = "F" | "M" | undefined;
⋮----
export interface EnabledChannels {
  can_access_message_read_status: boolean;
  email: boolean;
  inbox: boolean;
  push: boolean;
}
⋮----
export function extractFiscalCodeData(
  fiscalCode: FiscalCode,
  municipality: pot.Pot<Municipality, Error>
): FiscalCodeDerivedData
⋮----
// if we can't know more about date of birth
// just return info about municipality
</file>

<file path="apps/main-app/ts/utils/reporters.ts">
import { pipe } from "fp-ts/lib/function";
import { Context, ValidationError } from "io-ts";
import { Reporter } from "io-ts/lib/Reporter";
⋮----
export function errorsToReadableMessages(
  es: ReadonlyArray<ValidationError>
): ReadonlyArray<string>
⋮----
export function readablePrivacyReport(
  errors: ReadonlyArray<ValidationError>
): string
⋮----
function getContextPath(context: Context): string
⋮----
function getMessage(_: unknown, context: Context): string
⋮----
function success(): ReadonlyArray<string>
</file>

<file path="apps/main-app/ts/utils/SessionManager.ts">
import { IResponseType } from "@pagopa/ts-commons/lib/requests";
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import { Mutex } from "async-mutex";
⋮----
import { FunctionN, Lazy, pipe } from "fp-ts/lib/function";
⋮----
import { delayAsync } from "./timer";
⋮----
export class SessionManager<T>
⋮----
constructor(
⋮----
public withRefresh<R>(
    f: FunctionN<[T], Promise<t.Validation<IResponseType<401, any> | R>>>
): Lazy<ReturnType<typeof f>>
</file>

<file path="apps/main-app/ts/utils/share.ts">
export const share = (url: string, message?: string, _failOnCancel = false)
</file>

<file path="apps/main-app/ts/utils/stringBuilder.ts">
import { CardInfo } from "@io-app/api-types/generated/definitions/pagopa/walletv2/CardInfo";
import I18n from "i18next";
⋮----
export const centsToAmount = (cents: number): number
⋮----
export const formatNumberAmount = (
  amount: number,
  displayCurrency = false,
  currencyPosition: "left" | "right" = "left"
): string =>
⋮----
export const formatNumberWithNoDigits = (
  amount: number,
  displayCurrency = false
): string =>
⋮----
export const formatNumberCentsToAmount = (
  cents: number,
  displayCurrency = false,
  currencyPosition: "left" | "right" = "left"
): string
⋮----
export const buildExpirationDate = (creditCard: CardInfo): string
⋮----
export const formatIntegerNumber = (amount: number): string
</file>

<file path="apps/main-app/ts/utils/strings.ts">
import { pipe } from "fp-ts/lib/function";
⋮----
import _ from "lodash";
⋮----
export function capitalize(text: string, separator = " ")
⋮----
/**
 * Check if the source includes searchText. To make a case-insensitive check
 * both the source and the searchText are converted to lower-case.
 *
 * @param source Source string where you want to search
 * @param searchText String you want search for
 */
export function isTextIncludedCaseInsensitive(
  source: string,
  searchText: string
)
⋮----
/**
 * Determine if the text is undefined or empty (or composed only by blanks)
 *
 * @param text
 */
export const isStringNullyOrEmpty = (
  text: null | string | undefined
): boolean
⋮----
/**
 * Return some(text) if the text is not nully and not empty (or composed only by
 * blanks)
 *
 * @param text
 */
export const maybeNotNullyString = (
  text: null | string | undefined
): O.Option<string>
⋮----
/**
 * Return a string by adding 'toAdd' every 'every' chars
 *
 * @param text
 * @param toAdd
 * @param every
 */
export const addEvery = (text: string, toAdd: string, every: number): string
⋮----
export const splitAndTakeFirst = (text: string, splitter: string)
⋮----
export const withTrailingPoliceCarLightEmojii = (
  text: string,
  visible = true
) =>
⋮----
export const formatBytesWithUnit = (bytes: number) =>
⋮----
export const capitalizeTextName = (text: string, separator = " "): string =>
⋮----
// Capitalize the words between the separators
⋮----
.trim() // Remove leading/trailing spaces for processing
⋮----
// Handle words with apostrophes
</file>

<file path="apps/main-app/ts/utils/supportAssistance.ts">
import { ToolEnum } from "@io-app/api-types/generated/definitions/content/AssistanceToolConfig";
import { ZendeskCategory } from "@io-app/api-types/generated/definitions/content/ZendeskCategory";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import { getValueOrElse } from "../common/model/RemoteValue";
import { zendeskEnabled } from "../config";
import { ZendeskConfig } from "../features/zendesk/store/reducers";
⋮----
export type AnonymousIdentity = ZendDesk.AnonymousIdentity;
export type JwtIdentity = ZendDesk.JwtIdentity;
export type ZendeskAppConfig = {
  appId: string;
  clientId: string;
  key: string;
  logId: string;
  token?: string;
  url: string;
};
⋮----
export const anonymousAssistanceAddressWithSubject = (
  category: string,
  subcategory?: string
): string
⋮----
export const getZendeskConfig = (zendeskToken: string | undefined)
⋮----
export const getZendeskIdentity = (zendeskToken: string | undefined)
⋮----
export const assistanceToolRemoteConfig = (aTC: ToolEnum | undefined)
⋮----
export const isPanicModeActive = (zendeskConfig: ZendeskConfig)
⋮----
export const resetAssistanceData = () =>
⋮----
export const hasSubCategories = (zendeskCategory: ZendeskCategory): boolean
⋮----
export const canShowHelp = (assistanceTool: ToolEnum): boolean =>
⋮----
export const handleSendAssistanceLog = (
  assistanceTool: ToolEnum,
  log: string
) =>
</file>

<file path="apps/main-app/ts/utils/testAccessibility.tsx">
import { AccessibilityInfo } from "react-native";
⋮----
export function mockAccessibilityInfo(boldTextEnabled = false)
</file>

<file path="apps/main-app/ts/utils/tests.ts">
import { Action } from "../store/actions/types";
⋮----
export const reproduceSequence = <S>(
  initialState: S,
  reducer: (s: S, a: Action) => S,
  sequenceOfActions: ReadonlyArray<Action>
): S
</file>

<file path="apps/main-app/ts/utils/testWrapper.tsx">
import { IOThemeContextProvider } from "@io-app/design-system";
import { createStackNavigator } from "@react-navigation/stack";
import {
  render,
  renderAsync,
  RenderAsyncOptions,
  RenderOptions
} from "@testing-library/react-native";
import { ComponentType } from "react";
import { Linking } from "react-native";
import { Provider } from "react-redux";
import { Store } from "redux";
⋮----
import { TestInnerNavigationContainer } from "../navigation/AppStackNavigator";
⋮----
export const renderScreenWithNavigationStoreContext = <S,>(
  screen: ComponentType<any>,
  route: string,
  params: Record<string, any>,
  store: Store<S>,
  renderOptions: RenderOptions = {},
  mockLinkingSubscription = jest.fn()
)
⋮----
export const renderScreenWithNavigationStoreContextAsync = <S,>(
  screen: ComponentType<any>,
  route: string,
  params: Record<string, any>,
  store: Store<S>,
  renderOptions: RenderAsyncOptions = {},
  mockLinkingSubscription = jest.fn()
)
⋮----
const createScreenWithNavigationStoreContext = <S,>(
  screen: ComponentType<any>,
  route: string,
  params: Record<string, any>,
  store: Store<S>,
  mockLinkingSubscription: jest.Mock
) =>
</file>

<file path="apps/main-app/ts/utils/timer.ts">
import { Millisecond } from "@pagopa/ts-commons/lib/units";
import BackgroundTimer from "react-native-background-timer";
⋮----
export function startTimer(t: number): Promise<void>
⋮----
export const delayAsync = (milliseconds: Millisecond)
</file>

<file path="apps/main-app/ts/utils/url.ts">
import { constNull, pipe } from "fp-ts/lib/function";
⋮----
import { err, ok } from "neverthrow";
import { ImageURISource, Linking } from "react-native";
import URLParse from "url-parse";
⋮----
import { storeUrl, webStoreURL } from "./appVersion";
import { clipboardSetStringWithFeedback } from "./clipboard";
import { unknownToString } from "./errors";
import { openMaps } from "./openMaps";
import { splitAndTakeFirst } from "./strings";
⋮----
export function getResourceNameFromUrl(
  resourceUrl: string,
  includeExt = false
): string
⋮----
export const getUrlBasepath = (url: string): string =>
⋮----
export type ItemAction = "COPY" | "LINK" | "MAP";
⋮----
export function handleItemOnPress(
  value: string,
  valueType?: ItemAction,
  onSuccess: () => void = constNull,
  onError: () => void = constNull
): () => void
⋮----
export const isHttp = (url: string): boolean =>
⋮----
export const isIOIT = (url: string): boolean =>
⋮----
export const taskLinking = (url: string)
⋮----
const taskCanOpenUrl = (url: string)
⋮----
export const openWebUrl = (url: string, onError: () => void = constNull) =>
⋮----
export const openAppStoreUrl = async (onError: () => void = constNull) =>
⋮----
export function escapeStringRegexp(string: string)
⋮----
export function extractPathFromURL(
  prefixes: ReadonlyArray<string>,
  url: string
): string | undefined
⋮----
.replace(/\/+/g, "/") // Replace multiple slash (//) with single ones
.replace(/^\//, ""); // Remove extra leading slash
⋮----
/**
 * Type guard to check if a value is an ImageURISource
 *
 * @param value The value to check, can be anything
 * @returns Boolean
 */
export const isImageUri = (value: unknown): value is ImageURISource
⋮----
export const safeUrlParse = (url: string) =>
</file>

<file path="apps/main-app/ts/utils/useAvoidHardwareBackButton.ts">
import { useHardwareBackButton } from "../hooks/useHardwareBackButton";
⋮----
export const useAvoidHardwareBackButton = ()
</file>

<file path="apps/main-app/ts/utils/wallet.ts">
import I18n from "i18next";
⋮----
import { Alert } from "react-native";
⋮----
export const fixWalletPspTagsValues = (w: unknown) =>
⋮----
export const handleSetFavourite = (
  willBeFavorite: boolean,
  callback: () => void
)
</file>

<file path="apps/main-app/ts/utils/walletv2.ts">
import { EnableableFunctions } from "@io-app/api-types/generated/definitions/pagopa/EnableableFunctions";
import { PayPalInfo } from "@io-app/api-types/generated/definitions/pagopa/PayPalInfo";
import { TypeEnum as WalletTypeEnumV1 } from "@io-app/api-types/generated/definitions/pagopa/Wallet";
import { WalletTypeEnum } from "@io-app/api-types/generated/definitions/pagopa/WalletV2";
import {
  CardInfo,
  TypeEnum
} from "@io-app/api-types/generated/definitions/pagopa/walletv2/CardInfo";
import { pipe } from "fp-ts/lib/function";
⋮----
import {
  PatchedPaymentMethodInfo,
  PatchedWalletV2,
  RawBPayPaymentMethod,
  RawPaymentMethod,
  Wallet
} from "../types/pagopa";
import {
  CreditCardExpirationMonth,
  CreditCardExpirationYear,
  CreditCardPan
} from "./input";
⋮----
export const hasFunctionEnabled = (
  paymentMethod: RawPaymentMethod | undefined,
  walletFunction: EnableableFunctions
): boolean
⋮----
const isWalletV2BPay = (
  wallet: PatchedWalletV2,
  paymentMethodInfo: PatchedPaymentMethodInfo
): paymentMethodInfo is CardInfo
⋮----
const isWalletV2PayPal = (
  wallet: PatchedWalletV2,
  paymentMethodInfo: PatchedPaymentMethodInfo
): paymentMethodInfo is PayPalInfo
⋮----
const isWalletV2Bancomat = (
  wallet: PatchedWalletV2,
  paymentMethodInfo: PatchedPaymentMethodInfo
): paymentMethodInfo is CardInfo
⋮----
const isWalletV2CreditCard = (
  wallet: PatchedWalletV2,
  paymentMethodInfo: PatchedPaymentMethodInfo
): paymentMethodInfo is CardInfo
⋮----
export const fromPatchedWalletV2ToRawPaymentMethod = (
  wallet: PatchedWalletV2
): RawPaymentMethod | undefined =>
⋮----
export const fromPatchedWalletV2ToRawBPay = (
  wallet: PatchedWalletV2
): O.Option<RawBPayPaymentMethod>
⋮----
export const convertWalletV2toWalletV1 = (
  walletV2: PatchedWalletV2
): Wallet =>
</file>

<file path="apps/main-app/ts/utils/webview.ts">
export const closeInjectedScript = (injection: string) =>
</file>

<file path="apps/main-app/ts/App.tsx">
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";
import {
  IODSExperimentalContextProvider,
  IONewTypefaceContextProvider,
  IOThemeContextProvider,
  ToastProvider
} from "@io-app/design-system";
import { BottomSheetProvider } from "@swmansion/react-native-bottom-sheet";
import { JSX } from "react";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { KeyboardProvider } from "react-native-keyboard-controller";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";
⋮----
import { persistor, store } from "./boot/configureStoreAndPersistor";
import { IOAlertVisibleContextProvider } from "./components/StatusMessages/IOAlertVisibleContext";
import { StatusMessages } from "./components/StatusMessages/StatusMessages";
import { LightModalProvider } from "./components/ui/LightModal";
import { AppFeedbackProvider } from "./features/appReviews/components/AppFeedbackProvider";
import { TourProvider } from "./features/tour/components/TourProvider";
import RootContainer from "./RootContainer";
⋮----
export type AppDispatch = typeof store.dispatch;
</file>

<file path="apps/main-app/ts/config.ts">
import { CommaSeparatedListOf } from "@pagopa/ts-commons/lib/comma-separated-list";
import { NonEmptyString } from "@pagopa/ts-commons/lib/strings";
import { Millisecond, Second } from "@pagopa/ts-commons/lib/units";
⋮----
import { pipe } from "fp-ts/lib/function";
⋮----
import Config from "react-native-config";
⋮----
// This is the maximum number supported by API via pagination regardless of the content.
⋮----
/** Payments */
⋮----
// If not defined or invalid we don't want to filter PSPs
⋮----
/** IDPay */
⋮----
// Default pin for dev mode
</file>

<file path="apps/main-app/ts/i18n.ts">
import { BackendStatusMessage } from "@io-app/api-types/generated/definitions/content/BackendStatusMessage";
import { PreferredLanguageEnum } from "@io-app/api-types/generated/definitions/session_manager/PreferredLanguage";
⋮----
import i18next, { PostProcessorModule } from "i18next";
⋮----
import { initReactI18next } from "react-i18next";
⋮----
import de from "../locales/de/index.json";
import en from "../locales/en/index.json";
import it from "../locales/it/index.json";
⋮----
export type Locales = keyof typeof resources;
⋮----
export type LocalizedMessageKeys = keyof BackendStatusMessage;
⋮----
export type TranslationKeys = ExtractKeys<typeof it>;
⋮----
type ExtractKeys<Obj, Prefix extends string = ""> = {
  [K in keyof Obj]: K extends number | string
    ? Obj[K] extends Record<string, any>
      ? ExtractKeys<Obj[K], Prefix extends "" ? `${K}` : `${Prefix}.${K}`>
      : Prefix extends ""
        ? `${K}`
        : `${Prefix}.${K}`
    : never;
}[keyof Obj];
type FallBackLocale = {
  locale: "it";
  localeEnum: PreferredLanguageEnum;
  localizedMessageKey: LocalizedMessageKeys;
};
⋮----
export const setLocale = (locale: Locales) =>
</file>

<file path="apps/main-app/ts/images.d.ts">
import { ImageRequireSource } from "react-native";
</file>

<file path="apps/main-app/ts/mixpanel.ts">
import { Mixpanel, MixpanelProperties } from "mixpanel-react-native";
⋮----
import { mixpanelToken, mixpanelUrl } from "./config";
import { updateMixpanelProfileProperties } from "./mixpanelConfig/profileProperties";
import { updateMixpanelSuperProperties } from "./mixpanelConfig/superProperties";
import { GlobalState } from "./store/reducers/types";
import { getDeviceId } from "./utils/device";
import { isTestEnv } from "./utils/environment";
⋮----
type EnqueuedMixpanelEvent = {
  eventName: string;
  id: string;
  properties: Record<string, unknown>;
};
⋮----
export const initializeMixPanel = async (state: GlobalState) =>
⋮----
export const identifyMixpanel = async () =>
⋮----
export const resetMixpanel = () =>
⋮----
export const terminateMixpanel = () =>
⋮----
export const isMixpanelInstanceInitialized = ()
⋮----
export const getPeople = ()
⋮----
export const registerSuperProperties = (properties: MixpanelProperties)
⋮----
export const mixpanelTrack = (
  event: string,
  properties?: Record<string, unknown>
)
⋮----
export const enqueueMixpanelEvent = (
  eventName: string,
  id: string,
  properties: Record<string, unknown>
) =>
⋮----
const processEnqueuedMixpanelEvents = () =>
</file>

<file path="apps/main-app/ts/RootContainer.tsx">
import { pipe } from "fp-ts/lib/function";
⋮----
import { useCallback, useEffect, useRef } from "react";
import { AccessibilityInfo, AppState, StatusBar } from "react-native";
import SplashScreen from "react-native-splash-screen";
⋮----
import DebugInfoOverlay from "./components/debug/DebugInfoOverlay";
import PagoPATestIndicatorOverlay from "./components/PagoPATestIndicatorOverlay";
import { LightModalRoot } from "./components/ui/LightModal";
import {
  configurePushNotificationListeners,
  setupAndroidNotificationChannel
} from "./features/pushNotifications/utils/configurePushNotification";
import { useAppThemeConfiguration } from "./hooks/useAppThemeConfiguration";
import { setLocale } from "./i18n";
import { IONavigationContainer } from "./navigation/AppStackNavigator";
import RootModal from "./screens/modal/RootModal";
import { applicationChangeState } from "./store/actions/application";
import { setScreenReaderEnabled } from "./store/actions/preferences";
import { Store } from "./store/actions/types";
import { useIODispatch, useIOSelector } from "./store/hooks";
import { isDebugModeEnabledSelector } from "./store/reducers/debug";
import {
  isPagoPATestEnabledSelector,
  preferredLanguageSelector
} from "./store/reducers/persistedPreferences";
⋮----
useAppThemeConfiguration();
</file>

<file path="apps/main-app/ts/svg.d.ts">
import React from "react";
import { SvgProps } from "react-native-svg";
</file>

<file path="apps/main-app/ts/urls.ts">
import { contentRepoUrl } from "./config";
</file>

<file path="apps/main-app/.oxlintrc.jsonc">
{
  "$schema": "../../node_modules/oxlint/configuration_schema.json",
  "plugins": [],
  "categories": {
    "correctness": "off"
  },
  "env": {
    "builtin": true
  },
  // Patterns are "**/"-anchored so they also match when this config is reached
  // through `extends` from another project (design-system, dev-api-server).
  "ignorePatterns": [
    "**/*.js",
    "**/*.cjs",
    "**/*.mjs",
    "**/locales/locales.ts",
    "**/definitions/**",
    "**/*.typegen.ts"
  ],
  "overrides": [
    {
      "files": ["**/*.{ts,tsx}"],
      "rules": {
        "constructor-super": "error",
        "for-direction": "error",
        "no-async-promise-executor": "error",
        "no-case-declarations": "off",
        "no-class-assign": "error",
        "no-compare-neg-zero": "error",
        "no-cond-assign": "warn",
        "no-const-assign": "error",
        "no-constant-binary-expression": "error",
        "no-constant-condition": "off",
        "no-control-regex": "warn",
        "no-debugger": "warn",
        "no-delete-var": "warn",
        "no-dupe-class-members": "error",
        "no-dupe-else-if": "error",
        "no-dupe-keys": "error",
        "no-duplicate-case": "error",
        "no-empty": "off",
        "no-empty-character-class": "warn",
        "no-empty-pattern": "error",
        "no-empty-static-block": "error",
        "no-ex-assign": "warn",
        "no-extra-boolean-cast": "warn",
        "no-fallthrough": "warn",
        "no-func-assign": "warn",
        "no-global-assign": "error",
        "no-import-assign": "error",
        "no-invalid-regexp": "warn",
        "no-irregular-whitespace": "error",
        "no-loss-of-precision": "error",
        "no-misleading-character-class": "error",
        "no-new-native-nonconstructor": "error",
        "no-nonoctal-decimal-escape": "error",
        "no-obj-calls": "warn",
        "no-prototype-builtins": "error",
        "no-redeclare": "off",
        "no-regex-spaces": "warn",
        "no-self-assign": "error",
        "no-setter-return": "error",
        "no-shadow-restricted-names": "warn",
        "no-sparse-arrays": "warn",
        "no-this-before-super": "error",
        "no-unassigned-vars": "error",
        "no-unexpected-multiline": "off",
        "no-unsafe-finally": "error",
        "no-unsafe-negation": "error",
        "no-unsafe-optional-chaining": "error",
        "no-unused-labels": "error",
        "no-unused-private-class-members": "error",
        // Allow `_`-prefixed throwaways and rest-sibling destructuring omits,
        // matching tsc's noUnusedLocals.
        "no-unused-vars": [
          "error",
          {
            "argsIgnorePattern": "^_",
            "varsIgnorePattern": "^_",
            "ignoreRestSiblings": true
          }
        ],
        // Disabled for test files below, where empty stubs are common.
        "no-empty-function": "error",
        "no-useless-backreference": "error",
        "no-useless-catch": "error",
        "no-useless-escape": "warn",
        "no-with": "warn",
        "preserve-caught-error": "error",
        "require-yield": "error",
        "use-isnan": "warn",
        "valid-typeof": "warn",
        "no-array-constructor": "warn",
        "no-unused-expressions": ["error"],
        "typescript/ban-ts-comment": "error",
        "typescript/no-duplicate-enum-values": "error",
        "typescript/no-empty-object-type": "error",
        "typescript/no-explicit-any": "off",
        "typescript/no-extra-non-null-assertion": "error",
        "typescript/no-misused-new": "error",
... (312 lines truncated)
</file>

<file path="apps/main-app/.ruby-version">
3.3.8
</file>

<file path="apps/main-app/babel.config.js">

</file>

<file path="apps/main-app/CHANGELOG.md">
## 3.43.0-rc.7 (2026-11-09)

### Bug Fixes

- **IT-Wallet:** [[SIW-5353](https://pagopa.atlassian.net/browse/SIW-5353)] Announce wallet headers before cards ([#8843](https://github.com/pagopa/io-app/pull/8843))

### Chores

- **release:** 3.42.2-rc.0 ([#8858](https://github.com/pagopa/io-app/pull/8858))

### ❤️ Thank You

- Alessandro Dell'Oste @adelloste
- MonicaRungi-EY

## 3.42.2-rc.0 (2026-11-09)

### Chores

- [[IOPLT-000](https://pagopa.atlassian.net/browse/IOPLT-000)] Avoid startup crash when device ID lookup fails ([#8854](https://github.com/pagopa/io-app/pull/8854))

### ❤️ Thank You

- Alessandro Dell'Oste @adelloste

## 3.43.0-rc.6 (2026-11-06)

### Bug Fixes

- **IT-Wallet:** [[SIW-5304](https://pagopa.atlassian.net/browse/SIW-5304)] Remove "expiring" label from non IT-Wallet documents ([#8783](https://github.com/pagopa/io-app/pull/8783))
- [[IEG-3321](https://pagopa.atlassian.net/browse/IEG-3321)] Omit CGN banner calls based on FF ([#8848](https://github.com/pagopa/io-app/pull/8848))
- **IT-Wallet:** [[SIW-5186](https://pagopa.atlassian.net/browse/SIW-5186)] Back from DocIO fallback landing to mode selection ([#8709](https://github.com/pagopa/io-app/pull/8709))

### Chores

- **release:** 3.42.1-rc.0 ([#8850](https://github.com/pagopa/io-app/pull/8850))
- [[IOPLT-2266](https://pagopa.atlassian.net/browse/IOPLT-2266)] Bump `oxfmt` to `0.76` ([#8845](https://github.com/pagopa/io-app/pull/8845))
- [[IOPLT-2109](https://pagopa.atlassian.net/browse/IOPLT-2109)] Update dev server `supertest` dependency ([#8641](https://github.com/pagopa/io-app/pull/8641))

### ❤️ Thank You

- Damiano Plebani
- Emanuele Dall'Ara @LeleDallas
- Federico Mastrini @mastro993
- MonicaRungi-EY
- Riccardo Sacco @riccardosacco99

## 3.42.1-rc.0 (2026-11-06)

### Bug Fixes

- [[IEG-3321](https://pagopa.atlassian.net/browse/IEG-3321)] Omit CGN banner calls based on FF ([#8848](https://github.com/pagopa/io-app/pull/8848))

### ❤️ Thank You

- Emanuele Dall'Ara @LeleDallas

## 3.43.0-rc.5 (2026-11-05)

### Bug Fixes

- **IT-Wallet:** [[SIW-5130](https://pagopa.atlassian.net/browse/SIW-5130)] Fix intro credentials empty values ([#8688](https://github.com/pagopa/io-app/pull/8688))
- [[IOPLT-2060](https://pagopa.atlassian.net/browse/IOPLT-2060)] Restore `topic` value based on guards in store review context ([#8560](https://github.com/pagopa/io-app/pull/8560))
- **IT-Wallet:** [[SIW-5431](https://pagopa.atlassian.net/browse/SIW-5431),[SIW-5225](https://pagopa.atlassian.net/browse/SIW-5225)] fix mdoc remote presentation, proximity ios termination and bump deps ([#8834](https://github.com/pagopa/io-app/pull/8834))

### ❤️ Thank You

- Alessandro Mazzon
- Cristiano Tofani
- DavideOnano @DavideOnano
- Emanuele Dall'Ara @LeleDallas

## 3.43.0-rc.4 (2026-11-04)

### Bug Fixes

- [[IOPLT-2222](https://pagopa.atlassian.net/browse/IOPLT-2222)] Avoid `IT-Wallet` text break across lines ([#8820](https://github.com/pagopa/io-app/pull/8820))

### Chores

- [[IOPLT-2256](https://pagopa.atlassian.net/browse/IOPLT-2256)] Bump `@faker-js/faker` to `10.x` ([#8832](https://github.com/pagopa/io-app/pull/8832))

### ❤️ Thank You

- Damiano Plebani

## 3.43.0-rc.3 (2026-11-03)

### Bug Fixes

- **IT-Wallet:** [[SIW-5430](https://pagopa.atlassian.net/browse/SIW-5430)] Show detail title in nested claims sheet ([#8831](https://github.com/pagopa/io-app/pull/8831))
- [[IOPLT-2250](https://pagopa.atlassian.net/browse/IOPLT-2250)] Add dark mode support to ITW issuance intro card ([#8830](https://github.com/pagopa/io-app/pull/8830))

### ❤️ Thank You

- Damiano Plebani
- Federico Mastrini @mastro993

## 3.43.0-rc.2 (2026-11-02)

... (5240 lines truncated)
</file>

<file path="apps/main-app/eslint.config.mjs">
// Consumers must use the public design-system API instead of its monorepo path or internals
⋮----
"**/libs/design-system/**", // Avoid monorepo path
"@io-app/design-system/**" // Avoid internals
⋮----
// ESLint sees disables for rules moved to oxlint as unused, and `--fix`
// would delete them although oxlint still needs them. oxlint reports its own.
⋮----
// Must stay last: turns off every rule that oxlint already runs, so the two
// linters never report the same problem.
</file>

<file path="apps/main-app/Gemfile">
# frozen_string_literal: true
source "https://rubygems.org"

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '>=2.6.10'

# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.1', '!= 1.15.0'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
gem "fastlane", "~> 2.233.1"

# fixes an issue on linux env for android release
# see https://github.com/ffi/ffi/issues/1103#issuecomment-2186974923
gem "ffi", "< 1.17.0"

# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
</file>

<file path="apps/main-app/index.js">
const errorHandler = (e, isFatal) =>
</file>

<file path="apps/main-app/jest.config.js">

</file>

<file path="apps/main-app/jestAfterEnvSetup.js">

</file>

<file path="apps/main-app/jestGlobalSetup.js">

</file>

<file path="apps/main-app/jestSetup.js">
DocumentDir: ()
polyfill: ()
⋮----
global.__reanimatedWorkletInit = ()
⋮----
useBottomSheetModal: () => (
⋮----
IOMarkdown: (
IOMarkdownLite: (
⋮----
getEnforcing: name => {
      const modulesToMock = [
        "IoReactNativeHttpClient",
        "RNDocumentPicker",
        "RNCWebViewModule",
        "AppState"
      ];
if (modulesToMock.includes(name))
⋮----
addEventListener: () => (
⋮----
default: ()
⋮----
AccessibilityInfo.isScreenReaderEnabled = ()
⋮----
v4: () =>
</file>

<file path="apps/main-app/metro.config.js">
resolveRequest: (context, moduleName, platform) =>
</file>

<file path="apps/main-app/react-native.config.js">

</file>

<file path="apps/main-app/README.md">
<p align="center">
  <img src="img/io-app-icon.png" width="100" style="display: block" /><br />
  <h3 align="center">IO — The Italian public services app</h3>
</p>

<p align="center">
  <a href="https://github.com/pagopa/io-app/actions/workflows/publish-app-build-nightly.yml">
    <img src="https://github.com/pagopa/io-app/actions/workflows/publish-app-build-nightly.yml/badge.svg?branch=master" alt="Nightly build" />
  </a>
  <a href="https://codecov.io/gh/pagopa/io-app">
    <img src="https://codecov.io/gh/pagopa/io-app/branch/master/graph/badge.svg" alt="Codecov" />
  </a>
  <img src="https://img.shields.io/github/contributors-anon/pagopa/io-app" alt="Contributors" />
</p>

<p align="center">
  <a href="https://apps.apple.com/it/app/io/id1501681835">
    <img height="50" src="img/badges/app-store-badge.png" alt="Download on the App Store" />
  </a>
  <a href="https://play.google.com/store/apps/details?id=it.pagopa.io.app">
    <img height="50" src="img/badges/google-play-badge.png" alt="Get it on Google Play" />
  </a>
</p>

---

# IO — Main app

**IO** is the official Italian app for public services. It lets citizens access messages from public administrations, pay taxes and fines, manage their digital identity, and interact with dozens of government services from a single, accessible interface.

This directory is the **React Native application** at the core of the IO App ecosystem. It lives inside the [`pagopa/io-app`](https://github.com/pagopa/io-app) monorepo alongside the [design system library](../../libs/design-system/README.md).

---

## Table of contents

- [FAQ](#faq)
- [Getting started](#getting-started)
- [Environment variables](#environment-variables)
- [Run the app](#run-the-app)
- [Troubleshooting](#troubleshooting)
- [Architecture](#architecture)
- [Appendix](#appendix)

---

## FAQ

### What is the IO project?

IO aims at bringing citizens to the centre of Italian public-administration services. The project provides:

- a platform of enabling components for building citizen-centric digital services;
- an interface for citizens to manage their data and digital profile.

### Who develops IO?

The app is developed and maintained by [PagoPA S.p.A.](https://www.pagopa.it) with contributions from the open-source community.

### Can I use the app?

Yes. You need either a [SPID account](https://www.agid.gov.it/en/platforms/spid) or a [CIE (Italian electronic identity card)](https://www.cartaidentita.interno.gov.it) to sign in.

### How can I help?

[Report bugs](https://github.com/pagopa/io-app/issues), submit translations (see [locales/README.md](locales/README.md)), or [open a pull request](https://github.com/pagopa/io-app/pulls). Read [`CONTRIBUTING.md`](../../CONTRIBUTING.md) first.

### What permissions does the app request?

<details>
<summary><b>Android</b></summary>

| Permission                                         | Purpose                          |
| -------------------------------------------------- | -------------------------------- |
| `INTERNET`                                         | Network connectivity             |
| `ACCESS_NETWORK_STATE`                             | Monitor connection quality       |
| `CAMERA`                                           | QR code scanning                 |
| `NFC`                                              | NFC I/O operations               |
| `RECEIVE_BOOT_COMPLETED`                           | Push notification initialisation |
| `VIBRATE`                                          | Haptic feedback                  |
| `WAKE_LOCK`                                        | Push notification delivery       |
| `READ_APP_BADGE`                                   | Notification badge on app icon   |
| `READ_CALENDAR` / `WRITE_CALENDAR`                 | Adding reminders to calendar     |
| `READ_EXTERNAL_STORAGE` / `WRITE_EXTERNAL_STORAGE` | Image and document handling      |
| `USE_FINGERPRINT`                                  | Biometric login (API 23–28)      |
| `USE_BIOMETRIC`                                    | Biometric login (API 28+)        |
| `SCHEDULE_EXACT_ALARM`                             | Local notifications              |
| `DOWNLOAD_WITHOUT_NOTIFICATION`                    | Background file download         |
| `POST_NOTIFICATIONS`                               | Push notifications (Android 13+) |

Additional manufacturer-specific permissions are also declared for notification badge support on Samsung, Huawei, Sony, OPPO, and other devices.

</details>

<details>
<summary><b>iOS</b></summary>

| Permission                                                             | Purpose                               |
| ---------------------------------------------------------------------- | ------------------------------------- |
| `NSCameraUsageDescription`                                             | QR code scanning                      |
... (246 lines truncated)
</file>

<file path="docs/messages/add-remove-reminder.puml">
@startuml
start
:tap on "Aggiungi/Rimuovi Promemoria";
if (Has calendar permission?) then (yes)
else (no)
  :request system permission;
  if(granted?) then (yes)
  else (no)
    if (show popup\n"Per aggiungere il promemoria, devi consentire\na IO di accedere al tuo calendario"\nConsenti l'accesso\nAnnulla) then (consenti)
      :open app System settings;
    else (annulla)
    endif
    stop
  endif
endif
if (Add or remove?) then (add)
  if (has preferred calendar?) then (yes)
    label extraspace1
    label extraspace2
    label extraspace3
    label extraspace4
    label addEventToCalendar
    if (event is already in calendar?) then (yes)
      if(show popup\n"Esiste già un evento\nEsiste già un evento corrispondente\nal messaggio selezionato nel calendario.\nVuoi mantenere quello precedente o aggiungerne uno nuovo?"\nAggiungi un nuovo evento\nMantieni l'evento precedente\nAnnulla) then (Aggiungi)
        label addEvent
        if (Add to calendar) then (success)
          :show toast\nPromemoria aggiunto;
        else (failure)
          :show toast\nErrore durante l'aggiunta del promemoria,\nriprova per piacere;
        endif
      else (Mantieni\nAnnulla)
      endif
    else (no)
      label extraSpaceA1
      label extraSpaceA2
      label extraSpaceA3
      label extraSpaceA4
      goto addEvent
    endif
    stop
  else (no)
    :show CalendarSelection;
    if (Calendar selected?) then (yes)
      label extraspaceA
      goto addEventToCalendar
    else (no\nCancel)
      :;
    endif
    stop
  endif
else (remove)
  if (show popup\nVuoi davvero rimuovere il promemoria?\nRimuovi promemoria\nAnnulla l'operazione) then (Rimuovi)
    if (Event removed?) then (yes)
      :show toast\nPromemoria eliminato;
    else (no)
      :show toast\nErrore durante l'eliminazione del promemoria,\nriprova per piacere;
    endif
  else (Annulla)
  endif
  stop
endif
@enduml
</file>

<file path="docs/messages/load-next-page-message-list.puml">
@startuml name LoadNextMessagePage-ioApp

participant MessageList
participant homeUtils
database Redux
participant allPaginatedReducer
participant handleLoadNextPageMessages
entity BE

note over handleLoadNextPageMessages
 saga
end note

activate MessageList
note over MessageList
User scrolls to
the bottom of
the message list
end note
MessageList -> MessageList : FlatList invokes\nonEndReachedCallback
activate MessageList

MessageList -> homeUtils : calls\ngetLoadNextPageMessagesActionIfAllowed
activate homeUtils
note over homeUtils
undefined is returned if
- system is busy archiving or
  restoring messages
- system is loading the inbox
  or archive message list
- there is no 'next' id for
  current message page
- a previous request for next
  page messages has failed
  within two seconds
end note
homeUtils -> MessageList : returns\n| undefined\n| loadNextPageMessages.request
deactivate homeUtils

MessageList -> Redux : dispatches\nloadNextPageMessages.request
deactivate MessageList
deactivate MessageList

Redux -> allPaginatedReducer ++ : passes\nloadNextPageMessages.request
allPaginatedReducer -> Redux --: returns\nnew AllPaginated state

Redux -> handleLoadNextPageMessages ++ : forwards\nloadNextPageMessages.request

handleLoadNextPageMessages --> BE : API call to\nmessages?maximum_id=
BE --> handleLoadNextPageMessages : replies with\nPaginatedPublicMessagesCollection

handleLoadNextPageMessages -> handleLoadNextPageMessages : maps\nPaginatedPublicMessagesCollection\ninto UIMessage[]

handleLoadNextPageMessages -> Redux -- : dispatches\nloadNextPageMessages.success

Redux -> allPaginatedReducer ++ : passes\nloadNextPageMessages.success
allPaginatedReducer -> Redux -- : returns\nnew AllPaginated state

MessageList -> Redux: invokes\nMessageListForCategorySelector
activate MessageList
Redux -> MessageList : returns\nUIMessages[]
deactivate MessageList
note over MessageList
UI renders
updated
message list
end note

@enduml
</file>

<file path="docs/messages/messages-autorefresh.puml">
@startuml
box "UI logic" #LightBlue
participant PagerViewContainer
note right of PagerViewContainer
child of MessagesHomeScreen
end note
participant loadNewlyReceivedMessagesIfNeededCallback
end box
participant getLoadPreviousPageMessagesActionIfAllowed
note right of getLoadPreviousPageMessagesActionIfAllowed
 part of homeUtils.ts
 end note
database Redux
participant allPaginatedReducer
participant handleLoadPrediousPageMessages
note right of handleLoadPrediousPageMessages
 saga
 end note
database BE

create loadNewlyReceivedMessagesIfNeededCallback
PagerViewContainer -> loadNewlyReceivedMessagesIfNeededCallback  :| page landing \n|  switch between inbox and archived tab
loadNewlyReceivedMessagesIfNeededCallback->Redux  : store.getState()
activate loadNewlyReceivedMessagesIfNeededCallback
activate Redux
    Redux->loadNewlyReceivedMessagesIfNeededCallback: current app state
deactivate Redux
    loadNewlyReceivedMessagesIfNeededCallback -> getLoadPreviousPageMessagesActionIfAllowed ++ : get action to dispatch
    note left: app state is passed as an arg
    getLoadPreviousPageMessagesActionIfAllowed->getLoadPreviousPageMessagesActionIfAllowed: 60 seconds have passed since last call \n && no async operations on messages are running?  \n if so return loadPreviousPageMessages.request
    getLoadPreviousPageMessagesActionIfAllowed -> loadNewlyReceivedMessagesIfNeededCallback -- : action || undefined
    loadNewlyReceivedMessagesIfNeededCallback -> Redux : if an action is returned, track the event on mixpanel and dispatch it
deactivate loadNewlyReceivedMessagesIfNeededCallback

activate Redux
Redux->allPaginatedReducer ++ : passes loadPreviousPageMessages.request
allPaginatedReducer->Redux -- : return new state
' -------
Redux->handleLoadPrediousPageMessages : forward loadPreviousPageMessages.request
deactivate Redux

activate handleLoadPrediousPageMessages
handleLoadPrediousPageMessages-->BE : call Api
BE-->handleLoadPrediousPageMessages: PaginatedPublicMessagesCollection
handleLoadPrediousPageMessages->Redux --: dispatch loadPreviousPageMessagesAction.success
' ---------
activate Redux
Redux->allPaginatedReducer  : passes loadPreviousPageMessages.success
deactivate Redux
activate allPaginatedReducer
allPaginatedReducer->Redux -- : return new state
@enduml
</file>

<file path="docs/messages/view-message-list.puml">
@startuml name ViewMessageList-ioApp

participant PagerViewContainer
participant MessageList
database Redux
participant allPaginatedReducer
participant HandleReloadAllMessages
entity BE

note over PagerViewContainer
React component
embedded in
MessagesHomeScreen
end note

/ note over MessageList
React component
embedded in
PagerViewContainer
end note

/ note over HandleReloadAllMessages
saga
end note

PagerViewContainer -> Redux : MessagePagePotFromCategorySelector
activate PagerViewContainer
Redux -> PagerViewContainer : Pot.None

MessageList -> Redux : messageListForCategorySelector
activate MessageList
Redux -> MessageList : empty UIMessages[]
note left
UI logic infers
empty state
end note
deactivate MessageList

PagerViewContainer -> Redux : dispatch reloadAllMessages.request
deactivate PagerViewContainer

Redux -> allPaginatedReducer ++ : passes reloadAllMessages.request
allPaginatedReducer -> Redux --: return new state

Redux -> HandleReloadAllMessages ++ : forward reloadAllMessages.request

HandleReloadAllMessages --> BE : call Api
note left: api/v1/messages

MessageList -> Redux : MessageListForCategorySelector
activate MessageList
Redux -> MessageList : undefined
note left
UI logic infers
loading state
end note
deactivate MessageList

BE --> HandleReloadAllMessages : PaginatedPublicMessagesCollection
HandleReloadAllMessages -> Redux -- : dispatch reloadAllMessages.success

Redux -> allPaginatedReducer ++ : passes reloadAllMessages.success
allPaginatedReducer -> Redux -- : return new state

MessageList -> Redux: MessageListForCategorySelector
activate MessageList
Redux -> MessageList : UIMessages[]
note left
UI logic infers
nonEmpty state
end note
deactivate MessageList

@enduml
</file>

<file path="docs/wallet/routes.puml">
@startuml
hide empty description

[*] --> P_TRANSACTION_SUMMARY : prTransactionSummaryFromRptId
[*] --> P_TRANSACTION_SUMMARY : prTransactionSummaryFromBanner

P_TRANSACTION_SUMMARY --> P_PICK_PAYMENT_METHOD : prContinueWithPaymentMethods\n(no-fav-wallet)
P_TRANSACTION_SUMMARY --> P_PICK_PSP : prContinueWithPaymentMethods\n(fav-wallet,[psps] > 1)
P_TRANSACTION_SUMMARY --> P_CONFIRM_PAYMENT_METHOD : prContinueWithPaymentMethods\n(fav-wallet,[psps] === 1)

P_PICK_PAYMENT_METHOD --> P_PICK_PSP : prConfirmPaymentMethod\n(select-wallet,[psps] > 1)
P_PICK_PAYMENT_METHOD --> P_CONFIRM_PAYMENT_METHOD : prConfirmPaymentMethod\n(select-wallet,[psps] === 1)
P_PICK_PAYMENT_METHOD --> P_TRANSACTION_SUMMARY : prTransactionSummaryFromBanner

P_PICK_PSP --> P_PICK_PSP : pUpdatePsp,\nprConfirmPaymentMethod
P_PICK_PSP --> P_CONFIRM_PAYMENT_METHOD : pUpdatePsp,\nprConfirmPaymentMethod

P_CONFIRM_PAYMENT_METHOD --> P_PICK_PAYMENT_METHOD : prPickPaymentMethod
P_CONFIRM_PAYMENT_METHOD --> PIN_LOGIN_SCREEN : prPinLogin
P_CONFIRM_PAYMENT_METHOD --> P_PICK_PSP : prPickPsp
P_CONFIRM_PAYMENT_METHOD --> P_TRANSACTION_SUMMARY : prTransactionSummaryFromBanner

PIN_LOGIN_SCREEN --> W_TRANSACTION_DETAILS : prCompletion

@enduml
</file>

<file path="docs/wallet/saga.puml">
@startuml

start
fork
  #orange:paymentRequestTransactionSummaryFromRptId;
  #hotpink:PAYMENT_TRANSACTION_SUMMARY;
  #cyan:paymentSetLoadingState;
  if (getVerificaRpt) then (ok)
    #cyan:setPaymentStateToSummary;
  else (ko)
    #cyan:paymentFailure;
  endif
  #cyan:paymentResetLoadingState;

fork again

  #orange:paymentRequestTransactionSummaryFromBanner;
  #cyan:setPaymentStateToSummaryWithPaymentId;
  #hotpink:PAYMENT_TRANSACTION_SUMMARY;

fork again

  #orange:paymentRequestContinueWithPaymentMethods;
  #red:getFavoriteWalletId;
  #red:isGlobalStateWithPaymentId;
  #red:getRptId;
  #red:getPaymentContextCode;
  #red:getCurrentAmount;
  if (isGlobalStateWithPaymentId) then (no)
    #cyan:paymentSetLoadingState;
    :attivaRpt;
    :fetchPaymentId;
    #cyan:paymentResetLoadingState;
  endif
  if (paymentId) then (some)
    #cyan:paymentSetLoadingState;
    :checkPayment;
    #cyan:paymentResetLoadingState;
  endif
  if (favoriteWallet) then (some)
    #red:specificWalletSelector(walletId);
    if (wallet) then (some)
      #red:getPaymentId;
      #cyan:paymentSetLoadingState;
      :getPspList;
      #cyan:paymentResetLoadingState;
      if (shouldShowPspList) then (yes)
        if (paymentId) then (defined)
          #cyan:setPaymentStateFromSummaryToPickPsp;
        else (no)
          #cyan:setPaymentStateToPickPsp;
        endif
        #hotpink:PAYMENT_PICK_PSP;
      else (no)
        if (paymentId) then (defined)
          #cyan:setPaymentStateFromSummaryToConfirmPaymentMethod;
        else (undefined)
          #cyan:setPaymentStateToConfirmPaymentMethod;
        endif
        #hotpink:PAYMENT_CONFIRM_PAYMENT_METHOD;
      endif
    endif
  else (none)
    if (paymentId) then (defined)
      #cyan:setPaymentStateFromSummaryToPickPaymentMethod;
    else (undefined)
      #cyan:setPaymentStateToPickPaymentMethod;
    endif
    #hotpink:PAYMENT_PICK_PAYMENT_METHOD;
  endif
fork again

  #orange:paymentRequestPickPaymentMethod;
  if (paymentId) then (defined)
    #cyan:setPaymentStateFromSummaryToPickPaymentMethod;
  else (undefined)
    #cyan:setPaymentStateToPickPaymentMethod;
  endif
  #hotpink:PAYMENT_PICK_PAYMENT_METHOD;

fork again

  #orange:paymentRequestConfirmPaymentMethod;
  #red:specificWalletSelector(idWallet);
  if (wallet) then (some)
    #red:getPaymentId;
    #cyan:paymentSetLoadingState;
    :getPspList;
    #cyan:paymentResetLoadingState;
    if (shouldShowPspList) then (yes)
      if (paymentId) then (defined)
        #cyan:setPaymentStateFromSummaryToPickPsp;
      else (no)
        #cyan:setPaymentStateToPickPsp;
      endif
      #hotpink:PAYMENT_PICK_PSP;
    else (no)
      if (paymentId) then (defined)
        #cyan:setPaymentStateFromSummaryToConfirmPaymentMethod;
      else (undefined)
... (66 lines truncated)
</file>

<file path="docs/wallet/states.puml">
@startuml
hide empty description

title Wallet State Model

Summary : rptid : verificaResponse : initialAmount

SummaryWithPaymentId : rptId : verificaResponse : initialAmount : paymentId

PickPaymentMethod : rptId : verificaResponse : initialAmount : paymentId

ConfirmPaymentMethod : rptId : verificaResponse : initialAmount : paymentId : selectedPaymentMethod : pspList

PickPsp : rptId : verificaResponse : initialAmount : paymentId : selectedPaymentMethod : pspList

PinLogin : rptId : verificaResponse : initialAmount : paymentId : selectedPaymentMethod : pspList

[*] --> QrCode : ToQrCode
[*] --> Summary : ToSummary

QrCode --> ManualEntry : ToManualEntry

QrCode --> Summary : ToSummary
ManualEntry --> Summary : ToSummary

PickPaymentMethod --> SummaryWithPaymentId : ToSummaryWithPaymentId
ConfirmPaymentMethod --> SummaryWithPaymentId : ToSummaryWithPaymentId
PickPsp --> SummaryWithPaymentId : ToSummaryWithPaymentId

Summary --> PickPaymentMethod : FromSummaryToPickPaymentMethod

SummaryWithPaymentId --> PickPaymentMethod : ToPickPaymentMethod
ConfirmPaymentMethod --> PickPaymentMethod : ToPickPaymentMethod

Summary --> ConfirmPaymentMethod : FromSummaryToConfirmPaymentMethod

PickPaymentMethod --> ConfirmPaymentMethod : ToConfirmPaymentMethod
SummaryWithPaymentId --> ConfirmPaymentMethod : ToConfirmPaymentMethod
PickPsp --> ConfirmPaymentMethod : ToConfirmPaymentMethod

Summary --> PickPsp : FromSummaryToPickPsp

SummaryWithPaymentId --> PickPsp : ToPickPsp
ConfirmPaymentMethod --> PickPsp : ToPickPsp
PickPaymentMethod --> PickPsp : ToPickPsp

ConfirmPaymentMethod --> PinLogin : ToPinLogin

PinLogin --> [*] : resetState

@enduml
</file>

<file path=".node-version">
22.21.0
</file>

<file path=".oxlintrc.jsonc">
{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": ["typescript", "unicorn", "oxc"],
  "categories": {
    "correctness": "error"
  },
  // Root-only options: they apply when oxlint runs from the repo root (VS Code,
  // pre-commit). The per-project `oxlint` Nx target passes them as CLI flags.
  "options": {
    "typeAware": true,
    // Covers `oxlint-disable` comments, which ESLint's eslint-comments rules never see
    "reportUnusedDisableDirectives": "warn"
  },
  "rules": {},
  "env": {
    "builtin": true
  }
}
</file>

<file path="AGENTS.md">
# Repository guidelines

Run any script in `apps/main-app/package.json` as `pnpm nx run main-app:<script>`; run `sync` after cloning or pulling.

## Guardrails

- `libs/api-types/generated/definitions/` is generated: change it only by running `pnpm nx run main-app:generate`.
- Before adding a user-facing string or touching `apps/main-app/locales/`, read `CODING_STANDARDS.md#i18n`: Lokalise owns every locale value, and CI rejects value edits outside Lokalise PRs.
- Before any `git commit`, `git push`, or `gh pr create`, read `CODING_STANDARDS.md#commits-and-pull-requests`.
- A task is complete only when `pnpm nx affected --targets=lint,oxlint,tsc-noemit` and `pnpm format` both finish with zero errors.

## Coding standards

Before writing code, read `CODING_STANDARDS.md#general` and every other section matching your change:

- Creating a feature or placing a new file → `CODING_STANDARDS.md#feature-structure`
- Adding a route or screen → `CODING_STANDARDS.md#navigation`
- Writing actions, reducers, selectors, sagas, or store access → `CODING_STANDARDS.md#redux-and-sagas`
- Writing an XState machine → `CODING_STANDARDS.md#state-machines`
- Building components or screens → `CODING_STANDARDS.md#ui`
- Writing tests or fixing a bug → `CODING_STANDARDS.md#testing`
</file>

<file path="CODE_OF_CONDUCT.md">
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
  advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
  address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at . All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
</file>

<file path="CODEOWNERS">
# see https://help.github.com/en/articles/about-code-owners#example-of-a-codeowners-file

* @pagopa/io-app @gispada @soixdev91 @emilio-dimari @Leerti @s-bartolini

/locales/ @pagopa/io-app @thisisjp @gispada @soixdev91 @emilio-dimari @Leerti @s-bartolini
/ios/IO/it.lproj/ @pagopa/io-app @thisisjp @gispada @soixdev91 @emilio-dimari @Leerti @s-bartolini
/ios/IO/en.lproj/ @pagopa/io-app @thisisjp @gispada @soixdev91 @emilio-dimari @Leerti @s-bartolini
/ts/features/design-system @pagopa/io-app @dmnplb @gispada @soixdev91 @emilio-dimari @Leerti @s-bartolini
/ts/components/ui @pagopa/io-app @dmnplb @gispada @soixdev91 @emilio-dimari @Leerti @s-bartolini
</file>

<file path="CODING_STANDARDS.md">
# Coding standards

The reference for writing code in this repo, for humans and agents. Lint (`eslint` + `oxlint`) enforces the mechanical rules and names the fix in its messages; this file holds what lint cannot check.

## General

- Write new code with native TypeScript or `neverthrow` in place of `fp-ts`: lint only warns on `fp-ts` imports, so the completion check lets them through.
- Name every magic number and hardcoded value as an enum, string literal, or documented constant.
- Comment only business-logic constraints and side effects the code cannot show; when code needs a long explanation, refactor it instead.

## Feature structure

Keep each feature self-contained under `apps/main-app/ts/features/<feature>/`, laid out as in `apps/main-app/README.md#feature-structure`.

## Navigation

- Add each route to the feature's `navigation/params.ts` and `navigation/routes.ts`, then register the feature navigator in `apps/main-app/ts/navigation/params/AppParamsList.ts` and in the stack navigator hosting it (usually `apps/main-app/ts/navigation/AuthenticatedStackNavigator.tsx`).
- Navigate with `useIONavigation()`; type screen props and route params with `IOStackNavigationRouteProps<ParamsList, Route>`.

## Redux and sagas

- Create actions with `createAction` / `createAsyncAction` from `typesafe-actions`.
- Wrap authenticated API calls in `withRefreshApiCall` so expired tokens refresh automatically.
- Access the store from components through `useIOSelector`, `useIODispatch`, and `useIOStore` from `apps/main-app/ts/store/hooks.ts`.
- Define every selector as a named function in the feature's `store/selectors/`.

## State machines

- Keep `machine.ts` pure and portable: inject every side effect (navigation, Redux dispatch, toasts) from the feature's `machine/provider.tsx`.
- Model the sub-steps of a flow as nested states, and target states across the hierarchy by absolute ID (`#myMachine.Failure`).
- Type the context fully, with a JSDoc comment per field and an initial state.
- Type events as a tagged union with kebab-case `type` names.

## UI

- Build UI from `@io-app/design-system` components; write a custom component only when the design system has no suitable primitive.
- Take every color from the semantic tokens of `useIOTheme()`.
- Give every interactive element an accessible label.

## I18n

Lokalise owns every value under `apps/main-app/locales/`; CI rejects value changes outside Lokalise `lok_*` PRs.

- Render every user-facing string through an `I18n.t(...)` key.
- Add new keys only to the base locale `apps/main-app/locales/it/index.json`; Lokalise fills in the other languages.
- Leave existing values untouched. When asked for a copy change, report each full dotted key path (e.g. `features.wallet.title`) with its locale and tell the user to edit it on Lokalise.

## Testing

- Pair every bug fix with a regression test.
- Co-locate tests in `__tests__/` next to the implementation.
- Render screens with `renderScreenWithNavigationStoreContext`, and components that need the store with `withStore`.
- Test sagas with `expectSaga` for integration and `testSaga` for units.
- Write similar scenarios as `test.each` over named cases, interpolating `$name` in test titles.
- Derive initial state from `appReducer(undefined, applicationChangeState("active"))`.

## Commits and pull requests

- Work on a dedicated branch for the issue; **never push to `master`**.
- Write commit messages per `CONTRIBUTING.md#commit-messages` and PR titles per `CONTRIBUTING.md#pr-title-format`, focused on user impact rather than implementation details.
- Credit only humans as authors: leave out any `Co-authored-by` trailer naming an agent or AI assistant, even when your harness adds one by default.

Before pushing:

1. Review the full diff and keep only intentional, task-related changes.
2. Pass the completion check in `AGENTS.md` and every relevant test.
3. Rebase onto `master` and resolve all conflicts; when conflicts are complex, stop and ask for guidance.

Then push the branch, open the pre-filled PR creation page, and stop as soon as it opens:

```
gh pr create --web --title <title> --body <body>
```

Fill every section of `.github/PULL_REQUEST_TEMPLATE.md`. Under "How to test", give the steps to verify the change, the expected behavior, and relevant edge cases, plus "Steps to Reproduce" for bugs.
</file>

<file path="CONTRIBUTING.md">
# Contributing to IO App

Thank you for your interest in contributing to **IO**, the Italian public services app. This document explains how to report issues, propose changes, and submit pull requests in a way that keeps the project healthy and moving forward.

---

## Table of contents

- [Code of Conduct](#code-of-conduct)
- [Before you start](#before-you-start)
- [Reporting bugs](#reporting-bugs)
- [Suggesting improvements](#suggesting-improvements)
- [Setting up the development environment](#setting-up-the-development-environment)
- [Development workflow](#development-workflow)
- [Coding conventions](#coding-conventions)
- [Commit messages](#commit-messages)
- [Pull request checklist](#pull-request-checklist)
- [Review process](#review-process)
- [Translations](#translations)
- [Security vulnerabilities](#security-vulnerabilities)

---

## Code of Conduct

This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating you agree to uphold it. Please report unacceptable behaviour to the maintainers.

---

## Before you start

- Check the [open issues](https://github.com/pagopa/io-app/issues) and [pull requests](https://github.com/pagopa/io-app/pulls) to avoid duplicating existing work.
- For substantial changes (new features, architectural decisions), open an issue and discuss your approach with the maintainers **before** writing code.
- For bug fixes or small improvements, you can go straight to opening a pull request.

---

## Reporting bugs

Open a [GitHub Issue](https://github.com/pagopa/io-app/issues/new) and include:

1. A clear, descriptive title.
2. Steps to reproduce the issue.
3. Expected behaviour and actual behaviour.
4. App version, OS, and device model.
5. Relevant logs, screenshots, or recordings when possible.

> [!NOTE]
> For issues related to the design system components, please open the issue on the same repository and tag it with the `design-system` label.

---

## Suggesting improvements

Open a [GitHub Issue](https://github.com/pagopa/io-app/issues/new) with the `enhancement` label. Describe:

- The problem you are trying to solve or the opportunity you see.
- Your proposed solution at a high level.
- Any alternatives you considered.

---

## Setting up the development environment

Follow the setup instructions in the root [README.md](README.md#getting-started). Make sure the following complete without errors before starting work:

```bash
pnpm nx run main-app:sync
pnpm nx affected --target=lint,tsc-noemit
```

---

## Development workflow

1. **Fork** the repository and create a feature branch from `master`:

   ```bash
   git checkout -b fix/ISSUE-ID-short-description
   # or
   git checkout -b feat/ISSUE-ID-short-description
   ```

2. **Make your changes.** Follow the [coding conventions](#coding-conventions) below.

3. **Write tests** for new behaviour: cover the happy path, failure cases, and relevant edge cases.

4. **Run quality checks** from the repository root:

   ```bash
   pnpm nx affected --target=lint,tsc-noemit
   pnpm format
   pnpm nx run main-app:test-dev
   ```

   All checks must pass with zero errors before opening a PR.

5. **Rebase on `master`** to incorporate recent changes:

   ```bash
... (147 lines truncated)
</file>

<file path="eslint.config.mjs">
// @typescript-eslint and jest are already registered by pagopaConfig (via
// typescript-eslint and @pagopa/eslint-config/jest, the latter scoping jest to
// test files). Strip the plugins — and jest's now-orphaned rules, which the RN
// config applies globally — to avoid "Cannot redefine plugin" errors.
⋮----
// Pagopa base config: @eslint/js recommended, typescript-eslint strict+stylistic,
// eslint-config-prettier, perfectionist.
⋮----
// Only include rules from tseslint, not the plugin registration,
// because @react-native/eslint-config/flat already registers @typescript-eslint
⋮----
// `import` plugin is retained for `import/no-extraneous-dependencies`;
// import ordering is handled by `perfectionist/sort-imports`.
⋮----
// START: OVERWRITTEN RULES FROM PAGOPA/ESLINT-CONFIG
//
// Converting `type = {}` to `interface {}` breaks assignability to
// `Record<string, unknown>` — TypeScript requires an explicit index
// signature on interfaces, whereas type aliases satisfy it structurally.
// This affects analytics helpers, navigation param lists, and any other
// type used as a generic record argument throughout the codebase.
⋮----
// Auto-fix corrupts multi-line property values (see comment below)
⋮----
// Allow `_`-prefixed throwaways and rest-sibling destructuring omits
// (`const { key, ...rest } = obj`), matching tsc's own noUnusedLocals.
⋮----
// Rules from tseslint.strict / pagopa config that require widespread
// refactoring incompatible with the current codebase
⋮----
// Incorrectly fires on mapped types (`[P in ...]`) — only meant for
// plain index signatures (`[key: string]: V`) which should use Record<K,V>
⋮----
// Most violations are `typesafe-actions` empty payloads
// (`createStandardAction("X")<void>()`, `createAsyncAction(...)<void, S, F>()`).
// `void` here is load-bearing: it makes the action creator callable with no
// argument while keeping a `payload` slot. Re-enabling requires a deliberate
// action-shape refactor, not a mechanical fix.
⋮----
// Widespread, deliberate test patterns from pagopa's jest config that
// would require refactoring the whole test suite to satisfy:
// - narrowing fp-ts Either/Option before asserting inside the guard
⋮----
// - importing shared fixtures directly from __mocks__ directories
⋮----
// - asserting a mock was called without pinning its exact arguments
⋮----
// END: OVERWRITTEN RULES FROM PAGOPA/ESLINT-CONFIG
⋮----
// CODE STYLE
⋮----
// GENERAL JS SAFETY
// Deprecated since ESLint 5.1.0 — overrides @react-native/eslint-config warn
⋮----
// Import ordering is handled by `perfectionist/sort-imports`
⋮----
// TYPESCRIPT
// Downgraded to warn — existing shadows are widespread and non-critical
⋮----
// REACT
⋮----
// Less relevant rule with contemporary React with hooks
⋮----
// It could highlight performance issues,
// with some noise on trivial cases
⋮----
// REACT NATIVE
⋮----
// ACCESSIBILITY
⋮----
// SONAR
⋮----
// FUNCTIONAL PROGRAMMING
⋮----
// TODO: Remove this once we migrate to newer versions of `react-navigation`
⋮----
// Caches and memoization rely on mutable Map/Set
⋮----
// INTERNATIONALISATION
⋮----
// Text-bearing props
⋮----
// Props whose object value nests text in `componentProps`
⋮----
// Options replace the plugin defaults, so the default excludes are
// respelled here: patterns full-match with a leading dot allowed, so
// `t` is what exempts `I18n.t(...)` arguments.
⋮----
// REDUX SAGA
⋮----
// Disallow dynamically-built i18n keys so unused-key detection stays reliable
⋮----
// A single import name lets the i18n rules above, which match `I18n.t`, see every call
⋮----
// Remove this after the migration of fp-ts is being completed and replaced by neverthrow;
⋮----
// Data-driven tests here derive titles dynamically (loop variables,
// `fn.name`, ternaries). Allow non-string titles while keeping the
// empty/whitespace/duplicate-prefix checks active.
⋮----
... (8 lines truncated)
</file>

<file path="jest.config.ts">
import type { Config } from "jest";
import { getJestProjectsAsync } from "@nx/jest";
</file>

<file path="jest.preset.js">

</file>

<file path="knip.jsonc">
{
  "$schema": "./node_modules/knip/schema-jsonc.json",
  // Metro picks the platform variant of a module at bundle time, so nothing
  // ever imports `*.ios.tsx` / `*.android.tsx` by path. Knip resolves the
  // plain specifier only and would report every variant as an unused file.
  "ignoreIssues": {
    "**/*.{ios,android,native,web}.{js,jsx,ts,tsx}": ["files"]
  }
}
</file>

<file path="LICENSE">
European Union Public Licence
V. 1.2

EUPL © the European Union 2007, 2016

This European Union Public Licence (the ‘EUPL’) applies to the Work (as
defined below) which is provided under the terms of this Licence. Any use of
the Work, other than as authorised under this Licence is prohibited (to the
extent such use is covered by a right of the copyright holder of the Work).

The Work is provided under the terms of this Licence when the Licensor (as
defined below) has placed the following notice immediately following the
copyright notice for the Work: “Licensed under the EUPL”, or has expressed by
any other means his willingness to license under the EUPL.

1. Definitions

In this Licence, the following terms have the following meaning:
— ‘The Licence’: this Licence.
— ‘The Original Work’: the work or software distributed or communicated by the
  ‘Licensor under this Licence, available as Source Code and also as
  ‘Executable Code as the case may be.
— ‘Derivative Works’: the works or software that could be created by the
  ‘Licensee, based upon the Original Work or modifications thereof. This
  ‘Licence does not define the extent of modification or dependence on the
  ‘Original Work required in order to classify a work as a Derivative Work;
  ‘this extent is determined by copyright law applicable in the country
  ‘mentioned in Article 15.
— ‘The Work’: the Original Work or its Derivative Works.
— ‘The Source Code’: the human-readable form of the Work which is the most
  convenient for people to study and modify.

— ‘The Executable Code’: any code which has generally been compiled and which
  is meant to be interpreted by a computer as a program.
— ‘The Licensor’: the natural or legal person that distributes or communicates
  the Work under the Licence.
— ‘Contributor(s)’: any natural or legal person who modifies the Work under
  the Licence, or otherwise contributes to the creation of a Derivative Work.
— ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
  the Work under the terms of the Licence.
— ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
  renting, distributing, communicating, transmitting, or otherwise making
  available, online or offline, copies of the Work or providing access to its
  essential functionalities at the disposal of any other natural or legal
  person.

2. Scope of the rights granted by the Licence

The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
sublicensable licence to do the following, for the duration of copyright
vested in the Original Work:

— use the Work in any circumstance and for all usage,
— reproduce the Work,
— modify the Work, and make Derivative Works based upon the Work,
— communicate to the public, including the right to make available or display
  the Work or copies thereof to the public and perform publicly, as the case
  may be, the Work,
— distribute the Work or copies thereof,
— lend and rent the Work or copies thereof,
— sublicense rights in the Work or copies thereof.

Those rights can be exercised on any media, supports and formats, whether now
known or later invented, as far as the applicable law permits so.

In the countries where moral rights apply, the Licensor waives his right to
exercise his moral right to the extent allowed by law in order to make
effective the licence of the economic rights here above listed.

The Licensor grants to the Licensee royalty-free, non-exclusive usage rights
to any patents held by the Licensor, to the extent necessary to make use of
the rights granted on the Work under this Licence.

3. Communication of the Source Code

The Licensor may provide the Work either in its Source Code form, or as
Executable Code. If the Work is provided as Executable Code, the Licensor
provides in addition a machine-readable copy of the Source Code of the Work
along with each copy of the Work that the Licensor distributes or indicates,
in a notice following the copyright notice attached to the Work, a repository
where the Source Code is easily and freely accessible for as long as the
Licensor continues to distribute or communicate the Work.

4. Limitations on copyright

Nothing in this Licence is intended to deprive the Licensee of the benefits
from any exception or limitation to the exclusive rights of the rights owners
in the Work, of the exhaustion of those rights or of other applicable
limitations thereto.

5. Obligations of the Licensee

The grant of the rights mentioned above is subject to some restrictions and
obligations imposed on the Licensee. Those obligations are the following:

Attribution right: The Licensee shall keep intact all copyright, patent or
trademarks notices and all notices that refer to the Licence and to the
disclaimer of warranties. The Licensee must include a copy of such notices and
a copy of the Licence with every copy of the Work he/she distributes or
communicates. The Licensee must cause any Derivative Work to carry prominent
... (175 lines truncated)
</file>

<file path="README.md">
<p align="center">
  <img src="apps/main-app/img/io-app-icon.png" width="100" style="display: block" /><br />
  <h3 align="center">IO — The Italian public services app</h3>
</p>

<p align="center">
  <a href="https://github.com/pagopa/io-app/actions/workflows/nightly-build.yml">
    <img src="https://github.com/pagopa/io-app/actions/workflows/nightly-build.yml/badge.svg?branch=master" alt="Nightly build" />
  </a>
  <a href="https://codecov.io/gh/pagopa/io-app">
    <img src="https://codecov.io/gh/pagopa/io-app/branch/master/graph/badge.svg" alt="Codecov" />
  </a>
  <img src="https://img.shields.io/github/contributors-anon/pagopa/io-app" alt="Contributors" />
  <img src="https://img.shields.io/github/repo-size/pagopa/io-app" alt="Repo size" />
</p>

<p align="center">
  <a href="https://apps.apple.com/it/app/io/id1501681835">
    <img height="50" src="apps/main-app/img/badges/app-store-badge.png" alt="Download on the App Store" />
  </a>
  <a href="https://play.google.com/store/apps/details?id=it.pagopa.io.app">
    <img height="50" src="apps/main-app/img/badges/google-play-badge.png" alt="Get it on Google Play" />
  </a>
</p>

---

# IO App — Monorepo

This repository hosts the source code of the **IO mobile app** and the shared packages that power it.

**IO** is the official app that enables Italian citizens to interact with public administration services: messages, payments, documents, and more, all in one place. It is developed and maintained by [PagoPA S.p.A.](https://www.pagopa.it).

The mobile app lives in [`apps/main-app`](apps/main-app/README.md). The root of this repository is the **Nx monorepo** that groups the app together with its companion shared libraries.

---

## Table of contents

- [Repository structure](#repository-structure)
- [Prerequisites](#prerequisites)
- [Getting started](#getting-started)
- [Daily development commands](#daily-development-commands)
- [Architecture](#architecture)
- [Contributing](#contributing)
- [License](#license)

---

## Repository structure

```
io-app/
├── apps/
│   └── main-app/         # IO mobile app (React Native)
├── libs/
│   └── design-system/    # @pagopa/io-app-design-system component library
├── .github/              # CI workflows, templates, and automation
├── docs/                 # Architecture notes and additional documentation
├── patches/              # pnpm package patches
├── scripts/              # Shared tooling scripts
├── nx.json               # Nx workspace configuration
└── pnpm-workspace.yaml   # pnpm workspace definition
```

Each project contains its own `README.md` with project-specific instructions:

- [apps/main-app/README.md](apps/main-app/README.md) — IO mobile app
- [libs/design-system/README.md](libs/design-system/README.md) — Design system library

---

## Prerequisites

| Tool               | Notes                                                                                                                                      |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **Node.js**        | Version pinned in [`.node-version`](.node-version); use [nodenv](https://github.com/nodenv/nodenv) or [nvm](https://github.com/nvm-sh/nvm) |
| **pnpm**           | Managed via [Corepack](https://nodejs.org/api/corepack.html); version pinned in `package.json`                                             |
| **Ruby**           | Version pinned in `apps/main-app/.ruby-version`; use [rbenv](https://github.com/rbenv/rbenv)                                               |
| **Xcode**          | Required for iOS builds (macOS only)                                                                                                       |
| **Android Studio** | Required for Android builds                                                                                                                |

Follow the [React Native environment setup guide](https://reactnative.dev/docs/environment-setup?guide=native) for your OS before proceeding.

---

## Getting started

```bash
# 1. Clone the repository
git clone https://github.com/pagopa/io-app.git
cd io-app

# 2. Enable Corepack and activate pnpm
corepack enable
corepack prepare --activate

# 3. Install Ruby gems (from apps/main-app)
cd apps/main-app
gem install bundler
... (115 lines truncated)
</file>

</files>
