mage-ai 0.9.74__py3-none-any.whl → 0.9.76__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mage-ai might be problematic. Click here for more details.
- mage_ai/ai/llm_pipeline_wizard.py +6 -4
- mage_ai/ai/openai_client.py +7 -5
- mage_ai/api/policies/PipelineSchedulePolicy.py +1 -0
- mage_ai/api/presenters/PipelineSchedulePresenter.py +11 -2
- mage_ai/api/resources/PipelineScheduleResource.py +11 -3
- mage_ai/api/resources/PipelineTriggerResource.py +3 -1
- mage_ai/api/resources/SessionResource.py +2 -2
- mage_ai/api/resources/SyncResource.py +1 -1
- mage_ai/api/resources/UserResource.py +1 -1
- mage_ai/data_integrations/destinations/constants.py +3 -0
- mage_ai/data_integrations/sources/constants.py +2 -0
- mage_ai/data_preparation/models/block/__init__.py +4 -5
- mage_ai/data_preparation/models/block/dbt/dbt_adapter.py +20 -8
- mage_ai/data_preparation/models/block/dynamic/constants.py +0 -1
- mage_ai/data_preparation/models/block/dynamic/counter.py +1 -3
- mage_ai/data_preparation/models/block/r/__init__.py +16 -5
- mage_ai/data_preparation/models/block/sql/__init__.py +2 -0
- mage_ai/data_preparation/models/block/sql/mssql.py +8 -0
- mage_ai/data_preparation/models/block/sql/utils/shared.py +6 -2
- mage_ai/data_preparation/models/constants.py +2 -1
- mage_ai/data_preparation/models/pipeline.py +5 -0
- mage_ai/data_preparation/templates/constants.py +7 -0
- mage_ai/data_preparation/templates/data_exporters/streaming/elasticsearch.yaml +3 -0
- mage_ai/data_preparation/templates/data_loaders/airtable.py +28 -0
- mage_ai/data_preparation/templates/data_loaders/streaming/nats.yaml +6 -3
- mage_ai/data_preparation/templates/repo/io_config.yaml +2 -0
- mage_ai/io/airtable.py +104 -0
- mage_ai/io/base.py +30 -1
- mage_ai/io/bigquery.py +36 -0
- mage_ai/io/config.py +5 -0
- mage_ai/io/mssql.py +5 -0
- mage_ai/io/mysql.py +6 -1
- mage_ai/io/oracledb.py +2 -4
- mage_ai/io/postgres.py +38 -19
- mage_ai/io/redshift.py +13 -0
- mage_ai/io/sql.py +1 -0
- mage_ai/io/utils.py +18 -0
- mage_ai/orchestration/db/__init__.py +23 -3
- mage_ai/orchestration/db/models/schedules.py +2 -5
- mage_ai/orchestration/db/models/secrets.py +11 -1
- mage_ai/orchestration/metrics/pipeline_run.py +1 -1
- mage_ai/orchestration/pipeline_scheduler_original.py +4 -5
- mage_ai/orchestration/pipeline_scheduler_project_platform.py +4 -5
- mage_ai/orchestration/utils/distributed_lock.py +8 -1
- mage_ai/server/api/triggers.py +9 -0
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +3 -3
- mage_ai/server/frontend_dist/_next/static/chunks/{1187-839336d276186105.js → 1187-4560c3895e1d7099.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{1598-0adca9dce3ba4c60.js → 1598-cbf3f5a6078fc3f5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2717-638a944d24d5abde.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3548-36f746b1824004f2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{3763-39a5174f6a3924db.js → 3763-aabe2703076636b0.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3782-3e2acb5ed45b582b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/449-5e2253c6aba42557.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/5627-d5e559859dd0e1e0.js → frontend_dist/_next/static/chunks/5627-10e76bafa5a26f5f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{5699-e49718dfc9eb2854.js → 5699-e99379e332bd0b41.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{7966-163da2621b8c987c.js → 7966-a5a7db345ce81263.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-782dd4a6b13e1c42.js +2 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/compute-ed67fa8e81662e8b.js → frontend_dist/_next/static/chunks/pages/compute-9e2dea78024e3bb4.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/files-e0ecd7ced09a63b2.js → frontend_dist/_next/static/chunks/pages/files-e08c7fe76f968f9c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/{[...slug]-c7a729477ecda50e.js → [...slug]-30c3807057a4e65b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-fd6ae6a358a60a0c.js → global-data-products-8dcb3b31af9e0e39.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-8e50243797a7fe59.js → frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-85a64b64d27214b6.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-hooks-d0c003446332dc0d.js → global-hooks-4ff959d51b8a9502.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{files-a69ed8e9f814490c.js → files-d08a460641d0efaa.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{overview-1aad7093c6d39257.js → overview-aae747f487e08d51.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{pipeline-runs-528d30e0d13b0cc7.js → pipeline-runs-09a842d64a6ada62.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{settings-fb9201d9cf63031d.js → settings-2e98e57d9376a458.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/{[user]-000f5a980a07da39.js → [user]-7be6e41ad66089bb.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-e4e613f6e817a733.js → frontend_dist/_next/static/chunks/pages/manage/users/new-4c088833063bfa07.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-5db54821a3059c69.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage-34d718b8a4066c23.js → frontend_dist/_next/static/chunks/pages/manage-868fcd8cbeb265f0.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{oauth-3bfd1b8d7f036726.js → oauth-6ceceb62191dfe8a.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-f65416f6dbe30ad3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{pipeline-runs-5f8c100e648efa8a.js → pipeline-runs-2d0136b51b57de93.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-688c652f3296bb9c.js → [...slug]-1ad5238742e25b4c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-bd11e87d026bfbf9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{dashboard-1236e36d39b1637d.js → dashboard-0f4f47f721b0723f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-432da20df91511fb.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-fe91dfb0091f6bc6.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-0d68d4bf6290fefb.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-cf794b2d22a80f31.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-9254358d58f07714.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-a964caef91bed9e1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-821001e690caebe2.js → monitors-80bebb4401eefe25.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-2eae7cb017027682.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d4b2a0800a66b33.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-e3d7fdfeb7f806f7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-03d9bca3bc5e6088.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-707ed8ca942ca802.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/{[...slug]-259143ed3cf59e31.js → [...slug]-8429f17d4146e1ec.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-193045d9836d8d80.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-d25d07db166cbb04.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks/{[...slug]-5eeec927e4202b63.js → [...slug]-6834ae87bd668cb2.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-fbe9ad995d46d837.js → frontend_dist/_next/static/chunks/pages/platform/global-hooks-b3f7309a23e592b2.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/{profile-fc659962d4015cb3.js → profile-f8b7374385e1f1bf.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-8de68502a9afa299.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-a4f88c334414402b.js → frontend_dist/_next/static/chunks/pages/settings/platform/settings-50fb6a34f3913f1f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-4deb9579ef99a3c6.js → [...slug]-2e5c098c21ea32b7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-e0cda2f2bfce8d61.js → permissions-54e4b15b9585bfc4.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-040f83d75d0f6537.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-910257d16c604ebd.js → [...slug]-95088f43034e3c95.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-4f7a0756806cee34.js → roles-e9149e1fcf218f42.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{sync-data-208d6f955204d704.js → sync-data-75b67ae4a00818ef.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-c89dc67e5a1706a8.js → [...slug]-557dda05ca6c6124.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-fa61dc6c1370e6a5.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{sign-in-054b33312d3193c3.js → sign-in-593c40985d63fcf7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/{[...slug]-b6ed6a5d818bfd20.js → [...slug]-252c4b6b818345d5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{templates-852357bc983af2ea.js → templates-ca528bc607753ab8.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/terminal-1f9c56d671bbc67d.js → frontend_dist/_next/static/chunks/pages/terminal-287362c1defcc96b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-2f83af8c9f1378fe.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-d9de73fb799efed8.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/version-control-ae3469b992a341d6.js → frontend_dist/_next/static/chunks/pages/version-control-573f0225d7a703ed.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/qR0jauUABqPaFMjUsYeoG/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/block-layout.html +3 -3
- mage_ai/server/frontend_dist/compute.html +6 -6
- mage_ai/server/frontend_dist/files.html +6 -6
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +6 -6
- mage_ai/server/frontend_dist/global-data-products.html +6 -6
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist/global-hooks.html +6 -6
- mage_ai/server/frontend_dist/index.html +3 -3
- mage_ai/server/frontend_dist/manage/files.html +6 -6
- mage_ai/server/frontend_dist/manage/overview.html +6 -6
- mage_ai/server/frontend_dist/manage/pipeline-runs.html +6 -6
- mage_ai/server/frontend_dist/manage/settings.html +6 -6
- mage_ai/server/frontend_dist/manage/users/[user].html +6 -6
- mage_ai/server/frontend_dist/manage/users/new.html +6 -6
- mage_ai/server/frontend_dist/manage/users.html +6 -6
- mage_ai/server/frontend_dist/manage.html +6 -6
- mage_ai/server/frontend_dist/oauth.html +5 -5
- mage_ai/server/frontend_dist/overview.html +6 -6
- mage_ai/server/frontend_dist/pipeline-runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist/pipelines.html +6 -6
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist/platform/global-hooks.html +6 -6
- mage_ai/server/frontend_dist/settings/account/profile.html +6 -6
- mage_ai/server/frontend_dist/settings/platform/preferences.html +6 -6
- mage_ai/server/frontend_dist/settings/platform/settings.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/roles.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/users.html +6 -6
- mage_ai/server/frontend_dist/settings.html +3 -3
- mage_ai/server/frontend_dist/sign-in.html +7 -7
- mage_ai/server/frontend_dist/templates/[...slug].html +6 -6
- mage_ai/server/frontend_dist/templates.html +6 -6
- mage_ai/server/frontend_dist/terminal.html +6 -6
- mage_ai/server/frontend_dist/test.html +3 -3
- mage_ai/server/frontend_dist/triggers.html +6 -6
- mage_ai/server/frontend_dist/v2/canvas.html +2 -2
- mage_ai/server/frontend_dist/v2.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/404.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1187-839336d276186105.js → 1187-4560c3895e1d7099.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1598-0adca9dce3ba4c60.js → 1598-cbf3f5a6078fc3f5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-638a944d24d5abde.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-36f746b1824004f2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3763-39a5174f6a3924db.js → 3763-aabe2703076636b0.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-3e2acb5ed45b582b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/449-5e2253c6aba42557.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/5627-d5e559859dd0e1e0.js → frontend_dist_base_path_template/_next/static/chunks/5627-10e76bafa5a26f5f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5699-e49718dfc9eb2854.js → 5699-e99379e332bd0b41.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7966-163da2621b8c987c.js → 7966-a5a7db345ce81263.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-ee5e328aaf51c698.js +2 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/compute-ed67fa8e81662e8b.js → frontend_dist_base_path_template/_next/static/chunks/pages/compute-9e2dea78024e3bb4.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/files-e0ecd7ced09a63b2.js → frontend_dist_base_path_template/_next/static/chunks/pages/files-e08c7fe76f968f9c.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/{[...slug]-c7a729477ecda50e.js → [...slug]-30c3807057a4e65b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-fd6ae6a358a60a0c.js → global-data-products-8dcb3b31af9e0e39.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-8e50243797a7fe59.js → frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-85a64b64d27214b6.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-hooks-d0c003446332dc0d.js → global-hooks-4ff959d51b8a9502.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{files-a69ed8e9f814490c.js → files-d08a460641d0efaa.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{overview-1aad7093c6d39257.js → overview-aae747f487e08d51.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{pipeline-runs-528d30e0d13b0cc7.js → pipeline-runs-09a842d64a6ada62.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{settings-fb9201d9cf63031d.js → settings-2e98e57d9376a458.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/{[user]-000f5a980a07da39.js → [user]-7be6e41ad66089bb.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage/users/new-e4e613f6e817a733.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-4c088833063bfa07.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-5db54821a3059c69.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage-34d718b8a4066c23.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage-868fcd8cbeb265f0.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{oauth-3bfd1b8d7f036726.js → oauth-6ceceb62191dfe8a.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-f65416f6dbe30ad3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{pipeline-runs-5f8c100e648efa8a.js → pipeline-runs-2d0136b51b57de93.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-688c652f3296bb9c.js → [...slug]-1ad5238742e25b4c.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-bd11e87d026bfbf9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{dashboard-1236e36d39b1637d.js → dashboard-0f4f47f721b0723f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-432da20df91511fb.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-fe91dfb0091f6bc6.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-0d68d4bf6290fefb.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-cf794b2d22a80f31.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-9254358d58f07714.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-a964caef91bed9e1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-821001e690caebe2.js → monitors-80bebb4401eefe25.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-2eae7cb017027682.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d4b2a0800a66b33.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-e3d7fdfeb7f806f7.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-03d9bca3bc5e6088.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-707ed8ca942ca802.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/{[...slug]-259143ed3cf59e31.js → [...slug]-8429f17d4146e1ec.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-193045d9836d8d80.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-d25d07db166cbb04.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks/{[...slug]-5eeec927e4202b63.js → [...slug]-6834ae87bd668cb2.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/platform/global-hooks-fbe9ad995d46d837.js → frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-b3f7309a23e592b2.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/{profile-fc659962d4015cb3.js → profile-f8b7374385e1f1bf.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-8de68502a9afa299.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/platform/settings-a4f88c334414402b.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-50fb6a34f3913f1f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-4deb9579ef99a3c6.js → [...slug]-2e5c098c21ea32b7.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-e0cda2f2bfce8d61.js → permissions-54e4b15b9585bfc4.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-040f83d75d0f6537.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-910257d16c604ebd.js → [...slug]-95088f43034e3c95.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-4f7a0756806cee34.js → roles-e9149e1fcf218f42.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{sync-data-208d6f955204d704.js → sync-data-75b67ae4a00818ef.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-c89dc67e5a1706a8.js → [...slug]-557dda05ca6c6124.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-fa61dc6c1370e6a5.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{sign-in-054b33312d3193c3.js → sign-in-593c40985d63fcf7.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/{[...slug]-b6ed6a5d818bfd20.js → [...slug]-252c4b6b818345d5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{templates-852357bc983af2ea.js → templates-ca528bc607753ab8.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/terminal-1f9c56d671bbc67d.js → frontend_dist_base_path_template/_next/static/chunks/pages/terminal-287362c1defcc96b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-2f83af8c9f1378fe.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-d9de73fb799efed8.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/version-control-ae3469b992a341d6.js → frontend_dist_base_path_template/_next/static/chunks/pages/version-control-573f0225d7a703ed.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-12ad70eb5c31aa92.js → webpack-5f4be622608d9267.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/iCySon3_GCldnbC5U7C-s/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/compute.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/files.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/index.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/overview.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/pipeline-runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/oauth.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/overview.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +7 -7
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/templates.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/terminal.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/test.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/triggers.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/v2/canvas.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/v2.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/version-control.html +6 -6
- mage_ai/server/server.py +9 -0
- mage_ai/services/teams/config.py +13 -2
- mage_ai/services/teams/teams.py +13 -11
- mage_ai/settings/server.py +2 -0
- mage_ai/shared/constants.py +3 -1
- mage_ai/shared/enum.py +2 -5
- mage_ai/shared/environments.py +27 -3
- mage_ai/streaming/sinks/elasticsearch.py +15 -5
- mage_ai/tests/api/endpoints/test_blocks.py +1 -101
- mage_ai/tests/api/endpoints/test_configuration_options.py +1 -48
- mage_ai/tests/api/endpoints/test_configuration_options_project_platform.py +68 -0
- mage_ai/tests/api/endpoints/test_custom_designs.py +1 -106
- mage_ai/tests/api/endpoints/test_custom_designs_project_platform.py +132 -0
- mage_ai/tests/api/endpoints/test_dbt_blocks.py +111 -0
- mage_ai/tests/api/endpoints/test_file_contents.py +0 -48
- mage_ai/tests/api/endpoints/test_file_contents_with_project_platform.py +66 -0
- mage_ai/tests/api/endpoints/test_pipelines.py +0 -134
- mage_ai/tests/api/endpoints/test_pipelines_with_project_platform.py +143 -0
- mage_ai/tests/data_preparation/models/block/dynamic/test_counter.py +1 -3
- mage_ai/tests/data_preparation/models/block/hook/test_hook_block.py +3 -3
- mage_ai/tests/data_preparation/models/test_block.py +7 -0
- mage_ai/tests/data_preparation/test_repo_manager.py +0 -63
- mage_ai/tests/data_preparation/test_repo_manager_project_platform.py +67 -0
- mage_ai/tests/data_preparation/test_variable_manager.py +0 -51
- mage_ai/tests/data_preparation/test_variable_manager_project_platform.py +41 -0
- mage_ai/tests/io/create_table/test_postgresql.py +27 -0
- mage_ai/tests/orchestration/notification/test_config.py +3 -3
- mage_ai/usage_statistics/logger.py +99 -15
- mage_ai-0.9.76.dist-info/METADATA +393 -0
- {mage_ai-0.9.74.dist-info → mage_ai-0.9.76.dist-info}/RECORD +331 -322
- {mage_ai-0.9.74.dist-info → mage_ai-0.9.76.dist-info}/WHEEL +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1557-1ad0c64c2d08e569.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2717-d65056b6b5e124eb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3548-b2c5edfb710886a6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3782-4b3091e550f809a2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-5bdff745074fb350.js +0 -2
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-a5e9d77ed5b50205.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-69af3253ad0d0d89.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-fe112809feb25b05.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-e9ca358209cdf93d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-a29f1615d2e7d330.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-6d382ae5bad9745c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-cd49372ae1702963.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-135be8974f7f5f2b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-3af13e89adff4d6c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-b578b075a8d857e3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-058d283ee178c038.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-7b02bb70462144cb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-5212c01a9dc558da.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-86b12cc12d4a625f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-2481c40b18d5b6d4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/pLWT6Sqd09xYpufCVIqnz/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/JQewSAObpbhO0wrdAM6Ng/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-1ad0c64c2d08e569.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-d65056b6b5e124eb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-b2c5edfb710886a6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-4b3091e550f809a2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-90de19bc03f1484b.js +0 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-a5e9d77ed5b50205.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-69af3253ad0d0d89.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-fe112809feb25b05.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-e9ca358209cdf93d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-a29f1615d2e7d330.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-6d382ae5bad9745c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-cd49372ae1702963.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-135be8974f7f5f2b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-3af13e89adff4d6c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-b578b075a8d857e3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-058d283ee178c038.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-7b02bb70462144cb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-5212c01a9dc558da.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-86b12cc12d4a625f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-2481c40b18d5b6d4.js +0 -1
- mage_ai-0.9.74.dist-info/METADATA +0 -544
- /mage_ai/server/frontend_dist/_next/static/chunks/pages/{_app-5bdff745074fb350.js.LICENSE.txt → _app-782dd4a6b13e1c42.js.LICENSE.txt} +0 -0
- /mage_ai/server/frontend_dist/_next/static/{pLWT6Sqd09xYpufCVIqnz → qR0jauUABqPaFMjUsYeoG}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{_app-90de19bc03f1484b.js.LICENSE.txt → _app-ee5e328aaf51c698.js.LICENSE.txt} +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{JQewSAObpbhO0wrdAM6Ng → iCySon3_GCldnbC5U7C-s}/_ssgManifest.js +0 -0
- {mage_ai-0.9.74.dist-info → mage_ai-0.9.76.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.74.dist-info → mage_ai-0.9.76.dist-info/licenses}/LICENSE +0 -0
- {mage_ai-0.9.74.dist-info → mage_ai-0.9.76.dist-info}/top_level.txt +0 -0
mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-432da20df91511fb.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551],{53779:function(e,n,t){"use strict";t.d(n,{C:function(){return h},X$:function(){return f},eD:function(){return d}});var i=t(9518),r=t(44897),l=t(42631),o=t(70515),u=t(47041),c=t(91437),s=6.25*o.iI,a=100*o.iI,d=i.default.div.withConfig({displayName:"indexstyle__WindowContainerStyle",componentId:"sc-g0cszf-0"})(["border-radius:","px;width:100%;max-width:","px;z-index:101;position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);",""],l.n_,a,(function(e){return"\n box-shadow: ".concat((e.theme||r.Z).shadow.window,";\n background-color: ").concat((e.theme||r.Z).background.panel,";\n ")})),p=(0,i.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],s,o.iI,o.cd*o.iI,(function(e){return"\n background-color: ".concat((e.theme||r.Z).background.output,";\n ")})),f=i.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],p,l.n_,l.n_,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium,";\n ")})),h=i.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],o.iI,u.w5,(0,c.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*o.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*s,"px);\n ")}))},72226:function(e,n,t){"use strict";var i=t(82394),r=t(38276),l=t(75499),o=t(30160),u=t(17488),c=t(70515),s=t(28598);function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,a=e.setObjectAttributes;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.Z,{mb:1,px:c.cd,children:[(0,s.jsx)(o.ZP,{bold:!0,children:"Outdated after"}),(0,s.jsx)(o.ZP,{muted:!0,small:!0,children:"After the global data product successfully completes running, how long after that will the global data product be outdated?"})]}),(0,s.jsx)(l.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"seconds"},{uuid:"weeks"},{uuid:"months"},{uuid:"years"}].map((function(e){var r,l,c=e.uuid,p=null==n||null===(r=n.outdated_after)||void 0===r?void 0:r[c],f=null==t||null===(l=t.outdated_after)||void 0===l?void 0:l[c];return[(0,s.jsxs)(o.ZP,{default:!0,monospace:!0,children:[c," ",f&&(0,s.jsxs)(o.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",f,")"]})]},"label-".concat(c)),(0,s.jsx)(u.Z,{compact:!0,monospace:!0,onChange:function(e){return a((function(n){var t;return d(d({},n),{},{outdated_after:d(d({},null==n?void 0:n.outdated_after),{},(0,i.Z)({},c,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},placeholder:"Enter a number",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:null==p?"":p},"input-".concat(c))]}))})]})}},29644:function(e,n,t){"use strict";var i=t(82394),r=t(44085),l=t(38276),o=t(75499),u=t(30160),c=t(17488),s=t(70515),a=t(81728),d=t(86735),p=t(28598);function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,f=e.setObjectAttributes;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(l.Z,{mb:1,px:s.cd,children:[(0,p.jsxs)(u.ZP,{bold:!0,children:["Outdated starting at ",(0,p.jsx)(u.ZP,{inline:!0,muted:!0,children:"(optional)"})]}),(0,p.jsx)(u.ZP,{muted:!0,small:!0,children:"If enough time has passed since the last global data product has ran successfully and the global data product is determined to be outdated, then you can configure it to be outdated at a specific date or time."}),(0,p.jsx)("div",{style:{marginTop:4},children:(0,p.jsxs)(u.ZP,{muted:!0,small:!0,children:["For example, let’s say the global data product is outdated after 12 hours. The last successful run was yesterday at 18:00. The global data product will be outdated today at 06:00. However, if the ",(0,p.jsx)(u.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Outdated starting at"})," has a value of 17 for ",(0,p.jsx)(u.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Hour of day"}),", then the global data product won’t run again until today at 17:00."]})})]}),(0,p.jsx)(o.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"second_of_minute",values:(0,d.w6)(60).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"minute_of_hour",values:(0,d.w6)(60).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"hour_of_day",values:(0,d.w6)(24).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"day_of_week",values:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].map((function(e,n){return{uuid:e,value:n}}))},{uuid:"day_of_month",values:(0,d.w6)(31).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"day_of_year",values:(0,d.w6)(365).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"week_of_month",values:(0,d.w6)(5).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"week_of_year",values:(0,d.w6)(52).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"month_of_year",values:["January","February","March","April","May","June","July","August","September","October","November","December"].map((function(e,n){return{uuid:e,value:n+1}}))}].map((function(e){var l,o,s,d=e.uuid,v=e.values,m=null==n||null===(l=n.outdated_starting_at)||void 0===l?void 0:l[d],g=null==t||null===(o=t.outdated_starting_at)||void 0===o?void 0:o[d],b={compact:!0,key:"outdated-starting-at-input-".concat(d),monospace:!0,onChange:function(e){return f((function(n){var t;return h(h({},n),{},{outdated_starting_at:h(h({},null==n?void 0:n.outdated_starting_at),{},(0,i.Z)({},d,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},primary:!0,small:!0,value:null==m?"":m};return s=v?(0,p.jsx)(r.Z,h(h({},b),{},{placeholder:"Select a value",children:v.map((function(e){var n=e.uuid,t=e.value;return(0,p.jsx)("option",{value:t,children:n},t)}))})):(0,p.jsx)(c.Z,h(h({},b),{},{placeholder:"Enter a number",setContentOnMount:!0,type:"number"})),[(0,p.jsxs)(u.ZP,{default:!0,monospace:!0,children:[(0,a.vg)(d)," ",g&&(0,p.jsxs)(u.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"outdated-starting-at-label-".concat(d)),s]}))})]})}},46209:function(e,n,t){"use strict";var i=t(82394),r=t(12691),l=t.n(r),o=t(70652),u=t(48670),c=t(38276),s=t(75499),a=t(30160),d=t(17488),p=t(70515),f=t(28598);function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?h(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.blocks,t=e.objectAttributes,r=e.originalAttributes,h=e.setObjectAttributes;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(c.Z,{mb:1,px:p.cd,children:[(0,f.jsx)(a.ZP,{bold:!0,children:"Block data to output"}),(0,f.jsx)(a.ZP,{muted:!0,small:!0,children:"The data output from the block(s) you select below will be the data product that is returned when a downstream entity is requesting data from this global data product."}),(0,f.jsx)("div",{style:{marginTop:4},children:(0,f.jsx)(a.ZP,{muted:!0,small:!0,children:"When requesting data from this global data product, the selected block(s) will return data from its most recent partition. You can override this by adding a value in the partitions setting. For example, if you set the partitions value to 5, then the selected block will return data from its 5 most recent partitions. If you set the partitions value to 0, then all the partitions will be returned."})})]}),(0,f.jsx)(s.Z,{columnFlex:[null,1,null],columns:[{label:function(){return""},uuid:"selected"},{uuid:"Block UUID"},{uuid:"Partitions"}],rows:null==n?void 0:n.map((function(e){var n,c=e.uuid,s=null==t?void 0:t.settings,p=null==s?void 0:s[c],m=null==p?void 0:p.partitions,g=null==r||null===(n=r.settings)||void 0===n?void 0:n[c],b=null==g?void 0:g.partitions,x=!!p||!!g;return[(0,f.jsx)(o.Z,{checked:x,onClick:function(){return function(e){h((function(n){var t=(null==n?void 0:n.settings)||{};return e?t[c]={}:null==t||delete t[c],v(v({},n),{},{settings:t})}))}(!x)}},"selected--".concat(c)),(0,f.jsxs)("div",{children:[(0,f.jsx)(l(),{as:"/pipelines/".concat(null==t?void 0:t.object_uuid,"/edit?block_uuid=").concat(c),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,f.jsx)(u.Z,{monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:c})})," ",b&&(0,f.jsxs)(a.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"block-uuid-".concat(c)),(0,f.jsx)(d.Z,{compact:!0,monospace:!0,onChange:function(e){return h((function(n){var t,r;return v(v({},n),{},{settings:v(v({},null==n?void 0:n.settings),{},(0,i.Z)({},c,v(v({},null==n||null===(t=n.settings)||void 0===t?void 0:t[c]),{},{partitions:0===(null===(r=e.target.value)||void 0===r?void 0:r.length)?null:Number(e.target.value)})))})}))},placeholder:"1",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:null==m?"":m},"input-".concat(c))]}))})]})}},67355:function(e,n,t){"use strict";var i=t(12691),r=t.n(i),l=t(82684),o=t(34376),u=t(8666),c=t(48670),s=t(38276),a=t(4190),d=t(75499),p=t(30160),f=t(35686),h=t(70515),v=t(95924),m=t(28598);n.Z=function(e){var n=e.globalDataProducts,t=e.onClickRow,i=(0,o.useRouter)(),g=f.ZP.global_data_products.list({},{},{pauseFetch:!!n}).data,b=(0,l.useMemo)((function(){return n||(null==g?void 0:g.global_data_products)||[]}),[g,n]);return g||n?g&&0===(null==b?void 0:b.length)?(0,m.jsx)(s.Z,{p:h.cd,children:(0,m.jsx)(p.ZP,{children:"There are currently no global data products registered."})}):(0,m.jsx)(d.Z,{columnFlex:[null,null,null,null],columns:[{uuid:"UUID"},{uuid:"Object type"},{uuid:"Object UUID"},{uuid:"Project"}],onClickRow:function(e){var n=null==b?void 0:b[e];n&&(t?null==t||t(n):i.push("/global-data-products/[...slug]","/global-data-products".concat(null!=n&&n.project?"/"+(null==n?void 0:n.project):"","/").concat(null==n?void 0:n.uuid)))},rows:null==b?void 0:b.map((function(e){var n=e.object_type,t=e.object_uuid,l=e.project,o=e.uuid,s={as:null,href:null};return u.b.PIPELINE===n&&(s.as="/pipelines/".concat(t,"/edit"),s.href="/pipelines/[pipeline]/edit"),[(0,m.jsx)(p.ZP,{monospace:!0,children:o},"uuid"),(0,m.jsx)(p.ZP,{default:!0,monospace:!0,children:n},"objectType"),(0,m.jsx)(r(),{as:null==s?void 0:s.as,href:(null==s?void 0:s.href)||"",passHref:!0,children:(0,m.jsx)(c.Z,{default:!0,monospace:!0,onClick:function(e){(0,v.j)(e),i.push(s.href,s.as)},preventDefault:!0,children:t})},"objectUUID"),(0,m.jsx)(p.ZP,{default:!0,monospace:!0,children:l},"project")]})),uuid:"global-data-products"}):(0,m.jsx)(s.Z,{p:h.cd,children:(0,m.jsx)(a.Z,{})})}},29480:function(e,n,t){"use strict";t.d(n,{$W:function(){return a},cl:function(){return d},cv:function(){return p},dE:function(){return c},zG:function(){return s}});var i=t(9518),r=t(44897),l=t(42631),o=t(70515),u=t(47041),c=i.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-7a1uhf-0"})(["border-radius:","px;padding:","px;",""],l.n_,o.cd*o.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).popup,";\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__DocsStyle",componentId:"sc-7a1uhf-1"})(["> div{overflow:initial;}> div img{max-width:80%;background:white;padding:1rem;max-height:20vh;}"]),a=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-2"})(["padding-top:","px;",""],o.cd*o.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).codeTextarea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-3"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],u.w5,(function(e){return e.hideHorizontalScrollbar&&"\n overflow-x: hidden;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,";\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")})),p=i.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-4"})(["padding:","px;"," "," ",""],2*o.iI,(function(e){return"\n background-color: ".concat((e.theme||r.Z).interactive.defaultBackground,";\n border-bottom: ").concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium,";\n ")}),(function(e){return e.padding&&"\n padding: ".concat(e.padding,"px;\n ")}),(function(e){return e.rounded&&"\n border-top-left-radius: ".concat(l.n_,"px;\n border-top-right-radius: ").concat(l.n_,"px;\n ")}))},28795:function(e,n,t){"use strict";var i;t.d(n,{B:function(){return r},M:function(){return i}}),function(e){e.BACKFILLS="backfills",e.BLOCK_RUNS="block_runs",e.DASHBOARD="dashboard",e.EDIT="edit",e.MONITOR="monitor",e.PIPELINE_LOGS="pipeline_logs",e.PIPELINE_RUNS="pipeline_runs",e.RUNS="runs",e.SETTINGS="settings",e.SYNCS="syncs",e.TRIGGERS="triggers"}(i||(i={}));var r="cancel_all_running_pipeline_runs"},85010:function(e,n,t){"use strict";t.d(n,{H:function(){return o}});var i=t(57653),r=t(72473),l=t(28795);function o(e,n,t){var o=(n||{}).uuid||t,u=[{Icon:r.Lightning,id:l.M.TRIGGERS,isSelected:function(){return l.M.TRIGGERS===e},label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(o,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{Icon:r.Schedule,id:l.M.RUNS,isSelected:function(){return l.M.RUNS===e},label:function(){return"Runs"},linkProps:{as:"/pipelines/".concat(o,"/runs"),href:"/pipelines/[pipeline]/runs"}},{Icon:r.Logs,id:l.M.PIPELINE_LOGS,isSelected:function(){return l.M.PIPELINE_LOGS===e},label:function(){return"Logs"},linkProps:{as:"/pipelines/".concat(o,"/logs"),href:"/pipelines/[pipeline]/logs"}},{Icon:r.Monitor,id:l.M.MONITOR,isSelected:function(){return l.M.MONITOR===e},label:function(){return"Monitor"},linkProps:{as:"/pipelines/".concat(o,"/monitors"),href:"/pipelines/[pipeline]/monitors"}}];return i.qL.PYTHON===(null==n?void 0:n.type)&&u.splice(2,0,{Icon:r.BackfillV2,id:l.M.BACKFILLS,isSelected:function(){return l.M.BACKFILLS===e},label:function(){return"Backfills"},linkProps:{as:"/pipelines/".concat(o,"/backfills"),href:"/pipelines/[pipeline]/backfills"}}),i.qL.INTEGRATION===(null==n?void 0:n.type)&&u.unshift({Icon:r.PipeIcon,id:l.M.SYNCS,isSelected:function(){return l.M.SYNCS===e},label:function(){return"Syncs"},linkProps:{as:"/pipelines/".concat(o,"/syncs"),href:"/pipelines/[pipeline]/syncs"}}),u.unshift({Icon:r.Code,disabled:!o,id:l.M.EDIT,isSelected:function(){return l.M.EDIT===e},label:function(){return"Edit pipeline"},linkProps:{as:"/pipelines/".concat(o,"/edit"),href:"/pipelines/[pipeline]/edit"}}),u.push({Icon:r.SettingsWithKnobs,id:l.M.SETTINGS,isSelected:function(){return l.M.SETTINGS===e},label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(o,"/settings"),href:"/pipelines/[pipeline]/settings"}}),u}},79264:function(e,n,t){"use strict";var i=t(82394),r=t(75582),l=t(82684),o=t(21764),u=t(46568),c=t(97618),s=t(68562),a=t(82682),d=t(30160),p=t(17488),f=t(36300),h=t(72473),v=t(31748),m=t(79633),g=t(70515),b=t(72619),x=t(33834),j=t(83455),k=t(35686),Z=t(28598);n.Z=function(e){var n=e.copyText,t=e.deleteVariable,y=e.disableKeyEdit,P=e.editStateInit,C=void 0!==P&&P,O=e.fetchVariables,w=e.focusKey,_=e.hideEdit,S=e.obfuscate,I=e.onEnterCallback,E=e.onEscapeCallback,T=e.pipelineUUID,M=e.updateVariable,B=e.variable||{},D=B.uuid,A=B.value,R=(0,l.useRef)(null),N=(0,l.useRef)(null),L=(0,l.useState)(!1),F=L[0],U=L[1],H=(0,l.useState)(D),W=H[0],G=H[1],K=(0,l.useState)(A),z=K[0],q=K[1],V=(0,l.useState)(C),Y=V[0],X=V[1],Q=(0,j.Db)(k.ZP.variables.pipelines.useUpdate(T,D),{onSuccess:function(e){return(0,b.wD)(e,{callback:function(){X(!1),O()}})}}),J=(0,r.Z)(Q,1)[0],$=(0,l.useCallback)((function(e){if("Enter"===e.key){var n=z;try{n=JSON.parse(z)}catch(e){}M?W&&z&&(null==M||M((0,i.Z)({},W,z)),X(!1)):J({variable:{name:W,value:n}}),(0,x.ez)(),null==I||I()}else"Escape"===e.key&&((0,x.ez)(),X(!1),null==E||E())}),[I,E,M,J,W,z]),ee=(0,l.useCallback)((function(){(0,x.ez)(),t()}),[t]);(0,l.useEffect)((function(){var e,n;Y&&(w?null==R||null===(e=R.current)||void 0===e||e.focus():null==N||null===(n=N.current)||void 0===n||n.focus())}),[Y,w]);var ne=n||"kwargs['".concat(D,"']");return(0,Z.jsx)("div",{onMouseEnter:function(){return U(!0)},onMouseLeave:function(){return U(!1)},children:(0,Z.jsxs)(a.Z,{children:[(0,Z.jsx)(u.Z,{hiddenSmDown:!0,md:1,children:(0,Z.jsx)(f.qZ,{noPadding:!0,children:(0,Z.jsx)(s.ZP,{backgroundColor:v.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(ne),o.Am.success("Successfully copied to clipboard.",{position:o.Am.POSITION.BOTTOM_RIGHT,toastId:D})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(D),withIcon:!0,children:(0,Z.jsx)(h.Copy,{size:2.5*g.iI})})})}),(0,Z.jsx)(u.Z,{md:S?9:4,children:Y&&!y?(0,Z.jsx)(f.qZ,{children:(0,Z.jsx)(p.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){G(e.target.value),e.preventDefault()},onKeyDown:$,paddingHorizontal:0,placeholder:"variable",ref:R,small:!0,value:W})}):(0,Z.jsx)(f.qZ,{children:(0,Z.jsx)(d.ZP,{color:m.Or,monospace:!0,small:!0,title:D,children:D})})}),(0,Z.jsx)(u.Z,{md:S?2:7,children:Y?(0,Z.jsx)(f.qZ,{children:(0,Z.jsx)(p.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){q(e.target.value),e.preventDefault()},onKeyDown:$,paddingHorizontal:0,placeholder:"enter value",ref:N,small:!0,value:z})}):(0,Z.jsxs)(f.qZ,{children:[S?(0,Z.jsx)(d.ZP,{monospace:!0,small:!0,children:F?"*":"*******"}):(0,Z.jsx)(d.ZP,{monospace:!0,small:!0,title:A.toString(),children:A.toString()}),(0,Z.jsxs)(c.Z,{children:[!_&&F&&(0,Z.jsx)(s.ZP,{backgroundColor:v.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){X(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(D),withIcon:!0,children:(0,Z.jsx)(h.Edit,{size:2.5*g.iI})}),t&&F&&(0,Z.jsx)(s.ZP,{backgroundColor:v.qJ,borderless:!0,inline:!0,muted:!0,onClick:ee,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(D),withIcon:!0,children:(0,Z.jsx)(h.Trash,{size:2.5*g.iI})})]})]})})]})})}},36300:function(e,n,t){"use strict";t.d(n,{kA:function(){return s},qZ:function(){return a}});var i=t(9518),r=t(2842),l=t(4982),o=t(61896),u=t(47041),c=t(70515),s=(c.iI,l.O$,c.iI,o.dN,i.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],r.Wi,u.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),i.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*c.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),i.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),a=i.default.td.withConfig({displayName:"indexstyle__CellStyle",componentId:"sc-cr39lf-3"})(["display:flex;align-items:center;justify-content:space-between;border:1px solid #1C1C1C;height:100%;",""],(function(e){return!e.noPadding&&"\n padding: 0 ".concat(2*c.iI,"px;\n ")}))},66909:function(e,n,t){"use strict";t.d(n,{Eh:function(){return s},t0:function(){return a}});var i=t(9518),r=t(2842),l=t(4982),o=t(61896),u=t(47041),c=t(70515),s=(c.iI,l.O$+3*c.iI+o.dN),a=i.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-15ofupc-0"})([""," overflow:auto;position:absolute;width:100%;"," ",""],u.w5,(function(e){return"\n height: calc(100vh - ".concat(r.uX,"px - ").concat(e.heightOffset,"px);\n ")}),(function(e){return e.overflowHidden&&"\n overflow: hidden;\n "}));i.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-15ofupc-1"})(["padding:","px;",""],2*c.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}))},8916:function(e,n,t){"use strict";t.d(n,{FS:function(){return s},JZ:function(){return p},Tt:function(){return d},e7:function(){return f},wx:function(){return a}});var i=t(75582),r=t(82394),l=t(83784),o=t(30229);function u(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e){return"string"==typeof e?e:JSON.stringify(e)}function a(e,n){var t,i;return null==e||null===(t=e.find((function(e){var t=e.block;return n(t)})))||void 0===t||null===(i=t.variables)||void 0===i?void 0:i.map((function(e){var n=e.value;return c(c({},e),{},{value:s(n)})}))}function d(e){var n;return null===(n=a(e,(function(e){return e.uuid===l.C})))||void 0===n?void 0:n.reduce((function(e,n){var t=n.uuid,i=n.value;return c(c({},e),{},(0,r.Z)({},t,i))}),{})}function p(e,n){return n===o.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===o.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function f(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,i.Z)(n,2),l=t[0],o=t[1],u=o;try{u=JSON.parse(o)}catch(e){}return c(c({},e),{},(0,r.Z)({},l,u))}),{}):e}},46568:function(e,n,t){"use strict";var i=t(82394),r=t(26304),l=(t(82684),t(33591)),o=t(28598),u=["children","fullHeight","gutter","style"];function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,c=e.style,a=void 0===c?{}:c,d=(0,r.Z)(e,u),p=s({},a);return i&&(p.paddingLeft=i,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,o.jsx)(l.Col,s(s({},d),{},{style:p,children:n}))}},82682:function(e,n,t){"use strict";var i=t(82394),r=t(26304),l=t(82684),o=t(33591),u=t(28598),c=["children","fullHeight","gutter","justifyContent","style"];function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,s=e.justifyContent,d=e.style,p=void 0===d?{}:d,f=(0,r.Z)(e,c),h=a({},p);return i&&(h.marginLeft=-1*i,h.marginRight=h.marginLeft),t&&(h.height="100%"),(0,u.jsx)(o.Row,a(a({},f),{},{justifyContent:s,style:h,children:l.Children.map(n,(function(e,n){return e&&l.cloneElement(e,{gutter:i,key:n})}))}))}},68781:function(e,n,t){"use strict";var i;t.d(n,{R:function(){return r}}),function(e){e.AZURE_CONTAINER_INSTANCE="azure_container_instance",e.ECS="ecs",e.GCP_CLOUD_RUN="gcp_cloud_run",e.K8S="k8s",e.LOCAL_PYTHON="local_python",e.PYSPARK="pyspark"}(i||(i={}));var r=[i.AZURE_CONTAINER_INSTANCE,i.ECS,i.GCP_CLOUD_RUN,i.K8S,i.LOCAL_PYTHON,i.PYSPARK]},8666:function(e,n,t){"use strict";var i;t.d(n,{b:function(){return i}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(i||(i={}))},14466:function(e,n,t){"use strict";t.d(n,{Ij:function(){return l},N_:function(){return v},SQ:function(){return o},TT:function(){return u},W6:function(){return p},XG:function(){return a},YB:function(){return s},i9:function(){return h},sw:function(){return c},t4:function(){return d}});var i,r,l,o,u,c,s,a,d,p,f=t(82394);!function(e){e.CREATE="create",e.DELETE="delete",e.DETAIL="detail",e.EXECUTE="execute",e.LIST="list",e.UPDATE="update",e.UPDATE_ANYWHERE="update_anywhere"}(r||(r={})),function(e){e.BREAK="break",e.CONTINUE="continue",e.RAISE="raise"}(l||(l={})),function(e){e.AFTER="after",e.BEFORE="before"}(o||(o={})),function(e){e.ERROR="error",e.META="meta",e.METADATA="metadata",e.PAYLOAD="payload",e.QUERY="query",e.RESOURCE="resource",e.RESOURCES="resources"}(u||(u={})),function(e){e.FAILURE="failure",e.SUCCESS="success"}(c||(c={})),function(e){e.AND="and",e.OR="or"}(s||(s={})),function(e){e.ERROR="error",e.HOOK="hook",e.META="meta",e.METADATA="metadata",e.OPERATION_RESOURCE="operation_resource",e.PAYLOAD="payload",e.QUERY="query",e.RESOURCE="resource",e.RESOURCES="resources",e.RESOURCE_ID="resource_id",e.RESOURCE_PARENT="resource_parent",e.RESOURCE_PARENT_ID="resource_parent_id",e.RESOURCE_PARENT_TYPE="resource_parent_type",e.USER="user"}(a||(a={})),function(e){e.BOOLEAN="BOOLEAN",e.DICTIONARY="DICTIONARY",e.FLOAT="FLOAT",e.INTEGER="INTEGER",e.LIST="LIST",e.STRING="STRING"}(d||(d={})),function(e){e.EQUALS="EQUALS",e.GREATER_THAN="GREATER_THAN",e.GREATER_THAN_OR_EQUALS="GREATER_THAN_OR_EQUALS",e.INCLUDES="INCLUDES",e.LESS_THAN="LESS_THAN",e.LESS_THAN_OR_EQUALS="LESS_THAN_OR_EQUALS",e.NOT_EQUALS="NOT_EQUALS",e.NOT_INCLUDES="NOT_INCLUDES",e.NOT_PRESENT="NOT_PRESENT",e.PRESENT="PRESENT"}(p||(p={}));var h=[p.NOT_PRESENT,p.PRESENT],v=(i={},(0,f.Z)(i,p.EQUALS,"=="),(0,f.Z)(i,p.GREATER_THAN,">"),(0,f.Z)(i,p.GREATER_THAN_OR_EQUALS,">="),(0,f.Z)(i,p.INCLUDES,"includes"),(0,f.Z)(i,p.LESS_THAN,"<"),(0,f.Z)(i,p.LESS_THAN_OR_EQUALS,"<="),(0,f.Z)(i,p.NOT_EQUALS,"!="),(0,f.Z)(i,p.NOT_INCLUDES,"not includes"),(0,f.Z)(i,p.NOT_PRESENT,"is not present"),(0,f.Z)(i,p.PRESENT,"is present"),i)},83784:function(e,n,t){"use strict";t.d(n,{C:function(){return i}});var i="global"},9134:function(e,n,t){"use strict";var i=t(82684),r=t(20433),l=t(31811),o=t(9518),u=t(65292),c=t(44897),s=t(95363),a=t(70515),d=t(28598);n.Z=function(e){var n=e.language,t=e.maxWidth,p=e.showLineNumbers,f=e.small,h=e.source,v=e.wrapLines,m=(0,i.useContext)(o.ThemeContext);function g(e){var i=e.value;return(0,d.jsx)(l.Z,{customStyle:{backgroundColor:(m.background||c.Z.background).popup,border:"none",borderRadius:"none",boxShadow:"none",fontFamily:s.Vp,fontSize:f?12:14,marginBottom:0,marginTop:0,maxWidth:t,paddingBottom:2*a.iI,paddingTop:2*a.iI},language:n,lineNumberStyle:{color:(m.content||c.Z.content).muted},showLineNumbers:p,style:u._4,useInlineStyles:!0,wrapLines:v,children:i})}return(0,d.jsx)(r.D,{components:{code:function(e){var n=e.children;return(0,d.jsx)(g,{value:n})}},children:h})}},11074:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(9518),r=t(44897),l=t(42631),o=i.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;"," ",""],l.n_,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),u=t(28598);var c=function(e){var n=e.children,t=e.fullWidth,i=void 0===t||t;return(0,u.jsx)(o,{fullWidth:i,children:n})}},96348:function(e,n,t){"use strict";t.d(n,{g:function(){return g},Z:function(){return b}});var i=t(82684),r=t(9518),l=t(44897),o=t(42631),u=t(47041),c=t(70515),s=1.5*c.iI,a=1.5*c.iI,d=r.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-13p7y8j-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," ",""],o.n_,(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme||l.Z).background.page,";\n border: ").concat(o.YF,"px ").concat(o.M8," ").concat((e.theme||l.Z).interactive.defaultBorder,";\n box-shadow: ").concat((e.theme||l.Z).shadow.frame,";\n ")}),(function(e){return e.noBackground&&"\n background-color: transparent;\n "}),(function(e){return e.noBoxShadow&&"\n box-shadow: none;\n "})),p=r.default.div.withConfig({displayName:"indexstyle__RowContainerStyle",componentId:"sc-13p7y8j-1"})(["overflow:auto;border-bottom-left-radius:","px;border-bottom-right-radius:","px;"," "," "," ",""],o.n_,o.n_,u.w5,(function(e){return e.maxHeight>0&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),(function(e){return e.minHeight>0&&"\n min-height: ".concat(e.minHeight,"px;\n ")}),(function(e){return e.scrollable&&"\n margin-bottom: ".concat(c.iI,"px;\n overflow-y: auto;\n padding-top: ").concat(3,"px;\n padding-left: ").concat(3,"px;\n padding-right: ").concat(3,"px;\n ")})),f=r.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-13p7y8j-2"})(["border-top-left-radius:","px;border-top-right-radius:","px;padding:","px ","px;",""],o.n_,o.n_,s,2*c.iI,(function(e){return"\n border-bottom: ".concat(o.YF,"px ").concat(o.M8," ").concat((e.theme.interactive||l.Z.interactive).defaultBorder,";\n ")})),h=r.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-13p7y8j-3"})(["padding:","px ","px;"," "," "," "," "," ",""],a,2*c.iI,(function(e){return"\n border-bottom: ".concat(o.YF,"px ").concat(o.M8," ").concat((e.theme||l.Z).borders.medium2,";\n ")}),(function(e){return e.sameColorBorders&&"\n border-bottom-color: ".concat((e.theme||l.Z).interactive.defaultBorder,";\n ")}),(function(e){return e.noHorizontalPadding&&"\n padding-left: 0;\n padding-right: 0;\n "}),(function(e){return e.condensed&&"\n padding-top: ".concat(9,"px;\n padding-bottom: ").concat(9,"px;\n ")}),(function(e){return e.secondary&&"\n background-color: ".concat((e.theme.background||l.Z.background).row2,";\n ")}),(function(e){return e.last&&e.noBorder&&"\n border-bottom-left-radius: ".concat(o.n_,"px;\n border-bottom-right-radius: ").concat(o.n_,"px;\n border-bottom: none;\n ")})),v=r.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-13p7y8j-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;padding:","px ","px;",""],o.n_,o.n_,s,2*c.iI,(function(e){return"\n border-top: ".concat(o.YF,"px ").concat(o.M8," ").concat((e.theme||l.Z).borders.medium2,";\n ")})),m=t(28598),g=h;var b=function(e){var n=e.alternating,t=e.children,r=e.footer,l=e.header,o=e.maxHeight,u=e.minHeight,c=e.noBackground,s=e.noBoxShadow,a=e.sameColorBorders,h=e.scrollable,g=e.width,b=[].concat(t).filter((function(e){return null!==e}));return(0,m.jsxs)(d,{noBackground:c,noBoxShadow:s,width:g,children:[l&&(0,m.jsx)(f,{children:l}),(0,m.jsx)(p,{maxHeight:o,minHeight:u,scrollable:h,children:i.Children.map(b,(function(e,t){return e&&i.cloneElement(e,{last:t===b.length-1,sameColorBorders:a,secondary:n&&t%2==1})}))}),r&&(0,m.jsx)(v,{children:r})]})}},10946:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Oo}});var i=t(77837),r=t(21831),l=t(75582),o=t(82394),u=t(38860),c=t.n(u),s=t(92083),a=t.n(s),d=t(56085),p=t(9518),f=t(82684),h=t(83455),v=t(34376),m=t(65557),g=t(40761),b=t(44425),x=t(70652),j=t(39867),k=t(15338),Z=t(97618),y=t(55485),P=t(48670),C=t(38276),O=t(30160),w=t(70515),_=t(55283),S=t(28598);function I(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function E(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?I(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):I(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var T=function(e){var n=e.blockRefs,t=e.hiddenBlocks,i=e.pipeline,r=e.setHiddenBlocks,l=(0,f.useContext)(p.ThemeContext),u=(0,f.useMemo)((function(){return(null==i?void 0:i.blocks)||[]}),[i]),c=(0,f.useMemo)((function(){var e=[],n=[];return u.forEach((function(i){var r=i.uuid;null!=t&&t[r]?e.push(i):n.push(i)})),{blocksHidden:e,blocksVisible:n}}),[u,t]),s=c.blocksHidden,a=c.blocksVisible,d=(0,f.useMemo)((function(){return(null==u?void 0:u.length)>=1&&0===a.length}),[u,a]),h=(0,f.useMemo)((function(){return(null==u?void 0:u.length)>=1&&0===s.length}),[u,s]),v=(0,f.useCallback)((function(e){var t=e.type,i=e.uuid;if(null!=n&&n.current){var r,l=n.current["".concat(t,"s/").concat(i,".py")];null==l||null===(r=l.current)||void 0===r||r.scrollIntoView()}}),[n]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{p:1,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(x.Z,{checked:h,onClick:function(){return r((function(){return{}}))}}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{noWrapping:!0,children:"Show all"})]}),(0,S.jsx)(C.Z,{mb:1}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(x.Z,{checked:d,onClick:function(){return r((function(){return u.reduce((function(e,n){var t=n.uuid;return E(E({},e),{},(0,o.Z)({},t,!0))}),{})}))}}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{noWrapping:!0,children:"Hide all"})]})]}),(0,S.jsx)(k.Z,{medium:!0}),null==u?void 0:u.map((function(e){var n=e.uuid,i=(0,_.qn)(e.type,{blockColor:e.color,theme:l}).accent,u=!(null!=t&&t[n]);return(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){r((function(e){return E(E({},e),{},(0,o.Z)({},n,u))})),u||setTimeout((function(){return v(e)}),1)},preventDefault:!0,children:(0,S.jsx)(C.Z,{mt:1,px:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(C.Z,{pr:1,children:(0,S.jsx)(x.Z,{checked:u})}),(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(j.Z,{color:i,size:1.5*w.iI,square:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},M=t(60523),B=t(27277),D=t(17717),A=t(85854),R=t(75499),N=t(72473),L=t(86735);var F=function(e){var n=e.cacheItems,t=e.selectedLinks,i=(0,f.useMemo)((function(){var e;return null==t||null===(e=t.find((function(e){return e.uuid in b.GJ})))||void 0===e?void 0:e.uuid}),[t]),r=(0,f.useMemo)((function(){var e,i=null==t||null===(e=t.slice(0,2))||void 0===e?void 0:e.map((function(e){return e.uuid}));return null==n?void 0:n.find((function(e){var n,t=e.item;return null==i?void 0:i.includes(null==t||null===(n=t.project)||void 0===n?void 0:n.uuid)}))}),[n,t]);if(b.tf.DBT===i&&r){var o,u,c,s,a=null==r?void 0:r.item,d=a.models,p=a.profiles,h=a.project,v=(0,L.YC)(Object.entries((null==p||null===(o=p[null==h?void 0:h.profile])||void 0===o?void 0:o.outputs)||{}),(function(e){return e[0]})),m=(null==h?void 0:h["model-paths"])||[],g=(null==h||null===(u=h.file_path)||void 0===u?void 0:u.split(D.sep))||[],x=(null==g?void 0:g.length)||0;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Project"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(C.Z,{p:w.cd,children:null==g?void 0:g.map((function(e,n){var t=n===x-1,i=t?N.List:N.FolderOutline;return(0,S.jsx)(C.Z,{ml:2*n,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(i,{default:t,muted:!t}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:t,monospace:!0,muted:!t,small:!0,children:e})]})},e)}))}),(0,S.jsx)(k.Z,{light:!0}),(0,S.jsx)(R.Z,{columnFlex:[null,null],columns:[{label:function(){return"Detail"},uuid:"details"},{label:function(){return""},rightAligned:!0,uuid:"value"}],noHeader:!0,rows:[[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Name"}),(0,S.jsx)(O.ZP,{monospace:!0,rightAligned:!0,small:!0,children:null==h?void 0:h.name})],[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Models paths"}),(0,S.jsx)(O.ZP,{monospace:!0,rightAligned:!0,small:!0,children:null==m?void 0:m.join(", ")})],[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Models"}),(0,S.jsx)(O.ZP,{monospace:!0,rightAligned:!0,small:!0,children:(null==d?void 0:d.length)||0})]]}),(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Profiles"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(C.Z,{p:w.cd,children:null==p||null===(c=p.file_path)||void 0===c||null===(s=c.split(D.sep))||void 0===s?void 0:s.map((function(e,n){var t=n===x-1,i=t?N.List:N.FolderOutline;return(0,S.jsx)(C.Z,{ml:2*n,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(i,{default:t,muted:!t}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:t,monospace:!0,muted:!t,small:!0,children:e})]})},e)}))}),(0,S.jsx)(k.Z,{light:!0}),(0,S.jsx)(R.Z,{columnFlex:[null,null],columns:[{uuid:"Targets"},{rightAligned:!0,uuid:"Type"}],rows:null==v?void 0:v.map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:t},"target-".concat(t)),(0,S.jsx)(O.ZP,{monospace:!0,rightAligned:!0,small:!0,children:null==i?void 0:i.type},"type-".concat(null==i?void 0:i.type))]}))})]})}return(0,S.jsx)(S.Fragment,{})},U=t(44897),H=t(46684),W=p.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-183il08-0"})(["height:","px;",""],H.Mz,(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||U.Z.borders).medium,";\n ")})),G=t(81728);var K=function(e){var n,t=e.children,i=e.navigateBack,l=e.selectedLinks,o=e.selectedTab,u=(0,f.useMemo)((function(){var e=(0,r.Z)(l||[]);return e.reverse(),e}),[l]),c=(0,f.useMemo)((function(){return(null==u?void 0:u.length)||0}),[u]);return(0,S.jsx)(W,{children:(0,S.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,children:[(0,S.jsx)(C.Z,{pl:w.cd}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[o&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return null==i?void 0:i()},preventDefault:!0,children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(N.ArrowLeft,{muted:!0})})}),(0,S.jsx)(C.Z,{pr:1}),(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return null==i?void 0:i(c||1)},preventDefault:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(null==o?void 0:o.Icon)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(o.Icon,{}),(0,S.jsx)(C.Z,{mr:1})]}),(0,S.jsx)(O.ZP,{bold:!0,muted:!0,children:null!=o&&o.label?null==o||null===(n=o.label)||void 0===n?void 0:n.call(o):(0,G.vg)(null==o?void 0:o.uuid)})]})})]}),null==u?void 0:u.map((function(e,n){var t=e||{Icon:null,label:null,uuid:null},r=t.Icon,s=t.label,a=t.uuid;return(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(o||n>=1)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.ChevronRight,{muted:!0}),(0,S.jsx)(C.Z,{mr:1})]}),(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return null==i?void 0:i(c-1-n)},preventDefault:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(r,{default:n>=1&&(null==u?void 0:u.length)>=3}),(0,S.jsx)(C.Z,{mr:1})]}),(0,S.jsx)(O.ZP,{bold:!0,muted:n!==c-1,noWrapping:!0,children:b.V4[a]||s?null==s?void 0:s({selectedLinks:l}):a})]})})]},a)}))]}),(o||(null==l?void 0:l.length)>=1)&&t&&(0,S.jsx)(C.Z,{mr:w.cd}),t,(0,S.jsx)(C.Z,{pr:w.cd})]})})},z=t(83905),q=t(80029),V=t(78650),Y=t(35686);var X,Q,J,$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=(e.excludeDirPattern,e.excludePattern,e.pattern,Y.ZP.files.list()),t=n.data;return{fetch:n.mutate,files:(0,f.useMemo)((function(){return(null==t?void 0:t.files)||[]}),[t])}},ee=t(32929);!function(e){e.BLOCKS="blocks",e.FILES="files"}(Q||(Q={})),function(e){e.ALL_BLOCKS="all_blocks",e.ALL_BLOCKS_IN_TYPE="all_blocks_in_type"}(J||(J={}));var ne=[{Icon:N.TemplateShapes,label:function(){return"All blocks"},uuid:J.ALL_BLOCKS}].concat(null===ee.qy||void 0===ee.qy?void 0:ee.qy.filter((function(e){return e.uuid in b.GJ}))),te=(X={},(0,o.Z)(X,Q.FILES,{Icon:N.FolderOutline,uuid:Q.FILES}),(0,o.Z)(X,Q.BLOCKS,{Icon:N.BatchSquaresStacked,uuid:Q.BLOCKS}),X);function ie(e){var n,t,i=e.models,r=e.project,l=(null==r?void 0:r["model-paths"])||[],o=new RegExp(null==l||null===(n=l.map((function(e){return[null==r?void 0:r.uuid,e,""].join(D.sep)})))||void 0===n?void 0:n.join("|"));return(0,L.YC)(null===(t=i||[])||void 0===t?void 0:t.map((function(e){var n,t,i,l,u,c=e.replace(o,""),s=null==c?void 0:c.split(D.sep);(null==s?void 0:s.length)>=2?(i=null==s?void 0:s[(null==s?void 0:s.length)-1],l=null==s||null===(u=s.slice(0,(null==s?void 0:s.length)-1))||void 0===u?void 0:u.join(D.sep)):i=null==s?void 0:s[0];var a=null===(n=i)||void 0===n?void 0:n.split(".");return{directory:l,fileExtension:null==a?void 0:a[(null==a?void 0:a.length)-1],filePath:c,fullPath:e,name:null==a||null===(t=a.slice(0,(null==a?void 0:a.length)-1))||void 0===t?void 0:t.join("."),project:r}})),(function(e){return e.name}))}var re=t(71953);function le(e){return null==e?void 0:e.map((function(e){var n=e.directory,t=e.fileExtension,i=e.filePath,r=e.name;return{Icon:re.T[t],label:function(){return(0,S.jsx)(O.ZP,{monospace:!0,noWrapping:!0,children:r})},description:function(){return(0,S.jsx)(y.ZP,{flexDirection:"column",children:(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,noWrapping:!0,small:!0,children:n})})},uuid:i}}))}function oe(e){var n;return[{Icon:N.FolderOutline,label:function(){return(0,G._6)("project",(null==e?void 0:e.length)||0)},uuid:J.ALL_BLOCKS_IN_TYPE}].concat(null===(n=(0,L.YC)(e||[],(function(e){var n,t=e.item;return null==t||null===(n=t.project)||void 0===n?void 0:n.name})))||void 0===n?void 0:n.map((function(e){var n=e.item,t=null==n?void 0:n.project;return{Icon:N.FolderOutline,label:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{selectedLinks:null}).selectedLinks;return(0,S.jsx)(O.ZP,{default:(null==e?void 0:e.length)>=3,monospace:!0,noWrapping:!0,children:null==t?void 0:t.name})},description:function(){var e;return(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,noWrapping:!0,small:!0,children:(0,G._6)("model",(null==n||null===(e=n.models)||void 0===e?void 0:e.length)||0)}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,noWrapping:!0,small:!0,children:null==t?void 0:t.uuid})]})},uuid:null==t?void 0:t.uuid}})))}function ue(e,n){var t,i,r,l,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,u=(null==n?void 0:n.length)||0,c=null==n||null===(t=n[0])||void 0===t?void 0:t.uuid,s=e;Array.isArray(e)||(s=[e]);var a=null===(i=s)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.uuid,d=J.ALL_BLOCKS===a,p=a in b.GJ,f=J.ALL_BLOCKS_IN_TYPE===a,h=o&&(null==o?void 0:o.find((function(e){return e.uuid===c}))),v=o&&(null==o?void 0:o.find((function(e){return e.uuid===a}))),m=null==n||null===(l=n.find((function(e){return e.uuid in b.GJ})))||void 0===l?void 0:l.uuid;if(0===u)return d?[]:s;if(1<=u){if(d)return[];if(p)return s}if(2<=u){var g;if(p)return s;if(f)return null==n?void 0:n.slice(u-1);if(h&&v)return s.concat(null==n?void 0:n.slice(u-1));if((null===(g=s)||void 0===g?void 0:g.length)>=2)return s.concat(null==n?void 0:n.slice(1))}return 3<=u&&b.tf.DBT===m?s.concat(null==n?void 0:n.slice(1)):s.concat(n||[])}function ce(e,n){var t;return b.tf.DBT===(null==e||null===(t=e[0])||void 0===t?void 0:t.uuid)?null==n?void 0:n[0]:(null==e?void 0:e[0])||(null==n?void 0:n[0])}var se=t(23780);var ae=function(e){var n=e.cacheItems,t=e.selectedLinks,i=e.selectedTab,r=e.setSelectedLinks,o=(0,se.VI)(null,{},[],{uuid:"FileBrowserNavigation"}),u=(0,l.Z)(o,1)[0],c=(0,f.useRef)(null),s=$(),a=s.fetch,d=s.files,p=(0,f.useMemo)((function(){var e,i=null==t||null===(e=t.slice(0,2))||void 0===e?void 0:e.map((function(e){return e.uuid}));return null==n?void 0:n.find((function(e){var n,t=e.item;return null==i?void 0:i.includes(null==t||null===(n=t.project)||void 0===n?void 0:n.uuid)}))}),[n,t]),h=(0,f.useMemo)((function(){var e,i;return null!=t&&t.find((function(e){var n=e.uuid;return b.tf.DBT===n}))?p&&(null==t?void 0:t.length)>=3?le(ie({models:null==p||null===(e=p.item)||void 0===e?void 0:e.models,project:null==p||null===(i=p.item)||void 0===i?void 0:i.project})):oe(n):ne}),[n,p,t]);return(0,f.useMemo)((function(){var e;return null==t||null===(e=t.find((function(e){return e.uuid in b.GJ})))||void 0===e?void 0:e.uuid}),[t]),(0,S.jsxs)(S.Fragment,{children:[Q.FILES===(null==i?void 0:i.uuid)&&(0,S.jsx)(V.Z,{fetchFiles:a,files:d,onClickFile:function(e,n){return console.log(e)},onClickFolder:function(e,n){return console.log(e,!0)},ref:c,showError:u,uuid:"FileBrowserNavigation"}),Q.BLOCKS===(null==i?void 0:i.uuid)&&(0,S.jsx)(q.Z,{navLinks:h||[],selectedLink:ce(t,h),setSelectedLink:function(e){return r((function(t){return ue(e,t,n)}))}})]})},de=t(90299);function pe(e,n){var t=e.selectedTab,i=e.setSelectedTab,r=[te[Q.FILES],te[Q.BLOCKS]];return(0,f.useEffect)((function(){i((function(e){return e||(null==r?void 0:r[0])}))}),[]),(0,S.jsx)(W,{ref:n,children:(0,S.jsx)(y.ZP,{alignItems:"flex-end",fullHeight:!0,children:(0,S.jsx)(de.Z,{onClickTab:function(e){return null==i?void 0:i(e)},selectedTabUUID:null==t?void 0:t.uuid,tabs:r,underlineStyle:!0})})})}var fe,he=f.forwardRef(pe),ve=t(32013),me=t(98777),ge=t(71180),be=t(89083),xe=t(24138),je=t(4190),ke=t(89706);!function(e){e.CODE="Compiled code",e.DATA="Sample data",e.LINEAGE="Lineage",e.OVERVIEW="Overview",e.PIPELINES="Pipelines and runs"}(fe||(fe={}));var Ze=[{uuid:fe.OVERVIEW},{uuid:fe.DATA},{uuid:fe.LINEAGE},{uuid:fe.PIPELINES},{uuid:fe.CODE}],ye=t(72619);var Pe=function(e){var n=e.cacheItem,t=e.cacheItems,i=e.mainContainerHeight,r=e.onClickAction,o=e.selectedLinks,u=e.setSelectedLinks,c=(0,f.useContext)(p.ThemeContext),s=(0,se.VI)(null,{},[],{uuid:"BlockBrowser/BlockDetail"}),a=(0,l.Z)(s,1)[0],d=(0,f.useRef)(null),v=(0,f.useState)(null),m=v[0],g=v[1],x=(0,f.useState)(null),j=x[0],P=x[1],I=(0,f.useState)(null),E=I[0],T=I[1],M=(0,f.useMemo)((function(){var e,n;return null==E||null===(e=E.item)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.sample_data}),[E]),B=null==o?void 0:o[0],D=(0,f.useMemo)((function(){return null==n?void 0:n.item}),[n]),L=(0,f.useMemo)((function(){return ie({models:null==D?void 0:D.models,project:null==D?void 0:D.project})}),[D]),F=(0,f.useMemo)((function(){return null==L?void 0:L.find((function(e){return e.filePath===(null==B?void 0:B.uuid)}))}),[L,B]),U=Y.ZP.file_contents.detail(encodeURIComponent(null==F?void 0:F.fullPath)).data,H=(0,f.useMemo)((function(){return null==U?void 0:U.file_content}),[U]),W=(0,f.useMemo)((function(){var e;return{item_type:z.N.DBT,project_path:null==D||null===(e=D.project)||void 0===e?void 0:e.uuid}}),[D]),G=Y.ZP.cache_items.detail(encodeURIComponent(null==F?void 0:F.fullPath),W).data,K=(0,f.useMemo)((function(){return null==G?void 0:G.cache_item}),[G]),q=(0,f.useMemo)((function(){var e;return(null==K||null===(e=K.item)||void 0===e?void 0:e.upstream_blocks)||[]}),[K]),V=(0,f.useMemo)((function(){return null==q?void 0:q.filter((function(e){var n,t=e.configuration;return(null==t?void 0:t.file_path)!==(null==F?void 0:F.fullPath)&&(null==t||null===(n=t.file_source)||void 0===n?void 0:n.path)!==(null==F?void 0:F.fullPath)}))}),[F,q]);(0,f.useEffect)((function(){P((function(e){return e||(null==Ze?void 0:Ze[0])}))}),[]);var X,Q,J,$,ee,ne,te,re,oe,ce,ae,pe,he,ve,me,Pe,Ce,Oe,we,_e,Se,Ie,Ee,Te,Me,Be,De,Ae=(0,f.useMemo)((function(){var e,n;return{schema:null==D||null===(e=D.schema)||void 0===e?void 0:e.find((function(e){var t=e.models;return null==t?void 0:t.find((function(e){if((null==e?void 0:e.name)===(null==F?void 0:F.name))return n=e}))})),schemaDetails:n}}),[D,F]),Re=(0,h.Db)(Y.ZP.cache_items.useUpdate(encodeURIComponent(null==F?void 0:F.fullPath),W),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var n=e.cache_item;T(n)},onErrorCallback:function(e,n){return T(null),a({errors:n,response:e})}})}}),Ne=(0,l.Z)(Re,2),Le=Ne[0],Fe=Ne[1].isLoading;return(0,f.useEffect)((function(){setTimeout((function(){var e,n;return g(null==d||null===(e=d.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),1)}),[]),(0,f.useEffect)((function(){fe.DATA===(null==j?void 0:j.uuid)&&Le({cache_item:{}})}),[F,j,Le]),z.N.DBT===(null==n?void 0:n.item_type)?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)("div",{ref:d,children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{alignItems:"center",flex:1,children:[(0,S.jsx)(N.DBT,{size:2.5*w.iI}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{large:!0,monospace:!0,children:null==F?void 0:F.name}),(null==Ae||null===(X=Ae.schemaDetails)||void 0===X?void 0:X.description)&&(0,S.jsx)("div",{style:{marginTop:2},children:(0,S.jsx)(O.ZP,{muted:!0,children:null==Ae||null===(Q=Ae.schemaDetails)||void 0===Q?void 0:Q.description})})]})]}),r&&(0,S.jsx)(ge.ZP,{backgroundColor:(0,_.qn)(b.tf.DBT,{theme:c}).accent,beforeIcon:(0,S.jsx)(N.AddBlock,{}),onClick:function(){return r({cacheItem:n,row:F})},children:"Add to pipeline as a block"})]})}),(0,S.jsx)(de.Z,{large:!0,onClickTab:function(e){return null==P?void 0:P(e)},selectedTabUUID:null==j?void 0:j.uuid,tabs:Ze,underlineStyle:!0}),(0,S.jsx)(k.Z,{light:!0})]}),fe.OVERVIEW===(null==j?void 0:j.uuid)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Info"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{label:function(){return"Info"},uuid:"details"},{label:function(){return""},uuid:"value"}],noHeader:!0,rows:[[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Model file"}),(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:null==F?void 0:F.filePath})],[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Directory"}),(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:null==F?void 0:F.directory})]].concat(null!=Ae&&null!==(J=Ae.schema)&&void 0!==J&&J.file_path?[[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"Schema file"}),(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:null==Ae||null===($=Ae.schema)||void 0===$?void 0:$.file_path})]]:[])}),(null==Ae||null===(ee=Ae.schemaDetails)||void 0===ee||null===(ne=ee.columns)||void 0===ne?void 0:ne.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Schema"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{uuid:"Column"},{uuid:"Description"}],rows:null==Ae||null===(te=Ae.schemaDetails)||void 0===te||null===(re=te.columns)||void 0===re?void 0:re.map((function(e){var n=e.description,t=e.name;return[(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:t},"name-".concat(t)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:n},"description-".concat(n))]}))})]}),(null==V?void 0:V.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Upstream model dependencies"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(R.Z,{columnFlex:[1,1,1,null],columns:[{uuid:"Name"},{uuid:"Model file"},{uuid:"Directory"},{rightAligned:!0,uuid:"Project"}],onClickRow:function(e){var n,i,r,l=null==V?void 0:V[e],o=null==l?void 0:l.configuration,c=null==t?void 0:t.find((function(e){var n;return e.uuid===(null==o||null===(n=o.file_source)||void 0===n?void 0:n.project_path)})),s=ie({models:[(null==o?void 0:o.file_path)||(null==o||null===(n=o.file_source)||void 0===n?void 0:n.path)],project:null==c||null===(i=c.item)||void 0===i?void 0:i.project}),a=null===(r=le([null==s?void 0:s[0]]))||void 0===r?void 0:r[0];return u((function(e){return ue(a,e,t)}))},rows:null==V?void 0:V.map((function(e){var n,t,i,r,l=e.configuration,o=e.uuid,u=null===(n=ie({models:[(null==l?void 0:l.file_path)||(null==l||null===(t=l.file_source)||void 0===t?void 0:t.path)],project:null==D?void 0:D.project}))||void 0===n?void 0:n[0];return[(0,S.jsx)(O.ZP,{monospace:!0,dbt:!0,small:!0,children:(null==u?void 0:u.name)||o},"model-".concat(o)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:(null==u?void 0:u.filePath)||(null==l?void 0:l.file_path)||(null==l||null===(i=l.file_source)||void 0===i?void 0:i.path)},"model-file-".concat(o)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:null==u?void 0:u.directory},"model-directory-".concat(o)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,rightAligned:!0,small:!0,children:null==l||null===(r=l.file_source)||void 0===r?void 0:r.project_path},"project-".concat(o))]}))})]}),(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Code"})}),(0,S.jsx)(k.Z,{light:!0,short:!0}),(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{label:function(){return"Info"},uuid:"details"},{label:function(){return""},uuid:"value"}],noHeader:!0,rows:[[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:"File"}),(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:null==F?void 0:F.fullPath})]]}),(0,S.jsx)(be.Z,{autoHeight:!0,language:ke.nB[null==F?void 0:F.fileExtension],padding:2*w.iI,readOnly:!0,value:null==H?void 0:H.content})]}),fe.LINEAGE===(null==j?void 0:j.uuid)&&(0,S.jsx)(S.Fragment,{children:(null==q?void 0:q.length)>=1&&(0,S.jsx)(xe.ZP,{disabled:!0,enablePorts:!1,height:Math.max(i,50*w.iI),heightOffset:m,pannable:!0,pipeline:{blocks:q,uuid:null},zoomable:!0})}),fe.DATA===(null==j?void 0:j.uuid)&&(0,S.jsxs)(S.Fragment,{children:[Fe&&(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(je.Z,{inverted:!0})}),!Fe&&!(null!=M&&null!==(oe=M.rows)&&void 0!==oe&&oe.length)&&(0,S.jsxs)(C.Z,{p:w.cd,children:[!(null!=E&&null!==(ce=E.item)&&void 0!==ce&&null!==(ae=ce.exception)&&void 0!==ae&&ae.length)&&(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{default:!0,children:"No sample data exists. Try running the model first."})}),(null==E||null===(pe=E.item)||void 0===pe||null===(he=pe.logs)||void 0===he?void 0:he.length)>=1&&(0,S.jsx)(C.Z,{mb:w.cd,children:null==E||null===(ve=E.item)||void 0===ve||null===(me=ve.logs)||void 0===me||null===(Pe=me.split("\n"))||void 0===Pe?void 0:Pe.map((function(e){return(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,pre:!0,children:e},e)}))}),(null==E||null===(Ce=E.item)||void 0===Ce||null===(Oe=Ce.exception)||void 0===Oe?void 0:Oe.length)>=1&&(0,S.jsx)(C.Z,{mb:w.cd,children:null==E||null===(we=E.item)||void 0===we||null===(_e=we.exception)||void 0===_e||null===(Se=_e.split("\n"))||void 0===Se?void 0:Se.map((function(e){return(0,S.jsx)(O.ZP,{monospace:!0,pre:!0,warning:!0,children:e},e)}))})]}),!Fe&&M&&(null==M||null===(Ie=M.rows)||void 0===Ie?void 0:Ie.length)>=1&&(0,S.jsx)(R.Z,{columnFlex:null==M||null===(Ee=M.columns)||void 0===Ee?void 0:Ee.map((function(){return null})),columns:null==M||null===(Te=M.columns)||void 0===Te?void 0:Te.map((function(e){return{uuid:e}})),rows:null==M||null===(Me=M.rows)||void 0===Me?void 0:Me.map((function(e){return null==e?void 0:e.map((function(e,n){return(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:String(e)===String(!1)?"false":String(e)===String(!0)?"true":e},"value-".concat(e,"-").concat(n))}))}))})]}),fe.PIPELINES===(null==j?void 0:j.uuid)&&(0,S.jsx)(S.Fragment,{}),fe.CODE===(null==j?void 0:j.uuid)&&(0,S.jsx)(S.Fragment,{children:(null==K||null===(Be=K.item)||void 0===Be?void 0:Be.content_compiled)&&(0,S.jsx)(be.Z,{autoHeight:!0,language:ke.nB[null==F?void 0:F.fileExtension],padding:2*w.iI,readOnly:!0,value:null==K||null===(De=K.item)||void 0===De?void 0:De.content_compiled})})]}):(0,S.jsx)("div",{})},Ce=t(95924);function Oe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function we(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Oe(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Oe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var _e=function(e){var n=e.cacheItems,t=e.mainContainerHeight,i=e.onClickAction,r=e.refCacheItems,l=e.selectedItem,u=e.selectedLinks,c=e.setSelectedLinks,s=(0,f.useMemo)((function(){var e;return null==u||null===(e=u.find((function(e){return e.uuid in b.GJ})))||void 0===e?void 0:e.uuid}),[u]),a=(0,f.useMemo)((function(){return(0,L.YC)(n||[],(function(e){var n,t=e.item;return null==t||null===(n=t.project)||void 0===n?void 0:n.name})).filter((function(e){var n,t,i=e.item;return 1===(null==u?void 0:u.length)||(null==u||null===(n=u[0])||void 0===n?void 0:n.uuid)===(null==i||null===(t=i.project)||void 0===t?void 0:t.uuid)}))}),[n,u]),d=(0,f.useCallback)((function(e){var t=(null==e?void 0:e.item)||{models:[],project:null},l=ie({models:t.models,project:t.project});return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Models"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.PaginateArrowRight,{muted:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:!0,large:!0,monospace:!0,children:(null==l?void 0:l.length)||0})]})}),(0,S.jsx)(k.Z,{light:!0}),(0,S.jsx)(R.Z,{buildRowProps:function(n){var t=null==l?void 0:l[n],i=(0,f.createRef)();return(null==e?void 0:e.uuid)in(null==r?void 0:r.current)||(r.current[null==e?void 0:e.uuid]={}),r.current[null==e?void 0:e.uuid][t.fullPath]=i,{rowProps:{id:t.fullPath,ref:i}}},columnFlex:[1,1,1,1],columns:[{uuid:"Name"},{uuid:"Directory"},{uuid:"File"},{label:function(){return""},rightAligned:!0,uuid:"Action"}],onClickRow:function(e){var t,i,r=null==l?void 0:l[e],o=null===(t=le([r]))||void 0===t?void 0:t[0],u=null===(i=oe(n))||void 0===i?void 0:i.find((function(e){var n;return e.uuid===(null==r||null===(n=r.project)||void 0===n?void 0:n.uuid)}));return c((function(e){return ue([o,u],e,n)}))},rows:null==l?void 0:l.map((function(n){var t=n.directory,r=n.filePath,l=n.name;return[(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:l},"model-".concat(l)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:t},"model-".concat(t)),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:r},"model-".concat(r)),(0,S.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(ge.ZP,{compact:!0,onClick:function(t){return(0,Ce.j)(t),i({cacheItem:e,row:n})},secondary:!0,small:!0,children:"Add to pipeline"})})]}))})]})}),[n,i,c]),p=(0,f.useMemo)((function(){return(0,S.jsx)(ve.Z,{noBorder:!0,noBoxShadow:!0,visibleMappingForced:null==n?void 0:n.reduce((function(e,n,t){return we(we({},e),{},(0,o.Z)({},String(t),!0))}),{}),children:null==n?void 0:n.map((function(e){var n,t=(null==e||null===(n=e.item)||void 0===n?void 0:n.project)||{name:null,uuid:null},i=t.name,l=t.uuid,o=(0,f.createRef)();return r.current[null==e?void 0:e.uuid]={cacheItem:o},(0,S.jsx)(me.Z,{id:null==e?void 0:e.uuid,noBorderRadius:!0,noPaddingContent:!0,refContainer:o,title:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(N.FolderOutline,{size:2*w.iI}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{monospace:!0,children:i}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,small:!0,children:l})]})]}),titleXPadding:w.cd*w.iI,titleYPadding:w.cd*w.iI,children:d(e)},l)}))})}),[d,n]),h=(0,f.useMemo)((function(){return d(null==a?void 0:a[0])}),[a,d]),v=(0,f.useMemo)((function(){return(0,S.jsx)(Pe,{cacheItem:l,cacheItems:n,mainContainerHeight:t,onClickAction:i,selectedLinks:u,setSelectedLinks:c})}),[n,t,i,l,u,c]);return(0,S.jsx)(S.Fragment,{children:b.tf.DBT===s&&(0,S.jsx)(S.Fragment,{children:1===(null==u?void 0:u.length)?p:2===(null==u?void 0:u.length)?h:v})})},Se=t(49130),Ie=t(17488),Ee=t(62547),Te=t(42631),Me=t(47041),Be=t(91437),De=8*w.iI,Ae=p.default.div.withConfig({displayName:"indexstyle__AfterContentStyle",componentId:"sc-119v89s-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")})),Re=p.default.div.withConfig({displayName:"indexstyle__AfterFooterStyle",componentId:"sc-119v89s-1"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")})),Ne=p.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-119v89s-2"})(["border-radius:","px;position:relative;"," ",""],Te.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n background-color: ").concat((e.theme.background||U.Z.background).panel,";\n ")}),(function(e){return e.maxWidth&&"\n width: ".concat(e.maxWidth,"px;\n ")})),Le=p.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-119v89s-3"})(["padding:","px;",""],w.cd*w.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")})),Fe=p.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-119v89s-4"})([""," "," ",""],(0,Be.eR)(),(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||U.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||U.Z.background).codeTextarea,";\n ")})),Ue=p.default.div.withConfig({displayName:"indexstyle__StreamGridGroupStyle",componentId:"sc-119v89s-5"})(["position:absolute;"]),He=p.default.div.withConfig({displayName:"indexstyle__StreamGridGroupInnerStyle",componentId:"sc-119v89s-6"})([""," overflow:auto;position:fixed;",""],Me.w5,(function(e){return e.borderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")})),We=p.default.div.withConfig({displayName:"indexstyle__StreamGridStyle",componentId:"sc-119v89s-7"})(["border-radius:","px;padding:","px;margin:","px;"," "," "," "," ",""],Te.n_,w.cd*w.iI,1*w.iI,(function(e){return!e.warning&&"\n &:hover {\n cursor: pointer;\n }\n "}),(function(e){return!e.selected&&!e.warning&&"\n border: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")}),(function(e){return e.warning&&!e.selected&&"\n border: 1px solid ".concat((e.theme.accent||U.Z.accent).warningTransparent,";\n ")}),(function(e){return e.warning&&e.selected&&"\n border: 1px solid ".concat((e.theme.accent||U.Z.accent).warning,";\n ")}),(function(e){return e.selected&&!e.warning&&"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||U.Z.borders).contrast,";\n ")})),Ge=p.default.div.withConfig({displayName:"indexstyle__BackgroundStyle",componentId:"sc-119v89s-8"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")})),Ke=t(38118),ze=t(39643),qe=p.default.div.withConfig({displayName:"indexstyle__MainStyle",componentId:"sc-aj0zrh-0"})([".show{display:block;}tr.show{display:table-row;}.hide{display:none;}"]),Ve=t(53808),Ye=t(42041),Xe=t(44688),Qe=t(19183);function Je(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function $e(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Je(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Je(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var en=function(e){var n,t=e.contained,i=e.defaultBlockType,r=e.focused,o=e.onClickAction,u=e.setFocused,c=(0,f.useRef)(null),s=(0,f.useRef)(null),a=(0,f.useRef)(null),d=(0,f.useRef)({}),p=(0,f.useRef)({}),h=(0,f.useRef)(null),v=(0,f.useMemo)((function(){return"dbt/Browser"}),[]),m=(0,f.useMemo)((function(){return"".concat(v,"width_after")}),[v]),g=(0,f.useMemo)((function(){return"".concat(v,"width_before")}),[v]),x=(0,Qe.i)(),j=x.height,P=x.width,_=(0,f.useState)({height:null,width:null}),I=_[0],E=_[1];(0,f.useEffect)((function(){E({height:j-2*De,width:P-2*De})}),[j,P]);var T=(0,se.VI)(null,{},[],{uuid:v}),M=((0,l.Z)(T,1)[0],(0,f.useState)(!1)),D=M[0],A=M[1],R=(0,f.useCallback)((function(e){u&&void 0!==typeof r?null==u||u(e):A(e)}),[r,u]),L=(0,f.useMemo)((function(){return void 0===r?D:r}),[r,D]),U=(0,f.useState)(!0),W=U[0],G=U[1],q=(0,f.useState)((0,Ve.U2)(m,60*w.iI)),V=q[0],X=q[1],J=(0,f.useState)(!1),$=J[0],ee=J[1],re=(0,f.useState)(Math.max((0,Ve.U2)(g),40*w.iI)),ue=re[0],ce=re[1],de=(0,f.useState)(null),pe=de[0],fe=de[1],ve=(0,f.useState)(!1),me=ve[0],ge=ve[1],be=(0,f.useState)(null),xe=be[0],je=be[1],ke=Y.ZP.cache_items.list({item_type:z.N.DBT}).data,Ze=(0,f.useMemo)((function(){return(null==ke?void 0:ke.cache_items)||[]}),[ke]),ye=(0,f.useState)(null),Pe=ye[0],Oe=ye[1],we=(0,f.useCallback)((function(e){Oe(e),h.current=e,p.current={},null==Ze||Ze.forEach((function(e){if(z.N.DBT===(null==e?void 0:e.item_type)){var n,t,i,r,l,o=null==d||null===(n=d.current)||void 0===n?void 0:n[null==e?void 0:e.uuid],u=null==e||null===(t=e.item)||void 0===t||null===(i=t.models)||void 0===i?void 0:i.filter((function(e){var n,t,i,r,l=!(null!==(n=h.current)&&void 0!==n&&n.length)||(null==e||null===(t=e.toLowerCase())||void 0===t||null===(i=t.replaceAll("_"," "))||void 0===i||null===(r=i.replaceAll("-"," "))||void 0===r?void 0:r.includes(h.current));if(o){var u=null==o?void 0:o[e];if(null!=u&&u.current)if(l){var c,s,a,d=(null===(c=(null==u||null===(s=u.current)||void 0===s?void 0:s.className)||"")||void 0===c?void 0:c.split(" "))||[];u.current.className=null==d||null===(a=d.filter((function(e){return!["hide","show"].includes(e)})).concat("show"))||void 0===a?void 0:a.join(" ")}else{var p,f,v,m=(null===(p=(null==u||null===(f=u.current)||void 0===f?void 0:f.className)||"")||void 0===p?void 0:p.split(" "))||[];u.current.className=null==m||null===(v=m.filter((function(e){return!["hide","show"].includes(e)})).concat("hide"))||void 0===v?void 0:v.join(" ")}}return l}));if((null==u?void 0:u.length)>=1){if(p.current[e.uuid]=$e($e({},e||{}),{},{item:$e($e({},e.item||{}),{},{models:u})}),null!=o&&null!==(r=o.cacheItem)&&void 0!==r&&r.current){var c,s,a,f,v=(null===(c=(null==o||null===(s=o.cacheItem)||void 0===s||null===(a=s.current)||void 0===a?void 0:a.className)||"")||void 0===c?void 0:c.split(" "))||[];o.cacheItem.current.className=null==v||null===(f=v.filter((function(e){return!["hide","show"].includes(e)})).concat("show"))||void 0===f?void 0:f.join(" ")}}else if(null!=o&&null!==(l=o.cacheItem)&&void 0!==l&&l.current){var m,g,b,x,j=(null===(m=(null==o||null===(g=o.cacheItem)||void 0===g||null===(b=g.current)||void 0===b?void 0:b.className)||"")||void 0===m?void 0:m.split(" "))||[];o.cacheItem.current.className=null==j||null===(x=j.filter((function(e){return!["hide","show"].includes(e)})).concat("hide"))||void 0===x?void 0:x.join(" ")}}}))}),[Ze]),Te=(0,f.useState)(null),Me=Te[0],Be=Te[1],Ae=(0,f.useState)(null),Re=Ae[0],Le=Ae[1],Fe=(0,f.useCallback)((function(e){Be(e),we(null),null!=a&&a.current&&(a.current.value="")}),[we]),Ue=(0,f.useCallback)((function(e){Le(e),we(null),null!=a&&a.current&&(a.current.value="")}),[we]),He=(0,f.useMemo)((function(){var e,n=null==Me||null===(e=Me.slice(0,2))||void 0===e?void 0:e.map((function(e){return e.uuid}));return null==Ze?void 0:Ze.find((function(e){var t,i=e.item;return null==n?void 0:n.includes(null==i||null===(t=i.project)||void 0===t?void 0:t.uuid)}))}),[Ze,Me]);(0,f.useEffect)((function(){i&&(Le(te[Q.BLOCKS]),Fe([null==ne?void 0:ne.find((function(e){return e.uuid===i}))]))}),[]),(0,f.useEffect)((function(){G(!He)}),[He]);var We=(0,f.useMemo)((function(){return(0,S.jsx)(F,{cacheItems:Ze,selectedLinks:Me})}),[Ze,Me]),Ge=(0,f.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;Fe((function(n){return function(e,n){var t=null==n?void 0:n.slice(null===e?1:e);return null==t||t.length,(null==t?void 0:t.length)>=1?t:null}(e,n)}))}),[Me,Fe,Ue]),Je=(0,f.useMemo)((function(){return(0,S.jsx)(qe,{children:(0,S.jsx)(_e,{cacheItems:Ze,mainContainerHeight:xe,onClickAction:o,refCacheItems:d,selectedItem:He,selectedLinks:Me,setSelectedLinks:Fe})})}),[Ze,xe,o,He,Me,Fe]);(0,f.useEffect)((function(){setTimeout((function(){var e,n,t,i;fe(null==s||null===(e=s.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height),je(null==c||null===(t=c.current)||void 0===t||null===(i=t.getBoundingClientRect())||void 0===i?void 0:i.height)}),1)}),[]);var en=(0,Xe.y)(),nn=en.registerOnKeyDown,tn=en.unregisterOnKeyDown;(0,f.useEffect)((function(){return function(){return tn(v)}}),[tn,v]),null==nn||nn(v,(function(e,n){var t,i;L&&(n[ze.vP]&&(R(!1),null==a||null===(t=a.current)||void 0===t||t.blur()));((0,Ye.y)([ze.zX,ze.A1],n)||(0,Ye.y)([ze.PQ,ze.A1],n))&&(e.preventDefault(),null==a||null===(i=a.current)||void 0===i||i.focus())}),[L,R]);var rn=(0,f.useMemo)((function(){var e=[];return null==Ze||Ze.forEach((function(n){var t,i,r;null===(t=ie({models:(null==n||null===(i=n.item)||void 0===i?void 0:i.models)||[],project:null==n||null===(r=n.item)||void 0===r?void 0:r.project}))||void 0===t||t.forEach((function(t){var i,r,l,o,u,c,s={cacheItem:n,model:t};e.push({itemObject:s,searchQueries:[null==t?void 0:t.fullPath,null==t||null===(i=t.fullPath)||void 0===i||null===(r=i.toLowerCase())||void 0===r||null===(l=r.replaceAll("_"," "))||void 0===l?void 0:l.replaceAll("-"," "),null==t?void 0:t.name,null==t||null===(o=t.name)||void 0===o||null===(u=o.toLowerCase())||void 0===u||null===(c=u.replaceAll("_"," "))||void 0===c?void 0:c.replaceAll("-"," ")],value:null==t?void 0:t.fullPath})}))})),e}),[Ze]);return(0,S.jsx)(Ne,{maxWidth:t?null==I?void 0:I.width:null,children:(0,S.jsx)(Ee.Z,{after:We,afterDividerContrast:!0,afterHeightOffset:0,afterHidden:W,afterInnerHeightMinus:pe,afterMousedownActive:$,afterWidth:V,before:(0,S.jsx)(ae,{cacheItems:Ze,selectedLinks:Me,selectedTab:Re,setSelectedLinks:Fe}),beforeContentHeightOffset:pe,beforeDividerContrast:!0,beforeHeader:(0,S.jsx)("div",{ref:s,children:(null==Me?void 0:Me.length)>=1?(0,S.jsx)(K,{navigateBack:Ge,selectedLinks:Me,selectedTab:Re}):(0,S.jsx)(he,{selectedTab:Re,setSelectedTab:Ue})}),beforeHeightOffset:0,beforeMousedownActive:me,beforeWidth:ue,contained:!0,headerOffset:H.Mz,height:t?null==I?void 0:I.height:j,hideAfterCompletely:!He,inline:!0,mainContainerHeader:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(K,{navigateBack:Ge,selectedTab:(null==Me?void 0:Me.length)>=2?null==Me?void 0:Me[1]:null,children:(0,S.jsxs)(Ke.eS,{children:[(0,S.jsx)(Ie.Z,{afterIcon:(0,S.jsx)(Se.Z,{addPlusSignBetweenKeys:!0,disabled:!0,keyTextGroups:[[ze.RJ,ze.ZS]]}),afterIconClick:function(){var e;null==a||null===(e=a.current)||void 0===e||e.focus()},beforeIcon:(0,S.jsx)(N.Search,{}),compact:!0,fullWidth:!0,onBlur:function(){return setTimeout((function(){return R(!1)}),150)},onChange:function(e){return we(e.target.value)},onFocus:function(){return R(!0)},placeholder:"Search a file...",primary:!0,ref:a,small:!0}),(0,S.jsx)(Ke.rS,{maxHeight:100*w.iI,topOffset:null==a||null===(n=a.current)||void 0===n?void 0:n.getBoundingClientRect().height,children:(0,S.jsx)(B.Z,{itemGroups:[{items:L?rn:[],renderItem:function(e,n){var t=e.itemObject,i=(t.cacheItem,t.model),r=i.filePath,l=i.project,o=N.Database;return(0,S.jsx)(Ke.gI,$e($e({},n),{},{onClick:function(e){var t;(0,Ce.j)(e),null==n||null===(t=n.onClick)||void 0===t||t.call(n,e)},children:(0,S.jsxs)(Z.Z,{alignItems:"center",flex:1,justifyContent:"space-between",children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(o,{default:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,overflowWrap:!0,small:!0,textOverflow:!0,children:r})]}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,overflowWrap:!0,small:!0,textOverflow:!0,children:null==l?void 0:l.name})]})]})}))}}],maxResults:12,onSelectItem:function(e){var n,t,i,r=e.itemObject,l=[],o=null==r?void 0:r.cacheItem;z.N.DBT===(null==o?void 0:o.item_type)&&(l.push(null===(t=le([null==r?void 0:r.model]))||void 0===t?void 0:t[0]),l.push(null===(i=oe(Ze))||void 0===i?void 0:i.find((function(e){var n,t;return e.uuid===(null==o||null===(n=o.item)||void 0===n||null===(t=n.project)||void 0===t?void 0:t.uuid)}))),l.push(null==ne?void 0:ne.find((function(e){return e.uuid===b.tf.DBT}))));Fe(l),we(null),R(!1),null==a||null===(n=a.current)||void 0===n||n.blur()},searchQuery:Pe,uuid:"".concat(v,"/AutocompleteDropdown")})})]})}),(0,S.jsx)(k.Z,{light:!0})]}),mainContainerRef:c,setAfterHidden:G,setAfterMousedownActive:ee,setAfterWidth:X,setBeforeMousedownActive:ge,setBeforeWidth:ce,uuid:v,children:Je})})},nn=t(65701),tn=t(1254);var rn=function(e){var n=e.size;return(0,S.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsx)("path",{d:"M67.7193 2.36691C69.8656 1.52184 72.3078 2.0081 73.9667 3.61084L116.977 45.1646C119.018 47.1366 119.362 50.2841 117.794 52.65L92.5787 90.7113C92.1293 91.3897 91.5441 91.9675 90.8601 92.4083L51.1076 118.029C48.6859 119.589 45.4904 119.168 43.5558 117.033L3.02296 72.3013C1.48382 70.6027 1.07052 68.1652 1.96372 66.0542L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L67.7193 2.36691Z",fill:"url(#paint0_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M71.2431 0.979492L23.6155 19.9931C22.1646 20.5723 21.0034 21.7045 20.3877 23.1402L0.499023 69.5159L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L71.2431 0.979492Z",fill:"url(#paint1_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint3_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint4_linear_11972_15232)"}),(0,S.jsx)("path",{d:"M23.3591 24.6945L58.2913 58.6736L25.3897 22.7247C24.8455 22.13 23.9152 22.1095 23.3452 22.6795C22.7871 23.2375 22.7934 24.1442 23.3591 24.6945Z",fill:"url(#paint5_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M51.6694 46.395L73.0043 69.5215C73.6132 70.1816 74.5925 70.3441 75.382 69.9161L117.654 46.9975L75.6257 67.8209C74.8809 68.1899 73.9844 68.0497 73.3879 67.4708L51.6694 46.395Z",fill:"url(#paint6_radial_11972_15232)"}),(0,S.jsxs)("defs",{children:[(0,S.jsxs)("radialGradient",{id:"paint0_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16.9412 88.4412) rotate(18.02) scale(82.0367 81.4644)",children:[(0,S.jsx)("stop",{stopColor:"#FFDA19"}),(0,S.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,S.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,S.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,S.jsxs)("radialGradient",{id:"paint1_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(35.8711 10.2518) rotate(87.6364) scale(26.1711 27.0141)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint2_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(150.671 44.2502) rotate(128.639) scale(125.554 128.436)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint3_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(133.353 52.8357) rotate(144.647) scale(86.7385 72.7129)",children:[(0,S.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,S.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint5_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(25.2251 23.4978) rotate(48.3599) scale(35.5147 43.1672)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint6_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(76.5908 67.6516) rotate(104.629) scale(14.9575 79.0374)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},ln=t(30352),on=t(68562),un=t(7267),cn=t(57653),sn=t(44085),an=t(4015),dn=t(13803),pn=t(72191),fn=t(2548);function hn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function vn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?hn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):hn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var mn=function(e){var n,t,i,r=e.block,o=e.defaultName,u=e.isReplacingBlock,c=e.isUpdatingBlock,s=e.onClose,a=e.onSave,d=e.pipeline,p=(0,se.VI)(null,{},[],{uuid:"ConfigureBlock"}),v=(0,l.Z)(p,1)[0],m=null===(n=(null==r?void 0:r.pipelines)||[])||void 0===n?void 0:n.length,g=(0,f.useRef)(null),x=(0,f.useState)({color:(null==r?void 0:r.color)||null,language:(null==r||null===(t=r.defaults)||void 0===t?void 0:t.language)||(null==r?void 0:r.language),name:o,type:null==r?void 0:r.type}),j=x[0],k=x[1],P=(0,f.useMemo)((function(){return!(null==j||!j.name)&&(0,G.ps)((null==j?void 0:j.name)||"")}),[null==j?void 0:j.name]),_=(0,f.useCallback)((function(){a(vn(vn({},j),{},{name:(null==j?void 0:j.name)||o})),s()}),[j,o,s,a]);(0,f.useEffect)((function(){var e,n=function(e){if(e.stopPropagation(),e.key===ze.KW)s();else if(e.key===ze.tt){var n=e.target.innerText;n.startsWith("Save and")||"Cancel"===n||P||_()}};return null===(e=document)||void 0===e||e.addEventListener("keydown",n),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("keydown",n)}}),[P,_,s]),(0,f.useEffect)((function(){var e;null==g||null===(e=g.current)||void 0===e||e.focus()}),[]);var I=(0,f.useMemo)((function(){return cn.qL.INTEGRATION===(null==d?void 0:d.type)}),[d]),E=(0,f.useMemo)((function(){return b.tf.CUSTOM===(null==r?void 0:r.type)}),[r]),T=(0,f.useMemo)((function(){return b.tf.MARKDOWN===(null==r?void 0:r.type)}),[r]),M=(0,f.useMemo)((function(){return null==r?void 0:r.block_action_object}),[r]),B=(0,f.useMemo)((function(){return fn.L.GENERATE_BLOCK===(null==M?void 0:M.object_type)}),[M]),D=(0,f.useMemo)((function(){return B&&(null==M?void 0:M.description)}),[M,B]),A=(0,f.useMemo)((function(){var e;return dn.I.DATA_INTEGRATION===(null==r||null===(e=r.config)||void 0===e?void 0:e.template_type)||!![dn.O.DESTINATIONS,dn.O.SOURCES].includes(null==M?void 0:M.language)}),[r,M]),R=(0,f.useState)(null),L=R[0],F=R[1],U=(0,h.Db)(Y.ZP.llms.useCreate(),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var n=e.llm,t=(null==n?void 0:n.response)||{},i=t.block_type,r=(t.code,t.configuration),l=t.content,o=t.language;k((function(e){return vn(vn({},e),{},{block_action_object:null,configuration:r,content:l,language:o,type:i})})),F(n)},onErrorCallback:function(e,n){return v({errors:n,response:e})}})}}),H=(0,l.Z)(U,2),W=H[0],K=H[1].isLoading;(0,f.useEffect)((function(){B&&D&&!L&&W({llm:{request:{block_description:D,block_type:b.tf.TRANSFORMER,code_language:b.t6.PYTHON},use_case:un.z.GENERATE_CODE}})}),[W,D,B,L]);var z=(0,f.useMemo)((function(){var e,n;return null!=r&&null!==(e=r.config)&&void 0!==e&&e.custom_template?null==r||null===(n=r.config)||void 0===n?void 0:n.custom_template:[fn.L.CUSTOM_BLOCK_TEMPLATE,fn.L.MAGE_TEMPLATE].includes(null==M?void 0:M.object_type)?vn(vn({},M),{},{name:null==M?void 0:M.title}):void 0}),[r,M]),q=(0,f.useMemo)((function(){var e=(null==j?void 0:j.type)||(null==r?void 0:r.type);z&&(e=null==z?void 0:z.block_type);var n=b.V4[e];return I&&(b.tf.DATA_LOADER===e?n="Source":b.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[r,j,z,I]);return(0,S.jsxs)(an.Nk,{width:B&&(null==j?void 0:j.content)&&80*w.iI,children:[(0,S.jsxs)(an.I5,{children:[B&&K&&(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(O.ZP,{children:"Generating block using AI..."}),(0,S.jsx)(je.Z,{inverted:!0})]}),B&&!K&&(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(N.AISparkle,{size:5*w.iI,warning:!0})}),!B&&(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(rn,{size:15*w.iI})})]}),B&&!K&&(0,S.jsx)(an.gI,{children:(0,S.jsxs)(C.Z,{py:1,children:[(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Block generated using AI"})}),(0,S.jsx)(O.ZP,{textOverflow:!0,children:D})]})}),z&&(0,S.jsx)(an.gI,{children:(0,S.jsxs)(C.Z,{py:1,children:[(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Template"})}),(0,S.jsx)(O.ZP,{textOverflow:!0,children:null===(i=(null==z?void 0:z.name)||(null==z?void 0:z.template_uuid))||void 0===i?void 0:i.slice(0,40)})]})}),b.tf.GLOBAL_DATA_PRODUCT!==(null==r?void 0:r.type)&&m>1&&(0,S.jsxs)(an.gI,{children:[(0,S.jsx)(Z.Z,{flex:"1",children:(0,S.jsx)(N.AlertTriangle,{size:pn.l2,warning:!0})}),(0,S.jsx)(Z.Z,{flex:"6",children:(0,S.jsxs)(O.ZP,{bold:!0,warning:!0,children:[c&&"Renaming this block will affect ".concat(m," pipelines.")+" The renamed block may need to be re-added to the shared pipeline(s).",u&&"This will create a copy of the selected block and replace the existing one so it is no longer shared with any other pipelines."]})})]}),(0,S.jsxs)(an.gI,{columnFlex:!0,children:[(0,S.jsxs)(y.ZP,vn(vn({},y.A0),{},{fullWidth:!0,children:[(0,S.jsx)(O.ZP,{default:!0,children:"Name"}),(0,S.jsx)(Ie.Z,{alignRight:!0,fullWidth:!0,noBackground:!0,noBorder:!0,onChange:function(e){return k((function(n){return vn(vn({},n),{},{name:e.target.value})}))},paddingVertical:w.iI,placeholder:"Block name...",ref:g,value:(null==j?void 0:j.name)||""})]})),P&&(0,S.jsx)(O.ZP,{bold:!0,warning:!0,children:"Note: Numbers are not allowed as the first character of a block name."})]}),(0,S.jsxs)(an.gI,{children:[(0,S.jsx)(O.ZP,{default:!0,children:"Type"}),(0,S.jsx)(C.Z,{mr:w.cd,py:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{muted:!0,children:q}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.Locked,{muted:!0})]})})]}),!T&&(E||z||(null==j?void 0:j.language))&&(0,S.jsxs)(an.gI,{paddingVerticalAddition:3,children:[(0,S.jsx)(O.ZP,{default:!0,children:"Language"}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[[b.t6.PYTHON,b.t6.SQL,b.t6.R,b.t6.YAML].reduce((function(e,n){var t=(z?null==z?void 0:z.language:null==j?void 0:j.language)===n;return!(E&&!c&&!u||t||A&&b.t6.R!==n&&A&&b.t6.SQL!==n)||E&&b.t6.YAML===n||e.push((0,S.jsx)(C.Z,{ml:1,children:(0,S.jsx)(ge.ZP,{borderColor:t?null:"transparent",compact:!0,default:!E&&!t&&!A,disabled:!E&&!t&&!A,noBackground:!0,notClickable:(!E||c||!A)&&t,onClick:z&&!A?null:function(){return k((function(e){return vn(vn({},e),{},{language:n})}))},selected:t,children:b.LE[n]})},n)),e}),[]),!E&&!A&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.Locked,{muted:!0})]}),(0,S.jsx)(C.Z,{mr:E||A?1:2})]})]}),(E||(null==z?void 0:z.color)||(null==j?void 0:j.color))&&(0,S.jsxs)(an.gI,{children:[(0,S.jsx)(O.ZP,{default:!0,children:"Color"}),E&&(0,S.jsxs)(sn.Z,{alignRight:!0,disabled:u,noBackground:!0,noBorder:!0,onChange:function(e){return k((function(n){return vn(vn({},n),{},{color:e.target.value})}))},value:z?(null==z?void 0:z.color)||"":(null==j?void 0:j.color)||"",children:[(0,S.jsx)("option",{value:""}),Object.values(b.Lq).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.kC)(e)},e)}))]}),!E&&(0,S.jsx)(C.Z,{mr:w.cd,py:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{muted:!0,children:(0,G.kC)((null==z?void 0:z.color)||(null==j?void 0:j.color)||"")}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(N.Locked,{muted:!0})]})})]}),B&&(null==j?void 0:j.content)&&(0,S.jsx)(an.gI,{display:"block",children:(0,S.jsx)(C.Z,{pr:w.cd,py:1,children:(0,S.jsx)(nn.W,{backend:tn.PD,children:(0,S.jsx)(ln.Z,{block:vn(vn({},j),{},{uuid:D}),defaultValue:null==j?void 0:j.content,disableDrag:!0,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,noDivider:!0,onChange:function(e){return k((function(n){return vn(vn({},n),{},{content:e})}))},selected:!0,textareaFocused:!0},D)})})}),(0,S.jsx)(an.$b,{children:(0,S.jsxs)(y.ZP,{fullWidth:!0,children:[(0,S.jsxs)(on.ZP,{bold:!0,centerText:!0,disabled:K||P,onClick:_,primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:["Save and ",c?"update":u?"replace":"add"]}),(0,S.jsx)(C.Z,{ml:1,children:(0,S.jsx)(ge.ZP,{onClick:s,tabIndex:0,children:"Cancel"})})]})})]})},gn=t(54750),bn=t(82755),xn=t(99236),jn=t(98464),kn=t(29480),Zn=t(37443),yn=t(53405);function Pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Cn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Pn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var On=function(e){var n=e.block,t=e.blockConfigString,i=e.blockContent,r=e.blockUpstreamBlocks,o=e.dataIntegrationConfiguration,u=e.onChangeCodeBlock,c=e.pipeline,s=e.savePipelineContent,a=e.setBlockConfigString,d=e.setBlockContent,p=e.setContent,v=e.setSelectedSubTab,m=e.showError,g=n||{},x=g.language,Z=g.type,_=g.uuid,I=(c||{}).uuid,E=(0,f.useState)(!1),T=E[0],M=E[1],B=(0,f.useMemo)((function(){return b.t6.YAML===x&&i?(0,bn.Qc)(i):{}}),[i,x]),D=(0,jn.Z)(t);(0,f.useEffect)((function(){!B||t||D||a((0,bn.Pz)(null==B?void 0:B.config))}),[t,D,B,a]);var R=(0,f.useState)(!1),L=R[0],F=R[1],U=(0,h.Db)(Y.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var n=e.integration_source;null!=n&&n.error_message?m({response:{error:{exception:null==n?void 0:n.error_message}}}):null!=n&&n.success&&F(!0)},onErrorCallback:function(e,n){return m({errors:n,response:e})}})}}),H=(0,l.Z)(U,2),W=H[0],G=H[1].isLoading,K=(0,f.useCallback)((function(){return s().then((function(){return W({integration_source:{action_type:"test_connection",block_uuid:_,pipeline_uuid:I}})}))}),[_,W,I,s]),z=(0,f.useMemo)((function(){if(b.t6.YAML===x)return(0,S.jsx)(kn.$W,{children:(0,S.jsx)(be.Z,{autoHeight:!0,language:x,onChange:function(e){a(e);try{var n=(0,bn.Qc)(e),t=(0,bn.Pz)(Cn(Cn({},B),{},{config:n}));u(Z,_,t),p(t),M(!1)}catch(e){M(!0)}},tabSize:2,value:t||void 0,width:"100%"})});b.t6.PYTHON}),[t,i,B,x,Z,_,d,p]),q=(0,f.useMemo)((function(){return(0,yn.Wi)(r,o)}),[r,o]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.PlugAPI,{success:!0}),loading:G,onClick:function(){F(!1),K()},secondary:!0,compact:!0,children:"Test connection"}),L&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{size:1*w.iI,success:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{success:!0,children:"Connection successful"})]})]})]})}),(0,S.jsx)(k.Z,{light:!0}),(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,large:!0,children:"Inputs from upstream blocks"}),0===(null==q?void 0:q.length)&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{muted:!0,children:["No inputs are selected. Toggle the upstream blocks in the ",(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return v(Zn.tw.UPSTREAM_BLOCK_SETTINGS)},preventDefault:!0,children:"Upstream block settings"})," to enable its output data as an input."]})})]}),(null==q?void 0:q.length)>=1&&(0,S.jsx)(xn.Z,{inputsBlocks:q}),T&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(k.Z,{light:!0}),(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsx)(A.Z,{danger:!0,level:5,children:"ERROR"})}),(0,S.jsxs)(O.ZP,{muted:!0,children:["The credentials configuration is formatted incorrectly for the language ",b.LE[x],". The formatting must be fixed before the credentials configuration can be saved."]})]})]}),z]})},wn=t(11990),_n=t(96348),Sn=t(26304),In=t(93859),En=t(66909),Tn=t(42122);var Mn=function(e){var n=e.block,t=e.height,i=e.pipeline,r=e.setSelectedSubTab,o=e.showError,u=e.stream,c=(0,f.useRef)(null),s=(0,f.useState)(null),a=s[0],d=s[1],p=(0,f.useState)(100),v=p[0],m=(p[1],(0,f.useState)(0)),g=m[0],b=m[1];(0,f.useEffect)((function(){var e,n;null!=c&&null!==(e=c.current)&&void 0!==e&&e.getBoundingClientRect().height&&b(null==c||null===(n=c.current)||void 0===n?void 0:n.getBoundingClientRect().height)}),[c]);var x=null==i?void 0:i.uuid,j=null==n?void 0:n.uuid,k=(0,f.useMemo)((function(){return{parentStreamID:(0,yn.Qu)(u),streamID:(0,yn.M$)(u)}}),[u]),Z=k.parentStreamID,y=k.streamID,_=(0,f.useMemo)((function(){return(0,Tn.Qr)((0,yn.WE)(u||{})||{},{idIsInObject:!0})}),[u]),I=Y.ZP.outputs.pipelines.detail(!a&&x,!a&&j,{parent_stream:Z,sample_count:v,stream:y},{revalidateOnFocus:!1}).data,E=(0,h.Db)(Y.ZP.outputs.useCreate(),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var n=e.output;d(n)},onErrorCallback:function(e,n){return o({errors:n,response:e})}})}}),T=(0,l.Z)(E,2),M=T[0],B=T[1].isLoading,D=(0,f.useCallback)((function(){return M({output:{block_uuid:j,persist:1,pipeline_uuid:x,refresh:1,sample_count:v,streams:[{parent_stream:Z,stream:y}]}})}),[j,M,Z,x,v,y]),A=(0,f.useMemo)((function(){return a||(null==I?void 0:I.output)}),[I,a]),R=(0,f.useMemo)((function(){var e,n=(A||{}).outputs,t=void 0===n?[]:n;return null==t||null===(e=t.find((function(e){return e.uuid===y})))||void 0===e?void 0:e.data}),[A,y]),N=(0,f.useMemo)((function(){var e=R||{},n=e.sample_data,i=(e.type,n||{}),r=i.columns,l=i.rows;if(null!=r&&r.length&&null!=l&&l.length)return(0,S.jsx)(In.Z,{columnHeaderHeight:En.Eh,columns:r,height:t-g,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,rows:l})}),[R,t,g]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,ref:c,children:_?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.ZP,{default:!0,children:"Please select at least 1 column in the stream in order to fetch sample data."}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return r(Zn.tw.SETTINGS)},preventDefault:!0,children:"Go to Schema properties to select a column"})})]}):(0,S.jsx)(ge.ZP,{compact:!0,loading:B,onClick:function(){return D()},primary:!0,children:R?"Refresh sample data":"Fetch sample data"})}),N]})},Bn=t(31882),Dn=t(69650),An=t(12468),Rn=t(61599),Nn=t(14466),Ln=p.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-wjbb3f-0"})(["border-radius:","px;"," ",""],Te.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")}),(function(e){return!e.noPadding&&"\n padding: ".concat(w.cd*w.iI,"px;\n ")}));function Fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Un(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Fn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Hn=function(e){var n,t=e.block,i=(e.blocksMapping,e.onChangeBlock),u=e.setBlockAttributes,c=e.stream,s=(e.streamMapping,e.updateStreamsInCatalog),a=(0,f.useRef)(null),d=(0,f.useState)({}),p=d[0],h=d[1],v=c||{},m=v.auto_add_new_fields,g=v.bookmark_properties,x=v.bookmark_property_operators,j=v.destination_table,k=v.disable_column_type_check,P=v.key_properties,_=v.partition_keys,I=v.replication_method,E=v.run_in_parallel,T=v.unique_conflict_method,M=v.unique_constraints,B=(0,yn.M$)(c),D=(0,yn.WD)(c),A=(0,yn.Z5)(c),N=null==t||null===(n=t.metadata)||void 0===n?void 0:n.data_integration,F=(null==N?void 0:N.source)||(null==N?void 0:N.destination),U=(0,f.useCallback)((function(e){return s(e,(function(e){return null==i?void 0:i(e)}))}),[i,s]),H=(0,f.useCallback)((function(e,n){U([Un(Un({},c),{},(0,o.Z)({},e,n))])}),[c,U]),W=(0,f.useMemo)((function(){var e,n=[],t={},i=[],o=(0,yn.RP)(c)||{};return null===(e=Object.entries(o||{}))||void 0===e||e.forEach((function(e){var r,o=(0,l.Z)(e,2),u=o[0],c=o[1],s=c.metadata,a=c.type;n.push(u),(!s||null==s||!s.metadata||null!=s&&null!==(r=s.metadata)&&void 0!==r&&r.selected)&&i.push(u);var d=Array.isArray(a)?a:[a];if((null==d?void 0:d.length)>=1){var p=d[(null==d?void 0:d.length)-1];null!=t&&t[p]||(t[p]=[]),t[p].push(u)}})),(0,S.jsx)(R.Z,{columnFlex:[1,1],rows:[[(0,S.jsx)(O.ZP,{children:"Number of columns selected"},"columns"),(0,S.jsxs)(O.ZP,{monospace:!0,rightAligned:!0,children:[null==i?void 0:i.length," ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,children:"/"})," ",null==n?void 0:n.length]},"columns-value")]].concat((0,r.Z)((0,L.YC)(Object.entries(t),(function(e){return(0,l.Z)(e,1)[0]})).map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return[(0,S.jsxs)(O.ZP,{children:[(0,G.vg)(t)," columns"]},"columns-".concat(t)),(0,S.jsx)(O.ZP,{monospace:!0,rightAligned:!0,children:null==i?void 0:i.length},"columns-value-".concat(t))]}))),(0,r.Z)([["Bookmarks",g,"bookmark_properties"],["Unique constraints",M,"unique_constraints"],["Key properties",P,"key_properties"],["Partition keys",_,"partition_keys"]].map((function(e){var n,t=(0,l.Z)(e,3),i=t[0],r=t[1],o=t[2];return[(0,S.jsx)(O.ZP,{children:i},i),(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:[!(null!=r&&r.length)&&(0,S.jsx)(O.ZP,{muted:!0,monospace:!0,children:"-"}),null===(n=(0,L.YC)(r||[],(function(e){return e})))||void 0===n?void 0:n.map((function(e){return(0,S.jsx)("div",{style:{marginLeft:w.iI/2},children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){return H(o,(0,L.Od)(r,(function(n){return n===e})))},xsmall:!0})},"".concat(i,"-value-").concat(e))}))]},"".concat(i,"-value"))]}))))})}),[g,P,_,c,M,H]),K=(0,f.useMemo)((function(){return D in p?null==p?void 0:p[D]:j}),[j,p,D]);return(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{children:[(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Output"}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{large:!0,children:"Destination table"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(An.Z,{label:(0,S.jsxs)(O.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:B}),". To change the table name, enter in a different value."]}),lightBackground:!0}),(0,S.jsx)(C.Z,{mr:w.cd})]}),(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(Ie.Z,{fullWidth:!0,monospace:!0,onChange:function(e){var n,t=null==e||null===(n=e.target)||void 0===n?void 0:n.value;h((function(e){return Un(Un({},e),{},(0,o.Z)({},D,t))})),clearTimeout(a.current),a.current=setTimeout((function(){return H("destination_table",t)}),300)},value:K||""})})]})})]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{children:[(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Settings"}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{large:!0,children:"Replication method"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(An.Z,{label:(0,S.jsxs)(O.ZP,{children:["Do you want to synchronize the entire stream (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.FULL_TABLE}),") on each pipeline run or only new records (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.INCREMENTAL}),")?",Rn.th.POSTGRESQL===F&&(0,S.jsxs)(O.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(sn.Z,{defaultColor:!0,onChange:function(e){return H("replication_method",e.target.value)},placeholder:"Select an option",value:I,children:Rn.jL.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.vg)(e)},e)}))})]})}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{large:!0,children:"Unique conflict method"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(An.Z,{label:(0,S.jsxs)(O.ZP,{children:["If a new record has the same value as an existing record in the ",(0,G._6)("unique column",null==M?void 0:M.length),(null==M?void 0:M.length)>0&&(0,S.jsx)(S.Fragment,{children:" "}),null==M?void 0:M.sort().map((function(e,n){return(0,S.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null==M?void 0:M.length)&&n===(null==M?void 0:M.length)-1?(0,S.jsx)(O.ZP,{inline:!0,children:" and "},e):n>=1&&(0,S.jsx)(S.Fragment,{children:", "}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn.MU.IGNORE})," will skip the new record if it’s a duplicate of an existing record. The conflict method ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn.MU.UPDATE})," will not save the new record and instead update the existing record with the new record’s properties."]}),lightBackground:!0}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(sn.Z,{defaultColor:!0,onChange:function(e){return H("unique_conflict_method",e.target.value)},placeholder:"Select an option",value:T,children:Object.values(Rn.MU).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.vg)(e)},e)}))})]})})]})}),(null==N?void 0:N.sql)&&Rn._B.INCREMENTAL===I&&(null==g?void 0:g.length)>=1&&(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{children:[(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Bookmark property operators"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["By default, new records are compared to the bookmark property value using the operator greater than or equals (",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:">="}),").",(0,S.jsx)("br",{}),"If the bookmark property is also a unique constraint, then the default operator is greater than (",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:">"}),").",(0,S.jsx)("br",{}),"Change the operator that is used when determining which records to sync based on the bookmark value from the most recently completed sync."]})}),null==g?void 0:g.map((function(e){var n;return n=null!=x&&x[e]?null==x?void 0:x[e]:M&&null!=M&&M.includes(e)?Nn.W6.GREATER_THAN:Nn.W6.GREATER_THAN_OR_EQUALS,(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsxs)(O.ZP,{default:!0,monospace:!0,children:[(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,children:["{new_record}","."]}),e]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(sn.Z,{compact:!0,defaultColor:!0,monospace:!0,onChange:function(n){return H("bookmark_property_operators",Un(Un({},x),{},(0,o.Z)({},e,n.target.value)))},value:n,children:[Nn.W6.EQUALS,Nn.W6.GREATER_THAN,Nn.W6.GREATER_THAN_OR_EQUALS,Nn.W6.LESS_THAN,Nn.W6.LESS_THAN_OR_EQUALS,Nn.W6.NOT_EQUALS].map((function(e){return(0,S.jsx)("option",{value:e,children:Nn.N_[e]},e)}))}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(O.ZP,{default:!0,monospace:!0,children:[(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,children:["{bookmark}","."]}),e]})]})},e)}))]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{children:[(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Options"}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Run streams in parallel"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."})})]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Dn.Z,{checked:!!E,onCheck:function(e){return H("run_in_parallel",e(E))}})]})}),b.tf.DATA_EXPORTER===(null==t?void 0:t.type)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})})]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Dn.Z,{checked:!!m,onCheck:function(e){return H("auto_add_new_fields",e(m))}})]})}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"By default, the value for each column is validated according to the schema property for that column. If a value in a column doesn’t match its type, an error will be raised and the process will be stopped. Turn this toggle on if you want to disable this strict type checking."})})]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Dn.Z,{checked:!!k,onCheck:function(e){return H("disable_column_type_check",e(k))}})]})})]})]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{noPadding:!0,children:[(0,S.jsx)(C.Z,{pt:w.cd,px:w.cd,children:(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Summary"})}),(0,S.jsx)(C.Z,{mt:w.cd,pb:w.cd,children:W})]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(Ln,{children:[(0,S.jsx)(O.ZP,{default:!0,uppercase:!0,children:"Other"}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{large:!0,children:"Select stream"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Dn.Z,{checked:!!A,onCheck:function(e){return U([(0,yn.XE)(c,{selected:e(A)})])}})]})}),(0,S.jsx)(C.Z,{mt:w.HN,children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(ge.ZP,{danger:!0,onClick:function(){window.confirm("Are you sure you want to remove stream ".concat(B," from block ").concat(null==t?void 0:t.uuid,"?"))&&u((function(e){var n,t=Un(Un({},e),{},{catalog:Un(Un({},null==e?void 0:e.catalog),{},{streams:(0,L.Od)(null==e||null===(n=e.catalog)||void 0===n?void 0:n.streams,(function(e){return(0,yn.WD)(e)===D}))})});return null==i||i(t),t}))},children:"Delete stream from block"})})})]})})]})},Wn=t(11074),Gn=t(69632);function Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function zn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qn=function(e){var n,t,i=e.block,r=(e.blocksMapping,e.highlightedColumnsMapping),u=e.onChangeBlock,c=e.setBlockAttributes,s=e.setHighlightedColumnsMapping,a=e.setSelectedSubTab,d=e.setStreamsMappingConflicts,p=e.showStreamConflicts,h=e.stream,v=e.streamMapping,m=e.streamsMappingConflicts,g=(0,f.useCallback)((function(e){c((function(n){var t=e(n);return null==u||u(t),t}))}),[u,c]),b=(0,f.useMemo)((function(){return(0,yn.RP)(h)||{}}),[h]),P=(0,f.useState)(null),_=P[0],I=P[1],E=(0,f.useState)(null),T=E[0],M=E[1],B=(0,f.useRef)(null),D=(0,f.useState)(null),F=D[0],U=D[1],H=(0,f.useCallback)((function(){U(null),I(null)}),[U,I]);(0,f.useEffect)((function(){var e;return null===(e=document)||void 0===e||e.addEventListener("click",H),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("click",H)}}),[H]);var W=(0,f.useMemo)((function(){var e=h.bookmark_properties,n=h.key_properties,t=h.partition_keys,i=(h.replication_method,h.unique_constraints);return{bookmarkPropertiesMapping:(0,L.HK)(e||[],(function(e){return e})),keyPropertiesMapping:(0,L.HK)(n||[],(function(e){return e})),partitionKeysMapping:(0,L.HK)(t||[],(function(e){return e})),uniqueConstraintsMapping:(0,L.HK)(i||[],(function(e){return e}))}}),[h]),G=W.bookmarkPropertiesMapping,K=W.keyPropertiesMapping,z=W.partitionKeysMapping,q=W.uniqueConstraintsMapping,V=(0,f.useMemo)((function(){var e,n;return null===(e=(0,L.YC)(Object.entries(b||{}),(function(e){return(0,l.Z)(e,1)[0]})))||void 0===e||null===(n=e.map)||void 0===n?void 0:n.call(e,(function(e){var n=(0,l.Z)(e,2);return{column:n[0],property:n[1]}}))}),[b]),Y=((0,f.useMemo)((function(){return(0,yn.MB)(h)}),[h]),(0,f.useMemo)((function(){return(0,yn.Nf)(h)}),[h])),X=null==i||null===(n=i.metadata)||void 0===n||null===(t=n.data_integration)||void 0===t?void 0:t.destination,Q=(0,f.useMemo)((function(){return!Rn.kB.includes(X)}),[X]),J=(0,f.useMemo)((function(){var e=[null,1,1],n=null==V?void 0:V.every((function(e){var n,t,i,r=e.property;return!(null!=r&&r.metadata)||!(null!=r&&null!==(n=r.metadata)&&void 0!==n&&n.metadata)||(null==r||null===(t=r.metadata)||void 0===t||null===(i=t.metadata)||void 0===i?void 0:i.selected)})),t=[{label:function(){return(0,S.jsx)(Dn.Z,{checked:n,compact:!0,onCheck:function(e){return t={selected:e(n)},i=null==V?void 0:V.reduce((function(e,n){var i=n.column,r=(null==Y?void 0:Y[i])||(0,yn.jC)(i);return e[i]=zn(zn({},r),{},{metadata:zn(zn({},null==r?void 0:r.metadata),t)}),e}),{}),void g((function(e){return(0,yn.$C)((0,yn.AP)(h,i),e)}));var t,i}})},uuid:"action"},{uuid:"Property"},{uuid:"Types"}];Q&&(e.push.apply(e,[null,null]),t.push.apply(t,[{center:!0,uuid:"Unique"},{center:!0,uuid:"Key"}]));var i=h.replication_method;return Rn._B.INCREMENTAL===i&&(e.push(null),t.push({center:!0,uuid:"Bookmark"})),e.push(null),t.push({center:!0,uuid:"Partition"}),{columnFlex:e,columns:t}}),[V,g,h,Y,Q]),$=J.columnFlex,ee=J.columns,ne=(0,f.useCallback)((function(e,n,t){var i,r=t||{},l=r.disableEdit,u=r.key,c=(0,yn.wx)(e,n),s=(null==c?void 0:c.typesDerived)||[];return(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[null===(i=s||[])||void 0===i?void 0:i.map((function(n){return(0,S.jsx)("div",{style:{paddingBottom:1,marginRight:2,paddingTop:1},children:(0,S.jsx)(Bn.Z,{label:n,onClick:l?null:function(t){(0,Ce.j)(t);var i=!(null==s||!s.includes(n))?(0,yn.VZ)([n],c):(0,yn.qx)([n],c),r={anyOf:null==i?void 0:i.anyOf,format:null==i?void 0:i.format,type:null==i?void 0:i.type};g((function(n){return(0,yn.$C)((0,yn.KN)(h,(0,o.Z)({},e,r)),n)}))},xsmall:!0})},"".concat(e,"-").concat(u||"types","-").concat(n))})),!l&&(0,S.jsx)(ge.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,Ce.j)(e),U({x:e.pageX,y:e.pageY}),I(c)},children:(0,S.jsx)(N.Edit,{default:!0})})]},"".concat(e,"-").concat(u||"types"))}),[g,U,I,h]),te=(0,f.useMemo)((function(){return null==V?void 0:V.map((function(e){var n,t=e.column,i=e.property,r=h.bookmark_properties,u=h.key_properties,c=h.partition_keys,s=h.replication_method,a=h.unique_constraints,d=(i.anyOf,i.format,i.metadata),p=(i.type,(0,yn.wx)(t,i)),f=(null==p||p.typesDerived,!d||!(null!=d&&d.metadata)||(null==d||null===(n=d.metadata)||void 0===n?void 0:n.selected)),v=null==q?void 0:q[t],m=null==G?void 0:G[t],b=null==K?void 0:K[t],j=null==z?void 0:z[t],k=[(0,S.jsx)("div",{style:{minHeight:22},children:(0,S.jsx)(Dn.Z,{checked:f,compact:!0,onCheck:function(e){g((function(n){return(0,yn.$C)((0,yn.AP)(h,(0,o.Z)({},t,zn(zn({},d),{},{metadata:zn(zn({},null==d?void 0:d.metadata),{},{selected:e(f)})}))),n)}))}})},"".concat(t,"-selected")),(0,S.jsx)(O.ZP,{monospace:!0,children:t},"".concat(t,"-column")),ne(t,p)];Q&&k.push((0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(x.Z,{checked:v,onClick:function(e){(0,Ce.j)(e),g((function(e){return(0,yn.$C)(zn(zn({},h),{},{unique_constraints:v?(0,L.Od)(a||[],(function(e){return e===t})):(0,L.Hl)(t,a||[])}),e)}))}})},"".concat(t,"-unique")));var Z=[];return Q&&Z.push([b,"key_properties",u]),Rn._B.INCREMENTAL===s&&Z.push([m,"bookmark_properties",r]),Z.push([j,"partition_keys",c]),Z.forEach((function(e){var n=(0,l.Z)(e,3),i=n[0],r=n[1],u=n[2];k.push((0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(x.Z,{checked:i,onClick:function(e){(0,Ce.j)(e),g((function(e){return(0,yn.$C)(zn(zn({},h),{},(0,o.Z)({},r,i?(0,L.Od)(u||[],(function(e){return e===t})):(0,L.Hl)(t,u||[]))),e)}))}})},"".concat(t,"-").concat(r)))})),k}))}),[G,K,z,ne,V,g,h,Q,q]),ie=(0,f.useCallback)((function(e){var n=null==V?void 0:V[e];return zn(zn({},n),{},{highlighted:!(null==r||!r[null==n?void 0:n.column])})}),[r,V]),re=(0,f.useMemo)((function(){var e;if(F&&_){var n=21*w.iI,t=(null==B||null===(e=B.current)||void 0===e?void 0:e.getBoundingClientRect())||{},i=t.x,r=t.width,l=F||{},u=l.x,c=void 0===u?0:u,s=l.y,a=void 0===s?0:s,d=c;c+n>=i+r&&(d=i+r-(n+w.iI)),d<0&&(d=0);var p=(null==b?void 0:b[null==_?void 0:_.uuid])||{},f=(0,yn.wx)(null==_?void 0:_.uuid,p||{}),v=f||{},m=v.typesDerived,k=void 0===m?[]:m,Z=v.uuid;return(0,S.jsx)("div",{onClick:Ce.j,style:{left:d,position:"fixed",top:a+w.iI/2,width:n,zIndex:100},children:(0,S.jsxs)(Wn.Z,{children:[(0,S.jsx)("div",{style:{position:"relative"},children:(0,S.jsx)(ge.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,Ce.j)(e),U(null),I(null)},style:{position:"absolute",right:-.5*w.iI,top:-.5*w.iI,zIndex:1},children:(0,S.jsx)(j.Z,{default:!0,size:2.5*w.iI,children:(0,S.jsx)(N.Close,{size:1.5*w.iI})})})}),(0,S.jsx)(C.Z,{p:w.cd,children:Rn.D5.map((function(e,n){var t=!(null==k||!k.includes(e));return(0,S.jsx)("div",{style:{marginTop:0===n?0:4},children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(x.Z,{checked:t,label:e,onClick:function(n){(0,Ce.j)(n);var i=t?(0,yn.VZ)([e],f):(0,yn.qx)([e],f),r={anyOf:null==i?void 0:i.anyOf,format:null==i?void 0:i.format,type:null==i?void 0:i.type};g((function(e){return(0,yn.$C)((0,yn.KN)(h,(0,o.Z)({},Z,r)),e)}))}})})},e)}))})]})})}}),[F,_,B,b,g,U,I,h]),le=(0,f.useMemo)((function(){return(0,yn.p$)(h,m,v)}),[h,v,m]),oe=(0,f.useCallback)((function(e,n){var t,i=null==le?void 0:le.stream,r=null==i||null===(t=i.schema)||void 0===t?void 0:t.properties;M((function(t){var i=zn({},t);return null==e||e.forEach((function(e){n?i[e]=null==r?void 0:r[e]:e in i&&(null==i||delete i[e])})),i}))}),[le,M]),ue=(0,f.useCallback)((function(e){var n=e||{},t=n.column,i=n.property,r=n.currentProperty,l=!(null==T||!T[t]),o=[(0,S.jsx)(x.Z,{checked:l,onClick:function(e){(0,Ce.j)(e),oe([t],!l)}},"".concat(t,"-accept")),(0,S.jsx)(O.ZP,{monospace:!0,children:t},"".concat(t,"-property")),ne(t,i,{disableEdit:!0})];return r?o.push(ne(t,r,{disableEdit:!0,key:"types-current"})):o.push((0,S.jsx)("div",{},"".concat(t,"-empty"))),o}),[ne,T,oe]),ce=(0,f.useCallback)((function(e,n){var t=n||{},i=t.columnFlex,r=t.columns,l=(null==e?void 0:e.map((function(e){return e.column})))||[],o=null==l?void 0:l.every((function(e){return!(null==T||!T[e])}));return(0,S.jsx)(R.Z,{columnFlex:[null,1].concat(i||[]),columns:[{label:function(){return(0,S.jsx)(x.Z,{checked:o,onClick:function(e){(0,Ce.j)(e),oe(l,!o)}})},uuid:"Accept change"},{uuid:"Property"}].concat(r||[]),highlightRowOnHover:!0,onClickRow:function(n){var t=null==e?void 0:e[n],i=null==t?void 0:t.column,r=!(null==T||!T[i]);oe([i],!r)},rows:null==e?void 0:e.map(ue)})}),[ue,T,oe]),se=(0,f.useMemo)((function(){var e,n;if(!le)return null;var t=le.newColumnSettings,i=le.newColumns,r=le.stream,o=null==r||null===(e=r.schema)||void 0===e?void 0:e.properties,u=null===(n=(0,L.YC)(i,(function(e){return e})))||void 0===n?void 0:n.map((function(e){return{column:e,property:null==o?void 0:o[e]}})),c=(0,L.YC)(Object.entries(t),(function(e){return(0,l.Z)(e,1)[0]})).map((function(e){var n=(0,l.Z)(e,2),t=n[0];n[1];return{column:t,property:null==o?void 0:o[t],currentProperty:null==b?void 0:b[t]}}));return(0,S.jsxs)(S.Fragment,{children:[(null==u?void 0:u.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,warning:!0,children:"New properties"})}),(0,S.jsx)(k.Z,{light:!0}),ce(u,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{label:function(){return""},uuid:"empty"}]})]}),(null==c?void 0:c.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(A.Z,{level:5,warning:!0,children:"Properties with new types"})}),(0,S.jsx)(k.Z,{light:!0}),ce(c,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{uuid:"Types (current)"}]})]})]})}),[le,ce,b]),ae=(0,f.useMemo)((function(){return(0,S.jsx)(R.Z,{columnFlex:$,columns:ee,highlightRowOnHover:!0,isSelectedRow:function(e){var n;return null===(n=ie(e))||void 0===n?void 0:n.highlighted},menu:re,onClickRow:function(e){var n=ie(e),t=n.column,i=n.highlighted;s((function(e){return i?(0,Tn.gR)(e,[t]):zn(zn({},e),{},(0,o.Z)({},t,!0))}))},ref:B,rows:te,stickyHeader:!0})}),[$,ee,ie,B,re,te,s]);return(0,S.jsxs)(S.Fragment,{children:[p&&se&&(0,S.jsxs)(C.Z,{my:w.cd,children:[(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(Gn.NJ,{children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(Z.Z,{children:(0,S.jsx)(N.AlertTriangle,{size:2*w.iI,warning:!0})}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(O.ZP,{muted:!0,children:["The following properties are either new or have different types. Please review and either merge the changes or discard them.",(0,S.jsx)("br",{}),"Click the checkbox to include the updated property when merging changes."]})]})})}),se,(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{children:[(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.BranchAlt,{}),onClick:function(){g((function(e){var n;return(0,yn.$C)(zn(zn({},h),{},{schema:zn(zn({},null==h?void 0:h.schema),{},{properties:zn(zn({},null==h||null===(n=h.schema)||void 0===n?void 0:n.properties),T)})}),e)})),d({noParents:{},parents:{}}),a(Zn.tw.SETTINGS)},primary:!0,children:"Merge changes"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(ge.ZP,{onClick:function(){d({noParents:{},parents:{}}),a(Zn.tw.SETTINGS)},secondary:!0,children:"Discard changes"})]})})]}),!p&&ae,(0,S.jsx)(C.Z,{pb:w.HN})]})},Vn=["block","height","pipeline","selectedSubTab","showError","stream"];function Yn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Xn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Yn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Yn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Qn=function(e){var n=e.block,t=e.height,i=e.pipeline,r=e.selectedSubTab,l=e.showError,o=e.stream,u=(0,Sn.Z)(e,Vn);return Zn.tw.OVERVIEW!==r&&r?Zn.tw.SETTINGS===r||Zn.tw.STREAM_CONFLICTS===r?(0,S.jsx)(qn,Xn(Xn({},u),{},{block:n,showStreamConflicts:Zn.tw.STREAM_CONFLICTS===r,stream:o})):Zn.tw.SAMPLE_DATA===r?(0,S.jsx)(Mn,{block:n,height:t,pipeline:i,showError:l,stream:o}):(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(Hn,Xn(Xn({},u),{},{block:n,stream:o}))},Jn={label:function(e){return"".concat((0,G._6)("stream",e,!0)," fetched")},uuid:"Recently fetched"},$n={label:function(e){return"".concat((0,G._6)("stream",e,!0)," from settings")},uuid:"From stream settings"},et=[Jn,$n];function nt(e,n){return null==n?void 0:n.filter((function(n){var t=new RegExp(e||"","i"),i=(0,yn.M$)(n);return!e||(null==i?void 0:i.match(t))||(null==i?void 0:i.replace("-"," ").match(t))||(null==i?void 0:i.replace("-","").match(t))||(null==i?void 0:i.replace("_"," ").match(t))||(null==i?void 0:i.replace("_","").match(t))||(null==i?void 0:i.replaceAll("-"," ").match(t))||(null==i?void 0:i.replaceAll("-","").match(t))||(null==i?void 0:i.replaceAll("_"," ").match(t))||(null==i?void 0:i.replaceAll("_","").match(t))}))}var tt=function(e){var n=e.block,t=e.blocksMapping,i=e.height,r=e.onChangeBlock,u=e.searchText,c=e.setSelectedMainNavigationTab,s=(e.setSelectedSubTab,e.setStreamsMappingConflicts),a=e.streamsFetched,d=e.updateStreamsInCatalog,p=e.width,h=(0,f.useMemo)((function(){return(0,yn.Uc)(n,{getAll:!0})}),[n]),v=(0,f.useMemo)((function(){return(0,yn.UA)(h)}),[h]),m=(0,f.useMemo)((function(){return(0,yn.UA)(a||[])}),[a]),g=(0,f.useCallback)((function(e){return(0,yn.ig)(e,m,v)}),[m,v]),b=(0,f.useCallback)((function(e){return(0,yn.p$)(e,m,v)}),[m,v]),x=(0,f.useCallback)((function(e){var n;return(n={},(0,o.Z)(n,Jn.uuid,m),(0,o.Z)(n,$n.uuid,v),n)[e]}),[v,m]),j=(0,f.useMemo)((function(){var e=[];return et.forEach((function(n,i){var r,o=n.label,c=n.uuid,s=x(c),a=[],d=Object.values((null==s?void 0:s.noParents)||{})||[],p=nt(u,d);(null==p?void 0:p.length)>=1&&a.push({streams:(0,L.YC)(p||[],yn.M$)}),null===(r=Object.entries((null==s?void 0:s.parents)||{}))||void 0===r||r.forEach((function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1],o=nt(u,Object.values(r||{})||[]);(null==o?void 0:o.length)>=1&&a.push({block:null==t?void 0:t[i],streams:(0,L.YC)(o||[],yn.M$)})})),(null==a?void 0:a.length)>=1&&e.push({count:(0,L.Sm)((null==a?void 0:a.map((function(e){var n=e.streams;return(null==n?void 0:n.length)||0})))||[]),label:o,subgroups:a,uuid:c})})),e}),[x,u]),P=(0,f.useMemo)((function(){return(null==j?void 0:j.length)||0}),[j]);return(0,S.jsx)(S.Fragment,{children:null==j?void 0:j.map((function(e,n){var t=e.count,l=e.label,o=e.subgroups,u=e.uuid,a=Jn.uuid===u;return(0,S.jsx)(Ue,{style:{height:i,right:$n.uuid===u?null:0,width:p/P},children:(0,S.jsx)(He,{borderRight:P>=2&&!a,style:{height:i,width:p/P},children:(0,S.jsxs)(C.Z,{pt:w.cd,children:[(0,S.jsx)(C.Z,{px:w.Mq,children:(0,S.jsx)(A.Z,{level:4,children:l(t)})}),null==o?void 0:o.map((function(e,n){var t,i=e.block,l=e.streams;return(0,S.jsxs)(C.Z,{mt:i&&0===n?w.cd:1,children:[(0,S.jsx)(C.Z,{mb:i?w.cd:0,mt:i?0:w.cd,children:(0,S.jsx)(k.Z,{light:!0})}),i&&(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(O.ZP,{bold:!0,color:null===(t=(0,_.qn)(null==i?void 0:i.type,{blockColor:null==i?void 0:i.color}))||void 0===t?void 0:t.accent,default:!0,large:!0,monospace:!0,children:null==i?void 0:i.uuid})}),(0,S.jsx)(C.Z,{p:1,children:(0,S.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:null==l?void 0:l.map((function(e){var n=g(e),t=!!b(e),i=(0,yn.M$)(e),l=(0,yn.Qu)(e),o=!1;if(a){var u=(0,yn.zB)(e,x($n.uuid));u&&(o=(0,yn.Z5)(u))}else o=(0,yn.Z5)(e);var p=n&&t;return(0,S.jsx)(We,{onClick:a&&p?function(){return!1}:function(n){n.preventDefault(),d([(0,yn.XE)(e,{selected:!o})],(function(e){return null==r?void 0:r(e)}))},selected:o,warning:p&&a,children:(0,S.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(O.ZP,{monospace:!0,muted:!o,children:i})}),p&&a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{monospace:!0,warning:!0,children:"exists"})]}),p&&a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Z.Z,{alignItems:"center",style:{minHeight:3*w.iI},children:(0,S.jsx)(ge.ZP,{compact:!0,onClick:function(){s((function(n){return(0,yn.UA)([e],n)})),c((function(e){return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:l,selectedSubTab:Zn.tw.STREAM_CONFLICTS}}))},small:!0,warning:!0,children:"View differences"})})]}),(!p||!a)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:w.HN}),o&&(0,S.jsx)(N.Settings,{size:2*w.iI}),(0,S.jsx)(C.Z,{mr:o?1:3}),(0,S.jsx)(Z.Z,{alignItems:"center",style:{height:3*w.iI},children:(0,S.jsx)(Dn.Z,{checked:o,compact:!0,onCheck:function(n){return d([(0,yn.XE)(e,{selected:n(o)})],(function(e){return null==r?void 0:r(e)}))}})})]})]})},i)}))})})]},i?null==i?void 0:i.uuid:"no-subtitle-".concat(n))}))]})})},u)}))})};function it(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function rt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?it(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):it(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var lt=function(e){var n=e.attributes,t=e.attributesMapping,i=e.columnFlex,r=e.rightAlignColumnForRowIndexes,l=e.rowGroupHeaders,u=e.rowsGroupedByIndex,c=e.setAttributesMapping,s=(0,f.useCallback)((function(e,n){var i,l=e.inputType,u=e.label,s=e.options,a=e.uuid,d=null==t?void 0:t[a],p=!(null==d||!d.selected),f=null==d?void 0:d.value;return Zn.oI.CHECKBOX===l?i=(0,S.jsx)(x.Z,{checked:!!f,onClick:function(e){p&&(0,Ce.j)(e),c((function(e){return rt(rt({},e),{},(0,o.Z)({},a,rt(rt({},null==e?void 0:e[a]),{},{value:!f})))}))}}):Zn.oI.SELECT===l?i=(0,S.jsxs)(sn.Z,{compact:!0,fullWidth:!0,onChange:function(e){(0,Ce.j)(e),c((function(n){var t;return rt(rt({},n),{},(0,o.Z)({},a,rt(rt({},null==n?void 0:n[a]),{},{value:null==e||null===(t=e.target)||void 0===t?void 0:t.value})))}))},onClick:function(e){p&&(0,Ce.j)(e)},value:f,children:[(0,S.jsx)("option",{value:""}),null==s?void 0:s.map((function(e){var n=e.disabled,t=e.label,i=e.value;return(0,S.jsx)("option",{disabled:n,value:i,children:t?t():i},i)}))]}):Zn.oI.TOGGLE===l&&(i=(0,S.jsx)(Dn.Z,{checked:f,compact:!0,onCheck:function(e){c((function(n){return rt(rt({},n),{},(0,o.Z)({},a,rt(rt({},null==n?void 0:n[a]),{},{value:e(f)})))}))},pauseEvent:p})),[(0,S.jsx)(x.Z,{checked:p,onClick:function(e){(0,Ce.j)(e),c((function(e){return rt(rt({},e),{},(0,o.Z)({},a,rt(rt({},null==e?void 0:e[a]),{},{selected:!p})))}))}},"".concat(a,"-checkbox")),(0,S.jsx)(O.ZP,{muted:!p,children:u()},"".concat(a,"-name")),(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:null!=r&&r.includes(n)?"flex-end":"center",children:i},"".concat(a,"-value"))]}),[t,r,c]);return(0,f.useMemo)((function(){return(0,S.jsx)(R.Z,{columnFlex:i||[null,1,null],columns:[{uuid:"Use"},{uuid:"Attribute"},{uuid:"Value"}],groupsInline:!0,onClickRow:function(e){var i=null==n?void 0:n[e],r=null==i?void 0:i.uuid,l=null==t?void 0:t[r],u=!(null==l||!l.selected);c((function(e){return rt(rt({},e),{},(0,o.Z)({},r,rt(rt({},null==e?void 0:e[r]),{},{selected:!u})))}))},rowGroupHeaders:l,rowsGroupedByIndex:u,rows:n.map((function(e,n){return s(e,n)}))})}),[n,t,i,s])};var ot=function(e){var n=e.selectedStreamMapping,t=e.setSelectedStreamMapping,i=e.streamMapping,r=(0,f.useMemo)((function(){return(0,yn.th)(i)}),[i]),l=(0,f.useMemo)((function(){var e=[],t=[],i=[],l=[],o=0;return null==r||r.forEach((function(r){var u=r.groupHeader,c=r.streams;e.push(u);var s=[];null==c||c.forEach((function(e){l.push(e),s.push(o),o+=1;var i=(0,yn.WD)(e),r=(0,yn.M$)(e),u=!!(0,yn.zB)(e,n),c=[(0,S.jsx)(x.Z,{checked:u},"".concat(i,"-").concat(r,"-use")),(0,S.jsx)(O.ZP,{muted:!u,children:r},"".concat(i,"-").concat(r,"-stream"))];t.push(c)})),i.push(s)})),{rowGroupHeaders:e,rows:t,rowsGroupedByIndex:i,streamsArray:l}}),[n,r]),o=l.rowGroupHeaders,u=l.rows,c=l.rowsGroupedByIndex,s=l.streamsArray,a=(0,f.useMemo)((function(){var e,t;return(null===(e=Object.values((null==n?void 0:n.noParents)||{}))||void 0===e?void 0:e.length)+(0,L.Sm)(null===(t=Object.values((null==n?void 0:n.parents)||{}))||void 0===t?void 0:t.map((function(e){var n;return null===(n=Object.values(e||{}))||void 0===n?void 0:n.length})))}),[n]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)("div",{children:[(0,S.jsxs)(A.Z,{children:[(0,G._6)("stream",a||0)," chosen"]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})})]})}),(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{uuid:"Use"},{uuid:"Stream"}],groupsInline:!0,onClickRow:function(e){var i=null==s?void 0:s[e],r=!!(0,yn.zB)(i,n);t((function(e){return(0,yn.iN)(i,e,{remove:r})}))},rowGroupHeaders:o,rows:u,rowsGroupedByIndex:c,stickyHeader:!0})]})};var ut=function(e){var n=e.attributesMapping,t=e.selectedStreamMapping,i=e.setAttributesMapping,r=e.setSelectedStreamMapping,l=e.streamMapping,o=(0,f.useMemo)((function(){return(0,S.jsx)(lt,{attributes:[{label:function(){return"Replication method"},inputType:Zn.oI.SELECT,options:Rn.jL.map((function(e){return{label:function(){return(0,G.vg)(e)},value:e}})),uuid:yn.I1.REPLICATION_METHOD},{label:function(){return"Unique conflict method"},inputType:Zn.oI.SELECT,options:Object.values(Rn.MU).map((function(e){return{label:function(){return(0,G.vg)(e)},value:e}})),uuid:yn.I1.UNIQUE_CONFLICT_METHOD},{label:function(){return"Run stream in parallel"},inputType:Zn.oI.TOGGLE,uuid:yn.I1.RUN_IN_PARALLEL},{label:function(){return"Automatically add new columns"},inputType:Zn.oI.TOGGLE,uuid:yn.I1.AUTO_ADD_NEW_FIELDS},{label:function(){return"Disable strict column type checks"},inputType:Zn.oI.TOGGLE,uuid:yn.I1.DISABLE_COLUMN_TYPE_CHECK}],attributesMapping:n,columnFlex:[null,1,1],rightAlignColumnForRowIndexes:[2,3,4],setAttributesMapping:i})}),[n,i]),u=(0,f.useMemo)((function(){return(0,S.jsx)(ot,{selectedStreamMapping:t,setSelectedStreamMapping:r,streamMapping:l})}),[t,r,l]);return(0,S.jsxs)(Ge,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)("div",{children:[(0,S.jsx)(A.Z,{children:"Make changes to multiple streams"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the attributes below and change the values of those attributes for all the selected streams."})})]})}),o,u]})};function ct(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function st(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ct(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ct(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var at=function(e){var n,t,i=e.attributesMapping,u=e.block,c=e.highlightedColumnsMapping,s=e.selectedStreamMapping,a=e.setAttributesMapping,d=e.setHighlightedColumnsMapping,p=e.setSelectedStreamMapping,h=e.stream,v=e.streamMapping,m=(e.updateStreamsInCatalog,null==u||null===(n=u.metadata)||void 0===n||null===(t=n.data_integration)||void 0===t?void 0:t.destination),g=(0,f.useMemo)((function(){return!Rn.kB.includes(m)}),[m]);(0,f.useEffect)((function(){if(h&&!s){var e=(0,yn.M$)(h||{}),n=(0,yn.Qu)(h||{});n?p({noParents:{},parents:(0,o.Z)({},n,(0,o.Z)({},e,h))}):e&&p({noParents:(0,o.Z)({},e,h),parents:{}})}}),[s,p,h]);var b=(0,f.useMemo)((function(){return(null==h?void 0:h.replication_method)===Rn._B.INCREMENTAL}),[null==h?void 0:h.replication_method]),x=(0,f.useMemo)((function(){var e=[{label:function(){return"Include property when syncing"},inputType:Zn.oI.CHECKBOX,uuid:yn.I1.PROPERTY_SELECTED},{label:function(){return"Partition key"},inputType:Zn.oI.CHECKBOX,uuid:yn.I1.PARTITION_KEYS}].concat((0,r.Z)(Rn.D5.map((function(e){return{label:function(){return(0,G.vg)(e)},inputType:Zn.oI.CHECKBOX,uuid:e}}))));b&&e.splice(1,0,{label:function(){return"Bookmark property"},inputType:Zn.oI.CHECKBOX,uuid:yn.I1.BOOKMARK_PROPERTIES}),g&&e.splice(1,0,{label:function(){return"Unique constraint"},inputType:Zn.oI.CHECKBOX,uuid:yn.I1.UNIQUE_CONSTRAINTS},{label:function(){return"Key property"},inputType:Zn.oI.CHECKBOX,uuid:yn.I1.KEY_PROPERTIES});var n=2;b&&(n+=1),g&&(n+=2);var t=(0,L.m5)(n);return(0,S.jsx)(lt,{attributes:e,attributesMapping:i,rowGroupHeaders:["Options","Column types"],rowsGroupedByIndex:[t,null===Rn.D5||void 0===Rn.D5?void 0:Rn.D5.map((function(e,t){return t+n}))],setAttributesMapping:a})}),[i,a,g,b]),j=(0,f.useMemo)((function(){return(0,S.jsx)(ot,{selectedStreamMapping:s,setSelectedStreamMapping:p,streamMapping:v})}),[s,p,v]),k=(0,f.useMemo)((function(){var e,n=null===(e=Object.entries(c||{}))||void 0===e?void 0:e.reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);return(0,L.YC)(n,(function(e){return e}))}),[c]);return(0,S.jsxs)(Ge,{children:[(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsxs)("div",{children:[(0,S.jsxs)(A.Z,{children:[!(null!=k&&k.length)&&"Choose at least 1 property",(null==k?void 0:k.length)>=1&&"".concat((0,G._6)("property",(null==k?void 0:k.length)||0)," chosen")]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:[!(null!=k&&k.length)&&"Click 1 or more rows in the table to select which schema properties to apply bulk changes to.",(null==k?void 0:k.length)>=1&&(0,S.jsx)(S.Fragment,{children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})]})})]}),(null==k?void 0:k.length)>=1&&(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:null==k?void 0:k.map((function(e){return(0,S.jsx)("div",{style:{marginBottom:w.iI/2,marginRight:w.iI/2},children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){d((function(n){return!(null==n||!n[e])?(0,Tn.gR)(n,[e]):st(st({},n),{},(0,o.Z)({},e,!0))}))}})},"".concat(e,"-chip"))}))})})]}),x,j]})};function dt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function pt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?dt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):dt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ft={compact:!0,small:!0};var ht=function(e){var n=e.block,t=e.blocksMapping,i=e.onChangeBlock,r=e.selectedStreamMapping,l=e.setSelectedMainNavigationTab,u=e.setSelectedStreamMapping,c=e.streamMapping,s=e.updateStreamsInCatalog,a=(0,f.useRef)(null),d=(0,f.useState)({}),p=d[0],h=d[1],v=(0,f.useCallback)((function(e){return s(e,(function(e){return null==i?void 0:i(e)}))}),[i,s]),m=(n||{}).type,g=c||{},x=g.noParents,j=g.parents,k=(0,f.useMemo)((function(){return(0,Tn.Qr)(x||{})&&(0,Tn.Qr)(j||{})}),[x,j]),I=(0,f.useMemo)((function(){return(0,yn.th)(c)}),[c]),E=(0,f.useMemo)((function(){var e=[null,1,3,2,2,null],n=[{label:function(e){var n=e.groupIndex,t=((null==I?void 0:I[n])||{}).streams,i=t&&(null==t?void 0:t.every((function(e){return(0,yn.Z5)(e)})));return(0,S.jsx)(Dn.Z,{checked:i,compact:!0,disabled:!(null!=t&&t.length),onCheck:function(e){t&&v(null==t?void 0:t.map((function(n){return(0,yn.XE)(n,{selected:e(i)})})))}})},uuid:"action"},{uuid:"Stream"},{uuid:"Table"},{uuid:"Sync"},{uuid:"Unique conflict"},{center:b.tf.DATA_EXPORTER===m,rightAligned:b.tf.DATA_EXPORTER!==m,uuid:"Parallel"}];return b.tf.DATA_EXPORTER===m&&(e.push.apply(e,[null,null]),n.push.apply(n,[{center:!0,uuid:"Add columns"},{center:!0,uuid:"No strict check"}])),{columnFlex:e,columns:n}}),[m,I,v]),T=E.columnFlex,M=E.columns,B=(0,f.useMemo)((function(){var e=[],n=[],i=[],r=[],u=0;return null==I||I.forEach((function(c){var s=c.groupHeader,d=c.streams,g=s?null==t?void 0:t[s]:null;g?n.push((0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(O.ZP,{bold:!0,color:(0,_.qn)(null==g?void 0:g.type,{blockColor:null==g?void 0:g.color}).accent,monospace:!0,children:s})})):n.push(s);var x=[];null==d||d.forEach((function(n){e.push(n),x.push(u),u+=1;var t=(0,yn.WD)(n),r=(0,yn.Qu)(n),c=(0,yn.M$)(n),s=n.auto_add_new_fields,d=n.bookmark_properties,g=n.destination_table,j=n.disable_column_type_check,k=n.replication_method,w=n.run_in_parallel,_=n.unique_conflict_method,I=(0,yn.Z5)(n),E=t in p?null==p?void 0:p[t]:g,T=[(0,S.jsx)(Dn.Z,{checked:I,compact:!0,onCheck:function(e){v([(0,yn.XE)(n,{selected:e(I)})])}},"".concat(t,"-action")),(0,S.jsx)(P.Z,{bold:!0,monospace:!0,onClick:function(){l(c,r)},preventDefault:!0,sameColorAsText:!0,children:c},"".concat(t,"-name")),(0,S.jsx)(Ie.Z,{compact:!0,defaultColor:!E,monospace:!0,onChange:function(e){var i,r=null==e||null===(i=e.target)||void 0===i?void 0:i.value;h((function(e){return pt(pt({},e),{},(0,o.Z)({},t,r))})),clearTimeout(a.current),a.current=setTimeout((function(){return v([pt(pt({},n),{},{destination_table:r})])}),300)},onClick:Ce.j,placeholder:c,value:E||""},"".concat(t,"-destinationTable")),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(sn.Z,pt(pt({},ft),{},{fullWidth:!0,onChange:function(e){var t;return v([pt(pt({},n),{},{replication_method:null==e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:Ce.j,placeholder:"Replication method",value:k,children:Rn.jL.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.vg)(e)},e)}))}))}),Rn._B.INCREMENTAL===k&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),!(null!=d&&d.length)&&(0,S.jsx)(O.ZP,{danger:!0,xsmall:!0,children:"No bookmark properties set"}),(null==d?void 0:d.length)>=1&&(null==d?void 0:d.map((function(e,n){return(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,xsmall:!0,children:[n>=1&&", ",e]},e)})))]})]},"".concat(t,"-replicationMethod")),(0,f.createElement)(sn.Z,pt(pt({},ft),{},{key:"".concat(t,"-uniqueConflictMethod"),onChange:function(e){var t;return v([pt(pt({},n),{},{unique_conflict_method:null==e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:Ce.j,placeholder:"Unique conflict method",value:_}),Object.values(Rn.MU).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.vg)(e)},e)}))),(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:b.tf.DATA_EXPORTER===m?"center":"flex-end",children:(0,S.jsx)(Dn.Z,{checked:!!w,compact:!0,onCheck:function(e){v([pt(pt({},n),{},{run_in_parallel:e(w)})])}})},"".concat(t,"-runInParallel"))];b.tf.DATA_EXPORTER===m&&T.push.apply(T,[(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(Dn.Z,{checked:!!s,compact:!0,onCheck:function(e){v([pt(pt({},n),{},{auto_add_new_fields:e(s)})])}})},"".concat(t,"-autoAddNewFields")),(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(Dn.Z,{checked:!!j,compact:!0,onCheck:function(e){v([pt(pt({},n),{},{disable_column_type_check:e(j)})])}})},"".concat(t,"-disableColumnTypeCheck"))]),i.push(T)})),r.push(x)})),{rowGroupHeaders:n,rows:i,rowsGroupedByIndex:r,streamsInRows:e}}),[m,t,p,h,l,I,a,v]),D=B.rowGroupHeaders,N=B.rows,L=B.rowsGroupedByIndex,F=B.streamsInRows;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(A.Z,{children:"Overview of streams"}),k&&(0,S.jsxs)(C.Z,{mt:1,children:[(0,S.jsx)(O.ZP,{default:!0,children:"Fetch and add at least 1 stream to the catalog in order to see an overview of all the configured stream."}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return l(Zn.uK.STREAMS)},preventDefault:!0,children:"Go and fetch Streams"})})]})]}),!k&&(0,S.jsx)(R.Z,{columnFlex:T,columns:M,isSelectedRow:function(e){var n=null==F?void 0:F[e];return!!(0,yn.zB)(n,r)},groupsInline:!0,onClickRow:function(e){var n=null==F?void 0:F[e],t=!!(0,yn.zB)(n,r);u((function(e){return(0,yn.iN)(n,e,{remove:t})}))},rowGroupHeaders:D,rows:N,rowsGroupedByIndex:L,stickyHeader:!0})]})};function vt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function mt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gt=3*w.iI*2;var bt=function(e){var n=e.block,t=void 0===n?null:n,i=e.defaultMainNavigationTab,u=void 0===i?null:i,c=e.defaultMainNavigationTabSub,s=void 0===c?null:c,a=e.defaultSubTab,d=void 0===a?null:a,p=e.onChangeBlock,v=e.onChangeCodeBlock,m=e.onClose,g=e.onSaveBlock,I=e.pipeline,E=e.savePipelineContent,T=e.setContent,M=(0,f.useRef)(null),B=(0,f.useRef)(null),D=(0,f.useRef)(null),R=(0,f.useRef)(null),F=(0,f.useState)({}),U=F[0],H=F[1],W=(0,f.useState)(null),G=W[0],K=W[1],z=(0,f.useState)(!1),q=z[0],V=z[1],X=(0,Qe.i)(),Q=X.height,J=X.width,$=I||{},ee=$.blocks,ne=$.uuid,te=t||{},ie=(te.catalog,te.content),re=(te.language,te.type),le=te.uuid,oe=(0,f.useMemo)((function(){return b.tf.DATA_LOADER===re?dn.O.SOURCES:dn.O.DESTINATIONS}),[re]),ue=(0,f.useState)(t||null),ce=ue[0],ae=ue[1],pe=ce||{},fe=(pe.configuration,pe.content),he=pe.metadata,ve=(0,f.useMemo)((function(){return(null==he?void 0:he.data_integration)||{}}),[he]),me=ve.destination,be=ve.name,xe=ve.source,ke=(0,f.useMemo)((function(){return me||xe||null}),[me,xe]),Ze=(0,f.useMemo)((function(){var e={include_block_catalog:!0,include_block_metadata:!0,include_documentation:!0};return ke&&(e.data_integration_uuid=ke),e}),[ke]),Pe=Y.ZP.blocks.pipelines.detail(ne,le,Ze,{},{key:"pipelines/".concat(ne,"/blocks/").concat(le,"/documentation")}).data,Ce=(0,f.useMemo)((function(){var e;return(null==ce||null===(e=ce.configuration)||void 0===e?void 0:e.data_integration)||{}}),[ce]),Oe=(0,f.useCallback)((function(e){return ae((function(n){var t,i=mt(mt({},n),{},{configuration:mt(mt({},null==n?void 0:n.configuration),{},{data_integration:e((null==n||null===(t=n.configuration)||void 0===t?void 0:t.data_integration)||{})})});return null==p||p(i),i}))}),[p,ae]),we=(0,f.useCallback)((function(e){return Oe((function(n){return mt(mt({},n),{},{inputs:e((null==n?void 0:n.inputs)||{})})}))}),[Oe]),_e=(0,f.useCallback)((function(e,n){return ae((function(t){var i=(null==t?void 0:t.catalog)||{streams:[]},l=(0,r.Z)((null==i?void 0:i.streams)||[]);null==e||e.forEach((function(e){var n=(0,yn.M$)(e),t=null==e?void 0:e.parent_stream,i=null==l?void 0:l.findIndex((function(e){var i=(0,yn.M$)(e),r=null==e?void 0:e.parent_stream;return n===i&&t===r})),r={};i>=0&&(r=null==l?void 0:l[i]);var o=mt(mt({},r),e);i>=0?l[i]=o:l.push(o)}));var o=mt(mt({},t),{},{catalog:mt(mt({},i),{},{streams:l})});return null==n||n(o),o}))}),[ae]),Se=(0,f.useMemo)((function(){return null==Pe?void 0:Pe.block}),[Pe]);(0,f.useEffect)((function(){Se&&(ce&&(null==Se?void 0:Se.uuid)===(null==ce?void 0:ce.uuid)||ae(Se))}),[ce,Se]);var Te=(0,f.useMemo)((function(){return(0,L.HK)(ee||[],(function(e){return e.uuid}))}),[ee]),Me=(0,f.useMemo)((function(){var e;return null==ce||null===(e=ce.upstream_blocks)||void 0===e?void 0:e.map((function(e){return null==Te?void 0:Te[e]}))}),[ce,Te]),Be=(0,f.useMemo)((function(){return null==Se?void 0:Se.documentation}),[Se]),Ue=(0,f.useMemo)((function(){return(0,yn.Uc)(ce,{getAll:!0})}),[ce]),He=(0,f.useMemo)((function(){return(0,yn.UA)(Ue)}),[Ue]),We=(0,f.useMemo)((function(){return"DataIntegrationModal/".concat(le)}),[le]),Ge=(0,f.useMemo)((function(){return"block_layout_after_width_".concat(We)}),[We]),Ke=(0,f.useMemo)((function(){return"block_layout_before_width_".concat(We)}),[We]),ze=(0,se.VI)(null,{},[],{uuid:We}),qe=(0,l.Z)(ze,1)[0],Ye=(0,f.useState)((0,Ve.U2)(Ge,60*w.iI)),Xe=Ye[0],Je=Ye[1],$e=(0,f.useState)(!1),en=$e[0],nn=$e[1],tn=(0,f.useState)(Math.max((0,Ve.U2)(Ke),40*w.iI)),rn=tn[0],ln=tn[1],on=(0,f.useState)(!1),un=on[0],cn=on[1],sn=(0,f.useState)({}),an=sn[0],pn=sn[1],fn=(0,f.useState)({selectedMainNavigationTab:null,selectedMainNavigationTabSub:s,selectedSubTab:null}),hn=fn[0],vn=hn.selectedMainNavigationTab,mn=hn.selectedMainNavigationTabSub,bn=hn.selectedSubTab,xn=fn[1],jn=(0,f.useState)((0,yn.UA)([])),kn=jn[0],Pn=jn[1],Cn=(0,f.useMemo)((function(){if(!(0,Tn.Qr)(null==kn?void 0:kn.noParents)||!(0,Tn.Qr)(null==kn?void 0:kn.parents)){var e,n,t,i;if(vn)if(mn)e=null==kn||null===(n=kn.parents)||void 0===n||null===(t=n[vn])||void 0===t?void 0:t[mn];else e=null==kn||null===(i=kn.noParents)||void 0===i?void 0:i[vn];return(0,Zn.C0)({addStreamConflicts:!!e})}return(0,Zn.C0)()}),[vn,mn,kn]),Sn=(0,f.useCallback)((function(e){return e in Zn.Pf?Zn.Pf[e]:Cn}),[Cn]),In=(0,f.useCallback)((function(e){xn((function(n){return function(e,n){var t=e||{},i=t.selectedMainNavigationTab,r=t.selectedMainNavigationTabSub,l=t.selectedSubTab,o=n||{},u=o.selectedMainNavigationTab,c=o.selectedMainNavigationTabSub,s=i in Zn.Pf?Zn.Pf[i]:Cn,a=l;if(Zn.mU[i]||Zn.mU[u]){var d,p,f;if(a){if(Zn.mU[u]&&!Zn.mU[i]){var h;!a||null!=Cn&&Cn.includes(a)||Zn.tw.STREAM_CONFLICTS===a||(a=null==Cn||null===(h=Cn[0])||void 0===h?void 0:h.uuid)}}else a=null==s||null===(f=s[0])||void 0===f?void 0:f.uuid;i!==u&&pn({});var v=(0,yn.zB)({parent_stream:c,stream:u,tap_stream_id:u},He),m=(0,yn.zB)({parent_stream:r,stream:i,tap_stream_id:i},He),g=(0,L.jV)(Object.keys((null==v||null===(d=v.schema)||void 0===d?void 0:d.properties)||{}),Object.keys((null==m||null===(p=m.schema)||void 0===p?void 0:p.properties)||{}));pn((function(e){return mt({},(0,Tn.GL)(e,g||[]))}))}return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:r,selectedSubTab:a}}(e(n),n)}))}),[pn,He,Cn]);(0,f.useEffect)((function(){vn||In((function(e){var n,t,i=e.selectedSubTab;return{selectedMainNavigationTab:u||Zn.uK.CONFIGURATION,selectedMainNavigationTabSub:s,selectedSubTab:u?d||(null===(n=Sn(u))||void 0===n||null===(t=n[0])||void 0===t?void 0:t.uuid):i}}))}),[u,s,d,Sn,vn,In]);var En=(0,f.useMemo)((function(){return Sn(vn)}),[Sn,vn]),Mn=(0,f.useMemo)((function(){var e=[{Icon:N.SettingsWithKnobs,uuid:Zn.uK.CONFIGURATION},{Icon:N.Sun,uuid:Zn.uK.STREAMS},{Icon:N.Table,uuid:Zn.uK.OVERVIEW}].map((function(e){var n=e.Icon,t=e.uuid;return(0,S.jsx)(Fe,{selected:vn===t,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return In((function(){return{selectedMainNavigationTab:t}}))},preventDefault:!0,children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{primaryLight:!0,size:4*w.iI,square:!0,children:(0,S.jsx)(n,{size:2*w.iI})}),(0,S.jsx)(C.Z,{mr:2}),(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:Zn.TD[t]})]})})})},t)})),n=(null==Ue?void 0:Ue.length)||0,t=[],i={};return null==Ue||Ue.forEach((function(e){var n=e.parent_stream;n?(null!=i&&i[n]||(i[n]=[]),i[n].push(e)):t.push(e)})),[{block:null,streams:t}].concat((0,r.Z)((0,L.YC)(Object.entries(i),(function(e){var n=(0,l.Z)(e,2),t=n[0];n[1];return t})).map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return{block:null==Te?void 0:Te[t],streams:i}})))).forEach((function(t){var i=t.block,r=t.streams;if(i){var l=null==i?void 0:i.uuid;e.push((0,S.jsx)(k.Z,{light:!0},"block-".concat(l,"-divider-top"))),e.push((0,S.jsx)(C.Z,{px:w.cd,py:1,children:(0,S.jsx)(O.ZP,{bold:!0,color:(0,_.qn)(null==i?void 0:i.type,{blockColor:null==i?void 0:i.color}).accent,monospace:!0,small:!0,children:l})},"block-".concat(l)))}null==r||r.forEach((function(t,i){var r=(0,yn.M$)(t),l=(0,yn.Qu)(t),o=(0,yn.WD)(t),u=(0,yn.Z5)(t),c=vn===r&&(!l||mn===l);e.push((0,S.jsx)(k.Z,{light:!0},"".concat(o,"-divider-top"))),e.push((0,S.jsx)(Fe,{selected:c,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){In((function(e){var n=e.selectedSubTab;return{selectedMainNavigationTab:r,selectedMainNavigationTabSub:l,selectedSubTab:n}}))},preventDefault:!0,children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{size:1*w.iI,success:u}),(0,S.jsx)(C.Z,{mr:2}),(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(O.ZP,{default:!u,monospace:!0,children:r})})]})})})},o)),i===n-1&&e.push((0,S.jsx)(k.Z,{light:!0},"".concat(o,"-divider-last")))}))})),e}),[Te,vn,mn,In,Ue]),Bn=(0,f.useState)(null),An=Bn[0],Rn=Bn[1],Nn=(0,f.useMemo)((function(){return(0,yn.qf)(He,(0,yn.UA)(An||[]))}),[He,An]),Ln=(0,h.Db)(Y.ZP.integration_sources.useUpdate(ne),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var n=e.integration_source.streams;Rn(n)},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}}),Fn=(0,l.Z)(Ln,2),Un=Fn[0],Hn=Fn[1].isLoading,Wn=(0,f.useCallback)((function(){return Un({integration_source:{block_uuid:le}})}),[le,Un]),Gn=(0,f.useState)(null),Kn=Gn[0],zn=Gn[1],qn=(0,f.useMemo)((function(){return(0,S.jsxs)("div",{ref:R,children:[(null==En?void 0:En.length)>=1&&(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(de.Z,{noPadding:!0,onClickTab:function(e){var n=e.uuid;return In((function(e){return mt(mt({},e),{},{selectedSubTab:n})}))},regularSizeText:!0,selectedTabUUID:bn,tabs:En})}),!(null!=En&&En.length)&&Zn.uK.STREAMS===vn&&(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(Ie.Z,{beforeIcon:(0,S.jsx)(N.Search,{muted:!(null!=Kn&&Kn.length),size:2*w.iI}),fullWidth:!0,noBackground:!0,noBorder:!0,noBorderRadiusBottom:!0,noBorderRadiusTop:!0,onChange:function(e){var n;return zn(null==e||null===(n=e.target)||void 0===n?void 0:n.value)},paddingHorizontal:w.iI*w.cd,paddingVertical:w.iI*w.cd,placeholder:"Type the name of the stream to filter...",value:Kn||""})}),(null==Kn?void 0:Kn.length)>=1&&(0,S.jsx)(ge.ZP,{iconOnly:!0,noPadding:!0,noBackground:!0,noBorder:!0,onClick:function(){return zn(null)},children:(0,S.jsx)(N.Close,{default:!0,size:2*w.iI})}),!Nn&&(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.CubeWithArrowDown,{size:2*w.iI}),compact:!0,loading:Hn,onClick:function(){return Wn()},primary:!0,children:"Fetch streams"})})]}),(0,S.jsx)(k.Z,{light:!0})]})}),[Wn,Hn,Nn,R,Kn,vn,bn,zn,In,En]),Vn=(0,f.useMemo)((function(){return Q-2*De}),[Q]),Yn=(0,f.useMemo)((function(){return J-2*De}),[J]),Xn=(0,f.useState)(null),Jn=Xn[0],$n=Xn[1],et=(0,f.useState)(null),nt=et[0],it=et[1],rt=(0,f.useState)(null),lt=(rt[0],rt[1]),ot=(0,f.useState)(!1),ct=ot[0],st=ot[1];(0,f.useEffect)((function(){var e,n,t,i,r,l;(vn||bn)&&($n(null==R||null===(e=R.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height),lt(null==B||null===(t=B.current)||void 0===t||null===(i=t.getBoundingClientRect())||void 0===i?void 0:i.height),it(null==D||null===(r=D.current)||void 0===r||null===(l=r.getBoundingClientRect())||void 0===l?void 0:l.height))}),[D,B,R,vn,bn]);var dt=(0,h.Db)(Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(ne),encodeURIComponent(le)),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){null==g||g(null==e?void 0:e.block)},onErrorCallback:function(e,n){return qe({errors:n,response:e})}})}}),pt=(0,l.Z)(dt,2),ft=(pt[0],pt[1].isLoading,(0,f.useMemo)((function(){return vn&&![Zn.uK.CONFIGURATION,Zn.uK.OVERVIEW,Zn.uK.STREAMS,Zn.uK.SYNC].includes(vn)}),[vn])),vt=(0,f.useMemo)((function(){return ft&&Zn.tw.SETTINGS===bn}),[ft,bn]),bt=(0,f.useMemo)((function(){return Zn.uK.CONFIGURATION===vn&&Zn.tw.CREDENTIALS===bn}),[vn,bn]),xt=(0,f.useMemo)((function(){return Zn.uK.OVERVIEW===vn}),[vn]),jt=(0,f.useMemo)((function(){return!(bt||vt||xt&&(null==Ue?void 0:Ue.length)>=1)||ct}),[ct,bt,vt,xt,Ue]),kt=(0,f.useMemo)((function(){var e=(0,yn.zB)({parent_stream:mn,stream:vn,tap_stream_id:vn},He);if(e)return(0,S.jsx)(Qn,{block:ce,blocksMapping:Te,height:Vn-Jn-2*w.iI,highlightedColumnsMapping:an,onChangeBlock:p,pipeline:I,selectedSubTab:bn,setBlockAttributes:ae,setHighlightedColumnsMapping:pn,setSelectedSubTab:function(e){return In((function(n){return mt(mt({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Pn,showError:qe,stream:e,streamMapping:He,streamsMappingConflicts:kn,updateStreamsInCatalog:_e})}),[ce,Te,Jn,Vn,an,p,I,vn,mn,bn,ae,pn,In,Pn,qe,He,kn,_e]),Zt=(0,f.useState)(null),yt=Zt[0],Pt=Zt[1];(0,f.useEffect)((function(){null==yt&&Pt(null!=ie?ie:fe)}),[fe,ie,yt,Pt]);var Ct=(0,f.useState)(null),Ot=Ct[0],wt=Ct[1],_t=(0,f.useMemo)((function(){return(0,S.jsx)(On,{block:ce,blockConfigString:Ot,blockContent:yt,blockUpstreamBlocks:Me,dataIntegrationConfiguration:Ce,onChangeCodeBlock:v,pipeline:I,savePipelineContent:E,setBlockConfigString:wt,setBlockContent:Pt,setContent:T,setSelectedSubTab:function(e){return In((function(n){return mt(mt({},n),{},{selectedSubTab:e})}))},showError:qe})}),[ce,Ot,yt,Me,Ce,v,I,E,wt,Pt,T,In,qe]),St=(0,f.useMemo)((function(){if(Zn.uK.CONFIGURATION===vn){if(Zn.tw.UPSTREAM_BLOCK_SETTINGS===bn){var e=null==Me?void 0:Me.map((function(e){var n,t,i=e.uuid,r=null==Ce||null===(n=Ce.inputs)||void 0===n?void 0:n[i],l=(null==r?void 0:r.streams)||[],u=!!r,c=null==Te?void 0:Te[i],s=(null==c?void 0:c.catalog)?null===(t=(0,yn.Uc)(c))||void 0===t?void 0:t.map((function(e){var n=e.stream,t=e.tap_stream_id;return n||t})):[i],a=1===(null==s?void 0:s.length)&&(null==s?void 0:s.includes(i));return(0,S.jsxs)("div",{children:[(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{children:(0,S.jsx)(O.ZP,{bold:!0,large:!0,monospace:!0,muted:!u,children:i})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Dn.Z,{checked:u,compact:!0,onCheck:function(e){we((function(n){return e(u)?mt(mt({},n),{},(0,o.Z)({},i,{})):(0,Tn.gR)(n,[i])}))}})]}),u&&(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsxs)(_n.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(_n.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,mt(mt({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Use catalog as an input"}),(0,S.jsx)(O.ZP,{muted:!0,small:!0,children:"If checked, then this block’s catalog will be included as part of the input argument(s) for the current block."})]}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:null==r?void 0:r.catalog,onClick:function(){return we((function(e){var n;return mt(mt({},e),{},(0,o.Z)({},i,mt(mt({},null==e?void 0:e[i]),{},{catalog:!(null!=e&&null!==(n=e[i])&&void 0!==n&&n.catalog)})))}))}})]}))}),a&&(0,S.jsx)(_n.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,mt(mt({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Use the block’s output data as an input"}),(0,S.jsx)(O.ZP,{muted:!0,small:!0,children:"Include this block’s output data as an input."})]}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:null==l?void 0:l.includes(i),monospace:!0,onClick:function(){return we((function(e){return mt(mt({},e),{},(0,o.Z)({},i,mt(mt({},null==e?void 0:e[i]),{},{streams:null!=l&&l.includes(i)?(0,L.Od)(l,(function(e){return e===i})):l.concat(i)})))}))},small:!0})]}))}),!a&&(0,S.jsxs)(_n.g,{noBorder:!0,children:[(0,S.jsxs)(y.ZP,mt(mt({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Select which stream’s data to use as an input"}),(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["Only the output data from the selected streams will be used as an input.",(0,S.jsx)("br",{}),"If none are selected, then no output data from any stream from this block will be used as in input.",(0,S.jsx)("br",{}),"If you don’t see a stream here, then the upstream block may have unselected the stream in its stream settings."]})]}),(0,S.jsx)(C.Z,{mr:3})]})),null==s?void 0:s.map((function(e){var n=null==l?void 0:l.includes(e);return(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(y.ZP,mt(mt({},y.A0),{},{children:[(0,S.jsx)(Z.Z,{children:(0,S.jsx)(O.ZP,{default:!0,monospace:!0,small:!0,children:e})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:n,onClick:function(){return we((function(t){return mt(mt({},t),{},(0,o.Z)({},i,mt(mt({},null==t?void 0:t[i]),{},{streams:n?(0,L.Od)(l,(function(n){return n===e})):l.concat(e)})))}))},small:!0})]}))},e)}))]}),(0,S.jsx)(_n.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,mt(mt({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Only use this block’s output data as an input"}),(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["If checked, then this block’s output data is only used as inputs.",b.tf.DATA_EXPORTER===re&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("br",{}),"The block’s output data won’t be ingested when running a sync, regardless if it’s enabled in the settings."]})]})]}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:!(null==r||!r.input_only),onClick:function(){return we((function(e){var n;return mt(mt({},e),{},(0,o.Z)({},i,mt(mt({},null==e?void 0:e[i]),{},{input_only:!(null!=e&&null!==(n=e[i])&&void 0!==n&&n.input_only)})))}))}})]}))})]})})]}),(0,S.jsx)(k.Z,{light:!0})]},i)}));return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(A.Z,{children:"Inputs"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Choose which upstream block to use as inputs when interpolating data into ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:le}),"’s (current block) credentials (aka config) and decorated functions."]})}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["If ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:le})," (current block) doesn’t require the data from an upstream block to interpolate or as arguments for decorated functions, don’t toggle them on because it’ll save time and data by not loading unnecessary data as inputs."]})}),dn.O.DESTINATIONS===oe&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Upstream blocks can still be selected to have its data ingested. This is toggled and configured in the ",(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return In((function(){return{selectedMainNavigationTab:Zn.uK.STREAMS}}))},preventDefault:!0,primary:!0,children:"Streams"})," section."]})})]}),(0,S.jsx)(k.Z,{light:!0}),e]})}}else{if(Zn.uK.STREAMS===vn&&Nn)return(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsx)(A.Z,{children:"Fetch streams to start set up"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Add streams and configure them by first fetching the available streams from ",ke,"."]})})]}),(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.CubeWithArrowDown,{size:2*w.iI}),large:!0,loading:Hn,onClick:function(){return Wn()},primary:!0,children:"Fetch streams"})]});if(Zn.uK.SYNC===vn)return(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(O.ZP,{children:"Coming soon"})});if(Zn.uK.OVERVIEW===vn)return(0,S.jsx)(ht,{block:ce,blocksMapping:Te,onChangeBlock:p,selectedStreamMapping:G,setSelectedMainNavigationTab:function(e){return In((function(n){return{selectedMainNavigationTab:e}}))},setSelectedStreamMapping:K,streamMapping:He,updateStreamsInCatalog:_e})}}),[ce,re,le,Me,Te,Ce,oe,ke,Wn,Hn,Nn,p,vn,G,bn,we,In,K,He,_e]),It=(0,f.useMemo)((function(){return bt?(0,S.jsx)(O.ZP,{bold:!0,children:"Documentation"}):vt?(0,S.jsx)(O.ZP,{bold:!0,children:"Bulk edit stream properties"}):xt?(0,S.jsx)(O.ZP,{bold:!0,children:"Bulk edit streams"}):void 0}),[bt,vt,xt]),Et=(0,f.useMemo)((function(){if(vt||xt)return(0,S.jsx)(Re,{ref:D,children:(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(x.Z,{checked:q,label:"Clear selection and values after applying changes",onClick:function(){return V((function(e){return!e}))}})}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ge.ZP,{fullWidth:!0,onClick:function(){var e={noParents:{},parents:{}};vt?e=(0,yn.Kq)(G,an,U):xt&&(e=(0,yn.bX)(G,U)),_e((0,yn.eH)(e),(function(e){return null==p?void 0:p(e)})),q&&(H({}),pn({}),K(null))},primary:!0,children:"Apply bulk changes"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(ge.ZP,{fullWidth:!0,onClick:function(){H({}),pn({}),K(null)},secondary:!0,children:"Clear"})]})]})})}),[U,q,an,vt,xt,p,D,G,H,pn,K,_e]),Tt=(0,f.useMemo)((function(){if(bt)return(0,S.jsx)(Ae,{children:(0,S.jsxs)(C.Z,{p:w.cd,children:[!Pe&&(0,S.jsx)(je.Z,{}),Be&&(0,S.jsx)(wn.Z,{children:Be.replace(/\<br \/\>/g,"\n\n")})]})});if(vt){var e=(0,yn.zB)({parent_stream:mn,stream:vn,tap_stream_id:vn},He);return(0,S.jsx)(at,{attributesMapping:U,block:ce,blocksMapping:Te,highlightedColumnsMapping:an,selectedStreamMapping:G,setAttributesMapping:H,setHighlightedColumnsMapping:pn,setSelectedStreamMapping:K,stream:e,streamMapping:He,updateStreamsInCatalog:_e})}return xt?(0,S.jsx)(ut,{attributesMapping:U,selectedStreamMapping:G,setAttributesMapping:H,setSelectedStreamMapping:K,streamMapping:He}):void 0}),[U,ce,Te,Pe,Be,an,bt,vt,xt,vn,mn,G,He,_e]),Mt=(0,f.useMemo)((function(){var e=[{label:function(){return le}}];return be&&e.push({bold:!vn,label:function(){return be}}),vn&&e.push({bold:!0,label:function(){return Zn.TD[vn]||vn}}),(0,S.jsx)(gn.Z,{breadcrumbs:e,noMarginLeft:!0})}),[le,be,vn]),Bt=(0,f.useMemo)((function(){return(Q-Vn-gt)/2}),[Vn,Q]),Dt=(0,f.useMemo)((function(){return(0,S.jsx)(tt,{block:ce,blocksMapping:Te,height:Vn-Jn,onChangeBlock:p,searchText:Kn,setSelectedMainNavigationTab:In,setSelectedSubTab:function(e){return In((function(n){return mt(mt({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Pn,streamsFetched:An,updateStreamsInCatalog:_e,width:Yn-(rn+(jt?0:Xe))})}),[jt,Xe,rn,ce,Te,Jn,Vn,p,Kn,In,Pn,An,_e,Yn]);return(0,S.jsxs)(Ne,{maxWidth:Yn,children:[(0,S.jsx)(Le,{children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{children:Mt}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(P.Z,{href:"https://docs.mage.ai",inline:!0,noOutline:!0,openNewWindow:!0,children:(0,S.jsx)(N.DocumentIcon,{default:!0,size:2*w.iI})}),(0,S.jsx)(C.Z,{mr:2}),m&&(0,S.jsx)(ge.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){null==m||m()},children:(0,S.jsx)(N.Close,{default:!0,size:2*w.iI})})]})]})}),(0,S.jsxs)(Ee.Z,{after:Tt,afterFooter:Et,afterFooterBottomOffset:Bt,afterHeader:(0,S.jsx)(C.Z,{px:1,ref:B,children:It}),afterHeaderOffset:0,afterHeightOffset:0,afterHidden:jt,afterInnerHeightMinus:48+(Et&&nt||0),afterMousedownActive:en,afterWidth:Xe,before:Mn,beforeHeightOffset:0,beforeMousedownActive:un,beforeWidth:rn,contained:!0,headerOffset:Jn,height:Vn,hideAfterCompletely:!Tt||xt&&!(null!=Ue&&Ue.length),inline:!0,mainContainerHeader:qn,mainContainerRef:M,setAfterHidden:st,setAfterMousedownActive:nn,setAfterWidth:Je,setBeforeMousedownActive:cn,setBeforeWidth:ln,uuid:We,children:[ft&&kt,!ft&&St,Zn.uK.CONFIGURATION===vn&&Zn.tw.CREDENTIALS===bn&&_t,Zn.uK.STREAMS===vn&&!Nn&&Dt]})]})},xt=t(50724),jt=(0,S.jsx)("div",{style:{width:pn.gt}});var kt=function(e){var n=e.beforeIcon,t=e.checked,i=e.label,r=e.muted;return(0,S.jsxs)(y.ZP,{alignItems:"center",children:[n||(t?(0,S.jsx)(N.Check,{}):jt),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{disabled:r,noWrapping:!0,children:i})]})},Zt=t(70374),yt=t(38907),Pt=t(77417),Ct=t(72098),Ot=t(26419),wt=t(58325);function _t(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function St(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_t(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_t(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var It=function(e){var n=e.cancelPipeline,t=e.children,i=(e.collapseAllBlockOutputs,e.createPipeline),r=e.disableAutosave,l=e.executePipeline,u=e.hideOutputOnExecution,c=e.interruptKernel,s=e.isPipelineExecuting,a=e.pipeline,d=e.restartKernel,p=e.savePipelineContent,h=(e.scrollTogether,e.setMessages),v=(e.setScrollTogether,e.setSideBySideEnabled,e.sideBySideEnabled,e.toggleDisableAutosave),m=e.toggleHideOutputOnExecution,g=e.updatePipelineMetadata,b=(0,f.useState)(null),x=b[0],j=b[1],k=(0,f.useRef)(null),Z=(0,f.useRef)(null),P=(0,f.useRef)(null),C=(0,f.useRef)(null),w=(0,f.useRef)(null),_=(0,yt.Z)({pipelineType:null==a?void 0:a.type}).kernel,I=(0,Pt.Z)(),E=I.featureEnabled,T=I.featureUUIDs,M=[{beforeIcon:jt,label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,G.Y6)()}})},uuid:"new_standard_pipeline"},{beforeIcon:jt,label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,G.Y6)(),type:cn.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{beforeIcon:jt,keyTextGroups:[[(0,wt.V5)()?ze.RJ:ze.hE,ze.SS]],label:function(){return"Save pipeline"},onClick:function(){return p()},uuid:"save_pipeline"},{beforeIcon:r?(0,S.jsx)(N.Check,{}):jt,label:function(){return"Disable autosave"},onClick:v,uuid:"Disable_autosave"}],B=(0,f.useMemo)((function(){var e=[{keyTextGroups:[[ze.kA],[ze.kA]],label:function(){return"Interrupt kernel"},onClick:function(){return c()},uuid:"Interrupt kernel"},{keyTextGroups:[[ze.t_[ze.OC]],[ze.t_[ze.OC]]],label:function(){return"Restart kernel"},onClick:function(){return d()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return h((function(e){return Object.keys(e).reduce((function(e,n){return St(St({},e),{},(0,o.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return s?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):(null==a?void 0:a.type)===cn.qL.STREAMING&&e.push({label:function(){return"Execute pipeline"},onClick:function(){return l()},uuid:"Execute pipeline"}),e}),[n,l,c,s,null==a?void 0:a.type,d,h]),D=(0,f.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null==a?void 0:a.uuid,"/settings"),href:"/pipelines/[pipeline]/settings"},uuid:"Pipeline settings"},{label:function(){return"Browse custom templates"},linkProps:{href:"/templates"},uuid:"browse_custom_templates"},{label:function(){return"Create custom templates"},linkProps:{href:"/templates?new=1"},uuid:"create_custom_templates"}]}),[a]),A=(0,f.useMemo)((function(){return[{label:function(){return(0,S.jsx)(kt,{checked:u,label:"Hide output on execution"})},onClick:m,uuid:"Hide output on execution"}]}),[u,m]),R=(0,f.useMemo)((function(){var e=[];return Ct.U.PYTHON3===(null==_?void 0:_.name)?e.push({label:function(){return"Switch to PySpark kernel"},onClick:function(){return null==g?void 0:g(null==a?void 0:a.name,cn.fj[Ct.U.PYSPARK])},uuid:"Switch to PySpark kernel"}):Ct.U.PYSPARK===(null==_?void 0:_.name)&&e.push({label:function(){return"Switch to Python kernel"},onClick:function(){return null==g?void 0:g(null==a?void 0:a.name,cn.fj[Ct.U.PYTHON3])},uuid:"Switch to Python kernel"}),e}),[_,a,g]),L="FileHeaderMenu/index",F=(0,Xe.y)(),U=F.registerOnKeyDown,H=F.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){H(L)}}),[H,L]),U(L,(function(e,n,t){null!==x&&(n[ze.QK]?j((function(e){return 0===e?2:e-1})):n[ze.DY]&&j((function(e){return 2===e?0:e+1})))}),[x,j]),(0,S.jsx)(xt.Z,{onClickOutside:function(){return j(null)},open:!0,style:{position:"relative"},children:(0,S.jsxs)(y.ZP,{children:[(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(ge.ZP,St(St({},Ot.a),{},{noBackground:0!==x,onClick:function(){return j((function(e){return 0===e?null:0}))},onMouseEnter:function(){return j((function(e){return null!==e?0:null}))},ref:k,children:(0,S.jsx)(O.ZP,{children:"File"})})),(0,S.jsx)(Zt.Z,{items:M,onClickCallback:function(){return j(null)},open:0===x,parentRef:k,uuid:"FileHeaderMenu/file_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(ge.ZP,St(St({},Ot.a),{},{noBackground:2!==x,onClick:function(){return j((function(e){return 2===e?null:2}))},onMouseEnter:function(){return j((function(e){return null!==e?2:null}))},ref:P,children:(0,S.jsx)(O.ZP,{children:"Edit"})})),(0,S.jsx)(Zt.Z,{items:D,onClickCallback:function(){return j(null)},open:2===x,parentRef:P,uuid:"FileHeaderMenu/edit_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(ge.ZP,St(St({},Ot.a),{},{noBackground:1!==x,onClick:function(){return j((function(e){return 1===e?null:1}))},onMouseEnter:function(){return j((function(e){return null!==e?1:null}))},ref:Z,children:(0,S.jsx)(O.ZP,{children:"Run"})})),(0,S.jsx)(Zt.Z,{items:B,onClickCallback:function(){return j(null)},open:1===x,parentRef:Z,uuid:"FileHeaderMenu/run_items"})]}),cn.qL.INTEGRATION!==(null==a?void 0:a.type)&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(ge.ZP,St(St({},Ot.a),{},{noBackground:3!==x,onClick:function(){return j((function(e){return 3===e?null:3}))},onMouseEnter:function(){return j((function(e){return null!==e?3:null}))},ref:C,children:(0,S.jsx)(O.ZP,{children:"View"})})),(0,S.jsx)(Zt.Z,{items:A,onClickCallback:function(){return j(null)},open:3===x,parentRef:C,uuid:"FileHeaderMenu/viewItems"})]}),(null==E?void 0:E(T.COMPUTE_MANAGEMENT))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(ge.ZP,St(St({},Ot.a),{},{noBackground:4!==x,onClick:function(){return j((function(e){return 4===e?null:4}))},onMouseEnter:function(){return j((function(e){return null!==e?4:null}))},ref:w,children:(0,S.jsx)(O.ZP,{children:"Compute"})})),(0,S.jsx)(Zt.Z,{items:R,onClickCallback:function(){return j(null)},open:4===x,parentRef:w,uuid:"FileHeaderMenu/viewItems"})]}),t]})})},Et=t(69616),Tt=t(67355),Mt=t(70613),Bt=t(21764),Dt=t(28071),At=t(65956),Rt=t(23657),Nt=t(8970),Lt=p.default.div.withConfig({displayName:"indexstyle__MenuStyle",componentId:"sc-1bixraz-0"})(["",";border-radius:","px;max-height:","px;min-width:","px;overflow:auto;position:absolute;right:0;",""],Me.w5,Te.n_,60*w.iI,70*w.iI,(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n border: 1px solid ").concat((e.theme.interactive||U.Z.interactive).defaultBorder,";\n ")}));function Ft(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ut(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ft(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ft(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ht=2*w.iI,Wt={default:!0,monospace:!0,small:!0};var Gt,Kt,zt=function(){var e=(0,f.useRef)(null),n=(0,se.VI)(null,{},[],{uuid:"ClusterSelection"}),t=(0,l.Z)(n,1)[0],i=(0,f.useState)(!1),r=i[0],o=i[1],u=(0,Rt.Z)({clustersRefreshInterval:5e3,includeAllStates:r}),c=(u.activeCluster,u.clusters),s=u.clustersLoading,a=u.computeService,d=u.fetchComputeClusters,p=(0,f.useState)(null),v=p[0],m=p[1],g=(0,h.Db)(Y.ZP.compute_clusters.compute_services.useCreate(null==a?void 0:a.uuid),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){d()},onErrorCallback:function(e,n){return t({errors:n,response:e})}})}}),b=(0,l.Z)(g,2),x=b[0],j=b[1].isLoading,Z=(0,h.Db)((function(e){return Y.ZP.compute_clusters.compute_services.useUpdate(null==a?void 0:a.uuid,null==e?void 0:e.id)({compute_cluster:(0,Tn.GL)(e,["active"])})}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){d(),m(null)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.exception,r=n.message,l=n.type;Bt.Am.error((null==t?void 0:t.error)||i||r,{position:Bt.Am.POSITION.BOTTOM_RIGHT,toastId:l})}})}}),P=(0,l.Z)(Z,2),_=P[0],I=P[1].isLoading,E=(0,f.useMemo)((function(){return(null==c?void 0:c.length)||0}),[c]),T=(0,f.useMemo)((function(){return(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.WorkspacesUsersIcon,{size:Ht}),compact:E>=1,loading:j,onClick:function(){return x()},primary:!0,small:E>=1,children:"Launch cluster"})}),[E,x,j]),M=(0,f.useMemo)((function(){var n,t,i,r,l=v||{message:null,x:0,y:0},o=l.message,u=l.x,c=l.y,s=(0,S.jsx)(O.ZP,{default:!0,small:!0,children:o});return(0,S.jsx)("div",{ref:e,style:{hidden:!v,left:u-((null==e||null===(n=e.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.width)||0),maxWidth:30*w.iI,position:"fixed",top:c-((null==e||null===(i=e.current)||void 0===i||null===(r=i.getBoundingClientRect())||void 0===r?void 0:r.height)||0),zIndex:9999},children:(0,S.jsx)(At.Z,{dark:!0,noPadding:!0,children:(0,S.jsxs)(C.Z,{p:1,children:[I&&(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(je.Z,{inverted:!0,small:!0}),(0,S.jsx)(C.Z,{mr:1}),s]}),!I&&s]})})})}),[I,v,m]);return(0,S.jsxs)(S.Fragment,{children:[M,(0,S.jsxs)(Lt,{children:[(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:s?"Clusters":(0,G._6)("cluster",E,!0)}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Dn.Z,{checked:r,compact:!0,onCheck:function(e){return o(e(r))}}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{default:r,muted:!r,small:!0,children:"Include terminated clusters"})]})]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,small:!0,children:[E>=1&&"Click a cluster to activate and use it for compute.",!E&&"Launch a new cluster to use for compute."]})}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.ExpandOpenUpRight,{default:!0}),default:!0,linkProps:{href:"/compute",as:"/compute?tab=".concat(Nt.uK.CLUSTERS)},noBackground:!0,noBold:!0,noBorder:!0,target:"_blank",noPadding:!0,openNewWindow:!0,small:!0,children:"Open compute mangement"})})})]}),(0,S.jsx)(C.Z,{mr:w.cd}),E>=1&&(0,S.jsx)(y.ZP,{flexDirection:"column",children:T})]})}),(0,S.jsx)(k.Z,{light:!0}),(0,S.jsx)(xt.Z,{onClickOutside:function(){I||m(null)},open:!0,children:(0,S.jsx)(R.Z,{columnFlex:[null,null,null],columns:[{uuid:"ID"},{uuid:"State"},{label:function(){return""},rightAligned:!0,uuid:"Active"}],onClickRow:function(e,n){var t;if(!I){var i,r=null==c?void 0:c[e],l=null==r||null===(t=r.status)||void 0===t?void 0:t.state;null!=r&&r.active?i="Cluster ".concat(null==r?void 0:r.id," is already active."):[Dt.X.RUNNING,Dt.X.WAITING].includes(l)?(i="Activating cluster ".concat(null==r?void 0:r.id,"."),_(Ut(Ut({},r),{},{active:!0}))):i="\n Cluster ".concat(null==r?void 0:r.id," must be in a\n ").concat((0,G.vg)(Dt.X.WAITING)," or\n ").concat((0,G.vg)(Dt.X.RUNNING),"\n state to be activated and used for compute.\n "),m({message:i,x:n.clientX,y:n.clientY})}},rows:null==c?void 0:c.map((function(e){var n=e.active,t=e.id,i=e.status,r=null==i?void 0:i.state;return[(0,f.createElement)(O.ZP,Ut(Ut({},Wt),{},{key:"id"}),t),(0,S.jsx)(O.ZP,Ut(Ut({},Wt),{},{danger:[Dt.X.TERMINATED_WITH_ERRORS].includes(r),default:[Dt.X.STARTING].includes(r),muted:[Dt.X.TERMINATED].includes(r),success:[Dt.X.RUNNING,Dt.X.WAITING].includes(r),warning:[Dt.X.TERMINATING].includes(r),children:null!=i&&i.state?(0,G.vg)(null==i?void 0:i.state):null==i?void 0:i.state})),(0,S.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(N.PowerOnOffButton,{muted:!n,size:Ht,success:n})},"active")]})),stickyHeader:!0,uuid:"ClusterSelection"})}),!s&&0===E&&(0,S.jsx)(C.Z,{p:w.cd,children:T}),s&&(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(je.Z,{inverted:!0,small:!0})})]})]})};!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(Gt||(Gt={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(Kt||(Kt={}));var qt,Vt=t(89308),Yt=t(89515),Xt=t(78688);!function(e){e.EMR="emr"}(qt||(qt={}));var Qt=t(26032),Jt=t(74260),$t=t(89538);function ei(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ni(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ei(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ei(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ti=function(e){var n=e.children,t=e.isBusy,i=e.pipeline,o=(e.restartKernel,e.savePipelineContent,e.setErrors),u=e.setRunningBlocks,c=e.updatePipelineMetadata,s=(0,v.useRouter)(),a=(0,yt.Z)({pipelineType:null==i?void 0:i.type}).kernel,d=(0,Pt.Z)(),m=(d.featureEnabled,d.featureUUIDs,d.sparkEnabled),g=(0,Rt.Z)({clustersRefreshInterval:5e3,computeServiceRefreshInterval:5e3,connectionsRefreshInterval:5e3,pauseFetch:!m}),b=g.activeCluster,x=g.clusters,k=(g.clustersLoading,g.computeService),_=g.computeServiceUUIDs,I=g.connections,E=g.connectionsLoading,T=g.fetchAll,M=g.fetchComputeClusters,B=(g.setupComplete,(0,f.useContext)(p.ThemeContext)),D=a||{},A=D.alive,R=D.usage,F=(0,f.useState)(qt.EMR),H=F[0],W=(F[1],(0,f.useState)(!1)),K=W[0],z=W[1],q=(0,f.useState)(!1),V=q[0],X=q[1],Q=(0,f.useState)(!1),J=Q[0],$=Q[1],ee=(0,f.useState)(!1),ne=ee[0],te=ee[1],ie=(0,f.useRef)(null),re=Y.ZP.clusters.detail(m?H:null,{},{revalidateOnFocus:!1}),le=re.data,oe=re.mutate,ue=(0,f.useMemo)((function(){var e;return(null==le||null===(e=le.cluster)||void 0===e?void 0:e.clusters)||[]}),[le]),ce=(0,f.useMemo)((function(){return(0,L.sE)(ue,(function(e){return e.is_active}))}),[ue]),se=(0,h.Db)(Y.ZP.clusters.useUpdate(H),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){oe()},onErrorCallback:function(e,n){return o({errors:n,response:e})}})}}),ae=(0,l.Z)(se,1)[0],de=Y.ZP.spark_applications.list({},{},{pauseFetch:!m}).data,pe=(0,f.useMemo)((function(){return null==de?void 0:de.spark_applications}),[de]),fe="KernelStatus",he=(0,Xe.y)(),ve=(he.registerOnKeyDown,he.unregisterOnKeyDown);(0,f.useEffect)((function(){return function(){ve(fe)}}),[ve,fe]);var me=(0,f.useMemo)((function(){return null==R?void 0:R.pid}),[null==R?void 0:R.pid]),ge=(0,jn.Z)(me),be=(0,$t.dd)((function(){return(0,S.jsx)(Yt.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:Ze,onClick:function(){(0,Ve.t8)(Ve.DU,1),Ze()},subtitle:"You may need to refresh your page to continue using the notebook. Unexpected kernel restarts may be caused by your kernel running out of memory.",title:"The kernel has restarted",width:34*w.iI})}),{},[],{background:!0,uuid:"restart_kernel_warning"}),xe=(0,l.Z)(be,2),ke=xe[0],Ze=xe[1];(0,f.useEffect)((function(){var e=(0,Ve.U2)(Ve.DU,0);me!==ge&&t&&!e&&(ke(),u([]))}),[t,me,ge,u,ke]);var Pe=(0,f.useMemo)((function(){return[cn.qL.PYTHON,cn.qL.PYSPARK].includes(null==i?void 0:i.type)}),[i]),Oe=(0,f.useMemo)((function(){return(0,S.jsx)(j.Z,{color:t?(B||U.Z).borders.info:A?(B||U.Z).borders.success:(B||U.Z).borders.danger,size:w.iI})}),[A,t,B]),we=(0,h.Db)((function(e){return Y.ZP.compute_clusters.compute_services.useUpdate(null==k?void 0:k.uuid,null==e?void 0:e.id)({compute_cluster:(0,Tn.GL)(e,["active"])})}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){M()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.exception,r=n.message,l=n.type;Bt.Am.error((null==t?void 0:t.error)||i||r,{position:Bt.Am.POSITION.BOTTOM_RIGHT,toastId:l})}})}}),_e=(0,l.Z)(we,2),Se=_e[0],Ie=(_e[1].isLoading,(0,f.useMemo)((function(){if(!m||!Pe||_.AWS_EMR!==(null==k?void 0:k.uuid)||cn.qL.PYSPARK!==(null==i?void 0:i.type))return null;var e=null==I?void 0:I.find((function(e){var n=e.uuid;return Jt.IK.OBSERVABILITY===n}));if(!e)return null;var n=e.name,t=e.state,r=e.status_calculated,l=e.uuid,o=[Qt.i.ACTIVE].includes(t),u=([Qt.i.INACTIVE].includes(t),[Jt.br.COMPLETED].includes(r)),c={muted:!0,warning:!1},a=n||l;u&&(o?(a="Observability enabled",c.muted=!1):a="SSH tunnel not connected");var d=(0,S.jsx)(xt.Z,{onClickOutside:function(e){(0,Ce.j)(e),te(!1)},open:ne,children:(0,S.jsx)(Lt,{children:(0,S.jsx)(Vt.Z,{actionsOnly:u,computeService:k,computeConnections:[e],contained:!1,hideDetails:!0,fetchAll:T,onClickStep:function(e){s.push("/compute?tab=".concat(e))},small:!0})})}),p=(0,S.jsx)(N.PowerOnOffButton,{danger:[Jt.br.ERROR].includes(r),muted:[Jt.br.INCOMPLETE].includes(r),success:u&&o});return(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(on.ZP,ni(ni({beforeElement:p,blackBorder:!0,compact:!0,inline:!0,noHover:E,onClick:function(e){(0,Ce.j)(e),ne||te(!0),$(!1)},uuid:"Pipeline/ComputeConnectionStatus"},c),{},{children:a})),d]})}),[ne,k,I,E,T,i,$,te,Pe])),Ee=(0,f.useMemo)((function(){if(!m||!Pe)return null;var e,n,t,r;if(_.AWS_EMR===(null==k?void 0:k.uuid)){var l,o=null==k||null===(l=k.setup_steps)||void 0===l?void 0:l.find((function(e){var n=e.uuid;return Jt.IK.SETUP===n})),u=null==o?void 0:o.status_calculated;if(cn.qL.PYSPARK!==(null==i?void 0:i.type))return null;if(b){var c,a=null==b||null===(c=b.status)||void 0===c?void 0:c.state;t=(0,S.jsxs)(O.ZP,{monospace:!0,children:[null==b?void 0:b.id," ",a&&![Dt.X.RUNNING,Dt.X.WAITING].includes(a)&&(0,G.J3)(a)]}),r=(0,S.jsx)(N.PowerOnOffButton,{danger:[Dt.X.TERMINATED_WITH_ERRORS].includes(a),default:[Dt.X.STARTING].includes(a),muted:[Dt.X.TERMINATED].includes(a),success:[Dt.X.RUNNING,Dt.X.WAITING].includes(a),warning:[Dt.X.TERMINATING].includes(a)})}else u?(t=null!=x&&x.length?"Select a compute cluster":"Launch a new cluster",r=(0,S.jsx)(N.PowerOnOffButton,{warning:!0})):(e=(0,S.jsx)(xt.Z,{onClickOutside:function(e){(0,Ce.j)(e),$(!1)},open:J,children:(0,S.jsx)(Lt,{children:(0,S.jsx)(Xt.Z,{contained:!1,onClickStep:function(e){s.push("/compute?tab=".concat(e))},setupSteps:null==k?void 0:k.setup_steps,small:!0})})}),n=function(e){(0,Ce.j)(e),J||$(!0),te(!1)},t="Compute setup incomplete",r=(0,S.jsx)(N.AlertTriangle,{danger:!0}));(b||u)&&(e=(0,S.jsx)(xt.Z,{onClickOutside:function(e){(0,Ce.j)(e),$(!1)},open:J,children:(0,S.jsx)(zt,{})}),n=function(e){(0,Ce.j)(e),J||$(!0),te(!1),te(!1)})}else if(_.STANDALONE_CLUSTER===(null==k?void 0:k.uuid))if(de)if(null!=pe&&pe.length){if((null==pe?void 0:pe.length)>=1){var d,p,f=null==pe?void 0:pe[0];t=[null==f?void 0:f.name,null==f||null===(d=f.attempts)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.app_spark_version].filter((function(e){return e})).join(" "),r=(0,S.jsx)(N.PowerOnOffButton,{success:!0})}}else n=function(){return s.push("/compute")},t="Compute unavailable",r=(0,S.jsx)(N.PowerOnOffButton,{danger:!0});else t="Loading compute",r=(0,S.jsx)(je.Z,{inverted:!0,small:!0});return t?(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(on.ZP,ni(ni({beforeElement:r,blackBorder:!0,compact:!0,inline:!0,noHover:!de||(null==pe?void 0:pe.length)>=1,onClick:n,uuid:"Pipeline/ComputeStatus"},{muted:!1,warning:!1}),{},{children:t})),e]}):null}),[b,J,x,k,_,de,i,s,$,te,pe,m,Pe]),Te=(0,f.useMemo)((function(){return(0,S.jsx)("div",{ref:ie,style:{position:"relative"},children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(null==i?void 0:i.type)===cn.qL.PYSPARK&&!m&&(0,S.jsxs)(C.Z,{mr:w.cd,children:[(0,S.jsxs)(P.Z,{muted:!!ce,onClick:function(){return z(!0)},preventDefault:!0,sameColorAsText:!ce,underline:!ce,children:[ce&&ce.id,!ce&&"Select cluster"]}),(0,S.jsx)(xt.Z,{disableEscape:!0,onClickOutside:function(){return z(!1)},open:K,children:(0,S.jsx)(Zt.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,r.Z)(ue.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,S.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(O.ZP,{muted:!t&&Kt.WAITING!==i,children:n})}),t&&(0,S.jsx)(N.Check,{size:2*w.iI,success:!0}),!t&&(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||Kt.WAITING!==i?null:function(){return ae({cluster:{id:n}})},uuid:n}})))),onClickCallback:function(){return z(!1)},open:K,parentRef:ie,uuid:"KernelStatus/select_cluster",width:40*w.iI})})]}),(0,S.jsx)(on.ZP,{beforeElement:Oe,blackBorder:!0,compact:!0,inline:!0,onClick:function(){return X(!0)},uuid:"Pipeline/KernelStatus/kernel",children:cn.RH[(null==i?void 0:i.type)||cn.qL.PYTHON]}),(0,S.jsx)(xt.Z,{disableEscape:!0,onClickOutside:function(){return X(!1)},open:V,children:(0,S.jsx)(Zt.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,r.Z)(Object.keys(cn.a_).filter((function(e){return(null==i?void 0:i.type)!=e})).map((function(e){return{label:function(){return cn.RH[e]||e},onClick:function(){return c(null==i?void 0:i.name,e)},uuid:e}})))),onClickCallback:function(){return X(!1)},open:V,parentRef:ie,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*w.iI})})]})})}),[A,ue,t,i,ce,z,X,K,V,Oe,B,Se,ae,c]);return(0,S.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,S.jsx)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:n}),(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(Z.Z,{alignItems:"center",children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[Te,Ie&&(0,S.jsx)(C.Z,{ml:1,children:Ie}),Ee&&(0,S.jsx)(C.Z,{ml:1,children:Ee})]})})})]})},ii=t(48339),ri=t(12691),li=t.n(ri),oi=t(16910),ui=t(46510),ci=t(92709),si=p.default.div.withConfig({displayName:"indexstyle__ScrollbarContainerStyle",componentId:"sc-174iy66-0"})(["position:fixed;"," "," "," ",""],(function(e){return"\n border-radius: ".concat(Te.n_,"px;\n background: ").concat((e.theme.background||U.Z.background).scrollbarTrack,";\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Me.nn,"px;\n ")}),(function(e){return void 0!==e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return void 0!==e.left&&"\n left: ".concat(e.left,"px;\n ")})),ai=p.default.div.withConfig({displayName:"indexstyle__ScrollCursorStyle",componentId:"sc-174iy66-1"})(["position:fixed;z-index:3;"," "," "," "," ",""],(function(e){return"\n border-radius: ".concat(Te.TR,"px;\n background: ").concat((e.theme.background||U.Z.background).scrollbarThumb,";\n\n &:hover {\n background: ").concat((e.theme.background||U.Z.background).scrollbarThumbHover,";\n }\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Me.nn,"px;\n ")}),(function(e){return(null==e?void 0:e.selected)&&"\n background: ".concat((e.theme.background||U.Z.background).scrollbarThumbHover,";\n ")}),(function(e){return void 0!==e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return void 0!==e.top&&"\n top: ".concat(e.top,"px;\n ")})),di=t(74052),pi=t(61709);function fi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function hi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var vi,mi,gi,bi=function(e){var n,t,i=e.blocks,l=e.columnIndex,o=e.columns,u=e.disabled,c=e.eventNameRefsMapping,s=e.invisible,a=e.mainContainerRect,d=e.rightAligned,p=e.scrollTogether,h=e.setCursorHeight,v=(0,f.useRef)(null),m=(0,f.useRef)(null),g=((0,f.useMemo)((function(){return null==i?void 0:i.map((function(e){return e.uuid}))}),[i]),(0,f.useState)(null)),b=g[0],x=g[1],j=(0,f.useState)(null),k=j[0],Z=j[1],y=(0,f.useState)(null),P=(y[0],y[1]),C=(0,f.useState)(null),O=C[0],w=C[1],_=a||{},I=_.height,E=_.width,T=_.x,M=_.y,B=(0,f.useMemo)((function(){return(0,L.Sm)(b||[])}),[b]),D=(0,f.useCallback)((function(){return B>I?I*(I/B):0}),[I,B]),A=(0,f.useMemo)((function(){return D()}),[D]);(0,f.useMemo)((function(){h(A)}),[A,h]);var R=(0,f.useCallback)((function(e){if(A){var n,t,i=null==m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y;e<=i?e=i:e+A>=M+I&&(e=M+I-A),null!=v&&v.current&&(v.current.style.top="".concat(e,"px"))}}),[A,I,v,M]),N=(0,f.useCallback)((function(){if(!u){var e=new CustomEvent(ci.m$,{detail:{columnScrolling:l,refCursor:v,refCursorContainer:m,refsMappings:Object.values(c||{})}});window.dispatchEvent(e)}}),[l,u,c]);(0,f.useEffect)((function(){P(!0)}),[]);var F=(0,f.useCallback)((function(e){var n,t,i=e.blockIndex,r=e.heights,l=e.y,o=null==m||null===(n=m.current)||void 0===n?void 0:n.getBoundingClientRect(),u=null==v||null===(t=v.current)||void 0===t?void 0:t.getBoundingClientRect(),c=(0,L.Sm)((null==r?void 0:r.slice(0,i))||[]),s=(0,L.Sm)(r||[])||0,a=(0,pi.IT)(r,s,I);return(c-(l-(null==o?void 0:o.y)))/s/(1-a)*((null==o?void 0:o.height)-(null==u?void 0:u.height))+(null==o?void 0:o.y)}),[]),U=(0,f.useCallback)((function(){var e=Object.values(c||{}),n=null==i?void 0:i.map((function(n){var t=(0,di.zv)(n);return Math.max.apply(Math,(0,r.Z)(e.map((function(e){var n,i,r,l=null==e||null===(n=e.current)||void 0===n?void 0:n[t];return(null==l||null===(i=l.current)||void 0===i||null===(r=i.getBoundingClientRect())||void 0===r?void 0:r.height)||0}))))}));if(null!=n&&n.every((function(e){return void 0!==e&&!isNaN(e)}))){if(x(n),k){var t=F(hi(hi({},k),{},{heights:n}));R(t)}N()}}),[i,F,l,N,c,k,x]);(0,f.useEffect)((function(){var e;return null===(e=Object.keys(c||{}))||void 0===e||e.forEach((function(e){window.addEventListener(e,U)})),function(){var e;null===(e=Object.keys(c||{}))||void 0===e||e.forEach((function(e){window.removeEventListener(e,U)}))}}),[c,U]);var H=(0,f.useCallback)((function(){N(),U()}),[N,U]);(0,f.useEffect)((function(){return window.addEventListener(ci.Qj,H),function(){window.removeEventListener(ci.Qj,H)}}),[H]),(0,f.useEffect)((function(){var e=function(e){var n,t,r=e.detail.block,l=null==i?void 0:i.findIndex((function(e){return e.uuid===(null==r?void 0:r.uuid)})),o=F({blockIndex:l,heights:b,y:null==m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y});R(o),N()};return window.addEventListener(ci.Em,e),function(){window.removeEventListener(ci.Em,e)}}),[i,F,N,b,R]),(0,f.useEffect)((function(){u||U()}),[u,p,U]),(0,f.useEffect)((function(){var e=function(e){var n=e.detail;if(l===(null==n?void 0:n.columnIndex)){var t=F(hi(hi({},n),{},{heights:b}));R(t),N(),null!=n&&n.lockScroll&&Z(n)}};return window.addEventListener(ci.Wf,e),function(){window.removeEventListener(ci.Wf,e)}}),[l,I,b,Z,R,F,M]);var W=(0,f.useCallback)((function(e){var n=e.pageX,t=e.pageY;if(n>=T&&n<=T+E&&t>=M&&t<=M+I){var i=E/o;if(p||n>=T+i*l&&n<T+i*(l+1)){var r,u=null==v||null===(r=v.current)||void 0===r?void 0:r.getBoundingClientRect(),c=((null==u?void 0:u.y)||0)+((null==e?void 0:e.deltaY)||0);R(c),N(),Z(null)}}}),[l,o,N,I,p,R,E,T,M]),G=(0,f.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(O||null!=n){var t;e&&(null==e||e.preventDefault());if(null===n){var i,r=null==O?void 0:O.scrollTop,l=null==O||null===(i=O.event)||void 0===i?void 0:i.clientY;t=r+((null==e?void 0:e.clientY)-l)}else t=n;R(t),N(),Z(null)}}),[N,O,R]);return(0,f.useEffect)((function(){var e,n;R(null==v||null===(e=v.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.y)}),[I,R]),(0,f.useEffect)((function(){var e=function(){w(null)};return A&&(window.addEventListener("mousemove",G),window.addEventListener("wheel",W),window.addEventListener("mouseup",e)),function(){window.removeEventListener("mousemove",G),window.removeEventListener("wheel",W),window.removeEventListener("mouseup",e)}}),[A,G,W]),(0,S.jsx)(si,{height:I,invisible:s,left:d?T+E-Me.nn:void 0,ref:m,children:(0,S.jsx)(ai,{height:A,invisible:s,onMouseDown:function(e){var n,t;return w({event:e,scrollTop:null==v||null===(n=v.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y})},ref:v,selected:!!O,top:null==m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y})})};!function(e){e.DBT="dbt"}(vi||(vi={})),function(e){e.PROFILES="profiles",e.PROJECTS="projects",e.TARGETS="targets"}(mi||(mi={})),function(e){e.Block="Block"}(gi||(gi={}));var xi=t(68804),ji=t(29314),ki=t(93528),Zi=t(53779);var yi=function(e){var n=e.onClose,t=e.onOpenFile,i=e.onSelectBlockFile,r=(0,ki.ZP)({allowDbtModelSelect:!0,disableContextMenu:!0,onOpenFile:t,onSelectBlockFile:i,query:{pattern:encodeURIComponent("\\.sql$")},uuid:"FileSelectorPopup/dbt"}).browser;return(0,S.jsxs)(Zi.eD,{children:[(0,S.jsxs)(Zi.X$,{children:[(0,S.jsx)(Z.Z,{alignItems:"center",children:(0,S.jsx)(O.ZP,{disableWordBreak:!0,monospace:!0,children:"Select dbt model or snapshot file"})}),(0,S.jsx)(ge.ZP,{iconOnly:!0,onClick:n,children:(0,S.jsx)(N.Close,{muted:!0})})]}),(0,S.jsx)(Zi.C,{children:r})]})},Pi=t(39457);function Ci(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Oi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ci(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ci(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var wi="4px",_i={lightBackground:!0,muted:!0,relativePosition:!0},Si=[Rn.Zj.BIGQUERY,Rn.Zj.DELTA_LAKE_S3];var Ii=function(e){var n=e.bookmarkValues,t=e.destination,i=e.isLoadingLoadSampleData,r=e.isLoadingUpdateDestinationBlockState,u=e.loadSampleData,c=e.source,s=e.stream,a=e.streams,d=e.updateAllStreams,p=e.updateDestinationBlockState,h=e.updateMetadataForColumns,v=e.updateSchemaProperty,m=e.updateStream,g=(0,f.useRef)(null),b=s.bookmark_properties,j=s.destination_table,k=void 0===j?"":j,P=s.key_properties,_=s.metadata,I=s.partition_keys,E=s.replication_method,T=s.run_in_parallel,M=s.schema.properties,B=s.tap_stream_id,D=s.unique_constraints,N=s.unique_conflict_method,F=(0,f.useState)(k),U=F[0],H=F[1],W=(0,f.useState)(!1),K=W[0],z=W[1],q=(0,f.useState)(null),V=q[0],Y=q[1],X=(0,f.useState)(!!t),Q=X[0],J=X[1],$=(0,f.useState)((0,o.Z)({},B,n||{})),ee=$[0],ne=$[1],te=(0,jn.Z)(B);(0,f.useEffect)((function(){te!==B&&(H(k),Y(null))}),[k,E,B,te,N]),(0,f.useEffect)((function(){var e=null==ee?void 0:ee[B];(null==b?void 0:b.length)>0&&((0,Tn.Qr)(e)||!(0,Tn.Xy)(n,e))&&ne((function(e){return Oi(Oi({},e),{},(0,o.Z)({},B,n))}))}),[null==b?void 0:b.length,n,B]);var ie=(0,f.useMemo)((function(){return(0,L.HK)(_,(function(e){return e.breadcrumb.join("/")}))}),[_]),re=(0,f.useMemo)((function(){var e;return null===(e=(0,L.sE)(_,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[_]),le=(0,f.useMemo)((function(){return re[Rn.fe.KEY_PROPERTIES]||[]}),[re]),oe=(0,f.useMemo)((function(){return re[Rn.fe.REPLICATION_KEYS]||[]}),[re]),ue=Si.includes(t),ce=a.length>1,se=(0,f.useCallback)((function(e){var n=Oi({},null==ee?void 0:ee[B]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return Oi(Oi({},e),{},(0,o.Z)({},B,Oi({},n)))})),p({block:{bookmark_values:n,destination_table:U,tap_stream_id:B}})}),[ee,U,B,p]),ae=(0,f.useMemo)((function(){var e=[],n=[],i=(0,L.mr)(Object.entries(M)).map((function(i,r){var o=(0,l.Z)(i,2),u=o[0],c=o[1],s=c.anyOf,a=void 0===s?[]:s,p=c.format,f=c.type,g=void 0===f?[]:f,j=new Set(Array.isArray(g)?g:[g]),k=new Set(j);a.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){j.add(e),k.add(e)})):(j.add(t),k.add(t),n&&k.add(n))}));var _=Array.from(j);p&&k.add(p);var E=(ie["properties/".concat(u)]||{}).metadata,T=(E.inclusion,E.selected);e.push(T),n.push(u);var M=Rn.D5.reduce((function(e,n){return _.indexOf(n)>=0||Rn.Xv===String(n)&&Rn.zS.DATE_TIME===p||Rn.zS.UUID===String(n)&&Rn.zS.UUID===p?e:e.concat((0,S.jsx)("option",{value:n,children:n},n))}),[]),A=_.findIndex((function(e){return e===Rn.RL.STRING})),R=[(0,S.jsx)(x.Z,{checked:T,onClick:function(){h(B,[u],{selected:!T})}},"".concat(B,"/").concat(u,"/selected")),(0,S.jsx)(O.ZP,{children:u},"".concat(B,"/").concat(u,"/name")),(0,S.jsxs)(y.ZP,{children:[(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:_.map((function(e,n){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Bn.Z,{border:!0,label:p&&Rn.RL.STRING===e&&A===n?Rn.eL[p]:e,onClick:function(){var n={format:p,type:_.filter((function(n){return n!==e}))};Rn.zS.DATE_TIME!==p&&Rn.zS.UUID!==p||Rn.RL.STRING!==e||(n.format=null),v(B,u,n)},small:!0})},"".concat(B,"/").concat(u,"/").concat(e,"/").concat(n,"/chip"))}))})}),M.length>=1&&(0,S.jsxs)(sn.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:p,type:_};Rn.Xv===String(n)?(t.format=Rn.zS.DATE_TIME,t.type.push(Rn.RL.STRING)):Rn.zS.UUID===String(n)?(t.format=Rn.zS.UUID,t.type.push(Rn.RL.STRING)):t.type.push(n),v(B,u,t)},primary:!0,small:!0,value:"",width:10*w.iI,children:[(0,S.jsx)("option",{value:""}),M]})]},"".concat(B,"/").concat(u,"/type")),(0,S.jsx)(x.Z,{checked:!(null==D||!D.includes(u)),disabled:le.length>=1&&!le.includes(u),onClick:le.length>=1&&!le.includes(u)?null:function(){return m(B,(function(e){var n;return null!==(n=e.unique_constraints)&&void 0!==n&&n.includes(u)?e.unique_constraints=(0,L.Od)(e.unique_constraints,(function(e){return u===e})):e.unique_constraints=[u].concat(e.unique_constraints||[]),e}))}},"".concat(B,"/").concat(u,"/unique")),(0,S.jsx)(x.Z,{checked:!(null==b||!b.includes(u)),disabled:oe.length>=1&&!oe.includes(u),onClick:oe.length>=1&&!oe.includes(u)?null:function(){return m(B,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(u)?(se(u),e.bookmark_properties=(0,L.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),e}))}},"".concat(B,"/").concat(u,"/bookmark")),(0,S.jsx)(x.Z,{checked:!(null==P||!P.includes(u)),onClick:function(){return m(B,(function(e){var n;return null!==(n=e.key_properties)&&void 0!==n&&n.includes(u)?e.key_properties=(0,L.Od)(e.key_properties,(function(e){return u===e})):e.key_properties=[u].concat(e.key_properties||[]),e}))}},"".concat(B,"/").concat(u,"/key_property"))];if(ue){var N=t!==Rn.Zj.DELTA_LAKE_S3,F=N&&(le.includes(u)||!k.has(Rn.zS.DATE_TIME));R.push((0,S.jsx)(x.Z,{checked:!(null==I||!I.includes(u)),disabled:F,onClick:F?null:function(){return m(B,(function(e){var n,t;null!==(n=e.partition_keys)&&void 0!==n&&n.includes(u)?e.partition_keys=(0,L.Od)(e.partition_keys,(function(e){return u===e})):N&&1===(null===(t=e.partition_keys)||void 0===t?void 0:t.length)?e.partition_keys=[u]:e.partition_keys=[u].concat(e.partition_keys||[]);return e}))}},"".concat(B,"/").concat(u,"/partition_key")))}if(ce){var U=V===r;R.push((0,S.jsx)(ge.ZP,{compact:!0,disabled:U,onClick:function(){Y(r),setTimeout((function(){return Y(null)}),2e3),d((function(e){var n,t;if((null==e?void 0:e.tap_stream_id)!==B&&null!=e&&null!==(n=e.schema)&&void 0!==n&&null!==(t=n.properties)&&void 0!==t&&t[u]){var i,r,l,o,c,s,a,d,f;e.schema.properties[u]={format:p||null,type:_};var h=null===(i=(0,L.sE)((null==e?void 0:e.metadata)||[],(function(e){return 0===e.breadcrumb.length})))||void 0===i?void 0:i.metadata,v=h[Rn.fe.REPLICATION_KEYS]||[],m=h[Rn.fe.KEY_PROPERTIES]||[];null==D||!D.includes(u)||null!=e&&null!==(r=e.unique_constraints)&&void 0!==r&&r.includes(u)||!m.includes(u)?null!=D&&D.includes(u)||null==e||null===(l=e.unique_constraints)||void 0===l||!l.includes(u)||(e.unique_constraints=(0,L.Od)(e.unique_constraints,(function(e){return u===e}))):e.unique_constraints=[u].concat(e.unique_constraints||[]),null==b||!b.includes(u)||null!=e&&null!==(o=e.bookmark_properties)&&void 0!==o&&o.includes(u)||!v.includes(u)&&0!==v.length?null!=b&&b.includes(u)||null==e||null===(c=e.bookmark_properties)||void 0===c||!c.includes(u)||(e.bookmark_properties=(0,L.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),null==P||!P.includes(u)||null!=e&&null!==(s=e.key_properties)&&void 0!==s&&s.includes(u)?null!=P&&P.includes(u)||null==e||null===(a=e.key_properties)||void 0===a||!a.includes(u)||(e.key_properties=(0,L.Od)(e.key_properties,(function(e){return u===e}))):e.key_properties=[u].concat(e.key_properties||[]),null==I||!I.includes(u)||null!=e&&null!==(d=e.partition_keys)&&void 0!==d&&d.includes(u)?null!=I&&I.includes(u)||null==e||null===(f=e.partition_keys)||void 0===f||!f.includes(u)||(e.partition_keys=(0,L.Od)(e.partition_keys,(function(e){return u===e}))):e.partition_keys=[u].concat(e.partition_keys||[])}return Oi({},e)}))},pill:!0,secondary:!0,children:(0,S.jsx)(O.ZP,{success:U,children:U?"Applied!":"Apply"})}))}return R})),r=e.every((function(e){return e})),o=[null,2,1,null,null,null],u=[{label:function(){return(0,S.jsx)(x.Z,{checked:r,onClick:function(){h(B,n,{selected:!r})}})},uuid:"Selected"},{uuid:"Name"},{uuid:"Type"},{fitTooltipContentWidth:!0,tooltipMessage:"Used to avoid adding duplicate records",uuid:"Unique"},{tooltipMessage:"Used to keep track of sync progress and incrementally sync new records (e.g. a column indicating when a record was last updated)",tooltipWidth:305,uuid:"Bookmark"},{fitTooltipContentWidth:!0,tooltipMessage:"Used to create primary key for destination table",uuid:"Key prop"}];return ue&&(o.push(null),u.push({uuid:"Partition key"})),ce&&(o.push(null),u.push({tooltipMessage:"This will apply this individual feature's schema settings to all selected streams that have the same feature. Unique features must be valid key properties in other streams. Bookmark features must be valid replication keys in other streams.",uuid:"All streams"})),(0,S.jsx)(kn.cl,{children:(0,S.jsx)(R.Z,{alignTop:!0,columnFlex:o,columns:u,rows:i,stickyHeader:!0})})}),[b,t,ce,V,P,ie,I,M,se,ue,B,D,d,h,v,m,le,oe]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,S.jsx)(A.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:B})," schema"]}),(0,S.jsx)(C.Z,{mb:3,children:(0,S.jsx)(At.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{children:"Destination table name"}),(0,S.jsx)(C.Z,{ml:wi}),(0,S.jsx)(An.Z,Oi(Oi({},_i),{},{label:(0,S.jsxs)(O.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:B}),". To change the table name, enter in a different value."]})})),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(Ie.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;H(n),clearTimeout(g.current),g.current=setTimeout((function(){m(B,(function(e){return Oi(Oi({},e),{},{destination_table:n})}))}),300)},value:U||"",width:45*w.iI})]})})}),(0,S.jsx)(C.Z,{mb:3,children:(0,S.jsx)(At.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{children:"Replication method"}),(0,S.jsx)(C.Z,{ml:wi}),(0,S.jsx)(An.Z,Oi(Oi({},_i),{},{label:(0,S.jsxs)(O.ZP,{children:["Do you want to synchronize the entire stream (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.INCREMENTAL}),")?",c===Rn.th.POSTGRESQL&&(0,S.jsxs)(O.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]})})),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsxs)(sn.Z,{compact:!0,onChange:function(e){m(B,(function(n){return Oi(Oi({},n),{},{replication_method:e.target.value})}))},primary:!0,value:E,children:[(0,S.jsx)("option",{value:""}),Object.values(Rn._B).filter((function(e){return c===Rn.th.POSTGRESQL||e!==Rn._B.LOG_BASED})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))]}),(0,S.jsx)(C.Z,{ml:3}),(0,S.jsx)(O.ZP,{children:"Unique conflict method"}),(0,S.jsx)(C.Z,{ml:wi}),(0,S.jsx)(An.Z,Oi(Oi({},_i),{},{label:(0,S.jsxs)(O.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,G._6)("unique column",null==D?void 0:D.length),(null==D?void 0:D.length)>0&&(0,S.jsx)(S.Fragment,{children:" "}),null==D?void 0:D.sort().map((function(e,n){return(0,S.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null==D?void 0:D.length)&&n===(null==D?void 0:D.length)-1?(0,S.jsx)(O.ZP,{inline:!0,children:" and "},e):n>=1&&(0,S.jsx)(S.Fragment,{children:", "}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn.MU.IGNORE})," will skip the new record if it’s a duplicate of an existing record. The conflict method ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:Rn.MU.UPDATE})," will not save the new record and instead update the existing record with the new record’s properties."]})})),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsxs)(sn.Z,{compact:!0,inputWidth:11*w.iI,onChange:function(e){m(B,(function(n){return Oi(Oi({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:N,children:[(0,S.jsx)("option",{value:""}),(0,S.jsx)("option",{value:Rn.MU.IGNORE,children:Rn.MU.IGNORE}),(0,S.jsx)("option",{value:Rn.MU.UPDATE,children:Rn.MU.UPDATE})]})]}),ce&&(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{default:!0,children:"All streams"}),(0,S.jsx)(C.Z,{ml:wi}),(0,S.jsx)(An.Z,Oi(Oi({},_i),{},{appearBefore:!0,label:(0,S.jsx)(O.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."})})),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(ge.ZP,{compact:!0,disabled:K,onClick:function(){z(!0),setTimeout((function(){return z(!1)}),2e3),d((function(e){return Oi(Oi({},e),{},{replication_method:E,unique_conflict_method:N})}))},pill:!0,secondary:!0,children:(0,S.jsx)(O.ZP,{bold:!K,success:K,children:K?"Applied!":"Apply"})})]})]})})}),(0,S.jsx)(At.Z,{headerTitle:"Features",noPadding:!0,children:ae}),(0,S.jsx)(C.Z,{mt:2,children:(0,S.jsx)(ge.ZP,{loading:i,onClick:function(){return u(B)},primary:!0,small:!0,children:"Load sample data"})}),(0,S.jsxs)(C.Z,{mt:5,children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,S.jsx)(C.Z,{mb:5,children:(0,S.jsxs)(C.Z,{mb:1,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,S.jsx)(O.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."}),(0,S.jsx)(C.Z,{mb:1}),(0,S.jsx)(Dn.Z,{checked:T,onCheck:function(){return m(B,(function(e){return e.run_in_parallel=!T,e}))}},"".concat(B,"/run_in_parallel"))]})}),Rn._B.INCREMENTAL===E&&(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsxs)(C.Z,{mb:1,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,S.jsx)(O.ZP,{default:!0,children:"After each integration pipeline run, the last record that was successfully synchronized will be used as the bookmark. The properties listed below will be extracted from the last record and used as the bookmark. On the next run, the synchronization will start from the bookmarked record."})]}),(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!=b&&b.length)&&(0,S.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null==b?void 0:b.sort().map((function(e){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){se(e),m(B,(function(n){return Oi(Oi({},n),{},{bookmark_properties:(0,L.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]}),(null==b?void 0:b.length)>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{my:2,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(C.Z,{mr:2,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),!t&&(0,S.jsx)(O.ZP,{default:!0,children:'In order to overwrite the bookmark values for the next sync, you must first select a destination. Then you will be able to edit the bookmark property values in the table below. Click the "Save" button to save your changes.'}),t&&(0,S.jsx)(O.ZP,{default:!0,children:'This will temporarily overwrite the bookmark value for the next pipeline run. After editing any bookmark values below, you must click the "Save" button in the table header in order to persist and save your changes.'})]}),(0,S.jsx)(Dn.Z,{checked:Q,disabled:!t,onCheck:function(){return J((function(e){return!e}))}})]})}),Q&&!!t&&(0,S.jsx)(At.Z,{header:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,S.jsx)(ge.ZP,{compact:!0,loading:r,onClick:function(){p({block:{bookmark_values:(null==ee?void 0:ee[B])||{},destination_table:U,tap_stream_id:B}})},pill:!0,primary:!0,children:"Save"})]}),headerPaddingVertical:w.iI,noPadding:!0,overflowVisible:!0,children:(0,S.jsx)(R.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Feature"},{uuid:"Current bookmark value"}],rows:b.map((function(e){var n;return[(0,S.jsx)(O.ZP,{default:!0,monospace:!0,children:e},e),(0,S.jsx)(Ie.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ne((function(t){return Oi(Oi({},t),{},(0,o.Z)({},B,Oi(Oi({},t[B]),{},(0,o.Z)({},e,n.target.value||null))))}))},paddingHorizontal:0,placeholder:"Enter value (optional)",value:null==ee||null===(n=ee[B])||void 0===n?void 0:n[e]},"".concat(e,"_value"))]}))})})]})]}),ce&&(null==b?void 0:b.length)>0&&(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Valid replication keys"}),(0,S.jsx)(O.ZP,{default:!0,inline:!0,children:"If a stream's schema specifies its valid replication keys and a feature is not a valid replication key, that feature will not be set as a bookmark property when applying the feature (from a different stream) as a bookmark to all streams. "}),oe.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.ZP,{default:!0,inline:!0,children:"These are the valid replication keys for this stream:"})," ",(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,small:!0,children:[oe.join(", "),"."]})]}),0===oe.length&&(0,S.jsx)(O.ZP,{default:!0,inline:!0,children:"This stream did not specify any valid replication keys, so all features can be used as bookmark properties."})]}),(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsxs)(C.Z,{mb:1,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,S.jsx)(O.ZP,{default:!0,children:"Multiple records (e.g. 2 or more) with the same values in the columns listed below will be considered duplicates."})]}),(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!=D&&D.length)&&(0,S.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null==D?void 0:D.sort().map((function(e){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){m(B,(function(n){return Oi(Oi({},n),{},{unique_constraints:(0,L.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsxs)(C.Z,{mb:1,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,S.jsx)(O.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!=P&&P.length)&&(0,S.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null==P?void 0:P.sort().map((function(e){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){m(B,(function(n){return Oi(Oi({},n),{},{key_properties:(0,L.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ue&&(0,S.jsxs)(C.Z,{mb:3,children:[(0,S.jsxs)(C.Z,{mb:1,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,S.jsx)(O.ZP,{default:!0,children:"One datetime column can be used to partition the table. (Note: Partition keys currently only work with BigQuery destinations. Support for other destinations is WIP.)"})]}),(0,S.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!=I&&I.length)&&(0,S.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null==I?void 0:I.sort().map((function(e){return(0,S.jsx)(C.Z,{mb:1,mr:1,children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){m(B,(function(n){return Oi(Oi({},n),{},{partition_keys:(0,L.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Ei=["catalog","pipeline","setErrors","setSelectedStream"];function Ti(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Mi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ti(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ti(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Bi,Di=function(e){var n,t=e.catalog,i=e.pipeline,r=e.setErrors,o=e.setSelectedStream,u=(0,Sn.Z)(e,Ei),c=(0,f.useState)(null),s=c[0],a=c[1],d=(0,f.useMemo)((function(){return(null==t?void 0:t.streams)||[]}),[t]),p=(0,f.useMemo)((function(){return(0,L.YC)(d,"stream").map((function(e){return{uuid:e.stream}}))}),[d]),v=(0,f.useMemo)((function(){return(0,L.HK)(d,(function(e){return e.stream}))}),[d]),m=(0,f.useMemo)((function(){return v[null==s?void 0:s.uuid]}),[s,v]),g=(0,f.useMemo)((function(){return(0,L.sE)((null==i?void 0:i.blocks)||[],(function(e){var n=e.type;return b.tf.DATA_EXPORTER===n}))}),[null==i?void 0:i.blocks]),x=m||{},j=x.destination_table,k=x.tap_stream_id,Z=!(!k||!j),y=Y.ZP.blocks.pipelines.detail(Z?null==i?void 0:i.uuid:null,Z?null==g?void 0:g.uuid:null,{destination_table:j,state_stream:k}),P=y.data,w=y.mutate,_=null==P||null===(n=P.block)||void 0===n?void 0:n.bookmarks,I=(0,h.Db)(Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null==i?void 0:i.uuid),encodeURIComponent(null==g?void 0:g.uuid),{query:{update_state:!0}}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){null==w||w()},onErrorCallback:function(e,n){return null==r?void 0:r({errors:n,response:e})}})}}),E=(0,l.Z)(I,2),T=E[0],M=E[1].isLoading;(0,f.useEffect)((function(){p.length>0&&(s&&(0,L.sE)(p,(function(e){var n=e.uuid;return s.uuid===n}))||a(p[0]))}),[s,a,p]);var B=(0,f.useMemo)((function(){var e=[{uuid:"Stream"},{uuid:"Columns Selected"},{uuid:"Replication Method"},{uuid:"Destination Table"},{uuid:"Bookmark Props"},{uuid:"Key Props"},{uuid:"Unique Constraints"},{uuid:"Unique Conflict Method"},{uuid:"Partition Keys"}];return(0,S.jsx)(kn.cl,{children:(0,S.jsx)(R.Z,{alignTop:!0,columnBorders:!0,columnFlex:e.map((function(e){return 1})),columns:e,rows:d.map((function(e){var n=e.replication_method,t=e.destination_table,i=e.bookmark_properties,r=e.key_properties,l=e.metadata,o=e.unique_constraints,u=e.unique_conflict_method,c=e.partition_keys,s=e.tap_stream_id,a=l.reduce((function(e,n){var t=n.breadcrumb,i=n.metadata.selected,r=(null==t?void 0:t.length)>0,l=i&&r?1:0,o=r?1:0;return{selectedCount:e.selectedCount+l,totalCount:e.totalCount+o}}),{selectedCount:0,totalCount:0}),d=(0,S.jsx)(O.ZP,{children:"".concat(a.selectedCount," of ").concat(a.totalCount," total")},"".concat(s,"_col_selected")),p=[s,n,t,i,r,o,u,c].map((function(e,n){return(0,S.jsx)(O.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(s,"_cell_").concat(n))}));return p.slice(0,1).concat(d).concat(p.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[d]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(de.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){a(e),o(e.uuid)},selectedTabUUID:null==s?void 0:s.uuid,showScrollbar:!0,tabs:p}),m&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(kn.dE,{children:(0,S.jsx)(Ii,Mi(Mi({},u),{},{bookmarkValues:_,isLoadingUpdateDestinationBlockState:M,stream:m,streams:d,updateDestinationBlockState:T}))})}),d.length>=1&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(kn.dE,{children:[(0,S.jsx)(A.Z,{level:4,children:"Streams Summary"}),(0,S.jsx)(C.Z,{mt:1}),B]})})]})},Ai=t(46732);function Ri(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function Ni(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Li(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ni(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ni(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.ALL="All",e.SELECTED="Selected",e.NOT_SELECTED="Not selected"}(Bi||(Bi={}));var Fi=45*w.iI,Ui=Fi-4*w.iI;var Hi=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,r=e.streams,l=(0,L.HK)((null==n?void 0:n.streams)||[],(function(e){return e.stream})),u=(0,f.useMemo)((function(){var e=new Set(r.map((function(e){return e.stream})));return Object.values(l).filter((function(n){var t=n.stream;return!e.has(t)})).map((function(e){return Li(Li({},e),{},{isMissingStream:!0})}))}),[l,r]),c=Li({},l);u.forEach((function(e){var n=e.stream;delete c[n]}));var s=(0,f.useState)(c),a=s[0],d=s[1],p=(0,f.useState)(null),h=p[0],v=p[1],m=(0,f.useState)(!1),g=m[0],b=m[1],j=(0,f.useState)(Bi.ALL),Z=j[0],P=j[1],_=(0,f.useRef)(null),I=Ri(a),E=(0,f.useMemo)((function(){var e=r;return e=e.filter((function(e){var n=e.tap_stream_id;return Z===Bi.SELECTED?I.includes(n):Z!==Bi.NOT_SELECTED||!I.includes(n)})),h?e.filter((function(e){var n=e.tap_stream_id;return null==n?void 0:n.toLowerCase().includes(null==h?void 0:h.toLowerCase())})):e}),[Z,h,I,r]),T=(0,f.useMemo)((function(){return r.every((function(e){var n=e.stream;return!!a[n]}))}),[a,r]);return(0,S.jsxs)(Wn.Z,{children:[(0,S.jsx)(kn.cv,{rounded:!0,children:(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,S.jsx)(kn.cv,{padding:1.25*w.iI,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(Ie.Z,{beforeIcon:(0,S.jsx)(N.Search,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return v(e.target.value)},placeholder:"Search",value:h}),(0,S.jsx)(C.Z,{pr:1,children:(0,S.jsx)(Ai.Z,{items:[{label:function(){return Bi.ALL},onClick:function(){return P(Bi.ALL)},uuid:"all_streams"},{label:function(){return Bi.SELECTED},onClick:function(){return P(Bi.SELECTED)},uuid:"selected"},{label:function(){return Bi.NOT_SELECTED},onClick:function(){return P(Bi.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return b(!1)},onClickOutside:function(){return b(!1)},open:g,parentRef:_,uuid:"SelectStreams/filter",children:(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Filter,{}),noBackground:!0,onClick:function(){return b((function(e){return!e}))},ref:_,children:(0,S.jsx)(O.ZP,{children:Z})})})})]})}),(0,S.jsx)(kn.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(Fi,"px"),children:(0,S.jsx)(R.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,S.jsx)(x.Z,{checked:T,onClick:function(){var e=(0,L.HK)(r||[],(function(e){return e.stream}));d(T?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:E.concat(u).map((function(e){var n=e.isMissingStream,t=e.stream,i=!!a[t];return[(0,S.jsx)(x.Z,{checked:i,disabled:!i&&n,onClick:function(){d((function(n){return Li(Li({},n),{},(0,o.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,S.jsxs)(O.ZP,{danger:n,title:t,width:Fi-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,S.jsx)(k.Z,{medium:!0}),(0,S.jsxs)(C.Z,{p:2,children:[(null==I?void 0:I.length)>50&&(0,S.jsx)(C.Z,{pb:2,children:(0,S.jsxs)(O.ZP,{danger:!0,maxWidth:Ui,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,S.jsx)("br",{}),"may cause app performance issues."]})}),0===(null==r?void 0:r.length)&&(0,S.jsx)(C.Z,{pb:2,children:(0,S.jsx)(O.ZP,{bold:!0,maxWidth:Ui,warning:!0,whiteSpaceNormal:!0,children:"If you can successfully connect to the data source but no streams are displayed, check if the user has proper database/schema permissions."})}),(0,S.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(ge.ZP,{loading:t,onClick:function(){return i(a)},primary:!0,children:"Confirm ".concat(Ri(a).length," streams")})})]})]})};function Wi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Gi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Wi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Wi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ki=function(e){var n=e.api,t=e.block,i=e.blockContent,r=e.onChangeCodeBlock,u=e.pipeline,c=(0,f.useState)(null),s=c[0],a=c[1],d=(0,jn.Z)(s);(0,f.useEffect)((function(){!i||s||d||a((0,bn.Pz)(null==i?void 0:i.config))}),[s,d,i]);var p=(0,f.useState)(null),v=p[0],m=p[1],g=(0,f.useState)(),x=g[0],j=g[1],k=(0,h.Db)(Y.ZP[n].useCreate(),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var t,i,r=(0,G.C5)(n);m(null==e||null===(t=e[r])||void 0===t?void 0:t.success),j(null==e||null===(i=e[r])||void 0===i?void 0:i.error_message)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),Z=(0,l.Z)(k,2),P=Z[0],w=Z[1].isLoading;return t?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(kn.$W,{children:(0,S.jsx)(be.Z,{autoHeight:!0,language:b.t6.YAML,onChange:function(e){a(e),r(t.type,t.uuid,(0,bn.Pz)(Gi(Gi({},i),{},{config:(0,bn.Qc)(e)})))},tabSize:2,value:s||void 0,width:"100%"})}),(0,S.jsxs)(C.Z,{mt:1,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ge.ZP,{onClick:function(){P((0,o.Z)({},(0,G.C5)(n),{action_type:"test_connection",config:s,pipeline_uuid:u.uuid})),j(null)},small:!0,success:!0,children:"Test connection"}),(0,S.jsx)(C.Z,{ml:1,children:w?(0,S.jsx)(je.Z,{color:"white",small:!0}):(0,S.jsxs)(S.Fragment,{children:[v&&(0,S.jsx)(O.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===v&&(0,S.jsx)(O.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),x&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{small:!0,warning:!0,children:x})})]})]}):null},zi=t(85385);function qi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Vi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?qi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Yi=function(e){var n,t,i,r=e.addNewBlockAtIndex,o=e.blocks,u=e.codeBlocks,c=e.fetchFileTree,s=e.fetchPipeline,a=e.fetchSampleData,d=e.globalVariables,p=e.onChangeCodeBlock,v=e.openSidekickView,m=e.pipeline,g=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,k=e.setOutputBlocks,Z=e.setSelectedBlock,_=e.setSelectedOutputBlock,I=e.setSelectedStream,E=(0,f.useState)(!0),T=E[0],M=E[1],B=(0,f.useState)(!0),D=B[0],F=B[1],U=(0,f.useState)(!0),H=U[0],W=U[1],G=(0,f.useState)(""),K=G[0],z=G[1],q=Y.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,V=(0,f.useMemo)((function(){return(null==q?void 0:q.integration_sources)||[]}),[q]),X=(0,f.useMemo)((function(){return(0,L.HK)(V,(function(e){return e.uuid}))}),[V]),Q=Y.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,J=(0,f.useMemo)((function(){return(null==Q?void 0:Q.integration_destinations)||[]}),[Q]),$=(0,f.useMemo)((function(){return(0,L.HK)(J,(function(e){return e.uuid}))}),[J]),ee=(0,f.useMemo)((function(){return(0,L.sE)(o,(function(e){var n=e.type;return b.tf.DATA_LOADER===n}))}),[o]),ne=(0,f.useMemo)((function(){return ee?(0,bn.Qc)(ee.content):{}}),[ee]);(0,f.useEffect)((function(){var e;null!=ne&&ne.source&&z(null===(e=X[ne.source])||void 0===e?void 0:e.docs)}),[X,ne]);var te=(0,f.useMemo)((function(){return(0,S.jsx)(Ki,{api:"integration_sources",block:ee,blockContent:ne,onChangeCodeBlock:p,pipeline:m})}),[ee,ne,p,m]),ie=(0,f.useMemo)((function(){return(0,L.sE)(o,(function(e){var n=e.type;return b.tf.DATA_EXPORTER===n}))}),[o]),re=(0,f.useMemo)((function(){return ie?(0,bn.Qc)(ie.content):{}}),[ie]),le=(0,f.useMemo)((function(){return(0,S.jsx)(Ki,{api:"integration_destinations",block:ie,blockContent:re,onChangeCodeBlock:p,pipeline:m})}),[ie,re,p,m]),oe=(0,f.useMemo)((function(){return(0,L.sE)(o,(function(e){var n=e.type;return b.tf.TRANSFORMER===n}))}),[o]),ue=(0,f.useMemo)((function(){var e;return(0,Tn.Qr)(null==ne?void 0:ne.catalog)?null==m||null===(e=m.data_integration)||void 0===e?void 0:e.catalog:null==ne?void 0:ne.catalog}),[ne,null==m||null===(n=m.data_integration)||void 0===n?void 0:n.catalog]),ce=((null==ue?void 0:ue.streams)||[]).every((function(e){return e.auto_add_new_fields})),se=((null==ue?void 0:ue.streams)||[]).every((function(e){return e.disable_column_type_check})),ae=(0,jn.Z)(ue);(0,f.useEffect)((function(){!ae&&ue&&(k((function(){return _(ee),[ee]})),j((function(e){var n;return e||(null==ue||null===(n=ue.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[ue]);var de=(0,f.useState)(),pe=de[0],fe=de[1],he=(0,h.Db)(Y.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null==n?void 0:n.streams)||[];k((function(){return _(ee),[ee]})),t.length>0&&I(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),v(zi.cH.DATA),a()}else fe(null==n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),be=(0,l.Z)(he,2),xe=be[0],ke=be[1].isLoading,Ze=(0,h.Db)(Y.ZP.integration_sources.useUpdate(null==m?void 0:m.uuid),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var n=e.integration_source,t=n.selected_streams,i=n.streams,r=((null==ue?void 0:ue.streams)||[]).filter((function(e){var n=e.tap_stream_id;return t.includes(n)})),l=r.map((function(e){return e.tap_stream_id})),o=i.filter((function(e){var n=e.tap_stream_id;return t.includes(n)&&!l.includes(n)}));o.forEach((function(e){e.metadata.forEach((function(n,t){var i=n.metadata;if(Rn.ks.UNSUPPORTED!==i.inclusion){var r;if(e.replication_method||(e.replication_method=Rn._B.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=Rn.MU.UPDATE),!e.destination_table)e.destination_table=null==e||null===(r=e.tap_stream_id)||void 0===r?void 0:r.replace(/\W+/g,"_");e.metadata[t]=Vi(Vi({},n),{},{metadata:Vi(Vi({},i),{},{selected:!0})})}}))}));var u={streams:r.concat(o)};j(He.map((function(e){return e.tap_stream_id})));var a=null==ne?void 0:ne.catalog;(0,Tn.Qr)(a)||p(ee.type,ee.uuid,(0,bn.Pz)(Vi(Vi({},ne),{},{catalog:{}})));var d={pipeline:Vi(Vi({},m),{},{data_integration:Vi(Vi({},(null==m?void 0:m.data_integration)||{}),{},{catalog:u})})};g(d).then((function(){s(),null==c||c()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Pe=(0,l.Z)(Ze,2),Ce=Pe[0],Oe=Pe[1].isLoading,we=(0,f.useState)(null),_e=we[0],Se=we[1],Ie=(0,h.Db)(Y.ZP.integration_source_streams.useUpdate(null==m?void 0:m.uuid),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){Se(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Ee=(0,l.Z)(Ie,2),Te=Ee[0],Me=Ee[1].isLoading,Be=(0,f.useCallback)((function(e,n){var t=function(e,n){var t,i=[];return e.streams.forEach((function(e){e.tap_stream_id===n?t=e:i.push(e)})),{stream:t,streams:i}}(ue,e),i=t.stream,r=t.streams,l=Vi(Vi({},ue),{},{streams:r.concat(n(i))}),o=null==ne?void 0:ne.catalog;(0,Tn.Qr)(o)||p(ee.type,ee.uuid,(0,bn.Pz)(Vi(Vi({},ne),{},{catalog:{}})));var u={pipeline:Vi(Vi({},m),{},{data_integration:Vi(Vi({},(null==m?void 0:m.data_integration)||{}),{},{catalog:l})})};g(u).then((function(){return s()}))}),[ue,ee,ne,s,p,m,g]),De=(0,f.useCallback)((function(e){if(null!=ue&&ue.streams){var n=Vi(Vi({},ue),{},{streams:ue.streams.map((function(n){return e(n)}))}),t=null==ne?void 0:ne.catalog;(0,Tn.Qr)(t)||p(ee.type,ee.uuid,(0,bn.Pz)(Vi(Vi({},ne),{},{catalog:{}})));var i={pipeline:Vi(Vi({},m),{},{data_integration:Vi(Vi({},(null==m?void 0:m.data_integration)||{}),{},{catalog:n})})};g(i).then((function(){return s()}))}}),[ue,ee,ne,s,p,m,g]),Ae=(0,f.useCallback)((function(e,n,t){Be(e,(function(e){return e.schema.properties[n]=t,e}))}),[Be]),Re=(0,f.useCallback)((function(e,n,t){Be(e,(function(e){var i=e.metadata;return n.forEach((function(n){var r=i.findIndex((function(e){var t=e.breadcrumb,i=void 0===t?[]:t;return 2===i.length&&"properties"===i[0]&&i[1]===n}));if(r>=0){var l=i[r].metadata;e.metadata[r].metadata=Vi(Vi({},l),t)}})),e}))}),[Be]),Ne=(0,h.Db)(Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null==m?void 0:m.uuid),encodeURIComponent(null==ie?void 0:ie.uuid)),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){null==s||s()},onErrorCallback:function(e,n){return null==x?void 0:x({errors:n,response:e})}})}}),Le=(0,l.Z)(Ne,1)[0],Fe=(0,f.useMemo)((function(){var e=[];return null==d||d.forEach((function(n){var t=n.variables;return null==t?void 0:t.forEach((function(n){var t=n.uuid,i=n.value,r="\"{{ variables('".concat(t,"') }}\"");if(!t.startsWith("output"))return e.push([(0,S.jsx)(O.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,S.jsx)(O.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,S.jsx)(O.ZP,{monospace:!0,children:r},"variable-uuid-".concat(t,"-{value}-code")),(0,S.jsx)(Pi.Z,{copiedText:r,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,S.jsx)(R.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[d]),Ue=(0,f.useCallback)((function(e){return(0,S.jsxs)(C.Z,{mt:2,children:[(0,S.jsxs)(O.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,S.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,S.jsx)("br",{}),"For more information, check out the ",(0,S.jsx)(P.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,S.jsx)(C.Z,{mt:1,children:Fe})]})}),[Fe]),He=(0,f.useMemo)((function(){return(null==_e?void 0:_e.streams)||[]}),[_e]),We=(0,$t.dd)((function(){return(0,S.jsx)(Hi,{catalog:ue,isLoading:Oe,onActionCallback:function(e){var n=Object.entries(e).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);if(n.length>0)Ce({integration_source:{streams:n}}),ze();else{var t=null==ne?void 0:ne.catalog;(0,Tn.Qr)(t)||p(ee.type,ee.uuid,(0,bn.Pz)(Vi(Vi({},ne),{},{catalog:{}}))),g({pipeline:Vi(Vi({},m),{},{data_integration:Vi(Vi({},(null==m?void 0:m.data_integration)||{}),{},{catalog:null})})}).then((function(){return s()})),ze()}},streams:He})}),{},[ue,ee,ne,s,Oe,p,g,He],{background:!0,uuid:"select_streams"}),Ge=(0,l.Z)(We,2),Ke=Ge[0],ze=Ge[1];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ge.ZP,{iconOnly:!0,onClick:function(){return F((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[D&&(0,S.jsx)(N.ChevronUp,{size:1.5*w.iI}),!D&&(0,S.jsx)(N.ChevronDown,{size:1.5*w.iI})]})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{children:"Source"}),!D&&(0,S.jsxs)(A.Z,{default:!0,inline:!0,children:[" ",null===(t=X[null==ne?void 0:ne.source])||void 0===t?void 0:t.name]})]})]})}),D&&(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsxs)(kn.dE,{children:[(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null==V?void 0:V.length)>0?(0,S.jsxs)(sn.Z,{onChange:function(e){var n,t,i,l=e.target.value;if(l){z(null===(n=X[l])||void 0===n?void 0:n.docs);var o=null===(t=X[l])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;o&&Object.keys(o).forEach((function(e){o[e]=o[e]||null})),ee?p(ee.type,ee.uuid,(0,bn.Pz)(Vi(Vi({},ne),{},{catalog:{},config:o,source:l}))):r({content:(0,bn.Pz)({config:o,source:l}),language:b.t6.YAML,type:b.tf.DATA_LOADER},0,Z),Se(null),g().then((function(){s()}))}},primary:!0,value:null==ne?void 0:ne.source,children:[(0,S.jsx)("option",{value:""}),V.map((function(e){var n=e.name,t=e.uuid;return(0,S.jsx)("option",{value:t,children:n},t)}))]}):(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(je.Z,{inverted:!0}),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(A.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),ee&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null==ne?void 0:ne.source)&&K&&(0,S.jsxs)(C.Z,{mb:2,children:[(0,S.jsx)(ve.Z,{children:(0,S.jsx)(me.Z,{title:"Documentation: ".concat(ne.source),children:(0,S.jsx)(kn.zG,{children:(0,S.jsx)(wn.Z,{children:K.replace(/\<br \/\>/g,"\n\n")})})})}),Ue("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),te]}),(0,S.jsxs)("div",{children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,S.jsx)(ge.ZP,{loading:Me,onClick:function(){g().then((function(){Te().then((function(){return Ke()})),s()}))},primary:!0,small:!0,children:"View and select streams"})]}),pe&&(0,S.jsx)(O.ZP,{warning:!0,children:pe})]})]}),Oe&&(0,S.jsx)(C.Z,{p:2,children:(0,S.jsx)(je.Z,{})}),!Oe&&(0,S.jsx)(C.Z,{mt:3,children:(0,S.jsx)(Di,{catalog:ue,destination:null==re?void 0:re.destination,isLoadingLoadSampleData:ke,loadSampleData:function(e){return xe({integration_source:{action_type:"sample_data",pipeline_uuid:null==m?void 0:m.uuid,streams:[e]}})},pipeline:m,setErrors:x,setSelectedStream:I,source:null==ne?void 0:ne.source,updateAllStreams:De,updateMetadataForColumns:Re,updateSchemaProperty:Ae,updateStream:Be})})]}),(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ge.ZP,{disabled:!ee,iconOnly:!0,onClick:function(){return W((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[H&&ee&&(0,S.jsx)(N.ChevronUp,{size:1.5*w.iI}),(!H||!ee)&&(0,S.jsx)(N.ChevronDown,{disabled:!ee,size:1.5*w.iI})]})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(A.Z,{children:"Transformers"})})]})}),H&&ee&&(0,S.jsx)(C.Z,{mb:5,children:(0,S.jsxs)(kn.dE,{children:[u.length>0&&(0,S.jsx)(C.Z,{mb:1,children:u.map((function(e,n){return(0,S.jsx)(C.Z,{mb:1,children:e},n)}))}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(ui.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return ee&&i.push(ee.uuid),r(Vi(Vi({},e),{},{configuration:t,content:n,upstream_blocks:i}),o.length-1,(function(e){ie&&(Le({block:Vi(Vi({},ie),{},{upstream_blocks:[e.uuid]})}),Z(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!oe,hideTransformerDataSources:!0,pipeline:m})})]})}),(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ge.ZP,{disabled:!ee,iconOnly:!0,onClick:function(){return M((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[T&&ee&&(0,S.jsx)(N.ChevronUp,{size:1.5*w.iI}),(!T||!ee)&&(0,S.jsx)(N.ChevronDown,{disabled:!ee,size:1.5*w.iI})]})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{children:"Destination"}),!T&&(0,S.jsxs)(A.Z,{default:!0,inline:!0,children:[" ",null===(i=$[null==re?void 0:re.destination])||void 0===i?void 0:i.name]})]})]})}),T&&ee&&(0,S.jsxs)(kn.dE,{children:[(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null==J?void 0:J.length)>0?(0,S.jsxs)(sn.Z,{onChange:function(e){var n=e.target.value;if(n){if(ie)p(ie.type,ie.uuid,(0,bn.Pz)(Vi(Vi({},re),{},{destination:n})));else{var t,i,l=null===(t=$[n])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;l&&(Object.keys(l).forEach((function(e){l[e]=l[e]||null})),l.hasOwnProperty("table")&&delete l.table);var u=[];if((null==o?void 0:o.length)>=2){var c=o.find((function(e){var n=e.uuid;return(null==ee?void 0:ee.uuid)!==n}));c&&u.push(c.uuid)}else ee&&u.push(ee.uuid);r({content:(0,bn.Pz)({config:l,destination:n}),language:b.t6.YAML,type:b.tf.DATA_EXPORTER,upstream_blocks:u},1,Z)}g().then((function(){s()}))}},primary:!0,value:null==re?void 0:re.destination,children:[(0,S.jsx)("option",{value:""}),J.map((function(e){var n=e.name,t=e.uuid;return(0,S.jsx)("option",{value:t,children:n},t)}))]}):(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(je.Z,{inverted:!0}),(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(A.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),ie&&(0,S.jsxs)(C.Z,{mb:5,children:[(0,S.jsx)(A.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null==re?void 0:re.destination)&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(C.Z,{mb:2,children:[(0,S.jsxs)(O.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,S.jsxs)(P.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(re.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[re.destination," documentation"]}),".",(0,S.jsx)("br",{}),(0,S.jsx)("br",{}),"If your configuration contains a key named ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:"table"}),", it’s optional.",(0,S.jsx)("br",{}),"The table that’s created in this destination will have a name corresponding to the stream’s unique name (by default) or the value you entered under the input field labeled ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),Ue("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),le,(0,S.jsx)(C.Z,{mt:3,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(C.Z,{mr:2,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,S.jsx)(O.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})]}),(0,S.jsx)(Dn.Z,{checked:!!ce,disabled:!(null!=ue&&ue.streams),onCheck:function(){return De((function(e){return Vi(Vi({},e),{},{auto_add_new_fields:!ce})}))}})]})}),(0,S.jsx)(C.Z,{mt:3,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(C.Z,{mr:2,children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,S.jsxs)(O.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,S.jsx)("br",{}),"If a value in a column doesn’t match its type, an error will be raised and the process will be stopped.",(0,S.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,S.jsx)(Dn.Z,{checked:!!se,disabled:!(null!=ue&&ue.streams),onCheck:function(){return De((function(e){return Vi(Vi({},e),{},{disable_column_type_check:!se})}))}})]})})]})]})]})},Xi=t(16682),Qi=t(82359),Ji=t(59457),$i=t(19698),er=t(97133),nr=t(35058),tr=t(316),ir=t(38399),rr=t(33834);function lr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function or(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?lr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):lr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ur=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.afterHidden,u=e.allBlocks,c=e.allowCodeBlockShortcuts,s=e.anyInputFocused,a=e.autocompleteItems,d=e.beforeHidden,p=e.blockInteractionsMapping,v=e.blockRefs,m=e.blocks,g=void 0===m?[]:m,x=e.blocksThatNeedToRefresh,j=e.dataProviders,k=e.deleteBlock,Z=e.disableAutosave,y=e.disableShortcuts,I=e.fetchFileTree,E=e.fetchPipeline,T=e.fetchSampleData,M=(e.files,e.globalDataProducts),B=e.globalVariables,D=e.hideOutputOnExecution,A=e.hiddenBlocks,R=e.interactionsMapping,N=e.interruptKernel,F=e.mainContainerRef,U=e.mainContainerWidth,H=e.messages,W=e.onChangeCallbackBlock,G=e.onChangeCodeBlock,K=e.openSidekickView,z=e.pipeline,q=e.pipelineContentTouched,V=e.restartKernel,X=e.runBlock,Q=e.runningBlocks,J=void 0===Q?[]:Q,$=e.savePipelineContent,ee=e.scrollTogether,ne=e.selectedBlock,te=e.setAnyInputFocused,ie=e.setDisableShortcuts,re=e.setEditingBlock,le=e.setErrors,oe=e.setHiddenBlocks,ue=e.setIntegrationStreams,ce=e.setOutputBlocks,se=e.setPipelineContentTouched,ae=e.setSelectedBlock,de=e.setSelectedOutputBlock,pe=e.setSelectedStream,fe=e.setTextareaFocused,he=e.setScrollTogether,ve=e.setSideBySideEnabled,me=e.showBrowseTemplates,ge=e.showBlockBrowserModal,be=e.showConfigureProjectModal,xe=e.showDataIntegrationModal,je=e.showGlobalDataProducts,ke=e.showUpdateBlockModal,Ze=e.sideBySideEnabled,Pe=e.textareaFocused,Ce=e.widgets,Oe=(0,Pt.Z)(),we=Oe.featureEnabled,_e=Oe.featureUUIDs,Se=Oe.project,Ie=(0,$i.Z)().status,Ee=(0,f.useRef)(null),Te=(0,f.useRef)(null),Me=(0,f.useRef)({}),Be=(0,f.useRef)(null),De=(0,f.useRef)(null),Ae=(0,f.useState)(!1),Re=Ae[0],Ne=Ae[1],Le=(0,f.useState)(!1),Fe=Le[0],Ue=Le[1],He=(0,f.useState)(!1),We=He[0],Ge=He[1],Ke=(0,f.useState)(!0),qe=Ke[0],Ve=Ke[1],Je=(0,f.useState)(!1),$e=Je[0],en=Je[1],rn=(0,f.useState)(null),on=rn[0],un=rn[1],sn=(0,f.useState)(null),an=sn[0],dn=sn[1],pn=(0,f.useState)(!1),fn=pn[0],hn=pn[1],vn=(0,f.useState)(""),mn=vn[0],gn=vn[1],bn=(0,f.useState)({height:null,width:null,x:null,y:null}),xn=bn[0],kn=bn[1],Zn=(0,f.useMemo)((function(){return cn.qL.INTEGRATION===(null==z?void 0:z.type)}),[z]),yn=(0,f.useMemo)((function(){return cn.qL.STREAMING===(null==z?void 0:z.type)}),[z]),Pn=(0,f.useMemo)((function(){return null==g?void 0:g.some((function(e){var n=e.type;return b.tf.DBT===n}))}),[g]),Cn=(0,f.useMemo)((function(){return g.filter((function(e){var n=e.type;return!Zn||b.tf.TRANSFORMER===n}))}),[g,Zn]),On=(0,f.useState)({}),wn=(On[0],On[1]),_n=(0,Qe.i)(),Sn=_n.height,In=_n.width;(0,f.useEffect)((function(){var e;null!=F&&F.current&&kn(null==F||null===(e=F.current)||void 0===e?void 0:e.getBoundingClientRect())}),[i,d,F,U,kn,Sn,In]);var En=(0,f.useMemo)((function(){return J.reduce((function(e,n,t){return or(or({},e),{},(0,o.Z)({},n.uuid,or(or({},n),{},{priority:t})))}),{})}),[J]),Mn=(0,f.useState)(null),Bn=Mn[0],Dn=Mn[1],An=(0,f.useMemo)((function(){return(0,S.jsx)(bi,{blocks:Cn,columnIndex:0,columns:2,disabled:ee,eventNameRefsMapping:(0,o.Z)({},ci.$e,v),invisible:!(null!=g&&g.length)||!Bn||ee,mainContainerRect:xn,scrollTogether:ee,setCursorHeight:Dn})}),[null==g?void 0:g.length,v,Cn,Bn,xn,ee,Dn]),Rn=(0,f.useState)(null),Nn=Rn[0],Ln=Rn[1],Fn=(0,f.useMemo)((function(){return(0,S.jsx)(bi,{blocks:Cn,columnIndex:1,columns:2,disabled:ee,eventNameRefsMapping:(0,o.Z)({},ci.tK,Me),invisible:!(null!=g&&g.length)||!Nn||ee,mainContainerRect:xn,rightAligned:!0,scrollTogether:ee,setCursorHeight:Ln})}),[null==g?void 0:g.length,Me,Cn,Nn,xn,ee,Ln]),Un=(0,f.useState)(null),Hn=Un[0],Wn=Un[1],Gn=(0,f.useMemo)((function(){var e;return(0,S.jsx)(bi,{blocks:Cn,columnIndex:2,columns:1,disabled:!ee,eventNameRefsMapping:(e={},(0,o.Z)(e,ci.tK,Me),(0,o.Z)(e,ci.$e,v),e),invisible:!(null!=g&&g.length&&Hn&&ee),mainContainerRect:xn,rightAligned:!0,scrollTogether:ee,setCursorHeight:Wn})}),[Me,v,Cn,Hn,xn,ee,Wn,null==g?void 0:g.length]),Kn=(0,jn.Z)(ne),zn=(0,f.useMemo)((function(){return g.length}),[g]),qn=(0,f.useMemo)((function(){return cn.qL.PYTHON===(null==z?void 0:z.type)&&(null==we?void 0:we(null==_e?void 0:_e.ADD_NEW_BLOCK_V2))}),[we,_e,z]),Vn=(0,Ji.Z)(Y.ZP.block_templates.list,{show_all:!!qn},{revalidateOnFocus:!1},{delay:3e3}).data,Yn=(0,f.useMemo)((function(){return(null==Vn?void 0:Vn.block_templates)||[]}),[Vn]),Xn=Y.ZP.configuration_options.pipelines.list(Pn?null==z?void 0:z.uuid:null,{configuration_type:vi.DBT,option_type:mi.PROJECTS,resource_type:gi.Block},{revalidateOnFocus:!1}).data,Qn=(0,f.useMemo)((function(){return null==Xn?void 0:Xn.configuration_options}),[Xn]),Jn=(0,f.useCallback)((function(e,t){var i=g[g.length-1],r=null,l=e.configuration||{},o=i?(0,pi.eY)(i,e):[];i&&([b.tf.DATA_LOADER,b.tf.TRANSFORMER].includes(i.type)&&b.tf.SCRATCHPAD===e.type&&(r="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(z.uuid,"', '").concat(i.uuid,"', 'output_0')\n")),b.t6.SQL===i.language&&(l=or(or({},(0,Tn.GL)(i.configuration,[nr.cH,nr.Sv,nr.sc,nr.BD,nr.nq])),l))),b.t6.SQL===e.language&&(r=(0,ir.SF)(r)),r=(0,ir.X7)(e,r);var u=null!==t?t:zn;n(or(or({},e),{},{configuration:l,content:r,upstream_blocks:o}),u,ae),fe(!0)}),[n,g,zn,z,ae,fe]);(0,f.useEffect)((function(){var e=function(e){var n=e.detail;De.current=null==n?void 0:n.state},n=function(){Be.current=(0,ji.FV)({activeOnly:!0})};return window.addEventListener(xi.Yj,n),window.addEventListener(xi.Mt,e),function(){window.removeEventListener(xi.Yj,n),window.removeEventListener(xi.Mt,e)}}),[]);var $n="PipelineDetail/index",et=(0,Xe.y)(),nt=et.disableGlobalKeyboardShortcuts,tt=et.registerOnKeyDown,it=et.unregisterOnKeyDown;(0,f.useEffect)((function(){return function(){it($n)}}),[it,$n]),tt($n,(function(e,n,t){var i;if(!(Xi.WH.OPEN===(null==De?void 0:De.current)||(null==Be||null===(i=Be.current)||void 0===i?void 0:i.length)>=1)){if(q&&(0,Ye.y)([ze.zX,ze.hS],n)){e.preventDefault();"undefined"!=typeof location&&window.confirm("You have changes that are unsaved. Click cancel and save your changes before reloading page.")&&location.reload()}if(!Pe&&!ne&&!Zn&&qn){var r,l;if((0,Ye.y)([ze.zX,ze.A1],n)||(0,Ye.y)([ze.PQ,ze.A1],n))return e.preventDefault(),Ue(!0),void(null==Te||null===(r=Te.current)||void 0===r||r.focus());if(Fe&&(0,Ye.y)([ze.vP],n))return e.preventDefault(),Ue(!1),void(null==Te||null===(l=Te.current)||void 0===l||l.blur())}if(Pe||ne||!y&&!nt)if((0,Ye.y)([ze.zX,ze.Um],n)||(0,Ye.y)([ze.PQ,ze.Um],n))e.preventDefault(),$();else if((0,Ye.y)([ze.zH],n)||(0,Ye.y)([ze.Fv],n)){if(ne&&!e.repeat&&!(0,rr.cK)(e)){var o=g.findIndex((function(e){var n=e.uuid;return ne.uuid===n}));if(-1!==o){var u=(0,Ye.y)([ze.zH],n)?o:o+1;Jn({type:b.tf.SCRATCHPAD},u)}}}else if(Pe)n[ze.vP]?fe(!1):q||ze.Z1.find((function(e){return n[e]}))||se(!0);else if(!Zn){if(ne){var c=g.findIndex((function(e){var n=e.uuid;return ne.uuid===n}));if(n[ze.vP])ae(null);else if(t[0]===ze.xD&&t[1]===ze.xD)N();else if(t[0]===ze.l1&&t[1]===ze.l1&&-1!==c)k(ne).then((function(e){null!=e&&e.error||setTimeout((function(){c===g.length-1?ae(g[c-1]):g.length>=0?ae(g[c+1]):ae(null)}),100)}));else if(n[ze.Bu]&&c>=1){var a=g[c-1];if(a){var d,p;ae(a);var f="".concat(a.type,"s/").concat(a.uuid,".py");null===(d=v.current[f])||void 0===d||null===(p=d.current)||void 0===p||p.scrollIntoView()}}else if(n[ze.kD]&&c<=zn-2){var h=g[c+1];if(h){var m,x;ae(h);var j="".concat(h.type,"s/").concat(h.uuid,".py");null===(m=v.current[j])||void 0===m||null===(x=m.current)||void 0===x||x.scrollIntoView()}}else(0,Ye.y)([ze.Uq],n)&&fe(!0)}else Kn&&n[ze.Uq]&&ae(Kn);s||t[0]!==ze.OC||t[1]!==ze.OC||V()}}}),[n,s,v.current,g,Fe,N,Zn,zn,q,V,$,Te,ne,Kn,se,ae,fe,Pe,qn]),(0,f.useEffect)((function(){var e=setInterval((function(){q&&!Z&&$()}),1e4);return function(){clearInterval(e)}}),[Z,q,$]),(0,f.useEffect)((function(){setTimeout((function(){return Ge(!0)}),2*er.zn)}),[z]);var rt=(0,h.Db)(Y.ZP.pipelines.useUpdate(encodeURIComponent(null==z?void 0:z.uuid)),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){null==E||E()},onErrorCallback:function(e,n){return null==le?void 0:le({errors:n,response:e})}})}}),lt=(0,l.Z)(rt,2),ot=lt[0],ut=(lt[1].isLoading,(0,h.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null==z?void 0:z.uuid),encodeURIComponent(null==n?void 0:n.uuid))({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){E()},onErrorCallback:function(e,n){return null==le?void 0:le({errors:n,response:e})}})}})),ct=(0,l.Z)(ut,1)[0],st=(0,f.useCallback)((function(e){Ne(!0),dn(e),ie(!0)}),[Ne,ie,dn]),at=(0,f.useCallback)((function(){Ne(!1),hn(!1),gn(""),ie(!1)}),[ie]),dt=(0,f.useCallback)((function(e,n){var t,i;g.forEach((function(r,l){var o=r.uuid;t>=0&&i>=0||(o===e.uuid?t=l:o===n.uuid&&(i=l))}));var r=(0,L.oM)(g,i);return r=(0,L.Hk)(n,Math.max(t,0),r),$({pipeline:{blocks:r,uuid:null==z?void 0:z.uuid}})}),[g,z,$]),pt=(0,f.useMemo)((function(){return z&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ui.Z,{addNewBlock:Jn,blockIdx:zn,blockTemplates:Yn,focusedAddNewBlockSearch:Fe,hideCustom:Zn||yn,hideDataExporter:Zn,hideDataLoader:Zn,hideDbt:Zn||yn,hideScratchpad:Zn,hideSensor:Zn,onClickAddSingleDBTModel:st,pipeline:z,project:Se,searchTextInputRef:Te,setCreatingNewDBTModel:hn,setFocusedAddNewBlockSearch:Ue,showBlockBrowserModal:ge,showBrowseTemplates:me,showConfigureProjectModal:be,showGlobalDataProducts:je}),!qn&&!Zn&&!yn&&(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,S.jsx)("br",{}),"Turn on the feature named"," ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:Qi.d.ADD_NEW_BLOCK_V2})," ","in your"," ",(0,S.jsx)(li(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,S.jsx)(P.Z,{muted:!0,underline:!0,children:(0,S.jsx)(O.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[Jn,Yn,Fe,Zn,yn,zn,st,z,Se,Te,Ue,ge,me,be,je,qn]);(0,f.useEffect)((function(){var e,n=function(){var e,n,t,i=((null==F||null===(e=F.current)||void 0===e||null===(n=e.getBoundingClientRect)||void 0===n?void 0:n.call(e))||{}).y;null===(t=Object.values((null==v?void 0:v.current)||{}))||void 0===t||t.forEach((function(e){var n,t,r,l;((null==e||null===(n=e.current)||void 0===n||null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n))||{}).y<=i?null!=e&&e.current&&(e.current.className=(0,tr.bS)((0,tr.xi)((null==e||null===(r=e.current)||void 0===r?void 0:r.className)||"",["enable-border-radius"]),["disable-border-radius"])):null!=e&&e.current&&(e.current.className=(0,tr.bS)((0,tr.xi)((null==e||null===(l=e.current)||void 0===l?void 0:l.className)||"",["disable-border-radius"]),["enable-border-radius"]))}))};null==F||null===(e=F.current)||void 0===e||e.addEventListener("scroll",n);var t=null==F?void 0:F.current;return function(){null==t||t.removeEventListener("scroll",n)}}),[v,F]);var ft=(0,f.useRef)({}),ht=(0,f.useMemo)((function(){var e=[],i=(null==Cn?void 0:Cn.length)||0;return Cn.forEach((function(l,s){var d,h,m,Z=s===i-1,P=l.type,C=l.uuid,O=(null==ne?void 0:ne.uuid)===C,w=En[C],T=w?0===w.priority?ii.uF.BUSY:ii.uF.QUEUED:ii.uF.IDLE,B=(0,di.zv)({type:P,uuid:C});(d=Me.current)[B]||(d[B]=(0,f.createRef)()),(h=v.current)[B]||(h[B]=(0,f.createRef)());var L,q,V=(0,di.zv)({type:P,uuid:(null==l?void 0:l.replicated_block)||C});null!=l&&l.replicated_block&&((L=ft.current)[V]||(L[V]=(0,o.Z)({},C,{})),(q=ft.current[V])[C]||(q[C]=(0,f.createRef)()));var Y=P===b.tf.MARKDOWN,Q=P===b.tf.TRANSFORMER,ie=!(null==A||!A[C]),ue=s===zn-1||Zn,se=Me.current[B],pe=v.current[B],ye=C,Oe=null==x||null===(m=x[P])||void 0===m?void 0:m[C];Oe&&(ye="".concat(ye,":").concat(Oe));e.push((0,S.jsx)(ln.Z,{addNewBlock:function(e,t){fe(!0);return n(e,Ze?s:s+1,(function(e){if(1===(null==t?void 0:t.length)){var n,i,l=null===(n=t[0])||void 0===n?void 0:n.uuid,o=(null===(i=t[0])||void 0===i?void 0:i.upstream_blocks)||[];ct({block:{uuid:l},upstreamBlocks:[e.uuid].concat((0,r.Z)(o))})}null==ae||ae(e)}))},addNewBlockMenuOpenIdx:on,addWidget:t,allBlocks:u,allowCodeBlockShortcuts:c,autocompleteItems:a,block:l,blockIdx:s,blockInteractions:null==p?void 0:p[C],blockOutputRef:se,blockRefs:v,blockTemplates:Yn,blocks:g,codeEditorMappingRef:ft,containerRef:Ee,cursorHeight1:Bn,cursorHeight2:Nn,cursorHeight3:Hn,dataProviders:j,dbtConfigurationOptions:Qn,defaultValue:l.content,deleteBlock:function(e){k(e),te(!1)},disableShortcuts:y,executionState:T,fetchFileTree:I,fetchPipeline:E,globalDataProducts:M,hideOutputOnExecution:D,hideRunButton:yn||Y||Zn&&Q,interactionsMapping:R,interruptKernel:N,isHidden:ie,mainContainerRect:xn,mainContainerRef:F,mainContainerWidth:U,messages:H[C],noDivider:ue,onCallbackChange:function(e){return W(P,C,e)},onChange:function(e){return G(P,C,e)},onClickAddSingleDBTModel:st,onDrop:dt,onMountCallback:function(e){null!=l&&l.replicated_block&&(ft.current[V][C]=e)},openSidekickView:K,pipeline:z,project:Se,ref:pe,runBlock:X,runningBlocks:J,savePipelineContent:$,scrollTogether:ee,selected:O,setAddNewBlockMenuOpenIdx:un,setAnyInputFocused:te,setCreatingNewDBTModel:hn,setEditingBlock:re,setErrors:le,setHiddenBlocks:oe,setMountedBlocks:wn,setOutputBlocks:ce,setScrollTogether:he,setSelected:function(e){return ae(!0===e?l:null)},setSelectedBlock:ae,setSelectedOutputBlock:de,setSideBySideEnabled:ve,setTextareaFocused:fe,showBlockBrowserModal:ge,showBrowseTemplates:me,showConfigureProjectModal:be,showDataIntegrationModal:xe,showGlobalDataProducts:je,showUpdateBlockModal:ke,sideBySideEnabled:Ze,textareaFocused:O&&Pe,updatePipeline:ot,widgets:Ce,windowWidth:In,children:Ze&&Z&&(0,S.jsx)("div",{style:{paddingBottom:_.WC,paddingTop:_.WC},children:pt})},ye))})),e}),[n,on,pt,t,u,c,a,p,Me,v,Yn,g,Cn,x,Ee,Bn,Nn,Hn,j,Qn,k,y,I,E,M,D,A,R,N,Zn,yn,xn,F,U,H,zn,W,G,st,dt,K,z,Se,X,J,En,$,ee,ne,un,te,re,le,oe,wn,ce,ae,de,fe,he,ve,ge,me,be,xe,je,ke,Ze,Pe,ct,ot,Ce,In]),vt=(0,f.useMemo)((function(){return(0,S.jsx)(Yi,{addNewBlockAtIndex:n,blocks:g,codeBlocks:ht,fetchFileTree:I,fetchPipeline:E,fetchSampleData:T,globalVariables:B,onChangeCodeBlock:G,openSidekickView:K,pipeline:z,savePipelineContent:$,setErrors:le,setIntegrationStreams:ue,setOutputBlocks:ce,setSelectedBlock:ae,setSelectedOutputBlock:de,setSelectedStream:pe})}),[n,g,ht,I,E,T,B,G,K,z,$,le,ue,ce,ae,de,pe]),mt=(0,f.useCallback)((function(e){var t=null==an;n((0,di.J8)({blockIndex:an,blocks:g,filePath:e,isNewBlock:fn,name:mn,repoPathRelativeRoot:null==Ie?void 0:Ie.repo_path_relative_root}),(t?zn:an+1)-(Ze?1:0),ae),at(),fe(!0)}),[n,g,at,fn,mn,an,zn,ae,fe,Ze,Ie]);(0,f.useEffect)((function(){$e&&Se&&setTimeout((function(){return Ve(!1)}),er.zn)}),[$e,Se]);var gt=(0,f.useCallback)((function(e,n,t){mt(t)}),[mt]);return(0,f.useCallback)((function(e,n){n||mt(e)}),[mt]),(0,S.jsxs)(nn.W,{backend:tn.PD,children:[(0,S.jsx)(er.lO,{ref:Ee,children:qe&&(0,S.jsx)(oi.Z,{classNames:"pipeline-detail",in:We,onEntered:function(){return en(!0)},timeout:1,children:(0,S.jsx)(er.fm,{})})}),Zn&&(0,S.jsx)(C.Z,{mt:1,px:w.cd,children:vt}),!Ze&&(0,S.jsx)(C.Z,{mt:1,px:w.cd,children:!Zn&&(0,S.jsxs)(S.Fragment,{children:[ht,(0,S.jsx)(C.Z,{mt:w.cd,children:pt})]})}),Ze&&(0,S.jsxs)("div",{style:{position:"relative"},children:[An,ht,Fn,Gn,!(null!=g&&g.length)&&(0,S.jsx)(C.Z,{p:w.cd,children:pt})]}),Re&&(0,S.jsx)(xt.Z,{onClickOutside:at,open:!0,children:(0,S.jsx)(yi,{onClose:at,onSelectBlockFile:gt})})]})},cr=t(82555),sr=t(92272),ar=t(2842);function dr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function pr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?dr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):dr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var fr=function(e){var n=e.after,t=e.afterFooter,i=e.afterHeader,r=e.afterHeightOffset,o=e.afterHidden,u=e.afterInnerHeightMinus,c=e.afterNavigationItems,s=e.afterOverflow,a=e.afterSubheader,d=e.before,p=e.beforeDraggableTopOffset,h=e.beforeHeader,v=e.beforeHeightOffset,m=e.beforeHidden,g=e.beforeNavigationItems,b=e.children,x=e.errors,j=e.footerOffset,k=e.headerOffset,Z=e.mainContainerFooter,y=e.mainContainerHeader,P=e.mainContainerRef,C=e.page,O=e.pipeline,w=e.setAfterHidden,_=e.setAfterWidthForChildren,I=e.setBeforeHidden,E=e.setErrors,T=e.setMainContainerWidth,M=(0,Qe.i)().width,B=(0,f.useState)((0,Ve.U2)(Ve.L8,ar.Zt)),D=B[0],A=B[1],R=(0,f.useState)((0,Ve.U2)(Ve.J3,ar.ve)),N=R[0],L=R[1],F=(0,f.useState)(!1),U=F[0],H=F[1],W=(0,f.useState)(!1),K=W[0],z=W[1],q=o,V=w;if(!V){var Y=(0,f.useState)(!!(0,Ve.U2)(Ve.zg)),X=(0,l.Z)(Y,2);q=X[0],V=X[1]}var Q=m,J=I;if(!J){var $=(0,f.useState)(!!(0,Ve.U2)(Ve.Uu)),ee=(0,l.Z)($,2);Q=ee[0],J=ee[1]}(0,f.useEffect)((function(){null==P||!P.current||U||K||null==T||T(P.current.getBoundingClientRect().width)}),[U,K,q,D,Q,N,P,T,M]),(0,f.useEffect)((function(){U||(null==_||_(D),(0,Ve.t8)(Ve.L8,D))}),[U,D,_]),(0,f.useEffect)((function(){K||(0,Ve.t8)(Ve.J3,N)}),[K,N]);var ne=(0,f.useMemo)((function(){var e=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return O&&(e.push.apply(e,[{bold:ci.b7!==C,label:function(){return null==O?void 0:O.uuid},linkProps:{as:"/pipelines/".concat(null==O?void 0:O.uuid),href:"/pipelines/[pipeline]"}}]),ci.b7===C&&e.push.apply(e,[{bold:!0,label:function(){return(0,G.kC)(C)}}])),(0,S.jsx)(sr.Z,{breadcrumbs:e})}),[C,O]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt.Z,{title:null==O?void 0:O.name}),(0,S.jsx)(Ee.Z,{after:n,afterFooter:t,afterHeader:i,afterHeightOffset:r,afterHidden:q,afterInnerHeightMinus:u,afterMousedownActive:U,afterNavigationItems:c,afterOverflow:s,afterSubheader:a,afterWidth:D,before:d,beforeDraggableTopOffset:p,beforeHeader:h,beforeHeightOffset:v,beforeHidden:Q,beforeMousedownActive:K,beforeNavigationItems:g,beforeWidth:N,footerOffset:j,header:ne,headerOffset:k,mainContainerFooter:Z,mainContainerHeader:y,mainContainerRef:P,navigationShowMore:!0,setAfterHidden:V,setAfterMousedownActive:H,setAfterWidth:A,setBeforeHidden:J,setBeforeMousedownActive:z,setBeforeWidth:L,subtractTopFromBeforeDraggableHeight:!0,children:b}),x&&(0,S.jsx)(xt.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return E(null)},children:(0,S.jsx)(cr.Z,pr(pr({},x),{},{onClose:function(){return E(null)}}))})]})},hr=t(55729),vr=t(93808),mr=t(8666),gr=t(72226),br=t(29644),xr=t(46209),jr=t(79264),kr=p.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1cm3orh-0"})(["border-radius:","px;padding:","px ","px;",""],Te.n_,1.5*w.iI,w.l4,(function(e){return"\n border: ".concat(Te.YF,"px ").concat(Te.M8," ").concat((e.theme||U.Z).interactive.defaultBorder,";\n ")})),Zr=t(68781),yr=t(79633);function Pr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Cr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Pr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Or={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"},wr={bold:!0,default:!0,inline:!0,monospace:!0,small:!0},_r=(0,pi.YW)(),Sr=["data_integration","disable_output_preview","dynamic","file_path","file_source","global_data_product","reduce_output"];var Ir=function(e){e.addNewBlockAtIndex;var n,t,i,r,o,u=e.block,c=(e.contentByBlockUUID,e.fetchFileTree),s=e.fetchPipeline,a=e.globalDataProducts,d=e.pipeline,p=e.project,v=e.setSelectedBlock,m=(e.showDataIntegrationModal,e.showUpdateBlockModal),g=(0,f.useRef)(null),k=(0,f.useRef)(null),_=(0,f.useMemo)((function(){return null==d?void 0:d.uuid}),[d]),I=(0,f.useMemo)((function(){return(null==d?void 0:d.retry_config)||{}}),[d]),E=(0,f.useMemo)((function(){return!(null!=d&&d.run_pipeline_in_one_process)&&[cn.qL.PYSPARK,cn.qL.PYTHON].includes(null==d?void 0:d.type)}),[d]),T=u.color,M=u.configuration,B=u.language,D=u.name,F=u.type,U=u.uuid,H=(0,f.useMemo)((function(){return b.tf.DBT===F}),[F]),W=null==d||null===(n=d.blocks)||void 0===n?void 0:n.findIndex((function(e){return e.uuid===U})),K=(0,f.useMemo)((function(){var e;return null==d||null===(e=d.blocks)||void 0===e?void 0:e[W]}),[W,null==d?void 0:d.blocks]),z=(0,se.VI)(null,{},[],{uuid:"BlockSettings/index"}),q=(0,l.Z)(z,1)[0],V=(0,f.useMemo)((function(){return(0,L.HK)(a||[],(function(e){return e.uuid}))}),[a]),X=(0,f.useMemo)((function(){var e,n=null==M||null===(e=M.global_data_product)||void 0===e?void 0:e.uuid;if(n&&V)return null==V?void 0:V[n]}),[M,V]),Q=Y.ZP.pipelines.detail(mr.b.PIPELINE===(null==X?void 0:X.object_type)&&(null==X?void 0:X.object_uuid),{},{revalidateOnFocus:!1}).data,J=(0,f.useMemo)((function(){return null==Q?void 0:Q.pipeline}),[Q]),$=(0,f.useState)(null),ee=$[0],ne=$[1],te=(0,f.useState)(!1),ie=te[0],re=te[1],le=(0,f.useState)(!1),oe=le[0],ue=le[1],ce=(0,f.useState)(!1),ae=ce[0],de=ce[1],pe=(0,jn.Z)(u);(0,f.useEffect)((function(){(null==pe?void 0:pe.uuid)!==(null==u?void 0:u.uuid)&&ne(u)}),[u,pe]);var fe=(0,f.useMemo)((function(){return(null==ee?void 0:ee.retry_config)||{}}),[ee]),he=(0,f.useCallback)((function(e){re(!0),ne(e)}),[]),ve=(0,f.useMemo)((function(){return(0,Tn.gR)((null==ee?void 0:ee.configuration)||M,Sr)}),[null==ee?void 0:ee.configuration,M]),me=(0,f.useCallback)((function(e){return he((function(n){return Cr(Cr({},n),{},{configuration:Cr(Cr({},null==ee?void 0:ee.configuration),e)})}))}),[null==ee?void 0:ee.configuration,he]),be=(0,f.useMemo)((function(){return null==ee?void 0:ee.executor_type}),[ee]);(0,f.useEffect)((function(){oe||!be||Zr.R.find((function(e){return e===be}))||ue(!0)}),[oe,be]);var xe=Y.ZP.blocks.pipelines.detail(_,encodeURIComponent(U),{_format:"with_settings",block_type:F}).data,ke=(0,f.useMemo)((function(){return(null==xe?void 0:xe.block)||{}}),[xe]),Ze=(0,f.useMemo)((function(){return null!=ke&&ke.pipelines?null==ke?void 0:ke.pipelines:[]}),[ke]),Pe=(null==Ze?void 0:Ze.length)||1,Ce=(0,h.Db)(Y.ZP.blocks.pipelines.useUpdate(_,encodeURIComponent(U)),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){re(!1),null==c||c(),s(),null!=e&&e.block&&v(null==e?void 0:e.block)},onErrorCallback:function(e,n){return q({errors:n,response:e})}})}}),Oe=(0,l.Z)(Ce,2),we=Oe[0],_e=Oe[1].isLoading,Se=((0,f.useCallback)((function(e){return we({block:e})}),[we]),(0,f.useMemo)((function(){return Pe>=1&&(0,S.jsx)(kn.cl,{children:(0,S.jsx)(R.Z,{columnFlex:[null,1],columns:[{uuid:"Name"},{uuid:"Project path"}],rows:Ze.map((function(e){var n,t,i=e.pipeline,r=i.name,l=i.repo_path,o=i.uuid,u=!(null==p||!p.settings),c=(null==d?void 0:d.uuid)===o&&(!u||(null==p||null===(n=p.settings)||void 0===n?void 0:n.path)===l);return[c||u&&(null==p||null===(t=p.settings)||void 0===t?void 0:t.path)!==l?(0,S.jsxs)(O.ZP,{monospace:!0,muted:!0,children:[r||o,c&&" (current)"]},"name"):(0,S.jsx)(P.Z,{href:"/pipelines/".concat(o,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:r||o},"name"),(0,S.jsx)(O.ZP,{default:!0,monospace:!0,children:l||"-"},"project_path")]})),uuid:"git-branch-blockPipelines"})})}),[Ze,Pe,d,null==p?void 0:p.settings])),Ee=(0,f.useMemo)((function(){return I&&void 0!==I&&!(0,Tn.Qr)(I)&&(void 0!==(null==I?void 0:I.delay)&&void 0===(null==fe?void 0:fe.delay)||void 0!==(null==I?void 0:I.exponential_backoff)&&void 0===(null==fe?void 0:fe.exponential_backoff)||void 0!==(null==I?void 0:I.max_delay)&&void 0===(null==fe?void 0:fe.max_delay)||void 0!==(null==I?void 0:I.retries)&&void 0===(null==fe?void 0:fe.retries))}),[fe,I]),Te=(0,f.useMemo)((function(){var e;return(null==ee||null===(e=ee.configuration)||void 0===e?void 0:e.global_data_product)||{}}),[ee]),Me=(0,f.useCallback)((function(e){return he((function(n){var t;return Cr(Cr({},n),{},{configuration:Cr(Cr({},null==ee?void 0:ee.configuration),{},{global_data_product:e(null==ee||null===(t=ee.configuration)||void 0===t?void 0:t.global_data_product)})})}))}),[ee,he]),Be=(0,f.useMemo)((function(){return(0,yn.jO)(u,d)}),[u,d]);return(0,f.useMemo)((function(){return Be&&(0,yn.Uc)(u)}),[u,Be]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{mb:w.HN,pt:w.cd,children:[Pe>1&&(0,S.jsx)(C.Z,{mb:w.Mq,px:w.cd,children:(0,S.jsx)(kr,{children:(0,S.jsxs)(y.ZP,Cr(Cr({},y.A0),{},{children:[(0,S.jsxs)(Z.Z,{children:[(0,S.jsx)(N.DiamondShared,{fill:yr.$R,size:pn.l2}),(0,S.jsx)(C.Z,{pr:2}),(0,S.jsxs)(O.ZP,{bold:!0,large:!0,lineHeight:3*w.iI,warning:!0,children:["Shared by ",Pe," pipelines"]})]}),!H&&(null==d?void 0:d.type)!==cn.qL.INTEGRATION&&(0,S.jsx)(An.Z,{appearBefore:!0,block:!0,label:"Duplicates block so it is no longer shared with any other pipelines (detaches other pipeline associations)",lightBackground:!0,maxWidth:30*w.iI,size:null,children:(0,S.jsx)(ge.ZP,Cr(Cr({},Or),{},{afterIcon:(0,S.jsx)(N.DiamondDetached,{size:pn.bL}),iconOnly:!1,onClick:function(){return m(Cr(Cr({},(0,Tn.gR)(K,["all_upstream_blocks_executed","callback_blocks","conditional_blocks","downstream_blocks","executor_config","executor_type","name","outputs","retry_config","status","tags","timeout"])),{},{detach:!0}),"".concat(D,"_copy"),!0)},padding:null,children:"Detach"}))})]}))})}),(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsxs)(_n.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(_n.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,Cr(Cr({},y.A0),{},{children:[(0,S.jsx)(Z.Z,{children:(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Name"})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(ge.ZP,Cr(Cr({},Or),{},{afterIcon:H?null:(0,S.jsx)(N.Edit,{size:pn.bL}),disabled:H,onClick:function(){return m(u,D)},children:(0,S.jsx)(O.ZP,{bold:!0,children:D||""})}))]}))}),b.tf.CUSTOM===(null==u?void 0:u.type)?(0,S.jsx)(_n.g,{noBorder:!0,children:(0,S.jsxs)(y.ZP,Cr(Cr({},y.A0),{},{children:[(0,S.jsx)(Z.Z,{children:(0,S.jsx)(O.ZP,{bold:!0,default:!0,children:"Color"})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(ge.ZP,Cr(Cr({},Or),{},{afterIcon:(0,S.jsx)(j.Z,{color:T?_r[T]:null,size:pn.bL,square:!0}),onClick:function(){return m(u,D)},outline:!1,children:(0,S.jsx)(O.ZP,{bold:!0,children:(0,G.kC)(T||"")})}))]}))}):null]}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(x.Z,{checked:!(null==ee||null===(t=ee.configuration)||void 0===t||!t.disable_output_preview),label:"Disable output preview on page load",onClick:function(){return he((function(e){var n;return Cr(Cr({},e),{},{configuration:Cr(Cr({},null==e?void 0:e.configuration),{},{disable_output_preview:!(null!=e&&null!==(n=e.configuration)&&void 0!==n&&n.disable_output_preview)})})}))}})})]}),(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(A.Z,{level:5,children:"Executor type"}),(0,S.jsxs)(O.ZP,{muted:!0,children:["For more information on this setting, please read the"," ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/compute-resource#2-set-executor-type-and-customize-the-compute-resource-of-the-mage-executor",openNewWindow:!0,children:"documentation"}),"."]}),(0,S.jsxs)(C.Z,{mt:1,children:[!oe&&(0,S.jsx)(sn.Z,{label:"Executor type",onChange:function(e){return he((function(n){return Cr(Cr({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:g,value:(null==ee?void 0:ee.executor_type)||"",children:Zr.R.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}),oe&&(0,S.jsx)(Ie.Z,{label:"Executor type",monospace:!0,onChange:function(e){return he((function(n){return Cr(Cr({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:k,setContentOnMount:!0,value:(null==ee?void 0:ee.executor_type)||""}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(P.Z,{muted:!0,onClick:function(){oe?(he((function(e){return Cr(Cr({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null==g||null===(e=g.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null==k||null===(e=k.current)||void 0===e?void 0:e.focus()}),1),ue(!oe)},preventDefault:!0,small:!0,children:oe?"Select a preset executor type":"Enter a custom executor type"})})]})]}),(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(A.Z,{level:5,children:"Retry configuration"}),(0,S.jsxs)(O.ZP,{muted:!0,children:[Ee&&(0,S.jsxs)(S.Fragment,{children:["This block is currently using the retry configuration from the pipeline. You can override the pipeline’s retry configuration for this block.",(0,S.jsx)("br",{})]}),"For more information on this setting, please read the"," ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,S.jsxs)(C.Z,{mt:1,children:[(0,S.jsxs)(y.ZP,{children:[(0,S.jsx)(Ie.Z,{label:"Retries",monospace:!0,onChange:function(e){return he((function(n){var t;return Cr(Cr({},n),{},{retry_config:Cr(Cr({},null==n?void 0:n.retry_config),{},{retries:void 0!==e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:void 0===(null==I?void 0:I.retries),setContentOnMount:!0,type:"number",value:void 0!==(null==fe?void 0:fe.retries)?null==fe?void 0:fe.retries:(null==I?void 0:I.retries)||""}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Ie.Z,{label:"Delay",monospace:!0,onChange:function(e){return he((function(n){var t;return Cr(Cr({},n),{},{retry_config:Cr(Cr({},null==n?void 0:n.retry_config),{},{delay:void 0!==e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:void 0===(null==I?void 0:I.delay),setContentOnMount:!0,type:"number",value:void 0!==(null==fe?void 0:fe.delay)?null==fe?void 0:fe.delay:(null==I?void 0:I.delay)||""}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Ie.Z,{label:"Max delay",monospace:!0,onChange:function(e){return he((function(n){var t;return Cr(Cr({},n),{},{retry_config:Cr(Cr({},null==n?void 0:n.retry_config),{},{max_delay:void 0!==e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:void 0===(null==I?void 0:I.max_delay),setContentOnMount:!0,type:"number",value:void 0!==(null==fe?void 0:fe.max_delay)?null==fe?void 0:fe.max_delay:(null==I?void 0:I.max_delay)||""})]}),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(x.Z,{checked:void 0===(null==fe?void 0:fe.exponential_backoff)&&void 0!==(null==I?void 0:I.exponential_backoff)?!(null==I||!I.exponential_backoff):!(null==fe||!fe.exponential_backoff),label:"Exponential backoff",onClick:function(){return he((function(e){var n;return Cr(Cr({},e),{},{retry_config:Cr(Cr({},null==e?void 0:e.retry_config),{},{exponential_backoff:void 0===(null==fe?void 0:fe.exponential_backoff)&&void 0!==(null==I?void 0:I.exponential_backoff)?!(null!=I&&I.exponential_backoff):!(null!=e&&null!==(n=e.retry_config)&&void 0!==n&&n.exponential_backoff)})})}))}})})]})]}),E&&(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(A.Z,{level:5,children:"Block run timeout"}),(0,S.jsx)(C.Z,{mb:1}),(0,S.jsx)(Ie.Z,{label:"Time in seconds",monospace:!0,onChange:function(e){return he((function(n){return Cr(Cr({},n),{},{timeout:e.target.value})}))},primary:!0,setContentOnMount:!0,type:"number",value:(null==ee?void 0:ee.timeout)||""}),(0,S.jsx)(C.Z,{mb:1}),(0,S.jsx)(O.ZP,{muted:!0,small:!0,children:"The block timeout will only be applied when the block is run through a trigger. If a block times out, the block run will be set to a failed state."})]}),H&&(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(A.Z,{level:5,children:"dbt settings"}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(x.Z,{checked:!(null==ee||null===(i=ee.configuration)||void 0===i||null===(r=i.dbt)||void 0===r||!r.disable_tests),label:"Disable automatically running dbt tests",onClick:function(){return he((function(e){var n,t,i;return Cr(Cr({},e),{},{configuration:Cr(Cr({},null==e?void 0:e.configuration),{},{dbt:Cr(Cr({},null==e||null===(n=e.configuration)||void 0===n?void 0:n.dbt),{},{disable_tests:!(null!=e&&null!==(t=e.configuration)&&void 0!==t&&null!==(i=t.dbt)&&void 0!==i&&i.disable_tests)})})})}))}})})]}),b.Lk.includes(F)&&b.t6.PYTHON===B&&(0,S.jsxs)(C.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{level:5,children:"Block variables"}),(0,S.jsx)(C.Z,{ml:2}),(0,S.jsx)(on.ZP,{Icon:N.Add,blackBorder:!0,halfPaddingBottom:!0,halfPaddingTop:!0,inline:!0,onClick:function(){return de((function(e){return!e}))},smallIcon:!0,uuid:"Sidekick/BlockSettings/addNewBlockVariable",children:"New"})]}),(0,S.jsxs)(C.Z,{mb:w.cd,mt:1,children:[(0,S.jsxs)(O.ZP,{muted:!0,children:["Press",(0,S.jsx)(O.ZP,Cr(Cr({},wr),{},{children:" Enter"}))," or",(0,S.jsx)(O.ZP,Cr(Cr({},wr),{},{children:" Return"}))," on a row to add or update a variable. These variables are only accessible in this block ",(0,S.jsxs)(O.ZP,Cr(Cr({},wr),{},{bold:!1,children:["(",U,")."]})),(0,S.jsxs)(O.ZP,{inline:!0,muted:!0,children:[" ","Refer to the",(0,S.jsxs)(P.Z,{href:"https://docs.mage.ai/development/variables/block-variables",openNewWindow:!0,children:[" ","documentation"]})," ","for more details."]})]}),(0,S.jsxs)(O.ZP,{muted:!0,children:[(0,S.jsxs)(O.ZP,{bold:!0,inline:!0,warning:!0,children:["Note:"," "]}),"Click the",(0,S.jsx)(O.ZP,Cr(Cr({},wr),{},{children:" Update block settings"}))," button below to save changes. If you do not, any new or updated block variables will not be persisted."]})]}),(0,S.jsxs)(C.Z,{mb:w.cd,children:[ae&&(0,S.jsx)(jr.Z,{editStateInit:!0,focusKey:!0,onEnterCallback:function(){return de(!1)},onEscapeCallback:function(){return de(!1)},updateVariable:me},"new_block_variable"),null===(o=Object.entries(ve))||void 0===o?void 0:o.map((function(e){var n=e[0];return(0,S.jsx)(jr.Z,{copyText:"kwargs['configuration'].get('".concat(n,"')"),deleteVariable:function(){var e=Cr({},null==ee?void 0:ee.configuration);delete e[n],he((function(n){return Cr(Cr({},n),{},{configuration:Cr({},e)})}))},disableKeyEdit:!0,updateVariable:me,variable:{uuid:n,value:e[1]}},n)}))]})]}),b.tf.GLOBAL_DATA_PRODUCT===F&&(0,S.jsxs)(C.Z,{mb:w.HN,children:[(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(A.Z,{level:5,children:"Override global data product settings"})}),(0,S.jsx)(C.Z,{mt:w.Mq,children:(0,S.jsx)(gr.Z,{objectAttributes:Te,originalAttributes:X,setObjectAttributes:Me})}),(0,S.jsx)(C.Z,{mt:w.Mq,children:(0,S.jsx)(br.Z,{objectAttributes:Te,originalAttributes:X,setObjectAttributes:Me})}),(0,S.jsx)(C.Z,{mt:w.Mq,children:(0,S.jsx)(xr.Z,{blocks:null==J?void 0:J.blocks,objectAttributes:Te,originalAttributes:X,setObjectAttributes:Me})})]}),(0,S.jsx)(C.Z,{px:w.cd,children:(0,S.jsx)(ge.ZP,{disabled:!ie,loading:_e,onClick:function(){return we({block:{configuration:null==ee?void 0:ee.configuration,executor_type:null==ee?void 0:ee.executor_type,retry_config:fe,timeout:null==ee?void 0:ee.timeout}})},primary:!0,children:"Update block settings"})})]}),(0,S.jsxs)(C.Z,{mb:w.HN,children:[!xe&&(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(je.Z,{inverted:!0})}),xe&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsxs)(A.Z,{level:5,children:["Pipelines using this block (",Pe,")"]}),(0,S.jsx)(O.ZP,{default:!0,children:"A shared block is available to and reused by multiple pipelines. It enables you to write code once and have it easily accessible anywhere in the workspace. As a result, any code changes will affect all pipelines sharing the block."})]}),Se]})]})]})},Er=t(24496),Tr=t(50450),Mr=t(46568),Br=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];function Dr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ar(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Dr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Dr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Rr=p.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*w.iI),Nr=p.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var Lr=function(e){var n=e.bold,t=void 0===n||n,i=e.defaultColor,r=e.description,l=e.disableWordBreak,o=e.fullWidth,u=e.inputValue,c=e.inputWidth,s=e.invertedTheme,a=e.label,d=e.labelColor,p=e.menuOpen,h=void 0!==p&&p,v=e.monospace,m=e.muted,g=e.onClick,b=e.notRequired,x=e.selectedTextProps,j=e.small,k=e.stacked,w=e.suffixValue,_=e.tooltipProps,I=e.value,E=(0,Sn.Z)(e,Br),T=(0,f.useRef)(null),M=(0,f.useState)(!1),B=M[0],D=M[1],A=(0,f.useState)(!1),R=A[0],N=A[1],L=a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.ZP,{bold:t,color:d,inverted:s,lineHeight:20,monospace:v,muted:m,small:j,children:a}),_&&(0,S.jsx)(C.Z,{ml:1,children:(0,S.jsx)(An.Z,Ar({muted:!0},_))})]}),F=(0,S.jsxs)(Z.Z,{flex:o?"1":"none",children:[I&&(0,S.jsx)(P.Z,{block:!0,danger:null==x?void 0:x.danger,fullWidth:!0,muted:m,onClick:function(){g(),T.current&&T.current.focus(),D(!0)},preventDefault:!0,sameColorAsText:m||!(null!=x&&x.primary)&&!(null!=x&&x.danger)&&!(null!=x&&x.warning),underline:null==x?void 0:x.underline,warning:null==x?void 0:x.warning,children:(0,S.jsx)(O.ZP,Ar(Ar({inverted:s,muted:m},x),{},{disableWordBreak:l,monospace:v,small:j,title:c?I:null,width:c,children:I}))}),(0,S.jsx)(Ie.Z,Ar(Ar({},E),{},{basic:!0,defaultColor:i,fullWidth:o,invertedTheme:s,monospace:v,onBlur:function(e){D(!1),E.onBlur&&E.onBlur(e),R||N(!0)},onFocus:function(e){D(!0),E.onFocus&&E.onFocus(e)},ref:T,small:j,value:u,visible:!I}))]}),U=r&&(0,S.jsx)(Nr,{children:(0,S.jsx)(O.ZP,{dangerouslySetInnerHTML:{__html:r},monospace:v,muted:!0,small:j})}),H=(0,f.useMemo)((function(){return(0,S.jsx)(O.ZP,{default:!0,small:j,children:w})}),[j,w]);return(0,S.jsxs)(S.Fragment,{children:[k&&(0,S.jsxs)(S.Fragment,{children:[L&&(0,S.jsxs)(Rr,{children:[(0,S.jsx)(y.ZP,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:L}),U]}),(0,S.jsxs)(y.ZP,{fullWidth:o,children:[F,w&&H]})]}),!k&&(0,S.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,children:[L&&(0,S.jsxs)(S.Fragment,{children:[L,(0,S.jsx)(C.Z,{ml:1})]}),F,w&&H]}),R&&!B&&!I&&!h&&!b&&(0,S.jsx)(O.ZP,{danger:!0,small:j,children:"This field is required."})]})},Fr=t(10305),Ur=t(84820),Hr=t(85108),Wr=t(97301);function Gr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Kr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Gr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Gr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function zr(e,n){var t,i,r,u,c=e.autocompleteItems,s=e.block,a=e.blockRefs,d=e.blocks,v=e.deleteWidget,m=e.executionState,g=e.fetchPipeline,x=e.fetchFileTree,j=e.messages,k=void 0===j?[]:j,I=e.onChangeContent,E=e.pipeline,T=e.runBlock,M=e.runningBlocks,B=e.savePipelineContent,D=e.selected,A=e.setAnyInputFocused,R=e.setErrors,F=e.setSelectedBlock,H=e.setTextareaFocused,W=e.textareaFocused,K=e.updateWidget,z=e.width,q=(0,f.useRef)(null),V=(0,f.useContext)(p.ThemeContext),X=Y.ZP.blocks.pipelines.detail(encodeURIComponent(null==E?void 0:E.uuid),encodeURIComponent(null==s?void 0:s.upstream_blocks[0])).data,Q=(null==X||null===(t=X.block)||void 0===t?void 0:t.outputs)||(null==s?void 0:s.outputs)||[],J=(0,f.useState)(null),$=J[0],ee=J[1],ne=(0,f.useState)(null===(i=s.configuration)||void 0===i?void 0:i.chart_type),te=ne[0],ie=ne[1],re=(0,f.useState)(s.configuration),le=re[0],oe=re[1],ue=(0,f.useState)(s.content),ce=ue[0],se=ue[1],ae=(0,f.useState)(!te||0===Q.length),de=ae[0],pe=ae[1],fe=(0,f.useState)(!1),he=fe[0],ve=fe[1],me=(0,f.useState)(null),ge=me[0],xe=me[1],ke=(0,f.useState)(null==s?void 0:s.upstream_blocks),Ze=ke[0],Pe=ke[1],Ce=(0,f.useState)((null==Q?void 0:Q.length)||0),Oe=Ce[0],we=Ce[1],_e=(0,f.useState)(s.uuid),Se=_e[0],Ee=_e[1],Te=Hr.G8[te],Me=Hr.x8[te],Be=(0,f.useMemo)((function(){return null==d?void 0:d.filter((function(e){var n=e.type;return!b.vn.includes(n)}))}),[d]),De=(0,f.useMemo)((function(){return(0,L.HK)(Be,(function(e){return e.uuid}))}),[Be]),Ae=!!M.find((function(e){return e.uuid===s.uuid}))||(null==k?void 0:k.length)>=1&&m!==ii.uF.IDLE,Re=(0,f.useMemo)((function(){return null==k?void 0:k.filter((function(e){return null==e?void 0:e.type}))}),[k]),Ne=!!Re.find((function(e){return e.error})),Le=Re.length>=1,Fe=(0,f.useMemo)((function(){return{blockType:s.type,hasError:Ne,selected:D}}),[s.type,Ne,D]),Ue=(0,f.useMemo)((function(){var e,n;if(null!=Re&&Re.length){var t,i,r,l,o,u=Re.length-1;n=(null==Re||null===(t=Re[u])||void 0===t||null===(i=t.data)||void 0===i?void 0:i[0])||(null==Re||null===(r=Re[u])||void 0===r||null===(l=r.data)||void 0===l||null===(o=l.data)||void 0===o?void 0:o[0])}return n?(n=(n=n.slice(1,n.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,G.Pb)(n)&&(e=JSON.parse(n))):(null==Q?void 0:Q.length)>=1&&(e={},Q.forEach((function(n){var t=n||{},i=t.text_data,r=t.type,l=t.variable_uuid;ii.Gi.TEXT===r&&(0,G.Pb)(i)&&(e[l]=JSON.parse(i))}))),e}),[Re,Q]),He=(0,f.useCallback)((function(e){var n=Kr(Kr(Kr({},s),e),{},{configuration:Kr(Kr({},s.configuration),e.configuration)});B().then((function(){T({block:n,code:ce,ignoreAlreadyRunning:!0,runUpstream:!!Ze.find((function(e){var n;return![b.DA.EXECUTED,b.DA.UPDATED].includes(null===(n=De[e])||void 0===n?void 0:n.status)}))})})),we((function(e){return e+1}))}),[s,De,ce,T,B,we,Ze]),We=(0,f.useCallback)((function(e){se(e),I(e)}),[I,se]),Ge=(0,f.useCallback)((function(e){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).autoRun;oe((function(n){return Kr(Kr({},n),e)}));var t=Kr(Kr({},s),{},{configuration:Kr(Kr(Kr({},le),e),{},{chart_type:te})});K(t),Oe&&n&&He(t)}),[s,te,le,Oe,He,oe,K]);(0,f.useEffect)((function(){ee({python:(0,Ur.Z)({autocompleteItems:c,block:s,blocks:d,pipeline:E})})}),[c,s,d,E]);var Ke=(0,f.useMemo)((function(){return(0,S.jsx)(be.Z,{autoHeight:!0,autocompleteProviders:$,onChange:We,selected:D,setSelected:function(e){return F(!0===e?s:null)},setTextareaFocused:H,showLineNumbers:!1,textareaFocused:W||nr.oV.TABLE===te&&!de,value:ce,width:"100%"})}),[$,s,te,ce,de,D,F,H,W,We]),qe=(0,f.useMemo)((function(){return(Ne||Le)&&(0,S.jsx)(Tr.Z,Kr(Kr({},Fe),{},{block:s,contained:!1,hideExtraInfo:!0,isInProgress:Ae,messages:Re,selected:D}))}),[s,Fe,Ne,Le,Ae,Re,D]),Ve=(0,f.useMemo)((function(){return le[nr.v8]||1}),[le]),Ye=(0,jn.Z)(de),Qe=(0,jn.Z)(z),Je=(0,jn.Z)(null==le?void 0:le[nr.v8]);(0,f.useEffect)((function(){var e,n=null==q||null===(e=q.current)||void 0===e?void 0:e.getBoundingClientRect();Ye!==de||Qe!==z||Je!==Ve?(xe(0),setTimeout((function(){var e,n,t=null==q||null===(e=q.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width;t&&xe(t)}),100)):n&&xe(n.width)}),[de,Ye,q,xe,z,Qe,Ve,Je]);var $e=(0,f.useMemo)((function(){var e=[];return Ze.forEach((function(n,t){var i=De[n],r=(0,_.qn)(null==i?void 0:i.type,{blockColor:null==i?void 0:i.color,theme:V}).accent;e.push((0,S.jsxs)(C.Z,{ml:2,children:[(0,S.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,S.jsx)(P.Z,{color:r,inline:!0,onClick:function(){var e,n,t=null==a||null===(e=a.current)||void 0===e?void 0:e["".concat(null==i?void 0:i.type,"s/").concat(null==i?void 0:i.uuid,".py")];null==t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,S.jsx)(O.ZP,{color:r,monospace:!0,small:!0,children:n})})]},n))})),e}),[a,De,V,Ze]),en=(0,f.useMemo)((function(){var e,n=[],t=null==Te||null===(e=Te.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return nr.Tv.includes(t)?e.concat(t):e}),[]);return null==t||t.forEach((function(e){var t=le[e];if(t){var i,r,l=null===(i=Hr.SR[te])||void 0===i||null===(r=i[e])||void 0===r?void 0:r.call(i);n.push((0,S.jsxs)(C.Z,{ml:2,children:[(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",l&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,S.jsx)(O.ZP,{default:!0,inline:!0,small:!0,children:l})]})]},t))}})),n}),[te,le,Te]),nn=(0,jn.Z)(te),tn=(0,jn.Z)(Ze);(0,f.useEffect)((function(){if((!nn&&te&&null!=Ze&&Ze.length||(null==tn||!tn.length)&&(null==Ze?void 0:Ze.length)>=1&&te)&&!ce&&(0,Tn.Qr)(le)&&Me){var e=Kr(Kr({},s),{},{upstream_blocks:Ze});Me.configuration&&Ge(Me.configuration(e)),Me.content&&We(Me.content(e))}}),[s,te,nn,le,ce,Me,Ge,We,Ze,tn]);var rn=(0,f.useMemo)((function(){return Object.entries(Te||{}).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0],r=t[1];return Kr(Kr({},e),{},(0,o.Z)({},i,r.map((function(e){var n,t=e.autoRun,i=e.label,r=e.monospace,l=e.options,u=e.settings,c=void 0===u?{}:u,a=e.type,d=e.uuid,p={fullWidth:!0,key:d,label:(0,G.kC)(i()),monospace:r,onBlur:function(){return F(s)},onChange:function(e){return Ge((0,o.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return F(s)},value:(null==le?void 0:le[d])||""},f=(null!=X&&X.block?[X.block]:[]).reduce((function(e,n){var t=n.outputs;return t?e.concat(t.reduce((function(e,n){var t,i=n.sample_data;return null!=i&&i.columns?e.concat(null==i||null===(t=i.columns)||void 0===t?void 0:t.filter((function(n){return!e.includes(n)}))):e}),[])):e}),[]);if(Hr.VR.COLUMNS===a){var h=le[d]||[];n=(0,S.jsxs)(S.Fragment,{children:[(!c.maxValues||h.length<c.maxValues)&&(0,S.jsx)(sn.Z,Kr(Kr({},p),{},{onChange:function(e){var n=le[d]||[],i=e.target.value;n.includes(i)?n=(0,L.Od)(n,(function(e){return e===i})):n.push(i),Ge((0,o.Z)({},d,n),{autoRun:t})},value:null,children:(0,L.YC)(f.filter((function(e){return!h.includes(e)})),(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})),h.map((function(e){return(0,S.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,S.jsx)(Bn.Z,{label:e,onClick:function(){Ge((0,o.Z)({},d,(0,L.Od)(h,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(Hr.VR.METRICS===a){var v=le[d]||[];n=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.ZP,{bold:!0,children:"Metrics"}),(0,S.jsx)(O.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,S.jsxs)(Fr.Z,{onChange:function(e,n){var i=n.resetValues,r=n.setValues;2===e.filter((function(e){return!!e})).length&&(v.find((function(n){var t=n.aggregation;return n.column===e[1]&&t===e[0]}))||(Ge((0,o.Z)({},d,v.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),r([null,null]),i()))},children:[(0,S.jsx)(sn.Z,Kr(Kr({},p),{},{label:"aggregation",children:(0,L.YC)(nr.bn,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})),(0,S.jsx)(sn.Z,Kr(Kr({},p),{},{label:"column",children:(0,L.YC)(f,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}))]}),v.map((function(e){var n=e.aggregation,i=e.column;return(0,S.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,S.jsx)(Bn.Z,{label:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){Ge((0,o.Z)({},d,(0,L.Od)(v,(function(e){var t=e.aggregation,r=e.column;return n===t&&i===r}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=l?(0,S.jsx)(sn.Z,Kr(Kr({},p),{},{children:l.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})):(0,S.jsx)(Ie.Z,Kr(Kr({},p),{},{type:a}));return(0,S.jsx)(C.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[s,le,Te,X,F,Ge]),ln=rn.code,un=rn.noCode,cn=(0,h.Db)(Y.ZP.widgets.pipelines.useUpdate(encodeURIComponent(null==E?void 0:E.uuid),encodeURIComponent(s.uuid)),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){ve(!1),g(),null==x||x()},onErrorCallback:function(e,n){return null==R?void 0:R({errors:n,response:e})}})}}),an=(0,l.Z)(cn,1)[0],dn="ChartBlock/".concat(s.uuid),pn=(0,Xe.y)(),fn=pn.registerOnKeyDown,hn=pn.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){hn(dn)}}),[hn,dn]),fn(dn,(function(e,n,t){he&&String(t[0])===String(ze.Uq)&&String(t[1])!==String(ze.zX)&&an({widget:Kr(Kr({},s),{},{name:Se})})}),[s,he,Se,an]),(0,S.jsx)(Mr.Z,{md:12*Ve,sm:12,children:(0,S.jsxs)(Wr.pM,{ref:n,children:[(0,S.jsx)(C.Z,{mt:1,pt:1,px:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{flex:1,style:{position:"relative"},children:[(0,S.jsx)(Lr,{bold:!1,fullWidth:!0,inputValue:Se,inputWidth:(null==n||null===(r=n.current)||void 0===r||null===(u=r.getBoundingClientRect())||void 0===u?void 0:u.width)<265?7*w.iI:null,notRequired:!0,onBlur:function(){return setTimeout((function(){return ve(!1)}),300)},onChange:function(e){Ee(e.target.value),e.preventDefault()},onClick:function(){A(!0),ve(!0)},onFocus:function(){A(!0),ve(!0)},small:!0,stacked:!0,value:!he&&s.uuid}),he&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(P.Z,{noWrapping:!0,onClick:function(){return an({widget:Kr(Kr({},s),{},{name:Se})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(sn.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=Kr(Kr({},s),{},{upstream_blocks:n});K(t),He(t),Pe(n)},placeholder:"Source block",small:!0,value:(null==Ze?void 0:Ze[0])||"",children:null==Be?void 0:Be.map((function(e){var n=e.uuid;return(0,S.jsx)("option",{value:n,children:n},n)}))}),(0,S.jsx)(C.Z,{mr:1}),!Ae&&(0,S.jsx)(An.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,S.jsx)(on.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return He(s)},uuid:"ChartBlock/run/".concat(s.uuid),children:(0,S.jsx)(N.PlayButtonFilled,{size:2*w.iI})})}),ii.uF.QUEUED===m&&(0,S.jsx)(je.Z,{color:(V||U.Z).content.active,small:!0,type:"cylon"}),ii.uF.BUSY===m&&(0,S.jsx)(je.Z,{color:(V||U.Z).content.active,small:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(An.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,S.jsx)(on.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return pe((function(e){return!e}))},selected:de,uuid:"ChartBlock/edit/".concat(s.uuid),children:(0,S.jsx)(N.Edit,{size:2*w.iI})})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(An.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,S.jsx)(on.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return v(s)},uuid:"ChartBlock/delete/".concat(s.uuid),children:(0,S.jsx)(N.Trash,{size:2*w.iI})})})]})]})}),(0,S.jsx)(C.Z,{mt:1}),(0,S.jsxs)(y.ZP,{fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsx)(Z.Z,{flex:6,ref:q,children:Ue&&!(0,Tn.Qr)(Ue)&&(0,S.jsx)(C.Z,{pb:3,children:(0,S.jsx)(Er.Z,{block:Kr(Kr({},s),{},{configuration:Kr(Kr({},s.configuration),le)}),data:Ue,width:ge})})}),de&&(0,S.jsx)(Wr.Tb,{children:(0,S.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsx)(sn.Z,{onChange:function(e){var n=e.target.value,t=Kr(Kr({},s),{},{configuration:Kr(Kr({},le),{},{chart_type:n})});K(t),He(t),ie(n)},placeholder:"Select chart type",value:te,children:nr.CK.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,G.kC)(e)},e)}))})}),(0,S.jsx)(C.Z,{mb:1,children:(0,S.jsx)(sn.Z,{onChange:function(e){return Ge((0,o.Z)({},nr.v8,e.target.value))},placeholder:"Chart width",value:(null==le?void 0:le[nr.v8])||1,children:[["1/2 width",.5],["full width",1]].map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return(0,S.jsx)("option",{value:i,children:t},t)}))})}),un]})})]}),de&&!(null==ln||!ln.length)&&b.t6.SQL!==s.language&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{my:1,px:1,children:[(0,S.jsx)(O.ZP,{bold:!0,children:"Custom chart code"}),(0,S.jsxs)(O.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,S.jsx)("br",{}),"This code is only executed if you don’t have any columns or metrics selected."]})]}),(0,S.jsxs)(Wr.T7,{children:[Ze.length>=1&&(0,S.jsxs)(Wr.y9,{children:[(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",$e]}),(0,S.jsxs)(O.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",en]})]}),Ke]})]}),qe&&(0,S.jsx)(C.Z,{px:1,children:qe})]})})}var qr=f.forwardRef(zr),Vr=t(82682),Yr=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function Xr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Qr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Xr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Jr=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,r=e.deleteWidget,l=e.messages,u=e.onChangeChartBlock,c=e.runBlock,s=e.runningBlocks,a=e.savePipelineContent,d=e.selectedBlock,p=e.setAnyInputFocused,h=e.setErrors,v=e.setSelectedBlock,m=e.setTextareaFocused,g=e.textareaFocused,b=e.updateWidget,x=e.widgets,j=e.width,k=(0,Sn.Z)(e,Yr),Z=(0,f.useMemo)((function(){return s.reduce((function(e,n,t){return Qr(Qr({},e),{},(0,o.Z)({},n.uuid,Qr(Qr({},n),{},{priority:t})))}),{})}),[s]);return(0,S.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(Vr.Z,{fullHeight:!0,style:{marginLeft:.5*w.iI,marginRight:.5*w.iI},children:null==x?void 0:x.map((function(e){var o=e.uuid,x=Z[o],y=x?0===x.priority?ii.uF.BUSY:ii.uF.QUEUED:ii.uF.IDLE;return i.current[o]=(0,f.createRef)(),(0,f.createElement)(qr,Qr(Qr({},k),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:r,executionState:y,key:o,messages:l[o],onChangeContent:function(e){return u(o,e)},ref:i.current[o],runBlock:c,runningBlocks:s,savePipelineContent:a,selected:(null==d?void 0:d.uuid)===o,setAnyInputFocused:p,setErrors:h,setSelectedBlock:v,setTextareaFocused:m,textareaFocused:g,updateWidget:b,width:j}))}))}),(0,S.jsx)("div",{style:{height:"80vh"}})]})},$r=p.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),el=function(e){var n=e.size,t=void 0===n?20:n,i=e.viewBox,r=void 0===i?"0 0 358 305":i;return(0,S.jsxs)($r,{height:t*(305/358),viewBox:r,width:t,children:[(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M290 47H66c-3.866 0-7 3.134-7 7v200c0 3.866 3.134 7 7 7h224c3.866 0 7-3.134 7-7V54c0-3.866-3.134-7-7-7zM66 46c-4.4183 0-8 3.5817-8 8v200c0 4.418 3.5817 8 8 8h224c4.418 0 8-3.582 8-8V54c0-4.4183-3.582-8-8-8H66z",fill:"#000"}),(0,S.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,S.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,S.jsx)("rect",{x:"209.651",y:"17.1125",width:"1.0163",height:"14.2284",rx:".5082",transform:"rotate(24.933 209.651 17.1125)",fill:"#2AB2FE"}),(0,S.jsx)("path",{fill:"#2AB2FE",d:"M207.788 23.5313l35.4813 16.4949-.4285.9215-35.4812-16.4948zM247.033 31.9316c.946-2.0359 3.364-2.9191 5.4-1.9726l31.795 14.7811-11.383 24.4836-31.794-14.7811c-2.036-.9465-2.92-3.3642-1.973-5.4002l7.955-17.1108z"}),(0,S.jsx)("path",{d:"M284.228 44.7401l31.795 14.7811c2.036.9465 2.919 3.3642 1.972 5.4001l-7.954 17.1109c-.947 2.0359-3.365 2.9191-5.401 1.9726l-31.795-14.7811 11.383-24.4836z",fill:"#0093E4"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M352.959 83.7347a.5082.5082 0 00-.675.2466l-2.571 5.5296-35.481-16.4949-.428.9216 35.481 16.4949-2.571 5.5295a.5081.5081 0 00.247.675.5082.5082 0 00.675-.2466l5.57-11.9806a.5083.5083 0 00-.247-.6751z",fill:"#2AB2FE"}),(0,S.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("path",{d:"M337.354 256.065a38.3848 38.3848 0 01-10.816 21.271 38.3722 38.3722 0 01-21.293 10.768 38.3787 38.3787 0 01-23.542-3.895 38.3764 38.3764 0 01-16.691-17.054l17.208-8.494a19.1932 19.1932 0 0020.117 10.475 19.189 19.189 0 0010.647-5.385c2.886-2.88 4.78-6.605 5.407-10.635l18.963 2.949z",fill:"#FF3C3C"}),(0,S.jsx)("path",{d:"M294.876 288.277a38.3849 38.3849 0 01-21.64-10.056 38.3818 38.3818 0 01-11.516-20.899 38.3896 38.3896 0 013.06-23.666 38.386 38.386 0 0116.453-17.283l9.098 16.897a19.1904 19.1904 0 00-9.757 20.474 19.1937 19.1937 0 005.758 10.45 19.194 19.194 0 0010.82 5.028l-2.276 19.055z",fill:"#2ECDF7"}),(0,S.jsx)("path",{d:"M275.892 219.85a38.3804 38.3804 0 0145.342-1.268 38.3803 38.3803 0 0114.45 18.989 38.3873 38.3873 0 01.436 23.858l-18.346-5.631a19.1827 19.1827 0 00-.218-11.929 19.1907 19.1907 0 00-7.225-9.495 19.1875 19.1875 0 00-11.439-3.39 19.192 19.192 0 00-11.232 4.024l-11.768-15.158z",fill:"#885EFF"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M259.206 102.57c.241.135.327.439.193.68l-39.314 70.576c-.613 1.1-1.962 1.565-3.124 1.093-3.766-1.53-13.762-5.285-26.356-7.597-12.6-2.314-27.762-3.177-41.881 1.037-16.112 4.81-27.78 14.07-35.424 22.135-3.822 4.032-6.635 7.763-8.491 10.483-.928 1.36-1.616 2.467-2.072 3.232-.228.383-.397.68-.509.881-.057.1-.098.177-.126.227l-.03.057-.008.014-.001.003a.5008.5008 0 01-.676.21.5005.5005 0 01-.209-.676l.442.233-.442-.233.001-.001.002-.005.009-.016.033-.062c.03-.055.073-.135.132-.239.116-.208.29-.513.523-.904.465-.782 1.165-1.906 2.105-3.285 1.881-2.756 4.727-6.53 8.591-10.607 7.727-8.153 19.539-17.532 35.864-22.405 14.331-4.278 29.668-3.391 42.347-1.063 12.685 2.329 22.748 6.109 26.552 7.654.699.284 1.51.002 1.875-.653l39.313-70.575a.5008.5008 0 01.681-.194z",fill:"#7D55EC"}),(0,S.jsx)("path",{d:"M221.651 176.111c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM157.778 166.428c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM106.428 204.191c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.8726-1.734-3.8726-3.873 0-2.139 1.7336-3.873 3.8726-3.873s3.873 1.734 3.873 3.873zM262.35 104.459c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873z",fill:"#7D55EC"}),(0,S.jsx)("path",{d:"M8.5523 214.855c-.3562-1.045.2025-2.181 1.248-2.538l13.7251-4.677c1.0456-.356 2.1819.203 2.5382 1.248l29.6737 87.084-17.5112 5.967-29.6738-87.084z",fill:"#4776FF"}),(0,S.jsx)("path",{d:"M45.0935 264.735c-.3562-1.045.2025-2.182 1.2481-2.538l13.725-4.677c1.0455-.356 2.1819.203 2.5382 1.248l10.6438 31.237-17.5112 5.967-10.6439-31.237z",fill:"#FFCC19"}),(0,S.jsx)("path",{d:"M54.4607 234.868c-.3563-1.046.2025-2.182 1.248-2.538l13.7251-4.677c1.0455-.356 2.1819.202 2.5382 1.248l18.7879 55.137-17.5113 5.967-18.7879-55.137z",fill:"#4776FF"})]})};var nl,tl=function(e){var n=e.blocksInNotebook;return e.extensionOption,(0,f.useMemo)((function(){return(null==n?void 0:n.filter((function(e){var n=e.type;return b.tf.DBT===n})))||[]}),[n]),(0,S.jsx)(S.Fragment,{})};function il(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function rl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?il(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):il(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.DBT="dbt",e.GREAT_EXPECTATIONS="great_expectations"}(nl||(nl={}));var ll=function(e){var n,t,i=e.block,r=e.blockActionDescription,l=e.blocks,o=e.inputPlaceholder,u=e.loading,c=e.onClickTag,s=e.runBlockAndTrack,a=e.supportedUpstreamBlockLanguages,d=e.supportedUpstreamBlockTypes,h=e.updateBlock,v=(0,f.useContext)(p.ThemeContext),m=(0,f.useState)(""),g=m[0],b=m[1],P=(0,f.useState)(!1),I=P[0],E=P[1],T=(0,f.useState)(null),M=T[0],B=T[1],D=(0,f.useMemo)((function(){return(0,L.HK)(l,(function(e){return e.uuid}))}),[l]);(0,f.useEffect)((function(){M||B((0,L.HK)((null==i?void 0:i.upstream_blocks)||[],(function(e){return e})))}),[i,M]);var A=(0,f.useMemo)((function(){return(null==l?void 0:l.filter((function(e){var n=e.name,t=e.type,i=e.uuid;return((null==n?void 0:n.toLowerCase().includes(null==g?void 0:g.toLowerCase()))||(null==i?void 0:i.toLowerCase().includes(null==g?void 0:g.toLowerCase())))&&(null==d?void 0:d.includes(t))})))||[]}),[g,l,d]),R=(0,f.useMemo)((function(){var e=[];return null==A||A.forEach((function(n,t){var i=n.color,r=n.language,l=n.type,o=n.uuid,u=(0,_.qn)(l,{blockColor:i,theme:v}).accent;t>=1&&e.push((0,S.jsx)(k.Z,{light:!0},"divider-".concat(o)));var c=!(null==M||!M[o]),s=null!=a&&!(null!=a&&a.includes(r));e.push((0,S.jsx)(C.Z,{px:2,py:1,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(j.Z,{color:u,size:1.5*w.iI,square:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{monospace:!0,muted:s,small:!0,children:o})]}),s&&(0,S.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[r," support coming soon"]}),!s&&(0,S.jsx)(x.Z,{checked:!s&&c,disabled:s,onClick:function(){B((function(e){var n=rl({},e);return c?delete n[o]:n[o]=o,n}))}})]})},"option-".concat(o)))})),e}),[A,v,M]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(xt.Z,{onClickOutside:function(){return E(!1)},open:!0,children:[(0,S.jsx)(Ie.Z,{beforeIcon:(0,S.jsx)(N.Search,{}),borderless:!0,compact:!0,onChange:function(e){return b(e.target.value)},onClick:function(e){(0,Ce.j)(e),E(!0)},onFocus:function(e){(0,Ce.j)(e),E(!0)},placeholder:o,small:!0,value:g}),I&&(0,S.jsxs)(S.Fragment,{children:[R,(0,S.jsx)(C.Z,{p:1,children:(0,S.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(ge.ZP,{compact:!0,loading:u,onClick:function(){return h({block:i,upstream_blocks:Object.keys(M)}).then((function(){return E(!1)}))},small:!0,children:"Save selected blocks"})})})]})]}),!I&&(null==i||null===(n=i.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(0,S.jsxs)(C.Z,{pb:1,pr:1,children:[r&&(0,S.jsx)(C.Z,{mt:1,pl:1,children:(0,S.jsx)(O.ZP,{muted:!0,small:!0,children:r})}),(0,S.jsx)(y.ZP,{alignItems:"center",children:null==i||null===(t=i.upstream_blocks)||void 0===t?void 0:t.map((function(e){var n=null==D?void 0:D[e];if(!n)return(0,S.jsx)("div",{},e);var t=n.color,r=n.type,l=(0,_.qn)(r,{blockColor:t,theme:v}).accentLight;return(0,S.jsx)(C.Z,{ml:1,mt:1,children:(0,S.jsx)(ge.ZP,{backgroundColor:l,compact:!0,disabled:!s,onClick:function(e){(0,Ce.j)(e),c?c(n):null==s||s({block:rl(rl({},i),{},{upstream_blocks:[null==n?void 0:n.uuid]})})},small:!0,children:(0,S.jsx)(O.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},ol=t(75634);function ul(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function cl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ul(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ul(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var sl=function(e){var n=e.addNewBlockAtIndex,t=e.autocompleteItems,i=e.blockRefs,r=e.blocks,u=e.blocksInNotebook,c=e.deleteBlock,s=e.extensionOption,a=e.fetchFileTree,d=e.fetchPipeline,p=e.interruptKernel,v=e.messages,m=e.onChangeCallbackBlock,g=e.onChangeCodeBlock,x=e.pipeline,j=e.runBlock,k=e.runningBlocks,Z=e.savePipelineContent,y=e.selectedBlock,_=e.setAnyInputFocused,I=e.setErrors,E=e.setSelectedBlock,T=e.setTextareaFocused,M=e.showBrowseTemplates,B=e.textareaFocused,D=(0,f.useRef)(null),A=(0,f.useState)(!1),R=A[0],F=A[1],U=(s||{}).uuid,H=(x||{}).extensions,W=(0,f.useMemo)((function(){return(null==s?void 0:s.templates)||[]}),[s]),G=(0,f.useMemo)((function(){return null==H?void 0:H[U]}),[U,H]),K=(0,f.useMemo)((function(){return(null==G?void 0:G.blocks)||[]}),[G]),z=(0,f.useMemo)((function(){return(0,L.HK)(K,(function(e){return e.uuid}))}),[K]),q=(0,f.useMemo)((function(){return U===(null==y?void 0:y.extension_uuid)&&z[null==y?void 0:y.uuid]}),[z,U,y]),V=(0,f.useMemo)((function(){return k.reduce((function(e,n,t){return cl(cl({},e),{},(0,o.Z)({},n.uuid,cl(cl({},n),{},{priority:t})))}),{})}),[k]),X=(0,h.Db)((function(e){var n=e.block,t=e.upstream_blocks;return Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null==x?void 0:x.uuid),encodeURIComponent(null==n?void 0:n.uuid),{query:{extension_uuid:null==n?void 0:n.extension_uuid}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){d()},onErrorCallback:function(e,n){return null==I?void 0:I({errors:n,response:e})}})}}),Q=(0,l.Z)(X,2),J=Q[0],$=Q[1].isLoading,ee=(0,f.useMemo)((function(){return K.map((function(e,n){var l=cl(cl({},e),{},{extension_uuid:U}),o=l.type,s=l.uuid,h=(null==y?void 0:y.uuid)===s,P=V[s],O=P?0===P.priority?ii.uF.BUSY:ii.uF.QUEUED:ii.uF.IDLE,M="".concat(o,"s/").concat(s,".py");return i.current[M]=(0,f.createRef)(),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(ln.Z,{allBlocks:r,autocompleteItems:t,block:l,blockIdx:n,blockRefs:i,blocks:r,defaultValue:l.content,deleteBlock:function(e){c(cl(cl({},e),{},{extension_uuid:U})),_(!1)},executionState:O,extraContent:(0,S.jsx)(ll,{block:l,blockActionDescription:"Click a block name to run expectations on it.",blocks:u,inputPlaceholder:"Select blocks to run expectations on",loading:$,supportedUpstreamBlockLanguages:[b.t6.PYTHON],supportedUpstreamBlockTypes:[b.tf.DATA_EXPORTER,b.tf.DATA_LOADER,b.tf.DBT,b.tf.TRANSFORMER],updateBlock:J}),fetchFileTree:a,fetchPipeline:d,hideRunButton:!0,interruptKernel:p,messages:v[s],noDivider:!0,onCallbackChange:function(e){return m(o,s,e)},onChange:function(e){return g(o,s,e)},pipeline:x,ref:i.current[M],runBlock:j,runningBlocks:k,savePipelineContent:Z,selected:h,setAnyInputFocused:_,setErrors:I,setSelected:function(e){return E(!0===e?l:null)},setTextareaFocused:T,textareaFocused:h&&B})},s)}))}),[t,i,r,u,c,K,U,a,d,p,$,v,m,g,x,j,k,V,Z,y,_,I,E,T,B,J]),ne="Extensions/GreatExpectations/index",te=(0,Xe.y)(),ie=te.disableGlobalKeyboardShortcuts,re=te.registerOnKeyDown,le=te.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){le(ne)}}),[le,ne]),re(ne,(function(e,n){!ie&&q&&((0,Ye.y)([ze.zX,ze.Um],n)||(0,Ye.y)([ze.PQ,ze.Um],n))&&(e.preventDefault(),Z())}),[q,Z]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsx)(O.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["When a block in your pipeline runs, it’ll run any tests you define in its code. All associated extension blocks will also run during that phase. Learn more about the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["For all available expectations, read Great Expectation’s ",(0,S.jsx)(P.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),ee,(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(xt.Z,{onClickOutside:function(){return F(!1)},open:!0,children:(0,S.jsx)(Ai.Z,{disableKeyboardShortcuts:!0,items:null==W?void 0:W.map((function(e){var t=e.description,i=e.name,r=e.path;return{label:function(){return i},onClick:function(){return n({config:{template_path:r},extension_uuid:U,type:b.tf.EXTENSION},(null==K?void 0:K.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,ir.hr)((function(e){return n(cl(cl({},e),{},{extension_uuid:U,type:b.tf.EXTENSION}),(null==K?void 0:K.length)||0)}),b.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:M})),onClickCallback:function(){return F(!1)},open:R,parentRef:D,uuid:"Extension",children:(0,S.jsx)(on.ZP,{beforeElement:(0,S.jsx)(ol.Wx,{teal:!0,children:(0,S.jsx)(N.Add,{size:ol.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),F(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},al=t(15610),dl=t(69419),pl=["pipeline"];function fl(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function hl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fl(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var vl=function(e){var n=e.pipeline,t=(0,Sn.Z)(e,pl),i=(0,v.useRouter)(),r=Y.ZP.extension_options.list().data,l=(0,f.useMemo)((function(){return(null==r?void 0:r.extension_options)||[]}),[r]),o=(0,f.useMemo)((function(){return(0,L.HK)(l,(function(e){return e.uuid}))}),[l]),u=(0,f.useState)(null),c=u[0],s=u[1],a=(0,f.useMemo)((function(){return o[c]}),[o,c]),d=(0,f.useMemo)((function(){return hl(hl({},t),{},{pipeline:n})}),[n,t]);(0,f.useEffect)((function(){var e;s(null===(e=(0,dl.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var p=(0,f.useMemo)((function(){return n?(nl.GREAT_EXPECTATIONS===c?e=sl:nl.DBT===c&&(e=tl),e?(0,S.jsx)(e,hl(hl({},d),{},{extensionOption:a})):void 0):null;var e}),[a,n,c,d]);return(0,S.jsx)(nn.W,{backend:tn.PD,children:(0,S.jsxs)(C.Z,{p:w.cd,children:[!c&&(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsxs)(O.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,children:null==n?void 0:n.uuid})," pipeline."]})})]}),!r&&!c&&(0,S.jsx)(je.Z,{}),p,!c&&(null==l?void 0:l.map((function(e,n){var t=e.description,r=e.name,l=e.uuid;return(0,S.jsx)(C.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,al.u)({extension:l},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(At.Z,{dark:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(Wn.Z,{fullWidth:!1,children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)("img",{alt:r,height:3*w.iI,src:"".concat(null==i?void 0:i.basePath,"/images/extensions/").concat(l,"/logo.png"),width:3*w.iI})})})}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(Z.Z,{flexDirection:"column",children:[(0,S.jsx)(O.ZP,{bold:!0,children:r}),(0,S.jsx)(O.ZP,{default:!0,small:!0,children:t})]})]}),(0,S.jsx)(N.ChevronRight,{})]})})})},l)})))]})})},ml=t(28385),gl=t(9134),bl=t(83784),xl=t(36300),jl=t(31748),kl=t(30229),Zl=t(8916);var yl=function(e){e.blocks;var n=e.fetchVariables,t=e.pipeline,i=e.selectedBlock,r=e.setErrorMessages,o=e.variables,u=e.width,c=(0,f.useState)(!1),s=c[0],a=c[1],d=(0,f.useState)(),p=d[0],v=d[1],m=(0,f.useState)(),g=m[0],x=m[1],j=null==t?void 0:t.uuid,k=(0,h.Db)(Y.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,ye.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;r((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),Z=(0,l.Z)(k,1)[0],_=(0,h.Db)((function(e){return Y.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),I=(0,l.Z)(_,1)[0],E=(0,f.useCallback)((function(e){if("Enter"===e.key){var t=g;try{t=JSON.parse(g)}catch(e){}Z({variable:{name:p,value:t}}).then((function(){n(),v(null),x(null)})),(0,rr.ez)(),a(!1)}else"Escape"===e.key&&((0,rr.ez)(),a(!1))}),[Z,n,p,g]),T=(0,f.useMemo)((function(){return u-4*w.iI}),[u]),M=(0,f.useMemo)((function(){return(0,Zl.wx)(o,(function(e){return e.uuid===bl.C}))}),[o]),B=(0,f.useMemo)((function(){return(0,Zl.wx)(o,(function(e){return e.uuid===(null==i?void 0:i.uuid)}))}),[i,o]),D=(0,f.useMemo)((function(){return(0,S.jsxs)(xl.kA,{width:T,children:[s&&(0,S.jsxs)(Vr.Z,{children:[(0,S.jsx)(Mr.Z,{md:1,children:(0,S.jsx)(xl.qZ,{noPadding:!0,children:(0,S.jsx)(on.ZP,{backgroundColor:jl.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(p),Bt.Am.success("Successfully copied to clipboard.",{position:Bt.Am.POSITION.BOTTOM_RIGHT,toastId:p})},uuid:"Sidekick/GlobalVariables/".concat(p),withIcon:!0,children:(0,S.jsx)(N.Copy,{size:2.5*w.iI})})})}),(0,S.jsx)(Mr.Z,{md:4,children:(0,S.jsx)(xl.qZ,{children:(0,S.jsx)(Ie.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){v(e.target.value),e.preventDefault()},onKeyDown:E,paddingHorizontal:0,placeholder:"variable",small:!0,value:p})})}),(0,S.jsx)(Mr.Z,{md:7,children:(0,S.jsx)(xl.qZ,{children:(0,S.jsx)(Ie.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:E,paddingHorizontal:0,placeholder:"enter value",small:!0,value:g})})})]}),null==M?void 0:M.map((function(e){return(0,S.jsx)(jr.Z,{deleteVariable:function(){return I(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[I,M,p,g,j,v,x,a,s,T]),R=(0,f.useMemo)((function(){return(0,S.jsx)(xl.kA,{width:T,children:null==B?void 0:B.map((function(e){return(0,S.jsx)(jr.Z,{copyText:(n=e.uuid,"from mage_ai.data_preparation.variable_manager import (\n get_variable,\n)\n\n".concat(function(e,n,t){return"\n".concat(t," = get_variable('").concat(e,"', '").concat(n,"', '").concat(t,"')\n")}(j,null==i?void 0:i.uuid,n))),hideEdit:!0,pipelineUUID:j,variable:e},e.uuid);var n}))})}),[B,i,T]);return(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,S.jsx)(C.Z,{ml:2}),(0,S.jsx)(on.ZP,{Icon:N.Add,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(O.ZP,{muted:!0,children:["Press ",(0,S.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,S.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:D}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{children:"Global variables will be passed into all non-scratchpad blocks as keyword arguments (Python), interpolated variables (SQL), or vector elements (R). To load a global variable, use the following syntax:"})}),(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsxs)(O.ZP,{bold:!0,large:!0,children:["For Python (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(gl.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsxs)(O.ZP,{bold:!0,large:!0,children:["For SQL (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(gl.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsxs)(O.ZP,{bold:!0,large:!0,children:["For R (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(gl.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsx)(A.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,S.jsx)(C.Z,{mb:w.cd}),(0,S.jsx)(O.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(kl.Xm).map((function(e,n){var t;return(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{large:!0,monospace:!0,children:(0,G.vg)(null===(t=kl.Z4[e])||void 0===t?void 0:t.call(kl.Z4))})}),(0,Zl.JZ)([],e).map((function(n,t){return(0,S.jsx)(jr.Z,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),B&&B.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{my:2,children:(0,S.jsx)(A.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,S.jsx)(C.Z,{mb:2,children:R}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(O.ZP,{children:["Output variables can be used in any ",(0,S.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,warning:!0,children:b.tf.SCRATCHPAD})," block. They are for scratchpad blocks, specifically. To get upstream block outputs inside of other blocks, use the positional arguments."]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(gl.Z,{language:"python",small:!0,source:"\n from mage_ai.data_preparation.variable_manager import (\n get_variable,\n )\n\n\n df = get_variable(\n 'pipeline_uuid',\n 'block_uuid',\n 'variable_name',\n )\n"})})]})]})},Pl=t(89565),Cl=t.n(Pl),Ol=t(88494),wl=p.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,Me.y$)()),_l=p.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],Me.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return!e.height&&"\n max-height: ".concat(e.maxHeight||300,"px;\n ")})),Sl=t(60071),Il=t.n(Sl);function El(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Tl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?El(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):El(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ml=function(e){var n=e.cancelPipeline,t=e.checkIfPipelineRunning,i=e.executePipeline,r=e.isPipelineExecuting,l=e.pipelineExecutionHidden,o=e.pipelineMessages,u=e.setPipelineExecutionHidden,c=(0,f.useMemo)((function(){return(null==o?void 0:o.length)||0}),[o]),s=(0,f.useMemo)((function(){return c>100?o.slice(-100):o}),[c,o]),a=(0,f.useCallback)((function(){(0,rr.ez)(),i()}),[i]),d=(0,f.useCallback)((function(){(0,rr.ez)(),n()}),[n]),p=(0,f.useCallback)((function(){var e=!l;u(e),(0,Ve.t8)(Ve.Q9,e)}),[l,u]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(wl,{children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{children:[(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.PlayButton,{inverted:!0,size:2*w.iI}),compact:r,disabled:r,loading:r,onClick:a,success:!0,children:(0,S.jsx)(O.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,S.jsx)(C.Z,{ml:1}),r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Close,{inverted:!0,size:2*w.iI}),onClick:d,success:!0,children:(0,S.jsx)(O.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,S.jsx)(C.Z,{ml:1})]}),(0,S.jsx)(ge.ZP,{onClick:t,secondary:!0,children:(0,S.jsx)(O.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(C.Z,{ml:1}),(0,S.jsx)(O.ZP,{children:"Hide"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(Dn.Z,{checked:l,onCheck:p})]})]})}),!l&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mb:1}),(0,S.jsx)(_l,{noScrollbarTrackBackground:!0,children:(0,S.jsx)(Ol.Nk,{executedAndIdle:!0,hasError:!1,selected:!0,children:s.map((function(e,n){var t=e.data,i=e.type,r=[],l=(r=(r=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return r.map((function(e,t){var r,o={first:0===n&&0===t,last:n===c-1&&t===l-1};return ii.jU.includes(i)?r=(0,S.jsx)(Ol.T5,Tl(Tl({},o),{},{children:(0,S.jsx)(O.ZP,{monospace:!0,preWrap:!0,children:(0,S.jsx)(Cl(),{children:e})})})):i===ii.Gi.IMAGE_PNG&&(r=(0,S.jsx)("div",{style:{backgroundColor:"white"},children:(0,S.jsx)(Il(),{alt:"Image ".concat(n," from code output"),layout:"responsive",src:"data:image/png;base64, ".concat(e)})})),(0,S.jsx)("div",{children:r},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})},Bl=t(81769),Dl=(w.iI,p.default.div.withConfig({displayName:"indexstyle__AfterFooterStyle",componentId:"sc-1qjqori-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1qjqori-1"})([""," border-style:solid;border-width:1px;position:relative;"," "," "," "," "," "," ",""],_.Kf,(function(e){return!e.noBorderRadiusTop&&"\n border-top-left-radius: ".concat(Te.n_,"px;\n border-top-right-radius: ").concat(Te.n_,"px;\n ")}),(function(e){return e.noBorderRadiusTop&&"\n border-top: none !important;\n "}),(function(e){return!e.noBorderRadiusBottom&&"\n border-bottom-left-radius: ".concat(Te.n_,"px;\n border-bottom-right-radius: ").concat(Te.n_,"px;\n ")}),(function(e){return e.noBorderRadiusBottom&&"\n border-bottom: none !important;\n "}),(function(e){return!e.noBackground&&"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")}),(function(e){return!e.borderColor&&"\n border-color: ".concat((e.theme.borders||U.Z.borders).light,";\n ")}),(function(e){return e.borderColor&&"\n border-color: ".concat(e.borderColor,";\n ")}))),Al=(p.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-1qjqori-2"})(["padding:","px;",""],w.cd*w.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-1qjqori-3"})([""," "," ",""],(0,Be.eR)(),(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||U.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||U.Z.background).codeTextarea,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__StreamGridGroupStyle",componentId:"sc-1qjqori-4"})(["position:absolute;"]),p.default.div.withConfig({displayName:"indexstyle__StreamGridGroupInnerStyle",componentId:"sc-1qjqori-5"})([""," overflow:auto;position:fixed;",""],Me.w5,(function(e){return e.borderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__StreamGridStyle",componentId:"sc-1qjqori-6"})(["border-radius:","px;padding:","px;margin:","px;"," "," "," "," ",""],Te.n_,w.cd*w.iI,1*w.iI,(function(e){return!e.warning&&"\n &:hover {\n cursor: pointer;\n }\n "}),(function(e){return!e.selected&&!e.warning&&"\n border: 1px solid ".concat((e.theme.borders||U.Z.borders).light,";\n ")}),(function(e){return e.warning&&!e.selected&&"\n border: 1px solid ".concat((e.theme.accent||U.Z.accent).warningTransparent,";\n ")}),(function(e){return e.warning&&e.selected&&"\n border: 1px solid ".concat((e.theme.accent||U.Z.accent).warning,";\n ")}),(function(e){return e.selected&&!e.warning&&"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||U.Z.borders).contrast,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__BackgroundStyle",componentId:"sc-1qjqori-7"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__ButtonContainerStyle",componentId:"sc-1qjqori-8"})(["bottom:0;position:fixed;z-index:1;"," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||U.Z.background).panel,";\n border-left: 1px solid ").concat((e.theme.borders||U.Z.borders).light,";\n border-right: 1px solid ").concat((e.theme.borders||U.Z.borders).light,";\n border-top: 1px solid ").concat((e.theme.borders||U.Z.borders).light,";\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),Rl=t(19452);function Nl(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ll(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Nl(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Nl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Fl=function(e){var n,t,i,r,o=e.index,u=e.permission,c=e.setPermissions,s=e.updatePermission;return(0,S.jsx)(Dl,{children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"flex-start",flexDirection:"row",children:[(0,S.jsx)(ge.ZP,{iconOnly:!0,onClick:function(){return c((function(e){return(0,L.oM)(e,o)}))},children:(0,S.jsx)(N.Close,{})}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsxs)(y.ZP,{alignItems:"center",flexDirection:"row",children:[(0,S.jsx)(A.Z,{level:5,children:"Triggers"}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:!0,onClick:function(e){(0,Ce.j)(e),s(Ll(Ll({},u),{},{triggers:((null==u?void 0:u.triggers)||[]).concat({schedule_interval:"",schedule_type:"",uuid:""})}))},secondary:!0,small:!0,children:"Add trigger"})})]}),(null==u||null===(n=u.triggers)||void 0===n?void 0:n.length)>=1&&(0,S.jsx)(C.Z,{mt:w.cd,children:null==u||null===(t=u.triggers)||void 0===t?void 0:t.map((function(e,n){var t=e.schedule_interval,i=e.schedule_type,r=e.uuid;return(0,S.jsx)(C.Z,{mt:n>=1?1:0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ge.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(e){(0,Ce.j)(e);var t=(0,L.oM)((null==u?void 0:u.triggers)||[],n);s(Ll(Ll({},u),{},{triggers:t}))},children:(0,S.jsx)(N.Close,{})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(sn.Z,{compact:!0,onChange:function(e){var t,i=e.target.value,r=Ll({},u),l=Ll({},null==r||null===(t=r.triggers)||void 0===t?void 0:t[n]);l.schedule_type=i,r.triggers[n]=l,s(r)},placeholder:"Type",small:!0,value:i,children:Object.entries(kl.Z4).map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return(0,S.jsx)("option",{value:t,children:(0,G.kC)(i())},t)}))}),(kl.Xm.TIME===i||!i)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(sn.Z,{compact:!0,monospace:!0,onChange:function(e){var t,i=e.target.value,r=Ll({},u),l=Ll({},null==r||null===(t=r.triggers)||void 0===t?void 0:t[n]);l.schedule_interval=i,r.triggers[n]=l,s(r)},placeholder:"Interval",small:!0,value:t,children:kl.Wb.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})]})]})},"permission-trigger-".concat(o,"-").concat(n,"-").concat(r))}))})]}),(0,S.jsx)(C.Z,{mr:w.Mq}),(0,S.jsxs)(y.ZP,{flexDirection:"column",children:[(0,S.jsxs)(y.ZP,{alignItems:"center",flexDirection:"row",children:[(0,S.jsx)(A.Z,{level:5,children:"Roles"}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:!0,onClick:function(e){(0,Ce.j)(e),s(Ll(Ll({},u),{},{roles:((null==u?void 0:u.roles)||[]).concat({role:"",uuid:""})}))},secondary:!0,small:!0,children:"Add role"})})]}),(null==u||null===(i=u.roles)||void 0===i?void 0:i.length)>=1&&(0,S.jsx)(C.Z,{mt:w.cd,children:null==u||null===(r=u.roles)||void 0===r?void 0:r.map((function(e,n){var t=e.role,i=e.uuid;return(0,S.jsx)(C.Z,{mt:n>=1?1:0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ge.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(e){(0,Ce.j)(e);var t=(0,L.oM)((null==u?void 0:u.roles)||[],n);s(Ll(Ll({},u),{},{roles:t}))},children:(0,S.jsx)(N.Close,{})}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(sn.Z,{compact:!0,monospace:!0,onChange:function(e){var t,i=e.target.value,r=Ll({},u),l=Ll({},null==r||null===(t=r.roles)||void 0===t?void 0:t[n]);l.role=i,r.roles[n]=l,s(r)},placeholder:"Role",small:!0,value:t,children:Rl.Z3.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})]})},"permission-role-".concat(o,"-").concat(n,"-").concat(i))}))})]})]})})})},Ul=t(35576),Hl=t(3917);function Wl(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Gl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Wl(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Wl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Kl=function(e){var n,t,i=e.blockInteractionsMapping,l=e.containerWidth,u=e.createInteraction,c=e.interactions,s=e.interactionsMapping,a=e.isLoadingCreateInteraction,d=e.isLoadingUpdatePipelineInteraction,p=e.permissions,h=e.pipeline,v=e.pipelineInteraction,m=e.refAfterFooter,g=e.savePipelineInteraction,x=e.selectedBlock,j=e.setBlockInteractionsMapping,P=e.setInteractionsMapping,_=e.setPermissions,I=e.setSelectedBlock,E=e.updatePipelineInteraction,T=(0,f.useRef)(null),M=(0,f.useRef)(null),B=(0,f.useRef)(null),D=(0,f.useState)(null),R=D[0],F=D[1],U=(0,f.useState)(null),H=U[0],W=U[1],G=(0,f.useState)(!1),K=G[0],z=G[1],q=(0,f.useState)(null),V=q[0],Y=q[1],X=(0,f.useState)(!1),Q=X[0],J=X[1],$=(0,f.useState)(null),ee=($[0],$[1]),ne=!i,te=(0,f.useState)(null),ie=te[0],re=te[1],le=(0,f.useState)(null),oe=le[0],ue=le[1],ce=(0,f.useMemo)((function(){return void 0!==i?i:oe}),[i,oe]),se=(0,f.useMemo)((function(){return void 0!==s?s:ie}),[s,ie]),ae=(0,f.useCallback)((function(e,n){return null!=n&&n.initialBootstrap||z(!0),void 0!==j?j(e):ue(e)}),[j,ue,z]),de=(0,f.useCallback)((function(e,n){return null!=n&&n.initialBootstrap||z(!0),void 0!==P?P(e):re(e)}),[P,re,z]),pe=(0,f.useState)(null),fe=pe[0],he=pe[1],be=(0,f.useCallback)((function(e,n,t,i){return ae((function(l){var u=(0,r.Z)((null==l?void 0:l[e])||[]);return null!=i&&i.remove?u=(0,L.oM)(u,n):u[n]=Gl(Gl({},u[n]),t),Gl(Gl({},l),{},(0,o.Z)({},e,u))}))}),[ae]),xe=(0,f.useCallback)((function(e,n){W(Number(new Date)),null!=n&&n.initialBootstrap||z(!0),void 0!==_?_(e):he(e)}),[W,_,he,z]),je=(0,f.useMemo)((function(){var e;return null===(e=void 0!==p?p:fe)||void 0===e?void 0:e.map((function(e,n){var t=e.roles,i=e.triggers;return{roles:null==t?void 0:t.map((function(e,t){return{role:"string"==typeof e?e:null==e?void 0:e.role,uuid:"".concat(n,"-").concat(H,"-").concat(t)}})),triggers:null==i?void 0:i.map((function(e,t){return Gl(Gl({},e),{},{uuid:"".concat(n,"-").concat(H,"-").concat(t)})})),uuid:"".concat(n,"-").concat(H)}}))}),[H,p,fe]),ke=(0,f.useCallback)((function(){F(Number(new Date)),z(!1)}),[F,z]),Ze=(0,f.useCallback)((function(){g?null==g||g().then((function(){return ke()})):null==E||E(Gl(Gl({},v),{},{blocks:ce,interactions:se,permissions:null==je?void 0:je.map((function(e){var n=e.roles,t=e.triggers;return{roles:null==n?void 0:n.map((function(e){return"string"==typeof e?e:null==e?void 0:e.role})),triggers:null==t?void 0:t.map((function(e){return{schedule_interval:e.schedule_interval,schedule_type:e.schedule_type}}))}}))})).then((function(){return ke()}))}),[ce,se,je,v,ke,g,E]),ye=(0,f.useMemo)((function(){return(null==h?void 0:h.blocks)||[]}),[h]),Pe=(0,f.useMemo)((function(){return null==ye?void 0:ye.reduce((function(e,n,t){return Gl(Gl({},e),{},(0,o.Z)({},String(t),!0))}),{})}),[ye]);(0,f.useEffect)((function(){void 0===s&&!se&&(null==c?void 0:c.length)>=1&&de((0,L.HK)(c||[],(function(e){return e.uuid})),{initialBootstrap:!0})}),[c,se,s,de]),(0,f.useEffect)((function(){void 0===i&&!ce&&null!=v&&v.blocks&&ae(null==v?void 0:v.blocks,{initialBootstrap:!0})}),[ce,i,v,ae]),(0,f.useEffect)((function(){!je&&null!=v&&v.permissions&&xe(null==v?void 0:v.permissions,{initialBootstrap:!0})}),[je,v,xe]);var Oe=(0,f.useMemo)((function(){var e=[],n=(null==ye?void 0:ye.length)||0;return null==ye||ye.map((function(t,i){var r=(t||{uuid:null}).uuid,o=(null==ce?void 0:ce[r])||[],u=(null==o?void 0:o.length)>=1,c=(0,S.jsxs)(ge.ZP,{beforeIcon:u?(0,S.jsx)(N.Edit,{}):(0,S.jsx)(N.Add,{}),compact:!0,disabled:ne,onClick:function(e){(0,Ce.j)(e),I(t)},primary:!u,secondary:u,small:!0,children:[u&&"Edit interactions",!u&&"Add interactions"]});e.push((0,S.jsx)(me.Z,{first:0==i,noBorderRadius:i>=1,noPaddingContent:!0,title:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(C.Z,{mr:w.cd,py:1,children:(0,S.jsx)(O.ZP,{large:!0,monospace:!0,children:r})}),u&&(0,S.jsx)(y.ZP,{alignItems:"center",children:c})]}),titleXPadding:w.cd*w.iI,titleYPadding:1.5*w.iI,children:(0,S.jsx)(Dl,{noBackground:!0,noBorderRadiusBottom:i<n-1,noBorderRadiusTop:!0,children:(0,S.jsxs)(C.Z,{p:w.cd,children:[!u&&c,null==o?void 0:o.map((function(e,n){return(0,S.jsx)(C.Z,{mt:n>=1?w.HN:0,children:(0,S.jsx)(Bl.Z,{blockInteraction:e,containerRef:T,containerWidth:l,interaction:null==se?void 0:se[null==e?void 0:e.uuid],setInteractionsMapping:de,showVariableUUID:!0})},"".concat(null==e?void 0:e.uuid,"-").concat(n))}))]})})},r))})),e}),[ce,ye,T,l,se,ne,de,I]),we=(0,f.useMemo)((function(){return(null==ye?void 0:ye.length)>=1&&(0,S.jsx)(ve.Z,{noBackground:!0,noBorder:!0,noBoxShadow:!0,visibleMapping:Pe,children:Oe})}),[ye,Oe,Pe]),_e=(0,f.useMemo)((function(){return(null==ce?void 0:ce[null==x?void 0:x.uuid])||[]}),[ce,x]),Se=(0,f.useMemo)((function(){var e=[],n={};return null==_e||_e.forEach((function(t){var i=t.uuid,r=null==se?void 0:se[i],l=null==r?void 0:r.variables;Object.keys(l||{}).forEach((function(t){null!=n&&n[t]||(e.push(t),n[t]=!0)}))})),e}),[se,_e]),Ee=(0,f.useMemo)((function(){var e=(null==_e?void 0:_e.length)>=1;return(0,S.jsxs)(y.ZP,{alignItems:"center",children:[!Q&&(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:e,onClick:function(e){(0,Ce.j)(e),J(!0),setTimeout((function(){var e;return null==M||null===(e=M.current)||void 0===e?void 0:e.focus()}),1)},primary:!0,small:e,children:"Create new set of interactions"})}),Q&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Ie.Z,{compact:!0,monospace:!0,onChange:function(e){(0,Ce.j)(e),Y(e.target.value)},onClick:function(e){return(0,Ce.j)(e)},ref:M,small:!0,value:V||""}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(ge.ZP,{compact:e,loading:a,onClick:function(e){(0,Ce.j)(e),u({block_uuid:null==x?void 0:x.uuid,inputs:{},layout:[],uuid:"".concat(V,".").concat(b.t6.YAML),variables:{}}).then((function(e){var n=e.data;if(null==n||!n.error){var t=null==n?void 0:n.interaction,i=null==t?void 0:t.uuid;be(null==x?void 0:x.uuid,(null==_e?void 0:_e.length)||0,{uuid:i}),de((function(e){return Gl(Gl({},e),{},(0,o.Z)({},i,t))})),setTimeout((function(){var e;null==B||null===(e=B.current)||void 0===e||e.scrollIntoView()}),me.e+100)}})),J(!1),ee(V),Y(null)},primary:!0,small:e,children:"Save interaction"}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(ge.ZP,{compact:e,onClick:function(e){(0,Ce.j)(e),J(!1),Y(null)},secondary:!0,small:e,children:"Cancel"})]})]})}),[u,x,_e,Q,a,V,de,J,ee,Y,be]);return(0,S.jsxs)(C.Z,{p:w.cd,style:{position:"relative"},children:[(0,S.jsxs)(C.Z,{pb:w.cd,ref:T,children:[!x&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(A.Z,{children:"Blocks with interactions"})}),we,(0,S.jsxs)(C.Z,{mb:w.cd,mt:w.HN,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{children:"Permissions"}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Add,{}),compact:!0,disabled:ne,onClick:function(){return xe((function(e){return null==e?void 0:e.concat([{roles:[],triggers:[]}])}))},secondary:!0,small:!0,children:"Add permission"})})]}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsx)(O.ZP,{default:!0,children:"Add permissions to allow specific user roles the ability to trigger this pipeline using the interactions for this pipeline."})})]}),null==je?void 0:je.map((function(e,n){return(0,S.jsx)(C.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(Fl,{index:n,permission:e,setPermissions:xe,updatePermission:function(e){var t=(0,r.Z)(je);t[n]=e,xe(t)}})},"permission-".concat(n))}))]}),x&&(0,S.jsxs)(C.Z,{mb:w.Mq,children:[(0,S.jsxs)(C.Z,{mb:w.Mq,children:[(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(C.Z,{mr:w.cd,py:1,children:(0,S.jsx)(A.Z,{children:"Block interactions"})}),(null==_e?void 0:_e.length)>=1&&Ee]}),(0,S.jsx)(O.ZP,{default:!0,children:"A block can have multiple sets of interactions associated with it."})]}),!(null!=_e&&_e.length)&&Ee,(null==Se?void 0:Se.length)>=1&&(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Variables"}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Z.Z,{alignItems:"center",flex:1,children:null==Se?void 0:Se.map((function(e,n){return(0,S.jsx)(C.Z,{mr:1,children:(0,S.jsxs)(O.ZP,{default:!0,monospace:!0,children:[e,(null==Se?void 0:Se.length)>=2&&n<(null==Se?void 0:Se.length)-1&&(0,S.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,children:","})]})},e)}))})]})]}),null==_e?void 0:_e.map((function(e,n){var t,i=e||{description:null,name:null},r=i.description,o=i.name,u=null==x?void 0:x.uuid,c=null==e?void 0:e.uuid,s=null==se?void 0:se[c];return(0,S.jsxs)("div",{children:[n>=1&&(0,S.jsx)(C.Z,{my:w.HN,children:(0,S.jsx)(k.Z,{light:!0})}),(0,S.jsx)(Bl.Z,{blockInteraction:e,containerRef:T,containerWidth:l,interaction:s,isEditing:!0,removeBlockInteraction:function(){return be(u,n,e,{remove:!0})},setInteractionsMapping:de,children:(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsxs)(y.ZP,{alignItems:"flex-start",children:[(0,S.jsxs)(C.Z,{mb:1,style:{width:20*w.iI},children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Label"}),(0,S.jsxs)(O.ZP,{muted:!0,children:["Add a label for this",(0,S.jsx)("br",{}),"set of interactions."]})]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(Ie.Z,{fullWidth:!0,onChange:function(e){return be(u,n,{name:e.target.value})},value:o||""})})]}),(0,S.jsx)(C.Z,{mb:w.cd}),(0,S.jsxs)(y.ZP,{alignItems:"flex-start",children:[(0,S.jsxs)(C.Z,{mb:1,style:{width:20*w.iI},children:[(0,S.jsx)(O.ZP,{bold:!0,large:!0,children:"Description"}),(0,S.jsxs)(O.ZP,{muted:!0,children:["Describe how these",(0,S.jsx)("br",{}),"interactions are used."]})]}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Z.Z,{flex:1,children:(0,S.jsx)(Ul.Z,{fullWidth:!0,onChange:function(e){return be(u,n,{description:e.target.value})},rows:Math.max(3,Math.min(12,null==r||null===(t=r.split("\n"))||void 0===t?void 0:t.length)),value:r||""})})]})]})}),(0,S.jsx)("div",{ref:n===(null==_e?void 0:_e.length)-1?B:null})]},"".concat(null==e?void 0:e.uuid,"-").concat(n))}))]}),(0,S.jsx)(Al,{ref:m,width:(null==T||null===(n=T.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.width)||null,children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(ge.ZP,{beforeIcon:(0,S.jsx)(N.Save,{}),disabled:ne,loading:d,onClick:function(){return Ze()},primary:K,secondary:!K,children:"Save changes for all interactions"}),(0,S.jsx)(C.Z,{mr:w.cd}),K&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(N.AlertTriangle,{warning:!0}),(0,S.jsx)(C.Z,{mr:1}),(0,S.jsx)(O.ZP,{warning:!0,children:"You have unsaved interaction changes"})]}),!K&&R&&(0,S.jsxs)(O.ZP,{muted:!0,children:["Interactions last saved at"," ",(0,Hl.JX)(Number(R)/1e3)]})]})})})]})};var zl=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,r=e.setErrorMessages,o=e.width,u=(0,f.useState)(!1),c=u[0],s=u[1],a=(0,f.useState)(),d=a[0],p=a[1],v=(0,f.useState)(),m=v[0],g=v[1],b=(0,f.useMemo)((function(){return o-w.cd*w.iI*2}),[o]),x=(0,h.Db)(Y.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,ye.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;r((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),j=(0,l.Z)(x,1)[0],k=(0,h.Db)((function(e){return Y.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),Z=(0,l.Z)(k,1)[0],P=(0,f.useCallback)((function(e){"Enter"===e.key?(j({secret:{name:d,value:m}}).then((function(){n(),p(null),g(null)})),(0,rr.ez)(),s(!1)):"Escape"===e.key&&((0,rr.ez)(),s(!1))}),[j,n,d,m]),_=(0,f.useCallback)((function(e){(0,rr.ez)(),Z(e)}),[Z]);return(0,S.jsxs)(C.Z,{p:w.cd,children:[(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(y.ZP,{alignItems:"center",children:[(0,S.jsx)(A.Z,{level:4,monospace:!0,children:"Secrets"}),(0,S.jsx)(C.Z,{ml:2}),(0,S.jsx)(on.ZP,{Icon:N.Add,blackBorder:!0,inline:!0,onClick:function(){return s((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(O.ZP,{children:[(0,S.jsx)(O.ZP,{inline:!0,warning:!0,children:"WARNING:"})," ","the encryption key is stored in a file on your machine. If you need more secure encryption, we recommend using a secrets manager."]})}),c&&(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(O.ZP,{muted:!0,children:["Press"," ",(0,S.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," ","or"," ",(0,S.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," ","to save changes."]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsxs)(xl.kA,{width:b,children:[c&&(0,S.jsxs)(Vr.Z,{children:[(0,S.jsx)(Mr.Z,{md:1,children:(0,S.jsx)(xl.qZ,{noPadding:!0,children:(0,S.jsx)(on.ZP,{backgroundColor:jl.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(d,") }}")),Bt.Am.success("Successfully copied to clipboard.",{position:Bt.Am.POSITION.BOTTOM_RIGHT,toastId:d})},uuid:"Sidekick/Secrets/".concat(d),withIcon:!0,children:(0,S.jsx)(N.Copy,{size:2.5*w.iI})})})}),(0,S.jsx)(Mr.Z,{md:5,children:(0,S.jsx)(xl.qZ,{children:(0,S.jsx)(Ie.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){p(e.target.value),e.preventDefault()},onKeyDown:P,paddingHorizontal:0,placeholder:"secret name",small:!0,value:d})})}),(0,S.jsx)(Mr.Z,{md:6,children:(0,S.jsx)(xl.qZ,{children:(0,S.jsx)(Ie.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){g(e.target.value),e.preventDefault()},onKeyDown:P,paddingHorizontal:0,placeholder:"secret value",small:!0,value:m})})})]}),null==i?void 0:i.map((function(e){return(0,S.jsx)(jr.Z,{copyText:e.name,deleteVariable:function(){return _(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{children:"Secrets are not editable, they can only be created and deleted. Secrets are shared across the project, and can be used in configuration fields. To reference a secret, use the following templating syntax:"})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(gl.Z,{language:"yaml",maxWidth:b,small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n "})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(O.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,S.jsx)(C.Z,{mb:w.cd,children:(0,S.jsx)(gl.Z,{language:"python",maxWidth:b,small:!0,source:"\n from mage_ai.data_preparation.shared.secrets import get_secret_value\n\n get_secret_value('<secret_name>')\n "})})]})},ql=t(28026),Vl=t(68899),Yl=t(4982),Xl=t(15752),Ql=t(91835);function Jl(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function $l(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Jl(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Jl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var eo=function(e){var n=e.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,r=e.autocompleteItems,u=e.blockRefs,c=e.blocks,s=e.blocksInNotebook,a=e.deleteBlock,d=e.description,p=e.displayBlockName,v=e.fetchFileTree,m=e.fetchPipeline,g=e.interruptKernel,x=e.messages,j=(e.onChangeCallbackBlock,e.onChangeCodeBlock),k=e.onSelectBlockFile,Z=e.pipeline,y=e.runBlock,_=e.runningBlocks,I=e.savePipelineContent,E=e.selectedBlock,T=e.setAnyInputFocused,M=e.setErrors,B=e.setHiddenBlocks,D=e.setSelectedBlock,A=e.setTextareaFocused,R=e.showBrowseTemplates,F=e.showUpdateBlockModal,U=e.textareaFocused,H=(0,f.useRef)(null),W=(0,f.useState)(!1),K=W[0],z=W[1],q=(0,dl.iV)().block_uuid;(0,f.useEffect)((function(){var e=c.find((function(e){var n,t=e.uuid;return(null==q||null===(n=q.split(":"))||void 0===n?void 0:n[0])===t}));e&&(E&&(null==e?void 0:e.uuid)===(null==E?void 0:E.uuid)||(B((function(n){return $l($l({},n),{},(0,o.Z)({},e.uuid,!1))})),k(e.uuid,e.type,null)))}),[q,c,k,E,B]);var V=(Z||{}).type,X=(0,f.useMemo)((function(){return(0,L.HK)(t||[],(function(e){return e.uuid}))}),[t]),Q=Y.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,J=(0,f.useMemo)((function(){return(null==Q?void 0:Q.block_templates)||[]}),[Q]),$=(0,f.useCallback)((function(e){return n(e,(null==X?void 0:X.length)||0)}),[n,X]),ee=(0,f.useMemo)((function(){return(0,ir.oM)(J,$)}),[$,J]),ne=(0,f.useMemo)((function(){return(0,ir.hr)($,i,V,{blockTemplatesByBlockType:ee,languages:[b.t6.PYTHON],showBrowseTemplates:R})}),[$,i,ee,V]),te=(0,f.useMemo)((function(){return null==X?void 0:X[null==E?void 0:E.uuid]}),[X,E]),ie=(0,f.useMemo)((function(){return _.reduce((function(e,n,t){return $l($l({},e),{},(0,o.Z)({},n.uuid,$l($l({},n),{},{priority:t})))}),{})}),[_]),re=(0,h.Db)((function(e){var n=e.block,t=e.upstream_blocks;return Y.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null==Z?void 0:Z.uuid),encodeURIComponent(null==n?void 0:n.uuid),{query:{block_type:null==n?void 0:n.type}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){m()},onErrorCallback:function(e,n){return null==M?void 0:M({errors:n,response:e})}})}}),le=(0,l.Z)(re,2),oe=le[0],ue=le[1].isLoading,ce=(0,f.useMemo)((function(){return null==t?void 0:t.map((function(e,n){var t=e.type,i=e.uuid,l=(null==E?void 0:E.uuid)===i,d=ie[i],h=d?0===d.priority?ii.uF.BUSY:ii.uF.QUEUED:ii.uF.IDLE,P="".concat(t,"s/").concat(i,".py");return u.current[P]=(0,f.createRef)(),(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(ln.Z,{allBlocks:c,autocompleteItems:r,block:e,blockIdx:n,blockRefs:u,blocks:c,defaultValue:e.content,deleteBlock:function(e){a($l({},e)),T(!1)},executionState:h,extraContent:(0,S.jsx)(ll,{block:e,blocks:s,inputPlaceholder:"Select blocks to add ".concat((0,G._6)(p,null)," to"),loading:ue,onClickTag:function(e){B((function(n){return $l($l({},n),{},(0,o.Z)({},e.uuid,!1))})),k(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[b.tf.CUSTOM,b.tf.DATA_EXPORTER,b.tf.DATA_LOADER,b.tf.DBT,b.tf.SCRATCHPAD,b.tf.SENSOR,b.tf.TRANSFORMER],updateBlock:oe}),fetchFileTree:v,fetchPipeline:m,hideRunButton:!0,interruptKernel:g,messages:x[i],noDivider:!0,onChange:function(e){return j(t,i,e)},pipeline:Z,ref:u.current[P],runBlock:y,runningBlocks:_,savePipelineContent:I,showUpdateBlockModal:F,selected:l,setAnyInputFocused:T,setErrors:M,setSelected:function(n){return D(!0===n?e:null)},setTextareaFocused:A,textareaFocused:l&&U})},i)}))}),[t,r,u,c,s,a,p,v,m,g,ue,x,j,k,Z,y,_,ie,I,E,T,M,B,D,A,F,U,oe]),se="".concat(p,"/index"),ae=(0,Xe.y)(),de=ae.disableGlobalKeyboardShortcuts,pe=ae.registerOnKeyDown,fe=ae.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){fe(se)}}),[fe,se]),pe(se,(function(e,n){!de&&te&&((0,Ye.y)([ze.zX,ze.Um],n)||(0,Ye.y)([ze.PQ,ze.Um],n))&&(e.preventDefault(),I())}),[te,I]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.Z,{mb:w.cd,children:[(0,S.jsx)(O.ZP,{default:!0,children:d}),(0,S.jsx)(C.Z,{mt:1,children:(0,S.jsxs)(O.ZP,{default:!0,children:["Learn more about ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,G.wX)((0,G._6)(p,null)),"/overview"),openNewWindow:!0,children:(0,G.wX)((0,G._6)(p,null))}),"."]})})]}),ce,(0,S.jsx)(C.Z,{mt:w.cd,children:(0,S.jsx)(xt.Z,{onClickOutside:function(){return z(!1)},open:!0,children:(0,S.jsx)(Ai.Z,{disableKeyboardShortcuts:!0,items:ne,onClickCallback:function(){return z(!1)},open:K,parentRef:H,uuid:p,children:(0,S.jsxs)(on.ZP,{beforeElement:(0,S.jsx)(ol.Wx,{rose:i===b.tf.CALLBACK,children:(0,S.jsx)(N.Add,{size:ol.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),z(!0)},uuid:"AddNewBlocks/".concat(p),children:[(0,G.kC)(p)," block"]})})})})]})},no=t(26084);function to(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function io(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?to(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):to(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ro=[{Icon:N.Callback,name:"Callbacks",uuid:no.Q.CALLBACK},{Icon:N.Conditional,name:"Conditionals",uuid:no.Q.CONDITIONAL}];var lo=function(e){var n=(0,Ql.Z)({},e),t=(0,v.useRouter)(),i=(0,f.useState)(null),r=i[0],l=i[1];(0,f.useEffect)((function(){var e;l(null===(e=(0,dl.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var o=(0,f.useMemo)((function(){var e,t;if(no.Q.CALLBACK===r)e={addOnBlockType:b.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,description:"Run 1 or more callback blocks whenever the main block succeeds or fails.",displayBlockName:"callback"};else if(no.Q.CONDITIONAL===r){var i;e={addOnBlockType:b.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,description:"Run 1 or more conditional blocks to determine whether or not the main block should be run.",displayBlockName:"conditional"}}if(e)return(0,S.jsx)(eo,io(io({},e),n))}),[n,r]);return(0,S.jsx)(nn.W,{backend:tn.PD,children:(0,S.jsxs)(C.Z,{p:w.cd,children:[o,!r&&(null==ro?void 0:ro.map((function(e,n){var t=e.name,i=e.uuid,r=e.Icon;return(0,S.jsx)(C.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,al.u)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(At.Z,{dark:!0,children:(0,S.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(Z.Z,{alignItems:"center",children:[(0,S.jsx)(Wn.Z,{fullWidth:!1,children:(0,S.jsx)(C.Z,{p:w.cd,children:(0,S.jsx)(y.ZP,{alignItems:"center",children:(0,S.jsx)(r,{fill:"#885EFF",size:2*w.iI})})})}),(0,S.jsx)(C.Z,{mr:w.cd}),(0,S.jsx)(Z.Z,{flexDirection:"column",children:(0,S.jsx)(O.ZP,{bold:!0,children:t})})]}),(0,S.jsx)(N.ChevronRight,{})]})})})},i)})))]})})};function oo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function uo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?oo(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):oo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var co=function(e){var n=e.activeView,t=e.addNewBlockAtIndex,i=e.afterWidth,r=e.autocompleteItems,l=e.blockInteractionsMapping,u=e.blockRefs,c=e.blocks,s=e.blocksInNotebook,a=e.cancelPipeline,d=e.chartRefs,p=e.checkIfPipelineRunning,h=e.containerHeightOffset,v=e.contentByBlockUUID,g=e.createInteraction,b=e.deleteBlock,x=e.deleteWidget,j=e.editingBlock,k=e.executePipeline,Z=e.fetchFileTree,P=e.fetchPipeline,_=e.fetchSecrets,I=e.fetchVariables,E=e.globalDataProducts,T=e.globalVariables,M=e.insights,B=e.interactions,D=e.interactionsMapping,A=e.interruptKernel,R=e.isLoadingCreateInteraction,F=e.isLoadingUpdatePipelineInteraction,U=e.isPipelineExecuting,H=e.lastTerminalMessage,W=e.messages,G=e.metadata,K=e.onChangeCallbackBlock,z=e.onChangeChartBlock,q=e.onChangeCodeBlock,V=e.onSelectBlockFile,Y=e.onUpdateFileSuccess,X=e.permissions,Q=e.pipeline,J=e.pipelineInteraction,$=e.pipelineMessages,ee=e.project,ne=e.refAfterFooter,te=e.runBlock,ie=e.runningBlocks,re=e.sampleData,le=e.savePipelineContent,oe=e.savePipelineInteraction,ue=e.secrets,ce=e.selectedBlock,se=e.selectedFilePath,ae=e.sendTerminalMessage,de=e.setActiveSidekickView,pe=e.setAllowCodeBlockShortcuts,fe=e.setAnyInputFocused,he=e.setBlockInteractionsMapping,ve=e.setDisableShortcuts,me=e.setEditingBlock,be=e.setErrors,je=e.setHiddenBlocks,ke=e.setInteractionsMapping,Ze=e.setPermissions,ye=e.setSelectedBlock,Pe=e.setTextareaFocused,Ce=e.showBrowseTemplates,Oe=e.showDataIntegrationModal,we=e.showUpdateBlockModal,_e=e.sideBySideEnabled,Se=e.statistics,Ie=e.textareaFocused,Ee=e.treeRef,Te=e.updatePipelineInteraction,Be=e.updateWidget,De=e.widgets,Ae=(0,Qe.i)().height,Re=ar.uX,Ne=(0,f.useState)([]),Le=Ne[0],Fe=Ne[1],Ue=(0,f.useState)(!!(0,Ve.U2)(Ve.Q9)),He=Ue[0],We=Ue[1],Ge=(0,f.useMemo)((function(){return i-(Vl.k1+1)}),[i]),Ke=(0,f.useMemo)((function(){var e;return!(null==ee||null===(e=ee.features)||void 0===e||!e[Qi.d.INTERACTIONS])}),[null==ee?void 0:ee.features]),ze=((null==j?void 0:j.upstreamBlocks)||{}).block,qe=((null==re?void 0:re.columns)||[]).slice(0,100),Ye=(0,f.useMemo)((function(){return(null==re?void 0:re.rows)||[]}),[re]),Xe=(0,f.useMemo)((function(){return(null==G?void 0:G.column_types)||{}}),[G]),Je=(0,f.useMemo)((function(){return(null==M?void 0:M[1])||{}}),[M]),$e=(0,f.useMemo)((function(){return(0,L.HK)((null==M?void 0:M[0])||[],(function(e){return e.feature.uuid}))}),[M]),en=!!re,nn=(0,f.useMemo)((function(){return cn.qL.INTEGRATION===(null==Q?void 0:Q.type)}),[Q]),tn=cn.qL.STREAMING!==(null==Q?void 0:Q.type)?-70:He?-16:300,rn=(0,f.useCallback)((0,Yl.Fk)({columnTypes:Xe,columns:qe,insightsByFeatureUUID:$e,insightsOverview:Je,noColumnLinks:!0,statistics:Se}),[Xe,qe,$e,Je,Se]),ln=(0,f.useMemo)((function(){return(0,S.jsx)(yl,{blocks:c,fetchVariables:I,pipeline:Q,selectedBlock:ce,setErrorMessages:Fe,variables:T,width:Ge})}),[Ge,c,I,T,Q,ce]),on=(0,f.useMemo)((function(){return(0,S.jsx)(ml.Z,{onActionCallback:Y,pipeline:Q,selectedBlock:ce,selectedFilePath:se,setErrors:be,width:Ge>Me.nn?Ge-Me.nn:Ge})}),[Ge,Y,Q,ce,se,be]),un=(0,f.useMemo)((function(){return(0,S.jsx)(zl,{fetchSecrets:_,pipelineUUID:null==Q?void 0:Q.uuid,secrets:ue,setErrorMessages:Fe,width:Ge})}),[Ge,_,Q,ue]),sn=(0,f.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:r,blockRefs:u,blocks:c,blocksInNotebook:s,deleteBlock:b,fetchFileTree:Z,fetchPipeline:P,interruptKernel:A,messages:W,onChangeCallbackBlock:K,onChangeCodeBlock:q,onSelectBlockFile:V,pipeline:Q,runBlock:te,runningBlocks:ie,savePipelineContent:le,selectedBlock:ce,setAnyInputFocused:fe,setErrors:be,setHiddenBlocks:je,setSelectedBlock:ye,setTextareaFocused:Pe,showBrowseTemplates:Ce,showUpdateBlockModal:we,textareaFocused:Ie}}),[t,r,u,c,s,b,Z,P,A,W,K,q,V,Q,te,ie,le,ce,fe,be,je,ye,Pe,Ce,we,Ie]),an=(0,f.useMemo)((function(){return qe.length>0&&(0,S.jsx)(In.Z,{columnHeaderHeight:(0,Tn.Qr)(Xe)&&(0,Tn.Qr)($e)&&(0,Tn.Qr)(Je)?0:En.Eh,columns:qe,height:Ae-Re-ar.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:rn,rows:Ye,width:Ge})}),[Ge,Xe,qe,Re,Ae,$e,Je,rn,Ye]),dn=(0,f.useMemo)((function(){return De.length>0&&(0,S.jsx)(Jr,{autocompleteItems:r,blockRefs:u,blocks:c,chartRefs:d,deleteWidget:x,fetchFileTree:Z,fetchPipeline:P,messages:W,onChangeChartBlock:z,pipeline:Q,runBlock:te,runningBlocks:ie,savePipelineContent:le,selectedBlock:ce,setAnyInputFocused:fe,setErrors:be,setSelectedBlock:ye,setTextareaFocused:Pe,textareaFocused:Ie,updateWidget:Be,widgets:De,width:Ge})}),[Ge,r,u,c,d,x,Z,P,W,z,Q,te,ie,le,ce,fe,be,ye,Pe,Ie,Be,De]),pn=(0,f.useMemo)((function(){return(0,S.jsx)("div",{style:{height:"100%",position:"relative",width:Ge},children:(0,S.jsx)(ql.Z,{lastMessage:H,onFocus:function(){return ye(null)},sendMessage:ae,width:Ge})})}),[Ge,H,ae,ye]),fn=(0,f.useMemo)((function(){return(0,S.jsx)(vl,uo({},sn))}),[sn]),hn=(0,f.useMemo)((function(){return(0,S.jsx)(lo,uo({},sn))}),[sn]),vn=(0,f.useMemo)((function(){return Q&&ce&&(0,S.jsx)(Ir,{addNewBlockAtIndex:t,block:ce,contentByBlockUUID:v,fetchFileTree:Z,fetchPipeline:P,globalDataProducts:E,pipeline:Q,project:ee,setSelectedBlock:ye,showDataIntegrationModal:Oe,showUpdateBlockModal:we})}),[t,v,Z,P,E,Q,ee,ce,ye,Oe,we]);return(0,S.jsxs)(S.Fragment,{children:[(null==Le?void 0:Le.length)>=1&&(0,S.jsxs)(C.Z,{mb:3,mt:2,mx:2,children:[(0,S.jsxs)(y.ZP,{justifyContent:"space-between",children:[(0,S.jsx)(O.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,S.jsx)(ge.ZP,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return Fe([])},transparent:!0,children:(0,S.jsx)(N.Close,{muted:!0})})]}),null==Le?void 0:Le.map((function(e){return(0,S.jsx)(C.Z,{pb:1,children:(0,S.jsx)(O.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,S.jsxs)(En.t0,{fullWidth:!0,heightOffset:zi.cH.TERMINAL===n||n===zi.cH.TREE?0:h||Me.nn,onBlur:function(){se||ve(!1),null==pe||pe(!1)},onFocus:function(){ve(!0),n===zi.cH.TREE&&(null==pe||pe(!0))},overflowHidden:n===zi.cH.TREE,tabIndex:0,children:[n===zi.cH.TREE&&(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(null==Q?void 0:Q.uuid),children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(xe.ZP,{addNewBlockAtIndex:t,blockRefs:u,blocks:c,contentByBlockUUID:v,contextMenuEnabled:!0,deleteBlock:b,dragEnabled:!0,editingBlock:j,enablePorts:!nn,fetchPipeline:P,height:Ae-(Re-Me.nn)-tn,messages:W,onClickNode:function(e){var n=e.block.uuid;return je((function(e){var t=!(null==e||!e[n]);return t?uo(uo({},e),{},(0,o.Z)({},n,!t)):e}))},pipeline:Q,runBlock:te,runningBlocks:ie,selectedBlock:ce,setActiveSidekickView:de,setEditingBlock:me,setErrors:be,setSelectedBlock:function(e){ye(e),_e&&(0,Xl.F)(e)},showUpdateBlockModal:we,treeRef:Ee}),!ze&&cn.qL.STREAMING===(null==Q?void 0:Q.type)&&(0,S.jsx)(C.Z,{p:1,children:(0,S.jsx)(Ml,{cancelPipeline:a,checkIfPipelineRunning:p,executePipeline:k,isPipelineExecuting:U,pipelineExecutionHidden:He,pipelineMessages:$,setPipelineExecutionHidden:We})})]})}),n===zi.cH.DATA&&an,zi.cH.SECRETS===n&&un,zi.cH.VARIABLES===n&&ln,zi.cH.FILE_VERSIONS===n&&(0,S.jsx)(m.Z,{uuid:"FileVersions/".concat(se?decodeURIComponent(se):""),children:on}),nn||ce&&en||!ce&&en&&n===zi.cH.DATA?null:zi.du.includes(n)&&(0,S.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:zi.fp,verticalHeightOffset:Re,width:Ge,children:(0,S.jsx)(O.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:ce?!en&&"No data or insights available":"Select a block for insights"})}),zi.cH.CHARTS===n&&(De.length>0?dn:(0,S.jsxs)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:zi.fp,verticalHeightOffset:Re,width:Ge,children:[(0,S.jsx)(C.Z,{px:1,children:(0,S.jsx)(y.ZP,{flexDirection:"row",children:(0,S.jsxs)(O.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon ",(0,S.jsx)(N.Charts,{size:1.5*w.iI})," in",(0,S.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,S.jsx)(C.Z,{mt:w.cd,px:1,children:(0,S.jsx)(el,{size:40*w.iI})})]})),zi.cH.TERMINAL===n&&pn,zi.cH.EXTENSIONS===n&&fn,zi.cH.ADDON_BLOCKS===n&&hn,zi.cH.BLOCK_SETTINGS===n&&(ce?vn:(0,S.jsx)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:zi.fp,verticalHeightOffset:Re,width:Ge,children:(0,S.jsx)(C.Z,{px:1,children:(0,S.jsx)(y.ZP,{flexDirection:"row",children:(0,S.jsxs)(O.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon ",(0,S.jsx)(N.SettingsWithKnobs,{size:1.5*w.iI})," ",(0,S.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})})),zi.cH.INTERACTIONS===n&&Ke&&(0,S.jsx)(Kl,{blockInteractionsMapping:l,containerWidth:Ge,createInteraction:function(e){return g({interaction:e})},interactions:B,interactionsMapping:D,isLoadingCreateInteraction:R,isLoadingUpdatePipelineInteraction:F,permissions:X,pipeline:Q,pipelineInteraction:J,refAfterFooter:ne,savePipelineInteraction:oe,selectedBlock:ce,setBlockInteractionsMapping:he,setInteractionsMapping:ke,setPermissions:Ze,setSelectedBlock:ye,updatePipelineInteraction:function(e){return Te({pipeline_interaction:e})}})]})]})};var so=function(e){var n,t=e.activeView,i=e.pipeline,r=e.project,l=e.secrets,o=e.selectedBlock,u=e.setSelectedBlock,c=e.variables,s=null==i?void 0:i.uuid,a=(0,dl.iV)(),d=(0,Zl.wx)(c,(function(e){return e.uuid===bl.C})),p=(0,zi.Qq)({project:r})[t],h=(null==p||null===(n=p.buildLabel)||void 0===n?void 0:n.call(p,{pipeline:i,secrets:l,variables:d}))||(null==p?void 0:p.label);zi.cH.BLOCK_SETTINGS===t&&null!=o&&o.uuid&&(h=(0,S.jsxs)(S.Fragment,{children:["Block settings for ",(0,S.jsx)(O.ZP,{bold:!0,color:(0,_.qn)(null==o?void 0:o.type).accent,inline:!0,monospace:!0,children:null==o?void 0:o.uuid})]}));var v=(0,S.jsx)(O.ZP,{bold:!0,children:h}),m=zi.cH.EXTENSIONS===t&&(null==a?void 0:a.extension),g=Y.ZP.extension_options.list({},{},{pauseFetch:!m}).data,b=(0,f.useMemo)((function(){return(null==g?void 0:g.extension_options)||[]}),[g]),x=(0,f.useMemo)((function(){return(0,L.HK)(b,(function(e){return e.uuid}))}),[b]),j=zi.cH.ADDON_BLOCKS===t&&(null==a?void 0:a.addon);if(zi.cH.INTERACTIONS===t){var k=[];null!=o&&o.uuid?k.push.apply(k,[{label:function(){return"All interactions"},monospace:!1,onClick:function(){return u(null)}},{bold:!0,label:function(){return null==o?void 0:o.uuid},monospace:!0}]):k.push({bold:!0,label:function(){return"Interactions"},monospace:!1}),v=(0,S.jsx)(gn.Z,{breadcrumbs:k,noMarginLeft:!0})}else{if(!t)return(0,S.jsx)("div",{});if(m){var Z=x[null==a?void 0:a.extension];v=(0,S.jsxs)(y.ZP,{children:[(0,S.jsx)(li(),{as:"/pipelines/".concat(s,"/edit?").concat(zi.uM,"=").concat(zi.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,S.jsx)(P.Z,{default:!0,children:h})}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,children:" / "}),(0,S.jsx)(O.ZP,{bold:!0,children:null==Z?void 0:Z.name})]})}else j&&(v=(0,S.jsxs)(y.ZP,{children:[(0,S.jsx)(li(),{as:"/pipelines/".concat(s,"/edit?").concat(zi.uM,"=").concat(zi.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,S.jsx)(P.Z,{default:!0,children:h})}),(0,S.jsx)(O.ZP,{monospace:!0,muted:!0,children:" / "}),(0,S.jsx)(O.ZP,{bold:!0,children:(0,G.vg)(null==a?void 0:a.addon)})]}))}return(0,S.jsx)(ar.ym,{children:v})},ao=t(27597),po=t(54277),fo=t(87432),ho=t(65044),vo=t(78419),mo=t(11498),go=t(28795),bo=t(85010);function xo(e){var n=e.activeView,t=e.pipeline,i=e.project,r=e.secrets,l=e.setActiveSidekickView,o=e.variables,u=(0,Zl.wx)(o,(function(e){return e.uuid===bl.C}));return(0,zi.j5)({pipeline:t,project:i}).map((function(e){var i=e.buildLabel,o=e.key,c=e.label;return{Icon:zi.Z7[o],id:o,isSelected:function(){return n===o},label:function(){return(null==i?void 0:i({pipeline:t,secrets:r,variables:u}))||c},onClick:function(){return l(o,!0)}}}))}var jo=t(53005),ko=t(4383),Zo=t(70320);function yo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Po(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?yo(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):yo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Co(e){var n,t,i,u,c,s,x,j,k,Z,P,O,_,I,E,B,D,A,R,F,W=e.page,K=e.pipeline,z=(0,f.useRef)(null),q=(0,f.useRef)(null),V=(0,d.ZP)((0,ko.Ib)("terminal"),{shouldReconnect:function(){return!0}}),X=V.lastMessage,Q=V.sendMessage,J=(0,yt.Z)({refreshInterval:null,revalidateOnFocus:!1}).fetch,$=(0,Pt.Z)(),ne=$.featureEnabled,te=$.featureUUIDs,ie=$.fetchProjects,re=$.project,le=$.sparkEnabled,oe=(0,$i.Z)().status,ue=(0,f.useContext)(p.ThemeContext),ce=(0,v.useRouter)(),ae=(0,Qe.i)().height,pe=ce.query.pipeline,fe=K.uuid||pe,he=(0,f.useState)(!0),ve=he[0],be=he[1],xe=(0,f.useState)(!1),je=xe[0],Ze=xe[1],Pe=(0,f.useState)(null),Ce=Pe[0],Oe=Pe[1],we=(0,f.useState)(null),_e=we[0],Se=we[1],Ie=(0,f.useState)(null),Ee=Ie[0],Te=Ie[1],Me=(0,f.useState)(null),Be=Me[0],De=Me[1],Ae=(0,f.useState)(!1),Re=Ae[0],Ne=Ae[1],Le=(0,f.useState)(!1),Fe=Le[0],Ue=Le[1],He=(0,f.useState)(!1),We=He[0],Ge=He[1],Ke=(0,f.useState)(!1),ze=Ke[0],qe=Ke[1],Ye=(0,f.useState)(!0),Xe=Ye[0],Je=Ye[1],$e=(0,f.useState)(!1),nn=$e[0],tn=$e[1],rn=(0,f.useState)({upstreamBlocks:null}),ln=rn[0],un=rn[1],sn=(0,f.useState)([]),an=sn[0],dn=sn[1],pn=(0,f.useState)(null),hn=pn[0],vn=pn[1],gn=(0,f.useState)(null),bn=gn[0],xn=gn[1],kn=(0,dl.iV)(),Zn=kn[zi.uM],yn=kn.block_uuid,Pn=(0,f.useCallback)((function(e){var n;vn(e),e&&We&&Ge(!1),xn(null),yn&&(null==yn||null===(n=yn.split(":"))||void 0===n?void 0:n[0])!==(null==e?void 0:e.uuid)&&(0,al.u)({block_uuid:null})}),[yn,We]),Cn=(0,f.useState)(!!(0,Ve.U2)(Ve.zg)),On=Cn[0],wn=Cn[1],_n=(0,f.useState)(!!(0,Ve.U2)(Ve.Uu)),Sn=_n[0],In=_n[1],En=((0,f.useMemo)((function(){var e;return(0,Zo.hY)(null==re||null===(e=re.features)||void 0===e?void 0:e[Qi.d.LOCAL_TIMEZONE])}),[null==re?void 0:re.features]),(0,f.useMemo)((function(){var e;return!(null==re||null===(e=re.features)||void 0===e||!e[Qi.d.INTERACTIONS])}),[null==re?void 0:re.features])),Mn="".concat(vo.H8,"_").concat(fe),Bn=(0,Ve.U2)(Mn),Dn=(0,f.useState)((0,L.sE)(ci.NR,(function(e){return e.uuid===Bn}))||ci.NR[0]),An=Dn[0],Rn=Dn[1],Nn=(0,f.useCallback)((function(e){Rn(e),(0,Ve.t8)(Mn,null==e?void 0:e.uuid)}),[Mn,Rn]),Ln="".concat(vo.g6,"_").concat(fe),Fn=(0,f.useState)({}),Un=Fn[0],Hn=Fn[1],Wn=(0,f.useRef)(null),Gn=(0,f.useMemo)((function(){return null==oe?void 0:oe.disable_pipeline_edit_access}),[oe]),Kn=(0,f.useMemo)((function(){return null==oe?void 0:oe.max_print_output_lines}),[oe]),zn=(0,f.useState)({}),qn=zn[0],Vn=zn[1],Yn=(0,f.useState)([]),Xn=Yn[0],Qn=Yn[1],Jn=(0,jn.Z)(fe),$n=Y.ZP.pipelines.detail(fe,Po({include_block_pipelines:!0,includes_outputs:(0,Tn.Qr)(qn)||null==F||void 0===(null===(n=F)||void 0===n?void 0:n.blocks)||null===(null===(t=F)||void 0===t?void 0:t.blocks)||!(null===(i=F)||void 0===i||null===(u=i.blocks)||void 0===u||!u.find((function(e){return void 0===e.ouputs})))},Xe?{includes_outputs_spark:!0}:{}),{refreshInterval:null,revalidateOnFocus:!1},{key:"/pipelines/".concat(fe,"/edit")}),et=$n.data,nt=$n.mutate,tt=(0,Ji.Z)(Y.ZP.pipeline_interactions.detail,fe,{},{revalidateOnFocus:!1},{condition:function(){return En},delay:3e3}),it=tt.data,rt=tt.mutate,lt=(0,Ji.Z)(Y.ZP.interactions.pipeline_interactions.list,fe,{},{revalidateOnFocus:!1},{condition:function(){return En},delay:3e3}),ot=lt.data,ut=lt.mutate,ct=(0,f.useMemo)((function(){return(null==it?void 0:it.pipeline_interaction)||{}}),[it]),st=(0,f.useMemo)((function(){return(null==ot?void 0:ot.interactions)||[]}),[ot]),at=(0,h.Db)(Y.ZP.pipeline_interactions.useUpdate(fe),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){rt()},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}}),dt=(0,l.Z)(at,2),pt=dt[0],ft=dt[1].isLoading,ht=(0,h.Db)(Y.ZP.interactions.pipeline_interactions.useCreate(fe),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){ut(),rt()},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}}),vt=(0,l.Z)(ht,2),mt=vt[0],gt=vt[1].isLoading;F=(0,f.useMemo)((function(){return null==et?void 0:et.pipeline}),[et]);var xt=(0,f.useMemo)((function(){var e;return cn.qL.INTEGRATION===(null===(e=F)||void 0===e?void 0:e.type)}),[F]);(0,f.useEffect)((function(){F&&Xe&&le&&Je(!1)}),[Xe,F,Je,le]);var jt=(0,f.useState)((0,Ve.U2)(vo.iL,!1)),kt=jt[0],Zt=jt[1],Ct=(0,f.useMemo)((function(){return!xt&&(null==ne?void 0:ne(null==te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&kt}),[ne,te,xt,kt]),Ot=(0,f.useState)((0,Ve.U2)(vo.qj,!1)),wt=Ot[0],_t=Ot[1],St=(0,f.useMemo)((function(){return(null==ne?void 0:ne(null==te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&wt}),[ne,te,wt]),Bt=(0,f.useCallback)((function(e){_t(e),(0,Ve.t8)(vo.qj,"function"==typeof e?e():e)}),[_t]),Dt=(0,f.useCallback)((function(e){var n="function"==typeof e?e():e;Zt(e),(0,Ve.t8)(vo.iL,n),n||Bt(e)}),[Bt,Zt]),Rt=(0,f.useState)((0,Ve.U2)(vo.MS,!1)),Nt=Rt[0],Lt=Rt[1],Ft=(0,f.useCallback)((function(){var e=!Nt;Lt(e),(0,Ve.t8)(vo.MS,e)}),[Nt]),Ut=(0,f.useState)((0,Ve.U2)(vo.ls,!1)),Ht=Ut[0],Wt=Ut[1],Gt=(0,f.useCallback)((function(){var e=!Ht;Wt(e),(0,Ve.t8)(vo.ls,e)}),[Ht]),Kt=(0,f.useCallback)((function(){var e=new CustomEvent(ci.$e,{detail:{}});window.dispatchEvent(e)}),[]),zt=(0,f.useCallback)((function(){var e=new CustomEvent(ci.tK,{detail:{}});window.dispatchEvent(e)}),[]),qt=(0,f.useCallback)((function(e){Hn((function(n){var t=e(n);return(0,Ve.t8)(Ln,JSON.stringify(t)),t})),Ct&&(clearTimeout(q.current),q.current=setTimeout((function(){zt(),Kt()}),me.e+1))}),[Kt,zt,Ln,Hn,Ct]);(0,f.useEffect)((function(){var e=(0,Ve.U2)(Ln);e&&(0,G.Pb)(e)&&Hn(JSON.parse(e))}),[Ln,Hn]);var Vt=(0,f.useState)(null),Xt=Vt[0],Qt=Vt[1],Jt=(0,f.useState)(!1),ei=Jt[0],ni=Jt[1],ri=(0,f.useState)(!1),li=ri[0],oi=ri[1],ui=(0,$t.dd)((function(){return(0,S.jsx)(Yt.Z,{centerOnScreen:!0,neutral:!0,onClick:pi,subtitle:"This pipeline may be open on another tab. Saving changes here could overwrite any changes made to this pipeline on a separate tab. Proceed with caution.",title:"Your pipeline may be stale.",width:34*w.iI})}),{},[],{background:!0,uuid:"stale_pipeline_message"}),si=(0,l.Z)(ui,2),ai=si[0],pi=si[1];function fi(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2?arguments[2]:void 0,i=(0,o.Z)({},zi.uM,e);null!=t&&t.addon&&(i.addon=null==t?void 0:t.addon),null!=t&&t.blockUUID&&(i.block_uuid=null==t?void 0:t.blockUUID),null!=t&&t.extension&&(i.extension=null==t?void 0:t.extension),be(!0),(0,al.u)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}(0,f.useEffect)((function(){var e=new BroadcastChannel("".concat(fe,"_pipeline_editor_tabs"));return e.addEventListener("message",(function(e){"new_tab_same_page_opened"===e.data&&oi(!0)})),e.postMessage("new_tab_same_page_opened"),function(){e.close()}}),[]),(0,f.useEffect)((function(){li&&(ai(),oi(!1))}),[li,ai]),(0,f.useEffect)((function(){var e;null!=et&&null!==(e=et.pipeline)&&void 0!==e&&e.updated_at&&Xt!==a()().utc().unix()&&Qt(a()(et.pipeline.updated_at).unix())}),[null==et||null===(c=et.pipeline)||void 0===c?void 0:c.updated_at,Xt]),(0,f.useEffect)((function(){Zn||fi(zi.cH.TREE,!1)}),[Zn]);var hi=(0,f.useCallback)((function(e,n,t){wn(!1),setTimeout((function(){return fi(e,n,t)}),1)}),[]),vi=(0,f.useRef)({}),mi=(0,f.useRef)({}),gi=(0,f.useRef)(null),bi=(0,f.useRef)({}),xi=(0,f.useRef)({}),ji=(0,f.useRef)({}),Zi=(0,f.useState)({}),yi=Zi[0],Pi=Zi[1],Ci=(0,f.useCallback)((function(e,n,t){var i=bi.current||{};bi.current=Po(Po({},i),{},(0,o.Z)({},e,Po(Po({},i[e]||{}),{},(0,o.Z)({},n,t))))}),[bi]),Oi=(0,f.useCallback)((function(e,n,t){var i=xi.current||{};xi.current=Po(Po({},i),{},(0,o.Z)({},e,Po(Po({},i[e]||{}),{},(0,o.Z)({},n,t))))}),[]),wi=(0,f.useCallback)((function(e,n,t){Ci(e,n,t),ni(!0)}),[Ci,ni]),_i=(0,f.useCallback)((function(e,n,t){Oi(e,n,t),ei||ni(!0)}),[ei,Oi,ni]),Si=(0,f.useCallback)((function(e){ji.current=Po(Po({},ji.current),e)}),[ji]),Ii=(0,f.useCallback)((function(e,n){Si((0,o.Z)({},e,n)),ni(!0)}),[Si,ni]),Ei=(0,f.useState)(null),Ti=Ei[0],Mi=Ei[1],Bi=(0,f.useState)([]),Di=Bi[0],Ai=Bi[1],Ri=(0,f.useState)([]),Ni=Ri[0],Li=Ri[1],Fi=(0,Ji.Z)(Y.ZP.data_providers.list,{},{revalidateOnFocus:!1},{delay:1e3,condition:(null==Di?void 0:Di.length)>=1}).data,Ui=null==Fi?void 0:Fi.data_providers,Hi=(0,Ji.Z)(Y.ZP.variables.pipelines.list,fe,{global_only:!0},{revalidateOnFocus:!1},{delay:zi.cH.VARIABLES===Zn?0:1e4}),Wi=Hi.data,Gi=Hi.mutate,Ki=null==Wi?void 0:Wi.variables,qi=(0,Ji.Z)(Y.ZP.secrets.list,{},{revalidateOnFocus:!1},{delay:zi.cH.SECRETS===Zn?0:1e4}),Vi=qi.data,Yi=qi.mutate,nr=null==Vi?void 0:Vi.secrets,tr=(0,f.useRef)({}),ir=(0,f.useCallback)((function(e){var n;ni(!0);var t=tr.current[e.uuid]||{},i=t.upstream_blocks;(null==e||null===(n=e.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(i=e.upstream_blocks),tr.current[e.uuid]=Po(Po(Po({},t),e),{},{configuration:Po(Po({},t.configuration),e.configuration),upstream_blocks:i})}),[ni,tr]),rr=(0,f.useCallback)((function(e,n,t){xn({block:{type:n,uuid:e},file:{path:t}})}),[]),lr=(0,di.Dp)(fe),or=(0,di.Q9)(lr,Di),cr=(0,f.useState)(or),sr=cr[0],dr=cr[1],pr=(0,f.useState)(),vr=pr[0],mr=pr[1],gr=(0,f.useState)(),br=gr[0],xr=gr[1],jr=(0,f.useState)(null),kr=jr[0],Zr=jr[1],yr=(0,jn.Z)(sr);(0,f.useCallback)((function(){un({upstreamBlocks:{block:null,values:[]}}),Vn({}),ni(!1),dn([]),Pn(null)}),[]);(0,f.useEffect)((function(){fe!==Jn&&(bi.current={},xi.current={})}),[fe,Jn]);var Pr=Y.ZP.block_outputs.detail(!On&&(null==kr?void 0:kr.type)!==b.tf.SCRATCHPAD&&(null==kr?void 0:kr.type)!==b.tf.CHART&&null!=kr&&kr.uuid?encodeURIComponent(null==kr?void 0:kr.uuid):null,{pipeline_uuid:fe}),Cr=Pr.data,Or=Pr.mutate,wr=(0,f.useMemo)((function(){return null==Cr?void 0:Cr.block_output}),[Cr]),_r=(0,f.useMemo)((function(){var e,n,t;return xt?null===(e=(0,L.sE)(null==wr?void 0:wr.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,G.kE)(br))})))||void 0===e?void 0:e.sample_data:null==wr||null===(n=wr.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[wr,xt,br]),Sr=Y.ZP.blocks.pipelines.analyses.detail(On?null:fe,(null==kr?void 0:kr.type)!==b.tf.SCRATCHPAD&&(null==kr?void 0:kr.type)!==b.tf.CHART&&(null==kr?void 0:kr.uuid)&&encodeURIComponent(null==kr?void 0:kr.uuid)),Ir=Sr.data,Er=Sr.mutate,Tr=(null==Ir||null===(s=Ir.analyses)||void 0===s?void 0:s[0])||{},Mr=Tr.insights,Br=void 0===Mr?{}:Mr,Dr=Tr.metadata,Ar=void 0===Dr?{}:Dr,Rr=Tr.statistics,Nr=void 0===Rr?{}:Rr;(0,f.useEffect)((function(){0===an.length&&(Er(),Or(),Gi())}),[Er,Or,Gi,an]),(0,f.useEffect)((function(){if(0===sr.length)Zr(null);else if((null==yr?void 0:yr.length)!==(null==sr?void 0:sr.length)&&(null==sr?void 0:sr.length)<(null==yr?void 0:yr.length)){var e=yr.findIndex((function(e){return e.uuid===(null==kr?void 0:kr.uuid)})),n=yr.length-1===e?e-1:e+1;Zr(yr[Math.max(0,n)])}}),[sr,yr,null==kr?void 0:kr.uuid]),(0,f.useEffect)((function(){var e;null!==(e=ln.upstreamBlocks)&&void 0!==e&&e.block&&(wn(!1),fi(zi.cH.TREE))}),[ln.upstreamBlocks]);var Lr,Fr=(0,Ji.Z)(Y.ZP.autocomplete_items.list,{},{refreshInterval:!1,revalidateOnFocus:!1},{condition:(null==Di?void 0:Di.length)>=1,delay:1e3}),Ur=Fr.data,Hr=Fr.mutate,Wr=null==Ur?void 0:Ur.autocomplete_items,Gr=(0,h.Db)((function(e){var n=e.uuid;return Y.ZP.widgets.pipelines.useDelete(encodeURIComponent(fe),encodeURIComponent(n))()}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var n=e.widget.uuid;Li((function(e){return(0,L.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),nt(),nl()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Se({errors:n,response:e}),null!=t&&t.block_uuid&&Vn((function(e){return Po(Po({},e),{},(0,o.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:ii.Gi.TEXT_PLAIN}}))))}))}})}}),Kr=(0,l.Z)(Gr,1)[0],zr=(0,f.useCallback)((function(e,n){var t,i=e||{},r=i.content,l=i.path;if(t=null!=n&&n.blockUUID?null==Di?void 0:Di.find((function(e){return e.uuid===(null==n?void 0:n.blockUUID)})):(0,jo.IO)(l,Di)){var u=t,c=u.type,s=u.uuid;_i(c,s,r),Ai((function(e){var n=null==e?void 0:e.findIndex((function(e){var n=e.type,t=e.uuid;return n===c&&t===s}));return n>=0&&(e[n].content=r),e})),Pi((function(e){return Po(Po({},e),{},(0,o.Z)({},c,Po(Po({},null==e?void 0:e[c]),{},(0,o.Z)({},s,Number(new Date)))))})),nt()}}),[Di,nt,_i]),qr=(0,f.useCallback)((function(e,n,t){Lr(e,Di.length,n,e.name,t)}),[Lr,Di.length]),Vr=(0,po.Z)(),Yr=Vr.renderApplications,Xr=Vr.startApplication,Qr=(0,f.useCallback)((function(e,n){n||(Xr(null,null,Xi.X9.ArcaneLibrary),Pn(null))}),[]),Jr=(0,f.useCallback)((function(){Pn(null)}),[]),$r=(0,ki.ZP)({addNewBlock:qr,blocks:Di,delayFetch:Sn?7e3:1e3,deleteWidget:Kr,fetchAutocompleteItems:Hr,fetchPipeline:nt,fetchVariables:Gi,onOpenFile:Qr,onSelectBlockFile:rr,onSelectFile:Jr,onUpdateFileSuccess:zr,openSidekickView:hi,pipeline:F,query:{include_pipeline_count:!0},sendTerminalMessage:Q,setDisableShortcuts:Ge,setSelectedBlock:Pn,showHiddenFilesSetting:!0,uuid:fe,widgets:Ni}),el=$r.browser,nl=($r.controller,$r.fetchFiles),tl=($r.filePaths,$r.files),il=($r.filesTouched,$r.menu,$r.openFile),rl=$r.search,ll=$r.selectedFilePath,ol=$r.tabs,ul=($r.versions,$r.versionsVisible,(0,h.Db)(Y.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var n=e.pipeline.uuid;ce.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),nl()},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}})),cl=(0,l.Z)(ul,1)[0],sl=(0,h.Db)(Y.ZP.pipelines.useUpdate(fe,{update_content:!0}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){ni(!1),nt().then((function(e){var n,t,i,r=e.pipeline,l=null===(n=F)||void 0===n||null===(t=n.blocks)||void 0===t?void 0:t.map((function(e){return e.uuid})),o=null==r||null===(i=r.blocks)||void 0===i?void 0:i.map((function(e){return e.uuid}));!(0,L.fS)(l||[],o||[])&&Ct&&setTimeout((function(){(0,Xl.h)()}),1)}))},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}}),pl=(0,l.Z)(sl,2),fl=pl[0],hl=pl[1].isLoading,vl=(0,f.useState)({}),ml=vl[0],gl=vl[1],bl=(0,f.useCallback)((function(e,n){var t,i=e||{},r=i.block,o=i.pipeline,u=void 0===o?{extensions:{}}:o,c=(n||{}).contentOnly,s={},a={},d={},p={};((null==u?void 0:u.blocks)||Di).forEach((function(e){var n,t,i,o=e.extension_uuid,u=e.type,f=e.uuid,h=null===(n=xi.current[u])||void 0===n?void 0:n[f];void 0===h&&(h=e.content);var v=null===(t=bi.current[u])||void 0===t?void 0:t[f];void 0===v&&(v=e.callback_content);var m=null,g=null===(i=qn[f])||void 0===i?void 0:i.filter((function(e){return!!e})),x=null==g?void 0:g.find((function(e){return e.error}));if(g&&(!le||null==an||!an.length)){var j=[],k=0;g.forEach((function(n){var t=n.data,i=n.type;(b.tf.SCRATCHPAD===e.type||x||"table"!==i&&null!=ml&&ml[null==e?void 0:e.uuid])&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(ho.Lz)?e:e.concat(n)}),[]),i===ii.Gi.TEXT_PLAIN&&(k+=(null==t?void 0:t.length)||0)),(!Kn||k<Kn+5)&&j.push(n))})),m=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"output_".concat(n)}}))}var Z=Po(Po({},e),{},{callback_content:v,content:h});null===m?delete Z.outputs:Z.outputs=m,(null==r?void 0:r.uuid)===f&&Object.entries(r).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];"object"==typeof i&&!Array.isArray(i)&&i?Object.entries(i).forEach((function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];Z[t]||(Z[t]={}),Z[t][i]=r})):Z[t]=i})),c?a[Z.uuid]={callback_content:Z.callback_content,content:Z.content,outputs:Z.outputs,uuid:Z.uuid}:[b.tf.EXTENSION].includes(u)?(s[o]||(s[o]=[]),s[o].push(Z)):b.tf.CALLBACK===u?d[Z.uuid]=Z:b.tf.CONDITIONAL===u?p[Z.uuid]=Z:a[Z.uuid]=Z}));var f=Po(Po({},null===(t=F)||void 0===t?void 0:t.extensions),null==u?void 0:u.extensions);Object.entries(s).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];f[t]||(f[t]={}),f[t].blocks=i}));var h=[],v=[],m=[];((null==u?void 0:u.blocks)||Di).forEach((function(e){var n=e.uuid,t=a[n],i=d[n],r=p[n];void 0!==t?h.push(t):void 0!==i?v.push(i):void 0!==r&&m.push(r)})),gl({});var g=Po(Po(Po({},F),u),{},{blocks:h,callbacks:v,conditionals:m,extensions:f,widgets:Ni.map((function(e){var n,t,i=ji.current[e.uuid],r=tr.current[e.uuid]||{};void 0===i&&(i=e.content);var l=null===(n=qn[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),o=null==l?void 0:l.find((function(e){return e.error}));if(l){var u=[];l.forEach((function(n){var t=n.data,i=n.type;(b.tf.SCRATCHPAD===e.type||o||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(ho.Lz)?e:e.concat(n)}),[])),u.push(n))})),t=u.map((function(n,t){return{text_data:JSON.stringify(n),variable_uuid:"".concat(e.uuid,"_").concat(t)}}))}return Po(Po(Po({},e),r),{},{configuration:Po(Po({},e.configuration),r.configuration),content:i,outputs:t})}))});return delete g.updated_at,fl({pipeline:g})}),[Di,Kn,qn,ml,F,an,le,fl,Ni]),xl=(0,f.useMemo)((function(){return(0,di.Rz)(F,{displayRelative:!0,isPipelineUpdating:hl,pipelineContentTouched:ei,pipelineLastSaved:Xt})}),[hl,F,ei,Xt]),jl=(0,$t.dd)((function(e){var n,t,i=e||{block:null,contentByBlockUUID:null},r=i.block,l=i.contentByBlockUUID,o=r||{type:null,uuid:null},u=o.type,c=o.uuid,s=Po({},r);l&&(s.content=null==l||null===(n=l.current)||void 0===n||null===(t=n[u])||void 0===t?void 0:t[c]);return(0,S.jsx)(se.BC,{children:(0,S.jsx)(bt,Po(Po({},e),{},{block:s,onChangeCodeBlock:_i,onClose:yl,pipeline:F,savePipelineContent:bl}))})}),{},[_i,F,bl],{background:!0,disableClickOutside:!0,disableCloseButton:!0,disableEscape:!0,uuid:"DataIntegrationModal/".concat(fe)}),kl=(0,l.Z)(jl,2),Zl=kl[0],yl=kl[1];(0,f.useEffect)((function(){if(bn){var e,n=(null==bn?void 0:bn.block)||{type:null,uuid:null},t=n.type,i=n.uuid,r=Di.find((function(e){var n=e.type,r=e.uuid;return n===t&&r===i}));if(r){if(Pn(r),null!=vi&&vi.current){var l,o=vi.current[(0,di.zv)(r)];null==o||null===(l=o.current)||void 0===l||l.scrollIntoView()}}else if(t===b.tf.CHART){var u=Ni.find((function(e){return e.uuid===i}));if(u&&(Pn(u),null!=mi&&mi.current)){var c,s=mi.current[u.uuid];null==s||null===(c=s.current)||void 0===c||c.scrollIntoView()}}else if(null!=bn&&null!==(e=bn.file)&&void 0!==e&&e.path){var a;il(null==bn||null===(a=bn.file)||void 0===a?void 0:a.path)}}}),[Di,il,bn,Pn,Ni]),(0,f.useEffect)((function(){var e,n,t=et,i=[],r=null===(e=F)||void 0===e?void 0:e.variables_dir,l=null===(n=F)||void 0===n?void 0:n.remote_variables_dir;null!=et&&et.hasOwnProperty("error")?"undefined"!==fe?i=[{label:"Check pipeline configuration file for any issues",onClick:function(){il("pipelines/".concat(fe,"/").concat(ke.dT.METADATA_YAML)),Se(null)}}]:t.error.displayMessage="There may be an issue with your pipeline’s configuration file. Please check to make sure it is valid. It can be found at /pipelines/[pipeline_uuid]/metadata.yaml.":null!=Fi&&Fi.hasOwnProperty("error")?t=Fi:(null!=r&&r.includes("None")||null!=l&&l.includes("None"))&&(t={error:{displayMessage:"The variables_dir (".concat(r,") or remote_variables_dir (").concat(l,")")+" might be configured incorrectly. Please make sure those properties have values interpolated correctly in your project’s metadata.yaml config file."}},i=[{label:"Check project configuration",onClick:function(){il("".concat(ke.dT.METADATA_YAML)),Te(null)}}]),(0,ye.bB)(t,Te,i)}),[et,Fi,il,null===(x=F)||void 0===x?void 0:x.remote_variables_dir,null===(j=F)||void 0===j?void 0:j.variables_dir,fe]);var Pl=(0,f.useMemo)((function(){var e=[],n=[];return Di.forEach((function(t){b.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[Di]),Cl=Pl.blocksInNotebook,Ol=Pl.blocksInSidekick,wl=(0,f.useCallback)((function(e,n){return bl({pipeline:{name:e,type:n}}).then((function(e){var t,i;if(null!=e&&null!==(t=e.data)&&void 0!==t&&t.pipeline){var r,l=e.data.pipeline.uuid;if(fe!==l)window.location.href="".concat(null==ce?void 0:ce.basePath,"/pipelines/").concat(l,"/edit");else nl(),n!==(null===(r=F)||void 0===r?void 0:r.type)&&nt(),(0,di.k1)(Cl,fe,l),(0,di.k1)(Ol,fe,l)}else null!=e&&null!==(i=e.data)&&void 0!==i&&i.error&&Se((function(e){return Po(Po({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){il("pipelines/".concat(fe,"/").concat(ke.dT.METADATA_YAML)),Se(null)}}]})}))}))}),[Cl,Ol,nl,nt,il,null===(k=F)||void 0===k?void 0:k.type,fe,ce,bl]),_l=(0,f.useState)(null),Sl=_l[0],Il=_l[1],El=(0,f.useState)(null),Tl=El[0],Ml=El[1],Bl=(0,f.useState)(null),Dl=Bl[0],Al=Bl[1],Rl=(0,f.useCallback)((function(e){return pt({pipeline_interaction:Po(Po({},ct),{},{blocks:null!=e&&e.blockInteractionsMapping?null==e?void 0:e.blockInteractionsMapping:Tl,interactions:Sl,permissions:null==Dl?void 0:Dl.map((function(e){var n=e.roles,t=e.triggers;return{roles:null==n?void 0:n.map((function(e){return"string"==typeof e?e:null==e?void 0:e.role})),triggers:null==t?void 0:t.map((function(e){return{schedule_interval:e.schedule_interval,schedule_type:e.schedule_type}}))}}))})})}),[Tl,Sl,Dl,ct,pt]),Nl=(0,h.Db)((function(e){var n=e.extension_uuid,t=e.force,i=e.type,r=e.uuid,l={};return i&&(l.block_type=i),n&&(l.extension_uuid=n),void 0!==t&&(l.force=t),Y.ZP.blocks.pipelines.useDelete(encodeURIComponent(fe),encodeURIComponent(r),l)()}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;if(Ai((function(e){return(0,L.oM)(e,e.findIndex((function(e){var n=e.type,r=e.uuid;return t===n&&i===r})))})),nt(),Pn(null),En){var r=Po({},Tl);delete r[i],Rl({blockInteractionsMapping:r}).then((function(e){var n=e.pipeline_interaction;return Ml(null==n?void 0:n.blocks)}))}},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Se({errors:n,response:e}),null!=t&&t.block_uuid&&Vn((function(e){return Po(Po({},e),{},(0,o.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:ii.Gi.TEXT_PLAIN}}))))}))}})}}),Ll=(0,l.Z)(Nl,1)[0],Fl=(0,$t.dd)((function(e){return(0,S.jsx)(Yt.Z,{centerOnScreen:!0,neutral:!0,onCancel:Wl,onClick:function(){return Kl(e)},subtitle:"Deleting this block is dangerous. Your block may have downstream dependencies that depend on this block. You can delete this block anyway and remove it as a dependency from downstream blocks.",title:"Your block has dependencies",width:34*w.iI})})),Ul=(0,l.Z)(Fl,2),Hl=Ul[0],Wl=Ul[1],Gl=(0,h.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,r="".concat(t,"/").concat(i);return n&&ke.JD[n]&&(r="".concat(r,".").concat(ke.JD[n].toLowerCase())),Y.ZP.blocks.useDelete(encodeURIComponent(r))()}),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){Hr(),nt()},onErrorCallback:function(e,n){Hl(),Se({displayMessage:e.exception,errors:n,response:e})}})}}),Kl=(0,l.Z)(Gl,1)[0],zl=(0,h.Db)(Y.ZP.kernels.useUpdate("__auto_detect"),{onSuccess:function(e){return(0,ye.wD)(e,{callback:function(){return J()},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}}),ql=(0,l.Z)(zl,1)[0],Vl=(0,f.useCallback)((function(){return ql({kernel:{action_type:"restart"}})}),[ql]),Yl=(0,f.useCallback)((function(){ql({kernel:{action_type:"interrupt"}}),dn([])}),[ql]),Ql=(0,h.Db)(Y.ZP.blocks.pipelines.useCreate(fe)),Jl=(0,l.Z)(Ql,1)[0];Lr=(0,f.useCallback)((function(e,n,t){var i,o,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,G.Y6)(),c=arguments.length>4?arguments[4]:void 0;e.converted_from_type&&e.converted_from_uuid&&(i=null===(o=xi.current[e.converted_from_type])||void 0===o?void 0:o[e.converted_from_uuid]);var s=e.language,a=e.type;if(xt){var d,p=(0,L.HK)((null===(d=F)||void 0===d?void 0:d.blocks)||[],(function(e){return e.type})),f=p[b.tf.DATA_EXPORTER],h=p[b.tf.DATA_LOADER],v=p[b.tf.TRANSFORMER];if(b.tf.DATA_LOADER===a){if(b.t6.YAML!==s)return void Se({displayMessage:"The source you’re trying to add must contain the language ".concat(b.t6.YAML," and not ").concat(s,".")});var m;if(h)return void Se({displayMessage:"Pipeline ".concat(null===(m=F)||void 0===m?void 0:m.uuid," already has a source: ").concat(null==h?void 0:h.uuid,".")})}else if(b.tf.TRANSFORMER===a){var g;if(v)return void Se({displayMessage:"Pipeline ".concat(null===(g=F)||void 0===g?void 0:g.uuid," already has a transformer: ").concat(null==v?void 0:v.uuid,".")})}else if(b.tf.DATA_EXPORTER===a){if(b.t6.YAML!==s)return void Se({displayMessage:"The destination you’re trying to add must contain the language ".concat(b.t6.YAML," and not ").concat(s,".")});var x;if(f)return void Se({displayMessage:"Pipeline ".concat(null===(x=F)||void 0===x?void 0:x.uuid," already has a destination: ").concat(null==f?void 0:f.uuid,".")})}}var j=function(){return Jl({block:Po({content:i,name:u,priority:n,require_unique_name:!0},e)}).then((function(n){(0,ye.wD)(n,{callback:function(){var e,i,o=n.data.block;(null==t||t(o),Ct&&null!=ne&&ne(null==te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)&&(0,fo.eM)())?null===(e=window)||void 0===e||null===(i=e.location)||void 0===i||i.reload():(null!=c&&c.disableFetchingFiles||nl(),nt().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;Ai((function(e){var n=(0,r.Z)(t);Object.entries(i||{}).forEach((function(e){var t=(0,l.Z)(e,2),i=t[0],o=t[1].blocks;o&&n.push.apply(n,(0,r.Z)(o.map((function(e){return Po(Po({},e),{},{extension_uuid:i})}))))}));var o=(0,L.HK)(e,(function(e){return e.uuid})),u=[];return n.forEach((function(e){var n=o[e.uuid];n?u.push(n):u.push(e)})),u}))})))},onErrorCallback:function(n,t){var i,r=null==n||null===(i=n.error)||void 0===i?void 0:i.exception,l=(0,jo.u$)(Po(Po({},e),{},{name:u}));r&&l&&r.startsWith(ci.LR)?Se((function(){return{errors:t,links:[{label:"View existing block file contents.",onClick:function(){il(l),Se(null)}}],response:n}})):Se({errors:t,response:n})}})}))};return Ct&&null!=ne&&ne(null==te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)?bl().then((function(){return j()})):j()}),[Jl,ne,null==te?void 0:te.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW,nl,nt,xt,il,F,bl,Ct]);var $l=(0,$t.dd)((function(e){var n=e.block,t=e.idx,i=e.isReplacingBlock,r=void 0!==i&&i,l=e.isUpdatingBlock,o=void 0!==l&&l,u=e.name,c=void 0===u?(0,G.Y6)():u,s=e.onCreateCallback;return(0,S.jsx)(se.BC,{children:(0,S.jsx)(mn,{block:n,defaultName:c,isReplacingBlock:r,isUpdatingBlock:o,onClose:to,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o||r){var i,l=n.detach||!1;bl({block:{color:(null==e?void 0:e.color)||null,detach:l,name:null==e?void 0:e.name,uuid:n.uuid},pipeline:{blocks:(null===(i=F)||void 0===i?void 0:i.blocks)||[]}}).then((function(){Pn(null),to()}))}else Lr(Po(Po({},n),(0,Tn.gR)(e,["name"])),t,s,null==e?void 0:e.name).then((function(){return to()}))},pipeline:F})})}),{},[Lr,F],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),eo=(0,l.Z)($l,2),no=eo[0],to=eo[1],io=(0,$t.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,r=e.onSaveSuccess;return(0,S.jsx)(se.BC,{children:(0,S.jsx)(hr.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null==i||i(),oo()},onSaveSuccess:function(e){ie(),oo(),null==r||r(e)}})})}),{},[ie],{background:!0,uuid:"configure_project"}),ro=(0,l.Z)(io,2),lo=ro[0],oo=ro[1],uo=(0,h.Db)(Y.ZP.widgets.pipelines.useCreate(fe)),yo=(0,l.Z)(uo,1)[0],Co=(0,f.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,G.Y6)();return yo({widget:Po({name:i,priority:n,type:b.tf.CHART},e)}).then((function(e){return(0,ye.wD)(e,{callback:function(){var n=e.data.widget;null==t||t(n),nl(),nt(),fi(zi.cH.CHARTS),De(n)},onErrorCallback:function(e,n){return Se({errors:n,response:e})}})}))}),[nl,nt,yo]);(0,f.useEffect)((function(){if(Be){var e,n=null===(e=mi.current[Be.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),De(null))}}),[Be,De]),(0,f.useEffect)((function(){Jn!==fe&&(Ai([]),Li([]),dr([]),Qn([]))}),[fe,Jn]),(0,f.useEffect)((function(){var e,n;if(void 0!==(null===(e=F)||void 0===e?void 0:e.blocks)||void 0!==(null===(n=F)||void 0===n?void 0:n.extensions)){var t,i,o,u,c,s,a,d,p=[];if(void 0!==(null===(t=F)||void 0===t?void 0:t.blocks))p.push.apply(p,(0,r.Z)(null===(c=F)||void 0===c?void 0:c.blocks));if(void 0!==(null===(i=F)||void 0===i?void 0:i.callbacks))p.push.apply(p,(0,r.Z)(null===(s=F)||void 0===s?void 0:s.callbacks));if(void 0!==(null===(o=F)||void 0===o?void 0:o.conditionals))p.push.apply(p,(0,r.Z)(null===(a=F)||void 0===a?void 0:a.conditionals));if(void 0!==(null===(u=F)||void 0===u?void 0:u.extensions))Object.entries((null===(d=F)||void 0===d?void 0:d.extensions)||{}).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1].blocks;i&&p.push.apply(p,(0,r.Z)(i.map((function(e){return Po(Po({},e),{},{extension_uuid:t})}))))}));Ai(p)}}),[null===(Z=F)||void 0===Z?void 0:Z.blocks,null===(P=F)||void 0===P?void 0:P.callbacks,null===(O=F)||void 0===O?void 0:O.conditionals,null===(_=F)||void 0===_?void 0:_.extensions]),(0,f.useEffect)((function(){var e;void 0!==(null===(e=F)||void 0===e?void 0:e.widgets)&&Li(F.widgets)}),[null===(I=F)||void 0===I?void 0:I.widgets]),(0,f.useEffect)((function(){(null==or?void 0:or.length)>0&&0===(null==sr?void 0:sr.length)&&(dr(or),Zr(or[0]))}),[sr,or]);var Oo=(0,jn.Z)(Di);(0,f.useEffect)((function(){var e;if(!je&&(void 0!==(null===(e=F)||void 0===e?void 0:e.blocks)&&(!Di.length||!(0,L.fS)(null==Oo?void 0:Oo.map((function(e){return e.uuid})).sort(),null==Di?void 0:Di.map((function(e){return e.uuid})).sort())||(0,Tn.Qr)(qn)))){var n=(0,di.Rt)(F.blocks),t=n.content,i=n.messages;xi.current=t,(0,Tn.Qr)(i)||Vn((function(e){return Po(Po({},i),e)})),Ze(!0)}}),[Di,Oo,je,qn,null===(E=F)||void 0===E?void 0:E.blocks,Ze,Vn]),(0,f.useEffect)((function(){var e;if(!Ni.length&&void 0!==(null===(e=F)||void 0===e?void 0:e.widgets)){var n=(0,di.Rt)(F.widgets),t=n.content,i=n.messages;ji.current=t,Vn((function(e){return Po(Po({},i),e)}))}}),[null===(B=F)||void 0===B?void 0:B.widgets,Vn,Ni]),(0,f.useEffect)((function(){if(yn&&!hn){var e=Di.find((function(e){var n,t=e.uuid;return(null==yn||null===(n=yn.split(":"))||void 0===n?void 0:n[0])===t}));e&&(qt((function(n){return Po(Po({},n),{},(0,o.Z)({},e.uuid,!1))})),rr(e.uuid,e.type,null))}else(null==Oo?void 0:Oo.length)!==(null==Di?void 0:Di.length)&&hn&&(qt((function(e){return Po(Po({},e),{},(0,o.Z)({},hn.uuid,!1))})),rr(hn.uuid,hn.type,null))}),[yn,Di,null==Oo?void 0:Oo.length,rr,hn,qt]);var wo=(0,f.useMemo)((function(){return new g.Z}),[]),_o=(0,f.useMemo)((function(){return{api_key:mo.lG,token:wo.decodedToken.token}}),[wo]),So=(0,d.ZP)((0,ko.Ib)(),{onClose:function(){return(0,fo.eM)((function(){return console.log("socketUrlPublish closed")}))},onMessage:function(e){if(e){var n=JSON.parse(e.data),t=n.block_type,i=n.execution_state,l=n.msg_type,u=n.pipeline_uuid,c=n.uuid;if(!c&&!u)return;var s=Di.find((function(e){var n=e.type,i=e.uuid;return t===n&&c===i}));"stream_pipeline"!==l?Vn((function(e){var t=e[c]||[];return Po(Po({},e),{},(0,o.Z)({},c,t.concat(n)))})):(Qn((function(e){return[].concat((0,r.Z)(e),[n])})),ii.uF.IDLE===i&&(dn([]),nt(),c||tn(!1))),ii.uF.BUSY===i?dn((function(e){return e.find((function(e){var n=e.uuid;return c===n}))||!s?e:e.concat(s)})):ii.uF.IDLE===i&&dn((function(e){return e.filter((function(e){var n=e.uuid;return c!==n}))})),Gn||ni(!0)}},onOpen:function(){return(0,fo.eM)((function(){return console.log("socketUrlPublish opened")}))},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return(0,fo.eM)((function(){return console.log("Attempting to reconnect...")})),!0}}).sendMessage,Io=(0,f.useCallback)((function(){bl().then((function(){tn(!0),Qn([]),So(JSON.stringify(Po(Po({},_o),{},{execute_pipeline:!0,pipeline_uuid:fe})))}))}),[fe,bl,So,_o]),Eo=(0,f.useCallback)((function(){So(JSON.stringify(Po(Po({},_o),{},{cancel_pipeline:!0,pipeline_uuid:fe})))}),[fe,So,_o]),To=(0,f.useCallback)((function(){So(JSON.stringify(Po(Po({},_o),{},{cancel_pipeline:!0,pipeline_uuid:fe,skip_publish_message:!0})))}),[fe,So,_o]),Mo=(0,f.useCallback)((function(){So(JSON.stringify(Po(Po({},_o),{},{check_if_pipeline_running:!0,pipeline_uuid:fe})))}),[fe,So,_o]);(0,f.useEffect)((function(){var e;return window.addEventListener("pagehide",To),null==ce||null===(e=ce.events)||void 0===e||e.on("routeChangeStart",To),function(){var e;null==ce||null===(e=ce.events)||void 0===e||e.off("routeChangeStart",To),window.removeEventListener("pagehide",To)}}),[To,null==ce?void 0:ce.events]);var Bo=(0,f.useCallback)((function(e,n){var t=e.block,i=e.code,r=e.ignoreAlreadyRunning,l=e.runDownstream,u=void 0!==l&&l,c=e.runIncompleteUpstream,s=void 0!==c&&c,a=e.runSettings,d=void 0===a?{}:a,p=e.runTests,f=void 0!==p&&p,h=e.runUpstream,v=e.variables,m=t.extension_uuid,g=t.upstream_blocks,b=t.uuid;if(!an.find((function(e){var n=e.uuid;return b===n}))||r){var x,j,k="".concat(vo.vF,"_").concat(null===(x=F)||void 0===x?void 0:x.uuid);So(JSON.stringify(Po(Po({},_o),{},{code:i,extension_uuid:m,output_messages_to_logs:!!(0,Ve.U2)(k),pipeline_uuid:null===(j=F)||void 0===j?void 0:j.uuid,run_downstream:u,run_incomplete_upstream:s,run_settings:d,run_tests:f,run_upstream:h,type:t.type,upstream_blocks:g,uuid:b,variables:v}))),Vn((function(e){return delete e[b],e})),Ne(!1),dn((function(e){return e.find((function(e){var n=e.uuid;return b===n}))?e:e.concat(t)})),gl((function(e){return Po(Po({},e),{},(0,o.Z)({},null==t?void 0:t.uuid,!0))}))}null!=n&&n.skipUpdating||nt()}),[nt,F,an,So,Vn,dn,Ne,_o]),Do=(0,f.useCallback)((function(e,n){var t,i=e.block;return Gn||null!=n&&n.skipUpdating?Bo(e,n):null===(t=bl({block:{outputs:[],uuid:i.uuid}},{contentOnly:!0}))||void 0===t?void 0:t.then((function(){return Bo(e)}))}),[Gn,Bo,bl]),Ao=(0,$t.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,S.jsx)(se.BC,{children:(0,S.jsx)(M.Z,{contained:!0,defaultLinkUUID:i,onClickCustomTemplate:function(e){t({config:{custom_template:e,custom_template_uuid:null==e?void 0:e.template_uuid}}),Lo()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[ee.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),Ro=(0,l.Z)(Ao,2),No=Ro[0],Lo=Ro[1],Fo=(0,Ji.Z)(Y.ZP.global_data_products.list,{},{revalidateOnFocus:!1},{delay:(null==Di?void 0:Di.length)>=1?3e3:1e4}).data,Uo=(0,f.useMemo)((function(){return(null==Fo?void 0:Fo.global_data_products)||[]}),[Fo]),Ho=(0,$t.dd)((function(e){var n=e.addNewBlock;return(0,S.jsx)(se.BC,{children:(0,S.jsx)(At.Z,{children:(0,S.jsx)(Tt.Z,{globalDataProducts:Uo,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null==e?void 0:e.uuid}},type:b.tf.GLOBAL_DATA_PRODUCT}),Ko()}})})})}),{},[Uo],{background:!0,uuid:"global_data_products"}),Wo=(0,l.Z)(Ho,2),Go=Wo[0],Ko=Wo[1],zo=(0,f.useRef)(null),qo=(0,f.useState)(null),Vo=qo[0],Yo=qo[1],Xo=(0,f.useMemo)((function(){return zi.cH.INTERACTIONS===Zn}),[Zn]);(0,f.useEffect)((function(){var e,n;Zn&&null!=zo&&zo.current&&Yo(null==zo||null===(e=zo.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),[Zn,On,ae,En,zo]),(0,f.useEffect)((function(){!Sl&&(null==st?void 0:st.length)>=1&&Il((0,L.HK)(st||[],(function(e){return e.uuid})))}),[st,Sl,Il]),(0,f.useEffect)((function(){!Tl&&null!=ct&&ct.blocks&&Ml(null==ct?void 0:ct.blocks)}),[Tl,ct,Ml]);var Qo=(0,f.useMemo)((function(){return(0,S.jsx)(co,{activeView:Zn,addNewBlockAtIndex:function(e,n,t,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(){return no({block:e,idx:n,isReplacingBlock:r,name:i,onCreateCallback:t})}))},afterWidth:Ce,autocompleteItems:Wr,blockInteractionsMapping:Tl,blockRefs:vi,blocks:Di,blocksInNotebook:Cl,cancelPipeline:Eo,chartRefs:mi,checkIfPipelineRunning:Mo,containerHeightOffset:Xo?Vo+1:null,contentByBlockUUID:xi,createInteraction:mt,deleteBlock:Ll,deleteWidget:Kr,editingBlock:ln,executePipeline:Io,fetchFileTree:nl,fetchPipeline:nt,fetchSecrets:Yi,fetchVariables:Gi,globalDataProducts:Uo,globalVariables:Ki,insights:Br,interactions:st,interactionsMapping:Sl,interruptKernel:Yl,isLoadingCreateInteraction:gt,isLoadingUpdatePipelineInteraction:ft,isPipelineExecuting:nn,isPipelineUpdating:hl,lastTerminalMessage:X,messages:qn,metadata:Ar,onChangeCallbackBlock:wi,onChangeChartBlock:Ii,onChangeCodeBlock:_i,onSelectBlockFile:rr,onUpdateFileSuccess:zr,permissions:Dl,pipeline:F,pipelineInteraction:ct,pipelineMessages:Xn,project:re,refAfterFooter:zo,runBlock:Do,runningBlocks:an,sampleData:_r,savePipelineContent:bl,savePipelineInteraction:Rl,secrets:nr,selectedBlock:hn,selectedFilePath:ll,sendTerminalMessage:Q,setActiveSidekickView:fi,setAllowCodeBlockShortcuts:qe,setAnyInputFocused:Ue,setBlockInteractionsMapping:Ml,setDisableShortcuts:Ge,setEditingBlock:un,setErrors:Se,setHiddenBlocks:qt,setInteractionsMapping:Il,setPermissions:Al,setSelectedBlock:Pn,setTextareaFocused:Ne,showBrowseTemplates:No,showDataIntegrationModal:Zl,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,G.Y6)(),t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise((function(){return no({block:e,isReplacingBlock:t,isUpdatingBlock:!t,name:n})}))},sideBySideEnabled:Ct,statistics:Nr,textareaFocused:Re,treeRef:gi,updatePipelineInteraction:pt,updatePipelineMetadata:wl,updateWidget:ir,widgets:Ni})}),[Zn,Vo,Ce,Wr,Tl,vi,Di,Cl,Eo,Mo,xi,mt,Ll,Kr,ln,Io,nl,nt,Yi,Gi,Uo,Ki,Br,st,Sl,Yl,gt,ft,nn,hl,Xo,X,qn,Ar,wi,Ii,_i,rr,zr,Dl,F,ct,Xn,re,zo,Do,an,_r,bl,Rl,nr,hn,ll,Q,Ue,Ml,un,Se,qt,Il,Al,Pn,Ne,no,No,Zl,Ct,Nr,Re,pt,wl,ir,Ni]),Jo=(0,f.useMemo)((function(){return ve?(0,S.jsx)(so,{activeView:Zn,pipeline:F,project:re,secrets:nr,selectedBlock:hn,setSelectedBlock:Pn,variables:Ki}):(0,S.jsx)(Et.Z,{children:ol})}),[Zn,ol,Ki,ve,F,re,nr,hn,Pn]),$o=(0,$t.dd)((function(e){var n=e.blockIndex;return(0,S.jsx)(se.BC,{children:(0,S.jsx)(en,{contained:!0,defaultBlockType:b.tf.DBT,onClickAction:function(e){var t;Lr((0,di.J8)({blockIndex:n,blocks:Di,filePath:null==e||null===(t=e.row)||void 0===t?void 0:t.fullPath,repoPathRelativeRoot:null==oe?void 0:oe.repo_path_relative_root}),(null==n?null==Di?void 0:Di.length:n+1)-(Ct?1:0),(function(e){Pn(e),tu()}))}})})}),{},[Lr,Ct,oe],{background:!0,disableClickOutside:!1,disableCloseButton:!1,disableEscape:!0,uuid:"BlockBrowser/".concat(fe)}),eu=(0,l.Z)($o,2),nu=eu[0],tu=eu[1],iu=(0,f.useCallback)((function(e,n,t,i){return new Promise((function(){var r;fn.L.BLOCK_FILE!==(null==e||null===(r=e.block_action_object)||void 0===r?void 0:r.object_type)&&(b.tf.DBT!==(null==e?void 0:e.type)||b.t6.SQL!==(null==e?void 0:e.language)||null!=e&&e.block_action_object)?no({block:e,idx:n,name:i,onCreateCallback:t}):Lr(e,n,t,i)}))}),[Lr,no]),ru=(0,f.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,G.Y6)();return new Promise((function(){return no({block:e,isUpdatingBlock:!0,name:n})}))}),[no]),lu=(0,f.useCallback)((function(e,n){var t=n.onCreateCallback;return Co(e,Ni.length,t)}),[Co,Ni]),ou=(0,f.useMemo)((function(){return(0,S.jsx)(ur,{addNewBlockAtIndex:iu,addWidget:lu,afterHidden:On,allBlocks:Di,allowCodeBlockShortcuts:ze,anyInputFocused:Fe,autocompleteItems:Wr,beforeHidden:Sn,blockInteractionsMapping:Tl,blockRefs:vi,blocks:Cl,blocksThatNeedToRefresh:yi,dataProviders:Ui,deleteBlock:Ll,disableAutosave:Ht,disableShortcuts:We,fetchFileTree:nl,fetchPipeline:nt,fetchSampleData:Or,files:tl,globalDataProducts:Uo,globalVariables:Ki,hiddenBlocks:Un,hideOutputOnExecution:Nt,interactionsMapping:Sl,interruptKernel:Yl,mainContainerRef:Wn,mainContainerWidth:Ti,messages:qn,onChangeCallbackBlock:wi,onChangeCodeBlock:_i,openSidekickView:hi,pipeline:F,pipelineContentTouched:ei,restartKernel:Vl,runBlock:Do,runningBlocks:an,savePipelineContent:bl,scrollTogether:St,selectedBlock:hn,setAnyInputFocused:Ue,setDisableShortcuts:Ge,setEditingBlock:un,setErrors:Se,setHiddenBlocks:qt,setIntegrationStreams:mr,setOutputBlocks:dr,setPipelineContentTouched:ni,setScrollTogether:Bt,setSelectedBlock:Pn,setSelectedOutputBlock:Zr,setSelectedStream:xr,setSideBySideEnabled:Dt,setTextareaFocused:Ne,showBlockBrowserModal:nu,showBrowseTemplates:No,showConfigureProjectModal:lo,showDataIntegrationModal:Zl,showGlobalDataProducts:Go,showUpdateBlockModal:ru,sideBySideEnabled:Ct,textareaFocused:Re,widgets:Ni})}),[iu,lu,On,ze,Fe,Wr,Sn,vi,Tl,Di,Cl,yi,Ui,Ll,Ht,We,nl,nt,Or,tl,Uo,Ki,Nt,Un,Sl,Yl,Wn,Ti,qn,wi,_i,hi,F,ei,Vl,Do,an,bl,St,hn,Ue,un,Se,qt,ni,Pn,Ne,Dt,Bt,nu,No,lo,Zl,Go,ru,Ct,Re,Ni]),uu=(0,f.useMemo)((function(){if(W===ci.b7)return(0,S.jsx)(It,{cancelPipeline:Eo,createPipeline:cl,disableAutosave:Ht,executePipeline:Io,hideOutputOnExecution:Nt,interruptKernel:Yl,isPipelineExecuting:nn,pipeline:F,restartKernel:Vl,savePipelineContent:bl,scrollTogether:St,setMessages:Vn,setScrollTogether:Bt,setSideBySideEnabled:Dt,sideBySideEnabled:Ct,toggleDisableAutosave:Gt,toggleHideOutputOnExecution:Ft,updatePipelineMetadata:wl})}),[Eo,cl,Ht,Io,Nt,Yl,nn,W,F,Vl,bl,St,Vn,Bt,Dt,Ct,Gt,Ft,wl]),cu=(0,f.useCallback)((function(e){e.widthOffset;if(W===ci.b7)return(0,S.jsx)(er.rK,{relativePosition:!0,children:(0,S.jsxs)(ti,{isBusy:an.length>=1,pipeline:F,restartKernel:Vl,savePipelineContent:bl,setErrors:Se,setRunningBlocks:dn,updatePipelineMetadata:wl,children:[(0,S.jsx)(C.Z,{pr:1}),uu]})})}),[uu,W,F,Vl,an,bl,Se,wl]),su=(0,f.useMemo)((function(){var e;if(W===ci.b7)return(0,S.jsx)(ao.Z,{pipelineContentTouched:ei,pipelineLastSaved:Xt,pipelineType:null===(e=F)||void 0===e?void 0:e.type,ref:z,saveStatus:xl,width:Ti})}),[Ti,W,F,ei,Xt,xl]),au=(0,f.useMemo)((function(){var e;return null==vr||null===(e=vr.filter((function(e){return(0,L.sE)(null==wr?void 0:wr.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat((0,G.kE)(e))}))})))||void 0===e?void 0:e.map((function(e){return(0,S.jsx)(C.Z,{pl:1,children:(0,S.jsx)(on.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return xr(e)},selected:br===e,uuid:e,children:e})},e)}))}),[wr,vr,br]),du=(0,f.useMemo)((function(){return(0,S.jsx)(T,{blockRefs:vi,hiddenBlocks:Un,pipeline:F,setHiddenBlocks:qt})}),[vi,Un,F,qt]),pu=(0,f.useMemo)((function(){return ci.Jf.uuid===(null==An?void 0:An.uuid)?(0,S.jsxs)(S.Fragment,{children:[rl,el]}):ci.IY.uuid===(null==An?void 0:An.uuid)?du:null}),[du,el,rl,An]),fu=(0,f.useMemo)((function(){return(0,S.jsx)(C.Z,{px:1,children:(0,S.jsx)(de.Z,{noPadding:!0,onClickTab:function(e){Nn(e)},selectedTabUUID:null==An?void 0:An.uuid,tabs:ci.NR,underlineColor:(ue||U.Z).accent.purple,underlineStyle:!0})})}),[Nn,An,ue]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mt.Z,{title:null===(D=F)||void 0===D?void 0:D.name}),(0,S.jsxs)(fr,{after:Qo,afterHeader:Jo,afterHeightOffset:H.Mz-1,afterHidden:On,afterInnerHeightMinus:zi.cH.INTERACTIONS===Zn?Vo:null,afterNavigationItems:xo({activeView:Zn,pipeline:F,project:re,secrets:nr,setActiveSidekickView:fi,variables:Ki}),afterOverflow:zi.cH.DATA===Zn?"hidden":null,afterSubheader:(null==sr?void 0:sr.length)>0&&Zn===zi.cH.DATA&&(0,S.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!xt&&sr.map((function(e){var n=e.uuid,t=(null==kr?void 0:kr.uuid)===n;return(0,S.jsx)(C.Z,{pl:1,children:(0,S.jsx)(on.ZP,{afterElement:t?(0,S.jsx)(ge.ZP,{basic:!0,highlightOnHover:!0,onClick:function(){(0,di.h8)(fe,e.uuid),dr((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,S.jsx)(N.Close,{muted:!0,size:1.25*w.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return Zr(e)},selected:t,uuid:n,children:n})},n)})),xt&&au]}),before:pu,beforeDraggableTopOffset:H.Mz+ar.Wi,beforeHeader:fu,beforeHeightOffset:H.Mz,beforeHidden:Sn,beforeNavigationItems:(0,bo.H)(go.M.EDIT,F),errors:Ee||_e,footerOffset:null==z||null===(A=z.current)||void 0===A||null===(R=A.getBoundingClientRect())||void 0===R?void 0:R.height,mainContainerFooter:su,mainContainerHeader:cu,mainContainerRef:Wn,page:W,pipeline:F,setAfterHidden:wn,setAfterWidthForChildren:Oe,setBeforeHidden:In,setErrors:Ee?Te:Se,setMainContainerWidth:Mi,children:[(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(fe),children:ou}),(0,S.jsx)(C.Z,{pb:Ct?0:Math.max(Math.floor(ae*(2/3)/w.iI),0)})]}),!re||null!=ne&&ne(null==te?void 0:te.COMMAND_CENTER)?null:Yr()]})}Co.getInitialProps=function(){var e=(0,i.Z)(c().mark((function e(n){var t,i,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,i=ci.b7,r={page:i,pipeline:{uuid:t}},e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var Oo=(0,vr.Z)(Co)},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(10946)}])}},function(e){e.O(0,[9774,3662,125,2714,1799,7849,140,2996,449,8095,4241,4168,8023,523,4982,3548,3366,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|