1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[577],{29217:function(e,a,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/settings",function(){return n(75256)}])},75256:function(e,a,n){"use strict";n.r(a),n.d(a,{default:function(){return p}});var t=n(85893),l=n(67294),s=n(41664),i=n.n(s),r=n(44389),c=n(49759),d=n(84858),o=n(32474);let x=[{key:"amenities",label:"اÙ
Ú©Ø§ÙØ§Øª"},{key:"rules",label:"ÙÙØ§ÙÛÙ Ù Ù
ÙØ±Ø±Ø§Øª"},{key:"peak",label:"Ø±ÙØ²ÙØ§Û Ù¾ÛÚ©"}],m=[{value:"",label:"ÙÙ
Ù ÙÙØ¹ Ø§ÙØ§Ù
تگاÙ"},{value:"BOOMGARDI",label:"ÙÙØ· اتاÙâÙØ§Û بÙÙ
âگردÛ"},{value:"SUIT",label:"ÙÙØ· ÙÛÙØ§ Ù Ø³ÙØ¦Ûت"},{value:"HOTEL",label:"ÙÙØ· ÙØªÙ"}],h={BOOMGARDI:"بÙÙ
âگردÛ",SUIT:"ÙÛÙØ§/Ø³ÙØ¦Ûت",HOTEL:"ÙØªÙ"},g=[{value:"SWITCH",label:"Ú©ÙÛØ¯ (دارد / ÙØ¯Ø§Ø±Ø¯)"},{value:"DROPDOWN",label:"ÙÛØ³Øª Ú©Ø´ÙÛÛ"},{value:"TEXT",label:"Ù
ت٠آزاد"},{value:"CHECKBOX",label:"ÚÚ©âØ¨Ø§Ú©Ø³"}];function p(){let[e,a]=(0,l.useState)("amenities");return(0,t.jsxs)(c.Z,{title:"ØªÙØ¸ÛÙ
ات",breadcrumb:(0,t.jsx)(i(),{href:"/admin",children:"Ø¯Ø§Ø´Ø¨ÙØ±Ø¯"}),toolbar:(0,t.jsxs)(o.Zb,{className:"px-8 py-6 flex items-center gap-x-4 overflow-x-auto",children:[x.map(n=>(0,t.jsx)("button",{onClick:()=>a(n.key),"aria-pressed":e===n.key,className:`px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap transition ${e===n.key?"bg-primary-main text-white":"text-gray-6C6A7D hover:bg-gray-F0F0F0"}`,children:n.label},n.key)),(0,t.jsx)(i(),{href:"/admin/settings/reservations",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"ØªÙØ¸ÛÙ
ات Ø±Ø²Ø±ÙØ§Ø³ÛÙÙ"}),(0,t.jsx)(i(),{href:"/admin/settings/payments",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"Ø±ÙØ´âÙØ§Û پرداخت"}),(0,t.jsx)(i(),{href:"/admin/settings/locations",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"دستÙâØ¨ÙØ¯Û Ù
کاÙâÙØ§"}),(0,t.jsx)(i(),{href:"/admin/settings/announcements",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"Ø§Ø·ÙØ§Ø¹ÛÙâÙØ§"}),(0,t.jsx)(i(),{href:"/admin/settings/attractions",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"جاذبÙâÙØ§Û گردشگرÛ"}),(0,t.jsx)(i(),{href:"/admin/settings/tags",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"تگâÙØ§Û سئÙ"}),(0,t.jsx)(i(),{href:"/admin/settings/sitemap",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"sitemap Ù robots"}),(0,t.jsx)(i(),{href:"/admin/settings/faqs",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"Ø³ÙØ§Ùات Ù
تداÙÙ"}),(0,t.jsx)(i(),{href:"/admin/settings/home",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"ØµÙØÙ Ø§ØµÙÛ"}),(0,t.jsx)(i(),{href:"/admin/settings/day-control",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"Ú©ÙØªØ±Ù Ø±ÙØ²Ùا"}),(0,t.jsx)(i(),{href:"/admin/settings/booking-mode",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"ØØ§Ùت رزرÙ"}),(0,t.jsx)(i(),{href:"/admin/settings/fallback-avatars",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"تصاÙÛØ± جاÛگزÛ٠پرÙÙØ§ÛÙ"}),(0,t.jsx)(i(),{href:"/admin/settings/wizard",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"ثبت Ø§ÙØ§Ù
تگاÙ"}),(0,t.jsx)(i(),{href:"/admin/settings/ai",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"ÙÙØ´ Ù
صÙÙØ¹Û"}),(0,t.jsx)(i(),{href:"/admin/sales-channels/miaan",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"Ú©Ø§ÙØ§ÙâÙØ§Û ÙØ±ÙØ´"})]}),children:["amenities"===e&&(0,t.jsx)(u,{}),"rules"===e&&(0,t.jsx)(f,{}),"peak"===e&&(0,t.jsx)(v,{})]})}function u(){let{data:e,isLoading:a,mutate:n}=(0,r.u)("/api/admin/amenities",e=>(0,d.SC)(e)),[s,i]=(0,l.useState)(null),c=new Map;for(let a of e??[]){let e=a.category||"Ø³Ø§ÛØ±";c.set(e,[...c.get(e)??[],a])}return a?(0,t.jsx)(o.Od,{className:"h-[300px]"}):(0,t.jsxs)("div",{className:"flex flex-col gap-y-16",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(o.zx,{onClick:()=>i("new"),children:[(0,t.jsx)("i",{className:"icon-Plus text-16"})," اÙ
Ú©Ø§ÙØ§Øª Ø¬Ø¯ÛØ¯"]})}),[...c.entries()].map(e=>{let[a,n]=e;return(0,t.jsxs)(o.Zb,{className:"p-20",children:[(0,t.jsx)("h3",{className:"text-16 leading-24 font-m text-black mb-12",children:a}),(0,t.jsx)("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-10",children:n.map(e=>(0,t.jsxs)("button",{onClick:()=>i(e),className:"flex items-center gap-x-10 p-10 rounded-10 border border-gray-E5E5E6 hover:border-primary-main transition text-right",children:[e.iconUrl?(0,t.jsx)("img",{src:e.iconUrl,alt:"",className:"w-20 h-20 shrink-0 opacity-70"}):(0,t.jsx)("i",{className:"icon-Possibilities text-18 text-gray-9B9BAA shrink-0"}),(0,t.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"block text-13 leading-20 text-black truncate",children:e.name}),(0,t.jsx)("span",{className:"block text-11 text-gray-9B9BAA truncate",children:e.key??"â"})]}),!!e.scope&&(0,t.jsx)(o.Ct,{tone:"yellow",children:h[e.scope]}),e.features.length>0&&(0,t.jsxs)(o.Ct,{tone:"blue",children:[(0,o.N)(e.features.length)," ÙÛÚÚ¯Û"]})]},e.id))})]},a)}),!!s&&(0,t.jsx)(y,{amenity:"new"===s?null:s,onClose:()=>i(null),onSaved:()=>{i(null),n()}})]})}function y(e){let{amenity:a,onClose:n,onSaved:s}=e,[i,r]=(0,l.useState)({name:(null==a?void 0:a.name)??"",key:(null==a?void 0:a.key)??"",category:(null==a?void 0:a.category)??"",iconUrl:(null==a?void 0:a.iconUrl)??"",scope:(null==a?void 0:a.scope)??""}),[c,x]=(0,l.useState)((null==a?void 0:a.features)??[]),[h,p]=(0,l.useState)(!1),[u,y]=(0,l.useState)(null);async function f(e){e.preventDefault(),p(!0),y(null);try{let e={name:i.name,key:i.key||void 0,category:i.category||void 0,iconUrl:i.iconUrl||void 0,scope:i.scope||null,features:c.filter(e=>e.name.trim()).map(e=>({fieldType:e.fieldType,name:e.name,placeholder:e.placeholder||null,values:e.values||null}))};await (0,d.SC)(a?`/api/admin/amenities/${a.id}`:"/api/admin/amenities",{method:a?"PATCH":"POST",body:JSON.stringify(e)}),s()}catch(e){y(e instanceof Error?e.message:"خطا در Ø°Ø®ÛØ±Ù")}
1finally{p(!1)}}async function j(){a&&(await (0,d.SC)(`/api/admin/amenities/${a.id}`,{method:"DELETE"}),s())}return(0,t.jsx)(o.u_,{open:!0,onClose:n,title:a?`ÙÛØ±Ø§ÛØ´ ${a.name}`:"اÙ
Ú©Ø§ÙØ§Øª Ø¬Ø¯ÛØ¯",width:"max-w-[640px]",children:(0,t.jsxs)("form",{onSubmit:f,className:"flex flex-col gap-y-12",children:[(0,t.jsxs)("div",{className:"grid md:grid-cols-2 gap-12",children:[(0,t.jsx)(o.gN,{label:"ÙØ§Ù
",children:(0,t.jsx)(o.II,{value:i.name,onChange:e=>r(a=>({...a,name:e.target.value})),required:!0})}),(0,t.jsx)(o.gN,{label:"Ú©ÙÛØ¯ اÙÚ¯ÙÛØ³Û (Ø¨Ø±Ø§Û ÙÛÙØªØ±Ùا)",children:(0,t.jsx)(o.II,{value:i.key,onChange:e=>r(a=>({...a,key:e.target.value})),placeholder:"pool"})}),(0,t.jsx)(o.gN,{label:"دستÙâØ¨ÙØ¯Û",children:(0,t.jsx)(o.II,{value:i.category,onChange:e=>r(a=>({...a,category:e.target.value})),placeholder:"اÙ
Ú©Ø§ÙØ§Øª"})}),(0,t.jsx)(o.gN,{label:"آدرس Ø¢ÛÚ©ÙÙ",children:(0,t.jsx)(o.II,{value:i.iconUrl,onChange:e=>r(a=>({...a,iconUrl:e.target.value})),placeholder:"/assets/amenity-icons/pool.svg"})}),(0,t.jsx)(o.gN,{label:"داÙ
ÙÙ",hint:"Ù
ØØ¯Ùد کرد٠اÛ٠اÙ
کا٠ب٠ÛÚ© ÙÙØ¹ Ø§ÙØ§Ù
تگا٠در ÙÛØ²Ø§Ø±Ø¯ ثبت",children:(0,t.jsx)(o.Ph,{value:i.scope,onChange:e=>r(a=>({...a,scope:e.target.value})),children:m.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,t.jsx)("span",{className:"text-12 leading-18 text-gray-6C6A7D font-m",children:"ÙÛÚÚ¯ÛâÙØ§ (ÙØ±Ù
\xabÙÛÚÚ¯Û ÙØ§\xbb در ØµÙØÙ Ø§ÙØ§Ù
تگاÙ)"}),(0,t.jsx)("button",{type:"button",onClick:()=>x(e=>[...e,{name:"",fieldType:"SWITCH",placeholder:null,values:"دارد, ÙØ¯Ø§Ø±Ø¯"}]),className:"text-12 font-m text-primary-dark",children:"+ Ø§ÙØ²Ùد٠ÙÛÚÚ¯Û"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-y-8 max-h-[240px] overflow-y-auto",children:[c.map((e,a)=>(0,t.jsxs)("div",{className:"grid grid-cols-[1fr_140px_1fr_28px] gap-x-8 items-center",children:[(0,t.jsx)(o.II,{value:e.name,placeholder:"ÙØ§Ù
ÙÛÚÚ¯Û",onChange:e=>x(n=>n.map((n,t)=>t===a?{...n,name:e.target.value}:n))}),(0,t.jsx)(o.Ph,{value:e.fieldType,onChange:e=>x(n=>n.map((n,t)=>t===a?{...n,fieldType:e.target.value}:n)),children:g.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,t.jsx)(o.II,{value:e.values??"",placeholder:"گزÛÙÙâÙØ§ با ÙÛØ±Ú¯ÙÙ",onChange:e=>x(n=>n.map((n,t)=>t===a?{...n,values:e.target.value}:n))}),(0,t.jsx)("button",{type:"button",onClick:()=>x(e=>e.filter((e,n)=>n!==a)),className:"w-28 h-28 rounded-8 text-[#E53935] hover:bg-[#FFEBEB]","aria-label":"ØØ°Ù ÙÛÚÚ¯Û",children:(0,t.jsx)("i",{className:"icon-Delete text-16"})})]},a)),0===c.length&&(0,t.jsx)("p",{className:"text-12 text-gray-9B9BAA",children:"ÙÛÚÚ¯ÛâØ§Û ØªØ¹Ø±ÛÙ ÙØ´Ø¯Ù"})]})]}),!!u&&(0,t.jsx)("p",{className:"text-13 text-[#C62828]",children:u}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[!!a&&(0,t.jsx)(o.zx,{type:"button",variant:"danger",onClick:j,children:"ØØ°Ù"}),(0,t.jsxs)("div",{className:"flex items-center gap-x-10 mr-auto",children:[(0,t.jsx)(o.zx,{type:"button",variant:"secondary",onClick:n,children:"Ø§ÙØµØ±Ø§Ù"}),(0,t.jsx)(o.zx,{type:"submit",disabled:h,children:h?"در ØØ§Ù Ø°Ø®ÛØ±Ù...":"Ø°Ø®ÛØ±Ù"})]})]})]})})}function f(){let{data:e,isLoading:a,mutate:n}=(0,r.u)("/api/admin/rules",e=>(0,d.SC)(e)),[s,i]=(0,l.useState)(null);return a?(0,t.jsx)(o.Od,{className:"h-[240px]"}):(0,t.jsxs)("div",{className:"flex flex-col gap-y-16",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(o.zx,{onClick:()=>i("new"),children:[(0,t.jsx)("i",{className:"icon-Plus text-16"})," ÙØ§ÙÙÙ Ø¬Ø¯ÛØ¯"]})}),(0,t.jsxs)(o.Zb,{className:"p-20",children:[(0,t.jsx)("h3",{className:"text-16 leading-24 font-m text-black mb-12",children:"Ù
ÙØ±Ø±Ø§Øª Ø§ÙØ§Ù
تگاÙ"}),(null==e?void 0:e.length)===0&&(0,t.jsx)(o.ub,{text:"ÙØ§ÙÙÙÛ Ø«Ø¨Øª ÙØ´Ø¯Ù"}),(0,t.jsx)("div",{className:"grid md:grid-cols-2 gap-10",children:null==e?void 0:e.map(e=>(0,t.jsxs)("button",{onClick:()=>i(e),className:"flex items-center gap-x-10 p-12 rounded-10 border border-gray-E5E5E6 hover:border-primary-main transition text-right",children:[(0,t.jsx)("i",{className:"icon-Rules text-18 text-gray-9B9BAA shrink-0"}),(0,t.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"block text-13 leading-20 text-black",children:e.name}),(0,t.jsx)("span",{className:"block text-11 text-gray-9B9BAA",children:e.key??"â"})]})]},e.id))})]}),!!s&&(0,t.jsx)(j,{rule:"new"===s?null:s,onClose:()=>i(null),onSaved:()=>{i(null),n()}})]})}function j(e){let{rule:a,onClose:n,onSaved:s}=e,[i,r]=(0,l.useState)({name:(null==a?void 0:a.name)??"",key:(null==a?void 0:a.key)??"",category:(null==a?void 0:a.category)??"Ù
ÙØ±Ø±Ø§Øª Ø§ÙØ§Ù
تگاÙ"}),[c,x]=(0,l.useState)(!1);return(0,t.jsx)(o.u_,{open:!0,onClose:n,title:a?`ÙÛØ±Ø§ÛØ´ ${a.name}`:"ÙØ§ÙÙÙ Ø¬Ø¯ÛØ¯",children:(0,t.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),x(!0);try{await (0,d.SC)(a?`/api/admin/rules/${a.id}`:"/api/admin/rules",{method:a?"PATCH":"POST",body:JSON.stringify({name:i.name,key:i.key||void 0,category:i.category||void 0})}),s()}finally{x(!1)}},className:"flex flex-col gap-y-12",children:[(0,t.jsx)(o.gN,{label:"Ù
ØªÙ ÙØ§ÙÙÙ",children:(0,t.jsx)(o.II,{value:i.name,onChange:e=>r(a=>({...a,name:e.target.value})),required:!0})}),(0,t.jsx)(o.gN,{label:"Ú©ÙÛØ¯ اÙÚ¯ÙÛØ³Û",children:(0,t.jsx)(o.II,{value:i.key,onChange:e=>r(a=>({...a,key:e.target.value})),placeholder:"pets"})}),(0,t.jsx)(o.gN,{label:"دستÙâØ¨ÙØ¯Û",children:(0,t.jsx)(o.II,{value:i.category,onChange:e=>r(a=>({...a,category:e.target.value}))})}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[!!a&&(0,t.jsx)(o.zx,{type:"button",variant:"danger",onClick:async()=>{await (0,d.SC)(`/api/admin/rules/${a.id}`,{method:"DELETE"}),s()},children:"ØØ°Ù"}),(0,t.jsxs)("div",{className:"flex items-center gap-x-10 mr-auto",children:[(0,t.jsx)(o.zx,{type:"button",variant:"secondary",onClick:n,children:"Ø§ÙØµØ±Ø§Ù"}
1),(0,t.jsx)(o.zx,{type:"submit",disabled:c,children:"Ø°Ø®ÛØ±Ù"})]})]})]})})}function v(){return(0,t.jsxs)(o.Zb,{className:"p-20",children:[(0,t.jsx)("h3",{className:"text-16 leading-24 font-m text-black mb-4",children:"Ø±ÙØ²ÙØ§Û Ù¾ÛÚ©"}),(0,t.jsxs)("p",{className:"text-13 leading-22 text-gray-6C6A7D mb-6",children:["اÛ٠بخش ب٠",(0,t.jsx)("span",{className:"font-m text-black",children:"Ú©ÙØªØ±Ù Ø±ÙØ²Ùا"})," Ù
ÙØªÙ٠شد٠است."]}),(0,t.jsx)("p",{className:"text-12 leading-20 text-gray-9B9BAA mb-16",children:"Ø¢ÙØ¬Ø§ Ø¹ÙØ§Ù٠بر بازÙâÙØ§Û ÙØ±Ø® Ù¾ÛÚ©Ø Ù
ÛâØªÙØ§ÙÛØ¯ Ù
شخص Ú©ÙÛØ¯ ÙØ± باز٠رÙÛ ÚÙ ÚÛØ²Û اعÙ
Ø§Ù Ø´ÙØ¯ â ÙÙ
ÙâÛ Ø§ÙØ§Ù
تگاÙâÙØ§Ø Ø´ÙØ± ÛØ§ Ø§Ø³ØªØ§Ù Ø®Ø§ØµØ ÙÙØ¹ Ø§ÙØ§Ù
ØªÚ¯Ø§ÙØ اÙ
Ú©Ø§ÙØ§ØªØ ÛØ§ Ø§ÙØ§Ù
تگاÙâÙØ§Û Ø§ÙØªØ®Ø§Ø¨Û â Ù ÚÙ ÚÛØ²ÙاÛÛ Ø§Ø² Ø¢Ù Ù
Ø³ØªØ«ÙØ§ Ø¨Ø§Ø´ÙØ¯. Ø±ÙØ²ÙØ§Û ØªØ¹Ø·ÛÙ ÙÙ
ÙÙ
اÙâØ¬Ø§Ø³Øª."}),(0,t.jsxs)(i(),{href:"/admin/settings/day-control",className:"inline-flex items-center gap-x-8 px-14 py-8 rounded-10 bg-primary-main text-white text-13 leading-20 font-m",children:[(0,t.jsx)("i",{"aria-hidden":"true",className:"icon-CalendarFlash text-16"}),"Ø±ÙØªÙ Ø¨Ù Ú©ÙØªØ±Ù Ø±ÙØ²Ùا"]})]})}}},function(e){e.O(0,[4389,9759,9774,2888,179],function(){return e(e.s=29217)}),_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.