mage-ai 0.9.8__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/db/__init__.py +25 -0
- 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/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.8.dist-info → mage_ai-0.9.9.dist-info}/METADATA +9 -7
- {mage_ai-0.9.8.dist-info → mage_ai-0.9.9.dist-info}/RECORD +142 -129
- mage_ai/server/frontend_dist/_next/static/RcIgkp9pBXE1Rb4tOGR1L/_buildManifest.js +0 -1
- 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-0df5a20d6f1aa606.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/{RcIgkp9pBXE1Rb4tOGR1L → OwvTROmputQCA1Z9HEGDv}/_middlewareManifest.js +0 -0
- /mage_ai/server/frontend_dist/_next/static/{RcIgkp9pBXE1Rb4tOGR1L → OwvTROmputQCA1Z9HEGDv}/_ssgManifest.js +0 -0
- {mage_ai-0.9.8.dist-info → mage_ai-0.9.9.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.8.dist-info → mage_ai-0.9.9.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.8.dist-info → mage_ai-0.9.9.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.8.dist-info → mage_ai-0.9.9.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1484],{67429:function(e,n,t){var o=t(82394),r=t(21831),i=t(82684),c=t(16115),u=t(41150),l=t(28598);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.highlightedItemIndexInitial,t=void 0===n?null:n,o=e.itemGroups,a=e.noResultGroups,d=e.onHighlightItemIndexChange,f=e.onMouseEnterItem,p=e.onMouseLeaveItem,m=e.onSelectItem,h=e.renderEmptyState,v=e.searchQuery,b=e.selectedItem,g=e.setItemRefs,x=e.uuid,j=(0,i.useState)(!0),C=j[0],_=j[1],Z=(0,i.useMemo)((function(){var e=[],n=o.reduce((function(n,t){var o=t.items.filter((function(e){return!v||function(e,n){return e.searchQueries.filter((function(e){return String(e).toLowerCase().includes(n.toLowerCase())})).length>=1}(e,v)}));return 0===o.length?n:(e.push.apply(e,(0,r.Z)(o)),n.concat(s(s({},t),{},{items:o})))}),[]);return{itemGroups:n,itemsFlattened:e}}),[o,v]),O=Z.itemGroups,k=Z.itemsFlattened;a&&0===k.length&&(O.push.apply(O,(0,r.Z)(a)),k.push.apply(k,(0,r.Z)(a.reduce((function(e,n){var t=n.items;return e.concat(t)}),[]))));var y=(0,i.useRef)(null);y.current=k.map((function(){return(0,i.createRef)()}));var E=(0,i.useState)(t),T=E[0],I=E[1],S=(0,i.useCallback)((function(e){null===d||void 0===d||d(e),I(e)}),[d,I]),R=k[T],A=(0,u.y)(),w=A.registerOnKeyDown,P=A.unregisterOnKeyDown;(0,i.useEffect)((function(){return function(){return P(x)}}),[P,x]),null===w||void 0===w||w(x,(function(e,n,t){var o,r=!0,i=k.length,u=k.findIndex((function(e,o){var r=e.keyboardShortcutValidation;return null===r||void 0===r?void 0:r({keyHistory:t,keyMapping:n},o)})),l=n[c.Gs]&&!n[c.XR]&&!b;return-1!==u?(e.preventDefault(),m(k[u]),_(r),S(u)):(n[c.Uq]||l)&&k[T]?(l&&e.preventDefault(),m(k[T]),_(r),S(T)):(n[c.Bu]?(r=!1,o=null===T?i-1:T-1):n[c.kD]?(r=!1,o=null===T?0:T+1):n[c.vP]&&S(null),"undefined"!==typeof o&&(o>=i?o=0:o<=-1&&(o=i-1),o>=0&&o<=i-1?(S(o),e.preventDefault()):S(null)),void _(r))}),[T,k,b,S,_]),(0,i.useEffect)((function(){null===g||void 0===g||g(y)}),[y,k,g]),(0,i.useEffect)((function(){var e=null===T||"undefined"===typeof T||T>=k.length;(null===v||void 0===v?void 0:v.length)>=1&&e&&S(0)}),[T,k,v,S]);var D=(0,i.useCallback)((function(){return _(!0)}),[_]);return(0,i.useEffect)((function(){return window.addEventListener("mousemove",D),function(){window.removeEventListener("mousemove",D)}}),[D]),0===O.length&&h?h():(0,l.jsx)(l.Fragment,{children:O.map((function(e,n){var t=e.items,o=e.renderItem,r=e.renderGroupHeader,i=e.uuid,c=n>=1?O.slice(0,n).reduce((function(e,n){return e+n.items.length}),0):0,u=t.map((function(e,n){var t=e.itemObject,r=e.value,i=r===(null===R||void 0===R?void 0:R.value),u=n+c,a=(null===t||void 0===t?void 0:t.id)||(null===t||void 0===t?void 0:t.uuid);return(0,l.jsx)("div",{id:"item-".concat(r,"-").concat(a),onMouseMove:function(){return C&&S(u)},ref:y.current[u],children:o(e,{highlighted:i,onClick:function(){return m(e)},onMouseEnter:function(){return null===f||void 0===f?void 0:f(e)},onMouseLeave:function(){return null===p||void 0===p?void 0:p(e)}},n,u)},"item-".concat(r,"-").concat(a))}));return u.length>=1&&(0,l.jsxs)("div",{children:[null===r||void 0===r?void 0:r(),u]},i||"group-uuid-".concat(n))}))})}},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,c,u,l,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=(l={},(0,s.Z)(l,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)(l,d.oV.HISTOGRAM,(0,s.Z)({},d.a3,(function(){return"must be a list of integers or floats."}))),(0,s.Z)(l,d.oV.LINE_CHART,(c={},(0,s.Z)(c,d.a3,(function(){return"must be a list of integers or floats."})),(0,s.Z)(c,d.rj,(function(){return"must be a list of lists containing integers or floats. Each list is a single line in the chart."})),c)),(0,s.Z)(l,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)(l,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)),l),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 m},Nk:function(){return a},T5:function(){return s},_A:function(){return f},a3:function(){return p},wx:function(){return d}});var o=t(38626),r=t(23831),i=t(44162),c=t(73942),u=t(49125),l=t(19711),a=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;"," "," ",""],i.Kf,(function(e){return e.addBottomPadding&&"\n padding-bottom: ".concat(2*u.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(c.n_,"px;\n border-bottom-right-radius: ").concat(c.n_,"px;\n border-bottom-style: solid;\n border-bottom-width: 2px;\n ")})),s=o.default.div.withConfig({displayName:"indexstyle__OutputRowStyle",componentId:"sc-n38rkq-1"})([""," "," ",""],(function(e){return e.first&&"\n padding-top: ".concat(u.iI*u.cd,"px;\n ")}),(function(e){return e.last&&"\n padding-bottom: ".concat(u.iI*u.cd,"px;\n ")}),(function(e){return e.contained&&"\n padding-left: ".concat(i.oh,"px;\n padding-right: ").concat(u.iI*u.cd,"px;\n ")})),d=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{","}"],l.IH,i.Kf,(function(e){return"\n color: ".concat((e.theme.interactive||r.Z.interactive).linkPrimary,";\n ")})),f=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;",""],i.Kf,(function(e){return"\n background-color: ".concat((e.theme.borders||r.Z.borders).light,";\n border-bottom-left-radius: ").concat(c.n_,"px;\n border-bottom-right-radius: ").concat(c.n_,"px;\n ")})),p=o.default.div.withConfig({displayName:"indexstyle__ExtraInfoContentStyle",componentId:"sc-n38rkq-4"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;"],u.iI,i.oh,u.iI*u.cd,u.iI),m=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),c=t(82684),u=t(89565),l=t.n(u),a=t(62302),s=t(83455),d=t(35490),f=t(86422),p=t(60328),m=t(16634),h=t(57722),v=t(62976),b=t(48952),g=t(34744),x=t(93461),j=t(67971),C=t(82635),_=t(98781),Z=t(66176),O=t(86673),k=t(19711),y=t(46261),E=t(82531),T=t(66166),I=t(22341),S=t(22782),R=t(73828),A=t(35033),w=t(49125),P=t(94353),D=t(37391),M=t(93005),N=t(60701),B=t(43482),L=t(90211),U=t(96510),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 G(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}var Q={appearAbove:!0,appearBefore:!0,block:!0,size:null,widthFitContent:!0},z={basic:!0,iconOnly:!0,noPadding:!0,transparent:!0};n.Z=function(e){var n=e.block,t=e.blockMetadata,r=e.buttonTabs,u=e.collapsed,H=e.contained,W=void 0===H||H,q=e.dynamicBlock,K=e.dynamicChildBlock,V=e.hasError,Y=e.hasOutput,X=e.hideExtraInfo,J=e.isInProgress,$=e.mainContainerWidth,ee=e.messages,ne=e.openSidekickView,te=e.pipeline,oe=e.runCount,re=e.runEndTime,ie=e.runStartTime,ce=e.selected,ue=e.selectedTab,le=e.setCollapsed,ae=e.setErrors,se=e.setOutputBlocks,de=e.setSelectedOutputBlock,fe=e.setSelectedTab,pe=n||{},me=pe.status,he=pe.type,ve=pe.uuid,be=(0,c.useMemo)((function(){return(null===ee||void 0===ee?void 0:ee.length)||0}),[ee]),ge=f.DA.EXECUTED===me||!J&&0===oe&&be>=1||!J&&oe>=1&&re>=ie,xe=(0,c.useState)(),je=xe[0],Ce=xe[1],_e=(0,c.useState)(),Ze=_e[0],Oe=_e[1],ke=(0,c.useState)(null),ye=ke[0],Ee=ke[1],Te=(0,c.useMemo)((function(){var e,n;return null===(e=new d.Z)||void 0===e||null===(n=e.decodedToken)||void 0===n?void 0:n.token}),[]),Ie=(0,s.Db)((function(){return E.ZP.block_outputs.pipelines.downloads.detailAsync(null===te||void 0===te?void 0:te.uuid,ve,{token:Te},{onDownloadProgress:function(e){return Ee((Number((null===e||void 0===e?void 0:e.loaded)||0)/1e6).toFixed(3))},responseType:P.E.BLOB})}),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(e){(0,B.uS)(e,"".concat(ve,".").concat(R.Lu.CSV))},onErrorCallback:function(e,n){return null===ae||void 0===ae?void 0:ae({errors:n,response:e})}})}}),Se=(0,i.Z)(Ie,2),Re=Se[0],Ae=Se[1].isLoading;(0,c.useEffect)((function(){J||Oe(100)}),[J]);var we=function(e){return Array.isArray(e)?e.join("\n"):e},Pe=(0,c.useMemo)((function(){return ee.reduce((function(e,n){var t=e.at(-1);if(C.jU.includes(null===t||void 0===t?void 0:t.type)&&(null===t||void 0===t?void 0:t.type)===n.type&&!we(null===n||void 0===n?void 0:n.data).match(A.Lz)){if(Array.isArray(t.data))t.data.concat(n.data);else if("string"===typeof t.data){var o=we(n.data)||"";t.data=[t.data,o].join("\n")}}else C.jU.includes(null===n||void 0===n?void 0:n.type)&&!we(null===n||void 0===n?void 0:n.data).match(A.Lz)?e.push(G(G({},n),{},{data:we(n.data)})):e.push(G({},n));return e}),[])}),[ee]),De=(0,c.useMemo)((function(){return(0,F.jsx)(Z.Z,{progress:Ze})}),[Ze]),Me=f.tf.DBT===(null===n||void 0===n?void 0:n.type),Ne=(0,T.Z)(V);(0,c.useEffect)((function(){Me&&!Ne&&V&&fe(M.Rj)}),[V,Ne,Me,fe]);var Be=(0,c.useMemo)((function(){var e=function(e,n){var t=e.columns,o=e.index,r=e.rows,i=e.shape,c=n.borderTop,u=n.selected;return i&&Ce(i),r.length>=1&&(0,F.jsx)(v.Z,{columns:t,disableScrolling:!u,index:o,maxHeight:60*w.iI,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!c,rows:r,width:$-(2+w.cd*w.iI*2+2+D.nn)},"data-table-".concat(o))},n=[],t=[],r=[];return null===Pe||void 0===Pe||Pe.forEach((function(i,c){var u=i.data,s=i.type;if(u&&0!==(null===u||void 0===u?void 0:u.length)){var d=[];d=(d=Array.isArray(u)?u:[u]).filter((function(e){return e}));var f=[];d.forEach((function(e){if(s===C.Gi.TEXT_HTML)f.push(e);else if(e&&"string"===typeof e){var n=e.split("\n");f.push.apply(f,(0,o.Z)(n))}else"object"===typeof f&&f.push(e)}));var p=f.length,m=[];f.forEach((function(n,o){var i,u={contained:W,first:0===c&&0===o,last:c===Pe.length-1&&o===p-1},d=c>=1;if("string"===typeof n&&n.match(A.Gr)){var f=n.split("\n"),h=[];f.forEach((function(e){if(e.match(A.Gr)){var t=e.split(A.Vc),o=t[t.length-1];(0,L.Pb)(o)&&r.push(JSON.parse(o))}else h.push(e);n=h.length>=1?h.join("\n"):null}))}if(null!==n){if("string"===typeof n&&n.match(A.Lz)){var v=n.split(A.gr),b=v[v.length-1],g=b.split("FloatProgress");if(v.length>=2&&(b=g[0]),(0,L.Pb)(b)){var x=JSON.parse(b),j=x.data,_=x.type;if(C.Gi.TABLE===_){!0;var Z=e(j,{borderTop:d,selected:ce});t.push(Z),Me||(i=Z)}}}else if(s===C.Gi.TABLE){!0;var O=e((0,L.Pb)(n)?JSON.parse(n):n,{borderTop:d,selected:ce});t.push(O),Me||(i=O)}else if(C.jU.includes(s)){var y,E=null===(y=n)||void 0===y?void 0:y.split("\\n");i=(0,F.jsx)(S.T5,G(G({},u),{},{children:E.map((function(e){return(0,F.jsx)(k.ZP,{monospace:!0,preWrap:!0,children:(0,F.jsx)(l(),{children:e})},e)}))}))}else if(s===C.Gi.TEXT_HTML)n&&(i=(0,F.jsx)(S.T5,G(G({},u),{},{children:(0,F.jsx)(S.wx,{monospace:!0,children:(0,F.jsx)(a.Z,{html:n})})})));else if(s===C.Gi.IMAGE_PNG)i=(0,F.jsx)("div",{style:{backgroundColor:"white"},children:(0,F.jsx)("img",{alt:"Image ".concat(c," from code output"),src:"data:image/png;base64, ".concat(n)})});else if(s===C.Gi.PROGRESS){var T=parseInt(n);Oe(T>90?90:T)}i&&m.push((0,F.jsx)("div",{children:i},"code-output-".concat(c,"-").concat(o)))}})),m.length>=1&&n.push(m)}})),J&&(null===te||void 0===te?void 0:te.type)===_.qL.PYSPARK&&n.unshift([(0,F.jsx)(S.T5,{contained:!0,children:(0,F.jsx)(O.Z,{mt:1,children:De})},"progress_bar")]),{content:n,tableContent:t,testContent:r}}),[Pe,W,Me,J,$,te,De,ce]),Le=Be.content,Ue=Be.tableContent,Fe=Be.testContent,He=(null===je||void 0===je?void 0:je[1])||0,Ge=He>30?" (30 out of ".concat(He," columns displayed)"):"",Qe=(0,c.useMemo)((function(){var e;if(Me&&ue){var n=ue.uuid;if(M.$m.uuid===n)(null===Ue||void 0===Ue?void 0:Ue.length)>=1?e=Ue:J||(e=(0,F.jsx)(O.Z,{px:2,py:1,children:(0,F.jsx)(k.ZP,{muted:!0,children:V?"Error, check logs.":"No preview to display yet, try running the block."})}));else if(M.Rj.uuid===n)(null===Le||void 0===Le?void 0:Le.length)>=1?e=Le:J||(e=(0,F.jsx)(O.Z,{px:2,py:1,children:(0,F.jsx)(k.ZP,{muted:!0,children:V?"Error, check logs.":"No logs to display yet, try running the block."})}));else if(M.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,F.jsx)(h.Z,{autoHeight:!0,language:R.Lu.SQL,padding:!0,readOnly:!0,value:i,width:"100%"}):null}else if(M.gM.uuid===n){var c,u=null===t||void 0===t||null===(c=t.dbt)||void 0===c?void 0:c.lineage;e=u?(0,F.jsx)(b.Z,{disabled:!0,enablePorts:!1,height:55*w.iI,pannable:ce,pipeline:G(G({},te),{},{blocks:u}),zoomable:ce}):null}}else e=Le;return(0,F.jsxs)(F.Fragment,{children:[r,e]})}),[t,r,Le,V,Me,J,te,ce,ue,Ue]);return r||V||Y?(0,F.jsxs)(F.Fragment,{children:[W&&(0,F.jsxs)(S.Nk,{addBottomPadding:J&&(null===te||void 0===te?void 0:te.type)===_.qL.PYSPARK,blockType:he,dynamicBlock:q,dynamicChildBlock:K,executedAndIdle:ge,hasError:V,selected:ce,children:[!u&&(null===Fe||void 0===Fe?void 0:Fe.length)>=1&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(O.Z,{py:2,children:(0,F.jsx)(S.T5,{contained:!0,children:Fe.map((function(e,n){var t=e.error,o=e.message,r=e.stacktrace;return(0,F.jsxs)(O.Z,{mt:n>=1?3:0,children:[(0,F.jsx)(k.ZP,{monospace:!0,preWrap:!0,children:(0,F.jsx)(l(),{children:"".concat(o).concat(t?" "+t:"")})}),null===r||void 0===r?void 0:r.map((function(e){return(0,F.jsx)(k.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:(0,F.jsx)(l(),{children:e})},e)}))]},o)}))})}),(0,F.jsx)(O.Z,{mb:V?2:0,children:(0,F.jsx)(g.Z,{medium:!0})})]}),!u&&Qe]}),!W&&Qe,ge&&!X&&(0,F.jsxs)(S._A,{blockType:he,dynamicBlock:q,dynamicChildBlock:K,hasError:V,selected:ce,children:[(0,F.jsx)(S.MB,{}),(0,F.jsxs)(j.Z,{justifyContent:"space-between",children:[le&&(0,F.jsx)(x.Z,{alignItems:"center",px:1,children:(0,F.jsx)(p.Z,G(G({},z),{},{onClick:function(){return le(!u)},children:u?(0,F.jsxs)(j.Z,{alignItems:"center",children:[(0,F.jsx)(I._M,{muted:!0,size:2*w.iI}),"\xa0",(0,F.jsx)(k.ZP,{default:!0,children:"Expand output"})]}):(0,F.jsxs)(j.Z,{alignItems:"center",children:[(0,F.jsx)(I.Kh,{muted:!0,size:2*w.iI}),je&&(0,F.jsx)(O.Z,{ml:2,children:(0,F.jsx)(k.ZP,{children:"".concat(je[0]," rows x ").concat(je[1]," columns").concat(Ge)})})]})}))}),(0,F.jsx)(S.a3,{children:(0,F.jsxs)(j.Z,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,F.jsx)(y.Z,G(G({},Q),{},{label:oe>=1&&ie?"Last run at ".concat(new Date(ie.valueOf()).toLocaleString()):V?"Block executed with errors":"Block executed successfully",children:(0,F.jsxs)(j.Z,{alignItems:"center",children:[oe>=1&&Number(re)>Number(ie)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(k.ZP,{small:!0,children:[(Number(re)-Number(ie))/1e3,"s"]}),(0,F.jsx)(O.Z,{mr:1})]}),!V&&(0,F.jsx)(I.Jr,{size:2*w.iI,success:!0}),V&&(0,F.jsx)(m.Z,{danger:!0,size:2*w.iI,children:(0,F.jsx)(k.ZP,{bold:!0,monospace:!0,small:!0,children:"!"})})]})})),!V&&!f.Qj.includes(he)&&(0,F.jsx)(O.Z,{pl:2,children:(0,F.jsxs)(j.Z,{alignItems:"center",children:[(0,F.jsx)(y.Z,G(G({},Q),{},{label:"Expand table",children:(0,F.jsx)(p.Z,G(G({},z),{},{onClick:function(){(0,B.OF)(null===te||void 0===te?void 0:te.uuid,ve),null===ne||void 0===ne||ne(N.cH.DATA),null===se||void 0===se||se((function(e){return e.find((function(e){return e.uuid===ve}))?e:(null===de||void 0===de||de(n),e.concat(n))}))},children:(0,F.jsx)(I.M0,{muted:!0,size:1.75*w.iI})}))})),(0,F.jsx)(O.Z,{pl:2}),(0,F.jsx)(y.Z,G(G({},Q),{},{forceVisible:Ae,label:Ae?"".concat(ye||0,"mb downloaded..."):"Save output as CSV file",children:(0,F.jsx)(p.Z,G(G({},z),{},{compact:!0,loading:Ae,onClick:function(){Ee(null),Re()},children:(0,F.jsx)(I.vc,{muted:!0,size:1.75*w.iI})}))}))]})})]})})]})]})]}):null}},93005:function(e,n,t){t.d(n,{$m:function(){return r},C:function(){return a},Jt:function(){return c},Rj:function(){return i},Xy:function(){return l},gM:function(){return u},vT:function(){return s}});var o=t(49125),r={uuid:"Preview results"},i={uuid:"Logs"},c={uuid:"SQL"},u={uuid:"Lineage"},l=function(e){var n,t,o=e.metadata,l=[i,c];return(null===o||void 0===o||null===(n=o.dbt)||void 0===n||null===(t=n.block)||void 0===t?void 0:t.snapshot)||(l.unshift(r),l.push(u)),l},a=2.5*o.iI,s="CodeBlock_HiddenBlock"},89949:function(e,n,t){t.d(n,{z:function(){return Ke},Z:function(){return Ye}});var o=t(21831),r=t(75582),i=t(82394),c=t(82684),u=t(38626),l=t(10975),a=t(14567),s=t(83455),d=t(28317),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,c.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,c=(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:c,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),C=t(45419),_=t(60701),Z=t(24224);function O(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 k(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?O(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var y=function(e){var n=e.block,t=e.blocks,o=e.openSidekickView,i=e.pipeline,u=(0,c.useMemo)((function(){return(0,Z.HK)(t,(function(e){return e.uuid}))}),[t]),l=(0,c.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,c.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,c.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],c=o[1].blocks;null===c||void 0===c||c.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 c=null===u||void 0===u?void 0:u[r];c&&t.push(k(k({},c),{},{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:C.Q.CONDITIONAL,blockUUID:n})}})]})}),(null===l||void 0===l?void 0:l.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:l,onClick:function(e){var n=e.uuid;return o(_.cH.ADDON_BLOCKS,!0,{addon:C.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),I=t(38341),S=t(16634),R=t(57722),A=t(65051),w=t(62084),P=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,l=e.open,a=e.parentRef,s=e.runBlock,d=e.topOffset,f=(0,c.useMemo)((function(){return P.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},c=D.x8[e],u=(null===c||void 0===c||null===(o=c.configuration)||void 0===o?void 0:o.call(c,i))||{},l=E.t6.SQL===(null===t||void 0===t?void 0:t.language)?null:(null===c||void 0===c||null===(r=c.content)||void 0===r?void 0:r.call(c,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:l}),{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:l,disableReset:!0}):null===s||void 0===s||s({block:t,runDownstream:!0}))}})},uuid:e}}))}),[P.CK,t,s]),p=(0,c.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)(w.Z,{items:m,left:r,onClickCallback:u,open:l,parentRef:a,rightOffset:i,topOffset:d,uuid:"CommandButtons/add_charts",width:25*M.iI})},F=t(47999),H=t(40656),G=u.default.svg.withConfig({displayName:"Convert__SVGStyle",componentId:"sc-fmw0vr-0"})([""]),Q=function(e){var n=e.fill,t=e.opacity,o=e.size,r=void 0===o?H.C:o,i=e.style,c=e.viewBox,u=void 0===c?"0 0 12 12":c;return(0,g.jsxs)(G,{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"})]})})]})},z=t(30264),W=t(79749),q=t(33572),K=t(10919),V=t(29237),Y=t(54283),X=t(46261),J=t(82531),$=t(23831),ee=t(82635),ne=t(22341),te=t(93005),oe=t(16115),re=t(98781),ie=t(75968),ce=t(54405),ue=t(96510);function le(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 ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?le(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):le(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var se,de=function(e){var n,t,o=e.addNewBlock,i=e.addWidget,l=e.block,a=e.blocks,d=e.deleteBlock,f=e.executionState,x=e.fetchFileTree,j=e.fetchPipeline,C=e.hideExtraButtons,O=e.interruptKernel,k=e.isEditingBlock,y=e.openSidekickView,T=e.pipeline,I=e.project,R=e.runBlock,A=e.setIsEditingBlock,P=e.savePipelineContent,D=e.setErrors,N=e.setOutputCollapsed,B=e.showConfigureProjectModal,L=l.all_upstream_blocks_executed,H=void 0===L||L,G=l.color,le=l.metadata,se=l.type,de=l.uuid,fe=(0,c.useRef)(null),pe=(0,c.useRef)(null),me=(0,c.useRef)(null),he=(0,c.useRef)(null),ve=(0,c.useRef)(null),be=null===T||void 0===T?void 0:T.type,ge=(0,c.useState)(!1),xe=ge[0],je=ge[1],Ce=(0,c.useState)(!1),_e=Ce[0],Ze=Ce[1],Oe=(0,c.useState)(!1),ke=Oe[0],ye=Oe[1],Ee=(0,c.useState)(!1),Te=Ee[0],Ie=Ee[1],Se=(0,c.useState)(!1),Re=Se[0],Ae=Se[1],we=(0,c.useContext)(u.ThemeContext),Pe=ee.uF.IDLE!==f,De=(0,b.qn)(se,{blockColor:G,theme:we}).accent,Me=(0,c.useMemo)((function(){return be===re.qL.STREAMING}),[be]),Ne=(0,c.useMemo)((function(){return be===re.qL.INTEGRATION}),[be]),Be=(0,c.useMemo)((function(){return(0,ie.Ts)(l,a,"CommandButtons",o).map((function(e){return ae(ae({},e),{},{onClick:function(){return P().then((function(){return e.onClick()}))}})}))}),[o,l,a,P]),Le=(0,c.useMemo)((function(){return(0,Z.HK)(a,(function(e){return e.uuid}))}),[a]),Ue=(0,c.useMemo)((function(){return E.tf.DBT===(null===l||void 0===l?void 0:l.type)}),[l]),Fe=(0,c.useMemo)((function(){return E.tf.MARKDOWN===(null===l||void 0===l?void 0:l.type)}),[l]),He=(0,s.Db)(J.ZP.pipelines.useUpdate(null===T||void 0===T?void 0:T.uuid),{onSuccess:function(e){return(0,ue.wD)(e,{callback:function(){j()},onErrorCallback:function(e,n){return D({errors:n,response:e})}})}}),Ge=(0,r.Z)(He,2),Qe=Ge[0],ze=Ge[1].isLoading,We=(0,c.useMemo)((function(){var e=!(null!==I&&void 0!==I&&I.openai_api_key),n=function(e){null===B||void 0===B||B({header:(0,g.jsx)(h.Z,{mb:M.HN,children:(0,g.jsxs)(V.Z,{children:[(0,g.jsx)(v.ZP,{warning:!0,children:"You need to add an OpenAI API key to your project before you can generate blocks using AI."}),(0,g.jsx)(h.Z,{mt:1,children:(0,g.jsxs)(v.ZP,{warning:!0,children:["Read ",(0,g.jsx)(K.Z,{href:"https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key",openNewWindow:!0,children:"OpenAI\u2019s documentation"})," to get your API key."]})})]})}),onSaveSuccess:function(n){null!==n&&void 0!==n&&n.openai_api_key&&Qe({pipeline:{llm:e}})}})},t={request:{block_uuid:null===l||void 0===l?void 0:l.uuid,pipeline_uuid:null===T||void 0===T?void 0:T.uuid}};return[{label:function(){return"Document block"},onClick:function(){t.use_case=q.z.GENERATE_DOC_FOR_BLOCK,e?n(t):Qe({pipeline:{llm:t}})},uuid:"Document block"},{label:function(){return"Document pipeline and all blocks"},onClick:function(){t.use_case=q.z.GENERATE_DOC_FOR_PIPELINE,e?n(t):Qe({pipeline:{llm:t}})},uuid:"Document pipeline and all blocks"}]}),[l,T,I,B,Qe]);return(0,g.jsxs)(m.Z,{alignItems:"center",children:[ee.uF.QUEUED===f&&(0,g.jsx)(Y.Z,{color:(we||$.Z).content.active,type:"cylon"}),ee.uF.BUSY===f&&(0,g.jsx)(Y.Z,{color:(we||$.Z).content.active}),R&&!Pe&&!Me&&(0,g.jsxs)(g.Fragment,{children:[!Ue&&(0,g.jsx)(X.Z,{appearBefore:!0,default:!0,label:(0,g.jsxs)(v.ZP,{children:["Run block \xa0 \xa0",(0,g.jsx)(W.Z,{inline:!0,keyTextGroups:[[(0,ce.V5)()?oe.RJ:oe.hE,oe.Lz]],monospace:!0,uuidForKey:de})]}),size:3*M.iI,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){H?R({block:l}):ye(!0)},children:(0,g.jsx)(S.Z,{color:De,size:3*M.iI,children:(0,g.jsx)(ne.Py,{black:!0,size:1.5*M.iI})})})}),Ue&&(0,g.jsx)(p.Z,{backgroundColor:De,beforeIcon:(0,g.jsx)(ne.Py,{size:1.5*M.iI}),compact:!0,onClick:function(){H?R({block:l}):ye(!0)},small:!0,children:null!==le&&void 0!==le&&null!==(n=le.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 ye(!1)},open:ke,children:(0,g.jsx)(w.Z,{items:[{label:function(){return"Execute block"},onClick:function(){return R({block:l})},uuid:"execute_block"},{label:function(){return"Execute with upstream blocks"},onClick:function(){return R({block:l,runUpstream:!0})},uuid:"execute_upstream"}],onClickCallback:function(){return ye(!1)},open:ke,parentRef:me,rightOffset:13.25*M.iI,topOffset:4.5*M.iI,uuid:"execute_actions",width:25*M.iI})})]}),Pe&&(0,g.jsx)(h.Z,{ml:M.cd,children:(0,g.jsx)(X.Z,{appearBefore:!0,default:!0,label:(0,g.jsxs)(v.ZP,{children:["Interrupt kernel \xa0 \xa0",(0,g.jsx)(W.Z,{inline:!0,keyTextGroups:[[oe.kA],[oe.kA]],monospace:!0,uuidForKey:de})]}),size:te.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return O()},children:(0,g.jsx)(S.Z,{borderSize:1.5,size:te.C,children:(0,g.jsx)(ne.x8,{size:1*M.iI})})})})}),!C&&E.tf.SCRATCHPAD===l.type&&!Me&&(0,g.jsx)(h.Z,{ml:M.cd,children:(0,g.jsx)(z.Z,{items:Be,onClickCallback:function(){return Ze(!1)},onClickOutside:function(){return Ze(!1)},open:_e,parentRef:pe,rightOffset:0,topOffset:4,uuid:"CommandButtons/convert_block",children:(0,g.jsx)(X.Z,{appearBefore:!0,default:!0,label:(0,g.jsx)(v.ZP,{children:"Convert block"}),size:te.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return Ze(!_e)},ref:pe,children:(0,g.jsx)(Q,{size:te.C})})})})}),!C&&[E.tf.DATA_LOADER,E.tf.TRANSFORMER].includes(l.type)&&!Me&&!Ne&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.Z,{ml:M.cd,ref:fe,children:(0,g.jsx)(X.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 je((function(e){return!e}))},children:(0,g.jsx)(ne.GQ,{size:2.25*M.iI})})})}),i&&(0,g.jsx)(F.Z,{disableEscape:!0,onClickOutside:function(){return je(!1)},open:xe,children:(0,g.jsx)(U,{addWidget:i,block:l,onClickCallback:function(){return je(!1)},open:xe,parentRef:fe,rightOffset:9*M.iI,runBlock:R,topOffset:2*M.iI})})]}),!C&&Fe&&(0,g.jsx)(h.Z,{ml:M.cd,children:(0,g.jsx)(X.Z,{appearBefore:!0,default:!0,label:k?"Close editor":"Edit",size:te.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return A((function(e){return!e}))},children:k?(0,g.jsx)(ne.Jr,{size:te.C,success:!0}):(0,g.jsx)(ne.I8,{size:te.C})})})}),!C&&(0,g.jsx)("div",{ref:ve,children:(0,g.jsxs)(h.Z,{ml:M.cd,children:[ze&&(0,g.jsx)(Y.Z,{inverted:!0,small:!0}),!ze&&(0,g.jsx)(X.Z,{appearBefore:!0,default:!0,label:(0,g.jsx)(v.ZP,{children:"AI actions"}),size:te.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return Ae((function(e){return!e}))},children:(0,g.jsx)(ne.xq,{default:!0,size:te.C})})})]})}),!C&&(0,g.jsx)(F.Z,{disableEscape:!0,onClickOutside:function(){return Ae(!1)},open:Re,children:(0,g.jsx)(w.Z,{items:We,onClickCallback:function(){return Ae(!1)},open:Re,parentRef:ve,rightOffset:4.75*M.iI,topOffset:2*M.iI,uuid:"FileHeaderMenu/AI_actions"})}),!C&&(0,g.jsx)(h.Z,{ml:M.cd,children:(0,g.jsx)(X.Z,{appearBefore:!0,default:!0,label:"View and edit settings for this block",size:te.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return null===y||void 0===y?void 0:y(_.cH.BLOCK_SETTINGS)},children:(0,g.jsx)(ne.JG,{default:!0,size:te.C})})})}),!C&&(0,g.jsx)("div",{ref:he,children:(0,g.jsx)(h.Z,{ml:M.cd,children:(0,g.jsx)(X.Z,{appearBefore:!0,default:!0,label:(0,g.jsx)(v.ZP,{children:"More actions"}),size:te.C,widthFitContent:!0,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return Ie((function(e){return!e}))},children:(0,g.jsx)(S.Z,{borderSize:1.5,default:!0,size:te.C,children:(0,g.jsx)(ne.mH,{default:!0,size:M.iI})})})})})}),!C&&(0,g.jsx)(F.Z,{disableEscape:!0,onClickOutside:function(){return Ie(!1)},open:Te,children:(0,g.jsx)(w.Z,{items:(0,ie.J8)(l,R,d,N,Me||Ne,{addNewBlock:o,blocksMapping:Le,fetchFileTree:x,fetchPipeline:j,savePipelineContent:P,updatePipeline:Qe}),onClickCallback:function(){return Ie(!1)},open:Te,parentRef:he,rightOffset:4.75*M.iI,topOffset:2*M.iI,uuid:"FileHeaderMenu/file_items"})})]})};!function(e){e.APPEND="append",e.FAIL="fail",e.REPLACE="replace"}(se||(se={}));var fe,pe=[se.APPEND,se.FAIL,se.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"}(fe||(fe={}));var me=t(34744),he=t(25717),ve=t(68792),be=t(5882),ge=t(87372),xe=t(2005),je=t(73942),Ce=t(31012),_e=t(37391),Ze="0.75em",Oe=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;","}}"],xe.ry,M.iI,_e.w5,(function(e){return"\n color: ".concat((e.theme||$.Z).content.active,";\n ")}),Ze,M.iI,(function(e){return"\n border-left: ".concat(.5*M.iI,"px solid ").concat((e.theme||$.Z).content.active,";\n ")}),3*M.l4,je.BG,Ze,M.iI,_e.w5,(function(e){return"\n background-color: ".concat((e.theme||$.Z).interactive.defaultBorder,";\n ")}),Ze,3*M.iI,Ce.iD,Ce.iD,Ze,xe.nF,(function(e){return"\n border-bottom: ".concat(je.YF,"px solid ").concat((e.theme||$.Z).content.active,";\n ")}),.5*M.iI,.75*M.iI,(function(e){return"\n border: ".concat(je.YF,"px solid ").concat((e.theme||$.Z).content.muted,";\n ")}));var ke=function(e){var n=e.children;return(0,g.jsx)(Oe,{children:(0,g.jsx)(ve.D,{components:{a:function(e){var n=e.children,t=e.href;return(0,g.jsx)(K.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:$.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)(ge.Z,{level:1,children:n})},h2:function(e){var n=e.children;return(0,g.jsx)(ge.Z,{level:2,children:n})},h3:function(e){var n=e.children;return(0,g.jsx)(ge.Z,{level:3,children:n})},h4:function(e){var n=e.children;return(0,g.jsx)(ge.Z,{level:4,children:n})},h5:function(e){var n=e.children;return(0,g.jsx)(ge.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:[be.Z],children:n})})},ye=t(55378),Ee=t(82944),Te=t(87815),Ie=t(66653);function Se(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 Re(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ae=function(e){var n=e.block,t=e.blockConfiguration,o=e.blockRefs,r=e.blocks,l=e.updateBlockConfiguration,a=(0,c.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,c.useMemo)((function(){var e=[null];return d&&f?e.push.apply(e,[null,1]):e.push(1),e}),[f,d]),m=(0,c.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,c.useMemo)((function(){return null===r||void 0===r?void 0:r.map((function(e,n){var r,c=e.color,u=e.language,p=e.type,m=e.uuid,h=(0,b.qn)(p,{blockColor:c,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)(K.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 C="table-name-input-".concat(m),_=(null===t||void 0===t?void 0:t[P.Yf])||{},Z=(null===_||void 0===_?void 0:_[m])||{};x?j.push((0,g.jsx)(Ee.Z,{borderless:!0,compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;l((0,i.Z)({},P.Yf,Re(Re({},_),{},(0,i.Z)({},m,Re(Re({},Z),{},(0,i.Z)({},P.aZ,n))))))},onClick:Ie.j,placeholder:"[database_optional].[schema_optional].[table]",small:!0,value:(null===Z||void 0===Z?void 0:Z[P.aZ])||""},C)):f&&j.push((0,g.jsx)(v.ZP,{italic:!0,muted:!0,small:!0,children:"Table name is defined in upstream block."},C))}return j}))}),[f,t,o,r,s,d,a,l]);return(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(Te.Z,{columnFlex:p,columns:m,compact:!0,noBorder:!0,rows:h,uuid:"CodeBlock/UpstreamBlockSettings/".concat(null===n||void 0===n?void 0:n.uuid)})})},we=t(59582),Pe=t(66166),De=t(31524),Me=t(32365),Ne=t(84212),Be=t(80636),Le=t(91427),Ue=t(25958),Fe=t(43482),He=t(51504),Ge=t(7715),Qe=t(87323),ze=t(41150);function We(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 qe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?We(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):We(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ke=1e3;function Ve(e,n){var t,x,C,O,k=e.addNewBlock,w=e.addNewBlockMenuOpenIdx,D=e.addWidget,B=e.allBlocks,L=e.allowCodeBlockShortcuts,U=e.autocompleteItems,F=e.block,H=e.blockIdx,G=e.blockRefs,Q=e.blockTemplates,W=e.blocks,q=void 0===W?[]:W,V=e.dataProviders,Y=e.defaultValue,$=void 0===Y?"":Y,ce=e.deleteBlock,le=e.disableDrag,ae=e.disableShortcuts,ve=e.executionState,be=e.extraContent,ge=e.fetchFileTree,xe=e.fetchPipeline,je=e.height,Ce=e.hideExtraCommandButtons,_e=e.hideExtraConfiguration,Ze=e.hideHeaderInteractiveInformation,Oe=e.hideRunButton,Te=e.interruptKernel,Se=e.mainContainerRef,Re=e.mainContainerWidth,We=e.messages,Ve=void 0===We?[]:We,Ye=e.noDivider,Xe=e.onCallbackChange,Je=e.onChange,$e=e.onClickAddSingleDBTModel,en=e.onDrop,nn=e.openSidekickView,tn=e.pipeline,on=e.project,rn=e.runBlock,cn=e.runningBlocks,un=e.savePipelineContent,ln=e.selected,an=e.setAddNewBlockMenuOpenIdx,sn=e.setAnyInputFocused,dn=e.setCreatingNewDBTModel,fn=e.setEditingBlock,pn=e.setErrors,mn=e.setOutputBlocks,hn=e.setSelected,vn=e.setSelectedBlock,bn=e.setSelectedOutputBlock,gn=e.setTextareaFocused,xn=e.showBrowseTemplates,jn=e.showConfigureProjectModal,Cn=e.textareaFocused,_n=e.widgets,Zn=(0,c.useContext)(u.ThemeContext),On=F||{},kn=On.callback_content,yn=On.configuration,En=void 0===yn?{}:yn,Tn=On.color,In=On.error,Sn=On.has_callback,Rn=On.language,An=On.pipelines,wn=On.replicated_block,Pn=On.type,Dn=On.upstream_blocks,Mn=void 0===Dn?[]:Dn,Nn=On.uuid,Bn=(0,c.useMemo)((function(){return En}),[En]),Ln=(0,c.useMemo)((function(){var e;return(null===(e=Object.values(An||{}))||void 0===e?void 0:e.length)||1}),[An]),Un=(0,c.useState)(!1),Fn=Un[0],Hn=Un[1],Gn=(0,c.useState)(null),Qn=Gn[0],zn=Gn[1],Wn=(0,c.useState)(!1),qn=Wn[0],Kn=Wn[1],Vn=(0,c.useState)(!1),Yn=Vn[0],Xn=Vn[1],Jn=(0,c.useState)($),$n=Jn[0],et=Jn[1],nt=(0,c.useState)(null),tt=nt[0],ot=nt[1],rt=tn||{},it=rt.type,ct=rt.uuid,ut=(0,c.useMemo)((function(){return re.qL.STREAMING===it}),[it]),lt=E.tf.DBT===Pn,at=E.t6.SQL===Rn,st=E.t6.R===Rn,dt=E.tf.MARKDOWN===Pn,ft=Bn[P.mW];at&&void 0===ft&&(ft=Ke);var pt=(0,c.useState)(qe(qe({},Bn),{},(t={},(0,i.Z)(t,P.cH,Bn[P.cH]),(0,i.Z)(t,P.Sv,Bn[P.Sv]),(0,i.Z)(t,P.sc,Bn[P.sc]),(0,i.Z)(t,P.BD,Bn[P.BD]),(0,i.Z)(t,P.m$,Bn[P.m$]),(0,i.Z)(t,P.Pi,Bn[P.Pi]||{}),(0,i.Z)(t,P.Mv,Bn[P.Mv]),(0,i.Z)(t,P.eW,Bn[P.eW]),(0,i.Z)(t,P.nq,Bn[P.nq]||se.APPEND),(0,i.Z)(t,P.mW,ft),(0,i.Z)(t,P.bk,Bn[P.bk]),(0,i.Z)(t,P.Mi,!!Bn[P.Mi]),t))),mt=pt[0],ht=pt[1],vt=(0,c.useState)(null),bt=vt[0],gt=vt[1],xt=(0,c.useState)(dt),jt=xt[0],Ct=xt[1],_t=(0,c.useState)(!1),Zt=_t[0],Ot=_t[1],kt=(0,c.useState)(Nn),yt=kt[0],Et=kt[1],Tt=(0,c.useState)(!1),It=Tt[0],St=Tt[1],Rt=(0,c.useState)(0),At=Rt[0],wt=Rt[1],Pt=(0,c.useState)(null),Dt=Pt[0],Mt=Pt[1],Nt=(0,c.useState)(null),Bt=Nt[0],Lt=Nt[1],Ut=(0,c.useState)(Ve),Ft=Ut[0],Ht=Ut[1],Gt=(0,c.useState)((0,te.Xy)(F)[0]),Qt=Gt[0],zt=Gt[1],Wt=(0,l.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:F,type:te.vT}}),[F]),qt=(0,r.Z)(Wt,2),Kt=qt[0],Vt=qt[1],Yt=(0,a.L)((function(){return{accept:te.vT,drop:function(e){return null===en||void 0===en?void 0:en(F,e)}}}),[F]),Xt=(0,r.Z)(Yt,2)[1],Jt=(0,c.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]),$t=(0,c.useMemo)((function(){return Jt.projects||{}}),[Jt]),eo=(0,c.useMemo)((function(){return Jt.project||mt[P.eW]}),[mt,Jt]),no=(0,c.useMemo)((function(){return $t[eo]||{target:null,targets:[]}}),[eo,$t]),to=(0,c.useMemo)((function(){return no.targets||[]}),[no]),oo=(0,c.useMemo)((function(){return mt[P.Mv]}),[mt]),ro=eo?null!==no&&void 0!==no&&no.target?(0,Z.sE)(to,(function(e){return e===no.target})):"Select target":"Select project first",io=(0,c.useState)(oo&&!(null!==to&&void 0!==to&&to.includes(oo))),co=io[0],uo=io[1],lo=(0,c.useState)(null),ao=lo[0],so=lo[1];(0,c.useEffect)((function(){kn!==ao&&so(kn)}),[ao,kn]);var fo=(0,Pe.Z)(F);(0,c.useEffect)((function(){if(JSON.stringify(F)!=JSON.stringify(fo)){var e,n=(0,Fe.Rt)([F]).messages,t=null===n||void 0===n||null===(e=n[Pn])||void 0===e?void 0:e[Nn];(null===t||void 0===t?void 0:t.length)>=1&&Ht(t)}}),[F,Pn,Nn,fo,Ht]);var po=(0,Pe.Z)(Ve);(0,c.useEffect)((function(){"undefined"!==typeof Ve&&Ve.length!==(null===po||void 0===po?void 0:po.length)&&Ht(Ve)}),[Ve,po,Ht]);var mo=(0,c.useMemo)((function(){var e=new Set;return null===V||void 0===V||V.forEach((function(n){var t=n.profiles;e=new Set([].concat((0,o.Z)(e),(0,o.Z)(t)))})),(0,o.Z)(e)}),[V]),ho=(0,c.useMemo)((function(){return"".concat(ct,"/").concat(Nn,"/codeCollapsed")}),[ct,Nn]),vo=(0,c.useMemo)((function(){return"".concat(ct,"/").concat(Nn,"/outputCollapsed")}),[ct,Nn]);(0,c.useEffect)((function(){Xn((0,Le.U2)(ho,!1)),St((0,Le.U2)(vo,!1))}),[ho,vo]);var bo=(0,c.useRef)(null),go=(0,c.useMemo)((function(){return(0,Z.HK)(q,(function(e){return e.uuid}))}),[q]),xo=(0,c.useMemo)((function(){return!(null===_n||void 0===_n||!_n.find((function(e){return e.upstream_blocks.includes(Nn)})))}),[Nn,_n]),jo=(0,c.useCallback)((function(e){var n=e||{},t=n.block,o=n.code,r=n.disableReset,i=n.runDownstream,c=n.runIncompleteUpstream,u=n.runSettings,l=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&&te.Rj!==Qt&&zt(te.Rj),null===rn||void 0===rn||rn({block:t,code:o||$n,runDownstream:i||xo,runIncompleteUpstream:c||!1,runSettings:u,runTests:a||!1,runUpstream:l||!1}),r||(wt(1+Number(At)),Mt(null),St(!1))}),[$n,xo,lt,rn,At,Qt,wt,Mt,zt]),Co=!(null===cn||void 0===cn||!cn.find((function(e){return e.uuid===Nn})))||(null===Ft||void 0===Ft?void 0:Ft.length)>=1&&ve!==ee.uF.IDLE;(0,c.useEffect)((function(){Co&&Lt(Number(new Date))}),[Co,Lt]);var _o=(0,Pe.Z)(ve);(0,c.useEffect)((function(){ve===ee.uF.IDLE&&ve!==_o&&Mt(Number(new Date))}),[ve,_o,Mt]);var Zo=(0,c.useCallback)((function(e){var n=e.editorRect.top,t=e.position.lineNumberTop;if(null!==Se&&void 0!==Se&&Se.current){var o=Se.current.getBoundingClientRect().height;if(n+t>o){var r=Se.current.scrollTop+(t-o+n);Se.current.scrollTo(0,r)}else if(t+n<Me.aU){var i=Se.current.scrollTop+(t+n-Me.aU);Se.current.scrollTo(0,i)}}}),[Se]),Oo=(0,c.useMemo)((function(){return(0,ie.h5)(Ft,bt)}),[bt,Ft]),ko=(0,ie.oI)(Oo),yo=ko.hasError,Eo=ko.hasOutput,To=(0,b.qn)(Pn,{blockColor:Tn,theme:Zn}).accent,Io=(null===Mn||void 0===Mn?void 0:Mn.length)||0,So=(0,Qe.cU)([F],q)[0],Ro=So.dynamic,Ao=So.dynamicUpstreamBlock,wo=So.reduceOutput,Po=So.reduceOutputUpstreamBlock,Do=(0,c.useMemo)((function(){return(0,ie._o)({block:F,dynamic:Ro,dynamicUpstreamBlock:Ao,hasError:yo,reduceOutput:wo,reduceOutputUpstreamBlock:Po,selected:ln})}),[F,Ro,Ao,yo,wo,Po,ln]),Mo=Do.borderColorShareProps,No=Do.tags,Bo=(0,c.useCallback)((function(){ln||(null===sn||void 0===sn||sn(!1),null===hn||void 0===hn||hn(!0))}),[ln,sn,hn]),Lo=J.ZP.blocks.pipelines.detail(ct,te.gM.uuid===(null===Qt||void 0===Qt?void 0:Qt.uuid)||te.Jt.uuid===(null===Qt||void 0===Qt?void 0:Qt.uuid)?encodeURIComponent(Nn):null,{_format:"dbt"},{revalidateOnFocus:!0}),Uo=Lo.data,Fo=Lo.mutate,Ho=(0,c.useMemo)((function(){var e;return(null===Uo||void 0===Uo||null===(e=Uo.block)||void 0===e?void 0:e.metadata)||{}}),[Uo]),Go=(0,s.Db)(J.ZP.blocks.pipelines.useUpdate(ct,Nn),{onError:function(e){var n=(0,ue.qQ)(e).messages;gt(n)},onSuccess:function(e){return(0,ue.wD)(e,{callback:function(e){Ot(!1),xe(),ge(),et($n),null!==e&&void 0!==e&&e.block&&vn(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return pn({errors:n,response:e})}})}}),Qo=(0,r.Z)(Go,1)[0],zo="CodeBlock/".concat(Nn),Wo=(0,ze.y)(),qo=Wo.registerOnKeyDown,Ko=Wo.unregisterOnKeyDown;(0,c.useEffect)((function(){return function(){Ko(zo)}}),[Ko,zo]),qo(zo,(function(e,n,t){ae&&!L||(Zt&&String(t[0])===String(oe.Uq)&&String(t[1])!==String(oe.zX)?Nn===yt?e.target.blur():Qo({block:qe(qe({},F),{},{name:yt})}):ln&&!Oe&&((0,He.y)([oe.zX,oe.Uq],n)||(0,He.y)([oe.PQ,oe.Uq],n)?jo({block:F}):(0,He.y)([oe.XR,oe.Uq],n)&&k&&(e.preventDefault(),k({language:Rn,type:Pn,upstream_blocks:[Nn]}),jo({block:F}))))}),[k,F,Oe,Zt,yt,jo,ln,Qo]),(0,c.useEffect)((function(){var e;return Bt&&(e=setInterval((function(){return ot(Number(new Date))}),1e3)),tt&&!Co&&clearInterval(e),function(){return clearInterval(e)}}),[tt,Co,Bt]);var Vo=(0,c.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(){Qo({block:qe(qe({},e),{},{color:t})})},uuid:t}),n}),[])),(0,i.Z)(n,E.tf.SCRATCHPAD,(0,o.Z)((0,ie.Ts)(e,q,"block_menu/scratchpad",k)).map((function(e){return qe(qe({},e),{},{onClick:function(){return un().then((function(){return e.onClick()}))}})}))),n);return t[e.type]}),[k,q,un,Qo]),Yo=(0,c.useMemo)((function(){return wn&&(null===go||void 0===go?void 0:go[wn])}),[go,wn]),Xo=(0,c.useMemo)((function(){return!wn&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(R.Z,{autoHeight:!0,autocompleteProviders:Qn,block:F,height:je,language:Rn,onChange:function(e){et(e),null===Je||void 0===Je||Je(e)},onDidChangeCursorPosition:Zo,placeholder:E.tf.DBT===Pn&&E.t6.YAML===Rn?"e.g. --select ".concat(eo||"project","/models --exclude ").concat(eo||"project","/models/some_dir"):"Start typing here...",selected:ln,setSelected:hn,setTextareaFocused:gn,shortcuts:Oe?[]:[function(e,n){return(0,Be.Q)(e,(function(){Oe||jo({block:F,code:n.getValue()})}))}],textareaFocused:Cn,value:$n,width:"100%"}),Sn&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(me.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:Qn,language:"python",onChange:function(e){so(e),null===Xe||void 0===Xe||Xe(e)},onDidChangeCursorPosition:Zo,placeholder:"Start typing here...",selected:ln,setSelected:hn,setTextareaFocused:gn,textareaFocused:Cn,value:ao,width:"100%"})]})]})]})}),[Qn,F,Rn,Pn,ao,$n,eo,Sn,je,Oe,Xe,Je,Zo,wn,jo,ln,et,hn,gn,Cn]);(0,c.useEffect)((function(){U&&zn({python:(0,we.Z)({autocompleteItems:U,block:F,blocks:q,pipeline:tn})})}),[U,F,q,tn]);var Jo=(0,c.useMemo)((function(){return lt?(0,g.jsx)(h.Z,{py:1,children:(0,g.jsx)(T.Z,{onClickTab:function(e){zt(e),te.gM.uuid!==e.uuid&&te.Jt.uuid!==e.uuid||Fo()},selectedTabUUID:null===Qt||void 0===Qt?void 0:Qt.uuid,small:!0,tabs:(0,te.Xy)(F)})}):null}),[F,Fo,lt,Qt]),$o=(0,c.useMemo)((function(){return(0,g.jsx)(A.Z,qe(qe({},Mo),{},{block:F,blockMetadata:Ho,buttonTabs:Jo,collapsed:It,hasOutput:Eo,isInProgress:Co,mainContainerWidth:Re,messages:Oo,openSidekickView:nn,pipeline:tn,runCount:At,runEndTime:Dt,runStartTime:Bt,selected:ln,selectedTab:Qt,setCollapsed:function(e){St((function(){return(0,Le.t8)(vo,e),e}))},setErrors:pn,setOutputBlocks:mn,setSelectedOutputBlock:bn,setSelectedTab:zt}))}),[F,Ho,Mo,Jo,Eo,Co,Re,Oo,nn,It,vo,tn,At,Dt,Bt,ln,Qt,pn,mn,St,bn]),er=(0,c.useCallback)((function(){return Kn(!1)}),[]),nr=(0,c.useRef)(null),tr=(0,c.useCallback)((function(e){clearTimeout(nr.current),ht((function(n){return qe(qe({},n),e)})),nr.current=setTimeout((function(){var n=qe(qe({},mt),e);("undefined"!==typeof n[P.cH]&&"undefined"!==n[P.sc]||"undefined"!==typeof n[P.Mv]||"undefined"!==typeof n[P.eW]||"undefined"!==typeof n[P.mW])&&un({block:{configuration:n,uuid:Nn}})}),1e3)}),[Nn,mt,un]),or=De.zJ.BIGQUERY===mt[P.cH]||De.zJ.SNOWFLAKE===mt[P.cH],rr=(0,c.useMemo)((function(){return(null===q||void 0===q?void 0:q.length)||0}),[q]),ir=(0,c.useMemo)((function(){return $n?(0,g.jsx)(ke,{children:$n}):(0,g.jsx)(h.Z,{px:1,children:(0,g.jsx)(v.ZP,{monospace:!0,muted:!0,children:"Double-click to edit"})})}),[$n]);(0,c.useEffect)((function(){dt&&jt&&!ln&&Ct(!1)}),[jt,dt,ln]);var cr=(0,c.useMemo)((function(){return(0,g.jsx)(Ee.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){sn(!1)}),300)},onChange:function(e){sn(!0),tr((0,i.Z)({},P.mW,+e.target.value)),e.preventDefault()},onClick:Ie.j,onFocus:function(){sn(!0)},small:!0,type:"number",value:mt[P.mW]||"",width:11*M.iI})}),[mt,sn,tr]);return(0,g.jsx)("div",{ref:Xt,children:(0,g.jsxs)("div",{ref:n,style:{position:"relative",zIndex:H===w?rr+9:null},children:[(0,g.jsxs)("div",{style:{position:"relative"},children:[(0,g.jsx)(b.nz,qe(qe({},qe(qe({},Mo),Kt)),{},{bottomBorder:dt,onClick:function(){return Bo()},ref:le?null:Vt,zIndex:rr+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[Rn]}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(S.Z,{color:To,size:1.5*M.iI,square:!0}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(z.Z,{items:Vo(F),onClickCallback:er,onClickOutside:er,open:qn,parentRef:bo,uuid:"CodeBlock/block_menu",children:(0,g.jsx)(v.ZP,{color:To,monospace:!0,children:null===(x=lt?E.tf.DBT:E.V4[Pn])||void 0===x?void 0:x.toUpperCase()})}),!Ze&&[E.tf.CUSTOM,E.tf.SCRATCHPAD].includes(Pn)&&(0,g.jsxs)(g.Fragment,{children:["\xa0",(0,g.jsx)(p.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return Kn(!0)},transparent:!0,children:(0,g.jsx)(ne.K5,{muted:!0})})]})]}),!Ze&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.Z,{mr:M.cd}),(0,g.jsx)(ne.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!==Rn&&(0,g.jsx)(X.Z,{block:!0,label:(0,Ue.$1)(F,{fullPath:!0}),size:null,children:(0,g.jsx)(v.ZP,{monospace:!0,muted:!0,children:(0,Ue.$1)(F)})}),(!lt||E.t6.YAML===Rn)&&(0,g.jsx)(he.Z,{bold:!1,inputValue:yt,monospace:!0,muted:!0,notRequired:!0,onBlur:function(){return setTimeout((function(){sn(!1),Ot(!1)}),300)},onChange:function(e){Et(e.target.value),e.preventDefault()},onClick:function(){sn(!0),Ot(!0)},onFocus:function(){sn(!0),Ot(!0)},stacked:!0,value:!Zt&&Nn}),Zt&&!lt&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.Z,{ml:1}),(0,g.jsx)(K.Z,{onClick:function(){return un({block:{name:yt,uuid:Nn}}).then((function(){Ot(!1),xe(),ge()}))},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]}),(0,g.jsx)(h.Z,{mr:2}),!E.iZ.includes(Pn)&&Re>700&&(0,g.jsx)(X.Z,{appearBefore:!0,block:!0,label:"\n ".concat((0,N._6)("parent block",Io),". ").concat(0===Io?"Click to select 1 or more blocks to depend on.":"Edit parent blocks.","\n "),size:null,widthFitContent:Io>=1,children:(0,g.jsx)(p.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){hn(!0),fn({upstreamBlocks:{block:F,values:null===Mn||void 0===Mn?void 0:Mn.map((function(e){return{uuid:e}}))}})},children:(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsxs)(v.ZP,{monospace:Io>=1,small:!0,underline:0===Io,children:[0===Io&&"Edit parent blocks",Io>=1&&(0,N._6)("parent block",Io)]}),(0,g.jsx)(h.Z,{mr:1}),0===Io&&(0,g.jsx)(ne.Jj,{size:3*M.iI}),Io>=1&&(0,g.jsx)(ne.eV,{size:3*M.iI})]})})}),Ln>=2&&(0,g.jsx)(h.Z,{ml:2,children:(0,g.jsx)(X.Z,{block:!0,label:"This block is used in ".concat(Ln," pipelines."),size:null,widthFitContent:!0,children:(0,g.jsxs)(K.Z,{default:!0,monospace:!0,onClick:function(){return nn(_.cH.BLOCK_SETTINGS)},preventDefault:!0,small:!0,children:[Ln," pipelines"]})})})]})]}),rn&&(0,g.jsx)(de,{addNewBlock:k,addWidget:D,block:F,blocks:q,deleteBlock:ce,executionState:ve,fetchFileTree:ge,fetchPipeline:xe,hideExtraButtons:Ce,interruptKernel:Te,isEditingBlock:jt,openSidekickView:nn,pipeline:tn,project:on,runBlock:Oe?null:jo,savePipelineContent:un,setErrors:pn,setIsEditingBlock:Ct,setOutputCollapsed:St,showConfigureProjectModal:jn}),!Ce&&(0,g.jsx)(h.Z,{px:1,children:(0,g.jsx)(p.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){Xn((function(e){return(0,Le.t8)(ho,!e),!e})),Yn||St((function(){return(0,Le.t8)(vo,!0),!0}))},transparent:!0,children:Yn?(0,g.jsx)(ne._M,{muted:!0,size:2*M.iI}):(0,g.jsx)(ne.Kh,{muted:!0,size:2*M.iI})})})]})})),(0,g.jsxs)(b.Nk,{onClick:function(){return Bo()},children:[(0,g.jsxs)(b.jv,qe(qe({},Mo),{},{className:ln&&Cn?"selected":null,hasOutput:!!Jo||Eo,lightBackground:dt&&!jt,onDoubleClick:function(){dt&&!jt&&Ct(!0)},children:[!_e&&E.tf.DBT===Pn&&!Yn&&(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===Rn&&(0,g.jsx)(ye.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){sn(!1)}),300)},onChange:function(e){var n;tr((n={},(0,i.Z)(n,P.Mv,""),(0,i.Z)(n,P.eW,e.target.value),n)),e.preventDefault()},onClick:Ie.j,onFocus:function(){sn(!0)},placeholder:"Project",small:!0,value:mt[P.eW]||"",children:Object.keys($t||{}).map((function(e){return(0,g.jsx)("option",{value:e,children:e},e)}))}),E.t6.YAML!==Rn&&(0,g.jsx)(v.ZP,{monospace:!0,small:!0,children:eo}),(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"}),!co&&(0,g.jsx)(ye.Z,{compact:!0,disabled:!eo,monospace:!0,onBlur:function(){return setTimeout((function(){sn(!1)}),300)},onChange:function(e){tr((0,i.Z)({},P.Mv,e.target.value)),e.preventDefault()},onClick:Ie.j,onFocus:function(){sn(!0)},placeholder:ro,small:!0,value:oo||"",children:null===to||void 0===to?void 0:to.map((function(e){return(0,g.jsx)("option",{value:e,children:e},e)}))}),co&&(0,g.jsx)(Ee.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){sn(!1)}),300)},onChange:function(e){tr((0,i.Z)({},P.Mv,e.target.value)),e.preventDefault()},onClick:Ie.j,onFocus:function(){sn(!0)},placeholder:eo?(null===no||void 0===no?void 0:no.target)||"Enter target":"Select project first",small:!0,value:oo||"",width:21*M.iI}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(m.Z,{alignItems:"center",children:(0,g.jsx)(X.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)(I.Z,{checked:co,label:(0,g.jsx)(v.ZP,{muted:!0,small:!0,children:"Manually enter target"}),onClick:function(e){(0,Ie.j)(e),uo(!co),co&&tr((0,i.Z)({},P.Mv,null))}}),(0,g.jsx)("span",{children:"\xa0"}),(0,g.jsx)(ne.kI,{muted:!0})]})})})]}),E.t6.YAML!==Rn&&!(null!==Jt&&void 0!==Jt&&null!==(C=Jt.block)&&void 0!==C&&C.snapshot)&&(0,g.jsxs)(m.Z,{alignItems:"center",children:[(0,g.jsx)(X.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)(ne.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"})]})}),cr,(0,g.jsx)(h.Z,{mr:1})]})]}),E.t6.YAML===Rn&&(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)(Ee.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){sn(!1)}),300)},onChange:function(e){tr((0,i.Z)({},P.Pi,qe(qe({},null===mt||void 0===mt?void 0:mt[P.Pi]),{},(0,i.Z)({},P.pA,e.target.value)))),e.preventDefault()},onClick:Ie.j,onFocus:function(){sn(!0)},placeholder:"command",small:!0,value:(null===mt||void 0===mt||null===(O=mt[P.Pi])||void 0===O?void 0:O[P.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===mt||void 0===mt?void 0:mt[P.eW])||"project"," folder)"]})]}),(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(v.ZP,{muted:!0,small:!0,children:(0,g.jsx)(K.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&&at&&!Yn&&E.tf.DBT!==Pn&&(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)(ye.Z,{compact:!0,label:"Connection",onChange:function(e){return tr((0,i.Z)({},P.cH,e.target.value))},onClick:Ie.j,small:!0,value:mt[P.cH],children:null===V||void 0===V?void 0:V.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)(ye.Z,{compact:!0,label:"Profile",onChange:function(e){return tr((0,i.Z)({},P.sc,e.target.value))},onClick:Ie.j,small:!0,value:mt[P.sc],children:null===mo||void 0===mo?void 0:mo.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)(X.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)(I.Z,{checked:mt[P.Mi],label:(0,g.jsx)(v.ZP,{muted:!0,small:!0,children:"Use raw SQL"}),onClick:function(e){(0,Ie.j)(e),tr((0,i.Z)({},P.Mi,!mt[P.Mi]))}}),(0,g.jsx)("span",{children:"\xa0"}),(0,g.jsx)(ne.kI,{muted:!0})]})})}),!mt[P.Mi]&&(0,g.jsxs)(g.Fragment,{children:[or&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(m.Z,{alignItems:"center",children:(0,g.jsx)(Ee.Z,{compact:!0,label:"Database",monospace:!0,onBlur:function(){return setTimeout((function(){sn(!1)}),300)},onChange:function(e){tr((0,i.Z)({},P.Sv,e.target.value)),e.preventDefault()},onClick:Ie.j,onFocus:function(){sn(!0)},small:!0,value:mt[P.Sv],width:10*M.iI})})]}),(0,g.jsx)(h.Z,{mr:1}),![fe.CLICKHOUSE,fe.MYSQL].includes(mt[P.cH])&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(X.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)(Ee.Z,{compact:!0,label:"Schema",monospace:!0,onBlur:function(){return setTimeout((function(){sn(!1)}),300)},onChange:function(e){tr((0,i.Z)({},P.BD,e.target.value)),e.preventDefault()},onClick:Ie.j,onFocus:function(){sn(!0)},small:!0,value:mt[P.BD],width:10*M.iI})})}),(0,g.jsx)(h.Z,{mr:1})]}),(0,g.jsx)(X.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:[ct,"_",Nn]}),(0,g.jsx)("br",{}),"This field is optional."]}),size:null,widthFitContent:!0,children:(0,g.jsx)(m.Z,{alignItems:"center",children:(0,g.jsx)(Ee.Z,{compact:!0,label:"Table (optional)",monospace:!0,onBlur:function(){return setTimeout((function(){sn(!1)}),300)},onChange:function(e){tr((0,i.Z)({},P.m$,e.target.value)),e.preventDefault()},onClick:Ie.j,onFocus:function(){sn(!0)},small:!0,value:mt[P.m$],width:20*M.iI})})})]}),(0,g.jsx)(h.Z,{mr:1})]}),!mt[P.Mi]&&(0,g.jsxs)(m.Z,{alignItems:"center",style:{marginTop:"8px"},children:[(0,g.jsx)(X.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)(ne.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"})]})}),cr,(0,g.jsx)(h.Z,{mr:1}),(0,g.jsx)(X.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",or?" 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)(ne.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)(ye.Z,{compact:!0,label:"strategy",onChange:function(e){return tr((0,i.Z)({},P.nq,e.target.value))},onClick:Ie.j,small:!0,value:mt[P.nq],children:null===pe||void 0===pe?void 0:pe.map((function(e){return(0,g.jsx)("option",{value:e,children:(0,N.kC)(e)},e)}))})]})}),(0,g.jsx)(h.Z,{mr:1})]}),(null===mt||void 0===mt?void 0:mt[P.cH])===fe.TRINO&&Mn.length>=1&&(0,g.jsxs)(m.Z,{alignItems:"center",style:{marginTop:"8px"},children:[(0,g.jsx)(X.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)(I.Z,{checked:mt[P.bk],label:(0,g.jsx)(v.ZP,{muted:!0,small:!0,children:"Unique upstream table names"}),onClick:function(e){(0,Ie.j)(e),tr((0,i.Z)({},P.bk,!mt[P.bk]))}}),(0,g.jsx)("span",{children:"\xa0"}),(0,g.jsx)(ne.kI,{muted:!0})]})}),(0,g.jsx)(h.Z,{mr:1})]})]})}),No.length>=1&&(0,g.jsx)(b.y9,{normalPadding:!0,children:(0,g.jsx)(m.Z,{children:No.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)(X.Z,{block:!0,description:t,size:null,widthFitContent:!0,children:(0,g.jsx)(f.Z,{children:o})})},o)}))})}),Mn.length>=1&&!Yn&&E.f2.includes(Pn)&&!ut&&!wn&&(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:[!at&&"Positional arguments for ".concat(st?"":"decorated ","function:"),at&&(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===Mn||void 0===Mn?void 0:Mn[0]})," into a table."]})]})}),(0,g.jsxs)(h.Z,{mt:1,children:[!at&&!st&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,small:!0,children:[E.tf.DATA_EXPORTER===Pn&&"@data_exporter",E.tf.DATA_LOADER===Pn&&"@data_loader",E.tf.TRANSFORMER===Pn&&"@transformer",E.tf.CUSTOM===Pn&&"@custom"]}),(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,small:!0,children:["def ",(E.tf.DATA_EXPORTER===Pn?"export_data":E.tf.DATA_LOADER===Pn&&"load_data")||E.tf.TRANSFORMER===Pn&&"transform"||E.tf.CUSTOM===Pn&&"transform_custom","(",Mn.map((function(e,n){return n>=1?"data_".concat(n+1):"data"})).join(", "),"):"]})]}),st&&(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,small:!0,children:[E.tf.DATA_EXPORTER===Pn?"export_data":E.tf.TRANSFORMER===Pn&&"transform","\xa0\u2190 function(",Mn.map((function(e,n){return"df_".concat(n+1)})).join(", "),"):"]})}),at&&(null===Mn||void 0===Mn?void 0:Mn.length)>=1&&(0,g.jsx)(Ae,{block:F,blockConfiguration:mt,blockRefs:G,blocks:null===Mn||void 0===Mn?void 0:Mn.map((function(e){return null===go||void 0===go?void 0:go[e]})),updateBlockConfiguration:tr}),!at&&Mn.map((function(e,n){var t=go[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:[!at&&!st&&(0,g.jsxs)(v.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:["\xa0\xa0\xa0\xa0data",n>=1?"_".concat(n+1):null]}),at&&(0,g.jsx)(v.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:r}),st&&(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)(K.Z,{color:o,onClick:function(){var e,n,o=null===G||void 0===G||null===(e=G.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)}))]})]}),!In&&(0,g.jsx)(g.Fragment,{children:Yn?(0,g.jsx)(h.Z,{px:1,children:(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,children:["(",(0,N._6)("line",null===$n||void 0===$n?void 0:$n.split(/\r\n|\r|\n/).length)," collapsed)"]})}):!dt||jt?Yo?(0,g.jsx)(h.Z,{px:1,children:(0,g.jsxs)(v.ZP,{monospace:!0,muted:!0,children:["Replicated from block ",(0,g.jsx)(K.Z,{color:(0,b.qn)(null===Yo||void 0===Yo?void 0:Yo.type,{blockColor:null===Yo||void 0===Yo?void 0:Yo.color,theme:Zn}).accent,onClick:function(e){var n,t;(0,Ie.j)(e);var o=null===G||void 0===G||null===(n=G.current)||void 0===n?void 0:n["".concat(null===Yo||void 0===Yo?void 0:Yo.type,"s/").concat(null===Yo||void 0===Yo?void 0:Yo.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===Yo||void 0===Yo?void 0:Yo.type,{blockColor:null===Yo||void 0===Yo?void 0:Yo.color,theme:Zn}).accent,inline:!0,monospace:!0,children:null===Yo||void 0===Yo?void 0:Yo.uuid})})]})}):Xo:ir}),be&&c.cloneElement(be,{runBlockAndTrack:jo}),In&&(0,g.jsxs)(h.Z,{p:M.cd,children:[(0,g.jsx)(v.ZP,{bold:!0,danger:!0,children:null===In||void 0===In?void 0:In.error}),(0,g.jsx)(v.ZP,{muted:!0,children:null===In||void 0===In?void 0:In.message})]}),Co&&tt&&tt>Bt&&(0,g.jsx)(b.HC,{children:(0,g.jsxs)(v.ZP,{muted:!0,children:["".concat(Math.round((tt-Bt)/1e3)),"s"]})}),!Yn&&![E.tf.CALLBACK,E.tf.CONDITIONAL,E.tf.EXTENSION].includes(Pn)&&(0,g.jsx)(y,{block:F,blocks:B,openSidekickView:nn,pipeline:tn})]})),$o]})]}),!Ye&&(0,g.jsxs)(b.gE,{additionalZIndex:rr-H,onMouseEnter:function(){return Hn(!0)},onMouseLeave:function(){Hn(!1),null===an||void 0===an||an(null)},children:[Fn&&k&&(0,g.jsx)(h.Z,{mt:2,mx:2,style:{width:"100%"},children:(0,g.jsx)(d.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,o=(0,ie.eY)(F,e),r=(0,ie.fA)(tn,F,e).map((function(e){var n=qe({},go[e]||{}),t=n.upstream_blocks;return t&&(n.upstream_blocks=t.filter((function(e){return e!==Nn}))),n}));return[E.tf.DATA_LOADER,E.tf.TRANSFORMER].includes(Pn)&&E.tf.SCRATCHPAD===e.type&&(n="from mage_ai.data_preparation.variable_manager import get_variable\n\n\n df = get_variable('".concat(ct,"', '").concat(Nn,"', 'output_0')")),n=(0,Ne.X7)(e,n),E.t6.SQL===Rn&&(t=qe(qe({},(0,Ge.GL)(Bn,[P.cH,P.Sv,P.sc,P.BD,P.nq])),t)),E.t6.SQL===e.language&&(n=(0,Ne.SF)(n)),k(qe(qe({},e),{},{configuration:t,content:n,upstream_blocks:o}),r)},blockIdx:H,blockTemplates:Q,compact:!0,hideCustom:ut,hideDbt:ut,onClickAddSingleDBTModel:$e,pipeline:tn,project:on,setAddNewBlockMenuOpenIdx:an,setCreatingNewDBTModel:dn,showBrowseTemplates:xn,showConfigureProjectModal:jn})}),(0,g.jsx)(b.t1,{className:"block-divider-inner"})]})]})})}var Ye=c.forwardRef(Ve)},59582:function(e,n,t){t.d(n,{Z:function(){return v}});var o,r=t(21831),i=t(86422),c=t(82394),u=t(75582),l=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,c.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 c=t.slice(0,r-i).join(l.sep);o=n["".concat(c,".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,c=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 C=[],_=x.getValueInRange({endColumn:j.column,endLineNumber:j.lineNumber,startColumn:1,startLineNumber:1}),Z=x.getWordUntilPosition(j),O=Z.endColumn,k=Z.startColumn,y={endColumn:O,endLineNumber:j.lineNumber,startColumn:k,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 c=i.assignmentValue,u=(0,a.S0)(e)[c];if(u){var l,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,c);return null===s||void 0===s||null===(l=s.methods_for_class)||void 0===l?void 0:l[d]}}return[]}(_,y,g);if((null===E||void 0===E?void 0:E.length)>=1){var T=h(Z,E.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Method,label:e,range:y}})));if(T.length>=1)return{suggestions:T}}var I=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[]}(_,y,g);if((null===I||void 0===I?void 0:I.length)>=1){var S=h(Z,I.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Function,label:e,range:y}})));if(S.length>=1)return{suggestions:S}}if((null===b||void 0===b?void 0:b.length)>=1){var R=new RegExp("\n@".concat(v));_.match(R)&&C.push.apply(C,(0,r.Z)(h(Z,function(e,n,t){var o=t.block,r=t.blocks,i=o.upstream_blocks,c=(0,f.HK)(r,(function(e){return e.uuid}));return i.map((function(t,o){var r=c[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,y,e))))}if(Z.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,c=(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(l.sep,"."),f[i]=e}var c=t.replace(".py","").replace("/__init__","").split(l.sep);if(1===c.length)s.add("import ".concat(c[0]));else if(c.length>=2){var u=c.slice(0,c.length-1).join(".");s.add("from ".concat(u," import ").concat(c[c.length-1]))}r.forEach((function(e){return s.add(e)}))}));var p,m="i"===c,h="f"===c,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,C=g.files,_=g.functions,Z=[];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){Z.push({filterText:"import ".concat(e),insertText:"import ".concat(e),kind:o,label:e,range:i})}))})),C.forEach((function(e){var n=e.split(l.sep),o=n[n.length-1].split(".py")[0];Z.push({filterText:"import ".concat(o),insertText:"import ".concat(o),kind:t.languages.CompletionItemKind.Variable,label:o,range:i})})),Z}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,_,Z,t,y,e);C.push.apply(C,(0,r.Z)(A))}if(i.tf.CHART===v||i.tf.SCRATCHPAD===v){var w=[];if(i.tf.CHART===v?b.forEach((function(e,n){w.push({block:c.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")}}))}(c,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&&w.push({block:n,matchIndex:t,variableName:o})}))})),w.length>=1){var P,D=null===(P=_.split("\n")[j.lineNumber-1])||void 0===P?void 0:P.slice(0,Z.startColumn-1);if(D){var M=[];if(w.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,y,n),matchIndex:o})})),M.length>=1)return{suggestions:h(Z,(0,f.YC)(M,"matchIndex",{ascending:!1})[0].items)}}}1===k&&(i.tf.CHART===v?C.push.apply(C,(0,r.Z)(h(Z,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:y}}))))):i.tf.SCRATCHPAD===v&&C.push.apply(C,(0,r.Z)(h(Z,function(e,n,t){var o=t.block,r=t.blocks,c=t.pipeline;return r.reduce((function(t,r){var u=r.type,l=r.uuid;return o.uuid!==l&&[i.tf.DATA_LOADER,i.tf.TRANSFORMER].includes(u)?t.concat({label:"df ".concat(l," ").concat(u," block"),kind:e.languages.CompletionItemKind.Snippet,documentation:"Get the data from ".concat(u," block ").concat(l,"."),insertText:"from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(c.uuid,"', '").concat(l,"', 'output_0')\n"),range:n}):t}),[])}(t,y,e)))))}var N=new Set;c.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:y}}));C.push.apply(C,(0,r.Z)(h(Z,L)))}return{suggestions:C}}}}},27337:function(e,n,t){t.d(n,{iK:function(){return x},qy:function(){return j},hS:function(){return C},dP:function(){return g},n9:function(){return v},A2:function(){return b}});var o=t(26304),r=t(82394),i=t(28598);var c,u=function(e){var n=e.fill,t=void 0===n?"white":n,o=e.size;return(0,i.jsxs)("svg",{fill:"none",height:o,viewBox:"0 0 20 20",width:o,xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)("g",{clipPath:"url(#clip0_11802_82850)",children:[(0,i.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,i.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,i.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,i.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,i.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,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_11802_82850",children:(0,i.jsx)("rect",{fill:t,height:o,width:o})})})]})},l=t(86422),a=t(22341),s=t(98781),d=t(44162),f=["uuid"],p=["uuid"];function m(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?m(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var v={uuid:"Blocks"},b={uuid:"Pipelines"},g=[v,b],x=(c={},(0,r.Z)(c,l.tf.CALLBACK,a.AQ),(0,r.Z)(c,l.tf.CHART,a.GQ),(0,r.Z)(c,l.tf.CONDITIONAL,a.hW),(0,r.Z)(c,l.tf.CUSTOM,a.VS),(0,r.Z)(c,l.tf.DATA_EXPORTER,a.zS),(0,r.Z)(c,l.tf.DATA_LOADER,a.rH),(0,r.Z)(c,l.tf.DBT,a.xE),(0,r.Z)(c,l.tf.EXTENSION,a.Bf),(0,r.Z)(c,l.tf.MARKDOWN,a.$B),(0,r.Z)(c,l.tf.SENSOR,a.LM),(0,r.Z)(c,l.tf.TRANSFORMER,a.Sv),c),j=[{Icon:a.zQ,uuid:"All templates"}].concat([{uuid:l.tf.DATA_LOADER},{uuid:l.tf.TRANSFORMER},{selectedIconProps:{inverted:!0},uuid:l.tf.DATA_EXPORTER},{uuid:l.tf.SENSOR},{selectedIconProps:{inverted:!0},uuid:l.tf.CUSTOM},{uuid:l.tf.CHART},{selectedIconProps:{inverted:!0},uuid:l.tf.CALLBACK},{selectedIconProps:{inverted:!0},uuid:l.tf.CONDITIONAL},{uuid:l.tf.EXTENSION},{selectedBackgroundColor:null,uuid:l.tf.DBT},{selectedIconProps:{inverted:!0},uuid:l.tf.MARKDOWN}].map((function(e){var n=e.uuid,t=(0,o.Z)(e,f);return h({Icon:x[n],filterTemplates:function(e){return null===e||void 0===e?void 0:e.filter((function(e){return e.block_type===n}))},label:function(){return l.V4[n]},selectedBackgroundColor:function(e){return(0,d.qn)(n,{theme:e}).accent},uuid:n},t)}))),C=[{Icon:a.zQ,uuid:"All templates"}].concat([{Icon:a.X5,uuid:s.qL.PYTHON},{Icon:a.ZG,uuid:s.qL.INTEGRATION},{Icon:u,uuid:s.qL.STREAMING}].map((function(e){var n=e.uuid,t=(0,o.Z)(e,p);return h({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 s.G7[n]},uuid:n},t)})))},38639:function(e,n,t){t.d(n,{EN:function(){return y},FX:function(){return E},HS:function(){return C},Nk:function(){return m},Rd:function(){return p},SL:function(){return k},Tj:function(){return O},UE:function(){return Z},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),c=t(3055),u=t(49125),l=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:c.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,l.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,l.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),C=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),Z=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 ")})),O=o.default.div.withConfig({displayName:"indexstyle__CardTitleStyle",componentId:"sc-8sk2qr-11"})(["height:","px;"],2.5*u.iI),k=o.default.div.withConfig({displayName:"indexstyle__CardDescriptionStyle",componentId:"sc-8sk2qr-12"})(["height:","px;margin-top:","px;"],2.5*u.iI*2,1*u.iI),y=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),c=t.n(i),u=t(82684),l=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),C=t(32063),_=t(82531),Z=t(66166),O=t(3055),k={uuid:"Define"},y={uuid:"Document"},E=[k,y],T=t(49125),I=t(41422),S=t(72454),R=t(96510),A=t(9728),w=t(24141),P=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,w.i)().height,L=(O.Mz,(0,a.useRouter)()),U=(0,A.VI)(null,{},[],{uuid:"CustomTemplates/PipelineTemplateDetail"}),F=(0,r.Z)(U,1)[0],H=(0,u.useState)(!1),G=H[0],Q=H[1],z=(0,u.useState)(D),W=z[0],q=z[1],K=(0,u.useCallback)((function(e){Q(!0),q(e)}),[]),V=(0,Z.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)&&q(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!==W&&void 0!==W&&W.template_uuid):!G}),[J,W,G]),oe=(0,u.useState)(!1),re=oe[0],ie=oe[1],ce=(0,u.useState)(J?400:300),ue=ce[0],le=ce[1],ae=(0,l.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,l.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)):(q(n),Q(!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({},W),{},{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,W,he]),ge=(0,u.useMemo)((function(){return(0,P.jsx)(P.Fragment,{})}),[]),xe=(0,u.useMemo)((function(){return(0,P.jsxs)(h.Z,{flexDirection:"column",fullHeight:!0,children:[(0,P.jsx)(I.Yf,{children:(0,P.jsx)(d.Z,{noPadding:!0,onClickTab:function(e){ne(e)},selectedTabUUID:null===ee||void 0===ee?void 0:ee.uuid,tabs:E})}),(0,P.jsxs)(m.Z,{flexDirection:"column",children:[k.uuid===(null===ee||void 0===ee?void 0:ee.uuid)&&(0,P.jsxs)(P.Fragment,{children:[o&&(0,P.jsx)(b.Z,{mt:T.cd,px:T.cd,children:(0,P.jsxs)(g.ZP,{default:!0,children:["This pipeline template will be based off the pipeline ",(0,P.jsx)(c(),{as:"/pipelines/".concat(o),href:"/pipelines/[pipeline]",passHref:!0,children:(0,P.jsx)(v.Z,{bold:!0,default:!0,inline:!0,monospace:!0,openNewWindow:!0,children:o})}),"."]})}),(0,P.jsxs)(b.Z,{mt:T.cd,px:T.cd,children:[(0,P.jsxs)(b.Z,{mb:1,children:[(0,P.jsx)(g.ZP,{bold:!0,children:"Template UUID"}),(0,P.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,P.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===W||void 0===W?void 0:W.template_uuid)||""})]})]}),y.uuid===(null===ee||void 0===ee?void 0:ee.uuid)&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(b.Z,{mt:T.cd,px:T.cd,children:[(0,P.jsxs)(b.Z,{mb:1,children:[(0,P.jsx)(g.ZP,{bold:!0,children:"Name"}),(0,P.jsx)(g.ZP,{muted:!0,small:!0,children:"A human readable name for your template."})]}),(0,P.jsx)(j.Z,{onChange:function(e){return K((function(n){return M(M({},n),{},{name:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===W||void 0===W?void 0:W.name)||""})]}),(0,P.jsx)(b.Z,{mt:T.cd,px:T.cd,children:(0,P.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===W||void 0===W?void 0:W.description)||""})})]})]}),(0,P.jsx)(I.ig,{children:(0,P.jsx)(b.Z,{p:T.cd,children:(0,P.jsx)(h.Z,{children:(0,P.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,W]);return(0,P.jsx)(C.Z,{after:ge,before:xe,beforeHidden:re,beforeWidth:ue,leftOffset:S.k1,setBeforeHidden:ie,setBeforeWidth:le,children:(0,P.jsx)(p.Z,{blocks:X,height:B,heightOffset:O.Mz,noStatus:!0,pipeline:Y})})}},41422:function(e,n,t){t.d(n,{Nk:function(){return l},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),c=t(38639),u=(i.iI,40*i.iI),l=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-c.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 Q}});var o=t(82394),r=t(75582),i=t(56085),c=t(82684),u=t(65701),l=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),C=t(38435),_=t(82944),Z=t(82531),O=t(66166),k=t(86422),y=t(41422),E=t(82635),T=t(16115),I={uuid:"Define"},S={uuid:"Document"},R=[I,S],A=t(94353),w=t(49125),P=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 G(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 Q=function(e){var n=e.contained,t=e.defaultTab,H=e.heightOffset,Q=e.onCancel,z=e.onCreateCustomTemplate,W=e.onMutateSuccess,q=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,c.useState)(Number(new Date)),ne=ee[0],te=ee[1],oe=(0,c.useState)(!1),re=oe[0],ie=oe[1],ce=(0,c.useState)(t?R.find((function(e){return e.uuid===(null===t||void 0===t?void 0:t.uuid)})):R[0]),ue=ce[0],le=ce[1],ae=(0,c.useState)(!1),se=ae[0],de=ae[1],fe=(0,c.useState)(K),pe=fe[0],me=fe[1],he=(0,c.useCallback)((function(e){de(!0),me(e)}),[]),ve=Z.ZP.custom_templates.detail(!q&&V&&encodeURIComponent(V),{object_type:h.Z}).data,be=(0,c.useMemo)((function(){return q||(null===ve||void 0===ve?void 0:ve.custom_template)}),[ve,q]),ge=(0,O.Z)(be);(0,c.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)(Z.ZP.custom_templates.useCreate(),{onSuccess:function(e){return(0,M.wD)(e,{callback:function(e){var n=e.custom_template;W&&(null===W||void 0===W||W()),z?null===z||void 0===z||z(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),Ce=je[0],_e=je[1].isLoading,Ze=(0,a.Db)(Z.ZP.custom_templates.useUpdate(q?encodeURIComponent(null===q||void 0===q?void 0:q.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;W&&(null===W||void 0===W||W()),me(n),de(!1)},onErrorCallback:function(e,n){return $({errors:n,response:e})}})}}),Oe=(0,r.Z)(Ze,2),ke=Oe[0],ye=Oe[1].isLoading,Ee=(0,c.useMemo)((function(){return k.tf.MARKDOWN===(null===pe||void 0===pe?void 0:pe.block_type)}),[null===pe||void 0===pe?void 0:pe.block_type]),Te=!q&&!V,Ie=(0,c.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]),Se=Z.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),Re=Se.data,Ae=Se.mutate,we=null===Re||void 0===Re?void 0:Re.kernels,Pe=(null===we||void 0===we?void 0:we.find((function(e){return e.name===P.a_[P.qL.PYTHON]})))||(null===we||void 0===we?void 0:we[0]),De=(0,a.Db)(Z.ZP.kernels.useUpdate(null===Pe||void 0===Pe?void 0:Pe.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,c.useCallback)((function(){Me({kernel:{action_type:"interrupt"}}),Ge([])}),[Me]),Be=(0,c.useState)({}),Le=Be[0],Ue=Be[1],Fe=(0,c.useState)([]),He=Fe[0],Ge=Fe[1],Qe=(0,c.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]),ze=(0,c.useMemo)((function(){return new d.Z}),[]),We=(0,c.useMemo)((function(){return{api_key:A.l,token:ze.decodedToken.token}}),[ze]),qe=(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 G(G({},e),{},(0,o.Z)({},r,t.concat(n)))})),E.uF.BUSY===t?Ge((function(e){return e.find((function(e){var n=e.uuid;return r===n}))||!Qe?e:e.concat(Qe)})):E.uF.IDLE===t&&Ge((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,c.useCallback)((function(e){var n=e.block,t=e.code,o=e.ignoreAlreadyRunning,r=e.runDownstream,i=void 0!==r&&r,c=e.runIncompleteUpstream,u=void 0!==c&&c,l=e.runSettings,a=void 0===l?{}:l,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||(qe(JSON.stringify(G(G({},We),{},{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})),Ge((function(e){return e.find((function(e){var n=e.uuid;return h===n}))?e:e.concat(n)})))}),[He,qe,Ue,Ge,We]),Ve=(0,c.useMemo)((function(){return He.reduce((function(e,n,t){return G(G({},e),{},(0,o.Z)({},n.uuid,G(G({},n),{},{priority:t})))}),{})}),[He]),Ye=(0,c.useMemo)((function(){if(!re)return(0,F.jsx)("div",{});var e=Ve[null===Qe||void 0===Qe?void 0:Qe.uuid],n=e?0===e.priority?E.uF.BUSY:E.uF.QUEUED:E.uF.IDLE;return(0,F.jsx)(m.Z,{block:Qe,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===Qe||void 0===Qe?void 0:Qe.uuid],noDivider:!0,onChange:function(e){return he((function(n){return G(G({},n),{},{content:e})}))},runBlock:Ke,runningBlocks:He,selected:!0,setErrors:$,textareaFocused:!0},String(ne))}),[Qe,ne,Ne,Le,re,Ke,He,Ve,he,$,pe]),Xe=(0,c.useCallback)((function(){var e={custom_template:G(G({},pe),{},{language:Ee?k.t6.MARKDOWN:null===pe||void 0===pe?void 0:pe.language,object_type:h.Z})};Te?Ce(e):ke(e)}),[Ce,Ee,Te,pe,ke]),Je="CustomTemplates/TemplateDetail",$e=(0,L.y)(),en=$e.registerOnKeyDown,nn=$e.unregisterOnKeyDown;(0,c.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,c.useMemo)((function(){return Y-H}),[Y,H]);return(0,F.jsxs)(y.Nk,{children:[(0,F.jsx)(y.bC,{height:n?tn:null,children:(0,F.jsxs)(b.Z,{flexDirection:"column",fullHeight:!0,children:[(0,F.jsx)(y.Yf,{children:(0,F.jsx)(p.Z,{noPadding:!0,onClickTab:function(e){le(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:[I.uuid===(null===ue||void 0===ue?void 0:ue.uuid)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(g.Z,{mt:w.cd,px:w.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 G(G({},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:w.cd,px:w.cd,children:(0,F.jsx)(x.Z,{label:"Block type",onChange:function(e){return he((function(n){return G(G({},n),{},{block_type:e.target.value,language:k.tf.MARKDOWN===e.target.value?k.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(k.tf).map((function(e){return(0,F.jsx)("option",{value:e,children:k.V4[e]},e)}))})}),!Ee&&(0,F.jsx)(g.Z,{mt:w.cd,px:w.cd,children:(0,F.jsx)(x.Z,{label:"Language",onChange:function(e){return he((function(n){return G(G({},n),{},{language:e.target.value})}))},primary:!0,value:(null===pe||void 0===pe?void 0:pe.language)||"",children:Object.values(k.t6).map((function(e){return(0,F.jsx)("option",{value:e,children:k.LE[e]},e)}))})})]}),S.uuid===(null===ue||void 0===ue?void 0:ue.uuid)&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(g.Z,{mt:w.cd,px:w.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 G(G({},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:w.cd,px:w.cd,children:(0,F.jsx)(C.Z,{label:"Description",onChange:function(e){return he((function(n){return G(G({},n),{},{description:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===pe||void 0===pe?void 0:pe.description)||""})})]})]}),(0,F.jsx)(y.ig,{children:(0,F.jsx)(g.Z,{p:w.cd,children:(0,F.jsxs)(b.Z,{children:[(0,F.jsxs)(f.Z,{disabled:Ie,fullWidth:!0,loading:_e||ye,onClick:function(){return Xe()},primary:!0,children:[!Te&&"Save template",Te&&"Create new template"]}),Q&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(g.Z,{mr:1}),(0,F.jsx)(f.Z,{onClick:Q,secondary:!0,children:"Cancel"})]})]})})})]})}),(0,F.jsx)(y.w5,{children:(0,F.jsx)(g.Z,{p:w.cd,children:(0,F.jsx)(u.W,{backend:l.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),c=t(73942),u=t(49125),l=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;"," "," "," "," "," "," "," "," "," ",""],c.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,l.qn)(i.tf.SCRATCHPAD,e).accent,";\n ")}),(function(e){return e.blue&&"\n background-color: ".concat((0,l.qn)(i.tf.DATA_LOADER,e).accent,";\n ")}),(function(e){return e.purple&&"\n background-color: ".concat((0,l.qn)(i.tf.TRANSFORMER,e).accent,";\n ")}),(function(e){return e.sky&&"\n background-color: ".concat((0,l.qn)(i.tf.MARKDOWN,e).accent,";\n ")}),(function(e){return e.teal&&"\n background-color: ".concat((0,l.qn)(i.tf.EXTENSION,e).accent,";\n ")}),(function(e){return e.rose&&"\n background-color: ".concat((0,l.qn)(i.tf.CALLBACK,e).accent,";\n ")}),(function(e){return e.yellow&&"\n background-color: ".concat((0,l.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 "}))},28317:function(e,n,t){t.d(n,{Z:function(){return ve}});var o=t(82394),r=t(21831),i=t(82684),c=t(75582),u=t(83455),l=t(67429),a=t(72470),s=t(60328),d=t(47999),f=t(93461),p=t(67971),m=t(30264),h=t(79749),v=t(10919),b=t(28598);var g=function(e){var n=e.fill,t=void 0===n?"white":n,o=e.size;return(0,b.jsxs)("svg",{fill:"none",height:o,viewBox:"0 0 20 21",width:o,xmlns:"http://www.w3.org/2000/svg",children:[(0,b.jsx)("g",{clipPath:"url(#clip0_11802_82284)",children:(0,b.jsx)("path",{clipRule:"evenodd",d:"M10 20.0024C15.5228 20.0024 20 15.5253 20 10.0024C20 4.47959 15.5228 0.00244141 10 0.00244141C4.47715 0.00244141 0 4.47959 0 10.0024C0 15.5253 4.47715 20.0024 10 20.0024ZM10 18.5024C11.5782 18.5024 13.0559 18.0723 14.3224 17.323C14.3144 17.3061 14.307 17.2888 14.3002 17.2712L11.5045 10.0024H8.49587L5.70021 17.2712C5.69339 17.2889 5.68596 17.3062 5.67796 17.3231C6.94434 18.0724 8.42195 18.5024 10 18.5024ZM11.6336 6.15938L15.5784 16.416C17.3685 14.8577 18.5 12.5622 18.5 10.0024C18.5 5.30802 14.6944 1.50244 10 1.50244C5.30558 1.50244 1.5 5.30802 1.5 10.0024C1.5 12.5623 2.63162 14.8579 4.4219 16.4163L8.36685 6.15939C8.94212 4.66367 11.0583 4.66367 11.6336 6.15938Z",fill:t,fillRule:"evenodd"})}),(0,b.jsx)("defs",{children:(0,b.jsx)("clipPath",{id:"clip0_11802_82284",children:(0,b.jsx)("rect",{fill:t,height:"20",transform:"translate(0 0.00244141)",width:"20"})})})]})},x=t(29237),j=t(91835),C=t(93812),_=t(40656),Z=t(22341);function O(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 k(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?O(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var y,E=function(e){var n=(0,j.Z)({},e),t=(null===n||void 0===n?void 0:n.size)||_.C,o=(0,Z.J_)([{clipRule:"evenodd",d:"M15.4697 1.47202C16.3149 0.62684 17.6852 0.62684 18.5304 1.47202C19.3756 2.3172 19.3756 3.6875 18.5304 4.53268L10.7445 12.3186C10.5002 12.5629 10.1891 12.7294 9.85027 12.7972L9.11804 12.9436C7.89353 13.1885 6.81392 12.1089 7.05882 10.8844L7.20527 10.1522C7.27302 9.81337 7.43954 9.50222 7.68384 9.25792L15.4697 1.47202ZM17.4697 2.53268C17.2104 2.27329 16.7898 2.27329 16.5304 2.53268L14.7522 4.31085L15.6916 5.25019L17.4697 3.47202C17.7291 3.21263 17.7291 2.79207 17.4697 2.53268ZM14.6309 6.31085L13.6916 5.37151L8.7445 10.3186C8.7096 10.3535 8.68582 10.3979 8.67614 10.4463L8.52969 11.1786C8.4947 11.3535 8.64893 11.5077 8.82386 11.4727L9.5561 11.3263C9.60449 11.3166 9.64894 11.2928 9.68384 11.2579L14.6309 6.31085Z",fillRule:"evenodd"},{clipRule:"evenodd",d:"M2.12221 16.4212C1.89178 16.7635 1.42775 16.8555 1.08405 16.6264C0.739408 16.3966 0.646278 15.931 0.876042 15.5863L1.50008 16.0023C0.876042 15.5863 0.87632 15.5859 0.876609 15.5855L0.877248 15.5845L0.878742 15.5823L0.882593 15.5766L0.893746 15.5605C0.902714 15.5476 0.914758 15.5306 0.929868 15.51C0.96007 15.4687 1.00264 15.4126 1.05749 15.345C1.16699 15.2102 1.32669 15.0283 1.53609 14.8278C1.95274 14.4289 2.58034 13.9427 3.41428 13.6164C5.14688 12.9384 7.5533 13.0314 10.475 15.4219C13.0533 17.5314 14.8969 17.4384 16.0393 16.9914C16.6428 16.7552 17.109 16.3976 17.4267 16.0934C17.5845 15.9424 17.7021 15.8078 17.7782 15.7142C17.8161 15.6675 17.8434 15.6313 17.8598 15.6089C17.868 15.5977 17.8735 15.5899 17.8762 15.586C17.8769 15.585 17.8774 15.5843 17.8777 15.5838L17.877 15.5849C18.1069 15.2409 18.5717 15.1487 18.9161 15.3783C19.2608 15.6081 19.3539 16.0737 19.1241 16.4184L18.5001 16.0023C19.1241 16.4184 19.1238 16.4188 19.1236 16.4192L19.1229 16.4202L19.1214 16.4224L19.1176 16.4281L19.1064 16.4442C19.0974 16.4571 19.0854 16.4741 19.0703 16.4947C19.0401 16.536 18.9975 16.5921 18.9427 16.6597C18.8332 16.7945 18.6735 16.9764 18.4641 17.1769C18.0474 17.5758 17.4198 18.062 16.5859 18.3883C14.8533 19.0663 12.4469 18.9733 9.52515 16.5828C6.94686 14.4733 5.10328 14.5663 3.96088 15.0133C3.35732 15.2495 2.89117 15.6071 2.57345 15.9113C2.41566 16.0623 2.29802 16.1969 2.22197 16.2905C2.18405 16.3372 2.15679 16.3734 2.14036 16.3958C2.13215 16.407 2.12668 16.4148 2.12396 16.4187C2.12332 16.4196 2.12254 16.4207 2.12221 16.4212ZM2.12221 16.4212C2.1222 16.4212 2.12221 16.4212 2.12221 16.4212V16.4212Z",fillRule:"evenodd"}],{viewBox:"0 0 20 21"});return(0,b.jsxs)(C.ZP,k(k({},n),{},{size:t,viewBox:null,children:[(0,b.jsx)("g",{clipPath:"url(#clip0_11826_796)",id:"Type / Scratchpad",children:(0,b.jsx)("g",{id:"Vector",children:o(k(k({},n),{},{size:t}))})}),(0,b.jsx)("defs",{children:(0,b.jsx)("clipPath",{id:"clip0_11826_796",children:(0,b.jsx)("rect",{fill:"white",height:"20",transform:"translate(0 0.00244141)",width:"20"})})})]}))};!function(e){e.BLOCK_ACTION_OBJECTS="block_action_objects"}(y||(y={}));var T=t(86673),I=t(19711),S=t(82944),R=t(46261),A=t(82531),w=t(86422),P=t(27337),D=t(38626),M=t(23831),N=t(73942),B=t(49125),L=t(37391),U=t(90880),F=B.cd*B.iI,H=D.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1mqygp5-0"})([""," border-radius:","px;"," "," "," "," ",""],(0,U.eR)(),N.n_,(function(e){return"\n background-color: ".concat((e.theme.background||M.Z.background).dashboard,";\n box-shadow: ").concat((e.theme.shadow||M.Z.shadow).frame,";\n ")}),(function(e){return!e.focused&&"\n border: 1px solid ".concat((e.theme.interactive||M.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.focused&&"\n border: 1px solid ".concat((e.theme.interactive||M.Z.interactive).hoverBorder,";\n ")}),(function(e){return!e.compact&&"\n padding-left: ".concat(2.5*B.iI,"px;\n padding-right: ").concat(2.5*B.iI,"px;\n ")}),(function(e){return e.compact&&"\n padding-left: ".concat(1.5*B.iI,"px;\n padding-right: ").concat(1.5*B.iI,"px;\n ")})),G=D.default.div.withConfig({displayName:"indexstyle__DividerStyle",componentId:"sc-1mqygp5-1"})(["height:","px;width:1px;",""],F,(function(e){return"\n background-color: ".concat((e.theme.interactive||M.Z.interactive).defaultBorder,";\n ")})),Q=D.default.div.withConfig({displayName:"indexstyle__ButtonWrapper",componentId:"sc-1mqygp5-2"})(["position:relative;"," "," ",""],(function(e){return e.increasedZIndex&&"\n z-index: 3;\n "}),(function(e){return!e.compact&&"\n padding-bottom: ".concat(2.5*B.iI,"px;\n padding-top: ").concat(2.5*B.iI,"px;\n ")}),(function(e){return e.compact&&"\n padding-bottom: ".concat(1.5*B.iI,"px;\n padding-top: ").concat(1.5*B.iI,"px;\n ")})),z=D.default.div.withConfig({displayName:"indexstyle__TextInputFocusAreaStyle",componentId:"sc-1mqygp5-3"})(["width:100%;&:hover{cursor:text;}"," ",""],(function(e){return!e.compact&&"\n height: ".concat(2.5*B.iI,"px;\n ")}),(function(e){return e.compact&&"\n height: ".concat(1.5*B.iI,"px;\n ")})),W=D.default.div.withConfig({displayName:"indexstyle__SearchStyle",componentId:"sc-1mqygp5-4"})(["position:relative;width:100%;"]),q=D.default.div.withConfig({displayName:"indexstyle__DropdownStyle",componentId:"sc-1mqygp5-5"})([""," border-radius:","px;max-height:","px;overflow:auto;position:absolute;width:100%;z-index:1;"," ",""],L.w5,N.BG,40*B.iI,(function(e){return"\n background-color: ".concat((e.theme.background||M.Z.background).popup,";\n box-shadow: ").concat((e.theme.shadow||M.Z.shadow).popup,";\n ")}),(function(e){return e.topOffset&&"\n top: ".concat(e.topOffset,"px;\n ")})),K=D.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-1mqygp5-6"})(["align-items:center;display:flex;justify-content:space-between;padding:","px ","px;position:relative;z-index:2;&:hover{cursor:pointer;}",""],1.5*B.iI,2.5*B.iI,(function(e){return e.highlighted&&"\n background-color: ".concat((e.theme.interactive||M.Z.interactive).hoverBackground,";\n ")})),V=t(16115),Y=t(11366),X=t(91427),J=t(44162),$=t(84212),ee=t(96510),ne=t(66653),te=t(9728),oe=t(41150);function re(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 ie(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?re(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):re(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ce=function(e){var n,t=e.addNewBlock,o=e.blockIdx,r=e.blockTemplatesByBlockType,j=e.compact,C=e.focused,_=e.itemsDBT,O=e.pipelineType,k=e.project,D=e.searchTextInputRef,M=e.setAddNewBlockMenuOpenIdx,N=e.setFocused,L=e.showBrowseTemplates,U=e.showConfigureProjectModal,re=(0,i.useRef)(null),ce=(0,i.useRef)(null),ue=(0,i.useRef)(null),le=(0,i.useRef)(null),ae="undefined"!==typeof D?D:le,se=(0,i.useMemo)((function(){return"AddNewBlocksV2/".concat(o)}),[o]),de=(0,te.VI)(null,{},[],{uuid:"AddNewBlocksV2/".concat(o)}),fe=(0,c.Z)(de,1)[0],pe=(0,i.useState)(null),me=pe[0],he=pe[1],ve=(0,i.useState)(!1),be=ve[0],ge=ve[1],xe=(0,i.useState)(null),je=xe[0],Ce=xe[1],_e=(0,i.useState)(null),Ze=_e[0],Oe=_e[1],ke=(0,i.useState)(null),ye=ke[0],Ee=ke[1],Te=(0,i.useCallback)((function(e){Ee(e),(0,X.t8)(Y.Ch,e)}),[]);(0,i.useEffect)((function(){if(null===ye){var e=(0,X.U2)(Y.Ch,!1);Te(e)}}),[Te,ye]);var Ie=(0,i.useMemo)((function(){return"undefined"!==typeof C?C:be}),[C,be]),Se=(0,i.useCallback)((function(e){return"undefined"!==typeof N?N(e):ge(e)}),[N,ge]),Re=(0,oe.y)(),Ae=Re.registerOnKeyDown,we=Re.unregisterOnKeyDown;(0,i.useEffect)((function(){return function(){return we(se)}}),[we,se]),null===Ae||void 0===Ae||Ae(se,(function(e,n){var t;Ie&&(n[V.vP]&&(Se(!1),null===ae||void 0===ae||null===(t=ae.current)||void 0===t||t.blur()))}),[Ie,ae]);var Pe=(0,i.useCallback)((function(){return he(null)}),[]),De=(0,i.useCallback)((function(e){return null===M||void 0===M?void 0:M((function(n){return null===n||me!==e?o:null}))}),[o,me,M]),Me=(0,i.useMemo)((function(){var e,n;return null===(e=(0,$.hr)(t,w.tf.DATA_LOADER,O,{blockTemplatesByBlockType:r,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(w.tf.DATA_LOADER,"/").concat(w.t6.PYTHON)})))||void 0===n?void 0:n.items}),[t,r,O]),Ne=(0,i.useMemo)((function(){var e,n;return null===(e=(0,$.hr)(t,w.tf.DATA_EXPORTER,O,{blockTemplatesByBlockType:r,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(w.tf.DATA_EXPORTER,"/").concat(w.t6.PYTHON)})))||void 0===n?void 0:n.items}),[t,r,O]),Be=(0,i.useMemo)((function(){var e,n;return null===(e=(0,$.hr)(t,w.tf.TRANSFORMER,O,{blockTemplatesByBlockType:r,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(w.tf.TRANSFORMER,"/").concat(w.t6.PYTHON)})))||void 0===n?void 0:n.items}),[t,r,O]),Le=(0,i.useMemo)((function(){var e,n;return null===(e=(0,$.hr)(t,w.tf.SENSOR,O,{blockTemplatesByBlockType:r,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(w.tf.SENSOR,"/").concat(w.t6.PYTHON)})))||void 0===n?void 0:n.items}),[t,r,O]),Ue=(0,i.useCallback)((function(e){return[{isGroupingTitle:!0,label:function(){return"SQL"},uuid:"".concat(w.t6.SQL,"/").concat(e,"/group")},{label:function(){return"Base template (generic)"},onClick:function(){t({language:w.t6.SQL,type:e})},uuid:"".concat(w.t6.SQL,"/").concat(e,"/Base template (generic)")},{isGroupingTitle:!0,label:function(){return"R"},uuid:"".concat(w.t6.R,"/").concat(e,"/group")},{label:function(){return"Base template (generic)"},onClick:function(){t({language:w.t6.R,type:e})},uuid:"".concat(w.t6.R,"/").concat(e,"/Base template (generic)")}]}),[t]),Fe=(0,i.useMemo)((function(){return[{beforeIcon:(0,b.jsx)(Z.rH,{fill:(0,J.qn)(w.tf.DATA_LOADER).accent,size:F}),items:[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(w.t6.PYTHON).concat(w.tf.DATA_LOADER,"/group")}].concat(Me).concat(Ue(w.tf.DATA_LOADER)),label:function(){return w.V4[w.tf.DATA_LOADER]},uuid:"".concat(w.tf.DATA_LOADER,"/").concat(w.t6.PYTHON)},{beforeIcon:(0,b.jsx)(Z.Sv,{fill:(0,J.qn)(w.tf.TRANSFORMER).accent,size:F}),items:[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(w.t6.PYTHON).concat(w.tf.TRANSFORMER,"/group")}].concat(Be).concat(Ue(w.tf.TRANSFORMER)),label:function(){return w.V4[w.tf.TRANSFORMER]},uuid:"".concat(w.tf.TRANSFORMER,"/").concat(w.t6.PYTHON)},{beforeIcon:(0,b.jsx)(Z.zS,{fill:(0,J.qn)(w.tf.DATA_EXPORTER).accent,size:F}),items:[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(w.t6.PYTHON).concat(w.tf.DATA_EXPORTER,"/group")}].concat(Ne).concat(Ue(w.tf.DATA_EXPORTER)),label:function(){return w.V4[w.tf.DATA_EXPORTER]},uuid:"".concat(w.tf.DATA_EXPORTER,"/").concat(w.t6.PYTHON)},{beforeIcon:(0,b.jsx)(Z.LM,{fill:(0,J.qn)(w.tf.SENSOR).accent,size:F}),items:[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(w.t6.PYTHON).concat(w.tf.SENSOR,"/group")}].concat(Le),label:function(){return w.V4[w.tf.SENSOR]},uuid:"".concat(w.tf.SENSOR,"/").concat(w.t6.PYTHON)},{beforeIcon:(0,b.jsx)(Z.xE,{fill:(0,J.qn)(w.tf.DBT).accent,size:F}),items:_,label:function(){return w.V4[w.tf.DBT]},uuid:w.tf.DBT},{isGroupingTitle:!0,label:function(){return"Custom templates"},uuid:"custom_templates"},{beforeIcon:(0,b.jsx)(Z.zQ,{default:!0,size:F}),label:function(){return"Browse templates"},onClick:function(){return L({addNewBlock:t})},uuid:"browse_templates"},{beforeIcon:(0,b.jsx)(Z.o0,{default:!0,size:F}),label:function(){return"Create new template"},onClick:function(){return L({addNew:!0,addNewBlock:t})},uuid:"create_template"}]}),[t,Ue,Ne,Me,_,Le,Be,L]),He=(0,i.useMemo)((function(){return[{beforeIcon:(0,b.jsx)(Z.VS,{default:!0,size:F}),label:function(){return"Python block"},onClick:function(){t({language:w.t6.PYTHON,type:w.tf.CUSTOM})},uuid:"Python"},{beforeIcon:(0,b.jsx)(Z.VS,{default:!0,size:F}),label:function(){return"SQL block"},onClick:function(){t({language:w.t6.SQL,type:w.tf.CUSTOM})},uuid:"SQL"},{beforeIcon:(0,b.jsx)(Z.VS,{default:!0,size:F}),label:function(){return"R block"},onClick:function(){t({language:w.t6.R,type:w.tf.CUSTOM})},uuid:"R"},{beforeIcon:(0,b.jsx)(E,{default:!0,size:F}),label:function(){return"Scratchpad"},onClick:function(){t({language:w.t6.PYTHON,type:w.tf.SCRATCHPAD})},uuid:"scratchpad"}]}),[t]),Ge=(0,u.Db)(A.ZP.search_results.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.search_result;Oe(n)},onErrorCallback:function(e,n){return fe({errors:n,response:e})}})}}),Qe=(0,c.Z)(Ge,1)[0],ze=(0,i.useCallback)((function(e){clearTimeout(ue.current);var n=e.target.value;Ce(n),n?ue.current=setTimeout((function(){Qe({search_result:{pipeline_type:O,query:n,ratio:70,type:y.BLOCK_ACTION_OBJECTS}})}),500):Oe(null)}),[Qe,O,ue]),We=(0,i.useMemo)((function(){return(null===Ze||void 0===Ze?void 0:Ze.results)||[]}),[Ze]),qe=(0,i.useMemo)((function(){var e=null===Ze||void 0===Ze?void 0:Ze.uuid,n=null===We||void 0===We?void 0:We.map((function(n){return{itemObject:n,searchQueries:[e],value:null===n||void 0===n?void 0:n.uuid}}));if(e){var t={itemObject:{description:e,object_type:a.L.GENERATE_BLOCK,title:"Generate block using AI (beta)"},searchQueries:[e],value:"generate_block"};ye?n.push(t):n.unshift(t)}return n}),[We,Ze,ye]),Ke=(0,i.useMemo)((function(){return(0,b.jsx)(z,{compact:j,onClick:function(){var e;return null===ae||void 0===ae||null===(e=ae.current)||void 0===e?void 0:e.focus()}})}),[j,ae]),Ve=(0,i.useMemo)((function(){return!(null===k||void 0===k||!k.openai_api_key)}),[k]);return(0,b.jsx)(d.Z,{onClickOutside:Pe,open:!0,children:(0,b.jsx)(H,{compact:j,focused:Ie,children:(0,b.jsxs)(p.Z,{alignItems:"center",children:[(0,b.jsx)(Q,{compact:j,increasedZIndex:0===me,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:Fe,onClickCallback:Pe,open:0===me,parentRef:re,uuid:"button_templates",children:(0,b.jsx)(R.Z,{block:!0,label:"Add a block from a template",size:null,widthFitContent:!0,children:(0,b.jsx)(s.Z,{beforeIcon:(0,b.jsx)(Z.zQ,{secondary:0===me,size:F}),noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){e.preventDefault(),he((function(e){return 0===e?null:0})),De(0)},children:"Templates"})})})}),(0,b.jsx)(T.Z,{mr:3}),(0,b.jsx)(Q,{compact:j,increasedZIndex:1===me,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:He,onClickCallback:Pe,open:1===me,parentRef:ce,uuid:"button_custom",children:(0,b.jsx)(R.Z,{block:!0,label:"Add a blank custom block or scratchpad block",size:null,widthFitContent:!0,children:(0,b.jsx)(s.Z,{beforeIcon:(0,b.jsx)(Z.cW,{secondary:1===me,size:F}),noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){e.preventDefault(),he((function(e){return 1===e?null:1})),De(1)},children:"Custom"})})})}),(0,b.jsx)(T.Z,{mr:3}),(0,b.jsx)(Q,{compact:j,increasedZIndex:0===me,children:(0,b.jsx)(R.Z,{block:!0,label:"Add a markdown block for documentation",size:null,widthFitContent:!0,children:(0,b.jsx)(s.Z,{beforeIcon:(0,b.jsx)(g,{size:F}),noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){e.preventDefault(),t({language:w.t6.MARKDOWN,type:w.tf.MARKDOWN})},children:"Markdown"})})}),(0,b.jsx)(T.Z,{mr:3}),(0,b.jsx)(G,{}),(0,b.jsx)(T.Z,{mr:3}),(0,b.jsxs)(W,{children:[Ke,(0,b.jsxs)(p.Z,{alignItems:"center",fullWidth:!0,children:[(0,b.jsx)(S.Z,{fullWidth:!0,noBackground:!0,noBorder:!0,onBlur:function(){return setTimeout((function(){return Se(!1)}),150)},onChange:ze,onFocus:function(){return Se(!0)},paddingHorizontal:0,paddingVertical:0,placeholder:"Search for a block...",ref:ae,value:je||""}),(0,b.jsx)(h.Z,{addPlusSignBetweenKeys:!0,disabled:!0,keyTextGroups:[[V.RJ,V.ZS]]})]}),Ke,(0,b.jsx)(q,{topOffset:(null===ae||void 0===ae||null===(n=ae.current)||void 0===n?void 0:n.getBoundingClientRect().height)+(j?1.5*B.iI:2.5*B.iI),children:(0,b.jsx)(l.Z,{itemGroups:[{items:Ie?qe:[],renderItem:function(e,n){var t=e.itemObject,o=t.block_type,r=t.description,i=t.language,c=t.object_type,u=t.title,l={fill:(0,J.qn)(o).accent,size:F},s=P.iK[o],d=a.L.GENERATE_BLOCK===c;d&&(s=Z.xq,l.default=!1,l.fill=null,l.warning=!0);var p="".concat(u).concat(r?": "+r:"").slice(0,80);return(0,b.jsxs)(K,ie(ie({},n),{},{onClick:function(e){var t;(0,ne.j)(e),null===n||void 0===n||null===(t=n.onClick)||void 0===t||t.call(n,e)},children:[(0,b.jsxs)(f.Z,{alignItems:"center",flex:1,children:[s&&(0,b.jsx)(s,ie({default:!(null!==l&&void 0!==l&&l.fill)},l)),(0,b.jsx)(T.Z,{mr:2}),(0,b.jsx)(I.ZP,{default:!0,overflowWrap:!0,textOverflow:!0,children:p})]}),(0,b.jsx)(T.Z,{mr:1}),(0,b.jsx)(I.ZP,{monospace:!0,muted:!0,uppercase:!0,children:d?"AI":w.dO[i]}),(0,b.jsx)(T.Z,{mr:1}),a.L.BLOCK_FILE===c&&(0,b.jsx)(Z.$B,{muted:!0,size:F}),a.L.CUSTOM_BLOCK_TEMPLATE===c&&(0,b.jsx)(Z.zQ,{muted:!0,size:F}),a.L.MAGE_TEMPLATE===c&&(0,b.jsx)(Z.m1,{muted:!0,size:F}),d&&Ve&&(0,b.jsx)(Z.xq,{muted:!0,size:F}),d&&!Ve&&(0,b.jsx)(Z.uy,{muted:!0,size:F})]}))}}],onSelectItem:function(e){var n=e.itemObject,o=n.object_type;a.L.GENERATE_BLOCK!==o||Ve?(t({block_action_object:n}),Ce(null),Oe(null)):null===U||void 0===U||U({cancelButtonText:"Set this up later",header:(0,b.jsx)(T.Z,{mb:B.HN,children:(0,b.jsxs)(x.Z,{children:[(0,b.jsx)(I.ZP,{warning:!0,children:"You need to add an OpenAI API key to your project before you can generate blocks using AI."}),(0,b.jsx)(T.Z,{mt:1,children:(0,b.jsxs)(I.ZP,{warning:!0,children:["Read ",(0,b.jsx)(v.Z,{href:"https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key",openNewWindow:!0,children:"OpenAI\u2019s documentation"})," to get your API key."]})})]})}),onCancel:function(){Te(!0)},onSaveSuccess:function(e){null!==e&&void 0!==e&&e.openai_api_key&&(t({block_action_object:n}),Ce(null),Oe(null))}})},uuid:se})})]})]})})})};var ue=function(e){var n=e.size;return(0,b.jsx)("svg",{fill:"none",height:n,preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",width:n,xmlns:"http://www.w3.org/2000/svg",children:(0,b.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"})})},le=t(11135),ae=t(98781),se=t(46336),de=t(80906),fe=t(19140),pe=t(32238);function me(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 he(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?me(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):me(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ve=function(e){var n=e.addNewBlock,t=e.blockIdx,o=e.blockTemplates,c=e.compact,u=e.focusedAddNewBlockSearch,l=e.hideCustom,a=e.hideDataExporter,s=(e.hideDataLoader,e.hideDbt),f=e.hideMarkdown,h=e.hideScratchpad,v=e.hideSensor,g=e.hideTransformer,x=e.hideTransformerDataSources,j=e.onClickAddSingleDBTModel,C=e.pipeline,_=e.project,O=e.searchTextInputRef,k=e.setAddNewBlockMenuOpenIdx,y=e.setCreatingNewDBTModel,E=e.setFocusedAddNewBlockSearch,T=e.showBrowseTemplates,I=e.showConfigureProjectModal,S=(0,i.useState)(null),A=S[0],P=S[1],D=(0,i.useRef)(null),M=(0,i.useRef)(null),N=(0,i.useRef)(null),L=(0,i.useRef)(null),U=(0,i.useRef)(null),F=(0,i.useRef)(null),H=(0,i.useRef)(null),G={compact:c,inline:!0},Q=null===C||void 0===C?void 0:C.type,z=Q===ae.qL.STREAMING,W=c?fe.ZG/2:fe.ZG,q=25*B.iI,K=(0,i.useMemo)((function(){return(0,$.q_)(pe.c1,de.qs.COLUMN,n)}),[n]),V=(0,i.useMemo)((function(){return(0,$.q_)(pe.Wt,de.qs.ROW,n)}),[n]),Y=(0,i.useMemo)((function(){var e=[{label:function(){return"Generic (no template)"},onClick:function(){n({language:w.t6.PYTHON,type:w.tf.TRANSFORMER})},uuid:"generic_transformer_action"},{bold:!0,items:V,label:function(){return"Row actions"},uuid:"row_actions_grouping"},{isGroupingTitle:!0,label:function(){return"Column actions"},uuid:"column_actions_grouping"}].concat((0,r.Z)(K));return x||e.splice(1,0,{bold:!0,items:(0,$.hr)(n,w.tf.TRANSFORMER,Q),label:function(){return"Data sources"},uuid:"data_sources_grouping"}),e}),[n,K,x,Q,V]),X=(0,i.useCallback)((function(){return P(null)}),[]),J=(0,i.useCallback)((function(e){return null===k||void 0===k?void 0:k((function(n){return null===n||A!==e?t:null}))}),[t,A,k]),ee=ae.qL.PYSPARK===Q,ne=(0,i.useMemo)((function(){return(0,$.oM)(o,n)}),[n,o]),te=(0,i.useMemo)((function(){return(0,$.hr)(n,w.tf.DATA_LOADER,Q,{blockTemplatesByBlockType:ne,showBrowseTemplates:T})}),[n,ne,Q,T]),oe=(0,i.useMemo)((function(){return(0,$.hr)(n,w.tf.DATA_EXPORTER,Q,{blockTemplatesByBlockType:ne,showBrowseTemplates:T})}),[n,ne,Q,T]),re=(0,i.useMemo)((function(){return ee||ae.qL.INTEGRATION===Q?Y:z?[{items:(0,$.hr)(n,w.tf.TRANSFORMER,Q),label:function(){return"Python"},uuid:"transformers/python"}]:[{items:Y,label:function(){return"Python"},uuid:"transformers/python_all"}].concat((0,r.Z)((0,$.qs)(n,w.tf.TRANSFORMER)),(0,r.Z)((0,$.hr)(n,w.tf.TRANSFORMER,Q,{blockTemplatesByBlockType:ne,onlyCustomTemplate:!0,showBrowseTemplates:T})))}),[n,Y,ne,ee,z,Q,T]),ie=(0,i.useMemo)((function(){return[{label:function(){return"New model"},onClick:function(){null===y||void 0===y||y(!0),null===j||void 0===j||j(t)},uuid:"dbt/new_model"},{label:function(){return"Single model or snapshot (from file)"},onClick:function(){return null===j||void 0===j?void 0:j(t)},uuid:"dbt/single_model"},{label:function(){return"All models (w/ optional exclusion)"},onClick:function(){return n({configuration:{dbt:{command:"run"}},language:w.t6.YAML,type:w.tf.DBT})},uuid:"dbt/all_models"},{label:function(){return"Generic dbt command"},onClick:function(){return n({configuration:{dbt:{command:null}},language:w.t6.YAML,type:w.tf.DBT})},uuid:"dbt/generic_command"}]}),[n,t,j,y]);return(0,i.useMemo)((function(){var e;return ae.qL.PYTHON===Q&&!ee&&(null===_||void 0===_||null===(e=_.features)||void 0===e?void 0:e[se.d.ADD_NEW_BLOCK_V2])}),[ee,Q,_])?(0,b.jsx)(ce,{addNewBlock:n,blockIdx:t,blockTemplatesByBlockType:ne,compact:c,focused:u,itemsDBT:ie,pipelineType:Q,project:_,searchTextInputRef:O,setAddNewBlockMenuOpenIdx:k,setFocused:E,showBrowseTemplates:T,showConfigureProjectModal:I}):(0,b.jsx)(p.Z,{flexWrap:"wrap",inline:!0,children:(0,b.jsx)(d.Z,{onClickOutside:X,open:!0,children:(0,b.jsxs)(p.Z,{flexWrap:"wrap",children:[!a&&(0,b.jsx)(fe.W4,{increasedZIndex:0===A,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:te,onClickCallback:X,open:0===A,parentRef:D,uuid:"data_loader_button",children:(0,b.jsx)(le.ZP,he(he({},G),{},{beforeElement:(0,b.jsx)(fe.Wx,{blue:!0,compact:c,children:(0,b.jsx)(Z.mm,{size:W})}),onClick:function(e){e.preventDefault(),P((function(e){return 0===e?null:0})),J(0)},uuid:"AddNewBlocks/Data_loader",children:"Data loader"}))})}),!g&&(0,b.jsx)(fe.W4,{increasedZIndex:1===A,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:re,onClickCallback:X,open:1===A,parentRef:M,uuid:"transformer_button",children:(0,b.jsx)(le.ZP,he(he({},G),{},{beforeElement:(0,b.jsx)(fe.Wx,{compact:c,purple:!0,children:(0,b.jsx)(Z.mm,{size:W})}),onClick:function(e){e.preventDefault(),P((function(e){return 1===e?null:1})),J(1)},uuid:"AddNewBlocks/Transformer",children:"Transformer"}))})}),!a&&(0,b.jsx)(fe.W4,{increasedZIndex:2===A,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:oe,onClickCallback:X,open:2===A,parentRef:N,uuid:"data_exporter_button",children:(0,b.jsx)(le.ZP,he(he({},G),{},{beforeElement:(0,b.jsx)(fe.Wx,{compact:c,yellow:!0,children:(0,b.jsx)(Z.mm,{inverted:!0,size:W})}),onClick:function(e){e.preventDefault(),P((function(e){return 2===e?null:2})),J(2)},uuid:"AddNewBlocks/Data_exporter",children:"Data exporter"}))})}),!s&&(0,b.jsx)(fe.W4,{increasedZIndex:3===A,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:[].concat((0,r.Z)(ie),(0,r.Z)((0,$.hr)(n,w.tf.DBT,Q,{blockTemplatesByBlockType:ne,onlyCustomTemplate:!0,showBrowseTemplates:T}))),onClickCallback:X,open:3===A,parentRef:L,uuid:"dbt_button",children:(0,b.jsx)(le.ZP,he(he({},G),{},{beforeElement:(0,b.jsx)(ue,{size:fe.ZG*(c?.75:1.25)}),onClick:function(e){e.preventDefault(),P((function(e){return 3===e?null:3})),J(3)},uuid:"AddNewBlocks/DBT",children:"DBT model"}))})}),!l&&(0,b.jsx)(fe.W4,{increasedZIndex:4===A,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:[{items:(0,$.Bd)(n,w.tf.CUSTOM,w.t6.PYTHON),label:function(){return"Python"},uuid:"custom_block_python"},{items:(0,$.Bd)(n,w.tf.CUSTOM,w.t6.SQL),label:function(){return"SQL"},uuid:"custom_block_sql"}].concat((0,r.Z)((0,$.hr)(n,w.tf.CUSTOM,Q,{blockTemplatesByBlockType:ne,onlyCustomTemplate:!0,showBrowseTemplates:T}))),onClickCallback:X,open:4===A,parentRef:U,uuid:"custom_block_button",children:(0,b.jsx)(R.Z,{block:!0,label:"Add a custom code block with a designated color.",maxWidth:q,size:null,children:(0,b.jsx)(le.ZP,he(he({},G),{},{beforeElement:(0,b.jsx)(fe.Wx,{compact:c,grey:!0,children:(0,b.jsx)(Z.mm,{inverted:!0,size:W})}),onClick:function(e){e.preventDefault(),P((function(e){return 4===e?null:4})),J(4)},uuid:"AddNewBlocks/Scratchpad",children:"Custom"}))})})}),!h&&(0,b.jsx)(fe.W4,{children:(0,b.jsx)(R.Z,{block:!0,label:"Write experimental code that doesn\u2019t get executed when you run your pipeline.",maxWidth:q,size:null,children:(0,b.jsx)(le.ZP,he(he({},G),{},{beforeElement:(0,b.jsx)(fe.Wx,{border:!0,compact:c,children:(0,b.jsx)(Z.mm,{size:W})}),onClick:function(e){e.preventDefault(),n({type:w.tf.SCRATCHPAD})},uuid:"AddNewBlocks/Scratchpad",children:"Scratchpad"}))})}),!z&&!v&&(0,b.jsx)(fe.W4,{increasedZIndex:6===A,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:[].concat((0,r.Z)((0,$.hr)(n,w.tf.SENSOR,Q)),(0,r.Z)((0,$.hr)(n,w.tf.SENSOR,Q,{blockTemplatesByBlockType:ne,onlyCustomTemplate:!0,showBrowseTemplates:T}))),onClickCallback:X,open:6===A,parentRef:F,uuid:"sensor_button",children:(0,b.jsx)(le.ZP,he(he({},G),{},{beforeElement:(0,b.jsx)(fe.Wx,{compact:c,children:(0,b.jsx)(Z.LM,{pink:!0,size:fe.ZG*(c?.75:1.25)})}),onClick:function(e){e.preventDefault(),P((function(e){return 6===e?null:6})),J(6)},uuid:"AddNewBlocks/Sensor",children:"Sensor"}))})}),!f&&(0,b.jsx)(fe.W4,{increasedZIndex:7===A,children:(0,b.jsx)(m.Z,{disableKeyboardShortcuts:!0,items:[{label:function(){return"Generic (no template)"},onClick:function(){n({language:w.t6.MARKDOWN,type:w.tf.MARKDOWN})},uuid:"generic_markdown"}].concat((0,r.Z)((0,$.hr)(n,w.tf.MARKDOWN,Q,{blockTemplatesByBlockType:ne,onlyCustomTemplate:!0,showBrowseTemplates:T}))),onClickCallback:X,open:7===A,parentRef:H,uuid:"markdown_button",children:(0,b.jsx)(le.ZP,he(he({},G),{},{beforeElement:(0,b.jsx)(fe.Wx,{compact:c,sky:!0,children:(0,b.jsx)(Z.mm,{inverted:!0,size:W})}),onClick:function(e){e.preventDefault(),P((function(e){return 7===e?null:7})),J(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 E},hr:function(){return _},oM:function(){return C},q_:function(){return O},qs:function(){return j}});var o=t(21831),r=t(82394),i=t(67971),c=t(19711),u=t(32238),l=t(22341),a=t(86422),s=t(31524),d=t(98781),f=t(90211),p=t(44162),m=t(24224),h=t(28598);function v(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 b=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 g(e,n){return{label:function(){return"SQL"},onClick:function(){return e({language:a.t6.SQL,type:n})},uuid:"".concat(n,"/sql")}}function x(e,n){return{label:function(){return"R"},onClick:function(){return e({language:a.t6.R,type:n})},uuid:"".concat(n,"/r")}}var j=function(e,n){return[g(e,n),x(e,n)]};function C(e,n){var t={};return null===e||void 0===e||e.forEach((function(e){var o=e.block_type,i=e.description,c=e.groups,u=e.language,l=e.name,a=e.path,s=e.template_variables;t[o]||(t[o]={}),t[o][u]||(t[o][u]={items:[],label:function(){return u},uuid:"".concat(o,"/").concat(u)});var d={label:function(){return l},onClick:function(){return n({config:{template_path:a,template_variables:s},language:u,type:o})},tooltip:function(){return i},uuid:a};if((null===c||void 0===c?void 0:c.length)>=1){var f=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?v(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}({},t[o][u]),p=[null],m=[f];c.forEach((function(e,n){var t="".concat(o,"/").concat(u,"/").concat(c.slice(0,n+1).join("/")),r=m[n],i=r.items.findIndex((function(e){var n=e.uuid;return t===n})),l=i>=0?r.items[i]:null;l||(l={items:[],label:function(){return e},uuid:t}),p.push(i),m.push(l)})),p.push(-1),m.push(d);var h=m.length;t[o][u]=m.reduce((function(e,n,t){var o=h-t,r=m[o-2],i=m[o-1],c=p[o-1];return r?(c>=0?r.items[c]=i:r.items.push(i),r):i}),{})}else t[o][u].items.push(d)})),t}var _=function(e,n,t,o){var r=o||{},i=r.blockTemplatesByBlockType,c=r.languages,u=r.onlyCustomTemplate,l=r.showBrowseTemplates,s={};null!==o&&void 0!==o&&o.v2||(s=Object.fromEntries(a.Ut.map((function(n){return[n,b(n,e,t)]}))));var f={label:function(){return"Custom template"},onClick:function(){return l({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.STREAMING)return s[n];var p,h,v=(null===i||void 0===i||null===(p=i[n])||void 0===p||null===(h=p[a.t6.PYTHON])||void 0===h?void 0:h.items)||[],j=[{items:(0,m.YC)((s[n]||[]).concat(v),(function(e){return(0,e.label)()})),label:function(){return"Python"},uuid:"".concat(n,"/").concat(a.t6.PYTHON)}];return(!c||null!==c&&void 0!==c&&c.includes(a.t6.SQL))&&j.push(g(e,n)),(!c||null!==c&&void 0!==c&&c.includes(a.t6.R))&&j.push(x(e,n)),![a.tf.MARKDOWN,a.tf.SCRATCHPAD].includes(n)&&l&&j.push(f),j};function Z(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 O(e,n,t){var r=[];return e.forEach((function(e){if(e!==u._G.MISC)r.push({indent:!0,items:Z(u.d9[n][e],n,t),label:function(){return e},uuid:"".concat(n,"_grouping_").concat((0,f.RA)(e))});else{var i=Z(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,h.jsxs)(i.Z,{alignItems:"center",children:[(0,h.jsx)(l.mm,{fill:(0,p.qn)(a.tf.CUSTOM,{blockColor:o}).accent,size:16}),"\xa0",(0,h.jsx)(c.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 E(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),c=t(24224),u=t(90211);function l(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?l(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function 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,c=e.uuid;(null===r||void 0===r?void 0:r.length)>=1&&(n[c]=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][c]=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,c.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,c;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"}(c||(c={}))},45419:function(e,n,t){var o;t.d(n,{Q:function(){return o}}),function(e){e.CALLBACK="callbacks",e.CONDITIONAL="conditionals"}(o||(o={}))},72470:function(e,n,t){var o;t.d(n,{L:function(){return o}}),function(e){e.BLOCK_FILE="block_file",e.CUSTOM_BLOCK_TEMPLATE="custom_block_template",e.GENERATE_BLOCK="generate_block",e.MAGE_TEMPLATE="mage_template"}(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 l},JJ:function(){return u},JT:function(){return w},MP:function(){return M},Mi:function(){return I},Mv:function(){return _},PG:function(){return s},Pi:function(){return S},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 y},bn:function(){return B},c0:function(){return L},cH:function(){return b},e:function(){return a},eN:function(){return c},eW:function(){return Z},m$:function(){return C},m7:function(){return r},mW:function(){return k},nq:function(){return O},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",c="group_by",u="height",l="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",C="data_provider_table",_="dbt_profile_target",Z="dbt_project_name",O="export_write_policy",k="limit",y="unique_upstream_table_name",E="upstream_block_configuration",T="table_name",I="use_raw_sql",S="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 w,P,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"}(w||(w={})),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"}(P||(P={}));var M,N,B=[P.AVERAGE,P.COUNT,P.COUNT_DISTINCT,P.MAX,P.MEDIAN,P.MIN,P.MODE,P.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 l},cp:function(){return a},zJ:function(){return i}});var o,r,i,c=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 l=(o={},(0,c.Z)(o,i.AMAZON_SQS,"Amazon SQS"),(0,c.Z)(o,i.API,"API"),(0,c.Z)(o,i.AZURE_BLOB_STORAGE,"Azure Blob Storage"),(0,c.Z)(o,i.AZURE_DATA_LAKE,"Azure Data Lake"),(0,c.Z)(o,i.AZURE_EVENT_HUB,"Azure Event Hub"),(0,c.Z)(o,i.BIGQUERY,"Google BigQuery"),(0,c.Z)(o,i.DRUID,"Druid"),(0,c.Z)(o,i.DUMMY,"Dummy"),(0,c.Z)(o,i.FILE,"Local file"),(0,c.Z)(o,i.GENERIC,"Generic (no template)"),(0,c.Z)(o,i.GOOGLE_CLOUD_PUBSUB,"Google Cloud PubSub"),(0,c.Z)(o,i.GOOGLE_CLOUD_STORAGE,"Google Cloud Storage"),(0,c.Z)(o,i.KAFKA,"Kafka"),(0,c.Z)(o,i.KINESIS,"Kinesis"),(0,c.Z)(o,i.MONGODB,"MongoDB"),(0,c.Z)(o,i.MYSQL,"MySQL"),(0,c.Z)(o,i.OPENSEARCH,"OpenSearch"),(0,c.Z)(o,i.ORACLEDB,"OracleDB"),(0,c.Z)(o,i.POSTGRES,"PostgreSQL"),(0,c.Z)(o,i.RABBITMQ,"RabbitMQ"),(0,c.Z)(o,i.REDSHIFT,"Amazon Redshift"),(0,c.Z)(o,i.S3,"Amazon S3"),(0,c.Z)(o,i.SNOWFLAKE,"Snowflake"),o),a=(r={},(0,c.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,c.Z)(r,u.tf.DATA_EXPORTER,[i.GENERIC,i.FILE,i.S3,i.AZURE_BLOB_STORAGE,i.GOOGLE_CLOUD_STORAGE,i.REDSHIFT,i.BIGQUERY,i.SNOWFLAKE,i.MYSQL,i.POSTGRES]),(0,c.Z)(r,u.tf.TRANSFORMER,[i.REDSHIFT,i.BIGQUERY,i.SNOWFLAKE,i.POSTGRES]),(0,c.Z)(r,u.tf.SENSOR,[i.GENERIC,i.S3,i.REDSHIFT,i.BIGQUERY,i.SNOWFLAKE,i.MYSQL,i.POSTGRES]),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 c},n6:function(){return a},nB:function(){return h},oy:function(){return m},xF:function(){return d}});var o,r,i,c,u=t(82394),l=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"}(c||(c={}));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,l.t6.MARKDOWN),(0,u.Z)(o,i.JSON,i.JSON),(0,u.Z)(o,i.PY,l.t6.PYTHON),(0,u.Z)(o,i.R,l.t6.R),(0,u.Z)(o,i.SQL,l.t6.SQL),(0,u.Z)(o,i.TXT,"text"),(0,u.Z)(o,i.YAML,l.t6.YAML),(0,u.Z)(o,i.YML,l.t6.YAML),o),v=(r={},(0,u.Z)(r,l.t6.MARKDOWN,i.MD),(0,u.Z)(r,l.t6.PYTHON,i.PY),(0,u.Z)(r,l.t6.R,i.R),(0,u.Z)(r,l.t6.SQL,i.SQL),(0,u.Z)(r,l.t6.YAML,i.YAML),(0,u.Z)(r,"text",i.TXT),r)},33572:function(e,n,t){var o;t.d(n,{z:function(){return o}}),function(e){e.GENERATE_BLOCK_WITH_DESCRIPTION="generate_block_with_description",e.GENERATE_COMMENT_FOR_BLOCK="generate_comment_for_block",e.GENERATE_DOC_FOR_BLOCK="generate_doc_for_block",e.GENERATE_DOC_FOR_PIPELINE="generate_doc_for_pipeline"}(o||(o={}))},46336:function(e,n,t){var o,r;t.d(n,{d:function(){return o},k:function(){return r}}),function(e){e.ADD_NEW_BLOCK_V2="add_new_block_v2"}(o||(o={})),function(e){e.MAIN="main",e.STANDALONE="standalone",e.SUB="sub"}(r||(r={}))},32238:function(e,n,t){t.d(n,{NX:function(){return h},Wt:function(){return m},_G:function(){return l},c1:function(){return p},d9:function(){return f}});var o,r,i,c,u,l,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"}(l||(l={}));var f=(r={},(0,a.Z)(r,s.qs.COLUMN,(o={},(0,a.Z)(o,l.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,l.FORMATTING,[s.Q0.CLEAN_COLUMN_NAME,s.Q0.FIX_SYNTAX_ERRORS,s.Q0.REFORMAT]),(0,a.Z)(o,l.COLUMN_REMOVAL,[s.Q0.REMOVE,s.Q0.SELECT]),(0,a.Z)(o,l.SHIFT_ROWS,[s.Q0.SHIFT_DOWN,s.Q0.SHIFT_UP]),(0,a.Z)(o,l.MISC,[s.Q0.DIFF,s.Q0.IMPUTE,s.Q0.REMOVE_OUTLIERS]),(0,a.Z)(o,l.FEATURE_SCALING,[s.Q0.NORMALIZE,s.Q0.STANDARDIZE]),o)),(0,a.Z)(r,s.qs.ROW,(0,a.Z)({},l.MISC,[].concat(d))),r),p=Object.keys(f[s.qs.COLUMN]),m=[l.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,(c={},(0,a.Z)(c,s.Q0.DROP_DUPLICATE,"Drop duplicates"),(0,a.Z)(c,s.Q0.FILTER,"Filter"),(0,a.Z)(c,s.Q0.SORT,"Sort"),(0,a.Z)(c,s.Q0.REMOVE,"Remove rows"),c)),u)},30264:function(e,n,t){var o=t(82394),r=t(26304),i=(t(82684),t(47999)),c=t(62084),u=t(28598),l=["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,l),h=(0,u.jsxs)("div",{style:{position:"relative",zIndex:d?3:2},children:[(0,u.jsx)("div",{ref:f,children:n}),(0,u.jsx)(c.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),c=t(38626),u=t(93461),l=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=c.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*m.iI),j=c.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,c=e.description,m=e.disableWordBreak,b=e.fullWidth,C=e.inputValue,_=e.inputWidth,Z=e.invertedTheme,O=e.label,k=e.labelColor,y=e.menuOpen,E=void 0!==y&&y,T=e.monospace,I=e.muted,S=e.onClick,R=e.notRequired,A=e.selectedTextProps,w=e.small,P=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],G=(0,i.useState)(!1),Q=G[0],z=G[1],W=O&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.ZP,{bold:t,color:k,inverted:Z,lineHeight:20,monospace:T,muted:I,small:w,children:O}),M&&(0,h.jsx)(s.Z,{ml:1,children:(0,h.jsx)(p.Z,g({muted:!0},M))})]}),q=(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:I,onClick:function(){S(),L.current&&L.current.focus(),H(!0)},preventDefault:!0,sameColorAsText:I||!(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:Z,muted:I},A),{},{disableWordBreak:m,monospace:T,small:w,width:_,children:N}))}),(0,h.jsx)(f.Z,g(g({},B),{},{basic:!0,defaultColor:o,fullWidth:b,invertedTheme:Z,monospace:T,onBlur:function(e){H(!1),B.onBlur&&B.onBlur(e),Q||z(!0)},onFocus:function(e){H(!0),B.onFocus&&B.onFocus(e)},ref:L,small:w,value:C,visible:!N}))]}),K=c&&(0,h.jsx)(j,{children:(0,h.jsx)(d.ZP,{dangerouslySetInnerHTML:{__html:c},monospace:T,muted:!0,small:w})}),V=(0,i.useMemo)((function(){return(0,h.jsx)(d.ZP,{default:!0,small:w,children:D})}),[w,D]);return(0,h.jsxs)(h.Fragment,{children:[P&&(0,h.jsxs)(h.Fragment,{children:[W&&(0,h.jsxs)(x,{children:[(0,h.jsx)(l.Z,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:W}),K]}),(0,h.jsxs)(l.Z,{fullWidth:b,children:[q,D&&V]})]}),!P&&(0,h.jsxs)(l.Z,{alignItems:"center",fullWidth:!0,children:[W&&(0,h.jsxs)(h.Fragment,{children:[W,(0,h.jsx)(s.Z,{ml:1})]}),q,D&&V]}),Q&&!F&&!N&&!E&&!R&&(0,h.jsx)(d.ZP,{danger:!0,small:w,children:"This field is required."})]})}},29237:function(e,n,t){var o=t(38626),r=t(67971),i=t(86673),c=t(19711),u=t(23831),l=t(73942),a=t(37391),s=t(49125),d=t(28598),f=(0,o.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*s.iI,1.5*s.iI,1.5*s.iI),p=o.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," "," "," ",""],l.n_,(function(e){return e.fullWidth&&"\n width: 100%;\n "}),(function(e){return!e.borderless&&"\n border: 1px solid ".concat((e.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.success&&"\n background-color: ".concat((e.theme.background||u.Z.background).successLight,";\n ")}),(function(e){return e.success&&!e.borderless&&"\n border: 1px solid ".concat((e.theme.background||u.Z.background).success,";\n ")}),(function(e){return!e.dark&&!e.success&&"\n background-color: ".concat((e.theme.background||u.Z.background).panel,";\n ")}),(function(e){return e.dark&&"\n background-color: ".concat((e.theme.background||u.Z.background).content,";\n ")}),(function(e){return!e.fullHeight&&"\n height: fit-content;\n "}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")}),(function(e){return e.maxWidth&&"\n max-width: ".concat(e.maxWidth,"px;\n ")}),(function(e){return e.minWidth&&"\n min-width: ".concat(e.minWidth,"px;\n\n @media (max-width: ").concat(e.minWidth,"px) {\n min-width: 0;\n }\n ")}),(function(e){return e.borderless&&"\n border: none;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),m=o.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],l.n_,l.n_,(function(e){return"\n background-color: ".concat((e.theme.background||u.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||u.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),f,(function(e){return e.headerPaddingVertical&&"\n padding-bottom: ".concat(e.headerPaddingVertical,"px;\n padding-top: ").concat(e.headerPaddingVertical,"px;\n ")})),h=o.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*s.iI,a.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: calc(".concat(e.maxHeight," - ").concat(15*s.iI,"px);\n ")}),(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),v=o.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],l.M8,l.YF,1.75*s.iI);n.Z=function(e){var n=e.borderless,t=e.children,o=e.containerRef,u=e.contentContainerRef,l=e.dark,a=e.footer,s=e.fullHeight,f=void 0===s||s,b=e.fullWidth,g=void 0===b||b,x=e.header,j=e.headerHeight,C=e.headerIcon,_=e.headerPaddingVertical,Z=e.headerTitle,O=e.maxHeight,k=e.maxWidth,y=e.minWidth,E=e.noPadding,T=e.overflowVisible,I=e.subtitle,S=e.success;return(0,d.jsxs)(p,{borderless:n,dark:l,fullHeight:f,fullWidth:g,maxHeight:O,maxWidth:k,minWidth:y,overflowVisible:T,ref:o,success:S,children:[(x||Z)&&(0,d.jsxs)(m,{headerPaddingVertical:_,height:j,children:[x&&x,Z&&(0,d.jsx)(r.Z,{alignItems:"center",justifyContent:"space-between",children:(0,d.jsxs)(r.Z,{alignItems:"center",children:[C&&C,(0,d.jsx)(i.Z,{ml:C?1:0,children:(0,d.jsx)(c.ZP,{bold:!0,default:!0,children:Z})})]})})]}),(0,d.jsxs)(h,{maxHeight:O,noPadding:E,overflowVisible:T,ref:u,children:[I&&(0,d.jsx)(i.Z,{mb:2,children:(0,d.jsx)(c.ZP,{default:!0,children:I})}),t]}),a&&(0,d.jsx)(v,{children:a})]})}},66176:function(e,n,t){var o=t(82394),r=t(91835),i=(t(82684),t(38626)),c=t(23831),u=t(73942),l=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*l.iI,(function(e){return"\n background-color: ".concat((e.theme.monotone||c.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||c.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||c.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))}))}},11366:function(e,n,t){t.d(n,{Ch:function(){return c},H8:function(){return o},g6:function(){return r},vF:function(){return i}});var o="pipeline_edit_before_tab_selected",r="pipeline_edit_hidden_blocks",i="pipeline_edit_block_output_logs",c="setup_ai_later"},87323:function(e,n,t){t.d(n,{cU:function(){return c}});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})),c=(o||{}).includeAllNodes,u=[];function l(t){if(t){var o=(t[n]||[]).reduce((function(n,t){return e.uuid===t?n:n.concat(i[t])}),[]);(0===o.length||c&&e.uuid!==t.uuid)&&u.push(t),o.forEach((function(e){l(e)}))}}return l(e),u}(e,"upstream_blocks",n,{includeAllNodes:!0})}function c(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,c=o.dynamicUpstreamBlocks,u=o.reduceOutputUpstreamBlock,l=o.reduceOutputUpstreamBlocks,a=(t||{}).configuration||{},s=a.dynamic,d=a.reduce_output;return{block:t,blocksToUse:e,dynamic:!!s,dynamicUpstreamBlock:r,dynamicUpstreamBlocks:c,reduceOutput:!!d,reduceOutputUpstreamBlock:u,reduceOutputUpstreamBlocks:l}}))}),[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 c},gr:function(){return i}});var o=/\[__internal_output__\]/,r=/\[__internal_test__\]/,i="[__internal_output__]",c="[__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,c,u,l=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===(c=window)||void 0===c||null===(u=c.navigator)||void 0===u?void 0:u.platform);return s?["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(s)?l=r.MAC:["Win32","Win64","Windows","WinCE"].includes(s)?l=r.WINDOWS:["iPhone","iPad","iPod"].includes(s)&&(l=r.IOS):a&&(a.includes("Macintosh")?l=r.MAC:a.includes("Windows")?l=r.WINDOWS:a.includes("Linux")&&a.includes("X11")?l=r.LINUX:/(iPhone|iPad)/.test(a)?l=r.IOS:a.includes("Android")&&a.includes("Mobi")?l=r.ANDROID:a.includes("CrOS")&&(l=r.CHROME_OS)),l}()===r.MAC}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2485],{2485:function(e,n,t){var i=t(21831),l=t(82394),u=t(82684),o=t(38626),r=t(34376),d=t(28413),c=t(60328),s=t(32316),a=t(18908),p=t(67971),h=t(49666),m=t(86673),v=t(54283),j=t(55264),x=t(62749),f=t(19711),b=t(82531),g=t(22341),Z=t(38639),y=t(27337),k=t(33766),C=t(24141),w=t(28598);function I(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function P(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?I(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):I(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n,t=e.contained,l=e.defaultLinkUUID,I=e.defaultTab,O=e.objectType,T=e.onClickCustomTemplate,_=e.pipelineUUID,U=e.showAddingNewTemplates,M=e.showBreadcrumbs,A=e.tabs,S=(0,r.useRouter)(),N=(0,u.useContext)(o.ThemeContext),D=(0,C.i)(),R=D.height,q=D.width,E=(0,u.useMemo)((function(){return A||y.dP}),[A]),F=(0,u.useState)(U||!1),z=F[0],B=F[1],L=(0,u.useState)(l?y.qy.find((function(e){return e.uuid===l})):y.qy[0]),G=L[0],Y=L[1],H=(0,u.useState)(I?E.find((function(e){return e.uuid===(null===I||void 0===I?void 0:I.uuid)})):E[0]),W=H[0],X=H[1],J=(0,u.useState)(null),K=J[0],Q=J[1],V=b.ZP.custom_templates.list({object_type:a.Z},{},{pauseFetch:y.n9.uuid!==(null===W||void 0===W?void 0:W.uuid)}),$=V.data,ee=V.mutate,ne=(0,u.useMemo)((function(){var e=(null===$||void 0===$?void 0:$.custom_templates)||[];return null!==G&&void 0!==G&&G.filterTemplates?null===G||void 0===G?void 0:G.filterTemplates(e):e}),[$,G]),te=b.ZP.custom_templates.list({object_type:a.R},{},{pauseFetch:y.A2.uuid!==(null===W||void 0===W?void 0:W.uuid)}),ie=te.data,le=te.mutate,ue=(0,u.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]),oe=(0,u.useMemo)((function(){return y.qy.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,l=e.selectedIconProps,u=e.uuid,o=(null===G||void 0===G?void 0:G.uuid)===u,r=P({size:Z.ZG},o&&l?l:{});return(0,w.jsx)(Z.wj,{onClick:function(){return Y(e)},selected:o,children:(0,w.jsxs)(p.Z,{alignItems:"center",children:[(0,w.jsx)(Z.ze,{backgroundColor:o&&i?i(N):null,children:n?(0,w.jsx)(n,P({},r)):(0,w.jsx)(g.pd,P({},r))}),(0,w.jsx)(f.ZP,{bold:!0,large:!0,children:t?t():u})]})},u)}))}),[G,N]),re=(0,u.useMemo)((function(){return y.hS.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,l=e.selectedIconProps,u=e.uuid,o=(null===G||void 0===G?void 0:G.uuid)===u,r=P({size:Z.ZG},o&&l?l:{});return(0,w.jsx)(Z.wj,{onClick:function(){return Y(e)},selected:o,children:(0,w.jsxs)(p.Z,{alignItems:"center",children:[(0,w.jsx)(Z.ze,{backgroundColor:o&&i?i(N):null,children:n?(0,w.jsx)(n,P({},r)):(0,w.jsx)(g.pd,P({},r))}),(0,w.jsx)(f.ZP,{bold:!0,large:!0,children:t?t():u})]})},u)}))}),[G,N]),de=(0,u.useMemo)((function(){return null===ne||void 0===ne?void 0:ne.map((function(e){var n=e.description,t=e.name,l=e.tags,u=e.template_uuid,o=e.user,r=[];return null!==l&&void 0!==l&&l.length?r.push.apply(r,(0,i.Z)(l)):null!==o&&void 0!==o&&o.username&&r.push(null===o||void 0===o?void 0:o.username),(0,w.jsxs)(Z.UE,{onClick:function(){T?T(e):S.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(u)))},children:[(0,w.jsx)(Z.Tj,{children:(0,w.jsx)(f.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||u})}),(0,w.jsx)(Z.SL,{children:(0,w.jsx)(f.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,w.jsx)(Z.EN,{children:(null===r||void 0===r?void 0:r.length)>=1&&(0,w.jsx)(j.Z,{tags:null===r||void 0===r?void 0:r.map((function(e){return{uuid:e}}))})})]},u)}))}),[ne,T,S]),ce=(0,u.useMemo)((function(){return null===ue||void 0===ue?void 0:ue.map((function(e){var n=e.description,t=e.name,l=e.tags,u=e.template_uuid,o=e.user,r=[];return null!==l&&void 0!==l&&l.length?r.push.apply(r,(0,i.Z)(l)):null!==o&&void 0!==o&&o.username&&r.push(null===o||void 0===o?void 0:o.username),(0,w.jsxs)(Z.UE,{onClick:function(){T?T(e):S.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(u),"?object_type=").concat(a.R))},children:[(0,w.jsx)(Z.Tj,{children:(0,w.jsx)(f.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||u})}),(0,w.jsx)(Z.SL,{children:(0,w.jsx)(f.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,w.jsx)(Z.EN,{children:(null===r||void 0===r?void 0:r.length)>=1&&(0,w.jsx)(j.Z,{tags:null===r||void 0===r?void 0:r.map((function(e){return{uuid:e}}))})})]},u)}))}),[ue,T,S]),se=(0,u.useMemo)((function(){if(!M)return null;var e=[];return z?e.push.apply(e,[{label:function(){return"Templates"},onClick:function(){B(!1)}},{bold:!0,label:function(){return"New custom template"}}]):e.push({label:function(){return"Templates"}}),(0,w.jsx)(Z.FX,{children:(0,w.jsx)(d.Z,{breadcrumbs:e})})}),[z,M]),ae=(0,u.useMemo)((function(){return M?36:0}),[M]),pe=(0,u.useMemo)((function(){return R-ae}),[R,ae]);if(z)return n=a.R===O&&_?(0,w.jsx)(h.Z,{onMutateSuccess:le,pipelineUUID:_,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,w.jsx)(x.Z,{contained:t,heightOffset:ae,onCreateCustomTemplate:t?function(e){Q(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,w.jsxs)(w.Fragment,{children:[M&&se,(0,w.jsx)(Z.Rd,{height:pe,width:q,children:n})]}):n;var he=(0,w.jsxs)(Z.Nk,{children:[(0,w.jsxs)(Z.bC,{height:t?pe:null,children:[(0,w.jsx)(Z.Yf,{children:(0,w.jsx)(s.Z,{noPadding:!0,onClickTab:function(e){t?X(e):(0,k.u7)({object_type:y.A2.uuid===e.uuid?a.R:a.Z})},selectedTabUUID:null===W||void 0===W?void 0:W.uuid,tabs:E})}),(0,w.jsxs)(Z.wl,{contained:t,heightOffset:ae,children:[y.n9.uuid===(null===W||void 0===W?void 0:W.uuid)&&oe,y.A2.uuid===(null===W||void 0===W?void 0:W.uuid)&&re]})]}),(0,w.jsxs)(Z.w5,{children:[y.n9.uuid===(null===W||void 0===W?void 0:W.uuid)&&(0,w.jsx)(Z.HS,{children:(0,w.jsx)(c.Z,{beforeIcon:(0,w.jsx)(g.mm,{size:Z.ZG}),onClick:function(){B(!0)},primary:!0,children:"New block template"})}),y.n9.uuid===(null===W||void 0===W?void 0:W.uuid)&&(0,w.jsxs)(w.Fragment,{children:[!$&&(0,w.jsx)(m.Z,{p:2,children:(0,w.jsx)(v.Z,{inverted:!0})}),$&&!(null!==de&&void 0!==de&&de.length)&&(0,w.jsxs)(m.Z,{p:2,children:[(0,w.jsx)(f.ZP,{children:"There are currently no templates matching your search."}),(0,w.jsx)("br",{}),(0,w.jsx)(f.ZP,{children:"Add a new template by clicking the button above."})]}),(null===de||void 0===de?void 0:de.length)>=1&&(0,w.jsx)(Z.n8,{children:de})]}),y.A2.uuid===(null===W||void 0===W?void 0:W.uuid)&&(0,w.jsxs)(w.Fragment,{children:[!ie&&(0,w.jsx)(m.Z,{p:2,children:(0,w.jsx)(v.Z,{inverted:!0})}),ie&&!(null!==ce&&void 0!==ce&&ce.length)&&(0,w.jsxs)(m.Z,{p:2,children:[(0,w.jsx)(f.ZP,{children:"There are currently no templates matching your search."}),(0,w.jsx)("br",{}),(0,w.jsx)(f.ZP,{children:"Add a new template by clicking the button above."})]}),(null===ce||void 0===ce?void 0:ce.length)>=1&&(0,w.jsx)(Z.n8,{children:ce})]})]})]});return t?(0,w.jsxs)(w.Fragment,{children:[M&&se,(0,w.jsx)(Z.Rd,{height:pe,width:q,children:he})]}):he}},55264:function(e,n,t){var i=t(82684),l=t(79891),u=t(67971),o=t(19711),r=t(24224),d=t(28598);n.Z=function(e){var n=e.onClickTag,t=e.tags,c=void 0===t?[]:t,s=(0,i.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)||0}),[c]),a=(0,i.useMemo)((function(){return(0,r.YC)(c||[],"uuid")}),[c]);return(0,d.jsx)(u.Z,{alignItems:"center",flexWrap:"wrap",children:null===a||void 0===a?void 0:a.reduce((function(e,t){return e.push((0,d.jsx)("div",{style:{marginBottom:2,marginRight:s>=2?4:0,marginTop:2},children:(0,d.jsx)(l.Z,{onClick:n?function(){return n(t)}:null,small:!0,children:(0,d.jsx)(o.ZP,{children:t.uuid})})},"tag-".concat(t.uuid))),e}),[])})}},79891:function(e,n,t){var i=t(38626),l=t(60328),u=t(67971),o=t(86673),r=t(19711),d=t(23831),c=t(22341),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||d.Z.background).tag,";\n ")}),(function(e){return e.primary&&"\n background-color: ".concat((e.theme.chart||d.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||d.Z.content).muted,";\n ")}));n.Z=function(e){var n=e.border,t=e.children,i=e.disabled,d=e.label,a=e.onClick,m=e.primary,v=e.small;return(0,p.jsx)(h,{border:n,primary:m,small:v,children:(0,p.jsx)(l.Z,{basic:!0,disabled:i,noBackground:!0,noPadding:!0,onClick:a,transparent:!0,children:(0,p.jsxs)(u.Z,{alignItems:"center",children:[t,d&&(0,p.jsx)(r.ZP,{small:v,children:d}),!i&&a&&(0,p.jsx)(o.Z,{ml:1,children:(0,p.jsx)(c.x8,{default:m,muted:!m,size:v?s.iI:1.25*s.iI})})]})})})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2786],{27125:function(n,e,t){var o=t(75582),u=t(82684),i=t(12691),r=t.n(i),c=t(34376),l=t.n(c),a=t(38626),s=t(83455),d=t(35490),p=t(66050),f=t(60328),v=t(16634),b=t(67971),h=t(10919),O=t(98781),j=t(86673),m=t(87815),g=t(19711),x=t(46261),Z=t(82531),_=t(73828),y=t(94353),P=t(
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2786],{27125:function(n,e,t){var o=t(75582),u=t(82684),i=t(12691),r=t.n(i),c=t(34376),l=t.n(c),a=t(38626),s=t(83455),d=t(35490),p=t(66050),f=t(60328),v=t(16634),b=t(67971),h=t(10919),O=t(98781),j=t(86673),m=t(87815),g=t(19711),x=t(46261),Z=t(82531),_=t(73828),y=t(94353),P=t(22341),k=t(49125),T=t(44162),L=t(24224),w=t(96510),S=t(43482),D=t(28598);e.Z=function(n){var e=n.blockRuns,t=n.onClickRow,i=n.pipeline,c=n.selectedRun,C=n.setErrors,R=(0,u.useContext)(a.ThemeContext),M=(0,u.useState)(null),E=M[0],N=M[1],A=(0,u.useState)(null),I=A[0],Y=A[1],V=i||{},Q=V.uuid,U=V.type,F=(0,u.useMemo)((function(){return i.blocks||[]}),[i]),B=(0,u.useMemo)((function(){return(0,L.HK)(F,(function(n){return n.uuid}))}),[F]),H=(0,u.useMemo)((function(){return O.qL.INTEGRATION===U}),[U]),J=(0,u.useMemo)((function(){return O.qL.PYTHON===U}),[U]),K=(0,u.useMemo)((function(){var n,e;return null===(n=new d.Z)||void 0===n||null===(e=n.decodedToken)||void 0===e?void 0:e.token}),[]),q=(0,s.Db)((function(n){var e=n.blockUUID,t=n.pipelineRunId;return Z.ZP.block_outputs.pipelines.downloads.detailAsync(null===i||void 0===i?void 0:i.uuid,e,{pipeline_run_id:t,token:K},{onDownloadProgress:function(n){return N((Number((null===n||void 0===n?void 0:n.loaded)||0)/1e6).toFixed(3))},responseType:y.E.BLOB})}),{onSuccess:function(n){return(0,w.wD)(n,{callback:function(n){Y(null),(0,S.uS)(n,"block_output.".concat(_.Lu.CSV))},onErrorCallback:function(n,e){return null===C||void 0===C?void 0:C({errors:e,response:n})}})}}),X=(0,o.Z)(q,2),z=X[0],G=X[1].isLoading,W=[{uuid:"Date"},{uuid:"Status"},{uuid:"Trigger"},{uuid:"Block"},{uuid:"Completed"},{uuid:"Logs"}];return J&&W.push({uuid:"Output"}),(0,D.jsx)(m.Z,{columnFlex:[null,1,3,2,null,null,null],columns:W,isSelectedRow:function(n){return e[n].id===(null===c||void 0===c?void 0:c.id)},onClickRow:t,rows:null===e||void 0===e?void 0:e.map((function(n){var e,t,o,u,i=n||{},c=i.block_uuid,a=i.completed_at,s=i.created_at,d=i.id,O=i.pipeline_run_id,m=i.pipeline_schedule_id,Z=i.pipeline_schedule_name,_=i.status,y=c,L=y.split(":"),w=I===d&&G;H&&(y=L[0],o=L[1],u=L[2]);var S=B[y];S||(S=B[L[0]]);var C=[(0,D.jsx)(g.ZP,{default:!0,monospace:!0,children:s},"".concat(d,"_created_at")),(0,D.jsx)(g.ZP,{danger:p.V.FAILED===_,default:p.V.CANCELLED===_,info:p.V.INITIAL===_,monospace:!0,success:p.V.COMPLETED===_,warning:p.V.RUNNING===_,children:_},"".concat(d,"_status")),(0,D.jsx)(r(),{as:"/pipelines/".concat(Q,"/triggers/").concat(m),href:"/pipelines/[pipeline]/triggers/[...slug]",passHref:!0,children:(0,D.jsx)(h.Z,{bold:!0,sameColorAsText:!0,children:Z})},"".concat(d,"_trigger")),(0,D.jsx)(r(),{as:"/pipelines/".concat(Q,"/edit?block_uuid=").concat(y),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,D.jsxs)(h.Z,{bold:!0,sameColorAsText:!0,verticalAlignContent:!0,children:[(0,D.jsx)(v.Z,{color:(0,T.qn)(null===(e=S)||void 0===e?void 0:e.type,{blockColor:null===(t=S)||void 0===t?void 0:t.color,theme:R}).accent,size:1.5*k.iI,square:!0}),(0,D.jsx)(j.Z,{mr:1}),(0,D.jsxs)(g.ZP,{monospace:!0,children:[y,o&&": ",o&&(0,D.jsx)(g.ZP,{default:!0,inline:!0,monospace:!0,children:o}),u>=0&&": ",u>=0&&(0,D.jsx)(g.ZP,{default:!0,inline:!0,monospace:!0,children:u})]})]})},"".concat(d,"_block_uuid")),(0,D.jsx)(g.ZP,{default:!0,monospace:!0,children:a||"-"},"".concat(d,"_completed_at")),(0,D.jsx)(f.Z,{default:!0,iconOnly:!0,noBackground:!0,onClick:function(){return l().push("/pipelines/".concat(Q,"/logs?block_run_id[]=").concat(d))},children:(0,D.jsx)(P.B4,{default:!0,size:2*k.iI})},"".concat(d,"_logs"))];return J&&C.push((0,D.jsx)(b.Z,{alignItems:"center",justifyContent:"center",children:(0,D.jsx)(x.Z,{appearBefore:!0,autoHide:!w,block:!0,forceVisible:w,label:w?"".concat(E||0,"mb downloaded..."):"Save block run output as CSV file",size:null,widthFitContent:!0,children:(0,D.jsx)(f.Z,{default:!0,disabled:!J||!(p.V.COMPLETED===_)||G,iconOnly:!0,loading:w,noBackground:!0,onClick:function(){N(null),Y(d),z({blockUUID:y,pipelineRunId:O})},children:(0,D.jsx)(P.vc,{default:!0,size:2*k.iI})})})},"".concat(d,"_save_output"))),C})),uuid:"block-runs"})}},43482:function(n,e,t){t.d(e,{Dp:function(){return f},OF:function(){return v},Q9:function(){return h},Rt:function(){return s},h8:function(){return b},k1:function(){return d},uS:function(){return O}});var o=t(21831),u=t(82394),i=t(91427),r=t(24224),c=t(90211);function l(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,o)}return t}function a(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?l(Object(t),!0).forEach((function(e){(0,u.Z)(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function s(n){var e={},t={};return null===n||void 0===n||n.forEach((function(n){var o=n.content,u=n.outputs,i=n.type,r=n.uuid;(null===u||void 0===u?void 0:u.length)>=1&&(e[r]=u.map((function(n){var e=n||{},t=e.sample_data,o=e.shape,u=e.text_data,i=e.type;return t?{data:a({shape:o},t),type:i}:u&&(0,c.Pb)(u)?JSON.parse(u):u}))),t[i]||(t[i]={}),t[i][r]=o})),{content:t,messages:e}}function d(n,e,t){n.forEach((function(n){(0,i.t8)("".concat(t,"/").concat(n.uuid,"/codeCollapsed"),(0,i.Od)("".concat(e,"/").concat(n.uuid,"/codeCollapsed"))),(0,i.t8)("".concat(t,"/").concat(n.uuid,"/outputCollapsed"),(0,i.Od)("".concat(e,"/").concat(n.uuid,"/outputCollapsed")))}))}function p(n){return"".concat(n,"/").concat(i.kP)}function f(n){return(0,i.U2)(p(n),[])}function v(n,e){var t=f(n);t.includes(e)||(0,i.t8)(p(n),[].concat((0,o.Z)(t),[e]))}function b(n,e){var t=f(n).filter((function(n){return n!==e}));(0,i.t8)(p(n),t)}function h(n,e){var t=(0,r.HK)(e,(function(n){return n.uuid}));return n.map((function(n){return t[n]})).filter((function(n){return!!n}))}var O=function(n,e){var t=window.URL.createObjectURL(n),o=document.createElement("a");o.href=t,o.download=e,document.body.appendChild(o),o.click(),o.remove()}},56681:function(n,e,t){t.d(e,{G7:function(){return Z},ZP:function(){return _},u$:function(){return m}});var o=t(75582),u=t(82394),i=t(26304),r=t(32316),c=t(22673),l=t(48952),a=t(86673),s=t(19711),d=t(87815),p=t(49125),f=t(19395),v=t(7715),b=t(28598),h=["height","heightOffset","pipeline","selectedRun","selectedTab","setSelectedTab"];function O(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,o)}return t}function j(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?O(Object(t),!0).forEach((function(e){(0,u.Z)(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}var m=76,g={uuid:"Run details"},x={uuid:"Dependency tree"},Z=[x,g];function _(n){var e=n.height,t=n.heightOffset,u=n.pipeline,O=n.selectedRun,_=n.selectedTab,y=n.setSelectedTab,P=j({},(0,i.Z)(n,h));O?P.blockStatus=(0,f.IJ)(null===O||void 0===O?void 0:O.block_runs):P.noStatus=!0;var k=(0,v.Kn)(null===O||void 0===O?void 0:O.variables)?j({},null===O||void 0===O?void 0:O.variables):(null===O||void 0===O?void 0:O.variables)||{},T=null===O||void 0===O?void 0:O.event_variables;if(T&&(0,v.Kn)(T)&&!(0,v.Qr)(T))if((0,v.Kn)(k)&&k.hasOwnProperty("event")){var L=(0,v.Kn)(k.event)?k.event:{};k.event=j(j({},L),T)}else k.event=j({},T);var w=[];k&&JSON.stringify(k,null,2).split("\n").forEach((function(n){w.push(" ".concat(n))}));var S=O&&[["Run ID",null===O||void 0===O?void 0:O.id],["Variables",(0,b.jsx)(c.Z,{language:"json",small:!0,source:w.join("\n")},"variable_value")]],D=O&&(0,b.jsx)(a.Z,{pb:p.cd,px:p.cd,children:(0,b.jsx)(d.Z,{alignTop:!0,columnFlex:[null,1],columnMaxWidth:function(n){return 1===n?"100px":null},rows:S.map((function(n,e){var t=(0,o.Z)(n,2),u=t[0],i=t[1];return[(0,b.jsx)(s.ZP,{monospace:!0,muted:!0,children:u},"key_".concat(e)),(0,b.jsx)(s.ZP,{monospace:!0,textOverflow:!0,children:i},"val_".concat(e))]})),uuid:"LogDetail"})}),C=_&&y;return(0,b.jsxs)(b.Fragment,{children:[C&&(0,b.jsx)(a.Z,{py:p.cd,children:(0,b.jsx)(r.Z,{onClickTab:y,selectedTabUUID:null===_||void 0===_?void 0:_.uuid,tabs:Z})}),(!C||x.uuid===(null===_||void 0===_?void 0:_.uuid))&&(0,b.jsx)(l.Z,j(j({},P),{},{height:e,heightOffset:(t||0)+(C?m:0),pipeline:u})),g.uuid===(null===_||void 0===_?void 0:_.uuid)&&D]})}},73828:function(n,e,t){t.d(e,{JD:function(){return h},Lu:function(){return i},PF:function(){return f},d2:function(){return p},dT:function(){return r},n6:function(){return a},nB:function(){return b},oy:function(){return v},xF:function(){return d}});var o,u,i,r,c=t(82394),l=t(86422);!function(n){n.CSV="csv",n.JSON="json",n.MD="md",n.PY="py",n.R="r",n.SQL="sql",n.TXT="txt",n.YAML="yaml",n.YML="yml"}(i||(i={})),function(n){n.INIT_PY="__init__.py",n.METADATA_YAML="metadata.yaml",n.REQS_TXT="requirements.txt"}(r||(r={}));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(n){return".".concat(n,"$")})).join("|")),p=new RegExp(s.map((function(n){return".".concat(n,"$")})).join("|")),f="charts",v="pipelines",b=(o={},(0,c.Z)(o,i.MD,l.t6.MARKDOWN),(0,c.Z)(o,i.JSON,i.JSON),(0,c.Z)(o,i.PY,l.t6.PYTHON),(0,c.Z)(o,i.R,l.t6.R),(0,c.Z)(o,i.SQL,l.t6.SQL),(0,c.Z)(o,i.TXT,"text"),(0,c.Z)(o,i.YAML,l.t6.YAML),(0,c.Z)(o,i.YML,l.t6.YAML),o),h=(u={},(0,c.Z)(u,l.t6.MARKDOWN,i.MD),(0,c.Z)(u,l.t6.PYTHON,i.PY),(0,c.Z)(u,l.t6.R,i.R),(0,c.Z)(u,l.t6.SQL,i.SQL),(0,c.Z)(u,l.t6.YAML,i.YAML),(0,c.Z)(u,"text",i.TXT),u)}}]);
|