form-component-library-demo 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime"),u=require("lucide-react");var d=`field_library_token`,f=`field_library_user`,p=class{constructor({baseUrl:e,appId:t,onAuthError:n}){if(!e)throw Error(`baseUrl is required`);if(!t)throw Error(`appId is required`);if(this.baseUrl=e.replace(/\/+$/,``),this.appId=t,this.onAuthError=n,this.token=null,this.user=null,typeof window<`u`){this.token=localStorage.getItem(d);try{let e=localStorage.getItem(f);e&&(this.user=JSON.parse(e))}catch{this.user=null}}}setAuthErrorHandler(e){this.onAuthError=e}setToken(e){this.token=e,!(typeof window>`u`)&&(e?localStorage.setItem(d,e):(localStorage.removeItem(d),localStorage.removeItem(f),this.user=null))}getToken(){return this.token}async request(e,t,n,r={}){let i={"Content-Type":`application/json`,...r};return this.token&&(i.Authorization=`Bearer ${this.token}`),this.send(e,t,{headers:i,body:n===void 0?void 0:JSON.stringify(n)})}async requestForm(e,t){let n={};return this.token&&(n.Authorization=`Bearer ${this.token}`),this.send(`POST`,e,{headers:n,body:t})}async send(e,t,n){let r=await fetch(`${this.baseUrl}${t}`,{method:e,...n});if(r.status===401)throw this.setToken(null),this.onAuthError?.(),{status:401,message:`Unauthorized`};if(!r.ok){let e=r.statusText;try{let t=await r.json();t.error&&(e=t.error)}catch{}throw{status:r.status,message:e}}if(r.status!==204)return await r.json()}async login(e,t,n){let r=await this.request(`POST`,`/usr/login`,{email:e,password:t,...n?{org_id:Number(n)}:{}});return this.setToken(r.token),typeof window<`u`&&r.user&&(this.user=r.user,localStorage.setItem(f,JSON.stringify(r.user))),r}logout(){this.setToken(null)}async getMe(){let e=await this.request(`GET`,`/usr/app/${this.appId}/me`);return this.user&&(this.user={...this.user,...e},typeof window<`u`&&localStorage.setItem(f,JSON.stringify(this.user))),e}currentUser(){if(!this.token)return null;if(this.user)return this.user;try{let e=JSON.parse(atob(this.token.split(`.`)[1]));return{id:String(e.user_id??e.sub??``),org_id:String(e.org_id??``),name:e.name??``,email:e.email??``,mobile:String(e.mobile??e.mobile_number??e.phone??e.phone_number??e.user_mobile??``),roles:e.roles??[],groups:e.groups??[]}}catch{return null}}recordView(e,t={}){return this.request(`POST`,`/app/${this.appId}/view/recordview`,{rv_template_uid:e,...t.presetAlias?{preset_alias:t.presetAlias}:{},search_query:{page:t.page??1,limit:t.limit??50,sort_by:t.sortBy??``,sort_dir:t.sortDir??`desc`,search:t.search??``,filters:(t.filters??[]).map(e=>{let t={field_key:e.field_key,data_type:e.data_type??`character varying`};return e.values&&e.values.length>0?t.values=e.values:(t.value=e.value??``,t.value2=``),t})}})}detailView(e,t){return this.request(`GET`,`/app/${this.appId}/view/detailview/${e}?instance_id=${encodeURIComponent(String(t))}`)}audit(e){return this.request(`GET`,`/app/${this.appId}/view/audit?instance_id=${encodeURIComponent(String(e))}`)}aiDecisions(e){return this.request(`GET`,`/monitor/decisions?instance_id=${encodeURIComponent(String(e))}`).then(e=>e.decisions??[])}formSchema(e,t){return this.request(`POST`,`/app/${this.appId}/view/form-screens`,{activity_id:e,device_type:`desktop`,...t==null?{}:{instance_id:t}})}startInstance(e,t,n){return this.request(`POST`,`/app/${this.appId}/start`,{workflow_uuid:e,activity_id:t,data:n})}performActivity(e,t,n,r){return this.request(`POST`,`/app/${this.appId}/activity`,{workflow_uuid:e,instance_id:typeof t==`string`&&Number(t)||t,activity_id:n,data:r})}lookupRecords(e,t,n){return this.request(`POST`,`/app/${this.appId}/rdbms-templates/${t}/records`,{workflow_uuid:e,activity_id:n.activityId,field_id:n.fieldId,instance_id:n.instanceId||void 0,search:n.search??``,limit:n.limit??50,offset:0,form_data:n.formData??{}})}wfLookupRecords(e,t){return this.request(`POST`,`/app/${this.appId}/wf-lookup/records`,{workflow_uuid:e,activity_id:t.activityId,field_id:t.fieldId,form_data:t.formData??{},search:t.search??``,limit:t.limit??100,offset:t.offset??0})}datasetOptions(e,t){return this.request(`POST`,`/app/${this.appId}/dataset-options`,{workflow_uuid:e,activity_id:t.activityId,field_id:t.fieldId,instance_id:t.instanceId||void 0,search:t.search??``,limit:t.limit??200,offset:0,form_data:t.formData??{}})}getDatasets(){return this.request(`GET`,`/app/${this.appId}/datasets`)}getDataset(e){return this.request(`GET`,`/app/${this.appId}/datasets/${e}`)}createDataset(e){return this.request(`POST`,`/app/${this.appId}/datasets`,e)}updateDataset(e,t){return this.request(`PUT`,`/app/${this.appId}/datasets/${e}`,t)}fieldForm(e,t,n){let r=new FormData;return r.append(`file`,t),r.append(`workflow_uuid`,e),r.append(`activity_id`,n.activityId),r.append(`field_id`,n.fieldId),n.instanceId!=null&&r.append(`instance_id`,String(n.instanceId)),r}uploadFile(e,t,n){return this.requestForm(`/app/${this.appId}/upload`,this.fieldForm(e,t,n))}async extractOcr(e,t,n){if(t instanceof File||t instanceof Blob){let r=new FormData;return r.append(`file`,t),r.append(`store_file`,`true`),r.append(`workflow_uuid`,e),r.append(`activity_id`,n.activityId),r.append(`field_id`,n.fieldId),n.versionUuid&&r.append(`version_uuid`,n.versionUuid),n.instanceId!=null&&r.append(`instance_id`,String(n.instanceId)),this.requestForm(`/app/${this.appId}/ocr-extract`,r)}{let r={workflow_uuid:e,activity_id:n.activityId,field_id:n.fieldId,version_uuid:n.versionUuid,files:[t]};return n.instanceId!=null&&(r.instance_id=Number(n.instanceId)),{...await this.request(`POST`,`/app/${this.appId}/ocr-extract`,r),file:t}}}async getFilePreviewBlob(e){let t={};this.token&&(t.Authorization=`Bearer ${this.token}`);let n=await fetch(`${this.baseUrl}/app/${this.appId}/view/files/${e}/preview`,{method:`GET`,headers:t});if(n.status===401)throw this.setToken(null),this.onAuthError?.(),{status:401,message:`Unauthorized`};if(!n.ok)throw{status:n.status,message:`Failed to fetch preview`};return await n.blob()}},m={imagePreviewLoading:`_imagePreviewLoading_s2a11_1`,spinner:`_spinner_s2a11_10`,"zf-spin":`_zf-spin_s2a11_1`,spinnerSm:`_spinnerSm_s2a11_19`,imagePreviewError:`_imagePreviewError_s2a11_28`,imagePreview:`_imagePreview_s2a11_1`},h=(...e)=>e.filter(Boolean).join(` `);function g({file:e,client:t,className:n=``}){let[r,i]=(0,c.useState)(null),[a,o]=(0,c.useState)(!1),[s,u]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let n=null,r=!0;async function a(){if(!e){r&&i(null);return}if(e instanceof File){n=URL.createObjectURL(e),r&&i(n);return}if(e.uuid){if(!t){console.warn(`ImagePreview: 'client' prop is missing, cannot load remote preview`),r&&u(!0);return}r&&o(!0);try{let a=await t.getFilePreviewBlob(e.uuid);n=URL.createObjectURL(a),r&&i(n)}catch(e){console.error(`Failed to load image preview:`,e),r&&u(!0)}finally{r&&o(!1)}}}return a(),()=>{r=!1,n&&URL.revokeObjectURL(n)}},[e,t]),a?(0,l.jsx)(`div`,{className:h(m.imagePreviewLoading,n),children:(0,l.jsx)(`div`,{className:h(m.spinner,m.spinnerSm)})}):s||!r?(0,l.jsx)(`div`,{className:h(m.imagePreviewError,n),children:s?`Preview failed`:`No preview`}):(0,l.jsx)(`img`,{src:r,alt:`Preview`,className:h(m.imagePreview,n)})}var _={fieldContainer:`_fieldContainer_1tgn0_2`,label:`_label_1tgn0_14`,fieldBody:`_fieldBody_1tgn0_21`,sizeSm:`_sizeSm_1tgn0_28`,dropzone:`_dropzone_1tgn0_28`,sizeMd:`_sizeMd_1tgn0_29`,sizeLg:`_sizeLg_1tgn0_30`,variantPrimary:`_variantPrimary_1tgn0_33`,dropzoneIconWrapper:`_dropzoneIconWrapper_1tgn0_35`,dropzoneTitle:`_dropzoneTitle_1tgn0_36`,browseButton:`_browseButton_1tgn0_37`,fileCard:`_fileCard_1tgn0_39`,spinner:`_spinner_1tgn0_40`,variantSecondary:`_variantSecondary_1tgn0_42`,dropzoneLoading:`_dropzoneLoading_1tgn0_72`,dropzoneContent:`_dropzoneContent_1tgn0_77`,dropzoneIcon:`_dropzoneIcon_1tgn0_35`,dropzoneSub:`_dropzoneSub_1tgn0_109`,fileList:`_fileList_1tgn0_135`,fileCardPreview:`_fileCardPreview_1tgn0_152`,documentPreview:`_documentPreview_1tgn0_163`,documentBadge:`_documentBadge_1tgn0_173`,fileCardDetails:`_fileCardDetails_1tgn0_185`,statusSuccess:`_statusSuccess_1tgn0_193`,fileNameLarge:`_fileNameLarge_1tgn0_203`,fileMeta:`_fileMeta_1tgn0_211`,fileActions:`_fileActions_1tgn0_217`,btnActionBlue:`_btnActionBlue_1tgn0_224`,btnActionRed:`_btnActionRed_1tgn0_243`,hidden:`_hidden_1tgn0_263`,errorText:`_errorText_1tgn0_264`,overlay:`_overlay_1tgn0_266`,spin:`_spin_1tgn0_40`,spinnerSm:`_spinnerSm_1tgn0_286`,extractedPanel:`_extractedPanel_1tgn0_296`,extractedTitle:`_extractedTitle_1tgn0_304`,extractedList:`_extractedList_1tgn0_311`,extractedItem:`_extractedItem_1tgn0_317`,extractedKey:`_extractedKey_1tgn0_329`,extractedVal:`_extractedVal_1tgn0_336`},v=(...e)=>e.filter(Boolean).join(` `),y=e=>{let t=e.name||e.original_name||``,n=e.type||e.mime_type||``;return t.endsWith(`.pdf`)||n.includes(`pdf`)||t.match(/\.(doc|docx|txt)$/i)?(0,l.jsx)(u.FileText,{className:_.fileIcon}):(0,l.jsx)(u.File,{className:_.fileIcon})};function b({label:e,value:t,onChange:n,onExtracted:r,onProcess:i,client:a,showExtracted:o=!0,accept:s=`image/*,application/pdf`,variant:d=`primary`,size:f=`md`,width:p=`full`,className:m=``}){let[h,b]=(0,c.useState)(!1),[x,S]=(0,c.useState)(null),[C,w]=(0,c.useState)(null),T=(0,c.useRef)(null),E=Array.isArray(t)?t:t?[t]:[],D=e=>{e.file&&n(e.file),e.extract_error?S(e.extract_error):e.extracted&&(w(e.extracted),r&&r({...e.extracted}))},O=async e=>{let t=e.target.files?.[0];if(t){b(!0),S(null),w(null);try{let e=await i(t);e&&e.file&&!e.file.size&&!e.file.file_size&&(e.file.size=t.size),D(e)}catch(e){console.error(e),S(`OCR extraction failed`)}finally{b(!1),T.current&&(T.current.value=``)}}},k=async e=>{b(!0),S(null);try{let t=await i(e);t&&t.file&&!t.file.size&&!t.file.file_size&&(t.file.size=e.size||e.file_size),D(t)}catch(e){console.error(e),S(`OCR extraction retry failed`)}finally{b(!1)}},A=e=>{let t=[...E];if(t.splice(e,1),n(t.length===0?null:t),t.length===0){if(C&&r){let e={};for(let t of Object.keys(C))e[t]=``;r(e)}w(null)}},j=e=>e instanceof File?e.type.startsWith(`image/`):e.mime_type?e.mime_type.startsWith(`image/`):e.original_name?/\.(jpg|jpeg|png|gif|webp)$/i.test(e.original_name):!1,M=p===`full`?{width:`100%`}:{width:p};return(0,l.jsxs)(`div`,{className:v(_.fieldContainer,_[`variant${d.charAt(0).toUpperCase()+d.slice(1)}`],_[`size${f.charAt(0).toUpperCase()+f.slice(1)}`],m),style:M,children:[(0,l.jsx)(`label`,{className:_.label,children:e}),(0,l.jsxs)(`div`,{className:_.fieldBody,children:[(0,l.jsx)(`input`,{ref:T,type:`file`,onChange:O,disabled:h,accept:s,className:_.hidden}),E.length===0&&(0,l.jsx)(`div`,{className:v(_.dropzone,h&&_.dropzoneLoading),onClick:()=>T.current?.click(),children:h?(0,l.jsxs)(`div`,{className:_.dropzoneContent,children:[(0,l.jsx)(`div`,{className:v(_.spinner,_.spinnerSm,_.dropzoneIconWrapper)}),(0,l.jsx)(`p`,{className:_.dropzoneTitle,children:`Extracting OCR data...`})]}):(0,l.jsxs)(`div`,{className:_.dropzoneContent,children:[(0,l.jsx)(`div`,{className:_.dropzoneIconWrapper,children:(0,l.jsx)(u.FileUp,{className:_.dropzoneIcon})}),(0,l.jsx)(`p`,{className:_.dropzoneTitle,children:`Drop a document to extract`}),(0,l.jsx)(`p`,{className:_.dropzoneSub,children:`PNG, JPG, JPEG or PDF (Max 5MB)`}),(0,l.jsxs)(`button`,{type:`button`,className:_.browseButton,children:[(0,l.jsx)(u.Folder,{size:16}),`Browse Files`]})]})}),E.length>0&&(0,l.jsx)(`div`,{className:_.fileList,children:E.map((e,t)=>{let n=e.name||e.original_name||`Document`,r=``,i=e?.size||e?.file_size;i&&(r=i>1048576?`${(i/1048576).toFixed(1)} MB`:`${(i/1024).toFixed(1)} KB`);let o=n.split(`.`).pop()?.toUpperCase()||`FILE`;return(0,l.jsxs)(`div`,{className:_.fileCard,children:[(0,l.jsxs)(`div`,{className:_.fileCardPreview,children:[j(e)?(0,l.jsx)(g,{file:e,client:a}):(0,l.jsxs)(`div`,{className:_.documentPreview,children:[y(e),(0,l.jsx)(`span`,{className:_.documentBadge,children:`PDF`})]}),h&&(0,l.jsx)(`div`,{className:_.overlay,children:(0,l.jsx)(`div`,{className:_.spinner})})]}),(0,l.jsxs)(`div`,{className:_.fileCardDetails,children:[(0,l.jsxs)(`div`,{className:_.statusSuccess,children:[(0,l.jsx)(u.CheckCircle2,{size:16}),(0,l.jsx)(`span`,{children:`Document uploaded successfully`})]}),(0,l.jsx)(`h4`,{className:_.fileNameLarge,title:n,children:n}),(0,l.jsxs)(`p`,{className:_.fileMeta,children:[o,` • `,r]}),!h&&(0,l.jsxs)(`div`,{className:_.fileActions,children:[(0,l.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),k(e)},className:_.btnActionBlue,children:[(0,l.jsx)(u.RefreshCw,{size:14}),` Re-extract`]}),(0,l.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),A(t)},className:_.btnActionRed,children:[(0,l.jsx)(u.Trash2,{size:14}),` Delete`]})]})]})]},t)})}),x&&(0,l.jsxs)(`div`,{className:_.fieldBody,children:[(0,l.jsx)(`p`,{className:_.errorText,children:x}),E.length>0&&!C&&(0,l.jsx)(`button`,{type:`button`,onClick:()=>k(E[0]),disabled:h,className:_.btnActionBlue,style:{alignSelf:`flex-start`,marginTop:`0.5rem`},children:h?`Retrying...`:`Retry Extraction`})]}),o&&C&&(0,l.jsxs)(`div`,{className:_.extractedPanel,children:[(0,l.jsx)(`p`,{className:_.extractedTitle,children:`Extracted Data`}),(0,l.jsx)(`div`,{className:_.extractedList,children:Object.entries(C).map(([e,t])=>(0,l.jsxs)(`div`,{className:_.extractedItem,children:[(0,l.jsx)(`span`,{className:_.extractedKey,children:e.replace(/_/g,` `)}),(0,l.jsx)(`span`,{className:_.extractedVal,children:String(t)})]},e))})]})]})]})}var x={gridContainer:`_gridContainer_10n6x_1`,gridTable:`_gridTable_10n6x_9`,gridHeader:`_gridHeader_10n6x_16`,gridHeaderCell:`_gridHeaderCell_10n6x_21`,gridRow:`_gridRow_10n6x_31`,gridCell:`_gridCell_10n6x_44`,gridFooter:`_gridFooter_10n6x_95`,gridFooterCell:`_gridFooterCell_10n6x_101`,addRowButton:`_addRowButton_10n6x_107`,deleteRowButton:`_deleteRowButton_10n6x_127`,actionCell:`_actionCell_10n6x_142`,"variant-compact":`_variant-compact_10n6x_148`,"variant-striped":`_variant-striped_10n6x_164`,desktopOnly:`_desktopOnly_10n6x_169`,mobileOnly:`_mobileOnly_10n6x_172`,mobileListContainer:`_mobileListContainer_10n6x_186`,mobileCard:`_mobileCard_10n6x_192`,mobileCardRow:`_mobileCardRow_10n6x_201`,mobileCardLabel:`_mobileCardLabel_10n6x_211`,mobileCardInputWrapper:`_mobileCardInputWrapper_10n6x_220`,mobileDeleteBtnWrapper:`_mobileDeleteBtnWrapper_10n6x_257`,mobileAggregationsCard:`_mobileAggregationsCard_10n6x_265`,mobileAggregationRow:`_mobileAggregationRow_10n6x_272`,mobileAggregationLabel:`_mobileAggregationLabel_10n6x_283`,mobileAggregationValue:`_mobileAggregationValue_10n6x_290`,mobileSummaryCard:`_mobileSummaryCard_10n6x_296`,mobileSummaryLeft:`_mobileSummaryLeft_10n6x_311`,mobileSummaryRightWrapper:`_mobileSummaryRightWrapper_10n6x_317`,mobileSummaryActions:`_mobileSummaryActions_10n6x_324`,mobileIconButton:`_mobileIconButton_10n6x_329`,mobileIconDanger:`_mobileIconDanger_10n6x_349`,mobileSummaryRight:`_mobileSummaryRight_10n6x_317`,mobileSummaryTitle:`_mobileSummaryTitle_10n6x_361`,mobileSummaryChip:`_mobileSummaryChip_10n6x_367`,mobileSummaryValueRow:`_mobileSummaryValueRow_10n6x_377`},S=({value:e,column:t,rowData:n,rowIndex:r,onChange:i})=>(0,l.jsx)(`td`,{className:x.gridCell,children:t.render?t.render({value:e,onChange:e=>{i(n.id,t.key,e)},rowData:n,rowIndex:r,column:t}):(0,l.jsx)(`span`,{children:e})}),C=({rowData:e,rowIndex:t,columns:n,onChange:r,onDeleteRow:i})=>(0,l.jsxs)(`tr`,{className:x.gridRow,children:[n.map(n=>(0,l.jsx)(S,{value:e[n.key],column:n,rowData:e,rowIndex:t,onChange:r},n.key)),i&&(0,l.jsx)(`td`,{className:`${x.gridCell} ${x.actionCell}`,children:(0,l.jsx)(`button`,{type:`button`,className:x.deleteRowButton,onClick:()=>i(e.id),title:`Remove Row`,children:`Delete`})})]}),w=({data:e,columns:t,onChange:n,aggregations:r,onAddRow:i,onDeleteRow:a,variant:o,showAggregations:s=!0})=>{let u=e=>typeof s==`boolean`?s:!Array.isArray(s)||s.includes(e),d=t.some(e=>e.aggregation&&u(e.key)&&r[e.key]!==void 0),f=(0,c.useRef)(e?e.length:0),p=(0,c.useRef)(null);(0,c.useEffect)(()=>{e&&e.length>f.current&&setTimeout(()=>{if(p.current){let e=p.current.querySelectorAll(`tbody tr`);if(e.length>0){let t=e[e.length-1].querySelector(`input, select, textarea`);t&&t.focus()}}},0),f.current=e?e.length:0},[e]);let m=x[`variant-${o}`]||``;return(0,l.jsxs)(`div`,{className:`${x.gridContainer} ${m}`,children:[(0,l.jsxs)(`table`,{className:x.gridTable,ref:p,children:[(0,l.jsx)(`thead`,{className:x.gridHeader,children:(0,l.jsxs)(`tr`,{children:[t.map(e=>(0,l.jsx)(`th`,{className:x.gridHeaderCell,children:e.title||e.key},e.key)),a&&(0,l.jsx)(`th`,{className:`${x.gridHeaderCell} ${x.actionCell}`})]})}),(0,l.jsx)(`tbody`,{children:e.map((e,r)=>(0,l.jsx)(C,{rowData:e,rowIndex:r,columns:t,onChange:n,onDeleteRow:a},e.id||r))}),d&&(0,l.jsx)(`tfoot`,{className:x.gridFooter,children:(0,l.jsxs)(`tr`,{children:[t.map((e,t)=>{let n=t===0,i=u(e.key)?r[e.key]:void 0;return(0,l.jsx)(`td`,{className:x.gridFooterCell,children:i===void 0?n?`Total`:``:i},e.key)}),a&&(0,l.jsx)(`td`,{className:x.gridFooterCell})]})})]}),i&&(0,l.jsx)(`button`,{className:x.addRowButton,onClick:i,type:`button`,children:`+ Add Row`})]})},T=({data:e,columns:t,onChange:n,aggregations:r,onAddRow:i,onDeleteRow:a,showAggregations:o})=>{let[s,u]=(0,c.useState)(null),d=(0,c.useRef)(e?e.length:0);(0,c.useEffect)(()=>{if(e&&e.length>d.current){let t=e[e.length-1];t&&t.id&&u(t.id)}d.current=e?e.length:0},[e]),(0,c.useEffect)(()=>{s!==null&&setTimeout(()=>{let e=document.getElementById(`mobile-card-${s}`);if(e){e.scrollIntoView({behavior:`smooth`,block:`start`});let t=e.querySelector(`input, select, textarea`);t&&t.focus()}},50)},[s]);let f=e=>typeof o==`boolean`?o:!Array.isArray(o)||o.includes(e),p=t.some(e=>e.aggregation&&f(e.key)&&r[e.key]!==void 0);return(0,l.jsxs)(`div`,{className:x.mobileListContainer,children:[e&&e.length>0?e.map(e=>{if(s===e.id)return(0,l.jsxs)(`div`,{id:`mobile-card-${e.id}`,className:x.mobileCard,children:[t.map(t=>(0,l.jsxs)(`div`,{className:x.mobileCardRow,children:[(0,l.jsx)(`div`,{className:x.mobileCardLabel,children:t.title}),(0,l.jsx)(`div`,{className:x.mobileCardInputWrapper,children:t.render({value:e[t.key],rowData:e,onChange:r=>n(e.id,t.key,r)})})]},t.key)),(0,l.jsxs)(`div`,{className:x.mobileDeleteBtnWrapper,children:[(0,l.jsx)(`button`,{className:x.addRowButton,style:{margin:0,marginRight:`auto`,width:`auto`,padding:`0.35rem 0.75rem`,fontSize:`0.875rem`},onClick:e=>{e.stopPropagation(),u(null)},children:`Done`}),a&&(0,l.jsx)(`button`,{className:x.deleteRowButton,onClick:t=>{t.stopPropagation(),a(e.id),u(null)},"aria-label":`Delete Row`,children:`Delete`})]})]},e.id);let r=t.find(e=>e.mobile?.role===`title`)||t[0],i=t.find(e=>e.mobile?.role===`chip`),o=t.filter(e=>e.mobile?.role===`value`);return(0,l.jsxs)(`div`,{className:x.mobileSummaryCard,onClick:()=>u(e.id),children:[(0,l.jsxs)(`div`,{className:x.mobileSummaryLeft,children:[(0,l.jsx)(`div`,{className:x.mobileSummaryTitle,children:r&&e[r.key]!==void 0&&e[r.key]!==``?e[r.key]:`Row ${e.id}`}),i&&e[i.key]&&(0,l.jsx)(`div`,{children:(0,l.jsx)(`span`,{className:x.mobileSummaryChip,children:e[i.key]})})]}),(0,l.jsxs)(`div`,{className:x.mobileSummaryRightWrapper,children:[(0,l.jsx)(`div`,{className:x.mobileSummaryRight,children:o.map(t=>(0,l.jsxs)(`div`,{className:x.mobileSummaryValueRow,children:[t.title,`: `,(0,l.jsx)(`span`,{children:e[t.key]})]},t.key))}),(0,l.jsxs)(`div`,{className:x.mobileSummaryActions,children:[(0,l.jsx)(`button`,{className:x.mobileIconButton,onClick:t=>{t.stopPropagation(),u(e.id)},"aria-label":`Edit`,title:`Edit`,children:(0,l.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,l.jsx)(`path`,{d:`M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),(0,l.jsx)(`path`,{d:`M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z`})]})}),a&&(0,l.jsx)(`button`,{className:`${x.mobileIconButton} ${x.mobileIconDanger}`,onClick:t=>{t.stopPropagation(),a(e.id)},"aria-label":`Delete`,title:`Delete`,children:(0,l.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,l.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,l.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}),(0,l.jsx)(`line`,{x1:`10`,y1:`11`,x2:`10`,y2:`17`}),(0,l.jsx)(`line`,{x1:`14`,y1:`11`,x2:`14`,y2:`17`})]})})]})]})]},e.id)}):(0,l.jsx)(`div`,{style:{textAlign:`center`,padding:`2rem`,color:`var(--zf-text-muted)`},children:`No data available.`}),i&&(0,l.jsx)(`button`,{className:x.addRowButton,onClick:i,children:`+ Add Row`}),p&&(0,l.jsx)(`div`,{className:x.mobileAggregationsCard,children:t.map(e=>e.aggregation&&f(e.key)&&r[e.key]!==void 0?(0,l.jsxs)(`div`,{className:x.mobileAggregationRow,children:[(0,l.jsxs)(`div`,{className:x.mobileAggregationLabel,children:[e.title,` (Total)`]}),(0,l.jsx)(`div`,{className:x.mobileAggregationValue,children:r[e.key]})]},e.key):null)})]})},E=(e,t)=>(0,c.useMemo)(()=>{if(!e||e.length===0||!t)return{};let n={};return t.forEach(t=>{if(t.aggregation){let r=e.map(e=>Number(e[t.key])).filter(e=>!isNaN(e));if(r.length===0){n[t.key]=0;return}switch(t.aggregation){case`sum`:n[t.key]=r.reduce((e,t)=>e+t,0);break;case`avg`:n[t.key]=r.reduce((e,t)=>e+t,0)/r.length;break;case`min`:n[t.key]=Math.min(...r);break;case`max`:n[t.key]=Math.max(...r);break;default:typeof t.aggregation==`function`&&(n[t.key]=t.aggregation(e,t.key))}}}),n},[e,t]),D=({data:e,columns:t,onChange:n,onAddRow:r,onDeleteRow:i,variant:a=`default`,showAggregations:o=!0})=>{let s=E(e,t);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:x.desktopOnly,children:(0,l.jsx)(w,{data:e,columns:t,onChange:n,aggregations:s,onAddRow:r,onDeleteRow:i,variant:a,showAggregations:o})}),(0,l.jsx)(`div`,{className:x.mobileOnly,children:(0,l.jsx)(T,{data:e,columns:t,onChange:n,aggregations:s,onAddRow:r,onDeleteRow:i,showAggregations:o})})]})};exports.Grid=D,exports.ImagePreview=g,exports.OcrField=b,exports.ZinoClient=p,exports.useGridAggregations=E;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime"),u=require("lucide-react");var d=`field_library_token`,f=`field_library_user`,p=class{constructor({baseUrl:e,appId:t,onAuthError:n}){if(!e)throw Error(`baseUrl is required`);if(!t)throw Error(`appId is required`);if(this.baseUrl=e.replace(/\/+$/,``),this.appId=t,this.onAuthError=n,this.token=null,this.user=null,typeof window<`u`){this.token=localStorage.getItem(d);try{let e=localStorage.getItem(f);e&&(this.user=JSON.parse(e))}catch{this.user=null}}}setAuthErrorHandler(e){this.onAuthError=e}setToken(e){this.token=e,!(typeof window>`u`)&&(e?localStorage.setItem(d,e):(localStorage.removeItem(d),localStorage.removeItem(f),this.user=null))}getToken(){return this.token}async request(e,t,n,r={}){let i={"Content-Type":`application/json`,...r};return this.token&&(i.Authorization=`Bearer ${this.token}`),this.send(e,t,{headers:i,body:n===void 0?void 0:JSON.stringify(n)})}async requestForm(e,t){let n={};return this.token&&(n.Authorization=`Bearer ${this.token}`),this.send(`POST`,e,{headers:n,body:t})}async send(e,t,n){let r=await fetch(`${this.baseUrl}${t}`,{method:e,...n});if(r.status===401)throw this.setToken(null),this.onAuthError?.(),{status:401,message:`Unauthorized`};if(!r.ok){let e=r.statusText;try{let t=await r.json();t.error&&(e=t.error)}catch{}throw{status:r.status,message:e}}if(r.status!==204)return await r.json()}async login(e,t,n){let r=await this.request(`POST`,`/usr/login`,{email:e,password:t,...n?{org_id:Number(n)}:{}});return this.setToken(r.token),typeof window<`u`&&r.user&&(this.user=r.user,localStorage.setItem(f,JSON.stringify(r.user))),r}logout(){this.setToken(null)}async getMe(){let e=await this.request(`GET`,`/usr/app/${this.appId}/me`);return this.user&&(this.user={...this.user,...e},typeof window<`u`&&localStorage.setItem(f,JSON.stringify(this.user))),e}currentUser(){if(!this.token)return null;if(this.user)return this.user;try{let e=JSON.parse(atob(this.token.split(`.`)[1]));return{id:String(e.user_id??e.sub??``),org_id:String(e.org_id??``),name:e.name??``,email:e.email??``,mobile:String(e.mobile??e.mobile_number??e.phone??e.phone_number??e.user_mobile??``),roles:e.roles??[],groups:e.groups??[]}}catch{return null}}recordView(e,t={}){return this.request(`POST`,`/app/${this.appId}/view/recordview`,{rv_template_uid:e,...t.presetAlias?{preset_alias:t.presetAlias}:{},search_query:{page:t.page??1,limit:t.limit??50,sort_by:t.sortBy??``,sort_dir:t.sortDir??`desc`,search:t.search??``,filters:(t.filters??[]).map(e=>{let t={field_key:e.field_key,data_type:e.data_type??`character varying`};return e.values&&e.values.length>0?t.values=e.values:(t.value=e.value??``,t.value2=``),t})}})}detailView(e,t){return this.request(`GET`,`/app/${this.appId}/view/detailview/${e}?instance_id=${encodeURIComponent(String(t))}`)}audit(e){return this.request(`GET`,`/app/${this.appId}/view/audit?instance_id=${encodeURIComponent(String(e))}`)}aiDecisions(e){return this.request(`GET`,`/monitor/decisions?instance_id=${encodeURIComponent(String(e))}`).then(e=>e.decisions??[])}formSchema(e,t){return this.request(`POST`,`/app/${this.appId}/view/form-screens`,{activity_id:e,device_type:`desktop`,...t==null?{}:{instance_id:t}})}startInstance(e,t,n){return this.request(`POST`,`/app/${this.appId}/start`,{workflow_uuid:e,activity_id:t,data:n})}performActivity(e,t,n,r){return this.request(`POST`,`/app/${this.appId}/activity`,{workflow_uuid:e,instance_id:typeof t==`string`&&Number(t)||t,activity_id:n,data:r})}lookupRecords(e,t,n){return this.request(`POST`,`/app/${this.appId}/rdbms-templates/${t}/records`,{workflow_uuid:e,activity_id:n.activityId,field_id:n.fieldId,instance_id:n.instanceId||void 0,search:n.search??``,limit:n.limit??50,offset:0,form_data:n.formData??{}})}wfLookupRecords(e,t){return this.request(`POST`,`/app/${this.appId}/wf-lookup/records`,{workflow_uuid:e,activity_id:t.activityId,field_id:t.fieldId,form_data:t.formData??{},search:t.search??``,limit:t.limit??100,offset:t.offset??0})}datasetOptions(e,t){return this.request(`POST`,`/app/${this.appId}/dataset-options`,{workflow_uuid:e,activity_id:t.activityId,field_id:t.fieldId,instance_id:t.instanceId||void 0,search:t.search??``,limit:t.limit??200,offset:0,form_data:t.formData??{}})}getDatasets(){return this.request(`GET`,`/app/${this.appId}/datasets`)}getDataset(e){return this.request(`GET`,`/app/${this.appId}/datasets/${e}`)}createDataset(e){return this.request(`POST`,`/app/${this.appId}/datasets`,e)}updateDataset(e,t){return this.request(`PUT`,`/app/${this.appId}/datasets/${e}`,t)}fieldForm(e,t,n){let r=new FormData;return r.append(`file`,t),r.append(`workflow_uuid`,e),r.append(`activity_id`,n.activityId),r.append(`field_id`,n.fieldId),n.instanceId!=null&&r.append(`instance_id`,String(n.instanceId)),r}uploadFile(e,t,n){return this.requestForm(`/app/${this.appId}/upload`,this.fieldForm(e,t,n))}async extractOcr(e,t,n){if(t instanceof File||t instanceof Blob){let r=new FormData;return r.append(`file`,t),r.append(`store_file`,`true`),r.append(`workflow_uuid`,e),r.append(`activity_id`,n.activityId),r.append(`field_id`,n.fieldId),n.versionUuid&&r.append(`version_uuid`,n.versionUuid),n.instanceId!=null&&r.append(`instance_id`,String(n.instanceId)),this.requestForm(`/app/${this.appId}/ocr-extract`,r)}{let r={workflow_uuid:e,activity_id:n.activityId,field_id:n.fieldId,version_uuid:n.versionUuid,files:[t]};return n.instanceId!=null&&(r.instance_id=Number(n.instanceId)),{...await this.request(`POST`,`/app/${this.appId}/ocr-extract`,r),file:t}}}async getFilePreviewBlob(e){let t={};this.token&&(t.Authorization=`Bearer ${this.token}`);let n=await fetch(`${this.baseUrl}/app/${this.appId}/view/files/${e}/preview`,{method:`GET`,headers:t});if(n.status===401)throw this.setToken(null),this.onAuthError?.(),{status:401,message:`Unauthorized`};if(!n.ok)throw{status:n.status,message:`Failed to fetch preview`};return await n.blob()}},m={imagePreviewLoading:`_imagePreviewLoading_s2a11_1`,spinner:`_spinner_s2a11_10`,"zf-spin":`_zf-spin_s2a11_1`,spinnerSm:`_spinnerSm_s2a11_19`,imagePreviewError:`_imagePreviewError_s2a11_28`,imagePreview:`_imagePreview_s2a11_1`},h=(...e)=>e.filter(Boolean).join(` `);function g({file:e,client:t,className:n=``}){let[r,i]=(0,c.useState)(null),[a,o]=(0,c.useState)(!1),[s,u]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{let n=null,r=!0;async function a(){if(!e){r&&i(null);return}if(e instanceof File){n=URL.createObjectURL(e),r&&i(n);return}if(e.uuid){if(!t){console.warn(`ImagePreview: 'client' prop is missing, cannot load remote preview`),r&&u(!0);return}r&&o(!0);try{let a=await t.getFilePreviewBlob(e.uuid);n=URL.createObjectURL(a),r&&i(n)}catch(e){console.error(`Failed to load image preview:`,e),r&&u(!0)}finally{r&&o(!1)}}}return a(),()=>{r=!1,n&&URL.revokeObjectURL(n)}},[e,t]),a?(0,l.jsx)(`div`,{className:h(m.imagePreviewLoading,n),children:(0,l.jsx)(`div`,{className:h(m.spinner,m.spinnerSm)})}):s||!r?(0,l.jsx)(`div`,{className:h(m.imagePreviewError,n),children:s?`Preview failed`:`No preview`}):(0,l.jsx)(`img`,{src:r,alt:`Preview`,className:h(m.imagePreview,n)})}var _={fieldContainer:`_fieldContainer_1tgn0_2`,label:`_label_1tgn0_14`,fieldBody:`_fieldBody_1tgn0_21`,sizeSm:`_sizeSm_1tgn0_28`,dropzone:`_dropzone_1tgn0_28`,sizeMd:`_sizeMd_1tgn0_29`,sizeLg:`_sizeLg_1tgn0_30`,variantPrimary:`_variantPrimary_1tgn0_33`,dropzoneIconWrapper:`_dropzoneIconWrapper_1tgn0_35`,dropzoneTitle:`_dropzoneTitle_1tgn0_36`,browseButton:`_browseButton_1tgn0_37`,fileCard:`_fileCard_1tgn0_39`,spinner:`_spinner_1tgn0_40`,variantSecondary:`_variantSecondary_1tgn0_42`,dropzoneLoading:`_dropzoneLoading_1tgn0_72`,dropzoneContent:`_dropzoneContent_1tgn0_77`,dropzoneIcon:`_dropzoneIcon_1tgn0_35`,dropzoneSub:`_dropzoneSub_1tgn0_109`,fileList:`_fileList_1tgn0_135`,fileCardPreview:`_fileCardPreview_1tgn0_152`,documentPreview:`_documentPreview_1tgn0_163`,documentBadge:`_documentBadge_1tgn0_173`,fileCardDetails:`_fileCardDetails_1tgn0_185`,statusSuccess:`_statusSuccess_1tgn0_193`,fileNameLarge:`_fileNameLarge_1tgn0_203`,fileMeta:`_fileMeta_1tgn0_211`,fileActions:`_fileActions_1tgn0_217`,btnActionBlue:`_btnActionBlue_1tgn0_224`,btnActionRed:`_btnActionRed_1tgn0_243`,hidden:`_hidden_1tgn0_263`,errorText:`_errorText_1tgn0_264`,overlay:`_overlay_1tgn0_266`,spin:`_spin_1tgn0_40`,spinnerSm:`_spinnerSm_1tgn0_286`,extractedPanel:`_extractedPanel_1tgn0_296`,extractedTitle:`_extractedTitle_1tgn0_304`,extractedList:`_extractedList_1tgn0_311`,extractedItem:`_extractedItem_1tgn0_317`,extractedKey:`_extractedKey_1tgn0_329`,extractedVal:`_extractedVal_1tgn0_336`},v=(...e)=>e.filter(Boolean).join(` `),y=e=>{let t=e.name||e.original_name||``,n=e.type||e.mime_type||``;return t.endsWith(`.pdf`)||n.includes(`pdf`)||t.match(/\.(doc|docx|txt)$/i)?(0,l.jsx)(u.FileText,{className:_.fileIcon}):(0,l.jsx)(u.File,{className:_.fileIcon})};function b({label:e,value:t,onChange:n,onExtracted:r,onProcess:i,client:a,showExtracted:o=!0,accept:s=`image/*,application/pdf`,variant:d=`primary`,size:f=`md`,width:p=`full`,className:m=``}){let[h,b]=(0,c.useState)(!1),[x,S]=(0,c.useState)(null),[C,w]=(0,c.useState)(null),T=(0,c.useRef)(null),E=Array.isArray(t)?t:t?[t]:[],D=e=>{e.file&&n(e.file),e.extract_error?S(e.extract_error):e.extracted&&(w(e.extracted),r&&r({...e.extracted}))},O=async e=>{let t=e.target.files?.[0];if(t){b(!0),S(null),w(null);try{let e=await i(t);e&&e.file&&!e.file.size&&!e.file.file_size&&(e.file.size=t.size),D(e)}catch(e){console.error(e),S(`OCR extraction failed`)}finally{b(!1),T.current&&(T.current.value=``)}}},k=async e=>{b(!0),S(null);try{let t=await i(e);t&&t.file&&!t.file.size&&!t.file.file_size&&(t.file.size=e.size||e.file_size),D(t)}catch(e){console.error(e),S(`OCR extraction retry failed`)}finally{b(!1)}},A=e=>{let t=[...E];if(t.splice(e,1),n(t.length===0?null:t),t.length===0){if(C&&r){let e={};for(let t of Object.keys(C))e[t]=``;r(e)}w(null)}},j=e=>e instanceof File?e.type.startsWith(`image/`):e.mime_type?e.mime_type.startsWith(`image/`):e.original_name?/\.(jpg|jpeg|png|gif|webp)$/i.test(e.original_name):!1,M=p===`full`?{width:`100%`}:{width:p};return(0,l.jsxs)(`div`,{className:v(_.fieldContainer,_[`variant${d.charAt(0).toUpperCase()+d.slice(1)}`],_[`size${f.charAt(0).toUpperCase()+f.slice(1)}`],m),style:M,children:[(0,l.jsx)(`label`,{className:_.label,children:e}),(0,l.jsxs)(`div`,{className:_.fieldBody,children:[(0,l.jsx)(`input`,{ref:T,type:`file`,onChange:O,disabled:h,accept:s,className:_.hidden}),E.length===0&&(0,l.jsx)(`div`,{className:v(_.dropzone,h&&_.dropzoneLoading),onClick:()=>T.current?.click(),children:h?(0,l.jsxs)(`div`,{className:_.dropzoneContent,children:[(0,l.jsx)(`div`,{className:v(_.spinner,_.spinnerSm,_.dropzoneIconWrapper)}),(0,l.jsx)(`p`,{className:_.dropzoneTitle,children:`Extracting OCR data...`})]}):(0,l.jsxs)(`div`,{className:_.dropzoneContent,children:[(0,l.jsx)(`div`,{className:_.dropzoneIconWrapper,children:(0,l.jsx)(u.FileUp,{className:_.dropzoneIcon})}),(0,l.jsx)(`p`,{className:_.dropzoneTitle,children:`Drop a document to extract`}),(0,l.jsx)(`p`,{className:_.dropzoneSub,children:`PNG, JPG, JPEG or PDF (Max 5MB)`}),(0,l.jsxs)(`button`,{type:`button`,className:_.browseButton,children:[(0,l.jsx)(u.Folder,{size:16}),`Browse Files`]})]})}),E.length>0&&(0,l.jsx)(`div`,{className:_.fileList,children:E.map((e,t)=>{let n=e.name||e.original_name||`Document`,r=``,i=e?.size||e?.file_size;i&&(r=i>1048576?`${(i/1048576).toFixed(1)} MB`:`${(i/1024).toFixed(1)} KB`);let o=n.split(`.`).pop()?.toUpperCase()||`FILE`;return(0,l.jsxs)(`div`,{className:_.fileCard,children:[(0,l.jsxs)(`div`,{className:_.fileCardPreview,children:[j(e)?(0,l.jsx)(g,{file:e,client:a}):(0,l.jsxs)(`div`,{className:_.documentPreview,children:[y(e),(0,l.jsx)(`span`,{className:_.documentBadge,children:`PDF`})]}),h&&(0,l.jsx)(`div`,{className:_.overlay,children:(0,l.jsx)(`div`,{className:_.spinner})})]}),(0,l.jsxs)(`div`,{className:_.fileCardDetails,children:[(0,l.jsxs)(`div`,{className:_.statusSuccess,children:[(0,l.jsx)(u.CheckCircle2,{size:16}),(0,l.jsx)(`span`,{children:`Document uploaded successfully`})]}),(0,l.jsx)(`h4`,{className:_.fileNameLarge,title:n,children:n}),(0,l.jsxs)(`p`,{className:_.fileMeta,children:[o,` • `,r]}),!h&&(0,l.jsxs)(`div`,{className:_.fileActions,children:[(0,l.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),k(e)},className:_.btnActionBlue,children:[(0,l.jsx)(u.RefreshCw,{size:14}),` Re-extract`]}),(0,l.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),A(t)},className:_.btnActionRed,children:[(0,l.jsx)(u.Trash2,{size:14}),` Delete`]})]})]})]},t)})}),x&&(0,l.jsxs)(`div`,{className:_.fieldBody,children:[(0,l.jsx)(`p`,{className:_.errorText,children:x}),E.length>0&&!C&&(0,l.jsx)(`button`,{type:`button`,onClick:()=>k(E[0]),disabled:h,className:_.btnActionBlue,style:{alignSelf:`flex-start`,marginTop:`0.5rem`},children:h?`Retrying...`:`Retry Extraction`})]}),o&&C&&(0,l.jsxs)(`div`,{className:_.extractedPanel,children:[(0,l.jsx)(`p`,{className:_.extractedTitle,children:`Extracted Data`}),(0,l.jsx)(`div`,{className:_.extractedList,children:Object.entries(C).map(([e,t])=>(0,l.jsxs)(`div`,{className:_.extractedItem,children:[(0,l.jsx)(`span`,{className:_.extractedKey,children:e.replace(/_/g,` `)}),(0,l.jsx)(`span`,{className:_.extractedVal,children:String(t)})]},e))})]})]})]})}var x={gridContainer:`_gridContainer_1ga7t_1`,gridTable:`_gridTable_1ga7t_17`,gridHeader:`_gridHeader_1ga7t_31`,gridHeaderCell:`_gridHeaderCell_1ga7t_41`,gridRow:`_gridRow_1ga7t_61`,gridCell:`_gridCell_1ga7t_87`,gridFooter:`_gridFooter_1ga7t_189`,gridFooterCell:`_gridFooterCell_1ga7t_201`,addRowButton:`_addRowButton_1ga7t_213`,deleteRowButton:`_deleteRowButton_1ga7t_253`,actionCell:`_actionCell_1ga7t_283`,"variant-compact":`_variant-compact_1ga7t_295`,"variant-striped":`_variant-striped_1ga7t_327`,desktopOnly:`_desktopOnly_1ga7t_337`,mobileOnly:`_mobileOnly_1ga7t_343`,mobileListContainer:`_mobileListContainer_1ga7t_371`,mobileCard:`_mobileCard_1ga7t_383`,mobileCardRow:`_mobileCardRow_1ga7t_401`,mobileCardLabel:`_mobileCardLabel_1ga7t_421`,mobileCardInputWrapper:`_mobileCardInputWrapper_1ga7t_439`,mobileDeleteBtnWrapper:`_mobileDeleteBtnWrapper_1ga7t_513`,mobileAggregationsCard:`_mobileAggregationsCard_1ga7t_529`,mobileAggregationRow:`_mobileAggregationRow_1ga7t_543`,mobileAggregationLabel:`_mobileAggregationLabel_1ga7t_565`,mobileAggregationValue:`_mobileAggregationValue_1ga7t_579`,mobileSummaryCard:`_mobileSummaryCard_1ga7t_591`,mobileSummaryLeft:`_mobileSummaryLeft_1ga7t_621`,mobileSummaryRightWrapper:`_mobileSummaryRightWrapper_1ga7t_633`,mobileSummaryActions:`_mobileSummaryActions_1ga7t_647`,mobileIconButton:`_mobileIconButton_1ga7t_657`,mobileIconDanger:`_mobileIconDanger_1ga7t_697`,mobileSummaryRight:`_mobileSummaryRight_1ga7t_633`,mobileSummaryTitle:`_mobileSummaryTitle_1ga7t_721`,mobileSummaryChip:`_mobileSummaryChip_1ga7t_733`,mobileSummaryValueRow:`_mobileSummaryValueRow_1ga7t_753`},S=({value:e,column:t,rowData:n,rowIndex:r,onChange:i})=>(0,l.jsx)(`td`,{className:x.gridCell,children:t.render?t.render({value:e,onChange:e=>{i(n.id,t.key,e)},rowData:n,rowIndex:r,column:t}):(0,l.jsx)(`span`,{children:e})}),C=({rowData:e,rowIndex:t,columns:n,onChange:r,onDeleteRow:i})=>(0,l.jsxs)(`tr`,{className:x.gridRow,children:[n.map(n=>(0,l.jsx)(S,{value:e[n.key],column:n,rowData:e,rowIndex:t,onChange:r},n.key)),i&&(0,l.jsx)(`td`,{className:`${x.gridCell} ${x.actionCell}`,children:(0,l.jsx)(`button`,{type:`button`,className:x.deleteRowButton,onClick:()=>i(e.id),title:`Remove Row`,children:`Delete`})})]}),w=({data:e,columns:t,onChange:n,aggregations:r,onAddRow:i,onDeleteRow:a,variant:o,showAggregations:s=!0})=>{let u=e=>typeof s==`boolean`?s:!Array.isArray(s)||s.includes(e),d=t.some(e=>e.aggregation&&u(e.key)&&r[e.key]!==void 0),f=(0,c.useRef)(e?e.length:0),p=(0,c.useRef)(null);(0,c.useEffect)(()=>{e&&e.length>f.current&&setTimeout(()=>{if(p.current){let e=p.current.querySelectorAll(`tbody tr`);if(e.length>0){let t=e[e.length-1].querySelector(`input, select, textarea`);t&&t.focus()}}},0),f.current=e?e.length:0},[e]);let m=x[`variant-${o}`]||``;return(0,l.jsxs)(`div`,{className:`${x.gridContainer} ${m}`,children:[(0,l.jsxs)(`table`,{className:x.gridTable,ref:p,children:[(0,l.jsx)(`thead`,{className:x.gridHeader,children:(0,l.jsxs)(`tr`,{children:[t.map(e=>(0,l.jsx)(`th`,{className:x.gridHeaderCell,children:e.title||e.key},e.key)),a&&(0,l.jsx)(`th`,{className:`${x.gridHeaderCell} ${x.actionCell}`})]})}),(0,l.jsx)(`tbody`,{children:e.map((e,r)=>(0,l.jsx)(C,{rowData:e,rowIndex:r,columns:t,onChange:n,onDeleteRow:a},e.id||r))}),d&&(0,l.jsx)(`tfoot`,{className:x.gridFooter,children:(0,l.jsxs)(`tr`,{children:[t.map((e,t)=>{let n=t===0,i=u(e.key)?r[e.key]:void 0;return(0,l.jsx)(`td`,{className:x.gridFooterCell,children:i===void 0?n?`Total`:``:i},e.key)}),a&&(0,l.jsx)(`td`,{className:x.gridFooterCell})]})})]}),i&&(0,l.jsx)(`button`,{className:x.addRowButton,onClick:i,type:`button`,children:`+ Add Row`})]})},T=({data:e,columns:t,onChange:n,aggregations:r,onAddRow:i,onDeleteRow:a,showAggregations:o})=>{let[s,u]=(0,c.useState)(null),d=(0,c.useRef)(e?e.length:0);(0,c.useEffect)(()=>{if(e&&e.length>d.current){let t=e[e.length-1];t&&t.id&&u(t.id)}d.current=e?e.length:0},[e]),(0,c.useEffect)(()=>{s!==null&&setTimeout(()=>{let e=document.getElementById(`mobile-card-${s}`);if(e){e.scrollIntoView({behavior:`smooth`,block:`start`});let t=e.querySelector(`input, select, textarea`);t&&t.focus()}},50)},[s]);let f=e=>typeof o==`boolean`?o:!Array.isArray(o)||o.includes(e),p=t.some(e=>e.aggregation&&f(e.key)&&r[e.key]!==void 0);return(0,l.jsxs)(`div`,{className:x.mobileListContainer,children:[e&&e.length>0?e.map(e=>{if(s===e.id)return(0,l.jsxs)(`div`,{id:`mobile-card-${e.id}`,className:x.mobileCard,children:[t.map(t=>(0,l.jsxs)(`div`,{className:x.mobileCardRow,children:[(0,l.jsx)(`div`,{className:x.mobileCardLabel,children:t.title}),(0,l.jsx)(`div`,{className:x.mobileCardInputWrapper,children:t.render({value:e[t.key],rowData:e,onChange:r=>n(e.id,t.key,r)})})]},t.key)),(0,l.jsxs)(`div`,{className:x.mobileDeleteBtnWrapper,children:[(0,l.jsx)(`button`,{className:x.addRowButton,style:{margin:0,marginRight:`auto`,width:`auto`,padding:`0.35rem 0.75rem`,fontSize:`0.875rem`},onClick:e=>{e.stopPropagation(),u(null)},children:`Done`}),a&&(0,l.jsx)(`button`,{className:x.deleteRowButton,onClick:t=>{t.stopPropagation(),a(e.id),u(null)},"aria-label":`Delete Row`,children:`Delete`})]})]},e.id);let r=t.find(e=>e.mobile?.role===`title`)||t[0],i=t.find(e=>e.mobile?.role===`chip`),o=t.filter(e=>e.mobile?.role===`value`);return(0,l.jsxs)(`div`,{className:x.mobileSummaryCard,onClick:()=>u(e.id),children:[(0,l.jsxs)(`div`,{className:x.mobileSummaryLeft,children:[(0,l.jsx)(`div`,{className:x.mobileSummaryTitle,children:r&&e[r.key]!==void 0&&e[r.key]!==``?e[r.key]:`Row ${e.id}`}),i&&e[i.key]&&(0,l.jsx)(`div`,{children:(0,l.jsx)(`span`,{className:x.mobileSummaryChip,children:e[i.key]})})]}),(0,l.jsxs)(`div`,{className:x.mobileSummaryRightWrapper,children:[(0,l.jsx)(`div`,{className:x.mobileSummaryRight,children:o.map(t=>(0,l.jsxs)(`div`,{className:x.mobileSummaryValueRow,children:[t.title,`: `,(0,l.jsx)(`span`,{children:e[t.key]})]},t.key))}),(0,l.jsxs)(`div`,{className:x.mobileSummaryActions,children:[(0,l.jsx)(`button`,{className:x.mobileIconButton,onClick:t=>{t.stopPropagation(),u(e.id)},"aria-label":`Edit`,title:`Edit`,children:(0,l.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,l.jsx)(`path`,{d:`M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),(0,l.jsx)(`path`,{d:`M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z`})]})}),a&&(0,l.jsx)(`button`,{className:`${x.mobileIconButton} ${x.mobileIconDanger}`,onClick:t=>{t.stopPropagation(),a(e.id)},"aria-label":`Delete`,title:`Delete`,children:(0,l.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,l.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,l.jsx)(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}),(0,l.jsx)(`line`,{x1:`10`,y1:`11`,x2:`10`,y2:`17`}),(0,l.jsx)(`line`,{x1:`14`,y1:`11`,x2:`14`,y2:`17`})]})})]})]})]},e.id)}):(0,l.jsx)(`div`,{style:{textAlign:`center`,padding:`2rem`,color:`var(--zf-text-muted)`},children:`No data available.`}),i&&(0,l.jsx)(`button`,{className:x.addRowButton,onClick:i,children:`+ Add Row`}),p&&(0,l.jsx)(`div`,{className:x.mobileAggregationsCard,children:t.map(e=>e.aggregation&&f(e.key)&&r[e.key]!==void 0?(0,l.jsxs)(`div`,{className:x.mobileAggregationRow,children:[(0,l.jsxs)(`div`,{className:x.mobileAggregationLabel,children:[e.title,` (Total)`]}),(0,l.jsx)(`div`,{className:x.mobileAggregationValue,children:r[e.key]})]},e.key):null)})]})},E=(e,t)=>(0,c.useMemo)(()=>{if(!e||e.length===0||!t)return{};let n={};return t.forEach(t=>{if(t.aggregation){let r=e.map(e=>Number(e[t.key])).filter(e=>!isNaN(e));if(r.length===0){n[t.key]=0;return}switch(t.aggregation){case`sum`:n[t.key]=r.reduce((e,t)=>e+t,0);break;case`avg`:n[t.key]=r.reduce((e,t)=>e+t,0)/r.length;break;case`min`:n[t.key]=Math.min(...r);break;case`max`:n[t.key]=Math.max(...r);break;default:typeof t.aggregation==`function`&&(n[t.key]=t.aggregation(e,t.key))}}}),n},[e,t]),D=({data:e,columns:t,onChange:n,onAddRow:r,onDeleteRow:i,variant:a=`default`,showAggregations:o=!0})=>{let s=E(e,t);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{className:x.desktopOnly,children:(0,l.jsx)(w,{data:e,columns:t,onChange:n,aggregations:s,onAddRow:r,onDeleteRow:i,variant:a,showAggregations:o})}),(0,l.jsx)(`div`,{className:x.mobileOnly,children:(0,l.jsx)(T,{data:e,columns:t,onChange:n,aggregations:s,onAddRow:r,onDeleteRow:i,showAggregations:o})})]})};exports.Grid=D,exports.ImagePreview=g,exports.OcrField=b,exports.ZinoClient=p,exports.useGridAggregations=E;
@@ -1,2 +1,2 @@
1
- :root{--zf-primary-color:#3b82f6;--zf-primary-hover:#2563eb;--zf-primary-bg-subtle:#3b82f605;--zf-primary-bg-hover:#3b82f614;--zf-secondary-color:#64748b;--zf-secondary-hover:#475569;--zf-secondary-bg-hover:#64748b14;--zf-danger-color:#ef4444;--zf-danger-hover:#dc2828;--zf-danger-bg:#fee2e2;--zf-danger-bg-hover:#ef444426;--zf-border-color:#e2e8f0;--zf-border-style:dashed;--zf-text-color:#0f172a;--zf-text-muted:#64748b;--zf-text-inverse:#fff;--zf-surface-bg:#fff;--zf-surface-subtle:#f1f5f9;--zf-surface-overlay:#ffffffb3;--zf-font-family:inherit;--zf-font-size-xs:.75rem;--zf-font-size-sm:.875rem;--zf-font-size-md:1rem;--zf-font-size-lg:1.125rem;--zf-font-weight-normal:400;--zf-font-weight-medium:500;--zf-font-weight-semibold:600;--zf-font-weight-bold:700;--zf-spacing-1:.25rem;--zf-spacing-1-5:.375rem;--zf-spacing-2:.5rem;--zf-spacing-3:.75rem;--zf-spacing-4:1rem;--zf-spacing-5:1.25rem;--zf-spacing-6:1.5rem;--zf-spacing-8:2rem;--zf-spacing-16:4rem;--zf-radius-sm:.25rem;--zf-radius-md:.375rem;--zf-radius:.5rem;--zf-radius-lg:.5rem;--zf-radius-full:9999px;--zf-shadow-sm:0 1px 2px 0 #0000000d;--zf-shadow-md:0 4px 6px -1px #0000001a, 0 2px 4px -1px #0000000f;--zf-shadow-lg:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--zf-screen-sm:640px;--zf-screen-md:768px;--zf-screen-lg:1024px;--zf-screen-xl:1280px;--zf-z-base:1;--zf-z-overlay:10;--zf-z-modal:50;--zf-z-max:9999}._imagePreviewLoading_s2a11_1{background-color:var(--zf-surface-subtle);justify-content:center;align-items:center;width:100%;height:100%;display:flex}._spinner_s2a11_10{width:var(--zf-spacing-8);height:var(--zf-spacing-8);border:2px solid var(--zf-primary-color);border-radius:var(--zf-radius-full);border-top-color:#0000;animation:1s linear infinite _zf-spin_s2a11_1}._spinnerSm_s2a11_19{width:var(--zf-spacing-6);height:var(--zf-spacing-6)}@keyframes _zf-spin_s2a11_1{to{transform:rotate(360deg)}}._imagePreviewError_s2a11_28{background-color:var(--zf-danger-bg);color:var(--zf-danger-color);font-size:var(--zf-font-size-xs);text-align:center;padding:var(--zf-spacing-2);justify-content:center;align-items:center;width:100%;height:100%;display:flex}._imagePreview_s2a11_1{object-fit:cover;width:100%;height:100%}._fieldContainer_1tgn0_2{gap:var(--zf-spacing-2);font-family:var(--zf-font-family);box-sizing:border-box;flex-direction:column;display:flex}._fieldContainer_1tgn0_2 *{box-sizing:border-box}._label_1tgn0_14{color:#111827;margin-bottom:.5rem;font-size:1rem;font-weight:600}._fieldBody_1tgn0_21{gap:var(--zf-spacing-3);flex-direction:column;display:flex}._sizeSm_1tgn0_28 ._dropzone_1tgn0_28{padding:var(--zf-spacing-4);min-height:auto}._sizeMd_1tgn0_29 ._dropzone_1tgn0_28{padding:var(--zf-spacing-8) var(--zf-spacing-6)}._sizeLg_1tgn0_30 ._dropzone_1tgn0_28{padding:2.5rem 1.5rem}._variantPrimary_1tgn0_33 ._dropzone_1tgn0_28{border-color:var(--zf-primary-color,#3b82f6);background-color:var(--zf-primary-bg-subtle,#f8fafc)}._variantPrimary_1tgn0_33 ._dropzone_1tgn0_28:hover{background-color:var(--zf-primary-bg-hover,#f1f5f9);border-color:var(--zf-primary-hover,#2563eb)}._variantPrimary_1tgn0_33 ._dropzoneIconWrapper_1tgn0_35{background-color:var(--zf-primary-bg-subtle,#eff6ff);color:var(--zf-primary-color,#3b82f6)}._variantPrimary_1tgn0_33 ._dropzoneTitle_1tgn0_36{color:var(--zf-primary-color,#3b82f6)}._variantPrimary_1tgn0_33 ._browseButton_1tgn0_37{border-color:var(--zf-primary-color,#3b82f6);color:var(--zf-primary-color,#3b82f6)}._variantPrimary_1tgn0_33 ._browseButton_1tgn0_37:hover{background-color:var(--zf-primary-bg-subtle,#eff6ff)}._variantPrimary_1tgn0_33 ._fileCard_1tgn0_39{border-color:var(--zf-primary-color,#3b82f6);background-color:var(--zf-primary-bg-subtle,#f8fafc)}._variantPrimary_1tgn0_33 ._spinner_1tgn0_40{border-color:var(--zf-primary-color,#3b82f6);border-top-color:#0000}._variantSecondary_1tgn0_42 ._dropzone_1tgn0_28{border-color:var(--zf-secondary-color,#64748b);background-color:var(--zf-surface-subtle,#f8fafc)}._variantSecondary_1tgn0_42 ._dropzone_1tgn0_28:hover{background-color:var(--zf-secondary-bg-hover,#f1f5f9);border-color:var(--zf-text-color,#334155)}._variantSecondary_1tgn0_42 ._dropzoneIconWrapper_1tgn0_35{background-color:var(--zf-surface-subtle,#f1f5f9);color:var(--zf-secondary-color,#64748b)}._variantSecondary_1tgn0_42 ._dropzoneTitle_1tgn0_36{color:var(--zf-secondary-color,#64748b)}._variantSecondary_1tgn0_42 ._browseButton_1tgn0_37{border-color:var(--zf-secondary-color,#64748b);color:var(--zf-secondary-color,#64748b)}._variantSecondary_1tgn0_42 ._browseButton_1tgn0_37:hover{background-color:var(--zf-surface-subtle,#f1f5f9)}._variantSecondary_1tgn0_42 ._fileCard_1tgn0_39{border-color:var(--zf-secondary-color,#64748b);background-color:var(--zf-surface-subtle,#f8fafc)}._variantSecondary_1tgn0_42 ._spinner_1tgn0_40{border-color:var(--zf-secondary-color,#64748b);border-top-color:#0000}._dropzone_1tgn0_28{border-width:2px;border-style:var(--zf-border-style,dashed);border-radius:var(--zf-radius,12px);text-align:center;cursor:pointer;background-color:#f8fafc;border-color:#3b82f6;flex-direction:column;justify-content:center;align-items:center;padding:2.5rem 1.5rem;transition:all .2s;display:flex}._dropzone_1tgn0_28:hover{background-color:#f1f5f9}._dropzoneLoading_1tgn0_72{opacity:.5;pointer-events:none}._dropzoneContent_1tgn0_77{flex-direction:column;justify-content:center;align-items:center;gap:.5rem;display:flex}._dropzoneIconWrapper_1tgn0_35{color:#3b82f6;background-color:#eff6ff;border-radius:50%;justify-content:center;align-items:center;width:3.5rem;height:3.5rem;margin-bottom:.5rem;display:flex}._dropzoneIcon_1tgn0_35{width:1.75rem;height:1.75rem}._dropzoneTitle_1tgn0_36{color:#3b82f6;margin:0;font-size:1rem;font-weight:600}._dropzoneSub_1tgn0_109{color:#6b7280;margin:0 0 1rem;font-size:.875rem}._browseButton_1tgn0_37{color:#3b82f6;cursor:pointer;background-color:#0000;border:1px solid #3b82f6;border-radius:6px;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:all .2s;display:inline-flex}._browseButton_1tgn0_37:hover{background-color:#eff6ff}._fileList_1tgn0_135{flex-direction:column;gap:1rem;display:flex}._fileCard_1tgn0_39{border-radius:var(--zf-radius,12px);background-color:#fff;border:1px solid #e5e7eb;flex-direction:row;gap:1.5rem;padding:1rem;display:flex;box-shadow:0 1px 3px #0000000d}._fileCardPreview_1tgn0_152{background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:8px;flex-shrink:0;width:240px;height:150px;position:relative;overflow:hidden}._documentPreview_1tgn0_163{color:#9ca3af;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex}._documentBadge_1tgn0_173{color:#fff;background-color:#374151;border-radius:4px;padding:2px 6px;font-size:.65rem;font-weight:700;position:absolute;bottom:8px;left:8px}._fileCardDetails_1tgn0_185{flex-direction:column;flex-grow:1;justify-content:flex-start;padding:.25rem 0;display:flex}._statusSuccess_1tgn0_193{color:#10b981;align-items:center;gap:.5rem;margin-bottom:.75rem;font-size:.875rem;font-weight:500;display:flex}._fileNameLarge_1tgn0_203{color:#111827;word-break:break-all;margin:0 0 .5rem;font-size:1.25rem;font-weight:700}._fileMeta_1tgn0_211{color:#6b7280;margin:0;font-size:.875rem}._fileActions_1tgn0_217{justify-content:flex-end;gap:1rem;margin-top:auto;display:flex}._btnActionBlue_1tgn0_224{color:#3b82f6;cursor:pointer;background-color:#0000;border:1px solid #3b82f6;border-radius:6px;align-items:center;gap:.375rem;padding:.375rem .875rem;font-size:.875rem;font-weight:500;transition:all .2s;display:inline-flex}._btnActionBlue_1tgn0_224:hover{background-color:#eff6ff}._btnActionRed_1tgn0_243{color:#ef4444;cursor:pointer;background-color:#0000;border:1px solid #ef4444;border-radius:6px;align-items:center;gap:.375rem;padding:.375rem .875rem;font-size:.875rem;font-weight:500;transition:all .2s;display:inline-flex}._btnActionRed_1tgn0_243:hover{background-color:#fef2f2}._hidden_1tgn0_263{display:none}._errorText_1tgn0_264{color:#ef4444;margin:0;font-size:.875rem;font-weight:500}._overlay_1tgn0_266{z-index:10;background-color:#ffffffb3;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._spinner_1tgn0_40{border:2px solid #3b82f6;border-top-color:#0000;border-radius:50%;width:2rem;height:2rem;animation:1s linear infinite _spin_1tgn0_40}._spinnerSm_1tgn0_286{width:1.5rem;height:1.5rem}@keyframes _spin_1tgn0_40{to{transform:rotate(360deg)}}._extractedPanel_1tgn0_296{border-radius:var(--zf-radius,8px);background-color:#f9fafb;border:1px solid #e5e7eb;margin-top:1rem;padding:1rem}._extractedTitle_1tgn0_304{color:#111827;margin:0 0 .5rem;font-size:.875rem;font-weight:600}._extractedList_1tgn0_311{grid-template-columns:1fr;gap:.5rem;display:grid}._extractedItem_1tgn0_317{border-bottom:1px solid #e5e7eb;justify-content:space-between;align-items:center;padding:.25rem 0;display:flex}._extractedItem_1tgn0_317:last-child{border-bottom:none}._extractedKey_1tgn0_329{color:#6b7280;text-transform:uppercase;font-size:.75rem;font-weight:600}._extractedVal_1tgn0_336{color:#111827;text-align:right;word-break:break-all;max-width:60%;font-size:.875rem;font-weight:500}@media (width<=640px){._fileCard_1tgn0_39{flex-direction:column;align-items:stretch;gap:1rem;padding:1rem}._fileCardPreview_1tgn0_152{width:100%;height:180px}._fileCardDetails_1tgn0_185{padding:0}._fileActions_1tgn0_217{justify-content:space-between;width:100%;margin-top:1rem}._btnActionBlue_1tgn0_224,._btnActionRed_1tgn0_243{flex:1;justify-content:center}}._gridContainer_10n6x_1{border:1px solid var(--zf-border-color,#e2e8f0);border-radius:var(--zf-radius-md,.375rem);background:var(--zf-surface-bg,#fff);width:100%;overflow-x:auto}._gridTable_10n6x_9{border-collapse:collapse;text-align:left;width:100%;font-family:var(--zf-font-family,inherit)}._gridHeader_10n6x_16{background-color:var(--zf-surface-subtle,#f8fafc);border-bottom:2px solid var(--zf-border-color,#e2e8f0)}._gridHeaderCell_10n6x_21{font-weight:var(--zf-font-weight-semibold,600);font-size:var(--zf-font-size-sm,.875rem);color:var(--zf-text-muted,#475569);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;padding:.75rem 1rem}._gridRow_10n6x_31{border-bottom:1px solid var(--zf-border-color,#e2e8f0);transition:background-color .2s}._gridRow_10n6x_31:hover{background-color:var(--zf-primary-bg-hover,#f1f5f9)}._gridRow_10n6x_31:last-child{border-bottom:none}._gridCell_10n6x_44{vertical-align:middle;border-right:1px solid var(--zf-border-color,#e2e8f0);white-space:nowrap;padding:0}._gridCell_10n6x_44:last-child{border-right:none}._gridCell_10n6x_44 input,._gridCell_10n6x_44 select,._gridCell_10n6x_44 textarea{width:100%;min-width:max-content;height:100%;font-size:var(--zf-font-size-sm,.875rem);color:var(--zf-text-color,#0f172a);box-sizing:border-box;white-space:nowrap;background:0 0;border:none;outline:none;padding:.75rem 1rem;transition:background-color .2s}._gridCell_10n6x_44:focus-within{box-shadow:inset 0 0 0 2px var(--zf-primary-color,#3b82f6);background-color:var(--zf-surface-bg,#fff)}._gridCell_10n6x_44 select{cursor:pointer;appearance:none;background-image:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23131313%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E);background-position:right .7em top 50%,0 0;background-repeat:no-repeat,repeat;background-size:.65em,100%;padding-right:2rem}._gridFooter_10n6x_95{background-color:var(--zf-surface-subtle,#f8fafc);border-top:2px solid var(--zf-border-color,#e2e8f0);font-weight:var(--zf-font-weight-semibold,600)}._gridFooterCell_10n6x_101{font-size:var(--zf-font-size-sm,.875rem);color:var(--zf-text-color,#0f172a);padding:.75rem 1rem}._addRowButton_10n6x_107{background-color:var(--zf-surface-bg,#fff);border:1px dashed var(--zf-border-color,#cbd5e1);color:var(--zf-text-muted,#475569);border-radius:var(--zf-radius-md,.375rem);cursor:pointer;font-weight:var(--zf-font-weight-medium,500);width:calc(100% - 2rem);margin:1rem;padding:.5rem 1rem;transition:all .2s;display:block}._addRowButton_10n6x_107:hover{background-color:var(--zf-surface-subtle,#f8fafc);border-color:var(--zf-text-muted,#475569);color:var(--zf-text-color,#0f172a)}._deleteRowButton_10n6x_127{color:var(--zf-danger-color,#ef4444);border:1px solid var(--zf-danger-color,#ef4444);border-radius:var(--zf-radius-sm,.25rem);cursor:pointer;font-size:var(--zf-font-size-sm,.875rem);background-color:#0000;padding:.35rem .75rem;transition:all .2s}._deleteRowButton_10n6x_127:hover{background-color:var(--zf-danger-bg-hover,#fef2f2)}._actionCell_10n6x_142{text-align:center;width:80px}._variant-compact_10n6x_148 ._gridCell_10n6x_44 input,._variant-compact_10n6x_148 ._gridCell_10n6x_44 select,._variant-compact_10n6x_148 ._gridCell_10n6x_44 textarea{padding:.25rem .5rem}._variant-compact_10n6x_148 ._gridCell_10n6x_44 select{padding-right:1.75rem}._variant-compact_10n6x_148 ._gridHeaderCell_10n6x_21,._variant-compact_10n6x_148 ._gridFooterCell_10n6x_101{padding:.5rem}._variant-striped_10n6x_164 ._gridRow_10n6x_31:nth-child(2n){background-color:var(--zf-primary-bg-subtle,#3b82f605)}._desktopOnly_10n6x_169{display:block}._mobileOnly_10n6x_172{display:none}@media (width<=768px){._desktopOnly_10n6x_169{display:none!important}._mobileOnly_10n6x_172{display:block!important}}._mobileListContainer_10n6x_186{flex-direction:column;gap:1rem;display:flex}._mobileCard_10n6x_192{border:1px solid var(--zf-border-color,#e2e8f0);border-radius:var(--zf-radius-md,.375rem);background:var(--zf-surface-bg,#fff);scroll-margin-top:2rem;overflow:hidden;box-shadow:0 1px 2px #0000000d}._mobileCardRow_10n6x_201{border-bottom:1px solid var(--zf-border-color,#e2e8f0);flex-direction:column;display:flex}._mobileCardRow_10n6x_201:last-child{border-bottom:none}._mobileCardLabel_10n6x_211{font-size:var(--zf-font-size-xs,.75rem);font-weight:var(--zf-font-weight-semibold,600);color:var(--zf-text-muted,#64748b);text-transform:uppercase;letter-spacing:.05em;padding:.5rem 1rem 0}._mobileCardInputWrapper_10n6x_220{border-radius:var(--zf-radius-sm,.25rem);margin:0 .5rem;padding:0 .5rem .5rem;transition:all .2s}._mobileCardInputWrapper_10n6x_220 input,._mobileCardInputWrapper_10n6x_220 select,._mobileCardInputWrapper_10n6x_220 textarea{width:100%;font-size:var(--zf-font-size-md,1rem);color:var(--zf-text-color,#0f172a);box-sizing:border-box;background:0 0;border:none;outline:none;padding:.5rem}._mobileCardInputWrapper_10n6x_220 select{cursor:pointer;appearance:none;background-image:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23131313%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E);background-position:right .7em top 50%,0 0;background-repeat:no-repeat,repeat;background-size:.65em,100%;padding-right:2rem}._mobileCardInputWrapper_10n6x_220:focus-within{box-shadow:inset 0 0 0 2px var(--zf-primary-color,#3b82f6);background-color:var(--zf-surface-bg,#fff)}._mobileDeleteBtnWrapper_10n6x_257{background-color:var(--zf-surface-subtle,#f8fafc);border-top:1px solid var(--zf-border-color,#e2e8f0);justify-content:flex-end;padding:.75rem 1rem;display:flex}._mobileAggregationsCard_10n6x_265{background-color:var(--zf-surface-subtle,#f8fafc);border-radius:var(--zf-radius-md,.375rem);border:1px solid var(--zf-border-color,#e2e8f0);padding:1rem}._mobileAggregationRow_10n6x_272{border-bottom:1px dashed var(--zf-border-color,#cbd5e1);justify-content:space-between;padding:.5rem 0;display:flex}._mobileAggregationRow_10n6x_272:last-child{border-bottom:none}._mobileAggregationLabel_10n6x_283{font-weight:var(--zf-font-weight-semibold,600);color:var(--zf-text-muted,#475569);text-transform:uppercase;font-size:var(--zf-font-size-xs,.75rem)}._mobileAggregationValue_10n6x_290{font-weight:var(--zf-font-weight-bold,700);color:var(--zf-text-color,#0f172a)}._mobileSummaryCard_10n6x_296{cursor:pointer;background-color:var(--zf-surface-bg,#fff);border:1px solid var(--zf-border-color,#e2e8f0);border-radius:var(--zf-radius-md,.375rem);justify-content:space-between;padding:1rem;display:flex;box-shadow:0 1px 2px #0000000d}._mobileSummaryCard_10n6x_296:hover{background-color:var(--zf-primary-bg-subtle,#f8fafc)}._mobileSummaryLeft_10n6x_311{flex-direction:column;gap:.5rem;display:flex}._mobileSummaryRightWrapper_10n6x_317{flex-direction:row;align-items:center;gap:1rem;display:flex}._mobileSummaryActions_10n6x_324{gap:.25rem;display:flex}._mobileIconButton_10n6x_329{border-radius:var(--zf-radius-sm,.25rem);width:28px;height:28px;color:var(--zf-text-muted,#94a3b8);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:all .2s;display:flex}._mobileIconButton_10n6x_329:hover{background-color:var(--zf-surface-subtle,#f1f5f9);color:var(--zf-text-color,#334155)}._mobileIconDanger_10n6x_349:hover{color:#ef4444;background-color:#ef44441a}._mobileSummaryRight_10n6x_317{flex-direction:column;align-items:flex-end;gap:.25rem;display:flex}._mobileSummaryTitle_10n6x_361{font-size:var(--zf-font-size-md,1rem);font-weight:var(--zf-font-weight-bold,700);color:var(--zf-text-color,#0f172a)}._mobileSummaryChip_10n6x_367{background-color:var(--zf-primary-bg-subtle,#e0f2fe);color:var(--zf-primary-color,#0369a1);border-radius:var(--zf-radius-full,9999px);font-size:var(--zf-font-size-xs,.75rem);font-weight:var(--zf-font-weight-medium,500);padding:.25rem .75rem;display:inline-block}._mobileSummaryValueRow_10n6x_377{font-size:var(--zf-font-size-sm,.875rem);color:var(--zf-text-muted,#475569)}._mobileSummaryValueRow_10n6x_377 span{font-weight:var(--zf-font-weight-semibold,600);color:var(--zf-text-color,#0f172a);margin-left:.25rem}
1
+ :root{--zf-primary-color:#3b82f6;--zf-primary-hover:#2563eb;--zf-primary-bg-subtle:#3b82f605;--zf-primary-bg-hover:#3b82f614;--zf-secondary-color:#64748b;--zf-secondary-hover:#475569;--zf-secondary-bg-hover:#64748b14;--zf-danger-color:#ef4444;--zf-danger-hover:#dc2828;--zf-danger-bg:#fee2e2;--zf-danger-bg-hover:#ef444426;--zf-border-color:#e2e8f0;--zf-border-style:dashed;--zf-text-color:#0f172a;--zf-text-muted:#64748b;--zf-text-inverse:#fff;--zf-surface-bg:#fff;--zf-surface-subtle:#f1f5f9;--zf-surface-overlay:#ffffffb3;--zf-font-family:inherit;--zf-font-size-xs:.75rem;--zf-font-size-sm:.875rem;--zf-font-size-md:1rem;--zf-font-size-lg:1.125rem;--zf-font-weight-normal:400;--zf-font-weight-medium:500;--zf-font-weight-semibold:600;--zf-font-weight-bold:700;--zf-spacing-1:.25rem;--zf-spacing-1-5:.375rem;--zf-spacing-2:.5rem;--zf-spacing-3:.75rem;--zf-spacing-4:1rem;--zf-spacing-5:1.25rem;--zf-spacing-6:1.5rem;--zf-spacing-8:2rem;--zf-spacing-16:4rem;--zf-radius-sm:.25rem;--zf-radius-md:.375rem;--zf-radius:.5rem;--zf-radius-lg:.5rem;--zf-radius-full:9999px;--zf-shadow-sm:0 1px 2px 0 #0000000d;--zf-shadow-md:0 4px 6px -1px #0000001a, 0 2px 4px -1px #0000000f;--zf-shadow-lg:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--zf-screen-sm:640px;--zf-screen-md:768px;--zf-screen-lg:1024px;--zf-screen-xl:1280px;--zf-z-base:1;--zf-z-overlay:10;--zf-z-modal:50;--zf-z-max:9999}._imagePreviewLoading_s2a11_1{background-color:var(--zf-surface-subtle);justify-content:center;align-items:center;width:100%;height:100%;display:flex}._spinner_s2a11_10{width:var(--zf-spacing-8);height:var(--zf-spacing-8);border:2px solid var(--zf-primary-color);border-radius:var(--zf-radius-full);border-top-color:#0000;animation:1s linear infinite _zf-spin_s2a11_1}._spinnerSm_s2a11_19{width:var(--zf-spacing-6);height:var(--zf-spacing-6)}@keyframes _zf-spin_s2a11_1{to{transform:rotate(360deg)}}._imagePreviewError_s2a11_28{background-color:var(--zf-danger-bg);color:var(--zf-danger-color);font-size:var(--zf-font-size-xs);text-align:center;padding:var(--zf-spacing-2);justify-content:center;align-items:center;width:100%;height:100%;display:flex}._imagePreview_s2a11_1{object-fit:cover;width:100%;height:100%}._fieldContainer_1tgn0_2{gap:var(--zf-spacing-2);font-family:var(--zf-font-family);box-sizing:border-box;flex-direction:column;display:flex}._fieldContainer_1tgn0_2 *{box-sizing:border-box}._label_1tgn0_14{color:#111827;margin-bottom:.5rem;font-size:1rem;font-weight:600}._fieldBody_1tgn0_21{gap:var(--zf-spacing-3);flex-direction:column;display:flex}._sizeSm_1tgn0_28 ._dropzone_1tgn0_28{padding:var(--zf-spacing-4);min-height:auto}._sizeMd_1tgn0_29 ._dropzone_1tgn0_28{padding:var(--zf-spacing-8) var(--zf-spacing-6)}._sizeLg_1tgn0_30 ._dropzone_1tgn0_28{padding:2.5rem 1.5rem}._variantPrimary_1tgn0_33 ._dropzone_1tgn0_28{border-color:var(--zf-primary-color,#3b82f6);background-color:var(--zf-primary-bg-subtle,#f8fafc)}._variantPrimary_1tgn0_33 ._dropzone_1tgn0_28:hover{background-color:var(--zf-primary-bg-hover,#f1f5f9);border-color:var(--zf-primary-hover,#2563eb)}._variantPrimary_1tgn0_33 ._dropzoneIconWrapper_1tgn0_35{background-color:var(--zf-primary-bg-subtle,#eff6ff);color:var(--zf-primary-color,#3b82f6)}._variantPrimary_1tgn0_33 ._dropzoneTitle_1tgn0_36{color:var(--zf-primary-color,#3b82f6)}._variantPrimary_1tgn0_33 ._browseButton_1tgn0_37{border-color:var(--zf-primary-color,#3b82f6);color:var(--zf-primary-color,#3b82f6)}._variantPrimary_1tgn0_33 ._browseButton_1tgn0_37:hover{background-color:var(--zf-primary-bg-subtle,#eff6ff)}._variantPrimary_1tgn0_33 ._fileCard_1tgn0_39{border-color:var(--zf-primary-color,#3b82f6);background-color:var(--zf-primary-bg-subtle,#f8fafc)}._variantPrimary_1tgn0_33 ._spinner_1tgn0_40{border-color:var(--zf-primary-color,#3b82f6);border-top-color:#0000}._variantSecondary_1tgn0_42 ._dropzone_1tgn0_28{border-color:var(--zf-secondary-color,#64748b);background-color:var(--zf-surface-subtle,#f8fafc)}._variantSecondary_1tgn0_42 ._dropzone_1tgn0_28:hover{background-color:var(--zf-secondary-bg-hover,#f1f5f9);border-color:var(--zf-text-color,#334155)}._variantSecondary_1tgn0_42 ._dropzoneIconWrapper_1tgn0_35{background-color:var(--zf-surface-subtle,#f1f5f9);color:var(--zf-secondary-color,#64748b)}._variantSecondary_1tgn0_42 ._dropzoneTitle_1tgn0_36{color:var(--zf-secondary-color,#64748b)}._variantSecondary_1tgn0_42 ._browseButton_1tgn0_37{border-color:var(--zf-secondary-color,#64748b);color:var(--zf-secondary-color,#64748b)}._variantSecondary_1tgn0_42 ._browseButton_1tgn0_37:hover{background-color:var(--zf-surface-subtle,#f1f5f9)}._variantSecondary_1tgn0_42 ._fileCard_1tgn0_39{border-color:var(--zf-secondary-color,#64748b);background-color:var(--zf-surface-subtle,#f8fafc)}._variantSecondary_1tgn0_42 ._spinner_1tgn0_40{border-color:var(--zf-secondary-color,#64748b);border-top-color:#0000}._dropzone_1tgn0_28{border-width:2px;border-style:var(--zf-border-style,dashed);border-radius:var(--zf-radius,12px);text-align:center;cursor:pointer;background-color:#f8fafc;border-color:#3b82f6;flex-direction:column;justify-content:center;align-items:center;padding:2.5rem 1.5rem;transition:all .2s;display:flex}._dropzone_1tgn0_28:hover{background-color:#f1f5f9}._dropzoneLoading_1tgn0_72{opacity:.5;pointer-events:none}._dropzoneContent_1tgn0_77{flex-direction:column;justify-content:center;align-items:center;gap:.5rem;display:flex}._dropzoneIconWrapper_1tgn0_35{color:#3b82f6;background-color:#eff6ff;border-radius:50%;justify-content:center;align-items:center;width:3.5rem;height:3.5rem;margin-bottom:.5rem;display:flex}._dropzoneIcon_1tgn0_35{width:1.75rem;height:1.75rem}._dropzoneTitle_1tgn0_36{color:#3b82f6;margin:0;font-size:1rem;font-weight:600}._dropzoneSub_1tgn0_109{color:#6b7280;margin:0 0 1rem;font-size:.875rem}._browseButton_1tgn0_37{color:#3b82f6;cursor:pointer;background-color:#0000;border:1px solid #3b82f6;border-radius:6px;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:all .2s;display:inline-flex}._browseButton_1tgn0_37:hover{background-color:#eff6ff}._fileList_1tgn0_135{flex-direction:column;gap:1rem;display:flex}._fileCard_1tgn0_39{border-radius:var(--zf-radius,12px);background-color:#fff;border:1px solid #e5e7eb;flex-direction:row;gap:1.5rem;padding:1rem;display:flex;box-shadow:0 1px 3px #0000000d}._fileCardPreview_1tgn0_152{background-color:#f9fafb;border:1px solid #e5e7eb;border-radius:8px;flex-shrink:0;width:240px;height:150px;position:relative;overflow:hidden}._documentPreview_1tgn0_163{color:#9ca3af;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;display:flex}._documentBadge_1tgn0_173{color:#fff;background-color:#374151;border-radius:4px;padding:2px 6px;font-size:.65rem;font-weight:700;position:absolute;bottom:8px;left:8px}._fileCardDetails_1tgn0_185{flex-direction:column;flex-grow:1;justify-content:flex-start;padding:.25rem 0;display:flex}._statusSuccess_1tgn0_193{color:#10b981;align-items:center;gap:.5rem;margin-bottom:.75rem;font-size:.875rem;font-weight:500;display:flex}._fileNameLarge_1tgn0_203{color:#111827;word-break:break-all;margin:0 0 .5rem;font-size:1.25rem;font-weight:700}._fileMeta_1tgn0_211{color:#6b7280;margin:0;font-size:.875rem}._fileActions_1tgn0_217{justify-content:flex-end;gap:1rem;margin-top:auto;display:flex}._btnActionBlue_1tgn0_224{color:#3b82f6;cursor:pointer;background-color:#0000;border:1px solid #3b82f6;border-radius:6px;align-items:center;gap:.375rem;padding:.375rem .875rem;font-size:.875rem;font-weight:500;transition:all .2s;display:inline-flex}._btnActionBlue_1tgn0_224:hover{background-color:#eff6ff}._btnActionRed_1tgn0_243{color:#ef4444;cursor:pointer;background-color:#0000;border:1px solid #ef4444;border-radius:6px;align-items:center;gap:.375rem;padding:.375rem .875rem;font-size:.875rem;font-weight:500;transition:all .2s;display:inline-flex}._btnActionRed_1tgn0_243:hover{background-color:#fef2f2}._hidden_1tgn0_263{display:none}._errorText_1tgn0_264{color:#ef4444;margin:0;font-size:.875rem;font-weight:500}._overlay_1tgn0_266{z-index:10;background-color:#ffffffb3;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}._spinner_1tgn0_40{border:2px solid #3b82f6;border-top-color:#0000;border-radius:50%;width:2rem;height:2rem;animation:1s linear infinite _spin_1tgn0_40}._spinnerSm_1tgn0_286{width:1.5rem;height:1.5rem}@keyframes _spin_1tgn0_40{to{transform:rotate(360deg)}}._extractedPanel_1tgn0_296{border-radius:var(--zf-radius,8px);background-color:#f9fafb;border:1px solid #e5e7eb;margin-top:1rem;padding:1rem}._extractedTitle_1tgn0_304{color:#111827;margin:0 0 .5rem;font-size:.875rem;font-weight:600}._extractedList_1tgn0_311{grid-template-columns:1fr;gap:.5rem;display:grid}._extractedItem_1tgn0_317{border-bottom:1px solid #e5e7eb;justify-content:space-between;align-items:center;padding:.25rem 0;display:flex}._extractedItem_1tgn0_317:last-child{border-bottom:none}._extractedKey_1tgn0_329{color:#6b7280;text-transform:uppercase;font-size:.75rem;font-weight:600}._extractedVal_1tgn0_336{color:#111827;text-align:right;word-break:break-all;max-width:60%;font-size:.875rem;font-weight:500}@media (width<=640px){._fileCard_1tgn0_39{flex-direction:column;align-items:stretch;gap:1rem;padding:1rem}._fileCardPreview_1tgn0_152{width:100%;height:180px}._fileCardDetails_1tgn0_185{padding:0}._fileActions_1tgn0_217{justify-content:space-between;width:100%;margin-top:1rem}._btnActionBlue_1tgn0_224,._btnActionRed_1tgn0_243{flex:1;justify-content:center}}._gridContainer_1ga7t_1{border:1px solid var(--zf-border-color,#e2e8f0);border-radius:var(--zf-radius-md,.375rem);background:var(--zf-surface-bg,#fff);width:100%;overflow-x:auto}._gridTable_1ga7t_17{border-collapse:collapse;text-align:left;width:100%;font-family:var(--zf-font-family,inherit)}._gridHeader_1ga7t_31{background-color:var(--zf-surface-subtle,#f8fafc);border-bottom:2px solid var(--zf-border-color,#e2e8f0)}._gridHeaderCell_1ga7t_41{font-weight:var(--zf-font-weight-semibold,600);font-size:var(--zf-font-size-sm,.875rem);color:var(--zf-text-muted,#475569);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;padding:.75rem 1rem}._gridRow_1ga7t_61{border-bottom:1px solid var(--zf-border-color,#e2e8f0);transition:background-color .2s}._gridRow_1ga7t_61:hover{background-color:var(--zf-primary-bg-hover,#f1f5f9)}._gridRow_1ga7t_61:last-child{border-bottom:none}._gridCell_1ga7t_87{vertical-align:middle;border-right:1px solid var(--zf-border-color,#e2e8f0);white-space:nowrap;padding:0}._gridCell_1ga7t_87:last-child{border-right:none}._gridCell_1ga7t_87 input,._gridCell_1ga7t_87 select,._gridCell_1ga7t_87 textarea{width:100%;min-width:max-content;height:100%;font-size:var(--zf-font-size-sm,.875rem);color:var(--zf-text-color,#0f172a);box-sizing:border-box;white-space:nowrap;background:0 0;border:none;outline:none;padding:.75rem 1rem;transition:background-color .2s}._gridCell_1ga7t_87:focus-within{box-shadow:inset 0 0 0 2px var(--zf-primary-color,#3b82f6);background-color:var(--zf-surface-bg,#fff)}._gridCell_1ga7t_87 select{cursor:pointer;appearance:none;background-image:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23131313%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E);background-position:right .7em top 50%,0 0;background-repeat:no-repeat,repeat;background-size:.65em,100%;padding-right:2rem}._gridFooter_1ga7t_189{background-color:var(--zf-surface-subtle,#f8fafc);border-top:2px solid var(--zf-border-color,#e2e8f0);font-weight:var(--zf-font-weight-semibold,600)}._gridFooterCell_1ga7t_201{font-size:var(--zf-font-size-sm,.875rem);color:var(--zf-text-color,#0f172a);padding:.75rem 1rem}._addRowButton_1ga7t_213{background-color:var(--zf-surface-bg,#fff);border:1px dashed var(--zf-border-color,#cbd5e1);color:var(--zf-text-muted,#475569);border-radius:var(--zf-radius-md,.375rem);cursor:pointer;font-weight:var(--zf-font-weight-medium,500);width:calc(100% - 2rem);margin:1rem;padding:.5rem 1rem;transition:all .2s;display:block}._addRowButton_1ga7t_213:hover{background-color:var(--zf-surface-subtle,#f8fafc);border-color:var(--zf-text-muted,#475569);color:var(--zf-text-color,#0f172a)}._deleteRowButton_1ga7t_253{color:var(--zf-danger-color,#ef4444);border:1px solid var(--zf-danger-color,#ef4444);border-radius:var(--zf-radius-sm,.25rem);cursor:pointer;font-size:var(--zf-font-size-sm,.875rem);background-color:#0000;padding:.35rem .75rem;transition:all .2s}._deleteRowButton_1ga7t_253:hover{background-color:var(--zf-danger-bg-hover,#fef2f2)}._actionCell_1ga7t_283{text-align:center;width:80px}._variant-compact_1ga7t_295 ._gridCell_1ga7t_87 input,._variant-compact_1ga7t_295 ._gridCell_1ga7t_87 select,._variant-compact_1ga7t_295 ._gridCell_1ga7t_87 textarea{padding:.25rem .5rem}._variant-compact_1ga7t_295 ._gridCell_1ga7t_87 select{padding-right:1.75rem}._variant-compact_1ga7t_295 ._gridHeaderCell_1ga7t_41,._variant-compact_1ga7t_295 ._gridFooterCell_1ga7t_201{padding:.5rem}._variant-striped_1ga7t_327 ._gridRow_1ga7t_61:nth-child(2n){background-color:var(--zf-primary-bg-subtle,#3b82f605)}._desktopOnly_1ga7t_337{display:block}._mobileOnly_1ga7t_343{display:none}@media (width<=768px){._desktopOnly_1ga7t_337{display:none!important}._mobileOnly_1ga7t_343{display:block!important}}._mobileListContainer_1ga7t_371{flex-direction:column;gap:1rem;display:flex}._mobileCard_1ga7t_383{border:1px solid var(--zf-border-color,#e2e8f0);border-radius:var(--zf-radius-md,.375rem);background:var(--zf-surface-bg,#fff);scroll-margin-top:2rem;overflow:hidden;box-shadow:0 1px 2px #0000000d}._mobileCardRow_1ga7t_401{border-bottom:1px solid var(--zf-border-color,#e2e8f0);flex-direction:column;display:flex}._mobileCardRow_1ga7t_401:last-child{border-bottom:none}._mobileCardLabel_1ga7t_421{font-size:var(--zf-font-size-xs,.75rem);font-weight:var(--zf-font-weight-semibold,600);color:var(--zf-text-muted,#64748b);text-transform:uppercase;letter-spacing:.05em;padding:.5rem 1rem 0}._mobileCardInputWrapper_1ga7t_439{border-radius:var(--zf-radius-sm,.25rem);margin:0 .5rem;padding:0 .5rem .5rem;transition:all .2s}._mobileCardInputWrapper_1ga7t_439 input,._mobileCardInputWrapper_1ga7t_439 select,._mobileCardInputWrapper_1ga7t_439 textarea{width:100%;font-size:var(--zf-font-size-md,1rem);color:var(--zf-text-color,#0f172a);box-sizing:border-box;background:0 0;border:none;outline:none;padding:.5rem}._mobileCardInputWrapper_1ga7t_439 select{cursor:pointer;appearance:none;background-image:url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23131313%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E);background-position:right .7em top 50%,0 0;background-repeat:no-repeat,repeat;background-size:.65em,100%;padding-right:2rem}._mobileCardInputWrapper_1ga7t_439:focus-within{box-shadow:inset 0 0 0 2px var(--zf-primary-color,#3b82f6);background-color:var(--zf-surface-bg,#fff)}._mobileDeleteBtnWrapper_1ga7t_513{background-color:var(--zf-surface-subtle,#f8fafc);border-top:1px solid var(--zf-border-color,#e2e8f0);justify-content:flex-end;padding:.75rem 1rem;display:flex}._mobileAggregationsCard_1ga7t_529{background-color:var(--zf-surface-subtle,#f8fafc);border-radius:var(--zf-radius-md,.375rem);border:1px solid var(--zf-border-color,#e2e8f0);padding:1rem}._mobileAggregationRow_1ga7t_543{border-bottom:1px dashed var(--zf-border-color,#cbd5e1);justify-content:space-between;padding:.5rem 0;display:flex}._mobileAggregationRow_1ga7t_543:last-child{border-bottom:none}._mobileAggregationLabel_1ga7t_565{font-weight:var(--zf-font-weight-semibold,600);color:var(--zf-text-muted,#475569);text-transform:uppercase;font-size:var(--zf-font-size-xs,.75rem)}._mobileAggregationValue_1ga7t_579{font-weight:var(--zf-font-weight-bold,700);color:var(--zf-text-color,#0f172a)}._mobileSummaryCard_1ga7t_591{cursor:pointer;background-color:var(--zf-surface-bg,#fff);border:1px solid var(--zf-border-color,#e2e8f0);border-radius:var(--zf-radius-md,.375rem);justify-content:space-between;padding:1rem;display:flex;box-shadow:0 1px 2px #0000000d}._mobileSummaryCard_1ga7t_591:hover{background-color:var(--zf-primary-bg-subtle,#f8fafc)}._mobileSummaryLeft_1ga7t_621{flex-direction:column;gap:.5rem;display:flex}._mobileSummaryRightWrapper_1ga7t_633{flex-direction:row;align-items:center;gap:1rem;display:flex}._mobileSummaryActions_1ga7t_647{gap:.25rem;display:flex}._mobileIconButton_1ga7t_657{border-radius:var(--zf-radius-sm,.25rem);width:28px;height:28px;color:var(--zf-text-muted,#94a3b8);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:all .2s;display:flex}._mobileIconButton_1ga7t_657:hover{background-color:var(--zf-surface-subtle,#f1f5f9);color:var(--zf-text-color,#334155)}._mobileIconDanger_1ga7t_697:hover{color:#ef4444;background-color:#ef44441a}._mobileSummaryRight_1ga7t_633{flex-direction:column;align-items:flex-end;gap:.25rem;display:flex}._mobileSummaryTitle_1ga7t_721{font-size:var(--zf-font-size-md,1rem);font-weight:var(--zf-font-weight-bold,700);color:var(--zf-text-color,#0f172a)}._mobileSummaryChip_1ga7t_733{background-color:var(--zf-primary-bg-subtle,#e0f2fe);color:var(--zf-primary-color,#0369a1);border-radius:var(--zf-radius-full,9999px);font-size:var(--zf-font-size-xs,.75rem);font-weight:var(--zf-font-weight-medium,500);padding:.25rem .75rem;display:inline-block}._mobileSummaryValueRow_1ga7t_753{font-size:var(--zf-font-size-sm,.875rem);color:var(--zf-text-muted,#475569)}._mobileSummaryValueRow_1ga7t_753 span{font-weight:var(--zf-font-weight-semibold,600);color:var(--zf-text-color,#0f172a);margin-left:.25rem}
2
2
  /*$vite$:1*/
package/dist/src/index.js CHANGED
@@ -531,41 +531,41 @@ function C({ label: e, value: t, onChange: i, onExtracted: c, onProcess: l, clie
531
531
  });
532
532
  }
533
533
  var w = {
534
- gridContainer: "_gridContainer_10n6x_1",
535
- gridTable: "_gridTable_10n6x_9",
536
- gridHeader: "_gridHeader_10n6x_16",
537
- gridHeaderCell: "_gridHeaderCell_10n6x_21",
538
- gridRow: "_gridRow_10n6x_31",
539
- gridCell: "_gridCell_10n6x_44",
540
- gridFooter: "_gridFooter_10n6x_95",
541
- gridFooterCell: "_gridFooterCell_10n6x_101",
542
- addRowButton: "_addRowButton_10n6x_107",
543
- deleteRowButton: "_deleteRowButton_10n6x_127",
544
- actionCell: "_actionCell_10n6x_142",
545
- "variant-compact": "_variant-compact_10n6x_148",
546
- "variant-striped": "_variant-striped_10n6x_164",
547
- desktopOnly: "_desktopOnly_10n6x_169",
548
- mobileOnly: "_mobileOnly_10n6x_172",
549
- mobileListContainer: "_mobileListContainer_10n6x_186",
550
- mobileCard: "_mobileCard_10n6x_192",
551
- mobileCardRow: "_mobileCardRow_10n6x_201",
552
- mobileCardLabel: "_mobileCardLabel_10n6x_211",
553
- mobileCardInputWrapper: "_mobileCardInputWrapper_10n6x_220",
554
- mobileDeleteBtnWrapper: "_mobileDeleteBtnWrapper_10n6x_257",
555
- mobileAggregationsCard: "_mobileAggregationsCard_10n6x_265",
556
- mobileAggregationRow: "_mobileAggregationRow_10n6x_272",
557
- mobileAggregationLabel: "_mobileAggregationLabel_10n6x_283",
558
- mobileAggregationValue: "_mobileAggregationValue_10n6x_290",
559
- mobileSummaryCard: "_mobileSummaryCard_10n6x_296",
560
- mobileSummaryLeft: "_mobileSummaryLeft_10n6x_311",
561
- mobileSummaryRightWrapper: "_mobileSummaryRightWrapper_10n6x_317",
562
- mobileSummaryActions: "_mobileSummaryActions_10n6x_324",
563
- mobileIconButton: "_mobileIconButton_10n6x_329",
564
- mobileIconDanger: "_mobileIconDanger_10n6x_349",
565
- mobileSummaryRight: "_mobileSummaryRight_10n6x_317",
566
- mobileSummaryTitle: "_mobileSummaryTitle_10n6x_361",
567
- mobileSummaryChip: "_mobileSummaryChip_10n6x_367",
568
- mobileSummaryValueRow: "_mobileSummaryValueRow_10n6x_377"
534
+ gridContainer: "_gridContainer_1ga7t_1",
535
+ gridTable: "_gridTable_1ga7t_17",
536
+ gridHeader: "_gridHeader_1ga7t_31",
537
+ gridHeaderCell: "_gridHeaderCell_1ga7t_41",
538
+ gridRow: "_gridRow_1ga7t_61",
539
+ gridCell: "_gridCell_1ga7t_87",
540
+ gridFooter: "_gridFooter_1ga7t_189",
541
+ gridFooterCell: "_gridFooterCell_1ga7t_201",
542
+ addRowButton: "_addRowButton_1ga7t_213",
543
+ deleteRowButton: "_deleteRowButton_1ga7t_253",
544
+ actionCell: "_actionCell_1ga7t_283",
545
+ "variant-compact": "_variant-compact_1ga7t_295",
546
+ "variant-striped": "_variant-striped_1ga7t_327",
547
+ desktopOnly: "_desktopOnly_1ga7t_337",
548
+ mobileOnly: "_mobileOnly_1ga7t_343",
549
+ mobileListContainer: "_mobileListContainer_1ga7t_371",
550
+ mobileCard: "_mobileCard_1ga7t_383",
551
+ mobileCardRow: "_mobileCardRow_1ga7t_401",
552
+ mobileCardLabel: "_mobileCardLabel_1ga7t_421",
553
+ mobileCardInputWrapper: "_mobileCardInputWrapper_1ga7t_439",
554
+ mobileDeleteBtnWrapper: "_mobileDeleteBtnWrapper_1ga7t_513",
555
+ mobileAggregationsCard: "_mobileAggregationsCard_1ga7t_529",
556
+ mobileAggregationRow: "_mobileAggregationRow_1ga7t_543",
557
+ mobileAggregationLabel: "_mobileAggregationLabel_1ga7t_565",
558
+ mobileAggregationValue: "_mobileAggregationValue_1ga7t_579",
559
+ mobileSummaryCard: "_mobileSummaryCard_1ga7t_591",
560
+ mobileSummaryLeft: "_mobileSummaryLeft_1ga7t_621",
561
+ mobileSummaryRightWrapper: "_mobileSummaryRightWrapper_1ga7t_633",
562
+ mobileSummaryActions: "_mobileSummaryActions_1ga7t_647",
563
+ mobileIconButton: "_mobileIconButton_1ga7t_657",
564
+ mobileIconDanger: "_mobileIconDanger_1ga7t_697",
565
+ mobileSummaryRight: "_mobileSummaryRight_1ga7t_633",
566
+ mobileSummaryTitle: "_mobileSummaryTitle_1ga7t_721",
567
+ mobileSummaryChip: "_mobileSummaryChip_1ga7t_733",
568
+ mobileSummaryValueRow: "_mobileSummaryValueRow_1ga7t_753"
569
569
  }, T = ({ value: e, column: t, rowData: n, rowIndex: r, onChange: i }) => /* @__PURE__ */ a("td", {
570
570
  className: w.gridCell,
571
571
  children: t.render ? t.render({
package/package.json CHANGED
@@ -1,34 +1,33 @@
1
- {
2
- "name": "form-component-library-demo",
3
- "version": "1.0.6",
4
- "type": "module",
5
- "description": "Zino Client API library for field and workflow management",
6
- "main": "dist/src/index.cjs",
7
- "module": "dist/src/index.js",
8
- "scripts": {
9
- "build": "vite build",
10
- "dev": "vite build --watch"
11
- },
12
- "keywords": [
13
- "zino",
14
- "client",
15
- "api"
16
- ],
17
- "author": "",
18
- "license": "ISC",
19
- "devDependencies": {
20
- "@vitejs/plugin-react": "^6.1.1",
21
- "esbuild-css-modules-plugin": "^3.1.5",
22
- "vite": "^8.2.2"
23
- },
24
- "dependencies": {
25
- "lucide-react": "^1.34.0"
26
- },
27
- "peerDependencies": {
28
- "react": ">=16.8.0",
29
- "react-dom": ">=16.8.0"
30
- },
31
- "files": [
32
- "dist"
33
- ]
34
- }
1
+ {
2
+ "name": "form-component-library-demo",
3
+ "version": "1.0.7",
4
+ "type": "module",
5
+ "description": "Zino Client API library for field and workflow management",
6
+ "main": "dist/src/index.cjs",
7
+ "module": "dist/src/index.js",
8
+ "scripts": {
9
+ "build": "vite build",
10
+ "dev": "vite build --watch"
11
+ },
12
+ "keywords": [
13
+ "client",
14
+ "api"
15
+ ],
16
+ "author": "",
17
+ "license": "ISC",
18
+ "devDependencies": {
19
+ "@vitejs/plugin-react": "^6.1.1",
20
+ "esbuild-css-modules-plugin": "^3.1.5",
21
+ "vite": "^8.2.2"
22
+ },
23
+ "dependencies": {
24
+ "lucide-react": "^1.34.0"
25
+ },
26
+ "peerDependencies": {
27
+ "react": ">=16.8.0",
28
+ "react-dom": ">=16.8.0"
29
+ },
30
+ "files": [
31
+ "dist"
32
+ ]
33
+ }