"use strict";
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk"] = self["webpackChunk"] || []).push([["react-ui-core"],{

/***/ "../react-ui/core/App.tsx":
/*!********************************!*\
  !*** ../react-ui/core/App.tsx ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ App)\n/* harmony export */ });\nclass App {\n  formHeaderButtons = [];\n  customFormTabs = [];\n  constructor() {}\n  init() {\n    //\n  }\n  addCustomFormTab(tab) {\n    tab.isCustom = true;\n    this.customFormTabs.push(tab);\n  }\n  getCustomFormTabs() {\n    return this.customFormTabs;\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/App.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Chart.tsx":
/*!**********************************!*\
  !*** ../react-ui/core/Chart.tsx ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ HubletoChart)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_chartjs_2__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-chartjs-2 */ \"../react-ui/node_modules/react-chartjs-2/dist/index.js\");\n/* harmony import */ var chartjs_adapter_date_fns__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! chartjs-adapter-date-fns */ \"../react-ui/node_modules/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.esm.js\");\n/* harmony import */ var chart_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! chart.js */ \"../react-ui/node_modules/chart.js/dist/chart.js\");\n/* harmony import */ var _hubleto_react_ui_core_Request__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @hubleto/react-ui/core/Request */ \"../react-ui/core/Request.tsx\");\n/* harmony import */ var primereact_progressbar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! primereact/progressbar */ \"../react-ui/node_modules/primereact/progressbar/progressbar.esm.js\");\n\n\n\n\n\n\nchart_js__WEBPACK_IMPORTED_MODULE_3__.Chart.register(chart_js__WEBPACK_IMPORTED_MODULE_3__.ArcElement, chart_js__WEBPACK_IMPORTED_MODULE_3__.Tooltip, chart_js__WEBPACK_IMPORTED_MODULE_3__.Legend, chart_js__WEBPACK_IMPORTED_MODULE_3__.Filler, chart_js__WEBPACK_IMPORTED_MODULE_3__.BarController, chart_js__WEBPACK_IMPORTED_MODULE_3__.BarElement, chart_js__WEBPACK_IMPORTED_MODULE_3__.CategoryScale, chart_js__WEBPACK_IMPORTED_MODULE_3__.LinearScale, chart_js__WEBPACK_IMPORTED_MODULE_3__.TimeScale, chart_js__WEBPACK_IMPORTED_MODULE_3__.PointElement, chart_js__WEBPACK_IMPORTED_MODULE_3__.LineElement, chart_js__WEBPACK_IMPORTED_MODULE_3__.LineController);\nclass HubletoChart extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      data: this.props.data,\n      legend: this.props.legend,\n      options: this.props.options,\n      initialized: false\n    };\n  }\n  componentDidMount() {\n    if (this.props.async) this.loadChart();\n  }\n  loadChart() {\n    _hubleto_react_ui_core_Request__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get(this.props.endpoint, this.props.endpointParams ?? {}, chart => {\n      try {\n        this.setState({\n          data: chart.data,\n          legend: chart.legend,\n          options: chart.options\n        });\n      } catch (err) {\n        console.error(err);\n      }\n    });\n  }\n  render() {\n    if (!this.state.data) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_progressbar__WEBPACK_IMPORTED_MODULE_5__.ProgressBar, {\n        mode: \"indeterminate\",\n        style: {\n          height: '8px'\n        }\n      });\n    }\n    const data = this.state.data;\n    let labels = [];\n    let dataset = {};\n    labels = this.state.data.labels ?? [];\n    dataset.data = this.state.data.values ?? [];\n    if (data.colors) dataset.backgroundColor = data.colors;\n    switch (this.props.type) {\n      case \"scatter\":\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_chartjs_2__WEBPACK_IMPORTED_MODULE_1__.Scatter, {\n          options: this.state.options,\n          data: this.state.data\n        });\n        // removed by dead control flow\n\n      case \"line\":\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_chartjs_2__WEBPACK_IMPORTED_MODULE_1__.Line, {\n          options: this.state.options,\n          data: this.state.data\n        });\n        // removed by dead control flow\n\n      case \"bar\":\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_chartjs_2__WEBPACK_IMPORTED_MODULE_1__.Bar, {\n          width: 0,\n          height: 0,\n          options: {\n            scales: {\n              x: {\n                ticks: {\n                  display: false\n                }\n              },\n              y: {\n                beginAtZero: true\n              }\n            }\n          },\n          data: {\n            labels: labels,\n            datasets: [dataset]\n          }\n        });\n      case \"doughnut\":\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"h-full m-auto relative\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_chartjs_2__WEBPACK_IMPORTED_MODULE_1__.Doughnut, {\n          options: {\n            responsive: true,\n            plugins: {\n              legend: this.props.legend ? this.props.legend : {\n                display: false\n              }\n            }\n          },\n          data: {\n            labels: labels,\n            datasets: [dataset]\n          }\n        }));\n      case \"pie\":\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"h-full w-full m-auto relative\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_chartjs_2__WEBPACK_IMPORTED_MODULE_1__.Pie, {\n          options: {\n            responsive: true,\n            aspectRatio: 2,\n            plugins: {\n              legend: this.props.legend ? this.props.legend : {\n                display: false\n              }\n            }\n          },\n          data: {\n            labels: labels,\n            datasets: [dataset]\n          }\n        }));\n      case \"goals\":\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_chartjs_2__WEBPACK_IMPORTED_MODULE_1__.Bar, {\n          data: {\n            datasets: [{\n              type: 'bar',\n              label: 'Goals',\n              backgroundColor: \"#ffb12b\",\n              borderColor: \"#a87316\",\n              data: this.props.data ? [...this.props.data.goals] : []\n            }, {\n              type: 'bar',\n              label: 'Won Deals',\n              backgroundColor: \"#66c24f\",\n              data: this.props.data ? [...this.props.data.won] : [],\n              stack: \"stack\"\n            }, {\n              type: 'bar',\n              label: 'Pending Deals',\n              backgroundColor: \"#cfcecc\",\n              data: this.props.data ? [...this.props.data.pending] : [],\n              stack: \"stack\"\n            }],\n            labels: this.props.data ? [...this.props.data.labels] : []\n          }\n        });\n      default:\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Chart.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Dialog.tsx":
/*!***********************************!*\
  !*** ../react-ui/core/Dialog.tsx ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Dialog)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var primereact_dialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! primereact/dialog */ \"../react-ui/node_modules/primereact/dialog/dialog.esm.js\");\n\n\nclass Dialog extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n  constructor(props) {\n    super(props);\n    if (this.props.uid) {\n      globalThis.hubleto.reactElements[this.props.uid] = this;\n    }\n  }\n  show() {\n    this.setState({\n      containerVisible: true\n    });\n  }\n  hide() {\n    this.setState({\n      containerVisible: false\n    });\n  }\n  render() {\n    const props = {\n      ...this.props\n    };\n    props.resizable = false;\n    props.headerClassName = this.props.headerClassName;\n    props.contentClassName = this.props.contentClassName;\n    if (this.props.onHide) {\n      props.onHide = () => {\n        this.props.onHide();\n        this.hide();\n      };\n    } else props.onHide = () => {\n      this.hide();\n    };\n    if (this.state) props.visible = this.state.containerVisible;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_dialog__WEBPACK_IMPORTED_MODULE_1__.Dialog, props);\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Dialog.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/ErrorBoundary.tsx":
