1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2725],{14664:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/settings/profile-backgrounds",function(){return t(10201)}])},10201:function(e,a,t){"use strict";t.r(a);var n=t(85893),i=t(67294),l=t(44389),r=t(49759),s=t(84858),d=t(32474);function c(e){let{item:a}=e;return(0,n.jsx)("span",{className:"block h-full w-full",style:"IMAGE"===a.kind?{backgroundImage:`url(${a.value})`,backgroundSize:"cover",backgroundPosition:"center"}:{background:a.value}})}a.default=function(){let{data:e,error:a,isLoading:t,mutate:o}=(0,l.u)("/api/admin/profile-backgrounds",e=>(0,s.SC)(e)),u=(0,i.useRef)(null),[x,g]=(0,i.useState)(""),[m,h]=(0,i.useState)("#0EA5A8"),[p,b]=(0,i.useState)("#0B4F6C"),[f,j]=(0,i.useState)(!1),[v,N]=(0,i.useState)(null),y=e||[],w=y.filter(e=>e.isActive).length;async function k(e){j(!0),N(null);try{let a=new FormData;a.append("image",e),x.trim()&&a.append("alt",x.trim()),await (0,s.SC)("/api/admin/profile-backgrounds",{method:"POST",body:a}),g(""),u.current&&(u.current.value=""),await o()}catch(e){N((null==e?void 0:e.message)||"Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û Ø§ÙØ¬Ø§Ù
ÙØ´Ø¯")}finally{j(!1)}}async function C(){j(!0),N(null);try{let e=`linear-gradient(135deg, ${m} 0%, ${p} 100%)`;await (0,s.SC)("/api/admin/profile-backgrounds/gradient",{method:"POST",body:JSON.stringify({value:e,alt:x.trim()||void 0})}),g(""),await o()}catch(e){N((null==e?void 0:e.message)||"Ø§ÙØ²ÙØ¯Ù Ø§ÙØ¬Ø§Ù
ÙØ´Ø¯")}finally{j(!1)}}async function E(e){await (0,s.SC)(`/api/admin/profile-backgrounds/${e.id}`,{method:"PATCH",body:JSON.stringify({isActive:!e.isActive})}),await o()}async function S(e){window.confirm("اÛÙ Ù¾Ø³âØ²Ù
ÛÙÙ ØØ°Ù Ø´ÙØ¯Ø")&&(await (0,s.SC)(`/api/admin/profile-backgrounds/${e.id}`,{method:"DELETE"}),await o())}return(0,n.jsxs)(r.Z,{title:"تصاÙÛØ± Ù¾Ø³âØ²Ù
ÛÙ٠پرÙÙØ§ÛÙ",children:[(0,n.jsxs)(d.Zb,{children:[(0,n.jsx)("p",{className:"text-14 leading-24 font-m text-black",children:"اÛÙ Ù¾Ø³âØ²Ù
ÛÙÙâÙØ§ کجا Ø¯ÛØ¯Ù Ù
ÛâØ´ÙÙØ¯"}),(0,n.jsx)("p",{className:"mt-4 text-12 leading-20 font-r text-gray-6C6A7D",children:"در ØµÙØÙâÛ Ø¬Ø²Ø¦ÛØ§Øª کاربر Ù¾Ù٠ادÙ
ÛÙØ پشت ÙØ¯Ø± پرÙÙØ§ÛÙ. ÛÚ© ادÙ
Û٠از اÛÙ ÙÙØ±Ø³Øª Ø¨Ø±Ø§Û ÙØ± کاربر ÛÚ©Û Ø±Ø§ Ø§ÙØªØ®Ø§Ø¨ Ù
ÛâÚ©ÙØ¯Ø رÙÛ ØØ³Ø§Ø¨ Ø®ÙØ¯Ù کاربر ÛØ§ Ø³Ø§ÛØª اصÙÛ Ø§Ø«Ø±Û ÙØ¯Ø§Ø±Ø¯."}),(0,n.jsxs)("div",{className:"mt-16 border-t-1 border-solid border-gray-F0F0F0 pt-16",children:[(0,n.jsx)(d.gN,{label:"عÙÙØ§Ù (Ø§Ø®ØªÛØ§Ø±Û)",className:"max-w-[260px] mb-12",children:(0,n.jsx)(d.II,{value:x,onChange:e=>g(e.target.value),placeholder:"Ù
Ø«ÙØ§Ù: اÙÛØ§ÙÙØ³Û"})}),(0,n.jsxs)("div",{className:"flex flex-wrap items-end gap-24",children:[(0,n.jsxs)("div",{className:"flex items-end gap-12",children:[(0,n.jsx)(d.gN,{label:"از رÙÚ¯",children:(0,n.jsx)("input",{type:"color",value:m,onChange:e=>h(e.target.value),className:"h-38 w-52 rounded-8 border border-gray-E5E5E6 cursor-pointer"})}),(0,n.jsx)(d.gN,{label:"ب٠رÙÚ¯",children:(0,n.jsx)("input",{type:"color",value:p,onChange:e=>b(e.target.value),className:"h-38 w-52 rounded-8 border border-gray-E5E5E6 cursor-pointer"})}),(0,n.jsx)("span",{className:"h-38 w-72 rounded-8 border border-gray-E5E5E6",style:{background:`linear-gradient(135deg, ${m} 0%, ${p} 100%)`}}),(0,n.jsx)(d.zx,{disabled:f,onClick:C,children:"Ø§ÙØ²ÙØ¯Ù Ú¯Ø±Ø§Ø¯ÛØ§Ù"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("input",{ref:u,type:"file",accept:"image/*",className:"hidden",onChange:e=>{var a;let t=null===(a=e.target.files)||void 0===a?void 0:a[0];t&&k(t)}}),(0,n.jsx)(d.zx,{variant:"secondary",disabled:f,onClick:()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.click()},children:f?"در ØØ§Ù بارگذارÛâ¦":"ÛØ§ Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û ØªØµÙÛØ±"})]})]})]}),v&&(0,n.jsx)("p",{className:"mt-12 text-12 leading-20 text-error",children:v})]}),(0,n.jsxs)(d.Zb,{className:"mt-16",children:[(0,n.jsxs)("div",{className:"mb-12 flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-14 leading-24 font-m text-black",children:"Ù¾Ø³âØ²Ù
ÛÙÙâÙØ§"}),(0,n.jsxs)(d.Ct,{children:[w," ÙØ¹Ø§Ù"]})]}),t?(0,n.jsx)(d.Od,{}):a?(0,n.jsx)(d.ub,{text:"ÙÙØ±Ø³Øª Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û ÙØ´Ø¯"}):0===y.length?(0,n.jsx)(d.ub,{text:"ÙÙÙØ² Ù¾Ø³âØ²Ù
ÛÙÙâØ§Û Ø§Ø¶Ø§ÙÙ ÙØ´Ø¯Ù"}):(0,n.jsx)("ul",{className:"flex flex-wrap gap-16",children:y.map(e=>(0,n.jsxs)("li",{className:"flex w-[150px] flex-col items-center gap-8 rounded-12 border-1 border-solid border-gray-F0F0F0 p-12",children:[(0,n.jsx)("span",{className:"overflow-hidden rounded-10",style:{height:64,width:102.4},children:(0,n.jsx)(c,{item:e})}),(0,n.jsx)("span",{className:"truncate text-11 leading-18 text-gray-6C6A7D",title:e.alt||"",children:e.alt||("GRADIENT"===e.kind?"Ú¯Ø±Ø§Ø¯ÛØ§Ù":"â")}),(0,n.jsx)(d.ZD,{checked:e.isActive,onChange:()=>void E(e)}),(0,n.jsx)("button",{type:"button",onClick:()=>void S(e),className:"text-11 leading-18 text-error hover:underline",children:"ØØ°Ù"})]},e.id))})]})]})}}},function(e){e.O(0,[4389,9759,9774,2888,179],function(){return e(e.s=14
1664)}),_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.