"use strict";(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[4136],{64136:(t,e,n)=>{n.r(e),n.d(e,{default:()=>p,useAsync:()=>l});var i=n(87462),r=n(99196),o=n(91253),u=n(65342),a=n(4942),s=n(1413),c=n(70885),f=n(45987),d=n(37274),v=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"];function l(t){var e=t.defaultOptions,n=void 0!==e&&e,i=t.cacheOptions,o=void 0!==i&&i,u=t.loadOptions;t.options;var l=t.isLoading,p=void 0!==l&&l,Z=t.onInputChange,h=t.filterOption,S=void 0===h?null:h,O=(0,f.Z)(t,v),g=O.inputValue,b=(0,r.useRef)(void 0),y=(0,r.useRef)(!1),A=(0,r.useState)(Array.isArray(n)?n:void 0),C=(0,c.Z)(A,2),k=C[0],L=C[1],E=(0,r.useState)(void 0!==g?g:""),I=(0,c.Z)(E,2),R=I[0],J=I[1],P=(0,r.useState)(!0===n),T=(0,c.Z)(P,2),W=T[0],m=T[1],w=(0,r.useState)(void 0),V=(0,c.Z)(w,2),j=V[0],q=V[1],x=(0,r.useState)([]),z=(0,c.Z)(x,2),B=z[0],D=z[1],F=(0,r.useState)(!1),G=(0,c.Z)(F,2),H=G[0],K=G[1],M=(0,r.useState)({}),N=(0,c.Z)(M,2),Q=N[0],U=N[1],X=(0,r.useState)(void 0),Y=(0,c.Z)(X,2),$=Y[0],_=Y[1],tt=(0,r.useState)(void 0),et=(0,c.Z)(tt,2),nt=et[0],it=et[1];o!==nt&&(U({}),it(o)),n!==$&&(L(Array.isArray(n)?n:void 0),_(n)),(0,r.useEffect)((function(){return y.current=!0,function(){y.current=!1}}),[]);var rt=(0,r.useCallback)((function(t,e){if(!u)return e();var n=u(t,e);n&&"function"==typeof n.then&&n.then(e,(function(){return e()}))}),[u]);(0,r.useEffect)((function(){!0===n&&rt(R,(function(t){y.current&&(L(t||[]),m(!!b.current))}))}),[]);var ot=(0,r.useCallback)((function(t,e){var n=(0,d.L)(t,e,Z);if(!n)return b.current=void 0,J(""),q(""),D([]),m(!1),void K(!1);if(o&&Q[n])J(n),q(n),D(Q[n]),m(!1),K(!1);else{var i=b.current={};J(n),m(!0),K(!j),rt(n,(function(t){y&&i===b.current&&(b.current=void 0,m(!1),q(n),D(t||[]),K(!1),U(t?(0,s.Z)((0,s.Z)({},Q),{},(0,a.Z)({},n,t)):Q))}))}}),[o,rt,j,Q,Z]),ut=H?[]:R&&j?B:k||[];return(0,s.Z)((0,s.Z)({},O),{},{options:ut,isLoading:W||p,onInputChange:ot,filterOption:S})}n(91850),n(73469);var p=(0,r.forwardRef)((function(t,e){var n=l(t),a=(0,u.u)(n);return r.createElement(o.S,(0,i.Z)({ref:e},a))}))}}]);