/*!******************************************!*\
  !*** ../react-ui/core/ErrorBoundary.tsx ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ ErrorBoundary)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nclass ErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      hasError: false\n    };\n  }\n  static getDerivedStateFromError(error) {\n    // Update state so the next render will show the fallback UI.\n    return {\n      hasError: true\n    };\n  }\n  componentDidCatch(error, info) {\n    // Example \"componentStack\":\n    //   in ComponentThatThrows (created by App)\n    //   in ErrorBoundary (created by App)\n    //   in div (created by App)\n    //   in App\n    console.error('ErrorBoundary');\n    console.error(error, info);\n  }\n  render() {\n    if (this.state.hasError) {\n      // You can render any custom fallback UI\n      return this.props.fallback;\n    }\n    return this.props.children;\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/ErrorBoundary.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Form.tsx":
/*!*********************************!*\
  !*** ../react-ui/core/Form.tsx ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Form)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var primereact_progressbar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! primereact/progressbar */ \"../react-ui/node_modules/primereact/progressbar/progressbar.esm.js\");\n/* harmony import */ var primereact_tooltip__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! primereact/tooltip */ \"../react-ui/node_modules/primereact/tooltip/tooltip.esm.js\");\n/* harmony import */ var _Request__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Request */ \"../react-ui/core/Request.tsx\");\n/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Helper */ \"../react-ui/core/Helper.tsx\");\n/* harmony import */ var _TranslatedComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./TranslatedComponent */ \"../react-ui/core/TranslatedComponent.tsx\");\n/* harmony import */ var _InputFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./InputFactory */ \"../react-ui/core/InputFactory.tsx\");\n\n\n\n\n\n\n\n\nclass Form extends _TranslatedComponent__WEBPACK_IMPORTED_MODULE_6__[\"default\"] {\n  static defaultProps = {\n    uid: '_form_' + uuid__WEBPACK_IMPORTED_MODULE_1__[\"default\"]().replace('-', '_'),\n    descriptionSource: 'both'\n  };\n  components = [];\n\n  // DEPRECATED\n  jsxContentRendered = false;\n  inputs = {};\n  static formHeaderButtons = {};\n  static formFooterButtons = {};\n  static addFormHeaderButton(title, icon, onClick) {\n    if (!this.formHeaderButtons[this.name]) {\n      this.formHeaderButtons[this.name] = [];\n    }\n    this.formHeaderButtons[this.name].push({\n      title: title,\n      icon: icon,\n      onClick: onClick\n    });\n  }\n  static getFormHeaderButtons(formClass) {\n    return this.formHeaderButtons[formClass] ?? [];\n  }\n  static addFormFooterButton(title, icon, onClick) {\n    if (!this.formFooterButtons[this.name]) {\n      this.formFooterButtons[this.name] = [];\n    }\n    this.formFooterButtons[this.name].push({\n      title: title,\n      icon: icon,\n      onClick: onClick\n    });\n  }\n  static getFormFooterButtons(formClass) {\n    return this.formFooterButtons[formClass] ?? [];\n  }\n  constructor(props) {\n    super(props);\n    if (this.props.uid) {\n      globalThis.hubleto.reactElements[this.props.uid] = this;\n    }\n    this.state = this.getStateFromProps(props);\n  }\n  isCreatingRecord(id) {\n    return id ? id == -1 : false;\n  }\n  getStateFromProps(props) {\n    const isCreatingRecord = this.isCreatingRecord(props.id);\n    return {\n      isInitialized: false,\n      endpoint: props.endpoint ? props.endpoint : globalThis.hubleto.config.defaultFormEndpoint ?? {\n        describeForm: 'api/form/describe',\n        saveRecord: 'api/record/save',\n        deleteRecord: 'api/record/delete',\n        getRecord: 'api/record/get'\n      },\n      id: props.id,\n      prevId: props.prevId,\n      nextId: props.nextId,\n      readonly: props.readonly,\n      description: props.description ?? {\n        inputs: {},\n        defaultValues: {},\n        permissions: this.calculatePermissions(),\n        ui: {}\n      },\n      content: props.content,\n      creatingRecord: isCreatingRecord,\n      updatingRecord: !isCreatingRecord,\n      deletingRecord: false,\n      recordDeleted: false,\n      isInlineEditing: props.isInlineEditing ? props.isInlineEditing : isCreatingRecord,\n      isFullscreen: false,\n      invalidInputs: [],\n      originalRecord: {},\n      record: {},\n      params: null,\n      invalidRecordId: false,\n      customEndpointParams: props.customEndpointParams ?? {},\n      recordChanged: false,\n      deleteButtonDisabled: false,\n      permissions: this.calculatePermissions(),\n      tabs: this.props.tabs,\n      activeTab: this.props.activeTab,\n      activeTabUid: this.props.activeTabUid,\n      savedSuccessfully: false,\n      saveError: null,\n      loadRecordError: null\n    };\n  }\n  calculatePermissions(record) {\n    if (!this.state?.record) return {\n      canCreate: true,\n      canRead: true,\n      canUpdate: true,\n      canDelete: true\n    };\n    if (!record) record = this.state?.record;\n    let permissions = {\n      canCreate: false,\n      canRead: false,\n      canUpdate: false,\n      canDelete: false\n    };\n    permissions.canCreate = record._PERMISSIONS ? record._PERMISSIONS[0] ?? true : true;\n    permissions.canRead = record._PERMISSIONS ? record._PERMISSIONS[1] ?? true : true;\n    permissions.canUpdate = record._PERMISSIONS ? record._PERMISSIONS[2] ?? true : true;\n    permissions.canDelete = record._PERMISSIONS ? record._PERMISSIONS[3] ?? true : true;\n    if (this.state?.description?.permissions) {\n      const p = this.state.description.permissions;\n      permissions.canCreate = permissions.canCreate && (p.canCreate ?? true);\n      permissions.canRead = permissions.canRead && (p.canRead ?? true);\n      permissions.canUpdate = permissions.canUpdate && (p.canUpdate ?? true);\n      permissions.canDelete = permissions.canDelete && (p.canDelete ?? true);\n    }\n    if (this.props?.description?.permissions) {\n      const p = this.props.description.permissions;\n      permissions.canCreate = permissions.canCreate && (p.canCreate ?? true);\n      permissions.canRead = permissions.canRead && (p.canRead ?? true);\n      permissions.canUpdate = permissions.canUpdate && (p.canUpdate ?? true);\n      permissions.canDelete = permissions.canDelete && (p.canDelete ?? true);\n    }\n    return permissions;\n  }\n\n  /**\r\n   * This function trigger if something change, for Form id of record\r\n   */\n  componentDidUpdate(prevProps, prevState) {\n    let newState = {};\n    let setNewState = false;\n    if (this.props.isInitialized != prevProps.isInitialized) {\n      newState.isInitialized = this.props.isInitialized;\n      setNewState = true;\n    }\n    if (prevProps.id !== this.props.id) {\n      newState = this.getStateFromProps(this.props);\n      newState.id = this.props.id;\n\n      // this.checkIfIsEdit();\n      this.loadFormDescription();\n      newState.invalidInputs = {};\n      newState.creatingRecord = this.isCreatingRecord(this.props.id);\n      newState.updatingRecord = !newState.creatingRecord;\n      setNewState = true;\n    }\n    if (setNewState) {\n      this.setState(newState);\n    }\n  }\n  componentDidMount() {\n    this.loadFormDescription();\n  }\n  getEndpointUrl(action) {\n    return this.state.endpoint[action] ?? '';\n  }\n  getEndpointParams() {\n    return {\n      model: this.props.model,\n      id: this.state.id ? this.state.id : 0,\n      tag: this.props.tag,\n      includeRelations: this.state.description?.includeRelations,\n      __IS_AJAX__: '1',\n      ...this.state.customEndpointParams\n    };\n  }\n  getRecordFormUrl() {\n    return '';\n  }\n  onAfterLoadFormDescription(description) {\n    return description;\n  }\n  loadFormDescription() {\n    _Request__WEBPACK_IMPORTED_MODULE_4__[\"default\"].post(this.getEndpointUrl('describeForm'), this.getEndpointParams(), {}, description => {\n      if (this.props.description && this.props.descriptionSource == 'both') description = (0,_Helper__WEBPACK_IMPORTED_MODULE_5__.deepObjectMerge)(description, this.props.description);\n\n      // const defaultValues = deepObjectMerge(this.state.description.defaultValues ?? {}, description.defaultValues);\n\n      description = this.onAfterLoadFormDescription(description);\n      let permissions = this.calculatePermissions();\n      let tabs = this.state.tabs;\n      let hasCustomColumns = false;\n      let inputs = description?.inputs;\n      if (inputs) {\n        Object.keys(inputs).map((inpName, index) => {\n          if (inputs[inpName].isCustom) hasCustomColumns = true;\n        });\n      }\n      if (tabs && hasCustomColumns) {\n        tabs.push({\n          uid: '__custom_columns',\n          title: 'Custom',\n          onRender: form => {\n            // const inputs = form.state.description?.inputs;\n            // return <>{Object.keys(inputs).map((inpName, index) => {\n            //   if (inputs[inpName].isCustom) {\n            //     return form.inputWrapper(inpName);\n            //   }\n            // })}</>;\n            return form.renderCustomInputs();\n          }\n        });\n      }\n      this.setState({\n        description: description,\n        tabs: tabs,\n        readonly: !(permissions.canUpdate || permissions.canCreate),\n        permissions: permissions\n      }, () => {\n        if (this.state.id == -1) {\n          this.setRecord(description.defaultValues ?? {});\n        } else {\n          this.loadRecord();\n        }\n      });\n    });\n  }\n  reload() {\n    this.setState({\n      isInitialized: false\n    }, () => {\n      this.loadFormDescription();\n    });\n  }\n  loadRecord() {\n    _Request__WEBPACK_IMPORTED_MODULE_4__[\"default\"].post(this.getEndpointUrl('getRecord'), this.getEndpointParams(), {}, record => {\n      if (this.state.id != -1 && !record.id) {\n        this.setState({\n          isInitialized: true,\n          invalidRecordId: true\n        });\n      } else {\n        this.setState({\n          originalRecord: record\n        });\n        this.setRecord(record);\n      }\n    }, error => {\n      this.setState({\n        loadRecordError: error.data\n      });\n    });\n  }\n  setRecord(record) {\n    record = this.onAfterRecordLoaded(record);\n    let p = this.calculatePermissions(record);\n    this.setState({\n      isInitialized: true,\n      record: record,\n      originalRecord: JSON.parse(JSON.stringify(record)),\n      permissions: p,\n      readonly: !(p.canUpdate || p.canCreate)\n    }, () => {\n      this.onAfterFormInitialized();\n    });\n  }\n  onBeforeSaveRecord(record) {\n    // to be overriden\n    return record;\n  }\n  onAfterSaveRecord(saveResponse, customSaveOptions) {\n    if (this.props.onSaveCallback) this.props.onSaveCallback(this, saveResponse, customSaveOptions);\n  }\n  onAfterCopyRecord(copyResponse) {\n    if (this.props.onCopyCallback) this.props.onCopyCallback(this, copyResponse);\n  }\n  onAfterDeleteRecord(deleteResponse) {\n    if (this.props.onDeleteCallback) this.props.onDeleteCallback(this, deleteResponse);\n  }\n  onTabChange() {\n    const urlParams = new URLSearchParams(window.location.search);\n    if (this.state.activeTabUid == 'default' || this.state.activeTabUid == '') {\n      urlParams.delete('tab');\n    } else {\n      urlParams.set('tab', this.state.activeTabUid);\n    }\n    window.history.pushState({}, \"\", '?' + urlParams.toString());\n    if (this.props.onTabChangeCallback) this.props.onTabChangeCallback(this);\n  }\n  saveRecord(customSaveOptions) {\n    this.setState({\n      invalidInputs: []\n    });\n    let record = {\n      ...this.state.record,\n      id: this.state.id\n    };\n    (this.state.record._RELATIONS ?? []).map(relName => {\n      if (!(this.state.description?.includeRelations ?? []).includes(relName)) {\n        delete record[relName];\n      }\n    });\n    record = this.onBeforeSaveRecord(record);\n    _Request__WEBPACK_IMPORTED_MODULE_4__[\"default\"].post(this.getEndpointUrl('saveRecord'), {\n      ...this.getEndpointParams(),\n      record: record\n    }, {}, saveResponse => {\n      if (this.state.creatingRecord && this.props.parentTable && this.props.parentTable.setRecordFormUrl) {\n        this.props.parentTable.setRecordFormUrl(saveResponse.savedRecord?.id);\n      }\n      this.setState({\n        savedSuccessfully: true,\n        saveError: null,\n        record: saveResponse.savedRecord,\n        id: saveResponse.savedRecord?.id,\n        recordChanged: false,\n        updatingRecord: true,\n        creatingRecord: false\n      }, () => {\n        this.onAfterSaveRecord(saveResponse, customSaveOptions);\n      });\n    }, err => {\n      this.setState({\n        saveError: err.data\n      });\n      if (err.data?.invalidInputs != undefined) {\n        this.setState({\n          invalidInputs: err.data.invalidInputs\n        });\n      }\n    });\n  }\n  copyRecord() {\n    this.setState({\n      id: -1,\n      record: {\n        ...this.state.record,\n        id: -1\n      },\n      updatingRecord: false,\n      creatingRecord: true,\n      recordChanged: true\n    }, () => {\n      window.history.pushState({}, \"\", globalThis.hubleto.config.projectUrl + '/' + this.getRecordFormUrl());\n    });\n    // request.post(\n    //   this.getEndpointUrl('saveRecord'),\n    //   { ...this.getEndpointParams(), record: { ...this.state.record, id: -1 } },\n    //   {},\n    //   (saveResponse: any) => { this.onAfterCopyRecord(saveResponse); },\n    //   (err: any) => {\n    //     alert('An error ocured while copying the record.');\n    //   }\n    // );\n  }\n  deleteRecord() {\n    _Request__WEBPACK_IMPORTED_MODULE_4__[\"default\"].post(this.getEndpointUrl('deleteRecord'), {\n      ...this.getEndpointParams(),\n      hash: this.state.record._idHash_ ?? ''\n    }, {}, saveResponse => {\n      this.setState({\n        deletingRecord: false,\n        recordDeleted: true\n      });\n      this.onAfterDeleteRecord(saveResponse);\n    }, err => {\n      this.setState({\n        deletingRecord: false\n      });\n    });\n  }\n  normalizeRecord(record) {\n    return record;\n  }\n  updateRecord(changedValues, onSuccess) {\n    const record = this.normalizeRecord(this.state.record);\n    const newRecord = (0,_Helper__WEBPACK_IMPORTED_MODULE_5__.deepObjectMerge)({\n      ...record\n    }, changedValues);\n    this.setState({\n      recordChanged: JSON.stringify(this.state.originalRecord) !== JSON.stringify(newRecord),\n      savedSuccessfully: false,\n      record: newRecord\n    }, onSuccess);\n  }\n  onAfterRecordLoaded(record) {\n    return record;\n  }\n  onAfterFormInitialized() {\n    this.onTabChange();\n  }\n  closeForm() {\n    let ok = true;\n    if (this.state.recordChanged) ok = confirm(this.translate(\"You have unsaved changes. Are you sure to close?\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Form'));\n    if (ok) {\n      const urlParams = new URLSearchParams(window.location.search);\n      urlParams.delete('tab');\n      window.history.pushState({}, \"\", '?' + urlParams.toString());\n      if (this.props.onClose) {\n        this.props.onClose();\n      }\n    }\n  }\n  openNextRecord() {\n    const nextId = this.state?.nextId ?? 0;\n    if (nextId && this.props.parentTable) {\n      this.props.parentTable.openForm(nextId);\n    }\n  }\n  openPrevRecord() {\n    const prevId = this.state?.prevId ?? 0;\n    if (prevId && this.props.parentTable) {\n      this.props.parentTable.openForm(prevId);\n    }\n  }\n  contentClassName() {\n    return '';\n  }\n  renderCustomInputs() {\n    let customInputs = [];\n    if (this.state?.description?.inputs) {\n      Object.keys(this.state.description.inputs).map(inputName => {\n        const inputDesc = this.state.description.inputs[inputName];\n        if (inputDesc.isCustom) {\n          customInputs.push(this.inputWrapper(inputName));\n        }\n      });\n    }\n    return customInputs;\n  }\n  renderTabTitle(tabIndex) {\n    const tab = this.state.tabs[tabIndex];\n    if (tab) {\n      const R = this.state.record;\n      const title = tab.title;\n      if (tab.showCountFor) {\n        const count = tab.showCountFor && R[tab.showCountFor] ? R[tab.showCountFor].length : 0;\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, title, \" (\", count, \")\");\n      } else {\n        return title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, title) : null;\n      }\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, \"?\");\n    }\n  }\n  renderTopMenuButton(index) {\n    let tabs = this.state.tabs ?? [];\n    let tabUid = this.state.activeTabUid ?? '';\n    if (tabUid == '') tabUid = 'default';\n    let mainTabUid = tabUid.split('.')[0] ?? 'default';\n    let tabTitle = this.renderTabTitle(index);\n    let tab = tabs[index];\n    const isActive = tab['uid'] == mainTabUid;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      key: index,\n      className: \"btn \" + (isActive ? \"btn-primary\" : tab.cssClass ?? \"btn-transparent\"),\n      onClick: () => {\n        const tab = this.state.tabs ? this.state.tabs[index] : null;\n        const tabUid = tab ? tab.uid : 'default';\n        this.setState({\n          activeTab: index,\n          activeTabUid: tabUid\n        }, () => {\n          this.onTabChange();\n        });\n      }\n    }, tab.icon ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: tab.icon\n    })) : null, tabTitle ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text \" + (tab.isCustom ? \"italic\" : \"\")\n    }, tabTitle) : null);\n  }\n  renderTopMenu() {\n    if (this.state.tabs && Object.keys(this.state.tabs).length > 1) {\n      const tabs = this.state.tabs ?? [];\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"top-menu-wrapper\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, tabs.map((item, index) => {\n        if (item.position != 'right') {\n          return this.renderTopMenuButton(index);\n        }\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, tabs.map((item, index) => {\n        if (item.position == 'right') {\n          return this.renderTopMenuButton(index);\n        }\n      })));\n    } else {\n      return null;\n    }\n  }\n  renderTemplateElement(elRenderer, elData) {\n    switch (elRenderer) {\n      case 'form.columns':\n        if (!elData.props) elData.props = {};\n        elData.props.className = (elData.props?.className ?? '') + ' flex gap-2 flex-col md:flex-row';\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement('div', elData.props, this.renderFromTemplate(elData.columns));\n        // removed by dead control flow\n\n      case 'form.column':\n        if (!elData.props) elData.props = {};\n        elData.props.className = (elData.props?.className ?? '') + ' w-full flex gap-2 flex-col';\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement('div', elData.props, this.renderFromTemplate(elData.items));\n        // removed by dead control flow\n\n      case 'form.text':\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, elData);\n        // removed by dead control flow\n\n      case 'form.divider':\n        return this.divider(elData.text);\n        // removed by dead control flow\n\n      case 'form.input':\n        return this.inputWrapper(elData.input);\n        // removed by dead control flow\n\n      default:\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, \"Unknown element renderer: \", elRenderer);\n        // removed by dead control flow\n\n    }\n  }\n  renderFromTemplate(template) {\n    let content = [];\n    Object.keys(template).map(elDefinition => {\n      let tmp = elDefinition.split('#');\n      let elRenderer = tmp[0] ?? '';\n      let elId = tmp[1] ?? '';\n      let elData = template[elDefinition] ?? null;\n      content.push(this.renderTemplateElement(elRenderer, {\n        elId,\n        ...elData\n      }));\n    });\n    return content;\n  }\n  renderTab(tab) {\n    let template = {};\n    console.log('rentab', tab);\n    if (this.state.description?.ui?.templateJson) {\n      try {\n        template = JSON.parse(this.state.description?.ui?.templateJson);\n      } catch (ex) {\n        console.error('Failed to render form from template.');\n        console.error(this.state.description?.ui?.templateJson);\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, \"Failed to render form from template. Check console for more details.\");\n      }\n    } else {\n      template = null;\n    }\n    let tabTemplate = template && template.tabs && template.tabs[tab] ? template.tabs[tab] : null;\n    if (tab == 'default' && !tabTemplate) {\n      let tabInputs = {};\n      Object.keys(this.state.description?.inputs ?? {}).map(inputName => {\n        tabInputs['form.input#' + inputName] = {\n          input: inputName\n        };\n      });\n      tabTemplate = {\n        'form.column': {\n          items: tabInputs\n        }\n      };\n    }\n    if (!tabTemplate) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    } else {\n      //@ts-ignore\n      return this.renderFromTemplate(tabTemplate);\n    }\n  }\n\n  /**\r\n   * Render content\r\n   */\n  renderContent() {\n    let tabs = this.state.tabs ?? [];\n    let tabUid = this.state.activeTabUid ?? '';\n    if (tabUid == '') tabUid = 'default';\n    let mainTabUid = tabUid.split('.')[0] ?? '';\n    if (mainTabUid == '') mainTabUid = 'default';\n    let mainTab = tabs.filter(t => t['uid'] == mainTabUid)[0] ?? null;\n\n    // console.log('mainTab', mainTab, mainTab?.subTabs);\n    let subTabUid = tabUid.split('.')[1] ?? (mainTab?.subTabs ? mainTab?.subTabs[0]?.uid ?? '' : '');\n    //     // const tabUid = (tab ? tab.uid : 'default');\n    console.log(mainTabUid, mainTab);\n    // if (!mainTab) return null;\n\n    if (mainTab && typeof mainTab.onRender === 'function') {\n      const tabContent = mainTab.onRender(this);\n      return tabContent;\n    } else {\n      const tabContent = this.renderTab(mainTabUid + (subTabUid ? '.' + subTabUid : ''));\n      if (mainTab && mainTab.subTabs && mainTab.subTabs.length > 0) {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"flex h-full gap-2\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"btn-group vertical flex-1\"\n        }, mainTab.subTabs.map((subTab, index) => {\n          return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n            key: index,\n            className: 'btn ' + (subTab.uid == subTabUid ? 'btn-primary' : subTab.cssClass ?? 'btn-transparent'),\n            onClick: () => {\n              console.log('subTab', subTab);\n              this.setState({\n                activeTab: index,\n                activeTabUid: mainTab.uid + '.' + subTab.uid\n              }, () => {\n                this.onTabChange();\n              });\n            }\n          }, subTab.icon ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n            className: \"icon\"\n          }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n            className: subTab.icon\n          })) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n            className: \"text text-nowrap\"\n          }, subTab.title));\n        })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"flex-5\"\n        }, tabContent));\n      } else {\n        return tabContent;\n      }\n    }\n  }\n  getInputProps(inputName, customInputProps) {\n    const originalRecord = this.state.originalRecord ?? {};\n    const record = this.state.record ?? {};\n    const inputs = this.state.description?.inputs ?? {};\n    const inputDescription = inputs[inputName] ?? {};\n    const formDescription = this.state.description;\n    const inputType = inputDescription.type ?? '';\n    const enumValues = inputDescription.enumValues;\n    const lastIndexOfBackslash = this.props.model.lastIndexOf('/');\n    const rawModelName = this.props.model.substring(lastIndexOfBackslash + 1);\n    const modelInputName = rawModelName + '.' + inputName;\n    const invalid = Array.isArray(this.state.invalidInputs) ? this.state.invalidInputs.some(v => String(v.name).toLowerCase() === String(modelInputName).toLowerCase() && v.id === (this.state.record.id ?? -1)) : false;\n\n    // let customInputPropsWithoutOnchange = customInputProps;\n    // delete customInputPropsWithoutOnchange.onChange;\n\n    if (!customInputProps) customInputProps = {};\n    let value = null;\n    if (this.state.updatingRecord) value = record[inputName];else value = record[inputName] ?? (formDescription.defaultValues ? formDescription.defaultValues[inputName] : null);\n    if (!customInputProps.wrapperCssClass && (['boolean', 'date', 'datetime', 'decimal'].indexOf(inputType) >= 0 || inputType == 'int' && !enumValues)) {\n      customInputProps.wrapperCssClass = 'flex gap-2';\n    }\n    return {\n      inputName: inputName,\n      inputClassName: '',\n      record: record,\n      description: inputDescription,\n      value: value,\n      cssClass: inputs[inputName]?.cssClass,\n      readonly: this.props.readonly || inputs[inputName]?.readonly || inputs[inputName]?.disabled,\n      uid: this.props.uid + '_' + uuid__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\n      parentForm: this,\n      context: this.props.context ? this.props.context : this.props.uid,\n      isModified: record[inputName] !== originalRecord[inputName],\n      isInitialized: false,\n      isInlineEditing: this.state.isInlineEditing,\n      showInlineEditingButtons: false,\n      // !this.state.isInlineEditing,\n      invalid: invalid,\n      ...inputs[inputName]?.inputProps,\n      ...customInputProps,\n      onInlineEditCancel: () => {},\n      onInlineEditSave: () => {\n        this.saveRecord();\n      },\n      onChange: (input, value) => {\n        let record = {\n          ...this.state.record\n        };\n        if (value === '') value = null;\n        record[inputName] = value;\n        this.setState({\n          record: record,\n          recordChanged: JSON.stringify(this.state.originalRecord) !== JSON.stringify(record),\n          savedSuccessfully: false\n        }, () => {\n          if (this.props.onChange) this.props.onChange(input, value);\n          if (customInputProps && customInputProps.onChange) customInputProps.onChange(input, value);\n        });\n      }\n    };\n  }\n\n  /**\r\n   * Render different input types\r\n   */\n  input(inputName, customInputProps) {\n    const inputProps = this.getInputProps(inputName, customInputProps);\n    return (0,_InputFactory__WEBPACK_IMPORTED_MODULE_7__.InputFactory)(inputProps);\n  }\n  inputWrapper(inputName, customInputProps) {\n    const inputProps = this.getInputProps(inputName, customInputProps);\n    return this.inputWrapperCustom(inputName, inputProps, inputProps.description?.title ?? '', /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.input(inputName, customInputProps), inputProps.description?.info ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_tooltip__WEBPACK_IMPORTED_MODULE_3__.Tooltip, {\n      target: '#' + this.props.uid + '_' + inputName + ' .input-info'\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"input-info fas fa-info\",\n      \"data-pr-tooltip\": inputProps.description.info,\n      \"data-pr-position\": \"top\"\n    })) : null));\n  }\n  inputWrapperCustom(inputName, inputProps, label, body) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      id: this.props.uid + '_' + inputName,\n      className: \"input-wrapper\" + (inputProps.wrapperCssClass ? \" \" + inputProps.wrapperCssClass : \"\") + (inputProps.description?.required == true ? \" required\" : \"\") + (inputProps.isModified == true ? \" modified\" : \"\"),\n      key: inputName\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"label\", {\n      className: \"input-label\",\n      htmlFor: this.props.uid + '_' + inputName\n    }, label), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"input-body\",\n      key: inputName\n    }, inputProps.description?.icon ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"input-icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: inputProps.description?.icon\n    })) : null, body), inputProps.description?.description ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"input-description\"\n    }, inputProps.description?.description) : null));\n  }\n  divider(content) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"divider\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, content))));\n  }\n  renderHeaderButtons() {\n    const headerButtons = Form.getFormHeaderButtons(this.constructor.name);\n    if (headerButtons && headerButtons.length > 0) {\n      return headerButtons.map((button, key) => {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n          key: key,\n          className: \"btn btn-small btn-primary-outline\",\n          onClick: () => {\n            button.onClick(this);\n          }\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"text\"\n        }, button.title));\n      });\n    } else {\n      return null;\n    }\n  }\n  renderFooterButtons() {\n    const footerButtons = Form.getFormFooterButtons(this.constructor.name);\n    if (footerButtons && footerButtons.length > 0) {\n      return footerButtons.map((button, key) => {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n          key: key,\n          className: \"btn btn-primary\",\n          onClick: () => {\n            button.onClick(this);\n          }\n        }, button.icon == '' ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"icon\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n          className: button.icon\n        })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"text\"\n        }, button.title));\n      });\n    } else {\n      return null;\n    }\n  }\n  renderSaveButton() {\n    let showButton = this.state.description?.ui?.showSaveButton && (this.state.creatingRecord && this.state.permissions.canCreate || this.state.updatingRecord && this.state.permissions.canUpdate);\n    const saveIcon = \"fas \" + (this.state.savedSuccessfully ? \"fa-check\" : \"fa-save\");\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, showButton ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      onClick: e => {\n        if (!e.isFromDropdownMenu) this.saveRecord({\n          closeAfterSave: false\n        });\n      },\n      className: \"btn \" + (this.state.recordChanged ? this.state.savedSuccessfully ? \"btn-success\" : \"btn-add\" : \"btn-disabled\")\n    }, this.state.updatingRecord ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: saveIcon\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"shortcut\"\n    }, \"Ctrl+S\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, this.state.savedSuccessfully ? this.translate(\"Saved\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Form') : this.state.description?.ui?.saveButtonText ?? this.translate(\"Save\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Form'))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-plus\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"shortcut\"\n    }, \"Ctrl+S\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, this.state.description?.ui?.addButtonText ?? this.translate(\"Add\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Form'))))) : null);\n  }\n  renderCopyButton() {\n    let id = this.state.id ? this.state.id : 0;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.state.updatingRecord && this.state.description?.ui?.showCopyButton && this.state.permissions.canCreate ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      onClick: () => this.copyRecord(),\n      className: \"btn btn-transparent\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-save\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, \" \", this.state.description?.ui?.copyButtonText ?? this.translate(\"Copy\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Form'))) : null);\n  }\n  renderDeleteButton() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.state.updatingRecord && this.state.description?.ui?.showDeleteButton && this.state.permissions.canDelete ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      onClick: () => {\n        if (!this.state.deleteButtonDisabled) {\n          if (this.state.deletingRecord) this.deleteRecord();else {\n            this.setState({\n              deletingRecord: true,\n              deleteButtonDisabled: true\n            });\n            setTimeout(() => this.setState({\n              deleteButtonDisabled: false\n            }), 1000);\n          }\n        }\n      },\n      className: \"btn \" + (this.state.deletingRecord ? \"font-bold\" : \"\") + \" \" + (this.state.deleteButtonDisabled ? \"btn-light\" : \"btn-delete\") + \" hidden md:flex\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-trash-alt\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text text-nowrap\"\n    }, this.state.deletingRecord ? this.translate(\"Confirm delete\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Form') : this.state.description?.ui?.deleteButtonText ?? this.translate(\"Delete\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Form'))) : null);\n  }\n  renderPrevRecordButton() {\n    const prevId = this.state?.prevId ?? 0;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      onClick: () => {\n        this.openPrevRecord();\n      },\n      className: \"btn btn-transparent\" + (prevId ? \"\" : \" btn-disabled\")\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-angle-left\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"shortcut\"\n    }, \"Ctrl+Shift+PgUp\"));\n  }\n  renderNextRecordButton() {\n    const nextId = this.state?.nextId ?? 0;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      onClick: () => {\n        this.openNextRecord();\n      },\n      className: \"btn btn-transparent\" + (nextId ? \"\" : \" btn-disabled\")\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-angle-right\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"shortcut\"\n    }, \"Ctrl+Shift+PgDn\"));\n  }\n  renderEditButton() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.state.permissions.canUpdate ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      onClick: () => this.setState({\n        isInlineEditing: true\n      }),\n      className: \"btn btn-edit\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-pencil-alt\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, this.translate('Edit', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Form'))) : null);\n  }\n  renderFullscreenButton() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-transparent hidden md:block\",\n      type: \"button\",\n      \"aria-label\": \"Fullscreen\",\n      onClick: () => {\n        this.setState({\n          isFullscreen: !this.state.isFullscreen\n        });\n        this.props.modal.current.setState({\n          isFullscreen: !this.props.modal.current.state.isFullscreen\n        });\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-\" + (this.state.isFullscreen ? \"compress\" : \"expand\")\n    })));\n  }\n  renderCloseButton() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-close\",\n      type: \"button\",\n      \"data-dismiss\": \"modal\",\n      \"aria-label\": \"Close\",\n      onClick: () => {\n        this.closeForm();\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-xmark\"\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"shortcut\"\n    }, \"Esc\")));\n  }\n  renderHeaderLeft() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.state.isInlineEditing ? this.renderSaveButton() : this.renderEditButton());\n  }\n  renderHeaderRight() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.props.modal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.renderFullscreenButton(), this.renderCloseButton()) : null);\n  }\n  renderFooter() {\n    const prevId = this.state?.prevId ?? 0;\n    const nextId = this.state?.nextId ?? 0;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex gap-2 w-full\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, prevId || nextId ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"pr-4\"\n    }, this.renderPrevRecordButton(), this.renderNextRecordButton()) : null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, this.renderDeleteButton()));\n  }\n  renderSubTitle() {\n    let subTitle = this.state.description?.ui?.subTitle;\n    if (subTitle) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"small\", null, subTitle);\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n  renderTitle() {\n    let title = this.state.description?.ui?.title ?? (this.state.updatingRecord ? this.translate('Record', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Form') + ' #' + (this.state.record?.id ?? '-') : this.translate('New record', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Form'));\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", null, title), this.renderSubTitle());\n  }\n  renderWarningsOrErrors() {\n    if (this.state.recordDeleted) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"alert alert-danger m-1\"\n      }, \"Record has been deleted.\"));\n    }\n    if (!this.state.isInitialized || !this.state.record) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"p-4 h-full flex items-center\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_progressbar__WEBPACK_IMPORTED_MODULE_2__.ProgressBar, {\n        mode: \"indeterminate\",\n        style: {\n          flex: 1,\n          height: '30px'\n        }\n      }));\n    }\n    if (this.state.invalidRecordId) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"alert alert-danger m-1\"\n      }, \"Unable to load record.\"));\n    }\n    return null;\n  }\n  renderErrorAlert(message) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"alert alert-danger m-1\"\n    }, message ?? \"An error occured while performing the last operation.\"));\n  }\n  renderSaveErrorMessage() {\n    return this.state.saveError && this.state.saveError.message ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"text-white bg-red-300 p-2\"\n    }, this.state.saveError.message) : null;\n  }\n  render() {\n    if (this.state.loadRecordError) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"alert alert-danger m-4\"\n      }, \"Unable to load record. Check your permissions or contact administrator.\"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"m-4\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"code\", null, this.state.loadRecordError.message)));\n    } else {\n      try {\n        globalThis.hubleto.setTranslationContext(this.translationContext);\n        const warningsOrErrors = this.renderWarningsOrErrors();\n        const saveErrorMessage = this.renderSaveErrorMessage();\n        const formTitle = this.renderTitle();\n        const formContentClassName = this.contentClassName();\n        const formContent = warningsOrErrors ? warningsOrErrors : this.renderContent();\n        const formFooter = this.renderFooter();\n        const formTopMenu = this.state.isInitialized ? this.renderTopMenu() : null;\n        const headerLeft = warningsOrErrors ? null : this.renderHeaderLeft();\n        const headerRight = warningsOrErrors ? this.renderCloseButton() : this.renderHeaderRight();\n        const headerButtons = this.renderHeaderButtons();\n        const footerButtons = this.renderFooterButtons();\n        if (this.props.modal && this.props.modal.current) {\n          return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"modal-header \" + (this.props.modal.current.state.isActive ? \"active\" : \"\") + \" \" + this.state.description?.ui?.headerClassName\n          }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"modal-header-left\"\n          }, headerLeft), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"modal-header-title\"\n          }, formTitle), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"modal-header-right\"\n          }, headerRight)), headerButtons ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"modal-header-buttons\"\n          }, headerButtons) : null, saveErrorMessage, formTopMenu ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"modal-top-menu\"\n          }, formTopMenu) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"modal-body \" + formContentClassName\n          }, formContent), footerButtons ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"modal-footer-buttons\"\n          }, footerButtons) : null, formFooter ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"modal-footer\"\n          }, formFooter) : null);\n        } else {\n          return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            id: \"hubleto-form-\" + this.props.uid,\n            className: \"hubleto component form\"\n          }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"form-header\"\n          }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"form-header-left\"\n          }, headerLeft), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"form-header-title\"\n          }, formTitle), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"form-header-right\"\n          }, headerRight)), saveErrorMessage, formTopMenu ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"form-top-menu\"\n          }, formTopMenu) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"form-body\" + formContentClassName\n          }, formContent), formFooter ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"form-footer\"\n          }, formFooter) : null));\n        }\n      } catch (e) {\n        console.error('Failed to render form.');\n        console.error(e);\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"alert alert-danger\"\n        }, \"Failed to render form. Check console for error log.\");\n      }\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Form.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/FormInput.tsx":
/*!**************************************!*\
  !*** ../react-ui/core/FormInput.tsx ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ FormInput)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var primereact_tooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! primereact/tooltip */ \"../react-ui/node_modules/primereact/tooltip/tooltip.esm.js\");\n\n\n\nclass FormInput extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      uid: uuid__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\n      title: this.props.title,\n      description: this.props.description ?? '',\n      required: this.props.required ?? false\n    };\n  }\n  render() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      id: this.state.uid,\n      className: \"input-wrapper\" + (this.state.required == true ? \" required\" : \"\"),\n      key: this.state.uid\n    }, this.state.title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"label\", {\n      className: \"input-label\",\n      htmlFor: this.state.uid\n    }, this.state.title) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"input-body\",\n      key: this.state.uid\n    }, this.props.children), this.state.description ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_tooltip__WEBPACK_IMPORTED_MODULE_2__.Tooltip, {\n      target: '#' + this.state.uid + ' .input-description'\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"input-description fas fa-info\",\n      \"data-pr-tooltip\": this.state.description,\n      \"data-pr-position\": \"top\"\n    })) : null));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/FormInput.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Helper.tsx":
/*!***********************************!*\
  !*** ../react-ui/core/Helper.tsx ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   camelToKebab: () => (/* binding */ camelToKebab),\n/* harmony export */   capitalizeFirstLetter: () => (/* binding */ capitalizeFirstLetter),\n/* harmony export */   dateToString: () => (/* binding */ dateToString),\n/* harmony export */   deepObjectMerge: () => (/* binding */ deepObjectMerge),\n/* harmony export */   deleteUrlParam: () => (/* binding */ deleteUrlParam),\n/* harmony export */   errorJsx: () => (/* binding */ errorJsx),\n/* harmony export */   getUrlParam: () => (/* binding */ getUrlParam),\n/* harmony export */   isValidJson: () => (/* binding */ isValidJson),\n/* harmony export */   kebabToCamel: () => (/* binding */ kebabToCamel),\n/* harmony export */   kebabToPascal: () => (/* binding */ kebabToPascal),\n/* harmony export */   numberToStringTime: () => (/* binding */ numberToStringTime),\n/* harmony export */   setUrlParam: () => (/* binding */ setUrlParam)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction setUrlParam(paramName, paramValue) {\n  const qs = __webpack_require__(/*! qs */ \"./node_modules/qs/lib/index.js\");\n  const urlParams = qs.parse(window.location.search.substr(1));\n  urlParams[paramName] = paramValue;\n  window.history.pushState({}, \"\", '?' + qs.stringify(urlParams, {\n    arrayFormat: 'brackets'\n  }));\n}\nfunction getUrlParam(paramName) {\n  const urlParams = new URLSearchParams(window.location.search);\n  return urlParams.has(paramName) ? urlParams.get(paramName) : null;\n}\nfunction deleteUrlParam(paramName) {\n  const urlParams = new URLSearchParams(window.location.search);\n  urlParams.delete(paramName);\n  if (Array.from(urlParams).length == 0) {\n    history.pushState({}, '', location.protocol + \"//\" + location.host + location.pathname);\n  } else {\n    window.history.pushState({}, \"\", '?' + urlParams.toString());\n  }\n}\nfunction deepObjectMerge(target, source) {\n  let result = target;\n  for (const key in source) {\n    if (source[key] instanceof Object) {\n      if (!(result[key] instanceof Object)) {\n        result[key] = source[key];\n      } else {\n        result[key] = deepObjectMerge(result[key], source[key]);\n      }\n    } else {\n      result[key] = source[key]; // target will be overwritten by source\n    }\n  }\n\n  // for (const key in source) {\n  //   if (target[key] == undefined) {\n  //     result[key] = source[key]; // target will be overwritten by source\n  //   }\n  // }\n\n  return result;\n}\nfunction errorJsx(message) {\n  console.error('HubletoReactUi: ' + message);\n  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n    className: \"alert alert-danger\",\n    role: \"alert\"\n  }, message);\n}\nfunction dateToString(date) {\n  return `${date.getDate()}.${date.getMonth() + 1}.${date.getFullYear()}`;\n}\nfunction numberToStringTime(number) {\n  return String(number).padStart(2, '0');\n}\n\n/**\r\n * Validate string if it is JSON\r\n */\nfunction isValidJson(jsonString) {\n  try {\n    let tmp = JSON.parse(jsonString);\n    if (tmp && typeof tmp === \"object\") {\n      return true;\n    } else {\n      return false;\n    }\n  } catch (error) {\n    return false;\n  }\n}\nfunction capitalizeFirstLetter(s) {\n  return s.charAt(0).toUpperCase() + s.slice(1);\n}\n;\nfunction kebabToCamel(s) {\n  return s.replace(/-./g, x => x[1].toUpperCase());\n}\n;\nfunction kebabToPascal(s) {\n  return capitalizeFirstLetter(kebabToCamel(s));\n}\n;\nfunction camelToKebab(s) {\n  return s.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? \"-\" : \"\") + $.toLowerCase());\n}\n\n//# sourceURL=webpack:///../react-ui/core/Helper.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/HtmlFrame.tsx":
/*!**************************************!*\
  !*** ../react-ui/core/HtmlFrame.tsx ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ HtmlFrame)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nclass HtmlFrame extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n  render() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"iframe\", {\n      src: \"about:blank\",\n      className: this.props.className,\n      srcDoc: this.props.content,\n      id: this.props.iframeId\n    }));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/HtmlFrame.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Input.tsx":
/*!**********************************!*\
  !*** ../react-ui/core/Input.tsx ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   Input: () => (/* binding */ Input)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var _TranslatedComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TranslatedComponent */ \"../react-ui/core/TranslatedComponent.tsx\");\n\n\n\nclass Input extends _TranslatedComponent__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n  static defaultProps = {\n    inputClassName: '',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_1__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.refInputWrapper = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n    this.refInputElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n    this.refValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n    this.refInput = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n    globalThis.hubleto.reactElements[this.props.uid] = this;\n    const isModified = props.isModified ?? false;\n    const isInitialized = props.isInitialized ?? false;\n    const isInlineEditing = props.isInlineEditing ?? true;\n    const showInlineEditingButtons = props.showInlineEditingButtons ?? false;\n    const readonly = props.readonly ?? false;\n    const invalid = props.invalid ?? false;\n    const value = props.value;\n    const onChange = props.onChange ?? null;\n    const onInit = props.onInit ?? null;\n    const cssClass = props.cssClass ?? '';\n    const cssStyle = props.cssStyle ?? {};\n    const description = props.description ?? null;\n    this.state = {\n      isModified: isModified,\n      isInitialized: isInitialized,\n      isInlineEditing: isInlineEditing,\n      showInlineEditingButtons: showInlineEditingButtons,\n      readonly: readonly,\n      invalid: invalid,\n      value: value,\n      origValue: value,\n      onChange: onChange,\n      onInit: onInit,\n      cssClass: cssClass,\n      cssStyle: cssStyle,\n      description: description\n    };\n  }\n  componentDidMount() {\n    if (this.props.parentForm && this.props.inputName) {\n      this.props.parentForm.inputs[this.props.inputName.toString()] = this;\n      if (this.state.onInit) this.state.onInit(this);\n    }\n  }\n  componentDidUpdate(prevProps) {\n    let newState = {};\n    let setNewState = false;\n    if (this.props.isInitialized != prevProps.isInitialized) {\n      newState.isInitialized = this.props.isInitialized;\n      setNewState = true;\n    }\n    if (this.props.isInlineEditing != prevProps.isInlineEditing) {\n      newState.isInlineEditing = this.props.isInlineEditing;\n      setNewState = true;\n    }\n    if (this.props.showInlineEditingButtons != prevProps.showInlineEditingButtons) {\n      newState.showInlineEditingButtons = this.props.showInlineEditingButtons;\n      setNewState = true;\n    }\n    if (this.props.value != prevProps.value) {\n      newState.value = this.props.value;\n      setNewState = true;\n    }\n    if (this.props.cssClass != prevProps.cssClass) {\n      newState.cssClass = this.props.cssClass;\n      setNewState = true;\n    }\n    if (this.props.readonly != prevProps.readonly) {\n      newState.readonly = this.props.readonly;\n      setNewState = true;\n    }\n    if (this.props.invalid != prevProps.invalid) {\n      newState.invalid = this.props.invalid;\n      setNewState = true;\n    }\n    if (this.props.description != prevProps.description) {\n      newState.description = this.props.description;\n      setNewState = true;\n    }\n    if (this.props.invalid != prevProps.invalid) {\n      newState.invalid = this.props.invalid;\n      setNewState = true;\n    }\n    if (setNewState) {\n      this.setState(newState);\n    }\n  }\n  getClassName() {\n    return \"hubleto component input\" + \" \" + this.props.inputClassName + \" \" + (this.state.cssClass ?? \"\") + \" \" + (this.state.invalid ? 'invalid' : '') + \" \" + (this.state.readonly ? \"bg-muted\" : \"\") + \" \" + (this.state.isInlineEditing ? 'editing' : '') + \" \" + (this.state.isModified ? 'modified' : '');\n  }\n  onChange(value) {\n    if (typeof this.props.onChange == 'function') {\n      this.setState({\n        invalid: false,\n        value: value\n      }, () => {\n        if (typeof this.props.onChange == 'function') {\n          this.props.onChange(this, value);\n        }\n      });\n    } else {\n      this.setState({\n        invalid: false,\n        value: value\n      });\n    }\n  }\n  serialize() {\n    return this.state.value ? this.state.value.toString() : '';\n  }\n  inlineEditEnable() {\n    if (!this.state.readonly) {\n      this.setState({\n        origValue: this.state.value,\n        isInlineEditing: true\n      }, () => {\n        if (this.props.parentForm) {\n          this.props.parentForm.setState({\n            isInlineEditing: true\n          });\n        }\n      });\n    }\n  }\n  inlineEditSave() {\n    this.setState({\n      origValue: this.state.value,\n      isInlineEditing: false\n    }, () => {\n      if (this.props.onInlineEditSave) {\n        this.props.onInlineEditSave();\n      }\n    });\n  }\n  inlineEditCancel() {\n    this.setState({\n      value: this.state.origValue,\n      isInlineEditing: false\n    }, () => {\n      this.onChange(this.state.origValue);\n      if (this.props.onInlineEditCancel) {\n        this.props.onInlineEditCancel();\n      }\n    });\n  }\n  renderLoadingInfo() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"badge badge-warning\"\n    }, \"[loading]\");\n  }\n  renderInputElement() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n      type: \"text\",\n      value: this.state.value ?? '',\n      readOnly: this.state.readonly,\n      ref: this.refInput\n    });\n  }\n  renderValueElement() {\n    let value = (this.state.value ?? '') + '';\n    if (value == '') return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"no-value\"\n    });else return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, this.state.value.toString());\n  }\n  render() {\n    if (!this.state.isInitialized) return this.renderLoadingInfo();\n    try {\n      globalThis.hubleto.setTranslationContext(this.translationContext);\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        ref: this.refInputWrapper,\n        className: this.getClassName()\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"inner\"\n      }, this.state.isInlineEditing ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n        id: this.props.uid,\n        name: this.props.uid,\n        type: \"hidden\",\n        value: this.serialize(),\n        style: {\n          width: \"100%\",\n          fontSize: \"0.4em\"\n        },\n        className: \"value bg-light\",\n        readOnly: true\n      }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        ref: this.refInputElement,\n        className: \"input-element\"\n      }, this.renderInputElement(), this.props.description?.unit ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"input-unit\"\n      }, this.props.description.unit) : null), this.state.showInlineEditingButtons ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"inline-editing-buttons always-visible\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n        className: \"btn btn-success-outline\",\n        onClick: () => {\n          this.inlineEditSave();\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon !py-0\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-check\"\n      }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n        className: \"btn btn-cancel-outline\",\n        onClick: () => {\n          this.inlineEditCancel();\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon !py-0\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-times\"\n      })))) : null) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        ref: this.refValueElement,\n        className: \"value-element\",\n        onClick: () => {\n          this.inlineEditEnable();\n        }\n      }, this.renderValueElement(), this.props.description?.unit ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"input-unit\"\n      }, this.props.description.unit) : null))));\n    } catch (e) {\n      const errMsg = 'Failed to render input for ' + (this.props.description?.title ?? this.props.inputName) + '.';\n      console.error(errMsg);\n      console.error(e);\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"alert alert-danger\"\n      }, errMsg, \" Check console for error log.\");\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Input.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/InputFactory.tsx":
/*!*****************************************!*\
  !*** ../react-ui/core/InputFactory.tsx ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   InputFactory: () => (/* binding */ InputFactory)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Inputs_Lookup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Inputs/Lookup */ \"../react-ui/core/Inputs/Lookup.tsx\");\n/* harmony import */ var _Inputs_Varchar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Inputs/Varchar */ \"../react-ui/core/Inputs/Varchar.tsx\");\n/* harmony import */ var _Inputs_Password__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Inputs/Password */ \"../react-ui/core/Inputs/Password.tsx\");\n/* harmony import */ var _Inputs_Textarea__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Inputs/Textarea */ \"../react-ui/core/Inputs/Textarea.tsx\");\n/* harmony import */ var _Inputs_Int__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Inputs/Int */ \"../react-ui/core/Inputs/Int.tsx\");\n/* harmony import */ var _Inputs_Boolean__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Inputs/Boolean */ \"../react-ui/core/Inputs/Boolean.tsx\");\n/* harmony import */ var _Inputs_Color__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Inputs/Color */ \"../react-ui/core/Inputs/Color.tsx\");\n/* harmony import */ var _Inputs_File__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Inputs/File */ \"../react-ui/core/Inputs/File.tsx\");\n/* harmony import */ var _Inputs_Image__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Inputs/Image */ \"../react-ui/core/Inputs/Image.tsx\");\n/* harmony import */ var _Inputs_Tags__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Inputs/Tags */ \"../react-ui/core/Inputs/Tags.tsx\");\n/* harmony import */ var _Inputs_DateTime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Inputs/DateTime */ \"../react-ui/core/Inputs/DateTime.tsx\");\n/* harmony import */ var _Inputs_EnumValues__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Inputs/EnumValues */ \"../react-ui/core/Inputs/EnumValues.tsx\");\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n\n\n// import ReactQuill, {Value} from 'react-quill';\n// import 'react-quill/dist/quill.snow.css';\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction InputFactory(inputProps) {\n  let inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n  let description = inputProps.description;\n  if (!description) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"alert alert-warning\"\n    }, \"No description for input [\", inputProps.inputName, \"]. Check console for error log.\");\n  }\n  try {\n    if (description.enumValues) {\n      inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_EnumValues__WEBPACK_IMPORTED_MODULE_12__[\"default\"], _extends({}, inputProps, {\n        enumValues: description.enumValues,\n        enumCssClasses: description.enumCssClasses\n      }));\n    } else {\n      if (typeof description.reactComponent === 'string' && description.reactComponent !== '') {\n        inputToRender = globalThis.hubleto.renderReactElement(description.reactComponent, inputProps) ?? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n      } else {\n        switch (description.type ?? '') {\n          case 'varchar':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Varchar__WEBPACK_IMPORTED_MODULE_2__[\"default\"], inputProps);\n            break;\n          case 'password':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Password__WEBPACK_IMPORTED_MODULE_3__[\"default\"], inputProps);\n            break;\n          case 'text':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Textarea__WEBPACK_IMPORTED_MODULE_4__[\"default\"], inputProps);\n            break;\n          case 'json':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Textarea__WEBPACK_IMPORTED_MODULE_4__[\"default\"], inputProps);\n            break;\n          case 'decimal':\n          case 'int':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Int__WEBPACK_IMPORTED_MODULE_5__[\"default\"], inputProps);\n            break;\n          case 'boolean':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Boolean__WEBPACK_IMPORTED_MODULE_6__[\"default\"], inputProps);\n            break;\n          case 'lookup':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Lookup__WEBPACK_IMPORTED_MODULE_1__[\"default\"], inputProps);\n            break;\n          case 'color':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Color__WEBPACK_IMPORTED_MODULE_7__[\"default\"], inputProps);\n            break;\n          case 'tags':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Tags__WEBPACK_IMPORTED_MODULE_10__[\"default\"], _extends({}, inputProps, {\n              model: description.model,\n              recordId: inputProps.record.id\n            }));\n            break;\n          case 'file':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_File__WEBPACK_IMPORTED_MODULE_8__[\"default\"], inputProps);\n            break;\n          case 'image':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Image__WEBPACK_IMPORTED_MODULE_9__[\"default\"], inputProps);\n            break;\n          case 'datetime':\n          case 'date':\n          case 'time':\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_DateTime__WEBPACK_IMPORTED_MODULE_11__[\"default\"], _extends({}, inputProps, {\n              type: description.type\n            }));\n            break;\n          default:\n            inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Inputs_Varchar__WEBPACK_IMPORTED_MODULE_2__[\"default\"], inputProps);\n        }\n      }\n    }\n  } catch (e) {\n    inputToRender = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"alert alert-danger\"\n    }, \"Failed to initialize input [\", inputProps.inputName, \"]. Check console for error log.\");\n    console.error('Failed to initialize input for ' + inputProps.inputName);\n    console.error(e);\n  }\n  return inputToRender;\n}\n\n//# sourceURL=webpack:///../react-ui/core/InputFactory.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Boolean.tsx":
/*!*******************************************!*\
  !*** ../react-ui/core/Inputs/Boolean.tsx ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Boolean)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var primereact_inputswitch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! primereact/inputswitch */ \"../react-ui/node_modules/primereact/inputswitch/inputswitch.esm.js\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\n\nclass Boolean extends _Input__WEBPACK_IMPORTED_MODULE_1__.Input {\n  static defaultProps = {\n    inputClassName: 'boolean',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.state = this.getStateFromProps(props);\n  }\n  getStateFromProps(props) {\n    return {\n      ...this.state,\n      // Parent state\n      isInitialized: true\n    };\n  }\n  toggleValue(value) {\n    if (value == 1) return 0;else if (value == '1') return '0';else if (value == 'Y') return 'N';else if (value == 'true') return 'false';else if (value == true) return false;else if (value == 0) return 1;else if (value == '0') return '1';else if (value == 'N') return 'Y';else if (value == 'false') return 'true';else if (value == false) return true;else if (value == null) return true;else if (value == '') return true;\n  }\n  isChecked(value) {\n    return value == '1' || value == 'Y' || value > 0 || value == 'true' || value === true;\n  }\n  renderValueElement() {\n    if (this.isChecked(this.state.value)) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"text-green-600\",\n        style: {\n          fontSize: '1.2em'\n        }\n      }, \"\\u2713\");\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"text-red-600\",\n        style: {\n          fontSize: '1.2em'\n        }\n      }, \"\\u2715\");\n    }\n  }\n  renderInputElement() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_inputswitch__WEBPACK_IMPORTED_MODULE_2__.InputSwitch, {\n      disabled: this.state.readonly,\n      checked: this.isChecked(this.state.value),\n      onChange: e => {\n        this.onChange(this.toggleValue(this.state.value));\n      },\n      ref: this.refInput\n    }));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Boolean.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Color.tsx":
/*!*****************************************!*\
  !*** ../react-ui/core/Inputs/Color.tsx ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Color)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _uiw_react_color_compact__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @uiw/react-color-compact */ \"../react-ui/node_modules/@uiw/react-color-compact/esm/index.js\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n\n\n\n\nclass Color extends _Input__WEBPACK_IMPORTED_MODULE_3__.Input {\n  static defaultProps = {\n    inputClassName: 'color',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.state = {\n      ...this.state,\n      // Parent state\n      isInitialized: true,\n      showColorSelector: false\n    };\n  }\n  renderValueElement() {\n    if (this.state.value) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        style: {\n          backgroundColor: this.state.value\n        }\n      }, \"\\xA0\\xA0\\xA0\\xA0\");\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        style: {\n          border: '1px solid #EEEEEE'\n        }\n      }, \"\\xA0\\xA0\\xA0\\xA0\");\n    }\n  }\n  renderInputElement() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex flex-col gap-2 bg-white\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex justify-between items-center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      style: {\n        background: this.state.value\n      },\n      className: \"mr-2 cursor-pointer w-20 h-4 rounded border border-gray-400\",\n      onClick: () => {\n        this.setState({\n          showColorSelector: !this.state.showColorSelector\n        });\n      }\n    }), this.state.showColorSelector && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-transparent\",\n      onClick: () => this.setState({\n        showColorSelector: !this.state.showColorSelector\n      })\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-times\"\n    }))), this.state.showColorSelector ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"no-scrollbar w-full\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_uiw_react_color_compact__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n      ref: this.refInput,\n      color: this.state.value\n      // style={{\n      //   width: '100%'\n      // }}\n      ,\n      onChange: color => this.onChange(color.hex)\n      // rectRender={(props) => {\n      //   console.log(props.key)\n      //   if (props.key == 35) {\n      //     return <button key={props.key} style={{ width: 15, height: 15, padding: 0, lineHeight: \"10px\" }} onClick={() => setHex(null)}>x</button>\n      //   }\n      // }}\n    })) : null);\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Color.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/DateTime.tsx":
/*!********************************************!*\
  !*** ../react-ui/core/Inputs/DateTime.tsx ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   dateToEUFormat: () => (/* binding */ dateToEUFormat),\n/* harmony export */   datetimeToEUFormat: () => (/* binding */ datetimeToEUFormat),\n/* harmony export */   \"default\": () => (/* binding */ DateTime)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var flatpickr_dist_themes_material_blue_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! flatpickr/dist/themes/material_blue.css */ \"../react-ui/node_modules/flatpickr/dist/themes/material_blue.css\");\n/* harmony import */ var react_flatpickr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-flatpickr */ \"../react-ui/node_modules/react-flatpickr/build/index.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! moment */ \"../react-ui/node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\n\n\n\nconst dateToEUFormat = dateString => {\n  if (!dateString || dateString.length != 10) {\n    return '';\n  } else {\n    let d = new Date(dateString);\n    return ('0' + d.getDate()).slice(-2) + \".\" + ('0' + (d.getMonth() + 1)).slice(-2) + \".\" + d.getFullYear();\n  }\n};\nconst datetimeToEUFormat = dateString => {\n  let d = new Date(dateString);\n  return ('0' + d.getDate()).slice(-2) + \".\" + ('0' + (d.getMonth() + 1)).slice(-2) + \".\" + d.getFullYear() + \" \" + ('0' + d.getHours()).slice(-2) + \":\" + ('0' + d.getMinutes()).slice(-2) + \":\" + ('0' + d.getSeconds()).slice(-2);\n};\nclass DateTime extends _Input__WEBPACK_IMPORTED_MODULE_1__.Input {\n  static defaultProps = {\n    inputClassName: 'datetime',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_5__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_5__[\"default\"]()\n  };\n  options = {\n    allowInput: false,\n    locale: {\n      weekdays: {\n        shorthand: ['Ne.', 'Po.', 'Ut.', 'St.', 'Št.', 'Pi.', 'So.'],\n        longhand: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n      },\n      months: {\n        shorthand: ['Jan', 'Feb', 'Mar', 'Apr', 'Máj', 'Jún', 'Júl', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'],\n        longhand: ['Január', 'Február', 'Marec', 'Apríl', 'Máj', 'Jún', 'Júl', 'August', 'September', 'Október', 'November', 'December']\n      },\n      weekStart: 1\n    }\n  };\n  constructor(props) {\n    super(props);\n    switch (props.type) {\n      case 'datetime':\n        this.options = {\n          ...this.options,\n          enableTime: true,\n          showMonths: 2,\n          dateFormat: 'd.m.Y H:i:S'\n        };\n        break;\n      case 'date':\n        this.options = {\n          ...this.options,\n          showMonths: 2,\n          weekNumbers: true,\n          dateFormat: 'd.m.Y'\n        };\n        break;\n      case 'time':\n        this.options = {\n          ...this.options,\n          ...{\n            dateFormat: 'H:m',\n            enableTime: true,\n            noCalendar: true,\n            time_24hr: true,\n            minuteIncrement: 15,\n            showMonths: 2\n          }\n        };\n        break;\n    }\n    this.state = this.getStateFromProps(props);\n  }\n  getStateFromProps(props) {\n    return {\n      ...this.state,\n      // Parent state\n      isInitialized: true\n    };\n  }\n  onChange(value) {\n    if (value === null) {\n      value = '';\n    } else if (value != '') {\n      switch (this.props.type) {\n        case 'datetime':\n          value = moment__WEBPACK_IMPORTED_MODULE_4___default()(value).format('YYYY-MM-DD H:mm:s');\n          break;\n        case 'date':\n          value = moment__WEBPACK_IMPORTED_MODULE_4___default()(value).format('YYYY-MM-DD');\n          break;\n        case 'time':\n          value = moment__WEBPACK_IMPORTED_MODULE_4___default()(value).format('HH:mm');\n          break;\n      }\n    }\n    super.onChange(value);\n  }\n  renderReadableInfo(value) {\n    let days = moment__WEBPACK_IMPORTED_MODULE_4___default()(value).diff(moment__WEBPACK_IMPORTED_MODULE_4___default()(), 'days');\n    let info = days < -365 ? \"(more than a year ago)\" : days < -30 * 6 ? \"(more than 6 months ago)\" : days < -30 * 3 ? \"(more than 3 months ago)\" : days < -30 ? \"(more than a month ago)\" : days < -14 ? \"(more than 2 weeks ago)\" : days < -7 ? \"(more than a week ago)\" : days < -1 ? \"(\" + -days + \" days ago)\" : days == -1 ? \"(yesterday)\" : days == 0 ? \"(today)\" : days == 1 ? \"(tomorrow)\" : days > 365 ? \"(in a year)\" : days > 30 * 6 ? \"(in 6-12 months)\" : days > 30 * 3 ? \"(in 3-6 months)\" : days > 30 ? \"(in 1-3 months)\" : days > 14 ? \"(in 2-4 weeks)\" : days > 7 ? \"(in 1-2 weeks)\" : days > 1 ? \"(in \" + days + \" days)\" : \"\";\n    return info == '' ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"text-blue-400\"\n    }, info);\n  }\n  renderValueElement() {\n    let value = this.state.value;\n    let valueFormatted = this.state.value;\n    if (value) {\n      switch (this.props.type) {\n        case 'datetime':\n          valueFormatted = moment__WEBPACK_IMPORTED_MODULE_4___default()(value).format('DD.MM.YYYY H:mm:s');\n          break;\n        case 'date':\n          valueFormatted = moment__WEBPACK_IMPORTED_MODULE_4___default()(value).format('DD.MM.YYYY');\n          break;\n      }\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"flex\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"flex gap-2 items-center\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-calendar-days mr-2\"\n      }), valueFormatted), this.props.showReadable ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"text-xs\"\n      }, this.renderReadableInfo(value)) : null);\n    } else {\n      return super.renderValueElement();\n    }\n  }\n  renderInputElement() {\n    let value = this.state.value;\n    let defaultPlaceholder;\n    let icon = '';\n    switch (this.props.type) {\n      case 'datetime':\n        icon = 'fas fa-clock';\n        value = datetimeToEUFormat(this.state.value);\n        defaultPlaceholder = this.translate('Year-Month-Day Hour:Min:Sec', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\DateTime');\n        break;\n      case 'date':\n        icon = 'fas fa-calendar';\n        value = dateToEUFormat(this.state.value);\n        defaultPlaceholder = this.translate('Year-Month-Day', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\DateTime');\n        break;\n      case 'time':\n        icon = 'fas fa-clock';\n        this.options = {\n          ...this.options,\n          ...{\n            dateFormat: 'H:i',\n            enableTime: true,\n            noCalendar: true,\n            time_24hr: true,\n            minuteIncrement: 15\n          }\n        };\n        defaultPlaceholder = 'Hour:Min:Sec';\n        break;\n    }\n    const readableInfo = this.props.showReadable ? this.renderReadableInfo(this.state.value) : null;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex gap-2\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex gap-2 items-center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: icon\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      style: {\n        minWidth: \"8em\"\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_flatpickr__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n      ref: this.refInput,\n      value: value,\n      onChange: data => {\n        this.onChange(data[0] ?? null);\n      },\n      className: (this.state.invalid ? 'is-invalid' : '') + \" \" + (this.props.cssClass ?? \"\") + \" \" + (this.state.readonly ? \"bg-muted\" : \"\"),\n      placeholder: this.props.description?.placeholder ?? defaultPlaceholder,\n      disabled: this.state.readonly,\n      options: this.options\n    })), readableInfo ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"text-xs\"\n    }, readableInfo) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, this.state.readonly ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-small btn-transparent ml-2\",\n      onClick: () => {\n        if (!this.refInput?.current?.flatpickr) return;\n        this.refInput.current.flatpickr.clear();\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-times\"\n    }))))));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/DateTime.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/EnumValues.tsx":
