1import{L as M,d as q,w as N,V as B,P as A,j as i,o,i as t,g as c,t as l,A as s,Z as D,r as I,e as p,k,F as _,n as w,p as $,f as m,l as x,m as T,W as U,s as S,am as E,d5 as H,a1 as W,al as Z}from"./index.js";import{_ as G}from"./Drawer.vue_vue_type_style_index_0_lang.js";import{_ as J}from"./Pill.vue_vue_type_script_setup_true_lang.js";import{a as F,_ as K}from"./Option.vue_vue_type_script_setup_true_lang.js";import{_ as O}from"./Loading.vue_vue_type_style_index_0_lang.js";import{u as z}from"./inquiries.js";/** 2 * @license lucide-vue-next v0.469.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Q=M("InboxIcon",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),X={class:"dark:bg-gray-800 relative flex flex-col bg-dinesurf-grey-default overflow-y-auto rounded-lg w-full h-full"},Y={class:"sticky dark:bg-gray-800 p-5 bg-dinesurf-grey-default top-0 z-20"},ee={class:"mb-4"},se={class:"!text-2xl"},te={class:"free description"},ae={class:"flex flex-wrap items-center gap-2 mt-3"},re=["onClick"],oe={class:"border-t h-full max-h-[calc(100vh-22rem)] dark:border-gray-700 py-5 pt-3 mx-5"},ne={class:"flex relative h-full flex-col"},le={key:0,class:"free text-sm text-red-600 dark:text-red-500 px-3 py-6 text-center"},ie={key:1,class:"free text-sm dark:text-gray-400 text-gray-500 px-3 py-6 text-center"},de={key:2,class:"flex flex-col h-full overflow-y-auto"},ue=["aria-label"],me={class:"flex-1 min-w-0"},ce={class:"flex items-center justify-between gap-2"},fe={class:"free text-xs dark:text-gray-400 text-gray-500 truncate mt-0.5"},ge={class:"free text-xs dark:text-gray-500 text-gray-400 mt-1"},pe={key:0,class:"flex sticky bottom-0 items-center justify-between gap-3 pt-3 dark:bg-gray-800 bg-dinesurf-grey-default"},ye={class:"free text-xs dark:text-gray-400 text-gray-500"},xe=q({__name:"InquiriesPreview",setup(V){const e=z(),f=I(""),n=[{key:"all",label:"All"},{key:"new",label:"New"},{key:"responded",label:"Responded"},{key:"archived",label:"Archived"}],y=T(()=>!!e.filters.q||!!e.filters.form_slug||e.statusFilter!=="all"),b=r=>r.submitter.name||r.submitter.email||r.submitter.phone||"Anonymous",u=r=>({new:"New",read:"Read",responded:"Responded",archived:"Archived"})[r]??r,h=r=>({new:"green",read:"gray",responded:"blue",archived:"grey"})[r]??"gray",g=r=>r?U(r).format("D MMM, h:mm A"):"",L=r=>{e.setStatus(r),e.fetchSubmissions()},R=r=>{e.setFilters({form_slug:r==="all"?void 0:r}),e.fetchSubmissions()},C=r=>{e.setPage(r),e.fetchSubmissions()},P=E(()=>{e.setFilters({q:f.value.trim()||void 0}),e.fetchSubmissions()},400);return N(f,P),B(()=>{e.fetchSubmissions(),e.fetchForms()}),(r,d)=>{const j=A("RouterLink");return o(),i("div",X,[t("div",Y,[t("section",ee,[t("h3",se,l(s(e).pagination.total),1),t("p",te,l(s(e).pagination.total===1?"Inquiry":"Inquiries"),1)]),c(D,{type:"search",size:"sm",placeholder:"Search name, email, messageâ¦",class:"w-full",modelValue:f.value,"onUpdate:modelValue":d[0]||(d[0]=a=>f.value=a)},null,8,["modelValue"]),t("div",ae,[(o(),i(_,null,w(n,a=>t("button",{key:a.key,type:"button",onClick:v=>L(a.key),class:$(["px-3 py-1 rounded-full text-xs font-medium border transition-colors",s(e).statusFilter===a.key?"bg-dinesurf-green-600 border-dinesurf-green-600 text-white":"dark:border-gray-600 border-gray-300 dark:text-gray-300 text-gray-600 hover:dark:bg-gray-700 hover:bg-gray-100"])},l(a.label),11,re)),64)),s(e).forms.length>1?(o(),p(K,{key:0,size:"sm",placeholder:"All forms",class:"ml-auto","model-value":s(e).filters.form_slug??"all","onUpdate:modelValue":R},{default:m(()=>[c(F,{value:"all"},{default:m(()=>[...d[3]||(d[3]=[x("All forms",-1)])]),_:1}),(o(!0),i(_,null,w(s(e).forms,a=>(o(),p(F,{key:a.id,value:a.slug},{default:m(()=>[x(l(a.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["model-value"])):k("",!0)])]),t("div",oe,[t("section",ne,[c(O,{loading:s(e).isLoading&&!s(e).submissions.length},{default:m(()=>[s(e).error?(o(),i("p",le,l(s(e).error),1)):s(e).submissions.length?(o(),i("div",de,[(o(!0),i(_,null,w(s(e).submissions,a=>(o(),p(j,{key:a.id,to:{name:"dashboard.inquiries.show",params:{id:a.id}},exactActiveClass:"dark:bg-gray-700 bg-gray-300/50",class:"flex dark:text-gray-200 py-3 px-3 hover:dark:bg-gray-700/50 hover:bg-gray-100 items-start gap-3 border-b dark:border-gray-700"},{default:m(()=>{var v;return[t("span",{class:$(["mt-1.5 size-2 shrink-0 rounded-full",a.status==="new"?"bg-dinesurf-green-500":"bg-transparent"]),"aria-label":a.status==="new"?"Unread":void 0},null,10,ue),t("div",me,[t("div",ce,[t("span",{class:$(["font-medium truncate",a.status==="archived"?"opacity-60":""])},l(b(a)),3),c(J,{color:h(a.status),size:"xs"},{default:m(()=>[x(l(u(a.status)),1)]),_:2},1032,["color"])]),t("p",fe,l(a.submitter.email||a.submitter.phone||"No contact details"),1),t("p",ge,l(((v=a.form)==null?void 0:v.name)||"Form")+" · "+l(g(a.created_at)),1)])]}),_:2},1032,["to"]))),128))])):(o(),i("p",ie,l(y.value?"No inquiries match those filters.":"No inquiries yet. They land here the moment someone submits one of your forms."),1))]),_:1},8,["loading"]),s(e).pagination.last_page>1?(o(),i("div",pe,[c(S,{size:"xs",variant:"light",disabled:s(e).pagination.current_page<=1||s(e).isLoading,onClick:d[1]||(d[1]=a=>C(s(e).pagination.current_page-1))},{default:m(()=>[...d[4]||(d[4]=[x(" Previous ",-1)])]),_:1},8,["disabled"]),t("span",ye," Page "+l(s(e).pagination.current_page)+" of "+l(s(e).pagination.last_page),1),c(S,{size:"xs",variant:"light",disabled:s(e).pagination.current_page>=s(e).pagination.last_page||s(e).isLoading,onClick:d[2]||(d[2]=a=>C(s(e).pagination.current_page+1))},{default:m(()=>[...d[5]||(d[5]=[x(" Next ",-1)])]),_:1},8,["disabled"])])):k("",!0)])])])}}}),_e={class:"h-full flex flex-col items-center justify-center text-center gap-3 dark:bg-gray-800 bg-dinesurf-grey-default rounded-lg p-10"},be={class:"size-14 rounded-full flex items-center justify-center dark:bg-gray-700 bg-white"},he=q({__name:"EmptyInquiry",setup(V){const e=z();return(f,n)=>(o(),i("div",_e,[t("div",be,[c(s(Q),{class:"size-6 text-gray-400"})]),s(e).formsLoaded&&!s(e).hasForms?(o(),i(_,{key:0},[n[0]||(n[0]=t("h3",{class:"font-semibold dark:text-gray-100"},"No forms yet",-1)),n[1]||(n[1]=t("p",{class:"free text-sm dark:text-gray-400 text-gray-500 max-w-sm"}," Forms collect enquiries from your website and marketplace page. Build one in the Dinesurf Vendor app under More, then submissions land here. ",-1))],64)):(o(),i(_,{key:1},[n[2]||(n[2]=t("h3",{class:"font-semibold dark:text-gray-100"},"Nothing selected",-1)),n[3]||(n[3]=t("p",{class:"free text-sm dark:text-gray-400 text-gray-500 max-w-sm"}," Pick an inquiry on the left to read it, reply to the person, tag them and leave a note for your team. ",-1))],64))]))}}),ke={class:"flex flex-col h-full w-full"},ve={class:"flex-1 sm:h-inherit"},we={class:"flex h-full flex-row gap-5"},$e={class:"w-full sm:w-2/6 h-inherit"},qe={key:0,class:"w-full hidden sm:block sm:w-5/6 h-full"},Ie=q({__name:"Index",setup(V){const e=W(),f=Z(),{isMobile:n}=H(),y=I(!!e.params.id);return N(()=>e.params.id,b=>{y.value=!!b}),(b,u)=>{const h=A("RouterView");return o(),i("div",ke,[u[3]||(u[3]=t("nav",{class:"w-full mb-5 flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 justify-between"},[t("div",null,[t("h2",{class:"text-xl font-semibold dark:text-gray-100"},"Inquiries"),t("p",{class:"free text-sm dark:text-gray-400 text-gray-500"}," Everything people send you through your forms. ")])],-1)),t("div",ve,[t("section",we,[t("aside",$e,[c(xe)]),s(n)?k("",!0):(o(),i("main",qe,[s(e).params.id?(o(),p(h,{key:1})):(o(),p(he,{key:0}))]))])]),s(n)?(o(),p(G,{key:0,modelValue:y.value,"onUpdate:modelValue":[u[1]||(u[1]=g=>y.value=g),u[2]||(u[2]=g=>{!g&&s(e).params.id&&s(f).push({name:"dashboard.inquiries.index"})})],coverage:90,type:"bottom",drawerClass:"dark:bg-gray-800 h-full overflow-y-auto rounded-t-3xl bg-dinesurf-grey-default"},{default:m(()=>[c(h,{onClose:u[0]||(u[0]=g=>s(f).push({name:"dashboard.inquiries.index"}))})]),_:1},8,["modelValue"])):k("",!0)])}}});
6export{Ie 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.