"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("react");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=u(e);exports.useMultiSelectDraftValue=function(e){var u=e.value,r=e.optionIds,a=e.onChange,l=t.useState(null),o=n.default(l,2),c=o[0],i=o[1],s=t.useState(!1),f=n.default(s,2),d=f[0],b=f[1],p=t.useMemo((function(){return 0===u.length?r:u}),[r,u]),v=t.useMemo((function(){return d&&null!=c?c:p}),[p,c,d]),C=t.useCallback((function(){d||(i(p),b(!0))}),[p,d]),h=t.useCallback((function(){i(null),b(!1)}),[]);return{value:v,onChange:t.useCallback((function(e){i(e),a(e)}),[a]),startInteraction:C,endInteraction:h}};
//# sourceMappingURL=useMultiSelectDraftValue.js.map
