@roxyapi/ui 0.19.4 → 0.20.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.
Files changed (118) hide show
  1. package/AGENTS.md +10 -7
  2. package/README.md +9 -6
  3. package/components-catalog.json +166 -114
  4. package/dist/cdn/components/arudha-padas.js +313 -0
  5. package/dist/cdn/components/arudha-padas.js.map +7 -0
  6. package/dist/cdn/components/chara-karakas.js +313 -0
  7. package/dist/cdn/components/chara-karakas.js.map +7 -0
  8. package/dist/cdn/components/dasha-timeline.js +4 -4
  9. package/dist/cdn/components/dasha-timeline.js.map +4 -4
  10. package/dist/cdn/components/endpoint-form.js +1 -1
  11. package/dist/cdn/components/endpoint-form.js.map +1 -1
  12. package/dist/cdn/components/kp-chart.js +4 -4
  13. package/dist/cdn/components/kp-chart.js.map +4 -4
  14. package/dist/cdn/components/kp-ruling-planets.js +3 -3
  15. package/dist/cdn/components/kp-ruling-planets.js.map +4 -4
  16. package/dist/cdn/components/reference-card.js +3 -3
  17. package/dist/cdn/components/reference-card.js.map +2 -2
  18. package/dist/cdn/components/upagraha-table.js +313 -0
  19. package/dist/cdn/components/upagraha-table.js.map +7 -0
  20. package/dist/cdn/components/vedic-planets-table.js +2 -2
  21. package/dist/cdn/components/vedic-planets-table.js.map +2 -2
  22. package/dist/cdn/components/yoga-list.js +4 -4
  23. package/dist/cdn/components/yoga-list.js.map +3 -3
  24. package/dist/cdn/roxy-ui.js +78 -78
  25. package/dist/cdn/roxy-ui.js.map +4 -4
  26. package/dist/cdn/widgets.js +1 -1
  27. package/dist/components/arudha-padas.d.ts +22 -0
  28. package/dist/components/arudha-padas.d.ts.map +1 -0
  29. package/dist/components/arudha-padas.js +2 -0
  30. package/dist/components/arudha-padas.js.map +7 -0
  31. package/dist/components/chara-karakas.d.ts +22 -0
  32. package/dist/components/chara-karakas.d.ts.map +1 -0
  33. package/dist/components/chara-karakas.js +2 -0
  34. package/dist/components/chara-karakas.js.map +7 -0
  35. package/dist/components/dasha-timeline.d.ts +18 -13
  36. package/dist/components/dasha-timeline.d.ts.map +1 -1
  37. package/dist/components/dasha-timeline.js +1 -1
  38. package/dist/components/dasha-timeline.js.map +4 -4
  39. package/dist/components/endpoint-form.js +1 -1
  40. package/dist/components/endpoint-form.js.map +1 -1
  41. package/dist/components/kp-chart.d.ts +7 -0
  42. package/dist/components/kp-chart.d.ts.map +1 -1
  43. package/dist/components/kp-chart.js +1 -1
  44. package/dist/components/kp-chart.js.map +4 -4
  45. package/dist/components/kp-ruling-planets.d.ts +6 -0
  46. package/dist/components/kp-ruling-planets.d.ts.map +1 -1
  47. package/dist/components/kp-ruling-planets.js +1 -1
  48. package/dist/components/kp-ruling-planets.js.map +4 -4
  49. package/dist/components/reference-card.d.ts +2 -2
  50. package/dist/components/reference-card.d.ts.map +1 -1
  51. package/dist/components/reference-card.js +1 -1
  52. package/dist/components/reference-card.js.map +2 -2
  53. package/dist/components/upagraha-table.d.ts +22 -0
  54. package/dist/components/upagraha-table.d.ts.map +1 -0
  55. package/dist/components/upagraha-table.js +2 -0
  56. package/dist/components/upagraha-table.js.map +7 -0
  57. package/dist/components/vedic-planets-table.d.ts +10 -1
  58. package/dist/components/vedic-planets-table.d.ts.map +1 -1
  59. package/dist/components/vedic-planets-table.js +1 -1
  60. package/dist/components/vedic-planets-table.js.map +2 -2
  61. package/dist/components/yoga-list.d.ts +13 -2
  62. package/dist/components/yoga-list.d.ts.map +1 -1
  63. package/dist/components/yoga-list.js +1 -1
  64. package/dist/components/yoga-list.js.map +3 -3
  65. package/dist/generated/endpoint-bindings.d.ts.map +1 -1
  66. package/dist/index.cjs +46 -46
  67. package/dist/index.cjs.map +4 -4
  68. package/dist/index.d.ts +3 -0
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +51 -51
  71. package/dist/index.js.map +4 -4
  72. package/dist/manifest.d.ts.map +1 -1
  73. package/dist/manifest.json +3 -0
  74. package/dist/schemas/get--astrology-horoscope-sign-daily.json +1 -1
  75. package/dist/schemas/get--astrology-horoscope-sign-monthly.json +1 -1
  76. package/dist/schemas/get--astrology-horoscope-sign-weekly.json +1 -1
  77. package/dist/schemas/get--astrology-moon-phase-current.json +1 -1
  78. package/dist/schemas/get--vedic-astrology-avasthas-id.json +1 -0
  79. package/dist/schemas/get--vedic-astrology-avasthas.json +1 -0
  80. package/dist/schemas/get--vedic-astrology-kp-ayanamsa.json +1 -1
  81. package/dist/schemas/get--vedic-astrology-yoga-id.json +1 -1
  82. package/dist/schemas/post--vedic-astrology-arudha.json +1 -0
  83. package/dist/schemas/post--vedic-astrology-birth-chart.json +1 -1
  84. package/dist/schemas/post--vedic-astrology-chara-karakas.json +1 -0
  85. package/dist/schemas/post--vedic-astrology-dasha-current.json +1 -1
  86. package/dist/schemas/post--vedic-astrology-dasha-major.json +1 -1
  87. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha-pratyantardasha-sookshma.json +1 -0
  88. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha-pratyantardasha.json +1 -1
  89. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha.json +1 -1
  90. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha.json +1 -1
  91. package/dist/schemas/post--vedic-astrology-kp-chart.json +1 -1
  92. package/dist/schemas/post--vedic-astrology-kp-cusps.json +1 -1
  93. package/dist/schemas/post--vedic-astrology-kp-ruling-planets-interval.json +1 -1
  94. package/dist/schemas/post--vedic-astrology-kp-ruling-planets.json +1 -1
  95. package/dist/types/index.d.ts +1 -1
  96. package/dist/types/index.d.ts.map +1 -1
  97. package/dist/types/types.gen.d.ts +3228 -934
  98. package/dist/types/types.gen.d.ts.map +1 -1
  99. package/dist/utils/house-themes.d.ts +19 -0
  100. package/dist/utils/house-themes.d.ts.map +1 -0
  101. package/dist/version.d.ts +1 -1
  102. package/package.json +1 -1
  103. package/src/components/arudha-padas.ts +230 -0
  104. package/src/components/chara-karakas.ts +241 -0
  105. package/src/components/dasha-timeline.ts +129 -28
  106. package/src/components/kp-chart.ts +40 -5
  107. package/src/components/kp-ruling-planets.ts +29 -6
  108. package/src/components/reference-card.ts +3 -1
  109. package/src/components/upagraha-table.ts +182 -0
  110. package/src/components/vedic-planets-table.ts +34 -4
  111. package/src/components/yoga-list.ts +144 -20
  112. package/src/generated/endpoint-bindings.ts +13 -0
  113. package/src/index.ts +3 -0
  114. package/src/manifest.ts +48 -7
  115. package/src/types/index.ts +1 -1
  116. package/src/types/types.gen.ts +3133 -809
  117. package/src/utils/house-themes.ts +36 -0
  118. package/src/version.ts +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";if(window.__ROXY_WIDGETS_LOADED__)return;window.__ROXY_WIDGETS_LOADED__=!0;var m="https://cdn.jsdelivr.net/npm/@roxyapi/ui@0/dist/cdn/roxy-ui.js",f="https://roxyapi.com/api/v2",T={"natal-chart":{m:"POST",p:"/astrology/natal-chart",g:1},"synastry-chart":{m:"POST",p:"/astrology/synastry",g:1},"western-planets-table":{m:"POST",p:"/astrology/natal-chart",g:1},"transits-table":{m:"POST",p:"/astrology/transits"},"aspects-table":{m:"POST",p:"/astrology/aspect-patterns",g:1},"moon-phase":{m:"GET",p:"/astrology/moon-phase/calendar/{year}/{month}",s:"mode",v:{current:{p:"/astrology/moon-phase/current"},upcoming:{p:"/astrology/moon-phase/upcoming"}}},"horoscope-card":{m:"GET",p:"/astrology/horoscope/{sign}/daily",s:"period",v:{monthly:{p:"/astrology/horoscope/{sign}/monthly"},weekly:{p:"/astrology/horoscope/{sign}/weekly"}}},"astrocartography-map":{m:"POST",p:"/astrology/astrocartography",g:1},"local-space-compass":{m:"POST",p:"/astrology/local-space",g:1},"relocation-wheel":{m:"POST",p:"/astrology/relocation-chart",g:1},"positions-table":{m:"POST",p:"/astrology/arabic-lots",g:1},"fixed-stars":{m:"POST",p:"/astrology/fixed-stars",g:1},"profection-card":{m:"POST",p:"/astrology/profections",g:1},"compatibility-card":{m:"POST",p:"/astrology/compatibility-score",g:1,s:"mode",v:{biorhythm:{p:"/biorhythm/compatibility",g:1},numerology:{p:"/numerology/compatibility"}}},"vedic-kundli":{m:"POST",p:"/vedic-astrology/birth-chart",g:1},"divisional-chart":{m:"POST",p:"/vedic-astrology/divisional-chart",g:1},"kp-chart":{m:"POST",p:"/vedic-astrology/kp/chart",g:1},"vedic-planets-table":{m:"POST",p:"/vedic-astrology/birth-chart",g:1},"kp-planets-table":{m:"POST",p:"/vedic-astrology/kp/planets",g:1},"kp-ruling-planets":{m:"POST",p:"/vedic-astrology/kp/ruling-planets",g:1},"ashtakavarga-grid":{m:"POST",p:"/vedic-astrology/ashtakavarga",g:1},"shadbala-table":{m:"POST",p:"/vedic-astrology/shadbala",g:1},"dasha-timeline":{m:"POST",p:"/vedic-astrology/dasha/current",g:1,s:"period",v:{major:{p:"/vedic-astrology/dasha/major",g:1},sub:{p:"/vedic-astrology/dasha/sub/{mahadasha}",g:1},antara:{p:"/vedic-astrology/dasha/sub/{mahadasha}/{antardasha}",g:1},sookshma:{p:"/vedic-astrology/dasha/sub/{mahadasha}/{antardasha}/{pratyantardasha}",g:1}}},"guna-milan":{m:"POST",p:"/vedic-astrology/compatibility",g:1},"panchang-table":{m:"POST",p:"/vedic-astrology/panchang/basic",g:1,s:"detail",v:{detailed:{p:"/vedic-astrology/panchang/detailed",g:1}}},"vedic-aspects":{m:"POST",p:"/vedic-astrology/aspects",g:1},"hora-table":{m:"POST",p:"/vedic-astrology/panchang/hora",g:1},"choghadiya-grid":{m:"POST",p:"/vedic-astrology/panchang/choghadiya",g:1},"yoga-list":{m:"GET",p:"/vedic-astrology/yoga"},"nakshatra-card":{m:"GET",p:"/vedic-astrology/nakshatras/{id}"},"dosha-card":{m:"POST",p:"/vedic-astrology/dosha/kalsarpa",g:1,s:"type",v:{manglik:{p:"/vedic-astrology/dosha/manglik",g:1},sadhesati:{p:"/vedic-astrology/dosha/sadhesati",g:1}}},"numerology-card":{m:"POST",p:"/numerology/birth-day",g:1,s:"type",v:{chart:{p:"/numerology/chart",g:1},daily:{p:"/numerology/daily"},expression:{p:"/numerology/expression",g:1},"life-path":{p:"/numerology/life-path",g:1},maturity:{p:"/numerology/maturity"},"personal-day":{p:"/numerology/personal-day",g:1},"personal-month":{p:"/numerology/personal-month",g:1},"personal-year":{p:"/numerology/personal-year",g:1},personality:{p:"/numerology/personality",g:1},"soul-urge":{p:"/numerology/soul-urge",g:1}}},"tarot-card":{m:"POST",p:"/tarot/daily"},"tarot-catalog":{m:"GET",p:"/tarot/cards"},"tarot-spread":{m:"POST",p:"/tarot/draw",g:1,s:"spread",v:{career:{p:"/tarot/spreads/career"},"celtic-cross":{p:"/tarot/spreads/celtic-cross"},custom:{p:"/tarot/spreads/custom",g:1},love:{p:"/tarot/spreads/love"},"three-card":{p:"/tarot/spreads/three-card"},"yes-no":{p:"/tarot/yes-no"}}},bodygraph:{m:"POST",p:"/human-design/bodygraph",g:1},"hd-type-card":{m:"POST",p:"/human-design/profile",g:1},"hd-connection":{m:"POST",p:"/human-design/connection",g:1},"hd-penta":{m:"POST",p:"/human-design/penta",g:1},"hd-variables":{m:"POST",p:"/human-design/variables",g:1},"forecast-timeline":{m:"POST",p:"/forecast/significant-dates",g:1},"forecast-digest":{m:"POST",p:"/forecast/digest",g:1},"biorhythm-chart":{m:"POST",p:"/biorhythm/critical-days",g:1,s:"mode",v:{daily:{p:"/biorhythm/daily"},forecast:{p:"/biorhythm/forecast",g:1}}},hexagram:{m:"GET",p:"/iching/hexagrams/random"},"crystal-card":{m:"GET",p:"/crystals/{id}"},"crystal-grid":{m:"GET",p:"/crystals/chakra/{chakra}"},"dream-card":{m:"GET",p:"/dreams/symbols/{id}"},"dream-search":{m:"GET",p:"/dreams/symbols"},"angel-number-card":{m:"GET",p:"/angel-numbers/numbers/{number}"},"angel-number-lookup":{m:"GET",p:"/angel-numbers/lookup",g:1},"reference-card":{m:"GET",p:"/astrology/planet-meanings/{id}"}};function O(){var a=document.currentScript&&document.currentScript.src;if(!a){for(var e=document.querySelectorAll("script[src]"),t=e.length-1;t>=0;t--)if(/widgets\.js(\?|$)/.test(e[t].src)){a=e[t].src;break}}if(!a)return m;try{return new URL("roxy-ui.js",a).href}catch(s){return m}}function S(){return document.getElementById("roxy-ui-loader")||window.customElements&&window.customElements.get("roxy-data")?Promise.resolve():new Promise(function(a,e){var t=document.createElement("script");t.id="roxy-ui-loader",t.src=O(),t.async=!0,t.crossOrigin="anonymous",t.onload=function(){a()},t.onerror=function(){e(new Error("roxy-ui load failed"))},document.head.appendChild(t)})}function P(a){for(var e={"data-roxy-widget":1,"data-roxy-mounted":1,"data-publishable-key":1,"data-attribution":1,"data-submit-label":1},t={},s=0;s<a.attributes.length;s++){var o=a.attributes[s];o.name.indexOf("data-")===0&&!e[o.name]&&(t[o.name.slice(5).replace(/-([a-z])/g,function(l,c){return c.toUpperCase()})]=o.value)}return t}function E(a){return(a.match(/\{([^}]+)\}/g)||[]).map(function(e){return e.slice(1,-1)})}function x(a,e){return a.replace(/\{([^}]+)\}/g,function(t,s){return encodeURIComponent(e[s]||"")})}function k(a,e){if(a.s&&a.v){var t=a.v[e[a.s]];if(t)return t}return a}function A(a){var e=a.getAttribute("data-roxy-widget"),t=T[e];if(t){var s=a.getAttribute("data-publishable-key"),o=P(a),l=k(t,o),c=l.m||t.m,d=E(l.p),w=!!s&&!l.g&&d.every(function(n){return o[n]!=null&&o[n]!==""});S().then(function(){var n=document.createElement("roxy-"+e);t.s&&o[t.s]!=null&&n.setAttribute(t.s,o[t.s]),d.forEach(function(r){o[r]!=null&&n.setAttribute(r,o[r])}),o.lang!=null&&n.setAttribute("lang",o.lang);var y=a.getAttribute("data-submit-label");if(y!=null&&n.setAttribute("submit-label",y),a.getAttribute("data-attribution")!=="off"&&n.setAttribute("attribution",""),!w){n.setAttribute("data-endpoint",l.p.replace(/^\//,"")),n.setAttribute("method",c),s&&n.setAttribute("publishable-key",s),a.innerHTML="",a.appendChild(n);return}a.innerHTML="",a.appendChild(n);var i={};Object.keys(o).forEach(function(r){r===t.s||d.indexOf(r)>=0||(i[r]=o[r])});var p={};i.lang!=null&&(p.lang=i.lang,delete i.lang);var h={Accept:"application/json","X-API-Key":s},v={method:c,headers:h};c==="POST"?(h["Content-Type"]="application/json",v.body=JSON.stringify(i)):Object.keys(i).forEach(function(r){p[r]=i[r]});var g=f+x(l.p,o),b=Object.keys(p).map(function(r){return encodeURIComponent(r)+"="+encodeURIComponent(p[r])}).join("&");b&&(g+=(g.indexOf("?")>=0?"&":"?")+b),fetch(g,v).then(function(r){return r.json()}).then(function(r){n.data=r}).catch(function(r){n.setAttribute("aria-invalid","true"),console.error("roxy-widget",e,r)})})}}function u(){for(var a=document.querySelectorAll("[data-roxy-widget]:not([data-roxy-mounted])"),e=0;e<a.length;e++)a[e].setAttribute("data-roxy-mounted","true"),A(a[e])}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u()})();
