1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[78811],{60819:function(e,t,n){"use strict";n.d(t,{Z:function(){return T}});var r=n(85893),s=n(809),a=n.n(s),i=n(92447),l=n(67294),o=n(86455),c=n.n(o),d=n(77630),u=n.n(d),x=n(9669),p=n.n(x),h=n(37163),m=(n(16739),n(5152)),f=n(89265),b=n.n(f),g=n(50895),v=(0,m.default)((function(){return Promise.all([n.e(12596),n.e(86925)]).then(n.t.bind(n,35108,23)).then((function(e){return e.Editor}))}),{ssr:!1,loadableGenerated:{webpack:function(){return[35108]},modules:["../components/Editor/simpleEditor.js -> react-draft-wysiwyg"]}});function j(e){var t=e.text,s=(0,l.useState)(h.EditorState.createWithContent(h.ContentState.createFromBlockArray((0,h.convertFromHTML)(t)))),o=s[0],c=s[1];return(0,r.jsx)("div",{className:"editor",children:(0,r.jsx)(v,{editorState:o,onEditorStateChange:function(t){c(t);var n=t.getCurrentContent(),r=(0,h.convertToRaw)(n),s=n.hasText()?b()(r):"",a={target:{name:e.name,value:s}};e.onChange(a)},toolbar:{inline:{inDropdown:!0},list:{inDropdown:!0},textAlign:{inDropdown:!0},link:{inDropdown:!0},history:{inDropdown:!0},image:{uploadCallback:function(e){return new Promise(function(){var t=(0,i.Z)(a().mark((function t(r,s){var i,l,o,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n(6230),(l=new i).append("files",e),l.append("purpose","campaign-assets"),l.append("client",g.RECIPT_PREFIX),o={method:"post",url:"".concat("https://8xotuuqg2h.execute-api.ap-south-1.amazonaws.com/dev","/upload"),headers:{"Content-Type":"application/json"},data:l},t.next=8,p()(o).then((function(e){return"https://crowdera-platform.s3.ap-south-1.amazonaws.com/"+e.data.originalKey})).catch((function(e){console.log(e)}));case 8:(c=t.sent)&&r({data:{link:c}});case 10:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}())},alt:{present:!0,mandatory:!1}}},handlePastedText:function(){return!1},editorClassName:"editor-class",placeholder:"Tell us about your campaign, introduce your campaign in brief."})})}var y=n(60702),w=n(95477),N=n(52663),k=n(78715),C=n(29525),Z=n(91064),S=n(28142),P=n(41352),_=u()(c());function T(e){var t=e.refreshUpdatesData,n=(0,l.useState)(!1),s=n[0],o=n[1],c=(0,l.useState)(!1),d=c[0],u=c[1],x=(0,l.useState)(""),h=x[0],m=x[1],f=(0,l.useState)(""),b=f[0],g=f[1],v=(0,l.useState)(0),T=v[0],D=v[1],z=(0,l.useState)(!1),E=z[0],U=z[1],I=(0,l.useState)(!1),O=I[0],A=I[1],F=function(){o(!1)},B=function(e,t){"clickaway"!==t&&u(!1)},R=function(){var n=(0,i.Z)(a().mark((function n(){var r;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(""!==h){n.next=5;break}U("Title can not be empty."),u(!0),n.next=20;break;case 5:if(""!==b){n.next=10;break}U("Description can not be empty."),u(!0),n.next=20;break;case 10:if(null==localStorage.getItem("token")){n.next=18;break}return A(!0),r={title:h,description:b,campaign_id:e.id,amount:T},n.next=15,p().post("".concat("https://api.crowdera.com","/campaign/tabs/update"),r).then((function(e){"success"===e.data.status?(_.fire("Update Successfully added.","Your contributors can see the update.","success"),o(!1),t(),m(""),g(""),D("")):_.fire("Oops!",e.data.message,"error")})).catch((function(){_.fire("Oops!","Failed to publish update","error")}));case 15:A(!1),n.next=20;break;case 18:U("User not authenticated."),u(!0);case 20:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}}();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:function(){o(!0)},className:"flex items-center gap-1.5 sm:gap-2 px-[12px] py-[6px] rounded-[8px] bg-blue-50 border border-blue-200 text-blue-600 text-[12.5px] font-semibold hover:bg-blue-100 transition-all shadow-sm",children:[(0,r.jsx)(Z.Z,{size:15})," Add Update"]}),(0,r.jsxs)(N.Z,{onClose:F,open:s,fullWidth:!0,maxWidth:"md",classes:{paper:"m-4 rounded-2xl shadow-2xl bg-white overflow-hidden max-w-[800px] w-full"},style:{zIndex:1e3},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-6 py-5 border-b border-slate-100 bg-white",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"p-2.5 bg-blue-50 rounded-lg border border-blue-100",children:(0,r.jsx)(S.Z,{className:"text-blue-600",size:18})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-[17px] font-bold text-slate-800 tracking-tight leading-tight",children:"Publish Campaign Upd
1ate"}),(0,r.jsx)("p",{className:"text-[12.5px] text-slate-500 mt-0.5",children:"Keep your supporters in the loop with recent progress."})]})]}),(0,r.jsx)("button",{onClick:F,className:"p-2 hover:bg-slate-100 rounded-lg transition-colors text-slate-400 hover:text-slate-600",children:(0,r.jsx)(P.Z,{size:20})})]}),(0,r.jsx)(C.Z,{className:"p-0 bg-slate-50/30",children:(0,r.jsxs)("div",{className:"p-6 space-y-6",children:[(0,r.jsx)(k.Z,{severity:"info",className:"rounded-xl border border-blue-50 bg-blue-50/50",children:(0,r.jsx)("span",{className:"text-[13px] text-blue-800",children:"This update will be visible to all visitors on your public campaign page. Be transparent and engaging!"})}),(0,r.jsx)(y.Z,{open:d,autoHideDuration:6e3,onClose:B,children:(0,r.jsx)(k.Z,{onClose:B,severity:E?"error":"success",className:"rounded-xl shadow-lg",children:(0,r.jsx)("span",{className:"text-[13px]",children:E||"Success"})})}),(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("label",{className:"text-[11.5px] font-bold text-slate-500 uppercase tracking-wider ml-1",children:"Update Title"}),(0,r.jsx)("input",{type:"text",className:"w-full p-3 bg-white border border-slate-200 rounded-xl text-[14px] focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all outline-none text-slate-700 shadow-sm placeholder-slate-300",placeholder:"E.g., We've reached 50% of our goal!",value:h,onChange:function(e){return m(e.target.value)}})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("div",{className:"flex items-center justify-between ml-1 mb-1",children:(0,r.jsx)("label",{className:"text-[11.5px] font-bold text-slate-500 uppercase tracking-wider",children:"The Story"})}),(0,r.jsx)("div",{className:"bg-white border text-[14px] border-slate-200 rounded-xl overflow-hidden shadow-sm focus-within:ring-2 focus-within:ring-blue-500/20 focus-within:border-blue-500 transition-all [&_.public-DraftEditor-content]:min-h-[250px]",children:(0,r.jsx)(j,{name:"text",text:b,editorClassName:"p-4 prose prose-sm max-w-none text-slate-700",onChange:function(e){return g(e.target.value)}})})]})]}),(0,r.jsxs)("div",{className:"pt-6 flex justify-end gap-3 border-t border-slate-100",children:[(0,r.jsx)("button",{onClick:F,className:"px-6 py-2.5 text-[13.5px] font-bold text-slate-500 hover:text-slate-800 hover:bg-slate-100 rounded-xl transition-all",children:"Cancel"}),O?(0,r.jsx)("div",{className:"px-10 py-2.5 flex items-center justify-center bg-blue-50 rounded-xl",children:(0,r.jsx)(w.Z,{size:20,className:"text-blue-600"})}):(0,r.jsx)("button",{onClick:R,disabled:!h||!b,className:"px-8 py-2.5 flex items-center gap-2 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 disabled:hover:bg-blue-600 text-white text-[13.5px] font-bold rounded-xl transition-all shadow-sm shadow-blue-200 active:scale-[0.98]",children:"Publish Update"})]})]})})]})]})}},58467:function(e,t,n){"use strict";n.d(t,{Z:function(){return A}});var r=n(85893),s=n(809),a=n.n(s),i=n(92447),l=n(26265),o=n(38347),c=n(67294),d=n(11163),u=n(5152),x=n(77630),p=n.n(x),h=n(86455),m=n.n(h),f=n(57391),b=n(22318),g=n(17812),v=n(95477),j=n(52663),y=n(282),w=n(29525),N=n(66083),k=n(14670),C=n(80366),Z=n(78715),S=n(60819),P=n(71408),_=n(45077),T=n(71353);function D(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 z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var E=p()(m()),U=(0,u.default)((function(){return n.e(97183).then(n.bind(n,79061))}),{ssr:!1,loading:function(){return(0,r.jsx)("div",{className:"animate-pulse bg-gray-100 h-48 rounded-xl ring-1 ring-gray-100"})},loadableGenerated:{webpack:function(){return[79061]},modules:["../components/Campaign/UpdatesTable.tsx -> components/Editor/RichTextEditor"]}}),I=(0,k.Z)((function(e){return{root:{padding:e.spacing(2)}}}))(w.Z),O=(0,k.Z)((function(e){return{root:{margin:0,padding:e.spacing(2)},closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]}}}))((function(e){var t=e.children,n=e.classes,s=e.onClose,a=(0,o.Z)(e,["children","classes","onClose"]);return(0,r.jsxs)(N.Z,z(z({disableTypography:!0,className:n.root},a),{},{children:[(0,r.jsx)(b.Z,{variant:"h6",children:t}),s?(0,r.jsx)(g.Z,{"aria-label":"close",className:n.closeButton,onClick:s,children:(0,r.jsx)(C.Z,{})}):null]}))}));function A(e){var t=(0,d.useRouter)().query.slug,n=(0,c.useState)(!1),s=n[0],o=n[1],u=(0,c.useState)(!1),x=u[0],p=u[1],h=(0,c.useState)(!1),m=(h[0],h[1],(0,c.useState)(!1)),b=(m[0],m[1],(0,c.useState)(1)),g=b[0],w=b[1],N=(0,c.useState)(e.updates||[]),k=N[0],C=N[1],D=(0,c.useState)(""),A=D[0],F=D[1],B=(0,c.useState)(""),R=B[0],W=B[1],L=(0,c.useState)(""),M=L[0],q=L[1],G=(0,c.useState)(!1),K=G[0],V=G[1],X=function(){var t=(0,i.Z)(a().mark((function t(){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o(!0),t.next=3,(0,f.C4)(e.id,g,6);case 3:null!==(n=t.sent)&&void 0!==n&&n.data&&C(n.data.results),o(!1);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),H=function(){var t=(0,i.Z)(a().mark((function t(n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return w(n),o(!0),t.next=4,(0,f.C4)(e.id,n,6);case 4:null!==(r=t.sent)&&void 0!==r&&r.data&&C(r.data.results),o(!1);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),J=function(){var e=(0,i.Z)(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,f._e)({title:R,description:M},"/campaign/contribution/cam-update/".concat(A));case 3:p(!1),X(),E.fire("Success","Update successfully modified","success"),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),Y=function(){var t=(0,i.Z)(a().mark((function t(n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:E.fire({title:"Delete Update?",text:"This update will be removed from your campaign story.",icon:"warning",showCancelButton:!0,confirmButtonColor:"#ef4444",confirmButtonText:"Delete"}).then(function(){var t=(0,i.Z)(a().mark((function t(r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.isConfirmed){t.next=3;break}return t.next=3,(0,f.VT)(e.id,n).then((function(e){e&&(E.fire("Deleted","Update successfully deleted","success"),X())}));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Q=[{key:"title",label:"Title",visible:!0},{key:"description",label:"Story Snippet",visible:!0},{key:"created_at",label:"Date Posted",visible:!0},{key:"action",label:"Actions",visible:!0}],$=(0,c.useState)(Q.reduce((function(e,t){return e[t.key]=t.visible,e}),{})),ee=$[0],te=$[1],ne=Math.ceil((e.count||0)/6);return(0,c.useEffect)((function(){t&&X()}),[t]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl overflow-hidden flex flex-col h-full relative transition-all duration-300 min-h-[450px]",children:[(0,r.jsxs)("div",{className:"px-[22px] py-[18px] border-b border-gray-100 flex items-center justify-between flex-wrap gap-3 bg-white relative z-10",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-[15px] font-semibold text-[#0f172a] m-0",children:"Campaign Upd
1ates"}),(0,r.jsx)("p",{className:"mt-[3px] text-[12.5px] text-[#94a3b8]",children:"Share news and progress with your trustworthy donors."})]}),(0,r.jsxs)("div",{className:"flex items-center flex-wrap gap-2 lg:gap-3",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{onClick:function(){return V(!K)},className:"flex items-center gap-2 px-[12px] py-[6px] rounded-[8px] border text-[12.5px] font-semibold transition-all shadow-sm ".concat(K?"bg-blue-50 border-blue-200 text-blue-600":"bg-white border-[#e2e8f0] text-[#475569] hover:bg-gray-50"),children:[(0,r.jsx)(P.Z,{size:15}),"Manage Columns"]}),K&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-20",onClick:function(){return V(!1)}}),(0,r.jsxs)("div",{className:"absolute top-full mt-2 w-64 bg-white border border-gray-100 rounded-[12px] shadow-[0_10px_25px_-5px_rgba(0,0,0,0.1),0_8px_10px_-6px_rgba(0,0,0,0.1)] z-30 p-4 animate-in fade-in zoom-in duration-200",children:[(0,r.jsx)("h3",{className:"text-[13px] font-semibold text-[#0f172a] mb-3 px-1",children:"Display Columns"}),(0,r.jsx)("div",{className:"space-y-1",children:Q.map((function(e){return(0,r.jsxs)("div",{className:"flex items-center justify-between py-2 px-1 hover:bg-gray-50 rounded-lg transition-colors",children:[(0,r.jsx)("span",{className:"text-[12.5px] text-[#475569]",children:e.label}),(0,r.jsx)("button",{onClick:function(){return t=e.key,void te((function(e){return z(z({},e),{},(0,l.Z)({},t,!e[t]))}));var t},className:"relative inline-flex h-5 w-9 items-center rounded-full transition-colors focus:outline-none ".concat(ee[e.key]?"bg-blue-600":"bg-gray-200"),children:(0,r.jsx)("span",{className:"inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform ".concat(ee[e.key]?"translate-x-5":"translate-x-1")})})]},e.key)}))})]})]})]}),(0,r.jsx)(S.Z,{id:e.id,refreshUpdatesData:X})]})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-auto relative ".concat(k&&0!==k.length?"":"flex flex-col min-h-[300px]"),children:[s&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-white/40 z-10 backdrop-blur-[0.5px]",children:(0,r.jsx)(v.Z,{color:"primary",size:30})}),(null===k||void 0===k?void 0:k.length)>0?(0,r.jsxs)("table",{className:"w-max min-w-full border-collapse text-[13px]",children:[(0,r.jsx)("thead",{className:"sticky top-0 z-[1] bg-[#f8fafc]",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-[16px] py-[11px] text-left text-[12px] font-medium text-[#64748b] border-b border-[#e2e8f0]",children:(0,r.jsx)("input",{type:"checkbox",className:"w-[16px] h-[16px] rounded border-gray-300 text-blue-600 focus:ring-blue-500 transition-all cursor-pointer"})}),ee.title&&(0,r.jsx)("th",{className:"px-[16px] py-[11px] text-left text-[12px] font-medium text-[#64748b] border-b border-[#e2e8f0]",children:"Update Title"}),ee.description&&(0,r.jsx)("th",{className:"px-[16px] py-[11px] text-left text-[12px] font-medium text-[#64748b] border-b border-[#e2e8f0]",children:"Story Snippet"}),ee.created_at&&(0,r.jsx)("th",{className:"px-[16px] py-[11px] text-left text-[12px] font-medium text-[#64748b] border-b border-[#e2e8f0]",children:"Date Posted"}),ee.action&&(0,r.jsx)("th",{className:"px-[16px] py-[11px] text-left text-[12px] font-medium text-[#64748b] border-b border-[#e2e8f0] text-right",children:"Actions"})]})}),(0,r.jsxs)("tbody",{children:[k.map((function(e){var t,n;return(0,r.jsxs)("tr",{className:"transition-colors hover:bg-slate-50 border-b border-gray-100",children:[(0,r.jsx)("td",{className:"px-[16px] py-[13px] align-middle",children:(0,r.jsx)("input",{type:"checkbox",className:"w-[16px] h-[16px] rounded border-gray-300 text-blue-600 focus:ring-blue-500 transition-all cursor-pointer"})}),ee.title&&(0,r.jsx)("td",{className:"px-[16px] py-[13px] align-middle truncate max-w-[200px]",children:(0,r.jsx)("span",{className:"font-semibold text-[#0f172a]",children:e.title})}),ee.description&&(0,r.jsx)("td",{className:"px-[16px] py-[13px] text-[#64748b] align-middle truncate max-w-[400px]",title:null===(t=e.description)||void 0===t?void 0:t.replace(/<[^>]+>/g,""),children:(null===(n=e.description)||void 0===n?void 0:n.replace(/<[^>]+>/g,""))||"No content"}),ee.created_at&&(0,r.jsx)("td",{className:"px-[16px] py-[13px] text-[#64748b] align-middle",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-[12.5px]",children:[(0,r.jsx)(_.Z,{size:13,className:"text-slate-300"}),new Date(e.created_at).toLocaleDateString()]})}),ee.action&&(0,r.jsx)("td",{className:"px-[16px] py-[13px] align-middle",children:(0,r.jsxs)("div",{className:"flex gap-1.5 justify-end",children:[(0,r.jsx)("button",{onClick:function(){p(!0),F(e.id),W(e.title),q(e.description)},className:"px-[12px] py-[5px] text-[12px] font-medium rounded-[6px] bg-white text-slate-600 border border-gray-200 hover:bg-gray-50 transition-colors",children:"Edit"}),(0,r.jsx)("button",{onClick:function(){return Y(e.id)},className:"px-[12px] py-[5px] text-[12px] font-medium rounded-[6px] bg-red-50 text-red-600 border border-red-200 hover:bg-red-100 transition-colors",children:"Delete"})]})})]},e.id)})),(null===k||void 0===k?void 0:k.length)>0&&k.length<6&&Array.from({length:6-k.length}).map((function(e,t){return(0,r.jsx)("tr",{className:"opacity-0 pointer-events-none",children:(0,r.jsx)("td",{colSpan:100,className:"px-[16px] py-[13px]",children:"\xa0"})},"filler-".concat(t))}))]})]}):!s&&(0,r.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center pb-10",children:[(0,r.jsx)("div",{className:"w-16 h-16 bg-slate-50 rounded-xl flex items-center justify-center mb-4 border border-slate-100",children:(0,r.jsx)(T.Z,{className:"w-8 h-8 text-slate-300"})}),(0,r.jsx)("h3",{className:"text-[15px] font-bold text-[#0f172a]",children:"No Updates Found"}),(0,r.jsx)("p",{className:"text-[12.5px] text-[#94a3b8] mt-1",children:"Keep your donors informed with regular campaign progress."})]})]}),e.count>0&&(0,r.jsxs)("div",{className:"px-[20px] py-[14px] border-t border-gray-100 flex items-center justify-between flex-wrap gap-2 bg-white z-10",children:[(0,r.jsxs)("span",{className:"text-[12.5px] text-slate-400 font-medium",children:["Showing ",6*(g-1)+1,"\u2013",Math.min(6*g,e.count)," of ",e.count]}),(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)("button",{disabled:g<=1,onClick:function(){return H(g-1)},className:"w-[32px] h-[32px] border border-gray-200 rounded-[8px] bg-white disabled:opacity-50 flex items-center justify-center text-slate-500 hover:bg-gray-50 transition-all font-bold",children:"\u2039"}),(0,r.jsx)("button",{className:"h-[32px] px-3 border border-blue-600 bg-blue-50 text-blue-600 rounded-[8px] text-[12.5px] font-bold transition-all",children:g}),(0,r.jsx)("button",{disabled:g>=ne||0===ne,onClick:function(){return H(g+1)},className:"w-[32px] h-[32px] border border-gray-200 rounded-[8px] bg-white disabled:opacity-50 flex items-center justify-center text-slate-500 hover:bg-gray-50 transition-all font-bold",children:"\u203a"})]})]})]}),(0,r.jsxs)(j.Z,{onClose:function(){return p(!1)},open:x,fullWidth:!0,maxWidth:"md",style:{zIndex:"1000"},children:[(0,r.jsx)(O,{onClose:function(){return p(!1)}
1,children:"Edit Campaign Update"}),(0,r.jsx)(I,{dividers:!0,children:(0,r.jsxs)("div",{className:"space-y-5 py-2",children:[(0,r.jsx)(Z.Z,{severity:"info",className:"rounded-xl",children:"This update will be visible to all visitors on your public campaign page."}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-slate-500 uppercase",children:"Update Title"}),(0,r.jsx)("input",{type:"text",className:"w-full p-2.5 border border-slate-200 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 transition-all outline-none",value:R,onChange:function(e){return W(e.target.value)},placeholder:"Give your update a clear title"})]}),(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("label",{className:"text-xs font-bold text-slate-500 uppercase",children:"Update Progress Story"}),(0,r.jsx)("div",{className:"border border-slate-200 rounded-xl overflow-hidden shadow-sm shadow-slate-100 transition-all focus-within:ring-2 focus-within:ring-blue-500",children:(0,r.jsx)(U,{name:"story",story:M,placeholder:"Share your progress, challenges, and successes with your community...",onChange:function(e){return q(e.target.value)}})})]}),(0,r.jsxs)("div",{className:"pt-4 flex justify-end gap-3",children:[(0,r.jsx)(y.Z,{variant:"text",onClick:function(){return p(!1)},className:"text-slate-500 font-semibold px-4",children:"Cancel"}),(0,r.jsx)(y.Z,{variant:"contained",color:"primary",className:"bg-blue-600 hover:bg-blue-700 text-white font-bold px-8 shadow-sm rounded-lg",disabled:!R||!M,onClick:J,children:"Save Changes"})]})]})})]})]})}},57069:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(85893),s=(n(67294),n(868));function a(e){var t=e.statSubtitle,n=e.statTitle,a=e.statIcon,i=e.statIconColor,l=e.statInfo;return(0,r.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 px-5 py-4 flex items-center gap-4 h-full min-h-[100px]",children:[(0,r.jsx)("div",{className:"w-[44px] h-[44px] rounded-[10px] flex items-center justify-center flex-shrink-0 "+i,children:(0,r.jsx)("div",{className:"w-[22px] h-[22px]",children:a})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[l?(0,r.jsx)(s.ZP,{title:"Note: These are indicative amount. Actual disbursement amount will depend on the currency conversion rate of that period.",children:(0,r.jsxs)("div",{className:"text-[11px] font-medium text-gray-400 uppercase tracking-[0.04em] mb-[4px]",children:[t," ",l]})}):(0,r.jsx)("div",{className:"text-[11px] font-medium text-gray-400 uppercase tracking-[0.04em] mb-[4px] leading-tight break-words",children:t}),(0,r.jsx)("div",{className:"text-[18px] sm:text-[20px] md:text-[22px] font-bold text-[#1a1a2e] leading-tight break-all max-w-full",children:n})]})]})}a.defaultProps={statSubtitle:"Traffic",statTitle:"0",statArrow:"up",statPercent:"3.48",statPercentColor:"text-emerald-500",statDescripiron:"Since last month",statIconName:"far fa-chart-bar",statIconColor:"bg-red-500"}},76406:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return w},default:function(){return N}});var r=n(85893),s=n(809),a=n.n(s),i=n(92447),l=n(64121),o=n(67294),c=n(9008),d=n(11163),u=n(34616),x=n(1474),p=n(58467),h=n(57069),m=n(57391),f=n(53219),b=n(34464),g=n(77705),v=n(13718),j=n(57420),y=n(51267),w=!0;function N(e){var t=(0,d.useRouter)(),n=o.useState({}),s=(0,l.Z)(n,2),x=(s[0],s[1]),w=o.useState(),N=(0,l.Z)(w,2),k=N[0],C=N[1],Z=o.useState(e.details.data),S=(0,l.Z)(Z,2),P=S[0],_=(S[1],o.useState([])),T=(0,l.Z)(_,2),D=T[0],z=T[1],E=t.query.slug;o.useEffect((function(){var e,n;x(null!==(e=localStorage)&&void 0!==e&&e.getItem("user")?JSON.parse(null===(n=localStorage)||void 0===n?void 0:n.getItem("user")):""),null==localStorage.getItem("token")?t.push("/auth/login"):(U(),I())}),[E]);var U=function(){var e=(0,i.Z)(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,m.C4)(P.id).then(function(){var e=(0,i.Z)(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:z(t.data);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=(0,i.Z)(a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,m.lJ)(P.id).then(function(){var e=(0,i.Z)(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:C(t.data);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.default,{children:(0,r.jsxs)("title",{children:[P.title," Updates"]})}),(0,r.jsx)("div",{className:"bg-white border-b border-gray-100",children:(0,r.jsxs)("div",{className:"px-6 py-3 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("span",{onClick:function(){return t.push("/campaigns")},className:"p-1.5 rounded-lg hover:bg-gray-100 transition-colors inline-flex cursor-pointer",children:(0,r.jsx)(f.Z,{className:"text-gray-400",size:18})}),(0,r.jsx)("h1",{className:"text-sm font-semibold text-gray-800",children:"Admin Campaign Upd
1ates"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-[11px] md:text-xs text-gray-400",children:[(0,r.jsxs)("span",{onClick:function(){return window.open("".concat("https://app.crowdera.com","/campaign/").concat(E),"_blank")},className:"flex items-center gap-1 cursor-pointer hover:text-blue-600 transition-colors mr-2",children:[(0,r.jsx)(b.Z,{size:12}),(0,r.jsx)("span",{children:"View Campaign"})]}),(0,r.jsx)("span",{onClick:function(){return t.push("/admin/dashboard")},className:"cursor-pointer hover:text-blue-600 transition-colors",children:"Dashboard"}),(0,r.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-300",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})}),(0,r.jsx)("span",{className:"text-gray-500",children:"Updates"})]})]})}),(0,r.jsx)("div",{className:"mx-auto px-6 py-6",children:(0,r.jsx)("div",{className:"mx-auto mb-5 w-full",children:(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[(0,r.jsx)(h.Z,{statSubtitle:"Total Updates",statTitle:null===D||void 0===D?void 0:D.length,statArrow:"up",statPercent:"0",statPercentColor:"text-emerald-500",statDescripiron:"Story milestones",statIcon:(0,r.jsx)(g.Z,{size:18}),statIconColor:"bg-blue-50 text-blue-600"}),(0,r.jsx)(h.Z,{statSubtitle:"Deleted",statTitle:null===k||void 0===k?void 0:k.removed,statArrow:"up",statPercent:"0",statPercentColor:"text-emerald-500",statDescripiron:"Updates removed",statIcon:(0,r.jsx)(v.Z,{size:18}),statIconColor:"bg-red-50 text-red-600"}),(0,r.jsx)(h.Z,{statSubtitle:"LIVE",statTitle:null===k||void 0===k?void 0:k.live,statArrow:"up",statPercent:"0",statPercentColor:"text-emerald-500",statDescripiron:"Active updates",statIcon:(0,r.jsx)(j.Z,{size:18}),statIconColor:"bg-pink-50 text-pink-600"}),(0,r.jsx)(h.Z,{statSubtitle:"Raised",statTitle:"".concat(P.currency_symbol," ").concat(P.raised),statArrow:"up",statPercent:"0",statPercentColor:"text-emerald-500",statDescripiron:"Financial progress",statIcon:(0,r.jsx)(y.Z,{size:18}),statIconColor:"bg-green-50 text-green-600"})]})})})}),(0,r.jsxs)("div",{className:"mx-auto w-full px-6",children:[(0,r.jsx)("div",{className:"mx-auto w-full min-h-[400px]",children:(0,r.jsx)("div",{className:"mb-5",children:(0,r.jsx)(p.Z,{updates:D,id:null===P||void 0===P?void 0:P.id,count:null===D||void 0===D?void 0:D.length})})}),(0,r.jsx)(u.Z,{})]})]})}N.layout=x.Z},83018:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/campaign/[slug]/updates",function(){return n(76406)}])},60306:function(e){"use strict";e.exports={i8:"5.0.5"}}},function(e){e.O(0,[49774,43972,16724,10834,52453,45113,76649,32467,29e3,52663,24921,48764,51598,868,18971,8501,16309,42238,13969,16681,36559,33254,92590,92888,40179],(function(){return t=83018,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.