/*!**********************************************!*\
  !*** ../react-ui/core/Inputs/EnumValues.tsx ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ EnumValues)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\nclass EnumValues extends _Input__WEBPACK_IMPORTED_MODULE_1__.Input {\n  static defaultProps = {\n    inputClassName: 'enumValues',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    uiStyle: 'select'\n  };\n  constructor(props) {\n    super(props);\n    if (props.enumValues && !props.enumValues[this.state.value]) {\n      this.state.value = Object.keys(props.enumValues)[0];\n      if (props.parentForm && props.inputName) {\n        let record = {\n          ...props.parentForm.state.record\n        };\n        record[props.inputName] = this.state.value;\n        props.parentForm.setState({\n          record: record\n        });\n      }\n    }\n    this.state = this.getStateFromProps(props);\n  }\n  getStateFromProps(props) {\n    return {\n      ...this.state,\n      // Parent state\n      isInitialized: true\n    };\n  }\n  _renderOption(key) {\n    if (this.props.enumValues == undefined) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      key: key,\n      value: key\n    }, this.props.enumValues[key] ?? '');\n  }\n  renderValueElement() {\n    let value = this.props.enumValues ? this.props.enumValues[this.state.value] : null;\n    let cssClass = this.props.enumCssClasses ? this.props.enumCssClasses[this.state.value] : null;\n    if (!value) {\n      if (this.props.enumValues) value = this.props.enumValues[Object.keys(this.props.enumValues)[0]];else value = '-';\n    }\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"badge \" + (cssClass ?? '')\n    }, value));\n  }\n  serialize() {\n    if (!this.props.enumValues) return '';\n    if (!this.props.enumValues[this.state.value]) return Object.keys(this.props.enumValues)[0];\n    return '';\n  }\n  renderInputElement() {\n    if (!this.props.enumValues) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    let value = this.state.value ?? null;\n    if (!this.props.enumValues[value]) value = Object.keys(this.props.enumValues)[0];\n    if (this.props.uiStyle == 'select') {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"select\", {\n        ref: this.refInput,\n        value: value,\n        onChange: e => this.onChange(e.target.value),\n        className: \"bg-white\" + \" \" + (this.state.invalid ? 'is-invalid' : '') + \" \" + (this.props.cssClass ?? \"\") + \" \" + (this.state.readonly ? \"bg-muted\" : \"\"),\n        disabled: this.state.readonly\n      }, Object.keys(this.props.enumValues).map(key => this._renderOption(key))));\n    } else if (this.props.uiStyle == 'buttons' || this.props.uiStyle == 'buttons-vertical') {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        ref: this.refInput,\n        className: \"btn-group gap-1 \" + (this.props.uiStyle == 'buttons-vertical' ? \" flex-col w-full\" : \"\")\n      }, Object.keys(this.props.enumValues).map(key => {\n        const enumValue = this.props.enumValues ? this.props.enumValues[key] ?? '' : '';\n        const enumCssClass = this.props.enumCssClasses ? this.props.enumCssClasses[key] ?? '' : '';\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n          key: key,\n          className: \"btn \" + (this.state.readonly && this.state.value != key ? \"btn-disabled\" : \"\") + \" \" + (this.state.value == key ? \"btn-primary \" + enumCssClass : \"btn-transparent\"),\n          onClick: () => {\n            if (!this.state.readonly) this.onChange(key);\n          }\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"text\"\n        }, enumValue));\n      }));\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/EnumValues.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/File.tsx":
/*!****************************************!*\
  !*** ../react-ui/core/Inputs/File.tsx ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ File)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_images_uploading__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-images-uploading */ \"../react-ui/node_modules/react-images-uploading/dist/index.js\");\n/* harmony import */ var react_images_uploading__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_images_uploading__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n\n\n\n\nclass File extends _Input__WEBPACK_IMPORTED_MODULE_3__.Input {\n  static defaultProps = {\n    inputClassName: 'image',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.state = {\n      ...this.state,\n      // Parent state\n      files: [],\n      isInitialized: true\n    };\n  }\n  onFileChange(files) {\n    let file = files[0];\n    this.onChange({\n      fileName: file ? file.file.name : null,\n      fileData: file ? file.fileData : null,\n      fileSize: file ? parseInt(file.fileSize) : null\n      // fileType: image.file.type\n    });\n    this.setState({\n      files: files\n    });\n  }\n  getFileUrl() {\n    if (this.state.value) {\n      if (this.state.value.fileData) {\n        return this.state.value.fileData;\n      } else if (this.state.value) {\n        return globalThis.hubleto.config.uploadUrl + '/' + this.state.value;\n      } else {\n        return '';\n      }\n    } else {\n      return '';\n    }\n  }\n  getFileName() {\n    if (this.state.value.fileName) {\n      return this.state.value.fileName;\n    } else if (this.state.value) {\n      return this.state.value;\n    } else {\n      return '';\n    }\n  }\n  getFileSize() {\n    if (this.state.value.fileSize) {\n      return this.state.value.fileSize;\n    } else {\n      return 0;\n    }\n  }\n  renderValueElement() {\n    return this.state.value ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n      href: this.getFileUrl(),\n      target: \"_blank\",\n      onClick: e => {\n        e.stopPropagation();\n      },\n      className: \"btn btn-primary-outline btn-small\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fa-solid fa-up-right-from-square\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, this.getFileName()), this.getFileSize() > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, \"(\", Math.round(this.getFileSize() * 100 / 1024) / 100, \" kB)\") : null)) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n  }\n  renderInputElement() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.renderValueElement(), this.state.readonly ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react_images_uploading__WEBPACK_IMPORTED_MODULE_1___default()), {\n      value: this.state.value && this.state.value['fileData'] != null ? [this.state.value] : [],\n      onChange: (files, addUpdateIndex) => this.onFileChange(files),\n      maxNumber: 1,\n      dataURLKey: \"fileData\",\n      acceptType: this.props.acceptType ?? [],\n      allowNonImageType: true\n    }, ({\n      imageList,\n      onImageUpload,\n      onImageUpdate,\n      onImageRemove,\n      isDragging,\n      dragProps\n    }) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"upload__image-wrapper\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", _extends({\n      className: \"btn btn-small btn-transparent\",\n      style: isDragging ? {\n        color: 'red'\n      } : undefined,\n      onClick: onImageUpload\n    }, dragProps), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-cloud-arrow-up\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, this.props.uploadButtonText ?? this.translate(\"Upload file\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\File')))))));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/File.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Hyperlink.tsx":
/*!*********************************************!*\
  !*** ../react-ui/core/Inputs/Hyperlink.tsx ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Hyperlink)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Varchar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Varchar */ \"../react-ui/core/Inputs/Varchar.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\nclass Hyperlink extends _Varchar__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n  static defaultProps = {\n    inputClassName: 'hyperlink',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    type: 'text',\n    placeholder: 'https://'\n  };\n  constructor(props) {\n    super(props);\n    this.state = this.getStateFromProps(props);\n  }\n  getStateFromProps(props) {\n    return {\n      ...super.getStateFromProps(props),\n      // Parent state\n      showPredefinedValues: false,\n      isInitialized: true\n    };\n  }\n  renderValueElement() {\n    if (this.state.value) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-link\"\n      }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n        href: this.state.value,\n        target: \"_blank\",\n        onClick: e => {\n          e.stopPropagation();\n        },\n        className: \"btn btn-blue-outline btn-small max-w-60\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fa-solid fa-up-right-from-square\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"text\"\n      }, this.state.value ? this.state.value : '')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n        className: \"btn btn-transparent btn-small ml-2\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fa-solid fa-pencil\"\n      }))));\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"no-value\"\n      });\n    }\n  }\n  renderInputElement() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"w-full flex gap-2 items-center\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-link\"\n    }), super.renderInputElement(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n      href: this.state.value,\n      target: \"_blank\",\n      onClick: e => {\n        e.stopPropagation();\n      },\n      className: \"btn btn-transparent\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fa-solid fa-up-right-from-square\"\n    }))));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Hyperlink.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Image.tsx":
/*!*****************************************!*\
  !*** ../react-ui/core/Inputs/Image.tsx ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Image)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_images_uploading__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-images-uploading */ \"../react-ui/node_modules/react-images-uploading/dist/index.js\");\n/* harmony import */ var react_images_uploading__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_images_uploading__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n\n\n\n\nclass Image extends _Input__WEBPACK_IMPORTED_MODULE_3__.Input {\n  static defaultProps = {\n    inputClassName: 'image',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.state = {\n      ...this.state,\n      // Parent state\n      images: [],\n      showImageLarge: false,\n      isInitialized: true\n    };\n  }\n  onImageChange(images, addUpdateIndex) {\n    let image = images[0];\n    this.onChange({\n      fileName: image ? image.file.name : null,\n      fileData: image ? image.fileData : null\n      // fileSize: image.file.size,\n      // fileType: image.file.type\n    });\n    this.setState({\n      images: images\n    });\n  }\n  getImageUrl() {\n    if (this.state.value) {\n      if (this.state.value.fileData) {\n        return this.state.value.fileData;\n      } else if (this.state.value) {\n        return globalThis.hubleto.config.uploadUrl + '/' + this.state.value;\n      } else {\n        return '';\n      }\n    } else {\n      return '';\n    }\n  }\n  renderImage() {\n    let btnStyle = this.state.showImageLarge ? {\n      width: '100%',\n      height: 'calc(100vh - 2em)',\n      padding: '1em',\n      margin: 'auto',\n      position: 'fixed',\n      top: '0px',\n      left: '0px',\n      zIndex: 9999999,\n      background: '#FFFFFF80'\n    } : {\n      height: '3em',\n      paddingRight: '1em'\n    };\n    let imgStyle = this.state.showImageLarge ? {\n      height: '100%',\n      margin: 'auto'\n    } : {\n      height: '100%'\n    };\n    if (this.getImageUrl()) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n        style: btnStyle,\n        onClick: () => {\n          this.setState({\n            showImageLarge: !this.state.showImageLarge\n          });\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n        src: this.getImageUrl(),\n        style: imgStyle\n      })));\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n  renderValueElement() {\n    return this.renderImage();\n  }\n  renderInputElement() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.renderImage(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react_images_uploading__WEBPACK_IMPORTED_MODULE_1___default()), {\n      ref: this.refInput,\n      value: this.state.value && this.state.value['fileData'] != null ? [this.state.value] : [],\n      onChange: (images, addUpdateIndex) => this.onImageChange(images, addUpdateIndex),\n      maxNumber: 1,\n      dataURLKey: \"fileData\"\n    }, ({\n      imageList,\n      onImageUpload,\n      onImageUpdate,\n      onImageRemove,\n      isDragging,\n      dragProps\n    }) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"upload__image-wrapper\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", _extends({\n      className: \"btn btn-small btn-transparent\",\n      style: isDragging ? {\n        color: 'red'\n      } : undefined,\n      onClick: onImageUpload\n    }, dragProps), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-image\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, this.translate(\"Choose image\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\Image'))))));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Image.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Int.tsx":
