This repository has been archived by the owner on Jul 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sjl.min.js
1 lines (1 loc) · 23.2 KB
/
sjl.min.js
1
/**! sjljs 7.0.0 | License: GPL-2.0+ AND MIT | md5checksum: d2a402e95258062a8b072ae72788a1ef | Built-on: Thu Feb 02 2017 10:51:47 GMT-0500 (EST) **/!function(){"use strict";function e(){var e=i(arguments);return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function t(e){var r=o(arguments,1);return function(){var o=i(arguments),s=n(r,o),a=s.filter(m),u=0===a.length;return u?e.apply(null,s):t.apply(null,[e].concat(s))}}function r(e,t){var s=o(arguments,2);return function(){var o=i(arguments),a=n(s,o),u=a.filter(m),c=a.length-u.length>=t||!t;return c?e.apply(null,a):r.apply(null,[e,t].concat(a))}}function n(e,t){var r=e.map(function(e){return e instanceof Ce&&t.length>0?t.shift():e});return t.length>0?r.concat(t):r}function i(e){return Fe.call(e,0,e.length)}function o(e,t,r){return r=r||e.length,Fe.call(e,t,r)}function s(e,t,r,n){n=w(n)?n:!0;var i,o,s,a,u=[null,e];return e.hasOwnProperty(t+"")&&(s=n?e.slice():e,i=c(r,Se)?f(s[t],r):!0,i&&(a=s.splice(t,1),o=a.length>0?a[0]:null,u=[o,s])),u}function a(e){return typeof e!==Ne&&null!==e}function u(){return!i(arguments).some(function(e){return!a(e)})}function c(e,t){return a(e)&&d.apply(null,arguments)}function l(e){var t,r,n;return typeof e===Ne?t=xe:null===e?t=Ie:(n="toString"===e.toString.name?Object.prototype.toString:e.toString,r=n.call(e),t=r.substring(8,r.length-1),t===Te&&isNaN(e)&&(t="NaN")),t}function f(e,t){var r=l(t),n=t instanceof Function;if(r!==String.name&&!n)throw new TypeError("sjl.classOfIs expects it's `type` parameter tobe of type `String` or an instance of `Function`. Type received: "+r+".");return(n?e instanceof t:!1)||l(e)===(r===Se?t:t.name)}function p(e,t,r){var n=ge.classOf(e);switch(n){case Ee:case"Set":case"SjlSet":case"SjlMap":case"Map":e.forEach(t,r);break;case Ae:y(e,t,r);break;default:throw new TypeError("sjl.forEach takes only `Array`, `Object`, `Map`, `Set`, `SjlSet`, and `SjlMap` objects. Type passed in: `"+n+"`.")}}function y(e,t,r){Object.keys(e).forEach(function(n){t.call(r,e[n],n,e)})}function d(e,t){return ge.restArgs(arguments,1).some(function(t){return f(e,t)})}function h(e){return f(e,Te)}function m(e){return e instanceof Ce}function v(e){return f(e,_e)}function b(e){return Array.isArray(e)}function w(e){return f(e,ke)}function j(e){return f(e,Ae)}function O(e){return f(e,Se)}function g(e){return f(e,xe)}function S(e){return f(e,Ie)}function _(e){return f(e,"Symbol")}function E(e){return 0===Object.keys(e).length}function T(e){var t,r=l(e);return t=r===Ee||r===Se?0===e.length:r===Te&&0!==e||r===_e?!1:r===Ae?E(e):!a(e)||0===e||e===!1}function A(){return i(arguments).some(function(e){return T(e)})}function k(e,t){return T(e)||!d.apply(null,arguments)}function I(e,t){return!T(e)&&d.apply(null,arguments)}function x(e,t){return e[t]=void 0,delete e[t]}function N(e,t,r){var n=t,i=!g(r),o=l(t);if(o!==Ae&&t instanceof Function==!1)throw new TypeError("sjl.autoNamespace expects a Constructor or an instance obj to search on.Value received: `"+o+"`.");return e.split(".").forEach(function(e,t,o){(e in n==!1||g(n[e]))&&(n[e]={}),t===o.length-1&&i&&(n[e]=r),n=n[e]}),n}function P(e){return ie(e,"toLowerCase","lcaseFirst")}function F(e){return ie(e,"toUpperCase","ucaseFirst")}function C(e,t,r){t=t||!1,r=r||/[^a-z\d]/i;var n="",i=e.split(r);return i.forEach(function(e){/[a-z\d]/.test(e)&&(n+=F(e))}),t||(n=P(n)),n}function L(e,t){var r="",n=Object.getPrototypeOf(e);return b(e)?r=e.join(t):("Set"===n.constructor.name||"SjlSet"===n.constructor.name)&&(r=[],e.forEach(function(e){r.push(e)}),r=r.join(t)),r}function M(e,t){var r,n=e.split("."),i=t,o=l(t);if(Z("sjl.searchObj","ns_string",e,String),o!==Ae&&t instanceof Function==!1)throw new TypeError("sjl.searchObj expects `objToSearch` to be of type object or an instance of `Function`. Type received: "+o);for(r=0;r<n.length;r+=1){if(n[r]in i==!1||g(i[n[r]])){i=void 0;break}i=i[n[r]]}return i}function q(e,t){return I(e[t],_e)}function z(e,t,r){return e&&t?(Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);(!i||a(i.get)&&a(i.set)||i.writable)&&(r===!0&&j(t[n])&&j(e[n])&&!E(t[n])?z(e[n],t[n],r):e[n]=t[n])}),e):e}function W(){var e=i(arguments),t=se(e),r=e.shift();return e.forEach(function(e){j(e)&&z(r,e,t)}),r}function B(e){return z({},e,!0)}function K(e){return JSON.parse(JSON.stringify(e))}function U(e){return function(){console.warn("An anonymous constructor was used! Please replace it with a named constructor for best interoperability."),e.apply(this,arguments)}}function J(e,t,r,n){e=e||Object.create(Object.prototype);var i;return v(e)&&(i=Object.keys(e).reduce(function(t,r){return"extend"===r||"extendWith"===r?t:(t[r]=e[r],t)},{})),j(t)&&(n=r,r=B(t),t=v(r.constructor)?r.constructor:U(e),x(r,"constructor")),t=a(t)?t:U(e),{constructor:t,methods:r,statics:z(i||{},n||{},!0),superClass:e}}function D(e){return e.hasOwnProperty("toString")&&"toString"!==e.toString.name||(e.prototype.toString=function(){return"[object "+e.name+"]"}),e}function V(e){var t=function(t,r,n){return R(e,t,r,n)};return e.extend=e.extendWith=t,e}function H(e,t,r,n){var i=J.apply(null,arguments),o=i.superClass,s=i.statics,a=i.constructor,u=i.methods;return a.prototype=Object.create(o.prototype),Object.defineProperty(a.prototype,"constructor",{value:a}),z(a.prototype,u),z(a,s,!0),a}function R(t,r,n,i){var o=H.apply(null,arguments);return e(V,D)(o)}function G(e,t,r){return Q(e,t,r)}function Q(e,t,r){return t=t||"module",e[r||"ns"]=e[t]=function(r,n){return ge.isUndefined(r)?e[t]:ne(r,e[t],n)},e[t]}function X(e,t,r){return t>e?t:e>r?r:e}function Y(e,t,r){return e>r?t:t>e?r:e}function Z(e,t,r,n,i){var o=l(r);if(!O(n)&&!v(n))throw new TypeError("`sjl.throwTypeErrorIfNotOfType` only accepts strings or constructors. Type received: `"+l(n)+"`.");if(!f(r,n))throw new TypeError("#`"+e+"`.`"+t+'` is not of type "'+n+'". '+(i||"")+" Type received: `"+o+"`.")}function $(e,t,r,n,i){var o=l(r),s=a(n);if(s&&!O(n)&&!v(n))throw new TypeError("`sjl.throwTypeErrorIfEmptyOrNotOfType.type` only accepts strings, functions (constructors),null, or undefined. Type received: `"+l(n)+"`.");if(s&&!f(r,n))throw new TypeError("#`"+e+"`.`"+t+'` is not of type "'+n+'". '+(i||"")+" Type received: `"+o+"`.");if(T(r))throw new TypeError("#`"+e+"`.`"+t+"` Cannot be empty. "+(i||"")+" Value received: `"+r+"`. Type received: "+o+"`.")}function ee(e,t,r,n,i){$(e,t,r,n,i)}function te(e,t,r){t=typeof t===Ne?null:t;var n;return n=a(r)?c.apply(null,[e].concat(ge.restArgs(arguments,2)))?e:t:a(e)?e:t}function re(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0})}function ne(e,t,r){var n,i=t,o=typeof r!==Ne;return e.split(".").forEach(function(e,t,s){n=i.hasOwnProperty(e),t===s.length-1&&o&&!n?re(i,e,r):typeof i[e]!==Ne||n||re(i,e,{}),i=i[e]}),i}function ie(e,t,r){var n,i,o,s;return Z(r,"str",e,Se),n=e.search(/[a-z]/i),h(n)&&n>-1&&(i=e.substr(n,1)[t](),o=e.substr(n+1,e.length-1),s=0!==n?e.substr(0,n):"",e=s+i+o),e}function oe(e,t){var r=s(e,t?0:e.length-1,ke,!1)[0];return w(r)?r:!1}function se(e){return oe(e,!0)}function ae(e){return oe(e,!1)}function ue(e,t,r){return r=w(r)?r:!1,Object.keys(e).forEach(function(n){t.hasOwnProperty(n)&&W(r,e[n],t[n])}),e}function ce(e,t){var r=i(arguments),n=se(r),o=r.shift();return r.forEach(function(e){j(e)&&ue(o,e,n)}),o}function le(e){return q(e,"next")}function fe(e){return v(e[ge.Symbol.iterator])}function pe(e){return e[ge.Symbol.iterator]}function ye(e){for(var t=e.next(),r=[];t.done===!1;)r.push(t.value),t=e.next();return r}function de(){return i(arguments).filter(function(e){return Array.isArray(e)||f(e,"Arguments")||a(WeakSet)&&f(e,WeakSet)||a(ge.stdlib.SjlSet)&&f(e,ge.stdlib.SjlSet)||a(Set)&&f(e,Set)})}function he(e){var t=Object.keys(e);return 0===t.length?[]:t.map(function(t){return[t,e[t]]})}function me(e){for(var t=e.entries(),r=t.next(),n=[];r.done===!1;)n.push(r.value),r=t.next();return n}function ve(e){return me(e)}function be(e){var t,r=l(e);switch(r){case"Arguments":t=i(e);break;case"SjlSet":case"WeakSet":case"Set":t=me(e);break;case"Map":case"WeakMap":case"SjlMap":t=ve(e);break;case Ee:t=e;break;case Se:t=e.split("")}return t}function we(e){var t,r=l(e);switch(r){case Ae:t=fe(r)?ye(pe(r)):le(e)?ye(e):he(e);break;case Te:t=e+"".split("");break;case _e:t=je(e());break;default:if(d(e,Ie,xe,"Symbol",ke))throw new TypeError("`sjl.toArray` cannot operate on values of type `Null`, `Undefined`, `Symbol`, `Boolean`. Value type passed in: `"+r+"`.");console.warn("`sjl.toArray` has wrapped a value unrecognized to it. Value received: "+e+", Type of value: ",r),t=[e]}return t}function je(e){return be(e)||we(e)}function Oe(){return de.apply(null,arguments).reduce(function(e,t){return e.concat(be(t))},[])}var ge,Se=String.name,_e=Function.name,Ee=Array.name,Te=Number.name,Ae=Object.name,ke=Boolean.name,Ie="Null",xe="Undefined",Ne="undefined",Pe=typeof window===Ne,Fe=Array.prototype.slice,Ce=function(){},Le=new Ce,Me=Object.freeze?Object.freeze(Le):Le;if(ge={argsToArray:i,arrayLikeToArray:be,notArrayLikeToArray:we,autoNamespace:N,camelCase:C,classOf:l,classOfIs:f,classOfIsMulti:d,classicalToStringMethod:D,clone:B,compose:e,concatArrayLikes:Oe,constrainPointer:X,createTopLevelPackage:G,curry:t,curryN:r,curry1:Me,curry2:Me,curry3:Me,curry4:Me,curry5:Me,defineSubClass:R,defineSubClassPure:H,defineEnumProp:re,empty:T,emptyMulti:A,extend:W,extractBoolFromArrayEnd:ae,extractBoolFromArrayStart:se,extractFromArrayAt:s,forEach:p,forEachInObj:y,getIterator:pe,getArrayLikes:de,hasMethod:q,hasIterator:fe,implode:L,isset:a,issetMulti:u,issetAndOfType:c,isEmpty:T,isEmptyObj:E,isEmptyOrNotOfType:k,isArray:b,isBoolean:w,isFunction:v,isNull:S,isNumber:h,isObject:j,isString:O,isSymbol:_,isUndefined:g,iteratorToArray:ye,jsonClone:K,lcaseFirst:P,mapToArray:ve,mergeOnProps:ue,mergeOnPropsMulti:ce,notEmptyAndOfType:I,objToArrayMap:he,objToArray:he,restArgs:o,searchObj:M,setToArray:me,throwTypeErrorIfNotOfType:Z,throwTypeErrorIfEmptyOrNotOfType:$,throwTypeErrorIfEmpty:ee,toArray:je,ucaseFirst:F,unConfigurableNamespace:ne,unset:x,valueOrDefault:te,wrapPointer:Y},function(){for(var e=1;5>=e;)!function(e){ge["curry"+e]=function(t){return r(t,e)}}(e),e+=1}(),g(Symbol)?ge.Symbol={iterator:"@@iterator"}:ge.Symbol=Symbol,ge.defineEnumProp(ge,"_",Me),ge.defineEnumProp(ge,"isNodeEnv",Pe),Pe)ge["package"]=ge.ns=new(require("./nodejs/Namespace"))(__dirname,[".js",".json"],null,["sjl.js"]),Object.keys(ge.ns).forEach(function(e){ge[e]=ge.ns[e]}),x(ge,"createTopLevelPackage"),x(ge,"addRevealingModuleCall"),module.exports=ge;else if(Q(ge,"package","ns"),re(ge,"stdlib",ge.ns("stdlib")),re(ge,"isAmd",v(window.define)&&a(window.define.amd)),window.sjl=ge,ge.isAmd)return ge}(),function(){"use strict";var e="undefined"==typeof window,t=e?require("./../sjl.js"):window.sjl||{},r="7.0.0";if(e)module.exports=r;else if(t.ns("version",r),t.defineEnumProp(t,"version",r),t.isAmd)return r}(),function(){"use strict";var e="undefined"==typeof window,t=e?require("../sjl.js"):window.sjl||{},r=function(){};if(r=t.defineSubClass(Function,r),e)module.exports=r;else if(t.ns("stdlib.Extendable",r),t.isAmd)return r}(),function(){"use strict";var e="undefined"==typeof window,t=e?require("../sjl.js"):window.sjl||{},r="sjl.stdlib.Config",n=t.ns.stdlib.Extendable.extend({constructor:function(){arguments.length>0&&this.set.apply(this,arguments)},get:function(e){return t.throwTypeErrorIfNotOfType(r+".get","keyOrNsKey",e,String,"Also `undefined` or `null` are allowed (used when wanting the object as JSON)."),t.searchObj(e,this)},set:function(e,n){var i=this;if(t.isObject(e))t.extend.apply(t,[!0,i].concat(t.argsToArray(arguments)));else if(t.isString(e))t.autoNamespace(e,i,n);else if(t.isset(e))throw new TypeError(r+".set only allows strings or objects as it's first parameter. Param type received: `"+t.classOf(e)+"`.");return i},has:function(e){t.throwTypeErrorIfNotOfType(r+".has","keyOrNsString",e,String);var n=t.searchObj(e,this);return 1===arguments.length?t.isset(n):t.issetAndOfType.apply(t,[n].concat(t.restArgs(1)))},toJSON:function(e){return t.jsonClone(t.notEmptyAndOfType(e,String)?t.searchObj(e,this):this)}});if(e)module.exports=n;else if(t.ns("stdlib.Config",n),t.isAmd)return n}(),function(){"use strict";var e="undefined"==typeof window,t=e?require("../sjl.js"):window.sjl||{},r=function(){var e=arguments[0],r="_options";t.isObject(e)&&t.issetAndOfType(e.optionsKeyName,String)&&(r=e.optionsKeyName+"",t.unset(e,"optionsKeyName")),Object.defineProperty(this,"optionsKeyName",{value:r}),t.defineEnumProp(this,this.optionsKeyName,new t.ns.stdlib.Config),arguments.length>0&&this.set.apply(this,arguments)};if(r=t.ns.stdlib.Extendable.extend(r,{get:function(e){return this.getStoreHash().get(e)},set:function(){var e=this.getStoreHash();return e.set.apply(e,arguments),this},has:function(e){return this.getStoreHash().has(e)},getStoreHash:function(){return this[this.optionsKeyName]}}),e)module.exports=r;else if(t.ns("stdlib.Optionable",r),t.isAmd)return r}(),function(){"use strict";var e="undefined",t=typeof window===e,r=t?require("../sjl.js"):window.sjl||{},n="sjl.stdlib.Iterator",i=Object.getOwnPropertyDescriptor,o=function(e){r.throwTypeErrorIfNotOfType(n,"values",e,"Array");var t=e,o=0;i(this,"_values")||Object.defineProperty(this,"_values",{value:t}),i(this,"pointer")||Object.defineProperty(this,"pointer",{get:function(){return o},set:function(e){r.throwTypeErrorIfNotOfType(n,"pointer",e,Number),o=r.constrainPointer(e,0,t.length)},enumerable:!0}),i(this,"size")||Object.defineProperty(this,"size",{get:function(){return t.length},enumerable:!0})};if(o=r.ns.stdlib.Extendable.extend(o,{current:function(){var e=this;return e.valid()?{done:!1,value:e._values[e.pointer]}:{done:!0}},next:function(){var e=this,t=e.pointer,r=e.valid()?{done:!1,value:e._values[t]}:{done:!0};return e.pointer+=1,r},rewind:function(){return this.pointer=0,this},valid:function(){return this.pointer<this._values.length},forEach:function(e,t){return t=t||this,this._values.forEach(e,t),this}}),t)module.exports=o;else if(r.ns("stdlib.Iterator",o),r.isAmd)return r.stdlib.Iterator}(),function(){"use strict";var e="undefined",t=typeof window===e,r=t?require("../sjl.js"):window.sjl||{},n=r.ns.stdlib.Iterator,i="ObjectIterator",o="sjl.stdlib."+i,s=n.extend({constructor:function(e,t){var i,s,a,u,c=r.classOf(e);if("Object"===c)i=e,u=Object.keys(i),a=u.map(function(e){return i[e]});else{if("Array"!==c)throw s=[c,r.classOf(t)],new TypeError("#`"+o+"` received incorrect parameter values. The expected parameter list should be one of two: [Object] or [Array, Array]. Parameter list received: ["+s.join(", ")+"].");r.throwTypeErrorIfNotOfType(o,"values",t,Array,"With the previous param being an array `values` can only be an array in this scenario."),u=e,a=t}n.call(this,a),Object.defineProperty(this,"_keys",{value:u})},current:function(){var e=this,t=e.pointer;return e.valid()?{done:!1,value:[e._keys[t],e._values[t]]}:{done:!0}},next:function(){var e=this,t=e.pointer,r=e.valid()?{done:!1,value:[e._keys[t],e._values[t]]}:{done:!0};return e.pointer+=1,r},valid:function(){var e=this.pointer;return e<this._values.length&&e<this._keys.length},forEach:function(e,t){var r=this,n=r._values;return t=t||r,r._keys.forEach(function(r,i,o){e.call(t,n[i],r,o)}),this}});if(t)module.exports=s;else if(r.ns("stdlib."+i,s),r.isAmd)return s}(),function(){"use strict";var e="undefined"==typeof window,t=e?require("../sjl.js"):window.sjl||{},r=t.ns.stdlib.Iterator,n=t.ns.stdlib.ObjectIterator;if(t.iterable=function(e){var i,o,s=t.classOf(e);if("Array"===s)e[t.Symbol.iterator]=function(){return new r(e)};else{if("Object"!==s)throw new Error('sjl.iterable only takes objects or arrays. arrayOrObj param received type is "'+s+'". Value received: '+e);i=Object.keys(e),o=i.map(function(t){return e[t]}),e[t.Symbol.iterator]=function(){return new n(i,o)}}return e},e)module.exports=t.iterable;else if(t.ns("stdlib.iterable",t.iterable),t.isAmd)return t.iterable}(),function(){"use strict";var e="undefined",t=typeof window===e,r=t?require("../sjl.js"):window.sjl||{},n=r.ns.stdlib,i=n.Extendable,o=n.ObjectIterator,s=n.iterable,a=i.extend({constructor:function(t){var n=this,i=[];if(Object.defineProperties(this,{_values:{value:i},size:{get:function(){return i.length},enumerable:!0}}),r.classOfIs(t,"Array"))n.addFromArray(t);else if(typeof t!==e)throw new Error("Type Error: sjl.SjlSet takes only iterable objects as it's first parameter. Parameter received: ",t);s(i),n[r.Symbol.iterator]=function(){return new o(i,i)},Object.defineProperty(n,"_iteratorOverridden",{value:!0})},add:function(e){return this.has(e)||this._values.push(e),this},clear:function(){for(;this._values.length>0;)this._values.pop();return this},"delete":function(e){var t=this._values.indexOf(e);return t>-1&&t<=this._values.length&&this._values.splice(t,1),this},entries:function(){return new o(this._values,this._values,0)},forEach:function(e,t){return this._values.forEach(e,t),this},has:function(e){return this._values.indexOf(e)>-1},keys:function(){return this._values[r.Symbol.iterator]()},values:function(){return this._values[r.Symbol.iterator]()},addFromArray:function(e){for(var t=s(e,0)[r.Symbol.iterator]();t.valid();)this.add(t.next().value);return t=null,this},iterator:function(){return this._values[r.Symbol.iterator]()},toJSON:function(){return this._values}});if(t)module.exports=a;else if(r.ns("stdlib.SjlSet",a),r.isAmd)return a}(),function(){"use strict";var e="undefined",t=typeof window===e,r=t?require("../sjl.js"):window.sjl||{},n=r.ns.stdlib,i=n.Extendable,o=n.ObjectIterator,s=n.iterable,a=function(e){var t=this,n=s([]),i=s([]),a=r.classOf(e);if(Object.defineProperties(this,{_keys:{value:n},_values:{value:i},size:{get:function(){return t._keys.length},enumerable:!0}}),"Array"===a)t.addFromArray(e);else if("Object"===a)t.addFromObject(e);else if("Undefined"!==a)throw new TypeError("Type Error: sjl.stdlib.SjlMap constructor only accepts a parameter of type`Object`, `Array` or `Undefined`. Type received: ",r.classOf(e));t[r.Symbol.iterator]=function(){return new o(n,i,0)},Object.defineProperty(t,"_iteratorOverridden",{value:!0})};if(a=i.extend(a,{clear:function(){return[this._values,this._keys].forEach(function(e){for(;e.length>0;)e.pop()}),this},"delete":function(e){if(this.has(e)){var t=this._keys.indexOf(e);this._values.splice(t,1),this._keys.splice(t,1)}return this},entries:function(){return new o(this._keys,this._values,0)},forEach:function(e,t){var r=this;return r._keys.forEach(function(n,i){e.call(t,r._values[i],n)}),r},has:function(e){return this._keys.indexOf(e)>-1},keys:function(){return this._keys[r.Symbol.iterator]()},values:function(){return this._values[r.Symbol.iterator]()},get:function(e){var t=this._keys.indexOf(e);return t>-1?this._values[t]:void 0},set:function(e,t){var r=this._keys.indexOf(e);return r>-1?(this._keys[r]=e,this._values[r]=t):(this._keys.push(e),this._values.push(t)),this},addFromArray:function(e){for(var t,n=r.iterable(e,0)[r.Symbol.iterator]();n.valid();)t=n.next(),this.set(t.value[0],t.value[1]);return this},addFromObject:function(e){r.throwTypeErrorIfNotOfType(a.name,"object",e,"Object","Only `Object` types allowed.");for(var t,n=this,i=new o(e);i.valid();)t=i.next(),n.set(t.value[0],t.value[1]);return n},iterator:function(){return this.entries()},toJSON:function(){var e=this,t={};return this._keys.forEach(function(r,n){t[r]=e._values[n]}),t}}),t)module.exports=a;else if(r.ns("stdlib.SjlMap",a),r.isAmd)return a}(),function(){"use strict";var e="undefined"==typeof window,t=e?require("./../sjl.js"):window.sjl,r=t.ns.stdlib.Extendable,n=r.extend({constructor:function(e,r,n,i){var o,s,a="sjl.stdlib.PriorityListItem";Object.defineProperties(this,{key:{value:e,enumerable:!0},serial:{get:function(){return s},set:function(e){t.throwTypeErrorIfNotOfType(a,"serial",e,Number),s=e},enumerable:!0},value:{value:r,enumerable:!0},priority:{get:function(){return o},set:function(e){t.throwTypeErrorIfNotOfType(a,"priority",e,Number),o=e},enumerable:!0}}),this.priority=n,this.serial=i}});if(e)module.exports=n;else if(t.ns("stdlib.PriorityListItem",n),t.isAmd)return n}(),function(){"use strict";var e="undefined",t=typeof window===e,r=t?require("./../sjl.js"):window.sjl,n=r.ns,i=n.stdlib.ObjectIterator,o=n.stdlib.SjlMap,s=n.stdlib.Iterator,a=function u(e,t,n){var i=!1,a=0,c=0,l=r.isset(t)?t:!1,f=u.DefaultPriorityListItemConstructor,p=r.isset(n)?n:!0,y="sjl.stdlib.PriorityList",d=r.classOf(e);Object.defineProperties(this,{itemWrapperConstructor:{get:function(){return f},set:function(e){r.throwTypeErrorIfNotOfType(y,"itemWrapperConstructor",e,Function),f=e},enumerable:!0},wrapItems:{get:function(){return p},set:function(e){r.throwTypeErrorIfNotOfType(y,"wrapItems",e,Boolean),p=e},enumerable:!0},LIFO:{get:function(){return l},set:function(e){r.throwTypeErrorIfNotOfType(u.name,"LIFO",e,Boolean),l=e,this._sorted=!1},enumerable:!0},_internalSerialNumbers:{get:function(){return c},set:function(e){r.throwTypeErrorIfNotOfType(y,"__internalSerialNumbers",e,Number),c=e}},_internalPriorities:{get:function(){return a},set:function(e){r.throwTypeErrorIfNotOfType(u.name,"_internalPriorities",e,Number),a=e}},_LIFO_modifier:{get:function(){return this.LIFO?1:-1}},_sorted:{get:function(){return i},set:function(e){r.throwTypeErrorIfNotOfType(u.name,"_sorted",e,Boolean),i=e}}}),this.LIFO=l,this.wrapItems=p,o.call(this),s.call(this,this._values),"Object"===d?this.addFromObject(e):"Array"===d&&this.addFromArray(e)};if(a=o.extend(a,{current:function(){var e=s.prototype.current.call(this);return!e.done&&this.wrapItems&&(e.value=e.value.value),e},next:function(){var e=s.prototype.next.call(this);return!e.done&&this.wrapItems&&(e.value=e.value.value),e},valid:function(){return s.prototype.valid.call(this)},rewind:function(){return s.prototype.rewind.call(this)},clear:function(){return o.prototype.clear.call(this),this._sorted=!1,this},entries:function(){return this.sort().wrapItems?new i(this._keys,this._values.map(function(e){return e.value})):new o.prototype.entries.call(this.sort())},forEach:function(e,t){return o.prototype.forEach.call(this.sort(),function(r,n,i){e.call(t,this.wrapItems?r.value:r,n,i)},this),this},keys:function(){return o.prototype.keys.call(this.sort())},values:function(){return this.wrapItems?new s(this.sort()._values.map(function(e){return e.value})):new o.prototype.values.call(this.sort())},get:function(e){var t=o.prototype.get.call(this,e);return this.wrapItems&&t?t.value:t},set:function(e,t,r){return o.prototype.set.call(this,e,this.resolveItemWrapping(e,t,r)),this._sorted=!1,this},sort:function(){var e=this,t=e._LIFO_modifier;return e._sorted?e:(e._values.sort(function(e,r){var n;return n=e.priority===r.priority?e.serial>r.serial:e.priority>r.priority,(n?-1:1)*t}).forEach(function(t,r){e._keys[r]=t.key,t.serial=r}),e._sorted=!0,e.pointer=0,e)},normalizePriority:function(e){var t;return r.classOfIs(e,Number)?t=e:(this._internalPriorities+=1,t=+this._internalPriorities),t},resolveItemWrapping:function(e,t,n){var i=this.normalizePriority(n),o=this._internalSerialNumbers++;if(this.wrapItems)return new this.itemWrapperConstructor(e,t,i,o);try{t.key=e,t.priority=n,t.serial=o}catch(s){throw new TypeError('PriorityList can only work in "unwrapped" mode with values/objects that can have properties created/set on them. Type encountered: `'+r.classOf(t)+"`; Original error: "+s.message)}return t},addFromArray:function(e){return this._sorted=!1,o.prototype.addFromArray.call(this,e)},addFromObject:function(e){return this._sorted=!1,o.prototype.addFromObject.call(this,e)}}),Object.defineProperty(a,"DefaultPriorityListItemConstructor",{value:r.ns.stdlib.PriorityListItem,enumerable:!0}),t)module.exports=a;else if(r.ns("stdlib.PriorityList",a),r.isAmd)return a}();