1import{_ as Y}from"./BfG9wfOJ.js";import{_ as j}from"./CNx60fv1.js";import{_ as z}from"./Mk2bsrNJ.js";import{e as G,J as Q,p as X,q as Z,j as ee,r as _,a8 as K,U as te,av as c,i as se,E as ae,o as y,c as v,b as $,f as p,a as r,w as N,t as h,d as ne,F as P,I as V,z as D,K as ie,g as oe,bJ as le,n as M,bK as ce,bL as re,af as de,y as pe}from"./Dw9gc2IA.js";import{u as ue}from"./BeQj7gEv.js";import"./Br9ICfZC.js";import"./DuOV_HHS.js";const fe={class:"mt-[100px] sm:mt-[75px] md:mt-[80px] lg:mt-[102px] mb-20"},ye={class:"container mt-8 grid grid-cols-12 gap-2"},me={class:"border border-gray-2 shadow-xl rounded-2xl col-span-12 lg:col-span-10 xl:col-span-8"},_e={key:0,class:"p-6"},ve={class:"text-red-1 text-3xl"},he={class:"mt-4 mb-2"},be={key:0,class:"text-gray-400 pl-20"},ge=["innerHTML"],Ae={class:"mt-8 grid grid-cols-1 md:grid-cols-5 gap-2"},we=["disabled"],$e=["disabled"],Ce={key:1,class:"p-6"},xe={key:0,class:"py-8 text-xl text-red-500 font-proxima leading-loose"},Te={key:1,class:"py-8 text-xl text-red-500 font-proxima leading-loose"},He=G({__name:"assistance-types",async setup(Se){let u,C;const x=Q(),l=X(),d=Z(),{t:b,locale:F}=ee(),L=oe(),g=_([]),T=_(!1),E=L.public?.fplConsentLocationsAndType;let k=!1;if(E!==void 0&&typeof E=="string"){let t=E.split("|");if(t.length){let s=t.map(o=>o.split(":"));if(s[0][0]!==void 0&&s[0][1]!==void 0)for(const o of s)o[0]===`${l.chosen.licensed_location_id}`&&o[1]===`${l.chosen.license_type_id}`&&!x.isAdmin&&(k=!0)}}d.setFPLRecordId(null);const B=_(!1);if(k){const t=([u,C]=K(()=>ce(d.chosenEmailAddress)),u=await u,C(),u);t.success&&(B.value=t.data.isEligible,d.setFPLRecordId(t.data.recordId))}let A=[];const w=([u,C]=K(()=>re(l.chosen.id)),u=await u,C(),u);let I=[];const R=te(()=>{if(A=l.chosen.fund_service_areas.reduce((e,a)=>(a.fund.tbl_fund_assistance_types.map(i=>{const n=i.tbl_assistance_type?.assistance_type_locations?.find(m=>m.licensed_location_id===l.chosen.licensed_location_id&&m.license_type_id===l.chosen.license_type_id&&m.enabled&&m.assistance_type_configuration.license_type_id===l.chosen.license_type_id&&m.assistance_type_configuration.licensed_location_id===l.chosen.licensed_location_id&&m.assistance_type_configuration.active);n!==void 0&&(e=[...e,{label:b(i.tbl_assistance_type.description),value:`${i.tbl_assistance_type.id}`,help:n?.translations!==void 0?n.translations[F.value]?.optional_description:void 0,serviceAreaCategory:`${i.tbl_assistance_type.category}`}])}),e),[]),l.chosen?.assis_type_config_array.filter(e=>x.isAdmin||e?.config?.active).length)for(let e of l.chosen?.assis_type_config_array){const a=e.assistance_type,i=e.assistance_type.assistance_type_locations.find(n=>n.licensed_location_id===l.chosen.licensed_location_id&&n.license_type_id===l.chosen.license_type_id&&n.enabled&&n.assistance_type_configuration.license_type_id===l.chosen.license_type_id&&n.assistance_type_configuration.licensed_location_id===l.chosen.licensed_location_id&&n.assistance_type_configuration.active);i!==void 0&&A.push({label:b(a.description),value:`${a.id}`,help:i?.translations!==void 0?i.translations[F.value]?.optional_description:void 0,serviceAreaCategory:`${a.category}`})}const t=d.currentApplicant.applications.filter(e=>![c.ApprovedClosed,c.Declined,c.Expired].includes(e.status)).flatMap(e=>e.assistance_requests.filter(a=>a.assistance_type.id===L.public.foodAssistanceTypeId||a.assistance_type.id===L.public.disasterAssistanceTypeId?![c.ApprovedClosed,c.Declined,c.Abandoned,c.UserDeleted,c.Rescinded,c.Approved,c.Expired].includes(a.status):![c.ApprovedClosed,c.Declined,c.Abandoned,c.UserDeleted,c.Rescinded].includes(a.status)).map(a=>a.assistance_type.category)),s=w?.data?.assistanceTypesLimitStatus.map(e=>e.assistanceTypeId);w?.data?.assistanceTypeLimitsEnabled&&(I=w?.data?.assistanceTypesLimitStatus.filter(e=>e.limitReached||e.closed).map(e=>e.assistanceTypeId));let o=A.filter(e=>w?.data?.assistanceTypeLimitsEnabled===!1||s.includes(e.value)).filter(e=>x.isAdmin||!I.includes(e.value)).filter((e,a,i)=>a===i.findIndex(n=>n.label===e.label&&n.value===e.value&&n.serviceAreaCategory===e.serviceAreaCategory&&!t.includes(n.serviceAreaCategory)));return k&&(B.value?o.filter(a=>a.value==="5f697a9f-b59d-483a-b19c-f4ef8749419e").length>0?o=o.filter(a=>a.value==="5f697a9f-b59d-483a-b19c-f4ef8749419e"):T.value=!0:o=o.filter(e=>e.value!=="5f697a9f-b59d-483a-b19c-f4ef8749419e")),o.sort((e,a)=>e.label>a.label?1:-1)}),{hasVideos:U}=ue(),f=_(!1),q=async t=>{if(!f.value){f.value=!0;try{le(),l.setChosenAssistanceTypes(t.assistanceType),await M().push(U.value?"/secure/video-presentation-1":"/secure/personal-information")}catch(s){throw f.value=!1,s}}},O=t=>typeof t>"u"||t===null?"":(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2"),S=_(!1),H=_([]);se(g,(t,s)=>{const o=t.filter(e=>!s.includes(e));if(o.length){const e=A.filter(i=>s.includes(i.value)).map(i=>i.serviceAreaCategory),a=A.filter(i=>o.includes(i.value)).map(i=>i.serviceAreaCategory);if(e.includes(a[0])){de(()=>{g.value=s}),pe(b("Error"),b("You cannot select more than one assistance type from the :newCat category.").replace(":newCat",b(a[0])));return}}w?.data?.assistanceTypeLimitsEnabled&&x.isAdmin&&o.length&&I.includes(o[0])&&(H.value=s,S.value=!0)});const W=()=>{g.value=H.value,S.value=!1},J=()=>{T.value=!1,M().push("/secure/service-areas/welcome")};return(t,s)=>{const o=Y,e=ae("FormKit"),a=j,i=z;return y(),v("section",fe,[$(o,{title:t.$t("Welcome to SAHelp"),"show-subheader":!1,email:p(d).chosenEmailAddress,id:p(d).currentApplicant?.id,idPublic:p(d).currentApplicant?.id_public,name:p(d).currentApplicant?.first_name+" "+p(d).currentApplicant?.last_name},null,8,["title","email","id","idPublic","name"]),r("div",ye,[r("div",me,[p(R).length?(y(),v("div",_e,[$(e,{type:"form",onSubmit:q},{default:N(()=>[r("div",null,[r("h2",ve,h(t.$t("How can we help today?")),1),r("p",he,[ne(h(t.$t("Select the type(s) of assistance you need help with today."))+" ",1),s[6]||(s[6]=r("br",null,null,-1))]),$(e,{type:"checkbox",options:p(R),name:"assistanceType","options-class":"$reset","option-class":"$reset mb-2 grid grid-cols-1","wrapper-class":"flex grid-cols-1","fieldset-class":"!max-w-full","label-class":"!mt-0","inner-class":"mx-2",validation:"required","validation-label":t.$t("Assistance Type"),modelValue:g.value,"onUpdate:modelValue":s[0]||(s[0]=n=>g.value=n),"option-help-class":"pl-20"},{optionHelp:N(n=>[n.value.includes(n.option.value)?(y(),v("div",be,[r("span",{innerHTML:O(n.option?.help)},null,8,ge)])):P("",!0)]),_:1},8,["options","validation-label","modelValue"]),r("div",Ae,[r("button",{class:"btn-primary w-full md:hidden",disabled:f.value,onKeydown:s[1]||(s[1]=V(D(()=>{},["prevent"]),["enter"]))},[r("span",null,h(f.value?t.$t("Loading..."):t.$t("Next")),1)],40,we),p(d).currentApplicant.applications.length>0?(y(),ie(a,{key:0})):P("",!0),r("button",{class:"btn-primary w-full hidden md:block",disabled:f.value,onKeydown:s[2]||(s[2]=V(D(()=>{},["prevent"]),["enter"]))},[r("span",null,h(f.value?t.$t("Loading..."):t.$t("Next")),1)],40,$e),s[7]||(s[7]=r("div",{class:"col-span-1 md:col-span-2"},null,-1))])])]),_:1})])):(y(),v("div",Ce,[p(d).currentApplicant.applications.length===0?(y(),v("div",xe,h(t.$t("We are not currently accepting new applications in this area.")),1)):(y(),v("div",Te,h(t.$t("It appears that you already have an application in progress that covers all assistance types available for this service area. Once your existing application has been completed, you will then be able to apply for additional assistance.")),1))]))])]),$(i,{open:S.value,"onUpdate:open":W,onConfirm:s[3]||(s[3]=n=>S.value=!1),title:t.$t("Are you sure?"),context:t.$t("You have reached the maximum number of applications for this assistance type. Are you sure you want to override this and add a new application for this assistance type?")},null,8,["open","title","context"]),$(i,{open:T.value,"onUpdate:open":s[4]||(s[4]=n=>J()),onConfirm:s[5]||(s[5]=n=>T.value=!1),title:t.$t("Warning?"),cancelButtonText:t.$t("Cancel"),confirmButtonText:t.$t("Continue"),context:"FPL Saving Steps is not currently accepting new applications as they have hit the capacity for this month. New application openings will become available at the start of next month. We encourage you to return and apply at that time.<br/><br/>If you need immediate help with your bill or have received a disconnect notice, click continue to request assistance through the FPL Care to Share program."},null,8,["open","title","cancelButtonText","confirmButtonText"])])}}});
1export{He 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.