mage-ai 0.9.7__py3-none-any.whl → 0.9.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mage-ai might be problematic. Click here for more details.
- mage_ai/ai/constants.py +1 -0
- mage_ai/ai/generator.py +6 -0
- mage_ai/ai/{gen_doc_for_pipeline.py → generator_cmds.py} +5 -0
- mage_ai/ai/llm_pipeline_wizard.py +108 -3
- mage_ai/api/policies/BlockPolicy.py +1 -0
- mage_ai/api/policies/BlockTemplatePolicy.py +9 -0
- mage_ai/api/policies/LlmPolicy.py +3 -2
- mage_ai/api/policies/OauthAccessTokenPolicy.py +31 -0
- mage_ai/api/policies/PipelinePolicy.py +1 -0
- mage_ai/api/policies/ProjectPolicy.py +9 -0
- mage_ai/api/policies/SearchResultPolicy.py +32 -0
- mage_ai/api/policies/VariablePolicy.py +8 -0
- mage_ai/api/presenters/BlockTemplatePresenter.py +1 -0
- mage_ai/api/presenters/OauthAccessTokenPresenter.py +9 -0
- mage_ai/api/presenters/ProjectPresenter.py +2 -0
- mage_ai/api/presenters/SearchResultPresenter.py +73 -0
- mage_ai/api/resources/BlockResource.py +43 -4
- mage_ai/api/resources/BlockTemplateResource.py +15 -2
- mage_ai/api/resources/CustomTemplateResource.py +15 -3
- mage_ai/api/resources/FileContentResource.py +8 -1
- mage_ai/api/resources/FileResource.py +22 -2
- mage_ai/api/resources/OauthAccessTokenResource.py +24 -0
- mage_ai/api/resources/PipelineResource.py +70 -2
- mage_ai/api/resources/ProjectResource.py +15 -1
- mage_ai/api/resources/SearchResultResource.py +68 -0
- mage_ai/api/resources/VariableResource.py +25 -14
- mage_ai/cache/base.py +3 -0
- mage_ai/cache/block_action_object/__init__.py +282 -0
- mage_ai/cache/block_action_object/constants.py +4 -0
- mage_ai/cache/constants.py +1 -0
- mage_ai/data_integrations/destinations/constants.py +2 -0
- mage_ai/data_preparation/executors/k8s_pipeline_executor.py +1 -1
- mage_ai/data_preparation/models/block/__init__.py +20 -1
- mage_ai/data_preparation/models/block/dbt/utils/__init__.py +1 -0
- mage_ai/data_preparation/models/custom_templates/custom_block_template.py +8 -3
- mage_ai/data_preparation/models/custom_templates/utils.py +6 -3
- mage_ai/data_preparation/models/file.py +3 -0
- mage_ai/data_preparation/models/pipeline.py +10 -1
- mage_ai/data_preparation/models/{project.py → project/__init__.py} +17 -0
- mage_ai/data_preparation/models/project/constants.py +5 -0
- mage_ai/data_preparation/repo_manager.py +9 -6
- mage_ai/data_preparation/templates/constants.py +478 -1
- mage_ai/data_preparation/templates/template.py +9 -1
- mage_ai/orchestration/backfills/service.py +20 -1
- mage_ai/orchestration/db/__init__.py +25 -0
- mage_ai/orchestration/db/models/schedules.py +20 -1
- mage_ai/orchestration/pipeline_scheduler.py +23 -0
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/404.html.html +2 -2
- mage_ai/server/frontend_dist/_next/static/OwvTROmputQCA1Z9HEGDv/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{1005-ce36fe7ed460d006.js → 1005-16c1a6678de5311e.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1424-e22139f33196c5c1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1484-a76b2c31e4808379.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2485-b569baad92049d6b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{2786-d8b593e5d7c42665.js → 2786-acce6ea0d9b4898e.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3654-573457b62efff6e2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3881-0eb04f7f7a244347.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{4317-b112fe7bb532b998.js → 4317-3fe63fc9401685d6.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{4822-52d9d661b6bd1ae9.js → 4822-045cc7cdd7c95163.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{547-14029bdacc0ed267.js → 547-4ad2cdae967055b6.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6299-cf188c1b7a1bc33c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{7815-6dc55b5fd5d1f48a.js → 7815-fbd99c8f259d9e8b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{8312-cdc4d6c3b9f53099.js → 8312-c88a3b1012e5448b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{8952-492bf0e29d215ddd.js → 8952-e94a7334fcd5c68b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9055-d0d25298cb5f4e45.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{_app-c7557dc9e725825e.js → _app-fa38a24707c76411.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-b9dac983c75798f2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{settings-17bb362b9683079c.js → settings-453aaa7bf78f8101.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/{[user]-bfa53c0ee79920a0.js → [user]-3b502aa6d1a04cad.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/{new-2f7e6bf8e2a37380.js → new-dd41d718cbb5990c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-ec748f838b7b8fad.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-bcc24120f5911f76.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{overview-8ffbc4b0e8a43266.js → overview-6f20b9e9cbec91d6.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-373f6b8c9161e819.js → [...slug]-55212dfc15881ef2.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{backfills-226bf0c5c1bfe004.js → backfills-6b4a82cd0516e121.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-0705c99df236ec8a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{logs-4ade07836fd577c9.js → logs-c294f5d74bd2d50f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-fd9eb711e89425e9.js → monitors-1b9e4abc54842cdf.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{runs-027666ed18d3151e.js → runs-17ebe87e94242ae5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-48b60ca236a26818.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{syncs-de58e6b91e5e4552.js → syncs-5153f4665aaf8b17.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/{[...slug]-432843576e1ed09e.js → [...slug]-1306e85191f6b47c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-ae31b1d0d8a4634d.js → triggers-2e731d343a26d46a.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-0fab737dbc9074fc.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-b2354688508b0755.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-a4f01b5c429757cc.js → users-6522c963087f18e8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{sign-in-1140f8ee7e89381a.js → sign-in-7dcd1257ca9660bb.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/{[...slug]-f59b3f04c5a49351.js → [...slug]-78a07e7fe8973811.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{templates-dbb209ce131390a9.js → templates-19df643f52679d5a.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-a1cf445565b68809.js +1 -0
- mage_ai/server/frontend_dist/files.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]/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/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
- 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 +16 -16
- 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/server.py +5 -0
- mage_ai/server/websocket_server.py +1 -0
- mage_ai/services/search/__init__.py +0 -0
- mage_ai/services/search/block_action_objects.py +33 -0
- mage_ai/services/search/constants.py +1 -0
- mage_ai/shared/array.py +7 -0
- mage_ai/shared/parsers.py +11 -2
- mage_ai/tests/shared/test_parsers.py +73 -0
- mage_ai/usage_statistics/constants.py +1 -0
- mage_ai/usage_statistics/logger.py +19 -1
- {mage_ai-0.9.7.dist-info → mage_ai-0.9.9.dist-info}/METADATA +9 -7
- {mage_ai-0.9.7.dist-info → mage_ai-0.9.9.dist-info}/RECORD +145 -132
- mage_ai/server/frontend_dist/_next/static/chunks/1424-de97c5aa0477894b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1484-c9d6bc33227070dd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2485-86c97f516c1abb9f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3215-c2f5f19b650f9a50.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3654-bff4740b63cf280c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3881-7f121dbbe6e273cd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6299-97f283be01adf6a8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-daf49c7c6f7e70f8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-1f6cb7656299cbd1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-4894eabb442a039c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-a9bd86bee73b5762.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-cf51793c2112915c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-f1131ffe0d2a4a06.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-170943ca00445486.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-2ecda1f1437013f2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/tMZjCwLa1LRYRzhFRdKNf/_buildManifest.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{tMZjCwLa1LRYRzhFRdKNf → OwvTROmputQCA1Z9HEGDv}/_middlewareManifest.js +0 -0
- /mage_ai/server/frontend_dist/_next/static/{tMZjCwLa1LRYRzhFRdKNf → OwvTROmputQCA1Z9HEGDv}/_ssgManifest.js +0 -0
- {mage_ai-0.9.7.dist-info → mage_ai-0.9.9.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.7.dist-info → mage_ai-0.9.9.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.7.dist-info → mage_ai-0.9.9.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.7.dist-info → mage_ai-0.9.9.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1484],{78759:function(e,n,t){t.d(n,{G8:function(){return p},SR:function(){return h},VR:function(){return a},_H:function(){return v},x8:function(){return m}});var o,r,i,l,u,c,a,s=t(82394),d=t(42451);!function(e){e.COLUMNS="columns",e.METRICS="metrics",e.NUMBER="number"}(a||(a={}));var f={noCode:[{label:function(){return"time column"},settings:{maxValues:1},type:a.COLUMNS,uuid:d.eN},{label:function(){return"time interval"},options:[d.aE.ORIGINAL,d.aE.SECOND,d.aE.MINUTE,d.aE.HOUR,d.aE.DAY,d.aE.WEEK,d.aE.MONTH,d.aE.YEAR],uuid:d.Yg},{label:function(){return"metrics"},type:a.METRICS,uuid:d.bE}]},p=(o={},(0,s.Z)(o,d.oV.BAR_CHART,{noCode:[{label:function(){return"group by columns"},type:a.COLUMNS,uuid:d.eN},{label:function(){return"metrics"},type:a.METRICS,uuid:d.bE},{autoRun:!0,label:function(){return"chart style"},options:[d.JT.HORIZONTAL,d.JT.VERTICAL],uuid:d.R8},{autoRun:!0,label:function(){return"sort direction"},options:[null,d.MP.ASCENDING,d.MP.DESCENDING],uuid:d.$1}],code:[{label:function(){return"variable name of x-axis values"},monospace:!0,uuid:d.a3},{label:function(){return"variable name of y-axis values"},monospace:!0,uuid:d.rj}]}),(0,s.Z)(o,d.oV.HISTOGRAM,{noCode:[{label:function(){return"number column for chart"},settings:{maxValues:1},type:a.COLUMNS,uuid:d.eN},{autoRun:!0,label:function(){return"Number of buckets"},type:a.NUMBER,uuid:d.m7}],code:[{label:function(){return"variable name of values"},monospace:!0,uuid:d.a3}]}),(0,s.Z)(o,d.oV.LINE_CHART,{noCode:[{label:function(){return"group by columns"},settings:{maxValues:1},type:a.COLUMNS,uuid:d.eN},{label:function(){return"metrics"},type:a.METRICS,uuid:d.bE}],code:[{label:function(){return"variable name of x-axis values"},monospace:!0,uuid:d.a3},{label:function(){return"variable name of y-axis values"},monospace:!0,uuid:d.rj},{label:function(){return"labels of lines in chart (comma separated)"},uuid:d.e}]}),(0,s.Z)(o,d.oV.PIE_CHART,{noCode:[{label:function(){return"column for chart"},settings:{maxValues:1},type:a.COLUMNS,uuid:d.eN},{autoRun:!0,label:function(){return"Number of slices"},type:a.NUMBER,uuid:d.m7}],code:[{label:function(){return"variable name of values"},monospace:!0,uuid:d.a3}]}),(0,s.Z)(o,d.oV.TABLE,{noCode:[{label:function(){return"columns"},type:a.COLUMNS,uuid:d.eN},{label:function(){return"max number of rows"},type:a.NUMBER,uuid:d.PG}],code:[{label:function(){return"variable name of columns"},monospace:!0,uuid:d.a3},{label:function(){return"variable name of rows"},monospace:!0,uuid:d.rj}]}),(0,s.Z)(o,d.oV.TIME_SERIES_BAR_CHART,f),(0,s.Z)(o,d.oV.TIME_SERIES_LINE_CHART,f),o),m=(r={},(0,s.Z)(r,d.oV.BAR_CHART,{configuration:function(e){var n;return n={},(0,s.Z)(n,d.a3,"x"),(0,s.Z)(n,d.rj,"y"),(0,s.Z)(n,d.R8,d.JT.VERTICAL),n},content:function(e){return"columns = df_1.columns\nx = df_1.columns[:7]\ny = [[v] for v in [len(df_1[col].unique()) for col in x]]\n"}}),(0,s.Z)(r,d.oV.HISTOGRAM,{configuration:function(e){var n;return n={},(0,s.Z)(n,d.m7,10),(0,s.Z)(n,d.a3,"x"),n},content:function(e){return"columns = df_1.columns\ncol = list(filter(lambda x: df_1[x].dtype == float or df_1[x].dtype == int, columns))[0]\nx = df_1[col]\n"}}),(0,s.Z)(r,d.oV.LINE_CHART,{configuration:function(e){var n;return n={},(0,s.Z)(n,d.a3,"x"),(0,s.Z)(n,d.rj,"y"),n},content:function(e){return"columns = df_1.columns\ncols = list(filter(lambda x: df_1[x].dtype == float or df_1[x].dtype == int, columns))\nx = df_1[cols[0]]\ny = [df_1[cols[1]]]\n"}}),(0,s.Z)(r,d.oV.PIE_CHART,{configuration:function(e){var n;return n={},(0,s.Z)(n,d.m7,7),(0,s.Z)(n,d.a3,"x"),n},content:function(e){return"x = df_1[df_1.columns[0]]"}}),(0,s.Z)(r,d.oV.TABLE,{configuration:function(e){var n;return n={},(0,s.Z)(n,d.PG,10),(0,s.Z)(n,d.a3,"x"),(0,s.Z)(n,d.rj,"y"),n},content:function(e){return"x = df_1.columns\ny = df_1.to_numpy()"}}),(0,s.Z)(r,d.oV.TIME_SERIES_BAR_CHART,{configuration:function(e){return(0,s.Z)({},d.Yg,d.aE.ORIGINAL)}}),(0,s.Z)(r,d.oV.TIME_SERIES_LINE_CHART,{configuration:function(e){return(0,s.Z)({},d.Yg,d.aE.ORIGINAL)}}),r),h=(c={},(0,s.Z)(c,d.oV.BAR_CHART,(i={},(0,s.Z)(i,d.a3,(function(){return"must be a list of booleans, dates, integers, floats, or strings."})),(0,s.Z)(i,d.rj,(function(){return"must be a list of lists containing integers or floats."})),i)),(0,s.Z)(c,d.oV.HISTOGRAM,(0,s.Z)({},d.a3,(function(){return"must be a list of integers or floats."}))),(0,s.Z)(c,d.oV.LINE_CHART,(l={},(0,s.Z)(l,d.a3,(function(){return"must be a list of integers or floats."})),(0,s.Z)(l,d.rj,(function(){return"must be a list of lists containing integers or floats. Each list is a single line in the chart."})),l)),(0,s.Z)(c,d.oV.PIE_CHART,(0,s.Z)({},d.a3,(function(){return"must be a list of booleans, dates, integers, floats, or strings."}))),(0,s.Z)(c,d.oV.TABLE,(u={},(0,s.Z)(u,d.a3,(function(){return"must be a list of strings."})),(0,s.Z)(u,d.rj,(function(){return"must be a list of lists containing booleans, dates, integers, floats, or strings."})),u)),c),v=[{label:function(){return"% of missing values"},widgetTemplate:function(e){var n,t=e.block;return{name:"missing values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,s.Z)(n,d.a3,"columns_with_mising_values"),(0,s.Z)(n,d.rj,"percentage_of_missing_values"),(0,s.Z)(n,d.R8,d.JT.HORIZONTAL),(0,s.Z)(n,d.$1,d.MP.DESCENDING),(0,s.Z)(n,"chart_type",d.oV.BAR_CHART),n),content:"number_of_rows = len(df_1.index)\ncolumns_with_mising_values = []\npercentage_of_missing_values = []\nfor col in df_1.columns:\n missing = df_1[col].isna().sum()\n if missing > 0:\n columns_with_mising_values.append(col)\n percentage_of_missing_values.append(100 * missing / number_of_rows)\n"}}},{label:function(){return"Unique values"},widgetTemplate:function(e){var n,t=e.block;return{name:"unique values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,s.Z)(n,d.a3,"columns"),(0,s.Z)(n,d.rj,"number_of_unique_values"),(0,s.Z)(n,d.R8,d.JT.HORIZONTAL),(0,s.Z)(n,d.$1,d.MP.DESCENDING),(0,s.Z)(n,"chart_type",d.oV.BAR_CHART),n),content:"columns = df_1.columns\nnumber_of_unique_values = [df_1[col].nunique() for col in columns]\n"}}},{label:function(){return"Most frequent values"},widgetTemplate:function(e){var n,t=e.block;return{name:"most frequent values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,s.Z)(n,d.JJ,3e3),(0,s.Z)(n,d.ED,"column_index"),(0,s.Z)(n,d.a3,"columns"),(0,s.Z)(n,d.rj,"rows"),(0,s.Z)(n,"chart_type",d.oV.TABLE),n),content:"columns = ['mode value', 'frequency', '% of values']\n\ncolumn_index = []\nrows = []\nfor col in df_1.columns:\n value_counts = df_1[col].value_counts()\n if len(value_counts.index) == 0:\n continue\n column_value = value_counts.index[0]\n value = value_counts[column_value]\n number_of_rows = df_1[col].count()\n column_index.append(col)\n rows.append([\n column_value,\n f'{round(100 * value / number_of_rows, 2)}%',\n value,\n ])\n"}}},{label:function(){return"Summary overview"},widgetTemplate:function(e){var n,t=e.block;return{name:"summary overview for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,s.Z)(n,d.JJ,3e3),(0,s.Z)(n,d.ED,"stats"),(0,s.Z)(n,d.a3,"headers"),(0,s.Z)(n,d.rj,"rows"),(0,s.Z)(n,"chart_type",d.oV.TABLE),n),content:"from mage_ai.data_cleaner.column_types.column_type_detector import infer_column_types\n\n\nheaders = ['value']\nstats = ['Columns', 'Rows']\nrows = [[len(df_1.columns)], [len(df_1.index)]]\n\ncol_counts = {}\nfor col, col_type in infer_column_types(df_1).items():\n col_type_name = col_type.value\n if not col_counts.get(col_type_name):\n col_counts[col_type_name] = 0\n col_counts[col_type_name] += 1\n\nfor col_type, count in sorted(col_counts.items()):\n stats.append(f'# of {col_type}')\n rows.append([count])\n"}}},{label:function(){return"Feature profiles"},widgetTemplate:function(e){var n,t=e.block;return{name:"feature profiles for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,s.Z)(n,d.JJ,3e3),(0,s.Z)(n,d.ED,"stats"),(0,s.Z)(n,d.a3,"columns"),(0,s.Z)(n,d.rj,"rows"),(0,s.Z)(n,"chart_type",d.oV.TABLE),n),content:"from mage_ai.data_cleaner.column_types.column_type_detector import infer_column_types\nimport statistics\n\n\ncolumns_and_types = infer_column_types(df_1).items()\ncolumns = [t[0] for t in columns_and_types]\nstats = ['Type', 'Missing values', 'Unique values', 'Min', 'Max', 'Mean', 'Median', 'Mode']\nrows = [[] for _ in stats]\n\nfor col, col_type in columns_and_types:\n series = df_1[col]\n min_value = None\n max_value = None\n mean = None\n median = None\n\n not_null = series[series.notnull()]\n\n if col_type.value in ['number', 'number_with_decimals']:\n count = len(not_null.index)\n if count >= 1:\n mean = round(not_null.sum() / count, 2)\n median = sorted(not_null)[int(count / 2)]\n min_value = round(series.min(), 2)\n max_value = round(series.max(), 2)\n else:\n min_value = not_null.astype(str).min()\n max_value = not_null.astype(str).max()\n\n _, mode = sorted(\n [(v, k) for k, v in not_null.value_counts().items()],\n reverse=True,\n )[0]\n\n for idx, value in enumerate([\n col_type.value,\n len(series[series.isna()].index),\n len(series.unique()),\n min_value,\n max_value,\n mean,\n median,\n mode,\n ]):\n rows[idx].append(value)\n"}}}]},22782:function(e,n,t){t.d(n,{MB:function(){return p},Nk:function(){return c},T5:function(){return a},_A:function(){return d},a3:function(){return f},wx:function(){return s}});var o=t(38626),r=t(23831),i=t(73942),l=t(49125),u=t(44162),c=o.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-n38rkq-0"})([""," border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;overflow:hidden;"," "," ",""],u.Kf,(function(e){return e.addBottomPadding&&"\n padding-bottom: ".concat(2*l.tr,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).table,";\n ")}),(function(e){return!e.executedAndIdle&&"\n border-bottom-left-radius: ".concat(i.n_,"px;\n border-bottom-right-radius: ").concat(i.n_,"px;\n border-bottom-style: solid;\n border-bottom-width: 2px;\n ")})),a=o.default.div.withConfig({displayName:"indexstyle__OutputRowStyle",componentId:"sc-n38rkq-1"})([""," "," ",""],(function(e){return e.first&&"\n padding-top: ".concat(l.iI*l.cd,"px;\n ")}),(function(e){return e.last&&"\n padding-bottom: ".concat(l.iI*l.cd,"px;\n ")}),(function(e){return e.contained&&"\n padding-left: ".concat(u.oh,"px;\n padding-right: ").concat(l.iI*l.cd,"px;\n ")})),s=o.default.div.withConfig({displayName:"indexstyle__HTMLOutputStyle",componentId:"sc-n38rkq-2"})(["table{"," border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;}td,th{padding:0 8px;}a{","}"],u.Kf,(function(e){return"\n color: ".concat((e.theme.interactive||r.Z.interactive).linkPrimary,";\n ")})),d=o.default.div.withConfig({displayName:"indexstyle__ExtraInfoStyle",componentId:"sc-n38rkq-3"})([""," border-bottom-style:solid;border-bottom-width:2px;border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;",""],u.Kf,(function(e){return"\n background-color: ".concat((e.theme.borders||r.Z.borders).light,";\n border-bottom-left-radius: ").concat(i.n_,"px;\n border-bottom-right-radius: ").concat(i.n_,"px;\n ")})),f=o.default.div.withConfig({displayName:"indexstyle__ExtraInfoContentStyle",componentId:"sc-n38rkq-4"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;"],l.iI,u.oh,l.iI*l.cd,l.iI),p=o.default.div.withConfig({displayName:"indexstyle__ExtraInfoBorderStyle",componentId:"sc-n38rkq-5"})(["height:1px;width:100%;",""],(function(e){return"\n border-top: 1px solid ".concat((e.theme.borders||r.Z.borders).medium,";\n ")}))},65051:function(e,n,t){var o=t(21831),r=t(82394),i=t(75582),l=t(89565),u=t.n(l),c=t(82684),a=t(83455),s=t(35490),d=t(86422),f=t(60328),p=t(16634),m=t(57722),h=t(62976),v=t(48952),b=t(34744),g=t(93461),x=t(67971),j=t(82635),Z=t(98781),_=t(66176),C=t(86673),k=t(19711),y=t(46261),O=t(82531),E=t(66166),T=t(10503),S=t(22782),I=t(73828),R=t(35033),A=t(49125),P=t(94353),w=t(37391),D=t(93005),M=t(60701),N=t(43482),B=t(90211),L=t(96510),U=t(28598);function F(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function H(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?F(Object(t),!0).forEach((function(n){(0,r.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}var Q={appearAbove:!0,appearBefore:!0,block:!0,size:null,widthFitContent:!0},G={basic:!0,iconOnly:!0,noPadding:!0,transparent:!0};n.Z=function(e){var n=e.block,t=e.blockMetadata,r=e.buttonTabs,l=e.collapsed,F=e.contained,W=void 0===F||F,q=e.dynamicBlock,z=e.dynamicChildBlock,K=e.hasError,V=e.hasOutput,Y=e.hideExtraInfo,X=e.isInProgress,J=e.mainContainerWidth,$=e.messages,ee=e.openSidekickView,ne=e.pipeline,te=e.runCount,oe=e.runEndTime,re=e.runStartTime,ie=e.selected,le=e.selectedTab,ue=e.setCollapsed,ce=e.setErrors,ae=e.setOutputBlocks,se=e.setSelectedOutputBlock,de=e.setSelectedTab,fe=n||{},pe=fe.status,me=fe.type,he=fe.uuid,ve=(0,c.useMemo)((function(){return(null===$||void 0===$?void 0:$.length)||0}),[$]),be=d.DA.EXECUTED===pe||!X&&0===te&&ve>=1||!X&&te>=1&&oe>=re,ge=(0,c.useState)(),xe=ge[0],je=ge[1],Ze=(0,c.useState)(),_e=Ze[0],Ce=Ze[1],ke=(0,c.useState)(null),ye=ke[0],Oe=ke[1],Ee=(0,c.useMemo)((function(){var e,n;return null===(e=new s.Z)||void 0===e||null===(n=e.decodedToken)||void 0===n?void 0:n.token}),[]),Te=(0,a.Db)((function(){return O.ZP.block_outputs.pipelines.downloads.detailAsync(null===ne||void 0===ne?void 0:ne.uuid,he,{token:Ee},{onDownloadProgress:function(e){return Oe((Number((null===e||void 0===e?void 0:e.loaded)||0)/1e6).toFixed(3))},responseType:P.E.BLOB})}),{onSuccess:function(e){return(0,L.wD)(e,{callback:function(e){(0,N.uS)(e,"".concat(he,".").concat(I.Lu.CSV))},onErrorCallback:function(e,n){return null===ce||void 0===ce?void 0:ce({errors:n,response:e})}})}}),Se=(0,i.Z)(Te,2),Ie=Se[0],Re=Se[1].isLoading;(0,c.useEffect)((function(){X||Ce(100)}),[X]);var Ae=function(e){return Array.isArray(e)?e.join("\n"):e},Pe=(0,c.useMemo)((function(){return $.reduce((function(e,n){var t=e.at(-1);if(j.jU.includes(null===t||void 0===t?void 0:t.type)&&(null===t||void 0===t?void 0:t.type)===n.type&&!Ae(null===n||void 0===n?void 0:n.data).match(R.Lz)){if(Array.isArray(t.data))t.data.concat(n.data);else if("string"===typeof t.data){var o=Ae(n.data)||"";t.data=[t.data,o].join("\n")}}else j.jU.includes(null===n||void 0===n?void 0:n.type)&&!Ae(null===n||void 0===n?void 0:n.data).match(R.Lz)?e.push(H(H({},n),{},{data:Ae(n.data)})):e.push(H({},n));return e}),[])}),[$]),we=(0,c.useMemo)((function(){return(0,U.jsx)(_.Z,{progress:_e})}),[_e]),De=d.tf.DBT===(null===n||void 0===n?void 0:n.type),Me=(0,E.Z)(K);(0,c.useEffect)((function(){De&&!Me&&K&&de(D.Rj)}),[K,Me,De,de]);var Ne=(0,c.useMemo)((function(){var e=function(e,n){var t=e.columns,o=e.index,r=e.rows,i=e.shape,l=n.borderTop,u=n.selected;return i&&je(i),r.length>=1&&(0,U.jsx)(h.Z,{columns:t,disableScrolling:!u,index:o,maxHeight:60*A.iI,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!l,rows:r,width:J-(2+A.cd*A.iI*2+2+w.nn)},"data-table-".concat(o))},n=[],t=[],r=[];return null===Pe||void 0===Pe||Pe.forEach((function(i,l){var c=i.data,a=i.type;if(c&&0!==(null===c||void 0===c?void 0:c.length)){var s=[];s=(s=Array.isArray(c)?c:[c]).filter((function(e){return e}));var d=[];s.forEach((function(e){if(e&&"string"===typeof e){var n=e.split("\n");d.push.apply(d,(0,o.Z)(n))}else"object"===typeof d&&d.push(e)}));var f=d.length,p=[];d.forEach((function(n,o){var i,c={contained:W,first:0===l&&0===o,last:l===Pe.length-1&&o===f-1},s=l>=1;if("string"===typeof n&&n.match(R.Gr)){var d=n.split("\n"),m=[];d.forEach((function(e){if(e.match(R.Gr)){var t=e.split(R.Vc),o=t[t.length-1];(0,B.Pb)(o)&&r.push(JSON.parse(o))}else m.push(e);n=m.length>=1?m.join("\n"):null}))}if(null!==n){if("string"===typeof n&&n.match(R.Lz)){var h=n.split(R.gr),v=h[h.length-1],b=v.split("FloatProgress");if(h.length>=2&&(v=b[0]),(0,B.Pb)(v)){var g=JSON.parse(v),x=g.data,Z=g.type;if(j.Gi.TABLE===Z){!0;var _=e(x,{borderTop:s,selected:ie});t.push(_),De||(i=_)}}}else if(a===j.Gi.TABLE){!0;var C=e((0,B.Pb)(n)?JSON.parse(n):n,{borderTop:s,selected:ie});t.push(C),De||(i=C)}else if(j.jU.includes(a)){var y,O=null===(y=n)||void 0===y?void 0:y.split("\\n");i=(0,U.jsx)(S.T5,H(H({},c),{},{children:O.map((function(e){return(0,U.jsx)(k.ZP,{monospace:!0,preWrap:!0,children:(0,U.jsx)(u(),{children:e})},e)}))}))}else if(a===j.Gi.TEXT_HTML)i=(0,U.jsx)(S.T5,H(H({},c),{},{children:(0,U.jsx)(S.wx,{children:(0,U.jsx)(k.ZP,{dangerouslySetInnerHTML:{__html:n},monospace:!0})})}));else if(a===j.Gi.IMAGE_PNG)i=(0,U.jsx)("div",{style:{backgroundColor:"white"},children:(0,U.jsx)("img",{alt:"Image ".concat(l," from code output"),src:"data:image/png;base64, ".concat(n)})});else if(a===j.Gi.PROGRESS){var E=parseInt(n);Ce(E>90?90:E)}i&&p.push((0,U.jsx)("div",{children:i},"code-output-".concat(l,"-").concat(o)))}})),p.length>=1&&n.push(p)}})),X&&(null===ne||void 0===ne?void 0:ne.type)===Z.qL.PYSPARK&&n.unshift([(0,U.jsx)(S.T5,{contained:!0,children:(0,U.jsx)(C.Z,{mt:1,children:we})},"progress_bar")]),{content:n,tableContent:t,testContent:r}}),[Pe,W,De,X,J,ne,we,ie]),Be=Ne.content,Le=Ne.tableContent,Ue=Ne.testContent,Fe=(null===xe||void 0===xe?void 0:xe[1])||0,He=Fe>30?" (30 out of ".concat(Fe," columns displayed)"):"",Qe=(0,c.useMemo)((function(){var e;if(De&&le){var n=le.uuid;if(D.$m.uuid===n)(null===Le||void 0===Le?void 0:Le.length)>=1?e=Le:X||(e=(0,U.jsx)(C.Z,{px:2,py:1,children:(0,U.jsx)(k.ZP,{muted:!0,children:K?"Error, check logs.":"No preview to display yet, try running the block."})}));else if(D.Rj.uuid===n)(null===Be||void 0===Be?void 0:Be.length)>=1?e=Be:X||(e=(0,U.jsx)(C.Z,{px:2,py:1,children:(0,U.jsx)(k.ZP,{muted:!0,children:K?"Error, check logs.":"No logs to display yet, try running the block."})}));else if(D.Jt.uuid===n){var o,i=null===t||void 0===t||null===(o=t.dbt)||void 0===o?void 0:o.sql;e=i?(0,U.jsx)(m.Z,{autoHeight:!0,language:I.Lu.SQL,padding:!0,readOnly:!0,value:i,width:"100%"}):null}else if(D.gM.uuid===n){var l,u=null===t||void 0===t||null===(l=t.dbt)||void 0===l?void 0:l.lineage;e=u?(0,U.jsx)(v.Z,{disabled:!0,enablePorts:!1,height:55*A.iI,pannable:ie,pipeline:H(H({},ne),{},{blocks:u}),zoomable:ie}):null}}else e=Be;return(0,U.jsxs)(U.Fragment,{children:[r,e]})}),[t,r,Be,K,De,X,ne,ie,le,Le]);return r||K||V?(0,U.jsxs)(U.Fragment,{children:[W&&(0,U.jsxs)(S.Nk,{addBottomPadding:X&&(null===ne||void 0===ne?void 0:ne.type)===Z.qL.PYSPARK,blockType:me,dynamicBlock:q,dynamicChildBlock:z,executedAndIdle:be,hasError:K,selected:ie,children:[!l&&(null===Ue||void 0===Ue?void 0:Ue.length)>=1&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(C.Z,{py:2,children:(0,U.jsx)(S.T5,{contained:!0,children:Ue.map((function(e,n){var t=e.error,o=e.message,r=e.stacktrace;return(0,U.jsxs)(C.Z,{mt:n>=1?3:0,children:[(0,U.jsx)(k.ZP,{monospace:!0,preWrap:!0,children:(0,U.jsx)(u(),{children:"".concat(o).concat(t?" "+t:"")})}),null===r||void 0===r?void 0:r.map((function(e){return(0,U.jsx)(k.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:(0,U.jsx)(u(),{children:e})},e)}))]},o)}))})}),(0,U.jsx)(C.Z,{mb:K?2:0,children:(0,U.jsx)(b.Z,{medium:!0})})]}),!l&&Qe]}),!W&&Qe,be&&!Y&&(0,U.jsxs)(S._A,{blockType:me,dynamicBlock:q,dynamicChildBlock:z,hasError:K,selected:ie,children:[(0,U.jsx)(S.MB,{}),(0,U.jsxs)(x.Z,{justifyContent:"space-between",children:[ue&&(0,U.jsx)(g.Z,{alignItems:"center",px:1,children:(0,U.jsx)(f.Z,H(H({},G),{},{onClick:function(){return ue(!l)},children:l?(0,U.jsxs)(x.Z,{alignItems:"center",children:[(0,U.jsx)(T._M,{muted:!0,size:2*A.iI}),"\xa0",(0,U.jsx)(k.ZP,{default:!0,children:"Expand output"})]}):(0,U.jsxs)(x.Z,{alignItems:"center",children:[(0,U.jsx)(T.Kh,{muted:!0,size:2*A.iI}),xe&&(0,U.jsx)(C.Z,{ml:2,children:(0,U.jsx)(k.ZP,{children:"".concat(xe[0]," rows x ").concat(xe[1]," columns").concat(He)})})]})}))}),(0,U.jsx)(S.a3,{children:(0,U.jsxs)(x.Z,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,U.jsx)(y.Z,H(H({},Q),{},{label:te>=1&&re?"Last run at ".concat(new Date(re.valueOf()).toLocaleString()):K?"Block executed with errors":"Block executed successfully",children:(0,U.jsxs)(x.Z,{alignItems:"center",children:[te>=1&&Number(oe)>Number(re)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(k.ZP,{small:!0,children:[(Number(oe)-Number(re))/1e3,"s"]}),(0,U.jsx)(C.Z,{mr:1})]}),!K&&(0,U.jsx)(T.Jr,{size:2*A.iI,success:!0}),K&&(0,U.jsx)(p.Z,{danger:!0,size:2*A.iI,children:(0,U.jsx)(k.ZP,{bold:!0,monospace:!0,small:!0,children:"!"})})]})})),!K&&!d.Qj.includes(me)&&(0,U.jsx)(C.Z,{pl:2,children:(0,U.jsxs)(x.Z,{alignItems:"center",children:[(0,U.jsx)(y.Z,H(H({},Q),{},{label:"Expand table",children:(0,U.jsx)(f.Z,H(H({},G),{},{onClick:function(){(0,N.OF)(null===ne||void 0===ne?void 0:ne.uuid,he),null===ee||void 0===ee||ee(M.cH.DATA),null===ae||void 0===ae||ae((function(e){return e.find((function(e){return e.uuid===he}))?e:(null===se||void 0===se||se(n),e.concat(n))}))},children:(0,U.jsx)(T.M0,{muted:!0,size:1.75*A.iI})}))})),(0,U.jsx)(C.Z,{pl:2}),(0,U.jsx)(y.Z,H(H({},Q),{},{forceVisible:Re,label:Re?"".concat(ye||0,"mb downloaded..."):"Save output as CSV file",children:(0,U.jsx)(f.Z,H(H({},G),{},{compact:!0,loading:Re,onClick:function(){Oe(null),Ie()},children:(0,U.jsx)(T.vc,{muted:!0,size:1.75*A.iI})}))}))]})})]})})]})]})]}):null}},93005:function(e,n,t){t.d(n,{$m:function(){return r},C:function(){return a},Jt:function(){return l},Rj:function(){return i},Xy:function(){return c},gM:function(){return u},vT:function(){return s}});var o=t(49125),r={uuid:"Preview results"},i={uuid:"Logs"},l={uuid:"SQL"},u={uuid:"Lineage"},c=function(e){var n,t,o=e.metadata,c=[i,l];return(null===o||void 0===o||null===(n=o.dbt)||void 0===n||null===(t=n.block)||void 0===t?void 0:t.snapshot)||(c.unshift(r),c.push(u)),c},a=2.5*o.iI,s="CodeBlock_HiddenBlock"},89949:function(e,n,t){t.d(n,{z:function(){return qe},Z:function(){return Ke}});var o=t(21831),r=t(75582),i=t(82394),l=t(82684),u=t(38626),c=t(10975),a=t(14567),s=t(83455),d=t(42201),f=t(18283),p=t(60328),m=t(67971),h=t(86673),v=t(19711),b=t(44162),g=t(28598);var x=function(e){var n=e.blocks,t=e.onClick,o=(0,l.useContext)(u.ThemeContext);return(0,g.jsx)(m.Z,{alignItems:"center",children:null===n||void 0===n?void 0:n.map((function(e){var n=e.color,r=e.type,i=e.uuid,l=(0,b.qn)(r,{blockColor:n,theme:o}).accentLight;return(0,g.jsx)(h.Z,{ml:1,mt:1,children:(0,g.jsx)(p.Z,{backgroundColor:l,compact:!0,onClick:function(){return t(e)},small:!0,children:(0,g.jsx)(v.ZP,{monospace:!0,small:!0,children:i})})},i)}))})},j=t(93461),Z=t(45419),_=t(60701),C=t(24224);function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?k(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var O=function(e){var n=e.block,t=e.blocks,o=e.openSidekickView,i=e.pipeline,u=(0,l.useMemo)((function(){return(0,C.HK)(t,(function(e){return e.uuid}))}),[t]),c=(0,l.useMemo)((function(){var e;return null===n||void 0===n||null===(e=n.callback_blocks)||void 0===e?void 0:e.reduce((function(e,n){var t=null===u||void 0===u?void 0:u[n];return t?e.concat(t):e}),[])}),[n,u]),a=(0,l.useMemo)((function(){var e;return null===n||void 0===n||null===(e=n.conditional_blocks)||void 0===e?void 0:e.reduce((function(e,n){var t=null===u||void 0===u?void 0:u[n];return t?e.concat(t):e}),[])}),[n,u]),s=(0,l.useMemo)((function(){var e,t=[];return null===(e=Object.entries((null===i||void 0===i?void 0:i.extensions)||{}))||void 0===e||e.forEach((function(e){var o=(0,r.Z)(e,2),i=o[0],l=o[1].blocks;null===l||void 0===l||l.forEach((function(e){var o=e.upstream_blocks,r=e.uuid;if(null!==o&&void 0!==o&&o.includes(null===n||void 0===n?void 0:n.uuid)){var l=null===u||void 0===u?void 0:u[r];l&&t.push(y(y({},l),{},{extension_uuid:i}))}}))})),t}),[n,u,i]);return(0,g.jsxs)(g.Fragment,{children:[(null===a||void 0===a?void 0:a.length)>=1&&(0,g.jsx)(h.Z,{mt:1,children:(0,g.jsxs)(j.Z,{flexDirection:"column",children:[(0,g.jsx)(h.Z,{px:1,children:(0,g.jsx)(v.ZP,{bold:!0,muted:!0,children:"Conditionals"})}),(0,g.jsx)(x,{blocks:a,onClick:function(e){var n=e.uuid;return o(_.cH.ADDON_BLOCKS,!0,{addon:Z.Q.CONDITIONAL,blockUUID:n})}})]})}),(null===c||void 0===c?void 0:c.length)>=1&&(0,g.jsx)(h.Z,{mt:1,children:(0,g.jsxs)(j.Z,{flexDirection:"column",children:[(0,g.jsx)(h.Z,{px:1,children:(0,g.jsx)(v.ZP,{bold:!0,muted:!0,children:"Callbacks"})}),(0,g.jsx)(x,{blocks:c,onClick:function(e){var n=e.uuid;return o(_.cH.ADDON_BLOCKS,!0,{addon:Z.Q.CALLBACK,blockUUID:n})}})]})}),(null===s||void 0===s?void 0:s.length)>=1&&(0,g.jsx)(h.Z,{mt:1,children:(0,g.jsxs)(j.Z,{flexDirection:"column",children:[(0,g.jsx)(h.Z,{px:1,children:(0,g.jsx)(v.ZP,{bold:!0,muted:!0,children:"Extensions"})}),(0,g.jsx)(x,{blocks:s,onClick:function(e){var n=e.extension_uuid,t=e.uuid;return o(_.cH.EXTENSIONS,!0,{blockUUID:t,extension:n})}})]})})]})},E=t(86422),T=t(32316),S=t(38341),I=t(16634),R=t(57722),A=t(65051),P=t(62084),w=t(42451),D=t(78759),M=t(49125),N=t(90211);function B(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function L(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 U=function(e){var n=e.addWidget,t=e.block,r=e.left,i=e.rightOffset,u=e.onClickCallback,c=e.open,a=e.parentRef,s=e.runBlock,d=e.topOffset,f=(0,l.useMemo)((function(){return w.CK.map((function(e){var o,r,i={configuration:{chart_type:e},language:t.language,type:E.tf.CHART,upstream_blocks:t?[t.uuid]:null},l=D.x8[e],u=(null===l||void 0===l||null===(o=l.configuration)||void 0===o?void 0:o.call(l,i))||{},c=E.t6.SQL===(null===t||void 0===t?void 0:t.language)?null:(null===l||void 0===l||null===(r=l.content)||void 0===r?void 0:r.call(l,i))||null,a=e;return t&&(a="".concat(a," for ").concat(t.uuid)),{label:function(){return(0,N.vg)(e)},onClick:function(){return n(L(L({},i),{},{name:"".concat(a," ").concat((0,N.Mp)()),configuration:L(L({},i.configuration),u),content:c}),{onCreateCallback:function(e){t&&E.t6.SQL!==t.language&&([E.DA.EXECUTED,E.DA.UPDATED].includes(t.status)?null===s||void 0===s||s({block:e,code:c,disableReset:!0}):null===s||void 0===s||s({block:t,runDownstream:!0}))}})},uuid:e}}))}),[w.CK,t,s]),p=(0,l.useMemo)((function(){return D._H.map((function(e){var o=e.label,r=L(L({},(0,e.widgetTemplate)({block:t})),{},{language:t.language,type:E.tf.CHART,upstream_blocks:t?[t.uuid]:null});return{label:o,onClick:function(){return n(r,{onCreateCallback:function(e){t&&E.t6.SQL!==t.language&&([E.DA.EXECUTED,E.DA.UPDATED].includes(t.status)?null===s||void 0===s||s({block:e,code:e.content,disableReset:!0}):null===s||void 0===s||s({block:t,runDownstream:!0}))}})},uuid:o()}}))}),[D._H,n,t,s]),m=[{isGroupingTitle:!0,label:function(){return"Custom charts"},uuid:"custom_charts"}].concat((0,o.Z)(f));return E.t6.SQL!==t.language&&m.push.apply(m,[{isGroupingTitle:!0,label:function(){return"Templates"},uuid:"chart_templates"}].concat((0,o.Z)(p))),(0,g.jsx)(P.Z,{items:m,left:r,onClickCallback:u,open:c,parentRef:a,rightOffset:i,topOffset:d,uuid:"CommandButtons/add_charts",width:25*M.iI})},F=t(47999),H=t(40656),Q=u.default.svg.withConfig({displayName:"Convert__SVGStyle",componentId:"sc-fmw0vr-0"})([""]),G=function(e){var n=e.fill,t=e.opacity,o=e.size,r=void 0===o?H.C:o,i=e.style,l=e.viewBox,u=void 0===l?"0 0 12 12":l;return(0,g.jsxs)(Q,{fill:n,height:r,opacity:t,style:i,viewBox:u,width:r,children:[(0,g.jsx)("path",{clipRule:"evenodd",d:"M2.5 1C1.67157 1 1 1.67157 1 2.5v.0625c0 .27614-.223858.5-.5.5s-.5-.22386-.5-.5V2.5C0 1.11929 1.11929 0 2.5 0h7C10.8807 0 12 1.11929 12 2.5v7c0 1.3807-1.1193 2.5-2.5 2.5h-7C1.11929 12 0 10.8807 0 9.5v-.0625c0-.27614.223858-.5.5-.5s.5.22386.5.5V9.5c0 .8284.67157 1.5 1.5 1.5h7c.8284 0 1.5-.6716 1.5-1.5v-7c0-.82843-.6716-1.5-1.5-1.5h-7z",fill:"url(#paint0_linear_1332_60037)",fillRule:"evenodd"}),(0,g.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.05806 3.55806c.24408-.24408.6398-.24408.88388 0l2 2c.24408.24408.24408.6398 0 .88388l-2 2c-.24408.24408-.6398.24408-.88388 0-.24408-.24408-.24408-.6398 0-.88388l.93306-.93306H1C.654822 6.625.375 6.34518.375 6s.279822-.625.625-.625h5.99112l-.93306-.93306c-.24408-.24408-.24408-.6398 0-.88388z",fill:"#fff"}),(0,g.jsx)("defs",{children:(0,g.jsxs)("linearGradient",{id:"paint0_linear_1332_60037",x1:"-.618557",y1:"-.000001",x2:"10.5709",y2:".83113",gradientUnits:"userSpaceOnUse",children:[(0,g.jsx)("stop",{stopColor:"#FFCC19"}),(0,g.jsx)("stop",{offset:".585938",stopColor:"#2ECDF7"}),(0,g.jsx)("stop",{offset:"1",stopColor:"#9E7BFF"})]})})]})},W=t(30264),q=t(79749),z=t(54283),K=t(46261),V=t(82531),Y=t(23831),X=t(82635),J=t(10503),$=t(93005),ee=t(16115),ne=t(98781),te=t(75968),oe=t(54405),re=t(96510);function ie(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function le(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ie(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ue,ce=function(e){var n,t,o=e.addNewBlock,i=e.addWidget,c=e.block,a=e.blocks,d=e.deleteBlock,f=e.executionState,x=e.fetchFileTree,j=e.fetchPipeline,Z=e.hideExtraButtons,k=e.interruptKernel,y=e.isEditingBlock,O=e.openSidekickView,T=e.pipeline,S=e.runBlock,R=e.setIsEditingBlock,A=e.savePipelineContent,w=e.setErrors,D=e.setOutputCollapsed,N=c.all_upstream_blocks_executed,B=void 0===N||N,L=c.color,H=c.metadata,Q=c.type,ie=c.uuid,ue=(0,l.useRef)(null),ce=(0,l.useRef)(null),ae=(0,l.useRef)(null),se=(0,l.useRef)(null),de=null===T||void 0===T?void 0:T.type,fe=(0,l.useState)(!1),pe=fe[0],me=fe[1],he=(0,l.useState)(!1),ve=he[0],be=he[1],ge=(0,l.useState)(!1),xe=ge[0],je=ge[1],Ze=(0,l.useState)(!1),_e=Ze[0],Ce=Ze[1],ke=(0,l.useContext)(u.ThemeContext),ye=X.uF.IDLE!==f,Oe=(0,b.qn)(Q,{blockColor:L,theme:ke}).accent,Ee=(0,l.useMemo)((function(){return de===ne.qL.STREAMING}),[de]),Te=(0,l.useMemo)((function(){return de===ne.qL.INTEGRATION}),[de]),Se=(0,l.useMemo)((function(){return(0,te.Ts)(c,a,"CommandButtons",o).map((function(e){return le(le({},e),{},{onClick:function(){return A().then((function(){return e.onClick()}))}})}))}),[o,c,a,A]),Ie=(0,l.useMemo)((function(){return(0,C.HK)(a,(function(e){return e.uuid}))}),[a]),Re=(0,l.useMemo)((function(){return E.tf.DBT===(null===c||void 0===c?void 0:c.type)}),[c]),Ae=(0,l.useMemo)((function(){return E.tf.MARKDOWN===(null===c||void 0===c?void 0:c.type)}),[c]),Pe=(0,s.Db)(V.ZP.pipelines.useUpdate(null===T||void 0===T?void 0:T.uuid),{onSuccess:function(e){return(0,re.wD)(e,{callback:function(){j()},onErrorCallback:function(e,n){return w({errors:n,response:e})}})}}),we=(0,r.Z)(Pe,2),De=we[0];return we[1].isLoading,(0,g.jsxs)(m.Z,{alignItems:"center",children:[X.uF.QUEUED===f&&(0,g.jsx)(z.Z,{color:(ke||Y.Z).content.active,type:"cylon"}),X.uF.BUSY===f&&(0,g.jsx)(z.Z,{color:(ke||Y.Z).content.active}),S&&!ye&&!Ee&&(0,g.jsxs)(g.Fragment,{children:[!Re&&(0,g.jsx)(K.Z,{appearBefore:!0,default:!0,label:(0,g.jsxs)(v.ZP,{children:["Run block \xa0 \xa0",(0,g.jsx)(q.Z,{inline:!0,keyTextGroups:[[(0,oe.V5)()?ee.RJ:ee.hE,ee.Lz]],monospace:!0,uuidForKey:ie})]}),size:3*M.iI,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){B?S({block:c}):je(!0)},children:(0,g.jsx)(I.Z,{color:Oe,size:3*M.iI,children:(0,g.jsx)(J.Py,{black:!0,size:1.5*M.iI})})})}),Re&&(0,g.jsx)(p.Z,{backgroundColor:Oe,beforeIcon:(0,g.jsx)(J.Py,{size:1.5*M.iI}),compact:!0,onClick:function(){B?S({block:c}):je(!0)},small:!0,children:null!==H&&void 0!==H&&null!==(n=H.dbt)&&void 0!==n&&null!==(t=n.block)&&void 0!==t&&t.snapshot?"Run snapshot":"Compile & preview"}),(0,g.jsx)(F.Z,{disableEscape:!0,onClickOutside:function(){return je(!1)},open:xe,children:(0,g.jsx)(P.Z,{items:[{label:function(){return"Execute block"},onClick:function(){return S({block:c})},uuid:"execute_block"},{label:function(){return"Execute with upstream blocks"},onClick:function(){return S({block:c,runUpstream:!0})},uuid:"execute_upstream"}],onClickCallback:function(){return je(!1)},open:xe,parentRef:ae,rightOffset:13.25*M.iI,topOffset:4.5*M.iI,uuid:"execute_actions",width:25*M.iI})})]}),ye&&(0,g.jsx)(h.Z,{ml:M.cd,children:(0,g.jsx)(K.Z,{appearBefore:!0,default:!0,label:(0,g.jsxs)(v.ZP,{children:["Interrupt kernel \xa0 \xa0",(0,g.jsx)(q.Z,{inline:!0,keyTextGroups:[[ee.kA],[ee.kA]],monospace:!0,uuidForKey:ie})]}),size:$.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return k()},children:(0,g.jsx)(I.Z,{borderSize:1.5,size:$.C,children:(0,g.jsx)(J.x8,{size:1*M.iI})})})})}),!Z&&E.tf.SCRATCHPAD===c.type&&!Ee&&(0,g.jsx)(h.Z,{ml:M.cd,children:(0,g.jsx)(W.Z,{items:Se,onClickCallback:function(){return be(!1)},onClickOutside:function(){return be(!1)},open:ve,parentRef:ce,rightOffset:0,topOffset:4,uuid:"CommandButtons/convert_block",children:(0,g.jsx)(K.Z,{appearBefore:!0,default:!0,label:(0,g.jsx)(v.ZP,{children:"Convert block"}),size:$.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return be(!ve)},ref:ce,children:(0,g.jsx)(G,{size:$.C})})})})}),!Z&&[E.tf.DATA_LOADER,E.tf.TRANSFORMER].includes(c.type)&&!Ee&&!Te&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.Z,{ml:M.cd,ref:ue,children:(0,g.jsx)(K.Z,{appearBefore:!0,default:!0,label:"Add chart",size:2.25*M.iI,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return me((function(e){return!e}))},children:(0,g.jsx)(J.GQ,{size:2.25*M.iI})})})}),i&&(0,g.jsx)(F.Z,{disableEscape:!0,onClickOutside:function(){return me(!1)},open:pe,children:(0,g.jsx)(U,{addWidget:i,block:c,onClickCallback:function(){return me(!1)},open:pe,parentRef:ue,rightOffset:9*M.iI,runBlock:S,topOffset:2*M.iI})})]}),!Z&&Ae&&(0,g.jsx)(h.Z,{ml:M.cd,children:(0,g.jsx)(K.Z,{appearBefore:!0,default:!0,label:y?"Close editor":"Edit",size:$.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return R((function(e){return!e}))},children:y?(0,g.jsx)(J.Jr,{size:$.C,success:!0}):(0,g.jsx)(J.I8,{size:$.C})})})}),!Z&&(0,g.jsx)(h.Z,{ml:M.cd,children:(0,g.jsx)(K.Z,{appearBefore:!0,default:!0,label:"View and edit settings for this block",size:$.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return null===O||void 0===O?void 0:O(_.cH.BLOCK_SETTINGS)},children:(0,g.jsx)(J.JG,{default:!0,size:$.C})})})}),!Z&&(0,g.jsx)("div",{ref:se,children:(0,g.jsx)(h.Z,{ml:M.cd,children:(0,g.jsx)(K.Z,{appearBefore:!0,default:!0,label:(0,g.jsx)(v.ZP,{children:"More actions"}),size:$.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return Ce((function(e){return!e}))},children:(0,g.jsx)(I.Z,{borderSize:1.5,default:!0,size:$.C,children:(0,g.jsx)(J.mH,{default:!0,size:M.iI})})})})})}),!Z&&(0,g.jsx)(F.Z,{disableEscape:!0,onClickOutside:function(){return Ce(!1)},open:_e,children:(0,g.jsx)(P.Z,{items:(0,te.J8)(c,S,d,D,Ee||Te,{addNewBlock:o,blocksMapping:Ie,fetchFileTree:x,fetchPipeline:j,savePipelineContent:A,updatePipeline:De}),onClickCallback:function(){return Ce(!1)},open:_e,parentRef:se,rightOffset:4.75*M.iI,topOffset:2*M.iI,uuid:"FileHeaderMenu/file_items"})})]})};!function(e){e.APPEND="append",e.FAIL="fail",e.REPLACE="replace"}(ue||(ue={}));var ae,se=[ue.APPEND,ue.FAIL,ue.REPLACE];!function(e){e.BIGQUERY="bigquery",e.CLICKHOUSE="clickhouse",e.DRUID="druid",e.MYSQL="mysql",e.POSTGRES="postgres",e.REDSHIFT="redshift",e.SNOWFLAKE="snowflake",e.TRINO="trino"}(ae||(ae={}));var de=t(34744),fe=t(25717),pe=t(10919),me=t(68792),he=t(5882),ve=t(87372),be=t(2005),ge=t(73942),xe=t(31012),je=t(37391),Ze="0.75em",_e=u.default.div.withConfig({displayName:"indexstyle__MarkdownContainer",componentId:"sc-j72mol-0"})(["font-family:",";margin:0 ","px;overflow:auto;"," "," p{margin:0.5em 0;}blockquote{margin:"," 0;padding:","px 0;","}blockquote:before{content:'';font-size:","px;line-height:0.1em;margin-right:0.25em;vertical-align:-0.4em;}blockquote p{display:inline;}pre{border-radius:","px;white-space:pre;margin:"," 0;padding:","px;overflow-x:auto;"," "," span{padding:0;}}ul,ol{margin-bottom:",";padding-left:","px;}li{","}li > input[type='checkbox']{pointer-events:none;}table{"," margin:",";thead{font-family:",";","}th,td{padding:","px ","px;","}}"],be.ry,M.iI,je.w5,(function(e){return"\n color: ".concat((e.theme||Y.Z).content.active,";\n ")}),Ze,M.iI,(function(e){return"\n border-left: ".concat(.5*M.iI,"px solid ").concat((e.theme||Y.Z).content.active,";\n ")}),3*M.l4,ge.BG,Ze,M.iI,je.w5,(function(e){return"\n background-color: ".concat((e.theme||Y.Z).interactive.defaultBorder,";\n ")}),Ze,3*M.iI,xe.iD,xe.iD,Ze,be.nF,(function(e){return"\n border-bottom: ".concat(ge.YF,"px solid ").concat((e.theme||Y.Z).content.active,";\n ")}),.5*M.iI,.75*M.iI,(function(e){return"\n border: ".concat(ge.YF,"px solid ").concat((e.theme||Y.Z).content.muted,";\n ")}));var Ce=function(e){var n=e.children;return(0,g.jsx)(_e,{children:(0,g.jsx)(me.D,{components:{a:function(e){var n=e.children,t=e.href;return(0,g.jsx)(pe.Z,{href:t,inline:!0,openNewWindow:!0,primary:!0,children:n})},code:function(e){var n=e.children;return(0,g.jsx)(v.ZP,{backgroundColor:Y.Z.interactive.defaultBorder,inline:!0,monospace:!0,pre:!0,style:{fontSize:"13px"},children:n})},em:function(e){var n=e.children;return(0,g.jsx)(v.ZP,{inline:!0,italic:!0,children:n})},h1:function(e){var n=e.children;return(0,g.jsx)(ve.Z,{level:1,children:n})},h2:function(e){var n=e.children;return(0,g.jsx)(ve.Z,{level:2,children:n})},h3:function(e){var n=e.children;return(0,g.jsx)(ve.Z,{level:3,children:n})},h4:function(e){var n=e.children;return(0,g.jsx)(ve.Z,{level:4,children:n})},h5:function(e){var n=e.children;return(0,g.jsx)(ve.Z,{level:5,children:n})},p:function(e){var n=e.children;return(0,g.jsx)(v.ZP,{children:n})},strong:function(e){var n=e.children;return(0,g.jsx)(v.ZP,{bold:!0,inline:!0,children:n})}},remarkPlugins:[he.Z],children:n})})},ke=t(55378),ye=t(82944),Oe=t(87815),Ee=t(66653);function Te(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Se(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Te(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Te(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ie=function(e){var n=e.block,t=e.blockConfiguration,o=e.blockRefs,r=e.blocks,c=e.updateBlockConfiguration,a=(0,l.useContext)(u.ThemeContext),s=E.t6.R===(null===n||void 0===n?void 0:n.language),d=E.t6.SQL===(null===n||void 0===n?void 0:n.language),f=null===r||void 0===r?void 0:r.find((function(e){var n=e.language;return E.t6.PYTHON===n})),p=(0,l.useMemo)((function(){var e=[null];return d&&f?e.push.apply(e,[null,1]):e.push(1),e}),[f,d]),m=(0,l.useMemo)((function(){var e=[{tooltipMessage:null,uuid:"Variable"},{tooltipMessage:null,uuid:"Block"}];return d&&f&&e.push({tooltipMessage:"Customize the full table name that this block gets created in. Include database, schema, and table name where applicable.",uuid:"Table name"}),e}),[f,d]),h=(0,l.useMemo)((function(){return null===r||void 0===r?void 0:r.map((function(e,n){var r,l=e.color,u=e.language,p=e.type,m=e.uuid,h=(0,b.qn)(p,{blockColor:l,theme:a}).accent,x=E.t6.PYTHON===u;r=d?"{{ df_".concat(n+1," }}"):s?"df".concat(n+1):"data".concat(n>=1?"_".concat(n+1):null);var j=[(0,g.jsx)(v.ZP,{default:!0,monospace:!0,small:!0,children:r},"variable-".concat(m)),(0,g.jsx)(pe.Z,{color:h,onClick:function(){var e,n,t=null===o||void 0===o||null===(e=o.current)||void 0===e?void 0:e["".concat(p,"s/").concat(m,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,g.jsx)(v.ZP,{color:h,monospace:!0,small:!0,children:m})},"block-".concat(m))];if(d){var Z="table-name-input-".concat(m),_=(null===t||void 0===t?void 0:t[w.Yf])||{},C=(null===_||void 0===_?void 0:_[m])||{};x?j.push((0,g.jsx)(ye.Z,{borderless:!0,compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;c((0,i.Z)({},w.Yf,Se(Se({},_),{},(0,i.Z)({},m,Se(Se({},C),{},(0,i.Z)({},w.aZ,n))))))},onClick:Ee.j,placeholder:"[database_optional].[schema_optional].[table]",small:!0,value:(null===C||void 0===C?void 0:C[w.aZ])||""},Z)):f&&j.push((0,g.jsx)(v.ZP,{italic:!0,muted:!0,small:!0,children:"Table name is defined in upstream block."},Z))}return j}))}),[f,t,o,r,s,d,a,c]);return(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(Oe.Z,{columnFlex:p,columns:m,compact:!0,noBorder:!0,rows:h,uuid:"CodeBlock/UpstreamBlockSettings/".concat(null===n||void 0===n?void 0:n.uuid)})})},Re=t(59582),Ae=t(66166),Pe=t(31524),we=t(32365),De=t(84212),Me=t(80636),Ne=t(91427),Be=t(25958),Le=t(43482),Ue=t(51504),Fe=t(7715),He=t(87323),Qe=t(41150);function Ge(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function We(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ge(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ge(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qe=1e3;function ze(e,n){var t,x,Z,k,y=e.addNewBlock,P=e.addNewBlockMenuOpenIdx,D=e.addWidget,B=e.allBlocks,L=e.allowCodeBlockShortcuts,U=e.autocompleteItems,F=e.block,H=e.blockIdx,Q=e.blockRefs,G=e.blockTemplates,q=e.blocks,z=void 0===q?[]:q,Y=e.dataProviders,oe=e.defaultValue,ie=void 0===oe?"":oe,le=e.deleteBlock,me=e.disableDrag,he=e.disableShortcuts,ve=e.executionState,be=e.extraContent,ge=e.fetchFileTree,xe=e.fetchPipeline,je=e.height,Ze=e.hideExtraCommandButtons,_e=e.hideExtraConfiguration,Oe=e.hideHeaderInteractiveInformation,Te=e.hideRunButton,Se=e.interruptKernel,Ge=e.mainContainerRef,ze=e.mainContainerWidth,Ke=e.messages,Ve=void 0===Ke?[]:Ke,Ye=e.noDivider,Xe=e.onCallbackChange,Je=e.onChange,$e=e.onClickAddSingleDBTModel,en=e.onDrop,nn=e.openSidekickView,tn=e.pipeline,on=e.runBlock,rn=e.runningBlocks,ln=e.savePipelineContent,un=e.selected,cn=e.setAddNewBlockMenuOpenIdx,an=e.setAnyInputFocused,sn=e.setCreatingNewDBTModel,dn=e.setEditingBlock,fn=e.setErrors,pn=e.setOutputBlocks,mn=e.setSelected,hn=e.setSelectedBlock,vn=e.setSelectedOutputBlock,bn=e.setTextareaFocused,gn=e.showBrowseTemplates,xn=e.textareaFocused,jn=e.widgets,Zn=(0,l.useContext)(u.ThemeContext),_n=F||{},Cn=_n.callback_content,kn=_n.configuration,yn=void 0===kn?{}:kn,On=_n.color,En=_n.error,Tn=_n.has_callback,Sn=_n.language,In=_n.pipelines,Rn=_n.replicated_block,An=_n.type,Pn=_n.upstream_blocks,wn=void 0===Pn?[]:Pn,Dn=_n.uuid,Mn=(0,l.useMemo)((function(){return yn}),[yn]),Nn=(0,l.useMemo)((function(){var e;return(null===(e=Object.values(In||{}))||void 0===e?void 0:e.length)||1}),[In]),Bn=(0,l.useState)(!1),Ln=Bn[0],Un=Bn[1],Fn=(0,l.useState)(null),Hn=Fn[0],Qn=Fn[1],Gn=(0,l.useState)(!1),Wn=Gn[0],qn=Gn[1],zn=(0,l.useState)(!1),Kn=zn[0],Vn=zn[1],Yn=(0,l.useState)(ie),Xn=Yn[0],Jn=Yn[1],$n=(0,l.useState)(null),et=$n[0],nt=$n[1],tt=tn||{},ot=tt.type,rt=tt.uuid,it=(0,l.useMemo)((function(){return ne.qL.STREAMING===ot}),[ot]),lt=E.tf.DBT===An,ut=E.t6.SQL===Sn,ct=E.t6.R===Sn,at=E.tf.MARKDOWN===An,st=Mn[w.mW];ut&&void 0===st&&(st=qe);var dt=(0,l.useState)(We(We({},Mn),{},(t={},(0,i.Z)(t,w.cH,Mn[w.cH]),(0,i.Z)(t,w.Sv,Mn[w.Sv]),(0,i.Z)(t,w.sc,Mn[w.sc]),(0,i.Z)(t,w.BD,Mn[w.BD]),(0,i.Z)(t,w.m$,Mn[w.m$]),(0,i.Z)(t,w.Pi,Mn[w.Pi]||{}),(0,i.Z)(t,w.Mv,Mn[w.Mv]),(0,i.Z)(t,w.eW,Mn[w.eW]),(0,i.Z)(t,w.nq,Mn[w.nq]||ue.APPEND),(0,i.Z)(t,w.mW,st),(0,i.Z)(t,w.bk,Mn[w.bk]),(0,i.Z)(t,w.Mi,!!Mn[w.Mi]),t))),ft=dt[0],pt=dt[1],mt=(0,l.useState)(null),ht=mt[0],vt=mt[1],bt=(0,l.useState)(at),gt=bt[0],xt=bt[1],jt=(0,l.useState)(!1),Zt=jt[0],_t=jt[1],Ct=(0,l.useState)(Dn),kt=Ct[0],yt=Ct[1],Ot=(0,l.useState)(!1),Et=Ot[0],Tt=Ot[1],St=(0,l.useState)(0),It=St[0],Rt=St[1],At=(0,l.useState)(null),Pt=At[0],wt=At[1],Dt=(0,l.useState)(null),Mt=Dt[0],Nt=Dt[1],Bt=(0,l.useState)(Ve),Lt=Bt[0],Ut=Bt[1],Ft=(0,l.useState)((0,$.Xy)(F)[0]),Ht=Ft[0],Qt=Ft[1],Gt=(0,c.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:F,type:$.vT}}),[F]),Wt=(0,r.Z)(Gt,2),qt=Wt[0],zt=Wt[1],Kt=(0,a.L)((function(){return{accept:$.vT,drop:function(e){return null===en||void 0===en?void 0:en(F,e)}}}),[F]),Vt=(0,r.Z)(Kt,2)[1],Yt=(0,l.useMemo)((function(){var e;return(null===F||void 0===F||null===(e=F.metadata)||void 0===e?void 0:e.dbt)||{project:null,projects:{}}}),[F]),Xt=(0,l.useMemo)((function(){return Yt.projects||{}}),[Yt]),Jt=(0,l.useMemo)((function(){return Yt.project||ft[w.eW]}),[ft,Yt]),$t=(0,l.useMemo)((function(){return Xt[Jt]||{target:null,targets:[]}}),[Jt,Xt]),eo=(0,l.useMemo)((function(){return $t.targets||[]}),[$t]),no=(0,l.useMemo)((function(){return ft[w.Mv]}),[ft]),to=(0,l.useState)(no&&!(null!==eo&&void 0!==eo&&eo.includes(no))),oo=to[0],ro=to[1],io=(0,l.useState)(null),lo=io[0],uo=io[1];(0,l.useEffect)((function(){Cn!==lo&&uo(Cn)}),[lo,Cn]);var co=(0,Ae.Z)(F);(0,l.useEffect)((function(){if(JSON.stringify(F)!=JSON.stringify(co)){var e,n=(0,Le.Rt)([F]).messages,t=null===n||void 0===n||null===(e=n[An])||void 0===e?void 0:e[Dn];(null===t||void 0===t?void 0:t.length)>=1&&Ut(t)}}),[F,An,Dn,co,Ut]);var ao=(0,Ae.Z)(Ve);(0,l.useEffect)((function(){"undefined"!==typeof Ve&&Ve.length!==(null===ao||void 0===ao?void 0:ao.length)&&Ut(Ve)}),[Ve,ao,Ut]);var so=(0,l.useMemo)((function(){var e=new Set;return null===Y||void 0===Y||Y.forEach((function(n){var t=n.profiles;e=new Set([].concat((0,o.Z)(e),(0,o.Z)(t)))})),(0,o.Z)(e)}),[Y]),fo=(0,l.useMemo)((function(){return"".concat(rt,"/").concat(Dn,"/codeCollapsed")}),[rt,Dn]),po=(0,l.useMemo)((function(){return"".concat(rt,"/").concat(Dn,"/outputCollapsed")}),[rt,Dn]);(0,l.useEffect)((function(){Vn((0,Ne.U2)(fo,!1)),Tt((0,Ne.U2)(po,!1))}),[fo,po]);var mo=(0,l.useRef)(null),ho=(0,l.useMemo)((function(){return(0,C.HK)(z,(function(e){return e.uuid}))}),[z]),vo=(0,l.useMemo)((function(){return!(null===jn||void 0===jn||!jn.find((function(e){return e.upstream_blocks.includes(Dn)})))}),[Dn,jn]),bo=(0,l.useCallback)((function(e){var n=e||{},t=n.block,o=n.code,r=n.disableReset,i=n.runDownstream,l=n.runIncompleteUpstream,u=n.runSettings,c=n.runUpstream,a=n.runTests;if(null===a||"undefined"===typeof a){var s=(t||{}).type;a=[E.tf.DATA_LOADER,E.tf.DATA_EXPORTER,E.tf.TRANSFORMER].includes(s)}lt&&$.Rj!==Ht&&Qt($.Rj),on({block:t,code:o||Xn,runDownstream:i||vo,runIncompleteUpstream:l||!1,runSettings:u,runTests:a||!1,runUpstream:c||!1}),r||(Rt(1+Number(It)),wt(null),Tt(!1))}),[Xn,vo,lt,on,It,Ht,Rt,wt,Qt]),go=!(null===rn||void 0===rn||!rn.find((function(e){return e.uuid===Dn})))||(null===Lt||void 0===Lt?void 0:Lt.length)>=1&&ve!==X.uF.IDLE;(0,l.useEffect)((function(){go&&Nt(Number(new Date))}),[go,Nt]);var xo=(0,Ae.Z)(ve);(0,l.useEffect)((function(){ve===X.uF.IDLE&&ve!==xo&&wt(Number(new Date))}),[ve,xo,wt]);var jo=(0,l.useCallback)((function(e){var n=e.editorRect.top,t=e.position.lineNumberTop;if(null!==Ge&&void 0!==Ge&&Ge.current){var o=Ge.current.getBoundingClientRect().height;if(n+t>o){var r=Ge.current.scrollTop+(t-o+n);Ge.current.scrollTo(0,r)}else if(t+n<we.aU){var i=Ge.current.scrollTop+(t+n-we.aU);Ge.current.scrollTo(0,i)}}}),[Ge]),Zo=(0,l.useMemo)((function(){return(0,te.h5)(Lt,ht)}),[ht,Lt]),_o=(0,te.oI)(Zo),Co=_o.hasError,ko=_o.hasOutput,yo=(0,b.qn)(An,{blockColor:On,theme:Zn}).accent,Oo=(null===wn||void 0===wn?void 0:wn.length)||0,Eo=(0,He.cU)([F],z)[0],To=Eo.dynamic,So=Eo.dynamicUpstreamBlock,Io=Eo.reduceOutput,Ro=Eo.reduceOutputUpstreamBlock,Ao=(0,l.useMemo)((function(){return(0,te._o)({block:F,dynamic:To,dynamicUpstreamBlock:So,hasError:Co,reduceOutput:Io,reduceOutputUpstreamBlock:Ro,selected:un})}),[F,To,So,Co,Io,Ro,un]),Po=Ao.borderColorShareProps,wo=Ao.tags,Do=(0,l.useCallback)((function(){un||(null===an||void 0===an||an(!1),null===mn||void 0===mn||mn(!0))}),[un,an,mn]),Mo=V.ZP.blocks.pipelines.detail(rt,$.gM.uuid===(null===Ht||void 0===Ht?void 0:Ht.uuid)||$.Jt.uuid===(null===Ht||void 0===Ht?void 0:Ht.uuid)?encodeURIComponent(Dn):null,{_format:"dbt"},{revalidateOnFocus:!0}),No=Mo.data,Bo=Mo.mutate,Lo=(0,l.useMemo)((function(){var e;return(null===No||void 0===No||null===(e=No.block)||void 0===e?void 0:e.metadata)||{}}),[No]),Uo=(0,s.Db)(V.ZP.blocks.pipelines.useUpdate(rt,Dn),{onError:function(e){var n=(0,re.qQ)(e).messages;vt(n)},onSuccess:function(e){return(0,re.wD)(e,{callback:function(e){_t(!1),xe(),ge(),Jn(Xn),null!==e&&void 0!==e&&e.block&&hn(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return fn({errors:n,response:e})}})}}),Fo=(0,r.Z)(Uo,1)[0],Ho="CodeBlock/".concat(Dn),Qo=(0,Qe.y)(),Go=Qo.registerOnKeyDown,Wo=Qo.unregisterOnKeyDown;(0,l.useEffect)((function(){return function(){Wo(Ho)}}),[Wo,Ho]),Go(Ho,(function(e,n,t){he&&!L||(Zt&&String(t[0])===String(ee.Uq)&&String(t[1])!==String(ee.zX)?Dn===kt?e.target.blur():Fo({block:We(We({},F),{},{name:kt})}):un&&!Te&&((0,Ue.y)([ee.zX,ee.Uq],n)||(0,Ue.y)([ee.PQ,ee.Uq],n)?bo({block:F}):(0,Ue.y)([ee.XR,ee.Uq],n)&&y&&(e.preventDefault(),y({language:Sn,type:An,upstream_blocks:[Dn]}),bo({block:F}))))}),[y,F,Te,Zt,kt,bo,un,Fo]),(0,l.useEffect)((function(){var e;return Mt&&(e=setInterval((function(){return nt(Number(new Date))}),1e3)),et&&!go&&clearInterval(e),function(){return clearInterval(e)}}),[et,go,Mt]);var qo=(0,l.useCallback)((function(e){var n,t=(n={},(0,i.Z)(n,E.tf.CUSTOM,Object.values(E.Lq).reduce((function(n,t){return(null===e||void 0===e?void 0:e.color)!==t&&n.push({label:function(){return(0,g.jsx)(j.Z,{alignItems:"center",children:(0,g.jsxs)(v.ZP,{noWrapping:!0,children:["Change color to ",(0,g.jsx)(v.ZP,{color:(0,b.qn)(E.tf.CUSTOM,{blockColor:t}).accent,inline:!0,children:t})]})})},onClick:function(){Fo({block:We(We({},e),{},{color:t})})},uuid:t}),n}),[])),(0,i.Z)(n,E.tf.SCRATCHPAD,(0,o.Z)((0,te.Ts)(e,z,"block_menu/scratchpad",y)).map((function(e){return We(We({},e),{},{onClick:function(){return ln().then((function(){return e.onClick()}))}})}))),n);return t[e.type]}),[y,z,ln,Fo]),zo=(0,l.useMemo)((function(){return Rn&&(null===ho||void 0===ho?void 0:ho[Rn])}),[ho,Rn]),Ko=(0,l.useMemo)((function(){return!Rn&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(R.Z,{autoHeight:!0,autocompleteProviders:Hn,block:F,height:je,language:Sn,onChange:function(e){Jn(e),null===Je||void 0===Je||Je(e)},onDidChangeCursorPosition:jo,placeholder:E.tf.DBT===An&&E.t6.YAML===Sn?"e.g. --select ".concat(Jt||"project","/models --exclude ").concat(Jt||"project","/models/some_dir"):"Start typing here...",selected:un,setSelected:mn,setTextareaFocused:bn,shortcuts:Te?[]:[function(e,n){return(0,Me.Q)(e,(function(){Te||bo({block:F,code:n.getValue()})}))}],textareaFocused:xn,value:Xn,width:"100%"}),Tn&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(de.Z,{}),(0,g.jsxs)(h.Z,{mt:1,children:[(0,g.jsxs)(b.y9,{normalPadding:!0,children:[(0,g.jsx)(v.ZP,{small:!0,children:"Callback block: define @on_success or @on_failure callbacks for this block."}),(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,small:!0,children:["kwargs",(0,g.jsx)(v.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:" \u2192 "}),"global variables"]})]}),(0,g.jsx)(R.Z,{autoHeight:!0,autocompleteProviders:Hn,language:"python",onChange:function(e){uo(e),null===Xe||void 0===Xe||Xe(e)},onDidChangeCursorPosition:jo,placeholder:"Start typing here...",selected:un,setSelected:mn,setTextareaFocused:bn,textareaFocused:xn,value:lo,width:"100%"})]})]})]})}),[Hn,F,Sn,An,lo,Xn,Jt,Tn,je,Te,Xe,Je,jo,Rn,bo,un,Jn,mn,bn,xn]);(0,l.useEffect)((function(){U&&Qn({python:(0,Re.Z)({autocompleteItems:U,block:F,blocks:z,pipeline:tn})})}),[U,F,z,tn]);var Vo=(0,l.useMemo)((function(){return lt?(0,g.jsx)(h.Z,{py:1,children:(0,g.jsx)(T.Z,{onClickTab:function(e){Qt(e),$.gM.uuid!==e.uuid&&$.Jt.uuid!==e.uuid||Bo()},selectedTabUUID:null===Ht||void 0===Ht?void 0:Ht.uuid,small:!0,tabs:(0,$.Xy)(F)})}):null}),[F,Bo,lt,Ht]),Yo=(0,l.useMemo)((function(){return(0,g.jsx)(A.Z,We(We({},Po),{},{block:F,blockMetadata:Lo,buttonTabs:Vo,collapsed:Et,hasOutput:ko,isInProgress:go,mainContainerWidth:ze,messages:Zo,openSidekickView:nn,pipeline:tn,runCount:It,runEndTime:Pt,runStartTime:Mt,selected:un,selectedTab:Ht,setCollapsed:function(e){Tt((function(){return(0,Ne.t8)(po,e),e}))},setErrors:fn,setOutputBlocks:pn,setSelectedOutputBlock:vn,setSelectedTab:Qt}))}),[F,Lo,Po,Vo,ko,go,ze,Zo,nn,Et,po,tn,It,Pt,Mt,un,Ht,fn,pn,Tt,vn]),Xo=(0,l.useCallback)((function(){return qn(!1)}),[]),Jo=(0,l.useRef)(null),$o=(0,l.useCallback)((function(e){clearTimeout(Jo.current),pt((function(n){return We(We({},n),e)})),Jo.current=setTimeout((function(){var n=We(We({},ft),e);("undefined"!==typeof n[w.cH]&&"undefined"!==n[w.sc]||"undefined"!==typeof n[w.Mv]||"undefined"!==typeof n[w.eW]||"undefined"!==typeof n[w.mW])&&ln({block:{configuration:n,uuid:Dn}})}),1e3)}),[Dn,ft,ln]),er=Pe.zJ.BIGQUERY===ft[w.cH]||Pe.zJ.SNOWFLAKE===ft[w.cH],nr=(0,l.useMemo)((function(){return(null===z||void 0===z?void 0:z.length)||0}),[z]),tr=(0,l.useMemo)((function(){return Xn?(0,g.jsx)(Ce,{children:Xn}):(0,g.jsx)(h.Z,{px:1,children:(0,g.jsx)(v.ZP,{monospace:!0,muted:!0,children:"Double-click to edit"})})}),[Xn]);(0,l.useEffect)((function(){at&>&&!un&&xt(!1)}),[gt,at,un]);var or=(0,l.useMemo)((function(){return(0,g.jsx)(ye.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){an(!1)}),300)},onChange:function(e){an(!0),$o((0,i.Z)({},w.mW,+e.target.value)),e.preventDefault()},onClick:Ee.j,onFocus:function(){an(!0)},small:!0,type:"number",value:ft[w.mW]||"",width:11*M.iI})}),[ft,an,$o]);return(0,g.jsx)("div",{ref:Vt,children:(0,g.jsxs)("div",{ref:n,style:{position:"relative",zIndex:H===P?nr+9:null},children:[(0,g.jsxs)("div",{style:{position:"relative"},children:[(0,g.jsx)(b.nz,We(We({},We(We({},Po),qt)),{},{bottomBorder:at,onClick:function(){return Do()},ref:me?null:zt,zIndex:nr+1-(H||0),children:(0,g.jsxs)(m.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,g.jsxs)(j.Z,{alignItems:"center",flex:1,children:[(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsx)(f.Z,{monospace:!0,children:E.dO[Sn]}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(I.Z,{color:yo,size:1.5*M.iI,square:!0}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(W.Z,{items:qo(F),onClickCallback:Xo,onClickOutside:Xo,open:Wn,parentRef:mo,uuid:"CodeBlock/block_menu",children:(0,g.jsx)(v.ZP,{color:yo,monospace:!0,children:null===(x=lt?E.tf.DBT:E.V4[An])||void 0===x?void 0:x.toUpperCase()})}),!Oe&&[E.tf.CUSTOM,E.tf.SCRATCHPAD].includes(An)&&(0,g.jsxs)(g.Fragment,{children:["\xa0",(0,g.jsx)(p.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return qn(!0)},transparent:!0,children:(0,g.jsx)(J.K5,{muted:!0})})]})]}),!Oe&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.Z,{mr:M.cd}),(0,g.jsx)(J.iU,{size:1.5*M.iI}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsxs)(m.Z,{alignItems:"center",children:[lt&&E.t6.YAML!==Sn&&(0,g.jsx)(K.Z,{block:!0,label:(0,Be.$1)(F,{fullPath:!0}),size:null,children:(0,g.jsx)(v.ZP,{monospace:!0,muted:!0,children:(0,Be.$1)(F)})}),(!lt||E.t6.YAML===Sn)&&(0,g.jsx)(fe.Z,{bold:!1,inputValue:kt,monospace:!0,muted:!0,notRequired:!0,onBlur:function(){return setTimeout((function(){an(!1),_t(!1)}),300)},onChange:function(e){yt(e.target.value),e.preventDefault()},onClick:function(){an(!0),_t(!0)},onFocus:function(){an(!0),_t(!0)},stacked:!0,value:!Zt&&Dn}),Zt&&!lt&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.Z,{ml:1}),(0,g.jsx)(pe.Z,{onClick:function(){return ln({block:{name:kt,uuid:Dn}}).then((function(){_t(!1),xe(),ge()}))},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]}),(0,g.jsx)(h.Z,{mr:2}),!E.iZ.includes(An)&&ze>700&&(0,g.jsx)(K.Z,{appearBefore:!0,block:!0,label:"\n ".concat((0,N._6)("parent block",Oo),". ").concat(0===Oo?"Click to select 1 or more blocks to depend on.":"Edit parent blocks.","\n "),size:null,widthFitContent:Oo>=1,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){mn(!0),dn({upstreamBlocks:{block:F,values:null===wn||void 0===wn?void 0:wn.map((function(e){return{uuid:e}}))}})},children:(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsxs)(v.ZP,{monospace:Oo>=1,small:!0,underline:0===Oo,children:[0===Oo&&"Edit parent blocks",Oo>=1&&(0,N._6)("parent block",Oo)]}),(0,g.jsx)(h.Z,{mr:1}),0===Oo&&(0,g.jsx)(J.Jj,{size:3*M.iI}),Oo>=1&&(0,g.jsx)(J.eV,{size:3*M.iI})]})})}),Nn>=2&&(0,g.jsx)(h.Z,{ml:2,children:(0,g.jsx)(K.Z,{block:!0,label:"This block is used in ".concat(Nn," pipelines."),size:null,widthFitContent:!0,children:(0,g.jsxs)(pe.Z,{default:!0,monospace:!0,onClick:function(){return nn(_.cH.BLOCK_SETTINGS)},preventDefault:!0,small:!0,children:[Nn," pipelines"]})})})]})]}),(0,g.jsx)(ce,{addNewBlock:y,addWidget:D,block:F,blocks:z,deleteBlock:le,executionState:ve,fetchFileTree:ge,fetchPipeline:xe,hideExtraButtons:Ze,interruptKernel:Se,isEditingBlock:gt,openSidekickView:nn,pipeline:tn,runBlock:Te?null:bo,savePipelineContent:ln,setErrors:fn,setIsEditingBlock:xt,setOutputCollapsed:Tt}),!Ze&&(0,g.jsx)(h.Z,{px:1,children:(0,g.jsx)(p.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){Vn((function(e){return(0,Ne.t8)(fo,!e),!e})),Kn||Tt((function(){return(0,Ne.t8)(po,!0),!0}))},transparent:!0,children:Kn?(0,g.jsx)(J._M,{muted:!0,size:2*M.iI}):(0,g.jsx)(J.Kh,{muted:!0,size:2*M.iI})})})]})})),(0,g.jsxs)(b.Nk,{onClick:function(){return Do()},children:[(0,g.jsxs)(b.jv,We(We({},Po),{},{className:un&&xn?"selected":null,hasOutput:!!Vo||ko,lightBackground:at&&!gt,onDoubleClick:function(){at&&!gt&&xt(!0)},children:[!_e&&E.tf.DBT===An&&!Kn&&(0,g.jsxs)(b.y9,{normalPadding:!0,children:[(0,g.jsxs)(m.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,g.jsxs)(j.Z,{alignItems:"center",children:[E.t6.YAML===Sn&&(0,g.jsx)(ke.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){an(!1)}),300)},onChange:function(e){var n;$o((n={},(0,i.Z)(n,w.Mv,""),(0,i.Z)(n,w.eW,e.target.value),n)),e.preventDefault()},onClick:Ee.j,onFocus:function(){an(!0)},placeholder:"Project",small:!0,value:ft[w.eW]||"",children:Object.keys(Xt||{}).map((function(e){return(0,g.jsx)("option",{value:e,children:e},e)}))}),E.t6.YAML!==Sn&&(0,g.jsx)(v.ZP,{monospace:!0,small:!0,children:Jt}),(0,g.jsx)(h.Z,{mr:2}),(0,g.jsx)(v.ZP,{monospace:!0,muted:!0,small:!0,children:"Target"}),(0,g.jsx)("span",{children:"\xa0"}),!oo&&(0,g.jsx)(ke.Z,{compact:!0,disabled:!Jt,monospace:!0,onBlur:function(){return setTimeout((function(){an(!1)}),300)},onChange:function(e){$o((0,i.Z)({},w.Mv,e.target.value)),e.preventDefault()},onClick:Ee.j,onFocus:function(){an(!0)},placeholder:Jt?ut?null===$t||void 0===$t?void 0:$t.target:null:"Select project first",small:!0,value:no||"",children:null===eo||void 0===eo?void 0:eo.map((function(e){return(0,g.jsx)("option",{value:e,children:e},e)}))}),oo&&(0,g.jsx)(ye.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){an(!1)}),300)},onChange:function(e){$o((0,i.Z)({},w.Mv,e.target.value)),e.preventDefault()},onClick:Ee.j,onFocus:function(){an(!0)},placeholder:Jt?ut?null===$t||void 0===$t?void 0:$t.target:null:"Select project first",small:!0,value:no||"",width:21*M.iI}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(m.Z,{alignItems:"center",children:(0,g.jsx)(K.Z,{block:!0,description:(0,g.jsxs)(v.ZP,{default:!0,inline:!0,children:["Manually type the name of the target you want to use in the profile.",(0,g.jsx)("br",{}),"Interpolate environment variables and global variables using the following syntax:",(0,g.jsx)("br",{}),(0,g.jsx)(v.ZP,{default:!0,inline:!0,monospace:!0,children:"{{ env_var('NAME') }}"})," or ",(0,g.jsx)(v.ZP,{default:!0,inline:!0,monospace:!0,children:"{{ variables('NAME') }}"})]}),size:null,widthFitContent:!0,children:(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsx)(S.Z,{checked:oo,label:(0,g.jsx)(v.ZP,{muted:!0,small:!0,children:"Manually enter target"}),onClick:function(e){(0,Ee.j)(e),ro(!oo)}}),(0,g.jsx)("span",{children:"\xa0"}),(0,g.jsx)(J.kI,{muted:!0})]})})})]}),E.t6.YAML!==Sn&&!(null!==Yt&&void 0!==Yt&&null!==(Z=Yt.block)&&void 0!==Z&&Z.snapshot)&&(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsx)(K.Z,{appearBefore:!0,block:!0,description:(0,g.jsxs)(v.ZP,{default:!0,inline:!0,children:["Limit the number of results that are returned",(0,g.jsx)("br",{}),"when running this block in the notebook.",(0,g.jsx)("br",{}),"This limit won\u2019t affect the number of results",(0,g.jsx)("br",{}),"returned when running the pipeline end-to-end."]}),size:null,widthFitContent:!0,children:(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsx)(J.kI,{muted:!0}),(0,g.jsx)("span",{children:"\xa0"}),(0,g.jsx)(v.ZP,{monospace:!0,muted:!0,small:!0,children:"Sample limit"}),(0,g.jsx)("span",{children:"\xa0"})]})}),or,(0,g.jsx)(h.Z,{mr:1})]})]}),E.t6.YAML===Sn&&(0,g.jsx)(h.Z,{mt:1,children:(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsxs)(j.Z,{alignItems:"center",flex:1,children:[(0,g.jsx)(v.ZP,{default:!0,monospace:!0,small:!0,children:"dbt"}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(ye.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){an(!1)}),300)},onChange:function(e){$o((0,i.Z)({},w.Pi,We(We({},null===ft||void 0===ft?void 0:ft[w.Pi]),{},(0,i.Z)({},w.pA,e.target.value)))),e.preventDefault()},onClick:Ee.j,onFocus:function(){an(!0)},placeholder:"command",small:!0,value:(null===ft||void 0===ft||null===(k=ft[w.Pi])||void 0===k?void 0:k[w.pA])||"",width:10*M.iI}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(v.ZP,{monospace:!0,small:!0,children:"[type your --select and --exclude syntax below]"}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,small:!0,children:["(paths start from ",(null===ft||void 0===ft?void 0:ft[w.eW])||"project"," folder)"]})]}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(v.ZP,{muted:!0,small:!0,children:(0,g.jsx)(pe.Z,{href:"https://docs.getdbt.com/reference/node-selection/syntax#examples",openNewWindow:!0,small:!0,children:"Examples"})}),(0,g.jsx)(h.Z,{mr:1})]})})]}),!_e&&ut&&!Kn&&E.tf.DBT!==An&&(0,g.jsx)(b.y9,{normalPadding:!0,children:(0,g.jsxs)(m.Z,{flexWrap:"wrap",style:{marginTop:"-8px"},children:[(0,g.jsxs)(m.Z,{style:{marginTop:"8px"},children:[(0,g.jsx)(ke.Z,{compact:!0,label:"Connection",onChange:function(e){return $o((0,i.Z)({},w.cH,e.target.value))},onClick:Ee.j,small:!0,value:ft[w.cH],children:null===Y||void 0===Y?void 0:Y.map((function(e){var n=e.id,t=e.value;return(0,g.jsx)("option",{value:t,children:n},n)}))}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(ke.Z,{compact:!0,label:"Profile",onChange:function(e){return $o((0,i.Z)({},w.sc,e.target.value))},onClick:Ee.j,small:!0,value:ft[w.sc],children:null===so||void 0===so?void 0:so.map((function(e){return(0,g.jsx)("option",{value:e,children:e},e)}))}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(m.Z,{alignItems:"center",children:(0,g.jsx)(K.Z,{block:!0,description:(0,g.jsxs)(v.ZP,{default:!0,inline:!0,children:["If checked, you\u2019ll have to write your own custom",(0,g.jsx)("br",{}),"CREATE TABLE commands and INSERT commands.",(0,g.jsx)("br",{}),"Separate your commands using a semi-colon: ",(0,g.jsx)(v.ZP,{default:!0,inline:!0,monospace:!0,children:";"})]}),size:null,widthFitContent:!0,children:(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsx)(S.Z,{checked:ft[w.Mi],label:(0,g.jsx)(v.ZP,{muted:!0,small:!0,children:"Use raw SQL"}),onClick:function(e){(0,Ee.j)(e),$o((0,i.Z)({},w.Mi,!ft[w.Mi]))}}),(0,g.jsx)("span",{children:"\xa0"}),(0,g.jsx)(J.kI,{muted:!0})]})})}),!ft[w.Mi]&&(0,g.jsxs)(g.Fragment,{children:[er&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(m.Z,{alignItems:"center",children:(0,g.jsx)(ye.Z,{compact:!0,label:"Database",monospace:!0,onBlur:function(){return setTimeout((function(){an(!1)}),300)},onChange:function(e){$o((0,i.Z)({},w.Sv,e.target.value)),e.preventDefault()},onClick:Ee.j,onFocus:function(){an(!0)},small:!0,value:ft[w.Sv],width:10*M.iI})})]}),(0,g.jsx)(h.Z,{mr:1}),![ae.CLICKHOUSE,ae.MYSQL].includes(ft[w.cH])&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(K.Z,{block:!0,description:(0,g.jsxs)(v.ZP,{default:!0,inline:!0,children:["Schema that is used when creating a table and inserting values.",(0,g.jsx)("br",{}),"This field is required."]}),size:null,widthFitContent:!0,children:(0,g.jsx)(m.Z,{alignItems:"center",children:(0,g.jsx)(ye.Z,{compact:!0,label:"Schema",monospace:!0,onBlur:function(){return setTimeout((function(){an(!1)}),300)},onChange:function(e){$o((0,i.Z)({},w.BD,e.target.value)),e.preventDefault()},onClick:Ee.j,onFocus:function(){an(!0)},small:!0,value:ft[w.BD],width:10*M.iI})})}),(0,g.jsx)(h.Z,{mr:1})]}),(0,g.jsx)(K.Z,{block:!0,description:(0,g.jsxs)(v.ZP,{default:!0,inline:!0,children:["This value will be used as the table name.",(0,g.jsx)("br",{}),"If blank, the default table name will be:",(0,g.jsx)("br",{}),(0,g.jsxs)(v.ZP,{inline:!0,monospace:!0,children:[rt,"_",Dn]}),(0,g.jsx)("br",{}),"This field is optional."]}),size:null,widthFitContent:!0,children:(0,g.jsx)(m.Z,{alignItems:"center",children:(0,g.jsx)(ye.Z,{compact:!0,label:"Table (optional)",monospace:!0,onBlur:function(){return setTimeout((function(){an(!1)}),300)},onChange:function(e){$o((0,i.Z)({},w.m$,e.target.value)),e.preventDefault()},onClick:Ee.j,onFocus:function(){an(!0)},small:!0,value:ft[w.m$],width:20*M.iI})})})]}),(0,g.jsx)(h.Z,{mr:1})]}),!ft[w.Mi]&&(0,g.jsxs)(m.Z,{alignItems:"center",style:{marginTop:"8px"},children:[(0,g.jsx)(K.Z,{block:!0,description:(0,g.jsxs)(v.ZP,{default:!0,inline:!0,children:["Limit the number of results that are returned",(0,g.jsx)("br",{}),"when running this block in the notebook.",(0,g.jsx)("br",{}),"This limit won\u2019t affect the number of results",(0,g.jsx)("br",{}),"returned when running the pipeline end-to-end."]}),size:null,widthFitContent:!0,children:(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsx)(J.kI,{muted:!0}),(0,g.jsx)("span",{children:"\xa0"}),(0,g.jsx)(v.ZP,{monospace:!0,muted:!0,small:!0,children:"Limit"}),(0,g.jsx)("span",{children:"\xa0"})]})}),or,(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(K.Z,{autoWidth:!0,block:!0,description:(0,g.jsxs)(v.ZP,{default:!0,inline:!0,children:["How do you want to handle existing data with the same",er?" database,":""," schema, and table name?",(0,g.jsx)("br",{}),(0,g.jsx)(v.ZP,{bold:!0,inline:!0,monospace:!0,children:"Append"}),": add rows to the existing table.",(0,g.jsx)("br",{}),(0,g.jsx)(v.ZP,{bold:!0,inline:!0,monospace:!0,children:"Replace"}),": delete the existing data.",(0,g.jsx)("br",{}),(0,g.jsx)(v.ZP,{bold:!0,inline:!0,monospace:!0,children:"Fail"}),": raise an error during execution."]}),size:null,widthFitContent:!0,children:(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsx)(J.kI,{muted:!0}),(0,g.jsx)("span",{children:"\xa0"}),(0,g.jsx)(v.ZP,{monospace:!0,muted:!0,small:!0,children:"Write policy:"}),(0,g.jsx)("span",{children:"\xa0"}),(0,g.jsx)(ke.Z,{compact:!0,label:"strategy",onChange:function(e){return $o((0,i.Z)({},w.nq,e.target.value))},onClick:Ee.j,small:!0,value:ft[w.nq],children:null===se||void 0===se?void 0:se.map((function(e){return(0,g.jsx)("option",{value:e,children:(0,N.kC)(e)},e)}))})]})}),(0,g.jsx)(h.Z,{mr:1})]}),(null===ft||void 0===ft?void 0:ft[w.cH])===ae.TRINO&&wn.length>=1&&(0,g.jsxs)(m.Z,{alignItems:"center",style:{marginTop:"8px"},children:[(0,g.jsx)(K.Z,{appearBefore:!0,block:!0,description:(0,g.jsxs)(v.ZP,{default:!0,inline:!0,children:["If checked, upstream blocks that aren\u2019t SQL blocks",(0,g.jsx)("br",{}),"will have their data exported into a table that is",(0,g.jsx)("br",{}),"uniquely named upon each block run. For example,",(0,g.jsx)("br",{}),(0,g.jsx)(v.ZP,{default:!0,inline:!0,monospace:!0,children:"[pipeline_uuid]_[block_uuid]_[unique_timestamp]"}),"."]}),size:null,widthFitContent:!0,children:(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsx)(S.Z,{checked:ft[w.bk],label:(0,g.jsx)(v.ZP,{muted:!0,small:!0,children:"Unique upstream table names"}),onClick:function(e){(0,Ee.j)(e),$o((0,i.Z)({},w.bk,!ft[w.bk]))}}),(0,g.jsx)("span",{children:"\xa0"}),(0,g.jsx)(J.kI,{muted:!0})]})}),(0,g.jsx)(h.Z,{mr:1})]})]})}),wo.length>=1&&(0,g.jsx)(b.y9,{normalPadding:!0,children:(0,g.jsx)(m.Z,{children:wo.map((function(e,n){var t=e.description,o=e.title;return(0,g.jsx)(h.Z,{ml:n>=1?1:0,children:(0,g.jsx)(K.Z,{block:!0,description:t,size:null,widthFitContent:!0,children:(0,g.jsx)(f.Z,{children:o})})},o)}))})}),wn.length>=1&&!Kn&&E.f2.includes(An)&&!it&&!Rn&&(0,g.jsxs)(b.y9,{normalPadding:!0,children:[(0,g.jsx)(h.Z,{mr:1,children:(0,g.jsxs)(v.ZP,{muted:!0,small:!0,children:[!ut&&"Positional arguments for ".concat(ct?"":"decorated ","function:"),ut&&(0,g.jsxs)(g.Fragment,{children:["The interpolated tables below are available in queries from upstream blocks.",(0,g.jsx)("br",{}),"Example: ",(0,g.jsx)(v.ZP,{inline:!0,monospace:!0,small:!0,children:"SELECT * FROM {{ df_1 }}"})," to insert all rows from ",(0,g.jsx)(v.ZP,{inline:!0,monospace:!0,small:!0,children:null===wn||void 0===wn?void 0:wn[0]})," into a table."]})]})}),(0,g.jsxs)(h.Z,{mt:1,children:[!ut&&!ct&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,small:!0,children:[E.tf.DATA_EXPORTER===An&&"@data_exporter",E.tf.DATA_LOADER===An&&"@data_loader",E.tf.TRANSFORMER===An&&"@transformer",E.tf.CUSTOM===An&&"@custom"]}),(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,small:!0,children:["def ",(E.tf.DATA_EXPORTER===An?"export_data":E.tf.DATA_LOADER===An&&"load_data")||E.tf.TRANSFORMER===An&&"transform"||E.tf.CUSTOM===An&&"transform_custom","(",wn.map((function(e,n){return n>=1?"data_".concat(n+1):"data"})).join(", "),"):"]})]}),ct&&(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,small:!0,children:[E.tf.DATA_EXPORTER===An?"export_data":E.tf.TRANSFORMER===An&&"transform","\xa0\u2190 function(",wn.map((function(e,n){return"df_".concat(n+1)})).join(", "),"):"]})}),ut&&(null===wn||void 0===wn?void 0:wn.length)>=1&&(0,g.jsx)(Ie,{block:F,blockConfiguration:ft,blockRefs:Q,blocks:null===wn||void 0===wn?void 0:wn.map((function(e){return null===ho||void 0===ho?void 0:ho[e]})),updateBlockConfiguration:$o}),!ut&&wn.map((function(e,n){var t=ho[e],o=(0,b.qn)(null===t||void 0===t?void 0:t.type,{blockColor:null===t||void 0===t?void 0:t.color,theme:Zn}).accent,r="{{ df_".concat(n+1," }}");return(0,g.jsxs)("div",{children:[!ut&&!ct&&(0,g.jsxs)(v.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:["\xa0\xa0\xa0\xa0data",n>=1?"_".concat(n+1):null]}),ut&&(0,g.jsx)(v.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:r}),ct&&(0,g.jsxs)(v.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:["\xa0\xa0\xa0\xa0","df".concat(n+1)]})," ",(0,g.jsx)(v.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"\u2192"})," ",(0,g.jsx)(pe.Z,{color:o,onClick:function(){var e,n,o=null===Q||void 0===Q||null===(e=Q.current)||void 0===e?void 0:e["".concat(null===t||void 0===t?void 0:t.type,"s/").concat(null===t||void 0===t?void 0:t.uuid,".py")];null===o||void 0===o||null===(n=o.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,g.jsx)(v.ZP,{color:o,inline:!0,monospace:!0,small:!0,children:e})})]},e)}))]})]}),!En&&(0,g.jsx)(g.Fragment,{children:Kn?(0,g.jsx)(h.Z,{px:1,children:(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,children:["(",(0,N._6)("line",null===Xn||void 0===Xn?void 0:Xn.split(/\r\n|\r|\n/).length)," collapsed)"]})}):!at||gt?zo?(0,g.jsx)(h.Z,{px:1,children:(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,children:["Replicated from block ",(0,g.jsx)(pe.Z,{color:(0,b.qn)(null===zo||void 0===zo?void 0:zo.type,{blockColor:null===zo||void 0===zo?void 0:zo.color,theme:Zn}).accent,onClick:function(e){var n,t;(0,Ee.j)(e);var o=null===Q||void 0===Q||null===(n=Q.current)||void 0===n?void 0:n["".concat(null===zo||void 0===zo?void 0:zo.type,"s/").concat(null===zo||void 0===zo?void 0:zo.uuid,".py")];null===o||void 0===o||null===(t=o.current)||void 0===t||t.scrollIntoView()},preventDefault:!0,children:(0,g.jsx)(v.ZP,{color:(0,b.qn)(null===zo||void 0===zo?void 0:zo.type,{blockColor:null===zo||void 0===zo?void 0:zo.color,theme:Zn}).accent,inline:!0,monospace:!0,children:null===zo||void 0===zo?void 0:zo.uuid})})]})}):Ko:tr}),be&&l.cloneElement(be,{runBlockAndTrack:bo}),En&&(0,g.jsxs)(h.Z,{p:M.cd,children:[(0,g.jsx)(v.ZP,{bold:!0,danger:!0,children:null===En||void 0===En?void 0:En.error}),(0,g.jsx)(v.ZP,{muted:!0,children:null===En||void 0===En?void 0:En.message})]}),go&&et&&et>Mt&&(0,g.jsx)(b.HC,{children:(0,g.jsxs)(v.ZP,{muted:!0,children:["".concat(Math.round((et-Mt)/1e3)),"s"]})}),!Kn&&![E.tf.CALLBACK,E.tf.CONDITIONAL,E.tf.EXTENSION].includes(An)&&(0,g.jsx)(O,{block:F,blocks:B,openSidekickView:nn,pipeline:tn})]})),Yo]})]}),!Ye&&(0,g.jsxs)(b.gE,{additionalZIndex:nr-H,onMouseEnter:function(){return Un(!0)},onMouseLeave:function(){Un(!1),null===cn||void 0===cn||cn(null)},children:[Ln&&y&&(0,g.jsx)(h.Z,{mt:2,children:(0,g.jsx)(d.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,o=(0,te.eY)(F,e),r=(0,te.fA)(tn,F,e).map((function(e){var n=We({},ho[e]||{}),t=n.upstream_blocks;return t&&(n.upstream_blocks=t.filter((function(e){return e!==Dn}))),n}));return[E.tf.DATA_LOADER,E.tf.TRANSFORMER].includes(An)&&E.tf.SCRATCHPAD===e.type&&(n="from mage_ai.data_preparation.variable_manager import get_variable\n\n\n df = get_variable('".concat(rt,"', '").concat(Dn,"', 'output_0')")),n=(0,De.X7)(e,n),E.t6.SQL===Sn&&(t=We(We({},(0,Fe.GL)(Mn,[w.cH,w.Sv,w.sc,w.BD,w.nq])),t)),E.t6.SQL===e.language&&(n=(0,De.SF)(n)),y(We(We({},e),{},{configuration:t,content:n,upstream_blocks:o}),r)},blockIdx:H,blockTemplates:G,compact:!0,hideCustom:it,hideDbt:it,onClickAddSingleDBTModel:$e,pipeline:tn,setAddNewBlockMenuOpenIdx:cn,setCreatingNewDBTModel:sn,showBrowseTemplates:gn})}),(0,g.jsx)(b.t1,{className:"block-divider-inner"})]})]})})}var Ke=l.forwardRef(ze)},59582:function(e,n,t){t.d(n,{Z:function(){return v}});var o,r=t(21831),i=t(86422),l=t(82394),u=t(75582),c=t(17717);!function(e){e.DATA_EXPORTER="data_exporter",e.DATA_LOADER="data_loader",e.MAGE_LIBRARY="mage_library",e.TRANSFORMER="transformer",e.USER_LIBRARY="user_library"}(o||(o={}));var a=t(5677);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}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,l.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}var f=t(24224);function p(e,n){var t=e;t.includes("__init__")||t.push("__init__");var o,r=t.length;return(0,f.w6)(r).forEach((function(e,i){if(o)return o;var l=t.slice(0,r-i).join(c.sep);o=n["".concat(l,".py")]})),o}function m(e,n,t){var o,r,i;return((null===(o=t.outputs)||void 0===o||null===(r=o[0])||void 0===r||null===(i=r.sample_data)||void 0===i?void 0:i.columns)||[]).map((function(t){return{label:"".concat(t," column"),kind:e.languages.CompletionItemKind.Variable,insertText:"'".concat(t,"'"),range:n}}))}function h(e,n){var t=e.word.split(""),o=new RegExp(t.reduce((function(e,n,o){var r=t[o+1],i=r?"^".concat(r):"";return e+"".concat(n,"[w ").concat(i,"]*")}),""));return n.reduce((function(e,n){return n.label.match(o)?e.concat(n):e}),[])}function v(e){var n=e.autocompleteItems,t=e.block,l=e.blocks,s=e.pipeline,v=t.type,b=t.upstream_blocks,g=(0,f.HK)(n,(function(e){return e.id}));return function(t){return function(x,j){var Z=[],_=x.getValueInRange({endColumn:j.column,endLineNumber:j.lineNumber,startColumn:1,startLineNumber:1}),C=x.getWordUntilPosition(j),k=C.endColumn,y=C.startColumn,O={endColumn:k,endLineNumber:j.lineNumber,startColumn:y,startLineNumber:j.lineNumber},E=function(e,n,t){var o=(0,a.Yn)(e),r=(0,a.M4)(e,n),i=o.find((function(e){var n=e.variableName;return r.match(new RegExp(n))}));if(i){var l=i.assignmentValue,u=(0,a.S0)(e)[l];if(u){var c,s=p(u.split(" as ")[0].replace("from ","").replace("import ","").split(" ").reduce((function(e,n){return n.trim()?e.concat(n):e}),[]).join(".").split("."),t),d=(0,a.rW)(u,l);return null===s||void 0===s||null===(c=s.methods_for_class)||void 0===c?void 0:c[d]}}return[]}(_,O,g);if((null===E||void 0===E?void 0:E.length)>=1){var T=h(C,E.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Method,label:e,range:O}})));if(T.length>=1)return{suggestions:T}}var S=function(e,n,t){var o=(0,a.M4)(e,n);if(o=o.match(/([\w_]+)./)){var r=(0,a.S0)(e)[o[1]];if(r){var i=p(r.split(" as ")[0].replace("from ","").replace("import ","").split(" ").reduce((function(e,n){return n.trim()?e.concat(n):e}),[]).join(".").split("."),t);if(null!==i&&void 0!==i&&i.functions)return null===i||void 0===i?void 0:i.functions}}return[]}(_,O,g);if((null===S||void 0===S?void 0:S.length)>=1){var I=h(C,S.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Function,label:e,range:O}})));if(I.length>=1)return{suggestions:I}}if((null===b||void 0===b?void 0:b.length)>=1){var R=new RegExp("\n@".concat(v));_.match(R)&&Z.push.apply(Z,(0,r.Z)(h(C,function(e,n,t){var o=t.block,r=t.blocks,i=o.upstream_blocks,l=(0,f.HK)(r,(function(e){return e.uuid}));return i.map((function(t,o){var r=l[t].type,i=0===o?"output_0":"args[".concat(o-1,"]");return{label:"df ".concat(t," ").concat(r," block"),kind:e.languages.CompletionItemKind.Variable,documentation:"Variable for ".concat(r," ").concat(t," data."),insertText:i,range:n}}))}(t,O,e))))}if(C.word.match(/i|f/)){var A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,t=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,l=(arguments.length>2?arguments[2]:void 0).word,s=new Set,f={};e.forEach((function(e){var n=e.group,t=e.id,r=e.imports;if([o.MAGE_LIBRARY,o.USER_LIBRARY].includes(n)){var i=t;i.match(/__init__.py/)&&(i=i.replace(/\/__init__.py/,"")),i=i.split(".py")[0].replaceAll(c.sep,"."),f[i]=e}var l=t.replace(".py","").replace("/__init__","").split(c.sep);if(1===l.length)s.add("import ".concat(l[0]));else if(l.length>=2){var u=l.slice(0,l.length-1).join(".");s.add("from ".concat(u," import ").concat(l[l.length-1]))}r.forEach((function(e){return s.add(e)}))}));var p,m="i"===l,h="f"===l,v=m?"import":h?"from":"",b=(0,a.M4)(n,i);if(m&&b.match(/from/)&&(p=b.match(/from ([A-Za-z0-9_.]+) /)[1]),p&&f[p]){var g=f[p],x=g.classes,j=g.constants,Z=g.files,_=g.functions,C=[];return[[j,t.languages.CompletionItemKind.Constant],[x,t.languages.CompletionItemKind.Class],[_,t.languages.CompletionItemKind.Function]].forEach((function(e){var n=(0,u.Z)(e,2),t=n[0],o=n[1];t.forEach((function(e){C.push({filterText:"import ".concat(e),insertText:"import ".concat(e),kind:o,label:e,range:i})}))})),Z.forEach((function(e){var n=e.split(c.sep),o=n[n.length-1].split(".py")[0];C.push({filterText:"import ".concat(o),insertText:"import ".concat(o),kind:t.languages.CompletionItemKind.Variable,label:o,range:i})})),C}return(0,r.Z)(s).map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.File,label:e,range:i}})).concat(Object.entries(f).map((function(e){var n=(0,u.Z)(e,2),o=n[0];return n[1],{filterText:"".concat(v," ").concat(o),insertText:"".concat(v," ").concat(o," "),kind:t.languages.CompletionItemKind.File,label:"".concat(o),range:d({},i)}})))}(n,_,C,t,O,e);Z.push.apply(Z,(0,r.Z)(A))}if(i.tf.CHART===v||i.tf.SCRATCHPAD===v){var P=[];if(i.tf.CHART===v?b.forEach((function(e,n){P.push({block:l.find((function(n){var t=n.uuid;return e===t})),matchIndex:0,variableName:"df_".concat(n+1)})})):i.tf.SCRATCHPAD===v&&function(e,n){return e.map((function(e){return{block:e,regex:new RegExp("([\\w_]+)[ ]*=[ ]*get_variable\\('".concat(n.uuid,"', '").concat(e.uuid,"', 'output_0'\\)"),"g")}}))}(l,s).forEach((function(e){var n=e.block,t=e.regex,o=_.matchAll(t);(0,r.Z)(o).forEach((function(e){var t=null===e||void 0===e?void 0:e.index,o=null===e||void 0===e?void 0:e[1];o&&P.push({block:n,matchIndex:t,variableName:o})}))})),P.length>=1){var w,D=null===(w=_.split("\n")[j.lineNumber-1])||void 0===w?void 0:w.slice(0,C.startColumn-1);if(D){var M=[];if(P.forEach((function(e){var n=e.block,o=e.matchIndex,r=e.variableName,i=new RegExp("".concat(r,"\\["));D.match(i)&&M.push({items:m(t,O,n),matchIndex:o})})),M.length>=1)return{suggestions:h(C,(0,f.YC)(M,"matchIndex",{ascending:!1})[0].items)}}}1===y&&(i.tf.CHART===v?Z.push.apply(Z,(0,r.Z)(h(C,b.map((function(e,n){var o="df_".concat(n+1);return{label:"".concat(o," ").concat(e," block"),kind:t.languages.CompletionItemKind.Snippet,insertText:o,range:O}}))))):i.tf.SCRATCHPAD===v&&Z.push.apply(Z,(0,r.Z)(h(C,function(e,n,t){var o=t.block,r=t.blocks,l=t.pipeline;return r.reduce((function(t,r){var u=r.type,c=r.uuid;return o.uuid!==c&&[i.tf.DATA_LOADER,i.tf.TRANSFORMER].includes(u)?t.concat({label:"df ".concat(c," ").concat(u," block"),kind:e.languages.CompletionItemKind.Snippet,documentation:"Get the data from ".concat(u," block ").concat(c,"."),insertText:"from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(l.uuid,"', '").concat(c,"', 'output_0')\n"),range:n}):t}),[])}(t,O,e)))))}var N=new Set;l.concat({content:_}).forEach((function(e){var n=e.content;(0,r.Z)(n.matchAll("([A-Za-z_0-9]+)","g")).forEach((function(e){return N.add(e[1])}))}));var B=(0,r.Z)(N);if(B.length){var L=B.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Variable,label:e,range:O}}));Z.push.apply(Z,(0,r.Z)(h(C,L)))}return{suggestions:Z}}}}},38639:function(e,n,t){t.d(n,{EN:function(){return O},FX:function(){return E},HS:function(){return Z},Nk:function(){return m},Rd:function(){return p},SL:function(){return y},Tj:function(){return k},UE:function(){return C},Yf:function(){return v},ZG:function(){return s},bC:function(){return h},n5:function(){return f},n8:function(){return _},w5:function(){return j},wj:function(){return g},wl:function(){return b},ze:function(){return x}});var o=t(38626),r=t(23831),i=t(73942),l=t(3055),u=t(49125),c=t(90880),a=t(37391),s=2.5*u.iI,d=40*u.iI,f=10*u.iI,p=o.default.div.withConfig({displayName:"indexstyle__ContainedStyle",componentId:"sc-8sk2qr-0"})([""," overflow:auto;"," "," ",""],a.w5,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).page,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height-f,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width-f,"px;\n ")})),m=o.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-8sk2qr-1"})(["height:100%;position:relative;"]),h=o.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-8sk2qr-2"})(["position:fixed;width:","px;z-index:1;"," "," ",""],d,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-right: 1px solid ").concat((e.theme.borders||r.Z.borders).light,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height-f,"px;\n ")}),(function(e){return!e.height&&"\n height: 100%;\n "})),v=o.default.div.withConfig({displayName:"indexstyle__TabsStyle",componentId:"sc-8sk2qr-3"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;",""],1*u.iI,u.cd*u.iI,u.cd*u.iI,1*u.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||r.Z.borders).light,";\n ")})),b=o.default.div.withConfig({displayName:"indexstyle__LinksContainerStyle",componentId:"sc-8sk2qr-4"})([""," overflow:auto;position:fixed;width:","px;",""],a.w5,d,(function(e){return"\n height: calc(100% - ".concat(55+(null!==e&&void 0!==e&&e.contained?f:l.Mz)+((null===e||void 0===e?void 0:e.heightOffset)||0),"px);\n ")})),g=o.default.div.withConfig({displayName:"indexstyle__NavLinkStyle",componentId:"sc-8sk2qr-5"})([""," padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;&:hover{cursor:pointer;}",""],(0,c.eR)(),1*u.iI,u.cd*u.iI,u.cd*u.iI,1*u.iI,(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||r.Z.background).codeTextarea,";\n ")})),x=o.default.div.withConfig({displayName:"indexstyle__IconStyle",componentId:"sc-8sk2qr-6"})([""," border-radius:","px;height:","px;margin-right:","px;padding:","px;width:","px;"," ",""],(0,c.eR)(),i.n_,5*u.iI,1.25*u.iI,1.25*u.iI,5*u.iI,(function(e){return!e.backgroundColor&&"\n background-color: ".concat((e.theme.background||r.Z.background).chartBlock,";\n ")}),(function(e){return e.backgroundColor&&"\n background-color: ".concat(e.backgroundColor,";\n ")})),j=o.default.div.withConfig({displayName:"indexstyle__ContentStyle",componentId:"sc-8sk2qr-7"})(["margin-left:","px;"],d),Z=o.default.div.withConfig({displayName:"indexstyle__SubheaderStyle",componentId:"sc-8sk2qr-8"})(["padding:","px;",""],u.cd*u.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||r.Z.borders).light,";\n ")})),_=o.default.div.withConfig({displayName:"indexstyle__CardsStyle",componentId:"sc-8sk2qr-9"})(["display:flex;flex-wrap:wrap;padding:","px;"],.75*u.iI),C=o.default.div.withConfig({displayName:"indexstyle__CardStyle",componentId:"sc-8sk2qr-10"})(["border-radius:","px;margin:","px;padding:","px;width:","px;&:hover{cursor:pointer;}",""],i.n_,.75*u.iI,2.5*u.iI,50*u.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border: 1px solid ").concat((e.theme.background||r.Z.background).chartBlock,";\n box-shadow: ").concat((e.theme.shadow||r.Z.shadow).frame,";\n ")})),k=o.default.div.withConfig({displayName:"indexstyle__CardTitleStyle",componentId:"sc-8sk2qr-11"})(["height:","px;"],2.5*u.iI),y=o.default.div.withConfig({displayName:"indexstyle__CardDescriptionStyle",componentId:"sc-8sk2qr-12"})(["height:","px;margin-top:","px;"],2.5*u.iI*2,1*u.iI),O=o.default.div.withConfig({displayName:"indexstyle__TagsStyle",componentId:"sc-8sk2qr-13"})(["height:","px;margin-top:","px;overflow:hidden;"],3.5*u.iI,.5*u.iI),E=o.default.div.withConfig({displayName:"indexstyle__BreadcrumbsStyle",componentId:"sc-8sk2qr-14"})(["padding-bottom:","px;padding-top:","px;",""],1*u.iI,1*u.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||r.Z.borders).light,";\n ")}))},49666:function(e,n,t){t.d(n,{Z:function(){return N}});var o=t(82394),r=t(75582),i=t(12691),l=t.n(i),u=t(82684),c=t(83455),a=t(34376),s=t(60328),d=t(32316),f=t(18908),p=t(48952),m=t(93461),h=t(67971),v=t(10919),b=t(86673),g=t(19711),x=t(38435),j=t(82944),Z=t(32063),_=t(82531),C=t(66166),k=t(3055),y={uuid:"Define"},O={uuid:"Document"},E=[y,O],T=t(49125),S=t(41422),I=t(72454),R=t(96510),A=t(9728),P=t(24141),w=t(28598);function D(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function M(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?D(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var N=function(e){var n=e.defaultTab,t=e.onMutateSuccess,o=e.pipelineUUID,i=e.template,D=e.templateAttributes,N=e.templateUUID,B=(0,P.i)().height,L=(k.Mz,(0,a.useRouter)()),U=(0,A.VI)(null,{},[],{uuid:"CustomTemplates/PipelineTemplateDetail"}),F=(0,r.Z)(U,1)[0],H=(0,u.useState)(!1),Q=H[0],G=H[1],W=(0,u.useState)(D),q=W[0],z=W[1],K=(0,u.useCallback)((function(e){G(!0),z(e)}),[]),V=(0,C.Z)(i);(0,u.useEffect)((function(){(null===V||void 0===V?void 0:V.template_uuid)!==(null===i||void 0===i?void 0:i.template_uuid)&&z(i)}),[i,V]);var Y=(0,u.useMemo)((function(){return null===i||void 0===i?void 0:i.pipeline}),[i]),X=(0,u.useMemo)((function(){return(null===Y||void 0===Y?void 0:Y.blocks)||[]}),[Y]),J=(0,u.useMemo)((function(){return!i&&!N}),[i,N]),$=(0,u.useState)(n?E.find((function(e){return e.uuid===(null===n||void 0===n?void 0:n.uuid)})):E[0]),ee=$[0],ne=$[1],te=(0,u.useMemo)((function(){return J?!(null!==q&&void 0!==q&&q.template_uuid):!Q}),[J,q,Q]),oe=(0,u.useState)(!1),re=oe[0],ie=oe[1],le=(0,u.useState)(J?400:300),ue=le[0],ce=le[1],ae=(0,c.Db)(_.ZP.custom_templates.useCreate(),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(e){var n=e.custom_template;t&&(null===t||void 0===t||t()),L.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(null===n||void 0===n?void 0:n.template_uuid),"?object_type=").concat(f.R))},onErrorCallback:function(e,n){return F({errors:n,response:e})}})}}),se=(0,r.Z)(ae,2),de=se[0],fe=se[1].isLoading,pe=(0,c.Db)(_.ZP.custom_templates.useUpdate(i?encodeURIComponent(null===i||void 0===i?void 0:i.template_uuid):N&&encodeURIComponent(N),{object_type:f.R}),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(e){var n=e.custom_template;t&&(null===t||void 0===t||t()),null!==i&&void 0!==i&&i.template_uuid&&(null===n||void 0===n?void 0:n.template_uuid)!==(null===i||void 0===i?void 0:i.template_uuid)||N&&(null===n||void 0===n?void 0:n.template_uuid)!==N?L.replace("/templates/[...slug]","/templates/".concat(encodeURIComponent(null===n||void 0===n?void 0:n.template_uuid),"?object_type=").concat(f.R)):(z(n),G(!1))},onErrorCallback:function(e,n){return F({errors:n,response:e})}})}}),me=(0,r.Z)(pe,2),he=me[0],ve=me[1].isLoading,be=(0,u.useCallback)((function(){var e={custom_template:M(M({},q),{},{object_type:f.R})};J?de(M(M({},e),{},{custom_template:M(M({},null===e||void 0===e?void 0:e.custom_template),{},{pipeline_uuid:o})})):he(e)}),[de,J,o,q,he]),ge=(0,u.useMemo)((function(){return(0,w.jsx)(w.Fragment,{})}),[]),xe=(0,u.useMemo)((function(){return(0,w.jsxs)(h.Z,{flexDirection:"column",fullHeight:!0,children:[(0,w.jsx)(S.Yf,{children:(0,w.jsx)(d.Z,{noPadding:!0,onClickTab:function(e){ne(e)},selectedTabUUID:null===ee||void 0===ee?void 0:ee.uuid,tabs:E})}),(0,w.jsxs)(m.Z,{flexDirection:"column",children:[y.uuid===(null===ee||void 0===ee?void 0:ee.uuid)&&(0,w.jsxs)(w.Fragment,{children:[o&&(0,w.jsx)(b.Z,{mt:T.cd,px:T.cd,children:(0,w.jsxs)(g.ZP,{default:!0,children:["This pipeline template will be based off the pipeline ",(0,w.jsx)(l(),{as:"/pipelines/".concat(o),href:"/pipelines/[pipeline]",passHref:!0,children:(0,w.jsx)(v.Z,{bold:!0,default:!0,inline:!0,monospace:!0,openNewWindow:!0,children:o})}),"."]})}),(0,w.jsxs)(b.Z,{mt:T.cd,px:T.cd,children:[(0,w.jsxs)(b.Z,{mb:1,children:[(0,w.jsx)(g.ZP,{bold:!0,children:"Template UUID"}),(0,w.jsx)(g.ZP,{muted:!0,small:!0,children:"Unique identifier for custom template. The UUID will also determine where the custom template file is stored in the project. You can use nested folder names in the template\u2019s UUID."})]}),(0,w.jsx)(j.Z,{monospace:!0,onChange:function(e){return K((function(n){return M(M({},n),{},{template_uuid:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===q||void 0===q?void 0:q.template_uuid)||""})]})]}),O.uuid===(null===ee||void 0===ee?void 0:ee.uuid)&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(b.Z,{mt:T.cd,px:T.cd,children:[(0,w.jsxs)(b.Z,{mb:1,children:[(0,w.jsx)(g.ZP,{bold:!0,children:"Name"}),(0,w.jsx)(g.ZP,{muted:!0,small:!0,children:"A human readable name for your template."})]}),(0,w.jsx)(j.Z,{onChange:function(e){return K((function(n){return M(M({},n),{},{name:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===q||void 0===q?void 0:q.name)||""})]}),(0,w.jsx)(b.Z,{mt:T.cd,px:T.cd,children:(0,w.jsx)(x.Z,{label:"Description",onChange:function(e){return K((function(n){return M(M({},n),{},{description:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===q||void 0===q?void 0:q.description)||""})})]})]}),(0,w.jsx)(S.ig,{children:(0,w.jsx)(b.Z,{p:T.cd,children:(0,w.jsx)(h.Z,{children:(0,w.jsxs)(s.Z,{disabled:te,fullWidth:!0,loading:fe||ve,onClick:function(){return be()},primary:!0,children:[!J&&"Save template",J&&"Create new template"]})})})})]})}),[te,fe,ve,J,o,be,null===ee||void 0===ee?void 0:ee.uuid,K,q]);return(0,w.jsx)(Z.Z,{after:ge,before:xe,beforeHidden:re,beforeWidth:ue,leftOffset:I.k1,setBeforeHidden:ie,setBeforeWidth:ce,children:(0,w.jsx)(p.Z,{blocks:X,height:B,heightOffset:k.Mz,noStatus:!0,pipeline:Y})})}},41422:function(e,n,t){t.d(n,{Nk:function(){return c},Yf:function(){return s},bC:function(){return a},ig:function(){return d},w5:function(){return f}});var o=t(38626),r=t(23831),i=t(49125),l=t(38639),u=(i.iI,40*i.iI),c=o.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-axgvn9-0"})(["height:100%;position:relative;"]),a=o.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-axgvn9-1"})(["overflow:auto;position:fixed;width:","px;z-index:1;"," "," ",""],u,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-right: 1px solid ").concat((e.theme.borders||r.Z.borders).light,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height-l.n5,"px;\n ")}),(function(e){return!e.height&&"\n height: 100%;\n "})),s=o.default.div.withConfig({displayName:"indexstyle__TabsStyle",componentId:"sc-axgvn9-2"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;width:100%;",""],1*i.iI,i.cd*i.iI,i.cd*i.iI,1*i.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||r.Z.borders).light,";\n ")})),d=o.default.div.withConfig({displayName:"indexstyle__ButtonsStyle",componentId:"sc-axgvn9-3"})(["width:100%;",""],(function(e){return"\n border-top: 1px solid ".concat((e.theme.borders||r.Z.borders).light,";\n ")})),f=o.default.div.withConfig({displayName:"indexstyle__ContentStyle",componentId:"sc-axgvn9-4"})(["margin-left:","px;"],u)},62749:function(e,n,t){t.d(n,{Z:function(){return G}});var o=t(82394),r=t(75582),i=t(56085),l=t(82684),u=t(65701),c=t(1254),a=t(83455),s=t(34376),d=t(35490),f=t(60328),p=t(32316),m=t(89949),h=t(18908),v=t(93461),b=t(67971),g=t(86673),x=t(55378),j=t(19711),Z=t(38435),_=t(82944),C=t(82531),k=t(66166),y=t(86422),O=t(41422),E=t(82635),T=t(16115),S={uuid:"Define"},I={uuid:"Document"},R=[S,I],A=t(94353),P=t(49125),w=t(98781),D=t(28799),M=t(96510),N=t(51504),B=t(9728),L=t(41150),U=t(24141),F=t(28598);function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Q(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}var G=function(e){var n=e.contained,t=e.defaultTab,H=e.heightOffset,G=e.onCancel,W=e.onCreateCustomTemplate,q=e.onMutateSuccess,z=e.template,K=e.templateAttributes,V=e.templateUUID,Y=(0,U.i)().height,X=(0,s.useRouter)(),J=(0,B.VI)(null,{},[],{uuid:"CustomTemplates/TemplateDetail"}),$=(0,r.Z)(J,1)[0],ee=(0,l.useState)(Number(new Date)),ne=ee[0],te=ee[1],oe=(0,l.useState)(!1),re=oe[0],ie=oe[1],le=(0,l.useState)(t?R.find((function(e){return e.uuid===(null===t||void 0===t?void 0:t.uuid)})):R[0]),ue=le[0],ce=le[1],ae=(0,l.useState)(!1),se=ae[0],de=ae[1],fe=(0,l.useState)(K),pe=fe[0],me=fe[1],he=(0,l.useCallback)((function(e){de(!0),me(e)}),[]),ve=C.ZP.custom_templates.detail(!z&&V&&encodeURIComponent(V),{object_type:h.Z}).data,be=(0,l.useMemo)((function(){return z||(null===ve||void 0===ve?void 0:ve.custom_template)}),[ve,z]),ge=(0,k.Z)(be);(0,l.useEffect)((function(){(null===ge||void 0===ge?void 0:ge.template_uuid)!==(null===be||void 0===be?void 0:be.template_uuid)&&(te(Number(new Date)),me(be),ie(!0))}),[be,ge]);var xe=(0,a.Db)(C.ZP.custom_templates.useCreate(),{onSuccess:function(e){return(0,M.wD)(e,{callback:function(e){var n=e.custom_template;q&&(null===q||void 0===q||q()),W?null===W||void 0===W||W(n):X.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(null===n||void 0===n?void 0:n.template_uuid)))},onErrorCallback:function(e,n){return $({errors:n,response:e})}})}}),je=(0,r.Z)(xe,2),Ze=je[0],_e=je[1].isLoading,Ce=(0,a.Db)(C.ZP.custom_templates.useUpdate(z?encodeURIComponent(null===z||void 0===z?void 0:z.template_uuid):V&&encodeURIComponent(V),{object_type:h.Z}),{onSuccess:function(e){return(0,M.wD)(e,{callback:function(e){var n=e.custom_template;q&&(null===q||void 0===q||q()),me(n),de(!1)},onErrorCallback:function(e,n){return $({errors:n,response:e})}})}}),ke=(0,r.Z)(Ce,2),ye=ke[0],Oe=ke[1].isLoading,Ee=(0,l.useMemo)((function(){return y.tf.MARKDOWN===(null===pe||void 0===pe?void 0:pe.block_type)}),[null===pe||void 0===pe?void 0:pe.block_type]),Te=!z&&!V,Se=(0,l.useMemo)((function(){return Te?!(null!==pe&&void 0!==pe&&pe.template_uuid)||!(null!==pe&&void 0!==pe&&pe.block_type)||!Ee&&!(null!==pe&&void 0!==pe&&pe.language):!se}),[Ee,Te,pe,se]),Ie=C.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),Re=Ie.data,Ae=Ie.mutate,Pe=null===Re||void 0===Re?void 0:Re.kernels,we=(null===Pe||void 0===Pe?void 0:Pe.find((function(e){return e.name===w.a_[w.qL.PYTHON]})))||(null===Pe||void 0===Pe?void 0:Pe[0]),De=(0,a.Db)(C.ZP.kernels.useUpdate(null===we||void 0===we?void 0:we.id),{onSuccess:function(e){return(0,M.wD)(e,{callback:function(){return Ae()},onErrorCallback:function(e,n){return $({errors:n,response:e})}})}}),Me=(0,r.Z)(De,1)[0],Ne=(0,l.useCallback)((function(){Me({kernel:{action_type:"interrupt"}}),Qe([])}),[Me]),Be=(0,l.useState)({}),Le=Be[0],Ue=Be[1],Fe=(0,l.useState)([]),He=Fe[0],Qe=Fe[1],Ge=(0,l.useMemo)((function(){return{language:null===pe||void 0===pe?void 0:pe.language,name:null===pe||void 0===pe?void 0:pe.name,type:null===pe||void 0===pe?void 0:pe.block_type,uuid:null===pe||void 0===pe?void 0:pe.template_uuid}}),[pe]),We=(0,l.useMemo)((function(){return new d.Z}),[]),qe=(0,l.useMemo)((function(){return{api_key:A.l,token:We.decodedToken.token}}),[We]),ze=(0,i.ZP)((0,D.Ib)(),{onClose:function(){return console.log("socketUrlPublish closed")},onMessage:function(e){if(e){var n=JSON.parse(e.data),t=n.execution_state,r=n.uuid;if(!r)return;Ue((function(e){var t=e[r]||[];return Q(Q({},e),{},(0,o.Z)({},r,t.concat(n)))})),E.uF.BUSY===t?Qe((function(e){return e.find((function(e){var n=e.uuid;return r===n}))||!Ge?e:e.concat(Ge)})):E.uF.IDLE===t&&Qe((function(e){return e.filter((function(e){var n=e.uuid;return r!==n}))}))}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,Ke=(0,l.useCallback)((function(e){var n=e.block,t=e.code,o=e.ignoreAlreadyRunning,r=e.runDownstream,i=void 0!==r&&r,l=e.runIncompleteUpstream,u=void 0!==l&&l,c=e.runSettings,a=void 0===c?{}:c,s=e.runTests,d=void 0!==s&&s,f=e.runUpstream,p=n.extension_uuid,m=n.upstream_blocks,h=n.uuid;He.find((function(e){var n=e.uuid;return h===n}))&&!o||(ze(JSON.stringify(Q(Q({},qe),{},{code:t,extension_uuid:p,run_downstream:i,run_incomplete_upstream:u,run_settings:a,run_tests:d,run_upstream:f,type:n.type,upstream_blocks:m,uuid:h}))),Ue((function(e){return delete e[h],e})),Qe((function(e){return e.find((function(e){var n=e.uuid;return h===n}))?e:e.concat(n)})))}),[He,ze,Ue,Qe,qe]),Ve=(0,l.useMemo)((function(){return He.reduce((function(e,n,t){return Q(Q({},e),{},(0,o.Z)({},n.uuid,Q(Q({},n),{},{priority:t})))}),{})}),[He]),Ye=(0,l.useMemo)((function(){if(!re)return(0,F.jsx)("div",{});var e=Ve[null===Ge||void 0===Ge?void 0:Ge.uuid],n=e?0===e.priority?E.uF.BUSY:E.uF.QUEUED:E.uF.IDLE;return(0,F.jsx)(m.Z,{block:Ge,defaultValue:null===pe||void 0===pe?void 0:pe.content,disableDrag:!0,executionState:n,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,interruptKernel:Ne,messages:null===Le||void 0===Le?void 0:Le[null===Ge||void 0===Ge?void 0:Ge.uuid],noDivider:!0,onChange:function(e){return he((function(n){return Q(Q({},n),{},{content:e})}))},runBlock:Ke,runningBlocks:He,selected:!0,setErrors:$,textareaFocused:!0},String(ne))}),[Ge,ne,Ne,Le,re,Ke,He,Ve,he,$,pe]),Xe=(0,l.useCallback)((function(){var e={custom_template:Q(Q({},pe),{},{language:Ee?y.t6.MARKDOWN:null===pe||void 0===pe?void 0:pe.language,object_type:h.Z})};Te?Ze(e):ye(e)}),[Ze,Ee,Te,pe,ye]),Je="CustomTemplates/TemplateDetail",$e=(0,L.y)(),en=$e.registerOnKeyDown,nn=$e.unregisterOnKeyDown;(0,l.useEffect)((function(){return function(){nn(Je)}}),[nn,Je]),en(Je,(function(e,n){if(se&&(0,N.y)([T.zX,T.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()}else((0,N.y)([T.zX,T.Um],n)||(0,N.y)([T.PQ,T.Um],n))&&(e.preventDefault(),Xe())}),[Xe,se]);var tn=(0,l.useMemo)((function(){return Y-H}),[Y,H]);return(0,F.jsxs)(O.Nk,{children:[(0,F.jsx)(O.bC,{height:n?tn:null,children:(0,F.jsxs)(b.Z,{flexDirection:"column",fullHeight:!0,children:[(0,F.jsx)(O.Yf,{children:(0,F.jsx)(p.Z,{noPadding:!0,onClickTab:function(e){ce(e)},selectedTabUUID:null===ue||void 0===ue?void 0:ue.uuid,tabs:Te?R.slice(0,1):R})}),(0,F.jsxs)(v.Z,{flexDirection:"column",children:[S.uuid===(null===ue||void 0===ue?void 0:ue.uuid)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(g.Z,{mt:P.cd,px:P.cd,children:[(0,F.jsxs)(g.Z,{mb:1,children:[(0,F.jsx)(j.ZP,{bold:!0,children:"Template UUID"}),(0,F.jsx)(j.ZP,{muted:!0,small:!0,children:"Unique identifier for custom template. The UUID will also determine where the custom template file is stored in the project. You can use nested folder names in the template\u2019s UUID."})]}),(0,F.jsx)(_.Z,{monospace:!0,onChange:function(e){return he((function(n){return Q(Q({},n),{},{template_uuid:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===pe||void 0===pe?void 0:pe.template_uuid)||""})]}),(0,F.jsx)(g.Z,{mt:P.cd,px:P.cd,children:(0,F.jsx)(x.Z,{label:"Block type",onChange:function(e){return he((function(n){return Q(Q({},n),{},{block_type:e.target.value,language:y.tf.MARKDOWN===e.target.value?y.t6.MARKDOWN:null===n||void 0===n?void 0:n.language})}))},primary:!0,value:(null===pe||void 0===pe?void 0:pe.block_type)||"",children:Object.values(y.tf).map((function(e){return(0,F.jsx)("option",{value:e,children:y.V4[e]},e)}))})}),!Ee&&(0,F.jsx)(g.Z,{mt:P.cd,px:P.cd,children:(0,F.jsx)(x.Z,{label:"Language",onChange:function(e){return he((function(n){return Q(Q({},n),{},{language:e.target.value})}))},primary:!0,value:(null===pe||void 0===pe?void 0:pe.language)||"",children:Object.values(y.t6).map((function(e){return(0,F.jsx)("option",{value:e,children:y.LE[e]},e)}))})})]}),I.uuid===(null===ue||void 0===ue?void 0:ue.uuid)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(g.Z,{mt:P.cd,px:P.cd,children:[(0,F.jsxs)(g.Z,{mb:1,children:[(0,F.jsx)(j.ZP,{bold:!0,children:"Name"}),(0,F.jsx)(j.ZP,{muted:!0,small:!0,children:"A human readable name for your template."})]}),(0,F.jsx)(_.Z,{onChange:function(e){return he((function(n){return Q(Q({},n),{},{name:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===pe||void 0===pe?void 0:pe.name)||""})]}),(0,F.jsx)(g.Z,{mt:P.cd,px:P.cd,children:(0,F.jsx)(Z.Z,{label:"Description",onChange:function(e){return he((function(n){return Q(Q({},n),{},{description:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===pe||void 0===pe?void 0:pe.description)||""})})]})]}),(0,F.jsx)(O.ig,{children:(0,F.jsx)(g.Z,{p:P.cd,children:(0,F.jsxs)(b.Z,{children:[(0,F.jsxs)(f.Z,{disabled:Se,fullWidth:!0,loading:_e||Oe,onClick:function(){return Xe()},primary:!0,children:[!Te&&"Save template",Te&&"Create new template"]}),G&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(g.Z,{mr:1}),(0,F.jsx)(f.Z,{onClick:G,secondary:!0,children:"Cancel"})]})]})})})]})}),(0,F.jsx)(O.w5,{children:(0,F.jsx)(g.Z,{p:P.cd,children:(0,F.jsx)(u.W,{backend:c.PD,children:Ye})})})]})}},19140:function(e,n,t){t.d(n,{W4:function(){return d},Wx:function(){return s},ZG:function(){return a}});var o=t(38626),r=t(23831),i=t(86422),l=t(73942),u=t(49125),c=t(44162),a=u.cd*u.iI,s=o.default.div.withConfig({displayName:"indexstyle__IconContainerStyle",componentId:"sc-oyfjzc-0"})(["align-items:center;border-radius:","px;border:1px solid transparent;display:flex;justify-content:center;"," "," "," "," "," "," "," "," "," ",""],l.BG,(function(e){return e.border&&"\n border: 1px dotted ".concat((e.theme.content||r.Z.content).active,";\n ")}),(function(e){return e.grey&&"\n background-color: ".concat((0,c.qn)(i.tf.SCRATCHPAD,e).accent,";\n ")}),(function(e){return e.blue&&"\n background-color: ".concat((0,c.qn)(i.tf.DATA_LOADER,e).accent,";\n ")}),(function(e){return e.purple&&"\n background-color: ".concat((0,c.qn)(i.tf.TRANSFORMER,e).accent,";\n ")}),(function(e){return e.sky&&"\n background-color: ".concat((0,c.qn)(i.tf.MARKDOWN,e).accent,";\n ")}),(function(e){return e.teal&&"\n background-color: ".concat((0,c.qn)(i.tf.EXTENSION,e).accent,";\n ")}),(function(e){return e.rose&&"\n background-color: ".concat((0,c.qn)(i.tf.CALLBACK,e).accent,";\n ")}),(function(e){return e.yellow&&"\n background-color: ".concat((0,c.qn)(i.tf.DATA_EXPORTER,e).accent,";\n ")}),(function(e){return!e.compact&&"\n height: ".concat(a+u.iI/2,"px;\n width: ").concat(a+u.iI/2,"px;\n ")}),(function(e){return e.compact&&"\n height: ".concat(a/2+u.iI,"px;\n width: ").concat(a/2+u.iI,"px;\n ")})),d=o.default.div.withConfig({displayName:"indexstyle__ButtonWrapper",componentId:"sc-oyfjzc-1"})(["position:relative;margin-bottom:","px;margin-right:","px;",""],u.iI,u.iI,(function(e){return e.increasedZIndex&&"\n z-index: 3;\n "}))},42201:function(e,n,t){t.d(n,{Z:function(){return C}});var o=t(82394),r=t(21831),i=t(82684),l=t(47999),u=t(28598);var c=function(e){var n=e.size;return(0,u.jsx)("svg",{fill:"none",height:n,preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",width:n,xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{d:"M245.121138,10.6473813 C251.139129,16.4340053 255.074133,24.0723342 256,32.4050489 C256,35.8769778 255.074133,38.1917867 252.990862,42.5895822 C250.907876,46.9873778 225.215147,91.4286933 217.57696,103.696213 C213.179164,110.871609 210.864356,119.435947 210.864356,127.768462 C210.864356,136.3328 213.179164,144.6656 217.57696,151.840996 C225.215147,164.108516 250.907876,208.781084 252.990862,213.179164 C255.074133,217.57696 256,219.659947 256,223.131876 C255.074133,231.464676 251.370667,239.103147 245.352676,244.658347 C239.565938,250.676338 231.927751,254.611342 223.826489,255.305671 C220.35456,255.305671 218.039751,254.379804 213.873493,252.296533 C209.706951,250.213262 164.340053,225.215147 152.072249,217.57696 C151.146382,217.113884 150.220516,216.419556 149.063396,215.95648 L88.4195556,180.079502 C89.8082133,191.652693 94.9006222,202.763093 103.233138,210.864356 C104.853618,212.484551 106.473813,213.873493 108.325547,215.262151 C106.936604,215.95648 105.316409,216.651093 103.927751,217.57696 C91.6599467,225.215147 46.9873778,250.907876 42.5895822,252.990862 C38.1917867,255.074133 36.1085156,256 32.4050489,256 C24.0723342,255.074133 16.4340053,251.370667 10.8788338,245.352676 C4.86075733,239.565938 0.925858133,231.927751 0,223.594951 C0.231464676,220.123022 1.1573248,216.651093 3.00905244,213.641956 C5.09223822,209.24416 30.7848533,164.571307 38.42304,152.303787 C42.82112,145.128391 45.1356444,136.795591 45.1356444,128.231538 C45.1356444,119.6672 42.82112,111.3344 38.42304,104.159004 C30.7848533,91.4286933 4.86075733,46.75584 3.00905244,42.3580444 C1.1573248,39.3489067 0.231464676,35.8769778 0,32.4050489 C0.925858133,24.0723342 4.62930489,16.4340053 10.6473813,10.6473813 C16.4340053,4.62930489 24.0723342,0.925858133 32.4050489,0 C35.8769778,0.231464676 39.3489067,1.1573248 42.5895822,3.00905244 C46.2930489,4.62930489 78.9293511,23.6094009 96.28928,33.7939911 L100.224284,36.1085156 C101.612942,37.0343822 102.770347,37.7287111 103.696213,38.1917867 L105.547947,39.3489067 L167.348907,75.9204978 C165.960249,62.0324978 158.784853,49.3019022 147.674453,40.7378489 C149.063396,40.04352 150.683591,39.3489067 152.072249,38.42304 C164.340053,30.7848533 209.012622,4.86075733 213.410418,3.00905244 C216.419556,1.1573248 219.891484,0.231464676 223.594951,0 C231.696213,0.925858133 239.334684,4.62930489 245.121138,10.6473813 Z M131.240391,144.434062 L144.434062,131.240391 C146.285796,129.388658 146.285796,126.611342 144.434062,124.759609 L131.240391,111.565938 C129.388658,109.714204 126.611342,109.714204 124.759609,111.565938 L111.565938,124.759609 C109.714204,126.611342 109.714204,129.388658 111.565938,131.240391 L124.759609,144.434062 C126.379804,146.054258 129.388658,146.054258 131.240391,144.434062 Z",fill:"#FF694A"})})},a=t(67971),s=t(30264),d=t(11135),f=t(98781),p=t(46261),m=t(10503),h=t(80906),v=t(86422),b=t(19140),g=t(32238),x=t(49125),j=t(84212);function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function _(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,o.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 C=function(e){var n=e.addNewBlock,t=e.blockIdx,o=e.blockTemplates,Z=e.compact,C=e.hideCustom,k=e.hideDataExporter,y=(e.hideDataLoader,e.hideDbt),O=e.hideMarkdown,E=e.hideScratchpad,T=e.hideSensor,S=e.hideTransformer,I=e.hideTransformerDataSources,R=e.onClickAddSingleDBTModel,A=e.pipeline,P=e.setAddNewBlockMenuOpenIdx,w=e.setCreatingNewDBTModel,D=e.showBrowseTemplates,M=(0,i.useState)(null),N=M[0],B=M[1],L=(0,i.useRef)(null),U=(0,i.useRef)(null),F=(0,i.useRef)(null),H=(0,i.useRef)(null),Q=(0,i.useRef)(null),G=(0,i.useRef)(null),W=(0,i.useRef)(null),q={compact:Z,inline:!0},z=null===A||void 0===A?void 0:A.type,K=z===f.qL.STREAMING,V=Z?b.ZG/2:b.ZG,Y=25*x.iI,X=(0,i.useMemo)((function(){return(0,j.q_)(g.c1,h.qs.COLUMN,n)}),[n]),J=(0,i.useMemo)((function(){return(0,j.q_)(g.Wt,h.qs.ROW,n)}),[n]),$=(0,i.useMemo)((function(){var e=[{label:function(){return"Generic (no template)"},onClick:function(){n({language:v.t6.PYTHON,type:v.tf.TRANSFORMER})},uuid:"generic_transformer_action"},{bold:!0,items:J,label:function(){return"Row actions"},uuid:"row_actions_grouping"},{isGroupingTitle:!0,label:function(){return"Column actions"},uuid:"column_actions_grouping"}].concat((0,r.Z)(X));return I||e.splice(1,0,{bold:!0,items:(0,j.hr)(n,v.tf.TRANSFORMER,z),label:function(){return"Data sources"},uuid:"data_sources_grouping"}),e}),[n,X,I,z,J]),ee=(0,i.useCallback)((function(){return B(null)}),[]),ne=(0,i.useCallback)((function(e){return null===P||void 0===P?void 0:P((function(n){return null===n||N!==e?t:null}))}),[t,N,P]),te=f.qL.PYSPARK===z,oe=(0,i.useMemo)((function(){return(0,j.oM)(o,n)}),[n,o]),re=(0,i.useMemo)((function(){return(0,j.hr)(n,v.tf.DATA_LOADER,z,{blockTemplatesByBlockType:oe,showBrowseTemplates:D})}),[n,oe,z,D]),ie=(0,i.useMemo)((function(){return(0,j.hr)(n,v.tf.DATA_EXPORTER,z,{blockTemplatesByBlockType:oe,showBrowseTemplates:D})}),[n,oe,z,D]),le=(0,i.useMemo)((function(){return te||f.qL.INTEGRATION===z?$:K?[{items:(0,j.hr)(n,v.tf.TRANSFORMER,z),label:function(){return"Python"},uuid:"transformers/python"}]:[{items:$,label:function(){return"Python"},uuid:"transformers/python_all"}].concat((0,r.Z)((0,j.qs)(n,v.tf.TRANSFORMER)),(0,r.Z)((0,j.hr)(n,v.tf.TRANSFORMER,z,{blockTemplatesByBlockType:oe,onlyCustomTemplate:!0,showBrowseTemplates:D})))}),[n,$,oe,te,K,z,D]);return(0,u.jsx)(a.Z,{flexWrap:"wrap",inline:!0,children:(0,u.jsx)(l.Z,{onClickOutside:ee,open:!0,children:(0,u.jsxs)(a.Z,{flexWrap:"wrap",children:[!k&&(0,u.jsx)(b.W4,{increasedZIndex:0===N,children:(0,u.jsx)(s.Z,{disableKeyboardShortcuts:!0,items:re,onClickCallback:ee,open:0===N,parentRef:L,uuid:"data_loader_button",children:(0,u.jsx)(d.ZP,_(_({},q),{},{beforeElement:(0,u.jsx)(b.Wx,{blue:!0,compact:Z,children:(0,u.jsx)(m.mm,{size:V})}),onClick:function(e){e.preventDefault(),B((function(e){return 0===e?null:0})),ne(0)},uuid:"AddNewBlocks/Data_loader",children:"Data loader"}))})}),!S&&(0,u.jsx)(b.W4,{increasedZIndex:1===N,children:(0,u.jsx)(s.Z,{disableKeyboardShortcuts:!0,items:le,onClickCallback:ee,open:1===N,parentRef:U,uuid:"transformer_button",children:(0,u.jsx)(d.ZP,_(_({},q),{},{beforeElement:(0,u.jsx)(b.Wx,{compact:Z,purple:!0,children:(0,u.jsx)(m.mm,{size:V})}),onClick:function(e){e.preventDefault(),B((function(e){return 1===e?null:1})),ne(1)},uuid:"AddNewBlocks/Transformer",children:"Transformer"}))})}),!k&&(0,u.jsx)(b.W4,{increasedZIndex:2===N,children:(0,u.jsx)(s.Z,{disableKeyboardShortcuts:!0,items:ie,onClickCallback:ee,open:2===N,parentRef:F,uuid:"data_exporter_button",children:(0,u.jsx)(d.ZP,_(_({},q),{},{beforeElement:(0,u.jsx)(b.Wx,{compact:Z,yellow:!0,children:(0,u.jsx)(m.mm,{inverted:!0,size:V})}),onClick:function(e){e.preventDefault(),B((function(e){return 2===e?null:2})),ne(2)},uuid:"AddNewBlocks/Data_exporter",children:"Data exporter"}))})}),!y&&(0,u.jsx)(b.W4,{increasedZIndex:3===N,children:(0,u.jsx)(s.Z,{disableKeyboardShortcuts:!0,items:[{label:function(){return"New model"},onClick:function(){null===w||void 0===w||w(!0),null===R||void 0===R||R(t)},uuid:"dbt/new_model"},{label:function(){return"Single model or snapshot (from file)"},onClick:function(){return null===R||void 0===R?void 0:R(t)},uuid:"dbt/single_model"},{label:function(){return"All models (w/ optional exclusion)"},onClick:function(){return n({configuration:{dbt:{command:"run"}},language:v.t6.YAML,type:v.tf.DBT})},uuid:"dbt/all_models"},{label:function(){return"Generic dbt command"},onClick:function(){return n({configuration:{dbt:{command:null}},language:v.t6.YAML,type:v.tf.DBT})},uuid:"dbt/generic_command"}].concat((0,r.Z)((0,j.hr)(n,v.tf.DBT,z,{blockTemplatesByBlockType:oe,onlyCustomTemplate:!0,showBrowseTemplates:D}))),onClickCallback:ee,open:3===N,parentRef:H,uuid:"dbt_button",children:(0,u.jsx)(d.ZP,_(_({},q),{},{beforeElement:(0,u.jsx)(c,{size:b.ZG*(Z?.75:1.25)}),onClick:function(e){e.preventDefault(),B((function(e){return 3===e?null:3})),ne(3)},uuid:"AddNewBlocks/DBT",children:"DBT model"}))})}),!C&&(0,u.jsx)(b.W4,{increasedZIndex:4===N,children:(0,u.jsx)(s.Z,{disableKeyboardShortcuts:!0,items:[{items:(0,j.Bd)(n,v.tf.CUSTOM,v.t6.PYTHON),label:function(){return"Python"},uuid:"custom_block_python"},{items:(0,j.Bd)(n,v.tf.CUSTOM,v.t6.SQL),label:function(){return"SQL"},uuid:"custom_block_sql"}].concat((0,r.Z)((0,j.hr)(n,v.tf.CUSTOM,z,{blockTemplatesByBlockType:oe,onlyCustomTemplate:!0,showBrowseTemplates:D}))),onClickCallback:ee,open:4===N,parentRef:Q,uuid:"custom_block_button",children:(0,u.jsx)(p.Z,{block:!0,label:"Add a custom code block with a designated color.",maxWidth:Y,size:null,children:(0,u.jsx)(d.ZP,_(_({},q),{},{beforeElement:(0,u.jsx)(b.Wx,{compact:Z,grey:!0,children:(0,u.jsx)(m.mm,{inverted:!0,size:V})}),onClick:function(e){e.preventDefault(),B((function(e){return 4===e?null:4})),ne(4)},uuid:"AddNewBlocks/Scratchpad",children:"Custom"}))})})}),!E&&(0,u.jsx)(b.W4,{children:(0,u.jsx)(p.Z,{block:!0,label:"Write experimental code that doesn\u2019t get executed when you run your pipeline.",maxWidth:Y,size:null,children:(0,u.jsx)(d.ZP,_(_({},q),{},{beforeElement:(0,u.jsx)(b.Wx,{border:!0,compact:Z,children:(0,u.jsx)(m.mm,{size:V})}),onClick:function(e){e.preventDefault(),n({type:v.tf.SCRATCHPAD})},uuid:"AddNewBlocks/Scratchpad",children:"Scratchpad"}))})}),!K&&!T&&(0,u.jsx)(b.W4,{increasedZIndex:6===N,children:(0,u.jsx)(s.Z,{disableKeyboardShortcuts:!0,items:[].concat((0,r.Z)((0,j.hr)(n,v.tf.SENSOR,z)),(0,r.Z)((0,j.hr)(n,v.tf.SENSOR,z,{blockTemplatesByBlockType:oe,onlyCustomTemplate:!0,showBrowseTemplates:D}))),onClickCallback:ee,open:6===N,parentRef:G,uuid:"sensor_button",children:(0,u.jsx)(d.ZP,_(_({},q),{},{beforeElement:(0,u.jsx)(b.Wx,{compact:Z,children:(0,u.jsx)(m.LM,{pink:!0,size:b.ZG*(Z?.75:1.25)})}),onClick:function(e){e.preventDefault(),B((function(e){return 6===e?null:6})),ne(6)},uuid:"AddNewBlocks/Sensor",children:"Sensor"}))})}),!O&&(0,u.jsx)(b.W4,{increasedZIndex:7===N,children:(0,u.jsx)(s.Z,{disableKeyboardShortcuts:!0,items:[{label:function(){return"Generic (no template)"},onClick:function(){n({language:v.t6.MARKDOWN,type:v.tf.MARKDOWN})},uuid:"generic_markdown"}].concat((0,r.Z)((0,j.hr)(n,v.tf.MARKDOWN,z,{blockTemplatesByBlockType:oe,onlyCustomTemplate:!0,showBrowseTemplates:D}))),onClickCallback:ee,open:7===N,parentRef:W,uuid:"markdown_button",children:(0,u.jsx)(d.ZP,_(_({},q),{},{beforeElement:(0,u.jsx)(b.Wx,{compact:Z,sky:!0,children:(0,u.jsx)(m.mm,{inverted:!0,size:V})}),onClick:function(e){e.preventDefault(),B((function(e){return 7===e?null:7})),ne(7)},uuid:"AddNewBlocks/Markdown",children:"Markdown"}))})})]})})})}},84212:function(e,n,t){t.d(n,{Bd:function(){return k},SF:function(){return y},X7:function(){return O},hr:function(){return Z},oM:function(){return j},q_:function(){return C},qs:function(){return x}});var o=t(21831),r=t(82394),i=t(67971),l=t(19711),u=t(32238),c=t(10503),a=t(86422),s=t(31524),d=t(98781),f=t(90211),p=t(44162),m=t(28598);function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}var v=function(e,n,t){var o=t===d.qL.STREAMING&&(e===a.tf.DATA_LOADER||e===a.tf.DATA_EXPORTER);return(function(e){var n;return e===d.qL.STREAMING?(n={},(0,r.Z)(n,a.tf.DATA_LOADER,[s.ZP.AMAZON_SQS,s.ZP.AZURE_EVENT_HUB,s.ZP.GOOGLE_CLOUD_PUBSUB,s.ZP.KAFKA,s.ZP.KINESIS,s.ZP.RABBITMQ]),(0,r.Z)(n,a.tf.DATA_EXPORTER,[s.ZP.AZURE_DATA_LAKE,s.ZP.DUMMY,s.ZP.S3,s.ZP.KAFKA,s.ZP.KINESIS,s.ZP.MONGODB,s.ZP.OPENSEARCH]),(0,r.Z)(n,a.tf.TRANSFORMER,[s.ZP.GENERIC]),n):s.cp}(t)[e]||[]).map((function(t){return{indent:e===a.tf.TRANSFORMER,label:function(){return s.MV[t]},onClick:function(){n({config:{data_source:t===s.ZP.GENERIC?null:t},language:o?a.t6.YAML:a.t6.PYTHON,type:e})},uuid:"".concat(e,"/").concat(t)}}))};function b(e,n){return{label:function(){return"SQL"},onClick:function(){return e({language:a.t6.SQL,type:n})},uuid:"".concat(n,"/sql")}}function g(e,n){return{label:function(){return"R"},onClick:function(){return e({language:a.t6.R,type:n})},uuid:"".concat(n,"/r")}}var x=function(e,n){return[b(e,n),g(e,n)]};function j(e,n){var t={};return null===e||void 0===e||e.forEach((function(e){var o=e.block_type,i=e.description,l=e.groups,u=e.language,c=e.name,a=e.path;t[o]||(t[o]={}),t[o][u]||(t[o][u]={items:[],label:function(){return u},uuid:"".concat(o,"/").concat(u)});var s={label:function(){return c},onClick:function(){return n({config:{template_path:a},language:u,type:o})},tooltip:function(){return i},uuid:a};if((null===l||void 0===l?void 0:l.length)>=1){var d=function(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,r.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}({},t[o][u]),f=[null],p=[d];l.forEach((function(e,n){var t="".concat(o,"/").concat(u,"/").concat(l.slice(0,n+1).join("/")),r=p[n],i=r.items.findIndex((function(e){var n=e.uuid;return t===n})),c=i>=0?r.items[i]:null;c||(c={items:[],label:function(){return e},uuid:t}),f.push(i),p.push(c)})),f.push(-1),p.push(s);var m=p.length;t[o][u]=p.reduce((function(e,n,t){var o=m-t,r=p[o-2],i=p[o-1],l=f[o-1];return r?(l>=0?r.items[l]=i:r.items.push(i),r):i}),{})}else t[o][u].items.push(s)})),t}var Z=function(e,n,t,o){var r=o||{},i=r.blockTemplatesByBlockType,l=r.languages,u=r.onlyCustomTemplate,c=r.showBrowseTemplates,s=Object.fromEntries(a.Ut.map((function(n){return[n,v(n,e,t)]}))),f={label:function(){return"Custom template"},onClick:function(){return c({addNewBlock:e,blockType:n,language:a.t6.SQL})},uuid:"".concat(n,"/custom_template")};if(u)return[f];if(t===d.qL.PYSPARK||t===d.qL.PYTHON&&n===a.tf.TRANSFORMER||t===d.qL.STREAMING||n===a.tf.SENSOR)return s[n];var p,m,h=(null===i||void 0===i||null===(p=i[n])||void 0===p||null===(m=p[a.t6.PYTHON])||void 0===m?void 0:m.items)||[],x=[{items:(s[n]||[]).concat(h),label:function(){return"Python"},uuid:"".concat(n,"/").concat(a.t6.PYTHON)}];return(!l||null!==l&&void 0!==l&&l.includes(a.t6.SQL))&&x.push(b(e,n)),(!l||null!==l&&void 0!==l&&l.includes(a.t6.R))&&x.push(g(e,n)),![a.tf.MARKDOWN,a.tf.SCRATCHPAD].includes(n)&&c&&x.push(f),x};function _(e,n,t){return e.map((function(e){return{indent:!0,label:function(){return u.NX[n][e]},onClick:function(){t({config:{action_type:e,axis:n},language:a.t6.PYTHON,type:a.tf.TRANSFORMER})},uuid:"".concat(n,"_").concat(e)}})).sort((function(e,n){return e.label().localeCompare(n.label())}))}function C(e,n,t){var r=[];return e.forEach((function(e){if(e!==u._G.MISC)r.push({indent:!0,items:_(u.d9[n][e],n,t),label:function(){return e},uuid:"".concat(n,"_grouping_").concat((0,f.RA)(e))});else{var i=_(u.d9[n][e],n,t);r.push.apply(r,(0,o.Z)(i))}})),r}var k=function(e,n,t){return Object.values(a.Lq).map((function(o){return{label:function(){return(0,m.jsxs)(i.Z,{alignItems:"center",children:[(0,m.jsx)(c.mm,{fill:(0,p.qn)(a.tf.CUSTOM,{blockColor:o}).accent,size:16}),"\xa0",(0,m.jsx)(l.ZP,{children:(0,f.kC)(o)})]})},leftAligned:!0,onClick:function(){e({color:o,language:t,type:n})},uuid:"".concat(t,"_").concat(o)}}))},y=function(e){return"-- Docs: https://docs.mage.ai/guides/sql-blocks\n"+(e||"")};function O(e,n){var t=n;return a.tf.SCRATCHPAD===e.type&&(t='"""\nNOTE: Scratchpad blocks are used only for experimentation and testing out code.\nThe code written here will not be executed as part of the pipeline.\n"""\n'+(n||"")),t}},43482:function(e,n,t){t.d(n,{Dp:function(){return p},OF:function(){return m},Q9:function(){return v},Rt:function(){return s},h8:function(){return h},k1:function(){return d},uS:function(){return b}});var o=t(21831),r=t(82394),i=t(91427),l=t(24224),u=t(90211);function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}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,r.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}function s(e){var n={},t={};return null===e||void 0===e||e.forEach((function(e){var o=e.content,r=e.outputs,i=e.type,l=e.uuid;(null===r||void 0===r?void 0:r.length)>=1&&(n[l]=r.map((function(e){var n=e||{},t=n.sample_data,o=n.shape,r=n.text_data,i=n.type;return t?{data:a({shape:o},t),type:i}:r&&(0,u.Pb)(r)?JSON.parse(r):r}))),t[i]||(t[i]={}),t[i][l]=o})),{content:t,messages:n}}function d(e,n,t){e.forEach((function(e){(0,i.t8)("".concat(t,"/").concat(e.uuid,"/codeCollapsed"),(0,i.Od)("".concat(n,"/").concat(e.uuid,"/codeCollapsed"))),(0,i.t8)("".concat(t,"/").concat(e.uuid,"/outputCollapsed"),(0,i.Od)("".concat(n,"/").concat(e.uuid,"/outputCollapsed")))}))}function f(e){return"".concat(e,"/").concat(i.kP)}function p(e){return(0,i.U2)(f(e),[])}function m(e,n){var t=p(e);t.includes(n)||(0,i.t8)(f(e),[].concat((0,o.Z)(t),[n]))}function h(e,n){var t=p(e).filter((function(e){return e!==n}));(0,i.t8)(f(e),t)}function v(e,n){var t=(0,l.HK)(n,(function(e){return e.uuid}));return e.map((function(e){return t[e]})).filter((function(e){return!!e}))}var b=function(e,n){var t=window.URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=n,document.body.appendChild(o),o.click(),o.remove()}},80906:function(e,n,t){var o,r,i,l;t.d(n,{Q0:function(){return o},qs:function(){return r}}),function(e){e.ADD="add",e.AVERAGE="average",e.CLEAN_COLUMN_NAME="clean_column_name",e.COUNT="count",e.COUNT_DISTINCT="count_distinct",e.CUSTOM="custom",e.DIFF="diff",e.DROP_DUPLICATE="drop_duplicate",e.EXPAND_COLUMN="expand_column",e.EXPLODE="explode",e.FILTER="filter",e.FIRST="first",e.FIX_SYNTAX_ERRORS="fix_syntax_errors",e.GROUP="group",e.IMPUTE="impute",e.JOIN="join",e.LAST="last",e.LIMIT="limit",e.MAX="max",e.MEDIAN="median",e.MIN="min",e.MODE="mode",e.NORMALIZE="normalize",e.REFORMAT="reformat",e.REMOVE="remove",e.REMOVE_OUTLIERS="remove_outliers",e.SCALE="scale",e.SELECT="select",e.SHIFT_DOWN="shift_down",e.SHIFT_UP="shift_up",e.SORT="sort",e.STANDARDIZE="standardize",e.SUM="sum",e.UNION="union",e.UPDATE_TYPE="update_type",e.UPDATE_VALUE="update_value"}(o||(o={})),function(e){e.COLUMN="column",e.ROW="row"}(r||(r={})),function(e){e.NOT_APPLIED="not_applied",e.COMPLETED="completed"}(i||(i={})),function(e){e.FEATURE="feature"}(l||(l={}))},45419:function(e,n,t){var o;t.d(n,{Q:function(){return o}}),function(e){e.CALLBACK="callbacks",e.CONDITIONAL="conditionals"}(o||(o={}))},42451:function(e,n,t){t.d(n,{$1:function(){return v},BD:function(){return j},CK:function(){return D},ED:function(){return c},JJ:function(){return u},JT:function(){return P},MP:function(){return M},Mi:function(){return S},Mv:function(){return _},PG:function(){return s},Pi:function(){return I},R8:function(){return i},Sv:function(){return g},Tv:function(){return A},Yf:function(){return E},Yg:function(){return f},a3:function(){return m},aE:function(){return N},aZ:function(){return T},bE:function(){return d},bk:function(){return O},bn:function(){return B},c0:function(){return L},cH:function(){return b},e:function(){return a},eN:function(){return l},eW:function(){return C},m$:function(){return Z},m7:function(){return r},mW:function(){return y},nq:function(){return k},oV:function(){return o},pA:function(){return R},rj:function(){return h},sc:function(){return x},v8:function(){return p}});var o,r="buckets",i="chart_style",l="group_by",u="height",c="index",a="legend_labels",s="limit",d="metrics",f="time_interval",p="width_percentage",m="x",h="y",v="y_sort_order",b="data_provider",g="data_provider_database",x="data_provider_profile",j="data_provider_schema",Z="data_provider_table",_="dbt_profile_target",C="dbt_project_name",k="export_write_policy",y="limit",O="unique_upstream_table_name",E="upstream_block_configuration",T="table_name",S="use_raw_sql",I="dbt",R="command",A=[m,h];!function(e){e.BAR_CHART="bar chart",e.HISTOGRAM="histogram",e.LINE_CHART="line chart",e.PIE_CHART="pie chart",e.TABLE="table",e.TIME_SERIES_BAR_CHART="time series bar chart",e.TIME_SERIES_LINE_CHART="time series line chart"}(o||(o={}));var P,w,D=[o.BAR_CHART,o.HISTOGRAM,o.LINE_CHART,o.PIE_CHART,o.TABLE,o.TIME_SERIES_BAR_CHART,o.TIME_SERIES_LINE_CHART];!function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(P||(P={})),function(e){e.AVERAGE="average",e.COUNT="count",e.COUNT_DISTINCT="count_distinct",e.MAX="max",e.MEDIAN="median",e.MIN="min",e.MODE="mode",e.SUM="sum"}(w||(w={}));var M,N,B=[w.AVERAGE,w.COUNT,w.COUNT_DISTINCT,w.MAX,w.MEDIAN,w.MIN,w.MODE,w.SUM];function L(e){return"".concat(e.aggregation,"(").concat(e.column,")")}!function(e){e.ASCENDING="ascending",e.DESCENDING="descending"}(M||(M={})),function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.MONTH="month",e.ORIGINAL="original",e.SECOND="second",e.WEEK="week",e.YEAR="year"}(N||(N={}))},18908:function(e,n,t){t.d(n,{R:function(){return r},Z:function(){return o}});var o="blocks",r="pipelines"},31524:function(e,n,t){t.d(n,{MV:function(){return c},cp:function(){return a},zJ:function(){return i}});var o,r,i,l=t(82394),u=t(86422);!function(e){e.AMAZON_SQS="amazon_sqs",e.API="api",e.AZURE_BLOB_STORAGE="azure_blob_storage",e.AZURE_DATA_LAKE="azure_data_lake",e.AZURE_EVENT_HUB="azure_event_hub",e.BIGQUERY="bigquery",e.DRUID="druid",e.DUMMY="dummy",e.FILE="file",e.GENERIC="generic",e.GOOGLE_CLOUD_PUBSUB="google_cloud_pubsub",e.GOOGLE_CLOUD_STORAGE="google_cloud_storage",e.KAFKA="kafka",e.KINESIS="kinesis",e.MONGODB="mongodb",e.MYSQL="mysql",e.OPENSEARCH="opensearch",e.ORACLEDB="oracledb",e.POSTGRES="postgres",e.RABBITMQ="rabbitmq",e.REDSHIFT="redshift",e.S3="s3",e.SNOWFLAKE="snowflake"}(i||(i={}));var c=(o={},(0,l.Z)(o,i.AMAZON_SQS,"Amazon SQS"),(0,l.Z)(o,i.API,"API"),(0,l.Z)(o,i.AZURE_BLOB_STORAGE,"Azure Blob Storage"),(0,l.Z)(o,i.AZURE_DATA_LAKE,"Azure Data Lake"),(0,l.Z)(o,i.AZURE_EVENT_HUB,"Azure Event Hub"),(0,l.Z)(o,i.BIGQUERY,"Google BigQuery"),(0,l.Z)(o,i.DRUID,"Druid"),(0,l.Z)(o,i.DUMMY,"Dummy"),(0,l.Z)(o,i.FILE,"Local file"),(0,l.Z)(o,i.GENERIC,"Generic (no template)"),(0,l.Z)(o,i.GOOGLE_CLOUD_PUBSUB,"Google Cloud PubSub"),(0,l.Z)(o,i.GOOGLE_CLOUD_STORAGE,"Google Cloud Storage"),(0,l.Z)(o,i.KAFKA,"Kafka"),(0,l.Z)(o,i.KINESIS,"Kinesis"),(0,l.Z)(o,i.MONGODB,"MongoDB"),(0,l.Z)(o,i.MYSQL,"MySQL"),(0,l.Z)(o,i.OPENSEARCH,"OpenSearch"),(0,l.Z)(o,i.ORACLEDB,"OracleDB"),(0,l.Z)(o,i.POSTGRES,"PostgreSQL"),(0,l.Z)(o,i.RABBITMQ,"RabbitMQ"),(0,l.Z)(o,i.REDSHIFT,"Amazon Redshift"),(0,l.Z)(o,i.S3,"Amazon S3"),(0,l.Z)(o,i.SNOWFLAKE,"Snowflake"),o),a=(r={},(0,l.Z)(r,u.tf.DATA_LOADER,[i.GENERIC,i.FILE,i.API,i.AZURE_BLOB_STORAGE,i.BIGQUERY,i.DRUID,i.GOOGLE_CLOUD_STORAGE,i.MYSQL,i.ORACLEDB,i.POSTGRES,i.REDSHIFT,i.S3,i.SNOWFLAKE]),(0,l.Z)(r,u.tf.DATA_EXPORTER,[i.GENERIC,i.FILE,i.AZURE_BLOB_STORAGE,i.BIGQUERY,i.GOOGLE_CLOUD_STORAGE,i.MYSQL,i.POSTGRES,i.REDSHIFT,i.S3,i.SNOWFLAKE]),(0,l.Z)(r,u.tf.TRANSFORMER,[i.BIGQUERY,i.POSTGRES,i.REDSHIFT,i.SNOWFLAKE]),(0,l.Z)(r,u.tf.SENSOR,[i.GENERIC,i.BIGQUERY,i.MYSQL,i.POSTGRES,i.REDSHIFT,i.S3,i.SNOWFLAKE]),r);n.ZP=i},73828:function(e,n,t){t.d(n,{JD:function(){return v},Lu:function(){return i},PF:function(){return p},d2:function(){return f},dT:function(){return l},n6:function(){return a},nB:function(){return h},oy:function(){return m},xF:function(){return d}});var o,r,i,l,u=t(82394),c=t(86422);!function(e){e.CSV="csv",e.JSON="json",e.MD="md",e.PY="py",e.R="r",e.SQL="sql",e.TXT="txt",e.YAML="yaml",e.YML="yml"}(i||(i={})),function(e){e.INIT_PY="__init__.py",e.METADATA_YAML="metadata.yaml",e.REQS_TXT="requirements.txt"}(l||(l={}));var a=[i.PY,i.SQL],s=[i.JSON,i.MD,i.PY,i.R,i.SQL,i.TXT,i.YAML,i.YML],d=new RegExp(s.map((function(e){return".".concat(e,"$")})).join("|")),f=new RegExp(s.map((function(e){return".".concat(e,"$")})).join("|")),p="charts",m="pipelines",h=(o={},(0,u.Z)(o,i.MD,c.t6.MARKDOWN),(0,u.Z)(o,i.JSON,i.JSON),(0,u.Z)(o,i.PY,c.t6.PYTHON),(0,u.Z)(o,i.R,c.t6.R),(0,u.Z)(o,i.SQL,c.t6.SQL),(0,u.Z)(o,i.TXT,"text"),(0,u.Z)(o,i.YAML,c.t6.YAML),(0,u.Z)(o,i.YML,c.t6.YAML),o),v=(r={},(0,u.Z)(r,c.t6.MARKDOWN,i.MD),(0,u.Z)(r,c.t6.PYTHON,i.PY),(0,u.Z)(r,c.t6.R,i.R),(0,u.Z)(r,c.t6.SQL,i.SQL),(0,u.Z)(r,c.t6.YAML,i.YAML),(0,u.Z)(r,"text",i.TXT),r)},32238:function(e,n,t){t.d(n,{NX:function(){return h},Wt:function(){return m},_G:function(){return c},c1:function(){return p},d9:function(){return f}});var o,r,i,l,u,c,a=t(82394),s=t(80906),d=(s.Q0.AVERAGE,s.Q0.CLEAN_COLUMN_NAME,s.Q0.COUNT,s.Q0.COUNT_DISTINCT,s.Q0.CUSTOM,s.Q0.DIFF,s.Q0.FIRST,s.Q0.FIX_SYNTAX_ERRORS,s.Q0.IMPUTE,s.Q0.LAST,s.Q0.MAX,s.Q0.MEDIAN,s.Q0.MIN,s.Q0.NORMALIZE,s.Q0.REFORMAT,s.Q0.REMOVE,s.Q0.REMOVE_OUTLIERS,s.Q0.SELECT,s.Q0.SHIFT_DOWN,s.Q0.SHIFT_UP,s.Q0.STANDARDIZE,s.Q0.SUM,[s.Q0.DROP_DUPLICATE,s.Q0.FILTER,s.Q0.SORT,s.Q0.REMOVE]);!function(e){e.AGGREGATE="Aggregate",e.FORMATTING="Formatting",e.COLUMN_REMOVAL="Column removal",e.SHIFT_ROWS="Shift rows in a column",e.MISC="Miscellaneous",e.FEATURE_SCALING="Feature Scaling"}(c||(c={}));var f=(r={},(0,a.Z)(r,s.qs.COLUMN,(o={},(0,a.Z)(o,c.AGGREGATE,[s.Q0.AVERAGE,s.Q0.COUNT,s.Q0.COUNT_DISTINCT,s.Q0.FIRST,s.Q0.LAST,s.Q0.MAX,s.Q0.MEDIAN,s.Q0.MIN,s.Q0.SUM]),(0,a.Z)(o,c.FORMATTING,[s.Q0.CLEAN_COLUMN_NAME,s.Q0.FIX_SYNTAX_ERRORS,s.Q0.REFORMAT]),(0,a.Z)(o,c.COLUMN_REMOVAL,[s.Q0.REMOVE,s.Q0.SELECT]),(0,a.Z)(o,c.SHIFT_ROWS,[s.Q0.SHIFT_DOWN,s.Q0.SHIFT_UP]),(0,a.Z)(o,c.MISC,[s.Q0.DIFF,s.Q0.IMPUTE,s.Q0.REMOVE_OUTLIERS]),(0,a.Z)(o,c.FEATURE_SCALING,[s.Q0.NORMALIZE,s.Q0.STANDARDIZE]),o)),(0,a.Z)(r,s.qs.ROW,(0,a.Z)({},c.MISC,[].concat(d))),r),p=Object.keys(f[s.qs.COLUMN]),m=[c.MISC],h=(u={},(0,a.Z)(u,s.qs.COLUMN,(i={},(0,a.Z)(i,s.Q0.ADD,"Add column"),(0,a.Z)(i,s.Q0.AVERAGE,"Aggregate by average value"),(0,a.Z)(i,s.Q0.CLEAN_COLUMN_NAME,"Clean column name"),(0,a.Z)(i,s.Q0.COUNT_DISTINCT,"Aggregate by distinct count"),(0,a.Z)(i,s.Q0.COUNT,"Aggregate by total count"),(0,a.Z)(i,s.Q0.DIFF,"Difference"),(0,a.Z)(i,s.Q0.FIRST,"Aggregate by first value"),(0,a.Z)(i,s.Q0.FIX_SYNTAX_ERRORS,"Fix syntax errors"),(0,a.Z)(i,s.Q0.IMPUTE,"Fill in missing values"),(0,a.Z)(i,s.Q0.NORMALIZE,"Normalize Data"),(0,a.Z)(i,s.Q0.STANDARDIZE,"Standardize Data"),(0,a.Z)(i,s.Q0.LAST,"Aggregate by last value"),(0,a.Z)(i,s.Q0.MAX,"Aggregate by maximum value"),(0,a.Z)(i,s.Q0.MEDIAN,"Aggregate by median value"),(0,a.Z)(i,s.Q0.MIN,"Aggregate by mininum value"),(0,a.Z)(i,s.Q0.REFORMAT,"Reformat"),(0,a.Z)(i,s.Q0.REMOVE_OUTLIERS,"Remove outliers"),(0,a.Z)(i,s.Q0.REMOVE,"Remove column(s)"),(0,a.Z)(i,s.Q0.SELECT,"Keep columns"),(0,a.Z)(i,s.Q0.SHIFT_DOWN,"Shift rows down in a column"),(0,a.Z)(i,s.Q0.SHIFT_UP,"Shift rows up in a column"),(0,a.Z)(i,s.Q0.SUM,"Aggregate by sum of values"),i)),(0,a.Z)(u,s.qs.ROW,(l={},(0,a.Z)(l,s.Q0.DROP_DUPLICATE,"Drop duplicates"),(0,a.Z)(l,s.Q0.FILTER,"Filter"),(0,a.Z)(l,s.Q0.SORT,"Sort"),(0,a.Z)(l,s.Q0.REMOVE,"Remove rows"),l)),u)},30264:function(e,n,t){var o=t(82394),r=t(26304),i=(t(82684),t(47999)),l=t(62084),u=t(28598),c=["children","items","open","onClickCallback","onClickOutside","parentRef","uuid"];function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}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,o.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.items,o=e.open,a=e.onClickCallback,d=e.onClickOutside,f=e.parentRef,p=e.uuid,m=(0,r.Z)(e,c),h=(0,u.jsxs)("div",{style:{position:"relative",zIndex:d?3:2},children:[(0,u.jsx)("div",{ref:f,children:n}),(0,u.jsx)(l.Z,s(s({},m),{},{items:t,onClickCallback:a,open:o,parentRef:f,uuid:p}))]});return d?(0,u.jsx)(i.Z,{onClickOutside:d,open:!0,children:h}):h}},25717:function(e,n,t){var o=t(82394),r=t(26304),i=t(82684),l=t(38626),u=t(93461),c=t(67971),a=t(10919),s=t(86673),d=t(19711),f=t(82944),p=t(46261),m=t(49125),h=t(28598),v=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];function b(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function g(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,o.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 x=l.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*m.iI),j=l.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);n.Z=function(e){var n=e.bold,t=void 0===n||n,o=e.defaultColor,l=e.description,m=e.disableWordBreak,b=e.fullWidth,Z=e.inputValue,_=e.inputWidth,C=e.invertedTheme,k=e.label,y=e.labelColor,O=e.menuOpen,E=void 0!==O&&O,T=e.monospace,S=e.muted,I=e.onClick,R=e.notRequired,A=e.selectedTextProps,P=e.small,w=e.stacked,D=e.suffixValue,M=e.tooltipProps,N=e.value,B=(0,r.Z)(e,v),L=(0,i.useRef)(null),U=(0,i.useState)(!1),F=U[0],H=U[1],Q=(0,i.useState)(!1),G=Q[0],W=Q[1],q=k&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.ZP,{bold:t,color:y,inverted:C,lineHeight:20,monospace:T,muted:S,small:P,children:k}),M&&(0,h.jsx)(s.Z,{ml:1,children:(0,h.jsx)(p.Z,g({muted:!0},M))})]}),z=(0,h.jsxs)(u.Z,{flex:b?"1":"none",children:[N&&(0,h.jsx)(a.Z,{block:!0,danger:null===A||void 0===A?void 0:A.danger,fullWidth:!0,muted:S,onClick:function(){I(),L.current&&L.current.focus(),H(!0)},preventDefault:!0,sameColorAsText:S||!(null!==A&&void 0!==A&&A.primary)&&!(null!==A&&void 0!==A&&A.danger)&&!(null!==A&&void 0!==A&&A.warning),underline:null===A||void 0===A?void 0:A.underline,warning:null===A||void 0===A?void 0:A.warning,children:(0,h.jsx)(d.ZP,g(g({inverted:C,muted:S},A),{},{disableWordBreak:m,monospace:T,small:P,width:_,children:N}))}),(0,h.jsx)(f.Z,g(g({},B),{},{basic:!0,defaultColor:o,fullWidth:b,invertedTheme:C,monospace:T,onBlur:function(e){H(!1),B.onBlur&&B.onBlur(e),G||W(!0)},onFocus:function(e){H(!0),B.onFocus&&B.onFocus(e)},ref:L,small:P,value:Z,visible:!N}))]}),K=l&&(0,h.jsx)(j,{children:(0,h.jsx)(d.ZP,{dangerouslySetInnerHTML:{__html:l},monospace:T,muted:!0,small:P})}),V=(0,i.useMemo)((function(){return(0,h.jsx)(d.ZP,{default:!0,small:P,children:D})}),[P,D]);return(0,h.jsxs)(h.Fragment,{children:[w&&(0,h.jsxs)(h.Fragment,{children:[q&&(0,h.jsxs)(x,{children:[(0,h.jsx)(c.Z,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:q}),K]}),(0,h.jsxs)(c.Z,{fullWidth:b,children:[z,D&&V]})]}),!w&&(0,h.jsxs)(c.Z,{alignItems:"center",fullWidth:!0,children:[q&&(0,h.jsxs)(h.Fragment,{children:[q,(0,h.jsx)(s.Z,{ml:1})]}),z,D&&V]}),G&&!F&&!N&&!E&&!R&&(0,h.jsx)(d.ZP,{danger:!0,small:P,children:"This field is required."})]})}},66176:function(e,n,t){var o=t(82394),r=t(91835),i=(t(82684),t(38626)),l=t(23831),u=t(73942),c=t(49125),a=t(28598);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}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,o.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}var f=i.default.div.withConfig({displayName:"ProgressBar__ProgressBarContainerStyle",componentId:"sc-10x9ojc-0"})(["border-radius:","px;height:","px;overflow:hidden;position:relative;width:100%;",""],u.BG,.75*c.iI,(function(e){return"\n background-color: ".concat((e.theme.monotone||l.Z.monotone).grey200,";\n ")})),p=i.default.div.withConfig({displayName:"ProgressBar__ProgressBarStyle",componentId:"sc-10x9ojc-1"})(["height:inherit;position:absolute;"," "," "," ",""],(function(e){return!e.danger&&"\n background-color: ".concat((e.theme.progress||l.Z.progress).positive,";\n ")}),(function(e){return e.progress&&"\n width: ".concat(e.progress,"%;\n ")}),(function(e){return e.danger&&"\n background-color: ".concat((e.theme.progress||l.Z.progress).negative,";\n ")}),(function(e){return e.animateProgress&&"\n animation: animate-progress ".concat(e.animateProgress.duration,"ms linear forwards;\n\n @keyframes animate-progress {\n 0% {\n width: ").concat(e.animateProgress.start,"%;\n }\n\n 100% {\n width: ").concat(e.animateProgress.end,"%;\n }\n }\n ")}));n.Z=function(e){var n=(0,r.Z)({},e);return(0,a.jsx)(f,d(d({},n),{},{children:(0,a.jsx)(p,d({},n))}))}},87323:function(e,n,t){t.d(n,{cU:function(){return l}});var o=t(82684),r=t(24224);function i(e,n){return function(e,n,t){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{includeAllNodes:!1},i=(0,r.HK)(t,(function(e){return e.uuid})),l=(o||{}).includeAllNodes,u=[];function c(t){if(t){var o=(t[n]||[]).reduce((function(n,t){return e.uuid===t?n:n.concat(i[t])}),[]);(0===o.length||l&&e.uuid!==t.uuid)&&u.push(t),o.forEach((function(e){c(e)}))}}return c(e),u}(e,"upstream_blocks",n,{includeAllNodes:!0})}function l(e,n){return(0,o.useMemo)((function(){return e.map((function(t){var o=function(e,n){var t=i(e,n),o=t.filter((function(n){var t=n.configuration,o=n.uuid;return(null===t||void 0===t?void 0:t.dynamic)&&o!==(null===e||void 0===e?void 0:e.uuid)})),r=t.filter((function(n){var t=n.configuration,o=n.uuid;return(null===t||void 0===t?void 0:t.reduce_output)&&o!==(null===e||void 0===e?void 0:e.uuid)}));return{dynamicUpstreamBlock:o[0],dynamicUpstreamBlocks:o,reduceOutputUpstreamBlock:r[0],reduceOutputUpstreamBlocks:r}}(t,n),r=o.dynamicUpstreamBlock,l=o.dynamicUpstreamBlocks,u=o.reduceOutputUpstreamBlock,c=o.reduceOutputUpstreamBlocks,a=(t||{}).configuration||{},s=a.dynamic,d=a.reduce_output;return{block:t,blocksToUse:e,dynamic:!!s,dynamicUpstreamBlock:r,dynamicUpstreamBlocks:l,reduceOutput:!!d,reduceOutputUpstreamBlock:u,reduceOutputUpstreamBlocks:c}}))}),[n,null===n||void 0===n?void 0:n.map((function(e){var n=e.configuration;return null===n||void 0===n?void 0:n.dynamic})),null===n||void 0===n?void 0:n.map((function(e){var n=e.configuration;return null===n||void 0===n?void 0:n.reduce_output})),null===n||void 0===n?void 0:n.map((function(e){return e.upstream_blocks}))])}},35033:function(e,n,t){t.d(n,{Gr:function(){return r},Lz:function(){return o},Vc:function(){return l},gr:function(){return i}});var o=/\[__internal_output__\]/,r=/\[__internal_test__\]/,i="[__internal_output__]",l="[__internal_test__]"},54405:function(e,n,t){var o;t.d(n,{V5:function(){return i}}),function(e){e.ANDROID="Android",e.CHROME_OS="ChromeOS",e.IOS="iOS",e.LINUX="Linux",e.MAC="macOS",e.WINDOWS="Windows"}(o||(o={}));var r=o;function i(){return function(){var e,n,t,o,i,l,u,c=r.MAC,a=null===(e=window)||void 0===e||null===(n=e.navigator)||void 0===n?void 0:n.userAgent,s=(null===(t=window)||void 0===t||null===(o=t.navigator)||void 0===o||null===(i=o.userAgentData)||void 0===i?void 0:i.platform)||(null===(l=window)||void 0===l||null===(u=l.navigator)||void 0===u?void 0:u.platform);return s?["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(s)?c=r.MAC:["Win32","Win64","Windows","WinCE"].includes(s)?c=r.WINDOWS:["iPhone","iPad","iPod"].includes(s)&&(c=r.IOS):a&&(a.includes("Macintosh")?c=r.MAC:a.includes("Windows")?c=r.WINDOWS:a.includes("Linux")&&a.includes("X11")?c=r.LINUX:/(iPhone|iPad)/.test(a)?c=r.IOS:a.includes("Android")&&a.includes("Mobi")?c=r.ANDROID:a.includes("CrOS")&&(c=r.CHROME_OS)),c}()===r.MAC}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2485],{27337:function(e,n,t){t.d(n,{qy:function(){return x},hS:function(){return C},dP:function(){return j},n9:function(){return v},A2:function(){return m}});var i=t(82394),u=t(26304),l=t(28598);var r=function(e){var n=e.fill,t=void 0===n?"white":n,i=e.size;return(0,l.jsxs)("svg",{fill:"none",height:i,viewBox:"0 0 20 20",width:i,xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsxs)("g",{clipPath:"url(#clip0_11802_82850)",children:[(0,l.jsx)("path",{d:"M15.6276 1.73378C15.97 1.96689 16.022 2.44136 15.7638 2.76532C15.5057 3.08929 15.0355 3.13958 14.69 2.91102C13.3636 2.0334 11.8126 1.54269 10.2126 1.50266C8.36175 1.45636 6.54643 2.01561 5.04253 3.09541C3.53863 4.1752 2.4284 5.71649 1.8806 7.48498C1.40702 9.01387 1.37618 10.6403 1.7837 12.1777C1.88982 12.5781 1.69185 13.0076 1.30237 13.1486C0.912892 13.2896 0.479935 13.0887 0.368517 12.6897C-0.147093 10.8435 -0.122519 8.88224 0.447763 7.04116C1.09223 4.96057 2.39838 3.14729 4.16768 1.87695C5.93697 0.606601 8.07265 -0.0513415 10.2501 0.00312922C12.1769 0.0513296 14.0431 0.655033 15.6276 1.73378Z",fill:t}),(0,l.jsx)("path",{d:"M13.2714 5.89383C13.5295 5.56986 13.4781 5.09341 13.1245 4.87771C12.2306 4.33247 11.2055 4.02828 10.15 4.00188C8.84359 3.9692 7.56218 4.36396 6.50061 5.12617C5.43903 5.88838 4.65534 6.97634 4.26866 8.22469C3.95628 9.23316 3.91679 10.3017 4.14767 11.323C4.23901 11.727 4.67403 11.928 5.06351 11.787C5.45299 11.6461 5.64766 11.216 5.57323 10.8086C5.44361 10.0989 5.48588 9.36461 5.70149 8.66852C5.9915 7.73226 6.57927 6.91628 7.37545 6.34463C8.17164 5.77297 9.13269 5.4769 10.1125 5.50141C10.841 5.51963 11.5503 5.71432 12.1813 6.06401C12.5436 6.26478 13.0133 6.2178 13.2714 5.89383Z",fill:t}),(0,l.jsx)("path",{clipRule:"evenodd",d:"M10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5ZM9 10C9 10.5523 9.44772 11 10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10Z",fill:t,fillRule:"evenodd"}),(0,l.jsx)("path",{d:"M6.87554 15.1223C6.52192 14.9066 6.47052 14.4301 6.72863 14.1062C6.98673 13.7822 7.45642 13.7352 7.81872 13.936C8.44971 14.2857 9.15897 14.4804 9.88746 14.4986C10.8673 14.5231 11.8284 14.227 12.6245 13.6554C13.4207 13.0837 14.0085 12.2677 14.2985 11.3315C14.5141 10.6354 14.5564 9.90111 14.4268 9.19144C14.3523 8.78397 14.547 8.35395 14.9365 8.21295C15.326 8.07196 15.761 8.27297 15.8523 8.67699C16.0832 9.69826 16.0437 10.7668 15.7313 11.7753C15.3447 13.0237 14.561 14.1116 13.4994 14.8738C12.4378 15.636 11.1564 16.0308 9.84995 15.9981C8.79455 15.9717 7.76942 15.6675 6.87554 15.1223Z",fill:t}),(0,l.jsx)("path",{d:"M4.23615 17.2347C3.97805 17.5586 4.03001 18.0331 4.37241 18.2662C5.95691 19.345 7.82314 19.9487 9.74992 19.9969C11.9274 20.0513 14.063 19.3934 15.8323 18.1231C17.6016 16.8527 18.9078 15.0394 19.5522 12.9588C20.1225 11.1178 20.1471 9.15647 19.6315 7.31026C19.5201 6.91131 19.0871 6.7104 18.6976 6.85139C18.3082 6.99238 18.1102 7.42188 18.2163 7.82227C18.6238 9.35971 18.593 10.9861 18.1194 12.515C17.5716 14.2835 16.4614 15.8248 14.9575 16.9046C13.4536 17.9844 11.6382 18.5436 9.78743 18.4973C8.18738 18.4573 6.63645 17.9666 5.30996 17.089C4.96451 16.8604 4.49426 16.9107 4.23615 17.2347Z",fill:t})]}),(0,l.jsx)("defs",{children:(0,l.jsx)("clipPath",{id:"clip0_11802_82850",children:(0,l.jsx)("rect",{fill:t,height:i,width:i})})})]})},o=t(86422),c=t(10503),d=t(98781),s=t(44162),a=["uuid"],p=["uuid"];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 f(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?h(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var v={uuid:"Blocks"},m={uuid:"Pipelines"},j=[v,m],x=[{Icon:c.zQ,uuid:"All templates"}].concat([{Icon:c.rH,uuid:o.tf.DATA_LOADER},{Icon:c.Sv,uuid:o.tf.TRANSFORMER},{Icon:c.zS,selectedIconProps:{inverted:!0},uuid:o.tf.DATA_EXPORTER},{Icon:c.LM,uuid:o.tf.SENSOR},{Icon:c.VS,selectedIconProps:{inverted:!0},uuid:o.tf.CUSTOM},{Icon:c.GQ,uuid:o.tf.CHART},{Icon:c.AQ,selectedIconProps:{inverted:!0},uuid:o.tf.CALLBACK},{Icon:c.hW,selectedIconProps:{inverted:!0},uuid:o.tf.CONDITIONAL},{Icon:c.Bf,uuid:o.tf.EXTENSION},{Icon:c.xE,selectedBackgroundColor:null,uuid:o.tf.DBT},{Icon:c.$B,selectedIconProps:{inverted:!0},uuid:o.tf.MARKDOWN}].map((function(e){var n=e.uuid,t=(0,u.Z)(e,a);return f({filterTemplates:function(e){return null===e||void 0===e?void 0:e.filter((function(e){return e.block_type===n}))},label:function(){return o.V4[n]},selectedBackgroundColor:function(e){return(0,s.qn)(n,{theme:e}).accent},uuid:n},t)})));console.log(r);var C=[{Icon:c.zQ,uuid:"All templates"}].concat([{Icon:c.X5,uuid:d.qL.PYTHON},{Icon:c.ZG,uuid:d.qL.INTEGRATION},{Icon:r,uuid:d.qL.STREAMING}].map((function(e){var n=e.uuid,t=(0,u.Z)(e,p);return f({filterTemplates:function(e){return null===e||void 0===e?void 0:e.filter((function(e){var t;return(null===e||void 0===e||null===(t=e.pipeline)||void 0===t?void 0:t.type)===n}))},label:function(){return d.G7[n]},uuid:n},t)})))},2485:function(e,n,t){var i=t(21831),u=t(82394),l=t(82684),r=t(38626),o=t(34376),c=t(28413),d=t(60328),s=t(32316),a=t(18908),p=t(67971),h=t(49666),f=t(86673),v=t(54283),m=t(55264),j=t(62749),x=t(19711),C=t(82531),b=t(10503),g=t(38639),y=t(27337),Z=t(33766),I=t(24141),O=t(28598);function P(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 w(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?P(Object(t),!0).forEach((function(n){(0,u.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):P(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n,t=e.contained,u=e.defaultLinkUUID,P=e.defaultTab,k=e.objectType,T=e.onClickCustomTemplate,A=e.pipelineUUID,_=e.showAddingNewTemplates,M=e.showBreadcrumbs,S=e.tabs,R=(0,o.useRouter)(),N=(0,l.useContext)(r.ThemeContext),D=(0,I.i)(),E=D.height,U=D.width,q=(0,l.useMemo)((function(){return S||y.dP}),[S]),B=(0,l.useState)(_||!1),L=B[0],z=B[1],F=(0,l.useState)(u?y.qy.find((function(e){return e.uuid===u})):y.qy[0]),G=F[0],H=F[1],Q=(0,l.useState)(P?q.find((function(e){return e.uuid===(null===P||void 0===P?void 0:P.uuid)})):q[0]),X=Q[0],W=Q[1],Y=(0,l.useState)(null),K=Y[0],V=Y[1],$=C.ZP.custom_templates.list({object_type:a.Z},{},{pauseFetch:y.n9.uuid!==(null===X||void 0===X?void 0:X.uuid)}),J=$.data,ee=$.mutate,ne=(0,l.useMemo)((function(){var e=(null===J||void 0===J?void 0:J.custom_templates)||[];return null!==G&&void 0!==G&&G.filterTemplates?null===G||void 0===G?void 0:G.filterTemplates(e):e}),[J,G]),te=C.ZP.custom_templates.list({object_type:a.R},{},{pauseFetch:y.A2.uuid!==(null===X||void 0===X?void 0:X.uuid)}),ie=te.data,ue=te.mutate,le=(0,l.useMemo)((function(){var e=(null===ie||void 0===ie?void 0:ie.custom_templates)||[];return null!==G&&void 0!==G&&G.filterTemplates?null===G||void 0===G?void 0:G.filterTemplates(e):e}),[ie,G]),re=(0,l.useMemo)((function(){return y.qy.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,u=e.selectedIconProps,l=e.uuid,r=(null===G||void 0===G?void 0:G.uuid)===l,o=w({size:g.ZG},r&&u?u:{});return(0,O.jsx)(g.wj,{onClick:function(){return H(e)},selected:r,children:(0,O.jsxs)(p.Z,{alignItems:"center",children:[(0,O.jsx)(g.ze,{backgroundColor:r&&i?i(N):null,children:n?(0,O.jsx)(n,w({},o)):(0,O.jsx)(b.pd,w({},o))}),(0,O.jsx)(x.ZP,{bold:!0,large:!0,children:t?t():l})]})},l)}))}),[G,N]),oe=(0,l.useMemo)((function(){return y.hS.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,u=e.selectedIconProps,l=e.uuid,r=(null===G||void 0===G?void 0:G.uuid)===l,o=w({size:g.ZG},r&&u?u:{});return(0,O.jsx)(g.wj,{onClick:function(){return H(e)},selected:r,children:(0,O.jsxs)(p.Z,{alignItems:"center",children:[(0,O.jsx)(g.ze,{backgroundColor:r&&i?i(N):null,children:n?(0,O.jsx)(n,w({},o)):(0,O.jsx)(b.pd,w({},o))}),(0,O.jsx)(x.ZP,{bold:!0,large:!0,children:t?t():l})]})},l)}))}),[G,N]),ce=(0,l.useMemo)((function(){return null===ne||void 0===ne?void 0:ne.map((function(e){var n=e.description,t=e.name,u=e.tags,l=e.template_uuid,r=e.user,o=[];return null!==u&&void 0!==u&&u.length?o.push.apply(o,(0,i.Z)(u)):null!==r&&void 0!==r&&r.username&&o.push(null===r||void 0===r?void 0:r.username),(0,O.jsxs)(g.UE,{onClick:function(){T?T(e):R.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(l)))},children:[(0,O.jsx)(g.Tj,{children:(0,O.jsx)(x.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||l})}),(0,O.jsx)(g.SL,{children:(0,O.jsx)(x.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,O.jsx)(g.EN,{children:(null===o||void 0===o?void 0:o.length)>=1&&(0,O.jsx)(m.Z,{tags:null===o||void 0===o?void 0:o.map((function(e){return{uuid:e}}))})})]},l)}))}),[ne,T,R]),de=(0,l.useMemo)((function(){return null===le||void 0===le?void 0:le.map((function(e){var n=e.description,t=e.name,u=e.tags,l=e.template_uuid,r=e.user,o=[];return null!==u&&void 0!==u&&u.length?o.push.apply(o,(0,i.Z)(u)):null!==r&&void 0!==r&&r.username&&o.push(null===r||void 0===r?void 0:r.username),(0,O.jsxs)(g.UE,{onClick:function(){T?T(e):R.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(l),"?object_type=").concat(a.R))},children:[(0,O.jsx)(g.Tj,{children:(0,O.jsx)(x.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||l})}),(0,O.jsx)(g.SL,{children:(0,O.jsx)(x.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,O.jsx)(g.EN,{children:(null===o||void 0===o?void 0:o.length)>=1&&(0,O.jsx)(m.Z,{tags:null===o||void 0===o?void 0:o.map((function(e){return{uuid:e}}))})})]},l)}))}),[le,T,R]),se=(0,l.useMemo)((function(){if(!M)return null;var e=[];return L?e.push.apply(e,[{label:function(){return"Templates"},onClick:function(){z(!1)}},{bold:!0,label:function(){return"New custom template"}}]):e.push({label:function(){return"Templates"}}),(0,O.jsx)(g.FX,{children:(0,O.jsx)(c.Z,{breadcrumbs:e})})}),[L,M]),ae=(0,l.useMemo)((function(){return M?36:0}),[M]),pe=(0,l.useMemo)((function(){return E-ae}),[E,ae]);if(L)return n=a.R===k&&A?(0,O.jsx)(h.Z,{onMutateSuccess:ue,pipelineUUID:A,templateAttributes:G&&(null===G||void 0===G?void 0:G.uuid)!==(null===y.qy||void 0===y.qy?void 0:y.qy[0].uuid)?{pipeline_type:null===G||void 0===G?void 0:G.uuid}:null,templateUUID:null===K||void 0===K?void 0:K.template_uuid}):(0,O.jsx)(j.Z,{contained:t,heightOffset:ae,onCreateCustomTemplate:t?function(e){V(e)}:null,onMutateSuccess:ee,templateAttributes:G&&(null===G||void 0===G?void 0:G.uuid)!==(null===y.qy||void 0===y.qy?void 0:y.qy[0].uuid)?{block_type:null===G||void 0===G?void 0:G.uuid}:null,templateUUID:null===K||void 0===K?void 0:K.template_uuid}),t?(0,O.jsxs)(O.Fragment,{children:[M&&se,(0,O.jsx)(g.Rd,{height:pe,width:U,children:n})]}):n;var he=(0,O.jsxs)(g.Nk,{children:[(0,O.jsxs)(g.bC,{height:t?pe:null,children:[(0,O.jsx)(g.Yf,{children:(0,O.jsx)(s.Z,{noPadding:!0,onClickTab:function(e){t?W(e):(0,Z.u7)({object_type:y.A2.uuid===e.uuid?a.R:a.Z})},selectedTabUUID:null===X||void 0===X?void 0:X.uuid,tabs:q})}),(0,O.jsxs)(g.wl,{contained:t,heightOffset:ae,children:[y.n9.uuid===(null===X||void 0===X?void 0:X.uuid)&&re,y.A2.uuid===(null===X||void 0===X?void 0:X.uuid)&&oe]})]}),(0,O.jsxs)(g.w5,{children:[y.n9.uuid===(null===X||void 0===X?void 0:X.uuid)&&(0,O.jsx)(g.HS,{children:(0,O.jsx)(d.Z,{beforeIcon:(0,O.jsx)(b.mm,{size:g.ZG}),onClick:function(){z(!0)},primary:!0,children:"New block template"})}),y.n9.uuid===(null===X||void 0===X?void 0:X.uuid)&&(0,O.jsxs)(O.Fragment,{children:[!J&&(0,O.jsx)(f.Z,{p:2,children:(0,O.jsx)(v.Z,{inverted:!0})}),J&&!(null!==ce&&void 0!==ce&&ce.length)&&(0,O.jsxs)(f.Z,{p:2,children:[(0,O.jsx)(x.ZP,{children:"There are currently no templates matching your search."}),(0,O.jsx)("br",{}),(0,O.jsx)(x.ZP,{children:"Add a new template by clicking the button above."})]}),(null===ce||void 0===ce?void 0:ce.length)>=1&&(0,O.jsx)(g.n8,{children:ce})]}),y.A2.uuid===(null===X||void 0===X?void 0:X.uuid)&&(0,O.jsxs)(O.Fragment,{children:[!ie&&(0,O.jsx)(f.Z,{p:2,children:(0,O.jsx)(v.Z,{inverted:!0})}),ie&&!(null!==de&&void 0!==de&&de.length)&&(0,O.jsxs)(f.Z,{p:2,children:[(0,O.jsx)(x.ZP,{children:"There are currently no templates matching your search."}),(0,O.jsx)("br",{}),(0,O.jsx)(x.ZP,{children:"Add a new template by clicking the button above."})]}),(null===de||void 0===de?void 0:de.length)>=1&&(0,O.jsx)(g.n8,{children:de})]})]})]});return t?(0,O.jsxs)(O.Fragment,{children:[M&&se,(0,O.jsx)(g.Rd,{height:pe,width:U,children:he})]}):he}},55264:function(e,n,t){var i=t(82684),u=t(79891),l=t(67971),r=t(19711),o=t(24224),c=t(28598);n.Z=function(e){var n=e.onClickTag,t=e.tags,d=void 0===t?[]:t,s=(0,i.useMemo)((function(){return(null===d||void 0===d?void 0:d.length)||0}),[d]),a=(0,i.useMemo)((function(){return(0,o.YC)(d||[],"uuid")}),[d]);return(0,c.jsx)(l.Z,{alignItems:"center",flexWrap:"wrap",children:null===a||void 0===a?void 0:a.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)(u.Z,{onClick:n?function(){return n(t)}:null,small:!0,children:(0,c.jsx)(r.ZP,{children:t.uuid})})},"tag-".concat(t.uuid))),e}),[])})}},79891:function(e,n,t){var i=t(38626),u=t(60328),l=t(67971),r=t(86673),o=t(19711),c=t(23831),d=t(10503),s=t(49125),a=t(31012),p=t(28598),h=i.default.div.withConfig({displayName:"Chip__ChipStyle",componentId:"sc-1ok73g-0"})(["display:inline-block;"," "," "," "," ",""],(function(e){return!e.primary&&"\n background-color: ".concat((e.theme.background||c.Z.background).tag,";\n ")}),(function(e){return e.primary&&"\n background-color: ".concat((e.theme.chart||c.Z.chart).primary,";\n ")}),(function(e){return!e.small&&"\n border-radius: ".concat((s.iI+a.Al)/2,"px;\n height: ").concat(1.5*s.iI+a.Al,"px;\n padding: ").concat(s.iI/1.5,"px ").concat(1.25*s.iI,"px;\n ")}),(function(e){return e.small&&"\n border-radius: ".concat((s.iI/2+a.Al)/2,"px;\n height: ").concat(a.Al+s.iI/2+2,"px;\n padding: ").concat(s.iI/4,"px ").concat(s.iI,"px;\n ")}),(function(e){return e.border&&"\n border: 1px solid ".concat((e.theme.content||c.Z.content).muted,";\n ")}));n.Z=function(e){var n=e.border,t=e.children,i=e.disabled,c=e.label,a=e.onClick,f=e.primary,v=e.small;return(0,p.jsx)(h,{border:n,primary:f,small:v,children:(0,p.jsx)(u.Z,{basic:!0,disabled:i,noBackground:!0,noPadding:!0,onClick:a,transparent:!0,children:(0,p.jsxs)(l.Z,{alignItems:"center",children:[t,c&&(0,p.jsx)(o.ZP,{small:v,children:c}),!i&&a&&(0,p.jsx)(r.Z,{ml:1,children:(0,p.jsx)(d.x8,{default:f,muted:!f,size:v?s.iI:1.25*s.iI})})]})})})}}}]);
|