JSLT Minified
by Cyril J
JavaScript
/*https://jsfiddle.net/YSharpLanguage/c7usrpsL/10*/function Per(){function n(n){return h(n,{contains:e,distinct:u,flattenBy:o,groupBy:l,orderBy:c,nodeset:i,flatset:f,select:a})}function t(n,t){return null!=n&&null!=t&&"undefined"!=typeof n._HERE_&&"undefined"!=typeof n.value?n._HERE_===!0&&n._HERE_===t._HERE_&&n.value===t.value:n===t}function r(n,r){for(var e=0;e<n.length;e++)if(t(n[e],r))return!0;return!1}function e(n){return r(this,n)}function u(){for(var n=[],t=0;t<this.length;t++){var e=this[t];r(n,e)||n.push(e)}return n}function i(){var t=[].slice.call(arguments),r="function"==typeof t[0]?t[0]:null,e=r?t[1]:t[0],u=function(n,t,i,f){var o,l=v(n),c=!f;if(f=f||[],(!r&&(!c||!l)||r&&r(n,i,t))&&f.push({_HERE_:!0,parent:t,key:i,value:n}),o=l?{_HERE_:!0,parent:t,key:i,value:n}:n,g(n)&&(e||c&&l))for(t in n)null!=n[t]&&u(n[t],o,t,f);return f};return n(u(this))}function f(){var t=[].slice.call(arguments),r="function"==typeof t[0]?t[0]:null,e=null!==r?t[1]:t[0];return r=r?r:function(){return!0},n(this.slice(0)).nodeset(r,e)}function o(){return n(f.apply(this,arguments).map(function(n){return n.value}))}function l(){var e=[].slice.call(arguments),u="function"==typeof e[0]||"string"==typeof e[0]?e[0]:null,i=function(n){for(var r=f.length;--r>=0;){var e=f[r];if(t(n,e[0]))return e[1]}return null},f=[];if(null!==u){for(var o=0;o<this.length;o++){var l=this[o];if("undefined"!=typeof l){var c=void 0;if("function"!=typeof u?"undefined"!=typeof l[u]&&(c=l[u]):c=u(l),"undefined"!=typeof c){var a=i(c);a?r(a,l)||a.push(l):f.push([c,[l]])}}}return function(t){return n(("undefined"!=typeof t?"function"==typeof t?f.map(t):i(t):f)||[])}}return function(){return n([])}}function c(){var t,r=[].slice.call(arguments),e="function"==typeof r[0]||"string"==typeof r[0]?r[0]:null;return n(null!==e?this.slice(0).sort("function"!=typeof e?"function"!=typeof(t=r[1])?function(n,t){return n[e]<t[e]?-1:1}:function(n,r){return t(n[e],r[e])}:e):this.slice(0))}function a(){return...