/** * Copyright 2019 Igor Vaynberg and Select2 contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit * persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Bundle of select2 * Generated: 2019-07-17 * Version: 5.0.0-snapshot * Dependencies: * * tslib -- 1.9.3 * * preact -- 10.0.0-beta.3 */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).select25={})}(this,function(e){"use strict";var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var S=function(){return(S=Object.assign||function(e){for(var t,n=1,o=arguments.length;na[0]&&t[1]=o),p=c?W():void 0,d=f;f.updateState([e,{loading:c,results:{active:-1,page:0,results:void 0,showLoadMoreResults:!1,showMinimumCharactersError:!c,showNoSearchResultsFound:!1,token:p},search:r}],function(){if(t&&t(),c){var e=function(){return h(f,void 0,void 0,function(){var t,n,o;return v(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,u(r,0,p)];case 1:return(t=e.sent()).token!==d.state.results.token?[2]:(n=t.values||[],!i&&0=l.top&&u.bottom>l.bottom&&(c=u.bottom-l.bottom,s.scrollTop=s.scrollTop+c)}}},pe);function pe(e){var n=ue.call(this,e)||this;return n.onResultClicked=function(t){return function(e){n.props.onResultClicked(t,e)}},n.onMouseMove=function(t){return function(e){n.lastMouseClientX===e.clientX&&n.lastMouseClientY===e.clientY||(n.lastMouseClientX=e.clientX,n.lastMouseClientY=e.clientY,n.props.onMouseMove(t,e))}},n.onScroll=function(){if(n.props.showLoadMoreResults){var e=n.loadMore.current;"hidden"!==function(e,t){var n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return o.bottomn.bottom?"hidden":o.top=n.top&&o.bottom>n.bottom?"partial-bottom":"visible"}(n.container.current,e)&&n.props.onLoadMore()}},n.container={},n.loadMore={},n}var de,fe=B({},G,{values:[]}),he=(t(ve,de=$),ve.prototype.componentWillMount=function(){m()},ve.prototype.render=function(e,t){var n,o,u=this,r=e.values,s=e.tabIndex,a=e.minimumCharacters,i=e.valuesLabel,l=e.comboboxLabel,c=e.placeholder,p=t.open,d=t.loading,f=t.focused,h=t.search,v=t.values,m=v.active,g=v.selected,y=t.results,_=this.dictionary,b=q(ie.control,ie.multi,((n={})[ie.open]=p,n),((o={})[ie.focused]=f,o));e.containerClass&&0