PageSourceSearch

https://ivi-amc.vercel.app/assets/index-CeTdMfhp.js

js ivi-amc.vercel.app collected 2026-10-03 07:08:42 UTC 2,463 bytes, 1 lines download raw bytes

1import{u as q,b as m,p as Y,r as o,x as h,y as N,j as a,D as R,C as L,i as x,k as b,B as O,b5 as M}from"./index-LkbXvN8T.js";import{A as B}from"./index-Cp2k0TT1.js";import{M as y}from"./index-DWrnHpOh.js";import{c as T}from"./selector-CThrTl9s.js";import{u as V}from"./index.esm-BuQZ9b9b.js";import{d as k}from"./selector-G_w0rNFo.js";import"./Spinner-Doupy3lA.js";import"./Form-CXE8XLsO.js";const S="mb-24 d-flex align-items-center gap-4",Z=[{value:"aggregated",label:"Aggregated Data"},{value:"glass",label:"GLASS Data"}],$=()=>{var g;const s=q(),{countries:c,loadingCountries:F}=m(T),{profile:t}=m(Y),{year_list:i,loadingExtractData:f}=m(k),{watch:G,setValue:z,handleSubmit:j,formState:{errors:H,isSubmitted:p}}=V({mode:"all"});o.useState("aggregated");const[n,C]=o.useState([]),[l,w]=o.useState(t!=null&&t.user.country?[{value:t.user.country.code,label:t.user.country.name}]:[]),A=((g=Array.from(new Set(i==null?void 0:i.map(e=>e.year))))==null?void 0:g.sort((e,r)=>r-e).map(e=>({value:e,label:e})))||[],E=e=>{C(e)},v=e=>{w(e);const r=e.map(u=>u.value);s(O({countries:r})),e&&typeof e=="string"&&s(h({search:e}))},D=e=>{if(l.length===0||n.length==0)return;const r=l.map(d=>d.value),u=n.map(d=>d.value);s(M({data:{country:r,year:u}}))};return o.useEffect(()=>{t!=null&&t.user.country&&(t!=null&&t.user.country.code)||s(h({}))},[s,t]),o.useEffect(()=>{s(N())},[s]),a.jsxs(R,{children:[a.jsx("h6",{className:"fw-bold text-lg font-primary mb-32",children:"Extract Data"}),a.jsxs("form",{onSubmit:j(D),children:[a.jsxs(L,{className:"mx-0 px-0 max-w-full",children:[a.jsx(x,{children:a.jsx(b,{md:6,children:a.jsx(y,{showAllOption:!0,className:S,id:"country",label:"Country: ",placeholder:"Select Country",labelStyle:"mb-0 w-75",options:c==null?void 0:c.map(e=>({value:e.code,label:e.name,image:e.flag})),required:!0,value:l,onChange:v,disabled:(t==null?void 0:t.user.role.name)!=="Administrator",error:p&&l.length==0?"This field is required":void 0})})}),a.jsx(x,{children:a.jsx(b,{md:6,children:a.jsx(y,{showAllOption:!0,id:"year",placeholder:"Select Year",label:"Reporting Year:",options:A,value:n,labelStyle:"mb-0 w-75",className:S,required:!0,onChange:E,error:p&&n.length===0?"This field is required":void 0})})})]}),a.jsx("div",{className:"border-top mt-32 mb-32"}),a.jsx("footer",{className:"d-flex align-items-center justify-content-end",children:a.jsx(B,{type:"submit",loading:f,children:"Export (in CSV)"})})]})]})};export{$ as default,Z as tableOptions};

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.