@feathery/react 2.48.1 → 2.49.0
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.
- package/cjs/Form/grid/StyledContainer/utils.d.ts.map +1 -1
- package/cjs/elements/basic/ButtonElement.d.ts.map +1 -1
- package/cjs/elements/basic/TableElement/EditableCell.d.ts +5 -2
- package/cjs/elements/basic/TableElement/EditableCell.d.ts.map +1 -1
- package/cjs/elements/basic/TableElement/index.d.ts.map +1 -1
- package/cjs/elements/basic/TableElement/styles.d.ts +0 -23
- package/cjs/elements/basic/TableElement/styles.d.ts.map +1 -1
- package/cjs/elements/basic/TableElement/types.d.ts +4 -0
- package/cjs/elements/basic/TableElement/types.d.ts.map +1 -1
- package/cjs/elements/basic/TableElement/useTableMutations.d.ts +0 -1
- package/cjs/elements/basic/TableElement/useTableMutations.d.ts.map +1 -1
- package/cjs/elements/basic/TableElement/utils.d.ts +14 -0
- package/cjs/elements/basic/TableElement/utils.d.ts.map +1 -1
- package/cjs/{fthry_AssistantChat.BjyKdtNo.js → fthry_AssistantChat.BuqbKhai.js} +4 -4
- package/cjs/{fthry_FormControl.Bjj4gcfs.js → fthry_FormControl.BuMQfeZ1.js} +1 -1
- package/cjs/{fthry_InlineTooltip.D5tgdB4g.js → fthry_InlineTooltip.D8PDRhj_.js} +2 -2
- package/cjs/{fthry_Overlay.DLteVVAy.js → fthry_Overlay.D-NnFWEe.js} +1 -1
- package/cjs/{fthry_PaymentMethodField.Cx5IV_Aw.js → fthry_PaymentMethodField.myalaaOZ.js} +4 -4
- package/cjs/{fthry_Placeholder.BeZ9F1hP.js → fthry_Placeholder.UOTZToMt.js} +1 -1
- package/cjs/{fthry_ShowEyeIcon.DO1SzK0H.js → fthry_ShowEyeIcon.D8qDJDzZ.js} +1 -1
- package/cjs/{fthry_TabsElement.C1KUbyBb.js → fthry_TabsElement.BK0wFYNE.js} +1 -1
- package/cjs/{fthry_auto-track.CJBR_dw-.js → fthry_auto-track.B5EtzK5A.js} +2 -2
- package/cjs/{fthry_highlighted-body-TPN3WLV5.BdAGVyam.js → fthry_highlighted-body-TPN3WLV5.BEO11ycd.js} +3 -3
- package/cjs/{fthry_index.O5z58cdJ.js → fthry_index.7ndzGWiJ.js} +5 -5
- package/cjs/{fthry_index.6SblfScs.js → fthry_index.964D9mAK.js} +2 -2
- package/cjs/{fthry_index.C78x3b5O.js → fthry_index.B6qHn3Vr.js} +6 -6
- package/cjs/{fthry_index.CjM_QMbB.js → fthry_index.BFw_StvJ.js} +2 -2
- package/cjs/{fthry_index.C0KW8hya.js → fthry_index.BRo8czXJ.js} +2 -2
- package/cjs/{fthry_index.BOexWQ2G.js → fthry_index.BU9fFX-g.js} +1 -1
- package/cjs/{fthry_index.BpZi8dM4.js → fthry_index.B_0S-igL.js} +5 -5
- package/cjs/{fthry_index.Dhp1zjHK.js → fthry_index.BcfL5ZZY.js} +1 -1
- package/cjs/{fthry_index.Bkg_JW4Z.js → fthry_index.BckiEDZJ.js} +5 -5
- package/cjs/{fthry_index.SMUP75Ic.js → fthry_index.BmILtMAD.js} +3 -3
- package/cjs/{fthry_index.DyPl9RTy.js → fthry_index.BvnQTPSY.js} +1 -1
- package/cjs/{fthry_index.CwpWkape.js → fthry_index.C-kN7c0o.js} +38 -41
- package/cjs/{fthry_index.foJzYyYX.js → fthry_index.C2vpx_Q9.js} +1 -1
- package/cjs/{fthry_index.CeKZIDEV.js → fthry_index.C6ebZNtr.js} +3 -3
- package/cjs/{fthry_index.BhoKqCQO.js → fthry_index.C9AIy59J.js} +2 -2
- package/cjs/{fthry_index.CeWHxiu2.js → fthry_index.CHLGQEBH.js} +4 -4
- package/cjs/{fthry_index.B1e00tAu.js → fthry_index.CP8jeStb.js} +6 -6
- package/cjs/{fthry_index.CqC7Lj7F.js → fthry_index.CoZzaKnE.js} +5 -5
- package/cjs/{fthry_index.CRXRQpkJ.js → fthry_index.CrgFXYzE.js} +1 -1
- package/cjs/{fthry_index.ycfNh9WZ.js → fthry_index.D0My8MmY.js} +1 -1
- package/cjs/{fthry_index.duLdHjUv.js → fthry_index.DHx_H1T3.js} +151 -141
- package/cjs/{fthry_index.DghgxDID.js → fthry_index.DKv8MgEz.js} +8 -8
- package/cjs/{fthry_index.B3VA122M.js → fthry_index.DPIewKZa.js} +1 -1
- package/cjs/{fthry_index.CGzU2RS3.js → fthry_index.DTMlYZBn.js} +1 -1
- package/cjs/{fthry_index.DRA1vbTd.js → fthry_index.DgGKGO1E.js} +10 -10
- package/cjs/{fthry_index.WdgJ-r5S.js → fthry_index.DrrJo2Gf.js} +6 -6
- package/cjs/{fthry_index.BWAq_scB.js → fthry_index.OwukJO9-.js} +2 -2
- package/cjs/{fthry_index.BbZu0dS9.js → fthry_index.b8IraXmQ.js} +4 -4
- package/cjs/{fthry_index.CU2qYyyW.js → fthry_index.cpUxhiq-.js} +2 -2
- package/cjs/{fthry_index.BvriCG1q.js → fthry_index.e_GKEQRk.js} +1 -1
- package/cjs/{fthry_index.umd.B7oz9tEv.js → fthry_index.umd.YAgbegYu.js} +1 -1
- package/cjs/{fthry_index.97eysi95.js → fthry_index.w9-CuoQH.js} +6 -6
- package/cjs/{fthry_input.BFEJqFg2.js → fthry_input.D3t8liSW.js} +1 -1
- package/cjs/{fthry_mermaid-O7DHMXV3.-sm2XLZv.js → fthry_mermaid-O7DHMXV3.C5wDh0Pr.js} +3 -3
- package/cjs/{fthry_script.CrJCYCaD.js → fthry_script.sEVfx6Kl.js} +1 -1
- package/cjs/{fthry_styles.CBI9OfcR.js → fthry_styles.CFNJAwLy.js} +1 -1
- package/cjs/{fthry_useElementSize.Dq3fkD_k.js → fthry_useElementSize.yeWmUfpM.js} +1 -1
- package/cjs/{fthry_useSalesforceSync.DkO47B4_.js → fthry_useSalesforceSync.C_sMWo9m.js} +1 -1
- package/cjs/{fthry_webfontloader.BbP2ET0j.js → fthry_webfontloader.DLiAwukX.js} +1 -1
- package/cjs/index.js +1 -1
- package/cjs/thumbnail-renderer.js +1 -1
- package/cjs/types/Form.d.ts +3 -0
- package/cjs/types/Form.d.ts.map +1 -1
- package/dist/Form/grid/StyledContainer/utils.d.ts.map +1 -1
- package/dist/elements/basic/ButtonElement.d.ts.map +1 -1
- package/dist/elements/basic/TableElement/EditableCell.d.ts +5 -2
- package/dist/elements/basic/TableElement/EditableCell.d.ts.map +1 -1
- package/dist/elements/basic/TableElement/index.d.ts.map +1 -1
- package/dist/elements/basic/TableElement/styles.d.ts +0 -23
- package/dist/elements/basic/TableElement/styles.d.ts.map +1 -1
- package/dist/elements/basic/TableElement/tests/EditableCell.spec.d.ts +2 -0
- package/dist/elements/basic/TableElement/tests/EditableCell.spec.d.ts.map +1 -0
- package/dist/elements/basic/TableElement/tests/TableElement.spec.d.ts +2 -0
- package/dist/elements/basic/TableElement/tests/TableElement.spec.d.ts.map +1 -0
- package/dist/elements/basic/TableElement/tests/tabNavigation.spec.d.ts +2 -0
- package/dist/elements/basic/TableElement/tests/tabNavigation.spec.d.ts.map +1 -0
- package/dist/elements/basic/TableElement/types.d.ts +4 -0
- package/dist/elements/basic/TableElement/types.d.ts.map +1 -1
- package/dist/elements/basic/TableElement/useTableMutations.d.ts +0 -1
- package/dist/elements/basic/TableElement/useTableMutations.d.ts.map +1 -1
- package/dist/elements/basic/TableElement/utils.d.ts +14 -0
- package/dist/elements/basic/TableElement/utils.d.ts.map +1 -1
- package/dist/{fthry_AssistantChat.h6NTcnjr.js → fthry_AssistantChat.BejpFcyu.js} +4 -4
- package/dist/{fthry_FormControl.DQP6LlCL.js → fthry_FormControl.C3pHyJdN.js} +1 -1
- package/dist/{fthry_InlineTooltip.DUtqoLti.js → fthry_InlineTooltip.mv-Gc2Xw.js} +2 -2
- package/dist/{fthry_Overlay.DjQfEgir.js → fthry_Overlay.CPbgvfMU.js} +1 -1
- package/dist/{fthry_PaymentMethodField.DoX9prJ2.js → fthry_PaymentMethodField.D7ElRh4C.js} +4 -4
- package/dist/{fthry_Placeholder.DIKXUrCe.js → fthry_Placeholder.CRBysDun.js} +1 -1
- package/dist/{fthry_ShowEyeIcon.BsDiRWJb.js → fthry_ShowEyeIcon.Ds0oud66.js} +1 -1
- package/dist/{fthry_TabsElement.JCYNaBSd.js → fthry_TabsElement.BCuhzX6e.js} +1 -1
- package/dist/{fthry_auto-track.CZcLqilZ.js → fthry_auto-track.Dbu38K5j.js} +2 -2
- package/dist/{fthry_highlighted-body-TPN3WLV5.DwNcoR0j.js → fthry_highlighted-body-TPN3WLV5.Cuh_lSww.js} +3 -3
- package/dist/{fthry_index.KFRNwcZ_.js → fthry_index.0OEg6H3i.js} +1 -1
- package/dist/{fthry_index.CPrLJ4J-.js → fthry_index.5jB_IKHJ.js} +6 -6
- package/dist/{fthry_index.DHIhJeBb.js → fthry_index.B-NWpaAl.js} +2 -2
- package/dist/{fthry_index.dmme1I7g.js → fthry_index.B0NbPkQc.js} +1 -1
- package/dist/{fthry_index.BXqHrLYx.js → fthry_index.B31t0UUz.js} +2 -2
- package/dist/{fthry_index.By9XI2Se.js → fthry_index.B8QhrENg.js} +1 -1
- package/dist/{fthry_index.BFPFVaWv.js → fthry_index.BEUoZUyK.js} +1 -1
- package/dist/{fthry_index.D9kooW59.js → fthry_index.Bb2rQlTP.js} +4 -4
- package/dist/{fthry_index.DNmwwxoZ.js → fthry_index.BgljRyhO.js} +10 -10
- package/dist/{fthry_index.BKjEGHR_.js → fthry_index.BnWgnMbc.js} +5 -5
- package/dist/{fthry_index.C2QdbMzv.js → fthry_index.Bx6S1qZa.js} +2 -2
- package/dist/{fthry_index.CuFf_oA3.js → fthry_index.C2TazyZo.js} +1 -1
- package/dist/{fthry_index.D48zqV-m.js → fthry_index.C8wcBfv1.js} +1 -1
- package/dist/{fthry_index.B4uTV15J.js → fthry_index.CQaO0qYK.js} +1 -1
- package/dist/{fthry_index.DZPtLmTA.js → fthry_index.CWSqgxAa.js} +6 -6
- package/dist/{fthry_index.k3Hq7wKG.js → fthry_index.CreqHrWa.js} +1 -1
- package/dist/{fthry_index.B03qg4WP.js → fthry_index.D4jtsTFt.js} +2 -2
- package/dist/{fthry_index.DW4ZEycb.js → fthry_index.DEpC-Z5v.js} +5 -5
- package/dist/{fthry_index.CCyrVDsN.js → fthry_index.DJHFwZtE.js} +5 -5
- package/dist/{fthry_index.Bfo0vjcQ.js → fthry_index.DJzR8T-r.js} +5 -5
- package/dist/{fthry_index.Br_wsbaD.js → fthry_index.DS-rgCeg.js} +6 -6
- package/dist/{fthry_index.INdwJAsd.js → fthry_index.DeOBTZSR.js} +2 -2
- package/dist/{fthry_index.BkzGvVg2.js → fthry_index.Du_mis5t.js} +3 -3
- package/dist/{fthry_index.BgCJlRTN.js → fthry_index.NwQXVZvL.js} +3 -3
- package/dist/{fthry_index.C75qxU8Z.js → fthry_index.T_q8o1IJ.js} +1 -1
- package/dist/{fthry_index.BD5OtLZc.js → fthry_index.YJH2_M8x.js} +4 -4
- package/dist/{fthry_index.CHb07pX6.js → fthry_index.YWCe9xut.js} +8 -8
- package/dist/{fthry_index.C9bj3Amt.js → fthry_index._4LdTVJS.js} +2 -2
- package/dist/{fthry_index.Bl_YFFMi.js → fthry_index.aL99gjHK.js} +5 -5
- package/dist/{fthry_index.B21PnTei.js → fthry_index.cdWJRcXS.js} +38 -41
- package/dist/{fthry_index.umd.CNiEdJLO.js → fthry_index.umd.BYgeEgf8.js} +1 -1
- package/dist/{fthry_index.mEvi-eyb.js → fthry_index.xZSdf7ry.js} +152 -142
- package/dist/{fthry_input.C13Hy41e.js → fthry_input.DbXz6y8m.js} +1 -1
- package/dist/fthry_mermaid-O7DHMXV3.BTTUMTMH.js +8 -0
- package/dist/{fthry_script.DG-h2qqu.js → fthry_script.BORBdvL8.js} +1 -1
- package/dist/{fthry_styles.BbfFntw_.js → fthry_styles.BfxKVFUw.js} +1 -1
- package/dist/{fthry_useElementSize.Bvu4QN6c.js → fthry_useElementSize.BIz4pNfw.js} +1 -1
- package/dist/{fthry_useSalesforceSync.DxPyrYOH.js → fthry_useSalesforceSync.wO8Y6yIk.js} +1 -1
- package/dist/{fthry_webfontloader.BZH4UrSE.js → fthry_webfontloader.D4WGyNNh.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/thumbnail-renderer.js +1 -1
- package/dist/types/Form.d.ts +3 -0
- package/dist/types/Form.d.ts.map +1 -1
- package/package.json +1 -1
- package/umd/TableElement.f51ba6d3b0a6c7835187.js +1 -0
- package/umd/index.js +1 -1
- package/dist/fthry_mermaid-O7DHMXV3.rQggAcUJ.js +0 -8
- package/umd/TableElement.8c0bec8400517f135fe6.js +0 -1
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { u as Mermaid } from './fthry_AssistantChat.h6NTcnjr.js';
|
|
2
|
-
import './fthry_index.B21PnTei.js';
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import 'react';
|
|
5
|
-
import 'jszip';
|
|
6
|
-
import 'react-dom';
|
|
7
|
-
import './fthry_clsx.ChV9xqsO.js';
|
|
8
|
-
import './fthry_index.CuFf_oA3.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunkFeathery=this.webpackChunkFeathery||[]).push([[844],{5983:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ct});var n=r(35944),o=r(67294),a=r(20426),i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},l="#ffffff",c="#f9fafb",s="#f3f4f6",u="#e5e7eb",d="#d1d5db",f="#9ca3af",p="#4b5563",h="#111827",g="#1d4ed8",v="#ef4444",b="#dc2626",y={width:"16px",height:"16px",color:"#6b7280"},m={display:"flex",flexDirection:"column",gap:"2px","& svg":{marginInlineStart:"4px",width:"20px",height:"20px"}},x={width:"12px",height:"12px",color:f,opacity:.3,'&[data-active="true"]':{color:g,opacity:1}},w={display:"flex",alignItems:"center",gap:"8px"},C={position:"relative",overflowX:"auto",overflowY:"auto",backgroundColor:l,boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",borderRadius:"8px",border:"1px solid ".concat(u),minWidth:"100%",maxWidth:"100%",height:"100%",boxSizing:"border-box"},k={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"64px 24px",textAlign:"center"},S={color:p,fontSize:"16px",fontWeight:"500",margin:0},Z={position:"relative",flex:1},R={position:"absolute",top:0,bottom:0,left:0,display:"flex",alignItems:"center",paddingLeft:"12px",pointerEvents:"none"},P={display:"block",width:"100%",maxWidth:"384px",paddingLeft:"36px",paddingRight:"12px",paddingTop:"10px",paddingBottom:"10px",backgroundColor:c,border:"1px solid ".concat(u),color:h,fontSize:"14px",borderRadius:"8px",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",boxSizing:"border-box"},_={width:"100%",maxWidth:"100%",fontSize:"14px",textAlign:"left",color:p,textIndent:0,borderColor:"inherit",borderCollapse:"collapse"},B={fontSize:"14px",color:p,backgroundColor:c,borderBottom:"1px solid ".concat(u)},I={padding:"12px 24px",fontWeight:"500",userSelect:"none",whiteSpace:"nowrap"},L={backgroundColor:l,borderBottom:"1px solid ".concat(u),transition:"background-color 0.2s"},N={padding:"16px 24px",wordBreak:"break-word",overflowWrap:"anywhere"},A={display:"flex",alignItems:"center",flexWrap:"wrap",justifyContent:"space-between",padding:"16px",gap:"8px"},E={fontSize:"14px",fontWeight:"normal",color:p},D={fontWeight:"600",color:h},M={display:"flex",marginLeft:"-1px",fontSize:"14px",listStyle:"none",padding:0,margin:0},j={display:"flex",alignItems:"center",justifyContent:"center",color:p,backgroundColor:c,boxSizing:"border-box",border:"1px solid ".concat(u),fontWeight:"500",fontSize:"14px",textDecoration:"none",cursor:"pointer",height:"36px",wordBreak:"keep-all",overflowWrap:"normal","&:hover":{backgroundColor:s,color:h},"&:disabled:hover":{color:p,backgroundColor:c,cursor:"auto"}},T=i(i({},j),{borderRadius:"4px",paddingInline:"8px",paddingBlock:"4px",width:"auto",height:"auto",minHeight:"28px",position:"relative"}),X={width:"16px",height:"16px",color:p},O={position:"fixed",backgroundColor:l,border:"1px solid ".concat(d),borderRadius:"4px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",zIndex:9999,minWidth:"120px"},W={display:"block",width:"100%",textAlign:"left",paddingLeft:"12px",paddingRight:"12px",paddingTop:"8px",paddingBottom:"8px",fontSize:"14px",color:"#374151",backgroundColor:"transparent",border:"none",cursor:"pointer",whiteSpace:"nowrap",position:"relative","&:hover":{backgroundColor:s},"&:disabled:hover":{backgroundColor:"transparent",cursor:"auto"},"&:first-of-type":{borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},"&:last-of-type":{borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"}},F={borderTop:"1px solid ".concat(u),margin:"4px 0"},z=i(i({},W),{color:v,"&:hover":{backgroundColor:s,color:b}}),V=i(i({},T),{aspectRatio:1,paddingLeft:0,paddingRight:0}),Q={display:"flex",gap:"8px",justifyContent:"flex-end"},K=i(i({},j),{width:"36px",borderRightWidth:0}),H=i(i({},K),{borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",paddingLeft:"12px",paddingRight:"12px",width:"auto"}),Y=i(i({},K),{borderTopRightRadius:"8px",borderBottomRightRadius:"8px",paddingLeft:"12px",paddingRight:"12px",width:"auto",borderRightWidth:1}),$=i(i({},K),{color:g,backgroundColor:"#eff6ff",border:"1px solid ".concat(u)}),q={opacity:.8,cursor:"default",color:f,"&:hover":{backgroundColor:c,color:f}},G=i(i({},K),{appearance:"none",WebkitAppearance:"none",cursor:"pointer",paddingLeft:"8px",paddingRight:"8px",width:"36px",textAlign:"center",outline:"none","&:hover":{backgroundColor:s,color:h},"&:focus":{outline:"none"}}),J={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px",borderBottom:"1px solid ".concat(u),gap:"12px"},U=i(i({},j),{borderRadius:"8px",paddingLeft:"12px",paddingRight:"12px",whiteSpace:"nowrap"}),ee={color:f,cursor:"pointer",userSelect:"none",fontSize:"14px"},te={display:"block",width:"100%",minWidth:0,maxWidth:"100%",padding:"4px 8px",border:"1px solid ".concat(g),borderRadius:"4px",fontSize:"14px",color:h,outline:"none",boxSizing:"border-box",resize:"none",overflowY:"auto",fontFamily:"inherit",lineHeight:1.5},re={display:"flex",alignItems:"flex-start",gap:"8px"},ne={flex:1,minWidth:0,whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-word",lineHeight:1.5},oe={flex:1,minWidth:0,position:"relative",alignSelf:"stretch"},ae=i(i({},te),{whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-word",visibility:"hidden",pointerEvents:"none"}),ie={position:"absolute",inset:0,height:"100%"},le={display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",borderRadius:"4px",border:"none",backgroundColor:"transparent",color:f,cursor:"pointer",opacity:0,transition:"opacity 0.15s",flexShrink:0,padding:0,'tr:hover &, &[aria-expanded="true"]':{opacity:1},"&:hover":{backgroundColor:s,color:p}},ce={width:"40px",padding:"0 8px"},se={display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"4px",border:"none",backgroundColor:"transparent",color:f,cursor:"pointer",opacity:0,transition:"opacity 0.15s",padding:0,"tr:hover &":{opacity:1},"&:hover":{backgroundColor:s,color:v}},ue={position:"fixed",backgroundColor:l,border:"1px solid ".concat(d),borderRadius:"8px",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1)",zIndex:9999,padding:"12px 16px"},de={margin:"0 0 12px 0",fontSize:"14px",fontWeight:"500",color:h},fe={display:"flex",gap:"8px",justifyContent:"flex-end"},pe=i(i({},j),{borderRadius:"6px",paddingLeft:"12px",paddingRight:"12px",height:"32px"}),he=i(i({},j),{borderRadius:"6px",paddingLeft:"12px",paddingRight:"12px",height:"32px",backgroundColor:v,color:l,border:"1px solid ".concat(v),"&:hover":{backgroundColor:b,color:l}}),ge="feathery-table-header-cell",ve="feathery-table-row",be="feathery-table-cell",ye="feathery-table-editable-cell",me="feathery-table-action-menu-item",xe="feathery-table-page-button",we=function(){return we=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},we.apply(this,arguments)};function Ce(){return(0,n.tZ)("svg",we({css:y,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2},{children:(0,n.tZ)("path",{strokeLinecap:"round",d:"M21 21l-3.5-3.5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"})}))}function ke(e){var t=e.searchQuery,r=e.onSearchChange;return(0,n.BX)("div",we({className:"feathery-table-search",css:Z},{children:[(0,n.tZ)("div",we({css:R},{children:(0,n.tZ)(Ce,{})})),(0,n.tZ)("input",{type:"text",className:"feathery-table-search-input",css:P,placeholder:"Search",value:t,onChange:function(e){return r(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&e.preventDefault()}})]}))}var Se=function(){return Se=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Se.apply(this,arguments)};function Ze(e){var t=e.isSorted,r=e.sortDirection;return(0,n.BX)("svg",Se({xmlns:"http://www.w3.org/2000/svg",className:"feathery-table-sort-icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},{children:[(0,n.tZ)("path",{css:x,stroke:"currentColor","data-active":t&&"asc"===r||void 0,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m8 9 4-4 4 4"}),(0,n.tZ)("path",{css:x,stroke:"currentColor","data-active":t&&"desc"===r||void 0,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m8 15 4 4 4-4"})]}))}function Re(e){var t=e.columns,r=e.enableSort,a=e.sortColumn,i=e.sortDirection,l=e.onSort,c=e.styles;return(0,n.tZ)(o.Fragment,{children:t.map((function(e,t){var o=r,s=a===e.name,u=0===t;return(0,n.tZ)("th",Se({scope:"col",className:ge,"data-feathery-field":e.field_key,onClick:function(){return o&&l(e.name)},css:Se(Se(Se(Se({},I),u?{}:{paddingLeft:0}),c.getTarget("th")),o?{cursor:"pointer"}:{})},{children:(0,n.BX)("div",Se({css:w},{children:[(0,n.tZ)("span",{children:e.name}),o&&(0,n.tZ)("span",Se({css:m},{children:(0,n.tZ)(Ze,{isSorted:s,sortDirection:i})}))]}))}),t)}))})}var Pe=function(){return Pe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pe.apply(this,arguments)};function _e(e){var t=e.currentPage,r=e.totalItems,o=e.rowsPerPage;return(0,n.BX)("span",Pe({css:E},{children:["Showing"," ",(0,n.BX)("span",Pe({css:D},{children:[t*o+1,"-",Math.min((t+1)*o,r)]}))," ","of ",(0,n.tZ)("span",Pe({css:D},{children:r}))]}))}function Be(e){var t=e.disabled,r=e.onClick;return(0,n.tZ)("button",Pe({type:"button",onClick:r,disabled:t,className:xe,css:Pe(Pe({},H),t?q:{})},{children:"Previous"}))}function Ie(e){var t=e.disabled,r=e.onClick;return(0,n.tZ)("button",Pe({type:"button",onClick:r,disabled:t,className:xe,css:Pe(Pe({},Y),t?q:{})},{children:"Next"}))}function Le(e){var t=e.pages,r=e.onPageChange;return(0,n.BX)("select",Pe({value:"",onChange:function(e){r(Number(e.target.value))},"aria-label":"Go to page",className:"feathery-table-page-select",css:G},{children:[(0,n.tZ)("option",Pe({value:"",disabled:!0,hidden:!0},{children:"..."})),t.map((function(e){return(0,n.tZ)("option",Pe({value:e},{children:e+1}),e)}))]}))}function Ne(e){var t=e.currentPage,r=e.totalPages,a=e.onPageChange,i=new Set;i.add(0),i.add(r-1);for(var l=Math.max(0,t-1);l<=Math.min(r-1,t+1);l++)i.add(l);var c=[],s=Array.from(i).sort((function(e,t){return e-t}));for(l=0;l<s.length;l++){var u=s[l],d=l>0?s[l-1]:-1;if(u-d>1){for(var f=[],p=d+1;p<u;p++)f.push(p);c.push({type:"overflow",pages:f})}c.push({type:"page",page:u})}return(0,n.tZ)(o.Fragment,{children:c.map((function(e,r){if("overflow"===e.type)return 1===e.pages.length?(0,n.tZ)("li",{children:(0,n.tZ)("button",Pe({type:"button",onClick:function(){return a(e.pages[0])},className:xe,css:K},{children:e.pages[0]+1}))},"overflow-".concat(r)):(0,n.tZ)("li",{children:(0,n.tZ)(Le,{pages:e.pages,onPageChange:a})},"overflow-".concat(r));var o=e.page===t;return(0,n.tZ)("li",{children:(0,n.tZ)("button",Pe({type:"button",onClick:function(){return a(e.page)},"aria-current":o?"page":void 0,className:xe,css:o?$:K},{children:e.page+1}))},e.page)}))})}function Ae(e){var t=e.currentPage,r=e.totalPages,o=e.totalItems,a=e.rowsPerPage,i=e.onPageChange;return r<=1?null:(0,n.BX)("nav",Pe({className:"feathery-table-pagination",css:A,"aria-label":"Table navigation"},{children:[(0,n.tZ)(_e,{currentPage:t,totalItems:o,rowsPerPage:a}),(0,n.BX)("ul",Pe({css:M},{children:[(0,n.tZ)("li",{children:(0,n.tZ)(Be,{disabled:0===t,onClick:function(){return i(Math.max(0,t-1))}})}),(0,n.tZ)(Ne,{currentPage:t,totalPages:r,onPageChange:i}),(0,n.tZ)("li",{children:(0,n.tZ)(Ie,{disabled:t>=r-1,onClick:function(){i(Math.min(r-1,t+1))}})})]}))]}))}var Ee=r(73935),De=r(95710),Me=r(39479),je=function(){return je=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},je.apply(this,arguments)},Te=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i};function Xe(){return(0,n.BX)("svg",je({css:X,fill:"currentColor",viewBox:"0 0 24 24"},{children:[(0,n.tZ)("circle",{cx:"12",cy:"5",r:"2"}),(0,n.tZ)("circle",{cx:"12",cy:"12",r:"2"}),(0,n.tZ)("circle",{cx:"12",cy:"19",r:"2"})]}))}function Oe(e){var t,r,a,i=e.actions,l=e.rowIndex,c=e.columnData,s=e.fieldValues,u=e.onClick,d=e.forceInlineButtons,f=void 0!==d&&d,p=e.tableId,h=void 0===p?"":p,g=e.buttonLoaders,v=void 0===g?{}:g,b=e.canDeleteRows,y=void 0!==b&&b,m=e.onDeleteRow;if(0===i.length)return null;var x=Te((0,o.useState)(!1),2),w=x[0],C=x[1],k=Te((0,o.useState)({top:0,left:0}),2),S=k[0],Z=k[1],R=(0,o.useRef)(null),P=(0,o.useRef)(null),_=(0,o.useRef)(null),B=!f&&i.length>1;(0,o.useEffect)((function(){if(w){var e=function(e){P.current&&!P.current.contains(e.target)&&_.current&&!_.current.contains(e.target)&&C(!1)},t=function(){C(!1)},r=(0,Me.me)();return r.addEventListener("mousedown",e),r.addEventListener("scroll",t,!0),function(){r.removeEventListener("mousedown",e),r.removeEventListener("scroll",t,!0)}}}),[w]);var I=function(e){C(!1);var t=s||De.u4,r={};c.forEach((function(e){var n=t[e.field_key],o=Array.isArray(n)?n[l]:n;r[e.name]=o})),u({action:e.label,rowIndex:l,rowData:r})},L=null!==(a=null===(r=v["".concat(h,"_").concat(l,"_").concat(null===(t=i.find((function(e){var t,r="".concat(h,"_").concat(l,"_").concat(e.label);return null===(t=v[r])||void 0===t?void 0:t.loader})))||void 0===t?void 0:t.label)])||void 0===r?void 0:r.loader)&&void 0!==a?a:null;return(0,n.tZ)("div",je({ref:R,css:Q},{children:B?(0,n.BX)(o.Fragment,{children:[(0,n.tZ)("button",je({ref:_,type:"button",disabled:L,onClick:function(e){e.stopPropagation(),function(){if(!w&&_.current){var e=_.current.getBoundingClientRect();Z({top:e.bottom+4,left:e.right})}C(!w)}()},className:"feathery-table-action-menu-button",css:V},{children:L?(0,n.tZ)("div",je({style:{height:"16px",width:"16px",display:"flex",alignItems:"center",justifyContent:"center"}},{children:L})):(0,n.tZ)(Xe,{})})),w&&(0,Ee.createPortal)((0,n.BX)("div",je({ref:P,className:"feathery-table-action-menu",css:je(je({},O),{top:"".concat(S.top,"px"),left:"".concat(S.left,"px"),transform:"translateX(-100%)"})},{children:[i.map((function(e,t){var r=Object.keys(v).length>0;return(0,n.tZ)("button",je({type:"button",onClick:function(t){t.stopPropagation(),I(e)},className:me,css:W,disabled:r},{children:e.label}),t)})),y&&m&&(0,n.BX)(n.HY,{children:[(0,n.tZ)("div",{css:F}),(0,n.tZ)("button",je({type:"button",onClick:function(e){e.stopPropagation(),C(!1),m(l)},className:me,css:z},{children:"Delete"}))]})]})),(0,Me.me)().body)]}):i.map((function(e,t){var r,o="".concat(h,"_").concat(l,"_").concat(e.label),a=null===(r=v[o])||void 0===r?void 0:r.loader,i=Object.keys(v).length>0;return(0,n.BX)("button",je({type:"button",onClick:function(t){t.stopPropagation(),I(e)},className:"feathery-table-action-button",css:T,disabled:i},{children:[(0,n.tZ)("span",je({style:{visibility:a?"hidden":"visible"}},{children:e.label})),a&&(0,n.tZ)("div",je({style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",height:"16px",width:"16px"}},{children:a}))]}),t)}))}))}var We=function(){return We=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},We.apply(this,arguments)};function Fe(e){var t=e.hasSearchQuery;return(0,n.BX)("div",We({className:"feathery-table-empty",css:k},{children:[t&&(0,n.tZ)("svg",We({css:{width:"48px",height:"48px",color:"#9ca3af",marginBottom:"16px"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5},{children:(0,n.tZ)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})})),(0,n.tZ)("p",We({css:S},{children:t?"No results found":"No data available"})),t&&(0,n.tZ)("p",We({css:We(We({},S),{fontSize:"14px",marginTop:"8px"})},{children:"Try adjusting your search query"}))]}))}var ze=function(){return ze=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ze.apply(this,arguments)};function Ve(e){var t=e.anchorEl,r=e.onConfirm,a=e.onCancel,i=e.message,l=void 0===i?"Delete this row?":i,c=e.confirmLabel,s=void 0===c?"Delete":c,u=(0,o.useRef)(null);if(!t)return null;var d=t.getBoundingClientRect(),f=d.bottom+4,p=d.right;return(0,o.useEffect)((function(){var e=function(e){u.current&&!u.current.contains(e.target)&&t&&!t.contains(e.target)&&a()},r=function(){return a()},n=function(e){"Escape"===e.key&&a()},o=(0,Me.me)();return o.addEventListener("mousedown",e),o.addEventListener("scroll",r,!0),o.addEventListener("keydown",n),function(){o.removeEventListener("mousedown",e),o.removeEventListener("scroll",r,!0),o.removeEventListener("keydown",n)}}),[a,t]),(0,Ee.createPortal)((0,n.BX)("div",ze({ref:u,role:"alertdialog","aria-label":l,className:"feathery-table-delete-confirm",css:ze(ze({},ue),{top:"".concat(f,"px"),left:"".concat(p,"px"),transform:"translateX(-100%)"})},{children:[(0,n.tZ)("p",ze({css:de},{children:l})),(0,n.BX)("div",ze({css:fe},{children:[(0,n.tZ)("button",ze({type:"button",css:pe,onClick:function(e){e.stopPropagation(),a()}},{children:"Cancel"})),(0,n.tZ)("button",ze({type:"button",css:he,onClick:function(e){e.stopPropagation(),r()}},{children:s}))]}))]})),(0,Me.me)().body)}var Qe=function(){return Qe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Qe.apply(this,arguments)},Ke=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i};function He(){return(0,n.BX)("svg",Qe({width:"16",height:"16",fill:"currentColor",viewBox:"0 0 24 24"},{children:[(0,n.tZ)("circle",{cx:"12",cy:"5",r:"2"}),(0,n.tZ)("circle",{cx:"12",cy:"12",r:"2"}),(0,n.tZ)("circle",{cx:"12",cy:"19",r:"2"})]}))}function Ye(e){var t,r=e.value,i=e.fieldKey,l=e.rowIndex,c=e.onEdit,s=e.onClear,u=Ke((0,o.useState)(!1),2),d=u[0],f=u[1],p=Ke((0,o.useState)(""),2),h=p[0],g=p[1],v=Ke((0,o.useState)(!1),2),b=v[0],y=v[1],m=Ke((0,o.useState)(!1),2),x=m[0],w=m[1],C=Ke((0,o.useState)({top:0,left:0}),2),k=C[0],S=C[1],Z=(0,o.useRef)(null),R=(0,o.useRef)(null),P=(0,o.useRef)(null),_=(0,o.useRef)(!0),B=(0,o.useCallback)((function(){return w(!1)}),[]),I=null!==(t=(0,a.e7)(r))&&void 0!==t?t:"",L=""===I;(0,o.useEffect)((function(){d&&Z.current&&Z.current.focus()}),[d]),(0,o.useEffect)((function(){if(b){var e=function(e){P.current&&!P.current.contains(e.target)&&R.current&&!R.current.contains(e.target)&&y(!1)},t=function(){return y(!1)},r=(0,Me.me)();return r.addEventListener("mousedown",e),r.addEventListener("scroll",t,!0),function(){r.removeEventListener("mousedown",e),r.removeEventListener("scroll",t,!0)}}}),[b]);var N=function(){g(I),f(!0),y(!1)},A=function(){h!==I&&c(i,l,h),f(!1)};return d?(0,n.BX)("div",Qe({className:ye,css:oe},{children:[(0,n.tZ)("div",Qe({css:ae},{children:"".concat(h,"")})),(0,n.tZ)("textarea",{ref:Z,value:h,onChange:function(e){return g(e.target.value)},onBlur:function(){_.current&&A(),_.current=!0},onKeyDown:function(e){(e.metaKey||e.ctrlKey)&&"Enter"===e.key?(e.preventDefault(),_.current=!1,A()):"Escape"===e.key?(e.preventDefault(),_.current=!1,f(!1)):"Tab"===e.key&&(_.current=!1,A())},className:"feathery-table-cell-input",css:Qe(Qe({},te),ie),onClick:function(e){return e.stopPropagation()}})]})):L?(0,n.tZ)("span",Qe({className:ye,css:ee,onClick:N},{children:"Click to edit"})):(0,n.BX)("div",Qe({className:ye,css:re},{children:[(0,n.tZ)("span",Qe({css:ne},{children:I})),(0,n.tZ)("button",Qe({ref:R,type:"button","aria-expanded":b,"aria-haspopup":"menu",css:le,onClick:function(e){if(e.stopPropagation(),!b&&R.current){var t=R.current.getBoundingClientRect();S({top:t.bottom+4,left:t.right})}y(!b)}},{children:(0,n.tZ)(He,{})})),b&&(0,Ee.createPortal)((0,n.BX)("div",Qe({ref:P,role:"menu",css:Qe(Qe({},O),{top:"".concat(k.top,"px"),left:"".concat(k.left,"px"),transform:"translateX(-100%)"})},{children:[(0,n.tZ)("button",Qe({type:"button",role:"menuitem",css:W,onClick:function(e){e.stopPropagation(),N()}},{children:"Edit Value"})),(0,n.tZ)("button",Qe({type:"button",role:"menuitem",css:W,onClick:function(e){e.stopPropagation(),y(!1),w(!0)}},{children:"Clear Field"}))]})),(0,Me.me)().body),x&&(0,n.tZ)(Ve,{anchorEl:R.current,message:"Clear this field?",confirmLabel:"Clear",onConfirm:function(){B(),s(i,l)},onCancel:B})]}))}var $e=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i};function qe(e){var t,r=function(e){if(null==e||""===e)return null;var t=String(e).trim().replace(/[$€£¥]/g,"").replace(/[,%]/g,"").replace(/\s/g,""),r=parseFloat(t);return isNaN(r)?null:r}(e),n=function(e){var t,r,n,o;if(null==e||""===e)return null;var a=String(e).trim(),i=new Date(a);if(!isNaN(i.getTime()))return i;try{for(var l=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}([/^(\d{1,2})[/-](\d{1,2})[/-](\d{2,4})$/,/^(\d{4})[/-](\d{1,2})[/-](\d{1,2})$/]),c=l.next();!c.done;c=l.next()){var s=c.value,u=a.match(s);if(u){var d=void 0,f=void 0,p=void 0;4===u[1].length?(d=(n=$e(u,4))[1],f=n[2],p=n[3]):(f=(o=$e(u,4))[1],p=o[2],d=o[3]),2===d.length&&(d=parseInt(d)<50?"20".concat(d):"19".concat(d));var h=new Date(parseInt(d),parseInt(f)-1,parseInt(p));if(!isNaN(h.getTime()))return h}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return null}(e);return{original:e,asNumber:r,asDate:n,asString:null!==(t=(0,a.e7)(e))&&void 0!==t?t:""}}function Ge(e,t){return null!==e.asNumber&&null!==t.asNumber?e.asNumber-t.asNumber:null!==e.asDate&&null!==t.asDate?e.asDate.getTime()-t.asDate.getTime():e.asString.localeCompare(t.asString)}var Je=function(){return Je=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Je.apply(this,arguments)},Ue=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},et=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i},tt=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};function rt(e){return"".concat("__feathery_table_page_").concat(e)}var nt=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i},ot=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},at=r(65096),it=function(){return it=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},it.apply(this,arguments)},lt=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i};const ct=function(e){var t=e.element,r=e.responsiveStyles,i=e.onClick,l=void 0===i?function(){}:i,c=e.updateFieldValues,s=void 0===c?function(){}:c,u=e.submitCustom,d=void 0===u?function(){}:u,f=e.editMode,p=void 0!==f&&f,h=e.buttonLoaders,g=void 0===h?{}:h,v=e.assistantClient,b=(0,o.useMemo)((function(){return function(e){return e.addTargets("table","thead","tbody","th","td","tr"),e}(r)}),[r]),y=lt((0,o.useState)(0),2),x=y[0],k=y[1],S=(0,o.useCallback)((function(){return k((function(e){return e+1}))}),[]),Z=function(e){var t,r,n,i,l,c,s,u,d,f,p,h,g,v,b=e.element,y=e.editMode,m=void 0!==y&&y,x=e.dataVersion,w=void 0===x?0:x,C=(null===(t=b.properties)||void 0===t?void 0:t.columns)||[],k=((null===(r=b.properties)||void 0===r?void 0:r.actions)||[]).filter((function(e){return e.label&&""!==e.label.trim()})),S=null!==(i=null===(n=b.properties)||void 0===n?void 0:n.search)&&void 0!==i&&i,Z=null!==(c=null===(l=b.properties)||void 0===l?void 0:l.sort)&&void 0!==c&&c,R=null!==(u=null===(s=b.properties)||void 0===s?void 0:s.transpose)&&void 0!==u&&u,P=null!==(f=null===(d=b.properties)||void 0===d?void 0:d.enable_editing)&&void 0!==f&&f,_=null!==(h=null===(p=b.properties)||void 0===p?void 0:p.add_delete_rows)&&void 0!==h&&h,B=null!==(v=null===(g=b.properties)||void 0===g?void 0:g.pagination)&&void 0!==v?v:0,I="number"==typeof B&&B>0?Math.floor(B):0,L=I>0,N=(0,o.useMemo)((function(){var e=C;return m&&(e=e.map((function(e,t){return Je(Je({},e),{field_key:"example_column_".concat(t)})}))),e}),[m,C]),A=(0,o.useMemo)((function(){return m?function(e,t){void 0===t&&(t=2);var r={};return e.forEach((function(e){r[e.field_key]=Array(t).fill("Sample")})),r}(N):Je({},De.u4)}),[m,N,w]),E=et((0,o.useState)(""),2),D=E[0],M=E[1],j=et((0,o.useState)(null),2),T=j[0],X=j[1],O=et((0,o.useState)("asc"),2),W=O[0],F=O[1],z=et((0,o.useState)((function(){return function(e){var t=rt(e),r=sessionStorage.getItem(t);if(!r)return 0;var n=parseInt(r,10);return Number.isInteger(n)&&n>=0?n:0}(b.id)})),2),V=z[0],Q=z[1],K=(0,o.useMemo)((function(){return N.reduce((function(e,t){var r=A[t.field_key];return Array.isArray(r)?Math.max(e,r.length):e}),0)}),[N,A]),H=(0,o.useMemo)((function(){return Array.from({length:K},(function(e,t){return t}))}),[K]),Y=(0,o.useMemo)((function(){return R&&S&&D.trim()?H.filter((function(e){return N.some((function(t){var r,n=A[t.field_key],o=Array.isArray(n)?n[e]:n;return(null!==(r=(0,a.e7)(o))&&void 0!==r?r:"").toLowerCase().includes(D.toLowerCase().trim())}))})):H}),[R,H,N,D,S,A]),$=et((0,o.useState)(null),2),q=$[0],G=$[1],J=(0,o.useMemo)((function(){if(!R||!Z||null===q)return Y;var e=N[q];return e?tt([],et(Y),!1).sort((function(t,r){var n=A[e.field_key],o=Array.isArray(n)?n[t]:n,a=Array.isArray(n)?n[r]:n,i=Ge(qe(o),qe(a));return"asc"===W?i:-i})):Y}),[R,Y,q,W,N,A,Z]),U=(0,o.useMemo)((function(){if(!R||!L)return J;var e=V*I,t=e+I;return J.slice(e,t)}),[R,J,V,I,L]),ee=(0,o.useMemo)((function(){if(!R||0===K)return{columns:N,activeFieldValues:A,transposedRowIndices:[]};var e=function(e,t,r,n){var o,a,i,l,c,s,u=n||Array.from({length:r},(function(e,t){return t})),d=[{name:"",field_id:"_transpose_field_name",field_type:"text",field_key:"_transpose_field_name"}];try{for(var f=Ue(u),p=f.next();!p.done;p=f.next()){var h=p.value;d.push({name:"",field_id:"_transpose_row_".concat(h),field_type:"text",field_key:"_transpose_row_".concat(h),originalRowIndex:h})}}catch(e){o={error:e}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}var g={_transpose_field_name:e.map((function(e){return e.name}))};try{for(var v=Ue(u),b=v.next();!b.done;b=v.next()){h=b.value;var y=[];try{for(var m=(c=void 0,Ue(e)),x=m.next();!x.done;x=m.next()){var w=t[x.value.field_key],C=Array.isArray(w)?w[h]:w;y.push(C)}}catch(e){c={error:e}}finally{try{x&&!x.done&&(s=m.return)&&s.call(m)}finally{if(c)throw c.error}}g["_transpose_row_".concat(h)]=y}}catch(e){i={error:e}}finally{try{b&&!b.done&&(l=v.return)&&l.call(v)}finally{if(i)throw i.error}}return{transposedColumns:d,transposedFieldValues:g,includedRowIndices:u}}(N,A,K,U);return{columns:e.transposedColumns,activeFieldValues:e.transposedFieldValues,transposedRowIndices:e.includedRowIndices}}),[R,N,A,K,U]),te=ee.columns,re=ee.activeFieldValues,ne=ee.transposedRowIndices,oe=(0,o.useMemo)((function(){return te.reduce((function(e,t){var r=re[t.field_key];return Array.isArray(r)?Math.max(e,r.length):e}),0)}),[te,re]),ae=(0,o.useMemo)((function(){return Array.from({length:oe},(function(e,t){return t}))}),[oe]),ie=(0,o.useMemo)((function(){return R?ae:S&&D.trim()?ae.filter((function(e){return te.some((function(t){var r,n=re[t.field_key],o=Array.isArray(n)?n[e]:n;return(null!==(r=(0,a.e7)(o))&&void 0!==r?r:"").toLowerCase().includes(D.toLowerCase().trim())}))})):ae}),[R,ae,te,D,S,re]),le=(0,o.useMemo)((function(){if(R)return ie;if(!Z||!T)return ie;var e=te.find((function(e){return e.name===T}));return e?tt([],et(ie),!1).sort((function(t,r){var n=re[e.field_key],o=Array.isArray(n)?n[t]:n,a=Array.isArray(n)?n[r]:n,i=Ge(qe(o),qe(a));return"asc"===W?i:-i})):ie}),[R,ie,T,W,te,Z,re]),ce=(0,o.useMemo)((function(){if(R)return ae;if(!L)return le;var e=V*I,t=e+I;return le.slice(e,t)}),[R,ae,le,V,I,L]),se=(0,o.useRef)({initialMount:!0,search:"",sortColumn:"",sortDirection:""});(0,o.useEffect)((function(){var e=se.current;if(e.initialMount)return e.initialMount=!1,e.search=D,e.sortColumn=T,void(e.sortDirection=W);D===e.search&&T===e.sortColumn&&W===e.sortDirection||(Q(0),e.search=D,e.sortColumn=T,e.sortDirection=W)}),[D,T,W]);var ue=R?J.length:le.length,de=L?Math.ceil(ue/I):1;(0,o.useEffect)((function(){var e,t,r;b.id&&(e=b.id,t=V,r=rt(e),sessionStorage.setItem(r,t.toString()))}),[b.id,V]),(0,o.useEffect)((function(){de>0&&V>=de&&Q(de-1)}),[de]);var fe=oe>0,pe=R?Y.length>0:ie.length>0;return{enableSearch:S,searchQuery:D,hasSearchResults:pe,setSearchQuery:M,enableSort:Z,sortColumn:T,sortDirection:W,sortedColumnIndex:q,handleSort:function(e){Z&&(T===e?"asc"===W?F("desc"):(X(null),F("asc")):(X(e),F("asc")))},handleTransposedSort:function(e){Z&&R&&(q===e?"asc"===W?F("desc"):(G(null),F("asc")):(G(e),F("asc")))},enablePagination:L,currentPage:V,paginatedRowIndices:ce,rowsPerPage:I,setCurrentPage:Q,columns:te,actions:k,isTransposed:R&&K>0,transposedRowIndices:ne,enableEditing:P,enableAddDeleteRows:_,totalRows:ue,totalPages:de,hasData:fe,activeFieldValues:re,baseColumns:N,baseFieldValues:A}}({element:t,editMode:p,dataVersion:x}),R=Z.enableSearch,P=Z.searchQuery,A=Z.setSearchQuery,E=Z.enableSort,D=Z.sortColumn,M=Z.sortDirection,j=Z.sortedColumnIndex,T=Z.handleSort,X=Z.handleTransposedSort,O=Z.enablePagination,W=Z.currentPage,F=Z.setCurrentPage,z=Z.paginatedRowIndices,V=Z.rowsPerPage,Q=Z.enableEditing,K=Z.enableAddDeleteRows,H=Z.columns,Y=Z.actions,$=Z.isTransposed,q=Z.transposedRowIndices,G=Z.totalRows,ee=Z.totalPages,te=Z.hasData,re=Z.hasSearchResults,ne=Z.activeFieldValues,oe=Z.baseColumns,ae=Z.baseFieldValues,ie=function(e){var t=e.columns,r=e.updateFieldValues,n=e.submitCustom,a=e.editMode,i=e.editModeFieldValues,l=e.enablePagination,c=e.setCurrentPage,s=e.setSearchQuery,u=e.searchQuery,d=e.onMutate,f=(0,o.useRef)(i);f.current=i;var p=(0,o.useCallback)((function(e){var t=(a?f.current:De.u4)[e];return Array.isArray(t)?t:[]}),[a]),h=(0,o.useCallback)((function(){var e={};t.forEach((function(t){var r=p(t.field_key);e[t.field_key]=ot([""],nt(r),!1)})),u&&s(""),r(e),d(),l&&c(0)}),[t,p,r,d,l,c,s,u]),g=(0,o.useCallback)((function(e){var r={};return t.forEach((function(t){var n=p(t.field_key);r[t.field_key]=n.filter((function(t,r){return r!==e}))})),r}),[t,p]),v=(0,o.useCallback)((function(e){var t=g(e);r(t),a||n(t),d()}),[g,r,n,a,d]),b=(0,o.useCallback)((function(e){var t=g(e);r(t),d()}),[g,r,d]),y=(0,o.useCallback)((function(e,t,o){var i,l=p(e),c=ot([],nt(l),!1);c[t]=o;var s=((i={})[e]=c,i);r(s),a||n(s),d()}),[p,r,n,a,d]),m=(0,o.useCallback)((function(e,t){y(e,t,"")}),[y]);return{handleAddRow:h,handleDeleteRow:v,handleRemoveRowLocal:b,handleCellEdit:y,handleCellClear:m}}({columns:oe,updateFieldValues:s,submitCustom:d,editMode:p,editModeFieldValues:ne,enablePagination:O,setCurrentPage:F,setSearchQuery:A,searchQuery:P,onMutate:S}),le=ie.handleAddRow,ue=ie.handleDeleteRow,de=ie.handleCellEdit,fe=ie.handleCellClear,pe=null==t?void 0:t.id,he=Q&&!$,ye=he&&K,me=he&&K,xe=Y.length>1,we=me&&!xe,Ce=lt((0,o.useState)(new Set),2),Se=Ce[0],Pe=Ce[1],_e=(0,o.useRef)(Se);_e.current=Se;var Be=(0,o.useCallback)((function(e,t,r){_e.current.has(t)&&Pe((function(e){var r=new Set(e);return r.delete(t),r})),de(e,t,r)}),[de]),Ie=lt((0,o.useState)(null),2),Le=Ie[0],Ne=Ie[1],Ee=(0,o.useRef)(W);Ee.current!==W&&(Ee.current=W,Ne(null));var Me=(0,o.useCallback)((function(){return Ne(null)}),[]),je=(0,o.useRef)(new Map),Te=(0,o.useRef)(new Map),Xe=(0,o.useCallback)((function(){Ne(null),le(),Pe((function(e){var t=new Set;return t.add(0),e.forEach((function(e){return t.add(e+1)})),t}))}),[le]),We=(0,o.useCallback)((function(e){ue(e),Ne(null)}),[ue]);(0,o.useEffect)((function(){if(v&&pe)return v.registerTable(pe,{handleCellEdit:Be,handleAddRow:Xe,handleDeleteRow:We}),function(){return v.unregisterTable(pe)}}),[v,pe,Be,Xe,We]);var ze=!te||!re,Qe=R||ye;return(0,n.BX)("div",it({className:"feathery-table-container",css:it(it({},C),b.getTarget("container"))},{children:[Qe&&(0,n.BX)("div",it({className:"feathery-table-toolbar",css:J},{children:[R?(0,n.tZ)(ke,{searchQuery:P,onSearchChange:A}):(0,n.tZ)("div",{}),ye&&(0,n.tZ)("button",it({type:"button",className:"feathery-table-add-row-button",css:U,onClick:Xe},{children:"+ Add Row"}))]})),ze?(0,n.tZ)(Fe,{hasSearchQuery:P.trim().length>0}):(0,n.tZ)("div",it({css:{overflowX:"auto"}},{children:(0,n.BX)("table",it({className:"feathery-table",css:it(it({},_),b.getTarget("table"))},{children:[!$&&(0,n.tZ)("thead",it({className:"feathery-table-header",css:B},{children:(0,n.BX)("tr",{children:[(0,n.tZ)(Re,{columns:H,enableSort:E,sortColumn:D,sortDirection:M,onSort:T,styles:b}),Y.length>0&&(0,n.tZ)("th",{scope:"col",className:ge,css:it(it(it({},I),{paddingLeft:0}),b.getTarget("th"))}),we&&(0,n.tZ)("th",{scope:"col",className:ge,css:it(it(it({},I),ce),b.getTarget("th"))})]})})),(0,n.BX)("tbody",it({className:"feathery-table-body",css:b.getTarget("tbody")},{children:[z.map((function(e){var r,o,i={};return $||H.forEach((function(t){var r=ne[t.field_key],n=Array.isArray(r)?r[e]:r;i[t.name]=n})),(0,n.BX)("tr",it({className:ve,css:it(it({},L),b.getTarget("tr")),onClick:function(){$||he||l({rowIndex:e,rowData:i})}},{children:[H.map((function(t,r){var o,i,c,s=ne[t.field_key],u=Array.isArray(s)?s[e]:s,d=$&&0===r,f=d&&E,p=j===e,h=0===r,g=1===r,v=$&&!d?t.originalRowIndex:void 0,y=d?it(it(it(it({},I),{backgroundColor:"#f9fafb",borderRight:"1px solid #e5e7eb",width:"1px",whiteSpace:"nowrap"}),b.getTarget("th")),f?{cursor:"pointer"}:{}):it(it(it(it({},N),$?g?{}:{paddingLeft:0}:h?{}:{paddingLeft:0}),$&&!d?{cursor:"pointer"}:{}),b.getTarget("td")),x=d?"th":"td",C=$?null===(o=oe[e])||void 0===o?void 0:o.field_key:t.field_key;return(0,n.tZ)(x,it({className:d?ge:be,"data-feathery-field":C,css:y,onClick:function(t){if(f)X(e);else if($&&void 0!==v){t.stopPropagation();var r={};oe.forEach((function(e){var t=ae[e.field_key],n=Array.isArray(t)?t[v]:t;r[e.name]=n})),l({rowIndex:v,rowData:r})}}},d?{scope:"row"}:{},{children:d&&f?(0,n.BX)("div",it({css:it(it({},w),{justifyContent:"space-between"})},{children:[(0,n.tZ)("span",{children:null!==(i=(0,a.e7)(u))&&void 0!==i?i:""}),(0,n.tZ)("span",it({css:m},{children:(0,n.tZ)(Ze,{isSorted:p,sortDirection:M})}))]})):he?(0,n.tZ)(Ye,{value:u,fieldKey:t.field_key,rowIndex:e,onEdit:Be,onClear:fe}):null!==(c=(0,a.e7)(u))&&void 0!==c?c:""}),r)})),!$&&Y.length>0&&(0,n.BX)("td",it({ref:function(t){t?Te.current.set(e,t):Te.current.delete(e)},className:be,css:it(it(it({},N),{paddingLeft:0}),b.getTarget("td"))},{children:[(0,n.tZ)(Oe,{actions:Y,rowIndex:e,columnData:oe,fieldValues:ae,onClick:l,tableId:t.id,buttonLoaders:g,canDeleteRows:me&&xe,onDeleteRow:function(e){return Ne(e)}}),xe&&me&&Le===e&&(0,n.tZ)(Ve,{anchorEl:null!==(r=Te.current.get(e))&&void 0!==r?r:null,onConfirm:function(){return We(e)},onCancel:Me})]})),we&&(0,n.BX)("td",it({className:be,css:it(it({},ce),b.getTarget("td"))},{children:[(0,n.tZ)("button",it({type:"button",ref:function(t){t?je.current.set(e,t):je.current.delete(e)},className:"feathery-table-delete-button",css:it(it({},se),Le===e&&{opacity:1}),onClick:function(t){t.stopPropagation(),Ne(Le===e?null:e)}},{children:(0,n.tZ)(at.XH,{})})),Le===e&&(0,n.tZ)(Ve,{anchorEl:null!==(o=je.current.get(e))&&void 0!==o?o:null,onConfirm:function(){return We(e)},onCancel:Me})]}))]}),e)})),$&&Y.length>0&&(0,n.BX)("tr",it({className:ve,css:it(it({},L),b.getTarget("tr"))},{children:[(0,n.tZ)("th",{scope:"row",className:ge,css:it(it(it({},I),{backgroundColor:"#f9fafb",borderRight:"1px solid #e5e7eb",width:"1px",whiteSpace:"nowrap"}),b.getTarget("th"))}),q.map((function(e,r){return(0,n.tZ)("td",it({className:be,css:it(it(it({},N),0===r?{}:{paddingLeft:0}),b.getTarget("td"))},{children:(0,n.tZ)("div",it({css:{display:"flex",justifyContent:"flex-start"}},{children:(0,n.tZ)(Oe,{actions:Y,rowIndex:e,columnData:oe,fieldValues:ae,onClick:l,forceInlineButtons:!0,tableId:t.id,buttonLoaders:g})}))}),e)}))]}))]}))]}))})),!ze&&O&&(0,n.tZ)(Ae,{currentPage:W,totalPages:ee,totalItems:G,rowsPerPage:V,onPageChange:F})]}))}}}]);
|