1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6458],{88090:function(e,t,n){"use strict";var r=n(67294),l=n(52091),i=n(2777),a=n(30080),s=n(37797),d=n(85893);t.Z=function(e){var t=e.initial,n=e.onSave,s=e.editable,c=void 0!==s&&s,u=e.onDelete,m=(0,r.useState)(t.question),x=m[0],f=m[1],p=(0,r.useState)(t.answer),h=p[0],v=p[1],g=(0,r.useState)(c),b=g[0],j=g[1],N=t.id,w="que_".concat(N),y="ans_".concat(N);return(0,d.jsxs)(o,{className:"w-full bg-white border border-[#C7C7C7] rounded-md actions flex flex-col gap-4 p-4",children:[b?(0,d.jsxs)(r.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"font-semibold text-sm",htmlFor:w,children:"Question"}),(0,d.jsx)("textarea",{className:"w-full border border-[#d1d1d1] px-3 py-1.5 rounded-md",value:x,name:w,id:w,onChange:function(e){return f(e.target.value)}})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"font-semibold text-sm",htmlFor:y,children:"Answer"}),(0,d.jsx)("textarea",{className:"w-full border border-[#d1d1d1] px-3 py-1.5 rounded-md",value:h,name:y,id:y,onChange:function(e){return v(e.target.value)}})]})]}):(0,d.jsxs)(r.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"font-semibold text-sm",children:"Question"}),(0,d.jsx)("div",{className:"w-full bg-zinc-100 px-3 py-1.5 rounded-md min-h-[38px]",children:x})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"font-semibold text-sm",children:"Answer"}),(0,d.jsx)("div",{className:"w-full bg-zinc-100 px-3 py-1.5 rounded-md min-h-[38px]",children:h})]})]}),(0,d.jsxs)("div",{className:"flex justify-end gap-4",children:[(0,d.jsx)("button",{className:"border border-rose-600 bg-rose-500 hover:bg-rose-600 active:bg-rose-700 text-white px-3 py-2 rounded-md text-xs",onClick:function(){u(N)},children:(0,d.jsx)(l.AMf,{})}),b?(0,d.jsx)("button",{className:"border border-green-600 bg-green-500 hover:bg-green-600 active:bg-green-700 text-white px-3 py-2 rounded-md text-xs",onClick:function(){n({id:N,question:x,answer:h}),j(!1)},children:(0,d.jsx)(i.UgA,{})}):(0,d.jsx)("button",{className:"border border-sky-600 bg-sky-500 hover:bg-sky-600 active:bg-sky-700 text-white px-3 py-2 rounded-md text-xs",onClick:function(){j(!0)},children:(0,d.jsx)(a.zmo,{})})]})]})};var o=s.ZP.div.withConfig({displayName:"FaqInput__Container",componentId:"sc-139vo4s-0"})([""])},6656:function(e,t,n){"use strict";var r=n(90116),l=n(86010),i=n(67294),a=n(86501),s=n(2777),d=n(37797),o=n(85893),c=(0,i.forwardRef)((function(e,t){var n=e.multiple,d=void 0!==n&&n,c=e.label,m=e.placeholder,x=e.accept,f=e.id,p=e.containerClassName,h=e.maxFiles,v=void 0===h?3:h,g=(0,i.useState)([]),b=g[0],j=g[1],N=function(){j([])};return(0,i.useImperativeHandle)(t,(function(){return{files:b,reset:N}}),[b]),(0,o.jsxs)(u,{className:(0,l.Z)(p),children:[(0,o.jsx)("label",{htmlFor:f,className:"text-sm font-semibold mb-2 block",children:c}),(0,o.jsxs)("label",{htmlFor:f,className:"flex justify-between items-center outline-none border border-slate-300 p-2 rounded-md w-full gap-4",children:[(0,o.jsx)("span",{className:"whitespace-nowrap w-full overflow-hidden text-ellipsis",children:m}),(0,o.jsx)(s.Yjd,{})]}),(0,o.jsx)("input",{onClick:function(e){e.target.value=null},onChange:function(e){var t,n=null!==(t=e.target.files)&&void 0!==t?t:[],l=[].concat((0,r.Z)(b),(0,r.Z)(n));l.length>v?(0,a.Am)("Unable to attach more than ".concat(v," files.")):j(l)},multiple:d,className:"absolute left-[-1000vw]",type:"file",name:f,id:f,accept:x}),(0,o.jsx)("ul",{className:"flex flex-col gap-3 mt-4",children:b.map((function(e,t){var n;return(0,o.jsxs)("li",{onClick:function(){j((function(e){for(var n=[],r=0;r<e.length;r++)t!==r&&n.push(e[r]);return n}))},className:"bg-slate-50 border border-slate-300 p-2 rounded-md text-sm text-slate-600 flex items-center justify-between gap-4",children:[(0,o.jsx)("div",{className:"flex-1 whitespace-nowrap overflow-hidden text-ellipsis",children:null!==(n=null===e||void 0===e?void 0:e.name)&&void 0!==n?n:"File"}),(0,o.jsx)(s.Ybf,{className:"text-red-500"})]},t)}))})]})}));c.displayName="FileSelect",t.Z=c;var u=d.ZP.div.withConfig({displayName:"FileSelect__Container",componentId:"sc-1tqvvkf-0"})([""])},53119:function(e,t,n){"use strict";n(67294);var r=n(85893);t.Z=function(e){var t=e.children,n=e.className,l=void 0===n?"":n,i=e.style;return(0,r.jsx)("div",{style:i,className:"flex flex-col min-h-screen ".concat(l),children:t})}},65098:function(e,t,n){"use strict";n.d(t,{_:function(){return r.Z},J:function(){return a}});var r=n(53119),l=n(86010),i=(n(67294),n(85893)),a=function(e){var t=e.children,n=e.className,r=e.wrapperClassName;return(0,i.jsx)("div",{className:(0,l.Z)("flex-1 flex flex-col items-center",n),children:(0,i.jsx)("div",{className:(0,l.Z)("w-full max-w-5xl",r),children:t})})}},83146:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return Z}});var r,l=n(90116),i=n(4730),a=n(50029),s=n(87794),d=n.n(s),o=n(67294),c=n(90918),u=n(86501),m=n(47497),x=n(65098),f=n(9669),p=n.n(f),h=n(11163),v=n(6656),g=n(11047),b=n(96486),j=n(58003),N=n(9008),w=n(88090),y=n(25934),C=n(85893),k=["_new_"];!function(e){e.New="n",e.Edit="e"}(r||(r={}));var _=function(e){return e.map((function(e){return{id:(0,b.uniqueId)("file"),file:e,uploaded:!1,error:!1,url:""}}))},S=[{id:1,name:"Vipin Sharma",image:"https://media.shuru.co.in/input/5970def1188
114a6eb43d7d185d7e5dfefaa347e7-300x300.webp"},{id:2,name:"Chandni",image:"https://media.shuru.co.in/input/1682766997644.webp"},{id:3,name:"Niranjan",image:"https://media.shuru.co.in/input/1681713986224.webp"},{id:4,name:"Neeraj Chaudhary",image:"https://media.shuru.co.in/input/1703662457709.webp"},{id:5,name:"Palak Rohra",image:"https://media.shuru.co.in/input/1741339429311_72864.jpg"},{id:6,name:"Mahima Soni",image:"https://media.shuru.co.in/input/1745808433737_988605.jpeg"}],F=[j.K.Blog,j.K.News],Z=!0;t.default=function(e){var t,n,s,f,b,Z,I,A,z,D,T,q,P,U,R=e.data,B=e.mode,E=(0,o.useRef)(null),K=(0,o.useState)(null!==(t=null===R||void 0===R?void 0:R.seoTitle)&&void 0!==t?t:""),M=K[0],Q=K[1],O=(0,o.useState)(null!==(n=null===R||void 0===R?void 0:R.seoMetaDescription)&&void 0!==n?n:""),J=O[0],V=O[1],X=(0,h.useRouter)(),Y=(0,o.useState)(null!==(s=null===R||void 0===R?void 0:R.title)&&void 0!==s?s:""),$=Y[0],G=Y[1],H=(0,o.useState)(null!==(f=null===R||void 0===R?void 0:R.slug)&&void 0!==f?f:""),L=H[0],W=H[1],ee=(0,o.useState)(null!==(b=null===R||void 0===R?void 0:R.coverImageDesc)&&void 0!==b?b:""),te=ee[0],ne=ee[1],re=(0,o.useState)(null===(Z=null===R||void 0===R?void 0:R.active)||void 0===Z||Z),le=re[0],ie=re[1],ae=(0,o.useState)(null!==(I=null===R||void 0===R?void 0:R.redirect)&&void 0!==I&&I),se=ae[0],de=ae[1],oe=(0,o.useState)(null!==(A=null===R||void 0===R?void 0:R.redirectUrl)&&void 0!==A?A:""),ce=oe[0],ue=oe[1],me=(0,o.useState)(null!==(z=null===R||void 0===R?void 0:R.coverImageUrl)&&void 0!==z?z:""),xe=me[0],fe=me[1],pe=(0,o.useState)(!1),he=pe[0],ve=pe[1],ge=(0,o.useRef)(null),be=(0,o.useState)(null!==(D=null===R||void 0===R?void 0:R.faqs)&&void 0!==D?D:[]),je=be[0],Ne=be[1],we=(0,o.useState)(null!==(T=null===R||void 0===R?void 0:R.authorName)&&void 0!==T?T:S[0].name),ye=we[0],Ce=we[1],ke=(0,o.useState)(null!==(q=null===R||void 0===R?void 0:R.authorImage)&&void 0!==q?q:S[0].image),_e=ke[0],Se=ke[1],Fe=(0,o.useState)(null!==(P=null===R||void 0===R?void 0:R.tag)&&void 0!==P?P:j.K.Blog),Ze=Fe[0],Ie=Fe[1],Ae=(0,o.useState)(null!==(U=null===R||void 0===R?void 0:R.redirectFrom)&&void 0!==U?U:""),ze=Ae[0],De=Ae[1],Te=(0,o.useState)(),qe=(Te[0],Te[1]),Pe=(0,o.useRef)([]),Ue=function(){var e=(0,a.Z)(d().mark((function e(){var t,n,r,l,a,s;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E.current){e.next=2;break}return e.abrupt("return");case 2:if(L){e.next=5;break}return u.Am.error("Please add slug."),e.abrupt("return");case 5:return r=E.current.getContent(),l={_id:null!==(t=null===R||void 0===R?void 0:R._id)&&void 0!==t?t:"",title:$,slug:L,coverImageDesc:te,active:le,redirect:se,redirectUrl:ce,coverImageUrl:xe,authorName:ye,tag:Ze,authorImage:_e.replace("media.shuru.co.in","media.shuru.co.in"),content:r,seoTitle:M,seoMetaDescription:J,redirectFrom:ze,created:null!==(n=null===R||void 0===R?void 0:R.created)&&void 0!==n?n:(new Date).getTime(),updated:(new Date).getTime(),faqs:je.map((function(e){e._new_;return(0,i.Z)(e,k)}))},a={data:l},e.prev=8,e.next=11,p().post("/api/dynamicblog/update",a);case 11:200===(s=e.sent).status?(u.Am.success("Task completed successfully"),X.push("/internal/dynamic-blogs")):(u.Am.error("Some error occured. Please check logs."),console.error(s)),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(8),u.Am.error("Some error occured. Please check logs."),console.error(e.t0);case 19:case"end":return e.stop()}}),e,null,[[8,15]])})));return function(){return e.apply(this,arguments)}}(),Re=function(){var e=(0,a.Z)(d().mark((function e(){var t,n,r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!he){e.next=2;break}return e.abrupt("return");case 2:if(null!==(n=null===(t=ge.current)||void 0===t?void 0:t.files)&&void 0!==n&&n.length){e.next=6;break}return u.Am.error("Please select files before uploading"),e.abrupt("return");case 6:r=_(n),qe(r),Pe.current=r,Be(r);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Be=function(){var e=(0,a.Z)(d().mark((function e(t){var n,r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(ve(!0),n=function(e){var n=t[e];g.C.uploadFile(n.file).then((function(e){var r=(0,l.Z)(t),i=r.find((function(e){return e.id===n.id}));i&&(i.uploaded=!0,i.error=!1,i.url=e,fe(e),qe((0,l.Z)(r)))})).finally((function(){ve(!1)}))},r=0;r<t.length;r++)n(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}
1(),Ee=function(e){var t=je.findIndex((function(t){return t.id===e.id}));if(!(t<0)){var n=(0,l.Z)(je);n[t]=e,Ne((0,l.Z)(n))}},Ke=function(e){confirm("Are you sure?")&&Ne((0,l.Z)(je.filter((function(t){return t.id!==e}))))};return(0,C.jsxs)(x._,{children:[(0,C.jsx)(N.default,{children:(0,C.jsx)("title",{children:"Editor - Dynamic Blogs"})}),(0,C.jsx)(m.h4,{}),(0,C.jsx)(x.J,{className:"bg-gray-100 py-4",children:(0,C.jsxs)("div",{className:"card bg-white-200 py-4",children:[(0,C.jsxs)("main",{className:"mb-4 flex w-full flex-col justify-between gap-4 rounded-md border border-[#C7C7C7] bg-white p-4",children:[(0,C.jsx)("h1",{className:"text-xl font-bold",children:"Blog: Page Information"}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"title",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Title"}),(0,C.jsx)("input",{className:"flex-[9] rounded-md border border-[#d1d1d1] px-3 py-1.5",id:"title",type:"text",value:$,onChange:function(e){return G(e.target.value)}})]}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"slug",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Slug"}),(0,C.jsxs)("div",{className:"flex flex-[9] shrink-0 gap-2",children:[(0,C.jsx)("input",{className:"flex-1 rounded-md border border-[#d1d1d1] px-3 py-1.5",id:"slug",type:"text",value:L,onChange:function(e){return W(e.target.value)}}),(0,C.jsx)("button",{className:"min-w-[100px] rounded-md border border-green-600 bg-green-500 px-3 py-2 text-xs text-white hover:bg-green-600 active:bg-green-700",onClick:function(){W($.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,""))},children:"Generate"})]})]}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"authorName",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Author"}),(0,C.jsx)("select",{value:ye,name:"authorName",id:"authorName",className:"flex-[9] rounded-md border border-[#d1d1d1] px-3 py-1.5",onChange:function(e){var t=S.find((function(t){return t.name===e.target.value}));t&&(Ce(t.name),Se(t.image))},children:S.map((function(e){return(0,C.jsx)("option",{value:e.name,children:e.name},e.id)}))})]}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"authorName",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Tag"}),(0,C.jsx)("select",{value:Ze,name:"tag",id:"tag",className:"flex-[9] rounded-md border border-[#d1d1d1] px-3 py-1.5",onChange:function(e){Ie(e.target.value)},children:F.map((function(e){return(0,C.jsx)("option",{value:e,children:e},e)}))})]}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"title",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Redirect From"}),(0,C.jsx)("input",{className:"flex-[9] rounded-md border border-[#d1d1d1] px-3 py-1.5",id:"redirectFrom",type:"text",value:ze,onChange:function(e){return De(e.target.value)}})]}),(0,C.jsxs)("div",{className:"field flex flex-col items-start gap-2",children:[(0,C.jsx)(v.Z,{ref:ge,id:"coverImage",multiple:!1,maxFiles:1,label:"Cover Image",placeholder:"Select Cover Image"}),xe.length>0?(0,C.jsx)("img",{src:xe,className:"my-4 aspect-video max-h-[300px] w-full object-contain",alt:""}):null,(0,C.jsxs)("div",{className:"flex gap-4",children:[(0,C.jsx)("button",{onClick:function(){var e;null===(e=ge.current)||void 0===e||e.reset(),qe([]),Pe.current=[],fe("")},className:"w-full max-w-[120px] rounded-md bg-red-400 p-3 text-white",children:"Reset"}),(0,C.jsx)("button",{onClick:Re,disabled:he,className:"w-full max-w-[120px] rounded-md bg-green-500 p-3 text-white",children:"Upload"})]})]}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"coverImageDesc",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Cover Image Description"}),(0,C.jsx)("input",{className:"flex-[9] rounded-md border border-[#d1d1d1] px-3 py-1.5",id:"coverImageDesc",type:"text",value:te,onChange:function(e){return ne(e.target.value)}})]}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"active",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Active"}),(0,C.jsx)("div",{className:"flex-[9]",children:(0,C.jsx)("input",{className:"rounded-md border border-[#d1d1d1] px-3 py-1.5",id:"active",type:"checkbox",checked:le,onChange:function(e){return ie(e.target.checked)}})})]}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"redirect",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Redirect"}),(0,C.jsx)("div",{className:"flex-[9]",children:(0,C.jsx)("input",{className:"rounded-md border border-[#d1d1d1] px-3 py-1.5",id:"redirect",type:"checkbox",checked:se,onChange:function(e){return de(e.target.checked)}})})]}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"redirectUrl",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Redirect Url"}),(0,C.jsx)("input",{className:"flex-[9] rounded-md border border-[#d1d1d1] px-3 py-1.5",id:"redirectUrl",type:"text",value:ce,onChange:function(e){return ue(e.target.value)}})]})]}),(0,C.jsxs)("section",{className:"mb-4 flex w-full flex-col justify-between gap-4 roun
1ded-md border border-[#C7C7C7] bg-white p-4",children:[(0,C.jsx)("h1",{className:"text-xl font-bold",children:"Blog: SEO Information"}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"seoTitle",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Tab Title (Seo)"}),(0,C.jsx)("input",{className:"flex-[9] rounded-md border border-[#d1d1d1] px-3 py-1.5",id:"seoTitle",type:"text",value:M,onChange:function(e){return Q(e.target.value)}})]}),(0,C.jsxs)("div",{className:"field flex items-center gap-2",children:[(0,C.jsx)("label",{htmlFor:"seoDescription",className:"flex-[3] text-sm font-bold text-zinc-700",children:"Description (Seo)"}),(0,C.jsx)("textarea",{className:"flex-[9] rounded-md border border-[#d1d1d1] px-3 py-1.5",id:"seoDescription",value:J,onChange:function(e){return V(e.target.value)}})]})]}),(0,C.jsx)("div",{className:"h-[800px] flex-shrink-0",children:(0,C.jsx)(c.M,{apiKey:"mk7q0l6lnxglnpmgk2yo2rc018mfsamgq07u5dfzlowafdf7",onInit:function(e,t){E.current=t},initialValue:(null===R||void 0===R?void 0:R.content)||"",init:{branding:!1,height:"100%",menubar:!0,plugins:"print preview paste searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern",toolbar:"pre | h1 | h2 | h3 | formatselect | bold italic underline strikethrough | forecolor backcolor blockquote | link image media | alignleft aligncenter alignright al
1ignjustify | numlist bullist outdent indent | removeformat | code",image_advtab:!0,setup:function(e){e.ui.registry.addButton("pre",{icon:"code",tooltip:"Preformatted text",onAction:function(){var t="<pre>"+e.selection.getContent({format:"text"})+"</pre>";e.insertContent(t)}})}}})}),(0,C.jsxs)("div",{className:"mt-8",children:[(0,C.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-4",children:[(0,C.jsx)("h3",{className:"mb-2 font-semibold",children:"FAQ"}),(0,C.jsx)("button",{className:"min-w-[100px] rounded-md border border-violet-600 bg-violet-500 px-3 py-2 text-xs text-white hover:bg-violet-600 active:bg-violet-700",onClick:function(){Ne([].concat((0,l.Z)(je),[{id:(0,y.Z)(),question:"",answer:"",_new_:!0}]))},children:"Add FAQ"})]}),(0,C.jsx)("div",{className:"flex w-full flex-col gap-4",children:je.map((function(e){return(0,C.jsx)(w.Z,{onSave:Ee,initial:e,editable:e._new_,onDelete:Ke},e.id)}))})]}),(0,C.jsx)("div",{className:"actions mt-4 flex w-full items-center justify-end gap-4 rounded-md border border-[#C7C7C7] bg-white p-4",children:B===r.New?(0,C.jsx)("button",{className:"min-w-[100px] rounded-md border border-green-600 bg-green-500 px-3 py-2 text-xs text-white hover:bg-green-600 active:bg-green-700",onClick:Ue,children:"Save"}):(0,C.jsx)("button",{className:"min-w-[100px] rounded-md border border-green-600 bg-green-500 px-3 py-2 text-xs text-white hover:bg-green-600 active:bg-green-700",onClick:Ue,children:"Update"})})]})}),(0,C.jsx)(m.$_,{})]})}},58003:function(e,t,n){"use strict";var r;n.d(t,{K:function(){return r}}),function(e){e.Blog="Blog",e.News="News"}(r||(r={}))},67469:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/internal/dynamic-blogs/editor",function(){return n(83146)}])}},function(e){e.O(0,[3662,918,9774,2888,179],(function(){return t=67469,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.