@airporting/integrations-app 0.4.22 → 0.4.23

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/dist/mf/741.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["741"],{2348:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{AirButton:()=>AirButton,BankAccountsChart:()=>BankAccountsChart,BankAccountsChartTooltip:()=>BankAccountsChartTooltip,BlurSpot:()=>BlurSpot,COLORS_EMOJI:()=>COLORS_EMOJI,Circle:()=>Circle,CompanyLogo:()=>CompanyLogo,CompanySelector:()=>CompanySelector,DynamicForm:()=>DynamicForm,Field:()=>Field,IconArrowUp:()=>IconArrowUp,IconCalculator:()=>IconCalculator,IconCheck:()=>IconCheck,IconCoin:()=>IconCoin,IconConnector:()=>IconConnector,IconCross:()=>IconCross,IconDashboard:()=>IconDashboard,IconDoubleLeft:()=>IconDoubleLeft,IconExternalLink:()=>IconExternalLink,IconLogOut:()=>IconLogOut,IconLogo:()=>IconLogo,IconRepeat:()=>IconRepeat,IconStar:()=>IconStar,KPICard:()=>KPICard,KPICardBankAccountsChart:()=>KPICardBankAccountsChart,LanguageSwitcher:()=>LanguageSwitcher,Logo:()=>Logo,PillTrend:()=>PillTrend,RxState:()=>RxState,SearchBox:()=>SearchBox,THEME_COLORS:()=>THEME_COLORS,ZIndex:()=>zIndex_ZIndex,cssVarResolver:()=>cssVarResolver,formatCurrency:()=>formatCurrency,formatCurrencyCompact:()=>formatCurrencyCompact,formatDateLocale:()=>formatDateLocale,formatPercent:()=>formatPercent,getLocaleDateFormat:()=>getLocaleDateFormat,isoday:()=>isoday,nbhy:()=>nbhy,parseDateFr:()=>parseDateFr,parseDateLocale:()=>parseDateLocale,theme:()=>theme_theme,useRxState:()=>useRxState,useRxStateDebounced:()=>useRxStateDebounced,useRxStateOr:()=>useRxStateOr});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4848);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9389);var _tanstack_react_router__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(63);var _mantine_charts__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1445);var date_fns__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(467);var lodash_es__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(1084);var radash__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(2425);var react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(3620);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(3128);var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(6022);var _mantine_hooks__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(207);var _mantine_form__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(1599);var react_i18next__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(8510);function Circle({style,size,...rest}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{radius:"50%",bg:"dark.4",w:size,h:size,style:{display:"flex",flexWrap:"wrap",justifyContent:"center",alignContent:"center",...style},...rest})}function IconArrowUp({color="currentColor",size=24,rotate=0,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:`rotate(${rotate})`,...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 13.5L12 10.5L15 13.5",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"})})}function IconCalculator({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"4",y:"2",width:"16",height:"19",rx:"1",stroke:color,strokeWidth:"1.5"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"7",y:"6",width:"10",height:"4",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"7.5",y:"12.5",width:"1",height:"1",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"11.5",y:"12.5",width:"1",height:"1",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"15.5",y:"12.5",width:"1",height:"5",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"11.5",y:"16.5",width:"1",height:"1",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"7.5",y:"16.5",width:"1",height:"1",stroke:color})]})}function IconCheck({color="currentColor",size=16,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,fill:"none",stroke:color,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M13.3346 4L6.0013 11.3333L2.66797 8",strokeWidth:"1.25",strokeLinecap:"square",strokeLinejoin:"round"})})}function IconCoin({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ellipse",{cx:"12.0004",cy:"9.72212",rx:"10.0004",ry:"3.33345",stroke:color,strokeWidth:"1.5"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M12.0004 18.6119C9.94456 18.6119 8.03366 18.4051 6.4446 18.0505M12.0004 18.6119V13.0561M12.0004 18.6119C14.0561 18.6119 15.9671 18.4051 17.5561 18.0505M2 9.72266V15.2784C2 16.4342 3.76454 17.4525 6.4446 18.0505M22.0007 9.72266V15.2784C22.0007 16.4342 20.2362 17.4525 17.5561 18.0505M6.4446 11.945V18.0505M17.5561 12.5005L17.5561 18.0505",stroke:color,strokeWidth:"1.5"})]})}function IconConnector({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g",{clipPath:"url(#clip0_2605_1876)",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.3688 0.797175C19.6952 -0.195659 21.5754 0.0747827 22.5682 1.40122C23.5611 2.72767 23.2906 4.60781 21.9642 5.60064C20.9814 6.33624 19.6947 6.37837 18.6901 5.81135L13.2118 10.3012C13.7118 11.0797 14.0019 12.0059 14.0019 12.9999C14.0019 13.77 13.8278 14.4994 13.5168 15.151L16.0949 17.8695C17.2392 17.3161 18.6561 17.5353 19.5775 18.5069C20.7177 19.7091 20.6673 21.6079 19.4651 22.748C18.2629 23.8882 16.3641 23.8378 15.224 22.6356C14.348 21.712 14.1748 20.3771 14.6867 19.291L12.2915 16.7654C11.4123 17.5341 10.2615 17.9999 9.00189 17.9999C6.24046 17.9999 4.00189 15.7613 4.00189 12.9999C4.00189 11.5656 4.60582 10.2723 5.57327 9.36057L4.35098 6.87732C3.01379 7.07665 1.6641 6.34735 1.13207 5.03948C0.507758 3.50476 1.24579 1.7545 2.78052 1.13019C4.31525 0.50587 6.06551 1.24391 6.68982 2.77864C7.14163 3.8893 6.87995 5.11283 6.11916 5.94081L7.28211 8.30351C7.81835 8.10709 8.3976 7.99989 9.00189 7.99989C10.0434 7.99989 11.0105 8.31833 11.8112 8.86316L17.376 4.30245C16.8897 3.0748 17.2609 1.62646 18.3688 0.797175ZM9.00189 15.9999C10.6587 15.9999 12.0019 14.6567 12.0019 12.9999C12.0019 11.343 10.6587 9.99989 9.00189 9.99989C7.34503 9.99989 6.00189 11.343 6.00189 12.9999C6.00189 14.6567 7.34503 15.9999 9.00189 15.9999Z",fill:color})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs",{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("clipPath",{id:"clip0_2605_1876",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{width:"24",height:"24",fill:"white"})})})]})}function IconCross({color="currentColor",size=16,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,fill:"none",stroke:color,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M4 4L12 12M12 4L4 12",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function IconDashboard({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3Z",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M3 9H21",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 21V9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function IconDoubleLeft({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M11 15L8 12L11 9",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M16 15L13 12L16 9",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"})]})}function IconExternalLink({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M10 9L15 9M15 9L15 14M15 9L9 15",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"})})}function IconLogo(props){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:"88",height:"19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M0.038 14L4.883 0.699999H7.904L12.768 14H9.956L5.852 2.144H6.935L2.831 14H0.038ZM2.28 11.017L2.983 8.946H9.823L10.526 11.017H2.28ZM13.4867 14V4.576H16.1467V14H13.4867ZM13.6007 3.075V0.604999H16.0707V3.075H13.6007ZM17.5131 14V4.576H20.1731V6.001C20.4264 5.53233 20.7431 5.165 21.1231 4.899C21.5031 4.62033 21.9338 4.481 22.4151 4.481H23.5741V6.837H22.1491C21.6804 6.837 21.3004 6.95733 21.0091 7.198C20.7178 7.43867 20.5024 7.79967 20.3631 8.281C20.2364 8.74967 20.1731 9.326 20.1731 10.01V14H17.5131ZM24.7874 18.18V4.576H27.4474V5.868C27.7514 5.46267 28.1441 5.108 28.6254 4.804C29.1194 4.5 29.7528 4.348 30.5254 4.348C31.3994 4.348 32.1848 4.56333 32.8814 4.994C33.5781 5.42467 34.1291 6.01367 34.5344 6.761C34.9398 7.50833 35.1424 8.357 35.1424 9.307C35.1424 10.2443 34.9398 11.0867 34.5344 11.834C34.1291 12.5813 33.5781 13.1703 32.8814 13.601C32.1848 14.019 31.3994 14.228 30.5254 14.228C29.8288 14.228 29.2208 14.1013 28.7014 13.848C28.1948 13.5947 27.7768 13.24 27.4474 12.784V18.18H24.7874ZM29.8984 11.91C30.3924 11.91 30.8294 11.796 31.2094 11.568C31.6021 11.34 31.9061 11.0297 32.1214 10.637C32.3368 10.2443 32.4444 9.801 32.4444 9.307C32.4444 8.80033 32.3368 8.35067 32.1214 7.958C31.9061 7.55267 31.6021 7.236 31.2094 7.008C30.8294 6.78 30.3924 6.666 29.8984 6.666C29.4044 6.666 28.9674 6.78 28.5874 7.008C28.2074 7.236 27.9098 7.54633 27.6944 7.939C27.4791 8.33167 27.3714 8.78133 27.3714 9.288C27.3714 9.79467 27.4791 10.2443 27.6944 10.637C27.9098 11.0297 28.2074 11.34 28.5874 11.568C28.9674 11.796 29.4044 11.91 29.8984 11.91ZM40.9671 14.228C40.0171 14.228 39.1558 14.019 38.3831 13.601C37.6231 13.183 37.0151 12.6003 36.5591 11.853C36.1158 11.1057 35.8941 10.2507 35.8941 9.288C35.8941 8.31267 36.1158 7.45767 36.5591 6.723C37.0151 5.97567 37.6295 5.393 38.4021 4.975C39.1748 4.557 40.0298 4.348 40.9671 4.348C41.9171 4.348 42.7721 4.557 43.5321 4.975C44.3048 5.393 44.9128 5.97567 45.3561 6.723C45.8121 7.45767 46.0401 8.31267 46.0401 9.288C46.0401 10.2507 45.8121 11.1057 45.3561 11.853C44.9128 12.6003 44.3048 13.183 43.5321 13.601C42.7721 14.019 41.9171 14.228 40.9671 14.228ZM40.9671 11.929C41.3978 11.929 41.7905 11.834 42.1451 11.644C42.4998 11.4413 42.7785 11.1437 42.9811 10.751C43.1965 10.3583 43.3041 9.87067 43.3041 9.288C43.3041 8.70533 43.1965 8.21767 42.9811 7.825C42.7658 7.43233 42.4808 7.141 42.1261 6.951C41.7841 6.74833 41.4041 6.647 40.9861 6.647C40.5555 6.647 40.1628 6.74833 39.8081 6.951C39.4535 7.141 39.1685 7.43233 38.9531 7.825C38.7378 8.205 38.6301 8.69267 38.6301 9.288C38.6301 9.87067 38.7315 10.3583 38.9341 10.751C39.1495 11.1437 39.4345 11.4413 39.7891 11.644C40.1438 11.834 40.5365 11.929 40.9671 11.929ZM47.1264 14V4.576H49.7864V6.001C50.0397 5.53233 50.3564 5.165 50.7364 4.899C51.1164 4.62033 51.547 4.481 52.0284 4.481H53.1874V6.837H51.7624C51.2937 6.837 50.9137 6.95733 50.6224 7.198C50.331 7.43867 50.1157 7.79967 49.9764 8.281C49.8497 8.74967 49.7864 9.326 49.7864 10.01V14H47.1264ZM58.3717 14C57.713 14 57.1557 13.924 56.6997 13.772C56.2564 13.62 55.9207 13.3287 55.6927 12.898C55.4647 12.4547 55.3507 11.8213 55.3507 10.998V6.799H53.7357V4.576H55.3507V1.992H58.0107V4.576H60.3287V6.799H58.0107V10.675C58.0107 10.9663 58.0424 11.188 58.1057 11.34C58.169 11.492 58.283 11.5997 58.4477 11.663C58.625 11.7137 58.8594 11.739 59.1507 11.739H60.2717V14H58.3717ZM61.1166 14V4.576H63.7766V14H61.1166ZM61.2306 3.075V0.604999H63.7006V3.075H61.2306ZM65.143 14V4.576H67.803V5.963C68.107 5.469 68.5187 5.07633 69.038 4.785C69.57 4.49367 70.1907 4.348 70.9 4.348C72.0907 4.348 73.0027 4.728 73.636 5.488C74.2693 6.23533 74.586 7.31833 74.586 8.737V14H71.926V8.984C71.926 8.21133 71.7677 7.62233 71.451 7.217C71.147 6.799 70.6593 6.59 69.988 6.59C69.3547 6.59 68.829 6.818 68.411 7.274C68.0057 7.71733 67.803 8.338 67.803 9.136V14H65.143ZM81.2614 18.408C80.4634 18.408 79.6907 18.275 78.9434 18.009C78.2087 17.7557 77.5817 17.344 77.0624 16.774C76.543 16.204 76.2327 15.463 76.1314 14.551H78.7724C78.8737 15.0323 79.146 15.4123 79.5894 15.691C80.0454 15.9697 80.5837 16.109 81.2044 16.109C81.6477 16.109 82.0594 16.014 82.4394 15.824C82.8194 15.6467 83.1234 15.368 83.3514 14.988C83.5794 14.6207 83.6934 14.1457 83.6934 13.563V12.423C83.5034 12.7143 83.2627 12.9803 82.9714 13.221C82.68 13.4617 82.3317 13.658 81.9264 13.81C81.5337 13.9493 81.0777 14.019 80.5584 14.019C79.659 14.019 78.8484 13.81 78.1264 13.392C77.417 12.9613 76.8534 12.3787 76.4354 11.644C76.03 10.9093 75.8274 10.086 75.8274 9.174C75.8274 8.262 76.03 7.445 76.4354 6.723C76.8534 5.98833 77.417 5.412 78.1264 4.994C78.8484 4.56333 79.659 4.348 80.5584 4.348C81.255 4.348 81.8694 4.48733 82.4014 4.766C82.946 5.04467 83.3767 5.393 83.6934 5.811V4.576H86.3534V13.411C86.3534 14.513 86.119 15.4313 85.6504 16.166C85.1817 16.9133 84.561 17.4707 83.7884 17.838C83.0157 18.218 82.1734 18.408 81.2614 18.408ZM81.1094 11.72C81.6287 11.72 82.0784 11.606 82.4584 11.378C82.8384 11.15 83.136 10.846 83.3514 10.466C83.5667 10.086 83.6744 9.66167 83.6744 9.193C83.6744 8.71167 83.5667 8.281 83.3514 7.901C83.136 7.521 82.8384 7.22333 82.4584 7.008C82.0784 6.78 81.6287 6.666 81.1094 6.666C80.6027 6.666 80.153 6.78 79.7604 7.008C79.3804 7.22333 79.0827 7.521 78.8674 7.901C78.652 8.26833 78.5444 8.69267 78.5444 9.174C78.5444 9.64267 78.652 10.0733 78.8674 10.466C79.0827 10.846 79.3804 11.15 79.7604 11.378C80.153 11.606 80.6027 11.72 81.1094 11.72Z",fill:"#F3F3F3"})})}function IconLogOut({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M16 17L21 12L16 7",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M21 12H9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function IconRepeat({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M15 1L20 5L15 9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M4 11V9C4 7.93913 4.3746 6.92172 5.0414 6.17157C5.70819 5.42143 6.61256 5 7.55556 5H20",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 23L4 19L9 15",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M20 13V15C20 16.0609 19.6254 17.0783 18.9586 17.8284C18.2918 18.5786 17.3874 19 16.4444 19H4",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function IconStar({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M17.0178 1.76042C17.1521 1.26989 17.8479 1.26989 17.9822 1.76042L18.4798 3.57689C18.5237 3.73719 18.6444 3.86519 18.8019 3.91844L20.5994 4.52635C21.0525 4.67958 21.0525 5.32042 20.5994 5.47365L18.8019 6.08156C18.6444 6.13481 18.5237 6.26281 18.4798 6.42311L17.9822 8.23958C17.8479 8.73011 17.1521 8.73011 17.0178 8.23958L16.5202 6.42311C16.4763 6.26281 16.3556 6.13481 16.1981 6.08156L14.4006 5.47365C13.9475 5.32042 13.9475 4.67958 14.4006 4.52635L16.1981 3.91844C16.3556 3.86519 16.4763 3.73719 16.5202 3.57689L17.0178 1.76042Z",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9.83203 3.12891L11.7554 10.4793L18.332 12.6289L11.7554 14.7785L9.83203 22.1289L7.9087 14.7785L1.33203 12.6289L7.9087 10.4793L9.83203 3.12891Z",stroke:color,strokeWidth:"1.5",strokeLinejoin:"round"})]})}function AirButton({children,onClick,rightSection,...rest}){const navigate=(0,_tanstack_react_router__WEBPACK_IMPORTED_MODULE_2__.useNavigate)();const href="href"in rest?rest.href:void 0;const target="target"in rest?rest.target:void 0;const to="to"in rest?rest.to:void 0;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{size:"md",justify:"start",styles:{label:{flex:1}},rightSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[rightSection,href&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle,{bg:"dark.4",size:24,ml:"auto",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconExternalLink,{})})]}),onClick:e=>{onClick?.(e);if(href)open(href,target??"_blank");if(to)navigate({to})},...rest,children:children})}const THEME_COLORS=["green","blue","yellow","pink","cyan","orange","grape","teal"];const COLORS_EMOJI={red:"\uD83D\uDD34",orange:"\uD83D\uDFE0",yellow:"\uD83D\uDFE1",green:"\uD83D\uDFE2",blue:"\uD83D\uDD35",purple:"\uD83D\uDFE3",brown:"\uD83D\uDFE4"};function formatDateLocale(date,opts){if(!date)return null;return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.intlFormat)(date,{month:"2-digit",day:"2-digit",year:"numeric",...opts},{locale:"fr"})}function getLocaleDateFormat(locale){const getPatternForPart=part=>{switch(part.type){case"day":return"d".repeat(part.value.length);case"month":return"M".repeat(part.value.length);case"year":return"y".repeat(part.value.length);case"literal":return part.value}};return new Intl.DateTimeFormat(locale).formatToParts(new Date("2022-01-02")).map(getPatternForPart).join("")}function isoday(date){if(!date)return null;if(date instanceof Date&&isNaN(date.getTime()))return null;return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.formatISO)(date,{representation:"date"})}function parseDateFr(date){return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.parse)(date,"dd/MM/yyyy",new Date)}function parseDateLocale(date){if(!date)return null;const res=(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.parse)(date,getLocaleDateFormat("fr"),new Date);if(!(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isValid)(res))return null;return res}var _computedKey,_computedKey1;_computedKey=0,_computedKey1=1;class RxState extends Array{[_computedKey];[_computedKey1];constructor(value,dispatch){super();this[0]=value;this[1]=dispatch}get value(){return this[0]}get dispatch(){return this[1]}set value(value){this.dispatch(value)}}function useRxState(value){const state=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(value);return new RxState(state[0],state[1])}function useRxStateDebounced(from,delay=300){const debounced=useRxState(from.value);const handler=(0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{if(handler.current)clearTimeout(handler.current);handler.current=setTimeout(()=>{from.value=debounced.value},delay);return()=>{if(handler.current)clearTimeout(handler.current)}},[debounced.value,delay]);return debounced}function useRxStateOr(state,or){const fallbackValue=useRxState(or);const fallback=or instanceof RxState?or:fallbackValue;return state??fallback}function nbhy(){return String.fromCharCode(8209)}function formatCurrency(value,opts){const formatted=new Intl.NumberFormat(navigator.language,{style:"currency",currency:"eur",signDisplay:"exceptZero",...opts}).format(value);return formatted.replaceAll("-",nbhy())}function formatCurrencyCompact(value,opts){return formatCurrency(value,{maximumFractionDigits:Math.abs(Number(value))>1e6||Math.abs(Number(value))<1e4?2:Math.abs(Number(value))<1e5?1:0,notation:"compact",...opts})}function formatPercent(value,opts){const formatted=new Intl.NumberFormat(navigator.language,{style:"percent",signDisplay:"exceptZero",...opts}).format(value);return formatted.replaceAll("-",nbhy())}var zIndex_ZIndex=/*#__PURE__*/function(ZIndex){ZIndex[ZIndex["TableHeader"]=1]="TableHeader";ZIndex[ZIndex["TableScrollbar"]=2]="TableScrollbar";ZIndex[ZIndex["ChartTooltip"]=3]="ChartTooltip";ZIndex[ZIndex["Loader"]=9999]="Loader";return ZIndex}({});const BankAccountsChartTooltip=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_7__.forwardRef)((props,ref)=>{const{balance,accounts,detailed}=props;const themed=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const d=isoday(parseDateLocale(balance.date));return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{p:"xs",withBorder:true,shadow:"md",radius:"md",style:{maxHeight:600,overflow:"auto",filter:"drop-shadow(0 0 2px rgba(0, 0, 0, 0.5))",backdropFilter:"blur(6px)"},ref:ref,bg:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(themed.colors.dark[9],.3),children:[(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isAfter)(d,new Date)?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:10,c:"dimmed",children:"pr\xe9visionnel"}):null,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",gap:4,mb:10,align:"center",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:14,fw:"bold",children:balance.date}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:14,fw:"bolder",c:balance.accounts.total>=0?"green":"red",children:formatCurrencyCompact(balance.accounts.total)})]}),detailed?Object.entries(balance.accounts).filter(([accountId,amount])=>"total"!=accountId&&0!=amount).map(([accountId,amount],i)=>{const account=accounts[accountId];if(!account)return;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{mb:5,align:"center",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle,{bg:themed.colors[THEME_COLORS[(i+1)%THEME_COLORS.length]][9],size:10}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",children:account.display_name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:12,ml:"auto",children:formatCurrencyCompact(amount)})]},accountId)}):null]})});function BankAccountsChart(props){const{hovered:hoveredProps,showIndividualBalances,showReferenceLines="hover",showToday,legend,detail,xAxisProps,accounts,...rest}=props;const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const hovered=useRxStateDebounced(useRxStateOr(hoveredProps,null),200);const tooltipref=(0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);const data=(0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(()=>{const all=[];for(const[name,data]of(0,lodash_es__WEBPACK_IMPORTED_MODULE_5__.entries)(accounts)){const d=data;for(const[day,balance]of Object.entries(d.balance)){const date=formatDateLocale(day);let existing=all.find(x=>x.date===date);if(!existing){existing={date,label:new Date(isoday(day)).getTime(),accounts:{total:0,unassigned:0}};all.push(existing)}existing.accounts[name]=balance.amount;if(!(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isBefore)(day,(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.startOfDay)(new Date)))existing.accounts.total_future=existing.accounts.total;if(!(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isAfter)(day,new Date))existing.accounts.total_past=existing.accounts.total}}return all},[accounts]);const{low,high}=(0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(()=>{const values=[...Object.values(data).map(x=>x.accounts.total)];let low=(0,radash__WEBPACK_IMPORTED_MODULE_6__.min)(values)??0;low=low>0?.9*low:1.1*low;let high=(0,radash__WEBPACK_IMPORTED_MODULE_6__.max)(values)??0;high=high>0?1.05*high:.9*high;return{low,high}},[data.length]);return(0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(()=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_charts__WEBPACK_IMPORTED_MODULE_3__.AreaChart,{data:data,dataKey:"label",xAxisProps:{tickFormatter:value=>(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.formatDate)(new Date(value),"dd/MM"),...xAxisProps},strokeWidth:2,dotProps:{r:0,strokeWidth:1},activeDotProps:{r:3,strokeWidth:1},withXAxis:"high"==detail,withYAxis:true,gridAxis:"x",yAxisProps:high&&low?{allowDataOverflow:true,domain:[low,high]}:void 0,series:showIndividualBalances?Object.values(accounts).filter(x=>"total"!=x.accountId).map(x=>({name:"accounts."+x.accountId,color:THEME_COLORS[Object.values(accounts).indexOf(x)%THEME_COLORS.length],label:x.display_name})):[{name:"accounts.total_past",color:theme.primaryColor,label:"Solde"},{name:"accounts.total_future",color:theme.primaryColor,label:"Solde",strokeDasharray:"3 5"}],connectNulls:false,withLegend:legend,legendProps:{verticalAlign:"bottom"},curveType:"bump",type:"stacked",referenceLines:(0,radash__WEBPACK_IMPORTED_MODULE_6__.sift)([false!==showToday&&{x:new Date(isoday(new Date)).getTime(),color:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors.blue[5],1),label:"auj."},...("hover"!=showReferenceLines||hovered.value)&&"never"!=showReferenceLines&&data.length?[...(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.eachMonthOfInterval)({start:parseDateLocale(data[0].date),end:parseDateLocale(data[data.length-1].date)}).map(x=>({x:new Date(isoday(x)).getTime(),color:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors.gray[5],.3),label:(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.formatDate)(x,"MMMM"),labelPosition:"top"}))]:[]]),withGradient:true,fillOpacity:.1,valueFormatter:value=>formatCurrency(value,{notation:"compact"}),tooltipAnimationDuration:100,tooltipProps:{wrapperStyle:{zIndex:zIndex_ZIndex.ChartTooltip},content:props=>{const balance=props.payload?.[0]?.payload??null;setTimeout(()=>hovered.value=balance,100);if(!balance)return null;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(BankAccountsChartTooltip,{balance:balance,accounts:accounts,detailed:showIndividualBalances,ref:tooltipref})}},...rest}),[JSON.stringify(Object.keys(accounts)),showIndividualBalances,tooltipref,showReferenceLines,high,low,legend,detail])}function BlurSpot({pos="bottom"}){const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const spotStyle=options=>({position:"fixed",width:options.width??"800px",height:options.height??"800px",top:options.top,left:options.left,right:options.right,bottom:options.bottom,background:options.background??`radial-gradient(circle, ${theme.colors[theme.primaryColor][9]}, ${theme.colors[theme.primaryColor][6]} 50%, ${theme.colors[theme.primaryColor][9]})`,filter:`blur(${options.blur||150}px)`,transform:`rotate(${options.rotation||0}deg)`,pointerEvents:"none",zIndex:-1,opacity:options.opacity??.3});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{style:{position:"fixed",mixBlendMode:"screen"},children:["bottom"==pos&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"blur-spot",style:spotStyle({width:"700px",bottom:"-50%",left:"-10%",rotation:20})}),"top"==pos&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"blur-spot",style:spotStyle({width:"300px",top:"-50%",right:"15%",rotation:-20,opacity:.2})})]})}const Logo=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_7__.forwardRef)(({url,...rest},ref)=>{const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Image,{ref:ref,src:url.includes("img.logo.dev")||url.includes("media.airporting")?url:getLogo(url),radius:12,fit:"contain",bd:`3px solid ${(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.white,.11)}`,w:20,style:{aspectRatio:1},...rest})});Logo.displayName="Logo";const getLogo=url=>`https://img.logo.dev/${url}?token=pk_BVN4OQv0Qs-bnqjdIgTppg`;const CompanyLogo=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_7__.forwardRef)(({slug,...rest},ref)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Logo,{ref:ref,url:`https://s3.dualstack.eu-west-3.amazonaws.com/media.airporting/companies/${slug}.png`,fallbackSrc:"https://s3.dualstack.eu-west-3.amazonaws.com/media.airporting/companies/undefined.png",...rest}));CompanyLogo.displayName="CompanyLogo";class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&&params2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class AppApi{http;constructor(http){this.http=http}getStatus=(params={})=>this.http.request({path:"/status",method:"GET",...params});users={getMeV1:(params={})=>this.http.request({path:"/v1/users/me",method:"GET",secure:true,format:"json",...params}),forgotPasswordV1:(data,params={})=>this.http.request({path:"/v1/users/password/forgot",method:"POST",body:data,type:"application/json",...params}),resetPasswordV1:(data,params={})=>this.http.request({path:"/v1/users/password/reset",method:"POST",body:data,type:"application/json",...params})};chart={getCashBalanceAccountsV1:(query,params={})=>this.http.request({path:"/v1/chart/cash_balance/accounts",method:"GET",query:query,format:"json",...params})};dashboard={getDashboardV1:({companyId,...query},params={})=>this.http.request({path:`/v1/dashboard/${companyId}`,method:"GET",secure:true,format:"json",...params})};billing={getSepaV1:({acc,cid,...query},params={})=>this.http.request({path:`/v1/billing/${cid}/${acc}/sepa`,method:"GET",secure:true,format:"json",...params}),sepaSetupV1:({acc,cid,...query},data,params={})=>this.http.request({path:`/v1/billing/${cid}/${acc}/sepa/setup`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),getPortalV1:({acc,cid,...query},params={})=>this.http.request({path:`/v1/billing/${cid}/${acc}/portal`,method:"GET",query:query,secure:true,format:"json",...params})};auth={authCallbackCredentialsCreate:(data,params={})=>this.http.request({path:"/v1/auth/callback/credentials",method:"POST",body:data,type:"application/x-www-form-urlencoded",...params}),authCsrfList:(params={})=>this.http.request({path:"/v1/auth/csrf",method:"GET",format:"json",...params}),authSessionList:(params={})=>this.http.request({path:"/v1/auth/session",method:"GET",format:"json",...params}),authSignoutCreate:(data,params={})=>this.http.request({path:"/v1/auth/signout",method:"POST",body:data,type:"application/x-www-form-urlencoded",format:"json",...params})}}function useApi(){const client=new HttpClient({baseUrl:{MODE:"production",DEV:false,PROD:true,BASE_URL:"/",ASSET_PREFIX:"https://unpkg.com/@airporting/integrations-app@latest/dist/mf"}.PUBLIC_APP_API_URL,baseApiParams:{headers:{},credentials:"include"}});return new AppApi(client)}function useGetUsersMeQuery(){const api=useApi();const query=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_9__.useQuery)({queryKey:["users","me"],queryFn:async()=>{const res=await api.users.getMeV1().then(x=>x.data);if(res.user)localStorage.setItem("app:logged","1");return res}});return query}const Field=({prop,val})=>{if(!val)return null;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",children:[prop,":"]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{children:[" ",val]})]})};function SearchBox({children,values,selected,onChange,showDetails}){const[search,setSearch]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)("");const[preview,setPreview]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(selected??null);const itemElems=react__WEBPACK_IMPORTED_MODULE_7__.useRef(new Map);const scrollarea=(0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);const[popopen,setPopopen]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(false);const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const filtered=values.filter(item=>item.label.toLowerCase().includes(search.toLowerCase().trim()));const options=filtered.map(item=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{ref:ref=>{if(ref)itemElems.current.set(item.value,ref)},variant:selected===item.value?"filled":preview===item.value?"light":"subtle",color:selected===item.value?theme.colors[theme.primaryColor][9]:"gray",size:"xs",justify:"start",onClick:()=>{clickItem(item.value)},onMouseEnter:()=>setPreview(item.value),children:item.label},item.value));function clickItem(value){onChange?.(value);setPreview(value);setPopopen(false)}(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setPreview(filtered[0]?.value)},[search]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{if(preview)focusItem(preview)},[preview]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setTimeout(()=>{if(preview)focusItem(preview)},200)},[popopen]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setPreview(selected??null)},[selected]);function focusItem(value){const item=itemElems.current.get(value);if(item&&scrollarea.current){if(item.offsetTop+item.offsetHeight>scrollarea.current.offsetHeight+scrollarea.current.scrollTop)scrollarea.current.scrollTo({top:item.offsetTop+item.offsetHeight-scrollarea.current.offsetHeight});if(item.offsetTop<scrollarea.current.scrollTop||item.offsetTop+item.offsetHeight>scrollarea.current.offsetHeight+scrollarea.current.scrollTop)scrollarea.current.scrollTo({top:item.offsetTop})}}const content=/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{align:"flex-start",wrap:"nowrap",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{value:search,onChange:event=>setSearch(event.currentTarget.value),placeholder:"Rechercher",autoFocus:true,onKeyDown:(0,_mantine_hooks__WEBPACK_IMPORTED_MODULE_10__.getHotkeyHandler)([["enter",()=>preview&&clickItem(preview)],["escape",()=>setSearch("")],["arrowUp",()=>setPreview(filtered[filtered.findIndex(x=>x.value===preview)-1]?.value)],["arrowDown",()=>setPreview(filtered[filtered.findIndex(x=>x.value===preview)+1]?.value)]])}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ScrollArea,{h:300,scrollbars:"y",type:"auto",viewportRef:scrollarea,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:0,children:options}),0===filtered.length&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",flex:1,ta:"center",children:"Aucun resultat"})]})]}),preview&&showDetails&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Divider,{orientation:"vertical"}),showDetails(preview)]})]});if(!children)return content;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover,{opened:popopen,onChange:setPopopen,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover.Target,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{onClick:()=>setPopopen(true),children:children})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover.Dropdown,{children:content})]})}function CompanySelector({children,selected,onChange}){const me=useGetUsersMeQuery();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SearchBox,{values:me.data?.companies.map(c=>({label:c.display_name,value:c.id.toString()}))??[],selected:selected,onChange:onChange,showDetails:x=>{const comp=me.data?.companies.find(c=>c.id.toString()===x);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:4,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CompanyLogo,{slug:comp?.slug,w:48,mb:"md"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"Nom",val:comp?.display_name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"SIREN",val:comp?.siren_number}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"Dirigeant",val:comp?.leader}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"Adresse",val:comp?.address})]})},children:children??/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{flex:1,size:"md",variant:"subtle",color:"gray",leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconRepeat,{}),justify:"start",children:"Changer d'entreprise"})})}function getHelpInputStyles(help){return{input:{borderBottomLeftRadius:help?0:10,borderBottomRightRadius:help?0:10}}}function getHelpButtonStyles(help){return{root:{borderBottomLeftRadius:help?0:10,borderBottomRightRadius:help?0:10}}}const Help=({help,"rt-corner-round":rtCornerRound})=>{if(help?.length)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Alert,{variant:"light",color:"blue",title:"Aide",styles:{root:{borderTopLeftRadius:help?0:10,borderTopRightRadius:help?rtCornerRound?10:0:10}},children:help});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{})};const InputText=({label,required,placeholder,value,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);const singleValue="string"==typeof value?value:"";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,placeholder:placeholder,value:singleValue,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};function gradientCardBottomLeft(theme){return`linear-gradient(25deg, ${(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors[theme.primaryColor][8],.3)} 4.93%, ${theme.colors.dark[8]} 49.02%)`}const InputMsg=({full})=>{const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{radius:"md",p:"md",bg:gradientCardBottomLeft(theme),children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:2,mt:5,mb:15,children:full?.title}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",children:full?.text})]})};const InputPassword=({label,required,placeholder,value,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.PasswordInput,{pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,placeholder:placeholder,value:value,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const InputSwitch=({label,help,value,full,onChange})=>{const[checked,setChecked]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(false);const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setChecked(value??full?.default??false)},[value]);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Switch,{pb:help?0:15,pt:15,styles:stylesValue,label:label,checked:checked,onChange:event=>{setChecked(event.currentTarget.checked);onChange(event.currentTarget.checked)},autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const InputMultipleText=({label,required,placeholder,value,isMultiple,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpButtonStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpButtonStyles(helpValue??""))},[helpValue]);const arrayValue=Array.isArray(value)?value:[];const handleUpdateItem=(index,newValue)=>{const newArray=[...arrayValue];newArray[index]=newValue;onChange(newArray)};const handleRemoveItem=index=>{const newArray=arrayValue.filter((_,i)=>i!==index);onChange(newArray)};const handleAddItem=()=>{onChange([...arrayValue,""])};return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Box,{pb:help?0:15,pt:15,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label",{style:{fontWeight:500,display:"block",fontSize:"var(--mantine-font-size-sm)"},children:[label," ",required&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{style:{color:"var(--mantine-color-red-6)"},children:"*"})]}),arrayValue.map((item,index)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",mb:"xs",wrap:"nowrap",align:"flex-start",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{style:{flexGrow:1},placeholder:`${placeholder||label} #${index+1}`,value:item,onChange:event=>handleUpdateItem(index,event.currentTarget.value),type:"text",autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),arrayValue.length>1&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{size:"xs",color:"red",onClick:()=>handleRemoveItem(index),children:"Supprimer"})]},index)),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{color:"cyan",size:"xs",onClick:handleAddItem,styles:stylesValue,children:"Ajouter"}),error&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{style:{color:"var(--mantine-color-red-6)",fontSize:"12px",marginTop:"4px"},children:error}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??"","rt-corner-round":isMultiple})]})};const InputEmail=({label,required,placeholder,value,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);const singleValue="string"==typeof value?value:"";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{type:"email",pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,placeholder:placeholder,value:singleValue,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const InputMultipleEmail=({label,required,placeholder,value,isMultiple,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpButtonStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpButtonStyles(helpValue??""))},[helpValue]);const arrayValue=Array.isArray(value)?value:[];const handleUpdateItem=(index,newValue)=>{const newArray=[...arrayValue];newArray[index]=newValue;onChange(newArray)};const handleRemoveItem=index=>{const newArray=arrayValue.filter((_,i)=>i!==index);onChange(newArray)};const handleAddItem=()=>{onChange([...arrayValue,""])};return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Box,{pb:help?0:15,pt:15,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label",{style:{fontWeight:500,display:"block",fontSize:"var(--mantine-font-size-sm)"},children:[label," ",required&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{style:{color:"var(--mantine-color-red-6)"},children:"*"})]}),arrayValue.map((item,index)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",mb:"xs",wrap:"nowrap",align:"flex-start",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{style:{flexGrow:1},placeholder:`${placeholder||label} #${index+1}`,value:item,onChange:event=>handleUpdateItem(index,event.currentTarget.value),type:"email",autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),arrayValue.length>1&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{size:"xs",color:"red",onClick:()=>handleRemoveItem(index),children:"Supprimer"})]},index)),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{color:"cyan",size:"xs",onClick:handleAddItem,styles:stylesValue,children:"Ajouter"}),error&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{style:{color:"var(--mantine-color-red-6)",fontSize:"12px",marginTop:"4px"},children:error}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??"","rt-corner-round":isMultiple})]})};const InputHidden=({value,onChange,error})=>{const singleValue="string"==typeof value?value:"";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{type:"hidden",value:singleValue,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"})})};const InputSelect=({label,required,value,onChange,error,full,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.NativeSelect,{pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,value:value,data:full?.values??[],onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const FormField=({config,formProps})=>{switch(config.type){case"email":if(config.isMultiple)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputMultipleEmail,{...config,...formProps});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputEmail,{...config,...formProps});case"hidden":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputHidden,{...config,...formProps});case"msg":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputMsg,{...config,...formProps});case"password":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputPassword,{...config,...formProps});case"switch":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputSwitch,{...config,...formProps});case"select":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputSelect,{...config,...formProps});case"text":if(config.isMultiple)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputMultipleText,{...config,...formProps});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputText,{...config,...formProps});default:console.error(`Type de champs non reconnu : ${config.type}`);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Alert,{variant:"filled",color:"red",title:`Type de champ non reconnu ${config.type}`,children:["Name: $",config.name,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("br",{}),"Label: $",config.label]})}};const DynamicForm=({config,save})=>{const{data:configData,isPending:isLoadingConfig}=config();const form=(0,_mantine_form__WEBPACK_IMPORTED_MODULE_11__.useForm)({initialValues:configData?.initialData??{}});(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{if(configData?.initialData){form.setValues(configData.initialData);form.resetDirty()}},[configData]);if(isLoadingConfig||!configData)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{withBorder:true,shadow:"md",p:"xl",style:{position:"relative"},children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Skeleton,{height:30,mt:6,radius:"xl"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Skeleton,{height:12,mt:6,width:"30%",radius:"xl"})]});const handleSubmit=values=>{save(values)};const{sections}=configData;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{shadow:"md",p:"xl",style:{position:"relative"},children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form",{autoComplete:"off",onSubmit:form.onSubmit(handleSubmit),children:[sections.map(({fields})=>fields.map((fieldConfig,idx)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(FormField,{config:fieldConfig,formProps:{value:form.values[fieldConfig.name],onChange:value=>form.setFieldValue(fieldConfig.name,value),error:form.errors[fieldConfig.name]}},idx))),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{type:"submit",mt:"xl",children:"Sauvegarder"})]})})};function IconMore({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"17.168",cy:"7.5",r:"1.5",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"17.168",cy:"12.5",r:"1.5",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"17.168",cy:"17.5",r:"1.5",fill:color})]})}function IconTrendingUp({color="currentColor",size=24,transform,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",style:{transform},xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M23 6L13.5 15.5L8.5 10.5L1 18",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M17 6H23V12",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function KPICard({children,title,subtitle,topSection,trend,menu,...rest}){const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{bg:"dark.4",miw:260,p:"sm",...rest,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:12,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",align:"start",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[title&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:4,children:title}),topSection]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(KPICardMenu,{parameters:menu?.parameters,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconMore,{color:theme.colors.gray[7],cursor:"pointer"})})]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Divider,{}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:6,flex:1,children:[trend&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconTrendingUp,{transform:"down"==trend?"scaleY(-1)":void 0}),subtitle&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fw:500,fz:16,c:theme.primaryColor,children:subtitle}),children]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconHelpCircle,{color:theme.colors.dark[0],style:{alignSelf:"flex-end"}})]})]})})}function KPICardMenu({parameters,children}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu,{shadow:"md",width:200,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Target,{children:children}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Dropdown,{children:[parameters&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Label,{children:"Param\xe8tres"}),parameters,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Divider,{})]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Label,{children:"Organisation"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub.Target,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub.Item,{leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowsMove,{size:14}),children:"D\xe9placer"})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub.Dropdown,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBarLeft,{size:14}),children:"Gauche"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBarRight,{size:14}),children:"Droite"})]})]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{color:"red",leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconTrash,{size:14}),children:"Supprimer ce KPI"})]})]})}function KPICardBankAccountsChart({accounts,...rest}){const detailed=useRxState(false);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(KPICard,{title:"Cash position (k€)",w:"100%",menu:{parameters:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Checkbox,{label:"D\xe9tails par compte",checked:detailed.value,onChange:x=>detailed.value=x.target.checked})})]},...rest,children:accounts?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(BankAccountsChart,{showIndividualBalances:detailed.value,h:200,ml:10,accounts:accounts,detail:"high",showToday:false,showReferenceLines:"never",xAxisProps:{ticks:(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.eachMonthOfInterval)({start:(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.subMonths)(new Date,6),end:new Date}).map(d=>new Date(isoday(d)).getTime()),tickFormatter:v=>{v=new Date(v);return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.intlFormat)(v,{month:"short"},{locale:"fr"})}}}):/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Skeleton,{h:200,w:"100%"})})}const languages={en:{label:"English",flag:"us"},fr:{label:"Fran\xe7ais",flag:"fr"},es:{label:"Espa\xf1ol",flag:"es"}};const flag=lang=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{className:`fi fi-${languages[lang].flag}`});function LanguageSwitcher(props){const{i18n}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_12__.useTranslation)();const lang=i18n.language;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu,{shadow:"md",width:180,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Target,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{variant:"default",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",children:[flag(lang)," ",lang.toUpperCase()]})})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Dropdown,{children:(0,radash__WEBPACK_IMPORTED_MODULE_6__.listify)(languages,(key,{label})=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{onClick:()=>i18n.changeLanguage(key),disabled:lang===key,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{children:[flag(key)," ",label]})},key))})]})})}function PillTrend({children,trend,...rest}){const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Pill,{bg:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors["up"==trend?"teal":"red"][6],.3),...rest,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:4,wrap:"nowrap",align:"center",children:["up"==trend?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBigUpFilled,{size:10,color:theme.colors.teal[2]}):/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBigDownFilled,{size:10,color:theme.colors.red[5]}),children]})})}const theme_theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.createTheme)({primaryColor:"teal",fontFamily:"Host Grotesk",headings:{sizes:{h1:{fontSize:"28px",fontWeight:"500"},h2:{fontSize:"22px",fontWeight:"500"},h3:{fontSize:"18px",fontWeight:"500"},h4:{fontSize:"16px",fontWeight:"500"},h5:{fontSize:"14px",fontWeight:"500"},h6:{fontSize:"12px",fontWeight:"500"}}},fontSizes:{lg:"16px",md:"14px",sm:"12px",xs:"10px"},colors:{dark:["#a4a4a4",(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.2),(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.15),(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.1),(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.05),"#474747","#363636","#282828","#1e1e1e","#121212"]},components:{Button:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button.extend({styles:(_theme,props)=>({root:{border:"filled"!=props.variant&&props.variant?void 0:"none"},label:{fontWeight:"500"}})}),Checkbox:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Checkbox.extend({styles:{input:{border:"none"}},defaultProps:{icon:props=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconCheck,{...props})}}),TextInput:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput.extend({styles:{label:{marginBottom:"8px"}}}),PasswordInput:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.PasswordInput.extend({styles:{label:{marginBottom:"8px"}}}),Input:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Input.extend({styles:{input:{borderRadius:"10px",backgroundColor:"var(--mantine-color-body)"}}}),MenuDropdown:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.MenuDropdown.extend({defaultProps:{bg:"var(--mantine-color-dark-7)"}}),Popover:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover.extend({defaultProps:{radius:"8px"},styles:{dropdown:{background:"var(--mantine-color-dark-7)",borderColor:"var(--mantine-color-dark-1)"}}}),Divider:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Divider.extend({defaultProps:{color:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.1)}}),Badge:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Badge.extend({styles:{root:{borderRadius:"4px",fontWeight:"400",fontFamily:"IBM Plex Sans"}}}),Modal:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Modal.extend({styles:{content:{borderRadius:10,backgroundColor:"var(--mantine-color-dark-9)"},header:{backgroundColor:"var(--mantine-color-dark-9)"}}}),Drawer:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Drawer.extend({styles:{content:{backgroundColor:"var(--mantine-color-dark-9)"},header:{backgroundColor:"var(--mantine-color-dark-9)"}}}),Paper:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper.extend({styles:{root:{backgroundColor:"var(--mantine-color-dark-8)"}}})}});const cssVarResolver=theme=>({variables:{},light:{"--mantine-color-text":"var(--mantine-color-black)"},dark:{"--mantine-radius-default":"10px","--checkbox-radius":"4px","--mantine-color-text":"var(--mantine-color-white)","--mantine-color-body":"#090909","--mantine-color-placeholder":"var(--mantine-color-dark-0)","--mantine-color-dimmed":"var(--mantine-color-dark-0)","--button-bg":`linear-gradient(90deg, ${(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.darken)(theme.colors[theme.primaryColor][9],.3)} -10%, ${theme.colors[theme.primaryColor][8]} 100%)`,"--mantine-color-default":"var(--mantine-color-dark-3)","--mantine-color-default-border":"var(--mantine-color-dark-2)","--mantine-color-default-hover":"var(--mantine-color-dark-2)"}})}}]);
1
+ "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["741"],{2348:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{AirButton:()=>AirButton,BankAccountsChart:()=>BankAccountsChart,BankAccountsChartTooltip:()=>BankAccountsChartTooltip,BlurSpot:()=>BlurSpot,COLORS_EMOJI:()=>COLORS_EMOJI,Circle:()=>Circle,CompanyLogo:()=>CompanyLogo,CompanySelector:()=>CompanySelector,DynamicForm:()=>DynamicForm,Field:()=>Field,IconArrowUp:()=>IconArrowUp,IconCalculator:()=>IconCalculator,IconCheck:()=>IconCheck,IconCoin:()=>IconCoin,IconConnector:()=>IconConnector,IconCross:()=>IconCross,IconDashboard:()=>IconDashboard,IconDoubleLeft:()=>IconDoubleLeft,IconExternalLink:()=>IconExternalLink,IconLogOut:()=>IconLogOut,IconLogo:()=>IconLogo,IconRepeat:()=>IconRepeat,IconStar:()=>IconStar,KPICard:()=>KPICard,KPICardBankAccountsChart:()=>KPICardBankAccountsChart,LanguageSwitcher:()=>LanguageSwitcher,Logo:()=>Logo,PillTrend:()=>PillTrend,RxState:()=>RxState,SearchBox:()=>SearchBox,THEME_COLORS:()=>THEME_COLORS,ZIndex:()=>zIndex_ZIndex,cssVarResolver:()=>cssVarResolver,formatCurrency:()=>formatCurrency,formatCurrencyCompact:()=>formatCurrencyCompact,formatDateLocale:()=>formatDateLocale,formatPercent:()=>formatPercent,getLocaleDateFormat:()=>getLocaleDateFormat,isoday:()=>isoday,nbhy:()=>nbhy,parseDateFr:()=>parseDateFr,parseDateLocale:()=>parseDateLocale,theme:()=>theme_theme,useRxState:()=>useRxState,useRxStateDebounced:()=>useRxStateDebounced,useRxStateOr:()=>useRxStateOr});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4848);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9389);var _tanstack_react_router__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(63);var _mantine_charts__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(1445);var date_fns__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(467);var lodash_es__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(1084);var radash__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(2425);var react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(3620);var _tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(3128);var _tanstack_react_query__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(6022);var _mantine_hooks__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(207);var _mantine_form__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(1599);var react_i18next__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(8510);function Circle({style,size,...rest}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{radius:"50%",bg:"dark.4",w:size,h:size,style:{display:"flex",flexWrap:"wrap",justifyContent:"center",alignContent:"center",...style},...rest})}function IconArrowUp({color="currentColor",size=24,rotate=0,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:`rotate(${rotate})`,...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 13.5L12 10.5L15 13.5",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"})})}function IconCalculator({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"4",y:"2",width:"16",height:"19",rx:"1",stroke:color,strokeWidth:"1.5"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"7",y:"6",width:"10",height:"4",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"7.5",y:"12.5",width:"1",height:"1",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"11.5",y:"12.5",width:"1",height:"1",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"15.5",y:"12.5",width:"1",height:"5",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"11.5",y:"16.5",width:"1",height:"1",stroke:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{x:"7.5",y:"16.5",width:"1",height:"1",stroke:color})]})}function IconCheck({color="currentColor",size=16,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,fill:"none",stroke:color,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M13.3346 4L6.0013 11.3333L2.66797 8",strokeWidth:"1.25",strokeLinecap:"square",strokeLinejoin:"round"})})}function IconCoin({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ellipse",{cx:"12.0004",cy:"9.72212",rx:"10.0004",ry:"3.33345",stroke:color,strokeWidth:"1.5"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M12.0004 18.6119C9.94456 18.6119 8.03366 18.4051 6.4446 18.0505M12.0004 18.6119V13.0561M12.0004 18.6119C14.0561 18.6119 15.9671 18.4051 17.5561 18.0505M2 9.72266V15.2784C2 16.4342 3.76454 17.4525 6.4446 18.0505M22.0007 9.72266V15.2784C22.0007 16.4342 20.2362 17.4525 17.5561 18.0505M6.4446 11.945V18.0505M17.5561 12.5005L17.5561 18.0505",stroke:color,strokeWidth:"1.5"})]})}function IconConnector({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g",{clipPath:"url(#clip0_2605_1876)",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.3688 0.797175C19.6952 -0.195659 21.5754 0.0747827 22.5682 1.40122C23.5611 2.72767 23.2906 4.60781 21.9642 5.60064C20.9814 6.33624 19.6947 6.37837 18.6901 5.81135L13.2118 10.3012C13.7118 11.0797 14.0019 12.0059 14.0019 12.9999C14.0019 13.77 13.8278 14.4994 13.5168 15.151L16.0949 17.8695C17.2392 17.3161 18.6561 17.5353 19.5775 18.5069C20.7177 19.7091 20.6673 21.6079 19.4651 22.748C18.2629 23.8882 16.3641 23.8378 15.224 22.6356C14.348 21.712 14.1748 20.3771 14.6867 19.291L12.2915 16.7654C11.4123 17.5341 10.2615 17.9999 9.00189 17.9999C6.24046 17.9999 4.00189 15.7613 4.00189 12.9999C4.00189 11.5656 4.60582 10.2723 5.57327 9.36057L4.35098 6.87732C3.01379 7.07665 1.6641 6.34735 1.13207 5.03948C0.507758 3.50476 1.24579 1.7545 2.78052 1.13019C4.31525 0.50587 6.06551 1.24391 6.68982 2.77864C7.14163 3.8893 6.87995 5.11283 6.11916 5.94081L7.28211 8.30351C7.81835 8.10709 8.3976 7.99989 9.00189 7.99989C10.0434 7.99989 11.0105 8.31833 11.8112 8.86316L17.376 4.30245C16.8897 3.0748 17.2609 1.62646 18.3688 0.797175ZM9.00189 15.9999C10.6587 15.9999 12.0019 14.6567 12.0019 12.9999C12.0019 11.343 10.6587 9.99989 9.00189 9.99989C7.34503 9.99989 6.00189 11.343 6.00189 12.9999C6.00189 14.6567 7.34503 15.9999 9.00189 15.9999Z",fill:color})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs",{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("clipPath",{id:"clip0_2605_1876",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{width:"24",height:"24",fill:"white"})})})]})}function IconCross({color="currentColor",size=16,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,fill:"none",stroke:color,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M4 4L12 12M12 4L4 12",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function IconDashboard({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3Z",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M3 9H21",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 21V9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function IconDoubleLeft({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M11 15L8 12L11 9",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M16 15L13 12L16 9",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"})]})}function IconExternalLink({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M10 9L15 9M15 9L15 14M15 9L9 15",stroke:color,strokeWidth:"1.5",strokeLinecap:"square",strokeLinejoin:"round"})})}function IconLogo(props){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg",{width:"88",height:"19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M0.038 14L4.883 0.699999H7.904L12.768 14H9.956L5.852 2.144H6.935L2.831 14H0.038ZM2.28 11.017L2.983 8.946H9.823L10.526 11.017H2.28ZM13.4867 14V4.576H16.1467V14H13.4867ZM13.6007 3.075V0.604999H16.0707V3.075H13.6007ZM17.5131 14V4.576H20.1731V6.001C20.4264 5.53233 20.7431 5.165 21.1231 4.899C21.5031 4.62033 21.9338 4.481 22.4151 4.481H23.5741V6.837H22.1491C21.6804 6.837 21.3004 6.95733 21.0091 7.198C20.7178 7.43867 20.5024 7.79967 20.3631 8.281C20.2364 8.74967 20.1731 9.326 20.1731 10.01V14H17.5131ZM24.7874 18.18V4.576H27.4474V5.868C27.7514 5.46267 28.1441 5.108 28.6254 4.804C29.1194 4.5 29.7528 4.348 30.5254 4.348C31.3994 4.348 32.1848 4.56333 32.8814 4.994C33.5781 5.42467 34.1291 6.01367 34.5344 6.761C34.9398 7.50833 35.1424 8.357 35.1424 9.307C35.1424 10.2443 34.9398 11.0867 34.5344 11.834C34.1291 12.5813 33.5781 13.1703 32.8814 13.601C32.1848 14.019 31.3994 14.228 30.5254 14.228C29.8288 14.228 29.2208 14.1013 28.7014 13.848C28.1948 13.5947 27.7768 13.24 27.4474 12.784V18.18H24.7874ZM29.8984 11.91C30.3924 11.91 30.8294 11.796 31.2094 11.568C31.6021 11.34 31.9061 11.0297 32.1214 10.637C32.3368 10.2443 32.4444 9.801 32.4444 9.307C32.4444 8.80033 32.3368 8.35067 32.1214 7.958C31.9061 7.55267 31.6021 7.236 31.2094 7.008C30.8294 6.78 30.3924 6.666 29.8984 6.666C29.4044 6.666 28.9674 6.78 28.5874 7.008C28.2074 7.236 27.9098 7.54633 27.6944 7.939C27.4791 8.33167 27.3714 8.78133 27.3714 9.288C27.3714 9.79467 27.4791 10.2443 27.6944 10.637C27.9098 11.0297 28.2074 11.34 28.5874 11.568C28.9674 11.796 29.4044 11.91 29.8984 11.91ZM40.9671 14.228C40.0171 14.228 39.1558 14.019 38.3831 13.601C37.6231 13.183 37.0151 12.6003 36.5591 11.853C36.1158 11.1057 35.8941 10.2507 35.8941 9.288C35.8941 8.31267 36.1158 7.45767 36.5591 6.723C37.0151 5.97567 37.6295 5.393 38.4021 4.975C39.1748 4.557 40.0298 4.348 40.9671 4.348C41.9171 4.348 42.7721 4.557 43.5321 4.975C44.3048 5.393 44.9128 5.97567 45.3561 6.723C45.8121 7.45767 46.0401 8.31267 46.0401 9.288C46.0401 10.2507 45.8121 11.1057 45.3561 11.853C44.9128 12.6003 44.3048 13.183 43.5321 13.601C42.7721 14.019 41.9171 14.228 40.9671 14.228ZM40.9671 11.929C41.3978 11.929 41.7905 11.834 42.1451 11.644C42.4998 11.4413 42.7785 11.1437 42.9811 10.751C43.1965 10.3583 43.3041 9.87067 43.3041 9.288C43.3041 8.70533 43.1965 8.21767 42.9811 7.825C42.7658 7.43233 42.4808 7.141 42.1261 6.951C41.7841 6.74833 41.4041 6.647 40.9861 6.647C40.5555 6.647 40.1628 6.74833 39.8081 6.951C39.4535 7.141 39.1685 7.43233 38.9531 7.825C38.7378 8.205 38.6301 8.69267 38.6301 9.288C38.6301 9.87067 38.7315 10.3583 38.9341 10.751C39.1495 11.1437 39.4345 11.4413 39.7891 11.644C40.1438 11.834 40.5365 11.929 40.9671 11.929ZM47.1264 14V4.576H49.7864V6.001C50.0397 5.53233 50.3564 5.165 50.7364 4.899C51.1164 4.62033 51.547 4.481 52.0284 4.481H53.1874V6.837H51.7624C51.2937 6.837 50.9137 6.95733 50.6224 7.198C50.331 7.43867 50.1157 7.79967 49.9764 8.281C49.8497 8.74967 49.7864 9.326 49.7864 10.01V14H47.1264ZM58.3717 14C57.713 14 57.1557 13.924 56.6997 13.772C56.2564 13.62 55.9207 13.3287 55.6927 12.898C55.4647 12.4547 55.3507 11.8213 55.3507 10.998V6.799H53.7357V4.576H55.3507V1.992H58.0107V4.576H60.3287V6.799H58.0107V10.675C58.0107 10.9663 58.0424 11.188 58.1057 11.34C58.169 11.492 58.283 11.5997 58.4477 11.663C58.625 11.7137 58.8594 11.739 59.1507 11.739H60.2717V14H58.3717ZM61.1166 14V4.576H63.7766V14H61.1166ZM61.2306 3.075V0.604999H63.7006V3.075H61.2306ZM65.143 14V4.576H67.803V5.963C68.107 5.469 68.5187 5.07633 69.038 4.785C69.57 4.49367 70.1907 4.348 70.9 4.348C72.0907 4.348 73.0027 4.728 73.636 5.488C74.2693 6.23533 74.586 7.31833 74.586 8.737V14H71.926V8.984C71.926 8.21133 71.7677 7.62233 71.451 7.217C71.147 6.799 70.6593 6.59 69.988 6.59C69.3547 6.59 68.829 6.818 68.411 7.274C68.0057 7.71733 67.803 8.338 67.803 9.136V14H65.143ZM81.2614 18.408C80.4634 18.408 79.6907 18.275 78.9434 18.009C78.2087 17.7557 77.5817 17.344 77.0624 16.774C76.543 16.204 76.2327 15.463 76.1314 14.551H78.7724C78.8737 15.0323 79.146 15.4123 79.5894 15.691C80.0454 15.9697 80.5837 16.109 81.2044 16.109C81.6477 16.109 82.0594 16.014 82.4394 15.824C82.8194 15.6467 83.1234 15.368 83.3514 14.988C83.5794 14.6207 83.6934 14.1457 83.6934 13.563V12.423C83.5034 12.7143 83.2627 12.9803 82.9714 13.221C82.68 13.4617 82.3317 13.658 81.9264 13.81C81.5337 13.9493 81.0777 14.019 80.5584 14.019C79.659 14.019 78.8484 13.81 78.1264 13.392C77.417 12.9613 76.8534 12.3787 76.4354 11.644C76.03 10.9093 75.8274 10.086 75.8274 9.174C75.8274 8.262 76.03 7.445 76.4354 6.723C76.8534 5.98833 77.417 5.412 78.1264 4.994C78.8484 4.56333 79.659 4.348 80.5584 4.348C81.255 4.348 81.8694 4.48733 82.4014 4.766C82.946 5.04467 83.3767 5.393 83.6934 5.811V4.576H86.3534V13.411C86.3534 14.513 86.119 15.4313 85.6504 16.166C85.1817 16.9133 84.561 17.4707 83.7884 17.838C83.0157 18.218 82.1734 18.408 81.2614 18.408ZM81.1094 11.72C81.6287 11.72 82.0784 11.606 82.4584 11.378C82.8384 11.15 83.136 10.846 83.3514 10.466C83.5667 10.086 83.6744 9.66167 83.6744 9.193C83.6744 8.71167 83.5667 8.281 83.3514 7.901C83.136 7.521 82.8384 7.22333 82.4584 7.008C82.0784 6.78 81.6287 6.666 81.1094 6.666C80.6027 6.666 80.153 6.78 79.7604 7.008C79.3804 7.22333 79.0827 7.521 78.8674 7.901C78.652 8.26833 78.5444 8.69267 78.5444 9.174C78.5444 9.64267 78.652 10.0733 78.8674 10.466C79.0827 10.846 79.3804 11.15 79.7604 11.378C80.153 11.606 80.6027 11.72 81.1094 11.72Z",fill:"#F3F3F3"})})}function IconLogOut({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M16 17L21 12L16 7",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M21 12H9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function IconRepeat({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M15 1L20 5L15 9",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M4 11V9C4 7.93913 4.3746 6.92172 5.0414 6.17157C5.70819 5.42143 6.61256 5 7.55556 5H20",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9 23L4 19L9 15",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M20 13V15C20 16.0609 19.6254 17.0783 18.9586 17.8284C18.2918 18.5786 17.3874 19 16.4444 19H4",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function IconStar({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M17.0178 1.76042C17.1521 1.26989 17.8479 1.26989 17.9822 1.76042L18.4798 3.57689C18.5237 3.73719 18.6444 3.86519 18.8019 3.91844L20.5994 4.52635C21.0525 4.67958 21.0525 5.32042 20.5994 5.47365L18.8019 6.08156C18.6444 6.13481 18.5237 6.26281 18.4798 6.42311L17.9822 8.23958C17.8479 8.73011 17.1521 8.73011 17.0178 8.23958L16.5202 6.42311C16.4763 6.26281 16.3556 6.13481 16.1981 6.08156L14.4006 5.47365C13.9475 5.32042 13.9475 4.67958 14.4006 4.52635L16.1981 3.91844C16.3556 3.86519 16.4763 3.73719 16.5202 3.57689L17.0178 1.76042Z",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M9.83203 3.12891L11.7554 10.4793L18.332 12.6289L11.7554 14.7785L9.83203 22.1289L7.9087 14.7785L1.33203 12.6289L7.9087 10.4793L9.83203 3.12891Z",stroke:color,strokeWidth:"1.5",strokeLinejoin:"round"})]})}function AirButton({children,onClick,rightSection,...rest}){const navigate=(0,_tanstack_react_router__WEBPACK_IMPORTED_MODULE_2__.useNavigate)();const href="href"in rest?rest.href:void 0;const target="target"in rest?rest.target:void 0;const to="to"in rest?rest.to:void 0;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{size:"md",justify:"start",styles:{label:{flex:1}},rightSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[rightSection,href&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle,{bg:"dark.4",size:24,ml:"auto",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconExternalLink,{})})]}),onClick:e=>{onClick?.(e);if(href)open(href,target??"_blank");if(to)navigate({to})},...rest,children:children})}const THEME_COLORS=["green","blue","yellow","pink","cyan","orange","grape","teal"];const COLORS_EMOJI={red:"\uD83D\uDD34",orange:"\uD83D\uDFE0",yellow:"\uD83D\uDFE1",green:"\uD83D\uDFE2",blue:"\uD83D\uDD35",purple:"\uD83D\uDFE3",brown:"\uD83D\uDFE4"};function formatDateLocale(date,opts){if(!date)return null;return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.intlFormat)(date,{month:"2-digit",day:"2-digit",year:"numeric",...opts},{locale:"fr"})}function getLocaleDateFormat(locale){const getPatternForPart=part=>{switch(part.type){case"day":return"d".repeat(part.value.length);case"month":return"M".repeat(part.value.length);case"year":return"y".repeat(part.value.length);case"literal":return part.value}};return new Intl.DateTimeFormat(locale).formatToParts(new Date("2022-01-02")).map(getPatternForPart).join("")}function isoday(date){if(!date)return null;if(date instanceof Date&&isNaN(date.getTime()))return null;return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.formatISO)(date,{representation:"date"})}function parseDateFr(date){return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.parse)(date,"dd/MM/yyyy",new Date)}function parseDateLocale(date){if(!date)return null;const res=(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.parse)(date,getLocaleDateFormat("fr"),new Date);if(!(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isValid)(res))return null;return res}var _computedKey,_computedKey1;_computedKey=0,_computedKey1=1;class RxState extends Array{[_computedKey];[_computedKey1];constructor(value,dispatch){super();this[0]=value;this[1]=dispatch}get value(){return this[0]}get dispatch(){return this[1]}set value(value){this.dispatch(value)}}function useRxState(value){const state=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(value);return new RxState(state[0],state[1])}function useRxStateDebounced(from,delay=300){const debounced=useRxState(from.value);const handler=(0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{if(handler.current)clearTimeout(handler.current);handler.current=setTimeout(()=>{from.value=debounced.value},delay);return()=>{if(handler.current)clearTimeout(handler.current)}},[debounced.value,delay]);return debounced}function useRxStateOr(state,or){const fallbackValue=useRxState(or);const fallback=or instanceof RxState?or:fallbackValue;return state??fallback}function nbhy(){return String.fromCharCode(8209)}function formatCurrency(value,opts){const formatted=new Intl.NumberFormat(navigator.language,{style:"currency",currency:"eur",signDisplay:"exceptZero",...opts}).format(value);return formatted.replaceAll("-",nbhy())}function formatCurrencyCompact(value,opts){return formatCurrency(value,{maximumFractionDigits:Math.abs(Number(value))>1e6||Math.abs(Number(value))<1e4?2:Math.abs(Number(value))<1e5?1:0,notation:"compact",...opts})}function formatPercent(value,opts){const formatted=new Intl.NumberFormat(navigator.language,{style:"percent",signDisplay:"exceptZero",...opts}).format(value);return formatted.replaceAll("-",nbhy())}var zIndex_ZIndex=/*#__PURE__*/function(ZIndex){ZIndex[ZIndex["TableHeader"]=1]="TableHeader";ZIndex[ZIndex["TableScrollbar"]=2]="TableScrollbar";ZIndex[ZIndex["ChartTooltip"]=3]="ChartTooltip";ZIndex[ZIndex["Loader"]=9999]="Loader";return ZIndex}({});const BankAccountsChartTooltip=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_7__.forwardRef)((props,ref)=>{const{balance,accounts,detailed}=props;const themed=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const d=isoday(parseDateLocale(balance.date));return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{p:"xs",withBorder:true,shadow:"md",radius:"md",style:{maxHeight:600,overflow:"auto",filter:"drop-shadow(0 0 2px rgba(0, 0, 0, 0.5))",backdropFilter:"blur(6px)"},ref:ref,bg:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(themed.colors.dark[9],.3),children:[(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isAfter)(d,new Date)?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:10,c:"dimmed",children:"pr\xe9visionnel"}):null,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",gap:4,mb:10,align:"center",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:14,fw:"bold",children:balance.date}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:14,fw:"bolder",c:balance.accounts.total>=0?"green":"red",children:formatCurrencyCompact(balance.accounts.total)})]}),detailed?Object.entries(balance.accounts).filter(([accountId,amount])=>"total"!=accountId&&0!=amount).map(([accountId,amount],i)=>{const account=accounts[accountId];if(!account)return;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{mb:5,align:"center",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Circle,{bg:themed.colors[THEME_COLORS[(i+1)%THEME_COLORS.length]][9],size:10}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",children:account.display_name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fz:12,ml:"auto",children:formatCurrencyCompact(amount)})]},accountId)}):null]})});function BankAccountsChart(props){const{hovered:hoveredProps,showIndividualBalances,showReferenceLines="hover",showToday,legend,detail,xAxisProps,accounts,...rest}=props;const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const hovered=useRxStateDebounced(useRxStateOr(hoveredProps,null),200);const tooltipref=(0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);const data=(0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(()=>{const all=[];for(const[name,data]of(0,lodash_es__WEBPACK_IMPORTED_MODULE_5__.entries)(accounts)){const d=data;for(const[day,balance]of Object.entries(d.balance)){const date=formatDateLocale(day);let existing=all.find(x=>x.date===date);if(!existing){existing={date,label:new Date(isoday(day)).getTime(),accounts:{total:0,unassigned:0}};all.push(existing)}existing.accounts[name]=balance.amount;if(!(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isBefore)(day,(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.startOfDay)(new Date)))existing.accounts.total_future=existing.accounts.total;if(!(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.isAfter)(day,new Date))existing.accounts.total_past=existing.accounts.total}}return all},[accounts]);const{low,high}=(0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(()=>{const values=[...Object.values(data).map(x=>x.accounts.total)];let low=(0,radash__WEBPACK_IMPORTED_MODULE_6__.min)(values)??0;low=low>0?.9*low:1.1*low;let high=(0,radash__WEBPACK_IMPORTED_MODULE_6__.max)(values)??0;high=high>0?1.05*high:.9*high;return{low,high}},[data.length]);return(0,react__WEBPACK_IMPORTED_MODULE_7__.useMemo)(()=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_charts__WEBPACK_IMPORTED_MODULE_3__.AreaChart,{data:data,dataKey:"label",xAxisProps:{tickFormatter:value=>(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.formatDate)(new Date(value),"dd/MM"),...xAxisProps},strokeWidth:2,dotProps:{r:0,strokeWidth:1},activeDotProps:{r:3,strokeWidth:1},withXAxis:"high"==detail,withYAxis:true,gridAxis:"x",yAxisProps:high&&low?{allowDataOverflow:true,domain:[low,high]}:void 0,series:showIndividualBalances?Object.values(accounts).filter(x=>"total"!=x.accountId).map(x=>({name:"accounts."+x.accountId,color:THEME_COLORS[Object.values(accounts).indexOf(x)%THEME_COLORS.length],label:x.display_name})):[{name:"accounts.total_past",color:theme.primaryColor,label:"Solde"},{name:"accounts.total_future",color:theme.primaryColor,label:"Solde",strokeDasharray:"3 5"}],connectNulls:false,withLegend:legend,legendProps:{verticalAlign:"bottom"},curveType:"bump",type:"stacked",referenceLines:(0,radash__WEBPACK_IMPORTED_MODULE_6__.sift)([false!==showToday&&{x:new Date(isoday(new Date)).getTime(),color:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors.blue[5],1),label:"auj."},...("hover"!=showReferenceLines||hovered.value)&&"never"!=showReferenceLines&&data.length?[...(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.eachMonthOfInterval)({start:parseDateLocale(data[0].date),end:parseDateLocale(data[data.length-1].date)}).map(x=>({x:new Date(isoday(x)).getTime(),color:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors.gray[5],.3),label:(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.formatDate)(x,"MMMM"),labelPosition:"top"}))]:[]]),withGradient:true,fillOpacity:.1,valueFormatter:value=>formatCurrency(value,{notation:"compact"}),tooltipAnimationDuration:100,tooltipProps:{wrapperStyle:{zIndex:zIndex_ZIndex.ChartTooltip},content:props=>{const balance=props.payload?.[0]?.payload??null;setTimeout(()=>hovered.value=balance,100);if(!balance)return null;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(BankAccountsChartTooltip,{balance:balance,accounts:accounts,detailed:showIndividualBalances,ref:tooltipref})}},...rest}),[JSON.stringify(Object.keys(accounts)),showIndividualBalances,tooltipref,showReferenceLines,high,low,legend,detail])}function BlurSpot({pos="bottom"}){const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const spotStyle=options=>({position:"fixed",width:options.width??"800px",height:options.height??"800px",top:options.top,left:options.left,right:options.right,bottom:options.bottom,background:options.background??`radial-gradient(circle, ${theme.colors[theme.primaryColor][9]}, ${theme.colors[theme.primaryColor][6]} 50%, ${theme.colors[theme.primaryColor][9]})`,filter:`blur(${options.blur||150}px)`,transform:`rotate(${options.rotation||0}deg)`,pointerEvents:"none",zIndex:-1,opacity:options.opacity??.3});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{style:{position:"fixed",mixBlendMode:"screen"},children:["bottom"==pos&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"blur-spot",style:spotStyle({width:"700px",bottom:"-50%",left:"-10%",rotation:20})}),"top"==pos&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:"blur-spot",style:spotStyle({width:"300px",top:"-50%",right:"15%",rotation:-20,opacity:.2})})]})}const Logo=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_7__.forwardRef)(({url,...rest},ref)=>{const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Image,{ref:ref,src:url.includes("img.logo.dev")||url.includes("media.airporting")?url:getLogo(url),radius:12,fit:"contain",bd:`3px solid ${(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.white,.11)}`,w:20,style:{aspectRatio:1},...rest})});Logo.displayName="Logo";const getLogo=url=>`https://img.logo.dev/${url}?token=pk_BVN4OQv0Qs-bnqjdIgTppg`;const CompanyLogo=/*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_7__.forwardRef)(({slug,...rest},ref)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Logo,{ref:ref,url:`https://s3.dualstack.eu-west-3.amazonaws.com/media.airporting/companies/${slug}.png`,fallbackSrc:"https://s3.dualstack.eu-west-3.amazonaws.com/media.airporting/companies/undefined.png",...rest}));CompanyLogo.displayName="CompanyLogo";class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&&params2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class AppApi{http;constructor(http){this.http=http}getStatus=(params={})=>this.http.request({path:"/status",method:"GET",...params});users={getMeV1:(params={})=>this.http.request({path:"/v1/users/me",method:"GET",secure:true,format:"json",...params}),forgotPasswordV1:(data,params={})=>this.http.request({path:"/v1/users/password/forgot",method:"POST",body:data,type:"application/json",...params}),resetPasswordV1:(data,params={})=>this.http.request({path:"/v1/users/password/reset",method:"POST",body:data,type:"application/json",...params})};chart={getCashBalanceAccountsV1:(query,params={})=>this.http.request({path:"/v1/chart/cash_balance/accounts",method:"GET",query:query,format:"json",...params})};dashboard={getDashboardV1:({companyId,...query},params={})=>this.http.request({path:`/v1/dashboard/${companyId}`,method:"GET",secure:true,format:"json",...params})};billing={getSepaV1:({acc,cid,...query},params={})=>this.http.request({path:`/v1/billing/${cid}/${acc}/sepa`,method:"GET",secure:true,format:"json",...params}),sepaSetupV1:({acc,cid,...query},data,params={})=>this.http.request({path:`/v1/billing/${cid}/${acc}/sepa/setup`,method:"POST",body:data,secure:true,type:"application/json",format:"json",...params}),getPortalV1:({acc,cid,...query},params={})=>this.http.request({path:`/v1/billing/${cid}/${acc}/portal`,method:"GET",query:query,secure:true,format:"json",...params})};auth={authCallbackCredentialsCreate:(data,params={})=>this.http.request({path:"/v1/auth/callback/credentials",method:"POST",body:data,type:"application/x-www-form-urlencoded",...params}),authCsrfList:(params={})=>this.http.request({path:"/v1/auth/csrf",method:"GET",format:"json",...params}),authSessionList:(params={})=>this.http.request({path:"/v1/auth/session",method:"GET",format:"json",...params}),authSignoutCreate:(data,params={})=>this.http.request({path:"/v1/auth/signout",method:"POST",body:data,type:"application/x-www-form-urlencoded",format:"json",...params})}}function useApi(){const client=new HttpClient({baseUrl:{MODE:"production",DEV:false,PROD:true,BASE_URL:"/",ASSET_PREFIX:"https://unpkg.com/@airporting/integrations-app@latest/dist/mf"}.PUBLIC_APP_API_URL,baseApiParams:{headers:{},credentials:"include"}});return new AppApi(client)}function useGetUsersMeQuery(){const api=useApi();const query=(0,_tanstack_react_query__WEBPACK_IMPORTED_MODULE_9__.useQuery)({queryKey:["users","me"],queryFn:async()=>{const res=await api.users.getMeV1().then(x=>x.data);if(res.user)localStorage.setItem("app:logged","1");return res}});return query}const Field=({prop,val})=>{if(!val)return null;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",children:[prop,":"]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{children:[" ",val]})]})};function SearchBox({children,values,selected,onChange,showDetails}){const[search,setSearch]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)("");const[preview,setPreview]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(selected??null);const itemElems=react__WEBPACK_IMPORTED_MODULE_7__.useRef(new Map);const scrollarea=(0,react__WEBPACK_IMPORTED_MODULE_7__.useRef)(null);const[popopen,setPopopen]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(false);const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();const filtered=values.filter(item=>item.label.toLowerCase().includes(search.toLowerCase().trim()));const options=filtered.map(item=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{ref:ref=>{if(ref)itemElems.current.set(item.value,ref)},variant:selected===item.value?"filled":preview===item.value?"light":"subtle",color:selected===item.value?theme.colors[theme.primaryColor][9]:"gray",size:"xs",justify:"start",onClick:()=>{clickItem(item.value)},onMouseEnter:()=>setPreview(item.value),children:item.label},item.value));function clickItem(value){onChange?.(value);setPreview(value);setPopopen(false)}(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setPreview(filtered[0]?.value)},[search]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{if(preview)focusItem(preview)},[preview]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setTimeout(()=>{if(preview)focusItem(preview)},200)},[popopen]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setPreview(selected??null)},[selected]);function focusItem(value){const item=itemElems.current.get(value);if(item&&scrollarea.current){if(item.offsetTop+item.offsetHeight>scrollarea.current.offsetHeight+scrollarea.current.scrollTop)scrollarea.current.scrollTo({top:item.offsetTop+item.offsetHeight-scrollarea.current.offsetHeight});if(item.offsetTop<scrollarea.current.scrollTop||item.offsetTop+item.offsetHeight>scrollarea.current.offsetHeight+scrollarea.current.scrollTop)scrollarea.current.scrollTo({top:item.offsetTop})}}const content=/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{align:"flex-start",wrap:"nowrap",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{value:search,onChange:event=>setSearch(event.currentTarget.value),placeholder:"Rechercher",autoFocus:true,onKeyDown:(0,_mantine_hooks__WEBPACK_IMPORTED_MODULE_10__.getHotkeyHandler)([["enter",()=>preview&&clickItem(preview)],["escape",()=>setSearch("")],["arrowUp",()=>setPreview(filtered[filtered.findIndex(x=>x.value===preview)-1]?.value)],["arrowDown",()=>setPreview(filtered[filtered.findIndex(x=>x.value===preview)+1]?.value)]])}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.ScrollArea,{h:300,scrollbars:"y",type:"auto",viewportRef:scrollarea,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:0,children:options}),0===filtered.length&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",flex:1,ta:"center",children:"Aucun resultat"})]})]}),preview&&showDetails&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Divider,{orientation:"vertical"}),showDetails(preview)]})]});if(!children)return content;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover,{opened:popopen,onChange:setPopopen,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover.Target,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{onClick:()=>setPopopen(true),children:children})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover.Dropdown,{children:content})]})}function CompanySelector({children,selected,onChange}){const me=useGetUsersMeQuery();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SearchBox,{values:me.data?.companies.map(c=>({label:c.display_name,value:c.id.toString()}))??[],selected:selected,onChange:onChange,showDetails:x=>{const comp=me.data?.companies.find(c=>c.id.toString()===x);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:4,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CompanyLogo,{slug:comp?.slug,w:48,mb:"md"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"Nom",val:comp?.display_name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"SIREN",val:comp?.siren_number}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"Dirigeant",val:comp?.leader}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Field,{prop:"Adresse",val:comp?.address})]})},children:children??/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{flex:1,size:"md",variant:"subtle",color:"gray",leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconRepeat,{}),justify:"start",children:"Changer d'entreprise"})})}function getHelpInputStyles(help){return{input:{borderBottomLeftRadius:help?0:10,borderBottomRightRadius:help?0:10}}}function getHelpButtonStyles(help){return{root:{borderBottomLeftRadius:help?0:10,borderBottomRightRadius:help?0:10}}}const Help=({help,"rt-corner-round":rtCornerRound})=>{if(help?.length)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Alert,{variant:"light",color:"blue",title:"Aide",styles:{root:{borderTopLeftRadius:help?0:10,borderTopRightRadius:help?rtCornerRound?10:0:10}},children:help});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{})};const InputText=({label,required,placeholder,value,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);const singleValue="string"==typeof value?value:"";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,placeholder:placeholder,value:singleValue,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};function gradientCardBottomLeft(theme){return`linear-gradient(25deg, ${(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors[theme.primaryColor][8],.3)} 4.93%, ${theme.colors.dark[8]} 49.02%)`}const InputMsg=({full})=>{const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{radius:"md",p:"md",bg:gradientCardBottomLeft(theme),children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:2,mt:5,mb:15,children:full?.title}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",children:full?.text})]})};const InputPassword=({label,required,placeholder,value,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.PasswordInput,{pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,placeholder:placeholder,value:value,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const InputSwitch=({label,help,value,full,onChange})=>{const[checked,setChecked]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(false);const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setChecked(value??full?.default??false)},[value]);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Switch,{pb:help?0:15,pt:15,styles:stylesValue,label:label,checked:checked,onChange:event=>{setChecked(event.currentTarget.checked);onChange(event.currentTarget.checked)},autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const InputMultipleText=({label,required,placeholder,value,isMultiple,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpButtonStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpButtonStyles(helpValue??""))},[helpValue]);const arrayValue=Array.isArray(value)?value:[];const handleUpdateItem=(index,newValue)=>{const newArray=[...arrayValue];newArray[index]=newValue;onChange(newArray)};const handleRemoveItem=index=>{const newArray=arrayValue.filter((_,i)=>i!==index);onChange(newArray)};const handleAddItem=()=>{onChange([...arrayValue,""])};return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Box,{pb:help?0:15,pt:15,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label",{style:{fontWeight:500,display:"block",fontSize:"var(--mantine-font-size-sm)"},children:[label," ",required&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{style:{color:"var(--mantine-color-red-6)"},children:"*"})]}),arrayValue.map((item,index)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",mb:"xs",wrap:"nowrap",align:"flex-start",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{style:{flexGrow:1},placeholder:`${placeholder||label} #${index+1}`,value:item,onChange:event=>handleUpdateItem(index,event.currentTarget.value),type:"text",autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),arrayValue.length>1&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{size:"xs",color:"red",onClick:()=>handleRemoveItem(index),children:"Supprimer"})]},index)),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{color:"cyan",size:"xs",onClick:handleAddItem,styles:stylesValue,children:"Ajouter"}),error&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{style:{color:"var(--mantine-color-red-6)",fontSize:"12px",marginTop:"4px"},children:error}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??"","rt-corner-round":isMultiple})]})};const InputEmail=({label,required,placeholder,value,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);const singleValue="string"==typeof value?value:"";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{type:"email",pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,placeholder:placeholder,value:singleValue,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const InputMultipleEmail=({label,required,placeholder,value,isMultiple,onChange,error,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpButtonStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpButtonStyles(helpValue??""))},[helpValue]);const arrayValue=Array.isArray(value)?value:[];const handleUpdateItem=(index,newValue)=>{const newArray=[...arrayValue];newArray[index]=newValue;onChange(newArray)};const handleRemoveItem=index=>{const newArray=arrayValue.filter((_,i)=>i!==index);onChange(newArray)};const handleAddItem=()=>{onChange([...arrayValue,""])};return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Box,{pb:help?0:15,pt:15,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label",{style:{fontWeight:500,display:"block",fontSize:"var(--mantine-font-size-sm)"},children:[label," ",required&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{style:{color:"var(--mantine-color-red-6)"},children:"*"})]}),arrayValue.map((item,index)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",mb:"xs",wrap:"nowrap",align:"flex-start",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{style:{flexGrow:1},placeholder:`${placeholder||label} #${index+1}`,value:item,onChange:event=>handleUpdateItem(index,event.currentTarget.value),type:"email",autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),arrayValue.length>1&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{size:"xs",color:"red",onClick:()=>handleRemoveItem(index),children:"Supprimer"})]},index)),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{color:"cyan",size:"xs",onClick:handleAddItem,styles:stylesValue,children:"Ajouter"}),error&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{style:{color:"var(--mantine-color-red-6)",fontSize:"12px",marginTop:"4px"},children:error}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??"","rt-corner-round":isMultiple})]})};const InputHidden=({value,onChange,error})=>{const singleValue="string"==typeof value?value:"";return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput,{type:"hidden",value:singleValue,onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"})})};const InputSelect=({label,required,value,onChange,error,full,help})=>{const[helpValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(help);const[stylesValue,setStylesValue]=(0,react__WEBPACK_IMPORTED_MODULE_7__.useState)(getHelpInputStyles(helpValue??""));(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{setStylesValue(getHelpInputStyles(helpValue??""))},[helpValue]);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.NativeSelect,{pb:help?0:15,pt:15,styles:stylesValue,label:label,required:required,withAsterisk:required,value:value,data:full?.values??[],onChange:event=>onChange(event.currentTarget.value),error:error,autoComplete:"off","data-lpignore":"true","data-form-type":"other","data-bitwarden-watching":"false"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Help,{help:help??""})]})};const FormField=({config,formProps})=>{switch(config.type){case"email":if(config.isMultiple)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputMultipleEmail,{...config,...formProps});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputEmail,{...config,...formProps});case"hidden":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputHidden,{...config,...formProps});case"msg":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputMsg,{...config,...formProps});case"password":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputPassword,{...config,...formProps});case"switch":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputSwitch,{...config,...formProps});case"select":return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputSelect,{...config,...formProps});case"text":if(config.isMultiple)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputMultipleText,{...config,...formProps});return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(InputText,{...config,...formProps});default:console.error(`Type de champs non reconnu : ${config.type}`);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Alert,{variant:"filled",color:"red",title:`Type de champ non reconnu ${config.type}`,children:["Name: $",config.name,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("br",{}),"Label: $",config.label]})}};const DynamicForm=({config,save})=>{const{data:configData,isPending:isLoadingConfig}=config();const saveFn=save();const form=(0,_mantine_form__WEBPACK_IMPORTED_MODULE_11__.useForm)({initialValues:configData?.initialData??{}});(0,react__WEBPACK_IMPORTED_MODULE_7__.useEffect)(()=>{if(configData?.initialData){form.setValues(configData.initialData);form.resetDirty()}},[configData]);if(isLoadingConfig||!configData)return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{withBorder:true,shadow:"md",p:"xl",style:{position:"relative"},children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Skeleton,{height:30,mt:6,radius:"xl"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Skeleton,{height:12,mt:6,width:"30%",radius:"xl"})]});const handleSubmit=values=>{saveFn(values)};const{sections}=configData;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper,{shadow:"md",p:"xl",style:{position:"relative"},children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form",{autoComplete:"off",onSubmit:form.onSubmit(handleSubmit),children:[sections.map(({fields})=>fields.map((fieldConfig,idx)=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(FormField,{config:fieldConfig,formProps:{value:form.values[fieldConfig.name],onChange:value=>form.setFieldValue(fieldConfig.name,value),error:form.errors[fieldConfig.name]}},idx))),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{type:"submit",mt:"xl",children:"Sauvegarder"})]})})};function IconMore({color="currentColor",size=24,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"17.168",cy:"7.5",r:"1.5",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"17.168",cy:"12.5",r:"1.5",fill:color}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle",{cx:"17.168",cy:"17.5",r:"1.5",fill:color})]})}function IconTrendingUp({color="currentColor",size=24,transform,...props}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:"none",style:{transform},xmlns:"http://www.w3.org/2000/svg",...props,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M23 6L13.5 15.5L8.5 10.5L1 18",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M17 6H23V12",stroke:color,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function KPICard({children,title,subtitle,topSection,trend,menu,...rest}){const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{bg:"dark.4",miw:260,p:"sm",...rest,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:12,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",align:"start",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[title&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{order:4,children:title}),topSection]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(KPICardMenu,{parameters:menu?.parameters,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconMore,{color:theme.colors.gray[7],cursor:"pointer"})})]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Divider,{}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{justify:"space-between",children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{gap:6,flex:1,children:[trend&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconTrendingUp,{transform:"down"==trend?"scaleY(-1)":void 0}),subtitle&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{fw:500,fz:16,c:theme.primaryColor,children:subtitle}),children]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconHelpCircle,{color:theme.colors.dark[0],style:{alignSelf:"flex-end"}})]})]})})}function KPICardMenu({parameters,children}){return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu,{shadow:"md",width:200,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Target,{children:children}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Dropdown,{children:[parameters&&/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Label,{children:"Param\xe8tres"}),parameters,/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Divider,{})]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Label,{children:"Organisation"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub.Target,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub.Item,{leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowsMove,{size:14}),children:"D\xe9placer"})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Sub.Dropdown,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBarLeft,{size:14}),children:"Gauche"}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBarRight,{size:14}),children:"Droite"})]})]}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{color:"red",leftSection:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconTrash,{size:14}),children:"Supprimer ce KPI"})]})]})}function KPICardBankAccountsChart({accounts,...rest}){const detailed=useRxState(false);return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(KPICard,{title:"Cash position (k€)",w:"100%",menu:{parameters:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Checkbox,{label:"D\xe9tails par compte",checked:detailed.value,onChange:x=>detailed.value=x.target.checked})})]},...rest,children:accounts?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(BankAccountsChart,{showIndividualBalances:detailed.value,h:200,ml:10,accounts:accounts,detail:"high",showToday:false,showReferenceLines:"never",xAxisProps:{ticks:(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.eachMonthOfInterval)({start:(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.subMonths)(new Date,6),end:new Date}).map(d=>new Date(isoday(d)).getTime()),tickFormatter:v=>{v=new Date(v);return(0,date_fns__WEBPACK_IMPORTED_MODULE_4__.intlFormat)(v,{month:"short"},{locale:"fr"})}}}):/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Skeleton,{h:200,w:"100%"})})}const languages={en:{label:"English",flag:"us"},fr:{label:"Fran\xe7ais",flag:"fr"},es:{label:"Espa\xf1ol",flag:"es"}};const flag=lang=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{className:`fi fi-${languages[lang].flag}`});function LanguageSwitcher(props){const{i18n}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_12__.useTranslation)();const lang=i18n.language;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{...props,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu,{shadow:"md",width:180,children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Target,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button,{variant:"default",children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:"xs",children:[flag(lang)," ",lang.toUpperCase()]})})}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Dropdown,{children:(0,radash__WEBPACK_IMPORTED_MODULE_6__.listify)(languages,(key,{label})=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Menu.Item,{onClick:()=>i18n.changeLanguage(key),disabled:lang===key,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{children:[flag(key)," ",label]})},key))})]})})}function PillTrend({children,trend,...rest}){const theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineTheme)();return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Pill,{bg:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)(theme.colors["up"==trend?"teal":"red"][6],.3),...rest,children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Group,{gap:4,wrap:"nowrap",align:"center",children:["up"==trend?/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBigUpFilled,{size:10,color:theme.colors.teal[2]}):/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_tabler_icons_react__WEBPACK_IMPORTED_MODULE_8__.IconArrowBigDownFilled,{size:10,color:theme.colors.red[5]}),children]})})}const theme_theme=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.createTheme)({primaryColor:"teal",fontFamily:"Host Grotesk",headings:{sizes:{h1:{fontSize:"28px",fontWeight:"500"},h2:{fontSize:"22px",fontWeight:"500"},h3:{fontSize:"18px",fontWeight:"500"},h4:{fontSize:"16px",fontWeight:"500"},h5:{fontSize:"14px",fontWeight:"500"},h6:{fontSize:"12px",fontWeight:"500"}}},fontSizes:{lg:"16px",md:"14px",sm:"12px",xs:"10px"},colors:{dark:["#a4a4a4",(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.2),(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.15),(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.1),(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.05),"#474747","#363636","#282828","#1e1e1e","#121212"]},components:{Button:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Button.extend({styles:(_theme,props)=>({root:{border:"filled"!=props.variant&&props.variant?void 0:"none"},label:{fontWeight:"500"}})}),Checkbox:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Checkbox.extend({styles:{input:{border:"none"}},defaultProps:{icon:props=>/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IconCheck,{...props})}}),TextInput:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.TextInput.extend({styles:{label:{marginBottom:"8px"}}}),PasswordInput:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.PasswordInput.extend({styles:{label:{marginBottom:"8px"}}}),Input:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Input.extend({styles:{input:{borderRadius:"10px",backgroundColor:"var(--mantine-color-body)"}}}),MenuDropdown:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.MenuDropdown.extend({defaultProps:{bg:"var(--mantine-color-dark-7)"}}),Popover:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Popover.extend({defaultProps:{radius:"8px"},styles:{dropdown:{background:"var(--mantine-color-dark-7)",borderColor:"var(--mantine-color-dark-1)"}}}),Divider:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Divider.extend({defaultProps:{color:(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.alpha)("var(--mantine-color-white)",.1)}}),Badge:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Badge.extend({styles:{root:{borderRadius:"4px",fontWeight:"400",fontFamily:"IBM Plex Sans"}}}),Modal:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Modal.extend({styles:{content:{borderRadius:10,backgroundColor:"var(--mantine-color-dark-9)"},header:{backgroundColor:"var(--mantine-color-dark-9)"}}}),Drawer:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Drawer.extend({styles:{content:{backgroundColor:"var(--mantine-color-dark-9)"},header:{backgroundColor:"var(--mantine-color-dark-9)"}}}),Paper:_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Paper.extend({styles:{root:{backgroundColor:"var(--mantine-color-dark-8)"}}})}});const cssVarResolver=theme=>({variables:{},light:{"--mantine-color-text":"var(--mantine-color-black)"},dark:{"--mantine-radius-default":"10px","--checkbox-radius":"4px","--mantine-color-text":"var(--mantine-color-white)","--mantine-color-body":"#090909","--mantine-color-placeholder":"var(--mantine-color-dark-0)","--mantine-color-dimmed":"var(--mantine-color-dark-0)","--button-bg":`linear-gradient(90deg, ${(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.darken)(theme.colors[theme.primaryColor][9],.3)} -10%, ${theme.colors[theme.primaryColor][8]} 100%)`,"--mantine-color-default":"var(--mantine-color-dark-3)","--mantine-color-default-border":"var(--mantine-color-dark-2)","--mantine-color-default-hover":"var(--mantine-color-dark-2)"}})}}]);
@@ -1 +1 @@
1
- export declare function useConnectorSaveQuery(values: Record<string, any>): import("@tanstack/react-query").UseQueryResult<import("../../gen/IntegrationsApi").ConnectorSaveDataResponse, Error>;
1
+ export declare function useConnectorSaveQuery(): (values: Record<string, any>) => import("@tanstack/react-query").UseQueryResult<import("../../gen/IntegrationsApi").ConnectorSaveDataResponse, Error>;
Binary file
@@ -7,4 +7,4 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},5295:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Connectors});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(3620);var index_mjs_=__webpack_require__(9389);var modern_index_js_=__webpack_require__(6022);var IntegrationsApi=__webpack_require__(6699);const AppConfigCtx=/*#__PURE__*/(0,index_js_.createContext)(null);const AppConfigProvider=AppConfigCtx.Provider;function useAppConfig(){const config=(0,index_js_.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigProvider />`");return config}function useApi(){const config=useAppConfig();const client=new IntegrationsApi.Qq({baseUrl:config.api.replace(/\/$/,""),baseApiParams:{headers:{Authorization:config.token?`Bearer ${config.token}`:"",From:config.owner}}});return new IntegrationsApi.qx(client)}function useStatsQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","stats",config.company],queryFn:async()=>await api.connectors.getStatsConnectorsV1({cid:config.company}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function useConnectorsListQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","list",config.company],queryFn:async()=>await api.connectors.getConnectorsV1({cid:config.company}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}var connector_bubble=__webpack_require__(4184);function ListOkComponent(){const config=useAppConfig();const listResultRes=useConnectorsListQuery();const listResult=listResultRes.data;return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:2,children:"Tous vos connecteurs en marche"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{md:4,sm:2,xs:1},spacing:"md",style:{alignItems:"stretch"},children:listResult?.list?.map((connector,idx)=>connector?.main_connectorlist?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Card,{style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{underline:"never",href:`/company/${config.company}/integrations/${connector.id}/connector`,children:/*#__PURE__*/(0,jsx_runtime.jsx)(connector_bubble.q,{connector:connector})})},idx):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{radius:"md",animate:true},idx))})]})}function useConnectorsIllListQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","list","ill",config.company],queryFn:async()=>await api.connectors.getIllConnectorsV1({cid:config.company}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function ListIllComponent(){const config=useAppConfig();const listResultRes=useConnectorsIllListQuery();const listResult=listResultRes.data;return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:2,children:"Tous vos connecteurs \xe0 configurer"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{md:4,sm:2,xs:1},spacing:"md",style:{alignItems:"stretch"},children:listResult?.list?.map((connector,idx)=>connector?.main_connectorlist?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Card,{style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{underline:"never",href:`/company/${config.company}/integrations/${connector.id}/connector`,children:/*#__PURE__*/(0,jsx_runtime.jsx)(connector_bubble.q,{connector:connector})})},idx):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{radius:"md",animate:true},idx))})]})}var dist_index_js_=__webpack_require__(7182);function ConnectorsApp(){const tab=(0,dist_index_js_.useRxState)(new URL(location.href).searchParams.get("tab")??"active");const statsResultRes=useStatsQuery();const statsResult=statsResultRes.data;const[tabValue,setTabValue]=(0,index_js_.useState)(tab.value??"active");(0,index_js_.useEffect)(()=>{tab.dispatch(tabValue)},[tabValue]);return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:16,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:0,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:1,children:"Nos connecteurs"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{w:"fit-content",mb:0,c:"dimmed",fz:"h5",children:"Synchronisez vos comptes bancaires et outils comptables facilement."})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:16,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:tabValue,onChange:setTabValue,radius:"md",size:"xl",data:[{label:`Connecteurs actifs(${statsResult?.ok?statsResult.ok:0})`,value:"active"},{label:`Connecteurs \xe0 configurer (${statsResult?.ill?statsResult.ill:0})`,value:"ill"},{label:`Connecteurs en maintenance (${statsResult?.maintenance?statsResult.maintenance:0})`,value:"maintenance"},{label:"Tous les connecteurs",value:"all"}]})}),"active"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)(ListOkComponent,{}),"ill"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)(ListIllComponent,{}),"maintenance"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)("p",{children:"page under progress"}),"all"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)("p",{children:"page under progress"})]})}var esm_index_mjs_=__webpack_require__(6815);var notifications_esm_index_mjs_=__webpack_require__(5311);var dist_esm_index_mjs_=__webpack_require__(2425);const theme=(0,index_mjs_.createTheme)((0,dist_esm_index_mjs_.assign)(dist_index_js_.theme,{components:{}}));const cssVarResolver=x=>(0,dist_esm_index_mjs_.assign)(dist_index_js_.cssVarResolver(x),{dark:{},light:{},variables:{}});function Providers(props){const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(AppConfigProvider,{value:config,children:/*#__PURE__*/(0,jsx_runtime.jsx)(modern_index_js_.QueryClientProvider,{client:tanstack?.queryClient??new modern_index_js_.QueryClient,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(esm_index_mjs_.ModalsProvider,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(notifications_esm_index_mjs_.Notifications,{}),children]})})})})}function Connectors(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(Providers,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(ConnectorsApp,{})})})}},4184:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:()=>ConnectorBubble});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4848);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9389);function ConnectorBubble({connector}){const{colorScheme}=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineColorScheme)();const bg="dark"===colorScheme?"white":"dark";const logoUrl=connector.main_connectorlist.logo_key?`https://img.logo.dev/${connector.main_connectorlist.logo_key}?token=pk_QvyqAb6uTRGJE2_sDsEb9g&retina=true`:`https://s3.eu-west-3.amazonaws.com/media.airporting/connectors/${connector.main_connectorlist.codename}.png`;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Avatar,{src:logoUrl,size:64,radius:"md",bg:bg,color:"dark"===colorScheme?"black":"white",p:18}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{w:"fit-content",order:3,children:connector.name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",size:"lg",lineClamp:3,children:connector.main_connectorlist.description_fr})]})})}},6699:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Qq:()=>HttpClient,qx:()=>IntegrationsApi});class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&&params2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class IntegrationsApi{http;constructor(http){this.http=http}status=(params={})=>this.http.request({path:"/status",method:"GET",...params});connectors={getStatsConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/stats`,method:"GET",secure:true,format:"json",...params}),getConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ok`,method:"GET",secure:true,format:"json",...params}),getIllConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ill`,method:"GET",secure:true,format:"json",...params}),getConnectorConfigV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/config/${connector}`,method:"GET",format:"json",...params}),getConnectorSingleV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/single/${connector}`,method:"GET",format:"json",...params}),putConnectorDataV1:({connector,cid,...query},data,params={})=>this.http.request({path:`/v1/connectors/${cid}/data/${connector}`,method:"PUT",body:data,type:"application/json",format:"json",...params})}}}}]);
10
+ */var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},5295:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Connectors});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(3620);var index_mjs_=__webpack_require__(9389);var modern_index_js_=__webpack_require__(6022);var IntegrationsApi=__webpack_require__(6699);const AppConfigCtx=/*#__PURE__*/(0,index_js_.createContext)(null);const AppConfigProvider=AppConfigCtx.Provider;function useAppConfig(){const config=(0,index_js_.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigProvider />`");return config}function useApi(){const config=useAppConfig();const client=new IntegrationsApi.Qq({baseUrl:config.api.replace(/\/$/,""),baseApiParams:{headers:{Authorization:config.token?`Bearer ${config.token}`:"",From:config.owner}}});return new IntegrationsApi.qx(client)}function useStatsQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","stats",config.company],queryFn:async()=>await api.connectors.getStatsConnectorsV1({cid:config.company}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function useConnectorsListQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","list",config.company],queryFn:async()=>await api.connectors.getConnectorsV1({cid:config.company}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}var connector_bubble=__webpack_require__(4184);function ListOkComponent(){const config=useAppConfig();const listResultRes=useConnectorsListQuery();const listResult=listResultRes.data;return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:2,children:"Tous vos connecteurs en marche"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{md:4,sm:2,xs:1},spacing:"md",style:{alignItems:"stretch"},children:listResult?.list?.map((connector,idx)=>connector?.main_connectorlist?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Card,{style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{underline:"never",href:`/company/${config.company}/integrations/${connector.id}/connector`,children:/*#__PURE__*/(0,jsx_runtime.jsx)(connector_bubble.q,{connector:connector})})},idx):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{radius:"md",animate:true},idx))})]})}function useConnectorsIllListQuery(){const api=useApi();const config=useAppConfig();const query=(0,modern_index_js_.useQuery)({queryKey:["connectors","list","ill",config.company],queryFn:async()=>await api.connectors.getIllConnectorsV1({cid:config.company}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function ListIllComponent(){const config=useAppConfig();const listResultRes=useConnectorsIllListQuery();const listResult=listResultRes.data;return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:2,children:"Tous vos connecteurs \xe0 configurer"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{md:4,sm:2,xs:1},spacing:"md",style:{alignItems:"stretch"},children:listResult?.list?.map((connector,idx)=>connector?.main_connectorlist?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Card,{style:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{underline:"never",href:`/company/${config.company}/integrations/${connector.id}/connector`,children:/*#__PURE__*/(0,jsx_runtime.jsx)(connector_bubble.q,{connector:connector})})},idx):/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{radius:"md",animate:true},idx))})]})}var dist_index_js_=__webpack_require__(6423);function ConnectorsApp(){const tab=(0,dist_index_js_.useRxState)(new URL(location.href).searchParams.get("tab")??"active");const statsResultRes=useStatsQuery();const statsResult=statsResultRes.data;const[tabValue,setTabValue]=(0,index_js_.useState)(tab.value??"active");(0,index_js_.useEffect)(()=>{tab.dispatch(tabValue)},[tabValue]);return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:16,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:0,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:1,children:"Nos connecteurs"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{w:"fit-content",mb:0,c:"dimmed",fz:"h5",children:"Synchronisez vos comptes bancaires et outils comptables facilement."})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:16,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:tabValue,onChange:setTabValue,radius:"md",size:"xl",data:[{label:`Connecteurs actifs(${statsResult?.ok?statsResult.ok:0})`,value:"active"},{label:`Connecteurs \xe0 configurer (${statsResult?.ill?statsResult.ill:0})`,value:"ill"},{label:`Connecteurs en maintenance (${statsResult?.maintenance?statsResult.maintenance:0})`,value:"maintenance"},{label:"Tous les connecteurs",value:"all"}]})}),"active"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)(ListOkComponent,{}),"ill"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)(ListIllComponent,{}),"maintenance"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)("p",{children:"page under progress"}),"all"===tabValue&&/*#__PURE__*/(0,jsx_runtime.jsx)("p",{children:"page under progress"})]})}var esm_index_mjs_=__webpack_require__(6815);var notifications_esm_index_mjs_=__webpack_require__(5311);var dist_esm_index_mjs_=__webpack_require__(2425);const theme=(0,index_mjs_.createTheme)((0,dist_esm_index_mjs_.assign)(dist_index_js_.theme,{components:{}}));const cssVarResolver=x=>(0,dist_esm_index_mjs_.assign)(dist_index_js_.cssVarResolver(x),{dark:{},light:{},variables:{}});function Providers(props){const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(AppConfigProvider,{value:config,children:/*#__PURE__*/(0,jsx_runtime.jsx)(modern_index_js_.QueryClientProvider,{client:tanstack?.queryClient??new modern_index_js_.QueryClient,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(esm_index_mjs_.ModalsProvider,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(notifications_esm_index_mjs_.Notifications,{}),children]})})})})}function Connectors(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(Providers,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(ConnectorsApp,{})})})}},4184:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:()=>ConnectorBubble});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4848);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9389);function ConnectorBubble({connector}){const{colorScheme}=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineColorScheme)();const bg="dark"===colorScheme?"white":"dark";const logoUrl=connector.main_connectorlist.logo_key?`https://img.logo.dev/${connector.main_connectorlist.logo_key}?token=pk_QvyqAb6uTRGJE2_sDsEb9g&retina=true`:`https://s3.eu-west-3.amazonaws.com/media.airporting/connectors/${connector.main_connectorlist.codename}.png`;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Avatar,{src:logoUrl,size:64,radius:"md",bg:bg,color:"dark"===colorScheme?"black":"white",p:18}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{w:"fit-content",order:3,children:connector.name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",size:"lg",lineClamp:3,children:connector.main_connectorlist.description_fr})]})})}},6699:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Qq:()=>HttpClient,qx:()=>IntegrationsApi});class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&&params2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class IntegrationsApi{http;constructor(http){this.http=http}status=(params={})=>this.http.request({path:"/status",method:"GET",...params});connectors={getStatsConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/stats`,method:"GET",secure:true,format:"json",...params}),getConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ok`,method:"GET",secure:true,format:"json",...params}),getIllConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ill`,method:"GET",secure:true,format:"json",...params}),getConnectorConfigV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/config/${connector}`,method:"GET",format:"json",...params}),getConnectorSingleV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/single/${connector}`,method:"GET",format:"json",...params}),putConnectorDataV1:({connector,cid,...query},data,params={})=>this.http.request({path:`/v1/connectors/${cid}/data/${connector}`,method:"PUT",body:data,type:"application/json",format:"json",...params})}}}}]);
@@ -7,4 +7,4 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},563:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>SingleConnector});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(3620);var index_mjs_=__webpack_require__(9389);var dist_index_js_=__webpack_require__(7182);var modern_index_js_=__webpack_require__(6022);const AppConfigCtx=/*#__PURE__*/(0,index_js_.createContext)(null);const AppConfigConnectorSingleProvider=AppConfigCtx.Provider;function useAppConfigConnectorSingle(){const config=(0,index_js_.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigConnectorSingleProvider />`");return config}var IntegrationsApi=__webpack_require__(6699);function useApiConnectorSingle(){const config=useAppConfigConnectorSingle();const client=new IntegrationsApi.Qq({baseUrl:config.api.replace(/\/$/,""),baseApiParams:{headers:{Authorization:config.token?`Bearer ${config.token}`:"",From:config.owner}}});return new IntegrationsApi.qx(client)}function useConnectorConfigQuery(){const api=useApiConnectorSingle();const config=useAppConfigConnectorSingle();const query=(0,modern_index_js_.useQuery)({queryKey:["connector","config","form",config.company,config.connector],queryFn:async()=>await api.connectors.getConnectorConfigV1({cid:config.company,connector:+config.connector}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function useConnectorSaveQuery(values){const api=useApiConnectorSingle();const config=useAppConfigConnectorSingle();const query=(0,modern_index_js_.useQuery)({queryKey:["connector","save","form",config.company,config.connector],queryFn:async()=>await api.connectors.putConnectorDataV1({cid:config.company,connector:+config.connector},{data:values}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function useConnectorSingleQuery(){const api=useApiConnectorSingle();const config=useAppConfigConnectorSingle();const query=(0,modern_index_js_.useQuery)({queryKey:["connector","config","single",config.company,config.connector],queryFn:async()=>await api.connectors.getConnectorSingleV1({cid:config.company,connector:+config.connector}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}var connector_bubble=__webpack_require__(4184);function SingleConnectorApp(){const{colorScheme}=(0,index_mjs_.useMantineColorScheme)();const config=useAppConfigConnectorSingle();const itemRes=useConnectorSingleQuery();const item=itemRes.data;if(!item)return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:30,mt:6,radius:"xl"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:12,mt:6,width:"30%",radius:"xl"})]});const backLink={text:"Liste des connecteurs",tab:""};switch(item.status){case"active":backLink.tab="?tab=active";backLink.text="Connecteurs actifs";break;case"ill":backLink.tab="?tab=ill";backLink.text="Connecteurs \xe0 configurer";break}return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:10,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:0,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:1,children:"Nos connecteurs"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{w:"fit-content",mb:0,c:"dimmed",fz:"h5",children:"Synchronisez vos comptes bancaires et outils comptables facilement."}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:10,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{underline:"never",href:`/company/${config.company}/integrations/connectors${backLink.tab}`,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.Circle,{bg:"dark.4",size:24,ml:"auto",c:"white",children:/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.IconArrowUp,{rotate:270})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",c:"white",mb:0,order:3,children:backLink.text})]})})})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:0,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Grid,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Grid.Col,{span:{base:12,lg:3},children:/*#__PURE__*/(0,jsx_runtime.jsx)(connector_bubble.q,{connector:item})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Grid.Col,{span:{base:12,lg:9},children:/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.DynamicForm,{config:useConnectorConfigQuery,save:useConnectorSaveQuery})})]})})]})}var esm_index_mjs_=__webpack_require__(6815);var notifications_esm_index_mjs_=__webpack_require__(5311);var dist_esm_index_mjs_=__webpack_require__(2425);const theme=(0,index_mjs_.createTheme)((0,dist_esm_index_mjs_.assign)(dist_index_js_.theme,{components:{}}));const cssVarResolver=x=>(0,dist_esm_index_mjs_.assign)(dist_index_js_.cssVarResolver(x),{dark:{},light:{},variables:{}});function ProvidersSingleConnector(props){const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(AppConfigConnectorSingleProvider,{value:config,children:/*#__PURE__*/(0,jsx_runtime.jsx)(modern_index_js_.QueryClientProvider,{client:tanstack?.queryClient??new modern_index_js_.QueryClient,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(esm_index_mjs_.ModalsProvider,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(notifications_esm_index_mjs_.Notifications,{}),children]})})})})}function SingleConnector(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ProvidersSingleConnector,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(SingleConnectorApp,{})})})}},4184:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:()=>ConnectorBubble});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4848);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9389);function ConnectorBubble({connector}){const{colorScheme}=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineColorScheme)();const bg="dark"===colorScheme?"white":"dark";const logoUrl=connector.main_connectorlist.logo_key?`https://img.logo.dev/${connector.main_connectorlist.logo_key}?token=pk_QvyqAb6uTRGJE2_sDsEb9g&retina=true`:`https://s3.eu-west-3.amazonaws.com/media.airporting/connectors/${connector.main_connectorlist.codename}.png`;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Avatar,{src:logoUrl,size:64,radius:"md",bg:bg,color:"dark"===colorScheme?"black":"white",p:18}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{w:"fit-content",order:3,children:connector.name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",size:"lg",lineClamp:3,children:connector.main_connectorlist.description_fr})]})})}},6699:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Qq:()=>HttpClient,qx:()=>IntegrationsApi});class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&&params2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class IntegrationsApi{http;constructor(http){this.http=http}status=(params={})=>this.http.request({path:"/status",method:"GET",...params});connectors={getStatsConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/stats`,method:"GET",secure:true,format:"json",...params}),getConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ok`,method:"GET",secure:true,format:"json",...params}),getIllConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ill`,method:"GET",secure:true,format:"json",...params}),getConnectorConfigV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/config/${connector}`,method:"GET",format:"json",...params}),getConnectorSingleV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/single/${connector}`,method:"GET",format:"json",...params}),putConnectorDataV1:({connector,cid,...query},data,params={})=>this.http.request({path:`/v1/connectors/${cid}/data/${connector}`,method:"PUT",body:data,type:"application/json",format:"json",...params})}}}}]);
10
+ */var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848:function(module,__unused_webpack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},563:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>SingleConnector});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(3620);var index_mjs_=__webpack_require__(9389);var dist_index_js_=__webpack_require__(6423);var modern_index_js_=__webpack_require__(6022);const AppConfigCtx=/*#__PURE__*/(0,index_js_.createContext)(null);const AppConfigConnectorSingleProvider=AppConfigCtx.Provider;function useAppConfigConnectorSingle(){const config=(0,index_js_.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigConnectorSingleProvider />`");return config}var IntegrationsApi=__webpack_require__(6699);function useApiConnectorSingle(){const config=useAppConfigConnectorSingle();const client=new IntegrationsApi.Qq({baseUrl:config.api.replace(/\/$/,""),baseApiParams:{headers:{Authorization:config.token?`Bearer ${config.token}`:"",From:config.owner}}});return new IntegrationsApi.qx(client)}function useConnectorConfigQuery(){const api=useApiConnectorSingle();const config=useAppConfigConnectorSingle();const query=(0,modern_index_js_.useQuery)({queryKey:["connector","config","form",config.company,config.connector],queryFn:async()=>await api.connectors.getConnectorConfigV1({cid:config.company,connector:+config.connector}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}function useConnectorSaveQuery(){return values=>{const api=useApiConnectorSingle();const config=useAppConfigConnectorSingle();const query=(0,modern_index_js_.useQuery)({queryKey:["connector","save","form",config.company,config.connector],queryFn:async()=>await api.connectors.putConnectorDataV1({cid:config.company,connector:+config.connector},{data:values}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}}function useConnectorSingleQuery(){const api=useApiConnectorSingle();const config=useAppConfigConnectorSingle();const query=(0,modern_index_js_.useQuery)({queryKey:["connector","config","single",config.company,config.connector],queryFn:async()=>await api.connectors.getConnectorSingleV1({cid:config.company,connector:+config.connector}).then(x=>x.data),refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}var connector_bubble=__webpack_require__(4184);function SingleConnectorApp(){const{colorScheme}=(0,index_mjs_.useMantineColorScheme)();const config=useAppConfigConnectorSingle();const itemRes=useConnectorSingleQuery();const item=itemRes.data;if(!item)return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:30,mt:6,radius:"xl"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:12,mt:6,width:"30%",radius:"xl"})]});const backLink={text:"Liste des connecteurs",tab:""};switch(item.status){case"active":backLink.tab="?tab=active";backLink.text="Connecteurs actifs";break;case"ill":backLink.tab="?tab=ill";backLink.text="Connecteurs \xe0 configurer";break}return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:10,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:0,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",mb:0,order:1,children:"Nos connecteurs"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{w:"fit-content",mb:0,c:"dimmed",fz:"h5",children:"Synchronisez vos comptes bancaires et outils comptables facilement."}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:10,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{underline:"never",href:`/company/${config.company}/integrations/connectors${backLink.tab}`,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.Circle,{bg:"dark.4",size:24,ml:"auto",c:"white",children:/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.IconArrowUp,{rotate:270})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{w:"fit-content",c:"white",mb:0,order:3,children:backLink.text})]})})})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{py:0,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Grid,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Grid.Col,{span:{base:12,lg:3},children:/*#__PURE__*/(0,jsx_runtime.jsx)(connector_bubble.q,{connector:item})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Grid.Col,{span:{base:12,lg:9},children:/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.DynamicForm,{config:useConnectorConfigQuery,save:useConnectorSaveQuery})})]})})]})}var esm_index_mjs_=__webpack_require__(6815);var notifications_esm_index_mjs_=__webpack_require__(5311);var dist_esm_index_mjs_=__webpack_require__(2425);const theme=(0,index_mjs_.createTheme)((0,dist_esm_index_mjs_.assign)(dist_index_js_.theme,{components:{}}));const cssVarResolver=x=>(0,dist_esm_index_mjs_.assign)(dist_index_js_.cssVarResolver(x),{dark:{},light:{},variables:{}});function ProvidersSingleConnector(props){const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(AppConfigConnectorSingleProvider,{value:config,children:/*#__PURE__*/(0,jsx_runtime.jsx)(modern_index_js_.QueryClientProvider,{client:tanstack?.queryClient??new modern_index_js_.QueryClient,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(esm_index_mjs_.ModalsProvider,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(notifications_esm_index_mjs_.Notifications,{}),children]})})})})}function SingleConnector(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ProvidersSingleConnector,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(SingleConnectorApp,{})})})}},4184:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{q:()=>ConnectorBubble});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(4848);var _mantine_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(9389);function ConnectorBubble({connector}){const{colorScheme}=(0,_mantine_core__WEBPACK_IMPORTED_MODULE_1__.useMantineColorScheme)();const bg="dark"===colorScheme?"white":"dark";const logoUrl=connector.main_connectorlist.logo_key?`https://img.logo.dev/${connector.main_connectorlist.logo_key}?token=pk_QvyqAb6uTRGJE2_sDsEb9g&retina=true`:`https://s3.eu-west-3.amazonaws.com/media.airporting/connectors/${connector.main_connectorlist.codename}.png`;return/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Card,{children:/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Stack,{children:[/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Avatar,{src:logoUrl,size:64,radius:"md",bg:bg,color:"dark"===colorScheme?"black":"white",p:18}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Title,{w:"fit-content",order:3,children:connector.name}),/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mantine_core__WEBPACK_IMPORTED_MODULE_1__.Text,{c:"dimmed",size:"lg",lineClamp:3,children:connector.main_connectorlist.description_fr})]})})}},6699:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Qq:()=>HttpClient,qx:()=>IntegrationsApi});class HttpClient{baseUrl="";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...fetchParams)=>fetch(...fetchParams);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(apiConfig={}){Object.assign(this,apiConfig)}setSecurityData=data=>{this.securityData=data};encodeQueryParam(key,value){const encodedKey=encodeURIComponent(key);return`${encodedKey}=${encodeURIComponent("number"==typeof value?value:`${value}`)}`}addQueryParam(query,key){return this.encodeQueryParam(key,query[key])}addArrayQueryParam(query,key){const value=query[key];return value.map(v=>this.encodeQueryParam(key,v)).join("&")}toQueryString(rawQuery){const query=rawQuery||{};const keys=Object.keys(query).filter(key=>void 0!==query[key]);return keys.map(key=>Array.isArray(query[key])?this.addArrayQueryParam(query,key):this.addQueryParam(query,key)).join("&")}addQueryParams(rawQuery){const queryString=this.toQueryString(rawQuery);return queryString?`?${queryString}`:""}contentFormatters={["application/json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["application/vnd.api+json"]:input=>null!==input&&("object"==typeof input||"string"==typeof input)?JSON.stringify(input):input,["text/plain"]:input=>null!==input&&"string"!=typeof input?JSON.stringify(input):input,["multipart/form-data"]:input=>{if(input instanceof FormData)return input;return Object.keys(input||{}).reduce((formData,key)=>{const property=input[key];formData.append(key,property instanceof Blob?property:"object"==typeof property&&null!==property?JSON.stringify(property):`${property}`);return formData},new FormData)},["application/x-www-form-urlencoded"]:input=>this.toQueryString(input)};mergeRequestParams(params1,params2){return{...this.baseApiParams,...params1,...params2||{},headers:{...this.baseApiParams.headers||{},...params1.headers||{},...params2&&params2.headers||{}}}}createAbortSignal=cancelToken=>{if(this.abortControllers.has(cancelToken)){const abortController=this.abortControllers.get(cancelToken);if(abortController)return abortController.signal;return}const abortController=new AbortController;this.abortControllers.set(cancelToken,abortController);return abortController.signal};abortRequest=cancelToken=>{const abortController=this.abortControllers.get(cancelToken);if(abortController){abortController.abort();this.abortControllers.delete(cancelToken)}};request=async({body,secure,path,type,query,format,baseUrl,cancelToken,...params})=>{const secureParams=("boolean"==typeof secure?secure:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{};const requestParams=this.mergeRequestParams(params,secureParams);const queryString=query&&this.toQueryString(query);const payloadFormatter=this.contentFormatters[type||"application/json"];const responseFormat=format||requestParams.format;return this.customFetch(`${baseUrl||this.baseUrl||""}${path}${queryString?`?${queryString}`:""}`,{...requestParams,headers:{...requestParams.headers||{},...type&&"multipart/form-data"!==type?{"Content-Type":type}:{}},signal:(cancelToken?this.createAbortSignal(cancelToken):requestParams.signal)||null,body:null==body?null:payloadFormatter(body)}).then(async response=>{const r=response;r.data=null;r.error=null;const responseToParse=responseFormat?response.clone():response;const data=responseFormat?await responseToParse[responseFormat]().then(data=>{if(r.ok)r.data=data;else r.error=data;return r}).catch(e=>{r.error=e;return r}):r;if(cancelToken)this.abortControllers.delete(cancelToken);if(!response.ok)throw data;return data})}}class IntegrationsApi{http;constructor(http){this.http=http}status=(params={})=>this.http.request({path:"/status",method:"GET",...params});connectors={getStatsConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/stats`,method:"GET",secure:true,format:"json",...params}),getConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ok`,method:"GET",secure:true,format:"json",...params}),getIllConnectorsV1:({cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/ill`,method:"GET",secure:true,format:"json",...params}),getConnectorConfigV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/config/${connector}`,method:"GET",format:"json",...params}),getConnectorSingleV1:({connector,cid,...query},params={})=>this.http.request({path:`/v1/connectors/${cid}/single/${connector}`,method:"GET",format:"json",...params}),putConnectorDataV1:({connector,cid,...query},data,params={})=>this.http.request({path:`/v1/connectors/${cid}/data/${connector}`,method:"PUT",body:data,type:"application/json",format:"json",...params})}}}}]);