dsh-metaphysics 0.76.0 → 0.77.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.
@@ -1,6 +1,6 @@
1
- window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.wuyunliuqi.js",factory(qt){const D={};return D.fail=(function(){return{fail:(J,W)=>{const K=new Error(W);return K.code=J,K}}})(),D.bool=(function(){function R(s,u=!1){return s==null||s===""?u:s===!0||s===1||s==="true"||s==="1"?!0:s===!1||s===0||s==="false"||s==="0"?!1:u}const J={lateZi:!0,trueSolar:!0,dst:!0,isLeapMonth:!1,leapAsNext:!1,cross:!1,hourUnknown:!1,diff:!1,shadow:!1,trace:!1,rectify:!1,withInterpret:!1},W={lateZi:!0,trueSolar:!0,dst:!0,hourUnknown:!1};function K(s,u){let l=s;const O=($,w)=>{Object.is(s[$],w)||(l===s&&(l={...s}),l[$]=w)},x=$=>{l===s&&(l={...s}),delete l[$]};for(const[$,w]of Object.entries(u))if(s[$]!==void 0){if(typeof s[$]=="string"&&s[$].trim()===""){x($);continue}O($,R(s[$],w))}return l}function F(s){if(!s||typeof s!="object"||Array.isArray(s))return s;let u=s;for(const[l,O]of Object.entries(W)){if(s[l]===void 0)continue;if(typeof s[l]=="string"&&s[l].trim()===""){u===s&&(u={...s}),delete u[l];continue}const x=R(s[l],O);Object.is(s[l],x)||(u===s&&(u={...s}),u[l]=x)}return u}function q(s){if(!s||typeof s!="object")return s;let u=K(s,J);for(const l of["partner","partner2"]){const O=u[l],x=F(O);x!==O&&(u===s&&(u={...s}),u[l]=x)}return u}const A=["hour","minute","longitude","verifyPast","seed","days","lunarYear","lunarMonth","lunarDay","num1","num2","num3","upper","lower","changing","count","toAge","fortuneYear","period","limit","sittingOffset","sittingDegree","facingOffset","facingDegree","year","month","day"],P=["lines","rectifyHours","answers"],z=["strokeOverrides","surnameStrokes"],b=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;function y(s){if(typeof s!="string")return s;const u=s.trim();if(!b.test(u))return s;const l=Number(u);return Number.isFinite(l)?l:s}function L(s){let u=!1;const l={};for(const[O,x]of Object.entries(s)){const $=x===null?null:y(x);Object.is($,x)||(u=!0),l[O]=$}return u?l:s}function T(s){if(!s||typeof s!="object")return s;let u=s;const l=(O,x)=>{Object.is(s[O],x)||(u===s&&(u={...s}),u[O]=x)};for(const O of A)if(s[O]!==void 0){if(typeof s[O]=="string"&&s[O].trim()===""){u===s&&(u={...s}),delete u[O];continue}l(O,y(s[O]))}for(const O of P){const x=s[O];if(!Array.isArray(x))continue;let $=!1;const w=x.map(o=>{if(o===null)return null;if(typeof o=="string"&&o.trim()===""){$=!0;return}const d=y(o);return Object.is(d,o)||($=!0),d});$&&l(O,w)}for(const O of z){const x=s[O];!x||typeof x!="object"||Array.isArray(x)||l(O,L(x))}return u}return{bool:R,FLAG_DEFAULTS:J,canonicalFlags:q,NUMERIC_KEYS:A,NUMERIC_ARRAY_KEYS:P,NUMERIC_MAP_KEYS:z,canonicalNumbers:T}})(),D.diff=(function(){const{bool:R}=D.bool||{},J=new Set(["summary","interpret","castAt","asOf","precision","disclaimer","note","trueSolarText","civilText","offsetMinutes","input","jd","juMethod","juMethodNote","lateZiHourMode","leapPolicy","schools","bodyMasterSchool","bodyMasterNote","handle","handleError","revision","brief","briefError"]),W=o=>o!==null&&typeof o=="object";function K(o,d,h="",g=[]){if(o===d)return g;if(!W(o)||!W(d))return g.push({path:h||"(root)",from:o,to:d}),g;const N=new Set([...Object.keys(o),...Object.keys(d)]);for(const _ of N){if(J.has(_))continue;const M=h?`${h}.${_}`:_,B=o[_],se=d[_];W(B)&&W(se)?K(B,se,M,g):JSON.stringify(B)!==JSON.stringify(se)&&g.push({path:M,from:B,to:se})}return g}const F=[[/^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(Exact)?\./,"起运时间"],[/^dayun\./,"大运评分"],[/^liunian\./,"流年"],[/^jieqi\./,"节气边界"],[/^solarTime\./,"真太阳时"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^yueJiang\./,"月将"],[/^xunKong$/,"旬空"],[/^lines\.(\d+)\./,"爻"],[/^shensha\./,"神煞"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^relations\./,"干支关系"],[/^input\./,"输入回显"]],q=[[/^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\./,"爻"]],A=[[/^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 P(o){for(const[d,h]of F)if(d.test(o))return h;return z(o)||o}function z(o){for(const[d,h]of q)if(d.test(o))return h;return""}function b(o){for(const[d,h]of A)if(d.test(o))return h;return""}function y(o){return[...o].sort((d,h)=>d.path.localeCompare(h.path,"zh-Hans-CN",{numeric:!0}))}function L(o){if(!o.length)return"本盘不受此口径影响:所有字段一致。";const d=o.filter(_=>b(_.path)),h=[...new Set(o.map(_=>z(_.path)).filter(Boolean))],g=d.length?`根因 ${d.length} 处:`+d.slice(0,4).map(_=>`${P(_.path)} ${T(_.from)}→${T(_.to)}`).join("、")+(d.length>4?" 等":""):"无单一根因",N=h.length?`;连带影响 ${h.slice(0,6).join("、")}${h.length>6?" 等":""} ${h.length} 类,共 ${o.length} 处`:`;共 ${o.length} 处`;return g+N+"。"}const T=o=>o===void 0?"—":o===null?"null":typeof o=="string"?o:Array.isArray(o)?o.join("")||"[]":typeof o=="object"?JSON.stringify(o):String(o);function s(o,{title:d="",limit:h=12}={}){const g=[];if(d&&g.push(`【${d}】`),g.push(L(o)),!o.length)return g.join(`
2
- `);const N=y(o.filter(M=>b(M.path))),_=y(o.filter(M=>!b(M.path)));if(N.length){g.push(""),g.push(" 根因(口径直接改动):");for(const M of N)g.push(` ${P(M.path).padEnd(6)} ${T(M.from)} → ${T(M.to)}`)}if(_.length){g.push(""),g.push(` 连带变化(${_.length} 处,展示前 ${Math.min(h,_.length)} 处):`);for(const M of _.slice(0,h))g.push(` ${P(M.path).padEnd(6)} ${T(M.from)} → ${T(M.to)}`);if(_.length>h){const M={};for(const B of _.slice(h)){const se=z(B.path)||"其他";M[se]=(M[se]||0)+1}g.push(" 其余:"+Object.entries(M).map(([B,se])=>`${B} ${se} 处`).join("、"))}}return g.join(`
3
- `)}const u=(o,d,h,g,N,_)=>({key:o,title:d,short:h,read:M=>{const B=M[o]!==void 0?M[o]:M.schools&&M.schools[o];return _[B]?B:g},alt:M=>M===N?g:N,label:M=>_[M]||M}),l={bazi:[{key:"lateZi",title:"晚子时:23:00 后是否换日",short:"晚子时",read:o=>R(o.lateZi,!0),alt:o=>!o,label:o=>o?"换日":"不换日"},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:o=>R(o.trueSolar,!0),alt:o=>!o,label:o=>o?"修正":"不修正"}],ziwei:[{key:"leapMonth",title:"闰月归月:按日切分 / 整月归次月",short:"闰月归月",read:o=>o.leapMonth==="next"||o.leapMonth==="prev"?o.leapMonth:"split",alt:o=>o==="split"?"next":"split",label:o=>({split:"按日切分",next:"整月归次月",prev:"整月归本月"})[o]||o},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:o=>R(o.trueSolar,!0),alt:o=>!o,label:o=>o?"修正":"不修正"},u("brightnessSchool","亮度表:默认 / QS 七档","亮度表","default","QS",{default:"默认",QS:"QS(七档)",XD1:"XD1(七档)",ZZ:"ZZ(五档)",XD2:"XD2(五档)"}),u("gengYearSihua","庚干四化:阳武阴同 / 同科阴忌","庚干四化","GYWYT","GYWTY",{GYWYT:"阳武阴同",GYWTY:"同科阴忌",GYWFT:"府科同忌",GYWFX:"府科相忌",GYWTX:"同科相忌"}),u("tianmaSchool","天马:按年支 / 按生月","天马","year-branch","month-branch",{"year-branch":"年支","month-branch":"生月"}),u("tiankongSchool","天空:不排 / 年支顺行","天空","off","normal",{off:"不排",normal:"年支顺行","shun-jia-shi":"加生时"}),u("jiekongSchool","截空旬空:不排 / 正副双星","截空旬空","off","double",{off:"不排",single:"单星",double:"正副双星",zhanyan:"占验派"}),u("kuiyueSchool","魁钺:qs1 / qs2","魁钺","qs1","qs2",{qs1:"qs1",qs2:"qs2","zhong-yiming":"中一鸣"}),u("tianshiTianshang","天伤天使:常规 / 中州互换","天伤天使","normal","zhongzhou",{normal:"常规",zhongzhou:"中州(阴男阳女互换)"}),u("changshengSchool","长生:阴阳顺逆 / 火土起寅","长生","yin-yang-shun-ni","huo-tu",{"yin-yang-shun-ni":"阴阳顺逆","shui-tu":"水二","huo-tu":"火土(土五局起寅)"}),u("lateZishi","晚子时:归当日 / 归次日","晚子时","current-day","next-day",{"current-day":"归当日","next-day":"归次日","all-current":"全归当日","day-cur-time-next":"日归当日·时归次日"}),u("shenzhuSchool","身主:子午皆火星 / 子铃午火","身主","common","verse",{common:"子午皆火星",verse:"子铃午火(安身主诀逐字)"}),u("mingzhuSchool","命主取法:命宫地支 / 生年年支","命主取法","soul-branch","year-branch",{"soul-branch":"命宫地支(通行本)","year-branch":"生年年支(中州派)"}),u("zuoyaoSchool","杂曜:49 颗简盘 / 61 颗全表","杂曜全表","minimal","full",{minimal:"49 颗(简盘)",full:"61 颗(加十二颗杂曜)"}),u("liunianSihua","流年四化取干:流年天干 / 流年命宫宫干","流年四化取干","year-stem","life-palace-stem",{"year-stem":"流年天干","life-palace-stem":"流年命宫宫干"}),u("sihuaVariant","十干四化:通行表 / 变体整表替换","十干四化变体","default","廉破曲阳",{default:"各干通行表",廉破曲阳:"甲干 廉破曲阳",贪阴阳机:"戊干 贪阴阳机",阳武同阴:"庚干 阳武同阴",阳武府同:"庚干 阳武府同",阳武府相:"庚干 阳武府相",阳武同相:"庚干 阳武同相",巨阳武昌:"辛干 巨阳武昌",梁紫府武:"壬干 梁紫府武",梁紫相武:"壬干 梁紫相武",破巨阳贪:"癸干 破巨阳贪"}),u("jieluSchool","截路空亡:照常 / 不排(中州派)","截路空亡","off","zhongzhou",{off:"照常(截空/副截/旬空/副旬)",zhongzhou:"不排(中州派)"}),u("suipoSchool","岁前十二神:照常 / 大耗改岁破(中州派)","岁前十二神","off","zhongzhou",{off:"照常(大耗)",zhongzhou:"大耗改岁破"})],qimen:[{key:"juMethod",title:"取局流派:拆补 / 超神接气 / 置闰",short:"取局流派",read:o=>["chaibu","chaoshen","zhirun"].includes(o.juMethod)?o.juMethod:"chaibu",alt:o=>o==="chaibu"?"zhirun":"chaibu",label:o=>({chaibu:"拆补法",chaoshen:"超神接气",zhirun:"置闰法"})[o]||o},{key:"lateZiHourMode",title:"晚子时:23:00 后归当日 / 次日",short:"晚子时归日",read:o=>o.lateZiHourMode==="next-day"?"next-day":"same-day",alt:o=>o==="next-day"?"same-day":"next-day",label:o=>o==="next-day"?"归次日":"归当日"}]},O={bazi:[{path:"pillars.day.ganzhi",label:"日柱"},{path:"pillars.hour.ganzhi",label:"时柱"},{path:"strength.level",label:"旺衰"},{path:"frame.primaryName",label:"格局"},{path:"frame.yongshen.favor",label:"喜用"},{path:"dayun.jiao.at",label:"起运"}],ziwei:[{path:"soul.ganzhi",label:"命宫"},{path:"body.branch",label:"身宫支"},{path:"bureau.name",label:"五行局"},{path:"bodyMaster",label:"身主"},{path:"daxianList.0.ages",label:"起大限"}],qimen:[{path:"siZhu.day",label:"日柱"},{path:"ju",label:"局数"},{path:"zhiFu.star",label:"值符"},{path:"zhiShi.gate",label:"值使"}]};function x(o,d){let h=o;for(const g of String(d).split(".")){if(h==null)return;h=h[g]}return h}function $(o){return o==null?"—":Array.isArray(o)?o.join("、"):typeof o=="object"?"—":String(o)}function w(o,d,h){return(O[o]||[]).map(N=>{const _=$(x(d,N.path)),M=$(x(h,N.path));return{key:N.path,label:N.label,current:_,alt:M,changed:_!==M}})}return{diffObjects:K,labelOf:P,categoryOf:z,rootOf:b,sortDiffs:y,summarize:L,formatValue:T,renderDiff:s,CALIBER_SWITCHES:l,CALIBER_VIEWS:O,viewCell:$,viewRows:w}})(),D.fingerprint=(function(){const R="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function J(q){return JSON.stringify(W(q))}function W(q){if(q===null)return null;const A=typeof q;if(A==="string")return typeof q.normalize=="function"?q.normalize("NFC"):q;if(A==="number")return Number.isFinite(q)?Object.is(q,-0)?0:q:null;if(A==="boolean")return q;if(Array.isArray(q))return q.map(W);if(A==="object"){const P=Object.create(null);for(const z of Object.keys(q).sort()){const b=q[z];b===void 0||typeof b=="function"||typeof b=="symbol"||(P[z]=W(b))}return P}return null}function K(q){const A=String(q);let P=2166136261,z=2654435769;for(let L=0;L<A.length;L+=1){const T=A.charCodeAt(L);for(const s of[T&255,T>>>8])P=Math.imul(P^s,16777619),z=Math.imul(z^s,2246822507)}let b=(P>>>0)*8+(z>>>29),y="";for(let L=0;L<7;L+=1)y=R[b%32]+y,b=Math.floor(b/32);return y}function F(q={}){const A=String(q.system||""),P=String(q.version||"dev"),z=q.seed===void 0||q.seed===null||q.seed===""?null:Number(q.seed),b=q.asOf?String(q.asOf):null,y=q.params&&typeof q.params=="object"?q.params:{},L=J({system:A,params:y,seed:z,asOf:b}),T=J({base:L,version:P});return{id:`LY-${K(T)}`,baseId:`LY-${K(L)}`,version:P,system:A,payload:L}}return{canonicalJson:J,shortHash:K,fingerprintOf:F}})(),D.validate=(function(){const{fail:R}=D.fail||{},J=1600,W=2400;function K(y){return y%4===0&&y%100!==0||y%400===0}function F(y,L){return L===2?K(y)?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][L-1]||0}const q=y=>typeof y=="string"?`「${y}」`:String(y),A="引擎只接受解析好的公历字段 { year, month, day, hour?, minute? };字符串请先交给宿主层的 parseDateTime 解析";function P(y,L=""){const T=L?`${L} 的`:"";if(!y||typeof y!="object"||Array.isArray(y)){const O=y===null?"null":Array.isArray(y)?"数组":typeof y;throw R("E_INPUT",`${T}入参必须是对象(收到 ${O});${A}`)}const s=y.hour===void 0?0:y.hour,u=y.minute===void 0?0:y.minute;for(const[O,x]of[["year",y.year],["month",y.month],["day",y.day],["hour",s],["minute",u]])if(!Number.isInteger(x))throw R("E_INPUT",`${T}${O} 必须是整数(收到 ${q(x)});${A}`);if(y.year<J||y.year>W)throw R("E_INPUT",`${T}year 超出支持范围 ${J}–${W}(收到 ${y.year});更早的年份时区与历法口径不可靠`);if(y.month<1||y.month>12)throw R("E_INPUT",`${T}month 超出范围 1–12(收到 ${y.month})`);const l=F(y.year,y.month);if(y.day<1||y.day>l)throw R("E_INPUT",`${T}日期不存在:${y.year}-${y.month}-${y.day}(${y.year} 年 ${y.month} 月只有 ${l} 天)`);if(s<0||s>23)throw R("E_INPUT",`${T}hour 超出范围 0–23(收到 ${s})`);if(u<0||u>59)throw R("E_INPUT",`${T}minute 超出范围 0–59(收到 ${u})`);return y}function z(y,L,T){if(!y||typeof y!="object"||Array.isArray(y)){const s=y===null?"null":y===void 0?"undefined":Array.isArray(y)?"数组":typeof y;throw R("E_INPUT",`${L} 必须是对象(收到 ${s});${T}`)}return y}function b(y,L=""){const T=L?`${L}:`:"";if(y.year<J||y.year>W)throw R("E_RANGE",`${T}晚子时按次日归后落到 ${y.year}-${String(y.month).padStart(2,"0")}-${String(y.day).padStart(2,"0")},超出可计算范围 ${J}–${W};请把时刻挪到 23 点前,或换一天起课`);return y}return{MIN_YEAR:J,MAX_YEAR:W,isLeapYear:K,daysInMonth:F,assertCivil:P,assertObject:z,assertShifted:b}})(),D.datetime=(function(){const{fail:R}=D.fail||{},{MIN_YEAR:J,MAX_YEAR:W}=D.validate||{};function K(A,P){return P===2?A%4===0&&A%100!==0||A%400===0?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][P-1]}function F(A,P=""){const z=String(A??"").trim(),b=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(z);if(!b)return null;const y=Number(b[1]),L=Number(b[2]),T=Number(b[3]);if(L<1||L>12||T<1||T>K(y,L))return null;if(y<J||y>W){const s=P?`${P} `:"";throw R("E_RANGE",`${s}「${b[0]}」的年份超出可计算范围(${J}–${W},收到 ${y} 年);农历与节气表不覆盖之外的年份`)}return{year:y,month:L,day:T}}function q(A){if(typeof A!="string"||!A.trim())throw R("E_INPUT","缺少 datetime(公历日期时间),例如 1990-05-12T14:30");const P=A.trim().match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?$/);if(!P)throw R("E_INPUT",`无法解析 datetime:「${A}」,请用 1990-05-12T14:30 这种格式`);if(P[6]!==void 0&&Number(P[6])>59)throw R("E_INPUT",`秒超出范围:${P[6]}`);const z={year:Number(P[1]),month:Number(P[2]),day:Number(P[3]),hour:Number(P[4]??0),minute:Number(P[5]??0)};if(z.month<1||z.month>12)throw R("E_INPUT",`月份超出范围:${z.month}`);const b=K(z.year,z.month);if(z.day<1||z.day>b)throw R("E_INPUT",`日期不存在:${z.year}-${z.month}-${z.day}(${z.year} 年 ${z.month} 月只有 ${b} 天)`);if(z.hour>23||z.minute>59)throw R("E_INPUT",`时间超出范围:${z.hour}:${z.minute}`);if(z.year<J||z.year>W)throw R("E_RANGE",`年份 ${z.year} 超出可计算范围(${J}–${W})`);return(z.year<1900||z.year>2100)&&(z.precision={level:"approx",note:`ΔT 模型仅覆盖 1900–2100,${z.year} 年按端点值外推,节气与朔望时刻可能有分钟级偏差,月柱在交节前后需复核`}),z}return{daysInMonth:K,parseYmd:F,parseDateTime:q}})(),D.lru=(function(){function R({max:J=64,ttlMs:W=0,name:K="lru",now:F=()=>Date.now()}={}){const q=new Map,A={name:K,hits:0,misses:0,evictions:0,expirations:0},P=z=>W>0&&F()-z.at>W;return{name:K,max:J,ttlMs:W,get(z){const b=q.get(z);if(!b||P(b)){b&&(q.delete(z),A.expirations+=1),A.misses+=1;return}return q.delete(z),q.set(z,b),A.hits+=1,b.value},set(z,b){for(q.has(z)&&q.delete(z),q.set(z,{value:b,at:F()});q.size>J;)q.delete(q.keys().next().value),A.evictions+=1;return b},has(z){const b=q.get(z);return b?P(b)?(q.delete(z),A.expirations+=1,!1):!0:!1},delete(z){return q.delete(z)},clear(){q.clear()},get size(){return q.size},stats(){const z=A.hits+A.misses;return{name:K,size:q.size,max:J,hits:A.hits,misses:A.misses,evictions:A.evictions,expirations:A.expirations,hitRate:z?A.hits/z:0}}}}return{createLru:R}})(),D.nayin=(function(){const R=["海中金","炉中火","大林木","路旁土","剑锋金","山头火","涧下水","城头土","白蜡金","杨柳木","泉中水","屋上土","霹雳火","松柏木","长流水","沙中金","山下火","平地木","壁上土","金箔金","覆灯火","天河水","大驿土","钗钏金","桑柘木","大溪水","沙中土","天上火","石榴木","大海水"];function J(W){const K=(Number(W)%60+60)%60,F=R[Math.floor(K/2)];return{name:F,element:F[2]}}return{NAYIN_NAMES:R,nayinOf:J}})(),D.sanhe=(function(){const R=[{branches:["申","子","辰"],element:"水"},{branches:["亥","卯","未"],element:"木"},{branches:["寅","午","戌"],element:"火"},{branches:["巳","酉","丑"],element:"金"}],J=Object.fromEntries(R.map(F=>[F.branches.join(""),F.element])),W=Object.fromEntries(R.flatMap(F=>F.branches.map(q=>[q,F.element])));function K(F){return R.find(q=>q.branches.includes(F))||null}return{SANHE_GROUPS:R,SANHE:J,SANHE_ELEMENT:W,sanheGroupOf:K}})(),D["vsop-earth"]=(function(){const R=[[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]],W=[[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]],K=[[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]],F=[[7714e-11,4.14117321449,6283.0758499914],[1016e-11,3.27573644241,12566.1516999828]];function q(A){let P=0;for(const[b,y,L]of R)P+=b*Math.cos(y+L*A);let z=1;for(const b of[J,W,K,F]){z*=A;for(const[y,L,T]of b)P+=y*z*Math.cos(L+T*A)}return P}return{earthL:q}})(),D.calendar=(function(){const{earthL:R}=D["vsop-earth"]||{},{createLru:J}=D.lru||{},{bool:W}=D.bool||{},K=["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],F=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],q=["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"];function A(f){return(285+15*f)%360}function P(f,S,k){const Y=Math.floor((14-S)/12),U=f+4800-Y,Q=S+12*Y-3;return k+Math.floor((153*Q+2)/5)+365*U+Math.floor(U/4)-Math.floor(U/100)+Math.floor(U/400)-32045}function z(f){const S=f+32044,k=Math.floor((4*S+3)/146097),Y=S-Math.floor(146097*k/4),U=Math.floor((4*Y+3)/1461),Q=Y-Math.floor(1461*U/4),te=Math.floor((5*Q+2)/153);return{year:100*k+U-4800+Math.floor(te/10),month:te+3-12*Math.floor(te/10),day:Q-Math.floor((153*te+2)/5)+1}}function b(f,S){for(let k=0;k<60;k++)if(k%10===f&&k%12===S)return k;return-1}function y(f){const S=(f%60+60)%60;return{index:S,stem:K[S%10],branch:F[S%12],name:K[S%10]+F[S%12]}}function L(f){return((f+49)%60+60)%60}function T(f){const S=f-2451545,k=S/36525,Y=S/365250;let U=R(Y)*180/Math.PI+180;U=(U%360+360)%360;const Q=(5029.0966*k+1.11113*k*k-6e-6*k*k*k)/3600;U+=Q,U-=.09033/3600;const te=(125.04452-1934.136261*k)*Math.PI/180,re=(280.4665+36000.7698*k)*Math.PI/180,Z=(218.3165+481267.8813*k)*Math.PI/180,ce=(-17.2*Math.sin(te)-1.32*Math.sin(2*re)-.23*Math.sin(2*Z)+.21*Math.sin(2*te))/3600;U+=ce;const ue=(357.52911+35999.05029*k-1537e-7*k*k)*Math.PI/180,$e=.016708634-42037e-9*k-1267e-10*k*k,je=1.000001018*(1-$e*$e)/(1+$e*Math.cos(ue+(1.914602-.004817*k)*(Math.PI/180)*Math.sin(ue)));return U-=20.4898/3600/(je||1),(U%360+360)%360}function s(f){if(f<1900){const te=f;if(te<1600)return 120;if(te<1700){const Z=te-1600;return 120-.9808*Z-.01532*Z*Z+Z*Z*Z/7129}if(te<1800){const Z=te-1700;return 8.83+.1603*Z-.0059285*Z*Z+13336e-8*Z*Z*Z-Z**4/1174e3}if(te<1860){const Z=te-1800;return 13.72-.332447*Z+.0068612*Z*Z+.0041116*Z**3-37436e-8*Z**4+121272e-10*Z**5-1699e-10*Z**6+875e-12*Z**7}const re=te-1860;return 7.62+.5737*re-.251754*re*re+.01680668*re**3-.0004473624*re**4+re**5/233174}const S=[[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(f<=S[0][0])return S[0][1];for(let te=1;te<S.length;te++)if(f<=S[te][0]){const[re,Z]=S[te-1],[ce,ue]=S[te];return Z+(ue-Z)*(f-re)/(ce-re)}const[k,Y]=S[S.length-1],U=(k-1820)/100,Q=(f-1820)/100;return Y+32*(Q*Q-U*U)}const u=8/24,l=7.7611/24,O=2425612+4/24;function x(f){return f<O?l:u}const $=J({max:4096,name:"termInstant"}),w=1e-5,o=new Map,d=365.2422;function h(f,S){const k=A(S),Y=P(f,1,5)-.5+S*15.2184,U=o.get(S);let Q=U!==void 0?U+d:Y;Math.abs(Q-Y)>20&&(Q=Y);for(let re=0;re<12;re++){let Z=k-T(Q);if(Z=((Z+180)%360+360)%360-180,Q+=Z/.98564736,Math.abs(Z)<w)break}o.set(S,Q);const te=Q-s(f)/86400;return te+x(te)}function g(f,S){const k=f*24+S,Y=$.get(k);if(Y!==void 0)return Y;const U=h(f,S);return $.set(k,U),U}function N(f){const S=Math.floor(f+.5),k=f+.5-S,Y=Math.min(1439,Math.floor(Math.round(k*86400)/60)),{year:U,month:Q,day:te}=z(S);return{year:U,month:Q,day:te,hour:Math.floor(Y/60),minute:Y%60}}function _({year:f,month:S,day:k,hour:Y=0,minute:U=0}){return P(f,S,k)-.5+(Y*60+U)/1440}function M(f,S,k){const Y=P(f,S,k)-P(f,1,1)+1,U=2*Math.PI*(Y-81)/364;return 9.87*Math.sin(2*U)-7.53*Math.cos(U)-1.5*Math.sin(U)}const B=J({max:8,name:"termWindow"}),se=J({max:32,name:"termYear"}),H=Array.from({length:24},(f,S)=>S),pe=H.filter(f=>f%2===0);function be(f,S){const k=S?`${f}|jie`:`${f}|all`,Y=se.get(k);if(Y)return Y;if(S){const Q=se.get(`${f}|all`);if(Q){const te=Q.filter(re=>re.index%2===0);return se.set(k,te),te}}const U=[];for(const Q of S?pe:H)U.push({year:f,index:Q,name:q[Q],jd:g(f,Q)});return U.sort((Q,te)=>Q.jd-te.jd),se.set(k,U),U}function we(f,S={}){const k=W(S.jieOnly),Y=k?`${f}|jie`:f,U=B.get(Y);if(U)return U;const Q=[...be(f-1,k),...be(f,k),...be(f+1,k)];return Q.sort((te,re)=>te.jd-re.jd),B.set(Y,Q),Q}function oe(f){if(typeof f!="string"||f.length<2)return[];const S=K.indexOf(f[0]),k=F.indexOf(f[1]);if(S<0||k<0)return[];const Y=b(S,k);if(Y<0)return[];const U=Math.floor(Y/10)*10;return[F[(U+10)%12],F[(U+11)%12]]}function i(f,S){let k=null;for(const Y of f)if(Y.index%2===0)if(Y.jd<=S)k=Y;else break;return k}function m(f,S){for(const k of f)if(k.index%2===0&&k.jd>S)return k;return null}function C(f){const S=N(f),k=Y=>String(Y).padStart(2,"0");return`${S.year}-${k(S.month)}-${k(S.day)} ${k(S.hour)}:${k(S.minute)}`}function v(){return[$.stats(),se.stats(),B.stats()]}return{STEMS:K,BRANCHES:F,TERM_NAMES:q,termLongitude:A,toJDN:P,fromJDN:z,sexagenaryIndex:b,ganzhiName:y,dayGanzhiIndex:L,sunLongitude:T,deltaTSeconds:s,OFFSET_MODERN:u,OFFSET_BEIJING_LOCAL:l,CUTOVER_JD:O,localOffsetFor:x,termInstantJd:g,jdToParts:N,partsToJd:_,equationOfTime:M,termWindow:we,xunKongOf:oe,previousJie:i,nextJie:m,formatJd:C,cacheMetrics:v}})(),D.lunar=(function(){const{toJDN:R,jdToParts:J,termInstantJd:W,deltaTSeconds:K,localOffsetFor:F}=D.calendar||{},q=29.530588861,A=245155009766e-5,P=Math.PI/180;function z(s){const u=s/1236.85,l=A+q*s+15437e-8*u*u-15e-8*u*u*u+73e-11*u*u*u*u,O=1-.002516*u-74e-7*u*u,x=(2.5534+29.1053567*s-14e-7*u*u-11e-8*u*u*u)*P,$=(201.5643+385.81693528*s+.0107582*u*u+1238e-8*u*u*u-58e-9*u*u*u*u)*P,w=(160.7108+390.67050284*s-.0016118*u*u-227e-8*u*u*u+11e-9*u*u*u*u)*P,o=(124.7746-1.56375588*s+.0020672*u*u+215e-8*u*u*u)*P,d=-.4072*Math.sin($)+.17241*O*Math.sin(x)+.01608*Math.sin(2*$)+.01039*Math.sin(2*w)+.00739*O*Math.sin($-x)-.00514*O*Math.sin($+x)+.00208*O*O*Math.sin(2*x)-.00111*Math.sin($-2*w)-57e-5*Math.sin($+2*w)+56e-5*O*Math.sin(2*$+x)-42e-5*Math.sin(3*$)+42e-5*O*Math.sin(x+2*w)+38e-5*O*Math.sin(x-2*w)-24e-5*O*Math.sin(2*$-x)-17e-5*Math.sin(o)-7e-5*Math.sin($+2*x)+4e-5*Math.sin(2*$-2*w)+4e-5*Math.sin(3*x)+3e-5*Math.sin($+x-2*w)+3e-5*Math.sin(2*$+2*w)-3e-5*Math.sin($+x+2*w)+3e-5*Math.sin($-x+2*w)-2e-5*Math.sin($-x-2*w)-2e-5*Math.sin(3*$+x)+2e-5*Math.sin(4*$),h=l+d-K(2e3+u*100)/86400;return h+F(h)}function b(s){return Math.floor(s+.5)}function y(s){return Math.round((s+.5-A)/q)}function L(s,u,l){for(let O=s-1;O<=s+1;O++)for(let x=1;x<24;x+=2){const $=W(O,x),w=b($);if(w>=u&&w<l)return{index:x,jd:$}}return null}function T(s,u,l){const O=R(s,u,l),x=b(W(s,23)),$=O<x?s-1:s,w=b(W($,23));let o=y(w);for(;b(z(o))>w;)o--;for(;b(z(o+1))<=w;)o++;const d=b(W($+1,23));let h=o;for(;b(z(h+1))<=d;)h++;const g=h-o;let N=-1;if(g===13)for(let B=1;B<=g;B++){const se=b(z(o+B-1)),H=b(z(o+B));if(!L($,se,H)){N=B;break}}let _=11,M=!1;for(let B=1;B<=15;B++){const se=b(z(o+B-1)),H=b(z(o+B)),pe=L($,se,H),be=B===N;if(O>=se&&O<H){const we=J(z(o+B-1)),oe=be?(_+10)%12+1:_;return{year:$,lunarYear:M?$+1:$,month:oe,day:O-se+1,isLeap:be,monthStart:`${we.year}-${String(we.month).padStart(2,"0")}-${String(we.day).padStart(2,"0")}`,hasZhongQi:!!pe}}be||(_=_%12+1,_===1&&(M=!0))}throw new Error(`农历换算失败:${s}-${u}-${l}`)}return{SYNODIC:q,newMoonJd:z,dayNumberOf:b,solarToLunar:T}})(),D.geo=(function(){const{bool:R}=D.bool||{},J=`
1
+ window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.wuyunliuqi.js",factory(qt){const D={};return D.fail=(function(){return{fail:(K,Q)=>{const W=new Error(Q);return W.code=K,W}}})(),D.bool=(function(){function Y(s,u=!1){return s==null||s===""?u:s===!0||s===1||s==="true"||s==="1"?!0:s===!1||s===0||s==="false"||s==="0"?!1:u}const K={lateZi:!0,trueSolar:!0,dst:!0,isLeapMonth:!1,leapAsNext:!1,cross:!1,hourUnknown:!1,diff:!1,shadow:!1,trace:!1,rectify:!1,withInterpret:!1},Q={lateZi:!0,trueSolar:!0,dst:!0,hourUnknown:!1};function W(s,u){let c=s;const M=($,w)=>{Object.is(s[$],w)||(c===s&&(c={...s}),c[$]=w)},x=$=>{c===s&&(c={...s}),delete c[$]};for(const[$,w]of Object.entries(u))if(s[$]!==void 0){if(typeof s[$]=="string"&&s[$].trim()===""){x($);continue}M($,Y(s[$],w))}return c}function B(s){if(!s||typeof s!="object"||Array.isArray(s))return s;let u=s;for(const[c,M]of Object.entries(Q)){if(s[c]===void 0)continue;if(typeof s[c]=="string"&&s[c].trim()===""){u===s&&(u={...s}),delete u[c];continue}const x=Y(s[c],M);Object.is(s[c],x)||(u===s&&(u={...s}),u[c]=x)}return u}function q(s){if(!s||typeof s!="object")return s;let u=W(s,K);for(const c of["partner","partner2"]){const M=u[c],x=B(M);x!==M&&(u===s&&(u={...s}),u[c]=x)}return u}const A=["hour","minute","longitude","verifyPast","seed","days","lunarYear","lunarMonth","lunarDay","num1","num2","num3","upper","lower","changing","count","toAge","fortuneYear","period","limit","sittingOffset","sittingDegree","facingOffset","facingDegree","year","month","day"],P=["lines","rectifyHours","answers"],z=["strokeOverrides","surnameStrokes"],b=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;function y(s){if(typeof s!="string")return s;const u=s.trim();if(!b.test(u))return s;const c=Number(u);return Number.isFinite(c)?c:s}function L(s){let u=!1;const c={};for(const[M,x]of Object.entries(s)){const $=x===null?null:y(x);Object.is($,x)||(u=!0),c[M]=$}return u?c:s}function T(s){if(!s||typeof s!="object")return s;let u=s;const c=(M,x)=>{Object.is(s[M],x)||(u===s&&(u={...s}),u[M]=x)};for(const M of A)if(s[M]!==void 0){if(typeof s[M]=="string"&&s[M].trim()===""){u===s&&(u={...s}),delete u[M];continue}c(M,y(s[M]))}for(const M of P){const x=s[M];if(!Array.isArray(x))continue;let $=!1;const w=x.map(o=>{if(o===null)return null;if(typeof o=="string"&&o.trim()===""){$=!0;return}const d=y(o);return Object.is(d,o)||($=!0),d});$&&c(M,w)}for(const M of z){const x=s[M];!x||typeof x!="object"||Array.isArray(x)||c(M,L(x))}return u}return{bool:Y,FLAG_DEFAULTS:K,canonicalFlags:q,NUMERIC_KEYS:A,NUMERIC_ARRAY_KEYS:P,NUMERIC_MAP_KEYS:z,canonicalNumbers:T}})(),D.diff=(function(){const{bool:Y}=D.bool||{},K=new Set(["summary","interpret","castAt","asOf","precision","disclaimer","note","trueSolarText","civilText","offsetMinutes","input","jd","juMethod","juMethodNote","lateZiHourMode","leapPolicy","schools","bodyMasterSchool","bodyMasterNote","handle","handleError","revision","brief","briefError"]),Q=o=>o!==null&&typeof o=="object";function W(o,d,h="",g=[]){if(o===d)return g;if(!Q(o)||!Q(d))return g.push({path:h||"(root)",from:o,to:d}),g;const N=new Set([...Object.keys(o),...Object.keys(d)]);for(const _ of N){if(K.has(_))continue;const O=h?`${h}.${_}`:_,J=o[_],se=d[_];Q(J)&&Q(se)?W(J,se,O,g):JSON.stringify(J)!==JSON.stringify(se)&&g.push({path:O,from:J,to:se})}return g}const B=[[/^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(Exact)?\./,"起运时间"],[/^dayun\./,"大运评分"],[/^liunian\./,"流年"],[/^jieqi\./,"节气边界"],[/^solarTime\./,"真太阳时"],[/^dayGanZhi$/,"日辰"],[/^hourZhi$/,"时支"],[/^yueJiang\./,"月将"],[/^xunKong$/,"旬空"],[/^lines\.(\d+)\./,"爻"],[/^shensha\./,"神煞"],[/^frame\./,"格局用神"],[/^strength\./,"旺衰"],[/^wuxing\./,"五行计数"],[/^relations\./,"干支关系"],[/^input\./,"输入回显"]],q=[[/^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\./,"爻"]],A=[[/^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 P(o){for(const[d,h]of B)if(d.test(o))return h;return z(o)||o}function z(o){for(const[d,h]of q)if(d.test(o))return h;return""}function b(o){for(const[d,h]of A)if(d.test(o))return h;return""}function y(o){return[...o].sort((d,h)=>d.path.localeCompare(h.path,"zh-Hans-CN",{numeric:!0}))}function L(o){if(!o.length)return"本盘不受此口径影响:所有字段一致。";const d=o.filter(_=>b(_.path)),h=[...new Set(o.map(_=>z(_.path)).filter(Boolean))],g=d.length?`根因 ${d.length} 处:`+d.slice(0,4).map(_=>`${P(_.path)} ${T(_.from)}→${T(_.to)}`).join("、")+(d.length>4?" 等":""):"无单一根因",N=h.length?`;连带影响 ${h.slice(0,6).join("、")}${h.length>6?" 等":""} ${h.length} 类,共 ${o.length} 处`:`;共 ${o.length} 处`;return g+N+"。"}const T=o=>o===void 0?"—":o===null?"null":typeof o=="string"?o:Array.isArray(o)?o.join("")||"[]":typeof o=="object"?JSON.stringify(o):String(o);function s(o,{title:d="",limit:h=12}={}){const g=[];if(d&&g.push(`【${d}】`),g.push(L(o)),!o.length)return g.join(`
2
+ `);const N=y(o.filter(O=>b(O.path))),_=y(o.filter(O=>!b(O.path)));if(N.length){g.push(""),g.push(" 根因(口径直接改动):");for(const O of N)g.push(` ${P(O.path).padEnd(6)} ${T(O.from)} → ${T(O.to)}`)}if(_.length){g.push(""),g.push(` 连带变化(${_.length} 处,展示前 ${Math.min(h,_.length)} 处):`);for(const O of _.slice(0,h))g.push(` ${P(O.path).padEnd(6)} ${T(O.from)} → ${T(O.to)}`);if(_.length>h){const O={};for(const J of _.slice(h)){const se=z(J.path)||"其他";O[se]=(O[se]||0)+1}g.push(" 其余:"+Object.entries(O).map(([J,se])=>`${J} ${se} 处`).join("、"))}}return g.join(`
3
+ `)}const u=(o,d,h,g,N,_)=>({key:o,title:d,short:h,read:O=>{const J=O[o]!==void 0?O[o]:O.schools&&O.schools[o];return _[J]?J:g},alt:O=>O===N?g:N,label:O=>_[O]||O}),c={bazi:[{key:"lateZi",title:"晚子时:23:00 后是否换日",short:"晚子时",read:o=>Y(o.lateZi,!0),alt:o=>!o,label:o=>o?"换日":"不换日"},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:o=>Y(o.trueSolar,!0),alt:o=>!o,label:o=>o?"修正":"不修正"}],ziwei:[{key:"leapMonth",title:"闰月归月:按日切分 / 整月归次月",short:"闰月归月",read:o=>o.leapMonth==="next"||o.leapMonth==="prev"?o.leapMonth:"split",alt:o=>o==="split"?"next":"split",label:o=>({split:"按日切分",next:"整月归次月",prev:"整月归本月"})[o]||o},{key:"trueSolar",title:"真太阳时:是否按出生地经度修正",short:"真太阳时",read:o=>Y(o.trueSolar,!0),alt:o=>!o,label:o=>o?"修正":"不修正"},u("brightnessSchool","亮度表:默认 / QS 七档","亮度表","default","QS",{default:"默认",QS:"QS(七档)",XD1:"XD1(七档)",ZZ:"ZZ(五档)",XD2:"XD2(五档)"}),u("gengYearSihua","庚干四化:阳武阴同 / 同科阴忌","庚干四化","GYWYT","GYWTY",{GYWYT:"阳武阴同",GYWTY:"同科阴忌",GYWFT:"府科同忌",GYWFX:"府科相忌",GYWTX:"同科相忌"}),u("tianmaSchool","天马:按年支 / 按生月","天马","year-branch","month-branch",{"year-branch":"年支","month-branch":"生月"}),u("tiankongSchool","天空:不排 / 年支顺行","天空","off","normal",{off:"不排",normal:"年支顺行","shun-jia-shi":"加生时"}),u("jiekongSchool","截空旬空:不排 / 正副双星","截空旬空","off","double",{off:"不排",single:"单星",double:"正副双星",zhanyan:"占验派"}),u("kuiyueSchool","魁钺:qs1 / qs2","魁钺","qs1","qs2",{qs1:"qs1",qs2:"qs2","zhong-yiming":"中一鸣"}),u("tianshiTianshang","天伤天使:常规 / 中州互换","天伤天使","normal","zhongzhou",{normal:"常规",zhongzhou:"中州(阴男阳女互换)"}),u("changshengSchool","长生:阴阳顺逆 / 火土起寅","长生","yin-yang-shun-ni","huo-tu",{"yin-yang-shun-ni":"阴阳顺逆","shui-tu":"水二","huo-tu":"火土(土五局起寅)"}),u("lateZishi","晚子时:归当日 / 归次日","晚子时","current-day","next-day",{"current-day":"归当日","next-day":"归次日","all-current":"全归当日","day-cur-time-next":"日归当日·时归次日"}),u("shenzhuSchool","身主:子午皆火星 / 子铃午火","身主","common","verse",{common:"子午皆火星",verse:"子铃午火(安身主诀逐字)"}),u("mingzhuSchool","命主取法:命宫地支 / 生年年支","命主取法","soul-branch","year-branch",{"soul-branch":"命宫地支(通行本)","year-branch":"生年年支(中州派)"}),u("zuoyaoSchool","杂曜:49 颗简盘 / 61 颗全表","杂曜全表","minimal","full",{minimal:"49 颗(简盘)",full:"61 颗(加十二颗杂曜)"}),u("liunianSihua","流年四化取干:流年天干 / 流年命宫宫干","流年四化取干","year-stem","life-palace-stem",{"year-stem":"流年天干","life-palace-stem":"流年命宫宫干"}),u("sihuaVariant","十干四化:通行表 / 变体整表替换","十干四化变体","default","廉破曲阳",{default:"各干通行表",廉破曲阳:"甲干 廉破曲阳",贪阴阳机:"戊干 贪阴阳机",阳武同阴:"庚干 阳武同阴",阳武府同:"庚干 阳武府同",阳武府相:"庚干 阳武府相",阳武同相:"庚干 阳武同相",巨阳武昌:"辛干 巨阳武昌",梁紫府武:"壬干 梁紫府武",梁紫相武:"壬干 梁紫相武",破巨阳贪:"癸干 破巨阳贪"}),u("jieluSchool","截路空亡:照常 / 不排(中州派)","截路空亡","off","zhongzhou",{off:"照常(截空/副截/旬空/副旬)",zhongzhou:"不排(中州派)"}),u("suipoSchool","岁前十二神:照常 / 大耗改岁破(中州派)","岁前十二神","off","zhongzhou",{off:"照常(大耗)",zhongzhou:"大耗改岁破"})],qimen:[{key:"juMethod",title:"取局流派:拆补 / 超神接气 / 置闰",short:"取局流派",read:o=>["chaibu","chaoshen","zhirun"].includes(o.juMethod)?o.juMethod:"chaibu",alt:o=>o==="chaibu"?"zhirun":"chaibu",label:o=>({chaibu:"拆补法",chaoshen:"超神接气",zhirun:"置闰法"})[o]||o},{key:"lateZiHourMode",title:"晚子时:23:00 后归当日 / 次日",short:"晚子时归日",read:o=>o.lateZiHourMode==="next-day"?"next-day":"same-day",alt:o=>o==="next-day"?"same-day":"next-day",label:o=>o==="next-day"?"归次日":"归当日"}]},M={bazi:[{path:"pillars.day.ganzhi",label:"日柱"},{path:"pillars.hour.ganzhi",label:"时柱"},{path:"strength.level",label:"旺衰"},{path:"frame.primaryName",label:"格局"},{path:"frame.yongshen.favor",label:"喜用"},{path:"dayun.jiao.at",label:"起运"}],ziwei:[{path:"soul.ganzhi",label:"命宫"},{path:"body.branch",label:"身宫支"},{path:"bureau.name",label:"五行局"},{path:"bodyMaster",label:"身主"},{path:"daxianList.0.ages",label:"起大限"}],qimen:[{path:"siZhu.day",label:"日柱"},{path:"ju",label:"局数"},{path:"zhiFu.star",label:"值符"},{path:"zhiShi.gate",label:"值使"}]};function x(o,d){let h=o;for(const g of String(d).split(".")){if(h==null)return;h=h[g]}return h}function $(o){return o==null?"—":Array.isArray(o)?o.join("、"):typeof o=="object"?"—":String(o)}function w(o,d,h){return(M[o]||[]).map(N=>{const _=$(x(d,N.path)),O=$(x(h,N.path));return{key:N.path,label:N.label,current:_,alt:O,changed:_!==O}})}return{diffObjects:W,labelOf:P,categoryOf:z,rootOf:b,sortDiffs:y,summarize:L,formatValue:T,renderDiff:s,CALIBER_SWITCHES:c,CALIBER_VIEWS:M,viewCell:$,viewRows:w}})(),D.fingerprint=(function(){const Y="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function K(q){return JSON.stringify(Q(q))}function Q(q){if(q===null)return null;const A=typeof q;if(A==="string")return typeof q.normalize=="function"?q.normalize("NFC"):q;if(A==="number")return Number.isFinite(q)?Object.is(q,-0)?0:q:null;if(A==="boolean")return q;if(Array.isArray(q))return q.map(Q);if(A==="object"){const P=Object.create(null);for(const z of Object.keys(q).sort()){const b=q[z];b===void 0||typeof b=="function"||typeof b=="symbol"||(P[z]=Q(b))}return P}return null}function W(q){const A=String(q);let P=2166136261,z=2654435769;for(let L=0;L<A.length;L+=1){const T=A.charCodeAt(L);for(const s of[T&255,T>>>8])P=Math.imul(P^s,16777619),z=Math.imul(z^s,2246822507)}let b=(P>>>0)*8+(z>>>29),y="";for(let L=0;L<7;L+=1)y=Y[b%32]+y,b=Math.floor(b/32);return y}function B(q={}){const A=String(q.system||""),P=String(q.version||"dev"),z=q.seed===void 0||q.seed===null||q.seed===""?null:Number(q.seed),b=q.asOf?String(q.asOf):null,y=q.params&&typeof q.params=="object"?q.params:{},L=K({system:A,params:y,seed:z,asOf:b}),T=K({base:L,version:P});return{id:`LY-${W(T)}`,baseId:`LY-${W(L)}`,version:P,system:A,payload:L}}return{canonicalJson:K,shortHash:W,fingerprintOf:B}})(),D.validate=(function(){const{fail:Y}=D.fail||{},K=1600,Q=2400;function W(y){return y%4===0&&y%100!==0||y%400===0}function B(y,L){return L===2?W(y)?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][L-1]||0}const q=y=>typeof y=="string"?`「${y}」`:String(y),A="引擎只接受解析好的公历字段 { year, month, day, hour?, minute? };字符串请先交给宿主层的 parseDateTime 解析";function P(y,L=""){const T=L?`${L} 的`:"";if(!y||typeof y!="object"||Array.isArray(y)){const M=y===null?"null":Array.isArray(y)?"数组":typeof y;throw Y("E_INPUT",`${T}入参必须是对象(收到 ${M});${A}`)}const s=y.hour===void 0?0:y.hour,u=y.minute===void 0?0:y.minute;for(const[M,x]of[["year",y.year],["month",y.month],["day",y.day],["hour",s],["minute",u]])if(!Number.isInteger(x))throw Y("E_INPUT",`${T}${M} 必须是整数(收到 ${q(x)});${A}`);if(y.year<K||y.year>Q)throw Y("E_INPUT",`${T}year 超出支持范围 ${K}–${Q}(收到 ${y.year});更早的年份时区与历法口径不可靠`);if(y.month<1||y.month>12)throw Y("E_INPUT",`${T}month 超出范围 1–12(收到 ${y.month})`);const c=B(y.year,y.month);if(y.day<1||y.day>c)throw Y("E_INPUT",`${T}日期不存在:${y.year}-${y.month}-${y.day}(${y.year} 年 ${y.month} 月只有 ${c} 天)`);if(s<0||s>23)throw Y("E_INPUT",`${T}hour 超出范围 0–23(收到 ${s})`);if(u<0||u>59)throw Y("E_INPUT",`${T}minute 超出范围 0–59(收到 ${u})`);return y}function z(y,L,T){if(!y||typeof y!="object"||Array.isArray(y)){const s=y===null?"null":y===void 0?"undefined":Array.isArray(y)?"数组":typeof y;throw Y("E_INPUT",`${L} 必须是对象(收到 ${s});${T}`)}return y}function b(y,L=""){const T=L?`${L}:`:"";if(y.year<K||y.year>Q)throw Y("E_RANGE",`${T}晚子时按次日归后落到 ${y.year}-${String(y.month).padStart(2,"0")}-${String(y.day).padStart(2,"0")},超出可计算范围 ${K}–${Q};请把时刻挪到 23 点前,或换一天起课`);return y}return{MIN_YEAR:K,MAX_YEAR:Q,isLeapYear:W,daysInMonth:B,assertCivil:P,assertObject:z,assertShifted:b}})(),D.datetime=(function(){const{fail:Y}=D.fail||{},{MIN_YEAR:K,MAX_YEAR:Q}=D.validate||{};function W(A,P){return P===2?A%4===0&&A%100!==0||A%400===0?29:28:[31,28,31,30,31,30,31,31,30,31,30,31][P-1]}function B(A,P=""){const z=String(A??"").trim(),b=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(z);if(!b)return null;const y=Number(b[1]),L=Number(b[2]),T=Number(b[3]);if(L<1||L>12||T<1||T>W(y,L))return null;if(y<K||y>Q){const s=P?`${P} `:"";throw Y("E_RANGE",`${s}「${b[0]}」的年份超出可计算范围(${K}–${Q},收到 ${y} 年);农历与节气表不覆盖之外的年份`)}return{year:y,month:L,day:T}}function q(A){if(typeof A!="string"||!A.trim())throw Y("E_INPUT","缺少 datetime(公历日期时间),例如 1990-05-12T14:30");const P=A.trim().match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s](\d{1,2}):(\d{1,2})(?::(\d{1,2}))?)?$/);if(!P)throw Y("E_INPUT",`无法解析 datetime:「${A}」,请用 1990-05-12T14:30 这种格式`);if(P[6]!==void 0&&Number(P[6])>59)throw Y("E_INPUT",`秒超出范围:${P[6]}`);const z={year:Number(P[1]),month:Number(P[2]),day:Number(P[3]),hour:Number(P[4]??0),minute:Number(P[5]??0)};if(z.month<1||z.month>12)throw Y("E_INPUT",`月份超出范围:${z.month}`);const b=W(z.year,z.month);if(z.day<1||z.day>b)throw Y("E_INPUT",`日期不存在:${z.year}-${z.month}-${z.day}(${z.year} 年 ${z.month} 月只有 ${b} 天)`);if(z.hour>23||z.minute>59)throw Y("E_INPUT",`时间超出范围:${z.hour}:${z.minute}`);if(z.year<K||z.year>Q)throw Y("E_RANGE",`年份 ${z.year} 超出可计算范围(${K}–${Q})`);return(z.year<1900||z.year>2100)&&(z.precision={level:"approx",note:`ΔT 模型仅覆盖 1900–2100,${z.year} 年按端点值外推,节气与朔望时刻可能有分钟级偏差,月柱在交节前后需复核`}),z}return{daysInMonth:W,parseYmd:B,parseDateTime:q}})(),D.lru=(function(){function Y({max:K=64,ttlMs:Q=0,name:W="lru",now:B=()=>Date.now()}={}){const q=new Map,A={name:W,hits:0,misses:0,evictions:0,expirations:0},P=z=>Q>0&&B()-z.at>Q;return{name:W,max:K,ttlMs:Q,get(z){const b=q.get(z);if(!b||P(b)){b&&(q.delete(z),A.expirations+=1),A.misses+=1;return}return q.delete(z),q.set(z,b),A.hits+=1,b.value},set(z,b){for(q.has(z)&&q.delete(z),q.set(z,{value:b,at:B()});q.size>K;)q.delete(q.keys().next().value),A.evictions+=1;return b},has(z){const b=q.get(z);return b?P(b)?(q.delete(z),A.expirations+=1,!1):!0:!1},delete(z){return q.delete(z)},clear(){q.clear()},get size(){return q.size},stats(){const z=A.hits+A.misses;return{name:W,size:q.size,max:K,hits:A.hits,misses:A.misses,evictions:A.evictions,expirations:A.expirations,hitRate:z?A.hits/z:0}}}}return{createLru:Y}})(),D.nayin=(function(){const Y=["海中金","炉中火","大林木","路旁土","剑锋金","山头火","涧下水","城头土","白蜡金","杨柳木","泉中水","屋上土","霹雳火","松柏木","长流水","沙中金","山下火","平地木","壁上土","金箔金","覆灯火","天河水","大驿土","钗钏金","桑柘木","大溪水","沙中土","天上火","石榴木","大海水"];function K(Q){const W=(Number(Q)%60+60)%60,B=Y[Math.floor(W/2)];return{name:B,element:B[2]}}return{NAYIN_NAMES:Y,nayinOf:K}})(),D.sanhe=(function(){const Y=[{branches:["申","子","辰"],element:"水"},{branches:["亥","卯","未"],element:"木"},{branches:["寅","午","戌"],element:"火"},{branches:["巳","酉","丑"],element:"金"}],K=Object.fromEntries(Y.map(B=>[B.branches.join(""),B.element])),Q=Object.fromEntries(Y.flatMap(B=>B.branches.map(q=>[q,B.element])));function W(B){return Y.find(q=>q.branches.includes(B))||null}return{SANHE_GROUPS:Y,SANHE:K,SANHE_ELEMENT:Q,sanheGroupOf:W}})(),D["vsop-earth"]=(function(){const Y=[[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]],K=[[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]],Q=[[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]],W=[[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]],B=[[7714e-11,4.14117321449,6283.0758499914],[1016e-11,3.27573644241,12566.1516999828]];function q(A){let P=0;for(const[b,y,L]of Y)P+=b*Math.cos(y+L*A);let z=1;for(const b of[K,Q,W,B]){z*=A;for(const[y,L,T]of b)P+=y*z*Math.cos(L+T*A)}return P}return{earthL:q}})(),D.calendar=(function(){const{earthL:Y}=D["vsop-earth"]||{},{createLru:K}=D.lru||{},{bool:Q}=D.bool||{},W=["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],B=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],q=["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"];function A(f){return(285+15*f)%360}function P(f,S,k){const R=Math.floor((14-S)/12),H=f+4800-R,U=S+12*R-3;return k+Math.floor((153*U+2)/5)+365*H+Math.floor(H/4)-Math.floor(H/100)+Math.floor(H/400)-32045}function z(f){const S=f+32044,k=Math.floor((4*S+3)/146097),R=S-Math.floor(146097*k/4),H=Math.floor((4*R+3)/1461),U=R-Math.floor(1461*H/4),te=Math.floor((5*U+2)/153);return{year:100*k+H-4800+Math.floor(te/10),month:te+3-12*Math.floor(te/10),day:U-Math.floor((153*te+2)/5)+1}}function b(f,S){for(let k=0;k<60;k++)if(k%10===f&&k%12===S)return k;return-1}function y(f){const S=(f%60+60)%60;return{index:S,stem:W[S%10],branch:B[S%12],name:W[S%10]+B[S%12]}}function L(f){return((f+49)%60+60)%60}function T(f){const S=f-2451545,k=S/36525,R=S/365250;let H=Y(R)*180/Math.PI+180;H=(H%360+360)%360;const U=(5029.0966*k+1.11113*k*k-6e-6*k*k*k)/3600;H+=U,H-=.09033/3600;const te=(125.04452-1934.136261*k)*Math.PI/180,re=(280.4665+36000.7698*k)*Math.PI/180,Z=(218.3165+481267.8813*k)*Math.PI/180,le=(-17.2*Math.sin(te)-1.32*Math.sin(2*re)-.23*Math.sin(2*Z)+.21*Math.sin(2*te))/3600;H+=le;const ue=(357.52911+35999.05029*k-1537e-7*k*k)*Math.PI/180,fe=.016708634-42037e-9*k-1267e-10*k*k,pe=1.000001018*(1-fe*fe)/(1+fe*Math.cos(ue+(1.914602-.004817*k)*(Math.PI/180)*Math.sin(ue)));return H-=20.4898/3600/(pe||1),(H%360+360)%360}function s(f){if(f<1900){const te=f;if(te<1600)return 120;if(te<1700){const Z=te-1600;return 120-.9808*Z-.01532*Z*Z+Z*Z*Z/7129}if(te<1800){const Z=te-1700;return 8.83+.1603*Z-.0059285*Z*Z+13336e-8*Z*Z*Z-Z**4/1174e3}if(te<1860){const Z=te-1800;return 13.72-.332447*Z+.0068612*Z*Z+.0041116*Z**3-37436e-8*Z**4+121272e-10*Z**5-1699e-10*Z**6+875e-12*Z**7}const re=te-1860;return 7.62+.5737*re-.251754*re*re+.01680668*re**3-.0004473624*re**4+re**5/233174}const S=[[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(f<=S[0][0])return S[0][1];for(let te=1;te<S.length;te++)if(f<=S[te][0]){const[re,Z]=S[te-1],[le,ue]=S[te];return Z+(ue-Z)*(f-re)/(le-re)}const[k,R]=S[S.length-1],H=(k-1820)/100,U=(f-1820)/100;return R+32*(U*U-H*H)}const u=8/24,c=7.7611/24,M=2425612+4/24;function x(f){return f<M?c:u}const $=K({max:4096,name:"termInstant"}),w=1e-5,o=new Map,d=365.2422;function h(f,S){const k=A(S),R=P(f,1,5)-.5+S*15.2184,H=o.get(S);let U=H!==void 0?H+d:R;Math.abs(U-R)>20&&(U=R);for(let re=0;re<12;re++){let Z=k-T(U);if(Z=((Z+180)%360+360)%360-180,U+=Z/.98564736,Math.abs(Z)<w)break}o.set(S,U);const te=U-s(f)/86400;return te+x(te)}function g(f,S){const k=f*24+S,R=$.get(k);if(R!==void 0)return R;const H=h(f,S);return $.set(k,H),H}function N(f){const S=Math.floor(f+.5),k=f+.5-S,R=Math.min(1439,Math.floor(Math.round(k*86400)/60)),{year:H,month:U,day:te}=z(S);return{year:H,month:U,day:te,hour:Math.floor(R/60),minute:R%60}}function _({year:f,month:S,day:k,hour:R=0,minute:H=0}){return P(f,S,k)-.5+(R*60+H)/1440}function O(f,S,k){const R=Math.PI/180,H=P(f,S,k)-.5,U=(H-2451545)/36525,te=(H-2451545)/365250,re=23.439291111-.0130041667*U-16389e-11*U*U+50361e-11*U*U*U,Z=(125.04452-1934.136261*U)*R,le=-17.2*Math.sin(Z)/3600,ue=(Y(te)*180/Math.PI+180)%360,fe=(5029.0966*U+1.11113*U*U-6e-6*U*U*U)/3600,ee=((ue+fe+le-20.4898/3600)%360+360)%360*R,me=re*R,ve=Math.atan2(Math.cos(me)*Math.sin(ee),Math.cos(ee))/R;let qe=280.46646+36000.76983*U+3032e-7*U*U-ve;return qe=(qe%360+540)%360-180,qe*4}const J=K({max:8,name:"termWindow"}),se=K({max:32,name:"termYear"}),F=Array.from({length:24},(f,S)=>S),be=F.filter(f=>f%2===0);function we(f,S){const k=S?`${f}|jie`:`${f}|all`,R=se.get(k);if(R)return R;if(S){const U=se.get(`${f}|all`);if(U){const te=U.filter(re=>re.index%2===0);return se.set(k,te),te}}const H=[];for(const U of S?be:F)H.push({year:f,index:U,name:q[U],jd:g(f,U)});return H.sort((U,te)=>U.jd-te.jd),se.set(k,H),H}function je(f,S={}){const k=Q(S.jieOnly),R=k?`${f}|jie`:f,H=J.get(R);if(H)return H;const U=[...we(f-1,k),...we(f,k),...we(f+1,k)];return U.sort((te,re)=>te.jd-re.jd),J.set(R,U),U}function oe(f){if(typeof f!="string"||f.length<2)return[];const S=W.indexOf(f[0]),k=B.indexOf(f[1]);if(S<0||k<0)return[];const R=b(S,k);if(R<0)return[];const H=Math.floor(R/10)*10;return[B[(H+10)%12],B[(H+11)%12]]}function i(f,S){let k=null;for(const R of f)if(R.index%2===0)if(R.jd<=S)k=R;else break;return k}function m(f,S){for(const k of f)if(k.index%2===0&&k.jd>S)return k;return null}function C(f){const S=N(f),k=R=>String(R).padStart(2,"0");return`${S.year}-${k(S.month)}-${k(S.day)} ${k(S.hour)}:${k(S.minute)}`}function v(){return[$.stats(),se.stats(),J.stats()]}return{STEMS:W,BRANCHES:B,TERM_NAMES:q,termLongitude:A,toJDN:P,fromJDN:z,sexagenaryIndex:b,ganzhiName:y,dayGanzhiIndex:L,sunLongitude:T,deltaTSeconds:s,OFFSET_MODERN:u,OFFSET_BEIJING_LOCAL:c,CUTOVER_JD:M,localOffsetFor:x,termInstantJd:g,jdToParts:N,partsToJd:_,equationOfTime:O,termWindow:je,xunKongOf:oe,previousJie:i,nextJie:m,formatJd:C,cacheMetrics:v}})(),D.lunar=(function(){const{toJDN:Y,jdToParts:K,termInstantJd:Q,deltaTSeconds:W,localOffsetFor:B}=D.calendar||{},q=29.530588861,A=245155009766e-5,P=Math.PI/180;function z(s){const u=s/1236.85,c=A+q*s+15437e-8*u*u-15e-8*u*u*u+73e-11*u*u*u*u,M=1-.002516*u-74e-7*u*u,x=(2.5534+29.1053567*s-14e-7*u*u-11e-8*u*u*u)*P,$=(201.5643+385.81693528*s+.0107582*u*u+1238e-8*u*u*u-58e-9*u*u*u*u)*P,w=(160.7108+390.67050284*s-.0016118*u*u-227e-8*u*u*u+11e-9*u*u*u*u)*P,o=(124.7746-1.56375588*s+.0020672*u*u+215e-8*u*u*u)*P,d=-.4072*Math.sin($)+.17241*M*Math.sin(x)+.01608*Math.sin(2*$)+.01039*Math.sin(2*w)+.00739*M*Math.sin($-x)-.00514*M*Math.sin($+x)+.00208*M*M*Math.sin(2*x)-.00111*Math.sin($-2*w)-57e-5*Math.sin($+2*w)+56e-5*M*Math.sin(2*$+x)-42e-5*Math.sin(3*$)+42e-5*M*Math.sin(x+2*w)+38e-5*M*Math.sin(x-2*w)-24e-5*M*Math.sin(2*$-x)-17e-5*Math.sin(o)-7e-5*Math.sin($+2*x)+4e-5*Math.sin(2*$-2*w)+4e-5*Math.sin(3*x)+3e-5*Math.sin($+x-2*w)+3e-5*Math.sin(2*$+2*w)-3e-5*Math.sin($+x+2*w)+3e-5*Math.sin($-x+2*w)-2e-5*Math.sin($-x-2*w)-2e-5*Math.sin(3*$+x)+2e-5*Math.sin(4*$),h=c+d-W(2e3+u*100)/86400;return h+B(h)}function b(s){return Math.floor(s+.5)}function y(s){return Math.round((s+.5-A)/q)}function L(s,u,c){for(let M=s-1;M<=s+1;M++)for(let x=1;x<24;x+=2){const $=Q(M,x),w=b($);if(w>=u&&w<c)return{index:x,jd:$}}return null}function T(s,u,c){const M=Y(s,u,c),x=b(Q(s,23)),$=M<x?s-1:s,w=b(Q($,23));let o=y(w);for(;b(z(o))>w;)o--;for(;b(z(o+1))<=w;)o++;const d=b(Q($+1,23));let h=o;for(;b(z(h+1))<=d;)h++;const g=h-o;let N=-1;if(g===13)for(let J=1;J<=g;J++){const se=b(z(o+J-1)),F=b(z(o+J));if(!L($,se,F)){N=J;break}}let _=11,O=!1;for(let J=1;J<=15;J++){const se=b(z(o+J-1)),F=b(z(o+J)),be=L($,se,F),we=J===N;if(M>=se&&M<F){const je=K(z(o+J-1)),oe=we?(_+10)%12+1:_;return{year:$,lunarYear:O?$+1:$,month:oe,day:M-se+1,isLeap:we,monthStart:`${je.year}-${String(je.month).padStart(2,"0")}-${String(je.day).padStart(2,"0")}`,hasZhongQi:!!be}}we||(_=_%12+1,_===1&&(O=!0))}throw new Error(`农历换算失败:${s}-${u}-${c}`)}return{SYNODIC:q,newMoonJd:z,dayNumberOf:b,solarToLunar:T}})(),D.geo=(function(){const{bool:Y}=D.bool||{},K=`
4
4
  北京 116.41 39.90;上海 121.47 31.23;天津 117.20 39.13;重庆 106.55 29.56
5
5
  广州 113.26 23.13;深圳 114.06 22.55;珠海 113.58 22.27;东莞 113.75 23.02;佛山 113.12 23.02
6
6
  汕头 116.68 23.35;中山 113.39 22.52;惠州 114.42 23.11;江门 113.08 22.58;湛江 110.36 21.27
@@ -67,88 +67,88 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",chunk:"client.wuyunliuqi.js",
67
67
  贵港 109.60 23.11;贺州 111.57 24.40;来宾 109.23 23.75;崇左 107.36 22.40
68
68
  海口 110.20 20.04;三亚 109.51 18.25;儋州 109.58 19.52;琼海 110.47 19.26
69
69
  香港 114.17 22.32;澳门 113.55 22.20;台北 121.52 25.03;高雄 120.31 22.63;台中 120.68 24.14
70
- `,W={河北:"石家庄",山西:"太原",内蒙古:"呼和浩特",辽宁:"沈阳",吉林:"长春",黑龙江:"哈尔滨",江苏:"南京",浙江:"杭州",安徽:"合肥",福建:"福州",江西:"南昌",山东:"济南",河南:"郑州",湖北:"武汉",湖南:"长沙",广东:"广州",广西:"南宁",海南:"海口",四川:"成都",贵州:"贵阳",云南:"昆明",西藏:"拉萨",陕西:"西安",甘肃:"兰州",青海:"西宁",宁夏:"银川",新疆:"乌鲁木齐",台湾:"台北"},K={石家庄:[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]},F=(()=>{const T={};for(const s of J.trim().split(`
71
- `))for(const u of s.split(";")){const l=u.trim().split(/\s+/);if(l.length!==3)continue;const[O,x,$]=l;T[O]={lon:Number(x),lat:Number($)}}for(const[s,[u,l]]of Object.entries(K))T[s]||(T[s]={lon:u,lat:l});return T})(),q=/[省区路街道巷弄号村镇乡组队]/,A={中山区:{city:"大连"},朝阳区:{city:"北京",byProvince:{吉林:"长春",辽宁:"朝阳"}}};function P(T){const s=String(T||"").trim();if(!s)return null;const u=Number(s);if(Number.isFinite(u)&&/^-?\d+(\.\d+)?$/.test(s)&&u>=60&&u<=150)return{lon:u,lat:null,matched:`${u}°E`,level:"经度",note:"按你输入的经度计算"};const l=s.replace(/\s/g,""),O=Object.keys(F).sort((w,o)=>o.length-w.length),x=[];for(const w of O)for(let o=l.indexOf(w);o>=0;o=l.indexOf(w,o+w.length)){const d=l.charAt(o+w.length);q.test(d)||x.push({name:w,at:o,after:d,explicit:d==="市"?1:0})}if(x.sort((w,o)=>o.explicit-w.explicit||w.at-o.at),x.length){const w=x[0],o=F[w.name];return w.after==="县"?{lon:o.lon,lat:o.lat,matched:`${w.name}县`,level:"区县",note:`「${w.name}县」按 ${w.name} 城区估算(约 ${o.lon}°E)`}:{lon:o.lon,lat:o.lat,matched:w.name,level:"地级市",note:`按 ${w.name} 估算(约 ${o.lon}°E)`}}for(const[w,o]of Object.entries(A)){if(!l.includes(w))continue;let d=o.city;for(const[g,N]of Object.entries(o.byProvince||{}))if(l.includes(g)){d=N;break}const h=F[d];if(h)return{lon:h.lon,lat:h.lat,matched:d,level:"区县",note:`「${w}」按 ${d} 估算(约 ${h.lon}°E)`}}const $=O.find(w=>l.includes(`${w}路`)||l.includes(`${w}街`));if($)return{lon:null,lat:null,matched:null,level:"未匹配",note:`「${$}路」是全国常见的路名,无法确定城市;请补上城市(如「厦门市${$}路」)或直接填经度`};for(const[w,o]of Object.entries(W)){const d=l.indexOf(w);if(d<0)continue;const h=l.charAt(d+w.length);if(h==="区"||h==="县")continue;const g=F[o]||{lon:K[o][0],lat:K[o][1]};return{lon:g.lon,lat:g.lat,matched:o,level:"省会",note:`未匹配到具体城市,按 ${w} 省会 ${o} 估算(约 ${g.lon}°E)`}}return{lon:null,lat:null,matched:null,level:"未匹配",note:`没查到「${s}」,可改填经度(如 116.4)`}}const z=/(区|县|镇|乡|村|小区|街道|路|号|巷|弄|组|队)/,b="dsh-metaphysics (+https://github.com/xuanfu-web/dsh-metaphysics)";async function y(T,{timeoutMs:s=2500}={}){if(typeof fetch!="function")return null;let u=null;try{const l=typeof AbortController=="function"?new AbortController:null;l&&(u=setTimeout(()=>l.abort(),s));const O="https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&accept-language=zh-CN&countrycodes=cn&q="+encodeURIComponent(T),x=await fetch(O,{signal:l?l.signal:void 0,headers:{"User-Agent":b}});if(!x||!x.ok)return null;const $=await x.json();if(!Array.isArray($)||$.length===0)return null;const w=$[0],o=Number(w.lon),d=Number(w.lat);return Number.isFinite(o)?{lon:o,lat:d,matched:w.display_name,level:"在线",note:`在线解析:${w.display_name}`}:null}catch{return null}finally{u&&clearTimeout(u)}}async function L(T,s={}){const u=P(T),l=String(T||"").trim();if(!l||!R(s.online)||u&&typeof u.lon=="number"&&!z.test(l))return u;const x=await y(l,s);return x?{...x,local:u&&u.lon!=null?u:null}:u&&typeof u.lon=="number"?{...u,onlineFailed:!0,note:`${u.note}(联网解析失败或超时,已退回内置坐标表)`}:{...u,onlineFailed:!0}}return{CITIES:F,PROVINCES:W,resolveAddress:P,geocodeAddress:L}})(),D.random=(function(){function R(A){const P=Number(A),z=P>>>0,b=Math.floor(Math.abs(P)/4294967296)>>>0,y=Math.round((P-Math.trunc(P))*4294967296)>>>0;let L=(z^Math.imul(b+1,2246822507)^y)>>>0;return L||(L=2654435769),function(){L=L+1831565813>>>0;let s=L;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}function J(){const A=globalThis.crypto;if(!A||typeof A.getRandomValues!="function")return Math.random;const P=128,z=new Uint32Array(P);let b=P;const y=()=>(b>=P&&(A.getRandomValues(z),b=0),z[b++]/4294967296);return y.source="crypto",y}const W=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/,K=A=>{if(typeof A=="number")return Number.isFinite(A)?A:NaN;if(typeof A=="string"){const P=A.trim();if(P!==""&&W.test(P))return Number(P)}return NaN};function F(A){if(A==null||A==="")return J();const P=K(A);return Number.isFinite(P)?R(P):J()}function q(A){return A==null||A===""?!0:Number.isFinite(K(A))}return{mulberry32:R,randomOf:F,isSeed:q}})(),D.dst=(function(){const{daysInMonth:R}=D.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"]},W=(A,P,z)=>A*1e4+P*100+z;function K(A){const P=J[A.year];if(!P)return!1;const[z,b,y]=P[0].split("-").map(Number),[L,T,s]=P[1].split("-").map(Number),u=W(A.year,A.month,A.day);if(u<W(z,b,y)||u>W(L,T,s))return!1;const l=A.hour*60+(A.minute||0);return!(u===W(z,b,y)&&l<120||u===W(L,T,s)&&l>=120)}function F(A){const P=J[A.year];if(!P)return null;const[z,b,y]=P[0].split("-").map(Number),[L,T,s]=P[1].split("-").map(Number),u=W(A.year,A.month,A.day),l=A.hour*60+(A.minute||0);return u===W(z,b,y)&&l>=120&&l<180?"gap":u===W(L,T,s)&&l>=60&&l<120?"twice":null}function q(A){const P=A.minute||0;if(!K(A))return{year:A.year,month:A.month,day:A.day,hour:A.hour,minute:P,applied:!1,note:null};let{year:z,month:b,day:y,hour:L}=A;L-=1,L<0&&(L+=24,y-=1,y<1&&(b-=1,b<1&&(b=12,z-=1),y=R(z,b)));const T=F(A);return{year:z,month:b,day:y,hour:L,minute:P,applied:!0,note:`检出自 ${J[A.year][0]} 至 ${J[A.year][1]} 的中国夏令时:出生钟面时间已减 1 小时校正`+(T==="gap"?";这一天 02:00–03:00 钟表直接跳过,所给钟面时间在当年并不存在——这里按「拨快后的读数」回退一小时,若登记的本是标准时间,请传 dst:false 重排。":T==="twice"?";这一天 01:00–02:00 因回拨走了两遍,同一钟面时间对应两个真实时刻——这里按夏令时的那一遍(回退一小时)取。":"")}}return{DST_SPANS:J,inDstSpan:K,dstAmbiguity:F,applyDst:q}})(),D.classics=(function(){const R={ziping:{name:"子平真诠",author:"清·沈孝瞻",base:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/"},ditian:{name:"滴天髓",author:"明·京图(通行本)",base:"https://www.diancang.xyz/xuanxuewushu/ditiansui/"},sanming:{name:"三命通会",author:"明·万民英",base:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/"}},J=[{id:"zp-yongshen",book:"ziping",chapter:"八、论用神",scene:"用神",tags:[],quote:"八字用神,专求月令,以日干配月令地支,而生克不同,格局分焉。财官印食,此用神之善而顺用之者也;煞伤劫刃,用神之不善而逆用之者也。",plain:"用神从月令里找:财、官、印、食四吉神顺用(生之护之),煞、伤、劫、刃四凶神逆用(制之化之)。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53628.html"},{id:"zp-zhenguan",book:"ziping",chapter:"三十一、论正官",scene:"格局",tags:["正官"],quote:"以刑冲破害为忌,则以生之护之为喜矣。存其喜而去其忌则贵,而贵之中又有高低者,何也?",plain:"正官格最忌刑冲破害,喜财生官、印护官;去忌存喜才谈得上贵,贵的层次还要看财印是否并透、有无伤官七煞混杂。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53651.html"},{id:"zp-cai",book:"ziping",chapter:"三十三、论财",scene:"格局",tags:["财","正财","偏财"],quote:"财为我克,使用之物也,以能生官,所以为美。为财帛,为妻妾,为才能,为驿马,皆财类也。",plain:"财是我所克、能为我用之物,因能生官而美;它同时代表钱财、配偶、才能、走动,不只「钱」一项。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53653.html"},{id:"zp-yin",book:"ziping",chapter:"三十五、论印绶",scene:"格局",tags:["印"],quote:"印绶喜其生身,正偏同为美格,故财与印不分偏正,同为一格而论之。",plain:"印能生身,正印偏印都算美格,不分偏正而论;印格的关键在身印强弱与官杀、食伤、财的配合。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53655.html"},{id:"zp-shishen",book:"ziping",chapter:"三十七、论食神",scene:"格局",tags:["食神"],quote:"食神本属泄气,以其能生正财,所以喜之。故食神生财,美格也。财要有根,不必偏正叠出,如身强食旺而财透,大贵之格。",plain:"食神本是泄气,可贵在能生财;食神生财要财有根,身强、食旺、财透三者齐,格局才大。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53657.html"},{id:"zp-pianguan",book:"ziping",chapter:"三十九、论偏官",scene:"格局",tags:["七杀","偏官"],quote:"煞以攻身,似非美物,百大贵之格,多存七煞。盖控制得宜,煞为我用,如大英雄大豪杰,似难驾驭,而处之有方,则惊天动地之功,忽焉而就。",plain:"七煞攻身,看着不美,但大贵之格多有七煞——能控制住就为我所用,像驾驭豪杰,处之有方就能成大事。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53659.html"},{id:"zp-shangguan",book:"ziping",chapter:"四十一、论伤官",scene:"格局",tags:["伤官"],quote:"伤官虽非吉神,实为秀气,故文人学士,多于伤官格内得之。而夏木见水,冬金见火,则又为秀之尤秀者也。",plain:"伤官不是吉神,却是秀气所在,文人多出伤官格;夏木得水、冬金得火,是秀气里更秀的两种。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53661.html"},{id:"zp-yangren",book:"ziping",chapter:"四十三、论阳刃",scene:"格局",tags:["劫财","阳刃"],quote:"阳刃者,劫我正财之神,乃正财之七煞也。禄前一位,惟五阳有之,故为阳刃。不曰劫而曰刃,劫之甚也。刃宜伏制,官煞皆宜,财印相随,尤为贵显。",verifiedQuote:"阳刃者,劫我正财之神,乃正财之七煞也。禄前一位,惟五阳有之",variantNote:"典藏网此页把「故为阳刃」刻作「故为旭刃」,与通行本异文;前段仍可逐字核验",plain:"阳刃是劫财之极(只有五阳干有),宜用官煞制伏;财印相随而不相碍,格局更显。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53663.html"},{id:"zp-lujie",book:"ziping",chapter:"四十五、论建禄月劫",scene:"格局",tags:["比肩","建禄","月劫"],quote:"故建禄与月劫,可同一格,不必加分,皆以透干支,别取财官煞食为用。",plain:"建禄、月劫同看一格,月令本身不算用神,要另看透出的财官煞食取用。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53665.html"},{id:"zp-qihou",book:"ziping",chapter:"十四、论用神配气候得失",scene:"调候",tags:[],quote:"论命惟以月令用神为主,然亦须配气候而互参之。譬如英雄豪杰,生得其时,自然事半功倍;遭时不顺,虽有奇才,成功不易。",plain:"月令用神为主,但必须配气候参看;同样的格局,生在得时的气候里事半功倍,逆着气候就费劲。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53634.html"},{id:"zp-chengbai",book:"ziping",chapter:"九、论用神成败救应",scene:"格局",tags:[],quote:"成中有败,必是带忌;败中有成,全凭救应。",plain:"成格不等于一路顺:成中带忌(官逢财又逢伤、官被合之类)就打了折;败格也未必无救——印来解伤、合来清煞,败中还能转成。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53629.html"},{id:"zp-zaji",book:"ziping",chapter:"十六、论杂气如何取用",scene:"用神",tags:[],quote:"何谓透干?如甲生辰月,透戊则用偏财,透癸则用正印,透乙则用月劫是也。何谓会支?如甲生辰月,逢申与子会局,则用水印是也。一透则一用,兼透则兼用,透而又会,则透与会并用。",plain:"四墓(辰戌丑未)所藏不止一气,所以叫杂气:取用先看哪一藏干透到天干,透一个用一个;没有透干,再看地支有没有与月支会成三合局,会成什么局就取局中那一气。透干与会支同时成立时两样并用。原文对「兼透」只给原则,没有给取舍次序。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53636.html"},{id:"zp-bianhua",book:"ziping",chapter:"十、论用神变化",scene:"格局",tags:[],quote:"故若丁生亥月,本为正官,支全卯未,则化为印。己生申月,本属伤官。藏庚透壬,则化为财。凡此之类皆用神之变化也。",plain:"用神本从月令取,但月令藏干不一:丁生亥月本为正官,支会卯未就化为印;己生申月本属伤官,庚藏壬透就化为财。起点相同,合化一变,取用也跟着变(原文只说变化之由,不断定某盘必化)。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53630.html"},{id:"dt-hannuan",book:"ditian",chapter:"通神论·寒暖",scene:"调候",tags:[],quote:"天道有寒暖,生育万物,人道行之,不可过也。",plain:"天有寒暖才能生养万物,人命里寒暖也不能过——过寒过热都要调。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-zaoshi",book:"ditian",chapter:"通神论·燥湿",scene:"调候",tags:[],quote:"地道有燥湿,生成品汇,人道得之,不可偏也。",plain:"地有燥湿才有品类生成,人命得燥湿之气也不能偏。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-shuaiwang",book:"ditian",chapter:"通神论·衰旺",scene:"调候",tags:[],quote:"能知旺衰之真机,其于三命之奥,思过半矣。",plain:"真正看懂旺衰的机关,命理之奥就过了一半——旺衰不是数个数,要看真机。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-zhonghe",book:"ditian",chapter:"通神论·中和",scene:"调候",tags:[],quote:"既识中和之正理,而于五行之妙,有全能焉。",plain:"懂得中和的道理,五行的妙处就都在其中了。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-guansha",book:"ditian",chapter:"通神论·官杀",scene:"十神",tags:["正官","七杀"],quote:"官杀混杂来问我,有可有不可。",plain:"官杀混杂不是一律不好,要看能不能去留取清。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-shangguan",book:"ditian",chapter:"通神论·伤官",scene:"十神",tags:["伤官"],quote:"伤官见官最难辨,可见不可见。",plain:"伤官见官是最难分辨的一条:有的能见,有的不能见,不能一句「伤官见官为祸百端」了事。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-yueling",book:"ditian",chapter:"通神论·月令",scene:"用神",tags:[],quote:"月令乃提纲之府,譬之宅也,人元为用事之神,宅之定向也,不可以不卜。",plain:"月令像宅子,藏干是用事之神,像宅子的朝向,必须细看。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-tiyong",book:"ditian",chapter:"通神论·体用",scene:"用神",tags:[],quote:"道有体用,不可以一端论也,要在扶之抑之得其宜。",plain:"体用不能只看一头,关键是扶抑得宜。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-jingshen",book:"ditian",chapter:"通神论·精神",scene:"用神",tags:[],quote:"人有精神,不可以一偏求也,要在损之益之得其中。",plain:"看精神不能偏执一端,要在损益之间求其中。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-tongguan",book:"ditian",chapter:"通神论·通关",scene:"用神",tags:[],quote:"关内有织女,关外有牛郎,此关若通也,相邀入洞房。",plain:"两股力隔着一道关相望:一边织女、一边牛郎,中间若有一行能把两边接上(一方生它、它再生另一方),对峙就化成相生。原文只给取象,哪一行为关要按五行生克定。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"smt-zhenguan",book:"sanming",chapter:"卷五·论正官",scene:"格局",tags:["正官"],quote:"正官者,乃甲见辛、乙见庚之例。阴阳配合,相制有用,成其道也。故正官为六格之首,止许一位,多则不宜。",plain:"正官取「克我而阴阳相配」,有制而能成用;六格以正官居首,只宜一位,多见就杂。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7582.html"},{id:"smt-zhengcai",book:"sanming",chapter:"卷六·论正财",scene:"格局",tags:["财","正财"],quote:"正财者,乃甲见己、乙见戊之例。受我克制,为我之妻,譬人娶妻,妻赍财嫁我,我必精神康强,而后可享用,若衰微不振,虽妻财丰厚,但能目视,终不得用。",plain:"正财是我克制之物,古人以「娶妻带财」作比:自身精神康强才受用得起,身弱不振,财再厚也只是看着。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7645.html"},{id:"smt-piancai",book:"sanming",chapter:"卷六·论偏财",scene:"格局",tags:["财","偏财"],quote:"何谓偏财?乃甲见戊、乙见己之例。非妻所带,乃众人之财也。切忌有姊妹兄弟分夺,柱无官星,祸患百出。",plain:"偏财取「我克而阴阳不同」:不是妻家带来的私财,而是众人之财,宜流通不宜独占。原文最忌比肩劫财来分夺,又说柱中无官星则多事(旧说的重话照录,本插件只记原文、不作断语)。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7650.html"},{id:"smt-yinshou",book:"sanming",chapter:"卷六·论印绶",scene:"格局",tags:["印"],quote:"印绶者,乃五行生我之名。如甲乙在亥子月,丙丁在寅卯月之类,乃我气之源,为生气,为父母,能护我官星,使无伤克",plain:"印是生我之气,像源头与父母:它能护住官星,使官不受伤克;反过来说,印重就怕财来破。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7655.html"},{id:"smt-shishen",book:"sanming",chapter:"卷六·论食神",scene:"格局",tags:["食神"],quote:"凡命遇财煞之地,食神旺相,煞被食制,不敢为祸,财被食生,充裕不竭,故食神一名寿星,一名爵星,良有以也。",plain:"食神旺,一头制煞、一头生财:煞被制住不敢为祸,财被生起不至枯竭;所以食神又叫寿星、爵星。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7663.html"},{id:"smt-shangguan",book:"sanming",chapter:"卷六·论伤官",scene:"格局",tags:["伤官"],quote:"伤官虽凶,乃我所生,自家之物,伤尽则能生财,财旺则能生官,造化展转有情。",plain:"伤官虽称凶,却是我自己生出来的:伤尽(柱中不见官星)反能生财,财旺再生官,辗转还是有情。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7662.html"},{id:"smt-yangren",book:"sanming",chapter:"卷六·论阳刃",scene:"格局",tags:["阳刃","劫财"],quote:"阳者,阴阳之阳,刃者,刀刃之刃,即禄前一位,言旺越其分,故险。",plain:"阳刃指禄前一位,旺过了本分,所以险;甲丙戊庚壬五阳干才有刃,阴干见伤官同论。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7671.html"},{id:"smt-jianlu",book:"sanming",chapter:"卷六·论建禄",scene:"格局",tags:["建禄","比肩","月劫"],quote:"凡命月令建禄,难招祖业,必主平生见财不聚,却病少寿长,行运再见比肩,克妻妨父损子",plain:"月令建禄是日主临官之地,身旺而财官难取:古说难承祖业、见财不聚,但病少寿长;再走比肩运,古书说克妻妨父损子(属于旧说的重话,本插件只记原文、不作断语)。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7672.html"},{id:"smt-guansha-liu",book:"sanming",chapter:"卷五·官煞去留杂论",scene:"格局",tags:["七杀","偏官"],quote:"凡看去留,要详柱中官煞孰重孰轻,天干透者易去,月支所藏者难去,须伤官食神去官煞之物众而有力,方才去得。",plain:"官煞混见时先比谁重谁轻:天干透出的容易去,月支藏着的难去;用来去官煞的伤官食神要成众、有根有力,才真去得掉。七杀格遇正官混杂,就按这一篇看取舍。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7599.html"},{id:"smt-quzhi",book:"sanming",chapter:"卷六·曲直",scene:"格局",tags:["曲直格","专旺"],quote:"甲乙日得亥卯未局,柱中须有亥字带印为入格,若无亥有卯,止是木之本气,却要见金土为贵,既无亥字,又无金土,则木不秀不实,难以言贵。",plain:"曲直格要木局成方(亥卯未)且带亥字为印,才算入格;只有卯、没有亥,只是木的本气,得另见金土才谈得上贵;两样都没有,木虽旺而无成,难称贵格。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7630.html"},{id:"smt-yanshang",book:"sanming",chapter:"卷六·炎上",scene:"格局",tags:["炎上格","专旺"],quote:"丙丁日遇寅午戌局,柱中须有寅字带印为入格,无寅止是九流近贵之命,若火自旺,无亥水相济,不贵。喜东北方运,忌见辰丑戊己,晦火光明,多主眼疾,或患风气,柱有木制成贵,忌水金乡,怕冲。",plain:"炎上格要火局成方(寅午戌)且带寅字为印才入格;无寅只是偏贵的命。火自旺还要一点水相济,过燥不贵;行运喜东北、忌湿土晦火,也怕冲。原文另带「多主眼疾」一句,属于旧说,本插件只记原文、不作健康判断。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7631.html"},{id:"smt-congge",book:"sanming",chapter:"卷六·从革",scene:"格局",tags:["从革格","专旺"],quote:"庚辛日见巳酉丑局,须带丙丁巳午一二位方成其器,但不可火多。如辛巳、辛酉、辛丑三日不喜五月生,被火所伤,宜八月或水土养育食神印绶为吉。",plain:"从革格是金局成方(巳酉丑),但金要火炼才成器:须带丙丁或巳午一二位,火又不能多。辛巳、辛酉、辛丑三日出身在五月(火旺)被伤,原文说宜八月或水土养育。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7632.html"},{id:"smt-runxia",book:"sanming",chapter:"卷六·润下",scene:"格局",tags:["润下格","专旺"],quote:"壬癸日见申子辰全,忌引卯巳死绝之地,三刑四冲之乡,死绝则不流,冲刑则横流,岁运同。或曰水太泛须柱有土神一两位制之,得成堤岸,既有土怕会木为凶,如有木伤土要金印救解,终是一生成败。",plain:"润下格是水局三合全(申子辰),最忌卯巳死绝与三刑四冲:死绝水不流,冲刑水横流,行运也一样看。水太泛要一两位土作堤,有土又怕木来破堤,木伤土再用金印解救——原文把成败条件摊开讲。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7633.html"},{id:"smt-jiasi",book:"sanming",chapter:"卷六·稼穑",scene:"格局",tags:["稼穑格","专旺"],quote:"赋云:戊己忻逢四季,乃为稼穑之名。是戊己生逢季月,喜见木为官,止得一木为妙,木多则土虚,主虚诈为破家不仁之人。",plain:"稼穑格取戊己生于四季月(辰戌丑未)。原文说喜见一木为官,木多则土虚;后半对木多之人的评语是旧说的重话,本插件只照录条件、不拿来评价人。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7634.html"},{id:"smt-congsha",book:"sanming",chapter:"卷五·弃命从煞",scene:"格局",tags:["从杀格"],quote:"《独步》云:弃命从煞,须要会煞从财,忌煞从煞。盖言从煞格,以煞神太重,身无所归,不得已从之,要行煞旺及财乡,四柱无一点比肩印绶方论,如遇运扶身旺,与煞为敌,从煞不专,故为祸患。",plain:"从煞格是煞太重、日主无所归才「弃命」相从:条件是四柱没有一点比肩印绶扶身,行运喜煞旺与财乡;一旦走扶身之运,与煞为敌,就从得不专。本插件只作结构说明,不据此断寿夭。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7598.html"},{id:"smt-congcai",book:"sanming",chapter:"卷六·弃命从财",scene:"格局",tags:["从财格"],quote:"《独步》云:弃命从财,须要会财,若逢根气,命损无猜。假如丁生酉月,柱多庚辛,日干无气,只得弃命相从,运入北方财官旺地,乃为入格,南行灾。",plain:"从财格要财会成局、日干无气;一见根气就破格,原文用「命损无猜」这种重话写明。以丁生酉月、柱多庚辛为例:只能弃命相从,行北方财官旺地为入格,南行则灾。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7652.html"},{id:"smt-suiyun",book:"sanming",chapter:"卷二·总论岁运",scene:"岁运",tags:[],quote:"行运以生月为运元,最怕行运与太岁冲克,若岁运冲月必祸;若岁运与日相对,谓之返吟,岁运压日,谓之伏吟,二者不利六亲,非横破财,不为吉兆。",plain:"大运以生月为起点,最怕与流年(太岁)冲克:原文说岁运冲月为祸,又把「岁运与日柱相对」叫返吟、「岁运压日」叫伏吟。这两句是按「对日柱」说的,与本插件「干支相同为伏吟、天克地冲为反吟」不是同一套定义(本插件取后者);末句「不利六亲、破财」是旧说的重话,只作变动提示,不作断语。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7539.html"},{id:"smt-renyuan",book:"sanming",chapter:"卷二·论人元司事",scene:"人元",tags:[],quote:"故支吕所藏者主命,谓之人元,名为司事之神,以命术言之为月令。如正月建寅,寅中有艮土用事五日,丙火长生五日,甲木二十日;二月建卯,卯中有甲木用事七日,乙木二十三日;",plain:"地支所藏为「人元」,按月令分日轮值。三命通会这一本给的是另一套日数:寅月艮土(戊土)五日、丙火五日、甲木二十日,卯月甲七日、乙二十三日。它与本插件采用的通行 30 日表(寅月戊7丙7甲16,即 7/7/16;卯月甲10乙20,即 10/20)不是同一套分法;两表各照原样并列,本插件仍按通行表给「第几日谁当权」,不改取格。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7529.html"}],W=J.reduce((T,s)=>(T[s.id]=s,T),{}),K={正官格:"正官",七杀格:"七杀",偏官格:"偏官",正财格:"正财",偏财格:"偏财",正印格:"印",偏印格:"印",食神格:"食神",伤官格:"伤官",阳刃格:"阳刃",月劫格:"月劫",建禄格:"建禄"},F={曲直格:"smt-quzhi",炎上格:"smt-yanshang",从革格:"smt-congge",润下格:"smt-runxia",稼穑格:"smt-jiasi",从财格:"smt-congcai",从杀格:"smt-congsha"};function q(T){return W[T]||null}function A(T){return(T&&Array.isArray(T.liunian)?T.liunian:[]).some(l=>l&&l.suiyun&&Array.isArray(l.suiyun.signals)&&l.suiyun.signals.length)?q("smt-suiyun"):null}function P(T){const s=String(T||"");if(K[s])return K[s];const u=s.replace(/格$/,"");return K[u+"格"]||u}function z(T,s){return J.find(u=>u.scene==="格局"&&u.tags.includes(T)&&(!s||u.book===s))||null}function b(T){return T.chapter.replace(/^.*[、·]/,"").replace(/^论/,"")}function y(T,s=5){if(!T)return[];const u=[],l=new Set,O=(M,B)=>{!M||l.has(M.id)||u.length>=s||(l.add(M.id),u.push({...M,why:B}))},x=Array.isArray(T.geju)?T.geju:T.frame&&Array.isArray(T.frame.geju)?T.frame.geju:[],$=x.some(M=>M&&M.kind==="化气格");for(const M of x){if(M&&M.status==="破格"||$&&M&&M.status==="假从")continue;const B=M&&F[M.name]?q(F[M.name]):null;B&&O(B,`本盘列有「${M.name}」,故取${R[B.book].name}「${b(B)}」一条`)}for(const M of x){if(!M||M.kind&&M.kind!=="月令格")continue;const B=P(M.name),se=z(B,"ziping")||z(B);se&&O(se,`你的月令格局是「${M.name}」,故取${R[se.book].name}「${b(se)}」一条`);const H=J.find(pe=>pe.scene==="格局"&&pe.tags.includes(B)&&(!se||pe.book!==se.book));H&&O(H,`同是「${M.name}」,${R[H.book].name}「${b(H)}」另有取法,可对照读`)}const w=T.climate||T.frame&&T.frame.yongshen&&(T.frame.yongshen.climate||T.frame.yongshen.tiaohou),o=T.frame&&T.frame.yongshen&&T.frame.yongshen.tongguan,d=o&&o.usable?q("dt-tongguan"):null;if(w&&w.kind&&w.kind!=="平和"){const M=!!(w.cold||w.kind.indexOf("寒")>=0),B=!!(w.hot||w.kind.indexOf("热")>=0);O(q(M?"dt-hannuan":"dt-zaoshi"),`本盘气候判为「${w.kind}」,故取${R.ditian.name}寒暖燥湿一条`),d||O(q("zp-qihou"),"气候与月令用神要互参,故取子平真诠「用神配气候」一条"),B&&O(q("dt-hannuan"),"本盘偏热,寒暖一条正对")}d&&O(d,`本盘忌${o.foe}克用${o.use},局中${o.bridge}${o.weight}分可作通关,故取${R.ditian.name}「通关」一条`);const h=x.find(M=>M&&M.kind==="化气格"),g=x.find(M=>M&&M.kind==="组合"),N=T.monthBranch||T.frame&&T.frame.monthBranch||T.pillars&&T.pillars.month&&T.pillars.month.branch,_=["辰","未","戌","丑"].includes(N);return h?O(q("zp-bianhua"),`本盘列有「${h.name}」:用神由月令合化而变,总纲一位改取${R.ziping.name}论用神变化`):_?O(q("zp-zaji"),`月令${N}属四墓杂气,取用先看透干、再看会支,总纲一位取${R.ziping.name}论杂气如何取用`):g?O(q("zp-chengbai"),`本盘另有「${g.name}」组合:成格还要看带忌与救应,总纲一位改取${R.ziping.name}论用神成败救应`):O(q("zp-yongshen"),"用神从月令取、四吉顺用四凶逆用,是通用总纲"),u}function L(T){return!T||!T.length?"":T.map(s=>`《${R[s.book].name}·${s.chapter}》「${s.quote}」`).join(`
72
- `)}return{CLASSIC_BOOKS:R,CLASSICS:J,classicOf:q,suiyunClassicOf:A,classicsFor:y,classicsText:L}})(),D.wuyunliuqi=(function(){const{fail:R}=D.fail||{},{STEMS:J,BRANCHES:W,termInstantJd:K,ganzhiName:F,formatJd:q}=D.calendar||{},{assertCivil:A,daysInMonth:P}=D.validate||{},z=["厥阴风木","少阴君火","少阳相火","太阴湿土","阳明燥金","太阳寒水"],b=["厥阴风木","少阴君火","太阴湿土","少阳相火","阳明燥金","太阳寒水"],y=["木","火","土","金","水"],L={甲:"土",己:"土",乙:"金",庚:"金",丙:"水",辛:"水",丁:"木",壬:"木",戊:"火",癸:"火"},T=[1,2,3,4,5,0],s={木:{tone:"角",organ:"肝",nature:"风",text:"木运"},火:{tone:"徵",organ:"心",nature:"热",text:"火运"},土:{tone:"宫",organ:"脾",nature:"湿",text:"土运"},金:{tone:"商",organ:"肺",nature:"燥",text:"金运"},水:{tone:"羽",organ:"肾",nature:"寒",text:"水运"}},u={厥阴风木:{wuxing:"木",organ:"肝",nature:"风",short:"风木"},少阴君火:{wuxing:"火",organ:"心",nature:"热",short:"君火"},太阴湿土:{wuxing:"土",organ:"脾",nature:"湿",short:"湿土"},少阳相火:{wuxing:"火",organ:"三焦",nature:"火",short:"相火"},阳明燥金:{wuxing:"金",organ:"肺",nature:"燥",short:"燥金"},太阳寒水:{wuxing:"水",organ:"肾",nature:"寒",short:"寒水"}},l={木:{tai:{climate:"风气偏胜,草木早荣",organ:"肝气偏旺,脾土受克",sign:"易怒、胁胀、食少、肢体震颤"},bu:{climate:"风气不足,燥气乘之",organ:"肝木不及,肺金偏胜",sign:"筋脉拘急、目干、情绪低落"}},火:{tai:{climate:"火气偏胜,暑热早至",organ:"心火偏旺,肺金受克",sign:"心烦、失眠、咳喘、口疮"},bu:{climate:"火气不足,寒气乘之",organ:"心火不及,肾水偏胜",sign:"心悸、畏寒、胸闷、精神不振"}},土:{tai:{climate:"雨湿偏多,土气壅滞",organ:"脾湿偏胜,肾水受克",sign:"腹胀、身重、大便黏、四肢困倦"},bu:{climate:"土气不足,风气乘之",organ:"脾土不及,肝木偏胜",sign:"飧泄、乏力、腹鸣、食后胀"}},金:{tai:{climate:"燥气偏胜,天气清凉",organ:"肺燥偏胜,肝木受克",sign:"干咳、鼻干、皮肤干、筋急"},bu:{climate:"金气不足,火气乘之",organ:"肺金不及,心火偏胜",sign:"咳逆、鼻塞、咽干、易感外邪"}},水:{tai:{climate:"寒气偏胜,冰霜早降",organ:"肾寒偏胜,心火受克",sign:"畏寒、水肿、腰冷、心悸"},bu:{climate:"水气不足,湿土乘之",organ:"肾水不及,脾土偏胜",sign:"腰膝无力、小便不利、下肢沉"}}},O={厥阴风木:{climate:"风气流行,草木动摇",sign:"眩晕、抽搐、胁痛、过敏类症状偏多"},少阴君火:{climate:"热气偏胜,暑热早来",sign:"心烦、口疮、失眠、咽痛偏多"},太阴湿土:{climate:"湿气偏胜,阴雨多",sign:"腹胀、身重、泄泻、关节酸沉偏多"},少阳相火:{climate:"火气偏胜,炎热",sign:"头痛、目赤、耳鸣、疮疡偏多"},阳明燥金:{climate:"燥气偏胜,干燥少雨",sign:"干咳、鼻干、皮肤裂、便秘偏多"},太阳寒水:{climate:"寒气偏胜,霜雪多",sign:"畏寒、关节痛、腹痛、水肿偏多"}},x={covered:["运气年(大寒为界)与年干支","岁运(中运)五行与太过/不及、五音太少","司天、在泉","主运五步与客运五步(含每步起止时刻)","主气六步与客气六步(含每步起止时刻)","当前时刻所处的运与气","天符 / 岁会 / 同天符 / 同岁会 / 太乙天符"],notCovered:["《素问·六元正纪大论》六十年逐年全文与「先立其年,以明其气」的逐气病证条辨","刚柔失守、升降不前、不迁正、不退位等岁气交司推演","运气合参的方药与针灸取穴","地域与体质差异对运气的修正"],note:"病位、气候与症状倾向都是传统说法的转述,用来对照季节与身体感受,不是诊断结论。"},$=365.25/5,w=365.25/6;function o(oe){const i=J.indexOf(oe);if(i<0)throw R("E_INPUT",`天干「${oe}」不在十干之内`);return i}function d(oe){const i=W.indexOf(oe);if(i<0)throw R("E_INPUT",`地支「${oe}」不在十二支之内`);return i}function h(oe){const i=((oe-4)%60+60)%60;return F(i)}function g(oe){const i=o(oe),m=L[oe],C=i%2===0,v=s[m];return{gan:oe,wuxing:m,tone:v.tone,tai:C,name:`${m}运${C?"太过":"不及"}`,taiShao:`${C?"太":"少"}${v.tone}`,organ:v.organ,nature:v.nature}}function N(oe){const i=d(oe),m=T[i%6],C=(m+3)%6;return{sitIdx:m,zaiIdx:C,sitian:b[m],zaiquan:b[C]}}function _(oe){return y.map((i,m)=>{const C=s[i],v=oe+m*$,f=v+$;return{no:m+1,wuxing:i,name:`${i}运`,tone:C.tone,taiShao:`太${C.tone}`,startJd:v,endJd:f,startTime:q(v),endTime:q(f),days:Math.round($*100)/100}})}function M(oe,i){const m=y.indexOf(oe.wuxing);return Array.from({length:5},(C,v)=>{const f=y[(m+v)%5],S=s[f],k=v%2===0?oe.tai:!oe.tai,Y=i+v*$,U=Y+$;return{no:v+1,wuxing:f,tai:k,name:`${f}运${k?"太过":"不及"}`,tone:S.tone,taiShao:`${k?"太":"少"}${S.tone}`,startTime:q(Y),endTime:q(U)}})}function B(oe){return z.map((i,m)=>{const C=u[i],v=oe+m*w,f=v+w;return{no:m+1,qi:i,wuxing:C.wuxing,organ:C.organ,nature:C.nature,name:`${i}`,startTime:q(v),endTime:q(f),days:Math.round(w*100)/100}})}function se(oe,i){const m=((oe-2)%6+6)%6;return Array.from({length:6},(C,v)=>{const f=b[(m+v)%6],S=u[f],k=i+v*w,Y=k+w;return{no:v+1,qi:f,wuxing:S.wuxing,organ:S.organ,nature:S.nature,name:f,sitian:v===2,zaiquan:v===5,startTime:q(k),endTime:q(Y)}})}const H={子:"水",午:"火",卯:"木",酉:"金",辰:"土",戌:"土",丑:"土",未:"土",寅:null,申:null,巳:null,亥:null};function pe(oe,i){const m=K(oe,1);return i>=m?{nian:oe,startJd:m,endJd:K(oe+1,1)}:{nian:oe-1,startJd:K(oe-1,1),endJd:m}}function be(oe,i,m,C){const v=oe.wuxing,f=u[i].wuxing,S=u[m].wuxing,k=H[C]||null,Y=v===f,U=!!k&&v===k,Q=oe.tai&&v===S,te=!oe.tai&&v===S,re=Y&&U,Z=[];return re?Z.push("太乙天符:中运与司天同气、又与年支本位同气,传统上视为六十年里最「重」的一类年份之一,气候与病气的变化都容易被放大。"):Y&&Z.push("天符:中运与司天同气。传统上说这一年本气专一而偏胜,气候变化来得整齐。"),U&&Z.push("岁会:中运与年支本位同气。传统上说这一年气令与地域相应,来得比较「正」。"),Q&&Z.push("同天符:阳年太过之运与在泉同气,下半年(在泉主事)容易延续上半年的偏胜。"),te&&Z.push("同岁会:阴年不及之运与在泉同气,本气本已不足,下半年又被同一气拖住,恢复更慢。"),{tianFu:Y,suiHui:U,tongTianFu:Q,tongSuiHui:te,taiYi:re,notes:Z}}function we(oe){A(oe,"五运六气");const{year:i,month:m,day:C}=oe;if(C>P(i,m))throw R("E_INPUT",`非法日期:${i} 年 ${m} 月没有 ${C} 日`);const v=Number.isInteger(oe.hour)?oe.hour:12,f=Number.isInteger(oe.minute)?oe.minute:0;if(v<0||v>23)throw R("E_INPUT","hour 要在 0–23 之间");if(f<0||f>59)throw R("E_INPUT","minute 要在 0–59 之间");const S=K(i,1)*0+(function(){return(function(Me,Ie,De){const Fe=Math.floor((14-Ie)/12),Ge=Me+4800-Fe,Be=Ie+12*Fe-3;return De+Math.floor((153*Be+2)/5)+365*Ge+Math.floor(Ge/4)-Math.floor(Ge/100)+Math.floor(Ge/400)-32045})(i,m,C)-.5+(v*60+f)/1440})(),k=pe(i,S),Y=h(k.nian),U=g(Y.stem),Q=N(Y.branch),te=_(k.startJd),re=M(U,k.startJd),Z=B(k.startJd),ce=se(Q.sitIdx,k.startJd),ue=S-k.startJd,$e=Math.min(5,Math.max(1,Math.floor(ue/$)+1)),je=Math.min(6,Math.max(1,Math.floor(ue/w)+1)),ne=te[$e-1],me=re[$e-1],Re=Z[je-1],ve=ce[je-1],Ue=l[U.wuxing][U.tai?"tai":"bu"],Ye=O[Q.sitian],Ze=O[Q.zaiquan],_e=be(U,Q.sitian,Q.zaiquan,Y.branch),Oe=u[ve.qi].wuxing,Se=u[Re.qi].wuxing,Ne={木:"火",火:"土",土:"金",金:"水",水:"木"},Pe={木:"土",土:"水",水:"火",火:"金",金:"木"};let xe="相安";Oe===Se?xe="同气":Ne[Oe]===Se?xe="客生主(顺)":Ne[Se]===Oe?xe="主生客(泄)":Pe[Oe]===Se?xe="客克主(逆)":Pe[Se]===Oe&&(xe="主克客(从)");const qe=`${Q.sitian}司天 · ${U.name}`,ze=`这一运气年是「${Y.name}」年:中运${U.name}(${U.taiShao}),${Q.sitian}司天、${Q.zaiquan}在泉。传统上把这样的组合读成「${Ue.climate}」,司天一侧偏「${Ye.climate}」,在泉一侧偏「${Ze.climate}」。`;return{system:"wuyunliuqi",meta:{datetime:`${i}-${String(m).padStart(2,"0")}-${String(C).padStart(2,"0")} ${String(v).padStart(2,"0")}:${String(f).padStart(2,"0")}`,nian:k.nian,ganzhi:Y.name,stem:Y.stem,branch:Y.branch,isYang:U.tai,startTime:q(k.startJd),endTime:q(k.endJd),dayInYear:Math.round(ue*100)/100},year:{ganzhi:Y.name,stem:Y.stem,branch:Y.branch,nian:k.nian,startTime:q(k.startJd),endTime:q(k.endJd),note:"运气年以大寒为界:交大寒之前仍算上一运气年,与八字按立春定年柱不同。"},zhongyun:{...U,effect:Ue,text:`中运${U.name}(${U.taiShao}),主${U.organ},气候偏${U.nature}。`},sitian:{qi:Q.sitian,...u[Q.sitian],climate:Ye,text:`${Q.sitian}司天:上半年(三之气起)主事,气候偏${u[Q.sitian].nature}。`},zaiquan:{qi:Q.zaiquan,...u[Q.zaiquan],climate:Ze,text:`${Q.zaiquan}在泉:下半年(终之气)主事,气候偏${u[Q.zaiquan].nature}。`},zhuYun:te,keYun:re,zhuQi:Z,keQi:ce,current:{dayInYear:Math.round(ue*100)/100,yunNo:$e,qiNo:je,zhuYun:ne,keYun:me,zhuQi:Re,keQi:ve,lin:xe,text:`此刻在第 ${$e} 运(主运${ne.name} / 客运${me.name})、第 ${je} 气(主气${Re.qi} / 客气${ve.qi},客气加临主气:${xe})。`},special:_e,combo:{name:qe,text:ze},scope:x}}return{YUN_DAYS:$,QI_DAYS:w,ZHU_QI_ORDER:z,QI_ORDER:b,ZHU_YUN_ORDER:y,YUN_OF_STEM:L,SITIAN_INDEX_OF_BRANCH:T,YUN_INFO:s,QI_INFO:u,YUN_EFFECT:l,QI_CLIMATE:O,WUYUNLIUQI_SCOPE:x,yearGanzhiOf:h,zhongyunOf:g,sitianOf:N,yunYearOf:pe,specialOf:be,buildWuyunliuqi:we}})(),D.followup=(function(){const{ZIWEI_STARS:R}=D["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:["出行","搬家","旅行","出国","迁","远行"]}],W={career:"官禄",wealth:"财帛",love:"夫妻",health:"疾厄",study:"官禄",travel:"迁移",overall:"命宫"},K=(l,O)=>{const x=String(l).match(/(20\d{2})\s*年?/);if(x)return Number(x[1]);const $=Array.isArray(O.liunian)&&O.liunian[0]?Number(O.liunian[0].year):null;return $?/明年/.test(l)?$+1:/后年/.test(l)?$+2:/去年/.test(l)?$-1:/今年|本年/.test(l)?$:null:null},F=l=>J.find(O=>O.words.some(x=>String(l).includes(x)))||null;function q(l,O){const x=K(O,l),$=F(O),w=Array.isArray(l.liunian)?l.liunian:[],o=Array.isArray(l.dayun?.list)?l.dayun.list:[],d=w.map(h=>h.year);if(x&&!w.some(h=>Number(h.year)===x))return{ok:!1,year:x,topic:$,answer:`这一盘已排的流年范围是 ${d[0]}–${d[d.length-1]},没有 ${x} 年。可以把问题改到范围内,或用 asOf 指定你想看的年份重新排盘。`,evidence:[`已排流年:${d.join("、")}`],confidence:"弱"};if(x){const h=w.find(se=>Number(se.year)===x),g=o.find(se=>Number(se.startAge)<=Number(h.age)&&Number(h.age)<=Number(se.startAge)+9)||null,N=h.luck?.tier||"平",_=(h.luck?.reasons||[]).slice(0,3),M=(h.relations||[]).join("、"),B=$?P(l,$.key):"";return{ok:!0,year:x,topic:$,answer:`${x} 年(${h.ganzhi})流年,十神为${h.stemTenGod||"—"},档位「${N}」;所行大运 ${g?`${g.ganzhi}(${g.luck?.tier||"平"})`:"未取到"}。${_.length?`理由:${_.join(",")}。`:""}${M?`与该年地支相关的原局关系:${M}。`:""}${B}`,evidence:[`流年 ${h.year} ${h.ganzhi}·${h.stemTenGod||""}·${N}`,g?`大运 ${g.ganzhi}·${g.luck?.tier||"平"}`:"",M?`原局关系 ${M}`:"",$?`问题方向:${$.label}`:""].filter(Boolean),confidence:g&&_.length?"强":"中"}}if($){const h={wealth:"overall",study:"work",travel:"overall"}[$.key]||$.key,g=(l.interpret?.dimensions||[]).find(_=>_.key===$.key||_.key===h);if(g){const _=l.frame&&l.frame.godStats&&l.frame.godStats.groups||{},M=$.key==="wealth"?` 财星权重 ${Number(_.财||0)}(只作结构参考,不含金额)。`:"";return{ok:!0,year:null,topic:$,answer:`按${$.label}这条线看:${g.text}${M}${g.advice?` 建议:${g.advice}`:""}`,evidence:(g.evidence||[]).slice(0,4),confidence:g.confidence||"中"}}const N=l.frame&&l.frame.godStats&&l.frame.godStats.groups||{};if(Object.keys(N).length){const _=["比劫","食伤","财","官杀","印"].map(M=>`${M} ${Number(N[M]||0)}`);return{ok:!0,year:null,topic:$,answer:`「${$.label}」这条线,这一盘只带了盘面结构:${_.join("、")}。具体吉凶与建议需要解析层(排盘时加 withInterpret),追问这里不自行推演。`,evidence:_.slice(0,3),confidence:"弱"}}}return{ok:!1,year:null,topic:$,answer:`这个问题里没有识别到具体的年份或方面。可以这样问:「2027 年事业怎么样」「财运如何」「感情在 2028 年」;已排流年是 ${d[0]}–${d[d.length-1]}。`,evidence:[`可问年份:${d.join("、")}`],confidence:"弱"}}function A(l,O){const x=K(O,l),$=F(O),w=Array.isArray(l.liunian)?l.liunian:[];if(x&&!w.some(o=>Number(o.year)===x))return{ok:!1,year:x,topic:$,answer:`这一盘的流年表覆盖 ${w[0]?.year}–${w[w.length-1]?.year},没有 ${x} 年;可以换一个年份,或用 asOf 指定起点重新排盘。`,evidence:[`流年表:${w.map(o=>o.year).join("、")}`],confidence:"弱"};if(x){const o=w.find(h=>Number(h.year)===x),d=o.daxian||{};return{ok:!0,year:x,topic:$,answer:`${x} 年(${o.ganzhi},${o.age} 岁)流年命宫落在「${o.lifePalace?o.lifePalace.palace:"—"}」,四化为 ${(o.mutagen||[]).join("、")||"不明显"};所行大限${d.palace?`在${d.palace}(${d.start}–${d.end} 岁)`:"未取到"}。${$?`与「${$.label}」对应的宫位信号见下条依据。`:""}`,evidence:[`流年命宫 ${o.lifePalace?o.lifePalace.palace:"—"}(${o.lifePalace?o.lifePalace.branch:"—"})`,`四化 ${(o.mutagen||[]).join("、")||"不明显"}`,d.palace?`大限 ${d.palace}·${d.start}–${d.end}岁`:""].filter(Boolean),confidence:(o.mutagen||[]).length>=3?"强":"中"}}if($){const o=W[$.key]||"命宫",d=(l.palaces||[]).find(h=>h.palace===o);if(d){const h=(d.stars||[]).filter(N=>N.type==="主星").map(N=>N.name),g=h.map(N=>R[N]?.trait).filter(Boolean).slice(0,2).join(";");return{ok:!0,year:null,topic:$,answer:`「${$.label}」看${o}:主星${h.length?h.join("、"):"无正曜(借对宫)"}${g?`——${g}`:""}。宫支${d.branch},${d.stems,""}生年四化与煞星的影响需结合报告里的对应分节一起看。`,evidence:[`${o} ${d.branch}·${h.join("、")||"无正曜"}`,...(d.shensha||[]).slice(0,3)],confidence:h.length?"强":"弱"}}}return{ok:!1,year:null,topic:$,answer:"没有识别到具体年份或方面。可以问「2028 年事业」「感情怎么样」「财运在 2030 年」;也可以直接问某个宫位,如「夫妻宫」。",evidence:[],confidence:"弱"}}function P(l,O){return`这段时间可以重点对照报告里「${{career:"事业",wealth:"财富",love:"感情",health:"健康",study:"学业",travel:"出行"}[O]||"整体"}」一节看。`}function z(l,O){const x=F(O),$=Array.isArray(l.interpret?.sections)?l.interpret.sections:[],w=x?$.find(h=>h.label.includes(x.label)||h.text.includes(x.label)):null;if(w)return{ok:!0,year:null,topic:x,answer:w.text,evidence:[`引用分节:${w.label}`],confidence:"中"};const o=$[0];if(o)return{ok:!1,year:null,topic:x,answer:`这一盘的追问需要落到具体方面(事业 / 财富 / 感情 / 健康 / 学业 / 出行)。先看「${o.label}」这一节,或把问题说得更具体一点。`,evidence:[],confidence:"弱"};const d=String(l&&l.summary||"").trim();if(d){const h=d.split(`
73
- `).map(N=>N.trim()).filter(Boolean),g=x?h.filter(N=>x.words.some(_=>N.includes(_))):[];return{ok:!0,year:null,topic:x,answer:g.length?`${x.label}相关的盘面字段:${g.slice(0,3).join(";")}。这一盘没带解析层,只列盘面事实,不在这里补吉凶结论。`:`这一盘没有解析层,只能按盘面字段回答;可问的方向:${J.map(N=>N.label).join(" / ")}。下面任取摘要是盘面原文,未作推演。`,evidence:(g.length?g:h).slice(0,4),confidence:"弱"}}return{ok:!1,year:null,topic:x,answer:"这一盘暂时没有可追问的分节,也没有摘要字段;先重新排一次盘,再问具体方面。",evidence:[],confidence:"弱"}}function b(l,O){const x=String(O||"").trim(),$=l&&l.system==="bazi"?q(l,x):l&&l.system==="ziwei"?A(l,x):z(l,x);return{question:x,...$}}const y={bazi:"八字(四柱)",ziwei:"紫微斗数",liuyao:"六爻",meihua:"梅花易数",daliuren:"大六壬",qimen:"奇门遁甲",tarot:"塔罗",hepan:"合盘",chenggu:"称骨",almanac:"黄历",zeri:"择日",star:"星座",numerology:"生命数字",mbti:"十六型人格",trend:"人生 K 线",fengshui:"风水",name:"起名",convert:"公农历互转"},L=Object.freeze({bazi:["基本信息","四柱(日主/十神/藏干)","旺衰·格局·用神","合冲·神煞","起运·大运·流年","古籍依据"],ziwei:["基本信息","命宫/身宫与五行局","十二宫(主星/辅煞/四化)","格局与三方四正","大限/流年","古籍依据"],liuyao:["所问与用神","本卦/变卦(世应/动爻/六亲)","月建日辰(旺衰/空破)","应期线索","卦辞与依据"],meihua:["所问与体用","本卦/互卦/变卦","五行生克","应期与依据"],daliuren:["天地盘(月将/贵人)","四课","三传","课体与神将","依据"],qimen:["四柱与局数","九宫(星门神/天盘干)","用神落宫","门宫·干宫·十干克应","旺衰·击刑入墓","依据"],tarot:["问题与牌阵","逐牌(正逆/牌面/元素对应)","牌间关系","综合倾向","边界"],fengshui:["坐向与元运","运盘/山盘/向盘","旺山旺向","取象与边界"]}),T=Object.freeze(["基本信息","盘面事实","结构与关系","倾向","边界"]);function s(l){return L[l]||T}function u(l,O={}){const x=y[l&&l.system]||l&&l.system||"未知体系",w=String(O&&O.question||"").trim()||"请先用一句白话讲清这张盘的主线,再指出最值得注意的一两处,并说明每处的具体依据。",o=Number.isFinite(O&&O.maxChars)&&O.maxChars>=400?O.maxChars:3e3,d=String(l&&l.summary||"").trim(),h=d.length>o,g=h?`${d.slice(0,o)}…(摘要已截断)`:d,N=O&&typeof O.interpret=="object"&&O.interpret||l&&typeof l.interpret=="object"&&l.interpret||null,_=String(N&&N.answer||"").trim(),M=String(N&&N.plain||"").trim(),B=[];_&&B.push(`直答:${_}`),M&&B.push(`说人话:${M}`);const H=["【命理追问】下面这张盘是命理插件刚排好的,请就着它回答我的问题;不用重新排盘,盘面字段已经够用。",`体系:${x}`,`所问:${w}`,"",...B.length?["——开场结论(插件已按同一套规则算好,开场先沿用这句;措辞可改,口径别换)——",...B,""]:[],"——盘面层次(从上到下读,别跳层)——",`${x}:${s(l&&l.system).join(" → ")}`,"先复述事实,再讲结构与时间;上一层没交代清楚,不要跳到下一层。","","——盘面摘要——",g||"(这张盘没有摘要字段,请先让我重新排一次。)",...String(l&&l.jing||"").trim()?["","——《周易》经文原文(本插件按三份底本互校照录,〔一作…〕是异文,不是改写)——",String(l.jing).trim()]:[],...l&&l.zuoyao&&l.zuoyao.verses?["",`——紫微杂曜安星诀(本盘开了全表,${l.zuoyao.placed.length} 颗已按下列诀安入;诀文出多处近代通行辑本并核,属通行说,不是《紫微斗数全书》原文)——`,String(l.zuoyao.verses).trim(),`未另立:${(l.zuoyao.skipped||[]).join(";")}`]:[],"","——回答要求——","读者不懂命理。按下面的骨架答;任何一句他看不懂,就算没写完:",B.length?"1) 开头一句结论:先沿用上面的「开场结论」,再用一句不用术语的话说清这张盘的主线——只读这一句也该有收获;":"1) 开头一句结论:不用术语,一句话说清这张盘的主线,只读这一句也该有收获;","2) 第二段只复述盘面骨架:按上面的层次用 2–4 行写事实(如四柱、格局、用神、大运),不掺倾向,让读者知道后面的判断从哪来;","3) 判断最多两条,按重要性排序,每条分四行写:"," 盘面|只引盘面已有的字(具体的柱、宫或爻、字段名),不掺解释;"," 白话|把上一行的术语当场翻成日常话——调候 / 化气 / 通关 / 空亡 / 争合 这类词必须落地,一个词只翻一次,不连续堆三个以上;"," 倾向|说「更可能……」,讲清它在现实里大概意味着什么,用概率语气;"," 边界|这条在什么情况下不成立;盘面没给的,直接写「这盘里看不出来」;","4) 收尾一句「如果只记一件事」:给一条能核对、能动手的观察点,并说明它出自上面哪条盘面依据;","5) 别把传统说法当成已证实的事实:不下绝对断言,也不用「肯定」「绝对」这类词,更不写「格局很好」「运程不顺」这种没有信息的空话。"].join(`
74
- `);return{text:H,question:w,system:l&&l.system||"",label:x,chars:H.length,truncated:h}}return{followup:b,READING_ORDERS:L,READING_ORDER_FALLBACK:T,readingOrderOf:s,askPrompt:u}})(),D.revise=(function(){const R=[{key:"ziwei",label:"紫微",re:/紫微|斗数/},{key:"bazi",label:"八字",re:/八字|四柱/},{key:"liuyao",label:"六爻",re:/六爻|摇卦/},{key:"qimen",label:"奇门",re:/奇门/},{key:"daliuren",label:"大六壬",re:/大六壬|六壬/},{key:"tarot",label:"塔罗",re:/塔罗|抽牌/},{key:"meihua",label:"梅花",re:/梅花/},{key:"hepan",label:"合盘",re:/合盘|合婚/},{key:"almanac",label:"黄历",re:/黄历|老黄历/},{key:"zeri",label:"择日",re:/择日|挑日子/},{key:"fengshui",label:"风水",re:/风水/},{key:"name",label:"起名",re:/起名|取名/},{key:"chenggu",label:"称骨",re:/称骨/},{key:"xiaoliuren",label:"小六壬",re:/小六壬/},{key:"star",label:"星座",re:/星座/},{key:"numerology",label:"生命数字",re:/生命数字|生命灵数/},{key:"mbti",label:"MBTI",re:/mbti|人格测试|十六型/i},{key:"trend",label:"人生 K 线",re:/k\s*线|人生曲线/i},{key:"convert",label:"公农历互转",re:/农历转公历|公历转农历|公农历/}],J=[{key:"love",label:"感情",re:/感情|婚姻|恋爱|对象|夫妻/},{key:"wealth",label:"财运",re:/财运|财富|赚钱|收入|破财/},{key:"career",label:"事业",re:/事业|工作|升职|跳槽/},{key:"health",label:"健康",re:/健康|身体|疾病|病/},{key:"study",label:"学业",re:/学业|考试|考研|升学|读书/},{key:"travel",label:"出行",re:/出行|搬家|迁移|旅行|外地/}],W=/换成|改成|改为|换到|改看|再看|再看一下|换一套|排一?张|用|按|看/,K=z=>String(z||"").replace(/(出生|出生地|所在地|人)$/,"").replace(/[的了].*$/,"").trim();function F(z){const b=String(z??"").trim(),y={},L=[],T=[];if(!b)return{text:"",patch:y,labels:L,ignored:T};if(W.test(b)){for(const l of R)if(l.re.test(b)){y.system=l.key,L.push({key:"system",label:"体系",value:l.key,display:l.label});break}}/女命|女性|换成女|改成女|女盘/.test(b)?(y.gender="female",L.push({key:"gender",label:"性别",value:"female",display:"女"})):/男命|男性|换成男|改成男|男盘/.test(b)&&(y.gender="male",L.push({key:"gender",label:"性别",value:"male",display:"男"})),/晚子时/.test(b)&&(/不换日|不换天|算当日|归当日|按当日|当天/.test(b)?(y.lateZi=!1,L.push({key:"lateZi",label:"晚子时",value:!1,display:"23:00 后仍算当日"})):/换日|算次日|归次日|按次日|第二天|次日/.test(b)&&(y.lateZi=!0,L.push({key:"lateZi",label:"晚子时",value:!0,display:"23:00 后算次日"}))),/真太阳时/.test(b)&&(/不用|不要|关闭|关掉|取消|不算/.test(b)?(y.trueSolar=!1,L.push({key:"trueSolar",label:"真太阳时",value:!1,display:"用东八区平太阳时"})):(y.trueSolar=!0,L.push({key:"trueSolar",label:"真太阳时",value:!0,display:"按出生地经度校正"}))),/夏令时/.test(b)&&(/不用|不要|关闭|关掉|取消|不校正/.test(b)?(y.dst=!1,L.push({key:"dst",label:"夏令时",value:!1,display:"不自动校正 1986–1991 夏令时"})):(y.dst=!0,L.push({key:"dst",label:"夏令时",value:!0,display:"自动校正 1986–1991 夏令时"})));const s=b.match(/出生在\s*([\u4e00-\u9fa5]{2,12})/)||b.match(/出生地(?:改成|改为|换成|换到|是|为)?\s*([\u4e00-\u9fa5]{2,12})/)||b.match(/改到\s*([\u4e00-\u9fa5]{2,12})\s*出生/);if(s){const l=K(s[1]);l.length>=2&&(y.address=l,L.push({key:"address",label:"出生地",value:l,display:l}))}const u=b.match(/(?:看|查|问|到|到了|临近)\s*((?:19|20)\d{2})\s*年/)||b.match(/((?:19|20)\d{2})\s*年(?:的)?(?:运势|怎么样|如何|会怎样|流年)/);if(u){const l=Number(u[1]);y.asOf=`${l}-01-01T00:00`,L.push({key:"asOf",label:"流年基准",value:y.asOf,display:`${l} 年`})}else/(出生|生年)/.test(b)&&/(19|20)\d{2}\s*年/.test(b)&&T.push("出生年份没改:一句话改不出日与时辰,请直接传 datetime(如 1993-04-08T06:20)");for(const l of J)if(l.re.test(b)){y.direction=l.key,L.push({key:"direction",label:"询问方向",value:l.key,display:l.label});break}return/解读|详解|详细说|说人话/.test(b)&&!/不要解读|不用解读|别解读/.test(b)&&(y.withInterpret=!0,L.push({key:"withInterpret",label:"解读",value:!0,display:"附解析与详解"})),{text:b,patch:y,labels:L,ignored:T}}const q=R,A=J;function P(z,b){if(b==null)return null;if(z==="system"){const y=R.find(L=>L.key===b);return y?y.label:String(b)}if(z==="gender")return b==="female"?"女":b==="male"?"男":String(b);if(z==="direction"){const y=J.find(L=>L.key===b);return y?y.label:String(b)}if(typeof b=="boolean")return b?"开":"关";if(z==="asOf"){const y=String(b).match(/^(\d{4})/);return y?`${y[1]} 年`:String(b)}return String(b)}return{parseRevision:F,REVISE_SYSTEMS:q,REVISE_DIRECTIONS:A,displayValue:P}})(),D.handle=(function(){const{fail:R}=D.fail||{},J="mc1.",W=new Set(["handle","trace","shadow","shadowVersion","diff","withInterpret","detail","cross","verifyPast","rectify","events","ask","followup","question","geocode","caliber","geo","longitudeFromGeo","revise"]),K=d=>d!==null&&typeof d=="object"&&!Array.isArray(d);function F(d){if(Array.isArray(d))return`[${d.map(g=>F(g===void 0?null:g)).join(",")}]`;if(K(d))return`{${Object.keys(d).filter(N=>d[N]!==void 0).sort().map(N=>`${JSON.stringify(N)}:${F(d[N])}`).join(",")}}`;const h=JSON.stringify(d===void 0?null:d);return h===void 0?"null":h}function q(d){let h=2166136261;for(let g=0;g<d.length;g++)h^=d.charCodeAt(g),h=Math.imul(h,16777619)>>>0;return h.toString(16).padStart(8,"0")}const A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function P(d){const h=[];for(const g of String(d)){let N=g.codePointAt(0);N<128?h.push(N):N<2048?h.push(192|N>>6,128|N&63):N<65536?h.push(224|N>>12,128|N>>6&63,128|N&63):h.push(240|N>>18,128|N>>12&63,128|N>>6&63,128|N&63)}return h}function z(d){let h="";for(let g=0;g<d.length;){const N=d[g];let _,M;N<128?(_=N,M=1):N<224?(_=N&31,M=2):N<240?(_=N&15,M=3):(_=N&7,M=4);for(let B=1;B<M;B++)_=_<<6|d[g+B]&63;g+=M,h+=String.fromCodePoint(_)}return h}function b(d){const h=P(d);let g="";for(let N=0;N<h.length;N+=3){const _=h[N],M=h[N+1],B=h[N+2];if(g+=A[_>>2],g+=A[(_&3)<<4|(M===void 0?0:M)>>4],M===void 0||(g+=A[(M&15)<<2|(B===void 0?0:B)>>6],B===void 0))break;g+=A[B&63]}return g}function y(d){const h=[];let g=0,N=0;for(const _ of d){const M=A.indexOf(_);if(M<0)throw new Error(`不是 base64url 字符:${_}`);g=g<<6|M,N+=6,N>=8&&(N-=8,h.push(g>>N&255))}return z(h)}function L(d={}){const h={};for(const[g,N]of Object.entries(d||{}))W.has(g)||N===void 0||(h[g]=N);return h}function T(d={}){const h=L(d);if(!Object.keys(h).length)return"";const g=b(F(h));return`${J}${g}.${q(g)}`}function s(d){if(typeof d!="string"||!d.trim())throw R("E_HANDLE","handle 必须是非空字符串;没拿到句柄时照常传 system + datetime 等原始参数即可");const h=d.trim();if(!h.startsWith(J))throw R("E_HANDLE",`handle 前缀不对(应以 ${J} 开头):句柄来自旧版本或复制不全,重新排一次盘取新的 handle`);const g=h.slice(J.length),N=g.lastIndexOf(".");if(N<=0)throw R("E_HANDLE","handle 缺少校验位:复制时可能被截断,重新取一次");const _=g.slice(0,N),M=g.slice(N+1);if(q(_)!==M)throw R("E_HANDLE","handle 校验不通过:内容被改动或截断,重新排一次盘取新的 handle");let B;try{B=JSON.parse(y(_))}catch{throw R("E_HANDLE","handle 内容无法解析(不是本插件生成的句柄),重新排一次盘取新的 handle")}if(!K(B))throw R("E_HANDLE","handle 内容不是参数对象,重新排一次盘取新的 handle");return B}const u=new Set(["__proto__","constructor","prototype"]),l={hour:["chenggu","xiaoliuren","name"],minute:["name"],date:["xiaoliuren"],mode:["convert","meihua","xiaoliuren"],action:["fengshui","name"]};function O(d,h){if(!K(d))return d;const g=d.system;if(typeof g!="string"||!g)return d;for(const[N,_]of Object.entries(l))h.has(N)||d[N]===void 0||_.includes(g)||delete d[N];return d}function x(...d){const h=new Set;for(const g of d)if(K(g))for(const[N,_]of Object.entries(g))_!==void 0&&N!=="handle"&&h.add(N);return h}function $(d={}){if(!K(d))return d;const{handle:h,...g}=d;if(h==null||h==="")return{...g};const _={...s(h)};for(const[M,B]of Object.entries(g))B===void 0||u.has(M)||(_[M]=B);return O(_,x(g)),_}return{handlePayload:L,encodeHandle:T,decodeHandle:s,pruneForeignKeys:O,ownedKeys:x,resolveHandle:$,HANDLE_PREFIX:J,handleChecksum:q}})(),D.bridge=(function(){const{encodeHandle:R,decodeHandle:J,HANDLE_PREFIX:W}=D.handle||{},{askPrompt:K}=D.followup||{},F=200,q=60,A={bazi:"八字",ziwei:"紫微",liuyao:"六爻",meihua:"梅花",daliuren:"大六壬",qimen:"奇门",hepan:"合盘",tarot:"塔罗",almanac:"黄历",zeri:"择日",chenggu:"称骨",xiaoliuren:"小六壬",star:"星座",numerology:"生命数字",mbti:"人格",trend:"人生K线",fengshui:"风水",name:"起名",convert:"农历",constitution:"体质",wuyunliuqi:"运气",taiyi:"太乙"},P=$=>A[$]||$||"未知体系";function z($){const w=String($||""),o=w.indexOf("#");return o<0?w:w.slice(0,o)}function b($){try{return encodeURIComponent($)}catch{return""}}function y($){try{return decodeURIComponent($)}catch{return String($||"")}}function L($={},w={}){const o=w||{},h=String(o.handle||$&&$.handle||"").trim()||R($||{});if(!h||!h.startsWith(W))return"";const g=String(o.question||"").trim().slice(0,F),N=[`mp=${h}`];return g&&N.push(`q=${b(g)}`),`${z(o.base)}#${N.join("&")}`}function T($){const w=String($||"").trim();if(!w)return{ok:!1,code:"E_LINK",message:"没有链接内容:请粘贴带 #mp= 的完整链接"};let o="";const d=w.indexOf("#");if(d>=0&&w.slice(d+1).trim())o=w.slice(d+1).trim();else{const _=w.indexOf("?");_>=0&&w.slice(_+1).trim()?o=w.slice(_+1).trim():/^mp=/.test(w)&&(o=w)}if(!o)return{ok:!1,code:"E_LINK",message:"链接里没有 #mp= 片段:这不是本插件生成的深链"};const h={};for(const _ of o.split("&")){if(!_)continue;const M=_.indexOf("=");if(M<=0)continue;const B=_.slice(0,M),se=_.slice(M+1);B==="mp"?h.mp=se:B==="q"&&(h.q=se)}if(!h.mp)return{ok:!1,code:"E_LINK",message:"链接里没有 mp 参数(只有问题没有盘):无法还原盘面"};let g;try{g=J(h.mp)}catch(_){return{ok:!1,code:_&&_.code||"E_HANDLE",message:_&&_.message||"句柄无法解析"}}const N=h.q?y(h.q).slice(0,F):"";return{ok:!0,handle:h.mp,args:g,question:N,system:g.system||"",label:P(g.system)}}const s=$=>{const w=/^(\d{4}-\d{1,2}-\d{1,2})[T ](\d{1,2}:\d{2})/.exec(String($||"").trim());if(!w)return{date:"",time:""};const[o,d,h]=w[1].split("-");return{date:`${o}-${String(d).padStart(2,"0")}-${String(h).padStart(2,"0")}`,time:w[2].padStart(5,"0")}},u=["gender","address","trueSolar","lateZi","lines"];function l($){const w=$&&$.ok?$:null,o=w&&w.args||{},d=s(o.datetime),h={tab:o.system||"",date:d.date,time:d.time,question:w&&w.question||"",restored:[],rest:{}};h.tab&&h.restored.push("system"),d.date&&h.restored.push("datetime");for(const g of u)o[g]===void 0||o[g]===null||(h[g]=o[g],h.restored.push(g));h.question&&h.restored.push("question");for(const[g,N]of Object.entries(o))g==="system"||g==="datetime"||u.includes(g)||(h.rest[g]=N);return h}function O($){const w=Object.keys($&&$.rest||{});return w.length?`链接里还有 ${w.length} 项没填回表单(${w.join("、")}):这些只在引擎调用里生效,页面上按默认值显示。`:""}function x($,w={}){const o=w||{},d=$||{},h=d.system||"",g=P(h),N=String(o.question||"").trim(),_=String(d.handle||"").trim();let M="";try{const we=K(d,{question:N,interpret:o.interpret});M=we&&we.text||String(d.summary||"")}catch{M=String(d.summary||"")}const B=N?N.length>q?`${N.slice(0,q)}…`:N:"(未填问题:按摘要讲主线)",se=_?`【命理追问】${g}|${_}|问:${B}`:`【命理追问】${g}|问:${B}`,H={};_&&(H.handle=_),h&&(H.system=h),N&&(H.question=N);const pe=JSON.stringify({tool:"metaphysics",v:1,args:H},null,2),be=_?L({handle:_},{question:N,base:o.base}):"";return{system:h,label:g,handle:_,question:N,full:M,brief:se,structured:pe,link:be}}return{LINK_MAX_QUESTION:F,askLink:L,parseAskLink:T,formOf:l,restNote:O,askPackages:x}})(),D["plain-summary"]=(function(){const{ASK_KINDS:R}=D["event-prompt"]||{},{PALACE_FIELD:J,GATE_MEANING:W}=D["qimen-prompt"]||{},K=R||{},F=J||{},q=W||{},A={wealth:"business",career:"career",love:"love",health:"other",study:"career",travel:"action",general:"other"},P=i=>A[i]||(K[i]?i:"other"),z={木:{color:"青、绿",where:"东边、有树有水的地方",daily:"早上多出门走走"},火:{color:"红、橙、紫",where:"南边、向阳的房间",daily:"白天多晒太阳,别总待在阴冷的屋里"},土:{color:"黄、棕、米色",where:"中原地带、干爽高燥处",daily:"把作息和吃饭时间固定下来"},金:{color:"白、银、浅灰",where:"西边、通风利落的地方",daily:"把该断的事断干净,别拖"},水:{color:"黑、深蓝",where:"北边、临水处",daily:"留出独处和放空的时间"}},b={正印:"靠吸收和消化来获得安全感,习惯先想明白再动",偏印:"想得比说得多,一件事会在心里推演出很多种可能",正官:"对规矩和责任敏感,别人一句交代会变成自己的压力",七杀:"对压力和竞争敏感,遇强则强,也容易被强势的人吸引",正财:"对现实条件敏感,不太会被空话打动",偏财:"对机会敏感,愿意为看得见的回报承担风险",食神:"表达温和,喜欢把日子过得有滋味",伤官:"有自己的标准,看不上粗糙的东西,容易先挑毛病",比肩:"自我边界清楚,不太愿意被安排",劫财:"同辈之间容易较劲,也容易替朋友出头"},y={长生:"刚起步,有生机",沐浴:"不安定,容易被外界牵动",冠带:"在成形,开始要面子",临官:"正当力,能扛事",帝旺:"很足,但也容易过满",衰:"开始收力,做事偏保守",病:"使不上劲,需要借外力",死:"静态,不爱主动",墓:"收着、藏着,不爱外露",绝:"在这里使不上劲,容易觉得被压着",胎:"还在孕育,慢热",养:"在积攒,等时机"},L={紫微:"要主导、在意体面",天机:"脑子转得快,爱盘算",太阳:"愿意给出去,也容易被消耗",武曲:"务实,认结果",天同:"图安稳,怕冲突",廉贞:"要强,情绪起伏大",天府:"稳,能存住东西",太阴:"细腻,心思藏在里面",贪狼:"欲望强、多才多艺",巨门:"爱辨析,也容易生口舌",天相:"会配合,擅长讲和",天梁:"老成,愿意护着别人",七杀:"独断,敢冲",破军:"破旧立新,不安于现状"},T={庙:"得力",旺:"得力",得地:"还算得力",平:"一般",陷:"不太稳"},s=i=>[...new Set(i.filter(Boolean))],u={寅:"初春",卯:"仲春",辰:"暮春",巳:"初夏",午:"盛夏",未:"长夏",申:"初秋",酉:"仲秋",戌:"深秋",亥:"初冬",子:"仲冬",丑:"隆冬"};function l(i,m){const C={po:[],chong:[],he:[]};for(const v of i&&i.branches||[])!m||!String(v).includes(m)||(/破/.test(v)?C.po.push(v):/冲/.test(v)?C.chong.push(v):/合/.test(v)&&C.he.push(v));return C}function O(i){const m=i.pillars||{},C=m.day||{},v=m.month||{},f=i.dayMaster||{},S=i.climate||{},k=i.input&&i.input.gender||"female",Y=Object.entries(i.frame&&i.frame.godStats&&i.frame.godStats.groups||{}).filter(([,he])=>he>0).sort((he,Me)=>Me[1]-he[1]),U=i.frame&&i.frame.yongshen&&i.frame.yongshen.favorTenGods||[],Q=i.frame&&i.frame.yongshen&&i.frame.yongshen.favor||[],te=i.frame&&i.frame.yongshen&&i.frame.yongshen.avoid||[],re=u[v.branch]||`${v.branch}月`,Z=S.label==="寒湿"?"天寒水旺,木像冬天的藤,不是不强,是冷得伸展不开":S.label==="燥热"?"火土偏燥,像久旱的地,需要水和湿气来松一松":"寒暖相对均衡,没有极端的偏枯",ce=S.need&&S.need.element||Q[0]||"",ue=i.frame&&i.frame.caiKu||null,$e=ue?ue.present?ue.opened&&ue.verdict==="开库主发"?`财有库(${ue.store}),而且库门被${ue.opener}冲开了:钱是能进来的,关键在于你肯不肯把它存住。`:ue.opened&&ue.verdict==="开库反主破财"?`财有库(${ue.store})也被冲开了,但这一行在你这盘上是忌:动得越多漏得越快,稳比冲重要。`:ue.opened?`财有库(${ue.store}),库门也开了,但财本身不算厚:有得有失,别指望一次翻身。`:`财有库(${ue.store}),门还关着:不是没有,是要等对的时间或对的选择把它引出来。`:"财这一路没有立库,赚多少看明面上的财星与行运,不靠「开库」这一说。":"",je=`${f.stem||""}${f.element||""}日主,生在${re}${v.branch||""}月:${Z}。${ce?`最需要的是${ce}${S.need&&S.need.why?`——${S.need.why}`:""}。`:""}整体${i.strength?i.strength.level:"中和"},不是极旺也不是极弱,所以${i.strength&&i.strength.level==="身弱"?"很多事要靠外部条件配合,硬扛不如借力":"撑得住,关键是别把力气用在错的地方"}。`+$e,ne=Y.slice(0,2).map(([he])=>he),me=[];for(const he of Object.values(m))he&&(he.stemTenGod&&me.push(he.stemTenGod),he.hidden&&he.hidden[0]&&he.hidden[0].tenGod&&me.push(he.hidden[0].tenGod));const ve=`${ne.map(he=>{const Me={印:["正印","偏印"],官杀:["正官","七杀"],食伤:["食神","伤官"],财:["正财","偏财"],比劫:["比肩","劫财"]}[he]||[],Ie=Me.find(De=>me.includes(De))||Me[0];return Ie&&b[Ie]?`${he}偏重:${b[Ie]}。`:""}).filter(Boolean).join("")}${U.length,""}`+(ne.includes("印")?"想得多是你的默认状态,好处是稳,代价是慢和累。":""),Ue=k==="female"?["正官","七杀"]:["正财","偏财"],Ye=k==="female"?"官杀(正官与七杀)":"财星(正财与偏财)",Ze={year:"年干",month:"月干",day:"日干",hour:"时干"},_e=Object.entries(m).filter(([,he])=>he&&Ue.includes(he.stemTenGod)).map(([he,Me])=>`${Ze[he]}${Me.stemTenGod}`),Oe=C.hidden&&C.hidden[0]&&C.hidden[0].tenGod||"",Se=l(i.relations,C.branch),Ne=[];Ne.push(`${k==="female"?"女命":"男命"}看配偶星取${Ye}${_e.length?`,${_e.join("、")}`:",盘中未透干"}${_e.length?"——摆在明处,说明这件事在你生活里是绕不开的主题":"——不显在明处,往往要靠后天遇到的人把它带出来"}。`),Oe&&Ne.push(`日支(配偶宫)坐${C.branch}${Oe}${C.dishi?`,日主在这里是「${C.dishi}」:${y[C.dishi]||""}`:""}。`),Se.po.length&&Ne.push(`日支与另一支相破(${Se.po.join("、")}):破不是吵架,是那种说不清、解释不明白的暗耗,容易冷处理。`),Se.chong.length&&Ne.push(`日支逢冲(${Se.chong.join("、")}):关系里变动感强,聚散、异地、节奏不一致都可能出现。`),Se.he.length&&Ne.push(`日支有合(${Se.he.join("、")}):容易被关系拴住,进去了就不太想出来。`),i.hourUnknown&&Ne.push("时柱暂缺,所以「子女」这一路的信息读不出,感情结论也就少了三分之一。");const Pe=(i.frame&&i.frame.geju||[]).map(he=>he.name),xe=[];Se.po.length&&xe.push("破在日支:最伤人的往往不是大事,是没说开的小事。"),Pe.includes("伤官见官")&&xe.push("盘里有「伤官见官」的组合:既想要稳定,又忍不了对方的毛病,这是同一件事的两面。"),ne.includes("印")&&!ne.includes("财")&&xe.push("印重而财轻:想得多、落得少;越焦虑越容易继续想。"),xe.length||xe.push("这一盘没有特别尖锐的冲克,卡点更多在「节奏」上——什么时候该动,什么时候该停。");const qe=[];if(ce&&z[ce]){const he=z[ce];qe.push(`多接触${ce}:${he.color}这类颜色、${he.where},日常可以${he.daily}。`)}te.length&&qe.push(`少把自己放在${te.slice(0,2).join("、")}过重的环境里——不是不能碰,是别长期待在那种氛围中。`),ne.includes("印")&&qe.push("给「想」设个时限:一件事想超过十分钟还没结论,就先做一个最小动作,用行动换信息。"),Pe.includes("伤官见官")&&qe.push("把标准用在事情上,不要用在人身上;对人提要求之前,先说清你需要什么。");const ze=i.frame&&i.frame.balance||null;if(ze){const he=[];ze.wuxing.ok||he.push(`五行偏在${ze.wuxing.highest}、缺在${ze.wuxing.lowest}`),ze.yinyang.ok||he.push(ze.yinyang.pure?`${ze.yinyang.pure}之局`:`阴阳一边倒(阳 ${ze.yinyang.yang}/阴 ${ze.yinyang.yin})`),ze.climate.ok||he.push(`寒暖燥湿没调匀(${ze.climate.kind})`),qe.push(he.length?`结构上${he.join("、")}:不必去「补命」,把这几处当作长期要照看的方向就行。`:"五行、阴阳、寒暖燥湿三方面都还匀:这种盘最忌讳的是为了「更好」而硬改节奏,稳住就是优势。")}return{system:"bazi",title:"先看这一张:这张盘大致在说什么",chips:s([`${f.stem||""}${f.element||""}日主`,`${v.branch||""}月`,S.label||"",i.strength?i.strength.level:"",i.hourUnknown?"时柱暂缺":""]),lead:je,sections:[{h:"你的底色",t:ve||"结构比较均衡,没有一边倒的偏重。"},{h:"感情这件事",t:Ne.join("")},{h:"最容易卡住的地方",t:xe.join("")}],advice:qe,caveat:i.hourUnknown?"时柱暂缺:以上只据年、月、日六个字,等于全盘信息的七成左右。子女缘分、晚年走势、以及「内心最深处那一层」都读不全,结论只作参考。":"",footer:"以上都是对结构的描述,不是断语;判断好坏要结合你自己的处境。"}}function x(i){const m=i.palaces||[],C=m[0]||{},v=i.body||{},f=(C.stars||[]).filter(ne=>ne.type==="主星"),S=m.find(ne=>ne.isBody)||{},k=m.find(ne=>ne.palace==="夫妻")||{},Y=f.map(ne=>ne.name).join("、")||"空宫(借对宫)",U=f.map(ne=>T[ne.brightness]||"").filter(Boolean)[0]||"",Q=ne=>ne.filter(me=>me.type==="主星").map(me=>`${me.name}${L[me.name]?`(${L[me.name]})`:""}`).join(";"),te=i.patternSummary||{},re=s(te.broken||[]),Z=s(te.bad||[]),ce=s([...te.good||[],...te.neutral||[]]).filter(ne=>!re.includes(ne)),ue=k.stars||[],$e=ue.filter(ne=>ne.type==="主星"),je=ue.filter(ne=>ne.type==="煞星");return{system:"ziwei",title:"先看这一张:这张盘大致在说什么",chips:s([`命宫在${C.branch||""}`,Y,i.bureau?i.bureau.name:"",v.lands?`身宫落${v.lands}`:""]),lead:`命宫在${C.branch||""},坐${Y}${U?`(${U})`:""};身宫落在${v.lands||v.palace||"—"}。${f.length?`底色是${f.map(ne=>L[ne.name]||ne.name).join("、")}。`:"命宫无主星,性格更多由对宫与三方决定,可塑性反而大。"}${ce.length?`结构上成的是${ce.slice(0,3).join("、")}——格局只说明形状,不是吉凶判词。`:"没有完整成套的格局,这一盘更多看单颗星的性质,少看组合。"}`,sections:[{h:"你的底色",t:`${Q(C.stars||[])||"命宫无主星,靠三方四正补"}。身宫落${v.lands||"—"},说明你这辈子真正花力气的地方在${v.lands||"那一块"}。`},{h:"感情这件事",t:`夫妻宫在${k.branch||"—"},坐${$e.map(ne=>`${ne.name}${ne.brightness?`(${T[ne.brightness]||ne.brightness})`:""}`).join("、")||"空宫(借对宫)"}。${je.length?`同宫还有${je.map(ne=>ne.name).join("、")}——关系里容易起摩擦,来得快也去得快。`:"没有明显的煞星同宫,关系相对平顺。"}`},{h:"最容易卡住的地方",t:`${re.length?`被冲破的格局有${re.join("、")}——结构还在,但成色打折;冲不等于毁,说的是它不如完好时那么顶用。`:"主要格局没有明显被冲破。"}${Z.length?`另有${Z.join("、")}这类忌格,只描述结构,不作吉凶断。`:""}`}],advice:[`命宫主星${f.length?`是${f.map(ne=>ne.name).join("、")},顺它的长处在做事,比硬改性格省力`:"不显,先靠环境和习惯替自己定节奏"}。`,`身宫落${v.lands||"—"}:这块是你真正在意的地方,也是容易耗人的地方,留出余量。`],caveat:"",footer:"以上都是对结构的描述,不是断语;判断好坏要结合你自己的处境。"}}const $={旺:"当令,气最足",相:"有生机,正在起",休:"气在泄,歇着",囚:"被压着,使不上劲",死:"最弱,得靠外援"},w={官鬼:"职位、压力、管你的人和事",妻财:"钱、资源、实际回报",父母:"文书、答复、流程与长辈",子孙:"结果本身、松弛、把事情落地",兄弟:"同辈、分利、竞争"},o={日生:"日辰生它,当天有人托着",日克:"日辰克它,当天被压一头",比和:"与日辰同气,力量相当",日合:"与日辰相合,黏住了",日冲:"与日辰相冲,当天就动"};function d(i){if(!i)return"";const m=[],C=$[i.monthState]||i.monthSay||"";C&&m.push(`月令${i.monthState||""}(${C})`);const v=o[i.dayRelation]||i.daySay||"";return v&&m.push(v),i.kong&&m.push("旬空——抓不实,等冲或填"),i.moving&&m.push("发动,是这件事的动因"),i.monthChong&&m.push("月破,先破后立"),m.join(";")}function h(i){const m=i.hexStrength&&i.hexStrength.lines||[];if(!m.length)return null;const C=m.find(ce=>ce.shi)||null,v=m.find(ce=>ce.ying)||null,f=i.body||{},S=f.ben||{},k=f.bian||{},Y=i.cast&&i.cast.movingPositions||[],U=m.filter(ce=>ce.moving),Q=String(i.question||"").trim(),te=s([...f.labels||[],...i.hexStrength&&i.hexStrength.labels||[]]),re=i.hexStrength&&i.hexStrength.month?i.hexStrength.month.branch:"",Z=[S.chong?"六冲卦:事情容易散、节奏快":"",S.he?"六合卦:事情黏住、快不起来":"",f.fuYin&&(f.fuYin.inner||f.fuYin.outer)?"有伏吟:原地打转":"",f.fanYin&&(f.fanYin.inner||f.fanYin.outer)?"有反吟:来回反复":""].filter(Boolean);return{system:"liuyao",title:"先看这一卦:这卦大致在说什么",chips:s([S.name,k.name?`变${k.name}`:"",Y.length?`${Y.length} 爻动`:"静卦",re?`${re}月`:""]),lead:`${Q?`你问的是「${Q}」。`:""}本卦「${S.name||"—"}」${k.name?`,${Y.length?`第 ${Y.join("、")} 爻动`:"六爻安静"},变「${k.name}」`:""}。方向还留在「综合」,所以这一卦没有取用神——先只讲与问题无关的那几样:你(世爻)、事情(应爻)、卦体。`,sections:[{h:"代表你的是",t:C?`世爻在${C.name}(${C.branch}${C.element}·${C.liuqin}):${d(C)||"状态平稳"}。`:"这一卦取不到世爻。"},{h:"代表事情的是",t:v?`应爻在${v.name}(${v.branch}${v.element}·${v.liuqin}):${d(v)||"状态平稳"}。应爻说的是「事情那一头」的状态,不是你努力的程度。`:"这一卦取不到应爻。"},{h:"卦体与动爻",t:`${Z.length?`${Z.join(";")}。`:"没有六冲、六合、伏吟、反吟这类整体结构。"}${U.length?`动爻在${U.map(ce=>`${ce.name}(${ce.liuqin})`).join("、")}——动的地方,就是这件事会发生变化的那一环。`:"六爻安静:眼下没有明显在动的地方,说明事情的节奏还没起来。"}`}],advice:["先在上面选一个「询问方向」(工作、感情、生意、推进、择日):选完才会取用神,旺衰、应期、成败条件才有落点。",...(K.other&&K.other.reality||[]).slice(0,2)].filter(Boolean),caveat:"未指定所问之事:这一版只读世应、卦体与动爻,不判成败,也不给应期——不是算不出来,是取用神要先知道问什么。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function g(i){const m=i.useGod||{};if(!m.liuqin)return h(i);const C=m.found||[];if(!C.length&&!m.missing)return null;const v=String(i.question||"").trim(),f=i.useGodStrength&&i.useGodStrength.lines||[],S=ne=>f.find(me=>me.position===ne)||null,Y=(i.hexStrength&&i.hexStrength.lines||[]).find(ne=>ne.shi)||null,U=i.useGodStrength&&i.useGodStrength.month?i.useGodStrength.month.branch:"",Q=i.dayGanZhi&&i.dayGanZhi.name||"",te=C.map(ne=>ne.name).join("、"),re=`${v?`你问的是「${v}」。`:"你没填具体问题,这里按「综合」取用神,结论会更粗。"}这卦里代表它的是「${m.liuqin}」(${m.ask||""}),`+(C.length?`落在${te}${C.length>1?"——两处都出现了,两个条件要一起看":""}。`:"盘中看不见它(伏藏),要等冲开或引出才有动静。")+`日辰是${Q||"—"},月建是${U||"—"}。`,Z=[],ce=[];for(const ne of C){const me=S(ne.position);me&&(/旺|相/.test(me.monthState||"")&&!me.kong&&!me.monthChong&&Z.push(ne.name),(/日克|日冲/.test(me.dayRelation||"")||me.kong||me.monthChong)&&ce.push(ne.name))}const ue=C.length?Z.length>ce.length?"条件偏有利":ce.length>Z.length?"条件偏紧,得有外力或时间":"一半一半,取决于你怎么推":"没有可判的落点",$e=s([...(m.labels||[]).filter(ne=>/两现|伏藏|六合|六冲/.test(ne)),i.body&&i.body.ben&&i.body.ben.chong?"六冲卦:事情容易散,节奏偏快":"",i.body&&i.body.ben&&i.body.ben.he?"六合卦:事情黏住,快不起来":""]),je=s((i.yingqi&&i.yingqi.items||[]).map(ne=>ne.branch)).slice(0,4);return{system:"liuyao",title:"先看这一卦:这卦大致在说什么",chips:s([i.ben&&i.ben.name,`用神 ${m.liuqin||""}`,U?`${U}月`:"",i.yingqi?i.yingqi.tempo:""]),lead:re,sections:[{h:"代表你的是",t:Y?`世爻在${Y.name}(${Y.branch}${Y.element}·${Y.liuqin}):${d(Y)||"状态平稳"}。`:"这一卦的世爻取不到,先看用神那一条。"},{h:"代表这件事的是",t:C.length?C.map(ne=>`${ne.name} ${ne.ganzhi}(${ne.liuqin}):${d(S(ne.position))||"没有明显的月日冲克"}。`).join(""):"用神伏藏:盘中看不见它,说明这件事现在还不在明面上,要等一个引子。"},{h:"成不成看哪里",t:`把用神的月令与日辰放在一起,盘面给的是「${ue}」。${$e.length?`另有:${$e.join(";")}。`:""}`}],advice:[...(K[P(m.direction)]&&K[P(m.direction)].reality||[]).slice(0,2),je.length?`应期只看地支:${je.join("、")}——地支只是「往哪个方向等」,不是公历日期。`:""].filter(Boolean),caveat:s([C.length>1?`用神两现(${te}):本插件不替你二选一,两处条件一起看。`:"",m.missing?"用神伏藏:先看伏神与飞神的关系,再看有没有东西把它冲出来。":"","世应只说明「你」和「事」的相对位置,不直接等于吉凶。"]).join(""),footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function N(i){const m=i.bodyUse;if(!m||!m.body||!m.use)return null;const C=String(i.question||"").trim();return{system:"meihua",title:"先看这一卦:方向大致在哪",chips:s([i.ben&&i.ben.name,i.bian&&`变${i.bian.name}`,m.relation?`体用 ${m.relation.split("(")[0]}`:""]),lead:`${C?`你问的是「${C}」。`:""}本卦「${i.ben&&i.ben.name}」,动在第 ${i.moving} 爻,变卦「${i.bian&&i.bian.name}」。体卦 ${m.body.trigram}(${m.body.element})代表你,用卦 ${m.use.trigram}(${m.use.element})代表这件事:${m.relation}。`,sections:[{h:"过程与结果",t:`过程看互卦「${i.hu&&i.hu.name||"—"}」,结果看变卦「${i.bian&&i.bian.name||"—"}」。梅花给的是方向,不是细节——它不会告诉你几号、多少钱。`},{h:"盘面给的分量",t:`这一卦的体用关系被标成「${m.level}」。注意:这是条件层面的判断,不是结果已经发生;条件好但不动,一样没有结果。`}],advice:["把它当「换个角度看这件事」:体用只分「谁在给、谁在耗」,剩下要你自己补具体动作。","如果要推进,先定一个最小动作(打个电话、发条消息),别等条件齐了再动。"],caveat:"梅花取象的自由度大:同一卦,不同人读出的细节可以不同。本插件只取体用生克这一层。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function _(i){const m=i.sanChuan||{};if(!m.chu||!m.zhong||!m.mo)return null;const C=String(i.question||"").trim(),v=S=>`${S.zhi}(${S.liuQin||""}·${S.jiangFull||""})`,f=S=>w[S.liuQin]?`——${w[S.liuQin]}`:"";return{system:"daliuren",title:"先看这一课:事情怎么走到这一步",chips:s([i.geJu&&i.geJu.name,`${m.chu.zhi}→${m.mo.zhi}`,i.yueJiang&&`月将${i.yueJiang.zhi}`]),lead:`${C?`你问的是「${C}」。`:""}三传是 ${m.chu.zhi} → ${m.zhong.zhi} → ${m.mo.zhi};末传落 ${m.mo.zhi}(${m.mo.liuQin||""}·${m.mo.jiangFull||""}),课体是「${i.geJu&&i.geJu.name||"—"}」。`,sections:[{h:"起手(初传)",t:`${v(m.chu)}${f(m.chu)}。这是事情开头的样子。`},{h:"转折(中传)",t:`${v(m.zhong)}${f(m.zhong)}。中间会经过这一段,也是容易改道的地方。`},{h:"落点(末传)",t:`${v(m.mo)}${f(m.mo)}。末传比初传更接近结果——但也只是「照现在这样走下去会到哪」。`}],advice:["先看初传:事情是从哪儿起的?把那个起点找出来,比猜结果有用。","中传若与初传相冲相克,说明中途会变;这时别把计划定死。"],caveat:"三传讲的是传变形态,不给具体日期;同一课不同流派对课体的命名也有差异。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function M(i){const m=i.siZhu&&i.siZhu.day?String(i.siZhu.day)[0]:"",C=i.siZhu&&i.siZhu.time?String(i.siZhu.time)[0]:"",v=i.palaces||[];if(!v.length)return null;const f=Z=>v.find(ce=>ce.tianPan===Z)||(i.centerPalace&&i.centerPalace.tianPan===Z?i.centerPalace:null),S=f(m),k=f(C),Y=String(i.question||"").trim(),U=Z=>{const ce=Z&&F[Z.palace]&&F[Z.palace].field;return ce?ce.split(":")[0]:Z?`${Z.palace}宫`:"盘中取不到"},Q=Z=>Z&&F[Z.palace]&&F[Z.palace].dir?`(${F[Z.palace].dir})`:"",te=Z=>Z?`${U(Z)}${Q(Z)}|${Z.gate||"—"}·${Z.star||"—"}·${Z.god||"—"}`:"盘中取不到",re=Z=>!Z||!Z.gateRelation||!Z.gateRelation.type?"门与宫的关系没算到":`${Z.gateRelation.type}(${Z.gateRelation.note||""})`;return{system:"qimen",title:"先看这一局:条件和位置在哪",chips:s([i.ju,i.zhiFu&&`值符${i.zhiFu.star}`]),lead:`${Y?`你问的是「${Y}」。`:""}日干 ${m} 落在${te(S)},时干 ${C} 落在${te(k)}——前者代表你,后者代表这件事。你这边门与宫是${re(S)};事情那边是${re(k)}。`,sections:[{h:"你这边的条件",t:S?`你在${F[S.palace]?F[S.palace].field:S.palace+"宫"};门是${S.gate||"—"}——${q[S.gate]||"门名只说明形态"}。`:"日干落在中宫或取不到:中宫无门无神,按寄宫(多寄坤二)取用,读的时候要说清这是寄宫。"},{h:"事情那边的条件",t:k?`事情落在${F[k.palace]?F[k.palace].field:k.palace+"宫"};门是${k.gate||"—"}——${q[k.gate]||"门名只说明形态"}。`:"时干落在中宫或取不到,同样按寄宫看,别当成坤二本宫。"},{h:"门名不是吉凶",t:"开门主启动、生门主生长、休门主等待、伤门主损耗、杜门主隐藏——这些说的是「这件事现在是什么形态」,不是好坏判决。要看它与日干宫、时干宫的生克。"}],advice:["把「我这边」和「事情那边」的宫位对一下:两边相距越远,越需要中间人、流程或时间。","如果门名是伤门、死门,不是叫你别做,而是提醒这件事的代价和收尾要先想清楚。"],caveat:s([i.juMethodNote||"","奇门重方位与时机;本插件不给具体方位建议,只把宫位与门星神摊开。"]).join(""),footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function B(i){const m=i.cards||[];if(!m.length)return null;const C=String(i.question||"").trim(),v=m.find(f=>/现在|现况|当下|建议|核心/.test(f.position||""))||m[Math.floor(m.length/2)];return{system:"tarot",title:"先看这几张牌:它们各在说什么",chips:s([i.spread]),lead:`${C?`你问的是「${C}」。`:""}${i.spread||""}:`+m.map(f=>`${f.position}「${f.name}」${f.orientation}`).join(",")+"。",sections:m.slice(0,4).map(f=>({h:f.position,t:`「${f.name}」${f.orientation}:${(f.keywords||[]).slice(0,3).join("、")||f.core||""}。${f.image?`牌面上${f.image}。`:""}${f.astro?`占星对应是${f.astro}。`:f.role?`它在盘上顶的是「${f.role}」那个角色。`:""}${f.positionHint||""}`})),advice:[`最值得先看的是「${v.name}」(${v.position}·${v.orientation})——${(v.keywords||[]).slice(0,3).join("、")||"它所在的位置,就是这件事现在的着力点"}。`,"把牌当镜子:它给的是看事情的角度,不是判决。看完写一句「那我下一步做什么」。"],caveat:i.systemNote||"塔罗为象征系统,牌义与元素对应存在流派差异。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function se(i){const m=i.score;if(!m)return null;const C=(i.dimensions||[]).filter(k=>k&&k.text),v=k=>{const Y=k&&k.dayMaster;return Y?typeof Y=="string"?Y.replace(/日主$/,""):`${Y.stem||""}${Y.element||""}`:""},f=v(i.a),S=v(i.b);return{system:"hepan",title:"先看这一张:你们大致怎么相处",chips:s([f&&S?`${f} × ${S}`:"",m.level,`${m.total}/100`]),lead:`${f&&S?`你们是 ${f} 与 ${S}。`:""}合盘描述的是「相处方式与互补点」,不判合不合,也不决定关系成败。整体上盘面给的是「${m.level}」(${m.total}/100——分数只是相对刻度,不是及格线)。`,sections:C.slice(0,3).map(k=>({h:k.label,t:k.text})),advice:["一起看,别一个人看完拿去判断对方:前者是对话,后者是审判。","把上面的分歧当话题清单:哪一条你们真的在意,就聊哪一条。"],caveat:i.notes&&i.notes[0]||"合盘看的是相处方式与互补点,不决定关系成败。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function H(i){const m=i.points||[],C=i.segments||[];if(!m.length||!C.length)return null;const v=Number.isInteger(i.meta&&i.meta.nowYear)?i.meta.nowYear:null,f=v&&m.find(ue=>ue.year===v)||null,S=f&&C.find(ue=>f.age>=ue.startAge&&f.age<=ue.endAge)||C[0],k=C[C.indexOf(S)+1],Y=m.filter(ue=>ue.age>=S.startAge&&ue.age<=S.endAge),U=Y.length?Y.reduce((ue,$e)=>ue+$e.score,0)/Y.length:0,Q=m.reduce((ue,$e)=>ue+$e.score,0)/m.length,te=U>=Q+5?"比一生平均更亮":U<=Q-5?"比一生平均更闷":"与一生平均差不多",re=i.highlights&&i.highlights.best||[],Z=i.highlights&&i.highlights.worst||[],ce=f?`你现在 ${f.age} 岁(${v} 年),在「${S.ganZhi}」这一步的第 ${f.age-S.startAge+1} 年(${S.startAge}–${S.endAge} 岁)${k?`,再过 ${S.endAge-f.age+1} 年到 ${k.startAge} 岁换「${k.ganZhi}」`:",已是最后一步"}。`:`没给当前日期(asOf),所以不标「现在在第几步」;先看第一步「${S.ganZhi}」(${S.startAge}–${S.endAge} 岁)起手的样子。`;return{system:"trend",title:"先看这一条线:这些年大致什么走势",chips:s([S.ganZhi,`${S.startAge}–${S.endAge} 岁`,f?`${f.age} 岁`:""]),lead:`这条线按 ${i.meta&&i.meta.toAge||m.length} 岁排到 ${m[m.length-1].year} 年,共 ${C.length} 步大运。`+ce,sections:[{h:"这一步的基调",t:`这一步里各年的平均分是 ${U.toFixed(0)},${te}(全盘平均 ${Q.toFixed(0)})。分数是相对刻度,不是绝对值。`},{h:"这些年里最亮和最闷的",t:`${re.length?`高点:${re.slice(0,2).join("、")}`:"没有特别高的点"};${Z.length?`低点:${Z.slice(0,2).join("、")}`:"没有特别低的点"}。高点适合推进,低点适合收口。`},{h:"怎么用这条线",t:"它不是命运表,是把「顺/不顺」画成可视的起伏。真正决定走向的,是你在这几步里做了什么。"}],advice:["把下一步换运的年龄记下来:换运前后半年,通常是最容易做决定、也最容易冲动的时候。","低点年别做大额投入,高点年别只观望——这两条比记分数管用。"],caveat:"线按年岁等距绘制,实际每步大运十年;起点与交运按节气推算,出生时刻未知时按日估算。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function pe(i){const m=i.taiyi,C=[{h:"太乙落在哪一宫",t:`${m.palaceName}宫(${m.dir}),这是三年里的第 ${m.yearInPalace} 年,对应「${m.li}」。太乙三年换一宫,走的是八宫、不入中五,所以在盘面上永远看不到它落在中间。`},{h:"八门这三十年",t:`${i.gate.gate}。八门三十年一转,1954 年从休门起,顺序是休、生、伤、杜、景、死、惊、开,所以一个门要值三十年,不是每年都换。`},{h:"文昌在哪",t:`文昌在${i.wenchang.pos}(${i.wenchang.god},${i.wenchang.palaceName}宫)。文昌十八年一周,阳局从申起、阴局从寅起,路上遇乾、坤各数两次,所以要数满十八步才回到原点。`},{h:"计神、始击与主客算",t:`计神在${i.jishen.branch},始击在${i.shiji.pos}(${i.shiji.god})。主算 ${i.suan.zhu}、客算 ${i.suan.ke}:大将按算数的个位落宫(整十归一),参将是大将乘三的个位。四个将分别落在${i.jiang.zhuDaName}、${i.jiang.keDaName}、${i.jiang.zhuCanName}、${i.jiang.keCanName}宫。`},{h:"定目、三基与五福",t:`定目在${i.dingmu.pos}(${i.dingmu.god}):淘金歌讲「以合神加太岁」,把合神搬到太岁处,天目跟着转过去,落点就是定目。三基——君基${i.sanji.jun}(三十年一移)、臣基${i.sanji.chen}(三年一移)、民基${i.sanji.min}(一年一移);五福在${i.wufu.palaceName}宫(四十五年一移),大游在${i.dayou.palaceName}宫(三十六年一移、逆数)。十精另五位:天乙${i.shijing.tianyi}、地乙${i.shijing.diyi}、直符${i.shijing.zhifu}、四神${i.shijing.sishen}、小游${i.shijing.xiaoyou}。`},{h:"阴阳数和",t:`主算:${i.heshu.zhu.text}客算:${i.heshu.ke.text}这一段只说「和不和」,上和、次和、下和是算数落在特定数上的分级,不据此断胜负。`},{h:"卦象吉凶",t:`${i.jixiong.label}。${i.jixiong.text}${i.jixiong.note}判据出自卷一《推太公考时法》,只标吉凶,不推成与不成。`},{h:"神将与判辞",t:(()=>{const v=i.shenjiang;if(!v||!v.rows)return"这一盘没有排神将。";const f=v.goods&&v.goods.length?"在吉神下的:"+v.goods.join("、"):"没有将落在吉神下",S=v.bads&&v.bads.length?"在凶神下的:"+v.bads.join("、"):"没有将落在凶神下",k=i.verdict?"合起来判「"+i.verdict.label+"」。":"";return"按日干起十二神("+v.stem+"日、"+(v.day?"昼贵":"夜贵")+"、贵人临"+v.startBranch+(v.dir>0?"顺":"逆")+"行),"+f+";"+S+"。"+k+"这一层是古人拿十二神看四将落位的办法,只说明古法怎么判,不是对事情的预测。"})()},{h:"这一盘算到哪一层",t:`积年 ${i.meta.jinian},残年 ${i.meta.rest360},${i.meta.dunText}${i.meta.ju}局。太乙、八门、文昌、计神、始击、主客算与四将、掩迫囚格关、定目、三基、五福、大游、十精、阴阳数和、月日时三计、古法吉凶都在;${i.scope.notCovered.join("、")}这几项没有收录,盘面上也不显示。`}];return{system:"taiyi",title:"先看这一张",chips:[`${i.meta.year}年`,`${i.meta.dunText}${i.meta.ju}局`,`${m.palaceName}宫`].filter(Boolean),lead:`${i.meta.year} 年太乙:${i.meta.dunText}${i.meta.ju}局,太乙临 ${m.palaceName} 宫(${m.dir}),八门值 ${i.gate.gate}。`,sections:C,advice:[`先看太乙落在哪:${m.palaceName}宫${m.dir},这三年的大方向就在这一格,别拿它当每年的细节来读。`,`八门十年一变的说法常被混用,这里按三十年一转的口径——${i.gate.gate}值这三十年,不是今年才轮到。`,"太乙是象数盘,给的是位置的对应关系,不是「今年会发生什么」的判决。"],caveat:`这一层到太乙、八门、文昌、计神、始击、主客算与四将、八种格局、定目、三基、五福、大游、十精与阴阳数和;${i.scope.notCovered.join(";")}都未收录,别按它们解读。`,footer:"太乙年家用积年推局,与八字按立春换年、运气按大寒分年都不同口径,三套不要互相印证。"}}function be(i){const m=[];i.special.taiYi&&m.push("太乙天符"),i.special.tianFu&&!i.special.taiYi&&m.push("天符"),i.special.suiHui&&!i.special.taiYi&&m.push("岁会"),i.special.tongTianFu&&m.push("同天符"),i.special.tongSuiHui&&m.push("同岁会");const C=[{h:"这一年的气候底色",t:i.combo.text},{h:"此刻在哪个运、哪口气",t:i.current.text},{h:"被强调的脏腑",t:`中运主${i.zhongyun.organ}:传统上这样描述——${i.zhongyun.effect.organ}。${i.zhongyun.effect.sign}`},{h:"今年常被说到的身体反应",t:`上半年(${i.sitian.qi}司天):${i.sitian.climate.sign};下半年(${i.zaiquan.qi}在泉):${i.zaiquan.climate.sign}`}];return{system:"wuyunliuqi",title:"先看这一张",chips:[`${i.year.ganzhi}年`,i.zhongyun.name,`${i.sitian.qi}司天`].filter(Boolean),lead:`${i.year.ganzhi} 运气年:中运${i.zhongyun.name},${i.sitian.qi}司天、${i.zaiquan.qi}在泉。`,sections:C,advice:[`顺着「${i.zhongyun.nature}」来调:${i.zhongyun.tai?"本气偏胜,别再加码,先把被克的那一头护住":"本气不足,别硬扛,先补本气再谈其他"}。`,`这一年偏「${i.sitian.climate.climate}」,起居上按这个方向做减法,比按季节硬套更贴。`,"运气盘给的是「今年偏什么」,不是「你会得什么病」;有具体不适看医生。"],caveat:m.length?`特殊格局:${m.join("、")}。${i.special.notes.join("")}`:"这一年在格局上没有天符、岁会那一类标记,按中运与司天在泉的常例读就好。",footer:"运气年以大寒为界,与八字按立春定年柱不同;两套口径不要互相印证。"}}function we(i){const m=i.primary,C=[];m&&(C.push({h:m.name+"是什么",t:(m.oneLine||"")+(m.trait?" "+m.trait:"")}),m.tendency&&C.push({h:"容易被影响的地方",t:m.tendency}));const v=(i.top||[]).find(f=>m&&f.name!==m.name);return v&&C.push({h:"次高的一项",t:`${v.name} ${v.converted} 分(${v.level})——它常和主质一起出现,调的时候顺手带上。`}),{system:"constitution",title:"先看这一张",chips:[m?m.name:"未判定",i.pinghe?`平和 ${i.pinghe.converted}`:"",i.meta?`${i.meta.answered}/${i.meta.total} 题`:""].filter(Boolean),lead:m?`主体质是「${m.name}」${m.level==="是"?"":`(${m.level},未完全达判定线)`},转化分 ${m.converted};平和质 ${i.pinghe?i.pinghe.converted:"—"} 分。`:"这份问卷还没答够,先别急着对号入座。",sections:C,advice:(i.care||[]).slice(0,3),caveat:i.flat?"每题都选了同一个选项,问卷对你的区分度不足——主质仅供参考,建议按最近一年的真实感受重答一遍。":"体质是长期倾向,不是病名,也不与八字、星座互证;有具体不适请就医。",footer:"打分为自评,同一个人隔一个月再答可能差一档,看趋势比看单次结果有用。"}}function oe(i){return!i||typeof i!="object"?null:i.system==="bazi"?O(i):i.system==="ziwei"?x(i):i.system==="liuyao"?g(i):i.system==="meihua"?N(i):i.system==="daliuren"?_(i):i.system==="qimen"?M(i):i.system==="tarot"?B(i):i.system==="hepan"?se(i):i.system==="trend"?H(i):i.system==="constitution"?we(i):i.system==="wuyunliuqi"?be(i):i.system==="taiyi"?pe(i):null}return{plainSummary:oe}})(),D.index=(function(){const{buildBazi:R}=D.bazi||{},{buildLiuyao:J,tossLines:W,bodyLabels:K,yongshenOf:F,yongshenStrength:q,fushenAccess:A,hexagramStrength:P,jinTuiPower:z,yingqiWindow:b}=D.liuyao||{},{buildZiwei:y,BRIGHTNESS:L,flowOf:T,asOfParts:s,ZIWEI_SCHOOL_DEFAULTS:u}=D.ziwei||{},{drawTarot:l,SPREAD_KEYS:O}=D.tarot||{},{buildMeihua:x}=D.meihua||{},{buildDaliuren:$}=D.daliuren||{},{buildHepan:w,tripleOf:o}=D.hepan||{},{buildZiweiHepan:d}=D["ziwei-hepan"]||{},{buildQimen:h,buildSnapshot:g}=D.qimen||{},{geocodeAddress:N,resolveAddress:_}=D.geo||{},{toJDN:M,ganzhiName:B,dayGanzhiIndex:se}=D.calendar||{},{bool:H,canonicalFlags:pe,canonicalNumbers:be}=D.bool||{},{randomOf:we,isSeed:oe}=D.random||{},{encodeHandle:i,decodeHandle:m,resolveHandle:C,pruneForeignKeys:v,ownedKeys:f}=D.handle||{},{askLink:S,parseAskLink:k,formOf:Y,restNote:U,askPackages:Q}=D.bridge||{},{parseRevision:te,displayValue:re}=D.revise||{},{interpret:Z,DIRECTIONS:ce,DIRECTION_DEFAULT:ue}=D.interpret||{},{followup:$e,askPrompt:je}=D.followup||{},{crossCheck:ne,crossText:me,crossSection:Re}=D.crosscheck||{},{pastSignals:ve,verifyFit:Ue}=D.verify||{},{rectifyBirth:Ye}=D.rectify||{},{buildAlmanac:Ze}=D.almanac||{},{buildZeri:_e}=D.zeri||{},{buildChenggu:Oe}=D.chenggu||{},{buildXiaoliuren:Se}=D.xiaoliuren||{},{buildStar:Ne}=D.star||{},{buildNumerology:Pe}=D.numerology||{},{buildMbti:xe,mbtiPaper:qe}=D.mbti||{},{buildConstitution:ze,constitutionPaper:he}=D.constitution||{},{buildWuyunliuqi:Me}=D.wuyunliuqi||{},{buildTaiyi:Ie}=D.taiyi||{},{buildConvert:De}=D.convert||{},{classicsFor:Fe,classicsText:Ge,suiyunClassicOf:Be,classicOf:sn,CLASSIC_BOOKS:Je}=D.classics||{},{diffObjects:rn,summarize:un,sortDiffs:ln,labelOf:cn,rootOf:hn,categoryOf:dn,formatValue:Ke,CALIBER_SWITCHES:An,viewRows:En}=D.diff||{},{canonicalJson:It,fingerprintOf:Tn}=D.fingerprint||{},{buildTrend:mn}=D.trend||{},{buildFengshui:We}=D.fengshui||{},{buildName:fn}=D.name||{},{buildTrace:$n,traceMarkdown:yn,SYSTEM_LABEL:On}=D.trace||{},{fail:le}=D.fail||{},{assertCivil:vt,MIN_YEAR:gn,MAX_YEAR:pn}=D.validate||{},{parseDateTime:fe,daysInMonth:Mn}=D.datetime||{},_t=e=>String(e).padStart(2,"0"),qn=["male","female"],In=new Set(["bazi","ziwei","hepan","trend","meihua","daliuren","qimen","name"]),vn={bazi:{what:"时柱",advice:"知道大概几点就补上,不知道就传 hourUnknown:true(只排三柱)"},ziwei:{what:"命宫与生时星曜",advice:"紫微排不出三柱,必须补上出生时刻"},hepan:{what:"两侧时柱",advice:"两侧都要出生时刻,合盘才有意义"},trend:{what:"时柱与起运",advice:"知道大概几点就补上,不知道就传 hourUnknown:true(按日估算)"},meihua:{what:"起卦时刻",advice:"时间起卦要用真实起念时刻,请补 HH:mm"},daliuren:{what:"起课时辰(月将与贵人)",advice:"请补起课时刻 HH:mm"},qimen:{what:"起局时辰(旬首与局数)",advice:"请补起局时刻 HH:mm"},name:{what:"时柱",advice:"请补出生时刻 HH:mm"}};function Le(e,t=""){if(qn.includes(e))return e;const a=e==null||e===""?"(未提供)":`「${e}」`;throw le("E_INPUT",`${t?t+"的":""}gender 必须是 male 或 female${a};性别决定大运/大限顺逆,不能靠默认值`)}const _n=["brightnessSchool","gengYearSihua","tianmaSchool","tiankongSchool","jiekongSchool","kuiyueSchool","tianshiTianshang","changshengSchool","lateZishi","shenzhuSchool","mingzhuSchool","zuoyaoSchool","liunianSihua","sihuaVariant","jieluSchool","suipoSchool"];function bn(e){const t={};for(const a of _n)e[a]!==void 0&&(t[a]=e[a]);return e.schools&&typeof e.schools=="object"&&(t.schools=e.schools),t}function Pn(e){const t=e.pillars,a=(ae,ge)=>`${ae}:${ge.ganzhi} ${ge.stemTenGod?`十神 ${ge.stemTenGod} `:""}藏干 ${ge.hidden.map(Ce=>`${Ce.stem}(${Ce.tenGod})`).join(" ")} 纳音 ${ge.nayin} 地势 ${ge.dishi} 自坐 ${ge.zizuo} 空亡 ${ge.kongwang.join("")}`+(ge.shensha&&ge.shensha.length?` 神煞 ${ge.shensha.join("、")}`:""),n=Object.entries(e.wuxing).map(([ae,ge])=>`${ae}${ge}`).join(" "),c=e.palaces?`【胎元】${e.palaces.taiyuan.ganzhi} 胎息 ${e.palaces.taixi?e.palaces.taixi.ganzhi:"—"}`+(e.palaces.minggong?` 命宫 ${e.palaces.minggong.ganzhi}`:" 命宫 时柱暂缺,不排")+(e.palaces.shengong?` 身宫 ${e.palaces.shengong.ganzhi}`:" 身宫 时柱暂缺,不排"):"",r=e.dayun.list.slice(0,8).map(ae=>`${ae.startAge}岁 ${ae.ganzhi}(${ae.stemTenGod})${ae.luck?`·${ae.luck.tier}`:""}${ae.relations&&ae.relations.length?`[${ae.relations.join("")}]`:""}`).join(" "),p=e.dayun.jiao&&e.dayun.jiao.at?`;交运 ${e.dayun.jiao.at}(${e.dayun.jiao.frame},距${e.dayun.jiao.from.name} ${e.dayun.jiao.spanDays} 天,三日折一年)`:"",j=e.dayun.startAgeExact,E=j&&Number.isInteger(j.years)?`起运岁(精确):${j.years} 年 ${j.months} 个月 ${j.days} 天 ${j.hours} 小时(${j.caliber};上面「${e.dayun.startAge.years}岁${e.dayun.startAge.months}个月」是四舍五入到月,两者同源)`:"",ee=e.jieqi.nearBoundaryMinutes<20?`
75
- ⚠ 出生时刻距「节」仅 ${e.jieqi.nearBoundaryMinutes} 分钟,而节气时刻本身有最多约 14 分钟的偏差,月柱与年柱建议人工复核。`:"",X={year:"年",month:"月",day:"日",hour:"时"},G=e.shensha&&e.shensha.groups&&e.shensha.groups.length?`神煞(${e.shensha.count} 见):`+e.shensha.groups.map(ae=>`${ae.cat}|`+ae.items.map(ge=>`${ge.name}(${ge.pillars.map(Ce=>X[Ce]).join("")})`).join("、")).join(";"):"神煞:—",I=e.renyuan,ie=sn("smt-renyuan"),V=I?`人元:${I.month}月第${I.day}日,${I.active}${I.activeElement}司权(${I.segments.map(ae=>`${ae.stem}${ae.from}–${ae.to}`).join(" ")})${I.beyond?";已过 30 日表,按本气算":""}${ie?`|原文见《${Je[ie.book].name}·${ie.chapter}》`:""}`:"",ye=e.frame&&e.frame.yongshen&&e.frame.yongshen.disputed||[],de=ye.length?` 有争议:${ye.map(ae=>`${ae.element}(${ae.favorRole};${ae.climate}盘调候忌${ae.element})`).join("、")}`:"",ke=new Set(ye.map(ae=>ae.element)),Ae=e.frame&&e.frame.yongshen&&e.frame.yongshen.neutral||[],Nt=Ae.length?` 中性偏忌:${Ae.map(ae=>`${ae.element} ${ae.weight} 分`).join("、")}(近零,不作实忌)`:"",At=e.frame?[`格局:${e.frame.primary?`${e.frame.primary.name}(${e.frame.primary.evidence})`:"—"}`,`   ${e.frame.geju.map(ae=>`${ae.name}[${ae.kind}${ae.status?`·${ae.status}`:""}]`).join(" ")}`,`用神:喜${e.frame.yongshen.favor.join("")}(${e.frame.yongshen.favorTenGods.join("、")}) 忌${e.frame.yongshen.avoid.join("")}(${e.frame.yongshen.avoidTenGods.join("、")})${de}${Nt} ${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}${ke.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(([ae,ge])=>`${ae}${ge}`).join(" ")}`]:[],Te=e.strength&&e.strength.branchStructure,Et=Te?Te.branches.map(ae=>`${ae.label}${ae.branch}${ae.camp}${Te.placeholderHour&&ae.key==="hour"?"·占位":""}`).join("、"):"",Tt=Te&&!Te.placeholderHour&&!Te.complete?" 时柱暂缺,只列三支":"",kn=Te?`地支结构:${Te.placeholderHour?"三支+占位":"四支"} ${Te.code}(${Et}) ${Te.word}${Te.congProb!=null?`(静态从格 ${Te.congRange})`:""}${Tt}`:"",Xe=e.relations&&Array.isArray(e.relations.anhe)?e.relations.anhe:[],Nn=Xe.length?`暗合:${Xe.join(" ")}(另列,不并入上面的合冲刑害;${Xe.length===1?"只一对,按口径可忽略":`共 ${Xe.length} 对`})`:"",Ot=e.hourUnknown===!0||!t.hour;return[`【四柱】${t.year.ganzhi} ${t.month.ganzhi} ${t.day.ganzhi}${t.hour?` ${t.hour.ganzhi}`:"(时柱暂缺)"}`,`日主:${e.dayMaster.stem}${e.dayMaster.element}(${e.dayMaster.yinYang}) 空亡:${e.kongwang.join("")}`,a("年柱",t.year),a("月柱",t.month),a("日柱",t.day),...Ot?[]:[a("时柱",t.hour)],`五行:${n}`,...c?[c]:[],`日主强弱:${e.strength.level}(${e.strength.score}) ${e.strength.detail}`,...kn?[kn]:[],...At,`天干关系:${e.relations&&e.relations.stems.length?e.relations.stems.join(" "):"—"}`,`地支关系:${e.relations&&e.relations.branches.length?e.relations.branches.join(" "):"—"}`,...Nn?[Nn]:[],G,`真太阳时:${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}`,...V?[V]:[],`大运:${e.dayun.rule}(${e.dayun.direction}),${e.dayun.startAge.years}岁${e.dayun.startAge.months}个月起运${p}`,...E?[E]:[],` ${r}`,`流年:${e.liunian.slice(0,10).map(ae=>`${ae.year}${ae.ganzhi}(${ae.stemTenGod})${ae.luck?`·${ae.luck.tier}`:""}`).join(" ")}`,(()=>{const ae=e.liunian.filter(Ee=>Ee.suiyun&&Ee.suiyun.signals&&Ee.suiyun.signals.length);if(!ae.length)return"岁运提示:近十年无岁运并临、运年反吟或大运/流年伏吟、反吟(只标干支,不判吉凶)";const ge=Ee=>`${Ee.type}${(Ee.type.startsWith("流年")||Ee.type.startsWith("大运"))&&Ee.target?`(${Ee.target})`:""}`,Ce=Be(e),Mt=Ce?`|古籍见《${Je[Ce.book].name}·${Ce.chapter}》`:"";return"岁运提示(只标干支变动,不判吉凶):"+ae.map(Ee=>`${Ee.year}${Ee.ganzhi} ${Ee.suiyun.signals.map(ge).join("/")}`).join(";")+Mt})(),"(格局、用神、行运吉凶为扶抑+简化调候的量化提示,非断语。)"].join(`
76
- `)+ee}function Ln(e){const t=e.lunar.monthRaw||e.lunar.month,a=`${e.lunar.year}年${e.lunar.isLeap?`闰${t}`:e.lunar.month}月${e.lunar.day}日`+(e.lunar.isLeap&&e.lunar.month!==t?`(按${e.lunar.month}月起盘)`:""),n=(()=>{if(!e.schools)return"";const ie=Object.entries({brightnessSchool:"亮度",gengYearSihua:"庚干四化",tianmaSchool:"天马",tiankongSchool:"天空",jiekongSchool:"截空",kuiyueSchool:"魁钺",tianshiTianshang:"天伤天使",changshengSchool:"长生",lateZishi:"晚子时",shenzhuSchool:"身主",mingzhuSchool:"命主取法",zuoyaoSchool:"杂曜全表",liunianSihua:"流年四化取干",sihuaVariant:"十干四化变体",jieluSchool:"截路空亡",suipoSchool:"岁前十二神"}).filter(([V])=>e.schools[V]&&e.schools[V]!==u[V]).map(([V,ye])=>`${ye} ${e.schools[V]}`);return ie.length?`【流派】${ie.join(" ")}`:""})(),c=I=>I.length?I.map(ie=>`${ie.name}${ie.mutagen?`化${ie.mutagen}`:""}`).join(" "):"—",r=I=>`神煞:长生(${I.changsheng}) 博士(${I.boshi}) 将前(${I.jiangqian}) 岁前(${I.suiqi})`,p=[];for(const I of e.palaces){const ie=I.isSoul?"【命】":I.isBody?"【身】":"  ";p.push(` ${I.palace} ${I.branch} ${I.ganzhi} ${ie} 大限${String(I.daxian.start).padStart(2)}-${I.daxian.end} 小限${String(I.xiaoxian.age).padStart(2)} ${c(I.stars)}`),p.push(` ${r(I.shensha)}`)}const j=(e.liunian??[]).slice(0,6).map(I=>` ${I.year} ${I.ganzhi} ${String(I.age).padStart(2)}岁 命宫${I.lifePalace.branch}(${I.lifePalace.palace}) 流禄${I.liulu} 流羊${I.liuyang} 流陀${I.liutuo} | ${I.mutagen.map(ie=>ie.replace("化","")).join(" ")}`+(I.mutagenHits?` 四化落宫 ${I.mutagenHits.map(ie=>`${ie.star}${ie.type}→${ie.palace||"未上盘"}`).join("、")}`:"")+(I.sanfangMainStars?` 三方主星 ${I.sanfangMainStars.join("")}`:"")),E=(e.patterns??[]).length?e.patterns.map(I=>`${I.name}(${I.tone==="good"?"吉格":I.tone==="bad"?"忌格":"中"}:${I.evidence})`).join(";"):"无明显格局(按内置规则)",ee=(e.daxianList??[]).slice(0,8).map(I=>` ${I.branch}宫(${I.palace})${I.ages[0]}-${I.ages[1]}岁 ${I.ganzhi} 会${I.mainStars.join("")||"—"} 化 ${I.mutagenHits.map(ie=>`${ie.star}${ie.type}→${ie.palace||"未上盘"}`).join("、")}`),X=(()=>{const I=e.flyChains;if(!I)return"";const ie=ye=>{const de=I[ye];return!de||!de.steps.length?"":`${ye}:${de.path.join("→")}${de.closed?"(成环)":""}`},V=["禄","权","科","忌"].map(ie).filter(Boolean).join(" ");return V?`【命宫飞星】${V}`:""})(),G=(()=>{const I=e.flyComposite;if(!I||!Array.isArray(I.sources)||!I.sources.length)return"";const ie=I.labels.length?I.labels.join(" · "):"无同宫会聚",V=["禄","权","科","忌"].map(ye=>{const de=(I.byType&&I.byType[ye]||[]).filter(Ae=>!Ae.self),ke=[...new Set(de.map(Ae=>String(Ae.to).replace(/宫$/,"")))];return ke.length?`${ye}→${ke.join("/")}`:""}).filter(Boolean).join(" ");return`【三方四正飞化】${I.sanfang.join("·")}:${ie}${V?` ${V}`:""}`})();return[`【农历】${a}(月首 ${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.lifeMasterNote?`(${e.lifeMasterNote})`:""}`,`【大限】${e.daxian.rule},${e.daxian.startAge}岁起 【小限】${e.xiaoxianRule.direction}`,n,`【昌曲】文昌${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})`,X,G,"十二宫:",...p,"大限(按起运年龄排序,前 8 限,宫干四化落宫):",...ee,"流年(前 6 年,完整 12 年在结构化数据里):",...j,`【格局】${E}`,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(`
77
- `)}const Cn=["旺","相","休","囚","死"];function Rn(e){const t=e.states,a=e.month;if(!t||!a)return"无月令数据";const n=c=>Cn.filter(r=>c&&Array.isArray(c[r])&&c[r].length).map(r=>`${r} ${c[r].join("/")}`).join(" ");return`月令 ${a.branch}(${a.element}) 门 ${n(t.gate)||"—"} 星 ${n(t.star)||"—"} 干 ${n(t.stem)||"—"}`}function Yn(e){const t=e.palaces,a=n=>`${n.palace}宫 ${n.star||"—"}/${n.gate||"—"}/${n.god||"—"}${n.kong?" 空":""}${n.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(n=>`${n.palace}宫${n.stem}`).join("、")||"无"} 三奇入墓 ${(e.conditions&&e.conditions.ruMu||[]).map(n=>`${n.palace}宫${n.stem}`).join("、")||"无"} 六仪入墓 ${(e.conditions&&e.conditions.liuYiRuMu||[]).map(n=>`${n.palace}宫${n.stem}`).join("、")||"无"}`,`【十干克应】${[...t,e.centerPalace].filter(n=>n&&n.ganYing).map(n=>`${n.palace}宫 ${n.ganYing.tian}加${n.ganYing.di} ${n.ganYing.name}`).join(" ")||"—"}`,`【旺衰】${Rn(e)}`,`【九宫】${t.map(a).join(" ")}`,`※ 晚子时:${e.lateZiHourMode==="next-day"?"23:00 后归次日":"23:00 后仍归当日"}(可用 lateZiHourMode / lateZi 指定)`,`※ ${e.rules[e.rules.length-1]}`].join(`
78
- `)}function wn(e){if(!e||!Array.isArray(e.pairs)||!e.pairs.length)return[];const t=["【三方合盘】三对两两并列,不合成「三人总分」",...e.pairs.map(a=>`· ${a.a}–${a.b}:${a.level||"—"}(${a.total==null?"—":`${a.total}/100`})`)];return e.best&&(e.spread>=3?t.push(` 最顺:${e.best.a}–${e.best.b}(${e.best.total}/100)`+(e.hardest?`;最需磨合:${e.hardest.a}–${e.hardest.b}(${e.hardest.total}/100)`:"")):t.push(` 三对分数接近(最高与最低相差 ${e.spread} 分),不排名`)),e.focus&&e.focus.spread>=3&&t.push(` 差异最大的一维:${e.focus.label}(三对相差 ${e.focus.spread} 分)`),e.note&&t.push(`※ ${e.note}`),t}function Zn(e){if(e.chart==="ziwei"){const n=c=>`${c.label}:${c.score>=0?"+":""}${c.score} ${c.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(n),...e.interactions.map(c=>` · ${c.text}`),...wn(e.triple),...e.notes.map(c=>`※ ${c}`)].join(`
70
+ `,Q={河北:"石家庄",山西:"太原",内蒙古:"呼和浩特",辽宁:"沈阳",吉林:"长春",黑龙江:"哈尔滨",江苏:"南京",浙江:"杭州",安徽:"合肥",福建:"福州",江西:"南昌",山东:"济南",河南:"郑州",湖北:"武汉",湖南:"长沙",广东:"广州",广西:"南宁",海南:"海口",四川:"成都",贵州:"贵阳",云南:"昆明",西藏:"拉萨",陕西:"西安",甘肃:"兰州",青海:"西宁",宁夏:"银川",新疆:"乌鲁木齐",台湾:"台北"},W={石家庄:[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]},B=(()=>{const T={};for(const s of K.trim().split(`
71
+ `))for(const u of s.split(";")){const c=u.trim().split(/\s+/);if(c.length!==3)continue;const[M,x,$]=c;T[M]={lon:Number(x),lat:Number($)}}for(const[s,[u,c]]of Object.entries(W))T[s]||(T[s]={lon:u,lat:c});return T})(),q=/[省区路街道巷弄号村镇乡组队]/,A={中山区:{city:"大连"},朝阳区:{city:"北京",byProvince:{吉林:"长春",辽宁:"朝阳"}}};function P(T){const s=String(T||"").trim();if(!s)return null;const u=Number(s);if(Number.isFinite(u)&&/^-?\d+(\.\d+)?$/.test(s)&&u>=60&&u<=150)return{lon:u,lat:null,matched:`${u}°E`,level:"经度",note:"按你输入的经度计算"};const c=s.replace(/\s/g,""),M=Object.keys(B).sort((w,o)=>o.length-w.length),x=[];for(const w of M)for(let o=c.indexOf(w);o>=0;o=c.indexOf(w,o+w.length)){const d=c.charAt(o+w.length);q.test(d)||x.push({name:w,at:o,after:d,explicit:d==="市"?1:0})}if(x.sort((w,o)=>o.explicit-w.explicit||w.at-o.at),x.length){const w=x[0],o=B[w.name];return w.after==="县"?{lon:o.lon,lat:o.lat,matched:`${w.name}县`,level:"区县",note:`「${w.name}县」按 ${w.name} 城区估算(约 ${o.lon}°E)`}:{lon:o.lon,lat:o.lat,matched:w.name,level:"地级市",note:`按 ${w.name} 估算(约 ${o.lon}°E)`}}for(const[w,o]of Object.entries(A)){if(!c.includes(w))continue;let d=o.city;for(const[g,N]of Object.entries(o.byProvince||{}))if(c.includes(g)){d=N;break}const h=B[d];if(h)return{lon:h.lon,lat:h.lat,matched:d,level:"区县",note:`「${w}」按 ${d} 估算(约 ${h.lon}°E)`}}const $=M.find(w=>c.includes(`${w}路`)||c.includes(`${w}街`));if($)return{lon:null,lat:null,matched:null,level:"未匹配",note:`「${$}路」是全国常见的路名,无法确定城市;请补上城市(如「厦门市${$}路」)或直接填经度`};for(const[w,o]of Object.entries(Q)){const d=c.indexOf(w);if(d<0)continue;const h=c.charAt(d+w.length);if(h==="区"||h==="县")continue;const g=B[o]||{lon:W[o][0],lat:W[o][1]};return{lon:g.lon,lat:g.lat,matched:o,level:"省会",note:`未匹配到具体城市,按 ${w} 省会 ${o} 估算(约 ${g.lon}°E)`}}return{lon:null,lat:null,matched:null,level:"未匹配",note:`没查到「${s}」,可改填经度(如 116.4)`}}const z=/(区|县|镇|乡|村|小区|街道|路|号|巷|弄|组|队)/,b="dsh-metaphysics (+https://github.com/xuanfu-web/dsh-metaphysics)";async function y(T,{timeoutMs:s=2500}={}){if(typeof fetch!="function")return null;let u=null;try{const c=typeof AbortController=="function"?new AbortController:null;c&&(u=setTimeout(()=>c.abort(),s));const M="https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&accept-language=zh-CN&countrycodes=cn&q="+encodeURIComponent(T),x=await fetch(M,{signal:c?c.signal:void 0,headers:{"User-Agent":b}});if(!x||!x.ok)return null;const $=await x.json();if(!Array.isArray($)||$.length===0)return null;const w=$[0],o=Number(w.lon),d=Number(w.lat);return Number.isFinite(o)?{lon:o,lat:d,matched:w.display_name,level:"在线",note:`在线解析:${w.display_name}`}:null}catch{return null}finally{u&&clearTimeout(u)}}async function L(T,s={}){const u=P(T),c=String(T||"").trim();if(!c||!Y(s.online)||u&&typeof u.lon=="number"&&!z.test(c))return u;const x=await y(c,s);return x?{...x,local:u&&u.lon!=null?u:null}:u&&typeof u.lon=="number"?{...u,onlineFailed:!0,note:`${u.note}(联网解析失败或超时,已退回内置坐标表)`}:{...u,onlineFailed:!0}}return{CITIES:B,PROVINCES:Q,resolveAddress:P,geocodeAddress:L}})(),D.random=(function(){function Y(A){const P=Number(A),z=P>>>0,b=Math.floor(Math.abs(P)/4294967296)>>>0,y=Math.round((P-Math.trunc(P))*4294967296)>>>0;let L=(z^Math.imul(b+1,2246822507)^y)>>>0;return L||(L=2654435769),function(){L=L+1831565813>>>0;let s=L;return s=Math.imul(s^s>>>15,s|1),s^=s+Math.imul(s^s>>>7,s|61),((s^s>>>14)>>>0)/4294967296}}function K(){const A=globalThis.crypto;if(!A||typeof A.getRandomValues!="function")return Math.random;const P=128,z=new Uint32Array(P);let b=P;const y=()=>(b>=P&&(A.getRandomValues(z),b=0),z[b++]/4294967296);return y.source="crypto",y}const Q=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/,W=A=>{if(typeof A=="number")return Number.isFinite(A)?A:NaN;if(typeof A=="string"){const P=A.trim();if(P!==""&&Q.test(P))return Number(P)}return NaN};function B(A){if(A==null||A==="")return K();const P=W(A);return Number.isFinite(P)?Y(P):K()}function q(A){return A==null||A===""?!0:Number.isFinite(W(A))}return{mulberry32:Y,randomOf:B,isSeed:q}})(),D.dst=(function(){const{daysInMonth:Y}=D.validate||{},K={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"]},Q=(A,P,z)=>A*1e4+P*100+z;function W(A){const P=K[A.year];if(!P)return!1;const[z,b,y]=P[0].split("-").map(Number),[L,T,s]=P[1].split("-").map(Number),u=Q(A.year,A.month,A.day);if(u<Q(z,b,y)||u>Q(L,T,s))return!1;const c=A.hour*60+(A.minute||0);return!(u===Q(z,b,y)&&c<120||u===Q(L,T,s)&&c>=120)}function B(A){const P=K[A.year];if(!P)return null;const[z,b,y]=P[0].split("-").map(Number),[L,T,s]=P[1].split("-").map(Number),u=Q(A.year,A.month,A.day),c=A.hour*60+(A.minute||0);return u===Q(z,b,y)&&c>=120&&c<180?"gap":u===Q(L,T,s)&&c>=60&&c<120?"twice":null}function q(A){const P=A.minute||0;if(!W(A))return{year:A.year,month:A.month,day:A.day,hour:A.hour,minute:P,applied:!1,note:null};let{year:z,month:b,day:y,hour:L}=A;L-=1,L<0&&(L+=24,y-=1,y<1&&(b-=1,b<1&&(b=12,z-=1),y=Y(z,b)));const T=B(A);return{year:z,month:b,day:y,hour:L,minute:P,applied:!0,note:`检出自 ${K[A.year][0]} 至 ${K[A.year][1]} 的中国夏令时:出生钟面时间已减 1 小时校正`+(T==="gap"?";这一天 02:00–03:00 钟表直接跳过,所给钟面时间在当年并不存在——这里按「拨快后的读数」回退一小时,若登记的本是标准时间,请传 dst:false 重排。":T==="twice"?";这一天 01:00–02:00 因回拨走了两遍,同一钟面时间对应两个真实时刻——这里按夏令时的那一遍(回退一小时)取。":"")}}return{DST_SPANS:K,inDstSpan:W,dstAmbiguity:B,applyDst:q}})(),D.classics=(function(){const Y={ziping:{name:"子平真诠",author:"清·沈孝瞻",base:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/"},ditian:{name:"滴天髓",author:"明·京图(通行本)",base:"https://www.diancang.xyz/xuanxuewushu/ditiansui/"},sanming:{name:"三命通会",author:"明·万民英",base:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/"}},K=[{id:"zp-yongshen",book:"ziping",chapter:"八、论用神",scene:"用神",tags:[],quote:"八字用神,专求月令,以日干配月令地支,而生克不同,格局分焉。财官印食,此用神之善而顺用之者也;煞伤劫刃,用神之不善而逆用之者也。",plain:"用神从月令里找:财、官、印、食四吉神顺用(生之护之),煞、伤、劫、刃四凶神逆用(制之化之)。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53628.html"},{id:"zp-zhenguan",book:"ziping",chapter:"三十一、论正官",scene:"格局",tags:["正官"],quote:"以刑冲破害为忌,则以生之护之为喜矣。存其喜而去其忌则贵,而贵之中又有高低者,何也?",plain:"正官格最忌刑冲破害,喜财生官、印护官;去忌存喜才谈得上贵,贵的层次还要看财印是否并透、有无伤官七煞混杂。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53651.html"},{id:"zp-cai",book:"ziping",chapter:"三十三、论财",scene:"格局",tags:["财","正财","偏财"],quote:"财为我克,使用之物也,以能生官,所以为美。为财帛,为妻妾,为才能,为驿马,皆财类也。",plain:"财是我所克、能为我用之物,因能生官而美;它同时代表钱财、配偶、才能、走动,不只「钱」一项。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53653.html"},{id:"zp-yin",book:"ziping",chapter:"三十五、论印绶",scene:"格局",tags:["印"],quote:"印绶喜其生身,正偏同为美格,故财与印不分偏正,同为一格而论之。",plain:"印能生身,正印偏印都算美格,不分偏正而论;印格的关键在身印强弱与官杀、食伤、财的配合。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53655.html"},{id:"zp-shishen",book:"ziping",chapter:"三十七、论食神",scene:"格局",tags:["食神"],quote:"食神本属泄气,以其能生正财,所以喜之。故食神生财,美格也。财要有根,不必偏正叠出,如身强食旺而财透,大贵之格。",plain:"食神本是泄气,可贵在能生财;食神生财要财有根,身强、食旺、财透三者齐,格局才大。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53657.html"},{id:"zp-pianguan",book:"ziping",chapter:"三十九、论偏官",scene:"格局",tags:["七杀","偏官"],quote:"煞以攻身,似非美物,百大贵之格,多存七煞。盖控制得宜,煞为我用,如大英雄大豪杰,似难驾驭,而处之有方,则惊天动地之功,忽焉而就。",plain:"七煞攻身,看着不美,但大贵之格多有七煞——能控制住就为我所用,像驾驭豪杰,处之有方就能成大事。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53659.html"},{id:"zp-shangguan",book:"ziping",chapter:"四十一、论伤官",scene:"格局",tags:["伤官"],quote:"伤官虽非吉神,实为秀气,故文人学士,多于伤官格内得之。而夏木见水,冬金见火,则又为秀之尤秀者也。",plain:"伤官不是吉神,却是秀气所在,文人多出伤官格;夏木得水、冬金得火,是秀气里更秀的两种。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53661.html"},{id:"zp-yangren",book:"ziping",chapter:"四十三、论阳刃",scene:"格局",tags:["劫财","阳刃"],quote:"阳刃者,劫我正财之神,乃正财之七煞也。禄前一位,惟五阳有之,故为阳刃。不曰劫而曰刃,劫之甚也。刃宜伏制,官煞皆宜,财印相随,尤为贵显。",verifiedQuote:"阳刃者,劫我正财之神,乃正财之七煞也。禄前一位,惟五阳有之",variantNote:"典藏网此页把「故为阳刃」刻作「故为旭刃」,与通行本异文;前段仍可逐字核验",plain:"阳刃是劫财之极(只有五阳干有),宜用官煞制伏;财印相随而不相碍,格局更显。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53663.html"},{id:"zp-lujie",book:"ziping",chapter:"四十五、论建禄月劫",scene:"格局",tags:["比肩","建禄","月劫"],quote:"故建禄与月劫,可同一格,不必加分,皆以透干支,别取财官煞食为用。",plain:"建禄、月劫同看一格,月令本身不算用神,要另看透出的财官煞食取用。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53665.html"},{id:"zp-qihou",book:"ziping",chapter:"十四、论用神配气候得失",scene:"调候",tags:[],quote:"论命惟以月令用神为主,然亦须配气候而互参之。譬如英雄豪杰,生得其时,自然事半功倍;遭时不顺,虽有奇才,成功不易。",plain:"月令用神为主,但必须配气候参看;同样的格局,生在得时的气候里事半功倍,逆着气候就费劲。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53634.html"},{id:"zp-chengbai",book:"ziping",chapter:"九、论用神成败救应",scene:"格局",tags:[],quote:"成中有败,必是带忌;败中有成,全凭救应。",plain:"成格不等于一路顺:成中带忌(官逢财又逢伤、官被合之类)就打了折;败格也未必无救——印来解伤、合来清煞,败中还能转成。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53629.html"},{id:"zp-zaji",book:"ziping",chapter:"十六、论杂气如何取用",scene:"用神",tags:[],quote:"何谓透干?如甲生辰月,透戊则用偏财,透癸则用正印,透乙则用月劫是也。何谓会支?如甲生辰月,逢申与子会局,则用水印是也。一透则一用,兼透则兼用,透而又会,则透与会并用。",plain:"四墓(辰戌丑未)所藏不止一气,所以叫杂气:取用先看哪一藏干透到天干,透一个用一个;没有透干,再看地支有没有与月支会成三合局,会成什么局就取局中那一气。透干与会支同时成立时两样并用。原文对「兼透」只给原则,没有给取舍次序。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53636.html"},{id:"zp-bianhua",book:"ziping",chapter:"十、论用神变化",scene:"格局",tags:[],quote:"故若丁生亥月,本为正官,支全卯未,则化为印。己生申月,本属伤官。藏庚透壬,则化为财。凡此之类皆用神之变化也。",plain:"用神本从月令取,但月令藏干不一:丁生亥月本为正官,支会卯未就化为印;己生申月本属伤官,庚藏壬透就化为财。起点相同,合化一变,取用也跟着变(原文只说变化之由,不断定某盘必化)。",url:"https://www.diancang.xyz/xuanxuewushu/zipingzhenquan/53630.html"},{id:"dt-hannuan",book:"ditian",chapter:"通神论·寒暖",scene:"调候",tags:[],quote:"天道有寒暖,生育万物,人道行之,不可过也。",plain:"天有寒暖才能生养万物,人命里寒暖也不能过——过寒过热都要调。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-zaoshi",book:"ditian",chapter:"通神论·燥湿",scene:"调候",tags:[],quote:"地道有燥湿,生成品汇,人道得之,不可偏也。",plain:"地有燥湿才有品类生成,人命得燥湿之气也不能偏。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-shuaiwang",book:"ditian",chapter:"通神论·衰旺",scene:"调候",tags:[],quote:"能知旺衰之真机,其于三命之奥,思过半矣。",plain:"真正看懂旺衰的机关,命理之奥就过了一半——旺衰不是数个数,要看真机。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-zhonghe",book:"ditian",chapter:"通神论·中和",scene:"调候",tags:[],quote:"既识中和之正理,而于五行之妙,有全能焉。",plain:"懂得中和的道理,五行的妙处就都在其中了。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-guansha",book:"ditian",chapter:"通神论·官杀",scene:"十神",tags:["正官","七杀"],quote:"官杀混杂来问我,有可有不可。",plain:"官杀混杂不是一律不好,要看能不能去留取清。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-shangguan",book:"ditian",chapter:"通神论·伤官",scene:"十神",tags:["伤官"],quote:"伤官见官最难辨,可见不可见。",plain:"伤官见官是最难分辨的一条:有的能见,有的不能见,不能一句「伤官见官为祸百端」了事。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-yueling",book:"ditian",chapter:"通神论·月令",scene:"用神",tags:[],quote:"月令乃提纲之府,譬之宅也,人元为用事之神,宅之定向也,不可以不卜。",plain:"月令像宅子,藏干是用事之神,像宅子的朝向,必须细看。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-tiyong",book:"ditian",chapter:"通神论·体用",scene:"用神",tags:[],quote:"道有体用,不可以一端论也,要在扶之抑之得其宜。",plain:"体用不能只看一头,关键是扶抑得宜。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-jingshen",book:"ditian",chapter:"通神论·精神",scene:"用神",tags:[],quote:"人有精神,不可以一偏求也,要在损之益之得其中。",plain:"看精神不能偏执一端,要在损益之间求其中。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"dt-tongguan",book:"ditian",chapter:"通神论·通关",scene:"用神",tags:[],quote:"关内有织女,关外有牛郎,此关若通也,相邀入洞房。",plain:"两股力隔着一道关相望:一边织女、一边牛郎,中间若有一行能把两边接上(一方生它、它再生另一方),对峙就化成相生。原文只给取象,哪一行为关要按五行生克定。",url:"https://www.diancang.xyz/xuanxuewushu/ditiansui/153091.html"},{id:"smt-zhenguan",book:"sanming",chapter:"卷五·论正官",scene:"格局",tags:["正官"],quote:"正官者,乃甲见辛、乙见庚之例。阴阳配合,相制有用,成其道也。故正官为六格之首,止许一位,多则不宜。",plain:"正官取「克我而阴阳相配」,有制而能成用;六格以正官居首,只宜一位,多见就杂。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7582.html"},{id:"smt-zhengcai",book:"sanming",chapter:"卷六·论正财",scene:"格局",tags:["财","正财"],quote:"正财者,乃甲见己、乙见戊之例。受我克制,为我之妻,譬人娶妻,妻赍财嫁我,我必精神康强,而后可享用,若衰微不振,虽妻财丰厚,但能目视,终不得用。",plain:"正财是我克制之物,古人以「娶妻带财」作比:自身精神康强才受用得起,身弱不振,财再厚也只是看着。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7645.html"},{id:"smt-piancai",book:"sanming",chapter:"卷六·论偏财",scene:"格局",tags:["财","偏财"],quote:"何谓偏财?乃甲见戊、乙见己之例。非妻所带,乃众人之财也。切忌有姊妹兄弟分夺,柱无官星,祸患百出。",plain:"偏财取「我克而阴阳不同」:不是妻家带来的私财,而是众人之财,宜流通不宜独占。原文最忌比肩劫财来分夺,又说柱中无官星则多事(旧说的重话照录,本插件只记原文、不作断语)。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7650.html"},{id:"smt-yinshou",book:"sanming",chapter:"卷六·论印绶",scene:"格局",tags:["印"],quote:"印绶者,乃五行生我之名。如甲乙在亥子月,丙丁在寅卯月之类,乃我气之源,为生气,为父母,能护我官星,使无伤克",plain:"印是生我之气,像源头与父母:它能护住官星,使官不受伤克;反过来说,印重就怕财来破。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7655.html"},{id:"smt-shishen",book:"sanming",chapter:"卷六·论食神",scene:"格局",tags:["食神"],quote:"凡命遇财煞之地,食神旺相,煞被食制,不敢为祸,财被食生,充裕不竭,故食神一名寿星,一名爵星,良有以也。",plain:"食神旺,一头制煞、一头生财:煞被制住不敢为祸,财被生起不至枯竭;所以食神又叫寿星、爵星。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7663.html"},{id:"smt-shangguan",book:"sanming",chapter:"卷六·论伤官",scene:"格局",tags:["伤官"],quote:"伤官虽凶,乃我所生,自家之物,伤尽则能生财,财旺则能生官,造化展转有情。",plain:"伤官虽称凶,却是我自己生出来的:伤尽(柱中不见官星)反能生财,财旺再生官,辗转还是有情。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7662.html"},{id:"smt-yangren",book:"sanming",chapter:"卷六·论阳刃",scene:"格局",tags:["阳刃","劫财"],quote:"阳者,阴阳之阳,刃者,刀刃之刃,即禄前一位,言旺越其分,故险。",plain:"阳刃指禄前一位,旺过了本分,所以险;甲丙戊庚壬五阳干才有刃,阴干见伤官同论。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7671.html"},{id:"smt-jianlu",book:"sanming",chapter:"卷六·论建禄",scene:"格局",tags:["建禄","比肩","月劫"],quote:"凡命月令建禄,难招祖业,必主平生见财不聚,却病少寿长,行运再见比肩,克妻妨父损子",plain:"月令建禄是日主临官之地,身旺而财官难取:古说难承祖业、见财不聚,但病少寿长;再走比肩运,古书说克妻妨父损子(属于旧说的重话,本插件只记原文、不作断语)。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7672.html"},{id:"smt-guansha-liu",book:"sanming",chapter:"卷五·官煞去留杂论",scene:"格局",tags:["七杀","偏官"],quote:"凡看去留,要详柱中官煞孰重孰轻,天干透者易去,月支所藏者难去,须伤官食神去官煞之物众而有力,方才去得。",plain:"官煞混见时先比谁重谁轻:天干透出的容易去,月支藏着的难去;用来去官煞的伤官食神要成众、有根有力,才真去得掉。七杀格遇正官混杂,就按这一篇看取舍。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7599.html"},{id:"smt-quzhi",book:"sanming",chapter:"卷六·曲直",scene:"格局",tags:["曲直格","专旺"],quote:"甲乙日得亥卯未局,柱中须有亥字带印为入格,若无亥有卯,止是木之本气,却要见金土为贵,既无亥字,又无金土,则木不秀不实,难以言贵。",plain:"曲直格要木局成方(亥卯未)且带亥字为印,才算入格;只有卯、没有亥,只是木的本气,得另见金土才谈得上贵;两样都没有,木虽旺而无成,难称贵格。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7630.html"},{id:"smt-yanshang",book:"sanming",chapter:"卷六·炎上",scene:"格局",tags:["炎上格","专旺"],quote:"丙丁日遇寅午戌局,柱中须有寅字带印为入格,无寅止是九流近贵之命,若火自旺,无亥水相济,不贵。喜东北方运,忌见辰丑戊己,晦火光明,多主眼疾,或患风气,柱有木制成贵,忌水金乡,怕冲。",plain:"炎上格要火局成方(寅午戌)且带寅字为印才入格;无寅只是偏贵的命。火自旺还要一点水相济,过燥不贵;行运喜东北、忌湿土晦火,也怕冲。原文另带「多主眼疾」一句,属于旧说,本插件只记原文、不作健康判断。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7631.html"},{id:"smt-congge",book:"sanming",chapter:"卷六·从革",scene:"格局",tags:["从革格","专旺"],quote:"庚辛日见巳酉丑局,须带丙丁巳午一二位方成其器,但不可火多。如辛巳、辛酉、辛丑三日不喜五月生,被火所伤,宜八月或水土养育食神印绶为吉。",plain:"从革格是金局成方(巳酉丑),但金要火炼才成器:须带丙丁或巳午一二位,火又不能多。辛巳、辛酉、辛丑三日出身在五月(火旺)被伤,原文说宜八月或水土养育。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7632.html"},{id:"smt-runxia",book:"sanming",chapter:"卷六·润下",scene:"格局",tags:["润下格","专旺"],quote:"壬癸日见申子辰全,忌引卯巳死绝之地,三刑四冲之乡,死绝则不流,冲刑则横流,岁运同。或曰水太泛须柱有土神一两位制之,得成堤岸,既有土怕会木为凶,如有木伤土要金印救解,终是一生成败。",plain:"润下格是水局三合全(申子辰),最忌卯巳死绝与三刑四冲:死绝水不流,冲刑水横流,行运也一样看。水太泛要一两位土作堤,有土又怕木来破堤,木伤土再用金印解救——原文把成败条件摊开讲。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7633.html"},{id:"smt-jiasi",book:"sanming",chapter:"卷六·稼穑",scene:"格局",tags:["稼穑格","专旺"],quote:"赋云:戊己忻逢四季,乃为稼穑之名。是戊己生逢季月,喜见木为官,止得一木为妙,木多则土虚,主虚诈为破家不仁之人。",plain:"稼穑格取戊己生于四季月(辰戌丑未)。原文说喜见一木为官,木多则土虚;后半对木多之人的评语是旧说的重话,本插件只照录条件、不拿来评价人。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7634.html"},{id:"smt-congsha",book:"sanming",chapter:"卷五·弃命从煞",scene:"格局",tags:["从杀格"],quote:"《独步》云:弃命从煞,须要会煞从财,忌煞从煞。盖言从煞格,以煞神太重,身无所归,不得已从之,要行煞旺及财乡,四柱无一点比肩印绶方论,如遇运扶身旺,与煞为敌,从煞不专,故为祸患。",plain:"从煞格是煞太重、日主无所归才「弃命」相从:条件是四柱没有一点比肩印绶扶身,行运喜煞旺与财乡;一旦走扶身之运,与煞为敌,就从得不专。本插件只作结构说明,不据此断寿夭。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7598.html"},{id:"smt-congcai",book:"sanming",chapter:"卷六·弃命从财",scene:"格局",tags:["从财格"],quote:"《独步》云:弃命从财,须要会财,若逢根气,命损无猜。假如丁生酉月,柱多庚辛,日干无气,只得弃命相从,运入北方财官旺地,乃为入格,南行灾。",plain:"从财格要财会成局、日干无气;一见根气就破格,原文用「命损无猜」这种重话写明。以丁生酉月、柱多庚辛为例:只能弃命相从,行北方财官旺地为入格,南行则灾。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7652.html"},{id:"smt-suiyun",book:"sanming",chapter:"卷二·总论岁运",scene:"岁运",tags:[],quote:"行运以生月为运元,最怕行运与太岁冲克,若岁运冲月必祸;若岁运与日相对,谓之返吟,岁运压日,谓之伏吟,二者不利六亲,非横破财,不为吉兆。",plain:"大运以生月为起点,最怕与流年(太岁)冲克:原文说岁运冲月为祸,又把「岁运与日柱相对」叫返吟、「岁运压日」叫伏吟。这两句是按「对日柱」说的,与本插件「干支相同为伏吟、天克地冲为反吟」不是同一套定义(本插件取后者);末句「不利六亲、破财」是旧说的重话,只作变动提示,不作断语。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7539.html"},{id:"smt-renyuan",book:"sanming",chapter:"卷二·论人元司事",scene:"人元",tags:[],quote:"故支吕所藏者主命,谓之人元,名为司事之神,以命术言之为月令。如正月建寅,寅中有艮土用事五日,丙火长生五日,甲木二十日;二月建卯,卯中有甲木用事七日,乙木二十三日;",plain:"地支所藏为「人元」,按月令分日轮值。三命通会这一本给的是另一套日数:寅月艮土(戊土)五日、丙火五日、甲木二十日,卯月甲七日、乙二十三日。它与本插件采用的通行 30 日表(寅月戊7丙7甲16,即 7/7/16;卯月甲10乙20,即 10/20)不是同一套分法;两表各照原样并列,本插件仍按通行表给「第几日谁当权」,不改取格。",url:"https://www.diancang.xyz/xuanxuewushu/sanmingtonghui/7529.html"}],Q=K.reduce((T,s)=>(T[s.id]=s,T),{}),W={正官格:"正官",七杀格:"七杀",偏官格:"偏官",正财格:"正财",偏财格:"偏财",正印格:"印",偏印格:"印",食神格:"食神",伤官格:"伤官",阳刃格:"阳刃",月劫格:"月劫",建禄格:"建禄"},B={曲直格:"smt-quzhi",炎上格:"smt-yanshang",从革格:"smt-congge",润下格:"smt-runxia",稼穑格:"smt-jiasi",从财格:"smt-congcai",从杀格:"smt-congsha"};function q(T){return Q[T]||null}function A(T){return(T&&Array.isArray(T.liunian)?T.liunian:[]).some(c=>c&&c.suiyun&&Array.isArray(c.suiyun.signals)&&c.suiyun.signals.length)?q("smt-suiyun"):null}function P(T){const s=String(T||"");if(W[s])return W[s];const u=s.replace(/格$/,"");return W[u+"格"]||u}function z(T,s){return K.find(u=>u.scene==="格局"&&u.tags.includes(T)&&(!s||u.book===s))||null}function b(T){return T.chapter.replace(/^.*[、·]/,"").replace(/^论/,"")}function y(T,s=5){if(!T)return[];const u=[],c=new Set,M=(O,J)=>{!O||c.has(O.id)||u.length>=s||(c.add(O.id),u.push({...O,why:J}))},x=Array.isArray(T.geju)?T.geju:T.frame&&Array.isArray(T.frame.geju)?T.frame.geju:[],$=x.some(O=>O&&O.kind==="化气格");for(const O of x){if(O&&O.status==="破格"||$&&O&&O.status==="假从")continue;const J=O&&B[O.name]?q(B[O.name]):null;J&&M(J,`本盘列有「${O.name}」,故取${Y[J.book].name}「${b(J)}」一条`)}for(const O of x){if(!O||O.kind&&O.kind!=="月令格")continue;const J=P(O.name),se=z(J,"ziping")||z(J);se&&M(se,`你的月令格局是「${O.name}」,故取${Y[se.book].name}「${b(se)}」一条`);const F=K.find(be=>be.scene==="格局"&&be.tags.includes(J)&&(!se||be.book!==se.book));F&&M(F,`同是「${O.name}」,${Y[F.book].name}「${b(F)}」另有取法,可对照读`)}const w=T.climate||T.frame&&T.frame.yongshen&&(T.frame.yongshen.climate||T.frame.yongshen.tiaohou),o=T.frame&&T.frame.yongshen&&T.frame.yongshen.tongguan,d=o&&o.usable?q("dt-tongguan"):null;if(w&&w.kind&&w.kind!=="平和"){const O=!!(w.cold||w.kind.indexOf("寒")>=0),J=!!(w.hot||w.kind.indexOf("热")>=0);M(q(O?"dt-hannuan":"dt-zaoshi"),`本盘气候判为「${w.kind}」,故取${Y.ditian.name}寒暖燥湿一条`),d||M(q("zp-qihou"),"气候与月令用神要互参,故取子平真诠「用神配气候」一条"),J&&M(q("dt-hannuan"),"本盘偏热,寒暖一条正对")}d&&M(d,`本盘忌${o.foe}克用${o.use},局中${o.bridge}${o.weight}分可作通关,故取${Y.ditian.name}「通关」一条`);const h=x.find(O=>O&&O.kind==="化气格"),g=x.find(O=>O&&O.kind==="组合"),N=T.monthBranch||T.frame&&T.frame.monthBranch||T.pillars&&T.pillars.month&&T.pillars.month.branch,_=["辰","未","戌","丑"].includes(N);return h?M(q("zp-bianhua"),`本盘列有「${h.name}」:用神由月令合化而变,总纲一位改取${Y.ziping.name}论用神变化`):_?M(q("zp-zaji"),`月令${N}属四墓杂气,取用先看透干、再看会支,总纲一位取${Y.ziping.name}论杂气如何取用`):g?M(q("zp-chengbai"),`本盘另有「${g.name}」组合:成格还要看带忌与救应,总纲一位改取${Y.ziping.name}论用神成败救应`):M(q("zp-yongshen"),"用神从月令取、四吉顺用四凶逆用,是通用总纲"),u}function L(T){return!T||!T.length?"":T.map(s=>`《${Y[s.book].name}·${s.chapter}》「${s.quote}」`).join(`
72
+ `)}return{CLASSIC_BOOKS:Y,CLASSICS:K,classicOf:q,suiyunClassicOf:A,classicsFor:y,classicsText:L}})(),D.wuyunliuqi=(function(){const{fail:Y}=D.fail||{},{STEMS:K,BRANCHES:Q,termInstantJd:W,ganzhiName:B,formatJd:q}=D.calendar||{},{assertCivil:A,daysInMonth:P}=D.validate||{},z=["厥阴风木","少阴君火","少阳相火","太阴湿土","阳明燥金","太阳寒水"],b=["厥阴风木","少阴君火","太阴湿土","少阳相火","阳明燥金","太阳寒水"],y=["木","火","土","金","水"],L={甲:"土",己:"土",乙:"金",庚:"金",丙:"水",辛:"水",丁:"木",壬:"木",戊:"火",癸:"火"},T=[1,2,3,4,5,0],s={木:{tone:"角",organ:"肝",nature:"风",text:"木运"},火:{tone:"徵",organ:"心",nature:"热",text:"火运"},土:{tone:"宫",organ:"脾",nature:"湿",text:"土运"},金:{tone:"商",organ:"肺",nature:"燥",text:"金运"},水:{tone:"羽",organ:"肾",nature:"寒",text:"水运"}},u={厥阴风木:{wuxing:"木",organ:"肝",nature:"风",short:"风木"},少阴君火:{wuxing:"火",organ:"心",nature:"热",short:"君火"},太阴湿土:{wuxing:"土",organ:"脾",nature:"湿",short:"湿土"},少阳相火:{wuxing:"火",organ:"三焦",nature:"火",short:"相火"},阳明燥金:{wuxing:"金",organ:"肺",nature:"燥",short:"燥金"},太阳寒水:{wuxing:"水",organ:"肾",nature:"寒",short:"寒水"}},c={木:{tai:{climate:"风气偏胜,草木早荣",organ:"肝气偏旺,脾土受克",sign:"易怒、胁胀、食少、肢体震颤"},bu:{climate:"风气不足,燥气乘之",organ:"肝木不及,肺金偏胜",sign:"筋脉拘急、目干、情绪低落"}},火:{tai:{climate:"火气偏胜,暑热早至",organ:"心火偏旺,肺金受克",sign:"心烦、失眠、咳喘、口疮"},bu:{climate:"火气不足,寒气乘之",organ:"心火不及,肾水偏胜",sign:"心悸、畏寒、胸闷、精神不振"}},土:{tai:{climate:"雨湿偏多,土气壅滞",organ:"脾湿偏胜,肾水受克",sign:"腹胀、身重、大便黏、四肢困倦"},bu:{climate:"土气不足,风气乘之",organ:"脾土不及,肝木偏胜",sign:"飧泄、乏力、腹鸣、食后胀"}},金:{tai:{climate:"燥气偏胜,天气清凉",organ:"肺燥偏胜,肝木受克",sign:"干咳、鼻干、皮肤干、筋急"},bu:{climate:"金气不足,火气乘之",organ:"肺金不及,心火偏胜",sign:"咳逆、鼻塞、咽干、易感外邪"}},水:{tai:{climate:"寒气偏胜,冰霜早降",organ:"肾寒偏胜,心火受克",sign:"畏寒、水肿、腰冷、心悸"},bu:{climate:"水气不足,湿土乘之",organ:"肾水不及,脾土偏胜",sign:"腰膝无力、小便不利、下肢沉"}}},M={厥阴风木:{climate:"风气流行,草木动摇",sign:"眩晕、抽搐、胁痛、过敏类症状偏多"},少阴君火:{climate:"热气偏胜,暑热早来",sign:"心烦、口疮、失眠、咽痛偏多"},太阴湿土:{climate:"湿气偏胜,阴雨多",sign:"腹胀、身重、泄泻、关节酸沉偏多"},少阳相火:{climate:"火气偏胜,炎热",sign:"头痛、目赤、耳鸣、疮疡偏多"},阳明燥金:{climate:"燥气偏胜,干燥少雨",sign:"干咳、鼻干、皮肤裂、便秘偏多"},太阳寒水:{climate:"寒气偏胜,霜雪多",sign:"畏寒、关节痛、腹痛、水肿偏多"}},x={covered:["运气年(大寒为界)与年干支","岁运(中运)五行与太过/不及、五音太少","司天、在泉","主运五步与客运五步(含每步起止时刻)","主气六步与客气六步(含每步起止时刻)","当前时刻所处的运与气","天符 / 岁会 / 同天符 / 同岁会 / 太乙天符"],notCovered:["《素问·六元正纪大论》六十年逐年全文与「先立其年,以明其气」的逐气病证条辨","刚柔失守、升降不前、不迁正、不退位等岁气交司推演","运气合参的方药与针灸取穴","地域与体质差异对运气的修正"],note:"病位、气候与症状倾向都是传统说法的转述,用来对照季节与身体感受,不是诊断结论。"},$=365.25/5,w=365.25/6;function o(oe){const i=K.indexOf(oe);if(i<0)throw Y("E_INPUT",`天干「${oe}」不在十干之内`);return i}function d(oe){const i=Q.indexOf(oe);if(i<0)throw Y("E_INPUT",`地支「${oe}」不在十二支之内`);return i}function h(oe){const i=((oe-4)%60+60)%60;return B(i)}function g(oe){const i=o(oe),m=L[oe],C=i%2===0,v=s[m];return{gan:oe,wuxing:m,tone:v.tone,tai:C,name:`${m}运${C?"太过":"不及"}`,taiShao:`${C?"太":"少"}${v.tone}`,organ:v.organ,nature:v.nature}}function N(oe){const i=d(oe),m=T[i%6],C=(m+3)%6;return{sitIdx:m,zaiIdx:C,sitian:b[m],zaiquan:b[C]}}function _(oe){return y.map((i,m)=>{const C=s[i],v=oe+m*$,f=v+$;return{no:m+1,wuxing:i,name:`${i}运`,tone:C.tone,taiShao:`太${C.tone}`,startJd:v,endJd:f,startTime:q(v),endTime:q(f),days:Math.round($*100)/100}})}function O(oe,i){const m=y.indexOf(oe.wuxing);return Array.from({length:5},(C,v)=>{const f=y[(m+v)%5],S=s[f],k=v%2===0?oe.tai:!oe.tai,R=i+v*$,H=R+$;return{no:v+1,wuxing:f,tai:k,name:`${f}运${k?"太过":"不及"}`,tone:S.tone,taiShao:`${k?"太":"少"}${S.tone}`,startTime:q(R),endTime:q(H)}})}function J(oe){return z.map((i,m)=>{const C=u[i],v=oe+m*w,f=v+w;return{no:m+1,qi:i,wuxing:C.wuxing,organ:C.organ,nature:C.nature,name:`${i}`,startTime:q(v),endTime:q(f),days:Math.round(w*100)/100}})}function se(oe,i){const m=((oe-2)%6+6)%6;return Array.from({length:6},(C,v)=>{const f=b[(m+v)%6],S=u[f],k=i+v*w,R=k+w;return{no:v+1,qi:f,wuxing:S.wuxing,organ:S.organ,nature:S.nature,name:f,sitian:v===2,zaiquan:v===5,startTime:q(k),endTime:q(R)}})}const F={子:"水",午:"火",卯:"木",酉:"金",辰:"土",戌:"土",丑:"土",未:"土",寅:null,申:null,巳:null,亥:null};function be(oe,i){const m=W(oe,1);return i>=m?{nian:oe,startJd:m,endJd:W(oe+1,1)}:{nian:oe-1,startJd:W(oe-1,1),endJd:m}}function we(oe,i,m,C){const v=oe.wuxing,f=u[i].wuxing,S=u[m].wuxing,k=F[C]||null,R=v===f,H=!!k&&v===k,U=oe.tai&&v===S,te=!oe.tai&&v===S,re=R&&H,Z=[];return re?Z.push("太乙天符:中运与司天同气、又与年支本位同气,传统上视为六十年里最「重」的一类年份之一,气候与病气的变化都容易被放大。"):R&&Z.push("天符:中运与司天同气。传统上说这一年本气专一而偏胜,气候变化来得整齐。"),H&&Z.push("岁会:中运与年支本位同气。传统上说这一年气令与地域相应,来得比较「正」。"),U&&Z.push("同天符:阳年太过之运与在泉同气,下半年(在泉主事)容易延续上半年的偏胜。"),te&&Z.push("同岁会:阴年不及之运与在泉同气,本气本已不足,下半年又被同一气拖住,恢复更慢。"),{tianFu:R,suiHui:H,tongTianFu:U,tongSuiHui:te,taiYi:re,notes:Z}}function je(oe){A(oe,"五运六气");const{year:i,month:m,day:C}=oe;if(C>P(i,m))throw Y("E_INPUT",`非法日期:${i} 年 ${m} 月没有 ${C} 日`);const v=Number.isInteger(oe.hour)?oe.hour:12,f=Number.isInteger(oe.minute)?oe.minute:0;if(v<0||v>23)throw Y("E_INPUT","hour 要在 0–23 之间");if(f<0||f>59)throw Y("E_INPUT","minute 要在 0–59 之间");const S=W(i,1)*0+(function(){return(function(Oe,Pe,Ue){const Fe=Math.floor((14-Pe)/12),Ge=Oe+4800-Fe,Be=Pe+12*Fe-3;return Ue+Math.floor((153*Be+2)/5)+365*Ge+Math.floor(Ge/4)-Math.floor(Ge/100)+Math.floor(Ge/400)-32045})(i,m,C)-.5+(v*60+f)/1440})(),k=be(i,S),R=h(k.nian),H=g(R.stem),U=N(R.branch),te=_(k.startJd),re=O(H,k.startJd),Z=J(k.startJd),le=se(U.sitIdx,k.startJd),ue=S-k.startJd,fe=Math.min(5,Math.max(1,Math.floor(ue/$)+1)),pe=Math.min(6,Math.max(1,Math.floor(ue/w)+1)),ee=te[fe-1],me=re[fe-1],ve=Z[pe-1],_e=le[pe-1],qe=c[H.wuxing][H.tai?"tai":"bu"],Ze=M[U.sitian],De=M[U.zaiquan],Le=we(H,U.sitian,U.zaiquan,R.branch),Me=u[_e.qi].wuxing,Se=u[ve.qi].wuxing,Ne={木:"火",火:"土",土:"金",金:"水",水:"木"},Ce={木:"土",土:"水",水:"火",火:"金",金:"木"};let xe="相安";Me===Se?xe="同气":Ne[Me]===Se?xe="客生主(顺)":Ne[Se]===Me?xe="主生客(泄)":Ce[Me]===Se?xe="客克主(逆)":Ce[Se]===Me&&(xe="主克客(从)");const Ie=`${U.sitian}司天 · ${H.name}`,ze=`这一运气年是「${R.name}」年:中运${H.name}(${H.taiShao}),${U.sitian}司天、${U.zaiquan}在泉。传统上把这样的组合读成「${qe.climate}」,司天一侧偏「${Ze.climate}」,在泉一侧偏「${De.climate}」。`;return{system:"wuyunliuqi",meta:{datetime:`${i}-${String(m).padStart(2,"0")}-${String(C).padStart(2,"0")} ${String(v).padStart(2,"0")}:${String(f).padStart(2,"0")}`,nian:k.nian,ganzhi:R.name,stem:R.stem,branch:R.branch,isYang:H.tai,startTime:q(k.startJd),endTime:q(k.endJd),dayInYear:Math.round(ue*100)/100},year:{ganzhi:R.name,stem:R.stem,branch:R.branch,nian:k.nian,startTime:q(k.startJd),endTime:q(k.endJd),note:"运气年以大寒为界:交大寒之前仍算上一运气年,与八字按立春定年柱不同。"},zhongyun:{...H,effect:qe,text:`中运${H.name}(${H.taiShao}),主${H.organ},气候偏${H.nature}。`},sitian:{qi:U.sitian,...u[U.sitian],climate:Ze,text:`${U.sitian}司天:上半年(三之气起)主事,气候偏${u[U.sitian].nature}。`},zaiquan:{qi:U.zaiquan,...u[U.zaiquan],climate:De,text:`${U.zaiquan}在泉:下半年(终之气)主事,气候偏${u[U.zaiquan].nature}。`},zhuYun:te,keYun:re,zhuQi:Z,keQi:le,current:{dayInYear:Math.round(ue*100)/100,yunNo:fe,qiNo:pe,zhuYun:ee,keYun:me,zhuQi:ve,keQi:_e,lin:xe,text:`此刻在第 ${fe} 运(主运${ee.name} / 客运${me.name})、第 ${pe} 气(主气${ve.qi} / 客气${_e.qi},客气加临主气:${xe})。`},special:Le,combo:{name:Ie,text:ze},scope:x}}return{YUN_DAYS:$,QI_DAYS:w,ZHU_QI_ORDER:z,QI_ORDER:b,ZHU_YUN_ORDER:y,YUN_OF_STEM:L,SITIAN_INDEX_OF_BRANCH:T,YUN_INFO:s,QI_INFO:u,YUN_EFFECT:c,QI_CLIMATE:M,WUYUNLIUQI_SCOPE:x,yearGanzhiOf:h,zhongyunOf:g,sitianOf:N,yunYearOf:be,specialOf:we,buildWuyunliuqi:je}})(),D.followup=(function(){const{ZIWEI_STARS:Y}=D["interpret-data"]||{},K=[{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:["出行","搬家","旅行","出国","迁","远行"]}],Q={career:"官禄",wealth:"财帛",love:"夫妻",health:"疾厄",study:"官禄",travel:"迁移",overall:"命宫"},W=(c,M)=>{const x=String(c).match(/(20\d{2})\s*年?/);if(x)return Number(x[1]);const $=Array.isArray(M.liunian)&&M.liunian[0]?Number(M.liunian[0].year):null;return $?/明年/.test(c)?$+1:/后年/.test(c)?$+2:/去年/.test(c)?$-1:/今年|本年/.test(c)?$:null:null},B=c=>K.find(M=>M.words.some(x=>String(c).includes(x)))||null;function q(c,M){const x=W(M,c),$=B(M),w=Array.isArray(c.liunian)?c.liunian:[],o=Array.isArray(c.dayun?.list)?c.dayun.list:[],d=w.map(h=>h.year);if(x&&!w.some(h=>Number(h.year)===x))return{ok:!1,year:x,topic:$,answer:`这一盘已排的流年范围是 ${d[0]}–${d[d.length-1]},没有 ${x} 年。可以把问题改到范围内,或用 asOf 指定你想看的年份重新排盘。`,evidence:[`已排流年:${d.join("、")}`],confidence:"弱"};if(x){const h=w.find(se=>Number(se.year)===x),g=o.find(se=>Number(se.startAge)<=Number(h.age)&&Number(h.age)<=Number(se.startAge)+9)||null,N=h.luck?.tier||"平",_=(h.luck?.reasons||[]).slice(0,3),O=(h.relations||[]).join("、"),J=$?P(c,$.key):"";return{ok:!0,year:x,topic:$,answer:`${x} 年(${h.ganzhi})流年,十神为${h.stemTenGod||"—"},档位「${N}」;所行大运 ${g?`${g.ganzhi}(${g.luck?.tier||"平"})`:"未取到"}。${_.length?`理由:${_.join(",")}。`:""}${O?`与该年地支相关的原局关系:${O}。`:""}${J}`,evidence:[`流年 ${h.year} ${h.ganzhi}·${h.stemTenGod||""}·${N}`,g?`大运 ${g.ganzhi}·${g.luck?.tier||"平"}`:"",O?`原局关系 ${O}`:"",$?`问题方向:${$.label}`:""].filter(Boolean),confidence:g&&_.length?"强":"中"}}if($){const h={wealth:"overall",study:"work",travel:"overall"}[$.key]||$.key,g=(c.interpret?.dimensions||[]).find(_=>_.key===$.key||_.key===h);if(g){const _=c.frame&&c.frame.godStats&&c.frame.godStats.groups||{},O=$.key==="wealth"?` 财星权重 ${Number(_.财||0)}(只作结构参考,不含金额)。`:"";return{ok:!0,year:null,topic:$,answer:`按${$.label}这条线看:${g.text}${O}${g.advice?` 建议:${g.advice}`:""}`,evidence:(g.evidence||[]).slice(0,4),confidence:g.confidence||"中"}}const N=c.frame&&c.frame.godStats&&c.frame.godStats.groups||{};if(Object.keys(N).length){const _=["比劫","食伤","财","官杀","印"].map(O=>`${O} ${Number(N[O]||0)}`);return{ok:!0,year:null,topic:$,answer:`「${$.label}」这条线,这一盘只带了盘面结构:${_.join("、")}。具体吉凶与建议需要解析层(排盘时加 withInterpret),追问这里不自行推演。`,evidence:_.slice(0,3),confidence:"弱"}}}return{ok:!1,year:null,topic:$,answer:`这个问题里没有识别到具体的年份或方面。可以这样问:「2027 年事业怎么样」「财运如何」「感情在 2028 年」;已排流年是 ${d[0]}–${d[d.length-1]}。`,evidence:[`可问年份:${d.join("、")}`],confidence:"弱"}}function A(c,M){const x=W(M,c),$=B(M),w=Array.isArray(c.liunian)?c.liunian:[];if(x&&!w.some(o=>Number(o.year)===x))return{ok:!1,year:x,topic:$,answer:`这一盘的流年表覆盖 ${w[0]?.year}–${w[w.length-1]?.year},没有 ${x} 年;可以换一个年份,或用 asOf 指定起点重新排盘。`,evidence:[`流年表:${w.map(o=>o.year).join("、")}`],confidence:"弱"};if(x){const o=w.find(h=>Number(h.year)===x),d=o.daxian||{};return{ok:!0,year:x,topic:$,answer:`${x} 年(${o.ganzhi},${o.age} 岁)流年命宫落在「${o.lifePalace?o.lifePalace.palace:"—"}」,四化为 ${(o.mutagen||[]).join("、")||"不明显"};所行大限${d.palace?`在${d.palace}(${d.start}–${d.end} 岁)`:"未取到"}。${$?`与「${$.label}」对应的宫位信号见下条依据。`:""}`,evidence:[`流年命宫 ${o.lifePalace?o.lifePalace.palace:"—"}(${o.lifePalace?o.lifePalace.branch:"—"})`,`四化 ${(o.mutagen||[]).join("、")||"不明显"}`,d.palace?`大限 ${d.palace}·${d.start}–${d.end}岁`:""].filter(Boolean),confidence:(o.mutagen||[]).length>=3?"强":"中"}}if($){const o=Q[$.key]||"命宫",d=(c.palaces||[]).find(h=>h.palace===o);if(d){const h=(d.stars||[]).filter(N=>N.type==="主星").map(N=>N.name),g=h.map(N=>Y[N]?.trait).filter(Boolean).slice(0,2).join(";");return{ok:!0,year:null,topic:$,answer:`「${$.label}」看${o}:主星${h.length?h.join("、"):"无正曜(借对宫)"}${g?`——${g}`:""}。宫支${d.branch},${d.stems,""}生年四化与煞星的影响需结合报告里的对应分节一起看。`,evidence:[`${o} ${d.branch}·${h.join("、")||"无正曜"}`,...(d.shensha||[]).slice(0,3)],confidence:h.length?"强":"弱"}}}return{ok:!1,year:null,topic:$,answer:"没有识别到具体年份或方面。可以问「2028 年事业」「感情怎么样」「财运在 2030 年」;也可以直接问某个宫位,如「夫妻宫」。",evidence:[],confidence:"弱"}}function P(c,M){return`这段时间可以重点对照报告里「${{career:"事业",wealth:"财富",love:"感情",health:"健康",study:"学业",travel:"出行"}[M]||"整体"}」一节看。`}function z(c,M){const x=B(M),$=Array.isArray(c.interpret?.sections)?c.interpret.sections:[],w=x?$.find(h=>h.label.includes(x.label)||h.text.includes(x.label)):null;if(w)return{ok:!0,year:null,topic:x,answer:w.text,evidence:[`引用分节:${w.label}`],confidence:"中"};const o=$[0];if(o)return{ok:!1,year:null,topic:x,answer:`这一盘的追问需要落到具体方面(事业 / 财富 / 感情 / 健康 / 学业 / 出行)。先看「${o.label}」这一节,或把问题说得更具体一点。`,evidence:[],confidence:"弱"};const d=String(c&&c.summary||"").trim();if(d){const h=d.split(`
73
+ `).map(N=>N.trim()).filter(Boolean),g=x?h.filter(N=>x.words.some(_=>N.includes(_))):[];return{ok:!0,year:null,topic:x,answer:g.length?`${x.label}相关的盘面字段:${g.slice(0,3).join(";")}。这一盘没带解析层,只列盘面事实,不在这里补吉凶结论。`:`这一盘没有解析层,只能按盘面字段回答;可问的方向:${K.map(N=>N.label).join(" / ")}。下面任取摘要是盘面原文,未作推演。`,evidence:(g.length?g:h).slice(0,4),confidence:"弱"}}return{ok:!1,year:null,topic:x,answer:"这一盘暂时没有可追问的分节,也没有摘要字段;先重新排一次盘,再问具体方面。",evidence:[],confidence:"弱"}}function b(c,M){const x=String(M||"").trim(),$=c&&c.system==="bazi"?q(c,x):c&&c.system==="ziwei"?A(c,x):z(c,x);return{question:x,...$}}const y={bazi:"八字(四柱)",ziwei:"紫微斗数",liuyao:"六爻",meihua:"梅花易数",daliuren:"大六壬",qimen:"奇门遁甲",tarot:"塔罗",hepan:"合盘",chenggu:"称骨",almanac:"黄历",zeri:"择日",star:"星座",numerology:"生命数字",mbti:"十六型人格",trend:"人生 K 线",fengshui:"风水",name:"起名",convert:"公农历互转"},L=Object.freeze({bazi:["基本信息","四柱(日主/十神/藏干)","旺衰·格局·用神","合冲·神煞","起运·大运·流年","古籍依据"],ziwei:["基本信息","命宫/身宫与五行局","十二宫(主星/辅煞/四化)","格局与三方四正","大限/流年","古籍依据"],liuyao:["所问与用神","本卦/变卦(世应/动爻/六亲)","月建日辰(旺衰/空破)","应期线索","卦辞与依据"],meihua:["所问与体用","本卦/互卦/变卦","五行生克","应期与依据"],daliuren:["天地盘(月将/贵人)","四课","三传","课体与神将","依据"],qimen:["四柱与局数","九宫(星门神/天盘干)","用神落宫","门宫·干宫·十干克应","旺衰·击刑入墓","依据"],tarot:["问题与牌阵","逐牌(正逆/牌面/元素对应)","牌间关系","综合倾向","边界"],fengshui:["坐向与元运","运盘/山盘/向盘","旺山旺向","取象与边界"]}),T=Object.freeze(["基本信息","盘面事实","结构与关系","倾向","边界"]);function s(c){return L[c]||T}function u(c,M={}){const x=y[c&&c.system]||c&&c.system||"未知体系",w=String(M&&M.question||"").trim()||"请先用一句白话讲清这张盘的主线,再指出最值得注意的一两处,并说明每处的具体依据。",o=Number.isFinite(M&&M.maxChars)&&M.maxChars>=400?M.maxChars:3e3,d=String(c&&c.summary||"").trim(),h=d.length>o,g=h?`${d.slice(0,o)}…(摘要已截断)`:d,N=M&&typeof M.interpret=="object"&&M.interpret||c&&typeof c.interpret=="object"&&c.interpret||null,_=String(N&&N.answer||"").trim(),O=String(N&&N.plain||"").trim(),J=[];_&&J.push(`直答:${_}`),O&&J.push(`说人话:${O}`);const F=["【命理追问】下面这张盘是命理插件刚排好的,请就着它回答我的问题;不用重新排盘,盘面字段已经够用。",`体系:${x}`,`所问:${w}`,"",...J.length?["——开场结论(插件已按同一套规则算好,开场先沿用这句;措辞可改,口径别换)——",...J,""]:[],"——盘面层次(从上到下读,别跳层)——",`${x}:${s(c&&c.system).join(" → ")}`,"先复述事实,再讲结构与时间;上一层没交代清楚,不要跳到下一层。","","——盘面摘要——",g||"(这张盘没有摘要字段,请先让我重新排一次。)",...String(c&&c.jing||"").trim()?["","——《周易》经文原文(本插件按三份底本互校照录,〔一作…〕是异文,不是改写)——",String(c.jing).trim()]:[],...c&&c.zuoyao&&c.zuoyao.verses?["",`——紫微杂曜安星诀(本盘开了全表,${c.zuoyao.placed.length} 颗已按下列诀安入;诀文出多处近代通行辑本并核,属通行说,不是《紫微斗数全书》原文)——`,String(c.zuoyao.verses).trim(),`未另立:${(c.zuoyao.skipped||[]).join(";")}`]:[],"","——回答要求——","读者不懂命理。按下面的骨架答;任何一句他看不懂,就算没写完:",J.length?"1) 开头一句结论:先沿用上面的「开场结论」,再用一句不用术语的话说清这张盘的主线——只读这一句也该有收获;":"1) 开头一句结论:不用术语,一句话说清这张盘的主线,只读这一句也该有收获;","2) 第二段只复述盘面骨架:按上面的层次用 2–4 行写事实(如四柱、格局、用神、大运),不掺倾向,让读者知道后面的判断从哪来;","3) 判断最多两条,按重要性排序,每条分四行写:"," 盘面|只引盘面已有的字(具体的柱、宫或爻、字段名),不掺解释;"," 白话|把上一行的术语当场翻成日常话——调候 / 化气 / 通关 / 空亡 / 争合 这类词必须落地,一个词只翻一次,不连续堆三个以上;"," 倾向|说「更可能……」,讲清它在现实里大概意味着什么,用概率语气;"," 边界|这条在什么情况下不成立;盘面没给的,直接写「这盘里看不出来」;","4) 收尾一句「如果只记一件事」:给一条能核对、能动手的观察点,并说明它出自上面哪条盘面依据;","5) 别把传统说法当成已证实的事实:不下绝对断言,也不用「肯定」「绝对」这类词,更不写「格局很好」「运程不顺」这种没有信息的空话。"].join(`
74
+ `);return{text:F,question:w,system:c&&c.system||"",label:x,chars:F.length,truncated:h}}return{followup:b,READING_ORDERS:L,READING_ORDER_FALLBACK:T,readingOrderOf:s,askPrompt:u}})(),D.revise=(function(){const Y=[{key:"ziwei",label:"紫微",re:/紫微|斗数/},{key:"bazi",label:"八字",re:/八字|四柱/},{key:"liuyao",label:"六爻",re:/六爻|摇卦/},{key:"qimen",label:"奇门",re:/奇门/},{key:"daliuren",label:"大六壬",re:/大六壬|六壬/},{key:"tarot",label:"塔罗",re:/塔罗|抽牌/},{key:"meihua",label:"梅花",re:/梅花/},{key:"hepan",label:"合盘",re:/合盘|合婚/},{key:"almanac",label:"黄历",re:/黄历|老黄历/},{key:"zeri",label:"择日",re:/择日|挑日子/},{key:"fengshui",label:"风水",re:/风水/},{key:"name",label:"起名",re:/起名|取名/},{key:"chenggu",label:"称骨",re:/称骨/},{key:"xiaoliuren",label:"小六壬",re:/小六壬/},{key:"star",label:"星座",re:/星座/},{key:"numerology",label:"生命数字",re:/生命数字|生命灵数/},{key:"mbti",label:"MBTI",re:/mbti|人格测试|十六型/i},{key:"trend",label:"人生 K 线",re:/k\s*线|人生曲线/i},{key:"convert",label:"公农历互转",re:/农历转公历|公历转农历|公农历/}],K=[{key:"love",label:"感情",re:/感情|婚姻|恋爱|对象|夫妻/},{key:"wealth",label:"财运",re:/财运|财富|赚钱|收入|破财/},{key:"career",label:"事业",re:/事业|工作|升职|跳槽/},{key:"health",label:"健康",re:/健康|身体|疾病|病/},{key:"study",label:"学业",re:/学业|考试|考研|升学|读书/},{key:"travel",label:"出行",re:/出行|搬家|迁移|旅行|外地/}],Q=/换成|改成|改为|换到|改看|再看|再看一下|换一套|排一?张|用|按|看/,W=z=>String(z||"").replace(/(出生|出生地|所在地|人)$/,"").replace(/[的了].*$/,"").trim();function B(z){const b=String(z??"").trim(),y={},L=[],T=[];if(!b)return{text:"",patch:y,labels:L,ignored:T};if(Q.test(b)){for(const c of Y)if(c.re.test(b)){y.system=c.key,L.push({key:"system",label:"体系",value:c.key,display:c.label});break}}/女命|女性|换成女|改成女|女盘/.test(b)?(y.gender="female",L.push({key:"gender",label:"性别",value:"female",display:"女"})):/男命|男性|换成男|改成男|男盘/.test(b)&&(y.gender="male",L.push({key:"gender",label:"性别",value:"male",display:"男"})),/晚子时/.test(b)&&(/不换日|不换天|算当日|归当日|按当日|当天/.test(b)?(y.lateZi=!1,L.push({key:"lateZi",label:"晚子时",value:!1,display:"23:00 后仍算当日"})):/换日|算次日|归次日|按次日|第二天|次日/.test(b)&&(y.lateZi=!0,L.push({key:"lateZi",label:"晚子时",value:!0,display:"23:00 后算次日"}))),/真太阳时/.test(b)&&(/不用|不要|关闭|关掉|取消|不算/.test(b)?(y.trueSolar=!1,L.push({key:"trueSolar",label:"真太阳时",value:!1,display:"用东八区平太阳时"})):(y.trueSolar=!0,L.push({key:"trueSolar",label:"真太阳时",value:!0,display:"按出生地经度校正"}))),/夏令时/.test(b)&&(/不用|不要|关闭|关掉|取消|不校正/.test(b)?(y.dst=!1,L.push({key:"dst",label:"夏令时",value:!1,display:"不自动校正 1986–1991 夏令时"})):(y.dst=!0,L.push({key:"dst",label:"夏令时",value:!0,display:"自动校正 1986–1991 夏令时"})));const s=b.match(/出生在\s*([\u4e00-\u9fa5]{2,12})/)||b.match(/出生地(?:改成|改为|换成|换到|是|为)?\s*([\u4e00-\u9fa5]{2,12})/)||b.match(/改到\s*([\u4e00-\u9fa5]{2,12})\s*出生/);if(s){const c=W(s[1]);c.length>=2&&(y.address=c,L.push({key:"address",label:"出生地",value:c,display:c}))}const u=b.match(/(?:看|查|问|到|到了|临近)\s*((?:19|20)\d{2})\s*年/)||b.match(/((?:19|20)\d{2})\s*年(?:的)?(?:运势|怎么样|如何|会怎样|流年)/);if(u){const c=Number(u[1]);y.asOf=`${c}-01-01T00:00`,L.push({key:"asOf",label:"流年基准",value:y.asOf,display:`${c} 年`})}else/(出生|生年)/.test(b)&&/(19|20)\d{2}\s*年/.test(b)&&T.push("出生年份没改:一句话改不出日与时辰,请直接传 datetime(如 1993-04-08T06:20)");for(const c of K)if(c.re.test(b)){y.direction=c.key,L.push({key:"direction",label:"询问方向",value:c.key,display:c.label});break}return/解读|详解|详细说|说人话/.test(b)&&!/不要解读|不用解读|别解读/.test(b)&&(y.withInterpret=!0,L.push({key:"withInterpret",label:"解读",value:!0,display:"附解析与详解"})),{text:b,patch:y,labels:L,ignored:T}}const q=Y,A=K;function P(z,b){if(b==null)return null;if(z==="system"){const y=Y.find(L=>L.key===b);return y?y.label:String(b)}if(z==="gender")return b==="female"?"女":b==="male"?"男":String(b);if(z==="direction"){const y=K.find(L=>L.key===b);return y?y.label:String(b)}if(typeof b=="boolean")return b?"开":"关";if(z==="asOf"){const y=String(b).match(/^(\d{4})/);return y?`${y[1]} 年`:String(b)}return String(b)}return{parseRevision:B,REVISE_SYSTEMS:q,REVISE_DIRECTIONS:A,displayValue:P}})(),D.handle=(function(){const{fail:Y}=D.fail||{},K="mc1.",Q=new Set(["handle","trace","shadow","shadowVersion","diff","withInterpret","detail","cross","verifyPast","rectify","events","ask","followup","question","geocode","caliber","geo","longitudeFromGeo","revise"]),W=d=>d!==null&&typeof d=="object"&&!Array.isArray(d);function B(d){if(Array.isArray(d))return`[${d.map(g=>B(g===void 0?null:g)).join(",")}]`;if(W(d))return`{${Object.keys(d).filter(N=>d[N]!==void 0).sort().map(N=>`${JSON.stringify(N)}:${B(d[N])}`).join(",")}}`;const h=JSON.stringify(d===void 0?null:d);return h===void 0?"null":h}function q(d){let h=2166136261;for(let g=0;g<d.length;g++)h^=d.charCodeAt(g),h=Math.imul(h,16777619)>>>0;return h.toString(16).padStart(8,"0")}const A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function P(d){const h=[];for(const g of String(d)){let N=g.codePointAt(0);N<128?h.push(N):N<2048?h.push(192|N>>6,128|N&63):N<65536?h.push(224|N>>12,128|N>>6&63,128|N&63):h.push(240|N>>18,128|N>>12&63,128|N>>6&63,128|N&63)}return h}function z(d){let h="";for(let g=0;g<d.length;){const N=d[g];let _,O;N<128?(_=N,O=1):N<224?(_=N&31,O=2):N<240?(_=N&15,O=3):(_=N&7,O=4);for(let J=1;J<O;J++)_=_<<6|d[g+J]&63;g+=O,h+=String.fromCodePoint(_)}return h}function b(d){const h=P(d);let g="";for(let N=0;N<h.length;N+=3){const _=h[N],O=h[N+1],J=h[N+2];if(g+=A[_>>2],g+=A[(_&3)<<4|(O===void 0?0:O)>>4],O===void 0||(g+=A[(O&15)<<2|(J===void 0?0:J)>>6],J===void 0))break;g+=A[J&63]}return g}function y(d){const h=[];let g=0,N=0;for(const _ of d){const O=A.indexOf(_);if(O<0)throw new Error(`不是 base64url 字符:${_}`);g=g<<6|O,N+=6,N>=8&&(N-=8,h.push(g>>N&255))}return z(h)}function L(d={}){const h={};for(const[g,N]of Object.entries(d||{}))Q.has(g)||N===void 0||(h[g]=N);return h}function T(d={}){const h=L(d);if(!Object.keys(h).length)return"";const g=b(B(h));return`${K}${g}.${q(g)}`}function s(d){if(typeof d!="string"||!d.trim())throw Y("E_HANDLE","handle 必须是非空字符串;没拿到句柄时照常传 system + datetime 等原始参数即可");const h=d.trim();if(!h.startsWith(K))throw Y("E_HANDLE",`handle 前缀不对(应以 ${K} 开头):句柄来自旧版本或复制不全,重新排一次盘取新的 handle`);const g=h.slice(K.length),N=g.lastIndexOf(".");if(N<=0)throw Y("E_HANDLE","handle 缺少校验位:复制时可能被截断,重新取一次");const _=g.slice(0,N),O=g.slice(N+1);if(q(_)!==O)throw Y("E_HANDLE","handle 校验不通过:内容被改动或截断,重新排一次盘取新的 handle");let J;try{J=JSON.parse(y(_))}catch{throw Y("E_HANDLE","handle 内容无法解析(不是本插件生成的句柄),重新排一次盘取新的 handle")}if(!W(J))throw Y("E_HANDLE","handle 内容不是参数对象,重新排一次盘取新的 handle");return J}const u=new Set(["__proto__","constructor","prototype"]),c={hour:["chenggu","xiaoliuren","name"],minute:["name"],date:["xiaoliuren"],mode:["convert","meihua","xiaoliuren"],action:["fengshui","name"]};function M(d,h){if(!W(d))return d;const g=d.system;if(typeof g!="string"||!g)return d;for(const[N,_]of Object.entries(c))h.has(N)||d[N]===void 0||_.includes(g)||delete d[N];return d}function x(...d){const h=new Set;for(const g of d)if(W(g))for(const[N,_]of Object.entries(g))_!==void 0&&N!=="handle"&&h.add(N);return h}function $(d={}){if(!W(d))return d;const{handle:h,...g}=d;if(h==null||h==="")return{...g};const _={...s(h)};for(const[O,J]of Object.entries(g))J===void 0||u.has(O)||(_[O]=J);return M(_,x(g)),_}return{handlePayload:L,encodeHandle:T,decodeHandle:s,pruneForeignKeys:M,ownedKeys:x,resolveHandle:$,HANDLE_PREFIX:K,handleChecksum:q}})(),D.bridge=(function(){const{encodeHandle:Y,decodeHandle:K,HANDLE_PREFIX:Q}=D.handle||{},{askPrompt:W}=D.followup||{},B=200,q=60,A={bazi:"八字",ziwei:"紫微",liuyao:"六爻",meihua:"梅花",daliuren:"大六壬",qimen:"奇门",hepan:"合盘",tarot:"塔罗",almanac:"黄历",zeri:"择日",chenggu:"称骨",xiaoliuren:"小六壬",star:"星座",numerology:"生命数字",mbti:"人格",trend:"人生K线",fengshui:"风水",name:"起名",convert:"农历",constitution:"体质",wuyunliuqi:"运气",taiyi:"太乙"},P=$=>A[$]||$||"未知体系";function z($){const w=String($||""),o=w.indexOf("#");return o<0?w:w.slice(0,o)}function b($){try{return encodeURIComponent($)}catch{return""}}function y($){try{return decodeURIComponent($)}catch{return String($||"")}}function L($={},w={}){const o=w||{},h=String(o.handle||$&&$.handle||"").trim()||Y($||{});if(!h||!h.startsWith(Q))return"";const g=String(o.question||"").trim().slice(0,B),N=[`mp=${h}`];return g&&N.push(`q=${b(g)}`),`${z(o.base)}#${N.join("&")}`}function T($){const w=String($||"").trim();if(!w)return{ok:!1,code:"E_LINK",message:"没有链接内容:请粘贴带 #mp= 的完整链接"};let o="";const d=w.indexOf("#");if(d>=0&&w.slice(d+1).trim())o=w.slice(d+1).trim();else{const _=w.indexOf("?");_>=0&&w.slice(_+1).trim()?o=w.slice(_+1).trim():/^mp=/.test(w)&&(o=w)}if(!o)return{ok:!1,code:"E_LINK",message:"链接里没有 #mp= 片段:这不是本插件生成的深链"};const h={};for(const _ of o.split("&")){if(!_)continue;const O=_.indexOf("=");if(O<=0)continue;const J=_.slice(0,O),se=_.slice(O+1);J==="mp"?h.mp=se:J==="q"&&(h.q=se)}if(!h.mp)return{ok:!1,code:"E_LINK",message:"链接里没有 mp 参数(只有问题没有盘):无法还原盘面"};let g;try{g=K(h.mp)}catch(_){return{ok:!1,code:_&&_.code||"E_HANDLE",message:_&&_.message||"句柄无法解析"}}const N=h.q?y(h.q).slice(0,B):"";return{ok:!0,handle:h.mp,args:g,question:N,system:g.system||"",label:P(g.system)}}const s=$=>{const w=/^(\d{4}-\d{1,2}-\d{1,2})[T ](\d{1,2}:\d{2})/.exec(String($||"").trim());if(!w)return{date:"",time:""};const[o,d,h]=w[1].split("-");return{date:`${o}-${String(d).padStart(2,"0")}-${String(h).padStart(2,"0")}`,time:w[2].padStart(5,"0")}},u=["gender","address","trueSolar","lateZi","lines"];function c($){const w=$&&$.ok?$:null,o=w&&w.args||{},d=s(o.datetime),h={tab:o.system||"",date:d.date,time:d.time,question:w&&w.question||"",restored:[],rest:{}};h.tab&&h.restored.push("system"),d.date&&h.restored.push("datetime");for(const g of u)o[g]===void 0||o[g]===null||(h[g]=o[g],h.restored.push(g));h.question&&h.restored.push("question");for(const[g,N]of Object.entries(o))g==="system"||g==="datetime"||u.includes(g)||(h.rest[g]=N);return h}function M($){const w=Object.keys($&&$.rest||{});return w.length?`链接里还有 ${w.length} 项没填回表单(${w.join("、")}):这些只在引擎调用里生效,页面上按默认值显示。`:""}function x($,w={}){const o=w||{},d=$||{},h=d.system||"",g=P(h),N=String(o.question||"").trim(),_=String(d.handle||"").trim();let O="";try{const je=W(d,{question:N,interpret:o.interpret});O=je&&je.text||String(d.summary||"")}catch{O=String(d.summary||"")}const J=N?N.length>q?`${N.slice(0,q)}…`:N:"(未填问题:按摘要讲主线)",se=_?`【命理追问】${g}|${_}|问:${J}`:`【命理追问】${g}|问:${J}`,F={};_&&(F.handle=_),h&&(F.system=h),N&&(F.question=N);const be=JSON.stringify({tool:"metaphysics",v:1,args:F},null,2),we=_?L({handle:_},{question:N,base:o.base}):"";return{system:h,label:g,handle:_,question:N,full:O,brief:se,structured:be,link:we}}return{LINK_MAX_QUESTION:B,askLink:L,parseAskLink:T,formOf:c,restNote:M,askPackages:x}})(),D["plain-summary"]=(function(){const{ASK_KINDS:Y}=D["event-prompt"]||{},{PALACE_FIELD:K,GATE_MEANING:Q}=D["qimen-prompt"]||{},W=Y||{},B=K||{},q=Q||{},A={wealth:"business",career:"career",love:"love",health:"other",study:"career",travel:"action",general:"other"},P=i=>A[i]||(W[i]?i:"other"),z={木:{color:"青、绿",where:"东边、有树有水的地方",daily:"早上多出门走走"},火:{color:"红、橙、紫",where:"南边、向阳的房间",daily:"白天多晒太阳,别总待在阴冷的屋里"},土:{color:"黄、棕、米色",where:"中原地带、干爽高燥处",daily:"把作息和吃饭时间固定下来"},金:{color:"白、银、浅灰",where:"西边、通风利落的地方",daily:"把该断的事断干净,别拖"},水:{color:"黑、深蓝",where:"北边、临水处",daily:"留出独处和放空的时间"}},b={正印:"靠吸收和消化来获得安全感,习惯先想明白再动",偏印:"想得比说得多,一件事会在心里推演出很多种可能",正官:"对规矩和责任敏感,别人一句交代会变成自己的压力",七杀:"对压力和竞争敏感,遇强则强,也容易被强势的人吸引",正财:"对现实条件敏感,不太会被空话打动",偏财:"对机会敏感,愿意为看得见的回报承担风险",食神:"表达温和,喜欢把日子过得有滋味",伤官:"有自己的标准,看不上粗糙的东西,容易先挑毛病",比肩:"自我边界清楚,不太愿意被安排",劫财:"同辈之间容易较劲,也容易替朋友出头"},y={长生:"刚起步,有生机",沐浴:"不安定,容易被外界牵动",冠带:"在成形,开始要面子",临官:"正当力,能扛事",帝旺:"很足,但也容易过满",衰:"开始收力,做事偏保守",病:"使不上劲,需要借外力",死:"静态,不爱主动",墓:"收着、藏着,不爱外露",绝:"在这里使不上劲,容易觉得被压着",胎:"还在孕育,慢热",养:"在积攒,等时机"},L={紫微:"要主导、在意体面",天机:"脑子转得快,爱盘算",太阳:"愿意给出去,也容易被消耗",武曲:"务实,认结果",天同:"图安稳,怕冲突",廉贞:"要强,情绪起伏大",天府:"稳,能存住东西",太阴:"细腻,心思藏在里面",贪狼:"欲望强、多才多艺",巨门:"爱辨析,也容易生口舌",天相:"会配合,擅长讲和",天梁:"老成,愿意护着别人",七杀:"独断,敢冲",破军:"破旧立新,不安于现状"},T={庙:"得力",旺:"得力",得地:"还算得力",平:"一般",陷:"不太稳"},s=i=>[...new Set(i.filter(Boolean))],u={寅:"初春",卯:"仲春",辰:"暮春",巳:"初夏",午:"盛夏",未:"长夏",申:"初秋",酉:"仲秋",戌:"深秋",亥:"初冬",子:"仲冬",丑:"隆冬"};function c(i,m){const C={po:[],chong:[],he:[]};for(const v of i&&i.branches||[])!m||!String(v).includes(m)||(/破/.test(v)?C.po.push(v):/冲/.test(v)?C.chong.push(v):/合/.test(v)&&C.he.push(v));return C}function M(i){const m=i.pillars||{},C=m.day||{},v=m.month||{},f=i.dayMaster||{},S=i.climate||{},k=i.input&&i.input.gender||"female",R=Object.entries(i.frame&&i.frame.godStats&&i.frame.godStats.groups||{}).filter(([,he])=>he>0).sort((he,Oe)=>Oe[1]-he[1]),H=i.frame&&i.frame.yongshen&&i.frame.yongshen.favorTenGods||[],U=i.frame&&i.frame.yongshen&&i.frame.yongshen.favor||[],te=i.frame&&i.frame.yongshen&&i.frame.yongshen.avoid||[],re=u[v.branch]||`${v.branch}月`,Z=S.label==="寒湿"?"天寒水旺,木像冬天的藤,不是不强,是冷得伸展不开":S.label==="燥热"?"火土偏燥,像久旱的地,需要水和湿气来松一松":"寒暖相对均衡,没有极端的偏枯",le=S.need&&S.need.element||U[0]||"",ue=i.frame&&i.frame.caiKu||null,fe=ue?ue.present?ue.opened&&ue.verdict==="开库主发"?`财有库(${ue.store}),而且库门被${ue.opener}冲开了:钱是能进来的,关键在于你肯不肯把它存住。`:ue.opened&&ue.verdict==="开库反主破财"?`财有库(${ue.store})也被冲开了,但这一行在你这盘上是忌:动得越多漏得越快,稳比冲重要。`:ue.opened?`财有库(${ue.store}),库门也开了,但财本身不算厚:有得有失,别指望一次翻身。`:`财有库(${ue.store}),门还关着:不是没有,是要等对的时间或对的选择把它引出来。`:"财这一路没有立库,赚多少看明面上的财星与行运,不靠「开库」这一说。":"",pe=`${f.stem||""}${f.element||""}日主,生在${re}${v.branch||""}月:${Z}。${le?`最需要的是${le}${S.need&&S.need.why?`——${S.need.why}`:""}。`:""}整体${i.strength?i.strength.level:"中和"},不是极旺也不是极弱,所以${i.strength&&i.strength.level==="身弱"?"很多事要靠外部条件配合,硬扛不如借力":"撑得住,关键是别把力气用在错的地方"}。`+fe,ee=R.slice(0,2).map(([he])=>he),me=[];for(const he of Object.values(m))he&&(he.stemTenGod&&me.push(he.stemTenGod),he.hidden&&he.hidden[0]&&he.hidden[0].tenGod&&me.push(he.hidden[0].tenGod));const _e=`${ee.map(he=>{const Oe={印:["正印","偏印"],官杀:["正官","七杀"],食伤:["食神","伤官"],财:["正财","偏财"],比劫:["比肩","劫财"]}[he]||[],Pe=Oe.find(Ue=>me.includes(Ue))||Oe[0];return Pe&&b[Pe]?`${he}偏重:${b[Pe]}。`:""}).filter(Boolean).join("")}${H.length,""}`+(ee.includes("印")?"想得多是你的默认状态,好处是稳,代价是慢和累。":""),qe=k==="female"?["正官","七杀"]:["正财","偏财"],Ze=k==="female"?"官杀(正官与七杀)":"财星(正财与偏财)",De={year:"年干",month:"月干",day:"日干",hour:"时干"},Le=Object.entries(m).filter(([,he])=>he&&qe.includes(he.stemTenGod)).map(([he,Oe])=>`${De[he]}${Oe.stemTenGod}`),Me=C.hidden&&C.hidden[0]&&C.hidden[0].tenGod||"",Se=c(i.relations,C.branch),Ne=[];Ne.push(`${k==="female"?"女命":"男命"}看配偶星取${Ze}${Le.length?`,${Le.join("、")}`:",盘中未透干"}${Le.length?"——摆在明处,说明这件事在你生活里是绕不开的主题":"——不显在明处,往往要靠后天遇到的人把它带出来"}。`),Me&&Ne.push(`日支(配偶宫)坐${C.branch}${Me}${C.dishi?`,日主在这里是「${C.dishi}」:${y[C.dishi]||""}`:""}。`),Se.po.length&&Ne.push(`日支与另一支相破(${Se.po.join("、")}):破不是吵架,是那种说不清、解释不明白的暗耗,容易冷处理。`),Se.chong.length&&Ne.push(`日支逢冲(${Se.chong.join("、")}):关系里变动感强,聚散、异地、节奏不一致都可能出现。`),Se.he.length&&Ne.push(`日支有合(${Se.he.join("、")}):容易被关系拴住,进去了就不太想出来。`),i.hourUnknown&&Ne.push("时柱暂缺,所以「子女」这一路的信息读不出,感情结论也就少了三分之一。");const Ce=(i.frame&&i.frame.geju||[]).map(he=>he.name),xe=[];Se.po.length&&xe.push("破在日支:最伤人的往往不是大事,是没说开的小事。"),Ce.includes("伤官见官")&&xe.push("盘里有「伤官见官」的组合:既想要稳定,又忍不了对方的毛病,这是同一件事的两面。"),ee.includes("印")&&!ee.includes("财")&&xe.push("印重而财轻:想得多、落得少;越焦虑越容易继续想。"),xe.length||xe.push("这一盘没有特别尖锐的冲克,卡点更多在「节奏」上——什么时候该动,什么时候该停。");const Ie=[];if(le&&z[le]){const he=z[le];Ie.push(`多接触${le}:${he.color}这类颜色、${he.where},日常可以${he.daily}。`)}te.length&&Ie.push(`少把自己放在${te.slice(0,2).join("、")}过重的环境里——不是不能碰,是别长期待在那种氛围中。`),ee.includes("印")&&Ie.push("给「想」设个时限:一件事想超过十分钟还没结论,就先做一个最小动作,用行动换信息。"),Ce.includes("伤官见官")&&Ie.push("把标准用在事情上,不要用在人身上;对人提要求之前,先说清你需要什么。");const ze=i.frame&&i.frame.balance||null;if(ze){const he=[];ze.wuxing.ok||he.push(`五行偏在${ze.wuxing.highest}、缺在${ze.wuxing.lowest}`),ze.yinyang.ok||he.push(ze.yinyang.pure?`${ze.yinyang.pure}之局`:`阴阳一边倒(阳 ${ze.yinyang.yang}/阴 ${ze.yinyang.yin})`),ze.climate.ok||he.push(`寒暖燥湿没调匀(${ze.climate.kind})`),Ie.push(he.length?`结构上${he.join("、")}:不必去「补命」,把这几处当作长期要照看的方向就行。`:"五行、阴阳、寒暖燥湿三方面都还匀:这种盘最忌讳的是为了「更好」而硬改节奏,稳住就是优势。")}return{system:"bazi",title:"先看这一张:这张盘大致在说什么",chips:s([`${f.stem||""}${f.element||""}日主`,`${v.branch||""}月`,S.label||"",i.strength?i.strength.level:"",i.hourUnknown?"时柱暂缺":""]),lead:pe,sections:[{h:"你的底色",t:_e||"结构比较均衡,没有一边倒的偏重。"},{h:"感情这件事",t:Ne.join("")},{h:"最容易卡住的地方",t:xe.join("")}],advice:Ie,caveat:i.hourUnknown?"时柱暂缺:以上只据年、月、日六个字,等于全盘信息的七成左右。子女缘分、晚年走势、以及「内心最深处那一层」都读不全,结论只作参考。":"",footer:"以上都是对结构的描述,不是断语;判断好坏要结合你自己的处境。"}}function x(i){const m=i.palaces||[],C=m[0]||{},v=i.body||{},f=(C.stars||[]).filter(ee=>ee.type==="主星"),S=m.find(ee=>ee.isBody)||{},k=m.find(ee=>ee.palace==="夫妻")||{},R=f.map(ee=>ee.name).join("、")||"空宫(借对宫)",H=f.map(ee=>T[ee.brightness]||"").filter(Boolean)[0]||"",U=ee=>ee.filter(me=>me.type==="主星").map(me=>`${me.name}${L[me.name]?`(${L[me.name]})`:""}`).join(";"),te=i.patternSummary||{},re=s(te.broken||[]),Z=s(te.bad||[]),le=s([...te.good||[],...te.neutral||[]]).filter(ee=>!re.includes(ee)),ue=k.stars||[],fe=ue.filter(ee=>ee.type==="主星"),pe=ue.filter(ee=>ee.type==="煞星");return{system:"ziwei",title:"先看这一张:这张盘大致在说什么",chips:s([`命宫在${C.branch||""}`,R,i.bureau?i.bureau.name:"",v.lands?`身宫落${v.lands}`:""]),lead:`命宫在${C.branch||""},坐${R}${H?`(${H})`:""};身宫落在${v.lands||v.palace||"—"}。${f.length?`底色是${f.map(ee=>L[ee.name]||ee.name).join("、")}。`:"命宫无主星,性格更多由对宫与三方决定,可塑性反而大。"}${le.length?`结构上成的是${le.slice(0,3).join("、")}——格局只说明形状,不是吉凶判词。`:"没有完整成套的格局,这一盘更多看单颗星的性质,少看组合。"}`,sections:[{h:"你的底色",t:`${U(C.stars||[])||"命宫无主星,靠三方四正补"}。身宫落${v.lands||"—"},说明你这辈子真正花力气的地方在${v.lands||"那一块"}。`},{h:"感情这件事",t:`夫妻宫在${k.branch||"—"},坐${fe.map(ee=>`${ee.name}${ee.brightness?`(${T[ee.brightness]||ee.brightness})`:""}`).join("、")||"空宫(借对宫)"}。${pe.length?`同宫还有${pe.map(ee=>ee.name).join("、")}——关系里容易起摩擦,来得快也去得快。`:"没有明显的煞星同宫,关系相对平顺。"}`},{h:"最容易卡住的地方",t:`${re.length?`被冲破的格局有${re.join("、")}——结构还在,但成色打折;冲不等于毁,说的是它不如完好时那么顶用。`:"主要格局没有明显被冲破。"}${Z.length?`另有${Z.join("、")}这类忌格,只描述结构,不作吉凶断。`:""}`}],advice:[`命宫主星${f.length?`是${f.map(ee=>ee.name).join("、")},顺它的长处在做事,比硬改性格省力`:"不显,先靠环境和习惯替自己定节奏"}。`,`身宫落${v.lands||"—"}:这块是你真正在意的地方,也是容易耗人的地方,留出余量。`],caveat:"",footer:"以上都是对结构的描述,不是断语;判断好坏要结合你自己的处境。"}}const $={旺:"当令,气最足",相:"有生机,正在起",休:"气在泄,歇着",囚:"被压着,使不上劲",死:"最弱,得靠外援"},w={官鬼:"职位、压力、管你的人和事",妻财:"钱、资源、实际回报",父母:"文书、答复、流程与长辈",子孙:"结果本身、松弛、把事情落地",兄弟:"同辈、分利、竞争"},o={日生:"日辰生它,当天有人托着",日克:"日辰克它,当天被压一头",比和:"与日辰同气,力量相当",日合:"与日辰相合,黏住了",日冲:"与日辰相冲,当天就动"};function d(i){if(!i)return"";const m=[],C=$[i.monthState]||i.monthSay||"";C&&m.push(`月令${i.monthState||""}(${C})`);const v=o[i.dayRelation]||i.daySay||"";return v&&m.push(v),i.kong&&m.push("旬空——抓不实,等冲或填"),i.moving&&m.push("发动,是这件事的动因"),i.monthChong&&m.push("月破,先破后立"),m.join(";")}function h(i){const m=i.hexStrength&&i.hexStrength.lines||[];if(!m.length)return null;const C=m.find(le=>le.shi)||null,v=m.find(le=>le.ying)||null,f=i.body||{},S=f.ben||{},k=f.bian||{},R=i.cast&&i.cast.movingPositions||[],H=m.filter(le=>le.moving),U=String(i.question||"").trim(),te=s([...f.labels||[],...i.hexStrength&&i.hexStrength.labels||[]]),re=i.hexStrength&&i.hexStrength.month?i.hexStrength.month.branch:"",Z=[S.chong?"六冲卦:事情容易散、节奏快":"",S.he?"六合卦:事情黏住、快不起来":"",f.fuYin&&(f.fuYin.inner||f.fuYin.outer)?"有伏吟:原地打转":"",f.fanYin&&(f.fanYin.inner||f.fanYin.outer)?"有反吟:来回反复":""].filter(Boolean);return{system:"liuyao",title:"先看这一卦:这卦大致在说什么",chips:s([S.name,k.name?`变${k.name}`:"",R.length?`${R.length} 爻动`:"静卦",re?`${re}月`:""]),lead:`${U?`你问的是「${U}」。`:""}本卦「${S.name||"—"}」${k.name?`,${R.length?`第 ${R.join("、")} 爻动`:"六爻安静"},变「${k.name}」`:""}。方向还留在「综合」,所以这一卦没有取用神——先只讲与问题无关的那几样:你(世爻)、事情(应爻)、卦体。`,sections:[{h:"代表你的是",t:C?`世爻在${C.name}(${C.branch}${C.element}·${C.liuqin}):${d(C)||"状态平稳"}。`:"这一卦取不到世爻。"},{h:"代表事情的是",t:v?`应爻在${v.name}(${v.branch}${v.element}·${v.liuqin}):${d(v)||"状态平稳"}。应爻说的是「事情那一头」的状态,不是你努力的程度。`:"这一卦取不到应爻。"},{h:"卦体与动爻",t:`${Z.length?`${Z.join(";")}。`:"没有六冲、六合、伏吟、反吟这类整体结构。"}${H.length?`动爻在${H.map(le=>`${le.name}(${le.liuqin})`).join("、")}——动的地方,就是这件事会发生变化的那一环。`:"六爻安静:眼下没有明显在动的地方,说明事情的节奏还没起来。"}`}],advice:["先在上面选一个「询问方向」(工作、感情、生意、推进、择日):选完才会取用神,旺衰、应期、成败条件才有落点。",...(W.other&&W.other.reality||[]).slice(0,2)].filter(Boolean),caveat:"未指定所问之事:这一版只读世应、卦体与动爻,不判成败,也不给应期——不是算不出来,是取用神要先知道问什么。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function g(i){const m=i.useGod||{};if(!m.liuqin)return h(i);const C=m.found||[];if(!C.length&&!m.missing)return null;const v=String(i.question||"").trim(),f=i.useGodStrength&&i.useGodStrength.lines||[],S=ee=>f.find(me=>me.position===ee)||null,R=(i.hexStrength&&i.hexStrength.lines||[]).find(ee=>ee.shi)||null,H=i.useGodStrength&&i.useGodStrength.month?i.useGodStrength.month.branch:"",U=i.dayGanZhi&&i.dayGanZhi.name||"",te=C.map(ee=>ee.name).join("、"),re=`${v?`你问的是「${v}」。`:"你没填具体问题,这里按「综合」取用神,结论会更粗。"}这卦里代表它的是「${m.liuqin}」(${m.ask||""}),`+(C.length?`落在${te}${C.length>1?"——两处都出现了,两个条件要一起看":""}。`:"盘中看不见它(伏藏),要等冲开或引出才有动静。")+`日辰是${U||"—"},月建是${H||"—"}。`,Z=[],le=[];for(const ee of C){const me=S(ee.position);me&&(/旺|相/.test(me.monthState||"")&&!me.kong&&!me.monthChong&&Z.push(ee.name),(/日克|日冲/.test(me.dayRelation||"")||me.kong||me.monthChong)&&le.push(ee.name))}const ue=C.length?Z.length>le.length?"条件偏有利":le.length>Z.length?"条件偏紧,得有外力或时间":"一半一半,取决于你怎么推":"没有可判的落点",fe=s([...(m.labels||[]).filter(ee=>/两现|伏藏|六合|六冲/.test(ee)),i.body&&i.body.ben&&i.body.ben.chong?"六冲卦:事情容易散,节奏偏快":"",i.body&&i.body.ben&&i.body.ben.he?"六合卦:事情黏住,快不起来":""]),pe=s((i.yingqi&&i.yingqi.items||[]).map(ee=>ee.branch)).slice(0,4);return{system:"liuyao",title:"先看这一卦:这卦大致在说什么",chips:s([i.ben&&i.ben.name,`用神 ${m.liuqin||""}`,H?`${H}月`:"",i.yingqi?i.yingqi.tempo:""]),lead:re,sections:[{h:"代表你的是",t:R?`世爻在${R.name}(${R.branch}${R.element}·${R.liuqin}):${d(R)||"状态平稳"}。`:"这一卦的世爻取不到,先看用神那一条。"},{h:"代表这件事的是",t:C.length?C.map(ee=>`${ee.name} ${ee.ganzhi}(${ee.liuqin}):${d(S(ee.position))||"没有明显的月日冲克"}。`).join(""):"用神伏藏:盘中看不见它,说明这件事现在还不在明面上,要等一个引子。"},{h:"成不成看哪里",t:`把用神的月令与日辰放在一起,盘面给的是「${ue}」。${fe.length?`另有:${fe.join(";")}。`:""}`}],advice:[...(W[P(m.direction)]&&W[P(m.direction)].reality||[]).slice(0,2),pe.length?`应期只看地支:${pe.join("、")}——地支只是「往哪个方向等」,不是公历日期。`:""].filter(Boolean),caveat:s([C.length>1?`用神两现(${te}):本插件不替你二选一,两处条件一起看。`:"",m.missing?"用神伏藏:先看伏神与飞神的关系,再看有没有东西把它冲出来。":"","世应只说明「你」和「事」的相对位置,不直接等于吉凶。"]).join(""),footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function N(i){const m=i.bodyUse;if(!m||!m.body||!m.use)return null;const C=String(i.question||"").trim();return{system:"meihua",title:"先看这一卦:方向大致在哪",chips:s([i.ben&&i.ben.name,i.bian&&`变${i.bian.name}`,m.relation?`体用 ${m.relation.split("(")[0]}`:""]),lead:`${C?`你问的是「${C}」。`:""}本卦「${i.ben&&i.ben.name}」,动在第 ${i.moving} 爻,变卦「${i.bian&&i.bian.name}」。体卦 ${m.body.trigram}(${m.body.element})代表你,用卦 ${m.use.trigram}(${m.use.element})代表这件事:${m.relation}。`,sections:[{h:"过程与结果",t:`过程看互卦「${i.hu&&i.hu.name||"—"}」,结果看变卦「${i.bian&&i.bian.name||"—"}」。梅花给的是方向,不是细节——它不会告诉你几号、多少钱。`},{h:"盘面给的分量",t:`这一卦的体用关系被标成「${m.level}」。注意:这是条件层面的判断,不是结果已经发生;条件好但不动,一样没有结果。`}],advice:["把它当「换个角度看这件事」:体用只分「谁在给、谁在耗」,剩下要你自己补具体动作。","如果要推进,先定一个最小动作(打个电话、发条消息),别等条件齐了再动。"],caveat:"梅花取象的自由度大:同一卦,不同人读出的细节可以不同。本插件只取体用生克这一层。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function _(i){const m=i.sanChuan||{};if(!m.chu||!m.zhong||!m.mo)return null;const C=String(i.question||"").trim(),v=S=>`${S.zhi}(${S.liuQin||""}·${S.jiangFull||""})`,f=S=>w[S.liuQin]?`——${w[S.liuQin]}`:"";return{system:"daliuren",title:"先看这一课:事情怎么走到这一步",chips:s([i.geJu&&i.geJu.name,`${m.chu.zhi}→${m.mo.zhi}`,i.yueJiang&&`月将${i.yueJiang.zhi}`]),lead:`${C?`你问的是「${C}」。`:""}三传是 ${m.chu.zhi} → ${m.zhong.zhi} → ${m.mo.zhi};末传落 ${m.mo.zhi}(${m.mo.liuQin||""}·${m.mo.jiangFull||""}),课体是「${i.geJu&&i.geJu.name||"—"}」。`,sections:[{h:"起手(初传)",t:`${v(m.chu)}${f(m.chu)}。这是事情开头的样子。`},{h:"转折(中传)",t:`${v(m.zhong)}${f(m.zhong)}。中间会经过这一段,也是容易改道的地方。`},{h:"落点(末传)",t:`${v(m.mo)}${f(m.mo)}。末传比初传更接近结果——但也只是「照现在这样走下去会到哪」。`}],advice:["先看初传:事情是从哪儿起的?把那个起点找出来,比猜结果有用。","中传若与初传相冲相克,说明中途会变;这时别把计划定死。"],caveat:"三传讲的是传变形态,不给具体日期;同一课不同流派对课体的命名也有差异。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function O(i){const m=i.siZhu&&i.siZhu.day?String(i.siZhu.day)[0]:"",C=i.siZhu&&i.siZhu.time?String(i.siZhu.time)[0]:"",v=i.palaces||[];if(!v.length)return null;const f=Z=>v.find(le=>le.tianPan===Z)||(i.centerPalace&&i.centerPalace.tianPan===Z?i.centerPalace:null),S=f(m),k=f(C),R=String(i.question||"").trim(),H=Z=>{const le=Z&&B[Z.palace]&&B[Z.palace].field;return le?le.split(":")[0]:Z?`${Z.palace}宫`:"盘中取不到"},U=Z=>Z&&B[Z.palace]&&B[Z.palace].dir?`(${B[Z.palace].dir})`:"",te=Z=>Z?`${H(Z)}${U(Z)}|${Z.gate||"—"}·${Z.star||"—"}·${Z.god||"—"}`:"盘中取不到",re=Z=>!Z||!Z.gateRelation||!Z.gateRelation.type?"门与宫的关系没算到":`${Z.gateRelation.type}(${Z.gateRelation.note||""})`;return{system:"qimen",title:"先看这一局:条件和位置在哪",chips:s([i.ju,i.zhiFu&&`值符${i.zhiFu.star}`]),lead:`${R?`你问的是「${R}」。`:""}日干 ${m} 落在${te(S)},时干 ${C} 落在${te(k)}——前者代表你,后者代表这件事。你这边门与宫是${re(S)};事情那边是${re(k)}。`,sections:[{h:"你这边的条件",t:S?`你在${B[S.palace]?B[S.palace].field:S.palace+"宫"};门是${S.gate||"—"}——${q[S.gate]||"门名只说明形态"}。`:"日干落在中宫或取不到:中宫无门无神,按寄宫(多寄坤二)取用,读的时候要说清这是寄宫。"},{h:"事情那边的条件",t:k?`事情落在${B[k.palace]?B[k.palace].field:k.palace+"宫"};门是${k.gate||"—"}——${q[k.gate]||"门名只说明形态"}。`:"时干落在中宫或取不到,同样按寄宫看,别当成坤二本宫。"},{h:"门名不是吉凶",t:"开门主启动、生门主生长、休门主等待、伤门主损耗、杜门主隐藏——这些说的是「这件事现在是什么形态」,不是好坏判决。要看它与日干宫、时干宫的生克。"}],advice:["把「我这边」和「事情那边」的宫位对一下:两边相距越远,越需要中间人、流程或时间。","如果门名是伤门、死门,不是叫你别做,而是提醒这件事的代价和收尾要先想清楚。"],caveat:s([i.juMethodNote||"","奇门重方位与时机;本插件不给具体方位建议,只把宫位与门星神摊开。"]).join(""),footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function J(i){const m=i.cards||[];if(!m.length)return null;const C=String(i.question||"").trim(),v=m.find(f=>/现在|现况|当下|建议|核心/.test(f.position||""))||m[Math.floor(m.length/2)];return{system:"tarot",title:"先看这几张牌:它们各在说什么",chips:s([i.spread]),lead:`${C?`你问的是「${C}」。`:""}${i.spread||""}:`+m.map(f=>`${f.position}「${f.name}」${f.orientation}`).join(",")+"。",sections:m.slice(0,4).map(f=>({h:f.position,t:`「${f.name}」${f.orientation}:${(f.keywords||[]).slice(0,3).join("、")||f.core||""}。${f.image?`牌面上${f.image}。`:""}${f.astro?`占星对应是${f.astro}。`:f.role?`它在盘上顶的是「${f.role}」那个角色。`:""}${f.positionHint||""}`})),advice:[`最值得先看的是「${v.name}」(${v.position}·${v.orientation})——${(v.keywords||[]).slice(0,3).join("、")||"它所在的位置,就是这件事现在的着力点"}。`,"把牌当镜子:它给的是看事情的角度,不是判决。看完写一句「那我下一步做什么」。"],caveat:i.systemNote||"塔罗为象征系统,牌义与元素对应存在流派差异。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function se(i){const m=i.score;if(!m)return null;const C=(i.dimensions||[]).filter(k=>k&&k.text),v=k=>{const R=k&&k.dayMaster;return R?typeof R=="string"?R.replace(/日主$/,""):`${R.stem||""}${R.element||""}`:""},f=v(i.a),S=v(i.b);return{system:"hepan",title:"先看这一张:你们大致怎么相处",chips:s([f&&S?`${f} × ${S}`:"",m.level,`${m.total}/100`]),lead:`${f&&S?`你们是 ${f} 与 ${S}。`:""}合盘描述的是「相处方式与互补点」,不判合不合,也不决定关系成败。整体上盘面给的是「${m.level}」(${m.total}/100——分数只是相对刻度,不是及格线)。`,sections:C.slice(0,3).map(k=>({h:k.label,t:k.text})),advice:["一起看,别一个人看完拿去判断对方:前者是对话,后者是审判。","把上面的分歧当话题清单:哪一条你们真的在意,就聊哪一条。"],caveat:i.notes&&i.notes[0]||"合盘看的是相处方式与互补点,不决定关系成败。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function F(i){const m=i.points||[],C=i.segments||[];if(!m.length||!C.length)return null;const v=Number.isInteger(i.meta&&i.meta.nowYear)?i.meta.nowYear:null,f=v&&m.find(ue=>ue.year===v)||null,S=f&&C.find(ue=>f.age>=ue.startAge&&f.age<=ue.endAge)||C[0],k=C[C.indexOf(S)+1],R=m.filter(ue=>ue.age>=S.startAge&&ue.age<=S.endAge),H=R.length?R.reduce((ue,fe)=>ue+fe.score,0)/R.length:0,U=m.reduce((ue,fe)=>ue+fe.score,0)/m.length,te=H>=U+5?"比一生平均更亮":H<=U-5?"比一生平均更闷":"与一生平均差不多",re=i.highlights&&i.highlights.best||[],Z=i.highlights&&i.highlights.worst||[],le=f?`你现在 ${f.age} 岁(${v} 年),在「${S.ganZhi}」这一步的第 ${f.age-S.startAge+1} 年(${S.startAge}–${S.endAge} 岁)${k?`,再过 ${S.endAge-f.age+1} 年到 ${k.startAge} 岁换「${k.ganZhi}」`:",已是最后一步"}。`:`没给当前日期(asOf),所以不标「现在在第几步」;先看第一步「${S.ganZhi}」(${S.startAge}–${S.endAge} 岁)起手的样子。`;return{system:"trend",title:"先看这一条线:这些年大致什么走势",chips:s([S.ganZhi,`${S.startAge}–${S.endAge} 岁`,f?`${f.age} 岁`:""]),lead:`这条线按 ${i.meta&&i.meta.toAge||m.length} 岁排到 ${m[m.length-1].year} 年,共 ${C.length} 步大运。`+le,sections:[{h:"这一步的基调",t:`这一步里各年的平均分是 ${H.toFixed(0)},${te}(全盘平均 ${U.toFixed(0)})。分数是相对刻度,不是绝对值。`},{h:"这些年里最亮和最闷的",t:`${re.length?`高点:${re.slice(0,2).join("、")}`:"没有特别高的点"};${Z.length?`低点:${Z.slice(0,2).join("、")}`:"没有特别低的点"}。高点适合推进,低点适合收口。`},{h:"怎么用这条线",t:"它不是命运表,是把「顺/不顺」画成可视的起伏。真正决定走向的,是你在这几步里做了什么。"}],advice:["把下一步换运的年龄记下来:换运前后半年,通常是最容易做决定、也最容易冲动的时候。","低点年别做大额投入,高点年别只观望——这两条比记分数管用。"],caveat:"线按年岁等距绘制,实际每步大运十年;起点与交运按节气推算,出生时刻未知时按日估算。",footer:"以上是把盘面符号翻译成话,不是断语;真正的判断要看现实里那几步。"}}function be(i){const m=i.taiyi,C=[{h:"太乙落在哪一宫",t:`${m.palaceName}宫(${m.dir}),这是三年里的第 ${m.yearInPalace} 年,对应「${m.li}」。太乙三年换一宫,走的是八宫、不入中五,所以在盘面上永远看不到它落在中间。`},{h:"八门这三十年",t:`${i.gate.gate}。八门三十年一转,1954 年从休门起,顺序是休、生、伤、杜、景、死、惊、开,所以一个门要值三十年,不是每年都换。`},{h:"文昌在哪",t:`文昌在${i.wenchang.pos}(${i.wenchang.god},${i.wenchang.palaceName}宫)。文昌十八年一周,阳局从申起、阴局从寅起,路上遇乾、坤各数两次,所以要数满十八步才回到原点。`},{h:"计神、始击与主客算",t:`计神在${i.jishen.branch},始击在${i.shiji.pos}(${i.shiji.god})。主算 ${i.suan.zhu}、客算 ${i.suan.ke}:大将按算数的个位落宫(整十归一),参将是大将乘三的个位。四个将分别落在${i.jiang.zhuDaName}、${i.jiang.keDaName}、${i.jiang.zhuCanName}、${i.jiang.keCanName}宫。`},{h:"定目、三基与五福",t:`定目在${i.dingmu.pos}(${i.dingmu.god}):淘金歌讲「以合神加太岁」,把合神搬到太岁处,天目跟着转过去,落点就是定目。三基——君基${i.sanji.jun}(三十年一移)、臣基${i.sanji.chen}(三年一移)、民基${i.sanji.min}(一年一移);五福在${i.wufu.palaceName}宫(四十五年一移),大游在${i.dayou.palaceName}宫(三十六年一移、逆数)。十精另五位:天乙${i.shijing.tianyi}、地乙${i.shijing.diyi}、直符${i.shijing.zhifu}、四神${i.shijing.sishen}、小游${i.shijing.xiaoyou}。`},{h:"阴阳数和",t:`主算:${i.heshu.zhu.text}客算:${i.heshu.ke.text}这一段只说「和不和」,上和、次和、下和是算数落在特定数上的分级,不据此断胜负。`},{h:"卦象吉凶",t:`${i.jixiong.label}。${i.jixiong.text}${i.jixiong.note}判据出自卷一《推太公考时法》,只标吉凶,不推成与不成。`},{h:"神将与判辞",t:(()=>{const v=i.shenjiang;if(!v||!v.rows)return"这一盘没有排神将。";const f=v.goods&&v.goods.length?"在吉神下的:"+v.goods.join("、"):"没有将落在吉神下",S=v.bads&&v.bads.length?"在凶神下的:"+v.bads.join("、"):"没有将落在凶神下",k=i.verdict?"合起来判「"+i.verdict.label+"」。":"";return"按日干起十二神("+v.stem+"日、"+(v.day?"昼贵":"夜贵")+"、贵人临"+v.startBranch+(v.dir>0?"顺":"逆")+"行),"+f+";"+S+"。"+k+"这一层是古人拿十二神看四将落位的办法,只说明古法怎么判,不是对事情的预测。"})()},{h:"这一盘算到哪一层",t:`积年 ${i.meta.jinian},残年 ${i.meta.rest360},${i.meta.dunText}${i.meta.ju}局。太乙、八门、文昌、计神、始击、主客算与四将、掩迫囚格关、定目、三基、五福、大游、十精、阴阳数和、月日时三计、古法吉凶都在;${i.scope.notCovered.join("、")}这几项没有收录,盘面上也不显示。`}];return{system:"taiyi",title:"先看这一张",chips:[`${i.meta.year}年`,`${i.meta.dunText}${i.meta.ju}局`,`${m.palaceName}宫`].filter(Boolean),lead:`${i.meta.year} 年太乙:${i.meta.dunText}${i.meta.ju}局,太乙临 ${m.palaceName} 宫(${m.dir}),八门值 ${i.gate.gate}。`,sections:C,advice:[`先看太乙落在哪:${m.palaceName}宫${m.dir},这三年的大方向就在这一格,别拿它当每年的细节来读。`,`八门十年一变的说法常被混用,这里按三十年一转的口径——${i.gate.gate}值这三十年,不是今年才轮到。`,"太乙是象数盘,给的是位置的对应关系,不是「今年会发生什么」的判决。"],caveat:`这一层到太乙、八门、文昌、计神、始击、主客算与四将、八种格局、定目、三基、五福、大游、十精与阴阳数和;${i.scope.notCovered.join(";")}都未收录,别按它们解读。`,footer:"太乙年家用积年推局,与八字按立春换年、运气按大寒分年都不同口径,三套不要互相印证。"}}function we(i){const m=[];i.special.taiYi&&m.push("太乙天符"),i.special.tianFu&&!i.special.taiYi&&m.push("天符"),i.special.suiHui&&!i.special.taiYi&&m.push("岁会"),i.special.tongTianFu&&m.push("同天符"),i.special.tongSuiHui&&m.push("同岁会");const C=[{h:"这一年的气候底色",t:i.combo.text},{h:"此刻在哪个运、哪口气",t:i.current.text},{h:"被强调的脏腑",t:`中运主${i.zhongyun.organ}:传统上这样描述——${i.zhongyun.effect.organ}。${i.zhongyun.effect.sign}`},{h:"今年常被说到的身体反应",t:`上半年(${i.sitian.qi}司天):${i.sitian.climate.sign};下半年(${i.zaiquan.qi}在泉):${i.zaiquan.climate.sign}`}];return{system:"wuyunliuqi",title:"先看这一张",chips:[`${i.year.ganzhi}年`,i.zhongyun.name,`${i.sitian.qi}司天`].filter(Boolean),lead:`${i.year.ganzhi} 运气年:中运${i.zhongyun.name},${i.sitian.qi}司天、${i.zaiquan.qi}在泉。`,sections:C,advice:[`顺着「${i.zhongyun.nature}」来调:${i.zhongyun.tai?"本气偏胜,别再加码,先把被克的那一头护住":"本气不足,别硬扛,先补本气再谈其他"}。`,`这一年偏「${i.sitian.climate.climate}」,起居上按这个方向做减法,比按季节硬套更贴。`,"运气盘给的是「今年偏什么」,不是「你会得什么病」;有具体不适看医生。"],caveat:m.length?`特殊格局:${m.join("、")}。${i.special.notes.join("")}`:"这一年在格局上没有天符、岁会那一类标记,按中运与司天在泉的常例读就好。",footer:"运气年以大寒为界,与八字按立春定年柱不同;两套口径不要互相印证。"}}function je(i){const m=i.primary,C=[];m&&(C.push({h:m.name+"是什么",t:(m.oneLine||"")+(m.trait?" "+m.trait:"")}),m.tendency&&C.push({h:"容易被影响的地方",t:m.tendency}));const v=(i.top||[]).find(f=>m&&f.name!==m.name);return v&&C.push({h:"次高的一项",t:`${v.name} ${v.converted} 分(${v.level})——它常和主质一起出现,调的时候顺手带上。`}),{system:"constitution",title:"先看这一张",chips:[m?m.name:"未判定",i.pinghe?`平和 ${i.pinghe.converted}`:"",i.meta?`${i.meta.answered}/${i.meta.total} 题`:""].filter(Boolean),lead:m?`主体质是「${m.name}」${m.level==="是"?"":`(${m.level},未完全达判定线)`},转化分 ${m.converted};平和质 ${i.pinghe?i.pinghe.converted:"—"} 分。`:"这份问卷还没答够,先别急着对号入座。",sections:C,advice:(i.care||[]).slice(0,3),caveat:i.flat?"每题都选了同一个选项,问卷对你的区分度不足——主质仅供参考,建议按最近一年的真实感受重答一遍。":"体质是长期倾向,不是病名,也不与八字、星座互证;有具体不适请就医。",footer:"打分为自评,同一个人隔一个月再答可能差一档,看趋势比看单次结果有用。"}}function oe(i){return!i||typeof i!="object"?null:i.system==="bazi"?M(i):i.system==="ziwei"?x(i):i.system==="liuyao"?g(i):i.system==="meihua"?N(i):i.system==="daliuren"?_(i):i.system==="qimen"?O(i):i.system==="tarot"?J(i):i.system==="hepan"?se(i):i.system==="trend"?F(i):i.system==="constitution"?je(i):i.system==="wuyunliuqi"?we(i):i.system==="taiyi"?be(i):null}return{plainSummary:oe}})(),D.index=(function(){const{buildBazi:Y}=D.bazi||{},{buildLiuyao:K,tossLines:Q,bodyLabels:W,yongshenOf:B,yongshenStrength:q,fushenAccess:A,hexagramStrength:P,jinTuiPower:z,yingqiWindow:b}=D.liuyao||{},{buildZiwei:y,BRIGHTNESS:L,flowOf:T,asOfParts:s,ZIWEI_SCHOOL_DEFAULTS:u}=D.ziwei||{},{drawTarot:c,SPREAD_KEYS:M}=D.tarot||{},{buildMeihua:x}=D.meihua||{},{buildDaliuren:$}=D.daliuren||{},{buildHepan:w,tripleOf:o}=D.hepan||{},{buildZiweiHepan:d}=D["ziwei-hepan"]||{},{buildQimen:h,buildSnapshot:g}=D.qimen||{},{geocodeAddress:N,resolveAddress:_}=D.geo||{},{toJDN:O,ganzhiName:J,dayGanzhiIndex:se}=D.calendar||{},{bool:F,canonicalFlags:be,canonicalNumbers:we}=D.bool||{},{randomOf:je,isSeed:oe}=D.random||{},{encodeHandle:i,decodeHandle:m,resolveHandle:C,pruneForeignKeys:v,ownedKeys:f}=D.handle||{},{askLink:S,parseAskLink:k,formOf:R,restNote:H,askPackages:U}=D.bridge||{},{parseRevision:te,displayValue:re}=D.revise||{},{interpret:Z,DIRECTIONS:le,DIRECTION_DEFAULT:ue}=D.interpret||{},{followup:fe,askPrompt:pe}=D.followup||{},{crossCheck:ee,crossText:me,crossSection:ve}=D.crosscheck||{},{pastSignals:_e,verifyFit:qe}=D.verify||{},{rectifyBirth:Ze}=D.rectify||{},{buildAlmanac:De}=D.almanac||{},{buildZeri:Le}=D.zeri||{},{buildChenggu:Me}=D.chenggu||{},{buildXiaoliuren:Se}=D.xiaoliuren||{},{buildStar:Ne}=D.star||{},{buildNumerology:Ce}=D.numerology||{},{buildMbti:xe,mbtiPaper:Ie}=D.mbti||{},{buildConstitution:ze,constitutionPaper:he}=D.constitution||{},{buildWuyunliuqi:Oe}=D.wuyunliuqi||{},{buildTaiyi:Pe}=D.taiyi||{},{buildConvert:Ue}=D.convert||{},{classicsFor:Fe,classicsText:Ge,suiyunClassicOf:Be,classicOf:sn,CLASSIC_BOOKS:Je}=D.classics||{},{diffObjects:rn,summarize:un,sortDiffs:cn,labelOf:ln,rootOf:hn,categoryOf:dn,formatValue:Ke,CALIBER_SWITCHES:An,viewRows:En}=D.diff||{},{canonicalJson:It,fingerprintOf:Tn}=D.fingerprint||{},{buildTrend:mn}=D.trend||{},{buildFengshui:We}=D.fengshui||{},{buildName:fn}=D.name||{},{buildTrace:$n,traceMarkdown:yn,SYSTEM_LABEL:Mn}=D.trace||{},{fail:ce}=D.fail||{},{assertCivil:vt,MIN_YEAR:gn,MAX_YEAR:pn}=D.validate||{},{parseDateTime:$e,daysInMonth:On}=D.datetime||{},_t=e=>String(e).padStart(2,"0"),qn=["male","female"],In=new Set(["bazi","ziwei","hepan","trend","meihua","daliuren","qimen","name"]),vn={bazi:{what:"时柱",advice:"知道大概几点就补上,不知道就传 hourUnknown:true(只排三柱)"},ziwei:{what:"命宫与生时星曜",advice:"紫微排不出三柱,必须补上出生时刻"},hepan:{what:"两侧时柱",advice:"两侧都要出生时刻,合盘才有意义"},trend:{what:"时柱与起运",advice:"知道大概几点就补上,不知道就传 hourUnknown:true(按日估算)"},meihua:{what:"起卦时刻",advice:"时间起卦要用真实起念时刻,请补 HH:mm"},daliuren:{what:"起课时辰(月将与贵人)",advice:"请补起课时刻 HH:mm"},qimen:{what:"起局时辰(旬首与局数)",advice:"请补起局时刻 HH:mm"},name:{what:"时柱",advice:"请补出生时刻 HH:mm"}};function Re(e,t=""){if(qn.includes(e))return e;const a=e==null||e===""?"(未提供)":`「${e}」`;throw ce("E_INPUT",`${t?t+"的":""}gender 必须是 male 或 female${a};性别决定大运/大限顺逆,不能靠默认值`)}const _n=["brightnessSchool","gengYearSihua","tianmaSchool","tiankongSchool","jiekongSchool","kuiyueSchool","tianshiTianshang","changshengSchool","lateZishi","shenzhuSchool","mingzhuSchool","zuoyaoSchool","liunianSihua","sihuaVariant","jieluSchool","suipoSchool"];function bn(e){const t={};for(const a of _n)e[a]!==void 0&&(t[a]=e[a]);return e.schools&&typeof e.schools=="object"&&(t.schools=e.schools),t}function Pn(e){const t=e.pillars,a=(ae,ge)=>`${ae}:${ge.ganzhi} ${ge.stemTenGod?`十神 ${ge.stemTenGod} `:""}藏干 ${ge.hidden.map(Ye=>`${Ye.stem}(${Ye.tenGod})`).join(" ")} 纳音 ${ge.nayin} 地势 ${ge.dishi} 自坐 ${ge.zizuo} 空亡 ${ge.kongwang.join("")}`+(ge.shensha&&ge.shensha.length?` 神煞 ${ge.shensha.join("、")}`:""),n=Object.entries(e.wuxing).map(([ae,ge])=>`${ae}${ge}`).join(" "),l=e.palaces?`【胎元】${e.palaces.taiyuan.ganzhi} 胎息 ${e.palaces.taixi?e.palaces.taixi.ganzhi:"—"}`+(e.palaces.minggong?` 命宫 ${e.palaces.minggong.ganzhi}`:" 命宫 时柱暂缺,不排")+(e.palaces.shengong?` 身宫 ${e.palaces.shengong.ganzhi}`:" 身宫 时柱暂缺,不排"):"",r=e.dayun.list.slice(0,8).map(ae=>`${ae.startAge}岁 ${ae.ganzhi}(${ae.stemTenGod})${ae.luck?`·${ae.luck.tier}`:""}${ae.relations&&ae.relations.length?`[${ae.relations.join("")}]`:""}`).join(" "),p=e.dayun.jiao&&e.dayun.jiao.at?`;交运 ${e.dayun.jiao.at}(${e.dayun.jiao.frame},距${e.dayun.jiao.from.name} ${e.dayun.jiao.spanDays} 天,三日折一年)`:"",j=e.dayun.startAgeExact,E=j&&Number.isInteger(j.years)?`起运岁(精确):${j.years} 年 ${j.months} 个月 ${j.days} 天 ${j.hours} 小时(${j.caliber};上面「${e.dayun.startAge.years}岁${e.dayun.startAge.months}个月」是四舍五入到月,两者同源)`:"",ne=e.jieqi.nearBoundaryMinutes<20?`
75
+ ⚠ 出生时刻距「节」仅 ${e.jieqi.nearBoundaryMinutes} 分钟,而节气时刻本身有最多约 14 分钟的偏差,月柱与年柱建议人工复核。`:"",X={year:"年",month:"月",day:"日",hour:"时"},G=e.shensha&&e.shensha.groups&&e.shensha.groups.length?`神煞(${e.shensha.count} 见):`+e.shensha.groups.map(ae=>`${ae.cat}|`+ae.items.map(ge=>`${ge.name}(${ge.pillars.map(Ye=>X[Ye]).join("")})`).join("、")).join(";"):"神煞:—",I=e.renyuan,ie=sn("smt-renyuan"),V=I?`人元:${I.month}月第${I.day}日,${I.active}${I.activeElement}司权(${I.segments.map(ae=>`${ae.stem}${ae.from}–${ae.to}`).join(" ")})${I.beyond?";已过 30 日表,按本气算":""}${ie?`|原文见《${Je[ie.book].name}·${ie.chapter}》`:""}`:"",ye=e.frame&&e.frame.yongshen&&e.frame.yongshen.disputed||[],de=ye.length?` 有争议:${ye.map(ae=>`${ae.element}(${ae.favorRole};${ae.climate}盘调候忌${ae.element})`).join("、")}`:"",ke=new Set(ye.map(ae=>ae.element)),Ae=e.frame&&e.frame.yongshen&&e.frame.yongshen.neutral||[],Nt=Ae.length?` 中性偏忌:${Ae.map(ae=>`${ae.element} ${ae.weight} 分`).join("、")}(近零,不作实忌)`:"",At=e.frame?[`格局:${e.frame.primary?`${e.frame.primary.name}(${e.frame.primary.evidence})`:"—"}`,`   ${e.frame.geju.map(ae=>`${ae.name}[${ae.kind}${ae.status?`·${ae.status}`:""}]`).join(" ")}`,`用神:喜${e.frame.yongshen.favor.join("")}(${e.frame.yongshen.favorTenGods.join("、")}) 忌${e.frame.yongshen.avoid.join("")}(${e.frame.yongshen.avoidTenGods.join("、")})${de}${Nt} ${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}${ke.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(([ae,ge])=>`${ae}${ge}`).join(" ")}`]:[],Te=e.strength&&e.strength.branchStructure,Et=Te?Te.branches.map(ae=>`${ae.label}${ae.branch}${ae.camp}${Te.placeholderHour&&ae.key==="hour"?"·占位":""}`).join("、"):"",Tt=Te&&!Te.placeholderHour&&!Te.complete?" 时柱暂缺,只列三支":"",kn=Te?`地支结构:${Te.placeholderHour?"三支+占位":"四支"} ${Te.code}(${Et}) ${Te.word}${Te.congProb!=null?`(静态从格 ${Te.congRange})`:""}${Tt}`:"",Xe=e.relations&&Array.isArray(e.relations.anhe)?e.relations.anhe:[],Nn=Xe.length?`暗合:${Xe.join(" ")}(另列,不并入上面的合冲刑害;${Xe.length===1?"只一对,按口径可忽略":`共 ${Xe.length} 对`})`:"",Mt=e.hourUnknown===!0||!t.hour;return[`【四柱】${t.year.ganzhi} ${t.month.ganzhi} ${t.day.ganzhi}${t.hour?` ${t.hour.ganzhi}`:"(时柱暂缺)"}`,`日主:${e.dayMaster.stem}${e.dayMaster.element}(${e.dayMaster.yinYang}) 空亡:${e.kongwang.join("")}`,a("年柱",t.year),a("月柱",t.month),a("日柱",t.day),...Mt?[]:[a("时柱",t.hour)],`五行:${n}`,...l?[l]:[],`日主强弱:${e.strength.level}(${e.strength.score}) ${e.strength.detail}`,...kn?[kn]:[],...At,`天干关系:${e.relations&&e.relations.stems.length?e.relations.stems.join(" "):"—"}`,`地支关系:${e.relations&&e.relations.branches.length?e.relations.branches.join(" "):"—"}`,...Nn?[Nn]:[],G,`真太阳时:${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}`,...V?[V]:[],`大运:${e.dayun.rule}(${e.dayun.direction}),${e.dayun.startAge.years}岁${e.dayun.startAge.months}个月起运${p}`,...E?[E]:[],` ${r}`,`流年:${e.liunian.slice(0,10).map(ae=>`${ae.year}${ae.ganzhi}(${ae.stemTenGod})${ae.luck?`·${ae.luck.tier}`:""}`).join(" ")}`,(()=>{const ae=e.liunian.filter(Ee=>Ee.suiyun&&Ee.suiyun.signals&&Ee.suiyun.signals.length);if(!ae.length)return"岁运提示:近十年无岁运并临、运年反吟或大运/流年伏吟、反吟(只标干支,不判吉凶)";const ge=Ee=>`${Ee.type}${(Ee.type.startsWith("流年")||Ee.type.startsWith("大运"))&&Ee.target?`(${Ee.target})`:""}`,Ye=Be(e),Ot=Ye?`|古籍见《${Je[Ye.book].name}·${Ye.chapter}》`:"";return"岁运提示(只标干支变动,不判吉凶):"+ae.map(Ee=>`${Ee.year}${Ee.ganzhi} ${Ee.suiyun.signals.map(ge).join("/")}`).join(";")+Ot})(),"(格局、用神、行运吉凶为扶抑+简化调候的量化提示,非断语。)"].join(`
76
+ `)+ne}function Ln(e){const t=e.lunar.monthRaw||e.lunar.month,a=`${e.lunar.year}年${e.lunar.isLeap?`闰${t}`:e.lunar.month}月${e.lunar.day}日`+(e.lunar.isLeap&&e.lunar.month!==t?`(按${e.lunar.month}月起盘)`:""),n=(()=>{if(!e.schools)return"";const ie=Object.entries({brightnessSchool:"亮度",gengYearSihua:"庚干四化",tianmaSchool:"天马",tiankongSchool:"天空",jiekongSchool:"截空",kuiyueSchool:"魁钺",tianshiTianshang:"天伤天使",changshengSchool:"长生",lateZishi:"晚子时",shenzhuSchool:"身主",mingzhuSchool:"命主取法",zuoyaoSchool:"杂曜全表",liunianSihua:"流年四化取干",sihuaVariant:"十干四化变体",jieluSchool:"截路空亡",suipoSchool:"岁前十二神"}).filter(([V])=>e.schools[V]&&e.schools[V]!==u[V]).map(([V,ye])=>`${ye} ${e.schools[V]}`);return ie.length?`【流派】${ie.join(" ")}`:""})(),l=I=>I.length?I.map(ie=>`${ie.name}${ie.mutagen?`化${ie.mutagen}`:""}`).join(" "):"—",r=I=>`神煞:长生(${I.changsheng}) 博士(${I.boshi}) 将前(${I.jiangqian}) 岁前(${I.suiqi})`,p=[];for(const I of e.palaces){const ie=I.isSoul?"【命】":I.isBody?"【身】":"  ";p.push(` ${I.palace} ${I.branch} ${I.ganzhi} ${ie} 大限${String(I.daxian.start).padStart(2)}-${I.daxian.end} 小限${String(I.xiaoxian.age).padStart(2)} ${l(I.stars)}`),p.push(` ${r(I.shensha)}`)}const j=(e.liunian??[]).slice(0,6).map(I=>` ${I.year} ${I.ganzhi} ${String(I.age).padStart(2)}岁 命宫${I.lifePalace.branch}(${I.lifePalace.palace}) 流禄${I.liulu} 流羊${I.liuyang} 流陀${I.liutuo} | ${I.mutagen.map(ie=>ie.replace("化","")).join(" ")}`+(I.mutagenHits?` 四化落宫 ${I.mutagenHits.map(ie=>`${ie.star}${ie.type}→${ie.palace||"未上盘"}`).join("、")}`:"")+(I.sanfangMainStars?` 三方主星 ${I.sanfangMainStars.join("")}`:"")),E=(e.patterns??[]).length?e.patterns.map(I=>`${I.name}(${I.tone==="good"?"吉格":I.tone==="bad"?"忌格":"中"}:${I.evidence})`).join(";"):"无明显格局(按内置规则)",ne=(e.daxianList??[]).slice(0,8).map(I=>` ${I.branch}宫(${I.palace})${I.ages[0]}-${I.ages[1]}岁 ${I.ganzhi} 会${I.mainStars.join("")||"—"} 化 ${I.mutagenHits.map(ie=>`${ie.star}${ie.type}→${ie.palace||"未上盘"}`).join("、")}`),X=(()=>{const I=e.flyChains;if(!I)return"";const ie=ye=>{const de=I[ye];return!de||!de.steps.length?"":`${ye}:${de.path.join("→")}${de.closed?"(成环)":""}`},V=["禄","权","科","忌"].map(ie).filter(Boolean).join(" ");return V?`【命宫飞星】${V}`:""})(),G=(()=>{const I=e.flyComposite;if(!I||!Array.isArray(I.sources)||!I.sources.length)return"";const ie=I.labels.length?I.labels.join(" · "):"无同宫会聚",V=["禄","权","科","忌"].map(ye=>{const de=(I.byType&&I.byType[ye]||[]).filter(Ae=>!Ae.self),ke=[...new Set(de.map(Ae=>String(Ae.to).replace(/宫$/,"")))];return ke.length?`${ye}→${ke.join("/")}`:""}).filter(Boolean).join(" ");return`【三方四正飞化】${I.sanfang.join("·")}:${ie}${V?` ${V}`:""}`})();return[`【农历】${a}(月首 ${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.lifeMasterNote?`(${e.lifeMasterNote})`:""}`,`【大限】${e.daxian.rule},${e.daxian.startAge}岁起 【小限】${e.xiaoxianRule.direction}`,n,`【昌曲】文昌${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})`,X,G,"十二宫:",...p,"大限(按起运年龄排序,前 8 限,宫干四化落宫):",...ne,"流年(前 6 年,完整 12 年在结构化数据里):",...j,`【格局】${E}`,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(`
77
+ `)}const Cn=["旺","相","休","囚","死"];function Rn(e){const t=e.states,a=e.month;if(!t||!a)return"无月令数据";const n=l=>Cn.filter(r=>l&&Array.isArray(l[r])&&l[r].length).map(r=>`${r} ${l[r].join("/")}`).join(" ");return`月令 ${a.branch}(${a.element}) 门 ${n(t.gate)||"—"} 星 ${n(t.star)||"—"} 干 ${n(t.stem)||"—"}`}function Yn(e){const t=e.palaces,a=n=>`${n.palace}宫 ${n.star||"—"}/${n.gate||"—"}/${n.god||"—"}${n.kong?" 空":""}${n.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(n=>`${n.palace}宫${n.stem}`).join("、")||"无"} 三奇入墓 ${(e.conditions&&e.conditions.ruMu||[]).map(n=>`${n.palace}宫${n.stem}`).join("、")||"无"} 六仪入墓 ${(e.conditions&&e.conditions.liuYiRuMu||[]).map(n=>`${n.palace}宫${n.stem}`).join("、")||"无"}`,`【十干克应】${[...t,e.centerPalace].filter(n=>n&&n.ganYing).map(n=>`${n.palace}宫 ${n.ganYing.tian}加${n.ganYing.di} ${n.ganYing.name}`).join(" ")||"—"}`,`【旺衰】${Rn(e)}`,`【九宫】${t.map(a).join(" ")}`,`※ 晚子时:${e.lateZiHourMode==="next-day"?"23:00 后归次日":"23:00 后仍归当日"}(可用 lateZiHourMode / lateZi 指定)`,`※ ${e.rules[e.rules.length-1]}`].join(`
78
+ `)}function wn(e){if(!e||!Array.isArray(e.pairs)||!e.pairs.length)return[];const t=["【三方合盘】三对两两并列,不合成「三人总分」",...e.pairs.map(a=>`· ${a.a}–${a.b}:${a.level||"—"}(${a.total==null?"—":`${a.total}/100`})`)];return e.best&&(e.spread>=3?t.push(` 最顺:${e.best.a}–${e.best.b}(${e.best.total}/100)`+(e.hardest?`;最需磨合:${e.hardest.a}–${e.hardest.b}(${e.hardest.total}/100)`:"")):t.push(` 三对分数接近(最高与最低相差 ${e.spread} 分),不排名`)),e.focus&&e.focus.spread>=3&&t.push(` 差异最大的一维:${e.focus.label}(三对相差 ${e.focus.spread} 分)`),e.note&&t.push(`※ ${e.note}`),t}function Zn(e){if(e.chart==="ziwei"){const n=l=>`${l.label}:${l.score>=0?"+":""}${l.score} ${l.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(n),...e.interactions.map(l=>` · ${l.text}`),...wn(e.triple),...e.notes.map(l=>`※ ${l}`)].join(`
79
79
  `)}const t=n=>`${n.label}:${n.score>=0?"+":""}${n.score} ${n.text}`,a=n=>!n||!n.solarNote?"—":`${n.longitude==null?"未含经度修正":`${n.longitude}°E`}(${n.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||""}`,`真太阳时:你 ${a(e.a)};对方 ${a(e.b)}`,...e.dimensions.map(t),...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(n=>`${n.name}(${n.a}${n.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};分档只数象,总分以上面三维度为准)`]:[],...wn(e.triple),...e.notes.map(n=>`※ ${n}`)].join(`
80
80
  `)}function Dn(e){const t=e.sanChuan,a=n=>`${n.zhi}(${n.jiang}${n.liuQin}${n.xunKong?"空":""})`;return[`【日时】${e.dayGanZhi}日 ${e.hourZhi}时(${e.dayNight}贵) 月将 ${e.yueJiang.name}${e.yueJiang.zhi} 节气 ${e.jieqi.name} ${e.lateZi===!1?"晚子时不换日":"晚子时换日"}`,`【三传】初 ${a(t.chu)} → 中 ${a(t.zhong)} → 末 ${a(t.mo)}`,`【四课】${e.siKe.map(n=>`${n.position}课 ${n.shang}上${n.xia}下(${n.relation}·${n.jiang})`).join(" ")}`,`【天地盘】${e.pan.map(n=>`${n.di}:${n.tian}(${n.jiang})`).join(" ")}`,`【格局】${e.geJu.name}·${e.geJu.detail}`,...e.shensha&&e.shensha.length?[`【神煞】${e.shensha.map(n=>`${n.name}${n.branch}`).join(" ")}`]:[]].join(`
81
81
  `)}function Un(e){const t=[`【起卦】${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}`],a=e.lines.slice().reverse().map(n=>` ${n.name} ${n.yinYang==="阳"?"━━━━━":"━━ ━━"}${n.moving?" ←动":""}`);return[...t,"【爻】",...a].join(`
82
- `)}function Gn(e){const t=[e.question?`【所问】${e.question}`:"(未填写提问)",`【牌阵】${e.spread}${e.castAt?` 抽牌于 ${e.castAt}`:""}`];for(const a of e.cards){const n=a.astro?` ${a.astro}`:a.role?` ${a.role}`:"",c=a.en?` [${a.en}]`:"";t.push(` ${a.position}:${a.name}${c}(${a.orientation})${n} ${a.keywords.join("、")}`),a.image&&t.push(`    牌面:${a.image}`)}if(e.reading&&e.reading.length){t.push("【解读】");for(const a of e.reading)t.push(` ${a}`)}return t.join(`
83
- `)}function Hn(e){const t=E=>{const ee=E.lines.slice().reverse().map(X=>{const G=X.position===E.shi?"世":X.position===E.ying?"应":" ";return` ${X.name} ${G} ${X.symbol} ${X.ganzhi}${X.element} ${X.liuqin}/${X.liushen}`});return[`${E.name}(${E.palace}·${E.palaceElement})`,...ee].join(`
84
- `)},a=[`起卦:${e.cast.notation.join("、")}(自下而上)`,`日辰:${e.dayGanZhi.name}`,e.xunShou?`旬首:${e.xunShou} 旬空:${(e.xunKong||[]).join("")||"—"}`:"",e.question?`所问:${e.question}`:"","本卦:",t(e.ben)];e.bian?a.push(`动爻:第 ${e.cast.movingPositions.join("、")} 爻`,"变卦(六亲以变卦自身宫论):",t(e.bian)):a.push("六爻安静,无变卦。");const n=e.body&&Array.isArray(e.body.labels)?e.body.labels:K(e.body);a.push(`卦体:${n.length?n.join(" · "):"无六冲、六合、伏吟、反吟"}`);const c=e.useGod||F(e,{});if(c&&c.liuqin){const E=c.found.length?c.found.map(ie=>`${ie.position}爻${ie.ganzhi}${ie.element}${ie.kong?"(空)":""}`).join("、"):c.fushen.length?c.fushen.map(ie=>`伏 ${ie.position}爻${ie.ganzhi}${ie.element}(${ie.relation||"飞伏关系未知"})`).join("、"):"不上卦";a.push(`用神:${c.byShi?"世爻":c.liuqin}(${c.ask})→ ${E}${c.side?`(${c.side})`:""}`);const ee=c.byShi?"用神 世爻":`用神 ${c.liuqin}`,X=c.labels.filter(ie=>ie!==ee&&!ie.startsWith(ee));X.length&&a.push(`用神联动:${X.join(" · ")}`);const G=e.useGodStrength;if(G&&G.labels.length){const ie=G.month&&G.month.branch?`月建 ${G.month.branch}(${G.month.element}) `:"";a.push(`用神旺衰:${ie}${G.labels.join(" · ")}`)}const I=e.fushenAccess;I&&Array.isArray(I.labels)&&I.labels.length&&a.push(`伏神出伏:${I.labels.join(" · ")}`)}else a.push("用神:未取(未指明所问之事;用「询问方向」指定后即按六亲取用)");const r=e.hexStrength;if(r&&Array.isArray(r.labels)&&r.labels.length){const E=r.month&&r.month.branch?`月建 ${r.month.branch}(${r.month.element}) `:"无月建(未给起卦时间) ";a.push(`全卦旺衰:${E}${r.labels.join(" · ")}`)}const p=e.jinTuiPower;p&&Array.isArray(p.lines)&&p.lines.length&&a.push(`进退力重:${p.lines.map(E=>`${E.position}爻${E.from}→${E.to}${E.type}·${E.verdict}`).join(" · ")}`);const j=e.yingqi;return j&&Array.isArray(j.triggers)&&j.triggers.length&&a.push(`应期线索:${j.tempo} · ${j.triggers.map(E=>`${E.labels.join("/")}${E.branch}`).join(" · ")}(只列地支,不出日期)`),a.filter(Boolean).join(`
85
- `)}function Fn(e){const t=new WeakSet,a=(n,c)=>{switch((n instanceof Number||n instanceof String||n instanceof Boolean)&&(n=n.valueOf()),n&&typeof n=="object"&&typeof n.toJSON=="function"&&(n=n.toJSON(c)),typeof n){case"string":case"boolean":return n;case"number":return Number.isFinite(n)?Object.is(n,-0)?0:n:null;case"bigint":throw new TypeError("Do not know how to serialize a BigInt");case"object":{if(n===null)return null;if(t.has(n))throw new TypeError("Converting circular structure to JSON");t.add(n);let r;if(Array.isArray(n)){r=new Array(n.length);for(let p=0;p<n.length;p++){const j=a(n[p],String(p));r[p]=j===void 0?null:j}}else{r={};for(const p of Object.keys(n)){const j=a(n[p],p);j!==void 0&&(r[p]=j)}}return t.delete(n),r}default:return}};return a(e,"")}const Bn=new Set(["shadow","shadowVersion","diff","trace","traceError","withInterpret","detail","cross","verifyPast","rectify","events","geocode","ask","followup","caliber","seed","asOf","handle","revise","geo","longitudeFromGeo"]),Ve=e=>{if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?Number(t.toFixed(6)):null};function en(e){if(e==null||e==="")return null;try{const t=fe(e);return{y:t.year,m:t.month,d:t.day,h:t.hour,mi:t.minute,precision:t.precision}}catch{return String(e).trim()}}function Qe(e={}){const t={};return e.datetime&&(t.datetime=en(e.datetime)),e.gender&&(t.gender=String(e.gender).toLowerCase()),e.longitude!==void 0?t.longitude=Ve(e.longitude):e.address&&(t.address=String(e.address).trim()),e.lateZi!==void 0&&(t.lateZi=H(e.lateZi,!0)),e.trueSolar!==void 0&&(t.trueSolar=H(e.trueSolar,!0)),e.dst!==void 0&&(t.dst=H(e.dst,!0)),t}function Jn(e){return e.lateZiHourMode==="next-day"||H(e.lateZi)?"next-day":"same-day"}function Kn(e,t){const a=String(t&&t.system||e.system||""),n=t&&t.input&&typeof t.input=="object"?t.input:null;if(a==="bazi"&&n)return{civil:n.civil,gender:n.gender,longitude:Ve(n.longitude),lateZi:H(n.lateZi,!0),trueSolar:H(n.trueSolar,!0),dst:!!(n.dst&&n.dst.applied)};if(a==="ziwei"&&n)return{civil:{year:n.year,month:n.month,day:n.day,hour:n.hour,minute:n.minute},gender:n.gender,longitude:Ve(n.longitude),leapMonth:n.leapMonth||"split",leapAsNext:H(n.leapAsNext),schools:n.schools||u,trueSolar:H(n.trueSolar,!0),dst:!!(n.dst&&n.dst.applied)};if(a==="qimen")return{datetime:en(e.datetime),juMethod:e.juMethod||"chaibu",lateZiHourMode:Jn(e)};if(a==="hepan"){const p={chart:e.chart==="ziwei"?"ziwei":"bazi",a:Qe({...e,datetime:e.datetime}),b:Qe(e.partner||{})};return e.partner2&&(p.c=Qe(e.partner2)),p}const c={},r=(p,j)=>Object.defineProperty(c,p,{value:j,enumerable:!0,writable:!0,configurable:!0});for(const[p,j]of Object.entries(e))if(!(Bn.has(p)||j===void 0))if(p==="datetime")r(p,en(j));else if(p==="partner")r(p,Qe(j));else if(p==="gender")r(p,String(j).toLowerCase());else{if(p==="address")continue;typeof j=="number"?r(p,Number.isFinite(j)?Object.is(j,-0)?0:j:null):typeof j=="string"?r(p,j.trim()):r(p,j)}return a==="daliuren"&&c.lateZi===void 0&&(c.lateZi=!0),a==="tarot"&&c.spread===void 0&&c.count===void 0&&(c.count=3),a==="meihua"&&c.mode===void 0&&(c.mode="time"),a==="xiaoliuren"&&c.mode===void 0&&(c.mode="time"),a==="convert"&&c.mode===void 0&&(c.mode="solar2lunar"),a==="fengshui"&&c.action===void 0&&(c.action="natal"),a==="tarot"&&t&&Array.isArray(t.cards)&&t.cards.length&&(c.cards=t.cards.map(p=>`${p.name||""}|${p.upright?"正":"逆"}`)),a==="liuyao"&&t&&t.cast&&Array.isArray(t.cast.lines)&&(c.cast=t.cast.lines.join("")),c}function Wn(e,t,a=nn(t.asOf)){const n=t.seed,c=!(n==null||n==="");return e==="liuyao"&&Array.isArray(t.lines)&&t.lines.length===6?{reproducible:!0}:(e==="tarot"||e==="liuyao")&&!c?{reproducible:!1,reason:"未给 seed:重算会变成另一副牌 / 另一卦"}:e==="bazi"||e==="ziwei"||e==="trend"||e==="fengshui"?{reproducible:!0,asOfPinned:!!a}:{reproducible:!0}}function nn(e){if(e==null||e==="")return null;if(typeof e=="object")return e;const t=String(e).trim();if(!t)return null;const a=s(t);if(!a)return t;const n=r=>String(r).padStart(2,"0");return`${String(a.year).padStart(4,"0")}-${n(a.month)}-${n(a.day)}T${n(a.hour)}:${n(a.minute)}`}function jn(e={},t={}){const a=t.result||null,n=String(a&&a.system||e.system||""),c=String(t.version||typeof globalThis<"u"&&globalThis.__MP_VER||"dev"),r=nn(e.asOf);return{...Tn({system:n,params:Kn(e,a),seed:e.seed,asOf:r,version:c}),...Wn(n,e,r),system:n,version:c}}const Qn=new Set(["shadow","trace","traceText","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","handle","handleError","revision"]);function Sn(e){const t={};for(const[a,n]of Object.entries(e||{}))Qn.has(a)||(t[a]=n);return t}function Xn(e){return!e||!e.shadow||!e.shadow.baseId?null:{snapshot:!0,shadow:e.shadow,data:Sn(e)}}function Vn(e,t,a={}){const n=e&&e.shadow,c=t&&t.shadow;if(!n||!c)return{sameId:!1,total:0,reason:"缺少影子盘信息"};if(n.baseId&&c.baseId&&n.baseId!==c.baseId)return{sameId:!1,total:0,fromId:n.id,toId:c.id,fromBaseId:n.baseId,toBaseId:c.baseId,reason:"基础指纹不同,不是同一张盘"};const r=I=>I.snapshot===!0&&I.data&&typeof I.data=="object"?I.data:Sn(I),p=rn(r(e),r(t)),j=ln(p.filter(I=>hn(I.path))).map(I=>({path:I.path,label:cn(I.path),from:Ke(I.from),to:Ke(I.to)})),E=new Map;for(const I of p){const ie=dn(I.path)||"其他";E.set(ie,(E.get(ie)||0)+1)}const ee=[...E.entries()].map(([I,ie])=>({name:I,count:ie})).sort((I,ie)=>ie.count-I.count||I.name.localeCompare(ie.name,"zh-Hans-CN")),X=a.fromVersion||n.version||"",G=a.toVersion||c.version||"";return{sameId:!0,versionChanged:X!==G,fromVersion:X,toVersion:G,total:p.length,summary:un(p),roots:j,categories:ee,diffs:p}}function tn(e={}){let t=C(e),a;if(typeof t.revise=="string"&&t.revise.trim()){const E=te(t.revise),ee={...t};t={...t,...E.patch},a={text:E.text,applied:E.labels.map(X=>{const G=ee[X.key]===void 0?null:ee[X.key];return{...X,from:G,fromDisplay:re(X.key,G)}}),ignored:E.ignored},t=v(t,f(e,E.patch))}if(t=pe(t),t=be(t),t.asOf!==void 0&&t.asOf!==null&&t.asOf!==""){const E=nn(t.asOf);E===null?(t={...t},delete t.asOf):E!==t.asOf&&(t={...t,asOf:E})}if(t.partner2===null&&(t={...t},delete t.partner2),t=zn(t),t.verifyPast!==void 0&&t.verifyPast!==null&&t.verifyPast!==""){const E=Number(t.verifyPast);if(!Number.isInteger(E)||E<1||E>10)throw le("E_INPUT",`verifyPast 要是 1–10 的整数(年数),收到「${t.verifyPast}」`);t={...t,verifyPast:E}}const n=Fn(st(t));if(n&&!n.question&&typeof t.question=="string"&&t.question.trim()&&["liuyao","meihua","daliuren","qimen","tarot","xiaoliuren"].includes(n.system)&&(n.question=t.question.trim()),n)try{const E=kt(n);E&&(n.brief=E)}catch(E){n.briefError=String(E&&E.message||E)}if(a&&(n.revision=a),n&&n.system==="bazi"){n.classics=Fe(n);const E=Ge(n.classics);E&&(n.summary=`${n.summary}
82
+ `)}function Gn(e){const t=[e.question?`【所问】${e.question}`:"(未填写提问)",`【牌阵】${e.spread}${e.castAt?` 抽牌于 ${e.castAt}`:""}`];for(const a of e.cards){const n=a.astro?` ${a.astro}`:a.role?` ${a.role}`:"",l=a.en?` [${a.en}]`:"";t.push(` ${a.position}:${a.name}${l}(${a.orientation})${n} ${a.keywords.join("、")}`),a.image&&t.push(`    牌面:${a.image}`)}if(e.reading&&e.reading.length){t.push("【解读】");for(const a of e.reading)t.push(` ${a}`)}return t.join(`
83
+ `)}function Hn(e){const t=E=>{const ne=E.lines.slice().reverse().map(X=>{const G=X.position===E.shi?"世":X.position===E.ying?"应":" ";return` ${X.name} ${G} ${X.symbol} ${X.ganzhi}${X.element} ${X.liuqin}/${X.liushen}`});return[`${E.name}(${E.palace}·${E.palaceElement})`,...ne].join(`
84
+ `)},a=[`起卦:${e.cast.notation.join("、")}(自下而上)`,`日辰:${e.dayGanZhi.name}`,e.xunShou?`旬首:${e.xunShou} 旬空:${(e.xunKong||[]).join("")||"—"}`:"",e.question?`所问:${e.question}`:"","本卦:",t(e.ben)];e.bian?a.push(`动爻:第 ${e.cast.movingPositions.join("、")} 爻`,"变卦(六亲以变卦自身宫论):",t(e.bian)):a.push("六爻安静,无变卦。");const n=e.body&&Array.isArray(e.body.labels)?e.body.labels:W(e.body);a.push(`卦体:${n.length?n.join(" · "):"无六冲、六合、伏吟、反吟"}`);const l=e.useGod||B(e,{});if(l&&l.liuqin){const E=l.found.length?l.found.map(ie=>`${ie.position}爻${ie.ganzhi}${ie.element}${ie.kong?"(空)":""}`).join("、"):l.fushen.length?l.fushen.map(ie=>`伏 ${ie.position}爻${ie.ganzhi}${ie.element}(${ie.relation||"飞伏关系未知"})`).join("、"):"不上卦";a.push(`用神:${l.byShi?"世爻":l.liuqin}(${l.ask})→ ${E}${l.side?`(${l.side})`:""}`);const ne=l.byShi?"用神 世爻":`用神 ${l.liuqin}`,X=l.labels.filter(ie=>ie!==ne&&!ie.startsWith(ne));X.length&&a.push(`用神联动:${X.join(" · ")}`);const G=e.useGodStrength;if(G&&G.labels.length){const ie=G.month&&G.month.branch?`月建 ${G.month.branch}(${G.month.element}) `:"";a.push(`用神旺衰:${ie}${G.labels.join(" · ")}`)}const I=e.fushenAccess;I&&Array.isArray(I.labels)&&I.labels.length&&a.push(`伏神出伏:${I.labels.join(" · ")}`)}else a.push("用神:未取(未指明所问之事;用「询问方向」指定后即按六亲取用)");const r=e.hexStrength;if(r&&Array.isArray(r.labels)&&r.labels.length){const E=r.month&&r.month.branch?`月建 ${r.month.branch}(${r.month.element}) `:"无月建(未给起卦时间) ";a.push(`全卦旺衰:${E}${r.labels.join(" · ")}`)}const p=e.jinTuiPower;p&&Array.isArray(p.lines)&&p.lines.length&&a.push(`进退力重:${p.lines.map(E=>`${E.position}爻${E.from}→${E.to}${E.type}·${E.verdict}`).join(" · ")}`);const j=e.yingqi;return j&&Array.isArray(j.triggers)&&j.triggers.length&&a.push(`应期线索:${j.tempo} · ${j.triggers.map(E=>`${E.labels.join("/")}${E.branch}`).join(" · ")}(只列地支,不出日期)`),a.filter(Boolean).join(`
85
+ `)}function Fn(e){const t=new WeakSet,a=(n,l)=>{switch((n instanceof Number||n instanceof String||n instanceof Boolean)&&(n=n.valueOf()),n&&typeof n=="object"&&typeof n.toJSON=="function"&&(n=n.toJSON(l)),typeof n){case"string":case"boolean":return n;case"number":return Number.isFinite(n)?Object.is(n,-0)?0:n:null;case"bigint":throw new TypeError("Do not know how to serialize a BigInt");case"object":{if(n===null)return null;if(t.has(n))throw new TypeError("Converting circular structure to JSON");t.add(n);let r;if(Array.isArray(n)){r=new Array(n.length);for(let p=0;p<n.length;p++){const j=a(n[p],String(p));r[p]=j===void 0?null:j}}else{r={};for(const p of Object.keys(n)){const j=a(n[p],p);j!==void 0&&(r[p]=j)}}return t.delete(n),r}default:return}};return a(e,"")}const Bn=new Set(["shadow","shadowVersion","diff","trace","traceError","withInterpret","detail","cross","verifyPast","rectify","events","geocode","ask","followup","caliber","seed","asOf","handle","revise","geo","longitudeFromGeo"]),Ve=e=>{if(e==null||e==="")return null;const t=Number(e);return Number.isFinite(t)?Number(t.toFixed(6)):null};function en(e){if(e==null||e==="")return null;try{const t=$e(e);return{y:t.year,m:t.month,d:t.day,h:t.hour,mi:t.minute,precision:t.precision}}catch{return String(e).trim()}}function Qe(e={}){const t={};return e.datetime&&(t.datetime=en(e.datetime)),e.gender&&(t.gender=String(e.gender).toLowerCase()),e.longitude!==void 0?t.longitude=Ve(e.longitude):e.address&&(t.address=String(e.address).trim()),e.lateZi!==void 0&&(t.lateZi=F(e.lateZi,!0)),e.trueSolar!==void 0&&(t.trueSolar=F(e.trueSolar,!0)),e.dst!==void 0&&(t.dst=F(e.dst,!0)),t}function Jn(e){return e.lateZiHourMode==="next-day"||F(e.lateZi)?"next-day":"same-day"}function Kn(e,t){const a=String(t&&t.system||e.system||""),n=t&&t.input&&typeof t.input=="object"?t.input:null;if(a==="bazi"&&n)return{civil:n.civil,gender:n.gender,longitude:Ve(n.longitude),lateZi:F(n.lateZi,!0),trueSolar:F(n.trueSolar,!0),dst:!!(n.dst&&n.dst.applied)};if(a==="ziwei"&&n)return{civil:{year:n.year,month:n.month,day:n.day,hour:n.hour,minute:n.minute},gender:n.gender,longitude:Ve(n.longitude),leapMonth:n.leapMonth||"split",leapAsNext:F(n.leapAsNext),schools:n.schools||u,trueSolar:F(n.trueSolar,!0),dst:!!(n.dst&&n.dst.applied)};if(a==="qimen")return{datetime:en(e.datetime),juMethod:e.juMethod||"chaibu",lateZiHourMode:Jn(e)};if(a==="hepan"){const p={chart:e.chart==="ziwei"?"ziwei":"bazi",a:Qe({...e,datetime:e.datetime}),b:Qe(e.partner||{})};return e.partner2&&(p.c=Qe(e.partner2)),p}const l={},r=(p,j)=>Object.defineProperty(l,p,{value:j,enumerable:!0,writable:!0,configurable:!0});for(const[p,j]of Object.entries(e))if(!(Bn.has(p)||j===void 0))if(p==="datetime")r(p,en(j));else if(p==="partner")r(p,Qe(j));else if(p==="gender")r(p,String(j).toLowerCase());else{if(p==="address")continue;typeof j=="number"?r(p,Number.isFinite(j)?Object.is(j,-0)?0:j:null):typeof j=="string"?r(p,j.trim()):r(p,j)}return a==="daliuren"&&l.lateZi===void 0&&(l.lateZi=!0),a==="tarot"&&l.spread===void 0&&l.count===void 0&&(l.count=3),a==="meihua"&&l.mode===void 0&&(l.mode="time"),a==="xiaoliuren"&&l.mode===void 0&&(l.mode="time"),a==="convert"&&l.mode===void 0&&(l.mode="solar2lunar"),a==="fengshui"&&l.action===void 0&&(l.action="natal"),a==="tarot"&&t&&Array.isArray(t.cards)&&t.cards.length&&(l.cards=t.cards.map(p=>`${p.name||""}|${p.upright?"正":"逆"}`)),a==="liuyao"&&t&&t.cast&&Array.isArray(t.cast.lines)&&(l.cast=t.cast.lines.join("")),l}function Wn(e,t,a=nn(t.asOf)){const n=t.seed,l=!(n==null||n==="");return e==="liuyao"&&Array.isArray(t.lines)&&t.lines.length===6?{reproducible:!0}:(e==="tarot"||e==="liuyao")&&!l?{reproducible:!1,reason:"未给 seed:重算会变成另一副牌 / 另一卦"}:e==="bazi"||e==="ziwei"||e==="trend"||e==="fengshui"?{reproducible:!0,asOfPinned:!!a}:{reproducible:!0}}function nn(e){if(e==null||e==="")return null;if(typeof e=="object")return e;const t=String(e).trim();if(!t)return null;const a=s(t);if(!a)return t;const n=r=>String(r).padStart(2,"0");return`${String(a.year).padStart(4,"0")}-${n(a.month)}-${n(a.day)}T${n(a.hour)}:${n(a.minute)}`}function jn(e={},t={}){const a=t.result||null,n=String(a&&a.system||e.system||""),l=String(t.version||typeof globalThis<"u"&&globalThis.__MP_VER||"dev"),r=nn(e.asOf);return{...Tn({system:n,params:Kn(e,a),seed:e.seed,asOf:r,version:l}),...Wn(n,e,r),system:n,version:l}}const Qn=new Set(["shadow","trace","traceText","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","handle","handleError","revision"]);function Sn(e){const t={};for(const[a,n]of Object.entries(e||{}))Qn.has(a)||(t[a]=n);return t}function Xn(e){return!e||!e.shadow||!e.shadow.baseId?null:{snapshot:!0,shadow:e.shadow,data:Sn(e)}}function Vn(e,t,a={}){const n=e&&e.shadow,l=t&&t.shadow;if(!n||!l)return{sameId:!1,total:0,reason:"缺少影子盘信息"};if(n.baseId&&l.baseId&&n.baseId!==l.baseId)return{sameId:!1,total:0,fromId:n.id,toId:l.id,fromBaseId:n.baseId,toBaseId:l.baseId,reason:"基础指纹不同,不是同一张盘"};const r=I=>I.snapshot===!0&&I.data&&typeof I.data=="object"?I.data:Sn(I),p=rn(r(e),r(t)),j=cn(p.filter(I=>hn(I.path))).map(I=>({path:I.path,label:ln(I.path),from:Ke(I.from),to:Ke(I.to)})),E=new Map;for(const I of p){const ie=dn(I.path)||"其他";E.set(ie,(E.get(ie)||0)+1)}const ne=[...E.entries()].map(([I,ie])=>({name:I,count:ie})).sort((I,ie)=>ie.count-I.count||I.name.localeCompare(ie.name,"zh-Hans-CN")),X=a.fromVersion||n.version||"",G=a.toVersion||l.version||"";return{sameId:!0,versionChanged:X!==G,fromVersion:X,toVersion:G,total:p.length,summary:un(p),roots:j,categories:ne,diffs:p}}function tn(e={}){let t=C(e),a;if(typeof t.revise=="string"&&t.revise.trim()){const E=te(t.revise),ne={...t};t={...t,...E.patch},a={text:E.text,applied:E.labels.map(X=>{const G=ne[X.key]===void 0?null:ne[X.key];return{...X,from:G,fromDisplay:re(X.key,G)}}),ignored:E.ignored},t=v(t,f(e,E.patch))}if(t=be(t),t=we(t),t.asOf!==void 0&&t.asOf!==null&&t.asOf!==""){const E=nn(t.asOf);E===null?(t={...t},delete t.asOf):E!==t.asOf&&(t={...t,asOf:E})}if(t.partner2===null&&(t={...t},delete t.partner2),t=zn(t),t.verifyPast!==void 0&&t.verifyPast!==null&&t.verifyPast!==""){const E=Number(t.verifyPast);if(!Number.isInteger(E)||E<1||E>10)throw ce("E_INPUT",`verifyPast 要是 1–10 的整数(年数),收到「${t.verifyPast}」`);t={...t,verifyPast:E}}const n=Fn(st(t));if(n&&!n.question&&typeof t.question=="string"&&t.question.trim()&&["liuyao","meihua","daliuren","qimen","tarot","xiaoliuren"].includes(n.system)&&(n.question=t.question.trim()),n)try{const E=kt(n);E&&(n.brief=E)}catch(E){n.briefError=String(E&&E.message||E)}if(a&&(n.revision=a),n&&n.system==="bazi"){n.classics=Fe(n);const E=Ge(n.classics);E&&(n.summary=`${n.summary}
86
86
  【古籍】
87
- ${E}`);const ee=Be(n);if(ee&&(n.suiyunClassic={...ee,bookName:Je[ee.book].name}),n.renyuan){const X=sn("smt-renyuan");X&&(n.renyuanClassic={...X,bookName:Je[X.book].name})}}n&&n.precision&&n.precision.level==="approx"&&n.summary&&(n.summary=`⚠ ${n.precision.note}
87
+ ${E}`);const ne=Be(n);if(ne&&(n.suiyunClassic={...ne,bookName:Je[ne.book].name}),n.renyuan){const X=sn("smt-renyuan");X&&(n.renyuanClassic={...X,bookName:Je[X.book].name})}}n&&n.precision&&n.precision.level==="approx"&&n.summary&&(n.summary=`⚠ ${n.precision.note}
88
88
  ${n.summary}`),n&&(n.system==="bazi"||n.system==="ziwei")&&n.input&&n.input.longitude==null&&n.summary&&(n.summary=`⚠ 未提供出生地或经度:按东八区平太阳时排盘,时柱可能与本命盘相差一个时辰;海外出生请先把当地时间换算成东八区标准时。
89
89
  ${n.summary}`),n&&n.system==="bazi"&&n.hourUnknown&&n.summary&&(n.summary=`时柱按正午暂算,涉及时柱的结论仅供参考
90
90
  ${n.summary}`),n&&n.system==="trend"&&n.hourUnknown&&n.summary&&(n.summary=`时柱暂缺:起运与大运按日估算,仅供参考
91
- ${n.summary}`);const c=n&&n.system==="meihua"&&t.mode==="number",r=typeof t.datetime=="string"&&t.datetime.trim()!==""&&!/[T\s]\d{1,2}:\d{1,2}/.test(t.datetime.trim()),p=n&&n.system==="name"&&!(typeof t.datetime=="string"&&t.datetime.trim())&&Number.isInteger(t.year)&&Number.isInteger(t.month)&&Number.isInteger(t.day)&&!Number.isInteger(t.hour);if(n&&!c&&!n.hourUnknown&&!n.timeMissing&&In.has(n.system)&&(r||p)&&n.summary){n.timeMissing=!0;const E=vn[n.system]||{what:"时刻",advice:"请补上时刻 HH:mm"};n.summary=`⚠ 只给了日期、没有时刻:${E.what}按 00:00 暂算,与真实结果可能整档不同;${E.advice}
92
- ${n.summary}`}if(n&&n.system==="hepan"&&n.summary){const E=[];for(const[ee,X]of[["partner","对方"],["partner2","第三方"]]){const G=t[ee],I=G&&typeof G=="object"?G.datetime:void 0;typeof I=="string"&&!/[T\s]\d{1,2}:\d{1,2}/.test(I.trim())&&E.push(X)}E.length&&(n.timeMissing=!0,n.summary=`⚠ 只给了日期、没有时刻:${E.join("、")}的时柱按 00:00 暂算,与真实结果可能整档不同;请补出生时刻 HH:mm
93
- ${n.summary}`)}const j=ot(t.detail);if(t.withInterpret&&(n.interpret=Z(n,{question:typeof t.question=="string"?t.question:"",direction:typeof t.direction=="string"?t.direction:"general"}),n.interpret&&j!=="full"&&(n.interpretTier=j)),H(t.cross)&&H(t.hourUnknown)&&(n.crossSkipped="HOUR_UNKNOWN"),H(t.cross)&&!H(t.hourUnknown)&&(n.system==="bazi"||n.system==="ziwei")){const ee={...fe(t.datetime),gender:Le(t.gender),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0,trueSolar:H(t.trueSolar,!0),dst:H(t.dst,!0)},X=He(t.asOf),G=t.lateZishi!==void 0?t.lateZishi:t.lateZi===void 0||t.lateZi===null||t.lateZi===""?void 0:H(t.lateZi,!0)?"next-day":"current-day",I=n.system==="bazi"?y({...ee,leapMonth:t.leapMonth,leapAsNext:H(t.leapAsNext),...bn(t),...G!==void 0?{lateZishi:G}:{},asOf:X}):R({...ee,lateZi:H(t.lateZi,!0),nowYear:X?X.year:void 0});n.cross=ne(n.system==="bazi"?n:I,n.system==="ziwei"?n:I),n.interpret&&n.interpret.sections.push(Re(n.cross))}if(Number.isInteger(t.verifyPast)&&t.verifyPast>0&&n.system==="bazi"){const E=t.verifyPast,ee=Number(n.liunianFrom)-E,X=R({...fe(t.datetime),hourUnknown:H(t.hourUnknown),gender:Le(t.gender),lateZi:H(t.lateZi,!0),trueSolar:H(t.trueSolar,!0),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0,dst:H(t.dst,!0),nowYear:ee});n.past={rows:ve(X,Number(n.liunianFrom)-1),years:E,until:Number(n.liunianFrom)-1}}if(H(t.rectify)&&n.system==="bazi"){const E=fe(t.datetime);n.rectify=Ye({base:{year:E.year,month:E.month,day:E.day,minute:E.minute},gender:Le(t.gender),events:Array.isArray(t.events)?t.events:[],hours:Array.isArray(t.rectifyHours)?t.rectifyHours:void 0,lateZi:H(t.lateZi,!0),trueSolar:H(t.trueSolar,!0),dst:H(t.dst,!0),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0})}if(typeof t.ask=="string"&&t.ask.trim()&&(n.followup=$e(n,t.ask)),H(t.trace))try{const E=$n(n,{direction:t.direction,gender:t.gender});E&&(n.trace=E,n.traceText=yn(E,{system:n.system}))}catch(E){n.traceError=String(E&&E.message||E)}if(H(t.shadow))try{n.shadow=jn(t,{result:n,version:t.shadowVersion})}catch(E){n.shadow={error:String(E&&E.message||E)}}try{const E=i(t);E&&(n.handle=E)}catch(E){n.handleError=String(E&&E.message||E)}return n}function xn(e,t){if(!e)return"";const a=t==="brief",c=a||t==="lean",r=8,p=300,j=[`【${e.title||"解析与详解"}】${e.ask&&e.ask.echo?e.ask.echo:""}`];e.answer&&j.push(`▶ ${e.ask&&e.ask.question?"先答所问":"先看结论"}:${e.answer}`),e.plain&&j.push(`▶ 说人话:${e.plain}`),e.lead&&j.push(e.lead),Array.isArray(e.outline)&&e.outline.length&&j.push("一页读懂:"+e.outline.map(V=>`${V.label}·${V.text}`).join(" ")),e.error&&j.push(`⚠ 解析生成失败:${e.error}(上方盘面数据本身可用)`);const E=e.dimensions||[],ee=c&&E.some(V=>V&&V.focused)?E.filter(V=>V&&V.focused):E;for(const V of ee){const ye=Array.isArray(V.evidence)&&V.evidence.length?`
94
-  依据:${V.evidence.join(";")}${V.confidence?` 置信度:${V.confidence}`:""}`:"",de=V.plain?`(${V.plain})`:"",ke=c?(V.knowledge||[]).length?`
91
+ ${n.summary}`);const l=n&&n.system==="meihua"&&t.mode==="number",r=typeof t.datetime=="string"&&t.datetime.trim()!==""&&!/[T\s]\d{1,2}:\d{1,2}/.test(t.datetime.trim()),p=n&&n.system==="name"&&!(typeof t.datetime=="string"&&t.datetime.trim())&&Number.isInteger(t.year)&&Number.isInteger(t.month)&&Number.isInteger(t.day)&&!Number.isInteger(t.hour);if(n&&!l&&!n.hourUnknown&&!n.timeMissing&&In.has(n.system)&&(r||p)&&n.summary){n.timeMissing=!0;const E=vn[n.system]||{what:"时刻",advice:"请补上时刻 HH:mm"};n.summary=`⚠ 只给了日期、没有时刻:${E.what}按 00:00 暂算,与真实结果可能整档不同;${E.advice}
92
+ ${n.summary}`}if(n&&n.system==="hepan"&&n.summary){const E=[];for(const[ne,X]of[["partner","对方"],["partner2","第三方"]]){const G=t[ne],I=G&&typeof G=="object"?G.datetime:void 0;typeof I=="string"&&!/[T\s]\d{1,2}:\d{1,2}/.test(I.trim())&&E.push(X)}E.length&&(n.timeMissing=!0,n.summary=`⚠ 只给了日期、没有时刻:${E.join("、")}的时柱按 00:00 暂算,与真实结果可能整档不同;请补出生时刻 HH:mm
93
+ ${n.summary}`)}const j=ot(t.detail);if(t.withInterpret&&(n.interpret=Z(n,{question:typeof t.question=="string"?t.question:"",direction:typeof t.direction=="string"?t.direction:"general"}),n.interpret&&j!=="full"&&(n.interpretTier=j)),F(t.cross)&&F(t.hourUnknown)&&(n.crossSkipped="HOUR_UNKNOWN"),F(t.cross)&&!F(t.hourUnknown)&&(n.system==="bazi"||n.system==="ziwei")){const ne={...$e(t.datetime),gender:Re(t.gender),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0,trueSolar:F(t.trueSolar,!0),dst:F(t.dst,!0)},X=He(t.asOf),G=t.lateZishi!==void 0?t.lateZishi:t.lateZi===void 0||t.lateZi===null||t.lateZi===""?void 0:F(t.lateZi,!0)?"next-day":"current-day",I=n.system==="bazi"?y({...ne,leapMonth:t.leapMonth,leapAsNext:F(t.leapAsNext),...bn(t),...G!==void 0?{lateZishi:G}:{},asOf:X}):Y({...ne,lateZi:F(t.lateZi,!0),nowYear:X?X.year:void 0});n.cross=ee(n.system==="bazi"?n:I,n.system==="ziwei"?n:I),n.interpret&&n.interpret.sections.push(ve(n.cross))}if(Number.isInteger(t.verifyPast)&&t.verifyPast>0&&n.system==="bazi"){const E=t.verifyPast,ne=Number(n.liunianFrom)-E,X=Y({...$e(t.datetime),hourUnknown:F(t.hourUnknown),gender:Re(t.gender),lateZi:F(t.lateZi,!0),trueSolar:F(t.trueSolar,!0),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0,dst:F(t.dst,!0),nowYear:ne});n.past={rows:_e(X,Number(n.liunianFrom)-1),years:E,until:Number(n.liunianFrom)-1}}if(F(t.rectify)&&n.system==="bazi"){const E=$e(t.datetime);n.rectify=Ze({base:{year:E.year,month:E.month,day:E.day,minute:E.minute},gender:Re(t.gender),events:Array.isArray(t.events)?t.events:[],hours:Array.isArray(t.rectifyHours)?t.rectifyHours:void 0,lateZi:F(t.lateZi,!0),trueSolar:F(t.trueSolar,!0),dst:F(t.dst,!0),longitude:typeof t.longitude=="number"?t.longitude:void 0,address:typeof t.address=="string"?t.address:void 0,geo:t.geo&&typeof t.geo=="object"?t.geo:void 0})}if(typeof t.ask=="string"&&t.ask.trim()&&(n.followup=fe(n,t.ask)),F(t.trace))try{const E=$n(n,{direction:t.direction,gender:t.gender});E&&(n.trace=E,n.traceText=yn(E,{system:n.system}))}catch(E){n.traceError=String(E&&E.message||E)}if(F(t.shadow))try{n.shadow=jn(t,{result:n,version:t.shadowVersion})}catch(E){n.shadow={error:String(E&&E.message||E)}}try{const E=i(t);E&&(n.handle=E)}catch(E){n.handleError=String(E&&E.message||E)}return n}function xn(e,t){if(!e)return"";const a=t==="brief",l=a||t==="lean",r=8,p=300,j=[`【${e.title||"解析与详解"}】${e.ask&&e.ask.echo?e.ask.echo:""}`];e.answer&&j.push(`▶ ${e.ask&&e.ask.question?"先答所问":"先看结论"}:${e.answer}`),e.plain&&j.push(`▶ 说人话:${e.plain}`),e.lead&&j.push(e.lead),Array.isArray(e.outline)&&e.outline.length&&j.push("一页读懂:"+e.outline.map(V=>`${V.label}·${V.text}`).join(" ")),e.error&&j.push(`⚠ 解析生成失败:${e.error}(上方盘面数据本身可用)`);const E=e.dimensions||[],ne=l&&E.some(V=>V&&V.focused)?E.filter(V=>V&&V.focused):E;for(const V of ne){const ye=Array.isArray(V.evidence)&&V.evidence.length?`
94
+  依据:${V.evidence.join(";")}${V.confidence?` 置信度:${V.confidence}`:""}`:"",de=V.plain?`(${V.plain})`:"",ke=l?(V.knowledge||[]).length?`
95
95
   规则 ${V.knowledge.length} 条未展开(detail:"full" 给出原文与出处)`:"":(V.knowledge||[]).map(Ae=>`
96
-  规则·${Ae.gist}〔${Ae.statusLabel}〕${Ae.detail} 出处:${Ae.source}${Ae.note?` 注:${Ae.note}`:""}`).join("");j.push(`${V.label}:${de}${V.text}${V.advice?` 建议:${V.advice}`:""}${ye}${ke}`)}const X=e.sections||[],G=c?X.filter(V=>String(V.text||"").length>p):[];for(const V of X)c&&String(V.text||"").length>p||j.push(`${V.label}:${V.text}`);G.length&&j.push(`(另有 ${G.length} 节长论述未展开:${G.map(V=>V.label).join("、")}。需要原文与出处时传 detail:"full")`);for(const V of e.tables||[]){if(!Array.isArray(V.rows)||!V.rows.length)continue;let ye=V.rows;j.push(`【${V.title}】`),a&&ye.length>r&&(ye=ye.slice(0,r),j.push(`(共 ${V.rows.length} 行,仅列前 ${r} 行;全表传 detail:"lean")`)),j.push([V.columns.join(" | "),...ye.map(de=>de.join(" | "))].join(`
96
+  规则·${Ae.gist}〔${Ae.statusLabel}〕${Ae.detail} 出处:${Ae.source}${Ae.note?` 注:${Ae.note}`:""}`).join("");j.push(`${V.label}:${de}${V.text}${V.advice?` 建议:${V.advice}`:""}${ye}${ke}`)}const X=e.sections||[],G=l?X.filter(V=>String(V.text||"").length>p):[];for(const V of X)l&&String(V.text||"").length>p||j.push(`${V.label}:${V.text}`);G.length&&j.push(`(另有 ${G.length} 节长论述未展开:${G.map(V=>V.label).join("、")}。需要原文与出处时传 detail:"full")`);for(const V of e.tables||[]){if(!Array.isArray(V.rows)||!V.rows.length)continue;let ye=V.rows;j.push(`【${V.title}】`),a&&ye.length>r&&(ye=ye.slice(0,r),j.push(`(共 ${V.rows.length} 行,仅列前 ${r} 行;全表传 detail:"lean")`)),j.push([V.columns.join(" | "),...ye.map(de=>de.join(" | "))].join(`
97
97
  `))}Array.isArray(e.followups)&&e.followups.length&&j.push("还可以这样追问:"+e.followups.map(V=>`「${V}」`).join(" ")),!a&&Array.isArray(e.glossary)&&e.glossary.length&&j.push("名词解释:"+e.glossary.map(V=>`${V.term}=${V.plain}`).join(" "));let I="";Array.isArray(e.limits)&&e.limits.length&&(I+=`【本插件不回答什么】${e.limits.map(V=>`${V.title}——${V.text}`).join(`
98
98
  `)}
99
99
  `),e.disclaimer&&(I+=e.disclaimer);const ie=j.join(`
100
100
  `);return I?`${ie}
101
- ${I}`:ie}const et=["cross","verifyPast","withInterpret","detail","question","direction","ask","geocode","rectify","events","shadow","trace"];function nt(e={},t={}){const a=t.system||e.system,n=t.switches||An[a]||[];if(!n.length)return{system:a,switches:[],affected:0,total:0};const c={...e};for(const p of et)delete c[p];const r=n.map(p=>{const j=p.read(c),E=p.alt(j);let ee=[],X="",G=null,I=null;try{G=tn({...c,[p.key]:j}),I=tn({...c,[p.key]:E}),ee=rn(G,I)}catch(de){X=de&&de.message||String(de)}const ie=ln(ee.filter(de=>hn(de.path))).map(de=>({path:de.path,label:cn(de.path),from:Ke(de.from),to:Ke(de.to)})),V=new Map;for(const de of ee){const ke=dn(de.path)||"其他";V.set(ke,(V.get(ke)||0)+1)}const ye=[...V.entries()].map(([de,ke])=>({name:de,count:ke})).sort((de,ke)=>ke.count-de.count||de.name.localeCompare(ke.name,"zh-Hans-CN"));return{key:p.key,title:p.title,short:p.short,current:j,alt:E,currentLabel:p.label(j),altLabel:p.label(E),total:ee.length,summary:X?"":un(ee),views:X?[]:En(a,G,I),roots:ie,categories:ye,error:X}});return{system:a,switches:r,affected:r.filter(p=>!p.error&&p.total>0).length,total:r.reduce((p,j)=>p+j.total,0)}}const tt=["chaibu","chaoshen","zhirun"],it=[1,3,5],at=["same-day","next-day"];function an(e,t=""){if(e==null||e==="")return;const a=t?`${t}的`:"";let n;if(typeof e=="number")n=e;else if(typeof e=="string"){const c=e.trim();if(!/^[+-]?(\d+(\.\d*)?|\.\d+)$/.test(c))throw le("E_RANGE",`${a}经度不是十进制数字:收到「${e}」。经度写数字即可,例如北京 116.4`);n=Number(c)}else throw le("E_RANGE",`${a}经度必须是数字或数字字符串,收到 ${Array.isArray(e)?"array":typeof e}`);if(!Number.isFinite(n))throw le("E_RANGE",`${a}经度不是有限数值:收到「${e}」。经度写十进制数字即可,例如北京 116.4`);if(n<-180||n>180)throw le("E_RANGE",`${a}经度要在 −180 到 180 之间(东经为正),收到 ${n}`);return n}function zn(e){const t=an(e.longitude,""),a=e.partner&&typeof e.partner=="object"?an(e.partner.longitude,"对方"):void 0,n=e.partner2&&typeof e.partner2=="object"?an(e.partner2.longitude,"第三方"):void 0;if(!(t!==void 0&&e.longitude!==t||a!==void 0&&e.partner.longitude!==a||n!==void 0&&e.partner2.longitude!==n))return e;const r={...e};return t!==void 0&&(r.longitude=t),a!==void 0&&(r.partner={...r.partner,longitude:a}),n!==void 0&&(r.partner2={...r.partner2,longitude:n}),r}function ot(e){if(e==null||e==="")return"full";if(e==="full"||e==="lean"||e==="brief")return e;throw le("E_INPUT",`detail 只能是 'full' / 'lean' / 'brief':收到「${String(e).slice(0,24)}」`)}function He(e){if(e==null||typeof e=="string"&&!e.trim())return;const t=s(e);if(!t)throw le("E_ASOF",`无法解析 asOf:「${e}」,请用 2026-10-22T16:00 这种格式`);const{year:a,month:n,day:c,hour:r,minute:p}=t;if(a<gn||a>pn)throw le("E_ASOF",`asOf 的年份超出可计算范围(${gn}–${pn}):${e}`);if(!(n>=1&&n<=12)||!(c>=1&&c<=Mn(a,n)))throw le("E_ASOF",`asOf 指向的日期不存在:${e}`);if(r!==void 0&&!(r>=0&&r<=23))throw le("E_ASOF",`asOf 的小时要在 0–23 之间:${e}`);if(p!==void 0&&!(p>=0&&p<=59))throw le("E_ASOF",`asOf 的分钟要在 0–59 之间:${e}`);return t}function st(e={}){const t=e.system;if(e.mode!==void 0&&e.mode!==null&&e.mode!==""){const a={convert:["solar2lunar","lunar2solar"],meihua:["time","number"],xiaoliuren:["time","number"]},n=a[t];if(!n)throw le("E_INPUT",`mode 只用于 ${Object.keys(a).join(" / ")};${t||"当前体系"} 不收 mode`);if(!n.includes(e.mode))throw le("E_INPUT",`${t} 的 mode 只能是 ${n.join(" / ")},收到「${String(e.mode).slice(0,24)}」`)}if(e.gender!==void 0&&e.gender!==null&&e.gender!==""&&e.gender!=="male"&&e.gender!=="female")throw le("E_INPUT",`gender 只能是 male / female,收到「${String(e.gender).slice(0,24)}」`);if(e.direction!==void 0&&e.direction!==null&&e.direction!==""&&!["general","wealth","career","love","health","study","travel"].includes(e.direction))throw le("E_INPUT",`direction 只能是 general / wealth / career / love / health / study / travel,收到「${String(e.direction).slice(0,24)}」`);if(e.fortuneYear!==void 0&&e.fortuneYear!==null&&e.fortuneYear!==""){const a=Number(e.fortuneYear);if(!Number.isInteger(a))throw le("E_INPUT",`fortuneYear 要是整数年份,收到「${e.fortuneYear}」`);e={...e,fortuneYear:a}}if(t==="bazi"){const a=fe(e.datetime),n=He(e.asOf),c=R({...a,gender:Le(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:H(e.lateZi,!0),trueSolar:H(e.trueSolar,!0),dst:H(e.dst,!0),nowYear:n?n.year:void 0,hourUnknown:H(e.hourUnknown)});return{...c,...n?{asOf:n}:{},precision:a.precision,summary:Pn(c)}}if(t==="ziwei"){if(H(e.hourUnknown))throw le("HOUR_UNKNOWN","紫微必须有出生时刻:命宫由生月与生时支定,时支未知则整盘不成立。请补上出生时刻,或改用八字三柱模式只看年/月/日。");e.lateZi!==void 0&&e.lateZishi===void 0&&(e={...e,lateZishi:H(e.lateZi,!0)?"next-day":"current-day"});const a=fe(e.datetime),n=He(e.asOf),c=y({...a,gender:Le(e.gender),leapMonth:e.leapMonth,leapAsNext:H(e.leapAsNext),...bn(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:H(e.trueSolar,!0),dst:H(e.dst,!0),asOf:n});return{...c,...n?{asOf:n}:{},precision:a.precision,summary:Ln(c)}}if(t==="tarot"){const a=e.spread!==void 0&&e.spread!==null&&String(e.spread).trim()!=="";let n;if(a){if(O.indexOf(String(e.spread).trim().toLowerCase())<0)throw le("E_SPREAD",`塔罗牌阵只能是 ${O.join(" / ")},收到「${e.spread}」`);n=void 0}else if(n=e.count===void 0||e.count===null||e.count===""?3:Number(e.count),!it.includes(n))throw le("E_COUNT",`塔罗张数只能是 1 / 3 / 5,收到「${e.count}」`);if(!oe(e.seed))throw le("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);const c=He(e.asOf),r=l({spread:a?e.spread:void 0,count:n,question:e.question,at:e.asOf,random:we(e.seed)});return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(r.seed=Number(e.seed)),{...r,...c?{asOf:c}:{},summary:Gn(r)}}if(t==="daliuren"){const a=fe(e.datetime),n=H(e.lateZi,!0),c=$({...a,lateZi:n});return c.lateZi=n,{...c,precision:a.precision,summary:Dn(c)}}if(t==="qimen"){const a=fe(e.datetime);if(e.juMethod!==void 0&&!tt.includes(e.juMethod))throw le("E_INPUT",`juMethod 只能是 chaibu / chaoshen / zhirun,收到「${e.juMethod}」`);const n=e.lateZiHourMode!==void 0?e.lateZiHourMode:e.lateZi===void 0||e.lateZi===null?void 0:H(e.lateZi)?"next-day":"same-day";if(n!==void 0&&!at.includes(n))throw le("E_INPUT",`lateZiHourMode 只能是 same-day / next-day,收到「${n}」`);const c=n==="next-day"?"next-day":"same-day",r=h({...a,lateZiHourMode:c,juMethod:e.juMethod});return r.lateZiHourMode=c,{...r,summary:Yn(r)}}if(t==="hepan"){if(H(e.hourUnknown)||e.partner&&H(e.partner.hourUnknown)||e.partner2&&H(e.partner2.hourUnknown))throw le("HOUR_UNKNOWN","合盘需要每一方都有出生时刻:夫妻宫与大运都依赖时支。请补齐时刻后再看,或用八字三柱模式各自看年/月/日。");const n=e.partner;if(!n||typeof n!="object")throw le("E_PARTNER","合盘需要 partner:{ datetime, gender, address? },其中 partner.datetime 是对方的公历出生时间");if(!n.datetime)throw le("E_PARTNER",'缺少 partner.datetime(对方的公历出生时间),例如 partner: {"datetime":"1992-03-03T10:00","gender":"female"}');const c=e.partner2;if(c!=null){if(typeof c!="object"||Array.isArray(c))throw le("E_PARTNER","partner2 需要 { datetime, gender, address? };不想看三方就整段省略(null 视同未传)");if(!c.datetime)throw le("E_PARTNER",'缺少 partner2.datetime(第三方的公历出生时间),例如 partner2: {"datetime":"1988-09-09T08:00","gender":"male"}')}const r=e.chart==="ziwei"?"ziwei":"bazi",p=(G,I)=>{const ie=fe(G.datetime),V=G.lateZishi!==void 0?G.lateZishi:G.lateZi===void 0||G.lateZi===null||G.lateZi===""?void 0:H(G.lateZi,!0)?"next-day":"current-day";return{...ie,gender:Le(G.gender,I),trueSolar:G.trueSolar,lateZi:G.lateZi,...V!==void 0?{lateZishi:V}:{},...G.leapMonth!==void 0?{leapMonth:G.leapMonth}:{},...G.leapAsNext!==void 0?{leapAsNext:H(G.leapAsNext)}:{},dst:H(G.dst,!0),address:typeof G.address=="string"?G.address:void 0,longitude:typeof G.longitude=="number"?G.longitude:void 0,geo:G.geo&&typeof G.geo=="object"?G.geo:void 0}},j=p(e,"你(主方)"),E=p(n,"对方"),ee=(G,I)=>r==="ziwei"?d({a:G,b:I}):w({a:G,b:I}),X=ee(j,E);if(c){const G=p(c,"第三方");X.triple=o([{key:"a-b",a:"你",b:"对方",result:X},{key:"a-c",a:"你",b:"第三方",result:ee(j,G)},{key:"b-c",a:"对方",b:"第三方",result:ee(E,G)}])}return{...X,summary:Zn(X)}}if(t==="meihua"){let a;e.mode!=="number"&&fe(e.datetime);try{a=x({mode:e.mode==="number"?"number":"time",datetime:e.datetime,upper:e.upper,lower:e.lower,changing:e.changing,lateZi:e.lateZi})}catch(n){const c=n&&n.message||String(n);throw le(n&&n.code||"E_INPUT",n&&n.code?c:`梅花起卦参数不完整:${c}`)}return{...a,summary:Un(a)}}if(t==="liuyao"){if(!oe(e.seed))throw le("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);let a;if(e.lines===void 0||e.lines===null)a=W(we(e.seed));else{if(!Array.isArray(e.lines))throw le("E_LINES","lines 必须是数组:自下而上 6 个爻值(6 老阴 / 7 少阳 / 8 少阴 / 9 老阳)");if(e.lines.length!==6)throw le("E_LINES",`六爻需要正好 6 个爻值(自下而上),收到 ${e.lines.length} 个;留空则由引擎随机摇卦`);a=e.lines.map(Number)}let n,c=null;const r=e.datetime?fe(e.datetime):He(e.asOf);if(r){e.datetime||(c=r);const G=B(se(M(r.year,r.month,r.day)));n={stem:G.stem,branch:G.branch,name:G.name}}let p;try{p=J({lines:a,question:e.question,dayGanZhi:n})}catch(G){throw le(G&&G.code||"E_LINES",G&&G.message?G.message:G)}const j=F(p,{direction:e.direction,gender:e.gender});j.liuqin&&(p.useGod=j);let E=null;if(r)try{E=(g({year:r.year,month:r.month,day:r.day,hour:r.hour,minute:r.minute}).monthGanZhi||"")[1]||null}catch{E=null}const ee=P(p,{monthBranch:E,dayBranch:p.dayGanZhi.branch});ee&&(p.hexStrength=ee);const X=z(p,{monthBranch:E,dayBranch:p.dayGanZhi.branch});if(X&&(p.jinTuiPower=X),j.liuqin){const G=q(p,j,{monthBranch:E,dayBranch:p.dayGanZhi.branch});G&&(p.useGodStrength=G);const I=A(p,j,{monthBranch:E,dayBranch:p.dayGanZhi.branch});I&&(p.fushenAccess=I);const ie=b(p,j,{monthBranch:E});ie&&(p.yingqi=ie)}return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(p.seed=Number(e.seed)),{...p,...c?{asOf:c}:{},summary:Hn(p)}}if(t==="almanac"){const a=fe(e.datetime),n=Ze({year:a.year,month:a.month,day:a.day});return{...n,summary:rt(n)}}if(t==="zeri"){if(!(e.candidates!==void 0&&e.candidates!==null)&&(typeof e.startDate!="string"||!e.startDate.trim()))throw le("E_INPUT",'择日需要 startDate(公历 YYYY-MM-DD,起算日);可另给 days(1–60,默认 30)与 shengXiao(当事人属相)。只想比几天,改给 candidates: ["2026-12-01","2026-12-08"]');let n;try{n=_e({task:e.task,startDate:e.startDate,days:e.days,shengXiao:e.shengXiao,candidates:e.candidates})}catch(c){throw le(c&&c.code||"E_INPUT",c&&c.message||String(c))}return{...n,summary:ut(n)}}if(t==="chenggu"){const a=fe(e.datetime),n=/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime)),c=Number.isInteger(e.hour)?e.hour:n?a.hour:null;if(c===null||c<0||c>23)throw le("E_INPUT","称骨必须给时辰:datetime 带时分(如 1990-08-15T10:00),或额外给 hour(0–23)——缺时辰四柱不齐");const r=Oe({year:a.year,month:a.month,day:a.day,hour:c,minute:n?a.minute:0,lateZi:e.lateZi});return{...r,summary:lt(r)}}if(t==="convert"){const a=e.mode==="lunar2solar"?"lunar2solar":"solar2lunar";let n;if(a==="lunar2solar"){if(e.lunarYear==null||e.lunarMonth==null||e.lunarDay==null)throw le("E_INPUT","农历转公历需要 lunarYear / lunarMonth / lunarDay(闰月另加 isLeapMonth: true)");n=De({mode:a,lunarYear:Number(e.lunarYear),lunarMonth:Number(e.lunarMonth),lunarDay:Number(e.lunarDay),isLeapMonth:H(e.isLeapMonth)})}else{const c=fe(e.datetime);n=De({mode:a,year:c.year,month:c.month,day:c.day})}return{...n,summary:dt(n)}}if(t==="xiaoliuren"){const a=e.datetime?fe(e.datetime):null,n=Se({mode:e.mode==="number"?"number":"time",date:typeof e.date=="string"&&e.date.trim()?e.date:a?`${a.year}-${a.month}-${a.day}`:void 0,hour:Number.isInteger(e.hour)?e.hour:a&&/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime))?a.hour:void 0,num1:e.num1,num2:e.num2,num3:e.num3,question:e.question,lateZi:e.lateZi});return{...n,summary:ct(n)}}if(t==="star"){const a=fe(e.datetime),n=Ne({year:a.year,month:a.month,day:a.day});return{...n,summary:ht(n)}}if(t==="numerology"){const a=fe(e.datetime),n=Pe({year:a.year,month:a.month,day:a.day});return{...n,summary:mt(n)}}if(t==="wuyunliuqi"){const a=fe(e.datetime),n=Me({year:a.year,month:a.month,day:a.day,hour:a.hour,minute:a.minute});return{...n,summary:$t(n)}}if(t==="taiyi"){const a=fe(e.datetime),n=Ie({year:a.year,month:a.month,day:a.day,hour:a.hour});return{...n,summary:ft(n)}}if(t==="constitution"){if(e.answers===void 0||e.answers===null){const n=he();return{...n,summary:gt(n)}}const a=ze({answers:e.answers});return{...a,summary:yt(a)}}if(t==="mbti"){if(e.answers===void 0||e.answers===null){const n=qe();return{...n,summary:bt(n)}}const a=xe({answers:e.answers});return{...a,summary:pt(a)}}if(t==="trend"){const a=fe(e.datetime),n=e.asOf?He(e.asOf):void 0,c=mn({...a,nowYear:n?n.year:void 0,gender:Le(e.gender),toAge:e.toAge,lateZi:H(e.lateZi,!0),trueSolar:H(e.trueSolar,!0),dst:H(e.dst,!0),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,hourUnknown:H(e.hourUnknown)});return{...c,...H(e.hourUnknown)?{hourUnknown:!0,hourPrecision:"day"}:{},precision:a.precision,summary:wt(c)}}if(t==="fengshui"){if(e.action!=null&&!["natal","advise","xuankong"].includes(e.action))throw le("E_INPUT",`风水 action 只能是 natal / advise / xuankong,收到「${String(e.action).slice(0,24)}」`);const a=e.action==="advise"?"advise":e.action==="xuankong"?"xuankong":"natal";if(a==="xuankong"){const r=We({action:a,sitting:e.sitting,facing:e.facing,...e.period!==void 0?{period:e.period}:{},...e.fortuneYear!==void 0?{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:H(e.dst,!0)});return{...r,summary:on(r)}}if(a==="advise"){const r=We({action:a,sitting:e.sitting,facing:e.facing,...e.datetime?fe(e.datetime):{},...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},dst:H(e.dst,!0)});return{...r,summary:on(r)}}const n=fe(e.datetime),c=We({action:"natal",year:n.year,month:n.month,day:n.day,gender:Le(e.gender),fortuneYear:e.fortuneYear,dst:H(e.dst,!0)});return{...c,summary:on(c)}}if(t==="name"){if(e.action!=null&&!["assess","generate"].includes(e.action))throw le("E_INPUT",`起名 action 只能是 assess / generate,收到「${String(e.action).slice(0,24)}」`);const a=e.action==="generate"?"generate":"assess",n=e.datetime?fe(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}:{}}:{},c=fn({action:a,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,...n,...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},...e.datetime?{lateZi:H(e.lateZi,!0),trueSolar:H(e.trueSolar,!0),dst:H(e.dst,!0),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{...c,summary:jt(c)}}throw t?le("E_SYSTEM",`未知体系「${t}」,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、constitution(中医体质)、wuyunliuqi(五运六气)、taiyi(太乙神数)、convert(公农历互转)。`):le("E_INPUT","缺少 system,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、constitution(中医体质)、wuyunliuqi(五运六气)、taiyi(太乙神数)、convert(公农历互转)。")}function rt(e){const t=e.ganzhi,a=e.jieQi&&e.jieQi.next?` 下一节:${e.jieQi.next.name} ${e.jieQi.next.date}`:"",n=e.dayGod?`值日:${e.dayGod.name}(${e.dayGod.type}·${e.dayGod.luck})`:"",c=e.xiu?`二十八宿:${e.xiu.name}宿(${e.xiu.luck}·${e.xiu.zheng}·${e.xiu.animal})`:"",r=e.taiShen?`胎神:${e.taiShen}`:"",p=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:"—"}`:"",j=e.lucky?`吉配生肖:六合${e.lucky.liuhe||"—"} 三合${(e.lucky.sanhe||[]).join("、")||"—"}`:"",E=e.nayin&&e.nayin.day?`日柱纳音:${e.nayin.day.name}`:"",ee=(e.hours||[]).map(X=>`${X.zhi}${X.ganZhi.slice(0,1)}·${X.shen}${X.luck==="吉"?"吉":"凶"}`).join(" ");return[`【黄历】${e.meta.date} ${e.meta.weekday} ${e.lunar.text}`,`干支:${t.year}年 ${t.month}月 ${t.day}日 属${t.shengXiao}`,...e.meta.boundaryNote?[` ${e.meta.boundaryNote}`]:[],`建除:${e.zhiXing}日 冲:${e.chong.text}${e.chong.sha?`(${e.chong.sha})`:""} ${n}`,[c,E,r].filter(Boolean).join(" "),`宜:${e.yi.join("、")}`,`忌:${e.ji.join("、")}`,p,j,ee?`时辰吉凶:${ee}`:"",`节气:上一节 ${e.jieQi.prev?`${e.jieQi.prev.name} ${e.jieQi.prev.date}`:"—"}${a}`,e.dailyHexagram?`每日一卦:${e.dailyHexagram.name} ${e.dailyHexagram.meaning||""}`:"",`口径:${e.meta.scope}`].filter(Boolean).join(`
102
- `)}function ut(e){const t=e.compare&&e.compare.mode==="candidates",a=t?`【择日·${e.meta.task}】候选 ${e.meta.days} 天:${e.meta.candidates.join("、")}${e.meta.shengXiao?` 当事人属${e.meta.shengXiao}`:"(未给属相,未做冲煞排除)"}`:`【择日·${e.meta.task}】${e.meta.startDate} 起 ${e.meta.days} 天${e.meta.shengXiao?` 当事人属${e.meta.shengXiao}`:"(未给属相,未做冲煞排除)"}`,n=e.days.slice().sort((r,p)=>p.score-r.score).slice(0,t?12:5).map(r=>{const p=r.grade?`,卷十${r.grade.label}·${r.grade.decision}`:"";return`· ${r.date} ${r.weekday} ${r.verdict}(${r.score}分${p}) 宜${r.yi.slice(0,3).join("/")} ${r.reasons.join(";")||"无特别加减分"}`}),c=t?e.compare.best?`这一组里最优:${e.compare.best.date}(${e.compare.best.score}分,${e.compare.best.verdict})`+(e.compare.best.ties.length>1?`;同分:${e.compare.best.ties.filter(r=>r!==e.compare.best.date).join("、")}`:""):"这一组都因冲属相被排除,没有可用的日子":`推荐日:${e.best.length?e.best.join("、"):"本期无(都不够推荐分)"}`;return[a,c,`推荐日:${e.best.length?e.best.join("、"):"无"}`,`可用日:${e.usable.length?e.usable.join("、"):"无"}`,`回避日:${e.avoid.length?e.avoid.slice(0,6).join("、"):"无"}`,t?"候选日逐日:":"逐日排序:",...n,...t?[`比较口径:${e.compare.note}`]:[],`神煞依据:${e.shenshaRef.text};起法 ${e.shenshaRef.volumes.join("、")}。未实现起法:${e.shenshaRef.unsupported.join("、")}(不计分,逐日 shensha.unsupported 列出)。`,...e.shenshaRef.juan10?[`卷十依据:${e.shenshaRef.juan10.text}(${e.shenshaRef.juan10.corpusLines});${e.shenshaRef.juan10.thresholdsNote}`]:[],`口径:${e.meta.scope}`].join(`
103
- `)}function lt(e){const t=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}):${t.text||"—"}`,`释义:${t.plain||"—"}`,`分档白话:${e.verdict.text}`,"口径:骨重与歌诀为通行本口径(各版本歌诀有异文),释义为白话自撰,属民俗娱乐参考。"].join(`
104
- `)}function ct(e){const t=e.question||e.meta&&e.meta.question||null;return[`【小六壬·${e.meta.mode}】${t?`所问:${t}`:""}`,e.meta.originText,`落宫:${e.steps.join(" → ")}`,`断语:${e.result.palace}(${e.result.luck}) ${e.result.text}`].join(`
101
+ ${I}`:ie}const et=["cross","verifyPast","withInterpret","detail","question","direction","ask","geocode","rectify","events","shadow","trace"];function nt(e={},t={}){const a=t.system||e.system,n=t.switches||An[a]||[];if(!n.length)return{system:a,switches:[],affected:0,total:0};const l={...e};for(const p of et)delete l[p];const r=n.map(p=>{const j=p.read(l),E=p.alt(j);let ne=[],X="",G=null,I=null;try{G=tn({...l,[p.key]:j}),I=tn({...l,[p.key]:E}),ne=rn(G,I)}catch(de){X=de&&de.message||String(de)}const ie=cn(ne.filter(de=>hn(de.path))).map(de=>({path:de.path,label:ln(de.path),from:Ke(de.from),to:Ke(de.to)})),V=new Map;for(const de of ne){const ke=dn(de.path)||"其他";V.set(ke,(V.get(ke)||0)+1)}const ye=[...V.entries()].map(([de,ke])=>({name:de,count:ke})).sort((de,ke)=>ke.count-de.count||de.name.localeCompare(ke.name,"zh-Hans-CN"));return{key:p.key,title:p.title,short:p.short,current:j,alt:E,currentLabel:p.label(j),altLabel:p.label(E),total:ne.length,summary:X?"":un(ne),views:X?[]:En(a,G,I),roots:ie,categories:ye,error:X}});return{system:a,switches:r,affected:r.filter(p=>!p.error&&p.total>0).length,total:r.reduce((p,j)=>p+j.total,0)}}const tt=["chaibu","chaoshen","zhirun"],it=[1,3,5],at=["same-day","next-day"];function an(e,t=""){if(e==null||e==="")return;const a=t?`${t}的`:"";let n;if(typeof e=="number")n=e;else if(typeof e=="string"){const l=e.trim();if(!/^[+-]?(\d+(\.\d*)?|\.\d+)$/.test(l))throw ce("E_RANGE",`${a}经度不是十进制数字:收到「${e}」。经度写数字即可,例如北京 116.4`);n=Number(l)}else throw ce("E_RANGE",`${a}经度必须是数字或数字字符串,收到 ${Array.isArray(e)?"array":typeof e}`);if(!Number.isFinite(n))throw ce("E_RANGE",`${a}经度不是有限数值:收到「${e}」。经度写十进制数字即可,例如北京 116.4`);if(n<-180||n>180)throw ce("E_RANGE",`${a}经度要在 −180 到 180 之间(东经为正),收到 ${n}`);return n}function zn(e){const t=an(e.longitude,""),a=e.partner&&typeof e.partner=="object"?an(e.partner.longitude,"对方"):void 0,n=e.partner2&&typeof e.partner2=="object"?an(e.partner2.longitude,"第三方"):void 0;if(!(t!==void 0&&e.longitude!==t||a!==void 0&&e.partner.longitude!==a||n!==void 0&&e.partner2.longitude!==n))return e;const r={...e};return t!==void 0&&(r.longitude=t),a!==void 0&&(r.partner={...r.partner,longitude:a}),n!==void 0&&(r.partner2={...r.partner2,longitude:n}),r}function ot(e){if(e==null||e==="")return"full";if(e==="full"||e==="lean"||e==="brief")return e;throw ce("E_INPUT",`detail 只能是 'full' / 'lean' / 'brief':收到「${String(e).slice(0,24)}」`)}function He(e){if(e==null||typeof e=="string"&&!e.trim())return;const t=s(e);if(!t)throw ce("E_ASOF",`无法解析 asOf:「${e}」,请用 2026-10-22T16:00 这种格式`);const{year:a,month:n,day:l,hour:r,minute:p}=t;if(a<gn||a>pn)throw ce("E_ASOF",`asOf 的年份超出可计算范围(${gn}–${pn}):${e}`);if(!(n>=1&&n<=12)||!(l>=1&&l<=On(a,n)))throw ce("E_ASOF",`asOf 指向的日期不存在:${e}`);if(r!==void 0&&!(r>=0&&r<=23))throw ce("E_ASOF",`asOf 的小时要在 0–23 之间:${e}`);if(p!==void 0&&!(p>=0&&p<=59))throw ce("E_ASOF",`asOf 的分钟要在 0–59 之间:${e}`);return t}function st(e={}){const t=e.system;if(e.mode!==void 0&&e.mode!==null&&e.mode!==""){const a={convert:["solar2lunar","lunar2solar"],meihua:["time","number"],xiaoliuren:["time","number"]},n=a[t];if(!n)throw ce("E_INPUT",`mode 只用于 ${Object.keys(a).join(" / ")};${t||"当前体系"} 不收 mode`);if(!n.includes(e.mode))throw ce("E_INPUT",`${t} 的 mode 只能是 ${n.join(" / ")},收到「${String(e.mode).slice(0,24)}」`)}if(e.gender!==void 0&&e.gender!==null&&e.gender!==""&&e.gender!=="male"&&e.gender!=="female")throw ce("E_INPUT",`gender 只能是 male / female,收到「${String(e.gender).slice(0,24)}」`);if(e.direction!==void 0&&e.direction!==null&&e.direction!==""&&!["general","wealth","career","love","health","study","travel"].includes(e.direction))throw ce("E_INPUT",`direction 只能是 general / wealth / career / love / health / study / travel,收到「${String(e.direction).slice(0,24)}」`);if(e.fortuneYear!==void 0&&e.fortuneYear!==null&&e.fortuneYear!==""){const a=Number(e.fortuneYear);if(!Number.isInteger(a))throw ce("E_INPUT",`fortuneYear 要是整数年份,收到「${e.fortuneYear}」`);e={...e,fortuneYear:a}}if(t==="bazi"){const a=$e(e.datetime),n=He(e.asOf),l=Y({...a,gender:Re(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:F(e.lateZi,!0),trueSolar:F(e.trueSolar,!0),dst:F(e.dst,!0),nowYear:n?n.year:void 0,hourUnknown:F(e.hourUnknown)});return{...l,...n?{asOf:n}:{},precision:a.precision,summary:Pn(l)}}if(t==="ziwei"){if(F(e.hourUnknown))throw ce("HOUR_UNKNOWN","紫微必须有出生时刻:命宫由生月与生时支定,时支未知则整盘不成立。请补上出生时刻,或改用八字三柱模式只看年/月/日。");e.lateZi!==void 0&&e.lateZishi===void 0&&(e={...e,lateZishi:F(e.lateZi,!0)?"next-day":"current-day"});const a=$e(e.datetime),n=He(e.asOf),l=y({...a,gender:Re(e.gender),leapMonth:e.leapMonth,leapAsNext:F(e.leapAsNext),...bn(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:F(e.trueSolar,!0),dst:F(e.dst,!0),asOf:n});return{...l,...n?{asOf:n}:{},precision:a.precision,summary:Ln(l)}}if(t==="tarot"){const a=e.spread!==void 0&&e.spread!==null&&String(e.spread).trim()!=="";let n;if(a){if(M.indexOf(String(e.spread).trim().toLowerCase())<0)throw ce("E_SPREAD",`塔罗牌阵只能是 ${M.join(" / ")},收到「${e.spread}」`);n=void 0}else if(n=e.count===void 0||e.count===null||e.count===""?3:Number(e.count),!it.includes(n))throw ce("E_COUNT",`塔罗张数只能是 1 / 3 / 5,收到「${e.count}」`);if(!oe(e.seed))throw ce("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);const l=He(e.asOf),r=c({spread:a?e.spread:void 0,count:n,question:e.question,at:e.asOf,random:je(e.seed)});return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(r.seed=Number(e.seed)),{...r,...l?{asOf:l}:{},summary:Gn(r)}}if(t==="daliuren"){const a=$e(e.datetime),n=F(e.lateZi,!0),l=$({...a,lateZi:n});return l.lateZi=n,{...l,precision:a.precision,summary:Dn(l)}}if(t==="qimen"){const a=$e(e.datetime);if(e.juMethod!==void 0&&!tt.includes(e.juMethod))throw ce("E_INPUT",`juMethod 只能是 chaibu / chaoshen / zhirun,收到「${e.juMethod}」`);const n=e.lateZiHourMode!==void 0?e.lateZiHourMode:e.lateZi===void 0||e.lateZi===null?void 0:F(e.lateZi)?"next-day":"same-day";if(n!==void 0&&!at.includes(n))throw ce("E_INPUT",`lateZiHourMode 只能是 same-day / next-day,收到「${n}」`);const l=n==="next-day"?"next-day":"same-day",r=h({...a,lateZiHourMode:l,juMethod:e.juMethod});return r.lateZiHourMode=l,{...r,summary:Yn(r)}}if(t==="hepan"){if(F(e.hourUnknown)||e.partner&&F(e.partner.hourUnknown)||e.partner2&&F(e.partner2.hourUnknown))throw ce("HOUR_UNKNOWN","合盘需要每一方都有出生时刻:夫妻宫与大运都依赖时支。请补齐时刻后再看,或用八字三柱模式各自看年/月/日。");const n=e.partner;if(!n||typeof n!="object")throw ce("E_PARTNER","合盘需要 partner:{ datetime, gender, address? },其中 partner.datetime 是对方的公历出生时间");if(!n.datetime)throw ce("E_PARTNER",'缺少 partner.datetime(对方的公历出生时间),例如 partner: {"datetime":"1992-03-03T10:00","gender":"female"}');const l=e.partner2;if(l!=null){if(typeof l!="object"||Array.isArray(l))throw ce("E_PARTNER","partner2 需要 { datetime, gender, address? };不想看三方就整段省略(null 视同未传)");if(!l.datetime)throw ce("E_PARTNER",'缺少 partner2.datetime(第三方的公历出生时间),例如 partner2: {"datetime":"1988-09-09T08:00","gender":"male"}')}const r=e.chart==="ziwei"?"ziwei":"bazi",p=(G,I)=>{const ie=$e(G.datetime),V=G.lateZishi!==void 0?G.lateZishi:G.lateZi===void 0||G.lateZi===null||G.lateZi===""?void 0:F(G.lateZi,!0)?"next-day":"current-day";return{...ie,gender:Re(G.gender,I),trueSolar:G.trueSolar,lateZi:G.lateZi,...V!==void 0?{lateZishi:V}:{},...G.leapMonth!==void 0?{leapMonth:G.leapMonth}:{},...G.leapAsNext!==void 0?{leapAsNext:F(G.leapAsNext)}:{},dst:F(G.dst,!0),address:typeof G.address=="string"?G.address:void 0,longitude:typeof G.longitude=="number"?G.longitude:void 0,geo:G.geo&&typeof G.geo=="object"?G.geo:void 0}},j=p(e,"你(主方)"),E=p(n,"对方"),ne=(G,I)=>r==="ziwei"?d({a:G,b:I}):w({a:G,b:I}),X=ne(j,E);if(l){const G=p(l,"第三方");X.triple=o([{key:"a-b",a:"你",b:"对方",result:X},{key:"a-c",a:"你",b:"第三方",result:ne(j,G)},{key:"b-c",a:"对方",b:"第三方",result:ne(E,G)}])}return{...X,summary:Zn(X)}}if(t==="meihua"){let a;e.mode!=="number"&&$e(e.datetime);try{a=x({mode:e.mode==="number"?"number":"time",datetime:e.datetime,upper:e.upper,lower:e.lower,changing:e.changing,lateZi:e.lateZi})}catch(n){const l=n&&n.message||String(n);throw ce(n&&n.code||"E_INPUT",n&&n.code?l:`梅花起卦参数不完整:${l}`)}return{...a,summary:Un(a)}}if(t==="liuyao"){if(!oe(e.seed))throw ce("E_INPUT",`seed 必须是数字,收到「${e.seed}」`);let a;if(e.lines===void 0||e.lines===null)a=Q(je(e.seed));else{if(!Array.isArray(e.lines))throw ce("E_LINES","lines 必须是数组:自下而上 6 个爻值(6 老阴 / 7 少阳 / 8 少阴 / 9 老阳)");if(e.lines.length!==6)throw ce("E_LINES",`六爻需要正好 6 个爻值(自下而上),收到 ${e.lines.length} 个;留空则由引擎随机摇卦`);a=e.lines.map(Number)}let n,l=null;const r=e.datetime?$e(e.datetime):He(e.asOf);if(r){e.datetime||(l=r);const G=J(se(O(r.year,r.month,r.day)));n={stem:G.stem,branch:G.branch,name:G.name}}let p;try{p=K({lines:a,question:e.question,dayGanZhi:n})}catch(G){throw ce(G&&G.code||"E_LINES",G&&G.message?G.message:G)}const j=B(p,{direction:e.direction,gender:e.gender});j.liuqin&&(p.useGod=j);let E=null;if(r)try{E=(g({year:r.year,month:r.month,day:r.day,hour:r.hour,minute:r.minute}).monthGanZhi||"")[1]||null}catch{E=null}const ne=P(p,{monthBranch:E,dayBranch:p.dayGanZhi.branch});ne&&(p.hexStrength=ne);const X=z(p,{monthBranch:E,dayBranch:p.dayGanZhi.branch});if(X&&(p.jinTuiPower=X),j.liuqin){const G=q(p,j,{monthBranch:E,dayBranch:p.dayGanZhi.branch});G&&(p.useGodStrength=G);const I=A(p,j,{monthBranch:E,dayBranch:p.dayGanZhi.branch});I&&(p.fushenAccess=I);const ie=b(p,j,{monthBranch:E});ie&&(p.yingqi=ie)}return e.seed!==void 0&&e.seed!==null&&e.seed!==""&&(p.seed=Number(e.seed)),{...p,...l?{asOf:l}:{},summary:Hn(p)}}if(t==="almanac"){const a=$e(e.datetime),n=De({year:a.year,month:a.month,day:a.day});return{...n,summary:rt(n)}}if(t==="zeri"){if(!(e.candidates!==void 0&&e.candidates!==null)&&(typeof e.startDate!="string"||!e.startDate.trim()))throw ce("E_INPUT",'择日需要 startDate(公历 YYYY-MM-DD,起算日);可另给 days(1–60,默认 30)与 shengXiao(当事人属相)。只想比几天,改给 candidates: ["2026-12-01","2026-12-08"]');let n;try{n=Le({task:e.task,startDate:e.startDate,days:e.days,shengXiao:e.shengXiao,candidates:e.candidates})}catch(l){throw ce(l&&l.code||"E_INPUT",l&&l.message||String(l))}return{...n,summary:ut(n)}}if(t==="chenggu"){const a=$e(e.datetime),n=/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime)),l=Number.isInteger(e.hour)?e.hour:n?a.hour:null;if(l===null||l<0||l>23)throw ce("E_INPUT","称骨必须给时辰:datetime 带时分(如 1990-08-15T10:00),或额外给 hour(0–23)——缺时辰四柱不齐");const r=Me({year:a.year,month:a.month,day:a.day,hour:l,minute:n?a.minute:0,lateZi:e.lateZi});return{...r,summary:ct(r)}}if(t==="convert"){const a=e.mode==="lunar2solar"?"lunar2solar":"solar2lunar";let n;if(a==="lunar2solar"){if(e.lunarYear==null||e.lunarMonth==null||e.lunarDay==null)throw ce("E_INPUT","农历转公历需要 lunarYear / lunarMonth / lunarDay(闰月另加 isLeapMonth: true)");n=Ue({mode:a,lunarYear:Number(e.lunarYear),lunarMonth:Number(e.lunarMonth),lunarDay:Number(e.lunarDay),isLeapMonth:F(e.isLeapMonth)})}else{const l=$e(e.datetime);n=Ue({mode:a,year:l.year,month:l.month,day:l.day})}return{...n,summary:dt(n)}}if(t==="xiaoliuren"){const a=e.datetime?$e(e.datetime):null,n=Se({mode:e.mode==="number"?"number":"time",date:typeof e.date=="string"&&e.date.trim()?e.date:a?`${a.year}-${a.month}-${a.day}`:void 0,hour:Number.isInteger(e.hour)?e.hour:a&&/[T\s]\d{1,2}:\d{1,2}/.test(String(e.datetime))?a.hour:void 0,num1:e.num1,num2:e.num2,num3:e.num3,question:e.question,lateZi:e.lateZi});return{...n,summary:lt(n)}}if(t==="star"){const a=$e(e.datetime),n=Ne({year:a.year,month:a.month,day:a.day});return{...n,summary:ht(n)}}if(t==="numerology"){const a=$e(e.datetime),n=Ce({year:a.year,month:a.month,day:a.day});return{...n,summary:mt(n)}}if(t==="wuyunliuqi"){const a=$e(e.datetime),n=Oe({year:a.year,month:a.month,day:a.day,hour:a.hour,minute:a.minute});return{...n,summary:$t(n)}}if(t==="taiyi"){const a=$e(e.datetime),n=Pe({year:a.year,month:a.month,day:a.day,hour:a.hour});return{...n,summary:ft(n)}}if(t==="constitution"){if(e.answers===void 0||e.answers===null){const n=he();return{...n,summary:gt(n)}}const a=ze({answers:e.answers});return{...a,summary:yt(a)}}if(t==="mbti"){if(e.answers===void 0||e.answers===null){const n=Ie();return{...n,summary:bt(n)}}const a=xe({answers:e.answers});return{...a,summary:pt(a)}}if(t==="trend"){const a=$e(e.datetime),n=e.asOf?He(e.asOf):void 0,l=mn({...a,nowYear:n?n.year:void 0,gender:Re(e.gender),toAge:e.toAge,lateZi:F(e.lateZi,!0),trueSolar:F(e.trueSolar,!0),dst:F(e.dst,!0),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,hourUnknown:F(e.hourUnknown)});return{...l,...F(e.hourUnknown)?{hourUnknown:!0,hourPrecision:"day"}:{},precision:a.precision,summary:wt(l)}}if(t==="fengshui"){if(e.action!=null&&!["natal","advise","xuankong"].includes(e.action))throw ce("E_INPUT",`风水 action 只能是 natal / advise / xuankong,收到「${String(e.action).slice(0,24)}」`);const a=e.action==="advise"?"advise":e.action==="xuankong"?"xuankong":"natal";if(a==="xuankong"){const r=We({action:a,sitting:e.sitting,facing:e.facing,...e.period!==void 0?{period:e.period}:{},...e.fortuneYear!==void 0?{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:F(e.dst,!0)});return{...r,summary:on(r)}}if(a==="advise"){const r=We({action:a,sitting:e.sitting,facing:e.facing,...e.datetime?$e(e.datetime):{},...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},dst:F(e.dst,!0)});return{...r,summary:on(r)}}const n=$e(e.datetime),l=We({action:"natal",year:n.year,month:n.month,day:n.day,gender:Re(e.gender),fortuneYear:e.fortuneYear,dst:F(e.dst,!0)});return{...l,summary:on(l)}}if(t==="name"){if(e.action!=null&&!["assess","generate"].includes(e.action))throw ce("E_INPUT",`起名 action 只能是 assess / generate,收到「${String(e.action).slice(0,24)}」`);const a=e.action==="generate"?"generate":"assess",n=e.datetime?$e(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}:{}}:{},l=fn({action:a,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,...n,...e.gender==="male"||e.gender==="female"?{gender:e.gender}:{},...e.datetime?{lateZi:F(e.lateZi,!0),trueSolar:F(e.trueSolar,!0),dst:F(e.dst,!0),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{...l,summary:jt(l)}}throw t?ce("E_SYSTEM",`未知体系「${t}」,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、constitution(中医体质)、wuyunliuqi(五运六气)、taiyi(太乙神数)、convert(公农历互转)。`):ce("E_INPUT","缺少 system,可选:bazi(四柱八字)、ziwei(紫微斗数)、liuyao(六爻)、meihua(梅花易数)、daliuren(大六壬)、qimen(奇门遁甲)、hepan(合盘)、tarot(塔罗)、almanac(黄历)、zeri(择日)、chenggu(称骨)、xiaoliuren(小六壬)、star(星座)、numerology(生命数字)、mbti(十六型人格问卷)、trend(人生 K 线)、fengshui(风水)、name(起名)、constitution(中医体质)、wuyunliuqi(五运六气)、taiyi(太乙神数)、convert(公农历互转)。")}function rt(e){const t=e.ganzhi,a=e.jieQi&&e.jieQi.next?` 下一节:${e.jieQi.next.name} ${e.jieQi.next.date}`:"",n=e.dayGod?`值日:${e.dayGod.name}(${e.dayGod.type}·${e.dayGod.luck})`:"",l=e.xiu?`二十八宿:${e.xiu.name}宿(${e.xiu.luck}·${e.xiu.zheng}·${e.xiu.animal})`:"",r=e.taiShen?`胎神:${e.taiShen}`:"",p=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:"—"}`:"",j=e.lucky?`吉配生肖:六合${e.lucky.liuhe||"—"} 三合${(e.lucky.sanhe||[]).join("、")||"—"}`:"",E=e.nayin&&e.nayin.day?`日柱纳音:${e.nayin.day.name}`:"",ne=(e.hours||[]).map(X=>`${X.zhi}${X.ganZhi.slice(0,1)}·${X.shen}${X.luck==="吉"?"吉":"凶"}`).join(" ");return[`【黄历】${e.meta.date} ${e.meta.weekday} ${e.lunar.text}`,`干支:${t.year}年 ${t.month}月 ${t.day}日 属${t.shengXiao}`,...e.meta.boundaryNote?[` ${e.meta.boundaryNote}`]:[],`建除:${e.zhiXing}日 冲:${e.chong.text}${e.chong.sha?`(${e.chong.sha})`:""} ${n}`,[l,E,r].filter(Boolean).join(" "),`宜:${e.yi.join("、")}`,`忌:${e.ji.join("、")}`,p,j,ne?`时辰吉凶:${ne}`:"",`节气:上一节 ${e.jieQi.prev?`${e.jieQi.prev.name} ${e.jieQi.prev.date}`:"—"}${a}`,e.dailyHexagram?`每日一卦:${e.dailyHexagram.name} ${e.dailyHexagram.meaning||""}`:"",`口径:${e.meta.scope}`].filter(Boolean).join(`
102
+ `)}function ut(e){const t=e.compare&&e.compare.mode==="candidates",a=t?`【择日·${e.meta.task}】候选 ${e.meta.days} 天:${e.meta.candidates.join("、")}${e.meta.shengXiao?` 当事人属${e.meta.shengXiao}`:"(未给属相,未做冲煞排除)"}`:`【择日·${e.meta.task}】${e.meta.startDate} 起 ${e.meta.days} 天${e.meta.shengXiao?` 当事人属${e.meta.shengXiao}`:"(未给属相,未做冲煞排除)"}`,n=e.days.slice().sort((r,p)=>p.score-r.score).slice(0,t?12:5).map(r=>{const p=r.grade?`,卷十${r.grade.label}·${r.grade.decision}`:"";return`· ${r.date} ${r.weekday} ${r.verdict}(${r.score}分${p}) 宜${r.yi.slice(0,3).join("/")} ${r.reasons.join(";")||"无特别加减分"}`}),l=t?e.compare.best?`这一组里最优:${e.compare.best.date}(${e.compare.best.score}分,${e.compare.best.verdict})`+(e.compare.best.ties.length>1?`;同分:${e.compare.best.ties.filter(r=>r!==e.compare.best.date).join("、")}`:""):"这一组都因冲属相被排除,没有可用的日子":`推荐日:${e.best.length?e.best.join("、"):"本期无(都不够推荐分)"}`;return[a,l,`推荐日:${e.best.length?e.best.join("、"):"无"}`,`可用日:${e.usable.length?e.usable.join("、"):"无"}`,`回避日:${e.avoid.length?e.avoid.slice(0,6).join("、"):"无"}`,t?"候选日逐日:":"逐日排序:",...n,...t?[`比较口径:${e.compare.note}`]:[],`神煞依据:${e.shenshaRef.text};起法 ${e.shenshaRef.volumes.join("、")}。未实现起法:${e.shenshaRef.unsupported.join("、")}(不计分,逐日 shensha.unsupported 列出)。`,...e.shenshaRef.juan10?[`卷十依据:${e.shenshaRef.juan10.text}(${e.shenshaRef.juan10.corpusLines});${e.shenshaRef.juan10.thresholdsNote}`]:[],`口径:${e.meta.scope}`].join(`
103
+ `)}function ct(e){const t=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}):${t.text||"—"}`,`释义:${t.plain||"—"}`,`分档白话:${e.verdict.text}`,"口径:骨重与歌诀为通行本口径(各版本歌诀有异文),释义为白话自撰,属民俗娱乐参考。"].join(`
104
+ `)}function lt(e){const t=e.question||e.meta&&e.meta.question||null;return[`【小六壬·${e.meta.mode}】${t?`所问:${t}`:""}`,e.meta.originText,`落宫:${e.steps.join(" → ")}`,`断语:${e.result.palace}(${e.result.luck}) ${e.result.text}`].join(`
105
105
  `)}function ht(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(t=>`· ${t.name}:${"★".repeat(t.stars)}${"☆".repeat(5-t.stars)} ${t.text}`).join(`
106
106
  `),`幸运色:${e.daily.luckyColor} 幸运数字:${e.daily.luckyNumber}`,"口径:当日基调由日期哈希确定性生成(同日同结果),纯娱乐向。"].join(`
107
107
  `)}function dt(e){const t=e.ganzhi;return[`【公农历转换·${e.meta.mode==="lunar2solar"?"农历 → 公历":"公历 → 农历"}】${e.lunar.text} ⇄ ${e.solar.text} ${e.meta.weekday}`,`干支:${t.year}年 ${t.month}月 ${t.day}日 属${t.shengXiao}${t.springYear&&t.springYear!==t.year?`(春节界为${t.springYear}年)`:""}`,...e.meta.note?[`注:${e.meta.note}`]:[],`口径:${e.meta.scope}`].join(`
108
108
  `)}function mt(e){return[`【生命数字】${e.meta.date}(西方数字学,与八字/紫微不可互证)`,...e.parts.map(t=>`${t.name}:${t.number}(${t.meaning.title}) ${t.meaning.keywords}
109
109
   倾向:${t.meaning.tendency}
110
110
   课题:${t.meaning.lesson}`)].join(`
111
- `)}function ft(e){const t=[];t.push(`太乙积年 ${e.meta.jinian},残年 ${e.meta.rest360},${e.meta.dunText}${e.meta.ju}局。`),t.push(`${e.year.jiName}${e.year.jiYear}年,${e.year.yuanName}第${e.year.yuanYear}年。`),t.push(`太乙在${e.taiyi.palaceName}宫(第${e.taiyi.palace}宫,${e.taiyi.dir}),第${e.taiyi.yearInPalace}年,${e.taiyi.li}。`),t.push(`八门:${e.gate.gate}。`),t.push(`文昌在${e.wenchang.pos}(${e.wenchang.god},${e.wenchang.palaceName}宫)。`),t.push(`计神在${e.jishen.branch}(${e.jishen.god}),始击在${e.shiji.pos}(${e.shiji.god},${e.shiji.palaceName}宫)。`),t.push(`主算 ${e.suan.zhu}:主大将${e.jiang.zhuDaName}宫、主参将${e.jiang.zhuCanName}宫;客算 ${e.suan.ke}:客大将${e.jiang.keDaName}宫、客参将${e.jiang.keCanName}宫。`),t.push(e.geju.list.length?`格局:${e.geju.list.join(";")}。`:"四将之间不相犯,没有掩、迫、囚、格、关。"),t.push(`定目在${e.dingmu.pos}(${e.dingmu.god},${e.dingmu.palaceName}宫)。`),t.push(`三基:君基${e.sanji.jun}、臣基${e.sanji.chen}、民基${e.sanji.min};五福在${e.wufu.palaceName}宫,大游在${e.dayou.palaceName}宫。`),t.push(`十精:天乙${e.shijing.tianyi}、地乙${e.shijing.diyi}、直符${e.shijing.zhifu}、四神${e.shijing.sishen}、小游${e.shijing.xiaoyou}。`),t.push(`数和-主算:${e.heshu.zhu.text} 客算:${e.heshu.ke.text}`);const a=e.shenjiang||{};if(a.rows){const n=a.goods&&a.goods.length?a.goods.join("、"):"无",c=a.bads&&a.bads.length?a.bads.join("、"):"无";t.push(`神将:${a.stem}日(${a.day?"昼贵":"夜贵"})起${a.startBranch}、${a.dir>0?"顺":"逆"}行;在吉神下的有 ${n};在凶神下的有 ${c}。`)}return e.verdict&&t.push(`判辞:${e.verdict.label}。`),t.push(`月计:太乙在${e.month.taiyi.palaceName}宫(第${e.month.taiyi.unitInPalace}月),天目${e.month.mu.pos}(${e.month.mu.god}),计神在${e.month.jishen.branch}。`),t.push(`日计:太乙在${e.day.taiyi.palaceName}宫(第${e.day.taiyi.unitInPalace}日),天目${e.day.mu.pos}(${e.day.mu.god}),计神在${e.day.jishen.branch}。`),t.push(`时计:太乙在${e.hour.taiyi.palaceName}宫(第${e.hour.taiyi.unitInPalace}时),计神在${e.hour.jishen.branch}。${e.hour.note}`),t.push(`卦象:${e.jixiong.label}——${e.jixiong.text}`),t.push(`这一层到太乙、八门、文昌、计神、始击、主客算与四将、八种格局、定目、三基、五福、大游、十精、阴阳数和、月日时三计与古法吉凶;${e.scope.notCovered.join("、")}未收录。`),t.join(`
112
- `)}function $t(e){const t=[];t.push(`【运气年】${e.year.ganzhi} ${e.year.nian} 年(大寒界:${e.year.startTime} — ${e.year.endTime})`),t.push(`【中运】${e.zhongyun.text}`),t.push(`【司天在泉】${e.sitian.qi}司天 ${e.zaiquan.qi}在泉`),t.push(`【当前】${e.current.text}`),t.push("【客运五步】");for(const n of e.keYun)t.push(` ${n.no} ${n.name}(${n.taiShao}) ${n.startTime} — ${n.endTime}`);t.push("【客气六步】");for(const n of e.keQi){const c=n.sitian?"(司天)":n.zaiquan?"(在泉)":"";t.push(` ${n.no} ${n.qi}${c} ${n.startTime} — ${n.endTime}`)}const a=[];return e.special.taiYi&&a.push("太乙天符"),e.special.tianFu&&!e.special.taiYi&&a.push("天符"),e.special.suiHui&&!e.special.taiYi&&a.push("岁会"),e.special.tongTianFu&&a.push("同天符"),e.special.tongSuiHui&&a.push("同岁会"),a.length&&t.push(`【特殊】${a.join("、")}`),t.push(`【组合】${e.combo.text}`),t.push(`【边界】${e.scope.note}`),t.join(`
111
+ `)}function ft(e){const t=[];t.push(`太乙积年 ${e.meta.jinian},残年 ${e.meta.rest360},${e.meta.dunText}${e.meta.ju}局。`),t.push(`${e.year.jiName}${e.year.jiYear}年,${e.year.yuanName}第${e.year.yuanYear}年。`),t.push(`太乙在${e.taiyi.palaceName}宫(第${e.taiyi.palace}宫,${e.taiyi.dir}),第${e.taiyi.yearInPalace}年,${e.taiyi.li}。`),t.push(`八门:${e.gate.gate}。`),t.push(`文昌在${e.wenchang.pos}(${e.wenchang.god},${e.wenchang.palaceName}宫)。`),t.push(`计神在${e.jishen.branch}(${e.jishen.god}),始击在${e.shiji.pos}(${e.shiji.god},${e.shiji.palaceName}宫)。`),t.push(`主算 ${e.suan.zhu}:主大将${e.jiang.zhuDaName}宫、主参将${e.jiang.zhuCanName}宫;客算 ${e.suan.ke}:客大将${e.jiang.keDaName}宫、客参将${e.jiang.keCanName}宫。`),t.push(e.geju.list.length?`格局:${e.geju.list.join(";")}。`:"四将之间不相犯,没有掩、迫、囚、格、关。"),t.push(`定目在${e.dingmu.pos}(${e.dingmu.god},${e.dingmu.palaceName}宫)。`),t.push(`三基:君基${e.sanji.jun}、臣基${e.sanji.chen}、民基${e.sanji.min};五福在${e.wufu.palaceName}宫,大游在${e.dayou.palaceName}宫。`),t.push(`十精:天乙${e.shijing.tianyi}、地乙${e.shijing.diyi}、直符${e.shijing.zhifu}、四神${e.shijing.sishen}、小游${e.shijing.xiaoyou}。`),t.push(`数和-主算:${e.heshu.zhu.text} 客算:${e.heshu.ke.text}`);const a=e.shenjiang||{};if(a.rows){const n=a.goods&&a.goods.length?a.goods.join("、"):"无",l=a.bads&&a.bads.length?a.bads.join("、"):"无";t.push(`神将:${a.stem}日(${a.day?"昼贵":"夜贵"})起${a.startBranch}、${a.dir>0?"顺":"逆"}行;在吉神下的有 ${n};在凶神下的有 ${l}。`)}return e.verdict&&t.push(`判辞:${e.verdict.label}。`),t.push(`月计:太乙在${e.month.taiyi.palaceName}宫(第${e.month.taiyi.unitInPalace}月),天目${e.month.mu.pos}(${e.month.mu.god}),计神在${e.month.jishen.branch}。`),t.push(`日计:太乙在${e.day.taiyi.palaceName}宫(第${e.day.taiyi.unitInPalace}日),天目${e.day.mu.pos}(${e.day.mu.god}),计神在${e.day.jishen.branch}。`),t.push(`时计:太乙在${e.hour.taiyi.palaceName}宫(第${e.hour.taiyi.unitInPalace}时),计神在${e.hour.jishen.branch}。${e.hour.note}`),t.push(`卦象:${e.jixiong.label}——${e.jixiong.text}`),t.push(`这一层到太乙、八门、文昌、计神、始击、主客算与四将、八种格局、定目、三基、五福、大游、十精、阴阳数和、月日时三计与古法吉凶;${e.scope.notCovered.join("、")}未收录。`),t.join(`
112
+ `)}function $t(e){const t=[];t.push(`【运气年】${e.year.ganzhi} ${e.year.nian} 年(大寒界:${e.year.startTime} — ${e.year.endTime})`),t.push(`【中运】${e.zhongyun.text}`),t.push(`【司天在泉】${e.sitian.qi}司天 ${e.zaiquan.qi}在泉`),t.push(`【当前】${e.current.text}`),t.push("【客运五步】");for(const n of e.keYun)t.push(` ${n.no} ${n.name}(${n.taiShao}) ${n.startTime} — ${n.endTime}`);t.push("【客气六步】");for(const n of e.keQi){const l=n.sitian?"(司天)":n.zaiquan?"(在泉)":"";t.push(` ${n.no} ${n.qi}${l} ${n.startTime} — ${n.endTime}`)}const a=[];return e.special.taiYi&&a.push("太乙天符"),e.special.tianFu&&!e.special.taiYi&&a.push("天符"),e.special.suiHui&&!e.special.taiYi&&a.push("岁会"),e.special.tongTianFu&&a.push("同天符"),e.special.tongSuiHui&&a.push("同岁会"),a.length&&t.push(`【特殊】${a.join("、")}`),t.push(`【组合】${e.combo.text}`),t.push(`【边界】${e.scope.note}`),t.join(`
113
113
  `)}function yt(e){return[`【中医体质】${e.primary.name}(主)${e.primary.level==="是"?"":`·${e.primary.level}`} 转化分 ${e.primary.converted}`,e.secondary?`兼夹:${e.secondary.name}(${e.secondary.converted})${e.mingled.length?";同判为「是」:"+e.mingled.join("、"):""}`:"","九种体质转化分(偏颇质 ≥40 判是、30–39 有倾向):",e.scales.map(t=>`· ${t.name}:${t.converted}${t.level==="否"?"":`(${t.level})`}`).join(`
114
114
  `),e.primary.oneLine,e.primary.tendency,"调养方向:",e.care.map(t=>"· "+t).join(`
115
115
  `),e.note].filter(Boolean).join(`
116
116
  `)}function gt(e){return[`【中医体质·问卷】${e.scaleCount} 种体质 × ${e.itemsPerScale} 题,共 ${e.total} 题`,"打分:"+e.scale.map(t=>`${t.v}=${t.label}`).join(" "),e.howto,e.note].join(`
117
117
  `)}function pt(e){const t=e.dims.map(r=>{const p=r.picked===r.left?r.leftSay:r.rightSay,j=Math.round(r.pct*100);return`${r.left}/${r.right} 取 ${r.picked}(${r.strength} ${j}%,净分 ${r.sum}) ${p}`}),a=e.profile,n=Array.isArray(a.stack)&&a.stack.length?a.stack.map((r,p)=>`${p===0?"主导 ":""}${r.code}`).join(" → ")+`
118
118
   ${a.stack.map(r=>`${r.code}:${r.say}`).join(`
119
-  `)}`:"",c=Array.isArray(e.unanswered)&&e.unanswered.length?` 未答维度:${e.unanswered.join("、")}(该维按平手占位)`:"";return[`【十六型人格】${e.type}(${a.title})· ${a.keywords} 已答 ${e.answered}/${e.total} 题${c}`,`一句:${a.oneLine}`,"【四维】",...t,`【优势】${a.strengths.join(";")}`,`【留意】${a.blindspots.join(";")}`,`【课题】${a.growth}`,`【认知功能】${n}`,`【工作】${a.work}`,`【关系】${a.love}`,`【学习】${a.study}`,`注:${e.note}`].join(`
119
+  `)}`:"",l=Array.isArray(e.unanswered)&&e.unanswered.length?` 未答维度:${e.unanswered.join("、")}(该维按平手占位)`:"";return[`【十六型人格】${e.type}(${a.title})· ${a.keywords} 已答 ${e.answered}/${e.total} 题${l}`,`一句:${a.oneLine}`,"【四维】",...t,`【优势】${a.strengths.join(";")}`,`【留意】${a.blindspots.join(";")}`,`【课题】${a.growth}`,`【认知功能】${n}`,`【工作】${a.work}`,`【关系】${a.love}`,`【学习】${a.study}`,`注:${e.note}`].join(`
120
120
  `)}function bt(e){return[`【十六型人格问卷】${e.total} 题,每题按 1(完全不像我)到 5(很像我)打分`,...e.questions.map(t=>`${t.no}. ${t.text}`),`请把 ${e.total} 个分数按顺序交给 answers(如 [4,2,5,3,…]);可以跳过某些题(填 null),至少答 12 题。`,`注:${e.note}`].join(`
121
- `)}function wt(e){const t=e.meta.strength,a=e.meta.dayMaster,n=a&&typeof a=="object"?`${a.stem}(${a.element})`:String(a||"");return[`【人生 K 线】${e.meta.birth} ${e.meta.gender} 日主 ${n} 旺衰 ${t.level}(${t.score})`,e.meta.boundaryNote?`※ ${e.meta.boundaryNote}`:"",`【大运分段】${e.segments.map(c=>`${c.ganZhi} ${c.startAge}-${c.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?`
121
+ `)}function wt(e){const t=e.meta.strength,a=e.meta.dayMaster,n=a&&typeof a=="object"?`${a.stem}(${a.element})`:String(a||"");return[`【人生 K 线】${e.meta.birth} ${e.meta.gender} 日主 ${n} 旺衰 ${t.level}(${t.score})`,e.meta.boundaryNote?`※ ${e.meta.boundaryNote}`:"",`【大运分段】${e.segments.map(l=>`${l.ganZhi} ${l.startAge}-${l.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?`
122
122
  最需留意 ${e.highlights.worst.join(";")}`:""}`]:[],`※ ${e.disclaimer}`].filter(Boolean).join(`
123
- `)}function on(e){if(e.meta.action==="xuankong"){const a=e.meta.period,n=ee=>{const X=e.palaces.find(G=>G.palace===ee);return`${ee}${X.yun}/${X.shan}/${X.xiang}`},c=ee=>ee.map(n).join(" "),r=e.wangShanWangXiang,p=e.meta.jianXiang,j=e.timeFlying,E=j?`【年月日时】${[["year","年"],["month","月"],["day","日"],["hour","时"]].filter(([ee])=>j[ee]).map(([ee,X])=>`${X}${j[ee].centerName}${j[ee].fly?`·${j[ee].fly}`:""}`).join(" ")}${j.meta&&j.meta.note?`(${j.meta.note})`:""}`:"";return[`【玄空】${e.meta.periodLabel}${p&&p.active?"·替卦":"·下卦"} 坐 ${e.meta.sitting} 向 ${e.meta.facing}`,...p&&p.active?[`【替卦】${p.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?",已替":",用替而未替"}`:""})`,`【九宫】${c(["巽","离","坤"])}|${c(["震","中","兑"])}|${c(["艮","坎","乾"])}`,`【当运】山星${a}到${e.dangYun.shan.text};向星${a}到${e.dangYun.xiang.text}`,`【表法】${r.byTable===null?"替卦不套正向表;":""}${r.table.length?r.table.join("、"):"无"};${r.note}`,`【合十】山星合十 ${e.heshi.shan.join("、")||"无"};向星合十 ${e.heshi.xiang.join("、")||"无"}`,...E?[E]:[],...e.meta.note?[`※ ${e.meta.note}`]:[],`※ ${e.disclaimer}`].join(`
123
+ `)}function on(e){if(e.meta.action==="xuankong"){const a=e.meta.period,n=ne=>{const X=e.palaces.find(G=>G.palace===ne);return`${ne}${X.yun}/${X.shan}/${X.xiang}`},l=ne=>ne.map(n).join(" "),r=e.wangShanWangXiang,p=e.meta.jianXiang,j=e.timeFlying,E=j?`【年月日时】${[["year","年"],["month","月"],["day","日"],["hour","时"]].filter(([ne])=>j[ne]).map(([ne,X])=>`${X}${j[ne].centerName}${j[ne].fly?`·${j[ne].fly}`:""}`).join(" ")}${j.meta&&j.meta.note?`(${j.meta.note})`:""}`:"";return[`【玄空】${e.meta.periodLabel}${p&&p.active?"·替卦":"·下卦"} 坐 ${e.meta.sitting} 向 ${e.meta.facing}`,...p&&p.active?[`【替卦】${p.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?",已替":",用替而未替"}`:""})`,`【九宫】${l(["巽","离","坤"])}|${l(["震","中","兑"])}|${l(["艮","坎","乾"])}`,`【当运】山星${a}到${e.dangYun.shan.text};向星${a}到${e.dangYun.xiang.text}`,`【表法】${r.byTable===null?"替卦不套正向表;":""}${r.table.length?r.table.join("、"):"无"};${r.note}`,`【合十】山星合十 ${e.heshi.shan.join("、")||"无"};向星合十 ${e.heshi.xiang.join("、")||"无"}`,...E?[E]:[],...e.meta.note?[`※ ${e.meta.note}`]:[],`※ ${e.disclaimer}`].join(`
124
124
  `)}if(e.meta.action==="advise"){const a=e.mingMatch?[`【命宅配】${e.mingMatch.text}`]:[`※ ${e.meta.birthNote||"未提供生辰,未做命宅配。"}`];return[`【宅卦】坐 ${e.meta.sitting} 向 ${e.meta.facing} ${e.meta.houseGua}宅(${e.meta.houseGroup})`,`【八星】${e.houseStars.map(n=>`${n.star}·${n.direction}${n.palace?`(${n.palace})`:""}`).join(" ")}`,`【门】${e.layout.door}`,`【灶】${e.layout.stove}`,`【床】${e.layout.bed}`,`【厕】${e.layout.toilet}`,...a,`※ ${e.disclaimer}`].join(`
125
125
  `)}const t=e.mingGua;return[`【命卦】${t.num}${t.gua}(${t.group}) 方位 ${t.direction}`,`【四吉】${e.luckyDirections.map(a=>`${a.star}·${a.direction}${a.palace?`(${a.palace})`:""}`).join(" ")}`,`【四凶】${e.unluckyDirections.map(a=>`${a.star}·${a.direction}`).join(" ")}`,...e.yearlyFlying?[`【${e.meta.fortuneYear} 年九宫飞星】中宫 ${e.yearlyFlying.centerName};${e.yearlyFlying.palaces.filter(a=>a.palace!=="中").map(a=>`${a.palace}${a.name}`).join(" ")}`]:[`※ ${e.meta.note||""}`],`※ ${e.disclaimer}`].filter(Boolean).join(`
126
- `)}function jt(e){if(e.action==="generate")return[`【候选名】姓 ${e.surname}(${e.gender},喜用 ${e.bazi.favorable.join("、")})${e.bazi.basis}`,...e.candidates.map(j=>{const E=j.wuge&&j.wuge.available?` 五格 ${j.wuge.summary}`:"",ee=j.phonetics&&j.phonetics.available?` 音韵 ${j.phonetics.level}(${j.phonetics.tonePattern})`:"";return`${j.rank}. ${j.name} ${j.chars.map(X=>`${X.char}(${X.element})${X.meaning}`).join(" ")}${E}${ee}`}),...e.notes.map(j=>`※ ${j}`)].join(`
127
- `);const t=j=>j.source==="lib"?"字库":j.source==="user"?"用户指定":"未收录",a=j=>{const E=j.element==="未收录"?"未收录(不猜五行)":`${j.element}(${t(j)})`,ee=j.favorable===!0?"合喜用":j.favorable===!1?"不合喜用":"不判",X=j.suggest&&j.suggest.length?` 可换:${j.suggest.map(G=>`${G.char}(${G.element})`).join("、")}`:"";return`· ${j.char}:${E}|${ee}|${j.meaning}${X}`},n=e.wuge,c=n&&n.available?`【五格】${n.strokes.map(j=>`${j.char}${j.strokes}画`).join("+")}|${n.summary}|三才 ${n.sancai.text}`:`【五格】${n?n.reason:"未算"}`,r=e.phonetics,p=r&&r.available?`【音韵】${r.chars.map(j=>`${j.char}${j.py}${j.tone}`).join(" ")}|声调 ${r.tonePattern}|${r.level}${(r.alt||[]).length?`|姓又读 ${r.alt.map(j=>`${j.char}${j.py}${j.tone}`).join("、")}`:""}${r.issues.length?`:${r.issues.map(j=>j.text).join(";")}`:""}`:`【音韵】${r?r.reason:"未算"}`;return[`【名字评估】${e.fullName}`,...e.chars.map(a),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}`:"",c,p,`【结论】${e.verdict}`,...e.notes.map(j=>`※ ${j}`)].filter(Boolean).join(`
126
+ `)}function jt(e){if(e.action==="generate")return[`【候选名】姓 ${e.surname}(${e.gender},喜用 ${e.bazi.favorable.join("、")})${e.bazi.basis}`,...e.candidates.map(j=>{const E=j.wuge&&j.wuge.available?` 五格 ${j.wuge.summary}`:"",ne=j.phonetics&&j.phonetics.available?` 音韵 ${j.phonetics.level}(${j.phonetics.tonePattern})`:"";return`${j.rank}. ${j.name} ${j.chars.map(X=>`${X.char}(${X.element})${X.meaning}`).join(" ")}${E}${ne}`}),...e.notes.map(j=>`※ ${j}`)].join(`
127
+ `);const t=j=>j.source==="lib"?"字库":j.source==="user"?"用户指定":"未收录",a=j=>{const E=j.element==="未收录"?"未收录(不猜五行)":`${j.element}(${t(j)})`,ne=j.favorable===!0?"合喜用":j.favorable===!1?"不合喜用":"不判",X=j.suggest&&j.suggest.length?` 可换:${j.suggest.map(G=>`${G.char}(${G.element})`).join("、")}`:"";return`· ${j.char}:${E}|${ne}|${j.meaning}${X}`},n=e.wuge,l=n&&n.available?`【五格】${n.strokes.map(j=>`${j.char}${j.strokes}画`).join("+")}|${n.summary}|三才 ${n.sancai.text}`:`【五格】${n?n.reason:"未算"}`,r=e.phonetics,p=r&&r.available?`【音韵】${r.chars.map(j=>`${j.char}${j.py}${j.tone}`).join(" ")}|声调 ${r.tonePattern}|${r.level}${(r.alt||[]).length?`|姓又读 ${r.alt.map(j=>`${j.char}${j.py}${j.tone}`).join("、")}`:""}${r.issues.length?`:${r.issues.map(j=>j.text).join(";")}`:""}`:`【音韵】${r?r.reason:"未算"}`;return[`【名字评估】${e.fullName}`,...e.chars.map(a),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}`:"",l,p,`【结论】${e.verdict}`,...e.notes.map(j=>`※ ${j}`)].filter(Boolean).join(`
128
128
  `)}function St(e){const t=e.summary??JSON.stringify(e,null,2),a=`
129
- `,c=[(e.brief?["【先说结论】"+e.brief.lead].concat((e.brief.sections||[]).map(r=>[" ",r.h,":",r.t].join(""))).concat((e.brief.advice||[]).length?[" 可以试着做的:"+e.brief.advice.map(r=>String(r).replace(/。$/,"")).join(";")+"。"]:[]).concat(e.brief.caveat?[" ※ "+e.brief.caveat]:[]).join(a)+a:"")+t];if(e.shadow&&e.shadow.id){const r=e.shadow;c.push(`【影子盘】${r.id}(同参数同 ID;版本 ${r.version})
129
+ `,l=[(e.brief?["【先说结论】"+e.brief.lead].concat((e.brief.sections||[]).map(r=>[" ",r.h,":",r.t].join(""))).concat((e.brief.advice||[]).length?[" 可以试着做的:"+e.brief.advice.map(r=>String(r).replace(/。$/,"")).join(";")+"。"]:[]).concat(e.brief.caveat?[" ※ "+e.brief.caveat]:[]).join(a)+a:"")+t];if(e.shadow&&e.shadow.id){const r=e.shadow;l.push(`【影子盘】${r.id}(同参数同 ID;版本 ${r.version})
130
130
   基础指纹 ${r.baseId}(不含版本,跨版本可比对)`+(r.reproducible===!1?`
131
131
   ⚠ 不可复算:${r.reason}`:"")+(r.reproducible===!0&&r.asOfPinned===!1&&(r.system==="bazi"||r.system==="ziwei")?`
132
-  提示:未固定 asOf,流年/流月随「此刻」变化;要比对请传 asOf。`:""))}if(e.revision&&((e.revision.applied||[]).length||(e.revision.ignored||[]).length)){const r=e.revision,p=(r.applied||[]).map(j=>`${j.label}:${j.fromDisplay==null?"(未设)":j.fromDisplay} → ${j.display}`);c.push(`【改参】${r.text}${p.length?`
132
+  提示:未固定 asOf,流年/流月随「此刻」变化;要比对请传 asOf。`:""))}if(e.revision&&((e.revision.applied||[]).length||(e.revision.ignored||[]).length)){const r=e.revision,p=(r.applied||[]).map(j=>`${j.label}:${j.fromDisplay==null?"(未设)":j.fromDisplay} → ${j.display}`);l.push(`【改参】${r.text}${p.length?`
133
133
   ${p.join(";")}`:`
134
134
   没有识别到可改的参数,仍按原参数排盘`}`+((r.ignored||[]).length?`
135
-  未处理:${r.ignored.join(";")}`:""))}if(typeof e.handle=="string"&&e.handle&&c.push(`【排盘句柄】${e.handle}
136
-  追问同一张盘:传 handle + 增量参数(asOf / direction / question,或换 system 看另一套盘),不必重报出生信息。`),Array.isArray(e.trace)&&e.trace.length&&c.push(`【推导链】${On[e.system]||e.system} · ${e.trace.length} 层
135
+  未处理:${r.ignored.join(";")}`:""))}if(typeof e.handle=="string"&&e.handle&&l.push(`【排盘句柄】${e.handle}
136
+  追问同一张盘:传 handle + 增量参数(asOf / direction / question,或换 system 看另一套盘),不必重报出生信息。`),Array.isArray(e.trace)&&e.trace.length&&l.push(`【推导链】${Mn[e.system]||e.system} · ${e.trace.length} 层
137
137
  `+e.trace.map((r,p)=>`${p+1}. ${r.field}|${r.result}
138
138
   规则:${r.rule} 出处:${r.source}`).join(`
139
- `)),e.interpret){const r=xn(e.interpret,e.interpretTier);r&&c.push(r)}if(e.cross&&c.push(`【八字 × 紫微 交叉验证】
140
- ${me(e.cross)}`),e.caliber&&Array.isArray(e.caliber.switches)&&e.caliber.switches.length){const r=e.caliber;c.push(`【口径对照】同一组输入,只换一个口径(不判哪套更准,也不改盘面)
141
- `+r.switches.map(p=>{if(p.error)return`· ${p.title}:未能对照(${p.error})`;if(!p.total)return`· ${p.title}:${p.currentLabel} → ${p.altLabel},本盘无变化`;const j=(Array.isArray(p.views)?p.views:[]).filter(ee=>ee.changed),E=j.length?`
142
-  并排:${j.map(ee=>`${ee.label} ${ee.current} → ${ee.alt}`).join(";")}`:"";return`· ${p.title}:${p.currentLabel} → ${p.altLabel}
139
+ `)),e.interpret){const r=xn(e.interpret,e.interpretTier);r&&l.push(r)}if(e.cross&&l.push(`【八字 × 紫微 交叉验证】
140
+ ${me(e.cross)}`),e.caliber&&Array.isArray(e.caliber.switches)&&e.caliber.switches.length){const r=e.caliber;l.push(`【口径对照】同一组输入,只换一个口径(不判哪套更准,也不改盘面)
141
+ `+r.switches.map(p=>{if(p.error)return`· ${p.title}:未能对照(${p.error})`;if(!p.total)return`· ${p.title}:${p.currentLabel} → ${p.altLabel},本盘无变化`;const j=(Array.isArray(p.views)?p.views:[]).filter(ne=>ne.changed),E=j.length?`
142
+  并排:${j.map(ne=>`${ne.label} ${ne.current} → ${ne.alt}`).join(";")}`:"";return`· ${p.title}:${p.currentLabel} → ${p.altLabel}
143
143
   ${p.summary}${E}`}).join(`
144
- `))}if(e.followup){const r=e.followup;c.push(`【追问】${r.question}
144
+ `))}if(e.followup){const r=e.followup;l.push(`【追问】${r.question}
145
145
  ${r.answer}${r.evidence&&r.evidence.length?`
146
-  依据:${r.evidence.join(";")} 置信度:${r.confidence}`:""}`)}if(e.past&&Array.isArray(e.past.rows)&&e.past.rows.length&&c.push(`【验前事】过去 ${e.past.years} 年的流年信号(只读,不改盘)
146
+  依据:${r.evidence.join(";")} 置信度:${r.confidence}`:""}`)}if(e.past&&Array.isArray(e.past.rows)&&e.past.rows.length&&l.push(`【验前事】过去 ${e.past.years} 年的流年信号(只读,不改盘)
147
147
  `+e.past.rows.map(r=>`· ${r.year} ${r.ganzhi} · ${r.theme}(${r.tier}${r.tenGod?`,${r.tenGod}`:""})`).join(`
148
148
  `)+`
149
- 用法:在面板里勾「准 / 不准 / 不确定」后算贴合度;贴合度低时先核对出生时间、时区与晚子时口径。`),e.rectify&&Array.isArray(e.rectify.candidates)){const r=e.rectify;c.push(`【生时校正】候选时辰 ${r.candidates.length} 个(固定规则打分,只缩小范围)
149
+ 用法:在面板里勾「准 / 不准 / 不确定」后算贴合度;贴合度低时先核对出生时间、时区与晚子时口径。`),e.rectify&&Array.isArray(e.rectify.candidates)){const r=e.rectify;l.push(`【生时校正】候选时辰 ${r.candidates.length} 个(固定规则打分,只缩小范围)
150
150
  `+r.candidates.slice(0,8).map(p=>`· ${p.label} 时柱 ${p.hourGanzhi} / 日柱 ${p.dayGanzhi} · 命中 ${p.hits}/${p.total}`).join(`
151
151
  `)+`
152
- ${r.note}`)}return c.filter(Boolean).join(`
152
+ ${r.note}`)}return l.filter(Boolean).join(`
153
153
 
154
- `)}const{buildEventPrompt:xt,ASK_KINDS:zt}=D["event-prompt"]||{},{plainSummary:kt}=D["plain-summary"]||{};return{interpret:Z,DIRECTIONS:ce,DIRECTION_DEFAULT:ue,BRIGHTNESS:L,flowOf:T,parseDateTime:fe,geocodeAddress:N,resolveAddress:_,buildBazi:R,buildLiuyao:J,tossLines:W,followup:$e,askPrompt:je,pastSignals:ve,verifyFit:Ue,rectifyBirth:Ye,crossCheck:ne,crossText:me,crossSection:Re,buildAlmanac:Ze,buildZeri:_e,buildChenggu:Oe,buildXiaoliuren:Se,buildStar:Ne,buildNumerology:Pe,buildConvert:De,buildTrend:mn,buildFengshui:We,buildName:fn,buildConstitution:ze,buildWuyunliuqi:Me,buildTaiyi:Ie,buildTrace:$n,traceMarkdown:yn,encodeHandle:i,decodeHandle:m,resolveHandle:C,pruneForeignKeys:v,ownedKeys:f,askLink:S,parseAskLink:k,formOf:Y,restNote:U,askPackages:Q,buildEventPrompt:xt,ASK_KINDS:zt,chartFingerprint:jn,shadowSnapshot:Xn,shadowDiff:Vn,compute:tn,interpretText:xn,caliberCompare:nt,normalizeLongitudes:zn,renderText:St}})(),{Engine:D.index}}});
154
+ `)}const{buildEventPrompt:xt,ASK_KINDS:zt}=D["event-prompt"]||{},{plainSummary:kt}=D["plain-summary"]||{};return{interpret:Z,DIRECTIONS:le,DIRECTION_DEFAULT:ue,BRIGHTNESS:L,flowOf:T,parseDateTime:$e,geocodeAddress:N,resolveAddress:_,buildBazi:Y,buildLiuyao:K,tossLines:Q,followup:fe,askPrompt:pe,pastSignals:_e,verifyFit:qe,rectifyBirth:Ze,crossCheck:ee,crossText:me,crossSection:ve,buildAlmanac:De,buildZeri:Le,buildChenggu:Me,buildXiaoliuren:Se,buildStar:Ne,buildNumerology:Ce,buildConvert:Ue,buildTrend:mn,buildFengshui:We,buildName:fn,buildConstitution:ze,buildWuyunliuqi:Oe,buildTaiyi:Pe,buildTrace:$n,traceMarkdown:yn,encodeHandle:i,decodeHandle:m,resolveHandle:C,pruneForeignKeys:v,ownedKeys:f,askLink:S,parseAskLink:k,formOf:R,restNote:H,askPackages:U,buildEventPrompt:xt,ASK_KINDS:zt,chartFingerprint:jn,shadowSnapshot:Xn,shadowDiff:Vn,compute:tn,interpretText:xn,caliberCompare:nt,normalizeLongitudes:zn,renderText:St}})(),{Engine:D.index}}});