1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[473],{1656:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cpanel/gallery/add",function(){return n(7592)}])},8329:function(e,t,n){"use strict";var i=n(5893),l=n(1238);let a=e=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Z,{active:e.active}),(0,i.jsx)("div",{className:"min-h-screen bg-pale-50 py-20",children:e.children})]});t.Z=a},1238:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var i=n(5893),l=n(1163),a=n(7218),r=n(7294),s=n(1955);let o=()=>{s.Z.remove("token"),window.location.replace("/cpanel/login")},c=e=>{let{active:t}=e,[n,s]=(0,r.useState)(!1),c=[{title:"Admin Home",link:"/cpanel"},{title:"Products",link:"/cpanel/products"},{title:"\uD83D\uDD0C Logout",link:"logout"}],u=(0,l.useRouter)();return(0,r.useEffect)(()=>{},[]),(0,i.jsxs)("section",{id:"nav",children:[(0,i.jsxs)("nav",{className:"px-10 lg:px-32 py-4 flex justify-between items-center fixed z-40 w-full bg-white shadow-sm",children:[(0,i.jsx)("img",{src:"/img/top.png",className:"h-16 lg:h-20",alt:"",onClick:()=>u.push("/")}),(0,i.jsx)("div",{className:"lg:flex hidden",children:c.map((e,n)=>(0,i.jsx)("a",{className:t==e.title?"menu-item font-bold text-ilaj-600 hover:text-ilaj-600":"menu-item hover:text-ilaj-600",href:e.link,onClick:t=>{t.preventDefault(),"logout"==e.link?o():u.push(e.link)},children:e.title},n))})]}),n&&(0,i.jsxs)("div",{className:"fixed lg:hidden top-0 right-0 bottom-0 z-40 bg-white shadow-2xl w-8/12 ","data-aos":"fade-left",children:[(0,i.jsx)("div",{className:"my-20 mx-6"}),c.map((e,t)=>(0,i.jsxs)("a",{className:"px-8 py-3 hover:bg-gray-200 font-bold flex items-center hover:pl-10 hover:text-ilaj-600 transition-all duration-300",href:e.link,onClick:t=>{t.preventDefault(),"logout"==e.link?o():u.push(e.link)},children:[(0,i.jsx)("img",{src:"/img/icon.png",className:"w-4 mr-3",alt:""}),e.title]},t))]}),(0,i.jsx)("div",{className:"fixed right-6 top-3 lg:hidden",style:{zIndex:100},children:(0,i.jsx)(a.ZP,{toggled:n,toggle:s})}),(0,i.jsx)("div",{className:"py-8"}),n&&(0,i.jsx)("div",{className:"bg-black bg-opacity-70 fixed w-full h-full z-30",onClick:()=>s(!1)})]})};var u=c},3184:function(e,t,n){"use strict";n.d(t,{$h:function(){return i},aA:function(){return r},mY:function(){return l},t4:function(){return a}});let i="c24106bb093954188b2883e807d3bd8040cb96a9",l="https://api.ilajherbals.com",a="https://api.ilajherbals.com/uploads/",r=["ARISHTAM","ASAVAM","CHOORNAMS","GULIKAS","KASHAYAMS","LEHAMS","GHRUTHAMS","MEDICATED OILS AVARTHIS","SEVYAM/ANUVASANA THAILAMS","THAILAMS","KERA THAILAMS","KUZHAMBU","LEPAMS","RASAKRIYAS","BULK PACKING","OTHERS","PROPRIETERY MEDICINES"]},7592:function(e,t,n){"use strict";n.r(t);var i=n(5893),l=n(7294),a=n(594),r=n(1163),s=n(9008),o=n.n(s),c=n(3184),u=n(8329);let d=()=>{let[e,t]=(0,l.useState)(""),[n,s]=(0,l.useState)(null),[d,p]=(0,l.useState)(null),[h,m]=(0,l.useState)(!1),f=(0,r.useRouter)();async function x(){let t="".concat(c.mY,"/gallery/upload.php"),i=new FormData;return i.append("api",c.$h),i.append("file",n),i.append("title",e),await a.Z.post(t,i,{headers:{"content-type":"multipart/form-data"}})}return(0,i.jsxs)(u.Z,{title:"New Photo",label:"Photo",children:[(0,i.jsx)(o(),{children:(0,i.jsx)("title",{children:"New Photo | Ilaj Herbals"})}),d&&(0,i.jsx)("div",{className:"bg-red-200 text-red-700 px-3 py-2 mb-3 rounded",children:d}),(0,i.jsx)("h4",{className:"text-ilaj-500 mb-2",children:"Image Title"}),(0,i.jsx)("input",{type:"text",onChange:e=>{t(e.target.value)},className:"w-full input input-bordered ",placeholder:"Title"}),(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)("h4",{className:"text-ilaj-500 mb-2",children:"Select Photo"}),(0,i.jsx)("input",{type:"file",className:"input input-bordered w-full py-3",placeholder:"Photo",onChange:e=>s(e.target.files[0]),accept:"image/jpeg,image/png"}),(0,i.jsx)("span",{className:"text-red-600 text-sm pt-1 inline-block",children:"Upload compressed images to optimize page loading time."}),(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)("div",{className:"flex justify-end",children:(0,i.jsx)("button",{className:"bg-ilaj-500 hover:bg-ilaj-700 text-white px-6 py-3 rounded mt-3",onClick:()=>void(null!=e&&null!=n?(p(null),m(!0),x().then(e=>{"success"==e.data.status?(m(!1),f.push("/cpanel/gallery")):p("Something went wrong. Please try again later.")})):null==e?p("Please fill all the fields"):p("Please upload the file.")),children:h?(0,i.jsx)("span",{children:(0,i.jsx)("img",{src:"/img/loading.gif",className:"mx-4",style:{height:"30px"},alt:""})}):(0,i.jsx)("span",{children:"Upload Photo"})})})]})};t.default=d},1955:function(e,t){"use strict";/*! js-cookie v3.0.1 | MIT */function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}
1var i=function e(t,i){function l(e,l,a){if("undefined"!=typeof document){"number"==typeof(a=n({},i,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var r="";for(var s in a)a[s]&&(r+="; "+s,!0!==a[s]&&(r+="="+a[s].split(";")[0]));return document.cookie=e+"="+t.write(l,e)+r}}return Object.create({set:l,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],i={},l=0;l<n.length;l++){var a=n[l].split("="),r=a.slice(1).join("=");try{var s=decodeURIComponent(a[0]);if(i[s]=t.read(r,s),e===s)break}catch(e){}}return e?i[e]:i}},remove:function(e,t){l(e,"",n({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,n({},this.attributes,t))},withConverter:function(t){return e(n({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});t.Z=i}},function(e){e.O(0,[231,774,888,179],function(){return e(e.s=1656)}),_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.