diff --git a/hwe/b_inheritPoint.php b/hwe/b_inheritPoint.php index edc30ef6..3b15a86b 100644 --- a/hwe/b_inheritPoint.php +++ b/hwe/b_inheritPoint.php @@ -16,6 +16,8 @@ $me = General::createGeneralObjFromDB($generalID); $pointHelpText = [ + 'sum' => '다음 플레이에서 사용할 수 있는 총 포인트입니다.', + 'new' => '이번 플레이에서 얻은 총 포인트입니다.', 'previous' => '이전에 물려받은 포인트입니다.', 'lived_month' => '살아남은 기간입니다. (1개월 단위)', 'max_belong' => '가장 오래 임관했던 국가의 연도입니다.', @@ -28,7 +30,10 @@ $pointHelpText = [ 'tournament' => '토너먼트 입상 포인트입니다.', 'betting' => '성공적인 베팅을 했습니다.
수익율과 베팅 성공 횟수를 따릅니다.', ]; - +$items = []; +foreach(array_keys(General::INHERITANCE_KEY) as $key){ + $items[$key] = $me->getInheritancePoint($key)??0; +} ?> @@ -48,6 +53,10 @@ $pointHelpText = [ + @@ -59,16 +68,16 @@ $pointHelpText = [
-
+
- +
- +
@@ -76,16 +85,16 @@ $pointHelpText = [
- +
- +
-
+
@@ -94,7 +103,7 @@ $pointHelpText = [
- +

@@ -106,12 +115,12 @@ $pointHelpText = [
- +
- +
diff --git a/hwe/js/inheritPoint.js b/hwe/js/inheritPoint.js index f7f5440f..e0223ef3 100644 --- a/hwe/js/inheritPoint.js +++ b/hwe/js/inheritPoint.js @@ -1,2 +1,2 @@ -(()=>{var t={705:(t,r,e)=>{var n=e(639).Symbol;t.exports=n},239:(t,r,e)=>{var n=e(705),o=e(607),i=e(333),a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},877:t=>{var r=Math.floor,e=Math.random;t.exports=function(t,n){return t+r(e()*(n-t+1))}},98:t=>{var r=Math.ceil,e=Math.max;t.exports=function(t,n,o,i){for(var a=-1,u=e(r((n-t)/(o||1)),0),f=Array(u);u--;)f[i?u:++a]=t,t+=o;return f}},561:(t,r,e)=>{var n=e(990),o=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(o,""):t}},445:(t,r,e)=>{var n=e(98),o=e(612),i=e(601);t.exports=function(t){return function(r,e,a){return a&&"number"!=typeof a&&o(r,e,a)&&(e=a=void 0),r=i(r),void 0===e?(e=r,r=0):e=i(e),a=void 0===a?r{var n="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g;t.exports=n},607:(t,r,e)=>{var n=e(705),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=n?n.toStringTag:void 0;t.exports=function(t){var r=i.call(t,u),e=t[u];try{t[u]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(r?t[u]=e:delete t[u]),o}},776:t=>{var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&r.test(t))&&t>-1&&t%1==0&&t{var n=e(813),o=e(240),i=e(776),a=e(218);t.exports=function(t,r,e){if(!a(e))return!1;var u=typeof r;return!!("number"==u?o(e)&&i(r,e.length):"string"==u&&r in e)&&n(e[r],t)}},333:t=>{var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},639:(t,r,e)=>{var n=e(957),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},990:t=>{var r=/\s/;t.exports=function(t){for(var e=t.length;e--&&r.test(t.charAt(e)););return e}},813:t=>{t.exports=function(t,r){return t===r||t!=t&&r!=r}},240:(t,r,e)=>{var n=e(560),o=e(780);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},560:(t,r,e)=>{var n=e(239),o=e(218);t.exports=function(t){if(!o(t))return!1;var r=n(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}},780:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},218:t=>{t.exports=function(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)}},5:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},448:(t,r,e)=>{var n=e(239),o=e(5);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},608:(t,r,e)=>{var n=e(877),o=e(612),i=e(601),a=parseFloat,u=Math.min,f=Math.random;t.exports=function(t,r,e){if(e&&"boolean"!=typeof e&&o(t,r,e)&&(r=e=void 0),void 0===e&&("boolean"==typeof r?(e=r,r=void 0):"boolean"==typeof t&&(e=t,t=void 0)),void 0===t&&void 0===r?(t=0,r=1):(t=i(t),void 0===r?(r=t,t=0):r=i(r)),t>r){var c=t;t=r,r=c}if(e||t%1||r%1){var l=f();return u(t+l*(r-t+a("1e-"+((l+"").length-1))),r)}return n(t,r)}},26:(t,r,e)=>{var n=e(445)();t.exports=n},601:(t,r,e)=>{var n=e(841);t.exports=function(t){return t?Infinity===(t=n(t))||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},841:(t,r,e)=>{var n=e(561),o=e(218),i=e(448),a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,f=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(o(t)){var r="function"==typeof t.valueOf?t.valueOf():t;t=o(r)?r+"":r}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var e=u.test(t);return e||f.test(t)?c(t.slice(2),e?2:8):a.test(t)?NaN:+t}}},r={};function e(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return t[n](i,i.exports,e),i.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),(()=>{"use strict";var t=e(26),r=e.n(t),n=e(608),o=e.n(n);function i(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,f=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return u=t.done,t},e:function(t){f=!0,a=t},f:function(){try{u||null==e.return||e.return()}finally{if(f)throw a}}}}(r()(10));try{for(n.s();!(t=n.n()).done;){var a=t.value;e.push(o()()*a)}}catch(t){n.e(t)}finally{n.f()}console.log(20),console.log(e)}})()})(); +(()=>{var t={762:t=>{t.exports=function(t,e){for(var r,n=-1,o=t.length;++n{t.exports=function(t){return t}},297:(t,e,r)=>{var n=r(762),o=r(557);t.exports=function(t){return t&&t.length?n(t,o):0}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var u=e[n]={exports:{}};return t[n](u,u.exports,r),u.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(297),e=r.n(t);function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:"";return o(this,a),h(l(t=n.call(this,e)),"name","RuntimeError"),t.message=e,t}return e=a,(r=[{key:"toString",value:function(){return this.message?this.name+": "+this.message:this.name}}])&&u(e.prototype,r),a}(f(Error)));function m(t){if(null==t)throw new b;return t}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,u=[],i=!0,c=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(u.push(n.value),!e||u.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return w(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseRandom = require('./_baseRandom'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseFloat = parseFloat;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min,\n nativeRandom = Math.random;\n\n/**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\nfunction random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n}\n\nmodule.exports = random;\n","var createRange = require('./_createRange');\n\n/**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\nvar range = createRange();\n\nmodule.exports = range;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\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](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import {random, range} from \"lodash\"\n\ndeclare global {\n interface Window { formStart: any; }\n}\n\nexport {}\n\nfunction formStart() {\n console.log(window.pathConfig.root);\n\n const a = 10;\n const b:number[] = [];\n for(const v of range(10)){\n b.push(random()*v);\n }\n console.log(a + 10);\n console.log(b);\n}\n\nwindow.formStart = formStart;"],"names":["Symbol","module","exports","getRawTag","objectToString","symToStringTag","toStringTag","undefined","value","Object","nativeFloor","Math","floor","nativeRandom","random","lower","upper","nativeCeil","ceil","nativeMax","max","start","end","step","fromRight","index","length","result","Array","trimmedEndIndex","reTrimStart","string","slice","replace","baseRange","isIterateeCall","toFinite","freeGlobal","g","objectProto","prototype","hasOwnProperty","nativeObjectToString","toString","isOwn","call","tag","unmasked","e","reIsUint","type","test","eq","isArrayLike","isIndex","isObject","object","freeSelf","self","root","Function","reWhitespace","charAt","other","isFunction","isLength","baseGetTag","isObjectLike","baseRandom","freeParseFloat","parseFloat","nativeMin","min","floating","temp","rand","range","createRange","toNumber","baseTrim","isSymbol","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","valueOf","isBinary","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","defineProperty","enumerable","get","globalThis","this","window","obj","prop","formStart","console","log","pathConfig","b","v","push"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"inheritPoint.js","mappings":"qBAuBAA,EAAOC,QAdP,SAAiBC,EAAOC,GAKtB,IAJA,IAAIC,EACAC,GAAS,EACTC,EAASJ,EAAMI,SAEVD,EAAQC,GAAQ,CACvB,IAAIC,EAAUJ,EAASD,EAAMG,SACbG,IAAZD,IACFH,OAAoBI,IAAXJ,EAAuBG,EAAWH,EAASG,GAGxD,OAAOH,I,QCATJ,EAAOC,QAJP,SAAkBQ,GAChB,OAAOA,I,cCjBT,IAAIC,EAAU,EAAQ,KAClBC,EAAW,EAAQ,KAsBvBX,EAAOC,QANP,SAAaC,GACX,OAAQA,GAASA,EAAMI,OACnBI,EAAQR,EAAOS,GACf,KCnBFC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBN,IAAjBO,EACH,OAAOA,EAAad,QAGrB,IAAID,EAASY,EAAyBE,GAAY,CAGjDb,QAAS,IAOV,OAHAe,EAAoBF,GAAUd,EAAQA,EAAOC,QAASY,GAG/Cb,EAAOC,QCpBfY,EAAoBI,EAAKjB,IACxB,IAAIkB,EAASlB,GAAUA,EAAOmB,WAC7B,IAAOnB,EAAiB,QACxB,IAAM,EAEP,OADAa,EAAoBO,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRL,EAAoBO,EAAI,CAACnB,EAASqB,KACjC,IAAI,IAAIC,KAAOD,EACXT,EAAoBW,EAAEF,EAAYC,KAASV,EAAoBW,EAAEvB,EAASsB,IAC5EE,OAAOC,eAAezB,EAASsB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EV,EAAoBW,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,G,o2ECG3E,IAeMI,EAAb,yLACkB,mBADlB,YAfA,uB,IAAA,OAEI,aAAyC,MAAtBC,EAAsB,uDAAJ,GAAI,qBACrC,cAAMA,IAD+B,OAD3B,gBAC2B,EAAtBA,QAAAA,EAAsB,EAF7C,O,EAAA,G,EAAA,uBAKI,WACI,OAAIC,KAAKD,QACEC,KAAKC,KAAO,KAAOD,KAAKD,QAGxBC,KAAKC,U,iBAVxB,KAAkCC,SAmB3B,SAASC,EAAUnC,GACtB,GAAIA,MAAAA,EACA,MAAM,IAAI8B,EAEd,OAAO9B,E,87BCWXoC,OAAOC,UAzBP,WAEI,IAAMC,EAAOH,EAAOI,SAASC,cAAc,uBACrCC,EAAON,EAAOI,SAASC,cAAc,4BACrCE,EAAOP,EAAOI,SAASC,cAAc,uBAErCG,EAAWC,KAAKC,MAAM,IAAIxB,OAAOyB,OAAOV,OAAOW,SAC/CC,EAAWJ,KAAKC,MAAMT,OAAOW,MAAP,UACtBE,EAAcN,EAAWK,EAE/BV,EAAKjC,MAAQsC,EAASO,iBACtBT,EAAKpC,MAAQ2C,EAASE,iBACtBR,EAAKrC,MAAQ4C,EAAYC,iBAEzB,cAAwB7B,OAAO8B,QAAQf,OAAOW,OAA9C,eAAqD,CAAjD,gBAAO5B,EAAP,KAAYiC,EAAZ,KACcjB,EAAOI,SAASC,cAAT,mBAAmCrB,EAAnC,YACfd,MAAQuC,KAAKC,MAAMO,GAAKF,iBAGlC,cAAyB7B,OAAO8B,QAAQf,OAAOiB,UAA/C,eAAyD,CAArD,gBAAOlC,EAAP,KAAYmC,EAAZ,KACcnB,EAAOI,SAASC,cAAT,mBAAmCrB,EAAnC,sBACfoC,UAAYD,K","sources":["webpack://hidche_lib/./node_modules/lodash/_baseSum.js","webpack://hidche_lib/./node_modules/lodash/identity.js","webpack://hidche_lib/./node_modules/lodash/sum.js","webpack://hidche_lib/webpack/bootstrap","webpack://hidche_lib/webpack/runtime/compat get default export","webpack://hidche_lib/webpack/runtime/define property getters","webpack://hidche_lib/webpack/runtime/hasOwnProperty shorthand","webpack://hidche_lib/./hwe/ts/util.ts","webpack://hidche_lib/./hwe/ts/inheritPoint.ts"],"sourcesContent":["/**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\nfunction baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n}\n\nmodule.exports = baseSum;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var baseSum = require('./_baseSum'),\n identity = require('./identity');\n\n/**\n * Computes the sum of the values in `array`.\n *\n * @static\n * @memberOf _\n * @since 3.4.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {number} Returns the sum.\n * @example\n *\n * _.sum([4, 2, 8, 6]);\n * // => 20\n */\nfunction sum(array) {\n return (array && array.length)\n ? baseSum(array, identity)\n : 0;\n}\n\nmodule.exports = sum;\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](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","type ErrType = { new(msg?: string): T }\ntype Nullable = T | null | undefined\n\nexport class RuntimeError extends Error {\n public name = 'RuntimeError';\n constructor(public message: string = '') {\n super(message);\n }\n toString(): string {\n if (this.message) {\n return this.name + ': ' + this.message;\n }\n else {\n return this.name;\n }\n }\n}\n\nexport class NotNullExpected extends RuntimeError {\n public name = 'NotNullExpected';\n}\n\nexport function unwrap(result: Nullable): T {\n if (result === null || result === undefined) {\n throw new NotNullExpected();\n }\n return result;\n}\n\nexport function unwrap_err(result: Nullable, errType: ErrType, errMsg?: string): T {\n if (result === null || result === undefined) {\n throw new errType(errMsg);\n }\n return result;\n}","import { sum } from \"lodash\";\nimport { unwrap } from \"./util\";\ndeclare global {\n interface Window { \n formStart: ()=>void;\n items: {[name: string]:number};\n helpText: {[name: string]:string};\n }\n}\n\nexport {}\n\nfunction formStart() {\n\n const dSum = unwrap(document.querySelector('#inherit_sum_value')) as HTMLInputElement ;\n const dOld = unwrap(document.querySelector('#inherit_previous_value')) as HTMLInputElement;\n const dNew = unwrap(document.querySelector('#inherit_new_value')) as HTMLInputElement;\n\n const sumPoint = Math.floor(sum(Object.values(window.items)));\n const oldPoint = Math.floor(window.items['previous']);\n const sumNewPoint = sumPoint - oldPoint;\n\n dSum.value = sumPoint.toLocaleString();\n dOld.value = oldPoint.toLocaleString();\n dNew.value = sumNewPoint.toLocaleString();\n\n for(const [key, val] of Object.entries(window.items)){\n const dItem = unwrap(document.querySelector(`#inherit_${key}_value`)) as HTMLInputElement ;\n dItem.value = Math.floor(val).toLocaleString();\n }\n\n for(const [key, text] of Object.entries(window.helpText)){\n const dText = unwrap(document.querySelector(`#inherit_${key} small.form-text`)) as HTMLElement;\n dText.innerHTML = text;\n }\n}\n\nwindow.formStart = formStart;"],"names":["module","exports","array","iteratee","result","index","length","current","undefined","value","baseSum","identity","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","NotNullExpected","message","this","name","Error","unwrap","window","formStart","dSum","document","querySelector","dOld","dNew","sumPoint","Math","floor","values","items","oldPoint","sumNewPoint","toLocaleString","entries","val","helpText","text","innerHTML"],"sourceRoot":""} \ No newline at end of file diff --git a/hwe/ts/inheritPoint.ts b/hwe/ts/inheritPoint.ts index 01ee06de..07f01e30 100644 --- a/hwe/ts/inheritPoint.ts +++ b/hwe/ts/inheritPoint.ts @@ -1,21 +1,38 @@ -import {random, range} from "lodash" - +import { sum } from "lodash"; +import { unwrap } from "./util"; declare global { - interface Window { formStart: any; } + interface Window { + formStart: ()=>void; + items: {[name: string]:number}; + helpText: {[name: string]:string}; + } } export {} function formStart() { - console.log(window.pathConfig.root); - const a = 10; - const b:number[] = []; - for(const v of range(10)){ - b.push(random()*v); + const dSum = unwrap(document.querySelector('#inherit_sum_value')) as HTMLInputElement ; + const dOld = unwrap(document.querySelector('#inherit_previous_value')) as HTMLInputElement; + const dNew = unwrap(document.querySelector('#inherit_new_value')) as HTMLInputElement; + + const sumPoint = Math.floor(sum(Object.values(window.items))); + const oldPoint = Math.floor(window.items['previous']); + const sumNewPoint = sumPoint - oldPoint; + + dSum.value = sumPoint.toLocaleString(); + dOld.value = oldPoint.toLocaleString(); + dNew.value = sumNewPoint.toLocaleString(); + + for(const [key, val] of Object.entries(window.items)){ + const dItem = unwrap(document.querySelector(`#inherit_${key}_value`)) as HTMLInputElement ; + dItem.value = Math.floor(val).toLocaleString(); + } + + for(const [key, text] of Object.entries(window.helpText)){ + const dText = unwrap(document.querySelector(`#inherit_${key} small.form-text`)) as HTMLElement; + dText.innerHTML = text; } - console.log(a + 10); - console.log(b); } window.formStart = formStart; \ No newline at end of file diff --git a/hwe/ts/util.ts b/hwe/ts/util.ts new file mode 100644 index 00000000..99a04ab5 --- /dev/null +++ b/hwe/ts/util.ts @@ -0,0 +1,35 @@ +type ErrType = { new(msg?: string): T } +type Nullable = T | null | undefined + +export class RuntimeError extends Error { + public name = 'RuntimeError'; + constructor(public message: string = '') { + super(message); + } + toString(): string { + if (this.message) { + return this.name + ': ' + this.message; + } + else { + return this.name; + } + } +} + +export class NotNullExpected extends RuntimeError { + public name = 'NotNullExpected'; +} + +export function unwrap(result: Nullable): T { + if (result === null || result === undefined) { + throw new NotNullExpected(); + } + return result; +} + +export function unwrap_err(result: Nullable, errType: ErrType, errMsg?: string): T { + if (result === null || result === undefined) { + throw new errType(errMsg); + } + return result; +} \ No newline at end of file