"use strict";(globalThis.itsecWebpackJsonP=globalThis.itsecWebpackJsonP||[]).push([[1541],{11541:(t,e,n)=>{n.r(e),n.d(e,{default:()=>A,useAsync:()=>l});var i=n(58168),r=n(51609),o=n(13526),u=n(52836),a=n(64467),s=n(89379),c=n(80296),f=n(80045),d=n(63538),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,A=void 0!==l&&l,p=t.onInputChange,h=t.filterOption,S=void 0===h?null:h,O=(0,f.A)(t,v),g=O.inputValue,b=(0,r.useRef)(void 0),y=(0,r.useRef)(!1),C=(0,r.useState)(Array.isArray(n)?n:void 0),k=(0,c.A)(C,2),L=k[0],E=k[1],I=(0,r.useState)(void 0!==g?g:""),R=(0,c.A)(I,2),J=R[0],P=R[1],T=(0,r.useState)(!0===n),W=(0,c.A)(T,2),m=W[0],w=W[1],V=(0,r.useState)(void 0),j=(0,c.A)(V,2),q=j[0],x=j[1],z=(0,r.useState)([]),B=(0,c.A)(z,2),D=B[0],F=B[1],G=(0,r.useState)(!1),H=(0,c.A)(G,2),K=H[0],M=H[1],N=(0,r.useState)({}),Q=(0,c.A)(N,2),U=Q[0],X=Q[1],Y=(0,r.useState)(void 0),Z=(0,c.A)(Y,2),$=Z[0],_=Z[1],tt=(0,r.useState)(void 0),et=(0,c.A)(tt,2),nt=et[0],it=et[1];o!==nt&&(X({}),it(o)),n!==$&&(E(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(J,(function(t){y.current&&(E(t||[]),w(!!b.current))}))}),[]);var ot=(0,r.useCallback)((function(t,e){var n=(0,d.L)(t,e,p);if(!n)return b.current=void 0,P(""),x(""),F([]),w(!1),void M(!1);if(o&&U[n])P(n),x(n),F(U[n]),w(!1),M(!1);else{var i=b.current={};P(n),w(!0),M(!q),rt(n,(function(t){y&&i===b.current&&(b.current=void 0,w(!1),x(n),F(t||[]),M(!1),X(t?(0,s.A)((0,s.A)({},U),{},(0,a.A)({},n,t)):U))}))}}),[o,rt,q,U,p]),ut=K?[]:J&&q?D:L||[];return(0,s.A)((0,s.A)({},O),{},{options:ut,isLoading:m||A,onInputChange:ot,filterOption:S})}n(75795),n(27003);var A=(0,r.forwardRef)((function(t,e){var n=l(t),a=(0,u.u)(n);return r.createElement(o.S,(0,i.A)({ref:e},a))}))}}]);