1"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[6986,9098],{549:(e,t,n)=>{n.r(t),n.d(t,{default:()=>D});var i=n(65043),l=n(41894),r=n(1813),o=n(56986),s=n(29941),d=n(19717),a=n(76234);const c=n.p+"static/media/mapImage.951e3eeb08c26fce908e.png",u=n.p+"static/media/totalPhoto.6de9844ce8545387ac8f.png",p=n.p+"static/media/textPhoto.a39ea8bcae3cc7dfcedc.png",x=n.p+"static/media/chartPhoto.379a585f582d2df8301b.png",g=n.p+"static/media/calendarThumbnail.287638dad3f9a8399377.png",h=n.p+"static/media/workflowThumb.db0210795e2f157b6407.png";var f=n(85369),m=n(95263),y=n(22285),b=n(33865),v=n(21069),w=n(37546),j=n(98597),C=n(70579);const D=e=>{let{onClose:t,isOpen:n,widget:D,currentDash:S,gl:I}=e;const[k,A]=(0,i.useState)(700),[T,E]=(0,i.useState)(500),[M,F]=(0,i.useState)(window.innerHeight/2-T/2),[N,L]=(0,i.useState)(window.innerWidth/2-k/2),[R,W]=(0,i.useState)(!1),[H,q]=(0,i.useState)(null===D||void 0===D?void 0:D.id),[z,Q]=(0,i.useState)(!1),O=(0,i.useMemo)(()=>["Total/Average","Map","Custom Text","Chart","Tasks/Calendar","Workflows"],[]),J=(0,i.useMemo)(()=>[u,c,p,x,g,h],[]),[B,P]=(0,i.useState)(O[Number(null===D||void 0===D?void 0:D.id)-1]),G=e=>{P(e);const t=O.findIndex(t=>t===e);q("".concat(t+1))};(0,i.useEffect)(()=>{q(null===D||void 0===D?void 0:D.id),P(O[Number(null===D||void 0===D?void 0:D.id)-1])},[n,null===D||void 0===D?void 0:D.id,O]);const Y=(0,i.useCallback)(()=>{t(),Q(!1)},[t]),V=(0,i.useRef)(!1),X=(0,i.useCallback)(e=>{R&&(F(()=>e.clientY<20?20:e.clientY+T+20>window.innerHeight?window.innerHeight-T-20:e.clientY),L(()=>e.clientX<20?20:e.clientX+k+20>window.innerWidth?window.innerWidth-k-20:e.clientX))},[R,T,k]),U=(0,i.useCallback)(()=>{W(!1)},[]);(0,i.useEffect)(()=>{const e=e=>{V.current&&X(e)},t=()=>{V.current&&(U(),V.current=!1,i())},n=()=>{V.current&&(U(),V.current=!1,i())},i=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t),document.removeEventListener("mouseleave",n)};return R&&(V.current=!0,document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),document.addEventListener("mouseleave",n)),()=>i()},[R,X,U]);const[_,K]=(0,i.useState)(!1),Z=(0,i.useRef)(!1),$=(0,i.useRef)(0),ee=(0,i.useRef)(0),te=(0,i.useRef)(null),ne=(0,i.useCallback)(e=>{_&&(A(t=>{const n=e.clientX-ee.current,i=e.clientX>window.innerWidth-20?window.innerWidth-20-ee.current:1e3;return n<300?300:n>i?i:n}),E(t=>{const n=e.clientY-$.current,i=e.clientY>window.innerHeight-20?window.innerHeight-20-$.current:7e3;return n<300?300:n>i?i:n}))},[_]),ie=(0,i.useCallback)(()=>{K(!1)},[]);return(0,i.useEffect)(()=>{const e=e=>{Z.current&&ne(e)},t=()=>{Z.current&&(ie(),Z.current=!1,i())},n=()=>{Z.current&&(ie(),Z.current=!1,i())},i=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t),document.removeEventListener("mouseleave",n)};return _&&(Z.current=!0,document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),document.addEventListener("mouseleave",n)),()=>i()},[_,ne,ie]),n?(0,C.jsx)(l.A,{children:(0,C.jsx)("div",{style:{display:"flex",alignItems:"center",position:"fixed",top:"".concat(M,"px"),left:"".concat(N,"px"),background:"white",borderRadius:"5px",width:"".concat(k,"px"),height:"".concat(T,"px"),zIndex:"1000000",userSelect:"none",flexDirection:"column",boxShadow:"0px 2px 40px 0px rgba(0,0,0,0.5)"},ref:te,children:(0,C.jsxs)("div",{style:{height:"100%",width:"100%",display:"flex",flexDirection:"column",position:"relative",padding:"15px"},children:[(0,C.jsx)("div",{style:{width:"25px",height:"25px",borderRadius:"3px",background:"white",padding:"5px",cursor:"grab",display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:"0px",left:"0px"},onMouseDown:()=>{W(!0)},children:(0,C.jsx)(y.OLJ,{size:30})}),(0,C.jsx)("div",{style:{width:"25px",height:"25px",borderRadius:"3px",background:"white",padding:"5px",cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",top:"0px",right:"0px"},onClick:()=>{Y()},children:(0,C.jsx)(b.jkL,{size:30})}),(0,C.jsx)("div",{style:{width:"25px",height:"25px",borderRadius:"3px",background:"white",padding:"5px",cursor:"nwse-resize",display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",bottom:"0px",right:"0px"},onMouseDown:e=>{(()=>{K(!0);const{top:e,left:t}=te.current.getBoundingClientRect();$.current=e,ee.current=t})()},children:(0,C.jsx)(v.CTo,{size:30})}),z&&(0,C.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",ga
1p:"10px",fontFamily:"'DM Sans', sans-serif",flex:"1",minHeight:"0",width:"100%",overflow:"hidden"},children:[(0,C.jsx)("div",{style:{width:"100%",flex:"1",minHeight:"0",display:"flex",flexDirection:"column",overflow:"hidden"},children:(0,C.jsx)(a.A,{autoHide:!1,style:{width:"100%",flex:"1",minHeight:"0",padding:"20px 20px 10px 20px"},children:(0,C.jsx)("div",{style:{display:"flex",justifyContent:"center",flexWrap:"wrap",gap:"20px"},children:O.map((e,t)=>{if("Map"===e){var n;const i="2"!==(null===(n=D.id)||void 0===n?void 0:n.toString())&&!!document.getElementById("map");return(0,C.jsxs)("div",{onClick:()=>{i||G(e)},style:{display:"flex",flexDirection:"column",padding:"5px",cursor:"pointer",justifyContent:"flex-start",alignItems:"center",flex:"0 0 calc(50% - 20px)",borderRadius:"3px",height:"180px",gap:"10px",background:i?"rgb(240,240,240)":B===e?"rgb(245, 245, 255)":"",border:B===e?"2px solid rgb(26, 49, 95)":"1px solid rgba(0,0,0,0.3)"},children:[(0,C.jsxs)("label",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e,B===e?(0,C.jsx)(m.cxC,{style:{color:"rgb(26, 49, 95)"}}):(0,C.jsx)(f.EaG,{style:{color:"rgba(0,0,0,0.5)"}})]},t),i?(0,C.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",paddingBottom:"30px"},children:"Only one map is available per page"}):(0,C.jsx)("img",{src:J[t],alt:"No Preview",style:{height:"130px"}})]})}return(0,C.jsxs)("div",{onClick:()=>{G(e)},style:{display:"flex",flexDirection:"column",padding:"5px",cursor:"pointer",justifyContent:"flex-start",alignItems:"center",flex:"0 0 calc(50% - 20px)",borderRadius:"3px",height:"180px",gap:"10px",background:B===e?"rgb(245, 245, 255)":"",border:B===e?"2px solid rgb(26, 49, 95)":"1px solid rgba(0,0,0,0.3)"},children:[(0,C.jsxs)("label",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e,B===e?(0,C.jsx)(m.cxC,{style:{color:"rgb(26, 49, 95)"}}):(0,C.jsx)(f.EaG,{style:{color:"rgba(0,0,0,0.5)"}})]},t),(0,C.jsx)("img",{src:J[t],alt:"No Preview",style:{height:"135px"}})]})})})})}),(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"30px",width:"100%"},children:[(0,C.jsx)("button",{className:"edit-mode-button edit-mode-button--primary",onClick:()=>{const e="".concat(O.findIndex(e=>e===B)+1);P(O[Number(e)-1]),Q(!1),q(e)},children:"Confirm"}),(0,C.jsx)("button",{className:"edit-mode-button edit-mode-button--secondary",onClick:()=>{P(O[Number(null===D||void 0===D?void 0:D.id)-1]),Q(!1),q(null===D||void 0===D?void 0:D.id)},children:"Cancel"})]})]}),!z&&(0,C.jsxs)("div",{style:{flex:"1",minHeight:"0",padding:"15px",display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",fontFamily:"'DM Sans', sans-serif",width:"100%"},children:[(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[(0,C.jsx)("h3",{children:"".concat(B)}),(0,C.jsx)("button",{style:{fontFamily:"'DM Sans', sans-serif",border:"1px solid rgba(0,0,0,0.1)",borderRadius:"2px",padding:"3px 15px",background:"none",fontWeight:"500",fontSize:"14px",cursor:"pointer"},onClick:()=>{Q(!0)},children:"Change Item Type"})]}),(()=>{let e;switch(H){case"1":e=(0,C.jsx)(r.TotalDealsWidgetEditMode,{currentWidgetID:H,widget:D,currentDash:S,gl:I,onClose:t});break;case"2":e=(0,C.jsx)(s.HeatMapEditMode,{currentWidgetID:H,widget:D,currentDash:S,gl:I,onClose:t});break;case"3":e=(0,C.jsx)(o.RichTextEditMode,{currentWidgetID:H,widget:D,currentDash:S,gl:I,onClose:t});break;case"4":e=(0,C.jsx)(d.PieWidgetEditMode,{currentWidgetID:H,widget:D,currentDash:S,gl:I,onClose:t});break;case"5":e=(0,C.jsx)(w.TaskWidgetEditMode,{currentWidgetID:H,widget:D,currentDash:S,gl:I,onClose:t});break;case"6":e=(0,C.jsx)(j.WorkflowsWidgetEditMode,{currentWidgetID:H,widget:D,currentDash:S,gl:I,onClose:t});break;default:e=null}return e})()]})]})})}):null}},1813:(e,t,n)=>{n.r(t),n.d(t,{TotalDealsWidgetEditMode:()=>h,default:()=>g});var i=n(89379),l=n(65043),r=n(90801),o=n(70565),s=n(91368),d=n(76234),a=n(12543),c=n(19810),u=n(19717),p=n(80140),x=n(70579);const g=e=>{var t;let{gl:n,currentDash:i}=e;const{contactHeaderColumns:s,dealHeaderColumns:d}=(0,l.useContext)(r.C),[a,c]=(0,l.useState)(null),[u,g]=(0,l.useState)(!1),h=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=!0;if(h.current&&(clearTimeout(h.current),h.current=null),null!==n&&void 0!==n&&n.widget)return h.current=setTimeout(async()=>{g(!0);try{const t="Deals"===n.widget.DataType?d:s,i=await(0,o.qw)(n.widget,t,"GET_TILE");if(!e)return;c(i.finalData)}catch(t){if(!e)return;
1console.error("Error fetching dashboard tile result:",t),c("Error fetching data")}finally{if(!e)return;g(!1)}},300),()=>{e=!1,h.current&&(clearTimeout(h.current),h.current=null)};c(null)},[n.widget,s,d]);const f=(0,l.useMemo)(()=>n.widget&&n.widget.Column?"All Deals"===n.widget.Column||"All Contacts"===n.widget.Column?null:"Deals"===n.widget.DataType?d.find(e=>e.Name===n.widget.Column):"Contacts"===n.widget.DataType?s.find(e=>e.Name===n.widget.Column):null:null,[n.widget,s,d]),m=(0,l.useRef)(null);return(0,l.useEffect)(()=>{const e=m.current,t=new ResizeObserver(()=>{if(e){e.querySelectorAll("h2").forEach(t=>{const n=Math.min(e.clientWidth/12,22);t.style.fontSize="".concat(n,"px")})}});return e&&t.observe(e),()=>{e&&t.unobserve(e)}},[]),(0,x.jsxs)("div",{style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px"},ref:m,children:[(0,x.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",border:""},children:(0,x.jsx)("h2",{style:{textAlign:"center",fontSize:"110%"},children:null===(t=n.widget)||void 0===t?void 0:t.Name})}),(0,x.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",border:""},children:u?(0,x.jsx)("div",{className:"loading-wheel"}):(0,x.jsx)("h2",{style:{fontSize:"120%",fontWeight:"bold"},children:(0,x.jsx)("p",{style:{color:"rgb(109,109,109)"},children:a||0===a?f?(0,p.RA)(f,a):a:""})})})]})},h=e=>{let{widget:t,currentDash:n,gl:p,currentWidgetID:g,onClose:h}=e;const{userProfile:f}=(0,l.useContext)(a.cy),{contactHeaderColumns:m,setDashboards:y,dealHeaderColumns:b,dashboards:v,sendJsonMessage:w,sendFailedMessage:j}=(0,l.useContext)(r.C),{triggerFailAlert:C,triggerLoadAlert:D,triggerSuccessAlert:S}=(0,l.useContext)(s.Y),[I,k]=(0,l.useState)(null===t||void 0===t?void 0:t.Name),[A,T]=(0,l.useState)(null===t||void 0===t?void 0:t.Column),[E,M]=(0,l.useState)(null===t||void 0===t?void 0:t.Metric),[F,N]=(0,l.useState)(t.dealFilters||[]),[L,R]=(0,l.useState)(t.DataType||"Deals"),W=(e,t)=>{const n=F.find(t=>t.colId.toString()===e.toString());N(n?l=>{if(n.filters.find(e=>e.value===t)){return[...l.filter(e=>e.colId.toString()!==n.colId.toString()),(0,i.A)((0,i.A)({},n),{},{filters:[...n.filters.filter(e=>e.value!==t)]})]}return[...l.filter(t=>t.colId.toString()!==e.toString()),(0,i.A)((0,i.A)({},n),{},{filters:[...n.filters,{value:t,operator:"="}]})]}:n=>[...n,{colId:e,filters:[{value:t,operator:"="}]}])},[H,q]=(0,l.useState)("General"),[z,Q]=(0,l.useState)(!1);return(0,x.jsxs)("div",{style:{display:"flex",flexDirection:"column",width:"100%",flex:"1",minHeight:"0",userSelect:"none"},children:[(0,x.jsxs)("div",{style:{width:"100%",height:"40px",display:"flex",alignItems:"center",gap:"10px",marginTop:"10px"},children:[(0,x.jsx)("p",{onClick:()=>{q("General")},style:{background:"General"===H?"rgb(230,230,230)":"",padding:"5px",borderRadius:"2px",cursor:"pointer"},children:"General"}),(0,x.jsx)("p",{onClick:()=>{q("Filters")},style:{background:"Filters"===H?"rgb(230,230,230)":"",padding:"5px",borderRadius:"2px",cursor:"pointer"},children:"Filters"})]}),(0,x.jsx)("hr",{style:{width:"100%",marginTop:"10px",border:"1px solid rgb(209,209,209)",marginBottom:"10px"}}),(0,x.jsxs)("div",{style:{flex:"1",minHeight:"0",width:"100%",display:"flex",flexDirection:"column"},children:[(0,x.jsx)("div",{style:{flex:"1",minHeight:"0",overflow:"hidden",width:"100%"},children:(0,x.jsx)(d.A,{autoHide:!1,style:{height:"100%",width:"100%"},children:(0,x.jsxs)("div",{style:{paddingTop:"20px",display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",gap:"15px",width:"100%"},children:["General"===H&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{style:{display:"flex",gap:"5px",justifyContent:"flex-start",alignItems:"center"},children:[(0,x.jsx)("h5",{children:"Title: "}),(0,x.jsx)("input",{style:{width:"200px",padding:"5px",borderRadius:"2px",border:"1px solid rgba(0,0,0,0.1)"},placeholder:"Type title here...",value:I,onChange:e=>{k(e.target.value)}})]}),(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"5px"},children:[(0,x.jsx)("h5",{children:"Data Type: "}),(0,x.jsxs)("select",{style:{width:"200px",padding:"5px",borderRadius:"2px",border:"1px solid rgba(0,0,0,0.1)"},value:L,onChange:e=>{R(e.target.value),T(""),N([])},children:[(0,x.jsx)("option",{value:"",children:"Select Data Type"}),(0,x.jsx)("option",{value:"Deals",children:"Deals"}),(0,x.jsx)("option",{value:"Contacts",children:"Contacts"})]})]}),(0,x.jsx)("hr",{style:{width:"50%",border:"1px solid rgb(225,225,225)",margin:"10px 0px"}}),(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"5px"},children:[(0,x.jsx)("h5",{children:"Measurement: "}),(0,x.jsxs)("select",{style:{border:"1px solid rgba(0,0,0,0.1)",background:"none",height:"30px",width:"200px",borderRadius:"2px",padding:"5px",outline:"none"},value:E,onChange:e=>{M(e.target.value)},children:[(0,x.jsx)("option",{value:"",children:"Select Measurement"}),(0,x.jsx)("option",{value:"Total",children:"Total"}),(0,x.jsx)("option",{value:"Average",children:"Average"})]})]}),(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"5px"},children:[(0,x.jsx)("h5",{children:"Metric: "}),(0,x.jsxs)("select",{style:{border:"1px solid rgba(0,0,0,0.1)",background:"none",height:"30px",width:"200px",borderRadius:"2px",padding:"5px",outline:"none"},value:A,onChange:e=>{T(e.target.value)},children:[(0,x.jsx)("option",{value:"",children:"Select Metric"}
1),"Deals"===L?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("option",{value:"All Deals",children:"Deals"}),b.filter(e=>"Dropdown"!==e.CellType&&"Multi-Select"!==e.CellType&&"Formula"!==e.CellType).map(e=>(0,x.jsx)("option",{value:e.Name,children:e.Name},e.Name))]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("option",{value:"All Contacts",children:"Contacts"}),m.filter(e=>"Dropdown"!==e.CellType&&"Multi-Select"!==e.CellType&&"Formula"!==e.CellType).map(e=>(0,x.jsx)("option",{value:e.Name,children:e.Name},e.Name))]})]})]})]}),"Filters"===H&&(0,x.jsx)(x.Fragment,{children:(0,x.jsx)("div",{style:{display:"flex",justifyContent:"flex-start",flexDirection:"column",alignItems:"flex-start",gap:"5px",width:"100%"},children:"Deals"===L?(0,x.jsx)(u.DealFilters,{dealFilters:F,toggleDealFilter:W,handleSelectChange:e=>{if(console.log(e),e){if(F.find(e=>{var t;return"-1"===(null===(t=e.colId)||void 0===t?void 0:t.toString())})){const t=e.map(e=>({operator:"=",value:e.value}));N(e=>e.map(e=>{var n;return"-1"===(null===(n=e.colId)||void 0===n?void 0:n.toString())?(0,i.A)((0,i.A)({},e),{},{filters:[...t]}):e}))}else{const t={colId:"-1",filters:e.map(e=>({operator:"=",value:e.value}))};N(e=>[...e,t])}}else N(e=>e.filter(e=>{var t;return"-1"!==(null===(t=e.colId)||void 0===t?void 0:t.toString())}))}}):(0,x.jsx)(u.ContactFilters,{dealFilters:F,toggleDealFilter:W})})})]})})}),"Filters"===H&&(0,x.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",padding:"5px"},children:(0,x.jsx)("div",{style:{border:"1px solid rgb(209,209,209)",borderRadius:"2px",padding:"5px",fontSize:"12px",width:"fit-content",cursor:"pointer"},onClick:()=>{Q(!0)},children:"More filters"})}),(0,x.jsx)(c.A,{isOpen:z,onClose:Q,dealFilters:F,setDealFilters:N,dataType:L}),(0,x.jsx)("hr",{style:{width:"100%",border:"1px solid rgb(209,209,209)",marginBottom:"10px"}}),(0,x.jsx)("div",{style:{width:"100%",height:"30px",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,x.jsx)("div",{style:{cursor:"pointer",background:"rgb(38,42,91)",color:"white",padding:"5px 10px",borderRadius:"2px"},onClick:()=>{(()=>{let e;const t=[...v];let l=[];y(t=>(l=t.map(t=>{if(t.DashboardID.toString()===n.toString()){let n=JSON.parse(t.Layout);return n=n.map(e=>{if(e.i.toString()===p.i.toString()){let t=e.widget;const n=(0,i.A)((0,i.A)({},t),{},{Name:I,Metric:E,Column:A,dealFilters:F,id:g,DataType:L});return(0,i.A)((0,i.A)({},e),{},{widget:n})}return e}),e=n,(0,i.A)((0,i.A)({},t),{},{Layout:JSON.stringify(n)})}return t}),l)),D(),(0,o.fB)(n,JSON.stringify(e),"Layout",f,j).then(e=>{S("Saved successfully"),w({type:"dashboardsUpdate"})},e=>{D(),C("Failed to update dashboard"),y(t)})})()},children:"Save"})})]})]})}},41894:(e,t,n)=>{n.d(t,{A:()=>l});var i=n(97950);const l=e=>{let{children:t}=e;return i.createPortal(t,document.body)}},56986:(e,t,n)=>{n.r(t),n.d(t,{RichTextEditMode:()=>p,default:()=>u});var i=n(89379),l=n(65043),r=n(88481),o=n(90801),s=n(70565),d=n(91368),a=n(12543),c=n(70579);const u=e=>{let{widget:t,gl:n,currentDash:u}=e;(0,l.useEffect)(()=>{!function(e){const t=document.getElementById(e);if(t){const e=t.getElementsByTagName("a");Array.from(e).forEach(e=>{e.onclick=function(t){t.preventDefault();let n=e.href;["http://localhost:3000/","https://localhost:3000/","https://dealcompass.co/"].forEach(e=>{n.startsWith(e)&&(n=n.replace(e,"//"))}),console.log(n),window.open(n,"_blank")}})}}("showQuill-".concat(n.i))});const{userProfile:p}=(0,l.useContext)(a.cy),{dashboards:x,setDashboards:g,sendFailedMessage:h,sendJsonMessage:f}=(0,l.useContext)(o.C),{triggerFailAlert:m,triggerLoadAlert:y}=(0,l.useContext)(d.Y),[b,v]=(0,l.useState)();(0,l.useEffect)(()=>{const e=x.find(e=>e.DashboardID.toString()===u.toString()),t=JSON.parse(e.Layout||"[]").find(e=>e.i===n.i);v(t.widget.Value)},[u,x,n.i]);return(0,c.jsxs)("div",{style:{height:"100%",width:"100%",overflow:"scroll"},onBlur:()=>{(()=>{let e;const t=[...x];let l=[];g(t=>(l=t.map(t=>{if(t.DashboardID.toString()===u.toString()){let l=JSON.parse(t.Layout);return l=l.map(e=>{if(e.i.toString()===n.i.toString()){let t=e.widget;"object"===typeof t&&null!==t||(t={});const n=(0,i.A)((0,i.A)({},t),{},{Value:b});return(0,i.A)((0,i.A)({},e),{},{widget:n})}return e}),e=l,(0,i.A)((0,i.A)({},t),{}
1,{Layout:JSON.stringify(l)})}return t}),l)),(0,s.fB)(u,JSON.stringify(e),"Layout",p,h).then(e=>{f({type:"dashboardsUpdate"})},e=>{y(),m("Failed to update dashboard"),g(t)})})()},children:[(0,c.jsx)(r.A,{theme:"snow",id:"showQuill-".concat(n.i),value:b,style:{maxHeight:"fit-content",width:"fit-content",margin:"0px"},onChange:e=>{v(e)}}),(0,c.jsx)("style",{children:"\n\n #showQuill-".concat(n.i," .ql-toolbar {\n display: none;\n }\n\n #showQuill-").concat(n.i," .ql-snow {\n border: none !important;\n }\n\n #showQuill-").concat(n.i," .ql-editor a {\n cursor: pointer\n }\n\n #showQuill-").concat(n.i," .ql-tooltip {\n display: none\n }\n\n .ql-tooltip { \n z-index: 1000\n }\n\n ")})]})},p=e=>{let{widget:t,currentDash:n,gl:u,currentWidgetID:p,onClose:x}=e;const{userProfile:g}=(0,l.useContext)(a.cy),{setDashboards:h,dashboards:f,sendJsonMessage:m,sendFailedMessage:y}=(0,l.useContext)(o.C),{triggerFailAlert:b,triggerLoadAlert:v,triggerSuccessAlert:w}=(0,l.useContext)(d.Y),[j,C]=(0,l.useState)(null===t||void 0===t?void 0:t.Value);return(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"space-between"},children:[(0,c.jsx)("hr",{style:{width:"100%",marginTop:"10px",border:"1px solid rgb(209,209,209)",marginBottom:"10px"}}),(0,c.jsx)("div",{style:{display:"flex",flex:"1",minHeight:"100%"},children:(0,c.jsxs)("div",{style:{display:"flex",flex:"1",minWidth:"0",height:"100%",flexDirection:"column",justifyContent:"space-between",alignItems:"center",padding:"20px"},children:[(0,c.jsxs)("div",{style:{maxHeight:"300px",maxWidth:"100%"},children:[(0,c.jsx)(r.A,{theme:"snow",id:"showQuill-edit",value:j,formats:["header","font","size","bold","italic","underline","strike","blockquote","list","bullet","indent","link","image","video","color","align"],modules:{toolbar:{container:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","blockquote"],[{color:[]}],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"}],["link","image"],[{align:["","center","right"]}],["clean"]]},clipboard:{matchVisual:!0}},style:{maxHeight:"300px",maxWidth:"100%",margin:"0px",overflow:"scroll",border:"1px solid #ccc"},onChange:e=>{C(e)}}),(0,c.jsx)("style",{children:"\n .ql-container {\n box-sizing: border-box;\n max-height: 300px !important;\n\n }\n\n\n #showQuill-edit { \n position: relative\n }\n\n #showQuill-edit .ql-container {\n box-sizing: border-box;\n max-height: 100%;\n border-right: none;\n border-left: none;\n border-bottom: none;\n position: none;\n }\n\n #showQuill-edit .ql-toolbar {\n position: sticky;\n top: 0;\n z-index: 2;\n background: white;\n border-top: none;\n border-right: none;\n border-left: none;\n }\n\n #showQuill-edit .ql-editor {\n position: none !important;\n min-height: 275px !important;\n }\n\n\n #showQuill-edit .ql-tooltip {\n position: fixed;\n z-index: 2;\n top: 0px !important;\n left: calc(50% - 180px) !important;\n border-radius: 2px;\n font-family: 'DM Sans', sans-serif;\n font-weight: 600;\n }\n\n #showQuill-edit .ql-tooltip a {\n font-weight: 400\n }\n\n #showQuill-edit .ql-tooltip input {\n border-radius: 2px;\n color: rgba(0,0,0,0.5)\n }\n\n #showQuill-edit .ql-action {\n margin-left: 20px\n }\n\n #showQuill-edit .ql-action::after {\n background: #C4D4F2;\n padding: 2px 5px;\n text-align: center;\n margin: 0px;\n border-radius: 2px\n }\n\n #showQuill-edit .ql-remove {\n font-weight: 400;\n color: #C4423F;\n }\n\n\n\n\n \n "})]}),(0,c.jsx)("div",{style:{width:"100%",height:"30px",display:"flex",justifyContent:"center",alignItems:"center"},children:(0,c.jsx)("div",{style:{cursor:"pointer",background:"rgb(38,42,91)",color:"white",padding:"5px 10px",borderRadius:"2px"},onClick:()=>{(()=>{let e;v();const t=[...f];let l=[];h(t=>(l=t.map(t=>{if(t.DashboardID.toString()===n.toString()){let n=JSON.parse(t.
1Layout);return n=n.map(e=>{if(e.i.toString()===u.i.toString()){let t=e.widget;"object"===typeof t&&null!==t||(t={});const n=(0,i.A)((0,i.A)({},t),{},{Value:j,id:p});return console.log(n),(0,i.A)((0,i.A)({},e),{},{widget:n})}return e}),e=n,(0,i.A)((0,i.A)({},t),{},{Layout:JSON.stringify(n)})}return t}),l)),(0,s.fB)(n,JSON.stringify(e),"Layout",g,y).then(e=>{w("Saved successfully"),m({type:"dashboardsUpdate"})},e=>{b("Failed to update dashboard"),h(t)})})()},children:"Save"})})]})})]})}}}]);
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.