UNPKG

fortel-ziweidoushu

Version:
1 lines 649 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["fortel-ziweidoushu"]=t():e["fortel-ziweidoushu"]=t()}(self,(()=>(()=>{var e={924:(e,t,r)=>{"use strict";var n=r(210),i=r(559),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},559:(e,t,r)=>{"use strict";var n=r(612),i=r(210),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),c=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=s(n,a,arguments);return c&&u&&c(t,"length").configurable&&u(t,"length",{value:1+l(0,e.length-(arguments.length-1))}),t};var f=function(){return s(n,o,arguments)};u?u(e.exports,"apply",{value:f}):e.exports.apply=f},29:(e,t,r)=>{"use strict";var n=r(320),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a):"string"==typeof e?function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,a):function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a)}},648:e=>{"use strict";var t=Array.prototype.slice,r=Object.prototype.toString;e.exports=function(e){var n=this;if("function"!=typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i,o=t.call(arguments,1),a=Math.max(0,n.length-o.length),s=[],c=0;c<a;c++)s.push("$"+c);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var r=n.apply(this,o.concat(t.call(arguments)));return Object(r)===r?r:this}return n.apply(e,o.concat(t.call(arguments)))})),n.prototype){var u=function(){};u.prototype=n.prototype,i.prototype=new u,u.prototype=null}return i}},612:(e,t,r)=>{"use strict";var n=r(648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var u=function(){throw new a},l=c?function(){try{return u}catch(e){try{return c(arguments,"callee").get}catch(e){return u}}}():u,f=r(405)(),S=Object.getPrototypeOf||function(e){return e.__proto__},d={},b="undefined"==typeof Uint8Array?n:S(Uint8Array),_={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f?S([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?S(S([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?S((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?S((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?S(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":b,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=function e(t){var r;if("%AsyncFunction%"===t)r=s("async function () {}");else if("%GeneratorFunction%"===t)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=s("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=S(i.prototype))}return _[t]=r,r},R={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},T=r(612),A=r(642),I=T.call(Function.call,Array.prototype.concat),p=T.call(Function.apply,Array.prototype.splice),M=T.call(Function.call,String.prototype.replace),g=T.call(Function.call,String.prototype.slice),h=T.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,N=function(e,t){var r,n=e;if(A(R,n)&&(n="%"+(r=R[n])[0]+"%"),A(_,n)){var o=_[n];if(o===d&&(o=y(n)),void 0===o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===h(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=g(e,0,1),r=g(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return M(e,E,(function(e,t,r,i){n[n.length]=r?M(i,O,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",o=N("%"+n+"%",t),s=o.name,u=o.value,l=!1,f=o.alias;f&&(n=f[0],p(r,I([0,1],f)));for(var S=1,d=!0;S<r.length;S+=1){var b=r[S],y=g(b,0,1),R=g(b,-1);if(('"'===y||"'"===y||"`"===y||'"'===R||"'"===R||"`"===R)&&y!==R)throw new i("property names with quotes must have matching quotes");if("constructor"!==b&&d||(l=!0),A(_,s="%"+(n+="."+b)+"%"))u=_[s];else if(null!=u){if(!(b in u)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&S+1>=r.length){var T=c(u,b);u=(d=!!T)&&"get"in T&&!("originalValue"in T.get)?T.get:u[b]}else d=A(u,b),u=u[b];d&&!l&&(_[s]=u)}}return u}},296:(e,t,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},410:(e,t,r)=>{"use strict";var n=r(419);e.exports=function(){return n()&&!!Symbol.toStringTag}},642:(e,t,r)=>{"use strict";var n=r(612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},584:(e,t,r)=>{"use strict";var n=r(410)(),i=r(924)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},320:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var S=document.all;c.call(S)===c.call(document.all)&&(f=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(u)return s(e);if(a(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},662:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(410)(),c=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!c)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&c(t)}return c(e)===n}},692:(e,t,r)=>{"use strict";var n=r(29),i=r(83),o=r(924),a=o("Object.prototype.toString"),s=r(410)(),c=r(296),u="undefined"==typeof globalThis?r.g:globalThis,l=i(),f=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},S=o("String.prototype.slice"),d={},b=Object.getPrototypeOf;s&&c&&b&&n(l,(function(e){var t=new u[e];if(Symbol.toStringTag in t){var r=b(t),n=c(r,Symbol.toStringTag);if(!n){var i=b(r);n=c(i,Symbol.toStringTag)}d[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!s||!(Symbol.toStringTag in e)){var t=S(a(e),8,-1);return f(l,t)>-1}return!!c&&function(e){var t=!1;return n(d,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,c=[],u=!1,l=-1;function f(){u&&s&&(u=!1,s.length?c=s.concat(c):l=-1,c.length&&S())}function S(){if(!u){var e=a(f);u=!0;for(var t=c.length;t;){for(s=c,c=[];++l<t;)s&&s[l].run();l=-1,t=c.length}s=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function b(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new d(e,t)),1!==c.length||u||a(S)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=b,n.addListener=b,n.once=b,n.off=b,n.removeListener=b,n.removeAllListeners=b,n.emit=b,n.prependListener=b,n.prependOnceListener=b,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},570:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.CalendarType=void 0,function(e){e.LUNAR="LUNAR",e.SOLAR="SOLAR"}(r||(t.CalendarType=r={}))},553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultCalendar=void 0;const n=r(770),i=r(420),o=r(178),a={solar2lunar:function(e,t,r){const a=n.calendar.solar2lunar(e,t,r);if(this.solarMonthDays(e,t)<r)throw new Error("Invalid date");if(-1!==a)return{lunarYear:a.lYear,lunarMonth:a.lMonth,lunarDay:a.lDay,isLeapMonth:a.isLeap,yearSky:o.Sky.getByName(a.gzYear[0]),yearGround:i.Ground.getByName(a.gzYear[1]),monthSky:o.Sky.getByName(a.gzMonth[0]),monthGround:i.Ground.getByName(a.gzMonth[1]),daySky:o.Sky.getByName(a.gzDay[0]),dayGround:i.Ground.getByName(a.gzDay[1])};throw new Error("Invalid date")},lunar2solar:function(e,t,r,i){if(this.lunarMonthDays(e,t,i)<r)throw new Error("Invalid date");const o=n.calendar.lunar2solar(e,t,r,i);if(-1!==o)return{solarYear:o.cYear,solarMonth:o.cMonth,solarDay:o.cDay};throw new Error("Invalid date")},lunarSkyGround:function(e,t,r,a){const s=n.calendar.lunar2solar(e,t,r,a);if(-1!==s)return{yearSky:o.Sky.getByName(s.gzYear[0]),yearGround:i.Ground.getByName(s.gzYear[1]),monthSky:o.Sky.getByName(s.gzMonth[0]),monthGround:i.Ground.getByName(s.gzMonth[1]),daySky:o.Sky.getByName(s.gzDay[0]),dayGround:i.Ground.getByName(s.gzDay[1])};throw new Error("Invalid date")},lunarMonthDays:function(e,t,r){if(r){if(n.calendar.leapMonth(e)!=t)throw new Error("Invalid date");return n.calendar.leapDays(e)}return n.calendar.monthDays(e,t)},solarMonthDays:function(e,t){return n.calendar.solarDays(e,t)}};t.defaultCalendar=a},790:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CellsScope=t.BoardCriteria=void 0;const n=r(641),i=r(165),o=r(160),a=r(497),s=r(108),c=r(593);var u;!function(e){e.SELF="SELF",e.OPPOSITE="OPPOSITE",e.SELF_OPPOSITE="OPPOSITE",e.SUPPORT="SUPPORT",e.TRIANGLE="TRIANGLE",e.FOUR="FOUR"}(u||(t.CellsScope=u={}));class l{#e;#t;#r;constructor(e,t,r=u.SELF){this.#e=e,this.#t=t??e.destinyTempleCellGround,this.#r=r}ofDestinyTemple(){return new l(this.#e,this.#e.destinyTempleCellGround,this.#r)}ofTemple(e){return new l(this.#e,this.#e.getCellByTemple(e).ground,this.#r)}ofGroundCell(e){return new l(this.#e,e,this.#r)}ofCell(e){return new l(this.#e,e.ground,this.#r)}ofStar(e){const t=this.#e.cells.find((t=>t.hasStarInstance(e)));if(!t)throw new Error("Star not found");return new l(this.#e,t.ground,this.#r)}withCellsType(e){return new l(this.#e,this.#t,e)}get#n(){return this.#e.getCellByGround(this.#t)}static allStarsNameToKeyMap=[...n.MajorStar.stars,...o.MinorStar.stars,...i.MiniStar.allStars].reduce(((e,t)=>(e[t.getDisplayName()]||(e[t.getDisplayName()]=t.getKey()),e)),{});hasStar(e){return l.#i(this.#o,e)}hasAllStars(e){return l.#a(this.#o,e)}hasAnyStars(e){return l.#s(this.#o,e)}notFoundStar(e){return l.#c(this.#o,e)}notFoundAllStars(e){return l.#u(this.#o,e)}notFoundAnyStars(e){return l.#l(this.#o,e)}get#o(){switch(this.#r){case u.SELF:return this.#n.selfWithBorrow;case u.OPPOSITE:return this.#n.oppositeCellWithBorrow;case u.SELF_OPPOSITE:return this.#n.selfOppositeCellsWithBorrow;case u.SUPPORT:return this.#n.supportCellsWithBorrow;case u.TRIANGLE:return this.#n.triangleCellsWithBorrow;case u.FOUR:return this.#n.fourCellsWithBorrow;default:throw new Error("unknown cells type")}}static#i(e,t){return!!e.find((e=>e.hasStar(t)))}static#a(e,t){for(const r of t)if(!e.find((e=>e.hasStar(r))))return!1;return!0}static#s(e,t){for(const r of t)if(e.find((e=>e.hasStar(r))))return!0;return!1}static#c(e,t){return!l.#i(e,t)}static#u(e,t){return!l.#s(e,t)}static#l(e,t){return!l.#a(e,t)}static fromDescription(e,t){let r=null,f=null,S=[];const d=[];let b=!1;(!f&&t.includes("入命")||t.includes("在命"))&&(r=e.getCellByTemple(s.Temple.TEMPLE_DESTINY),f=u.SELF),!f&&t.includes("三方四正")&&(f=u.FOUR);const _=(0,c.str2Uni)("宮");{const n=t.match(new RegExp(`.*?(.{1,2}${_})`,"u"));if(n&&n[1]){const i=s.Temple.TEMPLES.find((e=>n[1].includes(e.getDisplayName())));i&&(r=e.getCellByTemple(i),t.match(new RegExp(`${(0,c.str2Uni)("入")}(.{1,2})${_}`,"u"))&&(f=u.SELF),t.match(new RegExp(`${(0,c.str2Uni)("在")}(.{1,2})${_}`,"u"))&&(f=u.SELF))}}!f&&t.includes("在")&&(f=u.SELF),!f&&t.includes("有")&&(f=u.SELF),!f&&t.includes("見")&&(f=u.FOUR),!f&&t.includes("會")&&(f=u.FOUR),S=Object.keys(l.allStarsNameToKeyMap).filter((e=>t.includes(e))).map((e=>{const t=l.allStarsNameToKeyMap[e];return n.MajorStar.getByKey(t)??o.MinorStar.getByKey(t)??i.MiniStar.getByKey(t)})).filter((e=>e)),t.includes("火")&&S.push(o.MinorStar.MINOR_STAR_BURNING),t.includes("鈴")&&S.push(o.MinorStar.MINOR_STAR_HIDDEN_FIRE),t.includes("羊")&&S.push(o.MinorStar.MINOR_STAR_COMPETITION),t.includes("陀")&&S.push(o.MinorStar.MINOR_STAR_HINDRANCE);{const e=t.match(new RegExp(`${(0,c.str2Uni)("見")}${(0,c.str2Uni)("祿")}(${(0,c.str2Uni)("存")})?`,"u"));e&&(f=u.FOUR,e[1]||(b=!0))}t.includes("化祿")&&d.push(a.StarDerivative.WEALTHINESS),t.includes("科")&&d.push(a.StarDerivative.FAME),t.includes("忌")&&d.push(a.StarDerivative.PROBLEM),r||(r=e.getCellByTemple(s.Temple.TEMPLE_DESTINY)),f||(f=u.SELF);const y=d.map((t=>e.bornStarDerivativeMap.get(t))),R=new l(e).ofCell(r).withCellsType(f);return b?(S=S.filter((e=>!e.equals(o.MinorStar.MINOR_STAR_EARN))),R.hasAllStars(S)&&R.hasAnyStars([o.MinorStar.MINOR_STAR_EARN,e.bornStarDerivativeMap.get(a.StarDerivative.WEALTHINESS)])):R.hasAllStars([...S,...y])}}t.BoardCriteria=l},519:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.starByKey=t.starByName=t.CalendarType=t.defaultCalendar=t.Direction=t.ShadowLight=t.Luckiness=t.Element=t.LifeStage=t.Runtime=t.StarDerivative=t.MiniStar=t.MinorStar=t.MajorStar=t.Temple=t.BorrowCell=t.Cell=t.DestinyBoard=t.Ground=t.Sky=t.CellsScope=t.BoardCriteria=t.destinyConfigTextParser=t.DestinyConfigBuilder=t.DayTimeGround=t.Gender=t.ConfigType=t.DestinyConfig=void 0;const n=r(570);Object.defineProperty(t,"CalendarType",{enumerable:!0,get:function(){return n.CalendarType}});const i=r(553);Object.defineProperty(t,"defaultCalendar",{enumerable:!0,get:function(){return i.defaultCalendar}});const o=r(790);Object.defineProperty(t,"BoardCriteria",{enumerable:!0,get:function(){return o.BoardCriteria}}),Object.defineProperty(t,"CellsScope",{enumerable:!0,get:function(){return o.CellsScope}});const a=r(442);Object.defineProperty(t,"DestinyConfigBuilder",{enumerable:!0,get:function(){return a.DestinyConfigBuilder}});const s=r(652);Object.defineProperty(t,"Cell",{enumerable:!0,get:function(){return s.Cell}}),Object.defineProperty(t,"BorrowCell",{enumerable:!0,get:function(){return s.BorrowCell}});const c=r(897);Object.defineProperty(t,"DayTimeGround",{enumerable:!0,get:function(){return c.DayTimeGround}});const u=r(94);Object.defineProperty(t,"DestinyBoard",{enumerable:!0,get:function(){return u.DestinyBoard}});const l=r(920);Object.defineProperty(t,"ConfigType",{enumerable:!0,get:function(){return l.ConfigType}}),Object.defineProperty(t,"DestinyConfig",{enumerable:!0,get:function(){return l.DestinyConfig}}),Object.defineProperty(t,"Gender",{enumerable:!0,get:function(){return l.Gender}});const f=r(420);Object.defineProperty(t,"Ground",{enumerable:!0,get:function(){return f.Ground}});const S=r(290);Object.defineProperty(t,"LifeStage",{enumerable:!0,get:function(){return S.LifeStage}});const d=r(641);Object.defineProperty(t,"MajorStar",{enumerable:!0,get:function(){return d.MajorStar}});const b=r(165);Object.defineProperty(t,"MiniStar",{enumerable:!0,get:function(){return b.MiniStar}});const _=r(160);Object.defineProperty(t,"MinorStar",{enumerable:!0,get:function(){return _.MinorStar}});const y=r(56);Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return y.Element}}),Object.defineProperty(t,"Direction",{enumerable:!0,get:function(){return y.Direction}}),Object.defineProperty(t,"Luckiness",{enumerable:!0,get:function(){return y.Luckiness}}),Object.defineProperty(t,"ShadowLight",{enumerable:!0,get:function(){return y.ShadowLight}});const R=r(306);Object.defineProperty(t,"Runtime",{enumerable:!0,get:function(){return R.Runtime}});const T=r(178);Object.defineProperty(t,"Sky",{enumerable:!0,get:function(){return T.Sky}});const A=r(497);Object.defineProperty(t,"StarDerivative",{enumerable:!0,get:function(){return A.StarDerivative}});const I=r(108);Object.defineProperty(t,"Temple",{enumerable:!0,get:function(){return I.Temple}});const p=r(997);Object.defineProperty(t,"destinyConfigTextParser",{enumerable:!0,get:function(){return p.destinyConfigTextParser}});const M=r(329);Object.defineProperty(t,"starByName",{enumerable:!0,get:function(){return M.starByName}}),Object.defineProperty(t,"starByKey",{enumerable:!0,get:function(){return M.starByKey}})},652:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.BorrowCell=t.Cell=void 0;const i=r(641),o=n(r(539)),a=r(593);class s{#f;#S;#d=[];#b=[];#_=[];#y=[];#R=[];#T;#A;#I;#p;#M;#g;#h;#E;constructor(e,t){this.#f=e,this.#S=t}get sky(){return this.#f}get ground(){return this.#S}get temples(){return this.#d}get majorStars(){return this.#b}get minorStars(){return this.#_}get miniStars(){return this.#y}get allStars(){return[...this.#b,...this.#_,...this.allMiniStars]}get allMiniStars(){return[...this.#y,this.#I,this.#A,this.#T]}get borrowCells(){return this.#R}get leaderStar(){if(this.#T)return this.#T;throw new Error("Leader Star not found.")}set leaderStar(e){this.#T=e}get yearGodStar(){if(this.#A)return this.#A;throw new Error("Year God Star not found.")}set yearGodStar(e){this.#A=e}get scholarStar(){if(this.#I)return this.#I;throw new Error("Scholar Star not found.")}set scholarStar(e){this.#I=e}get ageStart(){if(void 0!==this.#p)return this.#p;throw new Error("Age Start not found.")}set ageStart(e){this.#p=e}get ageEnd(){if(void 0!==this.#p)return this.#p+9;throw new Error("Age End not found.")}get lifeStage(){if(void 0!==this.#M)return this.#M;throw new Error("Life Stage not found.")}set lifeStage(e){this.#M=e}get cellIndex(){if(void 0!==this.#g)return this.#g;throw new Error("Cell Index not found.")}set cellIndex(e){this.#g=e}get prevCell(){if(void 0!==this.#h)return this.#h;throw new Error("prevCell not found.")}set prevCell(e){this.#h=e}get nextCell(){if(void 0!==this.#E)return this.#E;throw new Error("nextCell not found.")}set nextCell(e){this.#E=e}get self(){return this}getPrevICell(e){if(e<0)return this.getNextICell(-e);let t=this.self;for(let r=0;r<e;r++){if(void 0===t.prevCell)throw new Error("Prev Cell not defined!");t=t.prevCell}return t}getNextICell(e){if(e<0)return this.getPrevICell(-e);let t=this.self;for(let r=0;r<e;r++){if(void 0===t.nextCell)throw new Error("Next Cell not defined!");t=t.nextCell}return t}getCellNextDist(e){return(0,a.mod)(e.cellIndex-this.cellIndex,12)}getCellPrevDist(e){return(0,a.mod)(this.cellIndex-e.cellIndex,12)}getCellDist(e){const t=this.getCellNextDist(e);return Math.min(t,12-t)}[o.default.inspect.custom](e,t){return o.default.inspect(this.toJSON(),t)}toJSON(){return{sky:this.#f,ground:this.#S,temples:this.#d,majorStars:this.#b,minorStars:this.#_,miniStars:this.#y,miscStars:this.allMiniStars,ageStart:this.#p,ageEnd:this.#p?this.ageEnd:void 0,lifeStage:this.#M}}toString(){return`Cell {${this.sky.displayName}${this.ground.displayName}, temples=[${this.temples}], majorStars=[${this.majorStars?.map((e=>e.displayName+" "+i.MajorStar.majorStarPlacers.get(e)?.evalEnergyLevel(this.ground)))}], minorStars=[${this.minorStars}], miniStars=[${this.miniStars}], miscStars=[${[this.#I,this.#A,this.#T]}], ageRange=[${this.#p??""}-${this.#p?this.#p+9:""}], lifeStage=[${this.#M??""}]}`}equals(e){return this===e||this.toJSON()===e.toJSON()}get selfWithBorrow(){return[this,...this.#R.map((e=>e.cell))]}get oppositeCell(){return this.getNextICell(6)}get oppositeCellWithBorrow(){return this.oppositeCell.selfWithBorrow}get selfOppositeCells(){return[this,this.oppositeCell]}get selfOppositeCellsWithBorrow(){return s.cellsWithBorrowCells([this,this.oppositeCell])}get supportCells(){return[this.getNextICell(4),this.getPrevICell(4)]}get supportCellsWithBorrow(){return s.cellsWithBorrowCells(this.supportCells)}get triangleCells(){return[this,...this.supportCells]}get triangleCellsWithBorrow(){return s.cellsWithBorrowCells(this.triangleCells)}get fourCells(){return[this,this.oppositeCell,...this.supportCells]}get fourCellsWithBorrow(){return s.cellsWithBorrowCells(this.fourCells)}static cellsWithBorrowCells(e){return e.flatMap((e=>[e,...e.#R.map((e=>e.cell))])).filter(((e,t,r)=>r.indexOf(e)===t))}hasMajorMinorStar(e){return!!(this.#b.find((t=>t.equals(e)))??this.#_.find((t=>t.equals(e))))}hasStarInstance(e){return!!(this.#b.find((t=>t.equals(e)))??this.#_.find((t=>t.equals(e)))??this.allMiniStars.find((t=>t.equals(e))))}hasStar(e){return!!(this.#b.find((t=>t.equals(e)))??this.#_.find((t=>t.equals(e)))??this.allMiniStars.find((t=>t.getDisplayName()===e.getDisplayName())))}hasAllStars(e){for(const t of e)if(!this.hasStar(t))return!1;return!0}hasAnyStars(e){for(const t of e)if(this.hasStar(t))return!0;return!1}hasTemple(e){return!!this.temples.find((t=>t.equals(e)))}}t.Cell=s,t.BorrowCell=class{cell;cellRatio;constructor(e,t){this.cell=e,this.cellRatio=t}}},897:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DAY_TIME_GROUNDS=t.DayTimeGround=void 0;const i=r(420),o=r(593),a=n(r(539));class s{index;displayName;ground;hourStart;hourEnd;constructor(e,t,r,n,i){this.index=e,this.displayName=t,this.ground=r,this.hourStart=n,this.hourEnd=i}toJSON(){return this.displayName}toString(){return this.displayName}[a.default.inspect.custom](e,t){return this.toString()}static get(e){return c[(0,o.mod)(e,c.length)]}static getByName(e){const t=c.filter((t=>t.displayName===e))[0];if(t)return t;throw new Error("Not found")}static getByStartHour(e){const t=c.filter((t=>t.hourStart===e))[0];if(t)return t;throw new Error("Not found")}static getByHour(e){const t=c.filter((t=>t.hourStart<=e&&e<t.hourEnd))[0];if(t)return t;throw new Error("Not found")}static values(){return c}}t.DayTimeGround=s;const c=Object.freeze([Object.freeze(new s(0,"早子時",i.Ground.get(0),0,1)),...i.Ground.GROUNDS.slice(1).map((e=>{const t=e.index;return Object.freeze(new s(t,e.displayName+"時",e,2*t-1,1+2*t))})),Object.freeze(new s(12,"夜子時",i.Ground.get(0),23,24))]);t.DAY_TIME_GROUNDS=c},94:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DestinyBoard=void 0;const i=r(593),o=r(652),a=r(920),s=r(420),c=r(290),u=r(641),l=r(165),f=r(160),S=r(56),d=r(178),b=r(497),_=r(108),y=n(r(539)),R=r(519);class T{config;element;#O;#N;#m;#v=[];#L;#G=new Map;constructor(e){this.config=e,this.element=S.Element.FIRE,this.#w(),this.#C(),this.#D(),this.#P(),this.#j(),this.#U(),this.#B(),this.#x(),this.#k(),this.#z(),this.#K(),this.#F(),Object.freeze(this)}get destinyMaster(){if(void 0!==this.#O)return this.#O;throw new Error("destinyMaster not defined.")}get bodyMaster(){if(void 0!==this.#N)return this.#N;throw new Error("bodyMaster not defined.")}get startControl(){if(void 0!==this.#m)return this.#m;throw new Error("startControl not defined.")}get destinyTempleCellGround(){if(void 0!==this.#L)return this.#L;throw new Error("destinyTempleCellGround not defined.")}get cells(){return this.#v}get bornStarDerivativeMap(){return this.#G}#w(){this.#m=this.config.bornTimeGround.ground.shift(1-this.config.getLogicalMonth())}#C(){this.#O=[u.MajorStar.MAJOR_STAR_GREED,u.MajorStar.MAJOR_STAR_ARGUMENT,f.MinorStar.MINOR_STAR_EARN,f.MinorStar.MINOR_STAR_SKILL,u.MajorStar.MAJOR_STAR_FIRE,u.MajorStar.MAJOR_STAR_GOLD,u.MajorStar.MAJOR_STAR_PIONEER,u.MajorStar.MAJOR_STAR_GOLD,u.MajorStar.MAJOR_STAR_FIRE,f.MinorStar.MINOR_STAR_SKILL,f.MinorStar.MINOR_STAR_EARN,u.MajorStar.MAJOR_STAR_ARGUMENT][this.config.yearGround.index],this.#N=[f.MinorStar.MINOR_STAR_BURNING,u.MajorStar.MAJOR_STAR_SUPPORT,u.MajorStar.MAJOR_STAR_RULE,u.MajorStar.MAJOR_STAR_ENJOYMENT,f.MinorStar.MINOR_STAR_CLEVER,u.MajorStar.MAJOR_STAR_CHANGE,f.MinorStar.MINOR_STAR_BURNING,u.MajorStar.MAJOR_STAR_SUPPORT,u.MajorStar.MAJOR_STAR_RULE,u.MajorStar.MAJOR_STAR_ENJOYMENT,f.MinorStar.MINOR_STAR_CLEVER,u.MajorStar.MAJOR_STAR_CHANGE][this.config.yearGround.index]}#D(){const e=[],t=[];for(let e=0;e<12;e++){const r=new o.Cell(d.Sky.get(this.config.yearSky.index%5*2+2+e),s.Ground.get(e+2));t.push(r)}for(let r=-2;r<10;r++){const n=t[(0,i.mod)(r,12)];n.cellIndex=e.length,n.prevCell=t[(0,i.mod)(r-1,12)],n.nextCell=t[(0,i.mod)(r+1,12)],e.push(t[(0,i.mod)(r,12)])}this.#v=e}#P(){const e=this.config.bornTimeGround.ground.shift(2+this.config.getLogicalMonth()-1);let t;switch(this.config.configType){case a.ConfigType.GROUND:t=e;break;case a.ConfigType.HUMAN:t=s.Ground.get(2-this.config.bornTimeGround.ground.index+this.config.getLogicalMonth()-1+2);break;case a.ConfigType.SKY:default:t=s.Ground.get(2-this.config.bornTimeGround.ground.index+this.config.getLogicalMonth()-1)}this.#L=t,this.getCellByGround(t).temples.push(_.Temple.TEMPLE_DESTINY),this.getCellByGround(e).temples.push(_.Temple.TEMPLE_BODY);for(let e=_.Temple.LOOP_TEMPLES.indexOf(_.Temple.TEMPLE_BROTHER);e<_.Temple.LOOP_TEMPLES.length;e++){const r=s.Ground.get(t.index-e);this.getCellByGround(r).temples.push(_.Temple.LOOP_TEMPLES[e])}}#F(){for(const e of this.#v)0==e.majorStars.length&&(0==e.getNextICell(4).majorStars.length?e.borrowCells.push(Object.freeze(new o.BorrowCell(e.getNextICell(6),54.26)),Object.freeze(new o.BorrowCell(e.getPrevICell(4),32.45)),Object.freeze(new o.BorrowCell(e.getPrevICell(2),13.29))):0==e.getPrevICell(4).majorStars.length?e.borrowCells.push(Object.freeze(new o.BorrowCell(e.getNextICell(6),54.26)),Object.freeze(new o.BorrowCell(e.getNextICell(4),32.45)),Object.freeze(new o.BorrowCell(e.getNextICell(2),13.29))):e.borrowCells.push(Object.freeze(new o.BorrowCell(e.getNextICell(6),51)),Object.freeze(new o.BorrowCell(e.getNextICell(4),24.5)),Object.freeze(new o.BorrowCell(e.getPrevICell(4),24.5))))}#j(){const e=this.getCellByTemple(_.Temple.TEMPLE_DESTINY),t=Math.round(Math.floor(e.sky.index/2)),r=Math.round(Math.floor(e.ground.index/2));if(t>=0&&t<5&&r>=0&&r<6){const e=[[S.Element.GOLD,S.Element.WATER,S.Element.FIRE,S.Element.GOLD,S.Element.WATER,S.Element.FIRE],[S.Element.WATER,S.Element.FIRE,S.Element.EARTH,S.Element.WATER,S.Element.FIRE,S.Element.EARTH],[S.Element.FIRE,S.Element.EARTH,S.Element.WOOD,S.Element.FIRE,S.Element.EARTH,S.Element.WOOD],[S.Element.EARTH,S.Element.WOOD,S.Element.GOLD,S.Element.EARTH,S.Element.WOOD,S.Element.GOLD],[S.Element.WOOD,S.Element.GOLD,S.Element.WATER,S.Element.WOOD,S.Element.GOLD,S.Element.WATER]];this.element=e[t][r]}}#U(){let e;e=this.element==S.Element.WATER?s.Ground.get(8):this.element==S.Element.WOOD?s.Ground.get(11):this.element==S.Element.GOLD?s.Ground.get(5):this.element==S.Element.EARTH?s.Ground.get(8):s.Ground.get(2);const t=this.configDirection,r=this.getCellByGround(e);for(let e=0;e<this.#v.length;e++)r.getNextICell(e*t.direction).lifeStage=c.LifeStage.values[e]}#B(){const e=this.configDirection,t=this.element.patternNumber,r=this.getCellByTemple(_.Temple.TEMPLE_DESTINY);for(let n=0;n<this.#v.length;n++)r.getNextICell(n*e.direction).ageStart=t+10*n}#x(){for(const[e,t]of u.MajorStar.majorStarPlacers.entries()){const r=t.evalGround(this);this.getCellByGround(r).majorStars.push(e)}}#k(){for(const[e,t]of f.MinorStar.minorStarPlacers.entries()){const r=t.evalGround(this);this.getCellByGround(r).minorStars.push(e)}}#z(){for(const e of l.MiniStar.stars){const t=l.MiniStar.miniStarPlacers.get(e);if(!t)throw new Error("miniStarPlacer not found");const r=t.evalGround(this);this.getCellByGround(r).miniStars.push(e)}for(const e of l.MiniStar.twelveScholarStars){const t=l.MiniStar.miniStarPlacers.get(e);if(!t)throw new Error("miniStarPlacer not found");const r=t.evalGround(this);this.getCellByGround(r).scholarStar=e}for(const e of l.MiniStar.twelveYearGodStars){const t=l.MiniStar.miniStarPlacers.get(e);if(!t)throw new Error("miniStarPlacer not found");const r=t.evalGround(this);this.getCellByGround(r).yearGodStar=e}for(const e of l.MiniStar.twelveLeaderStars){const t=l.MiniStar.miniStarPlacers.get(e);if(!t)throw new Error("miniStarPlacer not found");const r=t.evalGround(this);this.getCellByGround(r).leaderStar=e}}#K(){this.#G.set(b.StarDerivative.WEALTHINESS,b.StarDerivative.getWealthinessStar(this.config.yearSky)),this.#G.set(b.StarDerivative.POWER,b.StarDerivative.getPowerStar(this.config.yearSky)),this.#G.set(b.StarDerivative.FAME,b.StarDerivative.getFameStar(this.config.yearSky)),this.#G.set(b.StarDerivative.PROBLEM,b.StarDerivative.getProblemStar(this.config.yearSky)),Object.freeze(this.#G)}getCellByGround(e){return this.#v[e.index]}getCellByTemple(e){const t=this.#v.find((t=>t.temples.map((e=>e.key)).includes(e.key)));if(t)return t;throw new Error("Cannot find cell")}getCellByStar(e){const t=this.cells.find((t=>t.allStars.includes(e)));if(!t)throw new Error("Cannot find cell");return t}getTenYearSky(e){const t=this.configDirection.direction,r=this.getCellByTemple(_.Temple.TEMPLE_DESTINY),n=r.getNextICell(-1*t).ageEnd,o=(0,i.mod)(e,n);let a;for(let e=0;e<this.#v.length;e++){const n=r.getNextICell(e*t);if(o<=n.ageEnd){a=n;break}}if(a)return a.sky;throw new Error("Cannot find ten year sky for unknown reason.")}getTenYearCellGround(e){const t=this.configDirection.direction,r=this.getCellByTemple(_.Temple.TEMPLE_DESTINY),n=r.getNextICell(-1*t).ageEnd,o=(0,i.mod)(e,n);let a;for(let e=0;e<this.#v.length;e++){const n=r.getNextICell(e*t);if(o<=n.ageEnd){a=n;break}}if(a)return a.ground;throw new Error("Cannot find ten year ground for unknown reason.")}getRuntimContext({lunarYear:e,lunarMonth:t,lunarDay:r,leap:n,calendar:i}){i=i??R.defaultCalendar;const o=e-this.config.year+1,a=this.getTenYearCellGround(o),c={age:o,effectiveMonth:t+(n&&r>15?1:0),tenYearGround:a,tenYearSky:this.getCellByGround(a).sky,...i.lunarSkyGround(e,t,r,n)};c.monthSky=d.Sky.get((2*(c.yearSky.index%5+1)+(c.effectiveMonth-1))%10),c.monthGround=s.Ground.get(c.effectiveMonth+1);const u={tenYear:{cellGround:null,groundStars:null,starDerivativeMap:null},year:{cellGround:null,groundStars:null,starDerivativeMap:null},month:{cellGround:null,groundStars:null,starDerivativeMap:null},day:{cellGround:null,groundStars:null,starDerivativeMap:null}};return u.tenYear.cellGround=c.tenYearGround,u.tenYear.groundStars=R.Runtime.getRuntimeLocationStars(c.tenYearSky),u.tenYear.starDerivativeMap=R.Runtime.getStarToDerivativeMapOf(c.tenYearSky),u.year.cellGround=c.yearGround,u.year.groundStars=R.Runtime.getRuntimeLocationStars(c.yearSky),u.year.starDerivativeMap=R.Runtime.getStarToDerivativeMapOf(c.yearSky),u.month.cellGround=this.startControl.shift(c.yearGround.index).shift(t-1),u.month.groundStars=R.Runtime.getRuntimeLocationStars(c.monthSky),u.month.starDerivativeMap=R.Runtime.getStarToDerivativeMapOf(c.monthSky),u.day.cellGround=u.month.cellGround.shift(r-1),n&&(u.day.cellGround=u.day.cellGround.shift(i.lunarMonthDays(e,t,!1))),u.day.groundStars=R.Runtime.getRuntimeLocationStars(c.daySky),u.day.starDerivativeMap=R.Runtime.getStarToDerivativeMapOf(c.daySky),{...c,...u}}get shadowLight(){return this.config.yearSky.index%2==0?S.ShadowLight.LIGHT:S.ShadowLight.SHADOW}get configDirection(){return(this.shadowLight===S.ShadowLight.LIGHT?S.Direction.CLOCKWISE:S.Direction.ANTI_CLOCKWISE).add(this.config.gender==a.Gender.M?S.Direction.CLOCKWISE:S.Direction.ANTI_CLOCKWISE)}getMajorStarEnergyLevel(e){return u.MajorStar.majorStarPlacers.get(e).evalEnergyLevel(u.MajorStar.majorStarPlacers.get(e).evalGround(this))}getMajorStarDerivative(e){return this.#G.get(b.StarDerivative.WEALTHINESS)?.equals(e)?b.StarDerivative.WEALTHINESS:this.#G.get(b.StarDerivative.POWER)?.equals(e)?b.StarDerivative.POWER:this.#G.get(b.StarDerivative.FAME)?.equals(e)?b.StarDerivative.FAME:this.#G.get(b.StarDerivative.PROBLEM)?.equals(e)?b.StarDerivative.PROBLEM:null}[y.default.inspect.custom](e,t){return y.default.inspect(this.toJSON(),t)}toJSON(){return{config:this.config,element:this.element,destinyMaster:this.#O,bodyMaster:this.#N,startControl:this.#m,cells:this.#v,bornStarDerivativeMap:Object.fromEntries(this.#G)}}toString(){const e=this.#v.map((e=>" "+e.toString())).join(",\n");return`DestinyBoard {\n config: ${this.config},\n element: ${this.element},\n destinyMaster: ${this.#O},\n bodyMaster: ${this.#N},\n startControl: ${this.#m},\n cells: [\n`+e+"\n ],\n"+` #bornStarDerivativeMap: ${JSON.stringify(Object.fromEntries(this.#G))}\n}`}}t.DestinyBoard=T},920:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Gender=t.ConfigType=t.DestinyConfig=void 0,t.DestinyConfig=class{year;month;day;isLeapMonth;yearSky;yearGround;monthSky;monthGround;daySky;dayGround;bornTimeGround;configType;gender;constructor(e){const{year:t,month:r,day:n,isLeapMonth:i,yearSky:o,yearGround:a,monthSky:s,monthGround:c,daySky:u,dayGround:l,bornTimeGround:f,configType:S,gender:d}=e;this.year=t,this.month=r,this.day=n,this.isLeapMonth=i,this.yearSky=o,this.yearGround=a,this.monthSky=s,this.monthGround=c,this.daySky=u,this.dayGround=l,this.bornTimeGround=f,this.configType=S,this.gender=d}getLogicalMonth(){return this.isLeapMonth&&this.day>15?this.month+1:this.month}toJSON(){return{year:this.year,month:this.month,day:this.day,isLeapMonth:this.isLeapMonth,yearSky:this.yearSky,yearGround:this.yearGround,monthSky:this.monthSky,monthGround:this.monthGround,daySky:this.daySky,dayGround:this.dayGround,bornTimeGround:this.bornTimeGround,configType:n[this.configType],gender:o[this.gender]}}toString(){return JSON.stringify(this)}},function(e){e.GROUND="GROUND",e.SKY="SKY",e.HUMAN="HUMAN"}(r||(t.ConfigType=r={}));const n={GROUND:"地盤",SKY:"天盤",HUMAN:"人盤"};var i;!function(e){e.M="M",e.F="F"}(i||(t.Gender=i={}));const o={M:"男",F:"女"}},420:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Ground=void 0;const i=r(593),o=n(r(539)),a=Object.freeze(["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]);class s{index;displayName;constructor(e,t){this.index=e,this.displayName=t}shift(e){return s.get(this.index+e)}toJSON(){return this.displayName}toString(){return this.displayName}[o.default.inspect.custom](e,t){return this.toString()}static get(e){return s.GROUNDS[(0,i.mod)(e,12)]}static getByName(e){const t=a.indexOf(e);if(-1!==t)return s.get(t);throw new Error("Not found")}static GROUNDS=Object.freeze(a.map(((e,t)=>Object.freeze(new s(t,e)))));static values(){return s.GROUNDS}equals(e){return this===e||this.index===e.index}}t.Ground=s},290:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LifeStage=void 0;const i=n(r(539));class o{displayName;constructor(e){this.displayName=e}toJSON(){return this.displayName}toString(){return this.displayName}static getByName(e){return o.values.find((t=>t.displayName===e))}[i.default.inspect.custom](e,t){return this.toString()}static values=Object.freeze([Object.freeze(new o("長生")),Object.freeze(new o("沐浴")),Object.freeze(new o("冠帶")),Object.freeze(new o("臨官")),Object.freeze(new o("帝旺")),Object.freeze(new o("衰")),Object.freeze(new o("病")),Object.freeze(new o("死")),Object.freeze(new o("墓")),Object.freeze(new o("絕")),Object.freeze(new o("胎")),Object.freeze(new o("養"))])}t.LifeStage=o},641:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MajorStar=void 0;const i=r(56),o=r(420),a=n(r(539));class s{key;displayName;constructor(e,t){this.key=e,this.displayName=t}toJSON(){return this.displayName}toString(){return this.displayName}[a.default.inspect.custom](e,t){return this.toString()}static MAJOR_STAR_EMPEROR=Object.freeze(new s("MAJOR_STAR_EMPEROR","紫微"));static MAJOR_STAR_CHANGE=Object.freeze(new s("MAJOR_STAR_CHANGE","天機"));static MAJOR_STAR_SUN=Object.freeze(new s("MAJOR_STAR_SUN","太陽"));static MAJOR_STAR_GOLD=Object.freeze(new s("MAJOR_STAR_GOLD","武曲"));static MAJOR_STAR_ENJOYMENT=Object.freeze(new s("MAJOR_STAR_ENJOYMENT","天同"));static MAJOR_STAR_FIRE=Object.freeze(new s("MAJOR_STAR_FIRE","廉貞"));static MAJOR_STAR_TREASURY=Object.freeze(new s("MAJOR_STAR_TREASURY","天府"));static MAJOR_STAR_MOON=Object.freeze(new s("MAJOR_STAR_MOON","太陰"));static MAJOR_STAR_GREED=Object.freeze(new s("MAJOR_STAR_GREED","貪狼"));static MAJOR_STAR_ARGUMENT=Object.freeze(new s("MAJOR_STAR_ARGUMENT","巨門"));static MAJOR_STAR_SUPPORT=Object.freeze(new s("MAJOR_STAR_SUPPORT","天相"));static MAJOR_STAR_RULE=Object.freeze(new s("MAJOR_STAR_RULE","天梁"));static MAJOR_STAR_GENERAL=Object.freeze(new s("MAJOR_STAR_GENERAL","七殺"));static MAJOR_STAR_PIONEER=Object.freeze(new s("MAJOR_STAR_PIONEER","破軍"));static stars=Object.freeze([s.MAJOR_STAR_EMPEROR,s.MAJOR_STAR_CHANGE,s.MAJOR_STAR_SUN,s.MAJOR_STAR_GOLD,s.MAJOR_STAR_ENJOYMENT,s.MAJOR_STAR_FIRE,s.MAJOR_STAR_TREASURY,s.MAJOR_STAR_MOON,s.MAJOR_STAR_GREED,s.MAJOR_STAR_ARGUMENT,s.MAJOR_STAR_SUPPORT,s.MAJOR_STAR_RULE,s.MAJOR_STAR_GENERAL,s.MAJOR_STAR_PIONEER]);static majorStarPlacers;static{const e=new Map;e.set(s.MAJOR_STAR_EMPEROR,{evalGround:e=>{const t=new Map;return t.set(i.Element.WATER,[1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,0,0,1,1,2,2,3,3,4]),t.set(i.Element.WOOD,[4,1,2,5,2,3,6,3,4,7,4,5,8,5,6,9,6,7,10,7,8,11,8,9,0,9,10,1,10,11]),t.set(i.Element.GOLD,[11,4,1,2,0,5,2,3,1,6,3,4,2,7,4,5,3,8,5,6,4,9,6,7,5,10,7,8,6,11]),t.set(i.Element.EARTH,[6,11,4,1,2,7,0,5,2,3,8,1,6,3,4,9,2,7,4,5,10,3,8,5,6,11,4,9,6,7]),t.set(i.Element.FIRE,[9,6,11,4,1,2,10,7,0,5,2,3,11,8,1,6,3,4,0,9,2,7,4,5,1,10,3,8,5,6]),o.Ground.get(t.get(e.element)[e.config.day-1])},evalEnergyLevel:e=>[0,2,2,1,-1,1,2,2,1,0,0,1][e.index]}),e.set(s.MAJOR_STAR_CHANGE,{evalGround:t=>e.get(s.MAJOR_STAR_EMPEROR).evalGround(t).shift(-1),evalEnergyLevel:e=>[2,-1,1,1,2,0,2,-1,0,1,2,0][e.index]}),e.set(s.MAJOR_STAR_SUN,{evalGround:t=>e.get(s.MAJOR_STAR_EMPEROR).evalGround(t).shift(-3),evalEnergyLevel:e=>[-1,-1,1,2,1,1,2,0,0,0,-1,-1][e.index]}),e.set(s.MAJOR_STAR_GOLD,{evalGround:t=>e.get(s.MAJOR_STAR_EMPEROR).evalGround(t).shift(-4),evalEnergyLevel:e=>[1,2,0,-1,2,0,1,2,0,1,2,0][e.index]}),e.set(s.MAJOR_STAR_ENJOYMENT,{evalGround:t=>e.get(s.MAJOR_STAR_EMPEROR).evalGround(t).shift(-5),evalEnergyLevel:e=>[1,-1,0,2,0,2,-1,-1,1,0,0,2][e.index]}),e.set(s.MAJOR_STAR_FIRE,{evalGround:t=>e.get(s.MAJOR_STAR_EMPEROR).evalGround(t).shift(-8),evalEnergyLevel:e=>[0,1,2,0,1,-1,0,2,2,0,1,-1][e.index]}),e.set(s.MAJOR_STAR_TREASURY,{evalGround:t=>{const r=e.get(s.MAJOR_STAR_EMPEROR).evalGround(t),n=t.getCellByGround(r),i=n.getCellNextDist(t.getCellByGround(o.Ground.get(2)));return n.getNextICell(2*i).ground},evalEnergyLevel:e=>[2,2,2,0,2,0,1,2,0,-1,2,1][e.index]}),e.set(s.MAJOR_STAR_MOON,{evalGround:t=>e.get(s.MAJOR_STAR_TREASURY).evalGround(t).shift(1),evalEnergyLevel:e=>[2,2,0,-1,0,-1,-1,0,0,1,1,2][e.index]}),e.set(s.MAJOR_STAR_GREED,{evalGround:t=>e.get(s.MAJOR_STAR_TREASURY).evalGround(t).shift(2),evalEnergyLevel:e=>[1,2,0,0,2,-1,1,2,0,0,2,-1][e.index]}),e.set(s.MAJOR_STAR_ARGUMENT,{evalGround:t=>e.get(s.MAJOR_STAR_TREASURY).evalGround(t).shift(3),evalEnergyLevel:e=>[1,1,2,2,0,0,1,-1,2,2,1,1][e.index]}),e.set(s.MAJOR_STAR_SUPPORT,{evalGround:t=>e.get(s.MAJOR_STAR_TREASURY).evalGround(t).shift(4),evalEnergyLevel:e=>[2,2,2,-1,1,0,1,0,2,-1,0,0][e.index]}),e.set(s.MAJOR_STAR_RULE,{evalGround:t=>e.get(s.MAJOR_STAR_TREASURY).evalGround(t).shift(5),evalEnergyLevel:e=>[2,1,2,2,1,-1,2,1,-1,0,1,-1][e.index]}),e.set(s.MAJOR_STAR_GENERAL,{evalGround:t=>e.get(s.MAJOR_STAR_TREASURY).evalGround(t).shift(6),evalEnergyLevel:e=>[1,2,2,-1,1,0,1,1,2,0,2,0][e.index]}),e.set(s.MAJOR_STAR_PIONEER,{evalGround:t=>e.get(s.MAJOR_STAR_TREASURY).evalGround(t).shift(-2),evalEnergyLevel:e=>[2,1,-1,1,1,0,2,2,-1,-1,1,0][e.index]}),s.majorStarPlacers=Object.freeze(e)}getType(){return"MajorStar"}getKey(){return this.key}getDisplayName(){return this.displayName}static getByKey(e){return s.stars.find((t=>t.getKey()===e))??null}static getByName(e){return s.stars.find((t=>t.getDisplayName()===e))??null}equals(e){return e===this||e.getType()===this.getType()&&e.getKey()===this.getKey()}}t.MajorStar=s},165:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MiniStar=void 0;const i=r(593),o=r(420),a=r(56),s=r(160),c=r(108),u=n(r(539));class l{key;displayName;luck;constructor(e,t,r){this.key=e,this.displayName=t,this.luck=r}toJSON(){return this.displayName}toString(){return this.displayName}[u.default.inspect.custom](e,t){return this.toString()}static MINI_STAR_SKY_NOBLE=Object.freeze(new l("MINI_STAR_SKY_NOBLE","天官",a.Luckiness.LUCK));static MINI_STAR_SKY_HAPPINESS=Object.freeze(new l("MINI_STAR_SKY_HAPPINESS","天福",a.Luckiness.LUCK));static MINI_STAR_COOK=Object.freeze(new l("MINI_STAR_COOK","天廚",a.Luckiness.LUCK));static MINI_STAR_CRY=Object.freeze(new l("MINI_STAR_CRY","天哭",a.Luckiness.BAD_LUCK));static MINI_STAR_LOST=Object.freeze(new l("MINI_STAR_LOST","天虛",a.Luckiness.BAD_LUCK));static MINI_STAR_SKILL=Object.freeze(new l("MINI_STAR_SKILL","龍池",a.Luckiness.LUCK));static M