dsh-metaphysics 0.50.5 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1102 -1005
- package/README.md +367 -355
- package/client.almanac.js +129 -0
- package/client.bazi.js +168 -0
- package/client.chenggu.js +129 -0
- package/client.convert.js +129 -0
- package/client.daliuren.js +167 -0
- package/client.fengshui.js +128 -0
- package/client.hepan.js +167 -0
- package/client.js +638 -18939
- package/client.liuyao.js +167 -0
- package/client.mbti.js +129 -0
- package/client.name.js +129 -0
- package/client.numerology.js +129 -0
- package/client.qimen.js +167 -0
- package/client.star.js +129 -0
- package/client.tarot.js +167 -0
- package/client.trend.js +167 -0
- package/client.xiaoliuren.js +129 -0
- package/client.zeri.js +129 -0
- package/client.ziwei.js +168 -0
- package/docs/assets/verification-badge.svg +13 -0
- package/engine/almanac.js +4 -4
- package/engine/bazi.js +98 -21
- package/engine/citations.js +320 -0
- package/engine/classics.js +567 -559
- package/engine/diff.js +350 -301
- package/engine/fengshui.js +272 -28
- package/engine/fingerprint.js +76 -0
- package/engine/followup.js +31 -3
- package/engine/geju.js +531 -475
- package/engine/index.js +311 -13
- package/engine/interpret-knowledge.js +502 -484
- package/engine/interpret-plain.js +383 -383
- package/engine/interpret.js +1885 -1867
- package/engine/qimen-ganying.js +134 -0
- package/engine/qimen-interpret.js +31 -9
- package/engine/qimen.js +16 -1
- package/engine/shensha.js +6 -3
- package/engine/trace.js +456 -0
- package/engine/ziwei.js +117 -8
- package/index.js +51 -3
- package/package.json +113 -106
- package//345/221/275/347/220/206/346/216/222/347/233/230.html +9418 -7122
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.fengshui.js",factory(Pn){const k={};return k.fail=(function(){return{fail:(J,U)=>{const C=new Error(U);return C.code=J,C}}})(),k.diff=(function(){const W=new Set(["summary","interpret","castAt","asOf","precision","disclaimer","note","trueSolarText","civilText","offsetMinutes","input","jd","juMethod","juMethodNote","lateZiHourMode","leapPolicy","schools","bodyMasterSchool","bodyMasterNote"]),J=i=>i!==null&&typeof i=="object";function U(i,l,r="",g=[]){if(i===l)return g;if(!J(i)||!J(l))return g.push({path:r||"(root)",from:i,to:l}),g;const _=new Set([...Object.keys(i),...Object.keys(l)]);for(const y of _){if(W.has(y))continue;const f=r?`${r}.${y}`:y,x=i[y],P=l[y];J(x)&&J(P)?U(x,P,f,g):JSON.stringify(x)!==JSON.stringify(P)&&g.push({path:f,from:x,to:P})}return g}const C=[[/^pillars\.year\.ganzhi$/,"年柱"],[/^pillars\.month\.ganzhi$/,"月柱"],[/^pillars\.day\.ganzhi$/,"日柱"],[/^pillars\.hour\.ganzhi$/,"时柱"],[/^pillars\.\w+\.hidden/,"藏干"],[/^pillars\.\w+\.stemTenGod$/,"十神"],[/^pillars\.\w+\.kongwang/,"空亡"],[/^pillars\.\w+\.dishi$|^pillars\.\w+\.zizuo$/,"十二长生"],[/^pillars\.\w+\.nayin$/,"纳音"],[/^dayMaster\./,"日主"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\.(palace|branch|stem|ganzhi)$/,"宫位"],[/^palaces\.\d+\.stars\.\d+\.(name|brightness|type)$/,"星曜"],[/^palaces\.\d+\.shensha\./,"神煞"],[/^palaces\.\d+\.(daxian|xiaoxian)\./,"大限"],[/^palaces\.\d+\.sanfang\./,"三方四正"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\./,"命宫"],[/^body\./,"身宫"],[/^doujun\./,"流年斗君"],[/^siZhu\.year$/,"年柱"],[/^siZhu\.month$/,"月柱"],[/^siZhu\.day$/,"日柱"],[/^siZhu\.time$/,"时柱"],[/^ju$|^juNumber$/,"局数"],[/^yuan$/,"三元"],[/^dun$/,"阴阳遁"],[/^daxian(List)?\./,"大限"],[/^fly(Chains|Composite)?\./,"飞星"],[/^pattern/,"格局"],[/^schools\./,"流派回显"],[/^dayun\.jiao\./,"起运"],[/^dayun\.toNextJieDays$/,"起运时间"],[/^dayun\.list\.(\d+)\.ganzhi$/,"大运干支"],[/^dayun\.startAge\./,"起运时间"],[/^dayun\./,"大运评分"],[/^liunian\./,"流年"],[/^jieqi\./,"节气边界"],[/^solarTime\./,"真太阳时"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^yueJiang\./,"月将"],[/^xunKong$/,"旬空"],[/^lines\.(\d+)\./,"爻"],[/^shensha\./,"神煞"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^relations\./,"干支关系"],[/^input\./,"输入回显"]],L=[[/^pillars\./,"四柱"],[/^shensha\./,"神煞"],[/^dayun\./,"大运"],[/^liunian\./,"流年"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^dayMaster\./,"日主"],[/^relations\./,"干支关系"],[/^palaces\.(taiyuan|minggong|shengong)\./,"命身宫"],[/^palaces\.\d+\./,"宫位"],[/^palaces\./,"命身宫"],[/^soul\.|^body\.|^doujun\./,"命身宫"],[/^siZhu\./,"四柱"],[/^ju$|^juNumber$|^yuan$|^dun$/,"局数"],[/^daxian/,"大限"],[/^fly/,"飞星"],[/^pattern/,"格局"],[/^jieqi\./,"节气"],[/^solarTime\./,"真太阳时"],[/^input\./,"输入回显"],[/^lines\./,"爻"]],S=[[/^pillars\.(year|month|day|hour)\.ganzhi$/,"柱"],[/^palaces\.(minggong|shengong)\.ganzhi$/,"命身宫"],[/^soul\.ganzhi$/,"命宫"],[/^body\.branch$/,"身宫"],[/^siZhu\.(year|month|day|time)$/,"柱"],[/^dayun\.jiao\.at$/,"起运"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^ju$|^juNumber$|^juName$/,"局数"],[/^dun$/,"阴阳遁"],[/^lines\.\d+\.(ganzhi|yinYang|name)$/,"爻"],[/^yueJiang\.(name|zhi)$/,"月将"]];function $(i){for(const[l,r]of C)if(l.test(i))return r;return R(i)||i}function R(i){for(const[l,r]of L)if(l.test(i))return r;return""}function u(i){for(const[l,r]of S)if(l.test(i))return r;return""}function b(i){return[...i].sort((l,r)=>l.path.localeCompare(r.path,"zh-Hans-CN",{numeric:!0}))}function M(i){if(!i.length)return"本盘不受此口径影响:所有字段一致。";const l=i.filter(y=>u(y.path)),r=[...new Set(i.map(y=>R(y.path)).filter(Boolean))],g=l.length?`根因 ${l.length} 处:`+l.slice(0,4).map(y=>`${$(y.path)} ${N(y.from)}→${N(y.to)}`).join("、")+(l.length>4?" 等":""):"无单一根因",_=r.length?`;连带影响 ${r.slice(0,6).join("、")}${r.length>6?" 等":""} ${r.length} 类,共 ${i.length} 处`:`;共 ${i.length} 处`;return g+_+"。"}const N=i=>i===void 0?"—":i===null?"null":typeof i=="string"?i:Array.isArray(i)?i.join("")||"[]":typeof i=="object"?JSON.stringify(i):String(i);function v(i,{title:l="",limit:r=12}={}){const g=[];if(l&&g.push(`【${l}】`),g.push(M(i)),!i.length)return g.join(`
|
|
2
|
+
`);const _=b(i.filter(f=>u(f.path))),y=b(i.filter(f=>!u(f.path)));if(_.length){g.push(""),g.push(" 根因(口径直接改动):");for(const f of _)g.push(` ${$(f.path).padEnd(6)} ${N(f.from)} → ${N(f.to)}`)}if(y.length){g.push(""),g.push(` 连带变化(${y.length} 处,展示前 ${Math.min(r,y.length)} 处):`);for(const f of y.slice(0,r))g.push(` ${$(f.path).padEnd(6)} ${N(f.from)} → ${N(f.to)}`);if(y.length>r){const f={};for(const x of y.slice(r)){const P=R(x.path)||"其他";f[P]=(f[P]||0)+1}g.push(" 其余:"+Object.entries(f).map(([x,P])=>`${x} ${P} 处`).join("、"))}}return g.join(`
|
|
3
|
+
`)}const q=(i,l,r,g,_,y)=>({key:i,title:l,short:r,read:f=>{const x=f[i]!==void 0?f[i]:f.schools&&f.schools[i];return y[x]?x:g},alt:f=>f===_?g:_,label:f=>y[f]||f}),ne={bazi:[{key:"lateZi",title:"晚子时:23:00 后是否换日",short:"晚子时",read:i=>i.lateZi!==!1,alt:i=>!i,label:i=>i?"换日":"不换日"},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:i=>i.trueSolar!==!1,alt:i=>!i,label:i=>i?"修正":"不修正"}],ziwei:[{key:"leapMonth",title:"闰月归月:按日切分 / 整月归次月",short:"闰月归月",read:i=>i.leapMonth==="next"||i.leapMonth==="prev"?i.leapMonth:"split",alt:i=>i==="split"?"next":"split",label:i=>({split:"按日切分",next:"整月归次月",prev:"整月归本月"})[i]||i},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:i=>i.trueSolar!==!1,alt:i=>!i,label:i=>i?"修正":"不修正"},q("brightnessSchool","亮度表:默认 / QS 七档","亮度表","default","QS",{default:"默认",QS:"QS(七档)",XD1:"XD1(七档)",ZZ:"ZZ(五档)",XD2:"XD2(五档)"}),q("gengYearSihua","庚干四化:阳武阴同 / 同科阴忌","庚干四化","GYWYT","GYWTY",{GYWYT:"阳武阴同",GYWTY:"同科阴忌",GYWFT:"府科同忌",GYWFX:"府科相忌",GYWTX:"同科相忌"}),q("tianmaSchool","天马:按年支 / 按生月","天马","year-branch","month-branch",{"year-branch":"年支","month-branch":"生月"}),q("tiankongSchool","天空:不排 / 年支顺行","天空","off","normal",{off:"不排",normal:"年支顺行","shun-jia-shi":"加生时"}),q("jiekongSchool","截空旬空:不排 / 正副双星","截空旬空","off","double",{off:"不排",single:"单星",double:"正副双星",zhanyan:"占验派"}),q("kuiyueSchool","魁钺:qs1 / qs2","魁钺","qs1","qs2",{qs1:"qs1",qs2:"qs2","zhong-yiming":"中一鸣",network:"网络"}),q("tianshiTianshang","天伤天使:常规 / 中州互换","天伤天使","normal","zhongzhou",{normal:"常规",zhongzhou:"中州(阴男阳女互换)"}),q("changshengSchool","长生:阴阳顺逆 / 火土起寅","长生","yin-yang-shun-ni","huo-tu",{"yin-yang-shun-ni":"阴阳顺逆","shui-tu":"水二","huo-tu":"火土(土五局起寅)"}),q("lateZishi","晚子时:归当日 / 归次日","晚子时","current-day","next-day",{"current-day":"归当日","next-day":"归次日","all-current":"全归当日","day-cur-time-next":"日归当日·时归次日"}),q("shenzhuSchool","身主:子午皆火星 / 子铃午火","身主","common","verse",{common:"子午皆火星",verse:"子铃午火(安身主诀逐字)"})],qimen:[{key:"juMethod",title:"取局流派:拆补 / 超神接气 / 置闰",short:"取局流派",read:i=>["chaibu","chaoshen","zhirun"].includes(i.juMethod)?i.juMethod:"chaibu",alt:i=>i==="chaibu"?"zhirun":"chaibu",label:i=>({chaibu:"拆补法",chaoshen:"超神接气",zhirun:"置闰法"})[i]||i},{key:"lateZiHourMode",title:"晚子时:23:00 后归当日 / 次日",short:"晚子时归日",read:i=>i.lateZiHourMode==="next-day"?"next-day":"same-day",alt:i=>i==="next-day"?"same-day":"next-day",label:i=>i==="next-day"?"归次日":"归当日"}]};return{diffObjects:U,labelOf:$,categoryOf:R,rootOf:u,sortDiffs:b,summarize:M,formatValue:N,renderDiff:v,CALIBER_SWITCHES:ne}})(),k.fingerprint=(function(){const W="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function J(S){return JSON.stringify(U(S))}function U(S){if(S===null)return null;const $=typeof S;if($==="string")return typeof S.normalize=="function"?S.normalize("NFC"):S;if($==="number")return Number.isFinite(S)?Object.is(S,-0)?0:S:null;if($==="boolean")return S;if(Array.isArray(S))return S.map(U);if($==="object"){const R={};for(const u of Object.keys(S).sort()){const b=S[u];b===void 0||typeof b=="function"||typeof b=="symbol"||(R[u]=U(b))}return R}return null}function C(S){const $=String(S);let R=2166136261,u=2654435769;for(let N=0;N<$.length;N+=1){const v=$.charCodeAt(N);for(const q of[v&255,v>>>8])R=Math.imul(R^q,16777619),u=Math.imul(u^q,2246822507)}let b=(R>>>0)*8+(u>>>29),M="";for(let N=0;N<7;N+=1)M=W[b%32]+M,b=Math.floor(b/32);return M}function L(S={}){const $=String(S.system||""),R=String(S.version||"dev"),u=S.seed===void 0||S.seed===null||S.seed===""?null:Number(S.seed),b=S.asOf?String(S.asOf):null,M=S.params&&typeof S.params=="object"?S.params:{},N=J({system:$,params:M,seed:u,asOf:b}),v=J({base:N,version:R});return{id:`LY-${C(v)}`,baseId:`LY-${C(N)}`,version:R,system:$,payload:N}}return{canonicalJson:J,shortHash:C,fingerprintOf:L}})(),k.validate=(function(){const{fail:W}=k.fail||{},J=1600,U=2400;function C(u){return u%4===0&&u%100!==0||u%400===0}function L(u,b){return b===2?C(u)?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][b-1]||0}const S=u=>typeof u=="string"?`「${u}」`:String(u),$="引擎只接受解析好的公历字段 { year, month, day, hour?, minute? };字符串请先交给宿主层的 parseDateTime 解析";function R(u,b=""){const M=b?`${b} 的`:"";if(!u||typeof u!="object"||Array.isArray(u)){const ne=u===null?"null":Array.isArray(u)?"数组":typeof u;throw W("E_INPUT",`${M}入参必须是对象(收到 ${ne});${$}`)}const N=u.hour===void 0?0:u.hour,v=u.minute===void 0?0:u.minute;for(const[ne,i]of[["year",u.year],["month",u.month],["day",u.day],["hour",N],["minute",v]])if(!Number.isInteger(i))throw W("E_INPUT",`${M}${ne} 必须是整数(收到 ${S(i)});${$}`);if(u.year<J||u.year>U)throw W("E_INPUT",`${M}year 超出支持范围 ${J}–${U}(收到 ${u.year});更早的年份时区与历法口径不可靠`);if(u.month<1||u.month>12)throw W("E_INPUT",`${M}month 超出范围 1–12(收到 ${u.month})`);const q=L(u.year,u.month);if(u.day<1||u.day>q)throw W("E_INPUT",`${M}日期不存在:${u.year}-${u.month}-${u.day}(${u.year} 年 ${u.month} 月只有 ${q} 天)`);if(N<0||N>23)throw W("E_INPUT",`${M}hour 超出范围 0–23(收到 ${N})`);if(v<0||v>59)throw W("E_INPUT",`${M}minute 超出范围 0–59(收到 ${v})`);return u}return{MIN_YEAR:J,MAX_YEAR:U,isLeapYear:C,daysInMonth:L,assertCivil:R}})(),k.lru=(function(){function W({max:J=64,ttlMs:U=0,name:C="lru",now:L=()=>Date.now()}={}){const S=new Map,$={name:C,hits:0,misses:0,evictions:0,expirations:0},R=u=>U>0&&L()-u.at>U;return{name:C,max:J,ttlMs:U,get(u){const b=S.get(u);if(!b||R(b)){b&&(S.delete(u),$.expirations+=1),$.misses+=1;return}return S.delete(u),S.set(u,b),$.hits+=1,b.value},set(u,b){for(S.has(u)&&S.delete(u),S.set(u,{value:b,at:L()});S.size>J;)S.delete(S.keys().next().value),$.evictions+=1;return b},has(u){const b=S.get(u);return b?R(b)?(S.delete(u),$.expirations+=1,!1):!0:!1},delete(u){return S.delete(u)},clear(){S.clear()},get size(){return S.size},stats(){const u=$.hits+$.misses;return{name:C,size:S.size,max:J,hits:$.hits,misses:$.misses,evictions:$.evictions,expirations:$.expirations,hitRate:u?$.hits/u:0}}}}return{createLru:W}})(),k.nayin=(function(){const W=["海中金","炉中火","大林木","路旁土","剑锋金","山头火","涧下水","城头土","白蜡金","杨柳木","泉中水","屋上土","霹雳火","松柏木","长流水","沙中金","山下火","平地木","壁上土","金箔金","覆灯火","天河水","大驿土","钗钏金","桑柘木","大溪水","沙中土","天上火","石榴木","大海水"];function J(U){const C=(Number(U)%60+60)%60,L=W[Math.floor(C/2)];return{name:L,element:L[2]}}return{NAYIN_NAMES:W,nayinOf:J}})(),k.sanhe=(function(){const W=[{branches:["申","子","辰"],element:"水"},{branches:["亥","卯","未"],element:"木"},{branches:["寅","午","戌"],element:"火"},{branches:["巳","酉","丑"],element:"金"}],J=Object.fromEntries(W.map(L=>[L.branches.join(""),L.element])),U=Object.fromEntries(W.flatMap(L=>L.branches.map(S=>[S,L.element])));function C(L){return W.find(S=>S.branches.includes(L))||null}return{SANHE_GROUPS:W,SANHE:J,SANHE_ELEMENT:U,sanheGroupOf:C}})(),k["vsop-earth"]=(function(){const W=[[1.75347045673,0,0],[.03341656453,4.66925680415,6283.0758499914],[.00034894275,4.62610242189,12566.1516999828],[3417572e-11,2.82886579754,3.523118349],[3497056e-11,2.74411783405,5753.3848848968],[3135899e-11,3.62767041756,77713.7714681205],[2676218e-11,4.41808345438,7860.4193924392],[2342691e-11,6.13516214446,3930.2096962196],[1273165e-11,2.03709657878,529.6909650946],[1324294e-11,.74246341673,11506.7697697936],[901854e-11,2.04505446477,26.2983197998],[1199167e-11,1.10962946234,1577.3435424478],[857223e-11,3.50849152283,398.1490034082],[779786e-11,1.17882681962,5223.6939198022],[99025e-10,5.23268072088,5884.9268465832],[753141e-11,2.53339052847,5507.5532386674],[505267e-11,4.58292599973,18849.2275499742],[492392e-11,4.20505711826,775.522611324],[356672e-11,2.91954114478,.0673103028],[284125e-11,1.89869240932,796.2980068164],[242879e-11,.34481445893,5486.777843175],[317087e-11,5.84901948512,11790.6290886588],[271112e-11,.31486255375,10977.078804699],[206217e-11,4.80646631478,2544.3144198834],[205478e-11,1.86953770281,5573.1428014331],[202318e-11,2.45767790232,6069.7767545534],[126225e-11,1.08295459501,20.7753954924],[155516e-11,.83306084617,213.299095438],[115132e-11,.64544911683,.9803210682],[102851e-11,.63599845579,4694.0029547076],[101724e-11,4.2667980198,7.1135470008],[99206e-11,6.20992926918,2146.1654164752],[132212e-11,3.41118292683,2942.4634232916],[97607e-11,.68101342359,155.4203994342],[85128e-11,1.29870764804,6275.9623029906],[74651e-11,1.755089133,5088.6288397668],[101895e-11,.97569280312,15720.8387848784],[84711e-11,3.67080093031,71430.69561812909],[73547e-11,4.67926633877,801.8209311238],[73874e-11,3.50319414955,3154.6870848956],[78757e-11,3.03697458703,12036.4607348882],[79637e-11,1.80791287082,17260.1546546904],[85803e-11,5.9832263126,161000.6857376741],[56963e-11,2.78430458592,6286.5989683404],[61148e-11,1.81839892984,7084.8967811152],[69627e-11,.83297621398,9437.762934887],[56116e-11,4.38694865354,14143.4952424306],[62449e-11,3.97763912806,8827.3902698748],[51145e-11,.28306832879,5856.4776591154],[55577e-11,3.47006059924,6279.5527316424],[41036e-11,5.36817592855,8429.2412664666],[51605e-11,1.33282739866,1748.016413067],[51992e-11,.18914947184,12139.5535091068],[49e-8,.48735014197,1194.4470102246],[392e-9,6.16833020996,10447.3878396044],[3557e-10,1.775968892,6812.766815086],[3677e-10,6.04133863162,10213.285546211],[36596e-11,2.56957481827,1059.3819301892],[33296e-11,.59310278598,17789.845619785],[35954e-11,1.70875808777,2352.8661537718],[40938e-11,2.39850938714,19651.048481098],[30047e-11,2.73975124088,1349.8674096588],[30412e-11,.44294464169,83996.84731811189],[23663e-11,.48473622521,8031.0922630584],[23574e-11,2.06528133162,3340.6124266998],[21089e-11,4.14825468851,951.7184062506],[24738e-11,.21484762138,3.5904286518],[25352e-11,3.16470891653,4690.4798363586],[22823e-11,5.22195230819,4705.7323075436],[21419e-11,1.42563910473,16730.4636895958],[21891e-11,5.55594302779,553.5694028424],[203e-9,.37133792946,283.8593188652]],J=[[6283.0758499914,0,0],[.00206058863,2.67823455808,6283.0758499914],[4303419e-11,2.63512233481,12566.1516999828],[425264e-11,1.59046982018,3.523118349],[109017e-11,2.96631010675,1577.3435424478],[93479e-11,2.59211109542,18849.2275499742],[119305e-11,5.79555765566,26.2983197998],[72121e-11,1.13840581212,529.6909650946],[67784e-11,1.87453300345,398.1490034082],[6735e-10,4.40932832004,5507.5532386674],[59045e-11,2.88815790631,5223.6939198022],[55976e-11,2.17471740035,155.4203994342],[45411e-11,.39799502896,796.2980068164],[36298e-11,.46875437227,775.522611324],[28962e-11,2.64732254645,7.1135470008],[20844e-11,5.34138275149,.9803210682]],U=[[8721859e-11,1.07253635559,6283.0758499914],[99099e-10,3.14159265359,0],[294833e-11,.43717350256,12566.1516999828],[27338e-11,.05295636147,3.523118349],[16333e-11,5.18820215724,26.2983197998],[15745e-11,3.68504712183,155.4203994342],[9425e-11,.29667114694,18849.2275499742],[8938e-11,2.05706319592,77713.7714681205],[694e-10,.82691541038,775.522611324],[5061e-11,4.6624323168,1577.3435424478]],C=[[289058e-11,5.84173149732,6283.0758499914],[20712e-11,6.0498393902,12566.1516999828],[2962e-11,5.1956057957,155.4203994342],[2527e-11,3.14159265359,0],[1288e-11,4.7219761197,3.523118349]],L=[[7714e-11,4.14117321449,6283.0758499914],[1016e-11,3.27573644241,12566.1516999828]];function S($){let R=0;for(const[b,M,N]of W)R+=b*Math.cos(M+N*$);let u=1;for(const b of[J,U,C,L]){u*=$;for(const[M,N,v]of b)R+=M*u*Math.cos(N+v*$)}return R}return{earthL:S}})(),k.calendar=(function(){const{earthL:W}=k["vsop-earth"]||{},{createLru:J}=k.lru||{},U=["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],C=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],L=["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"];function S(A){return(285+15*A)%360}function $(A,O,w){const X=Math.floor((14-O)/12),F=A+4800-X,ee=O+12*X-3;return w+Math.floor((153*ee+2)/5)+365*F+Math.floor(F/4)-Math.floor(F/100)+Math.floor(F/400)-32045}function R(A){const O=A+32044,w=Math.floor((4*O+3)/146097),X=O-Math.floor(146097*w/4),F=Math.floor((4*X+3)/1461),ee=X-Math.floor(1461*F/4),ue=Math.floor((5*ee+2)/153);return{year:100*w+F-4800+Math.floor(ue/10),month:ue+3-12*Math.floor(ue/10),day:ee-Math.floor((153*ue+2)/5)+1}}function u(A,O){for(let w=0;w<60;w++)if(w%10===A&&w%12===O)return w;return-1}function b(A){const O=(A%60+60)%60;return{index:O,stem:U[O%10],branch:C[O%12],name:U[O%10]+C[O%12]}}function M(A){return((A+49)%60+60)%60}function N(A){const O=A-2451545,w=O/36525,X=O/365250;let F=W(X)*180/Math.PI+180;F=(F%360+360)%360;const ee=(5029.0966*w+1.11113*w*w-6e-6*w*w*w)/3600;F+=ee,F-=.09033/3600;const ue=(125.04452-1934.136261*w)*Math.PI/180,ye=(280.4665+36000.7698*w)*Math.PI/180,Oe=(218.3165+481267.8813*w)*Math.PI/180,Fe=(-17.2*Math.sin(ue)-1.32*Math.sin(2*ye)-.23*Math.sin(2*Oe)+.21*Math.sin(2*ue))/3600;F+=Fe;const Ue=(357.52911+35999.05029*w-1537e-7*w*w)*Math.PI/180,_e=.016708634-42037e-9*w-1267e-10*w*w,Pe=1.000001018*(1-_e*_e)/(1+_e*Math.cos(Ue+(1.914602-.004817*w)*(Math.PI/180)*Math.sin(Ue)));return F-=20.4898/3600/(Pe||1),(F%360+360)%360}function v(A){const O=[[1900,-2.8],[1920,21.2],[1940,24.3],[1950,29.1],[1960,33.2],[1970,40.2],[1980,50.5],[1990,56.9],[2e3,63.8],[2010,66.1],[2020,69.4],[2030,72],[2050,80],[2100,110]];if(A<=O[0][0])return O[0][1];for(let w=1;w<O.length;w++)if(A<=O[w][0]){const[X,F]=O[w-1],[ee,ue]=O[w];return F+(ue-F)*(A-X)/(ee-X)}return O[O.length-1][1]}const q=8/24,ne=7.7611/24,i=2425612+4/24;function l(A){return A<i?ne:q}const r=J({max:4096,name:"termInstant"}),g=1e-5,_=new Map,y=365.2422;function f(A,O){const w=S(O),X=$(A,1,5)-.5+O*15.2184,F=_.get(O);let ee=F!==void 0?F+y:X;Math.abs(ee-X)>20&&(ee=X);for(let ye=0;ye<12;ye++){let Oe=w-N(ee);if(Oe=((Oe+180)%360+360)%360-180,ee+=Oe/.98564736,Math.abs(Oe)<g)break}_.set(O,ee);const ue=ee-v(A)/86400;return ue+l(ue)}function x(A,O){const w=A*24+O,X=r.get(w);if(X!==void 0)return X;const F=f(A,O);return r.set(w,F),F}function P(A){const O=Math.floor(A+.5),w=A+.5-O,X=Math.round(w*1440),{year:F,month:ee,day:ue}=R(O);return{year:F,month:ee,day:ue,hour:Math.floor(X/60)%24,minute:X%60}}function ae({year:A,month:O,day:w,hour:X=0,minute:F=0}){return $(A,O,w)-.5+(X*60+F)/1440}function fe(A,O,w){const X=$(A,O,w)-$(A,1,1)+1,F=2*Math.PI*(X-81)/364;return 9.87*Math.sin(2*F)-7.53*Math.cos(F)-1.5*Math.sin(F)}const $e=J({max:8,name:"termWindow"}),le=J({max:32,name:"termYear"}),he=Array.from({length:24},(A,O)=>O),be=he.filter(A=>A%2===0);function Ie(A,O){const w=O?`${A}|jie`:`${A}|all`,X=le.get(w);if(X)return X;if(O){const ee=le.get(`${A}|all`);if(ee){const ue=ee.filter(ye=>ye.index%2===0);return le.set(w,ue),ue}}const F=[];for(const ee of O?be:he)F.push({year:A,index:ee,name:L[ee],jd:x(A,ee)});return F.sort((ee,ue)=>ee.jd-ue.jd),le.set(w,F),F}function ge(A,O={}){const w=O.jieOnly===!0,X=w?`${A}|jie`:A,F=$e.get(X);if(F)return F;const ee=[...Ie(A-1,w),...Ie(A,w),...Ie(A+1,w)];return ee.sort((ue,ye)=>ue.jd-ye.jd),$e.set(X,ee),ee}function Te(A){if(typeof A!="string"||A.length<2)return[];const O=U.indexOf(A[0]),w=C.indexOf(A[1]);if(O<0||w<0)return[];const X=u(O,w);if(X<0)return[];const F=Math.floor(X/10)*10;return[C[(F+10)%12],C[(F+11)%12]]}function xe(A,O){let w=null;for(const X of A)if(X.index%2===0)if(X.jd<=O)w=X;else break;return w}function ve(A,O){for(const w of A)if(w.index%2===0&&w.jd>O)return w;return null}function Ee(A){const O=P(A),w=X=>String(X).padStart(2,"0");return`${O.year}-${w(O.month)}-${w(O.day)} ${w(O.hour)}:${w(O.minute)}`}function ke(){return[r.stats(),le.stats(),$e.stats()]}return{STEMS:U,BRANCHES:C,TERM_NAMES:L,termLongitude:S,toJDN:$,fromJDN:R,sexagenaryIndex:u,ganzhiName:b,dayGanzhiIndex:M,sunLongitude:N,deltaTSeconds:v,OFFSET_MODERN:q,OFFSET_BEIJING_LOCAL:ne,CUTOVER_JD:i,localOffsetFor:l,termInstantJd:x,jdToParts:P,partsToJd:ae,equationOfTime:fe,termWindow:ge,xunKongOf:Te,previousJie:xe,nextJie:ve,formatJd:Ee,cacheMetrics:ke}})(),k.lunar=(function(){const{toJDN:W,jdToParts:J,termInstantJd:U,deltaTSeconds:C,localOffsetFor:L,OFFSET_MODERN:S}=k.calendar||{},$=29.530588861,R=245155009766e-5,u=Math.PI/180;function b(l){const r=l/1236.85,g=R+$*l+15437e-8*r*r-15e-8*r*r*r+73e-11*r*r*r*r,_=1-.002516*r-74e-7*r*r,y=(2.5534+29.1053567*l-14e-7*r*r-11e-8*r*r*r)*u,f=(201.5643+385.81693528*l+.0107582*r*r+1238e-8*r*r*r-58e-9*r*r*r*r)*u,x=(160.7108+390.67050284*l-.0016118*r*r-227e-8*r*r*r+11e-9*r*r*r*r)*u,P=(124.7746-1.56375588*l+.0020672*r*r+215e-8*r*r*r)*u,ae=-.4072*Math.sin(f)+.17241*_*Math.sin(y)+.01608*Math.sin(2*f)+.01039*Math.sin(2*x)+.00739*_*Math.sin(f-y)-.00514*_*Math.sin(f+y)+.00208*_*_*Math.sin(2*y)-.00111*Math.sin(f-2*x)-57e-5*Math.sin(f+2*x)+56e-5*_*Math.sin(2*f+y)-42e-5*Math.sin(3*f)+42e-5*_*Math.sin(y+2*x)+38e-5*_*Math.sin(y-2*x)-24e-5*_*Math.sin(2*f-y)-17e-5*Math.sin(P)-7e-5*Math.sin(f+2*y)+4e-5*Math.sin(2*f-2*x)+4e-5*Math.sin(3*y)+3e-5*Math.sin(f+y-2*x)+3e-5*Math.sin(2*f+2*x)-3e-5*Math.sin(f+y+2*x)+3e-5*Math.sin(f-y+2*x)-2e-5*Math.sin(f-y-2*x)-2e-5*Math.sin(3*f+y)+2e-5*Math.sin(4*f),fe=g+ae-C(2e3+r*100)/86400;return fe+L(fe)}function M(l){return Math.floor(l+.5)}function N(l){const r=l-S;return r+L(r)}function v(l){return Math.round((l+.5-R)/$)}function q(l,r,g){for(let _=l-1;_<=l+1;_++)for(let y=1;y<24;y+=2){const f=N(U(_,y)),x=M(f);if(x>=r&&x<g)return{index:y,jd:f}}return null}function ne(l,r,g){const _=W(l,r,g),y=M(N(U(l,23))),f=_<y?l-1:l,x=M(N(U(f,23)));let P=v(x);for(;M(b(P))>x;)P--;for(;M(b(P+1))<=x;)P++;const ae=M(N(U(f+1,23)));let fe=P;for(;M(b(fe+1))<=ae;)fe++;const $e=fe-P;let le=-1;if($e===13)for(let ge=1;ge<=$e;ge++){const Te=M(b(P+ge-1)),xe=M(b(P+ge));if(!q(f,Te,xe)){le=ge;break}}let he=11,be=!1,Ie=M(b(P));for(let ge=1;ge<=15;ge++){const Te=M(b(P+ge-1)),xe=M(b(P+ge)),ve=q(f,Te,xe),Ee=ge===le;if(_>=Te&&_<xe){const ke=J(b(P+ge-1)),A=Ee?(he+10)%12+1:he;return{year:f,lunarYear:be?f+1:f,month:A,day:_-Te+1,isLeap:Ee,monthStart:`${ke.year}-${String(ke.month).padStart(2,"0")}-${String(ke.day).padStart(2,"0")}`,hasZhongQi:!!ve}}Ee||(he=he%12+1,he===1&&(be=!0)),Ie=xe}throw new Error(`农历换算失败:${l}-${r}-${g}`)}function i(l,r,g){return W(l,r,g)}return{SYNODIC:$,newMoonJd:b,dayNumberOf:M,solarToLunar:ne,monthStartJd:i}})(),k.geo=(function(){const W=`
|
|
4
|
+
北京 116.41 39.90;上海 121.47 31.23;天津 117.20 39.13;重庆 106.55 29.56
|
|
5
|
+
广州 113.26 23.13;深圳 114.06 22.55;珠海 113.58 22.27;东莞 113.75 23.02;佛山 113.12 23.02
|
|
6
|
+
汕头 116.68 23.35;中山 113.39 22.52;惠州 114.42 23.11;江门 113.08 22.58;湛江 110.36 21.27
|
|
7
|
+
韶关 113.60 24.81;梅州 116.12 24.29;清远 113.05 23.70;肇庆 112.47 23.05;茂名 110.93 21.66
|
|
8
|
+
揭阳 116.37 23.55;潮州 116.62 23.66;汕尾 115.37 22.78;河源 114.70 23.74;阳江 111.98 21.86
|
|
9
|
+
杭州 120.15 30.28;宁波 121.55 29.88;温州 120.70 28.00;嘉兴 120.75 30.75;湖州 120.09 30.89
|
|
10
|
+
绍兴 120.58 30.05;金华 119.65 29.09;台州 121.42 28.66;舟山 122.10 30.00;衢州 118.87 28.94;丽水 119.92 28.45
|
|
11
|
+
南京 118.80 32.06;苏州 120.62 31.32;无锡 120.31 31.49;常州 119.97 31.81;南通 120.89 31.98
|
|
12
|
+
徐州 117.28 34.26;扬州 119.41 32.39;盐城 120.16 33.35;泰州 119.92 32.46;镇江 119.45 32.20
|
|
13
|
+
淮安 119.02 33.61;连云港 119.22 34.60;宿迁 118.28 33.96
|
|
14
|
+
合肥 117.23 31.82;芜湖 118.43 31.35;蚌埠 117.39 32.92;安庆 117.05 30.54;阜阳 115.81 32.90
|
|
15
|
+
大同 113.30 40.08;阳泉 113.58 37.86;长治 113.12 36.19;晋城 112.85 35.49;朔州 112.43 39.33
|
|
16
|
+
晋中 112.75 37.69;运城 111.00 35.02;忻州 112.73 38.42;临汾 111.52 36.09;吕梁 111.14 37.52
|
|
17
|
+
六安 116.50 31.75;马鞍山 118.50 31.67;淮南 117.00 32.63;滁州 118.32 32.30;黄山 118.34 29.71
|
|
18
|
+
福州 119.30 26.08;厦门 118.09 24.48;泉州 118.68 24.87;漳州 117.65 24.51;莆田 119.01 25.45
|
|
19
|
+
宁德 119.55 26.67;三明 117.64 26.26;南平 118.18 26.64;龙岩 117.02 25.08
|
|
20
|
+
南昌 115.86 28.68;赣州 114.93 25.83;九江 116.00 29.70;上饶 117.94 28.45;宜春 114.40 27.80
|
|
21
|
+
吉安 114.99 27.11;抚州 116.36 27.95;景德镇 117.18 29.27;萍乡 113.85 27.62;新余 114.93 27.82;鹰潭 117.07 28.26
|
|
22
|
+
济南 117.00 36.65;青岛 120.38 36.07;烟台 121.45 37.46;潍坊 119.16 36.70;临沂 118.35 35.05
|
|
23
|
+
济宁 116.59 35.41;淄博 118.05 36.82;威海 122.12 37.51;泰安 117.09 36.20;德州 116.36 37.44
|
|
24
|
+
聊城 115.98 36.45;菏泽 115.48 35.23;枣庄 117.32 34.81;日照 119.53 35.42;东营 118.50 37.43
|
|
25
|
+
滨州 117.97 37.38
|
|
26
|
+
郑州 113.62 34.75;洛阳 112.45 34.62;南阳 112.53 33.00;开封 114.31 34.80;新乡 113.93 35.30
|
|
27
|
+
安阳 114.35 36.10;商丘 115.65 34.44;信阳 114.09 32.15;周口 114.70 33.62;驻马店 114.02 33.00
|
|
28
|
+
平顶山 113.19 33.77;许昌 113.85 34.03;焦作 113.24 35.22;濮阳 115.03 35.76;漯河 114.03 33.58;三门峡 111.20 34.78
|
|
29
|
+
武汉 114.30 30.59;宜昌 111.29 30.69;襄阳 112.14 32.04;荆州 112.24 30.33;黄石 115.04 30.20
|
|
30
|
+
十堰 110.79 32.65;孝感 113.92 30.92;黄冈 114.87 30.45;咸宁 114.32 29.84;恩施 109.49 30.27
|
|
31
|
+
荆门 112.20 31.04;随州 113.38 31.72;鄂州 114.89 30.40
|
|
32
|
+
长沙 112.94 28.23;株洲 113.13 27.83;湘潭 112.94 27.83;衡阳 112.57 26.89;岳阳 113.13 29.36
|
|
33
|
+
常德 111.70 29.03;郴州 113.02 25.77;邵阳 111.47 27.24;益阳 112.36 28.55;永州 111.61 26.42
|
|
34
|
+
怀化 109.99 27.55;娄底 112.00 27.70;张家界 110.48 29.12
|
|
35
|
+
成都 104.07 30.67;绵阳 104.68 31.47;德阳 104.40 31.13;南充 106.08 30.80;宜宾 104.63 28.77
|
|
36
|
+
泸州 105.44 28.87;自贡 104.78 29.34;乐山 103.76 29.58;达州 107.50 31.21;内江 105.06 29.58
|
|
37
|
+
遂宁 105.57 30.53;眉山 103.85 30.05;广元 105.84 32.44;广安 106.63 30.46;攀枝花 101.72 26.58
|
|
38
|
+
雅安 103.00 29.98;巴中 106.75 31.87;资阳 104.63 30.12
|
|
39
|
+
贵阳 106.63 26.65;遵义 106.93 27.73;六盘水 104.83 26.60;安顺 105.93 26.25;毕节 105.29 27.30
|
|
40
|
+
铜仁 109.19 27.72;凯里 107.98 26.58;都匀 107.52 26.26
|
|
41
|
+
昆明 102.83 24.88;曲靖 103.80 25.49;玉溪 102.54 24.35;大理 100.23 25.60;丽江 100.23 26.86
|
|
42
|
+
保山 99.17 25.11;昭通 103.72 27.34;普洱 100.97 22.79;临沧 100.09 23.88;景洪 100.80 22.00
|
|
43
|
+
拉萨 91.13 29.65;日喀则 88.88 29.27;林芝 94.36 29.65;昌都 97.17 31.14
|
|
44
|
+
西安 108.94 34.34;咸阳 108.70 34.33;宝鸡 107.14 34.37;渭南 109.50 34.50;汉中 107.03 33.07
|
|
45
|
+
榆林 109.73 38.29;延安 109.49 36.60;安康 109.03 32.68;商洛 109.94 33.87;铜川 108.95 34.90
|
|
46
|
+
兰州 103.83 36.06;天水 105.72 34.58;白银 104.14 36.55;酒泉 98.49 39.73;张掖 100.45 38.93
|
|
47
|
+
武威 102.63 37.93;庆阳 107.64 35.71;平凉 106.67 35.54;定西 104.63 35.58;陇南 104.93 33.40
|
|
48
|
+
西宁 101.78 36.62;海东 102.10 36.50;格尔木 94.90 36.40
|
|
49
|
+
银川 106.23 38.49;石嘴山 106.38 39.02;吴忠 106.20 37.99;固原 106.24 36.02
|
|
50
|
+
乌鲁木齐 87.62 43.82;克拉玛依 84.89 45.58;喀什 75.99 39.47;伊宁 81.32 43.92;库尔勒 86.15 41.76
|
|
51
|
+
阿克苏 80.26 41.17;哈密 93.51 42.83;吐鲁番 89.19 42.95;石河子 86.04 44.31
|
|
52
|
+
呼和浩特 111.75 40.84;包头 109.84 40.66;鄂尔多斯 109.78 39.61;赤峰 118.89 42.26;通辽 122.24 43.65
|
|
53
|
+
呼伦贝尔 119.77 49.21;乌兰察布 113.13 40.99;巴彦淖尔 107.42 40.75
|
|
54
|
+
沈阳 123.43 41.80;大连 121.62 38.92;鞍山 122.99 41.11;抚顺 123.96 41.88;本溪 123.77 41.30
|
|
55
|
+
丹东 124.38 40.13;锦州 121.13 41.10;营口 122.24 40.67;阜新 121.67 42.02;辽阳 123.24 41.27
|
|
56
|
+
盘锦 122.07 41.12;铁岭 123.84 42.29;朝阳 120.45 41.57;葫芦岛 120.84 40.71
|
|
57
|
+
长春 125.32 43.82;吉林 126.55 43.84;四平 124.35 43.17;通化 125.94 41.73;白山 126.42 41.94
|
|
58
|
+
松原 124.82 45.14;白城 122.84 45.62;延吉 129.51 42.91
|
|
59
|
+
哈尔滨 126.53 45.80;齐齐哈尔 123.92 47.35;牡丹江 129.63 44.55;佳木斯 130.32 46.80;大庆 125.11 46.59
|
|
60
|
+
鸡西 130.97 45.30;双鸭山 131.16 46.65;伊春 128.84 47.73;鹤岗 130.30 47.35;黑河 127.53 50.24;绥化 126.97 46.65
|
|
61
|
+
南宁 108.37 22.82;柳州 109.42 24.33;桂林 110.29 25.27;梧州 111.28 23.48;北海 109.12 21.48
|
|
62
|
+
玉林 110.16 22.63;百色 106.62 23.90;河池 108.06 24.70;钦州 108.65 21.98;防城港 108.35 21.69
|
|
63
|
+
贵港 109.60 23.11;贺州 111.57 24.40;来宾 109.23 23.75;崇左 107.36 22.40
|
|
64
|
+
海口 110.20 20.04;三亚 109.51 18.25;儋州 109.58 19.52;琼海 110.47 19.26
|
|
65
|
+
香港 114.17 22.32;澳门 113.55 22.20;台北 121.52 25.03;高雄 120.31 22.63;台中 120.68 24.14
|
|
66
|
+
`,J={河北:"石家庄",山西:"太原",内蒙古:"呼和浩特",辽宁:"沈阳",吉林:"长春",黑龙江:"哈尔滨",江苏:"南京",浙江:"杭州",安徽:"合肥",福建:"福州",江西:"南昌",山东:"济南",河南:"郑州",湖北:"武汉",湖南:"长沙",广东:"广州",广西:"南宁",海南:"海口",四川:"成都",贵州:"贵阳",云南:"昆明",西藏:"拉萨",陕西:"西安",甘肃:"兰州",青海:"西宁",宁夏:"银川",新疆:"乌鲁木齐",台湾:"台北"},U={石家庄:[114.51,38.04],太原:[112.55,37.87],沈阳:[123.43,41.8],长春:[125.32,43.82],哈尔滨:[126.53,45.8],南京:[118.8,32.06],杭州:[120.15,30.28],合肥:[117.23,31.82],福州:[119.3,26.08],南昌:[115.86,28.68],济南:[117,36.65],郑州:[113.62,34.75],武汉:[114.3,30.59],长沙:[112.94,28.23],广州:[113.26,23.13],南宁:[108.37,22.82],海口:[110.2,20.04],成都:[104.07,30.67],贵阳:[106.63,26.65],昆明:[102.83,24.88],拉萨:[91.13,29.65],西安:[108.94,34.34],兰州:[103.83,36.06],西宁:[101.78,36.62],银川:[106.23,38.49],乌鲁木齐:[87.62,43.82],台北:[121.52,25.03]},C=(()=>{const M={};for(const N of W.trim().split(`
|
|
67
|
+
`))for(const v of N.split(";")){const q=v.trim().split(/\s+/);if(q.length!==3)continue;const[ne,i,l]=q;M[ne]={lon:Number(i),lat:Number(l)}}for(const[N,[v,q]]of Object.entries(U))M[N]||(M[N]={lon:v,lat:q});return M})(),L=/(省|市|地区|盟|自治州|自治县|自治区|特别行政区|县|区|镇|乡|街道|村|小区|社区)/g;function S(M){const N=String(M||"").trim();if(!N)return null;const v=Number(N);if(Number.isFinite(v)&&/^-?\d+(\.\d+)?$/.test(N)&&v>=60&&v<=150)return{lon:v,lat:null,matched:`${v}°E`,level:"经度",note:"按你输入的经度计算"};const q=N.replace(/\s/g,"").replace(L,""),ne=Object.keys(C).sort((l,r)=>r.length-l.length);for(const l of ne)if(q.includes(l)){const r=C[l];return{lon:r.lon,lat:r.lat,matched:l,level:"地级市",note:`按 ${l} 估算(约 ${r.lon}°E)`}}const i=N.replace(/\s/g,"");for(const[l,r]of Object.entries(J)){const g=i.indexOf(l);if(g<0)continue;const _=i.charAt(g+l.length);if(_==="区"||_==="县")continue;const y=C[r]||{lon:U[r][0],lat:U[r][1]};return{lon:y.lon,lat:y.lat,matched:r,level:"省会",note:`未匹配到具体城市,按 ${l} 省会 ${r} 估算(约 ${y.lon}°E)`}}return{lon:null,lat:null,matched:null,level:"未匹配",note:`没查到「${N}」,可改填经度(如 116.4)`}}const $=/(区|县|镇|乡|村|小区|街道|路|号|巷|弄|组|队)/,R="dsh-metaphysics/0.23.0 (+https://github.com/xuanfu-web/dsh-metaphysics)";async function u(M,{timeoutMs:N=2500}={}){if(typeof fetch!="function")return null;let v=null;try{const q=typeof AbortController=="function"?new AbortController:null;q&&(v=setTimeout(()=>q.abort(),N));const ne="https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&accept-language=zh-CN&countrycodes=cn&q="+encodeURIComponent(M),i=await fetch(ne,{signal:q?q.signal:void 0,headers:{"User-Agent":R}});if(!i||!i.ok)return null;const l=await i.json();if(!Array.isArray(l)||l.length===0)return null;const r=l[0],g=Number(r.lon),_=Number(r.lat);return Number.isFinite(g)?{lon:g,lat:_,matched:r.display_name,level:"在线",note:`在线解析:${r.display_name}`}:null}catch{return null}finally{v&&clearTimeout(v)}}async function b(M,N={}){const v=S(M),q=String(M||"").trim();if(!q||!(N.online===!0)||v&&typeof v.lon=="number"&&!$.test(q))return v;const i=await u(q,N);return i?{...i,local:v&&v.lon!=null?v:null}:v&&typeof v.lon=="number"?{...v,onlineFailed:!0,note:`${v.note}(联网解析失败或超时,已退回内置坐标表)`}:{...v,onlineFailed:!0}}return{CITIES:C,PROVINCES:J,resolveAddress:S,geocodeAddress:b}})(),k.random=(function(){function W(C){let L=Number(C)>>>0;return L||(L=2654435769),function(){L=L+1831565813>>>0;let $=L;return $=Math.imul($^$>>>15,$|1),$^=$+Math.imul($^$>>>7,$|61),(($^$>>>14)>>>0)/4294967296}}function J(C){if(C==null||C==="")return Math.random;const L=Number(C);return Number.isFinite(L)?W(L):Math.random}function U(C){return C==null||C===""?!0:Number.isFinite(Number(C))}return{mulberry32:W,randomOf:J,isSeed:U}})(),k.dst=(function(){const{daysInMonth:W}=k.validate||{},J={1986:["1986-05-04","1986-09-14"],1987:["1987-04-12","1987-09-13"],1988:["1988-04-10","1988-09-11"],1989:["1989-04-16","1989-09-17"],1990:["1990-04-15","1990-09-16"],1991:["1991-04-14","1991-09-15"]},U=($,R,u)=>$*1e4+R*100+u;function C($){const R=J[$.year];if(!R)return!1;const[u,b,M]=R[0].split("-").map(Number),[N,v,q]=R[1].split("-").map(Number),ne=U($.year,$.month,$.day);if(ne<U(u,b,M)||ne>U(N,v,q))return!1;const i=$.hour*60+($.minute||0);return!(ne===U(u,b,M)&&i<120||ne===U(N,v,q)&&i>=120)}function L($){const R=$.minute||0;if(!C($))return{year:$.year,month:$.month,day:$.day,hour:$.hour,minute:R,applied:!1,note:null};let{year:u,month:b,day:M,hour:N}=$;return N-=1,N<0&&(N+=24,M-=1,M<1&&(b-=1,b<1&&(b=12,u-=1),M=W(u,b))),{year:u,month:b,day:M,hour:N,minute:R,applied:!0,note:`检出自 ${J[$.year][0]} 至 ${J[$.year][1]} 的中国夏令时:出生钟面时间已减 1 小时校正`}}function S($,R){const u=Array.isArray($)?$.slice():[];return R&&R.applied&&R.note&&u.push(R.note),u}return{DST_SPANS:J,inDstSpan:C,applyDst:L,withDstNote:S}})(),k.fengshui=(function(){const{partsToJd:W,termInstantJd:J,toJDN:U,dayGanzhiIndex:C,ganzhiName:L,termWindow:S,previousJie:$,BRANCHES:R}=k.calendar||{},{applyDst:u}=k.dst||{},{fail:b}=k.fail||{},M={1:{name:"一白",color:"白",element:"水",star:"贪狼",lucky:!0},2:{name:"二黑",color:"黑",element:"土",star:"巨门",lucky:!1},3:{name:"三碧",color:"碧",element:"木",star:"禄存",lucky:!1},4:{name:"四绿",color:"绿",element:"木",star:"文曲",lucky:!0},5:{name:"五黄",color:"黄",element:"土",star:"廉贞",lucky:!1},6:{name:"六白",color:"白",element:"金",star:"武曲",lucky:!0},7:{name:"七赤",color:"赤",element:"金",star:"破军",lucky:!1},8:{name:"八白",color:"白",element:"土",star:"左辅",lucky:!0},9:{name:"九紫",color:"紫",element:"火",star:"右弼",lucky:!0}},N={坎:"正北",艮:"东北",震:"正东",巽:"东南",离:"正南",坤:"西南",兑:"正西",乾:"西北"},v=["坎","艮","震","巽","离","坤","兑","乾"],q={乾:["六煞","天医","五鬼","祸害","绝命","延年","生气"],坎:["五鬼","天医","生气","延年","绝命","祸害","六煞"],艮:["六煞","绝命","祸害","生气","延年","天医","五鬼"],震:["延年","生气","祸害","绝命","五鬼","天医","六煞"],巽:["天医","五鬼","六煞","祸害","生气","绝命","延年"],离:["六煞","五鬼","绝命","延年","祸害","生气","天医"],坤:["天医","延年","绝命","生气","祸害","五鬼","六煞"],兑:["生气","祸害","延年","绝命","六煞","五鬼","天医"]},ne=["生气","延年","天医","伏位"],i=["绝命","五鬼","六煞","祸害"],l=[{m:"壬",gua:"坎",deg:345},{m:"子",gua:"坎",deg:0},{m:"癸",gua:"坎",deg:15},{m:"丑",gua:"艮",deg:30},{m:"艮",gua:"艮",deg:45},{m:"寅",gua:"艮",deg:60},{m:"甲",gua:"震",deg:75},{m:"卯",gua:"震",deg:90},{m:"乙",gua:"震",deg:105},{m:"辰",gua:"巽",deg:120},{m:"巽",gua:"巽",deg:135},{m:"巳",gua:"巽",deg:150},{m:"丙",gua:"离",deg:165},{m:"午",gua:"离",deg:180},{m:"丁",gua:"离",deg:195},{m:"未",gua:"坤",deg:210},{m:"坤",gua:"坤",deg:225},{m:"申",gua:"坤",deg:240},{m:"庚",gua:"兑",deg:255},{m:"酉",gua:"兑",deg:270},{m:"辛",gua:"兑",deg:285},{m:"戌",gua:"乾",deg:300},{m:"乾",gua:"乾",deg:315},{m:"亥",gua:"乾",deg:330}],r=new Map(l.map((s,c)=>[s.m,c]));function g(s){const c=r.get(s);if(c===void 0)throw b("E_INPUT",`坐向必须是 24 山之一(${l.map(j=>j.m).join("")}),收到「${s}」——请按罗盘 24 山报坐或报向,不要自造方位词。`);return{...l[c],index:c}}function _(s){const j=(g(s).index+12)%24;return{...l[j],index:j}}const y=s=>["坎","离","震","巽"].includes(s)?"东四":"西四",f={生气:"大吉:最宜开门、主卧、灶口朝向",延年:"大吉:宜开门、主卧(利感情与人缘)",天医:"次吉:宜主卧、书房、老人房(利健康)",伏位:"次吉:宜卧室、神位(主平稳)",祸害:"小凶:宜厕所、储物间(宜静不宜动)",六煞:"次凶:宜厕所、储物间",五鬼:"大凶:宜厕所,或以灶坐压之(传统「火烧五鬼」说)",绝命:"最凶:宜灶坐压之、储物,忌门床"},x=["坎","坤","震","巽","中","乾","兑","艮","离"];function P(s,c){const j=(s%100+100)%100,T=s>=2e3?{male:99,female:3}:{male:100,female:4},I=B=>{const z=(B%9+9)%9;return z===0?9:z};let Y=I(c==="male"?T.male-j:j-T.female);Y===5&&(Y=c==="male"?2:8);const E=x[Y-1];if(E==="中")throw new Error("命卦计算异常:落中宫");return{num:Y,gua:E,direction:N[E]}}function ae(s){const c={伏位:{palace:s,direction:N[s]}},j=v.indexOf(s);for(let T=1;T<=7;T++){const I=v[(j+T)%8];c[q[s][T-1]]={palace:I,direction:N[I]}}return c}function fe(s,c,j){return W({year:s,month:c,day:j,hour:12,minute:0})<J(s,2)?s-1:s}function $e(s){const c=(1+(2026-s))%9;return c<=0?c+9:c}const le=["坎","坤","震","巽","中","乾","兑","艮","离"],he=s=>{const c=(s%9+9)%9;return c===0?9:c};function be(s,c=!0){const j=[];for(const T of le){const I=le.indexOf(T)+1,Y=he(I-5+s),E=M[Y];j.push({palace:T,direction:T==="中"?"中宫":N[T],num:Y,name:E.name,star:E.star,element:E.element,lucky:E.lucky})}return{center:s,centerName:M[s].name,forward:c,fly:c?"顺飞":"逆飞",palaces:j}}function Ie(s){return be($e(s),!0)}const ge={立春:1,惊蛰:2,清明:3,立夏:4,芒种:5,小暑:6,立秋:7,白露:8,寒露:9,立冬:10,大雪:11,小寒:12},Te={四正:8,四墓:5,四生:2},xe={四正:1,四墓:7,四生:4},ve={四正:9,四墓:3,四生:6},Ee=s=>["子","午","卯","酉"].includes(s)?"四正":["辰","戌","丑","未"].includes(s)?"四墓":"四生",ke=s=>L(((s-4)%60+60)%60).branch;function A(s,c,j){let T=null;for(const I of s){if(I.jd>j)break;I.name===c&&(T=I)}return T}function O(s,c){const j=A(s,"冬至",c),T=A(s,"夏至",c);if(!!j&&(!T||j.jd>T.jd)){const B=A(s,"谷雨",c),z=A(s,"雨水",c);return B&&j&&B.jd>j.jd?{half:"阳遁",segment:"谷雨–夏至(下元)",offset:3,boundary:"冬至后阳遁,谷雨至上元转下元"}:z&&j&&z.jd>j.jd?{half:"阳遁",segment:"雨水–谷雨(中元)",offset:6,boundary:"冬至后阳遁,雨水至上元转中元"}:{half:"阳遁",segment:"冬至–雨水(上元)",offset:0,boundary:"冬至后阳遁上元"}}const Y=A(s,"霜降",c),E=A(s,"处暑",c);return Y&&T&&Y.jd>T.jd?{half:"阴遁",segment:"霜降–冬至(下元)",offset:3,boundary:"夏至后阴遁,霜降至上元转下元"}:E&&T&&E.jd>T.jd?{half:"阴遁",segment:"处暑–霜降(中元)",offset:6,boundary:"夏至后阴遁,处暑至上元转中元"}:{half:"阴遁",segment:"夏至–处暑(上元)",offset:0,boundary:"夏至后阴遁上元"}}function w(s){const c=Number(s.year),j=Number(s.month),T=Number(s.day),I=Number.isInteger(s.hour)?s.hour:12,Y=Number.isInteger(s.minute)?s.minute:0,E=W({year:c,month:j,day:T,hour:I,minute:Y}),B=S(c),z=fe(c,j,T),D=ke(z),se=Ee(D),re=$(B,E),te=ge[re?re.name:"立春"]||1,oe=O(B,E),ce=U(c,j,T)+(I>=23?1:0),pe=C(ce),Me=L(pe).name,Ye=L(pe).branch,Ae=Ee(Ye),Se=Math.floor((I+1)%24/2),Ce=$e(z),qe=he(Te[se]-(te-1)),de=he(pe+1+oe.offset),we=oe.half==="阳遁"?de:he(10-de),Qe=oe.half==="阳遁"?xe[Ae]:ve[Ae],cn=he(Qe+(oe.half==="阳遁"?Se:-Se));return{year:{...be(Ce,!0),basis:`${z} 年(立春界)年星 ${M[Ce].name} 入中顺飞`},month:{...be(qe,!0),basis:`${D}年(${se})${re?re.name:"立春"}月,${te} 月 ${M[qe].name} 入中顺飞`},day:{...be(we,oe.half==="阳遁"),basis:`${oe.half}·${oe.segment},${Me}日第 ${pe+1} 位,${M[we].name} 入中${oe.half==="阳遁"?"顺":"逆"}飞`},hour:{...be(cn,oe.half==="阳遁"),basis:`${oe.half}·${oe.segment},${Ae}日 ${R[Se]}时,${M[cn].name} 入中${oe.half==="阳遁"?"顺":"逆"}飞`},meta:{guaYear:z,yearBranch:D,yearGroup:se,monthNum:te,monthJie:re?re.name:"立春",dayGanzhi:Me,daySeq:pe+1,dayGroup:Ae,hourBranch:R[Se],half:oe.half,segment:oe.segment,boundary:oe.boundary,note:"月按节气月(寅月为正月);日按公历日、23:00 后归次日;日/时星入中后的顺逆取「冬至顺、夏至逆」。另有「一律顺飞」与「月按农历月」派,本插件不合并,差异见本注。"}}}const X=s=>String(s).padStart(2,"0");function F(s){const c=Math.floor((s-1864)/20),j=(c%9+9)%9+1,T=1864+20*c;return{period:j,start:T,end:T+19,label:`${j}运(${T}–${T+19})`}}const ee=new Set(["乾","巽","艮","坤","甲","庚","壬","丙","寅","申","巳","亥"]),ue=["地元","天元","人元"],ye={};l.forEach((s,c)=>{ye[s.m]={...s,yuan:ue[c%3],yinYang:ee.has(s.m)?"阳":"阴"}});const Oe=["中","乾","兑","艮","离","坎","坤","震","巽"],Fe=["坎","坤","震","巽","中","乾","兑","艮","离"],Ue={地元:0,天元:1,人元:2},_e=s=>l.filter(c=>c.gua===s).map(c=>ye[c.m]);function Pe(s,c){const j={};for(let T=0;T<9;T++){const I=((s-1+(c?T:-T))%9+9)%9+1;j[Oe[T]]=I}return j}function en(s,c){if(c===5)return{forward:s.yinYang==="阳",basis:`五黄入中,按${s.m}本山${s.yuan}${s.yinYang}论`};const j=Fe[c-1],T=_e(j)[Ue[s.yuan]];return{forward:T.yinYang==="阳",basis:`${c}${j}宫取${s.yuan}${T.m}(${T.yinYang})`}}const nn="《沈氏玄空学》坤壬乙诀(子癸甲申一白、壬卯乙未坤二黑、乾亥辰巽巳戌六白、酉辛丑艮丙七赤、寅午庚丁九紫)",Le=Object.freeze({子:1,癸:1,甲:1,申:1,壬:2,卯:2,乙:2,未:2,坤:2,乾:6,亥:6,辰:6,巽:6,巳:6,戌:6,酉:7,辛:7,丑:7,艮:7,丙:7,寅:9,午:9,庚:9,丁:9}),ze=4.5;function Be(s,c=0){const j=Number(c)||0;if(Math.abs(j)<=ze)return{active:!1,offset:j,threshold:ze,sitting:s.m,jian:null,kind:null,sameYinYang:null,note:`坐山偏离中心 ${j}°,未超 ${ze}°,按正向下卦排盘。`};const T=l.findIndex(z=>z.m===s.m),I=l[(T+(j>0?1:-1)+24)%24],Y=ye[s.m],E=ye[I.m],B=I.gua===s.gua;return{active:!0,offset:j,threshold:ze,sitting:s.m,jian:I.m,side:j>0?"右":"左",kind:B?"同卦兼":"出卦兼",sameYinYang:E.yinYang===Y.yinYang,note:`坐山偏离中心 ${j}°,兼${I.m}(${B?"同卦兼":"出卦兼"}${B&&E.yinYang===Y.yinYang?",同阴同阳":""});按沈氏替卦,山星以 ${Le[s.m]} 入中。`}}const He={1:[],2:[["乾","巽"],["亥","巳"],["丑","未"]],3:[["卯","酉"],["乙","辛"],["辰","戌"]],4:[["艮","坤"],["寅","申"],["甲","庚"]],5:[["子","午"],["癸","丁"],["卯","酉"],["乙","辛"],["丑","未"],["辰","戌"]],6:[["艮","坤"],["寅","申"],["甲","庚"]],7:[["卯","酉"],["乙","辛"],["辰","戌"]],8:[["乾","巽"],["亥","巳"],["丑","未"]],9:[]},Je=["三元九运(1864 年起一运、每运 20 年,九运 180 年一轮)","玄空下卦挨星(运盘顺飞;山盘/向盘以入中运星本宫同元龙阴阳定顺逆,五黄入中按本山阴阳)","兼向替卦:坐山偏离中心超 4.5° 用《沈氏玄空学》坤壬乙诀替星入中,顺逆按替星本宫同元龙","年月日时紫白(公式派:年逐年退一位;月按年支三组起 8/5/2;日按冬至夏至三段起 1/7/4 与 9/3/6;时按日支三组子时起 1/7/4 与 9/3/6)","二十四山旺山旺向通行表(每项含正反两向;一运、九运无局;只对正向下卦)"],Xe="玄空排盘为传统通行口径的本地计算,属民俗参考,不构成现场勘舆结论,仅供娱乐;兼向超 4.5° 按沈氏替卦,年月日时紫白按公式派;各家另有异说,形峦与现场勘舆不在本工具范围内。";function We(s,c,j,T={}){const I=ye[c],Y=ye[j],E=Number(T.offset)||0,B=Be(I,E),z=Pe(s,!0),D=B.active?Le[I.m]:z[I.gua],se=B.active?Le[Y.m]:z[Y.gua],re=en(I,D),te=en(Y,se),oe=Pe(D,re.forward),ce=Pe(se,te.forward),pe=le.map((de,we)=>({palace:de,direction:de==="中"?"中宫":N[de],luoshu:we+1,yun:z[de],shan:oe[de],xiang:ce[de]})),Me=de=>le.filter(we=>de[we]===s),Ye=He[s],Ae=Ye.find(([de,we])=>I.m===de&&Y.m===we||I.m===we&&Y.m===de),Se=oe[I.gua]===s&&ce[Y.gua]===s,Ce={shan:B.active&&D!==z[I.gua],xiang:B.active&&se!==z[Y.gua]},qe=B.active?`替卦盘不套正向旺山旺向表;${Se?"本盘当运山星/向星仍到坐向。":"本盘当运山星/向星未同时到坐向。"}${!Ce.shan&&!Ce.xiang?"山向两替星均「用替而未替」,实际仍按原卦气。":""}`:Se&&Ae?"盘面与表法一致:本局到山到向。":Se?"盘面到山到向,但不在通行表法所列之局(表法与盘面口径不同,并列不合并)。":Ae?"通行表法列为旺山旺向,但本盘当运山星/向星未同时落坐向(表法与盘面口径不同,并列不合并)。":"本局既未到山到向,也不在表法旺山旺向之列。";return{palaces:pe,sitting:I,facing:Y,yun:z,shan:oe,xiang:ce,yunCenter:s,jianXiang:B,shanCenter:{star:D,...re,mode:B.active?"替卦":"下卦",original:z[I.gua],replaced:Ce.shan},xiangCenter:{star:se,...te,mode:B.active?"替卦":"下卦",original:z[Y.gua],replaced:Ce.xiang},dangYun:{shan:Me(oe),xiang:Me(ce)},heshi:{shan:le.filter(de=>oe[de]+z[de]===10),xiang:le.filter(de=>ce[de]+z[de]===10)},wangShanWangXiang:{byChart:Se,byTable:B.active?null:!!Ae,table:Ye.map(([de,we])=>`${de}${we}`),note:qe}}}function Ke(s){const c=s.dst===!1?{year:s.year,month:s.month,day:s.day,hour:0,minute:0,applied:!1,note:null}:u({year:s.year,month:s.month,day:s.day,hour:0,minute:0});return{year:c.year,month:c.month,day:c.day,dst:c}}const Re=["大游年歌(八宅通行口径)","年家紫白飞星(纯公式:以 2026 丙午一白入中、逐年退一位、九年一轮;按立春换年)","24 山归属与度数(八宅通行口径,每山 15°)"],tn="八宅与飞星为传统通行口径的本地计算,属民俗参考,不构成现场勘舆结论,仅供娱乐;实际户型以现场为准。";function dn(s){if(s.action==="advise")return an(s);if(s.action==="xuankong")return rn(s);const c=s.gender;if(c!=="male"&&c!=="female")throw b("E_INPUT","风水命卦需要性别:男女命卦算法不同,不可缺省");if(!Number.isInteger(s.year)||!Number.isInteger(s.month)||!Number.isInteger(s.day))throw b("E_INPUT","风水命卦需要完整出生年月日(公历)——只知道年份不够:命卦按立春界划分出生年");const j=Ke(s),T=fe(j.year,j.month,j.day),{num:I,gua:Y,direction:E}=P(T,c),B=ae(Y),z=["坎","离","震","巽"].includes(Y),D=Number.isInteger(s.fortuneYear)?s.fortuneYear:null;return{system:"fengshui",meta:{birth:`${j.year}-${X(j.month)}-${X(j.day)}`,guaYear:T,gender:c==="male"?"男":"女",fortuneYear:D,...j.dst.applied?{dst:j.dst.note}:{},...D===null?{note:"未给流年:未算年紫白飞星(需要时补 fortuneYear)。"}:{},scope:"八宅命卦 + 大游年八星 + 年紫白;玄空飞星见 action=xuankong;不含形峦与现场勘舆。"},mingGua:{num:I,gua:Y,direction:E,group:z?"东四命":"西四命",compatible:z?"宜东四宅(坐坎离震巽)":"宜西四宅(坐乾坤艮兑)"},luckyDirections:ne.map(se=>({star:se,...B[se]})),unluckyDirections:i.map(se=>({star:se,...B[se]})),...D===null?{}:{yearlyFlying:Ie(D)},sources:Re,disclaimer:tn}}function on(s){const c=typeof s.sitting=="string"&&s.sitting.trim()!=="",j=typeof s.facing=="string"&&s.facing.trim()!=="";if(!c&&!j)throw b("E_INPUT","缺少坐向:sitting(坐山)或 facing(向山)至少给一个——按罗盘 24 山报坐或报向,例如「坐北朝南」对应坐子向午");if(c&&j){const Y=g(s.sitting.trim()),E=g(s.facing.trim());if((Y.index+12)%24!==E.index)throw b("E_INPUT",`坐向不自洽:坐${Y.m}(${Y.deg}°)与向${E.m}(${E.deg}°)不是对宫(相差应 180°,实测 ${(E.deg-Y.deg+360)%360}°)——请核对罗盘读数。`)}const T=c?g(s.sitting.trim()):_(s.facing.trim()),I=l[(T.index+12)%24];return{sitting:T,facing:I}}function an(s){const{sitting:c,facing:j}=on(s),T=c.gua,I=ae(T),Y=ne.map(te=>I[te]),E=i.map(te=>I[te]),B=te=>`${te.direction}(${te.palace}宫)`,z=[...ne,...i].map(te=>({star:te,lucky:ne.includes(te),...I[te],role:f[te]})),D={door:`门宜开于吉方:首选生气方 ${B(Y[0])},次选延年方 ${B(Y[1])}、天医方 ${B(Y[2])}。`,stove:`灶宜「坐凶向吉」:灶身压凶方(首选绝命方 ${B(E[0])}、五鬼方 ${B(E[1])}),灶口朝吉方。`,bed:`主卧与床头宜安吉方:生气方 ${B(Y[0])} 或延年方 ${B(Y[1])};床头宜向吉方。`,toilet:`厕所宜压凶方:祸害方 ${B(E[3])} 或六煞方 ${B(E[2])}(污去凶气,宜静常闭)。`};let se=null;const re=Number.isInteger(s.year)&&Number.isInteger(s.month)&&Number.isInteger(s.day)&&(s.gender==="male"||s.gender==="female");if(re){const te=Ke(s),oe=fe(te.year,te.month,te.day),ce=P(oe,s.gender),pe=y(ce.gua),Me=y(T),Ye=pe===Me,Ae=ne.map(Se=>`${Se}位${ae(ce.gua)[Se].direction}`).join("、");se={birth:`${te.year}-${X(te.month)}-${X(te.day)}`,guaYear:oe,gender:s.gender==="male"?"男":"女",mingGua:{gua:ce.gua,direction:ce.direction,group:`${pe}命`},houseGua:{gua:T,group:`${Me}宅`},sameGroup:Ye,text:Ye?`命宅相配(${pe}命住${Me}宅):以宅之八星盘布局即可,个人吉方与宅吉方大体同向。`:`命宅不配(${pe}命住${Me}宅):传统调停法——门与床以命卦吉方为先(此命四吉方:${Ae}),灶仍按宅卦坐凶向吉,两盘各自取用。`}}return{system:"fengshui",meta:{action:"advise",...re?{}:{birthNote:"未提供生辰:未做命宅配;如需按个人命卦调停门床,请补充出生年月日与性别。"},sitting:`${c.m}山(罗盘 ${c.deg}°)`,facing:`${j.m}山(罗盘 ${j.deg}°)`,houseGua:T,houseGroup:`${y(T)}宅`,scope:"门主灶厕走向按八宅通行口径给倾向,玄空飞星见 action=xuankong;不含形峦、不是现场勘舆结论。"},houseStars:z,layout:D,...se?{mingMatch:se}:{},sources:Re,disclaimer:tn}}function Ze(s,c,j){const T=z=>z!=null&&z!=="",I=(z,D)=>{if(typeof z!="number"||!Number.isFinite(z))throw b("E_INPUT",`${D} 必须是数字(度),收到「${z}」`);return z},Y=(z,D,se)=>{const re=I(z,se);if(re<0||re>360)throw b("E_INPUT",`${se} 必须在 0–360° 之间(罗盘度数),收到「${re}」`);const te=(re-D.deg+540)%360-180;if(Math.abs(te)>7.500000001)throw b("E_INPUT",`${se} ${re}° 不在${D.m}山范围内(${D.m}中心 ${D.deg}°,每山 15°),请核对坐向。`);return te},E=[];if(T(s.sittingOffset)&&E.push(I(s.sittingOffset,"sittingOffset")),T(s.sittingDegree)&&E.push(Y(s.sittingDegree,c,"sittingDegree")),T(s.facingOffset)&&E.push(I(s.facingOffset,"facingOffset")),T(s.facingDegree)&&E.push(Y(s.facingDegree,j,"facingDegree")),!E.length)return{offset:0,source:"未报兼向度数,按正向(0°)"};const B=E[0];if(E.some(z=>Math.abs(z-B)>1e-9))throw b("E_INPUT",`坐向兼度不一致:${E.join("° / ")}°——坐与向应同向偏离,请只报一个偏移或核对度数。`);if(Math.abs(B)>7.5+1e-9)throw b("E_INPUT",`兼向偏移必须在 −7.5°–7.5°(相对本山中心),收到「${B}」——超过 7.5° 已进入下一山。`);return{offset:B,source:"按所报兼向度数"}}function sn(s){const c=re=>re!=null&&re!=="";if(!c(s.fortuneDate))return null;if(typeof s.fortuneDate!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(s.fortuneDate))throw b("E_INPUT",`fortuneDate 需为 YYYY-MM-DD,收到「${s.fortuneDate}」`);const[j,T,I]=s.fortuneDate.split("-").map(Number),Y=new Date(Date.UTC(j,T-1,I));if(Y.getUTCFullYear()!==j||Y.getUTCMonth()!==T-1||Y.getUTCDate()!==I)throw b("E_INPUT",`fortuneDate 不是有效日期:「${s.fortuneDate}」`);const E=c(s.fortuneTime)?s.fortuneTime:"12:00";if(typeof E!="string"||!/^\d{2}:\d{2}$/.test(E))throw b("E_INPUT",`fortuneTime 需为 HH:MM,收到「${E}」`);const[B,z]=E.split(":").map(Number);if(B>23||z>59)throw b("E_INPUT",`fortuneTime 超出范围(HH:MM):「${E}」`);const D=s.dst===!1?null:u({year:j,month:T,day:I,hour:B,minute:z});return{at:D?{year:D.year,month:D.month,day:D.day,hour:D.hour,minute:D.minute}:{year:j,month:T,day:I,hour:B,minute:z},dst:D}}function rn(s){const{sitting:c,facing:j}=on(s),T=Ze(s,c,j),I=sn(s);let Y,E=null,B;if(s.period!==void 0&&s.period!==null&&!Number.isInteger(s.period))throw b("E_INPUT",`运必须是 1–9 的整数(三元九运),收到「${s.period}」——一运 1864 起、九运 2024–2043。`);if(Number.isInteger(s.period)){if(s.period<1||s.period>9)throw b("E_INPUT",`运必须是 1–9 的整数(三元九运),收到「${s.period}」——一运 1864 起、九运 2024–2043。`);Y=s.period}else Number.isInteger(s.fortuneYear)?(E=F(s.fortuneYear),Y=E.period):I?(E=F(fe(I.at.year,I.at.month,I.at.day)),Y=E.period,B=`未显式给运:按飞星日期归入 ${E.label}。`):(Y=9,B="未给运:默认按九运(2024–2043)排盘;可传 period(1–9)或 fortuneYear 指定。");const z=We(Y,c.m,j.m,{offset:T.offset}),D=ye[c.m],se=ye[j.m],re=ce=>({star:ce.star,name:M[ce.star].name,fly:ce.forward?"顺飞":"逆飞",basis:ce.basis,mode:ce.mode,original:ce.original,replaced:ce.replaced}),te=ce=>ce.map(pe=>pe==="中"?"中宫":`${pe}宫${N[pe]}`).join("、")||"无";let oe=null;if(I)oe=w(I.at),I.dst&&I.dst.applied&&(oe.meta.dst=I.dst.note);else if(Number.isInteger(s.fortuneYear)){const ce=$e(s.fortuneYear);oe={year:{...be(ce,!0),basis:`${s.fortuneYear} 年紫白 ${M[ce].name} 入中顺飞`},month:null,day:null,hour:null,meta:{guaYear:s.fortuneYear,note:"只给年份:已排年紫白;补 fortuneDate(YYYY-MM-DD)与 fortuneTime(HH:MM)可排月、日、时。"}}}return{system:"fengshui",meta:{action:"xuankong",period:Y,periodLabel:E?E.label:`${Y}运`,...E?{year:s.fortuneYear||I&&I.at.year,periodStart:E.start,periodEnd:E.end}:{},sitting:`${c.m}山(罗盘 ${c.deg}°)`,facing:`${j.m}山(罗盘 ${j.deg}°)`,sittingGua:c.gua,facingGua:j.gua,sittingYuan:`${D.yuan}${D.yinYang}`,facingYuan:`${se.yuan}${se.yinYang}`,sittingOffset:T.offset,jianXiang:z.jianXiang,shanCenter:re(z.shanCenter),xiangCenter:re(z.xiangCenter),...B?{note:B}:{},scope:"玄空下卦/替卦:运盘 + 山盘 + 向盘 + 当运星 + 合十 + 表法旺山旺向;兼向超 4.5° 按沈氏替卦;年月日时紫白按公式派;不含形峦与现场勘舆。"},palaces:z.palaces,dangYun:{shan:{palaces:z.dangYun.shan,text:te(z.dangYun.shan)},xiang:{palaces:z.dangYun.xiang,text:te(z.dangYun.xiang)}},heshi:{shan:z.heshi.shan,xiang:z.heshi.xiang},wangShanWangXiang:z.wangShanWangXiang,...oe?{timeFlying:oe}:{},sources:Je,disclaimer:Xe}}return{NINE_STARS:M,PALACE_DIRECTION:N,DAYOUTIAN:q,LUCKY_STARS:ne,UNLUCKY_STARS:i,MOUNTAINS_24:l,mountainInfo:g,sittingFromFacing:_,STAR_LAYOUT_ROLE:f,mingGua:P,eightStars:ae,guaYearOf:fe,yearZibaiStar:$e,yearlyFlying:Ie,timeFlyingOf:w,periodOfYear:F,MOUNTAIN_META:ye,TIGUA_SOURCE:nn,TIGUA_TABLE:Le,JIAN_XIANG_THRESHOLD:ze,jianXiangOf:Be,WANG_SHAN_WANG_XIANG:He,XUANKONG_SOURCES:Je,XUANKONG_DISCLAIMER:Xe,xuankongChart:We,buildFengshui:dn}})(),k.followup=(function(){const{ZIWEI_STARS:W}=k["interpret-data"]||{},J=[{key:"career",label:"事业",words:["事业","工作","跳槽","升职","创业","职业","岗位","离职","加薪","面试","offer"]},{key:"wealth",label:"财富",words:["财","钱","收入","投资","买房","存款","亏","赚","分红"]},{key:"love",label:"感情",words:["感情","婚","恋","对象","分手","复合","姻缘","结婚","桃花"]},{key:"health",label:"健康",words:["健康","病","身体","手术","失眠","体检","医院"]},{key:"study",label:"学业",words:["学业","考试","学习","考研","考公","证书","升学"]},{key:"travel",label:"出行",words:["出行","搬家","旅行","出国","迁","远行"]}],U={career:"官禄",wealth:"财帛",love:"夫妻",health:"疾厄",study:"官禄",travel:"迁移",overall:"命宫"},C=(i,l)=>{const r=String(i).match(/(20\d{2})\s*年?/);if(r)return Number(r[1]);const g=Array.isArray(l.liunian)&&l.liunian[0]?Number(l.liunian[0].year):null;return g?/明年/.test(i)?g+1:/后年/.test(i)?g+2:/去年/.test(i)?g-1:/今年|本年/.test(i)?g:null:null},L=i=>J.find(l=>l.words.some(r=>String(i).includes(r)))||null;function S(i,l){const r=C(l,i),g=L(l),_=Array.isArray(i.liunian)?i.liunian:[],y=Array.isArray(i.dayun?.list)?i.dayun.list:[],f=_.map(x=>x.year);if(r&&!_.some(x=>Number(x.year)===r))return{ok:!1,year:r,topic:g,answer:`这一盘已排的流年范围是 ${f[0]}–${f[f.length-1]},没有 ${r} 年。可以把问题改到范围内,或用 asOf 指定你想看的年份重新排盘。`,evidence:[`已排流年:${f.join("、")}`],confidence:"弱"};if(r){const x=_.find(he=>Number(he.year)===r),P=y.find(he=>Number(he.startAge)<=Number(x.age)&&Number(x.age)<=Number(he.startAge)+9)||null,ae=x.luck?.tier||"平",fe=(x.luck?.reasons||[]).slice(0,3),$e=(x.relations||[]).join("、"),le=g?R(i,g.key):"";return{ok:!0,year:r,topic:g,answer:`${r} 年(${x.ganzhi})流年,十神为${x.stemTenGod||"—"},档位「${ae}」;所行大运 ${P?`${P.ganzhi}(${P.luck?.tier||"平"})`:"未取到"}。${fe.length?`理由:${fe.join(",")}。`:""}${$e?`与该年地支相关的原局关系:${$e}。`:""}${le}`,evidence:[`流年 ${x.year} ${x.ganzhi}·${x.stemTenGod||""}·${ae}`,P?`大运 ${P.ganzhi}·${P.luck?.tier||"平"}`:"",$e?`原局关系 ${$e}`:"",g?`问题方向:${g.label}`:""].filter(Boolean),confidence:P&&fe.length?"强":"中"}}if(g){const x={wealth:"overall",study:"work",travel:"overall"}[g.key]||g.key,P=(i.interpret?.dimensions||[]).find(ae=>ae.key===g.key||ae.key===x);if(P){const ae=i.frame&&i.frame.godStats&&i.frame.godStats.groups||{},fe=g.key==="wealth"?` 财星权重 ${Number(ae.财||0)}(只作结构参考,不含金额)。`:"";return{ok:!0,year:null,topic:g,answer:`按${g.label}这条线看:${P.text}${fe}${P.advice?` 建议:${P.advice}`:""}`,evidence:(P.evidence||[]).slice(0,4),confidence:P.confidence||"中"}}}return{ok:!1,year:null,topic:g,answer:`这个问题里没有识别到具体的年份或方面。可以这样问:「2027 年事业怎么样」「财运如何」「感情在 2028 年」;已排流年是 ${f[0]}–${f[f.length-1]}。`,evidence:[`可问年份:${f.join("、")}`],confidence:"弱"}}function $(i,l){const r=C(l,i),g=L(l),_=Array.isArray(i.liunian)?i.liunian:[];if(r&&!_.some(y=>Number(y.year)===r))return{ok:!1,year:r,topic:g,answer:`这一盘的流年表覆盖 ${_[0]?.year}–${_[_.length-1]?.year},没有 ${r} 年;可以换一个年份,或用 asOf 指定起点重新排盘。`,evidence:[`流年表:${_.map(y=>y.year).join("、")}`],confidence:"弱"};if(r){const y=_.find(x=>Number(x.year)===r),f=y.daxian||{};return{ok:!0,year:r,topic:g,answer:`${r} 年(${y.ganzhi},${y.age} 岁)流年命宫落在「${y.lifePalace?y.lifePalace.palace:"—"}」,四化为 ${(y.mutagen||[]).join("、")||"不明显"};所行大限${f.palace?`在${f.palace}(${f.start}–${f.end} 岁)`:"未取到"}。${g?`与「${g.label}」对应的宫位信号见下条依据。`:""}`,evidence:[`流年命宫 ${y.lifePalace?y.lifePalace.palace:"—"}(${y.lifePalace?y.lifePalace.branch:"—"})`,`四化 ${(y.mutagen||[]).join("、")||"不明显"}`,f.palace?`大限 ${f.palace}·${f.start}–${f.end}岁`:""].filter(Boolean),confidence:(y.mutagen||[]).length>=3?"强":"中"}}if(g){const y=U[g.key]||"命宫",f=(i.palaces||[]).find(x=>x.palace===y);if(f){const x=(f.stars||[]).filter(ae=>ae.type==="主星").map(ae=>ae.name),P=x.map(ae=>W[ae]?.trait).filter(Boolean).slice(0,2).join(";");return{ok:!0,year:null,topic:g,answer:`「${g.label}」看${y}:主星${x.length?x.join("、"):"无正曜(借对宫)"}${P?`——${P}`:""}。宫支${f.branch},${f.stems,""}生年四化与煞星的影响需结合报告里的对应分节一起看。`,evidence:[`${y} ${f.branch}·${x.join("、")||"无正曜"}`,...(f.shensha||[]).slice(0,3)],confidence:x.length?"强":"弱"}}}return{ok:!1,year:null,topic:g,answer:"没有识别到具体年份或方面。可以问「2028 年事业」「感情怎么样」「财运在 2030 年」;也可以直接问某个宫位,如「夫妻宫」。",evidence:[],confidence:"弱"}}function R(i,l){return`这段时间可以重点对照报告里「${{career:"事业",wealth:"财富",love:"感情",health:"健康",study:"学业",travel:"出行"}[l]||"整体"}」一节看。`}function u(i,l){const r=L(l),g=Array.isArray(i.interpret?.sections)?i.interpret.sections:[],_=r?g.find(f=>f.label.includes(r.label)||f.text.includes(r.label)):null;if(_)return{ok:!0,year:null,topic:r,answer:_.text,evidence:[`引用分节:${_.label}`],confidence:"中"};const y=g[0];return{ok:!1,year:null,topic:r,answer:y?`这一盘的追问需要落到具体方面(事业 / 财富 / 感情 / 健康 / 学业 / 出行)。先看「${y.label}」这一节,或把问题说得更具体一点。`:"这一盘暂时没有可追问的分节;先看完整解析,再问具体方面。",evidence:[],confidence:"弱"}}function b(i,l){const r=String(l||"").trim(),g=i&&i.system==="bazi"?S(i,r):i&&i.system==="ziwei"?$(i,r):u(i,r);return{question:r,...g}}const M={bazi:"八字(四柱)",ziwei:"紫微斗数",liuyao:"六爻",meihua:"梅花易数",daliuren:"大六壬",qimen:"奇门遁甲",tarot:"塔罗",hepan:"合盘",chenggu:"称骨",almanac:"黄历",zeri:"择日",star:"星座",numerology:"生命数字",mbti:"十六型人格",trend:"人生 K 线",fengshui:"风水",name:"起名",convert:"公农历互转"},N=Object.freeze({bazi:["基本信息","四柱(日主/十神/藏干)","旺衰·格局·用神","合冲·神煞","起运·大运·流年","古籍依据"],ziwei:["基本信息","命宫/身宫与五行局","十二宫(主星/辅煞/四化)","格局与三方四正","大限/流年","古籍依据"],liuyao:["所问与用神","本卦/变卦(世应/动爻/六亲)","月建日辰(旺衰/空破)","应期线索","卦辞与依据"],meihua:["所问与体用","本卦/互卦/变卦","五行生克","应期与依据"],daliuren:["天地盘(月将/贵人)","四课","三传","课体与神将","依据"],qimen:["四柱与局数","九宫(星门神/天盘干)","用神落宫","门宫·干宫·十干克应","旺衰·击刑入墓","依据"],tarot:["问题与牌阵","逐牌(正逆/元素)","牌间关系","综合倾向","边界"],fengshui:["坐向与元运","运盘/山盘/向盘","旺山旺向","取象与边界"]}),v=Object.freeze(["基本信息","盘面事实","结构与关系","倾向","边界"]);function q(i){return N[i]||v}function ne(i,l={}){const r=M[i&&i.system]||i&&i.system||"未知体系",_=String(l&&l.question||"").trim()||"请先用一句白话讲清这张盘的主线,再指出最值得注意的一两处,并说明每处的具体依据。",y=Number.isFinite(l&&l.maxChars)&&l.maxChars>=400?l.maxChars:3e3,f=String(i&&i.summary||"").trim(),x=f.length>y,P=x?`${f.slice(0,y)}…(摘要已截断)`:f,ae=l&&typeof l.interpret=="object"&&l.interpret||i&&typeof i.interpret=="object"&&i.interpret||null,fe=String(ae&&ae.answer||"").trim(),$e=String(ae&&ae.plain||"").trim(),le=[];fe&&le.push(`直答:${fe}`),$e&&le.push(`说人话:${$e}`);const be=["【命理追问】下面这张盘是命理插件刚排好的,请就着它回答我的问题;不用重新排盘,盘面字段已经够用。",`体系:${r}`,`所问:${_}`,"",...le.length?["——开场结论(插件已按同一套规则算好,开场先沿用这句;措辞可改,口径别换)——",...le,""]:[],"——盘面层次(从上到下读,别跳层)——",`${r}:${q(i&&i.system).join(" → ")}`,"先复述事实,再讲结构与时间;上一层没交代清楚,不要跳到下一层。","","——盘面摘要——",P||"(这张盘没有摘要字段,请先让我重新排一次。)","","——回答要求——","读者不懂命理。按下面的骨架答;任何一句他看不懂,就算没写完:",le.length?"1) 开头一句结论:先沿用上面的「开场结论」,再用一句不用术语的话说清这张盘的主线——只读这一句也该有收获;":"1) 开头一句结论:不用术语,一句话说清这张盘的主线,只读这一句也该有收获;","2) 第二段只复述盘面骨架:按上面的层次用 2–4 行写事实(如四柱、格局、用神、大运),不掺倾向,让读者知道后面的判断从哪来;","3) 判断最多两条,按重要性排序,每条分四行写:"," 盘面|只引盘面已有的字(具体的柱、宫或爻、字段名),不掺解释;"," 白话|把上一行的术语当场翻成日常话——调候 / 化气 / 通关 / 空亡 / 争合 这类词必须落地,一个词只翻一次,不连续堆三个以上;"," 倾向|说「更可能……」,讲清它在现实里大概意味着什么,用概率语气;"," 边界|这条在什么情况下不成立;盘面没给的,直接写「这盘里看不出来」;","4) 收尾一句「如果只记一件事」:给一条能核对、能动手的观察点,并说明它出自上面哪条盘面依据;","5) 别把传统说法当成已证实的事实:不下绝对断言,也不用「肯定」「绝对」这类词,更不写「格局很好」「运程不顺」这种没有信息的空话。"].join(`
|
|
68
|
+
`);return{text:be,question:_,system:i&&i.system||"",label:r,chars:be.length,truncated:x}}return{followup:b,READING_ORDERS:N,READING_ORDER_FALLBACK:v,readingOrderOf:q,askPrompt:ne}})(),k.index=(function(){const{buildBazi:W}=k.bazi||{},{buildLiuyao:J,tossLines:U,bodyLabels:C,yongshenOf:L,yongshenStrength:S,fushenAccess:$,hexagramStrength:R,jinTuiPower:u,yingqiWindow:b}=k.liuyao||{},{buildZiwei:M,BRIGHTNESS:N,flowOf:v,asOfParts:q,ZIWEI_SCHOOL_DEFAULTS:ne}=k.ziwei||{},{drawTarot:i}=k.tarot||{},{buildMeihua:l}=k.meihua||{},{buildDaliuren:r}=k.daliuren||{},{buildHepan:g}=k.hepan||{},{buildZiweiHepan:_}=k["ziwei-hepan"]||{},{buildQimen:y,buildSnapshot:f}=k.qimen||{},{geocodeAddress:x,resolveAddress:P}=k.geo||{},{toJDN:ae,ganzhiName:fe,dayGanzhiIndex:$e}=k.calendar||{},{randomOf:le,isSeed:he}=k.random||{},{interpret:be,DIRECTIONS:Ie,DIRECTION_DEFAULT:ge}=k.interpret||{},{followup:Te,askPrompt:xe}=k.followup||{},{crossCheck:ve,crossText:Ee,crossSection:ke}=k.crosscheck||{},{pastSignals:A,verifyFit:O}=k.verify||{},{rectifyBirth:w}=k.rectify||{},{buildAlmanac:X}=k.almanac||{},{buildZeri:F}=k.zeri||{},{buildChenggu:ee}=k.chenggu||{},{buildXiaoliuren:ue}=k.xiaoliuren||{},{buildStar:ye}=k.star||{},{buildNumerology:Oe}=k.numerology||{},{buildMbti:Fe,mbtiPaper:Ue}=k.mbti||{},{buildConvert:_e}=k.convert||{},{classicsFor:Pe,classicsText:en,suiyunClassicOf:nn,classicOf:Le,CLASSIC_BOOKS:ze}=k.classics||{},{diffObjects:Be,summarize:He,sortDiffs:Je,labelOf:Xe,rootOf:We,categoryOf:Ke,formatValue:Re,CALIBER_SWITCHES:tn}=k.diff||{},{canonicalJson:dn,fingerprintOf:on}=k.fingerprint||{},{buildTrend:an}=k.trend||{},{buildFengshui:Ze}=k.fengshui||{},{buildName:sn}=k.name||{},{buildTrace:rn,SYSTEM_LABEL:s}=k.trace||{},{fail:c}=k.fail||{},{assertCivil:j}=k.validate||{},T=e=>String(e).padStart(2,"0"),I=["male","female"];function Y(e,o){return o===2?e%4===0&&e%100!==0||e%400===0?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][o-1]}function E(e,o=""){if(I.includes(e))return e;const n=e==null||e===""?"(未提供)":`「${e}」`;throw c("E_INPUT",`${o?o+"的":""}gender 必须是 male 或 female${n};性别决定大运/大限顺逆,不能靠默认值`)}const B=["brightnessSchool","gengYearSihua","tianmaSchool","tiankongSchool","jiekongSchool","kuiyueSchool","tianshiTianshang","changshengSchool","lateZishi","shenzhuSchool"];function z(e){const o={};for(const n of B)e[n]!==void 0&&(o[n]=e[n]);return e.schools&&typeof e.schools=="object"&&(o.schools=e.schools),o}function D(e){if(typeof e!="string"||!e.trim())throw c("E_INPUT","缺少 datetime(公历日期时间),例如 1990-05-12T14:30");const o=e.trim().match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?$/);if(!o)throw c("E_INPUT",`无法解析 datetime:「${e}」,请用 1990-05-12T14:30 这种格式`);const n={year:Number(o[1]),month:Number(o[2]),day:Number(o[3]),hour:Number(o[4]??0),minute:Number(o[5]??0)};if(n.month<1||n.month>12)throw c("E_INPUT",`月份超出范围:${n.month}`);const t=Y(n.year,n.month);if(n.day<1||n.day>t)throw c("E_INPUT",`日期不存在:${n.year}-${n.month}-${n.day}(${n.year} 年 ${n.month} 月只有 ${t} 天)`);if(n.hour>23||n.minute>59)throw c("E_INPUT",`时间超出范围:${n.hour}:${n.minute}`);if(n.year<1600||n.year>2400)throw c("E_RANGE",`年份 ${n.year} 超出可计算范围(1600–2400)`);return(n.year<1900||n.year>2100)&&(n.precision={level:"approx",note:`ΔT 模型仅覆盖 1900–2100,${n.year} 年按端点值外推,节气与朔望时刻可能有分钟级偏差,月柱在交节前后需复核`}),n}function se(e){const o=e.pillars,n=(K,me)=>`${K}:${me.ganzhi} ${me.stemTenGod?`十神 ${me.stemTenGod} `:""}藏干 ${me.hidden.map(Ge=>`${Ge.stem}(${Ge.tenGod})`).join(" ")} 纳音 ${me.nayin} 地势 ${me.dishi} 自坐 ${me.zizuo} 空亡 ${me.kongwang.join("")}`+(me.shensha&&me.shensha.length?` 神煞 ${me.shensha.join("、")}`:""),t=Object.entries(e.wuxing).map(([K,me])=>`${K}${me}`).join(" "),a=e.palaces?`【胎元】${e.palaces.taiyuan.ganzhi} 胎息 ${e.palaces.taixi?e.palaces.taixi.ganzhi:"—"} 命宫 ${e.palaces.minggong.ganzhi} 身宫 ${e.palaces.shengong.ganzhi}`:"",m=e.dayun.list.slice(0,8).map(K=>`${K.startAge}岁 ${K.ganzhi}(${K.stemTenGod})${K.luck?`·${K.luck.tier}`:""}${K.relations&&K.relations.length?`[${K.relations.join("")}]`:""}`).join(" "),d=e.dayun.jiao&&e.dayun.jiao.at?`;交运 ${e.dayun.jiao.at}(${e.dayun.jiao.frame},距${e.dayun.jiao.from.name} ${e.dayun.jiao.spanDays} 天,三日折一年)`:"",p=e.jieqi.nearBoundaryMinutes<20?`
|
|
69
|
+
⚠ 出生时刻距「节」仅 ${e.jieqi.nearBoundaryMinutes} 分钟,而节气时刻本身有最多约 14 分钟的偏差,月柱与年柱建议人工复核。`:"",Z={year:"年",month:"月",day:"日",hour:"时"},V=e.shensha&&e.shensha.groups&&e.shensha.groups.length?`神煞(${e.shensha.count} 见):`+e.shensha.groups.map(K=>`${K.cat}|`+K.items.map(me=>`${me.name}(${me.pillars.map(Ge=>Z[Ge]).join("")})`).join("、")).join(";"):"神煞:—",H=e.renyuan,Q=Le("smt-renyuan"),h=H?`人元:${H.month}月第${H.day}日,${H.active}${H.activeElement}司权(${H.segments.map(K=>`${K.stem}${K.from}–${K.to}`).join(" ")})${H.beyond?";已过 30 日表,按本气算":""}${Q?`|原文见《${ze[Q.book].name}·${Q.chapter}》`:""}`:"",G=e.frame&&e.frame.yongshen&&e.frame.yongshen.disputed||[],ie=G.length?` 有争议:${G.map(K=>`${K.element}(${K.favorRole};${K.climate}盘调候忌${K.element})`).join("、")}`:"",je=new Set(G.map(K=>K.element)),De=e.frame?[`格局:${e.frame.primary?`${e.frame.primary.name}(${e.frame.primary.evidence})`:"—"}`,` ${e.frame.geju.map(K=>`${K.name}[${K.kind}${K.status?`·${K.status}`:""}]`).join(" ")}`,`用神:喜${e.frame.yongshen.favor.join("")}(${e.frame.yongshen.favorTenGods.join("、")}) 忌${e.frame.yongshen.avoid.join("")}(${e.frame.yongshen.avoidTenGods.join("、")})${ie} ${e.frame.yongshen.method}`,` ${e.frame.yongshen.detail}`,`寒暖:${e.climate?`${e.climate.label}(${(e.climate.evidence||[]).join("、")})${e.climate.need?` 调候取${e.climate.need.stem}${e.climate.need.element} 忌${e.climate.avoidElement}${je.has(e.climate.avoidElement)?"(有争议)":""}`:""}`:"—"}`+(e.frame.yongshen.qt?` 穷通:${e.frame.yongshen.qt.month}${e.frame.yongshen.qt.stem}取${e.frame.yongshen.qt.yong.join("、")}(首取${e.frame.yongshen.qt.primary})`:""),`十神权重:${Object.entries(e.frame.godStats.groups).map(([K,me])=>`${K}${me}`).join(" ")}`]:[];return[`【四柱】${o.year.ganzhi} ${o.month.ganzhi} ${o.day.ganzhi} ${o.hour.ganzhi}`,`日主:${e.dayMaster.stem}${e.dayMaster.element}(${e.dayMaster.yinYang}) 空亡:${e.kongwang.join("")}`,n("年柱",o.year),n("月柱",o.month),n("日柱",o.day),n("时柱",o.hour),`五行:${t}`,...a?[a]:[],`日主强弱:${e.strength.level}(${e.strength.score}) ${e.strength.detail}`,...De,`天干关系:${e.relations&&e.relations.stems.length?e.relations.stems.join(" "):"—"}`,`地支关系:${e.relations&&e.relations.branches.length?e.relations.branches.join(" "):"—"}`,V,`真太阳时:${e.solarTime.trueSolarText}(${e.input.geo?e.input.geo.note+";":""}${e.solarTime.note}) 晚子时:${e.input.lateZi?"23:00 后算次日":"23:00 后仍算当日"}`,`节气:上一节 ${e.jieqi.previous.name} ${e.jieqi.previous.time} 下一节 ${e.jieqi.next.name} ${e.jieqi.next.time}`,...h?[h]:[],`大运:${e.dayun.rule}(${e.dayun.direction}),${e.dayun.startAge.years}岁${e.dayun.startAge.months}个月起运${d}`,` ${m}`,`流年:${e.liunian.slice(0,10).map(K=>`${K.year}${K.ganzhi}(${K.stemTenGod})${K.luck?`·${K.luck.tier}`:""}`).join(" ")}`,(()=>{const K=e.liunian.filter(Ne=>Ne.suiyun&&Ne.suiyun.signals&&Ne.suiyun.signals.length);if(!K.length)return"岁运提示:近十年无岁运并临、运年反吟或大运/流年伏吟、反吟(只标干支,不判吉凶)";const me=Ne=>`${Ne.type}${(Ne.type.startsWith("流年")||Ne.type.startsWith("大运"))&&Ne.target?`(${Ne.target})`:""}`,Ge=nn(e),Gn=Ge?`|古籍见《${ze[Ge.book].name}·${Ge.chapter}》`:"";return"岁运提示(只标干支变动,不判吉凶):"+K.map(Ne=>`${Ne.year}${Ne.ganzhi} ${Ne.suiyun.signals.map(me).join("/")}`).join(";")+Gn})(),"(格局、用神、行运吉凶为扶抑+简化调候的量化提示,非断语。)"].join(`
|
|
70
|
+
`)+p}function re(e){const o=e.lunar.monthRaw||e.lunar.month,n=`${e.lunar.year}年${e.lunar.isLeap?`闰${o}`:e.lunar.month}月${e.lunar.day}日`+(e.lunar.isLeap&&e.lunar.month!==o?`(按${e.lunar.month}月起盘)`:""),t=(()=>{if(!e.schools)return"";const G=Object.entries({brightnessSchool:"亮度",gengYearSihua:"庚干四化",tianmaSchool:"天马",tiankongSchool:"天空",jiekongSchool:"截空",kuiyueSchool:"魁钺",tianshiTianshang:"天伤天使",changshengSchool:"长生",lateZishi:"晚子时",shenzhuSchool:"身主"}).filter(([ie])=>e.schools[ie]&&e.schools[ie]!==ne[ie]).map(([ie,je])=>`${je} ${e.schools[ie]}`);return G.length?`【流派】${G.join(" ")}`:""})(),a=h=>h.length?h.map(G=>`${G.name}${G.mutagen?`化${G.mutagen}`:""}`).join(" "):"—",m=h=>`神煞:长生(${h.changsheng}) 博士(${h.boshi}) 将前(${h.jiangqian}) 岁前(${h.suiqi})`,d=[];for(const h of e.palaces){const G=h.isSoul?"【命】":h.isBody?"【身】":" ";d.push(` ${h.palace} ${h.branch} ${h.ganzhi} ${G} 大限${String(h.daxian.start).padStart(2)}-${h.daxian.end} 小限${String(h.xiaoxian.age).padStart(2)} ${a(h.stars)}`),d.push(` ${m(h.shensha)}`)}const p=(e.liunian??[]).slice(0,6).map(h=>` ${h.year} ${h.ganzhi} ${String(h.age).padStart(2)}岁 命宫${h.lifePalace.branch}(${h.lifePalace.palace}) 流禄${h.liulu} 流羊${h.liuyang} 流陀${h.liutuo} | ${h.mutagen.map(G=>G.replace("化","")).join(" ")}`+(h.mutagenHits?` 四化落宫 ${h.mutagenHits.map(G=>`${G.star}${G.type}→${G.palace||"未上盘"}`).join("、")}`:"")+(h.sanfangMainStars?` 三方主星 ${h.sanfangMainStars.join("")}`:"")),Z=(e.patterns??[]).length?e.patterns.map(h=>`${h.name}(${h.tone==="good"?"吉格":h.tone==="bad"?"忌格":"中"}:${h.evidence})`).join(";"):"无明显格局(按内置规则)",V=(e.daxianList??[]).slice(0,8).map(h=>` ${h.branch}宫(${h.palace})${h.ages[0]}-${h.ages[1]}岁 ${h.ganzhi} 会${h.mainStars.join("")||"—"} 化 ${h.mutagenHits.map(G=>`${G.star}${G.type}→${G.palace||"未上盘"}`).join("、")}`),H=(()=>{const h=e.flyChains;if(!h)return"";const G=je=>{const De=h[je];return!De||!De.steps.length?"":`${je}:${De.path.join("→")}${De.closed?"(成环)":""}`},ie=["禄","权","科","忌"].map(G).filter(Boolean).join(" ");return ie?`【命宫飞星】${ie}`:""})(),Q=(()=>{const h=e.flyComposite;if(!h||!Array.isArray(h.sources)||!h.sources.length)return"";const G=h.labels.length?h.labels.join(" · "):"无同宫会聚",ie=["禄","权","科","忌"].map(je=>{const De=(h.byType&&h.byType[je]||[]).filter(me=>!me.self),K=[...new Set(De.map(me=>String(me.to).replace(/宫$/,"")))];return K.length?`${je}→${K.join("/")}`:""}).filter(Boolean).join(" ");return`【三方四正飞化】${h.sanfang.join("·")}:${G}${ie?` ${ie}`:""}`})();return[`【农历】${n}(月首 ${e.lunar.monthStart}) 时支:${e.hourBranch} 年干支:${e.yearGanzhi}`,`【时刻】${e.solarTime?`${e.solarTime.civilText} → 真太阳时 ${e.solarTime.trueSolarText}${e.input.geo?"("+e.input.geo.note+")":""}`:""}`,`【命宫】${e.soul.branch}(${e.soul.ganzhi}·${e.soul.nayin}) 【身宫】${e.body.branch}(落${e.body.lands}) 【五行局】${e.bureau.name}`,`【紫微】${e.ziwei} 【天府】${e.tianfu} 【命主】${e.lifeMaster} 【身主】${e.bodyMaster}${e.bodyMasterNote?`(${e.bodyMasterSchool==="common"?"子午皆火星":"子铃午火"})`:""}`,`【大限】${e.daxian.rule},${e.daxian.startAge}岁起 【小限】${e.xiaoxianRule.direction}`,t,`【昌曲】文昌${e.changqu.wenchang.branch}(${e.changqu.wenchang.palace}${e.changqu.wenchang.mutagen?"·化"+e.changqu.wenchang.mutagen:""}) 文曲${e.changqu.wenqu.branch}(${e.changqu.wenqu.palace}${e.changqu.wenqu.mutagen?"·化"+e.changqu.wenqu.mutagen:""})`,` ${e.changqu.relation} 入命三方:${e.changqu.inSoulSanfang?"是":"否"} 吸收面:${e.changqu.absorb.label}(${e.changqu.absorb.reason})`,H,Q,"十二宫:",...d,"大限(按起运年龄排序,前 8 限,宫干四化落宫):",...V,"流年(前 6 年,完整 12 年在结构化数据里):",...p,`【格局】${Z}`,e.patternSummary?`【结构统计】吉格 ${e.patternSummary.good.length}、中性 ${e.patternSummary.neutral.length}、忌格 ${e.patternSummary.bad.length}${e.patternSummary.broken.length?`、破格 ${e.patternSummary.broken.length}(${e.patternSummary.broken.join("、")})`:""};${e.patternSummary.note}`:"",e.lunar.note?`注:${e.lunar.note}`:""].filter(Boolean).join(`
|
|
71
|
+
`)}const te=["旺","相","休","囚","死"];function oe(e){const o=e.states,n=e.month;if(!o||!n)return"无月令数据";const t=a=>te.filter(m=>a&&Array.isArray(a[m])&&a[m].length).map(m=>`${m} ${a[m].join("/")}`).join(" ");return`月令 ${n.branch}(${n.element}) 门 ${t(o.gate)||"—"} 星 ${t(o.star)||"—"} 干 ${t(o.stem)||"—"}`}function ce(e){const o=e.palaces,n=t=>`${t.palace}宫 ${t.star||"—"}/${t.gate||"—"}/${t.god||"—"}${t.kong?" 空":""}${t.ma?" 马":""}`;return[`【四柱】${e.siZhu.year} ${e.siZhu.month} ${e.siZhu.day} ${e.siZhu.time}`,`【局数】${e.ju} 节气 ${e.jieqi}(${e.jieqiTime})`,`【值符】${e.zhiFu.star}(${e.zhiFu.gong}宫) 【值使】${e.zhiShi.gate}(${e.zhiShi.gong}宫) 旬首 ${e.xunshou}`,`【空亡】${e.kongWang.join("")||"—"} 驿马 ${e.ma.zhi||"—"}(${e.ma.gong||"—"}宫)`,`【宫位条件】击刑 ${(e.conditions&&e.conditions.jiXing||[]).map(t=>`${t.palace}宫${t.stem}`).join("、")||"无"} 三奇入墓 ${(e.conditions&&e.conditions.ruMu||[]).map(t=>`${t.palace}宫${t.stem}`).join("、")||"无"} 六仪入墓 ${(e.conditions&&e.conditions.liuYiRuMu||[]).map(t=>`${t.palace}宫${t.stem}`).join("、")||"无"}`,`【十干克应】${[...o,e.centerPalace].filter(t=>t&&t.ganYing).map(t=>`${t.palace}宫 ${t.ganYing.tian}加${t.ganYing.di} ${t.ganYing.name}`).join(" ")||"—"}`,`【旺衰】${oe(e)}`,`【九宫】${o.map(n).join(" ")}`,`※ 晚子时:${e.lateZiHourMode==="next-day"?"23:00 后归次日":"23:00 后仍归当日"}(可用 lateZiHourMode / lateZi 指定)`,`※ ${e.rules[e.rules.length-1]}`].join(`
|
|
72
|
+
`)}function pe(e){if(e.chart==="ziwei"){const t=a=>`${a.label}:${a.score>=0?"+":""}${a.score} ${a.text}`;return[`【紫微合盘】${e.score.level}(${e.score.total}/100)`,`你 命宫 ${e.a.soul.branch}(${e.a.soulStars.join("、")||"无主星"}) 夫妻 ${e.a.spouseStars.join("、")||"无主星"} ${e.a.bureau}`,`对方 命宫 ${e.b.soul.branch}(${e.b.soulStars.join("、")||"无主星"}) 夫妻 ${e.b.spouseStars.join("、")||"无主星"} ${e.b.bureau}`,...e.dimensions.map(t),...e.interactions.map(a=>` · ${a.text}`),...e.notes.map(a=>`※ ${a}`)].join(`
|
|
73
|
+
`)}const o=t=>`${t.label}:${t.score>=0?"+":""}${t.score} ${t.text}`,n=t=>!t||!t.solarNote?"—":`${t.longitude==null?"未含经度修正":`${t.longitude}°E`}(${t.solarNote})`;return[`【合盘】${e.score.level}(${e.score.total}/100)`,`你 ${e.a.pillars.join(" ")} 日主 ${e.a.dayMaster} 日支 ${e.a.dayBranch} ${e.a.strength||""}`,`对方 ${e.b.pillars.join(" ")} 日主 ${e.b.dayMaster} 日支 ${e.b.dayBranch} ${e.b.strength||""}`,`真太阳时:你 ${n(e.a)};对方 ${n(e.b)}`,...e.dimensions.map(o),...e.detail?[`属相:${e.detail.yearRelation.label}——${e.detail.yearRelation.text}`,`日干:${e.detail.stems.text}`,...e.detail.crossBranches&&e.detail.crossBranches.length?[`跨盘地支:${e.detail.crossBranches.map(t=>`${t.name}(${t.a}${t.b})`).join("、")}`]:[],`年命纳音:${e.detail.nayin.a} / ${e.detail.nayin.b}(${e.detail.nayin.label})——${e.detail.nayin.text}`,`吉凶象:吉 ${e.detail.tally.good} / 凶 ${e.detail.tally.bad}(${e.detail.tally.lean};分档只数象,总分以上面三维度为准)`]:[],...e.notes.map(t=>`※ ${t}`)].join(`
|
|
74
|
+
`)}function Me(e){const o=e.sanChuan,n=t=>`${t.zhi}(${t.jiang}${t.liuQin}${t.xunKong?"空":""})`;return[`【日时】${e.dayGanZhi}日 ${e.hourZhi}时(${e.dayNight}贵) 月将 ${e.yueJiang.name}${e.yueJiang.zhi} 节气 ${e.jieqi.name} ${e.lateZi===!1?"晚子时不换日":"晚子时换日"}`,`【三传】初 ${n(o.chu)} → 中 ${n(o.zhong)} → 末 ${n(o.mo)}`,`【四课】${e.siKe.map(t=>`${t.position}课 ${t.shang}上${t.xia}下(${t.relation}·${t.jiang})`).join(" ")}`,`【天地盘】${e.pan.map(t=>`${t.di}:${t.tian}(${t.jiang})`).join(" ")}`,`【格局】${e.geJu.name}·${e.geJu.detail}`,...e.shensha&&e.shensha.length?[`【神煞】${e.shensha.map(t=>`${t.name}${t.branch}`).join(" ")}`]:[]].join(`
|
|
75
|
+
`)}function Ye(e){const o=[`【起卦】${e.source}`,`【本卦】${e.ben.name}(上${e.ben.upper} 下${e.ben.lower}) 动爻:${e.movingName}`,`【互卦】${e.hu.name} 【变卦】${e.bian.name} 【错卦】${e.cuo.name} 【综卦】${e.zong.name}`,`【体用】体 ${e.bodyUse.body.trigram}${e.bodyUse.body.element} 用 ${e.bodyUse.use.trigram}${e.bodyUse.use.element} ${e.bodyUse.level}`,` ${e.bodyUse.relation}`],n=e.lines.slice().reverse().map(t=>` ${t.name} ${t.yinYang==="阳"?"━━━━━":"━━ ━━"}${t.moving?" ←动":""}`);return[...o,"【爻】",...n].join(`
|
|
76
|
+
`)}function Ae(e){const o=[e.question?`【所问】${e.question}`:"(未填写提问)",`【牌阵】${e.spread}${e.castAt?` 抽牌于 ${e.castAt}`:""}`];for(const n of e.cards)o.push(` ${n.position}:${n.name}(${n.orientation}) ${n.keywords.join("、")}`);if(e.reading&&e.reading.length){o.push("【解读】");for(const n of e.reading)o.push(` ${n}`)}return o.join(`
|
|
77
|
+
`)}function Se(e){const o=Z=>{const V=Z.lines.slice().reverse().map(H=>{const Q=H.position===Z.shi?"世":H.position===Z.ying?"应":" ";return` ${H.name} ${Q} ${H.symbol} ${H.ganzhi}${H.element} ${H.liuqin}/${H.liushen}`});return[`${Z.name}(${Z.palace}·${Z.palaceElement})`,...V].join(`
|
|
78
|
+
`)},n=[`起卦:${e.cast.notation.join("、")}(自下而上)`,`日辰:${e.dayGanZhi.name}`,e.xunShou?`旬首:${e.xunShou} 旬空:${(e.xunKong||[]).join("")||"—"}`:"",e.question?`所问:${e.question}`:"","本卦:",o(e.ben)];e.bian?n.push(`动爻:第 ${e.cast.movingPositions.join("、")} 爻`,"变卦(六亲以变卦自身宫论):",o(e.bian)):n.push("六爻安静,无变卦。");const t=e.body&&Array.isArray(e.body.labels)?e.body.labels:C(e.body);n.push(`卦体:${t.length?t.join(" · "):"无六冲、六合、伏吟、反吟"}`);const a=e.useGod||L(e,{});if(a&&a.liuqin){const Z=a.found.length?a.found.map(G=>`${G.position}爻${G.ganzhi}${G.element}${G.kong?"(空)":""}`).join("、"):a.fushen.length?a.fushen.map(G=>`伏 ${G.position}爻${G.ganzhi}${G.element}(${G.relation||"飞伏关系未知"})`).join("、"):"不上卦";n.push(`用神:${a.byShi?"世爻":a.liuqin}(${a.ask})→ ${Z}${a.side?`(${a.side})`:""}`);const V=a.byShi?"用神 世爻":`用神 ${a.liuqin}`,H=a.labels.filter(G=>G!==V&&!G.startsWith(V));H.length&&n.push(`用神联动:${H.join(" · ")}`);const Q=e.useGodStrength;if(Q&&Q.labels.length){const G=Q.month&&Q.month.branch?`月建 ${Q.month.branch}(${Q.month.element}) `:"";n.push(`用神旺衰:${G}${Q.labels.join(" · ")}`)}const h=e.fushenAccess;h&&Array.isArray(h.labels)&&h.labels.length&&n.push(`伏神出伏:${h.labels.join(" · ")}`)}else n.push("用神:未取(未指明所问之事;用「询问方向」指定后即按六亲取用)");const m=e.hexStrength;if(m&&Array.isArray(m.labels)&&m.labels.length){const Z=m.month&&m.month.branch?`月建 ${m.month.branch}(${m.month.element}) `:"无月建(未给起卦时间) ";n.push(`全卦旺衰:${Z}${m.labels.join(" · ")}`)}const d=e.jinTuiPower;d&&Array.isArray(d.lines)&&d.lines.length&&n.push(`进退力重:${d.lines.map(Z=>`${Z.position}爻${Z.from}→${Z.to}${Z.type}·${Z.verdict}`).join(" · ")}`);const p=e.yingqi;return p&&Array.isArray(p.triggers)&&p.triggers.length&&n.push(`应期线索:${p.tempo} · ${p.triggers.map(Z=>`${Z.labels.join("/")}${Z.branch}`).join(" · ")}(只列地支,不出日期)`),n.filter(Boolean).join(`
|
|
79
|
+
`)}function Ce(e){const o=new WeakSet,n=(t,a)=>{switch((t instanceof Number||t instanceof String||t instanceof Boolean)&&(t=t.valueOf()),t&&typeof t=="object"&&typeof t.toJSON=="function"&&(t=t.toJSON(a)),typeof t){case"string":case"boolean":return t;case"number":return Number.isFinite(t)?Object.is(t,-0)?0:t:null;case"bigint":throw new TypeError("Do not know how to serialize a BigInt");case"object":{if(t===null)return null;if(o.has(t))throw new TypeError("Converting circular structure to JSON");o.add(t);let m;if(Array.isArray(t)){m=new Array(t.length);for(let d=0;d<t.length;d++){const p=n(t[d],String(d));m[d]=p===void 0?null:p}}else{m={};for(const d of Object.keys(t)){const p=n(t[d],d);p!==void 0&&(m[d]=p)}}return o.delete(t),m}default:return}};return n(e,"")}const qe=new Set(["shadow","shadowVersion","diff","trace","traceError","withInterpret","cross","verifyPast","rectify","events","geocode","ask","followup","caliber","seed","asOf"]),de=e=>{if(e==null||e==="")return null;const o=Number(e);return Number.isFinite(o)?Number(o.toFixed(6)):null};function we(e){if(e==null||e==="")return null;try{const o=D(e);return{y:o.year,m:o.month,d:o.day,h:o.hour,mi:o.minute,precision:o.precision}}catch{return String(e).trim()}}function Qe(e={}){const o={};return e.datetime&&(o.datetime=we(e.datetime)),e.gender&&(o.gender=String(e.gender).toLowerCase()),e.longitude!==void 0?o.longitude=de(e.longitude):e.address&&(o.address=String(e.address).trim()),e.lateZi!==void 0&&(o.lateZi=e.lateZi!==!1),e.trueSolar!==void 0&&(o.trueSolar=e.trueSolar!==!1),e.dst!==void 0&&(o.dst=e.dst!==!1),o}function cn(e){return e.lateZiHourMode==="next-day"||e.lateZi===!0?"next-day":"same-day"}function $n(e,o){const n=String(o&&o.system||e.system||""),t=o&&o.input&&typeof o.input=="object"?o.input:null;if(n==="bazi"&&t)return{civil:t.civil,gender:t.gender,longitude:de(t.longitude),lateZi:t.lateZi!==!1,trueSolar:t.trueSolar!==!1,dst:!!(t.dst&&t.dst.applied)};if(n==="ziwei"&&t)return{civil:{year:t.year,month:t.month,day:t.day,hour:t.hour,minute:t.minute},gender:t.gender,longitude:de(t.longitude),leapMonth:t.leapMonth||"split",leapAsNext:t.leapAsNext===!0,schools:t.schools||ne,trueSolar:t.trueSolar!==!1,dst:!!(t.dst&&t.dst.applied)};if(n==="qimen")return{datetime:we(e.datetime),juMethod:e.juMethod||"chaibu",lateZiHourMode:cn(e)};if(n==="hepan")return{chart:e.chart==="ziwei"?"ziwei":"bazi",a:Qe({...e,datetime:e.datetime}),b:Qe(e.partner||{})};const a={};for(const[m,d]of Object.entries(e))if(!(qe.has(m)||d===void 0))if(m==="datetime")a.datetime=we(d);else if(m==="partner")a.partner=Qe(d);else if(m==="gender")a.gender=String(d).toLowerCase();else{if(m==="address")continue;typeof d=="number"?a[m]=Number.isFinite(d)?Object.is(d,-0)?0:d:null:typeof d=="string"?a[m]=d.trim():a[m]=d}return n==="daliuren"&&a.lateZi===void 0&&(a.lateZi=!0),n==="tarot"&&a.count===void 0&&(a.count=3),n==="meihua"&&a.mode===void 0&&(a.mode="time"),n==="xiaoliuren"&&a.mode===void 0&&(a.mode="time"),n==="convert"&&a.mode===void 0&&(a.mode="solar2lunar"),n==="fengshui"&&a.action===void 0&&(a.action="natal"),n==="tarot"&&o&&Array.isArray(o.cards)&&o.cards.length&&(a.cards=o.cards.map(m=>`${m.name||""}|${m.upright?"正":"逆"}`)),n==="liuyao"&&o&&o.cast&&Array.isArray(o.cast.lines)&&(a.cast=o.cast.lines.join("")),a}function yn(e,o){const n=o.seed,t=!(n==null||n==="");return e==="liuyao"&&Array.isArray(o.lines)&&o.lines.length===6?{reproducible:!0}:(e==="tarot"||e==="liuyao")&&!t?{reproducible:!1,reason:"未给 seed:重算会变成另一副牌 / 另一卦"}:e==="bazi"||e==="ziwei"||e==="trend"||e==="fengshui"?{reproducible:!0,asOfPinned:!!o.asOf}:{reproducible:!0}}function fn(e={},o={}){const n=o.result||null,t=String(n&&n.system||e.system||""),a=String(o.version||typeof globalThis<"u"&&globalThis.__MP_VER||"dev");return{...on({system:t,params:$n(e,n),seed:e.seed,asOf:e.asOf?String(e.asOf):null,version:a}),...yn(t,e),system:t,version:a}}const gn=new Set(["shadow","trace","traceError","interpret","summary","classics","suiyunClassic","renyuanClassic","cross","past","rectify","followup","caliber","input","reading","knowledge","outline","sections","answer","plain","tables","glossary","caveats","lead","dimensions","moduleType","technique","disclaimer","ask","followups","knowledgeCount","title","systemLabel"]);function mn(e){const o={};for(const[n,t]of Object.entries(e||{}))gn.has(n)||(o[n]=t);return o}function pn(e){return!e||!e.shadow||!e.shadow.baseId?null:{snapshot:!0,shadow:e.shadow,data:mn(e)}}function bn(e,o,n={}){const t=e&&e.shadow,a=o&&o.shadow;if(!t||!a)return{sameId:!1,total:0,reason:"缺少影子盘信息"};if(t.baseId&&a.baseId&&t.baseId!==a.baseId)return{sameId:!1,total:0,fromId:t.id,toId:a.id,fromBaseId:t.baseId,toBaseId:a.baseId,reason:"基础指纹不同,不是同一张盘"};const m=h=>h.snapshot===!0&&h.data&&typeof h.data=="object"?h.data:mn(h),d=Be(m(e),m(o)),p=Je(d.filter(h=>We(h.path))).map(h=>({path:h.path,label:Xe(h.path),from:Re(h.from),to:Re(h.to)})),Z=new Map;for(const h of d){const G=Ke(h.path)||"其他";Z.set(G,(Z.get(G)||0)+1)}const V=[...Z.entries()].map(([h,G])=>({name:h,count:G})).sort((h,G)=>G.count-h.count||h.name.localeCompare(G.name,"zh-Hans-CN")),H=n.fromVersion||t.version||"",Q=n.toVersion||a.version||"";return{sameId:!0,versionChanged:H!==Q,fromVersion:H,toVersion:Q,total:d.length,summary:He(d),roots:p,categories:V,diffs:d}}function ln(e={}){const o=Ce(Mn(e));if(o&&o.system==="bazi"){o.classics=Pe(o);const n=en(o.classics);n&&(o.summary=`${o.summary}
|
|
80
|
+
【古籍】
|
|
81
|
+
${n}`);const t=nn(o);if(t&&(o.suiyunClassic={...t,bookName:ze[t.book].name}),o.renyuan){const a=Le("smt-renyuan");a&&(o.renyuanClassic={...a,bookName:ze[a.book].name})}}if(o&&o.precision&&o.precision.level==="approx"&&o.summary&&(o.summary=`⚠ ${o.precision.note}
|
|
82
|
+
${o.summary}`),o&&(o.system==="bazi"||o.system==="ziwei")&&o.input&&o.input.longitude==null&&o.summary&&(o.summary=`⚠ 未提供出生地或经度:按东八区平太阳时排盘,时柱可能与本命盘相差一个时辰;海外出生请先把当地时间换算成东八区标准时。
|
|
83
|
+
${o.summary}`),e.withInterpret&&(o.interpret=be(o,{question:typeof e.question=="string"?e.question:"",direction:typeof e.direction=="string"?e.direction:"general"})),e.cross===!0&&(o.system==="bazi"||o.system==="ziwei")){const t={...D(e.datetime),gender:E(e.gender),longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0,trueSolar:e.trueSolar!==!1,dst:e.dst!==!1},a=Ve(e.asOf),m=o.system==="bazi"?M({...t,leapMonth:e.leapMonth,leapAsNext:e.leapAsNext===!0,...z(e),asOf:a}):W({...t,lateZi:e.lateZi!==!1,nowYear:a?a.year:void 0});o.cross=ve(o.system==="bazi"?o:m,o.system==="ziwei"?o:m),o.interpret&&o.interpret.sections.push(ke(o.cross))}if(Number.isInteger(e.verifyPast)&&e.verifyPast>0&&o.system==="bazi"){const n=Math.min(Math.max(e.verifyPast,1),10),t=Number(o.liunianFrom)-n,a=W({...D(e.datetime),gender:E(e.gender),lateZi:e.lateZi!==!1,trueSolar:e.trueSolar!==!1,longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0,dst:e.dst!==!1,nowYear:t});o.past={rows:A(a,Number(o.liunianFrom)-1),years:n,until:Number(o.liunianFrom)-1}}if(e.rectify===!0&&o.system==="bazi"){const n=D(e.datetime);o.rectify=w({base:{year:n.year,month:n.month,day:n.day,minute:n.minute},gender:E(e.gender),events:Array.isArray(e.events)?e.events:[],hours:Array.isArray(e.rectifyHours)?e.rectifyHours:void 0,lateZi:e.lateZi!==!1,trueSolar:e.trueSolar!==!1,dst:e.dst!==!1,longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0})}if(typeof e.ask=="string"&&e.ask.trim()&&(o.followup=Te(o,e.ask)),e.trace===!0)try{const n=rn(o,{direction:e.direction,gender:e.gender});n&&(o.trace=n)}catch(n){o.traceError=String(n&&n.message||n)}if(e.shadow===!0)try{o.shadow=fn(e,{result:o,version:e.shadowVersion})}catch(n){o.shadow={error:String(n&&n.message||n)}}return o}function hn(e){if(!e)return"";const o=[`【${e.title||"解析与详解"}】${e.ask&&e.ask.echo?e.ask.echo:""}`];e.answer&&o.push(`▶ ${e.ask&&e.ask.question?"先答所问":"先看结论"}:${e.answer}`),e.plain&&o.push(`▶ 说人话:${e.plain}`),e.lead&&o.push(e.lead),Array.isArray(e.outline)&&e.outline.length&&o.push("一页读懂:"+e.outline.map(n=>`${n.label}·${n.text}`).join(" ")),e.error&&o.push(`⚠ 解析生成失败:${e.error}(上方盘面数据本身可用)`);for(const n of e.dimensions||[]){const t=Array.isArray(n.evidence)&&n.evidence.length?`
|
|
84
|
+
依据:${n.evidence.join(";")}${n.confidence?` 置信度:${n.confidence}`:""}`:"",a=n.plain?`(${n.plain})`:"",m=(n.knowledge||[]).map(d=>`
|
|
85
|
+
规则·${d.gist}〔${d.statusLabel}〕${d.detail} 出处:${d.source}${d.note?` 注:${d.note}`:""}`).join("");o.push(`${n.label}:${a}${n.text}${n.advice?` 建议:${n.advice}`:""}${t}${m}`)}for(const n of e.sections||[])o.push(`${n.label}:${n.text}`);for(const n of e.tables||[])!Array.isArray(n.rows)||!n.rows.length||(o.push(`【${n.title}】`),o.push([n.columns.join(" | "),...n.rows.map(t=>t.join(" | "))].join(`
|
|
86
|
+
`)));return Array.isArray(e.followups)&&e.followups.length&&o.push("还可以这样追问:"+e.followups.map(n=>`「${n}」`).join(" ")),Array.isArray(e.glossary)&&e.glossary.length&&o.push("名词解释:"+e.glossary.map(n=>`${n.term}=${n.plain}`).join(" ")),e.disclaimer&&o.push(e.disclaimer),o.join(`
|
|
87
|
+
`)}const jn=["cross","verifyPast","withInterpret","question","direction","ask","geocode","rectify","events","shadow","trace"];function wn(e={},o={}){const n=o.system||e.system,t=o.switches||tn[n]||[];if(!t.length)return{system:n,switches:[],affected:0,total:0};const a={...e};for(const d of jn)delete a[d];const m=t.map(d=>{const p=d.read(a),Z=d.alt(p);let V=[],H="";try{V=Be(ln({...a,[d.key]:p}),ln({...a,[d.key]:Z}))}catch(ie){H=ie&&ie.message||String(ie)}const Q=Je(V.filter(ie=>We(ie.path))).map(ie=>({path:ie.path,label:Xe(ie.path),from:Re(ie.from),to:Re(ie.to)})),h=new Map;for(const ie of V){const je=Ke(ie.path)||"其他";h.set(je,(h.get(je)||0)+1)}const G=[...h.entries()].map(([ie,je])=>({name:ie,count:je})).sort((ie,je)=>je.count-ie.count||ie.name.localeCompare(je.name,"zh-Hans-CN"));return{key:d.key,title:d.title,short:d.short,current:p,alt:Z,currentLabel:d.label(p),altLabel:d.label(Z),total:V.length,summary:H?"":He(V),roots:Q,categories:G,error:H}});return{system:n,switches:m,affected:m.filter(d=>!d.error&&d.total>0).length,total:m.reduce((d,p)=>d+p.total,0)}}const Sn=["chaibu","chaoshen","zhirun"],Nn=[1,3,5],Tn=["same-day","next-day"];function Ve(e){if(e==null||e==="")return;const o=q(e);if(!o)throw c("E_ASOF",`无法解析 asOf:「${e}」,请用 2026-10-22T16:00 这种格式`);const{year:n,month:t,day:a}=o;if(!(t>=1&&t<=12)||!(a>=1&&a<=Y(n,t)))throw c("E_ASOF",`asOf 指向的日期不存在:${e}`);return o}function Mn(e={}){const o=e.system;if(o==="bazi"){const n=D(e.datetime),t=Ve(e.asOf),a=W({...n,gender:E(e.gender),longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0,lateZi:e.lateZi!==!1,trueSolar:e.trueSolar!==!1,dst:e.dst!==!1,nowYear:t?t.year:void 0});return{...a,...t?{asOf:t}:{},precision:n.precision,summary:se(a)}}if(o==="ziwei"){const n=D(e.datetime),t=Ve(e.asOf),a=M({...n,gender:E(e.gender),leapMonth:e.leapMonth,leapAsNext:e.leapAsNext===!0,...z(e),longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0,trueSolar:e.trueSolar,dst:e.dst!==!1,asOf:t});return{...a,precision:n.precision,summary:re(a)}}if(o==="tarot"){const n=e.count===void 0||e.count===null||e.count===""?3:Number(e.count);if(!Nn.includes(n))throw c("E_COUNT",`塔罗张数只能是 1 / 3 / 5,收到「${e.count}」`);if(!he(e.seed))throw c("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);const t=Ve(e.asOf),a=i({count:n,question:e.question,at:e.asOf,random:le(e.seed)});return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(a.seed=Number(e.seed)),{...a,...t?{asOf:t}:{},summary:Ae(a)}}if(o==="daliuren"){const n=D(e.datetime),t=e.lateZi!==!1,a=r({...n,lateZi:t});return a.lateZi=t,{...a,precision:n.precision,summary:Me(a)}}if(o==="qimen"){const n=D(e.datetime);if(e.juMethod!==void 0&&!Sn.includes(e.juMethod))throw c("E_INPUT",`juMethod 只能是 chaibu / chaoshen / zhirun,收到「${e.juMethod}」`);const t=e.lateZiHourMode!==void 0?e.lateZiHourMode:e.lateZi===!0?"next-day":e.lateZi===!1?"same-day":void 0;if(t!==void 0&&!Tn.includes(t))throw c("E_INPUT",`lateZiHourMode 只能是 same-day / next-day,收到「${t}」`);const a=t==="next-day"?"next-day":"same-day",m=y({...n,lateZiHourMode:a,juMethod:e.juMethod});return m.lateZiHourMode=a,{...m,summary:ce(m)}}if(o==="hepan"){const n=e.partner;if(!n||typeof n!="object")throw c("E_PARTNER","合盘需要 partner:{ datetime, gender, address? },其中 partner.datetime 是对方的公历出生时间");if(!n.datetime)throw c("E_PARTNER",'缺少 partner.datetime(对方的公历出生时间),例如 partner: {"datetime":"1992-03-03T10:00","gender":"female"}');const t=D(e.datetime),a=D(n.datetime),m=e.chart==="ziwei"?"ziwei":"bazi",d={...t,gender:E(e.gender,"你(主方)"),trueSolar:e.trueSolar,lateZi:e.lateZi,dst:e.dst!==!1,address:typeof e.address=="string"?e.address:void 0,longitude:typeof e.longitude=="number"?e.longitude:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0},p={...a,gender:E(n.gender,"对方"),trueSolar:n.trueSolar,lateZi:n.lateZi,dst:n.dst!==!1,address:typeof n.address=="string"?n.address:void 0,longitude:typeof n.longitude=="number"?n.longitude:void 0,geo:n.geo&&typeof n.geo=="object"?n.geo:void 0},Z=m==="ziwei"?_({a:d,b:p}):g({a:d,b:p});return{...Z,summary:pe(Z)}}if(o==="meihua"){let n;try{n=l({mode:e.mode==="number"?"number":"time",datetime:e.datetime,upper:e.upper,lower:e.lower,changing:e.changing})}catch(t){throw c("E_INPUT",`梅花起卦参数不完整:${t&&t.message?t.message:t}`)}return{...n,summary:Ye(n)}}if(o==="liuyao"){if(!he(e.seed))throw c("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);let n;if(e.lines===void 0||e.lines===null)n=U(le(e.seed));else{if(!Array.isArray(e.lines))throw c("E_LINES","lines 必须是数组:自下而上 6 个爻值(6 老阴 / 7 少阳 / 8 少阴 / 9 老阳)");if(e.lines.length!==6)throw c("E_LINES",`六爻需要正好 6 个爻值(自下而上),收到 ${e.lines.length} 个;留空则由引擎随机摇卦`);n=e.lines.map(Number)}let t,a=null;const m=e.datetime?D(e.datetime):Ve(e.asOf);if(m){e.datetime||(a=m);const Q=fe($e(ae(m.year,m.month,m.day)));t={stem:Q.stem,branch:Q.branch,name:Q.name}}let d;try{d=J({lines:n,question:e.question,dayGanZhi:t})}catch(Q){throw c("E_LINES",Q&&Q.message?Q.message:Q)}const p=L(d,{direction:e.direction,gender:e.gender});p.liuqin&&(d.useGod=p);let Z=null;if(m)try{Z=(f({year:m.year,month:m.month,day:m.day,hour:m.hour,minute:m.minute}).monthGanZhi||"")[1]||null}catch{Z=null}const V=R(d,{monthBranch:Z,dayBranch:d.dayGanZhi.branch});V&&(d.hexStrength=V);const H=u(d,{monthBranch:Z,dayBranch:d.dayGanZhi.branch});if(H&&(d.jinTuiPower=H),p.liuqin){const Q=S(d,p,{monthBranch:Z,dayBranch:d.dayGanZhi.branch});Q&&(d.useGodStrength=Q);const h=$(d,p,{monthBranch:Z,dayBranch:d.dayGanZhi.branch});h&&(d.fushenAccess=h);const G=b(d,p,{monthBranch:Z});G&&(d.yingqi=G)}return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(d.seed=Number(e.seed)),{...d,...a?{asOf:a}:{},summary:Se(d)}}if(o==="almanac"){const n=D(e.datetime),t=X({year:n.year,month:n.month,day:n.day});return{...t,summary:An(t)}}if(o==="zeri"){if(typeof e.startDate!="string"||!e.startDate.trim())throw c("E_INPUT","择日需要 startDate(公历 YYYY-MM-DD,起算日);可另给 days(1–60,默认 30)与 shengXiao(当事人属相)");const n=F({task:e.task,startDate:e.startDate,days:e.days,shengXiao:e.shengXiao});return{...n,summary:xn(n)}}if(o==="chenggu"){const n=D(e.datetime),t=/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime)),a=Number.isInteger(e.hour)?e.hour:t?n.hour:null;if(a===null||a<0||a>23)throw c("E_INPUT","称骨必须给时辰:datetime 带时分(如 1990-08-15T10:00),或额外给 hour(0–23)——缺时辰四柱不齐");const m=ee({year:n.year,month:n.month,day:n.day,hour:a,minute:t?n.minute:0});return{...m,summary:En(m)}}if(o==="convert"){const n=e.mode==="lunar2solar"?"lunar2solar":"solar2lunar";let t;if(n==="lunar2solar"){if(e.lunarYear==null||e.lunarMonth==null||e.lunarDay==null)throw c("E_INPUT","农历转公历需要 lunarYear / lunarMonth / lunarDay(闰月另加 isLeapMonth: true)");t=_e({mode:n,lunarYear:Number(e.lunarYear),lunarMonth:Number(e.lunarMonth),lunarDay:Number(e.lunarDay),isLeapMonth:e.isLeapMonth===!0})}else{const a=D(e.datetime);t=_e({mode:n,year:a.year,month:a.month,day:a.day})}return{...t,summary:kn(t)}}if(o==="xiaoliuren"){const n=e.datetime?D(e.datetime):null,t=ue({mode:e.mode==="number"?"number":"time",date:typeof e.date=="string"&&e.date.trim()?e.date:n?`${n.year}-${n.month}-${n.day}`:void 0,hour:Number.isInteger(e.hour)?e.hour:n&&/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime))?n.hour:void 0,num1:e.num1,num2:e.num2,num3:e.num3,question:e.question});return{...t,summary:On(t)}}if(o==="star"){const n=D(e.datetime),t=ye({year:n.year,month:n.month,day:n.day});return{...t,summary:In(t)}}if(o==="numerology"){const n=D(e.datetime),t=Oe({year:n.year,month:n.month,day:n.day});return{...t,summary:zn(t)}}if(o==="mbti"){if(e.answers===void 0||e.answers===null){const t=Ue();return{...t,summary:Yn(t)}}const n=Fe({answers:e.answers});return{...n,summary:_n(n)}}if(o==="trend"){const n=D(e.datetime),t=an({...n,gender:E(e.gender),toAge:e.toAge,lateZi:e.lateZi!==!1,trueSolar:e.trueSolar!==!1,dst:e.dst!==!1,longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0});return{...t,precision:n.precision,summary:Cn(t)}}if(o==="fengshui"){const n=e.action==="advise"?"advise":e.action==="xuankong"?"xuankong":"natal";if(n==="xuankong"){const m=Ze({action:n,sitting:e.sitting,facing:e.facing,...e.period!==void 0?{period:e.period}:{},...Number.isInteger(e.fortuneYear)?{fortuneYear:e.fortuneYear}:{},...typeof e.sittingOffset=="number"?{sittingOffset:e.sittingOffset}:{},...typeof e.sittingDegree=="number"?{sittingDegree:e.sittingDegree}:{},...typeof e.facingOffset=="number"?{facingOffset:e.facingOffset}:{},...typeof e.facingDegree=="number"?{facingDegree:e.facingDegree}:{},...typeof e.fortuneDate=="string"?{fortuneDate:e.fortuneDate}:{},...typeof e.fortuneTime=="string"?{fortuneTime:e.fortuneTime}:{},dst:e.dst!==!1});return{...m,summary:un(m)}}if(n==="advise"){const m=Ze({action:n,sitting:e.sitting,facing:e.facing,...e.datetime?D(e.datetime):{},...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},dst:e.dst!==!1});return{...m,summary:un(m)}}const t=D(e.datetime),a=Ze({action:"natal",year:t.year,month:t.month,day:t.day,gender:E(e.gender),fortuneYear:Number.isInteger(e.fortuneYear)?e.fortuneYear:void 0,dst:e.dst!==!1});return{...a,summary:un(a)}}if(o==="name"){const n=e.action==="generate"?"generate":"assess",t=e.datetime?D(e.datetime):Number.isInteger(e.year)&&Number.isInteger(e.month)&&Number.isInteger(e.day)?{year:e.year,month:e.month,day:e.day,...Number.isInteger(e.hour)?{hour:e.hour}:{},...Number.isInteger(e.minute)?{minute:e.minute}:{}}:{},a=sn({action:n,surname:e.surname,givenName:e.givenName,limit:e.limit,charElements:e.charElements&&typeof e.charElements=="object"?e.charElements:void 0,strokeOverrides:e.strokeOverrides&&typeof e.strokeOverrides=="object"?e.strokeOverrides:void 0,surnameStrokes:e.surnameStrokes&&typeof e.surnameStrokes=="object"?e.surnameStrokes:void 0,...t,...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},...e.datetime?{lateZi:e.lateZi!==!1,trueSolar:e.trueSolar!==!1,dst:e.dst!==!1,longitude:typeof e.longitude=="number"?e.longitude:void 0,address:typeof e.address=="string"?e.address:void 0,geo:e.geo&&typeof e.geo=="object"?e.geo:void 0}:{}});return{...a,summary:vn(a)}}throw o?c("E_SYSTEM",`未知体系「${o}」,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、convert(公农历互转)。`):c("E_INPUT","缺少 system,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、convert(公农历互转)。")}function An(e){const o=e.ganzhi,n=e.jieQi&&e.jieQi.next?` 下一节:${e.jieQi.next.name} ${e.jieQi.next.date}`:"",t=e.dayGod?`值日:${e.dayGod.name}(${e.dayGod.type}·${e.dayGod.luck})`:"",a=e.xiu?`二十八宿:${e.xiu.name}宿(${e.xiu.luck}·${e.xiu.zheng}·${e.xiu.animal})`:"",m=e.taiShen?`胎神:${e.taiShen}`:"",d=e.positions?`吉神方位:喜神${e.positions.xiShen||"—"} 财神${e.positions.caiShen||"—"} 福神${e.positions.fuShen?e.positions.fuShen.dir:"—"} 阳贵${e.positions.yangGui?e.positions.yangGui.dir:"—"} 阴贵${e.positions.yinGui?e.positions.yinGui.dir:"—"}`:"",p=e.lucky?`吉配生肖:六合${e.lucky.liuhe||"—"} 三合${(e.lucky.sanhe||[]).join("、")||"—"}`:"",Z=e.nayin&&e.nayin.day?`日柱纳音:${e.nayin.day.name}`:"",V=(e.hours||[]).map(H=>`${H.zhi}${H.ganZhi.slice(0,1)}·${H.shen}${H.luck==="吉"?"吉":"凶"}`).join(" ");return[`【黄历】${e.meta.date} ${e.meta.weekday} ${e.lunar.text}`,`干支:${o.year}年 ${o.month}月 ${o.day}日 属${o.shengXiao}`,...e.meta.boundaryNote?[` ${e.meta.boundaryNote}`]:[],`建除:${e.zhiXing}日 冲:${e.chong.text}${e.chong.sha?`(${e.chong.sha})`:""} ${t}`,[a,Z,m].filter(Boolean).join(" "),`宜:${e.yi.join("、")}`,`忌:${e.ji.join("、")}`,d,p,V?`时辰吉凶:${V}`:"",`节气:上一节 ${e.jieQi.prev?`${e.jieQi.prev.name} ${e.jieQi.prev.date}`:"—"}${n}`,e.dailyHexagram?`每日一卦:${e.dailyHexagram.name} ${e.dailyHexagram.meaning||""}`:"",`口径:${e.meta.scope}`].filter(Boolean).join(`
|
|
88
|
+
`)}function xn(e){const o=`【择日·${e.meta.task}】${e.meta.startDate} 起 ${e.meta.days} 天${e.meta.shengXiao?` 当事人属${e.meta.shengXiao}`:"(未给属相,未做冲煞排除)"}`,n=e.days.slice().sort((t,a)=>a.score-t.score).slice(0,5).map(t=>`· ${t.date} ${t.weekday} ${t.verdict}(${t.score}分) 宜${t.yi.slice(0,3).join("/")} ${t.reasons.join(";")||"无特别加减分"}`);return[o,`推荐日:${e.best.length?e.best.join("、"):"本期无(都不够推荐分)"}`,`可用日:${e.usable.length?e.usable.join("、"):"无"}`,`回避日:${e.avoid.length?e.avoid.slice(0,6).join("、"):"无"}`,"逐日排序:",...n,`口径:${e.meta.scope}`].join(`
|
|
89
|
+
`)}function En(e){const o=e.song||{};return[`【称骨】${e.input.solar} ${e.lunar.text}`,`四项:${e.weights.year.label} ${e.weights.month.label} ${e.weights.day.label} ${e.weights.hour.label}`,`合计:${e.total.label}(${e.verdict.band})`,`歌诀(${e.total.label}):${o.text||"—"}`,`释义:${o.plain||"—"}`,`分档白话:${e.verdict.text}`,"口径:骨重与歌诀为通行本口径(各版本歌诀有异文),释义为白话自撰,属民俗娱乐参考。"].join(`
|
|
90
|
+
`)}function On(e){return[`【小六壬·${e.meta.mode}】${e.meta.question?`所问:${e.meta.question}`:""}`,e.meta.originText,`落宫:${e.steps.join(" → ")}`,`断语:${e.result.palace}(${e.result.luck}) ${e.result.text}`].join(`
|
|
91
|
+
`)}function In(e){return[`【星座】${e.meta.date} ${e.sign.name}(${e.sign.element}·守护星${e.sign.planet})`,`区间:${e.sign.range} 关键词:${e.sign.keywords} 契合:${e.sign.compatible}`,`当日基调:${e.daily.tone}`,e.daily.dims.map(o=>`· ${o.name}:${"★".repeat(o.stars)}${"☆".repeat(5-o.stars)} ${o.text}`).join(`
|
|
92
|
+
`),`幸运色:${e.daily.luckyColor} 幸运数字:${e.daily.luckyNumber}`,"口径:当日基调由日期哈希确定性生成(同日同结果),纯娱乐向。"].join(`
|
|
93
|
+
`)}function kn(e){const o=e.ganzhi;return[`【公农历转换·${e.meta.mode==="lunar2solar"?"农历 → 公历":"公历 → 农历"}】${e.lunar.text} ⇄ ${e.solar.text} ${e.meta.weekday}`,`干支:${o.year}年 ${o.month}月 ${o.day}日 属${o.shengXiao}${o.springYear&&o.springYear!==o.year?`(春节界为${o.springYear}年)`:""}`,...e.meta.note?[`注:${e.meta.note}`]:[],`口径:${e.meta.scope}`].join(`
|
|
94
|
+
`)}function zn(e){return[`【生命数字】${e.meta.date}(西方数字学,与八字/紫微不可互证)`,...e.parts.map(o=>`${o.name}:${o.number}(${o.meaning.title}) ${o.meaning.keywords}
|
|
95
|
+
倾向:${o.meaning.tendency}
|
|
96
|
+
课题:${o.meaning.lesson}`)].join(`
|
|
97
|
+
`)}function _n(e){const o=e.dims.map(a=>{const m=a.picked===a.left?a.leftSay:a.rightSay,d=Math.round(a.pct*100);return`${a.left}/${a.right} 取 ${a.picked}(${a.strength} ${d}%,净分 ${a.sum}) ${m}`}),n=e.profile,t=Array.isArray(n.stack)&&n.stack.length?n.stack.map((a,m)=>`${m===0?"主导 ":""}${a.code}`).join(" → ")+`
|
|
98
|
+
${n.stack.map(a=>`${a.code}:${a.say}`).join(`
|
|
99
|
+
`)}`:"";return[`【十六型人格】${e.type}(${n.title})· ${n.keywords} 已答 ${e.answered}/${e.total} 题`,`一句:${n.oneLine}`,"【四维】",...o,`【优势】${n.strengths.join(";")}`,`【留意】${n.blindspots.join(";")}`,`【课题】${n.growth}`,`【认知功能】${t}`,`【工作】${n.work}`,`【关系】${n.love}`,`【学习】${n.study}`,`注:${e.note}`].join(`
|
|
100
|
+
`)}function Yn(e){return[`【十六型人格问卷】${e.total} 题,每题按 1(完全不像我)到 5(很像我)打分`,...e.questions.map(o=>`${o.no}. ${o.text}`),`请把 ${e.total} 个分数按顺序交给 answers(如 [4,2,5,3,…]);可以跳过某些题(填 null),至少答 12 题。`,`注:${e.note}`].join(`
|
|
101
|
+
`)}function Cn(e){const o=e.meta.strength,n=e.meta.dayMaster,t=n&&typeof n=="object"?`${n.stem}(${n.element})`:String(n||"");return[`【人生 K 线】${e.meta.birth} ${e.meta.gender} 日主 ${t} 旺衰 ${o.level}(${o.score})`,e.meta.boundaryNote?`※ ${e.meta.boundaryNote}`:"",`【大运分段】${e.segments.map(a=>`${a.ganZhi} ${a.startAge}-${a.endAge}岁`).join(" ")}`,`【走势】${Array.isArray(e.sparkline)?e.sparkline.join(" "):e.sparkline}`,...e.highlights&&e.highlights.best&&e.highlights.best.length?[`【关键年】最佳 ${e.highlights.best.join(";")}${e.highlights.worst&&e.highlights.worst.length?`
|
|
102
|
+
最需留意 ${e.highlights.worst.join(";")}`:""}`]:[],`※ ${e.disclaimer}`].filter(Boolean).join(`
|
|
103
|
+
`)}function un(e){if(e.meta.action==="xuankong"){const n=e.meta.period,t=V=>{const H=e.palaces.find(Q=>Q.palace===V);return`${V}${H.yun}/${H.shan}/${H.xiang}`},a=V=>V.map(t).join(" "),m=e.wangShanWangXiang,d=e.meta.jianXiang,p=e.timeFlying,Z=p?`【年月日时】${[["year","年"],["month","月"],["day","日"],["hour","时"]].filter(([V])=>p[V]).map(([V,H])=>`${H}${p[V].centerName}${p[V].fly?`·${p[V].fly}`:""}`).join(" ")}${p.meta&&p.meta.note?`(${p.meta.note})`:""}`:"";return[`【玄空】${e.meta.periodLabel}${d&&d.active?"·替卦":"·下卦"} 坐 ${e.meta.sitting} 向 ${e.meta.facing}`,...d&&d.active?[`【替卦】${d.note}`]:[],`【入中】山盘 ${e.meta.shanCenter.star}${e.meta.shanCenter.name}(${e.meta.shanCenter.fly},${e.meta.shanCenter.basis}${e.meta.shanCenter.mode==="替卦"?`;原运星 ${e.meta.shanCenter.original}${e.meta.shanCenter.replaced?",已替":",用替而未替"}`:""});向盘 ${e.meta.xiangCenter.star}${e.meta.xiangCenter.name}(${e.meta.xiangCenter.fly},${e.meta.xiangCenter.basis}${e.meta.xiangCenter.mode==="替卦"?`;原运星 ${e.meta.xiangCenter.original}${e.meta.xiangCenter.replaced?",已替":",用替而未替"}`:""})`,`【九宫】${a(["巽","离","坤"])}|${a(["震","中","兑"])}|${a(["艮","坎","乾"])}`,`【当运】山星${n}到${e.dangYun.shan.text};向星${n}到${e.dangYun.xiang.text}`,`【表法】${m.byTable===null?"替卦不套正向表;":""}${m.table.length?m.table.join("、"):"无"};${m.note}`,`【合十】山星合十 ${e.heshi.shan.join("、")||"无"};向星合十 ${e.heshi.xiang.join("、")||"无"}`,...Z?[Z]:[],...e.meta.note?[`※ ${e.meta.note}`]:[],`※ ${e.disclaimer}`].join(`
|
|
104
|
+
`)}if(e.meta.action==="advise"){const n=e.mingMatch?[`【命宅配】${e.mingMatch.text}`]:[`※ ${e.meta.birthNote||"未提供生辰,未做命宅配。"}`];return[`【宅卦】坐 ${e.meta.sitting} 向 ${e.meta.facing} ${e.meta.houseGua}宅(${e.meta.houseGroup})`,`【八星】${e.houseStars.map(t=>`${t.star}·${t.direction}${t.palace?`(${t.palace})`:""}`).join(" ")}`,`【门】${e.layout.door}`,`【灶】${e.layout.stove}`,`【床】${e.layout.bed}`,`【厕】${e.layout.toilet}`,...n,`※ ${e.disclaimer}`].join(`
|
|
105
|
+
`)}const o=e.mingGua;return[`【命卦】${o.num}${o.gua}(${o.group}) 方位 ${o.direction}`,`【四吉】${e.luckyDirections.map(n=>`${n.star}·${n.direction}${n.palace?`(${n.palace})`:""}`).join(" ")}`,`【四凶】${e.unluckyDirections.map(n=>`${n.star}·${n.direction}`).join(" ")}`,...e.yearlyFlying?[`【${e.meta.fortuneYear} 年九宫飞星】中宫 ${e.yearlyFlying.centerName};${e.yearlyFlying.palaces.filter(n=>n.palace!=="中").map(n=>`${n.palace}${n.name}`).join(" ")}`]:[`※ ${e.meta.note||""}`],`※ ${e.disclaimer}`].filter(Boolean).join(`
|
|
106
|
+
`)}function vn(e){if(e.action==="generate")return[`【候选名】姓 ${e.surname}(${e.gender},喜用 ${e.bazi.favorable.join("、")})${e.bazi.basis}`,...e.candidates.map(p=>{const Z=p.wuge&&p.wuge.available?` 五格 ${p.wuge.summary}`:"",V=p.phonetics&&p.phonetics.available?` 音韵 ${p.phonetics.level}(${p.phonetics.tonePattern})`:"";return`${p.rank}. ${p.name} ${p.chars.map(H=>`${H.char}(${H.element})${H.meaning}`).join(" ")}${Z}${V}`}),...e.notes.map(p=>`※ ${p}`)].join(`
|
|
107
|
+
`);const o=p=>p.source==="lib"?"字库":p.source==="user"?"用户指定":"未收录",n=p=>{const Z=p.element==="未收录"?"未收录(不猜五行)":`${p.element}(${o(p)})`,V=p.favorable===!0?"合喜用":p.favorable===!1?"不合喜用":"不判",H=p.suggest&&p.suggest.length?` 可换:${p.suggest.map(Q=>`${Q.char}(${Q.element})`).join("、")}`:"";return`· ${p.char}:${Z}|${V}|${p.meaning}${H}`},t=e.wuge,a=t&&t.available?`【五格】${t.strokes.map(p=>`${p.char}${p.strokes}画`).join("+")}|${t.summary}|三才 ${t.sancai.text}`:`【五格】${t?t.reason:"未算"}`,m=e.phonetics,d=m&&m.available?`【音韵】${m.chars.map(p=>`${p.char}${p.py}${p.tone}`).join(" ")}|声调 ${m.tonePattern}|${m.level}${m.issues.length?`:${m.issues.map(p=>p.text).join(";")}`:""}`:`【音韵】${m?m.reason:"未算"}`;return[`【名字评估】${e.fullName}`,...e.chars.map(n),e.bazi?`【八字】日主 ${e.bazi.dayMaster&&e.bazi.dayMaster.stem?`${e.bazi.dayMaster.stem}(${e.bazi.dayMaster.element})`:e.bazi.dayMaster},旺衰 ${e.bazi.strength.level}(${e.bazi.strength.score}),${e.bazi.basis}`:"",a,d,`【结论】${e.verdict}`,...e.notes.map(p=>`※ ${p}`)].filter(Boolean).join(`
|
|
108
|
+
`)}function Dn(e){const n=[e.summary??JSON.stringify(e,null,2)];if(e.shadow&&e.shadow.id){const t=e.shadow;n.push(`【影子盘】${t.id}(同参数同 ID;版本 ${t.version})
|
|
109
|
+
基础指纹 ${t.baseId}(不含版本,跨版本可比对)`+(t.reproducible===!1?`
|
|
110
|
+
⚠ 不可复算:${t.reason}`:"")+(t.reproducible===!0&&t.asOfPinned===!1&&(t.system==="bazi"||t.system==="ziwei")?`
|
|
111
|
+
提示:未固定 asOf,流年/流月随「此刻」变化;要比对请传 asOf。`:""))}if(Array.isArray(e.trace)&&e.trace.length&&n.push(`【推导链】${s[e.system]||e.system} · ${e.trace.length} 层
|
|
112
|
+
`+e.trace.map((t,a)=>`${a+1}. ${t.field}|${t.result}
|
|
113
|
+
规则:${t.rule} 出处:${t.source}`).join(`
|
|
114
|
+
`)),e.interpret){const t=hn(e.interpret);t&&n.push(t)}if(e.cross&&n.push(`【八字 × 紫微 交叉验证】
|
|
115
|
+
${Ee(e.cross)}`),e.caliber&&Array.isArray(e.caliber.switches)&&e.caliber.switches.length){const t=e.caliber;n.push(`【口径对照】同一组输入,只换一个口径(不判哪套更准,也不改盘面)
|
|
116
|
+
`+t.switches.map(a=>a.error?`· ${a.title}:未能对照(${a.error})`:a.total?`· ${a.title}:${a.currentLabel} → ${a.altLabel}
|
|
117
|
+
${a.summary}`:`· ${a.title}:${a.currentLabel} → ${a.altLabel},本盘无变化`).join(`
|
|
118
|
+
`))}if(e.followup){const t=e.followup;n.push(`【追问】${t.question}
|
|
119
|
+
${t.answer}${t.evidence&&t.evidence.length?`
|
|
120
|
+
依据:${t.evidence.join(";")} 置信度:${t.confidence}`:""}`)}if(e.past&&Array.isArray(e.past.rows)&&e.past.rows.length&&n.push(`【验前事】过去 ${e.past.years} 年的流年信号(只读,不改盘)
|
|
121
|
+
`+e.past.rows.map(t=>`· ${t.year} ${t.ganzhi} · ${t.theme}(${t.tier}${t.tenGod?`,${t.tenGod}`:""})`).join(`
|
|
122
|
+
`)+`
|
|
123
|
+
用法:在面板里勾「准 / 不准 / 不确定」后算贴合度;贴合度低时先核对出生时间、时区与晚子时口径。`),e.rectify&&Array.isArray(e.rectify.candidates)){const t=e.rectify;n.push(`【生时校正】候选时辰 ${t.candidates.length} 个(固定规则打分,只缩小范围)
|
|
124
|
+
`+t.candidates.slice(0,8).map(a=>`· ${a.label} 时柱 ${a.hourGanzhi} / 日柱 ${a.dayGanzhi} · 命中 ${a.hits}/${a.total}`).join(`
|
|
125
|
+
`)+`
|
|
126
|
+
${t.note}`)}return n.filter(Boolean).join(`
|
|
127
|
+
|
|
128
|
+
`)}return{interpret:be,DIRECTIONS:Ie,DIRECTION_DEFAULT:ge,BRIGHTNESS:N,flowOf:v,geocodeAddress:x,resolveAddress:P,buildBazi:W,buildLiuyao:J,tossLines:U,followup:Te,askPrompt:xe,pastSignals:A,verifyFit:O,rectifyBirth:w,crossCheck:ve,crossText:Ee,crossSection:ke,buildAlmanac:X,buildZeri:F,buildChenggu:ee,buildXiaoliuren:ue,buildStar:ye,buildNumerology:Oe,buildConvert:_e,buildTrend:an,buildFengshui:Ze,buildName:sn,buildTrace:rn,parseDateTime:D,chartFingerprint:fn,shadowSnapshot:pn,shadowDiff:bn,compute:ln,interpretText:hn,caliberCompare:wn,renderText:Dn}})(),{Engine:k.index}}});
|