{"version":3,"sources":["webpack:///webpack/bootstrap 8415b3f4e7fb1256b4c4","webpack:///./src/main.js","webpack:///./src/ionic-modal-select.js","webpack:///./src/modal-template-multiple.html","webpack:///./src/modal-template.html"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA;;AAAA,wB;;;;;;ACAA;;;;AAEA,KAAI,UAAU,OAAO,WAAW,cAAc,OAAO,OAAO,aAAa,WAAW,UAAU,KAAK,EAAE,OAAO,OAAO,SAAS,UAAU,KAAK,EAAE,OAAO,OAAO,OAAO,WAAW,cAAc,IAAI,gBAAgB,SAAS,WAAW,OAAO;;;;;;;;;;;;;;;AAW1O,SAAQ,OAAO,sBAAsB,IACpC,UAAU,WAAW,SACrB,UAAU,eAAe;;AAG1B,UAAS,QAAQ,UAAU;EAC1B,OAAO,UAAS,OAAO,UAAU,QAAQ;GACxC,IAAI,IAAI,MAAM,OACb,UAAS,OAAO;;IAEf,OAAO,MAAM,MAAM,OAAO;MAE3B,UAAS,OAAO;;;IAGf,SAAS,KAAK;;;;;;IAMd,SAAS,SAAS,YAAY;;;IAG9B,IAAI,OAAO,gBAAgB,QAAQ;KAClC;;;;;;AAQL,UAAS,YAAY,aAAa,UAAU,SAAS,QAAQ,gBAAiB;;EAE5E,IAAM,wBAAwB,oBAAQ;EACtC,IAAM,gBAAgB,oBAAQ;;EAE9B,OAAO;GACN,UAAU;GACV,SAAU;GACV,OAAO;IACN,gBAAe;IACf,cAAa;IACb,eAAe;IACf,kBAAiB;IACjB,UAAU;IACV,UAAU;IACV,SAAS;IACT,SAAS;;GAEV,MAAM,cAAU,OAAO,UAAU,QAAQ,mBAAmB,YAAY;;IAEvE,IAAI,YAAY;IAChB,IAAI,iBAAiB,OAAO,iBAAiB,SAA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":"ionic-modal-select.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 8415b3f4e7fb1256b4c4\n **/","import \"./ionic-modal-select.js\";\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/main.js\n **/","/*!\n * Copyright 2015 Inmagik SRL.\n * http://www.inmagik.com/\n *\n * ionic-modal-select, v1.3.2\n * Modal select directive for Ionic framework.\n *\n * By @bianchimro\n *\n * Licensed under the MIT license. Please see LICENSE for more information.\n *\n */\n\nangular.module('ionic-modal-select', [])\n.directive('compile', compile)\n.directive('modalSelect', modalSelect);\n\n\nfunction compile($compile) {\n\treturn function(scope, iElement, iAttrs) {\n\t\tvar x = scope.$watch(\n\t\t\tfunction(scope) {\n\t\t\t\t// watch the 'compile' expression for changes\n\t\t\t\treturn scope.$eval(iAttrs.compile);\n\t\t\t},\n\t\t\tfunction(value) {\n\t\t\t\t// when the 'compile' expression changes\n\t\t\t\t// assign it into the current DOM\n\t\t\t\tiElement.html(value);\n\n\t\t\t\t// compile the new DOM and link it to the current\n\t\t\t\t// scope.\n\t\t\t\t// NOTE: we only compile .childNodes so that\n\t\t\t\t// we don't get into infinite loop compiling ourselves\n\t\t\t\t$compile(iElement.contents())(scope);\n\n\t\t\t\t//deactivate watch if \"compile-once\" is set to \"true\"\n\t\t\t\tif (iAttrs.compileOnce === 'true') {\n\t\t\t\t\tx();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t};\n}\n\n\nfunction modalSelect($ionicModal, $timeout, $filter, $parse, $templateCache ) {\n\n\t\tconst modalTemplateMultiple = require('raw!./modal-template-multiple.html');\n\t\tconst modalTemplate = require('raw!./modal-template.html');\n\n\t\treturn {\n\t\t\trestrict: 'A',\n\t\t\trequire : 'ngModel',\n\t\t\tscope: {\n\t\t\t\tinitialOptions:\"=options\",\n\t\t\t\toptionGetter:\"&\",\n\t\t\t\tsearchFilters: \"=searchFilters\",\n\t\t\t\tsearchProperties:'=',\n\t\t\t\tonSelect: \"&\",\n\t\t\t\tonSearch: \"&\",\n\t\t\t\tonReset: \"&\",\n\t\t\t\tonClose: \"&\",\n\t\t\t},\n\t\t\tlink: function (scope, iElement, iAttrs, ngModelController, transclude) {\n\n\t\t\t\tvar shortList = true;\n\t\t\t\tvar shortListBreak = iAttrs.shortListBreak ? parseInt(iAttrs.shortListBreak) : 10;\n\t\t\t\tvar setFromProperty= iAttrs.optionProperty;\n\t\t\t\tvar onOptionSelect = iAttrs.optionGetter;\n\t\t\t\tvar clearSearchOnSelect = iAttrs.clearSearchOnSelect !== \"false\" ? true : false;\n\t\t\t\tvar searchProperties = scope.searchProperties ? scope.searchProperties : false;\n\n\t\t\t\t//multiple values settings.\n\t\t\t\tvar multiple = iAttrs.multiple ? true : false;\n\t\t\t\tif (multiple) {\n\t\t\t\t\t\tscope.isChecked = {};\n\t\t\t\t}\n\t\t\t\tvar multipleNullValue = iAttrs.multipleNullValue ? scope.$eval(iAttrs.multipleNullValue) : [];\n\n\t\t\t\tscope.ui = {\n\t\t\t\t\tmodalTitle : iAttrs.modalTitle || 'Select an option',\n\t\t\t\t\tokButton : iAttrs.okButton || 'OK',\n\t\t\t\t\thideReset : iAttrs.hideReset !== \"true\" ? false : true,\n\t\t\t\t\tresetButton : iAttrs.resetButton || 'Reset',\n\t\t\t\t\tcancelButton : iAttrs.cancelButton || 'Cancel',\n\t\t\t\t\tloadListMessage : iAttrs.loadListMessage || 'Loading',\n\t\t\t\t\tmodalClass : iAttrs.modalClass || '',\n\t\t\t\t\theaderFooterClass : iAttrs.headerFooterClass || 'bar-stable',\n\t\t\t\t\tvalue : null,\n\t\t\t\t\tselectedClass : iAttrs.selectedClass || 'option-selected',\n\t\t\t\t\titemClass: iAttrs.itemClass || 'item item-text-wrap',\n\t\t\t\t\tsearchTemplate: iAttrs.searchTemplate || (multiple ? modalTemplateMultiple : modalTemplate),\n\n\t\t\t\t\t//search stuff\n\t\t\t\t\thasSearch : iAttrs.hasSearch !== \"true\" ? false : true,\n\t\t\t\t\tsearchValue : '',\n\t\t\t\t\tsearchPlaceholder : iAttrs.searchPlaceholder || 'Search',\n\t\t\t\t\tsubHeaderClass : iAttrs.subHeaderClass || 'bar-stable',\n\t\t\t\t\tcancelSearchButton : iAttrs.cancelSearchButton || 'Clear'\n\n\t\t\t\t};\n\n\t\t\t\tvar allOptions = [];\n\t\t\t\tscope.options = [];\n\n\t\t\t\tif (iAttrs.optionsExpression) {\n\t\t\t\t\t\tvar optionsExpression = iAttrs.optionsExpression;\n\t\t\t\t\t\tvar match = optionsExpression.match(/^\\s*([\\s\\S]+?)\\s+in\\s+([\\s\\S]+?)(?:\\s+track\\s+by\\s+([\\s\\S]+?))?\\s*$/);\n\t\t\t\t\t\tif (!match) {\n\t\t\t\t\t\t\t\tthrow new Error(\"collection-repeat expected expression in form of '_item_ in \" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"_collection_[ track by _id_]' but got '\" + iAttrs.optionsExpression + \"'.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//var keyExpr = match[1];\n\t\t\t\t\t\tvar listExpr = match[2];\n\t\t\t\t\t\tvar listGetter = $parse(listExpr);\n\t\t\t\t\t\tvar s = iElement.scope();\n\n\t\t\t\t\t\tscope.$watch(\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\treturn listGetter(s);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t(nv, ov) => {\n\t\t\t\t\t\t\t\t\t\tinitialOptionsSetup(nv);\n\t\t\t\t\t\t\t\t\t\tupdateListMode();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t);\n\n\t\t\t\t} else {\n\t\t\t\t\t\tscope.$watchCollection('initialOptions', function(nv){\n\t\t\t\t\t\t\t\tinitialOptionsSetup(nv);\n\t\t\t\t\t\t\t\tupdateListMode();\n\t\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t//#TODO: this is due to different single vs multiple template\n\t\t\t\t//but adds lots of complexity here and in search\n\t\t\t\tfunction initialOptionsSetup(nv){\n\t\t\t\t\t\tnv = nv || [];\n\t\t\t\t\t\tif ( !multiple ) {\n\t\t\t\t\t\t\t\tallOptions = angular.copy(nv);\n\t\t\t\t\t\t\t\tscope.options = angular.copy(nv);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tallOptions = nv.map((item, idx) => [idx, angular.copy(item)] );\n\t\t\t\t\t\t\t\tscope.options = angular.copy(allOptions);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// getting options template\n\t\t\t\tvar opt = iElement[0].querySelector('.option');\n\t\t\t\tif (!opt) {\n\t\t\t\t\tthrow new Error({\n\t\t\t\t\t\tname:'modalSelectError:noOptionTemplate',\n\t\t\t\t\t\tmessage:`When using modalSelect directive you must include an element with class \"option\"\n\t\t\t\t\t\t to provide a template for your select options.`,\n\t\t\t\t\t\ttoString:function(){\n\t\t\t\t\t\t\treturn this.name + \" \" + this.message;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tscope.inner = angular.element(opt).html();\n\n\t\t\t\t//add support for .remove for older devices\n\t\t\t\tif (!('remove' in Element.prototype)) {\n\t\t\t\t\tElement.prototype.remove = function() {\n\t\t\t\t\t\tthis.parentNode.removeChild(this);\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tangular.element(opt).remove();\n\n\t\t\t\tvar notFound = iElement[0].querySelector('.not-found');\n\t\t\t\tif(notFound) {\n\t\t\t\t\tscope.notFound = angular.element(notFound).html();\n\t\t\t\t\tangular.element(notFound).remove();\n\t\t\t\t}\n\n\t\t\t\tfunction updateListMode(){\n\t\t\t\t\t//shortList controls wether using ng-repeat instead of collection-repeat\n\t\t\t\t\tif (iAttrs.useCollectionRepeat === \"true\") {\n\t\t\t\t\t\tshortList = false;\n\t\t\t\t\t} else if (iAttrs.useCollectionRepeat === \"false\") {\n\t\t\t\t\t\tshortList = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (typeof(scope.options) !==\"undefined\"){\n\t\t\t\t\t\t\tshortList = !!(scope.options.length < shortListBreak);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.ui.shortList = shortList;\n\t\t\t\t}\n\n\t\t\t\tngModelController.$render = function(){\n\t\t\t\t\tscope.ui.value = ngModelController.$viewValue;\n\t\t\t\t};\n\n\t\t\t\tvar getSelectedValue = scope.getSelectedValue = function(option){\n\t\t\t\t\tvar val = null;\n\t\t\t\t\tif (option === null || option === undefined) {\n\t\t\t\t\t\treturn option;\n\t\t\t\t\t}\n\t\t\t\t\tif (onOptionSelect) {\n\t\t\t\t\t\treturn scope.optionGetter({option:option});\n\t\t\t\t\t}\n\t\t\t\t\tif (setFromProperty) {\n\t\t\t\t\t\tval = option[setFromProperty];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tval = option;\n\t\t\t\t\t}\n\t\t\t\t\treturn val;\n\t\t\t\t};\n\n\t\t\t\tscope.setOption = function(option){\n\t\t\t\t\tvar oldValue = ngModelController.$viewValue;\n\t\t\t\t\tvar val = getSelectedValue(option);\n\t\t\t\t\tngModelController.$setViewValue(val);\n\t\t\t\t\tngModelController.$render();\n\n\t\t\t\t\tif (scope.onSelect) {\n\t\t\t\t\t\tscope.onSelect({ newValue: val, oldValue: oldValue });\n\t\t\t\t\t}\n\t\t\t\t\tscope.modal.hide().then(function(){\n\t\t\t\t\t\tscope.showList = false;\n\t\t\t\t\t\tif (scope.ui.hasSearch) {\n\t\t\t\t\t\t\tif(clearSearchOnSelect) {\n\t\t\t\t\t\t\t\tscope.ui.searchValue = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\t// Filter object {id: , active: }\n\t\t\t\t// Used as auxiliary query params when querying server for search results\n\t\t\t\tscope.setFilter = function(filterId) {\n\t\t\t\t\tangular.forEach(scope.searchFilters, function(filter) {\n\t\t\t\t\t\tif(filter.id == filterId) {\n\t\t\t\t\t\t\tfilter.active = !filter.active;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfilter.active = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// Trigger another search when the search filters change\n\t\t\t\t\tif(scope.onSearch) {\n\t\t\t\t\t\tscope.onSearch({query: scope.ui.searchValue});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tscope.unsetValue = function(){\n\t\t\t\t\t$timeout(function(){\n\t\t\t\t\t\tngModelController.$setViewValue(\"\");\n\t\t\t\t\t\tngModelController.$render();\n\t\t\t\t\t\tscope.modal.hide();\n\t\t\t\t\t\tscope.showList = false;\n\t\t\t\t\t\tif (scope.onReset && angular.isFunction(scope.onReset)) {\n\t\t\t\t\t\t\tscope.onReset();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\tscope.setValues = function(){\n\t\t\t\t\t\tvar checkedItems = [];\n\t\t\t\t\t\tangular.forEach(scope.isChecked, function(v, k){\n\t\t\t\t\t\t\t\tif(v){\n\t\t\t\t\t\t\t\t\t\tcheckedItems.push(allOptions[k][1])\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\tvar oldValues = ngModelController.$viewValue;\n\t\t\t\t\t\tvar vals = checkedItems.map(function(item){\n\t\t\t\t\t\t\t\treturn getSelectedValue(item);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tngModelController.$setViewValue(vals);\n\t\t\t\t\t\tngModelController.$render();\n\n\t\t\t\t\t\tif (scope.onSelect) {\n\t\t\t\t\t\t\t\tscope.onSelect({ newValue: vals, oldValue: oldValues });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tscope.modal.hide().then(function(){\n\t\t\t\t\t\t\t\tscope.showList = false;\n\t\t\t\t\t\t\t\tif (scope.ui.hasSearch) {\n\t\t\t\t\t\t\t\t\t if(clearSearchOnSelect){\n\t\t\t\t\t\t\t\t\t\t\t\tscope.ui.searchValue = '';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t};\n\n\t\t\t\tscope.unsetValues = function(){\n\t\t\t\t\t\t$timeout(function(){\n\t\t\t\t\t\t\t\tngModelController.$setViewValue(multipleNullValue);\n\t\t\t\t\t\t\t\tngModelController.$render();\n\t\t\t\t\t\t\t\tscope.isChecked = {};\n\t\t\t\t\t\t\t\tscope.modal.hide();\n\t\t\t\t\t\t\t\tscope.showList = false;\n\t\t\t\t\t\t\t\tif (scope.onReset && angular.isFunction(scope.onReset)) {\n\t\t\t\t\t\t\t\t\t\tscope.onReset();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t};\n\n\t\t\t\tscope.closeModal = function(){\n\t\t\t\t\tscope.modal.hide().then(function(){\n\t\t\t\t\t\tscope.showList = false;\n\t\t\t\t\t});\n\t\t\t\t};\n\n\n\t\t\t\tscope.compareValues = function(a, b){\n\t\t\t\t\treturn angular.equals(a, b);\n\t\t\t\t};\n\n\t\t\t\t//loading the modal\n\t\t\t\tvar modalTpl = null;\n\t\t\t\tif(iAttrs.searchTemplate) {\n\t\t\t\t\tscope.modal = $ionicModal.fromTemplate(\n\t\t\t\t\t\t$templateCache.get(iAttrs.searchTemplate),\n\t\t\t\t\t\t{ scope: scope }\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tmodalTpl = multiple ? modalTemplateMultiple : modalTemplate;\n\t\t\t\t\tscope.modal = $ionicModal.fromTemplate(\n\t\t\t\t\t\tmodalTpl,\n\t\t\t\t\t\t{ scope: scope }\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tlet hiddenCb = null;\n\t\t\t\tscope.$on('$destroy', function(){\n\t\t\t\t\tif(hiddenCb){\n\t\t\t\t\t\t\thiddenCb();\n\t\t\t\t\t\t\thiddenCb = null;\n\t\t\t\t\t}\n\t\t\t\t\tscope.modal.remove();\n\t\t\t\t});\n\n\t\t\t\tif (scope.onClose && angular.isFunction(scope.onClose)) {\n\t\t\t\t\thiddenCb = scope.$on('modal.hidden', function(){\n\t\t\t\t\t\tscope.onClose();\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tiElement.on('click', function(){\n\t\t\t\t\tif (shortList) {\n\t\t\t\t\t\tscope.showList = true;\n\t\t\t\t\t\tscope.modal.show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscope.modal.show()\n\t\t\t\t\t\t\t.then(function(){\n\t\t\t\t\t\t\t\tscope.showList = true;\n\t\t\t\t\t\t\t\tscope.ui.shortList = shortList;\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t\t//filter function\n\t\t\t\tif (scope.ui.hasSearch) {\n\t\t\t\t\tscope.$watch('ui.searchValue', function(nv){\n\t\t\t\t\t\tvar whatToSearch;\n\t\t\t\t\t\tif ( !multiple ) {\n\t\t\t\t\t\t\t\twhatToSearch = allOptions;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twhatToSearch = allOptions.map(function(item){\n\t\t\t\t\t\t\t\t\t\treturn item[1];\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(iAttrs.onSearch) {\n\t\t\t\t\t\t\t\tscope.onSearch({query: nv});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tvar filteredOpts = $filter('filter')(whatToSearch, nv, function(actual, expected) {\n\t\t\t\t\t\t\t\tif(!actual){\n\t\t\t\t\t\t\t\t\t// if actual is an empty string, empty object, null, or undefined\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (searchProperties){\n\t\t\t\t\t\t\t\t\tif (typeof actual == 'object'){\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < searchProperties.length; i++){\n\t\t\t\t\t\t\t\t\t\t\tif (actual[searchProperties[i]] && actual[searchProperties[i]].toLowerCase().indexOf(expected.toLowerCase()) >= 0){\n\t\t\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif(actual.toString().toLowerCase().indexOf(expected.toLowerCase()) >= 0){\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tvar oldLen = scope.options.length;\n\t\t\t\t\t\t\tif ( !multiple ){\n\t\t\t\t\t\t\t\t\tscope.options = filteredOpts;\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//#TODO: lots of loops here!\n\t\t\t\t\t\t\t\t\tvar newOpts = [];\n\t\t\t\t\t\t\t\t\tangular.forEach(filteredOpts, function(item){\n\t\t\t\t\t\t\t\t\t\t\tvar originalItem = allOptions.find(function(it){\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn it[1] == item;\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\tif( originalItem ){\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewOpts.push(originalItem);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tscope.options = newOpts;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(oldLen != scope.options.length){\n\t\t\t\t\t\t\t\t//#todo: should resize scroll or scroll up here\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tscope.clearSearch = function(){\n\t\t\t\t\t\tscope.ui.searchValue = '';\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tscope.copyOpt = option => {\n\t\t\t\t\treturn angular.copy(option);\n\t\t\t\t}\n\n\t\t\t\t//#TODO ?: WRAP INTO $timeout?\n\t\t\t\tngModelController.$render();\n\n\t\t\t}\n\t\t};\n\t}\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/ionic-modal-select.js\n **/","module.exports = \" \\n\\n \\n

{{::ui.modalTitle}}

\\n
\\n\\n
\\n \\n \\n
\\n\\n \\n
\\n

{{::ui.loadListMessage}}

\\n

\\n \\n

\\n
\\n\\n
\\n \\n \\n \\n\\n \\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\\n \\n
\\n \\n \\n
\\n \\n
\\n \\n
\\n
\\n\"\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/raw-loader!./src/modal-template-multiple.html\n ** module id = 2\n ** module chunks = 0\n **/","module.exports = \" \\n\\n \\n

{{::ui.modalTitle}}

\\n
\\n\\n
\\n \\n \\n
\\n\\n \\n
\\n

{{::ui.loadListMessage}}

\\n

\\n \\n

\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n \\n \\n\\n
\\n
\\n
\\n\\n
\\n\\n \\n \\n \\n \\n\\n
\\n\"\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/raw-loader!./src/modal-template.html\n ** module id = 3\n ** module chunks = 0\n **/"],"sourceRoot":""}