/*!***************************************!*\
  !*** ../react-ui/core/Inputs/Int.tsx ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Int)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\nclass Int extends _Input__WEBPACK_IMPORTED_MODULE_1__.Input {\n  static defaultProps = {\n    inputClassName: 'int',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.state = {\n      ...this.state,\n      // Parent state\n      isInitialized: true\n    };\n  }\n  renderInputElement() {\n    const decimals = this.props.description?.decimals ?? 0;\n    const step = this.props.description?.step ?? 1;\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex gap-2\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n      ref: this.refInput,\n      type: \"number\",\n      step: step,\n      value: this.state.value\n      // onKeyDown={(evt) => evt.key === 'e' && evt.preventDefault()}\n      // onKeyDown={(e) => this.setState({value: e.currentTarget.value.replace('e', '')})}\n      ,\n      onChange: e => this.onChange(e.currentTarget.value.replace('e', '')),\n      placeholder: this.props.description?.placeholder ?? '0' + (decimals > 0 ? '.' + '0'.repeat(decimals) : ''),\n      className: \"form-control\" + \" \" + (this.state.invalid ? 'is-invalid' : '') + \" \" + (this.props.cssClass ?? \"\") + \" \" + (this.state.readonly ? \"bg-muted\" : \"\") + \" max-w-40\",\n      disabled: this.state.readonly\n    }), this.props.unit ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, this.props.unit) : null);\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Int.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/JsonKeyValue.tsx":
/*!************************************************!*\
  !*** ../react-ui/core/Inputs/JsonKeyValue.tsx ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ JsonKeyValue)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\nclass JsonKeyValue extends _Input__WEBPACK_IMPORTED_MODULE_1__.Input {\n  static defaultProps = {\n    inputClassName: 'JsonKeyValue',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.state = {\n      ...this.state,\n      // Parent state\n      isInitialized: true\n    };\n  }\n  getValueAsArray() {\n    let valAsObj = null;\n    try {\n      valAsObj = JSON.parse(this.state.value ?? '{}');\n    } catch (ex) {\n      valAsObj = {};\n    }\n    if (!valAsObj) valAsObj = {};\n    let valAsArray = [];\n    Object.keys(valAsObj).map(key => {\n      valAsArray.push([key, valAsObj[key]]);\n    });\n    return valAsArray;\n  }\n  convertArrayToObject(valArray) {\n    let valObj = {};\n    valArray.map((keyValue, index) => {\n      valObj[keyValue[0]] = keyValue[1];\n    });\n    return valObj;\n  }\n  addNewKeyValue() {\n    let newValue = this.getValueAsArray();\n    newValue.push(['', '']);\n    this.onChange(JSON.stringify(this.convertArrayToObject(newValue)));\n  }\n  updateKeyValue(index, key, value) {\n    let newValue = this.getValueAsArray();\n    newValue[index] = [key, value];\n    this.onChange(JSON.stringify(this.convertArrayToObject(newValue)));\n  }\n  renderInputElement() {\n    const valArray = this.getValueAsArray();\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, valArray.map((item, index) => {\n      const refKey = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n      const refValue = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        key: index,\n        className: \"flex w-full gap-2\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n        ref: refKey,\n        value: valArray[index][0],\n        onChange: () => this.updateKeyValue(index, refKey.current.value, refValue.current.value)\n      }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n        ref: refValue,\n        value: valArray[index][1],\n        onChange: () => this.updateKeyValue(index, refKey.current.value, refValue.current.value)\n      }));\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"mt-2\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-transparent btn-small\",\n      onClick: () => this.addNewKeyValue()\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-plus\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, this.translate('Add value', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\JsonKeyValue')))));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/JsonKeyValue.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Lookup.tsx":
/*!******************************************!*\
  !*** ../react-ui/core/Inputs/Lookup.tsx ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Lookup)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_select_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-select/async */ \"../react-ui/node_modules/react-select/async/dist/react-select-async.esm.js\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var _Request__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Request */ \"../react-ui/core/Request.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\n\n\nclass Lookup extends _Input__WEBPACK_IMPORTED_MODULE_2__.Input {\n  static defaultProps = {\n    inputClassName: 'lookup',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_4__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_4__[\"default\"](),\n    uiStyle: 'default'\n  };\n  constructor(props) {\n    super(props);\n    this.state = {\n      ...this.state,\n      // Parent state\n      endpoint: props.endpoint ? props.endpoint : props.description && props.description.endpoint ? props.description.endpoint : globalThis.hubleto.config.defaultLookupEndpoint ?? 'api/record/lookup',\n      model: props.model ? props.model : props.description && props.description.model ? props.description.model : '',\n      data: [],\n      customEndpointParams: this.props.customEndpointParams ?? {}\n    };\n  }\n  componentDidMount() {\n    super.componentDidMount();\n    this.loadData();\n  }\n  componentDidUpdate(prevProps) {\n    super.componentDidUpdate(prevProps);\n    if (JSON.stringify(this.props.customEndpointParams) !== JSON.stringify(prevProps.customEndpointParams) || this.props.model !== prevProps.model || this.props.context !== prevProps.context) {\n      this.loadData();\n    }\n  }\n  getEndpointUrl() {\n    return this.state.endpoint;\n  }\n  getEndpointParams() {\n    let formRecord = null;\n    if (this.props.parentForm) {\n      formRecord = {\n        ...this.props.parentForm.state.record\n      };\n      (this.props.parentForm.state.record._RELATIONS ?? []).map(relName => {\n        delete formRecord[relName];\n      });\n    }\n    return {\n      model: this.state.model,\n      context: this.props.context,\n      formRecord: formRecord,\n      __IS_AJAX__: '1',\n      ...(this.props.parentForm?.state.customEndpointParams ?? {}),\n      ...this.props.customEndpointParams\n    };\n  }\n  loadData(inputValue = null, callback = null) {\n    _Request__WEBPACK_IMPORTED_MODULE_3__[\"default\"].post(this.getEndpointUrl(), {\n      ...this.getEndpointParams(),\n      search: inputValue\n    }, {}, data => {\n      this.setState({\n        isInitialized: true,\n        data: data\n      });\n      if (callback) callback(Object.values(data ?? {}));\n    });\n  }\n  _renderOption(key) {\n    if (this.state.data == undefined) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n      key: key,\n      value: key\n    }, this.state.data[key]?._LOOKUP ?? '');\n  }\n  renderValueElement() {\n    if (this.state.data && this.state.data[this.state.value]?._LOOKUP) {\n      let value = this.state.data[this.state.value];\n      let urlDetail = value._URL_DETAIL ?? '';\n      let style = {};\n      if (value._LOOKUP_COLOR) style['borderLeft'] = '0.5em solid ' + value._LOOKUP_COLOR;\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n        className: \"btn btn-transparent\",\n        \"data-pr-tooltip\": JSON.stringify(value ?? {}),\n        \"data-pr-position\": \"bottom\",\n        style: style\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"text \" + (value._LOOKUP_CLASS ? value._LOOKUP_CLASS : \"text-primary\")\n      }, value._LOOKUP)), urlDetail && this.state.value ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n        className: \"btn btn-transparent ml-2\",\n        target: \"_blank\",\n        href: globalThis.hubleto.config.projectUrl + \"/\" + urlDetail\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-arrow-up-right-from-square\"\n      }))) : null);\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"no-value\"\n      });\n    }\n    // return this.state.value;\n  }\n  renderInputElement() {\n    let urlDetail = this.state.data[this.state.value]?._URL_DETAIL ?? '';\n    let value = this.state.data[this.state.value]?.id ?? 0;\n    if (this.props.uiStyle == 'select') {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"select\", {\n        ref: this.refInput,\n        value: value,\n        onChange: e => this.onChange(e.target.value),\n        className: (this.state.invalid ? 'is-invalid' : '') + \" \" + (this.props.cssClass ?? \"\") + \" \" + (this.state.readonly ? \"bg-muted\" : \"\"),\n        disabled: this.state.readonly\n      }, Object.keys(this.state.data).map(key => this._renderOption(key))));\n    } else if (this.props.uiStyle == 'buttons' || this.props.uiStyle == 'buttons-vertical') {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        ref: this.refInput,\n        className: \"btn-group gap-1 bg-white flex-wrap \" + (this.props.uiStyle == 'buttons-vertical' ? \" flex-col w-full\" : \"\")\n      }, Object.keys(this.state.data).map(key => {\n        const value = this.state.data ? this.state.data[key]?.id ?? 0 : 0;\n        const lookup = this.state.data ? this.state.data[key]?._LOOKUP ?? '' : '';\n        const color = this.state.data ? this.state.data[key]?._LOOKUP_COLOR ?? '' : '';\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n          className: \"btn \" + (this.state.readonly && this.state.value != value ? \"btn-disabled\" : \"\") + \" \" + (this.state.value == value ? \"btn-primary\" : \"btn-transparent\"),\n          style: {\n            borderLeft: color ? \"0.5em solid \" + color : \"\"\n          },\n          onClick: () => {\n            if (!this.state.readonly) this.onChange(this.state.value == value ? null : value);\n          }\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"text\"\n        }, lookup)));\n      }));\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_select_async__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n        ref: this.refInput,\n        value: {\n          id: value,\n          _LOOKUP: this.state.data[this.state.value]?._LOOKUP ?? ''\n        },\n        isClearable: true,\n        isDisabled: this.state.readonly || !this.state.isInitialized,\n        loadOptions: (inputValue, callback) => this.loadData(inputValue, callback),\n        defaultOptions: Object.values(this.state.data ?? {}),\n        getOptionLabel: option => {\n          return option._LOOKUP;\n        },\n        getOptionValue: option => {\n          return option.id;\n        },\n        onChange: item => {\n          this.onChange(item?.id ?? 0);\n        },\n        placeholder: this.props.description?.placeholder,\n        className: \"hubleto-lookup\"\n        // allowCreateWhileLoading={false}\n        // formatCreateLabel={(inputValue: string) => <span className=\"create-new\">{this.translate('Create', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\Lookup') + ': ' + inputValue}</span>}\n        // getNewOptionData={(value, label) => { return { id: {_isNew_: true, _LOOKUP: label}, _LOOKUP: label }; }}\n        ,\n        styles: {\n          menuPortal: base => ({\n            ...base,\n            zIndex: 9999\n          })\n        },\n        menuPosition: \"fixed\",\n        menuPortalTarget: document.body\n      }), urlDetail ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n        className: \"btn btn-transparent\",\n        target: \"_blank\",\n        href: globalThis.hubleto.config.projectUrl + \"/\" + urlDetail\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-arrow-up-right-from-square\"\n      }))) : null, this.props.urlAdd && !this.state.readonly ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n        className: \"btn btn-transparent ml-2\",\n        target: \"_blank\",\n        href: globalThis.hubleto.config.projectUrl + \"/\" + this.props.urlAdd\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-plus\"\n      }))) : null);\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Lookup.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Password.tsx":
/*!********************************************!*\
  !*** ../react-ui/core/Inputs/Password.tsx ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Password)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\nclass Password extends _Input__WEBPACK_IMPORTED_MODULE_1__.Input {\n  static defaultProps = {\n    inputClassName: 'password',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    type: 'text'\n  };\n  constructor(props) {\n    super(props);\n    this.state = {\n      ...this.state,\n      value: '',\n      visible: false,\n      isInitialized: true\n    };\n    this.refInputConfirm = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n  }\n  onChange() {\n    const val1 = this.refInput.current.value;\n    const val2 = this.refInputConfirm.current.value;\n    super.onChange([val1, val2]);\n  }\n  renderValueElement() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, \"***\");\n  }\n  renderInputElement() {\n    const password1 = this.state.value[0] ?? '';\n    const password2 = this.state.value[1] ?? '';\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"block pr-2\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n      ref: this.refInput,\n      type: this.state.visible ? 'text' : 'password',\n      value: password1,\n      onChange: e => this.onChange(),\n      placeholder: this.translate(\"New password\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\Password'),\n      className: (this.state.invalid ? 'is-invalid' : '') + \" \" + (this.props.cssClass ?? \"\") + \" \" + (this.state.readonly ? \"bg-muted\" : \"\") + \" \" + (password1 == password2 ? \"\" : \"bg-red-100\"),\n      disabled: this.state.readonly\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n      type: this.state.visible ? 'text' : 'password',\n      value: password2,\n      ref: this.refInputConfirm,\n      onChange: e => this.onChange(),\n      placeholder: this.translate(\"Confirm new password\", 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\Password'),\n      className: (this.state.invalid ? 'is-invalid' : '') + \" \" + (this.props.cssClass ?? \"\") + \" \" + (this.state.readonly ? \"bg-muted\" : \"\") + \" \" + (password1 == password2 ? \"\" : \"bg-red-100\"),\n      disabled: this.state.readonly\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"btn btn-light\",\n      onClick: () => {\n        this.setState({\n          visible: !this.state.visible\n        });\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas \" + (this.state.visible ? \"fa-low-vision\" : \"fa-eye\")\n    }))));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Password.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/SharedWith.tsx":
/*!**********************************************!*\
  !*** ../react-ui/core/Inputs/SharedWith.tsx ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ SharedWith)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Lookup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Lookup */ \"../react-ui/core/Inputs/Lookup.tsx\");\n/* harmony import */ var _ModalSimple__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ModalSimple */ \"../react-ui/core/ModalSimple.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\n\nclass SharedWith extends _Lookup__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n  static defaultProps = {\n    inputClassName: 'shared-with',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"](),\n    uiStyle: 'default'\n  };\n  getEndpointUrl() {\n    return 'api/get-users';\n  }\n  renderValueElement() {\n    return this.renderInputElement();\n  }\n  renderInputElement() {\n    if (!this.state.data) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, \"...\");\n    let valuesPerUser = this.state.value;\n    try {\n      valuesPerUser = JSON.parse(this.state.value);\n    } catch (ex) {\n      valuesPerUser = {};\n    }\n    Object.keys(valuesPerUser).map(idUser => {\n      if (valuesPerUser[idUser] != 'read' && valuesPerUser[idUser] != 'modify') {\n        delete valuesPerUser[idUser];\n      }\n    });\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-transparent\",\n      onClick: () => {\n        this.setState({\n          showModal: true\n        });\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-share-nodes\"\n    })), Object.keys(valuesPerUser).length == 0 ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text flex gap-4 text-xs\"\n    }, Object.keys(valuesPerUser).map(idUser => {\n      let user = null;\n      this.state.data.map(tmpUser => {\n        if (tmpUser.id == idUser) user = tmpUser;\n      });\n      return user ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, user.nick ?? Array.from(user.first_name ?? '')[0].toString() + Array.from(user.last_name ?? '')[0].toString(), valuesPerUser[idUser] == 'read' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"text-xs fas fa-eye pl-2\"\n      }) : null, valuesPerUser[idUser] == 'modify' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"text-xs fas fa-pencil pl-2\"\n      }) : null) : null;\n    }))), this.state.showModal ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ModalSimple__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n      uid: \"projects_table_discussions_modal\",\n      isOpen: true,\n      type: \"right\",\n      showHeader: true,\n      title: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", null, this.translate('Share', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\SharedWith'))),\n      onClose: modal => {\n        this.setState({\n          showModal: false\n        });\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"table\", {\n      ref: this.refInput,\n      className: \"table-default\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"tbody\", null, Object.keys(this.state.data).map(key => {\n      const user = this.state.data[key] ?? null;\n      const userId = user.id ?? 0;\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"tr\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"td\", null, user.first_name, \" \", user.last_name), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"td\", null, user.photo ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n        src: globalThis.hubleto.config.uploadUrl + '/' + user.photo,\n        className: \"max-w-4 max-h-4 rounded-xl\"\n      }) : null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"td\", null, user.nick), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"td\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"select\", {\n        value: valuesPerUser[userId],\n        onChange: event => {\n          valuesPerUser[user.id] = event.currentTarget.value;\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n        value: \"\"\n      }, this.translate('Default access based on ownership', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\SharedWith')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n        value: \"read\"\n      }, this.translate('Can only read', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\SharedWith')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n        value: \"modify\"\n      }, this.translate('Can read and modify', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\SharedWith')))));\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-add btn-large mt-4 m-auto\",\n      onClick: () => {\n        this.onChange(JSON.stringify(valuesPerUser));\n        this.setState({\n          showModal: false\n        });\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-check\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, this.translate('Apply', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\SharedWith')))) : null);\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/SharedWith.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Tags.tsx":
/*!****************************************!*\
  !*** ../react-ui/core/Inputs/Tags.tsx ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Tags)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var react_tag_input__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-tag-input */ \"../react-ui/node_modules/react-tag-input/dist/index.js\");\n/* harmony import */ var _Request__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Request */ \"../react-ui/core/Request.tsx\");\n/* harmony import */ var primereact_progressbar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! primereact/progressbar */ \"../react-ui/node_modules/primereact/progressbar/progressbar.esm.js\");\n/* harmony import */ var sweetalert2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! sweetalert2 */ \"../react-ui/node_modules/sweetalert2/dist/sweetalert2.all.js\");\n/* harmony import */ var sweetalert2__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(sweetalert2__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Notification */ \"../react-ui/core/Notification.tsx\");\n\n\n\n\n\n\n\n\n// import '../../Assets/Css/Components/Inputs/Tags.css';\n\n\nclass Tags extends _Input__WEBPACK_IMPORTED_MODULE_2__.Input {\n  static defaultProps = {\n    inputClassName: 'tags',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_1__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.state = {\n      ...this.state,\n      // Parent state\n      tags: [],\n      value: []\n    };\n  }\n  componentDidMount() {\n    super.componentDidMount();\n    this.loadData();\n    if (this.props.enableAdd ?? true) {\n      setTimeout(() => {\n        const tagInput = document.querySelector('.ReactTags__tagInput');\n        if (tagInput) tagInput.remove();\n      }, 500);\n    }\n  }\n  componentDidUpdate(prevProps) {\n    if (prevProps.recordId != this.props.recordId) {\n      this.loadData();\n    }\n  }\n  loadData() {\n    _Request__WEBPACK_IMPORTED_MODULE_4__[\"default\"].get('components/inputs/tags/data', {\n      model: this.props.model,\n      junction: this.props.params.junction,\n      __IS_AJAX__: '1',\n      id: this.props.recordId\n    }, data => {\n      const tmpTags = data.records;\n      const selected = data.selected;\n      let tags = [];\n      tmpTags.map(item => {\n        const tagBadge = {\n          id: item.id + '',\n          name: item.name,\n          className: (selected.includes(item.id) ? \" ReactTags__active\" : \"\") + (this.state.readonly ? \" ReactTags__disabled\" : \"\")\n        };\n        tags.push(tagBadge);\n        //else if (this.props.params['addNewTags'] != undefined) tagInput['className'] += ' ReactTags__not_removable'\n      });\n      this.onChange(selected);\n      this.setState({\n        isInitialized: true,\n        tags: tags\n      }, () => {\n        if (this.props.enableDelete ?? true) {\n          const removeButtons = document.querySelectorAll('.ReactTags__remove');\n          removeButtons.forEach(button => {\n            button.remove();\n          });\n        }\n      });\n    });\n  }\n  onTagAdd(tag) {\n    let postData = {};\n    if (this.props.params.dataKey) {\n      postData['dataKey'] = this.props.params.dataKey;\n      postData[this.props.params.dataKey] = tag[this.props.params.dataKey];\n    }\n    _Request__WEBPACK_IMPORTED_MODULE_4__[\"default\"].post('components/inputs/tags/add', postData, {\n      model: this.props.model,\n      id: this.props.recordId,\n      junction: this.props.params.junction,\n      __IS_AJAX__: '1'\n    }, () => {\n      _Notification__WEBPACK_IMPORTED_MODULE_7__[\"default\"].success(\"Tag pridaný\");\n      this.loadData();\n    });\n  }\n  onTagDelete(tagIndex) {\n    // @ts-ignore\n    sweetalert2__WEBPACK_IMPORTED_MODULE_6___default().fire({\n      title: 'Ste si istý?',\n      html: 'Ste si istý, že chcete vymazať tento tag?',\n      icon: 'question',\n      showCancelButton: true,\n      cancelButtonText: 'Nie',\n      confirmButtonText: 'Áno',\n      confirmButtonColor: '#dc4c64',\n      reverseButtons: false\n    }).then(result => {\n      if (result.isConfirmed) {\n        let id = parseInt(this.state.tags[tagIndex].id);\n        _Request__WEBPACK_IMPORTED_MODULE_4__[\"default\"].delete('components/inputs/tags/delete', {\n          model: this.props.model,\n          junction: this.props.params.junction,\n          __IS_AJAX__: '1',\n          id: id\n        }, () => {\n          _Notification__WEBPACK_IMPORTED_MODULE_7__[\"default\"].success(\"Tag zmazaný\");\n          this.loadData();\n        });\n      }\n    });\n  }\n  onTagClick(tagIndex) {\n    if (this.state.readonly) return;\n    const tmpTagId = parseInt(this.state.tags[tagIndex].id);\n    let value = this.state.value;\n    let className = \"\";\n\n    // Insert or delete\n    if (value.includes(tmpTagId)) {\n      value.splice(value.indexOf(tmpTagId), 1);\n    } else {\n      value.push(tmpTagId);\n      className = \" ReactTags__active\";\n    }\n    let currentTags = this.state.tags;\n    currentTags[tagIndex].className = className;\n    this.onChange(value);\n    this.setState({\n      tags: currentTags\n    });\n  }\n  renderInputElement() {\n    if (!this.state.isInitialized) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_progressbar__WEBPACK_IMPORTED_MODULE_5__.ProgressBar, {\n        mode: \"indeterminate\",\n        style: {\n          height: '3px'\n        }\n      });\n    }\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_tag_input__WEBPACK_IMPORTED_MODULE_3__.WithContext, {\n      ref: this.refInput,\n      tags: this.state.tags,\n      labelField: this.props.params.dataKey,\n      handleDelete: tagIndex => this.onTagDelete(tagIndex),\n      handleTagClick: tagIndex => this.onTagClick(tagIndex),\n      handleAddition: tag => this.onTagAdd(tag),\n      allowDragDrop: false,\n      inputFieldPosition: \"bottom\",\n      allowDeleteFromEmptyInput: false,\n      autocomplete: true,\n      readOnly: this.state.readonly,\n      allowUnique: false,\n      editable: false\n    });\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Tags.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Tags2.tsx":
/*!*****************************************!*\
  !*** ../react-ui/core/Inputs/Tags2.tsx ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Tags2)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var _Request__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Request */ \"../react-ui/core/Request.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var react_select_creatable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-select/creatable */ \"../react-ui/node_modules/react-select/creatable/dist/react-select-creatable.esm.js\");\n/* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-select */ \"../react-ui/node_modules/react-select/dist/react-select.esm.js\");\n\n\n\n\n\n\nclass Tags2 extends _Input__WEBPACK_IMPORTED_MODULE_1__.Input {\n  static defaultProps = {\n    inputClassName: 'tags',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.state = this.getStateFromProps(props);\n  }\n  getStateFromProps(props) {\n    return {\n      ...this.state,\n      // Parent state\n      endpoint: props.endpoint ? props.endpoint : props.params && props.params.endpoint ? props.params.endpoint : globalThis.hubleto.config.defaultLookupEndpoint ?? 'api/record/lookup',\n      model: props.model ? props.model : props.params && props.params.model ? props.params.model : '',\n      options: [],\n      targetColumn: props.targetColumn,\n      sourceColumn: props.sourceColumn\n    };\n  }\n  addNewTag(title) {\n    if (!this.props.onNewTag) return;\n    const newTag = this.props.onNewTag(title);\n    _Request__WEBPACK_IMPORTED_MODULE_2__[\"default\"].post(\"api/record/save\", {\n      model: this.props.model,\n      id: -1,\n      record: newTag\n    }, {}, saveResponse => {\n      this.loadOptions(() => {\n        const value = this.convertValueToOptionList(this.state.value);\n        value.push(Object.values(this.state.options).find(opt => opt.value == saveResponse.savedRecord.id) ?? {\n          id: saveResponse.savedRecord?.id,\n          value: saveResponse.savedRecord.id,\n          label: title\n        });\n        this.handleChange(value);\n      });\n    }, err => {\n      console.log(\"Unable to create new Tag\");\n    });\n  }\n  handleChange(selectedOptions) {\n    const value = [];\n    for (let i in selectedOptions) {\n      value.push({\n        id: selectedOptions[i].id ?? -1,\n        [this.props.targetColumn]: {\n          _useMasterRecordId_: true\n        },\n        [this.props.sourceColumn]: selectedOptions[i].value\n      });\n    }\n    this.onChange(value);\n  }\n  componentDidMount() {\n    super.componentDidMount();\n    this.loadOptions();\n  }\n  getEndpointUrl() {\n    return this.state.endpoint;\n  }\n  getEndpointParams() {\n    let formRecord = null;\n    if (this.props.parentForm) {\n      formRecord = {\n        ...this.props.parentForm.state.record\n      };\n      (this.props.parentForm.state.record._RELATIONS ?? []).map(relName => {\n        delete formRecord[relName];\n      });\n    }\n    return {\n      model: this.state.model,\n      context: this.props.context,\n      formRecord: formRecord,\n      __IS_AJAX__: '1'\n    };\n  }\n  loadOptions(callback = () => {}) {\n    _Request__WEBPACK_IMPORTED_MODULE_2__[\"default\"].post(this.getEndpointUrl(), this.getEndpointParams(), {}, data => {\n      let options = [];\n      for (let i in data) {\n        options[data[i].id] = {\n          value: data[i].id,\n          label: data[i]._LOOKUP,\n          color: data[i][this.props.colorColumn ?? ''] ?? ''\n        };\n      }\n      this.setState({\n        isInitialized: true,\n        options: options\n      }, callback);\n    });\n  }\n  convertValueToOptionList(value) {\n    let optionList = [];\n    if (value) {\n      optionList = value.map(item => {\n        const optionId = item.id;\n        const optionValue = item[this.props.sourceColumn];\n        const optionData = this.state.options[optionValue];\n        return {\n          id: optionId,\n          value: optionValue,\n          label: optionData?.label ?? '[' + optionValue + ']',\n          color: optionData?.color ?? ''\n        };\n      });\n    }\n    return optionList;\n  }\n  renderValueElement() {\n    const options = this.convertValueToOptionList(this.state.value);\n    if (options) {\n      let items = [];\n      for (let i in options) {\n        items.push(/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n          key: i,\n          className: \"btn btn-transparent btn-small mr-1\",\n          style: {\n            borderColor: options[i].color ? options[i].color : ''\n          }\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"text\",\n          style: {\n            color: options[i].color ? options[i].color : ''\n          }\n        }, options[i].label)));\n      }\n      return items;\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"no-value\"\n      });\n    }\n  }\n  renderInputElement() {\n    if (!(this.props.onNewTag ?? false)) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_select__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n        ref: this.refInput,\n        value: this.convertValueToOptionList(this.state.value),\n        isMulti: true,\n        isSearchable: true,\n        options: this.state.options,\n        className: \"hubleto-lookup\",\n        onChange: selectedOptions => this.handleChange(selectedOptions)\n      });\n    }\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_select_creatable__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n      ref: this.refInput,\n      value: this.convertValueToOptionList(this.state.value),\n      isMulti: true,\n      options: Object.values(this.state.options),\n      className: \"hubleto-lookup\",\n      onChange: selectedOptions => this.handleChange(selectedOptions),\n      onCreateOption: inputValue => this.addNewTag(inputValue)\n    });\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Tags2.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Textarea.tsx":
/*!********************************************!*\
  !*** ../react-ui/core/Inputs/Textarea.tsx ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Textarea)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\nclass Textarea extends _Input__WEBPACK_IMPORTED_MODULE_1__.Input {\n  static defaultProps = {\n    inputClassName: 'textarea',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.state = {\n      ...this.state,\n      // Parent state\n      isInitialized: true\n    };\n  }\n  renderInputElement() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"textarea\", {\n      ref: this.refInput,\n      value: this.state.value ?? '',\n      onChange: e => this.onChange(this.refInput.current.value)\n      // onKeyDown={(e) => this.setState({value: e.currentTarget.value})}\n      // onBlur={(e) => this.onChange(e.currentTarget.value)}\n      ,\n      \"aria-describedby\": \"passwordHelpInline\",\n      rows: 5,\n      placeholder: this.props.description?.placeholder ?? this.props.description?.title,\n      className: \"bg-white\" + \" \" + (this.props.cssClass ?? \"\") + \" \" + (this.state.invalid ? 'invalid' : '') + \" \" + (this.state.readonly ? \"readonly\" : \"\"),\n      style: {\n        ...this.props.cssStyle,\n        fontFamily: 'Courier'\n      },\n      disabled: this.state.readonly\n    });\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Textarea.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/TextareaWithHtmlPreview.tsx":
/*!***********************************************************!*\
  !*** ../react-ui/core/Inputs/TextareaWithHtmlPreview.tsx ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ TextareaWithHtmlPreview)\n/* harmony export */ });\n/* harmony import */ var _hubleto_react_ui_core_HtmlFrame__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @hubleto/react-ui/core/HtmlFrame */ \"../react-ui/core/HtmlFrame.tsx\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var react_simple_code_editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-simple-code-editor */ \"../react-ui/node_modules/react-simple-code-editor/lib/index.js\");\n/* harmony import */ var react_simple_code_editor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_simple_code_editor__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var prismjs_components_prism_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prismjs/components/prism-core */ \"../react-ui/node_modules/prismjs/components/prism-core.js\");\n/* harmony import */ var prismjs_components_prism_core__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_core__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var prismjs_components_prism_markup__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prismjs/components/prism-markup */ \"../react-ui/node_modules/prismjs/components/prism-markup.js\");\n/* harmony import */ var prismjs_components_prism_markup__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prismjs_components_prism_markup__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var prismjs_themes_prism_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prismjs/themes/prism.css */ \"../react-ui/node_modules/prismjs/themes/prism.css\");\n\n\n\n\n\n\n\n //Example style, you can use another\n\nclass TextareaWithHtmlPreview extends _Input__WEBPACK_IMPORTED_MODULE_2__.Input {\n  static defaultProps = {\n    inputClassName: 'TextareaWithHtmlPreview',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.refPreview = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createRef();\n    this.state = {\n      ...this.state,\n      // Parent state\n      isInitialized: true,\n      textareaValue: this.state.value,\n      previewInvalidated: false,\n      isFullscreen: false\n    };\n  }\n  renderInputElement() {\n    let editorStyle = {\n      overflow: 'auto',\n      fontFamily: 'monospace',\n      fontSize: 11,\n      maxWidth: '600px'\n    };\n    let wrapperStyle = {};\n    if (this.state.isFullscreen) {\n      wrapperStyle.position = 'fixed';\n      wrapperStyle.left = '0px';\n      wrapperStyle.top = '0px';\n      wrapperStyle.width = '100vw';\n      wrapperStyle.height = '100vh';\n      wrapperStyle.background = 'white';\n      wrapperStyle.padding = '1em';\n      wrapperStyle.zIndex = 9999999;\n    }\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n      className: \"flex gap-2 w-full\",\n      style: wrapperStyle\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n      className: \"w-1/2 card\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n      className: \"card-header\"\n    }, \"HTML content\", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"button\", {\n      className: \"btn btn-small btn-transparent\",\n      onClick: () => {\n        this.setState({\n          isFullscreen: !this.state.isFullscreen\n        });\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"i\", {\n      className: \"fas fa-expand\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"span\", {\n      className: \"text\"\n    }, this.translate('Toggle fullscreen', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\TextareaWithHtmlPreview'))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n      className: \"card-body flex flex-col overflow-y-auto\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react_simple_code_editor__WEBPACK_IMPORTED_MODULE_4___default()), {\n      className: \"bg-slate-100 w-full overflow-y\",\n      value: this.state.textareaValue ?? '',\n      onValueChange: newValue => {\n        this.setState({\n          textareaValue: newValue\n        });\n        this.onChange(newValue);\n      },\n      highlight: code => (0,prismjs_components_prism_core__WEBPACK_IMPORTED_MODULE_5__.highlight)(code, prismjs_components_prism_core__WEBPACK_IMPORTED_MODULE_5__.languages.markup),\n      padding: 10,\n      style: editorStyle\n    }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n      className: 'w-1/2 card ' + (this.state.previewInvalidated ? 'card-danger' : '')\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n      className: \"card-header\"\n    }, this.translate('Preview', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Inputs\\\\TextareaWithHtmlPreview')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n      className: \"card-body\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_hubleto_react_ui_core_HtmlFrame__WEBPACK_IMPORTED_MODULE_0__[\"default\"], {\n      ref: this.refPreview,\n      className: \"w-full h-full\",\n      content: this.state.textareaValue\n    }))));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/TextareaWithHtmlPreview.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/UserSelect.tsx":
