You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
10 KiB
1 lines
10 KiB
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[336],{7504:function(n,e,t){var r=t(5893),u=t(7294),l=t(8263),o=t(7357);function i(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function a(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function c(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})))),r.forEach((function(e){a(n,e,t[e])}))}return n}function s(n,e){if(null==n)return{};var t,r,u=function(n,e){if(null==n)return{};var t,r,u={},l=Object.keys(n);for(r=0;r<l.length;r++)t=l[r],e.indexOf(t)>=0||(u[t]=n[t]);return u}(n,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(n);for(r=0;r<l.length;r++)t=l[r],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(u[t]=n[t])}return u}function f(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var t=null==n?null:"undefined"!==typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=t){var r,u,l=[],o=!0,i=!1;try{for(t=t.call(n);!(o=(r=t.next()).done)&&(l.push(r.value),!e||l.length!==e);o=!0);}catch(a){i=!0,u=a}finally{try{o||null==t.return||t.return()}finally{if(i)throw u}}return l}}(n,e)||function(n,e){if(!n)return;if("string"===typeof n)return i(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);"Object"===t&&n.constructor&&(t=n.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(n,e)}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.Z=function(n){var e=n.calculateItemBreakpoints,t=void 0===e?function(){return{xs:1}}:e,i=n.layout,a=n.wrapperBoxProps,d=s(n,["calculateItemBreakpoints","layout","wrapperBoxProps"]),v=(0,u.useMemo)((function(){return Object.entries(i).map((function(n,e){var r=f(n,2),o=r[0],i=r[1],a=o;return i?(0,u.createElement)(l.ZP,c({},t(e,a),{key:a,item:!0},i)):void 0}))}),[t,i]);return(0,r.jsx)(o.Z,c({},a,{children:(0,r.jsx)(l.ZP,c({container:!0},d,{children:v}))}))}},4069:function(n,e,t){t.d(e,{Z:function(){return h}});var r=t(6486),u=t(7294),l=t(3675),o=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.postSet,t=n.preSet,r=n.set,u=n.setType,o=void 0===u?"string":u,i=n.valueKey,a=void 0===i?"value":i;return function(n){var u=n.target[a],i=l.Z[o](u);null===t||void 0===t||t.call(null,n),null===r||void 0===r||r.call(null,i),null===e||void 0===e||e.call(null,n)}},i=t(2027);function a(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function c(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function s(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})))),r.forEach((function(e){c(n,e,t[e])}))}return n}function f(n,e){if(null==n)return{};var t,r,u=function(n,e){if(null==n)return{};var t,r,u={},l=Object.keys(n);for(r=0;r<l.length;r++)t=l[r],e.indexOf(t)>=0||(u[t]=n[t]);return u}(n,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(n);for(r=0;r<l.length;r++)t=l[r],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(u[t]=n[t])}return u}function d(n){return function(n){if(Array.isArray(n))return a(n)}(n)||function(n){if("undefined"!==typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,e){if(!n)return;if("string"===typeof n)return a(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);"Object"===t&&n.constructor&&(t=n.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(n,e)}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(n){var e=function(n,e){if("object"!==p(n)||null===n)return n;var t=n[Symbol.toPrimitive];if(void 0!==t){var r=t.call(n,e||"default");if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(n)}(n,"string");return"symbol"===p(e)?e:String(e)}var p=function(n){return n&&"undefined"!==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n};var y="input",b={boolean:!1,number:0,string:""},m={createInputOnChangeHandlerOptions:{},debounceWait:500,required:!1,valueType:"string"},g=(0,u.forwardRef)((function(n,e){var t=n.debounceWait,l=void 0===t?m.debounceWait:t,a=n.input,p=n.inputTestBatch,g=n.onBlurAppend,h=n.onFirstRender,O=n.onFocusAppend,S=n.onUnmount,j=n.required,w=void 0===j?m.required:j,k=n.valueKey,C=n.valueType,A=void 0===C?m.valueType:C,I=n.createInputOnChangeHandlerOptions,M=void 0===I?m.createInputOnChangeHandlerOptions:I,P=M.postSet,E=M.valueKey,F=void 0===E?k:E,T=f(n.createInputOnChangeHandlerOptions,["postSet","valueKey"]),x=a.props,B=(0,u.useMemo)((function(){return null!==F&&void 0!==F?F:"checked"in x?"checked":"value"}),[x,F]),Z=x.onBlur,R=x.onChange,V=x.onFocus,K=x[B],U=void 0===K?b[A]:K,q=f(x,["onBlur","onChange","onFocus",B].map(v)),H=(0,u.useState)(U),N=H[0],W=H[1],_=(0,u.useState)(!1),$=_[0],D=_[1],L=(0,u.useState)(!1),z=L[0],G=L[1],J=(0,u.useCallback)((function(n){W(n)}),[]),Q=(0,u.useMemo)((function(){var n;return p&&(p.isRequired=w,n=(0,i.LT)(c({},y,p))),n}),[p,w]),X=(0,u.useCallback)((function(n){var e,t=null!==(e=null===Q||void 0===Q?void 0:Q.call(null,{inputs:c({},y,{value:n}),isIgnoreOnCallbacks:!0}))&&void 0!==e&&e;null===h||void 0===h||h.call(null,{isValid:t}),G(t)}),[h,Q]),Y=(0,u.useMemo)((function(){return(0,r.debounce)(X,l)}),[l,X]),nn=(0,u.useMemo)((function(){return null!==Z&&void 0!==Z?Z:Q&&function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var r,u=e[0],l=u.target.value,o=Q({inputs:c({},y,{value:l})});G(o),null===g||void 0===g||(r=g).call.apply(r,[null].concat(d(e)))}}),[Z,g,Q]),en=(0,u.useMemo)((function(){return o(s({postSet:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var r,u;D(!0),null===R||void 0===R||(r=R).call.apply(r,[null].concat(d(e))),null===P||void 0===P||(u=P).call.apply(u,[null].concat(d(e)))},set:function(n){J(n),Y(n)},setType:A,valueKey:B},T))}),[Y,R,P,T,J,B,A]),tn=(0,u.useMemo)((function(){return null!==V&&void 0!==V?V:p&&function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var r,u,l;null===(u=p.defaults)||void 0===u||null===(l=u.onSuccess)||void 0===l||l.call(null,{append:{}}),null===O||void 0===O||(r=O).call.apply(r,[null].concat(d(e)))}}),[V,p,O]);return(0,u.useEffect)((function(){return X(N),S}),[]),(0,u.useEffect)((function(){!$&&N!==U&&U&&(X(U),W(U))}),[X,U,N,$]),(0,u.useImperativeHandle)(e,(function(){return{getIsChangedByUser:function(){return $},getValue:function(){return N},isValid:function(){return z},setValue:J}}),[N,$,z,J]),(0,u.cloneElement)(a,s({},q,c({onBlur:nn,onChange:en,onFocus:tn,required:w},B,N)))}));g.defaultProps=m,g.displayName="InputWithRef";var h=g},8859:function(n,e,t){var r=t(7294),u=t(4390),l=t(6607),o=t(1770),i=t(2749);function a(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function c(n,e){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var t=null==n?null:"undefined"!==typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=t){var r,u,l=[],o=!0,i=!1;try{for(t=t.call(n);!(o=(r=t.next()).done)&&(l.push(r.value),!e||l.length!==e);o=!0);}catch(a){i=!0,u=a}finally{try{o||null==t.return||t.return()}finally{if(i)throw u}}return l}}(n,e)||function(n,e){if(!n)return;if("string"===typeof n)return a(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);"Object"===t&&n.constructor&&(t=n.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(n,e)}(n,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e.Z=function(n,e){var t,a=c((0,i.Z)(!1),2),s=a[0],f=a[1],d=(0,r.useState)({}),v=d[0],p=d[1],y=(0,r.useCallback)((function(n){var t,r;return null===e||void 0===e||null===(t=e.current)||void 0===t||null===(r=t.setMessage)||void 0===r?void 0:r.call(null,"api",n)}),[e]),b=(0,r.useCallback)((function(n,t){var r,u;null===e||void 0===e||null===(r=e.current)||void 0===r||null===(u=r.setMessage)||void 0===u||u.call(null,String(n),t)}),[e]),m=(0,r.useCallback)((function(n,t){var r,u;null===e||void 0===e||null===(r=e.current)||void 0===r||null===(u=r.setMessageRe)||void 0===u||u.call(null,n,t)}),[e]),g=(0,r.useCallback)((function(n,e){p((0,l.ZP)(n,e))}),[]),h=(0,r.useCallback)((function(n,e){p((0,l.Um)(n,e))}),[]),O=(0,r.useCallback)((function(n){b(n),g(n)}),[b,g]),S=(0,r.useCallback)((function(n){m(n),h(n)}),[m,h]),j=(0,r.useCallback)((function(n){return function(e){g(n,e)}}),[g]),w=(0,r.useCallback)((function(n){return function(e){var t=e.isValid;g(n,t)}}),[g]),k=(0,r.useCallback)((function(n){return function(){O(n)}}),[O]),C=(0,r.useCallback)((function(n){var r=n.body,l=n.getErrorMsg,i=n.msgKey,a=void 0===i?"api":i,c=n.method,s=n.onError,d=n.onSuccess,v=n.setMsg,p=void 0===v?null===e||void 0===e||null===(t=e.current)||void 0===t?void 0:t.setMessage:v,y=n.successMsg,b=n.url;f(!0),u.Z.request({data:r,method:c,url:b}).then((function(){null===p||void 0===p||p.call(null,a,{children:y,type:"info"}),null===d||void 0===d||d.call(null)})).catch((function(n){var e=(0,o.Z)(n);e.children=l(e.children),null===p||void 0===p||p.call(null,a,e),null===s||void 0===s||s.call(null)})).finally((function(){f(!1)}))}),[e,f]),A=(0,r.useMemo)((function(){return Object.values(v).some((function(n){return!n}))}),[v]);return{buildFinishInputTestBatchFunction:j,buildInputFirstRenderFunction:w,buildInputUnmountFunction:k,formValidity:v,isFormInvalid:A,isFormSubmitting:s,setApiMessage:y,setFormValidity:p,setMessage:b,setMessageRe:m,setValidity:g,setValidityRe:h,submitForm:C,unsetKey:O,unsetKeyRe:S}}}}]); |