PageSourceSearch

https://commuterinfo.net/js/libs/insane-2.6.2.min.js

js commuterinfo.net collected 2026-09-28 12:49:03 UTC 8,486 bytes, 1 lines download raw bytes

1(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.insane=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";var toMap=require("./toMap");var uris=["background","base","cite","href","longdesc","src","usemap"];module.exports={uris:toMap(uris)}},{"./toMap":10}],2:[function(require,module,exports){"use strict";var defaults={allowedAttributes:{a:["href","name","target","title","aria-label"],iframe:["allowfullscreen","frameborder","src"],img:["src","alt","title","aria-label"]},allowedClasses:{},allowedSchemes:["http","https","mailto"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],filter:null};module.exports=defaults},{}],3:[function(require,module,exports){"use strict";var toMap=require("./toMap");var voids=["area","br","col","hr","img","wbr","input","base","basefont","link","meta"];module.exports={voids:toMap(voids)}},{"./toMap":10}],4:[function(require,module,exports){"use strict";var he=require("he");var assign=require("assignment");var parser=require("./parser");var sanitizer=require("./sanitizer");var defaults=require("./defaults");function insane(html,options,strict){var buffer=[];var configuration=strict===true?options:assign({},defaults,options);var handler=sanitizer(buffer,configuration);parser(html,handler);return buffer.join("")}insane.defaults=defaults;module.exports=insane},{"./defaults":2,"./parser":7,"./sanitizer":8,assignment:6,he:9}],5:[function(require,module,exports){"use strict";module.exports=function lowercase(string){return typeof string==="string"?string.toLowerCase():string}},{}],6:[function(require,module,exports){"use strict";function assignment(result){var stack=Array.prototype.slice.call(arguments,1);var item;var key;while(stack.length){item=stack.shift();for(key in item){if(item.hasOwnProperty(key)){if(Object.prototype.toString.call(result[key])==="[object Object]"){result[key]=assignment(result[key],item[key])}else{result[key]=item[key]}}}}return result}module.exports=assignment},{}],7:[function(require,module,exports){"use strict";var he=require("he");var lowercase=require("./lowercase");var attributes=require("./attributes");var elements=require("./elements");var rstart=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/;var rend=/^<\s*\/\s*([\w:-]+)[^>]*>/;var rattrs=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g;var rtag=/^</;var rtagend=/^<\s*\//;function createStack(){var stack=[];stack.lastItem=function lastItem(){return stack[stack.length-1]};return stack}function parser(html,handler){var stack=createStack();var last=html;var chars;while(html){parsePart()}parseEndTag();function parsePart(){chars=true;parseTag();var same=html===last;last=html;if(same){html=""}}function parseTag(){if(html.substr(0,4)==="<!--"){parseComment()}else if(rtagend.test(html)){parseEdge(rend,parseEndTag)}else if(rtag.test(html)){parseEdge(rstart,parseStartTag)}parseTagDecode()}function parseEdge(regex,parser){var match=html.match(regex);if(match){html=html.substring(match[0].length);match[0].replace(regex,parser);chars=false}}function parseComment(){var index=html.indexOf("-->");if(index>=0){if(handler.comment){handler.comment(html.substring(4,index))}html=html.substring(index+3);chars=false}}function parseTagDecode(){if(!chars){return}var text;var index=html.indexOf("<");if(index>=0){text=html.substring(0,index);html=html.substring(index)}else{text=html;html=""}if(handler.chars){handler.chars(text)}}function parseStartTag(tag,tagName,rest,unary){var attrs={};var low=lowercase(tagName);var u=elements.voids[low]||!!unary;rest.replace(rattrs,attrReplacer);
1if(!u){stack.push(low)}if(handler.start){handler.start(low,attrs,u)}function attrReplacer(match,name,doubleQuotedValue,singleQuotedValue,unquotedValue){if(doubleQuotedValue===void 0&&singleQuotedValue===void 0&&unquotedValue===void 0){attrs[name]=void 0}else{attrs[name]=he.decode(doubleQuotedValue||singleQuotedValue||unquotedValue||"")}}}function parseEndTag(tag,tagName){var i;var pos=0;var low=lowercase(tagName);if(low){for(pos=stack.length-1;pos>=0;pos--){if(stack[pos]===low){break}}}if(pos>=0){for(i=stack.length-1;i>=pos;i--){if(handler.end){handler.end(stack[i])}}stack.length=pos}}}module.exports=parser},{"./attributes":1,"./elements":3,"./lowercase":5,he:9}],8:[function(require,module,exports){"use strict";var he=require("he");var lowercase=require("./lowercase");var attributes=require("./attributes");var elements=require("./elements");function sanitizer(buffer,options){var last;var context;var o=options||{};reset();return{start:start,end:end,chars:chars};function out(value){buffer.push(value)}function start(tag,attrs,unary){var low=lowercase(tag);if(context.ignoring){ignore(low);return}if((o.allowedTags||[]).indexOf(low)===-1){ignore(low);return}if(o.filter&&!o.filter({tag:low,attrs:attrs})){ignore(low);return}out("<");out(low);Object.keys(attrs).forEach(parse);out(unary?"/>":">");function parse(key){var value=attrs[key];var classesOk=(o.allowedClasses||{})[low]||[];var attrsOk=(o.allowedAttributes||{})[low]||[];var valid;var lkey=lowercase(key);if(lkey==="class"&&attrsOk.indexOf(lkey)===-1){value=value.split(" ").filter(isValidClass).join(" ").trim();valid=value.length}else{valid=attrsOk.indexOf(lkey)!==-1&&(attributes.uris[lkey]!==true||testUrl(value))}if(valid){out(" ");out(key);if(typeof value==="string"){out('="');out(he.encode(value));out('"')}}function isValidClass(className){return classesOk&&classesOk.indexOf(className)!==-1}}}function end(tag){var low=lowercase(tag);var allowed=(o.allowedTags||[]).indexOf(low)!==-1;if(allowed){if(context.ignoring===false){out("</");out(low);out(">")}else{unignore(low)}}else{unignore(low)}}function testUrl(text){var start=text[0];if(start==="#"||start==="/"){return true}var colon=text.indexOf(":");if(colon===-1){return true}var questionmark=text.indexOf("?");if(questionmark!==-1&&colon>questionmark){return true}
1var hash=text.indexOf("#");if(hash!==-1&&colon>hash){return true}return o.allowedSchemes.some(matches);function matches(scheme){return text.indexOf(scheme+":")===0}}function chars(text){if(context.ignoring===false){out(o.transformText?o.transformText(text):text)}}function ignore(tag){if(elements.voids[tag]){return}if(context.ignoring===false){context={ignoring:tag,depth:1}}else if(context.ignoring===tag){context.depth++}}function unignore(tag){if(context.ignoring===tag){if(--context.depth<=0){reset()}}}function reset(){context={ignoring:false,depth:0}}}module.exports=sanitizer},{"./attributes":1,"./elements":3,"./lowercase":5,he:9}],9:[function(require,module,exports){"use strict";var escapes={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};var unescapes={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};var rescaped=/(&amp;|&lt;|&gt;|&quot;|&#39;)/g;var runescaped=/[&<>"']/g;function escapeHtmlChar(match){return escapes[match]}function unescapeHtmlChar(match){return unescapes[match]}function escapeHtml(text){return text==null?"":String(text).replace(runescaped,escapeHtmlChar)}function unescapeHtml(html){return html==null?"":String(html).replace(rescaped,unescapeHtmlChar)}escapeHtml.options=unescapeHtml.options={};module.exports={encode:escapeHtml,escape:escapeHtml,decode:unescapeHtml,unescape:unescapeHtml,version:"1.0.0-browser"}},{}],10:[function(require,module,exports){"use strict";function toMap(list){return list.reduce(asKey,{})}function asKey(accumulator,item){accumulator[item]=true;return accumulator}module.exports=toMap},{}]},{},[4])(4)});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.