/*!**********************************************!*\
  !*** ../react-ui/core/Inputs/UserSelect.tsx ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ UserSelect)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Lookup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Lookup */ \"../react-ui/core/Inputs/Lookup.tsx\");\n/* harmony import */ var _Request__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Request */ \"../react-ui/core/Request.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\n\n\nclass UserSelect extends _Lookup__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n  static defaultProps = {\n    inputClassName: 'user-select',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"](),\n    uiStyle: 'default'\n  };\n  getEndpointUrl() {\n    return 'api/get-users';\n  }\n  renderValueElement() {\n    return this.renderInputElement();\n  }\n  loadData(inputValue = null, callback = null) {\n    let usersFromCache = globalThis.hubleto.users;\n    if (usersFromCache) {\n      this.setState({\n        isInitialized: true,\n        data: usersFromCache\n      });\n    } else {\n      _Request__WEBPACK_IMPORTED_MODULE_2__[\"default\"].post(this.getEndpointUrl(), {\n        ...this.getEndpointParams(),\n        search: inputValue\n      }, {}, data => {\n        this.setState({\n          isInitialized: true,\n          data: data\n        });\n        globalThis.hubleto.users = data;\n      });\n    }\n  }\n  renderInputElement() {\n    if (!this.state.data) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, \"...\");\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex flex-wrap gap-2 items-center bg-white\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      ref: this.refInput,\n      className: \"btn-group gap-1 flex-wrap\"\n    }, Object.keys(this.state.data).map(key => {\n      const user = this.state.data[key] ?? null;\n      const userId = user.id ?? 0;\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n        key: key,\n        className: \"btn \" + (this.state.readonly && this.state.value != userId ? \"btn-disabled\" : \"\") + \" \" + (this.state.value == userId ? \"btn-primary\" : \"btn-white\"),\n        onClick: () => {\n          if (!this.state.readonly) this.onChange(this.state.value == userId ? null : userId);\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"text flex gap-2\"\n      }, user.photo ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n        src: globalThis.hubleto.config.uploadUrl + '/' + user.photo,\n        className: \"max-w-4 max-h-4 rounded-xl\"\n      }) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"text-xs\"\n      }, Array.from(user.first_name ?? '')[0].toString() + Array.from(user.last_name ?? '')[0].toString())), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"hover min-w-48\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"flex flex-col gap-2\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"grow\"\n      }, user.photo ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n        src: globalThis.hubleto.config.uploadUrl + '/' + user.photo,\n        className: \"max-w-12 max-h-12 rounded-xl\"\n      }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"bg-gray-200 rounded-xl w-12 h-12 flex items-center justify-center\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-user\"\n      }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"text-primary\"\n      }, user.email), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"font-bold\"\n      }, user.position), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, user.first_name ?? '', \" \", user.last_name ?? '', \" \"))), user.TEAMS.map((team, key) => {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          key: key,\n          className: \"badge flex gap-2 items-center py-1\",\n          style: {\n            borderLeft: '0.5em solid ' + team.color\n          }\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n          className: \"fas fa-users\"\n        }), team.name);\n      })));\n    })));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/UserSelect.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Varchar.tsx":
/*!*******************************************!*\
  !*** ../react-ui/core/Inputs/Varchar.tsx ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Varchar)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var react_select_async__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-select/async */ \"../react-ui/node_modules/react-select/async/dist/react-select-async.esm.js\");\n/* harmony import */ var react_select_async_creatable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-select/async-creatable */ \"../react-ui/node_modules/react-select/async-creatable/dist/react-select-async-creatable.esm.js\");\n/* harmony import */ var _Request__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Request */ \"../react-ui/core/Request.tsx\");\n\n\n\n\n\n\nclass Varchar extends _Input__WEBPACK_IMPORTED_MODULE_1__.Input {\n  static defaultProps = {\n    inputClassName: 'varchar',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    type: 'text'\n  };\n  constructor(props) {\n    super(props);\n    this.state = this.getStateFromProps(props);\n  }\n  getStateFromProps(props) {\n    return {\n      ...this.state,\n      // Parent state\n      data: [],\n      showPredefinedValues: true,\n      isInitialized: true\n    };\n  }\n  componentDidMount() {\n    super.componentDidMount();\n    if (this.props.description?.autocomplete) {\n      this.loadData();\n    }\n  }\n  componentDidUpdate(prevProps) {\n    super.componentDidUpdate(prevProps);\n    if (this.props.description?.autocomplete && this.props.description?.autocomplete.endpoint != prevProps.description?.autocomplete?.endpoint) {\n      this.loadData();\n    }\n  }\n  getEndpointUrl() {\n    return this.state.description?.autocomplete?.endpoint ?? '';\n  }\n  loadData(inputValue = null, callback = null) {\n    _Request__WEBPACK_IMPORTED_MODULE_5__[\"default\"].post(this.getEndpointUrl(), {\n      search: inputValue\n    }, {}, data => {\n      let dataConv = [];\n      for (let i in data) {\n        dataConv.push({\n          'label': data[i],\n          'value': data[i]\n        });\n      }\n      this.setState({\n        isInitialized: true,\n        data: dataConv\n      });\n      if (callback) callback(dataConv);\n    });\n  }\n  renderInputElement() {\n    if (this.props.description?.autocomplete) {\n      let selectProps = {\n        value: {\n          label: this.state.value ?? '',\n          value: this.state.value ?? ''\n        },\n        isClearable: true,\n        isDisabled: this.state.readonly || !this.state.isInitialized,\n        loadOptions: (inputValue, callback) => this.loadData(inputValue, callback),\n        defaultOptions: this.state.data,\n        getOptionLabel: option => {\n          return option.label;\n        },\n        getOptionValue: option => {\n          return option.value;\n        },\n        onChange: item => {\n          this.onChange(item?.value ?? '');\n        },\n        placeholder: this.props.description?.placeholder,\n        className: 'hubleto-lookup',\n        styles: {\n          menuPortal: base => ({\n            ...base,\n            zIndex: 9999\n          })\n        },\n        // menuPosition: 'fixed',\n        menuPortalTarget: document.body\n      };\n      if (this.props.description?.autocomplete.creatable) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_select_async_creatable__WEBPACK_IMPORTED_MODULE_4__[\"default\"], selectProps);else return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_select_async__WEBPACK_IMPORTED_MODULE_3__[\"default\"], selectProps);\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"flex gap-2 w-full\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n        ref: this.refInput,\n        type: \"text\",\n        value: this.state.value ?? ''\n        // onKeyDown={(e) => this.setState({value: e.currentTarget.value})}\n        ,\n        onChange: e => this.onChange(this.refInput.current.value),\n        placeholder: this.props.placeholder,\n        className: (this.state.invalid ? 'is-invalid' : '') + \" \" + (this.props.cssClass ?? \"\") + \" \" + (this.state.readonly ? \"bg-muted\" : \"bg-white dark:bg-slate-800 dark:text-white dark:border-slate-700\") + \" border border-slate-200 rounded-sm p-1 w-full\",\n        disabled: this.state.readonly\n      }), this.props.description?.predefinedValues ? this.state.showPredefinedValues ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"select\", {\n        className: \"h-full\",\n        onChange: e => {\n          this.onChange(e.currentTarget.value);\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n        value: \"\"\n      }), this.props.description?.predefinedValues.map((item, index) => {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"option\", {\n          key: index,\n          value: item\n        }, item);\n      }))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n        className: \"mt-1 btn btn-transparent\",\n        onClick: () => {\n          this.setState({\n            showPredefinedValues: true\n          });\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"text\"\n      }, \"Choose from predefined options...\")) : null);\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Varchar.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Inputs/Wysiwyg.tsx":
/*!*******************************************!*\
  !*** ../react-ui/core/Inputs/Wysiwyg.tsx ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Wysiwyg)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Input */ \"../react-ui/core/Input.tsx\");\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var react_quill_new__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-quill-new */ \"../react-ui/node_modules/react-quill-new/lib/index.js\");\n/* harmony import */ var react_quill_new_dist_quill_snow_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-quill-new/dist/quill.snow.css */ \"../react-ui/node_modules/react-quill-new/dist/quill.snow.css\");\n\n\n\n\n\nclass Wysiwyg extends _Input__WEBPACK_IMPORTED_MODULE_1__.Input {\n  static defaultProps = {\n    inputClassName: 'Wysiwyg',\n    uid: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"](),\n    id: uuid__WEBPACK_IMPORTED_MODULE_2__[\"default\"]()\n  };\n  constructor(props) {\n    super(props);\n    this.refQuill = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n    this.state = {\n      ...this.state,\n      // Parent state\n      isInitialized: true,\n      textareaValue: this.state.value\n    };\n  }\n  renderInputElement() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex gap-2 w-full\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex-1 min-w-0 [&_.ql-editor]:[word-break:break-word]\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_quill_new__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n      ref: this.refQuill,\n      theme: \"snow\" // Use the 'snow' theme\n      ,\n      value: this.state.value,\n      readOnly: this.state.readonly,\n      onChange: htmlValue => {\n        this.onChange(htmlValue);\n        this.setState({\n          textareaValue: htmlValue\n        });\n      } // Content change handler\n      ,\n      modules: {\n        toolbar: [[{\n          'header': [1, 2, 3, 4, 5, 6, false]\n        }], ['bold', 'italic', 'underline', 'strike', 'blockquote'], [{\n          'list': 'ordered'\n        }, {\n          'list': 'bullet'\n        }, {\n          'indent': '-1'\n        }, {\n          'indent': '+1'\n        }], ['link', 'image', 'clean']]\n      },\n      formats: ['header', 'bold', 'italic', 'underline', 'strike', 'blockquote', 'list', 'indent', 'link', 'image']\n    })), this.state.readonly || !this.props.showHtmlCode ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex-1\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"textarea\", {\n      className: \"w-full min-h-[15em]\",\n      style: {\n        fontFamily: 'courier',\n        whiteSpace: 'nowrap',\n        padding: '0.5em'\n      },\n      value: this.state.textareaValue,\n      onChange: e => {\n        this.setState({\n          textareaValue: e.target.value\n        });\n      }\n    }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-transparent mt-2\",\n      onClick: () => {\n        console.log('this.state.textareaValue', this.state.textareaValue);\n        // this.onChange(this.state.textareaValue);\n        console.log(this.refQuill);\n        this.refQuill.current.editor.clipboard.dangerouslyPasteHTML(this.state.textareaValue);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-arrow-left\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, this.translate('Use this HTML code')))));\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Inputs/Wysiwyg.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Loader.tsx":
/*!***********************************!*\
  !*** ../react-ui/core/Loader.tsx ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   HubletoReactUi: () => (/* binding */ HubletoReactUi)\n/* harmony export */ });\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ \"./node_modules/jquery/dist/jquery.js\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom/client */ \"../react-ui/node_modules/react-dom/client.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Helper */ \"../react-ui/core/Helper.tsx\");\n/* harmony import */ var _Dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Dialog */ \"../react-ui/core/Dialog.tsx\");\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n\n\n\n\n\n\nclass HubletoReactUi {\n  config = {};\n  reactComponents = {};\n  reactElementsWaitingForRender = 0;\n  reactElements = {};\n  renderedModals = [];\n  primeReactTailwindTheme = {\n    dataTable: {\n      // root: { className: 'bg-primary' },\n      headerRow: {\n        className: 'bg-primary'\n      }\n    }\n  };\n  dictionary = null;\n  defaultTranslationContext = 'app';\n  dynamicContentInjectors = {};\n  locale = {};\n\n  /**\r\n  * Define attributes which will not removed\r\n  */\n  attributesToSkip = ['onclick'];\n  constructor(config) {\n    this.config = config;\n    globalThis.main = this;\n    this.locale = {\n      currencySymbol: config.locale?.currencySymbol ?? '€',\n      decimalsSeparator: config.locale?.decimalsSeparator ?? '.',\n      thousandsSeparator: config.locale?.thousandsSeparator ?? ' '\n    };\n  }\n  setTranslationContext(context) {\n    this.defaultTranslationContext = context;\n  }\n  translate(orig, context, contextInner) {\n    return orig; // to be overridden\n  }\n  addModalToStack(modal) {\n    this.renderedModals.push(modal);\n    // console.log('addModalToStack', this.renderedModals);\n    this.activateLastModalInStack();\n  }\n  removeModalFromStack(modalToDelete) {\n    let keyToDelete = null;\n    this.renderedModals.map((modal, key) => {\n      if (modal.state.stackUid === modalToDelete.state.stackUid) {\n        keyToDelete = key;\n      }\n    });\n    if (keyToDelete !== null) {\n      delete this.renderedModals[keyToDelete];\n      // console.log('removeModalFromStack', this.renderedModals);\n      this.activateLastModalInStack();\n    }\n  }\n  getActiveModalInStack() {\n    let activeModal = null;\n    this.renderedModals.map((modal, key) => {\n      if (modal.state.isActive) activeModal = modal;\n    });\n    return activeModal;\n  }\n  activateLastModalInStack() {\n    let lastModal = null;\n    this.renderedModals.map((modal, key) => {\n      if (modal) lastModal = modal;\n    });\n\n    // console.log('lastModal', lastModal);\n    if (lastModal) {\n      // console.log('lastModal.state.stackUid', lastModal.state.stackUid);\n      this.renderedModals.map((modal, key) => {\n        if (modal.state.stackUid != lastModal.state.stackUid) {\n          // console.log('isActive: false', modal.state.stackUid);\n          this.renderedModals[key].setState({\n            isActive: false\n          });\n        }\n      });\n      // console.log('isActive: true', lastModal.state.stackUid);\n      lastModal.setState({\n        isActive: true\n      });\n    }\n  }\n  registerModalShortcuts() {\n    document.addEventListener('keydown', function (e) {\n      // console.log('keydown', e);\n      if (e.ctrlKey && e.key === 'k') {\n        globalThis.hubleto.reactElements['global-fulltext-search'].searchRef.current.focus();\n        e.preventDefault();\n      }\n      if (e.ctrlKey && e.key === 's') {\n        const activeModal = globalThis.hubleto.getActiveModalInStack();\n        if (activeModal && activeModal.props.form && activeModal.props.form.current) {\n          activeModal.props.form.current.saveRecord();\n          e.stopPropagation();\n          e.preventDefault();\n        }\n      }\n      if (e.ctrlKey && e.shiftKey && e.key === 'PageDown') {\n        const activeModal = globalThis.hubleto.getActiveModalInStack();\n        if (activeModal && activeModal.props.form && activeModal.props.form.current) {\n          activeModal.props.form.current.openNextRecord();\n          e.stopPropagation();\n          e.preventDefault();\n        }\n      }\n      if (e.ctrlKey && e.shiftKey && e.key === 'PageUp') {\n        const activeModal = globalThis.hubleto.getActiveModalInStack();\n        if (activeModal && activeModal.props.form && activeModal.props.form.current) {\n          activeModal.props.form.current.openPrevRecord();\n          e.stopPropagation();\n          e.preventDefault();\n        }\n      }\n      if (e.key === 'Escape') {\n        const activeModal = globalThis.hubleto.getActiveModalInStack();\n        if (activeModal) {\n          if (activeModal.props.form && activeModal.props.form.current && activeModal.props.form.current.closeForm) {\n            activeModal.props.form.current.closeForm();\n          } else {\n            activeModal.close();\n          }\n        }\n      }\n    });\n  }\n  getValidationErrorMessage(messageString) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"b\", null, this.translate('Some inputs need your attention', 'Hubleto\\\\Erp\\\\Loader', 'HubletoReactUi')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"br\", null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"br\", null), messageString);\n  }\n  getDuplicateEntryErrorMessage(message) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"b\", null, this.translate('Duplicate entry error', 'Hubleto\\\\Erp\\\\Loader', 'HubletoReactUi')), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"br\", null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"br\", null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", null, message));\n  }\n  getGenericErrorMessage(message, code, details) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"pre\", {\n      className: \"text-red-800 text-base\"\n    }, message), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n      className: \"text-xs mt-4 text-gray-400\"\n    }, code == 0 ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", null, \"Error #\", code), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", null, details)));\n  }\n  showDialog(content, props) {\n    const root = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(document.getElementById('app-dialogs'));\n    this.lastShownDialogRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createRef();\n    props.headerClassName = 'dialog-header ' + (props.headerClassName ?? '');\n    props.contentClassName = 'dialog-content ' + (props.contentClassName ?? '');\n    root.render(/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_Dialog__WEBPACK_IMPORTED_MODULE_5__[\"default\"], _extends({\n      ref: this.lastShownDialogRef,\n      uid: 'app_dialog_' + uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"]().replace('-', '_'),\n      visible: true,\n      style: {\n        minWidth: '50vw'\n      }\n    }, props), content)));\n  }\n  showDialogDanger(content, props) {\n    let defaultProps = {\n      headerClassName: 'dialog-danger-header',\n      contentClassName: 'dialog-danger-content',\n      header: \"🥴 Ooops\",\n      footer: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n        className: \"flex w-full justify-start\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"button\", {\n        className: \"btn btn-transparent\",\n        onClick: () => {\n          this.lastShownDialogRef.current.hide();\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"i\", {\n        className: \"fas fa-check\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n        className: \"text\"\n      }, this.translate('OK, I understand', 'Hubleto\\\\Erp\\\\Loader', 'HubletoReactUi'))))\n    };\n    if (!props) props = {};\n    if (!props.headerClassName) props.headerClassName = defaultProps.headerClassName;\n    if (!props.contentClassName) props.contentClassName = defaultProps.contentClassName;\n    if (!props.header) props.header = defaultProps.header;\n    if (!props.footer) props.footer = defaultProps.footer;\n    this.showDialog(content, props);\n  }\n  showDialogWarning(content, props) {\n    let defaultProps = {\n      headerClassName: 'dialog-warning-header',\n      contentClassName: 'dialog-warning-content',\n      header: this.translate('Warning', 'Hubleto\\\\Erp\\\\Loader', 'HubletoReactUi'),\n      footer: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n        className: \"flex w-full justify-start\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"button\", {\n        className: \"btn btn-transparent\",\n        onClick: () => {\n          this.lastShownDialogRef.current.hide();\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"i\", {\n        className: \"fas fa-check\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n        className: \"text\"\n      }, this.translate('OK, I understand', 'Hubleto\\\\Erp\\\\Loader', 'HubletoReactUi'))))\n    };\n    if (!props) props = {};\n    if (!props.headerClassName) props.headerClassName = defaultProps.headerClassName;\n    if (!props.contentClassName) props.contentClassName = defaultProps.contentClassName;\n    if (!props.header) props.header = defaultProps.header;\n    if (!props.footer) props.footer = defaultProps.footer;\n    this.showDialog(content, props);\n  }\n  showDialogConfirm(content, props) {\n    const propsCloned = {\n      ...props\n    };\n    let defaultProps = {\n      headerClassName: 'dialog-confirm-header',\n      contentClassName: 'dialog-confirm-content',\n      header: this.translate('Confirm', 'Hubleto\\\\Erp\\\\Loader', 'HubletoReactUi'),\n      footer: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n        className: \"flex w-full justify-between\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"button\", {\n        className: \"btn \" + propsCloned.yesButtonClass,\n        onClick: () => {\n          this.lastShownDialogRef.current.hide();\n          propsCloned.onYes();\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"i\", {\n        className: \"fas fa-check\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n        className: \"text\"\n      }, propsCloned.yesText)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"button\", {\n        className: \"btn \" + propsCloned.noButtonClass,\n        onClick: () => {\n          this.lastShownDialogRef.current.hide();\n          propsCloned.onNo();\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"i\", {\n        className: \"fas fa-xmark\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"span\", {\n        className: \"text\"\n      }, propsCloned.noText))))\n    };\n    delete props.yesButtonClass;\n    delete props.yesText;\n    delete props.onYes;\n    delete props.noButtonClass;\n    delete props.noText;\n    delete props.onNo;\n    if (!props.headerClassName) props.headerClassName = defaultProps.headerClassName;\n    if (!props.contentClassName) props.contentClassName = defaultProps.contentClassName;\n    if (!props.header) props.footer = defaultProps.header;\n    if (!props.footer) props.footer = defaultProps.footer;\n    this.showDialog(content, props);\n  }\n  registerReactComponent(elementName, elementObject) {\n    this.reactComponents[elementName] = elementObject;\n  }\n\n  /**\r\n   * Get specific hubleto component with destructed params\r\n   */\n  renderReactElement(componentName, props, children) {\n    if (!componentName) return null;\n    let componentNamePascalCase = (0,_Helper__WEBPACK_IMPORTED_MODULE_4__.kebabToPascal)(componentName);\n    if (!this.reactComponents[componentNamePascalCase]) {\n      console.error('Hubleto: renderReactElement(' + componentNamePascalCase + '). Component does not exist. Use `hubleto.registerReactComponent()` in your project\\'s index.tsx file.');\n      return null;\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(this.reactComponents[componentNamePascalCase], props, children);\n    }\n  }\n  getReactElement(elementId) {\n    return this.reactElements[elementId] ?? null;\n  }\n\n  /**\r\n  * Validate attribute value\r\n  * E.g. if string contains Callback create frunction from string\r\n  */\n  // getValidatedAttributeValue(attributeName: string, attributeValue: any): Function|any {\n  //   return attributeName.toLowerCase().includes('callback') ? new Function(attributeValue) : attributeValue;\n  // }\n\n  convertDomToReact(domElement) {\n    let isHubletoComponent = false;\n    let component = '';\n    let componentProps = {};\n    if (domElement.nodeType == 3) {\n      /* Text node: https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType */\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, domElement.textContent);\n    } else {\n      if (domElement.tagName.substring(0, 4) == 'APP-') {\n        isHubletoComponent = true;\n        component = domElement.tagName.substring(4).toLowerCase();\n      } else if (domElement.tagName.substring(0, 9) == 'HBLREACT-') {\n        isHubletoComponent = true;\n        component = domElement.tagName.substring(9).toLowerCase();\n      } else {\n        component = domElement.tagName.toLowerCase();\n      }\n      let attributesDoNotConvert = [];\n      for (let i in domElement.attributes) {\n        if (domElement.attributes[i].name == 'hubleto-do-not-convert') {\n          attributesDoNotConvert = domElement.attributes[i].value.split(',');\n        }\n      }\n      let i = 0;\n      while (domElement.attributes.length > i) {\n        let attributeName = domElement.attributes[i].name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());\n        let attributeValue = domElement.attributes[i].value;\n        if (!attributesDoNotConvert.includes(attributeName)) {\n          if (attributeName.startsWith('json:')) {\n            attributeName = attributeName.replace('json:', '');\n            attributeValue = JSON.parse(attributeValue);\n          } else if (attributeName.startsWith('string:')) {\n            attributeName = attributeName.replace('string:', '');\n            attributeValue = attributeValue;\n          } else if (attributeName.startsWith('int:')) {\n            attributeName = attributeName.replace('int:', '');\n            attributeValue = parseInt(attributeValue);\n          } else if (attributeName.startsWith('bool:')) {\n            attributeName = attributeName.replace('bool:', '');\n            attributeValue = attributeValue == 'true';\n          } else if (attributeName.startsWith('function:')) {\n            attributeName = attributeName.replace('function:', '');\n            attributeValue = new Function(attributeValue);\n          } else if (attributeValue === 'true') {\n            attributeValue = true;\n          } else if (attributeValue === 'false') {\n            attributeValue = false;\n          } else if ((0,_Helper__WEBPACK_IMPORTED_MODULE_4__.isValidJson)(attributeValue)) {\n            attributeValue = JSON.parse(attributeValue);\n          }\n        }\n        componentProps[attributeName] = attributeValue;\n        i++;\n        // if (this.attributesToSkip.includes(attributeName)) {\n        //   i++;\n        //   continue;\n        // }\n\n        // // Remove attributes from HTML DOM\n        // domElement.removeAttribute(domElement.attributes[i].name);\n      }\n      let children = [];\n      domElement.childNodes.forEach((subElement, _index) => {\n        children.push(this.convertDomToReact(subElement));\n      });\n      let reactElement = null;\n      if (isHubletoComponent) {\n        if (componentProps['uid'] == undefined) {\n          componentProps['uid'] = '_' + uuid__WEBPACK_IMPORTED_MODULE_3__[\"default\"]().replace('-', '_');\n        }\n        reactElement = this.renderReactElement(component, componentProps, children);\n        domElement.setAttribute('hubleto-react-rendered', 'true');\n      } else {\n        reactElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(component, componentProps, children);\n      }\n      return reactElement;\n    }\n  }\n\n  /**\r\n  * Render React component (create HTML tag root and render)\r\n  */\n  renderReactElements(rootElement) {\n    if (!rootElement) rootElement = document;\n    rootElement.querySelectorAll('*').forEach((element, _index) => {\n      if (element.tagName.substring(0, 4) != 'APP-' && element.tagName.substring(0, 9) != 'HBLREACT-') return;\n      if (element.attributes['hubleto-react-rendered']) return;\n      if (element.tagName.substring(0, 4) == 'APP-') {\n        console.warn('Using `<app-...>` tags in your HTML is deprecated. Use `<hblreact-...>` instead.' + ' (found ' + element.tagName + ')');\n      }\n\n      //@ts-ignore\n      jquery__WEBPACK_IMPORTED_MODULE_0___default()(rootElement).addClass('react-elements-rendering');\n      let elementRoot = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(element);\n      this.reactElementsWaitingForRender++;\n      const reactElement = this.convertDomToReact(element);\n      elementRoot.render(reactElement);\n\n      // if (reactElement.props['uid']) {\n      //   this.reactElements[reactElement.props['uid']] = reactElement;\n      // }\n\n      // https://stackoverflow.com/questions/75388021/migrate-reactdom-render-with-async-callback-to-createroot\n      // https://blog.saeloun.com/2021/07/15/react-18-adds-new-root-api/\n      requestIdleCallback(() => {\n        this.reactElementsWaitingForRender--;\n        if (this.reactElementsWaitingForRender <= 0) {\n          //@ts-ignore\n          jquery__WEBPACK_IMPORTED_MODULE_0___default()(rootElement).removeClass('react-elements-rendering').addClass('react-elements-rendered');\n        }\n      });\n    });\n  }\n  registerDynamicContent(contentGroup, injector) {\n    if (!this.dynamicContentInjectors[contentGroup]) {\n      this.dynamicContentInjectors[contentGroup] = [];\n    }\n    this.dynamicContentInjectors[contentGroup].push(injector);\n  }\n  injectDynamicContent(contentGroup, injectorProps) {\n    if (this.dynamicContentInjectors && this.dynamicContentInjectors[contentGroup]) {\n      let dynamicContent = [];\n      for (let i in this.dynamicContentInjectors[contentGroup]) {\n        dynamicContent.push(/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(this.dynamicContentInjectors[contentGroup][i], injectorProps));\n      }\n      return dynamicContent;\n      // return dynamicContent.map((content, key) => <div key={key}>{content}</div>);\n    } else {\n      return null;\n    }\n  }\n  numberFormat(value, decimals = 2, decimalsSeparator = '', thousandsSeparator = '') {\n    if (decimalsSeparator == '') decimalsSeparator = this.locale.decimalsSeparator;\n    if (thousandsSeparator == '') thousandsSeparator = this.locale.thousandsSeparator;\n    value = (value ?? '').toString().replace(/[^0-9+\\-Ee.]/g, '');\n    let n = parseFloat(value);\n    if (isNaN(n)) n = 0;\n    n = Math.round(n * Math.pow(10, decimals)) / Math.pow(10, decimals);\n    let [integerPart, fractionalPart] = n.toString().split('.');\n    integerPart = integerPart.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousandsSeparator);\n    if (fractionalPart === undefined) {\n      fractionalPart = '';\n    }\n    while (fractionalPart.length < decimals) {\n      fractionalPart += '0';\n    }\n    return integerPart + (decimals > 0 ? decimalsSeparator + fractionalPart : '');\n  }\n  currencyFormat(value, decimals = 2) {\n    return this.numberFormat(value, decimals) + ' ' + this.locale.currencySymbol;\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Loader.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Modal.tsx":
/*!**********************************!*\
  !*** ../react-ui/core/Modal.tsx ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Modal)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var uuid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uuid */ \"../react-ui/node_modules/uuid/dist/esm-browser/v4.js\");\n\n\nclass Modal extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n  constructor(props) {\n    super(props);\n    if (this.props.uid) {\n      globalThis.hubleto.reactElements[this.props.uid] = this;\n    }\n    this.state = this.getStateFromProps(props);\n  }\n  getStateFromProps(props) {\n    return {\n      uid: props.uid ?? uuid__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\n      type: props.type ?? \"right\",\n      isOpen: props.isOpen ?? false,\n      title: props.title,\n      isFullscreen: props.isFullscreen,\n      stackUid: uuid__WEBPACK_IMPORTED_MODULE_1__[\"default\"](),\n      isActive: false\n    };\n  }\n  componentDidMount() {\n    globalThis.hubleto.addModalToStack(this);\n  }\n  componentWillUnmount() {\n    globalThis.hubleto.removeModalFromStack(this);\n  }\n\n  /**\r\n   * This function trigger if something change, for Form id of record\r\n   */\n  componentDidUpdate(prevProps) {\n    if (prevProps.title != this.props.title || prevProps.isOpen != this.props.isOpen) {\n      this.setState(this.getStateFromProps(this.props));\n    }\n  }\n  close() {\n    if (this.props.onClose) this.props.onClose(this);\n  }\n  render() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Modal.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/ModalForm.tsx":
/*!**************************************!*\
  !*** ../react-ui/core/ModalForm.tsx ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ ModalForm)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Modal */ \"../react-ui/core/Modal.tsx\");\n\n\nclass ModalForm extends _Modal__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n  static defaultProps = {\n    type: 'centered'\n  };\n  render() {\n    if (this.state.isOpen) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        key: this.props.uid,\n        id: \"hubleto-modal-\" + this.props.uid,\n        className: \"modal \" + (this.state.isFullscreen ? \"fullscreen\" : \"\") + \" \" + this.props.type\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"modal-inner\" + (this.props.type === 'inside-parent' ? \" !bg-white dark:!bg-gray-900 dark:!border-gray-700\" : \"\")\n      }, this.props.children)));\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/ModalForm.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/ModalSimple.tsx":
/*!****************************************!*\
  !*** ../react-ui/core/ModalSimple.tsx ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ ModalSimple)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Modal */ \"../react-ui/core/Modal.tsx\");\n\n\nclass ModalSimple extends _Modal__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n  static defaultProps = {\n    type: 'centered'\n  };\n  render() {\n    if (this.state.isOpen) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        key: this.props.uid,\n        id: \"hubleto-modal-\" + this.props.uid,\n        className: \"modal \" + this.props.type\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"modal-inner\"\n      }, this.props.showHeader ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"modal-header \" + (this.state.isActive ? \"active\" : \"\")\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"modal-header-left\"\n      }, this.props.headerLeft), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"modal-header-title\"\n      }, this.props.title), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"modal-header-right\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n        className: \"btn btn-close\",\n        type: \"button\",\n        \"data-dismiss\": \"modal\",\n        \"aria-label\": \"Close\",\n        onClick: () => {\n          this.close();\n        }\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-xmark\"\n      })))))) : null, this.props.topMenu ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"modal-top-menu\"\n      }, this.props.topMenu) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"modal-body\"\n      }, this.props.children))));\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/ModalSimple.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Notification.tsx":
/*!*****************************************!*\
  !*** ../react-ui/core/Notification.tsx ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var notyf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! notyf */ \"../react-ui/node_modules/notyf/notyf.es.js\");\n/* harmony import */ var notyf_notyf_min_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! notyf/notyf.min.css */ \"../react-ui/node_modules/notyf/notyf.min.css\");\n\n\nclass Notification extends notyf__WEBPACK_IMPORTED_MODULE_0__.Notyf {\n  constructor() {\n    super({\n      types: [{\n        type: 'info',\n        background: '#54b4d3',\n        icon: {\n          className: 'fas fa-info',\n          tagName: 'i',\n          color: '#fff'\n        },\n        dismissible: false\n      }]\n    });\n  }\n  error(payload) {\n    return super.error(payload);\n  }\n  custom(options) {\n    const notification = this.open({\n      type: options.type,\n      message: options.message,\n      dismissible: options.dissmisible ?? false,\n      duration: options.duration ?? 3000\n    });\n    return notification;\n  }\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (new Notification());\n\n//# sourceURL=webpack:///../react-ui/core/Notification.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Request.tsx":
/*!************************************!*\
  !*** ../react-ui/core/Request.tsx ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ \"../react-ui/node_modules/axios/lib/axios.js\");\n\nclass Request {\n  getProjectUrl() {\n    if (!globalThis.hubleto.config.projectUrl) {\n      console.warn('HubletoReactUi.Request: projectUrl is not set. Your AJAX requests might not work. To suppress this warning, set projectUrl to empty value.');\n      console.warn('To set the value add a script tag in HTML head section and set window.configEnv.projectUrl.');\n      console.warn('To suppress this warning, set may set projectUrl to an empty value.');\n    }\n    ;\n    return globalThis.hubleto.config.projectUrl + '/';\n  }\n  alertOnError(responseData) {\n    globalThis.hubleto.showDialogWarning(responseData.message);\n  }\n  get(url, queryParams, successCallback, errorCallback) {\n    document.body.classList.add(\"ajax-loading\");\n    axios__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(this.getProjectUrl() + url, {\n      params: queryParams\n    }).then(res => {\n      const responseData = res.data;\n      document.body.classList.remove(\"ajax-loading\");\n      if (responseData.status == 'error') {\n        if (errorCallback) errorCallback(responseData);else this.alertOnError(responseData);\n      } else if (successCallback) successCallback(responseData);\n    }).catch(err => this.catchHandler(url, err, errorCallback));\n  }\n  post(url, postData, queryParams, successCallback, errorCallback) {\n    document.body.classList.add(\"ajax-loading\");\n    axios__WEBPACK_IMPORTED_MODULE_0__[\"default\"].post(this.getProjectUrl() + url, postData, {\n      params: queryParams\n    }).then(res => {\n      const responseData = res.data;\n      document.body.classList.remove(\"ajax-loading\");\n      if (responseData.status == 'error') {\n        if (errorCallback) errorCallback(responseData);else this.alertOnError(responseData);\n      } else if (successCallback) successCallback(responseData);\n    }).catch(err => this.catchHandler(url, err, errorCallback));\n  }\n  put(url, putData, queryParams, successCallback, errorCallback) {\n    axios__WEBPACK_IMPORTED_MODULE_0__[\"default\"].put(this.getProjectUrl() + url, putData, {\n      params: queryParams\n    }).then(res => {\n      const responseData = res.data;\n      if (responseData.status == 'error') {\n        if (errorCallback) errorCallback(responseData);else this.alertOnError(responseData);\n      } else if (successCallback) successCallback(responseData);\n    }).catch(err => this.catchHandler(url, err, errorCallback));\n  }\n  patch(url, patchData, queryParams, successCallback, errorCallback) {\n    axios__WEBPACK_IMPORTED_MODULE_0__[\"default\"].patch(this.getProjectUrl() + url, patchData, {\n      params: queryParams\n    }).then(res => {\n      const responseData = res.data;\n      if (responseData.status == 'error') {\n        if (errorCallback) errorCallback(responseData);else this.alertOnError(responseData);\n      } else if (successCallback) successCallback(responseData);\n    }).catch(err => this.catchHandler(url, err, errorCallback));\n  }\n  delete(url, queryParams, successCallback, errorCallback) {\n    axios__WEBPACK_IMPORTED_MODULE_0__[\"default\"].delete(this.getProjectUrl() + url, {\n      params: queryParams\n    }).then(res => {\n      const responseData = res.data;\n      if (responseData.status == 'error') {\n        this.alertOnError(responseData);\n        if (errorCallback) errorCallback(responseData);\n      } else if (successCallback) successCallback(responseData);\n    }).catch(err => this.catchHandler(url, err, errorCallback));\n  }\n  catchHandler(url, err, errorCallback) {\n    if (err.response) {\n      this.fatalErrorNotification(url, err.response.data);\n      if (errorCallback) errorCallback(err.response);\n    } else {\n      console.error('HubletoReactUi: Request @ ' + url + ' unknown error.');\n      console.error(err);\n    }\n  }\n  fatalErrorNotification(url, error) {\n    console.error('HubletoReactUi request @ ' + url + ' finished with error: ', error);\n    if (typeof error == 'string') {\n      globalThis.hubleto.showDialogDanger(error);\n    } else {\n      switch (error.code) {\n        case 87335:\n          // globalThis.hubleto.showDialogWarning(globalThis.hubleto.getValidationErrorMessage(error.message));\n          break;\n        case 23000:\n          globalThis.hubleto.showDialogDanger(globalThis.hubleto.getDuplicateEntryErrorMessage(error.message));\n          break;\n        default:\n          let content = globalThis.hubleto.getGenericErrorMessage(error.message, error.code, url);\n          globalThis.hubleto.showDialogDanger(content);\n          break;\n      }\n    }\n  }\n}\nconst request = new Request();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (request);\n\n//# sourceURL=webpack:///../react-ui/core/Request.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Table.tsx":
/*!**********************************!*\
  !*** ../react-ui/core/Table.tsx ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Table)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Helper */ \"../react-ui/core/Helper.tsx\");\n/* harmony import */ var _ErrorBoundary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ErrorBoundary */ \"../react-ui/core/ErrorBoundary.tsx\");\n/* harmony import */ var _ModalForm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ModalForm */ \"../react-ui/core/ModalForm.tsx\");\n/* harmony import */ var _Form__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Form */ \"../react-ui/core/Form.tsx\");\n/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Notification */ \"../react-ui/core/Notification.tsx\");\n/* harmony import */ var _TranslatedComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./TranslatedComponent */ \"../react-ui/core/TranslatedComponent.tsx\");\n/* harmony import */ var primereact_selectbutton__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! primereact/selectbutton */ \"../react-ui/node_modules/primereact/selectbutton/selectbutton.esm.js\");\n/* harmony import */ var primereact_api__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! primereact/api */ \"../react-ui/node_modules/primereact/api/api.esm.js\");\n/* harmony import */ var primereact_datatable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! primereact/datatable */ \"../react-ui/node_modules/primereact/datatable/datatable.esm.js\");\n/* harmony import */ var primereact_column__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! primereact/column */ \"../react-ui/node_modules/primereact/column/column.esm.js\");\n/* harmony import */ var primereact_progressbar__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! primereact/progressbar */ \"../react-ui/node_modules/primereact/progressbar/progressbar.esm.js\");\n/* harmony import */ var _InputFactory__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./InputFactory */ \"../react-ui/core/InputFactory.tsx\");\n/* harmony import */ var _Inputs_DateTime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Inputs/DateTime */ \"../react-ui/core/Inputs/DateTime.tsx\");\n/* harmony import */ var _Request__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Request */ \"../react-ui/core/Request.tsx\");\n\n\n\n\n\n\n\n\n\nconst primeReactLocaleMap = {\n  sk: {\n    choose: 'Vybrať'\n  },\n  cs: {\n    choose: 'Vybrat'\n  },\n  pl: {\n    choose: 'Wybierz'\n  },\n  de: {\n    choose: 'Auswählen'\n  },\n  ro: {\n    choose: 'Alege'\n  },\n  it: {\n    choose: 'Scegli'\n  },\n  es: {\n    choose: 'Elegir'\n  },\n  fr: {\n    choose: 'Choisir'\n  }\n};\n\n\n\n\n\n\n\n\n// Laravel pagination\n\nclass Table extends _TranslatedComponent__WEBPACK_IMPORTED_MODULE_6__[\"default\"] {\n  static defaultProps = {\n    itemsPerPage: 35,\n    descriptionSource: 'both'\n  };\n  refFulltextSearchInput = null;\n  refForm = null;\n  refFormModal = null;\n  dt = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)();\n  constructor(props) {\n    super(props);\n    globalThis.hubleto.reactElements[this.props.uid] = this;\n    const lang = globalThis.hubleto.language;\n    if (lang && primeReactLocaleMap[lang]) {\n      (0,primereact_api__WEBPACK_IMPORTED_MODULE_8__.addLocale)(lang, primeReactLocaleMap[lang]);\n      (0,primereact_api__WEBPACK_IMPORTED_MODULE_8__.locale)(lang);\n    }\n    this.refFulltextSearchInput = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n    this.refForm = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n    this.refFormModal = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n    this.model = this.props.model ?? '';\n    this.state = this.getStateFromProps(props);\n  }\n  getStateFromProps(props) {\n    let state = {\n      endpoint: props.endpoint ? props.endpoint : globalThis.hubleto.config.defaultTableEndpoint ?? {\n        describeTable: 'api/table/describe',\n        loadTableData: 'api/record/load-table-data',\n        saveRecord: 'api/record/save',\n        deleteRecord: 'api/record/delete'\n      },\n      recordId: props.recordId,\n      activeRowId: props.recordId,\n      formEndpoint: props.formEndpoint ? props.formEndpoint : globalThis.hubleto.config.defaultFormEndpoint ?? null,\n      formProps: {\n        model: this.model,\n        uid: props.uid\n      },\n      formActiveTabUid: 'default',\n      loadingData: false,\n      page: 1,\n      itemsPerPage: this.props.itemsPerPage,\n      inlineEditingEnabled: props.inlineEditingEnabled ? props.inlineEditingEnabled : false,\n      isInlineEditing: props.isInlineEditing ? props.isInlineEditing : false,\n      isUsedAsInput: props.isUsedAsInput ? props.isUsedAsInput : false,\n      selection: props.selection ?? [],\n      async: props.async ?? true,\n      readonly: props.readonly ?? false,\n      customEndpointParams: this.props.customEndpointParams ?? {},\n      fulltextSearch: props.fulltextSearch ?? '',\n      columnSearch: props.columnSearch ?? {},\n      filters: props.filters ?? {},\n      sidebarFilterHidden: false,\n      invalidInputs: props.invalidInputs ?? [],\n      tableUpdateIteration: 0,\n      editMode: '',\n      myRootUrl: window.location.protocol + \"//\" + window.location.host + window.location.pathname\n    };\n    if (props.description) state.description = props.description;\n    if (props.data) state.data = props.data;\n    return state;\n  }\n  componentDidMount() {\n    if (this.state.async) {\n      this.loadTableDescription(() => {\n        ;\n        this.loadData();\n      });\n    }\n  }\n  componentDidUpdate(prevProps) {\n    if (prevProps.formProps?.id != this.props.formProps?.id\n    // || (prevProps.parentRecordId != this.props.parentRecordId)\n    ) {\n      this.state.formProps = this.props.formProps;\n      if (this.state.async) {\n        this.loadTableDescription();\n        this.loadData();\n      }\n    }\n    if (prevProps.data != this.props.data || prevProps.description != this.props.description) {\n      this.setState(this.getStateFromProps(this.props), () => {\n        if (this.state.async) {\n          this.loadTableDescription();\n          this.loadData();\n        }\n      });\n    }\n    if (prevProps.invalidInputs !== this.props.invalidInputs) {\n      this.setState({\n        invalidInputs: this.props.invalidInputs ?? [],\n        tableUpdateIteration: this.state.tableUpdateIteration + 1\n      });\n    }\n  }\n  onAfterLoadTableDescription(description) {\n    return description;\n  }\n\n  // getEndpointUrl(): string {\n  //   return this.state.endpoint;\n  // }\n\n  getEndpointUrl(action) {\n    return this.state.endpoint[action] ?? '';\n  }\n  getEndpointParams() {\n    let filters = this.state.filters;\n    if (this.state.description?.ui?.filters) {\n      Object.keys(this.state.description.ui.filters).map(filterName => {\n        const filter = this.state.description.ui.filters[filterName];\n        if (!filters[filterName] && (filter.default ?? null) !== null) {\n          filters[filterName] = filter.default;\n        }\n      });\n    }\n    return {\n      model: this.model,\n      filters: this.state.filters,\n      // parentRecordId: this.props.parentRecordId ? this.props.parentRecordId : 0,\n      // parentFormModel: this.props.parentFormModel ? this.props.parentFormModel : '',\n      tag: this.props.tag,\n      context: this.props.context,\n      dataView: this.state.description?.ui?.dataView,\n      view: this.props.view,\n      __IS_AJAX__: '1',\n      ...this.props.customEndpointParams\n    };\n  }\n  getCsvImportEndpointParams() {\n    return null;\n  }\n  getSelectionMode() {\n    return this.props.selectionMode ?? this.state.description?.ui?.selectionMode ?? '';\n  }\n  getTableProps() {\n    const sortOrders = {\n      'asc': 1,\n      'desc': -1\n    };\n    const totalRecords = this.state.data?.total ?? 0;\n    const showColumnSearch = this.state.description?.ui?.showColumnSearch;\n    const selectionMode = this.getSelectionMode();\n    let tableProps = {\n      // Dusan 19.11.2025: sposobovalo to konzolovu chybu, docasne zakomentovane\n      // invalidInputs: this.props.invalidInputs,\n      key: this.state.tableUpdateIteration,\n      ref: this.dt,\n      value: this.state.data?.records,\n      dataKey: \"id\",\n      first: (this.state.page - 1) * this.state.itemsPerPage,\n      paginator: totalRecords > this.state.itemsPerPage,\n      lazy: true,\n      editMode: this.state.editMode,\n      rows: this.state.itemsPerPage,\n      filterDisplay: showColumnSearch ? 'row' : null,\n      totalRecords: totalRecords,\n      rowsPerPageOptions: [5, 15, 30, 50, 100, 200, 300, 500, 750, 1000, 1500, 2000],\n      paginatorTemplate: \"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown\",\n      currentPageReportTemplate: \"{first}-{last} / {totalRecords}\",\n      onRowClick: data => this.onRowClick(data.data),\n      onRowSelect: event => this.onRowSelect(event),\n      onRowUnselect: event => this.onRowUnselect(event),\n      onPage: event => this.onPaginationChangeCustom(event),\n      onSort: event => this.onOrderByChangeCustom(event),\n      sortOrder: sortOrders[this.state.description?.ui?.orderBy?.direction ?? 'desc'],\n      sortField: this.state.description?.ui?.orderBy?.field ?? 'id',\n      rowClassName: rowData => this.rowClassName(rowData),\n      stripedRows: true,\n      //globalFilter={globalFilter}\n      //header={header}\n      emptyMessage: this.props.description?.ui?.emptyMessage || /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"p-2\"\n      }, this.translate('No data.', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'))),\n      selectAll: true,\n      selection: this.state.selection,\n      selectionMode: selectionMode == 'single' ? 'radiobutton' : selectionMode == 'multiple' ? 'checkbox' : null,\n      onSelectionChange: event => {\n        this.setState({\n          selection: event.value\n        }, () => {\n          this.onSelectionChange();\n        });\n      },\n      footer: () => {\n        let hiddenRecordsCount = 0;\n        let footer = [];\n        if (this.state.data?.records) {\n          this.state.data?.records.map((item, index) => {\n            if (item._PERMISSIONS && !item._PERMISSIONS[1]) hiddenRecordsCount++;\n          });\n        }\n        if (hiddenRecordsCount > 0) {\n          footer.push(/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"badge badge-warning\"\n          }, \"\\u26A0 \", hiddenRecordsCount, \" \", this.translate('records were hidden based on your permissions.', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table')));\n        }\n        if (this.state.description?.ui?.showFooter) footer.push(this.renderFooter());\n        return footer;\n      }\n    };\n    return tableProps;\n  }\n  reload() {\n    this.setState({\n      isInitialized: false\n    }, () => {\n      this.loadTableDescription(() => {\n        this.loadData();\n      });\n    });\n  }\n  loadTableDescription(successCallback) {\n    if (this.props.descriptionSource == 'props') return;\n    _Request__WEBPACK_IMPORTED_MODULE_14__[\"default\"].get(this.getEndpointUrl('describeTable'), this.getEndpointParams(), description => {\n      try {\n        if (this.props.description && this.props.descriptionSource == 'both') description = (0,_Helper__WEBPACK_IMPORTED_MODULE_1__.deepObjectMerge)(description, this.props.description);\n        description = this.onAfterLoadTableDescription(description);\n        this.setState({\n          description: description\n        }, () => {\n          if (successCallback) successCallback(description);\n        });\n      } catch (err) {\n        _Notification__WEBPACK_IMPORTED_MODULE_5__[\"default\"].error(err.message);\n      }\n    });\n  }\n  loadData() {\n    if (this.props.data) {\n      this.setState({\n        data: this.props.data\n      });\n    } else {\n      this.setState({\n        loadingData: true\n      }, () => {\n        _Request__WEBPACK_IMPORTED_MODULE_14__[\"default\"].get(this.getEndpointUrl('loadTableData'), {\n          ...this.getEndpointParams(),\n          filterBy: this.state.filterBy,\n          model: this.model,\n          orderBy: this.state.description?.ui?.orderBy ?? {\n            field: 'id',\n            direction: 'desc'\n          },\n          page: this.state.page ?? 0,\n          itemsPerPage: this.state.itemsPerPage ?? 35,\n          // parentRecordId: this.props.parentRecordId ? this.props.parentRecordId : 0,\n          // parentFormModel: this.props.parentFormModel ? this.props.parentFormModel : '',\n          fulltextSearch: this.state.fulltextSearch,\n          columnSearch: this.state.columnSearch,\n          tag: this.props.tag,\n          context: this.props.context,\n          where: this.props.where,\n          __IS_AJAX__: '1'\n        }, data => {\n          this.setState({\n            loadingData: false,\n            data: data\n          }, () => {\n            if (this.props.onAfterLoadData) {\n              this.props.onAfterLoadData(this);\n            }\n          });\n        });\n      });\n    }\n  }\n  getFormProps() {\n    return {\n      // isInitialized: false,\n      ref: this.refForm,\n      modal: this.refFormModal,\n      parentTable: this,\n      uid: this.props.uid + '_form',\n      model: this.model,\n      tag: this.props.tag,\n      activeTabUid: this.props.formActiveTabUid,\n      context: this.props.context,\n      id: this.state.recordId ?? null,\n      prevId: this.state?.recordPrevId ?? 0,\n      nextId: this.state?.recordNextId ?? 0,\n      endpoint: this.state.formEndpoint,\n      showInModal: true,\n      description: this.props.formProps?.description,\n      ...(this.props.formCustomProps ?? {}),\n      customEndpointParams: this.state.customEndpointParams ?? {},\n      onClose: () => {\n        this.closeForm();\n      },\n      onSaveCallback: (form, saveResponse) => {\n        this.reload();\n        if (this.props.closeFormAfterSave ?? false) {\n          this.closeForm();\n        } else if (saveResponse && saveResponse.savedRecord.id) {\n          this.openForm(saveResponse.savedRecord.id);\n        }\n      },\n      onCopyCallback: (form, saveResponse) => {\n        this.loadData();\n        this.openForm(saveResponse.savedRecord.id);\n      },\n      onDeleteCallback: () => {\n        this.loadData();\n        this.setState({\n          recordId: null\n        });\n      }\n    };\n  }\n  getFormModalProps() {\n    return {\n      ref: this.refFormModal,\n      uid: this.props.uid + '_form',\n      type: this.state.recordId == -1 ? 'centered' : 'right',\n      hideHeader: true,\n      isOpen: this.state.recordId !== null,\n      form: this.refForm,\n      onClose: () => {\n        this.closeForm();\n      },\n      ...this.props.formModal\n    };\n  }\n  cellClassName(columnName, column, rowData) {\n    let cellClassName = 'table-cell-content ' + (column.cssClass ?? '');\n    if (column.tableCssClass) {\n      cellClassName += ' ' + column.tableCssClass;\n    }\n    if (column.enumValues) {\n      cellClassName += ' badge ' + (column.enumCssClasses ? column.enumCssClasses[rowData[columnName]] ?? '' : '');\n    } else {\n      cellClassName += ' column-' + column.type;\n    }\n    if (column.textAlign == 'right') cellClassName += ' text-right float-right';else if (column.textAlign == 'center') cellClassName += ' text-center m-auto';else cellClassName += ' text-left';\n    if (column.colorScale) {\n      const min = this.getMinColumnValue(columnName);\n      const max = this.getMaxColumnValue(columnName);\n      const val = Number(rowData[columnName] ?? 0);\n      const step = (max - min) / 5;\n      const colorIndex = Math.min(5, Math.floor((val - min) / step) + 1);\n      cellClassName += ' ' + column.colorScale + '---step-' + colorIndex;\n    }\n    return cellClassName;\n  }\n  cellCssStyle(columnName, column, rowData) {\n    return column.cssStyle ?? {};\n  }\n  getMinColumnValue(columnName) {\n    let min = 0;\n    let assigned = false;\n    if (this.state.data?.records) {\n      for (let i in this.state.data.records) {\n        let val = Number(this.state.data.records[i][columnName] ?? 0);\n        if (!assigned || val < min) min = val;\n        assigned = true;\n      }\n    }\n    return min;\n  }\n  getMaxColumnValue(columnName) {\n    let max = 0;\n    let assigned = false;\n    if (this.state.data?.records) {\n      for (let i in this.state.data.records) {\n        let val = Number(this.state.data.records[i][columnName] ?? 0);\n        if (!assigned || val > max) max = val;\n        assigned = true;\n      }\n    }\n    return max;\n  }\n  rowClassName(rowData) {\n    let cssClasses = [];\n    if (rowData._PERMISSIONS && !rowData._PERMISSIONS[1]) cssClasses.push('hidden-record');\n    if (rowData.id === this.state.activeRowId) cssClasses.push('highlighted');\n    return cssClasses.join(' ');\n  }\n  showAddButton() {\n    if (!this.state.readonly && this.state.description?.ui?.showHeader && this.state.description?.ui?.showAddButton && this.state.description?.permissions?.canCreate) {\n      return true;\n    } else {\n      return false;\n    }\n  }\n  renderAddButton(forEmptyMessage) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      key: \"add-btn\",\n      className: \"btn \" + (forEmptyMessage ? \"btn-white btn-small\" : \"btn-add\"),\n      onClick: () => this.onAddClick()\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-plus\"\n    })), this.state.description?.ui?.addButtonText ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text text-nowrap\"\n    }, this.state.description?.ui?.addButtonText) : null);\n  }\n  showMoreActionsButton() {\n    if (this.state?.description?.ui?.showMoreActionsButton) {\n      return true;\n    } else {\n      return false;\n    }\n  }\n  renderMoreActionsButton() {\n    let moreActions = {\n      showHideFilter: {\n        title: this.translate('Show/Hide filter', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n        icon: 'fas fa-filter',\n        type: 'onclick',\n        onClick: () => {\n          this.setState({\n            sidebarFilterHidden: !this.state.sidebarFilterHidden\n          });\n        }\n      },\n      showAsPlainTable: {\n        title: this.state?.description?.ui?.showAsPlainTable ? this.translate('Show as standard table', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table') : this.translate('Show as plain table', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n        icon: 'fas fa-table',\n        type: 'onclick',\n        onClick: () => {\n          let description = this.state?.description ?? {};\n          if (!description.ui) description.ui = {};\n          description.ui.showAsPlainTable = !description.ui.showAsPlainTable;\n          this.setState({\n            description: description\n          });\n        }\n      },\n      ...(this.state?.description?.ui?.moreActions ?? [])\n    };\n    if (!this.state.readonly) {\n      moreActions['toggleEditMode'] = {\n        title: this.state?.editMode == 'cell' ? this.translate('Disable edit mode', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table') : this.translate('Enable edit mode', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n        icon: 'fas fa-pencil',\n        type: 'onclick',\n        onClick: () => {\n          this.setState({\n            editMode: this.state.editMode == 'cell' ? '' : 'cell'\n          });\n        }\n      };\n    }\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-dropdown btn-transparent\",\n      key: \"more-actions-btn\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-ellipsis-vertical\"\n    })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"menu\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"btn-list text-nowrap\"\n    }, Object.keys(moreActions).map((key, index) => {\n      const action = moreActions[key];\n      const type = action.type ?? '';\n      if (type == 'onclick') {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          key: index,\n          className: \"btn btn-transparent btn-list-item\",\n          onClick: () => {\n            action.onClick();\n          }\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"icon\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n          className: action.icon ?? 'fas fa-grip-lines'\n        })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"text\"\n        }, action.title));\n      }\n      if (type == 'link') {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n          key: index,\n          className: \"btn btn-transparent btn-list-item\",\n          href: action.href\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"icon\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n          className: action.icon ?? 'fas fa-grip-lines'\n        })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"text\"\n        }, action.title));\n      }\n      if (type == 'stateChange') {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          key: index,\n          className: \"btn btn-transparent btn-list-item\",\n          onClick: () => {\n            let newState = this.state;\n            newState[action.state] = action.value;\n            this.setState(newState);\n          }\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"icon\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n          className: action.icon ?? 'fas fa-grip-lines'\n        })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"text\"\n        }, action.title));\n      }\n    }))));\n  }\n  renderHeaderButtons() {\n    let buttons = [];\n    if (this.showAddButton()) buttons.push(this.renderAddButton());\n    if (this.showMoreActionsButton()) buttons.push(this.renderMoreActionsButton());\n\n    // if (this.state?.description?.ui?.filters) {\n    //   buttons.push(\n    //     <button\n    //       className=\"btn btn-transparent hidden md:block\"\n    //       key=\"filters-btn\"\n    //       onClick={() => this.setState({sidebarFilterHidden: !this.state.sidebarFilterHidden})}\n    //     >\n    //       <span className=\"icon\"><i className=\"fas fa-filter\"></i></span>\n    //       <span className=\"text\">{this.translate('Show/Hide filter', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table')}</span>\n    //     </button>\n    //   );\n    // }\n    return buttons;\n  }\n  renderHeaderLeft() {\n    if (this.state.description?.ui?.showHeader) {\n      return [...this.renderHeaderButtons(), this.renderFulltextSearch()];\n    } else {\n      return [];\n    }\n  }\n  renderHeaderTitle() {\n    return this.state.description?.ui?.title ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.state.description?.ui?.title) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n  }\n  renderFulltextSearch() {\n    if (this.state.description?.ui?.showFulltextSearch) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"table-header-search\",\n        key: \"fulltext-search\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n        ref: this.refFulltextSearchInput,\n        className: \"table-header-search \" + (this.state.fulltextSearch == \"\" ? \"\" : \"active\"),\n        type: \"search\",\n        placeholder: this.translate('Search...', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n        value: this.state.fulltextSearch,\n        onKeyUp: event => {\n          if (event.keyCode == 13) {\n            this.loadData();\n            if (!this.props.parentForm) {\n              if (this.state.fulltextSearch == '') {\n                (0,_Helper__WEBPACK_IMPORTED_MODULE_1__.deleteUrlParam)('q');\n              } else {\n                (0,_Helper__WEBPACK_IMPORTED_MODULE_1__.setUrlParam)('q', this.state.fulltextSearch);\n              }\n            }\n          }\n        },\n        onChange: event => this.onFulltextSearchChange(event.target.value)\n      }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n        className: \"btn btn-transparent\",\n        onClick: () => this.loadData()\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-magnifying-glass\"\n      }))));\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n  renderHeaderRight() {\n    let elements = [];\n    // elements.push(this.renderFulltextSearch());\n    return elements;\n  }\n  renderHeader() {\n    const left = this.renderHeaderLeft();\n    const right = this.renderHeaderRight();\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"table-header\"\n    }, left.length == 0 ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"table-header-left\"\n    }, left.map((item, index) => {\n      return item;\n    })), this.state.description?.ui?.showHeaderTitle ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"table-header-title\"\n    }, this.renderHeaderTitle()) : null, right.length == 0 ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"table-header-right\"\n    }, right.map((item, index) => {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        key: 'header-right-' + index\n      }, item);\n    }))));\n  }\n  renderFilter() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n  }\n  renderSidebarFilter() {\n    return null;\n  }\n  renderFooter() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n  }\n  deleteRecordById(id) {\n    let i = 0;\n    for (i in this.state.data?.records) {\n      if (this.state.data?.records[i].id == id) {\n        this.state.data?.records.splice(i, 1);\n      }\n    }\n  }\n  findRecordById(id) {\n    let data = {};\n    for (let i in this.state.data?.records) {\n      if (this.state.data?.records[i].id == id) {\n        data = this.state.data.records[i];\n      }\n    }\n    return data;\n  }\n  deleteRecord() {\n    if (this.props.externalCallbacks && this.props.externalCallbacks.onDeleteRecord) {\n      window[this.props.externalCallbacks.onDeleteRecord](this);\n    }\n    if (this.props.onDeleteRecord) {\n      this.props.onDeleteRecord(this);\n    } else {\n      let recordToDelete = null;\n      let indexRecordToDelete = 0;\n      for (let i in this.state.data?.records) {\n        if (this.state.data?.records[i]._toBeDeleted_) {\n          recordToDelete = this.state.data?.records[i];\n          indexRecordToDelete = i;\n          break;\n        }\n      }\n\n      // this.findRecordById(this.state.idsToDelete[0]);\n\n      if (recordToDelete) {\n        _Request__WEBPACK_IMPORTED_MODULE_14__[\"default\"].get(this.getEndpointUrl('deleteRecord'), {\n          ...this.getEndpointParams(),\n          id: recordToDelete.id ?? 0,\n          hash: recordToDelete._idHash_ ?? ''\n        }, response => {\n          let data = this.state.data;\n          if (data) delete data.records[indexRecordToDelete]._toBeDeleted_;\n          this.setState({\n            data: data\n          }, () => {\n            this.loadData();\n          });\n        });\n      }\n    }\n  }\n  renderDeleteConfirmModal() {\n    let hasRecordsToDelete = false;\n    for (let i in this.state.data?.records) {\n      if (this.state.data?.records[i]._toBeDeleted_) {\n        hasRecordsToDelete = true;\n        break;\n      }\n    }\n    if (hasRecordsToDelete) {\n      return globalThis.hubleto.showDialogConfirm(this.translate('Are you sure you want to delete this record?', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'), {\n        headerClassName: 'dialog-danger-header',\n        contentClassName: 'dialog-danger-content',\n        header: this.translate('Delete record', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n        yesText: this.translate('Delete', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n        yesButtonClass: 'btn-danger',\n        onYes: () => {\n          this.deleteRecord();\n        },\n        noText: this.translate('Cancel', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n        onNo: () => {\n          if (this.state.data) {\n            let newData = this.state.data;\n            for (let i in newData.records) delete newData.records[i]._toBeDeleted_;\n            this.setState({\n              data: newData\n            });\n          }\n        },\n        onHide: () => {\n          if (this.state.data) {\n            let newData = this.state.data;\n            for (let i in newData.records) delete newData.records[i]._toBeDeleted_;\n            this.setState({\n              data: newData\n            });\n          }\n        }\n      });\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n  renderFormModal() {\n    if (this.state.recordId) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ModalForm__WEBPACK_IMPORTED_MODULE_3__[\"default\"], this.getFormModalProps(), this.renderForm());\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n  renderForm() {\n    if (this.props.formReactComponent) {\n      return globalThis.hubleto.renderReactElement(this.props.formReactComponent, this.getFormProps()) ?? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Form__WEBPACK_IMPORTED_MODULE_4__[\"default\"], this.getFormProps());\n    }\n  }\n\n  /*\r\n   * Render body for Column (PrimeReact column)\r\n   */\n  renderCell(columnName, column, data, options) {\n    const columnValue = data[columnName]; // this.getColumnValue(columnName, column, data);\n    const enumValues = column.enumValues;\n    const lastIndexOfBackslash = this.props.model.lastIndexOf('/');\n    const rawModelName = this.props.model.substring(lastIndexOfBackslash + 1);\n    const modelInputName = rawModelName + '.' + columnName;\n    const inputProps = {\n      uid: this.props.uid + '_' + columnName,\n      inputName: columnName,\n      value: columnValue,\n      showInlineEditingButtons: false,\n      invalid: Array.isArray(this.state.invalidInputs) ? this.state.invalidInputs.some(v => String(v.name).toLowerCase() === String(modelInputName).toLowerCase() && v.id === (data.id ?? -1)) : false,\n      isInlineEditing: this.props.isInlineEditing,\n      description: this.state.description && this.state.description.inputs ? this.state.description?.inputs[columnName] : null\n    };\n    const cellProps = {\n      columnName: columnName,\n      column: column,\n      data: data,\n      options: options\n    };\n    const rowIndex = options.rowIndex;\n    let cellContent = enumValues ? enumValues[columnValue] : columnValue;\n    if (typeof column.cellRenderer == 'function') {\n      return column.cellRenderer(this, data, options);\n    } else if (typeof column.tableCellRenderer === 'string' && column.tableCellRenderer !== '') {\n      return globalThis.hubleto.renderReactElement(column.tableCellRenderer, cellProps) ?? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    } else {\n      let cellValueElement = null;\n      if (cellContent === null) {\n        switch (column.type) {\n          case 'lookup':\n            cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n              className: \"badge badge-small text-slate-300 p-1\"\n            }, \"N/A\");\n            break;\n          default:\n            cellValueElement = null;\n            break;\n        }\n      } else {\n        switch (column.type) {\n          case 'int':\n            if (column.showExponential) cellContent = cellContent.toExponential();\n            cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, cellContent, columnValue && column.unit ? ' ' + column.unit : '');\n            break;\n          case 'decimal':\n            if (column.showExponential) cellContent = cellContent.toExponential();\n            cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, cellContent ? Number(cellContent).toFixed(column.decimals ?? 2) : null, columnValue && column.unit ? ' ' + column.unit : '');\n            break;\n          case 'currency':\n            cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n              className: columnValue < 0 ? 'text-red-800' : 'text-green-800'\n            }, cellContent ? globalThis.hubleto.currencyFormat(cellContent, column.decimals ?? 2) : null, columnValue && column.unit ? ' ' + column.unit : '');\n            break;\n          case 'color':\n            cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n              style: {\n                width: '20px',\n                height: '20px',\n                background: cellContent\n              },\n              className: \"rounded\"\n            });\n            break;\n          case 'image':\n            if (!cellContent) cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n              className: \"fas fa-image\",\n              style: {\n                color: '#e3e6f0'\n              }\n            });else {\n              cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"img\", {\n                style: {\n                  width: '30px',\n                  height: '30px'\n                },\n                src: globalThis.hubleto.config.uploadUrl + \"/\" + cellContent,\n                className: \"rounded\"\n              });\n            }\n            break;\n          case 'file':\n            if (!cellContent) cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n              className: \"fas fa-image\",\n              style: {\n                color: '#e3e6f0'\n              }\n            });else {\n              cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n                href: globalThis.hubleto.config.uploadUrl + \"/\" + cellContent,\n                target: \"_blank\",\n                onClick: e => {\n                  e.stopPropagation();\n                },\n                className: \"btn btn-primary-outline btn-small\"\n              }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n                className: \"icon\"\n              }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n                className: \"fa-solid fa-up-right-from-square\"\n              })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n                className: \"text\"\n              }, cellContent));\n            }\n            break;\n          case 'lookup':\n            let className = data['_LOOKUP_CLASS[' + columnName + ']'];\n            let color = data['_LOOKUP_COLOR[' + columnName + ']'];\n            let style = {};\n            if (color) {\n              style['borderLeft'] = '0.5em solid ' + color;\n              style['marginLeft'] = '0.5em';\n              style['paddingLeft'] = '0.5em';\n            }\n            cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n              className: className,\n              style: style\n            }, data['_LOOKUP[' + columnName + ']'] ?? '');\n            break;\n          case 'enum':\n            const enumValues = column.enumValues;\n            if (enumValues) cellValueElement = enumValues[cellContent];\n            break;\n          case 'boolean':\n            if (cellContent) cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n              className: \"text-green-600\",\n              style: {\n                fontSize: '1.2em'\n              }\n            }, \"\\u2713\");else cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n              className: \"text-red-600\",\n              style: {\n                fontSize: '1.2em'\n              }\n            }, \"\\u2715\");\n            break;\n          case 'date':\n            cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, cellContent == '0000-00-00' ? '' : (0,_Inputs_DateTime__WEBPACK_IMPORTED_MODULE_13__.dateToEUFormat)(cellContent));\n            break;\n          case 'datetime':\n            const date = cellContent?.slice(0, 10) ?? \"N/A\";\n            const time = cellContent?.slice(11) ?? \"N/A\";\n            cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n              className: \"flex gap-2\"\n            }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n              className: \"fas fa-calendar mr-2 text-gray-300\"\n            }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, (0,_Inputs_DateTime__WEBPACK_IMPORTED_MODULE_13__.dateToEUFormat)(date))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n              className: \"fas fa-clock mr-2 text-gray-300\"\n            }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", null, time)));\n            break;\n          case 'tags':\n            cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, cellContent.map(item => {\n              if (!column.dataKey) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n              return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n                className: \"badge badge-info mx-1\",\n                key: item.id\n              }, item[column.dataKey]);\n            }));\n            break;\n          case 'json':\n            let columnValueParsed = null;\n            try {\n              columnValueParsed = JSON.parse(columnValue);\n            } catch (ex) {\n              columnValueParsed = null;\n            }\n            if (columnValueParsed === null) {\n              cellValueElement = null;\n            } else if (Array.isArray(columnValueParsed)) {\n              cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, columnValueParsed.map((item, index) => {\n                return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n                  key: index,\n                  className: \"badge block text-xs\"\n                }, JSON.stringify(item));\n              }));\n            } else {\n              cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, Object.keys(columnValueParsed).map((key, index) => {\n                return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n                  key: index,\n                  className: \"badge block text-xs\"\n                }, key, \": \", columnValueParsed[key].toString());\n              }));\n            }\n            break;\n          default:\n            cellValueElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, typeof cellContent == 'object' ? JSON.stringify(cellContent) : cellContent, columnValue && column.unit ? ' ' + column.unit : '');\n            break;\n        }\n        if (cellValueElement === /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null)) {\n          cellValueElement = cellContent;\n        }\n      }\n      let op = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createRef)();\n      if (options.renderEditor) {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, cellValueElement, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"absolute w-full top-0 left-0\"\n        }, (0,_InputFactory__WEBPACK_IMPORTED_MODULE_12__.InputFactory)({\n          ...inputProps,\n          onInlineEditCancel: () => {\n            op.current?.hide();\n          },\n          onChange: (input, value) => {\n            if (this.state.data) {\n              let data = this.state.data;\n              data.records[rowIndex][columnName] = value;\n              this.setState({\n                data: data\n              });\n              if (this.props.onChange) {\n                this.props.onChange(this);\n              }\n            }\n          }\n        })));\n      } else {\n        return cellValueElement;\n      }\n    }\n  }\n  renderDeleteButton(data, options) {\n    return data._toBeDeleted_ ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-small btn-cancel\",\n      onClick: e => {\n        e.preventDefault();\n        delete this.findRecordById(data.id)._toBeDeleted_;\n        this.setState({\n          data: this.state.data\n        }, () => {\n          if (this.props.onDeleteSelectionChange) {\n            this.props.onDeleteSelectionChange(this);\n          }\n        });\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-times\"\n    }))) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: \"btn btn-small btn-danger\",\n      title: this.translate('Delete', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n      onClick: e => {\n        e.preventDefault();\n        if (data.id <= 0 || data.id == undefined) {\n          this.deleteRecordById(data.id);\n        } else {\n          this.findRecordById(data.id)._toBeDeleted_ = true;\n        }\n        this.setState({\n          data: this.state.data\n        }, () => {\n          if (this.props.onDeleteSelectionChange) {\n            this.props.onDeleteSelectionChange(this);\n          }\n        });\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"icon\"\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n      className: \"fas fa-trash-alt\"\n    })));\n  }\n  renderActionsColumn(data, options) {\n    const R = this.findRecordById(data.id);\n    let moreActions = [];\n    let canDelete = !this.state.readonly && this.state.description?.permissions?.canDelete;\n    if (R._PERMISSIONS && !R._PERMISSIONS[3]) canDelete = false;\n    if (canDelete) {\n      moreActions.push(this.renderDeleteButton(data, options));\n    }\n    if (moreActions.length == 0) return null;else if (moreActions.length == 1) return moreActions[0];else return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex gap-2\"\n    }, moreActions.map((item, key) => item));\n  }\n  applyColumnSearch(columnSearch) {\n    if (!this.props.parentForm) {\n      if (columnSearch.length == 0) {\n        (0,_Helper__WEBPACK_IMPORTED_MODULE_1__.deleteUrlParam)('search');\n      } else {\n        (0,_Helper__WEBPACK_IMPORTED_MODULE_1__.setUrlParam)('search', columnSearch);\n      }\n    }\n    this.setState({\n      columnSearch: columnSearch\n    }, () => {\n      this.loadData();\n    });\n  }\n  setColumnSearch(columnName, value) {\n    let columnSearch = this.state.columnSearch;\n    if (value === null) delete columnSearch[columnName];else columnSearch[columnName] = value;\n    this.applyColumnSearch(columnSearch);\n  }\n  addColumnSearch(columnName, value) {\n    if (!value) return;\n    let columnSearch = this.state.columnSearch;\n    let columnSearchForColumn = this.state.columnSearch[columnName] ?? [];\n    if (typeof columnSearchForColumn === 'string') {\n      try {\n        columnSearchForColumn = JSON.parse(columnSearchForColumn);\n      } catch (ex) {\n        columnSearchForColumn = [];\n      }\n    }\n    if (columnSearchForColumn.length == 0) columnSearchForColumn.push('OR'); // default glue\n\n    columnSearchForColumn.push(value);\n    columnSearch[columnName] = columnSearchForColumn;\n    this.applyColumnSearch(columnSearch);\n  }\n  deleteColumnSearch(columnName, index) {\n    if (!this.state.columnSearch[columnName][index]) return;\n    let columnSearch = this.state.columnSearch;\n    columnSearch[columnName].splice(index, 1);\n    if (columnSearch[columnName].length == 1) delete columnSearch[columnName];\n    this.applyColumnSearch(columnSearch);\n  }\n  renderColumns() {\n    let columns = [];\n    const selectionMode = this.getSelectionMode();\n    if (selectionMode) {\n      columns.push(/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_column__WEBPACK_IMPORTED_MODULE_10__.Column, {\n        selectionMode: selectionMode\n      }));\n    }\n    Object.keys(this.state.description?.columns ?? {}).map(columnName => {\n      const column = this.state.description?.columns[columnName] ?? {};\n      const columnSearchValue = this.state.columnSearch[columnName] ?? null;\n      const showColumnSearch = this.state.description?.ui?.showColumnSearch;\n      let columnSearchInput = null;\n      let columnSearchValuePrettyfied = null;\n      let alignHeader = 'left';\n      if (column.textAlign == 'right') alignHeader = 'right';\n      if (column.textAlign == 'center') alignHeader = 'center';\n      if (showColumnSearch) {\n        switch (column.type) {\n          // case 'date':\n          //   columnSearchInput = <Flatpickr\n          //     onChange={(data: Date[]) => {\n          //       this.setColumnSearch(columnName, data);\n          //     }}\n          //     options={{mode: 'range'}}\n          //   />\n          // break;\n          case 'boolean':\n            columnSearchInput = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_selectbutton__WEBPACK_IMPORTED_MODULE_7__.SelectButton, {\n              value: columnSearchValue,\n              onChange: event => {\n                this.setColumnSearch(columnName, event.value);\n              },\n              itemTemplate: option => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n                className: \"btn btn-transparent\"\n              }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n                className: \"text\"\n              }, option.label)),\n              options: [{\n                label: 'Y',\n                value: true,\n                className: 'p-0'\n              }, {\n                label: 'N',\n                value: false,\n                className: 'p-0'\n              }]\n            });\n            break;\n          default:\n            columnSearchInput = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n              className: \"w-full\",\n              onKeyUp: event => {\n                if (event.keyCode == 13) {\n                  this.addColumnSearch(columnName, event.currentTarget.value);\n                  event.currentTarget.value = '';\n                }\n              }\n            });\n            break;\n        }\n        if (columnSearchValue instanceof Array) {\n          columnSearchValuePrettyfied = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"flex w-full gap-2 justify-items\"\n          }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            className: \"grow\"\n          }, columnSearchValue.map((item, index) => {\n            if (index == 0) return null;\n            return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n              className: \"btn btn-small btn-warning\",\n              onClick: () => {\n                this.deleteColumnSearch(columnName, index);\n              }\n            }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n              className: \"text\"\n            }, item)));\n          })), this.state.columnSearch[columnName].length > 2 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n            className: \"btn btn-small btn-transparent\",\n            onClick: () => {\n              let newColumnSearch = this.state.columnSearch;\n              let glue = newColumnSearch[columnName][0];\n              newColumnSearch[columnName][0] = glue == 'OR' ? 'AND' : 'OR';\n              this.setState({\n                columnSearch: newColumnSearch\n              }, () => {\n                this.loadData();\n              });\n            }\n          }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n            className: \"icon\"\n          }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n            className: \"fas fa-align-justify\"\n          })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n            className: \"text\"\n          }, this.state.columnSearch[columnName][0]))) : null);\n        }\n      }\n      columns.push(/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_column__WEBPACK_IMPORTED_MODULE_10__.Column, {\n        key: columnName,\n        field: columnName,\n        header: column.title + (column.unit ? ' [' + column.unit + ']' : ''),\n        filter: showColumnSearch,\n        showFilterMenu: false,\n        alignHeader: alignHeader,\n        filterElement: showColumnSearch ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"column-search input-wrapper\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"input-body\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"hubleto component input\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"input-element grow\"\n        }, columnSearchInput)))), columnSearchValuePrettyfied) : null,\n        body: (data, options) => {\n          if (data._PERMISSIONS && !data._PERMISSIONS[1]) {\n            // can not read\n            return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n              className: \"text-nowrap\"\n            }, \"Hidden record\");\n          } else {\n            const cellText = data['_LOOKUP[' + columnName + ']'] ?? data[columnName] ?? '';\n            const cellDetailUrl = data['_LOOKUP_DETAIL_URL[' + columnName + ']'] ?? '';\n            return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n              key: 'column-' + columnName,\n              className: this.cellClassName(columnName, column, data) + (data._toBeDeleted_ ? ' to-be-deleted' : ''),\n              style: this.cellCssStyle(columnName, column, data),\n              title: cellText\n            }, this.renderCell(columnName, column, data, options), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n              className: \"cell-buttons\"\n            }, cellDetailUrl ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n              className: \"btn btn-small btn-primary-outline\",\n              title: this.translate('Open in new tab', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n              onClick: e => {\n                globalThis.window.open(globalThis.hubleto.config.projectUrl + '/' + cellDetailUrl);\n                e.stopPropagation();\n              }\n            }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n              className: \"icon\"\n            }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n              className: \"fas fa-arrow-up-right-from-square\"\n            }))) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n              className: \"btn btn-small btn-primary-outline\",\n              title: this.translate('Copy cell content to clipboard', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n              onClick: e => {\n                navigator.clipboard.writeText(cellText);\n                e.stopPropagation();\n              }\n            }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n              className: \"icon\"\n            }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n              className: \"fas fa-copy\"\n            }))), this.state.editMode == '' || column.readonly || column.type == 'virtual' ? null : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n              className: \"btn btn-small btn-primary-outline\",\n              title: this.translate('Edit', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n              onClick: e => {\n                // Default cell click behavior is to open the form.\n                // If prevented, the 'onClick' of DataTable will\n                // be launched, which means editing the cell\n                // when editMode = 'cell'.\n                e.preventDefault();\n              }\n            }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n              className: \"icon\"\n            }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n              className: \"fas fa-pencil\"\n            })))));\n          }\n        },\n        editor: column.readonly ? null : options => {\n          const data = options.rowData;\n          const cellText = data['_LOOKUP[' + columnName + ']'] ?? data[columnName] ?? '';\n          this.setState({\n            isInlineEditing: true\n          });\n          return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n            key: 'column-' + columnName,\n            className: this.cellClassName(columnName, column, data) + (data._toBeDeleted_ ? ' to-be-deleted' : ''),\n            style: this.cellCssStyle(columnName, column, data),\n            title: cellText\n          }, this.renderCell(columnName, column, data, {\n            rowIndex: options.rowIndex,\n            renderEditor: true\n          }));\n        },\n        onCellEditComplete: e => {\n          _Request__WEBPACK_IMPORTED_MODULE_14__[\"default\"].post(this.getEndpointUrl('saveRecord'), {\n            ...this.getEndpointParams(),\n            id: e.newRowData.id ?? null,\n            record: this.findRecordById(e.newRowData.id)\n          }, {}, description => {\n            this.setState({\n              isInlineEditing: false\n            }, () => {\n              this.reload();\n            });\n          });\n        },\n        onCellEditCancel: e => {\n          setTimeout(() => this.setState({\n            isInlineEditing: false\n          }), 100);\n        },\n        style: {\n          width: 'auto'\n        },\n        sortable: true\n      }));\n    });\n    columns.push(/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_column__WEBPACK_IMPORTED_MODULE_10__.Column, {\n      key: \"__actions\",\n      field: \"__actions\",\n      header: \"\",\n      body: (data, options) => this.renderActionsColumn(data, options),\n      style: {\n        width: 'auto'\n      }\n    }));\n    return columns;\n  }\n  renderDataView() {\n    if (this.state.description?.ui?.showAsPlainTable) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"table\", {\n        className: \"table-default dense\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"thead\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"tr\", null, Object.keys(this.state.description?.columns).map((colName, columnIndex) => {\n        const column = this.state.description?.columns[colName];\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"th\", {\n          className: \"border-none\"\n        }, column.title);\n      }))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"tbody\", null, this.state.data?.records.map((row, rowIndex) => {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"tr\", null, Object.keys(this.state.description?.columns).map((colName, columnIndex) => {\n          const val = row['_LOOKUP[' + colName + ']'] ?? row[colName];\n          return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"td\", {\n            className: \"border-none\"\n          }, typeof val === 'object' && val !== null ? val['_LOOKUP'] : val);\n        }));\n      })));\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_datatable__WEBPACK_IMPORTED_MODULE_9__.DataTable, this.getTableProps(), this.renderColumns()));\n    }\n  }\n  renderContent() {\n    const sidebarFilter = this.renderSidebarFilter();\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.renderFormModal(), this.state.isUsedAsInput ? null : this.renderDeleteConfirmModal(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      id: \"hubleto-table-\" + this.props.uid,\n      className: \"hubleto component table\" + (this.props.className ? \" \" + this.props.className : \"\") + (this.state.loadingData ? \" loading\" : \"\")\n    }, this.state.description?.ui?.showHeader ? this.renderHeader() : null, this.state.description?.ui?.showFilter ? this.renderFilter() : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"flex gap-2 flex-col md:flex-row overflow-x max-w-[98vw]\"\n    }, sidebarFilter && this.state.description?.ui?.showSidebarFilter && !this.state.sidebarFilterHidden ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"table-sidebar-filter\"\n    }, sidebarFilter) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      className: \"table-body grow\",\n      id: \"hubleto-table-body-\" + this.props.uid\n    }, this.renderDataView()))));\n  }\n  render() {\n    try {\n      globalThis.hubleto.setTranslationContext(this.translationContext);\n      if (!this.state.data) {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_progressbar__WEBPACK_IMPORTED_MODULE_11__.ProgressBar, {\n          mode: \"indeterminate\",\n          style: {\n            height: '8px'\n          }\n        });\n      }\n      const fallback = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"alert alert-danger\"\n      }, \"Failed to render table. Check console for error log.\");\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ErrorBoundary__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n        fallback: fallback\n      }, this.renderContent());\n    } catch (e) {\n      console.error('Failed to render table.');\n      console.error(e);\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"alert alert-danger\"\n      }, \"Failed to render table. Check console for error log.\");\n    }\n  }\n  onSelectionChange() {\n    if (this.props.onSelectionChange) {\n      this.props.onSelectionChange(this);\n    }\n  }\n  onPaginationChangeCustom(event) {\n    const page = (event.page ?? 0) + 1;\n    const itemsPerPage = event.rows;\n    this.onPaginationChange(page, itemsPerPage);\n  }\n  onOrderByChangeCustom(event) {\n    let orderBy = null;\n\n    // Icons in PrimeTable changing\n    // 1 == ASC\n    // -1 == DESC\n    // null == neutral icons\n    if (event.sortField == this.state.description?.ui?.orderBy?.field) {\n      orderBy = {\n        field: event.sortField,\n        direction: event.sortOrder === 1 ? 'asc' : 'desc'\n      };\n    } else {\n      orderBy = {\n        field: event.sortField,\n        direction: 'asc'\n      };\n    }\n    this.onOrderByChange(orderBy);\n  }\n  onRowSelect(event) {\n    // to be overriden\n  }\n  onRowUnselect(event) {\n    // to be overriden\n  }\n  setRecordFormUrl(id) {\n    const urlParams = new URLSearchParams(window.location.search);\n    if (!this.props.parentForm) urlParams.set('recordId', id.toString());\n    window.history.pushState({}, \"\", '?' + urlParams.toString());\n  }\n  openForm(id) {\n    let prevId = null;\n    let nextId = null;\n    let prevRow = {};\n    let saveNextId = false;\n    let canRead = this.state.description?.permissions?.canRead;\n    if (!canRead) return;\n    for (let i in this.state.data?.records) {\n      const row = this.state.data?.records[i];\n      if (row && row.id) {\n        if (saveNextId) {\n          nextId = row.id;\n          saveNextId = false;\n        } else if (row.id == id) {\n          prevId = prevRow.id ?? null;\n          saveNextId = true;\n        }\n      }\n      prevRow = row;\n    }\n    if (this.props.externalCallbacks && this.props.externalCallbacks.openForm) {\n      window[this.props.externalCallbacks.openForm](this, id);\n    } else {\n      if (!this.props.parentForm) {\n        this.setRecordFormUrl(id);\n      }\n      this.setState({\n        recordId: null,\n        isInlineEditing: false\n      }, () => {\n        this.setState({\n          recordId: id,\n          recordPrevId: prevId,\n          recordNextId: nextId,\n          activeRowId: id\n        });\n      });\n    }\n  }\n  closeForm() {\n    const urlParams = new URLSearchParams(window.location.search);\n    urlParams.delete('recordId');\n    urlParams.delete('recordTitle');\n    if (Array.from(urlParams).length == 0) {\n      window.history.pushState({}, '', this.state.myRootUrl);\n    } else {\n      window.history.pushState({}, '', this.state.myRootUrl + '?' + urlParams.toString());\n    }\n    this.setState({\n      recordId: null,\n      isInlineEditing: false\n    });\n  }\n  onAddClick() {\n    if (this.props.externalCallbacks && this.props.externalCallbacks.onAddClick) {\n      window[this.props.externalCallbacks.onAddClick](this);\n    } else {\n      this.openForm(-1);\n    }\n  }\n  onRowClick(row) {\n    if (row._PERMISSIONS && !row._PERMISSIONS[1]) return; // cannot read\n    if (this.state.isInlineEditing) return; // doing nothing when inline editing\n\n    if (this.props.externalCallbacks && this.props.externalCallbacks.onRowClick) {\n      window[this.props.externalCallbacks.onRowClick](this, row.id ?? 0);\n    }\n    if (this.props.onRowClick) {\n      this.props.onRowClick(this, row);\n    } else {\n      this.openForm(row.id ?? 0);\n    }\n  }\n  onPaginationChange(page, itemsPerPage) {\n    this.setState({\n      page: page,\n      itemsPerPage: itemsPerPage\n    }, () => {\n      this.loadData();\n    });\n  }\n  onFilterChange(data) {\n    this.setState({\n      filterBy: data\n    }, () => this.loadData());\n  }\n  onOrderByChange(orderBy, stateParams) {\n    const getValue = item => {\n      const val = item;\n      if (typeof val === 'string' && /^\\d{1,3}(\\.\\d{3})*(,\\d+)?$/.test(val)) {\n        return parseFloat(val.replace(/\\./g, '').replace(',', '.'));\n      }\n      if (!isNaN(val)) {\n        return Number(val);\n      }\n      return val;\n    };\n    if (orderBy && this.props.data) {\n      let data = this.props.data;\n      if (orderBy.direction == \"asc\") {\n        data.records.sort((a, b) => {\n          const valA = getValue(a[orderBy.field]);\n          const valB = getValue(b[orderBy.field]);\n          if (valA < valB) return -1;\n          if (valA > valB) return 1;\n          return 0;\n        });\n      } else {\n        data.records.sort((a, b) => {\n          const valA = getValue(a[orderBy.field]);\n          const valB = getValue(b[orderBy.field]);\n          if (valA < valB) return 1;\n          if (valA > valB) return -1;\n          return 0;\n        });\n      }\n      this.setState({\n        ...stateParams,\n        orderBy: orderBy,\n        data: data\n      });\n    } else {\n      let updatedDescription = {\n        ...this.state.description\n      };\n      updatedDescription.ui.orderBy = orderBy;\n      this.setState({\n        ...stateParams,\n        description: updatedDescription\n      }, () => this.loadData());\n    }\n  }\n  onFulltextSearchChange(fulltextSearch) {\n    this.setState({\n      fulltextSearch: fulltextSearch\n    });\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Table.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/TableCellRenderer.tsx":
/*!**********************************************!*\
  !*** ../react-ui/core/TableCellRenderer.tsx ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   TableCellRenderer: () => (/* binding */ TableCellRenderer)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nclass TableCellRenderer extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      columnName: this.props.columnName,\n      column: this.props.column,\n      data: this.props.data,\n      options: this.props.options\n    };\n  }\n  componentDidUpdate(prevProps) {\n    let newState = {};\n    let setNewState = false;\n    if (this.props.columnName != prevProps.columnName) {\n      newState.columnName = this.props.columnName;\n      setNewState = true;\n    }\n    if (this.props.column != prevProps.column) {\n      newState.column = this.props.column;\n      setNewState = true;\n    }\n    if (this.props.data != prevProps.data) {\n      newState.data = this.props.data;\n      setNewState = true;\n    }\n    if (this.props.options != prevProps.options) {\n      newState.options = this.props.options;\n      setNewState = true;\n    }\n    if (setNewState) {\n      this.setState(newState);\n    }\n  }\n  render() {\n    return this.state.data[this.state.columnName];\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/TableCellRenderer.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/TableCellRenderers/Hyperlink.tsx":
/*!*********************************************************!*\
  !*** ../react-ui/core/TableCellRenderers/Hyperlink.tsx ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ HyperlinkTableCellRenderer)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _TableCellRenderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../TableCellRenderer */ \"../react-ui/core/TableCellRenderer.tsx\");\n\n\nclass HyperlinkTableCellRenderer extends _TableCellRenderer__WEBPACK_IMPORTED_MODULE_1__.TableCellRenderer {\n  render() {\n    if (this.state.data && this.state.data[this.state.columnName]) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"a\", {\n        href: this.state.data[this.state.columnName],\n        target: \"_blank\"\n        // onClick={(e) => { e.stopPropagation(); }}\n        ,\n        className: \"btn btn-blue-outline btn-small\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fa-solid fa-up-right-from-square\"\n      })), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"text\"\n      }, this.state.data[this.state.columnName])));\n    } else {\n      return null;\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/TableCellRenderers/Hyperlink.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/TableCellRenderers/SharedWith.tsx":
/*!**********************************************************!*\
  !*** ../react-ui/core/TableCellRenderers/SharedWith.tsx ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ SharedWithTableCellRenderer)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _TableCellRenderer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../TableCellRenderer */ \"../react-ui/core/TableCellRenderer.tsx\");\n\n\nclass SharedWithTableCellRenderer extends _TableCellRenderer__WEBPACK_IMPORTED_MODULE_1__.TableCellRenderer {\n  render() {\n    if (this.state.data && this.state.data[this.state.columnName]) {\n      let valuesPerUser = {};\n      try {\n        valuesPerUser = JSON.parse(this.state.data[this.state.columnName]);\n      } catch (ex) {\n        valuesPerUser = {};\n      }\n      Object.keys(valuesPerUser).map(idUser => {\n        if (valuesPerUser[idUser] != 'read' && valuesPerUser[idUser] != 'modify') {\n          delete valuesPerUser[idUser];\n        }\n      });\n      let userCount = Object.keys(valuesPerUser).length;\n      if (userCount > 0) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-share-nodes pr-2\"\n      }), \" \", userCount, \" user(s)\");else return null;\n    } else {\n      return null;\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/TableCellRenderers/SharedWith.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/TranslatedComponent.tsx":
/*!************************************************!*\
  !*** ../react-ui/core/TranslatedComponent.tsx ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ TranslatedComponent)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nclass TranslatedComponent extends react__WEBPACK_IMPORTED_MODULE_0__.Component {\n  translationContext = '';\n  translationContextInner = '';\n  translate(orig, context, contextInner, vars) {\n    try {\n      return globalThis.hubleto.translate(orig, context ?? this.translationContext, contextInner ?? this.translationContextInner, vars);\n    } catch (e) {\n      return orig;\n    }\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/TranslatedComponent.tsx?\n}");

/***/ }),

