mage-ai 0.8.4__py3-none-any.whl → 0.8.6__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.

Files changed (94) hide show
  1. mage_ai/api/policies/BlockPolicy.py +2 -0
  2. mage_ai/api/policies/PipelinePolicy.py +1 -0
  3. mage_ai/api/presenters/BlockPresenter.py +1 -0
  4. mage_ai/api/presenters/OutputPresenter.py +1 -0
  5. mage_ai/api/presenters/PipelinePresenter.py +6 -1
  6. mage_ai/data_preparation/models/block/__init__.py +18 -4
  7. mage_ai/data_preparation/models/block/dbt/__init__.py +50 -1
  8. mage_ai/data_preparation/models/block/dbt/utils/__init__.py +136 -60
  9. mage_ai/data_preparation/models/block/utils.py +2 -1
  10. mage_ai/data_preparation/models/pipeline.py +5 -3
  11. mage_ai/data_preparation/repo_manager.py +1 -1
  12. mage_ai/data_preparation/storage/local_storage.py +1 -1
  13. mage_ai/data_preparation/templates/custom/python/default.jinja +1 -1
  14. mage_ai/data_preparation/templates/data_exporters/default.jinja +2 -4
  15. mage_ai/data_preparation/templates/data_exporters/pyspark/default.jinja +2 -2
  16. mage_ai/data_preparation/templates/data_loaders/api.py +1 -1
  17. mage_ai/data_preparation/templates/data_loaders/default.jinja +1 -1
  18. mage_ai/data_preparation/templates/data_loaders/file.py +1 -0
  19. mage_ai/data_preparation/templates/data_loaders/pyspark/default.jinja +1 -1
  20. mage_ai/data_preparation/templates/testable.jinja +2 -2
  21. mage_ai/data_preparation/templates/transformers/data_warehouse_transformer.jinja +2 -0
  22. mage_ai/data_preparation/templates/transformers/default.jinja +4 -6
  23. mage_ai/data_preparation/templates/transformers/default_pyspark.jinja +4 -4
  24. mage_ai/data_preparation/templates/transformers/transformer_actions/action.jinja +2 -0
  25. mage_ai/io/base.py +11 -1
  26. mage_ai/io/postgres.py +10 -5
  27. mage_ai/server/constants.py +1 -1
  28. mage_ai/server/frontend_dist/404.html +2 -2
  29. mage_ai/server/frontend_dist/404.html.html +2 -2
  30. mage_ai/server/frontend_dist/_next/static/chunks/{2249-84de2142241f4925.js → 2249-70929b8c547bbc18.js} +1 -1
  31. mage_ai/server/frontend_dist/_next/static/chunks/4846-58b7e138009c98a2.js +1 -0
  32. mage_ai/server/frontend_dist/_next/static/chunks/{5944-9488f2ddf3543b08.js → 5944-757b7898608a65e1.js} +1 -1
  33. mage_ai/server/frontend_dist/_next/static/chunks/{6641-fb7a8be8444f2dd4.js → 6641-a0ed2bd8f5dc777b.js} +1 -1
  34. mage_ai/server/frontend_dist/_next/static/chunks/8961-7a2143c4424c9217.js +1 -0
  35. mage_ai/server/frontend_dist/_next/static/chunks/{9140-836abb2721055e82.js → 9140-6f67e0879394373d.js} +1 -1
  36. mage_ai/server/frontend_dist/_next/static/chunks/9898-51ca6a904b7a2382.js +1 -0
  37. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a1e8869ed201ce7e.js +1 -0
  38. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-0678cf63c79072a7.js +1 -0
  39. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-5ccc75887776efb0.js +1 -0
  40. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-a6dbd67285ecc5a5.js → block-runs-8f23f7ca9efcb069.js} +1 -1
  41. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-d2bbafbb5b2c09e7.js +1 -0
  42. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-b0b91245d3299bdf.js +1 -0
  43. mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-5d7c45bb058a3f20.js +1 -0
  44. mage_ai/server/frontend_dist/_next/static/chunks/pages/{triggers-dbce4f85a95ea336.js → triggers-e0172c422c95eda9.js} +1 -1
  45. mage_ai/server/frontend_dist/_next/static/{0jln56azuIZflrR1CXt9U → okm8eXXn0kUptL5A1B7a6}/_buildManifest.js +1 -1
  46. mage_ai/server/frontend_dist/index.html +2 -2
  47. mage_ai/server/frontend_dist/manage.html +2 -2
  48. mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
  49. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  50. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
  51. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  52. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
  53. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  54. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  55. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
  56. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
  57. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
  58. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
  59. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  60. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
  61. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  62. mage_ai/server/frontend_dist/pipelines.html +2 -2
  63. mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
  64. mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
  65. mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
  66. mage_ai/server/frontend_dist/settings.html +2 -2
  67. mage_ai/server/frontend_dist/sign-in.html +13 -13
  68. mage_ai/server/frontend_dist/terminal.html +2 -2
  69. mage_ai/server/frontend_dist/test.html +2 -2
  70. mage_ai/server/frontend_dist/triggers.html +2 -2
  71. mage_ai/server/server.py +1 -0
  72. mage_ai/server/utils/output_display.py +7 -0
  73. mage_ai/server/websocket_server.py +2 -2
  74. mage_ai/services/datadog/__init__.py +123 -0
  75. mage_ai/tests/data_preparation/test_templates.py +34 -86
  76. mage_ai/tests/services/datadog/__init__.py +0 -0
  77. mage_ai/tests/services/datadog/test_datadog.py +69 -0
  78. {mage_ai-0.8.4.dist-info → mage_ai-0.8.6.dist-info}/METADATA +2 -1
  79. {mage_ai-0.8.4.dist-info → mage_ai-0.8.6.dist-info}/RECORD +85 -82
  80. mage_ai/server/frontend_dist/_next/static/chunks/4846-64f9afc02d45293c.js +0 -1
  81. mage_ai/server/frontend_dist/_next/static/chunks/8961-e25997bc088e0d19.js +0 -1
  82. mage_ai/server/frontend_dist/_next/static/chunks/9898-91c6384c9bd33ca7.js +0 -1
  83. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-688184bd8b4d4f5c.js +0 -1
  84. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-c6dfcc4f231cfa5a.js +0 -1
  85. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-abce05c25bee218d.js +0 -1
  86. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-a056c0e384d39c9b.js +0 -1
  87. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-6a8545f96cc7b8f2.js +0 -1
  88. mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-1734d248ec2b6c24.js +0 -1
  89. /mage_ai/server/frontend_dist/_next/static/{0jln56azuIZflrR1CXt9U → okm8eXXn0kUptL5A1B7a6}/_middlewareManifest.js +0 -0
  90. /mage_ai/server/frontend_dist/_next/static/{0jln56azuIZflrR1CXt9U → okm8eXXn0kUptL5A1B7a6}/_ssgManifest.js +0 -0
  91. {mage_ai-0.8.4.dist-info → mage_ai-0.8.6.dist-info}/LICENSE +0 -0
  92. {mage_ai-0.8.4.dist-info → mage_ai-0.8.6.dist-info}/WHEEL +0 -0
  93. {mage_ai-0.8.4.dist-info → mage_ai-0.8.6.dist-info}/entry_points.txt +0 -0
  94. {mage_ai-0.8.4.dist-info → mage_ai-0.8.6.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551],{7432:function(e,n,t){var i={"./Active4D.json":[266,266],"./All Hallows Eve.json":[4450,4450],"./Amy.json":[88849,8849],"./Birds of Paradise.json":[78097,8097],"./Blackboard.json":[88018,6115],"./Brilliance Black.json":[73835,3835],"./Brilliance Dull.json":[6507,6507],"./Chrome DevTools.json":[22508,2508],"./Clouds Midnight.json":[49566,9566],"./Clouds.json":[57951,7951],"./Cobalt.json":[80826,826],"./Cobalt2.json":[98256,8256],"./Dawn.json":[76958,6958],"./Dominion Day.json":[89307,9307],"./Dracula.json":[33453,3453],"./Dreamweaver.json":[19363,9363],"./Eiffel.json":[82481,2481],"./Espresso Libre.json":[44776,4776],"./GitHub Dark.json":[792,792],"./GitHub Light.json":[61450,1450],"./GitHub.json":[10739,739],"./IDLE.json":[67947,7947],"./Katzenmilch.json":[81240,1240],"./Kuroir Theme.json":[4388,4388],"./LAZY.json":[25164,5164],"./MagicWB (Amiga).json":[76443,6443],"./Merbivore Soft.json":[99361,9361],"./Merbivore.json":[86042,6042],"./Monokai Bright.json":[14883,4883],"./Monokai.json":[34454,4454],"./Night Owl.json":[60261,261],"./Nord.json":[59785,9785],"./Oceanic Next.json":[58920,8920],"./Pastels on Dark.json":[38901,8901],"./Slush and Poppies.json":[26434,6434],"./Solarized-dark.json":[36116,6116],"./Solarized-light.json":[5008,5008],"./SpaceCadet.json":[20440,440],"./Sunburst.json":[68018,8018],"./Textmate (Mac Classic).json":[15824,5824],"./Tomorrow-Night-Blue.json":[81150,1150],"./Tomorrow-Night-Bright.json":[8762,8762],"./Tomorrow-Night-Eighties.json":[82545,2545],"./Tomorrow-Night.json":[99855,9855],"./Tomorrow.json":[34092,4092],"./Twilight.json":[93898,3898],"./Upstream Sunburst.json":[98807,8807],"./Vibrant Ink.json":[89927,9927],"./Xcode_default.json":[64042,4042],"./Zenburnesque.json":[33467,3467],"./iPlastic.json":[88277,8277],"./idleFingers.json":[5104,5104],"./krTheme.json":[9633,9633],"./monoindustrial.json":[15729,5729],"./themelist.json":[79437,9437]};function r(e){if(!t.o(i,e))return Promise.resolve().then((function(){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}));var n=i[e],r=n[0];return t.e(n[1]).then((function(){return t.t(r,19)}))}r.keys=function(){return Object.keys(i)},r.id=7432,e.exports=r},5677:function(e,n,t){"use strict";t.d(n,{M4:function(){return d},S0:function(){return u},S_:function(){return a},Yn:function(){return f},rW:function(){return s}});var i=t(82394),r=t(21831),o=t(75582);function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function 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,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function a(e,n){return Object.entries(n).map((function(n){var t=(0,o.Z)(n,2),i=t[0],r=t[1];return e.languages.registerCompletionItemProvider(i,{provideCompletionItems:r(e)})}))}function u(e){var n=function(e){var n="[\\w.]+",t=["import ".concat(n," as ").concat(n),"import ".concat(n),"from ".concat(n," import ").concat(n," as ").concat(n),"from ".concat(n," import ").concat(n)],i=new RegExp("(".concat(t.join("|"),")"),"g");return(0,r.Z)(e.matchAll(i)).map((function(e){return e[1]}))}(e),t="[\\w.]+",o=["from ".concat(t," import ").concat(t," as (").concat(t,")"),"from ".concat(t," import (").concat(t,")"),"import ".concat(t," as (").concat(t,")"),"import (".concat(t,")")],l=new RegExp("(".concat(o.join("|"),")"));return n.reduce((function(e,n){var t=n.match(l);if(!t)return e;var o=(0,r.Z)(t),a=o[2],u=o[3],s=o[4],d=o[5],f=a||u||s||d;return c(c({},e),{},(0,i.Z)({},f,n))}),{})}function s(e,n){var t=e;n&&(t=t.split(" as ".concat(n))[0]);var i="[\\w.]+",l=["from ".concat(i," import (").concat(i,")"),"import (".concat(i,")")],c=new RegExp("(".concat(l.join("|"),")"),"g"),a=(0,r.Z)(t.matchAll(c))[0];if(a){var u=(0,o.Z)(a,4),s=u[2],d=u[3];return s||d}}function d(e,n){return function(e,n){return e.split("\n")[n.startLineNumber-1]}(e,n).slice(0,n.startColumn-1)}function f(e){var n=new RegExp("([\\w_]+)[ ]*=[ ]*([\\w_]+)","g");return(0,r.Z)(e.matchAll(n)).map((function(e){return{assignmentValue:e[2],variableName:e[1]}}))}},32365:function(e,n,t){"use strict";t.d(n,{Ep:function(){return r},KT:function(){return c},Nk:function(){return l},aU:function(){return o}});var i=t(9518),r=2,o=21,l=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-w2hta3-0"})([""]),c=i.default.div.withConfig({displayName:"indexstyle__PlaceholderStyle",componentId:"sc-w2hta3-1"})(["padding-left:67px;position:absolute;z-index:1;"])},57722:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var i=t(82684),r=t(85202),o=t(38789),l=t(19711),c=t(66166),a="twilight",u=t(2005),s=t(31012),d=t(32365),f=t(5677);var p=t(75582),h={"all-hallows-eve":"All Hallows Eve","birds-of-paradise":"Birds of Paradise","brilliance-black":"Brilliance Black","brilliance-dull":"Brilliance Dull","chrome-devtools":"Chrome DevTools","clouds-midnight":"Clouds Midnight","espresso-libre":"Espresso Libre","kuroir-theme":"Kuroir Theme","magicwb--amiga-":"MagicWB (Amiga)","merbivore-soft":"Merbivore Soft","monokai-bright":"Monokai Bright","night-owl":"Night Owl","oceanic-next":"Oceanic Next","pastels-on-dark":"Pastels on Dark","slush-and-poppies":"Slush and Poppies","solarized-dark":"Solarized-dark","solarized-light":"Solarized-light","textmate--mac-classic-":"Textmate (Mac Classic)","tomorrow-night":"Tomorrow-Night","tomorrow-night-blue":"Tomorrow-Night-Blue","tomorrow-night-bright":"Tomorrow-Night-Bright","tomorrow-night-eighties":"Tomorrow-Night-Eighties","upstream-sunburst":"Upstream Sunburst","vibrant-ink":"Vibrant Ink","xcode-default":"Xcode_default",active4d:"Active4D",amy:"Amy",blackboard:"Blackboard",clouds:"Clouds",cobalt:"Cobalt",dawn:"Dawn",dreamweaver:"Dreamweaver",eiffel:"Eiffel",github:"GitHub",idle:"IDLE",idlefingers:"idleFingers",iplastic:"iPlastic",katzenmilch:"Katzenmilch",krtheme:"krTheme",lazy:"LAZY",merbivore:"Merbivore",monoindustrial:"monoindustrial",monokai:"Monokai",spacecadet:"SpaceCadet",sunburst:"Sunburst",tomorrow:"Tomorrow",twilight:"Twilight",zenburnesque:"Zenburnesque"};var m=t(80636),v=t(28598);var g=function(e){var n=e.autocompleteProviders,g=e.autoHeight,b=e.autoSave,x=e.fontSize,j=void 0===x?s.i3:x,y=e.height,k=e.language,Z=e.onChange,_=e.onDidChangeCursorPosition,O=e.onSave,C=e.placeholder,w=e.selected,S=e.setSelected,E=e.setTextareaFocused,P=e.shortcuts,T=e.showLineNumbers,I=void 0===T||T,A=e.tabSize,R=void 0===A?4:A,D=e.textareaFocused,M=e.theme,N=e.value,B=e.width,L=void 0===B?"100%":B,F=(0,i.useRef)(null),H=(0,i.useRef)(null),U=(0,i.useRef)(null),z=(0,i.useState)([]),G=z[0],W=z[1],Q=(0,i.useState)(null),q=Q[0],V=Q[1],Y=(0,i.useState)(!1),K=Y[0],X=Y[1],J=(0,i.useState)(y),$=(J[0],J[1],(0,i.useState)(M||a)),ee=$[0],ne=$[1],te=(0,i.useCallback)((function(e){e.languages.typescript.javascriptDefaults.setEagerModelSync(!0),V(e)}),[]),ie=(0,i.useCallback)((function(e,n){F.current=e,H.current=n;var t=[];null===P||void 0===P||P.forEach((function(i){t.push(i(n,e))})),O&&t.push((0,m.e)(n,(function(){O(e.getValue())}))),function(e,n,t){t.forEach((function(e){n.addAction(e)}))}(0,e,t),e.getModel().updateOptions({tabSize:R}),g&&!y&&(e._domElement.style.height="".concat(((N||"").split("\n").length+d.Ep)*d.aU,"px")),e.onDidFocusEditorWidget((function(){null===S||void 0===S||S(!0),null===E||void 0===E||E(!0)})),e.onDidContentSizeChange((function(n){var t=n.contentHeight,i=n.contentHeightChanged;g&&i&&(e._domElement.style.height="".concat(t+2*d.aU,"px"))})),w&&D&&setTimeout((function(){e.focus()}),1),_&&e.onDidChangeCursorPosition((function(n){var t=n.position.lineNumber,i=e._domElement.getBoundingClientRect(),r=i.height,o=i.top;_({editorRect:{height:Number(r),top:Number(o)},position:{lineNumber:Number(t)}})})),X(!0)}),[g,y,_,O,U.current,w,W,X,S,E,P,R,D,N]);(0,i.useEffect)((function(){(function(e){return new Promise((function(n){Promise.all([o._m.init(),t(7432)("./".concat(h[e],".json"))]).then((function(t){var i=(0,p.Z)(t,2),r=i[0],o=i[1];o.colors["editor.background"]="#000000",o.colors["editor.foreground"]="#FFFFFF",r.editor.defineTheme(e,o),n()}))}))})(a).then((function(){ne(a)}))}),[]),(0,i.useEffect)((function(){var e;return b&&O&&(e=setInterval((function(){O(F.current.getValue())}),5e3)),function(){b&&e&&clearInterval(e)}}),[b,F,O]);var re=(0,c.Z)(w),oe=(0,c.Z)(D);return(0,i.useEffect)((function(){null!==F&&void 0!==F&&F.current&&(w&&D?setTimeout((function(){F.current.focus()}),1):r.findDOMNode(F.current._domElement).getElementsByClassName("inputarea")[0].blur())}),[F,w,re,D,oe]),(0,i.useEffect)((function(){return function(){G.map((function(e){return e.dispose()}))}}),[G]),(0,i.useEffect)((function(){q&&n&&(0===G.length&&D||!oe&&D?W((0,f.S_)(q,n)):oe&&!D&&G.map((function(e){return e.dispose()})))}),[n,G,q,D,oe]),(0,v.jsxs)(d.Nk,{style:{display:K?null:"none"},children:[C&&!(null!==N&&void 0!==N&&N.length)&&(0,v.jsx)(d.KT,{children:(0,v.jsx)(l.ZP,{monospace:!0,muted:!0,children:C})}),(0,v.jsx)(o.ZP,{beforeMount:te,height:y,language:k||"python",onChange:function(e){null===Z||void 0===Z||Z(e)},onMount:ie,options:{fontFamily:u.Vp,fontLigatures:!0,fontSize:j,hideCursorInOverviewRuler:!0,lineNumbers:I,minimap:{enabled:!1},overviewRulerBorder:!1,renderLineHighlightOnlyWhenFocus:!0,scrollBeyondLastLine:!1,scrollbar:{alwaysConsumeMouseWheel:!1,vertical:"hidden"},wordBasedSuggestions:!1},theme:ee,value:N,width:L}),(0,v.jsx)("div",{ref:U})]})}},80636:function(e,n,t){"use strict";function i(e,n){return{contextMenuGroupId:"navigation",contextMenuOrder:1.5,id:"saveCode",keybindingContext:null,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],label:"Save",precondition:null,run:function(e){n()}}}function r(e,n){return{contextMenuGroupId:"navigation",contextMenuOrder:1.5,id:"executeCode",keybindingContext:null,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Enter],label:"Run selected block",precondition:null,run:function(){return n()}}}t.d(n,{Q:function(){return r},e:function(){return i}})},62976:function(e,n,t){"use strict";t.d(n,{Z:function(){return D}});var i=t(82394),r=t(21831),o=t(82684),l=t(10919),c=t(12691),a=t.n(c),u=t(34376),s=t.n(u),d=t(9518),f=t(63068),p=t(44628),h=t(6508),m=t(67971),v=t(19711),g=t(23831),b=t(31969),x=function(){var e=document.createElement("div");e.setAttribute("style","width: 100px; height: 100px; overflow: scroll; position:absolute; top:-9999px;"),document.body.appendChild(e);var n=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),n},j=t(2005),y=t(31012),k=t(37391),Z=t(6753),_=t(49125),O=t(20567),C=t(24224),w=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 E(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}var P=2*_.iI+y.dN,T=20*_.iI,I=d.default.div.withConfig({displayName:"DataTable__Styles",componentId:"sc-1arr863-0"})([""," "," "," .body > div{","}.table{border-spacing:0;display:inline-block;"," "," "," "," .tr{.td.td-index-column{","}}.th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;","}.th,.td{"," font-family:",";margin:0;","}.td{padding:","px;}&.sticky{overflow:auto;}.header{overflow:hidden;}}"],(function(e){return e.disableScrolling&&"\n overflow: hidden;\n "}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),k.w5,(function(e){return!e.noBorderBottom&&"\n border-bottom: 1px solid ".concat((e.theme.borders||b.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderLeft&&"\n border-left: 1px solid ".concat((e.theme.borders||b.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||b.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderTop&&"\n border-top: 1px solid ".concat((e.theme.borders||b.Z.borders).medium,";\n ")}),(function(e){return"\n color: ".concat((e.theme.content||b.Z.content).default,";\n ")}),(function(e){return"\n height: ".concat(e.columnHeaderHeight||P,"px;\n ")}),y.iD,j.ry,(function(e){return"\n background-color: ".concat((e.theme.background||b.Z.background).table,";\n border-bottom: 1px solid ").concat((e.theme.borders||b.Z.borders).medium,";\n border-right: 1px solid ").concat((e.theme.borders||b.Z.borders).medium,";\n ")}),1*_.iI);function A(e){var n=e.original,t=8.5*Math.max.apply(Math,(0,r.Z)(n.map((function(e){return(null===e||void 0===e?void 0:e.length)||0})))),i=Math.ceil(t/(T-2*_.iI));return Math.max(i,1)*y.dN+2*_.iI}function R(e){var n=e.columnHeaderHeight,t=e.columns,i=e.data,c=e.disableScrolling,u=e.height,k=e.index,S=e.invalidValues,I=e.maxHeight,R=e.numberOfIndexes,D=e.previewIndexes,M=e.renderColumnHeader,N=e.width,B=(0,o.useContext)(d.ThemeContext),L=(0,o.useRef)(null),F=(0,o.useRef)(null);(0,o.useEffect)((function(){var e=function(e){var n;null===L||void 0===L||null===(n=L.current)||void 0===n||n.scroll(e.target.scrollLeft,0)};return F&&F.current.addEventListener("scroll",e),function(){var n;null===F||void 0===F||null===(n=F.current)||void 0===n||n.removeEventListener("scroll",e)}}),[L,F]);var H=(0,o.useMemo)((function(){return k&&i&&k.length===i.length}),[i,k]),U=(0,o.useMemo)((function(){var e=[];return(0,C.w6)(R).forEach((function(n,t){var o=8.7*String(null===i||void 0===i?void 0:i.length).length;if(H){var l=k.map((function(e){return R>=2?String(e[t]).length:String(e).length}));o=8.7*Math.max.apply(Math,(0,r.Z)(l))}e.push(o+2*_.iI)})),e}),[i,k,R,H]),z=t.map((function(e){return null===e||void 0===e?void 0:e.Header})).slice(1),G=(0,o.useMemo)((function(){return x()}),[]),W=(0,o.useMemo)((function(){var e=N-(Math.max.apply(Math,(0,r.Z)(U))+1.5*_.iI+G),n=t.length-1,i=T;return i*n<e&&(i=e/n),{width:i}}),[t,U,G,N]),Q=(0,p.useTable)({columns:t,data:i,defaultColumn:W},p.useBlockLayout,h.useSticky),q=Q.getTableBodyProps,V=Q.getTableProps,Y=Q.headerGroups,K=Q.prepareRow,X=Q.rows,J=s().query.slug,$=void 0===J?[]:J,ee=new Set((null===D||void 0===D?void 0:D.removedRows)||[]),ne=(0,o.useCallback)((function(e){var n=e.index,t=e.style,i=X[n];K(i);var r=i.original,c=ee.has(n);return(0,w.jsx)("div",E(E({},i.getRowProps({style:E(E({},t),{},{width:"auto"})})),{},{className:"tr",children:i.cells.map((function(e,t){var i,u=t<=R-1,s=e.getCellProps(),d=e.column.id,f=null===S||void 0===S||null===(i=S[d])||void 0===i?void 0:i.includes(n),p=E({},s.style);u&&(p.fontFamily=j.Vp,p.left=0,p.position="sticky",p.textAlign=k?"right":"center",p.width=U[t]);var h,g=r[t-R],x=z.indexOf(d);if(f&&(p.color=b.Z.interactive.dangerBorder),c&&(p.backgroundColor=b.Z.background.danger),Array.isArray(g)||"object"===typeof g)try{g=JSON.stringify(g)}catch(y){g="Error: cannot display value"}return u&&(H?(h=k[n],Array.isArray(h)&&(h=h[t])):h=e.render("Cell")),(0,o.createElement)("div",E(E({},s),{},{className:"td ".concat(u?"td-index-column":""),key:"".concat(t,"-").concat(g),style:p}),h,!u&&(0,w.jsxs)(m.Z,{justifyContent:"space-between",children:[(0,w.jsxs)(v.ZP,{danger:f,default:!0,wordBreak:!0,children:[!0===g&&"true",!1===g&&"false",(null===g||"null"===g)&&"null",!0!==g&&!1!==g&&null!==g&&"null"!==g&&g]}),f&&(0,w.jsx)(a(),{as:(0,O.o_)(Z.mW,x),href:"/datasets/[...slug]",passHref:!0,children:(0,w.jsx)(l.Z,{danger:!0,children:"View all"})})]}))}))}))}),[k,S,U,R,K,X,$]),te=(0,o.useMemo)((function(){var e;return I?(e=(0,C.Sm)(X.map(A)),e+=n||P-y.dN):(e=u,e-=n||P),e}),[n,A,u,I,X]),ie=(0,o.useMemo)((function(){return(0,w.jsx)(f.S_,{estimatedItemSize:P,height:te,itemCount:null===X||void 0===X?void 0:X.length,itemSize:function(e){return A(X[e])},outerRef:F,style:{maxHeight:I,pointerEvents:c?"none":null},children:ne})}),[te,F,ne,X]);return(0,w.jsx)("div",E(E({},V()),{},{className:"table sticky",style:{width:N},children:(0,w.jsxs)("div",E(E({},q()),{},{className:"body",children:[(0,w.jsx)("div",{className:"header",ref:L,children:Y.map((function(e,n){return(0,o.createElement)("div",E(E({},e.getHeaderGroupProps()),{},{className:"tr",key:"".concat(e.id,"_").concat(n)}),e.headers.map((function(e,n){var t,i=n<=R-1,r=e.getHeaderProps(),l=E({},r.style);return i?(l.fontFamily=j.Vp,l.left=0,l.position="sticky",l.textAlign="center",l.width=U[n],l.minWidth=U[n]):M?t=M(e,n-R,{width:W.width}):(t=e.render("Header"),l.color=(B||g.Z).content.default,l.padding=1*_.iI,l.minWidth=W.width),(0,o.createElement)("div",E(E({},r),{},{className:"th",key:e.id,style:l,title:i?"Row number":void 0}),t)})))}))}),ie]}))}))}var D=function(e){var n=e.columnHeaderHeight,t=e.columns,r=e.disableScrolling,l=e.height,c=e.index,a=e.invalidValues,u=e.maxHeight,s=e.noBorderBottom,d=e.noBorderLeft,f=e.noBorderRight,p=e.noBorderTop,h=e.previewIndexes,m=e.renderColumnHeader,v=e.rows,g=e.width,b=(0,o.useMemo)((function(){return null!==c&&void 0!==c&&c.length&&Array.isArray(c[0])?c[0].length:1}),[c]),x=(0,o.useMemo)((function(){return(0,C.w6)(b).map((function(e,n){return{Header:(0,C.w6)(n+1).map((function(){return" "})).join(" "),accessor:function(e,n){return n},sticky:"left"}})).concat(null===t||void 0===t?void 0:t.map((function(e){return{Header:String(e),accessor:String(e)}})))}),[t,b]);return(0,o.useMemo)((function(){return null===v||void 0===v?void 0:v.map((function(e){return e.reduce((function(e,n,r){return E(E({},e),{},(0,i.Z)({},t[r],n))}),{})}))}),[t,v]),(0,w.jsx)(I,{columnHeaderHeight:n,disableScrolling:r,height:l,maxHeight:(u||0)+37,noBorderBottom:s,noBorderLeft:d,noBorderRight:f,noBorderTop:p,children:(0,w.jsx)(R,{columnHeaderHeight:n,columns:x,data:v,disableScrolling:r,height:l,index:c,invalidValues:a,maxHeight:u,numberOfIndexes:b,previewIndexes:h,renderColumnHeader:m,width:g})})}},55106:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var i=t(82394),r=t(75582),o=t(82684),l=t(83455),c=t(9518),a=t(77011),u=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}var f=c.default.div.withConfig({displayName:"MultiFileInput__DropzoneStyle",componentId:"sc-1l6yd2y-0"})(["&:hover{cursor:pointer;}"]);var p=function(e){var n=e.children,t=e.inputOnChange,i=e.inputProps,r=e.onDragActiveChange,l=e.setFiles,c=(0,o.useCallback)((function(e){l(e)}),[l]),s=(0,a.uI)({onDrop:c}),p=s.getInputProps,h=s.getRootProps,m=s.isDragActive,v=p(),g=v.accept,b=v.autoComplete,x=v.multiple,j=v.onChange,y=v.onClick,k=v.ref,Z=v.style,_=v.tabIndex,O=v.type,C=d(d({},i),{},{accept:g,autoComplete:b,multiple:x,onChange:function(e){null===t||void 0===t||t(e),null===i||void 0===i||i.onChange(e),j(e)},onClick:y,ref:k,style:Z,tabIndex:_,type:O});return(0,o.useEffect)((function(){null===r||void 0===r||r(m)}),[m,r]),(0,u.jsxs)(f,d(d({},h()),{},{children:[(0,u.jsx)("input",d(d({},C),{},{directory:"",webkitdirectory:""})),n]}))},h=t(82531);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 v(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 g=function(e){var n=e.children,t=e.directoryPath,c=e.onDragActiveChange,a=e.setFileUploadProgress,s=e.setUploadedFiles,d=(0,l.Db)(h.ZP.files.useCreate({onUploadProgress:function(e,n){var t,r=n.body,o="".concat(null===r||void 0===r?void 0:r.dir_path,"/").concat(null===r||void 0===r||null===(t=r.file)||void 0===t?void 0:t.name);null===a||void 0===a||a((function(n){return v(v({},n),{},(0,i.Z)({},o,e.loaded/e.total))}))}})),f=(0,r.Z)(d,1)[0],m=(0,o.useCallback)((function(e){e.forEach((function(e){var n=e.name,r=e.path.split("/").filter((function(e){return e&&e!==n})).join("/"),o="".concat(t,"/").concat(r),l="".concat(o,"/").concat(n);f({dir_path:o,file:e,overwrite:!1}).then((function(e){var n=e.data,t=n.error,r=n.file;s((function(e){return v(v({},e),{},(0,i.Z)({},l,r||t))}))})),a((function(e){return v(v({},e),{},(0,i.Z)({},l,0))}))}))}),[f,t,a,s]);return(0,u.jsx)(p,{onDragActiveChange:c,setFiles:m,children:n})}},85307:function(e,n,t){"use strict";t.d(n,{$W:function(){return u},cl:function(){return s},cv:function(){return d},dE:function(){return a}});var i=t(9518),r=t(23831),o=t(73942),l=t(49125),c=t(37391),a=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 ")})),u=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-1"})(["padding-top:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||r.Z.background).codeTextarea,";\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-2"})(["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 ")})),d=i.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-3"})(["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 ")}))},64155:function(e,n,t){"use strict";t.d(n,{Eh:function(){return a},ht:function(){return s},t0:function(){return u}});var i=t(9518),r=t(82386),o=t(1286),l=t(31012),c=t(49125),a=(c.iI,o.O$+3*c.iI+l.dN),u=i.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-15ofupc-0"})(["position:relative;width:fit-content;"," ",""],(function(e){return"\n height: calc(100vh - ".concat(r.uX,"px - ").concat(e.heightOffset,"px);\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),s=i.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-15ofupc-1"})(["padding:","px;",""],2*c.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}))},33699:function(e,n,t){"use strict";t.d(n,{y:function(){return R},Z:function(){return D}});var i=t(89565),r=t.n(i),o=t(56085),l=t(82684),c=t(35490),a=t(47999),u=t(67971),s=t(82635),d=t(86673),f=t(54283),p=t(19711),h=t(9518),m=t(23831),v=t(49125),g=t(37391),b=(0,h.css)([""," ",""],(function(e){return!e.width&&"\n width: 100%;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),x=h.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-11d4rgl-0"})([""," "," height:100%;overflow:auto;position:absolute;",""],b,g.w5,(function(e){return"\n background-color: ".concat((e.theme.background||m.Z.background).codeTextarea,";\n ")})),j=h.default.div.withConfig({displayName:"indexstyle__InnerStyle",componentId:"sc-11d4rgl-1"})([""," padding:","px;"],b,v.cd*v.iI),y=h.default.div.withConfig({displayName:"indexstyle__LineStyle",componentId:"sc-11d4rgl-2"})(["height:","px;"],20),k=(0,h.css)(["@keyframes cursor-blink{0%{opacity:0;}}::before{","}::after{","}"],(function(e){return e.focusBeginning&&"\n position: absolute;\n background-color: ".concat((e.theme.accent||m.Z.accent).warning,';\n content: "";\n display: inline-block;\n height: ').concat(20,"px;\n width: ").concat(v.iI,"px;\n opacity: 0.3;\n ")}),(function(e){return e.focused&&"\n background-color: ".concat((e.theme.accent||m.Z.accent).warning,';\n content: "";\n display: inline-block;\n height: ').concat(20,"px;\n width: ").concat(v.iI,"px;\n opacity: 0.3;\n ")})),Z=h.default.div.withConfig({displayName:"indexstyle__InputStyle",componentId:"sc-11d4rgl-3"})(["align-items:center;display:flex;gap:2px;",""],k),_=h.default.span.withConfig({displayName:"indexstyle__CharacterStyle",componentId:"sc-11d4rgl-4"})([""," ::after{","}"],k,(function(e){return e.focused&&"\n position: absolute;\n "})),O=t(16115),C=t(94353),w=t(28799),S=t(51504),E=t(66653),P=t(41150),T=t(28598);function I(e,n){var t="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(!e)return;if("string"===typeof e)return A(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A(e,n)}(e))||n&&e&&"number"===typeof e.length){t&&(e=t);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,c=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return l=e.done,e},e:function(e){c=!0,o=e},f:function(){try{l||null==t.return||t.return()}finally{if(c)throw o}}}}function A(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t<n;t++)i[t]=e[t];return i}var R="terminal";var D=function(e){var n=e.interruptKernel,t=e.onFocus,i=e.uuid,h=void 0===i?R:i,m=e.width,v=(0,l.useRef)(null),g=(0,l.useRef)(null),b=(0,l.useState)(!1),k=b[0],A=b[1],D=(0,l.useState)(""),M=D[0],N=D[1],B=(0,l.useState)(0),L=B[0],F=B[1],H=(0,l.useState)(0),U=H[0],z=H[1],G=(0,l.useState)([]),W=G[0],Q=G[1],q=(0,l.useState)(!1),V=q[0],Y=q[1],K=(0,l.useState)([]),X=K[0],J=K[1],$=(0,o.ZP)((0,w.Ib)(),{shouldReconnect:function(){return!0}}),ee=$.lastMessage,ne=($.readyState,$.sendMessage);(0,l.useEffect)((function(){if(ee){var e=null!==ee&&void 0!==ee&&ee.data?JSON.parse(ee.data):null;(null===e||void 0===e?void 0:e.uuid)===h&&(s.uF.BUSY===(null===e||void 0===e?void 0:e.execution_state)?A(!0):s.uF.IDLE===(null===e||void 0===e?void 0:e.execution_state)&&A(!1),J((function(n){return e?n.concat(e):n})))}}),[ee,A,J,h]),(0,l.useEffect)((function(){if(v.current&&g.current){var e=g.current.getBoundingClientRect().height;v.current.scrollTo(0,e)}}),[X,v,g]);var te=(0,P.y)(),ie=te.registerOnKeyDown,re=te.setDisableGlobalKeyboardShortcuts,oe=te.unregisterOnKeyDown;(0,l.useEffect)((function(){return function(){oe(h)}}),[oe,h]);var le=(0,l.useCallback)((function(){z((function(e){return e>0?e-1:e}))}),[]),ce=(0,l.useCallback)((function(){z((function(e){return e<=M.length?e+1:e}))}),[M]);return ie(h,(function(e,t,i){var r=e.code,o=e.key;if(V)if((0,E.j)(e),(0,S.y)([O.PQ,O.VS],t))A(!1),J((function(e){var n;return e.concat({command:!0,data:(null===M||void 0===M||null===(n=M.trim())||void 0===n?void 0:n.length)>=1?M:"\n",type:s.Gi.TEXT})})),N(""),n();else if(!k)if(O.Qj!==r||t[O.zX])if((0,S.y)([O.QK],t))le();else if((0,S.y)([O.DY],t))ce();else if((0,S.y)([O.Bu],t)){if(W.length>=1){var l=Math.max(0,L-1);N(W[l]),F(l),z(W[l].length)}}else if((0,S.y)([O.kD],t)){if(W.length>=1){var a=Math.min(W.length,L+1),u=W[a]||"";N(u),F(a),z(u.length)}}else if((0,S.y)([O.Uq],t))(null===M||void 0===M?void 0:M.length)>=1&&(A(!0),ne(JSON.stringify({api_key:C.l,code:"!".concat(M),token:(new c.Z).decodedToken.token,uuid:h})),F(W.length+1),Q((function(e){return e.concat(M)})),z(0)),J((function(e){var n;return e.concat({command:!0,data:(null===M||void 0===M||null===(n=M.trim())||void 0===n?void 0:n.length)>=1?M:"\n",type:s.Gi.TEXT})})),N("");else if((0,S.y)([O.zX,O.VS],t))navigator.clipboard.writeText(window.getSelection().toString());else if((0,S.y)([O.zX,O.Pd],t)||(0,S.y)([O.PQ,O.Pd],t)){var d,f;null!==(d=navigator)&&void 0!==d&&null!==(f=d.clipboard)&&void 0!==f&&f.readText?navigator.clipboard.readText().then((function(e){N((function(n){return n+e})),z(M.length+e.length)})).catch((function(e){return alert("".concat(e,'\n For Chrome, users need to allow clipboard permissions for this site under "Privacy and security" -> "Site settings".\n For Safari, users need to allow the clipboard paste by clicking "Paste" in the context menu that appears.'))})):navigator.clipboard.read().then((function(e){var n,t=I(e);try{for(t.s();!(n=t.n()).done;){var i,r=n.value,o=I(r.types);try{for(o.s();!(i=o.n()).done;){var l=i.value;if("text/plain"===l)return r.getType(l)}}catch(c){o.e(c)}finally{o.f()}}}catch(c){t.e(c)}finally{t.f()}})).then((function(e){return e.text()})).then((function(e){N((function(n){return n+e})),z(M.length+e.length)})).catch((function(e){return alert("".concat(e,'\n For Firefox, users need to allow clipboard paste by setting the "dom.events.asyncClipboard.read" preference in "about:config" to "true" and clicking "Paste" in the context menu that appears.'))}))}else t[O.zX]||t[O.PQ]||1!==o.length||(N((function(e){return e.slice(0,U)+o+e.slice(U)})),ce());else{var p=Math.max(0,U-1);N((function(e){return e.slice(0,p)+e.slice(U)})),z((function(e){return Math.max(0,e-1)}))}}),[k,M,W,L,V,n,A,N,Q,F,J,h]),(0,T.jsx)(x,{ref:v,width:m,children:(0,T.jsx)(a.Z,{isOpen:!0,onClick:function(){null===t||void 0===t||t(),Y(!0),re(!0)},onClickOutside:function(){Y(!1),re(!1)},style:{minHeight:"100%"},children:(0,T.jsxs)(j,{ref:g,width:m,children:[null===X||void 0===X?void 0:X.reduce((function(e,n,t){var i=n||{},o=i.command,l=i.data,c=i.type,a=[];a=(a=Array.isArray(l)?l:[l]).filter((function(e){return e}));var d=[];return a.forEach((function(e,n){var i;if(s.jU.includes(c)&&(i=(0,T.jsxs)(p.ZP,{monospace:!0,noWrapping:!0,pre:!0,children:[e&&(0,T.jsx)(r(),{children:e}),!e&&(0,T.jsx)(T.Fragment,{children:"\xa0"})]})),i){var l="command-".concat(t,"-").concat(n,"-").concat(e);o?d.push((0,T.jsx)(y,{children:(0,T.jsxs)(u.Z,{alignItems:"center",children:[(0,T.jsx)(p.ZP,{inline:!0,monospace:!0,warning:!0,children:"\u2192\xa0"}),i]})},l)):d.push((0,T.jsx)(y,{children:i},l))}})),e.concat(d)}),[]),k&&(0,T.jsx)(d.Z,{mt:1,children:(0,T.jsx)(f.Z,{})}),!k&&(0,T.jsx)(Z,{focused:V&&(0===M.length||U>M.length),children:(0,T.jsxs)(p.ZP,{monospace:!0,children:[(0,T.jsx)(p.ZP,{inline:!0,monospace:!0,warning:!0,children:"\u2192\xa0"}),null===M||void 0===M?void 0:M.split("").map((function(e,n){return(0,T.jsxs)(_,{focusBeginning:V&&0===U&&0===n,focused:V&&U===n+1,children:[" "===e&&(0,T.jsx)(T.Fragment,{children:"\xa0"})," "!==e&&e]},"command-".concat(n,"-").concat(e))}))]})})]})})})}},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 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 u(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.style,s=void 0===a?{}:a,d=(0,r.Z)(e,c),f=u({},s);return i&&(f.paddingLeft=i,f.paddingRight=f.paddingLeft),t&&(f.height="100%"),(0,l.jsx)(o.Col,u(u({},d),{},{style:f,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),a=["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 s(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,d=void 0===u?{}:u,f=(0,r.Z)(e,a),p=s({},d);return i&&(p.marginLeft=-1*i,p.marginRight=p.marginLeft),t&&(p.height="100%"),(0,c.jsx)(l.Row,s(s({},f),{},{style:p,children:o.Children.map(n,(function(e,n){return e&&o.cloneElement(e,{gutter:i,key:n})}))}))}},82635:function(e,n,t){"use strict";var i,r;t.d(n,{Gi:function(){return r},jU:function(){return l},uF:function(){return i}}),function(e){e.BUSY="busy",e.IDLE="idle",e.QUEUED="queued"}(i||(i={})),function(e){e.IMAGE_PNG="image/png",e.PROGRESS="progress",e.TABLE="table",e.TEXT="text",e.TEXT_HTML="text/html",e.TEXT_PLAIN="text/plain"}(r||(r={}));var o,l=[r.TEXT,r.TEXT_PLAIN];!function(e){e.DISPLAY_DATA="display_data",e.STATUS="status",e.STREAM="stream",e.STREAM_PIPELINE="stream_pipeline"}(o||(o={}))},93348:function(e,n,t){"use strict";t.d(n,{TR:function(){return d},U5:function(){return a},Xm:function(){return o},Z4:function(){return s},fq:function(){return c},kJ:function(){return u}});var i,r,o,l=t(82394);!function(e){e.API="api",e.EVENT="event",e.TIME="time"}(o||(o={}));var c,a,u,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"}(a||(a={})),function(e){e.CREATED_AT="created_at",e.NAME="name",e.PIPELINE="pipeline_uuid",e.STATUS="status",e.TYPE="schedule_type"}(u||(u={}));var d=(r={},(0,l.Z)(r,u.CREATED_AT,"Created at"),(0,l.Z)(r,u.NAME,"Name"),(0,l.Z)(r,u.PIPELINE,"Pipeline"),(0,l.Z)(r,u.STATUS,"Status"),(0,l.Z)(r,u.TYPE,"Type"),r)},30264:function(e,n,t){"use strict";var i=t(82394),r=t(26304),o=(t(82684),t(47999)),l=t(62084),c=t(28598),a=["children","items","open","onClickCallback","onClickOutside","parentRef","uuid"];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 s(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.items,i=e.open,u=e.onClickCallback,d=e.onClickOutside,f=e.parentRef,p=e.uuid,h=(0,r.Z)(e,a),m=(0,c.jsxs)("div",{style:{position:"relative",zIndex:d?3:2},children:[(0,c.jsx)("div",{ref:f,children:n}),(0,c.jsx)(l.Z,s(s({},h),{},{items:t,onClickCallback:u,open:i,parentRef:f,uuid:p}))]});return d?(0,c.jsx)(o.Z,{onClickOutside:d,open:!0,children:m}):m}},29237:function(e,n,t){"use strict";var i=t(9518),r=t(67971),o=t(86673),l=t(19711),c=t(31969),a=t(73942),u=t(37391),s=t(49125),d=t(28598),f=1.75,p=(0,i.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],f*s.iI,1.5*s.iI,1.5*s.iI),h=i.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," "," "," ",""],a.n_,(function(e){return"\n background-color: ".concat((e.theme.background||c.Z.background).panel,";\n border: 1px solid ").concat((e.theme.interactive||c.Z.interactive).defaultBorder,";\n ")}),(function(e){return!e.fullHeight&&"\n height: fit-content;\n "}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")}),(function(e){return e.minWidth&&"\n min-width: ".concat(e.minWidth,"px;\n\n @media (max-width: ").concat(e.minWidth,"px) {\n min-width: 0;\n }\n ")}),(function(e){return e.borderless&&"\n border: none;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),m=i.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," ",""],a.n_,a.n_,(function(e){return"\n background-color: ".concat((e.theme.background||c.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||c.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),p),v=i.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],f*s.iI,u.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: calc(".concat(e.maxHeight," - ").concat(15*s.iI,"px);\n ")}),(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),g=i.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],a.M8,a.YF,f*s.iI);n.Z=function(e){var n=e.borderless,t=e.children,i=e.containerRef,c=e.contentContainerRef,a=e.footer,u=e.fullHeight,s=void 0===u||u,f=e.header,p=e.headerHeight,b=e.headerIcon,x=e.headerTitle,j=e.maxHeight,y=e.noPadding,k=e.overflowVisible,Z=e.subtitle,_=e.minWidth;return(0,d.jsxs)(h,{borderless:n,fullHeight:s,maxHeight:j,minWidth:_,overflowVisible:k,ref:i,children:[(f||x)&&(0,d.jsxs)(m,{height:p,children:[f&&f,x&&(0,d.jsx)(r.Z,{alignItems:"center",justifyContent:"space-between",children:(0,d.jsxs)(r.Z,{alignItems:"center",children:[b&&b,(0,d.jsx)(o.Z,{ml:b?1:0,children:(0,d.jsx)(l.ZP,{bold:!0,default:!0,children:x})})]})})]}),(0,d.jsxs)(v,{maxHeight:j,noPadding:y,overflowVisible:k,ref:c,children:[Z&&(0,d.jsx)(o.Z,{mb:2,children:(0,d.jsx)(l.ZP,{default:!0,children:Z})}),t]}),a&&(0,d.jsx)(g,{children:a})]})}},32316:function(e,n,t){"use strict";t.d(n,{Z:function(){return h}});var i=t(82684),r=t(60328),o=t(67971),l=t(882),c=t(86673),a=t(99994),u=t(9518),s=t(49125),d=t(37391),f=u.default.div.withConfig({displayName:"indexstyle__TabsContainerStyle",componentId:"sc-segf7l-0"})(["padding-left:","px;padding-right:","px;"," "," ",""],s.cd*s.iI,s.cd*s.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.allowScroll&&"\n overflow: auto;\n "}),d.w5),p=t(28598);var h=function(e){var n=e.allowScroll,t=e.contained,u=e.noPadding,d=e.onClickTab,h=e.selectedTabUUID,m=e.tabs,v=(0,i.useMemo)((function(){var e=m.length,n=[];return m.forEach((function(t,i){var u=t.Icon,f=t.IconSelected,m=t.label,v=t.uuid,g=v===h,b=g&&f||u,x=m?m():v,j=(0,p.jsxs)(o.Z,{alignItems:"center",children:[b&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(b,{default:!g,size:2*s.iI}),(0,p.jsx)(c.Z,{mr:1})]}),x]});i>=1&&e>=2&&n.push((0,p.jsx)("div",{style:{marginLeft:1.5*s.iI}},"spacing-".concat(v))),g?n.push((0,p.jsx)(l.Z,{backgroundGradient:a.yr,backgroundPanel:!0,borderLess:!0,borderWidth:2,onClick:function(){return d(t)},paddingUnitsHorizontal:2,paddingUnitsVertical:1.25,children:j},v)):n.push((0,p.jsx)("div",{style:{padding:4},children:(0,p.jsx)(r.Z,{borderLess:!0,default:!0,onClick:function(){return d(t)},outline:!0,children:j},"button-tab-".concat(v))}))})),n}),[d,h,m]),g=(0,p.jsx)(o.Z,{alignItems:"center",children:v});return t?g:(0,p.jsx)(f,{allowScroll:n,noPadding:u,children:g})}},82944:function(e,n,t){"use strict";var i=t(82394),r=t(91835),o=t(82684),l=t(9518),c=t(69898),a=t(28598);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 s(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}var d=l.default.input.withConfig({displayName:"TextInput__TextInputStyle",componentId:"sc-1ii4qtc-0"})(["",""],c.p),f=function(e,n){var t=(0,r.Z)({},e);return(0,a.jsx)(c.Z,s(s({},t),{},{input:(0,a.jsx)(d,s({},t)),ref:n}))};n.Z=o.forwardRef(f)},46714:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Cc}});var i,r=t(77837),o=t(21831),l=t(75582),c=t(82394),a=t(38860),u=t.n(a),s=t(56085),d=t(82684),f=t(83455),p=t(34376),h=t(86422),m=t(62084),v="buckets",g="chart_style",b="group_by",x="height",j="index",y="legend_labels",k="limit",Z="metrics",_="time_interval",O="width_percentage",C="x",w="y",S="y_sort_order",E="data_provider",P="data_provider_database",T="data_provider_profile",I="data_provider_schema",A="data_provider_table",R="dbt_project_name",D="dbt_profile_target",M="export_write_policy",N="use_raw_sql",B=[C,w];!function(e){e.BAR_CHART="bar chart",e.HISTOGRAM="histogram",e.LINE_CHART="line chart",e.PIE_CHART="pie chart",e.TABLE="table",e.TIME_SERIES_BAR_CHART="time series bar chart",e.TIME_SERIES_LINE_CHART="time series line chart"}(i||(i={}));var L,F,H=[i.BAR_CHART,i.HISTOGRAM,i.LINE_CHART,i.PIE_CHART,i.TABLE,i.TIME_SERIES_BAR_CHART,i.TIME_SERIES_LINE_CHART];!function(e){e.HORIZONTAL="horizontal",e.VERTICAL="vertical"}(L||(L={})),function(e){e.AVERAGE="average",e.COUNT="count",e.COUNT_DISTINCT="count_distinct",e.MAX="max",e.MEDIAN="median",e.MIN="min",e.MODE="mode",e.SUM="sum"}(F||(F={}));var U,z,G,W,Q,q,V,Y,K,X=[F.AVERAGE,F.COUNT,F.COUNT_DISTINCT,F.MAX,F.MEDIAN,F.MIN,F.MODE,F.SUM];!function(e){e.ASCENDING="ascending",e.DESCENDING="descending"}(U||(U={})),function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.MONTH="month",e.ORIGINAL="original",e.SECOND="second",e.WEEK="week",e.YEAR="year"}(z||(z={})),function(e){e.COLUMNS="columns",e.METRICS="metrics",e.NUMBER="number"}(K||(K={}));var J={noCode:[{label:function(){return"time column"},settings:{maxValues:1},type:K.COLUMNS,uuid:b},{label:function(){return"time interval"},options:[z.ORIGINAL,z.SECOND,z.MINUTE,z.HOUR,z.DAY,z.WEEK,z.MONTH,z.YEAR],uuid:_},{label:function(){return"metrics"},type:K.METRICS,uuid:Z}]},$=(G={},(0,c.Z)(G,i.BAR_CHART,{noCode:[{label:function(){return"group by columns"},type:K.COLUMNS,uuid:b},{label:function(){return"metrics"},type:K.METRICS,uuid:Z},{autoRun:!0,label:function(){return"chart style"},options:[L.HORIZONTAL,L.VERTICAL],uuid:g},{autoRun:!0,label:function(){return"sort direction"},options:[null,U.ASCENDING,U.DESCENDING],uuid:S}],code:[{label:function(){return"variable name of x-axis values"},monospace:!0,uuid:C},{label:function(){return"variable name of y-axis values"},monospace:!0,uuid:w}]}),(0,c.Z)(G,i.HISTOGRAM,{noCode:[{label:function(){return"number column for chart"},settings:{maxValues:1},type:K.COLUMNS,uuid:b},{autoRun:!0,label:function(){return"Number of buckets"},type:K.NUMBER,uuid:v}],code:[{label:function(){return"variable name of values"},monospace:!0,uuid:C}]}),(0,c.Z)(G,i.LINE_CHART,{noCode:[{label:function(){return"group by columns"},settings:{maxValues:1},type:K.COLUMNS,uuid:b},{label:function(){return"metrics"},type:K.METRICS,uuid:Z}],code:[{label:function(){return"variable name of x-axis values"},monospace:!0,uuid:C},{label:function(){return"variable name of y-axis values"},monospace:!0,uuid:w},{label:function(){return"labels of lines in chart (comma separated)"},uuid:y}]}),(0,c.Z)(G,i.PIE_CHART,{noCode:[{label:function(){return"column for chart"},settings:{maxValues:1},type:K.COLUMNS,uuid:b},{autoRun:!0,label:function(){return"Number of slices"},type:K.NUMBER,uuid:v}],code:[{label:function(){return"variable name of values"},monospace:!0,uuid:C}]}),(0,c.Z)(G,i.TABLE,{noCode:[{label:function(){return"columns"},type:K.COLUMNS,uuid:b},{label:function(){return"max number of rows"},type:K.NUMBER,uuid:k}],code:[{label:function(){return"variable name of columns"},monospace:!0,uuid:C},{label:function(){return"variable name of rows"},monospace:!0,uuid:w}]}),(0,c.Z)(G,i.TIME_SERIES_BAR_CHART,J),(0,c.Z)(G,i.TIME_SERIES_LINE_CHART,J),G),ee=(W={},(0,c.Z)(W,i.BAR_CHART,{configuration:function(e){var n;return n={},(0,c.Z)(n,C,"x"),(0,c.Z)(n,w,"y"),(0,c.Z)(n,g,L.VERTICAL),n},content:function(e){return"columns = df_1.columns\nx = df_1.columns[:7]\ny = [[v] for v in [len(df_1[col].unique()) for col in x]]\n"}}),(0,c.Z)(W,i.HISTOGRAM,{configuration:function(e){var n;return n={},(0,c.Z)(n,v,10),(0,c.Z)(n,C,"x"),n},content:function(e){return"columns = df_1.columns\ncol = list(filter(lambda x: df_1[x].dtype == float or df_1[x].dtype == int, columns))[0]\nx = df_1[col]\n"}}),(0,c.Z)(W,i.LINE_CHART,{configuration:function(e){var n;return n={},(0,c.Z)(n,C,"x"),(0,c.Z)(n,w,"y"),n},content:function(e){return"columns = df_1.columns\ncols = list(filter(lambda x: df_1[x].dtype == float or df_1[x].dtype == int, columns))\nx = df_1[cols[0]]\ny = [df_1[cols[1]]]\n"}}),(0,c.Z)(W,i.PIE_CHART,{configuration:function(e){var n;return n={},(0,c.Z)(n,v,7),(0,c.Z)(n,C,"x"),n},content:function(e){return"x = df_1[df_1.columns[0]]"}}),(0,c.Z)(W,i.TABLE,{configuration:function(e){var n;return n={},(0,c.Z)(n,k,10),(0,c.Z)(n,C,"x"),(0,c.Z)(n,w,"y"),n},content:function(e){return"x = df_1.columns\ny = df_1.to_numpy()"}}),(0,c.Z)(W,i.TIME_SERIES_BAR_CHART,{configuration:function(e){return(0,c.Z)({},_,z.ORIGINAL)}}),(0,c.Z)(W,i.TIME_SERIES_LINE_CHART,{configuration:function(e){return(0,c.Z)({},_,z.ORIGINAL)}}),W),ne=(Y={},(0,c.Z)(Y,i.BAR_CHART,(Q={},(0,c.Z)(Q,C,(function(){return"must be a list of booleans, dates, integers, floats, or strings."})),(0,c.Z)(Q,w,(function(){return"must be a list of lists containing integers or floats."})),Q)),(0,c.Z)(Y,i.HISTOGRAM,(0,c.Z)({},C,(function(){return"must be a list of integers or floats."}))),(0,c.Z)(Y,i.LINE_CHART,(q={},(0,c.Z)(q,C,(function(){return"must be a list of integers or floats."})),(0,c.Z)(q,w,(function(){return"must be a list of lists containing integers or floats. Each list is a single line in the chart."})),q)),(0,c.Z)(Y,i.PIE_CHART,(0,c.Z)({},C,(function(){return"must be a list of booleans, dates, integers, floats, or strings."}))),(0,c.Z)(Y,i.TABLE,(V={},(0,c.Z)(V,C,(function(){return"must be a list of strings."})),(0,c.Z)(V,w,(function(){return"must be a list of lists containing booleans, dates, integers, floats, or strings."})),V)),Y),te=[{label:function(){return"% of missing values"},widgetTemplate:function(e){var n,t=e.block;return{name:"missing values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,c.Z)(n,C,"columns_with_mising_values"),(0,c.Z)(n,w,"percentage_of_missing_values"),(0,c.Z)(n,g,L.HORIZONTAL),(0,c.Z)(n,S,U.DESCENDING),(0,c.Z)(n,"chart_type",i.BAR_CHART),n),content:"number_of_rows = len(df_1.index)\ncolumns_with_mising_values = []\npercentage_of_missing_values = []\nfor col in df_1.columns:\n missing = df_1[col].isna().sum()\n if missing > 0:\n columns_with_mising_values.append(col)\n percentage_of_missing_values.append(100 * missing / number_of_rows)\n"}}},{label:function(){return"Unique values"},widgetTemplate:function(e){var n,t=e.block;return{name:"unique values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,c.Z)(n,C,"columns"),(0,c.Z)(n,w,"number_of_unique_values"),(0,c.Z)(n,g,L.HORIZONTAL),(0,c.Z)(n,S,U.DESCENDING),(0,c.Z)(n,"chart_type",i.BAR_CHART),n),content:"columns = df_1.columns\nnumber_of_unique_values = [df_1[col].nunique() for col in columns]\n"}}},{label:function(){return"Most frequent values"},widgetTemplate:function(e){var n,t=e.block;return{name:"most frequent values for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,c.Z)(n,x,3e3),(0,c.Z)(n,j,"column_index"),(0,c.Z)(n,C,"columns"),(0,c.Z)(n,w,"rows"),(0,c.Z)(n,"chart_type",i.TABLE),n),content:"columns = ['mode value', 'frequency', '% of values']\n\ncolumn_index = []\nrows = []\nfor col in df_1.columns:\n value_counts = df_1[col].value_counts()\n if len(value_counts.index) == 0:\n continue\n column_value = value_counts.index[0]\n value = value_counts[column_value]\n number_of_rows = df_1[col].count()\n column_index.append(col)\n rows.append([\n column_value,\n f'{round(100 * value / number_of_rows, 2)}%',\n value,\n ])\n"}}},{label:function(){return"Summary overview"},widgetTemplate:function(e){var n,t=e.block;return{name:"summary overview for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,c.Z)(n,x,3e3),(0,c.Z)(n,j,"stats"),(0,c.Z)(n,C,"headers"),(0,c.Z)(n,w,"rows"),(0,c.Z)(n,"chart_type",i.TABLE),n),content:"from mage_ai.data_cleaner.column_types.column_type_detector import infer_column_types\n\n\nheaders = ['value']\nstats = ['Columns', 'Rows']\nrows = [[len(df_1.columns)], [len(df_1.index)]]\n\ncol_counts = {}\nfor col, col_type in infer_column_types(df_1).items():\n col_type_name = col_type.value\n if not col_counts.get(col_type_name):\n col_counts[col_type_name] = 0\n col_counts[col_type_name] += 1\n\nfor col_type, count in sorted(col_counts.items()):\n stats.append(f'# of {col_type}')\n rows.append([count])\n"}}},{label:function(){return"Feature profiles"},widgetTemplate:function(e){var n,t=e.block;return{name:"feature profiles for ".concat(null===t||void 0===t?void 0:t.uuid),configuration:(n={},(0,c.Z)(n,x,3e3),(0,c.Z)(n,j,"stats"),(0,c.Z)(n,C,"columns"),(0,c.Z)(n,w,"rows"),(0,c.Z)(n,"chart_type",i.TABLE),n),content:"from mage_ai.data_cleaner.column_types.column_type_detector import infer_column_types\nimport statistics\n\n\ncolumns_and_types = infer_column_types(df_1).items()\ncolumns = [t[0] for t in columns_and_types]\nstats = ['Type', 'Missing values', 'Unique values', 'Min', 'Max', 'Mean', 'Median', 'Mode']\nrows = [[] for _ in stats]\n\nfor col, col_type in columns_and_types:\n series = df_1[col]\n min_value = None\n max_value = None\n mean = None\n median = None\n\n not_null = series[series.notnull()]\n\n if col_type.value in ['number', 'number_with_decimals']:\n count = len(not_null.index)\n if count >= 1:\n mean = round(not_null.sum() / count, 2)\n median = sorted(not_null)[int(count / 2)]\n min_value = round(series.min(), 2)\n max_value = round(series.max(), 2)\n else:\n min_value = not_null.astype(str).min()\n max_value = not_null.astype(str).max()\n\n _, mode = sorted(\n [(v, k) for k, v in not_null.value_counts().items()],\n reverse=True,\n )[0]\n\n for idx, value in enumerate([\n col_type.value,\n len(series[series.isna()].index),\n len(series.unique()),\n min_value,\n max_value,\n mean,\n median,\n mode,\n ]):\n rows[idx].append(value)\n"}}}],ie=t(49125),re=t(90211),oe=t(28598);function le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ce(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?le(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):le(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ae=function(e){var n=e.addWidget,t=e.block,i=e.left,r=e.rightOffset,l=e.onClickCallback,c=e.open,a=e.parentRef,u=e.runBlock,s=e.topOffset,f=(0,d.useMemo)((function(){return H.map((function(e){var i,r,o={configuration:{chart_type:e},language:t.language,type:h.tf.CHART,upstream_blocks:t?[t.uuid]:null},l=ee[e],c=(null===l||void 0===l||null===(i=l.configuration)||void 0===i?void 0:i.call(l,o))||{},a=h.t6.SQL===(null===t||void 0===t?void 0:t.language)?null:(null===l||void 0===l||null===(r=l.content)||void 0===r?void 0:r.call(l,o))||null,s=e;return t&&(s="".concat(s," for ").concat(t.uuid)),{label:function(){return(0,re.vg)(e)},onClick:function(){return n(ce(ce({},o),{},{name:"".concat(s," ").concat((0,re.Mp)()),configuration:ce(ce({},o.configuration),c),content:a}),{onCreateCallback:function(e){t&&h.t6.SQL!==t.language&&([h.DA.EXECUTED,h.DA.UPDATED].includes(t.status)?u({block:e,code:a,disableReset:!0}):u({block:t,runDownstream:!0}))}})},uuid:e}}))}),[H,t,u]),p=(0,d.useMemo)((function(){return te.map((function(e){var i=e.label,r=ce(ce({},(0,e.widgetTemplate)({block:t})),{},{language:t.language,type:h.tf.CHART,upstream_blocks:t?[t.uuid]:null});return{label:i,onClick:function(){return n(r,{onCreateCallback:function(e){t&&h.t6.SQL!==t.language&&([h.DA.EXECUTED,h.DA.UPDATED].includes(t.status)?u({block:e,code:e.content,disableReset:!0}):u({block:t,runDownstream:!0}))}})},uuid:i()}}))}),[te,n,t,u]),v=[{isGroupingTitle:!0,label:function(){return"Custom charts"},uuid:"custom_charts"}].concat((0,o.Z)(f));return h.t6.SQL!==t.language&&v.push.apply(v,[{isGroupingTitle:!0,label:function(){return"Templates"},uuid:"chart_templates"}].concat((0,o.Z)(p))),(0,oe.jsx)(m.Z,{items:v,left:i,onClickCallback:l,open:c,parentRef:a,rightOffset:r,topOffset:s,uuid:"CommandButtons/add_charts",width:25*ie.iI})},ue=t(35490),se=t(60328),de=t(47999),fe=t(38341),pe=t(67971),he=t(11135),me=t(29237),ve=t(98781),ge=t(86673),be=t(19711),xe=t(82944),je=t(16115),ye=t(11366),ke=t(91427),Ze=t(51504);var _e,Oe,Ce,we,Se=function(e){var n=e.block,t=e.defaultName,i=e.onClose,r=e.onSave,o=e.pipeline,l=(0,d.useRef)(null),c=(0,d.useState)(t),a=c[0],u=c[1],s=(0,d.useState)(!!(0,ke.U2)(ye.k)),f=s[0],p=s[1];(0,d.useEffect)((function(){var e;null===l||void 0===l||null===(e=l.current)||void 0===e||e.focus()}),[]);var m=(0,d.useMemo)((function(){return ve.q.INTEGRATION===(null===o||void 0===o?void 0:o.type)}),[o]),v=(0,d.useMemo)((function(){var e=null===n||void 0===n?void 0:n.type;if(m){if(h.tf.DATA_LOADER===e)return"Source";if(h.tf.DATA_EXPORTER===e)return"Destination"}return h.V4[e]}),[n,m]);return(0,oe.jsxs)(me.Z,{children:[(0,oe.jsxs)(be.ZP,{bold:!0,children:[v," block name"]}),(0,oe.jsx)(ge.Z,{mt:1,children:(0,oe.jsx)(xe.Z,{monospace:!0,onChange:function(e){return u(e.target.value)},ref:l,value:a})}),(0,oe.jsx)(ge.Z,{mt:2,children:(0,oe.jsx)(pe.Z,{alignItems:"center",children:(0,oe.jsx)(fe.Z,{checked:f,label:(0,oe.jsxs)(be.ZP,{muted:!0,small:!0,children:["Automatically use randomly generated name",(0,oe.jsx)("br",{}),"for blocks created in the future"]}),onClick:function(){p(!f),(0,ke.t8)(ye.k,!f)}})})}),(0,oe.jsx)(ge.Z,{mt:3,children:(0,oe.jsxs)(pe.Z,{children:[(0,oe.jsx)(he.ZP,{bold:!0,inline:!0,keyboardShortcutValidation:function(e){var n=e.keyMapping;return(0,Ze.y)([je.Uq],n)},onClick:function(){return r({name:a||t})},primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:"Save and add block"}),(0,oe.jsx)(ge.Z,{ml:1,children:(0,oe.jsx)(se.Z,{onClick:i,tabIndex:0,children:"Cancel"})})]})})]})},Ee=t(26304),Pe=t(9518),Te=t(16634);!function(e){e.JSON="json",e.PY="py",e.R="r",e.SQL="sql",e.TXT="txt",e.YAML="yaml",e.YML="yml"}(Ce||(Ce={})),function(e){e.INIT_PY="__init__.py",e.METADATA_YAML="metadata.yaml",e.REQS_TXT="requirements.txt"}(we||(we={}));var Ie,Ae,Re=[Ce.PY,Ce.SQL],De=[Ce.JSON,Ce.PY,Ce.R,Ce.SQL,Ce.TXT,Ce.YAML,Ce.YML],Me=new RegExp(De.map((function(e){return".".concat(e,"$")})).join("|")),Ne=De.concat(Ce.PY),Be=new RegExp(Ne.map((function(e){return".".concat(e,"$")})).join("|")),Le="charts",Fe="pipelines",He=(_e={},(0,c.Z)(_e,Ce.JSON,Ce.JSON),(0,c.Z)(_e,Ce.PY,h.t6.PYTHON),(0,c.Z)(_e,Ce.R,h.t6.R),(0,c.Z)(_e,Ce.SQL,h.t6.SQL),(0,c.Z)(_e,Ce.TXT,"text"),(0,c.Z)(_e,Ce.YAML,h.t6.YAML),(0,c.Z)(_e,Ce.YML,h.t6.YAML),_e),Ue=(Oe={},(0,c.Z)(Oe,h.t6.PYTHON,Ce.PY),(0,c.Z)(Oe,h.t6.R,Ce.R),(0,c.Z)(Oe,h.t6.SQL,Ce.SQL),(0,c.Z)(Oe,h.t6.YAML,Ce.YAML),(0,c.Z)(Oe,"text",Ce.TXT),Oe),ze=t(10503),Ge=t(43032),We="sideview";!function(e){e.CHARTS="charts",e.DATA="data",e.GRAPHS="graphs",e.REPORTS="reports",e.SECRETS="secrets",e.TERMINAL="terminal",e.TREE="tree",e.VARIABLES="variables"}(Ae||(Ae={}));var Qe=[Ae.CHARTS,Ae.DATA,Ae.REPORTS,Ae.TREE],qe=[Ae.DATA,Ae.REPORTS,Ae.GRAPHS],Ve=[{key:Ae.TREE,label:"Tree"},{key:Ae.CHARTS,label:"Charts"},{key:Ae.VARIABLES,label:"Variables"},{key:Ae.SECRETS,label:"Secrets"},{key:Ae.DATA,label:"Data"},{key:Ae.TERMINAL,label:"Terminal"}],Ye=(Ie={},(0,c.Z)(Ie,Ae.CHARTS,ze.er),(0,c.Z)(Ie,Ae.DATA,ze.t1),(0,c.Z)(Ie,Ae.GRAPHS,ze.er),(0,c.Z)(Ie,Ae.REPORTS,ze.Do),(0,c.Z)(Ie,Ae.SECRETS,ze.EK),(0,c.Z)(Ie,Ae.TREE,ze.BJ),(0,c.Z)(Ie,Ae.VARIABLES,ze.KJ),Ie),Ke=t(44162);function Xe(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=n||(null===e||void 0===e?void 0:e.name);return null!==e&&void 0!==e&&e.parent?Xe(e.parent,"".concat(e.parent.name,"/").concat(t)):t}function Je(e){return e.split("/").slice(1).join("/")}function $e(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=Xe(e,n);return Je(t)}function en(e){var n,t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=Xe(e,i).split("/");if(!r)return null;if(1===r.length)(r=null===e||void 0===e||null===(t=e.path)||void 0===t?void 0:t.split("/"))&&(n=r[0]===h.tf.CUSTOM?r[0]:(0,re.C5)(r[0]||""));else if(r[1]===h.tf.CUSTOM)n=r[1];else{var o=r[1];n=h.tf.DBT===o?o:(0,re.C5)(o||"")}if(!r)return null;var l="";l=r.length>=3?r.slice(2,r.length).join("/"):r[r.length-1];var c=[".".concat(Ce.PY),".".concat(Ce.R),".".concat(Ce.SQL),".".concat(Ce.YAML),".".concat(Ce.YML)].join("|"),a=new RegExp("".concat(c,"$"));if(h.$W.concat(h.tf.DBT).includes(n)&&l.match(a)){var u=l.split("."),s=u[1];return{language:He[s],type:n,uuid:u[0]}}}function nn(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=Xe(e,n).split("/");if(t[1]){var i=(0,re.C5)(t[n?0:1]);t[1]===h.tf.DBT&&(i=h.tf.DBT);var r=t[t.length-1],o=new RegExp(".".concat(Ce.YAML,"$")),l=new RegExp(".".concat(Ce.R,"$")),c=new RegExp(".".concat(Ce.SQL,"$"));if(r.match(o)&&h.VZ.includes(i))return{type:i,uuid:r.replace(o,"")};if(r.match(l)&&h.J8.includes(i))return{type:i,uuid:r.replace(l,"")};if(r.match(c)&&h.HX.includes(i)){var a=r.replace(/[.]/g,"_"),u=i===h.tf.DBT?t.slice(2,-1).join("_").concat("_".concat(a)):r.replace(c,"");return{type:i,uuid:u}}}}var tn=t(24224);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,c.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="default_repo";var cn=function e(n){var t=n.allowSelectingFolders,i=n.containerRef,r=n.disableContextMenu,o=n.file,l=n.isFileDisabled,c=n.level,a=n.onSelectBlockFile,u=n.onlyShowChildren,s=n.openFile,f=n.openPipeline,p=n.openSidekickView,m=n.pipelineBlockUuids,v=n.selectFile,g=n.setContextItem,b=n.setCoordinates,x=n.setDraggingFile,j=n.setSelectedFile,y=n.theme,k=n.timeout,Z=n.uncollapsed,_=n.useRootFolder,O=o.children,C=o.disabled,w=o.name,S=o.parent;w||(o.name=ln);var E,P=_?Xe(o):$e(o),T=(null===S||void 0===S?void 0:S.name)===Fe,I=(0,d.useMemo)((function(){return O?(0,tn.YC)(O,(function(e){return e.children?0:1})):O}),[O]),A=l?l(P,I):C||"__init__.py"===w||!(null===w||void 0===w||!w.match(/^\./))||!w.match(Be)&&!O,R="".concat(c,"/").concat(w),D=(m.includes(function(e){var n=e.name.split("."),t=n[n.length-1];return Re.includes(t)&&n.pop(),n.join("")}(o)),(0,d.useState)("undefined"===typeof Z?(0,ke.U2)(R,!1):!Z)),M=D[0],N=D[1],B=ze.iU;1===c&&w===Fe?B=ze.B_:w===Le?B=ze.er:I&&(B=ze.gt),I&&h.$W.includes((0,re.C5)(w))&&(0,re.C5)(w)!==h.tf.CHART&&(E=(0,Ke.qn)((0,re.C5)(w),{theme:y}).accent);var L=(0,d.useMemo)((function(){return null===I||void 0===I?void 0:I.map((function(n){return(0,oe.jsx)(e,{allowSelectingFolders:t,containerRef:i,disableContextMenu:r,file:on(on({},n),{},{parent:o}),isFileDisabled:l,level:u?c:c+1,onSelectBlockFile:a,openFile:s,openPipeline:f,openSidekickView:p,pipelineBlockUuids:m,selectFile:v,setContextItem:g,setCoordinates:b,setDraggingFile:x,setSelectedFile:j,theme:y,timeout:k,uncollapsed:Z,useRootFolder:_},"".concat(R,"/").concat((null===n||void 0===n?void 0:n.name)||ln))}))}),[t,i,I,r,o,l,c,a,u,s,f,p,m,v,g,y,k,Z,_,R]);return(0,oe.jsxs)(oe.Fragment,{children:[!u&&(0,oe.jsxs)("div",{className:"row",onClick:function(e){if(e.preventDefault(),!A){if((null===S||void 0===S?void 0:S.name)===Le){null===p||void 0===p||p(Ae.CHARTS);var n=en(o);n&&(null===a||void 0===a||a(n.uuid,n.type,$e(o)))}var i=nn(o);if(I)t?v(P):N((function(e){return(0,ke.t8)(R,!e),!e}));else if(i)null===a||void 0===a||a(i.uuid,i.type,$e(o));else if(w.match(Me))s(P);else{var r=en(o);r&&(null===a||void 0===a||a(r.uuid,r.type,$e(o)))}}},onContextMenu:function(e){var n;clearTimeout(k.current);var t=en(o);null===i||void 0===i||null===(n=i.current)||void 0===n||!n.contains(e.target)||!t&&"undefined"===typeof I||r||(e.preventDefault(),b(A?null:{x:e.pageX,y:e.pageY}),x(null),j(A?null:o),A||T||I||w.match(Me)||we.INIT_PY)},onMouseDown:function(e){var n,t=o?en(o):null;null===i||void 0===i||null===(n=i.current)||void 0===n||!n.contains(e.target)||!t||(null===I||void 0===I?void 0:I.length)>=1||r||A||T||(e.preventDefault(),clearTimeout(k.current),k.current=setTimeout((function(){b({x:e.pageX,y:e.pageY}),x(o),j(null)}),300))},style:{alignItems:"center",cursor:"default",display:"flex",minWidth:c*Ge.Cl+o.name.length*ie.Fo+2*ie.iI,paddingBottom:ie.iI/4,paddingLeft:ie.iI/4+Ge.Cl*c,paddingRight:ie.iI/4,paddingTop:ie.iI/4},children:[I&&!M&&(0,oe.jsx)(ze._M,{muted:!0,size:Ge.ZG}),I&&M&&(0,oe.jsx)(ze._Q,{muted:!0,size:Ge.ZG}),!I&&(0,oe.jsx)("div",{style:{width:Ge.ZG}}),(0,oe.jsxs)("div",{style:{marginLeft:ie.iI/2,marginRight:ie.iI/2},children:[!E&&(0,oe.jsx)(B,{disabled:A,size:Ge.ZG}),E&&(0,oe.jsx)(Te.Z,{color:E,size:Ge.ZG,square:!0})]}),(0,oe.jsx)(be.ZP,{color:E,default:!E&&!A,disabled:A,monospace:!0,small:!0,children:w})]}),(0,oe.jsx)("div",{style:{display:M?"none":"block"},children:L})]})},an=t(82531);var un=function(e){var n=e.fetchFileTree,t=e.onCancel,i=e.selectedFolder,r=e.setErrors,o=(0,d.useRef)(null),c=(0,d.useState)(""),a=c[0],u=c[1],s=(0,d.useState)(""),p=s[0],h=s[1];(0,d.useEffect)((function(){var e;null===o||void 0===o||null===(e=o.current)||void 0===e||e.focus()}),[]),(0,d.useEffect)((function(){i&&u($e(i))}),[i]);var m=(0,f.Db)(an.ZP.files.useCreate()),v=(0,l.Z)(m,1)[0];return(0,oe.jsxs)(me.Z,{footer:(0,oe.jsxs)(pe.Z,{children:[(0,oe.jsx)(he.ZP,{bold:!0,disabled:!(p&&a),inline:!0,keyboardShortcutValidation:function(e){var n=e.keyMapping;return(0,Ze.y)([je.Uq],n)},onClick:function(){v({file:{dir_path:a,name:p,overwrite:!1},file_json_only:!0}).then((function(e){var i=e.data,o=i.error;o?null===r||void 0===r||r({errors:{messages:[o.message]},response:i}):(t(),null===n||void 0===n||n())}))},primary:!0,tabIndex:0,uuid:"NewFile/create_file",children:"Create file"}),(0,oe.jsx)(ge.Z,{ml:1,children:(0,oe.jsx)(se.Z,{onClick:function(){return t()},tabIndex:0,children:"Cancel"})})]}),headerTitle:"New file",children:[(0,oe.jsx)(xe.Z,{label:"Directory",monospace:!0,onChange:function(e){return u(e.target.value)},required:!0,setContentOnMount:!0,value:a}),(0,oe.jsx)(ge.Z,{mt:2,children:(0,oe.jsx)(xe.Z,{label:"Filename",monospace:!0,onChange:function(e){return h(e.target.value)},ref:o,required:!0,value:p})})]})},sn=t(55106),dn=t(66176),fn=t(87815),pn=t(23831),hn=t(73942),mn=(ie.iI,Pe.default.div.withConfig({displayName:"indexstyle__DropZoneStyle",componentId:"sc-1g3zz7z-0"})(["border-radius:","px;padding:","px;max-width:","px;min-width:","px;",""],hn.n_,8*ie.iI,100*ie.iI,55*ie.iI,(function(e){return"\n border: 1px dashed ".concat((e.theme.borders||pn.Z.borders).contrast,";\n ")}))),vn=Pe.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-1g3zz7z-1"})(["max-width:","px;min-width:","px;"],100*ie.iI,55*ie.iI),gn=t(7715);var bn=function(e){var n=e.fetchFileTree,t=e.onCancel,i=e.selectedFolder,r=(0,d.useState)(!1),o=r[0],c=r[1],a=(0,d.useState)({}),u=a[0],s=a[1],f=(0,d.useState)({}),p=f[0],h=f[1],m=!(0,gn.Qr)(u),v=(0,d.useMemo)((function(){var e=[];return(0,tn.YC)(Object.entries(u),(function(e){var n=(0,l.Z)(e,2),t=n[0];n[1];return t})).forEach((function(n){var t=(0,l.Z)(n,2),i=t[0],r=t[1],o=p[i],c=null===o||void 0===o?void 0:o.message;e.push([(0,oe.jsxs)("div",{children:[(0,oe.jsx)(be.ZP,{overflowWrap:!0,preWrap:!0,children:i}),c&&(0,oe.jsx)(ge.Z,{mt:1,children:(0,oe.jsx)(be.ZP,{danger:!0,small:!0,children:c})})]},"name-".concat(i)),(0,oe.jsx)(dn.Z,{danger:!!c,progress:100*r},"progress-".concat(i))])})),(0,oe.jsx)(fn.Z,{columnFlex:[1,4],columns:[{uuid:"Filename"},{uuid:"Upload progress"}],rows:e,uuid:"block-runs"})}),[u,p]);return(0,oe.jsxs)(me.Z,{footer:(0,oe.jsxs)(pe.Z,{fullWidth:!0,children:[(0,oe.jsx)(se.Z,{onClick:function(){return t()},children:"Close"}),m&&(0,oe.jsx)(ge.Z,{ml:1,children:(0,oe.jsx)(se.Z,{onClick:function(){s({}),h({})},children:"Clear files and retry"})})]}),headerTitle:"Upload files",children:[m&&(0,oe.jsx)(vn,{children:v}),!m&&(0,oe.jsx)(sn.Z,{directoryPath:i?$e(i):"",onDragActiveChange:c,setFileUploadProgress:s,setUploadedFiles:function(e){h(e),null===n||void 0===n||n()},children:(0,oe.jsx)(mn,{children:(0,oe.jsxs)(be.ZP,{center:!0,children:[o&&"Drop to upload",!o&&"Click or drop files and folders to upload"]})})})]})},xn=t(86585),jn=function(e){var n=e[0];return n===h.tf.DBT||n===h.tf.CUSTOM?n:e[0].slice(0,-1)};function yn(){return new RegExp(Object.keys(He).map((function(e){return".(".concat(e,")$")})).join("|"))}function kn(e,n,t){var i,r,l=null===e||void 0===e||null===(i=e.path.match(yn())[0])||void 0===i?void 0:i.split(".")[1],c=t.type===ve.q.INTEGRATION,a=(0,tn.sE)(null===t||void 0===t?void 0:t.blocks,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n})),u=e.path.replace(n,"").split("/"),s=e.path.split("/")[0]===h.tf.DBT,d=(r=u)[0]===h.tf.DBT?r.slice(1).join("/"):function(e){return e.at(-1)}(r).split(".")[0];if(u.length>=3&&!s){var f=u.slice(1,u.length-1).join("/");d="".concat(f,"/").concat(d)}var p=jn(e.path.split("/")),m={configuration:{file_path:s?d:null},language:He[l],name:d,type:p};if(p===h.tf.CUSTOM&&(m.color=h.Lq.TEAL),c){var v=(0,tn.sE)(t.blocks,(function(e){var n=e.type;return h.tf.DATA_LOADER===n})),g=(0,tn.sE)(t.blocks,(function(e){var n=e.type;return h.tf.TRANSFORMER===n})),b=[];g?b.push(g.uuid):null!==a&&void 0!==a&&a.upstream_blocks?b.push.apply(b,(0,o.Z)(a.upstream_blocks)):v&&b.push(v.uuid),m.upstream_blocks=b}return m}var Zn=t(96510),_n=t(83608),On=["addNewBlock","blocks","deleteBlockFile","deleteWidget","fetchFileTree","fetchPipeline","files","pipeline","setErrors","setSelectedBlock","widgets"];function Cn(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 wn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Cn(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Cn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Sn,En=20*ie.iI;function Pn(e,n){var t=e.addNewBlock,i=e.blocks,r=void 0===i?[]:i,o=e.deleteBlockFile,c=e.deleteWidget,a=e.fetchFileTree,u=e.fetchPipeline,s=e.files,p=e.pipeline,v=e.setErrors,g=e.setSelectedBlock,b=e.widgets,x=void 0===b?[]:b,j=(0,Ee.Z)(e,On),y=(0,d.useRef)(null),k=(0,d.useContext)(Pe.ThemeContext),Z=(0,d.useState)(null),_=Z[0],O=Z[1],C=(0,d.useState)(null),w=C[0],S=C[1],E=(0,d.useState)(null),P=E[0],T=E[1],I=an.ZP.status.list().data,A=(0,d.useMemo)((function(){var e;return null===I||void 0===I||null===(e=I.status)||void 0===e?void 0:e.repo_path}),[I]),R=(0,tn.sE)(null===p||void 0===p?void 0:p.blocks,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n})),D=(0,f.Db)(an.ZP.blocks.pipelines.useUpdate(null===p||void 0===p?void 0:p.uuid,null===R||void 0===R?void 0:R.uuid),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){null===u||void 0===u||u()}})}}),M=(0,l.Z)(D,1)[0],N=(0,d.useCallback)((function(){return T(null)}),[T]);(0,d.useEffect)((function(){var e,i,r,o=function(e){if(clearTimeout(y.current),S(null),w&&p&&t){var i,r,o=(null===n||void 0===n||null===(i=n.current)||void 0===i||null===(r=i.getBoundingClientRect)||void 0===r?void 0:r.call(i))||{},l=o.width,c=o.x;if(e.pageX>c+l){var a=(null===p||void 0===p?void 0:p.type)===ve.q.INTEGRATION,u=kn(wn(wn({},w),{},{path:$e(w)}),A,p);null===t||void 0===t||t(u,(function(e){a&&R&&M({block:wn(wn({},R),{},{upstream_blocks:[e.uuid]})}),null===g||void 0===g||g(e)}))}}},l=function(e){w&&O({x:e.pageX,y:e.pageY})};return null===(e=document)||void 0===e||e.addEventListener("click",N),null===(i=document)||void 0===i||i.addEventListener("mousemove",l),null===(r=document)||void 0===r||r.addEventListener("mouseup",o),function(){var e,n,t;null===(e=document)||void 0===e||e.removeEventListener("click",N),null===(n=document)||void 0===n||n.removeEventListener("mousemove",l),null===(t=document)||void 0===t||t.removeEventListener("mouseup",o)}}),[t,R,w,N,p,n,A,g,y,M]);var B=(0,d.useMemo)((function(){return r.concat(x).map((function(e){return e.uuid}))}),[r,x]),L=(0,d.useMemo)((function(){return null===s||void 0===s?void 0:s.map((function(e){return(0,d.createElement)(cn,wn(wn({},j),{},{containerRef:n,file:e,key:e.name,level:0,pipelineBlockUuids:B,setCoordinates:O,setDraggingFile:S,setSelectedFile:T,theme:k,timeout:y}))}))}),[s,B,j,n,k,y]),F=(0,d.useMemo)((function(){return P&&en(P)}),[P]),H=(0,d.useMemo)((function(){return w&&en(w)}),[w]),U=(0,d.useMemo)((function(){return P&&"undefined"!==typeof(null===P||void 0===P?void 0:P.children)&&P}),[P]),z=(0,_n.dd)((function(){return(0,oe.jsx)(bn,{fetchFileTree:a,onCancel:Q,selectedFolder:U})}),{},[a,U],{background:!0,uuid:"upload_files"}),G=(0,l.Z)(z,2),W=G[0],Q=G[1],q=(0,_n.dd)((function(){return(0,oe.jsx)(un,{fetchFileTree:a,onCancel:K,selectedFolder:U,setErrors:v})}),{},[a,U,v],{background:!0,disableClickOutside:!0,uuid:"new_file"}),V=(0,l.Z)(q,2),Y=V[0],K=V[1],X=(0,d.useMemo)((function(){var e;if(!F&&!U)return(0,oe.jsx)("div",{});var t=(null===n||void 0===n||null===(e=n.current)||void 0===e?void 0:e.getBoundingClientRect())||{},i=t.x,r=t.width,l=_||{},a=l.x,u=void 0===a?0:a,s=l.y,d=void 0===s?0:s,f=u;u+En>=i+r&&(f=i+r-(En+ie.iI)),f<0&&(f=0);var p=[];return U?p.push.apply(p,[{label:function(){return"Upload files"},onClick:function(){W()},uuid:"upload_files"},{label:function(){return"New file"},onClick:function(){Y()},uuid:"new_file"}]):p.push({label:function(){return"Delete file"},onClick:function(){F.type===h.tf.CHART?c(F):o(F)},uuid:"delete_file"}),(0,oe.jsx)("div",{style:{left:f,position:"fixed",top:d+ie.iI/2,zIndex:xn.bf+100},children:(0,oe.jsx)(m.Z,{items:p,open:!0,parentRef:void 0,uuid:"FileBrowser/ContextMenu",width:En})})}),[_,o,c,n,W,Y,F,U]);return(0,oe.jsxs)(Ge.Nk,{ref:n,children:[L,(F||U)&&X,H&&(0,oe.jsx)("div",{style:{left:(null===_||void 0===_?void 0:_.x)-ie.iI,position:"fixed",top:(null===_||void 0===_?void 0:_.y)-ie.iI,zIndex:xn.bf+100},children:(0,oe.jsx)(be.ZP,{cursor:"grabbing",monospace:!0,children:null===H||void 0===H?void 0:H.uuid})})]})}!function(e){e.BLOCK_FILE="block_file",e.DISABLED="disabled",e.FILE="file",e.FOLDER="folder",e.PIPELINE="pipeline"}(Sn||(Sn={}));var Tn=d.forwardRef(Pn),In=t(93461),An=Pe.default.div.withConfig({displayName:"ButtonGroup__ButtonGroupStyle",componentId:"sc-15vbmc8-0"})([""]),Rn=Pe.default.div.withConfig({displayName:"ButtonGroup__VerticalDivider",componentId:"sc-15vbmc8-1"})(["width:1px;"]),Dn=function(e){var n=e.children,t=e.divider,i=d.Children.toArray(n).length;return(0,oe.jsx)(An,{children:(0,oe.jsx)(pe.Z,{children:d.Children.map(n,(function(e,n){return e&&(0,oe.jsxs)(In.Z,{children:[n>=1&&t&&(0,oe.jsx)(Rn,{}),d.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))}))})})},Mn=t(57722),Nn=t(82635),Bn=t(33699),Ln=t(94353),Fn=t(28799),Hn=t(41150);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 zn(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,c.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 Gn,Wn=function(e){var n,t=e.active,i=e.addNewBlock,r=e.fetchPipeline,o=e.fetchVariables,a=e.filePath,u=e.openSidekickView,p=e.pipeline,m=(e.projectName,e.selectedFilePath),v=e.setFilesTouched,g=e.setSelectedBlock,b=(0,d.useState)(null),x=b[0],j=b[1],y=(0,d.useState)(!1),k=y[0],Z=y[1],_=(0,d.useRef)(null),O=an.ZP.status.list().data,C=null===O||void 0===O||null===(n=O.status)||void 0===n?void 0:n.repo_path,w=an.ZP.file_contents.detail(a).data;(0,d.useEffect)((function(){null!==w&&void 0!==w&&w.file_content&&j(w.file_content)}),[w]);var S=(0,d.useState)(null===x||void 0===x?void 0:x.content),E=S[0],P=S[1],T=(0,d.useState)(!1),I=T[0],A=T[1];(0,d.useEffect)((function(){var e;m&&(null===_||void 0===_||null===(e=_.current)||void 0===e||e.scrollIntoView())}),[m]);var R=(0,f.Db)(an.ZP.file_contents.useUpdate(null===x||void 0===x?void 0:x.path),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){return!0},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),D=(0,l.Z)(R,1)[0],M=(0,d.useCallback)((function(e,n){D({file_content:zn(zn({},n),{},{content:e})}).then((function(){decodeURIComponent(a).split("/").pop()===we.METADATA_YAML&&o()})),v((function(e){return zn(zn({},e),{},(0,c.Z)({},null===n||void 0===n?void 0:n.path,!1))})),A(!1)}),[o,a,D]),N=(0,d.useMemo)((function(){return yn()}),[]),B=(0,d.useMemo)((function(){var e;return null===x||void 0===x||null===(e=x.path.match(N)[0])||void 0===e?void 0:e.split(".")[1]}),[N,x]),L=(0,d.useMemo)((function(){if(null!==x&&void 0!==x&&x.path)return(0,oe.jsx)(Mn.Z,{autoHeight:!0,language:He[B],onSave:function(e){M(e,x)},onChange:function(e){P(e),v((function(e){return zn(zn({},e),{},(0,c.Z)({},null===x||void 0===x?void 0:x.path,!0))})),A(!0)},selected:!0,textareaFocused:!0,value:(0,re.Pb)(null===x||void 0===x?void 0:x.content)?JSON.stringify(JSON.parse(null===x||void 0===x?void 0:x.content),null,2):null===x||void 0===x?void 0:x.content,width:"100%"})}),[x,B,M,v]),F=(0,tn.sE)(null===p||void 0===p?void 0:p.blocks,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n})),H=(0,f.Db)(an.ZP.blocks.pipelines.useUpdate(null===p||void 0===p?void 0:p.uuid,null===F||void 0===F?void 0:F.uuid),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){null===r||void 0===r||r()}})}}),U=(0,l.Z)(H,1)[0],z=(B===Ce.PY||B===Ce.SQL||(B===Ce.YAML||B===Ce.R)&&nn(x,null===x||void 0===x?void 0:x.path))&&jn(x.path.split("/"))!==h.tf.SCRATCHPAD&&en(x)&&(0,oe.jsx)(se.Z,{onClick:function(){var e=p.type===ve.q.INTEGRATION,n=kn(x,C,p);i(n,(function(n){e&&F&&U({block:zn(zn({},F),{},{upstream_blocks:[n.uuid]})}),g(n)}))},primary:!0,children:"Add to current pipeline"}),G=(0,s.ZP)((0,Fn.Ib)(),{shouldReconnect:function(){return!0}}),W=G.lastJsonMessage,Q=G.sendMessage;(0,d.useEffect)((function(){if(W){var e=W,n=null===e||void 0===e?void 0:e.execution_state;(null===e||void 0===e?void 0:e.uuid)===Bn.y&&(Nn.uF.BUSY===n?Z(!0):Nn.uF.IDLE===n&&Z(!1))}}),[W,Z]);var q=(0,oe.jsx)(ge.Z,{m:2,children:(0,oe.jsx)(he.ZP,{disabled:!C,inline:!0,loading:k,onClick:function(){u(Ae.TERMINAL),Q(JSON.stringify({api_key:Ln.l,code:"!pip install -r ".concat(C,"/requirements.txt"),token:(new ue.Z).decodedToken.token,uuid:Bn.y}))},title:C?"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"})}),V="FileEditor/".concat(null===x||void 0===x?void 0:x.path),Y=(0,Hn.y)(),K=Y.registerOnKeyDown,X=Y.unregisterOnKeyDown;return(0,d.useEffect)((function(){return function(){X(V)}}),[X,V]),K(V,(function(e,n,i){if(t)if((0,Ze.y)([je.zX,je.Um],n)||(0,Ze.y)([je.PQ,je.Um],n))e.preventDefault(),M(E,x);else if(I&&(0,Ze.y)([je.zX,je.hS],n)){e.preventDefault();var r="".concat(x.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(r)&&location.reload()}}),[t,E,x,M,I]),(0,oe.jsxs)("div",{ref:_,children:[(0,oe.jsx)(ge.Z,{p:2,children:(0,oe.jsxs)(Dn,{children:[z,(0,oe.jsx)(se.Z,{disabled:!E,onClick:function(e){e.preventDefault(),M(E,x)},title:E?null:"No changes have been made to this file.",children:"Save file content"})]})}),L,a===we.REQS_TXT&&q]})},Qn=t(64318);!function(e){e.ANDROID="Android",e.CHROME_OS="ChromeOS",e.IOS="iOS",e.LINUX="Linux",e.MAC="macOS",e.WINDOWS="Windows"}(Gn||(Gn={}));var qn=Gn;function Vn(){return function(){var e,n,t,i,r,o,l,c=null===(e=window)||void 0===e||null===(n=e.navigator)||void 0===n?void 0:n.userAgent,a=(null===(t=window)||void 0===t||null===(i=t.navigator)||void 0===i||null===(r=i.userAgentData)||void 0===r?void 0:r.platform)||(null===(o=window)||void 0===o||null===(l=o.navigator)||void 0===l?void 0:l.platform),u=qn.MAC;return a?["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(a)?u=qn.MAC:["Win32","Win64","Windows","WinCE"].includes(a)?u=qn.WINDOWS:["iPhone","iPad","iPod"].includes(a)&&(u=qn.IOS):c&&(c.includes("Macintosh")?u=qn.MAC:c.includes("Windows")?u=qn.WINDOWS:c.includes("Linux")&&c.includes("X11")?u=qn.LINUX:/(iPhone|iPad)/.test(c)?u=qn.IOS:c.includes("Android")&&c.includes("Mobi")?u=qn.ANDROID:c.includes("CrOS")&&(u=qn.CHROME_OS)),u}()===qn.MAC}function Yn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Kn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Yn(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Yn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xn=function(e){var n=e.cancelPipeline,t=e.createPipeline,i=e.executePipeline,r=e.interruptKernel,o=e.isPipelineExecuting,l=e.restartKernel,a=e.savePipelineContent,u=e.setMessages,s=(0,d.useState)(null),f=s[0],p=s[1],h=(0,d.useRef)(null),v=(0,d.useRef)(null),g=[{label:function(){return"New standard pipeline"},onClick:function(){return t({pipeline:{name:(0,re.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return t({pipeline:{name:(0,re.Y6)(),type:ve.q.STREAMING}})},uuid:"new_streaming_pipeline"},{label:function(){return"Save pipeline"},keyTextGroups:[[Vn()?je.RJ:je.hE,je.SS]],onClick:function(){return a()},uuid:"save_pipeline"}],b=(0,d.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[je.kA],[je.kA]],onClick:function(){return r()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[je.t_[je.OC]],[je.t_[je.OC]]],onClick:function(){return l()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return u((function(e){return Object.keys(e).reduce((function(e,n){return Kn(Kn({},e),{},(0,c.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return o?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):e.push({label:function(){return"Execute pipeline"},onClick:function(){return i()},uuid:"Execute pipeline"}),e}),[o]),x="FileHeaderMenu/index",j=(0,Hn.y)(),y=j.registerOnKeyDown,k=j.unregisterOnKeyDown;return(0,d.useEffect)((function(){return function(){k(x)}}),[k,x]),y(x,(function(e,n,t){null!==f&&(n[je.QK]?p((function(e){return 0===e?1:e-1})):n[je.DY]&&p((function(e){return 1===e?0:e+1})))}),[f,p]),(0,oe.jsx)(de.Z,{onClickOutside:function(){return p(null)},open:!0,style:{position:"relative"},children:(0,oe.jsxs)(pe.Z,{children:[(0,oe.jsxs)("div",{style:{position:"relative"},children:[(0,oe.jsx)(Qn.u,{highlighted:0===f,onClick:function(){return p((function(e){return 0===e?null:0}))},onMouseEnter:function(){return p((function(e){return null!==e?0:null}))},ref:h,children:(0,oe.jsx)(be.ZP,{children:"File"})}),(0,oe.jsx)(m.Z,{items:g,onClickCallback:function(){return p(null)},open:0===f,parentRef:h,uuid:"FileHeaderMenu/file_items"})]}),(0,oe.jsxs)("div",{style:{position:"relative"},children:[(0,oe.jsx)(Qn.u,{highlighted:1===f,onClick:function(){return p((function(e){return 1===e?null:1}))},onMouseEnter:function(){return p((function(e){return null!==e?1:null}))},ref:v,children:(0,oe.jsx)(be.ZP,{children:"Run"})}),(0,oe.jsx)(m.Z,{items:b,onClickCallback:function(){return p(null)},open:1===f,parentRef:v,uuid:"FileHeaderMenu/run_items"})]})]})})},Jn=t(10919),$n=t(46261),et=t(82386),nt=t(37391),tt=300,it=Pe.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;}"],tt,tt),rt=Pe.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||pn.Z.background).codeArea,";\n ")})),ot=Pe.default.div.withConfig({displayName:"indexstyle__PipelineHeaderStyle",componentId:"sc-1sv9513-2"})(["height:","px;position:sticky;top:","px;width:100%;z-index:5;"," "," ",""],et.Wi,et.Wi,(function(e){return"\n background-color: ".concat((e.theme.background||pn.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||pn.Z.borders).medium,";\n ")}),(function(e){return e.secondary&&"\n height: ".concat(37,"px;\n top: ").concat(2*et.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,nt.y$)()),lt=Pe.default.div.withConfig({displayName:"indexstyle__FileTabStyle",componentId:"sc-1sv9513-3"})(["border-left:1px solid transparent;height:100%;padding:","px ","px;"," "," "," ",""],ie.iI,ie.cd*ie.iI,(function(e){return"\n &:hover {\n cursor: default;\n\n p {\n color: ".concat((e.theme.content||pn.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||pn.Z.interactive).hoverBackground,";\n ")}),(function(e){return!e.selected&&"\n border-color: ".concat((e.theme.borders||pn.Z.borders).light," !important;\n ")}),(function(e){return e.last&&"\n border-right: 1px solid transparent;\n "})),ct=t(33766);var at,ut,st=function(e){var n=e.filePaths,t=e.filesTouched,i=e.savePipelineContent,r=e.selectedFilePath,o=(0,d.useContext)(Pe.ThemeContext),l=(0,d.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]);return(0,oe.jsx)(ot,{secondary:!0,children:(0,oe.jsx)(pe.Z,{alignItems:"center",justifyContent:"flex-start",children:null===l||void 0===l?void 0:l.map((function(e,n){var c=r===encodeURIComponent(e);return(0,oe.jsx)(pe.Z,{flexDirection:"column",fullHeight:!0,onClick:function(n){n.preventDefault(),c||(i(),(0,ct.u)({file_path:encodeURIComponent(e)}))},children:(0,oe.jsx)(lt,{last:n===l.length-1,selected:c,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",fullHeight:!0,children:[!t[e]&&(0,oe.jsx)(ze.iU,{muted:!c,size:1.5*ie.iI}),t[e]&&(0,oe.jsx)($n.Z,{label:"Unsaved changes",size:null,widthFitContent:!0,children:(0,oe.jsx)("div",{style:{padding:1},children:(0,oe.jsx)(Te.Z,{borderColor:(o||pn.Z).borders.danger,size:1.25*ie.iI})})}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsx)(be.ZP,{muted:!c,children:e}),(0,oe.jsx)(ge.Z,{mr:2}),c&&(0,oe.jsx)($n.Z,{appearAbove:!0,label:"Close",size:null,widthFitContent:!0,children:(0,oe.jsx)(Jn.Z,{autoHeight:!0,block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){var n=(0,tn.Od)(l,(function(n){return n===e})).map((function(e){return encodeURIComponent(e)}));(0,ct.u)({file_path:n[n.length-1]||null,"file_paths[]":n},{pushHistory:!0})},preventDefault:!0,children:(0,oe.jsx)(ze.x8,{size:1.25*ie.iI})})}),!c&&(0,oe.jsx)("div",{style:{width:1.25*ie.iI}})]})})},e)}))})})},dt=t(57384);!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(at||(at={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(ut||(ut={}));var ft=t(90686),pt=["bold","defaultColor","description","disableWordBreak","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","tooltipProps","value"];function ht(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function mt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ht(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ht(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var vt=Pe.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*ie.iI),gt=Pe.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var bt,xt=function(e){var n=e.bold,t=void 0===n||n,i=e.defaultColor,r=e.description,o=e.disableWordBreak,l=e.inputValue,c=e.inputWidth,a=e.invertedTheme,u=e.label,s=e.labelColor,f=e.menuOpen,p=void 0!==f&&f,h=e.monospace,m=e.muted,v=e.onClick,g=e.notRequired,b=e.selectedTextProps,x=e.small,j=e.stacked,y=e.tooltipProps,k=e.value,Z=(0,Ee.Z)(e,pt),_=(0,d.useRef)(null),O=(0,d.useState)(!1),C=O[0],w=O[1],S=(0,d.useState)(!1),E=S[0],P=S[1],T=u&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(be.ZP,{bold:t,color:s,inverted:a,lineHeight:20,monospace:h,muted:m,small:x,children:u}),y&&(0,oe.jsx)(ge.Z,{ml:1,children:(0,oe.jsx)($n.Z,mt({muted:!0},y))})]}),I=(0,oe.jsxs)(oe.Fragment,{children:[k&&(0,oe.jsx)(Jn.Z,{block:!0,danger:null===b||void 0===b?void 0:b.danger,fullWidth:!0,muted:m,onClick:function(){v(),_.current&&_.current.focus(),w(!0)},preventDefault:!0,sameColorAsText:m||!(null!==b&&void 0!==b&&b.primary)&&!(null!==b&&void 0!==b&&b.danger)&&!(null!==b&&void 0!==b&&b.warning),underline:null===b||void 0===b?void 0:b.underline,warning:null===b||void 0===b?void 0:b.warning,children:(0,oe.jsx)(be.ZP,mt(mt({inverted:a,muted:m},b),{},{disableWordBreak:o,monospace:h,small:x,width:c,children:k}))}),(0,oe.jsx)(xe.Z,mt(mt({},Z),{},{basic:!0,defaultColor:i,invertedTheme:a,monospace:h,onBlur:function(e){w(!1),Z.onBlur&&Z.onBlur(e),E||P(!0)},onFocus:function(e){w(!0),Z.onFocus&&Z.onFocus(e)},ref:_,small:x,value:l,visible:!k}))]}),A=r&&(0,oe.jsx)(gt,{children:(0,oe.jsx)(be.ZP,{dangerouslySetInnerHTML:{__html:r},monospace:h,muted:!0,small:x})});return(0,oe.jsxs)(oe.Fragment,{children:[j&&(0,oe.jsxs)(oe.Fragment,{children:[T&&(0,oe.jsxs)(vt,{children:[(0,oe.jsx)(pe.Z,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:T}),A]}),I]}),!j&&(0,oe.jsxs)(pe.Z,{alignItems:"center",fullWidth:!0,children:[T&&(0,oe.jsxs)(oe.Fragment,{children:[T,(0,oe.jsx)(ge.Z,{ml:1})]}),(0,oe.jsx)(In.Z,{flex:"1",children:I})]}),E&&!C&&!k&&!p&&!g&&(0,oe.jsx)(be.ZP,{danger:!0,small:x,children:"This field is required."})]})};!function(e){e.EMR="emr"}(bt||(bt={}));var jt=t(42305);var yt=function(e){e.filePaths,e.filesTouched;var n,t=e.isBusy,i=e.isPipelineUpdating,r=e.kernel,c=e.pipeline,a=e.pipelineContentTouched,u=e.pipelineLastSaved,s=(e.restartKernel,e.savePipelineContent,e.selectedFilePath),p=e.setErrors,h=e.updatePipelineMetadata,v=(0,d.useContext)(Pe.ThemeContext),g=r||{},b=g.alive,x=(g.name,(0,d.useState)(!1)),j=x[0],y=x[1],k=(0,d.useState)(""),Z=k[0],_=k[1],O=(0,d.useState)(bt.EMR),C=O[0],w=(O[1],(0,d.useState)(!1)),S=w[0],E=w[1],P=(0,d.useState)(!1),T=P[0],I=P[1],A=(0,d.useRef)(null),R=an.ZP.clusters.detail(C),D=R.data,M=R.mutate,N=(0,d.useMemo)((function(){var e;return(null===D||void 0===D||null===(e=D.cluster)||void 0===e?void 0:e.clusters)||[]}),D),B=(0,tn.sE)(N,(function(e){return e.is_active})),L=(0,f.Db)(an.ZP.clusters.useUpdate(C),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(e){M()},onErrorCallback:function(e,n){return p({errors:n,response:e})}})}}),F=(0,l.Z)(L,2),H=F[0];F[1].isLoading,(0,d.useEffect)((function(){null!==c&&void 0!==c&&c.uuid&&_(c.uuid)}),[null===c||void 0===c?void 0:c.uuid]),n=a?"Unsaved changes":i?"Saving changes...":u?"Last saved ".concat((0,jt.JX)(Number(u)/1e3)):"All changes saved";var U="KernelStatus",z=(0,Hn.y)(),G=z.registerOnKeyDown,W=z.unregisterOnKeyDown;(0,d.useEffect)((function(){return function(){W(U)}}),[W,U]),G(U,(function(e,n,t){j&&String(t[0])===String(je.Uq)&&String(t[1])!==String(je.zX)&&((null===c||void 0===c?void 0:c.uuid)===Z?e.target.blur():(h(Z),y(!1)))}),[j,Z,y,h]);var Q=(0,d.useMemo)((function(){return(0,oe.jsx)(xt,{bold:!1,inputValue:Z,notRequired:!0,onBlur:function(){return setTimeout((function(){return y(!1)}),300)},onChange:function(e){_(e.target.value),e.preventDefault()},onClick:function(){return y(!0)},onFocus:function(){return y(!0)},stacked:!0,value:j?null:(null===c||void 0===c?void 0:c.uuid)||""})}),[j,Z,c]),q=(0,d.useMemo)((function(){return(0,oe.jsx)("div",{ref:A,style:{position:"relative"},children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(null===c||void 0===c?void 0:c.type)===ve.q.PYSPARK&&(0,oe.jsxs)(ge.Z,{mr:1,children:[(0,oe.jsxs)(Jn.Z,{muted:!!B,onClick:function(){return E(!0)},preventDefault:!0,sameColorAsText:!B,underline:!B,children:[B&&B.id,!B&&"Select cluster"]}),(0,oe.jsx)(de.Z,{disableEscape:!0,onClickOutside:function(){return E(!1)},open:S,children:(0,oe.jsx)(m.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,o.Z)(N.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,oe.jsxs)(pe.Z,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,oe.jsx)(In.Z,{flex:1,children:(0,oe.jsx)(be.ZP,{muted:!t&&ut.WAITING!==i,children:n})}),t&&(0,oe.jsx)(ze.Jr,{size:2*ie.iI,success:!0}),!t&&(0,oe.jsx)(be.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||ut.WAITING!==i?null:function(){return H({cluster:{id:n,is_active:!0}})},uuid:n}})))),onClickCallback:function(){return E(!1)},open:S,parentRef:A,uuid:"KernelStatus/select_cluster",width:40*ie.iI})})]}),(0,oe.jsx)(he.ZP,{beforeElement:(0,oe.jsx)(Te.Z,{color:t?(v||pn.Z).borders.info:b?(v||pn.Z).borders.success:(v||pn.Z).borders.danger,size:ie.iI}),blackBorder:!0,compact:!0,inline:!0,onClick:function(){return I(!0)},uuid:"Pipeline/KernelStatus/kernel",children:(null===c||void 0===c?void 0:c.type)||ve.q.PYTHON}),(0,oe.jsx)(de.Z,{disableEscape:!0,onClickOutside:function(){return I(!1)},open:T,children:(0,oe.jsx)(m.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,o.Z)(Object.keys(ve.a).filter((function(e){return(null===c||void 0===c?void 0:c.type)!=e})).map((function(e){return{label:function(){return e},onClick:function(){return h(null===c||void 0===c?void 0:c.name,e)},uuid:e}})))),onClickCallback:function(){return I(!1)},open:T,parentRef:A,uuid:"KernelStatus/select_kernel",width:25*ie.iI})})]})})}),[b,N,t,c,B,E,I,S,T,v,H]),V=(0,d.useMemo)((function(){return(0,oe.jsxs)(In.Z,{alignItems:"center",children:[(0,oe.jsxs)(be.ZP,{children:["Pipeline:\xa0",s&&(null===c||void 0===c?void 0:c.uuid)]}),!s&&Q,(0,oe.jsx)(ge.Z,{mr:3})]})}),[b,t,c,Q,s,v]);return(0,oe.jsx)(ot,{children:(0,oe.jsxs)(pe.Z,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,oe.jsx)(pe.Z,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:(0,oe.jsxs)(ge.Z,{px:ie.cd,children:[s&&(0,oe.jsx)(Jn.Z,{noHoverUnderline:!0,noOutline:!0,onClick:s?function(){return(0,ct.u)({file_path:null})}:null,preventDefault:!0,children:V}),!s&&(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[V,j&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ge.Z,{ml:1}),(0,oe.jsx)(Jn.Z,{onClick:function(){h(Z),y(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]})]})}),(0,oe.jsx)(ge.Z,{px:ie.cd,children:(0,oe.jsxs)(In.Z,{alignItems:"center",children:[q,(0,oe.jsx)(ge.Z,{ml:2}),(0,oe.jsx)($n.Z,{appearBefore:!0,block:!0,description:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(be.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,oe.jsx)(ft.Z,{inline:!0,keyText:Vn()?je.RJ:je.hE}),"\xa0",(0,oe.jsx)(be.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,oe.jsx)(ft.Z,{inline:!0,keyText:je.SS}),"\xa0",(0,oe.jsx)(be.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,oe.jsx)("br",{})]}),(0,oe.jsx)(ge.Z,{mt:1,children:(0,oe.jsxs)(be.ZP,{default:!0,children:["Or, go to ",(0,oe.jsx)(be.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,oe.jsx)(be.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,oe.jsx)(be.ZP,{muted:!0,children:n})})]})})]})})},kt=t(16910);var Zt,_t,Ot,Ct,wt,St,Et=function(e){var n=e.size;return(0,oe.jsx)("svg",{fill:"none",height:n,preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",width:n,xmlns:"http://www.w3.org/2000/svg",children:(0,oe.jsx)("path",{d:"M245.121138,10.6473813 C251.139129,16.4340053 255.074133,24.0723342 256,32.4050489 C256,35.8769778 255.074133,38.1917867 252.990862,42.5895822 C250.907876,46.9873778 225.215147,91.4286933 217.57696,103.696213 C213.179164,110.871609 210.864356,119.435947 210.864356,127.768462 C210.864356,136.3328 213.179164,144.6656 217.57696,151.840996 C225.215147,164.108516 250.907876,208.781084 252.990862,213.179164 C255.074133,217.57696 256,219.659947 256,223.131876 C255.074133,231.464676 251.370667,239.103147 245.352676,244.658347 C239.565938,250.676338 231.927751,254.611342 223.826489,255.305671 C220.35456,255.305671 218.039751,254.379804 213.873493,252.296533 C209.706951,250.213262 164.340053,225.215147 152.072249,217.57696 C151.146382,217.113884 150.220516,216.419556 149.063396,215.95648 L88.4195556,180.079502 C89.8082133,191.652693 94.9006222,202.763093 103.233138,210.864356 C104.853618,212.484551 106.473813,213.873493 108.325547,215.262151 C106.936604,215.95648 105.316409,216.651093 103.927751,217.57696 C91.6599467,225.215147 46.9873778,250.907876 42.5895822,252.990862 C38.1917867,255.074133 36.1085156,256 32.4050489,256 C24.0723342,255.074133 16.4340053,251.370667 10.8788338,245.352676 C4.86075733,239.565938 0.925858133,231.927751 0,223.594951 C0.231464676,220.123022 1.1573248,216.651093 3.00905244,213.641956 C5.09223822,209.24416 30.7848533,164.571307 38.42304,152.303787 C42.82112,145.128391 45.1356444,136.795591 45.1356444,128.231538 C45.1356444,119.6672 42.82112,111.3344 38.42304,104.159004 C30.7848533,91.4286933 4.86075733,46.75584 3.00905244,42.3580444 C1.1573248,39.3489067 0.231464676,35.8769778 0,32.4050489 C0.925858133,24.0723342 4.62930489,16.4340053 10.6473813,10.6473813 C16.4340053,4.62930489 24.0723342,0.925858133 32.4050489,0 C35.8769778,0.231464676 39.3489067,1.1573248 42.5895822,3.00905244 C46.2930489,4.62930489 78.9293511,23.6094009 96.28928,33.7939911 L100.224284,36.1085156 C101.612942,37.0343822 102.770347,37.7287111 103.696213,38.1917867 L105.547947,39.3489067 L167.348907,75.9204978 C165.960249,62.0324978 158.784853,49.3019022 147.674453,40.7378489 C149.063396,40.04352 150.683591,39.3489067 152.072249,38.42304 C164.340053,30.7848533 209.012622,4.86075733 213.410418,3.00905244 C216.419556,1.1573248 219.891484,0.231464676 223.594951,0 C231.696213,0.925858133 239.334684,4.62930489 245.121138,10.6473813 Z M131.240391,144.434062 L144.434062,131.240391 C146.285796,129.388658 146.285796,126.611342 144.434062,124.759609 L131.240391,111.565938 C129.388658,109.714204 126.611342,109.714204 124.759609,111.565938 L111.565938,124.759609 C109.714204,126.611342 109.714204,129.388658 111.565938,131.240391 L124.759609,144.434062 C126.379804,146.054258 129.388658,146.054258 131.240391,144.434062 Z",fill:"#FF694A"})})},Pt=t(30264),Tt=t(80906),It=ie.cd*ie.iI,At=Pe.default.div.withConfig({displayName:"indexstyle__IconContainerStyle",componentId:"sc-oyfjzc-0"})(["align-items:center;border-radius:","px;border:1px solid transparent;display:flex;justify-content:center;"," "," "," "," "," ",""],hn.BG,(function(e){return e.border&&"\n border: 1px dotted ".concat((e.theme.content||pn.Z.content).active,";\n ")}),(function(e){return e.blue&&"\n background-color: ".concat((0,Ke.qn)(h.tf.DATA_LOADER,e).accent,";\n ")}),(function(e){return e.purple&&"\n background-color: ".concat((0,Ke.qn)(h.tf.TRANSFORMER,e).accent,";\n ")}),(function(e){return e.yellow&&"\n background-color: ".concat((0,Ke.qn)(h.tf.DATA_EXPORTER,e).accent,";\n ")}),(function(e){return!e.compact&&"\n height: ".concat(It+ie.iI/2,"px;\n width: ").concat(It+ie.iI/2,"px;\n ")}),(function(e){return e.compact&&"\n height: ".concat(It/2+ie.iI,"px;\n width: ").concat(It/2+ie.iI,"px;\n ")})),Rt=Pe.default.div.withConfig({displayName:"indexstyle__ButtonWrapper",componentId:"sc-oyfjzc-1"})(["position:relative;margin-bottom:","px;margin-right:","px;",""],ie.iI,ie.iI,(function(e){return e.increasedZIndex&&"\n z-index: 3;\n "})),Dt=(Tt.Q0.AVERAGE,Tt.Q0.CLEAN_COLUMN_NAME,Tt.Q0.COUNT,Tt.Q0.COUNT_DISTINCT,Tt.Q0.CUSTOM,Tt.Q0.DIFF,Tt.Q0.FIRST,Tt.Q0.FIX_SYNTAX_ERRORS,Tt.Q0.IMPUTE,Tt.Q0.LAST,Tt.Q0.MAX,Tt.Q0.MEDIAN,Tt.Q0.MIN,Tt.Q0.NORMALIZE,Tt.Q0.REFORMAT,Tt.Q0.REMOVE,Tt.Q0.REMOVE_OUTLIERS,Tt.Q0.SELECT,Tt.Q0.SHIFT_DOWN,Tt.Q0.SHIFT_UP,Tt.Q0.STANDARDIZE,Tt.Q0.SUM,[Tt.Q0.DROP_DUPLICATE,Tt.Q0.FILTER,Tt.Q0.SORT,Tt.Q0.REMOVE]);!function(e){e.AGGREGATE="Aggregate",e.FORMATTING="Formatting",e.COLUMN_REMOVAL="Column removal",e.SHIFT_ROWS="Shift rows in a column",e.MISC="Miscellaneous",e.FEATURE_SCALING="Feature Scaling"}(St||(St={}));var Mt,Nt,Bt,Lt=(_t={},(0,c.Z)(_t,Tt.qs.COLUMN,(Zt={},(0,c.Z)(Zt,St.AGGREGATE,[Tt.Q0.AVERAGE,Tt.Q0.COUNT,Tt.Q0.COUNT_DISTINCT,Tt.Q0.FIRST,Tt.Q0.LAST,Tt.Q0.MAX,Tt.Q0.MEDIAN,Tt.Q0.MIN,Tt.Q0.SUM]),(0,c.Z)(Zt,St.FORMATTING,[Tt.Q0.CLEAN_COLUMN_NAME,Tt.Q0.FIX_SYNTAX_ERRORS,Tt.Q0.REFORMAT]),(0,c.Z)(Zt,St.COLUMN_REMOVAL,[Tt.Q0.REMOVE,Tt.Q0.SELECT]),(0,c.Z)(Zt,St.SHIFT_ROWS,[Tt.Q0.SHIFT_DOWN,Tt.Q0.SHIFT_UP]),(0,c.Z)(Zt,St.MISC,[Tt.Q0.DIFF,Tt.Q0.IMPUTE,Tt.Q0.REMOVE_OUTLIERS]),(0,c.Z)(Zt,St.FEATURE_SCALING,[Tt.Q0.NORMALIZE,Tt.Q0.STANDARDIZE]),Zt)),(0,c.Z)(_t,Tt.qs.ROW,(0,c.Z)({},St.MISC,[].concat(Dt))),_t),Ft=Object.keys(Lt[Tt.qs.COLUMN]),Ht=[St.MISC],Ut=(wt={},(0,c.Z)(wt,Tt.qs.COLUMN,(Ot={},(0,c.Z)(Ot,Tt.Q0.ADD,"Add column"),(0,c.Z)(Ot,Tt.Q0.AVERAGE,"Aggregate by average value"),(0,c.Z)(Ot,Tt.Q0.CLEAN_COLUMN_NAME,"Clean column name"),(0,c.Z)(Ot,Tt.Q0.COUNT_DISTINCT,"Aggregate by distinct count"),(0,c.Z)(Ot,Tt.Q0.COUNT,"Aggregate by total count"),(0,c.Z)(Ot,Tt.Q0.DIFF,"Difference"),(0,c.Z)(Ot,Tt.Q0.FIRST,"Aggregate by first value"),(0,c.Z)(Ot,Tt.Q0.FIX_SYNTAX_ERRORS,"Fix syntax errors"),(0,c.Z)(Ot,Tt.Q0.IMPUTE,"Fill in missing values"),(0,c.Z)(Ot,Tt.Q0.NORMALIZE,"Normalize Data"),(0,c.Z)(Ot,Tt.Q0.STANDARDIZE,"Standardize Data"),(0,c.Z)(Ot,Tt.Q0.LAST,"Aggregate by last value"),(0,c.Z)(Ot,Tt.Q0.MAX,"Aggregate by maximum value"),(0,c.Z)(Ot,Tt.Q0.MEDIAN,"Aggregate by median value"),(0,c.Z)(Ot,Tt.Q0.MIN,"Aggregate by mininum value"),(0,c.Z)(Ot,Tt.Q0.REFORMAT,"Reformat"),(0,c.Z)(Ot,Tt.Q0.REMOVE_OUTLIERS,"Remove outliers"),(0,c.Z)(Ot,Tt.Q0.REMOVE,"Remove column(s)"),(0,c.Z)(Ot,Tt.Q0.SELECT,"Keep columns"),(0,c.Z)(Ot,Tt.Q0.SHIFT_DOWN,"Shift rows down in a column"),(0,c.Z)(Ot,Tt.Q0.SHIFT_UP,"Shift rows up in a column"),(0,c.Z)(Ot,Tt.Q0.SUM,"Aggregate by sum of values"),Ot)),(0,c.Z)(wt,Tt.qs.ROW,(Ct={},(0,c.Z)(Ct,Tt.Q0.DROP_DUPLICATE,"Drop duplicates"),(0,c.Z)(Ct,Tt.Q0.FILTER,"Filter"),(0,c.Z)(Ct,Tt.Q0.SORT,"Sort"),(0,c.Z)(Ct,Tt.Q0.REMOVE,"Remove rows"),Ct)),wt);!function(e){e.API="api",e.AZURE_BLOB_STORAGE="azure_blob_storage",e.AZURE_EVENT_HUB="azure_event_hub",e.BIGQUERY="bigquery",e.FILE="file",e.GENERIC="generic",e.GOOGLE_CLOUD_STORAGE="google_cloud_storage",e.KAFKA="kafka",e.KINESIS="kinesis",e.MYSQL="mysql",e.OPENSEARCH="opensearch",e.POSTGRES="postgres",e.RABBITMQ="rabbitmq",e.REDSHIFT="redshift",e.S3="s3",e.SNOWFLAKE="snowflake"}(Bt||(Bt={}));var zt=(Mt={},(0,c.Z)(Mt,Bt.API,"API"),(0,c.Z)(Mt,Bt.AZURE_BLOB_STORAGE,"Azure Blob Storage"),(0,c.Z)(Mt,Bt.AZURE_EVENT_HUB,"Azure Event Hub"),(0,c.Z)(Mt,Bt.BIGQUERY,"Google BigQuery"),(0,c.Z)(Mt,Bt.FILE,"Local file"),(0,c.Z)(Mt,Bt.GENERIC,"Generic (no template)"),(0,c.Z)(Mt,Bt.GOOGLE_CLOUD_STORAGE,"Google Cloud Storage"),(0,c.Z)(Mt,Bt.KAFKA,"Kafka"),(0,c.Z)(Mt,Bt.KINESIS,"Kinesis"),(0,c.Z)(Mt,Bt.MYSQL,"MySQL"),(0,c.Z)(Mt,Bt.OPENSEARCH,"OpenSearch"),(0,c.Z)(Mt,Bt.POSTGRES,"PostgreSQL"),(0,c.Z)(Mt,Bt.RABBITMQ,"RabbitMQ"),(0,c.Z)(Mt,Bt.REDSHIFT,"Amazon Redshift"),(0,c.Z)(Mt,Bt.S3,"Amazon S3"),(0,c.Z)(Mt,Bt.SNOWFLAKE,"Snowflake"),Mt),Gt=(Nt={},(0,c.Z)(Nt,h.tf.DATA_LOADER,[Bt.GENERIC,Bt.FILE,Bt.API,Bt.AZURE_BLOB_STORAGE,Bt.BIGQUERY,Bt.GOOGLE_CLOUD_STORAGE,Bt.MYSQL,Bt.POSTGRES,Bt.RABBITMQ,Bt.REDSHIFT,Bt.S3,Bt.SNOWFLAKE]),(0,c.Z)(Nt,h.tf.DATA_EXPORTER,[Bt.GENERIC,Bt.FILE,Bt.AZURE_BLOB_STORAGE,Bt.BIGQUERY,Bt.GOOGLE_CLOUD_STORAGE,Bt.MYSQL,Bt.POSTGRES,Bt.REDSHIFT,Bt.S3,Bt.SNOWFLAKE]),(0,c.Z)(Nt,h.tf.TRANSFORMER,[Bt.BIGQUERY,Bt.POSTGRES,Bt.REDSHIFT,Bt.SNOWFLAKE]),Nt),Wt=Bt,Qt=function(e,n,t){var i=t===ve.q.STREAMING&&(e===h.tf.DATA_LOADER||e===h.tf.DATA_EXPORTER);return function(e){var n;return e===ve.q.STREAMING?(n={},(0,c.Z)(n,h.tf.DATA_LOADER,[Wt.AZURE_EVENT_HUB,Wt.KAFKA,Wt.KINESIS,Wt.RABBITMQ]),(0,c.Z)(n,h.tf.DATA_EXPORTER,[Wt.KINESIS,Wt.OPENSEARCH]),(0,c.Z)(n,h.tf.TRANSFORMER,[Wt.GENERIC]),n):Gt}(t)[e].map((function(t){return{indent:e===h.tf.TRANSFORMER,label:function(){return zt[t]},onClick:function(){n({config:{data_source:t===Wt.GENERIC?null:t},language:i?h.t6.YAML:h.t6.PYTHON,type:e})},uuid:"".concat(e,"/").concat(t)}}))},qt=function(e,n){return[{label:function(){return"SQL"},onClick:function(){return e({language:h.t6.SQL,type:n})},uuid:"".concat(n,"/sql")},{label:function(){return"R"},onClick:function(){return e({language:h.t6.R,type:n})},uuid:"".concat(n,"/r")}]},Vt=function(e,n,t){var i=Object.fromEntries(h.Ut.map((function(n){return[n,Qt(n,e,t)]})));return t===ve.q.PYSPARK||t===ve.q.PYTHON&&n===h.tf.TRANSFORMER||t===ve.q.STREAMING?i[n]:[{items:i[n],label:function(){return"Python"},uuid:"".concat(n,"/python")}].concat((0,o.Z)(qt(e,n)))};function Yt(e,n,t){return e.map((function(e){return{indent:!0,label:function(){return Ut[n][e]},onClick:function(){t({config:{action_type:e,axis:n},language:h.t6.PYTHON,type:h.tf.TRANSFORMER})},uuid:"".concat(n,"_").concat(e)}})).sort((function(e,n){return e.label().localeCompare(n.label())}))}function Kt(e,n,t){var i=[];return e.forEach((function(e){if(e!==St.MISC)i.push({indent:!0,items:Yt(Lt[n][e],n,t),label:function(){return e},uuid:"".concat(n,"_grouping_").concat((0,re.RA)(e))});else{var r=Yt(Lt[n][e],n,t);i.push.apply(i,(0,o.Z)(r))}})),i}var Xt=function(e,n,t){return Object.values(h.Lq).map((function(i){return{label:function(){return(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(ze.mm,{fill:(0,Ke.qn)(h.tf.CUSTOM,{blockColor:i}).accent,size:16}),"\xa0",(0,oe.jsx)(be.ZP,{children:(0,re.kC)(i)})]})},onClick:function(){e({color:i,language:t,type:n})},uuid:"".concat(t,"_").concat(i)}}))},Jt=function(e){return"-- Docs: https://docs.mage.ai/guides/sql-blocks\n"+(e||"")};function $t(e,n){var t=n;return h.tf.SCRATCHPAD===e.type&&(t='"""\nNOTE: Scratchpad blocks are used only for experimentation and testing out code.\nThe code written here will not be executed as part of the pipeline.\n"""\n'+(n||"")),t}function ei(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ni(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ei(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ei(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ti=function(e){var n=e.addNewBlock,t=e.blockIdx,i=e.compact,r=e.hideCustom,l=e.hideDataExporter,c=(e.hideDataLoader,e.hideDbt),a=(e.hideRecommendations,e.hideScratchpad),u=e.hideSensor,s=e.hideTransformer,f=e.hideTransformerDataSources,p=e.onClickAddSingleDBTModel,m=e.pipeline,v=e.setAddNewBlockMenuOpenIdx,g=e.setCreatingNewDBTModel,b=(e.setRecsWindowOpenBlockIdx,(0,d.useState)(null)),x=b[0],j=b[1],y=(0,d.useRef)(null),k=(0,d.useRef)(null),Z=(0,d.useRef)(null),_=(0,d.useRef)(null),O=(0,d.useRef)(null),C={compact:i,inline:!0},w=null===m||void 0===m?void 0:m.type,S=w===ve.q.STREAMING,E=i?It/2:It,P=25*ie.iI,T=Kt(Ft,Tt.qs.COLUMN,n),I=[{label:function(){return"Generic (no template)"},onClick:function(){n({language:h.t6.PYTHON,type:h.tf.TRANSFORMER})},uuid:"generic_transformer_action"},{bold:!0,items:Kt(Ht,Tt.qs.ROW,n),label:function(){return"Row actions"},uuid:"row_actions_grouping"},{isGroupingTitle:!0,label:function(){return"Column actions"},uuid:"column_actions_grouping"}].concat((0,o.Z)(T));f||I.splice(1,0,{bold:!0,items:Vt(n,h.tf.TRANSFORMER,w),label:function(){return"Data sources"},uuid:"data_sources_grouping"});var A=(0,d.useCallback)((function(){return j(null)}),[]),R=(0,d.useCallback)((function(e){return null===v||void 0===v?void 0:v((function(n){return null===n||x!==e?t:null}))}),[t,x,v]),D=ve.q.PYSPARK===w;return(0,oe.jsx)(pe.Z,{flexWrap:"wrap",inline:!0,children:(0,oe.jsx)(de.Z,{onClickOutside:A,open:!0,children:(0,oe.jsxs)(pe.Z,{flexWrap:"wrap",children:[!l&&(0,oe.jsx)(Rt,{increasedZIndex:0===x,children:(0,oe.jsx)(Pt.Z,{disableKeyboardShortcuts:!0,items:Vt(n,h.tf.DATA_LOADER,w),onClickCallback:A,open:0===x,parentRef:y,uuid:"data_loader_button",children:(0,oe.jsx)(he.ZP,ni(ni({},C),{},{beforeElement:(0,oe.jsx)(At,{blue:!0,compact:i,children:(0,oe.jsx)(ze.mm,{size:E})}),onClick:function(e){e.preventDefault(),j((function(e){return 0===e?null:0})),R(0)},uuid:"AddNewBlocks/Data_loader",children:"Data loader"}))})}),!s&&(0,oe.jsx)(Rt,{increasedZIndex:1===x,children:(0,oe.jsx)(Pt.Z,{disableKeyboardShortcuts:!0,items:D||ve.q.INTEGRATION===w?I:S?[{items:Vt(n,h.tf.TRANSFORMER,w),label:function(){return"Python"},uuid:"transformers/python"}]:[{items:I,label:function(){return"Python"},uuid:"transformers/python_all"}].concat((0,o.Z)(qt(n,h.tf.TRANSFORMER))),onClickCallback:A,open:1===x,parentRef:k,uuid:"transformer_button",children:(0,oe.jsx)(he.ZP,ni(ni({},C),{},{beforeElement:(0,oe.jsx)(At,{compact:i,purple:!0,children:(0,oe.jsx)(ze.mm,{size:E})}),onClick:function(e){e.preventDefault(),j((function(e){return 1===e?null:1})),R(1)},uuid:"AddNewBlocks/Transformer",children:"Transformer"}))})}),!l&&(0,oe.jsx)(Rt,{increasedZIndex:2===x,children:(0,oe.jsx)(Pt.Z,{disableKeyboardShortcuts:!0,items:Vt(n,h.tf.DATA_EXPORTER,w),onClickCallback:A,open:2===x,parentRef:Z,uuid:"data_exporter_button",children:(0,oe.jsx)(he.ZP,ni(ni({},C),{},{beforeElement:(0,oe.jsx)(At,{compact:i,yellow:!0,children:(0,oe.jsx)(ze.mm,{inverted:!0,size:E})}),onClick:function(e){e.preventDefault(),j((function(e){return 2===e?null:2})),R(2)},uuid:"AddNewBlocks/Data_exporter",children:"Data exporter"}))})}),!c&&(0,oe.jsx)(Rt,{increasedZIndex:3===x,children:(0,oe.jsx)(Pt.Z,{disableKeyboardShortcuts:!0,items:[{label:function(){return"New model"},onClick:function(){null===g||void 0===g||g(!0),null===p||void 0===p||p(t)},uuid:"dbt/new_model"},{label:function(){return"Single model (from file)"},onClick:function(){return null===p||void 0===p?void 0:p(t)},uuid:"dbt/single_model"},{label:function(){return"All models (w/ optional exclusion)"},onClick:function(){return n({language:h.t6.YAML,type:h.tf.DBT})},uuid:"dbt/all_models"}],onClickCallback:A,open:3===x,parentRef:_,uuid:"dbt_button",children:(0,oe.jsx)(he.ZP,ni(ni({},C),{},{beforeElement:(0,oe.jsx)(Et,{size:It*(i?.75:1.25)}),onClick:function(e){e.preventDefault(),j((function(e){return 3===e?null:3})),R(3)},uuid:"AddNewBlocks/DBT",children:"DBT model"}))})}),!r&&(0,oe.jsx)(Rt,{increasedZIndex:4===x,children:(0,oe.jsx)(Pt.Z,{disableKeyboardShortcuts:!0,items:[{items:Xt(n,h.tf.CUSTOM,h.t6.PYTHON),label:function(){return"Python"},uuid:"custom_block_python"},{items:Xt(n,h.tf.CUSTOM,h.t6.SQL),label:function(){return"SQL"},uuid:"custom_block_sql"}],onClickCallback:A,open:4===x,parentRef:O,uuid:"custom_block_button",children:(0,oe.jsx)($n.Z,{block:!0,label:"Add a custom code block with a designated color.",maxWidth:P,size:null,children:(0,oe.jsx)(he.ZP,ni(ni({},C),{},{beforeElement:(0,oe.jsx)(At,{compact:i,children:(0,oe.jsx)(ze.I8,{size:E})}),onClick:function(e){e.preventDefault(),j((function(e){return 4===e?null:4})),R(4)},uuid:"AddNewBlocks/Scratchpad",children:"Custom"}))})})}),!a&&(0,oe.jsx)(Rt,{children:(0,oe.jsx)($n.Z,{block:!0,label:"Write experimental code that doesn\u2019t get executed when you run your pipeline.",maxWidth:P,size:null,children:(0,oe.jsx)(he.ZP,ni(ni({},C),{},{beforeElement:(0,oe.jsx)(At,{border:!0,compact:i,children:(0,oe.jsx)(ze.mm,{size:E})}),onClick:function(e){e.preventDefault(),n({type:h.tf.SCRATCHPAD})},uuid:"AddNewBlocks/Scratchpad",children:"Scratchpad"}))})}),!S&&(0,oe.jsx)(Rt,{children:!u&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)($n.Z,{block:!0,label:"Add a sensor so that other blocks only run when sensor is complete.",maxWidth:P,size:null,children:(0,oe.jsx)(he.ZP,ni(ni({},C),{},{beforeElement:(0,oe.jsx)(At,{compact:i,children:(0,oe.jsx)(ze.LM,{pink:!0,size:It*(i?.75:1.25)})}),onClick:function(e){e.preventDefault(),n({language:h.t6.PYTHON,type:h.tf.SENSOR})},uuid:"AddNewBlocks/Sensor",children:"Sensor"}))})})})]})})})},ii=t(2005),ri=t(31012),oi=["children"];function li(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 ci(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?li(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):li(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ai=Pe.default.p.withConfig({displayName:"Badge__BadgeStyle",componentId:"sc-tfqsp0-0"})(["border-radius:","px;display:inline;font-family:",";margin:0;",";"," ",";",";"," "," ",""],hn.BG,ii.ry,ri.iD,(function(e){return e.small&&"\n ".concat(ri.HC,";\n ")}),(function(e){return!e.regular&&"\n padding: 2px 4px;\n "}),(function(e){return e.regular&&"\n padding: ".concat(1*ie.iI,"px ").concat(1.25*ie.iI,"px;\n ")}),(function(e){return!e.disabled&&"\n background-color: ".concat((e.theme||pn.Z).background.row,";\n color: ").concat((e.theme||pn.Z).content.muted,";\n ")}),(function(e){return e.disabled&&"\n background-color: ".concat((e.theme||pn.Z).feature.disabled,";\n color: ").concat((e.theme||pn.Z).content.disabled,";\n ")}),(function(e){return e.quantifier&&"\n border-radius: 34px;\n line-height: 10px;\n padding: 4px 6px;\n "})),ui=function(e){var n=e.children,t=(0,Ee.Z)(e,oi);return(0,oe.jsx)(ai,ci(ci({},t),{},{children:n}))},si=t(89565),di=t.n(si),fi=t(62976),pi=t(34744),hi=Pe.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-n38rkq-0"})([""," border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;overflow:hidden;"," "," ",""],Ke.Kf,(function(e){return e.addBottomPadding&&"\n padding-bottom: ".concat(2*ie.tr,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme.background||pn.Z.background).table,";\n ")}),(function(e){return!e.executedAndIdle&&"\n border-bottom-left-radius: ".concat(hn.n_,"px;\n border-bottom-right-radius: ").concat(hn.n_,"px;\n border-bottom-style: solid;\n border-bottom-width: 2px;\n ")})),mi=Pe.default.div.withConfig({displayName:"indexstyle__OutputRowStyle",componentId:"sc-n38rkq-1"})([""," "," ",""],(function(e){return e.first&&"\n padding-top: ".concat(ie.iI*ie.cd,"px;\n ")}),(function(e){return e.last&&"\n padding-bottom: ".concat(ie.iI*ie.cd,"px;\n ")}),(function(e){return e.contained&&"\n padding-left: ".concat(Ke.oh,"px;\n padding-right: ").concat(ie.iI*ie.cd,"px;\n ")})),vi=Pe.default.div.withConfig({displayName:"indexstyle__HTMLOutputStyle",componentId:"sc-n38rkq-2"})(["table{"," border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;}td,th{padding:0 8px;}a{","}"],Ke.Kf,(function(e){return"\n color: ".concat((e.theme.interactive||pn.Z.interactive).linkPrimary,";\n ")})),gi=Pe.default.div.withConfig({displayName:"indexstyle__ExtraInfoStyle",componentId:"sc-n38rkq-3"})([""," border-bottom-style:solid;border-bottom-width:2px;border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;",""],Ke.Kf,(function(e){return"\n background-color: ".concat((e.theme.borders||pn.Z.borders).light,";\n border-bottom-left-radius: ").concat(hn.n_,"px;\n border-bottom-right-radius: ").concat(hn.n_,"px;\n ")})),bi=Pe.default.div.withConfig({displayName:"indexstyle__ExtraInfoContentStyle",componentId:"sc-n38rkq-4"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;"],ie.iI,Ke.oh,ie.iI*ie.cd,ie.iI),xi=Pe.default.div.withConfig({displayName:"indexstyle__ExtraInfoBorderStyle",componentId:"sc-n38rkq-5"})(["height:1px;width:100%;",""],(function(e){return"\n border-top: 1px solid ".concat((e.theme.borders||pn.Z.borders).medium,";\n ")})),ji=/\[__internal_output__\]/,yi=/\[__internal_test__\]/;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,c.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}function _i(e){var n={},t={};return null===e||void 0===e||e.forEach((function(e){var i=e.content,r=e.outputs,o=e.uuid;(null===r||void 0===r?void 0:r.length)>=1&&(n[o]=r.map((function(e){var n=e||{},t=n.sample_data,i=n.shape,r=n.text_data,o=n.type;return t?{data:Zi({shape:i},t),type:o}:r&&(0,re.Pb)(r)?JSON.parse(r):r}))),t[o]=i})),{content:t,messages:n}}function Oi(e,n,t){e.forEach((function(e){(0,ke.t8)("".concat(t,"/").concat(e.uuid,"/codeCollapsed"),(0,ke.Od)("".concat(n,"/").concat(e.uuid,"/codeCollapsed"))),(0,ke.t8)("".concat(t,"/").concat(e.uuid,"/outputCollapsed"),(0,ke.Od)("".concat(n,"/").concat(e.uuid,"/outputCollapsed")))}))}function Ci(e){return"".concat(e,"/").concat(ke.kP)}function wi(e){return(0,ke.U2)(Ci(e),[])}function Si(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 Ei(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Si(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Si(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Pi=function(e){var n=e.block,t=e.collapsed,i=e.contained,r=void 0===i||i,l=e.dynamicBlock,c=e.dynamicChildBlock,a=e.hasError,u=e.hideExtraInfo,s=e.isInProgress,f=e.mainContainerWidth,p=e.messages,m=e.openSidekickView,v=e.pipeline,g=e.runCount,b=e.runEndTime,x=e.runStartTime,j=e.selected,y=e.setCollapsed,k=e.setOutputBlocks,Z=e.setSelectedOutputBlock,_=n.status,O=n.type,C=(0,d.useMemo)((function(){return(null===p||void 0===p?void 0:p.length)||0}),[p]),w=h.DA.EXECUTED===_||!s&&0===g&&C>=1||!s&&g>=1&&b>=x,S=(0,d.useState)(),E=S[0],P=S[1],T=(0,d.useState)(),I=T[0],A=T[1];(0,d.useEffect)((function(){s||A(100)}),[s]);var R=function(e){return Array.isArray(e)?e.join("\n"):e},D=(0,d.useMemo)((function(){return p.reduce((function(e,n){var t=e.at(-1);return Nn.jU.includes(null===t||void 0===t?void 0:t.type)&&(null===t||void 0===t?void 0:t.type)===n.type&&!R(null===n||void 0===n?void 0:n.data).match(ji)?t.data+=R(n.data):Nn.jU.includes(null===n||void 0===n?void 0:n.type)&&!R(null===n||void 0===n?void 0:n.data).match(ji)?e.push(Ei(Ei({},n),{},{data:R(n.data)})):e.push(Ei({},n)),e}),[])}),[p]),M=(0,d.useMemo)((function(){return(0,oe.jsx)(dn.Z,{progress:I})}),[I]),N=(0,d.useMemo)((function(){var e=function(e,n){var t=e.columns,i=e.index,r=e.rows,o=e.shape,l=n.borderTop,c=n.selected;return o&&P(o),r.length>=1&&(0,oe.jsx)(fi.Z,{columns:t,disableScrolling:!c,index:i,maxHeight:60*ie.iI,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!l,rows:r,width:f-(2+ie.cd*ie.iI*2+2+nt.nn)})},n=[],t=[];return null===D||void 0===D||D.forEach((function(i,o){var l=i.data,c=i.type;if(l&&0!==(null===l||void 0===l?void 0:l.length)){var a=[],u=(a=(a=Array.isArray(l)?l:[l]).filter((function(e){return e}))).length,s=[];a.forEach((function(n,i){var l,a={contained:r,first:0===o&&0===i,last:o===D.length-1&&i===u-1},d=o>=1;if("string"===typeof n&&n.match(yi)){var f=n.split("\n"),p=[];f.forEach((function(e){if(e.match(yi)){var i=e.split("[__internal_test__]"),r=i[i.length-1];(0,re.Pb)(r)&&t.push(JSON.parse(r))}else p.push(e);n=p.length>=1?p.join("\n"):null}))}if(null!==n){if("string"===typeof n&&n.match(ji)){var h=n.split("[__internal_output__]"),m=h[h.length-1],v=m.split("FloatProgress");if(h.length>=2&&(m=v[0]),(0,re.Pb)(m)){var g=JSON.parse(m),b=g.data,x=g.type;Nn.Gi.TABLE===x&&(l=e(b,{borderTop:d,selected:j}),!0)}}else if(c===Nn.Gi.TABLE)l=e((0,re.Pb)(n)?JSON.parse(n):n,{borderTop:d,selected:j}),!0;else if(Nn.jU.includes(c)){var y,k=null===(y=n)||void 0===y?void 0:y.split("\\n");l=(0,oe.jsx)(mi,Ei(Ei({},a),{},{children:k.map((function(e){return(0,oe.jsx)(be.ZP,{monospace:!0,preWrap:!0,children:(0,oe.jsx)(di(),{children:e})},e)}))}))}else if(c===Nn.Gi.TEXT_HTML)l=(0,oe.jsx)(mi,Ei(Ei({},a),{},{children:(0,oe.jsx)(vi,{children:(0,oe.jsx)(be.ZP,{dangerouslySetInnerHTML:{__html:n},monospace:!0})})}));else if(c===Nn.Gi.IMAGE_PNG)l=(0,oe.jsx)("div",{style:{backgroundColor:"white"},children:(0,oe.jsx)("img",{alt:"Image ".concat(o," from code output"),src:"data:image/png;base64, ".concat(n)})});else if(c===Nn.Gi.PROGRESS){var Z=parseInt(n);A(Z>90?90:Z)}l&&s.push((0,oe.jsx)("div",{children:l},"code-output-".concat(o,"-").concat(i)))}})),s.length>=1&&n.push(s)}})),s&&(null===v||void 0===v?void 0:v.type)===ve.q.PYSPARK&&n.unshift([(0,oe.jsx)(mi,{contained:!0,children:(0,oe.jsx)(ge.Z,{mt:1,children:M})},"progress_bar")]),{content:n,testContent:t}}),[D,r,f,I,M,j]),B=N.content,L=N.testContent,F=(null===E||void 0===E?void 0:E[1])||0,H=F>30?" (30 out of ".concat(F," columns displayed)"):"";return(0,oe.jsxs)(oe.Fragment,{children:[r&&(0,oe.jsxs)(hi,{addBottomPadding:s&&(null===v||void 0===v?void 0:v.type)===ve.q.PYSPARK,blockType:O,dynamicBlock:l,dynamicChildBlock:c,executedAndIdle:w,hasError:a,selected:j,children:[!t&&(null===L||void 0===L?void 0:L.length)>=1&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ge.Z,{py:2,children:(0,oe.jsx)(mi,{contained:!0,children:L.map((function(e,n){var t=e.error,i=e.message,r=e.stacktrace;return(0,oe.jsxs)(ge.Z,{mt:n>=1?3:0,children:[(0,oe.jsx)(be.ZP,{monospace:!0,preWrap:!0,children:(0,oe.jsx)(di(),{children:"".concat(i).concat(t?" "+t:"")})}),null===r||void 0===r?void 0:r.map((function(e){return(0,oe.jsx)(be.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:(0,oe.jsx)(di(),{children:e})},e)}))]},i)}))})}),(0,oe.jsx)(ge.Z,{mb:a?2:0,children:(0,oe.jsx)(pi.Z,{medium:!0})})]}),!t&&B]}),!r&&B,w&&!u&&(0,oe.jsxs)(gi,{blockType:O,dynamicBlock:l,dynamicChildBlock:c,hasError:a,selected:j,children:[(0,oe.jsx)(xi,{}),(0,oe.jsxs)(pe.Z,{justifyContent:"space-between",children:[y&&(0,oe.jsx)(In.Z,{alignItems:"center",px:1,children:(0,oe.jsx)(se.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return y(!t)},transparent:!0,children:t?(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(ze._M,{muted:!0,size:2*ie.iI}),"\xa0",(0,oe.jsx)(be.ZP,{default:!0,children:"Expand output"})]}):(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(ze.Kh,{muted:!0,size:2*ie.iI}),E&&(0,oe.jsx)(ge.Z,{ml:2,children:(0,oe.jsx)(be.ZP,{children:"".concat(E[0]," rows x ").concat(E[1]," columns").concat(H)})})]})})}),(0,oe.jsx)(bi,{children:(0,oe.jsxs)(pe.Z,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,oe.jsx)($n.Z,{appearAbove:!0,appearBefore:!0,block:!0,label:g>=1&&x?"Last run at ".concat(new Date(x.valueOf()).toLocaleString()):a?"Block executed with errors":"Block executed successfully",size:null,widthFitContent:!0,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[g>=1&&Number(b)>Number(x)&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(be.ZP,{small:!0,children:[(Number(b)-Number(x))/1e3,"s"]}),(0,oe.jsx)(ge.Z,{mr:1})]}),!a&&(0,oe.jsx)(ze.Jr,{size:2*ie.iI,success:!0}),a&&(0,oe.jsx)(Te.Z,{danger:!0,size:2*ie.iI,children:(0,oe.jsx)(be.ZP,{bold:!0,monospace:!0,small:!0,children:"!"})})]})}),!a&&!h.Qj.includes(O)&&(0,oe.jsx)(ge.Z,{pl:1,children:(0,oe.jsx)(se.Z,{afterIcon:(0,oe.jsx)(ze.M0,{muted:!0,size:1.75*ie.iI}),basic:!0,noPadding:!0,onClick:function(){!function(e,n){var t=wi(e);t.includes(n)||(0,ke.t8)(Ci(e),[].concat((0,o.Z)(t),[n]))}(null===v||void 0===v?void 0:v.uuid,n.uuid),m(Ae.DATA),k((function(e){return e.find((function(e){return e.uuid===n.uuid}))?e:(Z(n),e.concat(n))}))},transparent:!0,children:(0,oe.jsx)(be.ZP,{default:!0,children:"Expand table"})})})]})})]})]})]})},Ti=t(40656),Ii=Pe.default.svg.withConfig({displayName:"Convert__SVGStyle",componentId:"sc-fmw0vr-0"})([""]),Ai=function(e){var n=e.fill,t=e.opacity,i=e.size,r=void 0===i?Ti.C:i,o=e.style,l=e.viewBox,c=void 0===l?"0 0 12 12":l;return(0,oe.jsxs)(Ii,{fill:n,height:r,opacity:t,style:o,viewBox:c,width:r,children:[(0,oe.jsx)("path",{clipRule:"evenodd",d:"M2.5 1C1.67157 1 1 1.67157 1 2.5v.0625c0 .27614-.223858.5-.5.5s-.5-.22386-.5-.5V2.5C0 1.11929 1.11929 0 2.5 0h7C10.8807 0 12 1.11929 12 2.5v7c0 1.3807-1.1193 2.5-2.5 2.5h-7C1.11929 12 0 10.8807 0 9.5v-.0625c0-.27614.223858-.5.5-.5s.5.22386.5.5V9.5c0 .8284.67157 1.5 1.5 1.5h7c.8284 0 1.5-.6716 1.5-1.5v-7c0-.82843-.6716-1.5-1.5-1.5h-7z",fill:"url(#paint0_linear_1332_60037)",fillRule:"evenodd"}),(0,oe.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.05806 3.55806c.24408-.24408.6398-.24408.88388 0l2 2c.24408.24408.24408.6398 0 .88388l-2 2c-.24408.24408-.6398.24408-.88388 0-.24408-.24408-.24408-.6398 0-.88388l.93306-.93306H1C.654822 6.625.375 6.34518.375 6s.279822-.625.625-.625h5.99112l-.93306-.93306c-.24408-.24408-.24408-.6398 0-.88388z",fill:"#fff"}),(0,oe.jsx)("defs",{children:(0,oe.jsxs)("linearGradient",{id:"paint0_linear_1332_60037",x1:"-.618557",y1:"-.000001",x2:"10.5709",y2:".83113",gradientUnits:"userSpaceOnUse",children:[(0,oe.jsx)("stop",{stopColor:"#FFCC19"}),(0,oe.jsx)("stop",{offset:".585938",stopColor:"#2ECDF7"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#9E7BFF"})]})})]})},Ri=t(79749),Di=t(54283);function Mi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ni(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Mi(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Mi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Bi=function(e,n){var t=(null===n||void 0===n?void 0:n.upstream_blocks)||[];return h.tf.CHART===e.type||h.tf.SCRATCHPAD===e.type||h.tf.CHART===(null===n||void 0===n?void 0:n.type)||h.tf.SCRATCHPAD===(null===n||void 0===n?void 0:n.type)||h.tf.DATA_LOADER===(null===n||void 0===n?void 0:n.type)&&h.tf.SENSOR!==e.type||t.push(e.uuid),t},Li=function(e,n,t,i){for(var r,o=[],l=n.findIndex((function(n){return n.uuid===e.uuid}));!r&&l>=0;){var c;r=n[l-1],h.tf.SCRATCHPAD===(null===(c=r)||void 0===c?void 0:c.type)&&(r=null),l-=1}return r&&o.push(r.uuid),h.Ut.map((function(n){return{label:function(){return"Convert to ".concat((0,re.wX)(h.V4[n]))},onClick:function(){return i({converted_from:e.uuid,type:n,upstream_blocks:o})},uuid:"".concat(t,"/convert_to/").concat(n)}}))},Fi=function(e,n,t,i,r,o){var l=[{label:function(){return"Execute with upstream blocks"},onClick:function(){return n({block:e,runUpstream:!0})},uuid:"execute_upstream"},{label:function(){return"Execute block and run tests"},onClick:function(){return n({block:e,runTests:!0})},uuid:"run_tests"}],c=e||{},a=c.configuration,u=c.downstream_blocks,s=c.upstream_blocks,d=a||{},f=d.dynamic,p=d.reduce_output,h=o||{},m=h.blocksMapping,v=h.savePipelineContent,g=[];(u.forEach((function(e){var n=null===m||void 0===m?void 0:m[e];n&&n.upstream_blocks.forEach((function(e){var n,t;null!==m&&void 0!==m&&null!==(n=m[e])&&void 0!==n&&null!==(t=n.configuration)&&void 0!==t&&t.dynamic&&g.push(m[e])}))})),v&&(f||0===g.length)&&l.push({label:function(){return f?"Disable block as dynamic":"Set block as dynamic"},onClick:function(){return v({block:Ni(Ni({},e),{},{configuration:Ni(Ni({},a),{},{dynamic:!f})})})},uuid:"dynamic"}),m)&&((null===s||void 0===s?void 0:s.find((function(e){var n,t;return null===m||void 0===m||null===(n=m[e])||void 0===n||null===(t=n.configuration)||void 0===t?void 0:t.dynamic})))&&l.push({label:function(){return p?"Don\u2019t reduce output":"Reduce output"},onClick:function(){return v({block:Ni(Ni({},e),{},{configuration:Ni(Ni({},a),{},{reduce_output:!p})})})},uuid:"reduce_output"}));return l.push({label:function(){return"Delete block"},onClick:function(){t(e),i(!1)},uuid:"delete_block"}),r?[l.pop()]:l};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 Ui(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,c.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 zi,Gi=function(e){var n=e.addNewBlock,t=e.addWidget,i=e.block,r=e.blocks,o=e.deleteBlock,l=e.executionState,c=e.interruptKernel,a=e.pipelineType,u=e.runBlock,s=e.savePipelineContent,f=e.setOutputCollapsed,p=(e.visible,i.all_upstream_blocks_executed),v=void 0===p||p,g=i.color,b=i.type,x=i.uuid,j=(0,d.useRef)(null),y=(0,d.useRef)(null),k=(0,d.useRef)(null),Z=(0,d.useRef)(null),_=(0,d.useState)(!1),O=_[0],C=_[1],w=(0,d.useState)(!1),S=w[0],E=w[1],P=(0,d.useState)(!1),T=P[0],I=P[1],A=(0,d.useState)(!1),R=A[0],D=A[1],M=(0,d.useContext)(Pe.ThemeContext),N=Nn.uF.IDLE!==l,B=(0,Ke.qn)(b,{blockColor:g,theme:M}).accent,L=a===ve.q.STREAMING,F=(0,d.useMemo)((function(){return Li(i,r,"CommandButtons",n).map((function(e){return Ui(Ui({},e),{},{onClick:function(){return s().then((function(){return e.onClick()}))}})}))}),[n,i,r,s]),H=(0,d.useMemo)((function(){return(0,tn.HK)(r,(function(e){return e.uuid}))}),[r]);return(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[Nn.uF.QUEUED===l&&(0,oe.jsx)(Di.Z,{color:(M||pn.Z).content.active,type:"cylon"}),Nn.uF.BUSY===l&&(0,oe.jsx)(Di.Z,{color:(M||pn.Z).content.active}),!N&&!L&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)($n.Z,{appearBefore:!0,default:!0,label:(0,oe.jsxs)(be.ZP,{children:["Run block \xa0 \xa0",(0,oe.jsx)(Ri.Z,{inline:!0,keyTextGroups:[[Vn()?je.RJ:je.hE,je.Lz]],monospace:!0,uuidForKey:x})]}),size:3*ie.iI,widthFitContent:!0,children:(0,oe.jsx)(se.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){v?u({block:i}):I(!0)},children:(0,oe.jsx)(Te.Z,{color:B,size:3*ie.iI,children:(0,oe.jsx)(ze.Py,{black:!0,size:1.5*ie.iI})})})}),(0,oe.jsx)(de.Z,{disableEscape:!0,onClickOutside:function(){return I(!1)},open:T,children:(0,oe.jsx)(m.Z,{items:[{label:function(){return"Execute block"},onClick:function(){return u({block:i})},uuid:"execute_block"},{label:function(){return"Execute with upstream blocks"},onClick:function(){return u({block:i,runUpstream:!0})},uuid:"execute_upstream"}],onClickCallback:function(){return I(!1)},open:T,parentRef:k,rightOffset:13.25*ie.iI,topOffset:4.5*ie.iI,uuid:"execute_actions",width:25*ie.iI})})]}),N&&(0,oe.jsx)(ge.Z,{ml:ie.cd,children:(0,oe.jsx)($n.Z,{appearBefore:!0,default:!0,label:(0,oe.jsxs)(be.ZP,{children:["Interrupt kernel \xa0 \xa0",(0,oe.jsx)(Ri.Z,{inline:!0,keyTextGroups:[[je.kA],[je.kA]],monospace:!0,uuidForKey:x})]}),size:2.5*ie.iI,widthFitContent:!0,children:(0,oe.jsx)(se.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return c()},children:(0,oe.jsx)(Te.Z,{borderSize:1.5,size:2.5*ie.iI,children:(0,oe.jsx)(ze.x8,{size:1*ie.iI})})})})}),h.tf.SCRATCHPAD===i.type&&!L&&(0,oe.jsx)(ge.Z,{ml:ie.cd,children:(0,oe.jsx)(Pt.Z,{items:F,onClickCallback:function(){return E(!1)},onClickOutside:function(){return E(!1)},open:S,parentRef:y,rightOffset:0,topOffset:4,uuid:"CommandButtons/convert_block",children:(0,oe.jsx)($n.Z,{appearBefore:!0,default:!0,label:(0,oe.jsx)(be.ZP,{children:"Convert block"}),size:2.5*ie.iI,widthFitContent:!0,children:(0,oe.jsx)(se.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return E(!S)},ref:y,children:(0,oe.jsx)(Ai,{size:2.5*ie.iI})})})})}),[h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(i.type)&&!L&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ge.Z,{ml:ie.cd,ref:j,children:(0,oe.jsx)($n.Z,{appearBefore:!0,default:!0,label:"Add chart",size:2.25*ie.iI,widthFitContent:!0,children:(0,oe.jsx)(se.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return C((function(e){return!e}))},children:(0,oe.jsx)(ze.er,{size:2.25*ie.iI})})})}),(0,oe.jsx)(de.Z,{disableEscape:!0,onClickOutside:function(){return C(!1)},open:O,children:(0,oe.jsx)(ae,{addWidget:t,block:i,onClickCallback:function(){return C(!1)},open:O,parentRef:j,rightOffset:9*ie.iI,runBlock:u,topOffset:2*ie.iI})})]}),(0,oe.jsx)("div",{ref:Z,children:(0,oe.jsx)(ge.Z,{ml:ie.cd,children:(0,oe.jsx)($n.Z,{appearBefore:!0,default:!0,label:(0,oe.jsx)(be.ZP,{children:"More actions"}),size:2.5*ie.iI,widthFitContent:!0,children:(0,oe.jsx)(se.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return D((function(e){return!e}))},children:(0,oe.jsx)(Te.Z,{borderSize:1.5,size:2.5*ie.iI,children:(0,oe.jsx)(ze.mH,{size:ie.iI})})})})})}),(0,oe.jsx)(de.Z,{disableEscape:!0,onClickOutside:function(){return D(!1)},open:R,children:(0,oe.jsx)(m.Z,{items:Fi(i,u,o,f,L,{blocksMapping:H,savePipelineContent:s}),onClickCallback:function(){return D(!1)},open:R,parentRef:Z,rightOffset:4.75*ie.iI,topOffset:2*ie.iI,uuid:"FileHeaderMenu/file_items"})})]})};!function(e){e.APPEND="append",e.FAIL="fail",e.REPLACE="replace"}(zi||(zi={}));var Wi,Qi=[zi.APPEND,zi.FAIL,zi.REPLACE];!function(e){e.BIGQUERY="bigquery",e.MYSQL="mysql",e.POSTGRES="postgres",e.REDSHIFT="redshift",e.SNOWFLAKE="snowflake"}(Wi||(Wi={}));var qi,Vi=t(55378);!function(e){e.DATA_EXPORTER="data_exporter",e.DATA_LOADER="data_loader",e.MAGE_LIBRARY="mage_library",e.TRANSFORMER="transformer",e.USER_LIBRARY="user_library"}(qi||(qi={}));var Yi=t(5677);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 Xi(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,c.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}function Ji(e,n){var t=e;t.includes("__init__")||t.push("__init__");var i,r=t.length;return(0,tn.w6)(r).forEach((function(e,o){if(i)return i;var l=t.slice(0,r-o).join("/");i=n["".concat(l,".py")]})),i}function $i(e,n,t){var i,r,o;return((null===(i=t.outputs)||void 0===i||null===(r=i[0])||void 0===r||null===(o=r.sample_data)||void 0===o?void 0:o.columns)||[]).map((function(t){return{label:"".concat(t," column"),kind:e.languages.CompletionItemKind.Variable,insertText:"'".concat(t,"'"),range:n}}))}function er(e,n){var t=e.word.split(""),i=new RegExp(t.reduce((function(e,n,i){var r=t[i+1],o=r?"^".concat(r):"";return e+"".concat(n,"[w ").concat(o,"]*")}),""));return n.reduce((function(e,n){return n.label.match(i)?e.concat(n):e}),[])}function nr(e){var n=e.autocompleteItems,t=e.block,i=e.blocks,r=e.pipeline,c=t.type,a=t.upstream_blocks,u=(0,tn.HK)(n,(function(e){return e.id}));return function(t){return function(s,d){var f=[],p=s.getValueInRange({endColumn:d.column,endLineNumber:d.lineNumber,startColumn:1,startLineNumber:1}),m=s.getWordUntilPosition(d),v=m.endColumn,g=m.startColumn,b={endColumn:v,endLineNumber:d.lineNumber,startColumn:g,startLineNumber:d.lineNumber},x=function(e,n,t){var i=(0,Yi.Yn)(e),r=(0,Yi.M4)(e,n),o=i.find((function(e){var n=e.variableName;return r.match(new RegExp(n))}));if(o){var l=o.assignmentValue,c=(0,Yi.S0)(e)[l];if(c){var a,u=Ji(c.split(" as ")[0].replace("from ","").replace("import ","").split(" ").reduce((function(e,n){return n.trim()?e.concat(n):e}),[]).join(".").split("."),t),s=(0,Yi.rW)(c,l);return null===u||void 0===u||null===(a=u.methods_for_class)||void 0===a?void 0:a[s]}}return[]}(p,b,u);if((null===x||void 0===x?void 0:x.length)>=1){var j=er(m,x.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Method,label:e,range:b}})));if(j.length>=1)return{suggestions:j}}var y=function(e,n,t){var i=(0,Yi.M4)(e,n);if(i=i.match(/([\w_]+)./)){var r=(0,Yi.S0)(e)[i[1]];if(r){var o=Ji(r.split(" as ")[0].replace("from ","").replace("import ","").split(" ").reduce((function(e,n){return n.trim()?e.concat(n):e}),[]).join(".").split("."),t);if(null!==o&&void 0!==o&&o.functions)return null===o||void 0===o?void 0:o.functions}}return[]}(p,b,u);if((null===y||void 0===y?void 0:y.length)>=1){var k=er(m,y.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Function,label:e,range:b}})));if(k.length>=1)return{suggestions:k}}if((null===a||void 0===a?void 0:a.length)>=1){var Z=new RegExp("\n@".concat(c));p.match(Z)&&f.push.apply(f,(0,o.Z)(er(m,function(e,n,t){var i=t.block,r=t.blocks,o=i.upstream_blocks,l=(0,tn.HK)(r,(function(e){return e.uuid}));return o.map((function(t,i){var r=l[t].type,o=0===i?"output_0":"args[".concat(i-1,"]");return{label:"df ".concat(t," ").concat(r," block"),kind:e.languages.CompletionItemKind.Variable,documentation:"Variable for ".concat(r," ").concat(t," data."),insertText:o,range:n}}))}(t,b,e))))}if(m.word.match(/i|f/)){var _=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,t=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=(arguments.length>2?arguments[2]:void 0).word,c=new Set,a={};e.forEach((function(e){var n=e.group,t=e.id,i=e.imports;if([qi.MAGE_LIBRARY,qi.USER_LIBRARY].includes(n)){var r=t;r.match(/__init__.py/)&&(r=r.replace(/\/__init__.py/,"")),r=r.split(".py")[0].replaceAll("/","."),a[r]=e}var o=t.replace(".py","").replace("/__init__","").split("/");if(1===o.length)c.add("import ".concat(o[0]));else if(o.length>=2){var l=o.slice(0,o.length-1).join(".");c.add("from ".concat(l," import ").concat(o[o.length-1]))}i.forEach((function(e){return c.add(e)}))}));var u,s="i"===r,d="f"===r,f=s?"import":d?"from":"",p=(0,Yi.M4)(n,i);if(s&&p.match(/from/)&&(u=p.match(/from ([A-Za-z0-9_.]+) /)[1]),u&&a[u]){var h=a[u],m=h.classes,v=h.constants,g=h.files,b=h.functions,x=[];return[[v,t.languages.CompletionItemKind.Constant],[m,t.languages.CompletionItemKind.Class],[b,t.languages.CompletionItemKind.Function]].forEach((function(e){var n=(0,l.Z)(e,2),t=n[0],r=n[1];t.forEach((function(e){x.push({filterText:"import ".concat(e),insertText:"import ".concat(e),kind:r,label:e,range:i})}))})),g.forEach((function(e){var n=e.split("/"),r=n[n.length-1].split(".py")[0];x.push({filterText:"import ".concat(r),insertText:"import ".concat(r),kind:t.languages.CompletionItemKind.Variable,label:r,range:i})})),x}return(0,o.Z)(c).map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.File,label:e,range:i}})).concat(Object.entries(a).map((function(e){var n=(0,l.Z)(e,2),r=n[0];return n[1],{filterText:"".concat(f," ").concat(r),insertText:"".concat(f," ").concat(r," "),kind:t.languages.CompletionItemKind.File,label:"".concat(r),range:Xi({},i)}})))}(n,p,m,t,b,e);f.push.apply(f,(0,o.Z)(_))}if(h.tf.CHART===c||h.tf.SCRATCHPAD===c){var O=[];if(h.tf.CHART===c?a.forEach((function(e,n){O.push({block:i.find((function(n){var t=n.uuid;return e===t})),matchIndex:0,variableName:"df_".concat(n+1)})})):h.tf.SCRATCHPAD===c&&function(e,n){return e.map((function(e){return{block:e,regex:new RegExp("([\\w_]+)[ ]*=[ ]*get_variable\\('".concat(n.uuid,"', '").concat(e.uuid,"', 'output_0'\\)"),"g")}}))}(i,r).forEach((function(e){var n=e.block,t=e.regex,i=p.matchAll(t);(0,o.Z)(i).forEach((function(e){var t=null===e||void 0===e?void 0:e.index,i=null===e||void 0===e?void 0:e[1];i&&O.push({block:n,matchIndex:t,variableName:i})}))})),O.length>=1){var C,w=null===(C=p.split("\n")[d.lineNumber-1])||void 0===C?void 0:C.slice(0,m.startColumn-1);if(w){var S=[];if(O.forEach((function(e){var n=e.block,i=e.matchIndex,r=e.variableName,o=new RegExp("".concat(r,"\\["));w.match(o)&&S.push({items:$i(t,b,n),matchIndex:i})})),S.length>=1)return{suggestions:er(m,(0,tn.YC)(S,"matchIndex",{ascending:!1})[0].items)}}}1===g&&(h.tf.CHART===c?f.push.apply(f,(0,o.Z)(er(m,a.map((function(e,n){var i="df_".concat(n+1);return{label:"".concat(i," ").concat(e," block"),kind:t.languages.CompletionItemKind.Snippet,insertText:i,range:b}}))))):h.tf.SCRATCHPAD===c&&f.push.apply(f,(0,o.Z)(er(m,function(e,n,t){var i=t.block,r=t.blocks,o=t.pipeline;return r.reduce((function(t,r){var l=r.type,c=r.uuid;return i.uuid!==c&&[h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(l)?t.concat({label:"df ".concat(c," ").concat(l," block"),kind:e.languages.CompletionItemKind.Snippet,documentation:"Get the data from ".concat(l," block ").concat(c,"."),insertText:"from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(o.uuid,"', '").concat(c,"', 'output_0')\n"),range:n}):t}),[])}(t,b,e)))))}var E=new Set;i.concat({content:p}).forEach((function(e){var n=e.content;(0,o.Z)(n.matchAll("([A-Za-z_0-9]+)","g")).forEach((function(e){return E.add(e[1])}))}));var P=(0,o.Z)(E);if(P.length){var T=P.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Variable,label:e,range:b}}));f.push.apply(f,(0,o.Z)(er(m,T)))}return{suggestions:f}}}}var tr=t(66166),ir=t(32365),rr=t(80636),or=t(25958),lr=t(87323);function cr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ar(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?cr(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):cr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function ur(e,n){var t,i,r,a,u,s,p,m,v,g,b,x,j,y,k,Z,_,O=e.addNewBlock,C=e.addNewBlockMenuOpenIdx,w=e.addWidget,S=e.autocompleteItems,B=e.block,L=e.blockIdx,F=e.blockRefs,H=e.blocks,U=e.dataProviders,z=e.defaultValue,G=void 0===z?"":z,W=e.deleteBlock,Q=e.executionState,q=e.fetchFileTree,V=e.fetchPipeline,Y=e.height,K=e.interruptKernel,X=e.mainContainerRef,J=e.mainContainerWidth,$=e.messages,ee=void 0===$?[]:$,ne=e.noDivider,te=e.onChange,le=e.onClickAddSingleDBTModel,ce=e.openSidekickView,ae=e.pipeline,ue=e.runBlock,de=e.runningBlocks,he=e.savePipelineContent,me=e.selected,ye=e.setAddNewBlockMenuOpenIdx,_e=e.setAnyInputFocused,Oe=e.setCreatingNewDBTModel,Ce=e.setEditingBlock,we=e.setOutputBlocks,Se=e.setRecsWindowOpenBlockIdx,Ee=e.setSelected,Ie=e.setSelectedOutputBlock,Ae=e.setTextareaFocused,Re=e.textareaFocused,De=e.widgets,Me=(0,d.useContext)(Pe.ThemeContext),Ne=(0,d.useState)(!1),Be=Ne[0],Le=Ne[1],Fe=(0,d.useState)(null),He=Fe[0],Ue=Fe[1],Ge=(0,d.useState)(!1),We=Ge[0],Qe=Ge[1],qe=(0,d.useState)(!1),Ve=qe[0],Ye=qe[1],Xe=(0,d.useState)(G),Je=Xe[0],$e=Xe[1],en=(0,d.useState)(null),nn=en[0],rn=en[1],on=(0,d.useState)((g={},(0,c.Z)(g,E,null===B||void 0===B||null===(t=B.configuration)||void 0===t?void 0:t.data_provider),(0,c.Z)(g,P,null===B||void 0===B||null===(i=B.configuration)||void 0===i?void 0:i.data_provider_database),(0,c.Z)(g,T,null===B||void 0===B||null===(r=B.configuration)||void 0===r?void 0:r.data_provider_profile),(0,c.Z)(g,I,null===B||void 0===B||null===(a=B.configuration)||void 0===a?void 0:a.data_provider_schema),(0,c.Z)(g,A,null===B||void 0===B||null===(u=B.configuration)||void 0===u?void 0:u.data_provider_table),(0,c.Z)(g,D,null===B||void 0===B||null===(s=B.configuration)||void 0===s?void 0:s.dbt_profile_target),(0,c.Z)(g,R,null===B||void 0===B||null===(p=B.configuration)||void 0===p?void 0:p.dbt_project_name),(0,c.Z)(g,M,(null===B||void 0===B||null===(m=B.configuration)||void 0===m?void 0:m.export_write_policy)||zi.APPEND),(0,c.Z)(g,N,!(null===B||void 0===B||null===(v=B.configuration)||void 0===v||!v.use_raw_sql)),g)),ln=on[0],cn=on[1],un=(0,d.useState)(null),sn=un[0],dn=un[1],fn=(0,d.useState)(!1),pn=fn[0],hn=fn[1],mn=(0,d.useState)(B.uuid),vn=mn[0],bn=mn[1],xn=(0,d.useState)(!1),jn=xn[0],yn=xn[1],kn=(0,d.useState)(0),_n=kn[0],On=kn[1],Cn=(0,d.useState)(null),wn=Cn[0],Sn=Cn[1],En=(0,d.useState)(null),Pn=En[0],Tn=En[1],An=(0,d.useState)(ee),Rn=An[0],Dn=An[1],Bn=h.tf.DBT===(null===B||void 0===B?void 0:B.type),Ln=(0,tr.Z)(B);(0,d.useEffect)((function(){if(JSON.stringify(B)!=JSON.stringify(Ln)){var e=_i([B]).messages,n=null===e||void 0===e?void 0:e[null===B||void 0===B?void 0:B.uuid];(null===n||void 0===n?void 0:n.length)>=1&&Dn(n)}}),[B,Ln,Dn]);var Fn=(0,tr.Z)(ee);(0,d.useEffect)((function(){"undefined"!==typeof ee&&ee.length!==(null===Fn||void 0===Fn?void 0:Fn.length)&&Dn(ee)}),[ee,Fn,Dn]);var Un=(0,d.useMemo)((function(){var e=new Set;return null===U||void 0===U||U.forEach((function(n){var t=n.profiles;e=new Set([].concat((0,o.Z)(e),(0,o.Z)(t)))})),(0,o.Z)(e)}),[U]),zn=(0,d.useMemo)((function(){return"".concat(null===ae||void 0===ae?void 0:ae.uuid,"/").concat(null===B||void 0===B?void 0:B.uuid,"/codeCollapsed")}),[null===ae||void 0===ae?void 0:ae.uuid,null===B||void 0===B?void 0:B.uuid]),Gn=(0,d.useMemo)((function(){return"".concat(null===ae||void 0===ae?void 0:ae.uuid,"/").concat(null===B||void 0===B?void 0:B.uuid,"/outputCollapsed")}),[null===ae||void 0===ae?void 0:ae.uuid,null===B||void 0===B?void 0:B.uuid]);(0,d.useEffect)((function(){Ye((0,ke.U2)(zn,!1)),yn((0,ke.U2)(Gn,!1))}),[]);var Wn=(0,d.useRef)(null),Qn=(0,d.useMemo)((function(){return(0,tn.HK)(H,(function(e){return e.uuid}))}),[H]),qn=(0,d.useMemo)((function(){return!!De.find((function(e){return e.upstream_blocks.includes(B.uuid)}))}),[B,De]),Vn=(0,d.useCallback)((function(e){var n=e||{},t=n.block,i=n.code,r=n.disableReset,o=n.runDownstream,l=n.runUpstream,c=n.runTests;if(null===c||"undefined"===typeof c){var a=(t||{}).type;c=[h.tf.DATA_LOADER,h.tf.DATA_EXPORTER,h.tf.TRANSFORMER].includes(a)}ue({block:t,code:i||Je,runDownstream:o||qn,runUpstream:l||!1,runTests:c||!1}),r||(On(1+Number(_n)),Sn(null),yn(!1))}),[Je,qn,_n,ue,On,Sn]),Yn=!!de.find((function(e){return e.uuid===B.uuid}))||(null===Rn||void 0===Rn?void 0:Rn.length)>=1&&Q!==Nn.uF.IDLE;(0,d.useEffect)((function(){Yn&&Tn(Number(new Date))}),[Yn,Tn]);var Kn=(0,tr.Z)(Q);(0,d.useEffect)((function(){Q===Nn.uF.IDLE&&Q!==Kn&&Sn(Number(new Date))}),[Q,Kn,Sn]);var Xn=(0,d.useCallback)((function(e){var n=e.editorRect,t=(n.height,n.top),i=e.position.lineNumber;if(null!==X&&void 0!==X&&X.current){var r=X.current.getBoundingClientRect().height,o=i*ir.aU;if(t+o>r){var l=X.current.scrollTop+(o-r+t);X.current.scrollTo(0,l)}else if(o+t<ir.aU){var c=X.current.scrollTop+(o+t-ir.aU);X.current.scrollTo(0,c)}}}),[X]),et=(0,d.useMemo)((function(){return(null===sn||void 0===sn?void 0:sn.length)>=0?sn.map((function(e){return{data:e,execution_state:Nn.uF.IDLE,type:Nn.Gi.TEXT_PLAIN}})):Rn.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[sn,Rn]),nt=!!et.find((function(e){return e.error})),tt=(0,Ke.qn)(B.type,{blockColor:B.color,theme:Me}).accent,it=(null===B||void 0===B||null===(b=B.upstream_blocks)||void 0===b?void 0:b.length)||0,rt=((0,d.useMemo)((function(){return(null===B||void 0===B?void 0:B.configuration)||{}}),[B]),(0,lr.cU)([B],H)[0]),ot=rt.dynamic,lt=rt.dynamicUpstreamBlock,ct=rt.reduceOutput,at=rt.reduceOutputUpstreamBlock,ut=(0,d.useMemo)((function(){var e=[];ot&&e.push({title:"Dynamic",description:"This block will create N blocks for each of its downstream blocks."});var n=lt&&!at;return n&&(e.push({title:"Dynamic child",description:"This block is dynamically created by its upstream parent block that is dynamic."}),ct&&e.push({title:"Reduce output",description:"Reduce output from all dynamically created blocks into a single array output."})),{borderColorShareProps:{blockColor:null===B||void 0===B?void 0:B.color,blockType:null===B||void 0===B?void 0:B.type,dynamicBlock:ot,dynamicChildBlock:n,hasError:nt,selected:me},tags:e}}),[ot,lt,nt,ct,at,me]),st=ut.borderColorShareProps,dt=ut.tags,ft=et.length>=1,pt=(0,d.useCallback)((function(){me||(_e(!1),Ee(!0))}),[_e,Ee]),ht=(0,f.Db)(an.ZP.blocks.pipelines.useUpdate(null===ae||void 0===ae?void 0:ae.uuid,B.uuid),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){hn(!1),V(),q(),$e(Je)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})},onError:function(e){var n=(0,Zn.qQ)(e).messages;dn(n)}}),mt=(0,l.Z)(ht,1)[0],vt="CodeBlock/".concat(B.uuid),gt=(0,Hn.y)(),bt=gt.registerOnKeyDown,jt=gt.unregisterOnKeyDown;(0,d.useEffect)((function(){return function(){jt(vt)}}),[jt,vt]),bt(vt,(function(e,n,t){pn&&String(t[0])===String(je.Uq)&&String(t[1])!==String(je.zX)?B.uuid===vn?e.target.blur():mt({block:ar(ar({},B),{},{name:vn})}):me&&((0,Ze.y)([je.zX,je.Uq],n)||(0,Ze.y)([je.PQ,je.Uq],n)?Vn({block:B}):(0,Ze.y)([je.XR,je.Uq],n)&&(e.preventDefault(),O({language:B.language,type:B.type,upstream_blocks:[B.uuid]}),Vn({block:B})))}),[O,B,pn,vn,Vn,me,mt]),(0,d.useEffect)((function(){var e;return Pn&&(e=setInterval((function(){return rn(Number(new Date))}),1e3)),function(){return clearInterval(e)}}),[Pn]);var yt=(0,d.useCallback)((function(e){return(0,c.Z)({},h.tf.SCRATCHPAD,(0,o.Z)(Li(e,H,"block_menu/scratchpad",O)).map((function(e){return ar(ar({},e),{},{onClick:function(){return he().then((function(){return e.onClick()}))}})})))[e.type]}),[O,H,Li,he]),kt=(0,d.useMemo)((function(){return(0,oe.jsx)(Mn.Z,{autoHeight:!0,autocompleteProviders:He,height:Y,language:B.language,onChange:function(e){$e(e),null===te||void 0===te||te(e)},onDidChangeCursorPosition:Xn,placeholder:h.tf.DBT===B.type&&h.t6.YAML===B.language?"e.g. --select path/to/my_model1.sql --exclude path/to/my_model2.sql":"Start typing here...",selected:me,setSelected:Ee,setTextareaFocused:Ae,shortcuts:[function(e,n){return(0,rr.Q)(e,(function(){Vn({block:B,code:n.getValue()})}))}],textareaFocused:Re,value:Je,width:"100%"})}),[He,B,H,Je,Y,ae,me,Re]);(0,d.useEffect)((function(){Ue({python:nr({autocompleteItems:S,block:B,blocks:H,pipeline:ae})})}),[S,B,H,ae]);var Zt=(0,d.useMemo)((function(){return(0,oe.jsx)(Pi,ar(ar({},st),{},{block:B,collapsed:jn,isInProgress:Yn,mainContainerWidth:J,messages:et,openSidekickView:ce,pipeline:ae,runCount:_n,runEndTime:wn,runStartTime:Pn,selected:me,setCollapsed:function(e){yn((function(){return(0,ke.t8)(Gn,e),e}))},setOutputBlocks:we,setSelectedOutputBlock:Ie}))}),[B,st,Yn,J,et,jn,_n,wn,Pn,me]),_t=(0,d.useCallback)((function(){return Qe(!1)}),[]),Ot=(0,d.useCallback)((function(e){cn((function(n){var t=ar(ar({},n),e);return(t.data_provider&&t.data_provider_profile||t.dbt_profile_target||t.dbt_project_name)&&he({block:{configuration:t,uuid:B.uuid}}),t}))}),[B,he]),Ct=Bt.BIGQUERY===ln.data_provider||Bt.SNOWFLAKE===ln.data_provider,wt=(0,d.useMemo)((function(){return(null===H||void 0===H?void 0:H.length)||0}),[H]);return(0,oe.jsxs)("div",{ref:n,style:{position:"relative",zIndex:L===C?wt+9:null},children:[(0,oe.jsx)(Ke.nz,ar(ar({},st),{},{onClick:function(){return pt()},zIndex:wt+1-(L||0),children:(0,oe.jsxs)(pe.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,oe.jsxs)(In.Z,{alignItems:"center",flex:1,children:[(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(ui,{children:h.dO[B.language]}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsx)(Te.Z,{color:tt,size:1.5*ie.iI,square:!0}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsx)(Pt.Z,{items:yt(B),onClickCallback:_t,onClickOutside:_t,open:We,parentRef:Wn,uuid:"CodeBlock/block_menu",children:(0,oe.jsx)(be.ZP,{color:tt,monospace:!0,children:null===(x=Bn?h.tf.DBT:h.V4[B.type])||void 0===x?void 0:x.toUpperCase()})}),h.tf.SCRATCHPAD===B.type&&(0,oe.jsxs)(oe.Fragment,{children:["\xa0",(0,oe.jsx)(se.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return Qe(!0)},transparent:!0,children:(0,oe.jsx)(ze.K5,{muted:!0})})]}),(0,oe.jsx)(ge.Z,{mr:1})]}),(0,oe.jsx)(ge.Z,{mr:ie.cd}),(0,oe.jsx)(ze.iU,{size:1.5*ie.iI}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[Bn&&(0,oe.jsx)(be.ZP,{monospace:!0,muted:!0,children:(0,or.$)(B,{fullPath:!0})}),!Bn&&(0,oe.jsx)(xt,{bold:!1,inputValue:vn,monospace:!0,muted:!0,notRequired:!0,onBlur:function(){return setTimeout((function(){_e(!1),hn(!1)}),300)},onChange:function(e){bn(e.target.value),e.preventDefault()},onClick:function(){_e(!0),hn(!0)},onFocus:function(){_e(!0),hn(!0)},stacked:!0,value:!pn&&B.uuid}),pn&&!Bn&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ge.Z,{ml:1}),(0,oe.jsx)(Jn.Z,{onClick:function(){return he({block:{name:vn,uuid:B.uuid}}).then((function(){hn(!1),V(),q()}))},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]}),(0,oe.jsx)(ge.Z,{mr:2}),!h.iZ.includes(B.type)&&(0,oe.jsx)($n.Z,{appearBefore:!0,block:!0,label:"\n ".concat((0,re._6)("parent block",it),". ").concat(0===it?"Click to select 1 or more blocks to depend on.":"Edit parent blocks.","\n "),size:null,widthFitContent:it>=1,children:(0,oe.jsx)(se.Z,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){var e;Ee(!0),Ce({upstreamBlocks:{block:B,values:null===(e=B.upstream_blocks)||void 0===e?void 0:e.map((function(e){return{uuid:e}}))}})},children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsxs)(be.ZP,{monospace:it>=1,small:it>=1,underline:0===it,children:[0===it&&"Edit parent blocks",it>=1&&(0,re._6)("parent block",it)]}),(0,oe.jsx)(ge.Z,{mr:1}),0===it&&(0,oe.jsx)(ze.Jj,{size:3*ie.iI}),it>=1&&(0,oe.jsx)(ze.eV,{size:3*ie.iI})]})})})]}),(0,oe.jsx)(Gi,{addNewBlock:O,addWidget:w,block:B,blocks:H,deleteBlock:W,executionState:Q,interruptKernel:K,pipelineType:null===ae||void 0===ae?void 0:ae.type,runBlock:Vn,savePipelineContent:he,setOutputCollapsed:yn,visible:me||Yn}),(0,oe.jsx)(ge.Z,{px:1,children:(0,oe.jsx)(se.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){Ye((function(e){return(0,ke.t8)(zn,!e),!e})),Ve||yn((function(){return(0,ke.t8)(Gn,!0),!0}))},transparent:!0,children:Ve?(0,oe.jsx)(ze._M,{muted:!0,size:2*ie.iI}):(0,oe.jsx)(ze.Kh,{muted:!0,size:2*ie.iI})})})]})})),(0,oe.jsxs)(Ke.Nk,{onClick:function(){return pt()},children:[(0,oe.jsxs)(Ke.jv,ar(ar({},st),{},{className:me&&Re?"selected":null,hasOutput:ft,children:[h.tf.DBT===B.type&&!Ve&&(0,oe.jsxs)(Ke.y9,{children:[(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(be.ZP,{monospace:!0,muted:!0,small:!0,children:"DBT project name:"}),(0,oe.jsx)("span",{children:"\xa0"}),h.t6.YAML===B.language&&(0,oe.jsx)(xe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){_e(!1)}),300)},onChange:function(e){Ot((0,c.Z)({},R,e.target.value)),e.preventDefault()},onFocus:function(){_e(!0)},placeholder:"e.g. my_project",small:!0,value:ln.dbt_project_name}),h.t6.YAML!==B.language&&(0,oe.jsx)(be.ZP,{monospace:!0,small:!0,children:null===B||void 0===B||null===(j=B.configuration)||void 0===j||null===(y=j.file_path)||void 0===y||null===(k=y.split("/"))||void 0===k?void 0:k[0]}),(0,oe.jsx)(ge.Z,{mr:2}),(0,oe.jsx)(be.ZP,{monospace:!0,muted:!0,small:!0,children:"DBT profile target:"}),(0,oe.jsx)("span",{children:"\xa0"}),(0,oe.jsx)(xe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){_e(!1)}),300)},onChange:function(e){Ot((0,c.Z)({},D,e.target.value)),e.preventDefault()},onFocus:function(){_e(!0)},placeholder:"e.g. prod",small:!0,value:ln.dbt_profile_target})]}),h.t6.YAML===B.language&&(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsxs)(In.Z,{flex:1,children:[(0,oe.jsxs)(be.ZP,{monospace:!0,default:!0,small:!0,children:["dbt run ",(0,oe.jsx)(be.ZP,{inline:!0,monospace:!0,small:!0,children:"[type your --select and --exclude syntax below]"})]}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsxs)(be.ZP,{monospace:!0,muted:!0,small:!0,children:["(paths start from ",(null===ln||void 0===ln?void 0:ln.dbt_project_name)||"project"," folder)"]})]}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsx)(be.ZP,{muted:!0,small:!0,children:(0,oe.jsx)(Jn.Z,{href:"https://docs.getdbt.com/reference/node-selection/syntax#examples",openNewWindow:!0,small:!0,children:"Examples"})}),(0,oe.jsx)(ge.Z,{mr:5})]})]}),h.t6.SQL===B.language&&!Ve&&h.tf.DBT!==B.type&&(0,oe.jsx)(Ke.y9,{children:(0,oe.jsxs)(pe.Z,{justifyContent:"space-between",children:[(0,oe.jsxs)(pe.Z,{children:[(0,oe.jsxs)(Vi.Z,{compact:!0,label:"Connection",onChange:function(e){return Ot((0,c.Z)({},E,e.target.value))},small:!0,value:ln.data_provider,children:[(0,oe.jsx)("option",{value:""}),null===U||void 0===U?void 0:U.map((function(e){var n=e.id,t=e.value;return(0,oe.jsx)("option",{value:t,children:n},n)}))]}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsxs)(Vi.Z,{compact:!0,label:"Profile",onChange:function(e){return Ot((0,c.Z)({},T,e.target.value))},small:!0,value:ln.data_provider_profile,children:[(0,oe.jsx)("option",{value:""}),null===Un||void 0===Un?void 0:Un.map((function(e){return(0,oe.jsx)("option",{value:e,children:e},e)}))]}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsx)(pe.Z,{alignItems:"center",children:(0,oe.jsx)($n.Z,{block:!0,description:(0,oe.jsxs)(be.ZP,{default:!0,inline:!0,children:["If checked, you\u2019ll have to write your own custom",(0,oe.jsx)("br",{}),"CREATE TABLE commands and INSERT commands.",(0,oe.jsx)("br",{}),"Separate your commands using a semi-colon: ",(0,oe.jsx)(be.ZP,{default:!0,inline:!0,monospace:!0,children:";"})]}),size:null,widthFitContent:!0,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(fe.Z,{checked:ln.use_raw_sql,label:(0,oe.jsx)(be.ZP,{muted:!0,small:!0,children:"Use raw SQL"}),onClick:function(){return Ot((0,c.Z)({},N,!ln.use_raw_sql))}}),(0,oe.jsx)("span",{children:"\xa0"}),(0,oe.jsx)(ze.kI,{muted:!0})]})})}),!ln.use_raw_sql&&(0,oe.jsxs)(oe.Fragment,{children:[Ct&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsx)(pe.Z,{alignItems:"center",children:(0,oe.jsx)(xe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){_e(!1)}),300)},onChange:function(e){Ot((0,c.Z)({},P,e.target.value)),e.preventDefault()},onFocus:function(){_e(!0)},label:"Database",small:!0,value:ln.data_provider_database,width:10*ie.iI})})]}),(0,oe.jsx)(ge.Z,{mr:1}),ln.data_provider!==Wi.MYSQL&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)($n.Z,{block:!0,description:(0,oe.jsxs)(be.ZP,{default:!0,inline:!0,children:["Schema that is used when creating a table and inserting values.",(0,oe.jsx)("br",{}),"This field is required."]}),size:null,widthFitContent:!0,children:(0,oe.jsx)(pe.Z,{alignItems:"center",children:(0,oe.jsx)(xe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){_e(!1)}),300)},onChange:function(e){Ot((0,c.Z)({},I,e.target.value)),e.preventDefault()},onFocus:function(){_e(!0)},label:"Schema",small:!0,value:ln.data_provider_schema,width:10*ie.iI})})}),(0,oe.jsx)(ge.Z,{mr:1})]}),(0,oe.jsx)($n.Z,{block:!0,description:(0,oe.jsxs)(be.ZP,{default:!0,inline:!0,children:["This value will be used as the table name.",(0,oe.jsx)("br",{}),"If blank, the default table name will be:",(0,oe.jsx)("br",{}),(0,oe.jsxs)(be.ZP,{inline:!0,monospace:!0,children:[null===ae||void 0===ae?void 0:ae.uuid,"_",null===B||void 0===B?void 0:B.uuid]}),(0,oe.jsx)("br",{}),"This field is optional."]}),size:null,widthFitContent:!0,children:(0,oe.jsx)(pe.Z,{alignItems:"center",children:(0,oe.jsx)(xe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){_e(!1)}),300)},onChange:function(e){Ot((0,c.Z)({},A,e.target.value)),e.preventDefault()},onFocus:function(){_e(!0)},label:"Table (optional)",small:!0,value:ln.data_provider_table,width:20*ie.iI})})})]})]}),!ln.use_raw_sql&&(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)($n.Z,{appearBefore:!0,block:!0,description:(0,oe.jsxs)(be.ZP,{default:!0,inline:!0,children:["How do you want to handle existing data with the same",Ct?" database,":""," schema, and table name?",(0,oe.jsx)("br",{}),(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:"Append"}),": add rows to the existing table.",(0,oe.jsx)("br",{}),(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:"Replace"}),": delete the existing data.",(0,oe.jsx)("br",{}),(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:"Fail"}),": raise an error during execution."]}),size:null,widthFitContent:!0,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(ze.kI,{muted:!0}),(0,oe.jsx)("span",{children:"\xa0"}),(0,oe.jsx)(be.ZP,{monospace:!0,muted:!0,small:!0,children:"Write policy:"}),(0,oe.jsx)("span",{children:"\xa0"})]})}),(0,oe.jsxs)(Vi.Z,{compact:!0,label:"strategy",onChange:function(e){return Ot((0,c.Z)({},M,e.target.value))},small:!0,value:ln.export_write_policy,children:[(0,oe.jsx)("option",{value:""}),null===Qi||void 0===Qi?void 0:Qi.map((function(e){return(0,oe.jsx)("option",{value:e,children:(0,re.kC)(e)},e)}))]}),(0,oe.jsx)(ge.Z,{mr:5})]})]})}),dt.length>=1&&(0,oe.jsx)(Ke.y9,{normalPadding:!0,children:(0,oe.jsx)(pe.Z,{children:dt.map((function(e,n){var t=e.description,i=e.title;return(0,oe.jsx)(ge.Z,{ml:n>=1?1:0,children:(0,oe.jsx)($n.Z,{block:!0,description:t,size:null,widthFitContent:!0,children:(0,oe.jsx)(ui,{children:i})})},i)}))})}),B.upstream_blocks.length>=1&&!Ve&&h.f2.includes(B.type)&&(null===ae||void 0===ae?void 0:ae.type)!==ve.q.STREAMING&&(0,oe.jsxs)(Ke.y9,{children:[(0,oe.jsxs)(be.ZP,{small:!0,children:[h.t6.SQL!==B.language&&"Positional arguments for decorated function:",h.t6.SQL===B.language&&"Tables available in query from upstream blocks:"]}),(0,oe.jsxs)(ge.Z,{mt:1,children:[h.t6.SQL!==B.language&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(be.ZP,{monospace:!0,muted:!0,small:!0,children:[h.tf.DATA_EXPORTER===B.type&&"@data_exporter",h.tf.DATA_LOADER===B.type&&"@data_loader",h.tf.TRANSFORMER===B.type&&"@transformer"]}),(0,oe.jsxs)(be.ZP,{monospace:!0,muted:!0,small:!0,children:["def ",(h.tf.DATA_EXPORTER===B.type?"export_data":h.tf.DATA_LOADER===B.type&&"load_data")||h.tf.TRANSFORMER===B.type&&"transform_df","(",B.upstream_blocks.map((function(e,n){return n>=1?"df_".concat(n+1):"df"})).join(", "),"):"]})]}),B.upstream_blocks.map((function(e,n){var t=Qn[e],i=(0,Ke.qn)(null===t||void 0===t?void 0:t.type,{blockColor:null===t||void 0===t?void 0:t.color,theme:Me}).accent;return(0,oe.jsxs)("div",{children:[h.t6.SQL!==B.language&&(0,oe.jsxs)(be.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:["\xa0\xa0\xa0\xa0df",n>=1?"_".concat(n+1):null]}),h.t6.SQL===B.language&&(0,oe.jsx)(be.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"{{ df_".concat(n+1," }}")})," ",(0,oe.jsx)(be.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"\u2192"})," ",(0,oe.jsx)(Jn.Z,{color:i,onClick:function(){var e,n,i=null===F||void 0===F||null===(e=F.current)||void 0===e?void 0:e["".concat(null===t||void 0===t?void 0:t.type,"s/").concat(null===t||void 0===t?void 0:t.uuid,".py")];null===i||void 0===i||null===(n=i.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,oe.jsx)(be.ZP,{color:i,inline:!0,monospace:!0,small:!0,children:e})})]},e)}))]})]}),!(null!==B&&void 0!==B&&B.error)&&(0,oe.jsx)(oe.Fragment,{children:Ve?(0,oe.jsx)(ge.Z,{px:1,children:(0,oe.jsxs)(be.ZP,{monospace:!0,muted:!0,children:["(",(0,re._6)("line",null===Je||void 0===Je?void 0:Je.split(/\r\n|\r|\n/).length)," collapsed)"]})}):kt}),(null===B||void 0===B?void 0:B.error)&&(0,oe.jsxs)(ge.Z,{p:ie.cd,children:[(0,oe.jsx)(be.ZP,{bold:!0,danger:!0,children:null===B||void 0===B||null===(Z=B.error)||void 0===Z?void 0:Z.error}),(0,oe.jsx)(be.ZP,{muted:!0,children:null===B||void 0===B||null===(_=B.error)||void 0===_?void 0:_.message})]}),Yn&&nn&&nn>Pn&&(0,oe.jsx)(Ke.HC,{children:(0,oe.jsxs)(be.ZP,{muted:!0,children:["".concat(Math.round((nn-Pn)/1e3)),"s"]})})]})),ft&&Zt]}),!ne&&(0,oe.jsxs)(Ke.gE,{additionalZIndex:wt-L,onMouseEnter:function(){return Le(!0)},onMouseLeave:function(){Le(!1),ye(null)},children:[Be&&(0,oe.jsx)(ge.Z,{mt:2,children:(0,oe.jsx)(ti,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=Bi(B,e);return[h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(B.type)&&h.tf.SCRATCHPAD===e.type&&(n="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(ae.uuid,"', '").concat(B.uuid,"', 'output_0')")),n=$t(e,n),h.t6.SQL===B.language&&(n=Jt(n),t=ar(ar({},(0,gn.GL)(B.configuration,[E,P,T,I,M])),t)),O(ar(ar({},e),{},{configuration:t,content:n,upstream_blocks:i}))},blockIdx:L,compact:!0,onClickAddSingleDBTModel:le,pipeline:ae,setAddNewBlockMenuOpenIdx:ye,setCreatingNewDBTModel:Oe,setRecsWindowOpenBlockIdx:Se})}),(0,oe.jsx)(Ke.t1,{className:"block-divider-inner"})]})]})}var sr=d.forwardRef(ur),dr=t(90880),fr=6.25*ie.iI,pr=(ie.iI,100*ie.iI),hr=Pe.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%);",""],hn.n_,pr,(function(e){return"\n box-shadow: ".concat((e.theme||pn.Z).shadow.window,";\n background-color: ").concat((e.theme||pn.Z).background.panel,";\n ")})),mr=(0,Pe.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],fr,ie.iI,ie.cd*ie.iI,(function(e){return"\n background-color: ".concat((e.theme||pn.Z).background.output,";\n ")})),vr=Pe.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],mr,hn.n_,hn.n_,(function(e){return"\n border-bottom: ".concat(hn.YF,"px ").concat(hn.M8," ").concat((e.theme||pn.Z).borders.medium,";\n ")})),gr=Pe.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],ie.iI,nt.w5,(0,dr.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*ie.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*fr,"px);\n ")})),br=Pe.default.div.withConfig({displayName:"indexstyle__WindowFooterStyle",componentId:"sc-g0cszf-3"})([""," justify-content:flex-end;border-bottom-left-radius:","px;border-bottom-right-radius:","px;",""],mr,hn.n_,hn.n_,(function(e){return"\n border-top: ".concat(hn.YF,"px ").concat(hn.M8," ").concat((e.theme||pn.Z).borders.medium,";\n ")})),xr=Pe.default.div.withConfig({displayName:"indexstyle__InputRowStyle",componentId:"sc-g0cszf-4"})(["padding:","px ","px;",""],.75*ie.iI,2*ie.iI,(function(e){return"\n border-bottom: ".concat(hn.YF,"px ").concat(hn.M8," ").concat((e.theme||pn.Z).borders.medium,";\n ")}));function jr(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 yr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?jr(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):jr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var kr,Zr,_r,Or,Cr=function(e){var n=e.blocks,t=e.creatingNewDBTModel,i=e.dbtModelName,r=e.files,o=e.onClose,l=e.onOpenFile,c=e.setDbtModelName,a=(0,d.useState)(!1),u=a[0],s=a[1],f=(0,d.useState)(null),p=f[0],m=f[1],v=(0,d.useMemo)((function(){var e,n,t=null===(e=(0,tn.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).filter((function(e){return"models"===e.name}));t.length>=1&&i.push(yr(yr({},e),{},{children:t}))})),i}),[r]),g=(0,d.useMemo)((function(){return(0,tn.HK)(n,(function(e){return e.configuration.file_path}))}),[n]);return(0,oe.jsxs)(hr,{children:[(0,oe.jsxs)(vr,{children:[(0,oe.jsx)(In.Z,{alignItems:"center",children:(0,oe.jsx)(be.ZP,{disableWordBreak:!0,monospace:!0,children:t?"Create new DBT model":"Select DBT model file"})}),(0,oe.jsx)(se.Z,{iconOnly:!0,onClick:o,children:(0,oe.jsx)(ze.x8,{muted:!0})})]}),t&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(xr,{children:(0,oe.jsx)(xt,{inputValue:i,label:"Model name (cannot be changed):",labelColor:pn.Z.accent.dbt,minWidth:38*ie.iI,notRequired:!0,onBlur:function(){s(!1)},onChange:function(e){c(e.target.value),e.preventDefault()},onClick:function(){s(!0)},onFocus:function(){s(!0)},placeholder:"Enter name",required:!0,stacked:!0,value:!u&&i})}),(0,oe.jsxs)(xr,{children:[(0,oe.jsx)(be.ZP,{bold:!0,color:pn.Z.accent.dbt,children:"Select folder location:"}),(0,oe.jsx)(be.ZP,{bold:!0,muted:!p,children:p?"dbt/".concat(p):"Choose folder below"})]})]}),(0,oe.jsx)(gr,{children:(0,oe.jsx)(Tn,{allowSelectingFolders:t,disableContextMenu:!0,files:v,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)}))):!!g[e]||!(null!==n&&void 0!==n&&n.length)&&!e.match(new RegExp(".".concat(h.t6.SQL,"$")))},openFile:l,selectFile:m,uncollapsed:!0,useRootFolder:!0})}),t&&(0,oe.jsx)(br,{children:(0,oe.jsx)(se.Z,{backgroundColor:i&&p?pn.Z.accent.dbt:pn.Z.monotone.grey500,disabled:!i||!p,onClick:function(){return l(p)},padding:"6px 8px",children:"Create model"})})]})},wr=t(4804),Sr=t(65730),Er=t(87372);!function(e){e.FULL_TABLE="FULL_TABLE",e.INCREMENTAL="INCREMENTAL",e.LOG_BASED="LOG_BASED"}(Zr||(Zr={})),function(e){e.IGNORE="IGNORE",e.UPDATE="UPDATE"}(_r||(_r={})),function(e){e.DATE_TIME="date-time",e.UUID="uuid"}(Or||(Or={}));var Pr,Tr="datetime",Ir=(kr={},(0,c.Z)(kr,Or.DATE_TIME,Tr),(0,c.Z)(kr,Or.UUID,Or.UUID),kr);!function(e){e.ARRAY="array",e.BOOLEAN="boolean",e.INTEGER="integer",e.NULL="null",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(Pr||(Pr={}));var Ar,Rr,Dr,Mr,Nr,Br=[Pr.ARRAY,Pr.BOOLEAN,Tr,Pr.INTEGER,Pr.NULL,Pr.NUMBER,Pr.OBJECT,Pr.STRING,Or.UUID];!function(e){e.PROPERTIES="properties"}(Ar||(Ar={})),function(e){e.AUTOMATIC="automatic",e.AVAILABLE="available",e.UNSUPPORTED="unsupported"}(Rr||(Rr={})),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"}(Dr||(Dr={})),function(e){e.AMPLITUDE="amplitude",e.BIGQUERY="bigquery",e.CHARGEBEE="chargebee",e.GOOGLE_SEARCH_CONSOLE="google_search_console",e.GOOGLE_SHEETS="google_sheets",e.INTERCOM="intercom",e.MYSQL="mysql",e.POSTGRESQL="postgresql",e.REDSHIFT="redshift",e.SALESFORCE="salesforce",e.STRIPE="stripe"}(Mr||(Mr={})),function(e){e.BIGQUERY="bigquery",e.DELTA_LAKE_S3="delta_lake_s3",e.MYSQL="mysql",e.POSTGRESQL="postgresql",e.SNOWFLAKE="snowflake"}(Nr||(Nr={}));var Lr=t(32316),Fr=Pe.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||pn.Z.background).popup,";\n ")}),(function(e){return e.primary&&"\n background-color: ".concat((e.theme.chart||pn.Z.chart).primary,";\n ")}),(function(e){return!e.small&&"\n border-radius: ".concat((ie.iI+ri.Al)/2,"px;\n height: ").concat(1.5*ie.iI+ri.Al,"px;\n padding: ").concat(ie.iI/1.5,"px ").concat(1.25*ie.iI,"px;\n ")}),(function(e){return e.small&&"\n border-radius: ".concat((ie.iI/2+ri.Al)/2,"px;\n height: ").concat(ri.Al+ie.iI/2+2,"px;\n padding: ").concat(ie.iI/4,"px ").concat(ie.iI,"px;\n ")}),(function(e){return e.border&&"\n border: 1px solid ".concat((e.theme.content||pn.Z.content).muted,";\n ")})),Hr=function(e){var n=e.border,t=e.children,i=e.label,r=e.onClick,o=e.primary,l=e.small;return(0,oe.jsx)(Fr,{border:n,primary:o,small:l,children:(0,oe.jsx)(se.Z,{basic:!0,noPadding:!0,noBackground:!0,onClick:r,transparent:!0,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[t,i&&(0,oe.jsx)(be.ZP,{small:l,children:i}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsx)(ze.x8,{default:o,muted:!o,size:l?ie.iI:1.25*ie.iI})]})})})},Ur=t(85307);function zr(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 Gr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zr(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Wr="4px",Qr=[Nr.BIGQUERY,Nr.DELTA_LAKE_S3];var qr=function(e){var n=e.destination,t=e.isLoadingLoadSampleData,i=e.loadSampleData,r=e.source,o=e.stream,c=e.streams,a=e.updateAllStreams,u=e.updateMetadataForColumns,s=e.updateSchemaProperty,f=e.updateStream,p=(0,d.useRef)(null),h=o.bookmark_properties,m=o.destination_table,v=void 0===m?"":m,g=o.key_properties,b=o.metadata,x=o.partition_keys,j=o.replication_method,y=o.schema.properties,k=o.tap_stream_id,Z=o.unique_constraints,_=o.unique_conflict_method,O=(0,d.useState)(v),C=O[0],w=O[1],S=(0,d.useState)(!1),E=S[0],P=S[1],T=(0,d.useState)(null),I=T[0],A=T[1],R=(0,tr.Z)(k);(0,d.useEffect)((function(){R!==k&&(w(v),A(null))}),[v,j,k,R,_]);var D=(0,d.useMemo)((function(){return(0,tn.HK)(b,(function(e){return e.breadcrumb.join("/")}))}),[b]),M=(0,d.useMemo)((function(){var e;return null===(e=(0,tn.sE)(b,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[b]),N=(0,d.useMemo)((function(){return M[Dr.KEY_PROPERTIES]||[]}),[M]),B=(0,d.useMemo)((function(){return M[Dr.REPLICATION_KEYS]||[]}),[M]),L=Qr.includes(n),F=c.length>1,H=(0,d.useMemo)((function(){var e=[],t=[],i=(0,tn.mr)(Object.entries(y)).map((function(i,r){var o=(0,l.Z)(i,2),c=o[0],d=o[1],p=d.anyOf,m=void 0===p?[]:p,v=d.format,b=d.type,j=void 0===b?[]:b,y=new Set(Array.isArray(j)?j:[j]),_=new Set(y);m.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){y.add(e),_.add(e)})):(y.add(t),_.add(t),n&&_.add(n))}));var O=Array.from(y);v&&_.add(v);var C=(D["properties/".concat(c)]||{}).metadata,w=(C.inclusion,C.selected);e.push(w),t.push(c);var S=Br.reduce((function(e,n){return O.indexOf(n)>=0||Tr===String(n)&&Or.DATE_TIME===v||Or.UUID===String(n)&&Or.UUID===v?e:e.concat((0,oe.jsx)("option",{value:n,children:n},n))}),[]),E=O.findIndex((function(e){return e===Pr.STRING})),P=[(0,oe.jsx)(fe.Z,{checked:w,onClick:function(){u(k,[c],{selected:!w})}},"".concat(k,"/").concat(c,"/selected")),(0,oe.jsx)(be.ZP,{children:c},"".concat(k,"/").concat(c,"/name")),(0,oe.jsxs)(pe.Z,{children:[(0,oe.jsx)(In.Z,{flex:1,children:(0,oe.jsx)(pe.Z,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:O.map((function(e,n){return(0,oe.jsx)(ge.Z,{mb:1,mr:1,children:(0,oe.jsx)(Hr,{border:!0,label:v&&Pr.STRING===e&&E===n?Ir[v]:e,onClick:function(){var n={format:v,type:O.filter((function(n){return n!==e}))};Or.DATE_TIME!==v&&Or.UUID!==v||Pr.STRING!==e||(n.format=null),s(k,c,n)},small:!0})},"".concat(k,"/").concat(c,"/").concat(e,"/").concat(n,"/chip"))}))})}),S.length>=1&&(0,oe.jsxs)(Vi.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:v,type:O};Tr===String(n)?(t.format=Or.DATE_TIME,t.type.push(Pr.STRING)):Or.UUID===String(n)?(t.format=Or.UUID,t.type.push(Pr.STRING)):t.type.push(n),s(k,c,t)},primary:!0,small:!0,value:"",width:10*ie.iI,children:[(0,oe.jsx)("option",{value:""}),S]})]},"".concat(k,"/").concat(c,"/type")),(0,oe.jsx)(fe.Z,{checked:!(null===Z||void 0===Z||!Z.includes(c)),disabled:N.length>=1&&!N.includes(c),onClick:N.length>=1&&!N.includes(c)?null:function(){return f(k,(function(e){var n;return null!==(n=e.unique_constraints)&&void 0!==n&&n.includes(c)?e.unique_constraints=(0,tn.Od)(e.unique_constraints,(function(e){return c===e})):e.unique_constraints=[c].concat(e.unique_constraints||[]),e}))}},"".concat(k,"/").concat(c,"/unique")),(0,oe.jsx)(fe.Z,{checked:!(null===h||void 0===h||!h.includes(c)),disabled:B.length>=1&&!B.includes(c),onClick:B.length>=1&&!B.includes(c)?null:function(){return f(k,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(c)?e.bookmark_properties=(0,tn.Od)(e.bookmark_properties,(function(e){return c===e})):e.bookmark_properties=[c].concat(e.bookmark_properties||[]),e}))}},"".concat(k,"/").concat(c,"/bookmark")),(0,oe.jsx)(fe.Z,{checked:!(null===g||void 0===g||!g.includes(c)),onClick:function(){return f(k,(function(e){var n;return null!==(n=e.key_properties)&&void 0!==n&&n.includes(c)?e.key_properties=(0,tn.Od)(e.key_properties,(function(e){return c===e})):e.key_properties=[c].concat(e.key_properties||[]),e}))}},"".concat(k,"/").concat(c,"/key_property"))];if(L){var T=n!==Nr.DELTA_LAKE_S3,R=T&&(N.includes(c)||!_.has(Or.DATE_TIME));P.push((0,oe.jsx)(fe.Z,{checked:!(null===x||void 0===x||!x.includes(c)),disabled:R,onClick:R?null:function(){return f(k,(function(e){var n,t;null!==(n=e.partition_keys)&&void 0!==n&&n.includes(c)?e.partition_keys=(0,tn.Od)(e.partition_keys,(function(e){return c===e})):T&&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(k,"/").concat(c,"/partition_key")))}if(F){var M=I===r;P.push((0,oe.jsx)(se.Z,{compact:!0,disabled:M,onClick:function(){A(r),setTimeout((function(){return A(null)}),2e3),a((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==k&&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,a,u,s,d,f;e.schema.properties[c]={format:v||null,type:O};var p=null===(i=(0,tn.sE)((null===e||void 0===e?void 0:e.metadata)||[],(function(e){return 0===e.breadcrumb.length})))||void 0===i?void 0:i.metadata,m=p[Dr.REPLICATION_KEYS]||[],b=p[Dr.KEY_PROPERTIES]||[];null===Z||void 0===Z||!Z.includes(c)||null!==e&&void 0!==e&&null!==(r=e.unique_constraints)&&void 0!==r&&r.includes(c)||!b.includes(c)?null!==Z&&void 0!==Z&&Z.includes(c)||null===e||void 0===e||null===(o=e.unique_constraints)||void 0===o||!o.includes(c)||(e.unique_constraints=(0,tn.Od)(e.unique_constraints,(function(e){return c===e}))):e.unique_constraints=[c].concat(e.unique_constraints||[]),null===h||void 0===h||!h.includes(c)||null!==e&&void 0!==e&&null!==(l=e.bookmark_properties)&&void 0!==l&&l.includes(c)||!m.includes(c)?null!==h&&void 0!==h&&h.includes(c)||null===e||void 0===e||null===(a=e.bookmark_properties)||void 0===a||!a.includes(c)||(e.bookmark_properties=(0,tn.Od)(e.bookmark_properties,(function(e){return c===e}))):e.bookmark_properties=[c].concat(e.bookmark_properties||[]),null===g||void 0===g||!g.includes(c)||null!==e&&void 0!==e&&null!==(u=e.key_properties)&&void 0!==u&&u.includes(c)?null!==g&&void 0!==g&&g.includes(c)||null===e||void 0===e||null===(s=e.key_properties)||void 0===s||!s.includes(c)||(e.key_properties=(0,tn.Od)(e.key_properties,(function(e){return c===e}))):e.key_properties=[c].concat(e.key_properties||[]),null===x||void 0===x||!x.includes(c)||null!==e&&void 0!==e&&null!==(d=e.partition_keys)&&void 0!==d&&d.includes(c)?null!==x&&void 0!==x&&x.includes(c)||null===e||void 0===e||null===(f=e.partition_keys)||void 0===f||!f.includes(c)||(e.partition_keys=(0,tn.Od)(e.partition_keys,(function(e){return c===e}))):e.partition_keys=[c].concat(e.partition_keys||[])}return Gr({},e)}))},pill:!0,secondary:!0,children:(0,oe.jsx)(be.ZP,{success:M,children:M?"Applied!":"Apply"})}))}return P})),r=e.every((function(e){return e})),o=[null,2,1,null,null,null],c=[{label:function(){return(0,oe.jsx)(fe.Z,{checked:r,onClick:function(){u(k,t,{selected:!r})}})},uuid:"Selected"},{uuid:"Name"},{uuid:"Type"},{uuid:"Unique"},{uuid:"Bookmark"},{uuid:"Key prop"}];return L&&(o.push(null),c.push({uuid:"Partition key"})),F&&(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,oe.jsx)(Ur.cl,{children:(0,oe.jsx)(fn.Z,{alignTop:!0,columnFlex:o,columns:c,rows:i,stickyHeader:!0})})}),[h,n,F,I,g,D,x,y,L,k,Z,a,u,s,f,N,B]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(Er.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,oe.jsx)(Er.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:k})," schema"]}),(0,oe.jsx)(ge.Z,{mb:3,children:(0,oe.jsx)(me.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(be.ZP,{children:"Destination table name"}),(0,oe.jsx)(ge.Z,{ml:Wr}),(0,oe.jsx)($n.Z,{label:(0,oe.jsxs)(be.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:k}),". To change the table name, enter in a different value."]}),lightBackground:!0,primary:!0}),(0,oe.jsx)(ge.Z,{ml:1}),(0,oe.jsx)(xe.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;w(n),clearTimeout(p.current),p.current=setTimeout((function(){f(k,(function(e){return Gr(Gr({},e),{},{destination_table:n})}))}),300)},value:C||"",width:45*ie.iI})]})})}),(0,oe.jsx)(ge.Z,{mb:3,children:(0,oe.jsx)(me.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,oe.jsxs)(In.Z,{alignItems:"center",children:[(0,oe.jsx)(be.ZP,{children:"Replication method"}),(0,oe.jsx)(ge.Z,{ml:Wr}),(0,oe.jsx)($n.Z,{label:(0,oe.jsxs)(be.ZP,{children:["Do you want to synchronize the entire stream (",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:Zr.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:Zr.INCREMENTAL}),")?",r===Mr.POSTGRESQL&&(0,oe.jsxs)(be.ZP,{children:["Log-based incremental replication (",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:Zr.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0,primary:!0}),(0,oe.jsx)(ge.Z,{ml:1}),(0,oe.jsxs)(Vi.Z,{compact:!0,onChange:function(e){f(k,(function(n){return Gr(Gr({},n),{},{replication_method:e.target.value})}))},primary:!0,value:j,children:[(0,oe.jsx)("option",{value:""}),Object.values(Zr).filter((function(e){return r===Mr.POSTGRESQL||e!==Zr.LOG_BASED})).map((function(e){return(0,oe.jsx)("option",{value:e,children:e},e)}))]}),(0,oe.jsx)(ge.Z,{ml:3}),(0,oe.jsx)(be.ZP,{children:"Unique conflict method"}),(0,oe.jsx)(ge.Z,{ml:Wr}),(0,oe.jsx)($n.Z,{label:(0,oe.jsxs)(be.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,re._6)("column",null===Z||void 0===Z?void 0:Z.length),(null===Z||void 0===Z?void 0:Z.length)>0&&(0,oe.jsx)(oe.Fragment,{children:"\xa0"}),null===Z||void 0===Z?void 0:Z.sort().map((function(e,n){return(0,oe.jsxs)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===Z||void 0===Z?void 0:Z.length)&&n===(null===Z||void 0===Z?void 0:Z.length)-1?(0,oe.jsx)(be.ZP,{inline:!0,children:" and "},e):n>=1&&(0,oe.jsx)(oe.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:_r.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:_r.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0,primary:!0}),(0,oe.jsx)(ge.Z,{ml:1}),(0,oe.jsxs)(Vi.Z,{compact:!0,inputWidth:11*ie.iI,onChange:function(e){f(k,(function(n){return Gr(Gr({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:_,children:[(0,oe.jsx)("option",{value:""}),(0,oe.jsx)("option",{value:_r.IGNORE,children:_r.IGNORE}),(0,oe.jsx)("option",{value:_r.UPDATE,children:_r.UPDATE})]})]}),F&&(0,oe.jsxs)(In.Z,{alignItems:"center",children:[(0,oe.jsx)(be.ZP,{default:!0,children:"All streams"}),(0,oe.jsx)(ge.Z,{ml:Wr}),(0,oe.jsx)($n.Z,{appearBefore:!0,label:(0,oe.jsx)(be.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."}),lightBackground:!0,primary:!0}),(0,oe.jsx)(ge.Z,{ml:1}),(0,oe.jsx)(se.Z,{compact:!0,disabled:E,onClick:function(){P(!0),setTimeout((function(){return P(!1)}),2e3),a((function(e){return Gr(Gr({},e),{},{replication_method:j,unique_conflict_method:_})}))},pill:!0,secondary:!0,children:(0,oe.jsx)(be.ZP,{bold:!E,success:E,children:E?"Applied!":"Apply"})})]})]})})}),(0,oe.jsx)(me.Z,{headerTitle:"Features",noPadding:!0,children:H}),(0,oe.jsx)(ge.Z,{mt:2,children:(0,oe.jsx)(se.Z,{loading:t,onClick:function(){return i(k)},primary:!0,small:!0,children:"Load sample data"})}),(0,oe.jsxs)(ge.Z,{mt:5,children:[(0,oe.jsx)(Er.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),Zr.INCREMENTAL===j&&(0,oe.jsxs)(ge.Z,{mb:5,children:[(0,oe.jsxs)(ge.Z,{mb:1,children:[(0,oe.jsx)(be.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,oe.jsxs)(be.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,oe.jsx)("br",{}),"On the next run, the synchronization will start after the bookmarked record."]})]}),(0,oe.jsxs)(pe.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==h&&void 0!==h&&h.length)&&(0,oe.jsxs)(be.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===h||void 0===h?void 0:h.sort().map((function(e){return(0,oe.jsx)(ge.Z,{mb:1,mr:1,children:(0,oe.jsx)(Hr,{label:e,onClick:function(){f(k,(function(n){return Gr(Gr({},n),{},{bookmark_properties:(0,tn.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]})]}),(0,oe.jsxs)(ge.Z,{mb:5,children:[(0,oe.jsxs)(ge.Z,{mb:1,children:[(0,oe.jsx)(be.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,oe.jsx)(be.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,oe.jsxs)(pe.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==Z&&void 0!==Z&&Z.length)&&(0,oe.jsxs)(be.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===Z||void 0===Z?void 0:Z.sort().map((function(e){return(0,oe.jsx)(ge.Z,{mb:1,mr:1,children:(0,oe.jsx)(Hr,{label:e,onClick:function(){f(k,(function(n){return Gr(Gr({},n),{},{unique_constraints:(0,tn.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,oe.jsxs)(ge.Z,{mb:5,children:[(0,oe.jsxs)(ge.Z,{mb:1,children:[(0,oe.jsx)(be.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,oe.jsx)(be.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,oe.jsxs)(pe.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==g&&void 0!==g&&g.length)&&(0,oe.jsxs)(be.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null===g||void 0===g?void 0:g.sort().map((function(e){return(0,oe.jsx)(ge.Z,{mb:1,mr:1,children:(0,oe.jsx)(Hr,{label:e,onClick:function(){f(k,(function(n){return Gr(Gr({},n),{},{key_properties:(0,tn.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),L&&(0,oe.jsxs)(ge.Z,{mb:3,children:[(0,oe.jsxs)(ge.Z,{mb:1,children:[(0,oe.jsx)(be.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,oe.jsx)(be.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,oe.jsxs)(pe.Z,{alignItems:"center",flexWrap:"wrap",children:[!(null!==x&&void 0!==x&&x.length)&&(0,oe.jsxs)(be.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===x||void 0===x?void 0:x.sort().map((function(e){return(0,oe.jsx)(ge.Z,{mb:1,mr:1,children:(0,oe.jsx)(Hr,{label:e,onClick:function(){f(k,(function(n){return Gr(Gr({},n),{},{partition_keys:(0,tn.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Vr=["catalog","setSelectedStream"];function Yr(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?Yr(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Yr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xr=function(e){var n=e.catalog,t=e.setSelectedStream,i=(0,Ee.Z)(e,Vr),r=(0,d.useState)(null),o=r[0],l=r[1],c=(0,d.useMemo)((function(){return(null===n||void 0===n?void 0:n.streams)||[]}),[n]),a=(0,d.useMemo)((function(){return(0,tn.YC)(c,"stream").map((function(e){return{uuid:e.stream}}))}),[c]),u=(0,d.useMemo)((function(){return(0,tn.HK)(c,(function(e){return e.stream}))}),[c]),s=(0,d.useMemo)((function(){return u[null===o||void 0===o?void 0:o.uuid]}),[o,u]);(0,d.useEffect)((function(){a.length>0&&(o&&(0,tn.sE)(a,(function(e){var n=e.uuid;return o.uuid===n}))||l(a[0]))}),[o,l,a]);var f=(0,d.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,oe.jsx)(Ur.cl,{children:(0,oe.jsx)(fn.Z,{alignTop:!0,columnBorders:!0,columnFlex:e.map((function(e){return 1})),columns:e,rows:c.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,a=e.partition_keys,u=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,oe.jsx)(be.ZP,{children:"".concat(s.selectedCount," of ").concat(s.totalCount," total")},"".concat(u,"_col_selected")),f=[u,n,t,i,r,l,c,a].map((function(e,n){return(0,oe.jsx)(be.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(u,"_cell_").concat(n))}));return f.slice(0,1).concat(d).concat(f.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[c]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Lr.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){l(e),t(e.uuid)},selectedTabUUID:null===o||void 0===o?void 0:o.uuid,tabs:a}),s&&(0,oe.jsx)(ge.Z,{mt:1,children:(0,oe.jsx)(Ur.dE,{children:(0,oe.jsx)(qr,Kr(Kr({},i),{},{stream:s,streams:c}))})}),c.length>=1&&(0,oe.jsx)(ge.Z,{mt:1,children:(0,oe.jsxs)(Ur.dE,{children:[(0,oe.jsx)(Er.Z,{level:4,children:"Streams Summary"}),(0,oe.jsx)(ge.Z,{mt:1}),f]})})]})},Jr=Pe.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;width:100%;",""],hn.n_,(function(e){return"\n background-color: ".concat((e.theme.background||pn.Z.background).panel,";\n ")}));var $r,eo=function(e){var n=e.children;return(0,oe.jsx)(Jr,{children:n})};function no(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function to(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function io(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?to(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):to(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.ALL="All",e.SELECTED="Selected",e.NOT_SELECTED="Not selected"}($r||($r={}));var ro=45*ie.iI;var oo=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,r=e.streams,o=(0,tn.HK)((null===n||void 0===n?void 0:n.streams)||[],(function(e){return e.stream})),l=(0,d.useState)(o),a=l[0],u=l[1],s=(0,d.useState)(null),f=s[0],p=s[1],h=(0,d.useState)(!1),m=h[0],v=h[1],g=(0,d.useState)($r.ALL),b=g[0],x=g[1],j=(0,d.useRef)(null),y=no(a),k=(0,d.useMemo)((function(){var e=r;return e=e.filter((function(e){var n=e.tap_stream_id;return b===$r.SELECTED?y.includes(n):b!==$r.NOT_SELECTED||!y.includes(n)})),f?e.filter((function(e){var n=e.tap_stream_id;return null===n||void 0===n?void 0:n.toLowerCase().includes(null===f||void 0===f?void 0:f.toLowerCase())})):e}),[b,f,y,r]),Z=(0,d.useMemo)((function(){return r.every((function(e){var n=e.stream;return!!a[n]}))}),[a,r]);return(0,oe.jsxs)(eo,{children:[(0,oe.jsx)(Ur.cv,{rounded:!0,children:(0,oe.jsx)(be.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,oe.jsx)(Ur.cv,{padding:1.25*ie.iI,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,oe.jsx)(xe.Z,{beforeIcon:(0,oe.jsx)(ze.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return p(e.target.value)},placeholder:"Search",value:f}),(0,oe.jsx)(ge.Z,{pr:1,children:(0,oe.jsx)(Pt.Z,{items:[{label:function(){return $r.ALL},onClick:function(){return x($r.ALL)},uuid:"all_streams"},{label:function(){return $r.SELECTED},onClick:function(){return x($r.SELECTED)},uuid:"selected"},{label:function(){return $r.NOT_SELECTED},onClick:function(){return x($r.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return v(!1)},onClickOutside:function(){return v(!1)},open:m,parentRef:j,uuid:"SelectStreams/filter",children:(0,oe.jsx)(se.Z,{beforeIcon:(0,oe.jsx)(ze.wn,{}),noBackground:!0,onClick:function(){return v((function(e){return!e}))},ref:j,children:(0,oe.jsx)(be.ZP,{children:b})})})})]})}),(0,oe.jsx)(Ur.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(ro,"px"),children:(0,oe.jsx)(fn.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,oe.jsx)(fe.Z,{checked:Z,onClick:function(){var e=(0,tn.HK)(r||[],(function(e){return e.stream}));u(Z?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:k.map((function(e){var n=e.stream,t=!!a[n];return[(0,oe.jsx)(fe.Z,{checked:t,onClick:function(){u((function(i){return io(io({},i),{},(0,c.Z)({},n,t?null:e))}))}},"selected-".concat(n)),(0,oe.jsx)(be.ZP,{children:n},"stream-".concat(n))]})),stickyHeader:!0})}),(0,oe.jsx)(pi.Z,{medium:!0}),(0,oe.jsxs)(ge.Z,{p:2,children:[(null===y||void 0===y?void 0:y.length)>50&&(0,oe.jsx)(ge.Z,{pb:2,children:(0,oe.jsxs)(be.ZP,{danger:!0,maxWidth:ro-4*ie.iI,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,oe.jsx)("br",{}),"may cause app performance issues."]})}),(0,oe.jsx)(pe.Z,{justifyContent:"flex-end",children:(0,oe.jsx)(se.Z,{loading:t,onClick:function(){return i(a)},primary:!0,children:"Confirm ".concat(no(a).length," streams")})})]})]})};function lo(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 co(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?lo(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):lo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ao=function(e){var n=e.api,t=e.block,i=e.blockContent,r=e.onChangeCodeBlock,o=e.pipeline,a=(0,d.useState)(null),u=a[0],s=a[1];(0,d.useEffect)((function(){i&&!u&&s((0,wr.Pz)(null===i||void 0===i?void 0:i.config))}),[u,i]);var p=(0,d.useState)(null),m=p[0],v=p[1],g=(0,d.useState)(),b=g[0],x=g[1],j=(0,f.Db)(an.ZP[n].useCreate(),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(e){var t,i,r=(0,re.C5)(n);v(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)}})}}),y=(0,l.Z)(j,2),k=y[0],Z=y[1].isLoading;return t?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Ur.$W,{children:(0,oe.jsx)(Mn.Z,{autoHeight:!0,language:h.t6.YAML,onChange:function(e){s(e),r(t.uuid,(0,wr.Pz)(co(co({},i),{},{config:(0,wr.Qc)(e)})))},tabSize:2,value:u||void 0,width:"100%"})}),(0,oe.jsxs)(ge.Z,{mt:1,children:[(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(se.Z,{onClick:function(){k((0,c.Z)({},(0,re.C5)(n),{action_type:"test_connection",config:u,pipeline_uuid:o.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,oe.jsx)(ge.Z,{ml:1,children:Z?(0,oe.jsx)(Di.Z,{color:"white",small:!0}):(0,oe.jsxs)(oe.Fragment,{children:[m&&(0,oe.jsx)(be.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===m&&(0,oe.jsx)(be.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),b&&(0,oe.jsx)(ge.Z,{mt:1,children:(0,oe.jsx)(be.ZP,{small:!0,warning:!0,children:b})})]})]}):null},uo=t(70902);function so(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 fo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?so(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):so(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var po=function(e){var n,t,i,r=e.addNewBlockAtIndex,o=e.blocks,c=e.codeBlocks,a=e.fetchFileTree,u=e.fetchPipeline,s=e.fetchSampleData,p=e.globalVariables,m=e.onChangeCodeBlock,v=e.openSidekickView,g=e.pipeline,b=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,y=e.setOutputBlocks,k=e.setSelectedBlock,Z=e.setSelectedOutputBlock,_=e.setSelectedStream,O=(0,d.useState)(!0),C=O[0],w=O[1],S=(0,d.useState)(!0),E=S[0],P=S[1],T=(0,d.useState)(!0),I=T[0],A=T[1],R=an.ZP.integration_sources.list().data,D=(0,d.useMemo)((function(){return(null===R||void 0===R?void 0:R.integration_sources)||[]}),[R]),M=(0,d.useMemo)((function(){return(0,tn.HK)(D,(function(e){return e.uuid}))}),[D]),N=an.ZP.integration_destinations.list().data,B=(0,d.useMemo)((function(){return(null===N||void 0===N?void 0:N.integration_destinations)||[]}),[N]),L=(0,d.useMemo)((function(){return(0,tn.HK)(B,(function(e){return e.uuid}))}),[B]),F=(0,d.useMemo)((function(){return(0,tn.sE)(o,(function(e){var n=e.type;return h.tf.DATA_LOADER===n}))}),[o]),H=(0,d.useMemo)((function(){return F?(0,wr.Qc)(F.content):{}}),[F]),U=(0,d.useMemo)((function(){return(0,oe.jsx)(ao,{api:"integration_sources",block:F,blockContent:H,onChangeCodeBlock:m,pipeline:g})}),[F,H]),z=(0,d.useMemo)((function(){return(0,tn.sE)(o,(function(e){var n=e.type;return h.tf.DATA_EXPORTER===n}))}),[o]),G=(0,d.useMemo)((function(){return z?(0,wr.Qc)(z.content):{}}),[z]),W=(0,d.useMemo)((function(){return(0,oe.jsx)(ao,{api:"integration_destinations",block:z,blockContent:G,onChangeCodeBlock:m,pipeline:g})}),[z,G]),Q=(0,d.useMemo)((function(){var e;return(0,gn.Qr)(null===H||void 0===H?void 0:H.catalog)?null===g||void 0===g||null===(e=g.data_integration)||void 0===e?void 0:e.catalog:null===H||void 0===H?void 0:H.catalog}),[H,null===g||void 0===g||null===(n=g.data_integration)||void 0===n?void 0:n.catalog]),q=((null===Q||void 0===Q?void 0:Q.streams)||[]).every((function(e){return e.auto_add_new_fields})),V=((null===Q||void 0===Q?void 0:Q.streams)||[]).every((function(e){return e.disable_column_type_check})),Y=(0,tr.Z)(Q);(0,d.useEffect)((function(){!Y&&Q&&(y((function(){return Z(F),[F]})),j((function(e){var n;return e||(null===Q||void 0===Q||null===(n=Q.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[Q]);var K=(0,d.useState)(),X=K[0],J=K[1],$=(0,f.Db)(an.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null===n||void 0===n?void 0:n.streams)||[];y((function(){return Z(F),[F]})),t.length>0&&_(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),v(Ae.DATA),s()}else J(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),ee=(0,l.Z)($,2),ne=ee[0],te=ee[1].isLoading,re=(0,f.Db)(an.ZP.integration_sources.useUpdate(null===g||void 0===g?void 0:g.uuid),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(e){var n=e.integration_source,t=n.selected_streams,i=n.streams,r=((null===Q||void 0===Q?void 0:Q.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(Rr.UNSUPPORTED!==i.inclusion){var r;if(e.replication_method||(e.replication_method=Zr.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=_r.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]=fo(fo({},n),{},{metadata:fo(fo({},i),{},{selected:!0})})}}))}));var c={streams:r.concat(l)};j(Se.map((function(e){return e.tap_stream_id})));var s=null===H||void 0===H?void 0:H.catalog;(0,gn.Qr)(s)||m(F.uuid,(0,wr.Pz)(fo(fo({},H),{},{catalog:{}})));var d={pipeline:fo(fo({},g),{},{data_integration:fo(fo({},(null===g||void 0===g?void 0:g.data_integration)||{}),{},{catalog:c})})};b(d).then((function(){u(),a()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),le=(0,l.Z)(re,2),ce=le[0],ae=le[1].isLoading,ue=(0,d.useState)(null),de=ue[0],fe=ue[1],he=(0,f.Db)(an.ZP.integration_source_streams.useUpdate(null===g||void 0===g?void 0:g.uuid),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(e){fe(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),me=(0,l.Z)(he,2),ve=me[0],xe=me[1].isLoading,je=(0,d.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}}(Q,e),i=t.stream,r=t.streams,o=fo(fo({},Q),{},{streams:r.concat(n(i))}),l=null===H||void 0===H?void 0:H.catalog;(0,gn.Qr)(l)||m(F.uuid,(0,wr.Pz)(fo(fo({},H),{},{catalog:{}})));var c={pipeline:fo(fo({},g),{},{data_integration:fo(fo({},(null===g||void 0===g?void 0:g.data_integration)||{}),{},{catalog:o})})};b(c).then((function(){return u()}))}),[Q,F,H,u,m,g,b]),ye=(0,d.useCallback)((function(e){if(null!==Q&&void 0!==Q&&Q.streams){var n=fo(fo({},Q),{},{streams:Q.streams.map((function(n){return e(n)}))}),t=null===H||void 0===H?void 0:H.catalog;(0,gn.Qr)(t)||m(F.uuid,(0,wr.Pz)(fo(fo({},H),{},{catalog:{}})));var i={pipeline:fo(fo({},g),{},{data_integration:fo(fo({},(null===g||void 0===g?void 0:g.data_integration)||{}),{},{catalog:n})})};b(i).then((function(){return u()}))}}),[Q,F,H,u,m,g,b]),ke=(0,d.useCallback)((function(e,n,t){je(e,(function(e){return e.schema.properties[n]=t,e}))}),[je]),Ze=(0,d.useCallback)((function(e,n,t){je(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=fo(fo({},o),t)}})),e}))}),[je]),_e=(0,f.Db)(an.ZP.blocks.pipelines.useUpdate(null===g||void 0===g?void 0:g.uuid,null===z||void 0===z?void 0:z.uuid),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){null===u||void 0===u||u()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),Oe=(0,l.Z)(_e,1)[0],Ce=(0,d.useMemo)((function(){var e=[];return null===p||void 0===p||p.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,oe.jsx)(be.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,oe.jsx)(be.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,oe.jsx)(be.ZP,{monospace:!0,children:r},"variable-uuid-".concat(t,"-{value}-code")),(0,oe.jsx)(Sr.Z,{copiedText:r,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,oe.jsx)(fn.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[p]),we=(0,d.useCallback)((function(e){return(0,oe.jsxs)(ge.Z,{mt:2,children:[(0,oe.jsxs)(be.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,oe.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,oe.jsx)(be.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,oe.jsx)("br",{}),"For more information, check out the ",(0,oe.jsx)(Jn.Z,{href:e,openNewWindow:!0,children:"documentation"}),"."]}),(0,oe.jsx)(ge.Z,{mt:1,children:Ce})]})}),[Ce]),Se=(0,d.useMemo)((function(){return(null===de||void 0===de?void 0:de.streams)||[]}),[de]),Ee=(0,_n.dd)((function(){return(0,oe.jsx)(oo,{catalog:Q,isLoading:ae,onActionCallback:function(e){var n=Object.entries(e).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);if(n.length>0)ce({integration_source:{streams:n}}),Ie();else{var t=null===H||void 0===H?void 0:H.catalog;(0,gn.Qr)(t)||m(F.uuid,(0,wr.Pz)(fo(fo({},H),{},{catalog:{}}))),b({pipeline:fo(fo({},g),{},{data_integration:fo(fo({},(null===g||void 0===g?void 0:g.data_integration)||{}),{},{catalog:null})})}).then((function(){return u()})),Ie()}},streams:Se})}),{},[Q,F,H,u,ae,m,b,Se],{background:!0,uuid:"select_streams"}),Pe=(0,l.Z)(Ee,2),Te=Pe[0],Ie=Pe[1];return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ge.Z,{mb:1,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(se.Z,{iconOnly:!0,onClick:function(){return P((function(e){return!e}))},children:(0,oe.jsxs)(oe.Fragment,{children:[E&&(0,oe.jsx)(ze.Kh,{size:1.5*ie.iI}),!E&&(0,oe.jsx)(ze._M,{size:1.5*ie.iI})]})}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(Er.Z,{children:"Source"}),!E&&(0,oe.jsxs)(Er.Z,{default:!0,inline:!0,children:["\xa0",null===(t=M[null===H||void 0===H?void 0:H.source])||void 0===t?void 0:t.name]})]})]})}),E&&(0,oe.jsxs)(ge.Z,{mb:5,children:[(0,oe.jsxs)(Ur.dE,{children:[(0,oe.jsxs)(ge.Z,{mb:5,children:[(0,oe.jsx)(Er.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(0,oe.jsxs)(Vi.Z,{onChange:function(e){var n,t,i=e.target.value;if(i){var o=null===(n=M[i])||void 0===n||null===(t=n.templates)||void 0===t?void 0:t.config;o&&Object.keys(o).forEach((function(e){o[e]=o[e]||null})),F?m(F.uuid,(0,wr.Pz)(fo(fo({},H),{},{catalog:{},config:o,source:i}))):r({content:(0,wr.Pz)({source:i,config:o}),language:h.t6.YAML,type:h.tf.DATA_LOADER},0,k),fe(null),b().then((function(){u()}))}},primary:!0,value:null===H||void 0===H?void 0:H.source,children:[(0,oe.jsx)("option",{value:""}),D.map((function(e){var n=e.name,t=e.uuid;return(0,oe.jsx)("option",{value:t,children:n},t)}))]})]}),F&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(ge.Z,{mb:5,children:[(0,oe.jsx)(Er.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===H||void 0===H?void 0:H.source)&&(0,oe.jsxs)(ge.Z,{mb:2,children:[(0,oe.jsxs)(be.ZP,{default:!0,children:["For more information on how to configure this source, read the ",(0,oe.jsxs)(Jn.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/sources/".concat(H.source,"/README.md"),openNewWindow:!0,children:[H.source," documentation"]})]}),we("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),U]}),(0,oe.jsxs)("div",{children:[(0,oe.jsx)(Er.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,oe.jsx)(se.Z,{loading:xe,onClick:function(){b().then((function(){ve().then((function(){return Te()})),u()}))},primary:!0,small:!0,children:"View and select streams"})]}),X&&(0,oe.jsx)(be.ZP,{warning:!0,children:X})]})]}),ae&&(0,oe.jsx)(ge.Z,{p:2,children:(0,oe.jsx)(Di.Z,{})}),!ae&&(0,oe.jsx)(ge.Z,{mt:3,children:(0,oe.jsx)(Xr,{catalog:Q,destination:null===G||void 0===G?void 0:G.destination,isLoadingLoadSampleData:te,loadSampleData:function(e){return ne({integration_source:{action_type:"sample_data",pipeline_uuid:null===g||void 0===g?void 0:g.uuid,streams:[e]}})},setSelectedStream:_,source:null===H||void 0===H?void 0:H.source,updateAllStreams:ye,updateMetadataForColumns:Ze,updateSchemaProperty:ke,updateStream:je})})]}),(0,oe.jsx)(ge.Z,{mb:1,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(se.Z,{disabled:!F,iconOnly:!0,onClick:function(){return A((function(e){return!e}))},children:(0,oe.jsxs)(oe.Fragment,{children:[I&&F&&(0,oe.jsx)(ze.Kh,{size:1.5*ie.iI}),(!I||!F)&&(0,oe.jsx)(ze._M,{disabled:!F,size:1.5*ie.iI})]})}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsx)(pe.Z,{alignItems:"center",children:(0,oe.jsx)(Er.Z,{children:"Transformers"})})]})}),I&&F&&(0,oe.jsx)(ge.Z,{mb:5,children:(0,oe.jsxs)(Ur.dE,{children:[c.length>0&&(0,oe.jsx)(ge.Z,{mb:1,children:c.map((function(e,n){return(0,oe.jsx)(ge.Z,{mb:1,children:e},n)}))}),(0,oe.jsx)(ge.Z,{mt:1,children:(0,oe.jsx)(ti,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return F&&i.push(F.uuid),r(fo(fo({},e),{},{configuration:t,content:n,upstream_blocks:i}),o.length-1,(function(e){z&&(Oe({block:fo(fo({},z),{},{upstream_blocks:[e.uuid]})}),k(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideRecommendations:!0,hideScratchpad:!0,hideSensor:!0,hideTransformerDataSources:!0,pipeline:g})})]})}),(0,oe.jsx)(ge.Z,{mb:1,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(se.Z,{disabled:!F,iconOnly:!0,onClick:function(){return w((function(e){return!e}))},children:(0,oe.jsxs)(oe.Fragment,{children:[C&&F&&(0,oe.jsx)(ze.Kh,{size:1.5*ie.iI}),(!C||!F)&&(0,oe.jsx)(ze._M,{disabled:!F,size:1.5*ie.iI})]})}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(Er.Z,{children:"Destination"}),!C&&(0,oe.jsxs)(Er.Z,{default:!0,inline:!0,children:["\xa0",null===(i=L[null===G||void 0===G?void 0:G.destination])||void 0===i?void 0:i.name]})]})]})}),C&&F&&(0,oe.jsxs)(Ur.dE,{children:[(0,oe.jsxs)(ge.Z,{mb:5,children:[(0,oe.jsx)(Er.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(0,oe.jsxs)(Vi.Z,{onChange:function(e){var n=e.target.value;if(n){if(z)m(z.uuid,(0,wr.Pz)(fo(fo({},G),{},{destination:n})));else{var t,i,l=null===(t=L[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 a=o.find((function(e){var n=e.uuid;return(null===F||void 0===F?void 0:F.uuid)!==n}));a&&c.push(a.uuid)}else F&&c.push(F.uuid);r({content:(0,wr.Pz)({config:l,destination:n}),language:h.t6.YAML,type:h.tf.DATA_EXPORTER,upstream_blocks:c},1,k)}b().then((function(){u()}))}},primary:!0,value:null===G||void 0===G?void 0:G.destination,children:[(0,oe.jsx)("option",{value:""}),B.map((function(e){var n=e.name,t=e.uuid;return(0,oe.jsx)("option",{value:t,children:n},t)}))]})]}),z&&(0,oe.jsxs)(ge.Z,{mb:5,children:[(0,oe.jsx)(Er.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===G||void 0===G?void 0:G.destination)&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)(ge.Z,{mb:2,children:[(0,oe.jsxs)(be.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,oe.jsxs)(Jn.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(G.destination,"/README.md"),openNewWindow:!0,children:[G.destination," documentation"]}),".",(0,oe.jsx)("br",{}),(0,oe.jsx)("br",{}),"If your configuration contains a key named ",(0,oe.jsx)(be.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,oe.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,oe.jsx)(be.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),we("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),W,(0,oe.jsx)(ge.Z,{mt:3,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,oe.jsxs)(ge.Z,{mr:2,children:[(0,oe.jsx)(be.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,oe.jsx)(be.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,oe.jsx)(uo.Z,{checked:!!q,disabled:!(null!==Q&&void 0!==Q&&Q.streams),onCheck:function(){return ye((function(e){return fo(fo({},e),{},{auto_add_new_fields:!q})}))}})]})}),(0,oe.jsx)(ge.Z,{mt:3,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",justifyContent:"space-between",children:[(0,oe.jsxs)(ge.Z,{mr:2,children:[(0,oe.jsx)(be.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,oe.jsxs)(be.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,oe.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,oe.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,oe.jsx)(uo.Z,{checked:!!V,disabled:!(null!==Q&&void 0!==Q&&Q.streams),onCheck:function(){return ye((function(e){return fo(fo({},e),{},{disable_column_type_check:!V})}))}})]})})]})]})]})},ho=t(66653);function mo(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 vo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mo(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var go=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.anyInputFocused,r=e.autocompleteItems,o=e.blockRefs,l=e.blocks,a=void 0===l?[]:l,u=e.dataProviders,s=e.deleteBlock,f=e.fetchFileTree,p=e.fetchPipeline,m=e.fetchSampleData,v=e.files,g=e.globalVariables,b=e.interruptKernel,x=(e.isPipelineUpdating,e.kernel,e.mainContainerRef),j=e.mainContainerWidth,y=e.messages,k=e.onChangeCodeBlock,Z=e.openSidekickView,_=e.pipeline,O=e.pipelineContentTouched,C=(e.pipelineLastSaved,e.restartKernel),w=e.runBlock,S=e.runningBlocks,A=void 0===S?[]:S,R=e.savePipelineContent,D=e.selectedBlock,N=e.setAnyInputFocused,B=e.setEditingBlock,L=e.setErrors,F=e.setIntegrationStreams,H=(e.setMessages,e.setOutputBlocks),U=e.setPipelineContentTouched,z=e.setRecsWindowOpenBlockIdx,G=(e.setRunningBlocks,e.setSelectedBlock),W=e.setSelectedOutputBlock,Q=e.setSelectedStream,q=e.setTextareaFocused,V=e.textareaFocused,Y=e.widgets,K=(0,d.useState)(!1),X=K[0],J=K[1],$=(0,d.useState)(!1),ee=$[0],ne=$[1],te=(0,d.useState)(!0),le=te[0],ce=te[1],ae=(0,d.useState)(null),ue=ae[0],se=ae[1],fe=(0,d.useState)(null),pe=fe[0],he=fe[1],me=(0,d.useState)(!1),be=me[0],xe=me[1],ye=(0,d.useState)(""),ke=ye[0],_e=ye[1],Oe=(0,d.useMemo)((function(){return A.reduce((function(e,n,t){return vo(vo({},e),{},(0,c.Z)({},n.uuid,vo(vo({},n),{},{priority:t})))}),{})}),[A]),we=(0,tr.Z)(D),Se=(0,d.useMemo)((function(){return a.length}),[a]),Ee=(0,d.useMemo)((function(){return ve.q.INTEGRATION===(null===_||void 0===_?void 0:_.type)}),[_]),Pe="PipelineDetail/index",Te=(0,Hn.y)(),Ie=Te.disableGlobalKeyboardShortcuts,Ae=Te.registerOnKeyDown,Re=Te.unregisterOnKeyDown;(0,d.useEffect)((function(){return function(){Re(Pe)}}),[Re,Pe]),Ae(Pe,(function(e,t,r){if(Ie)(0,ho.j)(e);else if(O&&(0,Ze.y)([je.zX,je.hS],t)){e.preventDefault();"undefined"!==typeof location&&window.confirm("You have changes that are unsaved. Click cancel and save your changes before reloading page.")&&location.reload()}else if((0,Ze.y)([je.zX,je.Um],t)||(0,Ze.y)([je.PQ,je.Um],t))e.preventDefault(),R();else if(V)t[je.vP]?q(!1):O||je.Z1.find((function(e){return t[e]}))||U(!0);else if(!Ee){if(D){var l=a.findIndex((function(e){var n=e.uuid;return D.uuid===n}));if(t[je.vP])G(null),z(null);else if(r[0]===je.xD&&r[1]===je.xD)b();else if(r[0]===je.l1&&r[1]===je.l1&&-1!==l)s(D).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){l===a.length-1?G(a[l-1]):a.length>=0?G(a[l+1]):G(null)}),100)}));else if(t[je.Bu]&&l>=1){var c=a[l-1];if(c){var u,d;G(c);var f="".concat(c.type,"s/").concat(c.uuid,".py");null===(u=o.current[f])||void 0===u||null===(d=u.current)||void 0===d||d.scrollIntoView()}}else if(t[je.kD]&&l<=Se-2){var p=a[l+1];if(p){var m,v;G(p);var g="".concat(p.type,"s/").concat(p.uuid,".py");null===(m=o.current[g])||void 0===m||null===(v=m.current)||void 0===v||v.scrollIntoView()}}else(0,Ze.y)([je.Uq],t)?q(!0):!i&&(0,Ze.y)([je.zH],t)?n({type:h.tf.SCRATCHPAD},l,G):!i&&(0,Ze.y)([je.Fv],t)&&n({type:h.tf.SCRATCHPAD},l+1,G)}else we&&t[je.Uq]&&G(we);r[0]===je.OC&&r[1]===je.OC&&C()}}),[n,i,o.current,a,b,Ee,Se,O,C,R,D,we,U,G,q,V]),(0,d.useEffect)((function(){var e=setInterval((function(){O&&R()}),5e3);return function(){clearInterval(e)}}),[O,R]),(0,d.useEffect)((function(){setTimeout((function(){return ne(!0)}),600)}),[_]);var De=(0,d.useCallback)((function(e){J(!0),he(e)}),[J,he]),Me=(0,d.useCallback)((function(){J(!1),xe(!1),_e("")}),[]),Ne=(0,d.useMemo)((function(){return a.filter((function(e){var n=e.type;return!Ee||h.tf.TRANSFORMER===n})).map((function(e,i){var l=e.type,c=e.uuid,h=(null===D||void 0===D?void 0:D.uuid)===c,m=Oe[c],v=m?0===m.priority?Nn.uF.BUSY:Nn.uF.QUEUED:Nn.uF.IDLE,g="".concat(l,"s/").concat(c,".py");return o.current[g]=(0,d.createRef)(),(0,oe.jsx)(sr,{addNewBlock:function(e){return q(!0),n(e,i+1,G)},addNewBlockMenuOpenIdx:ue,addWidget:t,autocompleteItems:r,block:e,blockIdx:i,blockRefs:o,blocks:a,dataProviders:u,defaultValue:e.content,deleteBlock:function(e){s(e),N(!1)},executionState:v,fetchFileTree:f,fetchPipeline:p,interruptKernel:b,mainContainerRef:x,mainContainerWidth:j,messages:y[c],noDivider:i===Se-1||Ee,onChange:function(e){return k(c,e)},onClickAddSingleDBTModel:De,openSidekickView:Z,pipeline:_,ref:o.current[g],runBlock:w,runningBlocks:A,savePipelineContent:R,selected:h,setAddNewBlockMenuOpenIdx:se,setAnyInputFocused:N,setCreatingNewDBTModel:xe,setEditingBlock:B,setOutputBlocks:H,setRecsWindowOpenBlockIdx:z,setSelected:function(n){return G(!0===n?e:null)},setSelectedOutputBlock:W,setTextareaFocused:q,textareaFocused:h&&V,widgets:Y},c)}))}),[n,ue,t,r,o,a,s,f,p,b,Ee,x,j,y,Se,k,De,Z,_,w,A,Oe,R,D,se,N,B,H,z,G,W,q,V,Y]),Be=(0,d.useMemo)((function(){return(0,oe.jsx)(po,{addNewBlockAtIndex:n,blocks:a,codeBlocks:Ne,fetchFileTree:f,fetchPipeline:p,fetchSampleData:m,globalVariables:g,onChangeCodeBlock:k,openSidekickView:Z,pipeline:_,savePipelineContent:R,setErrors:L,setIntegrationStreams:F,setOutputBlocks:H,setSelectedBlock:G,setSelectedOutputBlock:W,setSelectedStream:Q})}),[n,a,Ne,p,g,k,k,_,R,L,G]),Le=(0,d.useMemo)((function(){return(0,oe.jsx)(ti,{addNewBlock:function(e){var t=a[a.length-1],i=null,r={},o=t?Bi(t,e):[];t&&([h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(t.type)&&h.tf.SCRATCHPAD===e.type&&(i="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(_.uuid,"', '").concat(t.uuid,"', 'output_0')\n")),h.t6.SQL===t.language&&(r=vo(vo({},(0,gn.GL)(t.configuration,[E,P,T,I,M])),r))),h.t6.SQL===e.language&&(i=Jt(i)),i=$t(e,i),n(vo(vo({},e),{},{configuration:r,content:i,upstream_blocks:o}),Se,G),q(!0)},hideCustom:Ee,hideDataExporter:Ee,hideDataLoader:Ee,hideDbt:Ee||ve.q.STREAMING===(null===_||void 0===_?void 0:_.type),hideRecommendations:Ee,hideScratchpad:Ee,hideSensor:Ee,onClickAddSingleDBTModel:De,pipeline:_,setCreatingNewDBTModel:xe,setRecsWindowOpenBlockIdx:z})}),[a,Ee,_,De,z]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(it,{children:le&&(0,oe.jsx)(kt.Z,{classNames:"pipeline-detail",in:ee,onEntered:function(){return setTimeout((function(){return ce(!1)}),tt)},timeout:1,children:(0,oe.jsx)(rt,{})})}),(0,oe.jsxs)(ge.Z,{mt:1,px:ie.cd,children:[Ee&&Be,!Ee&&(0,oe.jsxs)(oe.Fragment,{children:[Ne,(0,oe.jsx)(ge.Z,{mt:ie.cd,children:Le})]}),X&&(0,oe.jsx)(de.Z,{onClickOutside:Me,open:!0,children:(0,oe.jsx)(Cr,{blocks:a,creatingNewDBTModel:be,dbtModelName:ke,files:v,onClose:Me,onOpenFile:function(e){var t=be?"".concat(e,"/").concat((0,re.RA)(ke||(0,re.Y6)()),".").concat(Ce.SQL):e,i={configuration:{file_path:t},language:h.t6.SQL,name:t,type:h.tf.DBT};be&&(i.content="--Docs: https://docs.mage.ai/dbt/sources\n");var r="undefined"===typeof pe||null===pe,o=a[r?a.length-1:pe],l=o?Bi(o,i):[];n(vo(vo({},i),{},{upstream_blocks:l}),r?Se:pe+1,G),Me(),q(!0)},setDbtModelName:_e})})]})]})},bo=t(28358),xo=t(19767),jo=t(32063),yo=t(70543),ko=t(24141);function Zo(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?Zo(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Zo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Oo=function(e){var n=e.after,t=e.afterHeader,i=e.afterHidden,r=e.afterSubheader,o=e.before,c=e.beforeHeader,a=e.children,u=e.errors,s=e.headerOffset,f=e.mainContainerHeader,p=e.mainContainerRef,h=e.page,m=e.pipeline,v=e.projectName,g=e.setAfterHidden,b=e.setAfterWidthForChildren,x=e.setErrors,j=e.setMainContainerWidth,y=(0,ko.i)().width,k=(0,d.useState)((0,ke.U2)(ke.L8,et.Zt)),Z=k[0],_=k[1],O=(0,d.useState)((0,ke.U2)(ke.J3,et.ve)),C=O[0],w=O[1],S=(0,d.useState)(!!(0,ke.U2)(ke.Uu)),E=S[0],P=S[1],T=(0,d.useState)(!1),I=T[0],A=T[1],R=(0,d.useState)(!1),D=R[0],M=R[1],N=i,B=g;if(!B){var L=(0,d.useState)(!!(0,ke.U2)(ke.zg)),F=(0,l.Z)(L,2);N=F[0],B=F[1]}(0,d.useEffect)((function(){null===p||void 0===p||!p.current||I||D||null===j||void 0===j||j(p.current.getBoundingClientRect().width)}),[I,D,N,Z,E,C,null===p||void 0===p?void 0:p.current,j,y]),(0,d.useEffect)((function(){I||(null===b||void 0===b||b(Z),(0,ke.t8)(ke.L8,Z))}),[I,Z,b]),(0,d.useEffect)((function(){D||(0,ke.t8)(ke.J3,C)}),[D,C]);var H=an.ZP.projects.list({},{revalidateOnFocus:!1}).data,U=null===H||void 0===H?void 0:H.projects,z=(0,d.useMemo)((function(){var e,n=[{label:function(){return"Pipelines"},linkProps:{href:"/pipelines",as:"/pipelines"}}];return m&&(n.push.apply(n,[{bold:yo.b!==h,label:function(){return null===m||void 0===m?void 0:m.name},linkProps:{href:"/pipelines/[pipeline]",as:"/pipelines/".concat(null===m||void 0===m?void 0:m.uuid)}}]),yo.b===h&&n.push.apply(n,[{bold:!0,label:function(){return(0,re.kC)(h)}}])),(0,oe.jsx)(xo.Z,{breadcrumbs:n,project:null===U||void 0===U?void 0:U[0],version:null===U||void 0===U||null===(e=U[0])||void 0===e?void 0:e.version})}),[h,m,v,U]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(dt.Z,{title:null===m||void 0===m?void 0:m.name}),(0,oe.jsx)(jo.Z,{after:n,afterHeader:t,afterHidden:N,afterMousedownActive:I,afterSubheader:r,afterWidth:Z,before:o,beforeHeader:c,beforeHidden:E,beforeMousedownActive:D,beforeWidth:C,header:z,headerOffset:s,mainContainerHeader:f,mainContainerRef:p,setAfterHidden:B,setAfterMousedownActive:A,setAfterWidth:_,setBeforeHidden:P,setBeforeMousedownActive:M,setBeforeWidth:w,children:a}),u&&(0,oe.jsx)(de.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return x(null)},children:(0,oe.jsx)(bo.Z,_o(_o({},u),{},{onClose:function(){return x(null)}}))})]})},Co=t(41788),wo=t(70001),So=t(26226),Eo=t(29989),Po=t(53655),To=t(84181),Io=t(31969);function Ao(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ro(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ao(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ao(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Do=Pe.default.div.withConfig({displayName:"HeatMap__YAxisLabelContainer",componentId:"sc-h2irj-0"})(["-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-o-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);white-space:nowrap;"]);function Mo(e,n){return Math.max.apply(Math,(0,o.Z)(e.map(n)))}function No(e,n){return Math.min.apply(Math,(0,o.Z)(e.map(n)))}var Bo=function(e){return e.bins},Lo=function(e){return e.count},Fo={top:0,left:0,right:0,bottom:0};function Ho(e){var n=e.countMidpoint,t=e.data,i=(e.events,e.height),r=e.margin,o=void 0===r?{}:r,l=e.minCount,c=e.width,a=(e.yLabels,(0,d.useContext)(Pe.ThemeContext)),u=(a.monotone||Io.Z.monotone).grey300,s=(a.brand||Io.Z.brand).wind400,f=(a.content||Io.Z.content).default,p=(a.monotone||Io.Z.monotone).white,h=Ro(Ro({},Fo),o),m=[];t[0].forEach((function(e,n){var i=t.map((function(e){return e[n]}));m.push({bin:n,bins:i.reverse().map((function(e,n){return{bin:n,count:e}}))})}));var v=Mo(m,(function(e){return Mo(Bo(e),Lo)})),g=No(m,(function(e){return No(Bo(e),Lo)})),b=Mo(m,(function(e){return Bo(e).length})),x="undefined"!==typeof n?n:0,j="undefined"!==typeof l?l:g,y=(0,To.Z)({domain:[0,m.length]}),k=(0,To.Z)({domain:[0,b]}),Z=(0,To.Z)({range:[u,s],domain:[x,v]}),_=(0,To.Z)({range:[.1,1],domain:[x,v]}),O=(0,To.Z)({range:[u,s],domain:[j,x]}),C=(0,To.Z)({range:[1,.1],domain:[j,x]}),w=c-(h.left+h.right),S=i-(h.bottom+h.top),E=w/m.length,P=S/b;return y.range([0,w]),k.range([S,0]),c<10?null:(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)("svg",{width:c,height:i,children:(0,oe.jsx)(Eo.Z,{left:h.left,top:h.top,children:(0,oe.jsx)(Po.Z,{data:m,xScale:y,yScale:k,colorScale:Z,opacityScale:_,binWidth:E,binHeight:E,gap:0,children:function(e){return e.map((function(e){return e.map((function(e){var t=e.opacity,i=e.color;return"undefined"!==typeof n&&e.count<n&&(t=C(e.count),i=O(e.count)),(0,oe.jsxs)("svg",{height:P,width:E,x:e.x,y:e.y-P,children:[(0,oe.jsx)("rect",{className:"visx-heatmap-rect",fill:i,fillOpacity:t,height:P,width:E}),(0,oe.jsx)("text",{alignmentBaseline:"middle",fill:e.count>=.8*v?p:f,fontFamily:ii.ry,fontSize:14,textAnchor:"middle",x:"50%",y:"50%",children:e.count})]},"heatmap-rect-".concat(e.row,"-").concat(e.column))}))}))}})})})})}var Uo=function(e){var n=e.countMidpoint,t=e.data,i=e.height,r=e.margin,o=e.minCount,l=e.xAxisLabel,c=e.xLabels,a=e.yAxisLabel,u=e.yLabels,s=function(e){return e.length>12?"".concat(e.substring(0,12),"..."):e},d=4*ie.iI,f=8*ie.iI,p=0;return a&&(p+=d+1*ie.iI),u&&(p+=f+1*ie.iI),(0,oe.jsxs)(oe.Fragment,{children:[(l||c)&&(0,oe.jsx)("div",{style:{marginBottom:null===r||void 0===r?void 0:r.bottom,marginLeft:null===r||void 0===r?void 0:r.left,marginRight:null===r||void 0===r?void 0:r.right,marginTop:null===r||void 0===r?void 0:r.top,paddingLeft:p},children:(0,oe.jsxs)(ge.Z,{mb:{xs:1},children:[l&&(0,oe.jsx)(ge.Z,{mb:1,children:(0,oe.jsx)(be.ZP,{center:!0,muted:!0,xsmall:!0,children:l})}),c&&(0,oe.jsx)(pe.Z,{children:c.map((function(e){var n=e.label,t=e.linkProps;return(0,oe.jsx)(In.Z,{flex:"1",justifyContent:"center",children:t?(0,oe.jsx)(Jn.Z,{bold:!0,centerAlign:!0,minWidth:70,onClick:t.onClick,xsmall:!0,children:n}):(0,oe.jsx)(be.ZP,{bold:!0,center:!0,minWidth:70,title:String(n),xsmall:!0,children:s(String(n))})},n)}))})]})}),(0,oe.jsxs)("div",{style:{height:i,display:"flex",width:"100%"},children:[a&&(0,oe.jsx)("div",{style:{marginRight:1*ie.iI,width:d},children:(0,oe.jsx)(pe.Z,{alignItems:"center",justifyContent:"center",children:(0,oe.jsx)(Do,{children:(0,oe.jsx)(be.ZP,{center:!0,muted:!0,xsmall:!0,children:a})})})}),u&&(0,oe.jsx)("div",{style:{marginRight:1*ie.iI},children:(0,oe.jsx)(pe.Z,{alignItems:"center",flexDirection:"column",fullHeight:!0,width:f,children:u.map((function(e){var n=e.label,t=e.linkProps;return(0,oe.jsx)(In.Z,{alignItems:"center",flex:"1",children:t?(0,oe.jsx)(Jn.Z,{bold:!0,centerAlign:!0,onClick:t.onClick,xsmall:!0,children:n}):(0,oe.jsx)(be.ZP,{bold:!0,center:!0,title:String(n),xsmall:!0,children:s(String(n))})},n)}))})}),(0,oe.jsx)("div",{style:{height:i,width:"100%"},children:(0,oe.jsx)(So.Z,{children:function(e){var i=e.width,l=e.height;return(0,oe.jsx)(Ho,{countMidpoint:n,data:t,height:l,margin:r,minCount:o,width:i,yLabels:u})}})})]})]})},zo=t(11754);var Go=function(e){var n=e.afterWidth,t=e.features,i=e.insightsOverview,r=e.statistics,o=i.correlations,c=void 0===o?[]:o,a=n-(2*ie.cd*ie.iI+nt.nn),u=function(e){var n=[];return{heatmapData:null===e||void 0===e?void 0:e.map((function(e,t){var i=e.correlations,r=e.feature.uuid;n.push({label:r});var o=i[0].y.map((function(e){var n=e.value;return(0,re.QV)(n)}));return o.splice(t,0,1),o})),xyLabels:n}}(c),s=u.heatmapData,d=u.xyLabels,f=function(e,n){return(0,tn.YC)(null===e||void 0===e?void 0:e.map((function(e){return{feature:e,value:1-n["".concat(e.uuid,"/null_value_rate")]}})),"value")}(t,r),p=function(e,n){return(0,tn.YC)(null===e||void 0===e?void 0:e.map((function(e){return{feature:e,value:n["".concat(e.uuid,"/count_distinct")]}})),"value")}(t,r),h=function(e,n){return(0,tn.YC)(null===e||void 0===e?void 0:e.map((function(e){var t=Object.entries(n["".concat(e.uuid,"/value_counts")]||{})[0]||[],i=(0,l.Z)(t,2),r=i[0],o=i[1];return{feature:e,percentage:Number(o)/n.count,value:r}})),"percentage")}(t,r);return(0,oe.jsxs)(pe.Z,{flexDirection:"column",children:[(null===f||void 0===f?void 0:f.length)>=1&&(0,oe.jsx)(zo.Z,{headerTitle:"Data completion",width:a,children:(0,oe.jsx)(wo.Z,{data:f.map((function(e){var n=e.feature;return{x:e.value,y:n.uuid}})),height:Math.max(3*f.length*ie.iI,50*ie.iI),renderTooltipContent:function(e){var n=e.x;return"".concat((0,re.T3)(n)," of rows have a value")},xNumTicks:2,ySerialize:function(e){return e.y}})}),(null===p||void 0===p?void 0:p.length)>=1&&(0,oe.jsx)(zo.Z,{headerTitle:"Number of unique values",width:a,children:(0,oe.jsx)(wo.Z,{data:p.map((function(e){var n=e.feature;return{x:e.value,y:n.uuid}})),height:Math.max(3*f.length*ie.iI,50*ie.iI),renderTooltipContent:function(e){var n=e.x;return"".concat(n," unique values")},xNumTicks:2,ySerialize:function(e){return e.y}})}),h.length>=1&&(0,oe.jsx)(zo.Z,{headerTitle:"Distribution of values",width:a,children:(0,oe.jsx)(wo.Z,{data:h.map((function(e){var n=e.feature,t=e.percentage;return{feature:n,value:e.value,x:t,y:n.uuid}})),height:Math.max(3*h.length*ie.iI,50*ie.iI),renderTooltipContent:function(e){var n=e.value,t=e.x;return"".concat(n," is ").concat((0,re.T3)(t)," of all rows")},xNumTicks:2,ySerialize:function(e){return e.y}})}),c&&(null===s||void 0===s?void 0:s.length)>=1&&(0,oe.jsx)(zo.Z,{headerTitle:"Correlations",children:(0,oe.jsx)(ge.Z,{p:1,children:(0,oe.jsx)(Uo,{countMidpoint:0,data:s,height:8*ie.iI*d.length,minCount:-1,xLabels:d,yLabels:d})})})]})},Wo=t(92083),Qo=t.n(Wo),qo=t(84969),Vo=t(90948),Yo=t(65743),Ko=t(39048),Xo=t(79487),Jo=t(61655),$o=t(16853),el=t(65376),nl=t(52359),tl=t(48072),il=t(24903),rl=t(98677),ol=t(73899);function ll(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function cl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ll(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ll(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var al={bottom:ie.iI*(3+ie.cd),left:ie.iI*ie.cd,right:ie.iI*ie.cd,top:ie.iI*ie.cd};function ul(e,n){return Math.max.apply(Math,(0,o.Z)(e.map(n)))}function sl(e){var n=e.data,t=e.height,i=e.keyForYData,r=e.large,l=e.margin,c=void 0===l?{}:l,a=e.orientationVertical,u=void 0!==a&&a,s=e.showTooltip,f=e.width,p=e.yLabelFormat,h=(0,d.useContext)(Pe.ThemeContext),m=(0,d.useCallback)((function(e){return e[i]}),[i]),v=p;v||(v=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e});var g=r?ri.iD:ri.J5,b=cl(cl({},al),c),x=n.slice(Math.max(0,n.length-50)),j=(0,d.useMemo)((function(){return Object.keys((null===x||void 0===x?void 0:x[0])||{}).filter((function(e){return e!==i}))}),[x,i]),y=(0,il.Z)({domain:j,range:[ol.a$,ol.Ej,ol.hM,ol.ZA,ol.$R,ol.X_,ol.er,ol.hl,ol.nQ]}),k=(0,d.useMemo)((function(){return x.map(m)}),[x,m]),Z=(0,rl.Z)({domain:k,padding:.1}),_=(0,rl.Z)({domain:j,padding:.1}),O=(0,To.Z)({domain:[0,ul(x,(function(e){return ul(j,(function(n){return Number(e[n])}))}))]}),C={active:(null===h||void 0===h?void 0:h.content.default)||pn.Z.content.default,backgroundPrimary:(null===h||void 0===h?void 0:h.chart.backgroundPrimary)||pn.Z.chart.backgroundPrimary,backgroundSecondary:(null===h||void 0===h?void 0:h.chart.backgroundSecondary)||pn.Z.chart.backgroundSecondary,muted:(null===h||void 0===h?void 0:h.content.muted)||pn.Z.content.muted,primary:(null===h||void 0===h?void 0:h.chart.primary)||pn.Z.chart.primary,tooltipBackground:(null===h||void 0===h?void 0:h.background.navigation)||pn.Z.background.navigation},w=k;u&&(w=x.reduce((function(e,n){return e.concat(j.map((function(e){var t=n[e];return(0,re.HW)(t)?parseInt(String(t)):t})))}),[]));var S=Math.min(Math.max.apply(Math,(0,o.Z)(w.map((function(e){return String(e).length})))),20);b.left+=7*S;var E=f-(b.left+b.right),P=t-(b.top+b.bottom);u?(Z.rangeRound([0,E]),O.rangeRound([P,0])):(Z.rangeRound([P,0]),O.rangeRound([0,E])),_.rangeRound([0,Z.bandwidth()]);var T=x.map(m).length,I=0;u||(I=Z(w[T-1]));var A=(0,d.useCallback)((function(e){var n=(0,tl.Z)(e)||{x:0,y:0},t=n.x,i=n.y,r=t-b.left,o=i-b.top,l=0;l=u?(r-I/2)/(E-I):1-(o-I/2)/(P-I);var c=Math.floor(l*T),a=x[c];"undefined"===typeof a&&(a=x[c-1]),u?r>I&&r<E+b.left-I&&s({tooltipData:a,tooltipLeft:t,tooltipTop:i}):o>I&&o<P-I&&s({tooltipData:a,tooltipLeft:t,tooltipTop:i})}),[x,T,b.left,b.top,u,s,I,E,P]);return{colorScale:y,colors:C,data:x,fontSize:g,handleTooltip:A,margin:b,tempScale:O,tickValues:w,xKeys:j,xMax:E,y1Scale:_,yLabelFormat:v,yMax:P,yScale:Z,ySerialize:m}}var dl=["height","width","xAxisLabel","yAxisLabel"];function fl(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function pl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fl(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}ie.iI,ie.iI,ie.iI;var hl=(0,Jo.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,a=e.margin,u=void 0===a?{}:a,s=e.renderNoDataText,d=e.renderTooltipContent,f=e.showTooltip,p=e.tooltipData,h=e.tooltipLeft,m=e.tooltipOpen,v=e.tooltipTop,g=e.width,b=e.xAxisLabel,x=e.xNumTicks,j=e.yLabelFormat,y=sl({data:n,height:t,keyForYData:o,large:c,margin:u,showTooltip:f,width:g,yLabelFormat:j}),k=y.colorScale,Z=y.colors,_=y.data,O=y.fontSize,C=y.handleTooltip,w=y.margin,S=y.tempScale,E=y.tickValues,P=y.xKeys,T=y.xMax,I=y.y1Scale,A=y.yLabelFormat,R=y.yMax,D=y.yScale,M=y.ySerialize;return g<10?null:(0,oe.jsxs)("div",{children:[(0,oe.jsxs)("svg",{height:t,width:g,children:[s&&!(null!==_&&void 0!==_&&_.length)&&(0,oe.jsx)("text",{fill:Z.active,dominantBaseline:"middle",textAnchor:"middle",fontFamily:ii.ry,fontSize:O,x:"50%",y:"50%",children:s()}),(0,oe.jsx)(Yo.Z,{fill:"transparent",height:t-(w.top+w.bottom),onMouseLeave:function(){return i()},onMouseMove:C,onTouchMove:C,onTouchStart:C,rx:14,width:g-(w.left+w.right),x:w.left,y:w.top}),(null===_||void 0===_?void 0:_.length)&&(0,oe.jsxs)(Eo.Z,{left:w.left,top:w.top,children:[(0,oe.jsx)(Ko.Z,{color:k,data:_,keys:P,width:T,xScale:S,y0:M,y0Scale:D,y1Scale:I,children:function(e){return e.map((function(e){return(0,oe.jsx)(Eo.Z,{top:e.y0,children:e.bars.map((function(n){return(0,oe.jsx)("g",{children:(0,oe.jsx)(oe.Fragment,{children:(0,oe.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,oe.jsx)(qo.Z,{hideTicks:!0,scale:D,stroke:Z.muted,tickFormat:function(e){return A(e)},tickLabelProps:function(){return{fill:Z.active,fontFamily:ii.ry,fontSize:O,style:{width:"10px"},textAnchor:"end"}},tickStroke:Z.muted,tickValues:E,top:2}),(0,oe.jsx)(Vo.Z,{label:b,labelProps:{fill:Z.muted,fontFamily:ii.ry,fontSize:O,textAnchor:"middle"},numTicks:x,scale:S,stroke:Z.muted,tickLabelProps:function(){return{fill:Z.active,fontFamily:ii.ry,fontSize:O,textAnchor:"middle"}},tickStroke:Z.muted,top:R})]}),p&&(0,oe.jsx)("g",{children:(0,oe.jsx)(Xo.Z,{from:{x:w.left,y:v},pointerEvents:"none",stroke:Z.active,strokeDasharray:"5,2",strokeWidth:1,to:{x:T+w.left,y:v}})})]}),m&&p&&(0,oe.jsxs)($o.Z,{left:h,style:pl(pl({},el.j),{},{backgroundColor:Z.tooltipBackground}),top:v,children:[d&&d(p),!d&&Object.entries(p).map((function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];if(o!==t){var r=i;return(0,re.HW)(r)&&String(r).split(".").length>=2&&(r=r.toFixed(4)),(0,oe.jsxs)(be.ZP,{inverted:!0,small:!0,children:[t,": ",r]},t)}}))]})]})}));var ml=function(e){var n,t=e.height,i=e.width,r=e.xAxisLabel,o=e.yAxisLabel,l=(0,Ee.Z)(e,dl);return n="undefined"===typeof i?"100%":o?0===i?i:i-28:i,(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)("div",{style:{display:"flex",height:t,marginBottom:r?ie.iI:null,width:"100%"},children:[o&&(0,oe.jsx)(pe.Z,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,oe.jsx)(nl.Z,{children:(0,oe.jsx)(be.ZP,{center:!0,muted:!0,small:!0,children:o})})}),(0,oe.jsx)("div",{style:{height:t,width:n},children:(0,oe.jsx)(So.Z,{children:function(e){var n=e.width,t=e.height;return(0,oe.jsx)(hl,pl(pl({},l),{},{height:t,width:n}))}})})]}),r&&(0,oe.jsx)("div",{style:{paddingLeft:o?36:0,paddingTop:4},children:(0,oe.jsx)(be.ZP,{center:!0,muted:!0,small:!0,children:r})})]})},vl=t(95422),gl=["keyForYData"],bl=["height","width","xAxisLabel","yAxisLabel"];function xl(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 jl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?xl(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var yl=(0,Jo.Z)((function(e){var n=e.keyForYData,t=void 0===n?"__y":n,i=(0,Ee.Z)(e,gl),r=i.height,o=i.hideTooltip,c=i.renderNoDataText,a=i.renderTooltipContent,u=i.tooltipData,s=i.tooltipLeft,d=i.tooltipOpen,f=i.tooltipTop,p=i.width,h=i.xLabelFormat,m=i.xNumTicks,v=i.yNumTicks,g=sl(jl(jl({},i),{},{keyForYData:t,orientationVertical:!0})),b=g.colorScale,x=g.colors,j=g.data,y=g.fontSize,k=g.handleTooltip,Z=g.margin,_=g.tempScale,O=(g.tickValues,g.xKeys),C=(g.xMax,g.y1Scale),w=g.yLabelFormat,S=g.yMax,E=g.yScale,P=g.ySerialize;return p<10?null:(0,oe.jsxs)("div",{children:[(0,oe.jsxs)("svg",{height:r,width:p,children:[c&&!(null!==j&&void 0!==j&&j.length)&&(0,oe.jsx)("text",{fill:x.active,dominantBaseline:"middle",textAnchor:"middle",fontFamily:ii.ry,fontSize:y,x:"50%",y:"50%",children:c()}),(null===j||void 0===j?void 0:j.length)&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Yo.Z,{fill:"transparent",height:r-(Z.top+Z.bottom),onMouseLeave:function(){return o()},onMouseMove:k,onTouchMove:k,onTouchStart:k,rx:14,width:p-(Z.left+Z.right),x:Z.left,y:2*Z.top}),(0,oe.jsxs)(Eo.Z,{top:Z.top,children:[(0,oe.jsx)(vl.Z,{color:b,data:j,height:S,keys:O,x0:P,x0Scale:E,x1Scale:C,yScale:_,children:function(e){return e.map((function(e){return(0,oe.jsx)(Eo.Z,{left:e.x0+Z.left,top:Z.top,children:e.bars.map((function(n){return(0,oe.jsx)("g",{children:(0,oe.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,oe.jsx)(qo.Z,{left:Z.left,numTicks:v,scale:_,stroke:x.muted,tickFormat:function(e){return w(e)},tickLabelProps:function(){return{fill:x.active,fontFamily:ii.ry,fontSize:y,textAnchor:"end",transform:"translate(-2,2.5)"}},tickStroke:x.muted,top:Z.top}),(0,oe.jsx)(Vo.Z,{hideTicks:!0,left:Z.left,numTicks:m,scale:E,stroke:x.muted,tickFormat:h,tickLabelProps:function(){return{fill:x.active,fontFamily:ii.ry,fontSize:y,textAnchor:"middle"}},tickStroke:x.muted,top:S+Z.top})]})]}),u&&(0,oe.jsx)("g",{children:(0,oe.jsx)(Xo.Z,{from:{x:s,y:2*Z.top},pointerEvents:"none",stroke:x.active,strokeDasharray:"5,2",strokeWidth:1,to:{x:s,y:S+2*Z.top}})})]}),d&&u&&(0,oe.jsxs)($o.Z,{left:s,style:jl(jl({},el.j),{},{backgroundColor:x.tooltipBackground}),top:f,children:[a&&a(u),!a&&Object.entries(u).map((function(e){var n=(0,l.Z)(e,2),i=n[0],r=n[1];if(t!==i){var o=r;return(0,re.HW)(o)&&String(o).split(".").length>=2&&(o=o.toFixed(4)),(0,oe.jsxs)(be.ZP,{inverted:!0,small:!0,children:[i,": ",o]},i)}})),(0,oe.jsx)("br",{}),(0,oe.jsxs)(be.ZP,{inverted:!0,small:!0,children:[h&&h(P(u)),!h&&P(u)]})]})]})}));var kl=function(e){var n=e.height,t=e.width,i=e.xAxisLabel,r=e.yAxisLabel,o=(0,Ee.Z)(e,bl);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)("div",{style:{display:"flex",height:n,marginBottom:i?ie.iI:null,width:"100%"},children:[r&&(0,oe.jsx)(pe.Z,{alignItems:"center",fullHeight:!0,justifyContent:"center",width:28,children:(0,oe.jsx)(nl.Z,{children:(0,oe.jsx)(be.ZP,{center:!0,muted:!0,small:!0,children:r})})}),(0,oe.jsx)("div",{style:{height:n,width:r?0===t?t:t-28:t},children:(0,oe.jsx)(So.Z,{children:function(e){var n=e.height,t=e.width;return(0,oe.jsx)(yl,jl(jl({},o),{},{height:n,width:t}))}})})]}),i&&(0,oe.jsx)("div",{style:{paddingLeft:r?36:0,paddingTop:4},children:(0,oe.jsx)(be.ZP,{center:!0,muted:!0,small:!0,children:i})})]})},Zl=t(66872),_l=t(68735),Ol=t(320),Cl=40*ie.iI,wl=Pe.default.div.withConfig({displayName:"indexstyle__ChartBlockStyle",componentId:"sc-1c3ufnj-0"})(["border-radius:","px;margin-left:","px;margin-right:","px;margin-top:","px;",""],hn.n_,.5*ie.iI,.5*ie.iI,1*ie.iI,(function(e){return"\n background-color: ".concat((e.theme.background||pn.Z.background).chartBlock,";\n ")})),Sl=Pe.default.div.withConfig({displayName:"indexstyle__ConfigurationOptionsStyle",componentId:"sc-1c3ufnj-1"})(["flex:4;padding-left:","px;padding-right:","px;"],1*ie.iI,1*ie.iI),El=Pe.default.div.withConfig({displayName:"indexstyle__CodeStyle",componentId:"sc-1c3ufnj-2"})(["padding-top:","px;",""],ie.iI/2,(function(e){return"\n background-color: ".concat((e.theme.background||pn.Z.background).codeTextarea,";\n ")})),Pl=Pe.default.div.withConfig({displayName:"indexstyle__CodeHelperStyle",componentId:"sc-1c3ufnj-3"})(["margin-bottom:","px;padding-bottom:","px;padding-left:","px;",""],ie.cd*ie.iI,ie.iI,ie.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||pn.Z.borders).medium,";\n ")}));function Tl(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 Il(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Tl(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Tl(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Al=function(e){var n,t=e.block,r=e.data,o=e.width,a=t.configuration,u=void 0===a?{}:a,s=u||{},d=s.chart_style,f=s.chart_type,p=s.y_sort_order,h=u.height||Cl,m=(null===u||void 0===u||null===(n=u.metrics)||void 0===n?void 0:n.map((function(e){return"".concat((n=e).aggregation,"(").concat(n.column,")");var n})))||[],v=jt.n1,g=u.time_interval;if([z.HOUR,z.MINUTE,z.SECOND].includes(g)&&(v=jt.OC),i.BAR_CHART===f||i.TIME_SERIES_BAR_CHART===f){var b=r.x,x=r.y,j=i.TIME_SERIES_BAR_CHART===f;if(b&&x&&Array.isArray(b)&&Array.isArray(x)){var y,k=null===(y=u.group_by)||void 0===y?void 0:y.join(", "),Z=null===m||void 0===m?void 0:m.join(", ");m.length||m.push(w);var _=m[0],O=b.map((function(e,n){return Il({__y:e},m.reduce((function(e,t,i){var r,o=null===x||void 0===x||null===(r=x[i])||void 0===r?void 0:r[n];return"undefined"===typeof o?e:Il(Il({},e),{},(0,c.Z)({},t,o))}),{}))}));U.ASCENDING===p?O=(0,tn.YC)(O,(function(e){return e[_]}),{ascending:!1}):U.DESCENDING===p&&(O=(0,tn.YC)(O,(function(e){return e[_]}),{ascending:!0}));var C={data:O,height:h,renderNoDataText:function(){return"No data matching query"},width:o,xNumTicks:3};return L.HORIZONTAL===d?(0,oe.jsx)(ml,Il(Il({},C),{},{xAxisLabel:Z||u.y,yAxisLabel:k||u.x})):(0,oe.jsx)(kl,Il(Il({},C),{},{xAxisLabel:k,xLabelFormat:function(e){return j?Qo()(1e3*e).format(jt.n1):e},xNumTicks:O.length,yAxisLabel:Z,yNumTicks:5}))}}else if(i.HISTOGRAM===f){var S,E=r.x,P=r.y,T=null===(S=u.group_by)||void 0===S?void 0:S.join(", ");if(E&&P&&Array.isArray(E))return(0,oe.jsx)(Zl.Z,{data:E.map((function(e,n){var t,i=e.max,r=e.min;return[i,null===P||void 0===P||null===(t=P[n])||void 0===t?void 0:t.value,r]})),height:h,width:o,large:!0,margin:{left:5*ie.iI,right:1*ie.iI,top:3*ie.iI},noPadding:!0,renderTooltipContent:function(e){var n=(0,l.Z)(e,3),t=n[0],i=n[1],r=n[2];return(0,oe.jsxs)(be.ZP,{inverted:!0,monospace:!0,small:!0,children:["Count : ",i,(0,oe.jsx)("br",{}),"Bucket: ",r,"-",t]})},showAxisLabels:!0,showYAxisLabels:!0,showZeroes:!0,sortData:function(e){return(0,tn.YC)(e,"[0]")},xAxisLabel:T||u.x,yAxisLabel:T?"count(".concat(T,")"):u.y})}else if(i.LINE_CHART===f||i.TIME_SERIES_LINE_CHART===f){var I=r.x,A=r.y,R=i.TIME_SERIES_LINE_CHART===f;if(I&&A&&Array.isArray(I)&&Array.isArray(A)&&Array.isArray(null===A||void 0===A?void 0:A[0])){var D,M=m;u.legend_labels&&(M=u.legend_labels.split(",").map((function(e){return e.trim()})));var N=I.map((function(e,n){return{x:e,y:(0,tn.w6)(A.length).map((function(e,t){var i=A[t][n];return"undefined"===typeof i||null===i?0:i}))}})),B=null===(D=u.group_by)||void 0===D?void 0:D.join(", "),F=m.join(", ");return(0,oe.jsx)(_l.Z,{data:N,height:h,lineLegendNames:M,margin:{bottom:8*ie.iI,left:5*ie.iI},noCurve:!0,renderXTooltipContent:function(e){e.index;var n=e.x,t=u.x,i=n;return u.group_by&&(t=u.group_by.map(String).join(", ")),R&&(i=Qo()(1e3*n).format(v)),(0,oe.jsxs)(be.ZP,{inverted:!0,small:!0,children:[t,": ",i]})},renderYTooltipContent:function(e,n){var t=e.y;return(0,oe.jsxs)(be.ZP,{inverted:!0,small:!0,children:[M&&M[n]&&"".concat(M[n],": "),t&&(0,re.x6)((0,re.QV)(t[n],4))]})},width:o?o-3*ie.iI:o,xAxisLabel:B||String(u.x),xLabelFormat:function(e){return R?Qo()(1e3*e).format(jt.n1):e},yAxisLabel:F||String(u.y),yLabelFormat:function(e){return e}})}}else if(i.PIE_CHART===f){var H,G=r[String(u.x)],W=null===(H=u.group_by)||void 0===H?void 0:H.join(", ");if(G)return(0,oe.jsx)(Ol.Z,{data:Object.entries(G),getX:function(e){var n=(0,l.Z)(e,2),t=n[0],i=n[1];return"".concat(t," (").concat((0,re.x6)(i),")")},getY:function(e){return(0,l.Z)(e,2)[1]},height:h,width:o,xAxisLabel:W||String(u.x)})}else if(i.TABLE===f){var Q=r.index,q=r.x,V=r.y;return Array.isArray(q)&&Array.isArray(V)&&Array.isArray(V[0])&&(0,oe.jsx)(fi.Z,{columns:q,index:Q,height:u.height?null:h,maxHeight:u.height?h:null,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,rows:V,width:o})}return(0,oe.jsx)("div",{})},Rl=t(76096);var Dl=function(e){var n=e.children,t=e.onChange,i=(0,d.useState)(d.Children.map(n,(function(){return null}))),r=i[0],o=i[1],l=(0,d.useState)(0),c=l[0],a=l[1];return(0,oe.jsx)(pe.Z,{children:d.Children.map(n,(function(e,n){return(0,oe.jsx)(ge.Z,{ml:n>=1?1:0,style:{display:"flex",flex:1},children:d.cloneElement(e,{onChange:function(e){o((function(i){return i[n]=e.target.value,t(i,{resetValues:function(){return a((function(e){return e+1}))},setValues:o}),i}))},value:r[n]})},"multi-select-child-".concat(n,"-").concat(c))}))})};function Ml(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 Nl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ml(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ml(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Bl(e,n){var t,r,o,a,u=e.autocompleteItems,s=e.block,p=e.blockRefs,m=e.blocks,v=e.deleteWidget,g=e.executionState,b=e.fetchPipeline,x=e.fetchFileTree,j=e.messages,y=void 0===j?[]:j,k=e.onChangeContent,Z=e.pipeline,_=e.runBlock,C=e.runningBlocks,w=e.savePipelineContent,S=e.selected,E=e.setAnyInputFocused,P=e.setSelectedBlock,T=e.setTextareaFocused,I=e.textareaFocused,A=e.updateWidget,R=e.width,D=(0,d.useRef)(null),M=(0,d.useContext)(Pe.ThemeContext),N=an.ZP.blocks.pipelines.detail(null===Z||void 0===Z?void 0:Z.uuid,null===s||void 0===s?void 0:s.upstream_blocks[0]).data,L=(null===N||void 0===N||null===(t=N.block)||void 0===t?void 0:t.outputs)||(null===s||void 0===s?void 0:s.outputs)||[],F=(0,d.useState)(null),U=F[0],z=F[1],G=(0,d.useState)(null===(r=s.configuration)||void 0===r?void 0:r.chart_type),W=G[0],Q=G[1],q=(0,d.useState)(s.configuration),V=q[0],Y=q[1],J=(0,d.useState)(s.content),te=J[0],le=J[1],ce=(0,d.useState)(!W||0===L.length),ae=ce[0],ue=ce[1],se=(0,d.useState)(!1),de=se[0],fe=se[1],me=(0,d.useState)(null),ve=me[0],ye=me[1],ke=(0,d.useState)(null===s||void 0===s?void 0:s.upstream_blocks),Ze=ke[0],_e=ke[1],Oe=(0,d.useState)((null===L||void 0===L?void 0:L.length)||0),Ce=Oe[0],we=Oe[1],Se=(0,d.useState)(s.uuid),Ee=Se[0],Te=Se[1],Ie=$[W],Ae=ee[W],Re=(0,d.useMemo)((function(){return null===m||void 0===m?void 0:m.filter((function(e){var n=e.type;return[h.tf.DATA_LOADER,h.tf.TRANSFORMER].includes(n)}))}),[m]),De=(0,d.useMemo)((function(){return(0,tn.HK)(Re,(function(e){return e.uuid}))}),[Re]),Me=!!C.find((function(e){return e.uuid===s.uuid}))||(null===y||void 0===y?void 0:y.length)>=1&&g!==Nn.uF.IDLE,Ne=(0,d.useMemo)((function(){return null===y||void 0===y?void 0:y.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[y]),Be=!!Ne.find((function(e){return e.error})),Le=Ne.length>=1,Fe=(0,d.useMemo)((function(){return{blockType:s.type,hasError:Be,selected:S}}),[s.type,Be,S]);if(null!==Ne&&void 0!==Ne&&Ne.length){var He,Ue,Ge=Ne.length-1;a=null===Ne||void 0===Ne||null===(He=Ne[Ge])||void 0===He||null===(Ue=He.data)||void 0===Ue?void 0:Ue[0]}a?(a=(a=a.slice(1,a.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,re.Pb)(a)&&(o=JSON.parse(a))):(null===L||void 0===L?void 0:L.length)>=1&&(o={},L.forEach((function(e){var n=e||{},t=n.text_data,i=n.type,r=n.variable_uuid;Nn.Gi.TEXT===i&&(0,re.Pb)(t)&&(o[r]=JSON.parse(t))})));var We=(0,d.useCallback)((function(e){var n=Nl(Nl(Nl({},s),e),{},{configuration:Nl(Nl({},s.configuration),e.configuration)});w().then((function(){_({block:n,code:te,ignoreAlreadyRunning:!0,runUpstream:!!Ze.find((function(e){var n;return![h.DA.EXECUTED,h.DA.UPDATED].includes(null===(n=De[e])||void 0===n?void 0:n.status)}))})})),we((function(e){return e+1}))}),[s,De,te,we,Ze]),Qe=(0,d.useCallback)((function(e){le(e),k(e)}),[k,le]),qe=(0,d.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;Y((function(n){return Nl(Nl({},n),e)}));var i=Nl(Nl({},s),{},{configuration:Nl(Nl(Nl({},V),e),{},{chart_type:W})});A(i);Object.keys(e);Ce&&t&&We(i)}),[s,W,V,Ce,We,Y,A]);(0,d.useEffect)((function(){z({python:nr({autocompleteItems:u,block:s,blocks:m,pipeline:Z})})}),[u,s,m,Z]);var Ve=(0,d.useMemo)((function(){return(0,oe.jsx)(Mn.Z,{autoHeight:!0,autocompleteProviders:U,onChange:Qe,selected:S,setSelected:function(e){return P(!0===e?s:null)},setTextareaFocused:T,showLineNumbers:!1,textareaFocused:I||i.TABLE===W&&!ae,value:te,width:"100%"})}),[U,W,te,ae,S,P,T,I,Qe]),Ye=(0,d.useMemo)((function(){return Be&&Le&&(0,oe.jsx)(Pi,Nl(Nl({},Fe),{},{block:s,contained:!1,hideExtraInfo:!0,isInProgress:Me,messages:Ne,selected:S}))}),[s,Fe,Be,Le,Me,Ne,S]),Xe=(0,tr.Z)(ae),Je=(0,tr.Z)(R);(0,d.useEffect)((function(){var e,n=null===D||void 0===D||null===(e=D.current)||void 0===e?void 0:e.getBoundingClientRect();Xe!==ae||Je!==R?(ye(0),setTimeout((function(){var e,n,t=null===D||void 0===D||null===(e=D.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width;t&&ye(t)}),100)):n&&ye(n.width)}),[ae,Xe,D.current,ye,R,Je]);var $e=(0,d.useMemo)((function(){var e=[];return Ze.forEach((function(n,t){var i=De[n],r=(0,Ke.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:M}).accent;e.push((0,oe.jsxs)(ge.Z,{ml:2,children:[(0,oe.jsxs)(be.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,oe.jsx)(be.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,oe.jsx)(Jn.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,oe.jsx)(be.ZP,{color:r,monospace:!0,small:!0,children:n})})]},n))})),e}),[De,Ze]),en=(0,d.useMemo)((function(){var e,n=[],t=null===Ie||void 0===Ie||null===(e=Ie.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return B.includes(t)?e.concat(t):e}),[]);null===t||void 0===t||t.length;return null===t||void 0===t||t.forEach((function(e,t){var i=V[e];if(i){var r,o,l=null===(r=ne[W])||void 0===r||null===(o=r[e])||void 0===o?void 0:o.call(r);n.push((0,oe.jsxs)(ge.Z,{ml:2,children:[(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:i})," ",l&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(be.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,oe.jsx)(be.ZP,{default:!0,inline:!0,small:!0,children:l})]})]},i))}})),n}),[V,Ie]),nn=(0,tr.Z)(W),rn=(0,tr.Z)(Ze);(0,d.useEffect)((function(){if((!nn&&W&&null!==Ze&&void 0!==Ze&&Ze.length||(null===rn||void 0===rn||!rn.length)&&(null===Ze||void 0===Ze?void 0:Ze.length)>=1&&W)&&!te&&(0,gn.Qr)(V)&&Ae){var e=Nl(Nl({},s),{},{upstream_blocks:Ze});Ae.configuration&&qe(Ae.configuration(e)),Ae.content&&Qe(Ae.content(e))}}),[s,W,nn,V,te,qe,Qe,Ze,rn]);var on=(0,d.useMemo)((function(){return V.width_percentage||1}),[V]),ln=(0,d.useMemo)((function(){return Object.entries(Ie||{}).reduce((function(e,n){var t=(0,l.Z)(n,2),i=t[0],r=t[1];return Nl(Nl({},e),{},(0,c.Z)({},i,r.map((function(e){var n,t=e.autoRun,i=e.label,r=e.monospace,o=e.options,l=e.settings,a=void 0===l?{}:l,u=e.type,d=e.uuid,f={fullWidth:!0,key:d,label:(0,re.kC)(i()),monospace:r,onBlur:function(){return P(s)},onChange:function(e){return qe((0,c.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return P(s)},value:(null===V||void 0===V?void 0:V[d])||""},p=(null!==N&&void 0!==N&&N.block?[N.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(K.COLUMNS===u){var h=V[d]||[];n=(0,oe.jsxs)(oe.Fragment,{children:[(!a.maxValues||h.length<a.maxValues)&&(0,oe.jsxs)(Vi.Z,Nl(Nl({},f),{},{onChange:function(e){var n=V[d]||[],i=e.target.value;n.includes(i)?n=(0,tn.Od)(n,(function(e){return e===i})):n.push(i),qe((0,c.Z)({},d,n),{autoRun:t})},value:null,children:[(0,oe.jsx)("option",{value:""}),(0,tn.YC)(p.filter((function(e){return!h.includes(e)})),(function(e){return e})).map((function(e){return(0,oe.jsx)("option",{value:e,children:e},e)}))]})),h.map((function(e){return(0,oe.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,oe.jsx)(Hr,{label:e,onClick:function(){qe((0,c.Z)({},d,(0,tn.Od)(h,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(K.METRICS===u){var m=V[d]||[];n=(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(be.ZP,{bold:!0,children:"Metrics"}),(0,oe.jsx)(be.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,oe.jsxs)(Dl,{onChange:function(e,n){var i=n.resetValues,r=n.setValues;2===e.filter((function(e){return!!e})).length&&(m.find((function(n){var t=n.aggregation;return n.column===e[1]&&t===e[0]}))||(qe((0,c.Z)({},d,m.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),r([null,null]),i()))},children:[(0,oe.jsxs)(Vi.Z,Nl(Nl({},f),{},{label:"aggregation",children:[(0,oe.jsx)("option",{value:""}),(0,tn.YC)(X,(function(e){return e})).map((function(e){return(0,oe.jsx)("option",{value:e,children:e},e)}))]})),(0,oe.jsxs)(Vi.Z,Nl(Nl({},f),{},{label:"column",children:[(0,oe.jsx)("option",{value:""}),(0,tn.YC)(p,(function(e){return e})).map((function(e){return(0,oe.jsx)("option",{value:e,children:e},e)}))]}))]}),m.map((function(e){var n=e.aggregation,i=e.column;return(0,oe.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,oe.jsx)(Hr,{label:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(be.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,oe.jsx)(be.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){qe((0,c.Z)({},d,(0,tn.Od)(m,(function(e){var t=e.aggregation,r=e.column;return n===t&&i===r}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=o?(0,oe.jsx)(Vi.Z,Nl(Nl({},f),{},{children:o.map((function(e){return(0,oe.jsx)("option",{value:e,children:e},e)}))})):(0,oe.jsx)(xe.Z,Nl(Nl({},f),{},{type:u}));return(0,oe.jsx)(ge.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[De,V,Ie,L,P,qe,Ze]),cn=ln.code,un=ln.noCode,sn=(0,f.Db)(an.ZP.widgets.pipelines.useUpdate(null===Z||void 0===Z?void 0:Z.uuid,s.uuid),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){fe(!1),b(),x()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})},onError:function(e){(0,Zn.qQ)(e).messages}}),dn=(0,l.Z)(sn,1)[0],fn="ChartBlock/".concat(s.uuid),hn=(0,Hn.y)(),mn=hn.registerOnKeyDown,vn=hn.unregisterOnKeyDown;return(0,d.useEffect)((function(){return function(){vn(fn)}}),[vn,fn]),mn(fn,(function(e,n,t){de&&String(t[0])===String(je.Uq)&&String(t[1])!==String(je.zX)&&dn({widget:Nl(Nl({},s),{},{name:Ee})})}),[s,de,Ee,dn]),(0,oe.jsx)(Rl.Z,{sm:12,md:12*on,children:(0,oe.jsxs)(wl,{ref:n,children:[(0,oe.jsx)(ge.Z,{mt:1,pt:1,px:1,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,oe.jsxs)(In.Z,{flex:1,style:{position:"relative"},children:[(0,oe.jsx)(xt,{bold:!1,fullWidth:!0,inputValue:Ee,notRequired:!0,onBlur:function(){return setTimeout((function(){return fe(!1)}),300)},onChange:function(e){Te(e.target.value),e.preventDefault()},onClick:function(){E(!0),fe(!0)},onFocus:function(){E(!0),fe(!0)},small:!0,stacked:!0,value:!de&&s.uuid}),de&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ge.Z,{ml:1}),(0,oe.jsx)(Jn.Z,{noWrapping:!0,onClick:function(){return dn({widget:Nl(Nl({},s),{},{name:Ee})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(Vi.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=Nl(Nl({},s),{},{upstream_blocks:n});A(t),We(t),_e(n)},placeholder:"Source block",small:!0,value:(null===Ze||void 0===Ze?void 0:Ze[0])||"",children:null===Re||void 0===Re?void 0:Re.map((function(e){var n=e.uuid;return(0,oe.jsx)("option",{value:n,children:n},n)}))}),(0,oe.jsx)(ge.Z,{mr:1}),!Me&&(0,oe.jsx)($n.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,oe.jsx)(he.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return We(s)},uuid:"ChartBlock/run/".concat(s.uuid),children:(0,oe.jsx)(ze.Py,{size:2*ie.iI})})}),Nn.uF.QUEUED===g&&(0,oe.jsx)(Di.Z,{color:(M||pn.Z).content.active,small:!0,type:"cylon"}),Nn.uF.BUSY===g&&(0,oe.jsx)(Di.Z,{color:(M||pn.Z).content.active,small:!0}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsx)($n.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,oe.jsx)(he.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return ue((function(e){return!e}))},selected:ae,uuid:"ChartBlock/edit/".concat(s.uuid),children:(0,oe.jsx)(ze.I8,{size:2*ie.iI})})}),(0,oe.jsx)(ge.Z,{mr:1}),(0,oe.jsx)($n.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,oe.jsx)(he.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return v(s)},uuid:"ChartBlock/delete/".concat(s.uuid),children:(0,oe.jsx)(ze.rF,{size:2*ie.iI})})})]})]})}),(0,oe.jsx)(ge.Z,{mt:1}),(0,oe.jsxs)(pe.Z,{justifyContent:"space-between",fullWidth:!0,children:[(0,oe.jsx)(In.Z,{flex:6,ref:D,children:o&&!(0,gn.Qr)(o)&&(0,oe.jsx)(ge.Z,{pb:3,children:(0,oe.jsx)(Al,{block:Nl(Nl({},s),{},{configuration:Nl(Nl({},s.configuration),V)}),data:o,width:ve})})}),ae&&(0,oe.jsx)(Sl,{children:(0,oe.jsxs)(pe.Z,{flexDirection:"column",fullWidth:!0,children:[(0,oe.jsx)(ge.Z,{mb:1,children:(0,oe.jsx)(Vi.Z,{onChange:function(e){var n=e.target.value,t=Nl(Nl({},s),{},{configuration:Nl(Nl({},V),{},{chart_type:n})});A(t),We(t),Q(n)},placeholder:"Select chart type",value:W,children:H.map((function(e){return(0,oe.jsx)("option",{value:e,children:(0,re.kC)(e)},e)}))})}),(0,oe.jsx)(ge.Z,{mb:1,children:(0,oe.jsx)(Vi.Z,{onChange:function(e){return qe((0,c.Z)({},O,e.target.value))},placeholder:"Chart width",value:(null===V||void 0===V?void 0:V.width_percentage)||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,oe.jsx)("option",{value:i,children:t},t)}))})}),un]})})]}),ae&&!(null===cn||void 0===cn||!cn.length)&&h.t6.SQL!==s.language&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(ge.Z,{my:1,px:1,children:[(0,oe.jsx)(be.ZP,{bold:!0,children:"Custom chart code"}),(0,oe.jsxs)(be.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,oe.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,oe.jsxs)(El,{children:[Ze.length>=1&&(0,oe.jsxs)(Pl,{children:[(0,oe.jsxs)(be.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",$e]}),(0,oe.jsxs)(be.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",en]})]}),Ve]})]}),Ye&&(0,oe.jsx)(ge.Z,{px:1,children:Ye})]})})}var Ll=d.forwardRef(Bl),Fl=t(97361),Hl=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function Ul(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function zl(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ul(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ul(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Gl=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,r=e.deleteWidget,o=e.messages,l=e.onChangeChartBlock,a=e.runBlock,u=e.runningBlocks,s=e.savePipelineContent,f=e.selectedBlock,p=e.setAnyInputFocused,h=e.setSelectedBlock,m=e.setTextareaFocused,v=e.textareaFocused,g=e.updateWidget,b=e.widgets,x=e.width,j=(0,Ee.Z)(e,Hl),y=(0,d.useMemo)((function(){return u.reduce((function(e,n,t){return zl(zl({},e),{},(0,c.Z)({},n.uuid,zl(zl({},n),{},{priority:t})))}),{})}),[u]);return(0,oe.jsxs)(pe.Z,{flexDirection:"column",fullWidth:!0,children:[(0,oe.jsx)(Fl.Z,{fullHeight:!0,style:{marginLeft:.5*ie.iI,marginRight:.5*ie.iI},children:null===b||void 0===b?void 0:b.map((function(e){var c=e.uuid,b=y[c],k=b?0===b.priority?Nn.uF.BUSY:Nn.uF.QUEUED:Nn.uF.IDLE;return i.current[c]=(0,d.createRef)(),(0,d.createElement)(Ll,zl(zl({},j),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:r,executionState:k,key:c,messages:o[c],onChangeContent:function(e){return l(c,e)},ref:i.current[c],runBlock:a,runningBlocks:u,savePipelineContent:s,selected:(null===f||void 0===f?void 0:f.uuid)===c,setAnyInputFocused:p,setSelectedBlock:h,setTextareaFocused:m,textareaFocused:v,updateWidget:g,width:x}))}))}),(0,oe.jsx)("div",{style:{height:"80vh"}})]})},Wl=t(86532),Ql=Pe.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),ql=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,oe.jsxs)(Ql,{height:t*(305/358),viewBox:r,width:t,children:[(0,oe.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,oe.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,oe.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,oe.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,oe.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,oe.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,oe.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,oe.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,oe.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,oe.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,oe.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,oe.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,oe.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,oe.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,oe.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,oe.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,oe.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,oe.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,oe.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"})]})},Vl=t(88560),Yl=(Pe.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-43nc8t-0"})(["border-radius:","px;",""],hn.TR,(function(e){return"\n border: 1px solid ".concat((e.theme.interactive||Io.Z.interactive).defaultBorder,";\n ")})),Pe.default.div.withConfig({displayName:"indexstyle__ColumnProfileStyle",componentId:"sc-43nc8t-1"})(["",""],(function(e){return"\n background: ".concat((e.theme.background||Io.Z.background).table,";\n border-bottom: 1px solid ").concat((e.theme.interactive||Io.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||Io.Z.interactive).defaultBorder,";\n ")}))),Kl=(Pe.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-43nc8t-2"})(["background:",";padding:","px ","px;"," border-top-left-radius:","px;border-top-right-radius:","px;"],ol.Uq,1.75*ie.iI,ie.tr,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.interactive||Io.Z.interactive).defaultBorder,";\n ")}),hn.TR,hn.TR),Pe.default.div.withConfig({displayName:"indexstyle__FeatureProfileStyle",componentId:"sc-43nc8t-3"})(["",""],(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.interactive||Io.Z.interactive).defaultBorder,";\n ")}))),Xl=(Pe.default.div.withConfig({displayName:"indexstyle__BodyStyle",componentId:"sc-43nc8t-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;overflow-y:scroll;"],hn.TR,hn.TR),Pe.default.div.withConfig({displayName:"indexstyle__CellStyle",componentId:"sc-43nc8t-5"})([""," padding:","px;"],(function(e){return e.backgroundColor&&"\n background-color: ".concat(e.backgroundColor,";\n ")}),ie.iI)),Jl=Pe.default.div.withConfig({displayName:"indexstyle__ScrollOverflowStyle",componentId:"sc-43nc8t-6"})([""," overflow-x:auto;"],nt.w5);function $l(e,n){return{average:e["".concat(n,"/average")],avg_string_length:e["".concat(n,"/avg_string_length")],avg_word_count:e["".concat(n,"/avg_word_count")],completeness:e["".concat(n,"/completeness")],count:e["".concat(n,"/count")],count_distinct:e["".concat(n,"/count_distinct")],invalid_indices:e["".concat(n,"/invalid_indices")],invalid_value_count:e["".concat(n,"/invalid_value_count")],invalid_value_rate:e["".concat(n,"/invalid_value_rate")],invalid_values:e["".concat(n,"/invalid_values")],max:e["".concat(n,"/max")],max_character_count:e["".concat(n,"/max_character_count")],max_null_seq:e["".concat(n,"/max_null_seq")],max_word_count:e["".concat(n,"/max_word_count")],median:e["".concat(n,"/median")],min:e["".concat(n,"/min")],min_character_count:e["".concat(n,"/min_character_count")],min_word_count:e["".concat(n,"/min_word_count")],mode:e["".concat(n,"/mode")],null_value_count:e["".concat(n,"/null_value_count")],null_value_rate:e["".concat(n,"/null_value_rate")],outlier_count:e["".concat(n,"/outlier_count")],outlier_ratio:e["".concat(n,"/outlier_ratio")],outliers:e["".concat(n,"/outliers")],quality:e["".concat(n,"/quality")],skew:e["".concat(n,"/skew")],std:e["".concat(n,"/std")],sum:e["".concat(n,"/sum")],unique_value_rate:e["".concat(n,"/unique_value_rate")],validity:e["".concat(n,"/validity")],value_counts:e["".concat(n,"/value_counts")]}}var ec=["Type","Missing","Unique","Min","Max","Mean","Median","Mode","Invalid","Outliers","Skewness","Std dev"],nc={Missing:0,Invalid:0,Outliers:0,Unique:.9};function tc(e){var n=e.columns,t=e.feature,i=e.shouldLink,r=e.statistics,o=(0,d.useContext)(Pe.ThemeContext),l=t.columnType,c=t.uuid,a=$l(r,c),u=a.average,s=a.avg_string_length,f=a.avg_word_count,p=a.count,h=a.count_distinct,m=a.invalid_value_count,v=a.invalid_value_rate,g=a.max,b=a.max_character_count,x=a.max_word_count,j=a.min,y=a.min_character_count,k=a.min_word_count,Z=a.median,_=a.mode,O=a.null_value_count,C=a.null_value_rate,w=a.outlier_count,S=a.skew,E=a.std,P=a.unique_value_rate,T=[l,O,h,j,g,u,Z,_,m,w,S,E],I={Min:k,Max:x,Mean:f},A={Min:"".concat((0,re._6)("character",y)),Max:"".concat((0,re._6)("character",b)),Mean:"".concat((0,re._6)("character",(0,re.QV)(s)))},R={Invalid:(0,re.T3)(v),Missing:(0,re.T3)(C),Unique:(0,re.T3)(P)},D=xn.T5[l],M=[o.background.row,o.background.row2],N=M[0],B=M[1],L=i?Jn.Z:be.ZP;return(0,oe.jsxs)(In.Z,{flexDirection:"column",children:[(0,oe.jsx)(Kl,{children:(0,oe.jsx)(ge.Z,{px:1,py:2,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[D&&(0,oe.jsxs)(In.Z,{title:Vl.Rp[l],children:[(0,oe.jsx)(D,{size:2*ie.iI}),"\xa0"]}),(0,oe.jsx)(L,{inline:!0,onClick:i?function(){return(0,ct.u)({column:n.indexOf(c)},{pushHistory:!0})}:void 0,preventDefault:!0,secondary:!0,children:(0,oe.jsx)(be.ZP,{bold:!0,default:!i,maxWidth:25*ie.iI,monospace:!0,secondary:i,textOverflow:!0,title:c,children:c})})]})})}),T.map((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"-",n=arguments.length>1?arguments[1]:void 0,t=ec[n],i=l===Vl.RL.TEXT&&t in I,r=i?I[t]:e,o=isNaN(r)?r:(0,re.QV)(r),c=t in nc&&o/p>nc[t];return(0,oe.jsx)(Xl,{backgroundColor:n%2===0?N:B,children:(0,oe.jsxs)(be.ZP,{bold:c,danger:c,default:!0,textOverflow:!0,title:i?A[t]:"",children:[i?"".concat((0,re._6)("word",o)):o,t in R&&" (".concat(R[t],")")]})},n)}))]})}var ic=function(e){var n=e.features,t=void 0===n?[]:n,i=e.shouldLink,r=e.statistics,o=(0,d.useContext)(Pe.ThemeContext),l=(0,d.useMemo)((function(){return t.map((function(e){return e.uuid}))}),[t]);return(0,oe.jsx)(zo.Z,{headerTitle:"Feature profiles",children:(0,oe.jsxs)(pe.Z,{children:[(0,oe.jsx)(Yl,{children:(0,oe.jsxs)(In.Z,{flex:1,flexDirection:"column",style:{background:o.background.table},children:[(0,oe.jsx)(ge.Z,{mr:1.25*ie.iI,mt:"".concat(53,"px")}),ec.map((function(e,n){return(0,oe.jsx)(Xl,{children:(0,oe.jsx)(be.ZP,{default:!i,secondary:i,children:e})},"".concat(e,"-").concat(n))}))]})}),(0,oe.jsx)(Jl,{children:(0,oe.jsx)(pe.Z,{children:t.map((function(e,n){return(0,oe.jsx)(Kl,{children:(0,oe.jsx)(tc,{columns:l,feature:e,shouldLink:i,statistics:r})},"".concat(e,"-").concat(n))}))})})]})})},rc=t(21764),oc=t(22673),lc=t(1286),cc=(ie.iI,lc.O$,ie.iI,ri.dN,Pe.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],et.Wi,nt.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),Pe.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*ie.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),Pe.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),ac=Pe.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*ie.iI,"px;\n ")})),uc=t(19963);var sc=function(e){var n=e.copyText,t=e.deleteVariable,i=e.fetchVariables,r=e.hideEdit,o=e.obfuscate,c=e.pipelineUUID,a=e.variable,u=a.uuid,s=(a.type,a.value),p=(0,d.useRef)(null),h=(0,d.useState)(!1),m=h[0],v=h[1],g=(0,d.useState)(u),b=g[0],x=g[1],j=(0,d.useState)(s),y=j[0],k=j[1],Z=(0,d.useState)(!1),_=Z[0],O=Z[1],C=(0,f.Db)(an.ZP.variables.pipelines.useUpdate(c,u),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){O(!1),i()}})}}),w=(0,l.Z)(C,1)[0],S=(0,d.useCallback)((function(e){if("Enter"===e.key){var n=y;try{n=JSON.parse(y)}catch(t){}w({variable:{name:b,value:n}})}else"Escape"===e.key&&O(!1)}),[b,y]);(0,d.useEffect)((function(){var e;_&&(null===p||void 0===p||null===(e=p.current)||void 0===e||e.focus())}),[_,p]);var E=n||"kwargs['".concat(u,"']");return(0,oe.jsx)("div",{onMouseEnter:function(){return v(!0)},onMouseLeave:function(){return v(!1)},children:(0,oe.jsxs)(Fl.Z,{children:[(0,oe.jsx)(Rl.Z,{md:1,hiddenSmDown:!0,children:(0,oe.jsx)(ac,{noPadding:!0,children:(0,oe.jsx)(he.ZP,{backgroundColor:uc.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(E),rc.Am.success("Successfully copied to clipboard.",{position:rc.Am.POSITION.BOTTOM_RIGHT,toastId:u})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(u),withIcon:!0,children:(0,oe.jsx)(ze.CK,{size:2.5*ie.iI})})})}),(0,oe.jsx)(Rl.Z,{md:4,children:_?(0,oe.jsx)(ac,{children:(0,oe.jsx)(xe.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:S,paddingHorizontal:0,placeholder:"variable",small:!0,value:b})}):(0,oe.jsx)(ac,{children:(0,oe.jsx)(be.ZP,{color:ol.Or,monospace:!0,small:!0,textOverflow:!0,children:u})})}),(0,oe.jsx)(Rl.Z,{md:7,children:_?(0,oe.jsx)(ac,{children:(0,oe.jsx)(xe.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){k(e.target.value),e.preventDefault()},onKeyDown:S,paddingHorizontal:0,placeholder:"enter value",ref:p,small:!0,value:y})}):(0,oe.jsxs)(ac,{children:[o?(0,oe.jsx)(be.ZP,{monospace:!0,small:!0,children:"********"}):(0,oe.jsx)(be.ZP,{monospace:!0,small:!0,children:s}),(0,oe.jsxs)(In.Z,{children:[!r&&m&&(0,oe.jsx)(he.ZP,{backgroundColor:uc.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){O(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(u),withIcon:!0,children:(0,oe.jsx)(ze.I8,{size:2.5*ie.iI})}),t&&m&&(0,oe.jsx)(he.ZP,{backgroundColor:uc.qJ,borderless:!0,inline:!0,muted:!0,onClick:t,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(u),withIcon:!0,children:(0,oe.jsx)(ze.rF,{size:2.5*ie.iI})})]})]})})]})})},dc=t(93348),fc=t(58122);var pc=function(e){e.blocks;var n=e.fetchVariables,t=e.pipeline,i=e.selectedBlock,r=e.setErrorMessages,o=e.variables,c=e.width,a=(0,d.useState)(!1),u=a[0],s=a[1],p=(0,d.useState)(),m=p[0],v=p[1],g=(0,d.useState)(),b=g[0],x=g[1],j=null===t||void 0===t?void 0:t.uuid,y=(0,f.Db)(an.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,Zn.wD)(e,{onErrorCallback:function(e){var n=e.error.exception;r((function(e){return e.concat(n)}))}})}}),k=(0,l.Z)(y,1)[0],Z=(0,f.Db)((function(e){return an.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),_=(0,l.Z)(Z,1)[0],O=(0,d.useCallback)((function(e){if("Enter"===e.key){var t=b;try{t=JSON.parse(b)}catch(i){}k({variable:{name:m,value:t}}).then((function(){n(),v(null),x(null)})),s(!1)}else"Escape"===e.key&&s(!1)}),[k,n,m,b]),C=(0,d.useMemo)((function(){return c-4*ie.iI}),[c]),w=(0,d.useMemo)((function(){return(0,fc.wx)(o,(function(e){return"global"===e.uuid}))}),[o]),S=(0,d.useMemo)((function(){return(0,fc.wx)(o,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,o]),E=(0,d.useMemo)((function(){return(0,oe.jsxs)(cc,{width:C,children:[u&&(0,oe.jsxs)(Fl.Z,{children:[(0,oe.jsx)(Rl.Z,{md:1,children:(0,oe.jsx)(ac,{noPadding:!0,children:(0,oe.jsx)(he.ZP,{backgroundColor:uc.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(m),rc.Am.success("Successfully copied to clipboard.",{position:rc.Am.POSITION.BOTTOM_RIGHT,toastId:m})},uuid:"Sidekick/GlobalVariables/".concat(m),withIcon:!0,children:(0,oe.jsx)(ze.CK,{size:2.5*ie.iI})})})}),(0,oe.jsx)(Rl.Z,{md:4,children:(0,oe.jsx)(ac,{children:(0,oe.jsx)(xe.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){v(e.target.value),e.preventDefault()},onKeyDown:O,paddingHorizontal:0,placeholder:"variable",small:!0,value:m})})}),(0,oe.jsx)(Rl.Z,{md:7,children:(0,oe.jsx)(ac,{children:(0,oe.jsx)(xe.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:O,paddingHorizontal:0,placeholder:"enter value",small:!0,value:b})})})]}),null===w||void 0===w?void 0:w.map((function(e){return(0,oe.jsx)(sc,{deleteVariable:function(){return _(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e})}))]})}),[_,w,m,b,j,v,x,s,u,C]),P=(0,d.useMemo)((function(){return(0,oe.jsx)(cc,{width:C,children:null===S||void 0===S?void 0:S.map((function(e){return(0,oe.jsx)(sc,{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});var n}))})}),[S,i,C]);return(0,oe.jsxs)(ge.Z,{p:ie.cd,children:[(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(Er.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,oe.jsx)(ge.Z,{ml:2}),(0,oe.jsx)(he.ZP,{Icon:ze.mm,blackBorder:!0,inline:!0,onClick:function(){return s((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsxs)(be.ZP,{muted:!0,children:["Press ",(0,oe.jsx)(be.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,oe.jsx)(be.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:E}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsx)(be.ZP,{children:"Global variables will be passed into all non-scratchpad blocks as keyword arguments. To load a global variable, use the following syntax:"})}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsx)(oc.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})}),(0,oe.jsxs)(ge.Z,{mb:ie.cd,children:[(0,oe.jsx)(Er.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,oe.jsx)(ge.Z,{mb:ie.cd}),(0,oe.jsx)(be.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(dc.Xm).map((function(e){var n;return(0,oe.jsxs)(ge.Z,{mb:ie.cd,children:[(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsx)(be.ZP,{large:!0,monospace:!0,children:(0,re.vg)(null===(n=dc.Z4[e])||void 0===n?void 0:n.call(dc.Z4))})}),(0,fc.JZ)([],e).map((function(e){return(0,oe.jsx)(sc,{hideEdit:!0,variable:e,pipelineUUID:j})}))]})})),S&&S.length>0&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(ge.Z,{my:2,children:(0,oe.jsx)(Er.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,oe.jsx)(ge.Z,{mb:2,children:P}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsxs)(be.ZP,{children:["Output variables can be used in any ",(0,oe.jsx)(be.ZP,{bold:!0,inline:!0,monospace:!0,children:h.tf.SCRATCHPAD})," block."]})}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsx)(be.ZP,{children:"To load the variable, use the following syntax:"})}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsx)(oc.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"})})]})]})},hc=Pe.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-0"})([""," overflow-y:scroll;"," ",""],nt.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return!e.height&&"\n height: ".concat(300,"px;\n ")}));function mc(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 vc(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mc(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mc(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gc=function(e){var n=e.cancelPipeline,t=e.executePipeline,i=e.isPipelineExecuting,r=e.pipelineMessages,o=(0,d.useMemo)((function(){return(null===r||void 0===r?void 0:r.length)||0}),[r]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(pe.Z,{children:[(0,oe.jsx)(se.Z,{beforeIcon:(0,oe.jsx)(ze.JM,{inverted:!0,size:2*ie.iI}),loading:i,onClick:t,success:!0,children:(0,oe.jsx)(be.ZP,{bold:!0,inverted:!0,primary:!1,children:"Execute pipeline"})}),(0,oe.jsx)(ge.Z,{ml:1}),i&&(0,oe.jsx)(se.Z,{beforeIcon:(0,oe.jsx)(ze.x8,{inverted:!0,size:2*ie.iI}),onClick:n,success:!0,children:(0,oe.jsx)(be.ZP,{bold:!0,inverted:!0,primary:!1,children:"Cancel Pipeline"})})]}),(0,oe.jsx)(hc,{noScrollbarTrackBackground:!0,children:(0,oe.jsx)(hi,{executedAndIdle:!0,hasError:!1,selected:!0,children:r.map((function(e,n){var t=e.data,i=e.type,r=[],l=(r=(r=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return r.map((function(e,t){var r,c={first:0===n&&0===t,last:n===o-1&&t===l-1};return Nn.jU.includes(i)?r=(0,oe.jsx)(mi,vc(vc({},c),{},{children:(0,oe.jsx)(be.ZP,{monospace:!0,preWrap:!0,children:(0,oe.jsx)(di(),{children:e})})})):i===Nn.Gi.IMAGE_PNG&&(r=(0,oe.jsx)("div",{style:{backgroundColor:"white"},children:(0,oe.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,oe.jsx)("div",{children:r},"code-output-".concat(n,"-").concat(t))}))}))})})]})};var bc=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,r=e.setErrorMessages,o=e.width,c=(0,d.useState)(!1),a=c[0],u=c[1],s=(0,d.useState)(),p=s[0],h=s[1],m=(0,d.useState)(),v=m[0],g=m[1],b=(0,d.useMemo)((function(){return o-4*ie.iI}),[o]),x=(0,f.Db)(an.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,Zn.wD)(e,{onErrorCallback:function(e){var n=e.error.exception;r((function(e){return e.concat(n)}))}})}}),j=(0,l.Z)(x,1)[0],y=(0,f.Db)((function(e){return an.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);r((function(e){return e.concat(t)}))}})}}),k=(0,l.Z)(y,1)[0],Z=(0,d.useCallback)((function(e){"Enter"===e.key?(j({secret:{name:p,value:v}}).then((function(){n(),h(null),g(null)})),u(!1)):"Escape"===e.key&&u(!1)}),[j,n,p,v]);return(0,oe.jsxs)(ge.Z,{p:ie.cd,children:[(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsxs)(pe.Z,{alignItems:"center",children:[(0,oe.jsx)(Er.Z,{level:4,monospace:!0,children:"Secrets"}),(0,oe.jsx)(ge.Z,{ml:2}),(0,oe.jsx)(he.ZP,{Icon:ze.mm,blackBorder:!0,inline:!0,onClick:function(){return u((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsxs)(be.ZP,{children:[(0,oe.jsx)(be.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."]})}),a&&(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsxs)(be.ZP,{muted:!0,children:["Press ",(0,oe.jsx)(be.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,oe.jsx)(be.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsxs)(cc,{width:b,children:[a&&(0,oe.jsxs)(Fl.Z,{children:[(0,oe.jsx)(Rl.Z,{md:1,children:(0,oe.jsx)(ac,{noPadding:!0,children:(0,oe.jsx)(he.ZP,{backgroundColor:uc.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(p,") }}")),rc.Am.success("Successfully copied to clipboard.",{position:rc.Am.POSITION.BOTTOM_RIGHT,toastId:p})},uuid:"Sidekick/Secrets/".concat(p),withIcon:!0,children:(0,oe.jsx)(ze.CK,{size:2.5*ie.iI})})})}),(0,oe.jsx)(Rl.Z,{md:4,children:(0,oe.jsx)(ac,{children:(0,oe.jsx)(xe.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){h(e.target.value),e.preventDefault()},onKeyDown:Z,paddingHorizontal:0,placeholder:"secret name",small:!0,value:p})})}),(0,oe.jsx)(Rl.Z,{md:7,children:(0,oe.jsx)(ac,{children:(0,oe.jsx)(xe.Z,{compact:!0,borderless:!0,fullWidth:!0,monospace:!0,onChange:function(e){g(e.target.value),e.preventDefault()},onKeyDown:Z,paddingHorizontal:0,placeholder:"secret value",small:!0,value:v})})})]}),null===i||void 0===i?void 0:i.map((function(e){return(0,oe.jsx)(sc,{deleteVariable:function(){return k(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}})}))]})}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsx)(be.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,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsx)(oc.Z,{language:"yaml",small:!0,source:"\n {{ mage_secret_var('<secret_name>') }}\n "})}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsx)(be.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,oe.jsx)(ge.Z,{mb:ie.cd,children:(0,oe.jsx)(oc.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 "})})]})},xc=t(66607),jc=t(64155);var yc=function(e){var n=e.activeView,t=e.afterWidth,i=e.autocompleteItems,r=e.blockRefs,o=e.blocks,l=e.cancelPipeline,c=e.chartRefs,a=e.deleteWidget,u=e.editingBlock,s=e.executePipeline,f=e.fetchFileTree,p=e.fetchPipeline,h=e.fetchSecrets,m=e.fetchVariables,v=e.globalVariables,g=e.insights,b=e.interruptKernel,x=e.isPipelineExecuting,j=e.messages,y=e.metadata,k=e.onChangeChartBlock,Z=e.pipeline,_=e.pipelineMessages,O=e.runBlock,C=e.runningBlocks,w=e.sampleData,S=e.savePipelineContent,E=e.secrets,P=e.selectedBlock,T=e.setAnyInputFocused,I=e.setEditingBlock,A=e.setErrors,R=e.setSelectedBlock,D=e.setTextareaFocused,M=e.statistics,N=e.textareaFocused,B=e.updateWidget,L=e.widgets,F=(0,ko.i)().height,H=et.uX,U=(0,d.useState)([]),z=U[0],G=U[1],W=((null===u||void 0===u?void 0:u.upstreamBlocks)||{}).block,Q=((null===w||void 0===w?void 0:w.columns)||[]).slice(0,100),q=(null===w||void 0===w?void 0:w.rows)||[],V=(null===y||void 0===y?void 0:y.column_types)||{},Y=null===Q||void 0===Q?void 0:Q.map((function(e){return{columnType:V[e],uuid:e}})),K=(null===g||void 0===g?void 0:g[1])||{},X=(0,d.useMemo)((function(){return(0,tn.HK)((null===g||void 0===g?void 0:g[0])||[],(function(e){return e.feature.uuid}))}),[g]),J=(0,fc.v0)({statistics:M}),$=(0,fc.CL)({columnTypes:V,statistics:M}),ee=!!w,ne=(0,d.useMemo)((function(){return ve.q.INTEGRATION===(null===Z||void 0===Z?void 0:Z.type)}),[Z]),te=(0,d.useCallback)((0,lc.Fk)({columnTypes:V,columns:Q,insightsByFeatureUUID:X,insightsOverview:K,noColumnLinks:!0,statistics:M}),[V,Q,X,K,M]),re=(0,d.useMemo)((function(){return(0,oe.jsx)(pc,{blocks:o,fetchVariables:m,pipeline:Z,selectedBlock:P,setErrorMessages:G,variables:v,width:t})}),[t,null===r||void 0===r?void 0:r.current,o,m,v,Z,P,R]),le=(0,d.useMemo)((function(){return(0,oe.jsx)(bc,{fetchSecrets:h,pipelineUUID:null===Z||void 0===Z?void 0:Z.uuid,secrets:E,setErrorMessages:G,width:t})}),[t,h,Z,E]);return(0,d.useMemo)((function(){return(0,oe.jsx)(fi.Z,{columnHeaderHeight:jc.Eh,columns:Q,height:F-H-et.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:te,rows:q,width:t})}),[Q,q]),(0,oe.jsxs)(oe.Fragment,{children:[(null===z||void 0===z?void 0:z.length)>=1&&(0,oe.jsxs)(ge.Z,{mb:3,mt:2,mx:2,children:[(0,oe.jsxs)(pe.Z,{justifyContent:"space-between",children:[(0,oe.jsx)(be.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,oe.jsx)(se.Z,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return G([])},transparent:!0,children:(0,oe.jsx)(ze.x8,{muted:!0})})]}),null===z||void 0===z?void 0:z.map((function(e){return(0,oe.jsx)(ge.Z,{pb:1,children:(0,oe.jsx)(be.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,oe.jsxs)(jc.t0,{fullWidth:Qe.includes(n),heightOffset:Ae.TERMINAL===n?0:nt.nn,children:[n===Ae.TREE&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(Wl.Z,{blockRefs:r,editingBlock:u,enablePorts:!ne,fetchPipeline:p,height:F-H-300,pipeline:Z,runningBlocks:C,selectedBlock:P,setEditingBlock:I,setErrors:A,setSelectedBlock:R}),!W&&ve.q.INTEGRATION!==(null===Z||void 0===Z?void 0:Z.type)&&(0,oe.jsx)(ge.Z,{p:2,children:(0,oe.jsx)(gc,{cancelPipeline:l,executePipeline:s,isPipelineExecuting:x,pipelineMessages:_})})]}),n===Ae.DATA&&Q.length>0&&(0,oe.jsx)(fi.Z,{columnHeaderHeight:(0,gn.Qr)(V)&&(0,gn.Qr)(X)&&(0,gn.Qr)(K)?0:jc.Eh,columns:Q,height:F-H-et.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:te,rows:q,width:t}),n===Ae.REPORTS&&(0,oe.jsx)(jc.ht,{noPadding:!P||!ee,children:(0,oe.jsxs)(pe.Z,{flexDirection:"column",fullWidth:!0,children:[J&&(0,oe.jsx)(xc.Z,{stats:J,title:"Quality metrics"}),$&&(0,oe.jsx)(ge.Z,{mt:ie.cd,children:(0,oe.jsx)(xc.Z,{stats:$,title:"Statistics"})}),Y.length>0&&(0,oe.jsx)(ge.Z,{mt:ie.cd,children:(0,oe.jsx)(ic,{features:Y,statistics:M})})]})}),n===Ae.GRAPHS&&(0,oe.jsx)(jc.ht,{noPadding:!P||!ee,children:(0,oe.jsx)(Go,{afterWidth:t,features:Y,insightsOverview:K,statistics:M})}),Ae.SECRETS===n&&le,Ae.VARIABLES===n&&re,ne||P&&ee||!P&&ee&&n===Ae.DATA?null:qe.includes(n)&&(0,oe.jsx)(pe.Z,{alignItems:"center",justifyContent:"center",verticalHeight:90,verticalHeightOffset:H,width:t,children:(0,oe.jsx)(be.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:P?!ee&&"No data or insights available":"Select a block for insights"})}),Ae.CHARTS===n&&(L.length>0?(0,oe.jsx)(Gl,{autocompleteItems:i,blockRefs:r,blocks:o,chartRefs:c,deleteWidget:a,fetchFileTree:f,fetchPipeline:p,messages:j,onChangeChartBlock:k,pipeline:Z,runBlock:O,runningBlocks:C,savePipelineContent:S,selectedBlock:P,setAnyInputFocused:T,setSelectedBlock:R,setTextareaFocused:D,textareaFocused:N,updateWidget:B,widgets:L,width:t}):(0,oe.jsxs)(pe.Z,{alignItems:"center",justifyContent:"center",verticalHeight:90,verticalHeightOffset:H,width:t,children:[(0,oe.jsx)(ge.Z,{pl:1}),(0,oe.jsx)(ql,{size:358}),(0,oe.jsx)(ge.Z,{pr:1})]})),Ae.TERMINAL===n&&(0,oe.jsx)(Bn.Z,{interruptKernel:b,onFocus:function(){return R(null)},width:t})]})]})},kc=t(59e3);function Zc(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?Zc(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Zc(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Oc(e){var n,t,i,r=e.page,a=e.pipeline,u=(0,p.useRouter)(),m=(0,ko.i)().height,v=(0,d.useState)(!!(0,ke.U2)(ke.zg)),g=v[0],b=v[1],x=(0,d.useState)(null),j=x[0],y=x[1],k=(0,d.useState)(null),Z=k[0],_=k[1],O=(0,d.useState)(null),C=O[0],w=O[1],S=(0,d.useState)(null),E=S[0],P=S[1],T=(0,d.useState)([]),I=T[0],A=T[1],R=(0,d.useState)(!1),D=R[0],M=R[1],N=(0,d.useState)({}),B=N[0],L=N[1],F=(0,d.useState)(!1),H=F[0],U=F[1],z=(0,d.useState)(!1),G=z[0],W=z[1],Q=(0,d.useRef)(null),q=(0,d.useState)({}),V=q[0],Y=q[1],K=(0,d.useState)([]),X=K[0],J=K[1],$=an.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),ee=$.data,ne=$.mutate,te=null===ee||void 0===ee?void 0:ee.kernels,le=(null===te||void 0===te?void 0:te.find((function(e){return e.name===ve.a[null===Ee||void 0===Ee?void 0:Ee.type]})))||(null===te||void 0===te?void 0:te[0]),ce=a.uuid,fe=(0,tr.Z)(ce),me=an.ZP.pipelines.detail(ce,{includes_outputs:(0,gn.Qr)(V)}),be=me.data,xe=me.mutate,je=an.ZP.files.list(),Ze=je.data,_e=je.mutate,Oe=(0,d.useMemo)((function(){return(null===Ze||void 0===Ze?void 0:Ze.files)||[]}),[Ze]),Ce=(0,d.useMemo)((function(){var e;return null===Oe||void 0===Oe||null===(e=Oe[0])||void 0===e?void 0:e.name}),[Oe]),Ee=null===be||void 0===be?void 0:be.pipeline,Pe=(0,d.useMemo)((function(){return ve.q.INTEGRATION===(null===Ee||void 0===Ee?void 0:Ee.type)}),[Ee]);(0,d.useEffect)((function(){null!==be&&void 0!==be&&be.error&&_({errors:(0,Zn.QZ)(be),response:be})}),[be]);var Te=(0,d.useState)(null),Ie=Te[0],Re=Te[1],De=(0,d.useState)(!1),Me=De[0],Ne=De[1],Be=(0,kc.iV)(),Le=Be.sideview,Fe=Be.block_uuid,He=Be.file_path,Ge=(0,d.useMemo)((function(){var e=Be["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[Be]),Qe=(0,d.useCallback)((function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];(0,kc.iV)().sideview!==e&&(0,ct.u)((0,c.Z)({},We,e),{pushHistory:n})}),[]);(0,d.useEffect)((function(){Le||Qe(Ae.TREE,!1)}),[Le]);var qe=(0,d.useCallback)((function(e,n){Qe(e,n),b(!1)}),[Qe]),Ke=(0,d.useRef)(null),Xe=(0,d.useRef)({}),Je=(0,d.useRef)({}),$e=(0,d.useRef)({}),en=(0,d.useRef)({}),nn=(0,d.useCallback)((function(e){$e.current=_c(_c({},$e.current),e)}),[$e]),rn=(0,d.useCallback)((function(e,n){nn((0,c.Z)({},e,n)),Ne(!0)}),[nn,Ne]),on=(0,d.useCallback)((function(e){en.current=_c(_c({},en.current),e)}),[en]),ln=(0,d.useCallback)((function(e,n){on((0,c.Z)({},e,n)),Ne(!0)}),[on,Ne]),cn=(0,d.useState)(null),un=cn[0],sn=cn[1],dn=an.ZP.data_providers.list({},{revalidateOnFocus:!0}).data,fn=null===dn||void 0===dn?void 0:dn.data_providers,pn=an.ZP.variables.pipelines.list(ce),hn=pn.data,mn=pn.mutate,vn=null===hn||void 0===hn?void 0:hn.variables,bn=an.ZP.secrets.list(),xn=bn.data,jn=bn.mutate,yn=null===xn||void 0===xn?void 0:xn.secrets,kn=(0,d.useState)([]),On=kn[0],Cn=kn[1],wn=(0,d.useState)([]),Sn=wn[0],En=wn[1],Pn=(0,d.useRef)({}),An=(0,d.useCallback)((function(e){var n;Ne(!0);var t=Pn.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),Pn.current[e.uuid]=_c(_c(_c({},t),e),{},{configuration:_c(_c({},t.configuration),e.configuration),upstream_blocks:i})}),[Ne,Pn]),Rn=(0,d.useState)(!1),Dn=Rn[0],Mn=Rn[1],Bn=(0,d.useState)({upstreamBlocks:null}),Hn=Bn[0],Un=Bn[1],zn=(0,d.useState)([]),Gn=zn[0],Qn=zn[1],qn=(0,d.useState)(null),Vn=qn[0],Yn=qn[1],Kn=(0,d.useState)(null),Jn=Kn[0],$n=Kn[1],et=function(e,n){var t=(0,tn.HK)(n,(function(e){return e.uuid}));return e.map((function(e){return t[e]})).filter((function(e){return!!e}))}(wi(ce),On),nt=(0,d.useState)(et),tt=nt[0],it=nt[1],rt=(0,d.useState)(),ot=rt[0],lt=rt[1],at=(0,d.useState)(),ut=at[0],ft=at[1],pt=(0,d.useState)(null),ht=pt[0],mt=pt[1],vt=(0,tr.Z)(tt),gt=(0,d.useCallback)((function(){Un({upstreamBlocks:{block:null,values:[]}}),Y({}),Ne(!1),Re(null),Qn([]),Yn(null)}),[]);(0,d.useEffect)((function(){ce!==fe&&($e.current={})}),[ce,fe]);var bt=an.ZP.blocks.pipelines.outputs.detail(!g&&ce,(null===ht||void 0===ht?void 0:ht.type)!==h.tf.SCRATCHPAD&&(null===ht||void 0===ht?void 0:ht.type)!==h.tf.CHART&&(null===ht||void 0===ht?void 0:ht.uuid)&&encodeURIComponent(null===ht||void 0===ht?void 0:ht.uuid)),xt=bt.data,jt=bt.mutate,kt=(0,d.useMemo)((function(){var e,n,t;return Pe?null===(e=(0,tn.sE)(null===xt||void 0===xt?void 0:xt.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat(ut)})))||void 0===e?void 0:e.sample_data:null===xt||void 0===xt||null===(n=xt.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[xt,Pe,ut]),Zt=an.ZP.blocks.pipelines.analyses.detail(!g&&ce,(null===ht||void 0===ht?void 0:ht.type)!==h.tf.SCRATCHPAD&&(null===ht||void 0===ht?void 0:ht.type)!==h.tf.CHART&&(null===ht||void 0===ht?void 0:ht.uuid)&&encodeURIComponent(null===ht||void 0===ht?void 0:ht.uuid)),_t=Zt.data,Ot=Zt.mutate,Ct=(null===_t||void 0===_t||null===(n=_t.analyses)||void 0===n?void 0:n[0])||{},wt=Ct.insights,St=void 0===wt?{}:wt,Et=Ct.metadata,Pt=void 0===Et?{}:Et,Tt=Ct.statistics,It=void 0===Tt?{}:Tt,At=an.ZP.blocks.pipelines.analyses.detail(ce,(null===Vn||void 0===Vn?void 0:Vn.type)!==h.tf.CHART&&null!==Jn&&(null===Vn||void 0===Vn?void 0:Vn.uuid)),Rt=At.data;At.mutate,null===Rt||void 0===Rt||null===(t=Rt.analyses)||void 0===t||null===(i=t[0])||void 0===i||i.suggestions;(0,d.useEffect)((function(){0===Gn.length&&(Ot(),jt(),mn())}),[Ot,jt,mn,Gn]),(0,d.useEffect)((function(){if(0===tt.length)mt(null);else if((null===vt||void 0===vt?void 0:vt.length)!==(null===tt||void 0===tt?void 0:tt.length)&&(null===tt||void 0===tt?void 0:tt.length)<(null===vt||void 0===vt?void 0:vt.length)){var e=vt.findIndex((function(e){return e.uuid===(null===ht||void 0===ht?void 0:ht.uuid)})),n=vt.length-1===e?e-1:e+1;mt(vt[Math.max(0,n)])}}),[tt,vt,null===ht||void 0===ht?void 0:ht.uuid]),(0,d.useEffect)((function(){var e;null!==(e=Hn.upstreamBlocks)&&void 0!==e&&e.block&&(b(!1),Qe(Ae.TREE))}),[Hn.upstreamBlocks]);var Dt=an.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!0}),Mt=Dt.data,Nt=Dt.mutate,Bt=null===Mt||void 0===Mt?void 0:Mt.autocomplete_items;(0,d.useEffect)((function(){P(He)}),[He]),(0,d.useEffect)((function(){(0,tn.fS)(Ge,I)||A(Ge)}),[Ge]);var Lt=(0,f.Db)(an.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(e){var n=e.pipeline.uuid;u.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),_e()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),Ft=(0,l.Z)(Lt,1)[0],Ht=(0,f.Db)(an.ZP.pipelines.useUpdate(ce,{update_content:!0}),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){return Ne(!1)},onErrorCallback:function(e,n){return _({errors:n,response:e})}})}}),Ut=(0,l.Z)(Ht,2),zt=Ut[0],Gt=Ut[1].isLoading,Wt=(0,d.useCallback)((function(e,n){var t=e||{},i=t.block,r=t.pipeline,o=void 0===r?{}:r,c=(n||{}).contentOnly;return Re(new Date),zt({pipeline:_c(_c(_c({},Ee),o),{},{blocks:On.map((function(e){var n,t,r=$e.current[e.uuid];"undefined"===typeof r&&(r=e.content);var o=null===(n=V[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),a=null===o||void 0===o?void 0:o.find((function(e){return e.error}));if(o){var u=[];o.forEach((function(n){var t=n.data,i=n.type;(h.tf.SCRATCHPAD===e.type||a||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(ji)?e:e.concat(n)}),[])),u.push(n))})),t=u.map((function(n,t){return{text_data:JSON.stringify(n),variable_uuid:"".concat(e.uuid,"_").concat(t)}}))}var s=_c(_c({},e),{},{content:r,outputs:t});return(null===i||void 0===i?void 0:i.uuid)===e.uuid&&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];s[t]||(s[t]={}),s[t][i]=r})):s[t]=i})),c?{content:s.content,outputs:s.outputs,uuid:s.uuid}:s})),widgets:Sn.map((function(e){var n,t,i=en.current[e.uuid],r=Pn.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var o=null===(n=V[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;(h.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(ji)?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 _c(_c(_c({},e),r),{},{configuration:_c(_c({},e.configuration),r.configuration),content:i,outputs:t})}))})})}),[On,$e.current,en.current,V,Ee,Re,zt,Pn.current,Sn]),Qt=(0,d.useCallback)((function(e){Wt();var n=encodeURIComponent(e),t=(0,kc.iV)()["file_paths[]"]||[];Array.isArray(t)||(t=[t]),t.includes(n)||t.push(n),(0,ct.u)({"file_paths[]":t,file_path:n})}),[Wt]),qt=(0,d.useCallback)((function(e,n){return Wt({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;ce!==r?window.location.href="/pipelines/".concat(r,"/edit"):(_e(),n!==(null===Ee||void 0===Ee?void 0:Ee.type)&&xe(),Oi(On,ce,r))}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&_((function(e){return _c(_c({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){Qt("pipelines/".concat(ce,"/").concat(we.METADATA_YAML)),_(null)}}]})}))}))}),[On,_e,ce,Wt,Oi]),Vt=(0,f.Db)((function(e){var n=e.uuid;return an.ZP.blocks.pipelines.useDelete(ce,encodeURIComponent(n))()}),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;Cn((function(e){return(0,tn.oM)(e,e.findIndex((function(e){var n=e.uuid;return i===n})))})),xe(),Yn(null),t===h.tf.SCRATCHPAD&&_e()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Y((function(e){return _c(_c({},e),{},(0,c.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Nn.Gi.TEXT_PLAIN}}))))}))}})}}),Yt=(0,l.Z)(Vt,1)[0],Kt=(0,f.Db)((function(e){var n=e.uuid;return an.ZP.widgets.pipelines.useDelete(ce,n)()}),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(e){var n=e.widget.uuid;En((function(e){return(0,tn.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),xe(),_e()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Y((function(e){return _c(_c({},e),{},(0,c.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:Nn.Gi.TEXT_PLAIN}}))))}))}})}}),Xt=(0,l.Z)(Kt,1)[0],Jt=(0,f.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,r="".concat(t,"/").concat(i);return n&&Ue[n]&&(r="".concat(r,".").concat(Ue[n].toLowerCase())),an.ZP.blocks.useDelete(encodeURIComponent(r))()}),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){Nt(),xe(),_e()},onErrorCallback:function(e,n){return _({displayMessage:"Error deleting block file. Check that there are no downstream blocks, then try again.",errors:n,response:e})}})}}),$t=(0,l.Z)(Jt,1)[0],ei=(0,f.Db)(an.ZP.kernels.useUpdate(null===le||void 0===le?void 0:le.id),{onSuccess:function(e){return(0,Zn.wD)(e,{callback:function(){return ne()},onErrorCallback:function(e,n){return _({errors:n,response:e})}})}}),ni=(0,l.Z)(ei,1)[0],ti=(0,d.useCallback)((function(){return ni({kernel:{action_type:"restart"}})}),[ni]),ii=(0,d.useCallback)((function(){return ni({kernel:{action_type:"interrupt"}})}),[ni]),ri=((0,d.useCallback)((function(){window.confirm("Do you want to restart the kernel? All variables will be cleared.")&&ti()}),[ti]),(0,f.Db)(an.ZP.blocks.pipelines.useCreate(ce))),oi=(0,l.Z)(ri,1)[0],li=(0,d.useCallback)((function(e,n,t){var i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,re.Y6)();e.converted_from&&(i=$e.current[e.converted_from]);var o=e.language,l=e.type;if(Pe){var c=(0,tn.HK)((null===Ee||void 0===Ee?void 0:Ee.blocks)||[],(function(e){return e.type})),a=c[h.tf.DATA_EXPORTER],u=c[h.tf.DATA_LOADER],s=c[h.tf.TRANSFORMER];if(h.tf.DATA_LOADER===l){if(h.t6.YAML!==o)return void _({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(h.t6.YAML," and not ").concat(o,".")});if(u)return void _({displayMessage:"Pipeline ".concat(null===Ee||void 0===Ee?void 0:Ee.uuid," already has a source: ").concat(null===u||void 0===u?void 0:u.uuid,".")})}else if(h.tf.TRANSFORMER===l){if(s)return void _({displayMessage:"Pipeline ".concat(null===Ee||void 0===Ee?void 0:Ee.uuid," already has a transformer: ").concat(null===s||void 0===s?void 0:s.uuid,".")})}else if(h.tf.DATA_EXPORTER===l){if(h.t6.YAML!==o)return void _({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(h.t6.YAML," and not ").concat(o,".")});if(a)return void _({displayMessage:"Pipeline ".concat(null===Ee||void 0===Ee?void 0:Ee.uuid," already has a destination: ").concat(null===a||void 0===a?void 0:a.uuid,".")})}}return oi({block:_c({content:i,name:r,priority:n},e)}).then((function(e){(0,Zn.wD)(e,{callback:function(){var n=e.data.block;null===t||void 0===t||t(n),$n(null),_e(),xe().then((function(e){var n=e.pipeline.blocks;return Cn(n)}))},onErrorCallback:function(e,n){return _({errors:n,response:e})}})}))}),[$e.current,oi,Pe,Cn,_,Ee]),ci=(0,d.useState)(!1),ai=ci[0],ui=ci[1];(0,d.useEffect)((function(){ui(!!(0,ke.U2)(ye.k))}),[]);var si=(0,_n.dd)((function(e){var n=e.block,t=e.idx,i=e.name,r=void 0===i?(0,re.Y6)():i,o=e.onCreateCallback;return(0,oe.jsx)(Se,{block:n,defaultName:r,onClose:pi,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return li(n,t,o,null===e||void 0===e?void 0:e.name).then((function(){return pi()}))},pipeline:Ee})}),{},[li,Ee],{background:!0,uuid:"configure_block_name_and_create"}),di=(0,l.Z)(si,2),fi=di[0],pi=di[1],hi=an.ZP.widgets.pipelines.list(!g&&ce),mi=(hi.data,hi.mutate,(0,f.Db)(an.ZP.widgets.pipelines.useCreate(ce))),vi=(0,l.Z)(mi,1)[0],gi=(0,d.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,re.Y6)();return vi({widget:_c({name:i,priority:n,type:h.tf.CHART},e)}).then((function(e){return(0,Zn.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),_e(),xe(),Qe(Ae.CHARTS),w(n)},onErrorCallback:function(e,n){return _({errors:n,response:e})}})}))}),[Le,Je.current,vi,Qe]);(0,d.useEffect)((function(){if(C){var e,n=null===(e=Je.current[C.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),w(null))}}),[Je.current[null===C||void 0===C?void 0:C.uuid],w]),(0,d.useEffect)((function(){fe!==ce&&(Cn([]),En([]),it([]),J([]))}),[ce,fe]),(0,d.useEffect)((function(){"undefined"!==typeof(null===Ee||void 0===Ee?void 0:Ee.blocks)&&Cn(Ee.blocks)}),[null===Ee||void 0===Ee?void 0:Ee.blocks]),(0,d.useEffect)((function(){"undefined"!==typeof(null===Ee||void 0===Ee?void 0:Ee.widgets)&&En(Ee.widgets)}),[null===Ee||void 0===Ee?void 0:Ee.widgets]),(0,d.useEffect)((function(){(null===et||void 0===et?void 0:et.length)>0&&0===(null===tt||void 0===tt?void 0:tt.length)&&(it(et),mt(et[0]))}),[null===tt||void 0===tt?void 0:tt.length,null===et||void 0===et?void 0:et.length]);var bi=(0,tr.Z)(On);(0,d.useEffect)((function(){if("undefined"!==typeof(null===Ee||void 0===Ee?void 0:Ee.blocks)&&(!On.length||(null===bi||void 0===bi?void 0:bi.map((function(e){return e.uuid})).sort())!==(null===On||void 0===On?void 0:On.map((function(e){return e.uuid})).sort()))){var e=_i(Ee.blocks),n=e.content,t=e.messages;$e.current=n,Y((function(e){return _c(_c({},t),e)}))}}),[On,bi,null===Ee||void 0===Ee?void 0:Ee.blocks,Cn,Y]),(0,d.useEffect)((function(){if(!Sn.length&&"undefined"!==typeof(null===Ee||void 0===Ee?void 0:Ee.widgets)){var e=_i(Ee.widgets),n=e.content,t=e.messages;en.current=n,Y((function(e){return _c(_c({},t),e)}))}}),[null===Ee||void 0===Ee?void 0:Ee.widgets,Cn,Y,Sn]);var xi=(0,d.useCallback)((function(e,n,t){var i=On.find((function(t){var i=t.type,r=t.uuid;return i===n&&r===e}));if(i){if(Yn(i),null!==Xe&&void 0!==Xe&&Xe.current){var r,o=Xe.current["".concat(i.type,"s/").concat(i.uuid,".py")];null===o||void 0===o||null===(r=o.current)||void 0===r||r.scrollIntoView()}(0,ct.u)({file_path:null,"file_paths[]":[]})}else if(n===h.tf.CHART){var l=Sn.find((function(n){return n.uuid===e}));if(l&&(Yn(l),null!==Je&&void 0!==Je&&Je.current)){var c,a=Je.current[l.uuid];null===a||void 0===a||null===(c=a.current)||void 0===c||c.scrollIntoView()}}else t&&Qt(t)}),[On]);(0,d.useEffect)((function(){if(Fe&&!Vn){var e=On.find((function(e){var n=e.uuid;return Fe===n}));e&&xi(e.uuid,e.type,null)}else(null===bi||void 0===bi?void 0:bi.length)!==(null===On||void 0===On?void 0:On.length)&&Vn&&xi(Vn.uuid,Vn.type,null)}),[Fe,null===bi||void 0===bi?void 0:bi.length,On,xi,Vn]);var yi=new ue.Z,ki=(0,d.useMemo)((function(){return{api_key:Ln.l,token:yi.decodedToken.token}}),[Ln.l,yi]),Zi=(0,s.ZP)((0,Fn.Ib)(),{onOpen:function(){return console.log("socketUrlPublish opened")},shouldReconnect:function(e){return console.log("Attempting to reconnect..."),!0}}),Si=Zi.lastMessage,Ei=(Zi.readyState,Zi.sendMessage);(0,d.useEffect)((function(){if(Si){var e=JSON.parse(Si.data),n=e.execution_state,t=e.msg_type,i=e.uuid,r=On.find((function(e){var n=e.uuid;return i===n}));"stream_pipeline"!==t?Y((function(n){var t=n[i]||[];return _c(_c({},n),{},(0,c.Z)({},i,t.concat(e)))})):(J((function(n){return[].concat((0,o.Z)(n),[e])})),Nn.uF.IDLE===n&&(Qn([]),xe(),i||Mn(!1))),Nn.uF.BUSY===n?Qn((function(e){return e.find((function(e){var n=e.uuid;return i===n}))||!r?e:e.concat(r)})):Nn.uF.IDLE===n&&Qn((function(e){return e.filter((function(e){var n=e.uuid;return i!==n}))})),Ne(!0)}}),[Si]);var Pi=(0,d.useCallback)((function(){Wt().then((function(){Mn(!0),J([]),Ei(JSON.stringify(_c(_c({},ki),{},{execute_pipeline:!0,pipeline_uuid:ce})))}))}),[ce,ki]),Ti=(0,d.useCallback)((function(){Ei(JSON.stringify(_c(_c({},ki),{},{cancel_pipeline:!0,pipeline_uuid:ce})))}),[ce,Ei,ki]),Ii=(0,d.useCallback)((function(e){var n=e.block,t=e.code,i=e.ignoreAlreadyRunning,r=e.runDownstream,o=void 0!==r&&r,l=e.runUpstream,c=void 0!==l&&l,a=e.runTests,u=void 0!==a&&a,s=n.uuid;Gn.find((function(e){var n=e.uuid;return s===n}))&&!i||(Ei(JSON.stringify(_c(_c({},ki),{},{code:t,pipeline_uuid:null===Ee||void 0===Ee?void 0:Ee.uuid,run_downstream:o,run_tests:u,run_upstream:c,type:n.type,uuid:s}))),Y((function(e){return delete e[s],e})),U(!1),Qn((function(e){return e.find((function(e){var n=e.uuid;return s===n}))?e:e.concat(n)}))),xe()}),[xe,Ee,Gn,Ei,Y,Qn,U,ki]),Ai=(0,d.useCallback)((function(e){var n=e.block;return Wt({block:{outputs:[],uuid:n.uuid}},{contentOnly:!0}).then((function(){return Ii(e)}))}),[Ii,Wt]),Ri=(null===tt||void 0===tt?void 0:tt.length)>0?Ve:Ve.filter((function(e){return e.key!==Ae.DATA})),Di=(0,d.useMemo)((function(){return(0,oe.jsx)(yc,{activeView:Le,afterWidth:j,autocompleteItems:Bt,blockRefs:Xe,blocks:On,cancelPipeline:Ti,chartRefs:Je,deleteWidget:Xt,editingBlock:Hn,executePipeline:Pi,fetchFileTree:_e,fetchPipeline:xe,fetchSecrets:jn,fetchVariables:mn,globalVariables:vn,insights:St,interruptKernel:ii,isPipelineExecuting:Dn,messages:V,metadata:Pt,onChangeChartBlock:ln,pipeline:Ee,pipelineMessages:X,runBlock:Ai,runningBlocks:Gn,sampleData:kt,savePipelineContent:Wt,secrets:yn,selectedBlock:Vn,setAnyInputFocused:W,setEditingBlock:Un,setErrors:_,setSelectedBlock:Yn,setTextareaFocused:U,statistics:It,textareaFocused:H,updateWidget:An,widgets:Sn})}),[Le,j,Bt,Xe,On,Xt,Hn,_e,xe,jn,mn,vn,St,ii,V,Pt,ln,Ee,X,Ai,Gn,kt,Wt,yn,Vn,Ei,W,Un,_,J,U,It,H,An,Sn]),Mi=(0,d.useMemo)((function(){return(0,oe.jsx)(go,{addNewBlockAtIndex:ai?li:function(e,n,t,i){return new Promise((function(r,o){h.tf.DBT===(null===e||void 0===e?void 0:e.type)&&h.t6.SQL===(null===e||void 0===e?void 0:e.language)?li(e,n,t,i):fi({block:e,idx:n,name:i,onCreateCallback:t})}))},addWidget:function(e,n){var t=n.onCreateCallback;return gi(e,Sn.length,t)},anyInputFocused:G,autocompleteItems:Bt,blockRefs:Xe,blocks:On,dataProviders:fn,deleteBlock:Yt,fetchFileTree:_e,fetchPipeline:xe,fetchSampleData:jt,files:Oe,globalVariables:vn,interruptKernel:ii,isPipelineUpdating:Gt,kernel:le,mainContainerRef:Q,mainContainerWidth:un,messages:V,onChangeCodeBlock:rn,openSidekickView:qe,pipeline:Ee,pipelineContentTouched:Me,pipelineLastSaved:Ie,restartKernel:ti,runBlock:Ai,runningBlocks:Gn,savePipelineContent:Wt,selectedBlock:Vn,setAnyInputFocused:W,setEditingBlock:Un,setErrors:_,setIntegrationStreams:lt,setMessages:Y,setOutputBlocks:it,setPipelineContentTouched:Ne,setRecsWindowOpenBlockIdx:$n,setRunningBlocks:Qn,setSelectedBlock:Yn,setSelectedOutputBlock:mt,setSelectedStream:ft,setTextareaFocused:U,textareaFocused:H,widgets:Sn})}),[li,gi,ai,G,Bt,Xe,On,fn,Yt,_e,xe,Oe,vn,ii,Gt,le,Q,un,V,rn,Ee,Me,Ie,ti,Ai,Gn,Wt,Vn,W,Un,_,Y,Ne,Qn,Yn,U,fi,H,Sn]),Ni=(0,d.useMemo)((function(){if(r===yo.b)return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(yt,{filePaths:I,filesTouched:B,isBusy:Gn.length>=1,isPipelineUpdating:Gt,kernel:le,pipeline:Ee,pipelineContentTouched:Me,pipelineLastSaved:Ie,restartKernel:ti,savePipelineContent:Wt,selectedFilePath:E,setErrors:_,updatePipelineMetadata:qt}),(null===I||void 0===I?void 0:I.length)>0&&(0,oe.jsx)(st,{filePaths:I,filesTouched:B,savePipelineContent:Wt,selectedFilePath:E})]})}),[B,Gt,le,r,Ee,Me,Ie,ti,Gn,Wt,E,I,_,qt]),Bi=(0,d.useMemo)((function(){var e=null===On||void 0===On?void 0:On.filter((function(e){var n=e.type;return h.tf.SCRATCHPAD!==n}));return(0,oe.jsxs)(pe.Z,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,oe.jsx)(In.Z,{children:Ri.map((function(e){var n=e.key,t=e.label,i=n===Le,r=Ye[n];return(0,oe.jsx)(ge.Z,{pl:1,children:(0,oe.jsx)(he.ZP,{beforeElement:r&&(0,oe.jsx)(r,{}),blackBorder:!0,compact:!0,onClick:function(){return Qe(n)},selected:i,uuid:n,children:t})},n)}))}),(0,oe.jsxs)(ge.Z,{px:1,ref:Ke,style:{position:"relative"},children:[(0,oe.jsx)(he.ZP,{beforeElement:(0,oe.jsx)(ze.mm,{}),blackBorder:!0,compact:!0,disabled:0===(null===e||void 0===e?void 0:e.length),onClick:function(){return M(!0)},primaryGradient:!0,uuid:"Pipeline/afterHeader/add_chart",children:"Add chart"}),(0,oe.jsx)(de.Z,{disableEscape:!0,onClickOutside:function(){return M(!1)},open:D,children:(0,oe.jsx)(ae,{addWidget:function(e,n){var t=n.onCreateCallback;return gi(e,Sn.length,t)},block:e[e.length-1],onClickCallback:function(){return M(!1)},open:D,parentRef:Ke,rightOffset:2*ie.iI,runBlock:Ai})})]})]})}),[gi,On,Ri,Ke,Ai,M,D,Sn]),Li=(0,d.useMemo)((function(){var e;return null===ot||void 0===ot||null===(e=ot.filter((function(e){return(0,tn.sE)(null===xt||void 0===xt?void 0:xt.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat(e)}))})))||void 0===e?void 0:e.map((function(e){return(0,oe.jsx)(ge.Z,{pl:1,children:(0,oe.jsx)(he.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return ft(e)},selected:ut===e,uuid:e,children:e})},e)}))}),[xt,ot,ut]),Fi=(0,d.useRef)(null),Hi=(0,d.useMemo)((function(){return(0,oe.jsx)(Tn,{addNewBlock:function(e,n){li(e,On.length,n,e.name),(null===Ge||void 0===Ge?void 0:Ge.length)>=1&&u.push("/pipelines/".concat(ce,"/edit"))},blocks:On,deleteBlockFile:$t,deleteWidget:Xt,fetchFileTree:_e,fetchPipeline:xe,files:Oe,onSelectBlockFile:xi,openFile:Qt,openPipeline:function(e){gt(),u.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))},openSidekickView:qe,pipeline:Ee,ref:Fi,setErrors:_,setSelectedBlock:Yn,widgets:Sn})}),[li,On,$t,Xt,_e,xe,null===Ge||void 0===Ge?void 0:Ge.length,Oe,xi,Qt,qe,Ee,ce,gt,u,_,Yn,Sn]),Ui=(0,d.useMemo)((function(){if(r===yo.b)return(0,oe.jsx)(Xn,{cancelPipeline:Ti,createPipeline:Ft,executePipeline:Pi,interruptKernel:ii,isPipelineExecuting:Dn,restartKernel:ti,savePipelineContent:Wt,setMessages:Y})}),[Ti,Ft,Pi,ii,Dn,r,ti,Wt,Y]);return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(dt.Z,{title:null===Ee||void 0===Ee?void 0:Ee.name}),(0,oe.jsxs)(Oo,{after:Di,afterHeader:Bi,afterHidden:g,afterSubheader:(null===tt||void 0===tt?void 0:tt.length)>0&&Le===Ae.DATA&&(0,oe.jsxs)(pe.Z,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!Pe&&tt.map((function(e){var n=e.uuid,t=(null===ht||void 0===ht?void 0:ht.uuid)===n;return(0,oe.jsx)(ge.Z,{pl:1,children:(0,oe.jsx)(he.ZP,{afterElement:t?(0,oe.jsx)(se.Z,{basic:!0,highlightOnHover:!0,onClick:function(){!function(e,n){var t=wi(e).filter((function(e){return e!==n}));(0,ke.t8)(Ci(e),t)}(ce,e.uuid),it((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,oe.jsx)(ze.x8,{muted:!0,size:1.25*ie.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return mt(e)},selected:t,uuid:n,children:n})},n)})),Pe&&Li]}),before:Hi,beforeHeader:Ui,errors:Z,headerOffset:(null===I||void 0===I?void 0:I.length)>0?36:0,mainContainerHeader:Ni,mainContainerRef:Q,page:r,pipeline:Ee,projectName:Ce,setAfterHidden:b,setAfterWidthForChildren:y,setErrors:_,setMainContainerWidth:sn,children:[(0,oe.jsx)("div",{style:{height:E?0:null,visibility:E?"hidden":null,opacity:E?0:null},children:Mi}),null===Ge||void 0===Ge?void 0:Ge.map((function(e){return(0,oe.jsx)("div",{style:{display:E===e?null:"none"},children:(0,oe.jsx)(Wn,{active:E===e,addNewBlock:function(e,n){li(e,On.length,n,e.name),u.push("/pipelines/".concat(ce,"/edit"))},fetchPipeline:xe,fetchVariables:mn,filePath:e,openSidekickView:qe,pipeline:Ee,projectName:Ce,selectedFilePath:E,setFilesTouched:L,setSelectedBlock:Yn})},e)})),(0,oe.jsx)(ge.Z,{pb:He?0:Math.max(Math.floor(m*(2/3)/ie.iI),0)})]})]})}Oc.getInitialProps=function(){var e=(0,r.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=yo.b,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 Cc=(0,Co.Z)(Oc)},11366:function(e,n,t){"use strict";t.d(n,{k:function(){return i}});var i="automatically_name_blocks"},42305:function(e,n,t){"use strict";t.d(n,{A5:function(){return d},AY:function(){return f},BP:function(){return s},JX:function(){return u},OC:function(){return o},Pc:function(){return p},d$:function(){return a},lJ:function(){return h},n1:function(){return c}});var i=t(92083),r=t.n(i),o="YYYY-MM-DD HH:mm:SS",l="YYYY-MM-DD HH:mm",c="YYYY-MM-DD";function a(e,n){var t=n.utcFormat,i=n.dayAgo,o=r()(e);return t&&(o=o.utc()),i&&(o=o.subtract(1,"days")),o.format(l)}function u(e){return r().unix(e).format(l)}function s(e,n,t){return r()(e).utc().hours(+n).minutes(+t).format()}function d(e){return r()(e).unix()}function f(e,n,t){return"".concat(e.toISOString().split("T")[0]," ").concat(n,":").concat(t)}function p(e){var n=r().unix(+e).utc();return{date:n.toDate(),hour:String(n.hour()),minute:String(n.minute())}}function h(e){return e.padStart(2,"0")}},51504:function(e,n,t){"use strict";t.d(n,{y:function(){return o}});var i=t(75582),r=t(16115);function o(e,n){var t=e.map((function(e){return String(e)})),o=e.includes(r.PQ),l=e.includes(r.zX),c=e.includes(r.XR),a=r.xU.map((function(e){return String(e)})),u=r.vk.map((function(e){return String(e)})),s=r.Tr.map((function(e){return String(e)})),d=Object.entries(n).find((function(e){var n=(0,i.Z)(e,2),r=n[0];return n[1]&&!t.includes(String(r))&&(!l||!u.includes(String(r)))&&(!o||!a.includes(String(r)))&&(!c||!s.includes(String(r)))}));return e.every((function(e){return n[e]}))&&!d}},33766:function(e,n,t){"use strict";t.d(n,{u:function(){return s}});var i=t(75582),r=t(82394),o=t(34376),l=t.n(o),c=t(59e3);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 u(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,r.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}function s(e){var n,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.replaceParams,o=t.pushHistory,a=r?{}:(0,c.iV)();n=window.location.pathname;var s=o?l().push:l().replace,d=u(u({},a),e);Object.entries(e).forEach((function(e){var n=(0,i.Z)(e,2),t=n[0],r=n[1];"undefined"!==typeof r&&null!==r||delete d[t]}));var f=(0,c.uM)(d);f.length>=1&&(f="?".concat(f));var p="".concat(n.split("?")[0]).concat(f);return s(l().router.pathname,p,{shallow:!0})}},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(46714)}])}},function(e){e.O(0,[3662,3850,2083,5896,4804,1774,5872,2524,9565,2714,2125,7011,6085,8789,704,9767,6579,9898,1830,4463,6532,1286,2426,6641,9774,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);