PageSourceSearch

https://empresaexcelencia.cv/_next/static/chunks/pages/admin/conte…/[id]-ff6e4ab6f4020bbe.js

js empresaexcelencia.cv collected 2026-10-06 07:19:43 UTC 11,151 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8293],{56561:function(e,i,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/content-managment/testimonies-content/[id]",function(){return t(64587)}])},92288:function(e,i,t){"use strict";t.d(i,{Z:function(){return BlankWrapper}});var n=t(85893),l=t(80166);function BlankWrapper(e){let{title:i,children:t,show:s=!0,url:a}=e;return(0,n.jsxs)("div",{className:"flex flex-col max-w-screen-xl",children:[(0,n.jsx)("div",{className:"",children:(0,n.jsxs)("h1",{className:"titulo-pagina flex gap-[0.5rem] items-center",children:[i,(0,n.jsx)(l.Z,{url:a,show:s})]})}),(0,n.jsx)("hr",{className:"border-1 my-6 mt-1"}),(0,n.jsx)("div",{className:"-my-2 ",children:(0,n.jsx)("div",{className:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8",children:(0,n.jsx)("div",{className:"border-b border-gray-200 sm:rounded-lg",children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsx)("div",{className:"bg-white px-[1rem] sm:px-[3rem]",children:t})})})})})]})}},58346:function(e,i,t){"use strict";t.d(i,{Z:function(){return TestimonyForm}});var n=t(85893),l=t(42746),s=t(99971),a=t(15333),o=t(25675),r=t.n(o);function TestimonyForm(e){var i;let{handleSubmit:t,selectedOption:o,handleSelectChange:d,imageBlobUrl:u,uploadedFile:m,uploadedFileError:v,handleImageRemove:c,handleUploadButtonClick:p,fileInputRef:g,handleImageUpload:h,edit:y,isSL:x,set:f,payload:b,errors:D}=e,j=(0,l.useTranslations)("tables"),w=(0,l.useTranslations)("gallery"),N=(0,l.useTranslations)("buttons"),k=(0,l.useTranslations)("toast"),E=(0,l.useTranslations)("lang");return(0,n.jsx)("form",{onSubmit:t,className:"mt-[2rem]",children:(0,n.jsxs)("div",{className:"flex flex-col gap-3 pt-[1rem] ",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(a.II,{type:"text",onChange:f,label:j("name"),value:null==b?void 0:b.name,name:"name",twClass:"inputFormClass !border-[#ad8b19] md:!w-1/2"}),(null==D?void 0:D.name)&&(0,n.jsx)("span",{className:"error",children:null==D?void 0:D.name})]}),null==b?void 0:null===(i=b.testimonyDescriptions)||void 0===i?void 0:i.map((e,i)=>{var t,l,s,o,r,d,u,m;return(0,n.jsxs)("div",{className:"",children:[(0,n.jsx)("label",{className:"font-[700] text-[#2B434E]",htmlFor:e,children:E(null===(l=b.testimonyDescriptions)||void 0===l?void 0:null===(t=l[i])||void 0===t?void 0:t.typeLangDescription.toLowerCase())}),(0,n.jsx)("input",{readOnly:!0,type:"text",value:null===(o=b.testimonyDescriptions)||void 0===o?void 0:null===(s=o[i])||void 0===s?void 0:s.typeLangDescription,className:"information_input !p-[0rem] md:!p-[0.375rem] hidden"}),(0,n.jsx)(a.Kx,{type:"text",onChange:e=>f(e,i),label:j("description"),value:null===(d=b.testimonyDescriptions)||void 0===d?void 0:null===(r=d[i])||void 0===r?void 0:r.description,name:"description",twClass:"md:w-1/2 !border-[#AD8B19]",error:null===(m=D.testimonyDescriptions)||void 0===m?void 0:null===(u=m[i])||void 0===u?void 0:u.description})]},e.typeLangDescription)}),(0,n.jsx)("div",{className:"max-w-[6rem]",children:(0,n.jsxs)("select",{disabled:y,className:"information_input w-full",value:o,onChange:d,children:[(0,n.jsx)("option",{value:"IMAGE",children:w("pic")}),(0,n.jsx)("option",{value:"VIDEO",children:w("vid")})]})}),"VIDEO"===o&&(0,n.jsxs)("div",{children:[(0,n.jsx)(a.II,{type:"text",onChange:f,label:"Link",value:null==b?void 0:b.link,name:"link",twClass:"inputFormClass !border-[#ad8b19] md:!w-1/2"}),(null==D?void 0:D.link)&&(0,n.jsx)("span",{className:"error",children:null==D?void 0:D.link})]}),"IMAGE"===o&&(0,n.jsxs)("div",{className:"mt-[1rem] flex flex-col",children:[u&&(0,n.jsx)("div",{className:"ml-[0.3rem]",children:(0,n.jsx)(r(),{src:u,alt:"Uploaded Image",width:287,height:195,style:{width:"287px",height:"195px"}})}),(0,n.jsxs)("div",{className:"flex gap-2 my-[0.5rem] ml-[0.5rem] items-center font-[500]",children:[null!==m&&v&&v!==k("filePdf")&&(0,n.jsx)(r(),{width:13,height:16,src:"/eliminar.svg",alt:"SVG",className:"hover:cursor-pointer mt-[0.1rem]",onClick:c}),v&&(0,n.jsx)("p",{className:v===k("filePdf")?"text-red-500":"text-[#2B434E]",children:v})]}),(0,n.jsx)(s.z,{type:"button",action:p,name:N("uploadImage"),twClass:"!text-[#AD8B19] !bg-white !w-[18rem] !border !border-[#AD8B19] !text-base drop-shadow-xl"}),(0,n.jsx)("input",{type:"file",ref:g,style:{display:"none"},onChange:h})]}),(0,n.jsx)("div",{className:"p-2 md:p-4 md:justify-end flex",children:(0,n.jsx)(s.z,{loading:x,action:()=>{},name:N("save"),twClass:"!text-white !text-base drop-shadow-xl"})})]})})}},80166:function(e,i,t){"use strict";var n=t(85893),l=t(42746),s=t(25675),a=t.n(s),o=t(11163);
1i.Z=e=>{let{show:i,url:t}=e,s=(0,o.useRouter)(),r=(0,l.useTranslations)("buttons"),handleClick=()=>{t?s.replace(t):s.back()};return i?(0,n.jsx)("button",{onClick:()=>{handleClick()},className:"text-green-500 hover:text-green-700",title:r("return"),children:(0,n.jsx)(a(),{width:20,height:15,src:"/icon/redirectDark.svg",alt:"SVG",className:"!text-pink-500"})}):null}},64587:function(e,i,t){"use strict";t.r(i);var n=t(85893),l=t(58346),s=t(4023),a=t(30727),o=t(42746),r=t(11163),d=t(67294),u=t(22920),m=t(35773),v=t(87066),c=t(92288);i.default=()=>{let{token:e,APIURL:i}=(0,s.qD)(),t=(0,o.useTranslations)("titles"),p=(0,o.useTranslations)("toast"),g="/admin/content-managment/testimonies-content",h=(0,r.useRouter)(),[y,x]=(0,d.useState)({}),[f,b]=(0,d.useState)({}),D=["name","link"],j={description:p("mandatoryError"),link:p("mandatoryError"),name:p("mandatoryError")},w=(0,d.useMemo)(()=>new a.Z(i,e),[e,i]),[N,k]=(0,d.useState)(null),[E,S]=(0,d.useState)(""),[T,I]=(0,d.useState)(null),C=(0,d.useRef)(null),[A,M]=(0,d.useState)(!1),[O,L]=(0,d.useState)(""),[_,B]=(0,d.useState)("IMAGE"),handleVideoSubmission=(e,i)=>{0===Object.keys(i).length&&(null==w||w.updatObject(String(h.query.id),"testimonials",(0,m.sW)(y)).then(e=>{(0,u.Am)(p("updateDone")),h.replace(g)}).catch(i=>{var t,n,l,s,a,o,r,d,m;e.preventDefault(),M(!1),console.log("testimonyDataError",i),u.Am.error((null===(s=i.response)||void 0===s?void 0:null===(l=s.data)||void 0===l?void 0:null===(n=l.errorsDetails)||void 0===n?void 0:null===(t=n.debugMessage[0])||void 0===t?void 0:t.message)||(null===(r=i.response)||void 0===r?void 0:null===(o=r.data)||void 0===o?void 0:null===(a=o.errorsDetails)||void 0===a?void 0:a.debugMessage)||(null===(m=i.response)||void 0===m?void 0:null===(d=m.data)||void 0===d?void 0:d.message))}))},handleImageSubmission=(e,i)=>{0===Object.keys(i).length&&null===N&&(M(!0),null==w||w.updatObject(String(h.query.id),"testimonials",y).then(e=>{(0,u.Am)(p("updateDone")),h.replace(g)}).catch(i=>{var t,n,l,s,a,o,r,d,m;e.preventDefault(),M(!1),console.log("testimonialsDataError",i),u.Am.error((null===(s=i.response)||void 0===s?void 0:null===(l=s.data)||void 0===l?void 0:null===(n=l.errorsDetails)||void 0===n?void 0:null===(t=n.debugMessage[0])||void 0===t?void 0:t.message)||(null===(r=i.response)||void 0===r?void 0:null===(o=r.data)||void 0===o?void 0:null===(a=o.errorsDetails)||void 0===a?void 0:a.debugMessage)||(null===(m=i.response)||void 0===m?void 0:null===(d=m.data)||void 0===d?void 0:d.message))})),0===Object.keys(i).length&&null!==N&&(M(!0),null==w||w.updatObject(String(h.query.id),"testimonials",y).then(e=>{let i=new FormData;i.append("testimonyImage",N),null==w||w.uploadFormData(O,"testimonials",i,"f
1iles").then(e=>{M(!1),(0,u.Am)(p("updateDone")),h.replace(g)}).catch(e=>{var i,t,n,l,s,a,o,r,d;M(!1),u.Am.error((null===(l=e.response)||void 0===l?void 0:null===(n=l.data)||void 0===n?void 0:null===(t=n.errorsDetails)||void 0===t?void 0:null===(i=t.debugMessage[0])||void 0===i?void 0:i.message)||(null===(o=e.response)||void 0===o?void 0:null===(a=o.data)||void 0===a?void 0:null===(s=a.errorsDetails)||void 0===s?void 0:s.debugMessage)||(null===(d=e.response)||void 0===d?void 0:null===(r=d.data)||void 0===r?void 0:r.message))})}).catch(i=>{var t,n,l,s,a,o,r,d,m;e.preventDefault(),console.log("testimonialsDataError",i),u.Am.error((null===(s=i.response)||void 0===s?void 0:null===(l=s.data)||void 0===l?void 0:null===(n=l.errorsDetails)||void 0===n?void 0:null===(t=n.debugMessage[0])||void 0===t?void 0:t.message)||(null===(r=i.response)||void 0===r?void 0:null===(o=r.data)||void 0===o?void 0:null===(a=o.errorsDetails)||void 0===a?void 0:a.debugMessage)||(null===(m=i.response)||void 0===m?void 0:null===(d=m.data)||void 0===d?void 0:d.message))}))},handleSubmit=async e=>{e.preventDefault();let i={};for(let e of D)"string"==typeof y[e]&&""===y[e].trim()?i[e]=j[e]:delete j[e];b(i),"VIDEO"===_&&handleVideoSubmission(e,i),"IMAGE"===_&&handleImageSubmission(e,i)};return(0,d.useEffect)(()=>{null==w||w.getById(String(h.query.id),"testimonials").then(t=>{if("VIDEO"===t.data.typeTestimony&&(x({name:t.data.name,testimonyDescriptions:t.data.testimonyDescriptions.map(e=>({id:e.id||"",description:e.description||"",typeLangDescription:e.typeLangDescription||""})),link:t.data.link,typeTestimony:t.data.typeTestimony}),B(t.data.typeTestimony)),"IMAGE"===t.data.typeTestimony){var n,l;L(t.data.id);let s="".concat(i,"/testimonials/files/").concat(null==t?void 0:null===(l=t.data)||void 0===l?void 0:null===(n=l.testimonyImage)||void 0===n?void 0:n.id);v.Z.get(s,{responseType:"blob",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/octet-stream"}}).then(e=>{let i=new Blob([e.data],{type:"image/jpeg"}),t=window.URL.createObjectURL(i);I(t)}).catch(e=>{console.error("Error downloading file:",e)}),x({name:t.data.name,typeTestimony:t.data.typeTestimony,link:t.data.name,testimonyDescriptions:t.data.testimonyDescriptions.map(e=>({id:e.id||"",description:e.description||"",typeLangDescription:e.typeLangDescription||""}))}),B(t.data.typeTestimony)}}).catch(e=>{var i,t,n,l,s,a,o,r,d;console.log("testimonialsDataError",e),u.Am.error((null===(l=e.response)||void 0===l?void 0:null===(n=l.data)||void 0===n?void 0:null===(t=n.errorsDetails)||void 0===t?void 0:null===(i=t.debugMessage[0])||void 0===i?void 0:i.message)||(null===(o=e.response)||void 0===o?void 0:null===(a=o.data)||void 0===a?void 0:null===(s=a.errorsDetails)||void 0===s?void 0:s.debugMessage)||(null===(d=e.response)||void 0===d?void 0:null===(r=d.data)||void 0===r?void 0:r.message))})},[w,h.query.id]),(0,n.jsx)(c.Z,{title:t("editTestimony"),children:(0,n.jsx)(l.Z,{handleSubmit:handleSubmit,selectedOption:_,handleSelectChange:e=>{B(e.target.value),x(i=>((0,m.F1)(i,"typeTestimony",e.target.value),i))},imageBlobUrl:T,uploadedFile:N,uploadedFileError:E,handleImageRemove:e=>{e.preventDefault(),k(null),I(null),S("")},handleUploadButtonClick:()=>{C.current&&C.current.click()},fileInputRef:C,handleImageUpload:e=>{var i,t;if(e.preventDefault(),S(""),null==C?void 0:null===(t=C.current)||void 0===t?void 0:null===(i=t.files)||void 0===i?void 0:i.length){let e=C.current.files[0];k(e),S(e.name);let i=URL.createObjectURL(e);I(i)}},edit:!0,isSL:A,payload:y,set:(e,i)=>{let{name:t,value:n}=e.target;x(e=>{if(void 0===i)return{...e,[t]:n};{let l=e.testimonyDescriptions.map((e,l)=>l===i?{...e,[t]:n}:e);return{...e,testimonyDescriptions:l}}})},errors:f})})}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=56561)}),_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.