/***/ "../react-ui/core/Tree.tsx":
/*!*********************************!*\
  !*** ../react-ui/core/Tree.tsx ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": () => (/* binding */ Tree)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"../react-ui/node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _ErrorBoundary__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ErrorBoundary */ \"../react-ui/core/ErrorBoundary.tsx\");\n/* harmony import */ var _ModalForm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ModalForm */ \"../react-ui/core/ModalForm.tsx\");\n/* harmony import */ var _Form__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Form */ \"../react-ui/core/Form.tsx\");\n/* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Notification */ \"../react-ui/core/Notification.tsx\");\n/* harmony import */ var _TranslatedComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TranslatedComponent */ \"../react-ui/core/TranslatedComponent.tsx\");\n/* harmony import */ var primereact_progressbar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! primereact/progressbar */ \"../react-ui/node_modules/primereact/progressbar/progressbar.esm.js\");\n/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Helper */ \"../react-ui/core/Helper.tsx\");\n/* harmony import */ var _Request__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Request */ \"../react-ui/core/Request.tsx\");\n\n\n\n\n\n\n\n\n\n\n// Laravel pagination\n\nclass Tree extends _TranslatedComponent__WEBPACK_IMPORTED_MODULE_5__[\"default\"] {\n  static defaultProps = {\n    descriptionSource: 'both'\n  };\n  refFulltextSearchInput = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n  refForm = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n  refFormModal = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createRef();\n  constructor(props) {\n    super(props);\n    globalThis.hubleto.reactElements[this.props.uid] = this;\n    this.model = this.props.model ?? '';\n    this.state = this.getStateFromProps(props);\n  }\n  getStateFromProps(props) {\n    let state = {\n      endpoint: props.endpoint ? props.endpoint : globalThis.hubleto.config.defaultTableEndpoint ?? {\n        describeTree: 'api/tree/describe',\n        loadTreeData: 'api/record/load-tree-data'\n      },\n      recordId: props.recordId,\n      formEndpoint: props.formEndpoint ? props.formEndpoint : globalThis.hubleto.config.defaultFormEndpoint ?? null,\n      formProps: {\n        model: this.model,\n        uid: props.uid\n      },\n      loadingData: false,\n      readonly: props.readonly ?? false,\n      customEndpointParams: this.props.customEndpointParams ?? {},\n      fulltextSearch: props.fulltextSearch ?? '',\n      myRootUrl: window.location.protocol + \"//\" + window.location.host + window.location.pathname,\n      collapsedNodeIds: []\n    };\n    if (props.description) state.description = props.description;\n    if (props.data) state.data = props.data;\n    return state;\n  }\n  componentDidMount() {\n    this.loadDescription(() => {\n      ;\n      this.loadData();\n    });\n  }\n  componentDidUpdate(prevProps) {\n    if (prevProps.formProps?.id != this.props.formProps?.id\n    // || (prevProps.parentRecordId != this.props.parentRecordId)\n    ) {\n      this.state.formProps = this.props.formProps;\n      this.loadDescription();\n      this.loadData();\n    }\n    if (prevProps.data != this.props.data || prevProps.description != this.props.description) {\n      this.setState(this.getStateFromProps(this.props), () => {\n        this.loadDescription();\n        this.loadData();\n      });\n    }\n  }\n  onAfterLoadDescription(description) {\n    return description;\n  }\n  getEndpointUrl(action) {\n    return this.state.endpoint[action] ?? '';\n  }\n  getEndpointParams() {\n    return {\n      model: this.model,\n      tag: this.props.tag,\n      __IS_AJAX__: '1',\n      ...this.props.customEndpointParams\n    };\n  }\n  getCsvImportEndpointParams() {\n    return null;\n  }\n  reload() {\n    this.setState({\n      isInitialized: false\n    }, () => {\n      this.loadDescription(() => {\n        this.loadData();\n      });\n    });\n  }\n  loadDescription(successCallback) {\n    if (this.props.descriptionSource == 'props') return;\n    _Request__WEBPACK_IMPORTED_MODULE_8__[\"default\"].get(this.getEndpointUrl('describeTree'), this.getEndpointParams(), description => {\n      try {\n        if (this.props.description && this.props.descriptionSource == 'both') description = (0,_Helper__WEBPACK_IMPORTED_MODULE_7__.deepObjectMerge)(description, this.props.description);\n        description = this.onAfterLoadDescription(description);\n        this.setState({\n          description: description\n        }, () => {\n          if (successCallback) successCallback(description);\n        });\n      } catch (err) {\n        _Notification__WEBPACK_IMPORTED_MODULE_4__[\"default\"].error(err.message);\n      }\n    });\n  }\n  loadData() {\n    if (this.props.data) {\n      this.setState({\n        data: this.props.data\n      });\n    } else {\n      this.setState({\n        loadingData: true\n      }, () => {\n        _Request__WEBPACK_IMPORTED_MODULE_8__[\"default\"].get(this.getEndpointUrl('loadTreeData'), {\n          ...this.getEndpointParams(),\n          model: this.model,\n          orderBy: this.state.description?.ui?.orderBy ?? {\n            field: 'id',\n            direction: 'asc'\n          },\n          fulltextSearch: this.state.fulltextSearch,\n          tag: this.props.tag,\n          __IS_AJAX__: '1'\n        }, data => {\n          this.setState({\n            loadingData: false,\n            data: data\n          }, () => {\n            if (this.props.onAfterLoadData) {\n              this.props.onAfterLoadData(this);\n            }\n          });\n        });\n      });\n    }\n  }\n  getFormProps() {\n    return {\n      // isInitialized: false,\n      ref: this.refForm,\n      modal: this.refFormModal,\n      parentTable: this,\n      uid: this.props.uid + '_form',\n      model: this.model,\n      tag: this.props.tag,\n      id: this.state.recordId ?? null,\n      endpoint: this.state.formEndpoint,\n      showInModal: true,\n      description: this.props.formProps?.description,\n      ...(this.props.formCustomProps ?? {}),\n      customEndpointParams: this.state.customEndpointParams ?? {},\n      onClose: () => {\n        this.closeForm();\n      },\n      onSaveCallback: (form, saveResponse) => {\n        this.reload();\n        if (this.props.closeFormAfterSave ?? false) {\n          this.closeForm();\n        } else if (saveResponse && saveResponse.savedRecord.id) {\n          this.openForm(saveResponse.savedRecord.id);\n        }\n      },\n      onCopyCallback: (form, saveResponse) => {\n        this.loadData();\n        this.openForm(saveResponse.savedRecord.id);\n      },\n      onDeleteCallback: () => {\n        this.loadData();\n        this.setState({\n          recordId: null\n        });\n      }\n    };\n  }\n  getFormModalProps() {\n    return {\n      ref: this.refFormModal,\n      uid: this.props.uid + '_form',\n      type: this.state.recordId == -1 ? 'centered' : 'right',\n      hideHeader: true,\n      isOpen: this.state.recordId !== null,\n      form: this.refForm,\n      onClose: () => {\n        this.closeForm();\n      },\n      ...this.props.formModal\n    };\n  }\n  renderFulltextSearch() {\n    if (this.state.description?.ui?.showFulltextSearch) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"table-header-search\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"input\", {\n        ref: this.refFulltextSearchInput,\n        className: \"table-header-search \" + (this.state.fulltextSearch == \"\" ? \"\" : \"active\"),\n        type: \"search\",\n        placeholder: this.translate('Search...', 'Hubleto\\\\Erp\\\\Loader', 'Components\\\\Table'),\n        value: this.state.fulltextSearch,\n        onKeyUp: event => {\n          if (event.keyCode == 13) {\n            this.loadData();\n          }\n        },\n        onChange: event => this.onFulltextSearchChange(event.target.value)\n      }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n        className: \"btn btn-transparent\",\n        onClick: () => this.loadData()\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n        className: \"icon\"\n      }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n        className: \"fas fa-magnifying-glass\"\n      }))));\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n  renderFormModal() {\n    if (this.state.recordId) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ModalForm__WEBPACK_IMPORTED_MODULE_2__[\"default\"], this.getFormModalProps(), this.renderForm());\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n  renderForm() {\n    if (this.props.formReactComponent) {\n      return globalThis.hubleto.renderReactElement(this.props.formReactComponent, this.getFormProps()) ?? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Form__WEBPACK_IMPORTED_MODULE_3__[\"default\"], this.getFormProps());\n    }\n  }\n\n  /*\r\n   * Render tree node\r\n   */\n  renderNode(node) {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n      className: 'btn w-full ' + (node.id == this.state.recordId ? 'btn-primary' : 'btn-transparent'),\n      onClick: () => {\n        this.openForm(node.id);\n      }\n    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n      className: \"text\"\n    }, node.title)));\n  }\n  renderTree(nodes = null, idParent = 0, level = 0) {\n    if (nodes === null) {\n      nodes = this.state.data.nodes;\n    }\n    if (nodes.length && nodes.length > 0) {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, nodes.map((node, index) => {\n        const hasChildren = node.CHILDREN && node.CHILDREN.length > 0;\n        const isExpanded = !this.state.collapsedNodeIds.includes(node.id);\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"btn-group my-1\"\n        }, hasChildren ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n          className: \"btn btn-transparent h-full\",\n          onClick: () => {\n            let collapsedNodeIds = this.state.collapsedNodeIds;\n            if (collapsedNodeIds.includes(node.id)) {\n              for (let i in collapsedNodeIds) {\n                if (collapsedNodeIds[i] == node.id) {\n                  delete collapsedNodeIds[i];\n                }\n              }\n            } else {\n              collapsedNodeIds.push(node.id);\n            }\n            this.setState({\n              collapsedNodeIds: collapsedNodeIds\n            });\n          }\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"span\", {\n          className: \"icon\"\n        }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"i\", {\n          className: 'fas fa-' + (isExpanded ? 'chevron-up' : 'chevron-down')\n        })))) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"grow\"\n        }, this.renderNode(node))), hasChildren && isExpanded ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n          className: \"ml-4 mt-2\"\n        }, this.renderTree(node.CHILDREN, node.id, level + 1)) : null);\n      }));\n    } else {\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);\n    }\n  }\n  renderContent() {\n    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, this.renderFormModal(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n      id: \"hubleto-table-\" + this.props.uid,\n      className: \"hubleto component tree\" + (this.state.loadingData ? \" loading\" : \"\")\n    }, this.renderTree()));\n  }\n  render() {\n    try {\n      globalThis.hubleto.setTranslationContext(this.translationContext);\n      if (!this.state.data) {\n        return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(primereact_progressbar__WEBPACK_IMPORTED_MODULE_6__.ProgressBar, {\n          mode: \"indeterminate\",\n          style: {\n            height: '8px'\n          }\n        });\n      }\n      const fallback = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"alert alert-danger\"\n      }, \"Failed to render table. Check console for error log.\");\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ErrorBoundary__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n        fallback: fallback\n      }, this.renderContent());\n    } catch (e) {\n      console.error('Failed to render table.');\n      console.error(e);\n      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n        className: \"alert alert-danger\"\n      }, \"Failed to render table. Check console for error log.\");\n    }\n  }\n  setRecordFormUrl(id) {\n    const urlParams = new URLSearchParams(window.location.search);\n    if (!this.props.parentForm) urlParams.set('recordId', id.toString());\n    window.history.pushState({}, \"\", '?' + urlParams.toString());\n  }\n  openForm(id) {\n    if (!this.props.parentForm) {\n      this.setRecordFormUrl(id);\n    }\n    this.setState({\n      recordId: null\n    }, () => {\n      this.setState({\n        recordId: id,\n        activeRowId: id\n      });\n    });\n  }\n  closeForm() {\n    const urlParams = new URLSearchParams(window.location.search);\n    urlParams.delete('recordId');\n    urlParams.delete('recordTitle');\n    if (Array.from(urlParams).length == 0) {\n      window.history.pushState({}, '', this.state.myRootUrl);\n    } else {\n      window.history.pushState({}, '', this.state.myRootUrl + '?' + urlParams.toString());\n    }\n    this.setState({\n      recordId: null\n    });\n  }\n  onAddClick() {\n    this.openForm(-1);\n  }\n  onRowClick(row) {\n    if (row._PERMISSIONS && !row._PERMISSIONS[1]) return; // cannot read\n\n    this.openForm(row.id ?? 0);\n  }\n  onFulltextSearchChange(fulltextSearch) {\n    this.setState({\n      fulltextSearch: fulltextSearch\n    });\n  }\n}\n\n//# sourceURL=webpack:///../react-ui/core/Tree.tsx?\n}");

/***/ })

}]);