{"version":3,"file":"fuzzy.js","mappings":";;;;;;AAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wDAAwD;AACxD;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH,CAAC;;;;;;;;AC3MD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,IAAI,IAA8B;AAClC;AACA,EAAE,KAAK,EAEN;;AAED;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gBAAgB;AAC1D;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;AAGA,CAAC;;;;;;;;UC9ID;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,iCAAiC;AACjC;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,mBAAO,CAAC,GAAO;;AAE9B;AACA,mBAAO,CAAC,GAAiC","sources":["webpack://@glpi/glpi/./lib/jqueryplugins/jquery.hotkeys.js","webpack://@glpi/glpi/./node_modules/fuzzy/lib/fuzzy.js","webpack://@glpi/glpi/webpack/bootstrap","webpack://@glpi/glpi/./lib/bundles/fuzzy.js"],"sourcesContent":["/*jslint browser: true*/\n/*jslint jquery: true*/\n\n/*\n * jQuery Hotkeys Plugin\n * Copyright 2010, John Resig\n * Dual licensed under the MIT or GPL Version 2 licenses.\n *\n * Based upon the plugin by Tzury Bar Yochay:\n * https://github.com/tzuryby/jquery.hotkeys\n *\n * Original idea by:\n * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/\n */\n\n/*\n * One small change is: now keys are passed by object { keys: '...' }\n * Might be useful, when you want to pass some other data to your handler\n */\n\n(function(jQuery) {\n\n jQuery.hotkeys = {\n version: \"0.2.0\",\n\n specialKeys: {\n 8: \"backspace\",\n 9: \"tab\",\n 10: \"return\",\n 13: \"return\",\n 16: \"shift\",\n 17: \"ctrl\",\n 18: \"alt\",\n 19: \"pause\",\n 20: \"capslock\",\n 27: \"esc\",\n 32: \"space\",\n 33: \"pageup\",\n 34: \"pagedown\",\n 35: \"end\",\n 36: \"home\",\n 37: \"left\",\n 38: \"up\",\n 39: \"right\",\n 40: \"down\",\n 45: \"insert\",\n 46: \"del\",\n 59: \";\",\n 61: \"=\",\n 96: \"0\",\n 97: \"1\",\n 98: \"2\",\n 99: \"3\",\n 100: \"4\",\n 101: \"5\",\n 102: \"6\",\n 103: \"7\",\n 104: \"8\",\n 105: \"9\",\n 106: \"*\",\n 107: \"+\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 112: \"f1\",\n 113: \"f2\",\n 114: \"f3\",\n 115: \"f4\",\n 116: \"f5\",\n 117: \"f6\",\n 118: \"f7\",\n 119: \"f8\",\n 120: \"f9\",\n 121: \"f10\",\n 122: \"f11\",\n 123: \"f12\",\n 144: \"numlock\",\n 145: \"scroll\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\"\n },\n\n shiftNums: {\n \"`\": \"~\",\n \"1\": \"!\",\n \"2\": \"@\",\n \"3\": \"#\",\n \"4\": \"$\",\n \"5\": \"%\",\n \"6\": \"^\",\n \"7\": \"&\",\n \"8\": \"*\",\n \"9\": \"(\",\n \"0\": \")\",\n \"-\": \"_\",\n \"=\": \"+\",\n \";\": \": \",\n \"'\": \"\\\"\",\n \",\": \"<\",\n \".\": \">\",\n \"/\": \"?\",\n \"\\\\\": \"|\"\n },\n\n // excludes: button, checkbox, file, hidden, image, password, radio, reset, search, submit, url\n textAcceptingInputTypes: [\n \"text\", \"password\", \"number\", \"email\", \"url\", \"range\", \"date\", \"month\", \"week\", \"time\", \"datetime\",\n \"datetime-local\", \"search\", \"color\", \"tel\"],\n\n // default input types not to bind to unless bound directly\n textInputTypes: /textarea|input|select/i,\n\n options: {\n filterInputAcceptingElements: true,\n filterTextInputs: true,\n filterContentEditable: true\n }\n };\n\n function keyHandler(handleObj) {\n if (typeof handleObj.data === \"string\") {\n handleObj.data = {\n keys: handleObj.data\n };\n }\n\n // Only care when a possible input has been specified\n if (!handleObj.data || !handleObj.data.keys || typeof handleObj.data.keys !== \"string\") {\n return;\n }\n\n var origHandler = handleObj.handler,\n keys = handleObj.data.keys.toLowerCase().split(\" \");\n\n handleObj.handler = function(event) {\n // Don't fire in text-accepting inputs that we didn't directly bind to\n if (this !== event.target &&\n (jQuery.hotkeys.options.filterInputAcceptingElements &&\n jQuery.hotkeys.textInputTypes.test(event.target.nodeName) ||\n (jQuery.hotkeys.options.filterContentEditable && jQuery(event.target).attr('contenteditable')) ||\n (jQuery.hotkeys.options.filterTextInputs &&\n jQuery.inArray(event.target.type, jQuery.hotkeys.textAcceptingInputTypes) > -1))) {\n return;\n }\n\n var special = event.type !== \"keypress\" && jQuery.hotkeys.specialKeys[event.which],\n character = String.fromCharCode(event.which).toLowerCase(),\n modif = \"\",\n possible = {};\n\n jQuery.each([\"alt\", \"ctrl\", \"shift\"], function(index, specialKey) {\n\n if (event[specialKey + 'Key'] && special !== specialKey) {\n modif += specialKey + '+';\n }\n });\n\n // metaKey is triggered off ctrlKey erronously\n if (event.metaKey && !event.ctrlKey && special !== \"meta\") {\n modif += \"meta+\";\n }\n\n if (event.metaKey && special !== \"meta\" && modif.indexOf(\"alt+ctrl+shift+\") > -1) {\n modif = modif.replace(\"alt+ctrl+shift+\", \"hyper+\");\n }\n\n if (special) {\n possible[modif + special] = true;\n }\n else {\n possible[modif + character] = true;\n possible[modif + jQuery.hotkeys.shiftNums[character]] = true;\n\n // \"$\" can be triggered as \"Shift+4\" or \"Shift+$\" or just \"$\"\n if (modif === \"shift+\") {\n possible[jQuery.hotkeys.shiftNums[character]] = true;\n }\n }\n\n for (var i = 0, l = keys.length; i < l; i++) {\n if (possible[keys[i]]) {\n return origHandler.apply(this, arguments);\n }\n }\n };\n }\n\n jQuery.each([\"keydown\", \"keyup\", \"keypress\"], function() {\n jQuery.event.special[this] = {\n add: keyHandler\n };\n });\n\n})(jQuery || this.jQuery || window.jQuery);\n","/*\n * Fuzzy\n * https://github.com/myork/fuzzy\n *\n * Copyright (c) 2012 Matt York\n * Licensed under the MIT license.\n */\n\n(function() {\n\nvar root = this;\n\nvar fuzzy = {};\n\n// Use in node or in browser\nif (typeof exports !== 'undefined') {\n module.exports = fuzzy;\n} else {\n root.fuzzy = fuzzy;\n}\n\n// Return all elements of `array` that have a fuzzy\n// match against `pattern`.\nfuzzy.simpleFilter = function(pattern, array) {\n return array.filter(function(str) {\n return fuzzy.test(pattern, str);\n });\n};\n\n// Does `pattern` fuzzy match `str`?\nfuzzy.test = function(pattern, str) {\n return fuzzy.match(pattern, str) !== null;\n};\n\n// If `pattern` matches `str`, wrap each matching character\n// in `opts.pre` and `opts.post`. If no match, return null\nfuzzy.match = function(pattern, str, opts) {\n opts = opts || {};\n var patternIdx = 0\n , result = []\n , len = str.length\n , totalScore = 0\n , currScore = 0\n // prefix\n , pre = opts.pre || ''\n // suffix\n , post = opts.post || ''\n // String to compare against. This might be a lowercase version of the\n // raw string\n , compareString = opts.caseSensitive && str || str.toLowerCase()\n , ch;\n\n pattern = opts.caseSensitive && pattern || pattern.toLowerCase();\n\n // For each character in the string, either add it to the result\n // or wrap in template if it's the next string in the pattern\n for(var idx = 0; idx < len; idx++) {\n ch = str[idx];\n if(compareString[idx] === pattern[patternIdx]) {\n ch = pre + ch + post;\n patternIdx += 1;\n\n // consecutive characters should increase the score more than linearly\n currScore += 1 + currScore;\n } else {\n currScore = 0;\n }\n totalScore += currScore;\n result[result.length] = ch;\n }\n\n // return rendered string if we have a match for every char\n if(patternIdx === pattern.length) {\n // if the string is an exact match with pattern, totalScore should be maxed\n totalScore = (compareString === pattern) ? Infinity : totalScore;\n return {rendered: result.join(''), score: totalScore};\n }\n\n return null;\n};\n\n// The normal entry point. Filters `arr` for matches against `pattern`.\n// It returns an array with matching values of the type:\n//\n// [{\n// string: 'lah' // The rendered string\n// , index: 2 // The index of the element in `arr`\n// , original: 'blah' // The original element in `arr`\n// }]\n//\n// `opts` is an optional argument bag. Details:\n//\n// opts = {\n// // string to put before a matching character\n// pre: ''\n//\n// // string to put after matching character\n// , post: ''\n//\n// // Optional function. Input is an entry in the given arr`,\n// // output should be the string to test `pattern` against.\n// // In this example, if `arr = [{crying: 'koala'}]` we would return\n// // 'koala'.\n// , extract: function(arg) { return arg.crying; }\n// }\nfuzzy.filter = function(pattern, arr, opts) {\n if(!arr || arr.length === 0) {\n return [];\n }\n if (typeof pattern !== 'string') {\n return arr;\n }\n opts = opts || {};\n return arr\n .reduce(function(prev, element, idx, arr) {\n var str = element;\n if(opts.extract) {\n str = opts.extract(element);\n }\n var rendered = fuzzy.match(pattern, str, opts);\n if(rendered != null) {\n prev[prev.length] = {\n string: rendered.rendered\n , score: rendered.score\n , index: idx\n , original: element\n };\n }\n return prev;\n }, [])\n\n // Sort by score. Browsers are inconsistent wrt stable/unstable\n // sorting, so force stable by using the index in the case of tie.\n // See http://ofb.net/~sethml/is-sort-stable.html\n .sort(function(a,b) {\n var compare = b.score - a.score;\n if(compare) return compare;\n return a.index - b.index;\n });\n};\n\n\n}());\n\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * ---------------------------------------------------------------------\n * GLPI - Gestionnaire Libre de Parc Informatique\n * Copyright (C) 2015-2022 Teclib' and contributors.\n *\n * http://glpi-project.org\n *\n * based on GLPI - Gestionnaire Libre de Parc Informatique\n * Copyright (C) 2003-2014 by the INDEPNET Development Team.\n *\n * ---------------------------------------------------------------------\n *\n * LICENSE\n *\n * This file is part of GLPI.\n *\n * GLPI is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2 of the License, or\n * (at your option) any later version.\n *\n * GLPI is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with GLPI. If not, see .\n * ---------------------------------------------------------------------\n */\n\n// Fuzzy base lib\n// 'fuzzy' object has to be declared in global scope\nwindow.fuzzy = require('fuzzy');\n\n// Required to open search menu with \"CTRL+ALT+G\"\nrequire('../jqueryplugins/jquery.hotkeys');\n"],"names":[],"sourceRoot":""}