{"version":3,"sources":["jsdelivr-header.js","/npm/jquery-highlight-text@1.0.1/jquery.highlighttext.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,CCoBC,SAAU,GACY,iBAAX,QAAiD,iBAAnB,OAAO,QAC/C,EAAQ,QAAQ,UAAW,OAAQ,UAEnC,EAAQ,OAAQ,OAAQ,SAE1B,CANA,EAME,SAAU,EAAG,EAAQ,GAEtB,EAAE,GAAG,cAAgB,WAGpB,IAAI,EACH,EACA,EACA,EAAU,EAAE,KAAK,UAAU,IAC3B,EAAiB,EAAE,GAAG,cAAc,eAErC,GAAiB,WAAZ,EAEJ,EAAK,UAAU,QAGX,GAAiB,UAAZ,EAGT,EAAQ,UAAU,GAAG,KAAK,SAGtB,IAAiB,WAAZ,EAQT,OALA,EAAQ,UAAU,EAMnB,CAuCG,MAzBc,YADjB,EAAU,EAAE,KAAK,UAAU,KAE1B,EAAS,UAAU,GAEE,YAAZ,GACT,EAAS,YACJ,IACJ,EAAQ,MAAQ,EAAQ,QAIzB,EAAS,YAGL,UAAU,IAAM,IACpB,EAAQ,EAAQ,MAAQ,EAAQ,OAM5B,IACJ,EAAK,IAAI,OAAQ,IAAM,EAAQ,IAAK,OAI3B,KAAK,MAAM,WAEd,EAAG,MAAO,KAAM,KAAM,UAAU,WAG/B,QAAQ,WACd,OAAyB,IAAlB,KAAK,UAA+D,IAA7C,EAAG,MAAO,QAAS,IAAM,GAAS,MACjE,IAGC,MAAM,WACG,IAAI,GACJ,EAAS,KAAK,UACT,QAAS,EAAI,IAAM,EAAiB,WAAa,EAAS,SAAW,EAAgB,QAC1E,KAAK,WACjB,EAAG,MAAO,KAAM,WAAY,SACvB,KAAM,GAAS,WAAW,QAEvC,GACJ,GACJ,EAEA,EAAE,GAAG,cAAc,eAAiB,MAErC","file":"/npm/jquery-highlight-text@1.0.1/jquery.highlighttext.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/jquery-highlight-text@1.0.1/jquery.highlighttext.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// This jQuery plugin implements the $.fn.highlightText method\r\n// making it easy to highlight text within an element by wrapping\r\n// it in a span with a given class.\r\n//\r\n// To use this plugin, first select the element that contains the text\r\n// that you want to replace, then call .highlightText() on it.\r\n// the plugin has one required parameter and two optional parameters.\r\n//\r\n// The plugin is always called in the same way:\r\n// $(sel).highlightText(<parameters>);\r\n// It accepts three parameters.\r\n//\r\n// The first parameter decides what text will be matched. It can be a\r\n// string, a regular expression in string format, a regular expression\r\n// object, or an array of words.\r\n//\r\n// The second parameter is the class that will be added to the matched\r\n// text. it is optional and can be a space delimited list of classes to\r\n// add to the element that wraps the matched text. It is set to \"highlight\"\r\n// by default.\r\n//\r\n// The third parameter lets you decide whether or not the plugin should\r\n// only match full matches. It is defaulted to false, meaning it will\r\n// match partial matches. However, this third parameter is ignored if\r\n// the first parameter is a regular expression object.\r\n\r\n(function (factory) {\r\n\tif (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n\t\tfactory(require(\"jquery\"), window, document);\r\n\t} else {\r\n\t\tfactory(jQuery, window, document);\r\n\t}\r\n}(function ($, window, document){\r\n\r\n\t$.fn.highlightText = function () {\r\n\t\t// handler first parameter\r\n\t\t// is the first parameter a regexp?\r\n\t\tvar re,\r\n\t\t\thClass,\r\n\t\t\treStr,\r\n\t\t\targType = $.type(arguments[0]),\r\n\t\t\tdefaultTagName = $.fn.highlightText.defaultTagName;\r\n\r\n\t\tif ( argType === \"regexp\" ) {\r\n\t\t\t// first argument is a regular expression\r\n\t\t\tre = arguments[0];\r\n\t\t}\r\n\t\t// is the first parameter an array?\r\n\t\telse if ( argType === \"array\" ) {\r\n\t\t\t// first argument is an array, generate\r\n\t\t\t// regular expression string for later use\r\n\t\t\treStr = arguments[0].join(\"|\");\r\n\t\t}\r\n\t\t// is the first parameter a string?\r\n\t\telse if ( argType === \"string\" ) {\r\n\t\t\t// store string in regular expression string\r\n\t\t\t// for later use\r\n\t\t\treStr = arguments[0];\r\n\t\t}\r\n\t\t// else, return out and do nothing because this\r\n\t\t// argument is required.\r\n\t\telse {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// the second parameter is optional, however,\r\n\t\t// it must be a string or boolean value. If it is\r\n\t\t// a string, it will be used as the highlight class.\r\n\t\t// If it is a boolean value and equal to true, it\r\n\t\t// will be used as the third parameter and the highlight\r\n\t\t// class will default to \"highlight\". If it is undefined,\r\n\t\t// the highlight class will default to \"highlight\" and\r\n\t\t// the third parameter will default to false, allowing\r\n\t\t// the plugin to match partial matches.\r\n\t\t// ** The exception is if the first parameter is a regular\r\n\t\t// expression, the third parameter will be ignored.\r\n\t\targType = $.type(arguments[1]);\r\n\t\tif ( argType === \"string\" ) {\r\n\t\t\thClass = arguments[1];\r\n\t\t}\r\n\t\telse if ( argType === \"boolean\" ) {\r\n\t\t\thClass = \"highlight\";\r\n\t\t\tif ( reStr ) {\r\n\t\t\t\treStr = \"\\\\b\" + reStr + \"\\\\b\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\thClass = \"highlight\";\r\n\t\t}\r\n\r\n\t\tif ( arguments[2] && reStr ) {\r\n\t\t\treStr = reStr = \"\\\\b\" + reStr + \"\\\\b\";\r\n\t\t}\r\n\r\n\t\t// if re is not defined ( which means either an array or\r\n\t\t// string was passed as the first parameter ) create the\r\n\t\t// regular expression.\r\n\t\tif (!re) {\r\n\t\t\tre = new RegExp( \"(\" + reStr + \")\", \"ig\" );\r\n\t\t}\r\n\r\n\t    // iterate through each matched element\r\n\t    return this.each( function() {\r\n\t        // select all contents of this element\r\n\t        $( this ).find( \"*\" ).andSelf().contents()\r\n\r\n\t        // filter to only text nodes that aren't already highlighted\r\n\t        .filter( function () {\r\n\t\t\t\treturn this.nodeType === 3 && $( this ).closest( \".\" + hClass ).length === 0;\r\n\t\t\t})\r\n\r\n\t\t\t// loop through each text node\r\n\t\t\t.each( function () {\r\n\t            var output;\r\n\t            output = this.nodeValue\r\n\t                .replace( re, \"<\" + defaultTagName + \" class='\" + hClass + \"'>$1</\" + defaultTagName +\">\" );\r\n\t            if ( output !== this.nodeValue ) {\r\n\t                $( this ).wrap( \"<p></p>\" ).parent()\r\n\t                    .html( output ).contents().unwrap();\r\n\t            }\r\n\t        });\r\n\t    });\r\n\t};\r\n\r\n\t$.fn.highlightText.defaultTagName = \"span\";\r\n\r\n}));\r\n"]}