From 7c1a18895ecf789abd1fbbdad8aaaf95c400daec Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Mon, 13 Nov 2017 19:13:37 +0000 Subject: [PATCH] Use export for classes --- src/scripts/dist/choices.js | 5621 +++++++++++++++---------------- src/scripts/dist/choices.js.map | 2 +- src/scripts/dist/choices.min.js | 4 +- src/scripts/src/choices.js | 4 +- src/scripts/src/store/store.js | 2 - 5 files changed, 2726 insertions(+), 2907 deletions(-) diff --git a/src/scripts/dist/choices.js b/src/scripts/dist/choices.js index da80db9..6d41e04 100644 --- a/src/scripts/dist/choices.js +++ b/src/scripts/dist/choices.js @@ -1,4 +1,4 @@ -/*! choices.js v3.0.2 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */ +/*! choices.js v3.0.2 | (c) 2017 Josh Johnson | https://github.com/jshjohnson/Choices#readme */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); @@ -71,45 +71,1655 @@ return /******/ (function(modules) { // webpackBootstrap /******/ __webpack_require__.p = "/src/scripts/dist/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 6); +/******/ return __webpack_require__(__webpack_require__.s = 1); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(2); + + +/***/ }), +/* 2 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* unused harmony export capitalise */ -/* unused harmony export generateChars */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return generateId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return isType; }); -/* unused harmony export isNode */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return isElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return extend; }); -/* unused harmony export whichTransitionEvent */ -/* unused harmony export whichAnimationEvent */ -/* unused harmony export getParentsUntil */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return wrap; }); -/* unused harmony export getSiblings */ -/* unused harmony export findAncestor */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return findAncestorByAttrName; }); -/* unused harmony export debounce */ -/* unused harmony export getElemDistance */ -/* unused harmony export getElementOffset */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getAdjacentEl; }); -/* unused harmony export getScrollPosition */ -/* unused harmony export isInView */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return isScrolledIntoView; }); -/* unused harmony export stripHTML */ -/* unused harmony export addAnimation */ -/* unused harmony export getRandomNumber */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return strToEl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getWidthOfInput; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return sortByAlpha; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return sortByScore; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return dispatchEvent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return regexFilter; }); +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); + +// EXTERNAL MODULE: ./node_modules/fuse.js/dist/fuse.js +var dist_fuse = __webpack_require__(3); +var fuse_default = /*#__PURE__*/__webpack_require__.n(dist_fuse); + +// EXTERNAL MODULE: ./node_modules/redux/node_modules/lodash-es/_freeGlobal.js +var _freeGlobal = __webpack_require__(4); + +// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_root.js + + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = _freeGlobal["a" /* default */] || freeSelf || Function('return this')(); + +/* harmony default export */ var _root = (root); + +// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_Symbol.js + + +/** Built-in value references. */ +var _Symbol_Symbol = _root.Symbol; + +/* harmony default export */ var _Symbol = (_Symbol_Symbol); + +// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_getRawTag.js + + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var _getRawTag_hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = _getRawTag_hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +/* harmony default export */ var _getRawTag = (getRawTag); + +// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_objectToString.js +/** Used for built-in method references. */ +var _objectToString_objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var _objectToString_nativeObjectToString = _objectToString_objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return _objectToString_nativeObjectToString.call(value); +} + +/* harmony default export */ var _objectToString = (objectToString); + +// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_baseGetTag.js + + + + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var _baseGetTag_symToStringTag = _Symbol ? _Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (_baseGetTag_symToStringTag && _baseGetTag_symToStringTag in Object(value)) + ? _getRawTag(value) + : _objectToString(value); +} + +/* harmony default export */ var _baseGetTag = (baseGetTag); + +// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_overArg.js +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/* harmony default export */ var _overArg = (overArg); + +// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_getPrototype.js + + +/** Built-in value references. */ +var getPrototype = _overArg(Object.getPrototypeOf, Object); + +/* harmony default export */ var _getPrototype = (getPrototype); + +// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/isObjectLike.js +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +/* harmony default export */ var lodash_es_isObjectLike = (isObjectLike); + +// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/isPlainObject.js + + + + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + isPlainObject_objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var isPlainObject_hasOwnProperty = isPlainObject_objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!lodash_es_isObjectLike(value) || _baseGetTag(value) != objectTag) { + return false; + } + var proto = _getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = isPlainObject_hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +/* harmony default export */ var lodash_es_isPlainObject = (isPlainObject); + +// EXTERNAL MODULE: ./node_modules/redux/node_modules/symbol-observable/index.js +var symbol_observable = __webpack_require__(5); +var symbol_observable_default = /*#__PURE__*/__webpack_require__.n(symbol_observable); + +// CONCATENATED MODULE: ./node_modules/redux/es/createStore.js + + + +/** + * These are private action types reserved by Redux. + * For any unknown actions, you must return the current state. + * If the current state is undefined, you must return the initial state. + * Do not reference these action types directly in your code. + */ +var ActionTypes = { + INIT: '@@redux/INIT' + + /** + * Creates a Redux store that holds the state tree. + * The only way to change the data in the store is to call `dispatch()` on it. + * + * There should only be a single store in your app. To specify how different + * parts of the state tree respond to actions, you may combine several reducers + * into a single reducer function by using `combineReducers`. + * + * @param {Function} reducer A function that returns the next state tree, given + * the current state tree and the action to handle. + * + * @param {any} [preloadedState] The initial state. You may optionally specify it + * to hydrate the state from the server in universal apps, or to restore a + * previously serialized user session. + * If you use `combineReducers` to produce the root reducer function, this must be + * an object with the same shape as `combineReducers` keys. + * + * @param {Function} [enhancer] The store enhancer. You may optionally specify it + * to enhance the store with third-party capabilities such as middleware, + * time travel, persistence, etc. The only store enhancer that ships with Redux + * is `applyMiddleware()`. + * + * @returns {Store} A Redux store that lets you read the state, dispatch actions + * and subscribe to changes. + */ +};function createStore_createStore(reducer, preloadedState, enhancer) { + var _ref2; + + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { + enhancer = preloadedState; + preloadedState = undefined; + } + + if (typeof enhancer !== 'undefined') { + if (typeof enhancer !== 'function') { + throw new Error('Expected the enhancer to be a function.'); + } + + return enhancer(createStore_createStore)(reducer, preloadedState); + } + + if (typeof reducer !== 'function') { + throw new Error('Expected the reducer to be a function.'); + } + + var currentReducer = reducer; + var currentState = preloadedState; + var currentListeners = []; + var nextListeners = currentListeners; + var isDispatching = false; + + function ensureCanMutateNextListeners() { + if (nextListeners === currentListeners) { + nextListeners = currentListeners.slice(); + } + } + + /** + * Reads the state tree managed by the store. + * + * @returns {any} The current state tree of your application. + */ + function getState() { + return currentState; + } + + /** + * Adds a change listener. It will be called any time an action is dispatched, + * and some part of the state tree may potentially have changed. You may then + * call `getState()` to read the current state tree inside the callback. + * + * You may call `dispatch()` from a change listener, with the following + * caveats: + * + * 1. The subscriptions are snapshotted just before every `dispatch()` call. + * If you subscribe or unsubscribe while the listeners are being invoked, this + * will not have any effect on the `dispatch()` that is currently in progress. + * However, the next `dispatch()` call, whether nested or not, will use a more + * recent snapshot of the subscription list. + * + * 2. The listener should not expect to see all state changes, as the state + * might have been updated multiple times during a nested `dispatch()` before + * the listener is called. It is, however, guaranteed that all subscribers + * registered before the `dispatch()` started will be called with the latest + * state by the time it exits. + * + * @param {Function} listener A callback to be invoked on every dispatch. + * @returns {Function} A function to remove this change listener. + */ + function subscribe(listener) { + if (typeof listener !== 'function') { + throw new Error('Expected listener to be a function.'); + } + + var isSubscribed = true; + + ensureCanMutateNextListeners(); + nextListeners.push(listener); + + return function unsubscribe() { + if (!isSubscribed) { + return; + } + + isSubscribed = false; + + ensureCanMutateNextListeners(); + var index = nextListeners.indexOf(listener); + nextListeners.splice(index, 1); + }; + } + + /** + * Dispatches an action. It is the only way to trigger a state change. + * + * The `reducer` function, used to create the store, will be called with the + * current state tree and the given `action`. Its return value will + * be considered the **next** state of the tree, and the change listeners + * will be notified. + * + * The base implementation only supports plain object actions. If you want to + * dispatch a Promise, an Observable, a thunk, or something else, you need to + * wrap your store creating function into the corresponding middleware. For + * example, see the documentation for the `redux-thunk` package. Even the + * middleware will eventually dispatch plain object actions using this method. + * + * @param {Object} action A plain object representing “what changed”. It is + * a good idea to keep actions serializable so you can record and replay user + * sessions, or use the time travelling `redux-devtools`. An action must have + * a `type` property which may not be `undefined`. It is a good idea to use + * string constants for action types. + * + * @returns {Object} For convenience, the same action object you dispatched. + * + * Note that, if you use a custom middleware, it may wrap `dispatch()` to + * return something else (for example, a Promise you can await). + */ + function dispatch(action) { + if (!lodash_es_isPlainObject(action)) { + throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); + } + + if (typeof action.type === 'undefined') { + throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); + } + + if (isDispatching) { + throw new Error('Reducers may not dispatch actions.'); + } + + try { + isDispatching = true; + currentState = currentReducer(currentState, action); + } finally { + isDispatching = false; + } + + var listeners = currentListeners = nextListeners; + for (var i = 0; i < listeners.length; i++) { + var listener = listeners[i]; + listener(); + } + + return action; + } + + /** + * Replaces the reducer currently used by the store to calculate the state. + * + * You might need this if your app implements code splitting and you want to + * load some of the reducers dynamically. You might also need this if you + * implement a hot reloading mechanism for Redux. + * + * @param {Function} nextReducer The reducer for the store to use instead. + * @returns {void} + */ + function replaceReducer(nextReducer) { + if (typeof nextReducer !== 'function') { + throw new Error('Expected the nextReducer to be a function.'); + } + + currentReducer = nextReducer; + dispatch({ type: ActionTypes.INIT }); + } + + /** + * Interoperability point for observable/reactive libraries. + * @returns {observable} A minimal observable of state changes. + * For more information, see the observable proposal: + * https://github.com/tc39/proposal-observable + */ + function observable() { + var _ref; + + var outerSubscribe = subscribe; + return _ref = { + /** + * The minimal observable subscription method. + * @param {Object} observer Any object that can be used as an observer. + * The observer object should have a `next` method. + * @returns {subscription} An object with an `unsubscribe` method that can + * be used to unsubscribe the observable from the store, and prevent further + * emission of values from the observable. + */ + subscribe: function subscribe(observer) { + if (typeof observer !== 'object') { + throw new TypeError('Expected the observer to be an object.'); + } + + function observeState() { + if (observer.next) { + observer.next(getState()); + } + } + + observeState(); + var unsubscribe = outerSubscribe(observeState); + return { unsubscribe: unsubscribe }; + } + }, _ref[symbol_observable_default.a] = function () { + return this; + }, _ref; + } + + // When a store is created, an "INIT" action is dispatched so that every + // reducer returns their initial state. This effectively populates + // the initial state tree. + dispatch({ type: ActionTypes.INIT }); + + return _ref2 = { + dispatch: dispatch, + subscribe: subscribe, + getState: getState, + replaceReducer: replaceReducer + }, _ref2[symbol_observable_default.a] = observable, _ref2; +} +// CONCATENATED MODULE: ./node_modules/redux/es/utils/warning.js +/** + * Prints a warning in the console if it exists. + * + * @param {String} message The warning message. + * @returns {void} + */ +function warning_warning(message) { + /* eslint-disable no-console */ + if (typeof console !== 'undefined' && typeof console.error === 'function') { + console.error(message); + } + /* eslint-enable no-console */ + try { + // This error was thrown as a convenience so that if you enable + // "break on all exceptions" in your console, + // it would pause the execution at this line. + throw new Error(message); + /* eslint-disable no-empty */ + } catch (e) {} + /* eslint-enable no-empty */ +} +// CONCATENATED MODULE: ./node_modules/redux/es/combineReducers.js + + + + +function getUndefinedStateErrorMessage(key, action) { + var actionType = action && action.type; + var actionName = actionType && '"' + actionType.toString() + '"' || 'an action'; + + return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.'; +} + +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { + var reducerKeys = Object.keys(reducers); + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; + + if (reducerKeys.length === 0) { + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; + } + + if (!lodash_es_isPlainObject(inputState)) { + return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); + } + + var unexpectedKeys = Object.keys(inputState).filter(function (key) { + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; + }); + + unexpectedKeys.forEach(function (key) { + unexpectedKeyCache[key] = true; + }); + + if (unexpectedKeys.length > 0) { + return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); + } +} + +function assertReducerShape(reducers) { + Object.keys(reducers).forEach(function (key) { + var reducer = reducers[key]; + var initialState = reducer(undefined, { type: ActionTypes.INIT }); + + if (typeof initialState === 'undefined') { + throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.'); + } + + var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.'); + if (typeof reducer(undefined, { type: type }) === 'undefined') { + throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.'); + } + }); +} + +/** + * Turns an object whose values are different reducer functions, into a single + * reducer function. It will call every child reducer, and gather their results + * into a single state object, whose keys correspond to the keys of the passed + * reducer functions. + * + * @param {Object} reducers An object whose values correspond to different + * reducer functions that need to be combined into one. One handy way to obtain + * it is to use ES6 `import * as reducers` syntax. The reducers may never return + * undefined for any action. Instead, they should return their initial state + * if the state passed to them was undefined, and the current state for any + * unrecognized action. + * + * @returns {Function} A reducer function that invokes every reducer inside the + * passed object, and builds a state object with the same shape. + */ +function combineReducers(reducers) { + var reducerKeys = Object.keys(reducers); + var finalReducers = {}; + for (var i = 0; i < reducerKeys.length; i++) { + var key = reducerKeys[i]; + + if (false) { + if (typeof reducers[key] === 'undefined') { + warning('No reducer provided for key "' + key + '"'); + } + } + + if (typeof reducers[key] === 'function') { + finalReducers[key] = reducers[key]; + } + } + var finalReducerKeys = Object.keys(finalReducers); + + var unexpectedKeyCache = void 0; + if (false) { + unexpectedKeyCache = {}; + } + + var shapeAssertionError = void 0; + try { + assertReducerShape(finalReducers); + } catch (e) { + shapeAssertionError = e; + } + + return function combination() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; + + if (shapeAssertionError) { + throw shapeAssertionError; + } + + if (false) { + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); + if (warningMessage) { + warning(warningMessage); + } + } + + var hasChanged = false; + var nextState = {}; + for (var _i = 0; _i < finalReducerKeys.length; _i++) { + var _key = finalReducerKeys[_i]; + var reducer = finalReducers[_key]; + var previousStateForKey = state[_key]; + var nextStateForKey = reducer(previousStateForKey, action); + if (typeof nextStateForKey === 'undefined') { + var errorMessage = getUndefinedStateErrorMessage(_key, action); + throw new Error(errorMessage); + } + nextState[_key] = nextStateForKey; + hasChanged = hasChanged || nextStateForKey !== previousStateForKey; + } + return hasChanged ? nextState : state; + }; +} +// CONCATENATED MODULE: ./node_modules/redux/es/bindActionCreators.js +function bindActionCreator(actionCreator, dispatch) { + return function () { + return dispatch(actionCreator.apply(undefined, arguments)); + }; +} + +/** + * Turns an object whose values are action creators, into an object with the + * same keys, but with every function wrapped into a `dispatch` call so they + * may be invoked directly. This is just a convenience method, as you can call + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. + * + * For convenience, you can also pass a single function as the first argument, + * and get a function in return. + * + * @param {Function|Object} actionCreators An object whose values are action + * creator functions. One handy way to obtain it is to use ES6 `import * as` + * syntax. You may also pass a single function. + * + * @param {Function} dispatch The `dispatch` function available on your Redux + * store. + * + * @returns {Function|Object} The object mimicking the original object, but with + * every action creator wrapped into the `dispatch` call. If you passed a + * function as `actionCreators`, the return value will also be a single + * function. + */ +function bindActionCreators(actionCreators, dispatch) { + if (typeof actionCreators === 'function') { + return bindActionCreator(actionCreators, dispatch); + } + + if (typeof actionCreators !== 'object' || actionCreators === null) { + throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); + } + + var keys = Object.keys(actionCreators); + var boundActionCreators = {}; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var actionCreator = actionCreators[key]; + if (typeof actionCreator === 'function') { + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); + } + } + return boundActionCreators; +} +// CONCATENATED MODULE: ./node_modules/redux/es/compose.js +/** + * Composes single-argument functions from right to left. The rightmost + * function can take multiple arguments as it provides the signature for + * the resulting composite function. + * + * @param {...Function} funcs The functions to compose. + * @returns {Function} A function obtained by composing the argument functions + * from right to left. For example, compose(f, g, h) is identical to doing + * (...args) => f(g(h(...args))). + */ + +function compose() { + for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { + funcs[_key] = arguments[_key]; + } + + if (funcs.length === 0) { + return function (arg) { + return arg; + }; + } + + if (funcs.length === 1) { + return funcs[0]; + } + + return funcs.reduce(function (a, b) { + return function () { + return a(b.apply(undefined, arguments)); + }; + }); +} +// CONCATENATED MODULE: ./node_modules/redux/es/applyMiddleware.js +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + + +/** + * Creates a store enhancer that applies middleware to the dispatch method + * of the Redux store. This is handy for a variety of tasks, such as expressing + * asynchronous actions in a concise manner, or logging every action payload. + * + * See `redux-thunk` package as an example of the Redux middleware. + * + * Because middleware is potentially asynchronous, this should be the first + * store enhancer in the composition chain. + * + * Note that each middleware will be given the `dispatch` and `getState` functions + * as named arguments. + * + * @param {...Function} middlewares The middleware chain to be applied. + * @returns {Function} A store enhancer applying the middleware. + */ +function applyMiddleware() { + for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) { + middlewares[_key] = arguments[_key]; + } + + return function (createStore) { + return function (reducer, preloadedState, enhancer) { + var store = createStore(reducer, preloadedState, enhancer); + var _dispatch = store.dispatch; + var chain = []; + + var middlewareAPI = { + getState: store.getState, + dispatch: function dispatch(action) { + return _dispatch(action); + } + }; + chain = middlewares.map(function (middleware) { + return middleware(middlewareAPI); + }); + _dispatch = compose.apply(undefined, chain)(store.dispatch); + + return _extends({}, store, { + dispatch: _dispatch + }); + }; + }; +} +// CONCATENATED MODULE: ./node_modules/redux/es/index.js + + + + + + + +/* +* This is a dummy function to check if the function name has been altered by minification. +* If the function has been minified and NODE_ENV !== 'production', warn the user. +*/ +function isCrushed() {} + +if (false) { + warning('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); +} + + +// CONCATENATED MODULE: ./src/scripts/src/reducers/items.js +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +var defaultState = []; + +function items_items() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState; + var action = arguments[1]; + + switch (action.type) { + case 'ADD_ITEM': + { + // Add object to items array + var newState = [].concat(_toConsumableArray(state), [{ + id: action.id, + choiceId: action.choiceId, + groupId: action.groupId, + value: action.value, + label: action.label, + active: true, + highlighted: false, + customProperties: action.customProperties, + placeholder: action.placeholder || false, + keyCode: null + }]); + + return newState.map(function (obj) { + var item = obj; + if (item.highlighted) { + item.highlighted = false; + } + return item; + }); + } + + case 'REMOVE_ITEM': + { + // Set item to inactive + return state.map(function (obj) { + var item = obj; + if (item.id === action.id) { + item.active = false; + } + return item; + }); + } + + case 'HIGHLIGHT_ITEM': + { + return state.map(function (obj) { + var item = obj; + if (item.id === action.id) { + item.highlighted = action.highlighted; + } + return item; + }); + } + + default: + { + return state; + } + } +} +// CONCATENATED MODULE: ./src/scripts/src/reducers/groups.js +function groups__toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +var groups_defaultState = []; + +function groups() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : groups_defaultState; + var action = arguments[1]; + + switch (action.type) { + case 'ADD_GROUP': + { + return [].concat(groups__toConsumableArray(state), [{ + id: action.id, + value: action.value, + active: action.active, + disabled: action.disabled + }]); + } + + case 'CLEAR_CHOICES': + { + return []; + } + + default: + { + return state; + } + } +} +// CONCATENATED MODULE: ./src/scripts/src/reducers/choices.js +function choices__toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +var choices_defaultState = []; + +function choices_choices() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : choices_defaultState; + var action = arguments[1]; + + switch (action.type) { + case 'ADD_CHOICE': + { + /* + A disabled choice appears in the choice dropdown but cannot be selected + A selected choice has been added to the passed input's value (added as an item) + An active choice appears within the choice dropdown + */ + return [].concat(choices__toConsumableArray(state), [{ + id: action.id, + elementId: action.elementId, + groupId: action.groupId, + value: action.value, + label: action.label || action.value, + disabled: action.disabled || false, + selected: false, + active: true, + score: 9999, + customProperties: action.customProperties, + placeholder: action.placeholder || false, + keyCode: null + }]); + } + + case 'ADD_ITEM': + { + // If all choices need to be activated + if (action.activateOptions) { + return state.map(function (obj) { + var choice = obj; + choice.active = action.active; + return choice; + }); + } + + // When an item is added and it has an associated choice, + // we want to disable it so it can't be chosen again + if (action.choiceId > -1) { + return state.map(function (obj) { + var choice = obj; + if (choice.id === parseInt(action.choiceId, 10)) { + choice.selected = true; + } + return choice; + }); + } + + return state; + } + + case 'REMOVE_ITEM': + { + // When an item is removed and it has an associated choice, + // we want to re-enable it so it can be chosen again + if (action.choiceId > -1) { + return state.map(function (obj) { + var choice = obj; + if (choice.id === parseInt(action.choiceId, 10)) { + choice.selected = false; + } + return choice; + }); + } + + return state; + } + + case 'FILTER_CHOICES': + { + return state.map(function (obj) { + var choice = obj; + // Set active state based on whether choice is + // within filtered results + choice.active = action.results.some(function (_ref) { + var item = _ref.item, + score = _ref.score; + + if (item.id === choice.id) { + choice.score = score; + return true; + } + return false; + }); + + return choice; + }); + } + + case 'ACTIVATE_CHOICES': + { + return state.map(function (obj) { + var choice = obj; + choice.active = action.active; + return choice; + }); + } + + case 'CLEAR_CHOICES': + { + return choices_defaultState; + } + + default: + { + return state; + } + } +} +// CONCATENATED MODULE: ./src/scripts/src/reducers/index.js + + + + + +var appReducer = combineReducers({ + items: items_items, + groups: groups, + choices: choices_choices +}); + +var rootReducer = function rootReducer(passedState, action) { + var state = passedState; + // If we are clearing all items, groups and options we reassign + // state and then pass that state to our proper reducer. This isn't + // mutating our actual state + // See: http://stackoverflow.com/a/35641992 + if (action.type === 'CLEAR_ALL') { + state = undefined; + } + + return appReducer(state, action); +}; + +/* harmony default export */ var src_reducers = (rootReducer); +// CONCATENATED MODULE: ./src/scripts/src/store/store.js +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function store__toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + + + +var store_Store = function () { + function Store() { + _classCallCheck(this, Store); + + this.store = createStore_createStore(src_reducers, window.devToolsExtension ? window.devToolsExtension() : undefined); + } + + /** + * Subscribe store to function call (wrapped Redux method) + * @param {Function} onChange Function to trigger when state changes + * @return + */ + + + _createClass(Store, [{ + key: 'subscribe', + value: function subscribe(onChange) { + this.store.subscribe(onChange); + } + + /** + * Dispatch event to store (wrapped Redux method) + * @param {Function} action Action function to trigger + * @return + */ + + }, { + key: 'dispatch', + value: function dispatch(action) { + this.store.dispatch(action); + } + + /** + * Get store object (wrapping Redux method) + * @return {Object} State + */ + + }, { + key: 'getState', + value: function getState() { + return this.store.getState(); + } + + /** + * Get items from store + * @return {Array} Item objects + */ + + }, { + key: 'getItems', + value: function getItems() { + var state = this.store.getState(); + return state.items; + } + + /** + * Get active items from store + * @return {Array} Item objects + */ + + }, { + key: 'getItemsFilteredByActive', + value: function getItemsFilteredByActive() { + var items = this.getItems(); + var values = items.filter(function (item) { + return item.active === true; + }, []); + + return values; + } + + /** + * Get items from store reduced to just their values + * @return {Array} Item objects + */ + + }, { + key: 'getItemsReducedToValues', + value: function getItemsReducedToValues() { + var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getItems(); + + var values = items.reduce(function (prev, current) { + prev.push(current.value); + return prev; + }, []); + + return values; + } + + /** + * Get choices from store + * @return {Array} Option objects + */ + + }, { + key: 'getChoices', + value: function getChoices() { + var state = this.store.getState(); + return state.choices; + } + + /** + * Get active choices from store + * @return {Array} Option objects + */ + + }, { + key: 'getChoicesFilteredByActive', + value: function getChoicesFilteredByActive() { + var choices = this.getChoices(); + var values = choices.filter(function (choice) { + return choice.active === true; + }); + + return values; + } + + /** + * Get selectable choices from store + * @return {Array} Option objects + */ + + }, { + key: 'getChoicesFilteredBySelectable', + value: function getChoicesFilteredBySelectable() { + var choices = this.getChoices(); + var values = choices.filter(function (choice) { + return choice.disabled !== true; + }); + + return values; + } + + /** + * Get choices that can be searched (excluding placeholders) + * @return {Array} Option objects + */ + + }, { + key: 'getSearchableChoices', + value: function getSearchableChoices() { + var filtered = this.getChoicesFilteredBySelectable(); + return filtered.filter(function (choice) { + return choice.placeholder !== true; + }); + } + + /** + * Get single choice by it's ID + * @return {Object} Found choice + */ + + }, { + key: 'getChoiceById', + value: function getChoiceById(id) { + if (id) { + var choices = this.getChoicesFilteredByActive(); + var foundChoice = choices.find(function (choice) { + return choice.id === parseInt(id, 10); + }); + return foundChoice; + } + return false; + } + + /** + * Get placeholder choice from store + * @return {Object} Found placeholder + */ + + }, { + key: 'getPlaceholderChoice', + value: function getPlaceholderChoice() { + var choices = this.getChoices(); + var placeholderChoice = [].concat(store__toConsumableArray(choices)).reverse().find(function (choice) { + return choice.placeholder === true; + }); + + return placeholderChoice; + } + + /** + * Get groups from store + * @return {Array} Group objects + */ + + }, { + key: 'getGroups', + value: function getGroups() { + var state = this.store.getState(); + return state.groups; + } + + /** + * Get active groups from store + * @return {Array} Group objects + */ + + }, { + key: 'getGroupsFilteredByActive', + value: function getGroupsFilteredByActive() { + var groups = this.getGroups(); + var choices = this.getChoices(); + + var values = groups.filter(function (group) { + var isActive = group.active === true && group.disabled === false; + var hasActiveOptions = choices.some(function (choice) { + return choice.active === true && choice.disabled === false; + }); + return isActive && hasActiveOptions; + }, []); + + return values; + } + + /** + * Get group by group id + * @param {Number} id Group ID + * @return {Object} Group data + */ + + }, { + key: 'getGroupById', + value: function getGroupById(id) { + var groups = this.getGroups(); + var foundGroup = groups.find(function (group) { + return group.id === parseInt(id, 10); + }); + + return foundGroup; + } + }]); + + return Store; +}(); + +/* harmony default export */ var store_store = (store_Store); +// CONCATENATED MODULE: ./src/scripts/src/components/dropdown.js +var dropdown__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function dropdown__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Dropdown = function () { + function Dropdown(instance, element, classNames) { + dropdown__classCallCheck(this, Dropdown); + + this.parentInstance = instance; + this.element = element; + this.classNames = classNames; + this.dimensions = null; + this.position = null; + this.isActive = false; + } + + dropdown__createClass(Dropdown, [{ + key: 'getElement', + value: function getElement() { + return this.element; + } + + /** + * Determine how far the top of our element is from + * the top of the window + * @return {Number} Vertical position + */ + + }, { + key: 'getVerticalPos', + value: function getVerticalPos() { + this.dimensions = this.element.getBoundingClientRect(); + this.position = Math.ceil(this.dimensions.top + window.pageYOffset + this.element.offsetHeight); + return this.position; + } + + /** + * Find element that matches passed selector + * @return {HTMLElement} + */ + + }, { + key: 'getChild', + value: function getChild(selector) { + return this.element.querySelector(selector); + } + + /** + * Show dropdown to user by adding active state class + * @return {Object} Class instance + * @public + */ + + }, { + key: 'show', + value: function show() { + this.element.classList.add(this.classNames.activeState); + this.element.setAttribute('aria-expanded', 'true'); + this.isActive = true; + return this.parentInstance; + } + + /** + * Hide dropdown from user + * @return {Object} Class instance + * @public + */ + + }, { + key: 'hide', + value: function hide() { + this.element.classList.remove(this.classNames.activeState); + this.element.setAttribute('aria-expanded', 'false'); + this.isActive = false; + return this.parentInstance; + } + }]); + + return Dropdown; +}(); + +/* harmony default export */ var components_dropdown = (Dropdown); +// CONCATENATED MODULE: ./src/scripts/src/components/container.js +var container__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function container__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Container = function () { + function Container(instance, element, classNames) { + container__classCallCheck(this, Container); + + this.parentInstance = instance; + this.element = element; + this.classNames = classNames; + this.config = instance.config; + this.isOpen = false; + this.isFlipped = false; + this.isFocussed = false; + this.isDisabled = false; + this.isLoading = false; + this.onFocus = this.onFocus.bind(this); + this.onBlur = this.onBlur.bind(this); + } + + container__createClass(Container, [{ + key: 'getElement', + value: function getElement() { + return this.element; + } + + /** + * Add event listeners + */ + + }, { + key: 'addEventListeners', + value: function addEventListeners() { + this.element.addEventListener('focus', this.onFocus); + this.element.addEventListener('blur', this.onBlur); + } + + /** + * Remove event listeners + */ + + /** */ + + }, { + key: 'removeEventListeners', + value: function removeEventListeners() { + this.element.removeEventListener('focus', this.onFocus); + this.element.removeEventListener('blur', this.onBlur); + } + + /** + * Set focussed state + */ + + }, { + key: 'onFocus', + value: function onFocus() { + this.isFocussed = true; + } + + /** + * Remove blurred state + */ + + }, { + key: 'onBlur', + value: function onBlur() { + this.isFocussed = false; + } + + /** + * Determine whether container should be flipped + * based on passed dropdown position + * @param {Number} dropdownPos + * @returns + */ + + }, { + key: 'shouldFlip', + value: function shouldFlip(dropdownPos) { + if (dropdownPos === undefined) { + return false; + } + + var body = document.body; + var html = document.documentElement; + var winHeight = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); + + // If flip is enabled and the dropdown bottom position is + // greater than the window height flip the dropdown. + var shouldFlip = false; + if (this.config.position === 'auto') { + shouldFlip = dropdownPos >= winHeight; + } else if (this.config.position === 'top') { + shouldFlip = true; + } + + return shouldFlip; + } + + /** + * Set active descendant attribute + * @param {Number} activeDescendant ID of active descendant + */ + + }, { + key: 'setActiveDescendant', + value: function setActiveDescendant(activeDescendantID) { + this.element.setAttribute('aria-activedescendant', activeDescendantID); + } + + /** + * Remove active descendant attribute + */ + + }, { + key: 'removeActiveDescendant', + value: function removeActiveDescendant() { + this.element.removeAttribute('aria-activedescendant'); + } + }, { + key: 'open', + value: function open(dropdownPos) { + this.element.classList.add(this.classNames.openState); + this.element.setAttribute('aria-expanded', 'true'); + this.isOpen = true; + + if (this.shouldFlip(dropdownPos)) { + this.element.classList.add(this.classNames.flippedState); + this.isFlipped = true; + } + } + }, { + key: 'close', + value: function close() { + this.element.classList.remove(this.classNames.openState); + this.element.setAttribute('aria-expanded', 'false'); + this.removeActiveDescendant(); + this.isOpen = false; + + // A dropdown flips if it does not have space within the page + if (this.isFlipped) { + this.element.classList.remove(this.classNames.flippedState); + this.isFlipped = false; + } + } + }, { + key: 'focus', + value: function focus() { + if (!this.isFocussed) { + this.element.focus(); + } + } + }, { + key: 'addFocusState', + value: function addFocusState() { + this.element.classList.add(this.classNames.focusState); + } + }, { + key: 'removeFocusState', + value: function removeFocusState() { + this.element.classList.remove(this.classNames.focusState); + } + + /** + * Remove disabled state + */ + + }, { + key: 'enable', + value: function enable() { + this.element.classList.remove(this.config.classNames.disabledState); + this.element.removeAttribute('aria-disabled'); + if (this.parentInstance.isSelectOneElement) { + this.element.setAttribute('tabindex', '0'); + } + this.isDisabled = false; + } + + /** + * Set disabled state + */ + + }, { + key: 'disable', + value: function disable() { + this.element.classList.add(this.config.classNames.disabledState); + this.element.setAttribute('aria-disabled', 'true'); + if (this.parentInstance.isSelectOneElement) { + this.element.setAttribute('tabindex', '-1'); + } + this.isDisabled = true; + } + }, { + key: 'revert', + value: function revert(originalElement) { + // Move passed element back to original position + this.element.parentNode.insertBefore(originalElement, this.element); + // Remove container + this.element.parentNode.removeChild(this.element); + } + + /** + * Add loading state to element + */ + + }, { + key: 'addLoadingState', + value: function addLoadingState() { + this.element.classList.add(this.classNames.loadingState); + this.element.setAttribute('aria-busy', 'true'); + this.isLoading = true; + } + + /** + * Remove loading state from element + */ + + }, { + key: 'removeLoadingState', + value: function removeLoadingState() { + this.element.classList.remove(this.classNames.loadingState); + this.element.removeAttribute('aria-busy'); + this.isLoading = false; + } + }]); + + return Container; +}(); + +/* harmony default export */ var container = (Container); +// CONCATENATED MODULE: ./src/scripts/src/lib/utils.js var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* eslint-disable */ @@ -703,18 +2313,524 @@ var regexFilter = function regexFilter(value, regex) { var expression = new RegExp(regex.source, 'i'); return expression.test(value); }; +// CONCATENATED MODULE: ./src/scripts/src/components/input.js +var input__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function input__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DEFAULT_CLASSNAMES; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return DEFAULT_CONFIG; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return EVENTS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ACTION_TYPES; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return KEY_CODES; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return SCROLLING_SPEED; }); + + +var input_Input = function () { + function Input(instance, element, classNames) { + input__classCallCheck(this, Input); + + this.parentInstance = instance; + this.element = element; + this.classNames = classNames; + this.isFocussed = this.element === document.activeElement; + this.isDisabled = false; + + // Bind event listeners + this.onPaste = this.onPaste.bind(this); + this.onInput = this.onInput.bind(this); + this.onFocus = this.onFocus.bind(this); + this.onBlur = this.onBlur.bind(this); + } + + input__createClass(Input, [{ + key: 'getElement', + value: function getElement() { + return this.element; + } + }, { + key: 'addEventListeners', + value: function addEventListeners() { + this.element.addEventListener('input', this.onInput); + this.element.addEventListener('paste', this.onPaste); + this.element.addEventListener('focus', this.onFocus); + this.element.addEventListener('blur', this.onBlur); + } + }, { + key: 'removeEventListeners', + value: function removeEventListeners() { + this.element.removeEventListener('input', this.onInput); + this.element.removeEventListener('paste', this.onPaste); + this.element.removeEventListener('focus', this.onFocus); + this.element.removeEventListener('blur', this.onBlur); + } + + /** + * Input event + * @return + * @private + */ + + }, { + key: 'onInput', + value: function onInput() { + if (!this.parentInstance.isSelectOneElement) { + this.setWidth(); + } + } + + /** + * Paste event + * @param {Object} e Event + * @return + * @private + */ + + }, { + key: 'onPaste', + value: function onPaste(e) { + // Disable pasting into the input if option has been set + if (e.target === this.element && !this.parentInstance.config.paste) { + e.preventDefault(); + } + } + + /** + * Set focussed state + */ + + }, { + key: 'onFocus', + value: function onFocus() { + this.isFocussed = true; + } + + /** + * Remove focussed state + */ + + }, { + key: 'onBlur', + value: function onBlur() { + this.isFocussed = false; + } + }, { + key: 'activate', + value: function activate(focusInput) { + // Optionally focus the input if we have a search input + if (focusInput && this.parentInstance.canSearch && document.activeElement !== this.element) { + this.element.focus(); + } + } + }, { + key: 'deactivate', + value: function deactivate(blurInput) { + this.removeActiveDescendant(); + // Optionally blur the input if we have a search input + if (blurInput && this.parentInstance.canSearch && document.activeElement === this.element) { + this.element.blur(); + } + } + }, { + key: 'enable', + value: function enable() { + this.element.removeAttribute('disabled'); + this.isDisabled = false; + } + }, { + key: 'disable', + value: function disable() { + this.element.setAttribute('disabled', ''); + this.isDisabled = true; + } + }, { + key: 'focus', + value: function focus() { + if (!this.isFocussed) { + this.element.focus(); + } + } + + /** + * Set value of input to blank + * @return {Object} Class instance + * @public + */ + + }, { + key: 'clear', + value: function clear() { + var setWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + if (this.element.value) { + this.element.value = ''; + } + + if (setWidth) { + this.setWidth(); + } + + return this.parentInstance; + } + + /** + * Set the correct input width based on placeholder + * value or input value + * @return + */ + + }, { + key: 'setWidth', + value: function setWidth(enforceWidth) { + if (this.parentInstance.placeholder) { + // If there is a placeholder, we only want to set the width of the input when it is a greater + // length than 75% of the placeholder. This stops the input jumping around. + if (this.element.value && this.element.value.length >= this.parentInstance.placeholder.length / 1.25 || enforceWidth) { + this.element.style.width = this.getWidth(); + } + } else { + // If there is no placeholder, resize input to contents + this.element.style.width = this.getWidth(); + } + } + }, { + key: 'getWidth', + value: function getWidth() { + return getWidthOfInput(this.element); + } + }, { + key: 'setPlaceholder', + value: function setPlaceholder(placeholder) { + this.element.placeholder = placeholder; + } + }, { + key: 'setValue', + value: function setValue(value) { + this.element.value = value; + } + }, { + key: 'getValue', + value: function getValue() { + return this.element.value; + } + }, { + key: 'setActiveDescendant', + value: function setActiveDescendant(activeDescendantID) { + this.element.setAttribute('aria-activedescendant', activeDescendantID); + } + }, { + key: 'removeActiveDescendant', + value: function removeActiveDescendant() { + this.element.removeAttribute('aria-activedescendant'); + } + }]); + + return Input; +}(); + +/* harmony default export */ var components_input = (input_Input); +// CONCATENATED MODULE: ./src/scripts/src/components/list.js +var list__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function list__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var List = function () { + function List(instance, element, classNames) { + list__classCallCheck(this, List); + + this.parentInstance = instance; + this.element = element; + this.classNames = classNames; + this.scrollPos = this.element.scrollTop; + this.height = this.element.offsetHeight; + this.hasChildren = !!this.element.children; + } + + list__createClass(List, [{ + key: 'getElement', + value: function getElement() { + return this.element; + } + + /** + * Clear List contents + */ + + }, { + key: 'clear', + value: function clear() { + this.element.innerHTML = ''; + } + + /** + * Scroll to passed position on Y axis + */ + + }, { + key: 'scrollTo', + value: function scrollTo() { + var scrollPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + + this.element.scrollTop = scrollPos; + } + /** + * Append node to element + */ + + }, { + key: 'append', + value: function append(node) { + this.element.appendChild(node); + } + + /** + * Find element that matches passed selector + * @return {HTMLElement} + */ + + }, { + key: 'getChild', + value: function getChild(selector) { + return this.element.querySelector(selector); + } + }]); + + return List; +}(); + +/* harmony default export */ var list = (List); +// CONCATENATED MODULE: ./src/scripts/src/components/wrapped-element.js +var wrapped_element__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function wrapped_element__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + + +var wrapped_element_WrappedElement = function () { + function WrappedElement(instance, element, classNames) { + wrapped_element__classCallCheck(this, WrappedElement); + + this.parentInstance = instance; + this.element = element; + this.classNames = classNames; + this.isDisabled = false; + } + + wrapped_element__createClass(WrappedElement, [{ + key: 'getElement', + value: function getElement() { + return this.element; + } + }, { + key: 'getValue', + value: function getValue() { + return this.element.value; + } + }, { + key: 'conceal', + value: function conceal() { + // Hide passed input + this.element.classList.add(this.classNames.input, this.classNames.hiddenState); + + // Remove element from tab index + this.element.tabIndex = '-1'; + + // Backup original styles if any + var origStyle = this.element.getAttribute('style'); + + if (origStyle) { + this.element.setAttribute('data-choice-orig-style', origStyle); + } + + this.element.setAttribute('style', 'display:none;'); + this.element.setAttribute('aria-hidden', 'true'); + this.element.setAttribute('data-choice', 'active'); + } + }, { + key: 'reveal', + value: function reveal() { + // Reinstate passed element + this.element.classList.remove(this.classNames.input, this.classNames.hiddenState); + this.element.removeAttribute('tabindex'); + + // Recover original styles if any + var origStyle = this.element.getAttribute('data-choice-orig-style'); + + if (origStyle) { + this.element.removeAttribute('data-choice-orig-style'); + this.element.setAttribute('style', origStyle); + } else { + this.element.removeAttribute('style'); + } + this.element.removeAttribute('aria-hidden'); + this.element.removeAttribute('data-choice'); + + // Re-assign values - this is weird, I know + this.element.value = this.element.value; + } + }, { + key: 'enable', + value: function enable() { + this.element.removeAttribute('disabled'); + this.element.disabled = false; + this.isDisabled = false; + } + }, { + key: 'disable', + value: function disable() { + this.element.setAttribute('disabled', ''); + this.element.disabled = true; + this.isDisabled = true; + } + }, { + key: 'triggerEvent', + value: function triggerEvent(eventType, data) { + dispatchEvent(this.element, eventType, data); + } + }]); + + return WrappedElement; +}(); + +/* harmony default export */ var wrapped_element = (wrapped_element_WrappedElement); +// CONCATENATED MODULE: ./src/scripts/src/components/wrapped-input.js +var wrapped_input__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function wrapped_input__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + +var WrappedInput = function (_WrappedElement) { + _inherits(WrappedInput, _WrappedElement); + + function WrappedInput(instance, element, classNames) { + wrapped_input__classCallCheck(this, WrappedInput); + + var _this = _possibleConstructorReturn(this, (WrappedInput.__proto__ || Object.getPrototypeOf(WrappedInput)).call(this, instance, element, classNames)); + + _this.parentInstance = instance; + _this.element = element; + _this.classNames = classNames; + return _this; + } + + wrapped_input__createClass(WrappedInput, [{ + key: 'getElement', + value: function getElement() { + _get(WrappedInput.prototype.__proto__ || Object.getPrototypeOf(WrappedInput.prototype), 'getElement', this).call(this); + } + }, { + key: 'conceal', + value: function conceal() { + _get(WrappedInput.prototype.__proto__ || Object.getPrototypeOf(WrappedInput.prototype), 'conceal', this).call(this); + } + }, { + key: 'reveal', + value: function reveal() { + _get(WrappedInput.prototype.__proto__ || Object.getPrototypeOf(WrappedInput.prototype), 'reveal', this).call(this); + } + }, { + key: 'enable', + value: function enable() { + _get(WrappedInput.prototype.__proto__ || Object.getPrototypeOf(WrappedInput.prototype), 'enable', this).call(this); + } + }, { + key: 'disable', + value: function disable() { + _get(WrappedInput.prototype.__proto__ || Object.getPrototypeOf(WrappedInput.prototype), 'enable', this).call(this); + } + }, { + key: 'setValue', + value: function setValue(value) { + this.element.setAttribute('value', value); + this.element.value = value; + } + }]); + + return WrappedInput; +}(wrapped_element); + +/* harmony default export */ var wrapped_input = (WrappedInput); +// CONCATENATED MODULE: ./src/scripts/src/components/wrapped-select.js +var wrapped_select__createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var wrapped_select__get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function wrapped_select__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function wrapped_select__possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function wrapped_select__inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + +var WrappedSelect = function (_WrappedElement) { + wrapped_select__inherits(WrappedSelect, _WrappedElement); + + function WrappedSelect(instance, element, classNames) { + wrapped_select__classCallCheck(this, WrappedSelect); + + var _this = wrapped_select__possibleConstructorReturn(this, (WrappedSelect.__proto__ || Object.getPrototypeOf(WrappedSelect)).call(this, instance, element, classNames)); + + _this.parentInstance = instance; + _this.element = element; + _this.classNames = classNames; + return _this; + } + + wrapped_select__createClass(WrappedSelect, [{ + key: 'getElement', + value: function getElement() { + wrapped_select__get(WrappedSelect.prototype.__proto__ || Object.getPrototypeOf(WrappedSelect.prototype), 'getElement', this).call(this); + } + }, { + key: 'conceal', + value: function conceal() { + wrapped_select__get(WrappedSelect.prototype.__proto__ || Object.getPrototypeOf(WrappedSelect.prototype), 'conceal', this).call(this); + } + }, { + key: 'reveal', + value: function reveal() { + wrapped_select__get(WrappedSelect.prototype.__proto__ || Object.getPrototypeOf(WrappedSelect.prototype), 'reveal', this).call(this); + } + }, { + key: 'enable', + value: function enable() { + wrapped_select__get(WrappedSelect.prototype.__proto__ || Object.getPrototypeOf(WrappedSelect.prototype), 'enable', this).call(this); + } + }, { + key: 'disable', + value: function disable() { + wrapped_select__get(WrappedSelect.prototype.__proto__ || Object.getPrototypeOf(WrappedSelect.prototype), 'enable', this).call(this); + } + }, { + key: 'setOptions', + value: function setOptions(options) { + this.element.innerHTML = ''; + this.element.appendChild(options); + } + }, { + key: 'getPlaceholderOption', + value: function getPlaceholderOption() { + return this.element.querySelector('option[placeholder]'); + } + }, { + key: 'getOptions', + value: function getOptions() { + return Array.from(this.element.options); + } + }, { + key: 'getOptionGroups', + value: function getOptionGroups() { + return Array.from(this.element.getElementsByTagName('OPTGROUP')); + } + }]); + + return WrappedSelect; +}(wrapped_element); + +/* harmony default export */ var wrapped_select = (WrappedSelect); +// CONCATENATED MODULE: ./src/scripts/src/constants.js var DEFAULT_CLASSNAMES = { containerOuter: 'choices', @@ -826,1018 +2942,208 @@ var KEY_CODES = { }; var SCROLLING_SPEED = 4; +// EXTERNAL MODULE: ./node_modules/classnames/index.js +var classnames = __webpack_require__(9); +var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); -/***/ }), -/* 2 */ -/***/ (function(module, exports) { - -module.exports = function(originalModule) { - if(!originalModule.webpackPolyfill) { - var module = Object.create(originalModule); - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - Object.defineProperty(module, "exports", { - enumerable: true, - }); - module.webpackPolyfill = 1; - } - return module; -}; - - -/***/ }), -/* 3 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: ./node_modules/redux/node_modules/lodash-es/_freeGlobal.js -var _freeGlobal = __webpack_require__(10); - -// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_root.js - - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = _freeGlobal["a" /* default */] || freeSelf || Function('return this')(); - -/* harmony default export */ var _root = (root); - -// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_Symbol.js - - -/** Built-in value references. */ -var Symbol = _root.Symbol; - -/* harmony default export */ var _Symbol = (Symbol); - -// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_getRawTag.js - - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var _getRawTag_hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** Built-in value references. */ -var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined; - -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = _getRawTag_hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; -} - -/* harmony default export */ var _getRawTag = (getRawTag); - -// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_objectToString.js -/** Used for built-in method references. */ -var _objectToString_objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var _objectToString_nativeObjectToString = _objectToString_objectProto.toString; - -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return _objectToString_nativeObjectToString.call(value); -} - -/* harmony default export */ var _objectToString = (objectToString); - -// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_baseGetTag.js - - - - -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; - -/** Built-in value references. */ -var _baseGetTag_symToStringTag = _Symbol ? _Symbol.toStringTag : undefined; - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (_baseGetTag_symToStringTag && _baseGetTag_symToStringTag in Object(value)) - ? _getRawTag(value) - : _objectToString(value); -} - -/* harmony default export */ var _baseGetTag = (baseGetTag); - -// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_overArg.js -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/* harmony default export */ var _overArg = (overArg); - -// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/_getPrototype.js - - -/** Built-in value references. */ -var getPrototype = _overArg(Object.getPrototypeOf, Object); - -/* harmony default export */ var _getPrototype = (getPrototype); - -// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/isObjectLike.js -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} - -/* harmony default export */ var lodash_es_isObjectLike = (isObjectLike); - -// CONCATENATED MODULE: ./node_modules/redux/node_modules/lodash-es/isPlainObject.js - - - - -/** `Object#toString` result references. */ -var objectTag = '[object Object]'; - -/** Used for built-in method references. */ -var funcProto = Function.prototype, - isPlainObject_objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var isPlainObject_hasOwnProperty = isPlainObject_objectProto.hasOwnProperty; - -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); - -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - if (!lodash_es_isObjectLike(value) || _baseGetTag(value) != objectTag) { - return false; - } - var proto = _getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = isPlainObject_hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; -} - -/* harmony default export */ var lodash_es_isPlainObject = (isPlainObject); - -// EXTERNAL MODULE: ./node_modules/redux/node_modules/symbol-observable/index.js -var symbol_observable = __webpack_require__(11); -var symbol_observable_default = /*#__PURE__*/__webpack_require__.n(symbol_observable); - -// CONCATENATED MODULE: ./node_modules/redux/es/createStore.js - - - -/** - * These are private action types reserved by Redux. - * For any unknown actions, you must return the current state. - * If the current state is undefined, you must return the initial state. - * Do not reference these action types directly in your code. - */ -var ActionTypes = { - INIT: '@@redux/INIT' - - /** - * Creates a Redux store that holds the state tree. - * The only way to change the data in the store is to call `dispatch()` on it. - * - * There should only be a single store in your app. To specify how different - * parts of the state tree respond to actions, you may combine several reducers - * into a single reducer function by using `combineReducers`. - * - * @param {Function} reducer A function that returns the next state tree, given - * the current state tree and the action to handle. - * - * @param {any} [preloadedState] The initial state. You may optionally specify it - * to hydrate the state from the server in universal apps, or to restore a - * previously serialized user session. - * If you use `combineReducers` to produce the root reducer function, this must be - * an object with the same shape as `combineReducers` keys. - * - * @param {Function} [enhancer] The store enhancer. You may optionally specify it - * to enhance the store with third-party capabilities such as middleware, - * time travel, persistence, etc. The only store enhancer that ships with Redux - * is `applyMiddleware()`. - * - * @returns {Store} A Redux store that lets you read the state, dispatch actions - * and subscribe to changes. - */ -};function createStore_createStore(reducer, preloadedState, enhancer) { - var _ref2; - - if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { - enhancer = preloadedState; - preloadedState = undefined; - } - - if (typeof enhancer !== 'undefined') { - if (typeof enhancer !== 'function') { - throw new Error('Expected the enhancer to be a function.'); - } - - return enhancer(createStore_createStore)(reducer, preloadedState); - } - - if (typeof reducer !== 'function') { - throw new Error('Expected the reducer to be a function.'); - } - - var currentReducer = reducer; - var currentState = preloadedState; - var currentListeners = []; - var nextListeners = currentListeners; - var isDispatching = false; - - function ensureCanMutateNextListeners() { - if (nextListeners === currentListeners) { - nextListeners = currentListeners.slice(); - } - } - - /** - * Reads the state tree managed by the store. - * - * @returns {any} The current state tree of your application. - */ - function getState() { - return currentState; - } - - /** - * Adds a change listener. It will be called any time an action is dispatched, - * and some part of the state tree may potentially have changed. You may then - * call `getState()` to read the current state tree inside the callback. - * - * You may call `dispatch()` from a change listener, with the following - * caveats: - * - * 1. The subscriptions are snapshotted just before every `dispatch()` call. - * If you subscribe or unsubscribe while the listeners are being invoked, this - * will not have any effect on the `dispatch()` that is currently in progress. - * However, the next `dispatch()` call, whether nested or not, will use a more - * recent snapshot of the subscription list. - * - * 2. The listener should not expect to see all state changes, as the state - * might have been updated multiple times during a nested `dispatch()` before - * the listener is called. It is, however, guaranteed that all subscribers - * registered before the `dispatch()` started will be called with the latest - * state by the time it exits. - * - * @param {Function} listener A callback to be invoked on every dispatch. - * @returns {Function} A function to remove this change listener. - */ - function subscribe(listener) { - if (typeof listener !== 'function') { - throw new Error('Expected listener to be a function.'); - } - - var isSubscribed = true; - - ensureCanMutateNextListeners(); - nextListeners.push(listener); - - return function unsubscribe() { - if (!isSubscribed) { - return; - } - - isSubscribed = false; - - ensureCanMutateNextListeners(); - var index = nextListeners.indexOf(listener); - nextListeners.splice(index, 1); - }; - } - - /** - * Dispatches an action. It is the only way to trigger a state change. - * - * The `reducer` function, used to create the store, will be called with the - * current state tree and the given `action`. Its return value will - * be considered the **next** state of the tree, and the change listeners - * will be notified. - * - * The base implementation only supports plain object actions. If you want to - * dispatch a Promise, an Observable, a thunk, or something else, you need to - * wrap your store creating function into the corresponding middleware. For - * example, see the documentation for the `redux-thunk` package. Even the - * middleware will eventually dispatch plain object actions using this method. - * - * @param {Object} action A plain object representing “what changed”. It is - * a good idea to keep actions serializable so you can record and replay user - * sessions, or use the time travelling `redux-devtools`. An action must have - * a `type` property which may not be `undefined`. It is a good idea to use - * string constants for action types. - * - * @returns {Object} For convenience, the same action object you dispatched. - * - * Note that, if you use a custom middleware, it may wrap `dispatch()` to - * return something else (for example, a Promise you can await). - */ - function dispatch(action) { - if (!lodash_es_isPlainObject(action)) { - throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); - } - - if (typeof action.type === 'undefined') { - throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); - } - - if (isDispatching) { - throw new Error('Reducers may not dispatch actions.'); - } - - try { - isDispatching = true; - currentState = currentReducer(currentState, action); - } finally { - isDispatching = false; - } - - var listeners = currentListeners = nextListeners; - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(); - } - - return action; - } - - /** - * Replaces the reducer currently used by the store to calculate the state. - * - * You might need this if your app implements code splitting and you want to - * load some of the reducers dynamically. You might also need this if you - * implement a hot reloading mechanism for Redux. - * - * @param {Function} nextReducer The reducer for the store to use instead. - * @returns {void} - */ - function replaceReducer(nextReducer) { - if (typeof nextReducer !== 'function') { - throw new Error('Expected the nextReducer to be a function.'); - } - - currentReducer = nextReducer; - dispatch({ type: ActionTypes.INIT }); - } - - /** - * Interoperability point for observable/reactive libraries. - * @returns {observable} A minimal observable of state changes. - * For more information, see the observable proposal: - * https://github.com/tc39/proposal-observable - */ - function observable() { - var _ref; - - var outerSubscribe = subscribe; - return _ref = { - /** - * The minimal observable subscription method. - * @param {Object} observer Any object that can be used as an observer. - * The observer object should have a `next` method. - * @returns {subscription} An object with an `unsubscribe` method that can - * be used to unsubscribe the observable from the store, and prevent further - * emission of values from the observable. - */ - subscribe: function subscribe(observer) { - if (typeof observer !== 'object') { - throw new TypeError('Expected the observer to be an object.'); - } - - function observeState() { - if (observer.next) { - observer.next(getState()); - } - } - - observeState(); - var unsubscribe = outerSubscribe(observeState); - return { unsubscribe: unsubscribe }; - } - }, _ref[symbol_observable_default.a] = function () { - return this; - }, _ref; - } - - // When a store is created, an "INIT" action is dispatched so that every - // reducer returns their initial state. This effectively populates - // the initial state tree. - dispatch({ type: ActionTypes.INIT }); - - return _ref2 = { - dispatch: dispatch, - subscribe: subscribe, - getState: getState, - replaceReducer: replaceReducer - }, _ref2[symbol_observable_default.a] = observable, _ref2; -} -// CONCATENATED MODULE: ./node_modules/redux/es/utils/warning.js -/** - * Prints a warning in the console if it exists. - * - * @param {String} message The warning message. - * @returns {void} - */ -function warning_warning(message) { - /* eslint-disable no-console */ - if (typeof console !== 'undefined' && typeof console.error === 'function') { - console.error(message); - } - /* eslint-enable no-console */ - try { - // This error was thrown as a convenience so that if you enable - // "break on all exceptions" in your console, - // it would pause the execution at this line. - throw new Error(message); - /* eslint-disable no-empty */ - } catch (e) {} - /* eslint-enable no-empty */ -} -// CONCATENATED MODULE: ./node_modules/redux/es/combineReducers.js - - - - -function getUndefinedStateErrorMessage(key, action) { - var actionType = action && action.type; - var actionName = actionType && '"' + actionType.toString() + '"' || 'an action'; - - return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.'; -} - -function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { - var reducerKeys = Object.keys(reducers); - var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; - - if (reducerKeys.length === 0) { - return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; - } - - if (!lodash_es_isPlainObject(inputState)) { - return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); - } - - var unexpectedKeys = Object.keys(inputState).filter(function (key) { - return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; - }); - - unexpectedKeys.forEach(function (key) { - unexpectedKeyCache[key] = true; - }); - - if (unexpectedKeys.length > 0) { - return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); - } -} - -function assertReducerShape(reducers) { - Object.keys(reducers).forEach(function (key) { - var reducer = reducers[key]; - var initialState = reducer(undefined, { type: ActionTypes.INIT }); - - if (typeof initialState === 'undefined') { - throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.'); - } - - var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.'); - if (typeof reducer(undefined, { type: type }) === 'undefined') { - throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.'); - } - }); -} - -/** - * Turns an object whose values are different reducer functions, into a single - * reducer function. It will call every child reducer, and gather their results - * into a single state object, whose keys correspond to the keys of the passed - * reducer functions. - * - * @param {Object} reducers An object whose values correspond to different - * reducer functions that need to be combined into one. One handy way to obtain - * it is to use ES6 `import * as reducers` syntax. The reducers may never return - * undefined for any action. Instead, they should return their initial state - * if the state passed to them was undefined, and the current state for any - * unrecognized action. - * - * @returns {Function} A reducer function that invokes every reducer inside the - * passed object, and builds a state object with the same shape. - */ -function combineReducers(reducers) { - var reducerKeys = Object.keys(reducers); - var finalReducers = {}; - for (var i = 0; i < reducerKeys.length; i++) { - var key = reducerKeys[i]; - - if (false) { - if (typeof reducers[key] === 'undefined') { - warning('No reducer provided for key "' + key + '"'); - } - } - - if (typeof reducers[key] === 'function') { - finalReducers[key] = reducers[key]; - } - } - var finalReducerKeys = Object.keys(finalReducers); - - var unexpectedKeyCache = void 0; - if (false) { - unexpectedKeyCache = {}; - } - - var shapeAssertionError = void 0; - try { - assertReducerShape(finalReducers); - } catch (e) { - shapeAssertionError = e; - } - - return function combination() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var action = arguments[1]; - - if (shapeAssertionError) { - throw shapeAssertionError; - } - - if (false) { - var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); - if (warningMessage) { - warning(warningMessage); - } - } - - var hasChanged = false; - var nextState = {}; - for (var _i = 0; _i < finalReducerKeys.length; _i++) { - var _key = finalReducerKeys[_i]; - var reducer = finalReducers[_key]; - var previousStateForKey = state[_key]; - var nextStateForKey = reducer(previousStateForKey, action); - if (typeof nextStateForKey === 'undefined') { - var errorMessage = getUndefinedStateErrorMessage(_key, action); - throw new Error(errorMessage); - } - nextState[_key] = nextStateForKey; - hasChanged = hasChanged || nextStateForKey !== previousStateForKey; - } - return hasChanged ? nextState : state; - }; -} -// CONCATENATED MODULE: ./node_modules/redux/es/bindActionCreators.js -function bindActionCreator(actionCreator, dispatch) { - return function () { - return dispatch(actionCreator.apply(undefined, arguments)); - }; -} - -/** - * Turns an object whose values are action creators, into an object with the - * same keys, but with every function wrapped into a `dispatch` call so they - * may be invoked directly. This is just a convenience method, as you can call - * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. - * - * For convenience, you can also pass a single function as the first argument, - * and get a function in return. - * - * @param {Function|Object} actionCreators An object whose values are action - * creator functions. One handy way to obtain it is to use ES6 `import * as` - * syntax. You may also pass a single function. - * - * @param {Function} dispatch The `dispatch` function available on your Redux - * store. - * - * @returns {Function|Object} The object mimicking the original object, but with - * every action creator wrapped into the `dispatch` call. If you passed a - * function as `actionCreators`, the return value will also be a single - * function. - */ -function bindActionCreators(actionCreators, dispatch) { - if (typeof actionCreators === 'function') { - return bindActionCreator(actionCreators, dispatch); - } - - if (typeof actionCreators !== 'object' || actionCreators === null) { - throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); - } - - var keys = Object.keys(actionCreators); - var boundActionCreators = {}; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var actionCreator = actionCreators[key]; - if (typeof actionCreator === 'function') { - boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); - } - } - return boundActionCreators; -} -// CONCATENATED MODULE: ./node_modules/redux/es/compose.js -/** - * Composes single-argument functions from right to left. The rightmost - * function can take multiple arguments as it provides the signature for - * the resulting composite function. - * - * @param {...Function} funcs The functions to compose. - * @returns {Function} A function obtained by composing the argument functions - * from right to left. For example, compose(f, g, h) is identical to doing - * (...args) => f(g(h(...args))). - */ - -function compose() { - for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { - funcs[_key] = arguments[_key]; - } - - if (funcs.length === 0) { - return function (arg) { - return arg; - }; - } - - if (funcs.length === 1) { - return funcs[0]; - } - - return funcs.reduce(function (a, b) { - return function () { - return a(b.apply(undefined, arguments)); - }; - }); -} -// CONCATENATED MODULE: ./node_modules/redux/es/applyMiddleware.js -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - - -/** - * Creates a store enhancer that applies middleware to the dispatch method - * of the Redux store. This is handy for a variety of tasks, such as expressing - * asynchronous actions in a concise manner, or logging every action payload. - * - * See `redux-thunk` package as an example of the Redux middleware. - * - * Because middleware is potentially asynchronous, this should be the first - * store enhancer in the composition chain. - * - * Note that each middleware will be given the `dispatch` and `getState` functions - * as named arguments. - * - * @param {...Function} middlewares The middleware chain to be applied. - * @returns {Function} A store enhancer applying the middleware. - */ -function applyMiddleware() { - for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) { - middlewares[_key] = arguments[_key]; - } - - return function (createStore) { - return function (reducer, preloadedState, enhancer) { - var store = createStore(reducer, preloadedState, enhancer); - var _dispatch = store.dispatch; - var chain = []; - - var middlewareAPI = { - getState: store.getState, - dispatch: function dispatch(action) { - return _dispatch(action); - } - }; - chain = middlewares.map(function (middleware) { - return middleware(middlewareAPI); - }); - _dispatch = compose.apply(undefined, chain)(store.dispatch); - - return _extends({}, store, { - dispatch: _dispatch - }); - }; - }; -} -// CONCATENATED MODULE: ./node_modules/redux/es/index.js -/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "b", function() { return createStore_createStore; }); -/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, "a", function() { return combineReducers; }); -/* unused concated harmony import bindActionCreators */ -/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, false, function() { return bindActionCreators; }); -/* unused concated harmony import applyMiddleware */ -/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, false, function() { return applyMiddleware; }); -/* unused concated harmony import compose */ -/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, false, function() { return compose; }); - - - - - - - -/* -* This is a dummy function to check if the function name has been altered by minification. -* If the function has been minified and NODE_ENV !== 'production', warn the user. -*/ -function isCrushed() {} - -if (false) { - warning('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); -} - - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), -/* 5 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lib_utils__ = __webpack_require__(0); -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - - -var WrappedElement = function () { - function WrappedElement(instance, element, classNames) { - _classCallCheck(this, WrappedElement); - - this.parentInstance = instance; - this.element = element; - this.classNames = classNames; - this.isDisabled = false; - } - - _createClass(WrappedElement, [{ - key: 'getElement', - value: function getElement() { - return this.element; - } - }, { - key: 'getValue', - value: function getValue() { - return this.element.value; - } - }, { - key: 'conceal', - value: function conceal() { - // Hide passed input - this.element.classList.add(this.classNames.input, this.classNames.hiddenState); - - // Remove element from tab index - this.element.tabIndex = '-1'; - - // Backup original styles if any - var origStyle = this.element.getAttribute('style'); - - if (origStyle) { - this.element.setAttribute('data-choice-orig-style', origStyle); - } - - this.element.setAttribute('style', 'display:none;'); - this.element.setAttribute('aria-hidden', 'true'); - this.element.setAttribute('data-choice', 'active'); - } - }, { - key: 'reveal', - value: function reveal() { - // Reinstate passed element - this.element.classList.remove(this.classNames.input, this.classNames.hiddenState); - this.element.removeAttribute('tabindex'); - - // Recover original styles if any - var origStyle = this.element.getAttribute('data-choice-orig-style'); - - if (origStyle) { - this.element.removeAttribute('data-choice-orig-style'); - this.element.setAttribute('style', origStyle); - } else { - this.element.removeAttribute('style'); - } - this.element.removeAttribute('aria-hidden'); - this.element.removeAttribute('data-choice'); - - // Re-assign values - this is weird, I know - this.element.value = this.element.value; - } - }, { - key: 'enable', - value: function enable() { - this.element.removeAttribute('disabled'); - this.element.disabled = false; - this.isDisabled = false; - } - }, { - key: 'disable', - value: function disable() { - this.element.setAttribute('disabled', ''); - this.element.disabled = true; - this.isDisabled = true; - } - }, { - key: 'triggerEvent', - value: function triggerEvent(eventType, data) { - Object(__WEBPACK_IMPORTED_MODULE_0__lib_utils__["a" /* dispatchEvent */])(this.element, eventType, data); - } - }]); - - return WrappedElement; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (WrappedElement); - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(7); - - -/***/ }), -/* 7 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_fuse_js__ = __webpack_require__(8); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_fuse_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_fuse_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__store_store__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_dropdown__ = __webpack_require__(16); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_container__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_input__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__components_list__ = __webpack_require__(19); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__components_wrapped_input__ = __webpack_require__(20); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__components_wrapped_select__ = __webpack_require__(21); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__constants__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__templates__ = __webpack_require__(22); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__actions_choices__ = __webpack_require__(24); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__actions_items__ = __webpack_require__(25); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__actions_groups__ = __webpack_require__(26); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__actions_misc__ = __webpack_require__(27); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__lib_utils__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__lib_polyfills__ = __webpack_require__(28); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__lib_polyfills___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_15__lib_polyfills__); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - +// CONCATENATED MODULE: ./src/scripts/src/templates.js function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + +var TEMPLATES = { + containerOuter: function containerOuter(globalClasses, direction, isSelectElement, isSelectOneElement, searchEnabled, passedElementType) { + var tabIndex = isSelectOneElement ? 'tabindex="0"' : ''; + var role = isSelectElement ? 'role="listbox"' : ''; + var ariaAutoComplete = ''; + + if (isSelectElement && searchEnabled) { + role = 'role="combobox"'; + ariaAutoComplete = 'aria-autocomplete="list"'; + } + + return strToEl('\n