mage-ai 0.9.18__py3-none-any.whl → 0.9.19__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mage-ai might be problematic. Click here for more details.
- mage_ai/api/middleware.py +9 -6
- mage_ai/api/policies/PageBlockLayoutPolicy.py +46 -0
- mage_ai/api/policies/PipelinePolicy.py +1 -0
- mage_ai/api/presenters/PageBlockLayoutPresenter.py +12 -0
- mage_ai/api/resources/PageBlockLayoutResource.py +22 -0
- mage_ai/api/resources/PipelineResource.py +60 -13
- mage_ai/data_preparation/executors/k8s_pipeline_executor.py +14 -1
- mage_ai/data_preparation/models/block/dbt/__init__.py +2 -0
- mage_ai/data_preparation/models/block/dbt/utils/__init__.py +2 -1
- mage_ai/presenters/__init__.py +0 -0
- mage_ai/presenters/block_layout/__init__.py +0 -0
- mage_ai/presenters/block_layout/constants.py +1 -0
- mage_ai/presenters/block_layout/page.py +86 -0
- mage_ai/presenters/constants.py +2 -0
- mage_ai/server/api/v1.py +16 -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/DTEnEDO68KRvd3eboRuhE/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1484-e209ef2f20fcfc81.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4250-9944d52bed19617c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-d12c3b172bd25751.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-a214672a55b1ce9f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-bf8a8f58e19dca2d.js +1 -0
- mage_ai/server/frontend_dist/files.html +2 -2
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-data-products.html +2 -2
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +2 -2
- mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist/manage/users.html +2 -2
- mage_ai/server/frontend_dist/manage.html +2 -2
- mage_ai/server/frontend_dist/overview.html +2 -2
- mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/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 +2 -2
- mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist/templates.html +2 -2
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +2 -2
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/IH3dqMU16smA5y2jlNbyO/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1484-e209ef2f20fcfc81.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4250-9944d52bed19617c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-d12c3b172bd25751.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-a214672a55b1ce9f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-bf8a8f58e19dca2d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
- mage_ai/server/server.py +6 -0
- {mage_ai-0.9.18.dist-info → mage_ai-0.9.19.dist-info}/METADATA +6 -6
- {mage_ai-0.9.18.dist-info → mage_ai-0.9.19.dist-info}/RECORD +119 -109
- mage_ai/server/frontend_dist/_next/static/awdRBeqr8vM6acFkDuskw/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1484-65c543b9350ab7a0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-7f790238fe70d9ab.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-158c1a93ac7a951a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-cbaf371216a70d43.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1484-65c543b9350ab7a0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-7f790238fe70d9ab.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-158c1a93ac7a951a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-cbaf371216a70d43.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/vkOaw6IoqucwBE_cK1Sp_/_buildManifest.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{awdRBeqr8vM6acFkDuskw → DTEnEDO68KRvd3eboRuhE}/_middlewareManifest.js +0 -0
- /mage_ai/server/frontend_dist/_next/static/{awdRBeqr8vM6acFkDuskw → DTEnEDO68KRvd3eboRuhE}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{vkOaw6IoqucwBE_cK1Sp_ → IH3dqMU16smA5y2jlNbyO}/_middlewareManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{vkOaw6IoqucwBE_cK1Sp_ → IH3dqMU16smA5y2jlNbyO}/_ssgManifest.js +0 -0
- {mage_ai-0.9.18.dist-info → mage_ai-0.9.19.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.18.dist-info → mage_ai-0.9.19.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.18.dist-info → mage_ai-0.9.19.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.18.dist-info → mage_ai-0.9.19.dist-info}/top_level.txt +0 -0
mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-a214672a55b1ce9f.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551,2485],{48591:function(e,n,t){"use strict";var i=t(21831),r=t(75582),o=t(82684),l=t(37958);n.Z=function(e){var n=e.children,t=e.uuid,c=e.uuids,u=void 0===c?[]:c,a=(0,l.j)("apiReloads"),s=(0,r.Z)(a,1)[0],d=(0,i.Z)(u);t&&d.push(t);var p=d.map((function(e){return String(s[e])||"-"})).join("_");return o.cloneElement(n,{key:p})}},2485:function(e,n,t){"use strict";var i=t(21831),r=t(82394),o=t(82684),l=t(38626),c=t(34376),u=t(28413),a=t(60328),s=t(32316),d=t(18908),p=t(67971),f=t(49666),h=t(86673),v=t(54283),m=t(55264),b=t(62749),g=t(19711),x=t(82531),j=t(22341),y=t(38639),k=t(57541),Z=t(33766),O=t(24141),P=t(28598);function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function C(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n,t=e.contained,r=e.defaultLinkUUID,w=e.defaultTab,_=e.objectType,S=e.onClickCustomTemplate,E=e.pipelineUUID,I=e.showAddingNewTemplates,T=e.showBreadcrumbs,D=e.tabs,A=(0,c.useRouter)(),M=(0,o.useContext)(l.ThemeContext),B=(0,O.i)(),R=B.height,N=B.width,L=(0,o.useMemo)((function(){return D||k.dP}),[D]),F=(0,o.useState)(I||!1),U=F[0],H=F[1],W=(0,o.useState)(r?k.qy.find((function(e){return e.uuid===r})):k.qy[0]),z=W[0],V=W[1],G=(0,o.useState)(w?L.find((function(e){return e.uuid===(null===w||void 0===w?void 0:w.uuid)})):L[0]),K=G[0],Y=G[1],q=(0,o.useState)(null),Q=q[0],J=q[1],X=x.ZP.custom_templates.list({object_type:d.Z},{},{pauseFetch:k.n9.uuid!==(null===K||void 0===K?void 0:K.uuid)}),$=X.data,ee=X.mutate,ne=(0,o.useMemo)((function(){var e=(null===$||void 0===$?void 0:$.custom_templates)||[];return null!==z&&void 0!==z&&z.filterTemplates?null===z||void 0===z?void 0:z.filterTemplates(e):e}),[$,z]),te=x.ZP.custom_templates.list({object_type:d.R},{},{pauseFetch:k.A2.uuid!==(null===K||void 0===K?void 0:K.uuid)}),ie=te.data,re=te.mutate,oe=(0,o.useMemo)((function(){var e=(null===ie||void 0===ie?void 0:ie.custom_templates)||[];return null!==z&&void 0!==z&&z.filterTemplates?null===z||void 0===z?void 0:z.filterTemplates(e):e}),[ie,z]),le=(0,o.useMemo)((function(){return k.qy.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,r=e.selectedIconProps,o=e.uuid,l=(null===z||void 0===z?void 0:z.uuid)===o,c=C({size:y.ZG},l&&r?r:{});return(0,P.jsx)(y.wj,{onClick:function(){return V(e)},selected:l,children:(0,P.jsxs)(p.ZP,{alignItems:"center",children:[(0,P.jsx)(y.ze,{backgroundColor:l&&i?i(M):null,children:n?(0,P.jsx)(n,C({},c)):(0,P.jsx)(j.pd,C({},c))}),(0,P.jsx)(g.ZP,{bold:!0,large:!0,children:t?t():o})]})},o)}))}),[z,M]),ce=(0,o.useMemo)((function(){return k.hS.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,r=e.selectedIconProps,o=e.uuid,l=(null===z||void 0===z?void 0:z.uuid)===o,c=C({size:y.ZG},l&&r?r:{});return(0,P.jsx)(y.wj,{onClick:function(){return V(e)},selected:l,children:(0,P.jsxs)(p.ZP,{alignItems:"center",children:[(0,P.jsx)(y.ze,{backgroundColor:l&&i?i(M):null,children:n?(0,P.jsx)(n,C({},c)):(0,P.jsx)(j.pd,C({},c))}),(0,P.jsx)(g.ZP,{bold:!0,large:!0,children:t?t():o})]})},o)}))}),[z,M]),ue=(0,o.useMemo)((function(){return null===ne||void 0===ne?void 0:ne.map((function(e){var n=e.description,t=e.name,r=e.tags,o=e.template_uuid,l=e.user,c=[];return null!==r&&void 0!==r&&r.length?c.push.apply(c,(0,i.Z)(r)):null!==l&&void 0!==l&&l.username&&c.push(null===l||void 0===l?void 0:l.username),(0,P.jsxs)(y.UE,{onClick:function(){S?S(e):A.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(o)))},children:[(0,P.jsx)(y.Tj,{children:(0,P.jsx)(g.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||o})}),(0,P.jsx)(y.SL,{children:(0,P.jsx)(g.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,P.jsx)(y.EN,{children:(null===c||void 0===c?void 0:c.length)>=1&&(0,P.jsx)(m.Z,{tags:null===c||void 0===c?void 0:c.map((function(e){return{uuid:e}}))})})]},o)}))}),[ne,S,A]),ae=(0,o.useMemo)((function(){return null===oe||void 0===oe?void 0:oe.map((function(e){var n=e.description,t=e.name,r=e.tags,o=e.template_uuid,l=e.user,c=[];return null!==r&&void 0!==r&&r.length?c.push.apply(c,(0,i.Z)(r)):null!==l&&void 0!==l&&l.username&&c.push(null===l||void 0===l?void 0:l.username),(0,P.jsxs)(y.UE,{onClick:function(){S?S(e):A.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(o),"?object_type=").concat(d.R))},children:[(0,P.jsx)(y.Tj,{children:(0,P.jsx)(g.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||o})}),(0,P.jsx)(y.SL,{children:(0,P.jsx)(g.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,P.jsx)(y.EN,{children:(null===c||void 0===c?void 0:c.length)>=1&&(0,P.jsx)(m.Z,{tags:null===c||void 0===c?void 0:c.map((function(e){return{uuid:e}}))})})]},o)}))}),[oe,S,A]),se=(0,o.useMemo)((function(){if(!T)return null;var e=[];return U?e.push.apply(e,[{label:function(){return"Templates"},onClick:function(){H(!1)}},{bold:!0,label:function(){return"New custom template"}}]):e.push({label:function(){return"Templates"}}),(0,P.jsx)(y.FX,{children:(0,P.jsx)(u.Z,{breadcrumbs:e})})}),[U,T]),de=(0,o.useMemo)((function(){return T?36:0}),[T]),pe=(0,o.useMemo)((function(){return R-de}),[R,de]);if(U)return n=d.R===_&&E?(0,P.jsx)(f.Z,{onMutateSuccess:re,pipelineUUID:E,templateAttributes:z&&(null===z||void 0===z?void 0:z.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{pipeline_type:null===z||void 0===z?void 0:z.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}):(0,P.jsx)(b.Z,{contained:t,heightOffset:de,onCreateCustomTemplate:t?function(e){J(e)}:null,onMutateSuccess:ee,templateAttributes:z&&(null===z||void 0===z?void 0:z.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{block_type:null===z||void 0===z?void 0:z.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}),t?(0,P.jsxs)(P.Fragment,{children:[T&&se,(0,P.jsx)(y.Rd,{height:pe,width:N,children:n})]}):n;var fe=(0,P.jsxs)(y.Nk,{children:[(0,P.jsxs)(y.bC,{height:t?pe:null,children:[(0,P.jsx)(y.Yf,{children:(0,P.jsx)(s.Z,{noPadding:!0,onClickTab:function(e){t?Y(e):(0,Z.u7)({object_type:k.A2.uuid===e.uuid?d.R:d.Z})},selectedTabUUID:null===K||void 0===K?void 0:K.uuid,tabs:L})}),(0,P.jsxs)(y.wl,{contained:t,heightOffset:de,children:[k.n9.uuid===(null===K||void 0===K?void 0:K.uuid)&&le,k.A2.uuid===(null===K||void 0===K?void 0:K.uuid)&&ce]})]}),(0,P.jsxs)(y.w5,{children:[k.n9.uuid===(null===K||void 0===K?void 0:K.uuid)&&(0,P.jsx)(y.HS,{children:(0,P.jsx)(a.Z,{beforeIcon:(0,P.jsx)(j.mm,{size:y.ZG}),onClick:function(){H(!0)},primary:!0,children:"New block template"})}),k.n9.uuid===(null===K||void 0===K?void 0:K.uuid)&&(0,P.jsxs)(P.Fragment,{children:[!$&&(0,P.jsx)(h.Z,{p:2,children:(0,P.jsx)(v.Z,{inverted:!0})}),$&&!(null!==ue&&void 0!==ue&&ue.length)&&(0,P.jsxs)(h.Z,{p:2,children:[(0,P.jsx)(g.ZP,{children:"There are currently no templates matching your search."}),(0,P.jsx)("br",{}),(0,P.jsx)(g.ZP,{children:"Add a new template by clicking the button above."})]}),(null===ue||void 0===ue?void 0:ue.length)>=1&&(0,P.jsx)(y.n8,{children:ue})]}),k.A2.uuid===(null===K||void 0===K?void 0:K.uuid)&&(0,P.jsxs)(P.Fragment,{children:[!ie&&(0,P.jsx)(h.Z,{p:2,children:(0,P.jsx)(v.Z,{inverted:!0})}),ie&&!(null!==ae&&void 0!==ae&&ae.length)&&(0,P.jsxs)(h.Z,{p:2,children:[(0,P.jsx)(g.ZP,{children:"There are currently no templates matching your search."}),(0,P.jsx)("br",{}),(0,P.jsx)(g.ZP,{children:"Add a new template by clicking the button above."})]}),(null===ae||void 0===ae?void 0:ae.length)>=1&&(0,P.jsx)(y.n8,{children:ae})]})]})]});return t?(0,P.jsxs)(P.Fragment,{children:[T&&se,(0,P.jsx)(y.Rd,{height:pe,width:N,children:fe})]}):fe}},91207:function(e,n,t){"use strict";t.d(n,{Z:function(){return R}});var i=t(82394),r=t(75582),o=t(17717),l=t(82684),c=t(37958),u=t(83455),a=t(35490),s=t(86422),d=t(60328),p=t(38626),f=t(93461),h=t(67971),v=t(28598),m=p.default.div.withConfig({displayName:"ButtonGroup__ButtonGroupStyle",componentId:"sc-15vbmc8-0"})([""]),b=p.default.div.withConfig({displayName:"ButtonGroup__VerticalDivider",componentId:"sc-15vbmc8-1"})(["width:1px;"]),g=function(e){var n=e.children,t=e.divider,i=l.Children.toArray(n).length;return(0,v.jsx)(m,{children:(0,v.jsx)(h.ZP,{children:l.Children.map(n,(function(e,n){return e&&(0,v.jsxs)(f.Z,{children:[n>=1&&t&&(0,v.jsx)(b,{}),l.cloneElement(e,{borderRadiusLeft:i>=2&&0===n,borderRadiusRight:i>=2&&n===i-1,halfPaddingLeft:i>=2&&0!==n,halfPaddingRight:i>=2&&n!==i-1,noBorder:i>=2&&n>0&&n<i-1,noBorderRight:i>=2&&n!==i-1})]},"button-group-child-".concat(n))}))})})},x=t(57722),j=t(73828),y=t(11135),k=t(98781),Z=t(86673),O=t(82531),P=t(16115),w=t(94353),C=t(60701),_=t(55512),S=t(24224),E=t(32821),I=t(90211),T=t(96510),D=t(51504),A=t(41150);function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function B(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,i.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 R=function(e){var n=e.active,t=e.addNewBlock,p=e.disableRefreshWarning,f=e.fetchPipeline,m=e.fetchVariables,b=e.filePath,M=e.hideHeaderButtons,R=e.onContentChange,N=e.onUpdateFileSuccess,L=e.openSidekickView,F=e.pipeline,U=e.saveFile,H=e.selectedFilePath,W=e.sendTerminalMessage,z=e.setDisableShortcuts,V=e.setErrors,G=e.setFilesTouched,K=e.setSelectedBlock,Y=(0,c.j)("apiReloads"),q=(0,r.Z)(Y,2)[1],Q=(0,l.useState)(null),J=Q[0],X=Q[1],$=(0,l.useState)(!1),ee=$[0],ne=($[1],(0,l.useRef)(null)),te=(0,l.useMemo)((function(){return new a.Z}),[]),ie=(0,l.useMemo)((function(){return{api_key:w.l,token:te.decodedToken.token}}),[te]),re=O.ZP.statuses.list().data,oe=(0,l.useMemo)((function(){var e,n;return null===re||void 0===re||null===(e=re.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[re]),le=O.ZP.file_contents.detail(b).data;(0,l.useEffect)((function(){null!==le&&void 0!==le&&le.file_content?X(le.file_content):null!==le&&void 0!==le&&le.error&&(0,T.h$)(le,{onErrorCallback:function(e,n){return V({errors:n,response:e})}})}),[le,V]);var ce=(0,l.useState)(null===J||void 0===J?void 0:J.content),ue=ce[0],ae=ce[1],se=(0,l.useCallback)((function(e){ae(e),R&&(null===R||void 0===R||R(e))}),[R]),de=(0,l.useState)(!1),pe=de[0],fe=de[1];(0,l.useEffect)((function(){n&&z&&(null===z||void 0===z||z(!0))}),[n,z]),(0,l.useEffect)((function(){var e;H&&(null===ne||void 0===ne||null===(e=ne.current)||void 0===e||e.scrollIntoView())}),[H]);var he=(0,u.Db)(O.ZP.file_contents.useUpdate((null===J||void 0===J?void 0:J.path)&&encodeURIComponent(null===J||void 0===J?void 0:J.path)),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(e){var n=e.file_content;q((function(e){return B(B({},e),{},(0,i.Z)({},"FileVersions/".concat(null===J||void 0===J?void 0:J.path),Number(new Date)))})),N&&(null===N||void 0===N||N(n))},onErrorCallback:function(e,n){return null===V||void 0===V?void 0:V({errors:n,response:e})}})}}),ve=(0,r.Z)(he,1)[0],me=(0,l.useCallback)((function(e,n){if(U)return U(e,n);ve({file_content:B(B({},n),{},{content:e})}).then((function(){decodeURIComponent(b).split(o.sep).pop()===j.dT.METADATA_YAML&&m&&(null===m||void 0===m||m())})),G((function(e){return B(B({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))})),fe(!1)}),[m,b,U,G,ve]),be=(0,l.useMemo)((function(){return(0,_.lU)()}),[]),ge=(0,l.useMemo)((function(){var e,n,t,i;return null===(null===J||void 0===J||null===(e=J.path)||void 0===e?void 0:e.match(be))?j.Lu.TXT:null===J||void 0===J||null===(n=J.path)||void 0===n||null===(t=n.match(be))||void 0===t||null===(i=t[0])||void 0===i?void 0:i.split(".")[1]}),[be,J]),xe=(0,l.useMemo)((function(){if(null!==J&&void 0!==J&&J.path)return(0,v.jsx)(x.Z,{autoHeight:!0,language:j.nB[ge],onChange:function(e){se(e),G((function(e){return B(B({},e),{},(0,i.Z)({},null===J||void 0===J?void 0:J.path,!0))})),fe(!0)},onSave:function(e){me(e,J)},selected:!0,textareaFocused:!0,value:(0,I.Pb)(null===J||void 0===J?void 0:J.content)?JSON.stringify(JSON.parse(null===J||void 0===J?void 0:J.content),null,2):null===J||void 0===J?void 0:J.content,width:"100%"})}),[J,ge,me,se,G]),je=null!==F&&void 0!==F&&F.blocks?(0,S.sE)(null===F||void 0===F?void 0:F.blocks,(function(e){var n=e.type;return s.tf.DATA_EXPORTER===n})):null,ye=(0,u.Db)(O.ZP.blocks.pipelines.useUpdate(null===F||void 0===F?void 0:F.uuid,null===je||void 0===je?void 0:je.uuid),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(){null===f||void 0===f||f()}})}}),ke=(0,r.Z)(ye,1)[0],Ze=t&&F&&(ge===j.Lu.PY||ge===j.Lu.SQL||(ge===j.Lu.YAML||ge===j.Lu.R)&&(0,E.V3)(J,null===J||void 0===J?void 0:J.path))&&(0,_.ck)(J.path.split(o.sep))!==s.tf.SCRATCHPAD&&(0,E.lr)(J)&&(0,v.jsx)(d.Z,{onClick:function(){var e=(null===F||void 0===F?void 0:F.type)===k.qL.INTEGRATION,n=(0,_.TU)(J,oe,F);t(n,(function(n){e&&je&&ke({block:B(B({},je),{},{upstream_blocks:[n.uuid]})}),null===K||void 0===K||K(n)}))},primary:!0,children:"Add to current pipeline"}),Oe=W&&(0,v.jsx)(Z.Z,{m:2,children:(0,v.jsx)(y.ZP,{disabled:!oe,inline:!0,loading:ee,onClick:function(){null===L||void 0===L||L(C.cH.TERMINAL),null===W||void 0===W||W(JSON.stringify(B(B({},ie),{},{command:["stdin","pip install -r ".concat(oe,"/requirements.txt\r")]})))},title:oe?"Pip install packages from your saved requirements.txt file (\u2318+S to save).":"Please use right panel terminal to install packages.",uuid:"FileEditor/InstallPackages",children:"Install packages"})}),Pe="FileEditor/".concat(null===J||void 0===J?void 0:J.path),we=(0,A.y)(),Ce=we.registerOnKeyDown,_e=we.unregisterOnKeyDown;return(0,l.useEffect)((function(){return function(){_e(Pe)}}),[_e,Pe]),Ce(Pe,(function(e,t){if(n&&!p)if((0,D.y)([P.zX,P.Um],t)||(0,D.y)([P.PQ,P.Um],t))e.preventDefault(),me(ue,J);else if(pe&&(0,D.y)([P.zX,P.hS],t)){e.preventDefault();var i="".concat(J.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(i)&&location.reload()}}),[n,ue,p,J,me,pe]),(0,v.jsxs)("div",{ref:ne,children:[!M&&(0,v.jsx)(Z.Z,{p:2,children:(0,v.jsxs)(h.ZP,{justifyContent:"space-between",children:[(0,v.jsxs)(g,{children:[Ze,(0,v.jsx)(d.Z,{disabled:!ue,onClick:function(e){e.preventDefault(),me(ue,J)},title:ue?null:"No changes have been made to this file.",children:"Save file content"})]}),L&&(0,v.jsx)(g,{children:(0,v.jsx)(d.Z,{compact:!0,onClick:function(){L(C.cH.FILE_VERSIONS)},small:!0,title:"View previous changes to this file.",children:"Show versions"})})]})}),xe,b===j.dT.REQS_TXT&&Oe]})}},23351:function(e,n,t){"use strict";var i=t(82394),r=t(75582),o=t(17717),l=t(37958),c=t(82684),u=t(83455),a=t(60328),s=t(57722),d=t(73828),p=t(93461),f=t(67971),h=t(87372),v=t(86673),m=t(54283),b=t(87815),g=t(19711),x=t(82531),j=t(49125),y=t(55512),k=t(42305),Z=t(90211),O=t(96510),P=t(66653),w=t(24224),C=t(28598);function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function S(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.onActionCallback,t=e.selectedBlock,_=e.selectedFilePath,E=e.setErrors,I=e.width,T=(0,l.j)("apiReloads"),D=(0,r.Z)(T,2)[1],A=x.ZP.file_versions.files.list(_&&encodeURIComponent(_)),M=A.data,B=A.mutate,R=(0,c.useMemo)((function(){return(null===M||void 0===M?void 0:M.file_versions)||[]}),[M]),N=(0,c.useState)(null),L=N[0],F=N[1],U=(0,c.useMemo)((function(){return null===R||void 0===R?void 0:R[L]}),[L,R]),H=x.ZP.file_contents.detail(U?encodeURIComponent(U.path):null).data,W=(0,c.useMemo)((function(){return null===H||void 0===H?void 0:H.file_content}),[H]),z=(0,c.useMemo)((function(){return(0,y.lU)()}),[]),V=(0,c.useMemo)((function(){var e,n,t;return null===_||void 0===_||null===(e=_.match(z))||void 0===e||null===(n=e[0])||void 0===n||null===(t=n.split("."))||void 0===t?void 0:t[1]}),[_,z]),G=(0,u.Db)(x.ZP.file_contents.useUpdate(_&&encodeURIComponent(_)),{onSuccess:function(e){return(0,O.wD)(e,{callback:function(e){var t;_&&B();var r=null===e||void 0===e||null===(t=e.file_content)||void 0===t?void 0:t.path,l="FileEditor/".concat(r);if(r){var c=r.split(o.sep);if("pipelines"===c[0]){var u=c.slice(1,c.length-1).join(o.sep);l="PipelineDetail/".concat(u)}}D((function(e){return S(S({},e),{},(0,i.Z)({},l,Number(new Date)))})),F((function(e){return e+1})),null===n||void 0===n||n(null===e||void 0===e?void 0:e.file_content)},onErrorCallback:function(e,n){return E({errors:n,response:e})}})}}),K=(0,r.Z)(G,2),Y=K[0],q=K[1].isLoading,Q=(0,c.useMemo)((function(){var e=R.map((function(e){var n=e.name,t=e.path;return[(0,C.jsxs)(f.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(p.Z,{flex:1,children:[(0,C.jsx)(g.ZP,{default:!0,monospace:!0,children:(0,k.JX)(n,{withSeconds:!0})}),(0,C.jsx)(v.Z,{px:2*j.cd,children:(0,C.jsx)(g.ZP,{monospace:!0,children:n})})]}),U&&(null===U||void 0===U?void 0:U.path)===t&&(0,C.jsx)(a.Z,{compact:!0,loading:q,onClick:function(e){(0,P.j)(e),Y({file_content:{version:n}})},small:!0,children:"Replace with this version"})]},n)]}));if(U){var n=(0,C.jsx)(v.Z,{p:j.cd,children:(0,C.jsx)(m.Z,{},"spinner")});if(W&&(null===W||void 0===W?void 0:W.path)===(null===U||void 0===U?void 0:U.path)){var t=W.content,i=void 0===t?"":t;n=(0,C.jsx)(s.Z,{autoHeight:!0,language:d.nB[V],padding:!0,readOnly:!0,value:(0,Z.Pb)(i)?JSON.stringify(JSON.parse(i),null,2):i,width:I})}e=(0,w.Hk)([n],L+1,e)}return e}),[W,V,R,q,U,L,Y,I]);return(0,C.jsxs)("div",{style:{width:I},children:[(0,C.jsxs)(v.Z,{p:j.cd,children:[(0,C.jsx)(h.Z,{level:5,children:"File versions"}),(0,C.jsx)(g.ZP,{inline:!0,monospace:!0,children:_?decodeURIComponent(_):null===t||void 0===t?void 0:t.uuid})]}),(0,C.jsx)(b.Z,{buildRowProps:function(e){if(U&&L+1===e)return{renderCell:function(e){return e},renderRow:function(e){return e}}},columnFlex:[1],columns:[{uuid:"Version"}],isSelectedRow:function(e){var n;return(null===(n=R[e])||void 0===n?void 0:n.name)===(null===U||void 0===U?void 0:U.name)},onClickRow:function(e){U?e===L?F(null):e<L?F(e):e>L+1&&F(e-1):F(e)},rows:Q})]})}},83766:function(e,n,t){"use strict";var i=t(82394),r=t(86673),o=t(87815),l=t(19711),c=t(82944),u=t(49125),a=t(28598);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,s=e.setObjectAttributes;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(r.Z,{mb:1,px:u.cd,children:[(0,a.jsx)(l.ZP,{bold:!0,children:"Outdated after"}),(0,a.jsx)(l.ZP,{muted:!0,small:!0,children:"After the global data product successfully completes running, how long after that will the global data product be outdated?"})]}),(0,a.jsx)(o.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"seconds"},{uuid:"weeks"},{uuid:"months"},{uuid:"years"}].map((function(e){var r,o,u=e.uuid,p=null===n||void 0===n||null===(r=n.outdated_after)||void 0===r?void 0:r[u],f=null===t||void 0===t||null===(o=t.outdated_after)||void 0===o?void 0:o[u];return[(0,a.jsxs)(l.ZP,{default:!0,monospace:!0,children:[u," ",f&&(0,a.jsxs)(l.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",f,")"]})]},"label-".concat(u)),(0,a.jsx)(c.Z,{compact:!0,monospace:!0,onChange:function(e){return s((function(n){var t;return d(d({},n),{},{outdated_after:d(d({},null===n||void 0===n?void 0:n.outdated_after),{},(0,i.Z)({},u,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},placeholder:"Enter a number",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof p||null===p?"":p},"input-".concat(u))]}))})]})}},31682:function(e,n,t){"use strict";var i=t(82394),r=t(55378),o=t(86673),l=t(87815),c=t(19711),u=t(82944),a=t(49125),s=t(90211),d=t(24224),p=t(28598);function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,f=e.setObjectAttributes;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(o.Z,{mb:1,px:a.cd,children:[(0,p.jsxs)(c.ZP,{bold:!0,children:["Outdated starting at ",(0,p.jsx)(c.ZP,{inline:!0,muted:!0,children:"(optional)"})]}),(0,p.jsx)(c.ZP,{muted:!0,small:!0,children:"If enough time has passed since the last global data product has ran successfully and the global data product is determined to be outdated, then you can configure it to be outdated at a specific date or time."}),(0,p.jsx)("div",{style:{marginTop:4},children:(0,p.jsxs)(c.ZP,{muted:!0,small:!0,children:["For example, let\u2019s say the global data product is outdated after 12 hours. The last successful run was yesterday at 18:00. The global data product will be outdated today at 06:00. However, if the ",(0,p.jsx)(c.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Outdated starting at"})," has a value of 17 for ",(0,p.jsx)(c.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Hour of day"}),", then the global data product won\u2019t run again until today at 17:00."]})})]}),(0,p.jsx)(l.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"second_of_minute",values:(0,d.w6)(60).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"minute_of_hour",values:(0,d.w6)(60).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"hour_of_day",values:(0,d.w6)(24).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"day_of_week",values:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].map((function(e,n){return{uuid:e,value:n}}))},{uuid:"day_of_month",values:(0,d.w6)(31).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"day_of_year",values:(0,d.w6)(365).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"week_of_month",values:(0,d.w6)(5).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"week_of_year",values:(0,d.w6)(52).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"month_of_year",values:["January","February","March","April","May","June","July","August","September","October","November","December"].map((function(e,n){return{uuid:e,value:n+1}}))}].map((function(e){var o,l,a,d=e.uuid,v=e.values,m=null===n||void 0===n||null===(o=n.outdated_starting_at)||void 0===o?void 0:o[d],b=null===t||void 0===t||null===(l=t.outdated_starting_at)||void 0===l?void 0:l[d],g={compact:!0,key:"outdated-starting-at-input-".concat(d),monospace:!0,onChange:function(e){return f((function(n){var t;return h(h({},n),{},{outdated_starting_at:h(h({},null===n||void 0===n?void 0:n.outdated_starting_at),{},(0,i.Z)({},d,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},primary:!0,small:!0,value:"undefined"===typeof m||null===m?"":m};return a=v?(0,p.jsx)(r.Z,h(h({},g),{},{placeholder:"Select a value",children:v.map((function(e){var n=e.uuid,t=e.value;return(0,p.jsx)("option",{value:t,children:n},t)}))})):(0,p.jsx)(u.Z,h(h({},g),{},{placeholder:"Enter a number",setContentOnMount:!0,type:"number"})),[(0,p.jsxs)(c.ZP,{default:!0,monospace:!0,children:[(0,s.vg)(d)," ",b&&(0,p.jsxs)(c.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"outdated-starting-at-label-".concat(d)),a]}))})]})}},21978:function(e,n,t){"use strict";var i=t(82394),r=t(12691),o=t.n(r),l=t(38341),c=t(10919),u=t(86673),a=t(87815),s=t(19711),d=t(82944),p=t(49125),f=t(28598);function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?h(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.blocks,t=e.objectAttributes,r=e.originalAttributes,h=e.setObjectAttributes;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(u.Z,{mb:1,px:p.cd,children:[(0,f.jsx)(s.ZP,{bold:!0,children:"Block data to output"}),(0,f.jsx)(s.ZP,{muted:!0,small:!0,children:"The data output from the block(s) you select below will be the data product that is returned when a downstream entity is requesting data from this global data product."}),(0,f.jsx)("div",{style:{marginTop:4},children:(0,f.jsx)(s.ZP,{muted:!0,small:!0,children:"When requesting data from this global data product, the selected block(s) will return data from its most recent partition. You can override this by adding a value in the partitions setting. For example, if you set the partitions value to 5, then the selected block will return data from its 5 most recent partitions. If you set the partitions value to 0, then all the partitions will be returned."})})]}),(0,f.jsx)(a.Z,{columnFlex:[null,1,null],columns:[{label:function(){return""},uuid:"selected"},{uuid:"Block UUID"},{uuid:"Partitions"}],rows:null===n||void 0===n?void 0:n.map((function(e){var n,u=e.uuid,a=null===t||void 0===t?void 0:t.settings,p=null===a||void 0===a?void 0:a[u],m=null===p||void 0===p?void 0:p.partitions,b=null===r||void 0===r||null===(n=r.settings)||void 0===n?void 0:n[u],g=null===b||void 0===b?void 0:b.partitions,x=!!p||!!b;return[(0,f.jsx)(l.Z,{checked:x,onClick:function(){return function(e){h((function(n){var t=(null===n||void 0===n?void 0:n.settings)||{};return e?t[u]={}:null===t||void 0===t||delete t[u],v(v({},n),{},{settings:t})}))}(!x)}},"selected--".concat(u)),(0,f.jsxs)("div",{children:[(0,f.jsx)(o(),{as:"/pipelines/".concat(null===t||void 0===t?void 0:t.object_uuid,"/edit?block_uuid=").concat(u),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,f.jsx)(c.Z,{monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:u})})," ",g&&(0,f.jsxs)(s.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"block-uuid-".concat(u)),(0,f.jsx)(d.Z,{compact:!0,monospace:!0,onChange:function(e){return h((function(n){var t,r;return v(v({},n),{},{settings:v(v({},null===n||void 0===n?void 0:n.settings),{},(0,i.Z)({},u,v(v({},null===n||void 0===n||null===(t=n.settings)||void 0===t?void 0:t[u]),{},{partitions:0===(null===(r=e.target.value)||void 0===r?void 0:r.length)?null:Number(e.target.value)})))})}))},placeholder:"1",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof m||null===m?"":m},"input-".concat(u))]}))})]})}},65232:function(e,n,t){"use strict";var i=t(12691),r=t.n(i),o=t(82684),l=t(34376),c=t(30119),u=t(10919),a=t(86673),s=t(54283),d=t(87815),p=t(19711),f=t(82531),h=t(49125),v=t(66653),m=t(28598);n.Z=function(e){var n=e.globalDataProducts,t=e.onClickRow,i=(0,l.useRouter)(),b=f.ZP.global_data_products.list({},{},{pauseFetch:!!n}).data,g=(0,o.useMemo)((function(){return n||(null===b||void 0===b?void 0:b.global_data_products)||[]}),[b,n]);return b||n?b&&0===(null===g||void 0===g?void 0:g.length)?(0,m.jsx)(a.Z,{p:h.cd,children:(0,m.jsx)(p.ZP,{children:"There are currently no global data products registered."})}):(0,m.jsx)(d.Z,{columnFlex:[1,null,null],columns:[{uuid:"UUID"},{uuid:"Object type"},{uuid:"Object UUID"}],onClickRow:function(e){var n=null===g||void 0===g?void 0:g[e];n&&(t?null===t||void 0===t||t(n):i.push("/global-data-products/[...slug]","/global-data-products/".concat(null===n||void 0===n?void 0:n.uuid)))},rows:null===g||void 0===g?void 0:g.map((function(e){var n=e.object_type,t=e.object_uuid,o=e.uuid,l={as:null,href:null};return c.b.PIPELINE===n&&(l.as="/pipelines/".concat(t,"/edit"),l.href="/pipelines/[pipeline]/edit"),[(0,m.jsx)(p.ZP,{monospace:!0,children:o},"uuid"),(0,m.jsx)(p.ZP,{default:!0,monospace:!0,children:n},"objectType"),(0,m.jsx)(r(),{as:null===l||void 0===l?void 0:l.as,href:(null===l||void 0===l?void 0:l.href)||"",passHref:!0,children:(0,m.jsx)(u.Z,{default:!0,monospace:!0,onClick:function(e){(0,v.j)(e),i.push(l.href,l.as)},preventDefault:!0,children:t})},"objectUUID")]})),uuid:"global-data-products"}):(0,m.jsx)(a.Z,{p:h.cd,children:(0,m.jsx)(s.Z,{})})}},85307:function(e,n,t){"use strict";t.d(n,{$W:function(){return s},cl:function(){return d},cv:function(){return p},dE:function(){return u},zG:function(){return a}});var i=t(38626),r=t(23831),o=t(73942),l=t(49125),c=t(37391),u=i.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-7a1uhf-0"})(["border-radius:","px;padding:","px;",""],o.n_,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).popup,";\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__DocsStyle",componentId:"sc-7a1uhf-1"})(["> div{overflow:initial;}> div img{max-width:80%;background:white;padding:1rem;max-height:20vh;}"]),s=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-2"})(["padding-top:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).codeTextarea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-3"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],c.w5,(function(e){return e.hideHorizontalScrollbar&&"\n overflow-x: hidden;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,";\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")})),p=i.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-4"})(["padding:","px;"," "," ",""],2*l.iI,(function(e){return"\n background-color: ".concat((e.theme||r.Z).interactive.defaultBackground,";\n border-bottom: ").concat(o.YF,"px ").concat(o.M8," ").concat((e.theme||r.Z).borders.medium,";\n ")}),(function(e){return e.padding&&"\n padding: ".concat(e.padding,"px;\n ")}),(function(e){return e.rounded&&"\n border-top-left-radius: ".concat(o.n_,"px;\n border-top-right-radius: ").concat(o.n_,"px;\n ")}))},68579:function(e,n,t){"use strict";t.d(n,{$b:function(){return s},I5:function(){return u},Nk:function(){return c},gI:function(){return a}});var i=t(38626),r=t(23831),o=t(73942),l=t(49125),c=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-h093u4-0"})([""," ",""],(function(e){return!e.width&&"\n width: ".concat(40*l.iI,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),u=i.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-h093u4-1"})(["padding:","px;",""],2.5*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n border-top-left-radius: ").concat(o.n_,"px;\n border-top-right-radius: ").concat(o.n_,"px;\n border-top: 1px solid ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-h093u4-2"})(["align-items:center;justify-content:space-between;",""],(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n border-top: 1px solid ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n display: ").concat((null===e||void 0===e?void 0:e.display)||"flex",";\n padding-bottom: ").concat(1*l.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n padding-left: ").concat(l.cd*l.iI,"px;\n padding-top: ").concat(1*l.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-h093u4-3"})(["padding:","px ","px;",""],2.5*l.iI,2*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n border-bottom-left-radius: ").concat(o.n_,"px;\n border-bottom-right-radius: ").concat(o.n_,"px;\n border-bottom: 1px solid ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n ")}))},38488:function(e,n,t){"use strict";t.d(n,{Z:function(){return P}});var i=t(82394),r=t(26304),o=t(82684),l=t(38626),c=t(16634),u=t(67971),a=t(10919),s=t(86673),d=t(19711),p=t(46261),f=t(23831),h=t(22341),v=t(28347),m=t(49125),b=t(33766),g=t(66653),x=t(28598);var j=function(e){var n=e.filePath,t=e.filesTouched,i=void 0===t?{}:t,r=e.isLast,l=e.onClickTab,j=e.onClickTabClose,y=e.renderTabTitle,k=e.savePipelineContent,Z=e.selected,O=e.themeContext,P=(0,o.useState)(!1),w=P[0],C=P[1];return(0,x.jsx)(u.ZP,{flexDirection:"column",fullHeight:!0,onClick:function(e){e.preventDefault(),Z||(l?l(n):(null===k||void 0===k||k(),(0,b.u7)({file_path:encodeURIComponent(n)})))},onMouseEnter:function(){return C(!0)},onMouseLeave:function(){return C(!1)},children:(0,x.jsx)(v.Gb,{last:r,selected:Z,children:(0,x.jsxs)(u.ZP,{alignItems:"center",fullHeight:!0,children:[(0,x.jsx)(p.Z,{appearAbove:!0,appearBefore:!0,label:n,size:null,widthFitContent:!0,children:(0,x.jsxs)(u.ZP,{alignItems:"center",fullHeight:!0,children:[!i[n]&&(0,x.jsx)(h.iU,{muted:!Z,size:1.5*m.iI}),i[n]&&(0,x.jsx)(p.Z,{label:"Unsaved changes",size:null,widthFitContent:!0,children:(0,x.jsx)("div",{style:{padding:1},children:(0,x.jsx)(c.Z,{borderColor:(O||f.Z).borders.danger,size:1.25*m.iI})})}),(0,x.jsx)(s.Z,{mr:1}),(0,x.jsx)(d.ZP,{muted:!Z,children:y?y(n):n})]})}),(0,x.jsx)(s.Z,{mr:2}),(0,x.jsx)(p.Z,{label:"Close",size:null,widthFitContent:!0,children:(0,x.jsxs)(a.Z,{autoHeight:!0,block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(e){(0,g.j)(e),null===j||void 0===j||j(n)},preventDefault:!0,children:[(w||Z)&&(0,x.jsx)(h.x8,{muted:!Z,size:1.25*m.iI}),!w&&!Z&&(0,x.jsx)("div",{style:{width:1.25*m.iI}})]})})]})})})},y=t(24224),k=["filePaths","isSelectedFilePath","onClickTabClose","selectedFilePath"];function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Z(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var P=function(e){var n=e.filePaths,t=e.isSelectedFilePath,i=e.onClickTabClose,c=e.selectedFilePath,a=(0,r.Z)(e,k),s=(0,o.useContext)(l.ThemeContext),d=(0,o.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]),p=(0,o.useMemo)((function(){return null===d||void 0===d?void 0:d.length}),[d]);return(0,x.jsx)(u.ZP,{alignItems:"center",justifyContent:"flex-start",children:null===d||void 0===d?void 0:d.map((function(e,n){var r=t?t(e,c):c===encodeURIComponent(e);return(0,o.createElement)(j,O(O({},a),{},{filePath:e,isLast:n===p-1,key:e,onClickTabClose:function(e){if(i)i(e);else{var n=(0,y.Od)(d,(function(n){return n===e})).map((function(e){return encodeURIComponent(e)}));(0,b.u7)({file_path:n[n.length-1]||null,"file_paths[]":n},{pushHistory:!0})}},selected:r,themeContext:s}))}))})}},70543:function(e,n,t){"use strict";t.d(n,{IY:function(){return l},Jf:function(){return o},LR:function(){return r},NR:function(){return c},b7:function(){return i}});var i="edit",r="[ERR_BLOCK_EXISTS]",o={uuid:"All files"},l={uuid:"Files in pipeline"},c=[o,l]},28347:function(e,n,t){"use strict";t.d(n,{Gb:function(){return p},fm:function(){return s},lO:function(){return a},rK:function(){return d},zn:function(){return u}});var i=t(38626),r=t(23831),o=t(82386),l=t(49125),c=t(37391),u=300,a=i.default.div.withConfig({displayName:"indexstyle__PipelineContainerStyle",componentId:"sc-1sv9513-0"})([".pipeline-detail-enter-active{opacity:1;transition:opacity ","ms linear;}.pipeline-detail-enter-done{opacity:0;transition:opacity ","ms linear;}"],u,u),s=i.default.div.withConfig({displayName:"indexstyle__OverlayStyle",componentId:"sc-1sv9513-1"})(["height:100vh;opacity:1;position:fixed;width:100vw;z-index:9999;",""],(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).codeArea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__PipelineHeaderStyle",componentId:"sc-1sv9513-2"})(["height:","px;position:sticky;top:","px;width:100%;z-index:5;"," "," "," ",""],o.Wi,o.Wi,(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).medium,";\n ")}),(function(e){return e.relativePosition&&"\n position: relative;\n "}),(function(e){return e.secondary&&"\n height: ".concat(37,"px;\n top: ").concat(o.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,c.y$)()),p=i.default.div.withConfig({displayName:"indexstyle__FileTabStyle",componentId:"sc-1sv9513-3"})(["border-right:1px solid transparent;height:100%;padding:","px ","px;"," "," ",""],l.iI,l.cd*l.iI,(function(e){return"\n &:hover {\n cursor: default;\n\n p {\n color: ".concat((e.theme.content||r.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||r.Z.interactive).hoverBackground,";\n ")}),(function(e){return!e.selected&&!e.last&&"\n border-color: ".concat((e.theme.borders||r.Z.borders).light," !important;\n ")}))},59920:function(e,n,t){"use strict";var i;t.d(n,{M:function(){return i}}),function(e){e.BACKFILLS="backfills",e.BLOCK_RUNS="block_runs",e.EDIT="edit",e.MONITOR="monitor",e.PIPELINE_LOGS="pipeline_logs",e.PIPELINE_RUNS="pipeline_runs",e.RUNS="runs",e.SETTINGS="settings",e.SYNCS="syncs",e.TRIGGERS="triggers"}(i||(i={}))},36405:function(e,n,t){"use strict";t.d(n,{H:function(){return c}});var i=t(98781),r=t(22341),o=t(59920),l=t(9736);function c(e,n,t){var c=(n||{}).uuid||t,u=[{Icon:r.Bf,id:o.M.TRIGGERS,isSelected:function(){return o.M.TRIGGERS===e},label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(c,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{Icon:r.Pf,id:o.M.RUNS,isSelected:function(){return o.M.RUNS===e},label:function(){return"Runs"},linkProps:{as:"/pipelines/".concat(c,"/runs"),href:"/pipelines/[pipeline]/runs"}},{Icon:r.dE,id:o.M.BACKFILLS,isSelected:function(){return o.M.BACKFILLS===e},label:function(){return"Backfills"},linkProps:{as:"/pipelines/".concat(c,"/backfills"),href:"/pipelines/[pipeline]/backfills"}},{Icon:r.UL,id:o.M.PIPELINE_LOGS,isSelected:function(){return o.M.PIPELINE_LOGS===e},label:function(){return"Logs"},linkProps:{as:"/pipelines/".concat(c,"/logs"),href:"/pipelines/[pipeline]/logs"}},{Icon:r.ug,id:o.M.MONITOR,isSelected:function(){return o.M.MONITOR===e},label:function(){return"Monitor"},linkProps:{as:"/pipelines/".concat(c,"/monitors"),href:"/pipelines/[pipeline]/monitors"}}];return i.qL.INTEGRATION===(null===n||void 0===n?void 0:n.type)&&u.unshift({Icon:r.Nt,id:o.M.SYNCS,isSelected:function(){return o.M.SYNCS===e},label:function(){return"Syncs"},linkProps:{as:"/pipelines/".concat(c,"/syncs"),href:"/pipelines/[pipeline]/syncs"}}),(0,l.Ct)()||(u.unshift({Icon:r.EK,disabled:!c,id:o.M.EDIT,isSelected:function(){return o.M.EDIT===e},label:function(){return"Edit pipeline"},linkProps:{as:"/pipelines/".concat(c,"/edit"),href:"/pipelines/[pipeline]/edit"}}),u.push({Icon:r.Zr,id:o.M.SETTINGS,isSelected:function(){return o.M.SETTINGS===e},label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(c,"/settings"),href:"/pipelines/[pipeline]/settings"}})),u}},58122:function(e,n,t){"use strict";t.d(n,{FS:function(){return u},JZ:function(){return s},e7:function(){return d},wx:function(){return a}});var i=t(75582),r=t(82394),o=t(93348);function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(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 u(e){return"string"===typeof e?e:JSON.stringify(e)}function a(e,n){var t,i;return null===e||void 0===e||null===(t=e.find((function(e){var t=e.block;return n(t)})))||void 0===t||null===(i=t.variables)||void 0===i?void 0:i.map((function(e){var n=e.value;return c(c({},e),{},{value:u(n)})}))}function s(e,n){return n===o.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===o.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function d(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,i.Z)(n,2),o=t[0],l=t[1],u=l;try{u=JSON.parse(l)}catch(a){}return c(c({},e),{},(0,r.Z)({},o,u))}),{}):e}},55264:function(e,n,t){"use strict";var i=t(82684),r=t(79891),o=t(67971),l=t(19711),c=t(24224),u=t(28598);n.Z=function(e){var n=e.onClickTag,t=e.tags,a=void 0===t?[]:t,s=(0,i.useMemo)((function(){return(null===a||void 0===a?void 0:a.length)||0}),[a]),d=(0,i.useMemo)((function(){return(0,c.YC)(a||[],"uuid")}),[a]);return(0,u.jsx)(o.ZP,{alignItems:"center",flexWrap:"wrap",children:null===d||void 0===d?void 0:d.reduce((function(e,t){return e.push((0,u.jsx)("div",{style:{marginBottom:2,marginRight:s>=2?4:0,marginTop:2},children:(0,u.jsx)(r.Z,{onClick:n?function(){return n(t)}:null,small:!0,children:(0,u.jsx)(l.ZP,{children:t.uuid})})},"tag-".concat(t.uuid))),e}),[])})}},68735:function(e,n,t){"use strict";var i=t(26304),r=t(21831),o=t(82394),l=t(82684),c=t(26226),u=t(38626),a=t(90948),s=t(84969),d=t(65743),p=t(85587),f=t(79487),h=t(52136),v=t(67778),m=t(29989),b=t(17066),g=t(84482),x=t(76771),j=t(98889),y=t(65376),k=t(61655),Z=t(97745),O=t(48072),P=t(10103),w=t(84181),C=t(24903),_=t(67971),S=t(19711),E=t(52359),I=t(23831),T=t(80906),D=t(73899),A=t(2005),M=t(31012),B=t(49125),R=t(24224),N=t(344),L=t(45739),F=t(28598),U=["areaBetweenLines","data","events","height","lineLegendNames","margin","width","xAxisLabel","xLabelFormat","yAxisLabel","yLabelFormat"];function H(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function W(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 z=W(W({},y.j),{},{backgroundColor:I.Z.background.muted,border:"none"}),V=(0,k.Z)((function(e){var n=e.areaBetweenLines,t=e.data,i=e.events,o=void 0!==i&&i,c=e.getX,k=e.getY,_=e.getYScaleValues,E=e.gridProps,U=void 0===E?{}:E,H=e.height,V=e.hideGridX,G=e.hideTooltip,K=e.increasedXTicks,Y=e.lineLegendNames,q=e.margin,Q=e.noCurve,J=e.numYTicks,X=e.renderXTooltipContent,$=e.renderYTooltipContent,ee=e.showTooltip,ne=e.thickStroke,te=e.tooltipData,ie=e.tooltipLeft,re=void 0===ie?0:ie,oe=e.tooltipTop,le=void 0===oe?[]:oe,ce=e.width,ue=e.xLabelFormat,ae=e.xLabelRotate,se=void 0===ae||ae,de=e.yLabelFormat,pe=(0,l.useContext)(u.ThemeContext),fe=c||function(e){return null===e||void 0===e?void 0:e.x},he=k||function(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return null===e||void 0===e||null===(n=e.y)||void 0===n?void 0:n[t]},ve=I.Z.monotone.gray,me=I.Z.brand.wind200,be=I.Z.content.muted,ge=I.Z.monotone.gray,xe=t.map((function(e){return Number(fe(e))}));if(ce<10)return null;var je=ce-q.left-q.right,ye=H-q.top-q.bottom,ke=je/2,Ze=0===t.length?0:Math.max.apply(Math,(0,r.Z)(t.map((function(e){var n=e.y;return(null===n||void 0===n?void 0:n.length)||0})))),Oe=(0,l.useMemo)((function(){return(0,w.Z)({domain:[Math.min.apply(Math,(0,r.Z)(xe)),Math.max.apply(Math,(0,r.Z)(xe))],range:[0,je]})}),[je,xe]),Pe=Math.min.apply(Math,(0,r.Z)(t.map((function(e){var n=e.y;return Math.min.apply(Math,(0,r.Z)(_?_(n):n||[]))})))),we=Math.max.apply(Math,(0,r.Z)(t.map((function(e){var n=e.y;return Math.max.apply(Math,(0,r.Z)(_?_(n):n||[]))})))),Ce=(0,l.useMemo)((function(){return(0,w.Z)({domain:[Pe,we],nice:!0,range:[ye,0]})}),[ye,we,Pe]),_e=ce>520?K?20:10:K?10:5,Se=(0,L.K)(pe),Ee=be,Ie=Se.map((function(e){return{stroke:e}})),Te=(0,C.Z)({domain:Y||[],range:Ie.map((function(e){return e.stroke}))}),De=(0,l.useCallback)((function(e){var n=((0,O.Z)(e)||{x:0}).x,i=Oe.invert(n-q.left),r=(0,R.ry)(xe,(function(e){return i>=e})),o=t[r-1],l=t[r],c=o;l&&(i-fe(o)>fe(l)-i?c=l:(c=o,r-=1));var u=(0,P.range)(0,Ze).map((function(e){return Ce(he(c,e))})),a=u.some((function(e){return"undefined"===typeof e}));(he(c)||_&&!a)&&ee({tooltipData:W(W({},c),{},{index:r}),tooltipLeft:n,tooltipTop:u})}),[t,fe,he,_,q,ee,Oe,xe,Ce]),Ae={};return Q||(Ae.curve=Z.ZP),(0,F.jsxs)(F.Fragment,{children:[Y&&(0,F.jsx)("div",{style:{marginLeft:null===q||void 0===q?void 0:q.left},children:(0,F.jsx)(b.Z,{labelFormat:function(e){return e},scale:Te,children:function(e){return(0,F.jsx)("div",{style:{display:"flex",flexDirection:T.qs.ROW},children:e.map((function(e,n){return(0,F.jsxs)(g.Z,{margin:"0 5px",onClick:function(){o&&alert("clicked: ".concat(JSON.stringify(e)))},children:[(0,F.jsx)("svg",{height:15,width:15,children:(0,F.jsx)("rect",{fill:e.value,height:15,width:15})}),(0,F.jsx)(x.Z,{align:"left",margin:"0 0 0 4px",children:(0,F.jsx)(S.ZP,{small:!0,children:e.text})})]},"legend-quantile-".concat(n))}))})}})}),(0,F.jsxs)("svg",{height:H,width:ce,children:[!n&&(0,F.jsx)(d.Z,{fill:"transparent",height:H,onMouseLeave:function(){return G()},onMouseMove:De,onTouchMove:De,onTouchStart:De,rx:14,width:ce-(q.left+q.right),x:q.left,y:0}),(0,F.jsxs)(m.Z,{left:q.left,top:q.top,children:[!V&&(0,F.jsx)(h.Z,W({height:ye,pointerEvents:"none",scale:Oe,stroke:ve,strokeDasharray:"3,3",strokeOpacity:.4,width:je},U)),(0,F.jsx)(v.Z,W({height:ye,pointerEvents:"none",scale:Ce,stroke:ve,strokeDasharray:"3,3",strokeOpacity:.4,width:je},U)),(0,F.jsx)("line",{stroke:ve,x1:je,x2:je,y1:0,y2:ye}),(0,F.jsx)(a.Z,{numTicks:_e,scale:Oe,stroke:Ee,tickFormat:function(e){return ue?ue(e):e},tickLabelProps:function(e){return{fill:be,fontFamily:A.ry,fontSize:M.J5,textAnchor:"middle",transform:se&&"rotate(-45, ".concat(Oe(e),", 0) translate(-32, 4)")}},tickStroke:Ee,top:ye}),(0,F.jsx)(s.Z,{hideTicks:!0,numTicks:J,scale:Ce,stroke:Ee,tickFormat:function(e){return de?de(e):(0,N.P5)(e)},tickLabelProps:function(e){return{dx:String(e).length>4?3:0,fill:be,fontFamily:A.ry,fontSize:M.J5,textAnchor:"end",transform:"translate(0,2.5)"}},tickStroke:Ee}),n&&n.map((function(e){var n=e[0],i=e[1];return(0,l.createElement)(j.Z,W(W({},Ae),{},{aboveAreaProps:{fill:I.Z.brand.earth400,fillOpacity:.3},belowAreaProps:{fill:me,fillOpacity:.2},clipAboveTo:0,clipBelowTo:ye,data:t,id:"".concat(Math.random()),key:"".concat(n,"-").concat(i),x:function(e){return Oe(fe(e))},y0:function(e){return Ce("undefined"===typeof i?Pe:he(e,i))},y1:function(e){return Ce(he(e,n))}}))})),(0,P.range)(0,Ze).map((function(e){return(0,l.createElement)(p.Z,W(W({},Ae),{},{data:t.filter((function(e){return void 0!=e.y})),key:e,pointerEvents:"none",strokeWidth:ne?2:1,x:function(e){return Oe(fe(e))},y:function(n){return Ce(n.y&&(e>=n.y.length?Pe:he(n,e)))}},Ie[e]))}))]}),te&&(0,F.jsxs)("g",{children:[(0,F.jsx)(f.Z,{from:{x:re,y:q.top},pointerEvents:"none",stroke:D.Ej,strokeDasharray:"5,2",strokeWidth:1,to:{x:re,y:ye+q.top}}),le.map((function(e,n){return(0,F.jsx)("circle",{cx:re,cy:e+1+q.top,fill:Ie[n].stroke,fillOpacity:.1,pointerEvents:"none",r:4,stroke:ge,strokeOpacity:.1,strokeWidth:1},n)})),le.map((function(e,n){return(0,F.jsx)("circle",{cx:re,cy:e+q.top,fill:Ie[n].stroke,pointerEvents:"none",r:4,stroke:Ie[n].stroke,strokeWidth:2},n)}))]})]}),te&&(0,F.jsxs)("div",{children:[le.map((function(e,n){var t=he(te,n);return n>=1&&Math.abs(le[n-1]-e)<5*B.iI&&(e+=3*B.iI),(0,F.jsxs)(y.Z,{left:re>ke?re-(0,N.Vs)($,te,n)*B.iI:re+B.iI,style:z,top:e-2*B.iI,children:[$&&$(te,n),!$&&(0,F.jsxs)(S.ZP,{center:!0,small:!0,children:[t.toFixed?t.toFixed(3):t," ",null===Y||void 0===Y?void 0:Y[n]]})]},n)})),(0,F.jsxs)(y.Z,{left:re>ke?re-4*(0,N.Vs)(X,te):re,style:W(W({},z),{},{transform:"translateX(-65%)"}),top:ye+q.top,children:[X&&X(te),!X&&(0,F.jsx)(S.ZP,{center:!0,small:!0,children:fe(te).toFixed(3)})]})]})]})}));n.Z=function(e){var n=e.areaBetweenLines,t=e.data,r=(e.events,e.height),o=e.lineLegendNames,l=e.margin,u=void 0===l?{}:l,a=e.width,s=e.xAxisLabel,d=e.xLabelFormat,p=e.yAxisLabel,f=e.yLabelFormat,h=(0,i.Z)(e,U),v=W(W({},{bottom:3*B.iI,left:5*B.iI,right:3*B.iI,top:3*B.iI}),u);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{style:{display:"flex",height:r,marginBottom:B.iI,width:"100%"},children:[p&&(0,F.jsx)(_.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,F.jsx)(E.Z,{children:(0,F.jsx)(S.ZP,{center:!0,muted:!0,small:!0,children:p})})}),(0,F.jsx)("div",{style:{height:r,width:"undefined"===typeof a?"100%":a},children:(0,F.jsx)(c.Z,{children:function(e){var i=e.width,r=e.height;return(0,F.jsx)(V,W(W({},h),{},{areaBetweenLines:n,data:t,height:r,lineLegendNames:o,margin:v,width:i,xLabelFormat:d,yLabelFormat:f}))}})})]}),s&&(0,F.jsx)("div",{style:{paddingLeft:p?36:0,paddingTop:4},children:(0,F.jsx)(S.ZP,{center:!0,muted:!0,small:!0,children:s})})]})}},21853:function(e,n,t){"use strict";t.d(n,{Z:function(){return S}});var i=t(82394),r=t(75582),o=t(82684),l=t(83455),c=t(60328),u=t(34744),a=t(93461),s=t(67971),d=t(87372),p=t(10919),f=t(29237),h=t(86673),v=t(19711),m=t(82944),b=t(70902),g=t(82531),x=t(38626),j=t(23831),y=t(73942),k=t(49125),Z=x.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1b0w59t-0"})(["border-radius:","px;padding:","px;",""],y.n_,k.cd*k.iI,(function(e){return"\n background-color: ".concat((e.theme.background||j.Z.background).codeArea,";\n ")})),O=t(96510),P=t(9728),w=t(28598);function C(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function _(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?C(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):C(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var S=function(e){var n=e.cancelButtonText,t=e.contained,x=e.header,j=e.onCancel,y=e.onSaveSuccess,C=(0,P.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),S=(0,r.Z)(C,1)[0],E=(0,o.useState)(null),I=E[0],T=E[1],D=g.ZP.projects.list(),A=D.data,M=D.mutate,B=(0,o.useMemo)((function(){var e;return null===A||void 0===A||null===(e=A.projects)||void 0===e?void 0:e[0]}),[A]),R=B||{},N=R.name,L=R.project_uuid;(0,o.useEffect)((function(){I||T(B)}),[B,I]);var F=(0,l.Db)(g.ZP.projects.useUpdate(N),{onSuccess:function(e){return(0,O.wD)(e,{callback:function(e){var n=e.project;M(),T(n),y&&(null===y||void 0===y||y(n))},onErrorCallback:function(e,n){return S({errors:n,response:e})}})}}),U=(0,r.Z)(F,2),H=U[0],W=U[1].isLoading,z=(0,o.useCallback)((function(e){return H({project:e})}),[H]),V=(0,w.jsxs)(w.Fragment,{children:[x,(0,w.jsxs)(f.Z,{noPadding:!0,children:[(0,w.jsxs)(h.Z,{p:k.cd,children:[(0,w.jsx)(h.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Project name"})}),(0,w.jsx)(v.ZP,{default:!0,monospace:!0,children:N})]}),(0,w.jsx)(u.Z,{light:!0}),(0,w.jsxs)(h.Z,{p:k.cd,children:[(0,w.jsx)(h.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Project UUID"})}),(0,w.jsx)(v.ZP,{default:!!L,monospace:!0,muted:!L,children:L||"Not required"})]}),(0,w.jsx)(u.Z,{light:!0}),(0,w.jsx)(h.Z,{p:k.cd,children:(0,w.jsxs)(s.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(a.Z,{flexDirection:"column",children:[(0,w.jsx)(h.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Help improve Mage"})}),(0,w.jsxs)(v.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,w.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,w.jsx)(h.Z,{mr:k.cd}),(0,w.jsx)(b.Z,{checked:null===I||void 0===I?void 0:I.help_improve_mage,onCheck:function(){return T((function(e){return _(_({},e),{},{help_improve_mage:!(null!==I&&void 0!==I&&I.help_improve_mage)})}))}})]})})]}),(0,w.jsx)(h.Z,{mt:k.HN}),(0,w.jsx)(f.Z,{noPadding:!0,children:(0,w.jsxs)(h.Z,{p:k.cd,children:[(0,w.jsx)(h.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"Features"})}),Object.entries((null===I||void 0===I?void 0:I.features)||{}).map((function(e){var n=(0,r.Z)(e,2),t=n[0],o=n[1];return(0,w.jsxs)(s.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsx)(v.ZP,{default:!0,monospace:!0,children:t}),(0,w.jsx)(h.Z,{mr:k.cd}),(0,w.jsx)(b.Z,{checked:!!o,onCheck:function(){return T((function(e){return _(_({},e),{},{features:_(_({},null===I||void 0===I?void 0:I.features),{},(0,i.Z)({},t,!o))})}))}})]},t)}))]})}),(0,w.jsx)(h.Z,{mt:k.HN}),(0,w.jsx)(f.Z,{noPadding:!0,children:(0,w.jsxs)(h.Z,{p:k.cd,children:[(0,w.jsx)(h.Z,{mb:1,children:(0,w.jsx)(d.Z,{level:5,children:"OpenAI"})}),(0,w.jsx)(m.Z,{label:"API key",monospace:!0,onChange:function(e){return T((function(n){return _(_({},n),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===I||void 0===I?void 0:I.openai_api_key)||""})]})}),(0,w.jsx)(h.Z,{mt:k.HN}),(0,w.jsxs)(s.ZP,{alignItems:"center",children:[(0,w.jsx)(c.Z,{loading:W,onClick:function(){z({features:null===I||void 0===I?void 0:I.features,help_improve_mage:null===I||void 0===I?void 0:I.help_improve_mage,openai_api_key:null===I||void 0===I?void 0:I.openai_api_key})},primary:!0,children:"Save project settings"}),j&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(h.Z,{mr:k.cd}),(0,w.jsx)(c.Z,{onClick:j,secondary:!0,children:n||"Cancel"})]})]})]});return t?(0,w.jsx)(Z,{children:V}):V}},76096:function(e,n,t){"use strict";var i=t(82394),r=t(26304),o=(t(82684),t(33591)),l=t(28598),c=["children","fullHeight","gutter","style"];function u(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,u=e.style,s=void 0===u?{}:u,d=(0,r.Z)(e,c),p=a({},s);return i&&(p.paddingLeft=i,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,l.jsx)(o.Col,a(a({},d),{},{style:p,children:n}))}},97361:function(e,n,t){"use strict";var i=t(82394),r=t(26304),o=t(82684),l=t(33591),c=t(28598),u=["children","fullHeight","gutter","justifyContent","style"];function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,a=e.justifyContent,d=e.style,p=void 0===d?{}:d,f=(0,r.Z)(e,u),h=s({},p);return i&&(h.marginLeft=-1*i,h.marginRight=h.marginLeft),t&&(h.height="100%"),(0,c.jsx)(l.Row,s(s({},f),{},{justifyContent:a,style:h,children:o.Children.map(n,(function(e,n){return e&&o.cloneElement(e,{gutter:i,key:n})}))}))}},18221:function(e,n,t){"use strict";var i;t.d(n,{R:function(){return r}}),function(e){e.AZURE_CONTAINER_INSTANCE="azure_container_instance",e.ECS="ecs",e.GCP_CLOUD_RUN="gcp_cloud_run",e.K8S="k8s",e.LOCAL_PYTHON="local_python",e.PYSPARK="pyspark"}(i||(i={}));var r=[i.AZURE_CONTAINER_INSTANCE,i.ECS,i.GCP_CLOUD_RUN,i.K8S,i.LOCAL_PYTHON,i.PYSPARK]},30119:function(e,n,t){"use strict";var i;t.d(n,{b:function(){return i}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(i||(i={}))},93348:function(e,n,t){"use strict";t.d(n,{TR:function(){return d},U5:function(){return u},Xm:function(){return o},Z4:function(){return s},fq:function(){return c},kJ:function(){return a}});var i,r,o,l=t(82394);!function(e){e.API="api",e.EVENT="event",e.TIME="time"}(o||(o={}));var c,u,a,s=(i={},(0,l.Z)(i,o.API,(function(){return"API"})),(0,l.Z)(i,o.EVENT,(function(){return"event"})),(0,l.Z)(i,o.TIME,(function(){return"schedule"})),i);!function(e){e.ACTIVE="active",e.INACTIVE="inactive"}(c||(c={})),function(e){e.ONCE="@once",e.HOURLY="@hourly",e.DAILY="@daily",e.WEEKLY="@weekly",e.MONTHLY="@monthly"}(u||(u={})),function(e){e.CREATED_AT="created_at",e.NAME="name",e.PIPELINE="pipeline_uuid",e.STATUS="status",e.TYPE="schedule_type"}(a||(a={}));var d=(r={},(0,l.Z)(r,a.CREATED_AT,"Created at"),(0,l.Z)(r,a.NAME,"Name"),(0,l.Z)(r,a.PIPELINE,"Pipeline"),(0,l.Z)(r,a.STATUS,"Status"),(0,l.Z)(r,a.TYPE,"Type"),r)},52769:function(e,n,t){"use strict";t.d(n,{C:function(){return i}});var i="global"},79891:function(e,n,t){"use strict";var i=t(38626),r=t(60328),o=t(67971),l=t(86673),c=t(19711),u=t(23831),a=t(22341),s=t(49125),d=t(31012),p=t(28598),f=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||u.Z.background).tag,";\n ")}),(function(e){return e.primary&&"\n background-color: ".concat((e.theme.chart||u.Z.chart).primary,";\n ")}),(function(e){return!e.small&&"\n border-radius: ".concat((s.iI+d.Al)/2,"px;\n height: ").concat(1.5*s.iI+d.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+d.Al)/2,"px;\n height: ").concat(d.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||u.Z.content).muted,";\n ")}));n.Z=function(e){var n=e.border,t=e.children,i=e.disabled,u=e.label,d=e.onClick,h=e.primary,v=e.small;return(0,p.jsx)(f,{border:n,primary:h,small:v,children:(0,p.jsx)(r.Z,{basic:!0,disabled:i,noBackground:!0,noPadding:!0,onClick:d,transparent:!0,children:(0,p.jsxs)(o.ZP,{alignItems:"center",children:[t,u&&(0,p.jsx)(c.ZP,{small:v,children:u}),!i&&d&&(0,p.jsx)(l.Z,{ml:1,children:(0,p.jsx)(a.x8,{default:h,muted:!h,size:v?s.iI:1.25*s.iI})})]})})})}},65730:function(e,n,t){"use strict";var i,r=t(82394),o=(t(82684),t(64866)),l=t(21764),c=t(67971),u=t(10919),a=t(86673),s=t(19711),d=t(46261),p=t(22341),f=t(49125),h=t(28598);function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function m(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}!function(e){e.LEFT="left",e.RIGHT="right"}(i||(i={})),n.Z=function(e){var n,t=e.children,r=e.copiedText,v=e.iconPosition,b=void 0===v?i.LEFT:v,g=e.inverted,x=e.linkProps,j=e.linkText,y=e.monospace,k=e.muted,Z=e.small,O=e.toastMessage,P=e.withCopyIcon;return t?n=(0,h.jsx)("span",{children:t}):P&&(n=(0,h.jsx)(u.Z,m(m({href:"#",inline:!0,muted:k,preventDefault:!0,sameColorAsText:!0,small:Z},x),{},{children:(0,h.jsxs)(c.ZP,{alignItems:"center",children:[b===i.LEFT&&(0,h.jsx)(a.Z,{mr:j?1:0,children:(0,h.jsx)(c.ZP,{alignItems:"center",children:(0,h.jsx)(p.CK,{inverted:g,muted:k,size:2*f.iI})})}),j&&(0,h.jsx)(s.ZP,{inverted:g,monospace:y,muted:k,small:Z,children:j}),b===i.RIGHT&&(0,h.jsx)(a.Z,{ml:j?1:0,children:(0,h.jsx)(c.ZP,{alignItems:"center",children:(0,h.jsx)(p.CK,{inverted:g,muted:k})})})]})}))),(0,h.jsx)(d.Z,{block:!0,label:"Copy",size:null,widthFitContent:!0,children:(0,h.jsx)(o.CopyToClipboard,{onCopy:function(){return l.Am.success(O||"Successfully copied to clipboard.",{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:r})},text:r,children:n})})}},18776:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var i=t(38626),r=t(23831),o=t(73942),l=i.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;"," ",""],o.n_,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).panel,";\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),c=t(28598);var u=function(e){var n=e.children,t=e.fullWidth,i=void 0===t||t;return(0,c.jsx)(l,{fullWidth:i,children:n})}},98636:function(e,n,t){"use strict";t.d(n,{g:function(){return b},Z:function(){return g}});var i=t(82684),r=t(38626),o=t(23831),l=t(73942),c=t(37391),u=t(49125),a=1.5*u.iI,s=1.5*u.iI,d=r.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-13p7y8j-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," ",""],l.n_,(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme||o.Z).background.page,";\n border: ").concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||o.Z).interactive.defaultBorder,";\n box-shadow: ").concat((e.theme||o.Z).shadow.frame,";\n ")}),(function(e){return e.noBackground&&"\n background-color: transparent;\n "}),(function(e){return e.noBoxShadow&&"\n box-shadow: none;\n "})),p=r.default.div.withConfig({displayName:"indexstyle__RowContainerStyle",componentId:"sc-13p7y8j-1"})(["overflow:auto;border-bottom-left-radius:","px;border-bottom-right-radius:","px;"," "," "," ",""],l.n_,l.n_,c.w5,(function(e){return e.maxHeight>0&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),(function(e){return e.minHeight>0&&"\n min-height: ".concat(e.minHeight,"px;\n ")}),(function(e){return e.scrollable&&"\n margin-bottom: ".concat(u.iI,"px;\n overflow-y: auto;\n padding-top: ").concat(3,"px;\n padding-left: ").concat(3,"px;\n padding-right: ").concat(3,"px;\n ")})),f=r.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-13p7y8j-2"})(["border-top-left-radius:","px;border-top-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,a,2*u.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")})),h=r.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-13p7y8j-3"})(["padding:","px ","px;"," "," "," "," "," ",""],s,2*u.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||o.Z).borders.medium2,";\n ")}),(function(e){return e.sameColorBorders&&"\n border-bottom-color: ".concat((e.theme||o.Z).interactive.defaultBorder,";\n ")}),(function(e){return e.noHorizontalPadding&&"\n padding-left: 0;\n padding-right: 0;\n "}),(function(e){return e.condensed&&"\n padding-top: ".concat(9,"px;\n padding-bottom: ").concat(9,"px;\n ")}),(function(e){return e.secondary&&"\n background-color: ".concat((e.theme.background||o.Z.background).row2,";\n ")}),(function(e){return e.last&&e.noBorder&&"\n border-bottom-left-radius: ".concat(l.n_,"px;\n border-bottom-right-radius: ").concat(l.n_,"px;\n border-bottom: none;\n ")})),v=r.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-13p7y8j-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,a,2*u.iI,(function(e){return"\n border-top: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||o.Z).borders.medium2,";\n ")})),m=t(28598),b=h;var g=function(e){var n=e.alternating,t=e.children,r=e.footer,o=e.header,l=e.maxHeight,c=e.minHeight,u=e.noBackground,a=e.noBoxShadow,s=e.sameColorBorders,h=e.scrollable,b=e.width,g=[].concat(t).filter((function(e){return null!==e}));return(0,m.jsxs)(d,{noBackground:u,noBoxShadow:a,width:b,children:[o&&(0,m.jsx)(f,{children:o}),(0,m.jsx)(p,{maxHeight:l,minHeight:c,scrollable:h,children:i.Children.map(g,(function(e,t){return e&&i.cloneElement(e,{last:t===g.length-1,sameColorBorders:s,secondary:n&&t%2===1})}))}),r&&(0,m.jsx)(v,{children:r})]})}},79938:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return go}});var i=t(77837),r=t(21831),o=t(82394),l=t(75582),c=t(38860),u=t.n(c),a=t(56085),s=t(82684),d=t(83455),p=t(34376),f=t(48591),h=t(35490),v=t(86422),m=t(38626),b=t(38341),g=t(16634),x=t(34744),j=t(93461),y=t(67971),k=t(10919),Z=t(86673),O=t(19711),P=t(49125),w=t(44162),C=t(28598);function _(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function S(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var E=function(e){var n=e.blockRefs,t=e.hiddenBlocks,i=e.pipeline,r=e.setHiddenBlocks,l=(0,s.useContext)(m.ThemeContext),c=(0,s.useMemo)((function(){return(null===i||void 0===i?void 0:i.blocks)||[]}),[i]),u=(0,s.useMemo)((function(){var e=[],n=[];return c.forEach((function(i){var r=i.uuid;null!==t&&void 0!==t&&t[r]?e.push(i):n.push(i)})),{blocksHidden:e,blocksVisible:n}}),[c,t]),a=u.blocksHidden,d=u.blocksVisible,p=(0,s.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)>=1&&0===d.length}),[c,d]),f=(0,s.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)>=1&&0===a.length}),[c,a]),h=(0,s.useCallback)((function(e){var t=e.type,i=e.uuid;if(null!==n&&void 0!==n&&n.current){var r,o=n.current["".concat(t,"s/").concat(i,".py")];null===o||void 0===o||null===(r=o.current)||void 0===r||r.scrollIntoView()}}),[n]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:1,justifyContent:"center",children:(0,C.jsx)(b.Z,{checked:f,label:"Show all",onClick:function(){return r((function(){return{}}))}})}),(0,C.jsx)(j.Z,{flex:1,justifyContent:"center",children:(0,C.jsx)(b.Z,{checked:p,label:"Hide all",onClick:function(){return r((function(){return c.reduce((function(e,n){var t=n.uuid;return S(S({},e),{},(0,o.Z)({},t,!0))}),{})}))}})})]})}),(0,C.jsx)(x.Z,{medium:!0}),null===c||void 0===c?void 0:c.map((function(e){var n=e.uuid,i=(0,w.qn)(e.type,{blockColor:e.color,theme:l}).accent,c=!(null!==t&&void 0!==t&&t[n]);return(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){r((function(e){return S(S({},e),{},(0,o.Z)({},n,c))})),c||setTimeout((function(){return h(e)}),1)},preventDefault:!0,children:(0,C.jsx)(Z.Z,{mt:1,px:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(Z.Z,{pr:1,children:(0,C.jsx)(b.Z,{checked:c})}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(g.Z,{color:i,size:1.5*P.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},I=t(2485),T=t(60328),D=t(32316),A=t(65701),M=t(1254);var B=function(e){var n=e.size;return(0,C.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,C.jsx)("path",{d:"M67.7193 2.36691C69.8656 1.52184 72.3078 2.0081 73.9667 3.61084L116.977 45.1646C119.018 47.1366 119.362 50.2841 117.794 52.65L92.5787 90.7113C92.1293 91.3897 91.5441 91.9675 90.8601 92.4083L51.1076 118.029C48.6859 119.589 45.4904 119.168 43.5558 117.033L3.02296 72.3013C1.48382 70.6027 1.07052 68.1652 1.96372 66.0542L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L67.7193 2.36691Z",fill:"url(#paint0_radial_11972_15232)"}),(0,C.jsx)("path",{d:"M71.2431 0.979492L23.6155 19.9931C22.1646 20.5723 21.0034 21.7045 20.3877 23.1402L0.499023 69.5159L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L71.2431 0.979492Z",fill:"url(#paint1_radial_11972_15232)"}),(0,C.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint3_radial_11972_15232)"}),(0,C.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint4_linear_11972_15232)"}),(0,C.jsx)("path",{d:"M23.3591 24.6945L58.2913 58.6736L25.3897 22.7247C24.8455 22.13 23.9152 22.1095 23.3452 22.6795C22.7871 23.2375 22.7934 24.1442 23.3591 24.6945Z",fill:"url(#paint5_radial_11972_15232)"}),(0,C.jsx)("path",{d:"M51.6694 46.395L73.0043 69.5215C73.6132 70.1816 74.5925 70.3441 75.382 69.9161L117.654 46.9975L75.6257 67.8209C74.8809 68.1899 73.9844 68.0497 73.3879 67.4708L51.6694 46.395Z",fill:"url(#paint6_radial_11972_15232)"}),(0,C.jsxs)("defs",{children:[(0,C.jsxs)("radialGradient",{id:"paint0_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16.9412 88.4412) rotate(18.02) scale(82.0367 81.4644)",children:[(0,C.jsx)("stop",{stopColor:"#FFDA19"}),(0,C.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,C.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,C.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,C.jsxs)("radialGradient",{id:"paint1_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(35.8711 10.2518) rotate(87.6364) scale(26.1711 27.0141)",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("radialGradient",{id:"paint2_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(150.671 44.2502) rotate(128.639) scale(125.554 128.436)",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("radialGradient",{id:"paint3_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(133.353 52.8357) rotate(144.647) scale(86.7385 72.7129)",children:[(0,C.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,C.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("radialGradient",{id:"paint5_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(25.2251 23.4978) rotate(48.3599) scale(35.5147 43.1672)",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,C.jsxs)("radialGradient",{id:"paint6_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(76.5908 67.6516) rotate(104.629) scale(14.9575 79.0374)",children:[(0,C.jsx)("stop",{stopColor:"white"}),(0,C.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},R=t(95689),N=t(11135),L=t(33572),F=t(98781),U=t(55378),H=t(54283),W=t(82944),z=t(82531),V=t(22341),G=t(68579),K=(P.iI,2*P.iI),Y=(P.iI,3*P.iI),q=t(72470),Q=t(90211),J=t(96510),X=t(9728);function $(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ee(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?$(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ne=function(e){var n,t=e.block,i=e.defaultName,r=e.isUpdatingBlock,o=e.onClose,c=e.onSave,u=e.pipeline,a=(e.preventDuplicateBlockName,(0,X.VI)(null,{},[],{uuid:"ConfigureBlock"})),p=(0,l.Z)(a,1)[0],f=Object.keys((null===t||void 0===t?void 0:t.pipelines)||{}).length,h=(0,s.useRef)(null),m=(0,s.useState)({color:(null===t||void 0===t?void 0:t.color)||null,language:null===t||void 0===t?void 0:t.language,name:i,type:null===t||void 0===t?void 0:t.type}),b=m[0],g=m[1];(0,s.useEffect)((function(){var e;null===h||void 0===h||null===(e=h.current)||void 0===e||e.focus()}),[]);var x=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===u||void 0===u?void 0:u.type)}),[u]),k=(0,s.useMemo)((function(){return v.tf.CUSTOM===(null===t||void 0===t?void 0:t.type)}),[t]),w=(0,s.useMemo)((function(){return v.tf.MARKDOWN===(null===t||void 0===t?void 0:t.type)}),[t]),_=(0,s.useMemo)((function(){return null===t||void 0===t?void 0:t.block_action_object}),[t]),S=(0,s.useMemo)((function(){return q.L.GENERATE_BLOCK===(null===_||void 0===_?void 0:_.object_type)}),[_]),E=(0,s.useMemo)((function(){return S&&(null===_||void 0===_?void 0:_.description)}),[_,S]),I=(0,s.useState)(null),D=I[0],K=I[1],$=(0,d.Db)(z.ZP.llms.useCreate(),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(e){var n=e.llm,t=(null===n||void 0===n?void 0:n.response)||{},i=t.block_type,r=t.configuration,o=t.content,l=t.language;g((function(e){return ee(ee({},e),{},{block_action_object:null,configuration:r,content:o,language:l,type:i})})),K(n)},onErrorCallback:function(e,n){return p({errors:n,response:e})}})}}),ne=(0,l.Z)($,2),te=ne[0],ie=ne[1].isLoading;(0,s.useEffect)((function(){S&&E&&!D&&te({llm:{request:{block_description:E},use_case:L.z.GENERATE_BLOCK_WITH_DESCRIPTION}})}),[te,E,S,D]);var re=(0,s.useMemo)((function(){var e,n;return null!==t&&void 0!==t&&null!==(e=t.config)&&void 0!==e&&e.custom_template?null===t||void 0===t||null===(n=t.config)||void 0===n?void 0:n.custom_template:[q.L.CUSTOM_BLOCK_TEMPLATE,q.L.MAGE_TEMPLATE].includes(null===_||void 0===_?void 0:_.object_type)?ee(ee({},_),{},{name:null===_||void 0===_?void 0:_.title}):void 0}),[t,_]),oe=(0,s.useMemo)((function(){var e=(null===b||void 0===b?void 0:b.type)||(null===t||void 0===t?void 0:t.type);re&&(e=null===re||void 0===re?void 0:re.block_type);var n=v.V4[e];return x&&(v.tf.DATA_LOADER===e?n="Source":v.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[t,b,re,x]);return(0,C.jsxs)(G.Nk,{width:S&&(null===b||void 0===b?void 0:b.content)&&80*P.iI,children:[(0,C.jsxs)(G.I5,{children:[S&&ie&&(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(O.ZP,{children:"Generating block using AI..."}),(0,C.jsx)(H.Z,{inverted:!0})]}),S&&!ie&&(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(V.xq,{size:5*P.iI,warning:!0})}),!S&&(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",children:(0,C.jsx)(B,{size:15*P.iI})})]}),S&&!ie&&(0,C.jsx)(G.gI,{children:(0,C.jsxs)(Z.Z,{py:1,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(O.ZP,{default:!0,children:"Block generated using AI"})}),(0,C.jsx)(O.ZP,{textOverflow:!0,children:E})]})}),re&&(0,C.jsx)(G.gI,{children:(0,C.jsxs)(Z.Z,{py:1,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(O.ZP,{default:!0,children:"Template"})}),(0,C.jsx)(O.ZP,{textOverflow:!0,children:null===(n=(null===re||void 0===re?void 0:re.name)||(null===re||void 0===re?void 0:re.template_uuid))||void 0===n?void 0:n.slice(0,40)})]})}),v.tf.GLOBAL_DATA_PRODUCT!==(null===t||void 0===t?void 0:t.type)&&f>1&&(0,C.jsxs)(G.gI,{children:[(0,C.jsx)(j.Z,{flex:"1",children:(0,C.jsx)(V.uy,{size:Y,warning:!0})}),(0,C.jsx)(j.Z,{flex:"6",children:(0,C.jsxs)(O.ZP,{bold:!0,warning:!0,children:["Renaming this block will affect ",f," pipelines. The renamed block may need to be re-added to the shared pipeline(s)."]})})]}),(0,C.jsxs)(G.gI,{children:[(0,C.jsx)(O.ZP,{default:!0,children:"Name"}),(0,C.jsx)(W.Z,{alignRight:!0,noBackground:!0,noBorder:!0,onChange:function(e){return g((function(n){return ee(ee({},n),{},{name:e.target.value})}))},paddingVertical:P.iI,placeholder:"Block name...",ref:h,value:(null===b||void 0===b?void 0:b.name)||""})]}),(0,C.jsxs)(G.gI,{children:[(0,C.jsx)(O.ZP,{default:!0,children:"Type"}),(0,C.jsx)(Z.Z,{mr:P.cd,py:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{muted:!0,children:oe}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(V.QM,{muted:!0})]})})]}),!w&&(k||re||(null===b||void 0===b?void 0:b.language))&&(0,C.jsxs)(G.gI,{paddingVerticalAddition:3,children:[(0,C.jsx)(O.ZP,{default:!0,children:"Language"}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[[v.t6.PYTHON,v.t6.SQL,v.t6.R].reduce((function(e,n){var t=(re?null===re||void 0===re?void 0:re.language:null===b||void 0===b?void 0:b.language)===n;return k&&!r||t?(e.push((0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(T.Z,{borderColor:t?null:"transparent",compact:!0,default:!k&&!t,disabled:!k&&!t,noBackground:!0,notClickable:(!k||r)&&t,onClick:re?null:function(){return g((function(e){return ee(ee({},e),{},{language:n})}))},selected:t,children:v.LE[n]})},n)),e):e}),[]),!k&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(V.QM,{muted:!0})]}),(0,C.jsx)(Z.Z,{mr:k?1:2})]})]}),(k||(null===re||void 0===re?void 0:re.color)||(null===b||void 0===b?void 0:b.color))&&(0,C.jsxs)(G.gI,{children:[(0,C.jsx)(O.ZP,{default:!0,children:"Color"}),k&&(0,C.jsxs)(U.Z,{alignRight:!0,noBackground:!0,noBorder:!0,onChange:function(e){return g((function(n){return ee(ee({},n),{},{color:e.target.value})}))},value:re?(null===re||void 0===re?void 0:re.color)||"":(null===b||void 0===b?void 0:b.color)||"",children:[(0,C.jsx)("option",{value:""}),Object.values(v.Lq).map((function(e){return(0,C.jsx)("option",{value:e,children:(0,Q.kC)(e)},e)}))]}),!k&&(0,C.jsx)(Z.Z,{mr:P.cd,py:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{muted:!0,children:(0,Q.kC)((null===re||void 0===re?void 0:re.color)||(null===b||void 0===b?void 0:b.color)||"")}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(V.QM,{muted:!0})]})})]}),S&&(null===b||void 0===b?void 0:b.content)&&(0,C.jsx)(G.gI,{display:"block",children:(0,C.jsx)(Z.Z,{pr:P.cd,py:1,children:(0,C.jsx)(A.W,{backend:M.PD,children:(0,C.jsx)(R.Z,{block:ee(ee({},b),{},{uuid:E}),defaultValue:null===b||void 0===b?void 0:b.content,disableDrag:!0,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,noDivider:!0,onChange:function(e){return g((function(n){return ee(ee({},n),{},{content:e})}))},selected:!0,textareaFocused:!0},E)})})}),(0,C.jsx)(G.$b,{children:(0,C.jsxs)(y.ZP,{fullWidth:!0,children:[(0,C.jsxs)(N.ZP,{bold:!0,centerText:!0,disabled:ie,onClick:function(){return c(ee(ee({},b),{},{name:(null===b||void 0===b?void 0:b.name)||i}))},primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:["Save and ",r?"update":"add"," block"]}),(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(T.Z,{onClick:o,tabIndex:0,children:"Cancel"})})]})})]})},te=t(46299),ie=t(91207),re=t(47999),oe=t(62084),le=t(16115),ce=t(64318),ue=t(54405),ae=t(41150);function se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function de(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?se(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pe,fe,he=function(e){var n=e.cancelPipeline,t=e.children,i=e.createPipeline,r=e.executePipeline,l=e.interruptKernel,c=e.isPipelineExecuting,u=e.pipeline,a=e.restartKernel,d=e.savePipelineContent,p=(e.setActiveSidekickView,e.setMessages),f=(0,s.useState)(null),h=f[0],v=f[1],m=(0,s.useRef)(null),b=(0,s.useRef)(null),g=(0,s.useRef)(null),x=[{label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,Q.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,Q.Y6)(),type:F.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{keyTextGroups:[[(0,ue.V5)()?le.RJ:le.hE,le.SS]],label:function(){return"Save pipeline"},onClick:function(){return d()},uuid:"save_pipeline"}],j=(0,s.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[le.kA],[le.kA]],onClick:function(){return l()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[le.t_[le.OC]],[le.t_[le.OC]]],onClick:function(){return a()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return p((function(e){return Object.keys(e).reduce((function(e,n){return de(de({},e),{},(0,o.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return c?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):e.push({label:function(){return"Execute pipeline"},onClick:function(){return r()},uuid:"Execute pipeline"}),e}),[n,r,l,c,a,p]),k=(0,s.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null===u||void 0===u?void 0:u.uuid,"/settings"),href:"/pipelines/[pipeline]/settings"},uuid:"Pipeline settings"},{label:function(){return"Browse custom templates"},linkProps:{href:"/templates"},uuid:"browse_custom_templates"},{label:function(){return"Create custom templates"},linkProps:{href:"/templates?new=1"},uuid:"create_custom_templates"}]}),[u]),Z="FileHeaderMenu/index",P=(0,ae.y)(),w=P.registerOnKeyDown,_=P.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){_(Z)}}),[_,Z]),w(Z,(function(e,n,t){null!==h&&(n[le.QK]?v((function(e){return 0===e?2:e-1})):n[le.DY]&&v((function(e){return 2===e?0:e+1})))}),[h,v]),(0,C.jsx)(re.Z,{onClickOutside:function(){return v(null)},open:!0,style:{position:"relative"},children:(0,C.jsxs)(y.ZP,{children:[(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(ce.u,{highlighted:0===h,onClick:function(){return v((function(e){return 0===e?null:0}))},onMouseEnter:function(){return v((function(e){return null!==e?0:null}))},ref:m,children:(0,C.jsx)(O.ZP,{children:"File"})}),(0,C.jsx)(oe.Z,{items:x,onClickCallback:function(){return v(null)},open:0===h,parentRef:m,uuid:"FileHeaderMenu/file_items"})]}),(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(ce.u,{highlighted:1===h,onClick:function(){return v((function(e){return 1===e?null:1}))},onMouseEnter:function(){return v((function(e){return null!==e?1:null}))},ref:b,children:(0,C.jsx)(O.ZP,{children:"Run"})}),(0,C.jsx)(oe.Z,{items:j,onClickCallback:function(){return v(null)},open:1===h,parentRef:b,uuid:"FileHeaderMenu/run_items"})]}),(0,C.jsxs)("div",{style:{position:"relative"},children:[(0,C.jsx)(ce.u,{highlighted:2===h,onClick:function(){return v((function(e){return 2===e?null:2}))},onMouseEnter:function(){return v((function(e){return null!==e?2:null}))},ref:g,children:(0,C.jsx)(O.ZP,{children:"Edit"})}),(0,C.jsx)(oe.Z,{items:k,onClickCallback:function(){return v(null)},open:2===h,parentRef:g,uuid:"FileHeaderMenu/edit_items"})]}),t]})})},ve=t(38488),me=t(73828),be=t(65232),ge=t(57384);!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(pe||(pe={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(fe||(fe={}));var xe,je=t(90686),ye=t(62609),ke=t(46261),Ze=t(23831),Oe=t(66166);!function(e){e.EMR="emr"}(xe||(xe={}));var Pe=t(91427),we=t(28347),Ce=t(42305),_e=t(24224),Se=t(33766),Ee=t(99497);var Ie=function(e){var n,t=e.children,i=(e.filePaths,e.filesTouched,e.isBusy),o=e.isPipelineUpdating,c=e.kernel,u=e.pipeline,a=e.pipelineContentTouched,p=e.pipelineLastSaved,f=(e.restartKernel,e.savePipelineContent,e.selectedFilePath),h=e.setErrors,v=e.setRunningBlocks,b=e.updatePipelineMetadata,x=(0,s.useContext)(m.ThemeContext),w=c||{},_=w.alive,S=w.usage,E=(0,s.useState)(!1),I=E[0],T=E[1],D=(0,s.useState)(""),A=D[0],M=D[1],B=(0,s.useState)(xe.EMR),R=B[0],L=(B[1],(0,s.useState)(!1)),U=L[0],H=L[1],W=(0,s.useState)(!1),G=W[0],K=W[1],Y=(0,s.useRef)(null),q=z.ZP.clusters.detail(R,{},{revalidateOnFocus:!1}),Q=q.data,X=q.mutate,$=(0,s.useMemo)((function(){var e;return(null===Q||void 0===Q||null===(e=Q.cluster)||void 0===e?void 0:e.clusters)||[]}),[Q]),ee=(0,s.useMemo)((function(){return(0,_e.sE)($,(function(e){return e.is_active}))}),[$]),ne=(0,d.Db)(z.ZP.clusters.useUpdate(R),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){X()},onErrorCallback:function(e,n){return h({errors:n,response:e})}})}}),te=(0,l.Z)(ne,1)[0];(0,s.useEffect)((function(){null!==u&&void 0!==u&&u.uuid&&M(u.uuid)}),[null===u||void 0===u?void 0:u.uuid]),n=a?"Unsaved changes":o?"Saving changes...":p?"Last saved ".concat((0,Ce.JX)(Number(p)/1e3)):"All changes saved";var ie="KernelStatus",ce=(0,ae.y)(),se=ce.registerOnKeyDown,de=ce.unregisterOnKeyDown;(0,s.useEffect)((function(){return function(){de(ie)}}),[de,ie]),se(ie,(function(e,n,t){I&&String(t[0])===String(le.Uq)&&String(t[1])!==String(le.zX)&&((null===u||void 0===u?void 0:u.uuid)===A?e.target.blur():(b(A),T(!1)))}),[I,A,T,b]);var pe=(0,s.useMemo)((function(){return null===S||void 0===S?void 0:S.pid}),[null===S||void 0===S?void 0:S.pid]),he=(0,Oe.Z)(pe),ve=(0,s.useMemo)((function(){if(null!==S&&void 0!==S&&S.kernel_memory){var e=S.kernel_memory,n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(2))).concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}}),[null===S||void 0===S?void 0:S.kernel_memory]),me=(0,Ee.dd)((function(){return(0,C.jsx)(ye.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:Ie,onClick:function(){(0,Pe.t8)(Pe.DU,1),Ie()},subtitle:"You may need to refresh your page to continue using the notebook. Unexpected kernel restarts may be caused by your kernel running out of memory.",title:"The kernel has restarted",width:34*P.iI})}),{},[],{background:!0,uuid:"restart_kernel_warning"}),be=(0,l.Z)(me,2),ge=be[0],Ie=be[1];(0,s.useEffect)((function(){var e=(0,Pe.U2)(Pe.DU,0);pe!==he&&i&&!e&&(ge(),v([]))}),[i,pe,he,v,ge]);var Te=(0,s.useMemo)((function(){return(0,C.jsx)("div",{ref:Y,style:{position:"relative"},children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(null===u||void 0===u?void 0:u.type)===F.qL.PYSPARK&&(0,C.jsxs)(Z.Z,{mr:1,children:[(0,C.jsxs)(k.Z,{muted:!!ee,onClick:function(){return H(!0)},preventDefault:!0,sameColorAsText:!ee,underline:!ee,children:[ee&&ee.id,!ee&&"Select cluster"]}),(0,C.jsx)(re.Z,{disableEscape:!0,onClickOutside:function(){return H(!1)},open:U,children:(0,C.jsx)(oe.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,r.Z)($.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(O.ZP,{muted:!t&&fe.WAITING!==i,children:n})}),t&&(0,C.jsx)(V.Jr,{size:2*P.iI,success:!0}),!t&&(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||fe.WAITING!==i?null:function(){return te({cluster:{id:n,is_active:!0}})},uuid:n}})))),onClickCallback:function(){return H(!1)},open:U,parentRef:Y,uuid:"KernelStatus/select_cluster",width:40*P.iI})})]}),(0,C.jsx)(N.ZP,{beforeElement:(0,C.jsx)(g.Z,{color:i?(x||Ze.Z).borders.info:_?(x||Ze.Z).borders.success:(x||Ze.Z).borders.danger,size:P.iI}),blackBorder:!0,compact:!0,inline:!0,onClick:function(){return K(!0)},uuid:"Pipeline/KernelStatus/kernel",children:(null===u||void 0===u?void 0:u.type)||F.qL.PYTHON}),(0,C.jsx)(re.Z,{disableEscape:!0,onClickOutside:function(){return K(!1)},open:G,children:(0,C.jsx)(oe.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,r.Z)(Object.keys(F.a_).filter((function(e){return(null===u||void 0===u?void 0:u.type)!=e})).map((function(e){return{label:function(){return e},onClick:function(){return b(null===u||void 0===u?void 0:u.name,e)},uuid:e}})))),onClickCallback:function(){return K(!1)},open:G,parentRef:Y,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*P.iI})})]})})}),[_,$,i,u,ee,H,K,U,G,x,te,b]);return(0,C.jsx)(we.rK,{relativePosition:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,C.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:[(0,C.jsxs)(Z.Z,{px:P.cd,children:[f&&(0,C.jsx)(k.Z,{noHoverUnderline:!0,noOutline:!0,onClick:f?function(){return(0,Se.u7)({file_path:null})}:null,preventDefault:!0,children:t}),!f&&(0,C.jsxs)(y.ZP,{alignItems:"center",children:[t,I&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(k.Z,{onClick:function(){b(A),T(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]})]}),S&&(0,C.jsx)(Z.Z,{mr:P.cd,children:(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsxs)(O.ZP,{monospace:!0,muted:!0,xsmall:!0,children:["CPU: ",null===S||void 0===S?void 0:S.kernel_cpu,"undefined"!==typeof(null===S||void 0===S?void 0:S.kernel_cpu)&&"%"]}),(0,C.jsxs)(O.ZP,{monospace:!0,muted:!0,xsmall:!0,children:["Memory: ",ve]})]})})]}),(0,C.jsx)(Z.Z,{px:P.cd,children:(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(ke.Z,{appearBefore:!0,block:!0,description:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,C.jsx)(je.Z,{inline:!0,keyText:(0,ue.V5)()?le.RJ:le.hE}),"\xa0",(0,C.jsx)(O.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,C.jsx)(je.Z,{inline:!0,keyText:le.SS}),"\xa0",(0,C.jsx)(O.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,C.jsx)("br",{})]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["Or, go to ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,C.jsx)(O.ZP,{muted:!0,children:n})}),(0,C.jsx)(Z.Z,{ml:2}),Te]})})]})})},Te=t(82635),De=t(29237),Ae=t(17717),Me=t(12691),Be=t.n(Me),Re=t(16910),Ne=t(28317),Le=t(26304),Fe=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];function Ue(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 He(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ue(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ue(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var We=m.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*P.iI),ze=m.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var Ve=function(e){var n=e.bold,t=void 0===n||n,i=e.defaultColor,r=e.description,o=e.disableWordBreak,l=e.fullWidth,c=e.inputValue,u=e.inputWidth,a=e.invertedTheme,d=e.label,p=e.labelColor,f=e.menuOpen,h=void 0!==f&&f,v=e.monospace,m=e.muted,b=e.onClick,g=e.notRequired,x=e.selectedTextProps,P=e.small,w=e.stacked,_=e.suffixValue,S=e.tooltipProps,E=e.value,I=(0,Le.Z)(e,Fe),T=(0,s.useRef)(null),D=(0,s.useState)(!1),A=D[0],M=D[1],B=(0,s.useState)(!1),R=B[0],N=B[1],L=d&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(O.ZP,{bold:t,color:p,inverted:a,lineHeight:20,monospace:v,muted:m,small:P,children:d}),S&&(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(ke.Z,He({muted:!0},S))})]}),F=(0,C.jsxs)(j.Z,{flex:l?"1":"none",children:[E&&(0,C.jsx)(k.Z,{block:!0,danger:null===x||void 0===x?void 0:x.danger,fullWidth:!0,muted:m,onClick:function(){b(),T.current&&T.current.focus(),M(!0)},preventDefault:!0,sameColorAsText:m||!(null!==x&&void 0!==x&&x.primary)&&!(null!==x&&void 0!==x&&x.danger)&&!(null!==x&&void 0!==x&&x.warning),underline:null===x||void 0===x?void 0:x.underline,warning:null===x||void 0===x?void 0:x.warning,children:(0,C.jsx)(O.ZP,He(He({inverted:a,muted:m},x),{},{disableWordBreak:o,monospace:v,small:P,width:u,children:E}))}),(0,C.jsx)(W.Z,He(He({},I),{},{basic:!0,defaultColor:i,fullWidth:l,invertedTheme:a,monospace:v,onBlur:function(e){M(!1),I.onBlur&&I.onBlur(e),R||N(!0)},onFocus:function(e){M(!0),I.onFocus&&I.onFocus(e)},ref:T,small:P,value:c,visible:!E}))]}),U=r&&(0,C.jsx)(ze,{children:(0,C.jsx)(O.ZP,{dangerouslySetInnerHTML:{__html:r},monospace:v,muted:!0,small:P})}),H=(0,s.useMemo)((function(){return(0,C.jsx)(O.ZP,{default:!0,small:P,children:_})}),[P,_]);return(0,C.jsxs)(C.Fragment,{children:[w&&(0,C.jsxs)(C.Fragment,{children:[L&&(0,C.jsxs)(We,{children:[(0,C.jsx)(y.ZP,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:L}),U]}),(0,C.jsxs)(y.ZP,{fullWidth:l,children:[F,_&&H]})]}),!w&&(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,children:[L&&(0,C.jsxs)(C.Fragment,{children:[L,(0,C.jsx)(Z.Z,{ml:1})]}),F,_&&H]}),R&&!A&&!E&&!h&&!g&&(0,C.jsx)(O.ZP,{danger:!0,small:P,children:"This field is required."})]})},Ge=t(73942),Ke=t(37391),Ye=t(90880),qe=6.25*P.iI,Qe=(P.iI,100*P.iI),Je=m.default.div.withConfig({displayName:"indexstyle__WindowContainerStyle",componentId:"sc-g0cszf-0"})(["border-radius:","px;width:100%;max-width:","px;z-index:101;position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);",""],Ge.n_,Qe,(function(e){return"\n box-shadow: ".concat((e.theme||Ze.Z).shadow.window,";\n background-color: ").concat((e.theme||Ze.Z).background.panel,";\n ")})),Xe=(0,m.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],qe,P.iI,P.cd*P.iI,(function(e){return"\n background-color: ".concat((e.theme||Ze.Z).background.output,";\n ")})),$e=m.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],Xe,Ge.n_,Ge.n_,(function(e){return"\n border-bottom: ".concat(Ge.YF,"px ").concat(Ge.M8," ").concat((e.theme||Ze.Z).borders.medium,";\n ")})),en=m.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],P.iI,Ke.w5,(0,Ye.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*P.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*qe,"px);\n ")})),nn=m.default.div.withConfig({displayName:"indexstyle__WindowFooterStyle",componentId:"sc-g0cszf-3"})([""," justify-content:flex-end;border-bottom-left-radius:","px;border-bottom-right-radius:","px;",""],Xe,Ge.n_,Ge.n_,(function(e){return"\n border-top: ".concat(Ge.YF,"px ").concat(Ge.M8," ").concat((e.theme||Ze.Z).borders.medium,";\n ")})),tn=m.default.div.withConfig({displayName:"indexstyle__InputRowStyle",componentId:"sc-g0cszf-4"})(["padding:","px ","px;",""],.75*P.iI,2*P.iI,(function(e){return"\n border-bottom: ".concat(Ge.YF,"px ").concat(Ge.M8," ").concat((e.theme||Ze.Z).borders.medium,";\n ")}));function rn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function on(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?rn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):rn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ln=function(e){var n=e.blocks,t=e.creatingNewDBTModel,i=e.dbtModelName,r=e.files,o=e.onClose,l=e.onOpenFile,c=e.setDbtModelName,u=(0,s.useState)(!1),a=u[0],d=u[1],p=(0,s.useState)(null),f=p[0],h=p[1],m=(0,s.useMemo)((function(){var e,n,t=null===(e=(0,_e.sE)((null===r||void 0===r||null===(n=r[0])||void 0===n?void 0:n.children)||[],(function(e){return"dbt"===e.name})))||void 0===e?void 0:e.children,i=[];return null===t||void 0===t||t.forEach((function(e){var n=e.children,t=void 0===n?[]:n;t.length>=1&&i.push(on(on({},e),{},{children:t}))})),i}),[r]),b=(0,s.useMemo)((function(){return(0,_e.HK)(n,(function(e){return e.configuration.file_path}))}),[n]);return(0,C.jsxs)(Je,{children:[(0,C.jsxs)($e,{children:[(0,C.jsx)(j.Z,{alignItems:"center",children:(0,C.jsx)(O.ZP,{disableWordBreak:!0,monospace:!0,children:t?"Create new dbt model":"Select dbt model or snapshot file"})}),(0,C.jsx)(T.Z,{iconOnly:!0,onClick:o,children:(0,C.jsx)(V.x8,{muted:!0})})]}),t&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(tn,{children:(0,C.jsx)(Ve,{dynamicSizing:!0,inputValue:i,label:"Model name (cannot be changed):",labelColor:Ze.Z.accent.dbt,notRequired:!0,onBlur:function(){d(!1)},onChange:function(e){c(e.target.value),e.preventDefault()},onClick:function(){d(!0)},onFocus:function(){d(!0)},placeholder:"Enter name",required:!0,stacked:!0,suffixValue:".".concat(v.t6.SQL),value:!a&&i})}),(0,C.jsxs)(tn,{children:[(0,C.jsx)(O.ZP,{bold:!0,color:Ze.Z.accent.dbt,children:"Select folder location:"}),(0,C.jsx)(O.ZP,{bold:!0,muted:!f,children:f?"dbt".concat(Ae.sep).concat(f):"Choose folder below"})]})]}),(0,C.jsx)(en,{children:(0,C.jsx)(te.Z,{allowSelectingFolders:t,disableContextMenu:!0,files:m,isFileDisabled:function(e,n){return t?!n||(null===n||void 0===n?void 0:n.some((function(e){return"models"===(null===e||void 0===e?void 0:e.name)}))):!!b[e]||!(null!==n&&void 0!==n&&n.length)&&!e.match(new RegExp(".".concat(v.t6.SQL,"$")))},openFile:l,selectFile:h,uncollapsed:!0,useRootFolder:!0})}),t&&(0,C.jsx)(nn,{children:(0,C.jsx)(T.Z,{backgroundColor:i&&f?Ze.Z.accent.dbt:Ze.Z.monotone.grey500,disabled:!i||!f,onClick:function(){return l(f)},padding:"6px 8px",children:"Create model"})})]})},cn=t(10975),un=t(14567),an=t(18283),sn=t(93005),dn=t(75968),pn=t(87323);function fn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function hn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function vn(e,n){var t,i=e.block,r=e.blocks,o=e.onClick,c=e.onDrop,u=i.type,a=(0,cn.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:i,type:sn.vT}}),[i]),d=(0,l.Z)(a,3),p=d[0],f=d[1],h=(d[2],(0,un.L)((function(){return{accept:sn.vT,drop:function(e){return null===c||void 0===c?void 0:c(i,e)}}}),[i])),b=(0,l.Z)(h,2)[1],x=(0,s.useContext)(m.ThemeContext),_=(0,w.qn)(u,{blockColor:i.color,theme:x}).accent,S=(0,pn.cU)([i],r)[0],E=S.dynamic,I=S.dynamicUpstreamBlock,T=S.reduceOutput,D=S.reduceOutputUpstreamBlock,A=(0,s.useMemo)((function(){return(0,dn._o)({block:i,dynamic:E,dynamicUpstreamBlock:I,reduceOutput:T,reduceOutputUpstreamBlock:D})}),[i,E,I,T,D]).borderColorShareProps,M=(0,s.useMemo)((function(){return v.tf.DBT===(null===i||void 0===i?void 0:i.type)}),[i]);return(0,C.jsx)(Z.Z,{pb:1,ref:b,children:(0,C.jsx)(w.PY,hn(hn({},hn(hn({},A),p)),{},{ref:f,children:(0,C.jsx)(k.Z,{noHoverUnderline:!0,noOutline:!0,onClick:function(){return o()},preventDefault:!0,ref:n,children:(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",flex:1,children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(an.Z,{monospace:!0,children:v.dO[i.language]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(g.Z,{color:_,size:1.5*P.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{color:_,monospace:!0,children:null===(t=M?v.tf.DBT:v.V4[i.type])||void 0===t?void 0:t.toUpperCase()})]}),(0,C.jsx)(Z.Z,{mr:P.cd}),(0,C.jsx)(V.iU,{size:1.5*P.iI}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:null===i||void 0===i?void 0:i.uuid})]}),(0,C.jsx)(ke.Z,{appearAbove:!0,appearBefore:!0,block:!0,label:"Show ".concat(null===i||void 0===i?void 0:i.uuid," block"),size:2*P.iI,widthFitContent:!0,children:(0,C.jsx)(V.Db,{muted:!0,size:2*P.iI})})]})})})}))})}var mn,bn,gn,xn,jn=s.forwardRef(vn),yn=t(4804),kn=t(44182),Zn=t(25880),On=t(65730),Pn=t(87372);!function(e){e.FULL_TABLE="FULL_TABLE",e.INCREMENTAL="INCREMENTAL",e.LOG_BASED="LOG_BASED"}(bn||(bn={})),function(e){e.IGNORE="IGNORE",e.UPDATE="UPDATE"}(gn||(gn={})),function(e){e.DATE_TIME="date-time",e.UUID="uuid"}(xn||(xn={}));var wn,Cn="datetime",_n=(mn={},(0,o.Z)(mn,xn.DATE_TIME,Cn),(0,o.Z)(mn,xn.UUID,xn.UUID),mn);!function(e){e.ARRAY="array",e.BOOLEAN="boolean",e.INTEGER="integer",e.NULL="null",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(wn||(wn={}));var Sn,En,In,Tn,Dn,An=[wn.ARRAY,wn.BOOLEAN,Cn,wn.INTEGER,wn.NULL,wn.NUMBER,wn.OBJECT,wn.STRING,xn.UUID];!function(e){e.PROPERTIES="properties"}(Sn||(Sn={})),function(e){e.AUTOMATIC="automatic",e.AVAILABLE="available",e.UNSUPPORTED="unsupported"}(En||(En={})),function(e){e.FORCED_REPLICATION_METHOD="forced-replication-method",e.KEY_PROPERTIES="table-key-properties",e.REPLICATION_KEYS="valid-replication-keys",e.SCHEMA_NAME="schema-name"}(In||(In={})),function(e){e.AMPLITUDE="amplitude",e.BIGQUERY="bigquery",e.CHARGEBEE="chargebee",e.GOOGLE_ADS="google_ads",e.GOOGLE_SEARCH_CONSOLE="google_search_console",e.GOOGLE_SHEETS="google_sheets",e.INTERCOM="intercom",e.MYSQL="mysql",e.PIPEDRIVE="pipedrive",e.POSTGRESQL="postgresql",e.REDSHIFT="redshift",e.SALESFORCE="salesforce",e.STRIPE="stripe"}(Tn||(Tn={})),function(e){e.BIGQUERY="bigquery",e.DELTA_LAKE_S3="delta_lake_s3",e.MYSQL="mysql",e.POSTGRESQL="postgresql",e.SNOWFLAKE="snowflake"}(Dn||(Dn={}));var Mn=t(96016),Bn=t(79891),Rn=t(87815),Nn=t(70902),Ln=t(85307),Fn=t(7715);function Un(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 Hn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Un(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Un(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Wn="4px",zn=[Dn.BIGQUERY,Dn.DELTA_LAKE_S3];var Vn=function(e){var n=e.bookmarkValues,t=e.destination,i=e.isLoadingLoadSampleData,r=e.isLoadingUpdateDestinationBlockState,c=e.loadSampleData,u=e.source,a=e.stream,d=e.streams,p=e.updateAllStreams,f=e.updateDestinationBlockState,h=e.updateMetadataForColumns,v=e.updateSchemaProperty,m=e.updateStream,g=(0,s.useRef)(null),x=a.bookmark_properties,k=a.destination_table,w=void 0===k?"":k,_=a.key_properties,S=a.metadata,E=a.partition_keys,I=a.replication_method,D=a.run_in_parallel,A=a.schema.properties,M=a.tap_stream_id,B=a.unique_constraints,R=a.unique_conflict_method,N=(0,s.useState)(w),L=N[0],F=N[1],H=(0,s.useState)(!1),z=H[0],V=H[1],G=(0,s.useState)(null),K=G[0],Y=G[1],q=(0,s.useState)(!1),J=q[0],X=q[1],$=(0,s.useState)((0,o.Z)({},M,n||{})),ee=$[0],ne=$[1],te=(0,Oe.Z)(M);(0,s.useEffect)((function(){te!==M&&(F(w),Y(null))}),[w,I,M,te,R]),(0,s.useEffect)((function(){var e=null===ee||void 0===ee?void 0:ee[M];(null===x||void 0===x?void 0:x.length)>0&&((0,Fn.Qr)(e)||!(0,Fn.Xy)(n,e))&&ne((function(e){return Hn(Hn({},e),{},(0,o.Z)({},M,n))}))}),[null===x||void 0===x?void 0:x.length,n,M]);var ie=(0,s.useMemo)((function(){return(0,_e.HK)(S,(function(e){return e.breadcrumb.join("/")}))}),[S]),re=(0,s.useMemo)((function(){var e;return null===(e=(0,_e.sE)(S,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[S]),oe=(0,s.useMemo)((function(){return re[In.KEY_PROPERTIES]||[]}),[re]),le=(0,s.useMemo)((function(){return re[In.REPLICATION_KEYS]||[]}),[re]),ce=zn.includes(t),ue=d.length>1,ae=(0,s.useCallback)((function(e){var n=Hn({},null===ee||void 0===ee?void 0:ee[M]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return Hn(Hn({},e),{},(0,o.Z)({},M,Hn({},n)))})),f({block:{bookmark_values:n,destination_table:L,tap_stream_id:M}})}),[ee,L,M,f]),se=(0,s.useMemo)((function(){var e=[],n=[],i=(0,_e.mr)(Object.entries(A)).map((function(i,r){var o=(0,l.Z)(i,2),c=o[0],u=o[1],a=u.anyOf,s=void 0===a?[]:a,d=u.format,f=u.type,g=void 0===f?[]:f,k=new Set(Array.isArray(g)?g:[g]),w=new Set(k);s.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){k.add(e),w.add(e)})):(k.add(t),w.add(t),n&&w.add(n))}));var S=Array.from(k);d&&w.add(d);var I=(ie["properties/".concat(c)]||{}).metadata,D=(I.inclusion,I.selected);e.push(D),n.push(c);var A=An.reduce((function(e,n){return S.indexOf(n)>=0||Cn===String(n)&&xn.DATE_TIME===d||xn.UUID===String(n)&&xn.UUID===d?e:e.concat((0,C.jsx)("option",{value:n,children:n},n))}),[]),R=S.findIndex((function(e){return e===wn.STRING})),N=[(0,C.jsx)(b.Z,{checked:D,onClick:function(){h(M,[c],{selected:!D})}},"".concat(M,"/").concat(c,"/selected")),(0,C.jsx)(O.ZP,{children:c},"".concat(M,"/").concat(c,"/name")),(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(j.Z,{flex:1,children:(0,C.jsx)(y.ZP,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:S.map((function(e,n){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Bn.Z,{border:!0,label:d&&wn.STRING===e&&R===n?_n[d]:e,onClick:function(){var n={format:d,type:S.filter((function(n){return n!==e}))};xn.DATE_TIME!==d&&xn.UUID!==d||wn.STRING!==e||(n.format=null),v(M,c,n)},small:!0})},"".concat(M,"/").concat(c,"/").concat(e,"/").concat(n,"/chip"))}))})}),A.length>=1&&(0,C.jsxs)(U.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:d,type:S};Cn===String(n)?(t.format=xn.DATE_TIME,t.type.push(wn.STRING)):xn.UUID===String(n)?(t.format=xn.UUID,t.type.push(wn.STRING)):t.type.push(n),v(M,c,t)},primary:!0,small:!0,value:"",width:10*P.iI,children:[(0,C.jsx)("option",{value:""}),A]})]},"".concat(M,"/").concat(c,"/type")),(0,C.jsx)(b.Z,{checked:!(null===B||void 0===B||!B.includes(c)),disabled:oe.length>=1&&!oe.includes(c),onClick:oe.length>=1&&!oe.includes(c)?null:function(){return m(M,(function(e){var n;return null!==(n=e.unique_constraints)&&void 0!==n&&n.includes(c)?e.unique_constraints=(0,_e.Od)(e.unique_constraints,(function(e){return c===e})):e.unique_constraints=[c].concat(e.unique_constraints||[]),e}))}},"".concat(M,"/").concat(c,"/unique")),(0,C.jsx)(b.Z,{checked:!(null===x||void 0===x||!x.includes(c)),disabled:le.length>=1&&!le.includes(c),onClick:le.length>=1&&!le.includes(c)?null:function(){return m(M,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(c)?(ae(c),e.bookmark_properties=(0,_e.Od)(e.bookmark_properties,(function(e){return c===e}))):e.bookmark_properties=[c].concat(e.bookmark_properties||[]),e}))}},"".concat(M,"/").concat(c,"/bookmark")),(0,C.jsx)(b.Z,{checked:!(null===_||void 0===_||!_.includes(c)),onClick:function(){return m(M,(function(e){var n;return null!==(n=e.key_properties)&&void 0!==n&&n.includes(c)?e.key_properties=(0,_e.Od)(e.key_properties,(function(e){return c===e})):e.key_properties=[c].concat(e.key_properties||[]),e}))}},"".concat(M,"/").concat(c,"/key_property"))];if(ce){var L=t!==Dn.DELTA_LAKE_S3,F=L&&(oe.includes(c)||!w.has(xn.DATE_TIME));N.push((0,C.jsx)(b.Z,{checked:!(null===E||void 0===E||!E.includes(c)),disabled:F,onClick:F?null:function(){return m(M,(function(e){var n,t;null!==(n=e.partition_keys)&&void 0!==n&&n.includes(c)?e.partition_keys=(0,_e.Od)(e.partition_keys,(function(e){return c===e})):L&&1===(null===(t=e.partition_keys)||void 0===t?void 0:t.length)?e.partition_keys=[c]:e.partition_keys=[c].concat(e.partition_keys||[]);return e}))}},"".concat(M,"/").concat(c,"/partition_key")))}if(ue){var H=K===r;N.push((0,C.jsx)(T.Z,{compact:!0,disabled:H,onClick:function(){Y(r),setTimeout((function(){return Y(null)}),2e3),p((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==M&&null!==e&&void 0!==e&&null!==(n=e.schema)&&void 0!==n&&null!==(t=n.properties)&&void 0!==t&&t[c]){var i,r,o,l,u,a,s,p,f;e.schema.properties[c]={format:d||null,type:S};var h=null===(i=(0,_e.sE)((null===e||void 0===e?void 0:e.metadata)||[],(function(e){return 0===e.breadcrumb.length})))||void 0===i?void 0:i.metadata,v=h[In.REPLICATION_KEYS]||[],m=h[In.KEY_PROPERTIES]||[];null===B||void 0===B||!B.includes(c)||null!==e&&void 0!==e&&null!==(r=e.unique_constraints)&&void 0!==r&&r.includes(c)||!m.includes(c)?null!==B&&void 0!==B&&B.includes(c)||null===e||void 0===e||null===(o=e.unique_constraints)||void 0===o||!o.includes(c)||(e.unique_constraints=(0,_e.Od)(e.unique_constraints,(function(e){return c===e}))):e.unique_constraints=[c].concat(e.unique_constraints||[]),null===x||void 0===x||!x.includes(c)||null!==e&&void 0!==e&&null!==(l=e.bookmark_properties)&&void 0!==l&&l.includes(c)||!v.includes(c)?null!==x&&void 0!==x&&x.includes(c)||null===e||void 0===e||null===(u=e.bookmark_properties)||void 0===u||!u.includes(c)||(e.bookmark_properties=(0,_e.Od)(e.bookmark_properties,(function(e){return c===e}))):e.bookmark_properties=[c].concat(e.bookmark_properties||[]),null===_||void 0===_||!_.includes(c)||null!==e&&void 0!==e&&null!==(a=e.key_properties)&&void 0!==a&&a.includes(c)?null!==_&&void 0!==_&&_.includes(c)||null===e||void 0===e||null===(s=e.key_properties)||void 0===s||!s.includes(c)||(e.key_properties=(0,_e.Od)(e.key_properties,(function(e){return c===e}))):e.key_properties=[c].concat(e.key_properties||[]),null===E||void 0===E||!E.includes(c)||null!==e&&void 0!==e&&null!==(p=e.partition_keys)&&void 0!==p&&p.includes(c)?null!==E&&void 0!==E&&E.includes(c)||null===e||void 0===e||null===(f=e.partition_keys)||void 0===f||!f.includes(c)||(e.partition_keys=(0,_e.Od)(e.partition_keys,(function(e){return c===e}))):e.partition_keys=[c].concat(e.partition_keys||[])}return Hn({},e)}))},pill:!0,secondary:!0,children:(0,C.jsx)(O.ZP,{success:H,children:H?"Applied!":"Apply"})}))}return N})),r=e.every((function(e){return e})),o=[null,2,1,null,null,null],c=[{label:function(){return(0,C.jsx)(b.Z,{checked:r,onClick:function(){h(M,n,{selected:!r})}})},uuid:"Selected"},{uuid:"Name"},{uuid:"Type"},{fitTooltipContentWidth:!0,tooltipMessage:"Used to avoid adding duplicate records",uuid:"Unique"},{tooltipMessage:"Used to keep track of sync progress and incrementally sync new records (e.g. a column indicating when a record was last updated)",tooltipWidth:305,uuid:"Bookmark"},{fitTooltipContentWidth:!0,tooltipMessage:"Used to create primary key for destination table",uuid:"Key prop"}];return ce&&(o.push(null),c.push({uuid:"Partition key"})),ue&&(o.push(null),c.push({tooltipMessage:"This will apply this individual feature's schema settings to all selected streams that have the same feature. Unique features must be valid key properties in other streams. Bookmark features must be valid replication keys in other streams.",uuid:"All streams"})),(0,C.jsx)(Ln.cl,{children:(0,C.jsx)(Rn.Z,{alignTop:!0,columnFlex:o,columns:c,rows:i,stickyHeader:!0})})}),[x,t,ue,K,_,ie,E,A,ae,ce,M,B,p,h,v,m,oe,le]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Pn.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,C.jsx)(Pn.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:M})," schema"]}),(0,C.jsx)(Z.Z,{mb:3,children:(0,C.jsx)(De.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{children:"Destination table name"}),(0,C.jsx)(Z.Z,{ml:Wn}),(0,C.jsx)(ke.Z,{label:(0,C.jsxs)(O.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:M}),". To change the table name, enter in a different value."]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(W.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;F(n),clearTimeout(g.current),g.current=setTimeout((function(){m(M,(function(e){return Hn(Hn({},e),{},{destination_table:n})}))}),300)},value:L||"",width:45*P.iI})]})})}),(0,C.jsx)(Z.Z,{mb:3,children:(0,C.jsx)(De.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{children:"Replication method"}),(0,C.jsx)(Z.Z,{ml:Wn}),(0,C.jsx)(ke.Z,{label:(0,C.jsxs)(O.ZP,{children:["Do you want to synchronize the entire stream (",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:bn.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:bn.INCREMENTAL}),")?",u===Tn.POSTGRESQL&&(0,C.jsxs)(O.ZP,{children:["Log-based incremental replication (",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:bn.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsxs)(U.Z,{compact:!0,onChange:function(e){m(M,(function(n){return Hn(Hn({},n),{},{replication_method:e.target.value})}))},primary:!0,value:I,children:[(0,C.jsx)("option",{value:""}),Object.values(bn).filter((function(e){return u===Tn.POSTGRESQL||e!==bn.LOG_BASED})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))]}),(0,C.jsx)(Z.Z,{ml:3}),(0,C.jsx)(O.ZP,{children:"Unique conflict method"}),(0,C.jsx)(Z.Z,{ml:Wn}),(0,C.jsx)(ke.Z,{label:(0,C.jsxs)(O.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,Q._6)("unique column",null===B||void 0===B?void 0:B.length),(null===B||void 0===B?void 0:B.length)>0&&(0,C.jsx)(C.Fragment,{children:"\xa0"}),null===B||void 0===B?void 0:B.sort().map((function(e,n){return(0,C.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===B||void 0===B?void 0:B.length)&&n===(null===B||void 0===B?void 0:B.length)-1?(0,C.jsx)(O.ZP,{inline:!0,children:" and "},e):n>=1&&(0,C.jsx)(C.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:gn.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,children:gn.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsxs)(U.Z,{compact:!0,inputWidth:11*P.iI,onChange:function(e){m(M,(function(n){return Hn(Hn({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:R,children:[(0,C.jsx)("option",{value:""}),(0,C.jsx)("option",{value:gn.IGNORE,children:gn.IGNORE}),(0,C.jsx)("option",{value:gn.UPDATE,children:gn.UPDATE})]})]}),ue&&(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(O.ZP,{default:!0,children:"All streams"}),(0,C.jsx)(Z.Z,{ml:Wn}),(0,C.jsx)(ke.Z,{appearBefore:!0,label:(0,C.jsx)(O.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."}),lightBackground:!0,primary:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(T.Z,{compact:!0,disabled:z,onClick:function(){V(!0),setTimeout((function(){return V(!1)}),2e3),p((function(e){return Hn(Hn({},e),{},{replication_method:I,unique_conflict_method:R})}))},pill:!0,secondary:!0,children:(0,C.jsx)(O.ZP,{bold:!z,success:z,children:z?"Applied!":"Apply"})})]})]})})}),(0,C.jsx)(De.Z,{headerTitle:"Features",noPadding:!0,children:se}),(0,C.jsx)(Z.Z,{mt:2,children:(0,C.jsx)(T.Z,{loading:i,onClick:function(){return c(M)},primary:!0,small:!0,children:"Load sample data"})}),(0,C.jsxs)(Z.Z,{mt:5,children:[(0,C.jsx)(Pn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,C.jsx)(Z.Z,{mb:5,children:(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,C.jsx)(O.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."}),(0,C.jsx)(Z.Z,{mb:1}),(0,C.jsx)(Nn.Z,{checked:D,onCheck:function(){return m(M,(function(e){return e.run_in_parallel=!D,e}))}},"".concat(M,"/run_in_parallel"))]})}),bn.INCREMENTAL===I&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,C.jsxs)(O.ZP,{default:!0,children:["After each integration pipeline run, the last record that was successfully synchronized will be used as the bookmark. The properties listed below will be extracted from the last record and used as the bookmark.",(0,C.jsx)("br",{}),"On the next run, the synchronization will start after the bookmarked record."]})]}),(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==x&&void 0!==x&&x.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===x||void 0===x?void 0:x.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Bn.Z,{label:e,onClick:function(){ae(e),m(M,(function(n){return Hn(Hn({},n),{},{bookmark_properties:(0,_e.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]}),(null===x||void 0===x?void 0:x.length)>0&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{my:2,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),(0,C.jsx)(O.ZP,{default:!0,children:'In order to override the bookmark values for the next sync, you must first select a destination. Then click the toggle to edit the values for the bookmark properties in the table below. Click the "Save" button to save your changes.'})]}),(0,C.jsx)(Nn.Z,{checked:J,disabled:!t,onCheck:function(){return X((function(e){return!e}))}})]})}),J&&!!t&&(0,C.jsx)(De.Z,{header:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(O.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,C.jsx)(T.Z,{compact:!0,loading:r,onClick:function(){f({block:{bookmark_values:(null===ee||void 0===ee?void 0:ee[M])||{},destination_table:L,tap_stream_id:M}})},pill:!0,secondary:!0,children:"Save"})]}),headerPaddingVertical:P.iI,noPadding:!0,overflowVisible:!0,children:(0,C.jsx)(Rn.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Bookmark property"},{uuid:"Value"}],rows:x.map((function(e){var n;return[(0,C.jsx)(O.ZP,{default:!0,monospace:!0,children:e},e),(0,C.jsx)(W.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ne((function(t){return Hn(Hn({},t),{},(0,o.Z)({},M,Hn(Hn({},t[M]),{},(0,o.Z)({},e,n.target.value))))}))},paddingHorizontal:0,placeholder:"Enter value",value:null===ee||void 0===ee||null===(n=ee[M])||void 0===n?void 0:n[e]},"".concat(e,"_value"))]}))})})]})]}),(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,C.jsx)(O.ZP,{default:!0,children:"Multiple records (e.g. 2 or more) with the same values in the columns listed below will be considered duplicates."})]}),(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==B&&void 0!==B&&B.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===B||void 0===B?void 0:B.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Bn.Z,{label:e,onClick:function(){m(M,(function(n){return Hn(Hn({},n),{},{unique_constraints:(0,_e.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,C.jsx)(O.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==_&&void 0!==_&&_.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null===_||void 0===_?void 0:_.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Bn.Z,{label:e,onClick:function(){m(M,(function(n){return Hn(Hn({},n),{},{key_properties:(0,_e.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ce&&(0,C.jsxs)(Z.Z,{mb:3,children:[(0,C.jsxs)(Z.Z,{mb:1,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,C.jsx)(O.ZP,{default:!0,children:"One datetime column can be used to partition the table. (Note: Partition keys currently only work with BigQuery destinations. Support for other destinations is WIP.)"})]}),(0,C.jsxs)(y.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==E&&void 0!==E&&E.length)&&(0,C.jsxs)(O.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===E||void 0===E?void 0:E.sort().map((function(e){return(0,C.jsx)(Z.Z,{mb:1,mr:1,children:(0,C.jsx)(Bn.Z,{label:e,onClick:function(){m(M,(function(n){return Hn(Hn({},n),{},{partition_keys:(0,_e.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Gn=["catalog","pipeline","setErrors","setSelectedStream"];function Kn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Yn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qn,Qn=function(e){var n,t=e.catalog,i=e.pipeline,r=e.setErrors,o=e.setSelectedStream,c=(0,Le.Z)(e,Gn),u=(0,s.useState)(null),a=u[0],p=u[1],f=(0,s.useMemo)((function(){return(null===t||void 0===t?void 0:t.streams)||[]}),[t]),h=(0,s.useMemo)((function(){return(0,_e.YC)(f,"stream").map((function(e){return{uuid:e.stream}}))}),[f]),m=(0,s.useMemo)((function(){return(0,_e.HK)(f,(function(e){return e.stream}))}),[f]),b=(0,s.useMemo)((function(){return m[null===a||void 0===a?void 0:a.uuid]}),[a,m]),g=(0,s.useMemo)((function(){return(0,_e.sE)((null===i||void 0===i?void 0:i.blocks)||[],(function(e){var n=e.type;return v.tf.DATA_EXPORTER===n}))}),[null===i||void 0===i?void 0:i.blocks]),x=b||{},j=x.destination_table,y=x.tap_stream_id,k=!(!y||!j),P=z.ZP.blocks.pipelines.detail(k?null===i||void 0===i?void 0:i.uuid:null,k?null===g||void 0===g?void 0:g.uuid:null,{destination_table:j,state_stream:y}),w=P.data,_=P.mutate,S=null===w||void 0===w||null===(n=w.block)||void 0===n?void 0:n.bookmarks,E=(0,d.Db)(z.ZP.blocks.pipelines.useUpdate(null===i||void 0===i?void 0:i.uuid,null===g||void 0===g?void 0:g.uuid,{query:{update_state:!0}}),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){null===_||void 0===_||_()},onErrorCallback:function(e,n){return null===r||void 0===r?void 0:r({errors:n,response:e})}})}}),I=(0,l.Z)(E,2),T=I[0],A=I[1].isLoading;(0,s.useEffect)((function(){h.length>0&&(a&&(0,_e.sE)(h,(function(e){var n=e.uuid;return a.uuid===n}))||p(h[0]))}),[a,p,h]);var M=(0,s.useMemo)((function(){var e=[{uuid:"Stream"},{uuid:"Columns Selected"},{uuid:"Replication Method"},{uuid:"Destination Table"},{uuid:"Bookmark Props"},{uuid:"Key Props"},{uuid:"Unique Constraints"},{uuid:"Unique Conflict Method"},{uuid:"Partition Keys"}];return(0,C.jsx)(Ln.cl,{children:(0,C.jsx)(Rn.Z,{alignTop:!0,columnBorders:!0,columnFlex:e.map((function(e){return 1})),columns:e,rows:f.map((function(e){var n=e.replication_method,t=e.destination_table,i=e.bookmark_properties,r=e.key_properties,o=e.metadata,l=e.unique_constraints,c=e.unique_conflict_method,u=e.partition_keys,a=e.tap_stream_id,s=o.reduce((function(e,n){var t=n.breadcrumb,i=n.metadata.selected,r=(null===t||void 0===t?void 0:t.length)>0,o=i&&r?1:0,l=r?1:0;return{selectedCount:e.selectedCount+o,totalCount:e.totalCount+l}}),{selectedCount:0,totalCount:0}),d=(0,C.jsx)(O.ZP,{children:"".concat(s.selectedCount," of ").concat(s.totalCount," total")},"".concat(a,"_col_selected")),p=[a,n,t,i,r,l,c,u].map((function(e,n){return(0,C.jsx)(O.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(a,"_cell_").concat(n))}));return p.slice(0,1).concat(d).concat(p.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[f]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(D.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){p(e),o(e.uuid)},selectedTabUUID:null===a||void 0===a?void 0:a.uuid,tabs:h}),b&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(Ln.dE,{children:(0,C.jsx)(Vn,Yn(Yn({},c),{},{bookmarkValues:S,isLoadingUpdateDestinationBlockState:A,stream:b,streams:f,updateDestinationBlockState:T}))})}),f.length>=1&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(Ln.dE,{children:[(0,C.jsx)(Pn.Z,{level:4,children:"Streams Summary"}),(0,C.jsx)(Z.Z,{mt:1}),M]})})]})},Jn=t(30264),Xn=t(18776);function $n(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function et(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function nt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?et(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):et(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.ALL="All",e.SELECTED="Selected",e.NOT_SELECTED="Not selected"}(qn||(qn={}));var tt=45*P.iI,it=tt-4*P.iI;var rt=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,r=e.streams,l=(0,_e.HK)((null===n||void 0===n?void 0:n.streams)||[],(function(e){return e.stream})),c=(0,s.useMemo)((function(){var e=new Set(r.map((function(e){return e.stream})));return Object.values(l).filter((function(n){var t=n.stream;return!e.has(t)})).map((function(e){return nt(nt({},e),{},{isMissingStream:!0})}))}),[l,r]),u=nt({},l);c.forEach((function(e){var n=e.stream;delete u[n]}));var a=(0,s.useState)(u),d=a[0],p=a[1],f=(0,s.useState)(null),h=f[0],v=f[1],m=(0,s.useState)(!1),g=m[0],j=m[1],k=(0,s.useState)(qn.ALL),w=k[0],_=k[1],S=(0,s.useRef)(null),E=$n(d),I=(0,s.useMemo)((function(){var e=r;return e=e.filter((function(e){var n=e.tap_stream_id;return w===qn.SELECTED?E.includes(n):w!==qn.NOT_SELECTED||!E.includes(n)})),h?e.filter((function(e){var n=e.tap_stream_id;return null===n||void 0===n?void 0:n.toLowerCase().includes(null===h||void 0===h?void 0:h.toLowerCase())})):e}),[w,h,E,r]),D=(0,s.useMemo)((function(){return r.every((function(e){var n=e.stream;return!!d[n]}))}),[d,r]);return(0,C.jsxs)(Xn.Z,{children:[(0,C.jsx)(Ln.cv,{rounded:!0,children:(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,C.jsx)(Ln.cv,{padding:1.25*P.iI,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsx)(W.Z,{beforeIcon:(0,C.jsx)(V.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return v(e.target.value)},placeholder:"Search",value:h}),(0,C.jsx)(Z.Z,{pr:1,children:(0,C.jsx)(Jn.Z,{items:[{label:function(){return qn.ALL},onClick:function(){return _(qn.ALL)},uuid:"all_streams"},{label:function(){return qn.SELECTED},onClick:function(){return _(qn.SELECTED)},uuid:"selected"},{label:function(){return qn.NOT_SELECTED},onClick:function(){return _(qn.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return j(!1)},onClickOutside:function(){return j(!1)},open:g,parentRef:S,uuid:"SelectStreams/filter",children:(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(V.wn,{}),noBackground:!0,onClick:function(){return j((function(e){return!e}))},ref:S,children:(0,C.jsx)(O.ZP,{children:w})})})})]})}),(0,C.jsx)(Ln.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(tt,"px"),children:(0,C.jsx)(Rn.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,C.jsx)(b.Z,{checked:D,onClick:function(){var e=(0,_e.HK)(r||[],(function(e){return e.stream}));p(D?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:I.concat(c).map((function(e){var n=e.isMissingStream,t=e.stream,i=!!d[t];return[(0,C.jsx)(b.Z,{checked:i,disabled:!i&&n,onClick:function(){p((function(n){return nt(nt({},n),{},(0,o.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,C.jsxs)(O.ZP,{danger:n,title:t,width:tt-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,C.jsx)(x.Z,{medium:!0}),(0,C.jsxs)(Z.Z,{p:2,children:[(null===E||void 0===E?void 0:E.length)>50&&(0,C.jsx)(Z.Z,{pb:2,children:(0,C.jsxs)(O.ZP,{danger:!0,maxWidth:it,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,C.jsx)("br",{}),"may cause app performance issues."]})}),0===(null===r||void 0===r?void 0:r.length)&&(0,C.jsx)(Z.Z,{pb:2,children:(0,C.jsx)(O.ZP,{bold:!0,maxWidth:it,warning:!0,whiteSpaceNormal:!0,children:"If you can successfully connect to the data source but no streams are displayed, check if the user has proper database/schema permissions."})}),(0,C.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,C.jsx)(T.Z,{loading:t,onClick:function(){return i(d)},primary:!0,children:"Confirm ".concat($n(d).length," streams")})})]})]})},ot=t(57722);function lt(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 ct(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?lt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):lt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ut=function(e){var n=e.api,t=e.block,i=e.blockContent,r=e.onChangeCodeBlock,c=e.pipeline,u=(0,s.useState)(null),a=u[0],p=u[1];(0,s.useEffect)((function(){i&&!a&&p((0,yn.Pz)(null===i||void 0===i?void 0:i.config))}),[a,i]);var f=(0,s.useState)(null),h=f[0],m=f[1],b=(0,s.useState)(),g=b[0],x=b[1],j=(0,d.Db)(z.ZP[n].useCreate(),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(e){var t,i,r=(0,Q.C5)(n);m(null===e||void 0===e||null===(t=e[r])||void 0===t?void 0:t.success),x(null===e||void 0===e||null===(i=e[r])||void 0===i?void 0:i.error_message)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),k=(0,l.Z)(j,2),P=k[0],w=k[1].isLoading;return t?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Ln.$W,{children:(0,C.jsx)(ot.Z,{autoHeight:!0,language:v.t6.YAML,onChange:function(e){p(e),r(t.type,t.uuid,(0,yn.Pz)(ct(ct({},i),{},{config:(0,yn.Qc)(e)})))},tabSize:2,value:a||void 0,width:"100%"})}),(0,C.jsxs)(Z.Z,{mt:1,children:[(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{onClick:function(){P((0,o.Z)({},(0,Q.C5)(n),{action_type:"test_connection",config:a,pipeline_uuid:c.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,C.jsx)(Z.Z,{ml:1,children:w?(0,C.jsx)(H.Z,{color:"white",small:!0}):(0,C.jsxs)(C.Fragment,{children:[h&&(0,C.jsx)(O.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===h&&(0,C.jsx)(O.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),g&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(O.ZP,{small:!0,warning:!0,children:g})})]})]}):null},at=t(60701);function st(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 dt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?st(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):st(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var pt=function(e){var n,t,i,r=e.addNewBlockAtIndex,o=e.blocks,c=e.codeBlocks,u=e.fetchFileTree,a=e.fetchPipeline,p=e.fetchSampleData,f=e.globalVariables,h=e.onChangeCodeBlock,m=e.openSidekickView,b=e.pipeline,g=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,w=e.setOutputBlocks,_=e.setSelectedBlock,S=e.setSelectedOutputBlock,E=e.setSelectedStream,I=(0,s.useState)(!0),D=I[0],A=I[1],M=(0,s.useState)(!0),B=M[0],R=M[1],N=(0,s.useState)(!0),L=N[0],F=N[1],W=(0,s.useState)(""),G=W[0],K=W[1],Y=z.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,q=(0,s.useMemo)((function(){return(null===Y||void 0===Y?void 0:Y.integration_sources)||[]}),[Y]),Q=(0,s.useMemo)((function(){return(0,_e.HK)(q,(function(e){return e.uuid}))}),[q]),X=z.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,$=(0,s.useMemo)((function(){return(null===X||void 0===X?void 0:X.integration_destinations)||[]}),[X]),ee=(0,s.useMemo)((function(){return(0,_e.HK)($,(function(e){return e.uuid}))}),[$]),ne=(0,s.useMemo)((function(){return(0,_e.sE)(o,(function(e){var n=e.type;return v.tf.DATA_LOADER===n}))}),[o]),te=(0,s.useMemo)((function(){return ne?(0,yn.Qc)(ne.content):{}}),[ne]);(0,s.useEffect)((function(){var e;null!==te&&void 0!==te&&te.source&&K(null===(e=Q[te.source])||void 0===e?void 0:e.docs)}),[Q,te]);var ie=(0,s.useMemo)((function(){return(0,C.jsx)(ut,{api:"integration_sources",block:ne,blockContent:te,onChangeCodeBlock:h,pipeline:b})}),[ne,te,h,b]),re=(0,s.useMemo)((function(){return(0,_e.sE)(o,(function(e){var n=e.type;return v.tf.DATA_EXPORTER===n}))}),[o]),oe=(0,s.useMemo)((function(){return re?(0,yn.Qc)(re.content):{}}),[re]),le=(0,s.useMemo)((function(){return(0,C.jsx)(ut,{api:"integration_destinations",block:re,blockContent:oe,onChangeCodeBlock:h,pipeline:b})}),[re,oe,h,b]),ce=(0,s.useMemo)((function(){return(0,_e.sE)(o,(function(e){var n=e.type;return v.tf.TRANSFORMER===n}))}),[o]),ue=(0,s.useMemo)((function(){var e;return(0,Fn.Qr)(null===te||void 0===te?void 0:te.catalog)?null===b||void 0===b||null===(e=b.data_integration)||void 0===e?void 0:e.catalog:null===te||void 0===te?void 0:te.catalog}),[te,null===b||void 0===b||null===(n=b.data_integration)||void 0===n?void 0:n.catalog]),ae=((null===ue||void 0===ue?void 0:ue.streams)||[]).every((function(e){return e.auto_add_new_fields})),se=((null===ue||void 0===ue?void 0:ue.streams)||[]).every((function(e){return e.disable_column_type_check})),de=(0,Oe.Z)(ue);(0,s.useEffect)((function(){!de&&ue&&(w((function(){return S(ne),[ne]})),j((function(e){var n;return e||(null===ue||void 0===ue||null===(n=ue.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[ue]);var pe=(0,s.useState)(),fe=pe[0],he=pe[1],ve=(0,d.Db)(z.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null===n||void 0===n?void 0:n.streams)||[];w((function(){return S(ne),[ne]})),t.length>0&&E(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),m(at.cH.DATA),p()}else he(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),me=(0,l.Z)(ve,2),be=me[0],ge=me[1].isLoading,xe=(0,d.Db)(z.ZP.integration_sources.useUpdate(null===b||void 0===b?void 0:b.uuid),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(e){var n=e.integration_source,t=n.selected_streams,i=n.streams,r=((null===ue||void 0===ue?void 0:ue.streams)||[]).filter((function(e){var n=e.tap_stream_id;return t.includes(n)})),o=r.map((function(e){return e.tap_stream_id})),l=i.filter((function(e){var n=e.tap_stream_id;return t.includes(n)&&!o.includes(n)}));l.forEach((function(e){e.metadata.forEach((function(n,t){var i=n.metadata;if(En.UNSUPPORTED!==i.inclusion){var r;if(e.replication_method||(e.replication_method=bn.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=gn.UPDATE),!e.destination_table)e.destination_table=null===e||void 0===e||null===(r=e.tap_stream_id)||void 0===r?void 0:r.replace(/\W+/g,"_");e.metadata[t]=dt(dt({},n),{},{metadata:dt(dt({},i),{},{selected:!0})})}}))}));var c={streams:r.concat(l)};j(He.map((function(e){return e.tap_stream_id})));var s=null===te||void 0===te?void 0:te.catalog;(0,Fn.Qr)(s)||h(ne.type,ne.uuid,(0,yn.Pz)(dt(dt({},te),{},{catalog:{}})));var d={pipeline:dt(dt({},b),{},{data_integration:dt(dt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:c})})};g(d).then((function(){a(),u()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),je=(0,l.Z)(xe,2),ye=je[0],ke=je[1].isLoading,Ze=(0,s.useState)(null),Pe=Ze[0],we=Ze[1],Ce=(0,d.Db)(z.ZP.integration_source_streams.useUpdate(null===b||void 0===b?void 0:b.uuid),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(e){we(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Se=(0,l.Z)(Ce,2),Ie=Se[0],Te=Se[1].isLoading,De=(0,s.useCallback)((function(e,n){var t=function(e,n){var t,i=[];return e.streams.forEach((function(e){e.tap_stream_id===n?t=e:i.push(e)})),{stream:t,streams:i}}(ue,e),i=t.stream,r=t.streams,o=dt(dt({},ue),{},{streams:r.concat(n(i))}),l=null===te||void 0===te?void 0:te.catalog;(0,Fn.Qr)(l)||h(ne.type,ne.uuid,(0,yn.Pz)(dt(dt({},te),{},{catalog:{}})));var c={pipeline:dt(dt({},b),{},{data_integration:dt(dt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:o})})};g(c).then((function(){return a()}))}),[ue,ne,te,a,h,b,g]),Ae=(0,s.useCallback)((function(e){if(null!==ue&&void 0!==ue&&ue.streams){var n=dt(dt({},ue),{},{streams:ue.streams.map((function(n){return e(n)}))}),t=null===te||void 0===te?void 0:te.catalog;(0,Fn.Qr)(t)||h(ne.type,ne.uuid,(0,yn.Pz)(dt(dt({},te),{},{catalog:{}})));var i={pipeline:dt(dt({},b),{},{data_integration:dt(dt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:n})})};g(i).then((function(){return a()}))}}),[ue,ne,te,a,h,b,g]),Me=(0,s.useCallback)((function(e,n,t){De(e,(function(e){return e.schema.properties[n]=t,e}))}),[De]),Be=(0,s.useCallback)((function(e,n,t){De(e,(function(e){var i=e.metadata;return n.forEach((function(n){var r=i.findIndex((function(e){var t=e.breadcrumb,i=void 0===t?[]:t;return 2===i.length&&"properties"===i[0]&&i[1]===n}));if(r>=0){var o=i[r].metadata;e.metadata[r].metadata=dt(dt({},o),t)}})),e}))}),[De]),Re=(0,d.Db)(z.ZP.blocks.pipelines.useUpdate(null===b||void 0===b?void 0:b.uuid,null===re||void 0===re?void 0:re.uuid),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){null===a||void 0===a||a()},onErrorCallback:function(e,n){return null===x||void 0===x?void 0:x({errors:n,response:e})}})}}),Le=(0,l.Z)(Re,1)[0],Fe=(0,s.useMemo)((function(){var e=[];return null===f||void 0===f||f.forEach((function(n){var t=n.variables;return null===t||void 0===t?void 0:t.forEach((function(n){var t=n.uuid,i=n.value,r="\"{{ variables('".concat(t,"') }}\"");if(!t.startsWith("output"))return e.push([(0,C.jsx)(O.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,C.jsx)(O.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,C.jsx)(O.ZP,{monospace:!0,children:r},"variable-uuid-".concat(t,"-{value}-code")),(0,C.jsx)(On.Z,{copiedText:r,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,C.jsx)(Rn.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[f]),Ue=(0,s.useCallback)((function(e){return(0,C.jsxs)(Z.Z,{mt:2,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,C.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,C.jsx)("br",{}),"For more information, check out the ",(0,C.jsx)(k.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,C.jsx)(Z.Z,{mt:1,children:Fe})]})}),[Fe]),He=(0,s.useMemo)((function(){return(null===Pe||void 0===Pe?void 0:Pe.streams)||[]}),[Pe]),We=(0,Ee.dd)((function(){return(0,C.jsx)(rt,{catalog:ue,isLoading:ke,onActionCallback:function(e){var n=Object.entries(e).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);if(n.length>0)ye({integration_source:{streams:n}}),Ge();else{var t=null===te||void 0===te?void 0:te.catalog;(0,Fn.Qr)(t)||h(ne.type,ne.uuid,(0,yn.Pz)(dt(dt({},te),{},{catalog:{}}))),g({pipeline:dt(dt({},b),{},{data_integration:dt(dt({},(null===b||void 0===b?void 0:b.data_integration)||{}),{},{catalog:null})})}).then((function(){return a()})),Ge()}},streams:He})}),{},[ue,ne,te,a,ke,h,g,He],{background:!0,uuid:"select_streams"}),ze=(0,l.Z)(We,2),Ve=ze[0],Ge=ze[1];return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{iconOnly:!0,onClick:function(){return R((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[B&&(0,C.jsx)(V.Kh,{size:1.5*P.iI}),!B&&(0,C.jsx)(V._M,{size:1.5*P.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(Pn.Z,{children:"Source"}),!B&&(0,C.jsxs)(Pn.Z,{default:!0,inline:!0,children:["\xa0",null===(t=Q[null===te||void 0===te?void 0:te.source])||void 0===t?void 0:t.name]})]})]})}),B&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsxs)(Ln.dE,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(Pn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null===q||void 0===q?void 0:q.length)>0?(0,C.jsxs)(U.Z,{onChange:function(e){var n,t,i,o=e.target.value;if(o){K(null===(n=Q[o])||void 0===n?void 0:n.docs);var l=null===(t=Q[o])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;l&&Object.keys(l).forEach((function(e){l[e]=l[e]||null})),ne?h(ne.type,ne.uuid,(0,yn.Pz)(dt(dt({},te),{},{catalog:{},config:l,source:o}))):r({content:(0,yn.Pz)({config:l,source:o}),language:v.t6.YAML,type:v.tf.DATA_LOADER},0,_),we(null),g().then((function(){a()}))}},primary:!0,value:null===te||void 0===te?void 0:te.source,children:[(0,C.jsx)("option",{value:""}),q.map((function(e){var n=e.name,t=e.uuid;return(0,C.jsx)("option",{value:t,children:n},t)}))]}):(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(H.Z,{inverted:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(Pn.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),ne&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(Pn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===te||void 0===te?void 0:te.source)&&G&&(0,C.jsxs)(Z.Z,{mb:2,children:[(0,C.jsx)(kn.Z,{children:(0,C.jsx)(Zn.Z,{title:"Documentation: ".concat(te.source),children:(0,C.jsx)(Ln.zG,{children:(0,C.jsx)(Mn.Z,{children:G.replace(/\<br \/\>/g,"\n\n")})})})}),Ue("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),ie]}),(0,C.jsxs)("div",{children:[(0,C.jsx)(Pn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,C.jsx)(T.Z,{loading:Te,onClick:function(){g().then((function(){Ie().then((function(){return Ve()})),a()}))},primary:!0,small:!0,children:"View and select streams"})]}),fe&&(0,C.jsx)(O.ZP,{warning:!0,children:fe})]})]}),ke&&(0,C.jsx)(Z.Z,{p:2,children:(0,C.jsx)(H.Z,{})}),!ke&&(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsx)(Qn,{catalog:ue,destination:null===oe||void 0===oe?void 0:oe.destination,isLoadingLoadSampleData:ge,loadSampleData:function(e){return be({integration_source:{action_type:"sample_data",pipeline_uuid:null===b||void 0===b?void 0:b.uuid,streams:[e]}})},pipeline:b,setErrors:x,setSelectedStream:E,source:null===te||void 0===te?void 0:te.source,updateAllStreams:Ae,updateMetadataForColumns:Be,updateSchemaProperty:Me,updateStream:De})})]}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{disabled:!ne,iconOnly:!0,onClick:function(){return F((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[L&&ne&&(0,C.jsx)(V.Kh,{size:1.5*P.iI}),(!L||!ne)&&(0,C.jsx)(V._M,{disabled:!ne,size:1.5*P.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)(Pn.Z,{children:"Transformers"})})]})}),L&&ne&&(0,C.jsx)(Z.Z,{mb:5,children:(0,C.jsxs)(Ln.dE,{children:[c.length>0&&(0,C.jsx)(Z.Z,{mb:1,children:c.map((function(e,n){return(0,C.jsx)(Z.Z,{mb:1,children:e},n)}))}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(Ne.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return ne&&i.push(ne.uuid),r(dt(dt({},e),{},{configuration:t,content:n,upstream_blocks:i}),o.length-1,(function(e){re&&(Le({block:dt(dt({},re),{},{upstream_blocks:[e.uuid]})}),_(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!ce,hideTransformerDataSources:!0,pipeline:b})})]})}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(T.Z,{disabled:!ne,iconOnly:!0,onClick:function(){return A((function(e){return!e}))},children:(0,C.jsxs)(C.Fragment,{children:[D&&ne&&(0,C.jsx)(V.Kh,{size:1.5*P.iI}),(!D||!ne)&&(0,C.jsx)(V._M,{disabled:!ne,size:1.5*P.iI})]})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(Pn.Z,{children:"Destination"}),!D&&(0,C.jsxs)(Pn.Z,{default:!0,inline:!0,children:["\xa0",null===(i=ee[null===oe||void 0===oe?void 0:oe.destination])||void 0===i?void 0:i.name]})]})]})}),D&&ne&&(0,C.jsxs)(Ln.dE,{children:[(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(Pn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null===$||void 0===$?void 0:$.length)>0?(0,C.jsxs)(U.Z,{onChange:function(e){var n=e.target.value;if(n){if(re)h(re.type,re.uuid,(0,yn.Pz)(dt(dt({},oe),{},{destination:n})));else{var t,i,l=null===(t=ee[n])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;l&&(Object.keys(l).forEach((function(e){l[e]=l[e]||null})),l.hasOwnProperty("table")&&delete l.table);var c=[];if((null===o||void 0===o?void 0:o.length)>=2){var u=o.find((function(e){var n=e.uuid;return(null===ne||void 0===ne?void 0:ne.uuid)!==n}));u&&c.push(u.uuid)}else ne&&c.push(ne.uuid);r({content:(0,yn.Pz)({config:l,destination:n}),language:v.t6.YAML,type:v.tf.DATA_EXPORTER,upstream_blocks:c},1,_)}g().then((function(){a()}))}},primary:!0,value:null===oe||void 0===oe?void 0:oe.destination,children:[(0,C.jsx)("option",{value:""}),$.map((function(e){var n=e.name,t=e.uuid;return(0,C.jsx)("option",{value:t,children:n},t)}))]}):(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(H.Z,{inverted:!0}),(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(Pn.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),re&&(0,C.jsxs)(Z.Z,{mb:5,children:[(0,C.jsx)(Pn.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===oe||void 0===oe?void 0:oe.destination)&&(0,C.jsx)(C.Fragment,{children:(0,C.jsxs)(Z.Z,{mb:2,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,C.jsxs)(k.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(oe.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[oe.destination," documentation"]}),".",(0,C.jsx)("br",{}),(0,C.jsx)("br",{}),"If your configuration contains a key named ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,C.jsx)("br",{}),"The table that\u2019s created in this destination will have a name corresponding to the stream\u2019s unique name (by default) or the value you entered under the input field labeled ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),Ue("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),le,(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,C.jsx)(O.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})]}),(0,C.jsx)(Nn.Z,{checked:!!ae,disabled:!(null!==ue&&void 0!==ue&&ue.streams),onCheck:function(){return Ae((function(e){return dt(dt({},e),{},{auto_add_new_fields:!ae})}))}})]})}),(0,C.jsx)(Z.Z,{mt:3,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(Z.Z,{mr:2,children:[(0,C.jsx)(O.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,C.jsxs)(O.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,C.jsx)("br",{}),"If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped.",(0,C.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,C.jsx)(Nn.Z,{checked:!!se,disabled:!(null!==ue&&void 0!==ue&&ue.streams),onCheck:function(){return Ae((function(e){return dt(dt({},e),{},{disable_column_type_check:!se})}))}})]})})]})]})]})},ft=t(46336),ht=t(42451),vt=t(84212),mt=t(51504);function bt(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 gt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?bt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var xt=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.allBlocks,c=e.allowCodeBlockShortcuts,u=e.anyInputFocused,a=e.autocompleteItems,p=e.blockRefs,f=e.blocks,h=void 0===f?[]:f,m=e.blocksThatNeedToRefresh,b=e.dataProviders,g=e.deleteBlock,x=e.disableShortcuts,j=e.fetchFileTree,y=e.fetchPipeline,w=e.fetchSampleData,_=e.files,S=e.globalDataProducts,E=e.globalVariables,I=e.hiddenBlocks,T=e.interruptKernel,D=e.mainContainerRef,B=e.mainContainerWidth,N=e.messages,L=e.onChangeCallbackBlock,U=e.onChangeCodeBlock,H=e.openSidekickView,W=e.pipeline,V=e.pipelineContentTouched,G=e.project,K=e.restartKernel,Y=e.runBlock,q=e.runningBlocks,X=void 0===q?[]:q,$=e.savePipelineContent,ee=e.selectedBlock,ne=e.setAnyInputFocused,te=e.setDisableShortcuts,ie=e.setEditingBlock,oe=e.setErrors,ce=e.setIntegrationStreams,ue=e.setHiddenBlocks,se=e.setOutputBlocks,de=e.setPipelineContentTouched,pe=e.setSelectedBlock,fe=e.setSelectedOutputBlock,he=e.setSelectedStream,ve=e.setTextareaFocused,be=e.showBrowseTemplates,ge=e.showConfigureProjectModal,xe=e.showGlobalDataProducts,je=e.showUpdateBlockModal,ye=e.textareaFocused,ke=e.widgets,Ze=(0,s.useRef)(null),Pe=(0,s.useState)(!1),Ce=Pe[0],Se=Pe[1],Ee=(0,s.useState)(!1),Ie=Ee[0],De=Ee[1],Me=(0,s.useState)(!1),Le=Me[0],Fe=Me[1],Ue=(0,s.useState)(!0),He=Ue[0],We=Ue[1],ze=(0,s.useState)(null),Ve=ze[0],Ge=ze[1],Ke=(0,s.useState)(null),Ye=Ke[0],qe=Ke[1],Qe=(0,s.useState)(!1),Je=Qe[0],Xe=Qe[1],$e=(0,s.useState)(""),en=$e[0],nn=$e[1],tn=(0,s.useMemo)((function(){return X.reduce((function(e,n,t){return gt(gt({},e),{},(0,o.Z)({},n.uuid,gt(gt({},n),{},{priority:t})))}),{})}),[X]),rn=(0,Oe.Z)(ee),on=(0,s.useMemo)((function(){return h.length}),[h]),cn=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===W||void 0===W?void 0:W.type)}),[W]),un=(0,s.useMemo)((function(){return F.qL.STREAMING===(null===W||void 0===W?void 0:W.type)}),[W]),an=(0,s.useMemo)((function(){var e;return F.qL.PYTHON===(null===W||void 0===W?void 0:W.type)&&(null===G||void 0===G||null===(e=G.features)||void 0===e?void 0:e[ft.d.ADD_NEW_BLOCK_V2])}),[W,G]),sn=z.ZP.block_templates.list({show_all:!!an},{revalidateOnFocus:!1}).data,pn=(0,s.useMemo)((function(){return(null===sn||void 0===sn?void 0:sn.block_templates)||[]}),[sn]),fn="PipelineDetail/index",hn=(0,ae.y)(),vn=hn.disableGlobalKeyboardShortcuts,mn=hn.registerOnKeyDown,bn=hn.unregisterOnKeyDown;(0,s.useEffect)((function(){return function(){bn(fn)}}),[bn,fn]),mn(fn,(function(e,n,t){if(V&&(0,mt.y)([le.zX,le.hS],n)){e.preventDefault();"undefined"!==typeof location&&window.confirm("You have changes that are unsaved. Click cancel and save your changes before reloading page.")&&location.reload()}if(!x&&!vn)if((0,mt.y)([le.zX,le.Um],n)||(0,mt.y)([le.PQ,le.Um],n))e.preventDefault(),$();else if(ye)n[le.vP]?ve(!1):V||le.Z1.find((function(e){return n[e]}))||de(!0);else if(!cn){var i;if(an&&((0,mt.y)([le.zX,le.A1],n)||(0,mt.y)([le.PQ,le.A1],n)))e.preventDefault(),De(!0),null===Ze||void 0===Ze||null===(i=Ze.current)||void 0===i||i.focus();else if(an&&Ie&&(0,mt.y)([le.vP],n)){var r;e.preventDefault(),De(!1),null===Ze||void 0===Ze||null===(r=Ze.current)||void 0===r||r.blur()}else if(ee){var o=h.findIndex((function(e){var n=e.uuid;return ee.uuid===n}));if(n[le.vP])pe(null);else if(t[0]===le.xD&&t[1]===le.xD)T();else if(t[0]===le.l1&&t[1]===le.l1&&-1!==o)g(ee).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){o===h.length-1?pe(h[o-1]):h.length>=0?pe(h[o+1]):pe(null)}),100)}));else if(n[le.Bu]&&o>=1){var l=h[o-1];if(l){var c,a;pe(l);var s="".concat(l.type,"s/").concat(l.uuid,".py");null===(c=p.current[s])||void 0===c||null===(a=c.current)||void 0===a||a.scrollIntoView()}}else if(n[le.kD]&&o<=on-2){var d=h[o+1];if(d){var f,v;pe(d);var m="".concat(d.type,"s/").concat(d.uuid,".py");null===(f=p.current[m])||void 0===f||null===(v=f.current)||void 0===v||v.scrollIntoView()}}else(0,mt.y)([le.Uq],n)&&ve(!0)}else rn&&n[le.Uq]&&pe(rn);u||t[0]!==le.OC||t[1]!==le.OC||K()}}),[n,u,p.current,h,Ie,T,cn,on,V,K,$,Ze,ee,rn,de,pe,ve,ye,an]),(0,s.useEffect)((function(){var e=setInterval((function(){V&&$()}),1e4);return function(){clearInterval(e)}}),[V,$]),(0,s.useEffect)((function(){setTimeout((function(){return Fe(!0)}),2*we.zn)}),[W]);var gn=(0,d.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return z.ZP.blocks.pipelines.useUpdate(null===W||void 0===W?void 0:W.uuid,null===n||void 0===n?void 0:n.uuid)({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){y()},onErrorCallback:function(e,n){return null===oe||void 0===oe?void 0:oe({errors:n,response:e})}})}}),xn=(0,l.Z)(gn,1)[0],yn=(0,s.useCallback)((function(e){Se(!0),qe(e),te(!0)}),[Se,te,qe]),kn=(0,s.useCallback)((function(){Se(!1),Xe(!1),nn(""),te(!1)}),[te]),Zn=(0,s.useCallback)((function(e,n){var t,i;h.forEach((function(r,o){var l=r.uuid;t>=0&&i>=0||(l===e.uuid?t=o:l===n.uuid&&(i=o))}));var r=(0,_e.oM)(h,i);return r=(0,_e.Hk)(n,Math.max(t,0),r),$({pipeline:{blocks:r,uuid:null===W||void 0===W?void 0:W.uuid}})}),[h,W,$]),On=(0,s.useMemo)((function(){var e=[];return h.filter((function(e){var n=e.type;return!cn||v.tf.TRANSFORMER===n})).forEach((function(l,u){var d,f,k=l.type,Z=l.uuid,O=(null===ee||void 0===ee?void 0:ee.uuid)===Z,P=tn[Z],w=P?0===P.priority?Te.uF.BUSY:Te.uF.QUEUED:Te.uF.IDLE,_="".concat(k,"s/").concat(Z,".py");p.current[_]=(0,s.createRef)();var E=k===v.tf.MARKDOWN,A=k===v.tf.TRANSFORMER,M=!(null===I||void 0===I||!I[Z]),F=u===on-1||cn,z=p.current[_],V=Z,K=null===m||void 0===m||null===(d=m[k])||void 0===d?void 0:d[Z];K&&(V="".concat(V,":").concat(K)),f=M?(0,C.jsx)(jn,{block:l,blocks:h,onClick:function(){return ue((function(e){return gt(gt({},e),{},(0,o.Z)({},Z,!M))}))},onDrop:Zn,ref:z},V):(0,C.jsx)(R.Z,{addNewBlock:function(e,t){ve(!0);return n(e,u+1,(function(e){if(1===(null===t||void 0===t?void 0:t.length)){var n,i,o=null===(n=t[0])||void 0===n?void 0:n.uuid,l=(null===(i=t[0])||void 0===i?void 0:i.upstream_blocks)||[];xn({block:{uuid:o},upstreamBlocks:[e.uuid].concat((0,r.Z)(l))})}null===pe||void 0===pe||pe(e)}))},addNewBlockMenuOpenIdx:Ve,addWidget:t,allBlocks:i,allowCodeBlockShortcuts:c,autocompleteItems:a,block:l,blockIdx:u,blockRefs:p,blockTemplates:pn,blocks:h,dataProviders:b,defaultValue:l.content,deleteBlock:function(e){g(e),ne(!1)},disableShortcuts:x,executionState:w,fetchFileTree:j,fetchPipeline:y,globalDataProducts:S,hideRunButton:un||E||cn&&A,interruptKernel:T,mainContainerRef:D,mainContainerWidth:B,messages:N[Z],noDivider:F,onCallbackChange:function(e){return L(k,Z,e)},onChange:function(e){return U(k,Z,e)},onClickAddSingleDBTModel:yn,onDrop:Zn,openSidekickView:H,pipeline:W,project:G,ref:z,runBlock:Y,runningBlocks:X,savePipelineContent:$,selected:O,setAddNewBlockMenuOpenIdx:Ge,setAnyInputFocused:ne,setCreatingNewDBTModel:Xe,setEditingBlock:ie,setErrors:oe,setOutputBlocks:se,setSelected:function(e){return pe(!0===e?l:null)},setSelectedBlock:pe,setSelectedOutputBlock:fe,setTextareaFocused:ve,showBrowseTemplates:be,showConfigureProjectModal:ge,showGlobalDataProducts:xe,showUpdateBlockModal:je,textareaFocused:O&&ye,widgets:ke},V),e.push(f)})),e}),[n,Ve,t,i,c,a,p,pn,m,h,b,g,x,j,y,S,I,T,cn,un,D,B,N,on,L,U,yn,Zn,H,W,G,Y,X,tn,$,ee,Ge,ne,ie,oe,ue,se,pe,fe,ve,be,ge,xe,je,ye,xn,ke]),Pn=(0,s.useMemo)((function(){return(0,C.jsx)(pt,{addNewBlockAtIndex:n,blocks:h,codeBlocks:On,fetchFileTree:j,fetchPipeline:y,fetchSampleData:w,globalVariables:E,onChangeCodeBlock:U,openSidekickView:H,pipeline:W,savePipelineContent:$,setErrors:oe,setIntegrationStreams:ce,setOutputBlocks:se,setSelectedBlock:pe,setSelectedOutputBlock:fe,setSelectedStream:he})}),[n,h,On,j,y,w,E,U,H,W,$,oe,ce,se,pe,fe,he]),wn=(0,s.useMemo)((function(){return W&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Ne.Z,{addNewBlock:function(e){var t=h[h.length-1],i=null,r=e.configuration||{},o=t?(0,dn.eY)(t,e):[];t&&([v.tf.DATA_LOADER,v.tf.TRANSFORMER].includes(t.type)&&v.tf.SCRATCHPAD===e.type&&(i="from mage_ai.data_preparation.variable_manager import get_variable\n\n\n df = get_variable('".concat(W.uuid,"', '").concat(t.uuid,"', 'output_0')\n ")),v.t6.SQL===t.language&&(r=gt(gt({},(0,Fn.GL)(t.configuration,[ht.cH,ht.Sv,ht.sc,ht.BD,ht.nq])),r))),v.t6.SQL===e.language&&(i=(0,vt.SF)(i)),i=(0,vt.X7)(e,i),n(gt(gt({},e),{},{configuration:r,content:i,upstream_blocks:o}),on,pe),ve(!0)},blockTemplates:pn,focusedAddNewBlockSearch:Ie,hideCustom:cn||un,hideDataExporter:cn,hideDataLoader:cn,hideDbt:cn||un,hideScratchpad:cn,hideSensor:cn,onClickAddSingleDBTModel:yn,pipeline:W,project:G,searchTextInputRef:Ze,setCreatingNewDBTModel:Xe,setFocusedAddNewBlockSearch:De,showBrowseTemplates:be,showConfigureProjectModal:ge,showGlobalDataProducts:xe}),!an&&!cn&&!un&&(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,C.jsx)("br",{}),"Turn on the feature named ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:ft.d.ADD_NEW_BLOCK_V2})," in your ",(0,C.jsx)(Be(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,C.jsx)(k.Z,{muted:!0,underline:!0,children:(0,C.jsx)(O.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[n,pn,h,Ie,cn,un,on,yn,W,G,Ze,De,pe,ve,be,ge,xe,an]);return(0,C.jsxs)(A.W,{backend:M.PD,children:[(0,C.jsx)(we.lO,{children:He&&(0,C.jsx)(Re.Z,{classNames:"pipeline-detail",in:Le,onEntered:function(){return setTimeout((function(){return We(!1)}),we.zn)},timeout:1,children:(0,C.jsx)(we.fm,{})})}),(0,C.jsxs)(Z.Z,{mt:1,px:P.cd,children:[cn&&Pn,!cn&&(0,C.jsxs)(C.Fragment,{children:[On,(0,C.jsx)(Z.Z,{mt:P.cd,children:wn})]}),Ce&&(0,C.jsx)(re.Z,{onClickOutside:kn,open:!0,children:(0,C.jsx)(ln,{blocks:h,creatingNewDBTModel:Je,dbtModelName:en,files:_,onClose:kn,onOpenFile:function(e){var t=e;if(Je){var i=(0,Q.RA)(en||(0,Q.Y6)()),r=".".concat(me.Lu.SQL);i.endsWith(r)&&(i=i.slice(0,-4)),t="".concat(e).concat(Ae.sep).concat(i,".").concat(me.Lu.SQL)}var o={configuration:{file_path:t,limit:R.z},language:v.t6.SQL,name:(0,Q.wE)(t),type:v.tf.DBT};Je&&(o.content="--Docs: https://docs.mage.ai/dbt/sources\n");var l="undefined"===typeof Ye||null===Ye,c=h[l?h.length-1:Ye],u=c?(0,dn.eY)(c,o):[];n(gt(gt({},o),{},{upstream_blocks:u}),l?on:Ye+1,pe),kn(),ve(!0)},setDbtModelName:nn})})]})]})},jt=t(49894),yt=t(41424),kt=t(32063),Zt=t(82386),Ot=t(70543),Pt=t(24141);function wt(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 Ct(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?wt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):wt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var _t=function(e){var n=e.after,t=e.afterHeader,i=e.afterHeightOffset,r=e.afterHidden,o=e.afterNavigationItems,c=e.afterOverflow,u=e.afterSubheader,a=e.before,d=e.beforeHeader,p=e.beforeHeightOffset,f=e.beforeNavigationItems,h=e.children,v=e.errors,m=e.headerOffset,b=e.mainContainerHeader,g=e.mainContainerRef,x=e.page,j=e.pipeline,y=e.setAfterHidden,k=e.setAfterWidthForChildren,Z=e.setErrors,O=e.setMainContainerWidth,P=(0,Pt.i)().width,w=(0,s.useState)((0,Pe.U2)(Pe.L8,Zt.Zt)),_=w[0],S=w[1],E=(0,s.useState)((0,Pe.U2)(Pe.J3,Zt.ve)),I=E[0],T=E[1],D=(0,s.useState)(!!(0,Pe.U2)(Pe.Uu)),A=D[0],M=D[1],B=(0,s.useState)(!1),R=B[0],N=B[1],L=(0,s.useState)(!1),F=L[0],U=L[1],H=r,W=y;if(!W){var V=(0,s.useState)(!!(0,Pe.U2)(Pe.zg)),G=(0,l.Z)(V,2);H=G[0],W=G[1]}(0,s.useEffect)((function(){null===g||void 0===g||!g.current||R||F||null===O||void 0===O||O(g.current.getBoundingClientRect().width)}),[R,F,H,_,A,I,g,O,P]),(0,s.useEffect)((function(){R||(null===k||void 0===k||k(_),(0,Pe.t8)(Pe.L8,_))}),[R,_,k]),(0,s.useEffect)((function(){F||(0,Pe.t8)(Pe.J3,I)}),[F,I]);var K=z.ZP.projects.list({},{revalidateOnFocus:!1}).data,Y=null===K||void 0===K?void 0:K.projects,q=(0,s.useMemo)((function(){var e,n=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return j&&(n.push.apply(n,[{bold:Ot.b7!==x,label:function(){return null===j||void 0===j?void 0:j.uuid},linkProps:{as:"/pipelines/".concat(null===j||void 0===j?void 0:j.uuid),href:"/pipelines/[pipeline]"}}]),Ot.b7===x&&n.push.apply(n,[{bold:!0,label:function(){return(0,Q.kC)(x)}}])),(0,C.jsx)(yt.Z,{breadcrumbs:n,project:null===Y||void 0===Y?void 0:Y[0],version:null===Y||void 0===Y||null===(e=Y[0])||void 0===e?void 0:e.version})}),[x,j,Y]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(ge.Z,{title:null===j||void 0===j?void 0:j.name}),(0,C.jsx)(kt.Z,{after:n,afterHeader:t,afterHeightOffset:i,afterHidden:H,afterMousedownActive:R,afterNavigationItems:o,afterOverflow:c,afterSubheader:u,afterWidth:_,before:a,beforeHeader:d,beforeHeightOffset:p,beforeHidden:A,beforeMousedownActive:F,beforeNavigationItems:f,beforeWidth:I,header:q,headerOffset:m,mainContainerHeader:b,mainContainerRef:g,navigationShowMore:!0,setAfterHidden:W,setAfterMousedownActive:N,setAfterWidth:S,setBeforeHidden:M,setBeforeMousedownActive:U,setBeforeWidth:T,children:h}),v&&(0,C.jsx)(re.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return Z(null)},children:(0,C.jsx)(jt.Z,Ct(Ct({},v),{},{onClose:function(){return Z(null)}}))})]})},St=t(21853),Et=t(41788),It=t(30119),Tt=t(83766),Dt=t(31682),At=t(98636),Mt=t(21978),Bt=m.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1cm3orh-0"})(["border-radius:","px;padding:","px ","px;",""],Ge.n_,1.5*P.iI,P.l4,(function(e){return"\n border: ".concat(Ge.YF,"px ").concat(Ge.M8," ").concat((e.theme||Ze.Z).interactive.defaultBorder,";\n ")})),Rt=t(18221),Nt=t(73899);function Lt(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 Ft(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Lt(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Lt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ut={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"};var Ht=function(e){var n,t,i=e.block,r=e.fetchFileTree,o=e.fetchPipeline,c=e.globalDataProducts,u=e.pipeline,a=e.setSelectedBlock,p=e.showUpdateBlockModal,f=(0,s.useRef)(null),h=(0,s.useRef)(null),m=(0,s.useMemo)((function(){return null===u||void 0===u?void 0:u.uuid}),[u]),x=(0,s.useMemo)((function(){return(null===u||void 0===u?void 0:u.retry_config)||{}}),[u]),w=i.color,_=i.configuration,S=i.name,E=i.type,I=i.uuid,D=(0,X.VI)(null,{},[],{uuid:"BlockSettings/index"}),A=(0,l.Z)(D,1)[0],M=(0,s.useMemo)((function(){return(0,_e.HK)(c||[],(function(e){return e.uuid}))}),[c]),B=(0,s.useMemo)((function(){var e,n=null===_||void 0===_||null===(e=_.global_data_product)||void 0===e?void 0:e.uuid;if(n&&M)return null===M||void 0===M?void 0:M[n]}),[_,M]),R=z.ZP.pipelines.detail(It.b.PIPELINE===(null===B||void 0===B?void 0:B.object_type)&&(null===B||void 0===B?void 0:B.object_uuid)).data,N=(0,s.useMemo)((function(){return null===R||void 0===R?void 0:R.pipeline}),[R]),L=(0,s.useState)(null),F=L[0],G=L[1],q=(0,s.useState)(!1),$=q[0],ee=q[1],ne=(0,s.useState)(!1),te=ne[0],ie=ne[1],re=(0,Oe.Z)(i);(0,s.useEffect)((function(){(null===re||void 0===re?void 0:re.uuid)!==(null===i||void 0===i?void 0:i.uuid)&&G(i)}),[i,re]);var oe=(0,s.useMemo)((function(){return(null===F||void 0===F?void 0:F.retry_config)||{}}),[F]),le=(0,s.useCallback)((function(e){ee(!0),G(e)}),[]),ce=(0,s.useMemo)((function(){return null===F||void 0===F?void 0:F.executor_type}),[F]);(0,s.useEffect)((function(){te||!ce||Rt.R.find((function(e){return e===ce}))||ie(!0)}),[te,ce]);var ue=z.ZP.blocks.pipelines.detail(m,encodeURIComponent(I),{_format:"with_settings",block_type:E}).data,ae=(0,s.useMemo)((function(){return(null===ue||void 0===ue?void 0:ue.block)||{}}),[ue]),se=(0,s.useMemo)((function(){return null!==ae&&void 0!==ae&&ae.pipelines?Object.values(null===ae||void 0===ae?void 0:ae.pipelines):[]}),[ae]),de=(null===se||void 0===se?void 0:se.length)||1,pe=(0,d.Db)(z.ZP.blocks.pipelines.useUpdate(m,encodeURIComponent(I)),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(e){ee(!1),r(),o(),null!==e&&void 0!==e&&e.block&&a(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return A({errors:n,response:e})}})}}),fe=(0,l.Z)(pe,2),he=fe[0],ve=fe[1].isLoading,me=(0,s.useMemo)((function(){return de>=1&&(0,C.jsx)(Ln.cl,{children:(0,C.jsx)(Rn.Z,{columnFlex:[null,1],columns:[{uuid:"Name"},{uuid:"Description"}],rows:se.map((function(e){var n=e.pipeline,t=n.description,i=n.name,r=n.uuid;return[(null===u||void 0===u?void 0:u.uuid)===r?(0,C.jsxs)(O.ZP,{monospace:!0,muted:!0,children:[i||r," (current)"]},"name"):(0,C.jsx)(k.Z,{href:"/pipelines/".concat(r,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:i||r},"name"),(0,C.jsx)(O.ZP,{default:!0,monospace:!0,children:t||"-"},"description")]})),uuid:"git-branch-blockPipelines"})})}),[se,de,u]),be=(0,s.useMemo)((function(){return x&&"undefined"!==typeof x&&!(0,Fn.Qr)(x)&&("undefined"!==typeof(null===x||void 0===x?void 0:x.delay)&&"undefined"===typeof(null===oe||void 0===oe?void 0:oe.delay)||"undefined"!==typeof(null===x||void 0===x?void 0:x.exponential_backoff)&&"undefined"===typeof(null===oe||void 0===oe?void 0:oe.exponential_backoff)||"undefined"!==typeof(null===x||void 0===x?void 0:x.max_delay)&&"undefined"===typeof(null===oe||void 0===oe?void 0:oe.max_delay)||"undefined"!==typeof(null===x||void 0===x?void 0:x.retries)&&"undefined"===typeof(null===oe||void 0===oe?void 0:oe.retries))}),[oe,x]),ge=(0,s.useMemo)((function(){var e;return(null===F||void 0===F||null===(e=F.configuration)||void 0===e?void 0:e.global_data_product)||{}}),[F]),xe=(0,s.useCallback)((function(e){return le((function(n){var t;return Ft(Ft({},n),{},{configuration:Ft(Ft({},null===F||void 0===F?void 0:F.configuration),{},{global_data_product:e(null===F||void 0===F||null===(t=F.configuration)||void 0===t?void 0:t.global_data_product)})})}))}),[F,le]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:P.HN,children:(0,C.jsxs)(Z.Z,{p:P.cd,children:[de>1&&(0,C.jsx)(Z.Z,{mb:P.Mq,children:(0,C.jsx)(Bt,{children:(0,C.jsx)(y.ZP,Ft(Ft({},y.A0),{},{children:(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(V.BG,{fill:Nt.$R,size:Y}),(0,C.jsx)(Z.Z,{pr:2}),(0,C.jsxs)(O.ZP,{bold:!0,large:!0,lineHeight:3*P.iI,warning:!0,children:["Shared by ",de," pipelines"]})]})}))})}),(0,C.jsx)(Z.Z,{mb:P.HN,children:(0,C.jsxs)(At.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,C.jsx)(At.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,Ft(Ft({},y.A0),{},{children:[(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(O.ZP,{bold:!0,children:"Name:\xa0"}),(0,C.jsx)(O.ZP,{children:S||""})]}),(0,C.jsx)(T.Z,Ft(Ft({},Ut),{},{onClick:function(){return p(i,S)},children:(0,C.jsx)(V.I8,{size:K})}))]}))}),v.tf.CUSTOM===(null===i||void 0===i?void 0:i.type)?(0,C.jsx)(At.g,{noBorder:!0,children:(0,C.jsxs)(y.ZP,Ft(Ft({},y.A0),{},{children:[(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(O.ZP,{bold:!0,children:"Color:\xa0"}),(0,C.jsx)(O.ZP,{children:(0,Q.kC)(w||"")})]}),(0,C.jsx)(T.Z,Ft(Ft({},Ut),{},{onClick:function(){return p(i,S)},outline:!1,children:(0,C.jsx)(g.Z,{color:w?v.Vd[w]:null,size:K,square:!0})}))]}))}):null]})}),(0,C.jsxs)(Z.Z,{mb:P.HN,px:P.cd,children:[(0,C.jsx)(Pn.Z,{children:"Executor type"}),(0,C.jsxs)(O.ZP,{muted:!0,children:["For more information on this setting, please read the ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/compute-resource#2-set-executor-type-and-customize-the-compute-resource-of-the-mage-executor",openNewWindow:!0,children:"documentation"}),"."]}),(0,C.jsxs)(Z.Z,{mt:1,children:[!te&&(0,C.jsx)(U.Z,{label:"Executor type",onChange:function(e){return le((function(n){return Ft(Ft({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:f,value:(null===F||void 0===F?void 0:F.executor_type)||"",children:Rt.R.map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))}),te&&(0,C.jsx)(W.Z,{label:"Executor type",monospace:!0,onChange:function(e){return le((function(n){return Ft(Ft({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:h,setContentOnMount:!0,value:(null===F||void 0===F?void 0:F.executor_type)||""}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(k.Z,{muted:!0,onClick:function(){te?(le((function(e){return Ft(Ft({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null===f||void 0===f||null===(e=f.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.focus()}),1),ie(!te)},preventDefault:!0,small:!0,children:te?"Select a preset executor type":"Enter a custom executor type"})})]})]}),(0,C.jsxs)(Z.Z,{mb:P.HN,px:P.cd,children:[(0,C.jsx)(Pn.Z,{children:"Retry configuration"}),(0,C.jsxs)(O.ZP,{muted:!0,children:[be&&(0,C.jsxs)(C.Fragment,{children:["This block is currently using the retry configuration from the pipeline. You can override the pipeline\u2019s retry configuration for this block.",(0,C.jsx)("br",{})]}),"For more information on this setting, please read the ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,C.jsxs)(Z.Z,{mt:1,children:[(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(W.Z,{label:"Retries",monospace:!0,onChange:function(e){return le((function(n){var t;return Ft(Ft({},n),{},{retry_config:Ft(Ft({},null===n||void 0===n?void 0:n.retry_config),{},{retries:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===x||void 0===x?void 0:x.retries),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===oe||void 0===oe?void 0:oe.retries)?null===oe||void 0===oe?void 0:oe.retries:(null===x||void 0===x?void 0:x.retries)||""}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(W.Z,{label:"Delay",monospace:!0,onChange:function(e){return le((function(n){var t;return Ft(Ft({},n),{},{retry_config:Ft(Ft({},null===n||void 0===n?void 0:n.retry_config),{},{delay:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===x||void 0===x?void 0:x.delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===oe||void 0===oe?void 0:oe.delay)?null===oe||void 0===oe?void 0:oe.delay:(null===x||void 0===x?void 0:x.delay)||""}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(W.Z,{label:"Max delay",monospace:!0,onChange:function(e){return le((function(n){var t;return Ft(Ft({},n),{},{retry_config:Ft(Ft({},null===n||void 0===n?void 0:n.retry_config),{},{max_delay:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===x||void 0===x?void 0:x.max_delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===oe||void 0===oe?void 0:oe.max_delay)?null===oe||void 0===oe?void 0:oe.max_delay:(null===x||void 0===x?void 0:x.max_delay)||""})]}),(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(b.Z,{checked:"undefined"===typeof(null===oe||void 0===oe?void 0:oe.exponential_backoff)&&"undefined"!==typeof(null===x||void 0===x?void 0:x.exponential_backoff)?!(null===x||void 0===x||!x.exponential_backoff):!(null===oe||void 0===oe||!oe.exponential_backoff),label:"Exponential backoff",onClick:function(){return le((function(e){var n;return Ft(Ft({},e),{},{retry_config:Ft(Ft({},null===e||void 0===e?void 0:e.retry_config),{},{exponential_backoff:"undefined"===typeof(null===oe||void 0===oe?void 0:oe.exponential_backoff)&&"undefined"!==typeof(null===x||void 0===x?void 0:x.exponential_backoff)?!(null!==x&&void 0!==x&&x.exponential_backoff):!(null!==e&&void 0!==e&&null!==(n=e.retry_config)&&void 0!==n&&n.exponential_backoff)})})}))}})})]})]}),v.tf.DBT===E&&(0,C.jsxs)(Z.Z,{mb:P.HN,px:P.cd,children:[(0,C.jsx)(Pn.Z,{children:"dbt settings"}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsx)(b.Z,{checked:!(null===F||void 0===F||null===(n=F.configuration)||void 0===n||null===(t=n.dbt)||void 0===t||!t.disable_tests),label:"Disable automatically running dbt tests",onClick:function(){return le((function(e){var n,t,i;return Ft(Ft({},e),{},{configuration:Ft(Ft({},null===e||void 0===e?void 0:e.configuration),{},{dbt:Ft(Ft({},null===e||void 0===e||null===(n=e.configuration)||void 0===n?void 0:n.dbt),{},{disable_tests:!(null!==e&&void 0!==e&&null!==(t=e.configuration)&&void 0!==t&&null!==(i=t.dbt)&&void 0!==i&&i.disable_tests)})})})}))}})})]}),v.tf.GLOBAL_DATA_PRODUCT===E&&(0,C.jsxs)(Z.Z,{mb:P.HN,children:[(0,C.jsx)(Z.Z,{px:P.cd,children:(0,C.jsx)(Pn.Z,{children:"Override global data product settings"})}),(0,C.jsx)(Z.Z,{mt:P.Mq,children:(0,C.jsx)(Tt.Z,{objectAttributes:ge,originalAttributes:B,setObjectAttributes:xe})}),(0,C.jsx)(Z.Z,{mt:P.Mq,children:(0,C.jsx)(Dt.Z,{objectAttributes:ge,originalAttributes:B,setObjectAttributes:xe})}),(0,C.jsx)(Z.Z,{mt:P.Mq,children:(0,C.jsx)(Mt.Z,{blocks:null===N||void 0===N?void 0:N.blocks,objectAttributes:ge,originalAttributes:B,setObjectAttributes:xe})})]}),(0,C.jsx)(Z.Z,{px:P.cd,children:(0,C.jsx)(T.Z,{disabled:!$,loading:ve,onClick:function(){return he({block:{configuration:null===F||void 0===F?void 0:F.configuration,executor_type:null===F||void 0===F?void 0:F.executor_type,retry_config:oe}})},primary:!0,children:"Update block settings"})})]})}),(0,C.jsxs)(Z.Z,{mb:P.HN,children:[!ue&&(0,C.jsx)(Z.Z,{p:P.cd,children:(0,C.jsx)(H.Z,{inverted:!0})}),ue&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{p:P.cd,children:[(0,C.jsxs)(Pn.Z,{children:["Pipelines using this block (",de,")"]}),(0,C.jsx)(O.ZP,{default:!0,children:"A shared block is available to and reused by multiple pipelines. It enables you to write code once and have it easily accessible anywhere in the workspace. As a result, any code changes will affect all pipelines sharing the block."})]}),me]})]})]})},Wt=t(92083),zt=t.n(Wt),Vt=t(26226),Gt=t(84969),Kt=t(90948),Yt=t(65743),qt=t(39048),Qt=t(79487),Jt=t(29989),Xt=t(61655),$t=t(16853),ei=t(65376),ni=t(52359),ti=t(2005),ii=t(48072),ri=t(24903),oi=t(98677),li=t(84181),ci=t(31012);function ui(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 ai(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ui(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ui(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var si={bottom:P.iI*(3+P.cd),left:P.iI*P.cd,right:P.iI*P.cd,top:P.iI*P.cd};function di(e,n){return Math.max.apply(Math,(0,r.Z)(e.map(n)))}function pi(e){var n=e.data,t=e.height,i=e.keyForYData,o=e.large,l=e.margin,c=void 0===l?{}:l,u=e.orientationVertical,a=void 0!==u&&u,d=e.showTooltip,p=e.width,f=e.yLabelFormat,h=(0,s.useContext)(m.ThemeContext),v=(0,s.useCallback)((function(e){return e[i]}),[i]),b=f;b||(b=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e});var g=o?ci.iD:ci.J5,x=ai(ai({},si),c),j=n.slice(Math.max(0,n.length-50)),y=(0,s.useMemo)((function(){return Object.keys((null===j||void 0===j?void 0:j[0])||{}).filter((function(e){return e!==i}))}),[j,i]),k=(0,ri.Z)({domain:y,range:[Nt.a$,Nt.Ej,Nt.hM,Nt.ZA,Nt.$R,Nt.X_,Nt.er,Nt.hl,Nt.nQ]}),Z=(0,s.useMemo)((function(){return j.map(v)}),[j,v]),O=(0,oi.Z)({domain:Z,padding:.1}),P=(0,oi.Z)({domain:y,padding:.1}),w=(0,li.Z)({domain:[0,di(j,(function(e){return di(y,(function(n){return Number(e[n])}))}))]}),C={active:(null===h||void 0===h?void 0:h.content.default)||Ze.Z.content.default,backgroundPrimary:(null===h||void 0===h?void 0:h.chart.backgroundPrimary)||Ze.Z.chart.backgroundPrimary,backgroundSecondary:(null===h||void 0===h?void 0:h.chart.backgroundSecondary)||Ze.Z.chart.backgroundSecondary,muted:(null===h||void 0===h?void 0:h.content.muted)||Ze.Z.content.muted,primary:(null===h||void 0===h?void 0:h.chart.primary)||Ze.Z.chart.primary,tooltipBackground:(null===h||void 0===h?void 0:h.background.navigation)||Ze.Z.background.navigation},_=Z;a&&(_=j.reduce((function(e,n){return e.concat(y.map((function(e){var t=n[e];return(0,Q.HW)(t)?parseInt(String(t)):t})))}),[]));var S=Math.min(Math.max.apply(Math,(0,r.Z)(_.map((function(e){return String(e).length})))),20);x.left+=7*S;var E=p-(x.left+x.right),I=t-(x.top+x.bottom);a?(O.rangeRound([0,E]),w.rangeRound([I,0])):(O.rangeRound([I,0]),w.rangeRound([0,E])),P.rangeRound([0,O.bandwidth()]);var T=j.map(v).length,D=0;a||(D=O(_[T-1]));var A=(0,s.useCallback)((function(e){var n=(0,ii.Z)(e)||{x:0,y:0},t=n.x,i=n.y,r=t-x.left,o=i-x.top,l=0;l=a?(r-D/2)/(E-D):1-(o-D/2)/(I-D);var c=Math.floor(l*T),u=j[c];"undefined"===typeof u&&(u=j[c-1]),a?r>D&&r<E+x.left-D&&d({tooltipData:u,tooltipLeft:t,tooltipTop:i}):o>D&&o<I-D&&d({tooltipData:u,tooltipLeft:t,tooltipTop:i})}),[j,T,x.left,x.top,a,d,D,E,I]);return{colorScale:k,colors:C,data:j,fontSize:g,handleTooltip:A,margin:x,tempScale:w,tickValues:_,xKeys:y,xMax:E,y1Scale:P,yLabelFormat:b,yMax:I,yScale:O,ySerialize:v}}var fi=["height","width","xAxisLabel","yAxisLabel"];function hi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function vi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?hi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):hi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var mi=3*P.iI,bi=(P.iI,P.iI,P.iI,(0,Xt.Z)((function(e){var n=e.data,t=e.height,i=e.hideTooltip,r=e.keyForYData,o=void 0===r?"__y":r,c=e.large,u=e.margin,a=void 0===u?{}:u,s=e.renderNoDataText,d=e.renderTooltipContent,p=e.showTooltip,f=e.tooltipData,h=e.tooltipLeft,v=e.tooltipOpen,m=e.tooltipTop,b=e.width,g=e.xAxisLabel,x=e.xNumTicks,j=e.yLabelFormat,y=pi({data:n,height:t,keyForYData:o,large:c,margin:a,showTooltip:p,width:b,yLabelFormat:j}),k=y.colorScale,Z=y.colors,P=y.data,w=y.fontSize,_=y.handleTooltip,S=y.margin,E=y.tempScale,I=y.tickValues,T=y.xKeys,D=y.xMax,A=y.y1Scale,M=y.yLabelFormat,B=y.yMax,R=y.yScale,N=y.ySerialize,L=[],F=Math.floor((null===I||void 0===I?void 0:I.length)/Math.floor(t/mi));return null===I||void 0===I||I.forEach((function(e,n){n%F===0&&L.push(e)})),b<10?null:(0,C.jsxs)("div",{children:[(0,C.jsxs)("svg",{height:t,width:b,children:[s&&!(null!==P&&void 0!==P&&P.length)&&(0,C.jsx)("text",{fill:Z.active,dominantBaseline:"middle",textAnchor:"middle",fontFamily:ti.ry,fontSize:w,x:"50%",y:"50%",children:s()}),(0,C.jsx)(Yt.Z,{fill:"transparent",height:t-(S.top+S.bottom),onMouseLeave:function(){return i()},onMouseMove:_,onTouchMove:_,onTouchStart:_,rx:14,width:b-(S.left+S.right),x:S.left,y:S.top}),(null===P||void 0===P?void 0:P.length)&&(0,C.jsxs)(Jt.Z,{left:S.left,top:S.top,children:[(0,C.jsx)(qt.Z,{color:k,data:P,keys:T,width:D,xScale:E,y0:N,y0Scale:R,y1Scale:A,children:function(e){return e.map((function(e){return(0,C.jsx)(Jt.Z,{top:e.y0,children:e.bars.map((function(n){return(0,C.jsx)("g",{children:(0,C.jsx)(C.Fragment,{children:(0,C.jsx)("rect",{fill:n.color,height:n.height,pointerEvents:"none",rx:4,width:n.width,x:n.x,y:n.y})})},"".concat(e.index,"-").concat(n.index,"-").concat(n.key))}))},"bar-group-horizontal-".concat(e.index,"-").concat(e.y0))}))}}),(0,C.jsx)(Gt.Z,{hideTicks:!0,scale:R,stroke:Z.muted,tickFormat:function(e){return M(e)},tickLabelProps:function(){return{fill:Z.active,fontFamily:ti.ry,fontSize:w,style:{width:"10px"},textAnchor:"end"}},tickStroke:Z.muted,tickValues:L,top:2}),(0,C.jsx)(Kt.Z,{label:g,labelProps:{fill:Z.muted,fontFamily:ti.ry,fontSize:w,textAnchor:"middle"},numTicks:x,scale:E,stroke:Z.muted,tickLabelProps:function(){return{fill:Z.active,fontFamily:ti.ry,fontSize:w,textAnchor:"middle"}},tickStroke:Z.muted,top:B})]}),f&&(0,C.jsx)("g",{children:(0,C.jsx)(Qt.Z,{from:{x:S.left,y:m},pointerEvents:"none",stroke:Z.active,strokeDasharray:"5,2",strokeWidth:1,to:{x:D+S.left,y:m}})})]}),v&&f&&(0,C.jsxs)($t.Z,{left:h,style:vi(vi({},ei.j),{},{backgroundColor:Z.tooltipBackground}),top:m,children:[d&&d(f),!d&&Object.entries(f).map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];if(o!==t){var r=i;return(0,Q.HW)(r)&&String(r).split(".").length>=2&&(r=r.toFixed(4)),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[t,": ",r]},t)}}))]})]})})));var gi=function(e){var n,t=e.height,i=e.width,r=e.xAxisLabel,o=e.yAxisLabel,l=(0,Le.Z)(e,fi);return n="undefined"===typeof i?"100%":o?0===i?i:i-28:i,(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{style:{display:"flex",height:t,marginBottom:r?P.iI:null,width:"100%"},children:[o&&(0,C.jsx)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,C.jsx)(ni.Z,{children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:o})})}),(0,C.jsx)("div",{style:{height:t,width:n},children:(0,C.jsx)(Vt.Z,{children:function(e){var n=e.width,t=e.height;return(0,C.jsx)(bi,vi(vi({},l),{},{height:t,width:n}))}})})]}),r&&(0,C.jsx)("div",{style:{paddingLeft:o?36:0,paddingTop:4},children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:r})})]})},xi=t(95422),ji=["keyForYData"],yi=["height","width","xAxisLabel","yAxisLabel"];function ki(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 Zi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ki(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ki(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Oi=6*P.iI,Pi=(0,Xt.Z)((function(e){var n=e.keyForYData,t=void 0===n?"__y":n,i=(0,Le.Z)(e,ji),r=i.height,o=i.hideTooltip,c=i.renderNoDataText,u=i.renderTooltipContent,a=i.tooltipData,s=i.tooltipLeft,d=i.tooltipOpen,p=i.tooltipTop,f=i.width,h=i.xLabelFormat,v=i.xNumTicks,m=i.yNumTicks,b=pi(Zi(Zi({},i),{},{keyForYData:t,orientationVertical:!0})),g=b.colorScale,x=b.colors,j=b.data,y=b.fontSize,k=b.handleTooltip,Z=b.margin,P=b.tempScale,w=(b.tickValues,b.xKeys),_=(b.xMax,b.y1Scale),S=b.yLabelFormat,E=b.yMax,I=b.yScale,T=b.ySerialize,D=Math.min(v,f/Oi);return f<10?null:(0,C.jsxs)("div",{children:[(0,C.jsxs)("svg",{height:r,width:f,children:[c&&!(null!==j&&void 0!==j&&j.length)&&(0,C.jsx)("text",{fill:x.active,dominantBaseline:"middle",textAnchor:"middle",fontFamily:ti.ry,fontSize:y,x:"50%",y:"50%",children:c()}),(null===j||void 0===j?void 0:j.length)&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Yt.Z,{fill:"transparent",height:r-(Z.top+Z.bottom),onMouseLeave:function(){return o()},onMouseMove:k,onTouchMove:k,onTouchStart:k,rx:14,width:f-(Z.left+Z.right),x:Z.left,y:2*Z.top}),(0,C.jsxs)(Jt.Z,{top:Z.top,children:[(0,C.jsx)(xi.Z,{color:g,data:j,height:E,keys:w,x0:T,x0Scale:I,x1Scale:_,yScale:P,children:function(e){return e.map((function(e){return(0,C.jsx)(Jt.Z,{left:e.x0+Z.left,top:Z.top,children:e.bars.map((function(n){return(0,C.jsx)("g",{children:(0,C.jsx)("rect",{fill:n.color,height:n.height,pointerEvents:"none",rx:4,width:n.width,x:n.x,y:n.y})},"".concat(e.index,"-").concat(n.index,"-").concat(n.key))}))},"bar-group-horizontal-".concat(e.index,"-").concat(e.x0))}))}}),(0,C.jsx)(Gt.Z,{left:Z.left,numTicks:m,scale:P,stroke:x.muted,tickFormat:function(e){return S(e)},tickLabelProps:function(){return{fill:x.active,fontFamily:ti.ry,fontSize:y,textAnchor:"end",transform:"translate(-2,2.5)"}},tickStroke:x.muted,top:Z.top}),(0,C.jsx)(Kt.Z,{hideTicks:!0,left:Z.left,numTicks:D,scale:I,stroke:x.muted,tickFormat:h,tickLabelProps:function(){return{fill:x.active,fontFamily:ti.ry,fontSize:y,textAnchor:"middle"}},tickStroke:x.muted,top:E+Z.top})]})]}),a&&(0,C.jsx)("g",{children:(0,C.jsx)(Qt.Z,{from:{x:s,y:2*Z.top},pointerEvents:"none",stroke:x.active,strokeDasharray:"5,2",strokeWidth:1,to:{x:s,y:E+2*Z.top}})})]}),d&&a&&(0,C.jsxs)($t.Z,{left:s,style:Zi(Zi({},ei.j),{},{backgroundColor:x.tooltipBackground}),top:p,children:[u&&u(a),!u&&Object.entries(a).map((function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];if(t!==i){var o=r;return(0,Q.HW)(o)&&String(o).split(".").length>=2&&(o=o.toFixed(4)),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[i,": ",o]},i)}})),(0,C.jsx)("br",{}),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[h&&h(T(a)),!h&&T(a)]})]})]})}));var wi=function(e){var n=e.height,t=e.width,i=e.xAxisLabel,r=e.yAxisLabel,o=(0,Le.Z)(e,yi);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{style:{display:"flex",height:n,marginBottom:i?P.iI:null,width:"100%"},children:[r&&(0,C.jsx)(y.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,C.jsx)(ni.Z,{children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:r})})}),(0,C.jsx)("div",{style:{height:n,width:r?0===t?t:t-28:t},children:(0,C.jsx)(Vt.Z,{children:function(e){var n=e.height,t=e.width;return(0,C.jsx)(Pi,Zi(Zi({},o),{},{height:n,width:t}))}})})]}),i&&(0,C.jsx)("div",{style:{paddingLeft:r?36:0,paddingTop:4},children:(0,C.jsx)(O.ZP,{center:!0,muted:!0,small:!0,children:i})})]})},Ci=t(62976),_i=t(66872),Si=t(68735),Ei=t(320),Ii=40*P.iI,Ti=m.default.div.withConfig({displayName:"indexstyle__ChartBlockStyle",componentId:"sc-1c3ufnj-0"})(["border-radius:","px;margin-left:","px;margin-right:","px;margin-top:","px;",""],Ge.n_,.5*P.iI,.5*P.iI,1*P.iI,(function(e){return"\n background-color: ".concat((e.theme.background||Ze.Z.background).codeArea,";\n ")})),Di=m.default.div.withConfig({displayName:"indexstyle__ConfigurationOptionsStyle",componentId:"sc-1c3ufnj-1"})(["flex:4;padding-left:","px;padding-right:","px;"],1*P.iI,1*P.iI),Ai=m.default.div.withConfig({displayName:"indexstyle__CodeStyle",componentId:"sc-1c3ufnj-2"})(["padding-top:","px;",""],P.iI/2,(function(e){return"\n background-color: ".concat((e.theme.background||Ze.Z.background).codeTextarea,";\n ")})),Mi=m.default.div.withConfig({displayName:"indexstyle__CodeHelperStyle",componentId:"sc-1c3ufnj-3"})(["margin-bottom:","px;padding-bottom:","px;padding-left:","px;",""],P.cd*P.iI,P.iI,P.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||Ze.Z.borders).medium,";\n ")}));function Bi(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 Ri(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Bi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Bi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ni=function(e){var n,t=e.block,i=e.data,r=e.width,c=t.configuration,u=void 0===c?{}:c,a=u||{},s=a.chart_style,d=a.chart_type,p=a.y_sort_order,f=u[ht.JJ]||Ii,h=(null===u||void 0===u||null===(n=u[ht.bE])||void 0===n?void 0:n.map((function(e){return(0,ht.c0)(e)})))||[],v=Ce.n1,m=u[ht.Yg];if([ht.aE.HOUR,ht.aE.MINUTE,ht.aE.SECOND].includes(m)&&(v=Ce.OC),ht.oV.BAR_CHART===d||ht.oV.TIME_SERIES_BAR_CHART===d){var b=i.x,g=i.y,x=ht.oV.TIME_SERIES_BAR_CHART===d;if(b&&g&&Array.isArray(b)&&Array.isArray(g)){var j,y=null===(j=u[ht.eN])||void 0===j?void 0:j.join(", "),k=null===h||void 0===h?void 0:h.join(", ");h.length||h.push(ht.rj);var Z=h[0],w=b.map((function(e,n){return Ri({__y:e},h.reduce((function(e,t,i){var r,l=null===g||void 0===g||null===(r=g[i])||void 0===r?void 0:r[n];return"undefined"===typeof l?e:Ri(Ri({},e),{},(0,o.Z)({},t,l))}),{}))}));ht.MP.ASCENDING===p?w=(0,_e.YC)(w,(function(e){return e[Z]}),{ascending:!1}):ht.MP.DESCENDING===p&&(w=(0,_e.YC)(w,(function(e){return e[Z]}),{ascending:!0}));var _={data:w,height:f,renderNoDataText:function(){return"No data matching query"},width:r,xNumTicks:3};return ht.JT.HORIZONTAL===s?(0,C.jsx)(gi,Ri(Ri({},_),{},{xAxisLabel:k||u[ht.rj],yAxisLabel:y||u[ht.a3]})):(0,C.jsx)(wi,Ri(Ri({},_),{},{xAxisLabel:y,xLabelFormat:function(e){return x?zt()(1e3*e).format(Ce.n1):e},xNumTicks:w.length,yAxisLabel:k,yNumTicks:5}))}}else if(ht.oV.HISTOGRAM===d){var S,E=i.x,I=i.y,T=null===(S=u[ht.eN])||void 0===S?void 0:S.join(", ");if(E&&I&&Array.isArray(E))return(0,C.jsx)(_i.Z,{data:E.map((function(e,n){var t,i=e.max,r=e.min;return[i,null===I||void 0===I||null===(t=I[n])||void 0===t?void 0:t.value,r]})),height:f,width:r,large:!0,margin:{left:5*P.iI,right:1*P.iI,top:3*P.iI},noPadding:!0,renderTooltipContent:function(e){var n=(0,l.Z)(e,3),t=n[0],i=n[1],r=n[2];return(0,C.jsxs)(O.ZP,{inverted:!0,monospace:!0,small:!0,children:["Count : ",i,(0,C.jsx)("br",{}),"Bucket: ",r,"-",t]})},showAxisLabels:!0,showYAxisLabels:!0,showZeroes:!0,sortData:function(e){return(0,_e.YC)(e,"[0]")},xAxisLabel:T||u[ht.a3],yAxisLabel:T?"count(".concat(T,")"):u[ht.rj]})}else if(ht.oV.LINE_CHART===d||ht.oV.TIME_SERIES_LINE_CHART===d){var D=i.x,A=i.y,M=ht.oV.TIME_SERIES_LINE_CHART===d;if(D&&A&&Array.isArray(D)&&Array.isArray(A)&&Array.isArray(null===A||void 0===A?void 0:A[0])){var B,R=h;u[ht.e]&&(R=u[ht.e].split(",").map((function(e){return e.trim()})));var N=D.map((function(e,n){return{x:e,y:(0,_e.w6)(A.length).map((function(e,t){var i=A[t][n];return"undefined"===typeof i||null===i?0:i}))}})),L=null===(B=u[ht.eN])||void 0===B?void 0:B.join(", "),F=h.join(", ");return(0,C.jsx)(Si.Z,{data:N,height:f,lineLegendNames:R,margin:{bottom:8*P.iI,left:5*P.iI},noCurve:!0,renderXTooltipContent:function(e){e.index;var n=e.x,t=u[ht.a3],i=n;return u[ht.eN]&&(t=u[ht.eN].map(String).join(", ")),M&&(i=zt()(1e3*n).format(v)),(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[t,": ",i]})},renderYTooltipContent:function(e,n){var t=e.y;return(0,C.jsxs)(O.ZP,{inverted:!0,small:!0,children:[R&&R[n]&&"".concat(R[n],": "),t&&(0,Q.x6)((0,Q.QV)(t[n],4))]})},width:r?r-3*P.iI:r,xAxisLabel:L||String(u[ht.a3]),xLabelFormat:function(e){return M?zt()(1e3*e).format(Ce.n1):e},yAxisLabel:F||String(u[ht.rj]),yLabelFormat:function(e){return e}})}}else if(ht.oV.PIE_CHART===d){var U,H=i[String(u[ht.a3])],W=null===(U=u[ht.eN])||void 0===U?void 0:U.join(", ");if(H)return(0,C.jsx)(Ei.Z,{data:Object.entries(H),getX:function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return"".concat(t," (").concat((0,Q.x6)(i),")")},getY:function(e){return(0,l.Z)(e,2)[1]},height:f,width:r,xAxisLabel:W||String(u[ht.a3])})}else if(ht.oV.TABLE===d){var z=i.index,V=i.x,G=i.y;return Array.isArray(V)&&Array.isArray(G)&&Array.isArray(G[0])&&(0,C.jsx)(Ci.Z,{columns:V,index:z,height:u[ht.JJ]?null:f,maxHeight:u[ht.JJ]?f:null,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,rows:G,width:r})}return(0,C.jsx)("div",{})},Li=t(65051),Fi=t(76096);var Ui=function(e){var n=e.children,t=e.onChange,i=(0,s.useState)(s.Children.map(n,(function(){return null}))),r=i[0],o=i[1],l=(0,s.useState)(0),c=l[0],u=l[1];return(0,C.jsx)(y.ZP,{children:s.Children.map(n,(function(e,n){return(0,C.jsx)(Z.Z,{ml:n>=1?1:0,style:{display:"flex",flex:1},children:s.cloneElement(e,{onChange:function(e){o((function(i){return i[n]=e.target.value,t(i,{resetValues:function(){return u((function(e){return e+1}))},setValues:o}),i}))},value:r[n]})},"multi-select-child-".concat(n,"-").concat(c))}))})},Hi=t(59582),Wi=t(78759);function zi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Vi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Gi(e,n){var t,i,r,c,u=e.autocompleteItems,a=e.block,p=e.blockRefs,f=e.blocks,h=e.deleteWidget,b=e.executionState,g=e.fetchPipeline,x=e.fetchFileTree,_=e.messages,S=void 0===_?[]:_,E=e.onChangeContent,I=e.pipeline,T=e.runBlock,D=e.runningBlocks,A=e.savePipelineContent,M=e.selected,B=e.setAnyInputFocused,R=e.setErrors,L=e.setSelectedBlock,F=e.setTextareaFocused,G=e.textareaFocused,K=e.updateWidget,Y=e.width,q=(0,s.useRef)(null),X=(0,s.useContext)(m.ThemeContext),$=z.ZP.blocks.pipelines.detail(null===I||void 0===I?void 0:I.uuid,null===a||void 0===a?void 0:a.upstream_blocks[0]).data,ee=(null===$||void 0===$||null===(t=$.block)||void 0===t?void 0:t.outputs)||(null===a||void 0===a?void 0:a.outputs)||[],ne=(0,s.useState)(null),te=ne[0],ie=ne[1],re=(0,s.useState)(null===(i=a.configuration)||void 0===i?void 0:i.chart_type),oe=re[0],ce=re[1],ue=(0,s.useState)(a.configuration),se=ue[0],de=ue[1],pe=(0,s.useState)(a.content),fe=pe[0],he=pe[1],ve=(0,s.useState)(!oe||0===ee.length),me=ve[0],be=ve[1],ge=(0,s.useState)(!1),xe=ge[0],je=ge[1],ye=(0,s.useState)(null),Pe=ye[0],we=ye[1],Ce=(0,s.useState)(null===a||void 0===a?void 0:a.upstream_blocks),Se=Ce[0],Ee=Ce[1],Ie=(0,s.useState)((null===ee||void 0===ee?void 0:ee.length)||0),De=Ie[0],Ae=Ie[1],Me=(0,s.useState)(a.uuid),Be=Me[0],Re=Me[1],Ne=Wi.G8[oe],Le=Wi.x8[oe],Fe=(0,s.useMemo)((function(){return null===f||void 0===f?void 0:f.filter((function(e){var n=e.type;return[v.tf.DATA_LOADER,v.tf.TRANSFORMER].includes(n)}))}),[f]),Ue=(0,s.useMemo)((function(){return(0,_e.HK)(Fe,(function(e){return e.uuid}))}),[Fe]),He=!!D.find((function(e){return e.uuid===a.uuid}))||(null===S||void 0===S?void 0:S.length)>=1&&b!==Te.uF.IDLE,We=(0,s.useMemo)((function(){return null===S||void 0===S?void 0:S.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[S]),ze=!!We.find((function(e){return e.error})),Ge=We.length>=1,Ke=(0,s.useMemo)((function(){return{blockType:a.type,hasError:ze,selected:M}}),[a.type,ze,M]);if(null!==We&&void 0!==We&&We.length){var Ye,qe,Qe=We.length-1;c=null===We||void 0===We||null===(Ye=We[Qe])||void 0===Ye||null===(qe=Ye.data)||void 0===qe?void 0:qe[0]}c?(c=(c=c.slice(1,c.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,Q.Pb)(c)&&(r=JSON.parse(c))):(null===ee||void 0===ee?void 0:ee.length)>=1&&(r={},ee.forEach((function(e){var n=e||{},t=n.text_data,i=n.type,o=n.variable_uuid;Te.Gi.TEXT===i&&(0,Q.Pb)(t)&&(r[o]=JSON.parse(t))})));var Je=(0,s.useCallback)((function(e){var n=Vi(Vi(Vi({},a),e),{},{configuration:Vi(Vi({},a.configuration),e.configuration)});A().then((function(){T({block:n,code:fe,ignoreAlreadyRunning:!0,runUpstream:!!Se.find((function(e){var n;return![v.DA.EXECUTED,v.DA.UPDATED].includes(null===(n=Ue[e])||void 0===n?void 0:n.status)}))})})),Ae((function(e){return e+1}))}),[a,Ue,fe,Ae,Se]),Xe=(0,s.useCallback)((function(e){he(e),E(e)}),[E,he]),$e=(0,s.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;de((function(n){return Vi(Vi({},n),e)}));var i=Vi(Vi({},a),{},{configuration:Vi(Vi(Vi({},se),e),{},{chart_type:oe})});K(i),De&&t&&Je(i)}),[a,oe,se,De,Je,de,K]);(0,s.useEffect)((function(){ie({python:(0,Hi.Z)({autocompleteItems:u,block:a,blocks:f,pipeline:I})})}),[u,a,f,I]);var en=(0,s.useMemo)((function(){return(0,C.jsx)(ot.Z,{autoHeight:!0,autocompleteProviders:te,onChange:Xe,selected:M,setSelected:function(e){return L(!0===e?a:null)},setTextareaFocused:F,showLineNumbers:!1,textareaFocused:G||ht.oV.TABLE===oe&&!me,value:fe,width:"100%"})}),[te,a,oe,fe,me,M,L,F,G,Xe]),nn=(0,s.useMemo)((function(){return(ze||Ge)&&(0,C.jsx)(Li.Z,Vi(Vi({},Ke),{},{block:a,contained:!1,hideExtraInfo:!0,isInProgress:He,messages:We,selected:M}))}),[a,Ke,ze,Ge,He,We,M]),tn=(0,Oe.Z)(me),rn=(0,Oe.Z)(Y);(0,s.useEffect)((function(){var e,n=null===q||void 0===q||null===(e=q.current)||void 0===e?void 0:e.getBoundingClientRect();tn!==me||rn!==Y?(we(0),setTimeout((function(){var e,n,t=null===q||void 0===q||null===(e=q.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width;t&&we(t)}),100)):n&&we(n.width)}),[me,tn,q,we,Y,rn]);var on=(0,s.useMemo)((function(){var e=[];return Se.forEach((function(n,t){var i=Ue[n],r=(0,w.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:X}).accent;e.push((0,C.jsxs)(Z.Z,{ml:2,children:[(0,C.jsxs)(O.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,C.jsx)(k.Z,{color:r,inline:!0,onClick:function(){var e,n,t=null===p||void 0===p||null===(e=p.current)||void 0===e?void 0:e["".concat(null===i||void 0===i?void 0:i.type,"s/").concat(null===i||void 0===i?void 0:i.uuid,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,C.jsx)(O.ZP,{color:r,monospace:!0,small:!0,children:n})})]},n))})),e}),[p,Ue,X,Se]),ln=(0,s.useMemo)((function(){var e,n=[],t=null===Ne||void 0===Ne||null===(e=Ne.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return ht.Tv.includes(t)?e.concat(t):e}),[]);return null===t||void 0===t||t.forEach((function(e){var t=se[e];if(t){var i,r,o=null===(i=Wi.SR[oe])||void 0===i||null===(r=i[e])||void 0===r?void 0:r.call(i);n.push((0,C.jsxs)(Z.Z,{ml:2,children:[(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",o&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,C.jsx)(O.ZP,{default:!0,inline:!0,small:!0,children:o})]})]},t))}})),n}),[oe,se,Ne]),cn=(0,Oe.Z)(oe),un=(0,Oe.Z)(Se);(0,s.useEffect)((function(){if((!cn&&oe&&null!==Se&&void 0!==Se&&Se.length||(null===un||void 0===un||!un.length)&&(null===Se||void 0===Se?void 0:Se.length)>=1&&oe)&&!fe&&(0,Fn.Qr)(se)&&Le){var e=Vi(Vi({},a),{},{upstream_blocks:Se});Le.configuration&&$e(Le.configuration(e)),Le.content&&Xe(Le.content(e))}}),[a,oe,cn,se,fe,Le,$e,Xe,Se,un]);var an=(0,s.useMemo)((function(){return se[ht.v8]||1}),[se]),sn=(0,s.useMemo)((function(){return Object.entries(Ne||{}).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0],r=t[1];return Vi(Vi({},e),{},(0,o.Z)({},i,r.map((function(e){var n,t=e.autoRun,i=e.label,r=e.monospace,l=e.options,c=e.settings,u=void 0===c?{}:c,s=e.type,d=e.uuid,p={fullWidth:!0,key:d,label:(0,Q.kC)(i()),monospace:r,onBlur:function(){return L(a)},onChange:function(e){return $e((0,o.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return L(a)},value:(null===se||void 0===se?void 0:se[d])||""},f=(null!==$&&void 0!==$&&$.block?[$.block]:[]).reduce((function(e,n){var t=n.outputs;return t?e.concat(t.reduce((function(e,n){var t=n.sample_data;return null!==t&&void 0!==t&&t.columns?e.concat(t.columns):e}),[])):e}),[]);if(Wi.VR.COLUMNS===s){var h=se[d]||[];n=(0,C.jsxs)(C.Fragment,{children:[(!u.maxValues||h.length<u.maxValues)&&(0,C.jsx)(U.Z,Vi(Vi({},p),{},{onChange:function(e){var n=se[d]||[],i=e.target.value;n.includes(i)?n=(0,_e.Od)(n,(function(e){return e===i})):n.push(i),$e((0,o.Z)({},d,n),{autoRun:t})},value:null,children:(0,_e.YC)(f.filter((function(e){return!h.includes(e)})),(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})),h.map((function(e){return(0,C.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,C.jsx)(Bn.Z,{label:e,onClick:function(){$e((0,o.Z)({},d,(0,_e.Od)(h,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(Wi.VR.METRICS===s){var v=se[d]||[];n=(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(O.ZP,{bold:!0,children:"Metrics"}),(0,C.jsx)(O.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,C.jsxs)(Ui,{onChange:function(e,n){var i=n.resetValues,r=n.setValues;2===e.filter((function(e){return!!e})).length&&(v.find((function(n){var t=n.aggregation;return n.column===e[1]&&t===e[0]}))||($e((0,o.Z)({},d,v.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),r([null,null]),i()))},children:[(0,C.jsx)(U.Z,Vi(Vi({},p),{},{label:"aggregation",children:(0,_e.YC)(ht.bn,(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})),(0,C.jsx)(U.Z,Vi(Vi({},p),{},{label:"column",children:(0,_e.YC)(f,(function(e){return e})).map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))}))]}),v.map((function(e){var n=e.aggregation,i=e.column;return(0,C.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,C.jsx)(Bn.Z,{label:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(O.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){$e((0,o.Z)({},d,(0,_e.Od)(v,(function(e){var t=e.aggregation,r=e.column;return n===t&&i===r}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=l?(0,C.jsx)(U.Z,Vi(Vi({},p),{},{children:l.map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})):(0,C.jsx)(W.Z,Vi(Vi({},p),{},{type:s}));return(0,C.jsx)(Z.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[a,se,Ne,$,L,$e]),dn=sn.code,pn=sn.noCode,fn=(0,d.Db)(z.ZP.widgets.pipelines.useUpdate(null===I||void 0===I?void 0:I.uuid,a.uuid),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){je(!1),g(),x()},onErrorCallback:function(e,n){return null===R||void 0===R?void 0:R({errors:n,response:e})}})}}),hn=(0,l.Z)(fn,1)[0],vn="ChartBlock/".concat(a.uuid),mn=(0,ae.y)(),bn=mn.registerOnKeyDown,gn=mn.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){gn(vn)}}),[gn,vn]),bn(vn,(function(e,n,t){xe&&String(t[0])===String(le.Uq)&&String(t[1])!==String(le.zX)&&hn({widget:Vi(Vi({},a),{},{name:Be})})}),[a,xe,Be,hn]),(0,C.jsx)(Fi.Z,{sm:12,md:12*an,children:(0,C.jsxs)(Ti,{ref:n,children:[(0,C.jsx)(Z.Z,{mt:1,pt:1,px:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{flex:1,style:{position:"relative"},children:[(0,C.jsx)(Ve,{bold:!1,fullWidth:!0,inputValue:Be,notRequired:!0,onBlur:function(){return setTimeout((function(){return je(!1)}),300)},onChange:function(e){Re(e.target.value),e.preventDefault()},onClick:function(){B(!0),je(!0)},onFocus:function(){B(!0),je(!0)},small:!0,stacked:!0,value:!xe&&a.uuid}),xe&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(k.Z,{noWrapping:!0,onClick:function(){return hn({widget:Vi(Vi({},a),{},{name:Be})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(U.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=Vi(Vi({},a),{},{upstream_blocks:n});K(t),Je(t),Ee(n)},placeholder:"Source block",small:!0,value:(null===Se||void 0===Se?void 0:Se[0])||"",children:null===Fe||void 0===Fe?void 0:Fe.map((function(e){var n=e.uuid;return(0,C.jsx)("option",{value:n,children:n},n)}))}),(0,C.jsx)(Z.Z,{mr:1}),!He&&(0,C.jsx)(ke.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Je(a)},uuid:"ChartBlock/run/".concat(a.uuid),children:(0,C.jsx)(V.Py,{size:2*P.iI})})}),Te.uF.QUEUED===b&&(0,C.jsx)(H.Z,{color:(X||Ze.Z).content.active,small:!0,type:"cylon"}),Te.uF.BUSY===b&&(0,C.jsx)(H.Z,{color:(X||Ze.Z).content.active,small:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(ke.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return be((function(e){return!e}))},selected:me,uuid:"ChartBlock/edit/".concat(a.uuid),children:(0,C.jsx)(V.I8,{size:2*P.iI})})}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(ke.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return h(a)},uuid:"ChartBlock/delete/".concat(a.uuid),children:(0,C.jsx)(V.rF,{size:2*P.iI})})})]})]})}),(0,C.jsx)(Z.Z,{mt:1}),(0,C.jsxs)(y.ZP,{fullWidth:!0,justifyContent:"space-between",children:[(0,C.jsx)(j.Z,{flex:6,ref:q,children:r&&!(0,Fn.Qr)(r)&&(0,C.jsx)(Z.Z,{pb:3,children:(0,C.jsx)(Ni,{block:Vi(Vi({},a),{},{configuration:Vi(Vi({},a.configuration),se)}),data:r,width:Pe})})}),me&&(0,C.jsx)(Di,{children:(0,C.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(U.Z,{onChange:function(e){var n=e.target.value,t=Vi(Vi({},a),{},{configuration:Vi(Vi({},se),{},{chart_type:n})});K(t),Je(t),ce(n)},placeholder:"Select chart type",value:oe,children:ht.CK.map((function(e){return(0,C.jsx)("option",{value:e,children:(0,Q.kC)(e)},e)}))})}),(0,C.jsx)(Z.Z,{mb:1,children:(0,C.jsx)(U.Z,{onChange:function(e){return $e((0,o.Z)({},ht.v8,e.target.value))},placeholder:"Chart width",value:(null===se||void 0===se?void 0:se[ht.v8])||1,children:[["1/2 width",.5],["full width",1]].map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return(0,C.jsx)("option",{value:i,children:t},t)}))})}),pn]})})]}),me&&!(null===dn||void 0===dn||!dn.length)&&v.t6.SQL!==a.language&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{my:1,px:1,children:[(0,C.jsx)(O.ZP,{bold:!0,children:"Custom chart code"}),(0,C.jsxs)(O.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,C.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,C.jsxs)(Ai,{children:[Se.length>=1&&(0,C.jsxs)(Mi,{children:[(0,C.jsxs)(O.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",on]}),(0,C.jsxs)(O.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",ln]})]}),en]})]}),nn&&(0,C.jsx)(Z.Z,{px:1,children:nn})]})})}var Ki=s.forwardRef(Gi),Yi=t(97361),qi=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function Qi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ji(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qi(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xi=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,r=e.deleteWidget,l=e.messages,c=e.onChangeChartBlock,u=e.runBlock,a=e.runningBlocks,d=e.savePipelineContent,p=e.selectedBlock,f=e.setAnyInputFocused,h=e.setErrors,v=e.setSelectedBlock,m=e.setTextareaFocused,b=e.textareaFocused,g=e.updateWidget,x=e.widgets,j=e.width,k=(0,Le.Z)(e,qi),Z=(0,s.useMemo)((function(){return a.reduce((function(e,n,t){return Ji(Ji({},e),{},(0,o.Z)({},n.uuid,Ji(Ji({},n),{},{priority:t})))}),{})}),[a]);return(0,C.jsxs)(y.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,C.jsx)(Yi.Z,{fullHeight:!0,style:{marginLeft:.5*P.iI,marginRight:.5*P.iI},children:null===x||void 0===x?void 0:x.map((function(e){var o=e.uuid,x=Z[o],y=x?0===x.priority?Te.uF.BUSY:Te.uF.QUEUED:Te.uF.IDLE;return i.current[o]=(0,s.createRef)(),(0,s.createElement)(Ki,Ji(Ji({},k),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:r,executionState:y,key:o,messages:l[o],onChangeContent:function(e){return c(o,e)},ref:i.current[o],runBlock:u,runningBlocks:a,savePipelineContent:d,selected:(null===p||void 0===p?void 0:p.uuid)===o,setAnyInputFocused:f,setErrors:h,setSelectedBlock:v,setTextareaFocused:m,textareaFocused:b,updateWidget:g,width:j}))}))}),(0,C.jsx)("div",{style:{height:"80vh"}})]})},$i=t(48952),er=m.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),nr=function(e){var n=e.size,t=void 0===n?20:n,i=e.viewBox,r=void 0===i?"0 0 358 305":i;return(0,C.jsxs)(er,{height:t*(305/358),viewBox:r,width:t,children:[(0,C.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M290 47H66c-3.866 0-7 3.134-7 7v200c0 3.866 3.134 7 7 7h224c3.866 0 7-3.134 7-7V54c0-3.866-3.134-7-7-7zM66 46c-4.4183 0-8 3.5817-8 8v200c0 4.418 3.5817 8 8 8h224c4.418 0 8-3.582 8-8V54c0-4.4183-3.582-8-8-8H66z",fill:"#000"}),(0,C.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,C.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,C.jsx)("rect",{x:"209.651",y:"17.1125",width:"1.0163",height:"14.2284",rx:".5082",transform:"rotate(24.933 209.651 17.1125)",fill:"#2AB2FE"}),(0,C.jsx)("path",{fill:"#2AB2FE",d:"M207.788 23.5313l35.4813 16.4949-.4285.9215-35.4812-16.4948zM247.033 31.9316c.946-2.0359 3.364-2.9191 5.4-1.9726l31.795 14.7811-11.383 24.4836-31.794-14.7811c-2.036-.9465-2.92-3.3642-1.973-5.4002l7.955-17.1108z"}),(0,C.jsx)("path",{d:"M284.228 44.7401l31.795 14.7811c2.036.9465 2.919 3.3642 1.972 5.4001l-7.954 17.1109c-.947 2.0359-3.365 2.9191-5.401 1.9726l-31.795-14.7811 11.383-24.4836z",fill:"#0093E4"}),(0,C.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M352.959 83.7347a.5082.5082 0 00-.675.2466l-2.571 5.5296-35.481-16.4949-.428.9216 35.481 16.4949-2.571 5.5295a.5081.5081 0 00.247.675.5082.5082 0 00.675-.2466l5.57-11.9806a.5083.5083 0 00-.247-.6751z",fill:"#2AB2FE"}),(0,C.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,C.jsx)("path",{d:"M337.354 256.065a38.3848 38.3848 0 01-10.816 21.271 38.3722 38.3722 0 01-21.293 10.768 38.3787 38.3787 0 01-23.542-3.895 38.3764 38.3764 0 01-16.691-17.054l17.208-8.494a19.1932 19.1932 0 0020.117 10.475 19.189 19.189 0 0010.647-5.385c2.886-2.88 4.78-6.605 5.407-10.635l18.963 2.949z",fill:"#FF3C3C"}),(0,C.jsx)("path",{d:"M294.876 288.277a38.3849 38.3849 0 01-21.64-10.056 38.3818 38.3818 0 01-11.516-20.899 38.3896 38.3896 0 013.06-23.666 38.386 38.386 0 0116.453-17.283l9.098 16.897a19.1904 19.1904 0 00-9.757 20.474 19.1937 19.1937 0 005.758 10.45 19.194 19.194 0 0010.82 5.028l-2.276 19.055z",fill:"#2ECDF7"}),(0,C.jsx)("path",{d:"M275.892 219.85a38.3804 38.3804 0 0145.342-1.268 38.3803 38.3803 0 0114.45 18.989 38.3873 38.3873 0 01.436 23.858l-18.346-5.631a19.1827 19.1827 0 00-.218-11.929 19.1907 19.1907 0 00-7.225-9.495 19.1875 19.1875 0 00-11.439-3.39 19.192 19.192 0 00-11.232 4.024l-11.768-15.158z",fill:"#885EFF"}),(0,C.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M259.206 102.57c.241.135.327.439.193.68l-39.314 70.576c-.613 1.1-1.962 1.565-3.124 1.093-3.766-1.53-13.762-5.285-26.356-7.597-12.6-2.314-27.762-3.177-41.881 1.037-16.112 4.81-27.78 14.07-35.424 22.135-3.822 4.032-6.635 7.763-8.491 10.483-.928 1.36-1.616 2.467-2.072 3.232-.228.383-.397.68-.509.881-.057.1-.098.177-.126.227l-.03.057-.008.014-.001.003a.5008.5008 0 01-.676.21.5005.5005 0 01-.209-.676l.442.233-.442-.233.001-.001.002-.005.009-.016.033-.062c.03-.055.073-.135.132-.239.116-.208.29-.513.523-.904.465-.782 1.165-1.906 2.105-3.285 1.881-2.756 4.727-6.53 8.591-10.607 7.727-8.153 19.539-17.532 35.864-22.405 14.331-4.278 29.668-3.391 42.347-1.063 12.685 2.329 22.748 6.109 26.552 7.654.699.284 1.51.002 1.875-.653l39.313-70.575a.5008.5008 0 01.681-.194z",fill:"#7D55EC"}),(0,C.jsx)("path",{d:"M221.651 176.111c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM157.778 166.428c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM106.428 204.191c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.8726-1.734-3.8726-3.873 0-2.139 1.7336-3.873 3.8726-3.873s3.873 1.734 3.873 3.873zM262.35 104.459c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873z",fill:"#7D55EC"}),(0,C.jsx)("path",{d:"M8.5523 214.855c-.3562-1.045.2025-2.181 1.248-2.538l13.7251-4.677c1.0456-.356 2.1819.203 2.5382 1.248l29.6737 87.084-17.5112 5.967-29.6738-87.084z",fill:"#4776FF"}),(0,C.jsx)("path",{d:"M45.0935 264.735c-.3562-1.045.2025-2.182 1.2481-2.538l13.725-4.677c1.0455-.356 2.1819.203 2.5382 1.248l10.6438 31.237-17.5112 5.967-10.6439-31.237z",fill:"#FFCC19"}),(0,C.jsx)("path",{d:"M54.4607 234.868c-.3563-1.046.2025-2.182 1.248-2.538l13.7251-4.677c1.0455-.356 2.1819.202 2.5382 1.248l18.7879 55.137-17.5113 5.967-18.7879-55.137z",fill:"#4776FF"})]})};var tr,ir=function(e){var n=e.blocksInNotebook;return e.extensionOption,(0,s.useMemo)((function(){return(null===n||void 0===n?void 0:n.filter((function(e){var n=e.type;return v.tf.DBT===n})))||[]}),[n]),(0,C.jsx)(C.Fragment,{})};!function(e){e.DBT="dbt",e.GREAT_EXPECTATIONS="great_expectations"}(tr||(tr={}));var rr=t(66653);function or(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 lr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?or(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):or(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var cr=function(e){var n,t,i=e.block,r=e.blockActionDescription,o=e.blocks,l=e.inputPlaceholder,c=e.loading,u=e.onClickTag,a=e.runBlockAndTrack,d=e.supportedUpstreamBlockLanguages,p=e.supportedUpstreamBlockTypes,f=e.updateBlock,h=(0,s.useContext)(m.ThemeContext),v=(0,s.useState)(""),k=v[0],_=v[1],S=(0,s.useState)(!1),E=S[0],I=S[1],D=(0,s.useState)(null),A=D[0],M=D[1],B=(0,s.useMemo)((function(){return(0,_e.HK)(o,(function(e){return e.uuid}))}),[o]);(0,s.useEffect)((function(){A||M((0,_e.HK)((null===i||void 0===i?void 0:i.upstream_blocks)||[],(function(e){return e})))}),[i,A]);var R=(0,s.useMemo)((function(){return(null===o||void 0===o?void 0:o.filter((function(e){var n=e.name,t=e.type,i=e.uuid;return((null===n||void 0===n?void 0:n.toLowerCase().includes(null===k||void 0===k?void 0:k.toLowerCase()))||(null===i||void 0===i?void 0:i.toLowerCase().includes(null===k||void 0===k?void 0:k.toLowerCase())))&&(null===p||void 0===p?void 0:p.includes(t))})))||[]}),[k,o,p]),N=(0,s.useMemo)((function(){var e=[];return null===R||void 0===R||R.forEach((function(n,t){var i=n.color,r=n.language,o=n.type,l=n.uuid,c=(0,w.qn)(o,{blockColor:i,theme:h}).accent;t>=1&&e.push((0,C.jsx)(x.Z,{light:!0},"divider-".concat(l)));var u=!(null===A||void 0===A||!A[l]),a=null!==d&&"undefined"!==typeof d&&!(null!==d&&void 0!==d&&d.includes(r));e.push((0,C.jsx)(Z.Z,{px:2,py:1,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(g.Z,{color:c,size:1.5*P.iI,square:!0}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(O.ZP,{monospace:!0,muted:a,small:!0,children:l})]}),a&&(0,C.jsxs)(O.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[r," support coming soon"]}),!a&&(0,C.jsx)(b.Z,{checked:!a&&u,disabled:a,onClick:function(){M((function(e){var n=lr({},e);return u?delete n[l]:n[l]=l,n}))}})]})},"option-".concat(l)))})),e}),[R,h,A]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(re.Z,{onClickOutside:function(){return I(!1)},open:!0,children:[(0,C.jsx)(W.Z,{beforeIcon:(0,C.jsx)(V.HN,{}),borderless:!0,compact:!0,onChange:function(e){return _(e.target.value)},onClick:function(e){(0,rr.j)(e),I(!0)},onFocus:function(e){(0,rr.j)(e),I(!0)},placeholder:l,small:!0,value:k}),E&&(0,C.jsxs)(C.Fragment,{children:[N,(0,C.jsx)(Z.Z,{mx:1,children:(0,C.jsx)(y.ZP,{justifyContent:"flex-end",children:(0,C.jsx)(T.Z,{compact:!0,loading:c,onClick:function(){return f({block:i,upstream_blocks:Object.keys(A)}).then((function(){return I(!1)}))},small:!0,children:"Save selected blocks"})})})]})]}),!E&&(null===i||void 0===i||null===(n=i.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(0,C.jsxs)(Z.Z,{pb:1,pr:1,children:[r&&(0,C.jsx)(Z.Z,{mt:1,pl:1,children:(0,C.jsx)(O.ZP,{muted:!0,small:!0,children:r})}),(0,C.jsx)(y.ZP,{alignItems:"center",children:null===i||void 0===i||null===(t=i.upstream_blocks)||void 0===t?void 0:t.map((function(e){var n=null===B||void 0===B?void 0:B[e];if(!n)return(0,C.jsx)("div",{},e);var t=n.color,r=n.type,o=(0,w.qn)(r,{blockColor:t,theme:h}).accentLight;return(0,C.jsx)(Z.Z,{ml:1,mt:1,children:(0,C.jsx)(T.Z,{backgroundColor:o,compact:!0,disabled:!a,onClick:function(e){(0,rr.j)(e),u?u(n):null===a||void 0===a||a({block:lr(lr({},i),{},{upstream_blocks:[null===n||void 0===n?void 0:n.uuid]})})},small:!0,children:(0,C.jsx)(O.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},ur=t(19140);function ar(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 sr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ar(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ar(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var dr=function(e){var n=e.addNewBlockAtIndex,t=e.autocompleteItems,i=e.blockRefs,r=e.blocks,c=e.blocksInNotebook,u=e.deleteBlock,a=e.extensionOption,p=e.fetchFileTree,f=e.fetchPipeline,h=e.interruptKernel,m=e.messages,b=e.onChangeCallbackBlock,g=e.onChangeCodeBlock,x=e.pipeline,j=e.runBlock,y=e.runningBlocks,w=e.savePipelineContent,_=e.selectedBlock,S=e.setAnyInputFocused,E=e.setErrors,I=e.setSelectedBlock,T=e.setTextareaFocused,D=e.showBrowseTemplates,A=e.textareaFocused,M=(0,s.useRef)(null),B=(0,s.useState)(!1),L=B[0],F=B[1],U=(a||{}).uuid,H=(x||{}).extensions,W=(0,s.useMemo)((function(){return(null===a||void 0===a?void 0:a.templates)||[]}),[a]),G=(0,s.useMemo)((function(){return null===H||void 0===H?void 0:H[U]}),[U,H]),K=(0,s.useMemo)((function(){return(null===G||void 0===G?void 0:G.blocks)||[]}),[G]),Y=(0,s.useMemo)((function(){return(0,_e.HK)(K,(function(e){return e.uuid}))}),[K]),q=(0,s.useMemo)((function(){return U===(null===_||void 0===_?void 0:_.extension_uuid)&&Y[null===_||void 0===_?void 0:_.uuid]}),[Y,U,_]),Q=(0,s.useMemo)((function(){return y.reduce((function(e,n,t){return sr(sr({},e),{},(0,o.Z)({},n.uuid,sr(sr({},n),{},{priority:t})))}),{})}),[y]),X=(0,d.Db)((function(e){var n=e.block,t=e.upstream_blocks;return z.ZP.blocks.pipelines.useUpdate(null===x||void 0===x?void 0:x.uuid,encodeURIComponent(null===n||void 0===n?void 0:n.uuid),{query:{extension_uuid:null===n||void 0===n?void 0:n.extension_uuid}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){f()},onErrorCallback:function(e,n){return null===E||void 0===E?void 0:E({errors:n,response:e})}})}}),$=(0,l.Z)(X,2),ee=$[0],ne=$[1].isLoading,te=(0,s.useMemo)((function(){return K.map((function(e,n){var o=sr(sr({},e),{},{extension_uuid:U}),l=o.type,a=o.uuid,d=(null===_||void 0===_?void 0:_.uuid)===a,k=Q[a],O=k?0===k.priority?Te.uF.BUSY:Te.uF.QUEUED:Te.uF.IDLE,D="".concat(l,"s/").concat(a,".py");return i.current[D]=(0,s.createRef)(),(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(R.Z,{allBlocks:r,autocompleteItems:t,block:o,blockIdx:n,blockRefs:i,blocks:r,defaultValue:o.content,deleteBlock:function(e){u(sr(sr({},e),{},{extension_uuid:U})),S(!1)},executionState:O,extraContent:(0,C.jsx)(cr,{block:o,blockActionDescription:"Click a block name to run expectations on it.",blocks:c,inputPlaceholder:"Select blocks to run expectations on",loading:ne,supportedUpstreamBlockLanguages:[v.t6.PYTHON],supportedUpstreamBlockTypes:[v.tf.DATA_EXPORTER,v.tf.DATA_LOADER,v.tf.DBT,v.tf.TRANSFORMER],updateBlock:ee}),fetchFileTree:p,fetchPipeline:f,hideRunButton:!0,interruptKernel:h,messages:m[a],noDivider:!0,onCallbackChange:function(e){return b(l,a,e)},onChange:function(e){return g(l,a,e)},pipeline:x,ref:i.current[D],runBlock:j,runningBlocks:y,savePipelineContent:w,selected:d,setAnyInputFocused:S,setErrors:E,setSelected:function(e){return I(!0===e?o:null)},setTextareaFocused:T,textareaFocused:d&&A})},a)}))}),[t,i,r,c,u,K,U,p,f,h,ne,m,b,g,x,j,y,Q,w,_,S,E,I,T,A,ee]),ie="Extensions/GreatExpectations/index",oe=(0,ae.y)(),ce=oe.disableGlobalKeyboardShortcuts,ue=oe.registerOnKeyDown,se=oe.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){se(ie)}}),[se,ie]),ue(ie,(function(e,n){!ce&&q&&((0,mt.y)([le.zX,le.Um],n)||(0,mt.y)([le.PQ,le.Um],n))&&(e.preventDefault(),w())}),[q,w]),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsx)(O.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["When a block in your pipeline runs, it\u2019ll run any tests you define in its code. All associated extension blocks will also run during that phase. Learn more about the ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["For all available expectations, read Great Expectation\u2019s ",(0,C.jsx)(k.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),te,(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(re.Z,{onClickOutside:function(){return F(!1)},open:!0,children:(0,C.jsx)(Jn.Z,{disableKeyboardShortcuts:!0,items:null===W||void 0===W?void 0:W.map((function(e){var t=e.description,i=e.name,r=e.path;return{label:function(){return i},onClick:function(){return n({config:{template_path:r},extension_uuid:U,type:v.tf.EXTENSION},(null===K||void 0===K?void 0:K.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,vt.hr)((function(e){return n(sr(sr({},e),{},{extension_uuid:U,type:v.tf.EXTENSION}),(null===K||void 0===K?void 0:K.length)||0)}),v.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:D})),onClickCallback:function(){return F(!1)},open:L,parentRef:M,uuid:"Extension",children:(0,C.jsx)(N.ZP,{beforeElement:(0,C.jsx)(ur.Wx,{teal:!0,children:(0,C.jsx)(V.mm,{size:ur.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),F(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},pr=t(59e3),fr=["pipeline"];function hr(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 vr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?hr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):hr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var mr=function(e){var n=e.pipeline,t=(0,Le.Z)(e,fr),i=(0,p.useRouter)(),r=z.ZP.extension_options.list().data,o=(0,s.useMemo)((function(){return(null===r||void 0===r?void 0:r.extension_options)||[]}),[r]),l=(0,s.useMemo)((function(){return(0,_e.HK)(o,(function(e){return e.uuid}))}),[o]),c=(0,s.useState)(null),u=c[0],a=c[1],d=(0,s.useMemo)((function(){return l[u]}),[l,u]),f=(0,s.useMemo)((function(){return vr(vr({},t),{},{pipeline:n})}),[n,t]);(0,s.useEffect)((function(){var e;a(null===(e=(0,pr.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var h=(0,s.useMemo)((function(){return n?(tr.GREAT_EXPECTATIONS===u?e=dr:tr.DBT===u&&(e=ir),e?(0,C.jsx)(e,vr(vr({},f),{},{extensionOption:d})):void 0):null;var e}),[d,n,u,f]);return(0,C.jsx)(A.W,{backend:M.PD,children:(0,C.jsxs)(Z.Z,{p:P.cd,children:[!u&&(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,C.jsx)(O.ZP,{inline:!0,monospace:!0,children:null===n||void 0===n?void 0:n.uuid})," pipeline."]})})]}),!r&&!u&&(0,C.jsx)(H.Z,{}),h,!u&&(null===o||void 0===o?void 0:o.map((function(e,n){var t=e.description,r=e.name,o=e.uuid;return(0,C.jsx)(Z.Z,{mt:n>=1?P.cd:0,children:(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,Se.u7)({extension:o},{pushHistory:!0})},preventDefault:!0,children:(0,C.jsx)(De.Z,{dark:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Xn.Z,{fullWidth:!1,children:(0,C.jsx)(Z.Z,{p:P.cd,children:(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)("img",{alt:r,height:3*P.iI,src:"".concat(i.basePath,"/images/extensions/").concat(o,"/logo.png"),width:3*P.iI})})})}),(0,C.jsx)(Z.Z,{mr:P.cd}),(0,C.jsxs)(j.Z,{flexDirection:"column",children:[(0,C.jsx)(O.ZP,{bold:!0,children:r}),(0,C.jsx)(O.ZP,{default:!0,small:!0,children:t})]})]}),(0,C.jsx)(V._Q,{})]})})})},o)})))]})})},br=t(23351),gr=t(21764),xr=t(22673),jr=t(52769),yr=t(9468),kr=(P.iI,yr.O$,P.iI,ci.dN,m.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],Zt.Wi,Ke.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),m.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*P.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),m.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),Zr=m.default.td.withConfig({displayName:"indexstyle__CellStyle",componentId:"sc-cr39lf-3"})(["display:flex;align-items:center;justify-content:space-between;border:1px solid #1C1C1C;height:100%;",""],(function(e){return!e.noPadding&&"\n padding: 0 ".concat(2*P.iI,"px;\n ")})),Or=t(19963);var Pr=function(e){var n=e.copyText,t=e.deleteVariable,i=e.fetchVariables,r=e.hideEdit,o=e.obfuscate,c=e.pipelineUUID,u=e.variable,a=u.uuid,p=(u.type,u.value),f=(0,s.useRef)(null),h=(0,s.useState)(!1),v=h[0],m=h[1],b=(0,s.useState)(a),g=b[0],x=b[1],y=(0,s.useState)(p),k=y[0],Z=y[1],w=(0,s.useState)(!1),_=w[0],S=w[1],E=(0,d.Db)(z.ZP.variables.pipelines.useUpdate(c,a),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){S(!1),i()}})}}),I=(0,l.Z)(E,1)[0],T=(0,s.useCallback)((function(e){if("Enter"===e.key){var n=k;try{n=JSON.parse(k)}catch(t){}I({variable:{name:g,value:n}})}else"Escape"===e.key&&S(!1)}),[g,k]);(0,s.useEffect)((function(){var e;_&&(null===f||void 0===f||null===(e=f.current)||void 0===e||e.focus())}),[_,f]);var D=n||"kwargs['".concat(a,"']");return(0,C.jsx)("div",{onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)},children:(0,C.jsxs)(Yi.Z,{children:[(0,C.jsx)(Fi.Z,{md:1,hiddenSmDown:!0,children:(0,C.jsx)(Zr,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:Or.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(D),gr.Am.success("Successfully copied to clipboard.",{position:gr.Am.POSITION.BOTTOM_RIGHT,toastId:a})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(a),withIcon:!0,children:(0,C.jsx)(V.CK,{size:2.5*P.iI})})})}),(0,C.jsx)(Fi.Z,{md:4,children:_?(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:T,paddingHorizontal:0,placeholder:"variable",small:!0,value:g})}):(0,C.jsx)(Zr,{children:(0,C.jsx)(O.ZP,{color:Nt.Or,monospace:!0,small:!0,textOverflow:!0,children:a})})}),(0,C.jsx)(Fi.Z,{md:7,children:_?(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){Z(e.target.value),e.preventDefault()},onKeyDown:T,paddingHorizontal:0,placeholder:"enter value",ref:f,small:!0,value:k})}):(0,C.jsxs)(Zr,{children:[o?(0,C.jsx)(O.ZP,{monospace:!0,small:!0,children:"********"}):(0,C.jsx)(O.ZP,{monospace:!0,small:!0,children:p}),(0,C.jsxs)(j.Z,{children:[!r&&v&&(0,C.jsx)(N.ZP,{backgroundColor:Or.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){S(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(a),withIcon:!0,children:(0,C.jsx)(V.I8,{size:2.5*P.iI})}),t&&v&&(0,C.jsx)(N.ZP,{backgroundColor:Or.qJ,borderless:!0,inline:!0,muted:!0,onClick:t,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(a),withIcon:!0,children:(0,C.jsx)(V.rF,{size:2.5*P.iI})})]})]})})]})})},wr=t(93348),Cr=t(58122);var _r=function(e){e.blocks;var n=e.fetchVariables,t=e.pipeline,i=e.selectedBlock,r=e.setErrorMessages,o=e.variables,c=e.width,u=(0,s.useState)(!1),a=u[0],p=u[1],f=(0,s.useState)(),h=f[0],m=f[1],b=(0,s.useState)(),g=b[0],x=b[1],j=null===t||void 0===t?void 0:t.uuid,w=(0,d.Db)(z.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,J.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;r((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),_=(0,l.Z)(w,1)[0],S=(0,d.Db)((function(e){return z.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),E=(0,l.Z)(S,1)[0],I=(0,s.useCallback)((function(e){if("Enter"===e.key){var t=g;try{t=JSON.parse(g)}catch(i){}_({variable:{name:h,value:t}}).then((function(){n(),m(null),x(null)})),p(!1)}else"Escape"===e.key&&p(!1)}),[_,n,h,g]),T=(0,s.useMemo)((function(){return c-4*P.iI}),[c]),D=(0,s.useMemo)((function(){return(0,Cr.wx)(o,(function(e){return e.uuid===jr.C}))}),[o]),A=(0,s.useMemo)((function(){return(0,Cr.wx)(o,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,o]),M=(0,s.useMemo)((function(){return(0,C.jsxs)(kr,{width:T,children:[a&&(0,C.jsxs)(Yi.Z,{children:[(0,C.jsx)(Fi.Z,{md:1,children:(0,C.jsx)(Zr,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:Or.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(h),gr.Am.success("Successfully copied to clipboard.",{position:gr.Am.POSITION.BOTTOM_RIGHT,toastId:h})},uuid:"Sidekick/GlobalVariables/".concat(h),withIcon:!0,children:(0,C.jsx)(V.CK,{size:2.5*P.iI})})})}),(0,C.jsx)(Fi.Z,{md:4,children:(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){m(e.target.value),e.preventDefault()},onKeyDown:I,paddingHorizontal:0,placeholder:"variable",small:!0,value:h})})}),(0,C.jsx)(Fi.Z,{md:7,children:(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:I,paddingHorizontal:0,placeholder:"enter value",small:!0,value:g})})})]}),null===D||void 0===D?void 0:D.map((function(e){return(0,C.jsx)(Pr,{deleteVariable:function(){return E(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[E,D,h,g,j,m,x,p,a,T]),B=(0,s.useMemo)((function(){return(0,C.jsx)(kr,{width:T,children:null===A||void 0===A?void 0:A.map((function(e){return(0,C.jsx)(Pr,{copyText:(n=e.uuid,"from mage_ai.data_preparation.variable_manager import (\n get_variable,\n)\n\n".concat(function(e,n,t){return"\n".concat(t," = get_variable('").concat(e,"', '").concat(n,"', '").concat(t,"')\n")}(j,null===i||void 0===i?void 0:i.uuid,n))),hideEdit:!0,pipelineUUID:j,variable:e},e.uuid);var n}))})}),[A,i,T]);return(0,C.jsxs)(Z.Z,{p:P.cd,children:[(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(Pn.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,C.jsx)(Z.Z,{ml:2}),(0,C.jsx)(N.ZP,{Icon:V.mm,blackBorder:!0,inline:!0,onClick:function(){return p((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{muted:!0,children:["Press ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:M}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{children:"Global variables will be passed into all non-scratchpad blocks as keyword arguments (Python), interpolated variables (SQL), or vector elements (R). To load a global variable, use the following syntax:"})}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{bold:!0,large:!0,children:["For Python (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(xr.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{bold:!0,large:!0,children:["For SQL (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(xr.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{bold:!0,large:!0,children:["For R (",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,C.jsx)(xr.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsx)(Pn.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,C.jsx)(Z.Z,{mb:P.cd}),(0,C.jsx)(O.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(wr.Xm).map((function(e,n){var t;return(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{large:!0,monospace:!0,children:(0,Q.vg)(null===(t=wr.Z4[e])||void 0===t?void 0:t.call(wr.Z4))})}),(0,Cr.JZ)([],e).map((function(n,t){return(0,C.jsx)(Pr,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),A&&A.length>0&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{my:2,children:(0,C.jsx)(Pn.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,C.jsx)(Z.Z,{mb:2,children:B}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{children:["Output variables can be used in any ",(0,C.jsx)(O.ZP,{bold:!0,inline:!0,monospace:!0,warning:!0,children:v.tf.SCRATCHPAD})," block. They are for scratchpad blocks, specifically. To get upstream block outputs inside of other blocks, use the positional arguments."]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(xr.Z,{language:"python",small:!0,source:"\n from mage_ai.data_preparation.variable_manager import (\n get_variable,\n )\n\n\n df = get_variable(\n 'pipeline_uuid',\n 'block_uuid',\n 'variable_name',\n )\n"})})]})]})},Sr=t(89565),Er=t.n(Sr),Ir=t(22782),Tr=m.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,Ke.y$)()),Dr=m.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],Ke.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return!e.height&&"\n max-height: ".concat(e.maxHeight||300,"px;\n ")}));function Ar(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 Mr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ar(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ar(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Br=function(e){var n=e.cancelPipeline,t=e.checkIfPipelineRunning,i=e.executePipeline,r=e.isPipelineExecuting,o=e.pipelineExecutionHidden,l=e.pipelineMessages,c=e.setPipelineExecutionHidden,u=(0,s.useMemo)((function(){return(null===l||void 0===l?void 0:l.length)||0}),[l]),a=(0,s.useMemo)((function(){return u>100?l.slice(-100):l}),[u,l]),d=(0,s.useCallback)((function(){var e=!o;c(e),(0,Pe.t8)(Pe.Q9,e)}),[o,c]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Tr,{children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{children:[(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(V.JM,{inverted:!0,size:2*P.iI}),compact:r,disabled:r,loading:r,onClick:i,success:!0,children:(0,C.jsx)(O.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,C.jsx)(Z.Z,{ml:1}),r&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(T.Z,{beforeIcon:(0,C.jsx)(V.x8,{inverted:!0,size:2*P.iI}),onClick:n,success:!0,children:(0,C.jsx)(O.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,C.jsx)(Z.Z,{ml:1})]}),(0,C.jsx)(T.Z,{onClick:t,secondary:!0,children:(0,C.jsx)(O.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Z.Z,{ml:1}),(0,C.jsx)(O.ZP,{children:"Hide"}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(Nn.Z,{checked:o,onCheck:d})]})]})}),!o&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Z.Z,{mb:1}),(0,C.jsx)(Dr,{noScrollbarTrackBackground:!0,children:(0,C.jsx)(Ir.Nk,{executedAndIdle:!0,hasError:!1,selected:!0,children:a.map((function(e,n){var t=e.data,i=e.type,r=[],o=(r=(r=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return r.map((function(e,t){var r,l={first:0===n&&0===t,last:n===u-1&&t===o-1};return Te.jU.includes(i)?r=(0,C.jsx)(Ir.T5,Mr(Mr({},l),{},{children:(0,C.jsx)(O.ZP,{monospace:!0,preWrap:!0,children:(0,C.jsx)(Er(),{children:e})})})):i===Te.Gi.IMAGE_PNG&&(r=(0,C.jsx)("div",{style:{backgroundColor:"white"},children:(0,C.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,C.jsx)("div",{children:r},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})};var Rr=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,r=e.setErrorMessages,o=e.width,c=(0,s.useState)(!1),u=c[0],a=c[1],p=(0,s.useState)(),f=p[0],h=p[1],v=(0,s.useState)(),m=v[0],b=v[1],g=(0,s.useMemo)((function(){return o-P.cd*P.iI*2}),[o]),x=(0,d.Db)(z.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,J.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;r((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),j=(0,l.Z)(x,1)[0],k=(0,d.Db)((function(e){return z.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),w=(0,l.Z)(k,1)[0],_=(0,s.useCallback)((function(e){"Enter"===e.key?(j({secret:{name:f,value:m}}).then((function(){n(),h(null),b(null)})),a(!1)):"Escape"===e.key&&a(!1)}),[j,n,f,m]);return(0,C.jsxs)(Z.Z,{p:P.cd,children:[(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(y.ZP,{alignItems:"center",children:[(0,C.jsx)(Pn.Z,{level:4,monospace:!0,children:"Secrets"}),(0,C.jsx)(Z.Z,{ml:2}),(0,C.jsx)(N.ZP,{Icon:V.mm,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{children:[(0,C.jsx)(O.ZP,{inline:!0,warning:!0,children:"WARNING:"})," the encryption key is stored in a file on your machine. If you need more secure encryption, we recommend using a secrets manager."]})}),u&&(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(O.ZP,{muted:!0,children:["Press ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,C.jsx)(O.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsxs)(kr,{width:g,children:[u&&(0,C.jsxs)(Yi.Z,{children:[(0,C.jsx)(Fi.Z,{md:1,children:(0,C.jsx)(Zr,{noPadding:!0,children:(0,C.jsx)(N.ZP,{backgroundColor:Or.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(f,") }}")),gr.Am.success("Successfully copied to clipboard.",{position:gr.Am.POSITION.BOTTOM_RIGHT,toastId:f})},uuid:"Sidekick/Secrets/".concat(f),withIcon:!0,children:(0,C.jsx)(V.CK,{size:2.5*P.iI})})})}),(0,C.jsx)(Fi.Z,{md:4,children:(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){h(e.target.value),e.preventDefault()},onKeyDown:_,paddingHorizontal:0,placeholder:"secret name",small:!0,value:f})})}),(0,C.jsx)(Fi.Z,{md:7,children:(0,C.jsx)(Zr,{children:(0,C.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){b(e.target.value),e.preventDefault()},onKeyDown:_,paddingHorizontal:0,placeholder:"secret value",small:!0,value:m})})})]}),null===i||void 0===i?void 0:i.map((function(e){return(0,C.jsx)(Pr,{copyText:e.name,deleteVariable:function(){return w(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{children:"Secrets are not editable, they can only be created and deleted. Secrets are shared across the project, and can be used in configuration fields. To reference a secret, use the following templating syntax:"})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(xr.Z,{language:"yaml",small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n ",maxWidth:g})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(O.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,C.jsx)(Z.Z,{mb:P.cd,children:(0,C.jsx)(xr.Z,{language:"python",small:!0,source:"\n from mage_ai.data_preparation.shared.secrets import get_secret_value\n\n get_secret_value('<secret_name>')\n ",maxWidth:g})})]})},Nr=t(33699),Lr=t(72454),Fr=t(64155),Ur=t(91835);function Hr(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 Wr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Hr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Hr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var zr=function(e){var n=e.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,r=e.autocompleteItems,c=e.blockRefs,u=e.blocks,a=e.blocksInNotebook,p=e.deleteBlock,f=e.displayBlockName,h=e.fetchFileTree,m=e.fetchPipeline,b=e.interruptKernel,g=e.messages,x=(e.onChangeCallbackBlock,e.onChangeCodeBlock),j=e.onSelectBlockFile,y=e.pipeline,w=e.runBlock,_=e.runningBlocks,S=e.savePipelineContent,E=e.selectedBlock,I=e.setAnyInputFocused,T=e.setErrors,D=e.setHiddenBlocks,A=e.setSelectedBlock,M=e.setTextareaFocused,B=e.showBrowseTemplates,L=e.textareaFocused,F=(0,s.useRef)(null),U=(0,s.useState)(!1),H=U[0],W=U[1],G=(0,pr.iV)().block_uuid;(0,s.useEffect)((function(){var e=u.find((function(e){var n,t=e.uuid;return(null===G||void 0===G||null===(n=G.split(":"))||void 0===n?void 0:n[0])===t}));e&&(E&&(null===e||void 0===e?void 0:e.uuid)===(null===E||void 0===E?void 0:E.uuid)||(D((function(n){return Wr(Wr({},n),{},(0,o.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)))}),[G,u,j,E,D]);var K=(y||{}).type,Y=(0,s.useMemo)((function(){return(0,_e.HK)(t||[],(function(e){return e.uuid}))}),[t]),q=z.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,X=(0,s.useMemo)((function(){return(null===q||void 0===q?void 0:q.block_templates)||[]}),[q]),$=(0,s.useCallback)((function(e){return n(e,(null===Y||void 0===Y?void 0:Y.length)||0)}),[n,Y]),ee=(0,s.useMemo)((function(){return(0,vt.oM)(X,$)}),[$,X]),ne=(0,s.useMemo)((function(){return(0,vt.hr)($,i,K,{blockTemplatesByBlockType:ee,languages:[v.t6.PYTHON],showBrowseTemplates:B})}),[$,i,ee,K]),te=(0,s.useMemo)((function(){return null===Y||void 0===Y?void 0:Y[null===E||void 0===E?void 0:E.uuid]}),[Y,E]),ie=(0,s.useMemo)((function(){return _.reduce((function(e,n,t){return Wr(Wr({},e),{},(0,o.Z)({},n.uuid,Wr(Wr({},n),{},{priority:t})))}),{})}),[_]),oe=(0,d.Db)((function(e){var n=e.block,t=e.upstream_blocks;return z.ZP.blocks.pipelines.useUpdate(null===y||void 0===y?void 0:y.uuid,encodeURIComponent(null===n||void 0===n?void 0:n.uuid),{query:{block_type:null===n||void 0===n?void 0:n.type}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){m()},onErrorCallback:function(e,n){return null===T||void 0===T?void 0:T({errors:n,response:e})}})}}),ce=(0,l.Z)(oe,2),ue=ce[0],se=ce[1].isLoading,de=(0,s.useMemo)((function(){return null===t||void 0===t?void 0:t.map((function(e,n){var t=e.type,i=e.uuid,l=(null===E||void 0===E?void 0:E.uuid)===i,d=ie[i],k=d?0===d.priority?Te.uF.BUSY:Te.uF.QUEUED:Te.uF.IDLE,O="".concat(t,"s/").concat(i,".py");return c.current[O]=(0,s.createRef)(),(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(R.Z,{allBlocks:u,autocompleteItems:r,block:e,blockIdx:n,blockRefs:c,blocks:u,defaultValue:e.content,deleteBlock:function(e){p(Wr({},e)),I(!1)},executionState:k,extraContent:(0,C.jsx)(cr,{block:e,blocks:a,inputPlaceholder:"Select blocks to add ".concat((0,Q._6)(f,null)," to"),loading:se,onClickTag:function(e){D((function(n){return Wr(Wr({},n),{},(0,o.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[v.tf.CUSTOM,v.tf.DATA_EXPORTER,v.tf.DATA_LOADER,v.tf.DBT,v.tf.SCRATCHPAD,v.tf.SENSOR,v.tf.TRANSFORMER],updateBlock:ue}),fetchFileTree:h,fetchPipeline:m,hideRunButton:!0,interruptKernel:b,messages:g[i],noDivider:!0,onChange:function(e){return x(t,i,e)},pipeline:y,ref:c.current[O],runBlock:w,runningBlocks:_,savePipelineContent:S,selected:l,setAnyInputFocused:I,setErrors:T,setSelected:function(n){return A(!0===n?e:null)},setTextareaFocused:M,textareaFocused:l&&L})},i)}))}),[t,r,c,u,a,p,f,h,m,b,se,g,x,j,y,w,_,ie,S,E,I,T,D,A,M,L,ue]),pe="".concat(f,"/index"),fe=(0,ae.y)(),he=fe.disableGlobalKeyboardShortcuts,ve=fe.registerOnKeyDown,me=fe.unregisterOnKeyDown;return(0,s.useEffect)((function(){return function(){me(pe)}}),[me,pe]),ve(pe,(function(e,n){!he&&te&&((0,mt.y)([le.zX,le.Um],n)||(0,mt.y)([le.PQ,le.Um],n))&&(e.preventDefault(),S())}),[te,S]),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(Z.Z,{mb:P.cd,children:[(0,C.jsxs)(O.ZP,{default:!0,children:["Run 1 or more ",(0,Q.wX)(f)," block functions whenever another block succeeds or fails."]}),(0,C.jsx)(Z.Z,{mt:1,children:(0,C.jsxs)(O.ZP,{default:!0,children:["Learn more about ",(0,C.jsx)(k.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,Q.wX)((0,Q._6)(f,null)),"/overview"),openNewWindow:!0,children:(0,Q.wX)((0,Q._6)(f,null))}),"."]})})]}),de,(0,C.jsx)(Z.Z,{mt:P.cd,children:(0,C.jsx)(re.Z,{onClickOutside:function(){return W(!1)},open:!0,children:(0,C.jsx)(Jn.Z,{disableKeyboardShortcuts:!0,items:ne,onClickCallback:function(){return W(!1)},open:H,parentRef:F,uuid:f,children:(0,C.jsxs)(N.ZP,{beforeElement:(0,C.jsx)(ur.Wx,{rose:i===v.tf.CALLBACK,children:(0,C.jsx)(V.mm,{size:ur.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),W(!0)},uuid:"AddNewBlocks/".concat(f),children:[(0,Q.kC)(f)," block"]})})})})]})},Vr=t(45419);function Gr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Kr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Gr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Gr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Yr=[{Icon:V.AQ,name:"Callbacks",uuid:Vr.Q.CALLBACK},{Icon:V.hW,name:"Conditionals",uuid:Vr.Q.CONDITIONAL}];var qr=function(e){var n=(0,Ur.Z)({},e),t=(0,p.useRouter)(),i=(0,s.useState)(null),r=i[0],o=i[1];(0,s.useEffect)((function(){var e;o(null===(e=(0,pr.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,s.useMemo)((function(){var e,t;if(Vr.Q.CALLBACK===r)e={addOnBlockType:v.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,displayBlockName:"callback"};else if(Vr.Q.CONDITIONAL===r){var i;e={addOnBlockType:v.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,displayBlockName:"conditional"}}if(e)return(0,C.jsx)(zr,Kr(Kr({},e),n))}),[n,r]);return(0,C.jsx)(A.W,{backend:M.PD,children:(0,C.jsxs)(Z.Z,{p:P.cd,children:[l,!r&&(null===Yr||void 0===Yr?void 0:Yr.map((function(e,n){var t=e.name,i=e.uuid,r=e.Icon;return(0,C.jsx)(Z.Z,{mt:n>=1?P.cd:0,children:(0,C.jsx)(k.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,Se.u7)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,C.jsx)(De.Z,{dark:!0,children:(0,C.jsxs)(y.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(Xn.Z,{fullWidth:!1,children:(0,C.jsx)(Z.Z,{p:P.cd,children:(0,C.jsx)(y.ZP,{alignItems:"center",children:(0,C.jsx)(r,{fill:"#885EFF",size:2*P.iI})})})}),(0,C.jsx)(Z.Z,{mr:P.cd}),(0,C.jsx)(j.Z,{flexDirection:"column",children:(0,C.jsx)(O.ZP,{bold:!0,children:t})})]}),(0,C.jsx)(V._Q,{})]})})})},i)})))]})})};function Qr(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 Jr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qr(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xr=function(e){var n=e.activeView,t=e.addNewBlockAtIndex,i=e.afterWidth,r=e.autocompleteItems,l=e.blockRefs,c=e.blocks,u=e.blocksInNotebook,a=e.cancelPipeline,d=e.chartRefs,p=e.checkIfPipelineRunning,h=e.deleteBlock,v=e.deleteWidget,m=e.editingBlock,b=e.executePipeline,g=e.fetchFileTree,x=e.fetchPipeline,j=e.fetchSecrets,k=e.fetchVariables,w=e.globalDataProducts,_=e.globalVariables,S=e.insights,E=e.interruptKernel,I=e.isPipelineExecuting,D=e.lastTerminalMessage,A=e.messages,M=e.metadata,B=e.onChangeCallbackBlock,R=e.onChangeChartBlock,N=e.onChangeCodeBlock,L=e.onSelectBlockFile,U=e.onUpdateFileSuccess,H=e.pipeline,W=e.pipelineMessages,z=e.runBlock,G=e.runningBlocks,K=e.sampleData,Y=e.savePipelineContent,q=e.secrets,Q=e.selectedBlock,J=e.selectedFilePath,X=e.sendTerminalMessage,$=e.setAllowCodeBlockShortcuts,ee=e.setAnyInputFocused,ne=e.setDepGraphZoom,te=e.setDisableShortcuts,ie=e.setEditingBlock,re=e.setErrors,oe=e.setHiddenBlocks,le=e.setSelectedBlock,ce=e.setTextareaFocused,ue=e.showBrowseTemplates,ae=e.showUpdateBlockModal,se=e.statistics,de=e.textareaFocused,pe=e.treeRef,fe=e.updateWidget,he=e.widgets,ve=(0,Pt.i)().height,me=Zt.uX,be=(0,s.useState)([]),ge=be[0],xe=be[1],je=(0,s.useState)(!!(0,Pe.U2)(Pe.Q9)),ye=je[0],ke=je[1],Ze=(0,s.useMemo)((function(){return i-(Lr.k1+1)}),[i]),Oe=((null===m||void 0===m?void 0:m.upstreamBlocks)||{}).block,we=((null===K||void 0===K?void 0:K.columns)||[]).slice(0,100),Ce=(0,s.useMemo)((function(){return(null===K||void 0===K?void 0:K.rows)||[]}),[K]),Se=(0,s.useMemo)((function(){return(null===M||void 0===M?void 0:M.column_types)||{}}),[M]),Ee=(0,s.useMemo)((function(){return(null===S||void 0===S?void 0:S[1])||{}}),[S]),Ie=(0,s.useMemo)((function(){return(0,_e.HK)((null===S||void 0===S?void 0:S[0])||[],(function(e){return e.feature.uuid}))}),[S]),Te=!!K,De=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===H||void 0===H?void 0:H.type)}),[H]),Ae=F.qL.STREAMING!==(null===H||void 0===H?void 0:H.type)?-70:ye?-16:300,Me=(0,s.useCallback)((0,yr.Fk)({columnTypes:Se,columns:we,insightsByFeatureUUID:Ie,insightsOverview:Ee,noColumnLinks:!0,statistics:se}),[Se,we,Ie,Ee,se]),Be=(0,s.useMemo)((function(){return(0,C.jsx)(_r,{blocks:c,fetchVariables:k,pipeline:H,selectedBlock:Q,setErrorMessages:xe,variables:_,width:Ze})}),[Ze,c,k,_,H,Q]),Re=(0,s.useMemo)((function(){return(0,C.jsx)(br.Z,{onActionCallback:U,selectedBlock:Q,selectedFilePath:J,setErrors:re,width:Ze>Ke.nn?Ze-Ke.nn:Ze})}),[Ze,U,Q,J,re]),Ne=(0,s.useMemo)((function(){return(0,C.jsx)(Rr,{fetchSecrets:j,pipelineUUID:null===H||void 0===H?void 0:H.uuid,secrets:q,setErrorMessages:xe,width:Ze})}),[Ze,j,H,q]),Le=(0,s.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:r,blockRefs:l,blocks:c,blocksInNotebook:u,deleteBlock:h,fetchFileTree:g,fetchPipeline:x,interruptKernel:E,messages:A,onChangeCallbackBlock:B,onChangeCodeBlock:N,onSelectBlockFile:L,pipeline:H,runBlock:z,runningBlocks:G,savePipelineContent:Y,selectedBlock:Q,setAnyInputFocused:ee,setErrors:re,setHiddenBlocks:oe,setSelectedBlock:le,setTextareaFocused:ce,showBrowseTemplates:ue,textareaFocused:de}}),[t,r,l,c,u,h,g,x,E,A,B,N,L,H,z,G,Y,Q,ee,re,oe,le,ce,ue,de]),Fe=(0,s.useMemo)((function(){return we.length>0&&(0,C.jsx)(Ci.Z,{columnHeaderHeight:(0,Fn.Qr)(Se)&&(0,Fn.Qr)(Ie)&&(0,Fn.Qr)(Ee)?0:Fr.Eh,columns:we,height:ve-me-Zt.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:Me,rows:Ce,width:Ze})}),[Ze,Se,we,me,ve,Ie,Ee,Me,Ce]),Ue=(0,s.useMemo)((function(){return he.length>0&&(0,C.jsx)(Xi,{autocompleteItems:r,blockRefs:l,blocks:c,chartRefs:d,deleteWidget:v,fetchFileTree:g,fetchPipeline:x,messages:A,onChangeChartBlock:R,pipeline:H,runBlock:z,runningBlocks:G,savePipelineContent:Y,selectedBlock:Q,setAnyInputFocused:ee,setErrors:re,setSelectedBlock:le,setTextareaFocused:ce,textareaFocused:de,updateWidget:fe,widgets:he,width:Ze})}),[Ze,r,l,c,d,v,g,x,A,R,H,z,G,Y,Q,ee,re,le,ce,de,fe,he]),He=(0,s.useMemo)((function(){return(0,C.jsx)("div",{style:{height:"100%",position:"relative",width:Ze},children:(0,C.jsx)(Nr.Z,{lastMessage:D,onFocus:function(){return le(null)},sendMessage:X,width:Ze})})}),[Ze,D,X,le]),We=(0,s.useMemo)((function(){return(0,C.jsx)(mr,Jr({},Le))}),[Le]),ze=(0,s.useMemo)((function(){return(0,C.jsx)(qr,Jr({},Le))}),[Le]),Ve=(0,s.useMemo)((function(){return H&&Q&&(0,C.jsx)(Ht,{block:Q,fetchFileTree:g,fetchPipeline:x,globalDataProducts:w,pipeline:H,setSelectedBlock:le,showUpdateBlockModal:ae})}),[g,x,w,H,Q,le,ae]);return(0,C.jsxs)(C.Fragment,{children:[(null===ge||void 0===ge?void 0:ge.length)>=1&&(0,C.jsxs)(Z.Z,{mb:3,mt:2,mx:2,children:[(0,C.jsxs)(y.ZP,{justifyContent:"space-between",children:[(0,C.jsx)(O.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,C.jsx)(T.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return xe([])},transparent:!0,children:(0,C.jsx)(V.x8,{muted:!0})})]}),null===ge||void 0===ge?void 0:ge.map((function(e){return(0,C.jsx)(Z.Z,{pb:1,children:(0,C.jsx)(O.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,C.jsxs)(Fr.t0,{fullWidth:!0,heightOffset:at.cH.TERMINAL===n||n===at.cH.TREE?0:Ke.nn,onBlur:function(){J||te(!1),null===$||void 0===$||$(!1)},onFocus:function(){te(!0),n===at.cH.TREE&&(null===$||void 0===$||$(!0))},overflowHidden:n===at.cH.TREE,children:[n===at.cH.TREE&&(0,C.jsx)(f.Z,{uuid:"PipelineDetail/".concat(null===H||void 0===H?void 0:H.uuid),children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)($i.Z,{blockRefs:l,blocks:c,editingBlock:m,enablePorts:!De,fetchPipeline:x,height:ve-(me-Ke.nn)-Ae,messages:A,onClickNode:function(e){var n=e.block.uuid;return oe((function(e){var t=!(null===e||void 0===e||!e[n]);return t?Jr(Jr({},e),{},(0,o.Z)({},n,!t)):e}))},pipeline:H,runningBlocks:G,selectedBlock:Q,setEditingBlock:ie,setErrors:re,setSelectedBlock:le,setZoom:ne,treeRef:pe}),!Oe&&F.qL.STREAMING===(null===H||void 0===H?void 0:H.type)&&(0,C.jsx)(Z.Z,{p:1,children:(0,C.jsx)(Br,{cancelPipeline:a,checkIfPipelineRunning:p,executePipeline:b,isPipelineExecuting:I,pipelineExecutionHidden:ye,pipelineMessages:W,setPipelineExecutionHidden:ke})})]})}),n===at.cH.DATA&&Fe,at.cH.SECRETS===n&&Ne,at.cH.VARIABLES===n&&Be,at.cH.FILE_VERSIONS===n&&(0,C.jsx)(f.Z,{uuid:"FileVersions/".concat(J?decodeURIComponent(J):""),children:Re}),De||Q&&Te||!Q&&Te&&n===at.cH.DATA?null:at.du.includes(n)&&(0,C.jsx)(y.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:at.fp,verticalHeightOffset:me,width:Ze,children:(0,C.jsx)(O.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:Q?!Te&&"No data or insights available":"Select a block for insights"})}),at.cH.CHARTS===n&&(he.length>0?Ue:(0,C.jsxs)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:at.fp,verticalHeightOffset:me,width:Ze,children:[(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(y.ZP,{flexDirection:"row",children:(0,C.jsxs)(O.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon \xa0",(0,C.jsx)(V.GQ,{size:1.5*P.iI}),"\xa0in",(0,C.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,C.jsx)(Z.Z,{mt:P.cd,px:1,children:(0,C.jsx)(nr,{size:40*P.iI})})]})),at.cH.TERMINAL===n&&He,at.cH.EXTENSIONS===n&&We,at.cH.ADDON_BLOCKS===n&&ze,at.cH.BLOCK_SETTINGS===n&&(Q?Ve:(0,C.jsx)(y.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:at.fp,verticalHeightOffset:me,width:Ze,children:(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(y.ZP,{flexDirection:"row",children:(0,C.jsxs)(O.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon \xa0",(0,C.jsx)(V.JG,{size:1.5*P.iI}),"\xa0",(0,C.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})}))]})]})},$r=t(35438);function eo(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 no(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?eo(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):eo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var to=function(e){var n,t=e.activeView,i=e.depGraphZoom,r=e.pipeline,o=e.secrets,l=e.selectedBlock,c=e.treeRef,u=e.variables,a=null===r||void 0===r?void 0:r.uuid,d=(0,pr.iV)(),p=(0,Cr.wx)(u,(function(e){return e.uuid===jr.C})),f=at.Qq[t],h=(null===f||void 0===f||null===(n=f.buildLabel)||void 0===n?void 0:n.call(f,{pipeline:r,secrets:o,variables:p}))||(null===f||void 0===f?void 0:f.label);at.cH.BLOCK_SETTINGS===t&&null!==l&&void 0!==l&&l.uuid&&(h=(0,C.jsxs)(C.Fragment,{children:["Block settings for ",(0,C.jsx)(O.ZP,{bold:!0,color:(0,w.qn)(null===l||void 0===l?void 0:l.type).accent,inline:!0,monospace:!0,children:null===l||void 0===l?void 0:l.uuid})]}));var v=(0,C.jsx)(O.ZP,{bold:!0,children:h}),m=at.cH.EXTENSIONS===t&&(null===d||void 0===d?void 0:d.extension),b=z.ZP.extension_options.list({},{},{pauseFetch:!m}).data,g=(0,s.useMemo)((function(){return(null===b||void 0===b?void 0:b.extension_options)||[]}),[b]),x=(0,s.useMemo)((function(){return(0,_e.HK)(g,(function(e){return e.uuid}))}),[g]),P=at.cH.ADDON_BLOCKS===t&&(null===d||void 0===d?void 0:d.addon);if(!t)return(0,C.jsx)("div",{});if(c&&at.cH.TREE===t)v=(0,C.jsxs)(y.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[v,(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(j.Z,{alignItems:"center",children:[(0,C.jsx)(T.Z,no(no({},$r.Ai),{},{onClick:function(){var e,n;null===c||void 0===c||null===(e=c.current)||void 0===e||null===(n=e.zoomIn)||void 0===n||n.call(e)},children:(0,C.jsx)(O.ZP,{noWrapping:!0,children:"Zoom in"})})),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(T.Z,no(no({},$r.Ai),{},{onClick:function(){var e,n;null===c||void 0===c||null===(e=c.current)||void 0===e||null===(n=e.zoomOut)||void 0===n||n.call(e)},children:(0,C.jsx)(O.ZP,{noWrapping:!0,children:"Zoom out"})})),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsx)(ke.Z,{appearAbove:!0,appearBefore:!0,default:!0,label:"Shortcut: Double-click canvas",lightBackground:!0,size:null,widthFitContent:!0,children:(0,C.jsx)(T.Z,no(no({},$r.Ai),{},{onClick:function(){var e,n;null===c||void 0===c||null===(e=c.current)||void 0===e||null===(n=e.fitCanvas)||void 0===n||n.call(e)},children:(0,C.jsx)(O.ZP,{noWrapping:!0,children:"Reset"})}))}),(0,C.jsx)(Z.Z,{mr:1}),(0,C.jsxs)(O.ZP,{bold:!0,children:[null===i||void 0===i?void 0:i.toFixed(2),"x"]})]})]});else if(m){var _=x[null===d||void 0===d?void 0:d.extension];v=(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(Be(),{as:"/pipelines/".concat(a,"/edit?").concat(at.uM,"=").concat(at.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,C.jsx)(k.Z,{default:!0,children:h})}),(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,C.jsx)(O.ZP,{bold:!0,children:null===_||void 0===_?void 0:_.name})]})}else P&&(v=(0,C.jsxs)(y.ZP,{children:[(0,C.jsx)(Be(),{as:"/pipelines/".concat(a,"/edit?").concat(at.uM,"=").concat(at.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,C.jsx)(k.Z,{default:!0,children:h})}),(0,C.jsx)(O.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,C.jsx)(O.ZP,{bold:!0,children:(0,Q.vg)(null===d||void 0===d?void 0:d.addon)})]}));return(0,C.jsx)(Zt.ym,{children:v})},io=t(35033),ro=t(11366),oo=t(3055),lo=t(57541),co=t(94353),uo=t(59920),ao=t(36405);function so(e){var n=e.activeView,t=e.pipeline,i=e.secrets,r=e.setActiveSidekickView,o=e.variables,l=(0,Cr.wx)(o,(function(e){return e.uuid===jr.C}));return at.j5.map((function(e){var o=e.buildLabel,c=e.key,u=e.label;return{Icon:at.Z7[c],id:c,isSelected:function(){return n===c},label:function(){return(null===o||void 0===o?void 0:o({pipeline:t,secrets:i,variables:l}))||u},onClick:function(){return r(c,!0)}}}))}var po=t(43482),fo=t(32821),ho=t(28799);function vo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function mo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vo(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function bo(e){var n,t,i=e.page,c=e.pipeline,u=(0,p.useRouter)(),m=(0,Pt.i)().height,b=u.query.pipeline,g=c.uuid||b,x=(0,s.useState)(!!(0,Pe.U2)(Pe.zg)),j=x[0],k=x[1],O=(0,s.useState)(null),w=O[0],_=O[1],S=(0,s.useState)(null),A=S[0],M=S[1],B=(0,s.useState)(null),R=B[0],L=B[1],U=(0,s.useState)(null),H=U[0],W=U[1],G=(0,s.useState)(null),K=G[0],Y=G[1],$=(0,s.useState)([]),ee=$[0],re=$[1],oe=(0,s.useState)({}),le=oe[0],ce=oe[1],ue=(0,s.useState)(!1),ae=ue[0],se=ue[1],de=(0,s.useState)(!1),pe=de[0],fe=de[1],xe=(0,s.useState)(!1),je=xe[0],ke=xe[1],Ze=(0,s.useState)(!1),Ae=Ze[0],Me=Ze[1],Be=(0,s.useState)(1),Re=Be[0],Ne=Be[1],Le=z.ZP.projects.list(),Fe=Le.data,Ue=Le.mutate,He=(0,s.useMemo)((function(){var e;return null===Fe||void 0===Fe||null===(e=Fe.projects)||void 0===e?void 0:e[0]}),[Fe]),We="".concat(ro.H8,"_").concat(g),ze=(0,Pe.U2)(We),Ve=(0,s.useState)((0,_e.sE)(Ot.NR,(function(e){return e.uuid===ze}))||Ot.NR[0]),Ge=Ve[0],Ke=Ve[1],Ye=(0,s.useCallback)((function(e){Ke(e),(0,Pe.t8)(We,null===e||void 0===e?void 0:e.uuid)}),[We,Ke]),qe="".concat(ro.g6,"_").concat(g),Qe=(0,s.useState)({}),Je=Qe[0],Xe=Qe[1],$e=(0,s.useCallback)((function(e){Xe((function(n){var t=e(n);return(0,Pe.t8)(qe,JSON.stringify(t)),t}))}),[qe,Xe]);(0,s.useEffect)((function(){var e=(0,Pe.U2)(qe);e&&(0,Q.Pb)(e)&&Xe(JSON.parse(e))}),[qe,Xe]);var en=(0,s.useRef)(null),nn=z.ZP.statuses.list({},{revalidateOnFocus:!1}).data,tn=(0,s.useMemo)((function(){var e,n;return null===nn||void 0===nn||null===(e=nn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.disable_pipeline_edit_access}),[nn]),rn=(0,s.useMemo)((function(){var e,n;return null===nn||void 0===nn||null===(e=nn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.max_print_output_lines}),[nn]),on=(0,s.useState)({}),ln=on[0],cn=on[1],un=(0,s.useState)([]),an=un[0],sn=un[1],dn=z.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),pn=dn.data,fn=dn.mutate,hn=null===pn||void 0===pn?void 0:pn.kernels,vn=(null===hn||void 0===hn?void 0:hn.find((function(e){return e.name===F.a_[null===On||void 0===On?void 0:On.type]})))||(null===hn||void 0===hn?void 0:hn[0]),mn=(0,Oe.Z)(g),bn=z.ZP.pipelines.detail(g,{include_block_pipelines:!0,includes_outputs:(0,Fn.Qr)(ln)},{refreshInterval:6e4}),gn=bn.data,xn=bn.mutate,jn=z.ZP.files.list(),yn=jn.data,kn=jn.mutate,Zn=(0,s.useMemo)((function(){return(null===yn||void 0===yn?void 0:yn.files)||[]}),[yn]),On=null===gn||void 0===gn?void 0:gn.pipeline,Pn=(0,s.useMemo)((function(){return F.qL.INTEGRATION===(null===On||void 0===On?void 0:On.type)}),[On]),wn=(0,s.useState)(null),Cn=wn[0],_n=wn[1],Sn=(0,s.useState)((0,Ce.Tz)({dateObj:!0})),En=Sn[0],In=Sn[1],Tn=(0,s.useState)(!1),Dn=Tn[0],An=Tn[1],Mn=(0,Ee.dd)((function(){return(0,C.jsx)(ye.Z,{centerOnScreen:!0,neutral:!0,onClick:Nn,subtitle:"Please refresh your page to have the most up-to-date data before making any changes.",title:"Your pipeline may be stale.",width:34*P.iI})}),{},[],{background:!0,uuid:"stale_pipeline_message"}),Bn=(0,l.Z)(Mn,2),Rn=Bn[0],Nn=Bn[1];(0,s.useEffect)((function(){var e,n;null!==gn&&void 0!==gn&&null!==(e=gn.pipeline)&&void 0!==e&&e.updated_at&&(null===Cn||void 0===Cn?void 0:Cn.toISOString())!==new Date(null===gn||void 0===gn||null===(n=gn.pipeline)||void 0===n?void 0:n.updated_at).toISOString()&&_n(new Date(gn.pipeline.updated_at)),Cn&&Number(Cn)>Number(En)&&Rn()}),[null===gn||void 0===gn||null===(n=gn.pipeline)||void 0===n?void 0:n.updated_at,Cn,En,Rn]);var Ln=(0,pr.iV)(),Un=Ln[at.uM],Hn=Ln.block_uuid,Wn=Ln.file_path,zn=(0,s.useMemo)((function(){var e=Ln["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[Ln]),Vn=(0,s.useCallback)((function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2?arguments[2]:void 0,i=(0,o.Z)({},at.uM,e);null!==t&&void 0!==t&&t.addon&&(i.addon=null===t||void 0===t?void 0:t.addon),null!==t&&void 0!==t&&t.blockUUID&&(i.block_uuid=null===t||void 0===t?void 0:t.blockUUID),null!==t&&void 0!==t&&t.extension&&(i.extension=null===t||void 0===t?void 0:t.extension),(0,Se.u7)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}),[]);(0,s.useEffect)((function(){Un||Vn(at.cH.TREE,!1)}),[Un,Vn]);var Gn=(0,s.useCallback)((function(e,n,t){k(!1),setTimeout((function(){return Vn(e,n,t)}),1)}),[Vn]),Kn=(0,s.useRef)({}),Yn=(0,s.useRef)({}),qn=(0,s.useRef)(null),Qn=(0,s.useRef)({}),Jn=(0,s.useRef)({}),Xn=(0,s.useRef)({}),$n=(0,s.useState)({}),et=$n[0],nt=$n[1],tt=(0,s.useCallback)((function(e,n,t){var i=Qn.current||{};Qn.current=mo(mo({},i),{},(0,o.Z)({},e,mo(mo({},i[e]||{}),{},(0,o.Z)({},n,t))))}),[Qn]),it=(0,s.useCallback)((function(e,n,t){var i=Jn.current||{};Jn.current=mo(mo({},i),{},(0,o.Z)({},e,mo(mo({},i[e]||{}),{},(0,o.Z)({},n,t))))}),[Jn]),rt=(0,s.useCallback)((function(e,n,t){tt(e,n,t),An(!0)}),[tt,An]),ot=(0,s.useCallback)((function(e,n,t){it(e,n,t),An(!0)}),[it,An]),lt=(0,s.useCallback)((function(e){Xn.current=mo(mo({},Xn.current),e)}),[Xn]),ct=(0,s.useCallback)((function(e,n){lt((0,o.Z)({},e,n)),An(!0)}),[lt,An]),ut=(0,s.useState)(null),st=ut[0],dt=ut[1],pt=z.ZP.data_providers.list({},{revalidateOnFocus:!1}).data,ft=null===pt||void 0===pt?void 0:pt.data_providers;(0,s.useEffect)((function(){var e=gn;null!==gn&&void 0!==gn&&gn.hasOwnProperty("error")||null===pt||void 0===pt||!pt.hasOwnProperty("error")||(e=pt),(0,J.bB)(e,L)}),[gn,pt]);var ht=z.ZP.variables.pipelines.list(g,{global_only:!0},{revalidateOnFocus:!1}),vt=ht.data,mt=ht.mutate,bt=null===vt||void 0===vt?void 0:vt.variables,gt=z.ZP.secrets.list({},{revalidateOnFocus:!1}),jt=gt.data,yt=gt.mutate,kt=null===jt||void 0===jt?void 0:jt.secrets,Zt=(0,s.useState)([]),wt=Zt[0],Ct=Zt[1],Et=(0,s.useState)([]),It=Et[0],Tt=Et[1],Dt=(0,s.useRef)({}),At=(0,s.useCallback)((function(e){var n;An(!0);var t=Dt.current[e.uuid]||{},i=t.upstream_blocks;(null===e||void 0===e||null===(n=e.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(i=e.upstream_blocks),Dt.current[e.uuid]=mo(mo(mo({},t),e),{},{configuration:mo(mo({},t.configuration),e.configuration),upstream_blocks:i})}),[An,Dt]),Mt=(0,s.useState)(!1),Bt=Mt[0],Rt=Mt[1],Nt=(0,s.useState)({upstreamBlocks:null}),Lt=Nt[0],Ft=Nt[1],Ut=(0,s.useState)([]),Ht=Ut[0],Wt=Ut[1],zt=(0,s.useState)(null),Vt=zt[0],Gt=zt[1],Kt=(0,po.Dp)(g),Yt=(0,po.Q9)(Kt,wt),qt=(0,s.useState)(Yt),Qt=qt[0],Jt=qt[1],Xt=(0,s.useState)(),$t=Xt[0],ei=Xt[1],ni=(0,s.useState)(),ti=ni[0],ii=ni[1],ri=(0,s.useState)(null),oi=ri[0],li=ri[1],ci=(0,Oe.Z)(Qt),ui=(0,s.useCallback)((function(){Ft({upstreamBlocks:{block:null,values:[]}}),cn({}),An(!1),Wt([]),Gt(null)}),[]);(0,s.useEffect)((function(){g!==mn&&(Qn.current={},Jn.current={})}),[g,mn]);var ai=z.ZP.block_outputs.detail(!j&&(null===oi||void 0===oi?void 0:oi.type)!==v.tf.SCRATCHPAD&&(null===oi||void 0===oi?void 0:oi.type)!==v.tf.CHART&&null!==oi&&void 0!==oi&&oi.uuid?encodeURIComponent(null===oi||void 0===oi?void 0:oi.uuid):null,{pipeline_uuid:g}),si=ai.data,di=ai.mutate,pi=(0,s.useMemo)((function(){return null===si||void 0===si?void 0:si.block_output}),[si]),fi=(0,s.useMemo)((function(){var e,n,t;return Pn?null===(e=(0,_e.sE)(null===pi||void 0===pi?void 0:pi.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,Q.kE)(ti))})))||void 0===e?void 0:e.sample_data:null===pi||void 0===pi||null===(n=pi.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[pi,Pn,ti]),hi=z.ZP.blocks.pipelines.analyses.detail(j?null:g,(null===oi||void 0===oi?void 0:oi.type)!==v.tf.SCRATCHPAD&&(null===oi||void 0===oi?void 0:oi.type)!==v.tf.CHART&&(null===oi||void 0===oi?void 0:oi.uuid)&&encodeURIComponent(null===oi||void 0===oi?void 0:oi.uuid)),vi=hi.data,mi=hi.mutate,bi=(null===vi||void 0===vi||null===(t=vi.analyses)||void 0===t?void 0:t[0])||{},gi=bi.insights,xi=void 0===gi?{}:gi,ji=bi.metadata,yi=void 0===ji?{}:ji,ki=bi.statistics,Zi=void 0===ki?{}:ki;(0,s.useEffect)((function(){0===Ht.length&&(mi(),di(),mt())}),[mi,di,mt,Ht]),(0,s.useEffect)((function(){if(0===Qt.length)li(null);else if((null===ci||void 0===ci?void 0:ci.length)!==(null===Qt||void 0===Qt?void 0:Qt.length)&&(null===Qt||void 0===Qt?void 0:Qt.length)<(null===ci||void 0===ci?void 0:ci.length)){var e=ci.findIndex((function(e){return e.uuid===(null===oi||void 0===oi?void 0:oi.uuid)})),n=ci.length-1===e?e-1:e+1;li(ci[Math.max(0,n)])}}),[Qt,ci,null===oi||void 0===oi?void 0:oi.uuid]),(0,s.useEffect)((function(){var e;null!==(e=Lt.upstreamBlocks)&&void 0!==e&&e.block&&(k(!1),Vn(at.cH.TREE))}),[Lt.upstreamBlocks,Vn]);var Oi=z.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!1}),Pi=Oi.data,wi=Oi.mutate,Ci=null===Pi||void 0===Pi?void 0:Pi.autocomplete_items;(0,s.useEffect)((function(){Wn||ke(!1),Y(Wn)}),[Wn]),(0,s.useEffect)((function(){(0,_e.fS)(zn,ee)||re(zn)}),[zn,ee]);var _i=(0,d.Db)(z.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(e){var n=e.pipeline.uuid;u.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),kn()},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}}),Si=(0,l.Z)(_i,1)[0],Ei=(0,d.Db)(z.ZP.pipelines.useUpdate(g,{update_content:!0}),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){An(!1),xn(),kn()},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}}),Ii=(0,l.Z)(Ei,2),Ti=Ii[0],Di=Ii[1].isLoading,Ai=(0,s.useCallback)((function(e,n){var t=e||{},i=t.block,r=t.pipeline,o=void 0===r?{extensions:{}}:r,c=(n||{}).contentOnly;if(!(Cn&&Number(Cn)>Number(En))){var u=(0,Ce.Tz)({dateObj:!0}),a=(0,Ce.Tz)();In(u);var s={},d={},p={},f={};((null===o||void 0===o?void 0:o.blocks)||wt).forEach((function(e){var n,t,r,o=e.extension_uuid,u=e.type,a=e.uuid,h=null===(n=Jn.current[u])||void 0===n?void 0:n[a];"undefined"===typeof h&&(h=e.content);var m,b=null===(t=Qn.current[u])||void 0===t?void 0:t[a];"undefined"===typeof b&&(b=e.callback_content);var g=null===(r=ln[a])||void 0===r?void 0:r.filter((function(e){return!!e})),x=null===g||void 0===g?void 0:g.find((function(e){return e.error}));if(g){var j=[],y=0;g.forEach((function(n){var t=n.data,i=n.type;(v.tf.SCRATCHPAD===e.type||x||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(io.Lz)?e:e.concat(n)}),[]),i===Te.Gi.TEXT_PLAIN&&(y+=(null===t||void 0===t?void 0:t.length)||0)),(!rn||y<rn+5)&&j.push(n))})),m=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"".concat(a,"_").concat(n)}}))}var k=mo(mo({},e),{},{callback_content:b,content:h,outputs:m});(null===i||void 0===i?void 0:i.uuid)===a&&Object.entries(i).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];"object"===typeof i&&!Array.isArray(i)&&i?Object.entries(i).forEach((function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];k[t]||(k[t]={}),k[t][i]=r})):k[t]=i})),c?d[k.uuid]={callback_content:k.callback_content,content:k.content,outputs:k.outputs,uuid:k.uuid}:[v.tf.EXTENSION].includes(u)?(s[o]||(s[o]=[]),s[o].push(k)):v.tf.CALLBACK===u?p[k.uuid]=k:v.tf.CONDITIONAL===u?f[k.uuid]=k:d[k.uuid]=k}));var h=mo(mo({},null===On||void 0===On?void 0:On.extensions),null===o||void 0===o?void 0:o.extensions);Object.entries(s).forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];h[t]||(h[t]={}),h[t].blocks=i}));var m=[],b=[],g=[];return((null===o||void 0===o?void 0:o.blocks)||wt).forEach((function(e){var n=e.uuid,t=d[n],i=p[n],r=f[n];"undefined"!==typeof t?m.push(t):"undefined"!==typeof i?b.push(i):"undefined"!==typeof r&&g.push(r)})),Ti({pipeline:mo(mo(mo({},On),o),{},{blocks:m,callbacks:b,conditionals:g,extensions:h,updated_at:a,widgets:It.map((function(e){var n,t,i=Xn.current[e.uuid],r=Dt.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var o=null===(n=ln[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),l=null===o||void 0===o?void 0:o.find((function(e){return e.error}));if(o){var c=[];o.forEach((function(n){var t=n.data,i=n.type;(v.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(io.Lz)?e:e.concat(n)}),[])),c.push(n))})),t=c.map((function(n,t){return{text_data:JSON.stringify(n),variable_uuid:"".concat(e.uuid,"_").concat(t)}}))}return mo(mo(mo({},e),r),{},{configuration:mo(mo({},e.configuration),r.configuration),content:i,outputs:t})}))})})}Rn()}),[wt,rn,ln,On,Cn,En,Rn,Ti,It]),Mi=(0,s.useCallback)((function(e){Ai();var n=encodeURIComponent(e),t=(0,pr.iV)()["file_paths[]"]||[];Array.isArray(t)||(t=[t]),t.includes(n)||t.push(n),(0,Se.u7)({file_path:n,"file_paths[]":t})}),[Ai]),Bi=(0,s.useCallback)((function(e){var n=e||{},t=n.content,i=n.path,r=(0,fo.IO)(i,wt);if(r){var l=r.type,c=r.uuid;ot(l,c,t),Ct((function(e){var n=null===e||void 0===e?void 0:e.findIndex((function(e){var n=e.type,t=e.uuid;return n===l&&t===c}));return n>=0&&(e[n].content=t),e})),nt((function(e){return mo(mo({},e),{},(0,o.Z)({},l,mo(mo({},null===e||void 0===e?void 0:e[l]),{},(0,o.Z)({},c,Number(new Date)))))})),xn()}}),[wt,xn,ot]),Ri=(0,s.useMemo)((function(){var e=[],n=[];return wt.forEach((function(t){v.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[wt]),Ni=Ri.blocksInNotebook,Li=Ri.blocksInSidekick,Fi=(0,s.useCallback)((function(e,n){return Ai({pipeline:{name:e,type:n}}).then((function(e){var t,i;if(null!==e&&void 0!==e&&null!==(t=e.data)&&void 0!==t&&t.pipeline){var r=e.data.pipeline.uuid;g!==r?window.location.href="".concat(u.basePath,"/pipelines/").concat(r,"/edit"):(kn(),n!==(null===On||void 0===On?void 0:On.type)&&xn(),(0,po.k1)(Ni,g,r),(0,po.k1)(Li,g,r))}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&M((function(e){return mo(mo({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){Mi("pipelines/".concat(g,"/").concat(me.dT.METADATA_YAML)),M(null)}}]})}))}))}),[Ni,Li,kn,xn,Mi,null===On||void 0===On?void 0:On.type,g,u,Ai]),Ui=(0,d.Db)((function(e){var n=e.type,t=e.extension_uuid,i=e.uuid,r={};return n&&(r.block_type=n),t&&(r.extension_uuid=t),z.ZP.blocks.pipelines.useDelete(g,encodeURIComponent(i),r)()}),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;Ct((function(e){return(0,_e.oM)(e,e.findIndex((function(e){var n=e.type,r=e.uuid;return t===n&&i===r})))})),xn(),Gt(null),t===v.tf.SCRATCHPAD&&kn()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;M({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&cn((function(e){return mo(mo({},e),{},(0,o.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Te.Gi.TEXT_PLAIN}}))))}))}})}}),Hi=(0,l.Z)(Ui,1)[0],Wi=(0,d.Db)((function(e){var n=e.uuid;return z.ZP.widgets.pipelines.useDelete(g,n)()}),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(e){var n=e.widget.uuid;Tt((function(e){return(0,_e.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),xn(),kn()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;M({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&cn((function(e){return mo(mo({},e),{},(0,o.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Te.Gi.TEXT_PLAIN}}))))}))}})}}),zi=(0,l.Z)(Wi,1)[0],Vi=(0,Ee.dd)((function(e){return(0,C.jsx)(ye.Z,{centerOnScreen:!0,neutral:!0,onCancel:Yi,onClick:function(){return Qi(e)},subtitle:"Deleting this block is dangerous. Your block may have downstream dependencies that depend on this block. You can delete this block anyway and remove it as a dependency from downstream blocks.",title:"Your block has dependencies",width:34*P.iI})})),Gi=(0,l.Z)(Vi,2),Ki=Gi[0],Yi=Gi[1],qi=(0,d.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,r="".concat(t,"/").concat(i);return n&&me.JD[n]&&(r="".concat(r,".").concat(me.JD[n].toLowerCase())),z.ZP.blocks.useDelete(encodeURIComponent(r))()}),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){wi(),xn(),kn()},onErrorCallback:function(e,n){Ki(),M({displayMessage:e.exception,errors:n,response:e})}})}}),Qi=(0,l.Z)(qi,1)[0],Ji=(0,d.Db)(z.ZP.kernels.useUpdate(null===vn||void 0===vn?void 0:vn.id),{onSuccess:function(e){return(0,J.wD)(e,{callback:function(){return fn()},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}}),Xi=(0,l.Z)(Ji,1)[0],$i=(0,s.useCallback)((function(){return Xi({kernel:{action_type:"restart"}})}),[Xi]),er=(0,s.useCallback)((function(){Xi({kernel:{action_type:"interrupt"}}),Wt([])}),[Xi]),nr=(0,d.Db)(z.ZP.blocks.pipelines.useCreate(g)),tr=(0,l.Z)(nr,1)[0],ir=(0,s.useCallback)((function(e,n,t){var i,o,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,Q.Y6)();e.converted_from_type&&e.converted_from_uuid&&(i=null===(o=Jn.current[e.converted_from_type])||void 0===o?void 0:o[e.converted_from_uuid]);var u=e.language,a=e.type;if(Pn){var s=(0,_e.HK)((null===On||void 0===On?void 0:On.blocks)||[],(function(e){return e.type})),d=s[v.tf.DATA_EXPORTER],p=s[v.tf.DATA_LOADER],f=s[v.tf.TRANSFORMER];if(v.tf.DATA_LOADER===a){if(v.t6.YAML!==u)return void M({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(v.t6.YAML," and not ").concat(u,".")});if(p)return void M({displayMessage:"Pipeline ".concat(null===On||void 0===On?void 0:On.uuid," already has a source: ").concat(null===p||void 0===p?void 0:p.uuid,".")})}else if(v.tf.TRANSFORMER===a){if(f)return void M({displayMessage:"Pipeline ".concat(null===On||void 0===On?void 0:On.uuid," already has a transformer: ").concat(null===f||void 0===f?void 0:f.uuid,".")})}else if(v.tf.DATA_EXPORTER===a){if(v.t6.YAML!==u)return void M({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(v.t6.YAML," and not ").concat(u,".")});if(d)return void M({displayMessage:"Pipeline ".concat(null===On||void 0===On?void 0:On.uuid," already has a destination: ").concat(null===d||void 0===d?void 0:d.uuid,".")})}}return tr({block:mo({content:i,name:c,priority:n,require_unique_name:!0},e)}).then((function(n){(0,J.wD)(n,{callback:function(){var e=n.data.block;null===t||void 0===t||t(e),kn(),xn().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;return Ct((function(e){var n=(0,r.Z)(t);Object.entries(i||{}).forEach((function(e){var t=(0,l.Z)(e,2),i=t[0],o=t[1].blocks;o&&n.push.apply(n,(0,r.Z)(o.map((function(e){return mo(mo({},e),{},{extension_uuid:i})}))))}));var o=(0,_e.HK)(e,(function(e){return e.uuid})),c=[];return n.forEach((function(e){var n=o[e.uuid];n?c.push(n):c.push(e)})),c}))}))},onErrorCallback:function(n,t){var i,r=null===n||void 0===n||null===(i=n.error)||void 0===i?void 0:i.exception,o=(0,fo.u$)(mo(mo({},e),{},{name:c}));r&&o&&r.startsWith(Ot.LR)?M((function(){return{errors:t,links:[{label:"View existing block file contents and optionally add to pipeline (if applicable).",onClick:function(){Mi(o),M(null)}}],response:n}})):M({errors:t,response:n})}})}))}),[tr,kn,xn,Pn,Mi,Ct,M,On]),rr=(0,Ee.dd)((function(e){var n=e.block,t=e.idx,i=e.isUpdatingBlock,r=void 0!==i&&i,o=e.name,l=void 0===o?(0,Q.Y6)():o,c=e.onCreateCallback,u=e.preventDuplicateBlockName;return(0,C.jsx)(X.BC,{children:(0,C.jsx)(ne,{block:n,defaultName:l,isUpdatingBlock:r,onClose:cr,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r?Ai({block:{color:(null===e||void 0===e?void 0:e.color)||null,name:null===e||void 0===e?void 0:e.name,uuid:n.uuid},pipeline:{blocks:(null===On||void 0===On?void 0:On.blocks)||[]}}).then((function(){Gt(null),cr()})):ir(mo(mo({},n),(0,Fn.gR)(e,["name"])),t,c,null===e||void 0===e?void 0:e.name).then((function(){return cr()}))},pipeline:On,preventDuplicateBlockName:u})})}),{},[ir,On],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),or=(0,l.Z)(rr,2),lr=or[0],cr=or[1],ur=(0,Ee.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,r=e.onSaveSuccess;return(0,C.jsx)(X.BC,{children:(0,C.jsx)(St.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),dr()},onSaveSuccess:function(e){Ue(),dr(),null===r||void 0===r||r(e)}})})}),{},[Ue],{background:!0,uuid:"configure_project"}),ar=(0,l.Z)(ur,2),sr=ar[0],dr=ar[1],fr=(0,d.Db)(z.ZP.widgets.pipelines.useCreate(g)),hr=(0,l.Z)(fr,1)[0],vr=(0,s.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,Q.Y6)();return hr({widget:mo({name:i,priority:n,type:v.tf.CHART},e)}).then((function(e){return(0,J.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),kn(),xn(),Vn(at.cH.CHARTS),W(n)},onErrorCallback:function(e,n){return M({errors:n,response:e})}})}))}),[kn,xn,hr,Vn]);(0,s.useEffect)((function(){if(H){var e,n=null===(e=Yn.current[H.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),W(null))}}),[H,W]),(0,s.useEffect)((function(){mn!==g&&(Ct([]),Tt([]),Jt([]),sn([]))}),[g,mn]),(0,s.useEffect)((function(){if("undefined"!==typeof(null===On||void 0===On?void 0:On.blocks)||"undefined"!==typeof(null===On||void 0===On?void 0:On.extensions)){var e=[];"undefined"!==typeof(null===On||void 0===On?void 0:On.blocks)&&e.push.apply(e,(0,r.Z)(null===On||void 0===On?void 0:On.blocks)),"undefined"!==typeof(null===On||void 0===On?void 0:On.callbacks)&&e.push.apply(e,(0,r.Z)(null===On||void 0===On?void 0:On.callbacks)),"undefined"!==typeof(null===On||void 0===On?void 0:On.conditionals)&&e.push.apply(e,(0,r.Z)(null===On||void 0===On?void 0:On.conditionals)),"undefined"!==typeof(null===On||void 0===On?void 0:On.extensions)&&Object.entries((null===On||void 0===On?void 0:On.extensions)||{}).forEach((function(n){var t=(0,l.Z)(n,2),i=t[0],o=t[1].blocks;o&&e.push.apply(e,(0,r.Z)(o.map((function(e){return mo(mo({},e),{},{extension_uuid:i})}))))})),Ct(e)}}),[null===On||void 0===On?void 0:On.blocks,null===On||void 0===On?void 0:On.callbacks,null===On||void 0===On?void 0:On.conditionals,null===On||void 0===On?void 0:On.extensions]),(0,s.useEffect)((function(){"undefined"!==typeof(null===On||void 0===On?void 0:On.widgets)&&Tt(On.widgets)}),[null===On||void 0===On?void 0:On.widgets]),(0,s.useEffect)((function(){(null===Yt||void 0===Yt?void 0:Yt.length)>0&&0===(null===Qt||void 0===Qt?void 0:Qt.length)&&(Jt(Yt),li(Yt[0]))}),[Qt,Yt]);var mr=(0,Oe.Z)(wt);(0,s.useEffect)((function(){if("undefined"!==typeof(null===On||void 0===On?void 0:On.blocks)&&(!wt.length||!(0,_e.fS)(null===mr||void 0===mr?void 0:mr.map((function(e){return e.uuid})).sort(),null===wt||void 0===wt?void 0:wt.map((function(e){return e.uuid})).sort()))){var e=(0,po.Rt)(On.blocks),n=e.content,t=e.messages;Jn.current=n,cn((function(e){return mo(mo({},t),e)}))}}),[wt,mr,null===On||void 0===On?void 0:On.blocks,cn]),(0,s.useEffect)((function(){if(!It.length&&"undefined"!==typeof(null===On||void 0===On?void 0:On.widgets)){var e=(0,po.Rt)(On.widgets),n=e.content,t=e.messages;Xn.current=n,cn((function(e){return mo(mo({},t),e)}))}}),[null===On||void 0===On?void 0:On.widgets,cn,It]);var br=(0,s.useCallback)((function(e,n,t){var i=wt.find((function(t){var i=t.type,r=t.uuid;return i===n&&r===e}));if(i){if(Gt(i),null!==Kn&&void 0!==Kn&&Kn.current){var r,o=Kn.current["".concat(i.type,"s/").concat(i.uuid,".py")];null===o||void 0===o||null===(r=o.current)||void 0===r||r.scrollIntoView()}(0,Se.u7)({block_uuid:null,file_path:null,"file_paths[]":[]})}else if(n===v.tf.CHART){var l=It.find((function(n){return n.uuid===e}));if(l&&(Gt(l),null!==Yn&&void 0!==Yn&&Yn.current)){var c,u=Yn.current[l.uuid];null===u||void 0===u||null===(c=u.current)||void 0===c||c.scrollIntoView()}}else t&&Mi(t)}),[wt,Mi,It]);(0,s.useEffect)((function(){if(Hn&&!Vt){var e=wt.find((function(e){var n,t=e.uuid;return(null===Hn||void 0===Hn||null===(n=Hn.split(":"))||void 0===n?void 0:n[0])===t}));e&&($e((function(n){return mo(mo({},n),{},(0,o.Z)({},e.uuid,!1))})),br(e.uuid,e.type,null))}else(null===mr||void 0===mr?void 0:mr.length)!==(null===wt||void 0===wt?void 0:wt.length)&&Vt&&($e((function(e){return mo(mo({},e),{},(0,o.Z)({},Vt.uuid,!1))})),br(Vt.uuid,Vt.type,null))}),[Hn,wt,null===mr||void 0===mr?void 0:mr.length,br,Vt,$e]);var gr=(0,s.useMemo)((function(){return new h.Z}),[]),xr=(0,s.useMemo)((function(){return{api_key:co.l,token:gr.decodedToken.token}}),[gr]),jr=(0,a.ZP)((0,ho.Ib)(),{onClose:function(){return console.log("socketUrlPublish closed")},onMessage:function(e){if(e){var n=JSON.parse(e.data),t=n.block_type,i=n.execution_state,l=n.msg_type,c=n.pipeline_uuid,u=n.uuid;if(!u&&!c)return;var a=wt.find((function(e){var n=e.type,i=e.uuid;return t===n&&u===i}));"stream_pipeline"!==l?cn((function(e){var t=e[u]||[];return mo(mo({},e),{},(0,o.Z)({},u,t.concat(n)))})):(sn((function(e){return[].concat((0,r.Z)(e),[n])})),Te.uF.IDLE===i&&(Wt([]),xn(),u||Rt(!1))),Te.uF.BUSY===i?Wt((function(e){return e.find((function(e){var n=e.uuid;return u===n}))||!a?e:e.concat(a)})):Te.uF.IDLE===i&&Wt((function(e){return e.filter((function(e){var n=e.uuid;return u!==n}))})),tn||An(!0)}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,yr=(0,s.useCallback)((function(){Ai().then((function(){Rt(!0),sn([]),jr(JSON.stringify(mo(mo({},xr),{},{execute_pipeline:!0,pipeline_uuid:g})))}))}),[g,Ai,jr,xr]),kr=(0,s.useCallback)((function(){jr(JSON.stringify(mo(mo({},xr),{},{cancel_pipeline:!0,pipeline_uuid:g})))}),[g,jr,xr]),Zr=(0,s.useCallback)((function(){jr(JSON.stringify(mo(mo({},xr),{},{cancel_pipeline:!0,pipeline_uuid:g,skip_publish_message:!0})))}),[g,jr,xr]),Or=(0,s.useCallback)((function(){jr(JSON.stringify(mo(mo({},xr),{},{check_if_pipeline_running:!0,pipeline_uuid:g})))}),[g,jr,xr]);(0,s.useEffect)((function(){var e;return window.addEventListener("pagehide",Zr),null===u||void 0===u||null===(e=u.events)||void 0===e||e.on("routeChangeStart",Zr),function(){var e;null===u||void 0===u||null===(e=u.events)||void 0===e||e.off("routeChangeStart",Zr),window.removeEventListener("pagehide",Zr)}}),[Zr,null===u||void 0===u?void 0:u.events]);var Pr=(0,s.useCallback)((function(e){var n=e.block,t=e.code,i=e.ignoreAlreadyRunning,r=e.runDownstream,o=void 0!==r&&r,l=e.runIncompleteUpstream,c=void 0!==l&&l,u=e.runSettings,a=void 0===u?{}:u,s=e.runTests,d=void 0!==s&&s,p=e.runUpstream,f=n.extension_uuid,h=n.upstream_blocks,v=n.uuid;if(!Ht.find((function(e){var n=e.uuid;return v===n}))||i){var m="".concat(ro.vF,"_").concat(null===On||void 0===On?void 0:On.uuid);jr(JSON.stringify(mo(mo({},xr),{},{code:t,extension_uuid:f,output_messages_to_logs:!!(0,Pe.U2)(m),pipeline_uuid:null===On||void 0===On?void 0:On.uuid,run_downstream:o,run_incomplete_upstream:c,run_settings:a,run_tests:d,run_upstream:p,type:n.type,upstream_blocks:h,uuid:v}))),cn((function(e){return delete e[v],e})),se(!1),Wt((function(e){return e.find((function(e){var n=e.uuid;return v===n}))?e:e.concat(n)}))}xn()}),[xn,On,Ht,jr,cn,Wt,se,xr]),wr=(0,s.useCallback)((function(e){var n=e.block;return tn?Pr(e):Ai({block:{outputs:[],uuid:n.uuid}},{contentOnly:!0}).then((function(){return Pr(e)}))}),[tn,Pr,Ai]),Cr=(0,a.ZP)((0,ho.Ib)("terminal"),{shouldReconnect:function(){return!0}}),_r=Cr.lastMessage,Sr=Cr.sendMessage,Er=(0,Ee.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,C.jsx)(X.BC,{children:(0,C.jsx)(I.Z,{contained:!0,defaultLinkUUID:i,onClickCustomTemplate:function(e){t({config:{custom_template:e,custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid}}),Dr()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[lo.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),Ir=(0,l.Z)(Er,2),Tr=Ir[0],Dr=Ir[1],Ar=z.ZP.global_data_products.list().data,Mr=(0,s.useMemo)((function(){return(null===Ar||void 0===Ar?void 0:Ar.global_data_products)||[]}),[Ar]),Br=(0,Ee.dd)((function(e){var n=e.addNewBlock;return(0,C.jsx)(X.BC,{children:(0,C.jsx)(De.Z,{children:(0,C.jsx)(be.Z,{globalDataProducts:Mr,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:v.tf.GLOBAL_DATA_PRODUCT}),Lr()}})})})}),{},[Mr],{background:!0,uuid:"global_data_products"}),Rr=(0,l.Z)(Br,2),Nr=Rr[0],Lr=Rr[1],Fr=(0,s.useMemo)((function(){return(0,C.jsx)(Xr,{activeView:Un,addNewBlockAtIndex:function(e,n,t,i){return new Promise((function(){return lr({block:e,idx:n,name:i,onCreateCallback:t})}))},afterWidth:w,autocompleteItems:Ci,blockRefs:Kn,blocks:wt,blocksInNotebook:Ni,cancelPipeline:kr,chartRefs:Yn,checkIfPipelineRunning:Or,deleteBlock:Hi,deleteWidget:zi,editingBlock:Lt,executePipeline:yr,fetchFileTree:kn,fetchPipeline:xn,fetchSecrets:yt,fetchVariables:mt,globalDataProducts:Mr,globalVariables:bt,insights:xi,interruptKernel:er,isPipelineExecuting:Bt,isPipelineUpdating:Di,lastTerminalMessage:_r,messages:ln,metadata:yi,onChangeCallbackBlock:rt,onChangeChartBlock:ct,onChangeCodeBlock:ot,onSelectBlockFile:br,onUpdateFileSuccess:Bi,pipeline:On,pipelineMessages:an,runBlock:wr,runningBlocks:Ht,sampleData:fi,savePipelineContent:Ai,secrets:kt,selectedBlock:Vt,selectedFilePath:K,sendTerminalMessage:Sr,setActiveSidekickView:Vn,setAllowCodeBlockShortcuts:Me,setAnyInputFocused:fe,setDepGraphZoom:Ne,setDisableShortcuts:ke,setEditingBlock:Ft,setErrors:M,setHiddenBlocks:$e,setSelectedBlock:Gt,setTextareaFocused:se,showBrowseTemplates:Tr,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,Q.Y6)(),t=arguments.length>2?arguments[2]:void 0;return new Promise((function(){return lr({block:e,isUpdatingBlock:!0,name:n,preventDuplicateBlockName:t})}))},statistics:Zi,textareaFocused:ae,treeRef:qn,updatePipelineMetadata:Fi,updateWidget:At,widgets:It})}),[Un,w,Ci,Kn,wt,Ni,kr,Or,Hi,zi,Lt,yr,kn,xn,yt,mt,Mr,bt,xi,er,Bt,Di,_r,ln,yi,rt,ct,ot,br,Bi,On,an,wr,Ht,fi,Ai,kt,Vt,K,Sr,Vn,fe,Ft,M,$e,se,lr,Tr,Zi,ae,Fi,At,It]),Ur=(0,s.useMemo)((function(){return(0,C.jsx)(xt,{addNewBlockAtIndex:function(e,n,t,i){return new Promise((function(){var r;q.L.BLOCK_FILE!==(null===e||void 0===e||null===(r=e.block_action_object)||void 0===r?void 0:r.object_type)&&(v.tf.DBT!==(null===e||void 0===e?void 0:e.type)||v.t6.SQL!==(null===e||void 0===e?void 0:e.language)||null!==e&&void 0!==e&&e.block_action_object)?lr({block:e,idx:n,name:i,onCreateCallback:t}):ir(e,n,t,i)}))},addWidget:function(e,n){var t=n.onCreateCallback;return vr(e,It.length,t)},allBlocks:wt,allowCodeBlockShortcuts:Ae,anyInputFocused:pe,autocompleteItems:Ci,blockRefs:Kn,blocks:Ni,blocksThatNeedToRefresh:et,dataProviders:ft,deleteBlock:Hi,disableShortcuts:je,fetchFileTree:kn,fetchPipeline:xn,fetchSampleData:di,files:Zn,globalDataProducts:Mr,globalVariables:bt,hiddenBlocks:Je,interruptKernel:er,mainContainerRef:en,mainContainerWidth:st,messages:ln,onChangeCallbackBlock:rt,onChangeCodeBlock:ot,openSidekickView:Gn,pipeline:On,pipelineContentTouched:Dn,project:He,restartKernel:$i,runBlock:wr,runningBlocks:Ht,savePipelineContent:Ai,selectedBlock:Vt,setAnyInputFocused:fe,setDisableShortcuts:ke,setEditingBlock:Ft,setErrors:M,setHiddenBlocks:$e,setIntegrationStreams:ei,setOutputBlocks:Jt,setPipelineContentTouched:An,setSelectedBlock:Gt,setSelectedOutputBlock:li,setSelectedStream:ii,setTextareaFocused:se,showBrowseTemplates:Tr,showConfigureProjectModal:sr,showGlobalDataProducts:Nr,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,Q.Y6)();return new Promise((function(){return lr({block:e,isUpdatingBlock:!0,name:n})}))},textareaFocused:ae,widgets:It})}),[ir,vr,Ae,pe,Ci,Kn,wt,Ni,et,ft,Hi,je,kn,xn,di,Zn,Mr,bt,Je,er,en,st,ln,rt,ot,Gn,On,Dn,He,$i,wr,Ht,Ai,Vt,fe,Ft,M,$e,An,Gt,se,lr,Tr,sr,Nr,ae,It]),Hr=(0,s.useMemo)((function(){if(i===Ot.b7)return(0,C.jsx)(he,{cancelPipeline:kr,createPipeline:Si,executePipeline:yr,interruptKernel:er,isPipelineExecuting:Bt,pipeline:On,restartKernel:$i,savePipelineContent:Ai,setActiveSidekickView:Vn,setMessages:cn,children:K&&(0,C.jsx)(Z.Z,{ml:1,children:(0,C.jsx)(y.ZP,{alignItems:"center",fullHeight:!0,children:(0,C.jsx)(T.Z,{compact:!0,onClick:function(){return Y(null)},small:!0,children:"View pipeline"})})})})}),[kr,Si,yr,er,Bt,i,On,$i,Ai,K,Vn,cn,Y]),Wr=(0,s.useMemo)((function(){if(i===Ot.b7)return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Ie,{filePaths:ee,filesTouched:le,isBusy:Ht.length>=1,isPipelineUpdating:Di,kernel:vn,pipeline:On,pipelineContentTouched:Dn,pipelineLastSaved:Cn,restartKernel:$i,savePipelineContent:Ai,selectedFilePath:K,setErrors:M,setRunningBlocks:Wt,updatePipelineMetadata:Fi,children:Hr}),(null===ee||void 0===ee?void 0:ee.length)>0&&(0,C.jsx)(we.rK,{relativePosition:!0,secondary:!0,children:(0,C.jsx)(ve.Z,{filePaths:ee,filesTouched:le,savePipelineContent:Ai,selectedFilePath:K})})]})}),[Hr,le,Di,vn,i,On,Dn,Cn,$i,Ht,Ai,K,ee,M,Fi]),zr=(0,s.useMemo)((function(){var e;return null===$t||void 0===$t||null===(e=$t.filter((function(e){return(0,_e.sE)(null===pi||void 0===pi?void 0:pi.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat((0,Q.kE)(e))}))})))||void 0===e?void 0:e.map((function(e){return(0,C.jsx)(Z.Z,{pl:1,children:(0,C.jsx)(N.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return ii(e)},selected:ti===e,uuid:e,children:e})},e)}))}),[pi,$t,ti]),Vr=(0,s.useRef)(null),Gr=(0,s.useMemo)((function(){return(0,C.jsx)(te.Z,{addNewBlock:function(e,n){ir(e,wt.length,n,e.name),(null===zn||void 0===zn?void 0:zn.length)>=1&&u.push("/pipelines/".concat(g,"/edit"))},blocks:wt,deleteWidget:zi,fetchAutocompleteItems:wi,fetchFileTree:kn,fetchPipeline:xn,files:Zn,onSelectBlockFile:br,openFile:Mi,openPipeline:function(e){ui(),u.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))},openSidekickView:Gn,pipeline:On,ref:Vr,setErrors:M,setSelectedBlock:Gt,widgets:It})}),[ir,wt,zi,wi,kn,xn,null===zn||void 0===zn?void 0:zn.length,Zn,br,Mi,Gn,On,g,ui,u,M,Gt,It]),Kr=(0,s.useMemo)((function(){return(0,C.jsx)(E,{blockRefs:Kn,hiddenBlocks:Je,pipeline:On,setHiddenBlocks:$e})}),[Kn,Je,On,$e]),Yr=(0,s.useMemo)((function(){return Ot.Jf.uuid===(null===Ge||void 0===Ge?void 0:Ge.uuid)?Gr:Ot.IY.uuid===(null===Ge||void 0===Ge?void 0:Ge.uuid)?Kr:null}),[Gr,Kr,Ge]),qr=(0,s.useMemo)((function(){return(0,C.jsx)(Z.Z,{px:1,children:(0,C.jsx)(D.Z,{noPadding:!0,onClickTab:function(e){Ye(e)},selectedTabUUID:null===Ge||void 0===Ge?void 0:Ge.uuid,small:!0,tabs:Ot.NR})})}),[Ye,Ge]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(ge.Z,{title:null===On||void 0===On?void 0:On.name}),(0,C.jsxs)(_t,{after:Fr,afterHeader:(0,C.jsx)(to,{activeView:Un,depGraphZoom:Re,pipeline:On,secrets:kt,selectedBlock:Vt,treeRef:qn,variables:bt}),afterHeightOffset:oo.Mz,afterHidden:j,afterNavigationItems:so({activeView:Un,pipeline:On,secrets:kt,setActiveSidekickView:Vn,variables:bt}),afterOverflow:at.cH.DATA===Un?"hidden":null,afterSubheader:(null===Qt||void 0===Qt?void 0:Qt.length)>0&&Un===at.cH.DATA&&(0,C.jsxs)(y.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!Pn&&Qt.map((function(e){var n=e.uuid,t=(null===oi||void 0===oi?void 0:oi.uuid)===n;return(0,C.jsx)(Z.Z,{pl:1,children:(0,C.jsx)(N.ZP,{afterElement:t?(0,C.jsx)(T.Z,{basic:!0,highlightOnHover:!0,onClick:function(){(0,po.h8)(g,e.uuid),Jt((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,C.jsx)(V.x8,{muted:!0,size:1.25*P.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return li(e)},selected:t,uuid:n,children:n})},n)})),Pn&&zr]}),before:Yr,beforeHeader:qr,beforeHeightOffset:oo.Mz,beforeNavigationItems:(0,ao.H)(uo.M.EDIT,On),errors:R||A,headerOffset:(null===ee||void 0===ee?void 0:ee.length)>0?36:0,mainContainerHeader:Wr,mainContainerRef:en,page:i,pipeline:On,setAfterHidden:k,setAfterWidthForChildren:_,setErrors:R?L:M,setMainContainerWidth:dt,children:[(0,C.jsx)("div",{style:{height:K?0:null,opacity:K?0:null,visibility:K?"hidden":null},children:(0,C.jsx)(f.Z,{uuid:"PipelineDetail/".concat(g),children:Ur})}),null===zn||void 0===zn?void 0:zn.map((function(e){return(0,C.jsx)("div",{style:{display:K===e?null:"none"},children:(0,C.jsx)(f.Z,{uuid:"FileEditor/".concat(decodeURIComponent(e)),children:(0,C.jsx)(ie.Z,{active:K===e,addNewBlock:function(e,n){ir(mo(mo({},e),{},{require_unique_name:!1}),wt.length,n,e.name),u.push("/pipelines/".concat(g,"/edit"))},fetchPipeline:xn,fetchVariables:mt,filePath:e,onUpdateFileSuccess:Bi,openSidekickView:Gn,pipeline:On,selectedFilePath:K,sendTerminalMessage:Sr,setDisableShortcuts:ke,setErrors:M,setFilesTouched:ce,setSelectedBlock:Gt})})},e)})),(0,C.jsx)(Z.Z,{pb:Wn?0:Math.max(Math.floor(m*(2/3)/P.iI),0)})]})]})}bo.getInitialProps=function(){var e=(0,i.Z)(u().mark((function e(n){var t,i,r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,i=Ot.b7,r={page:i,pipeline:{uuid:t}},e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var go=(0,Et.Z)(bo)},37958:function(e,n,t){"use strict";t.d(n,{j:function(){return i}});var i=(0,t(44152).r)({apiReloads:{}}).useGlobalState},42305:function(e,n,t){"use strict";t.d(n,{A5:function(){return x},AY:function(){return j},BP:function(){return g},JX:function(){return b},OC:function(){return d},Pc:function(){return y},Ro:function(){return k},Tz:function(){return m},Y_:function(){return O},d$:function(){return v},jV:function(){return Z},lJ:function(){return P},n1:function(){return f},s8:function(){return a},vk:function(){return o},yD:function(){return s}});var i,r,o,l=t(82394),c=t(92083),u=t.n(c);!function(e){e.TODAY="today",e.WEEK="week",e.MONTH="month"}(o||(o={}));var a=(i={},(0,l.Z)(i,o.TODAY,"today"),(0,l.Z)(i,o.WEEK,"last 7 days"),(0,l.Z)(i,o.MONTH,"last 30 days"),i),s=(r={},(0,l.Z)(r,o.TODAY,0),(0,l.Z)(r,o.WEEK,6),(0,l.Z)(r,o.MONTH,29),r),d="YYYY-MM-DD HH:mm:ss",p="YYYY-MM-DD HH:mm",f="YYYY-MM-DD",h="MMMM D, YYYY";function v(e,n){var t=n||{},i=t.dayAgo,r=t.includeSeconds,o=t.utcFormat,l=u()(e),c=p;return o&&(l=l.utc()),i&&(l=l.subtract(1,"days")),r&&(c=d),l.format(c)}function m(e){var n=v((new Date).toISOString(),{includeSeconds:!0,utcFormat:!0});return null!==e&&void 0!==e&&e.dateObj?new Date(n):n}function b(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u().unix(e).format(null!==n&&void 0!==n&&n.withSeconds?d:p)}function g(e,n,t){return u()(e).utc().hours(+n).minutes(+t).format()}function x(e){return u()(e).unix()}function j(e,n,t,i){var r="".concat(e.toISOString().split("T")[0]," ").concat(n,":").concat(t);return i?"".concat(r,":").concat(i):r}function y(e){var n=u().unix(+e).utc();return{date:n.toDate(),hour:String(n.hour()),minute:String(n.minute())}}function k(e,n){var t=u().utc(),i=u().utc();null!==n&&void 0!==n&&n.localTime&&(t=u()().local(),i=u()().local());var r=(t=t.subtract(e,"days")).format(h),o=i.format(h);return null!==n&&void 0!==n&&n.endDateOnly?o:"".concat(r," - ").concat(o)}function Z(e,n){var t=null!==n&&void 0!==n&&n.localTime?u()().local():u().utc();if(e===o.WEEK){var i=s[o.WEEK];t=t.subtract(i,"days")}else if(e===o.MONTH){var r=s[o.MONTH];t=t.subtract(r,"days")}return null!==n&&void 0!==n&&n.isoString?t.startOf("day").toISOString():t.startOf("day").format(d)}function O(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:90,n=new Date,t=[],i=0;i<e;i++)t.unshift(n.toISOString().split("T")[0]),n.setDate(n.getDate()-1);return t}function P(e){return e.padStart(2,"0")}},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(79938)}])}},function(e){e.O(0,[3662,844,9902,426,1774,8792,8789,4259,5896,7849,9055,2714,7011,5872,2991,1424,1005,7815,6422,8952,7722,4822,3391,1484,6299,437,9774,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|