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,IAAAvG,UAAQ,IAAMtC,EAAEmI,EAAEI,WAAWnH,MAAM0H,QAAQ,eAAgB,SAAS,CAAC9I,EAAEmI,EAAEI,WAAWnH,QAE3GpB,EAAEmI,EAAEI,WAAWG,IAAK,MAAM,IAAIrH,MAAM,iBACpCiG,MAAkBtH,EAAEmI,EAAEI,WAAW9G,KAAOA,GAE7C,MAAM,iBAACuE,GAAoB,GAAqBI,GAC9CA,EAAgB2C,WAAa/I,EAAEmI,EAAEI,WAAWnH,MAAQgF,EAAgB2C,WAAa/I,EAAEmI,EAAEU,qBAGjFG,EAAc,CAClBjJ,OAAQiG,EACR3D,KAAMrC,EAAEA,EAAEqC,KACVyF,MAAOA,KAGT,MAAO,CACLS,WAAYvI,EAAEmI,EAAEI,WAChBS,cACA9G,YACF,C","sources":["webpack://wooftech/./node_modules/@kaspernj/api-maker/src/bootstrap/invalid-feedback.jsx","webpack://wooftech/./node_modules/@kaspernj/api-maker/src/form.jsx","webpack://wooftech/./node_modules/debounce/index.js","webpack://wooftech/./node_modules/react-native-web/dist/cjs/exports/Platform/index.js","webpack://wooftech/./node_modules/@kaspernj/api-maker/src/inputs/id-for-component.mjs","webpack://wooftech/./node_modules/@kaspernj/api-maker/src/inputs/name-for-component.mjs","webpack://wooftech/./node_modules/@kaspernj/api-maker/src/use-validation-errors.mjs","webpack://wooftech/./node_modules/@kaspernj/api-maker/src/use-input.mjs"],"sourcesContent":["import {digs} from \"diggerize\"\nimport PropTypes from \"prop-types\"\nimport propTypesExact from \"prop-types-exact\"\nimport React from \"react\"\n\nexport default class ApiMakerBootstrapInvalidFeedback extends React.PureComponent {\n static propTypes = propTypesExact({\n errors: PropTypes.array.isRequired\n })\n\n render () {\n return (\n
\n {this.errorMessages().join(\". \")}\n
\n )\n }\n\n errorMessages () {\n const {errors} = digs(this.props, \"errors\")\n const errorMessages = []\n\n for (const error of errors) {\n for (const errorMessage of error.getErrorMessages()) {\n errorMessages.push(errorMessage)\n }\n }\n\n return errorMessages\n }\n}\n","import {createContext, memo, useContext, useMemo} from \"react\"\nimport BaseComponent from \"./base-component\"\nimport FormDataObjectizer from \"form-data-objectizer\"\nimport {Platform} from \"react-native\"\nimport {shapeComponent} from \"set-state-compare/src/shape-component.js\"\n\nconst FormContext = createContext(null)\n\nclass FormInputs {\n constructor() {\n this.inputs = {}\n }\n\n asObject() {\n const result = {}\n const formDataObjectizer = new FormDataObjectizer()\n\n for(const key in this.inputs) {\n const value = this.inputs[key]\n\n formDataObjectizer.treatInitial(key, value, result)\n }\n\n return result\n }\n\n setValue(name, value) {\n if (!name) throw new Error(\"'name' is required\")\n\n this.inputs[name] = value\n }\n\n setValueWithHidden(name, value) {\n this.setValue(name, value)\n\n if (Platform.OS == \"web\") {\n return \n }\n }\n}\n\nconst Form = memo(shapeComponent(class Form extends BaseComponent {\n render() {\n const {children, setForm, ...restProps} = this.props\n const form = useMemo(() => new FormInputs(), [])\n\n useMemo(() => {\n if (setForm) {\n setForm(form)\n }\n }, [setForm])\n\n return (\n \n {Platform.OS == \"web\" &&\n
\n {children}\n
\n }\n {Platform.OS != \"web\" && this.props.children}\n
\n )\n }\n}))\n\nconst useForm = () => useContext(FormContext)\n\nexport {Form, FormContext, FormInputs, useForm}\n","function debounce(function_, wait = 100, options = {}) {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError(`Expected the first parameter to be a function, got \\`${typeof function_}\\`.`);\n\t}\n\n\tif (wait < 0) {\n\t\tthrow new RangeError('`wait` must not be negative.');\n\t}\n\n\t// TODO: Deprecate the boolean parameter at some point.\n\tconst {immediate} = typeof options === 'boolean' ? {immediate: options} : options;\n\n\tlet storedContext;\n\tlet storedArguments;\n\tlet timeoutId;\n\tlet timestamp;\n\tlet result;\n\n\tfunction run() {\n\t\tconst callContext = storedContext;\n\t\tconst callArguments = storedArguments;\n\t\tstoredContext = undefined;\n\t\tstoredArguments = undefined;\n\t\tresult = function_.apply(callContext, callArguments);\n\t\treturn result;\n\t}\n\n\tfunction later() {\n\t\tconst last = Date.now() - timestamp;\n\n\t\tif (last < wait && last >= 0) {\n\t\t\ttimeoutId = setTimeout(later, wait - last);\n\t\t} else {\n\t\t\ttimeoutId = undefined;\n\n\t\t\tif (!immediate) {\n\t\t\t\tresult = run();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst debounced = function (...arguments_) {\n\t\tif (storedContext && this !== storedContext) {\n\t\t\tthrow new Error('Debounced method called with different contexts.');\n\t\t}\n\n\t\tstoredContext = this; // eslint-disable-line unicorn/no-this-assignment\n\t\tstoredArguments = arguments_;\n\t\ttimestamp = Date.now();\n\n\t\tconst callNow = immediate && !timeoutId;\n\n\t\tif (!timeoutId) {\n\t\t\ttimeoutId = setTimeout(later, wait);\n\t\t}\n\n\t\tif (callNow) {\n\t\t\tresult = run();\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tdebounced.clear = () => {\n\t\tif (!timeoutId) {\n\t\t\treturn;\n\t\t}\n\n\t\tclearTimeout(timeoutId);\n\t\ttimeoutId = undefined;\n\t};\n\n\tdebounced.flush = () => {\n\t\tif (!timeoutId) {\n\t\t\treturn;\n\t\t}\n\n\t\tdebounced.trigger();\n\t};\n\n\tdebounced.trigger = () => {\n\t\tresult = run();\n\n\t\tdebounced.clear();\n\t};\n\n\treturn debounced;\n}\n\n// Adds compatibility for ES modules\nmodule.exports.debounce = debounce;\n\nmodule.exports = debounce;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nvar Platform = {\n OS: 'web',\n select: obj => 'web' in obj ? obj.web : obj.default,\n get isTesting() {\n if (process.env.NODE_ENV === 'test') {\n return true;\n }\n return false;\n }\n};\nvar _default = Platform;\nexports.default = _default;\nmodule.exports = exports.default;","import * as inflection from \"inflection\"\n\nexport default function apiMakerIdForComponent(component) {\n if (\"id\" in component.props) {\n return component.props.id\n } else if (component.props.attribute && component.props.model) {\n return `${component.props.model.modelClassData().paramKey}_${inflection.underscore(component.props.attribute)}`\n } else if (component.generatedInputId) {\n return component.generatedInputId\n } else {\n const generatedInputId = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)\n component.generatedInputId = generatedInputId\n return generatedInputId\n }\n}\n","import * as inflection from \"inflection\"\n\nexport default function apiMakerNameForComponent (component) {\n if (\"name\" in component.props) {\n return component.props.name\n } else if (component.props.attribute && component.props.model) {\n let attributeName = inflection.underscore(component.props.attribute)\n\n if (component.props.type == \"money\") {\n attributeName += \"_cents\"\n }\n\n return `${component.props.model.modelClassData().paramKey}[${attributeName}]`\n }\n}\n","import events from \"./events.mjs\"\nimport {useCallback} from \"react\"\nimport useEventEmitter from \"./use-event-emitter.mjs\"\nimport useShape from \"set-state-compare/src/use-shape.js\"\n\nconst useValidationErrors = (callback) => {\n const s = useShape({callback})\n\n s.useStates({validationErrors: []})\n\n const onValidationErrors = useCallback((validationErrors) => {\n const matchedValidationErrors = []\n\n for (const validationError of validationErrors.getValidationErrors()) {\n if (s.p.callback(validationError)) {\n validationError.setHandled()\n matchedValidationErrors.push(validationError)\n }\n }\n\n s.set({\n validationErrors: matchedValidationErrors\n })\n }, [])\n\n useEventEmitter(events, \"onValidationErrors\", onValidationErrors)\n\n return {\n validationErrors: s.s.validationErrors\n }\n}\n\nexport default useValidationErrors\n","import {dig, digg} from \"diggerize\"\nimport {useCallback, useEffect, useMemo} from \"react\"\nimport idForComponent from \"./inputs/id-for-component.mjs\"\nimport nameForComponent from \"./inputs/name-for-component.mjs\"\nimport strftime from \"strftime\"\nimport useShape from \"set-state-compare/src/use-shape.js\"\nimport useValidationErrors from \"./use-validation-errors.mjs\"\n\nconst useInput = ({props, wrapperOptions}) => {\n const s = useShape(props)\n\n s.useStates({\n form: undefined\n })\n\n useEffect(() => {\n setForm()\n }, [s.props.inputRef?.current])\n\n s.meta.fakeComponent = {props}\n\n const formatValue = useCallback((value) => {\n const {formatValue} = s.props\n\n if (formatValue) {\n return formatValue(value)\n } else if (value instanceof Date && !isNaN(value.getTime())) {\n // We need to use a certain format for datetime-local\n if (inputType() == \"datetime-local\") {\n return strftime(\"%Y-%m-%dT%H:%M:%S\", value)\n } else if (inputType() == \"date\") {\n return strftime(\"%Y-%m-%d\", value)\n }\n }\n\n return value\n }, [])\n\n const handleAsCheckbox = useCallback(() => {\n if (s.props.type == \"checkbox\") return true\n if (!(\"type\" in s.props) && wrapperOptions?.type == \"checkbox\") return true\n\n return false\n }, [])\n\n const handleAsSelect = useCallback(() => {\n if (wrapperOptions?.type == \"select\") return true\n\n return false\n }, [])\n\n const inputDefaultChecked = useCallback(() => {\n if (\"defaultChecked\" in s.props) {\n return s.props.defaultChecked\n } else if (s.props.model) {\n if (!s.props.model[s.props.attribute])\n throw new Error(`No such attribute: ${s.props.attribute}`)\n\n return s.props.model[s.props.attribute]()\n }\n }, [])\n\n const inputDefaultValue = useCallback(() => {\n if (\"defaultValue\" in s.props) {\n return formatValue(s.props.defaultValue)\n } else if (s.props.model) {\n if (!s.props.model[s.props.attribute]) {\n throw new Error(`No such attribute defined on resource: ${digg(s.props.model.modelClassData(), \"name\")}#${s.props.attribute}`)\n }\n\n return formatValue(s.props.model[s.props.attribute]())\n }\n }, [])\n\n const inputRefBackup = useCallback(() => {\n if (!s.meta._inputRefBackup) s.meta._inputRefBackup = React.createRef()\n\n return s.meta._inputRefBackup\n }, [])\n\n const inputRef = useCallback(() => s.props.inputRef || inputRefBackup())\n\n const inputType = useCallback(() => {\n if (\"type\" in s.props) {\n return s.props.type\n } else if (wrapperOptions?.type == \"checkbox\") {\n return \"checkbox\"\n } else {\n return \"text\"\n }\n }, [])\n\n const label = useCallback(() => {\n if (\"label\" in s.props) {\n return s.props.label\n } else if (s.props.attribute && s.props.model) {\n return s.props.model.modelClass().humanAttributeName(s.props.attribute)\n }\n }, [])\n\n const setForm = useCallback(() => {\n const inputElement = inputRef().current\n\n let form\n\n if (inputElement) form = dig(inputElement, \"form\")\n if (form && form != s.s.form) s.set({form})\n }, [])\n\n const getId = useCallback(() => idForComponent(s.m.fakeComponent), [])\n const getName = useCallback(() => nameForComponent(s.m.fakeComponent), [])\n\n const getInputProps = useCallback(() => {\n const givenInputProps = s.props.inputProps || {}\n const inputProps = Object.assign(\n {\n id: getId(),\n name: getName(),\n ref: inputRef()\n },\n givenInputProps\n )\n\n if (handleAsCheckbox()) {\n if (\"checked\" in s.props) {\n inputProps.checked = s.props.checked\n }\n\n if (\"defaultChecked\" in s.props || (s.props.attribute && s.props.model)) {\n inputProps.defaultChecked = inputDefaultChecked()\n }\n } else if (!(\"value\" in s.props)) {\n inputProps.defaultValue = inputDefaultValue()\n }\n\n return inputProps\n }, [])\n\n const {inputProps: oldInputProps, ...restProps} = props\n const type = inputType()\n\n s.meta.inputProps = getInputProps()\n s.meta.inputNameWithoutId = useMemo(() => s.m.inputProps.name?.replace(/\\[(.+)_id\\]$/, \"[$1]\"), [s.m.inputProps.name])\n\n if (!s.m.inputProps.ref) throw new Error(\"No input ref?\")\n if (!handleAsSelect()) s.m.inputProps.type = type\n\n const {validationErrors} = useValidationErrors((validationError) =>\n validationError.inputName == s.m.inputProps.name || validationError.inputName == s.m.inputNameWithoutId\n )\n\n const wrapperOpts = {\n errors: validationErrors,\n form: s.s.form,\n label: label()\n }\n\n return {\n inputProps: s.m.inputProps,\n wrapperOpts,\n restProps\n }\n}\n\nexport default useInput\n"],"names":["ApiMakerBootstrapInvalidFeedback","_React$PureComponent","_classCallCheck","_callSuper","arguments","_inherits","key","value","React","className","this","errorMessages","join","_step","_iterator","_createForOfIteratorHelper","digs","props","errors","s","n","done","_step2","_iterator2","getErrorMessages","errorMessage","push","err","e","f","FormContext","createContext","FormInputs","_createClass","inputs","result","formDataObjectizer","FormDataObjectizer","treatInitial","name","Error","setValue","Platform","createElement","type","undefined","Form","memo","shapeComponent","_BaseComponent","_this$props","children","setForm","restProps","_objectWithoutProperties","_excluded","form","useMemo","Provider","BaseComponent","useForm","useContext","debounce","function_","wait","options","TypeError","RangeError","immediate","storedContext","storedArguments","timeoutId","timestamp","run","callContext","callArguments","apply","later","last","Date","now","setTimeout","debounced","arguments_","callNow","clear","clearTimeout","flush","trigger","module","exports","__esModule","_default","OS","select","obj","web","default","isTesting","apiMakerIdForComponent","component","id","attribute","model","modelClassData","paramKey","generatedInputId","Math","random","toString","substring","apiMakerNameForComponent","attributeName","callback","useStates","validationErrors","onValidationErrors","useCallback","matchedValidationErrors","validationError","getValidationErrors","p","setHandled","set","events","wrapperOptions","useEffect","inputRef","current","meta","fakeComponent","formatValue","isNaN","getTime","inputType","strftime","handleAsCheckbox","handleAsSelect","inputDefaultChecked","defaultChecked","inputDefaultValue","defaultValue","inputRefBackup","_inputRefBackup","createRef","label","modelClass","humanAttributeName","inputElement","getId","m","getName","getInputProps","givenInputProps","inputProps","Object","assign","ref","checked","oldInputProps","inputNameWithoutId","replace","inputName","wrapperOpts"],"sourceRoot":""}