{"version":3,"file":"store-Ds2_hrUO.js","sources":["../../../node_modules/reselect/es/defaultMemoize.js","../../../node_modules/reselect/es/index.js","../../../app/javascript/reducks/store/TableCopyData/initializes.ts","../../../app/javascript/reducks/store/TableCopyData/slices.ts","../../../app/javascript/reducks/store/DynamicRecordReducer.ts","../../../app/javascript/reducks/store/ColumnHidden/initializes.ts","../../../app/javascript/reducks/store/ColumnHidden/slices.ts","../../../app/javascript/reducks/store/DataConnect/initializes.ts","../../../app/javascript/reducks/store/DataConnect/slices.ts","../../../app/javascript/reducks/store/TableSelect/initializes.ts","../../../app/javascript/reducks/store/TableSelect/slices.ts","../../../app/javascript/reducks/store/ColumnModal/initializes.ts","../../../app/javascript/reducks/store/ColumnModal/slices.ts","../../../app/javascript/reducks/store/TableView/initializes.ts","../../../app/javascript/reducks/store/TableView/slices.ts","../../../app/javascript/reducks/store/TableData/initializes.ts","../../../app/javascript/reducks/store/TableData/slices.ts","../../../app/javascript/reducks/store/TableHeader/initializes.ts","../../../app/javascript/reducks/store/TableHeader/slices.ts","../../../app/javascript/reducks/store/TableDataType/initializes.ts","../../../app/javascript/reducks/store/TableDataType/slices.ts","../../../app/javascript/reducks/store/TableSearch/initializes.ts","../../../app/javascript/reducks/store/TableSearch/slices.ts","../../../app/javascript/reducks/store/Common/initializes.ts","../../../app/javascript/reducks/store/Common/slices.ts","../../../node_modules/file-saver/dist/FileSaver.min.js","../../../app/javascript/reducks/store/RelationModal/initializes.ts","../../../app/javascript/reducks/store/RelationModal/slices.ts","../../../app/javascript/reducks/store/TableCell/initializes.ts","../../../app/javascript/reducks/store/TableCell/slices.ts","../../../app/javascript/constants/settings.ts","../../../app/javascript/components/common/Setting/SettingPages/AccountSettings.tsx","../../../app/javascript/components/common/Setting/Forms/FormInputText.tsx","../../../app/javascript/components/common/Setting/SettingPages/CommonSettings.tsx","../../../app/javascript/constants/Currencies.ts","../../../app/javascript/components/templates/payment/AddressForm.tsx","../../../app/javascript/components/common/Setting/SettingPages/BillingInfoForm.tsx","../../../app/javascript/components/common/Setting/SettingPages/CompanyBillingInfo.tsx","../../../app/javascript/components/common/Setting/SettingPages/GuestManagement.tsx","../../../app/javascript/components/common/Setting/SettingPages/MemberManagement.tsx","../../../app/javascript/components/common/Setting/SettingPages/NotificationSettings.tsx","../../../app/javascript/components/common/Setting/SettingPages/PlanAndBilling.tsx","../../../app/javascript/components/common/Setting/SettingPages/TwoFactorAuthSettings.tsx","../../../app/javascript/components/common/Setting/SettingPages/SecuritySettings.tsx","../../../app/javascript/reducks/store/Settings/selectors.ts","../../../app/javascript/components/common/Setting/SettingContent.tsx","../../../app/javascript/components/templates/payment/ChangePlanPriceListForOverseas.tsx","../../../app/javascript/components/templates/payment/ChangePaidPlanModalBodyForOverseas.tsx","../../../app/javascript/components/templates/payment/CheckoutForm.tsx","../../../app/javascript/components/templates/payment/ChangePlanForOverseas.tsx","../../../app/javascript/components/common/Setting/SettingFullContent.tsx","../../../app/javascript/components/common/Setting/SettingModal.tsx","../../../app/javascript/reducks/store/AppTrigger/initializes.ts","../../../app/javascript/reducks/store/AppTrigger/slices.ts","../../../app/javascript/reducks/store/store.ts"],"sourcesContent":["// Cache implementation based on Erik Rasmussen's `lru-memoize`:\n// https://github.com/erikras/lru-memoize\nvar NOT_FOUND = 'NOT_FOUND';\n\nfunction createSingletonCache(equals) {\n var entry;\n return {\n get: function get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n\n return NOT_FOUND;\n },\n put: function put(key, value) {\n entry = {\n key: key,\n value: value\n };\n },\n getEntries: function getEntries() {\n return entry ? [entry] : [];\n },\n clear: function clear() {\n entry = undefined;\n }\n };\n}\n\nfunction createLruCache(maxSize, equals) {\n var entries = [];\n\n function get(key) {\n var cacheIndex = entries.findIndex(function (entry) {\n return equals(key, entry.key);\n }); // We found a cached entry\n\n if (cacheIndex > -1) {\n var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top\n\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n\n return entry.value;\n } // No entry found in cache, return sentinel\n\n\n return NOT_FOUND;\n }\n\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n // TODO Is unshift slow?\n entries.unshift({\n key: key,\n value: value\n });\n\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n\n function getEntries() {\n return entries;\n }\n\n function clear() {\n entries = [];\n }\n\n return {\n get: get,\n put: put,\n getEntries: getEntries,\n clear: clear\n };\n}\n\nexport var defaultEqualityCheck = function defaultEqualityCheck(a, b) {\n return a === b;\n};\nexport function createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n\n\n var length = prev.length;\n\n for (var i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n };\n}\n// defaultMemoize now supports a configurable cache size with LRU behavior,\n// and optional comparison of the result value with existing values\nexport function defaultMemoize(func, equalityCheckOrOptions) {\n var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {\n equalityCheck: equalityCheckOrOptions\n };\n var _providedOptions$equa = providedOptions.equalityCheck,\n equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,\n _providedOptions$maxS = providedOptions.maxSize,\n maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,\n resultEqualityCheck = providedOptions.resultEqualityCheck;\n var comparator = createCacheKeyComparator(equalityCheck);\n var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons\n\n function memoized() {\n var value = cache.get(arguments);\n\n if (value === NOT_FOUND) {\n // @ts-ignore\n value = func.apply(null, arguments);\n\n if (resultEqualityCheck) {\n var entries = cache.getEntries();\n var matchingEntry = entries.find(function (entry) {\n return resultEqualityCheck(entry.value, value);\n });\n\n if (matchingEntry) {\n value = matchingEntry.value;\n }\n }\n\n cache.put(arguments, value);\n }\n\n return value;\n }\n\n memoized.clearCache = function () {\n return cache.clear();\n };\n\n return memoized;\n}","import { defaultMemoize, defaultEqualityCheck } from './defaultMemoize';\nexport { defaultMemoize, defaultEqualityCheck };\n\nfunction getDependencies(funcs) {\n var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;\n\n if (!dependencies.every(function (dep) {\n return typeof dep === 'function';\n })) {\n var dependencyTypes = dependencies.map(function (dep) {\n return typeof dep === 'function' ? \"function \" + (dep.name || 'unnamed') + \"()\" : typeof dep;\n }).join(', ');\n throw new Error(\"createSelector expects all input-selectors to be functions, but received the following types: [\" + dependencyTypes + \"]\");\n }\n\n return dependencies;\n}\n\nexport function createSelectorCreator(memoize) {\n for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n memoizeOptionsFromArgs[_key - 1] = arguments[_key];\n }\n\n var createSelector = function createSelector() {\n for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n funcs[_key2] = arguments[_key2];\n }\n\n var _recomputations = 0;\n\n var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.\n // So, start by declaring the default value here.\n // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)\n\n\n var directlyPassedOptions = {\n memoizeOptions: undefined\n }; // Normally, the result func or \"output selector\" is the last arg\n\n var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object\n\n if (typeof resultFunc === 'object') {\n directlyPassedOptions = resultFunc; // and pop the real result func off\n\n resultFunc = funcs.pop();\n }\n\n if (typeof resultFunc !== 'function') {\n throw new Error(\"createSelector expects an output function after the inputs, but received: [\" + typeof resultFunc + \"]\");\n } // Determine which set of options we're using. Prefer options passed directly,\n // but fall back to options given to createSelectorCreator.\n\n\n var _directlyPassedOption = directlyPassedOptions,\n _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,\n memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer\n // is an array. In most libs I've looked at, it's an equality function or options object.\n // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full\n // user-provided array of options. Otherwise, it must be just the _first_ arg, and so\n // we wrap it in an array so we can apply it.\n\n var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];\n var dependencies = getDependencies(funcs);\n var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {\n _recomputations++; // apply arguments instead of spreading for performance.\n\n return resultFunc.apply(null, arguments);\n }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.\n\n var selector = memoize(function dependenciesChecker() {\n var params = [];\n var length = dependencies.length;\n\n for (var i = 0; i < length; i++) {\n // apply arguments instead of spreading and mutate a local list of params for performance.\n // @ts-ignore\n params.push(dependencies[i].apply(null, arguments));\n } // apply arguments instead of spreading for performance.\n\n\n _lastResult = memoizedResultFunc.apply(null, params);\n return _lastResult;\n });\n Object.assign(selector, {\n resultFunc: resultFunc,\n memoizedResultFunc: memoizedResultFunc,\n dependencies: dependencies,\n lastResult: function lastResult() {\n return _lastResult;\n },\n recomputations: function recomputations() {\n return _recomputations;\n },\n resetRecomputations: function resetRecomputations() {\n return _recomputations = 0;\n }\n });\n return selector;\n }; // @ts-ignore\n\n\n return createSelector;\n}\nexport var createSelector = /* #__PURE__ */createSelectorCreator(defaultMemoize);\n// Manual definition of state and output arguments\nexport var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {\n if (selectorCreator === void 0) {\n selectorCreator = createSelector;\n }\n\n if (typeof selectors !== 'object') {\n throw new Error('createStructuredSelector expects first argument to be an object ' + (\"where each property is a selector, instead received a \" + typeof selectors));\n }\n\n var objectKeys = Object.keys(selectors);\n var resultSelector = selectorCreator( // @ts-ignore\n objectKeys.map(function (key) {\n return selectors[key];\n }), function () {\n for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n values[_key3] = arguments[_key3];\n }\n\n return values.reduce(function (composition, value, index) {\n composition[objectKeys[index]] = value;\n return composition;\n }, {});\n });\n return resultSelector;\n};","import { TableCopyData } from \"./types\";\n\nexport const initialTableCopyDataState: TableCopyData = {\n copyData: {\n value: \"\",\n key: \"\",\n type: \"\",\n },\n editHistory: [],\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialTableCopyDataState } from \"./initializes\";\nimport type { TableCopyData, CopyDataType, EditHistoryType } from \"./types\";\n\nconst tableCopyDataSlice = createSlice({\n name: \"TableCopyData\",\n initialState: initialTableCopyDataState,\n reducers: {\n setCopyData: (state: TableCopyData, action: PayloadAction) => {\n state.copyData = action.payload;\n },\n setEditHistory: (state: TableCopyData, action: PayloadAction) => {\n state.editHistory =\n state.editHistory.length < 50\n ? [...state.editHistory, action.payload]\n : [...state.editHistory.slice(1), action.payload];\n },\n setPrevEditHistory: (state: TableCopyData, action: PayloadAction) => {\n state.editHistory = action.payload;\n },\n },\n});\n\nexport const { setCopyData, setEditHistory, setPrevEditHistory } = tableCopyDataSlice.actions;\n\nexport default tableCopyDataSlice.reducer;\n","// @ts-nocheck\nimport { createSlice } from \"@reduxjs/toolkit\";\nimport axios from \"axios\";\naxios.defaults.headers.common[\"X-Requested-With\"] = \"XMLHttpRequest\";\nimport moment from \"moment-timezone\";\nimport { setEditHistory } from \"./TableCopyData/slices\";\nimport timeZoneMapping from \"../../entries/_modules/time_zone/config\";\n\nexport const stateRecordData = createSlice({\n name: \"stateRecordData\",\n initialState: {\n body: [],\n prevLength: 0,\n headKeyView: [],\n headsView: {},\n data: null,\n startIndex: 0,\n startHeadIndex: 0,\n pageNumber: 1,\n widths: {},\n multiCopyData: [],\n multiCopyDataValues: [],\n dbConnectId: null,\n comment: [],\n recordViewItem: [],\n currentSelectPosition: [],\n multiSelectRow: 0,\n multiSelectCol: 0,\n isApi: false,\n aggregateResults: {},\n databaseInfo: {},\n footerHeadsView: {},\n },\n reducers: {\n setDatabaseInfo: (state, action) => {\n state.databaseInfo = { ...action.payload };\n },\n insertConnectId: (state, action) => {\n state.dbConnectId = action.payload.id;\n },\n insertWidths: (state, action) => {\n state.widths = action.payload.widths;\n },\n updateWidths: (state, action) => {\n state.widths[action.payload.key] = action.payload.width;\n },\n insertData: (state, action) => {\n state.data = action.payload.data;\n },\n insertBody: (state, action) => {\n state.body = action.payload.body;\n },\n addBody: (state, action) => {\n // NOTE: 重複したデータを追加しないようにしている\n const addRecordId = action.payload[0]?.id;\n if (state.body.some((item: any) => item.id === addRecordId)) {\n return;\n }\n state.body = [...state.body, ...action.payload];\n },\n setHeadKeyView: (state, action) => {\n state.headKeyView = action.payload.headKeys;\n },\n setHeadsView: (state, action) => {\n state.headsView = action.payload.heads;\n },\n setStartIndex: (state, action) => {\n state.startIndex = action.payload.index;\n },\n setStartHeadIndex: (state, action) => {\n state.startHeadIndex = action.payload.index;\n },\n setPageNumber: (state, action) => {\n state.pageNumber = action.payload.number;\n },\n insertRecords: (state, action) => {\n for (const i in state.body) {\n state.body[i].records = action.payload.records[i];\n }\n },\n setCurrentSelectPosition: (state, action) => {\n state.currentSelectPosition = action.payload.position;\n },\n stateMultiCopyData: (state, action) => {\n state.multiCopyData = action.payload.data;\n },\n stateMultiCopyDataValues: (state, action) => {\n state.multiCopyDataValues = action.payload.values;\n },\n insertReturnValue: (state, action) => {\n const record = state.body[action.payload.i - state.prevLength];\n\n if (record) {\n for (const [key, value] of Object.entries(state.body[action.payload.i - state.prevLength][\"records\"])) {\n for (const k of Object.keys(action.payload.records)) {\n if (k === key && [\"formula\", \"updated_at\"].includes(action.payload[\"records\"][key].type)) {\n state.body[action.payload.i - state.prevLength][\"records\"][key].value =\n action.payload[\"records\"][key].value;\n break;\n }\n }\n }\n }\n },\n insertMultiFormula: (state, action) => {\n if (state.body[action.payload.i - state.prevLength]?.records) {\n for (const [key, data] of Object.entries(state.body[action.payload.i - state.prevLength][\"records\"])) {\n if (key === action.payload.id && action.payload[\"records\"][key].type === \"formula\") {\n state.body[action.payload.i - state.prevLength][\"records\"][key].value = action.payload.val.value;\n break;\n }\n }\n }\n },\n updateValue: (state, action) => {\n if (state.body[action.payload.i - state.prevLength]?.records) {\n for (const [key, data] of Object.entries(state.body[action.payload.i - state.prevLength][\"records\"])) {\n if (key === action.payload.id) {\n if (state.body[action.payload.i - state.prevLength][\"records\"][key].type === \"date\") {\n state.body[action.payload.i - state.prevLength][\"records\"][key].value = action.payload.val\n ? moment.tz(action.payload.val, timeZoneMapping[action.payload.timeZone]).format()\n : null;\n } else if (state.body[action.payload.i - state.prevLength][\"records\"][key].type === \"datetime\") {\n state.body[action.payload.i - state.prevLength][\"records\"][key].value = action.payload.val\n ? moment.tz(action.payload.val, timeZoneMapping[action.payload.timeZone]).format()\n : null;\n } else if (\n state.body[action.payload.i - state.prevLength][\"records\"][key].type === \"file\" ||\n state.body[action.payload.i - state.prevLength][\"records\"][key].type === \"image\"\n ) {\n if (state.body[action.payload.i - state.prevLength][\"records\"][key].value?.length) {\n state.body[action.payload.i - state.prevLength][\"records\"][key].value.push(action.payload.val);\n } else {\n state.body[action.payload.i - state.prevLength][\"records\"][key].value = [action.payload.val];\n }\n } else if (state.body[action.payload.i - state.prevLength][\"records\"][key].type === \"link\") {\n state.body[action.payload.i - state.prevLength][\"records\"][key].value = action.payload.val;\n } else {\n state.body[action.payload.i - state.prevLength][\"records\"][key].value = action.payload.val;\n }\n }\n }\n }\n },\n // NOTE: レコード詳細モーダルのみで呼ばれるメソッド。後々updateValueが呼ばれている箇所を全てこのメソッドに置き換える。\n updateValueFromModal: (state, action) => {\n const { val, columnId, recordId } = action.payload;\n const targetRecord = state.body.find((record) => record.id === recordId);\n\n if (targetRecord?.records && targetRecord.records[columnId]) {\n const dataType = targetRecord.records[columnId].type;\n\n switch (dataType) {\n case \"date\":\n case \"datetime\":\n targetRecord.records[columnId].value = val\n ? moment.tz(action.payload.val, timeZoneMapping[action.payload.timeZone]).format()\n : null;\n break;\n case \"file\":\n case \"image\":\n if (targetRecord.records[columnId].value?.length) {\n targetRecord.records[columnId].value.push(val);\n } else {\n targetRecord.records[columnId].value = [val];\n }\n break;\n default:\n targetRecord.records[columnId].value = val;\n }\n }\n },\n insertComment: (state, action) => {\n state.comment = action.payload;\n },\n deleteFileValue: (state, action) => {\n if (state.body[action.payload.i - state.prevLength]?.records) {\n for (const [key, data] of Object.entries(state.body[action.payload.i - state.prevLength][\"records\"])) {\n if (state.body[action.payload.i - state.prevLength][\"records\"][key].type === \"file\") {\n if (state.body[action.payload.i - state.prevLength][\"records\"][key].value?.length) {\n const tempValue = state.body[action.payload.i - state.prevLength][\"records\"][key].value.filter(\n (n) => n.id !== action.payload.val,\n );\n state.body[action.payload.i - state.prevLength][\"records\"][key].value = tempValue;\n } else {\n state.body[action.payload.i - state.prevLength][\"records\"][key].value = [];\n }\n }\n }\n }\n },\n deleteImageValue: (state, action) => {\n if (state.body[action.payload.i - state.prevLength]?.records) {\n for (const [key, data] of Object.entries(state.body[action.payload.i - state.prevLength][\"records\"])) {\n if (state.body[action.payload.i - state.prevLength][\"records\"][key].type === \"image\") {\n if (state.body[action.payload.i - state.prevLength][\"records\"][key].value?.length) {\n const tempValue = state.body[action.payload.i - state.prevLength][\"records\"][key].value.filter(\n (n) => n.id !== action.payload.val,\n );\n state.body[action.payload.i - state.prevLength][\"records\"][key].value = tempValue;\n } else {\n state.body[action.payload.i - state.prevLength][\"records\"][key].value = [];\n }\n }\n }\n }\n },\n stateMultiSelect: (state, action) => {\n state.multiSelectRow = action.payload.row;\n state.multiSelectCol = action.payload.col;\n },\n statePrevLength: (state, action) => {\n state.prevLength = action.payload.length;\n },\n setIsApi: (state, action) => {\n state.isApi = action.payload.flag;\n },\n setAggregateResults: (state, action) => {\n state.aggregateResults = Object.assign({}, state.aggregateResults, action.payload);\n },\n setFooterHeadsView: (state, action) => {\n state.footerHeadsView = action.payload;\n },\n },\n});\n\nexport const {\n insertData,\n insertBody,\n addBody,\n setHeadKeyView,\n updateValue,\n insertWidths,\n updateWidths,\n insertConnectId,\n insertReturnValue,\n insertComment,\n stateMultiCopyData,\n insertMultiFormula,\n deleteFileValue,\n deleteImageValue,\n concatBody,\n setStartIndex,\n setStartHeadIndex,\n setHeadsView,\n insertRecords,\n setCurrentSelectPosition,\n stateMultiSelect,\n stateMultiCopyDataValues,\n statePrevLength,\n setIsApi,\n setAggregateResults,\n setDatabaseInfo,\n setFooterHeadsView,\n updateValueFromModal,\n} = stateRecordData.actions;\n\nexport const updateField =\n (i, body, record, value, key = null, heads, pathname, timeZone) =>\n async (dispatch, getState) => {\n const { footerHeadsView } = getState().stateRecordData;\n const attributes = {};\n if (record.type === \"check_box\") {\n const data = [];\n heads[key].selections.forEach((v) => {\n data.push(v.name);\n });\n value = value ? value.filter((i) => data.includes(i)) : value;\n } else if (record.type === \"date\" || record.type === \"datetime\") {\n value = value ? moment.tz(value, timeZoneMapping[timeZone]) : \"\";\n }\n\n if (record.type === \"member\" && value) {\n attributes[heads[key].data_position] = value.map((value) => value.id);\n } else {\n attributes[heads[key].data_position] = value;\n }\n\n dispatch(\n updateValue({\n i: i,\n val: value,\n id: key,\n timeZone: timeZone,\n }),\n );\n const formulaColumnIds = [];\n const { data } = await axios.patch(`${pathname}/dynamic_table_records/batch_update`, {\n dynamic_table_records: [\n {\n id: body.id,\n attributes,\n },\n ],\n });\n if (data.body[0]) {\n dispatch(\n insertReturnValue({\n records: data.body[0].records,\n i: i,\n id: key,\n }),\n );\n Object.keys(data.body[0].records).forEach((key) => {\n const columnId = footerHeadsView[key].id;\n formulaColumnIds.push(columnId);\n });\n }\n\n await dispatch(fetchAggregateResults(pathname, [footerHeadsView[key].id, ...formulaColumnIds]));\n };\n\nexport const updateMultiField =\n (indexs, bodys, records, values, keys = [], heads, pathname) =>\n async (dispatch, getState) => {\n const { footerHeadsView } = getState().stateRecordData;\n const updateRecords = [];\n const columnDataPositions = [];\n for (const i in indexs) {\n const attributes = {};\n for (const idx in records[i]) {\n if (records[i][idx].type === \"check_box\") {\n const data = [];\n heads[keys[i][idx]].selections.forEach((v) => {\n data.push(v.name);\n });\n values[i][idx] = values[i][idx].filter((i) => data.includes(i));\n } else if (records[i][idx].type === \"date\" || records[i][idx].type === \"datetime\") {\n //現状使用されていないため、moment.tzの対応は不要。将来的に使用することになるかもしれないので残す。\n values[i][idx] = values[i][idx] ? moment(values[i][idx]) : \"\";\n }\n if (records[i][idx].type === \"member\" && values[i][idx]) {\n attributes[heads[keys[i][idx]].data_position] = values[i][idx].map((value) => value.id);\n } else {\n attributes[heads[keys[i][idx]].data_position] = values[i][idx];\n }\n columnDataPositions.push(heads[keys[i][idx]].data_position);\n dispatch(\n updateValue({\n i: indexs[i],\n val: values[i][idx],\n id: keys[i][idx],\n }),\n );\n }\n updateRecords.push({\n id: bodys[i].id,\n attributes,\n });\n }\n\n const columnIds = [...new Set(columnDataPositions.map((position) => Number(position.match(/_(\\d+)$/)[1])))];\n const formulaColumnKeys = [];\n\n const { data } = await axios.patch(`${pathname}/dynamic_table_records/batch_update`, {\n dynamic_table_records: updateRecords,\n });\n const datas = data.body;\n for (const i in datas) {\n dispatch(\n insertMultiFormula({\n records: datas[i].records,\n i: indexs[i],\n id: Object.keys(datas[i].records)[0],\n val: Object.values(datas[i].records)[0],\n }),\n );\n\n formulaColumnKeys.push(Object.keys(datas[i].records));\n }\n const formulaColumnIds = [...new Set(formulaColumnKeys.flat().map((key) => footerHeadsView[key].id))];\n\n await dispatch(fetchAggregateResults(pathname, [...columnIds, ...formulaColumnIds]));\n };\n\nexport const updatePulldownValue =\n (i, body, record, v, key, railsContext, heads, input, position) => async (dispatch) => {\n const log = {\n data_type: record.type,\n position: position,\n once_select: {\n value: record.value,\n },\n };\n dispatch(setEditHistory(log));\n if (record.value === v.name) {\n await dispatch(updateField(i, body, { type: record.type, value: \"\" }, \"\", key, heads, railsContext));\n } else {\n await dispatch(updateField(i, body, { type: record.type, value: v.name }, v.name, key, heads, railsContext));\n }\n };\n\nexport const updateCheckBoxValue = (i, body, record, v, key, pathname, heads, input, position) => async (dispatch) => {\n const value = record.value || [];\n const flag = value.includes(v.name);\n\n if (!flag) {\n const log = {\n data_type: record.type,\n position: position,\n once_select: {\n value: value,\n },\n };\n dispatch(setEditHistory(log));\n await dispatch(\n updateField(i, body, { type: record.type, value: [...value, v.name] }, [...value, v.name], key, heads, pathname),\n );\n }\n if (input.current !== null) {\n input.current.focus();\n }\n};\n\n// NOTE: 集計結果取得API\nexport const fetchAggregateResults =\n (pathname, columnIds = null, query = null) =>\n async (dispatch, getState) => {\n const { aggregateResults, footerHeadsView, databaseInfo } = getState().stateRecordData;\n const endpoint = `${pathname}/dynamic_table_views/${databaseInfo.viewId}/grid_views/aggregate`;\n const params = {};\n if (databaseInfo?.isEditable) {\n if (columnIds) {\n params[\"aggregate_columns\"] = columnIds.map((id) => {\n return { dynamic_table_column_id: id };\n });\n }\n } else {\n //NOTE:フィルター検索時,初期読み込み時\n //設定されている集計タイプを取得\n const aggregations = Object.entries(aggregateResults).filter(([key, value]) => {\n return value.aggregate_type !== \"none\";\n });\n\n const targetColumns = aggregations.map(([key, value]) => {\n return {\n dynamic_table_column_id: footerHeadsView[key].id,\n aggregate_type: value.aggregate_type,\n };\n });\n\n params[\"aggregate_columns\"] = targetColumns;\n if (query) params[\"search_query\"] = query;\n }\n\n const { data } = await axios.post(endpoint, Object.keys(params) && params);\n dispatch(setAggregateResults(data));\n };\n\nexport const fetchAggregateResultForChangeView = (pathname) => async (dispatch, getState) => {\n const { databaseInfo } = getState().stateRecordData;\n const endpoint = `${pathname}/dynamic_table_views/${databaseInfo.viewId}/grid_views/aggregate`;\n\n const { data } = await axios.post(endpoint);\n dispatch(setAggregateResults(data));\n};\n\nexport const fetchAggregateResultForBrowsingAuth =\n (pathname, aggregationType, columnId, query = null) =>\n async (dispatch, getState) => {\n const { databaseInfo } = getState().stateRecordData;\n const endpoint = `${pathname}/dynamic_table_views/${databaseInfo.viewId}/grid_views/aggregate`;\n const params = {\n aggregate_columns: [\n {\n dynamic_table_column_id: columnId,\n aggregate_type: aggregationType,\n },\n ],\n };\n if (query) {\n params[\"search_query\"] = query;\n }\n const { data } = await axios.post(endpoint, params);\n dispatch(setAggregateResults(data));\n };\n\nexport default stateRecordData.reducer;\n","import { ColumnHidden } from \"./types\";\n\nexport const initialColumnHiddenState: ColumnHidden = {\n hiddenIndex: [],\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialColumnHiddenState } from \"./initializes\";\nimport type { ColumnHidden } from \"./types\";\n\nconst columnHiddenSlice = createSlice({\n name: \"ColumnHidden\",\n initialState: initialColumnHiddenState,\n reducers: {\n setHiddenIndex: (state: ColumnHidden, action: PayloadAction) => {\n state.hiddenIndex = action.payload;\n },\n },\n});\n\nexport const { setHiddenIndex } = columnHiddenSlice.actions;\n\nexport default columnHiddenSlice.reducer;\n","import { DataConnect } from \"./types\";\n\nexport const initialDataConnectState: DataConnect = {\n appConnectData: {},\n isDbConnecting: false,\n connectingColumns: [],\n yoomDatabaseEditData: null,\n relationUpdateCurrentId: null,\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialDataConnectState } from \"./initializes\";\nimport type { DataConnect } from \"./types\";\n\nconst dataConnectSlice = createSlice({\n name: \"DataConnect\",\n initialState: initialDataConnectState,\n reducers: {\n setAppConnectData: (state: DataConnect, action: PayloadAction) => {\n state.appConnectData = action.payload;\n },\n setIsDbConnecting: (state: DataConnect, action: PayloadAction) => {\n state.isDbConnecting = action.payload;\n },\n setConnectingColumns: (state: DataConnect, action: PayloadAction) => {\n state.connectingColumns = action.payload;\n },\n setYoomDatabaseEditData: (state: DataConnect, action: PayloadAction) => {\n state.yoomDatabaseEditData = action.payload;\n },\n setRelationUpdateCurrentId: (state: DataConnect, action: PayloadAction) => {\n state.relationUpdateCurrentId = action.payload;\n },\n },\n});\n\nexport const {\n setAppConnectData,\n setIsDbConnecting,\n setConnectingColumns,\n setYoomDatabaseEditData,\n setRelationUpdateCurrentId,\n} = dataConnectSlice.actions;\n\nexport default dataConnectSlice.reducer;\n","import { TableSelect } from \"./types\";\n\nexport const initialTableSelectState: TableSelect = {\n selectedRecordIds: [],\n excludeRecordIds: [],\n isAllSelected: false,\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialTableSelectState } from \"./initializes\";\nimport type { TableSelect } from \"./types\";\n\nconst tableSelectSlice = createSlice({\n name: \"TableSelect\",\n initialState: initialTableSelectState,\n reducers: {\n setSelectedRecordIds: (state: TableSelect, action: PayloadAction) => {\n state.selectedRecordIds = action.payload;\n },\n setExcludeRecordIds: (state: TableSelect, action: PayloadAction) => {\n state.excludeRecordIds = action.payload;\n },\n setIsAllSelected: (state: TableSelect, action: PayloadAction) => {\n state.isAllSelected = action.payload;\n },\n },\n});\n\nexport const { setSelectedRecordIds, setExcludeRecordIds, setIsAllSelected } = tableSelectSlice.actions;\n\nexport default tableSelectSlice.reducer;\n","import { ColumnModal } from \"./types\";\nimport { t } from \"i18next\";\n\nexport const initialColumnModalState: ColumnModal = {\n isColumnModal: false,\n isDataTypeModal: false,\n columnDataType: { name: t(\"ColumnModal.テキスト\"), type: \"string\" },\n isOpenColumnMemu: false,\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialColumnModalState } from \"./initializes\";\nimport type { ColumnModal } from \"./types\";\n\nconst columnModalSlice = createSlice({\n name: \"ColumnModal\",\n initialState: initialColumnModalState,\n reducers: {\n setColumnModal: (state: ColumnModal, action: PayloadAction) => {\n state.isColumnModal = action.payload;\n },\n setDataTypeModal: (state: ColumnModal, action: PayloadAction) => {\n state.isDataTypeModal = action.payload;\n },\n setColumnDataType: (state: ColumnModal, action: PayloadAction) => {\n state.columnDataType = action.payload;\n },\n setIsOpenColumnMemu: (state: ColumnModal, action: PayloadAction) => {\n state.isOpenColumnMemu = action.payload;\n },\n },\n});\n\nexport const { setColumnModal, setDataTypeModal, setColumnDataType, setIsOpenColumnMemu } = columnModalSlice.actions;\n\nexport default columnModalSlice.reducer;\n","import { TableView } from \"./types\";\nimport { t } from \"i18next\";\n\nexport const initialTableViewState: TableView = {\n viewErrorMessage: \"\",\n isViewEditMenu: false,\n dynamicTableViewId: null,\n dynamicTableViews: null,\n rowHeight: { name: t(\"TableViewInitializes.小\"), value: 36, key: \"short\" },\n hidden: [],\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialTableViewState } from \"./initializes\";\nimport type { TableView, DynamicTableViewsType, RowHeightType } from \"./types\";\n\nconst tableViewSlice = createSlice({\n name: \"TableView\",\n initialState: initialTableViewState,\n reducers: {\n setViewErrorMessage: (state: TableView, action: PayloadAction) => {\n state.viewErrorMessage = action.payload;\n },\n setIsViewEditMenu: (state: TableView, action: PayloadAction) => {\n state.isViewEditMenu = action.payload;\n },\n setDynamicTableViewId: (state: TableView, action: PayloadAction) => {\n state.dynamicTableViewId = action.payload;\n },\n setDynamicTableViews: (state: TableView, action: PayloadAction) => {\n state.dynamicTableViews = action.payload;\n },\n setRowHeight: (state: TableView, action: PayloadAction) => {\n state.rowHeight = action.payload;\n },\n setHidden: (state: TableView, action: PayloadAction) => {\n state.hidden = action.payload;\n },\n },\n});\n\nexport const {\n setViewErrorMessage,\n setIsViewEditMenu,\n setDynamicTableViewId,\n setDynamicTableViews,\n setRowHeight,\n setHidden,\n} = tableViewSlice.actions;\n\nexport default tableViewSlice.reducer;\n","import { TableData, SearchParamsType } from \"./types\";\n\nexport const initialTableDataState: TableData = {\n recordViewItem: null,\n totalHits: 0,\n};\n\nexport const initialSearchParams: SearchParamsType = {\n search_query: \"\",\n search_offset: 0,\n search_limit: 200,\n search_sort: \"\",\n search_order: \"\",\n res_option: \"data\",\n field_offset: 0,\n field_limit: 99,\n};\n\nexport const initialSearchBodyParams: SearchParamsType = {\n search_query: \"\",\n search_offset: 0,\n search_limit: 200,\n search_sort: \"\",\n search_order: \"\",\n res_option: \"body\",\n field_offset: 0,\n field_limit: 99,\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialTableDataState } from \"./initializes\";\nimport type { TableData } from \"./types\";\n\nconst tableDataSlice = createSlice({\n name: \"TableData\",\n initialState: initialTableDataState,\n reducers: {\n setRecordViewItem: (state: TableData, action: PayloadAction) => {\n state.recordViewItem = action.payload;\n },\n setTotalHits: (state: TableData, action: PayloadAction) => {\n state.totalHits = action.payload;\n },\n },\n});\n\nexport const { setRecordViewItem, setTotalHits } = tableDataSlice.actions;\n\nexport default tableDataSlice.reducer;\n","import { TableHeader } from \"./types\";\n\nexport const initialTableHeaderState: TableHeader = {\n heads: {},\n headKey: [],\n headsMaster: null,\n headKeyMaster: null,\n changedColumnWidthIndex: null,\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialTableHeaderState } from \"./initializes\";\nimport type { HeadsType } from \"./types\";\n\nconst tableHeaderSlice = createSlice({\n name: \"TableHeader\",\n initialState: initialTableHeaderState,\n reducers: {\n setHeads(state, action: PayloadAction) {\n state.heads = action.payload;\n },\n setHeadKey(state, action: PayloadAction) {\n state.headKey = action.payload;\n },\n setHeadsMaster(state, action: PayloadAction) {\n state.headsMaster = action.payload;\n },\n setHeadKeyMaster(state, action: PayloadAction) {\n state.headKeyMaster = action.payload;\n },\n setChangedColumnWidthIndex(state, action: PayloadAction) {\n state.changedColumnWidthIndex = action.payload;\n },\n },\n});\n\nexport const { setHeads, setHeadKey, setHeadsMaster, setHeadKeyMaster, setChangedColumnWidthIndex } =\n tableHeaderSlice.actions;\n\nexport default tableHeaderSlice.reducer;\n","import { TableDataType } from \"./types\";\n\nexport const initialTableDataTypeState: TableDataType = {\n memberSelections: [],\n imageAttachLoading: {\n isLoading: false,\n index: \"\",\n name: \"\",\n customKey: \"\",\n },\n imageAttachError: {\n isError: false,\n message: \"\",\n name: \"\",\n },\n fileAttachLoading: {\n isLoading: false,\n index: \"\",\n name: \"\",\n customKey: \"\",\n },\n fileAttachError: {\n isError: false,\n message: \"\",\n name: \"\",\n },\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialTableDataTypeState } from \"./initializes\";\nimport type { TableDataType, attachLoadingType, attachErrorType } from \"./types\";\n\nconst tableDataTypeSlice = createSlice({\n name: \"TableDataType\",\n initialState: initialTableDataTypeState,\n reducers: {\n setMemberSelections: (state: TableDataType, action: PayloadAction) => {\n state.memberSelections = action.payload;\n },\n setImageAttachLoading: (state: TableDataType, action: PayloadAction) => {\n state.imageAttachLoading = action.payload;\n },\n setImageAttachError: (state: TableDataType, action: PayloadAction) => {\n state.imageAttachError = action.payload;\n },\n setFileAttachLoading: (state: TableDataType, action: PayloadAction) => {\n state.fileAttachLoading = action.payload;\n },\n setFileAttachError: (state: TableDataType, action: PayloadAction) => {\n state.fileAttachError = action.payload;\n },\n },\n});\n\nexport const {\n setMemberSelections,\n setImageAttachLoading,\n setImageAttachError,\n setFileAttachLoading,\n setFileAttachError,\n} = tableDataTypeSlice.actions;\n\nexport default tableDataTypeSlice.reducer;\n","import { TableSearch } from \"./types\";\n\nexport const initialTableSearchState: TableSearch = {\n query: \"\",\n sort: \"\",\n order: \"\",\n isFilterSearchLoading: false,\n wildcardQuery: \"\",\n isKeywordInputFocus: false,\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialTableSearchState } from \"./initializes\";\nimport type {} from \"./types\";\n\nconst tableSearchSlice = createSlice({\n name: \"TableSearch\",\n initialState: initialTableSearchState,\n reducers: {\n setQuery(state, action: PayloadAction) {\n state.query = action.payload;\n },\n setSort(state, action: PayloadAction) {\n state.sort = action.payload;\n },\n setOrder(state, action: PayloadAction) {\n state.order = action.payload;\n },\n setIsFilterSearchLoading: (state, action: PayloadAction) => {\n state.isFilterSearchLoading = action.payload;\n },\n setWildcardQuery: (state, action: PayloadAction) => {\n state.wildcardQuery = action.payload;\n },\n setIsKeywordInputFocus: (state, action: PayloadAction) => {\n state.isKeywordInputFocus = action.payload;\n },\n },\n});\n\nexport const { setQuery, setSort, setOrder, setIsFilterSearchLoading, setWildcardQuery, setIsKeywordInputFocus } =\n tableSearchSlice.actions;\n\nexport default tableSearchSlice.reducer;\n","import { Common } from \"./types\";\n\nexport const initialCommonState: Common = {\n noticeMessage: \"\",\n pathname: \"\",\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialCommonState } from \"./initializes\";\nimport type { Common } from \"./types\";\n\nconst commonSlice = createSlice({\n name: \"Common\",\n initialState: initialCommonState,\n reducers: {\n setNoticeMessage: (state: Common, action: PayloadAction) => {\n state.noticeMessage = action.payload;\n },\n setPathname: (state: Common, action: PayloadAction) => {\n state.pathname = action.payload;\n },\n },\n});\n\nexport const { setNoticeMessage, setPathname } = commonSlice.actions;\n\nexport default commonSlice.reducer;\n","(function(a,b){if(\"function\"==typeof define&&define.amd)define([],b);else if(\"undefined\"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){\"use strict\";function b(a,b){return\"undefined\"==typeof b?b={autoBom:!1}:\"object\"!=typeof b&&(console.warn(\"Deprecated: Expected third argument to be a object\"),b={autoBom:!b}),b.autoBom&&/^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(a.type)?new Blob([\"\\uFEFF\",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open(\"GET\",a),d.responseType=\"blob\",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error(\"could not download file\")},d.send()}function d(a){var b=new XMLHttpRequest;b.open(\"HEAD\",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent(\"click\"))}catch(c){var b=document.createEvent(\"MouseEvents\");b.initMouseEvent(\"click\",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f=\"object\"==typeof window&&window.window===window?window:\"object\"==typeof self&&self.self===self?self:\"object\"==typeof global&&global.global===global?global:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||(\"object\"!=typeof window||window!==f?function(){}:\"download\"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement(\"a\");g=g||b.name||\"download\",j.download=g,j.rel=\"noopener\",\"string\"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target=\"_blank\")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:\"msSaveOrOpenBlob\"in navigator?function(f,g,h){if(g=g||f.name||\"download\",\"string\"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement(\"a\");i.href=f,i.target=\"_blank\",setTimeout(function(){e(i)})}}:function(b,d,e,g){if(g=g||open(\"\",\"_blank\"),g&&(g.document.title=g.document.body.innerText=\"downloading...\"),\"string\"==typeof b)return c(b,d,e);var h=\"application/octet-stream\"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\\/[\\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&\"undefined\"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,\"data:attachment/file;\"),g?g.location.href=a:location=a,g=null},k.readAsDataURL(b)}else{var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m)},4E4)}});f.saveAs=g.saveAs=g,\"undefined\"!=typeof module&&(module.exports=g)});\n\n//# sourceMappingURL=FileSaver.min.js.map","import { RelationModal } from \"./types\";\n\nexport const initialRelationModalState: RelationModal = {\n relationInfo: {\n referenceDatabaseId: null,\n referenceTableId: null,\n referenceViewId: null,\n },\n connectDataInfo: {\n recordId: null,\n headId: null,\n value: null,\n rowIndex: null,\n headKey: null,\n fieldDataType: null,\n },\n isShown: false,\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialRelationModalState } from \"./initializes\";\nimport type { RelationModal, RelationInfo, ConnectDataInfo } from \"./types\";\n\nconst relationModalSlice = createSlice({\n name: \"RelationModal\",\n initialState: initialRelationModalState,\n reducers: {\n setRelationInfo: (state: RelationModal, action: PayloadAction) => {\n state.relationInfo = action.payload;\n },\n setIsShownRelationModal: (state: RelationModal, action: PayloadAction) => {\n state.isShown = action.payload;\n },\n setConnectDataInfo: (state: RelationModal, action: PayloadAction) => {\n state.connectDataInfo = action.payload;\n },\n },\n});\n\nexport const { setRelationInfo, setIsShownRelationModal, setConnectDataInfo } = relationModalSlice.actions;\n\nexport default relationModalSlice.reducer;\n","import { TableCell } from \"./types\";\n\nexport const initialTableCellState: TableCell = {\n selectMode: true,\n};\n","import { createSlice, PayloadAction } from \"@reduxjs/toolkit\";\nimport { initialTableCellState } from \"./initializes\";\nimport type { TableCell } from \"./types\";\n\nconst tableCellSlice = createSlice({\n name: \"TableCell\",\n initialState: initialTableCellState,\n reducers: {\n setSelectMode: (state: TableCell, action: PayloadAction) => {\n state.selectMode = action.payload;\n },\n },\n});\n\nexport const { setSelectMode } = tableCellSlice.actions;\n\nexport default tableCellSlice.reducer;\n","import type { SettingMenuArray } from \"../types/settingsTypes\";\nexport const SettingMenu: SettingMenuArray = [\n {\n id: 1,\n title: \"SettingMenu.アカウント\",\n type: \"account\",\n icon: \"user\",\n },\n {\n id: 2,\n title: \"SettingMenu.通知設定\",\n type: \"notification\",\n icon: \"comment\",\n },\n {\n id: 3,\n title: \"SettingMenu.2要素認証\",\n type: \"two-factor-auth\",\n icon: \"verification\",\n },\n {\n id: 4,\n title: \"SettingMenu.会社情報・請求先情報\",\n type: \"company-billing-info\",\n icon: \"company\",\n },\n {\n id: 5,\n title: \"SettingMenu.メンバー管理\",\n type: \"member-management\",\n icon: \"people\",\n },\n {\n id: 6,\n title: \"SettingMenu.ゲスト管理\",\n type: \"guest-management\",\n icon: \"guest\",\n },\n {\n id: 7,\n title: \"SettingMenu.プラン・支払い\",\n type: \"plan-and-billing\",\n icon: \"credit_card\",\n },\n {\n id: 8,\n title: \"SettingMenu.共通設定\",\n type: \"common\",\n icon: \"settingBlack\",\n },\n {\n id: 9,\n title: \"SettingMenu.セキュリティ\",\n type: \"security\",\n icon: \"key\",\n },\n];\n","import React, { useState, useEffect } from \"react\";\nimport { PageLoader } from \"../../Loaders/PageLoader\";\nimport cummonStyles from \"../SettingModal.module.scss\";\nimport styles from \"./AccountSettings.module.scss\";\nimport axios from \"axios\";\nimport { Loader } from \"../../Loaders/Loader\";\naxios.defaults.headers.common[\"X-Requested-With\"] = \"XMLHttpRequest\";\n\nimport type { NoticeType } from \"../../../../types/settingsTypes\";\nimport { useTranslation } from \"react-i18next\";\n\ntype Props = {\n client: string;\n memberId: number;\n setNotice: React.Dispatch>;\n changeModalCss?: (width: string, height: string) => void;\n setIsMenuOpen?: (isOpen: boolean) => void;\n setHeaderShow?: (show: boolean) => void;\n};\n\ntype MemberInfo = {\n name?: string;\n email?: string;\n current_password?: string;\n password?: string;\n password_confirmation?: string;\n};\n\ntype Mode = \"default\" | \"deleteAccount\";\n\nconst AccountSettings = ({ client, setNotice, memberId, changeModalCss, setIsMenuOpen, setHeaderShow }: Props) => {\n const { t } = useTranslation();\n const [loading, setLoading] = useState(true);\n const [mode, setMode] = useState(\"default\");\n const [memberInfo, setMemberInfo] = useState({\n name: \"\",\n email: \"\",\n password: \"\",\n password_confirmation: \"\",\n current_password: \"\",\n });\n const [passwordForDestroy, setPasswordForDestroy] = useState(\"\");\n const [destroyErrorMessage, setDestroyErrorMessage] = useState(\"\");\n const [formLoadings, setFormLoadings] = useState<{ member: boolean; password: boolean }>({\n member: false,\n password: false,\n });\n\n const getMemberData = async () => {\n const endpoint = `/${client}/settings/members/${memberId}`;\n const { data } = await axios.get(endpoint);\n\n setMemberInfo({ name: data.name, email: data.email });\n setLoading(false);\n };\n\n const updateMember = async () => {\n const endpoint = `/${client}/settings/members/${memberId}`;\n setFormLoadings((prev) => ({ ...prev, member: true }));\n const results = await axios\n .patch(endpoint, {\n member: {\n name: memberInfo.name,\n email: memberInfo.email,\n },\n })\n .catch((error) => {\n setNotice({\n message: error.response.data?.message || t(\"AccountSettings.更新に失敗しました。\"),\n type: \"alert\",\n });\n });\n\n if (results?.data) {\n setMemberInfo({ name: results.data.name, email: results.data.email });\n setNotice({ message: results.data.message, type: \"success\" });\n }\n setFormLoadings((prev) => ({ ...prev, member: false }));\n };\n\n const updatePassword = async () => {\n const endpoint = `/${client}/settings/members/${memberId}`;\n\n setFormLoadings((prev) => ({ ...prev, password: true }));\n await axios\n .patch(endpoint, {\n member: {\n current_password: memberInfo.current_password,\n password: memberInfo.password,\n password_confirmation: memberInfo.password_confirmation,\n },\n })\n .then((res) => {\n setNotice({ message: res.data.message, type: \"success\" });\n })\n .catch((error) => {\n setNotice({\n message: error.response.data?.message || t(\"AccountSettings.更新に失敗しました。\"),\n type: \"alert\",\n });\n });\n setFormLoadings((prev) => ({ ...prev, password: false }));\n };\n\n const destroyAccount = async () => {\n if (!passwordForDestroy) {\n return;\n }\n\n const endpoint = `/${client}/settings/members/${memberId}`;\n await axios\n .delete(endpoint, {\n data: {\n member_password: passwordForDestroy,\n },\n })\n .then((res) => {\n setNotice({\n message: res.data.message,\n type: \"success\",\n });\n })\n .catch((error) => {\n if (error.response) {\n const message = error.response.data.message;\n setDestroyErrorMessage(message);\n }\n });\n };\n\n const resetPassword = async () => {\n const endpoint = `/${client}/members/${memberId}/send_reset_password_mail`;\n\n await axios.get(endpoint).then((res) => {\n setNotice({\n message: res.data.message,\n type: \"success\",\n });\n });\n };\n\n useEffect(() => {\n getMemberData();\n }, []);\n\n const renderContent = () => {\n switch (mode) {\n case \"deleteAccount\":\n return (\n
\n

{t(\"AccountSettings.アカウントの削除\")}

\n

\n {t(\"AccountSettings.所属するワークスペースのマイプロジェクト内にある全てのデータを削除します。\")}\n
\n {t(\"AccountSettings.削除したデータを復元することはできません。\")}\n
\n
\n {t(\n \"AccountSettings.退会が完了すると所属する全てのワークスペースからアカウントが削除され、ログインできなくなります。\",\n )}\n
\n {t(\"AccountSettings.今一度ご確認のうえ、実行してください。\")}\n

\n
\n {t(\"AccountSettings.確認のため「パスワード」を入力してください\")}\n setPasswordForDestroy(e.target.value)} />\n {destroyErrorMessage &&

{destroyErrorMessage}

}\n
\n
\n {\n setMode(\"default\");\n setIsMenuOpen?.(true);\n changeModalCss?.(\"100%\", \"auto\");\n setHeaderShow?.(true);\n }}\n >\n {t(\"AccountSettings.キャンセル\")}\n \n \n {t(\"AccountSettings.アカウント削除\")}\n \n
\n
\n );\n\n default:\n return (\n <>\n

{t(\"AccountSettings.アカウント設定\")}

\n
\n
\n
{t(\"AccountSettings.アカウント情報\")}
\n
\n
\n {t(\"AccountSettings.アカウント名\")}\n setMemberInfo((prev) => ({ ...prev, name: e.target.value }))}\n />\n
\n
\n {t(\"AccountSettings.メールアドレス\")}\n setMemberInfo((prev) => ({ ...prev, email: e.target.value }))}\n />\n
\n \n
\n
\n
\n
\n
\n
{t(\"AccountSettings.パスワード\")}
\n
\n
\n {t(\"AccountSettings.現在のパスワード\")}\n setMemberInfo((prev) => ({ ...prev, current_password: e.target.value }))}\n />\n
\n
\n {t(\"AccountSettings.新しいパスワード\")}\n setMemberInfo((prev) => ({ ...prev, password: e.target.value }))}\n />\n
\n
\n {t(\"AccountSettings.確認用パスワード\")}\n setMemberInfo((prev) => ({ ...prev, password_confirmation: e.target.value }))}\n />\n
\n \n

\n {t(\"AccountSettings.現在のパスワードがわからない場合はこちら\")}\n

\n
\n
\n
\n {\n setMode(\"deleteAccount\");\n setIsMenuOpen?.(false);\n changeModalCss?.(\"765px\", \"auto\");\n setHeaderShow?.(false);\n }}\n >\n {t(\"AccountSettings.アカウントの削除はこちら\")}\n

\n \n );\n }\n };\n\n return <>{!loading ? renderContent() : };\n};\n\nexport default AccountSettings;\n","import React, { ReactNode } from \"react\";\nimport styles from \"./FormFields.module.scss\";\nimport { getImageUrl } from \"../../../../commons/assets_path\";\nimport { useTranslation } from \"react-i18next\";\n\ntype Props = {\n label: string;\n value: string;\n type?: \"text\" | \"long-text\" | \"password\";\n description?: ReactNode | string;\n required?: boolean;\n error?: string;\n options?: {\n descPosition?: \"top\" | \"bottom\";\n styles?: {\n input?: object;\n };\n };\n onChange: (e: React.ChangeEvent) => void;\n dataTestId?: string;\n};\n\nconst FormInputText = ({\n label,\n value,\n type = \"text\",\n description,\n error,\n options,\n required = false,\n onChange,\n dataTestId,\n}: Props) => {\n const { t } = useTranslation();\n const descPosition = options?.descPosition || \"bottom\";\n const optionStyles = options?.styles || {};\n\n return (\n
\n
\n \n {label}\n \n {required && (\n \n \n {t(\"SettingsModalFormInputText.必須\")}\n \n )}\n
\n {description && descPosition === \"top\" &&

{description}

}\n {type === \"long-text\" ? (\n