1import{e as G,u as R,aY as O,N as V,a as j,p as z,V as Q,r as n,ac as Y,aZ as g,i as Z,j as s,Q as q,c,a1 as H,a_ as I,d as J}from"./index.af7661b9.js";import{P as K}from"./index.53dd0779.js";const X=()=>{var v,N,w,k,F,S,$,T,_;const{t:y}=G(),h=R(),A=O(),{id:P}=V(),{language:r}=j(z),{guideContent:l,guideDetail:a}=j(Q),[t,D]=n.exports.useState(a),[o,L]=n.exports.useState(0),[x,m]=n.exports.useState(0),d=n.exports.useRef(null);n.exports.useEffect(()=>{var e;window.scroll({top:0}),((e=l==null?void 0:l.results)==null?void 0:e.length)===0&&h(Y()),h(g(Number(P)))},[]),n.exports.useEffect(()=>{var e;a&&(D(a),m(0),L((e=l==null?void 0:l.results)==null?void 0:e.findIndex(i=>i.id===a.id)))},[a]),n.exports.useEffect(()=>{if(x>0){const e=document.getElementById(`guide-${o}-${x}`);d.current&&e&&(d.current.scrollTop=(e==null?void 0:e.offsetTop)-d.current.offsetTop)}else d.current&&(d.current.scrollTop=0)},[x]);const b=e=>{m(0),h(g(e)),A(`/${r}/guides/${e}`)},E=e=>{var i;b((i=l==null?void 0:l.results[e.selected])==null?void 0:i.id)};return n.exports.useEffect(()=>{Z("dynFont","font-kalimati",r)},[r]),s(q,{children:c("div",{className:"w-full flex justify-start lg:grid lg:grid-flow-col relative",children:[s("div",{className:"sticky top-0 bg-scroll hidden lg:flex flex-col pl-16 pr-10 w-[22%] h-full min-w-[350px] overflow-y-auto scrollbar-thin scrollbar-thumb-[#C9C9C9] active:scrollbar-thumb-grayTen ",children:c("div",{className:"flex flex-col",children:[s("div",{className:"w-full my-9",children:s(H,{setSearchResult:(e,i)=>{var u,p;const f=(p=(u=l==null?void 0:l.results)==null?void 0:u.filter(B=>B.title.toLowerCase()===e.toLowerCase().trim())[0])==null?void 0:p.id;f&&h(g(f))},dataField:"search"})}),!Array.isArray(l)&&((v=l==null?void 0:l.results)==null?void 0:v.map((e,i)=>{var f;return c("div",{className:"flex flex-col pb-6",children:[s("h3",{id:`guide-title-${e.id}`,onClick:()=>{b(e.id)},className:`pb-2 ${t&&t.id===e.id?"text-black":"text-grayTen"} text-lg leading-[27px] font-bold uppercase cursor-pointer active:scale-95 dynFont`,children:r==="en"?e.title:e.title_ne}),e.id===(t==null?void 0:t.id)&&((f=t.children)==null?void 0:f.length)>0&&t.children.map((u,p)=>s("div",{onClick:()=>{m(p+1)},className:` pb-2 ${x===p+1?"text-black":"text-grayTen"} text-base leading-6 font-medium cursor-pointer active:scale-95 dynFont`,children:r==="en"?u.title:u.title_ne},p))]},i)})),Array.isArray(l)&&a?c("div",{className:"flex flex-col pb-6",children:[s("h3",{id:`guide-title-${a.id}`,onClick:()=>{b(a.id)},className:`pb-2 ${t&&t.id===a.id?"text-black":"text-grayTen"} text-lg leading-[27px] font-bold uppercase cursor-pointer active:scale-95 dynFont`,children:r==="en"?a.title:a.title_ne}),a.id===(t==null?void 0:t.id)&&((N=t.children)==null?void 0:N.length)>0&&t.children.map((e,i)=>s("div",{onClick:()=>{m(i+1)},className:` pb-2 ${x===i+1?"text-black":"text-grayTen"} text-base leading-6 font-medium cursor-pointer active:scale-95 dynFont`,children:r==="en"?e.title:e.title_ne},i))]}):""]})}),c("div",{id:"guide-container",ref:d,className:"flex flex-col w-full pl-[50px] pr-[10%] py-[15px] lg:py-[68px] overflow-y-auto max-h-[calc(100vh-170px)] thin-scrollbar",children:[s("h5",{className:"hidden lg:flex text-black text-[32px] leading-[48px] font-bold uppercase dynFont",children:t&&(r==="en"?t.title:t.title_ne)}),s("div",{className:"w-full flex lg:hidden",children:s(I,{placeholder:"",options:typeof l=="object"?(w=l==null?void 0:l.results)==null?void 0:w.map(e=>({id:e.id,title:r==="en"?e.title:e.title_ne})):[{id:a.id,title:r==="en"?a.title:a.title_ne}],name:(k=a==null?void 0:a.name)!=null?k:"select_disaster",getSelectData:(e,i)=>b(e),selectedValue:t==null?void 0:t.id,divStyle:"!w-fit bg-[white] h-[100px]",textStyle:"w-fit pb-2 text-black text-[25px] leading-[48px] font-bold dynFont",placeholderStyle:"w-fit pb-2 text-black text-[25px] leading-[48px] font-bold dynFont",textOptionStyle:"p-2 text-black bg-white text-xl border-b border-gray leading-[36px] font-base hover:text-greenTwo dynFont"})}),c("div",{className:"pb-20 flex flex-col justify-start",children:[s("div",{className:"mb-28",children:t&&t.children&&t.children.length>0&&t.children.map((e,i)=>c("div",{className:"flex flex-col ",id:`guide-${o}-${i+1}`,children:[s("h5",{className:"pb-4 text-black text-2xl leading-9 font-medium sm:mt-4 dynFont",children:r==="en"?e.title:e.title_ne}),s("div",{className:"text-black text-base leading-6 font-poppins space-y-4 dynFont",children:J(r==="en"?e.description:e.description_ne)}),e.image&&s("img",{src:`${e.image}`,alt:"",className:"pt-4 w-full md:h-[540px] h-[215px] object-cover bg-center",loading:"lazy"})]},i))}),c("div",{className:"flex flex-col",children:[c("div",{className:"flex w-full justify-between",children:[s("p",{className:"pl-2 text-black text-xs leading-[18px] font-medium uppercase dynFont",children:((F=l==null?void 0:l.results)==null?void 0:F.length)>0&&o>0?y(`${(S=l==null?void 0:l.results[o-1])==null?void 0:S.title}`.toLowerCase()):""}),s("p",{className:"pr-2 text-black text-xs leading-[18px] font-medium uppercase dynFont",children:(($=l==null?void 0:l.results)==null?void 0:$.length)>0&&o<((T=l==null?void 0:l.results)==null?void 0:T.length)-1?y(`${(_=l==null?void 0:l.results[o+1])==null?void 0:_.title}`.toLowerCase()):""})]}),Array.isArray(l)?"":s(K,{pageCount:l.count,handlePageClick:E,hidePageNum:!0,previousLabel:r==="en"?"Previous":"\u0905\u0918\u093F\u0932\u094D\u0932\u094B",nextLabel:r==="en"?"Next":"\u
10905\u0930\u094D\u0915\u094B"})]})]})]})]})})};export{X as default};
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.