1
+ (function(){"use strict";if(window.__ROXY_WIDGETS_LOADED__)return;window.__ROXY_WIDGETS_LOADED__=!0;var m="https://cdn.jsdelivr.net/npm/@roxyapi/ui@0/dist/cdn/roxy-ui.js",f="https://roxyapi.com/api/v2",T={"natal-chart":{m:"POST",p:"/astrology/natal-chart",g:1},"synastry-chart":{m:"POST",p:"/astrology/synastry",g:1},"western-planets-table":{m:"POST",p:"/astrology/natal-chart",g:1},"transits-table":{m:"POST",p:"/astrology/transits"},"aspects-table":{m:"POST",p:"/astrology/aspect-patterns",g:1},"moon-phase":{m:"GET",p:"/astrology/moon-phase/calendar/{year}/{month}",s:"mode",v:{current:{p:"/astrology/moon-phase/current"},upcoming:{p:"/astrology/moon-phase/upcoming"}}},"horoscope-card":{m:"GET",p:"/astrology/horoscope/{sign}/daily",s:"period",v:{monthly:{p:"/astrology/horoscope/{sign}/monthly"},weekly:{p:"/astrology/horoscope/{sign}/weekly"}}},"astrocartography-map":{m:"POST",p:"/astrology/astrocartography",g:1},"local-space-compass":{m:"POST",p:"/astrology/local-space",g:1},"relocation-wheel":{m:"POST",p:"/astrology/relocation-chart",g:1},"positions-table":{m:"POST",p:"/astrology/arabic-lots",g:1},"fixed-stars":{m:"POST",p:"/astrology/fixed-stars",g:1},"profection-card":{m:"POST",p:"/astrology/profections",g:1},"compatibility-card":{m:"POST",p:"/astrology/compatibility-score",g:1,s:"mode",v:{biorhythm:{p:"/biorhythm/compatibility",g:1},numerology:{p:"/numerology/compatibility"}}},"vedic-kundli":{m:"POST",p:"/vedic-astrology/birth-chart",g:1},"divisional-chart":{m:"POST",p:"/vedic-astrology/divisional-chart",g:1},"kp-chart":{m:"POST",p:"/vedic-astrology/kp/chart",g:1},"vedic-planets-table":{m:"POST",p:"/vedic-astrology/birth-chart",g:1},"kp-planets-table":{m:"POST",p:"/vedic-astrology/kp/planets",g:1},"kp-ruling-planets":{m:"POST",p:"/vedic-astrology/kp/ruling-planets",g:1},"ashtakavarga-grid":{m:"POST",p:"/vedic-astrology/ashtakavarga",g:1},"shadbala-table":{m:"POST",p:"/vedic-astrology/shadbala",g:1},"dasha-timeline":{m:"POST",p:"/vedic-astrology/dasha/current",g:1,s:"period",v:{major:{p:"/vedic-astrology/dasha/major",g:1},sub:{p:"/vedic-astrology/dasha/sub/{mahadasha}",g:1},antara:{p:"/vedic-astrology/dasha/sub/{mahadasha}/{antardasha}",g:1},sookshma:{p:"/vedic-astrology/dasha/sub/{mahadasha}/{antardasha}/{pratyantardasha}",g:1},prana:{p:"/vedic-astrology/dasha/sub/{mahadasha}/{antardasha}/{pratyantardasha}/{sookshma}",g:1}}},"guna-milan":{m:"POST",p:"/vedic-astrology/compatibility",g:1},"panchang-table":{m:"POST",p:"/vedic-astrology/panchang/basic",g:1,s:"detail",v:{detailed:{p:"/vedic-astrology/panchang/detailed",g:1}}},"vedic-aspects":{m:"POST",p:"/vedic-astrology/aspects",g:1},"hora-table":{m:"POST",p:"/vedic-astrology/panchang/hora",g:1},"choghadiya-grid":{m:"POST",p:"/vedic-astrology/panchang/choghadiya",g:1},"yoga-list":{m:"GET",p:"/vedic-astrology/yoga"},"nakshatra-card":{m:"GET",p:"/vedic-astrology/nakshatras/{id}"},"dosha-card":{m:"POST",p:"/vedic-astrology/dosha/kalsarpa",g:1,s:"type",v:{manglik:{p:"/vedic-astrology/dosha/manglik",g:1},sadhesati:{p:"/vedic-astrology/dosha/sadhesati",g:1}}},"numerology-card":{m:"POST",p:"/numerology/birth-day",g:1,s:"type",v:{chart:{p:"/numerology/chart",g:1},daily:{p:"/numerology/daily"},expression:{p:"/numerology/expression",g:1},"life-path":{p:"/numerology/life-path",g:1},maturity:{p:"/numerology/maturity"},"personal-day":{p:"/numerology/personal-day",g:1},"personal-month":{p:"/numerology/personal-month",g:1},"personal-year":{p:"/numerology/personal-year",g:1},personality:{p:"/numerology/personality",g:1},"soul-urge":{p:"/numerology/soul-urge",g:1}}},"tarot-card":{m:"POST",p:"/tarot/daily"},"tarot-catalog":{m:"GET",p:"/tarot/cards"},"tarot-spread":{m:"POST",p:"/tarot/draw",g:1,s:"spread",v:{career:{p:"/tarot/spreads/career"},"celtic-cross":{p:"/tarot/spreads/celtic-cross"},custom:{p:"/tarot/spreads/custom",g:1},love:{p:"/tarot/spreads/love"},"three-card":{p:"/tarot/spreads/three-card"},"yes-no":{p:"/tarot/yes-no"}}},bodygraph:{m:"POST",p:"/human-design/bodygraph",g:1},"hd-type-card":{m:"POST",p:"/human-design/profile",g:1},"hd-connection":{m:"POST",p:"/human-design/connection",g:1},"hd-penta":{m:"POST",p:"/human-design/penta",g:1},"hd-variables":{m:"POST",p:"/human-design/variables",g:1},"forecast-timeline":{m:"POST",p:"/forecast/significant-dates",g:1},"forecast-digest":{m:"POST",p:"/forecast/digest",g:1},"biorhythm-chart":{m:"POST",p:"/biorhythm/critical-days",g:1,s:"mode",v:{daily:{p:"/biorhythm/daily"},forecast:{p:"/biorhythm/forecast",g:1}}},hexagram:{m:"GET",p:"/iching/hexagrams/random"},"crystal-card":{m:"GET",p:"/crystals/{id}"},"crystal-grid":{m:"GET",p:"/crystals/chakra/{chakra}"},"dream-card":{m:"GET",p:"/dreams/symbols/{id}"},"dream-search":{m:"GET",p:"/dreams/symbols"},"angel-number-card":{m:"GET",p:"/angel-numbers/numbers/{number}"},"angel-number-lookup":{m:"GET",p:"/angel-numbers/lookup",g:1},"reference-card":{m:"GET",p:"/astrology/planet-meanings/{id}"}};function O(){var a=document.currentScript&&document.currentScript.src;if(!a){for(var r=document.querySelectorAll("script[src]"),t=r.length-1;t>=0;t--)if(/widgets\.js(\?|$)/.test(r[t].src)){a=r[t].src;break}}if(!a)return m;try{return new URL("roxy-ui.js",a).href}catch(s){return m}}function S(){return document.getElementById("roxy-ui-loader")||window.customElements&&window.customElements.get("roxy-data")?Promise.resolve():new Promise(function(a,r){var t=document.createElement("script");t.id="roxy-ui-loader",t.src=O(),t.async=!0,t.crossOrigin="anonymous",t.onload=function(){a()},t.onerror=function(){r(new Error("roxy-ui load failed"))},document.head.appendChild(t)})}function P(a){for(var r={"data-roxy-widget":1,"data-roxy-mounted":1,"data-publishable-key":1,"data-attribution":1,"data-submit-label":1},t={},s=0;s<a.attributes.length;s++){var o=a.attributes[s];o.name.indexOf("data-")===0&&!r[o.name]&&(t[o.name.slice(5).replace(/-([a-z])/g,function(l,c){return c.toUpperCase()})]=o.value)}return t}function E(a){return(a.match(/\{([^}]+)\}/g)||[]).map(function(r){return r.slice(1,-1)})}function x(a,r){return a.replace(/\{([^}]+)\}/g,function(t,s){return encodeURIComponent(r[s]||"")})}function k(a,r){if(a.s&&a.v){var t=a.v[r[a.s]];if(t)return t}return a}function A(a){var r=a.getAttribute("data-roxy-widget"),t=T[r];if(t){var s=a.getAttribute("data-publishable-key"),o=P(a),l=k(t,o),c=l.m||t.m,d=E(l.p),w=!!s&&!l.g&&d.every(function(n){return o[n]!=null&&o[n]!==""});S().then(function(){var n=document.createElement("roxy-"+r);t.s&&o[t.s]!=null&&n.setAttribute(t.s,o[t.s]),d.forEach(function(e){o[e]!=null&&n.setAttribute(e,o[e])}),o.lang!=null&&n.setAttribute("lang",o.lang);var y=a.getAttribute("data-submit-label");if(y!=null&&n.setAttribute("submit-label",y),a.getAttribute("data-attribution")!=="off"&&n.setAttribute("attribution",""),!w){n.setAttribute("data-endpoint",l.p.replace(/^\//,"")),n.setAttribute("method",c),s&&n.setAttribute("publishable-key",s),a.innerHTML="",a.appendChild(n);return}a.innerHTML="",a.appendChild(n);var i={};Object.keys(o).forEach(function(e){e===t.s||d.indexOf(e)>=0||(i[e]=o[e])});var p={};i.lang!=null&&(p.lang=i.lang,delete i.lang);var h={Accept:"application/json","X-API-Key":s},v={method:c,headers:h};c==="POST"?(h["Content-Type"]="application/json",v.body=JSON.stringify(i)):Object.keys(i).forEach(function(e){p[e]=i[e]});var g=f+x(l.p,o),b=Object.keys(p).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(p[e])}).join("&");b&&(g+=(g.indexOf("?")>=0?"&":"?")+b),fetch(g,v).then(function(e){return e.json()}).then(function(e){n.data=e}).catch(function(e){n.setAttribute("aria-invalid","true"),console.error("roxy-widget",r,e)})})}}function u(){for(var a=document.querySelectorAll("[data-roxy-widget]:not([data-roxy-mounted])"),r=0;r<a.length;r++)a[r].setAttribute("data-roxy-mounted","true"),A(a[r])}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u()})();
@@ -0,0 +1,22 @@
1
+ import type { ArudhaResponse } from '../types/index.js';
2
+ import { RoxyDataElement } from '../utils/base-element.js';
3
+ /**
4
+ * Arudha padas. Renders /vedic-astrology/arudha: the twelve Jaimini padas, each with the bhava it belongs to, the lord and the count that produced it, the sign it lands in, and what it is read for.
5
+ *
6
+ * @remarks
7
+ * All twelve render, and two are marked. The Arudha Lagna (AL, the pada of the first house) is the one most readings start from, and the Upapada (UL, the pada of the twelfth) is the one a marriage reading turns on, so a table that shows only the AL is missing the second question it will be asked.
8
+ *
9
+ * The derivation is shown, not just the answer. Each row carries the bhava sign, its lord and the lord's sign, which is the count a reader checks by hand, plus a mark where the classical exception fired: a pada that fell in its own bhava or the seventh from it is moved to the tenth from there, and that step is the one implementations most often skip.
10
+ */
11
+ export declare class RoxyArudhaPadas extends RoxyDataElement<ArudhaResponse> {
12
+ static styles: import("lit").CSSResult[];
13
+ protected renderEmpty(): import("lit").TemplateResult<1>;
14
+ protected renderData(d: ArudhaResponse): import("lit").TemplateResult<1>;
15
+ private renderRow;
16
+ }
17
+ declare global {
18
+ interface HTMLElementTagNameMap {
19
+ 'roxy-arudha-padas': RoxyArudhaPadas;
20
+ }
21
+ }
22
+ //# sourceMappingURL=arudha-padas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arudha-padas.d.ts","sourceRoot":"","sources":["../../src/components/arudha-padas.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAS3D;;;;;;;GAOG;AACH,qBACa,eAAgB,SAAQ,eAAe,CAAC,cAAc,CAAC;IACnE,MAAM,CAAC,MAAM,4BAoHX;IAEF,SAAS,CAAC,WAAW;IAIrB,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,cAAc;IAqDtC,OAAO,CAAC,SAAS;CAyBjB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,eAAe,CAAC;KACrC;CACD"}
@@ -0,0 +1,2 @@
1
+ var E=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var i=(a,r,e,t)=>{for(var o=t>1?void 0:t?U(r,e):r,s=a.length-1,c;s>=0;s--)(c=a[s])&&(o=(t?c(r,e,o):c(o))||o);return t&&o&&E(r,e,o),o};import{css as z,html as u,nothing as m}from"lit";import{customElement as F}from"lit/decorators.js";var R={Aries:"\u2648",Taurus:"\u2649",Gemini:"\u264A",Cancer:"\u264B",Leo:"\u264C",Virgo:"\u264D",Libra:"\u264E",Scorpio:"\u264F",Sagittarius:"\u2650",Capricorn:"\u2651",Aquarius:"\u2652",Pisces:"\u2653"};import{html as d,LitElement as M}from"lit";import{property as l,state as h}from"lit/decorators.js";import{ifDefined as w}from"lit/directives/if-defined.js";import{css as P}from"lit";var y=P`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var f="Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.";function A(a){return!!a&&!a.startsWith("pk_")}function $(a,r={}){r.warn&&console.warn(f),a.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:"possible-secret-key",message:f},bubbles:!0,composed:!0}))}var _="https://roxyapi.com/api/v2",x=class{constructor(r){this.baseUrl=_;this.host=r,r.addController(this)}hostDisconnected(){this.abort?.abort(),this.abort=void 0}async run(r){if(!this.submitUrl&&this.secretKeyRefused())return;this.abort?.abort();let e=new AbortController;this.abort=e,this.host.loading=!0,this.host.error=null;try{let t=this.submitUrl?await fetch(this.submitUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(r),signal:e.signal}):await this.callApi(r,e.signal);if(!t.ok)throw new Error(await this.readError(t));let o=await t.json();if(e.signal.aborted)return;this.host.data=o}catch(t){if(t?.name==="AbortError")return;this.host.error=t instanceof Error?t.message:String(t)}finally{this.abort===e&&(this.abort=void 0),e.signal.aborted||(this.host.loading=!1)}}callApi(r,e){let t=new URL(`${this.baseUrl}${r.path}`);for(let[s,c]of Object.entries(r.query??{}))c!=null&&t.searchParams.set(s,String(c));let o={Accept:"application/json"};return this.publishableKey&&(o["X-API-Key"]=this.publishableKey),r.body!=null&&(o["Content-Type"]="application/json"),fetch(t,{method:r.method??"GET",headers:o,body:r.body!=null?JSON.stringify(r.body):void 0,signal:e})}secretKeyRefused(){return A(this.publishableKey)?(this.host.error=f,$(this.host),!0):!1}async readError(r){try{let e=await r.json();if(e?.error)return e.error}catch{}return`Request failed (${r.status})`}};function T(a,r,e,t=[]){let o={...e},s=`/${a.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(g,p)=>{let C=o[p];return delete o[p],encodeURIComponent(String(C??""))}),c=new Set(t),S={},k={};for(let[g,p]of Object.entries(o))p===void 0||p===""||(r==="GET"||c.has(g)?S[g]=p:k[g]=p);return{path:s,method:r,query:S,body:r==="POST"?k:void 0}}var N="roxy-data";function K(a){return a.nodeName==="SCRIPT"&&a.getAttribute("type")==="application/json"}var v=class{constructor(r){this.host=r,r.addController(this)}hostConnected(){if(this.host.data!=null)return;let r=this.read();r!==void 0&&(this.host.data=r,this.host.requestUpdate())}read(){let r=this.findInlineScript();return r?this.parse(r.textContent):void 0}findInlineScript(){for(let r of Array.from(this.host.children))if(K(r)&&r.classList.contains(N))return r;return null}parse(r){if(r?.trim())try{return JSON.parse(r)}catch{return}}};var n=class extends M{constructor(){super();this.data=null;this.endpoint="";this.method="POST";this.remember=!1;this.loading=!1;this.error=null;this.selfFetched=!1;this.editing=!1;this.sticky=!1;this.onEdit=()=>{this.editing=!0};this.onFormSubmit=e=>{let t=e.detail;this.lastValues=t.values,this.sticky=!!t.sticky,this.selfFetched=!0,this.editing=!1,this.remember&&this.writeRemembered(t.values),this.fetcher.run(T(this.endpoint,this.method,t.values,t.queryKeys??[]))};new v(this),this.fetcher=new x(this)}static{this.styles=[y]}willUpdate(e){e.has("publishableKey")&&(this.fetcher.publishableKey=this.publishableKey),e.has("baseUrl")&&this.baseUrl&&(this.fetcher.baseUrl=this.baseUrl),e.has("submitUrl")&&(this.fetcher.submitUrl=this.submitUrl)}render(){return this.loading?this.renderLoading():this.error!=null?this.renderError(this.error):this.data!=null?this.selfFetched?this.editing?this.renderForm():this.renderResult(this.data):this.showAttribution()?d`${this.renderData(this.data)}${this.renderAttribution()}`:this.renderData(this.data):this.renderNoData()}renderResult(e){let t=this.sticky?d`${this.renderForm()}${this.renderData(e)}`:d`<div class="roxy-edit-bar"><button type="button" class="roxy-edit" @click="${this.onEdit}">Edit query</button></div>${this.renderData(e)}`;return this.showAttribution()?d`${t}${this.renderAttribution()}`:t}showAttribution(){return this.attribution!=null&&this.attribution!=="off"&&this.attribution!=="false"}renderAttribution(){return d`<div class="roxy-attribution"><a href="https://roxyapi.com/?utm_source=widget&utm_medium=embed" target="_blank" rel="noopener">Spiritual data by RoxyAPI</a></div>`}renderNoData(){return this.endpoint?this.renderForm():this.renderEmpty()}renderForm(){return d`<roxy-endpoint-form data-endpoint="${this.endpoint}" method="${this.method}" spec-url="${w(this.specUrl)}" publishable-key="${w(this.publishableKey)}" submit-label="${w(this.submitLabel)}" lang="${w(this.effectiveLang())}" .initialValues="${this.formInitialValues()}" @roxy-submit="${this.onFormSubmit}"></roxy-endpoint-form>`}formInitialValues(){return this.lastValues??(this.remember?this.readRemembered():void 0)}effectiveLang(){return this.lang||void 0}rememberKey(){return`roxy-ui:form:${this.endpoint}`}readRemembered(){try{let e=sessionStorage.getItem(this.rememberKey());return e?JSON.parse(e):void 0}catch{return}}writeRemembered(e){try{sessionStorage.setItem(this.rememberKey(),JSON.stringify(e))}catch{}}renderEmpty(){return d`<div class="roxy-empty" role="status">No data</div>`}renderLoading(){return d`<div class="roxy-skeleton" style="height:8rem" role="status" aria-label="Loading"></div>`}renderError(e){let t=d`<div class="roxy-error" role="alert">${e}</div>`;return this.endpoint?d`${t}${this.renderForm()}`:t}};i([l({attribute:!1})],n.prototype,"data",2),i([l({type:String,attribute:"data-endpoint"})],n.prototype,"endpoint",2),i([l({type:String})],n.prototype,"method",2),i([l({type:String,attribute:"publishable-key"})],n.prototype,"publishableKey",2),i([l({type:String,attribute:"base-url"})],n.prototype,"baseUrl",2),i([l({type:String,attribute:"spec-url"})],n.prototype,"specUrl",2),i([l({type:String,attribute:"submit-url"})],n.prototype,"submitUrl",2),i([l({type:Boolean})],n.prototype,"remember",2),i([l({type:String,attribute:"submit-label"})],n.prototype,"submitLabel",2),i([l({type:String})],n.prototype,"attribution",2),i([h()],n.prototype,"loading",2),i([h()],n.prototype,"error",2),i([h()],n.prototype,"selfFetched",2),i([h()],n.prototype,"editing",2),i([h()],n.prototype,"sticky",2);function L(a){return a?a.charAt(0).toUpperCase()+a.slice(1).toLowerCase():""}var G=new Set(["a1","a12"]),b=class extends n{renderEmpty(){return u`<div class="roxy-empty" role="status">No arudha pada data</div>`}renderData(r){let e=r.padas??[];if(!e.length)return this.renderEmpty();let t=e.filter(o=>o.exceptionApplied).length;return u`<div class="wrap" aria-label="Arudha padas"><header class="head"><h2 class="title">Arudha padas</h2></header><div class="leads"><div class="lead"><span>Lagna</span><strong>${r.lagnaRashi??""}</strong></div><div class="lead"><span>Arudha Lagna</span><strong>${r.arudhaLagna??""}</strong></div><div class="lead"><span>Upapada</span><strong>${r.upapada??""}</strong></div></div><div class="scroll" tabindex="0"><table role="table"><caption class="roxy-sr-only">The twelve Arudha padas: each pada with its bhava, the bhava sign and its lord, the sign the lord occupies, the sign the pada falls in, which house from the Lagna that is, whether the classical exception was applied, and what the pada is read for.</caption><thead><tr><th scope="col">Pada</th><th scope="col">Bhava</th><th scope="col">Bhava rashi</th><th scope="col">Lord</th><th scope="col">Lord rashi</th><th scope="col">Pada rashi</th><th scope="col">From Lagna</th><th scope="col">Read for</th></tr></thead><tbody>${e.map(o=>this.renderRow(o))}</tbody></table></div>${t>0?u`<p class="note"><span class="exception">Moved</span> marks a pada that fell in its own bhava or the seventh from it and was moved to the tenth from there, as the classical rule requires. ${t} of ${e.length} padas here.</p>`:m}</div>`}renderRow(r){let e=o=>R[L(o??"")]??"",t=o=>{let s=e(o);return u`${s?u`<span class="glyph">${s}</span>`:m}${o??""}`};return u`<tr class="${G.has(r.id)?"lead-row":""}"><td class="pada">${r.name??""}${r.abbreviation?u`<span class="abbr">${r.abbreviation}</span>`:m}</td><td class="num">${r.house??""}</td><td>${t(r.bhavaRashi)}</td><td>${r.lord??""}</td><td>${t(r.lordRashi)}</td><td>${t(r.rashi)} ${r.exceptionApplied?u`<span class="exception">Moved</span>`:m}</td><td class="num">${r.houseFromLagna??""}</td><td class="meaning"><strong>${r.meaning??""}</strong> ${r.significations?u`<p>${r.significations}</p>`:m}</td></tr>`}};b.styles=[y,z`.wrap{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);background:var(--roxy-surface,#fff);box-shadow:var(--roxy-shadow-sm);overflow:hidden}.head{padding:var(--roxy-space-md,1rem);border-bottom:1px solid var(--roxy-border,#e4e4e7)}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.leads{gap:var(--roxy-space-md,1rem);padding:var(--roxy-space-md,1rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);grid-template-columns:repeat(auto-fit,minmax(9rem,1fr));display:grid}.lead span{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;display:block}.lead strong{font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a)}.scroll{min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem);min-width:700px}thead{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 20%, transparent)}th,td{padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);text-align:left;white-space:nowrap}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.04em}tbody tr{border-top:1px solid var(--roxy-border,#e4e4e7)}tbody tr.lead-row{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 10%, transparent)}td.pada{font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a)}.abbr{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-normal,400);margin-left:.4em}tbody tr.lead-row .abbr,tbody tr.lead-row .glyph{color:var(--roxy-accent-ink,#b45309)}.glyph{color:var(--roxy-muted,#71717a);margin-right:.4em}.num{font-variant-numeric:tabular-nums}.exception{font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-warning-fg,#b45309)}.meaning{white-space:normal;min-width:12rem}.meaning strong{font-weight:var(--roxy-weight-bold,600);display:block}.meaning p{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);line-height:var(--roxy-leading-normal,1.5);margin:0}.note{padding:0 var(--roxy-space-md,1rem) var(--roxy-space-md,1rem);color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);line-height:var(--roxy-leading-normal,1.5);margin:0}`],b=i([F("roxy-arudha-padas")],b);export{b as RoxyArudhaPadas};
2
+ //# sourceMappingURL=arudha-padas.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/arudha-padas.ts", "../../src/tokens/index.ts", "../../src/utils/base-element.ts", "../../src/utils/base-styles.ts", "../../src/utils/key-guard.ts", "../../src/utils/fetch-controller.ts", "../../src/utils/markup-data.ts", "../../src/utils/string.ts"],
4
+ "sourcesContent": ["import { css, html, nothing } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { SIGN_GLYPH } from '../tokens/index.js';\nimport type { ArudhaResponse } from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { capitalize } from '../utils/string.js';\n\ntype Pada = ArudhaResponse['padas'][number];\n\n/** The two padas lifted to the top of the response, and what each is read for. Both are marked in the table too, so the summary and the rows agree. */\nconst LEAD_IDS = new Set(['a1', 'a12']);\n\n/**\n * Arudha padas. Renders /vedic-astrology/arudha: the twelve Jaimini padas, each with the bhava it belongs to, the lord and the count that produced it, the sign it lands in, and what it is read for.\n *\n * @remarks\n * All twelve render, and two are marked. The Arudha Lagna (AL, the pada of the first house) is the one most readings start from, and the Upapada (UL, the pada of the twelfth) is the one a marriage reading turns on, so a table that shows only the AL is missing the second question it will be asked.\n *\n * The derivation is shown, not just the answer. Each row carries the bhava sign, its lord and the lord's sign, which is the count a reader checks by hand, plus a mark where the classical exception fired: a pada that fell in its own bhava or the seventh from it is moved to the tenth from there, and that step is the one implementations most often skip.\n */\n@customElement('roxy-arudha-padas')\nexport class RoxyArudhaPadas extends RoxyDataElement<ArudhaResponse> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);background:var(--roxy-surface,#fff);box-shadow:var(--roxy-shadow-sm);overflow:hidden}.head{padding:var(--roxy-space-md,1rem);border-bottom:1px solid var(--roxy-border,#e4e4e7)}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.leads{gap:var(--roxy-space-md,1rem);padding:var(--roxy-space-md,1rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);grid-template-columns:repeat(auto-fit,minmax(9rem,1fr));display:grid}.lead span{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;display:block}.lead strong{font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a)}.scroll{min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem);min-width:700px}thead{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 20%, transparent)}th,td{padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);text-align:left;white-space:nowrap}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.04em}tbody tr{border-top:1px solid var(--roxy-border,#e4e4e7)}tbody tr.lead-row{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 10%, transparent)}td.pada{font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a)}.abbr{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-normal,400);margin-left:.4em}tbody tr.lead-row .abbr,tbody tr.lead-row .glyph{color:var(--roxy-accent-ink,#b45309)}.glyph{color:var(--roxy-muted,#71717a);margin-right:.4em}.num{font-variant-numeric:tabular-nums}.exception{font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-warning-fg,#b45309)}.meaning{white-space:normal;min-width:12rem}.meaning strong{font-weight:var(--roxy-weight-bold,600);display:block}.meaning p{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);line-height:var(--roxy-leading-normal,1.5);margin:0}.note{padding:0 var(--roxy-space-md,1rem) var(--roxy-space-md,1rem);color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);line-height:var(--roxy-leading-normal,1.5);margin:0}`,\n\t];\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No arudha pada data</div>`;\n\t}\n\n\tprotected renderData(d: ArudhaResponse) {\n\t\tconst padas = d.padas ?? [];\n\t\tif (!padas.length) return this.renderEmpty();\n\t\tconst exceptions = padas.filter((p) => p.exceptionApplied).length;\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Arudha padas\"><header class=\"head\"><h2 class=\"title\">Arudha padas</h2></header><div class=\"leads\"><div class=\"lead\"><span>Lagna</span><strong>${d.lagnaRashi ?? ''}</strong></div><div class=\"lead\"><span>Arudha Lagna</span><strong>${d.arudhaLagna ?? ''}</strong></div><div class=\"lead\"><span>Upapada</span><strong>${d.upapada ?? ''}</strong></div></div><div class=\"scroll\" tabindex=\"0\"><table role=\"table\"><caption class=\"roxy-sr-only\">The twelve Arudha padas: each pada with its bhava, the bhava sign and its lord, the sign the lord occupies, the sign the pada falls in, which house from the Lagna that is, whether the classical exception was applied, and what the pada is read for.</caption><thead><tr><th scope=\"col\">Pada</th><th scope=\"col\">Bhava</th><th scope=\"col\">Bhava rashi</th><th scope=\"col\">Lord</th><th scope=\"col\">Lord rashi</th><th scope=\"col\">Pada rashi</th><th scope=\"col\">From Lagna</th><th scope=\"col\">Read for</th></tr></thead><tbody>${padas.map((p) => this.renderRow(p))}</tbody></table></div>${\n\t\t\t\texceptions > 0\n\t\t\t\t\t? html`<p class=\"note\"><span class=\"exception\">Moved</span> marks a pada that fell in its own bhava or the seventh from it and was moved to the tenth from there, as the classical rule requires. ${exceptions} of ${padas.length} padas here.</p>`\n\t\t\t\t\t: nothing\n\t\t\t}</div>`;\n\t}\n\n\tprivate renderRow(p: Pada) {\n\t\tconst glyph = (sign?: string) => SIGN_GLYPH[capitalize(sign ?? '')] ?? '';\n\t\tconst cell = (sign?: string) => {\n\t\t\tconst g = glyph(sign);\n\t\t\treturn html`${g ? html`<span class=\"glyph\">${g}</span>` : nothing}${sign ?? ''}`;\n\t\t};\n\t\treturn html`<tr class=\"${LEAD_IDS.has(p.id) ? 'lead-row' : ''}\"><td class=\"pada\">${p.name ?? ''}${p.abbreviation ? html`<span class=\"abbr\">${p.abbreviation}</span>` : nothing}</td><td class=\"num\">${p.house ?? ''}</td><td>${cell(p.bhavaRashi)}</td><td>${p.lord ?? ''}</td><td>${cell(p.lordRashi)}</td><td>${cell(p.rashi)} ${p.exceptionApplied ? html`<span class=\"exception\">Moved</span>` : nothing}</td><td class=\"num\">${p.houseFromLagna ?? ''}</td><td class=\"meaning\"><strong>${p.meaning ?? ''}</strong> ${p.significations ? html`<p>${p.significations}</p>` : nothing}</td></tr>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-arudha-padas': RoxyArudhaPadas;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\n/**\n * Glyph per aspect, keyed by the hyphen-free canonical name.\n *\n * @remarks\n * These are the nine aspects Unicode itself defines as a set, in its Miscellaneous Symbols block note: `260C, 26BA, 2220, 26B9, 25A1, 25B3, 26BC, 26BB, 260D` for 0, 30, 45, 60, 90, 120, 135, 150 and 180 degrees. That is exactly the vocabulary the API returns, so every aspect resolves to a real glyph and none falls through to a truncated slug.\n *\n * Do not substitute the visually similar maths operators. An earlier revision used `\u22BB` XOR for quincunx and `\u22BC` NAND for semisextile, which are the two characters Unicode lists as cross-references FROM the real glyphs, and it had them the wrong way round: charts rendered a 150 degree quincunx with the 30 degree semisextile symbol and vice versa. An astrologer reads the glyph, not the tooltip.\n */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\tsemisextile: '\u26BA',\n\tsemisquare: '\u2220',\n\tsextile: '\u26B9',\n\tsquare: '\u25A1',\n\ttrine: '\u25B3',\n\tsesquiquadrate: '\u26BC',\n\tquincunx: '\u26BB',\n\topposition: '\u260D',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import {\n\ttype CSSResultGroup,\n\thtml,\n\tLitElement,\n\ttype PropertyValues,\n} from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { baseStyles } from './base-styles.js';\nimport { buildRequest, FetchController } from './fetch-controller.js';\nimport { MarkupDataController } from './markup-data.js';\n\n/**\n * Shared base for every data-driven Roxy component. Consolidates the things every component used to repeat by hand and adds the self-contained, drop-in behavior: controlled-mode hydration, an opt-in self-fetch (form, request, loading, error, empty), the typed `data` slot, and the render switch. A subclass implements one method, {@link RoxyDataElement.renderData}.\n *\n * @remarks\n * Two render modes, one component, which is the whole drop-in contract:\n *\n * - Controlled: a server (WordPress, JSX SSR, static HTML) fetches the response and injects it as a direct-child `<script type=\"application/json\" class=\"roxy-data\">`. {@link MarkupDataController} hydrates `data` from it on connect. No key reaches the browser. This is the path the WordPress plugin drives, and it is unchanged by the base class.\n * - Uncontrolled: no data is injected, but a `data-endpoint` and a `pk_` `publishable-key` are set. The component renders its own `<roxy-endpoint-form>` (an internal detail, never placed by the consumer), and on submit fetches through {@link FetchController}, which refuses any non-publishable key. The result populates `data` and the component renders it.\n *\n * The JavaScript `data` property always wins over markup, so a host that assigns `el.data = \u2026` after upgrade is authoritative.\n *\n * Self-fetch needs `<roxy-endpoint-form>` (and `<roxy-location-search>`) registered. The CDN bundle and the full `@roxyapi/ui` entry register everything; per-component ESM consumers that want self-fetch import the form component too.\n *\n * @example\n * ```ts\n * @customElement('roxy-dream-card')\n * export class RoxyDreamCard extends RoxyDataElement<GetDreamSymbolResponse> {\n * static styles = [baseStyles, css`.card { \u2026 }`];\n * protected renderData(d: GetDreamSymbolResponse) {\n * return html`<article class=\"card\">\u2026</article>`;\n * }\n * protected renderEmpty() {\n * return html`<div class=\"roxy-empty\" role=\"status\">No dream symbol</div>`;\n * }\n * }\n * ```\n */\nexport abstract class RoxyDataElement<T = unknown> extends LitElement {\n\tstatic styles: CSSResultGroup = [baseStyles];\n\n\t/** Typed RoxyAPI response. Assigned in JavaScript, hydrated from the roxy-data island, or set by a self-fetch. */\n\t@property({ attribute: false })\n\tdata: T | null = null;\n\n\t/** Endpoint path for self-fetch, e.g. \"astrology/natal-chart\" or \"dreams/symbols/{id}\". Empty disables self-fetch (controlled mode only). */\n\t@property({ type: String, attribute: 'data-endpoint' })\n\tendpoint = '';\n\n\t/** HTTP method for self-fetch. */\n\t@property({ type: String })\n\tmethod: 'GET' | 'POST' = 'POST';\n\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side. */\n\t@property({ type: String, attribute: 'publishable-key' })\n\tpublishableKey?: string;\n\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\t@property({ type: String, attribute: 'base-url' })\n\tbaseUrl?: string;\n\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\t@property({ type: String, attribute: 'spec-url' })\n\tspecUrl?: string;\n\n\t/** Consumer backend route that proxies the request (holds the secret key). When set, self-fetch POSTs the request here instead of calling RoxyAPI directly, so no key reaches the browser. The server-rendered (WordPress) path. */\n\t@property({ type: String, attribute: 'submit-url' })\n\tsubmitUrl?: string;\n\n\t/** Persist the last self-fetch form values in sessionStorage (keyed by endpoint) and prefill the form on reload. */\n\t@property({ type: Boolean })\n\tremember = false;\n\n\t/** Override the self-fetch form's submit-button label. Empty derives one from the endpoint. */\n\t@property({ type: String, attribute: 'submit-label' })\n\tsubmitLabel?: string;\n\n\t/** Render a small \"Spiritual data by RoxyAPI\" credit under a self-fetch or auto-mount result. Off by default; any value except \"off\"/\"false\" enables it. The one-tag widgets script turns it on unless data-attribution=\"off\". Never shown in controlled mode. */\n\t@property({ type: String })\n\tattribution?: string;\n\n\t/** True while an uncontrolled self-fetch is in flight. Public so {@link FetchController} can drive it. */\n\t@state()\n\tloading = false;\n\n\t/** Message from a failed self-fetch, or null. Public so {@link FetchController} can drive it. */\n\t@state()\n\terror: string | null = null;\n\n\t/**\n\t * True once a self-fetch (not a consumer-assigned or island-hydrated `data`) produced the current result. It gates the interactive result affordances, so controlled mode never shows an Edit control or a sticky picker.\n\t */\n\t@state()\n\tprivate selfFetched = false;\n\n\t/** True when the visitor asked to edit a self-fetch result, so the form is restored over the result. */\n\t@state()\n\tprivate editing = false;\n\n\t/** True when the last self-fetch form was a single-enum picker, so it stays visible above the result and a change refetches. */\n\t@state()\n\tprivate sticky = false;\n\n\t/** Last submitted form values (nested per group), kept in memory to restore the form on Edit and to prefill the sticky picker. */\n\tprivate lastValues?: Record<string, unknown>;\n\n\tprivate fetcher: FetchController<T>;\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Controlled mode: hydrate `data` from a direct-child roxy-data island when\n\t\t// no JS property was assigned. Keyless; the server already fetched.\n\t\tnew MarkupDataController<T>(this);\n\t\tthis.fetcher = new FetchController<T>(this);\n\t}\n\n\tprotected willUpdate(changed: PropertyValues): void {\n\t\tif (changed.has('publishableKey')) {\n\t\t\tthis.fetcher.publishableKey = this.publishableKey;\n\t\t}\n\t\tif (changed.has('baseUrl') && this.baseUrl) {\n\t\t\tthis.fetcher.baseUrl = this.baseUrl;\n\t\t}\n\t\tif (changed.has('submitUrl')) {\n\t\t\tthis.fetcher.submitUrl = this.submitUrl;\n\t\t}\n\t}\n\n\trender(): unknown {\n\t\tif (this.loading) return this.renderLoading();\n\t\tif (this.error != null) return this.renderError(this.error);\n\t\tif (this.data != null) {\n\t\t\t// Controlled mode (consumer-assigned or island-hydrated data) renders the\n\t\t\t// result alone, byte-identical to before: no picker, no Edit. The one\n\t\t\t// exception is the widgets auto-mount attrs-complete path, which assigns\n\t\t\t// data directly AND sets `attribution`; a real controlled consumer never\n\t\t\t// sets the attribute, so this stays byte-identical for them.\n\t\t\tif (!this.selfFetched) {\n\t\t\t\treturn this.showAttribution()\n\t\t\t\t\t? html`${this.renderData(this.data)}${this.renderAttribution()}`\n\t\t\t\t\t: this.renderData(this.data);\n\t\t\t}\n\t\t\tif (this.editing) return this.renderForm();\n\t\t\treturn this.renderResult(this.data);\n\t\t}\n\t\treturn this.renderNoData();\n\t}\n\n\t/** Render the populated response. The single method every component implements. */\n\tprotected abstract renderData(data: T): unknown;\n\n\t/**\n\t * A self-fetch result plus its re-query affordance. A single-enum form keeps its picker above the result so a new selection refetches (a sign switch is a new reading); any other form gets a compact Edit control that restores the form with the previous values.\n\t */\n\tprotected renderResult(data: T): unknown {\n\t\tconst body = this.sticky\n\t\t\t? html`${this.renderForm()}${this.renderData(data)}`\n\t\t\t: html`<div class=\"roxy-edit-bar\"><button type=\"button\" class=\"roxy-edit\" @click=\"${this.onEdit}\">Edit query</button></div>${this.renderData(data)}`;\n\t\treturn this.showAttribution()\n\t\t\t? html`${body}${this.renderAttribution()}`\n\t\t\t: body;\n\t}\n\n\tprivate onEdit = () => {\n\t\tthis.editing = true;\n\t};\n\n\t/** True when the attribution credit renders: the attribute is present and not explicitly disabled. */\n\tprivate showAttribution(): boolean {\n\t\treturn (\n\t\t\tthis.attribution != null &&\n\t\t\tthis.attribution !== 'off' &&\n\t\t\tthis.attribution !== 'false'\n\t\t);\n\t}\n\n\t/** Small muted credit under a self-fetch or auto-mount result. Reached only from the result path, so controlled mode never renders it. */\n\tprotected renderAttribution(): unknown {\n\t\treturn html`<div class=\"roxy-attribution\"><a href=\"https://roxyapi.com/?utm_source=widget&utm_medium=embed\" target=\"_blank\" rel=\"noopener\">Spiritual data by RoxyAPI</a></div>`;\n\t}\n\n\t/** The data-absent branch: the self-fetch form when an endpoint is set, otherwise the empty state. */\n\tprotected renderNoData(): unknown {\n\t\treturn this.endpoint ? this.renderForm() : this.renderEmpty();\n\t}\n\n\t/** Internal self-fetch form. Reuses the introspecting `<roxy-endpoint-form>`; the consumer never places it. */\n\tprotected renderForm(): unknown {\n\t\treturn html`<roxy-endpoint-form data-endpoint=\"${this.endpoint}\" method=\"${this.method}\" spec-url=\"${ifDefined(this.specUrl)}\" publishable-key=\"${ifDefined(this.publishableKey)}\" submit-label=\"${ifDefined(this.submitLabel)}\" lang=\"${ifDefined(this.effectiveLang())}\" .initialValues=\"${this.formInitialValues()}\" @roxy-submit=\"${this.onFormSubmit}\"></roxy-endpoint-form>`;\n\t}\n\n\t/** Prefill source for the form: the last submission (Edit / sticky refetch) wins over remembered storage. */\n\tprivate formInitialValues(): Record<string, unknown> | undefined {\n\t\treturn (\n\t\t\tthis.lastValues ?? (this.remember ? this.readRemembered() : undefined)\n\t\t);\n\t}\n\n\t/** Site-owner language from the element `lang` attribute (native accessor), routed to the API query on submit. */\n\tprivate effectiveLang(): string | undefined {\n\t\treturn this.lang || undefined;\n\t}\n\n\tprivate onFormSubmit = (e: Event) => {\n\t\tconst detail = (e as CustomEvent).detail as {\n\t\t\tvalues: Record<string, unknown>;\n\t\t\tqueryKeys?: string[];\n\t\t\tsticky?: boolean;\n\t\t};\n\t\tthis.lastValues = detail.values;\n\t\tthis.sticky = !!detail.sticky;\n\t\tthis.selfFetched = true;\n\t\tthis.editing = false;\n\t\tif (this.remember) this.writeRemembered(detail.values);\n\t\tvoid this.fetcher.run(\n\t\t\tbuildRequest(\n\t\t\t\tthis.endpoint,\n\t\t\t\tthis.method,\n\t\t\t\tdetail.values,\n\t\t\t\tdetail.queryKeys ?? [],\n\t\t\t),\n\t\t);\n\t};\n\n\t/** sessionStorage key for this component's remembered form values, scoped by endpoint. */\n\tprivate rememberKey(): string {\n\t\treturn `roxy-ui:form:${this.endpoint}`;\n\t}\n\n\tprivate readRemembered(): Record<string, unknown> | undefined {\n\t\ttry {\n\t\t\tconst raw = sessionStorage.getItem(this.rememberKey());\n\t\t\treturn raw ? (JSON.parse(raw) as Record<string, unknown>) : undefined;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate writeRemembered(values: Record<string, unknown>): void {\n\t\ttry {\n\t\t\tsessionStorage.setItem(this.rememberKey(), JSON.stringify(values));\n\t\t} catch {\n\t\t\t// Private mode / disabled storage: remembering is best-effort, never fatal.\n\t\t}\n\t}\n\n\t/** Terminal empty state. Subclasses override for a domain-specific message. */\n\tprotected renderEmpty(): unknown {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No data</div>`;\n\t}\n\n\t/** Loading placeholder shown during a self-fetch. */\n\tprotected renderLoading(): unknown {\n\t\treturn html`<div class=\"roxy-skeleton\" style=\"height:8rem\" role=\"status\" aria-label=\"Loading\"></div>`;\n\t}\n\n\t/** Error state shown when a self-fetch fails. Keeps the form in view so the request can be retried. */\n\tprotected renderError(message: string): unknown {\n\t\tconst banner = html`<div class=\"roxy-error\" role=\"alert\">${message}</div>`;\n\t\treturn this.endpoint ? html`${banner}${this.renderForm()}` : banner;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "/**\n * The one place the \"publishable key only\" rule lives. Every client-side fetch boundary ({@link ../components/location-search.ts}, {@link ./fetch-controller.ts}) calls through here so a secret or legacy unprefixed key is refused identically: no network call, the same visible message, the same `roxy-validation-error` event. Centralising it is what stops the two paths drifting, which is exactly how `<roxy-location-search>` used to warn-then-fetch a secret key while the controller fail-closed.\n */\n\n/** Canonical refusal message. Both fetch boundaries surface this exact wording. */\nexport const KEY_REFUSED_MESSAGE =\n\t'Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.';\n\n/** True when the key is a browser-safe `pk_` publishable key. */\nexport function isPublishableKey(key: string | undefined | null): boolean {\n\treturn !!key && key.startsWith('pk_');\n}\n\n/**\n * The fail-closed condition: a key is PRESENT and is NOT a `pk_` key. An absent key is not refused, so a keyless public call (a form-slotted city search with no key set) still proceeds; only a real secret/legacy token in the browser is stopped.\n */\nexport function keyIsRefused(key: string | undefined | null): boolean {\n\treturn !!key && !key.startsWith('pk_');\n}\n\n/**\n * Announce a refused key: dispatch the shared `roxy-validation-error` (bubbling, composed) and, when `warn` is set, log it once for the developer. The caller sets its own visible error state and skips the fetch; this only handles the parts both boundaries share.\n */\nexport function dispatchKeyRefusal(\n\thost: EventTarget,\n\topts: { warn?: boolean } = {},\n): void {\n\tif (opts.warn) console.warn(KEY_REFUSED_MESSAGE);\n\thost.dispatchEvent(\n\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\tdetail: { reason: 'possible-secret-key', message: KEY_REFUSED_MESSAGE },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t}),\n\t);\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport {\n\tdispatchKeyRefusal,\n\tKEY_REFUSED_MESSAGE,\n\tkeyIsRefused,\n} from './key-guard.js';\n\n/**\n * Host slots the controller drives. {@link RoxyDataElement} satisfies this, so the form mixin can attach a controller without the component wiring state by hand.\n *\n * @remarks\n * Intersected with `HTMLElement` because the controller dispatches events on the host. Lit's `ReactiveControllerHost` is the update-lifecycle contract only (`addController`, `requestUpdate`, `updateComplete`) and carries no DOM surface, even though every real host is a `LitElement` and therefore an `HTMLElement`. Declaring the DOM half is what the controller actually needs; it used to reach it through a `this.host as unknown as EventTarget` double cast instead, which asserted a capability the type never promised.\n */\ntype FetchHost<T> = ReactiveControllerHost &\n\tHTMLElement & {\n\t\tdata: T | null;\n\t\tloading: boolean;\n\t\terror: string | null;\n\t};\n\n/** Default RoxyAPI v2 origin. A component overrides it per instance via its `base-url` attribute. */\nconst DEFAULT_BASE_URL = 'https://roxyapi.com/api/v2';\n\n/** A single request the controller issues on the component's behalf. */\nexport interface RoxyRequest {\n\t/** Path under the API base, e.g. \"/dreams/symbols/water\" or \"/astrology/natal-chart\". */\n\tpath: string;\n\tmethod?: 'GET' | 'POST';\n\t/** JSON body for POST endpoints. */\n\tbody?: unknown;\n\t/** Query string parameters; nullish values are dropped. */\n\tquery?: Record<string, string | number | undefined>;\n}\n\n/**\n * Client-side fetch for uncontrolled (self-fetching) components: drives `host.data` / `host.loading` / `host.error` and cancels a stale request when a newer one starts or the host disconnects.\n *\n * @remarks\n * Security boundary. The only credential this ever sends is a `pk_` publishable key, which carries a server-side origin allowlist. A secret (`sk_`) or legacy unprefixed key is refused before any network call and surfaced as an error, so a server secret cannot leak into a browser request. This centralizes the guard that originated in `<roxy-location-search>` so every self-fetching component enforces it identically.\n *\n * Controlled-mode components never construct this. When a server injects the response as a `<script class=\"roxy-data\">` island, there is no key and no fetch, which is the path server-rendered consumers (WordPress, JSX SSR, static HTML) rely on.\n */\nexport class FetchController<T = unknown> implements ReactiveController {\n\tprivate readonly host: FetchHost<T>;\n\tprivate abort?: AbortController;\n\n\t/** Browser-safe publishable key. Set by the host from its `publishable-key` attribute. */\n\tpublishableKey?: string;\n\t/** API origin, overridable for self-hosted or proxied deployments. */\n\tbaseUrl = DEFAULT_BASE_URL;\n\t/**\n\t * Consumer backend route that holds the secret key. When set, the request is POSTed here as `{ path, method, body, query }` instead of called against RoxyAPI directly, so no key (publishable or secret) is sent from the browser. This is the canonical path for server-rendered hosts (WordPress); the backend proxies the request with its own `sk_` key and returns the JSON response.\n\t */\n\tsubmitUrl?: string;\n\n\tconstructor(host: FetchHost<T>) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostDisconnected() {\n\t\tthis.abort?.abort();\n\t\tthis.abort = undefined;\n\t}\n\n\t/**\n\t * Issue the request and resolve once `host.data` (success) or `host.error`\n\t * (failure) is set. A no-op return when a non-publishable key is present:\n\t * the error is already surfaced and nothing is sent.\n\t */\n\tasync run(req: RoxyRequest): Promise<void> {\n\t\t// submit-url proxy: no key leaves the browser; the consumer's backend holds it.\n\t\tif (!this.submitUrl && this.secretKeyRefused()) return;\n\t\tthis.abort?.abort();\n\t\tconst controller = new AbortController();\n\t\tthis.abort = controller;\n\t\tthis.host.loading = true;\n\t\tthis.host.error = null;\n\t\ttry {\n\t\t\tconst res = this.submitUrl\n\t\t\t\t? await fetch(this.submitUrl, {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\tAccept: 'application/json',\n\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: JSON.stringify(req),\n\t\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t\t})\n\t\t\t\t: await this.callApi(req, controller.signal);\n\t\t\tif (!res.ok) throw new Error(await this.readError(res));\n\t\t\tconst json = (await res.json()) as T;\n\t\t\tif (controller.signal.aborted) return;\n\t\t\tthis.host.data = json;\n\t\t} catch (err) {\n\t\t\tif ((err as { name?: string })?.name === 'AbortError') return;\n\t\t\tthis.host.error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (this.abort === controller) this.abort = undefined;\n\t\t\tif (!controller.signal.aborted) this.host.loading = false;\n\t\t}\n\t}\n\n\t/** Direct call against RoxyAPI with the publishable key (the no-backend path). */\n\tprivate callApi(req: RoxyRequest, signal: AbortSignal): Promise<Response> {\n\t\tconst url = new URL(`${this.baseUrl}${req.path}`);\n\t\tfor (const [k, v] of Object.entries(req.query ?? {})) {\n\t\t\tif (v != null) url.searchParams.set(k, String(v));\n\t\t}\n\t\tconst headers: Record<string, string> = { Accept: 'application/json' };\n\t\tif (this.publishableKey) headers['X-API-Key'] = this.publishableKey;\n\t\tif (req.body != null) headers['Content-Type'] = 'application/json';\n\t\treturn fetch(url, {\n\t\t\tmethod: req.method ?? 'GET',\n\t\t\theaders,\n\t\t\tbody: req.body != null ? JSON.stringify(req.body) : undefined,\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/** True when a key is set and it is not a browser-safe `pk_` publishable key. Surfaces the error and refuses to send, via the shared {@link keyIsRefused} guard so every fetch boundary fail-closes identically. */\n\tprivate secretKeyRefused(): boolean {\n\t\tif (!keyIsRefused(this.publishableKey)) return false;\n\t\tthis.host.error = KEY_REFUSED_MESSAGE;\n\t\tdispatchKeyRefusal(this.host);\n\t\treturn true;\n\t}\n\n\t/** Surface the `{ error, code }` message the API returns on failure, falling back to the status code. */\n\tprivate async readError(res: Response): Promise<string> {\n\t\ttry {\n\t\t\tconst body = (await res.json()) as { error?: string };\n\t\t\tif (body?.error) return body.error;\n\t\t} catch {\n\t\t\t// Non-JSON error body: fall through to the status line.\n\t\t}\n\t\treturn `Request failed (${res.status})`;\n\t}\n}\n\n/**\n * Translate flat form values into a {@link RoxyRequest} for an endpoint. The `{name}` segments in the endpoint template are substituted from the values and removed; the rest become the JSON body for POST or query parameters for GET. This is the spec-light request builder the base element uses to turn a `<roxy-endpoint-form>` submission into a self-fetch, so a component needs no per-endpoint glue.\n *\n * @param queryKeys - Names the spec declares as `in: query` for this operation, which `<roxy-endpoint-form>` reports on its `roxy-submit` event. A POST operation can still take query parameters (every localized endpoint takes `?lang=`), and sending one in the JSON body silently drops it, so those names are routed to the query string on POST as well as GET.\n */\nexport function buildRequest(\n\tendpoint: string,\n\tmethod: 'GET' | 'POST',\n\tvalues: Record<string, unknown>,\n\tqueryKeys: readonly string[] = [],\n): RoxyRequest {\n\tconst rest: Record<string, unknown> = { ...values };\n\tconst path = `/${endpoint.replace(/^\\//, '')}`.replace(\n\t\t/\\{([^}]+)\\}/g,\n\t\t(_match, name: string) => {\n\t\t\tconst v = rest[name];\n\t\t\tdelete rest[name];\n\t\t\treturn encodeURIComponent(String(v ?? ''));\n\t\t},\n\t);\n\tconst inQuery = new Set(queryKeys);\n\tconst query: Record<string, string | number | undefined> = {};\n\tconst body: Record<string, unknown> = {};\n\tfor (const [k, v] of Object.entries(rest)) {\n\t\tif (v === undefined || v === '') continue;\n\t\tif (method === 'GET' || inQuery.has(k)) query[k] = v as string | number;\n\t\telse body[k] = v;\n\t}\n\treturn { path, method, query, body: method === 'POST' ? body : undefined };\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * Serialize a RoxyAPI response for embedding inside an inline `<script type=\"application/json\" class=\"roxy-data\">`. This is the safe writer counterpart to {@link MarkupDataController}, the reader: server-rendered and cached consumers (WordPress, JSX SSR, static HTML) emit the script with this, and the component hydrates `data` from it on connect.\n *\n * @remarks\n * Use this instead of a bare `JSON.stringify`. A raw stringify of a response that contains the literal text `</script>` (common in long interpretation prose) closes the script element early, corrupting the page and creating an HTML-injection vector. This escapes the script-unsafe characters to their `\\uXXXX` JSON escapes, which `JSON.parse` restores to the original characters, so the value the component receives is identical to the response you passed.\n *\n * `<` is the load-bearing escape (it defeats `</script>` and `<!--`). `>` and `&` are escaped for defence in depth, and U+2028 / U+2029 because they are valid in JSON yet are line terminators in a `<script>` context and break some parsers. The escapes introduce only `\\uXXXX` sequences, so the replacements never feed each other and order is irrelevant.\n *\n * Pass the unwrapped RoxyAPI response, the same shape you would assign to `element.data`. Do not pass the SDK envelope (`{ data, error, request, response }`).\n *\n * @example\n * ```ts\n * import { serializeRoxyData } from '@roxyapi/ui';\n *\n * const { data } = await roxy.dreams.getDreamSymbol({ path: { id: 'water' } });\n * const html = `<roxy-dream-card><script type=\"application/json\" class=\"roxy-data\">${serializeRoxyData(data)}</script></roxy-dream-card>`;\n * ```\n */\nexport function serializeRoxyData(data: unknown): string {\n\treturn JSON.stringify(data)\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n\n/**\n * Build the complete `<script type=\"application/json\" class=\"roxy-data\">\u2026</script>` element a server nests inside a `roxy-*` component for the no-JavaScript hydration path. The payload is escaped via {@link serializeRoxyData}, so it is safe to drop straight into HTML output.\n *\n * @remarks\n * The element carries both `type=\"application/json\"` and `class=\"roxy-data\"` because {@link MarkupDataController} reads only a direct-child script that has both. Emit one of these inside the target component; the JavaScript `data` property still wins if it is later assigned.\n *\n * @example\n * ```ts\n * import { roxyDataScript } from '@roxyapi/ui';\n *\n * const { data } = await roxy.crystals.getCrystal({ path: { id: 'amethyst' } });\n * const html = `<roxy-crystal-grid>${roxyDataScript(data)}</roxy-crystal-grid>`;\n * ```\n */\nexport function roxyDataScript(data: unknown): string {\n\treturn `<script type=\"application/json\" class=\"${ROXY_DATA_CLASS}\">${serializeRoxyData(data)}</script>`;\n}\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn (\n\t\ts\n\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t\t// Split a trailing/embedded digit off a word so \"person1\" reads \"Person 1\"\n\t\t\t// and every group legend and field label spaces its ordinal.\n\t\t\t.replace(/([a-z])([0-9])/g, '$1 $2')\n\t\t\t.replace(/^\\w/, (c) => c.toUpperCase())\n\t);\n}\n"],
5
+ "mappings": "wMAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,WAAAC,MAAe,MACnC,OAAS,iBAAAC,MAAqB,oBC+CvB,IAAMC,EAAqC,CACjD,MAAO,SACP,OAAQ,SACR,OAAQ,SACR,OAAQ,SACR,IAAK,SACL,MAAO,SACP,MAAO,SACP,QAAS,SACT,YAAa,SACb,UAAW,SACX,SAAU,SACV,OAAQ,QACT,EC7DA,OAEC,QAAAC,EACA,cAAAC,MAEM,MACP,OAAS,YAAAC,EAAU,SAAAC,MAAa,oBAChC,OAAS,aAAAC,MAAiB,+BCP1B,OAAS,OAAAC,MAAW,MAMb,IAAMC,EAAaD,67FCDnB,IAAME,EACZ,mIAUM,SAASC,EAAaC,EAAyC,CACrE,MAAO,CAAC,CAACA,GAAO,CAACA,EAAI,WAAW,KAAK,CACtC,CAKO,SAASC,EACfC,EACAC,EAA2B,CAAC,EACrB,CACHA,EAAK,MAAM,QAAQ,KAAKC,CAAmB,EAC/CF,EAAK,cACJ,IAAI,YAAY,wBAAyB,CACxC,OAAQ,CAAE,OAAQ,sBAAuB,QAASE,CA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W,EAAE,inBAAinBC,EAAM,IAAKE,GAAM,KAAK,UAAUA,CAAC,CAAC,CAAC,yBACrgCD,EAAa,EACVH,+LAAkMG,CAAU,OAAOD,EAAM,MAAM,mBAC/NG,CACJ,QACF,CAEQ,UAAUD,EAAS,CAC1B,IAAME,EAASC,GAAkBC,EAAWC,EAAWF,GAAQ,EAAE,CAAC,GAAK,GACjEG,EAAQH,GAAkB,CAC/B,IAAMI,EAAIL,EAAMC,CAAI,EACpB,OAAOP,IAAOW,EAAIX,wBAA2BW,CAAC,UAAYN,CAAO,GAAGE,GAAQ,EAAE,EAC/E,EACA,OAAOP,eAAkBH,EAAS,IAAIO,EAAE,EAAE,EAAI,WAAa,EAAE,sBAAsBA,EAAE,MAAQ,EAAE,GAAGA,EAAE,aAAeJ,uBAA0BI,EAAE,YAAY,UAAYC,CAAO,wBAAwBD,EAAE,OAAS,EAAE,YAAYM,EAAKN,EAAE,UAAU,CAAC,YAAYA,EAAE,MAAQ,EAAE,YAAYM,EAAKN,EAAE,SAAS,CAAC,YAAYM,EAAKN,EAAE,KAAK,CAAC,IAAIA,EAAE,iBAAmBJ,wCAA6CK,CAAO,wBAAwBD,EAAE,gBAAkB,EAAE,oCAAoCA,EAAE,SAAW,EAAE,aAAaA,EAAE,eAAiBJ,OAAUI,EAAE,cAAc,OAASC,CAAO,YACxjB,CACD,EA9BaP,EACL,OAAS,CACfc,EACAC,ywEACD,EAJYf,EAANgB,EAAA,CADNC,EAAc,mBAAmB,GACrBjB",
6
+ "names": ["css", "html", "nothing", "customElement", "SIGN_GLYPH", "html", "LitElement", "property", "state", "ifDefined", "css", "baseStyles", "KEY_REFUSED_MESSAGE", "keyIsRefused", "key", "dispatchKeyRefusal", "host", "opts", "KEY_REFUSED_MESSAGE", "DEFAULT_BASE_URL", "FetchController", "host", "req", "controller", "res", "json", "err", "signal", "url", "k", "v", "headers", "keyIsRefused", "KEY_REFUSED_MESSAGE", "dispatchKeyRefusal", "body", "buildRequest", "endpoint", "method", "values", "queryKeys", "rest", "path", "_match", "name", "inQuery", "query", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "ROXY_DATA_CLASS", "text", "RoxyDataElement", "LitElement", "detail", "buildRequest", "MarkupDataController", "FetchController", "baseStyles", "changed", "html", "data", "body", "ifDefined", "raw", "values", "message", "banner", "__decorateClass", "property", "state", "capitalize", "s", "LEAD_IDS", "RoxyArudhaPadas", "RoxyDataElement", "html", "d", "padas", "exceptions", "p", "nothing", "glyph", "sign", "SIGN_GLYPH", "capitalize", "cell", "g", "baseStyles", "css", "__decorateClass", "customElement"]
7
+ }
@@ -0,0 +1,22 @@
1
+ import type { CharaKarakaResponse } from '../types/index.js';
2
+ import { RoxyDataElement } from '../utils/base-element.js';
3
+ /**
4
+ * Chara Karakas. Renders /vedic-astrology/chara-karakas: the movable significators of Jaimini astrology, the offices ranked by how far each graha has advanced into its sign, Atmakaraka first.
5
+ *
6
+ * @remarks
7
+ * The scheme is shown, never hidden. The seven and eight karaka schemes name a DIFFERENT Atmakaraka on the same chart, so a reader who follows one school has to be able to see at a glance which one produced the ranking in front of them. The value is the one the response echoes, so the label can never disagree with the ranking beside it.
8
+ *
9
+ * Rahu is flagged where it appears. It advances backward through a sign, so it is ranked on thirty degrees minus its position, and the response carries both figures: the degree a chart displays and the degree that earned the office. Showing only one of them makes the order look wrong.
10
+ */
11
+ export declare class RoxyCharaKarakas extends RoxyDataElement<CharaKarakaResponse> {
12
+ static styles: import("lit").CSSResult[];
13
+ protected renderEmpty(): import("lit").TemplateResult<1>;
14
+ protected renderData(d: CharaKarakaResponse): import("lit").TemplateResult<1>;
15
+ private renderRow;
16
+ }
17
+ declare global {
18
+ interface HTMLElementTagNameMap {
19
+ 'roxy-chara-karakas': RoxyCharaKarakas;
20
+ }
21
+ }
22
+ //# sourceMappingURL=chara-karakas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chara-karakas.d.ts","sourceRoot":"","sources":["../../src/components/chara-karakas.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAe3D;;;;;;;GAOG;AACH,qBACa,gBAAiB,SAAQ,eAAe,CAAC,mBAAmB,CAAC;IACzE,MAAM,CAAC,MAAM,4BAsIX;IAEF,SAAS,CAAC,WAAW;IAIrB,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,mBAAmB;IAyC3C,OAAO,CAAC,SAAS;CAwBjB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,oBAAoB,EAAE,gBAAgB,CAAC;KACvC;CACD"}
@@ -0,0 +1,2 @@
1
+ var P=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var a=(n,e,r,t)=>{for(var o=t>1?void 0:t?U(e,r):e,u=n.length-1,c;u>=0;u--)(c=n[u])&&(o=(t?c(e,r,o):c(o))||o);return t&&o&&P(e,r,o),o};import{css as I,html as l,nothing as m}from"lit";import{customElement as O}from"lit/decorators.js";var T={Sun:"\u2609",Moon:"\u263D",Mercury:"\u263F",Venus:"\u2640",Earth:"\u2641",Mars:"\u2642",Jupiter:"\u2643",Saturn:"\u2644",Uranus:"\u2645",Neptune:"\u2646",Pluto:"\u2647",Rahu:"\u260A",Ketu:"\u260B",Ascendant:"Asc",Lagna:"La",NorthNode:"\u260A",SouthNode:"\u260B","North node":"\u260A","South node":"\u260B",Chiron:"\u26B7",Lilith:"\u26B8","Black moon lilith":"\u26B8"};var A={Aries:"\u2648",Taurus:"\u2649",Gemini:"\u264A",Cancer:"\u264B",Leo:"\u264C",Virgo:"\u264D",Libra:"\u264E",Scorpio:"\u264F",Sagittarius:"\u2650",Capricorn:"\u2651",Aquarius:"\u2652",Pisces:"\u2653"};import{html as s,LitElement as G}from"lit";import{property as d,state as h}from"lit/decorators.js";import{ifDefined as k}from"lit/directives/if-defined.js";import{css as _}from"lit";var b=_`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var y="Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.";function E(n){return!!n&&!n.startsWith("pk_")}function L(n,e={}){e.warn&&console.warn(y),n.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:"possible-secret-key",message:y},bubbles:!0,composed:!0}))}var K="https://roxyapi.com/api/v2",x=class{constructor(e){this.baseUrl=K;this.host=e,e.addController(this)}hostDisconnected(){this.abort?.abort(),this.abort=void 0}async run(e){if(!this.submitUrl&&this.secretKeyRefused())return;this.abort?.abort();let r=new AbortController;this.abort=r,this.host.loading=!0,this.host.error=null;try{let t=this.submitUrl?await fetch(this.submitUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:r.signal}):await this.callApi(e,r.signal);if(!t.ok)throw new Error(await this.readError(t));let o=await t.json();if(r.signal.aborted)return;this.host.data=o}catch(t){if(t?.name==="AbortError")return;this.host.error=t instanceof Error?t.message:String(t)}finally{this.abort===r&&(this.abort=void 0),r.signal.aborted||(this.host.loading=!1)}}callApi(e,r){let t=new URL(`${this.baseUrl}${e.path}`);for(let[u,c]of Object.entries(e.query??{}))c!=null&&t.searchParams.set(u,String(c));let o={Accept:"application/json"};return this.publishableKey&&(o["X-API-Key"]=this.publishableKey),e.body!=null&&(o["Content-Type"]="application/json"),fetch(t,{method:e.method??"GET",headers:o,body:e.body!=null?JSON.stringify(e.body):void 0,signal:r})}secretKeyRefused(){return E(this.publishableKey)?(this.host.error=y,L(this.host),!0):!1}async readError(e){try{let r=await e.json();if(r?.error)return r.error}catch{}return`Request failed (${e.status})`}};function C(n,e,r,t=[]){let o={...r},u=`/${n.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(g,p)=>{let N=o[p];return delete o[p],encodeURIComponent(String(N??""))}),c=new Set(t),R={},$={};for(let[g,p]of Object.entries(o))p===void 0||p===""||(e==="GET"||c.has(g)?R[g]=p:$[g]=p);return{path:u,method:e,query:R,body:e==="POST"?$:void 0}}var z="roxy-data";function M(n){return n.nodeName==="SCRIPT"&&n.getAttribute("type")==="application/json"}var v=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(M(e)&&e.classList.contains(z))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};var i=class extends G{constructor(){super();this.data=null;this.endpoint="";this.method="POST";this.remember=!1;this.loading=!1;this.error=null;this.selfFetched=!1;this.editing=!1;this.sticky=!1;this.onEdit=()=>{this.editing=!0};this.onFormSubmit=r=>{let t=r.detail;this.lastValues=t.values,this.sticky=!!t.sticky,this.selfFetched=!0,this.editing=!1,this.remember&&this.writeRemembered(t.values),this.fetcher.run(C(this.endpoint,this.method,t.values,t.queryKeys??[]))};new v(this),this.fetcher=new x(this)}static{this.styles=[b]}willUpdate(r){r.has("publishableKey")&&(this.fetcher.publishableKey=this.publishableKey),r.has("baseUrl")&&this.baseUrl&&(this.fetcher.baseUrl=this.baseUrl),r.has("submitUrl")&&(this.fetcher.submitUrl=this.submitUrl)}render(){return this.loading?this.renderLoading():this.error!=null?this.renderError(this.error):this.data!=null?this.selfFetched?this.editing?this.renderForm():this.renderResult(this.data):this.showAttribution()?s`${this.renderData(this.data)}${this.renderAttribution()}`:this.renderData(this.data):this.renderNoData()}renderResult(r){let t=this.sticky?s`${this.renderForm()}${this.renderData(r)}`:s`<div class="roxy-edit-bar"><button type="button" class="roxy-edit" @click="${this.onEdit}">Edit query</button></div>${this.renderData(r)}`;return this.showAttribution()?s`${t}${this.renderAttribution()}`:t}showAttribution(){return this.attribution!=null&&this.attribution!=="off"&&this.attribution!=="false"}renderAttribution(){return s`<div class="roxy-attribution"><a href="https://roxyapi.com/?utm_source=widget&utm_medium=embed" target="_blank" rel="noopener">Spiritual data by RoxyAPI</a></div>`}renderNoData(){return this.endpoint?this.renderForm():this.renderEmpty()}renderForm(){return s`<roxy-endpoint-form data-endpoint="${this.endpoint}" method="${this.method}" spec-url="${k(this.specUrl)}" publishable-key="${k(this.publishableKey)}" submit-label="${k(this.submitLabel)}" lang="${k(this.effectiveLang())}" .initialValues="${this.formInitialValues()}" @roxy-submit="${this.onFormSubmit}"></roxy-endpoint-form>`}formInitialValues(){return this.lastValues??(this.remember?this.readRemembered():void 0)}effectiveLang(){return this.lang||void 0}rememberKey(){return`roxy-ui:form:${this.endpoint}`}readRemembered(){try{let r=sessionStorage.getItem(this.rememberKey());return r?JSON.parse(r):void 0}catch{return}}writeRemembered(r){try{sessionStorage.setItem(this.rememberKey(),JSON.stringify(r))}catch{}}renderEmpty(){return s`<div class="roxy-empty" role="status">No data</div>`}renderLoading(){return s`<div class="roxy-skeleton" style="height:8rem" role="status" aria-label="Loading"></div>`}renderError(r){let t=s`<div class="roxy-error" role="alert">${r}</div>`;return this.endpoint?s`${t}${this.renderForm()}`:t}};a([d({attribute:!1})],i.prototype,"data",2),a([d({type:String,attribute:"data-endpoint"})],i.prototype,"endpoint",2),a([d({type:String})],i.prototype,"method",2),a([d({type:String,attribute:"publishable-key"})],i.prototype,"publishableKey",2),a([d({type:String,attribute:"base-url"})],i.prototype,"baseUrl",2),a([d({type:String,attribute:"spec-url"})],i.prototype,"specUrl",2),a([d({type:String,attribute:"submit-url"})],i.prototype,"submitUrl",2),a([d({type:Boolean})],i.prototype,"remember",2),a([d({type:String,attribute:"submit-label"})],i.prototype,"submitLabel",2),a([d({type:String})],i.prototype,"attribution",2),a([h()],i.prototype,"loading",2),a([h()],i.prototype,"error",2),a([h()],i.prototype,"selfFetched",2),a([h()],i.prototype,"editing",2),a([h()],i.prototype,"sticky",2);function w(n){return n?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():""}function S(n,e=1){if(typeof n!="number"||!Number.isFinite(n))return"";let r=n.toFixed(e);return r.includes(".")?r.replace(/\.?0+$/,""):r}var F={eight:"Eight karaka scheme, Rahu included and ranked from the end of its sign.",seven:"Seven karaka scheme, Rahu excluded and the Pitrikaraka office not assigned."},f=class extends i{renderEmpty(){return l`<div class="roxy-empty" role="status">No chara karaka data</div>`}renderData(e){let r=e.karakas??[];return r.length?l`<div class="wrap" aria-label="Chara karakas"><header class="head"><h2 class="title">Chara karakas</h2><p class="scheme"><span class="scheme-chip">${e.scheme??""}</span> ${e.scheme?F[e.scheme]??"":""}</p></header><div class="leads"><div class="lead"><span>Atmakaraka</span><strong>${e.atmakaraka??""}</strong></div><div class="lead"><span>Darakaraka</span><strong>${e.darakaraka??""}</strong></div></div><div class="scroll" tabindex="0"><table role="table"><caption class="roxy-sr-only">Chara karakas in descending rank: each office, the graha holding it, its rashi, the degree it holds, the degree that earned the office, and what the office is read for.</caption><thead><tr><th scope="col">Office</th><th scope="col">Graha</th><th scope="col">Rashi</th><th scope="col">Degree</th><th scope="col">Ranked on</th><th scope="col">Read for</th></tr></thead><tbody>${r.map((t,o)=>this.renderRow(t,o===0))}</tbody></table></div></div>`:this.renderEmpty()}renderRow(e,r){let t=T[w(e.graha??"")]??"",o=A[w(e.rashi??"")]??"";return l`<tr class="${r?"ak":""}"><td class="office">${e.name??""}${e.abbreviation?l`<span class="abbr">${e.abbreviation}</span>`:m}</td><td>${t?l`<span class="glyph">${t}</span>`:m}${e.graha??""}</td><td>${o?l`<span class="glyph">${o}</span>`:m}${e.rashi??""}</td><td class="num">${S(e.degreeInRashi,2)}</td><td class="num">${S(e.rankingDegree,2)} ${e.isReversed?l`<span class="reversed">measured from the end of the sign</span>`:m}</td><td class="meaning"><strong>${e.meaning??""}</strong> ${e.significations?l`<p>${e.significations}</p>`:m}</td></tr>`}};f.styles=[b,I`.wrap{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);background:var(--roxy-surface,#fff);box-shadow:var(--roxy-shadow-sm);overflow:hidden}.head{padding:var(--roxy-space-md,1rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);gap:var(--roxy-space-xs,.25rem);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.scheme{align-items:baseline;gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);line-height:var(--roxy-leading-normal,1.5);flex-wrap:wrap;display:flex}.scheme-chip{font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;letter-spacing:.05em;background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 16%, transparent);color:var(--roxy-accent-ink,#b45309);border-radius:999px;padding:.15em .6em}.leads{gap:var(--roxy-space-md,1rem);padding:var(--roxy-space-md,1rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);grid-template-columns:repeat(auto-fit,minmax(9rem,1fr));display:grid}.lead span{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;display:block}.lead strong{font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a)}.scroll{min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem);min-width:640px}thead{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 20%, transparent)}th,td{padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);text-align:left;white-space:nowrap}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.04em}tbody tr{border-top:1px solid var(--roxy-border,#e4e4e7)}tbody tr.ak{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 10%, transparent)}td.office{font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a)}.abbr{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-normal,400);margin-left:.4em}tbody tr.ak .abbr{color:var(--roxy-accent-ink,#b45309)}.glyph{color:var(--roxy-muted,#71717a);margin-right:.4em}tbody tr.ak .glyph{color:var(--roxy-accent-ink,#b45309)}.num{font-variant-numeric:tabular-nums}.reversed{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);display:block}.meaning{white-space:normal;min-width:12rem}.meaning strong{font-weight:var(--roxy-weight-bold,600);display:block}.meaning p{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);line-height:var(--roxy-leading-normal,1.5);margin:0}`],f=a([O("roxy-chara-karakas")],f);export{f as RoxyCharaKarakas};
2
+ //# sourceMappingURL=chara-karakas.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/chara-karakas.ts", "../../src/tokens/index.ts", "../../src/utils/base-element.ts", "../../src/utils/base-styles.ts", "../../src/utils/key-guard.ts", "../../src/utils/fetch-controller.ts", "../../src/utils/markup-data.ts", "../../src/utils/string.ts", "../../src/utils/format.ts"],
4
+ "sourcesContent": ["import { css, html, nothing } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { PLANET_GLYPH, SIGN_GLYPH } from '../tokens/index.js';\nimport type { CharaKarakaResponse } from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { formatNumber } from '../utils/format.js';\nimport { capitalize } from '../utils/string.js';\n\ntype Karaka = CharaKarakaResponse['karakas'][number];\n\n/** What each scheme is, stated on the card rather than left implicit. Read from the response `scheme`, which the API echoes for exactly this reason. */\nconst SCHEMES: Record<string, string> = {\n\teight:\n\t\t'Eight karaka scheme, Rahu included and ranked from the end of its sign.',\n\tseven:\n\t\t'Seven karaka scheme, Rahu excluded and the Pitrikaraka office not assigned.',\n};\n\n/**\n * Chara Karakas. Renders /vedic-astrology/chara-karakas: the movable significators of Jaimini astrology, the offices ranked by how far each graha has advanced into its sign, Atmakaraka first.\n *\n * @remarks\n * The scheme is shown, never hidden. The seven and eight karaka schemes name a DIFFERENT Atmakaraka on the same chart, so a reader who follows one school has to be able to see at a glance which one produced the ranking in front of them. The value is the one the response echoes, so the label can never disagree with the ranking beside it.\n *\n * Rahu is flagged where it appears. It advances backward through a sign, so it is ranked on thirty degrees minus its position, and the response carries both figures: the degree a chart displays and the degree that earned the office. Showing only one of them makes the order look wrong.\n */\n@customElement('roxy-chara-karakas')\nexport class RoxyCharaKarakas extends RoxyDataElement<CharaKarakaResponse> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);background:var(--roxy-surface,#fff);box-shadow:var(--roxy-shadow-sm);overflow:hidden}.head{padding:var(--roxy-space-md,1rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);gap:var(--roxy-space-xs,.25rem);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.scheme{align-items:baseline;gap:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);line-height:var(--roxy-leading-normal,1.5);flex-wrap:wrap;display:flex}.scheme-chip{font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;letter-spacing:.05em;background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 16%, transparent);color:var(--roxy-accent-ink,#b45309);border-radius:999px;padding:.15em .6em}.leads{gap:var(--roxy-space-md,1rem);padding:var(--roxy-space-md,1rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);grid-template-columns:repeat(auto-fit,minmax(9rem,1fr));display:grid}.lead span{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;display:block}.lead strong{font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a)}.scroll{min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem);min-width:640px}thead{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 20%, transparent)}th,td{padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);text-align:left;white-space:nowrap}th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;font-size:var(--roxy-text-xs,.75rem);letter-spacing:.04em}tbody tr{border-top:1px solid var(--roxy-border,#e4e4e7)}tbody tr.ak{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 10%, transparent)}td.office{font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a)}.abbr{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-normal,400);margin-left:.4em}tbody tr.ak .abbr{color:var(--roxy-accent-ink,#b45309)}.glyph{color:var(--roxy-muted,#71717a);margin-right:.4em}tbody tr.ak .glyph{color:var(--roxy-accent-ink,#b45309)}.num{font-variant-numeric:tabular-nums}.reversed{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);display:block}.meaning{white-space:normal;min-width:12rem}.meaning strong{font-weight:var(--roxy-weight-bold,600);display:block}.meaning p{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);line-height:var(--roxy-leading-normal,1.5);margin:0}`,\n\t];\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No chara karaka data</div>`;\n\t}\n\n\tprotected renderData(d: CharaKarakaResponse) {\n\t\tconst karakas = d.karakas ?? [];\n\t\tif (!karakas.length) return this.renderEmpty();\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Chara karakas\"><header class=\"head\"><h2 class=\"title\">Chara karakas</h2><p class=\"scheme\"><span class=\"scheme-chip\">${d.scheme ?? ''}</span> ${d.scheme ? (SCHEMES[d.scheme] ?? '') : ''}</p></header><div class=\"leads\"><div class=\"lead\"><span>Atmakaraka</span><strong>${d.atmakaraka ?? ''}</strong></div><div class=\"lead\"><span>Darakaraka</span><strong>${d.darakaraka ?? ''}</strong></div></div><div class=\"scroll\" tabindex=\"0\"><table role=\"table\"><caption class=\"roxy-sr-only\">Chara karakas in descending rank: each office, the graha holding it, its rashi, the degree it holds, the degree that earned the office, and what the office is read for.</caption><thead><tr><th scope=\"col\">Office</th><th scope=\"col\">Graha</th><th scope=\"col\">Rashi</th><th scope=\"col\">Degree</th><th scope=\"col\">Ranked on</th><th scope=\"col\">Read for</th></tr></thead><tbody>${karakas.map((k, i) => this.renderRow(k, i === 0))}</tbody></table></div></div>`;\n\t}\n\n\tprivate renderRow(k: Karaka, isFirst: boolean) {\n\t\tconst glyph = PLANET_GLYPH[capitalize(k.graha ?? '')] ?? '';\n\t\tconst signGlyph = SIGN_GLYPH[capitalize(k.rashi ?? '')] ?? '';\n\t\treturn html`<tr class=\"${isFirst ? 'ak' : ''}\"><td class=\"office\">${k.name ?? ''}${k.abbreviation ? html`<span class=\"abbr\">${k.abbreviation}</span>` : nothing}</td><td>${glyph ? html`<span class=\"glyph\">${glyph}</span>` : nothing}${k.graha ?? ''}</td><td>${signGlyph ? html`<span class=\"glyph\">${signGlyph}</span>` : nothing}${k.rashi ?? ''}</td><td class=\"num\">${formatNumber(k.degreeInRashi, 2)}</td><td class=\"num\">${formatNumber(k.rankingDegree, 2)} ${k.isReversed ? html`<span class=\"reversed\">measured from the end of the sign</span>` : nothing}</td><td class=\"meaning\"><strong>${k.meaning ?? ''}</strong> ${k.significations ? html`<p>${k.significations}</p>` : nothing}</td></tr>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-chara-karakas': RoxyCharaKarakas;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\n/**\n * Glyph per aspect, keyed by the hyphen-free canonical name.\n *\n * @remarks\n * These are the nine aspects Unicode itself defines as a set, in its Miscellaneous Symbols block note: `260C, 26BA, 2220, 26B9, 25A1, 25B3, 26BC, 26BB, 260D` for 0, 30, 45, 60, 90, 120, 135, 150 and 180 degrees. That is exactly the vocabulary the API returns, so every aspect resolves to a real glyph and none falls through to a truncated slug.\n *\n * Do not substitute the visually similar maths operators. An earlier revision used `\u22BB` XOR for quincunx and `\u22BC` NAND for semisextile, which are the two characters Unicode lists as cross-references FROM the real glyphs, and it had them the wrong way round: charts rendered a 150 degree quincunx with the 30 degree semisextile symbol and vice versa. An astrologer reads the glyph, not the tooltip.\n */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\tsemisextile: '\u26BA',\n\tsemisquare: '\u2220',\n\tsextile: '\u26B9',\n\tsquare: '\u25A1',\n\ttrine: '\u25B3',\n\tsesquiquadrate: '\u26BC',\n\tquincunx: '\u26BB',\n\topposition: '\u260D',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import {\n\ttype CSSResultGroup,\n\thtml,\n\tLitElement,\n\ttype PropertyValues,\n} from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { baseStyles } from './base-styles.js';\nimport { buildRequest, FetchController } from './fetch-controller.js';\nimport { MarkupDataController } from './markup-data.js';\n\n/**\n * Shared base for every data-driven Roxy component. Consolidates the things every component used to repeat by hand and adds the self-contained, drop-in behavior: controlled-mode hydration, an opt-in self-fetch (form, request, loading, error, empty), the typed `data` slot, and the render switch. A subclass implements one method, {@link RoxyDataElement.renderData}.\n *\n * @remarks\n * Two render modes, one component, which is the whole drop-in contract:\n *\n * - Controlled: a server (WordPress, JSX SSR, static HTML) fetches the response and injects it as a direct-child `<script type=\"application/json\" class=\"roxy-data\">`. {@link MarkupDataController} hydrates `data` from it on connect. No key reaches the browser. This is the path the WordPress plugin drives, and it is unchanged by the base class.\n * - Uncontrolled: no data is injected, but a `data-endpoint` and a `pk_` `publishable-key` are set. The component renders its own `<roxy-endpoint-form>` (an internal detail, never placed by the consumer), and on submit fetches through {@link FetchController}, which refuses any non-publishable key. The result populates `data` and the component renders it.\n *\n * The JavaScript `data` property always wins over markup, so a host that assigns `el.data = \u2026` after upgrade is authoritative.\n *\n * Self-fetch needs `<roxy-endpoint-form>` (and `<roxy-location-search>`) registered. The CDN bundle and the full `@roxyapi/ui` entry register everything; per-component ESM consumers that want self-fetch import the form component too.\n *\n * @example\n * ```ts\n * @customElement('roxy-dream-card')\n * export class RoxyDreamCard extends RoxyDataElement<GetDreamSymbolResponse> {\n * static styles = [baseStyles, css`.card { \u2026 }`];\n * protected renderData(d: GetDreamSymbolResponse) {\n * return html`<article class=\"card\">\u2026</article>`;\n * }\n * protected renderEmpty() {\n * return html`<div class=\"roxy-empty\" role=\"status\">No dream symbol</div>`;\n * }\n * }\n * ```\n */\nexport abstract class RoxyDataElement<T = unknown> extends LitElement {\n\tstatic styles: CSSResultGroup = [baseStyles];\n\n\t/** Typed RoxyAPI response. Assigned in JavaScript, hydrated from the roxy-data island, or set by a self-fetch. */\n\t@property({ attribute: false })\n\tdata: T | null = null;\n\n\t/** Endpoint path for self-fetch, e.g. \"astrology/natal-chart\" or \"dreams/symbols/{id}\". Empty disables self-fetch (controlled mode only). */\n\t@property({ type: String, attribute: 'data-endpoint' })\n\tendpoint = '';\n\n\t/** HTTP method for self-fetch. */\n\t@property({ type: String })\n\tmethod: 'GET' | 'POST' = 'POST';\n\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side. */\n\t@property({ type: String, attribute: 'publishable-key' })\n\tpublishableKey?: string;\n\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\t@property({ type: String, attribute: 'base-url' })\n\tbaseUrl?: string;\n\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\t@property({ type: String, attribute: 'spec-url' })\n\tspecUrl?: string;\n\n\t/** Consumer backend route that proxies the request (holds the secret key). When set, self-fetch POSTs the request here instead of calling RoxyAPI directly, so no key reaches the browser. The server-rendered (WordPress) path. */\n\t@property({ type: String, attribute: 'submit-url' })\n\tsubmitUrl?: string;\n\n\t/** Persist the last self-fetch form values in sessionStorage (keyed by endpoint) and prefill the form on reload. */\n\t@property({ type: Boolean })\n\tremember = false;\n\n\t/** Override the self-fetch form's submit-button label. Empty derives one from the endpoint. */\n\t@property({ type: String, attribute: 'submit-label' })\n\tsubmitLabel?: string;\n\n\t/** Render a small \"Spiritual data by RoxyAPI\" credit under a self-fetch or auto-mount result. Off by default; any value except \"off\"/\"false\" enables it. The one-tag widgets script turns it on unless data-attribution=\"off\". Never shown in controlled mode. */\n\t@property({ type: String })\n\tattribution?: string;\n\n\t/** True while an uncontrolled self-fetch is in flight. Public so {@link FetchController} can drive it. */\n\t@state()\n\tloading = false;\n\n\t/** Message from a failed self-fetch, or null. Public so {@link FetchController} can drive it. */\n\t@state()\n\terror: string | null = null;\n\n\t/**\n\t * True once a self-fetch (not a consumer-assigned or island-hydrated `data`) produced the current result. It gates the interactive result affordances, so controlled mode never shows an Edit control or a sticky picker.\n\t */\n\t@state()\n\tprivate selfFetched = false;\n\n\t/** True when the visitor asked to edit a self-fetch result, so the form is restored over the result. */\n\t@state()\n\tprivate editing = false;\n\n\t/** True when the last self-fetch form was a single-enum picker, so it stays visible above the result and a change refetches. */\n\t@state()\n\tprivate sticky = false;\n\n\t/** Last submitted form values (nested per group), kept in memory to restore the form on Edit and to prefill the sticky picker. */\n\tprivate lastValues?: Record<string, unknown>;\n\n\tprivate fetcher: FetchController<T>;\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Controlled mode: hydrate `data` from a direct-child roxy-data island when\n\t\t// no JS property was assigned. Keyless; the server already fetched.\n\t\tnew MarkupDataController<T>(this);\n\t\tthis.fetcher = new FetchController<T>(this);\n\t}\n\n\tprotected willUpdate(changed: PropertyValues): void {\n\t\tif (changed.has('publishableKey')) {\n\t\t\tthis.fetcher.publishableKey = this.publishableKey;\n\t\t}\n\t\tif (changed.has('baseUrl') && this.baseUrl) {\n\t\t\tthis.fetcher.baseUrl = this.baseUrl;\n\t\t}\n\t\tif (changed.has('submitUrl')) {\n\t\t\tthis.fetcher.submitUrl = this.submitUrl;\n\t\t}\n\t}\n\n\trender(): unknown {\n\t\tif (this.loading) return this.renderLoading();\n\t\tif (this.error != null) return this.renderError(this.error);\n\t\tif (this.data != null) {\n\t\t\t// Controlled mode (consumer-assigned or island-hydrated data) renders the\n\t\t\t// result alone, byte-identical to before: no picker, no Edit. The one\n\t\t\t// exception is the widgets auto-mount attrs-complete path, which assigns\n\t\t\t// data directly AND sets `attribution`; a real controlled consumer never\n\t\t\t// sets the attribute, so this stays byte-identical for them.\n\t\t\tif (!this.selfFetched) {\n\t\t\t\treturn this.showAttribution()\n\t\t\t\t\t? html`${this.renderData(this.data)}${this.renderAttribution()}`\n\t\t\t\t\t: this.renderData(this.data);\n\t\t\t}\n\t\t\tif (this.editing) return this.renderForm();\n\t\t\treturn this.renderResult(this.data);\n\t\t}\n\t\treturn this.renderNoData();\n\t}\n\n\t/** Render the populated response. The single method every component implements. */\n\tprotected abstract renderData(data: T): unknown;\n\n\t/**\n\t * A self-fetch result plus its re-query affordance. A single-enum form keeps its picker above the result so a new selection refetches (a sign switch is a new reading); any other form gets a compact Edit control that restores the form with the previous values.\n\t */\n\tprotected renderResult(data: T): unknown {\n\t\tconst body = this.sticky\n\t\t\t? html`${this.renderForm()}${this.renderData(data)}`\n\t\t\t: html`<div class=\"roxy-edit-bar\"><button type=\"button\" class=\"roxy-edit\" @click=\"${this.onEdit}\">Edit query</button></div>${this.renderData(data)}`;\n\t\treturn this.showAttribution()\n\t\t\t? html`${body}${this.renderAttribution()}`\n\t\t\t: body;\n\t}\n\n\tprivate onEdit = () => {\n\t\tthis.editing = true;\n\t};\n\n\t/** True when the attribution credit renders: the attribute is present and not explicitly disabled. */\n\tprivate showAttribution(): boolean {\n\t\treturn (\n\t\t\tthis.attribution != null &&\n\t\t\tthis.attribution !== 'off' &&\n\t\t\tthis.attribution !== 'false'\n\t\t);\n\t}\n\n\t/** Small muted credit under a self-fetch or auto-mount result. Reached only from the result path, so controlled mode never renders it. */\n\tprotected renderAttribution(): unknown {\n\t\treturn html`<div class=\"roxy-attribution\"><a href=\"https://roxyapi.com/?utm_source=widget&utm_medium=embed\" target=\"_blank\" rel=\"noopener\">Spiritual data by RoxyAPI</a></div>`;\n\t}\n\n\t/** The data-absent branch: the self-fetch form when an endpoint is set, otherwise the empty state. */\n\tprotected renderNoData(): unknown {\n\t\treturn this.endpoint ? this.renderForm() : this.renderEmpty();\n\t}\n\n\t/** Internal self-fetch form. Reuses the introspecting `<roxy-endpoint-form>`; the consumer never places it. */\n\tprotected renderForm(): unknown {\n\t\treturn html`<roxy-endpoint-form data-endpoint=\"${this.endpoint}\" method=\"${this.method}\" spec-url=\"${ifDefined(this.specUrl)}\" publishable-key=\"${ifDefined(this.publishableKey)}\" submit-label=\"${ifDefined(this.submitLabel)}\" lang=\"${ifDefined(this.effectiveLang())}\" .initialValues=\"${this.formInitialValues()}\" @roxy-submit=\"${this.onFormSubmit}\"></roxy-endpoint-form>`;\n\t}\n\n\t/** Prefill source for the form: the last submission (Edit / sticky refetch) wins over remembered storage. */\n\tprivate formInitialValues(): Record<string, unknown> | undefined {\n\t\treturn (\n\t\t\tthis.lastValues ?? (this.remember ? this.readRemembered() : undefined)\n\t\t);\n\t}\n\n\t/** Site-owner language from the element `lang` attribute (native accessor), routed to the API query on submit. */\n\tprivate effectiveLang(): string | undefined {\n\t\treturn this.lang || undefined;\n\t}\n\n\tprivate onFormSubmit = (e: Event) => {\n\t\tconst detail = (e as CustomEvent).detail as {\n\t\t\tvalues: Record<string, unknown>;\n\t\t\tqueryKeys?: string[];\n\t\t\tsticky?: boolean;\n\t\t};\n\t\tthis.lastValues = detail.values;\n\t\tthis.sticky = !!detail.sticky;\n\t\tthis.selfFetched = true;\n\t\tthis.editing = false;\n\t\tif (this.remember) this.writeRemembered(detail.values);\n\t\tvoid this.fetcher.run(\n\t\t\tbuildRequest(\n\t\t\t\tthis.endpoint,\n\t\t\t\tthis.method,\n\t\t\t\tdetail.values,\n\t\t\t\tdetail.queryKeys ?? [],\n\t\t\t),\n\t\t);\n\t};\n\n\t/** sessionStorage key for this component's remembered form values, scoped by endpoint. */\n\tprivate rememberKey(): string {\n\t\treturn `roxy-ui:form:${this.endpoint}`;\n\t}\n\n\tprivate readRemembered(): Record<string, unknown> | undefined {\n\t\ttry {\n\t\t\tconst raw = sessionStorage.getItem(this.rememberKey());\n\t\t\treturn raw ? (JSON.parse(raw) as Record<string, unknown>) : undefined;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate writeRemembered(values: Record<string, unknown>): void {\n\t\ttry {\n\t\t\tsessionStorage.setItem(this.rememberKey(), JSON.stringify(values));\n\t\t} catch {\n\t\t\t// Private mode / disabled storage: remembering is best-effort, never fatal.\n\t\t}\n\t}\n\n\t/** Terminal empty state. Subclasses override for a domain-specific message. */\n\tprotected renderEmpty(): unknown {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No data</div>`;\n\t}\n\n\t/** Loading placeholder shown during a self-fetch. */\n\tprotected renderLoading(): unknown {\n\t\treturn html`<div class=\"roxy-skeleton\" style=\"height:8rem\" role=\"status\" aria-label=\"Loading\"></div>`;\n\t}\n\n\t/** Error state shown when a self-fetch fails. Keeps the form in view so the request can be retried. */\n\tprotected renderError(message: string): unknown {\n\t\tconst banner = html`<div class=\"roxy-error\" role=\"alert\">${message}</div>`;\n\t\treturn this.endpoint ? html`${banner}${this.renderForm()}` : banner;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "/**\n * The one place the \"publishable key only\" rule lives. Every client-side fetch boundary ({@link ../components/location-search.ts}, {@link ./fetch-controller.ts}) calls through here so a secret or legacy unprefixed key is refused identically: no network call, the same visible message, the same `roxy-validation-error` event. Centralising it is what stops the two paths drifting, which is exactly how `<roxy-location-search>` used to warn-then-fetch a secret key while the controller fail-closed.\n */\n\n/** Canonical refusal message. Both fetch boundaries surface this exact wording. */\nexport const KEY_REFUSED_MESSAGE =\n\t'Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.';\n\n/** True when the key is a browser-safe `pk_` publishable key. */\nexport function isPublishableKey(key: string | undefined | null): boolean {\n\treturn !!key && key.startsWith('pk_');\n}\n\n/**\n * The fail-closed condition: a key is PRESENT and is NOT a `pk_` key. An absent key is not refused, so a keyless public call (a form-slotted city search with no key set) still proceeds; only a real secret/legacy token in the browser is stopped.\n */\nexport function keyIsRefused(key: string | undefined | null): boolean {\n\treturn !!key && !key.startsWith('pk_');\n}\n\n/**\n * Announce a refused key: dispatch the shared `roxy-validation-error` (bubbling, composed) and, when `warn` is set, log it once for the developer. The caller sets its own visible error state and skips the fetch; this only handles the parts both boundaries share.\n */\nexport function dispatchKeyRefusal(\n\thost: EventTarget,\n\topts: { warn?: boolean } = {},\n): void {\n\tif (opts.warn) console.warn(KEY_REFUSED_MESSAGE);\n\thost.dispatchEvent(\n\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\tdetail: { reason: 'possible-secret-key', message: KEY_REFUSED_MESSAGE },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t}),\n\t);\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport {\n\tdispatchKeyRefusal,\n\tKEY_REFUSED_MESSAGE,\n\tkeyIsRefused,\n} from './key-guard.js';\n\n/**\n * Host slots the controller drives. {@link RoxyDataElement} satisfies this, so the form mixin can attach a controller without the component wiring state by hand.\n *\n * @remarks\n * Intersected with `HTMLElement` because the controller dispatches events on the host. Lit's `ReactiveControllerHost` is the update-lifecycle contract only (`addController`, `requestUpdate`, `updateComplete`) and carries no DOM surface, even though every real host is a `LitElement` and therefore an `HTMLElement`. Declaring the DOM half is what the controller actually needs; it used to reach it through a `this.host as unknown as EventTarget` double cast instead, which asserted a capability the type never promised.\n */\ntype FetchHost<T> = ReactiveControllerHost &\n\tHTMLElement & {\n\t\tdata: T | null;\n\t\tloading: boolean;\n\t\terror: string | null;\n\t};\n\n/** Default RoxyAPI v2 origin. A component overrides it per instance via its `base-url` attribute. */\nconst DEFAULT_BASE_URL = 'https://roxyapi.com/api/v2';\n\n/** A single request the controller issues on the component's behalf. */\nexport interface RoxyRequest {\n\t/** Path under the API base, e.g. \"/dreams/symbols/water\" or \"/astrology/natal-chart\". */\n\tpath: string;\n\tmethod?: 'GET' | 'POST';\n\t/** JSON body for POST endpoints. */\n\tbody?: unknown;\n\t/** Query string parameters; nullish values are dropped. */\n\tquery?: Record<string, string | number | undefined>;\n}\n\n/**\n * Client-side fetch for uncontrolled (self-fetching) components: drives `host.data` / `host.loading` / `host.error` and cancels a stale request when a newer one starts or the host disconnects.\n *\n * @remarks\n * Security boundary. The only credential this ever sends is a `pk_` publishable key, which carries a server-side origin allowlist. A secret (`sk_`) or legacy unprefixed key is refused before any network call and surfaced as an error, so a server secret cannot leak into a browser request. This centralizes the guard that originated in `<roxy-location-search>` so every self-fetching component enforces it identically.\n *\n * Controlled-mode components never construct this. When a server injects the response as a `<script class=\"roxy-data\">` island, there is no key and no fetch, which is the path server-rendered consumers (WordPress, JSX SSR, static HTML) rely on.\n */\nexport class FetchController<T = unknown> implements ReactiveController {\n\tprivate readonly host: FetchHost<T>;\n\tprivate abort?: AbortController;\n\n\t/** Browser-safe publishable key. Set by the host from its `publishable-key` attribute. */\n\tpublishableKey?: string;\n\t/** API origin, overridable for self-hosted or proxied deployments. */\n\tbaseUrl = DEFAULT_BASE_URL;\n\t/**\n\t * Consumer backend route that holds the secret key. When set, the request is POSTed here as `{ path, method, body, query }` instead of called against RoxyAPI directly, so no key (publishable or secret) is sent from the browser. This is the canonical path for server-rendered hosts (WordPress); the backend proxies the request with its own `sk_` key and returns the JSON response.\n\t */\n\tsubmitUrl?: string;\n\n\tconstructor(host: FetchHost<T>) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostDisconnected() {\n\t\tthis.abort?.abort();\n\t\tthis.abort = undefined;\n\t}\n\n\t/**\n\t * Issue the request and resolve once `host.data` (success) or `host.error`\n\t * (failure) is set. A no-op return when a non-publishable key is present:\n\t * the error is already surfaced and nothing is sent.\n\t */\n\tasync run(req: RoxyRequest): Promise<void> {\n\t\t// submit-url proxy: no key leaves the browser; the consumer's backend holds it.\n\t\tif (!this.submitUrl && this.secretKeyRefused()) return;\n\t\tthis.abort?.abort();\n\t\tconst controller = new AbortController();\n\t\tthis.abort = controller;\n\t\tthis.host.loading = true;\n\t\tthis.host.error = null;\n\t\ttry {\n\t\t\tconst res = this.submitUrl\n\t\t\t\t? await fetch(this.submitUrl, {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\tAccept: 'application/json',\n\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: JSON.stringify(req),\n\t\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t\t})\n\t\t\t\t: await this.callApi(req, controller.signal);\n\t\t\tif (!res.ok) throw new Error(await this.readError(res));\n\t\t\tconst json = (await res.json()) as T;\n\t\t\tif (controller.signal.aborted) return;\n\t\t\tthis.host.data = json;\n\t\t} catch (err) {\n\t\t\tif ((err as { name?: string })?.name === 'AbortError') return;\n\t\t\tthis.host.error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (this.abort === controller) this.abort = undefined;\n\t\t\tif (!controller.signal.aborted) this.host.loading = false;\n\t\t}\n\t}\n\n\t/** Direct call against RoxyAPI with the publishable key (the no-backend path). */\n\tprivate callApi(req: RoxyRequest, signal: AbortSignal): Promise<Response> {\n\t\tconst url = new URL(`${this.baseUrl}${req.path}`);\n\t\tfor (const [k, v] of Object.entries(req.query ?? {})) {\n\t\t\tif (v != null) url.searchParams.set(k, String(v));\n\t\t}\n\t\tconst headers: Record<string, string> = { Accept: 'application/json' };\n\t\tif (this.publishableKey) headers['X-API-Key'] = this.publishableKey;\n\t\tif (req.body != null) headers['Content-Type'] = 'application/json';\n\t\treturn fetch(url, {\n\t\t\tmethod: req.method ?? 'GET',\n\t\t\theaders,\n\t\t\tbody: req.body != null ? JSON.stringify(req.body) : undefined,\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/** True when a key is set and it is not a browser-safe `pk_` publishable key. Surfaces the error and refuses to send, via the shared {@link keyIsRefused} guard so every fetch boundary fail-closes identically. */\n\tprivate secretKeyRefused(): boolean {\n\t\tif (!keyIsRefused(this.publishableKey)) return false;\n\t\tthis.host.error = KEY_REFUSED_MESSAGE;\n\t\tdispatchKeyRefusal(this.host);\n\t\treturn true;\n\t}\n\n\t/** Surface the `{ error, code }` message the API returns on failure, falling back to the status code. */\n\tprivate async readError(res: Response): Promise<string> {\n\t\ttry {\n\t\t\tconst body = (await res.json()) as { error?: string };\n\t\t\tif (body?.error) return body.error;\n\t\t} catch {\n\t\t\t// Non-JSON error body: fall through to the status line.\n\t\t}\n\t\treturn `Request failed (${res.status})`;\n\t}\n}\n\n/**\n * Translate flat form values into a {@link RoxyRequest} for an endpoint. The `{name}` segments in the endpoint template are substituted from the values and removed; the rest become the JSON body for POST or query parameters for GET. This is the spec-light request builder the base element uses to turn a `<roxy-endpoint-form>` submission into a self-fetch, so a component needs no per-endpoint glue.\n *\n * @param queryKeys - Names the spec declares as `in: query` for this operation, which `<roxy-endpoint-form>` reports on its `roxy-submit` event. A POST operation can still take query parameters (every localized endpoint takes `?lang=`), and sending one in the JSON body silently drops it, so those names are routed to the query string on POST as well as GET.\n */\nexport function buildRequest(\n\tendpoint: string,\n\tmethod: 'GET' | 'POST',\n\tvalues: Record<string, unknown>,\n\tqueryKeys: readonly string[] = [],\n): RoxyRequest {\n\tconst rest: Record<string, unknown> = { ...values };\n\tconst path = `/${endpoint.replace(/^\\//, '')}`.replace(\n\t\t/\\{([^}]+)\\}/g,\n\t\t(_match, name: string) => {\n\t\t\tconst v = rest[name];\n\t\t\tdelete rest[name];\n\t\t\treturn encodeURIComponent(String(v ?? ''));\n\t\t},\n\t);\n\tconst inQuery = new Set(queryKeys);\n\tconst query: Record<string, string | number | undefined> = {};\n\tconst body: Record<string, unknown> = {};\n\tfor (const [k, v] of Object.entries(rest)) {\n\t\tif (v === undefined || v === '') continue;\n\t\tif (method === 'GET' || inQuery.has(k)) query[k] = v as string | number;\n\t\telse body[k] = v;\n\t}\n\treturn { path, method, query, body: method === 'POST' ? body : undefined };\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * Serialize a RoxyAPI response for embedding inside an inline `<script type=\"application/json\" class=\"roxy-data\">`. This is the safe writer counterpart to {@link MarkupDataController}, the reader: server-rendered and cached consumers (WordPress, JSX SSR, static HTML) emit the script with this, and the component hydrates `data` from it on connect.\n *\n * @remarks\n * Use this instead of a bare `JSON.stringify`. A raw stringify of a response that contains the literal text `</script>` (common in long interpretation prose) closes the script element early, corrupting the page and creating an HTML-injection vector. This escapes the script-unsafe characters to their `\\uXXXX` JSON escapes, which `JSON.parse` restores to the original characters, so the value the component receives is identical to the response you passed.\n *\n * `<` is the load-bearing escape (it defeats `</script>` and `<!--`). `>` and `&` are escaped for defence in depth, and U+2028 / U+2029 because they are valid in JSON yet are line terminators in a `<script>` context and break some parsers. The escapes introduce only `\\uXXXX` sequences, so the replacements never feed each other and order is irrelevant.\n *\n * Pass the unwrapped RoxyAPI response, the same shape you would assign to `element.data`. Do not pass the SDK envelope (`{ data, error, request, response }`).\n *\n * @example\n * ```ts\n * import { serializeRoxyData } from '@roxyapi/ui';\n *\n * const { data } = await roxy.dreams.getDreamSymbol({ path: { id: 'water' } });\n * const html = `<roxy-dream-card><script type=\"application/json\" class=\"roxy-data\">${serializeRoxyData(data)}</script></roxy-dream-card>`;\n * ```\n */\nexport function serializeRoxyData(data: unknown): string {\n\treturn JSON.stringify(data)\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n\n/**\n * Build the complete `<script type=\"application/json\" class=\"roxy-data\">\u2026</script>` element a server nests inside a `roxy-*` component for the no-JavaScript hydration path. The payload is escaped via {@link serializeRoxyData}, so it is safe to drop straight into HTML output.\n *\n * @remarks\n * The element carries both `type=\"application/json\"` and `class=\"roxy-data\"` because {@link MarkupDataController} reads only a direct-child script that has both. Emit one of these inside the target component; the JavaScript `data` property still wins if it is later assigned.\n *\n * @example\n * ```ts\n * import { roxyDataScript } from '@roxyapi/ui';\n *\n * const { data } = await roxy.crystals.getCrystal({ path: { id: 'amethyst' } });\n * const html = `<roxy-crystal-grid>${roxyDataScript(data)}</roxy-crystal-grid>`;\n * ```\n */\nexport function roxyDataScript(data: unknown): string {\n\treturn `<script type=\"application/json\" class=\"${ROXY_DATA_CLASS}\">${serializeRoxyData(data)}</script>`;\n}\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn (\n\t\ts\n\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t\t// Split a trailing/embedded digit off a word so \"person1\" reads \"Person 1\"\n\t\t\t// and every group legend and field label spaces its ordinal.\n\t\t\t.replace(/([a-z])([0-9])/g, '$1 $2')\n\t\t\t.replace(/^\\w/, (c) => c.toUpperCase())\n\t);\n}\n", "/**\n * Display formatters for ISO timestamps and floats coming back from the API.\n * Every helper returns \"\" for nullish or unparseable input so it falls out of\n * template literals cleanly.\n */\n\nimport { capitalize, humanize } from './string.js';\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst BARE_TIME = /^\\d{2}:\\d{2}(:\\d{2})?$/;\n/** An ISO datetime with NO timezone designator: a wall clock, not an instant. */\nconst NAIVE_DATETIME = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?$/;\n\n/**\n * Resolve an API timestamp to a Date plus the timezone it must be RENDERED in.\n *\n * @remarks\n * The API returns chart times naive (`2026-07-13T04:36:00`): that is 04:36 in the CHART's timezone, not UTC and not the viewer's. A wall clock must read the same for every viewer on earth, so hora at sunrise says 04:36 in Tokyo and in Chicago alike.\n *\n * Handing a naive string to `new Date()` makes the runtime interpret it in the VIEWER's zone, which is a silent corruption whenever that wall clock lands in the viewer's DST gap. In America/New_York `2026-03-08T02:30:00` does not exist, so the clock jumps and it renders as `3:30 AM`. Pinning the wall clock to UTC, which has no DST and therefore no gap, preserves the digits exactly while Intl still applies the viewer's locale conventions.\n *\n * An offset-bearing timestamp (`...Z`, `...+05:30`) IS a real instant, so it keeps the normal behaviour and converts to the viewer's local time.\n */\nexport function resolveDisplayDate(input: string): {\n\td: Date;\n\ttimeZone?: string;\n} {\n\tconst naive = BARE_TIME.test(input)\n\t\t? `1970-01-01T${input}`\n\t\t: NAIVE_DATETIME.test(input)\n\t\t\t? input\n\t\t\t: null;\n\treturn naive\n\t\t? { d: new Date(`${naive}Z`), timeZone: 'UTC' }\n\t\t: { d: new Date(input) };\n}\n\nexport function formatTime(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (DATE_ONLY.test(input)) return '';\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(undefined, {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\thour12: true,\n\t\ttimeZone,\n\t});\n}\n\nexport function formatDate(input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(undefined, {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatTimeRange(\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(t.start);\n\tconst end = formatTime(t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\n/** Two dates as one label: `Jan 1, 2026 - Jan 7, 2026`. Falls back to whichever end parses when the other is absent. */\nexport function formatDateRange(start: unknown, end: unknown): string {\n\tconst a = formatDate(start);\n\tconst b = formatDate(end);\n\tif (a && b) return `${a} - ${b}`;\n\treturn a || b;\n}\n\n/**\n * Format a number, dropping trailing zeros in the FRACTIONAL part only: `2.50` becomes `2.5`, `2.0` becomes `2`, and `100` stays `100`.\n *\n * @remarks\n * The old implementation ran `.replace(/\\.?0+$/, '')` against the whole string, which happily ate zeros off the INTEGER when there was no decimal point. At `dp = 0` that meant `100` rendered as `1`, `90` as `9`, `20` as `2`, and `0` as the empty string. It shipped: a 100 percent tight stellium displayed as \"1% tight\", and an aspect of strength 100 as \"str 1\". Guard on the decimal point, and never strip from the integer side.\n *\n * @example\n * ```ts\n * formatNumber(100, 0); // '100'\n * formatNumber(2.5, 1); // '2.5'\n * formatNumber(2, 1); // '2'\n * formatNumber(0, 0); // '0'\n * ```\n */\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\tconst fixed = value.toFixed(dp);\n\treturn fixed.includes('.') ? fixed.replace(/\\.?0+$/, '') : fixed;\n}\n\nexport function formatPercent(value: unknown, dp = 1): string {\n\tconst n = formatNumber(value, dp);\n\treturn n ? `${n}%` : '';\n}\n\n/**\n * CSS class name per aspect type. Used by natal and synastry chart aspect\n * lines so the same color encoding (harmonious vs challenging) applies in\n * both wheels. Keys are lowercase canonical names, values are CSS class\n * suffixes the chart components define in their `:host` styles.\n */\nexport const ASPECT_CLASS: Record<string, string> = {\n\tconjunction: 'aspect-conjunction',\n\tsextile: 'aspect-sextile',\n\tsquare: 'aspect-square',\n\ttrine: 'aspect-trine',\n\topposition: 'aspect-opposition',\n};\n\n/**\n * Normalize the `type` field on an aspect entry to a lowercase, hyphen-separated canonical name (`SEMI_SEXTILE` and `SEMI SEXTILE` both become `semi-sextile`). Accepts any aspect-shaped object so both natal and synastry inter-aspect entries can share this.\n *\n * @remarks\n * Spaces are folded as well as underscores because the endpoints do not agree on the separator: aspects returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`. Handling only the underscore left the space form failing every {@link ASPECT_CLASS} and `ASPECT_SYMBOL` lookup, so the same aspect rendered hyphenated and correctly coloured in one component and space-separated in the neutral fallback colour in another.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '')\n\t\t.toLowerCase()\n\t\t.trim()\n\t\t.replace(/[\\s_]+/g, '-');\n}\n\n/**\n * Display label for an aspect: `SEMI_SEXTILE` -> `Semi-sextile`.\n *\n * The raw value is an API enum and the table column it lands in is read by practitioners, not parsers. {@link normalizeAspect} stays the lookup key for classes and glyphs; this is the human-facing form.\n */\nexport function formatAspectName(a: { type?: string }): string {\n\treturn capitalize(normalizeAspect(a));\n}\n\n/**\n * Display label for an ayanamsa identifier. `kp-newcomb` -> `KP Newcomb`.\n *\n * The raw values are API enums. KP is an initialism and must stay uppercase, which {@link humanize} alone cannot know, so the three known frames are mapped explicitly and anything else degrades to a humanized slug rather than rendering the enum.\n */\nconst AYANAMSA_LABEL: Record<string, string> = {\n\t'kp-newcomb': 'KP Newcomb',\n\t'kp-old': 'KP Old',\n\tlahiri: 'Lahiri',\n};\n\nexport function formatAyanamsa(type: unknown, degrees?: unknown): string {\n\tconst label =\n\t\ttypeof type === 'string' ? (AYANAMSA_LABEL[type] ?? humanize(type)) : '';\n\tconst deg =\n\t\ttypeof degrees === 'number' ? `${formatNumber(degrees, 2)}\\u00b0` : '';\n\tif (label && deg) return `${label} (${deg})`;\n\treturn label || deg;\n}\n\n/**\n * Date plus time in one label: `Jan 15, 1990, 2:30 PM`.\n *\n * @remarks\n * Components were concatenating a raw date and a raw time (`1990-01-15 \\u00b7 14:30:00`) while siblings rendered the same instant through {@link formatDate}. One helper keeps every card reading the same way.\n *\n * Birth details arrive as two fields rather than one timestamp, so `time` may be passed separately; it is merged into a naive datetime, which {@link formatDate} and {@link formatTime} pin to UTC so the wall clock renders identically for every viewer.\n *\n * @example\n * ```ts\n * formatDateTime('1990-01-15T14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('1990-01-15', '14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('1990-01-15'); // 'Jan 15, 1990'\n * ```\n */\nexport function formatDateTime(input: unknown, time?: unknown): string {\n\tconst merged =\n\t\ttypeof input === 'string' &&\n\t\tDATE_ONLY.test(input) &&\n\t\ttypeof time === 'string' &&\n\t\tBARE_TIME.test(time)\n\t\t\t? `${input}T${time}`\n\t\t\t: input;\n\tconst date = formatDate(merged);\n\tconst clock = formatTime(merged);\n\tif (date && clock) return `${date}, ${clock}`;\n\treturn date || clock;\n}\n"],
5
+ "mappings": "wMAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,WAAAC,MAAe,MACnC,OAAS,iBAAAC,MAAqB,oBCKvB,IAAMC,EAAuC,CACnD,IAAK,SACL,KAAM,SACN,QAAS,SACT,MAAO,SACP,MAAO,SACP,KAAM,SACN,QAAS,SACT,OAAQ,SACR,OAAQ,SACR,QAAS,SACT,MAAO,SACP,KAAM,SACN,KAAM,SACN,UAAW,MACX,MAAO,KACP,UAAW,SACX,UAAW,SACX,aAAc,SACd,aAAc,SACd,OAAQ,SACR,OAAQ,SACR,oBAAqB,QACtB,EAmBO,IAAMC,EAAqC,CACjD,MAAO,SACP,OAAQ,SACR,OAAQ,SACR,OAAQ,SACR,IAAK,SACL,MAAO,SACP,MAAO,SACP,QAAS,SACT,YAAa,SACb,UAAW,SACX,SAAU,SACV,OAAQ,QACT,EC7DA,OAEC,QAAAC,EACA,cAAAC,MAEM,MACP,OAAS,YAAAC,EAAU,SAAAC,MAAa,oBAChC,OAAS,aAAAC,MAAiB,+BCP1B,OAAS,OAAAC,MAAW,MAMb,IAAMC,EAAaD,67FCDnB,IAAME,EACZ,mIAUM,SAASC,EAAaC,EAAyC,CACrE,MAAO,CAAC,CAACA,GAAO,CAACA,EAAI,WAAW,KAAK,CACtC,CAKO,SAASC,EACfC,EACAC,EAA2B,CAAC,EACrB,CACHA,EAAK,MAAM,QAAQ,KAAKC,CA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"keyIsRefused", "key", "dispatchKeyRefusal", "host", "opts", "KEY_REFUSED_MESSAGE", "DEFAULT_BASE_URL", "FetchController", "host", "req", "controller", "res", "json", "err", "signal", "url", "k", "v", "headers", "keyIsRefused", "KEY_REFUSED_MESSAGE", "dispatchKeyRefusal", "body", "buildRequest", "endpoint", "method", "values", "queryKeys", "rest", "path", "_match", "name", "inQuery", "query", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "ROXY_DATA_CLASS", "text", "RoxyDataElement", "LitElement", "e", "detail", "buildRequest", "MarkupDataController", "FetchController", "baseStyles", "changed", "html", "data", "body", "ifDefined", "raw", "values", "message", "banner", "__decorateClass", "property", "state", "capitalize", "s", "formatNumber", "value", "dp", "fixed", "SCHEMES", "RoxyCharaKarakas", "RoxyDataElement", "html", "d", "karakas", "k", "i", "isFirst", "glyph", "PLANET_GLYPH", "capitalize", "signGlyph", "SIGN_GLYPH", "nothing", "formatNumber", "baseStyles", "css", "__decorateClass", "customElement"]
7
+ }
@@ -1,26 +1,31 @@
1
- import type { GetCurrentDashaResponse, GetMajorDashasResponse, GetPratyantardashasResponse, GetSookshmaDashasResponse, GetSubDashasResponse } from '../types/index.js';
1
+ import type { GetCurrentDashaResponse, GetMajorDashasResponse, GetPranaDashasResponse, GetPratyantardashasResponse, GetSookshmaDashasResponse, GetSubDashasResponse } from '../types/index.js';
2
2
  import { RoxyDataElement } from '../utils/base-element.js';
3
- type DashaData = GetCurrentDashaResponse | GetMajorDashasResponse | GetSubDashasResponse | GetPratyantardashasResponse | GetSookshmaDashasResponse;
3
+ type DashaData = GetCurrentDashaResponse | GetMajorDashasResponse | GetSubDashasResponse | GetPratyantardashasResponse | GetSookshmaDashasResponse | GetPranaDashasResponse;
4
4
  /**
5
5
  * Dasha timeline. Renders /vedic-astrology/dasha/{current,major,sub/{...}}.
6
6
  *
7
7
  * @remarks
8
- * Default mode shows the active mahadasha, antardasha and pratyantardasha with
9
- * the reading each one carries. `period="major"` draws the full 120-year
8
+ * Default mode shows all five active levels, mahadasha through prana, with the
9
+ * reading each one carries. `period="major"` draws the full 120-year
10
10
  * Vimshottari timeline; `period="sub"` draws the antardashas inside one
11
11
  * mahadasha and states which mahadasha they sit in, since an antardasha means
12
12
  * nothing without its parent lord.
13
+ *
14
+ * When the request asked for significators, each period also names the houses
15
+ * its lord acts on, in words taken from the response rather than from any table
16
+ * held here, so the words arrive in the language the caller requested.
13
17
  */
14
18
  export declare class RoxyDashaTimeline extends RoxyDataElement<DashaData> {
15
19
  static styles: import("lit").CSSResult[];
16
20
  /**
17
- * Which dasha endpoint fed this element. `sub`, `antara` and `sookshma` are the
18
- * three drill-down levels and render identically; they stay distinct because
19
- * each maps one-to-one onto its endpoint binding, which is what lets a widget
20
- * pick a level. The heading and the level LABELS come from the payload, not
21
- * from here, so a host that cannot set attributes still renders correctly.
21
+ * Which dasha endpoint fed this element. `sub`, `antara`, `sookshma` and
22
+ * `prana` are the four drill-down levels and render identically; they stay
23
+ * distinct because each maps one-to-one onto its endpoint binding, which is
24
+ * what lets a widget pick a level. The heading and the level LABELS come from
25
+ * the payload, not from here, so a host that cannot set attributes still
26
+ * renders correctly.
22
27
  */
23
- period: 'current' | 'major' | 'sub' | 'antara' | 'sookshma';
28
+ period: 'current' | 'major' | 'sub' | 'antara' | 'sookshma' | 'prana';
24
29
  /** Which panel is showing. Reset guarded in renderData when the data changes shape. */
25
30
  private view;
26
31
  protected renderEmpty(): import("lit").TemplateResult<1>;
@@ -67,9 +72,9 @@ export declare class RoxyDashaTimeline extends RoxyDataElement<DashaData> {
67
72
  private renderParentMahadasha;
68
73
  /**
69
74
  * Every reading the response carries, behind one exclusive accordion. Current
70
- * mode has four (mahadasha, antardasha, pratyantardasha, sookshma); drill-down
71
- * modes lead with the parent period reading, then the sub-period running now;
72
- * major mode shows the mahadasha running now.
75
+ * mode has five (mahadasha, antardasha, pratyantardasha, sookshma, prana);
76
+ * drill-down modes lead with the parent period reading, then the sub-period
77
+ * running now; major mode shows the mahadasha running now.
73
78
  */
74
79
  private readings;
75
80
  private renderCurrent;
@@ -1 +1 @@
1
- {"version":3,"file":"dasha-timeline.d.ts","sourceRoot":"","sources":["../../src/components/dasha-timeline.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,uBAAuB,EACvB,sBAAsB,EACtB,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAgB3D,KAAK,SAAS,GACX,uBAAuB,GACvB,sBAAsB,GACtB,oBAAoB,GACpB,2BAA2B,GAC3B,yBAAyB,CAAC;AAmD7B;;;;;;;;;GASG;AACH,qBACa,iBAAkB,SAAQ,eAAe,CAAC,SAAS,CAAC;IAChE,MAAM,CAAC,MAAM,4BAsJX;IAEF;;;;;;OAMG;IAEH,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,CAAa;IAExE,uFAAuF;IAEvF,OAAO,CAAC,IAAI,CAAiD;IAE7D,SAAS,CAAC,WAAW;IAIrB,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,SAAS;IAyFjC;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAkBvB;;;;;;;OAOG;IACH,OAAO,CAAC,SAAS;IAyCjB,OAAO,CAAC,WAAW;IAMnB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,OAAO;IAUf;;;;;;;;OAQG;IACH,OAAO,CAAC,qBAAqB;IAkB7B;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IA0ChB,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,cAAc;IAUtB,sFAAsF;IACtF,OAAO,CAAC,SAAS;IASjB;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,SAAS;CAgCjB;AA4CD,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,qBAAq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