PageSourceSearch

https://app.magicbean.ai/_next/static/chunks/pages/homepage/sandbox/dashboard/[uuid]-adaeadfd4d7a4d48.js

js magicbean.ai collected 2026-10-05 12:16:50 UTC 31,922 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5361],{81596:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r=n(2784),a=n(25743),i=n.n(a),s=n(35298),o=n(98536),l=n(23773),c=n(53013),u=n(23707);let d=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:a,textPaddingInline:i,orientationMargin:s,verticalMarginInline:c}=e;return{[t]:Object.assign(Object.assign({},(0,l.Wf)(e)),{borderBlockStart:`${(0,o.bf)(a)} solid ${r}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:c,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${(0,o.bf)(a)} solid ${r}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${(0,o.bf)(e.dividerHorizontalGutterMargin)} 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${(0,o.bf)(e.dividerHorizontalWithTextGutterMargin)} 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${r}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${(0,o.bf)(a)} solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-left`]:{"&::before":{width:`calc(${s} * 100%)`},"&::after":{width:`calc(100% - ${s} * 100%)`}},[`&-horizontal${t}-with-text-right`]:{"&::before":{width:`calc(100% - ${s} * 100%)`},"&::after":{width:`calc(${s} * 100%)`}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:i},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:`${(0,o.bf)(a)} 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:a,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-left${t}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-right${t}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}};var p=(0,c.I$)("Divider",e=>{let t=(0,u.TS)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0});return[d(t)]},e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}}),h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>t.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n},f=e=>{let{getPrefixCls:t,direction:n,divider:a}=r.useContext(s.E_),{prefixCls:o,type:l="horizontal",orientation:c="center",orientationMargin:u,className:d,rootClassName:f,children:m,dashed:x,plain:v,style:b}=e,g=h(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),y=t("divider",o),[j,w,S]=p(y),P=c.length>0?`-${c}`:c,k=!!m,D="left"===c&&null!=u,N="right"===c&&null!=u,Z=i()(y,null==a?void 0:a.className,w,S,`${y}-${l}`,{[`${y}-with-text`]:k,[`${y}-with-text${P}`]:k,[`${y}-dashed`]:!!x,[`${y}-plain`]:!!v,[`${y}-rtl`]:"rtl"===n,[`${y}-no-default-orientation-margin-left`]:D,[`${y}-no-default-orientation-margin-right`]:N},d,f),C=r.useMemo(()=>"number"==typeof u?u:/^\d+$/.test(u)?Number(u):u,[u]),I=Object.assign(Object.assign({},D&&{marginLeft:C}),N&&{marginRight:C});return j(r.createElement("div",Object.assign({className:Z,style:Object.assign(Object.assign({},null==a?void 0:a.style),b)},g,{role:"separator"}),m&&"vertical"!==l&&r.createElement("span",{className:`${y}-inner-text`,style:I},m)))}},13e3:function(e,t,n){"use strict";n.d(t,{z:function(){return o}});var r=n(2784),a=n(41327),i=n.n(a),s=n(52322),o=function(e){var t=e.children,n=e.onClick,a=e.className,o=(0,r.useRef)({drag:!1,draggStart:{},draggEnd:{},down:!1});return(0,s.jsx)(i(),{onStart:function(e,t){o.current.draggStart=t},onStop:function(e,t){o.current.draggEnd=t},children:(0,s.jsx)("div",{className:"fixed ".concat(a),children:(0,s.jsx)("div",{onMouseDown:function(){o.current.drag=!1,o.current.down=!0},onMouseMove:function(){o.current.down&&(o.current.drag=!0)},onMouseUp:function(){var e=o.current,t=e.drag,r=e.draggStart,a=e.draggEnd;t&&(r.x!==a.x||r.y!==a.y)||n(),o.current.down=!1},children:t})})})}},14476:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return ec}});var r=n(95235),a=n(20406),i=n(52746),s=n(8529),o=n(28526),l=n.n(o),c=n(70129),u=n(5632),d=n(2784),p=n(25237),h=n.n(p),f=n(85874),m=n(71098),x=n(53901),v=n(70713),b=n(96191),g=n(82186),y=n(90964),j=n(70020),w=n(33395),S=n(26785),P=n(17627),k=n(69649),D=n(9564),N=n(57647),Z=n(46563),C=n(327),I=n(76635),O=n(81452),T=n(49857),$=n(86719),E=n(82908),_=n(99461),R=n(39097),z=n.n(R),F=n(72242),L=n(15518);n(72779);var M=n(68448),H=n(10300),A=n(75773),Y=n(95177),V=n(72146),G=n(47521),U=n(77222),B=n(13e3),W=n(97381),q=n(61804),K=n(50810),X=n(57038),J=n(42630),Q=n(63594),ee=n(28879),et=n.n(ee),en=n(63094),er=n(52322);function ea(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ei(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?ea(Object(n),!0).forEach(function(t){(0,r.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ea(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var es=f.Z.useForm,eo=h()(function(){return Promise.all([n.e(8115),n.e(9804),n.e(6026),n.e(8267),n.e(317),n.e(4447),n.e(9653),n.e(3521),n.e(9535),n.e(5024),n.e(8288),n.e(8230),n.e(9943)]).then(n.bind(n,14019)).then(function(e){return e.DashboardCanvas})},{loading:function(){return(0,er.jsx)("div",{className:"p-4",children:(0,er.jsx)(m.Z,{loading:!0})})},ssr:!1,loadableGenerated:{webpack:function(){return[14019]}}}),el=[{name:"home",path:en.c7.MagicGPTSandbox,icon:"iconHome",exact:!0},{name:"magicGPT",path:en.c7.DashboardSandbox,icon:"iconDashboard",isParent:!0,action:"addNewSandboxSession"}],ec=!0;t.default=(0,c.f3)("magicChatStore")((0,c.Pi)(function(e){var t,n,r,o,c,p,h,m,R,ee,en,ea,ec,eh,ef,em,ex,ev,eb,eg,ey,ej,ew,eS,eP,ek,eD,eN,eZ,eC=e.magicChatStore,eI=x.ZP.useMessage(),eO=(0,s.Z)(eI,2),eT=eO[0],e$=eO[1],eE=(0,d.useState)(!1),e_=eE[0],eR=eE[1],ez=(0,d.useState)(null),eF=ez[0],eL=ez[1],eM=(0,d.useState)(null),eH=eM[0],eA=eM[1],eY=(0,d.useState)(""),eV=eY[0],eG=eY[1],eU=(0,d.useRef)(null),eB=(0,d.useState)(null),eW=eB[0],eq=eB[1],eK=(0,d.useState)(""),eX=eK[0],eJ=eK[1],eQ=(0,d.useState)(ed.CHATS),e0=eQ[0],e1=eQ[1],e4=(0,d.useState)(!1),e2=e4[0],e5=e4[1],e7=(0,d.useState)(null),e3=e7[0],e6=e7[1],e8=(0,d.useState)(!1),e9=e8[0],te=e8[1],tt=(0,d.useState)(!1),tn=tt[0],tr=tt[1],ta=f.Z.useForm(),ti=(0,s.Z)(ta,1)[0],ts=es(),to=(0,s.Z)(ts,1)[0],tl=(0,d.useState)(null),tc=tl[0],tu=tl[1],td=(0,u.useRouter)(),tp=td.query.uuid,th=f.Z.useForm(),tf=(0,s.Z)(th,1)[0],tm=(0,d.useRef)({}),tx=(0,T.ZP)(null!=eC&&eC.session?"fetchPromptVariables":null,eC.fetchPromptVariables,{revalidateOnFocus:!1}),tv=(0,T.ZP)(null!=eC&&eC.session?"/api/dashboardScheduler/list/".concat(tp):null,$._i,{dedupingInterval:6e4,onSuccess:function(e){tm.current=(null==e?void 0:e.data[0])||{}}}),tb=(0,T.ZP)("/api/org/mine",$.HG),tg=tb.data?[tb.data.data[0].owner].concat((0,i.Z)(tb.data.data[0].users)):[];tg=Array.from(new Set(tg.map(JSON.stringify))).map(JSON.parse);var ty=(0,I.debounce)(function(e){(0,D.xI)(e).then(function(e){var t=e.data.data;t&&eC.updateDashboardName({uuid:tp,title:t}).then(function(e){tD.mutate(),tN.mutate()})})},1e3),tj=(0,H.k)(),tw=(0,F.$G)(["main"]),tS=tw.t;tw.i18n;var tP=null==tj?void 0:tj.list,tk=null==tj?void 0:tj.loading;(0,T.ZP)("fetchPromptVariables",eC.fetchPromptVariables,{dedupingInterval:6e4});var tD=(0,T.ZP)(tp?"/api/dashboard/".concat(tp):null,$.zy,{dedupingInterval:6e4,onSuccess:function(e){eC.setChartListForDashboard(e.data.charts||[]),eC.setLayouts(e.data.layouts||[])}}),tN=(0,T.ZP)("/api/getMineDashboards",$._i,{onSuccess:function(e){eC.setDashboards(e.data)}}),tZ=(0,T.ZP)("/api/magicGPT/klaviyoList",$.zy,{revalidateOnMount:!1,revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}),tC=(null==tZ?void 0:null===(ev=tZ.data)||void 0===ev?void 0:null===(eb=ev.data)||void 0===eb?void 0:eb.map(function(e){return{label:e.attributes.name,value:e.id}}))||[],tI=(0,I.get)(eC,"session.activeSubscriptions[0].name"),tO=(0,V.t)({currentPlanName:tI}).find(function(e){return e.type===A.P.klaviyo});(0,d.useEffect)(function(){eC.fetchRecipes(),tx.mutate()},[]),(0,d.useEffect)(function(){var e=function(e){var t=/Mac|iPod|iPhone|iPad/.test(navigator.platform),n=(t?e.metaKey:e.ctrlKey)&&"z"===e.key,r=(t?e.metaKey:e.ctrlKey)&&"y"===e.key;n?eC.undoDashboard():r&&eC.redoDashboard()};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[]),(0,d.useEffect)(function(){return eC.setEditingRecipe(null),function(){eC.setEditingRecipe(null),eC.setChartListForDashboard([]),eC.setLayouts([])}},[]);var tT=null===(eg=tD.data)||void 0===eg?void 0:null===(ey=eg.data)||void 0===ey?void 0:ey.title;(0,d.useEffect)(function(){tm.current={},tf.resetFields(),tD.mutate(),tv.mutate(),eC.setCurrentDashboardId(tp),eC.initHistoryDashboard(),eC.initDashboard()},[tp]);var t$=function(e){e0===e.type?e1(null):e1(e.type),eC.relayoutDashboardChart()},tE=(0,L.x)((null===(ej=tN.data)||void 0===ej?void 0:ej.data)||[]),t_=tE["Previous 7 Days"],tR=tE.Yesterday,tz=tE.Today,tF=tE.Others,tL=(null===(ew=tN.data)||void 0===ew?void 0:e
1w.data.filter(function(e){return!!(null!=e&&e.pinState)}))||[];function tM(e){eL(e.uuid),eG(e.title)}tL.sort(function(e,t){return new Date(t.updatedAt)-new Date(e.updatedAt)});var tH=function(e){var t;v.Z.confirm({title:"Delete dashboard",content:"Are you sure you want to delete this dashboard?",onOk:(t=(0,a.Z)(l().mark(function t(){return l().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,eC.deleteDashboard(e.uuid);case 2:tN.mutate().then(function(t){if(!tN.data.data.length){eC.createDashboard().then(function(e){td.push("/homepage/sandbox/dashboard/".concat(e.uuid))});return}tp===e.uuid&&td.push("/homepage/sandbox/dashboard/".concat(t.data[0].uuid))});case 3:case"end":return t.stop()}},t)})),function(){return t.apply(this,arguments)})})},tA=(t=(0,a.Z)(l().mark(function e(t){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,eC.updateDashboardPinState({uuid:t.uuid,pinState:!(null!=t&&t.pinState)});case 2:tN.mutate().then(function(){eT.open({type:"success",content:null!=t&&t.pinState?"Unpinned successfully":"Pinned successfully"})});case 3:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)}),tY=(n=(0,a.Z)(l().mark(function e(){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e5(!0),e.prev=1,e.next=4,eC.updateDashboardName({uuid:eF,title:eV});case 4:tD.mutate(),tN.mutate(),eL(null),e5(!1),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(1),e5(!1);case 13:case"end":return e.stop()}},e,null,[[1,10]])})),function(){return n.apply(this,arguments)}),tV=(r=(0,a.Z)(l().mark(function e(){var t,n;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return(t=ei({uuid:tp,hasEndDate:!1},tf.getFieldsValue())).endDate=(null==t?void 0:t.option)==="Once"?et()(new Date(new Date().getTime()+24e5)).format("YYYY-MM-DD HH:mm:ss"):t.hasEndDate?et()(t.endDate).format("YYYY-MM-DD HH:mm:ss"):null,n=Intl.DateTimeFormat().resolvedOptions().timeZone,e.next=5,(0,D.Ds)({dashboardId:t.uuid,cron:t.cron,recipients:t.recipients,endDate:t.endD
1ate,timeZone:n});case 5:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)}),tG=(o=(0,a.Z)(l().mark(function e(){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e5(!0),e.prev=1,e.next=4,tV();case 4:return b.ZP.success({message:"Set schedule successfully"}),eA(null),tf.resetFields(),e.next=9,tv.mutate();case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),b.ZP.error({message:"Set schedule failed"});case 14:return e.prev=14,e5(!1),e.finish(14);case 17:case"end":return e.stop()}},e,null,[[1,11,14,17]])})),function(){return o.apply(this,arguments)}),tU=(c=(0,a.Z)(l().mark(function e(){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e5(!0),e.prev=1,e.next=4,(0,D.tt)(tp);case 4:return e.next=6,tV();case 6:return b.ZP.success({message:"Schedule Updated successfully"}),eA(null),tf.resetFields(),tm.current={},e.next=12,tv.mutate();case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),b.ZP.error({message:"Schedule Updated failed"});case 17:return e.prev=17,e5(!1),e.finish(17);case 20:case"end":return e.stop()}},e,null,[[1,14,17,20]])})),function(){return c.apply(this,arguments)}),tB=(p=(0,a.Z)(l().mark(function e(){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,D.tt)(tp);case 3:return b.ZP.success({message:"Schedule Deleted successfully"}),eA(null),tf.resetFields(),tm.current={},e.next=9,tv.mutate();case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),b.ZP.error({message:"Schedule Deleted failed"});case 14:case"end":return e.stop()}},e,null,[[0,11]])})),function(){return p.apply(this,arguments)}),tW=(h=(0,a.Z)(l().mark(function e(){var t;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return G.j(U.Y.NewDashboardClicked),e.next=3,eC.createDashboard({charts:[],layouts:[]});case 3:t=e.sent,tN.mutate(),td.push("/homepage/sandbox/dashboard/".concat(t.uuid));case 6:case"end":return e.stop()}},e)})),function(){return h.apply(this,arguments)}),tq=(m=(0,a.Z)(l().mark(function e(t,n){var r,a,i;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.value,a=t.promptId,i=r.filter(function(e){return e.isVariable}).map(function(e){return ei(ei({},e.variable),{},{type:e.type,value:e.value})}),e.next=4,eC.updateDashboardTemplate(a,{variables:i,callUpdateAPI:!0});case 4:n&&n();case 5:case"end":return e.stop()}},e)})),function(e,t){return m.apply(this,arguments)}),tK=function(e,t){tu({template:e,promptId:t})},tX=function(){eq({})},tJ=(R=(0,a.Z)(l().mark(function e(t,n){var r,a,i,s;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=(r=eC.chartListForDashboard.find(function(e){return e.id===t})).prompt,e.next=4,(0,D.Bc)({userPrompt:a,dashboardId:tp});case 4:return i=e.sent,s=(0,I.get)(i,"data.content.query"),e.next=8,eC.updateDashboardChartItem(t,ei(ei({},r),{},{query:s}));case 8:n&&n();case 9:case"end":return e.stop()}},e)})),function(e,t){return R.apply(this,arguments)}),tQ=(ee=(0,a.Z)(l().mark(function e(t,n){var r;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return G.j(U.Y.PromptSubmitted,{content:t,dashboardId:tp}),e5(!0),e.prev=2,e.next=5,(0,D.Bc)({userPrompt:t,dashboardId:tp});case 5:return r=e.sent,e.next=8,(0,K.P)({uuid:tp,insertChartObj:eW,setInsertChartObj:eq,promptFromGPT:ei({},r),store:eC,updateDashboard:eC.updateDashboard});case 8:if(tT){e.next=11;break}return e.next=11,ty(t);case 11:e5(!1),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),e5(!1);case 17:n&&n();case 18:case"end":return e.stop()}},e,null,[[2,14]])})),function(e,t){return ee.apply(this,arguments)}),t0=(0,er.jsx)(y.Z,{overlay:(0,er.jsxs)(g.Z,{onClick:function(e){var t,n,r=e.key;"edit"===r&&(eL(tp),eG((null===(t=tD.data)||void 0===t?void 0:null===(n=t.data)||void 0===n?void 0:n.title)||"")),"delete"===r&&tH({uuid:tp})},children:[(0,er.jsx)(g.Z.Item,{icon:(0,er.jsx)("i",{className:"iconfont iconpencil"}),children:tS("Rename")},"edit"),(0,er.jsx)(g.Z.Item,{icon:(0,er.jsx)("i",{className:"iconfont icondelete"}),children:tS("Delete")},"delete")]}),children:(0,er.jsx)("i",{className:"iconfont iconmore cursor-pointer"})});j.Z;var t1=(en=(0,a.Z)(l().mark(function e(t){var n;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e6(ei(ei({},n=eC.chartListForDashboard.find(function(e){return e.id===t})),{},{name:null==n?void 0:n.prompt})),tj.sourceMutate();case 3:case"end":return e.stop()}},e)})),function(e){return en.apply(this,arguments)}),t4=(ea=(0,a.Z)(l().mark(function e(t){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.P4)(t);case 2:return b.ZP.success({message:"Destination deleted successfully"}),e.next=5,tj.mutate();case 5:case"end":return e.stop()}},e)})),function(e){return ea.apply(this,arguments)}
1),t2=(ec=(0,a.Z)(l().mark(function e(t){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.Xy)({destinationId:t,isExist:!0});case 2:return b.ZP.success({message:"Sync successfully"}),e.next=5,tj.mutate();case 5:case"end":return e.stop()}},e)})),function(e){return ec.apply(this,arguments)}),t5=(eh=(0,a.Z)(l().mark(function e(){var t,n,r,a,i;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=to.getFieldsValue(),n=e3,r=eC.chartListForDashboard.findIndex(function(e){return e.id===n.id}),a=eC.chartListForDashboard[r],te(!0),!tP.find(function(e){return e.promptId===n.uuid&&e.type===A.P.klaviyo&&e.listId===t.listId})){e.next=10;break}return b.ZP.error({message:"This destination is already synced"}),te(!1),e.abrupt("return",Promise.resolve());case 10:return e.prev=10,i={type:A.P.klaviyo,sessionId:tp,promptId:n.id,listId:t.listId,name:a.prompt},e.next=14,(0,D.Xy)(i);case 14:return b.ZP.success({message:"Sync successfully"}),e.next=17,tj.mutate();case 17:te(!1),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(10),te(!1),b.ZP.error({message:"Sync failed"});case 24:e6(null);case 25:case"end":return e.stop()}},e,null,[[10,20]])})),function(){return eh.apply(this,arguments)}),t7=(ef=(0,a.Z)(l().mark(function e(){var t;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.Jw)({name:eV});case 2:t=e.sent,tZ.mutate().then(function(e){to.setFieldsValue({listId:t.id})}),b.ZP.success({message:"List created successfully"}),eR(!1);case 6:case"end":return e.stop()}},e)})),function(){return ef.apply(this,arguments)}),t3=(em=(0,a.Z)(l().mark(function e(t){return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:(0,D.v4)({promptId:t}).catch(function(e){b.ZP.error({message:"Download failed"})});case 1:case"end":return e.stop()}},e)})),function(e){return em.apply(this,arguments)}),t6=(ex=(0,a.Z)(l().mark(function e(t,n){var r,a;return l().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return G.j("submitTemplate",{template:null===(r=eC.editingRecipe)||void 0===r?void 0:r.attributes}),a=eC.editingRecipe.attributes.prompt,e.next=4,(0,K.P)({uuid:tp,promptValue:t,insertChartObj:eW,setInsertChartObj:eq,store:eC,updateDashboard:eC.updateDashboard},n);case 4:if(e.prev=4,tT){e.next=8;break}return e.next=8,ty((0,N.bU)(a,t));case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),console.log("debug e",e.t0);case 13:eC.setEditingRecipe(null);case 14:case"end":return e.stop()}},e,null,[[4,10]])})),function(e,t){return ex.apply(this,arguments)}),t8=(0,J.v)(tS);return(0,er.jsxs)(k.Z,{navs:el,backNavigator:(0,er.jsx)(er.Fragment,{children:(0,er.jsxs)("div",{className:"w-full relative",children:[(0,er.jsxs)("div",{className:"flex justify-center items-center bg-sky-50 h-12",children:[(0,er.jsx)("div",{className:"text-sky-500",children:"Sandbox mode"}),(0,er.jsx)("div",{className:"absolute right-12",children:(0,er.jsx)(O.$,{type:"primary",onClick:function(){td.push("/homepage/magicGPT"),tN.mutate()},children:tS("Exit")})})]}),(0,er.jsxs)("div",{className:"flex justify-between items-center bg-white",children:[(0,er.jsx)("div",{className:"px-6 py-3 font-bold text-xl border-b border-modou-purple-100",children:tS("Dashboards")}),(0,er.jsx)("div",{children:(0,er.jsxs)(O.$,{type:"ghost",color:"modou-green",onClick:function(){tr(!0)},children:["+ ",tS("New dashboard")]})})]})]})}),children:[e$,(0,er.jsx)("div",{className:"flex flex-col w-full flex-1",children:(0,er.jsxs)("div",{className:"flex flex-1",children:[(0,er.jsxs)("div",{className:"flex flex-col flex-1 h-100%",children:[(0,er.jsxs)("div",{className:"flex justify-between px-6 py-4 w-full border-b border-modou-purple-100",children:[(0,er.jsx)("div",{className:"font-bold cursor-text",onDoubleClick:function(){var e,t;eL(tp),eG((null===(e=tD.data)||void 0===e?void 0:null===(t=e.data)||void 0===t?void 0:t.title)||"")},children:(null===(eS=tD.data)||void 0===eS?void 0:null===(eP=eS.data)||void 0===eP?void 0:eP.title)||"Unnamed dashboard"}),(0,er.jsx)("div",{children:t0})]}),(0,er.jsx)("div",{className:"flex flex-col flex-1 w-full p-4",children:(0,er.jsx)(eo,{onDownload:t3,onEditPrompt:function(e){return tK(e.template,e.promptId)},onEditTitle:function(e){e.template;var t=e.promptId,n=e.customTitle;ti.setFieldsValue({customTitle:n,isCustomTitle:!!n}),v.Z.confirm({icon:null,width:"60%",title:"Custom title",closable:!0,onOk:function(){var e=ti.getFieldsValue().customTitle;eC.updateDashboardCustomTitle(t,{customTitle:e,callUpdateAPI:!0})},content:(0,er.jsx)("div",{children:(0,er.jsx)(f.Z,{form:ti,layout:"vertical",children:(0,er.jsx)(f.Z.Item,{name:"customTitle",children:(0,er.jsx)(_.L,{})})})})})},onRemoveCustomTitle:function(e){var t=e.promptId;eC.updateDashboardCustomTitle(t,{customTitle:null,callUpdateAPI:!0})},isEnableSync:!!tO,isEditing:!0,onMounted:function(){},chartList:eC.chartListForDashboard,onInsertChart:function(e){eq(e)},onLayoutsChange:function(e){eC.setLayouts(e),eC.relayoutDashboardChart(),eC.updateDashboard({layouts:e})},layouts:eC.layouts,visualizationVariables:[],variableDefinitions:[],onSyncToIntegration:t1,titleRender:function(e){var t=e.template,n=e.id,r=e.prompt,a=e.customTitle;return(0,er.jsx)(q.U,{customTitle:a,prompt:r,template:t,id:n,onClickVariables:tK,rangeTime:t8})},onResubmit:tJ,emptyInfoRender:function(){return(0,er.jsx)(W.z,{mode:"dashboard",title:tS("discover-Reports-for-Your-Business"),onTryMore:tX,onSubmit:tQ,onRecipeSubmit:t6,templates:eC.recipes})},dashboardStore:eC,dashboardId:"123"})})]}),(0,er.jsxs)("div",{className:"flex bg-[#FAFAFA]",children:[e0===ed.CHATS&&(0,er.jsxs)("div",{className:"flex flex-col w-[300px] overflow-y-auto py-6 border-l border-modou-dark-purple-100",style:{height:"calc(100vh - 64px)"},children:[(0,er.jsxs)("div",{className:"px-6 mb-2",children:[(0,er.jsx)(E.Z,{level:5,className:"mb-2",children:tS("History")}),(0,er.jsx)(_.L,{placeholder:tS("search"),size:"sm",value:eX,onChange:function(e){return eJ(e.target.value)}})]}),eX?eC.searchChats(eX).map(function(e){return(0,er.jsx)(z(),{className:"px-4",href:"/homepage/sandbox/dashboard/".concat(e.uuid),children:(0,er.jsx)(j.Z,{mouseEnterDelay:3,title:e.title,children:(0,er.jsx)(O.$,{type:"ghostPrimary",className:"w-full text-sm font-bold ".concat(tp===e.uuid?"bg-modou-st-purple-50":""),children:(0,er.jsx)(C.Z,{size:"sm",className:"line-clamp-3 text-left",children:e.title})})})},e.uuid)}):(0,er.jsxs)(er.Fragment,{children:[!!(null!=tL&&tL.length)&&(0,er.jsx)("div",{className:"sessions-list__group-title text-modou-st-purple-400 py-2 px-6",children:tS("Pinned")}),(0,er.jsx)(eu,{list:tL,currentSessionId:tp,onRename:tM,onDelete:tH,onPin:tA}),!!(null!=tz&&tz.length)&&(0,er.jsx)("div",{className:"sessions-list__group-title text-modou-st-purple-400 py-2 px-6",children:tS("Today")}),(0,er.jsx)(eu,{list:tz,currentSessionId:tp,onRename:tM,onDelete:tH,onPin:tA}),!!(null!=tR&&tR.length)&&(0,er.jsx)("div",{className:"sessions-list__group-title text-modou-st-purple-400 py-2 px-6",children:tS("Yesterday")}),(0,er.jsx)(eu,{list:tR,currentSessionId:tp,onRename:tM,onDelete:tH,onPin:tA}),!!(null!=t_&&t_.length)&&(0,er.jsx)("div",{className:"sessions-list__group-title text-modou-st-purple-400 py-2 px-6",children:tS("Previous 7 Days")}),(0,er.jsx)(eu,{list:t_,currentSessionId:tp,onRename:tM,onDelete:tH,onPin:tA}),!!(null!=tF&&tF.length)&&(0,er.jsx)("div",{className:"sessions-list__group-title text-modou-st-purple-400 py-2 px-6",children:tS("Others")}),(0,er.jsx)(eu,{list:tF,currentSessionId:tp,onRename:tM,onDelete:tH,onPin:tA})]})]}),e0===ed.SYNC&&(0,er.jsx)(Y.$,{loading:tk,list:tP,type:"destination",onDelete:t4,onSync:t2}),(0,er.jsx)("div",{className:"border-l border-modou-purple-100 pt-4 flex flex-col items-center gap-3 w-[40px] h-full",children:ep.map(function(e){return(0,er.jsx)(O.$,{size:"icon",onClick:function(){return t$(e)},className:"px-2 ".concat(e0===e.type?"bg-modou-st-purple-50":""),type:"ghostPrimary",children:(0,er.jsx)("i",{className:"iconfont ".concat(e.icon)})}
1,e.title)})})]}),(0,er.jsx)(B.z,{className:"bottom-[7%] right-[7%]",onClick:function(){eq({})},children:(0,er.jsx)(function(){return(0,er.jsx)("div",{className:"flex items-center justify-center cursor-pointer w-[58px] h-[58px] origin-center hover:w-[64px] hover:h-[64px] text-white bg-modou-green-1000 shadow-md hover:shadow-xl transition-all duration-300 rounded-full text-lg",children:(0,er.jsx)("i",{className:"iconfont iconMagicGPT",style:{fontSize:"24px"}})})},{})})]})}),(0,er.jsx)(v.Z,{open:!!eW,placement:"bottom",style:{top:"5%"},height:"90%",width:"90%",title:(0,er.jsx)("div",{className:"h-4"}),footer:null,onCancel:function(){eq(null)},children:(0,er.jsx)("div",{className:"h-[80vh]",children:(0,er.jsx)(M.Y,{mode:"dashboard",onSubmit:tQ,onRecipeSubmit:t6,promptVariablesQuery:tx})})}),(0,er.jsx)(Q.h,{type:Object.keys(tm.current).length?"update":"create",users:tg,form:tf,open:!!eH,onOk:tG,onCancel:function(){e5(!1),eA(null),tf.resetFields()},onUpdate:tU,onDelete:tB,updating:e2,initialValues:{Dashboard:(null===(ek=tD.data)||void 0===ek?void 0:null===(eD=ek.data)||void 0===eD?void 0:eD.title)||"Unnamed dashboard",hasEndDate:!1,recipients:[],option:"Once",cron:"0 0 * * *"}}),(0,er.jsx)(v.Z,{open:!!eF,title:"Rename",width:360,onOk:tY,onCancel:function(){eL(null)},okButtonProps:{loading:e2},children:(0,er.jsx)(_.L,{placeholder:"Dashboard name",value:eV,onChange:function(e){return eG(e.target.value)}})}),(0,er.jsx)(v.Z,{title:"Edit prompt",open:!!tc,destroyOnClose:!0,onOk:function(){var e;null===(e=eU.current)||void 0===e||e.submit(),tu(null)},onCancel:function(){tu(null)},children:(0,er.jsx)(Z.E,{store:eC,ref:eU,onChangeToPrompt:function(){},editingRecipe:{attributes:{prompt:null==tc?void 0:null===(eN=tc.template)||void 0===eN?void 0:eN.templatePrompt,properties:{variableConfig:null==tc?void 0:null===(eZ=tc.template)||void 0===eZ?void 0:eZ.variables}}},allowChangeMode:!1,variables:eC.promptVariables,showQuestions:!1,alwayShowQuestions:!0,isOutlined:!1,onSubmit:function(){},onSubmitRecipe:function(e,t){return tq({value:e,promptId:tc.promptId},t)},onClear:function(){}})}),(0,er.jsx)(v.Z,{title:"Sync",width:480,open:e3,onOk:t5,confirmLoading:e9,cancelButtonProps:{disabled:e9},onCancel:function(){return e6(!1)},children:(0,er.jsxs)(f.Z,{layout:"vertical",form:to,children:[(0,er.jsx)("div",{className:"text-modou-purple-700 text-bold mb-2",children:"From"}),(0,er.jsx)(f.Z.Item,{label:"Table",required:!0,className:"relative",children:(0,er.jsx)(w.Z,{disabled:!0,value:null==e3?void 0:e3.name})}),(0,er.jsx)("div",{className:"text-modou-purple-700 text-bold  mb-2",children:"To"}),(0,er.jsx)(f.Z.Item,{label:"Klaviyo list",name:"listId",required:!0,rules:[{required:!0,message:"Please select list."}],className:"relative",children:(0,er.jsx)(S.default,{showSearch:!0,filterOption:function(e,t){var n;return null==t?void 0:null===(n=t.label)||void 0===n?void 0:n.toLowerCase().includes(e.toLowerCase())},dropdownRender:function(e){return(0,er.jsxs)("div",{className:"relative top-1",children:[e,(0,er.jsx)("div",{className:"sync-integration-form__add-menu border-t border-modou-purple-100",children:(0,er.jsxs)(P.ZP,{className:"w-full",type:"text",onClick:function(){return eR(!0)},children:[(0,er.jsx)("i",{className:"iconfont iconplus1"}),"Add new list"]})})]})},children:tC.map(function(e){return(0,er.jsx)(S.default.Option,{value:e.value,label:e.label,children:e.label},e.value)})})})]})}),(0,er.jsx)(v.Z,{zIndex:9999,open:e_,title:"Create list",width:360,onOk:t7,onCancel:function(){eR(!1)},children:(0,er.jsx)(w.Z,{value:eV,onChange:function(e){return eG(e.target.value)}})}),(0,er.jsx)(X.s,{magicChatStore:eC,open:tn,onCancel:function(){return tr(!1)},onNew:tW,refreshWhenRedirect:function(){tN.mutate(),eC.setEditingRecipe(null),tr(!1)}})]})}));var eu=function(e){var t=e.list,n=e.currentSessionId,r=e.onRename,a=e.onDelete,i=e.onPin,s=(0,d.useState)(t.slice(0,8)),o=s[0],l=s[1],c=(null==t?void 0:t.length)>(null==o?void 0:o.length),u=(0,F.$G)(["main"]),p=u.t;return u.i18n,(0,d.useEffect)(function(){l(t.slice(0,8))},[t]),(0,er.jsxs)("div",{className:"px-4",children:[null==o?void 0:o.map(function(e){var t;return(0,er.jsx)("div",{children:(0,er.jsxs)("div",{className:"w-full session-item group relative flex justify-between items-center rounded-sm ".concat(e.uuid===n?"bg-modou-purple-50":""),children:[(0,er.jsx)(z(),{className:"w-full",href:"/homepage/sandbox/dashboard/".concat(e.uuid),children:(0,er.jsx)(O.$,{style:{display:"flex",alignItems:"center",width:"100%",height:"auto",padding:"6px 10px"},type:"ghostPrimary",children:(0,er.jsx)(j.Z,{mouseEnterDelay:1,title:e.title,placement:"left",children:(0,er.jsx)(C.Z,{className:"text-left sessions-list__item__title max-w-[250px] line-clamp-3",style:{textWrap:"wrap"},size:"sm",children:(0,er.jsx)("div",{className:"w-[200px] truncate",children:e.title||"Unnamed dashboard"})})})})},e.uuid),(0,er.jsx)("div",{className:"absolute h-full right-0 group-hover:flex items-center hidden bg-[#fafafacc]",children:(t=e,(0,er.jsx)(y.Z,{overlay:(0,er.jsxs)(g.Z,{children:[(0,er.jsx)(g.Z.Item,{onClick:function(){return r(t)},icon:(0,er.jsx)("i",{className:"iconfont iconpencil"}),children:p("Rename")},"edit"),(0,er.jsx)(g.Z.Item,{onClick:function(){return i(t)},icon:(0,er.jsx)("i",{className:"iconfont iconPin1"}),children:null!=t&&t.pinState?p("Unpin"):p("Pin")},"pin"),(0,er.jsx)(g.Z.Item,{onClick:function(){return a(t)},icon:(0,er.jsx)("i",{className:"iconfont icondelete"}),children:p("Delete")},"delete")]}),children:(0,er.jsx)("i",{className:"iconfont iconmore cursor-pointer"})}))})]})},e.uuid)}),c&&(0,er.jsx)("div",{className:"text-modou-lblue-1000",children:(0,er.jsx)(O.$,{onClick:function(){l(t.slice(0,o.length+8))},type:"link",color:"modou-lblue",className:"w-40",children:p("Show-more")})})]})},ed={CHATS:"chats",SYNC:"sync"},ep=[{title:"Chats",type:ed.CHATS,icon:"iconhistoryversion"}]},9575:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/homepage/sandbox/dashboard/[uuid]",function(){return n(14476)}])},68262:function(e,t,n){"use strict";var r=n(23586);function a(){}function i(){}i.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,i,s){if(s!==r){var o=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol
1:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:a};return n.PropTypes=n,n}},13980:function(e,t,n){e.exports=n(68262)()},23586:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},function(e){e.O(0,[6577,446,9097,20,9857,4545,8138,1258,3395,805,7907,6324,7505,6785,940,1098,6574,650,4755,1327,1249,9649,1022,9389,4170,9774,2888,179],function(){return e(e.s=9575)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.