PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/settings/wizard-478ec675dfdc7088.js

js lidomatrip.com collected 2026-09-25 07:11:28 UTC 8,981 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2028],{42399:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/settings/wizard",function(){return t(3311)}])},3311:function(e,n,t){"use strict";t.r(n);var r=t(47568),i=t(26042),a=t(69396),s=t(10253),l=t(70655),c=t(85893),d=t(67294),o=t(44389),u=t(49759),h=t(84858),p=t(32474),x={RES_TYPE:"نوع اقامتگاه (مرحله ۱)",REGION:"منطقه (مرحله ۲)",RENT_TYPE:"نحوه اجاره (مرحله ۳)"},m=Object.keys(x);function g(e){var n,t=e.step,o=e.onSaved,u=(0,s.Z)((0,d.useState)(t),2),x=u[0],m=u[1],g=(0,s.Z)((0,d.useState)(!1),2),f=g[0],b=g[1],v=(0,s.Z)((0,d.useState)(!1),2),j=v[0],N=v[1];(0,d.useEffect)(function(){return m(t)},[t.id,t.step]);var Z=x.title!==t.title||(x.description||"")!==(t.description||"")||(x.helpText||"")!==(t.helpText||"")||(x.iconUrl||"")!==(t.iconUrl||"")||x.isEnabled!==t.isEnabled,y=(n=(0,r.Z)(function(){return(0,l.__generator)(this,function(e){switch(e.label){case 0:b(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,(0,h.SC)("/api/admin/wizard/steps/".concat(t.step),{method:"PATCH",body:JSON.stringify({title:x.title,de
1scription:x.description||null,helpText:x.helpText||null,iconUrl:x.iconUrl||null,isEnabled:x.isEnabled})})];case 2:return e.sent(),N(!0),setTimeout(function(){return N(!1)},2e3),o(),[3,4];case 3:return b(!1),[7];case 4:return[2]}})}),function(){return n.apply(this,arguments)});return(0,c.jsxs)("div",{className:"border-b border-gray-F0F0F0 py-16 last:border-b-0",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between gap-x-8",children:[(0,c.jsxs)("span",{className:"flex items-center gap-x-8",children:[(0,c.jsxs)(p.Ct,{tone:"gray",children:["مرحله ",(0,p.N)(t.step)]}),!x.isEnabled&&(0,c.jsx)(p.Ct,{tone:"red",children:"غیرفعال"})]}),(0,c.jsxs)("span",{className:"flex items-center gap-x-8",children:[j&&(0,c.jsx)("span",{className:"text-12 text-[#1B8A4B]",children:"ذخیره شد"}),(0,c.jsx)(p.zx,{variant:"secondary",onClick:function(){return m((0,a.Z)((0,i.Z)({},x),{isEnabled:!x.isEnabled}))},children:x.isEnabled?"غیرفعال کن":"فعال کن"}),(0,c.jsx)(p.zx,{onClick:y,disabled:!Z||f,children:f?"در حال ذخیره…":"ذخیره"})]})]}),(0,c.jsxs)("div",{className:"mt-12 grid grid-cols-1 gap-12 md:grid-cols-2",children:[(0,c.jsx)(p.gN,{label:"عنوان (تیتری که میزبان می‌بیند)",children:(0,c.jsx)(p.II,{value:x.title,onChange:function(e){return m((0,a.Z)((0,i.Z)({},x),{title:e.target.value}))}})}),(0,c.jsx)(p.gN,{label:"توضیح کوتاه — زیر عنوان",hint:"خالی بگذارید تا نمایش داده نشود",children:(0,c.jsx)(p.II,{value:x.description||"",onChange:function(e){return m((0,a.Z)((0,i.Z)({},x),{description:e.target.value}))},placeholder:"مثلاً: ویلا، آپارتمان، سوئیت یا اقامتگاه بوم‌گردی"})}),(0,c.jsx)(p.gN,{label:"متن راهنما — پشت دکمه‌ی \xab؟\xbb",children:(0,c.jsx)(p.II,{value:x.helpText||"",onChange:function(e){return m((0,a.Z)((0,i.Z)({},x),{helpText:e.target.value}))}})}),(0,c.jsx)(p.gN,{label:"آدرس آیکون",hint:"اختیاری",children:(0,c.jsx)(p.II,{value:x.iconUrl||"",onChange:function(e){return m((0,a.Z)((0,i.Z)({},x),{iconUrl:e.target.value}))},placeholder:"/assets/..."})})]})]})}function f(e){var n,t,o=e.option,u=e.onSaved,x=(0,s.Z)((0,d.useState)(o),2),m=x[0],g=x[1],f=(0,s.Z)((0,d.useState)(!1),2),b=f[0],v=f[1];(0,d.useEffect)(function(){return g(o)},[o.id]);var j=m.name!==o.name||(m.description||"")!==(o.description||"")||(m.imageUrl||"")!==(o.imageUrl||"")||m.sortOrder!==o.sortOrder,N=(n=(0,r.Z)(function(){return(0,l.__generator)(this,function(e){switch(e.label){case 0:v(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,(0,h.SC)("/api/admin/wizard/options/".concat(o.id),{method:"PATCH",body:JSON.stringify({name:m.name,description:m.description||null,imageUrl:m.imageUrl||null,sortOrder:m.sortOrder})})];case 2:return e.sent(),u(),[3,4];case 3:return v(!1),[7];case 4:return[2]}})}),function(){return n.apply(this,arguments)}),Z=(t=(0,r.Z)(function(){return(0,l.__generator)(this,function(e){switch(e.label){case 0:return[4,(0,h.SC)("/api/admin/wizard/options/".concat(o.id,"/toggle"),{method:"POST"})];case 1:return e.sent(),u(),[2]}})}),function(){return t.apply(this,arguments)});return(0,c.jsxs)("div",{className:"rounded-10 border p-12 ".concat(o.isActive?"border-gray-E5E5E6 bg-white":"border-dashed border-gray-CACFD3 bg-gray-F7F7F7"),children:[(0,c.jsxs)("div",{className:"flex items-start gap-x-12",children:[(0,c.jsx)("div",{className:"h-56 w-56 shrink-0 overflow-hidden rounded-8 bg-gray-F0F0F0",children:m.imageUrl?(0,c.jsx)("img",{src:m.imageUrl,alt:"",className:"h-full w-full object-cover"}):null}),(0,c.jsxs)("div",{className:"grid flex-1 grid-cols-1 gap-8 md:grid-cols-2",children:[(0,c.jsx)(p.II,{value:m.name,onChange:function(e){return g((0,a.Z)((0,i.Z)({},m),{name:e.target.value}))},placeholder:"نام گزینه"}),(0,c.jsx)(p.II,{value:m.description||"",onChange:function(e){return g((0,a.Z)((0,i.Z)({},m),{description:e.target.value}))},placeholder:"توضیح (اختیاری)"}),(0,c.jsx)(p.II,{value:m.imageUrl||"",onChange:function(e){return g((0,a.Z)((0,i.Z)({},m),{imageUrl:e.target.value}))},placeholder:"آدرس تصویر"}),(0,c.jsx)(p.II,{type:"number",value:m.sortOrder,onChange:function(e){return g((0,a.Z)((0,i.Z)({},m),{sortOrder:Number(e.target.value)}))},placeholder:"ترتیب"})]}),(0,c.jsxs)("div",{className:"flex shrink-0 flex-col gap-y-6",children:[(0,c.jsx)(p.zx,{onClick:N,disabled:!j||b,children:b?"…":"ذخیره"}),(0,c.jsx)(p.zx,{variant:"secondary",onClick:Z,children:o.isActive?"پنهان":"نمایش"})]})]}),m.name!==o.name&&(0,c.jsx)("p",{className:"mt-8 text-11 leading-18 text-[#B07D1A]",children:"تغییر نام فقط روی ثبت‌های جدید اثر دارد؛ اقامتگاه‌هایی که قبلاً این گزینه را انتخاب کرده‌اند نام قبلی را نگه می‌دارند."})]})}function b(e){var n,t=e.kind,i=e.onSaved,a=(0,s.Z)((0,d.useState)(""),2),o=a[0],u=a[1],x=(0,s.Z)((0,d.useState)(!1),2),m=x[0],g=x[1],f=(n=(0,r.Z)(function(){return(0,l.__generator)(this,function(e){switch(e.label){case 0:if(!o.trim())return[2];g(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,(0,h.SC)("/api/admin/wizard/options",{method:"POST",body:JSON.stringify({kind:t,name:o.trim(),sortOrder:99})})];case 2:return e.sent(),u(""),i(),[3,4];case 3:return g(!1),[7];case 4:return[2]}})}),function(){return n.apply(this,arguments)});return(0,c.jsxs)("div",{className:"mt-12 flex items-center gap-x-8",children:[(0,c.jsx)(p.II,{value:o,onChange:function(e){return u(e.target.value)},placeholder:"افزودن گزینه‌ی جدید…",className:"max-w-[320px]"}),(0,c.jsx)(p.zx,{variant:"secondary",onClick:f,disabled:!o.trim()||m,children:"افزودن"})]})}n.default=function(){var e,n,t=(0,s.Z)((0,d.useState)("steps"),2),r=t[0],i=t[1],a=(0,o.u)("/api/admin/wizard",function(n){return(0,h.SC)(n).then(function(n){return null!==(e=n.data)&&void 0!==e?e:n})}),l=a.data,v=a.isLoading,j=a.mutate;return(0,c.jsxs)(u.Z,{title:"محتوای ثبت اقامتگاه",breadcrumb:"تنظیمات",children:[(0,c.jsxs)(p.Zb,{children:[(0,c.jsx)("p",{className:"text-13 leading-22 text-gray-6C6A7D",children:"عنوان و توضیح هر مرحله‌ی ثبت اقامتگاه، و گزینه‌هایی که میزبان در سه مرحله‌ی اول انتخاب می‌کند. تغییرات بلافاصله روی ویزارد اعمال می‌شوند."}),(0,c.jsx)("div",{className:"mt-16 flex items-center gap-x-6",children:["steps","options"].map(function(e){return(0,c.jsx)("button",{onClick:function(){return i(e)},"aria-pressed":r===e,className:"rounded-10 px-12 py-6 text-13 leading-20 font-m transition ".concat(r===e?"bg-primary-main text-white":"text-gray-6C6A7D hover:bg-gray-F0F0F0"),children:"steps"===e?"مراحل":"گزینه‌ها"},e)})})]}),(0,c.jsx)("div",{className:"mt-16",children:v?(0,c.jsx)(p.Zb,{children:[0,1,2].map(function(e){return(0,c.jsx)(p.Od,{className:"mb-12 h-80 w-full rounded-10"},e)})}):"steps"===r?(0,c.jsx)(p.Zb,{children:(null!==(n=null==l?void 0:l.steps)&&void 0!==n?n:[]).map(function(e){return(0,c.jsx)(g,{step:e,onSaved:function(){return j()}},e.step)})}):(0,c.jsx)("div",{className:"space-y-16",children:m.map(function(e){var n,t=(null!==(n=null==l?void 0:l.options)&&void 0!==n?n:[]).filter(function(n){return n.kind===e});return(0,c.jsxs)(p.Zb,{children:[(0,c.jsx)("h3",{className:"text-14 leading-22 font-m text-black",children:x[e]}),(0,c.jsx)("div",{className:"mt-12 space-y-8",children:t.map(function(e){return(0,c.jsx)(f,{option:e,onSaved:function(){return j()}},e.id)})}),(0,c.jsx)(b,{kind:e,onSaved:function(){return j()}})]},e)})})})]})}}},function(e){e.O(0,[9791,9759,9774,2888,179],function(){return e(e.s=42399)}),_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.