mage-ai 0.9.32__py3-none-any.whl → 0.9.34__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/api/constants.py +37 -2
- mage_ai/api/errors.py +9 -5
- mage_ai/api/middleware.py +2 -2
- mage_ai/api/mixins/__init__.py +0 -0
- mage_ai/api/mixins/result_set.py +65 -0
- mage_ai/api/operations/base.py +41 -11
- mage_ai/api/operations/constants.py +7 -6
- mage_ai/api/parsers/BaseParser.py +6 -4
- mage_ai/api/parsers/PipelineScheduleParser.py +36 -2
- mage_ai/api/policies/BackfillPolicy.py +1 -0
- mage_ai/api/policies/BasePolicy.py +229 -40
- mage_ai/api/policies/PermissionPolicy.py +17 -0
- mage_ai/api/policies/PipelineSchedulePolicy.py +18 -2
- mage_ai/api/policies/RolePermissionPolicy.py +2 -1
- mage_ai/api/policies/RolePolicy.py +3 -0
- mage_ai/api/policies/SessionPolicy.py +36 -1
- mage_ai/api/policies/StatusPolicy.py +46 -3
- mage_ai/api/policies/UserPolicy.py +25 -2
- mage_ai/api/policies/mixins/__init__.py +0 -0
- mage_ai/api/policies/mixins/user_permissions.py +241 -0
- mage_ai/api/presenters/PermissionPresenter.py +35 -8
- mage_ai/api/presenters/RolePresenter.py +29 -12
- mage_ai/api/presenters/StatusPresenter.py +11 -0
- mage_ai/api/presenters/UserPresenter.py +21 -24
- mage_ai/api/resources/BaseResource.py +24 -9
- mage_ai/api/resources/BlockResource.py +3 -2
- mage_ai/api/resources/DatabaseResource.py +2 -2
- mage_ai/api/resources/PermissionResource.py +65 -3
- mage_ai/api/resources/Resource.py +8 -1
- mage_ai/api/resources/RolePermissionResource.py +23 -0
- mage_ai/api/resources/RoleResource.py +75 -4
- mage_ai/api/resources/StatusResource.py +34 -0
- mage_ai/api/resources/UserResource.py +35 -4
- mage_ai/api/result_set.py +8 -1
- mage_ai/authentication/permissions/constants.py +78 -0
- mage_ai/data_integrations/destinations/constants.py +1 -0
- mage_ai/data_integrations/utils/config.py +9 -0
- mage_ai/data_integrations/utils/scheduler.py +16 -7
- mage_ai/data_preparation/models/block/__init__.py +56 -16
- mage_ai/data_preparation/models/block/data_integration/mixins.py +92 -1
- mage_ai/data_preparation/models/block/data_integration/utils.py +5 -5
- mage_ai/data_preparation/models/block/integration/__init__.py +12 -7
- mage_ai/data_preparation/models/block/sql/__init__.py +5 -2
- mage_ai/data_preparation/models/block/sql/utils/shared.py +15 -1
- mage_ai/data_preparation/models/pipelines/interactions.py +15 -0
- mage_ai/data_preparation/shared/secrets.py +7 -17
- mage_ai/data_preparation/templates/data_exporters/streaming/google_cloud_pubsub.yaml +5 -0
- mage_ai/data_preparation/templates/repo/metadata.yaml +5 -0
- mage_ai/io/druid.py +9 -5
- mage_ai/io/mssql.py +52 -30
- mage_ai/io/postgres.py +1 -0
- mage_ai/io/sql.py +15 -1
- mage_ai/orchestration/db/models/oauth.py +181 -17
- mage_ai/orchestration/db/models/schedules.py +11 -0
- mage_ai/presenters/interactions/constants.py +1 -0
- mage_ai/presenters/pages/loaders/pipeline_schedules.py +9 -3
- mage_ai/server/api/base.py +16 -6
- mage_ai/server/api/v1.py +2 -1
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/PBVuphyo_muEAj347ZP_b/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1124-d8fc76201b83b376.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{1749-9ec0f4709f5a9284.js → 1749-a6bdce4ee8a09bce.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1769-613e23e361eb5bce.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1821-953efd0da290d25f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2327-1a797c758f8b064a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2677-a85c5a72bb695304.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3419-6c8ec8db8c398c12.js → frontend_dist/_next/static/chunks/3419-0df6c5ef72f2e672.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3684-e1a713b7c16f0151.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3859-3501cdba0a33f9f2.js → frontend_dist/_next/static/chunks/3859-ba594d21a1260cd2.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4636-84f545d1d238df13.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/4839-963da65cea58054f.js → frontend_dist/_next/static/chunks/4839-e5fe343a369734bc.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5457-97433bc45b42a88a.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/5499-63667ad5a785dba5.js → frontend_dist/_next/static/chunks/5499-b74459f6be5f9229.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6043-6ea109833b88eb1d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/6333-ca4cd6a73a597a40.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7022-80d082a1d7fd1234.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7361-25f211ef377e5958.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/8013-1d6b1f7c13264cb4.js → frontend_dist/_next/static/chunks/8013-e67c71ddea072a20.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8146-941c5155c3bfcc35.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9161-837b653aa849a76f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9264-5730e4e059db40a8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-752d991f239a128f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{block-layout-a624972d126a3dbd.js → block-layout-a27a28d2a615e364.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-98e27a4d7bd0da47.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/{[...slug]-a95787fe1695f493.js → [...slug]-9eb5dad57da13efd.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-0d55711df91a78d0.js → global-data-products-26909dec66f00231.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-b9eea6abc676ca81.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-11c601c6ef07fe86.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-ae6083077c9c1c41.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-bfce0ee677d57206.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-476c921d62f565fc.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/overview-9bc34ef66d84330a.js → frontend_dist/_next/static/chunks/pages/overview-2ec6b17e45a52be8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-605918f3a5c1aac4.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-84ec3ab0770bcd68.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ee65a62ed166bd85.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-2402004a19a6ad53.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-9a5b4768a640cd68.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-8781db69f19759a1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-d7fd4857579e2b00.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-bd4bd009146bab36.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-234007c99efdccf6.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-8405a83adeaa8ff5.js → block-runs-da7510d4b277e47b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runtime-98aa0840a00cc661.js → block-runtime-eae853ff34b09481.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-0fb48e1cc51f78b2.js → monitors-a057b17847b82468.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-845c1f010d5ec380.js → [run]-99d11c86f8b15369.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-9255f85760e1f57a.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-3f0980d8810a540b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{settings-187ac359020704e1.js → settings-9edf75d03460aaeb.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-c52d0c49439ec620.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-e7692e54979f037d.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-7b3b57523b226a0e.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-cb6a3bcaf4fa1a81.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-5eff96c149584e87.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{pipelines-efc080913a247e99.js → pipelines-270b912e1ac189b5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-2058d022972cdea4.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/[...slug]-1a95628ea8d0d846.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions-cb1cdf5f8e5bf9c5.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-58978256db4efbda.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/[...slug]-9ddd7eb842d5a911.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles-1694c5eb1acbcf30.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-6850e854fbedbb61.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/[...slug]-5061c073e1c0de07.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-f551c5665bfd3494.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-6fe3657070f98aca.js → frontend_dist/_next/static/chunks/pages/sign-in-e779dbab123e626e.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-935113d252ada806.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/templates-25b6d24cfa81c306.js → frontend_dist/_next/static/chunks/pages/templates-7079d637e396f2a8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-67fdb4a3be93aa14.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-9c0374c7c783b34a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-ea3a0d48e5822b42.js +1 -0
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/files.html +2 -2
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-data-products.html +2 -2
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +2 -2
- mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist/manage/users.html +2 -2
- mage_ai/server/frontend_dist/manage.html +2 -2
- mage_ai/server/frontend_dist/overview.html +2 -2
- mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +2 -2
- mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +24 -0
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +24 -0
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +24 -0
- mage_ai/server/frontend_dist/settings/workspace/roles.html +24 -0
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +24 -0
- mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +5 -5
- mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist/templates.html +2 -2
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +2 -2
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/L-IKw5_bRZUs-wyjnpN_j/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1124-d8fc76201b83b376.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1749-9ec0f4709f5a9284.js → 1749-a6bdce4ee8a09bce.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1769-613e23e361eb5bce.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1821-953efd0da290d25f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2327-1a797c758f8b064a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2677-a85c5a72bb695304.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3419-6c8ec8db8c398c12.js → frontend_dist_base_path_template/_next/static/chunks/3419-0df6c5ef72f2e672.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3684-e1a713b7c16f0151.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3859-3501cdba0a33f9f2.js → frontend_dist_base_path_template/_next/static/chunks/3859-ba594d21a1260cd2.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4636-84f545d1d238df13.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/4839-963da65cea58054f.js → frontend_dist_base_path_template/_next/static/chunks/4839-e5fe343a369734bc.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-97433bc45b42a88a.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/5499-63667ad5a785dba5.js → frontend_dist_base_path_template/_next/static/chunks/5499-b74459f6be5f9229.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6043-6ea109833b88eb1d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-ca4cd6a73a597a40.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7022-80d082a1d7fd1234.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-25f211ef377e5958.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/8013-1d6b1f7c13264cb4.js → frontend_dist_base_path_template/_next/static/chunks/8013-e67c71ddea072a20.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-941c5155c3bfcc35.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9161-837b653aa849a76f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-5730e4e059db40a8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-752d991f239a128f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{block-layout-a624972d126a3dbd.js → block-layout-a27a28d2a615e364.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-98e27a4d7bd0da47.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/{[...slug]-a95787fe1695f493.js → [...slug]-9eb5dad57da13efd.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-0d55711df91a78d0.js → global-data-products-26909dec66f00231.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-b9eea6abc676ca81.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-11c601c6ef07fe86.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-ae6083077c9c1c41.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-bfce0ee677d57206.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-476c921d62f565fc.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/overview-9bc34ef66d84330a.js → frontend_dist_base_path_template/_next/static/chunks/pages/overview-2ec6b17e45a52be8.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-605918f3a5c1aac4.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-84ec3ab0770bcd68.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ee65a62ed166bd85.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-2402004a19a6ad53.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-9a5b4768a640cd68.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-8781db69f19759a1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-d7fd4857579e2b00.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-bd4bd009146bab36.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-234007c99efdccf6.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-8405a83adeaa8ff5.js → block-runs-da7510d4b277e47b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runtime-98aa0840a00cc661.js → block-runtime-eae853ff34b09481.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-0fb48e1cc51f78b2.js → monitors-a057b17847b82468.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-845c1f010d5ec380.js → [run]-99d11c86f8b15369.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-9255f85760e1f57a.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-3f0980d8810a540b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{settings-187ac359020704e1.js → settings-9edf75d03460aaeb.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-c52d0c49439ec620.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-e7692e54979f037d.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-7b3b57523b226a0e.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-cb6a3bcaf4fa1a81.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-5eff96c149584e87.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{pipelines-efc080913a247e99.js → pipelines-270b912e1ac189b5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-2058d022972cdea4.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/[...slug]-1a95628ea8d0d846.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions-cb1cdf5f8e5bf9c5.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-58978256db4efbda.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/[...slug]-9ddd7eb842d5a911.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles-1694c5eb1acbcf30.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-6850e854fbedbb61.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/[...slug]-5061c073e1c0de07.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-f551c5665bfd3494.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/sign-in-6fe3657070f98aca.js → frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-e779dbab123e626e.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-935113d252ada806.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/templates-25b6d24cfa81c306.js → frontend_dist_base_path_template/_next/static/chunks/pages/templates-7079d637e396f2a8.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-67fdb4a3be93aa14.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-9c0374c7c783b34a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-ea3a0d48e5822b42.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/overview.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +13 -13
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/templates.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/terminal.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/test.html +4 -4
- mage_ai/server/frontend_dist_base_path_template/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/version-control.html +5 -5
- mage_ai/server/server.py +37 -2
- mage_ai/services/aws/__init__.py +19 -8
- mage_ai/services/spark/config.py +5 -1
- mage_ai/services/spark/spark.py +5 -4
- mage_ai/settings/__init__.py +2 -0
- mage_ai/streaming/constants.py +1 -0
- mage_ai/streaming/sinks/google_cloud_pubsub.py +66 -0
- mage_ai/streaming/sinks/sink_factory.py +6 -0
- mage_ai/tests/api/operations/test_operations.py +8 -2
- mage_ai/tests/api/operations/test_pipeline_schedules.py +3 -0
- mage_ai/tests/data_preparation/models/block/sql/utils/test_shared.py +130 -5
- mage_ai/tests/factory.py +2 -0
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +20 -3
- mage_ai/tests/streaming/sinks/test_google_cloud_pubsub.py +28 -0
- mage_ai/usage_statistics/logger.py +4 -1
- {mage_ai-0.9.32.dist-info → mage_ai-0.9.34.dist-info}/METADATA +1 -1
- {mage_ai-0.9.32.dist-info → mage_ai-0.9.34.dist-info}/RECORD +302 -268
- mage_ai/api/policies/utils.py +0 -14
- mage_ai/server/frontend_dist/_next/static/cbN7L4Ms6UUPoANozEh9w/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1769-e2efd4df8d09481f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2327-2d8a1555605cf4af.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2369-cb9cd97052e18d27.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2677-aea54e655c4a727f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5457-994e1044953f1425.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5597-c034402ee26af3b4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6333-d1f8db4e7d9656a5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6648-9bd31397f1d1b551.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9161-0101571a3635a938.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9264-7c4fcfed1200046a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9696-3e8ab7786f0e3a0e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-976b488b8aea327f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-1a6c6654bfc953ac.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-49004d918b04c866.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-97177740fbb6eb9f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-5b6411c9eb8c4ba4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-0a7a746cc0998608.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-606012a580245001.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-0801de3c9a2976ea.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-0a5865d4cf012127.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-87b1a0601c4236cd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-77ffaa2d721a0a4e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-4e72d40881ac0605.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-8da8f8e2fdb1c99f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-be029347e99fcea2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-d4b07df78b3d6037.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-87c492e9edc6064e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-2ab9f3d0c50cce81.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-0ba40243a030ddf4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-28a3a43d65074394.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1769-e2efd4df8d09481f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2327-2d8a1555605cf4af.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2369-cb9cd97052e18d27.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2677-aea54e655c4a727f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-994e1044953f1425.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5597-c034402ee26af3b4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-d1f8db4e7d9656a5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6648-9bd31397f1d1b551.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9161-0101571a3635a938.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-7c4fcfed1200046a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9696-3e8ab7786f0e3a0e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-976b488b8aea327f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-1a6c6654bfc953ac.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-49004d918b04c866.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-97177740fbb6eb9f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-5b6411c9eb8c4ba4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-0a7a746cc0998608.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-606012a580245001.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-0801de3c9a2976ea.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-0a5865d4cf012127.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-87b1a0601c4236cd.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-77ffaa2d721a0a4e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-4e72d40881ac0605.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-8da8f8e2fdb1c99f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-be029347e99fcea2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-d4b07df78b3d6037.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-87c492e9edc6064e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-2ab9f3d0c50cce81.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-0ba40243a030ddf4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-28a3a43d65074394.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/o_Yc57jh8Te2SI-VoipGQ/_buildManifest.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{cbN7L4Ms6UUPoANozEh9w → PBVuphyo_muEAj347ZP_b}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{o_Yc57jh8Te2SI-VoipGQ → L-IKw5_bRZUs-wyjnpN_j}/_ssgManifest.js +0 -0
- {mage_ai-0.9.32.dist-info → mage_ai-0.9.34.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.32.dist-info → mage_ai-0.9.34.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.32.dist-info → mage_ai-0.9.34.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.32.dist-info → mage_ai-0.9.34.dist-info}/top_level.txt +0 -0
mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-87b1a0601c4236cd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551,5810,3859],{7432:function(e,n,t){var i={"./Active4D.json":[266,266],"./All Hallows Eve.json":[4450,4450],"./Amy.json":[88849,8849],"./Birds of Paradise.json":[78097,8097],"./Blackboard.json":[88018,6115],"./Brilliance Black.json":[73835,3835],"./Brilliance Dull.json":[6507,6507],"./Chrome DevTools.json":[22508,2508],"./Clouds Midnight.json":[49566,9566],"./Clouds.json":[57951,7951],"./Cobalt.json":[80826,826],"./Cobalt2.json":[98256,8256],"./Dawn.json":[76958,6958],"./Dominion Day.json":[89307,9307],"./Dracula.json":[33453,3453],"./Dreamweaver.json":[19363,9363],"./Eiffel.json":[82481,2481],"./Espresso Libre.json":[44776,4776],"./GitHub Dark.json":[792,792],"./GitHub Light.json":[61450,1450],"./GitHub.json":[10739,739],"./IDLE.json":[67947,7947],"./Katzenmilch.json":[81240,1240],"./Kuroir Theme.json":[4388,4388],"./LAZY.json":[25164,5164],"./MagicWB (Amiga).json":[76443,6443],"./Merbivore Soft.json":[99361,9361],"./Merbivore.json":[86042,6042],"./Monokai Bright.json":[14883,4883],"./Monokai.json":[34454,4454],"./Night Owl.json":[60261,261],"./Nord.json":[59785,9785],"./Oceanic Next.json":[58920,8920],"./Pastels on Dark.json":[38901,8901],"./Slush and Poppies.json":[26434,6434],"./Solarized-dark.json":[36116,6116],"./Solarized-light.json":[5008,5008],"./SpaceCadet.json":[20440,440],"./Sunburst.json":[68018,8018],"./Textmate (Mac Classic).json":[15824,5824],"./Tomorrow-Night-Blue.json":[81150,1150],"./Tomorrow-Night-Bright.json":[8762,8762],"./Tomorrow-Night-Eighties.json":[82545,2545],"./Tomorrow-Night.json":[99855,9855],"./Tomorrow.json":[34092,4092],"./Twilight.json":[93898,3898],"./Upstream Sunburst.json":[98807,8807],"./Vibrant Ink.json":[89927,9927],"./Xcode_default.json":[64042,4042],"./Zenburnesque.json":[33467,3467],"./iPlastic.json":[88277,8277],"./idleFingers.json":[5104,5104],"./krTheme.json":[9633,9633],"./monoindustrial.json":[15729,5729],"./themelist.json":[79437,9437]};function o(e){if(!t.o(i,e))return Promise.resolve().then((function(){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}));var n=i[e],o=n[0];return t.e(n[1]).then((function(){return t.t(o,19)}))}o.keys=function(){return Object.keys(i)},o.id=7432,e.exports=o},65557:function(e,n,t){"use strict";var i=t(21831),o=t(75582),r=t(82684),l=t(80329);n.Z=function(e){var n=e.children,t=e.uuid,u=e.uuids,c=void 0===u?[]:u,a=(0,l.j)("apiReloads"),s=(0,o.Z)(a,1)[0],d=(0,i.Z)(c);t&&d.push(t);var p=d.map((function(e){return String(s[e])||"-"})).join("_");return r.cloneElement(n,{key:p})}},89209:function(e,n,t){"use strict";t.d(n,{M4:function(){return d},S0:function(){return a},S_:function(){return c},Yn:function(){return p},rW:function(){return s}});var i=t(82394),o=t(21831),r=t(75582);function l(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 u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function c(e,n){return Object.entries(n).map((function(n){var t=(0,r.Z)(n,2),i=t[0],o=t[1];return e.languages.registerCompletionItemProvider(i,{provideCompletionItems:o(e)})}))}function a(e){var n=function(e){var n="[\\w.]+",t=["import ".concat(n," as ").concat(n),"import ".concat(n),"from ".concat(n," import ").concat(n," as ").concat(n),"from ".concat(n," import ").concat(n)],i=new RegExp("(".concat(t.join("|"),")"),"g");return(0,o.Z)(e.matchAll(i)).map((function(e){return e[1]}))}(e),t="[\\w.]+",r=["from ".concat(t," import ").concat(t," as (").concat(t,")"),"from ".concat(t," import (").concat(t,")"),"import ".concat(t," as (").concat(t,")"),"import (".concat(t,")")],l=new RegExp("(".concat(r.join("|"),")"));return n.reduce((function(e,n){var t=n.match(l);if(!t)return e;var r=(0,o.Z)(t),c=r[2],a=r[3],s=r[4],d=r[5],p=c||a||s||d;return u(u({},e),{},(0,i.Z)({},p,n))}),{})}function s(e,n){var t=e;n&&(t=t.split(" as ".concat(n))[0]);var i="[\\w.]+",l=["from ".concat(i," import (").concat(i,")"),"import (".concat(i,")")],u=new RegExp("(".concat(l.join("|"),")"),"g"),c=(0,o.Z)(t.matchAll(u))[0];if(c){var a=(0,r.Z)(c,4),s=a[2],d=a[3];return s||d}}function d(e,n){return function(e,n){return e.split("\n")[n.startLineNumber-1]}(e,n).slice(0,n.startColumn-1)}function p(e){var n=new RegExp("([\\w_]+)[ ]*=[ ]*([\\w_]+)","g");return(0,o.Z)(e.matchAll(n)).map((function(e){return{assignmentValue:e[2],variableName:e[1]}}))}},89678:function(e,n,t){"use strict";t.d(n,{Ep:function(){return u},KT:function(){return s},Nk:function(){return a},aU:function(){return c}});var i=t(38626),o=t(44897),r=t(95363),l=t(70515),u=2,c=21,a=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-w2hta3-0"})(["font-family:",";"," ",""],r.ry,(function(e){return e.padding&&"\n padding-top: ".concat(2*l.iI,"px;\n background-color: ").concat((e.theme.background||o.Z.background).codeTextarea,";\n ")}),(function(e){return e.hideDuplicateMenuItems&&'\n /*\n * The (n + 10) assumes a specific number of items in the block editor context\n * menu. This includes "Run selected block", "Change All Occurrences", "Cut",\n * "Copy", "Paste", "Command Palette", and 3 dividers. The 10th item from the\n * bottom and higher are hidden to avoid duplicate shortcut items in the\n * context menu.\n */\n .monaco-menu li.action-item:nth-last-child(n + 10) {\n display: none;\n }\n '})),s=i.default.div.withConfig({displayName:"indexstyle__PlaceholderStyle",componentId:"sc-w2hta3-1"})(["padding-left:67px;position:absolute;z-index:1;"])},75810:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var i=t(82684),o=t(85202),r=t(38789),l=t(44425),u=t(30160),c=t(98464),a="twilight",s=t(95363),d=t(61896),p=t(89678),f=t(89209);function v(e,n,t){t.forEach((function(e){n.addAction(e)}))}var h=t(75582),m={"all-hallows-eve":"All Hallows Eve","birds-of-paradise":"Birds of Paradise","brilliance-black":"Brilliance Black","brilliance-dull":"Brilliance Dull","chrome-devtools":"Chrome DevTools","clouds-midnight":"Clouds Midnight","espresso-libre":"Espresso Libre","kuroir-theme":"Kuroir Theme","magicwb--amiga-":"MagicWB (Amiga)","merbivore-soft":"Merbivore Soft","monokai-bright":"Monokai Bright","night-owl":"Night Owl","oceanic-next":"Oceanic Next","pastels-on-dark":"Pastels on Dark","slush-and-poppies":"Slush and Poppies","solarized-dark":"Solarized-dark","solarized-light":"Solarized-light","textmate--mac-classic-":"Textmate (Mac Classic)","tomorrow-night":"Tomorrow-Night","tomorrow-night-blue":"Tomorrow-Night-Blue","tomorrow-night-bright":"Tomorrow-Night-Bright","tomorrow-night-eighties":"Tomorrow-Night-Eighties","upstream-sunburst":"Upstream Sunburst","vibrant-ink":"Vibrant Ink","xcode-default":"Xcode_default",active4d:"Active4D",amy:"Amy",blackboard:"Blackboard",clouds:"Clouds",cobalt:"Cobalt",dawn:"Dawn",dreamweaver:"Dreamweaver",eiffel:"Eiffel",github:"GitHub",idle:"IDLE",idlefingers:"idleFingers",iplastic:"iPlastic",katzenmilch:"Katzenmilch",krtheme:"krTheme",lazy:"LAZY",merbivore:"Merbivore",monoindustrial:"monoindustrial",monokai:"Monokai",spacecadet:"SpaceCadet",sunburst:"Sunburst",tomorrow:"Tomorrow",twilight:"Twilight",zenburnesque:"Zenburnesque"};var b=t(37529),g=t(28598);var x=function(e){var n=e.autocompleteProviders,x=e.autoHeight,j=e.autoSave,y=e.block,k=e.fontSize,Z=void 0===k?d.i3:k,P=e.height,O=e.language,w=e.onChange,C=e.onDidChangeCursorPosition,_=e.onSave,S=e.padding,I=e.placeholder,E=e.readOnly,T=e.selected,M=e.setSelected,D=e.setTextareaFocused,B=e.shortcuts,A=e.showLineNumbers,R=void 0===A||A,N=e.tabSize,L=void 0===N?4:N,F=e.textareaFocused,U=e.theme,H=e.value,z=e.width,W=void 0===z?"100%":z,G=(0,i.useRef)(null),K=(0,i.useRef)(null),V=(0,i.useRef)(null),q=(0,i.useState)([]),Y=q[0],Q=q[1],X=(0,i.useState)(null),J=X[0],$=X[1],ee=(0,i.useState)(!1),ne=ee[0],te=ee[1],ie=(0,i.useState)(U||a),oe=ie[0],re=ie[1],le=(0,i.useCallback)((function(e){e.languages.typescript.javascriptDefaults.setEagerModelSync(!0),$(e)}),[]),ue=(0,i.useCallback)((function(e,n){G.current=e,K.current=n;var t=[];null===B||void 0===B||B.forEach((function(i){t.push(i(n,e))})),_&&t.push((0,b.e)(n,(function(){_(e.getValue())}))),v(0,e,t),e.getModel().updateOptions({tabSize:L}),x&&!P&&(e._domElement.style.height="".concat(((H||"").split("\n").length+p.Ep)*p.aU,"px")),e.onDidFocusEditorWidget((function(){null===D||void 0===D||D(!0)})),e.onDidContentSizeChange((function(n){var t=n.contentHeight,i=n.contentHeightChanged;x&&i&&(e._domElement.style.height="".concat(t+2*p.aU,"px"))})),T&&F&&setTimeout((function(){e.focus()}),1),C&&e.onDidChangeCursorPosition((function(n){var t=n.position.lineNumber,i=e._domElement.getBoundingClientRect(),o=i.height,r=i.top,l=e.getTopForLineNumber(t);C({editorRect:{height:Number(o),top:Number(r)},position:{lineNumberTop:l}})})),te(!0)}),[x,P,C,_,T,te,M,D,B,L,F,H]);(0,i.useEffect)((function(){(function(e){return new Promise((function(n){Promise.all([r._m.init(),t(7432)("./".concat(m[e],".json"))]).then((function(t){var i=(0,h.Z)(t,2),o=i[0],r=i[1];r.colors["editor.background"]="#000000",r.colors["editor.foreground"]="#FFFFFF",o.editor.defineTheme(e,r),n()}))}))})(a).then((function(){re(a)}))}),[]),(0,i.useEffect)((function(){var e;return j&&_&&(e=setInterval((function(){_(G.current.getValue())}),5e3)),function(){j&&e&&clearInterval(e)}}),[j,G,_]);var ce=(0,c.Z)(T),ae=(0,c.Z)(F);return(0,i.useEffect)((function(){null!==G&&void 0!==G&&G.current&&(T&&F?setTimeout((function(){G.current.focus()}),1):o.findDOMNode(G.current._domElement).getElementsByClassName("inputarea")[0].blur())}),[G,T,ce,F,ae]),(0,i.useEffect)((function(){if(null!==K&&void 0!==K&&K.current&&null!==G&&void 0!==G&&G.current){var e=[];null===B||void 0===B||B.forEach((function(n){e.push(n(null===K||void 0===K?void 0:K.current,null===G||void 0===G?void 0:G.current))})),v(null===K||void 0===K||K.current,null===G||void 0===G?void 0:G.current,e)}}),[null===y||void 0===y?void 0:y.downstream_blocks,null===y||void 0===y?void 0:y.upstream_blocks]),(0,i.useEffect)((function(){return function(){Y.map((function(e){return e.dispose()}))}}),[Y]),(0,i.useEffect)((function(){J&&n&&(0===Y.length&&F||!ae&&F?Q((0,f.S_)(J,n)):ae&&!F&&Y.map((function(e){return e.dispose()})))}),[n,Y,J,F,ae]),(0,g.jsxs)(p.Nk,{hideDuplicateMenuItems:!0,padding:S,style:{display:ne?null:"none"},children:[I&&!(null!==H&&void 0!==H&&H.length)&&(0,g.jsx)(p.KT,{children:(0,g.jsx)(u.ZP,{monospace:!0,muted:!0,children:I})}),(0,g.jsx)(r.ZP,{beforeMount:le,height:P,language:O||"python",onChange:function(e){null===w||void 0===w||w(e)},onMount:ue,options:{domReadOnly:E,fontFamily:s.Vp,fontLigatures:!0,fontSize:Z,hideCursorInOverviewRuler:!0,lineNumbers:R,minimap:{enabled:!1},overviewRulerBorder:!1,readOnly:E,renderLineHighlightOnlyWhenFocus:!0,scrollBeyondLastLine:!1,scrollbar:{alwaysConsumeMouseWheel:!1,vertical:"hidden"},useShadowDOM:!1,wordBasedSuggestions:!1,wordWrap:(null===y||void 0===y?void 0:y.type)===l.tf.MARKDOWN?"on":"off"},theme:oe,value:H,width:W}),(0,g.jsx)("div",{ref:V})]})}},37529:function(e,n,t){"use strict";function i(e,n){return{contextMenuGroupId:"navigation",contextMenuOrder:1.5,id:"saveCode",keybindingContext:null,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],label:"Save",precondition:null,run:function(e){n()}}}function o(e,n){return{contextMenuGroupId:"navigation",contextMenuOrder:1.5,id:"executeCode",keybindingContext:null,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Enter],label:"Run selected block",precondition:null,run:function(){return n()}}}t.d(n,{Q:function(){return o},e:function(){return i}})},60523:function(e,n,t){"use strict";var i=t(21831),o=t(82394),r=t(82684),l=t(38626),u=t(34376),c=t(54750),a=t(71180),s=t(90299),d=t(44898),p=t(55485),f=t(88328),v=t(38276),h=t(4190),m=t(48381),b=t(5755),g=t(30160),x=t(35686),j=t(72473),y=t(84649),k=t(32929),Z=t(15610),P=t(19183),O=t(28598);function w(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?w(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n,t=e.contained,o=e.defaultLinkUUID,w=e.defaultTab,_=e.objectType,S=e.onClickCustomTemplate,I=e.pipelineUUID,E=e.showAddingNewTemplates,T=e.showBreadcrumbs,M=e.tabs,D=(0,u.useRouter)(),B=(0,r.useContext)(l.ThemeContext),A=(0,P.i)(),R=A.height,N=A.width,L=(0,r.useMemo)((function(){return M||k.dP}),[M]),F=(0,r.useState)(E||!1),U=F[0],H=F[1],z=(0,r.useState)(o?k.qy.find((function(e){return e.uuid===o})):k.qy[0]),W=z[0],G=z[1],K=(0,r.useState)(w?L.find((function(e){return e.uuid===(null===w||void 0===w?void 0:w.uuid)})):L[0]),V=K[0],q=K[1],Y=(0,r.useState)(null),Q=Y[0],X=Y[1],J=x.ZP.custom_templates.list({object_type:d.Z},{},{pauseFetch:k.n9.uuid!==(null===V||void 0===V?void 0:V.uuid)}),$=J.data,ee=J.mutate,ne=(0,r.useMemo)((function(){var e=(null===$||void 0===$?void 0:$.custom_templates)||[];return null!==W&&void 0!==W&&W.filterTemplates?null===W||void 0===W?void 0:W.filterTemplates(e):e}),[$,W]),te=x.ZP.custom_templates.list({object_type:d.R},{},{pauseFetch:k.A2.uuid!==(null===V||void 0===V?void 0:V.uuid)}),ie=te.data,oe=te.mutate,re=(0,r.useMemo)((function(){var e=(null===ie||void 0===ie?void 0:ie.custom_templates)||[];return null!==W&&void 0!==W&&W.filterTemplates?null===W||void 0===W?void 0:W.filterTemplates(e):e}),[ie,W]),le=(0,r.useMemo)((function(){return k.qy.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,o=e.selectedIconProps,r=e.uuid,l=(null===W||void 0===W?void 0:W.uuid)===r,u=C({size:y.ZG},l&&o?o:{});return(0,O.jsx)(y.wj,{onClick:function(){return G(e)},selected:l,children:(0,O.jsxs)(p.ZP,{alignItems:"center",children:[(0,O.jsx)(y.ze,{backgroundColor:l&&i?i(B):null,children:n?(0,O.jsx)(n,C({},u)):(0,O.jsx)(j.pd,C({},u))}),(0,O.jsx)(g.ZP,{bold:!0,large:!0,children:t?t():r})]})},r)}))}),[W,B]),ue=(0,r.useMemo)((function(){return k.hS.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,o=e.selectedIconProps,r=e.uuid,l=(null===W||void 0===W?void 0:W.uuid)===r,u=C({size:y.ZG},l&&o?o:{});return(0,O.jsx)(y.wj,{onClick:function(){return G(e)},selected:l,children:(0,O.jsxs)(p.ZP,{alignItems:"center",children:[(0,O.jsx)(y.ze,{backgroundColor:l&&i?i(B):null,children:n?(0,O.jsx)(n,C({},u)):(0,O.jsx)(j.pd,C({},u))}),(0,O.jsx)(g.ZP,{bold:!0,large:!0,children:t?t():r})]})},r)}))}),[W,B]),ce=(0,r.useMemo)((function(){return null===ne||void 0===ne?void 0:ne.map((function(e){var n=e.description,t=e.name,o=e.tags,r=e.template_uuid,l=e.user,u=[];return null!==o&&void 0!==o&&o.length?u.push.apply(u,(0,i.Z)(o)):null!==l&&void 0!==l&&l.username&&u.push(null===l||void 0===l?void 0:l.username),(0,O.jsxs)(y.UE,{onClick:function(){S?S(e):D.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(r)))},children:[(0,O.jsx)(y.Tj,{children:(0,O.jsx)(g.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||r})}),(0,O.jsx)(y.SL,{children:(0,O.jsx)(g.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,O.jsx)(y.EN,{children:(null===u||void 0===u?void 0:u.length)>=1&&(0,O.jsx)(m.Z,{tags:null===u||void 0===u?void 0:u.map((function(e){return{uuid:e}}))})})]},r)}))}),[ne,S,D]),ae=(0,r.useMemo)((function(){return null===re||void 0===re?void 0:re.map((function(e){var n=e.description,t=e.name,o=e.tags,r=e.template_uuid,l=e.user,u=[];return null!==o&&void 0!==o&&o.length?u.push.apply(u,(0,i.Z)(o)):null!==l&&void 0!==l&&l.username&&u.push(null===l||void 0===l?void 0:l.username),(0,O.jsxs)(y.UE,{onClick:function(){S?S(e):D.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(r),"?object_type=").concat(d.R))},children:[(0,O.jsx)(y.Tj,{children:(0,O.jsx)(g.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||r})}),(0,O.jsx)(y.SL,{children:(0,O.jsx)(g.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,O.jsx)(y.EN,{children:(null===u||void 0===u?void 0:u.length)>=1&&(0,O.jsx)(m.Z,{tags:null===u||void 0===u?void 0:u.map((function(e){return{uuid:e}}))})})]},r)}))}),[re,S,D]),se=(0,r.useMemo)((function(){if(!T)return null;var e=[];return U?e.push.apply(e,[{label:function(){return"Templates"},onClick:function(){H(!1)}},{bold:!0,label:function(){return"New custom template"}}]):e.push({label:function(){return"Templates"}}),(0,O.jsx)(y.FX,{children:(0,O.jsx)(c.Z,{breadcrumbs:e})})}),[U,T]),de=(0,r.useMemo)((function(){return T?36:0}),[T]),pe=(0,r.useMemo)((function(){return R-de}),[R,de]);if(U)return n=d.R===_&&I?(0,O.jsx)(f.Z,{onMutateSuccess:oe,pipelineUUID:I,templateAttributes:W&&(null===W||void 0===W?void 0:W.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{pipeline_type:null===W||void 0===W?void 0:W.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}):(0,O.jsx)(b.Z,{contained:t,heightOffset:de,onCreateCustomTemplate:t?function(e){X(e)}:null,onMutateSuccess:ee,templateAttributes:W&&(null===W||void 0===W?void 0:W.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{block_type:null===W||void 0===W?void 0:W.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}),t?(0,O.jsxs)(O.Fragment,{children:[T&&se,(0,O.jsx)(y.Rd,{height:pe,width:N,children:n})]}):n;var fe=(0,O.jsxs)(y.Nk,{children:[(0,O.jsxs)(y.bC,{height:t?pe:null,children:[(0,O.jsx)(y.Yf,{children:(0,O.jsx)(s.Z,{noPadding:!0,onClickTab:function(e){t?q(e):(0,Z.u7)({object_type:k.A2.uuid===e.uuid?d.R:d.Z})},selectedTabUUID:null===V||void 0===V?void 0:V.uuid,tabs:L})}),(0,O.jsxs)(y.wl,{contained:t,heightOffset:de,children:[k.n9.uuid===(null===V||void 0===V?void 0:V.uuid)&&le,k.A2.uuid===(null===V||void 0===V?void 0:V.uuid)&&ue]})]}),(0,O.jsxs)(y.w5,{children:[k.n9.uuid===(null===V||void 0===V?void 0:V.uuid)&&(0,O.jsx)(y.HS,{children:(0,O.jsx)(a.Z,{beforeIcon:(0,O.jsx)(j.mm,{size:y.ZG}),onClick:function(){H(!0)},primary:!0,children:"New block template"})}),k.n9.uuid===(null===V||void 0===V?void 0:V.uuid)&&(0,O.jsxs)(O.Fragment,{children:[!$&&(0,O.jsx)(v.Z,{p:2,children:(0,O.jsx)(h.Z,{inverted:!0})}),$&&!(null!==ce&&void 0!==ce&&ce.length)&&(0,O.jsxs)(v.Z,{p:2,children:[(0,O.jsx)(g.ZP,{children:"There are currently no templates matching your search."}),(0,O.jsx)("br",{}),(0,O.jsx)(g.ZP,{children:"Add a new template by clicking the button above."})]}),(null===ce||void 0===ce?void 0:ce.length)>=1&&(0,O.jsx)(y.n8,{children:ce})]}),k.A2.uuid===(null===V||void 0===V?void 0:V.uuid)&&(0,O.jsxs)(O.Fragment,{children:[!ie&&(0,O.jsx)(v.Z,{p:2,children:(0,O.jsx)(h.Z,{inverted:!0})}),ie&&!(null!==ae&&void 0!==ae&&ae.length)&&(0,O.jsxs)(v.Z,{p:2,children:[(0,O.jsx)(g.ZP,{children:"There are currently no templates matching your search."}),(0,O.jsx)("br",{}),(0,O.jsx)(g.ZP,{children:'Add a new template by right-clicking a pipeline row from the Pipelines page and selecting "Create template".'})]}),(null===ae||void 0===ae?void 0:ae.length)>=1&&(0,O.jsx)(y.n8,{children:ae})]})]})]});return t?(0,O.jsxs)(O.Fragment,{children:[T&&se,(0,O.jsx)(y.Rd,{height:pe,width:N,children:fe})]}):fe}},93859:function(e,n,t){"use strict";t.d(n,{r:function(){return I},Z:function(){return D}});var i=t(82394),o=t(21831),r=t(82684),l=t(48670),u=t(12691),c=t.n(u),a=t(38626),s=t(78141),d=t(44628),p=t(6508),f=t(55485),v=t(30160),h=t(44897),m=t(70987),b=function(){var e=document.createElement("div");e.setAttribute("style","width: 100px; height: 100px; overflow: scroll; position:absolute; top:-9999px;"),document.body.appendChild(e);var n=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),n},g=t(95363),x=t(61896),j=t(47041),y=t(48888),k=t(70515),Z=t(40489),P=t(86735),O=t(28598);function w(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?w(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var _=2*k.iI+x.dN,S=20*k.iI,I=8.7,E=a.default.div.withConfig({displayName:"DataTable__Styles",componentId:"sc-1arr863-0"})([""," "," "," .body > div{","}.table{border-spacing:0;display:inline-block;"," "," "," "," .tr{.td.td-index-column{","}}.th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;","}.th,.td{"," font-family:",";margin:0;","}.td{padding:","px;}&.sticky{overflow:auto;}.header{overflow:hidden;}}"],(function(e){return e.disableScrolling&&"\n overflow: hidden;\n "}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),j.w5,(function(e){return!e.noBorderBottom&&"\n border-bottom: 1px solid ".concat((e.theme.borders||m.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderLeft&&"\n border-left: 1px solid ".concat((e.theme.borders||m.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||m.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderTop&&"\n border-top: 1px solid ".concat((e.theme.borders||m.Z.borders).medium,";\n ")}),(function(e){return"\n color: ".concat((e.theme.content||m.Z.content).default,";\n ")}),(function(e){return"\n height: ".concat(e.columnHeaderHeight||_,"px;\n ")}),x.iD,g.ry,(function(e){return"\n background-color: ".concat((e.theme.background||m.Z.background).table,";\n border-bottom: 1px solid ").concat((e.theme.borders||m.Z.borders).medium,";\n border-right: 1px solid ").concat((e.theme.borders||m.Z.borders).medium,";\n ")}),1*k.iI);function T(e){var n=e.original,t=8.5*Math.max.apply(Math,(0,o.Z)(n.map((function(e){return(null===e||void 0===e?void 0:e.length)||0})))),i=Math.ceil(t/(S-2*k.iI));return Math.max(i,1)*x.dN+2*k.iI}function M(e){var n=e.columnHeaderHeight,t=e.columns,i=e.data,u=e.disableScrolling,j=e.height,w=e.index,E=e.invalidValues,M=e.maxHeight,D=e.numberOfIndexes,B=e.previewIndexes,A=e.renderColumnHeader,R=e.width,N=(0,r.useContext)(a.ThemeContext),L=(0,r.useRef)(null),F=(0,r.useRef)(null);(0,r.useEffect)((function(){var e=function(e){var n;null===L||void 0===L||null===(n=L.current)||void 0===n||n.scroll(e.target.scrollLeft,0)};return F&&F.current.addEventListener("scroll",e),function(){var n;null===F||void 0===F||null===(n=F.current)||void 0===n||n.removeEventListener("scroll",e)}}),[L,F]);var U=(0,r.useMemo)((function(){return w&&i&&w.length===i.length}),[i,w]),H=(0,r.useMemo)((function(){var e=[];return(0,P.w6)(D).forEach((function(n,t){var r=String(null===i||void 0===i?void 0:i.length).length*I;if(U){var l=w.map((function(e){return D>=2?String(e[t]).length:String(e).length}));r=Math.max.apply(Math,(0,o.Z)(l))*I}e.push(r+2*k.iI)})),e}),[i,w,D,U]),z=t.map((function(e){return null===e||void 0===e?void 0:e.Header})).slice(1),W=(0,r.useMemo)((function(){return b()}),[]),G=(0,r.useMemo)((function(){var e=R-(Math.max.apply(Math,(0,o.Z)(H))+1.5*k.iI+W),n=t.length-1,i=S;return i*n<e&&(i=e/n),{width:i}}),[t,H,W,R]),K=(0,d.useTable)({columns:t,data:i,defaultColumn:G},d.useBlockLayout,p.useSticky),V=K.getTableBodyProps,q=K.getTableProps,Y=K.headerGroups,Q=K.prepareRow,X=K.rows,J=(0,r.useCallback)((function(e){var n=e.index,t=e.style,i=new Set((null===B||void 0===B?void 0:B.removedRows)||[]),o=X[n];Q(o);var u=o.original,a=i.has(n);return(0,O.jsx)("div",C(C({},o.getRowProps({style:C(C({},t),{},{width:"auto"})})),{},{className:"tr",children:o.cells.map((function(e,t){var i,o=t<=D-1,s=e.getCellProps(),d=e.column.id,p=null===E||void 0===E||null===(i=E[d])||void 0===i?void 0:i.includes(n),h=C({},s.style);o&&(h.fontFamily=g.Vp,h.left=0,h.position="sticky",h.textAlign=w?"right":"center",h.width=H[t]);var b,x=u[t-D],j=z.indexOf(d);if(p&&(h.color=m.Z.interactive.dangerBorder),a&&(h.backgroundColor=m.Z.background.danger),Array.isArray(x)||"object"===typeof x)try{x=JSON.stringify(x)}catch(k){x="Error: cannot display value"}return o&&(U?(b=w[n],Array.isArray(b)&&(b=b[t])):b=e.render("Cell")),(0,r.createElement)("div",C(C({},s),{},{className:"td ".concat(o?"td-index-column":""),key:"".concat(t,"-").concat(x),style:h}),b,!o&&(0,O.jsxs)(f.ZP,{justifyContent:"space-between",children:[(0,O.jsxs)(v.ZP,{danger:p,default:!0,wordBreak:!0,children:[!0===x&&"true",!1===x&&"false",(null===x||"null"===x)&&"null",!0!==x&&!1!==x&&null!==x&&"null"!==x&&x]}),p&&(0,O.jsx)(c(),{as:(0,Z.o_)(y.mW,j),href:"/datasets/[...slug]",passHref:!0,children:(0,O.jsx)(l.Z,{danger:!0,children:"View all"})})]}))}))}))}),[z,w,E,H,D,Q,X,U,B]),$=(0,r.useMemo)((function(){var e;return M?(e=(0,P.Sm)(X.map(T)),e+=n||_-x.dN):(e=j,e-=n||_),e}),[n,j,M,X]),ee=(0,r.useMemo)((function(){return(0,O.jsx)(s.S_,{estimatedItemSize:_,height:$,itemCount:null===X||void 0===X?void 0:X.length,itemSize:function(e){return T(X[e])},outerRef:F,style:{maxHeight:M,pointerEvents:u?"none":null},children:J})}),[u,$,M,J,X]);return(0,O.jsx)("div",C(C({},q()),{},{className:"table sticky",style:{width:R},children:(0,O.jsxs)("div",C(C({},V()),{},{className:"body",children:[(0,O.jsx)("div",{className:"header",ref:L,children:Y.map((function(e,n){return(0,r.createElement)("div",C(C({},e.getHeaderGroupProps()),{},{className:"tr",key:"".concat(e.id,"_").concat(n)}),e.headers.map((function(e,n){var t,i=n<=D-1,o=e.getHeaderProps(),l=C({},o.style);return i?(l.fontFamily=g.Vp,l.left=0,l.position="sticky",l.textAlign="center",l.width=H[n],l.minWidth=H[n]):A?t=A(e,n-D,{width:G.width}):(t=e.render("Header"),l.color=(N||h.Z).content.default,l.padding=1*k.iI,l.minWidth=G.width),(0,r.createElement)("div",C(C({},o),{},{className:"th",key:e.id,style:l,title:i?"Row number":void 0}),t)})))}))}),ee]}))}))}var D=function(e){var n=e.columnHeaderHeight,t=e.columns,i=e.disableScrolling,o=e.height,l=e.index,u=e.invalidValues,c=e.maxHeight,a=e.noBorderBottom,s=e.noBorderLeft,d=e.noBorderRight,p=e.noBorderTop,f=e.previewIndexes,v=e.renderColumnHeader,h=e.rows,m=e.width,b=(0,r.useMemo)((function(){return null!==l&&void 0!==l&&l.length&&Array.isArray(l[0])?l[0].length:1}),[l]),g=(0,r.useMemo)((function(){return(0,P.w6)(b).map((function(e,n){return{Header:(0,P.w6)(n+1).map((function(){return" "})).join(" "),accessor:function(e,n){return n},sticky:"left"}})).concat(null===t||void 0===t?void 0:t.map((function(e){return{Header:String(e),accessor:String(e)}})))}),[t,b]),x=(0,r.useMemo)((function(){return(0,O.jsx)(M,{columnHeaderHeight:n,columns:g,data:h,disableScrolling:i,height:o,index:l,invalidValues:u,maxHeight:c,numberOfIndexes:b,previewIndexes:f,renderColumnHeader:v,width:m})}),[n,g,h,i,o,l,u,c,b,f,v,m]);return(0,O.jsx)(E,{columnHeaderHeight:n,disableScrolling:i,height:o,maxHeight:c?c+37:c,noBorderBottom:a,noBorderLeft:s,noBorderRight:d,noBorderTop:p,children:x})}},29618:function(e,n,t){"use strict";t.d(n,{Z:function(){return R}});var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(80329),c=t(69864),a=t(40761),s=t(44425),d=t(71180),p=t(38626),f=t(97618),v=t(55485),h=t(28598),m=p.default.div.withConfig({displayName:"ButtonGroup__ButtonGroupStyle",componentId:"sc-15vbmc8-0"})([""]),b=p.default.div.withConfig({displayName:"ButtonGroup__VerticalDivider",componentId:"sc-15vbmc8-1"})(["width:1px;"]),g=function(e){var n=e.children,t=e.divider,i=l.Children.toArray(n).length;return(0,h.jsx)(m,{children:(0,h.jsx)(v.ZP,{children:l.Children.map(n,(function(e,n){return e&&(0,h.jsxs)(f.Z,{children:[n>=1&&t&&(0,h.jsx)(b,{}),l.cloneElement(e,{borderRadiusLeft:i>=2&&0===n,borderRadiusRight:i>=2&&n===i-1,halfPaddingLeft:i>=2&&0!==n,halfPaddingRight:i>=2&&n!==i-1,noBorder:i>=2&&n>0&&n<i-1,noBorderRight:i>=2&&n!==i-1})]},"button-group-child-".concat(n))}))})})},x=t(75810),j=t(15135),y=t(93369),k=t(57653),Z=t(38276),P=t(35686),O=t(39643),w=t(11498),C=t(85385),_=t(68669),S=t(86735),I=t(53005),E=t(81728),T=t(72619),M=t(42041),D=t(44688);function B(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?B(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var R=function(e){var n=e.active,t=e.addNewBlock,p=e.disableRefreshWarning,f=e.fetchPipeline,m=e.fetchVariables,b=e.filePath,B=e.hideHeaderButtons,R=e.onContentChange,N=e.onUpdateFileSuccess,L=e.openSidekickView,F=e.pipeline,U=e.saveFile,H=e.selectedFilePath,z=e.sendTerminalMessage,W=e.setDisableShortcuts,G=e.setErrors,K=e.setFilesTouched,V=e.setSelectedBlock,q=(0,u.j)("apiReloads"),Y=(0,o.Z)(q,2)[1],Q=(0,l.useState)(null),X=Q[0],J=Q[1],$=(0,l.useState)(!1),ee=$[0],ne=($[1],(0,l.useRef)(null)),te=(0,l.useMemo)((function(){return new a.Z}),[]),ie=(0,l.useMemo)((function(){return{api_key:w.l,token:te.decodedToken.token}}),[te]),oe=P.ZP.statuses.list().data,re=(0,l.useMemo)((function(){var e,n;return null===oe||void 0===oe||null===(e=oe.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[oe]),le=P.ZP.file_contents.detail(b).data;(0,l.useEffect)((function(){null!==le&&void 0!==le&&le.file_content?J(le.file_content):null!==le&&void 0!==le&&le.error&&(0,T.h$)(le,{onErrorCallback:function(e,n){return G({errors:n,response:e})}})}),[le,G]);var ue=(0,l.useState)(null===X||void 0===X?void 0:X.content),ce=ue[0],ae=ue[1],se=(0,l.useCallback)((function(e){ae(e),R&&(null===R||void 0===R||R(e))}),[R]),de=(0,l.useState)(!1),pe=de[0],fe=de[1];(0,l.useEffect)((function(){n&&W&&(null===W||void 0===W||W(!0))}),[n,W]),(0,l.useEffect)((function(){var e;H&&(null===ne||void 0===ne||null===(e=ne.current)||void 0===e||e.scrollIntoView())}),[H]);var ve=(0,c.Db)(P.ZP.file_contents.useUpdate((null===X||void 0===X?void 0:X.path)&&encodeURIComponent(null===X||void 0===X?void 0:X.path)),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(e){var n=e.file_content;Y((function(e){return A(A({},e),{},(0,i.Z)({},"FileVersions/".concat(null===X||void 0===X?void 0:X.path),Number(new Date)))})),N&&(null===N||void 0===N||N(n))},onErrorCallback:function(e,n){return null===G||void 0===G?void 0:G({errors:n,response:e})}})}}),he=(0,o.Z)(ve,1)[0],me=(0,l.useCallback)((function(e,n){if(U)return U(e,n);he({file_content:A(A({},n),{},{content:e})}).then((function(){decodeURIComponent(b).split(r.sep).pop()===j.dT.METADATA_YAML&&m&&(null===m||void 0===m||m())})),K((function(e){return A(A({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))})),fe(!1)}),[m,b,U,K,he]),be=(0,l.useMemo)((function(){return(0,_.lU)()}),[]),ge=(0,l.useMemo)((function(){var e,n,t,i;return null===(null===X||void 0===X||null===(e=X.path)||void 0===e?void 0:e.match(be))?j.Lu.TXT:null===X||void 0===X||null===(n=X.path)||void 0===n||null===(t=n.match(be))||void 0===t||null===(i=t[0])||void 0===i?void 0:i.split(".")[1]}),[be,X]),xe=(0,l.useMemo)((function(){if(null!==X&&void 0!==X&&X.path)return(0,h.jsx)(x.Z,{autoHeight:!0,language:j.nB[ge],onChange:function(e){se(e),K((function(e){return A(A({},e),{},(0,i.Z)({},null===X||void 0===X?void 0:X.path,!0))})),fe(!0)},onSave:function(e){me(e,X)},selected:!0,textareaFocused:!0,value:(0,E.Pb)(null===X||void 0===X?void 0:X.content)?JSON.stringify(JSON.parse(null===X||void 0===X?void 0:X.content),null,2):null===X||void 0===X?void 0:X.content,width:"100%"})}),[X,ge,me,se,K]),je=null!==F&&void 0!==F&&F.blocks?(0,S.sE)(null===F||void 0===F?void 0:F.blocks,(function(e){var n=e.type;return s.tf.DATA_EXPORTER===n})):null,ye=(0,c.Db)(P.ZP.blocks.pipelines.useUpdate(null===F||void 0===F?void 0:F.uuid,null===je||void 0===je?void 0:je.uuid),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(){null===f||void 0===f||f()}})}}),ke=(0,o.Z)(ye,1)[0],Ze=t&&F&&(ge===j.Lu.PY||ge===j.Lu.SQL||(ge===j.Lu.YAML||ge===j.Lu.R)&&(0,I.V3)(X,null===X||void 0===X?void 0:X.path))&&(0,_.ck)(X.path.split(r.sep))!==s.tf.SCRATCHPAD&&(0,I.lr)(X)&&(0,h.jsx)(d.Z,{onClick:function(){var e=(null===F||void 0===F?void 0:F.type)===k.qL.INTEGRATION,n=(0,_.TU)(X,re,F);t(n,(function(n){e&&je&&ke({block:A(A({},je),{},{upstream_blocks:[n.uuid]})}),null===V||void 0===V||V(n)}))},primary:!0,children:"Add to current pipeline"}),Pe=z&&(0,h.jsx)(Z.Z,{m:2,children:(0,h.jsx)(y.ZP,{disabled:!re,inline:!0,loading:ee,onClick:function(){null===L||void 0===L||L(C.cH.TERMINAL),null===z||void 0===z||z(JSON.stringify(A(A({},ie),{},{command:["stdin","pip install -r ".concat(re,"/requirements.txt\r")]})))},title:re?"Pip install packages from your saved requirements.txt file (\u2318+S to save).":"Please use right panel terminal to install packages.",uuid:"FileEditor/InstallPackages",children:"Install packages"})}),Oe="FileEditor/".concat(null===X||void 0===X?void 0:X.path),we=(0,D.y)(),Ce=we.registerOnKeyDown,_e=we.unregisterOnKeyDown;return(0,l.useEffect)((function(){return function(){_e(Oe)}}),[_e,Oe]),Ce(Oe,(function(e,t){if(n&&!p)if((0,M.y)([O.zX,O.Um],t)||(0,M.y)([O.PQ,O.Um],t))e.preventDefault(),me(ce,X);else if(pe&&(0,M.y)([O.zX,O.hS],t)){e.preventDefault();var i="".concat(X.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(i)&&location.reload()}}),[n,ce,p,X,me,pe]),(0,h.jsxs)("div",{ref:ne,children:[!B&&(0,h.jsx)(Z.Z,{p:2,children:(0,h.jsxs)(v.ZP,{justifyContent:"space-between",children:[(0,h.jsxs)(g,{children:[Ze,(0,h.jsx)(d.Z,{disabled:!ce,onClick:function(e){e.preventDefault(),me(ce,X)},title:ce?null:"No changes have been made to this file.",children:"Save file content"})]}),L&&(0,h.jsx)(g,{children:(0,h.jsx)(d.Z,{compact:!0,onClick:function(){L(C.cH.FILE_VERSIONS)},small:!0,title:"View previous changes to this file.",children:"Show versions"})})]})}),xe,b===j.dT.REQS_TXT&&Pe]})}},28385:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(17717),l=t(80329),u=t(82684),c=t(69864),a=t(71180),s=t(75810),d=t(15135),p=t(97618),f=t(55485),v=t(85854),h=t(38276),m=t(4190),b=t(75499),g=t(30160),x=t(35686),j=t(70515),y=t(68669),k=t(3917),Z=t(81728),P=t(72619),O=t(3314),w=t(86735),C=t(28598);function _(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?_(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.onActionCallback,t=e.selectedBlock,_=e.selectedFilePath,I=e.setErrors,E=e.width,T=(0,l.j)("apiReloads"),M=(0,o.Z)(T,2)[1],D=x.ZP.file_versions.files.list(_&&encodeURIComponent(_)),B=D.data,A=D.mutate,R=(0,u.useMemo)((function(){return(null===B||void 0===B?void 0:B.file_versions)||[]}),[B]),N=(0,u.useState)(null),L=N[0],F=N[1],U=(0,u.useMemo)((function(){return null===R||void 0===R?void 0:R[L]}),[L,R]),H=x.ZP.file_contents.detail(U?encodeURIComponent(U.path):null).data,z=(0,u.useMemo)((function(){return null===H||void 0===H?void 0:H.file_content}),[H]),W=(0,u.useMemo)((function(){return(0,y.lU)()}),[]),G=(0,u.useMemo)((function(){var e,n,t;return null===_||void 0===_||null===(e=_.match(W))||void 0===e||null===(n=e[0])||void 0===n||null===(t=n.split("."))||void 0===t?void 0:t[1]}),[_,W]),K=(0,c.Db)(x.ZP.file_contents.useUpdate(_&&encodeURIComponent(_)),{onSuccess:function(e){return(0,P.wD)(e,{callback:function(e){var t;_&&A();var o=null===e||void 0===e||null===(t=e.file_content)||void 0===t?void 0:t.path,l="FileEditor/".concat(o);if(o){var u=o.split(r.sep);if("pipelines"===u[0]){var c=u.slice(1,u.length-1).join(r.sep);l="PipelineDetail/".concat(c)}}M((function(e){return S(S({},e),{},(0,i.Z)({},l,Number(new Date)))})),F((function(e){return e+1})),null===n||void 0===n||n(null===e||void 0===e?void 0:e.file_content)},onErrorCallback:function(e,n){return I({errors:n,response:e})}})}}),V=(0,o.Z)(K,2),q=V[0],Y=V[1].isLoading,Q=(0,u.useMemo)((function(){var e=R.map((function(e){var n=e.name,t=e.path;return[(0,C.jsxs)(f.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(p.Z,{flex:1,children:[(0,C.jsx)(g.ZP,{default:!0,monospace:!0,children:(0,k.JX)(n,{withSeconds:!0})}),(0,C.jsx)(h.Z,{px:2*j.cd,children:(0,C.jsx)(g.ZP,{monospace:!0,children:n})})]}),U&&(null===U||void 0===U?void 0:U.path)===t&&(0,C.jsx)(a.Z,{compact:!0,loading:Y,onClick:function(e){(0,O.j)(e),q({file_content:{version:n}})},small:!0,children:"Replace with this version"})]},n)]}));if(U){var n=(0,C.jsx)(h.Z,{p:j.cd,children:(0,C.jsx)(m.Z,{},"spinner")});if(z&&(null===z||void 0===z?void 0:z.path)===(null===U||void 0===U?void 0:U.path)){var t=z.content,i=void 0===t?"":t;n=(0,C.jsx)(s.Z,{autoHeight:!0,language:d.nB[G],padding:!0,readOnly:!0,value:(0,Z.Pb)(i)?JSON.stringify(JSON.parse(i),null,2):i,width:E})}e=(0,w.Hk)([n],L+1,e)}return e}),[z,G,R,Y,U,L,q,E]);return(0,C.jsxs)("div",{style:{width:E},children:[(0,C.jsxs)(h.Z,{p:j.cd,children:[(0,C.jsx)(v.Z,{level:5,children:"File versions"}),(0,C.jsx)(g.ZP,{inline:!0,monospace:!0,children:_?decodeURIComponent(_):null===t||void 0===t?void 0:t.uuid})]}),(0,C.jsx)(b.Z,{buildRowProps:function(e){if(U&&L+1===e)return{renderCell:function(e){return e},renderRow:function(e){return e}}},columnFlex:[1],columns:[{uuid:"Version"}],isSelectedRow:function(e){var n;return(null===(n=R[e])||void 0===n?void 0:n.name)===(null===U||void 0===U?void 0:U.name)},onClickRow:function(e){U?e===L?F(null):e<L?F(e):e>L+1&&F(e-1):F(e)},rows:Q})]})}},72226:function(e,n,t){"use strict";var i=t(82394),o=t(38276),r=t(75499),l=t(30160),u=t(17488),c=t(70515),a=t(28598);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 d(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.objectAttributes,t=e.originalAttributes,s=e.setObjectAttributes;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(o.Z,{mb:1,px:c.cd,children:[(0,a.jsx)(l.ZP,{bold:!0,children:"Outdated after"}),(0,a.jsx)(l.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,a.jsx)(r.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"seconds"},{uuid:"weeks"},{uuid:"months"},{uuid:"years"}].map((function(e){var o,r,c=e.uuid,p=null===n||void 0===n||null===(o=n.outdated_after)||void 0===o?void 0:o[c],f=null===t||void 0===t||null===(r=t.outdated_after)||void 0===r?void 0:r[c];return[(0,a.jsxs)(l.ZP,{default:!0,monospace:!0,children:[c," ",f&&(0,a.jsxs)(l.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",f,")"]})]},"label-".concat(c)),(0,a.jsx)(u.Z,{compact:!0,monospace:!0,onChange:function(e){return s((function(n){var t;return d(d({},n),{},{outdated_after:d(d({},null===n||void 0===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:"undefined"===typeof p||null===p?"":p},"input-".concat(c))]}))})]})}},29644:function(e,n,t){"use strict";var i=t(82394),o=t(44085),r=t(38276),l=t(75499),u=t(30160),c=t(17488),a=t(70515),s=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 v(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)(r.Z,{mb:1,px:a.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\u2019s 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\u2019t run again until today at 17:00."]})})]}),(0,p.jsx)(l.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 r,l,a,d=e.uuid,h=e.values,m=null===n||void 0===n||null===(r=n.outdated_starting_at)||void 0===r?void 0:r[d],b=null===t||void 0===t||null===(l=t.outdated_starting_at)||void 0===l?void 0:l[d],g={compact:!0,key:"outdated-starting-at-input-".concat(d),monospace:!0,onChange:function(e){return f((function(n){var t;return v(v({},n),{},{outdated_starting_at:v(v({},null===n||void 0===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:"undefined"===typeof m||null===m?"":m};return a=h?(0,p.jsx)(o.Z,v(v({},g),{},{placeholder:"Select a value",children:h.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,v(v({},g),{},{placeholder:"Enter a number",setContentOnMount:!0,type:"number"})),[(0,p.jsxs)(u.ZP,{default:!0,monospace:!0,children:[(0,s.vg)(d)," ",b&&(0,p.jsxs)(u.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"outdated-starting-at-label-".concat(d)),a]}))})]})}},46209:function(e,n,t){"use strict";var i=t(82394),o=t(12691),r=t.n(o),l=t(70652),u=t(48670),c=t(38276),a=t(75499),s=t(30160),d=t(17488),p=t(70515),f=t(28598);function v(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?v(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(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,o=e.originalAttributes,v=e.setObjectAttributes;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(c.Z,{mb:1,px:p.cd,children:[(0,f.jsx)(s.ZP,{bold:!0,children:"Block data to output"}),(0,f.jsx)(s.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)(s.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)(a.Z,{columnFlex:[null,1,null],columns:[{label:function(){return""},uuid:"selected"},{uuid:"Block UUID"},{uuid:"Partitions"}],rows:null===n||void 0===n?void 0:n.map((function(e){var n,c=e.uuid,a=null===t||void 0===t?void 0:t.settings,p=null===a||void 0===a?void 0:a[c],m=null===p||void 0===p?void 0:p.partitions,b=null===o||void 0===o||null===(n=o.settings)||void 0===n?void 0:n[c],g=null===b||void 0===b?void 0:b.partitions,x=!!p||!!b;return[(0,f.jsx)(l.Z,{checked:x,onClick:function(){return function(e){v((function(n){var t=(null===n||void 0===n?void 0:n.settings)||{};return e?t[c]={}:null===t||void 0===t||delete t[c],h(h({},n),{},{settings:t})}))}(!x)}},"selected--".concat(c)),(0,f.jsxs)("div",{children:[(0,f.jsx)(r(),{as:"/pipelines/".concat(null===t||void 0===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})})," ",g&&(0,f.jsxs)(s.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"block-uuid-".concat(c)),(0,f.jsx)(d.Z,{compact:!0,monospace:!0,onChange:function(e){return v((function(n){var t,o;return h(h({},n),{},{settings:h(h({},null===n||void 0===n?void 0:n.settings),{},(0,i.Z)({},c,h(h({},null===n||void 0===n||null===(t=n.settings)||void 0===t?void 0:t[c]),{},{partitions:0===(null===(o=e.target.value)||void 0===o?void 0:o.length)?null:Number(e.target.value)})))})}))},placeholder:"1",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof m||null===m?"":m},"input-".concat(c))]}))})]})}},67355:function(e,n,t){"use strict";var i=t(12691),o=t.n(i),r=t(82684),l=t(34376),u=t(8666),c=t(48670),a=t(38276),s=t(4190),d=t(75499),p=t(30160),f=t(35686),v=t(70515),h=t(3314),m=t(28598);n.Z=function(e){var n=e.globalDataProducts,t=e.onClickRow,i=(0,l.useRouter)(),b=f.ZP.global_data_products.list({},{},{pauseFetch:!!n}).data,g=(0,r.useMemo)((function(){return n||(null===b||void 0===b?void 0:b.global_data_products)||[]}),[b,n]);return b||n?b&&0===(null===g||void 0===g?void 0:g.length)?(0,m.jsx)(a.Z,{p:v.cd,children:(0,m.jsx)(p.ZP,{children:"There are currently no global data products registered."})}):(0,m.jsx)(d.Z,{columnFlex:[1,null,null],columns:[{uuid:"UUID"},{uuid:"Object type"},{uuid:"Object UUID"}],onClickRow:function(e){var n=null===g||void 0===g?void 0:g[e];n&&(t?null===t||void 0===t||t(n):i.push("/global-data-products/[...slug]","/global-data-products/".concat(null===n||void 0===n?void 0:n.uuid)))},rows:null===g||void 0===g?void 0:g.map((function(e){var n=e.object_type,t=e.object_uuid,r=e.uuid,l={as:null,href:null};return u.b.PIPELINE===n&&(l.as="/pipelines/".concat(t,"/edit"),l.href="/pipelines/[pipeline]/edit"),[(0,m.jsx)(p.ZP,{monospace:!0,children:r},"uuid"),(0,m.jsx)(p.ZP,{default:!0,monospace:!0,children:n},"objectType"),(0,m.jsx)(o(),{as:null===l||void 0===l?void 0:l.as,href:(null===l||void 0===l?void 0:l.href)||"",passHref:!0,children:(0,m.jsx)(c.Z,{default:!0,monospace:!0,onClick:function(e){(0,h.j)(e),i.push(l.href,l.as)},preventDefault:!0,children:t})},"objectUUID")]})),uuid:"global-data-products"}):(0,m.jsx)(a.Z,{p:v.cd,children:(0,m.jsx)(s.Z,{})})}},29480:function(e,n,t){"use strict";t.d(n,{$W:function(){return s},cl:function(){return d},cv:function(){return p},dE:function(){return c},zG:function(){return a}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=t(47041),c=i.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-7a1uhf-0"})(["border-radius:","px;padding:","px;",""],r.n_,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).popup,";\n ")})),a=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;}"]),s=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-2"})(["padding-top:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.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*l.iI,(function(e){return"\n background-color: ".concat((e.theme||o.Z).interactive.defaultBackground,";\n border-bottom: ").concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.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(r.n_,"px;\n border-top-right-radius: ").concat(r.n_,"px;\n ")}))},4015:function(e,n,t){"use strict";t.d(n,{$b:function(){return s},I5:function(){return c},Nk:function(){return u},gI:function(){return a}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-h093u4-0"})([""," ",""],(function(e){return!e.width&&"\n width: ".concat(40*l.iI,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),c=i.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-h093u4-1"})(["padding:","px;",""],2.5*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-top-left-radius: ").concat(r.n_,"px;\n border-top-right-radius: ").concat(r.n_,"px;\n border-top: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-h093u4-2"})(["align-items:center;justify-content:space-between;",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-top: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n display: ").concat((null===e||void 0===e?void 0:e.display)||"flex",";\n padding-bottom: ").concat(1*l.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n padding-left: ").concat(l.cd*l.iI,"px;\n padding-top: ").concat(1*l.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-h093u4-3"})(["padding:","px ","px;",""],2.5*l.iI,2*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom-left-radius: ").concat(r.n_,"px;\n border-bottom-right-radius: ").concat(r.n_,"px;\n border-bottom: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")}))},90758:function(e,n,t){"use strict";t.d(n,{Z:function(){return O}});var i=t(82394),o=t(26304),r=t(82684),l=t(38626),u=t(39867),c=t(55485),a=t(48670),s=t(38276),d=t(30160),p=t(12468),f=t(44897),v=t(72473),h=t(97133),m=t(70515),b=t(15610),g=t(3314),x=t(28598);var j=function(e){var n=e.filePath,t=e.filesTouched,i=void 0===t?{}:t,o=e.isLast,l=e.onClickTab,j=e.onClickTabClose,y=e.renderTabTitle,k=e.savePipelineContent,Z=e.selected,P=e.themeContext,O=(0,r.useState)(!1),w=O[0],C=O[1];return(0,x.jsx)(c.ZP,{flexDirection:"column",fullHeight:!0,onClick:function(e){e.preventDefault(),Z||(l?l(n):(null===k||void 0===k||k(),(0,b.u7)({file_path:encodeURIComponent(n)})))},onMouseEnter:function(){return C(!0)},onMouseLeave:function(){return C(!1)},children:(0,x.jsx)(h.Gb,{last:o,selected:Z,children:(0,x.jsxs)(c.ZP,{alignItems:"center",fullHeight:!0,children:[(0,x.jsx)(p.Z,{appearAbove:!0,appearBefore:!0,label:n,size:null,widthFitContent:!0,children:(0,x.jsxs)(c.ZP,{alignItems:"center",fullHeight:!0,children:[!i[n]&&(0,x.jsx)(v.iU,{muted:!Z,size:1.5*m.iI}),i[n]&&(0,x.jsx)(p.Z,{label:"Unsaved changes",size:null,widthFitContent:!0,children:(0,x.jsx)("div",{style:{padding:1},children:(0,x.jsx)(u.Z,{borderColor:(P||f.Z).borders.danger,size:1.25*m.iI})})}),(0,x.jsx)(s.Z,{mr:1}),(0,x.jsx)(d.ZP,{muted:!Z,children:y?y(n):n})]})}),(0,x.jsx)(s.Z,{mr:2}),(0,x.jsx)(p.Z,{label:"Close",size:null,widthFitContent:!0,children:(0,x.jsxs)(a.Z,{autoHeight:!0,block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(e){(0,g.j)(e),null===j||void 0===j||j(n)},preventDefault:!0,children:[(w||Z)&&(0,x.jsx)(v.x8,{muted:!Z,size:1.25*m.iI}),!w&&!Z&&(0,x.jsx)("div",{style:{width:1.25*m.iI}})]})})]})})})},y=t(86735),k=["filePaths","isSelectedFilePath","onClickTabClose","selectedFilePath"];function Z(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 P(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Z(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var O=function(e){var n=e.filePaths,t=e.isSelectedFilePath,i=e.onClickTabClose,u=e.selectedFilePath,a=(0,o.Z)(e,k),s=(0,r.useContext)(l.ThemeContext),d=(0,r.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]),p=(0,r.useMemo)((function(){return null===d||void 0===d?void 0:d.length}),[d]);return(0,x.jsx)(c.ZP,{alignItems:"center",justifyContent:"flex-start",children:null===d||void 0===d?void 0:d.map((function(e,n){var o=t?t(e,u):u===encodeURIComponent(e);return(0,r.createElement)(j,P(P({},a),{},{filePath:e,isLast:n===p-1,key:e,onClickTabClose:function(e){if(i)i(e);else{var n=(0,y.Od)(d,(function(n){return n===e})).map((function(e){return encodeURIComponent(e)}));(0,b.u7)({file_path:n[n.length-1]||null,"file_paths[]":n},{pushHistory:!0})}},selected:o,themeContext:s}))}))})}},92709:function(e,n,t){"use strict";t.d(n,{IY:function(){return l},Jf:function(){return r},LR:function(){return o},NR:function(){return u},b7:function(){return i}});var i="edit",o="[ERR_BLOCK_EXISTS]",r={uuid:"All files"},l={uuid:"Files in pipeline"},u=[r,l]},97133:function(e,n,t){"use strict";t.d(n,{Gb:function(){return p},fm:function(){return s},lO:function(){return a},rK:function(){return d},zn:function(){return c}});var i=t(38626),o=t(44897),r=t(2842),l=t(70515),u=t(47041),c=300,a=i.default.div.withConfig({displayName:"indexstyle__PipelineContainerStyle",componentId:"sc-1sv9513-0"})([".pipeline-detail-enter-active{opacity:1;transition:opacity ","ms linear;}.pipeline-detail-enter-done{opacity:0;transition:opacity ","ms linear;}"],c,c),s=i.default.div.withConfig({displayName:"indexstyle__OverlayStyle",componentId:"sc-1sv9513-1"})(["height:100vh;opacity:1;position:fixed;width:100vw;z-index:9999;",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).codeArea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__PipelineHeaderStyle",componentId:"sc-1sv9513-2"})(["height:","px;position:sticky;top:","px;width:100%;z-index:5;"," "," "," ",""],r.Wi,r.Wi,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||o.Z.borders).medium,";\n ")}),(function(e){return e.relativePosition&&"\n position: relative;\n "}),(function(e){return e.secondary&&"\n height: ".concat(37,"px;\n top: ").concat(r.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,u.y$)()),p=i.default.div.withConfig({displayName:"indexstyle__FileTabStyle",componentId:"sc-1sv9513-3"})(["border-right:1px solid transparent;height:100%;padding:","px ","px;"," "," ",""],l.iI,l.cd*l.iI,(function(e){return"\n &:hover {\n cursor: default;\n\n p {\n color: ".concat((e.theme.content||o.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||o.Z.interactive).hoverBackground,";\n ")}),(function(e){return!e.selected&&!e.last&&"\n border-color: ".concat((e.theme.borders||o.Z.borders).light," !important;\n ")}))},28795:function(e,n,t){"use strict";var i;t.d(n,{B:function(){return o},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 o="cancel_all_running_pipeline_runs"},85010:function(e,n,t){"use strict";t.d(n,{H:function(){return u}});var i=t(57653),o=t(72473),r=t(28795),l=t(50178);function u(e,n,t){var u=(n||{}).uuid||t,c=[{Icon:o.Bf,id:r.M.TRIGGERS,isSelected:function(){return r.M.TRIGGERS===e},label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(u,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{Icon:o.Pf,id:r.M.RUNS,isSelected:function(){return r.M.RUNS===e},label:function(){return"Runs"},linkProps:{as:"/pipelines/".concat(u,"/runs"),href:"/pipelines/[pipeline]/runs"}},{Icon:o.dE,id:r.M.BACKFILLS,isSelected:function(){return r.M.BACKFILLS===e},label:function(){return"Backfills"},linkProps:{as:"/pipelines/".concat(u,"/backfills"),href:"/pipelines/[pipeline]/backfills"}},{Icon:o.UL,id:r.M.PIPELINE_LOGS,isSelected:function(){return r.M.PIPELINE_LOGS===e},label:function(){return"Logs"},linkProps:{as:"/pipelines/".concat(u,"/logs"),href:"/pipelines/[pipeline]/logs"}},{Icon:o.ug,id:r.M.MONITOR,isSelected:function(){return r.M.MONITOR===e},label:function(){return"Monitor"},linkProps:{as:"/pipelines/".concat(u,"/monitors"),href:"/pipelines/[pipeline]/monitors"}}];return i.qL.INTEGRATION===(null===n||void 0===n?void 0:n.type)&&c.unshift({Icon:o.Nt,id:r.M.SYNCS,isSelected:function(){return r.M.SYNCS===e},label:function(){return"Syncs"},linkProps:{as:"/pipelines/".concat(u,"/syncs"),href:"/pipelines/[pipeline]/syncs"}}),(0,l.Ct)()||(c.unshift({Icon:o.EK,disabled:!u,id:r.M.EDIT,isSelected:function(){return r.M.EDIT===e},label:function(){return"Edit pipeline"},linkProps:{as:"/pipelines/".concat(u,"/edit"),href:"/pipelines/[pipeline]/edit"}}),c.push({Icon:o.Zr,id:r.M.SETTINGS,isSelected:function(){return r.M.SETTINGS===e},label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(u,"/settings"),href:"/pipelines/[pipeline]/settings"}})),c.unshift({Icon:o.G6,id:r.M.DASHBOARD,isSelected:function(){return r.M.DASHBOARD===e},label:function(){return"Dashboard"},linkProps:{as:"/pipelines/".concat(u,"/dashboard"),href:"/pipelines/[pipeline]/dashboard"}}),c}},66909:function(e,n,t){"use strict";t.d(n,{Eh:function(){return a},t0:function(){return s}});var i=t(38626),o=t(2842),r=t(17679),l=t(61896),u=t(47041),c=t(70515),a=(c.iI,r.O$+3*c.iI+l.dN),s=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(o.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 c},JZ:function(){return s},e7:function(){return d},wx:function(){return a}});var i=t(75582),o=t(82394),r=t(30229);function l(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 u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function c(e){return"string"===typeof e?e:JSON.stringify(e)}function a(e,n){var t,i;return null===e||void 0===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 u(u({},e),{},{value:c(n)})}))}function s(e,n){return n===r.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===r.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function d(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,i.Z)(n,2),r=t[0],l=t[1],c=l;try{c=JSON.parse(l)}catch(a){}return u(u({},e),{},(0,o.Z)({},r,c))}),{}):e}},48381:function(e,n,t){"use strict";var i=t(82684),o=t(31882),r=t(55485),l=t(30160),u=t(86735),c=t(28598);n.Z=function(e){var n=e.onClickTag,t=e.tags,a=void 0===t?[]:t,s=(0,i.useMemo)((function(){return(null===a||void 0===a?void 0:a.length)||0}),[a]),d=(0,i.useMemo)((function(){return(0,u.YC)(a||[],"uuid")}),[a]);return(0,c.jsx)(r.ZP,{alignItems:"center",flexWrap:"wrap",children:null===d||void 0===d?void 0:d.reduce((function(e,t){return e.push((0,c.jsx)("div",{style:{marginBottom:2,marginRight:s>=2?4:0,marginTop:2},children:(0,c.jsx)(o.Z,{onClick:n?function(){return n(t)}:null,small:!0,children:(0,c.jsx)(l.ZP,{children:t.uuid})})},"tag-".concat(t.uuid))),e}),[])})}},48888:function(e,n,t){"use strict";t.d(n,{AE:function(){return o},H3:function(){return r},mW:function(){return l},oE:function(){return u},yg:function(){return i}});var i="tabs[]",o="show_columns",r="column",l="Reports",u="Visualizations"},17679:function(e,n,t){"use strict";t.d(n,{O$:function(){return re},Fk:function(){return le}});var i=t(75582),o=t(12691),r=t.n(o),l=t(26304),u=t(21831),c=t(82394),a=t(82684),s=t(26226),d=t(84969),p=t(90948),f=t(65743),v=t(28108),h=t(79487),m=t(29989),b=t(38626),g=t(61655),x=t(16853),j=t(65376),y=t(48072),k=t(24903),Z=t(84181),P=t(98677),O=t(30160),w=t(70987),C=t(79633),_=t(61896),S=t(70515),I=t(95363),E=t(28598),T=["height","width"];function M(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?M(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):M(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var B={bottom:5*S.iI,left:3*S.iI,right:20*S.iI,top:0},A=function(e){return e.x},R=function(e){return e.y},N=(0,g.Z)((function(e){var n=e.data,t=e.height,i=e.hideTooltip,o=e.large,r=e.margin,l=void 0===r?{}:r,c=e.renderTooltipContent,s=e.showTooltip,g=e.tooltipData,S=e.tooltipLeft,T=e.tooltipOpen,M=e.tooltipTop,N=e.width,L=e.xAxisLabel,F=e.xNumTicks,U=e.yLabelFormat,H=e.ySerialize,z=U;z||(z=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e});var W=o?_.iD:_.J5,G=(0,a.useContext)(b.ThemeContext),K=D(D({},B),l),V=n.slice(Math.max(0,n.length-50)),q=Object.keys(V[0]||[]).filter((function(e){return"x"===e})),Y=(0,k.Z)({domain:q,range:[C.hM]}),Q=(0,Z.Z)({domain:[0,Math.max.apply(Math,(0,u.Z)(V.map(A)))],nice:!0}),X=(0,P.Z)({domain:V.map(R),padding:.35}),J={active:(null===G||void 0===G?void 0:G.content.default)||w.Z.content.default,backgroundPrimary:(null===G||void 0===G?void 0:G.chart.backgroundPrimary)||w.Z.chart.backgroundPrimary,backgroundSecondary:(null===G||void 0===G?void 0:G.chart.backgroundSecondary)||w.Z.chart.backgroundSecondary,muted:(null===G||void 0===G?void 0:G.content.muted)||w.Z.content.muted,primary:(null===G||void 0===G?void 0:G.chart.primary)||w.Z.chart.primary,tooltipBackground:(null===G||void 0===G?void 0:G.background.navigation)||w.Z.background.navigation},$=V.map(H),ee=Math.min(Math.max.apply(Math,(0,u.Z)($.map((function(e){return String(e).length})))),20);6*ee>2*K.right?K.right+=5.5*ee:6*ee>=K.right&&(K.right+=3.75*ee);var ne=N-K.left-K.right,te=t-K.top-K.bottom;K.left+=7*ee,Q.rangeRound([0,ne]),X.rangeRound([te,0]);var ie=V.map(A).length,oe=X($[ie-1]),re=(0,a.useCallback)((function(e){var n=(0,y.Z)(e)||{x:0,y:0},t=n.x,i=n.y,o=1-(i-oe/2)/(te-oe),r=Math.floor(o*ie),l=V[r];"undefined"===typeof l&&(l=V[r-1]),i>oe&&i<te-oe&&s({tooltipData:l,tooltipLeft:t,tooltipTop:i+K.top})}),[V,ie,K.top,s,oe,te]);return N<10?null:(0,E.jsxs)("div",{children:[(0,E.jsxs)("svg",{height:t,width:N,children:[(0,E.jsx)(f.Z,{fill:"transparent",height:t-(K.top+K.bottom),onMouseLeave:function(){return i()},onMouseMove:re,onTouchMove:re,onTouchStart:re,rx:14,width:N-K.left,x:K.left,y:0}),(0,E.jsxs)(m.Z,{left:K.left,top:K.top,children:[(0,E.jsx)(v.Z,{color:Y,data:V,height:te,keys:q,pointerEvents:"none",xScale:Q,y:H,yScale:X,children:function(e){return e.map((function(e){return e.bars.map((function(n){return(0,E.jsx)("g",{children:(0,E.jsx)(E.Fragment,{children:(0,E.jsx)("rect",{fill:J.backgroundPrimary,height:n.height,pointerEvents:"none",rx:4,width:n.width,x:n.x,y:n.y})})},"barstack-horizontal-".concat(e.index,"-").concat(n.index))}))}))}}),(0,E.jsx)(d.Z,{hideTicks:!0,scale:X,stroke:J.muted,tickFormat:function(e){return z(e)},tickLabelProps:function(){return{fill:J.active,fontFamily:I.ry,fontSize:W,style:{width:"10px"},textAnchor:"end"}},tickStroke:J.muted,tickValues:$,top:2}),(0,E.jsx)(p.Z,{label:L,labelProps:{fill:J.muted,fontFamily:I.ry,fontSize:W,textAnchor:"middle"},numTicks:F,scale:Q,stroke:J.muted,tickLabelProps:function(){return{fill:J.active,fontFamily:I.ry,fontSize:W,textAnchor:"middle"}},tickStroke:J.muted,top:te})]}),g&&(0,E.jsx)("g",{children:(0,E.jsx)(h.Z,{from:{x:K.left,y:M},pointerEvents:"none",stroke:C.Ej,strokeDasharray:"5,2",strokeWidth:1,to:{x:ne+K.left,y:M}})})]}),T&&g&&(0,E.jsx)(x.Z,{left:S,style:D(D({},j.j),{},{backgroundColor:J.tooltipBackground}),top:M,children:(0,E.jsxs)(O.ZP,{black:!0,small:!0,children:[null===c||void 0===c?void 0:c(g),!c&&A(g).toFixed(4)]})})]})}));var L,F,U,H,z=function(e){var n=e.height,t=e.width,i=(0,l.Z)(e,T);return(0,E.jsx)("div",{style:{height:n,width:"undefined"===typeof t?"100%":t},children:(0,E.jsx)(s.Z,{children:function(e){var n=e.width,t=e.height;return(0,E.jsx)(N,D(D({},i),{},{height:t,width:n}))}})})},W=t(97618),G=t(52729),K=t(48670),V=t(87862),q=t(89370),Y=t(86735),Q=(Y.Qj,Y.tS,Y.tS,Y.tS,Y.tS,Y.Qj,Y.Qj,Y.Qj,Y.tS,Y.tS,L={},(0,c.Z)(L,q.RL.EMAIL,"domain_distribution"),(0,c.Z)(L,q.RL.TEXT,"word_distribution"),(0,c.Z)(L,q.RL.LIST,"element_distribution"),(0,c.Z)(L,"default","value_counts"),L),X=[].concat((0,u.Z)(q.P_),[q.RL.TEXT,q.RL.EMAIL,q.RL.LIST]),J=(F={},(0,c.Z)(F,q.RL.EMAIL,"Domain distribution"),(0,c.Z)(F,q.RL.TEXT,"Word distribution"),(0,c.Z)(F,q.RL.LIST,"Element distribution"),(0,c.Z)(F,"default","Distribution of values"),t(31353));!function(e){e.RANGE="range"}(U||(U={})),function(e){e.BAR_HORIZONTAL="bar_horizontal",e.LINE_CHART="line_chart",e.HISTOGRAM="histogram"}(H||(H={}));var $=t(48888),ee=t(92083),ne=t.n(ee),te=t(81728);function ie(e,n){var t,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i||{},r=o.calculateAnomaly,l=o.feature,c=o.getYValue,a=e.x,s=e.x_metadata,d=s.label,p=s.label_type,f=e.y,v=(null===f||void 0===f?void 0:f.map((function(e){return null===c||void 0===c?void 0:c(e)})))||[],h=Math.max.apply(Math,(0,u.Z)(v)),m=Math.max.apply(Math,(0,u.Z)(v)),b=(0,Y.Sm)(v),g=(0,Y.IN)(v),x=b/Math.max(1,v.length),j=n[d]||l,y=null===j||void 0===j?void 0:j.columnType,k=q.RL.DATETIME===y,Z=[],P=[],O=a.length,w=a.map((function(e,n){var i,o,l,u,c=e.label,a=e.max,s=e.min,d=f[n];if(U.RANGE===p)if(t||(t=a-s),u=q.RL.NUMBER===y&&t<=O)i=Number(s);else if(i=t/2+s,k){var j="M/D/YYYY",w="M/D/YYYY",C="M/D/YYYY";t<=1?(j=t<=.1?"H:mm:ss.SSS":"H:mm:ss",w="H:mm:ss.SSS",C="H:mm:ss.SSS"):t<=60?(j="H:mm",w="H:mm:ss",C="H:mm:ss"):t<=3600?(j="H:mm",w="M/D/YYYY H:mm",C="H:mm"):t<=86400&&(w="M/D/YYYY H:mm",C="M/D/YYYY H:mm"),i=ne().unix(i).format(j),o=ne().unix(s).format(w),l=ne().unix(a).format(C)}else i=(0,te.QV)(i);else i=c;var _=n>=1?f[n-1]:null,S=!1;r&&(S=r({x:e,y:d,yPrevious:_,yValues:v,yValuesAverage:x,yValuesMax:h,yValuesMin:m,yValuesStandardDeviation:g,yValuesSum:b}));var I={hideRange:u,isUnusual:S,x:e,xLabel:i,xLabelMax:l,xLabelMin:o,y:d};return S&&(u?P.push(I):Z.push(I)),I}));return{distribution:{data:w,featureUUID:d},rangedWithUnusualDistribution:(0,Y.YC)(Z,(function(e){var n=e.y;return c(n)}),{ascending:!1}),unusualDistribution:(0,Y.YC)(P,(function(e){var n=e.y;return c(n)}),{ascending:!1})}}var oe=t(40489);var re=12*S.iI;function le(e){var n=e.columnTypes,t=e.columns,o=e.insightsByFeatureUUID,l=e.insightsOverview,u=e.noColumnLinks,c=void 0!==u&&u,a=e.statistics;return function(e,u,s){var d=s.width,p=t[u],f=n[p],v=J.T5[f],h=(o[p]||{}).charts,m=l.time_series,b=t.filter((function(e){return n[e]===q.RL.DATETIME})),g=null===m||void 0===m?void 0:m.map((function(e){return ie(e,{},{feature:{columnType:f,uuid:p}}).distribution})),x={};null===g||void 0===g||g.forEach((function(e,n){var t=e.data;x[b[n]]=(0,E.jsx)(G.Z,{data:t.map((function(e){var n=e.x,t=e.xLabel,i=e.xLabelMax,o=e.xLabelMin;return[t,e.y.count,o,i,n.min,n.max]})),height:re,large:!0,margin:{bottom:0,left:0,right:0,top:0},renderTooltipContent:function(e){var n=(0,i.Z)(e,4),t=n[1],o=n[2],r=n[3];return(0,E.jsxs)("p",{children:["Rows: ",t,(0,E.jsx)("br",{}),"Start: ",o,(0,E.jsx)("br",{}),"End: ",r]})},sortData:function(e){return(0,Y.YC)(e,"[4]")}},p)}));var j,y=null===h||void 0===h?void 0:h.find((function(e){var n=e.type;return H.HISTOGRAM===n})),k=(y?ie(y,{},{feature:{columnType:f,uuid:p},getYValue:function(e){return e.value}}):{}).distribution,Z=void 0===k?null:k,P=Q[f]||Q.default,w=null===a||void 0===a?void 0:a["".concat(p,"/").concat(P)],C=Object.entries(w||{}).map((function(e){var n=(0,i.Z)(e,2),t=n[0];return{x:n[1],y:t}})),_=q.RL.TRUE_OR_FALSE===f;if(q.RL.DATETIME===f)j=x[p];else if(Z&&!_)j=(0,E.jsx)(G.Z,{data:Z.data.map((function(e){var n=e.hideRange,t=e.isUnusual,i=e.x;return[e.xLabel,e.y.value,i.min,i.max,t,n]})),height:re,margin:{bottom:0,left:0,right:0,top:0},renderTooltipContent:function(e){var n=(0,i.Z)(e,6),t=n[1],o=n[2],r=n[3],l=n[5];return(0,E.jsxs)("p",{children:[l&&(0,E.jsxs)(E.Fragment,{children:["Rows: ",t,(0,E.jsx)("br",{}),"Value: ",o]}),!l&&(0,E.jsxs)(E.Fragment,{children:["Rows: ",t,(0,E.jsx)("br",{}),"Range: ",o," - ",r]})]})},sortData:function(e){return(0,Y.YC)(e,"[2]")},width:d-2*S.iI});else if(X.includes(f)){var I=(0,Y.YC)((0,Y.YC)(C,"x",{ascending:!1}).slice(0,5),"x");j=(0,E.jsx)(z,{data:I,height:re,margin:{bottom:0,left:0,right:20,top:0},renderTooltipContent:function(e){var n=e.x,t=e.y;return"".concat(t," appears ").concat((0,te.x6)(n)," times")},xNumTicks:2,ySerialize:function(e){return e.y}})}else _&&w&&(j=(0,E.jsx)(V.Z,{data:Object.entries(w),getX:function(e){var n=(0,i.Z)(e,2),t=n[0],o=n[1];return"".concat(t," (").concat((0,te.x6)(o),")")},getY:function(e){return(0,i.Z)(e,2)[1]},height:re}));return(0,E.jsxs)("div",{style:{padding:S.iI},children:[(0,E.jsxs)("div",{style:{alignItems:"center",display:"flex",marginBottom:S.iI},children:[v&&(0,E.jsx)(W.Z,{title:q.Rp[f],children:(0,E.jsx)(v,{size:2*S.iI})}),(0,E.jsx)("div",{style:{marginLeft:.5*S.iI,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:d-4.5*S.iI},children:c?(0,E.jsx)(O.ZP,{bold:!0,default:!0,title:t[u],children:t[u]}):(0,E.jsx)(r(),{as:(0,oe.o_)($.oE,u),href:"/datasets/[...slug]",passHref:!0,children:(0,E.jsx)(K.Z,{bold:!0,monospace:!0,secondary:!0,small:!0,title:t[u],children:t[u]})})})]}),j,!j&&(0,E.jsx)("div",{style:{height:re}})]})}}},55729:function(e,n,t){"use strict";t.d(n,{Z:function(){return D}});var i=t(82394),o=t(75582),r=t(82684),l=t(69864),u=t(71180),c=t(15338),a=t(97618),s=t(55485),d=t(85854),p=t(48670),f=t(65956),v=t(82359),h=t(38276),m=t(30160),b=t(17488),g=t(69650),x=t(12468),j=t(35686),y=t(38626),k=t(44897),Z=t(42631),P=t(70515),O=y.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1b0w59t-0"})(["border-radius:","px;padding:","px;",""],Z.n_,P.cd*P.iI,(function(e){return"\n background-color: ".concat((e.theme.background||k.Z.background).codeArea,";\n ")})),w=t(72473),C=t(72191),_=t(72619),S=t(70320),I=t(23780),E=t(28598);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 M(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,i.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 D=function(e){var n=e.cancelButtonText,t=e.contained,y=e.header,k=e.onCancel,Z=e.onSaveSuccess,T=(0,I.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),D=(0,o.Z)(T,1)[0],B=(0,r.useState)(null),A=B[0],R=B[1],N=(0,r.useState)(!1),L=N[0],F=N[1],U=j.ZP.projects.list(),H=U.data,z=U.mutate,W=(0,r.useMemo)((function(){var e;return null===H||void 0===H||null===(e=H.projects)||void 0===e?void 0:e[0]}),[H]),G=W||{},K=G.name,V=G.openai_api_key,q=G.project_uuid,Y=(0,r.useMemo)((function(){return"demo.mage.ai"===window.location.hostname}),[]);(0,r.useEffect)((function(){A||R(W)}),[W,A]);var Q=(0,l.Db)(j.ZP.projects.useUpdate(K),{onSuccess:function(e){return(0,_.wD)(e,{callback:function(e){var n,t=e.project;z(),R(t),F(!1),(0,S.h)(null===t||void 0===t||null===(n=t.features)||void 0===n?void 0:n[v.d.LOCAL_TIMEZONE]),Z&&(null===Z||void 0===Z||Z(t))},onErrorCallback:function(e,n){return D({errors:n,response:e})}})}}),X=(0,o.Z)(Q,2),J=X[0],$=X[1].isLoading,ee=(0,r.useCallback)((function(e){return J({project:e})}),[J]),ne=(0,E.jsxs)(E.Fragment,{children:[y,(0,E.jsxs)(f.Z,{noPadding:!0,children:[(0,E.jsxs)(h.Z,{p:P.cd,children:[(0,E.jsx)(h.Z,{mb:1,children:(0,E.jsx)(d.Z,{level:5,children:"Project name"})}),(0,E.jsx)(m.ZP,{default:!0,monospace:!0,children:K})]}),(0,E.jsx)(c.Z,{light:!0}),(0,E.jsxs)(h.Z,{p:P.cd,children:[(0,E.jsx)(h.Z,{mb:1,children:(0,E.jsx)(d.Z,{level:5,children:"Project UUID"})}),(0,E.jsx)(m.ZP,{default:!!q,monospace:!0,muted:!q,children:q||"Not required"})]}),(0,E.jsx)(c.Z,{light:!0}),(0,E.jsx)(h.Z,{p:P.cd,children:(0,E.jsxs)(s.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,E.jsxs)(a.Z,{flexDirection:"column",children:[(0,E.jsx)(h.Z,{mb:1,children:(0,E.jsx)(d.Z,{level:5,children:"Help improve Mage"})}),(0,E.jsxs)(m.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,E.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,E.jsx)(h.Z,{mr:P.cd}),(0,E.jsx)(g.Z,{compact:!0,checked:null===A||void 0===A?void 0:A.help_improve_mage,onCheck:function(){return R((function(e){return M(M({},e),{},{help_improve_mage:!(null!==A&&void 0!==A&&A.help_improve_mage)})}))}})]})})]}),(0,E.jsx)(h.Z,{mt:P.HN}),(0,E.jsx)(f.Z,{noPadding:!0,overflowVisible:!0,children:(0,E.jsxs)(h.Z,{p:P.cd,children:[(0,E.jsx)(h.Z,{mb:1,children:(0,E.jsx)(d.Z,{level:5,children:"Features"})}),Object.entries((null===A||void 0===A?void 0:A.features)||{}).map((function(e,n){var t=(0,o.Z)(e,2),r=t[0],l=t[1];return(0,E.jsx)(h.Z,{mt:0===n?0:"4px",children:(0,E.jsxs)(s.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,E.jsxs)(a.Z,{children:[(0,E.jsx)(m.ZP,{default:!0,monospace:!0,children:r}),r===v.d.LOCAL_TIMEZONE&&(0,E.jsx)(h.Z,{ml:1,children:(0,E.jsx)(x.Z,{block:!0,description:"Display dates in local timezone. Please note that certain pages (e.g. Monitor page) or components (e.g. Pipeline run bar charts) may still be in UTC time. Dates in local time will have a timezone offset in the timestamp (e.g. -07:00).",lightBackground:!0,muted:!0,size:C._k})})]}),(0,E.jsx)(h.Z,{mr:P.cd}),(0,E.jsx)(g.Z,{checked:!!l,onCheck:function(){return R((function(e){return M(M({},e),{},{features:M(M({},null===A||void 0===A?void 0:A.features),{},(0,i.Z)({},r,!l))})}))}})]})},r)}))]})}),(0,E.jsx)(h.Z,{mt:P.HN}),(0,E.jsx)(f.Z,{noPadding:!0,children:(0,E.jsxs)(h.Z,{p:P.cd,children:[(0,E.jsx)(h.Z,{mb:1,children:(0,E.jsx)(d.Z,{level:5,children:"OpenAI"})}),V&&!L?(0,E.jsxs)(s.ZP,M(M({},s.A0),{},{children:[(0,E.jsx)(m.ZP,{default:!0,monospace:!0,children:"API key: ********"}),(0,E.jsx)(u.Z,{iconOnly:!0,onClick:function(){return F(!0)},secondary:!0,title:"Edit",children:(0,E.jsx)(w.I8,{size:C.bL})})]})):(0,E.jsx)(b.Z,{disabled:Y,label:Y?"Entering API key is disabled on demo":"API key",monospace:!0,onChange:function(e){return R((function(n){return M(M({},n),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===A||void 0===A?void 0:A.openai_api_key)||""})]})}),(0,E.jsx)(h.Z,{mt:P.HN}),(0,E.jsxs)(s.ZP,{alignItems:"center",children:[(0,E.jsx)(u.Z,{loading:$,onClick:function(){ee({features:null===A||void 0===A?void 0:A.features,help_improve_mage:null===A||void 0===A?void 0:A.help_improve_mage,openai_api_key:null===A||void 0===A?void 0:A.openai_api_key})},primary:!0,children:"Save project settings"}),k&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(h.Z,{mr:P.cd}),(0,E.jsx)(u.Z,{onClick:k,secondary:!0,children:n||"Cancel"})]})]})]});return t?(0,E.jsx)(O,{children:ne}):ne}},46568:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=(t(82684),t(33591)),l=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 a(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,s=void 0===c?{}:c,d=(0,o.Z)(e,u),p=a({},s);return i&&(p.paddingLeft=i,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,l.jsx)(r.Col,a(a({},d),{},{style:p,children:n}))}},82682:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=t(82684),l=t(33591),u=t(28598),c=["children","fullHeight","gutter","justifyContent","style"];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 s(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.children,t=e.fullHeight,i=e.gutter,a=e.justifyContent,d=e.style,p=void 0===d?{}:d,f=(0,o.Z)(e,c),v=s({},p);return i&&(v.marginLeft=-1*i,v.marginRight=v.marginLeft),t&&(v.height="100%"),(0,u.jsx)(l.Row,s(s({},f),{},{justifyContent:a,style:v,children:r.Children.map(n,(function(e,n){return e&&r.cloneElement(e,{gutter:i,key:n})}))}))}},40489:function(e,n,t){"use strict";t.d(n,{o_:function(){return c}});var i=t(75582),o=t(34376),r=t(48888);t(82684),t(12691),t(71180),t(58036),t(97618),t(55485),t(48670),t(38276),t(30160),t(72473),t(28598);var l,u=t(69419);!function(e){e.DATASETS="datasets",e.DATASET_DETAIL="dataset_detail",e.COLUMNS="features",e.COLUMN_DETAIL="feature_detail",e.EXPORT="export"}(l||(l={}));var c=function(e,n){var t=(0,o.useRouter)().query.slug,c=void 0===t?[]:t,a=(0,i.Z)(c,1)[0],s=(0,u.iV)(),d=s.show_columns,p=s.column,f="/".concat(l.DATASETS,"/").concat(a),v="".concat(r.H3,"=").concat(p||n),h="".concat(r.yg,"=").concat(e,"&").concat(v,"&").concat(r.AE,"=").concat(d||0);return"".concat(f,"?").concat(h)}},68781:function(e,n,t){"use strict";var i;t.d(n,{R:function(){return o}}),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 o=[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={}))},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),o=t(62369),r=t(68432),l=t(38626),u=t(65292),c=t(44897),a=t(95363),s=t(70515),d=t(28598);n.Z=function(e){var n=e.language,t=e.maxWidth,p=e.showLineNumbers,f=e.small,v=e.source,h=e.wrapLines,m=(0,i.useContext)(l.ThemeContext);function b(e){var i=e.value;return(0,d.jsx)(r.Z,{customStyle:{backgroundColor:(m.background||c.Z.background).popup,border:"none",borderRadius:"none",boxShadow:"none",fontFamily:a.Vp,fontSize:f?12:14,marginBottom:0,marginTop:0,maxWidth:t,paddingBottom:2*s.iI,paddingTop:2*s.iI},language:n,lineNumberStyle:{color:(m.content||c.Z.content).muted},showLineNumbers:p,style:u._4,useInlineStyles:!0,wrapLines:h,children:i})}return(0,d.jsx)(o.D,{components:{code:function(e){var n=e.children;return(0,d.jsx)(b,{value:n})}},children:v})}},39457:function(e,n,t){"use strict";var i,o=t(82394),r=(t(82684),t(64866)),l=t(21764),u=t(55485),c=t(48670),a=t(38276),s=t(30160),d=t(12468),p=t(72473),f=t(70515),v=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 m(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,o.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}!function(e){e.LEFT="left",e.RIGHT="right"}(i||(i={})),n.Z=function(e){var n,t=e.children,o=e.copiedText,h=e.iconPosition,b=void 0===h?i.LEFT:h,g=e.inverted,x=e.linkProps,j=e.linkText,y=e.monospace,k=e.muted,Z=e.small,P=e.toastMessage,O=e.withCopyIcon;return t?n=(0,v.jsx)("span",{children:t}):O&&(n=(0,v.jsx)(c.Z,m(m({href:"#",inline:!0,muted:k,preventDefault:!0,sameColorAsText:!0,small:Z},x),{},{children:(0,v.jsxs)(u.ZP,{alignItems:"center",children:[b===i.LEFT&&(0,v.jsx)(a.Z,{mr:j?1:0,children:(0,v.jsx)(u.ZP,{alignItems:"center",children:(0,v.jsx)(p.CK,{inverted:g,muted:k,size:2*f.iI})})}),j&&(0,v.jsx)(s.ZP,{inverted:g,monospace:y,muted:k,small:Z,children:j}),b===i.RIGHT&&(0,v.jsx)(a.Z,{ml:j?1:0,children:(0,v.jsx)(u.ZP,{alignItems:"center",children:(0,v.jsx)(p.CK,{inverted:g,muted:k})})})]})}))),(0,v.jsx)(d.Z,{block:!0,label:"Copy",size:null,widthFitContent:!0,children:(0,v.jsx)(r.CopyToClipboard,{onCopy:function(){return l.Am.success(P||"Successfully copied to clipboard.",{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:o})},text:o,children:n})})}},11074:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(38626),o=t(44897),r=t(42631),l=i.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;"," ",""],r.n_,(function(e){return"\n background-color: ".concat((e.theme.background||o.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)(l,{fullWidth:i,children:n})}},96348:function(e,n,t){"use strict";t.d(n,{g:function(){return b},Z:function(){return g}});var i=t(82684),o=t(38626),r=t(44897),l=t(42631),u=t(47041),c=t(70515),a=1.5*c.iI,s=1.5*c.iI,d=o.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-13p7y8j-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," ",""],l.n_,(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme||r.Z).background.page,";\n border: ").concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).interactive.defaultBorder,";\n box-shadow: ").concat((e.theme||r.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=o.default.div.withConfig({displayName:"indexstyle__RowContainerStyle",componentId:"sc-13p7y8j-1"})(["overflow:auto;border-bottom-left-radius:","px;border-bottom-right-radius:","px;"," "," "," ",""],l.n_,l.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=o.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-13p7y8j-2"})(["border-top-left-radius:","px;border-top-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,a,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n ")})),v=o.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-13p7y8j-3"})(["padding:","px ","px;"," "," "," "," "," ",""],s,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")}),(function(e){return e.sameColorBorders&&"\n border-bottom-color: ".concat((e.theme||r.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||r.Z.background).row2,";\n ")}),(function(e){return e.last&&e.noBorder&&"\n border-bottom-left-radius: ".concat(l.n_,"px;\n border-bottom-right-radius: ").concat(l.n_,"px;\n border-bottom: none;\n ")})),h=o.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-13p7y8j-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,a,2*c.iI,(function(e){return"\n border-top: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")})),m=t(28598),b=v;var g=function(e){var n=e.alternating,t=e.children,o=e.footer,r=e.header,l=e.maxHeight,u=e.minHeight,c=e.noBackground,a=e.noBoxShadow,s=e.sameColorBorders,v=e.scrollable,b=e.width,g=[].concat(t).filter((function(e){return null!==e}));return(0,m.jsxs)(d,{noBackground:c,noBoxShadow:a,width:b,children:[r&&(0,m.jsx)(f,{children:r}),(0,m.jsx)(p,{maxHeight:l,minHeight:u,scrollable:v,children:i.Children.map(g,(function(e,t){return e&&i.cloneElement(e,{last:t===g.length-1,sameColorBorders:s,secondary:n&&t%2===1})}))}),o&&(0,m.jsx)(h,{children:o})]})}},72191:function(e,n,t){"use strict";t.d(n,{_k:function(){return r},bL:function(){return o},l2:function(){return l}});var i=t(70515),o=(i.iI,2*i.iI),r=2.5*i.iI,l=3*i.iI},59967:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return fr}});var i=t(77837),o=t(21831),r=t(82394),l=t(75582),u=t(38860),c=t.n(u),a=t(56085),s=t(82684),d=t(69864),p=t(34376),f=t(65557),v=t(40761),h=t(44425),m=t(38626),b=t(70652),g=t(39867),x=t(15338),j=t(97618),y=t(55485),k=t(48670),Z=t(38276),P=t(30160),O=t(70515),w=t(55283),C=t(28598);function _(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?_(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var I=function(e){var n=e.blockRefs,t=e.hiddenBlocks,i=e.pipeline,o=e.setHiddenBlocks,l=(0,s.useContext)(m.ThemeContext),u=(0,s.useMemo)((function(){return(null===i||void 0===i?void 0:i.blocks)||[]}),[i]),c=(0,s.useMemo)((function(){var e=[],n=[];return u.forEach((function(i){var o=i.uuid;null!==t&&void 0!==t&&t[o]?e.push(i):n.push(i)})),{blocksHidden:e,blocksVisible:n}}),[u,t]),a=c.blocksHidden,d=c.blocksVisible,p=(0,s.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===d.length}),[u,d]),f=(0,s.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===a.length}),[u,a]),v=(0,s.useCallback)((function(e){var t=e.type,i=e.uuid;if(null!==n&&void 0!==n&&n.current){var o,r=n.current["".concat(t,"s/").concat(i,".py")];null===r||void 0===r||null===(o=r.current)||void 0===o||o.scrollIntoView()}}),[n]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:1,justifyContent:"center",children:(0,C.jsx)(b.Z,{checked:f,label:"Show all",onClick:function(){return o((function(){return{}}))}})}),(0,C.jsx)(j.Z,{flex:1,justifyContent:"center",children:(0,C.jsx)(b.Z,{checked:p,label:"Hide all",onClick:function(){return o((function(){return u.reduce((function(e,n){var t=n.uuid;return S(S({},e),{},(0,r.Z)({},t,!0))}),{})}))}})})]})}),(0,C.jsx)(x.Z,{medium:!0}),null===u||void 0===u?void 0:u.map((function(e){var n=e.uuid,i=(0,w.qn)(e.type,{blockColor:e.color,theme:l}).accent,u=!(null!==t&&void 0!==t&&t[n]);return(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){o((function(e){return S(S({},e),{},(0,r.Z)({},n,u))})),u||setTimeout((function(){return v(e)}),1)},preventDefault:!0,children:(0,C.jsx)(Z.Z,{mt:1,px:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(Z.Z,{pr:1,children:(0,C.jsx)(b.Z,{checked:u})}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(g.Z,{color:i,size:1.5*O.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(P.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},E=t(60523),T=t(71180),M=t(90299),D=t(65701),B=t(1254);var A=function(e){var n=e.size;return(0,C.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,C.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,C.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,C.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,C.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,C.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,C.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,C.jsxs)("defs",{children:[(0,C.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,C.jsx)("stop",{stopColor:"#FFDA19"}),(0,C.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,C.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,C.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,C.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,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.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,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.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,C.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,C.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,C.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,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.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,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},R=t(79818),N=t(93369),L=t(7267),F=t(57653),U=t(44085),H=t(4190),z=t(17488),W=t(35686),G=t(72473),K=t(4015),V=t(13803),q=t(72191),Y=t(2548),Q=t(81728),X=t(72619),J=t(23780);function $(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 ee(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ne=function(e){var n,t,i=e.block,o=e.defaultName,r=e.isUpdatingBlock,u=e.onClose,c=e.onSave,a=e.pipeline,p=(e.preventDuplicateBlockName,(0,J.VI)(null,{},[],{uuid:"ConfigureBlock"})),f=(0,l.Z)(p,1)[0],v=Object.keys((null===i||void 0===i?void 0:i.pipelines)||{}).length,m=(0,s.useRef)(null),b=(0,s.useState)({color:(null===i||void 0===i?void 0:i.color)||null,language:(null===i||void 0===i||null===(n=i.defaults)||void 0===n?void 0:n.language)||(null===i||void 0===i?void 0:i.language),name:o,type:null===i||void 0===i?void 0:i.type}),g=b[0],x=b[1];(0,s.useEffect)((function(){var e;null===m||void 0===m||null===(e=m.current)||void 0===e||e.focus()}),[]);var k=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===a||void 0===a?void 0:a.type)}),[a]),w=(0,s.useMemo)((function(){return h.tf.CUSTOM===(null===i||void 0===i?void 0:i.type)}),[i]),_=(0,s.useMemo)((function(){return h.tf.MARKDOWN===(null===i||void 0===i?void 0:i.type)}),[i]),S=(0,s.useMemo)((function(){return null===i||void 0===i?void 0:i.block_action_object}),[i]),I=(0,s.useMemo)((function(){return Y.L.GENERATE_BLOCK===(null===S||void 0===S?void 0:S.object_type)}),[S]),E=(0,s.useMemo)((function(){return I&&(null===S||void 0===S?void 0:S.description)}),[S,I]),M=(0,s.useMemo)((function(){var e;return V.I.DATA_INTEGRATION===(null===i||void 0===i||null===(e=i.config)||void 0===e?void 0:e.template_type)||!![V.O.DESTINATIONS,V.O.SOURCES].includes(null===S||void 0===S?void 0:S.language)}),[i,S]),$=(0,s.useState)(null),ne=$[0],te=$[1],ie=(0,d.Db)(W.ZP.llms.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.llm,t=(null===n||void 0===n?void 0:n.response)||{},i=t.block_type,o=t.configuration,r=t.content,l=t.language;x((function(e){return ee(ee({},e),{},{block_action_object:null,configuration:o,content:r,language:l,type:i})})),te(n)},onErrorCallback:function(e,n){return f({errors:n,response:e})}})}}),oe=(0,l.Z)(ie,2),re=oe[0],le=oe[1].isLoading;(0,s.useEffect)((function(){I&&E&&!ne&&re({llm:{request:{block_description:E},use_case:L.z.GENERATE_BLOCK_WITH_DESCRIPTION}})}),[re,E,I,ne]);var ue=(0,s.useMemo)((function(){var e,n;return null!==i&&void 0!==i&&null!==(e=i.config)&&void 0!==e&&e.custom_template?null===i||void 0===i||null===(n=i.config)||void 0===n?void 0:n.custom_template:[Y.L.CUSTOM_BLOCK_TEMPLATE,Y.L.MAGE_TEMPLATE].includes(null===S||void 0===S?void 0:S.object_type)?ee(ee({},S),{},{name:null===S||void 0===S?void 0:S.title}):void 0}),[i,S]),ce=(0,s.useMemo)((function(){var e=(null===g||void 0===g?void 0:g.type)||(null===i||void 0===i?void 0:i.type);ue&&(e=null===ue||void 0===ue?void 0:ue.block_type);var n=h.V4[e];return k&&(h.tf.DATA_LOADER===e?n="Source":h.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[i,g,ue,k]);return(0,C.jsxs)(K.Nk,{width:I&&(null===g||void 0===g?void 0:g.content)&&80*O.iI,children:[(0,C.jsxs)(K.I5,{children:[I&&le&&(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(P.ZP,{children:"Generating block using AI..."}),(0,C.jsx)(H.Z,{inverted:!0})]}),I&&!le&&(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(G.xq,{size:5*O.iI,warning:!0})}),!I&&(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(A,{size:15*O.iI})})]}),I&&!le&&(0,C.jsx)(K.gI,{children:(0,C.jsxs)(Z.Z,{py:1,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(P.ZP,{default:!0,children:"Block generated using AI"})}),(0,C.jsx)(P.ZP,{textOverflow:!0,children:E})]})}),ue&&(0,C.jsx)(K.gI,{children:(0,C.jsxs)(Z.Z,{py:1,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(P.ZP,{default:!0,children:"Template"})}),(0,C.jsx)(P.ZP,{textOverflow:!0,children:null===(t=(null===ue||void 0===ue?void 0:ue.name)||(null===ue||void 0===ue?void 0:ue.template_uuid))||void 0===t?void 0:t.slice(0,40)})]})}),h.tf.GLOBAL_DATA_PRODUCT!==(null===i||void 0===i?void 0:i.type)&&v>1&&(0,C.jsxs)(K.gI,{children:[(0,C.jsx)(j.Z,{flex:"1",children:(0,C.jsx)(G.uy,{size:q.l2,warning:!0})}),(0,C.jsx)(j.Z,{flex:"6",children:(0,C.jsxs)(P.ZP,{bold:!0,warning:!0,children:["Renaming this block will affect ",v," pipelines. The renamed block may need to be re-added to the shared pipeline(s)."]})})]}),(0,C.jsxs)(K.gI,{children:[(0,C.jsx)(P.ZP,{default:!0,children:"Name"}),(0,C.jsx)(z.Z,{alignRight:!0,noBackground:!0,noBorder:!0,onChange:function(e){return x((function(n){return ee(ee({},n),{},{name:e.target.value})}))},paddingVertical:O.iI,placeholder:"Block name...",ref:m,value:(null===g||void 0===g?void 0:g.name)||""})]}),(0,C.jsxs)(K.gI,{children:[(0,C.jsx)(P.ZP,{default:!0,children:"Type"}),(0,C.jsx)(Z.Z,{mr:O.cd,py:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(P.ZP,{muted:!0,children:ce}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(G.QM,{muted:!0})]})})]}),!_&&(w||ue||(null===g||void 0===g?void 0:g.language))&&(0,C.jsxs)(K.gI,{paddingVerticalAddition:3,children:[(0,C.jsx)(P.ZP,{default:!0,children:"Language"}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[[h.t6.PYTHON,h.t6.SQL,h.t6.R,h.t6.YAML].reduce((function(e,n){var t=(ue?null===ue||void 0===ue?void 0:ue.language:null===g||void 0===g?void 0:g.language)===n;return!(w&&!r||t||M&&h.t6.R!==n&&M&&h.t6.SQL!==n)||w&&h.t6.YAML===n||e.push((0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(T.Z,{borderColor:t?null:"transparent",compact:!0,default:!w&&!t&&!M,disabled:!w&&!t&&!M,noBackground:!0,notClickable:(!w||r||!M)&&t,onClick:ue&&!M?null:function(){return x((function(e){return ee(ee({},e),{},{language:n})}))},selected:t,children:h.LE[n]})},n)),e}),[]),!w&&!M&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(G.QM,{muted:!0})]}),(0,C.jsx)(Z.Z,{mr:w||M?1:2})]})]}),(w||(null===ue||void 0===ue?void 0:ue.color)||(null===g||void 0===g?void 0:g.color))&&(0,C.jsxs)(K.gI,{children:[(0,C.jsx)(P.ZP,{default:!0,children:"Color"}),w&&(0,C.jsxs)(U.Z,{alignRight:!0,noBackground:!0,noBorder:!0,onChange:function(e){return x((function(n){return ee(ee({},n),{},{color:e.target.value})}))},value:ue?(null===ue||void 0===ue?void 0:ue.color)||"":(null===g||void 0===g?void 0:g.color)||"",children:[(0,C.jsx)("option",{value:""}),Object.values(h.Lq).map((function(e){return(0,C.jsx)("option",{value:e,children:(0,Q.kC)(e)},e)}))]}),!w&&(0,C.jsx)(Z.Z,{mr:O.cd,py:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(P.ZP,{muted:!0,children:(0,Q.kC)((null===ue||void 0===ue?void 0:ue.color)||(null===g||void 0===g?void 0:g.color)||"")}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(G.QM,{muted:!0})]})})]}),I&&(null===g||void 0===g?void 0:g.content)&&(0,C.jsx)(K.gI,{display:"block",children:(0,C.jsx)(Z.Z,{pr:O.cd,py:1,children:(0,C.jsx)(D.W,{backend:B.PD,children:(0,C.jsx)(R.Z,{block:ee(ee({},g),{},{uuid:E}),defaultValue:null===g||void 0===g?void 0:g.content,disableDrag:!0,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,noDivider:!0,onChange:function(e){return x((function(n){return ee(ee({},n),{},{content:e})}))},selected:!0,textareaFocused:!0},E)})})}),(0,C.jsx)(K.$b,{children:(0,C.jsxs)(y.ZP,{fullWidth:!0,children:[(0,C.jsxs)(N.ZP,{bold:!0,centerText:!0,disabled:le,onClick:function(){return c(ee(ee({},g),{},{name:(null===g||void 0===g?void 0:g.name)||o}))},primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:["Save and ",r?"update":"add"," block"]}),(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(T.Z,{onClick:u,tabIndex:0,children:"Cancel"})})]})})]})},te=t(54750),ie=t(4804),oe=t(75810),re=t(85854),le=t(99236),ue=t(29480),ce=t(37443),ae=t(53405);function se(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 de(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?se(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pe=function(e){var n=e.block,t=e.blockConfigString,i=e.blockContent,o=e.blockUpstreamBlocks,r=e.dataIntegrationConfiguration,u=e.onChangeCodeBlock,c=e.pipeline,a=e.savePipelineContent,p=e.setBlockConfigString,f=e.setBlockContent,v=e.setSelectedSubTab,m=e.showError,b=n||{},j=b.language,w=b.type,_=b.uuid,S=(c||{}).uuid,I=(0,s.useState)(!1),E=I[0],M=I[1],D=(0,s.useMemo)((function(){return h.t6.YAML===j&&i?(0,ie.Qc)(i):{}}),[i,j]);(0,s.useEffect)((function(){D&&!t&&p((0,ie.Pz)(null===D||void 0===D?void 0:D.config))}),[t,D]);var B=(0,s.useState)(!1),A=B[0],R=B[1],N=(0,d.Db)(W.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.integration_source;null!==n&&void 0!==n&&n.error_message?m({response:{error:{exception:null===n||void 0===n?void 0:n.error_message}}}):null!==n&&void 0!==n&&n.success&&R(!0)},onErrorCallback:function(e,n){return m({errors:n,response:e})}})}}),L=(0,l.Z)(N,2),F=L[0],U=L[1].isLoading,H=(0,s.useCallback)((function(){return a().then((function(){return F({integration_source:{action_type:"test_connection",block_uuid:_,pipeline_uuid:S}})}))}),[_,F,S,a]),z=(0,s.useMemo)((function(){if(h.t6.YAML===j)return(0,C.jsx)(ue.$W,{children:(0,C.jsx)(oe.Z,{autoHeight:!0,language:j,onChange:function(e){p(e);try{var n=(0,ie.Qc)(e),t=(0,ie.Pz)(de(de({},D),{},{config:n}));u(w,_,t),M(!1)}catch(i){M(!0)}},tabSize:2,value:t||void 0,width:"100%"})});h.t6.PYTHON}),[t,i,D,j,w,_,f]),K=(0,s.useMemo)((function(){return(0,ae.Wi)(o,r)}),[o,r]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(G.Ae,{success:!0}),loading:U,onClick:function(){R(!1),H()},secondary:!0,compact:!0,children:"Test connection"}),A&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mr:O.cd}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(g.Z,{size:1*O.iI,success:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(P.ZP,{success:!0,children:"Connection successful"})]})]})]})}),(0,C.jsx)(x.Z,{light:!0}),(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsx)(P.ZP,{bold:!0,default:!0,large:!0,children:"Inputs from upstream blocks"}),0===(null===K||void 0===K?void 0:K.length)&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{muted:!0,children:["No inputs are selected. Toggle the upstream blocks in the ",(0,C.jsx)(k.Z,{bold:!0,onClick:function(){return v(ce.tw.UPSTREAM_BLOCK_SETTINGS)},preventDefault:!0,children:"Upstream block settings"})," to enable its output data as an input."]})})]}),(null===K||void 0===K?void 0:K.length)>=1&&(0,C.jsx)(le.Z,{inputsBlocks:K}),E&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(x.Z,{light:!0}),(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(re.Z,{danger:!0,level:5,children:"ERROR"})}),(0,C.jsxs)(P.ZP,{muted:!0,children:["The credentials configuration is formatted incorrectly for the language ",h.LE[j],". The formatting must be fixed before the credentials configuration can be saved."]})]})]}),z]})},fe=t(56747),ve=t(96348),he=t(26304),me=t(93859),be=t(66909),ge=t(42122);var xe=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.setSelectedSubTab,r=e.showError,u=e.stream,c=(0,s.useRef)(null),a=(0,s.useState)(null),p=a[0],f=a[1],v=(0,s.useState)(100),h=v[0],m=(v[1],(0,s.useState)(0)),b=m[0],g=m[1];(0,s.useEffect)((function(){var e,n;null!==c&&void 0!==c&&null!==(e=c.current)&&void 0!==e&&e.getBoundingClientRect().height&&g(null===c||void 0===c||null===(n=c.current)||void 0===n?void 0:n.getBoundingClientRect().height)}),[c]);var x=null===i||void 0===i?void 0:i.uuid,j=null===n||void 0===n?void 0:n.uuid,y=(0,s.useMemo)((function(){return{parentStreamID:(0,ae.Qu)(u),streamID:(0,ae.M$)(u)}}),[u]),w=y.parentStreamID,_=y.streamID,S=(0,s.useMemo)((function(){return(0,ge.Qr)((0,ae.WE)(u||{})||{},{idIsInObject:!0})}),[u]),I=W.ZP.outputs.pipelines.detail(!p&&x,!p&&j,{parent_stream:w,sample_count:h,stream:_},{revalidateOnFocus:!1}).data,E=(0,d.Db)(W.ZP.outputs.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.output;f(n)},onErrorCallback:function(e,n){return r({errors:n,response:e})}})}}),M=(0,l.Z)(E,2),D=M[0],B=M[1].isLoading,A=(0,s.useCallback)((function(){return D({output:{block_uuid:j,persist:1,pipeline_uuid:x,refresh:1,sample_count:h,streams:[{parent_stream:w,stream:_}]}})}),[j,D,w,x,h,_]),R=(0,s.useMemo)((function(){return p||(null===I||void 0===I?void 0:I.output)}),[I,p]),N=(0,s.useMemo)((function(){var e,n=(R||{}).outputs,t=void 0===n?[]:n;return null===t||void 0===t||null===(e=t.find((function(e){return e.uuid===_})))||void 0===e?void 0:e.data}),[R,_]),L=(0,s.useMemo)((function(){var e=N||{},n=e.sample_data,i=(e.type,n||{}),o=i.columns,r=i.rows;if(null!==o&&void 0!==o&&o.length&&null!==r&&void 0!==r&&r.length)return(0,C.jsx)(me.Z,{columnHeaderHeight:be.Eh,columns:o,height:t-b,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,rows:r})}),[N,t,b]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{p:O.cd,ref:c,children:S?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(P.ZP,{default:!0,children:"Please select at least 1 column in the stream in order to fetch sample data."}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(k.Z,{bold:!0,onClick:function(){return o(ce.tw.SETTINGS)},preventDefault:!0,children:"Go to Schema properties to select a column"})})]}):(0,C.jsx)(T.Z,{compact:!0,loading:B,onClick:function(){return A()},primary:!0,children:N?"Refresh sample data":"Fetch sample data"})}),L]})},je=t(31882),ye=t(75499),ke=t(69650),Ze=t(12468),Pe=t(61599),Oe=t(44897),we=t(42631),Ce=m.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-wjbb3f-0"})(["border-radius:","px;"," ",""],we.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||Oe.Z.borders).light,";\n ")}),(function(e){return!e.noPadding&&"\n padding: ".concat(O.cd*O.iI,"px;\n ")})),_e=t(86735);function Se(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 Ie(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ee=function(e){var n,t=e.block,i=(e.blocksMapping,e.onChangeBlock),u=e.setBlockAttributes,c=e.stream,a=(e.streamMapping,e.updateStreamsInCatalog),d=(0,s.useRef)(null),p=(0,s.useState)({}),f=p[0],v=p[1],m=c||{},b=m.auto_add_new_fields,g=m.bookmark_properties,x=m.destination_table,k=m.disable_column_type_check,w=m.key_properties,_=m.partition_keys,S=m.replication_method,I=m.run_in_parallel,E=m.unique_conflict_method,M=m.unique_constraints,D=(0,ae.M$)(c),B=(0,ae.WD)(c),A=(0,ae.Z5)(c),R=null===t||void 0===t||null===(n=t.metadata)||void 0===n?void 0:n.data_integration,N=(null===R||void 0===R?void 0:R.source)||(null===R||void 0===R?void 0:R.destination),L=(0,s.useCallback)((function(e){return a(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,a]),F=(0,s.useCallback)((function(e,n){L([Ie(Ie({},c),{},(0,r.Z)({},e,n))])}),[c,L]),H=(0,s.useMemo)((function(){var e,n=[],t={},i=[],r=(0,ae.RP)(c)||{};return null===(e=Object.entries(r||{}))||void 0===e||e.forEach((function(e){var o,r=(0,l.Z)(e,2),u=r[0],c=r[1],a=c.metadata,s=c.type;n.push(u),(!a||null===a||void 0===a||!a.metadata||null!==a&&void 0!==a&&null!==(o=a.metadata)&&void 0!==o&&o.selected)&&i.push(u);null===s||void 0===s||s.filter((function(e){return e!==Pe.RL.NULL}));if((null===s||void 0===s?void 0:s.length)>=1){var d=s[(null===s||void 0===s?void 0:s.length)-1];null!==t&&void 0!==t&&t[d]||(t[d]=[]),t[d].push(u)}})),(0,C.jsx)(ye.Z,{columnFlex:[1,1],rows:[[(0,C.jsx)(P.ZP,{children:"Number of columns selected"},"columns"),(0,C.jsxs)(P.ZP,{monospace:!0,rightAligned:!0,children:[null===i||void 0===i?void 0:i.length," ",(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,muted:!0,children:"/"})," ",null===n||void 0===n?void 0:n.length]},"columns-value")]].concat((0,o.Z)((0,_e.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,C.jsxs)(P.ZP,{children:[(0,Q.vg)(t)," columns"]},"columns-".concat(t)),(0,C.jsx)(P.ZP,{monospace:!0,rightAligned:!0,children:null===i||void 0===i?void 0:i.length},"columns-value-".concat(t))]}))),(0,o.Z)([["Bookmarks",g,"bookmark_properties"],["Unique constraints",M,"unique_constraints"],["Key properties",w,"key_properties"],["Partition keys",_,"partition_keys"]].map((function(e){var n,t=(0,l.Z)(e,3),i=t[0],o=t[1],r=t[2];return[(0,C.jsx)(P.ZP,{children:i},i),(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:[!(null!==o&&void 0!==o&&o.length)&&(0,C.jsx)(P.ZP,{muted:!0,monospace:!0,children:"-"}),null===(n=(0,_e.YC)(o||[],(function(e){return e})))||void 0===n?void 0:n.map((function(e){return(0,C.jsx)("div",{style:{marginLeft:O.iI/2},children:(0,C.jsx)(je.Z,{label:e,onClick:function(){return F(r,(0,_e.Od)(o,(function(n){return n===e})))},xsmall:!0})},"".concat(i,"-value-").concat(e))}))]},"".concat(i,"-value"))]}))))})}),[g,w,_,c,M,F]),W=(0,s.useMemo)((function(){return B in f?null===f||void 0===f?void 0:f[B]:x}),[x,f,B]);return(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(Ce,{children:[(0,C.jsx)(P.ZP,{default:!0,uppercase:!0,children:"Output"}),(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(P.ZP,{large:!0,children:"Destination table"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Ze.Z,{label:(0,C.jsxs)(P.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:D}),". To change the table name, enter in a different value."]}),lightBackground:!0}),(0,C.jsx)(Z.Z,{mr:O.cd})]}),(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(z.Z,{fullWidth:!0,monospace:!0,onChange:function(e){var n,t=null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value;v((function(e){return Ie(Ie({},e),{},(0,r.Z)({},B,t))})),clearTimeout(d.current),d.current=setTimeout((function(){return F("destination_table",t)}),300)},value:W||""})})]})})]})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(Ce,{children:[(0,C.jsx)(P.ZP,{default:!0,uppercase:!0,children:"Settings"}),(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(P.ZP,{large:!0,children:"Replication method"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Ze.Z,{label:(0,C.jsxs)(P.ZP,{children:["Do you want to synchronize the entire stream (",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.FULL_TABLE}),") on each pipeline run or only new records (",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.INCREMENTAL}),")?",Pe.th.POSTGRESQL===N&&(0,C.jsxs)(P.ZP,{children:["Log-based incremental replication (",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0}),(0,C.jsx)(Z.Z,{mr:O.cd}),(0,C.jsx)(U.Z,{defaultColor:!0,onChange:function(e){return F("replication_method",e.target.value)},placeholder:"Select an option",value:S,children:Object.values(Pe._B).map((function(e){return(0,C.jsx)("option",{value:e,children:(0,Q.vg)(e)},e)}))})]})}),(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(P.ZP,{large:!0,children:"Unique conflict method"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Ze.Z,{label:(0,C.jsxs)(P.ZP,{children:["If a new record has the same value as an existing record in the ",(0,Q._6)("unique column",null===M||void 0===M?void 0:M.length),(null===M||void 0===M?void 0:M.length)>0&&(0,C.jsx)(C.Fragment,{children:"\xa0"}),null===M||void 0===M?void 0:M.sort().map((function(e,n){return(0,C.jsxs)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===M||void 0===M?void 0:M.length)&&n===(null===M||void 0===M?void 0:M.length)-1?(0,C.jsx)(P.ZP,{inline:!0,children:" and "},e):n>=1&&(0,C.jsx)(C.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0}),(0,C.jsx)(Z.Z,{mr:O.cd}),(0,C.jsx)(U.Z,{defaultColor:!0,onChange:function(e){return F("unique_conflict_method",e.target.value)},placeholder:"Select an option",value:E,children:Object.values(Pe.MU).map((function(e){return(0,C.jsx)("option",{value:e,children:(0,Q.vg)(e)},e)}))})]})})]})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(Ce,{children:[(0,C.jsx)(P.ZP,{default:!0,uppercase:!0,children:"Options"}),(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Run streams in parallel"}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(P.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."})})]}),(0,C.jsx)(Z.Z,{mr:O.cd}),(0,C.jsx)(ke.Z,{checked:!!I,onCheck:function(e){return F("run_in_parallel",e(I))}})]})}),h.tf.DATA_EXPORTER===(null===t||void 0===t?void 0:t.type)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(P.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,C.jsx)(Z.Z,{mr:O.cd}),(0,C.jsx)(ke.Z,{checked:!!b,onCheck:function(e){return F("auto_add_new_fields",e(b))}})]})}),(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(P.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\u2019t 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,C.jsx)(Z.Z,{mr:O.cd}),(0,C.jsx)(ke.Z,{checked:!!k,onCheck:function(e){return F("disable_column_type_check",e(k))}})]})})]})]})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(Ce,{noPadding:!0,children:[(0,C.jsx)(Z.Z,{pt:O.cd,px:O.cd,children:(0,C.jsx)(P.ZP,{default:!0,uppercase:!0,children:"Summary"})}),(0,C.jsx)(Z.Z,{mt:O.cd,pb:O.cd,children:H})]})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(Ce,{children:[(0,C.jsx)(P.ZP,{default:!0,uppercase:!0,children:"Other"}),(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(P.ZP,{large:!0,children:"Select stream"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(ke.Z,{checked:!!A,onCheck:function(e){return L([(0,ae.XE)(c,{selected:e(A)})])}})]})}),(0,C.jsx)(Z.Z,{mt:O.HN,children:(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)(T.Z,{danger:!0,onClick:function(){window.confirm("Are you sure you want to remove stream ".concat(D," from block ").concat(null===t||void 0===t?void 0:t.uuid,"?"))&&u((function(e){var n,t=Ie(Ie({},e),{},{catalog:Ie(Ie({},null===e||void 0===e?void 0:e.catalog),{},{streams:(0,_e.Od)(null===e||void 0===e||null===(n=e.catalog)||void 0===n?void 0:n.streams,(function(e){return(0,ae.WD)(e)===B}))})});return null===i||void 0===i||i(t),t}))},children:"Delete stream from block"})})})]})})]})},Te=t(11074),Me=t(69632),De=t(3314);function Be(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 Ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Be(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Be(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Re=function(e){e.block,e.blocksMapping;var n=e.highlightedColumnsMapping,t=e.onChangeBlock,i=e.setBlockAttributes,o=e.setHighlightedColumnsMapping,u=e.setSelectedSubTab,c=e.setStreamsMappingConflicts,a=e.showStreamConflicts,d=e.stream,p=e.streamMapping,f=e.streamsMappingConflicts,v=(0,s.useCallback)((function(e){i((function(n){var i=e(n);return null===t||void 0===t||t(i),i}))}),[t,i]),h=(0,s.useMemo)((function(){return(0,ae.RP)(d)||{}}),[d]),m=(0,s.useState)(null),k=m[0],w=m[1],_=(0,s.useState)(null),S=_[0],I=_[1],E=(0,s.useRef)(null),M=(0,s.useState)(null),D=M[0],B=M[1],A=(0,s.useCallback)((function(){B(null),w(null)}),[B,w]);(0,s.useEffect)((function(){var e;return null===(e=document)||void 0===e||e.addEventListener("click",A),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("click",A)}}),[A]);var R=(0,s.useMemo)((function(){var e=d.bookmark_properties,n=d.key_properties,t=d.partition_keys,i=(d.replication_method,d.unique_constraints);return{bookmarkPropertiesMapping:(0,_e.HK)(e||[],(function(e){return e})),keyPropertiesMapping:(0,_e.HK)(n||[],(function(e){return e})),partitionKeysMapping:(0,_e.HK)(t||[],(function(e){return e})),uniqueConstraintsMapping:(0,_e.HK)(i||[],(function(e){return e}))}}),[d]),N=R.bookmarkPropertiesMapping,L=R.keyPropertiesMapping,F=R.partitionKeysMapping,U=R.uniqueConstraintsMapping,H=(0,s.useMemo)((function(){var e,n;return null===(e=(0,_e.YC)(Object.entries(h||{}),(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]}}))}),[h]),z=((0,s.useMemo)((function(){return(0,ae.MB)(d)}),[d]),(0,s.useMemo)((function(){return(0,ae.Nf)(d)}),[d])),W=(0,s.useMemo)((function(){var e=[null,1,1,null],n=null===H||void 0===H?void 0:H.every((function(e){var n,t,i,o=e.property;return!(null!==o&&void 0!==o&&o.metadata)||!(null!==o&&void 0!==o&&null!==(n=o.metadata)&&void 0!==n&&n.metadata)||(null===o||void 0===o||null===(t=o.metadata)||void 0===t||null===(i=t.metadata)||void 0===i?void 0:i.selected)})),t=[{label:function(){return(0,C.jsx)(ke.Z,{checked:n,compact:!0,onCheck:function(e){return function(e){var n=null===H||void 0===H?void 0:H.reduce((function(n,t){var i=t.column,o=(null===z||void 0===z?void 0:z[i])||(0,ae.jC)(i);return n[i]=Ae(Ae({},o),{},{metadata:Ae(Ae({},null===o||void 0===o?void 0:o.metadata),e)}),n}),{});v((function(e){return(0,ae.$C)((0,ae.AP)(d,n),e)}))}({selected:e(n)})}})},uuid:"action"},{uuid:"Property"},{uuid:"Types"},{center:!0,uuid:"Unique"}],i=d.replication_method;return Pe._B.INCREMENTAL===i&&(e.push(null),t.push({center:!0,uuid:"Bookmark"})),e.push.apply(e,[null,null]),t.push.apply(t,[{center:!0,uuid:"Key"},{center:!0,uuid:"Partition"}]),{columnFlex:e,columns:t}}),[H,v,d,z]),K=W.columnFlex,V=W.columns,q=(0,s.useCallback)((function(e,n,t){var i,o=t||{},l=o.disableEdit,u=o.key,c=(0,ae.wx)(e,n),a=(null===c||void 0===c?void 0:c.typesDerived)||[];return(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[null===(i=a||[])||void 0===i?void 0:i.map((function(n){return(0,C.jsx)("div",{style:{paddingBottom:1,marginRight:2,paddingTop:1},children:(0,C.jsx)(je.Z,{label:n,onClick:l?null:function(t){(0,De.j)(t);var i=!(null===a||void 0===a||!a.includes(n))?(0,ae.VZ)([n],c):(0,ae.qx)([n],c),o={anyOf:null===i||void 0===i?void 0:i.anyOf,format:null===i||void 0===i?void 0:i.format,type:null===i||void 0===i?void 0:i.type};v((function(n){return(0,ae.$C)((0,ae.KN)(d,(0,r.Z)({},e,o)),n)}))},xsmall:!0})},"".concat(e,"-").concat(u||"types","-").concat(n))})),!l&&(0,C.jsx)(T.Z,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,De.j)(e),B({x:e.pageX,y:e.pageY}),w(c)},children:(0,C.jsx)(G.I8,{default:!0})})]},"".concat(e,"-").concat(u||"types"))}),[v,B,w,d,ae.$C]),Y=(0,s.useMemo)((function(){return null===H||void 0===H?void 0:H.map((function(e){var n,t=e.column,i=e.property,o=d.bookmark_properties,u=d.key_properties,c=d.partition_keys,a=d.replication_method,s=d.unique_constraints,p=(i.anyOf,i.format,i.metadata),f=(i.type,(0,ae.wx)(t,i)),h=(null===f||void 0===f||f.typesDerived,!p||!(null!==p&&void 0!==p&&p.metadata)||(null===p||void 0===p||null===(n=p.metadata)||void 0===n?void 0:n.selected)),m=null===U||void 0===U?void 0:U[t],g=null===N||void 0===N?void 0:N[t],x=null===L||void 0===L?void 0:L[t],j=null===F||void 0===F?void 0:F[t],k=[(0,C.jsx)("div",{style:{minHeight:22},children:(0,C.jsx)(ke.Z,{checked:h,compact:!0,onCheck:function(e){v((function(n){return(0,ae.$C)((0,ae.AP)(d,(0,r.Z)({},t,Ae(Ae({},p),{},{metadata:Ae(Ae({},null===p||void 0===p?void 0:p.metadata),{},{selected:e(h)})}))),n)}))}})},"".concat(t,"-selected")),(0,C.jsx)(P.ZP,{monospace:!0,children:t},"".concat(t,"-column")),q(t,f),(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(b.Z,{checked:m,onClick:function(e){(0,De.j)(e),v((function(e){return(0,ae.$C)(Ae(Ae({},d),{},{unique_constraints:m?(0,_e.Od)(s||[],(function(e){return e===t})):(0,_e.Hl)(t,s||[])}),e)}))}})},"".concat(t,"-unique"))],Z=[];return Pe._B.INCREMENTAL===a&&Z.push([g,"bookmark_properties",o]),Z.push.apply(Z,[[x,"key_properties",u],[j,"partition_keys",c]]),Z.forEach((function(e){var n=(0,l.Z)(e,3),i=n[0],o=n[1],u=n[2];k.push((0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(b.Z,{checked:i,onClick:function(e){(0,De.j)(e),v((function(e){return(0,ae.$C)(Ae(Ae({},d),{},(0,r.Z)({},o,i?(0,_e.Od)(u||[],(function(e){return e===t})):(0,_e.Hl)(t,u||[]))),e)}))}})},"".concat(t,"-").concat(o)))})),k}))}),[N,L,F,q,h,H,v,B,w,d,U]),Q=(0,s.useCallback)((function(e){var t=null===H||void 0===H?void 0:H[e];return Ae(Ae({},t),{},{highlighted:!(null===n||void 0===n||!n[null===t||void 0===t?void 0:t.column])})}),[n,H]),X=(0,s.useMemo)((function(){var e;if(D&&k){var n=21*O.iI,t=(null===E||void 0===E||null===(e=E.current)||void 0===e?void 0:e.getBoundingClientRect())||{},i=t.x,o=t.width,l=D||{},u=l.x,c=void 0===u?0:u,a=l.y,s=void 0===a?0:a,p=c;c+n>=i+o&&(p=i+o-(n+O.iI)),p<0&&(p=0);var f=(null===h||void 0===h?void 0:h[null===k||void 0===k?void 0:k.uuid])||{},m=(0,ae.wx)(null===k||void 0===k?void 0:k.uuid,f||{}),x=m||{},j=x.typesDerived,P=void 0===j?[]:j,_=x.uuid;return(0,C.jsx)("div",{onClick:De.j,style:{left:p,position:"fixed",top:s+O.iI/2,width:n,zIndex:100},children:(0,C.jsxs)(Te.Z,{children:[(0,C.jsx)("div",{style:{position:"relative"},children:(0,C.jsx)(T.Z,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,De.j)(e),B(null),w(null)},style:{position:"absolute",right:-.5*O.iI,top:-.5*O.iI,zIndex:1},children:(0,C.jsx)(g.Z,{default:!0,size:2.5*O.iI,children:(0,C.jsx)(G.x8,{size:1.5*O.iI})})})}),(0,C.jsx)(Z.Z,{p:O.cd,children:Pe.D5.map((function(e,n){var t=!(null===P||void 0===P||!P.includes(e));return(0,C.jsx)("div",{style:{marginTop:0===n?0:4},children:(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)(b.Z,{checked:t,label:e,onClick:function(n){(0,De.j)(n);var i=t?(0,ae.VZ)([e],m):(0,ae.qx)([e],m),o={anyOf:null===i||void 0===i?void 0:i.anyOf,format:null===i||void 0===i?void 0:i.format,type:null===i||void 0===i?void 0:i.type};v((function(e){return(0,ae.$C)((0,ae.KN)(d,(0,r.Z)({},_,o)),e)}))}})})},e)}))})]})})}}),[D,k,E,h,v,B,w,d]),J=(0,s.useMemo)((function(){return(0,ae.p$)(d,f,p)}),[d,p,f]),$=(0,s.useCallback)((function(e,n){var t,i=null===J||void 0===J?void 0:J.stream,o=null===i||void 0===i||null===(t=i.schema)||void 0===t?void 0:t.properties;I((function(t){var i=Ae({},t);return null===e||void 0===e||e.forEach((function(e){n?i[e]=null===o||void 0===o?void 0:o[e]:e in i&&(null===i||void 0===i||delete i[e])})),i}))}),[J,I]),ee=(0,s.useCallback)((function(e){var n=e||{},t=n.column,i=n.property,o=n.currentProperty,r=!(null===S||void 0===S||!S[t]),l=[(0,C.jsx)(b.Z,{checked:r,onClick:function(e){(0,De.j)(e),$([t],!r)}},"".concat(t,"-accept")),(0,C.jsx)(P.ZP,{monospace:!0,children:t},"".concat(t,"-property")),q(t,i,{disableEdit:!0})];return o?l.push(q(t,o,{disableEdit:!0,key:"types-current"})):l.push((0,C.jsx)("div",{},"".concat(t,"-empty"))),l}),[q,S,I,$]),ne=(0,s.useCallback)((function(e,n){var t=n||{},i=t.columnFlex,o=t.columns,r=(null===e||void 0===e?void 0:e.map((function(e){return e.column})))||[],l=null===r||void 0===r?void 0:r.every((function(e){return!(null===S||void 0===S||!S[e])}));return(0,C.jsx)(ye.Z,{columnFlex:[null,1].concat(i||[]),columns:[{label:function(){return(0,C.jsx)(b.Z,{checked:l,onClick:function(e){(0,De.j)(e),$(r,!l)}})},uuid:"Accept change"},{uuid:"Property"}].concat(o||[]),highlightRowOnHover:!0,onClickRow:function(n){var t=null===e||void 0===e?void 0:e[n],i=null===t||void 0===t?void 0:t.column,o=!(null===S||void 0===S||!S[i]);$([i],!o)},rows:null===e||void 0===e?void 0:e.map(ee)})}),[ee,S,$]),te=(0,s.useMemo)((function(){var e,n;if(!J)return null;var t=J.newColumnSettings,i=J.newColumns,o=J.stream,r=null===o||void 0===o||null===(e=o.schema)||void 0===e?void 0:e.properties,u=null===(n=(0,_e.YC)(i,(function(e){return e})))||void 0===n?void 0:n.map((function(e){return{column:e,property:null===r||void 0===r?void 0:r[e]}})),c=(0,_e.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===r||void 0===r?void 0:r[t],currentProperty:null===h||void 0===h?void 0:h[t]}}));return(0,C.jsxs)(C.Fragment,{children:[(null===u||void 0===u?void 0:u.length)>=1&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsx)(re.Z,{level:5,warning:!0,children:"New properties"})}),(0,C.jsx)(x.Z,{light:!0}),ne(u,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{label:function(){return""},uuid:"empty"}]})]}),(null===c||void 0===c?void 0:c.length)>=1&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsx)(re.Z,{level:5,warning:!0,children:"Properties with new types"})}),(0,C.jsx)(x.Z,{light:!0}),ne(c,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{uuid:"Types (current)"}]})]})]})}),[J,ne,h,d]),ie=(0,s.useMemo)((function(){return(0,C.jsx)(ye.Z,{columnFlex:K,columns:V,highlightRowOnHover:!0,isSelectedRow:function(e){var n;return null===(n=Q(e))||void 0===n?void 0:n.highlighted},menu:X,onClickRow:function(e){var n=Q(e),t=n.column,i=n.highlighted;o((function(e){return i?(0,ge.gR)(e,[t]):Ae(Ae({},e),{},(0,r.Z)({},t,!0))}))},ref:E,rows:Y,stickyHeader:!0})}),[K,V,Q,E,X,Y,o]);return(0,C.jsxs)(C.Fragment,{children:[a&&te&&(0,C.jsxs)(Z.Z,{my:O.cd,children:[(0,C.jsx)(Z.Z,{px:O.cd,children:(0,C.jsx)(Me.NJ,{children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(j.Z,{children:(0,C.jsx)(G.uy,{size:2*O.iI,warning:!0})}),(0,C.jsx)(Z.Z,{mr:O.cd}),(0,C.jsxs)(P.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,C.jsx)("br",{}),"Click the checkbox to include the updated property when merging changes."]})]})})}),te,(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(G.Pt,{}),onClick:function(){v((function(e){var n;return(0,ae.$C)(Ae(Ae({},d),{},{schema:Ae(Ae({},null===d||void 0===d?void 0:d.schema),{},{properties:Ae(Ae({},null===d||void 0===d||null===(n=d.schema)||void 0===n?void 0:n.properties),S)})}),e)})),c({noParents:{},parents:{}}),u(ce.tw.SETTINGS)},primary:!0,children:"Merge changes"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(T.Z,{onClick:function(){c({noParents:{},parents:{}}),u(ce.tw.SETTINGS)},secondary:!0,children:"Discard changes"})]})})]}),!a&&ie,(0,C.jsx)(Z.Z,{pb:O.HN})]})},Ne=["block","height","pipeline","selectedSubTab","showError","stream"];function Le(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 Fe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Le(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Le(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ue=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.selectedSubTab,r=e.showError,l=e.stream,u=(0,he.Z)(e,Ne);return ce.tw.OVERVIEW!==o&&o?ce.tw.SETTINGS===o||ce.tw.STREAM_CONFLICTS===o?(0,C.jsx)(Re,Fe(Fe({},u),{},{block:n,showStreamConflicts:ce.tw.STREAM_CONFLICTS===o,stream:l})):ce.tw.SAMPLE_DATA===o?(0,C.jsx)(xe,{block:n,height:t,pipeline:i,showError:r,stream:l}):(0,C.jsx)(C.Fragment,{}):(0,C.jsx)(Ee,Fe(Fe({},u),{},{block:n,stream:l}))},He=t(47041),ze=t(91437),We=8*O.iI,Ge=m.default.div.withConfig({displayName:"indexstyle__AfterFooterStyle",componentId:"sc-119v89s-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||Oe.Z.background).panel,";\n ")})),Ke=m.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-119v89s-1"})(["border-radius:","px;position:relative;"," ",""],we.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||Oe.Z.borders).light,";\n background-color: ").concat((e.theme.background||Oe.Z.background).panel,";\n ")}),(function(e){return e.maxWidth&&"\n width: ".concat(e.maxWidth,"px;\n ")})),Ve=m.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-119v89s-2"})(["padding:","px;",""],O.cd*O.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||Oe.Z.borders).light,";\n ")})),qe=m.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-119v89s-3"})([""," "," ",""],(0,ze.eR)(),(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||Oe.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||Oe.Z.background).codeTextarea,";\n ")})),Ye=m.default.div.withConfig({displayName:"indexstyle__StreamGridGroupStyle",componentId:"sc-119v89s-4"})(["position:absolute;"]),Qe=m.default.div.withConfig({displayName:"indexstyle__StreamGridGroupInnerStyle",componentId:"sc-119v89s-5"})([""," overflow:auto;position:fixed;",""],He.w5,(function(e){return e.borderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||Oe.Z.borders).light,";\n ")})),Xe=m.default.div.withConfig({displayName:"indexstyle__StreamGridStyle",componentId:"sc-119v89s-6"})(["border-radius:","px;padding:","px;margin:","px;"," "," "," "," ",""],we.n_,O.cd*O.iI,1*O.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||Oe.Z.borders).light,";\n ")}),(function(e){return e.warning&&!e.selected&&"\n border: 1px solid ".concat((e.theme.accent||Oe.Z.accent).warningTransparent,";\n ")}),(function(e){return e.warning&&e.selected&&"\n border: 1px solid ".concat((e.theme.accent||Oe.Z.accent).warning,";\n ")}),(function(e){return e.selected&&!e.warning&&"\n background-color: ".concat((e.theme.background||Oe.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||Oe.Z.borders).contrast,";\n ")})),Je=m.default.div.withConfig({displayName:"indexstyle__BackgroundStyle",componentId:"sc-119v89s-7"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||Oe.Z.background).panel,";\n ")})),$e={label:function(e){return"".concat((0,Q._6)("stream",e,!0)," fetched")},uuid:"Recently fetched"},en={label:function(e){return"".concat((0,Q._6)("stream",e,!0)," from settings")},uuid:"From stream settings"},nn=[$e,en];function tn(e,n){return null===n||void 0===n?void 0:n.filter((function(n){var t=new RegExp(e||"","i"),i=(0,ae.M$)(n);return!e||(null===i||void 0===i?void 0:i.match(t))||(null===i||void 0===i?void 0:i.replace("-"," ").match(t))||(null===i||void 0===i?void 0:i.replace("-","").match(t))||(null===i||void 0===i?void 0:i.replace("_"," ").match(t))||(null===i||void 0===i?void 0:i.replace("_","").match(t))||(null===i||void 0===i?void 0:i.replaceAll("-"," ").match(t))||(null===i||void 0===i?void 0:i.replaceAll("-","").match(t))||(null===i||void 0===i?void 0:i.replaceAll("_"," ").match(t))||(null===i||void 0===i?void 0:i.replaceAll("_","").match(t))}))}var on=function(e){var n=e.block,t=e.blocksMapping,i=e.height,o=e.onChangeBlock,u=e.searchText,c=e.setSelectedMainNavigationTab,a=(e.setSelectedSubTab,e.setStreamsMappingConflicts),d=e.streamsFetched,p=e.updateStreamsInCatalog,f=e.width,v=(0,s.useMemo)((function(){return(0,ae.Uc)(n,{getAll:!0})}),[n]),h=(0,s.useMemo)((function(){return(0,ae.UA)(v)}),[v]),m=(0,s.useMemo)((function(){return(0,ae.UA)(d||[])}),[d]),b=(0,s.useCallback)((function(e){return(0,ae.ig)(e,m,h)}),[m,h]),g=(0,s.useCallback)((function(e){return(0,ae.p$)(e,m,h)}),[m,h]),k=(0,s.useCallback)((function(e){var n;return(n={},(0,r.Z)(n,$e.uuid,m),(0,r.Z)(n,en.uuid,h),n)[e]}),[h,m]),_=(0,s.useMemo)((function(){var e=[];return nn.forEach((function(n,i){var o,r=n.label,c=n.uuid,a=k(c),s=[],d=Object.values((null===a||void 0===a?void 0:a.noParents)||{})||[],p=tn(u,d);(null===p||void 0===p?void 0:p.length)>=1&&s.push({streams:(0,_e.YC)(p||[],ae.M$)}),null===(o=Object.entries((null===a||void 0===a?void 0:a.parents)||{}))||void 0===o||o.forEach((function(e){var n=(0,l.Z)(e,2),i=n[0],o=n[1],r=tn(u,Object.values(o||{})||[]);(null===r||void 0===r?void 0:r.length)>=1&&s.push({block:null===t||void 0===t?void 0:t[i],streams:(0,_e.YC)(r||[],ae.M$)})})),(null===s||void 0===s?void 0:s.length)>=1&&e.push({count:(0,_e.Sm)((null===s||void 0===s?void 0:s.map((function(e){var n=e.streams;return(null===n||void 0===n?void 0:n.length)||0})))||[]),label:r,subgroups:s,uuid:c})})),e}),[k,u]),S=(0,s.useMemo)((function(){return(null===_||void 0===_?void 0:_.length)||0}),[_]);return(0,C.jsx)(C.Fragment,{children:null===_||void 0===_?void 0:_.map((function(e,n){var t=e.count,r=e.label,l=e.subgroups,u=e.uuid,s=$e.uuid===u;return(0,C.jsx)(Ye,{style:{height:i,right:en.uuid===u?null:0,width:f/S},children:(0,C.jsx)(Qe,{borderRight:S>=2&&!s,style:{height:i,width:f/S},children:(0,C.jsxs)(Z.Z,{pt:O.cd,children:[(0,C.jsx)(Z.Z,{px:O.Mq,children:(0,C.jsx)(re.Z,{level:4,children:r(t)})}),null===l||void 0===l?void 0:l.map((function(e,n){var t,i=e.block,r=e.streams;return(0,C.jsxs)(Z.Z,{mt:i&&0===n?O.cd:1,children:[(0,C.jsx)(Z.Z,{mb:i?O.cd:0,mt:i?0:O.cd,children:(0,C.jsx)(x.Z,{light:!0})}),i&&(0,C.jsx)(Z.Z,{px:O.cd,children:(0,C.jsx)(P.ZP,{bold:!0,color:null===(t=(0,w.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}))||void 0===t?void 0:t.accent,default:!0,large:!0,monospace:!0,children:null===i||void 0===i?void 0:i.uuid})}),(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:null===r||void 0===r?void 0:r.map((function(e){var n=b(e),t=!!g(e),i=(0,ae.M$)(e),r=(0,ae.Qu)(e),l=!1;if(s){var u=(0,ae.zB)(e,k(en.uuid));u&&(l=(0,ae.Z5)(u))}else l=(0,ae.Z5)(e);var d=n&&t;return(0,C.jsx)(Xe,{onClick:s&&d?function(){return!1}:function(n){n.preventDefault(),p([(0,ae.XE)(e,{selected:!l})],(function(e){return null===o||void 0===o?void 0:o(e)}))},selected:l,warning:d&&s,children:(0,C.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(P.ZP,{monospace:!0,muted:!l,children:i})}),d&&s&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(P.ZP,{monospace:!0,warning:!0,children:"exists"})]}),d&&s&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(j.Z,{alignItems:"center",style:{minHeight:3*O.iI},children:(0,C.jsx)(T.Z,{compact:!0,onClick:function(){a((function(n){return(0,ae.UA)([e],n)})),c((function(e){return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:r,selectedSubTab:ce.tw.STREAM_CONFLICTS}}))},small:!0,warning:!0,children:"View differences"})})]}),(!d||!s)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mr:O.HN}),l&&(0,C.jsx)(G.Zr,{size:2*O.iI}),(0,C.jsx)(Z.Z,{mr:l?1:3}),(0,C.jsx)(j.Z,{alignItems:"center",style:{height:3*O.iI},children:(0,C.jsx)(ke.Z,{checked:l,compact:!0,onCheck:function(n){return p([(0,ae.XE)(e,{selected:n(l)})],(function(e){return null===o||void 0===o?void 0:o(e)}))}})})]})]})},i)}))})})]},i?null===i||void 0===i?void 0:i.uuid:"no-subtitle-".concat(n))}))]})})},u)}))})};function rn(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 ln(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?rn(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):rn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var un=function(e){var n=e.attributes,t=e.attributesMapping,i=e.columnFlex,o=e.rightAlignColumnForRowIndexes,l=e.rowGroupHeaders,u=e.rowsGroupedByIndex,c=e.setAttributesMapping,a=(0,s.useCallback)((function(e,n){var i,l=e.inputType,u=e.label,a=e.options,s=e.uuid,d=null===t||void 0===t?void 0:t[s],p=!(null===d||void 0===d||!d.selected),f=null===d||void 0===d?void 0:d.value;return ce.oI.CHECKBOX===l?i=(0,C.jsx)(b.Z,{checked:!!f,onClick:function(e){p&&(0,De.j)(e),c((function(e){return ln(ln({},e),{},(0,r.Z)({},s,ln(ln({},null===e||void 0===e?void 0:e[s]),{},{value:!f})))}))}}):ce.oI.SELECT===l?i=(0,C.jsxs)(U.Z,{compact:!0,fullWidth:!0,onChange:function(e){(0,De.j)(e),c((function(n){var t;return ln(ln({},n),{},(0,r.Z)({},s,ln(ln({},null===n||void 0===n?void 0:n[s]),{},{value:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})))}))},onClick:function(e){p&&(0,De.j)(e)},value:f,children:[(0,C.jsx)("option",{value:""}),null===a||void 0===a?void 0:a.map((function(e){var n=e.label,t=e.value;return(0,C.jsx)("option",{value:t,children:n?n():t},t)}))]}):ce.oI.TOGGLE===l&&(i=(0,C.jsx)(ke.Z,{checked:f,compact:!0,onCheck:function(e){c((function(n){return ln(ln({},n),{},(0,r.Z)({},s,ln(ln({},null===n||void 0===n?void 0:n[s]),{},{value:e(f)})))}))},pauseEvent:p})),[(0,C.jsx)(b.Z,{checked:p,onClick:function(e){(0,De.j)(e),c((function(e){return ln(ln({},e),{},(0,r.Z)({},s,ln(ln({},null===e||void 0===e?void 0:e[s]),{},{selected:!p})))}))}},"".concat(s,"-checkbox")),(0,C.jsx)(P.ZP,{muted:!p,children:u()},"".concat(s,"-name")),(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:null!==o&&void 0!==o&&o.includes(n)?"flex-end":"center",children:i},"".concat(s,"-value"))]}),[t,o,c]);return(0,s.useMemo)((function(){return(0,C.jsx)(ye.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?void 0:n[e],o=null===i||void 0===i?void 0:i.uuid,l=null===t||void 0===t?void 0:t[o],u=!(null===l||void 0===l||!l.selected);c((function(e){return ln(ln({},e),{},(0,r.Z)({},o,ln(ln({},null===e||void 0===e?void 0:e[o]),{},{selected:!u})))}))},rowGroupHeaders:l,rowsGroupedByIndex:u,rows:n.map((function(e,n){return a(e,n)}))})}),[n,t,i,a])};var cn=function(e){var n=e.selectedStreamMapping,t=e.setSelectedStreamMapping,i=e.streamMapping,o=(0,s.useMemo)((function(){return(0,ae.th)(i)}),[i]),r=(0,s.useMemo)((function(){var e=[],t=[],i=[],r=[],l=0;return null===o||void 0===o||o.forEach((function(o){var u=o.groupHeader,c=o.streams;e.push(u);var a=[];null===c||void 0===c||c.forEach((function(e){r.push(e),a.push(l),l+=1;var i=(0,ae.WD)(e),o=(0,ae.M$)(e),u=!!(0,ae.zB)(e,n),c=[(0,C.jsx)(b.Z,{checked:u},"".concat(i,"-").concat(o,"-use")),(0,C.jsx)(P.ZP,{muted:!u,children:o},"".concat(i,"-").concat(o,"-stream"))];t.push(c)})),i.push(a)})),{rowGroupHeaders:e,rows:t,rowsGroupedByIndex:i,streamsArray:r}}),[n,o]),l=r.rowGroupHeaders,u=r.rows,c=r.rowsGroupedByIndex,a=r.streamsArray,d=(0,s.useMemo)((function(){var e,t;return(null===(e=Object.values((null===n||void 0===n?void 0:n.noParents)||{}))||void 0===e?void 0:e.length)+(0,_e.Sm)(null===(t=Object.values((null===n||void 0===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,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsxs)("div",{children:[(0,C.jsxs)(re.Z,{children:[(0,Q._6)("stream",d||0)," chosen"]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(P.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,C.jsx)(ye.Z,{columnFlex:[null,1],columns:[{uuid:"Use"},{uuid:"Stream"}],groupsInline:!0,onClickRow:function(e){var i=null===a||void 0===a?void 0:a[e],o=!!(0,ae.zB)(i,n);t((function(e){return(0,ae.iN)(i,e,{remove:o})}))},rowGroupHeaders:l,rows:u,rowsGroupedByIndex:c,stickyHeader:!0})]})};var an=function(e){var n=e.attributesMapping,t=e.selectedStreamMapping,i=e.setAttributesMapping,o=e.setSelectedStreamMapping,r=e.streamMapping,l=(0,s.useMemo)((function(){return(0,C.jsx)(un,{attributes:[{label:function(){return"Replication method"},inputType:ce.oI.SELECT,options:Object.values(Pe._B).map((function(e){return{label:function(){return(0,Q.vg)(e)},value:e}})),uuid:ae.I1.REPLICATION_METHOD},{label:function(){return"Unique conflict method"},inputType:ce.oI.SELECT,options:Object.values(Pe.MU).map((function(e){return{label:function(){return(0,Q.vg)(e)},value:e}})),uuid:ae.I1.UNIQUE_CONFLICT_METHOD},{label:function(){return"Run stream in parallel"},inputType:ce.oI.TOGGLE,uuid:ae.I1.RUN_IN_PARALLEL},{label:function(){return"Automatically add new columns"},inputType:ce.oI.TOGGLE,uuid:ae.I1.AUTO_ADD_NEW_FIELDS},{label:function(){return"Disable strict column type checks"},inputType:ce.oI.TOGGLE,uuid:ae.I1.DISABLE_COLUMN_TYPE_CHECK}],attributesMapping:n,columnFlex:[null,1,1],rightAlignColumnForRowIndexes:[2,3,4],setAttributesMapping:i})}),[n,i]),u=(0,s.useMemo)((function(){return(0,C.jsx)(cn,{selectedStreamMapping:t,setSelectedStreamMapping:o,streamMapping:r})}),[t,o,r]);return(0,C.jsxs)(Je,{children:[(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsxs)("div",{children:[(0,C.jsx)(re.Z,{children:"Make changes to multiple streams"}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(P.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."})})]})}),l,u]})};function sn(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 dn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?sn(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pn=function(e){var n=e.attributesMapping,t=e.highlightedColumnsMapping,i=e.selectedStreamMapping,u=e.setAttributesMapping,c=e.setHighlightedColumnsMapping,a=e.setSelectedStreamMapping,d=e.stream,p=e.streamMapping;e.updateStreamsInCatalog,(0,s.useEffect)((function(){if(d&&!i){var e=(0,ae.M$)(d||{}),n=(0,ae.Qu)(d||{});n?a({noParents:{},parents:(0,r.Z)({},n,(0,r.Z)({},e,d))}):e&&a({noParents:(0,r.Z)({},e,d),parents:{}})}}),[i,a,d]);var f=(0,s.useMemo)((function(){return(0,C.jsx)(un,{attributes:[{label:function(){return"Include property when syncing"},inputType:ce.oI.CHECKBOX,uuid:ae.I1.PROPERTY_SELECTED},{label:function(){return"Unique constraint"},inputType:ce.oI.CHECKBOX,uuid:ae.I1.UNIQUE_CONSTRAINTS},{label:function(){return"Bookmark property"},inputType:ce.oI.CHECKBOX,uuid:ae.I1.BOOKMARK_PROPERTIES},{label:function(){return"Key property"},inputType:ce.oI.CHECKBOX,uuid:ae.I1.KEY_PROPERTIES},{label:function(){return"Partition key"},inputType:ce.oI.CHECKBOX,uuid:ae.I1.PARTITION_KEYS}].concat((0,o.Z)(Pe.D5.map((function(e){return{label:function(){return(0,Q.vg)(e)},inputType:ce.oI.CHECKBOX,uuid:e}})))),attributesMapping:n,rowGroupHeaders:["Options","Column types"],rowsGroupedByIndex:[[0,1,2,3],null===Pe.D5||void 0===Pe.D5?void 0:Pe.D5.map((function(e,n){return n+4}))],setAttributesMapping:u})}),[n,u]),v=(0,s.useMemo)((function(){return(0,C.jsx)(cn,{selectedStreamMapping:i,setSelectedStreamMapping:a,streamMapping:p})}),[i,a,p]),h=(0,s.useMemo)((function(){var e,n=null===(e=Object.entries(t||{}))||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,_e.YC)(n,(function(e){return e}))}),[t]);return(0,C.jsxs)(Je,{children:[(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsxs)("div",{children:[(0,C.jsxs)(re.Z,{children:[!(null!==h&&void 0!==h&&h.length)&&"Choose at least 1 property",(null===h||void 0===h?void 0:h.length)>=1&&"".concat((0,Q._6)("property",(null===h||void 0===h?void 0:h.length)||0)," chosen")]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{default:!0,children:[!(null!==h&&void 0!==h&&h.length)&&"Click 1 or more rows in the table to select which schema properties to apply bulk changes to.",(null===h||void 0===h?void 0:h.length)>=1&&(0,C.jsx)(C.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===h||void 0===h?void 0:h.length)>=1&&(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:null===h||void 0===h?void 0:h.map((function(e){return(0,C.jsx)("div",{style:{marginBottom:O.iI/2,marginRight:O.iI/2},children:(0,C.jsx)(je.Z,{label:e,onClick:function(){c((function(n){return!(null===n||void 0===n||!n[e])?(0,ge.gR)(n,[e]):dn(dn({},n),{},(0,r.Z)({},e,!0))}))}})},"".concat(e,"-chip"))}))})})]}),f,v]})};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 vn(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,r.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={compact:!0,small:!0};var mn=function(e){var n=e.block,t=e.blocksMapping,i=e.onChangeBlock,o=e.selectedStreamMapping,l=e.setSelectedMainNavigationTab,u=e.setSelectedStreamMapping,c=e.streamMapping,a=e.updateStreamsInCatalog,d=(0,s.useRef)(null),p=(0,s.useState)({}),f=p[0],v=p[1],m=(0,s.useCallback)((function(e){return a(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,a]),b=(n||{}).type,g=c||{},x=g.noParents,j=g.parents,_=(0,s.useMemo)((function(){return(0,ge.Qr)(x||{})&&(0,ge.Qr)(j||{})}),[x,j]),S=(0,s.useMemo)((function(){return(0,ae.th)(c)}),[c]),I=(0,s.useMemo)((function(){var e=[null,1,3,2,2,null],n=[{label:function(e){var n=e.groupIndex,t=((null===S||void 0===S?void 0:S[n])||{}).streams,i=t&&(null===t||void 0===t?void 0:t.every((function(e){return(0,ae.Z5)(e)})));return(0,C.jsx)(ke.Z,{checked:i,compact:!0,disabled:!(null!==t&&void 0!==t&&t.length),onCheck:function(e){t&&m(null===t||void 0===t?void 0:t.map((function(n){return(0,ae.XE)(n,{selected:e(i)})})))}})},uuid:"action"},{uuid:"Stream"},{uuid:"Table"},{uuid:"Sync"},{uuid:"Unique conflict"},{center:!0,uuid:"Parallel"}];return h.tf.DATA_EXPORTER===b&&(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}}),[b,S,m]),E=I.columnFlex,T=I.columns,M=(0,s.useMemo)((function(){var e=[],n=[],i=[],o=[],u=0;return null===S||void 0===S||S.forEach((function(c){var a=c.groupHeader,p=c.streams,g=a?null===t||void 0===t?void 0:t[a]:null;g?n.push((0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsx)(P.ZP,{bold:!0,color:(0,w.qn)(null===g||void 0===g?void 0:g.type,{blockColor:null===g||void 0===g?void 0:g.color}).accent,monospace:!0,children:a})})):n.push(a);var x=[];null===p||void 0===p||p.forEach((function(n){e.push(n),x.push(u),u+=1;var t=(0,ae.WD)(n),o=(0,ae.Qu)(n),c=(0,ae.M$)(n),a=n.auto_add_new_fields,p=n.destination_table,g=n.disable_column_type_check,j=n.replication_method,Z=n.run_in_parallel,P=n.unique_conflict_method,O=(0,ae.Z5)(n),w=t in f?null===f||void 0===f?void 0:f[t]:p,_=[(0,C.jsx)(ke.Z,{checked:O,compact:!0,onCheck:function(e){m([(0,ae.XE)(n,{selected:e(O)})])}},"".concat(t,"-action")),(0,C.jsx)(k.Z,{bold:!0,monospace:!0,onClick:function(){l(c,o)},preventDefault:!0,sameColorAsText:!0,children:c},"".concat(t,"-name")),(0,C.jsx)(z.Z,{compact:!0,defaultColor:!w,monospace:!0,onChange:function(e){var i,o=null===e||void 0===e||null===(i=e.target)||void 0===i?void 0:i.value;v((function(e){return vn(vn({},e),{},(0,r.Z)({},t,o))})),clearTimeout(d.current),d.current=setTimeout((function(){return m([vn(vn({},n),{},{destination_table:o})])}),300)},onClick:De.j,placeholder:c,value:w||""},"".concat(t,"-destinationTable")),(0,s.createElement)(U.Z,vn(vn({},hn),{},{key:"".concat(t,"-replicationMethod"),onChange:function(e){var t;return m([vn(vn({},n),{},{replication_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:De.j,placeholder:"Replication method",value:j}),Object.values(Pe._B).map((function(e){return(0,C.jsx)("option",{value:e,children:(0,Q.vg)(e)},e)}))),(0,s.createElement)(U.Z,vn(vn({},hn),{},{key:"".concat(t,"-uniqueConflictMethod"),onChange:function(e){var t;return m([vn(vn({},n),{},{unique_conflict_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:De.j,placeholder:"Unique conflict method",value:P}),Object.values(Pe.MU).map((function(e){return(0,C.jsx)("option",{value:e,children:(0,Q.vg)(e)},e)}))),(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(ke.Z,{checked:!!Z,compact:!0,onCheck:function(e){m([vn(vn({},n),{},{run_in_parallel:e(Z)})])}})},"".concat(t,"-runInParallel"))];h.tf.DATA_EXPORTER===b&&_.push.apply(_,[(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(ke.Z,{checked:!!a,compact:!0,onCheck:function(e){m([vn(vn({},n),{},{auto_add_new_fields:e(a)})])}})},"".concat(t,"-autoAddNewFields")),(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(ke.Z,{checked:!!g,compact:!0,onCheck:function(e){m([vn(vn({},n),{},{disable_column_type_check:e(g)})])}})},"".concat(t,"-disableColumnTypeCheck"))]),i.push(_)})),o.push(x)})),{rowGroupHeaders:n,rows:i,rowsGroupedByIndex:o,streamsInRows:e}}),[b,t,f,v,l,S,d,m]),D=M.rowGroupHeaders,B=M.rows,A=M.rowsGroupedByIndex,R=M.streamsInRows;return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsx)(re.Z,{children:"Overview of streams"}),_&&(0,C.jsxs)(Z.Z,{mt:1,children:[(0,C.jsx)(P.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,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(k.Z,{bold:!0,onClick:function(){return l(ce.uK.STREAMS)},preventDefault:!0,children:"Go and fetch Streams"})})]})]}),!_&&(0,C.jsx)(ye.Z,{columnFlex:E,columns:T,isSelectedRow:function(e){var n=null===R||void 0===R?void 0:R[e];return!!(0,ae.zB)(n,o)},groupsInline:!0,onClickRow:function(e){var n=null===R||void 0===R?void 0:R[e],t=!!(0,ae.zB)(n,o);u((function(e){return(0,ae.iN)(n,e,{remove:t})}))},rowGroupHeaders:D,rows:B,rowsGroupedByIndex:A,stickyHeader:!0})]})},bn=t(62547),gn=t(53808),xn=t(19183);function jn(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 yn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?jn(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):jn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var kn=3*O.iI*2;var Zn=function(e){var n=e.block,t=void 0===n?null:n,i=e.defaultMainNavigationTab,u=void 0===i?null:i,c=e.defaultMainNavigationTabSub,a=void 0===c?null:c,p=e.defaultSubTab,f=void 0===p?null:p,v=e.onChangeBlock,m=e.onChangeCodeBlock,_=e.onClose,S=e.onSaveBlock,I=e.pipeline,E=e.savePipelineContent,D=(0,s.useRef)(null),B=(0,s.useRef)(null),A=(0,s.useRef)(null),R=(0,s.useRef)(null),N=(0,s.useState)({}),L=N[0],F=N[1],U=(0,s.useState)(null),K=U[0],q=U[1],Y=(0,s.useState)(!1),Q=Y[0],$=Y[1],ee=(0,xn.i)(),ne=ee.height,ie=ee.width,oe=I||{},le=oe.blocks,ue=oe.uuid,se=t||{},de=(se.catalog,se.content),he=se.language,me=se.type,be=se.uuid,xe=(0,s.useMemo)((function(){return h.tf.DATA_LOADER===me?V.O.SOURCES:V.O.DESTINATIONS}),[me]),je=(0,s.useState)(t||null),ye=je[0],Ze=je[1],Pe=ye||{},Oe=(Pe.configuration,Pe.content),we=Pe.metadata,Ce=(0,s.useMemo)((function(){return(null===we||void 0===we?void 0:we.data_integration)||{}}),[we]),Se=Ce.destination,Ie=Ce.name,Ee=Ce.source,Te=(0,s.useMemo)((function(){return Se||Ee||null}),[Se,Ee]),Me=(0,s.useMemo)((function(){var e={include_block_catalog:!0,include_block_metadata:!0,include_documentation:!0};return Te&&(e.data_integration_uuid=Te),e}),[xe,Te]),De=W.ZP.blocks.pipelines.detail(ue,be,Me,{},{key:"pipelines/".concat(ue,"/blocks/").concat(be,"/documentation")}).data,Be=(0,s.useMemo)((function(){var e;return(null===ye||void 0===ye||null===(e=ye.configuration)||void 0===e?void 0:e.data_integration)||{}}),[ye]),Ae=(0,s.useCallback)((function(e){return Ze((function(n){var t,i=yn(yn({},n),{},{configuration:yn(yn({},null===n||void 0===n?void 0:n.configuration),{},{data_integration:e((null===n||void 0===n||null===(t=n.configuration)||void 0===t?void 0:t.data_integration)||{})})});return null===v||void 0===v||v(i),i}))}),[v,Ze]),Re=(0,s.useCallback)((function(e){return Ae((function(n){return yn(yn({},n),{},{inputs:e((null===n||void 0===n?void 0:n.inputs)||{})})}))}),[Ae]),Ne=(0,s.useCallback)((function(e,n){return Ze((function(t){var i=(null===t||void 0===t?void 0:t.catalog)||{streams:[]},r=(0,o.Z)((null===i||void 0===i?void 0:i.streams)||[]);null===e||void 0===e||e.forEach((function(e){var n=(0,ae.M$)(e),t=null===e||void 0===e?void 0:e.parent_stream,i=null===r||void 0===r?void 0:r.findIndex((function(e){var i=(0,ae.M$)(e),o=null===e||void 0===e?void 0:e.parent_stream;return n===i&&t===o})),o={};i>=0&&(o=null===r||void 0===r?void 0:r[i]);var l=yn(yn({},o),e);i>=0?r[i]=l:r.push(l)}));var l=yn(yn({},t),{},{catalog:yn(yn({},i),{},{streams:r})});return null===n||void 0===n||n(l),l}))}),[Ze]),Le=(0,s.useMemo)((function(){return null===De||void 0===De?void 0:De.block}),[De]);(0,s.useEffect)((function(){Le&&(ye&&(null===Le||void 0===Le?void 0:Le.uuid)===(null===ye||void 0===ye?void 0:ye.uuid)||Ze(Le))}),[ye,Le]);var Fe=(0,s.useMemo)((function(){return(0,_e.HK)(le||[],(function(e){return e.uuid}))}),[le]),He=(0,s.useMemo)((function(){var e;return null===ye||void 0===ye||null===(e=ye.upstream_blocks)||void 0===e?void 0:e.map((function(e){return null===Fe||void 0===Fe?void 0:Fe[e]}))}),[ye,Fe]),ze=(0,s.useMemo)((function(){return null===Le||void 0===Le?void 0:Le.documentation}),[Le]),Ye=(0,s.useMemo)((function(){return(0,ae.Uc)(ye,{getAll:!0})}),[ye]),Qe=(0,s.useMemo)((function(){return(0,ae.UA)(Ye)}),[Ye]),Xe=(0,s.useMemo)((function(){return"DataIntegrationModal/".concat(be)}),be),Je=(0,s.useMemo)((function(){return"block_layout_after_width_".concat(Xe)}),[Xe]),$e=(0,s.useMemo)((function(){return"block_layout_before_width_".concat(Xe)}),[Xe]),en=(0,J.VI)(null,{},[],{uuid:Xe}),nn=(0,l.Z)(en,1)[0],tn=(0,s.useState)((0,gn.U2)(Je,60*O.iI)),rn=tn[0],ln=tn[1],un=(0,s.useState)(!1),cn=un[0],sn=un[1],dn=(0,s.useState)(Math.max((0,gn.U2)($e),40*O.iI)),fn=dn[0],vn=dn[1],hn=(0,s.useState)(!1),jn=hn[0],Zn=hn[1],Pn=(0,s.useState)({}),On=Pn[0],wn=Pn[1],Cn=(0,s.useState)({selectedMainNavigationTab:null,selectedMainNavigationTabSub:a,selectedSubTab:null}),_n=Cn[0],Sn=_n.selectedMainNavigationTab,In=_n.selectedMainNavigationTabSub,En=_n.selectedSubTab,Tn=Cn[1],Mn=(0,s.useState)((0,ae.UA)([])),Dn=Mn[0],Bn=Mn[1],An=(0,s.useMemo)((function(){if(!(0,ge.Qr)(null===Dn||void 0===Dn?void 0:Dn.noParents)||!(0,ge.Qr)(null===Dn||void 0===Dn?void 0:Dn.parents)){var e,n,t,i;if(Sn)if(In)e=null===Dn||void 0===Dn||null===(n=Dn.parents)||void 0===n||null===(t=n[Sn])||void 0===t?void 0:t[In];else e=null===Dn||void 0===Dn||null===(i=Dn.noParents)||void 0===i?void 0:i[Sn];return(0,ce.C0)({addStreamConflicts:!!e})}return(0,ce.C0)()}),[Sn,In,Dn]),Rn=(0,s.useCallback)((function(e){return e in ce.Pf?ce.Pf[e]:An}),[An]),Nn=(0,s.useCallback)((function(e){Tn((function(n){return function(e,n){var t=e||{},i=t.selectedMainNavigationTab,o=t.selectedMainNavigationTabSub,r=t.selectedSubTab,l=n||{},u=l.selectedMainNavigationTab,c=l.selectedMainNavigationTabSub,a=i in ce.Pf?ce.Pf[i]:An,s=r;if(ce.mU[i]||ce.mU[u]){var d,p,f;s||(s=null===a||void 0===a||null===(f=a[0])||void 0===f?void 0:f.uuid),i!==u&&wn({});var v=(0,ae.zB)({parent_stream:c,stream:u,tap_stream_id:u},Qe),h=(0,ae.zB)({parent_stream:o,stream:i,tap_stream_id:i},Qe),m=(0,_e.jV)(Object.keys((null===v||void 0===v||null===(d=v.schema)||void 0===d?void 0:d.properties)||{}),Object.keys((null===h||void 0===h||null===(p=h.schema)||void 0===p?void 0:p.properties)||{}));wn((function(e){return yn({},(0,ge.GL)(e,m||[]))}))}return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:o,selectedSubTab:s}}(e(n),n)}))}),[In,wn,Qe,An]);(0,s.useEffect)((function(){Sn||Nn((function(e){var n,t,i=e.selectedSubTab;return{selectedMainNavigationTab:u||ce.uK.CONFIGURATION,selectedMainNavigationTabSub:a,selectedSubTab:u?f||(null===(n=Rn(u))||void 0===n||null===(t=n[0])||void 0===t?void 0:t.uuid):i}}))}),[u,a,f,Sn,Nn]);var Ln=(0,s.useMemo)((function(){return Rn(Sn)}),[Rn,Sn]),Fn=(0,s.useMemo)((function(){var e=[{Icon:G.JG,uuid:ce.uK.CONFIGURATION},{Icon:G.kO,uuid:ce.uK.STREAMS},{Icon:G.iA,uuid:ce.uK.OVERVIEW}].map((function(e){var n=e.Icon,t=e.uuid;return(0,C.jsx)(qe,{selected:Sn===t,children:(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return Nn((function(){return{selectedMainNavigationTab:t}}))},preventDefault:!0,children:(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(g.Z,{primaryLight:!0,size:4*O.iI,square:!0,children:(0,C.jsx)(n,{size:2*O.iI})}),(0,C.jsx)(Z.Z,{mr:2}),(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:ce.TD[t]})]})})})},t)})),n=(null===Ye||void 0===Ye?void 0:Ye.length)||0,t=[],i={};return null===Ye||void 0===Ye||Ye.forEach((function(e){var n=e.parent_stream;n?(null!==i&&void 0!==i&&i[n]||(i[n]=[]),i[n].push(e)):t.push(e)})),[{streams:t}].concat((0,o.Z)((0,_e.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===Fe||void 0===Fe?void 0:Fe[t],streams:i}})))).forEach((function(t){var i=t.block,o=t.streams;if(i){var r=null===i||void 0===i?void 0:i.uuid;e.push((0,C.jsx)(x.Z,{light:!0},"block-".concat(r,"-divider-top"))),e.push((0,C.jsx)(Z.Z,{px:O.cd,py:1,children:(0,C.jsx)(P.ZP,{bold:!0,color:(0,w.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}).accent,monospace:!0,small:!0,children:r})},"block-".concat(r)))}null===o||void 0===o||o.forEach((function(t,i){var o=(0,ae.M$)(t),r=(0,ae.Qu)(t),l=(0,ae.WD)(t),u=(0,ae.Z5)(t),c=Sn===o&&(!r||In===r);e.push((0,C.jsx)(x.Z,{light:!0},"".concat(l,"-divider-top"))),e.push((0,C.jsx)(qe,{selected:c,children:(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){Nn((function(e){var n=e.selectedSubTab;return{selectedMainNavigationTab:o,selectedMainNavigationTabSub:r,selectedSubTab:n}}))},preventDefault:!0,children:(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(g.Z,{size:1*O.iI,success:u}),(0,C.jsx)(Z.Z,{mr:2}),(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(P.ZP,{default:!u,monospace:!0,children:o})})]})})})},l)),i===n-1&&e.push((0,C.jsx)(x.Z,{light:!0},"".concat(l,"-divider-last")))}))})),e}),[Fe,Sn,In,Nn,Ye]),Un=(0,s.useState)(null),Hn=Un[0],zn=Un[1],Wn=(0,s.useMemo)((function(){return(0,ae.qf)(Qe,(0,ae.UA)(Hn||[]))}),[Qe,Hn]),Gn=(0,d.Db)(W.ZP.integration_sources.useUpdate(ue),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.integration_source.streams;zn(n)},onErrorCallback:function(e,n){return nn({errors:n,response:e})}})}}),Kn=(0,l.Z)(Gn,2),Vn=Kn[0],qn=Kn[1].isLoading,Yn=(0,s.useCallback)((function(){return Vn({integration_source:{block_uuid:be}})}),[be,Vn]),Qn=(0,s.useState)(null),Xn=Qn[0],Jn=Qn[1],$n=(0,s.useMemo)((function(){return(0,C.jsxs)("div",{ref:R,children:[(null===Ln||void 0===Ln?void 0:Ln.length)>=1&&(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsx)(M.Z,{noPadding:!0,onClickTab:function(e){var n=e.uuid;return Nn((function(e){return yn(yn({},e),{},{selectedSubTab:n})}))},regularSizeText:!0,selectedTabUUID:En,tabs:Ln})}),!(null!==Ln&&void 0!==Ln&&Ln.length)&&ce.uK.STREAMS===Sn&&(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(z.Z,{beforeIcon:(0,C.jsx)(G.HN,{muted:!(null!==Xn&&void 0!==Xn&&Xn.length),size:2*O.iI}),fullWidth:!0,noBackground:!0,noBorder:!0,noBorderRadiusBottom:!0,noBorderRadiusTop:!0,onChange:function(e){var n;return Jn(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},paddingHorizontal:O.iI*O.cd,paddingVertical:O.iI*O.cd,placeholder:"Type the name of the stream to filter...",value:Xn||""})}),(null===Xn||void 0===Xn?void 0:Xn.length)>=1&&(0,C.jsx)(T.Z,{iconOnly:!0,noPadding:!0,noBackground:!0,noBorder:!0,onClick:function(){return Jn(null)},children:(0,C.jsx)(G.x8,{default:!0,size:2*O.iI})}),!Wn&&(0,C.jsx)(Z.Z,{px:O.cd,children:(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(G.rH,{size:2*O.iI}),compact:!0,loading:qn,onClick:function(){return Yn()},primary:!0,children:"Fetch streams"})})]}),(0,C.jsx)(x.Z,{light:!0})]})}),[be,Yn,qn,Wn,R,Xn,Sn,En,Jn,Ln]),et=(0,s.useMemo)((function(){return ne-2*We}),[ne]),nt=(0,s.useMemo)((function(){return ie-2*We}),[ie]),tt=(0,s.useState)(null),it=tt[0],ot=tt[1],rt=(0,s.useState)(null),lt=rt[0],ut=rt[1],ct=(0,s.useState)(null),at=(ct[0],ct[1]),st=(0,s.useState)(!1),dt=st[0],pt=st[1];(0,s.useEffect)((function(){var e,n,t,i,o,r;(Sn||En)&&(ot(null===R||void 0===R||null===(e=R.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height),at(null===B||void 0===B||null===(t=B.current)||void 0===t||null===(i=t.getBoundingClientRect())||void 0===i?void 0:i.height),ut(null===A||void 0===A||null===(o=A.current)||void 0===o||null===(r=o.getBoundingClientRect())||void 0===r?void 0:r.height))}),[A,B,R,Sn,En]);var ft=(0,d.Db)(W.ZP.blocks.pipelines.useUpdate(ue,encodeURIComponent(be)),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){null===S||void 0===S||S(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return nn({errors:n,response:e})}})}}),vt=(0,l.Z)(ft,2),ht=(vt[0],vt[1].isLoading,(0,s.useMemo)((function(){return Sn&&![ce.uK.CONFIGURATION,ce.uK.OVERVIEW,ce.uK.STREAMS,ce.uK.SYNC].includes(Sn)}),[Sn])),mt=(0,s.useMemo)((function(){return ht&&ce.tw.SETTINGS===En}),[ht,En]),bt=(0,s.useMemo)((function(){return ce.uK.CONFIGURATION===Sn&&ce.tw.CREDENTIALS===En}),[Sn,En]),gt=(0,s.useMemo)((function(){return ce.uK.OVERVIEW===Sn}),[Sn]),xt=(0,s.useMemo)((function(){return!(bt||mt||gt&&(null===Ye||void 0===Ye?void 0:Ye.length)>=1)||dt}),[dt,bt,mt,gt,Sn,En,Ye]),jt=(0,s.useMemo)((function(){var e=(0,ae.zB)({parent_stream:In,stream:Sn,tap_stream_id:Sn},Qe);if(e)return(0,C.jsx)(Ue,{block:ye,blocksMapping:Fe,height:et-it-2*O.iI,highlightedColumnsMapping:On,onChangeBlock:v,pipeline:I,selectedSubTab:En,setBlockAttributes:Ze,setHighlightedColumnsMapping:wn,setSelectedSubTab:function(e){return Nn((function(n){return yn(yn({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Bn,showError:nn,stream:e,streamMapping:Qe,streamsMappingConflicts:Dn,updateStreamsInCatalog:Ne})}),[ye,Fe,it,et,On,v,I,Sn,In,En,Ze,wn,Nn,Bn,nn,Qe,Dn,Ne]),yt=(0,s.useState)(null),kt=yt[0],Zt=yt[1];(0,s.useEffect)((function(){"undefined"!==typeof kt&&null!==kt||Zt("undefined"!==typeof de&&null!==de?de:Oe)}),[Oe,de,kt,Zt]);var Pt=(0,s.useState)(null),Ot=Pt[0],wt=Pt[1],Ct=(0,s.useMemo)((function(){return(0,C.jsx)(pe,{block:ye,blockConfigString:Ot,blockContent:kt,blockUpstreamBlocks:He,dataIntegrationConfiguration:Be,onChangeCodeBlock:m,pipeline:I,savePipelineContent:E,setBlockConfigString:wt,setBlockContent:Zt,setSelectedSubTab:function(e){return Nn((function(n){return yn(yn({},n),{},{selectedSubTab:e})}))},showError:nn})}),[ye,Ot,kt,He,Be,m,I,E,wt,Zt,Nn,nn]),_t=(0,s.useMemo)((function(){if(ce.uK.CONFIGURATION===Sn){if(ce.tw.UPSTREAM_BLOCK_SETTINGS===En){var e=null===He||void 0===He?void 0:He.map((function(e){var n,t,i=e.uuid,o=null===Be||void 0===Be||null===(n=Be.inputs)||void 0===n?void 0:n[i],l=(null===o||void 0===o?void 0:o.streams)||[],u=!!o,c=null===Fe||void 0===Fe?void 0:Fe[i],a=(null===c||void 0===c?void 0:c.catalog)?null===(t=(0,ae.Uc)(c))||void 0===t?void 0:t.map((function(e){var n=e.stream,t=e.tap_stream_id;return n||t})):[i],s=1===(null===a||void 0===a?void 0:a.length)&&(null===a||void 0===a?void 0:a.includes(i));return(0,C.jsxs)("div",{children:[(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{children:(0,C.jsx)(P.ZP,{bold:!0,large:!0,monospace:!0,muted:!u,children:i})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(ke.Z,{checked:u,compact:!0,onCheck:function(e){Re((function(n){return e(u)?yn(yn({},n),{},(0,r.Z)({},i,{})):(0,ge.gR)(n,[i])}))}})]}),u&&(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsxs)(ve.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,C.jsx)(ve.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,yn(yn({},y.A0),{},{children:[(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(P.ZP,{bold:!0,default:!0,children:"Use catalog as an input"}),(0,C.jsx)(P.ZP,{muted:!0,small:!0,children:"If checked, then this block\u2019s catalog will be included as part of the input argument(s) for the current block."})]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(b.Z,{checked:null===o||void 0===o?void 0:o.catalog,onClick:function(){return Re((function(e){var n;return yn(yn({},e),{},(0,r.Z)({},i,yn(yn({},null===e||void 0===e?void 0:e[i]),{},{catalog:!(null!==e&&void 0!==e&&null!==(n=e[i])&&void 0!==n&&n.catalog)})))}))}})]}))}),s&&(0,C.jsx)(ve.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,yn(yn({},y.A0),{},{children:[(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(P.ZP,{bold:!0,default:!0,children:"Use the block\u2019s output data as an input"}),(0,C.jsx)(P.ZP,{muted:!0,small:!0,children:"Include this block\u2019s output data as an input."})]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(b.Z,{checked:null===l||void 0===l?void 0:l.includes(i),monospace:!0,onClick:function(){return Re((function(e){return yn(yn({},e),{},(0,r.Z)({},i,yn(yn({},null===e||void 0===e?void 0:e[i]),{},{streams:null!==l&&void 0!==l&&l.includes(i)?(0,_e.Od)(l,(function(e){return e===i})):l.concat(i)})))}))},small:!0})]}))}),!s&&(0,C.jsxs)(ve.g,{noBorder:!0,children:[(0,C.jsxs)(y.ZP,yn(yn({},y.A0),{},{children:[(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(P.ZP,{bold:!0,default:!0,children:"Select which stream\u2019s data to use as an input"}),(0,C.jsxs)(P.ZP,{muted:!0,small:!0,children:["Only the output data from the selected streams will be used as an input.",(0,C.jsx)("br",{}),"If none are selected, then no output data from any stream from this block will be used as in input.",(0,C.jsx)("br",{}),"If you don\u2019t see a stream here, then the upstream block may have unselected the stream in its stream settings."]})]}),(0,C.jsx)(Z.Z,{mr:3})]})),null===a||void 0===a?void 0:a.map((function(e){var n=null===l||void 0===l?void 0:l.includes(e);return(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(y.ZP,yn(yn({},y.A0),{},{children:[(0,C.jsx)(j.Z,{children:(0,C.jsx)(P.ZP,{default:!0,monospace:!0,small:!0,children:e})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(b.Z,{checked:n,onClick:function(){return Re((function(t){return yn(yn({},t),{},(0,r.Z)({},i,yn(yn({},null===t||void 0===t?void 0:t[i]),{},{streams:n?(0,_e.Od)(l,(function(n){return n===e})):l.concat(e)})))}))},small:!0})]}))},e)}))]}),(0,C.jsx)(ve.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,yn(yn({},y.A0),{},{children:[(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(P.ZP,{bold:!0,default:!0,children:"Only use this block\u2019s output data as an input"}),(0,C.jsxs)(P.ZP,{muted:!0,small:!0,children:["If checked, then this block\u2019s output data is only used as inputs.",h.tf.DATA_EXPORTER===me&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("br",{}),"The block\u2019s output data won\u2019t be ingested when running a sync, regardless if it\u2019s enabled in the settings."]})]})]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(b.Z,{checked:!(null===o||void 0===o||!o.input_only),onClick:function(){return Re((function(e){var n;return yn(yn({},e),{},(0,r.Z)({},i,yn(yn({},null===e||void 0===e?void 0:e[i]),{},{input_only:!(null!==e&&void 0!==e&&null!==(n=e[i])&&void 0!==n&&n.input_only)})))}))}})]}))})]})})]}),(0,C.jsx)(x.Z,{light:!0})]},i)}));return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsx)(re.Z,{children:"Inputs"}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{default:!0,children:["Choose which upstream block to use as inputs when interpolating data into ",(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,children:be}),"\u2019s (current block) credentials (aka config) and decorated functions."]})}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{default:!0,children:["If ",(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,children:be})," (current block) doesn\u2019t require the data from an upstream block to interpolate or as arguments for decorated functions, don\u2019t toggle them on because it\u2019ll save time and data by not loading unnecessary data as inputs."]})}),V.O.DESTINATIONS===xe&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{default:!0,children:["Upstream blocks can still be selected to have its data ingested. This is toggled and configured in the ",(0,C.jsx)(k.Z,{bold:!0,primary:!0,preventDefault:!0,onClick:function(){return Nn((function(){return{selectedMainNavigationTab:ce.uK.STREAMS}}))},children:"Streams"})," section."]})})]}),(0,C.jsx)(x.Z,{light:!0}),e]})}}else{if(ce.uK.STREAMS===Sn&&Wn)return(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsxs)(Z.Z,{mb:O.cd,children:[(0,C.jsx)(re.Z,{children:"Fetch streams to start set up"}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{default:!0,children:["Add streams and configure them by first fetching the available streams from ",Te,"."]})})]}),(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(G.rH,{size:2*O.iI}),large:!0,loading:qn,onClick:function(){return Yn()},primary:!0,children:"Fetch streams"})]});if(ce.uK.SYNC===Sn)return(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsx)(P.ZP,{children:"Coming soon"})});if(ce.uK.OVERVIEW===Sn)return(0,C.jsx)(mn,{block:ye,blocksMapping:Fe,onChangeBlock:v,selectedStreamMapping:K,setSelectedMainNavigationTab:function(e){return Nn((function(n){return{selectedMainNavigationTab:e}}))},setSelectedStreamMapping:q,streamMapping:Qe,updateStreamsInCatalog:Ne})}}),[ye,he,me,be,He,Fe,Be,xe,Te,Yn,qn,Wn,v,ue,Sn,In,K,En,Re,Nn,q,Qe,Ne]),St=(0,s.useMemo)((function(){return bt?(0,C.jsx)(P.ZP,{bold:!0,children:"Documentation"}):mt?(0,C.jsx)(P.ZP,{bold:!0,children:"Bulk edit stream properties"}):gt?(0,C.jsx)(P.ZP,{bold:!0,children:"Bulk edit streams"}):void 0}),[bt,mt,gt]),It=(0,s.useMemo)((function(){if(mt||gt)return(0,C.jsx)(Ge,{ref:A,children:(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsx)(b.Z,{checked:Q,label:"Clear selection and values after applying changes",onClick:function(){return $((function(e){return!e}))}})}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{fullWidth:!0,onClick:function(){var e={noParents:{},parents:{}};mt?e=(0,ae.Kq)(K,On,L):gt&&(e=(0,ae.bX)(K,L)),Ne((0,ae.eH)(e),(function(e){return null===v||void 0===v?void 0:v(e)})),Q&&(F({}),wn({}),q(null))},primary:!0,children:"Apply bulk changes"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(T.Z,{fullWidth:!0,onClick:function(){F({}),wn({}),q(null)},secondary:!0,children:"Clear"})]})]})})}),[L,Q,On,mt,gt,v,A,K,F,wn,q]),Et=(0,s.useMemo)((function(){if(bt)return(0,C.jsxs)(Z.Z,{p:O.cd,children:[!De&&(0,C.jsx)(H.Z,{}),ze&&(0,C.jsx)(fe.Z,{children:ze.replace(/\<br \/\>/g,"\n\n")})]});if(mt){var e=(0,ae.zB)({parent_stream:In,stream:Sn,tap_stream_id:Sn},Qe);return(0,C.jsx)(pn,{attributesMapping:L,block:ye,blocksMapping:Fe,highlightedColumnsMapping:On,selectedStreamMapping:K,setAttributesMapping:F,setHighlightedColumnsMapping:wn,setSelectedStreamMapping:q,stream:e,streamMapping:Qe,updateStreamsInCatalog:Ne})}return gt?(0,C.jsx)(an,{attributesMapping:L,selectedStreamMapping:K,setAttributesMapping:F,setSelectedStreamMapping:q,streamMapping:Qe}):void 0}),[L,ye,Fe,De,ze,On,bt,mt,gt,K,F,wn,q,Qe,Ne]),Tt=(0,s.useMemo)((function(){var e=[{label:function(){return be}}];return Ie&&e.push({bold:!Sn,label:function(){return Ie}}),Sn&&e.push({bold:!0,label:function(){return ce.TD[Sn]||Sn}}),(0,C.jsx)(te.Z,{breadcrumbs:e,noMarginLeft:!0})}),[be,Ie,Sn]),Mt=(0,s.useMemo)((function(){return(ne-et-kn)/2}),[et,ne]),Dt=(0,s.useMemo)((function(){return(0,C.jsx)(on,{block:ye,blocksMapping:Fe,height:et-it,onChangeBlock:v,searchText:Xn,setSelectedMainNavigationTab:Nn,setSelectedSubTab:function(e){return Nn((function(n){return yn(yn({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Bn,streamsFetched:Hn,updateStreamsInCatalog:Ne,width:nt-(fn+(xt?0:rn))})}),[xt,rn,fn,ye,Fe,it,et,v,Xn,Nn,Bn,Hn,Ne,nt]);return(0,C.jsxs)(Ke,{maxWidth:nt,children:[(0,C.jsx)(Ve,{children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{children:Tt}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(k.Z,{href:"https://docs.mage.ai",inline:!0,noOutline:!0,openNewWindow:!0,children:(0,C.jsx)(G.$l,{default:!0,size:2*O.iI})}),(0,C.jsx)(Z.Z,{mr:2}),_&&(0,C.jsx)(T.Z,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){null===_||void 0===_||_()},children:(0,C.jsx)(G.x8,{default:!0,size:2*O.iI})})]})]})}),(0,C.jsxs)(bn.Z,{after:Et,afterFooter:It,afterFooterBottomOffset:Mt,afterHeader:(0,C.jsx)(Z.Z,{ref:B,px:1,children:St}),afterHeightOffset:0,afterHeaderOffset:0,afterHidden:xt,afterInnerHeightMinus:48+(It&<||0),afterMousedownActive:cn,afterWidth:rn,before:Fn,beforeHeightOffset:0,beforeMousedownActive:jn,beforeWidth:fn,contained:!0,headerOffset:it,height:et,hideAfterCompletely:!Et||gt&&!(null!==Ye&&void 0!==Ye&&Ye.length),inline:!0,mainContainerHeader:$n,mainContainerRef:D,setAfterHidden:pt,setAfterMousedownActive:sn,setAfterWidth:ln,setBeforeMousedownActive:Zn,setBeforeWidth:vn,uuid:Xe,children:[ht&&jt,!ht&&_t,ce.uK.CONFIGURATION===Sn&&ce.tw.CREDENTIALS===En&&Ct,ce.uK.STREAMS===Sn&&!Wn&&Dt]})]})},Pn=t(10553),On=t(29618),wn=t(50724),Cn=t(70374),_n=t(39643),Sn=t(87848),In=t(58325),En=t(44688);function Tn(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 Mn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Tn(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Tn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Dn,Bn,An=function(e){var n=e.cancelPipeline,t=e.children,i=e.createPipeline,o=e.executePipeline,l=e.interruptKernel,u=e.isPipelineExecuting,c=e.pipeline,a=e.restartKernel,d=e.savePipelineContent,p=(e.setActiveSidekickView,e.setMessages),f=(0,s.useState)(null),v=f[0],h=f[1],m=(0,s.useRef)(null),b=(0,s.useRef)(null),g=(0,s.useRef)(null),x=[{label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,Q.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,Q.Y6)(),type:F.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{keyTextGroups:[[(0,In.V5)()?_n.RJ:_n.hE,_n.SS]],label:function(){return"Save pipeline"},onClick:function(){return d()},uuid:"save_pipeline"}],j=(0,s.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[_n.kA],[_n.kA]],onClick:function(){return l()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[_n.t_[_n.OC]],[_n.t_[_n.OC]]],onClick:function(){return a()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return p((function(e){return Object.keys(e).reduce((function(e,n){return Mn(Mn({},e),{},(0,r.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return u?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):(null===c||void 0===c?void 0:c.type)===F.qL.STREAMING&&e.push({label:function(){return"Execute pipeline"},onClick:function(){return o()},uuid:"Execute pipeline"}),e}),[n,o,l,u,null===c||void 0===c?void 0:c.type,a,p]),k=(0,s.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null===c||void 0===c?void 0:c.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"}]}),[c]),Z="FileHeaderMenu/index",O=(0,En.y)(),w=O.registerOnKeyDown,_=O.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){_(Z)}}),[_,Z]),w(Z,(function(e,n,t){null!==v&&(n[_n.QK]?h((function(e){return 0===e?2:e-1})):n[_n.DY]&&h((function(e){return 2===e?0:e+1})))}),[v,h]),(0,C.jsx)(wn.Z,{onClickOutside:function(){return h(null)},open:!0,style:{position:"relative"},children:(0,C.jsxs)(y.ZP,{children:[(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(Sn.u,{highlighted:0===v,onClick:function(){return h((function(e){return 0===e?null:0}))},onMouseEnter:function(){return h((function(e){return null!==e?0:null}))},ref:m,children:(0,C.jsx)(P.ZP,{children:"File"})}),(0,C.jsx)(Cn.Z,{items:x,onClickCallback:function(){return h(null)},open:0===v,parentRef:m,uuid:"FileHeaderMenu/file_items"})]}),(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(Sn.u,{highlighted:1===v,onClick:function(){return h((function(e){return 1===e?null:1}))},onMouseEnter:function(){return h((function(e){return null!==e?1:null}))},ref:b,children:(0,C.jsx)(P.ZP,{children:"Run"})}),(0,C.jsx)(Cn.Z,{items:j,onClickCallback:function(){return h(null)},open:1===v,parentRef:b,uuid:"FileHeaderMenu/run_items"})]}),(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(Sn.u,{highlighted:2===v,onClick:function(){return h((function(e){return 2===e?null:2}))},onMouseEnter:function(){return h((function(e){return null!==e?2:null}))},ref:g,children:(0,C.jsx)(P.ZP,{children:"Edit"})}),(0,C.jsx)(Cn.Z,{items:k,onClickCallback:function(){return h(null)},open:2===v,parentRef:g,uuid:"FileHeaderMenu/edit_items"})]}),t]})})},Rn=t(90758),Nn=t(15135),Ln=t(67355),Fn=t(70613);!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(Dn||(Dn={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(Bn||(Bn={}));var Un,Hn=t(16756),zn=t(89515),Wn=t(98464);!function(e){e.EMR="emr"}(Un||(Un={}));var Gn=t(97133),Kn=t(15610),Vn=t(89538);var qn=function(e){var n=e.children,t=(e.filePaths,e.filesTouched,e.isBusy),i=e.kernel,r=e.pipeline,u=(e.restartKernel,e.savePipelineContent,e.saveStatus),c=e.selectedFilePath,a=e.setErrors,p=e.setRunningBlocks,f=e.updatePipelineMetadata,v=(0,s.useContext)(m.ThemeContext),h=i||{},b=h.alive,x=h.usage,w=(0,s.useState)(!1),_=w[0],S=w[1],I=(0,s.useState)(""),E=I[0],T=I[1],M=(0,s.useState)(Un.EMR),D=M[0],B=(M[1],(0,s.useState)(!1)),A=B[0],R=B[1],L=(0,s.useState)(!1),U=L[0],H=L[1],z=(0,s.useRef)(null),K=W.ZP.clusters.detail(D,{},{revalidateOnFocus:!1}),V=K.data,q=K.mutate,Y=(0,s.useMemo)((function(){var e;return(null===V||void 0===V||null===(e=V.cluster)||void 0===e?void 0:e.clusters)||[]}),[V]),Q=(0,s.useMemo)((function(){return(0,_e.sE)(Y,(function(e){return e.is_active}))}),[Y]),J=(0,d.Db)(W.ZP.clusters.useUpdate(D),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){q()},onErrorCallback:function(e,n){return a({errors:n,response:e})}})}}),$=(0,l.Z)(J,1)[0];(0,s.useEffect)((function(){null!==r&&void 0!==r&&r.uuid&&T(r.uuid)}),[null===r||void 0===r?void 0:r.uuid]);var ee="KernelStatus",ne=(0,En.y)(),te=ne.registerOnKeyDown,ie=ne.unregisterOnKeyDown;(0,s.useEffect)((function(){return function(){ie(ee)}}),[ie,ee]),te(ee,(function(e,n,t){_&&String(t[0])===String(_n.Uq)&&String(t[1])!==String(_n.zX)&&((null===r||void 0===r?void 0:r.uuid)===E?e.target.blur():(f(E),S(!1)))}),[_,E,S,f]);var oe=(0,s.useMemo)((function(){return null===x||void 0===x?void 0:x.pid}),[null===x||void 0===x?void 0:x.pid]),re=(0,Wn.Z)(oe),le=(0,s.useMemo)((function(){if(null!==x&&void 0!==x&&x.kernel_memory){var e=x.kernel_memory,n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(2))).concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}}),[null===x||void 0===x?void 0:x.kernel_memory]),ue=(0,Vn.dd)((function(){return(0,C.jsx)(zn.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:se,onClick:function(){(0,gn.t8)(gn.DU,1),se()},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*O.iI})}),{},[],{background:!0,uuid:"restart_kernel_warning"}),ce=(0,l.Z)(ue,2),ae=ce[0],se=ce[1];(0,s.useEffect)((function(){var e=(0,gn.U2)(gn.DU,0);oe!==re&&t&&!e&&(ae(),p([]))}),[t,oe,re,p,ae]);var de=(0,s.useMemo)((function(){return(0,C.jsx)("div",{ref:z,style:{position:"relative"},children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(null===r||void 0===r?void 0:r.type)===F.qL.PYSPARK&&(0,C.jsxs)(Z.Z,{mr:1,children:[(0,C.jsxs)(k.Z,{muted:!!Q,onClick:function(){return R(!0)},preventDefault:!0,sameColorAsText:!Q,underline:!Q,children:[Q&&Q.id,!Q&&"Select cluster"]}),(0,C.jsx)(wn.Z,{disableEscape:!0,onClickOutside:function(){return R(!1)},open:A,children:(0,C.jsx)(Cn.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,o.Z)(Y.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(P.ZP,{muted:!t&&Bn.WAITING!==i,children:n})}),t&&(0,C.jsx)(G.Jr,{size:2*O.iI,success:!0}),!t&&(0,C.jsx)(P.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||Bn.WAITING!==i?null:function(){return $({cluster:{id:n}})},uuid:n}})))),onClickCallback:function(){return R(!1)},open:A,parentRef:z,uuid:"KernelStatus/select_cluster",width:40*O.iI})})]}),(0,C.jsx)(N.ZP,{beforeElement:(0,C.jsx)(g.Z,{color:t?(v||Oe.Z).borders.info:b?(v||Oe.Z).borders.success:(v||Oe.Z).borders.danger,size:O.iI}),blackBorder:!0,compact:!0,inline:!0,onClick:function(){return H(!0)},uuid:"Pipeline/KernelStatus/kernel",children:(null===r||void 0===r?void 0:r.type)||F.qL.PYTHON}),(0,C.jsx)(wn.Z,{disableEscape:!0,onClickOutside:function(){return H(!1)},open:U,children:(0,C.jsx)(Cn.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,o.Z)(Object.keys(F.a_).filter((function(e){return(null===r||void 0===r?void 0:r.type)!=e})).map((function(e){return{label:function(){return e},onClick:function(){return f(null===r||void 0===r?void 0:r.name,e)},uuid:e}})))),onClickCallback:function(){return H(!1)},open:U,parentRef:z,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*O.iI})})]})})}),[b,Y,t,r,Q,R,H,A,U,v,$,f]);return(0,C.jsx)(Gn.rK,{relativePosition:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,C.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:[(0,C.jsxs)(Z.Z,{px:O.cd,children:[c&&(0,C.jsx)(k.Z,{noHoverUnderline:!0,noOutline:!0,onClick:c?function(){return(0,Kn.u7)({file_path:null})}:null,preventDefault:!0,children:n}),!c&&(0,C.jsxs)(y.ZP,{alignItems:"center",children:[n,_&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(k.Z,{onClick:function(){f(E),S(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]})]}),x&&(0,C.jsx)(Z.Z,{mr:O.cd,children:(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsxs)(P.ZP,{monospace:!0,muted:!0,xsmall:!0,children:["CPU: ",null===x||void 0===x?void 0:x.kernel_cpu,"undefined"!==typeof(null===x||void 0===x?void 0:x.kernel_cpu)&&"%"]}),(0,C.jsxs)(P.ZP,{monospace:!0,muted:!0,xsmall:!0,children:["Memory: ",le]})]})})]}),(0,C.jsx)(Z.Z,{px:O.cd,children:(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Ze.Z,{appearBefore:!0,block:!0,description:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(P.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,C.jsx)(Hn.Z,{inline:!0,keyText:(0,In.V5)()?_n.RJ:_n.hE}),"\xa0",(0,C.jsx)(P.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,C.jsx)(Hn.Z,{inline:!0,keyText:_n.SS}),"\xa0",(0,C.jsx)(P.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,C.jsx)("br",{})]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{default:!0,children:["Or, go to ",(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,C.jsx)(P.ZP,{muted:!0,children:u})}),(0,C.jsx)(Z.Z,{ml:2}),de]})})]})})},Yn=t(48339),Qn=t(65956),Xn=t(17717),Jn=t(12691),$n=t.n(Jn),et=t(65976),nt=t(57271),tt=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];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 ot(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,r.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 rt=m.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*O.iI),lt=m.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var ut=function(e){var n=e.bold,t=void 0===n||n,i=e.defaultColor,o=e.description,r=e.disableWordBreak,l=e.fullWidth,u=e.inputValue,c=e.inputWidth,a=e.invertedTheme,d=e.label,p=e.labelColor,f=e.menuOpen,v=void 0!==f&&f,h=e.monospace,m=e.muted,b=e.onClick,g=e.notRequired,x=e.selectedTextProps,O=e.small,w=e.stacked,_=e.suffixValue,S=e.tooltipProps,I=e.value,E=(0,he.Z)(e,tt),T=(0,s.useRef)(null),M=(0,s.useState)(!1),D=M[0],B=M[1],A=(0,s.useState)(!1),R=A[0],N=A[1],L=d&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(P.ZP,{bold:t,color:p,inverted:a,lineHeight:20,monospace:h,muted:m,small:O,children:d}),S&&(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(Ze.Z,ot({muted:!0},S))})]}),F=(0,C.jsxs)(j.Z,{flex:l?"1":"none",children:[I&&(0,C.jsx)(k.Z,{block:!0,danger:null===x||void 0===x?void 0:x.danger,fullWidth:!0,muted:m,onClick:function(){b(),T.current&&T.current.focus(),B(!0)},preventDefault:!0,sameColorAsText:m||!(null!==x&&void 0!==x&&x.primary)&&!(null!==x&&void 0!==x&&x.danger)&&!(null!==x&&void 0!==x&&x.warning),underline:null===x||void 0===x?void 0:x.underline,warning:null===x||void 0===x?void 0:x.warning,children:(0,C.jsx)(P.ZP,ot(ot({inverted:a,muted:m},x),{},{disableWordBreak:r,monospace:h,small:O,width:c,children:I}))}),(0,C.jsx)(z.Z,ot(ot({},E),{},{basic:!0,defaultColor:i,fullWidth:l,invertedTheme:a,monospace:h,onBlur:function(e){B(!1),E.onBlur&&E.onBlur(e),R||N(!0)},onFocus:function(e){B(!0),E.onFocus&&E.onFocus(e)},ref:T,small:O,value:u,visible:!I}))]}),U=o&&(0,C.jsx)(lt,{children:(0,C.jsx)(P.ZP,{dangerouslySetInnerHTML:{__html:o},monospace:h,muted:!0,small:O})}),H=(0,s.useMemo)((function(){return(0,C.jsx)(P.ZP,{default:!0,small:O,children:_})}),[O,_]);return(0,C.jsxs)(C.Fragment,{children:[w&&(0,C.jsxs)(C.Fragment,{children:[L&&(0,C.jsxs)(rt,{children:[(0,C.jsx)(y.ZP,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:L}),U]}),(0,C.jsxs)(y.ZP,{fullWidth:l,children:[F,_&&H]})]}),!w&&(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,children:[L&&(0,C.jsxs)(C.Fragment,{children:[L,(0,C.jsx)(Z.Z,{ml:1})]}),F,_&&H]}),R&&!D&&!I&&!v&&!g&&(0,C.jsx)(P.ZP,{danger:!0,small:O,children:"This field is required."})]})},ct=6.25*O.iI,at=(O.iI,100*O.iI),st=m.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%);",""],we.n_,at,(function(e){return"\n box-shadow: ".concat((e.theme||Oe.Z).shadow.window,";\n background-color: ").concat((e.theme||Oe.Z).background.panel,";\n ")})),dt=(0,m.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],ct,O.iI,O.cd*O.iI,(function(e){return"\n background-color: ".concat((e.theme||Oe.Z).background.output,";\n ")})),pt=m.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],dt,we.n_,we.n_,(function(e){return"\n border-bottom: ".concat(we.YF,"px ").concat(we.M8," ").concat((e.theme||Oe.Z).borders.medium,";\n ")})),ft=m.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],O.iI,He.w5,(0,ze.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*ct,"px);\n ")})),vt=m.default.div.withConfig({displayName:"indexstyle__WindowFooterStyle",componentId:"sc-g0cszf-3"})([""," justify-content:flex-end;border-bottom-left-radius:","px;border-bottom-right-radius:","px;",""],dt,we.n_,we.n_,(function(e){return"\n border-top: ".concat(we.YF,"px ").concat(we.M8," ").concat((e.theme||Oe.Z).borders.medium,";\n ")})),ht=m.default.div.withConfig({displayName:"indexstyle__InputRowStyle",componentId:"sc-g0cszf-4"})(["padding:","px ","px;",""],.75*O.iI,2*O.iI,(function(e){return"\n border-bottom: ".concat(we.YF,"px ").concat(we.M8," ").concat((e.theme||Oe.Z).borders.medium,";\n ")}));function mt(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 bt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mt(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gt=function(e){var n=e.blocks,t=e.creatingNewDBTModel,i=e.dbtModelName,o=e.files,r=e.onClose,l=e.onOpenFile,u=e.setDbtModelName,c=(0,s.useState)(!1),a=c[0],d=c[1],p=(0,s.useState)(null),f=p[0],v=p[1],m=(0,s.useMemo)((function(){var e,n,t=null===(e=(0,_e.sE)((null===o||void 0===o||null===(n=o[0])||void 0===n?void 0:n.children)||[],(function(e){return"dbt"===e.name})))||void 0===e?void 0:e.children,i=[];return null===t||void 0===t||t.forEach((function(e){var n=e.children,t=void 0===n?[]:n;t.length>=1&&i.push(bt(bt({},e),{},{children:t}))})),i}),[o]),b=(0,s.useMemo)((function(){return(0,_e.HK)(n,(function(e){return e.configuration.file_path}))}),[n]);return(0,C.jsxs)(st,{children:[(0,C.jsxs)(pt,{children:[(0,C.jsx)(j.Z,{alignItems:"center",children:(0,C.jsx)(P.ZP,{disableWordBreak:!0,monospace:!0,children:t?"Create new dbt model":"Select dbt model or snapshot file"})}),(0,C.jsx)(T.Z,{iconOnly:!0,onClick:r,children:(0,C.jsx)(G.x8,{muted:!0})})]}),t&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(ht,{children:(0,C.jsx)(ut,{dynamicSizing:!0,inputValue:i,label:"Model name (cannot be changed):",labelColor:Oe.Z.accent.dbt,notRequired:!0,onBlur:function(){d(!1)},onChange:function(e){u(e.target.value),e.preventDefault()},onClick:function(){d(!0)},onFocus:function(){d(!0)},placeholder:"Enter name",required:!0,stacked:!0,suffixValue:".".concat(h.t6.SQL),value:!a&&i})}),(0,C.jsxs)(ht,{children:[(0,C.jsx)(P.ZP,{bold:!0,color:Oe.Z.accent.dbt,children:"Select folder location:"}),(0,C.jsx)(P.ZP,{bold:!0,muted:!f,children:f?"dbt".concat(Xn.sep).concat(f):"Choose folder below"})]})]}),(0,C.jsx)(ft,{children:(0,C.jsx)(Pn.Z,{allowSelectingFolders:t,disableContextMenu:!0,files:m,isFileDisabled:function(e,n){return t?!n||(null===n||void 0===n?void 0:n.some((function(e){return"models"===(null===e||void 0===e?void 0:e.name)}))):!!b[e]||!(null!==n&&void 0!==n&&n.length)&&!e.match(new RegExp(".".concat(h.t6.SQL,"$")))},openFile:l,selectFile:v,uncollapsed:!0,useRootFolder:!0})}),t&&(0,C.jsx)(vt,{children:(0,C.jsx)(T.Z,{backgroundColor:i&&f?Oe.Z.accent.dbt:Oe.Z.monotone.grey500,disabled:!i||!f,onClick:function(){return l(f)},padding:"6px 8px",children:"Create model"})})]})},xt=t(10975),jt=t(14567),yt=t(79757),kt=t(41429),Zt=t(61709);function Pt(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 Ot(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Pt(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function wt(e,n){var t,i=e.block,o=e.blocks,r=e.onClick,u=e.onDrop,c=i.type,a=(0,xt.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:i,type:kt.vT}}),[i]),d=(0,l.Z)(a,3),p=d[0],f=d[1],v=(d[2],(0,jt.L)((function(){return{accept:kt.vT,drop:function(e){return null===u||void 0===u?void 0:u(i,e)}}}),[i])),b=(0,l.Z)(v,2)[1],x=(0,s.useContext)(m.ThemeContext),_=(0,w.qn)(c,{blockColor:i.color,theme:x}).accent,S=(0,ae.cU)([i],o)[0],I=S.dynamic,E=S.dynamicUpstreamBlock,T=S.reduceOutput,M=S.reduceOutputUpstreamBlock,D=(0,s.useMemo)((function(){return(0,Zt._o)({block:i,dynamic:I,dynamicUpstreamBlock:E,reduceOutput:T,reduceOutputUpstreamBlock:M})}),[i,I,E,T,M]).borderColorShareProps,B=(0,s.useMemo)((function(){return h.tf.DBT===(null===i||void 0===i?void 0:i.type)}),[i]);return(0,C.jsx)(Z.Z,{pb:1,ref:b,children:(0,C.jsx)(w.PY,Ot(Ot({},Ot(Ot({},D),p)),{},{ref:f,children:(0,C.jsx)(k.Z,{noHoverUnderline:!0,noOutline:!0,onClick:function(){return r()},preventDefault:!0,ref:n,children:(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",flex:1,children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(yt.Z,{monospace:!0,children:h.dO[i.language]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(g.Z,{color:_,size:1.5*O.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(P.ZP,{color:_,monospace:!0,children:null===(t=B?h.tf.DBT:h.V4[i.type])||void 0===t?void 0:t.toUpperCase()})]}),(0,C.jsx)(Z.Z,{mr:O.cd}),(0,C.jsx)(G.iU,{size:1.5*O.iI}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(P.ZP,{monospace:!0,muted:!0,children:null===i||void 0===i?void 0:i.uuid})]}),(0,C.jsx)(Ze.Z,{appearAbove:!0,appearBefore:!0,block:!0,label:"Show ".concat(null===i||void 0===i?void 0:i.uuid," block"),size:2*O.iI,widthFitContent:!0,children:(0,C.jsx)(G.Db,{muted:!0,size:2*O.iI})})]})})})}))})}var Ct=s.forwardRef(wt),_t=t(32013),St=t(98777),It=t(39457);function Et(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 Tt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Et(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Et(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Mt="4px",Dt=[Pe.Zj.BIGQUERY,Pe.Zj.DELTA_LAKE_S3];var Bt=function(e){var n=e.bookmarkValues,t=e.destination,i=e.isLoadingLoadSampleData,o=e.isLoadingUpdateDestinationBlockState,u=e.loadSampleData,c=e.source,a=e.stream,d=e.streams,p=e.updateAllStreams,f=e.updateDestinationBlockState,v=e.updateMetadataForColumns,h=e.updateSchemaProperty,m=e.updateStream,g=(0,s.useRef)(null),x=a.bookmark_properties,k=a.destination_table,w=void 0===k?"":k,_=a.key_properties,S=a.metadata,I=a.partition_keys,E=a.replication_method,M=a.run_in_parallel,D=a.schema.properties,B=a.tap_stream_id,A=a.unique_constraints,R=a.unique_conflict_method,N=(0,s.useState)(w),L=N[0],F=N[1],H=(0,s.useState)(!1),W=H[0],G=H[1],K=(0,s.useState)(null),V=K[0],q=K[1],Y=(0,s.useState)(!!t),X=Y[0],J=Y[1],$=(0,s.useState)((0,r.Z)({},B,n||{})),ee=$[0],ne=$[1],te=(0,Wn.Z)(B);(0,s.useEffect)((function(){te!==B&&(F(w),q(null))}),[w,E,B,te,R]),(0,s.useEffect)((function(){var e=null===ee||void 0===ee?void 0:ee[B];(null===x||void 0===x?void 0:x.length)>0&&((0,ge.Qr)(e)||!(0,ge.Xy)(n,e))&&ne((function(e){return Tt(Tt({},e),{},(0,r.Z)({},B,n))}))}),[null===x||void 0===x?void 0:x.length,n,B]);var ie=(0,s.useMemo)((function(){return(0,_e.HK)(S,(function(e){return e.breadcrumb.join("/")}))}),[S]),oe=(0,s.useMemo)((function(){var e;return null===(e=(0,_e.sE)(S,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[S]),le=(0,s.useMemo)((function(){return oe[Pe.fe.KEY_PROPERTIES]||[]}),[oe]),ce=(0,s.useMemo)((function(){return oe[Pe.fe.REPLICATION_KEYS]||[]}),[oe]),ae=Dt.includes(t),se=d.length>1,de=(0,s.useCallback)((function(e){var n=Tt({},null===ee||void 0===ee?void 0:ee[B]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return Tt(Tt({},e),{},(0,r.Z)({},B,Tt({},n)))})),f({block:{bookmark_values:n,destination_table:L,tap_stream_id:B}})}),[ee,L,B,f]),pe=(0,s.useMemo)((function(){var e=[],n=[],i=(0,_e.mr)(Object.entries(D)).map((function(i,o){var r=(0,l.Z)(i,2),u=r[0],c=r[1],a=c.anyOf,s=void 0===a?[]:a,d=c.format,f=c.type,g=void 0===f?[]:f,k=new Set(Array.isArray(g)?g:[g]),w=new Set(k);s.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){k.add(e),w.add(e)})):(k.add(t),w.add(t),n&&w.add(n))}));var S=Array.from(k);d&&w.add(d);var E=(ie["properties/".concat(u)]||{}).metadata,M=(E.inclusion,E.selected);e.push(M),n.push(u);var D=Pe.D5.reduce((function(e,n){return S.indexOf(n)>=0||Pe.Xv===String(n)&&Pe.zS.DATE_TIME===d||Pe.zS.UUID===String(n)&&Pe.zS.UUID===d?e:e.concat((0,C.jsx)("option",{value:n,children:n},n))}),[]),R=S.findIndex((function(e){return e===Pe.RL.STRING})),N=[(0,C.jsx)(b.Z,{checked:M,onClick:function(){v(B,[u],{selected:!M})}},"".concat(B,"/").concat(u,"/selected")),(0,C.jsx)(P.ZP,{children:u},"".concat(B,"/").concat(u,"/name")),(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:S.map((function(e,n){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(je.Z,{border:!0,label:d&&Pe.RL.STRING===e&&R===n?Pe.eL[d]:e,onClick:function(){var n={format:d,type:S.filter((function(n){return n!==e}))};Pe.zS.DATE_TIME!==d&&Pe.zS.UUID!==d||Pe.RL.STRING!==e||(n.format=null),h(B,u,n)},small:!0})},"".concat(B,"/").concat(u,"/").concat(e,"/").concat(n,"/chip"))}))})}),D.length>=1&&(0,C.jsxs)(U.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:d,type:S};Pe.Xv===String(n)?(t.format=Pe.zS.DATE_TIME,t.type.push(Pe.RL.STRING)):Pe.zS.UUID===String(n)?(t.format=Pe.zS.UUID,t.type.push(Pe.RL.STRING)):t.type.push(n),h(B,u,t)},primary:!0,small:!0,value:"",width:10*O.iI,children:[(0,C.jsx)("option",{value:""}),D]})]},"".concat(B,"/").concat(u,"/type")),(0,C.jsx)(b.Z,{checked:!(null===A||void 0===A||!A.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,_e.Od)(e.unique_constraints,(function(e){return u===e})):e.unique_constraints=[u].concat(e.unique_constraints||[]),e}))}},"".concat(B,"/").concat(u,"/unique")),(0,C.jsx)(b.Z,{checked:!(null===x||void 0===x||!x.includes(u)),disabled:ce.length>=1&&!ce.includes(u),onClick:ce.length>=1&&!ce.includes(u)?null:function(){return m(B,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(u)?(de(u),e.bookmark_properties=(0,_e.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),e}))}},"".concat(B,"/").concat(u,"/bookmark")),(0,C.jsx)(b.Z,{checked:!(null===_||void 0===_||!_.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,_e.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(ae){var L=t!==Pe.Zj.DELTA_LAKE_S3,F=L&&(le.includes(u)||!w.has(Pe.zS.DATE_TIME));N.push((0,C.jsx)(b.Z,{checked:!(null===I||void 0===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,_e.Od)(e.partition_keys,(function(e){return u===e})):L&&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(se){var H=V===o;N.push((0,C.jsx)(T.Z,{compact:!0,disabled:H,onClick:function(){q(o),setTimeout((function(){return q(null)}),2e3),p((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==B&&null!==e&&void 0!==e&&null!==(n=e.schema)&&void 0!==n&&null!==(t=n.properties)&&void 0!==t&&t[u]){var i,o,r,l,c,a,s,p,f;e.schema.properties[u]={format:d||null,type:S};var v=null===(i=(0,_e.sE)((null===e||void 0===e?void 0:e.metadata)||[],(function(e){return 0===e.breadcrumb.length})))||void 0===i?void 0:i.metadata,h=v[Pe.fe.REPLICATION_KEYS]||[],m=v[Pe.fe.KEY_PROPERTIES]||[];null===A||void 0===A||!A.includes(u)||null!==e&&void 0!==e&&null!==(o=e.unique_constraints)&&void 0!==o&&o.includes(u)||!m.includes(u)?null!==A&&void 0!==A&&A.includes(u)||null===e||void 0===e||null===(r=e.unique_constraints)||void 0===r||!r.includes(u)||(e.unique_constraints=(0,_e.Od)(e.unique_constraints,(function(e){return u===e}))):e.unique_constraints=[u].concat(e.unique_constraints||[]),null===x||void 0===x||!x.includes(u)||null!==e&&void 0!==e&&null!==(l=e.bookmark_properties)&&void 0!==l&&l.includes(u)||!h.includes(u)?null!==x&&void 0!==x&&x.includes(u)||null===e||void 0===e||null===(c=e.bookmark_properties)||void 0===c||!c.includes(u)||(e.bookmark_properties=(0,_e.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),null===_||void 0===_||!_.includes(u)||null!==e&&void 0!==e&&null!==(a=e.key_properties)&&void 0!==a&&a.includes(u)?null!==_&&void 0!==_&&_.includes(u)||null===e||void 0===e||null===(s=e.key_properties)||void 0===s||!s.includes(u)||(e.key_properties=(0,_e.Od)(e.key_properties,(function(e){return u===e}))):e.key_properties=[u].concat(e.key_properties||[]),null===I||void 0===I||!I.includes(u)||null!==e&&void 0!==e&&null!==(p=e.partition_keys)&&void 0!==p&&p.includes(u)?null!==I&&void 0!==I&&I.includes(u)||null===e||void 0===e||null===(f=e.partition_keys)||void 0===f||!f.includes(u)||(e.partition_keys=(0,_e.Od)(e.partition_keys,(function(e){return u===e}))):e.partition_keys=[u].concat(e.partition_keys||[])}return Tt({},e)}))},pill:!0,secondary:!0,children:(0,C.jsx)(P.ZP,{success:H,children:H?"Applied!":"Apply"})}))}return N})),o=e.every((function(e){return e})),r=[null,2,1,null,null,null],u=[{label:function(){return(0,C.jsx)(b.Z,{checked:o,onClick:function(){v(B,n,{selected:!o})}})},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 ae&&(r.push(null),u.push({uuid:"Partition key"})),se&&(r.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,C.jsx)(ue.cl,{children:(0,C.jsx)(ye.Z,{alignTop:!0,columnFlex:r,columns:u,rows:i,stickyHeader:!0})})}),[x,t,se,V,_,ie,I,D,de,ae,B,A,p,v,h,m,le,ce]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,C.jsx)(re.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:B})," schema"]}),(0,C.jsx)(Z.Z,{mb:3,children:(0,C.jsx)(Qn.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(P.ZP,{children:"Destination table name"}),(0,C.jsx)(Z.Z,{ml:Mt}),(0,C.jsx)(Ze.Z,{label:(0,C.jsxs)(P.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:B}),". To change the table name, enter in a different value."]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(z.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;F(n),clearTimeout(g.current),g.current=setTimeout((function(){m(B,(function(e){return Tt(Tt({},e),{},{destination_table:n})}))}),300)},value:L||"",width:45*O.iI})]})})}),(0,C.jsx)(Z.Z,{mb:3,children:(0,C.jsx)(Qn.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(P.ZP,{children:"Replication method"}),(0,C.jsx)(Z.Z,{ml:Mt}),(0,C.jsx)(Ze.Z,{label:(0,C.jsxs)(P.ZP,{children:["Do you want to synchronize the entire stream (",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.INCREMENTAL}),")?",c===Pe.th.POSTGRESQL&&(0,C.jsxs)(P.ZP,{children:["Log-based incremental replication (",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsxs)(U.Z,{compact:!0,onChange:function(e){m(B,(function(n){return Tt(Tt({},n),{},{replication_method:e.target.value})}))},primary:!0,value:E,children:[(0,C.jsx)("option",{value:""}),Object.values(Pe._B).filter((function(e){return c===Pe.th.POSTGRESQL||e!==Pe._B.LOG_BASED})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))]}),(0,C.jsx)(Z.Z,{ml:3}),(0,C.jsx)(P.ZP,{children:"Unique conflict method"}),(0,C.jsx)(Z.Z,{ml:Mt}),(0,C.jsx)(Ze.Z,{label:(0,C.jsxs)(P.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,Q._6)("unique column",null===A||void 0===A?void 0:A.length),(null===A||void 0===A?void 0:A.length)>0&&(0,C.jsx)(C.Fragment,{children:"\xa0"}),null===A||void 0===A?void 0:A.sort().map((function(e,n){return(0,C.jsxs)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===A||void 0===A?void 0:A.length)&&n===(null===A||void 0===A?void 0:A.length)-1?(0,C.jsx)(P.ZP,{inline:!0,children:" and "},e):n>=1&&(0,C.jsx)(C.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,children:Pe.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsxs)(U.Z,{compact:!0,inputWidth:11*O.iI,onChange:function(e){m(B,(function(n){return Tt(Tt({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:R,children:[(0,C.jsx)("option",{value:""}),(0,C.jsx)("option",{value:Pe.MU.IGNORE,children:Pe.MU.IGNORE}),(0,C.jsx)("option",{value:Pe.MU.UPDATE,children:Pe.MU.UPDATE})]})]}),se&&(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(P.ZP,{default:!0,children:"All streams"}),(0,C.jsx)(Z.Z,{ml:Mt}),(0,C.jsx)(Ze.Z,{appearBefore:!0,label:(0,C.jsx)(P.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(T.Z,{compact:!0,disabled:W,onClick:function(){G(!0),setTimeout((function(){return G(!1)}),2e3),p((function(e){return Tt(Tt({},e),{},{replication_method:E,unique_conflict_method:R})}))},pill:!0,secondary:!0,children:(0,C.jsx)(P.ZP,{bold:!W,success:W,children:W?"Applied!":"Apply"})})]})]})})}),(0,C.jsx)(Qn.Z,{headerTitle:"Features",noPadding:!0,children:pe}),(0,C.jsx)(Z.Z,{mt:2,children:(0,C.jsx)(T.Z,{loading:i,onClick:function(){return u(B)},primary:!0,small:!0,children:"Load sample data"})}),(0,C.jsxs)(Z.Z,{mt:5,children:[(0,C.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,C.jsx)(Z.Z,{mb:5,children:(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,C.jsx)(P.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."}),(0,C.jsx)(Z.Z,{mb:1}),(0,C.jsx)(ke.Z,{checked:M,onCheck:function(){return m(B,(function(e){return e.run_in_parallel=!M,e}))}},"".concat(B,"/run_in_parallel"))]})}),Pe._B.INCREMENTAL===E&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,C.jsx)(P.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,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==x&&void 0!==x&&x.length)&&(0,C.jsxs)(P.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===x||void 0===x?void 0:x.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(je.Z,{label:e,onClick:function(){de(e),m(B,(function(n){return Tt(Tt({},n),{},{bookmark_properties:(0,_e.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]}),(null===x||void 0===x?void 0:x.length)>0&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{my:2,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),!t&&(0,C.jsx)(P.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,C.jsx)(P.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,C.jsx)(ke.Z,{checked:X,disabled:!t,onCheck:function(){return J((function(e){return!e}))}})]})}),X&&!!t&&(0,C.jsx)(Qn.Z,{header:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(P.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,C.jsx)(T.Z,{compact:!0,loading:o,onClick:function(){f({block:{bookmark_values:(null===ee||void 0===ee?void 0:ee[B])||{},destination_table:L,tap_stream_id:B}})},pill:!0,primary:!0,children:"Save"})]}),headerPaddingVertical:O.iI,noPadding:!0,overflowVisible:!0,children:(0,C.jsx)(ye.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Feature"},{uuid:"Current bookmark value"}],rows:x.map((function(e){var n;return[(0,C.jsx)(P.ZP,{default:!0,monospace:!0,children:e},e),(0,C.jsx)(z.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ne((function(t){return Tt(Tt({},t),{},(0,r.Z)({},B,Tt(Tt({},t[B]),{},(0,r.Z)({},e,n.target.value||null))))}))},paddingHorizontal:0,placeholder:"Enter value (optional)",value:null===ee||void 0===ee||null===(n=ee[B])||void 0===n?void 0:n[e]},"".concat(e,"_value"))]}))})})]})]}),(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,C.jsx)(P.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,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==A&&void 0!==A&&A.length)&&(0,C.jsxs)(P.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===A||void 0===A?void 0:A.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(je.Z,{label:e,onClick:function(){m(B,(function(n){return Tt(Tt({},n),{},{unique_constraints:(0,_e.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,C.jsx)(P.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==_&&void 0!==_&&_.length)&&(0,C.jsxs)(P.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null===_||void 0===_?void 0:_.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(je.Z,{label:e,onClick:function(){m(B,(function(n){return Tt(Tt({},n),{},{key_properties:(0,_e.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ae&&(0,C.jsxs)(Z.Z,{mb:3,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,C.jsx)(P.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,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==I&&void 0!==I&&I.length)&&(0,C.jsxs)(P.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===I||void 0===I?void 0:I.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(je.Z,{label:e,onClick:function(){m(B,(function(n){return Tt(Tt({},n),{},{partition_keys:(0,_e.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},At=["catalog","pipeline","setErrors","setSelectedStream"];function Rt(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 Nt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Rt(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Rt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Lt,Ft=function(e){var n,t=e.catalog,i=e.pipeline,o=e.setErrors,r=e.setSelectedStream,u=(0,he.Z)(e,At),c=(0,s.useState)(null),a=c[0],p=c[1],f=(0,s.useMemo)((function(){return(null===t||void 0===t?void 0:t.streams)||[]}),[t]),v=(0,s.useMemo)((function(){return(0,_e.YC)(f,"stream").map((function(e){return{uuid:e.stream}}))}),[f]),m=(0,s.useMemo)((function(){return(0,_e.HK)(f,(function(e){return e.stream}))}),[f]),b=(0,s.useMemo)((function(){return m[null===a||void 0===a?void 0:a.uuid]}),[a,m]),g=(0,s.useMemo)((function(){return(0,_e.sE)((null===i||void 0===i?void 0:i.blocks)||[],(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n}))}),[null===i||void 0===i?void 0:i.blocks]),x=b||{},j=x.destination_table,y=x.tap_stream_id,k=!(!y||!j),O=W.ZP.blocks.pipelines.detail(k?null===i||void 0===i?void 0:i.uuid:null,k?null===g||void 0===g?void 0:g.uuid:null,{destination_table:j,state_stream:y}),w=O.data,_=O.mutate,S=null===w||void 0===w||null===(n=w.block)||void 0===n?void 0:n.bookmarks,I=(0,d.Db)(W.ZP.blocks.pipelines.useUpdate(null===i||void 0===i?void 0:i.uuid,null===g||void 0===g?void 0:g.uuid,{query:{update_state:!0}}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){null===_||void 0===_||_()},onErrorCallback:function(e,n){return null===o||void 0===o?void 0:o({errors:n,response:e})}})}}),E=(0,l.Z)(I,2),T=E[0],D=E[1].isLoading;(0,s.useEffect)((function(){v.length>0&&(a&&(0,_e.sE)(v,(function(e){var n=e.uuid;return a.uuid===n}))||p(v[0]))}),[a,p,v]);var B=(0,s.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,C.jsx)(ue.cl,{children:(0,C.jsx)(ye.Z,{alignTop:!0,columnBorders:!0,columnFlex:e.map((function(e){return 1})),columns:e,rows:f.map((function(e){var n=e.replication_method,t=e.destination_table,i=e.bookmark_properties,o=e.key_properties,r=e.metadata,l=e.unique_constraints,u=e.unique_conflict_method,c=e.partition_keys,a=e.tap_stream_id,s=r.reduce((function(e,n){var t=n.breadcrumb,i=n.metadata.selected,o=(null===t||void 0===t?void 0:t.length)>0,r=i&&o?1:0,l=o?1:0;return{selectedCount:e.selectedCount+r,totalCount:e.totalCount+l}}),{selectedCount:0,totalCount:0}),d=(0,C.jsx)(P.ZP,{children:"".concat(s.selectedCount," of ").concat(s.totalCount," total")},"".concat(a,"_col_selected")),p=[a,n,t,i,o,l,u,c].map((function(e,n){return(0,C.jsx)(P.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(a,"_cell_").concat(n))}));return p.slice(0,1).concat(d).concat(p.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[f]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(M.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){p(e),r(e.uuid)},selectedTabUUID:null===a||void 0===a?void 0:a.uuid,tabs:v}),b&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(ue.dE,{children:(0,C.jsx)(Bt,Nt(Nt({},u),{},{bookmarkValues:S,isLoadingUpdateDestinationBlockState:D,stream:b,streams:f,updateDestinationBlockState:T}))})}),f.length>=1&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(ue.dE,{children:[(0,C.jsx)(re.Z,{level:4,children:"Streams Summary"}),(0,C.jsx)(Z.Z,{mt:1}),B]})})]})},Ut=t(46732);function Ht(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function zt(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 Wt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zt(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zt(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"}(Lt||(Lt={}));var Gt=45*O.iI,Kt=Gt-4*O.iI;var Vt=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,o=e.streams,l=(0,_e.HK)((null===n||void 0===n?void 0:n.streams)||[],(function(e){return e.stream})),u=(0,s.useMemo)((function(){var e=new Set(o.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 Wt(Wt({},e),{},{isMissingStream:!0})}))}),[l,o]),c=Wt({},l);u.forEach((function(e){var n=e.stream;delete c[n]}));var a=(0,s.useState)(c),d=a[0],p=a[1],f=(0,s.useState)(null),v=f[0],h=f[1],m=(0,s.useState)(!1),g=m[0],j=m[1],k=(0,s.useState)(Lt.ALL),w=k[0],_=k[1],S=(0,s.useRef)(null),I=Ht(d),E=(0,s.useMemo)((function(){var e=o;return e=e.filter((function(e){var n=e.tap_stream_id;return w===Lt.SELECTED?I.includes(n):w!==Lt.NOT_SELECTED||!I.includes(n)})),v?e.filter((function(e){var n=e.tap_stream_id;return null===n||void 0===n?void 0:n.toLowerCase().includes(null===v||void 0===v?void 0:v.toLowerCase())})):e}),[w,v,I,o]),M=(0,s.useMemo)((function(){return o.every((function(e){var n=e.stream;return!!d[n]}))}),[d,o]);return(0,C.jsxs)(Te.Z,{children:[(0,C.jsx)(ue.cv,{rounded:!0,children:(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,C.jsx)(ue.cv,{padding:1.25*O.iI,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(z.Z,{beforeIcon:(0,C.jsx)(G.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return h(e.target.value)},placeholder:"Search",value:v}),(0,C.jsx)(Z.Z,{pr:1,children:(0,C.jsx)(Ut.Z,{items:[{label:function(){return Lt.ALL},onClick:function(){return _(Lt.ALL)},uuid:"all_streams"},{label:function(){return Lt.SELECTED},onClick:function(){return _(Lt.SELECTED)},uuid:"selected"},{label:function(){return Lt.NOT_SELECTED},onClick:function(){return _(Lt.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return j(!1)},onClickOutside:function(){return j(!1)},open:g,parentRef:S,uuid:"SelectStreams/filter",children:(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(G.wn,{}),noBackground:!0,onClick:function(){return j((function(e){return!e}))},ref:S,children:(0,C.jsx)(P.ZP,{children:w})})})})]})}),(0,C.jsx)(ue.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(Gt,"px"),children:(0,C.jsx)(ye.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,C.jsx)(b.Z,{checked:M,onClick:function(){var e=(0,_e.HK)(o||[],(function(e){return e.stream}));p(M?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:E.concat(u).map((function(e){var n=e.isMissingStream,t=e.stream,i=!!d[t];return[(0,C.jsx)(b.Z,{checked:i,disabled:!i&&n,onClick:function(){p((function(n){return Wt(Wt({},n),{},(0,r.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,C.jsxs)(P.ZP,{danger:n,title:t,width:Gt-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,C.jsx)(x.Z,{medium:!0}),(0,C.jsxs)(Z.Z,{p:2,children:[(null===I||void 0===I?void 0:I.length)>50&&(0,C.jsx)(Z.Z,{pb:2,children:(0,C.jsxs)(P.ZP,{danger:!0,maxWidth:Kt,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,C.jsx)("br",{}),"may cause app performance issues."]})}),0===(null===o||void 0===o?void 0:o.length)&&(0,C.jsx)(Z.Z,{pb:2,children:(0,C.jsx)(P.ZP,{bold:!0,maxWidth:Kt,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,C.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,C.jsx)(T.Z,{loading:t,onClick:function(){return i(d)},primary:!0,children:"Confirm ".concat(Ht(d).length," streams")})})]})]})};function qt(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 Yt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?qt(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Qt=function(e){var n=e.api,t=e.block,i=e.blockContent,o=e.onChangeCodeBlock,u=e.pipeline,c=(0,s.useState)(null),a=c[0],p=c[1];(0,s.useEffect)((function(){i&&!a&&p((0,ie.Pz)(null===i||void 0===i?void 0:i.config))}),[a,i]);var f=(0,s.useState)(null),v=f[0],m=f[1],b=(0,s.useState)(),g=b[0],x=b[1],j=(0,d.Db)(W.ZP[n].useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var t,i,o=(0,Q.C5)(n);m(null===e||void 0===e||null===(t=e[o])||void 0===t?void 0:t.success),x(null===e||void 0===e||null===(i=e[o])||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)}})}}),k=(0,l.Z)(j,2),O=k[0],w=k[1].isLoading;return t?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(ue.$W,{children:(0,C.jsx)(oe.Z,{autoHeight:!0,language:h.t6.YAML,onChange:function(e){p(e),o(t.type,t.uuid,(0,ie.Pz)(Yt(Yt({},i),{},{config:(0,ie.Qc)(e)})))},tabSize:2,value:a||void 0,width:"100%"})}),(0,C.jsxs)(Z.Z,{mt:1,children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{onClick:function(){O((0,r.Z)({},(0,Q.C5)(n),{action_type:"test_connection",config:a,pipeline_uuid:u.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,C.jsx)(Z.Z,{ml:1,children:w?(0,C.jsx)(H.Z,{color:"white",small:!0}):(0,C.jsxs)(C.Fragment,{children:[v&&(0,C.jsx)(P.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===v&&(0,C.jsx)(P.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),g&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(P.ZP,{small:!0,warning:!0,children:g})})]})]}):null},Xt=t(85385);function Jt(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 $t(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Jt(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Jt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ei=function(e){var n,t,i,o=e.addNewBlockAtIndex,r=e.blocks,u=e.codeBlocks,c=e.fetchFileTree,a=e.fetchPipeline,p=e.fetchSampleData,f=e.globalVariables,v=e.onChangeCodeBlock,m=e.openSidekickView,b=e.pipeline,g=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,w=e.setOutputBlocks,_=e.setSelectedBlock,S=e.setSelectedOutputBlock,I=e.setSelectedStream,E=(0,s.useState)(!0),M=E[0],D=E[1],B=(0,s.useState)(!0),A=B[0],R=B[1],N=(0,s.useState)(!0),L=N[0],F=N[1],z=(0,s.useState)(""),K=z[0],V=z[1],q=W.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,Y=(0,s.useMemo)((function(){return(null===q||void 0===q?void 0:q.integration_sources)||[]}),[q]),Q=(0,s.useMemo)((function(){return(0,_e.HK)(Y,(function(e){return e.uuid}))}),[Y]),J=W.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,$=(0,s.useMemo)((function(){return(null===J||void 0===J?void 0:J.integration_destinations)||[]}),[J]),ee=(0,s.useMemo)((function(){return(0,_e.HK)($,(function(e){return e.uuid}))}),[$]),ne=(0,s.useMemo)((function(){return(0,_e.sE)(r,(function(e){var n=e.type;return h.tf.DATA_LOADER===n}))}),[r]),te=(0,s.useMemo)((function(){return ne?(0,ie.Qc)(ne.content):{}}),[ne]);(0,s.useEffect)((function(){var e;null!==te&&void 0!==te&&te.source&&V(null===(e=Q[te.source])||void 0===e?void 0:e.docs)}),[Q,te]);var oe=(0,s.useMemo)((function(){return(0,C.jsx)(Qt,{api:"integration_sources",block:ne,blockContent:te,onChangeCodeBlock:v,pipeline:b})}),[ne,te,v,b]),le=(0,s.useMemo)((function(){return(0,_e.sE)(r,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n}))}),[r]),ce=(0,s.useMemo)((function(){return le?(0,ie.Qc)(le.content):{}}),[le]),ae=(0,s.useMemo)((function(){return(0,C.jsx)(Qt,{api:"integration_destinations",block:le,blockContent:ce,onChangeCodeBlock:v,pipeline:b})}),[le,ce,v,b]),se=(0,s.useMemo)((function(){return(0,_e.sE)(r,(function(e){var n=e.type;return h.tf.TRANSFORMER===n}))}),[r]),de=(0,s.useMemo)((function(){var e;return(0,ge.Qr)(null===te||void 0===te?void 0:te.catalog)?null===b||void 0===b||null===(e=b.data_integration)||void 0===e?void 0:e.catalog:null===te||void 0===te?void 0:te.catalog}),[te,null===b||void 0===b||null===(n=b.data_integration)||void 0===n?void 0:n.catalog]),pe=((null===de||void 0===de?void 0:de.streams)||[]).every((function(e){return e.auto_add_new_fields})),ve=((null===de||void 0===de?void 0:de.streams)||[]).every((function(e){return e.disable_column_type_check})),he=(0,Wn.Z)(de);(0,s.useEffect)((function(){!he&&de&&(w((function(){return S(ne),[ne]})),j((function(e){var n;return e||(null===de||void 0===de||null===(n=de.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[de]);var me=(0,s.useState)(),be=me[0],xe=me[1],je=(0,d.Db)(W.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null===n||void 0===n?void 0:n.streams)||[];w((function(){return S(ne),[ne]})),t.length>0&&I(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),m(Xt.cH.DATA),p()}else xe(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Ze=(0,l.Z)(je,2),Oe=Ze[0],we=Ze[1].isLoading,Ce=(0,d.Db)(W.ZP.integration_sources.useUpdate(null===b||void 0===b?void 0:b.uuid),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.integration_source,t=n.selected_streams,i=n.streams,o=((null===de||void 0===de?void 0:de.streams)||[]).filter((function(e){var n=e.tap_stream_id;return t.includes(n)})),r=o.map((function(e){return e.tap_stream_id})),l=i.filter((function(e){var n=e.tap_stream_id;return t.includes(n)&&!r.includes(n)}));l.forEach((function(e){e.metadata.forEach((function(n,t){var i=n.metadata;if(Pe.ks.UNSUPPORTED!==i.inclusion){var o;if(e.replication_method||(e.replication_method=Pe._B.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=Pe.MU.UPDATE),!e.destination_table)e.destination_table=null===e||void 0===e||null===(o=e.tap_stream_id)||void 0===o?void 0:o.replace(/\W+/g,"_");e.metadata[t]=$t($t({},n),{},{metadata:$t($t({},i),{},{selected:!0})})}}))}));var u={streams:o.concat(l)};j(Ve.map((function(e){return e.tap_stream_id})));var s=null===te||void 0===te?void 0:te.catalog;(0,ge.Qr)(s)||v(ne.type,ne.uuid,(0,ie.Pz)($t($t({},te),{},{catalog:{}})));var d={pipeline:$t($t({},b),{},{data_integration:$t($t({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:u})})};g(d).then((function(){a(),c()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Se=(0,l.Z)(Ce,2),Ie=Se[0],Ee=Se[1].isLoading,Te=(0,s.useState)(null),Me=Te[0],De=Te[1],Be=(0,d.Db)(W.ZP.integration_source_streams.useUpdate(null===b||void 0===b?void 0:b.uuid),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){De(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Ae=(0,l.Z)(Be,2),Re=Ae[0],Ne=Ae[1].isLoading,Le=(0,s.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}}(de,e),i=t.stream,o=t.streams,r=$t($t({},de),{},{streams:o.concat(n(i))}),l=null===te||void 0===te?void 0:te.catalog;(0,ge.Qr)(l)||v(ne.type,ne.uuid,(0,ie.Pz)($t($t({},te),{},{catalog:{}})));var u={pipeline:$t($t({},b),{},{data_integration:$t($t({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:r})})};g(u).then((function(){return a()}))}),[de,ne,te,a,v,b,g]),Fe=(0,s.useCallback)((function(e){if(null!==de&&void 0!==de&&de.streams){var n=$t($t({},de),{},{streams:de.streams.map((function(n){return e(n)}))}),t=null===te||void 0===te?void 0:te.catalog;(0,ge.Qr)(t)||v(ne.type,ne.uuid,(0,ie.Pz)($t($t({},te),{},{catalog:{}})));var i={pipeline:$t($t({},b),{},{data_integration:$t($t({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:n})})};g(i).then((function(){return a()}))}}),[de,ne,te,a,v,b,g]),Ue=(0,s.useCallback)((function(e,n,t){Le(e,(function(e){return e.schema.properties[n]=t,e}))}),[Le]),He=(0,s.useCallback)((function(e,n,t){Le(e,(function(e){var i=e.metadata;return n.forEach((function(n){var o=i.findIndex((function(e){var t=e.breadcrumb,i=void 0===t?[]:t;return 2===i.length&&"properties"===i[0]&&i[1]===n}));if(o>=0){var r=i[o].metadata;e.metadata[o].metadata=$t($t({},r),t)}})),e}))}),[Le]),ze=(0,d.Db)(W.ZP.blocks.pipelines.useUpdate(null===b||void 0===b?void 0:b.uuid,null===le||void 0===le?void 0:le.uuid),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){null===a||void 0===a||a()},onErrorCallback:function(e,n){return null===x||void 0===x?void 0:x({errors:n,response:e})}})}}),We=(0,l.Z)(ze,1)[0],Ge=(0,s.useMemo)((function(){var e=[];return null===f||void 0===f||f.forEach((function(n){var t=n.variables;return null===t||void 0===t?void 0:t.forEach((function(n){var t=n.uuid,i=n.value,o="\"{{ variables('".concat(t,"') }}\"");if(!t.startsWith("output"))return e.push([(0,C.jsx)(P.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,C.jsx)(P.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,C.jsx)(P.ZP,{monospace:!0,children:o},"variable-uuid-".concat(t,"-{value}-code")),(0,C.jsx)(It.Z,{copiedText:o,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,C.jsx)(ye.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[f]),Ke=(0,s.useCallback)((function(e){return(0,C.jsxs)(Z.Z,{mt:2,children:[(0,C.jsxs)(P.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,C.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,C.jsx)("br",{}),"For more information, check out the ",(0,C.jsx)(k.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,C.jsx)(Z.Z,{mt:1,children:Ge})]})}),[Ge]),Ve=(0,s.useMemo)((function(){return(null===Me||void 0===Me?void 0:Me.streams)||[]}),[Me]),qe=(0,Vn.dd)((function(){return(0,C.jsx)(Vt,{catalog:de,isLoading:Ee,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)Ie({integration_source:{streams:n}}),Xe();else{var t=null===te||void 0===te?void 0:te.catalog;(0,ge.Qr)(t)||v(ne.type,ne.uuid,(0,ie.Pz)($t($t({},te),{},{catalog:{}}))),g({pipeline:$t($t({},b),{},{data_integration:$t($t({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:null})})}).then((function(){return a()})),Xe()}},streams:Ve})}),{},[de,ne,te,a,Ee,v,g,Ve],{background:!0,uuid:"select_streams"}),Ye=(0,l.Z)(qe,2),Qe=Ye[0],Xe=Ye[1];return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{iconOnly:!0,onClick:function(){return R((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[A&&(0,C.jsx)(G.Kh,{size:1.5*O.iI}),!A&&(0,C.jsx)(G._M,{size:1.5*O.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(re.Z,{children:"Source"}),!A&&(0,C.jsxs)(re.Z,{default:!0,inline:!0,children:["\xa0",null===(t=Q[null===te||void 0===te?void 0:te.source])||void 0===t?void 0:t.name]})]})]})}),A&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(ue.dE,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null===Y||void 0===Y?void 0:Y.length)>0?(0,C.jsxs)(U.Z,{onChange:function(e){var n,t,i,r=e.target.value;if(r){V(null===(n=Q[r])||void 0===n?void 0:n.docs);var l=null===(t=Q[r])||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})),ne?v(ne.type,ne.uuid,(0,ie.Pz)($t($t({},te),{},{catalog:{},config:l,source:r}))):o({content:(0,ie.Pz)({config:l,source:r}),language:h.t6.YAML,type:h.tf.DATA_LOADER},0,_),De(null),g().then((function(){a()}))}},primary:!0,value:null===te||void 0===te?void 0:te.source,children:[(0,C.jsx)("option",{value:""}),Y.map((function(e){var n=e.name,t=e.uuid;return(0,C.jsx)("option",{value:t,children:n},t)}))]}):(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(H.Z,{inverted:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(re.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),ne&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===te||void 0===te?void 0:te.source)&&K&&(0,C.jsxs)(Z.Z,{mb:2,children:[(0,C.jsx)(_t.Z,{children:(0,C.jsx)(St.Z,{title:"Documentation: ".concat(te.source),children:(0,C.jsx)(ue.zG,{children:(0,C.jsx)(fe.Z,{children:K.replace(/\<br \/\>/g,"\n\n")})})})}),Ke("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),oe]}),(0,C.jsxs)("div",{children:[(0,C.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,C.jsx)(T.Z,{loading:Ne,onClick:function(){g().then((function(){Re().then((function(){return Qe()})),a()}))},primary:!0,small:!0,children:"View and select streams"})]}),be&&(0,C.jsx)(P.ZP,{warning:!0,children:be})]})]}),Ee&&(0,C.jsx)(Z.Z,{p:2,children:(0,C.jsx)(H.Z,{})}),!Ee&&(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsx)(Ft,{catalog:de,destination:null===ce||void 0===ce?void 0:ce.destination,isLoadingLoadSampleData:we,loadSampleData:function(e){return Oe({integration_source:{action_type:"sample_data",pipeline_uuid:null===b||void 0===b?void 0:b.uuid,streams:[e]}})},pipeline:b,setErrors:x,setSelectedStream:I,source:null===te||void 0===te?void 0:te.source,updateAllStreams:Fe,updateMetadataForColumns:He,updateSchemaProperty:Ue,updateStream:Le})})]}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{disabled:!ne,iconOnly:!0,onClick:function(){return F((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[L&&ne&&(0,C.jsx)(G.Kh,{size:1.5*O.iI}),(!L||!ne)&&(0,C.jsx)(G._M,{disabled:!ne,size:1.5*O.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)(re.Z,{children:"Transformers"})})]})}),L&&ne&&(0,C.jsx)(Z.Z,{mb:5,children:(0,C.jsxs)(ue.dE,{children:[u.length>0&&(0,C.jsx)(Z.Z,{mb:1,children:u.map((function(e,n){return(0,C.jsx)(Z.Z,{mb:1,children:e},n)}))}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(nt.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return ne&&i.push(ne.uuid),o($t($t({},e),{},{configuration:t,content:n,upstream_blocks:i}),r.length-1,(function(e){le&&(We({block:$t($t({},le),{},{upstream_blocks:[e.uuid]})}),_(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!se,hideTransformerDataSources:!0,pipeline:b})})]})}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{disabled:!ne,iconOnly:!0,onClick:function(){return D((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[M&&ne&&(0,C.jsx)(G.Kh,{size:1.5*O.iI}),(!M||!ne)&&(0,C.jsx)(G._M,{disabled:!ne,size:1.5*O.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(re.Z,{children:"Destination"}),!M&&(0,C.jsxs)(re.Z,{default:!0,inline:!0,children:["\xa0",null===(i=ee[null===ce||void 0===ce?void 0:ce.destination])||void 0===i?void 0:i.name]})]})]})}),M&&ne&&(0,C.jsxs)(ue.dE,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null===$||void 0===$?void 0:$.length)>0?(0,C.jsxs)(U.Z,{onChange:function(e){var n=e.target.value;if(n){if(le)v(le.type,le.uuid,(0,ie.Pz)($t($t({},ce),{},{destination:n})));else{var t,i,l=null===(t=ee[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===r||void 0===r?void 0:r.length)>=2){var c=r.find((function(e){var n=e.uuid;return(null===ne||void 0===ne?void 0:ne.uuid)!==n}));c&&u.push(c.uuid)}else ne&&u.push(ne.uuid);o({content:(0,ie.Pz)({config:l,destination:n}),language:h.t6.YAML,type:h.tf.DATA_EXPORTER,upstream_blocks:u},1,_)}g().then((function(){a()}))}},primary:!0,value:null===ce||void 0===ce?void 0:ce.destination,children:[(0,C.jsx)("option",{value:""}),$.map((function(e){var n=e.name,t=e.uuid;return(0,C.jsx)("option",{value:t,children:n},t)}))]}):(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(H.Z,{inverted:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(re.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),le&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(re.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===ce||void 0===ce?void 0:ce.destination)&&(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)(Z.Z,{mb:2,children:[(0,C.jsxs)(P.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,C.jsxs)(k.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(ce.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[ce.destination," documentation"]}),".",(0,C.jsx)("br",{}),(0,C.jsx)("br",{}),"If your configuration contains a key named ",(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,C.jsx)("br",{}),"The table that\u2019s created in this destination will have a name corresponding to the stream\u2019s unique name (by default) or the value you entered under the input field labeled ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),Ke("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),ae,(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,C.jsx)(P.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,C.jsx)(ke.Z,{checked:!!pe,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Fe((function(e){return $t($t({},e),{},{auto_add_new_fields:!pe})}))}})]})}),(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(P.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,C.jsxs)(P.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,C.jsx)("br",{}),"If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped.",(0,C.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,C.jsx)(ke.Z,{checked:!!ve,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Fe((function(e){return $t($t({},e),{},{disable_column_type_check:!ve})}))}})]})})]})]})]})},ni=t(82359),ti=t(35058),ii=t(38399),oi=t(42041);function ri(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?ri(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ri(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ui=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.allBlocks,u=e.allowCodeBlockShortcuts,c=e.anyInputFocused,a=e.autocompleteItems,p=e.blockInteractionsMapping,f=e.blockRefs,v=e.blocks,m=void 0===v?[]:v,b=e.blocksThatNeedToRefresh,g=e.dataProviders,x=e.deleteBlock,j=e.disableShortcuts,y=e.fetchFileTree,w=e.fetchPipeline,_=e.fetchSampleData,S=e.files,I=e.globalDataProducts,E=e.globalVariables,T=e.hiddenBlocks,M=e.interactionsMapping,A=e.interruptKernel,N=e.mainContainerRef,L=e.mainContainerWidth,U=e.messages,H=e.onChangeCallbackBlock,z=e.onChangeCodeBlock,G=e.openSidekickView,K=e.pipeline,V=e.pipelineContentTouched,q=e.project,Y=e.restartKernel,J=e.runBlock,$=e.runningBlocks,ee=void 0===$?[]:$,ne=e.savePipelineContent,te=e.selectedBlock,ie=e.setAnyInputFocused,oe=e.setDisableShortcuts,re=e.setEditingBlock,le=e.setErrors,ue=e.setIntegrationStreams,ce=e.setHiddenBlocks,ae=e.setOutputBlocks,se=e.setPipelineContentTouched,de=e.setSelectedBlock,pe=e.setSelectedOutputBlock,fe=e.setSelectedStream,ve=e.setTextareaFocused,he=e.showBrowseTemplates,me=e.showConfigureProjectModal,be=e.showDataIntegrationModal,xe=e.showGlobalDataProducts,je=e.showUpdateBlockModal,ye=e.textareaFocused,ke=e.widgets,Ze=(0,s.useRef)(null),Pe=(0,s.useRef)(null),Oe=(0,s.useState)(!1),we=Oe[0],Ce=Oe[1],Se=(0,s.useState)(!1),Ie=Se[0],Ee=Se[1],Te=(0,s.useState)(!1),Me=Te[0],De=Te[1],Be=(0,s.useState)(!0),Ae=Be[0],Re=Be[1],Ne=(0,s.useState)(null),Le=Ne[0],Fe=Ne[1],Ue=(0,s.useState)(null),He=Ue[0],ze=Ue[1],We=(0,s.useState)(!1),Ge=We[0],Ke=We[1],Ve=(0,s.useState)(""),qe=Ve[0],Ye=Ve[1],Qe=(0,s.useMemo)((function(){return ee.reduce((function(e,n,t){return li(li({},e),{},(0,r.Z)({},n.uuid,li(li({},n),{},{priority:t})))}),{})}),[ee]),Xe=(0,Wn.Z)(te),Je=(0,s.useMemo)((function(){return m.length}),[m]),$e=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===K||void 0===K?void 0:K.type)}),[K]),en=(0,s.useMemo)((function(){return F.qL.STREAMING===(null===K||void 0===K?void 0:K.type)}),[K]),nn=(0,s.useMemo)((function(){var e;return F.qL.PYTHON===(null===K||void 0===K?void 0:K.type)&&(null===q||void 0===q||null===(e=q.features)||void 0===e?void 0:e[ni.d.ADD_NEW_BLOCK_V2])}),[K,q]),tn=W.ZP.block_templates.list({show_all:!!nn},{revalidateOnFocus:!1}).data,on=(0,s.useMemo)((function(){return(null===tn||void 0===tn?void 0:tn.block_templates)||[]}),[tn]),rn="PipelineDetail/index",ln=(0,En.y)(),un=ln.disableGlobalKeyboardShortcuts,cn=ln.registerOnKeyDown,an=ln.unregisterOnKeyDown;(0,s.useEffect)((function(){return function(){an(rn)}}),[an,rn]),cn(rn,(function(e,n,t){if(V&&(0,oi.y)([_n.zX,_n.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(!j&&!un)if((0,oi.y)([_n.zX,_n.Um],n)||(0,oi.y)([_n.PQ,_n.Um],n))e.preventDefault(),ne();else if(ye)n[_n.vP]?ve(!1):V||_n.Z1.find((function(e){return n[e]}))||se(!0);else if(!$e){var i;if(nn&&((0,oi.y)([_n.zX,_n.A1],n)||(0,oi.y)([_n.PQ,_n.A1],n)))e.preventDefault(),Ee(!0),null===Pe||void 0===Pe||null===(i=Pe.current)||void 0===i||i.focus();else if(nn&&Ie&&(0,oi.y)([_n.vP],n)){var o;e.preventDefault(),Ee(!1),null===Pe||void 0===Pe||null===(o=Pe.current)||void 0===o||o.blur()}else if(te){var r=m.findIndex((function(e){var n=e.uuid;return te.uuid===n}));if(n[_n.vP])de(null);else if(t[0]===_n.xD&&t[1]===_n.xD)A();else if(t[0]===_n.l1&&t[1]===_n.l1&&-1!==r)x(te).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){r===m.length-1?de(m[r-1]):m.length>=0?de(m[r+1]):de(null)}),100)}));else if(n[_n.Bu]&&r>=1){var l=m[r-1];if(l){var u,a;de(l);var s="".concat(l.type,"s/").concat(l.uuid,".py");null===(u=f.current[s])||void 0===u||null===(a=u.current)||void 0===a||a.scrollIntoView()}}else if(n[_n.kD]&&r<=Je-2){var d=m[r+1];if(d){var p,v;de(d);var h="".concat(d.type,"s/").concat(d.uuid,".py");null===(p=f.current[h])||void 0===p||null===(v=p.current)||void 0===v||v.scrollIntoView()}}else(0,oi.y)([_n.Uq],n)&&ve(!0)}else Xe&&n[_n.Uq]&&de(Xe);c||t[0]!==_n.OC||t[1]!==_n.OC||Y()}}),[n,c,f.current,m,Ie,A,$e,Je,V,Y,ne,Pe,te,Xe,se,de,ve,ye,nn]),(0,s.useEffect)((function(){var e=setInterval((function(){V&&ne()}),1e4);return function(){clearInterval(e)}}),[V,ne]),(0,s.useEffect)((function(){setTimeout((function(){return De(!0)}),2*Gn.zn)}),[K]);var sn=(0,d.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return W.ZP.blocks.pipelines.useUpdate(null===K||void 0===K?void 0:K.uuid,null===n||void 0===n?void 0:n.uuid)({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){w()},onErrorCallback:function(e,n){return null===le||void 0===le?void 0:le({errors:n,response:e})}})}}),dn=(0,l.Z)(sn,1)[0],pn=(0,s.useCallback)((function(e){Ce(!0),ze(e),oe(!0)}),[Ce,oe,ze]),fn=(0,s.useCallback)((function(){Ce(!1),Ke(!1),Ye(""),oe(!1)}),[oe]),vn=(0,s.useCallback)((function(e,n){var t,i;m.forEach((function(o,r){var l=o.uuid;t>=0&&i>=0||(l===e.uuid?t=r:l===n.uuid&&(i=r))}));var o=(0,_e.oM)(m,i);return o=(0,_e.Hk)(n,Math.max(t,0),o),ne({pipeline:{blocks:o,uuid:null===K||void 0===K?void 0:K.uuid}})}),[m,K,ne]),hn=(0,s.useMemo)((function(){var e=[];return m.filter((function(e){var n=e.type;return!$e||h.tf.TRANSFORMER===n})).forEach((function(l,c){var d,v,k=l.type,Z=l.uuid,P=(null===te||void 0===te?void 0:te.uuid)===Z,O=Qe[Z],_=O?0===O.priority?Yn.uF.BUSY:Yn.uF.QUEUED:Yn.uF.IDLE,S="".concat(k,"s/").concat(Z,".py");f.current[S]=(0,s.createRef)();var E=k===h.tf.MARKDOWN,D=k===h.tf.TRANSFORMER,B=!(null===T||void 0===T||!T[Z]),F=c===Je-1||$e,W=f.current[S],V=Z,Y=null===b||void 0===b||null===(d=b[k])||void 0===d?void 0:d[Z];Y&&(V="".concat(V,":").concat(Y)),v=B?(0,C.jsx)(Ct,{block:l,blocks:m,onClick:function(){return ce((function(e){return li(li({},e),{},(0,r.Z)({},Z,!B))}))},onDrop:vn,ref:W},V):(0,C.jsx)(R.Z,{addNewBlock:function(e,t){ve(!0);return n(e,c+1,(function(e){if(1===(null===t||void 0===t?void 0:t.length)){var n,i,r=null===(n=t[0])||void 0===n?void 0:n.uuid,l=(null===(i=t[0])||void 0===i?void 0:i.upstream_blocks)||[];dn({block:{uuid:r},upstreamBlocks:[e.uuid].concat((0,o.Z)(l))})}null===de||void 0===de||de(e)}))},addNewBlockMenuOpenIdx:Le,addWidget:t,allBlocks:i,allowCodeBlockShortcuts:u,autocompleteItems:a,block:l,blockInteractions:null===p||void 0===p?void 0:p[Z],blockIdx:c,blockRefs:f,blockTemplates:on,blocks:m,containerRef:Ze,dataProviders:g,defaultValue:l.content,deleteBlock:function(e){x(e),ie(!1)},disableShortcuts:j,executionState:_,fetchFileTree:y,fetchPipeline:w,globalDataProducts:I,hideRunButton:en||E||$e&&D,interactionsMapping:M,interruptKernel:A,mainContainerRef:N,mainContainerWidth:L,messages:U[Z],noDivider:F,onCallbackChange:function(e){return H(k,Z,e)},onChange:function(e){return z(k,Z,e)},onClickAddSingleDBTModel:pn,onDrop:vn,openSidekickView:G,pipeline:K,project:q,ref:W,runBlock:J,runningBlocks:ee,savePipelineContent:ne,selected:P,setAddNewBlockMenuOpenIdx:Fe,setAnyInputFocused:ie,setCreatingNewDBTModel:Ke,setEditingBlock:re,setErrors:le,setOutputBlocks:ae,setSelected:function(e){return de(!0===e?l:null)},setSelectedBlock:de,setSelectedOutputBlock:pe,setTextareaFocused:ve,showBrowseTemplates:he,showConfigureProjectModal:me,showDataIntegrationModal:be,showGlobalDataProducts:xe,showUpdateBlockModal:je,textareaFocused:P&&ye,widgets:ke},V),e.push(v)})),e}),[n,Le,t,i,u,a,p,f,on,b,m,Ze,g,x,j,y,w,I,T,M,A,$e,en,N,L,U,Je,H,z,pn,vn,G,K,q,J,ee,Qe,ne,te,Fe,ie,re,le,ce,ae,de,pe,ve,he,me,be,xe,je,ye,dn,ke]),mn=(0,s.useMemo)((function(){return(0,C.jsx)(ei,{addNewBlockAtIndex:n,blocks:m,codeBlocks:hn,fetchFileTree:y,fetchPipeline:w,fetchSampleData:_,globalVariables:E,onChangeCodeBlock:z,openSidekickView:G,pipeline:K,savePipelineContent:ne,setErrors:le,setIntegrationStreams:ue,setOutputBlocks:ae,setSelectedBlock:de,setSelectedOutputBlock:pe,setSelectedStream:fe})}),[n,m,hn,y,w,_,E,z,G,K,ne,le,ue,ae,de,pe,fe]),bn=(0,s.useMemo)((function(){return K&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(nt.Z,{addNewBlock:function(e){var t=m[m.length-1],i=null,o=e.configuration||{},r=t?(0,Zt.eY)(t,e):[];t&&([h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(t.type)&&h.tf.SCRATCHPAD===e.type&&(i="from mage_ai.data_preparation.variable_manager import get_variable\n\n\n df = get_variable('".concat(K.uuid,"', '").concat(t.uuid,"', 'output_0')\n ")),h.t6.SQL===t.language&&(o=li(li({},(0,ge.GL)(t.configuration,[ti.cH,ti.Sv,ti.sc,ti.BD,ti.nq])),o))),h.t6.SQL===e.language&&(i=(0,ii.SF)(i)),i=(0,ii.X7)(e,i),n(li(li({},e),{},{configuration:o,content:i,upstream_blocks:r}),Je,de),ve(!0)},blockTemplates:on,focusedAddNewBlockSearch:Ie,hideCustom:$e||en,hideDataExporter:$e,hideDataLoader:$e,hideDbt:$e||en,hideScratchpad:$e,hideSensor:$e,onClickAddSingleDBTModel:pn,pipeline:K,project:q,searchTextInputRef:Pe,setCreatingNewDBTModel:Ke,setFocusedAddNewBlockSearch:Ee,showBrowseTemplates:he,showConfigureProjectModal:me,showGlobalDataProducts:xe}),!nn&&!$e&&!en&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,C.jsx)("br",{}),"Turn on the feature named ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:ni.d.ADD_NEW_BLOCK_V2})," in your ",(0,C.jsx)($n(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,C.jsx)(k.Z,{muted:!0,underline:!0,children:(0,C.jsx)(P.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[n,on,m,Ie,$e,en,Je,pn,K,q,Pe,Ee,de,ve,he,me,xe,nn]);return(0,C.jsxs)(D.W,{backend:B.PD,children:[(0,C.jsx)(Gn.lO,{ref:Ze,children:Ae&&(0,C.jsx)(et.Z,{classNames:"pipeline-detail",in:Me,onEntered:function(){return setTimeout((function(){return Re(!1)}),Gn.zn)},timeout:1,children:(0,C.jsx)(Gn.fm,{})})}),(0,C.jsxs)(Z.Z,{mt:1,px:O.cd,children:[$e&&mn,!$e&&(0,C.jsxs)(C.Fragment,{children:[hn,(0,C.jsx)(Z.Z,{mt:O.cd,children:bn})]}),we&&(0,C.jsx)(wn.Z,{onClickOutside:fn,open:!0,children:(0,C.jsx)(gt,{blocks:m,creatingNewDBTModel:Ge,dbtModelName:qe,files:S,onClose:fn,onOpenFile:function(e){var t=e;if(Ge){var i=(0,Q.RA)(qe||(0,Q.Y6)()),o=".".concat(Nn.Lu.SQL);i.endsWith(o)&&(i=i.slice(0,-4)),t="".concat(e).concat(Xn.sep).concat(i,".").concat(Nn.Lu.SQL)}var r={configuration:{file_path:t,limit:R.z},language:h.t6.SQL,name:(0,Q.wE)(t),type:h.tf.DBT};Ge&&(r.content="--Docs: https://docs.mage.ai/dbt/sources\n");var l="undefined"===typeof He||null===He,u=m[l?m.length-1:He],c=u?(0,Zt.eY)(u,r):[];n(li(li({},r),{},{upstream_blocks:c}),l?Je:He+1,de),fn(),ve(!0)},setDbtModelName:Ye})})]})]})},ci=t(82555),ai=t(59696),si=t(2842),di=t(92709);function pi(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 fi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pi(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var vi=function(e){var n=e.after,t=e.afterFooter,i=e.afterHeader,o=e.afterHeightOffset,r=e.afterHidden,u=e.afterInnerHeightMinus,c=e.afterNavigationItems,a=e.afterOverflow,d=e.afterSubheader,p=e.before,f=e.beforeHeader,v=e.beforeHeightOffset,h=e.beforeNavigationItems,m=e.children,b=e.errors,g=e.headerOffset,x=e.mainContainerHeader,j=e.mainContainerRef,y=e.page,k=e.pipeline,Z=e.setAfterHidden,P=e.setAfterWidthForChildren,O=e.setErrors,w=e.setMainContainerWidth,_=(0,xn.i)().width,S=(0,s.useState)((0,gn.U2)(gn.L8,si.Zt)),I=S[0],E=S[1],T=(0,s.useState)((0,gn.U2)(gn.J3,si.ve)),M=T[0],D=T[1],B=(0,s.useState)(!!(0,gn.U2)(gn.Uu)),A=B[0],R=B[1],N=(0,s.useState)(!1),L=N[0],F=N[1],U=(0,s.useState)(!1),H=U[0],z=U[1],G=r,K=Z;if(!K){var V=(0,s.useState)(!!(0,gn.U2)(gn.zg)),q=(0,l.Z)(V,2);G=q[0],K=q[1]}(0,s.useEffect)((function(){null===j||void 0===j||!j.current||L||H||null===w||void 0===w||w(j.current.getBoundingClientRect().width)}),[L,H,G,I,A,M,j,w,_]),(0,s.useEffect)((function(){L||(null===P||void 0===P||P(I),(0,gn.t8)(gn.L8,I))}),[L,I,P]),(0,s.useEffect)((function(){H||(0,gn.t8)(gn.J3,M)}),[H,M]);var Y=W.ZP.projects.list({},{revalidateOnFocus:!1}).data,X=null===Y||void 0===Y?void 0:Y.projects,J=(0,s.useMemo)((function(){var e,n=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return k&&(n.push.apply(n,[{bold:di.b7!==y,label:function(){return null===k||void 0===k?void 0:k.uuid},linkProps:{as:"/pipelines/".concat(null===k||void 0===k?void 0:k.uuid),href:"/pipelines/[pipeline]"}}]),di.b7===y&&n.push.apply(n,[{bold:!0,label:function(){return(0,Q.kC)(y)}}])),(0,C.jsx)(ai.Z,{breadcrumbs:n,project:null===X||void 0===X?void 0:X[0],version:null===X||void 0===X||null===(e=X[0])||void 0===e?void 0:e.version})}),[y,k,X]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Fn.Z,{title:null===k||void 0===k?void 0:k.name}),(0,C.jsx)(bn.Z,{after:n,afterFooter:t,afterHeader:i,afterHeightOffset:o,afterHidden:G,afterInnerHeightMinus:u,afterMousedownActive:L,afterNavigationItems:c,afterOverflow:a,afterSubheader:d,afterWidth:I,before:p,beforeHeader:f,beforeHeightOffset:v,beforeHidden:A,beforeMousedownActive:H,beforeNavigationItems:h,beforeWidth:M,header:J,headerOffset:g,mainContainerHeader:x,mainContainerRef:j,navigationShowMore:!0,setAfterHidden:K,setAfterMousedownActive:F,setAfterWidth:E,setBeforeHidden:R,setBeforeMousedownActive:z,setBeforeWidth:D,children:m}),b&&(0,C.jsx)(wn.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return O(null)},children:(0,C.jsx)(ci.Z,fi(fi({},b),{},{onClose:function(){return O(null)}}))})]})},hi=t(55729),mi=t(93808),bi=t(8666),gi=t(72226),xi=t(29644),ji=t(46209),yi=t(21764),ki=t(46568),Zi=t(82682),Pi=t(17679),Oi=t(61896),wi=(O.iI,Pi.O$,O.iI,Oi.dN,m.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],si.Wi,He.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),m.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*O.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),m.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),Ci=m.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*O.iI,"px;\n ")})),_i=t(31748),Si=t(79633);var Ii=function(e){var n=e.copyText,t=e.deleteVariable,i=e.disableKeyEdit,o=e.editStateInit,u=void 0!==o&&o,c=e.fetchVariables,a=e.focusKey,p=e.hideEdit,f=e.obfuscate,v=e.onEnterCallback,h=e.onEscapeCallback,m=e.pipelineUUID,b=e.updateVariable,g=e.variable||{},x=g.uuid,y=g.value,k=(0,s.useRef)(null),Z=(0,s.useRef)(null),w=(0,s.useState)(!1),_=w[0],S=w[1],I=(0,s.useState)(x),E=I[0],T=I[1],M=(0,s.useState)(y),D=M[0],B=M[1],A=(0,s.useState)(u),R=A[0],L=A[1],F=(0,d.Db)(W.ZP.variables.pipelines.useUpdate(m,x),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){L(!1),c()}})}}),U=(0,l.Z)(F,1)[0],H=(0,s.useCallback)((function(e){if("Enter"===e.key){var n=D;try{n=JSON.parse(D)}catch(t){}b?E&&D&&(null===b||void 0===b||b((0,r.Z)({},E,D)),L(!1)):U({variable:{name:E,value:n}}),null===v||void 0===v||v()}else"Escape"===e.key&&(L(!1),null===h||void 0===h||h())}),[v,h,b,U,E,D]);(0,s.useEffect)((function(){var e,n;R&&(a?null===k||void 0===k||null===(e=k.current)||void 0===e||e.focus():null===Z||void 0===Z||null===(n=Z.current)||void 0===n||n.focus())}),[R,a]);var K=n||"kwargs['".concat(x,"']");return(0,C.jsx)("div",{onMouseEnter:function(){return S(!0)},onMouseLeave:function(){return S(!1)},children:(0,C.jsxs)(Zi.Z,{children:[(0,C.jsx)(ki.Z,{md:1,hiddenSmDown:!0,children:(0,C.jsx)(Ci,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:_i.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(K),yi.Am.success("Successfully copied to clipboard.",{position:yi.Am.POSITION.BOTTOM_RIGHT,toastId:x})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(x),withIcon:!0,children:(0,C.jsx)(G.CK,{size:2.5*O.iI})})})}),(0,C.jsx)(ki.Z,{md:4,children:R&&!i?(0,C.jsx)(Ci,{children:(0,C.jsx)(z.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){T(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"variable",ref:k,small:!0,value:E})}):(0,C.jsx)(Ci,{children:(0,C.jsx)(P.ZP,{color:Si.Or,monospace:!0,small:!0,textOverflow:!0,children:x})})}),(0,C.jsx)(ki.Z,{md:7,children:R?(0,C.jsx)(Ci,{children:(0,C.jsx)(z.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){B(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"enter value",ref:Z,small:!0,value:D})}):(0,C.jsxs)(Ci,{children:[f?(0,C.jsx)(P.ZP,{monospace:!0,small:!0,children:"********"}):(0,C.jsx)(P.ZP,{monospace:!0,small:!0,children:y}),(0,C.jsxs)(j.Z,{children:[!p&&_&&(0,C.jsx)(N.ZP,{backgroundColor:_i.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){L(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(x),withIcon:!0,children:(0,C.jsx)(G.I8,{size:2.5*O.iI})}),t&&_&&(0,C.jsx)(N.ZP,{backgroundColor:_i.qJ,borderless:!0,inline:!0,muted:!0,onClick:t,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(x),withIcon:!0,children:(0,C.jsx)(G.rF,{size:2.5*O.iI})})]})]})})]})})},Ei=m.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1cm3orh-0"})(["border-radius:","px;padding:","px ","px;",""],we.n_,1.5*O.iI,O.l4,(function(e){return"\n border: ".concat(we.YF,"px ").concat(we.M8," ").concat((e.theme||Oe.Z).interactive.defaultBorder,";\n ")})),Ti=t(68781);function Mi(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 Di(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Mi(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Mi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Bi={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"},Ai={bold:!0,default:!0,inline:!0,monospace:!0,small:!0},Ri=(0,Zt.YW)();var Ni=function(e){var n,t,i,o=e.block,r=e.contentByBlockUUID,u=e.fetchFileTree,c=e.fetchPipeline,a=e.globalDataProducts,p=e.pipeline,f=e.setSelectedBlock,v=e.showDataIntegrationModal,m=e.showUpdateBlockModal,x=(0,s.useRef)(null),w=(0,s.useRef)(null),_=(0,s.useMemo)((function(){return null===p||void 0===p?void 0:p.uuid}),[p]),S=(0,s.useMemo)((function(){return(null===p||void 0===p?void 0:p.retry_config)||{}}),[p]),I=(0,s.useMemo)((function(){return!(null!==p&&void 0!==p&&p.run_pipeline_in_one_process)&&[F.qL.PYSPARK,F.qL.PYTHON].includes(null===p||void 0===p?void 0:p.type)}),[p]),E=o.color,M=o.configuration,D=o.language,B=o.name,A=o.type,R=o.uuid,L=(0,J.VI)(null,{},[],{uuid:"BlockSettings/index"}),K=(0,l.Z)(L,1)[0],V=(0,s.useMemo)((function(){return(0,_e.HK)(a||[],(function(e){return e.uuid}))}),[a]),Y=(0,s.useMemo)((function(){var e,n=null===M||void 0===M||null===(e=M.global_data_product)||void 0===e?void 0:e.uuid;if(n&&V)return null===V||void 0===V?void 0:V[n]}),[M,V]),$=W.ZP.pipelines.detail(bi.b.PIPELINE===(null===Y||void 0===Y?void 0:Y.object_type)&&(null===Y||void 0===Y?void 0:Y.object_uuid)).data,ee=(0,s.useMemo)((function(){return null===$||void 0===$?void 0:$.pipeline}),[$]),ne=(0,s.useState)(null),te=ne[0],ie=ne[1],oe=(0,s.useState)(!1),le=oe[0],se=oe[1],de=(0,s.useState)(!1),pe=de[0],fe=de[1],he=(0,s.useState)(!1),me=he[0],be=he[1],xe=(0,Wn.Z)(o);(0,s.useEffect)((function(){(null===xe||void 0===xe?void 0:xe.uuid)!==(null===o||void 0===o?void 0:o.uuid)&&ie(o)}),[o,xe]);var je=(0,s.useMemo)((function(){return(null===te||void 0===te?void 0:te.retry_config)||{}}),[te]),ke=(0,s.useCallback)((function(e){se(!0),ie(e)}),[]),Ze=(0,s.useMemo)((function(){return(0,ge.gR)((null===te||void 0===te?void 0:te.configuration)||M,["data_integration","file_path","global_data_product"])}),[null===te||void 0===te?void 0:te.configuration,M]),Pe=(0,s.useCallback)((function(e){return ke((function(n){return Di(Di({},n),{},{configuration:Di(Di({},null===te||void 0===te?void 0:te.configuration),e)})}))}),[null===te||void 0===te?void 0:te.configuration,ke]),Oe=(0,s.useMemo)((function(){return null===te||void 0===te?void 0:te.executor_type}),[te]);(0,s.useEffect)((function(){pe||!Oe||Ti.R.find((function(e){return e===Oe}))||fe(!0)}),[pe,Oe]);var we=W.ZP.blocks.pipelines.detail(_,encodeURIComponent(R),{_format:"with_settings",block_type:A}).data,Ce=(0,s.useMemo)((function(){return(null===we||void 0===we?void 0:we.block)||{}}),[we]),Se=(0,s.useMemo)((function(){return null!==Ce&&void 0!==Ce&&Ce.pipelines?Object.values(null===Ce||void 0===Ce?void 0:Ce.pipelines):[]}),[Ce]),Ie=(null===Se||void 0===Se?void 0:Se.length)||1,Ee=(0,d.Db)(W.ZP.blocks.pipelines.useUpdate(_,encodeURIComponent(R)),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){se(!1),u(),c(),null!==e&&void 0!==e&&e.block&&f(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return K({errors:n,response:e})}})}}),Te=(0,l.Z)(Ee,2),Me=Te[0],De=Te[1].isLoading,Be=(0,s.useCallback)((function(e){return Me({block:e})}),[Me]),Ae=(0,s.useMemo)((function(){return Ie>=1&&(0,C.jsx)(ue.cl,{children:(0,C.jsx)(ye.Z,{columnFlex:[null,1],columns:[{uuid:"Name"},{uuid:"Description"}],rows:Se.map((function(e){var n=e.pipeline,t=n.description,i=n.name,o=n.uuid;return[(null===p||void 0===p?void 0:p.uuid)===o?(0,C.jsxs)(P.ZP,{monospace:!0,muted:!0,children:[i||o," (current)"]},"name"):(0,C.jsx)(k.Z,{href:"/pipelines/".concat(o,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:i||o},"name"),(0,C.jsx)(P.ZP,{default:!0,monospace:!0,children:t||"-"},"description")]})),uuid:"git-branch-blockPipelines"})})}),[Se,Ie,p]),Re=(0,s.useMemo)((function(){return S&&"undefined"!==typeof S&&!(0,ge.Qr)(S)&&("undefined"!==typeof(null===S||void 0===S?void 0:S.delay)&&"undefined"===typeof(null===je||void 0===je?void 0:je.delay)||"undefined"!==typeof(null===S||void 0===S?void 0:S.exponential_backoff)&&"undefined"===typeof(null===je||void 0===je?void 0:je.exponential_backoff)||"undefined"!==typeof(null===S||void 0===S?void 0:S.max_delay)&&"undefined"===typeof(null===je||void 0===je?void 0:je.max_delay)||"undefined"!==typeof(null===S||void 0===S?void 0:S.retries)&&"undefined"===typeof(null===je||void 0===je?void 0:je.retries))}),[je,S]),Ne=(0,s.useMemo)((function(){var e;return(null===te||void 0===te||null===(e=te.configuration)||void 0===e?void 0:e.global_data_product)||{}}),[te]),Le=(0,s.useCallback)((function(e){return ke((function(n){var t;return Di(Di({},n),{},{configuration:Di(Di({},null===te||void 0===te?void 0:te.configuration),{},{global_data_product:e(null===te||void 0===te||null===(t=te.configuration)||void 0===t?void 0:t.global_data_product)})})}))}),[te,ke]),Fe=(0,s.useMemo)((function(){return(0,ae.jO)(o,p)}),[o,p]),Ue=(0,s.useMemo)((function(){return Fe&&(0,ae.Uc)(o)}),[o,Fe]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:O.HN,pt:O.cd,children:[Ie>1&&(0,C.jsx)(Z.Z,{mb:O.Mq,px:O.cd,children:(0,C.jsx)(Ei,{children:(0,C.jsx)(y.ZP,Di(Di({},y.A0),{},{children:(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(G.BG,{fill:Si.$R,size:q.l2}),(0,C.jsx)(Z.Z,{pr:2}),(0,C.jsxs)(P.ZP,{bold:!0,large:!0,lineHeight:3*O.iI,warning:!0,children:["Shared by ",Ie," pipelines"]})]})}))})}),(0,C.jsx)(Z.Z,{mb:O.HN,px:O.cd,children:(0,C.jsxs)(ve.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,C.jsx)(ve.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,Di(Di({},y.A0),{},{children:[(0,C.jsx)(j.Z,{children:(0,C.jsx)(P.ZP,{bold:!0,default:!0,children:"Name"})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(T.Z,Di(Di({},Bi),{},{afterIcon:(0,C.jsx)(G.I8,{size:q.bL}),onClick:function(){return m(o,B)},children:(0,C.jsx)(P.ZP,{bold:!0,children:B||""})}))]}))}),h.tf.CUSTOM===(null===o||void 0===o?void 0:o.type)?(0,C.jsx)(ve.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,Di(Di({},y.A0),{},{children:[(0,C.jsx)(j.Z,{children:(0,C.jsx)(P.ZP,{bold:!0,default:!0,children:"Color"})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(T.Z,Di(Di({},Bi),{},{afterIcon:(0,C.jsx)(g.Z,{color:E?Ri[E]:null,size:q.bL,square:!0}),onClick:function(){return m(o,B)},outline:!1,children:(0,C.jsx)(P.ZP,{bold:!0,children:(0,Q.kC)(E||"")})}))]}))}):null]})}),Fe&&(0,C.jsx)(Z.Z,{mb:O.HN,px:O.cd,children:(0,C.jsxs)(ve.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,C.jsx)(ve.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,Di(Di({},y.A0),{},{children:[(0,C.jsx)(P.ZP,{bold:!0,default:!0,children:"Configuration"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(T.Z,Di(Di({},Bi),{},{onClick:function(){return v({block:o,contentByBlockUUID:r,defaultMainNavigationTab:ce.uK.CONFIGURATION,onChangeBlock:Be})},children:(0,C.jsx)(G.I8,{size:q.bL})}))]}))}),(0,C.jsx)(ve.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,Di(Di({},y.A0),{},{children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(P.ZP,{bold:!0,default:!0,children:"Streams"})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(T.Z,Di(Di({},Bi),{},{afterIcon:(0,C.jsx)(G.I8,{size:q.bL}),onClick:function(){return v({block:o,contentByBlockUUID:r,defaultMainNavigationTab:ce.uK.STREAMS,onChangeBlock:Be})},children:(0,C.jsxs)(P.ZP,{bold:!0,children:[(null===Ue||void 0===Ue?void 0:Ue.length)||0," selected"]})}))]}))})]})}),(0,C.jsxs)(Z.Z,{mb:O.HN,px:O.cd,children:[(0,C.jsx)(re.Z,{level:5,children:"Executor type"}),(0,C.jsxs)(P.ZP,{muted:!0,children:["For more information on this setting, please read the ",(0,C.jsx)(k.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,C.jsxs)(Z.Z,{mt:1,children:[!pe&&(0,C.jsx)(U.Z,{label:"Executor type",onChange:function(e){return ke((function(n){return Di(Di({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:x,value:(null===te||void 0===te?void 0:te.executor_type)||"",children:Ti.R.map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))}),pe&&(0,C.jsx)(z.Z,{label:"Executor type",monospace:!0,onChange:function(e){return ke((function(n){return Di(Di({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:w,setContentOnMount:!0,value:(null===te||void 0===te?void 0:te.executor_type)||""}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(k.Z,{muted:!0,onClick:function(){pe?(ke((function(e){return Di(Di({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null===x||void 0===x||null===(e=x.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null===w||void 0===w||null===(e=w.current)||void 0===e?void 0:e.focus()}),1),fe(!pe)},preventDefault:!0,small:!0,children:pe?"Select a preset executor type":"Enter a custom executor type"})})]})]}),(0,C.jsxs)(Z.Z,{mb:O.HN,px:O.cd,children:[(0,C.jsx)(re.Z,{level:5,children:"Retry configuration"}),(0,C.jsxs)(P.ZP,{muted:!0,children:[Re&&(0,C.jsxs)(C.Fragment,{children:["This block is currently using the retry configuration from the pipeline. You can override the pipeline\u2019s retry configuration for this block.",(0,C.jsx)("br",{})]}),"For more information on this setting, please read the ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,C.jsxs)(Z.Z,{mt:1,children:[(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(z.Z,{label:"Retries",monospace:!0,onChange:function(e){return ke((function(n){var t;return Di(Di({},n),{},{retry_config:Di(Di({},null===n||void 0===n?void 0:n.retry_config),{},{retries:"undefined"!==typeof 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:"undefined"===typeof(null===S||void 0===S?void 0:S.retries),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===je||void 0===je?void 0:je.retries)?null===je||void 0===je?void 0:je.retries:(null===S||void 0===S?void 0:S.retries)||""}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(z.Z,{label:"Delay",monospace:!0,onChange:function(e){return ke((function(n){var t;return Di(Di({},n),{},{retry_config:Di(Di({},null===n||void 0===n?void 0:n.retry_config),{},{delay:"undefined"!==typeof 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:"undefined"===typeof(null===S||void 0===S?void 0:S.delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===je||void 0===je?void 0:je.delay)?null===je||void 0===je?void 0:je.delay:(null===S||void 0===S?void 0:S.delay)||""}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(z.Z,{label:"Max delay",monospace:!0,onChange:function(e){return ke((function(n){var t;return Di(Di({},n),{},{retry_config:Di(Di({},null===n||void 0===n?void 0:n.retry_config),{},{max_delay:"undefined"!==typeof 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:"undefined"===typeof(null===S||void 0===S?void 0:S.max_delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===je||void 0===je?void 0:je.max_delay)?null===je||void 0===je?void 0:je.max_delay:(null===S||void 0===S?void 0:S.max_delay)||""})]}),(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsx)(b.Z,{checked:"undefined"===typeof(null===je||void 0===je?void 0:je.exponential_backoff)&&"undefined"!==typeof(null===S||void 0===S?void 0:S.exponential_backoff)?!(null===S||void 0===S||!S.exponential_backoff):!(null===je||void 0===je||!je.exponential_backoff),label:"Exponential backoff",onClick:function(){return ke((function(e){var n;return Di(Di({},e),{},{retry_config:Di(Di({},null===e||void 0===e?void 0:e.retry_config),{},{exponential_backoff:"undefined"===typeof(null===je||void 0===je?void 0:je.exponential_backoff)&&"undefined"!==typeof(null===S||void 0===S?void 0:S.exponential_backoff)?!(null!==S&&void 0!==S&&S.exponential_backoff):!(null!==e&&void 0!==e&&null!==(n=e.retry_config)&&void 0!==n&&n.exponential_backoff)})})}))}})})]})]}),I&&(0,C.jsxs)(Z.Z,{mb:O.HN,px:O.cd,children:[(0,C.jsx)(re.Z,{level:5,children:"Block run timeout"}),(0,C.jsx)(Z.Z,{mb:1}),(0,C.jsx)(z.Z,{label:"Time in seconds",monospace:!0,onChange:function(e){return ke((function(n){return Di(Di({},n),{},{timeout:e.target.value})}))},primary:!0,setContentOnMount:!0,type:"number",value:(null===te||void 0===te?void 0:te.timeout)||""}),(0,C.jsx)(Z.Z,{mb:1}),(0,C.jsx)(P.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.tf.DBT===A&&(0,C.jsxs)(Z.Z,{mb:O.HN,px:O.cd,children:[(0,C.jsx)(re.Z,{level:5,children:"dbt settings"}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(b.Z,{checked:!(null===te||void 0===te||null===(n=te.configuration)||void 0===n||null===(t=n.dbt)||void 0===t||!t.disable_tests),label:"Disable automatically running dbt tests",onClick:function(){return ke((function(e){var n,t,i;return Di(Di({},e),{},{configuration:Di(Di({},null===e||void 0===e?void 0:e.configuration),{},{dbt:Di(Di({},null===e||void 0===e||null===(n=e.configuration)||void 0===n?void 0:n.dbt),{},{disable_tests:!(null!==e&&void 0!==e&&null!==(t=e.configuration)&&void 0!==t&&null!==(i=t.dbt)&&void 0!==i&&i.disable_tests)})})})}))}})})]}),h.Lk.includes(A)&&h.t6.PYTHON===D&&(0,C.jsxs)(Z.Z,{mb:O.HN,px:O.cd,children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(re.Z,{level:5,children:"Block variables"}),(0,C.jsx)(Z.Z,{ml:2}),(0,C.jsx)(N.ZP,{Icon:G.mm,blackBorder:!0,halfPaddingBottom:!0,halfPaddingTop:!0,inline:!0,onClick:function(){return be((function(e){return!e}))},smallIcon:!0,uuid:"Sidekick/BlockSettings/addNewBlockVariable",children:"New"})]}),(0,C.jsxs)(Z.Z,{mb:O.cd,mt:1,children:[(0,C.jsxs)(P.ZP,{muted:!0,children:["Press",(0,C.jsx)(P.ZP,Di(Di({},Ai),{},{children:" Enter"}))," or",(0,C.jsx)(P.ZP,Di(Di({},Ai),{},{children:" Return"}))," on a row to add or update a variable. These variables are only accessible in this block\xa0",(0,C.jsxs)(P.ZP,Di(Di({},Ai),{},{bold:!1,children:["(",R,")."]})),(0,C.jsxs)(P.ZP,{inline:!0,muted:!0,children:[" Refer to the",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/development/variables/block-variables",openNewWindow:!0,children:" documentation"})," for more details."]})]}),(0,C.jsxs)(P.ZP,{muted:!0,children:[(0,C.jsx)(P.ZP,{bold:!0,inline:!0,warning:!0,children:"Note: "}),"Click the",(0,C.jsx)(P.ZP,Di(Di({},Ai),{},{children:" Update block settings"}))," button below to save changes. If you do not, any new or updated block variables will not be persisted."]})]}),(0,C.jsxs)(Z.Z,{mb:O.cd,children:[me&&(0,C.jsx)(Ii,{editStateInit:!0,focusKey:!0,onEnterCallback:function(){return be(!1)},onEscapeCallback:function(){return be(!1)},updateVariable:Pe},"new_block_variable"),null===(i=Object.entries(Ze))||void 0===i?void 0:i.map((function(e){var n=e[0];return(0,C.jsx)(Ii,{copyText:"kwargs['configuration'].get('".concat(n,"')"),deleteVariable:function(){var e=Di({},null===te||void 0===te?void 0:te.configuration);delete e[n],ke((function(n){return Di(Di({},n),{},{configuration:Di({},e)})}))},disableKeyEdit:!0,updateVariable:Pe,variable:{uuid:n,value:e[1]}},n)}))]})]}),h.tf.GLOBAL_DATA_PRODUCT===A&&(0,C.jsxs)(Z.Z,{mb:O.HN,children:[(0,C.jsx)(Z.Z,{px:O.cd,children:(0,C.jsx)(re.Z,{level:5,children:"Override global data product settings"})}),(0,C.jsx)(Z.Z,{mt:O.Mq,children:(0,C.jsx)(gi.Z,{objectAttributes:Ne,originalAttributes:Y,setObjectAttributes:Le})}),(0,C.jsx)(Z.Z,{mt:O.Mq,children:(0,C.jsx)(xi.Z,{objectAttributes:Ne,originalAttributes:Y,setObjectAttributes:Le})}),(0,C.jsx)(Z.Z,{mt:O.Mq,children:(0,C.jsx)(ji.Z,{blocks:null===ee||void 0===ee?void 0:ee.blocks,objectAttributes:Ne,originalAttributes:Y,setObjectAttributes:Le})})]}),(0,C.jsx)(Z.Z,{px:O.cd,children:(0,C.jsx)(T.Z,{disabled:!le,loading:De,onClick:function(){return Me({block:{configuration:null===te||void 0===te?void 0:te.configuration,executor_type:null===te||void 0===te?void 0:te.executor_type,retry_config:je,timeout:null===te||void 0===te?void 0:te.timeout}})},primary:!0,children:"Update block settings"})})]}),(0,C.jsxs)(Z.Z,{mb:O.HN,children:[!we&&(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsx)(H.Z,{inverted:!0})}),we&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsxs)(re.Z,{level:5,children:["Pipelines using this block (",Ie,")"]}),(0,C.jsx)(P.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."})]}),Ae]})]})]})},Li=t(4006),Fi=t(12869),Ui=t(10305),Hi=t(84820),zi=t(85108),Wi=t(97301);function Gi(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 Ki(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Gi(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Gi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Vi(e,n){var t,i,o,u,c=e.autocompleteItems,a=e.block,p=e.blockRefs,f=e.blocks,v=e.deleteWidget,b=e.executionState,g=e.fetchPipeline,x=e.fetchFileTree,_=e.messages,S=void 0===_?[]:_,I=e.onChangeContent,E=e.pipeline,T=e.runBlock,M=e.runningBlocks,D=e.savePipelineContent,B=e.selected,A=e.setAnyInputFocused,R=e.setErrors,L=e.setSelectedBlock,F=e.setTextareaFocused,K=e.textareaFocused,V=e.updateWidget,q=e.width,Y=(0,s.useRef)(null),J=(0,s.useContext)(m.ThemeContext),$=W.ZP.blocks.pipelines.detail(null===E||void 0===E?void 0:E.uuid,null===a||void 0===a?void 0:a.upstream_blocks[0]).data,ee=(null===$||void 0===$||null===(t=$.block)||void 0===t?void 0:t.outputs)||(null===a||void 0===a?void 0:a.outputs)||[],ne=(0,s.useState)(null),te=ne[0],ie=ne[1],re=(0,s.useState)(null===(i=a.configuration)||void 0===i?void 0:i.chart_type),le=re[0],ue=re[1],ce=(0,s.useState)(a.configuration),ae=ce[0],se=ce[1],de=(0,s.useState)(a.content),pe=de[0],fe=de[1],ve=(0,s.useState)(!le||0===ee.length),he=ve[0],me=ve[1],be=(0,s.useState)(!1),xe=be[0],ye=be[1],ke=(0,s.useState)(null),Pe=ke[0],we=ke[1],Ce=(0,s.useState)(null===a||void 0===a?void 0:a.upstream_blocks),Se=Ce[0],Ie=Ce[1],Ee=(0,s.useState)((null===ee||void 0===ee?void 0:ee.length)||0),Te=Ee[0],Me=Ee[1],De=(0,s.useState)(a.uuid),Be=De[0],Ae=De[1],Re=zi.G8[le],Ne=zi.x8[le],Le=(0,s.useMemo)((function(){return null===f||void 0===f?void 0:f.filter((function(e){var n=e.type;return[h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(n)}))}),[f]),Fe=(0,s.useMemo)((function(){return(0,_e.HK)(Le,(function(e){return e.uuid}))}),[Le]),Ue=!!M.find((function(e){return e.uuid===a.uuid}))||(null===S||void 0===S?void 0:S.length)>=1&&b!==Yn.uF.IDLE,He=(0,s.useMemo)((function(){return null===S||void 0===S?void 0:S.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[S]),ze=!!He.find((function(e){return e.error})),We=He.length>=1,Ge=(0,s.useMemo)((function(){return{blockType:a.type,hasError:ze,selected:B}}),[a.type,ze,B]);if(null!==He&&void 0!==He&&He.length){var Ke,Ve,qe=He.length-1;u=null===He||void 0===He||null===(Ke=He[qe])||void 0===Ke||null===(Ve=Ke.data)||void 0===Ve?void 0:Ve[0]}u?(u=(u=u.slice(1,u.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,Q.Pb)(u)&&(o=JSON.parse(u))):(null===ee||void 0===ee?void 0:ee.length)>=1&&(o={},ee.forEach((function(e){var n=e||{},t=n.text_data,i=n.type,r=n.variable_uuid;Yn.Gi.TEXT===i&&(0,Q.Pb)(t)&&(o[r]=JSON.parse(t))})));var Ye=(0,s.useCallback)((function(e){var n=Ki(Ki(Ki({},a),e),{},{configuration:Ki(Ki({},a.configuration),e.configuration)});D().then((function(){T({block:n,code:pe,ignoreAlreadyRunning:!0,runUpstream:!!Se.find((function(e){var n;return![h.DA.EXECUTED,h.DA.UPDATED].includes(null===(n=Fe[e])||void 0===n?void 0:n.status)}))})})),Me((function(e){return e+1}))}),[a,Fe,pe,T,D,Me,Se]),Qe=(0,s.useCallback)((function(e){fe(e),I(e)}),[I,fe]),Xe=(0,s.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;se((function(n){return Ki(Ki({},n),e)}));var i=Ki(Ki({},a),{},{configuration:Ki(Ki(Ki({},ae),e),{},{chart_type:le})});V(i),Te&&t&&Ye(i)}),[a,le,ae,Te,Ye,se,V]);(0,s.useEffect)((function(){ie({python:(0,Hi.Z)({autocompleteItems:c,block:a,blocks:f,pipeline:E})})}),[c,a,f,E]);var Je=(0,s.useMemo)((function(){return(0,C.jsx)(oe.Z,{autoHeight:!0,autocompleteProviders:te,onChange:Qe,selected:B,setSelected:function(e){return L(!0===e?a:null)},setTextareaFocused:F,showLineNumbers:!1,textareaFocused:K||ti.oV.TABLE===le&&!he,value:pe,width:"100%"})}),[te,a,le,pe,he,B,L,F,K,Qe]),$e=(0,s.useMemo)((function(){return(ze||We)&&(0,C.jsx)(Fi.Z,Ki(Ki({},Ge),{},{block:a,contained:!1,hideExtraInfo:!0,isInProgress:Ue,messages:He,selected:B}))}),[a,Ge,ze,We,Ue,He,B]),en=(0,Wn.Z)(he),nn=(0,Wn.Z)(q);(0,s.useEffect)((function(){var e,n=null===Y||void 0===Y||null===(e=Y.current)||void 0===e?void 0:e.getBoundingClientRect();en!==he||nn!==q?(we(0),setTimeout((function(){var e,n,t=null===Y||void 0===Y||null===(e=Y.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width;t&&we(t)}),100)):n&&we(n.width)}),[he,en,Y,we,q,nn]);var tn=(0,s.useMemo)((function(){var e=[];return Se.forEach((function(n,t){var i=Fe[n],o=(0,w.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:J}).accent;e.push((0,C.jsxs)(Z.Z,{ml:2,children:[(0,C.jsxs)(P.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,C.jsx)(k.Z,{color:o,inline:!0,onClick:function(){var e,n,t=null===p||void 0===p||null===(e=p.current)||void 0===e?void 0:e["".concat(null===i||void 0===i?void 0:i.type,"s/").concat(null===i||void 0===i?void 0:i.uuid,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,C.jsx)(P.ZP,{color:o,monospace:!0,small:!0,children:n})})]},n))})),e}),[p,Fe,J,Se]),on=(0,s.useMemo)((function(){var e,n=[],t=null===Re||void 0===Re||null===(e=Re.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return ti.Tv.includes(t)?e.concat(t):e}),[]);return null===t||void 0===t||t.forEach((function(e){var t=ae[e];if(t){var i,o,r=null===(i=zi.SR[le])||void 0===i||null===(o=i[e])||void 0===o?void 0:o.call(i);n.push((0,C.jsxs)(Z.Z,{ml:2,children:[(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",r&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,C.jsx)(P.ZP,{default:!0,inline:!0,small:!0,children:r})]})]},t))}})),n}),[le,ae,Re]),rn=(0,Wn.Z)(le),ln=(0,Wn.Z)(Se);(0,s.useEffect)((function(){if((!rn&&le&&null!==Se&&void 0!==Se&&Se.length||(null===ln||void 0===ln||!ln.length)&&(null===Se||void 0===Se?void 0:Se.length)>=1&&le)&&!pe&&(0,ge.Qr)(ae)&&Ne){var e=Ki(Ki({},a),{},{upstream_blocks:Se});Ne.configuration&&Xe(Ne.configuration(e)),Ne.content&&Qe(Ne.content(e))}}),[a,le,rn,ae,pe,Ne,Xe,Qe,Se,ln]);var un=(0,s.useMemo)((function(){return ae[ti.v8]||1}),[ae]),cn=(0,s.useMemo)((function(){return Object.entries(Re||{}).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0],o=t[1];return Ki(Ki({},e),{},(0,r.Z)({},i,o.map((function(e){var n,t=e.autoRun,i=e.label,o=e.monospace,l=e.options,u=e.settings,c=void 0===u?{}:u,s=e.type,d=e.uuid,p={fullWidth:!0,key:d,label:(0,Q.kC)(i()),monospace:o,onBlur:function(){return L(a)},onChange:function(e){return Xe((0,r.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return L(a)},value:(null===ae||void 0===ae?void 0:ae[d])||""},f=(null!==$&&void 0!==$&&$.block?[$.block]:[]).reduce((function(e,n){var t=n.outputs;return t?e.concat(t.reduce((function(e,n){var t=n.sample_data;return null!==t&&void 0!==t&&t.columns?e.concat(t.columns):e}),[])):e}),[]);if(zi.VR.COLUMNS===s){var v=ae[d]||[];n=(0,C.jsxs)(C.Fragment,{children:[(!c.maxValues||v.length<c.maxValues)&&(0,C.jsx)(U.Z,Ki(Ki({},p),{},{onChange:function(e){var n=ae[d]||[],i=e.target.value;n.includes(i)?n=(0,_e.Od)(n,(function(e){return e===i})):n.push(i),Xe((0,r.Z)({},d,n),{autoRun:t})},value:null,children:(0,_e.YC)(f.filter((function(e){return!v.includes(e)})),(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})),v.map((function(e){return(0,C.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,C.jsx)(je.Z,{label:e,onClick:function(){Xe((0,r.Z)({},d,(0,_e.Od)(v,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(zi.VR.METRICS===s){var h=ae[d]||[];n=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(P.ZP,{bold:!0,children:"Metrics"}),(0,C.jsx)(P.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,C.jsxs)(Ui.Z,{onChange:function(e,n){var i=n.resetValues,o=n.setValues;2===e.filter((function(e){return!!e})).length&&(h.find((function(n){var t=n.aggregation;return n.column===e[1]&&t===e[0]}))||(Xe((0,r.Z)({},d,h.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),o([null,null]),i()))},children:[(0,C.jsx)(U.Z,Ki(Ki({},p),{},{label:"aggregation",children:(0,_e.YC)(ti.bn,(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})),(0,C.jsx)(U.Z,Ki(Ki({},p),{},{label:"column",children:(0,_e.YC)(f,(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))}))]}),h.map((function(e){var n=e.aggregation,i=e.column;return(0,C.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,C.jsx)(je.Z,{label:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(P.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){Xe((0,r.Z)({},d,(0,_e.Od)(h,(function(e){var t=e.aggregation,o=e.column;return n===t&&i===o}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=l?(0,C.jsx)(U.Z,Ki(Ki({},p),{},{children:l.map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})):(0,C.jsx)(z.Z,Ki(Ki({},p),{},{type:s}));return(0,C.jsx)(Z.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[a,ae,Re,$,L,Xe]),an=cn.code,sn=cn.noCode,dn=(0,d.Db)(W.ZP.widgets.pipelines.useUpdate(null===E||void 0===E?void 0:E.uuid,a.uuid),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){ye(!1),g(),x()},onErrorCallback:function(e,n){return null===R||void 0===R?void 0:R({errors:n,response:e})}})}}),pn=(0,l.Z)(dn,1)[0],fn="ChartBlock/".concat(a.uuid),vn=(0,En.y)(),hn=vn.registerOnKeyDown,mn=vn.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){mn(fn)}}),[mn,fn]),hn(fn,(function(e,n,t){xe&&String(t[0])===String(_n.Uq)&&String(t[1])!==String(_n.zX)&&pn({widget:Ki(Ki({},a),{},{name:Be})})}),[a,xe,Be,pn]),(0,C.jsx)(ki.Z,{sm:12,md:12*un,children:(0,C.jsxs)(Wi.pM,{ref:n,children:[(0,C.jsx)(Z.Z,{mt:1,pt:1,px:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{flex:1,style:{position:"relative"},children:[(0,C.jsx)(ut,{bold:!1,fullWidth:!0,inputValue:Be,notRequired:!0,onBlur:function(){return setTimeout((function(){return ye(!1)}),300)},onChange:function(e){Ae(e.target.value),e.preventDefault()},onClick:function(){A(!0),ye(!0)},onFocus:function(){A(!0),ye(!0)},small:!0,stacked:!0,value:!xe&&a.uuid}),xe&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(k.Z,{noWrapping:!0,onClick:function(){return pn({widget:Ki(Ki({},a),{},{name:Be})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(U.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=Ki(Ki({},a),{},{upstream_blocks:n});V(t),Ye(t),Ie(n)},placeholder:"Source block",small:!0,value:(null===Se||void 0===Se?void 0:Se[0])||"",children:null===Le||void 0===Le?void 0:Le.map((function(e){var n=e.uuid;return(0,C.jsx)("option",{value:n,children:n},n)}))}),(0,C.jsx)(Z.Z,{mr:1}),!Ue&&(0,C.jsx)(Ze.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Ye(a)},uuid:"ChartBlock/run/".concat(a.uuid),children:(0,C.jsx)(G.Py,{size:2*O.iI})})}),Yn.uF.QUEUED===b&&(0,C.jsx)(H.Z,{color:(J||Oe.Z).content.active,small:!0,type:"cylon"}),Yn.uF.BUSY===b&&(0,C.jsx)(H.Z,{color:(J||Oe.Z).content.active,small:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Ze.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return me((function(e){return!e}))},selected:he,uuid:"ChartBlock/edit/".concat(a.uuid),children:(0,C.jsx)(G.I8,{size:2*O.iI})})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Ze.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return v(a)},uuid:"ChartBlock/delete/".concat(a.uuid),children:(0,C.jsx)(G.rF,{size:2*O.iI})})})]})]})}),(0,C.jsx)(Z.Z,{mt:1}),(0,C.jsxs)(y.ZP,{fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:6,ref:Y,children:o&&!(0,ge.Qr)(o)&&(0,C.jsx)(Z.Z,{pb:3,children:(0,C.jsx)(Li.Z,{block:Ki(Ki({},a),{},{configuration:Ki(Ki({},a.configuration),ae)}),data:o,width:Pe})})}),he&&(0,C.jsx)(Wi.Tb,{children:(0,C.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(U.Z,{onChange:function(e){var n=e.target.value,t=Ki(Ki({},a),{},{configuration:Ki(Ki({},ae),{},{chart_type:n})});V(t),Ye(t),ue(n)},placeholder:"Select chart type",value:le,children:ti.CK.map((function(e){return(0,C.jsx)("option",{value:e,children:(0,Q.kC)(e)},e)}))})}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(U.Z,{onChange:function(e){return Xe((0,r.Z)({},ti.v8,e.target.value))},placeholder:"Chart width",value:(null===ae||void 0===ae?void 0:ae[ti.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,C.jsx)("option",{value:i,children:t},t)}))})}),sn]})})]}),he&&!(null===an||void 0===an||!an.length)&&h.t6.SQL!==a.language&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{my:1,px:1,children:[(0,C.jsx)(P.ZP,{bold:!0,children:"Custom chart code"}),(0,C.jsxs)(P.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,C.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,C.jsxs)(Wi.T7,{children:[Se.length>=1&&(0,C.jsxs)(Wi.y9,{children:[(0,C.jsxs)(P.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",tn]}),(0,C.jsxs)(P.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",on]})]}),Je]})]}),$e&&(0,C.jsx)(Z.Z,{px:1,children:$e})]})})}var qi=s.forwardRef(Vi),Yi=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];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 Xi(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,r.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 Ji=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,o=e.deleteWidget,l=e.messages,u=e.onChangeChartBlock,c=e.runBlock,a=e.runningBlocks,d=e.savePipelineContent,p=e.selectedBlock,f=e.setAnyInputFocused,v=e.setErrors,h=e.setSelectedBlock,m=e.setTextareaFocused,b=e.textareaFocused,g=e.updateWidget,x=e.widgets,j=e.width,k=(0,he.Z)(e,Yi),Z=(0,s.useMemo)((function(){return a.reduce((function(e,n,t){return Xi(Xi({},e),{},(0,r.Z)({},n.uuid,Xi(Xi({},n),{},{priority:t})))}),{})}),[a]);return(0,C.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,C.jsx)(Zi.Z,{fullHeight:!0,style:{marginLeft:.5*O.iI,marginRight:.5*O.iI},children:null===x||void 0===x?void 0:x.map((function(e){var r=e.uuid,x=Z[r],y=x?0===x.priority?Yn.uF.BUSY:Yn.uF.QUEUED:Yn.uF.IDLE;return i.current[r]=(0,s.createRef)(),(0,s.createElement)(qi,Xi(Xi({},k),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:o,executionState:y,key:r,messages:l[r],onChangeContent:function(e){return u(r,e)},ref:i.current[r],runBlock:c,runningBlocks:a,savePipelineContent:d,selected:(null===p||void 0===p?void 0:p.uuid)===r,setAnyInputFocused:f,setErrors:v,setSelectedBlock:h,setTextareaFocused:m,textareaFocused:b,updateWidget:g,width:j}))}))}),(0,C.jsx)("div",{style:{height:"80vh"}})]})},$i=t(17586),eo=m.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),no=function(e){var n=e.size,t=void 0===n?20:n,i=e.viewBox,o=void 0===i?"0 0 358 305":i;return(0,C.jsxs)(eo,{height:t*(305/358),viewBox:o,width:t,children:[(0,C.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,C.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,C.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,C.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,C.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,C.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,C.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,C.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,C.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,C.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,C.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,C.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,C.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,C.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,C.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,C.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 to,io=function(e){var n=e.blocksInNotebook;return e.extensionOption,(0,s.useMemo)((function(){return(null===n||void 0===n?void 0:n.filter((function(e){var n=e.type;return h.tf.DBT===n})))||[]}),[n]),(0,C.jsx)(C.Fragment,{})};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 ro(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,r.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}!function(e){e.DBT="dbt",e.GREAT_EXPECTATIONS="great_expectations"}(to||(to={}));var lo=function(e){var n,t,i=e.block,o=e.blockActionDescription,r=e.blocks,l=e.inputPlaceholder,u=e.loading,c=e.onClickTag,a=e.runBlockAndTrack,d=e.supportedUpstreamBlockLanguages,p=e.supportedUpstreamBlockTypes,f=e.updateBlock,v=(0,s.useContext)(m.ThemeContext),h=(0,s.useState)(""),k=h[0],_=h[1],S=(0,s.useState)(!1),I=S[0],E=S[1],M=(0,s.useState)(null),D=M[0],B=M[1],A=(0,s.useMemo)((function(){return(0,_e.HK)(r,(function(e){return e.uuid}))}),[r]);(0,s.useEffect)((function(){D||B((0,_e.HK)((null===i||void 0===i?void 0:i.upstream_blocks)||[],(function(e){return e})))}),[i,D]);var R=(0,s.useMemo)((function(){return(null===r||void 0===r?void 0:r.filter((function(e){var n=e.name,t=e.type,i=e.uuid;return((null===n||void 0===n?void 0:n.toLowerCase().includes(null===k||void 0===k?void 0:k.toLowerCase()))||(null===i||void 0===i?void 0:i.toLowerCase().includes(null===k||void 0===k?void 0:k.toLowerCase())))&&(null===p||void 0===p?void 0:p.includes(t))})))||[]}),[k,r,p]),N=(0,s.useMemo)((function(){var e=[];return null===R||void 0===R||R.forEach((function(n,t){var i=n.color,o=n.language,r=n.type,l=n.uuid,u=(0,w.qn)(r,{blockColor:i,theme:v}).accent;t>=1&&e.push((0,C.jsx)(x.Z,{light:!0},"divider-".concat(l)));var c=!(null===D||void 0===D||!D[l]),a=null!==d&&"undefined"!==typeof d&&!(null!==d&&void 0!==d&&d.includes(o));e.push((0,C.jsx)(Z.Z,{px:2,py:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(g.Z,{color:u,size:1.5*O.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(P.ZP,{monospace:!0,muted:a,small:!0,children:l})]}),a&&(0,C.jsxs)(P.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[o," support coming soon"]}),!a&&(0,C.jsx)(b.Z,{checked:!a&&c,disabled:a,onClick:function(){B((function(e){var n=ro({},e);return c?delete n[l]:n[l]=l,n}))}})]})},"option-".concat(l)))})),e}),[R,v,D]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(wn.Z,{onClickOutside:function(){return E(!1)},open:!0,children:[(0,C.jsx)(z.Z,{beforeIcon:(0,C.jsx)(G.HN,{}),borderless:!0,compact:!0,onChange:function(e){return _(e.target.value)},onClick:function(e){(0,De.j)(e),E(!0)},onFocus:function(e){(0,De.j)(e),E(!0)},placeholder:l,small:!0,value:k}),I&&(0,C.jsxs)(C.Fragment,{children:[N,(0,C.jsx)(Z.Z,{mx:1,children:(0,C.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,C.jsx)(T.Z,{compact:!0,loading:u,onClick:function(){return f({block:i,upstream_blocks:Object.keys(D)}).then((function(){return E(!1)}))},small:!0,children:"Save selected blocks"})})})]})]}),!I&&(null===i||void 0===i||null===(n=i.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(0,C.jsxs)(Z.Z,{pb:1,pr:1,children:[o&&(0,C.jsx)(Z.Z,{mt:1,pl:1,children:(0,C.jsx)(P.ZP,{muted:!0,small:!0,children:o})}),(0,C.jsx)(y.ZP,{alignItems:"center",children:null===i||void 0===i||null===(t=i.upstream_blocks)||void 0===t?void 0:t.map((function(e){var n=null===A||void 0===A?void 0:A[e];if(!n)return(0,C.jsx)("div",{},e);var t=n.color,o=n.type,r=(0,w.qn)(o,{blockColor:t,theme:v}).accentLight;return(0,C.jsx)(Z.Z,{ml:1,mt:1,children:(0,C.jsx)(T.Z,{backgroundColor:r,compact:!0,disabled:!a,onClick:function(e){(0,De.j)(e),c?c(n):null===a||void 0===a||a({block:ro(ro({},i),{},{upstream_blocks:[null===n||void 0===n?void 0:n.uuid]})})},small:!0,children:(0,C.jsx)(P.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},uo=t(75634);function co(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 ao(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?co(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):co(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var so=function(e){var n=e.addNewBlockAtIndex,t=e.autocompleteItems,i=e.blockRefs,o=e.blocks,u=e.blocksInNotebook,c=e.deleteBlock,a=e.extensionOption,p=e.fetchFileTree,f=e.fetchPipeline,v=e.interruptKernel,m=e.messages,b=e.onChangeCallbackBlock,g=e.onChangeCodeBlock,x=e.pipeline,j=e.runBlock,y=e.runningBlocks,w=e.savePipelineContent,_=e.selectedBlock,S=e.setAnyInputFocused,I=e.setErrors,E=e.setSelectedBlock,T=e.setTextareaFocused,M=e.showBrowseTemplates,D=e.textareaFocused,B=(0,s.useRef)(null),A=(0,s.useState)(!1),L=A[0],F=A[1],U=(a||{}).uuid,H=(x||{}).extensions,z=(0,s.useMemo)((function(){return(null===a||void 0===a?void 0:a.templates)||[]}),[a]),K=(0,s.useMemo)((function(){return null===H||void 0===H?void 0:H[U]}),[U,H]),V=(0,s.useMemo)((function(){return(null===K||void 0===K?void 0:K.blocks)||[]}),[K]),q=(0,s.useMemo)((function(){return(0,_e.HK)(V,(function(e){return e.uuid}))}),[V]),Y=(0,s.useMemo)((function(){return U===(null===_||void 0===_?void 0:_.extension_uuid)&&q[null===_||void 0===_?void 0:_.uuid]}),[q,U,_]),Q=(0,s.useMemo)((function(){return y.reduce((function(e,n,t){return ao(ao({},e),{},(0,r.Z)({},n.uuid,ao(ao({},n),{},{priority:t})))}),{})}),[y]),J=(0,d.Db)((function(e){var n=e.block,t=e.upstream_blocks;return W.ZP.blocks.pipelines.useUpdate(null===x||void 0===x?void 0:x.uuid,encodeURIComponent(null===n||void 0===n?void 0:n.uuid),{query:{extension_uuid:null===n||void 0===n?void 0:n.extension_uuid}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){f()},onErrorCallback:function(e,n){return null===I||void 0===I?void 0:I({errors:n,response:e})}})}}),$=(0,l.Z)(J,2),ee=$[0],ne=$[1].isLoading,te=(0,s.useMemo)((function(){return V.map((function(e,n){var r=ao(ao({},e),{},{extension_uuid:U}),l=r.type,a=r.uuid,d=(null===_||void 0===_?void 0:_.uuid)===a,k=Q[a],P=k?0===k.priority?Yn.uF.BUSY:Yn.uF.QUEUED:Yn.uF.IDLE,M="".concat(l,"s/").concat(a,".py");return i.current[M]=(0,s.createRef)(),(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsx)(R.Z,{allBlocks:o,autocompleteItems:t,block:r,blockIdx:n,blockRefs:i,blocks:o,defaultValue:r.content,deleteBlock:function(e){c(ao(ao({},e),{},{extension_uuid:U})),S(!1)},executionState:P,extraContent:(0,C.jsx)(lo,{block:r,blockActionDescription:"Click a block name to run expectations on it.",blocks:u,inputPlaceholder:"Select blocks to run expectations on",loading:ne,supportedUpstreamBlockLanguages:[h.t6.PYTHON],supportedUpstreamBlockTypes:[h.tf.DATA_EXPORTER,h.tf.DATA_LOADER,h.tf.DBT,h.tf.TRANSFORMER],updateBlock:ee}),fetchFileTree:p,fetchPipeline:f,hideRunButton:!0,interruptKernel:v,messages:m[a],noDivider:!0,onCallbackChange:function(e){return b(l,a,e)},onChange:function(e){return g(l,a,e)},pipeline:x,ref:i.current[M],runBlock:j,runningBlocks:y,savePipelineContent:w,selected:d,setAnyInputFocused:S,setErrors:I,setSelected:function(e){return E(!0===e?r:null)},setTextareaFocused:T,textareaFocused:d&&D})},a)}))}),[t,i,o,u,c,V,U,p,f,v,ne,m,b,g,x,j,y,Q,w,_,S,I,E,T,D,ee]),ie="Extensions/GreatExpectations/index",oe=(0,En.y)(),re=oe.disableGlobalKeyboardShortcuts,le=oe.registerOnKeyDown,ue=oe.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){ue(ie)}}),[ue,ie]),le(ie,(function(e,n){!re&&Y&&((0,oi.y)([_n.zX,_n.Um],n)||(0,oi.y)([_n.PQ,_n.Um],n))&&(e.preventDefault(),w())}),[Y,w]),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:O.cd,children:[(0,C.jsx)(P.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{default:!0,children:["When a block in your pipeline runs, it\u2019ll run any tests you define in its code. All associated extension blocks will also run during that phase. Learn more about the ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{default:!0,children:["For all available expectations, read Great Expectation\u2019s ",(0,C.jsx)(k.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),te,(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsx)(wn.Z,{onClickOutside:function(){return F(!1)},open:!0,children:(0,C.jsx)(Ut.Z,{disableKeyboardShortcuts:!0,items:null===z||void 0===z?void 0:z.map((function(e){var t=e.description,i=e.name,o=e.path;return{label:function(){return i},onClick:function(){return n({config:{template_path:o},extension_uuid:U,type:h.tf.EXTENSION},(null===V||void 0===V?void 0:V.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,ii.hr)((function(e){return n(ao(ao({},e),{},{extension_uuid:U,type:h.tf.EXTENSION}),(null===V||void 0===V?void 0:V.length)||0)}),h.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:M})),onClickCallback:function(){return F(!1)},open:L,parentRef:B,uuid:"Extension",children:(0,C.jsx)(N.ZP,{beforeElement:(0,C.jsx)(uo.Wx,{teal:!0,children:(0,C.jsx)(G.mm,{size:uo.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),F(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},po=t(69419),fo=["pipeline"];function vo(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 ho(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vo(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var mo=function(e){var n=e.pipeline,t=(0,he.Z)(e,fo),i=(0,p.useRouter)(),o=W.ZP.extension_options.list().data,r=(0,s.useMemo)((function(){return(null===o||void 0===o?void 0:o.extension_options)||[]}),[o]),l=(0,s.useMemo)((function(){return(0,_e.HK)(r,(function(e){return e.uuid}))}),[r]),u=(0,s.useState)(null),c=u[0],a=u[1],d=(0,s.useMemo)((function(){return l[c]}),[l,c]),f=(0,s.useMemo)((function(){return ho(ho({},t),{},{pipeline:n})}),[n,t]);(0,s.useEffect)((function(){var e;a(null===(e=(0,po.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var v=(0,s.useMemo)((function(){return n?(to.GREAT_EXPECTATIONS===c?e=so:to.DBT===c&&(e=io),e?(0,C.jsx)(e,ho(ho({},f),{},{extensionOption:d})):void 0):null;var e}),[d,n,c,f]);return(0,C.jsx)(D.W,{backend:B.PD,children:(0,C.jsxs)(Z.Z,{p:O.cd,children:[!c&&(0,C.jsxs)(Z.Z,{mb:O.cd,children:[(0,C.jsxs)(P.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,C.jsx)(P.ZP,{inline:!0,monospace:!0,children:null===n||void 0===n?void 0:n.uuid})," pipeline."]})})]}),!o&&!c&&(0,C.jsx)(H.Z,{}),v,!c&&(null===r||void 0===r?void 0:r.map((function(e,n){var t=e.description,o=e.name,r=e.uuid;return(0,C.jsx)(Z.Z,{mt:n>=1?O.cd:0,children:(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,Kn.u7)({extension:r},{pushHistory:!0})},preventDefault:!0,children:(0,C.jsx)(Qn.Z,{dark:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Te.Z,{fullWidth:!1,children:(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)("img",{alt:o,height:3*O.iI,src:"".concat(i.basePath,"/images/extensions/").concat(r,"/logo.png"),width:3*O.iI})})})}),(0,C.jsx)(Z.Z,{mr:O.cd}),(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(P.ZP,{bold:!0,children:o}),(0,C.jsx)(P.ZP,{default:!0,small:!0,children:t})]})]}),(0,C.jsx)(G._Q,{})]})})})},r)})))]})})},bo=t(28385),go=t(9134),xo=t(83784),jo=t(30229),yo=t(8916);var ko=function(e){e.blocks;var n=e.fetchVariables,t=e.pipeline,i=e.selectedBlock,o=e.setErrorMessages,r=e.variables,u=e.width,c=(0,s.useState)(!1),a=c[0],p=c[1],f=(0,s.useState)(),v=f[0],m=f[1],b=(0,s.useState)(),g=b[0],x=b[1],j=null===t||void 0===t?void 0:t.uuid,w=(0,d.Db)(W.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,X.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;o((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),_=(0,l.Z)(w,1)[0],S=(0,d.Db)((function(e){return W.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);o((function(e){return e.concat(t)}))}})}}),I=(0,l.Z)(S,1)[0],E=(0,s.useCallback)((function(e){if("Enter"===e.key){var t=g;try{t=JSON.parse(g)}catch(i){}_({variable:{name:v,value:t}}).then((function(){n(),m(null),x(null)})),p(!1)}else"Escape"===e.key&&p(!1)}),[_,n,v,g]),T=(0,s.useMemo)((function(){return u-4*O.iI}),[u]),M=(0,s.useMemo)((function(){return(0,yo.wx)(r,(function(e){return e.uuid===xo.C}))}),[r]),D=(0,s.useMemo)((function(){return(0,yo.wx)(r,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,r]),B=(0,s.useMemo)((function(){return(0,C.jsxs)(wi,{width:T,children:[a&&(0,C.jsxs)(Zi.Z,{children:[(0,C.jsx)(ki.Z,{md:1,children:(0,C.jsx)(Ci,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:_i.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(v),yi.Am.success("Successfully copied to clipboard.",{position:yi.Am.POSITION.BOTTOM_RIGHT,toastId:v})},uuid:"Sidekick/GlobalVariables/".concat(v),withIcon:!0,children:(0,C.jsx)(G.CK,{size:2.5*O.iI})})})}),(0,C.jsx)(ki.Z,{md:4,children:(0,C.jsx)(Ci,{children:(0,C.jsx)(z.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){m(e.target.value),e.preventDefault()},onKeyDown:E,paddingHorizontal:0,placeholder:"variable",small:!0,value:v})})}),(0,C.jsx)(ki.Z,{md:7,children:(0,C.jsx)(Ci,{children:(0,C.jsx)(z.Z,{compact:!0,borderless:!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?void 0:M.map((function(e){return(0,C.jsx)(Ii,{deleteVariable:function(){return I(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[I,M,v,g,j,m,x,p,a,T]),A=(0,s.useMemo)((function(){return(0,C.jsx)(wi,{width:T,children:null===D||void 0===D?void 0:D.map((function(e){return(0,C.jsx)(Ii,{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?void 0:i.uuid,n))),hideEdit:!0,pipelineUUID:j,variable:e},e.uuid);var n}))})}),[D,i,T]);return(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(re.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,C.jsx)(Z.Z,{ml:2}),(0,C.jsx)(N.ZP,{Icon:G.mm,blackBorder:!0,inline:!0,onClick:function(){return p((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(P.ZP,{muted:!0,children:["Press ",(0,C.jsx)(P.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,C.jsx)(P.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:B}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsx)(P.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,C.jsxs)(Z.Z,{mb:O.cd,children:[(0,C.jsxs)(P.ZP,{bold:!0,large:!0,children:["For Python (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(go.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,C.jsxs)(Z.Z,{mb:O.cd,children:[(0,C.jsxs)(P.ZP,{bold:!0,large:!0,children:["For SQL (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(go.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,C.jsxs)(Z.Z,{mb:O.cd,children:[(0,C.jsxs)(P.ZP,{bold:!0,large:!0,children:["For R (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(go.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,C.jsxs)(Z.Z,{mb:O.cd,children:[(0,C.jsx)(re.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,C.jsx)(Z.Z,{mb:O.cd}),(0,C.jsx)(P.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(jo.Xm).map((function(e,n){var t;return(0,C.jsxs)(Z.Z,{mb:O.cd,children:[(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsx)(P.ZP,{large:!0,monospace:!0,children:(0,Q.vg)(null===(t=jo.Z4[e])||void 0===t?void 0:t.call(jo.Z4))})}),(0,yo.JZ)([],e).map((function(n,t){return(0,C.jsx)(Ii,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),D&&D.length>0&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{my:2,children:(0,C.jsx)(re.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,C.jsx)(Z.Z,{mb:2,children:A}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(P.ZP,{children:["Output variables can be used in any ",(0,C.jsx)(P.ZP,{bold:!0,inline:!0,monospace:!0,warning:!0,children:h.tf.SCRATCHPAD})," block. They are for scratchpad blocks, specifically. To get upstream block outputs inside of other blocks, use the positional arguments."]})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsx)(P.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsx)(go.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"})})]})]})},Zo=t(89565),Po=t.n(Zo),Oo=t(88494),wo=m.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,He.y$)()),Co=m.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],He.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 ")}));function _o(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 So(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_o(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Io=function(e){var n=e.cancelPipeline,t=e.checkIfPipelineRunning,i=e.executePipeline,o=e.isPipelineExecuting,r=e.pipelineExecutionHidden,l=e.pipelineMessages,u=e.setPipelineExecutionHidden,c=(0,s.useMemo)((function(){return(null===l||void 0===l?void 0:l.length)||0}),[l]),a=(0,s.useMemo)((function(){return c>100?l.slice(-100):l}),[c,l]),d=(0,s.useCallback)((function(){var e=!r;u(e),(0,gn.t8)(gn.Q9,e)}),[r,u]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(wo,{children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(G.JM,{inverted:!0,size:2*O.iI}),compact:o,disabled:o,loading:o,onClick:i,success:!0,children:(0,C.jsx)(P.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,C.jsx)(Z.Z,{ml:1}),o&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(G.x8,{inverted:!0,size:2*O.iI}),onClick:n,success:!0,children:(0,C.jsx)(P.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,C.jsx)(Z.Z,{ml:1})]}),(0,C.jsx)(T.Z,{onClick:t,secondary:!0,children:(0,C.jsx)(P.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(P.ZP,{children:"Hide"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(ke.Z,{checked:r,onCheck:d})]})]})}),!r&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:1}),(0,C.jsx)(Co,{noScrollbarTrackBackground:!0,children:(0,C.jsx)(Oo.Nk,{executedAndIdle:!0,hasError:!1,selected:!0,children:a.map((function(e,n){var t=e.data,i=e.type,o=[],r=(o=(o=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return o.map((function(e,t){var o,l={first:0===n&&0===t,last:n===c-1&&t===r-1};return Yn.jU.includes(i)?o=(0,C.jsx)(Oo.T5,So(So({},l),{},{children:(0,C.jsx)(P.ZP,{monospace:!0,preWrap:!0,children:(0,C.jsx)(Po(),{children:e})})})):i===Yn.Gi.IMAGE_PNG&&(o=(0,C.jsx)("div",{style:{backgroundColor:"white"},children:(0,C.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,C.jsx)("div",{children:o},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})},Eo=t(91749);var To=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,o=e.setErrorMessages,r=e.width,u=(0,s.useState)(!1),c=u[0],a=u[1],p=(0,s.useState)(),f=p[0],v=p[1],h=(0,s.useState)(),m=h[0],b=h[1],g=(0,s.useMemo)((function(){return r-O.cd*O.iI*2}),[r]),x=(0,d.Db)(W.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;o((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,d.Db)((function(e){return W.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);o((function(e){return e.concat(t)}))}})}}),w=(0,l.Z)(k,1)[0],_=(0,s.useCallback)((function(e){"Enter"===e.key?(j({secret:{name:f,value:m}}).then((function(){n(),v(null),b(null)})),a(!1)):"Escape"===e.key&&a(!1)}),[j,n,f,m]);return(0,C.jsxs)(Z.Z,{p:O.cd,children:[(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(re.Z,{level:4,monospace:!0,children:"Secrets"}),(0,C.jsx)(Z.Z,{ml:2}),(0,C.jsx)(N.ZP,{Icon:G.mm,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(P.ZP,{children:[(0,C.jsx)(P.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,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(P.ZP,{muted:!0,children:["Press ",(0,C.jsx)(P.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,C.jsx)(P.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsxs)(wi,{width:g,children:[c&&(0,C.jsxs)(Zi.Z,{children:[(0,C.jsx)(ki.Z,{md:1,children:(0,C.jsx)(Ci,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:_i.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(f,") }}")),yi.Am.success("Successfully copied to clipboard.",{position:yi.Am.POSITION.BOTTOM_RIGHT,toastId:f})},uuid:"Sidekick/Secrets/".concat(f),withIcon:!0,children:(0,C.jsx)(G.CK,{size:2.5*O.iI})})})}),(0,C.jsx)(ki.Z,{md:4,children:(0,C.jsx)(Ci,{children:(0,C.jsx)(z.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){v(e.target.value),e.preventDefault()},onKeyDown:_,paddingHorizontal:0,placeholder:"secret name",small:!0,value:f})})}),(0,C.jsx)(ki.Z,{md:7,children:(0,C.jsx)(Ci,{children:(0,C.jsx)(z.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){b(e.target.value),e.preventDefault()},onKeyDown:_,paddingHorizontal:0,placeholder:"secret value",small:!0,value:m})})})]}),null===i||void 0===i?void 0:i.map((function(e){return(0,C.jsx)(Ii,{copyText:e.name,deleteVariable:function(){return w(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsx)(P.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,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsx)(go.Z,{language:"yaml",small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n ",maxWidth:g})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsx)(P.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,C.jsx)(Z.Z,{mb:O.cd,children:(0,C.jsx)(go.Z,{language:"python",small:!0,source:"\n from mage_ai.data_preparation.shared.secrets import get_secret_value\n\n get_secret_value('<secret_name>')\n ",maxWidth:g})})]})},Mo=t(28026),Do=t(68899),Bo=t(91835);function Ao(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 Ro(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ao(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ao(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var No=function(e){var n=e.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,o=e.autocompleteItems,u=e.blockRefs,c=e.blocks,a=e.blocksInNotebook,p=e.deleteBlock,f=e.displayBlockName,v=e.fetchFileTree,m=e.fetchPipeline,b=e.interruptKernel,g=e.messages,x=(e.onChangeCallbackBlock,e.onChangeCodeBlock),j=e.onSelectBlockFile,y=e.pipeline,w=e.runBlock,_=e.runningBlocks,S=e.savePipelineContent,I=e.selectedBlock,E=e.setAnyInputFocused,T=e.setErrors,M=e.setHiddenBlocks,D=e.setSelectedBlock,B=e.setTextareaFocused,A=e.showBrowseTemplates,L=e.textareaFocused,F=(0,s.useRef)(null),U=(0,s.useState)(!1),H=U[0],z=U[1],K=(0,po.iV)().block_uuid;(0,s.useEffect)((function(){var e=c.find((function(e){var n,t=e.uuid;return(null===K||void 0===K||null===(n=K.split(":"))||void 0===n?void 0:n[0])===t}));e&&(I&&(null===e||void 0===e?void 0:e.uuid)===(null===I||void 0===I?void 0:I.uuid)||(M((function(n){return Ro(Ro({},n),{},(0,r.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)))}),[K,c,j,I,M]);var V=(y||{}).type,q=(0,s.useMemo)((function(){return(0,_e.HK)(t||[],(function(e){return e.uuid}))}),[t]),Y=W.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,J=(0,s.useMemo)((function(){return(null===Y||void 0===Y?void 0:Y.block_templates)||[]}),[Y]),$=(0,s.useCallback)((function(e){return n(e,(null===q||void 0===q?void 0:q.length)||0)}),[n,q]),ee=(0,s.useMemo)((function(){return(0,ii.oM)(J,$)}),[$,J]),ne=(0,s.useMemo)((function(){return(0,ii.hr)($,i,V,{blockTemplatesByBlockType:ee,languages:[h.t6.PYTHON],showBrowseTemplates:A})}),[$,i,ee,V]),te=(0,s.useMemo)((function(){return null===q||void 0===q?void 0:q[null===I||void 0===I?void 0:I.uuid]}),[q,I]),ie=(0,s.useMemo)((function(){return _.reduce((function(e,n,t){return Ro(Ro({},e),{},(0,r.Z)({},n.uuid,Ro(Ro({},n),{},{priority:t})))}),{})}),[_]),oe=(0,d.Db)((function(e){var n=e.block,t=e.upstream_blocks;return W.ZP.blocks.pipelines.useUpdate(null===y||void 0===y?void 0:y.uuid,encodeURIComponent(null===n||void 0===n?void 0:n.uuid),{query:{block_type:null===n||void 0===n?void 0:n.type}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){m()},onErrorCallback:function(e,n){return null===T||void 0===T?void 0:T({errors:n,response:e})}})}}),re=(0,l.Z)(oe,2),le=re[0],ue=re[1].isLoading,ce=(0,s.useMemo)((function(){return null===t||void 0===t?void 0:t.map((function(e,n){var t=e.type,i=e.uuid,l=(null===I||void 0===I?void 0:I.uuid)===i,d=ie[i],k=d?0===d.priority?Yn.uF.BUSY:Yn.uF.QUEUED:Yn.uF.IDLE,P="".concat(t,"s/").concat(i,".py");return u.current[P]=(0,s.createRef)(),(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsx)(R.Z,{allBlocks:c,autocompleteItems:o,block:e,blockIdx:n,blockRefs:u,blocks:c,defaultValue:e.content,deleteBlock:function(e){p(Ro({},e)),E(!1)},executionState:k,extraContent:(0,C.jsx)(lo,{block:e,blocks:a,inputPlaceholder:"Select blocks to add ".concat((0,Q._6)(f,null)," to"),loading:ue,onClickTag:function(e){M((function(n){return Ro(Ro({},n),{},(0,r.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[h.tf.CUSTOM,h.tf.DATA_EXPORTER,h.tf.DATA_LOADER,h.tf.DBT,h.tf.SCRATCHPAD,h.tf.SENSOR,h.tf.TRANSFORMER],updateBlock:le}),fetchFileTree:v,fetchPipeline:m,hideRunButton:!0,interruptKernel:b,messages:g[i],noDivider:!0,onChange:function(e){return x(t,i,e)},pipeline:y,ref:u.current[P],runBlock:w,runningBlocks:_,savePipelineContent:S,selected:l,setAnyInputFocused:E,setErrors:T,setSelected:function(n){return D(!0===n?e:null)},setTextareaFocused:B,textareaFocused:l&&L})},i)}))}),[t,o,u,c,a,p,f,v,m,b,ue,g,x,j,y,w,_,ie,S,I,E,T,M,D,B,L,le]),ae="".concat(f,"/index"),se=(0,En.y)(),de=se.disableGlobalKeyboardShortcuts,pe=se.registerOnKeyDown,fe=se.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){fe(ae)}}),[fe,ae]),pe(ae,(function(e,n){!de&&te&&((0,oi.y)([_n.zX,_n.Um],n)||(0,oi.y)([_n.PQ,_n.Um],n))&&(e.preventDefault(),S())}),[te,S]),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:O.cd,children:[(0,C.jsxs)(P.ZP,{default:!0,children:["Run 1 or more ",(0,Q.wX)(f)," block functions whenever another block succeeds or fails."]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(P.ZP,{default:!0,children:["Learn more about ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,Q.wX)((0,Q._6)(f,null)),"/overview"),openNewWindow:!0,children:(0,Q.wX)((0,Q._6)(f,null))}),"."]})})]}),ce,(0,C.jsx)(Z.Z,{mt:O.cd,children:(0,C.jsx)(wn.Z,{onClickOutside:function(){return z(!1)},open:!0,children:(0,C.jsx)(Ut.Z,{disableKeyboardShortcuts:!0,items:ne,onClickCallback:function(){return z(!1)},open:H,parentRef:F,uuid:f,children:(0,C.jsxs)(N.ZP,{beforeElement:(0,C.jsx)(uo.Wx,{rose:i===h.tf.CALLBACK,children:(0,C.jsx)(G.mm,{size:uo.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),z(!0)},uuid:"AddNewBlocks/".concat(f),children:[(0,Q.kC)(f)," block"]})})})})]})},Lo=t(26084);function Fo(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?Fo(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ho=[{Icon:G.AQ,name:"Callbacks",uuid:Lo.Q.CALLBACK},{Icon:G.hW,name:"Conditionals",uuid:Lo.Q.CONDITIONAL}];var zo=function(e){var n=(0,Bo.Z)({},e),t=(0,p.useRouter)(),i=(0,s.useState)(null),o=i[0],r=i[1];(0,s.useEffect)((function(){var e;r(null===(e=(0,po.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,s.useMemo)((function(){var e,t;if(Lo.Q.CALLBACK===o)e={addOnBlockType:h.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,displayBlockName:"callback"};else if(Lo.Q.CONDITIONAL===o){var i;e={addOnBlockType:h.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,displayBlockName:"conditional"}}if(e)return(0,C.jsx)(No,Uo(Uo({},e),n))}),[n,o]);return(0,C.jsx)(D.W,{backend:B.PD,children:(0,C.jsxs)(Z.Z,{p:O.cd,children:[l,!o&&(null===Ho||void 0===Ho?void 0:Ho.map((function(e,n){var t=e.name,i=e.uuid,o=e.Icon;return(0,C.jsx)(Z.Z,{mt:n>=1?O.cd:0,children:(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,Kn.u7)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,C.jsx)(Qn.Z,{dark:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Te.Z,{fullWidth:!1,children:(0,C.jsx)(Z.Z,{p:O.cd,children:(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)(o,{fill:"#885EFF",size:2*O.iI})})})}),(0,C.jsx)(Z.Z,{mr:O.cd}),(0,C.jsx)(j.Z,{flexDirection:"column",children:(0,C.jsx)(P.ZP,{bold:!0,children:t})})]}),(0,C.jsx)(G._Q,{})]})})})},i)})))]})})};function Wo(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 Go(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Wo(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Wo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ko=function(e){var n=e.activeView,t=e.addNewBlockAtIndex,i=e.afterWidth,o=e.autocompleteItems,l=e.blockInteractionsMapping,u=e.blockRefs,c=e.blocks,a=e.blocksInNotebook,d=e.cancelPipeline,p=e.chartRefs,v=e.checkIfPipelineRunning,h=e.containerHeightOffset,m=e.contentByBlockUUID,b=e.createInteraction,g=e.deleteBlock,x=e.deleteWidget,j=e.editingBlock,k=e.executePipeline,w=e.fetchFileTree,_=e.fetchPipeline,S=e.fetchSecrets,I=e.fetchVariables,E=e.globalDataProducts,M=e.globalVariables,D=e.insights,B=e.interactions,A=e.interactionsMapping,R=e.interruptKernel,N=e.isLoadingCreateInteraction,L=e.isLoadingUpdatePipelineInteraction,U=e.isPipelineExecuting,H=e.lastTerminalMessage,z=e.messages,W=e.metadata,K=e.onChangeCallbackBlock,V=e.onChangeChartBlock,q=e.onChangeCodeBlock,Y=e.onSelectBlockFile,Q=e.onUpdateFileSuccess,X=e.permissions,J=e.pipeline,$=e.pipelineInteraction,ee=e.pipelineMessages,ne=e.project,te=e.refAfterFooter,ie=e.runBlock,oe=e.runningBlocks,re=e.sampleData,le=e.savePipelineContent,ue=e.savePipelineInteraction,ce=e.secrets,ae=e.selectedBlock,se=e.selectedFilePath,de=e.sendTerminalMessage,pe=e.setAllowCodeBlockShortcuts,fe=e.setAnyInputFocused,ve=e.setBlockInteractionsMapping,he=e.setDepGraphZoom,xe=e.setDisableShortcuts,je=e.setEditingBlock,ye=e.setErrors,ke=e.setHiddenBlocks,Ze=e.setInteractionsMapping,Pe=e.setPermissions,Oe=e.setSelectedBlock,we=e.setTextareaFocused,Ce=e.showBrowseTemplates,Se=e.showDataIntegrationModal,Ie=e.showUpdateBlockModal,Ee=e.statistics,Te=e.textareaFocused,Me=e.treeRef,De=e.updatePipelineInteraction,Be=e.updateWidget,Ae=e.widgets,Re=(0,xn.i)().height,Ne=si.uX,Le=(0,s.useState)([]),Fe=Le[0],Ue=Le[1],ze=(0,s.useState)(!!(0,gn.U2)(gn.Q9)),We=ze[0],Ge=ze[1],Ke=(0,s.useMemo)((function(){return i-(Do.k1+1)}),[i]),Ve=(0,s.useMemo)((function(){var e;return!(null===ne||void 0===ne||null===(e=ne.features)||void 0===e||!e[ni.d.INTERACTIONS])}),[null===ne||void 0===ne?void 0:ne.features]),qe=((null===j||void 0===j?void 0:j.upstreamBlocks)||{}).block,Ye=((null===re||void 0===re?void 0:re.columns)||[]).slice(0,100),Qe=(0,s.useMemo)((function(){return(null===re||void 0===re?void 0:re.rows)||[]}),[re]),Xe=(0,s.useMemo)((function(){return(null===W||void 0===W?void 0:W.column_types)||{}}),[W]),Je=(0,s.useMemo)((function(){return(null===D||void 0===D?void 0:D[1])||{}}),[D]),$e=(0,s.useMemo)((function(){return(0,_e.HK)((null===D||void 0===D?void 0:D[0])||[],(function(e){return e.feature.uuid}))}),[D]),en=!!re,nn=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===J||void 0===J?void 0:J.type)}),[J]),tn=F.qL.STREAMING!==(null===J||void 0===J?void 0:J.type)?-70:We?-16:300,on=(0,s.useCallback)((0,Pi.Fk)({columnTypes:Xe,columns:Ye,insightsByFeatureUUID:$e,insightsOverview:Je,noColumnLinks:!0,statistics:Ee}),[Xe,Ye,$e,Je,Ee]),rn=(0,s.useMemo)((function(){return(0,C.jsx)(ko,{blocks:c,fetchVariables:I,pipeline:J,selectedBlock:ae,setErrorMessages:Ue,variables:M,width:Ke})}),[Ke,c,I,M,J,ae]),ln=(0,s.useMemo)((function(){return(0,C.jsx)(bo.Z,{onActionCallback:Q,selectedBlock:ae,selectedFilePath:se,setErrors:ye,width:Ke>He.nn?Ke-He.nn:Ke})}),[Ke,Q,ae,se,ye]),un=(0,s.useMemo)((function(){return(0,C.jsx)(To,{fetchSecrets:S,pipelineUUID:null===J||void 0===J?void 0:J.uuid,secrets:ce,setErrorMessages:Ue,width:Ke})}),[Ke,S,J,ce]),cn=(0,s.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:o,blockRefs:u,blocks:c,blocksInNotebook:a,deleteBlock:g,fetchFileTree:w,fetchPipeline:_,interruptKernel:R,messages:z,onChangeCallbackBlock:K,onChangeCodeBlock:q,onSelectBlockFile:Y,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:ae,setAnyInputFocused:fe,setErrors:ye,setHiddenBlocks:ke,setSelectedBlock:Oe,setTextareaFocused:we,showBrowseTemplates:Ce,textareaFocused:Te}}),[t,o,u,c,a,g,w,_,R,z,K,q,Y,J,ie,oe,le,ae,fe,ye,ke,Oe,we,Ce,Te]),an=(0,s.useMemo)((function(){return Ye.length>0&&(0,C.jsx)(me.Z,{columnHeaderHeight:(0,ge.Qr)(Xe)&&(0,ge.Qr)($e)&&(0,ge.Qr)(Je)?0:be.Eh,columns:Ye,height:Re-Ne-si.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:on,rows:Qe,width:Ke})}),[Ke,Xe,Ye,Ne,Re,$e,Je,on,Qe]),sn=(0,s.useMemo)((function(){return Ae.length>0&&(0,C.jsx)(Ji,{autocompleteItems:o,blockRefs:u,blocks:c,chartRefs:p,deleteWidget:x,fetchFileTree:w,fetchPipeline:_,messages:z,onChangeChartBlock:V,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:ae,setAnyInputFocused:fe,setErrors:ye,setSelectedBlock:Oe,setTextareaFocused:we,textareaFocused:Te,updateWidget:Be,widgets:Ae,width:Ke})}),[Ke,o,u,c,p,x,w,_,z,V,J,ie,oe,le,ae,fe,ye,Oe,we,Te,Be,Ae]),dn=(0,s.useMemo)((function(){return(0,C.jsx)("div",{style:{height:"100%",position:"relative",width:Ke},children:(0,C.jsx)(Mo.Z,{lastMessage:H,onFocus:function(){return Oe(null)},sendMessage:de,width:Ke})})}),[Ke,H,de,Oe]),pn=(0,s.useMemo)((function(){return(0,C.jsx)(mo,Go({},cn))}),[cn]),fn=(0,s.useMemo)((function(){return(0,C.jsx)(zo,Go({},cn))}),[cn]),vn=(0,s.useMemo)((function(){return J&&ae&&(0,C.jsx)(Ni,{block:ae,contentByBlockUUID:m,fetchFileTree:w,fetchPipeline:_,globalDataProducts:E,pipeline:J,setSelectedBlock:Oe,showDataIntegrationModal:Se,showUpdateBlockModal:Ie})}),[m,w,_,E,J,ae,Oe,Se,Ie]);return(0,C.jsxs)(C.Fragment,{children:[(null===Fe||void 0===Fe?void 0:Fe.length)>=1&&(0,C.jsxs)(Z.Z,{mb:3,mt:2,mx:2,children:[(0,C.jsxs)(y.ZP,{justifyContent:"space-between",children:[(0,C.jsx)(P.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,C.jsx)(T.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return Ue([])},transparent:!0,children:(0,C.jsx)(G.x8,{muted:!0})})]}),null===Fe||void 0===Fe?void 0:Fe.map((function(e){return(0,C.jsx)(Z.Z,{pb:1,children:(0,C.jsx)(P.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,C.jsxs)(be.t0,{fullWidth:!0,heightOffset:Xt.cH.TERMINAL===n||n===Xt.cH.TREE?0:h||He.nn,onBlur:function(){se||xe(!1),null===pe||void 0===pe||pe(!1)},onFocus:function(){xe(!0),n===Xt.cH.TREE&&(null===pe||void 0===pe||pe(!0))},overflowHidden:n===Xt.cH.TREE,children:[n===Xt.cH.TREE&&(0,C.jsx)(f.Z,{uuid:"PipelineDetail/".concat(null===J||void 0===J?void 0:J.uuid),children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)($i.Z,{blockRefs:u,blocks:c,editingBlock:j,enablePorts:!nn,fetchPipeline:_,height:Re-(Ne-He.nn)-tn,messages:z,onClickNode:function(e){var n=e.block.uuid;return ke((function(e){var t=!(null===e||void 0===e||!e[n]);return t?Go(Go({},e),{},(0,r.Z)({},n,!t)):e}))},pipeline:J,runningBlocks:oe,selectedBlock:ae,setEditingBlock:je,setErrors:ye,setSelectedBlock:Oe,setZoom:he,treeRef:Me}),!qe&&F.qL.STREAMING===(null===J||void 0===J?void 0:J.type)&&(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsx)(Io,{cancelPipeline:d,checkIfPipelineRunning:v,executePipeline:k,isPipelineExecuting:U,pipelineExecutionHidden:We,pipelineMessages:ee,setPipelineExecutionHidden:Ge})})]})}),n===Xt.cH.DATA&&an,Xt.cH.SECRETS===n&&un,Xt.cH.VARIABLES===n&&rn,Xt.cH.FILE_VERSIONS===n&&(0,C.jsx)(f.Z,{uuid:"FileVersions/".concat(se?decodeURIComponent(se):""),children:ln}),nn||ae&&en||!ae&&en&&n===Xt.cH.DATA?null:Xt.du.includes(n)&&(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:Xt.fp,verticalHeightOffset:Ne,width:Ke,children:(0,C.jsx)(P.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:ae?!en&&"No data or insights available":"Select a block for insights"})}),Xt.cH.CHARTS===n&&(Ae.length>0?sn:(0,C.jsxs)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:Xt.fp,verticalHeightOffset:Ne,width:Ke,children:[(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(y.ZP,{flexDirection:"row",children:(0,C.jsxs)(P.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon \xa0",(0,C.jsx)(G.GQ,{size:1.5*O.iI}),"\xa0in",(0,C.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,C.jsx)(Z.Z,{mt:O.cd,px:1,children:(0,C.jsx)(no,{size:40*O.iI})})]})),Xt.cH.TERMINAL===n&&dn,Xt.cH.EXTENSIONS===n&&pn,Xt.cH.ADDON_BLOCKS===n&&fn,Xt.cH.BLOCK_SETTINGS===n&&(ae?vn:(0,C.jsx)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:Xt.fp,verticalHeightOffset:Ne,width:Ke,children:(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(y.ZP,{flexDirection:"row",children:(0,C.jsxs)(P.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon \xa0",(0,C.jsx)(G.JG,{size:1.5*O.iI}),"\xa0",(0,C.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})})),Xt.cH.INTERACTIONS===n&&Ve&&(0,C.jsx)(Eo.Z,{containerWidth:Ke,createInteraction:function(e){return b({interaction:e})},blockInteractionsMapping:l,interactions:B,interactionsMapping:A,isLoadingCreateInteraction:N,isLoadingUpdatePipelineInteraction:L,permissions:X,pipeline:J,pipelineInteraction:$,refAfterFooter:te,savePipelineInteraction:ue,selectedBlock:ae,setBlockInteractionsMapping:ve,setInteractionsMapping:Ze,setPermissions:Pe,setSelectedBlock:Oe,updatePipelineInteraction:function(e){return De({pipeline_interaction:e})}})]})]})},Vo=t(21978);function qo(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 Yo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?qo(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Qo=function(e){var n,t=e.activeView,i=e.depGraphZoom,o=e.pipeline,r=e.project,l=e.secrets,u=e.selectedBlock,c=e.setSelectedBlock,a=e.treeRef,d=e.variables,p=null===o||void 0===o?void 0:o.uuid,f=(0,po.iV)(),v=(0,yo.wx)(d,(function(e){return e.uuid===xo.C})),h=(0,Xt.Qq)({project:r})[t],m=(null===h||void 0===h||null===(n=h.buildLabel)||void 0===n?void 0:n.call(h,{pipeline:o,secrets:l,variables:v}))||(null===h||void 0===h?void 0:h.label);Xt.cH.BLOCK_SETTINGS===t&&null!==u&&void 0!==u&&u.uuid&&(m=(0,C.jsxs)(C.Fragment,{children:["Block settings for ",(0,C.jsx)(P.ZP,{bold:!0,color:(0,w.qn)(null===u||void 0===u?void 0:u.type).accent,inline:!0,monospace:!0,children:null===u||void 0===u?void 0:u.uuid})]}));var b=(0,C.jsx)(P.ZP,{bold:!0,children:m}),g=Xt.cH.EXTENSIONS===t&&(null===f||void 0===f?void 0:f.extension),x=W.ZP.extension_options.list({},{},{pauseFetch:!g}).data,O=(0,s.useMemo)((function(){return(null===x||void 0===x?void 0:x.extension_options)||[]}),[x]),_=(0,s.useMemo)((function(){return(0,_e.HK)(O,(function(e){return e.uuid}))}),[O]),S=Xt.cH.ADDON_BLOCKS===t&&(null===f||void 0===f?void 0:f.addon);if(Xt.cH.INTERACTIONS===t){var I=[];null!==u&&void 0!==u&&u.uuid?I.push.apply(I,[{label:function(){return"All interactions"},monospace:!1,onClick:function(){return c(null)}},{bold:!0,label:function(){return null===u||void 0===u?void 0:u.uuid},monospace:!0}]):I.push({bold:!0,label:function(){return"Interactions"},monospace:!1}),b=(0,C.jsx)(te.Z,{breadcrumbs:I,noMarginLeft:!0})}else{if(!t)return(0,C.jsx)("div",{});if(a&&Xt.cH.TREE===t)b=(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[b,(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(T.Z,Yo(Yo({},Vo.Ai),{},{onClick:function(){var e,n;null===a||void 0===a||null===(e=a.current)||void 0===e||null===(n=e.zoomIn)||void 0===n||n.call(e)},children:(0,C.jsx)(P.ZP,{noWrapping:!0,children:"Zoom in"})})),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(T.Z,Yo(Yo({},Vo.Ai),{},{onClick:function(){var e,n;null===a||void 0===a||null===(e=a.current)||void 0===e||null===(n=e.zoomOut)||void 0===n||n.call(e)},children:(0,C.jsx)(P.ZP,{noWrapping:!0,children:"Zoom out"})})),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Ze.Z,{appearAbove:!0,appearBefore:!0,default:!0,label:"Shortcut: Double-click canvas",lightBackground:!0,size:null,widthFitContent:!0,children:(0,C.jsx)(T.Z,Yo(Yo({},Vo.Ai),{},{onClick:function(){var e,n;null===a||void 0===a||null===(e=a.current)||void 0===e||null===(n=e.fitCanvas)||void 0===n||n.call(e)},children:(0,C.jsx)(P.ZP,{noWrapping:!0,children:"Reset"})}))}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(P.ZP,{bold:!0,children:[null===i||void 0===i?void 0:i.toFixed(2),"x"]})]})]});else if(g){var E=_[null===f||void 0===f?void 0:f.extension];b=(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)($n(),{as:"/pipelines/".concat(p,"/edit?").concat(Xt.uM,"=").concat(Xt.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,C.jsx)(k.Z,{default:!0,children:m})}),(0,C.jsx)(P.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,C.jsx)(P.ZP,{bold:!0,children:null===E||void 0===E?void 0:E.name})]})}else S&&(b=(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)($n(),{as:"/pipelines/".concat(p,"/edit?").concat(Xt.uM,"=").concat(Xt.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,C.jsx)(k.Z,{default:!0,children:m})}),(0,C.jsx)(P.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,C.jsx)(P.ZP,{bold:!0,children:(0,Q.vg)(null===f||void 0===f?void 0:f.addon)})]}))}return(0,C.jsx)(si.ym,{children:b})},Xo=t(65044),Jo=t(78419),$o=t(46684),er=t(32929),nr=t(11498),tr=t(28795),ir=t(85010);function or(e){var n=e.activeView,t=e.pipeline,i=e.project,o=e.secrets,r=e.setActiveSidekickView,l=e.variables,u=(0,yo.wx)(l,(function(e){return e.uuid===xo.C}));return(0,Xt.j5)({project:i}).map((function(e){var i=e.buildLabel,l=e.key,c=e.label;return{Icon:Xt.Z7[l],id:l,isSelected:function(){return n===l},label:function(){return(null===i||void 0===i?void 0:i({pipeline:t,secrets:o,variables:u}))||c},onClick:function(){return r(l,!0)}}}))}var rr=t(74052),lr=t(53005),ur=t(4383),cr=t(70320),ar=t(3917);function sr(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 dr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?sr(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function pr(e){var n,t,i,u,c,m,b,g,x,j,k,P,w,_,S,D=e.page,B=e.pipeline,A=(0,p.useRouter)(),R=(0,xn.i)().height,L=A.query.pipeline,U=B.uuid||L,H=(0,s.useState)(!!(0,gn.U2)(gn.zg)),z=H[0],K=H[1],V=(0,s.useState)(null),q=V[0],$=V[1],ee=(0,s.useState)(null),te=ee[0],ie=ee[1],oe=(0,s.useState)(null),re=oe[0],le=oe[1],ue=(0,s.useState)(null),ce=ue[0],ae=ue[1],se=(0,s.useState)(null),de=se[0],pe=se[1],fe=(0,s.useState)([]),ve=fe[0],he=fe[1],me=(0,s.useState)({}),be=me[0],xe=me[1],je=(0,s.useState)(!1),ye=je[0],ke=je[1],Ze=(0,s.useState)(!1),Pe=Ze[0],Oe=Ze[1],we=(0,s.useState)(!1),Ce=we[0],Se=we[1],Ie=(0,s.useState)(!1),Ee=Ie[0],Te=Ie[1],Me=(0,s.useState)(1),De=Me[0],Be=Me[1],Ae=W.ZP.projects.list(),Re=Ae.data,Ne=Ae.mutate,Le=(0,s.useMemo)((function(){var e;return null===Re||void 0===Re||null===(e=Re.projects)||void 0===e?void 0:e[0]}),[Re]),Fe=((0,s.useMemo)((function(){var e;return(0,cr.h)(null===Le||void 0===Le||null===(e=Le.features)||void 0===e?void 0:e[ni.d.LOCAL_TIMEZONE])}),[null===Le||void 0===Le?void 0:Le.features]),(0,s.useMemo)((function(){var e;return!(null===Le||void 0===Le||null===(e=Le.features)||void 0===e||!e[ni.d.INTERACTIONS])}),[null===Le||void 0===Le?void 0:Le.features])),Ue="".concat(Jo.H8,"_").concat(U),He=(0,gn.U2)(Ue),ze=(0,s.useState)((0,_e.sE)(di.NR,(function(e){return e.uuid===He}))||di.NR[0]),We=ze[0],Ge=ze[1],Ke=(0,s.useCallback)((function(e){Ge(e),(0,gn.t8)(Ue,null===e||void 0===e?void 0:e.uuid)}),[Ue,Ge]),Ve="".concat(Jo.g6,"_").concat(U),qe=(0,s.useState)({}),Ye=qe[0],Qe=qe[1],Xe=(0,s.useCallback)((function(e){Qe((function(n){var t=e(n);return(0,gn.t8)(Ve,JSON.stringify(t)),t}))}),[Ve,Qe]);(0,s.useEffect)((function(){var e=(0,gn.U2)(Ve);e&&(0,Q.Pb)(e)&&Qe(JSON.parse(e))}),[Ve,Qe]);var Je,$e=(0,s.useRef)(null),en=W.ZP.statuses.list({},{revalidateOnFocus:!1}).data,nn=(0,s.useMemo)((function(){var e,n;return null===en||void 0===en||null===(e=en.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.disable_pipeline_edit_access}),[en]),tn=(0,s.useMemo)((function(){var e,n;return null===en||void 0===en||null===(e=en.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.max_print_output_lines}),[en]),on=(0,s.useState)({}),rn=on[0],ln=on[1],un=(0,s.useState)([]),cn=un[0],an=un[1],sn=W.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),dn=sn.data,pn=sn.mutate,fn=null===dn||void 0===dn?void 0:dn.kernels,vn=(null===fn||void 0===fn?void 0:fn.find((function(e){var n;return e.name===F.a_[null===(n=Je)||void 0===n?void 0:n.type]})))||(null===fn||void 0===fn?void 0:fn[0]),hn=(0,Wn.Z)(U),mn=W.ZP.pipelines.detail(U,{include_block_pipelines:!0,includes_outputs:(0,ge.Qr)(rn)||"undefined"===typeof Je||null===Je||"undefined"===typeof(null===(n=Je)||void 0===n?void 0:n.blocks)||null===(null===(t=Je)||void 0===t?void 0:t.blocks)||!(null===(i=Je)||void 0===i||null===(u=i.blocks)||void 0===u||!u.find((function(e){return"undefined"===typeof e.ouputs})))},{refreshInterval:6e4},{key:"/pipelines/".concat(U,"/edit")}),bn=mn.data,jn=mn.mutate,yn=W.ZP.pipeline_interactions.detail(Fe&&U),kn=yn.data,wn=yn.mutate,Cn=W.ZP.interactions.pipeline_interactions.list(Fe&&U),_n=Cn.data,Sn=Cn.mutate,In=(0,s.useMemo)((function(){return(null===kn||void 0===kn?void 0:kn.pipeline_interaction)||{}}),[kn]),En=(0,s.useMemo)((function(){return(null===_n||void 0===_n?void 0:_n.interactions)||{}}),[_n]),Tn=(0,d.Db)(W.ZP.pipeline_interactions.useUpdate(U),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){wn()}})}}),Mn=(0,l.Z)(Tn,2),Dn=Mn[0],Bn=Mn[1].isLoading,Un=(0,d.Db)(W.ZP.interactions.pipeline_interactions.useCreate(U),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){Sn(),wn()}})}}),Hn=(0,l.Z)(Un,2),Xn=Hn[0],Jn=Hn[1].isLoading,$n=W.ZP.files.list(),et=$n.data,nt=$n.mutate,tt=(0,s.useMemo)((function(){return(null===et||void 0===et?void 0:et.files)||[]}),[et]);Je=(0,s.useMemo)((function(){return null===bn||void 0===bn?void 0:bn.pipeline}),[bn]);var it=(0,s.useMemo)((function(){var e;return F.qL.INTEGRATION===(null===(e=Je)||void 0===e?void 0:e.type)}),[Je]),ot=(0,s.useState)(null),rt=ot[0],lt=ot[1],ut=(0,s.useState)((0,ar.Tz)({dateObj:!0})),ct=ut[0],at=ut[1],st=(0,s.useState)(!1),dt=st[0],pt=st[1],ft=(0,Vn.dd)((function(){return(0,C.jsx)(zn.Z,{centerOnScreen:!0,neutral:!0,onClick:mt,subtitle:"Please refresh your page to have the most up-to-date data before making any changes.",title:"Your pipeline may be stale.",width:34*O.iI})}),{},[],{background:!0,uuid:"stale_pipeline_message"}),vt=(0,l.Z)(ft,2),ht=vt[0],mt=vt[1];(0,s.useEffect)((function(){var e,n;null!==bn&&void 0!==bn&&null!==(e=bn.pipeline)&&void 0!==e&&e.updated_at&&(null===rt||void 0===rt?void 0:rt.toISOString())!==new Date(null===bn||void 0===bn||null===(n=bn.pipeline)||void 0===n?void 0:n.updated_at).toISOString()&<(new Date(bn.pipeline.updated_at)),rt&&Number(rt)>Number(ct)&&ht()}),[null===bn||void 0===bn||null===(c=bn.pipeline)||void 0===c?void 0:c.updated_at,rt,ct,ht]);var bt=(0,po.iV)(),gt=bt[Xt.uM],xt=bt.block_uuid,jt=bt.file_path,yt=(0,s.useMemo)((function(){var e=bt["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[bt]),kt=(0,s.useCallback)((function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2?arguments[2]:void 0,i=(0,r.Z)({},Xt.uM,e);null!==t&&void 0!==t&&t.addon&&(i.addon=null===t||void 0===t?void 0:t.addon),null!==t&&void 0!==t&&t.blockUUID&&(i.block_uuid=null===t||void 0===t?void 0:t.blockUUID),null!==t&&void 0!==t&&t.extension&&(i.extension=null===t||void 0===t?void 0:t.extension),(0,Kn.u7)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}),[]);(0,s.useEffect)((function(){gt||kt(Xt.cH.TREE,!1)}),[gt,kt]);var Zt=(0,s.useCallback)((function(e,n,t){K(!1),setTimeout((function(){return kt(e,n,t)}),1)}),[kt]),Pt=(0,s.useRef)({}),Ot=(0,s.useRef)({}),wt=(0,s.useRef)(null),Ct=(0,s.useRef)({}),_t=(0,s.useRef)({}),St=(0,s.useRef)({}),It=(0,s.useState)({}),Et=It[0],Tt=It[1],Mt=(0,s.useCallback)((function(e,n,t){var i=Ct.current||{};Ct.current=dr(dr({},i),{},(0,r.Z)({},e,dr(dr({},i[e]||{}),{},(0,r.Z)({},n,t))))}),[Ct]),Dt=(0,s.useCallback)((function(e,n,t){var i=_t.current||{};_t.current=dr(dr({},i),{},(0,r.Z)({},e,dr(dr({},i[e]||{}),{},(0,r.Z)({},n,t))))}),[_t]),Bt=(0,s.useCallback)((function(e,n,t){Mt(e,n,t),pt(!0)}),[Mt,pt]),At=(0,s.useCallback)((function(e,n,t){Dt(e,n,t),pt(!0)}),[Dt,pt]),Rt=(0,s.useCallback)((function(e){St.current=dr(dr({},St.current),e)}),[St]),Nt=(0,s.useCallback)((function(e,n){Rt((0,r.Z)({},e,n)),pt(!0)}),[Rt,pt]),Lt=(0,s.useState)(null),Ft=Lt[0],Ut=Lt[1],Ht=W.ZP.data_providers.list({},{revalidateOnFocus:!1}).data,zt=null===Ht||void 0===Ht?void 0:Ht.data_providers;(0,s.useEffect)((function(){var e=bn;null!==bn&&void 0!==bn&&bn.hasOwnProperty("error")||null===Ht||void 0===Ht||!Ht.hasOwnProperty("error")||(e=Ht),(0,X.bB)(e,le)}),[bn,Ht]);var Wt=W.ZP.variables.pipelines.list(U,{global_only:!0},{revalidateOnFocus:!1}),Gt=Wt.data,Kt=Wt.mutate,Vt=null===Gt||void 0===Gt?void 0:Gt.variables,qt=W.ZP.secrets.list({},{revalidateOnFocus:!1}),Yt=qt.data,Qt=qt.mutate,Jt=null===Yt||void 0===Yt?void 0:Yt.secrets,$t=(0,s.useState)([]),ei=$t[0],ti=$t[1],ii=(0,s.useState)([]),oi=ii[0],ri=ii[1],li=(0,s.useRef)({}),ci=(0,s.useCallback)((function(e){var n;pt(!0);var t=li.current[e.uuid]||{},i=t.upstream_blocks;(null===e||void 0===e||null===(n=e.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(i=e.upstream_blocks),li.current[e.uuid]=dr(dr(dr({},t),e),{},{configuration:dr(dr({},t.configuration),e.configuration),upstream_blocks:i})}),[pt,li]),ai=(0,s.useState)(!1),si=ai[0],pi=ai[1],fi=(0,s.useState)({upstreamBlocks:null}),mi=fi[0],bi=fi[1],gi=(0,s.useState)([]),xi=gi[0],ji=gi[1],yi=(0,s.useState)(null),ki=yi[0],Zi=yi[1],Pi=(0,rr.Dp)(U),Oi=(0,rr.Q9)(Pi,ei),wi=(0,s.useState)(Oi),Ci=wi[0],_i=wi[1],Si=(0,s.useState)(),Ii=Si[0],Ei=Si[1],Ti=(0,s.useState)(),Mi=Ti[0],Di=Ti[1],Bi=(0,s.useState)(null),Ai=Bi[0],Ri=Bi[1],Ni=(0,Wn.Z)(Ci),Li=(0,s.useCallback)((function(){bi({upstreamBlocks:{block:null,values:[]}}),ln({}),pt(!1),ji([]),Zi(null)}),[]);(0,s.useEffect)((function(){U!==hn&&(Ct.current={},_t.current={})}),[U,hn]);var Fi=W.ZP.block_outputs.detail(!z&&(null===Ai||void 0===Ai?void 0:Ai.type)!==h.tf.SCRATCHPAD&&(null===Ai||void 0===Ai?void 0:Ai.type)!==h.tf.CHART&&null!==Ai&&void 0!==Ai&&Ai.uuid?encodeURIComponent(null===Ai||void 0===Ai?void 0:Ai.uuid):null,{pipeline_uuid:U}),Ui=Fi.data,Hi=Fi.mutate,zi=(0,s.useMemo)((function(){return null===Ui||void 0===Ui?void 0:Ui.block_output}),[Ui]),Wi=(0,s.useMemo)((function(){var e,n,t;return it?null===(e=(0,_e.sE)(null===zi||void 0===zi?void 0:zi.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,Q.kE)(Mi))})))||void 0===e?void 0:e.sample_data:null===zi||void 0===zi||null===(n=zi.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[zi,it,Mi]),Gi=W.ZP.blocks.pipelines.analyses.detail(z?null:U,(null===Ai||void 0===Ai?void 0:Ai.type)!==h.tf.SCRATCHPAD&&(null===Ai||void 0===Ai?void 0:Ai.type)!==h.tf.CHART&&(null===Ai||void 0===Ai?void 0:Ai.uuid)&&encodeURIComponent(null===Ai||void 0===Ai?void 0:Ai.uuid)),Ki=Gi.data,Vi=Gi.mutate,qi=(null===Ki||void 0===Ki||null===(m=Ki.analyses)||void 0===m?void 0:m[0])||{},Yi=qi.insights,Qi=void 0===Yi?{}:Yi,Xi=qi.metadata,Ji=void 0===Xi?{}:Xi,$i=qi.statistics,eo=void 0===$i?{}:$i;(0,s.useEffect)((function(){0===xi.length&&(Vi(),Hi(),Kt())}),[Vi,Hi,Kt,xi]),(0,s.useEffect)((function(){if(0===Ci.length)Ri(null);else if((null===Ni||void 0===Ni?void 0:Ni.length)!==(null===Ci||void 0===Ci?void 0:Ci.length)&&(null===Ci||void 0===Ci?void 0:Ci.length)<(null===Ni||void 0===Ni?void 0:Ni.length)){var e=Ni.findIndex((function(e){return e.uuid===(null===Ai||void 0===Ai?void 0:Ai.uuid)})),n=Ni.length-1===e?e-1:e+1;Ri(Ni[Math.max(0,n)])}}),[Ci,Ni,null===Ai||void 0===Ai?void 0:Ai.uuid]),(0,s.useEffect)((function(){var e;null!==(e=mi.upstreamBlocks)&&void 0!==e&&e.block&&(K(!1),kt(Xt.cH.TREE))}),[mi.upstreamBlocks,kt]);var no=W.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!1}),to=no.data,io=no.mutate,oo=null===to||void 0===to?void 0:to.autocomplete_items;(0,s.useEffect)((function(){jt||Se(!1),pe(jt)}),[jt]),(0,s.useEffect)((function(){(0,_e.fS)(yt,ve)||he(yt)}),[yt,ve]);var ro=(0,d.Db)(W.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.pipeline.uuid;A.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),nt()},onErrorCallback:function(e,n){return ie({errors:n,response:e})}})}}),lo=(0,l.Z)(ro,1)[0],uo=(0,d.Db)(W.ZP.pipelines.useUpdate(U,{update_content:!0}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){pt(!1),jn(),nt()},onErrorCallback:function(e,n){return ie({errors:n,response:e})}})}}),co=(0,l.Z)(uo,2),ao=co[0],so=co[1].isLoading,fo=(0,s.useState)({}),vo=fo[0],ho=fo[1],mo=(0,s.useCallback)((function(e,n){var t,i=e||{},o=i.block,r=i.pipeline,u=void 0===r?{extensions:{}}:r,c=(n||{}).contentOnly;if(!(rt&&Number(rt)>Number(ct))){var a=(0,ar.Tz)({dateObj:!0}),s=(0,ar.Tz)();at(a);var d={},p={},f={},v={};((null===u||void 0===u?void 0:u.blocks)||ei).forEach((function(e){var n,t,i,r=e.extension_uuid,u=e.type,a=e.uuid,s=null===(n=_t.current[u])||void 0===n?void 0:n[a];"undefined"===typeof s&&(s=e.content);var m=null===(t=Ct.current[u])||void 0===t?void 0:t[a];"undefined"===typeof m&&(m=e.callback_content);var b=null,g=null===(i=rn[a])||void 0===i?void 0:i.filter((function(e){return!!e})),x=null===g||void 0===g?void 0:g.find((function(e){return e.error}));if(g){var j=[],y=0;g.forEach((function(n){var t=n.data,i=n.type;(h.tf.SCRATCHPAD===e.type||x||"table"!==i&&null!==vo&&void 0!==vo&&vo[null===e||void 0===e?void 0:e.uuid])&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(Xo.Lz)?e:e.concat(n)}),[]),i===Yn.Gi.TEXT_PLAIN&&(y+=(null===t||void 0===t?void 0:t.length)||0)),(!tn||y<tn+5)&&j.push(n))})),b=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"output_".concat(n)}}))}var k=dr(dr({},e),{},{callback_content:m,content:s});null===b?delete k.outputs:k.outputs=b,(null===o||void 0===o?void 0:o.uuid)===a&&Object.entries(o).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],o=n[1];k[t]||(k[t]={}),k[t][i]=o})):k[t]=i})),c?p[k.uuid]={callback_content:k.callback_content,content:k.content,outputs:k.outputs,uuid:k.uuid}:[h.tf.EXTENSION].includes(u)?(d[r]||(d[r]=[]),d[r].push(k)):h.tf.CALLBACK===u?f[k.uuid]=k:h.tf.CONDITIONAL===u?v[k.uuid]=k:p[k.uuid]=k}));var m=dr(dr({},null===(t=Je)||void 0===t?void 0:t.extensions),null===u||void 0===u?void 0:u.extensions);Object.entries(d).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];m[t]||(m[t]={}),m[t].blocks=i}));var b=[],g=[],x=[];return((null===u||void 0===u?void 0:u.blocks)||ei).forEach((function(e){var n=e.uuid,t=p[n],i=f[n],o=v[n];"undefined"!==typeof t?b.push(t):"undefined"!==typeof i?g.push(i):"undefined"!==typeof o&&x.push(o)})),ho({}),ao({pipeline:dr(dr(dr({},Je),u),{},{blocks:b,callbacks:g,conditionals:x,extensions:m,updated_at:s,widgets:oi.map((function(e){var n,t,i=St.current[e.uuid],o=li.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var r=null===(n=rn[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),l=null===r||void 0===r?void 0:r.find((function(e){return e.error}));if(r){var u=[];r.forEach((function(n){var t=n.data,i=n.type;(h.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(Xo.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 dr(dr(dr({},e),o),{},{configuration:dr(dr({},e.configuration),o.configuration),content:i,outputs:t})}))})})}ht()}),[ei,tn,rn,vo,Je,rt,ct,ht,ao,oi]),bo=(0,s.useMemo)((function(){return(0,rr.Rz)(Je,{isPipelineUpdating:so,pipelineContentTouched:dt,pipelineLastSaved:rt})}),[so,Je,dt,rt]),go=(0,Vn.dd)((function(e){var n,t,i=e||{block:null,contentByBlockUUID:null},o=i.block,r=i.contentByBlockUUID,l=o||{type:null,uuid:null},u=l.type,c=l.uuid,a=dr({},o);r&&(a.content=null===r||void 0===r||null===(n=r.current)||void 0===n||null===(t=n[u])||void 0===t?void 0:t[c]);return(0,C.jsx)(J.BC,{children:(0,C.jsx)(Zn,dr(dr({},e),{},{block:a,onChangeCodeBlock:At,onClose:yo,pipeline:Je,savePipelineContent:mo}))})}),{},[At,Je,mo],{background:!0,disableClickOutside:!0,disableCloseButton:!0,disableEscape:!0,uuid:"DataIntegrationModal/".concat(U)}),xo=(0,l.Z)(go,2),jo=xo[0],yo=xo[1],ko=(0,s.useCallback)((function(e){mo();var n=encodeURIComponent(e),t=(0,po.iV)()["file_paths[]"]||[];Array.isArray(t)||(t=[t]),t.includes(n)||t.push(n),(0,Kn.u7)({file_path:n,"file_paths[]":t})}),[mo]),Zo=(0,s.useCallback)((function(e){var n=e||{},t=n.content,i=n.path,o=(0,lr.IO)(i,ei);if(o){var l=o.type,u=o.uuid;At(l,u,t),ti((function(e){var n=null===e||void 0===e?void 0:e.findIndex((function(e){var n=e.type,t=e.uuid;return n===l&&t===u}));return n>=0&&(e[n].content=t),e})),Tt((function(e){return dr(dr({},e),{},(0,r.Z)({},l,dr(dr({},null===e||void 0===e?void 0:e[l]),{},(0,r.Z)({},u,Number(new Date)))))})),jn()}}),[ei,jn,At]),Po=(0,s.useMemo)((function(){var e=[],n=[];return ei.forEach((function(t){h.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[ei]),Oo=Po.blocksInNotebook,wo=Po.blocksInSidekick,Co=(0,s.useCallback)((function(e,n){return mo({pipeline:{name:e,type:n}}).then((function(e){var t,i;if(null!==e&&void 0!==e&&null!==(t=e.data)&&void 0!==t&&t.pipeline){var o,r=e.data.pipeline.uuid;if(U!==r)window.location.href="".concat(A.basePath,"/pipelines/").concat(r,"/edit");else nt(),n!==(null===(o=Je)||void 0===o?void 0:o.type)&&jn(),(0,rr.k1)(Oo,U,r),(0,rr.k1)(wo,U,r)}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&ie((function(e){return dr(dr({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){ko("pipelines/".concat(U,"/").concat(Nn.dT.METADATA_YAML)),ie(null)}}]})}))}))}),[Oo,wo,nt,jn,ko,null===(b=Je)||void 0===b?void 0:b.type,U,A,mo]),_o=(0,s.useState)(null),So=_o[0],Io=_o[1],Eo=(0,s.useState)(null),To=Eo[0],Mo=Eo[1],Do=(0,s.useState)(null),Bo=Do[0],Ao=Do[1],Ro=(0,s.useCallback)((function(e){return Dn({pipeline_interaction:dr(dr({},In),{},{blocks:null!==e&&void 0!==e&&e.blockInteractionsMapping?null===e||void 0===e?void 0:e.blockInteractionsMapping:To,interactions:So,permissions:null===Bo||void 0===Bo?void 0:Bo.map((function(e){var n=e.roles,t=e.triggers;return{roles:null===n||void 0===n?void 0:n.map((function(e){return"string"===typeof e?e:null===e||void 0===e?void 0:e.role})),triggers:null===t||void 0===t?void 0:t.map((function(e){return{schedule_interval:e.schedule_interval,schedule_type:e.schedule_type}}))}}))})})}),[To,So,Bo,In,Dn]),No=(0,d.Db)((function(e){var n=e.type,t=e.extension_uuid,i=e.uuid,o={};return n&&(o.block_type=n),t&&(o.extension_uuid=t),W.ZP.blocks.pipelines.useDelete(U,encodeURIComponent(i),o)()}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;if(ti((function(e){return(0,_e.oM)(e,e.findIndex((function(e){var n=e.type,o=e.uuid;return t===n&&i===o})))})),jn(),Zi(null),t===h.tf.SCRATCHPAD&&nt(),Fe){var o=dr({},To);delete o[i],Ro({blockInteractionsMapping:o}).then((function(e){var n=e.pipeline_interaction;return Mo(null===n||void 0===n?void 0:n.blocks)}))}},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;ie({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&ln((function(e){return dr(dr({},e),{},(0,r.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Yn.Gi.TEXT_PLAIN}}))))}))}})}}),Lo=(0,l.Z)(No,1)[0],Fo=(0,d.Db)((function(e){var n=e.uuid;return W.ZP.widgets.pipelines.useDelete(U,n)()}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(e){var n=e.widget.uuid;ri((function(e){return(0,_e.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),jn(),nt()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;ie({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&ln((function(e){return dr(dr({},e),{},(0,r.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Yn.Gi.TEXT_PLAIN}}))))}))}})}}),Uo=(0,l.Z)(Fo,1)[0],Ho=(0,Vn.dd)((function(e){return(0,C.jsx)(zn.Z,{centerOnScreen:!0,neutral:!0,onCancel:Go,onClick:function(){return qo(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*O.iI})})),zo=(0,l.Z)(Ho,2),Wo=zo[0],Go=zo[1],Vo=(0,d.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,o="".concat(t,"/").concat(i);return n&&Nn.JD[n]&&(o="".concat(o,".").concat(Nn.JD[n].toLowerCase())),W.ZP.blocks.useDelete(encodeURIComponent(o))()}),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){io(),jn(),nt()},onErrorCallback:function(e,n){Wo(),ie({displayMessage:e.exception,errors:n,response:e})}})}}),qo=(0,l.Z)(Vo,1)[0],Yo=(0,d.Db)(W.ZP.kernels.useUpdate(null===vn||void 0===vn?void 0:vn.id),{onSuccess:function(e){return(0,X.wD)(e,{callback:function(){return pn()},onErrorCallback:function(e,n){return ie({errors:n,response:e})}})}}),sr=(0,l.Z)(Yo,1)[0],pr=(0,s.useCallback)((function(){return sr({kernel:{action_type:"restart"}})}),[sr]),fr=(0,s.useCallback)((function(){sr({kernel:{action_type:"interrupt"}}),ji([])}),[sr]),vr=(0,d.Db)(W.ZP.blocks.pipelines.useCreate(U)),hr=(0,l.Z)(vr,1)[0],mr=(0,s.useCallback)((function(e,n,t){var i,r,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,Q.Y6)();e.converted_from_type&&e.converted_from_uuid&&(i=null===(r=_t.current[e.converted_from_type])||void 0===r?void 0:r[e.converted_from_uuid]);var c=e.language,a=e.type;if(it){var s,d=(0,_e.HK)((null===(s=Je)||void 0===s?void 0:s.blocks)||[],(function(e){return e.type})),p=d[h.tf.DATA_EXPORTER],f=d[h.tf.DATA_LOADER],v=d[h.tf.TRANSFORMER];if(h.tf.DATA_LOADER===a){if(h.t6.YAML!==c)return void ie({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(h.t6.YAML," and not ").concat(c,".")});var m;if(f)return void ie({displayMessage:"Pipeline ".concat(null===(m=Je)||void 0===m?void 0:m.uuid," already has a source: ").concat(null===f||void 0===f?void 0:f.uuid,".")})}else if(h.tf.TRANSFORMER===a){var b;if(v)return void ie({displayMessage:"Pipeline ".concat(null===(b=Je)||void 0===b?void 0:b.uuid," already has a transformer: ").concat(null===v||void 0===v?void 0:v.uuid,".")})}else if(h.tf.DATA_EXPORTER===a){if(h.t6.YAML!==c)return void ie({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(h.t6.YAML," and not ").concat(c,".")});var g;if(p)return void ie({displayMessage:"Pipeline ".concat(null===(g=Je)||void 0===g?void 0:g.uuid," already has a destination: ").concat(null===p||void 0===p?void 0:p.uuid,".")})}}return hr({block:dr({content:i,name:u,priority:n,require_unique_name:!0},e)}).then((function(n){(0,X.wD)(n,{callback:function(){var e=n.data.block;null===t||void 0===t||t(e),nt(),jn().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;return ti((function(e){var n=(0,o.Z)(t);Object.entries(i||{}).forEach((function(e){var t=(0,l.Z)(e,2),i=t[0],r=t[1].blocks;r&&n.push.apply(n,(0,o.Z)(r.map((function(e){return dr(dr({},e),{},{extension_uuid:i})}))))}));var r=(0,_e.HK)(e,(function(e){return e.uuid})),u=[];return n.forEach((function(e){var n=r[e.uuid];n?u.push(n):u.push(e)})),u}))}))},onErrorCallback:function(n,t){var i,o=null===n||void 0===n||null===(i=n.error)||void 0===i?void 0:i.exception,r=(0,lr.u$)(dr(dr({},e),{},{name:u}));o&&r&&o.startsWith(di.LR)?ie((function(){return{errors:t,links:[{label:"View existing block file contents and optionally add to pipeline (if applicable).",onClick:function(){ko(r),ie(null)}}],response:n}})):ie({errors:t,response:n})}})}))}),[hr,nt,jn,it,ko,ti,ie,Je]),br=(0,Vn.dd)((function(e){var n=e.block,t=e.idx,i=e.isUpdatingBlock,o=void 0!==i&&i,r=e.name,l=void 0===r?(0,Q.Y6)():r,u=e.onCreateCallback,c=e.preventDuplicateBlockName;return(0,C.jsx)(J.BC,{children:(0,C.jsx)(ne,{block:n,defaultName:l,isUpdatingBlock:o,onClose:jr,onSave:function(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o?mo({block:{color:(null===i||void 0===i?void 0:i.color)||null,name:null===i||void 0===i?void 0:i.name,uuid:n.uuid},pipeline:{blocks:(null===(e=Je)||void 0===e?void 0:e.blocks)||[]}}).then((function(){Zi(null),jr()})):mr(dr(dr({},n),(0,ge.gR)(i,["name"])),t,u,null===i||void 0===i?void 0:i.name).then((function(){return jr()}))},pipeline:Je,preventDuplicateBlockName:c})})}),{},[mr,Je],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),gr=(0,l.Z)(br,2),xr=gr[0],jr=gr[1],yr=(0,Vn.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,o=e.onSaveSuccess;return(0,C.jsx)(J.BC,{children:(0,C.jsx)(hi.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),Pr()},onSaveSuccess:function(e){Ne(),Pr(),null===o||void 0===o||o(e)}})})}),{},[Ne],{background:!0,uuid:"configure_project"}),kr=(0,l.Z)(yr,2),Zr=kr[0],Pr=kr[1],Or=(0,d.Db)(W.ZP.widgets.pipelines.useCreate(U)),wr=(0,l.Z)(Or,1)[0],Cr=(0,s.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,Q.Y6)();return wr({widget:dr({name:i,priority:n,type:h.tf.CHART},e)}).then((function(e){return(0,X.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),nt(),jn(),kt(Xt.cH.CHARTS),ae(n)},onErrorCallback:function(e,n){return ie({errors:n,response:e})}})}))}),[nt,jn,wr,kt]);(0,s.useEffect)((function(){if(ce){var e,n=null===(e=Ot.current[ce.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),ae(null))}}),[ce,ae]),(0,s.useEffect)((function(){hn!==U&&(ti([]),ri([]),_i([]),an([]))}),[U,hn]),(0,s.useEffect)((function(){var e,n;if("undefined"!==typeof(null===(e=Je)||void 0===e?void 0:e.blocks)||"undefined"!==typeof(null===(n=Je)||void 0===n?void 0:n.extensions)){var t,i,r,u,c,a,s,d,p=[];if("undefined"!==typeof(null===(t=Je)||void 0===t?void 0:t.blocks))p.push.apply(p,(0,o.Z)(null===(c=Je)||void 0===c?void 0:c.blocks));if("undefined"!==typeof(null===(i=Je)||void 0===i?void 0:i.callbacks))p.push.apply(p,(0,o.Z)(null===(a=Je)||void 0===a?void 0:a.callbacks));if("undefined"!==typeof(null===(r=Je)||void 0===r?void 0:r.conditionals))p.push.apply(p,(0,o.Z)(null===(s=Je)||void 0===s?void 0:s.conditionals));if("undefined"!==typeof(null===(u=Je)||void 0===u?void 0:u.extensions))Object.entries((null===(d=Je)||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,o.Z)(i.map((function(e){return dr(dr({},e),{},{extension_uuid:t})}))))}));ti(p)}}),[null===(g=Je)||void 0===g?void 0:g.blocks,null===(x=Je)||void 0===x?void 0:x.callbacks,null===(j=Je)||void 0===j?void 0:j.conditionals,null===(k=Je)||void 0===k?void 0:k.extensions]),(0,s.useEffect)((function(){var e;"undefined"!==typeof(null===(e=Je)||void 0===e?void 0:e.widgets)&&ri(Je.widgets)}),[null===(P=Je)||void 0===P?void 0:P.widgets]),(0,s.useEffect)((function(){(null===Oi||void 0===Oi?void 0:Oi.length)>0&&0===(null===Ci||void 0===Ci?void 0:Ci.length)&&(_i(Oi),Ri(Oi[0]))}),[Ci,Oi]);var _r=(0,Wn.Z)(ei);(0,s.useEffect)((function(){var e;if("undefined"!==typeof(null===(e=Je)||void 0===e?void 0:e.blocks)&&(!ei.length||!(0,_e.fS)(null===_r||void 0===_r?void 0:_r.map((function(e){return e.uuid})).sort(),null===ei||void 0===ei?void 0:ei.map((function(e){return e.uuid})).sort())||(0,ge.Qr)(rn))){var n=(0,rr.Rt)(Je.blocks),t=n.content,i=n.messages;_t.current=t,(0,ge.Qr)(i)||ln((function(e){return dr(dr({},i),e)}))}}),[ei,_r,rn,null===(w=Je)||void 0===w?void 0:w.blocks,ln]),(0,s.useEffect)((function(){var e;if(!oi.length&&"undefined"!==typeof(null===(e=Je)||void 0===e?void 0:e.widgets)){var n=(0,rr.Rt)(Je.widgets),t=n.content,i=n.messages;St.current=t,ln((function(e){return dr(dr({},i),e)}))}}),[null===(_=Je)||void 0===_?void 0:_.widgets,ln,oi]);var Sr=(0,s.useCallback)((function(e,n,t){var i=ei.find((function(t){var i=t.type,o=t.uuid;return i===n&&o===e}));if(i){if(Zi(i),null!==Pt&&void 0!==Pt&&Pt.current){var o,r=Pt.current["".concat(i.type,"s/").concat(i.uuid,".py")];null===r||void 0===r||null===(o=r.current)||void 0===o||o.scrollIntoView()}(0,Kn.u7)({block_uuid:null,file_path:null,"file_paths[]":[]})}else if(n===h.tf.CHART){var l=oi.find((function(n){return n.uuid===e}));if(l&&(Zi(l),null!==Ot&&void 0!==Ot&&Ot.current)){var u,c=Ot.current[l.uuid];null===c||void 0===c||null===(u=c.current)||void 0===u||u.scrollIntoView()}}else t&&ko(t)}),[ei,ko,oi]);(0,s.useEffect)((function(){if(xt&&!ki){var e=ei.find((function(e){var n,t=e.uuid;return(null===xt||void 0===xt||null===(n=xt.split(":"))||void 0===n?void 0:n[0])===t}));e&&(Xe((function(n){return dr(dr({},n),{},(0,r.Z)({},e.uuid,!1))})),Sr(e.uuid,e.type,null))}else(null===_r||void 0===_r?void 0:_r.length)!==(null===ei||void 0===ei?void 0:ei.length)&&ki&&(Xe((function(e){return dr(dr({},e),{},(0,r.Z)({},ki.uuid,!1))})),Sr(ki.uuid,ki.type,null))}),[xt,ei,null===_r||void 0===_r?void 0:_r.length,Sr,ki,Xe]);var Ir=(0,s.useMemo)((function(){return new v.Z}),[]),Er=(0,s.useMemo)((function(){return{api_key:nr.l,token:Ir.decodedToken.token}}),[Ir]),Tr=(0,a.ZP)((0,ur.Ib)(),{onClose: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 a=ei.find((function(e){var n=e.type,i=e.uuid;return t===n&&c===i}));"stream_pipeline"!==l?ln((function(e){var t=e[c]||[];return dr(dr({},e),{},(0,r.Z)({},c,t.concat(n)))})):(an((function(e){return[].concat((0,o.Z)(e),[n])})),Yn.uF.IDLE===i&&(ji([]),jn(),c||pi(!1))),Yn.uF.BUSY===i?ji((function(e){return e.find((function(e){var n=e.uuid;return c===n}))||!a?e:e.concat(a)})):Yn.uF.IDLE===i&&ji((function(e){return e.filter((function(e){var n=e.uuid;return c!==n}))})),nn||pt(!0)}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,Mr=(0,s.useCallback)((function(){mo().then((function(){pi(!0),an([]),Tr(JSON.stringify(dr(dr({},Er),{},{execute_pipeline:!0,pipeline_uuid:U})))}))}),[U,mo,Tr,Er]),Dr=(0,s.useCallback)((function(){Tr(JSON.stringify(dr(dr({},Er),{},{cancel_pipeline:!0,pipeline_uuid:U})))}),[U,Tr,Er]),Br=(0,s.useCallback)((function(){Tr(JSON.stringify(dr(dr({},Er),{},{cancel_pipeline:!0,pipeline_uuid:U,skip_publish_message:!0})))}),[U,Tr,Er]),Ar=(0,s.useCallback)((function(){Tr(JSON.stringify(dr(dr({},Er),{},{check_if_pipeline_running:!0,pipeline_uuid:U})))}),[U,Tr,Er]);(0,s.useEffect)((function(){var e;return window.addEventListener("pagehide",Br),null===A||void 0===A||null===(e=A.events)||void 0===e||e.on("routeChangeStart",Br),function(){var e;null===A||void 0===A||null===(e=A.events)||void 0===e||e.off("routeChangeStart",Br),window.removeEventListener("pagehide",Br)}}),[Br,null===A||void 0===A?void 0:A.events]);var Rr=(0,s.useCallback)((function(e){var n=e.block,t=e.code,i=e.ignoreAlreadyRunning,o=e.runDownstream,l=void 0!==o&&o,u=e.runIncompleteUpstream,c=void 0!==u&&u,a=e.runSettings,s=void 0===a?{}:a,d=e.runTests,p=void 0!==d&&d,f=e.runUpstream,v=e.variables,h=n.extension_uuid,m=n.upstream_blocks,b=n.uuid;if(!xi.find((function(e){var n=e.uuid;return b===n}))||i){var g,x,j="".concat(Jo.vF,"_").concat(null===(g=Je)||void 0===g?void 0:g.uuid);Tr(JSON.stringify(dr(dr({},Er),{},{code:t,extension_uuid:h,output_messages_to_logs:!!(0,gn.U2)(j),pipeline_uuid:null===(x=Je)||void 0===x?void 0:x.uuid,run_downstream:l,run_incomplete_upstream:c,run_settings:s,run_tests:p,run_upstream:f,type:n.type,upstream_blocks:m,uuid:b,variables:v}))),ln((function(e){return delete e[b],e})),ke(!1),ji((function(e){return e.find((function(e){var n=e.uuid;return b===n}))?e:e.concat(n)})),ho((function(e){return dr(dr({},e),{},(0,r.Z)({},null===n||void 0===n?void 0:n.uuid,!0))}))}jn()}),[jn,Je,xi,Tr,ln,ji,ke,Er]),Nr=(0,s.useCallback)((function(e){var n,t=e.block;return nn?Rr(e):null===(n=mo({block:{outputs:[],uuid:t.uuid}},{contentOnly:!0}))||void 0===n?void 0:n.then((function(){return Rr(e)}))}),[nn,Rr,mo]),Lr=(0,a.ZP)((0,ur.Ib)("terminal"),{shouldReconnect:function(){return!0}}),Fr=Lr.lastMessage,Ur=Lr.sendMessage,Hr=(0,Vn.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,C.jsx)(J.BC,{children:(0,C.jsx)(E.Z,{contained:!0,defaultLinkUUID:i,onClickCustomTemplate:function(e){t({config:{custom_template:e,custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid}}),Gr()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[er.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),zr=(0,l.Z)(Hr,2),Wr=zr[0],Gr=zr[1],Kr=W.ZP.global_data_products.list().data,Vr=(0,s.useMemo)((function(){return(null===Kr||void 0===Kr?void 0:Kr.global_data_products)||[]}),[Kr]),qr=(0,Vn.dd)((function(e){var n=e.addNewBlock;return(0,C.jsx)(J.BC,{children:(0,C.jsx)(Qn.Z,{children:(0,C.jsx)(Ln.Z,{globalDataProducts:Vr,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:h.tf.GLOBAL_DATA_PRODUCT}),Xr()}})})})}),{},[Vr],{background:!0,uuid:"global_data_products"}),Yr=(0,l.Z)(qr,2),Qr=Yr[0],Xr=Yr[1],Jr=(0,s.useRef)(null),$r=(0,s.useState)(null),el=$r[0],nl=$r[1],tl=(0,s.useMemo)((function(){return Xt.cH.INTERACTIONS===gt}),[gt]);(0,s.useEffect)((function(){var e,n;gt&&null!==Jr&&void 0!==Jr&&Jr.current&&nl(null===Jr||void 0===Jr||null===(e=Jr.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),[gt,z,R,Fe,Jr]),(0,s.useEffect)((function(){!So&&(null===En||void 0===En?void 0:En.length)>=1&&Io((0,_e.HK)(En||[],(function(e){return e.uuid})))}),[En,So,Io]),(0,s.useEffect)((function(){!To&&null!==In&&void 0!==In&&In.blocks&&Mo(null===In||void 0===In?void 0:In.blocks)}),[To,In,Mo]);var il=(0,s.useMemo)((function(){return(0,C.jsx)(Ko,{activeView:gt,addNewBlockAtIndex:function(e,n,t,i){return new Promise((function(){return xr({block:e,idx:n,name:i,onCreateCallback:t})}))},afterWidth:q,autocompleteItems:oo,blockInteractionsMapping:To,blockRefs:Pt,blocks:ei,blocksInNotebook:Oo,cancelPipeline:Dr,chartRefs:Ot,checkIfPipelineRunning:Ar,containerHeightOffset:tl?el+1:null,contentByBlockUUID:_t,createInteraction:Xn,deleteBlock:Lo,deleteWidget:Uo,editingBlock:mi,executePipeline:Mr,fetchFileTree:nt,fetchPipeline:jn,fetchSecrets:Qt,fetchVariables:Kt,globalDataProducts:Vr,globalVariables:Vt,insights:Qi,interactions:En,interactionsMapping:So,interruptKernel:fr,isLoadingCreateInteraction:Jn,isLoadingUpdatePipelineInteraction:Bn,isPipelineExecuting:si,isPipelineUpdating:so,lastTerminalMessage:Fr,messages:rn,metadata:Ji,onChangeCallbackBlock:Bt,onChangeChartBlock:Nt,onChangeCodeBlock:At,onSelectBlockFile:Sr,onUpdateFileSuccess:Zo,permissions:Bo,pipeline:Je,pipelineInteraction:In,pipelineMessages:cn,project:Le,refAfterFooter:Jr,runBlock:Nr,runningBlocks:xi,sampleData:Wi,savePipelineContent:mo,savePipelineInteraction:Ro,secrets:Jt,selectedBlock:ki,selectedFilePath:de,sendTerminalMessage:Ur,setActiveSidekickView:kt,setAllowCodeBlockShortcuts:Te,setAnyInputFocused:Oe,setBlockInteractionsMapping:Mo,setDepGraphZoom:Be,setDisableShortcuts:Se,setEditingBlock:bi,setErrors:ie,setHiddenBlocks:Xe,setInteractionsMapping:Io,setPermissions:Ao,setSelectedBlock:Zi,setTextareaFocused:ke,showBrowseTemplates:Wr,showDataIntegrationModal:jo,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,Q.Y6)(),t=arguments.length>2?arguments[2]:void 0;return new Promise((function(){return xr({block:e,isUpdatingBlock:!0,name:n,preventDuplicateBlockName:t})}))},statistics:eo,textareaFocused:ye,treeRef:wt,updatePipelineInteraction:Dn,updatePipelineMetadata:Co,updateWidget:ci,widgets:oi})}),[gt,el,q,oo,To,Pt,ei,Oo,Dr,Ar,_t,Xn,Lo,Uo,mi,Mr,nt,jn,Qt,Kt,Vr,Vt,Qi,En,So,fr,Jn,Bn,si,so,tl,Fr,rn,Ji,Bt,Nt,At,Sr,Zo,Bo,Je,In,cn,Le,Jr,Nr,xi,Wi,mo,Ro,Jt,ki,de,Ur,kt,Oe,Mo,bi,ie,Xe,Io,Ao,ke,xr,Wr,jo,eo,ye,Dn,Co,ci,oi]),ol=(0,s.useMemo)((function(){return(0,C.jsx)(ui,{addNewBlockAtIndex:function(e,n,t,i){return new Promise((function(){var o;Y.L.BLOCK_FILE!==(null===e||void 0===e||null===(o=e.block_action_object)||void 0===o?void 0:o.object_type)&&(h.tf.DBT!==(null===e||void 0===e?void 0:e.type)||h.t6.SQL!==(null===e||void 0===e?void 0:e.language)||null!==e&&void 0!==e&&e.block_action_object)?xr({block:e,idx:n,name:i,onCreateCallback:t}):mr(e,n,t,i)}))},addWidget:function(e,n){var t=n.onCreateCallback;return Cr(e,oi.length,t)},allBlocks:ei,allowCodeBlockShortcuts:Ee,anyInputFocused:Pe,autocompleteItems:oo,blockInteractionsMapping:To,blockRefs:Pt,blocks:Oo,blocksThatNeedToRefresh:Et,dataProviders:zt,deleteBlock:Lo,disableShortcuts:Ce,fetchFileTree:nt,fetchPipeline:jn,fetchSampleData:Hi,files:tt,globalDataProducts:Vr,globalVariables:Vt,hiddenBlocks:Ye,interactionsMapping:So,interruptKernel:fr,mainContainerRef:$e,mainContainerWidth:Ft,messages:rn,onChangeCallbackBlock:Bt,onChangeCodeBlock:At,openSidekickView:Zt,pipeline:Je,pipelineContentTouched:dt,project:Le,restartKernel:pr,runBlock:Nr,runningBlocks:xi,savePipelineContent:mo,selectedBlock:ki,setAnyInputFocused:Oe,setDisableShortcuts:Se,setEditingBlock:bi,setErrors:ie,setHiddenBlocks:Xe,setIntegrationStreams:Ei,setOutputBlocks:_i,setPipelineContentTouched:pt,setSelectedBlock:Zi,setSelectedOutputBlock:Ri,setSelectedStream:Di,setTextareaFocused:ke,showBrowseTemplates:Wr,showConfigureProjectModal:Zr,showDataIntegrationModal:jo,showGlobalDataProducts:Qr,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,Q.Y6)();return new Promise((function(){return xr({block:e,isUpdatingBlock:!0,name:n})}))},textareaFocused:ye,widgets:oi})}),[mr,Cr,Ee,Pe,oo,Pt,To,ei,Oo,Et,zt,Lo,Ce,nt,jn,Hi,tt,Vr,Vt,Ye,So,fr,$e,Ft,rn,Bt,At,Zt,Je,dt,Le,pr,Nr,xi,mo,ki,Oe,bi,ie,Xe,pt,Zi,ke,xr,Wr,Zr,jo,Qr,ye,oi]),rl=(0,s.useMemo)((function(){if(D===di.b7)return(0,C.jsx)(An,{cancelPipeline:Dr,createPipeline:lo,executePipeline:Mr,interruptKernel:fr,isPipelineExecuting:si,pipeline:Je,restartKernel:pr,savePipelineContent:mo,setActiveSidekickView:kt,setMessages:ln,children:de&&(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(y.ZP,{alignItems:"center",fullHeight:!0,children:(0,C.jsx)(T.Z,{compact:!0,onClick:function(){return pe(null)},small:!0,children:"View pipeline"})})})})}),[Dr,lo,Mr,fr,si,D,Je,pr,mo,de,kt,ln,pe]),ll=(0,s.useMemo)((function(){if(D===di.b7)return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(qn,{filePaths:ve,filesTouched:be,isBusy:xi.length>=1,kernel:vn,pipeline:Je,restartKernel:pr,savePipelineContent:mo,saveStatus:bo,selectedFilePath:de,setErrors:ie,setRunningBlocks:ji,updatePipelineMetadata:Co,children:rl}),(null===ve||void 0===ve?void 0:ve.length)>0&&(0,C.jsx)(Gn.rK,{relativePosition:!0,secondary:!0,children:(0,C.jsx)(Rn.Z,{filePaths:ve,filesTouched:be,savePipelineContent:mo,selectedFilePath:de})})]})}),[rl,be,vn,D,Je,pr,xi,mo,bo,de,ve,ie,Co]),ul=(0,s.useMemo)((function(){var e;return null===Ii||void 0===Ii||null===(e=Ii.filter((function(e){return(0,_e.sE)(null===zi||void 0===zi?void 0:zi.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat((0,Q.kE)(e))}))})))||void 0===e?void 0:e.map((function(e){return(0,C.jsx)(Z.Z,{pl:1,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return Di(e)},selected:Mi===e,uuid:e,children:e})},e)}))}),[zi,Ii,Mi]),cl=(0,s.useRef)(null),al=(0,s.useMemo)((function(){return(0,C.jsx)(Pn.Z,{addNewBlock:function(e,n){mr(e,ei.length,n,e.name),(null===yt||void 0===yt?void 0:yt.length)>=1&&A.push("/pipelines/".concat(U,"/edit"))},blocks:ei,deleteWidget:Uo,fetchAutocompleteItems:io,fetchFileTree:nt,fetchPipeline:jn,files:tt,onSelectBlockFile:Sr,openFile:ko,openPipeline:function(e){Li(),A.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))},openSidekickView:Zt,pipeline:Je,ref:cl,setErrors:ie,setSelectedBlock:Zi,widgets:oi})}),[mr,ei,Uo,io,nt,jn,null===yt||void 0===yt?void 0:yt.length,tt,Sr,ko,Zt,Je,U,Li,A,ie,Zi,oi]),sl=(0,s.useMemo)((function(){return(0,C.jsx)(I,{blockRefs:Pt,hiddenBlocks:Ye,pipeline:Je,setHiddenBlocks:Xe})}),[Pt,Ye,Je,Xe]),dl=(0,s.useMemo)((function(){return di.Jf.uuid===(null===We||void 0===We?void 0:We.uuid)?al:di.IY.uuid===(null===We||void 0===We?void 0:We.uuid)?sl:null}),[al,sl,We]),pl=(0,s.useMemo)((function(){return(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(M.Z,{noPadding:!0,onClickTab:function(e){Ke(e)},selectedTabUUID:null===We||void 0===We?void 0:We.uuid,small:!0,tabs:di.NR})})}),[Ke,We]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Fn.Z,{title:null===(S=Je)||void 0===S?void 0:S.name}),(0,C.jsxs)(vi,{after:il,afterHeader:(0,C.jsx)(Qo,{activeView:gt,depGraphZoom:De,pipeline:Je,project:Le,secrets:Jt,selectedBlock:ki,setSelectedBlock:Zi,treeRef:wt,variables:Vt}),afterHeightOffset:$o.Mz,afterHidden:z,afterInnerHeightMinus:el,afterNavigationItems:or({activeView:gt,pipeline:Je,project:Le,secrets:Jt,setActiveSidekickView:kt,variables:Vt}),afterOverflow:Xt.cH.DATA===gt?"hidden":null,afterSubheader:(null===Ci||void 0===Ci?void 0:Ci.length)>0&>===Xt.cH.DATA&&(0,C.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!it&&Ci.map((function(e){var n=e.uuid,t=(null===Ai||void 0===Ai?void 0:Ai.uuid)===n;return(0,C.jsx)(Z.Z,{pl:1,children:(0,C.jsx)(N.ZP,{afterElement:t?(0,C.jsx)(T.Z,{basic:!0,highlightOnHover:!0,onClick:function(){(0,rr.h8)(U,e.uuid),_i((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,C.jsx)(G.x8,{muted:!0,size:1.25*O.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return Ri(e)},selected:t,uuid:n,children:n})},n)})),it&&ul]}),before:dl,beforeHeader:pl,beforeHeightOffset:$o.Mz,beforeNavigationItems:(0,ir.H)(tr.M.EDIT,Je),errors:re||te,headerOffset:(null===ve||void 0===ve?void 0:ve.length)>0?36:0,mainContainerHeader:ll,mainContainerRef:$e,page:D,pipeline:Je,setAfterHidden:K,setAfterWidthForChildren:$,setErrors:re?le:ie,setMainContainerWidth:Ut,children:[(0,C.jsx)("div",{style:{height:de?0:null,opacity:de?0:null,visibility:de?"hidden":null},children:(0,C.jsx)(f.Z,{uuid:"PipelineDetail/".concat(U),children:ol})}),null===yt||void 0===yt?void 0:yt.map((function(e){return(0,C.jsx)("div",{style:{display:de===e?null:"none"},children:(0,C.jsx)(f.Z,{uuid:"FileEditor/".concat(decodeURIComponent(e)),children:(0,C.jsx)(On.Z,{active:de===e,addNewBlock:function(e,n){mr(dr(dr({},e),{},{require_unique_name:!1}),ei.length,n,e.name),A.push("/pipelines/".concat(U,"/edit"))},fetchPipeline:jn,fetchVariables:Kt,filePath:e,onUpdateFileSuccess:Zo,openSidekickView:Zt,pipeline:Je,selectedFilePath:de,sendTerminalMessage:Ur,setDisableShortcuts:Se,setErrors:ie,setFilesTouched:xe,setSelectedBlock:Zi})})},e)})),(0,C.jsx)(Z.Z,{pb:jt?0:Math.max(Math.floor(R*(2/3)/O.iI),0)})]})]})}pr.getInitialProps=function(){var e=(0,i.Z)(c().mark((function e(n){var t,i,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,i=di.b7,o={page:i,pipeline:{uuid:t}},e.abrupt("return",o);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var fr=(0,mi.Z)(pr)},80329:function(e,n,t){"use strict";t.d(n,{j:function(){return i}});var i=(0,t(44152).r)({apiReloads:{}}).useGlobalState},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(59967)}])}},function(e){e.O(0,[3662,844,2083,2851,2369,341,8789,4913,5896,2714,9161,2631,6648,4783,7011,6563,8013,600,9696,8264,4666,5499,4839,7055,1769,9264,976,553,1749,9774,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|