@roxyapi/ui 0.17.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +3 -2
- package/README.md +3 -3
- package/components-catalog.json +126 -110
- package/dist/cdn/components/ashtakavarga-grid.js +1 -1
- package/dist/cdn/components/ashtakavarga-grid.js.map +2 -2
- package/dist/cdn/components/bodygraph.js +1 -1
- package/dist/cdn/components/bodygraph.js.map +2 -2
- package/dist/cdn/components/dasha-timeline.js +4 -4
- package/dist/cdn/components/dasha-timeline.js.map +4 -4
- package/dist/cdn/components/divisional-chart.js +1 -1
- package/dist/cdn/components/divisional-chart.js.map +2 -2
- package/dist/cdn/components/endpoint-form.js +1 -1
- package/dist/cdn/components/endpoint-form.js.map +1 -1
- package/dist/cdn/components/kp-chart.js +1 -1
- package/dist/cdn/components/kp-chart.js.map +2 -2
- package/dist/cdn/components/natal-chart.js +1 -1
- package/dist/cdn/components/natal-chart.js.map +2 -2
- package/dist/cdn/components/relocation-wheel.js +1 -1
- package/dist/cdn/components/relocation-wheel.js.map +2 -2
- package/dist/cdn/components/tarot-card.js +1 -1
- package/dist/cdn/components/tarot-card.js.map +2 -2
- package/dist/cdn/components/transits-table.js +1 -1
- package/dist/cdn/components/transits-table.js.map +2 -2
- package/dist/cdn/components/vedic-kundli.js +1 -1
- package/dist/cdn/components/vedic-kundli.js.map +2 -2
- package/dist/cdn/roxy-ui.js +74 -74
- package/dist/cdn/roxy-ui.js.map +3 -3
- package/dist/cdn/widgets.js +1 -1
- package/dist/components/ashtakavarga-grid.js +1 -1
- package/dist/components/ashtakavarga-grid.js.map +2 -2
- package/dist/components/bodygraph.js +1 -1
- package/dist/components/bodygraph.js.map +2 -2
- package/dist/components/dasha-timeline.d.ts +43 -8
- package/dist/components/dasha-timeline.d.ts.map +1 -1
- package/dist/components/dasha-timeline.js +1 -1
- package/dist/components/dasha-timeline.js.map +4 -4
- package/dist/components/divisional-chart.js +1 -1
- package/dist/components/divisional-chart.js.map +2 -2
- package/dist/components/endpoint-form.js +1 -1
- package/dist/components/endpoint-form.js.map +1 -1
- package/dist/components/kp-chart.js +1 -1
- package/dist/components/kp-chart.js.map +2 -2
- package/dist/components/natal-chart.js +1 -1
- package/dist/components/natal-chart.js.map +2 -2
- package/dist/components/relocation-wheel.js +1 -1
- package/dist/components/relocation-wheel.js.map +2 -2
- package/dist/components/tarot-card.js +1 -1
- package/dist/components/tarot-card.js.map +2 -2
- package/dist/components/transits-table.js +1 -1
- package/dist/components/transits-table.js.map +2 -2
- package/dist/components/vedic-kundli.js +1 -1
- package/dist/components/vedic-kundli.js.map +2 -2
- package/dist/generated/endpoint-bindings.d.ts.map +1 -1
- package/dist/index.cjs +42 -42
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +50 -50
- package/dist/index.js.map +3 -3
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.json +45 -45
- package/dist/schemas/post--vedic-astrology-dasha-current.json +1 -1
- package/dist/schemas/post--vedic-astrology-dasha-major.json +1 -1
- package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha-pratyantardasha.json +1 -0
- package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha.json +1 -0
- package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha.json +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.gen.d.ts +642 -2
- package/dist/types/types.gen.d.ts.map +1 -1
- package/dist/utils/tablist.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/dasha-timeline.ts +250 -50
- package/src/generated/endpoint-bindings.ts +16 -0
- package/src/manifest.ts +4 -2
- package/src/types/index.ts +1 -1
- package/src/types/types.gen.ts +652 -2
- package/src/utils/tablist.ts +7 -1
- package/src/version.ts +1 -1
package/dist/cdn/widgets.js
CHANGED
|
@@ -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}}},"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
|
|
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,2 +1,2 @@
|
|
|
1
|
-
var K=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var o=(d,r,e,t)=>{for(var a=t>1?void 0:t?_(r,e):r,l=d.length-1,i;l>=0;l--)(i=d[l])&&(a=(t?i(r,e,a):i(a))||a);return t&&a&&K(r,e,a),a};import{css as q,html as n,nothing as C}from"lit";import{customElement as z,state as j}from"lit/decorators.js";var T={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 u,LitElement as F}from"lit";import{property as h,state as f}from"lit/decorators.js";import{ifDefined as S}from"lit/directives/if-defined.js";import{css as B}from"lit";var v=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 x="Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.";function R(d){return!!d&&!d.startsWith("pk_")}function $(d,r={}){r.warn&&console.warn(x),d.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:"possible-secret-key",message:x},bubbles:!0,composed:!0}))}var I="https://roxyapi.com/api/v2",w=class{constructor(r){this.baseUrl=I;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 a=await t.json();if(e.signal.aborted)return;this.host.data=a}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[l,i]of Object.entries(r.query??{}))i!=null&&t.searchParams.set(l,String(i));let a={Accept:"application/json"};return this.publishableKey&&(a["X-API-Key"]=this.publishableKey),r.body!=null&&(a["Content-Type"]="application/json"),fetch(t,{method:r.method??"GET",headers:a,body:r.body!=null?JSON.stringify(r.body):void 0,signal:e})}secretKeyRefused(){return R(this.publishableKey)?(this.host.error=x,$(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 A(d,r,e,t=[]){let a={...e},l=`/${d.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(g,p)=>{let y=a[p];return delete a[p],encodeURIComponent(String(y??""))}),i=new Set(t),b={},c={};for(let[g,p]of Object.entries(a))p===void 0||p===""||(r==="GET"||i.has(g)?b[g]=p:c[g]=p);return{path:l,method:r,query:b,body:r==="POST"?c:void 0}}var M="roxy-data";function G(d){return d.nodeName==="SCRIPT"&&d.getAttribute("type")==="application/json"}var k=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(G(r)&&r.classList.contains(M))return r;return null}parse(r){if(r?.trim())try{return JSON.parse(r)}catch{return}}};var s=class extends F{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(A(this.endpoint,this.method,t.values,t.queryKeys??[]))};new k(this),this.fetcher=new w(this)}static{this.styles=[v]}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()?u`${this.renderData(this.data)}${this.renderAttribution()}`:this.renderData(this.data):this.renderNoData()}renderResult(e){let t=this.sticky?u`${this.renderForm()}${this.renderData(e)}`:u`<div class="roxy-edit-bar"><button type="button" class="roxy-edit" @click="${this.onEdit}">Edit query</button></div>${this.renderData(e)}`;return this.showAttribution()?u`${t}${this.renderAttribution()}`:t}showAttribution(){return this.attribution!=null&&this.attribution!=="off"&&this.attribution!=="false"}renderAttribution(){return u`<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 u`<roxy-endpoint-form data-endpoint="${this.endpoint}" method="${this.method}" spec-url="${S(this.specUrl)}" publishable-key="${S(this.publishableKey)}" submit-label="${S(this.submitLabel)}" lang="${S(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 u`<div class="roxy-empty" role="status">No data</div>`}renderLoading(){return u`<div class="roxy-skeleton" style="height:8rem" role="status" aria-label="Loading"></div>`}renderError(e){let t=u`<div class="roxy-error" role="alert">${e}</div>`;return this.endpoint?u`${t}${this.renderForm()}`:t}};o([h({attribute:!1})],s.prototype,"data",2),o([h({type:String,attribute:"data-endpoint"})],s.prototype,"endpoint",2),o([h({type:String})],s.prototype,"method",2),o([h({type:String,attribute:"publishable-key"})],s.prototype,"publishableKey",2),o([h({type:String,attribute:"base-url"})],s.prototype,"baseUrl",2),o([h({type:String,attribute:"spec-url"})],s.prototype,"specUrl",2),o([h({type:String,attribute:"submit-url"})],s.prototype,"submitUrl",2),o([h({type:Boolean})],s.prototype,"remember",2),o([h({type:String,attribute:"submit-label"})],s.prototype,"submitLabel",2),o([h({type:String})],s.prototype,"attribution",2),o([f()],s.prototype,"loading",2),o([f()],s.prototype,"error",2),o([f()],s.prototype,"selfFetched",2),o([f()],s.prototype,"editing",2),o([f()],s.prototype,"sticky",2);import{css as H,html as P,nothing as O}from"lit";var L=H`.roxy-tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);scrollbar-width:thin;gap:2px;min-width:0;display:flex;overflow-x:auto}.roxy-tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;flex-shrink:0;margin-bottom:-2px;font-family:inherit}.roxy-tab[aria-selected=true]{color:var(--roxy-accent-ink,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.roxy-tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.roxy-tab:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:4px}`;function E(d){let{items:r,active:e,onSelect:t,label:a,idPrefix:l,controls:i=!1}=d;return P`<div class="roxy-tablist" role="tablist" aria-label="${a}" @keydown="${c=>{if(c.key!=="ArrowRight"&&c.key!=="ArrowLeft")return;c.preventDefault();let g=r.findIndex(U=>U.id===e);if(g===-1)return;let p=c.key==="ArrowRight"?1:-1,y=r[(g+p+r.length)%r.length];if(!y)return;t(y.id);let N=c.currentTarget.getRootNode();requestAnimationFrame(()=>{N.querySelector(`#${l}-tab-${y.id}`)?.focus()})}}">${r.map(c=>P`<button type="button" class="roxy-tab" role="tab" id="${l}-tab-${c.id}" aria-selected="${e===c.id?"true":"false"}" aria-controls="${i&&e===c.id?`${l}-panel-${c.id}`:O}" tabindex="${e===c.id?"0":"-1"}" @click="${()=>t(c.id)}">${c.label}</button>`)}</div>`}var V=[{id:"sarva",label:"Sarvashtakavarga"},{id:"bhinna",label:"Bhinnashtakavarga"},{id:"reduced",label:"Reduced"},{id:"pinda",label:"Shodhya Pinda"}],m=class extends s{constructor(){super(...arguments);this.activeTab="sarva"}renderEmpty(){return n`<div class="roxy-empty" role="status">No ashtakavarga data</div>`}renderData(e){let t=e.signs??[];return n`<div class="wrap" aria-label="Ashtakavarga grid"><div class="head"><h2 class="title">Ashtakavarga</h2>${t.length?n`<p class="subtitle">${t.length} signs</p>`:C}</div>${E({items:V,active:this.activeTab,onSelect:a=>{this.activeTab=a},label:"Ashtakavarga views",idPrefix:"ashtakavarga",controls:!0})}<div id="ashtakavarga-panel-${this.activeTab}" role="tabpanel" aria-labelledby="ashtakavarga-tab-${this.activeTab}">${this.activeTab==="sarva"?this.renderSarva(t):this.activeTab==="bhinna"?this.renderBhinna(t):this.activeTab==="reduced"?this.renderReduced(t):this.renderPinda()}</div></div>`}bhinnaTier(e){return e<=1?"tier-1":e<=2?"tier-2":e<=3?"tier-3":e<=4?"tier-4":e<=5?"tier-5":e<=6?"tier-6":"tier-7"}sarvaTier(e){return e<=20?"tier-1":e<=24?"tier-2":e<=27?"tier-3":e<=29?"tier-4":e<=32?"tier-5":e<=36?"tier-6":"tier-7"}renderLegend(e){return n`<div class="legend"><span>Fewer bindus</span> <span class="legend-scale" aria-hidden="true">${[1,2,3,4,5,6,7].map(t=>n`<span class="legend-swatch tier-${t}"></span>`)} </span><span>More bindus</span> <span class="legend-note">${e}</span></div>`}renderSarva(e){let t=this.data?.sarvashtakavarga;return t?n`<div class="overflow-scroll"><table><caption class="roxy-sr-only">Sarvashtakavarga: each of the twelve signs and the bindus all planets contribute to it, with a grand total.</caption><thead><tr><th scope="col">Sign</th><th scope="col">Bindus</th></tr></thead><tbody>${e.map((a,l)=>{let i=t.bindus[l]??0;return n`<tr><td><div class="planet-cell"><span class="glyph" aria-hidden="true">${T[a]??""}</span> ${a}</div></td><td class="${`bindu-cell ${this.sarvaTier(i)}`}">${i}</td></tr>`})}</tbody><tfoot><tr class="total-row"><td>Total</td><td>${t.total}</td></tr></tfoot></table></div>${this.renderLegend("Under 25 is a weak sign, 25 to 29 average, 30 and above strong. The 12 signs always total 337.")}`:n`<p class="roxy-empty">No sarvashtakavarga data</p>`}renderBhinna(e){let t=this.data?.bhinnashtakavarga;return t?.length?n`${this.renderBinduGrid(e,t,"Bhinnashtakavarga: the bindus each planet scores in every one of the twelve signs, with a row total.")} ${this.renderLegend("Each planet scores 0 to 8 bindus per sign. 4 is the mid, 5 and above is strong support for that planet in that sign.")}`:n`<p class="roxy-empty">No bhinnashtakavarga data</p>`}renderReduced(e){let t=this.data?.reducedBhinnashtakavarga,a=this.data?.reducedSarvashtakavarga;return!t?.length&&!a?n`<p class="roxy-empty">No reduced ashtakavarga data</p>`:n`${this.renderBinduGrid(e,t??[],"Reduced Bhinnashtakavarga after Shodhana: the bindus each planet keeps in every one of the twelve signs, with a row total and a Reduced Sarvashtakavarga totals row.",a)} ${this.renderLegend("Bindus left after Trikona and Ekadipati Shodhana, the input to Shodhya Pinda. The Reduced SAV row totals the seven planets only, so it does not include the Lagna row above it.")}`}renderBinduGrid(e,t,a,l){return t.length?n`<div class="overflow-scroll"><table class="bhinna-table"><caption class="roxy-sr-only">${a}</caption><thead><tr><th scope="col">Planet</th>${e.map(i=>n`<th scope="col" title="${i}">${T[i]??i.slice(0,2)}</th>`)}<th scope="col">Total</th></tr></thead><tbody>${t.map(i=>n`<tr><td>${i.planet}</td>${i.bindus.map(b=>n`<td class="${`bindu-cell ${this.bhinnaTier(b)}`}">${b}</td>`)}<td>${i.total}</td></tr>`)}</tbody>${l?n`<tfoot><tr class="total-row"><td>Reduced SAV</td>${e.map((i,b)=>n`<td>${l.bindus[b]??0}</td>`)}<td>${l.total}</td></tr></tfoot>`:C}</table></div>`:n`<p class="roxy-empty">No bindu data</p>`}renderPinda(){let e=this.data?.shodhyaPinda;return e?.length?n`<div class="overflow-scroll"><table><caption class="roxy-sr-only">Shodhya Pinda: each planet with its Rashi Pinda, Graha Pinda and Shodhya Pinda strength scores.</caption><thead><tr><th scope="col">Planet</th><th scope="col">Rashi Pinda</th><th scope="col">Graha Pinda</th><th scope="col">Shodhya Pinda</th></tr></thead><tbody>${e.map(t=>n`<tr><td>${t.planet}</td><td>${t.rashiPinda}</td><td>${t.grahaPinda}</td><td>${t.shodhyaPinda}</td></tr>`)}</tbody></table></div>`:n`<p class="roxy-empty">No shodhya pinda data</p>`}};m.styles=[v,L,q`.wrap{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);grid-template-columns:minmax(0,1fr);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}.overflow-scroll{-webkit-overflow-scrolling:touch;min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:center}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:.06em}td:first-child,th:first-child{text-align:left}.glyph{margin-right:3px;font-size:1.1em;line-height:1}.planet-cell{white-space:nowrap;align-items:center;gap:4px;display:flex}.total-row td{font-weight:var(--roxy-weight-bold,600);border-top:2px solid var(--roxy-border,#e4e4e7);border-bottom:none}.bindu-cell{border-radius:var(--roxy-radius-sm,4px);font-weight:var(--roxy-weight-bold,600);font-variant-numeric:tabular-nums;min-width:2rem;color:var(--roxy-fg,currentColor)}.tier-1{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 30%, transparent)}.tier-2{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 17%, transparent)}.tier-3{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 7%, transparent)}.tier-4{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 45%, transparent)}.tier-5{background:color-mix(in srgb, var(--roxy-success,#16a34a) 16%, transparent)}.tier-6{background:color-mix(in srgb, var(--roxy-success,#16a34a) 32%, transparent)}.tier-7{background:color-mix(in srgb, var(--roxy-success,#16a34a) 50%, transparent)}.legend{align-items:center;gap:var(--roxy-space-xs,.25rem) var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);flex-wrap:wrap;display:flex}.legend-scale{gap:2px;display:flex}.legend-swatch{border-radius:2px;width:16px;height:10px}.legend-note{flex:12rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:5rem}@container (width<=480px){.bhinna-table th,.bhinna-table td{font-size:var(--roxy-text-xs,.75rem);padding:.3rem .35rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:3.5rem}.bindu-cell{min-width:1.5rem}}.overflow-scroll{-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%);mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%)}`],o([j()],m.prototype,"activeTab",2),m=o([z("roxy-ashtakavarga-grid")],m);export{m as RoxyAshtakavargaGrid};
|
|
1
|
+
var K=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var o=(d,r,e,t)=>{for(var a=t>1?void 0:t?_(r,e):r,l=d.length-1,i;l>=0;l--)(i=d[l])&&(a=(t?i(r,e,a):i(a))||a);return t&&a&&K(r,e,a),a};import{css as q,html as n,nothing as C}from"lit";import{customElement as z,state as j}from"lit/decorators.js";var T={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 u,LitElement as F}from"lit";import{property as h,state as f}from"lit/decorators.js";import{ifDefined as S}from"lit/directives/if-defined.js";import{css as B}from"lit";var v=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 x="Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.";function R(d){return!!d&&!d.startsWith("pk_")}function $(d,r={}){r.warn&&console.warn(x),d.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:"possible-secret-key",message:x},bubbles:!0,composed:!0}))}var I="https://roxyapi.com/api/v2",w=class{constructor(r){this.baseUrl=I;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 a=await t.json();if(e.signal.aborted)return;this.host.data=a}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[l,i]of Object.entries(r.query??{}))i!=null&&t.searchParams.set(l,String(i));let a={Accept:"application/json"};return this.publishableKey&&(a["X-API-Key"]=this.publishableKey),r.body!=null&&(a["Content-Type"]="application/json"),fetch(t,{method:r.method??"GET",headers:a,body:r.body!=null?JSON.stringify(r.body):void 0,signal:e})}secretKeyRefused(){return R(this.publishableKey)?(this.host.error=x,$(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 A(d,r,e,t=[]){let a={...e},l=`/${d.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(g,p)=>{let y=a[p];return delete a[p],encodeURIComponent(String(y??""))}),i=new Set(t),b={},c={};for(let[g,p]of Object.entries(a))p===void 0||p===""||(r==="GET"||i.has(g)?b[g]=p:c[g]=p);return{path:l,method:r,query:b,body:r==="POST"?c:void 0}}var M="roxy-data";function G(d){return d.nodeName==="SCRIPT"&&d.getAttribute("type")==="application/json"}var k=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(G(r)&&r.classList.contains(M))return r;return null}parse(r){if(r?.trim())try{return JSON.parse(r)}catch{return}}};var s=class extends F{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(A(this.endpoint,this.method,t.values,t.queryKeys??[]))};new k(this),this.fetcher=new w(this)}static{this.styles=[v]}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()?u`${this.renderData(this.data)}${this.renderAttribution()}`:this.renderData(this.data):this.renderNoData()}renderResult(e){let t=this.sticky?u`${this.renderForm()}${this.renderData(e)}`:u`<div class="roxy-edit-bar"><button type="button" class="roxy-edit" @click="${this.onEdit}">Edit query</button></div>${this.renderData(e)}`;return this.showAttribution()?u`${t}${this.renderAttribution()}`:t}showAttribution(){return this.attribution!=null&&this.attribution!=="off"&&this.attribution!=="false"}renderAttribution(){return u`<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 u`<roxy-endpoint-form data-endpoint="${this.endpoint}" method="${this.method}" spec-url="${S(this.specUrl)}" publishable-key="${S(this.publishableKey)}" submit-label="${S(this.submitLabel)}" lang="${S(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 u`<div class="roxy-empty" role="status">No data</div>`}renderLoading(){return u`<div class="roxy-skeleton" style="height:8rem" role="status" aria-label="Loading"></div>`}renderError(e){let t=u`<div class="roxy-error" role="alert">${e}</div>`;return this.endpoint?u`${t}${this.renderForm()}`:t}};o([h({attribute:!1})],s.prototype,"data",2),o([h({type:String,attribute:"data-endpoint"})],s.prototype,"endpoint",2),o([h({type:String})],s.prototype,"method",2),o([h({type:String,attribute:"publishable-key"})],s.prototype,"publishableKey",2),o([h({type:String,attribute:"base-url"})],s.prototype,"baseUrl",2),o([h({type:String,attribute:"spec-url"})],s.prototype,"specUrl",2),o([h({type:String,attribute:"submit-url"})],s.prototype,"submitUrl",2),o([h({type:Boolean})],s.prototype,"remember",2),o([h({type:String,attribute:"submit-label"})],s.prototype,"submitLabel",2),o([h({type:String})],s.prototype,"attribution",2),o([f()],s.prototype,"loading",2),o([f()],s.prototype,"error",2),o([f()],s.prototype,"selfFetched",2),o([f()],s.prototype,"editing",2),o([f()],s.prototype,"sticky",2);import{css as H,html as P,nothing as O}from"lit";var L=H`.roxy-tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);scrollbar-width:thin;gap:2px;min-width:0;display:flex;overflow-x:auto}.roxy-tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;flex-shrink:0;margin-bottom:-2px;font-family:inherit}.roxy-tab[aria-selected=true]{color:var(--roxy-accent-ink,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.roxy-tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.roxy-tab:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:-2px;border-radius:4px}`;function E(d){let{items:r,active:e,onSelect:t,label:a,idPrefix:l,controls:i=!1}=d;return P`<div class="roxy-tablist" role="tablist" aria-label="${a}" @keydown="${c=>{if(c.key!=="ArrowRight"&&c.key!=="ArrowLeft")return;c.preventDefault();let g=r.findIndex(U=>U.id===e);if(g===-1)return;let p=c.key==="ArrowRight"?1:-1,y=r[(g+p+r.length)%r.length];if(!y)return;t(y.id);let N=c.currentTarget.getRootNode();requestAnimationFrame(()=>{N.querySelector(`#${l}-tab-${y.id}`)?.focus()})}}">${r.map(c=>P`<button type="button" class="roxy-tab" role="tab" id="${l}-tab-${c.id}" aria-selected="${e===c.id?"true":"false"}" aria-controls="${i&&e===c.id?`${l}-panel-${c.id}`:O}" tabindex="${e===c.id?"0":"-1"}" @click="${()=>t(c.id)}">${c.label}</button>`)}</div>`}var V=[{id:"sarva",label:"Sarvashtakavarga"},{id:"bhinna",label:"Bhinnashtakavarga"},{id:"reduced",label:"Reduced"},{id:"pinda",label:"Shodhya Pinda"}],m=class extends s{constructor(){super(...arguments);this.activeTab="sarva"}renderEmpty(){return n`<div class="roxy-empty" role="status">No ashtakavarga data</div>`}renderData(e){let t=e.signs??[];return n`<div class="wrap" aria-label="Ashtakavarga grid"><div class="head"><h2 class="title">Ashtakavarga</h2>${t.length?n`<p class="subtitle">${t.length} signs</p>`:C}</div>${E({items:V,active:this.activeTab,onSelect:a=>{this.activeTab=a},label:"Ashtakavarga views",idPrefix:"ashtakavarga",controls:!0})}<div id="ashtakavarga-panel-${this.activeTab}" role="tabpanel" aria-labelledby="ashtakavarga-tab-${this.activeTab}">${this.activeTab==="sarva"?this.renderSarva(t):this.activeTab==="bhinna"?this.renderBhinna(t):this.activeTab==="reduced"?this.renderReduced(t):this.renderPinda()}</div></div>`}bhinnaTier(e){return e<=1?"tier-1":e<=2?"tier-2":e<=3?"tier-3":e<=4?"tier-4":e<=5?"tier-5":e<=6?"tier-6":"tier-7"}sarvaTier(e){return e<=20?"tier-1":e<=24?"tier-2":e<=27?"tier-3":e<=29?"tier-4":e<=32?"tier-5":e<=36?"tier-6":"tier-7"}renderLegend(e){return n`<div class="legend"><span>Fewer bindus</span> <span class="legend-scale" aria-hidden="true">${[1,2,3,4,5,6,7].map(t=>n`<span class="legend-swatch tier-${t}"></span>`)} </span><span>More bindus</span> <span class="legend-note">${e}</span></div>`}renderSarva(e){let t=this.data?.sarvashtakavarga;return t?n`<div class="overflow-scroll"><table><caption class="roxy-sr-only">Sarvashtakavarga: each of the twelve signs and the bindus all planets contribute to it, with a grand total.</caption><thead><tr><th scope="col">Sign</th><th scope="col">Bindus</th></tr></thead><tbody>${e.map((a,l)=>{let i=t.bindus[l]??0;return n`<tr><td><div class="planet-cell"><span class="glyph" aria-hidden="true">${T[a]??""}</span> ${a}</div></td><td class="${`bindu-cell ${this.sarvaTier(i)}`}">${i}</td></tr>`})}</tbody><tfoot><tr class="total-row"><td>Total</td><td>${t.total}</td></tr></tfoot></table></div>${this.renderLegend("Under 25 is a weak sign, 25 to 29 average, 30 and above strong. The 12 signs always total 337.")}`:n`<p class="roxy-empty">No sarvashtakavarga data</p>`}renderBhinna(e){let t=this.data?.bhinnashtakavarga;return t?.length?n`${this.renderBinduGrid(e,t,"Bhinnashtakavarga: the bindus each planet scores in every one of the twelve signs, with a row total.")} ${this.renderLegend("Each planet scores 0 to 8 bindus per sign. 4 is the mid, 5 and above is strong support for that planet in that sign.")}`:n`<p class="roxy-empty">No bhinnashtakavarga data</p>`}renderReduced(e){let t=this.data?.reducedBhinnashtakavarga,a=this.data?.reducedSarvashtakavarga;return!t?.length&&!a?n`<p class="roxy-empty">No reduced ashtakavarga data</p>`:n`${this.renderBinduGrid(e,t??[],"Reduced Bhinnashtakavarga after Shodhana: the bindus each planet keeps in every one of the twelve signs, with a row total and a Reduced Sarvashtakavarga totals row.",a)} ${this.renderLegend("Bindus left after Trikona and Ekadipati Shodhana, the input to Shodhya Pinda. The Reduced SAV row totals the seven planets only, so it does not include the Lagna row above it.")}`}renderBinduGrid(e,t,a,l){return t.length?n`<div class="overflow-scroll"><table class="bhinna-table"><caption class="roxy-sr-only">${a}</caption><thead><tr><th scope="col">Planet</th>${e.map(i=>n`<th scope="col" title="${i}">${T[i]??i.slice(0,2)}</th>`)}<th scope="col">Total</th></tr></thead><tbody>${t.map(i=>n`<tr><td>${i.planet}</td>${i.bindus.map(b=>n`<td class="${`bindu-cell ${this.bhinnaTier(b)}`}">${b}</td>`)}<td>${i.total}</td></tr>`)}</tbody>${l?n`<tfoot><tr class="total-row"><td>Reduced SAV</td>${e.map((i,b)=>n`<td>${l.bindus[b]??0}</td>`)}<td>${l.total}</td></tr></tfoot>`:C}</table></div>`:n`<p class="roxy-empty">No bindu data</p>`}renderPinda(){let e=this.data?.shodhyaPinda;return e?.length?n`<div class="overflow-scroll"><table><caption class="roxy-sr-only">Shodhya Pinda: each planet with its Rashi Pinda, Graha Pinda and Shodhya Pinda strength scores.</caption><thead><tr><th scope="col">Planet</th><th scope="col">Rashi Pinda</th><th scope="col">Graha Pinda</th><th scope="col">Shodhya Pinda</th></tr></thead><tbody>${e.map(t=>n`<tr><td>${t.planet}</td><td>${t.rashiPinda}</td><td>${t.grahaPinda}</td><td>${t.shodhyaPinda}</td></tr>`)}</tbody></table></div>`:n`<p class="roxy-empty">No shodhya pinda data</p>`}};m.styles=[v,L,q`.wrap{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);grid-template-columns:minmax(0,1fr);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}.overflow-scroll{-webkit-overflow-scrolling:touch;min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:center}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:.06em}td:first-child,th:first-child{text-align:left}.glyph{margin-right:3px;font-size:1.1em;line-height:1}.planet-cell{white-space:nowrap;align-items:center;gap:4px;display:flex}.total-row td{font-weight:var(--roxy-weight-bold,600);border-top:2px solid var(--roxy-border,#e4e4e7);border-bottom:none}.bindu-cell{border-radius:var(--roxy-radius-sm,4px);font-weight:var(--roxy-weight-bold,600);font-variant-numeric:tabular-nums;min-width:2rem;color:var(--roxy-fg,currentColor)}.tier-1{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 30%, transparent)}.tier-2{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 17%, transparent)}.tier-3{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 7%, transparent)}.tier-4{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 45%, transparent)}.tier-5{background:color-mix(in srgb, var(--roxy-success,#16a34a) 16%, transparent)}.tier-6{background:color-mix(in srgb, var(--roxy-success,#16a34a) 32%, transparent)}.tier-7{background:color-mix(in srgb, var(--roxy-success,#16a34a) 50%, transparent)}.legend{align-items:center;gap:var(--roxy-space-xs,.25rem) var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);flex-wrap:wrap;display:flex}.legend-scale{gap:2px;display:flex}.legend-swatch{border-radius:2px;width:16px;height:10px}.legend-note{flex:12rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:5rem}@container (width<=480px){.bhinna-table th,.bhinna-table td{font-size:var(--roxy-text-xs,.75rem);padding:.3rem .35rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:3.5rem}.bindu-cell{min-width:1.5rem}}.overflow-scroll{-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%);mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%)}`],o([j()],m.prototype,"activeTab",2),m=o([z("roxy-ashtakavarga-grid")],m);export{m as RoxyAshtakavargaGrid};
|
|
2
2
|
//# sourceMappingURL=ashtakavarga-grid.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/ashtakavarga-grid.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/tablist.ts"],
|
|
4
|
-
"sourcesContent": ["import { css, html, nothing } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\nimport { SIGN_GLYPH } from '../tokens/index.js';\nimport type { AshtakavargaResponse } from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport {\n\trenderTablist,\n\ttype TablistItem,\n\ttablistStyles,\n} from '../utils/tablist.js';\n\ntype Tab = 'sarva' | 'bhinna' | 'reduced' | 'pinda';\n\nconst TABS: ReadonlyArray<TablistItem<Tab>> = [\n\t{ id: 'sarva', label: 'Sarvashtakavarga' },\n\t{ id: 'bhinna', label: 'Bhinnashtakavarga' },\n\t{ id: 'reduced', label: 'Reduced' },\n\t{ id: 'pinda', label: 'Shodhya Pinda' },\n];\n\ntype Signs = AshtakavargaResponse['signs'];\ntype BhinnaRow = AshtakavargaResponse['bhinnashtakavarga'][number];\ntype SarvaRow = AshtakavargaResponse['sarvashtakavarga'];\n\n/**\n * Ashtakavarga grid: Sarvashtakavarga, Bhinnashtakavarga, the Shodhana-reduced\n * grid, and Shodhya Pinda. Pass `data` from /vedic-astrology/ashtakavarga.\n *\n * @remarks\n * Bindus are benefic points, so MORE is better in every view here. The colour\n * ramp is therefore diverging, not a single hot hue: a weak count tints toward\n * --roxy-heat (which resolves to the danger token), the classical average stays\n * neutral, a strong count tints toward --roxy-success, and each tab states its\n * own scale in a legend. The previous single-hue ramp painted the best signs the\n * most alarming shade, the exact opposite of what the numbers mean.\n */\n@customElement('roxy-ashtakavarga-grid')\nexport class RoxyAshtakavargaGrid extends RoxyDataElement<AshtakavargaResponse> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\ttablistStyles,\n\t\tcss`.wrap{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);grid-template-columns:minmax(0,1fr);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}.overflow-scroll{-webkit-overflow-scrolling:touch;min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:center}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:.06em}td:first-child,th:first-child{text-align:left}.glyph{margin-right:3px;font-size:1.1em;line-height:1}.planet-cell{white-space:nowrap;align-items:center;gap:4px;display:flex}.total-row td{font-weight:var(--roxy-weight-bold,600);border-top:2px solid var(--roxy-border,#e4e4e7);border-bottom:none}.bindu-cell{border-radius:var(--roxy-radius-sm,4px);font-weight:var(--roxy-weight-bold,600);font-variant-numeric:tabular-nums;min-width:2rem;color:var(--roxy-fg,currentColor)}.tier-1{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 30%, transparent)}.tier-2{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 17%, transparent)}.tier-3{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 7%, transparent)}.tier-4{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 45%, transparent)}.tier-5{background:color-mix(in srgb, var(--roxy-success,#16a34a) 16%, transparent)}.tier-6{background:color-mix(in srgb, var(--roxy-success,#16a34a) 32%, transparent)}.tier-7{background:color-mix(in srgb, var(--roxy-success,#16a34a) 50%, transparent)}.legend{align-items:center;gap:var(--roxy-space-xs,.25rem) var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);flex-wrap:wrap;display:flex}.legend-scale{gap:2px;display:flex}.legend-swatch{border-radius:2px;width:16px;height:10px}.legend-note{flex:12rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:5rem}@container (width<=480px){.bhinna-table th,.bhinna-table td{font-size:var(--roxy-text-xs,.75rem);padding:.3rem .35rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:3.5rem}.bindu-cell{min-width:1.5rem}}.overflow-scroll{-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%);mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%)}`,\n\t];\n\n\t@state()\n\tactiveTab: Tab = 'sarva';\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No ashtakavarga data</div>`;\n\t}\n\n\tprotected renderData(d: AshtakavargaResponse) {\n\t\tconst signs = d.signs ?? [];\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Ashtakavarga grid\"><div class=\"head\"><h2 class=\"title\">Ashtakavarga</h2>${\n\t\t\t\t\tsigns.length\n\t\t\t\t\t\t? html`<p class=\"subtitle\">${signs.length} signs</p>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div>${renderTablist({\n\t\t\t\titems: TABS,\n\t\t\t\tactive: this.activeTab,\n\t\t\t\tonSelect: (id) => {\n\t\t\t\t\tthis.activeTab = id;\n\t\t\t\t},\n\t\t\t\tlabel: 'Ashtakavarga views',\n\t\t\t\tidPrefix: 'ashtakavarga',\n\t\t\t\tcontrols: true,\n\t\t\t})}<div id=\"ashtakavarga-panel-${this.activeTab}\" role=\"tabpanel\" aria-labelledby=\"ashtakavarga-tab-${this.activeTab}\">${\n\t\t\t\t\tthis.activeTab === 'sarva'\n\t\t\t\t\t\t? this.renderSarva(signs)\n\t\t\t\t\t\t: this.activeTab === 'bhinna'\n\t\t\t\t\t\t\t? this.renderBhinna(signs)\n\t\t\t\t\t\t\t: this.activeTab === 'reduced'\n\t\t\t\t\t\t\t\t? this.renderReduced(signs)\n\t\t\t\t\t\t\t\t: this.renderPinda()\n\t\t\t\t}</div></div>`;\n\t}\n\n\t/**\n\t * Bhinna bindus per planet per sign run 0..8 (one 0/1 contribution from each\n\t * of the 8 reference points). 4 is the mid, so it holds the neutral tier and\n\t * anything above it reads as support. The reduced grid uses the same 0..8\n\t * units, so it shares this scale.\n\t */\n\tprivate bhinnaTier(count: number): string {\n\t\tif (count <= 1) return 'tier-1';\n\t\tif (count <= 2) return 'tier-2';\n\t\tif (count <= 3) return 'tier-3';\n\t\tif (count <= 4) return 'tier-4';\n\t\tif (count <= 5) return 'tier-5';\n\t\tif (count <= 6) return 'tier-6';\n\t\treturn 'tier-7';\n\t}\n\n\t/**\n\t * Sarva bindus per sign are the column total across the 7 planets. The grand\n\t * total is always 337, so the classical average is 337/12 = 28.08 and the\n\t * bands used by readers are: under 25 weak, 25 to 29 average, 30 and above\n\t * strong, with the highest signs carrying transits best. The tiers follow\n\t * those bands rather than an even split, so 28 sits on the neutral tier.\n\t */\n\tprivate sarvaTier(count: number): string {\n\t\tif (count <= 20) return 'tier-1';\n\t\tif (count <= 24) return 'tier-2';\n\t\tif (count <= 27) return 'tier-3';\n\t\tif (count <= 29) return 'tier-4';\n\t\tif (count <= 32) return 'tier-5';\n\t\tif (count <= 36) return 'tier-6';\n\t\treturn 'tier-7';\n\t}\n\n\t/**\n\t * The scale, stated. Without this a reader has to guess whether a saturated\n\t * cell is good or bad, and in a bindu grid the answer is always \"good\".\n\t */\n\tprivate renderLegend(note: string) {\n\t\treturn html`<div class=\"legend\"><span>Fewer bindus</span> <span class=\"legend-scale\" aria-hidden=\"true\">${[1, 2, 3, 4, 5, 6, 7].map(\n\t\t\t\t\t(t) => html`<span class=\"legend-swatch tier-${t}\"></span>`,\n\t\t\t\t)} </span><span>More bindus</span> <span class=\"legend-note\">${note}</span></div>`;\n\t}\n\n\tprivate renderSarva(signs: Signs) {\n\t\tconst sav = this.data?.sarvashtakavarga;\n\t\tif (!sav) return html`<p class=\"roxy-empty\">No sarvashtakavarga data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table><caption class=\"roxy-sr-only\">Sarvashtakavarga: each of the twelve signs and the bindus all planets contribute to it, with a grand total.</caption><thead><tr><th scope=\"col\">Sign</th><th scope=\"col\">Bindus</th></tr></thead><tbody>${signs.map((sign, i) => {\n\t\t\t\t\t\t\tconst count = sav.bindus[i] ?? 0;\n\t\t\t\t\t\t\treturn html`<tr><td><div class=\"planet-cell\"><span class=\"glyph\" aria-hidden=\"true\">${SIGN_GLYPH[sign] ?? ''}</span> ${sign}</div></td><td class=\"${`bindu-cell ${this.sarvaTier(count)}`}\">${count}</td></tr>`;\n\t\t\t\t\t\t})}</tbody><tfoot><tr class=\"total-row\"><td>Total</td><td>${sav.total}</td></tr></tfoot></table></div>${this.renderLegend(\n\t\t\t\t'Under 25 is a weak sign, 25 to 29 average, 30 and above strong. The 12 signs always total 337.',\n\t\t\t)}`;\n\t}\n\n\tprivate renderBhinna(signs: Signs) {\n\t\tconst bhinna = this.data?.bhinnashtakavarga;\n\t\tif (!bhinna?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No bhinnashtakavarga data</p>`;\n\n\t\treturn html`${this.renderBinduGrid(\n\t\t\tsigns,\n\t\t\tbhinna,\n\t\t\t'Bhinnashtakavarga: the bindus each planet scores in every one of the twelve signs, with a row total.',\n\t\t)} ${this.renderLegend(\n\t\t\t'Each planet scores 0 to 8 bindus per sign. 4 is the mid, 5 and above is strong support for that planet in that sign.',\n\t\t)}`;\n\t}\n\n\t/**\n\t * The Shodhana-purified grid (Trikona then Ekadipati), which is what Shodhya\n\t * Pinda is computed from. The column totals are the Reduced Sarvashtakavarga,\n\t * so they are shown as the total row rather than as a second table.\n\t */\n\tprivate renderReduced(signs: Signs) {\n\t\tconst reduced = this.data?.reducedBhinnashtakavarga;\n\t\tconst rsav = this.data?.reducedSarvashtakavarga;\n\t\tif (!reduced?.length && !rsav)\n\t\t\treturn html`<p class=\"roxy-empty\">No reduced ashtakavarga data</p>`;\n\n\t\treturn html`${this.renderBinduGrid(\n\t\t\tsigns,\n\t\t\treduced ?? [],\n\t\t\t'Reduced Bhinnashtakavarga after Shodhana: the bindus each planet keeps in every one of the twelve signs, with a row total and a Reduced Sarvashtakavarga totals row.',\n\t\t\trsav,\n\t\t)} ${this.renderLegend(\n\t\t\t'Bindus left after Trikona and Ekadipati Shodhana, the input to Shodhya Pinda. The Reduced SAV row totals the seven planets only, so it does not include the Lagna row above it.',\n\t\t)}`;\n\t}\n\n\t/**\n\t * The planet-by-sign grid both the bhinna and the reduced tabs draw. The rows\n\t * are the 7 planets plus Lagna, but a Sarva total counts the 7 planets only\n\t * (which is why the classical SAV grand total is 337), so the totals row is\n\t * named for what it is rather than left to read as a column sum.\n\t */\n\tprivate renderBinduGrid(\n\t\tsigns: Signs,\n\t\trows: BhinnaRow[],\n\t\tcaption: string,\n\t\ttotals?: SarvaRow,\n\t) {\n\t\tif (!rows.length) return html`<p class=\"roxy-empty\">No bindu data</p>`;\n\t\treturn html`<div class=\"overflow-scroll\"><table class=\"bhinna-table\"><caption class=\"roxy-sr-only\">${caption}</caption><thead><tr><th scope=\"col\">Planet</th>${signs.map(\n\t\t\t\t\t\t\t(s) =>\n\t\t\t\t\t\t\t\thtml`<th scope=\"col\" title=\"${s}\">${SIGN_GLYPH[s] ?? s.slice(0, 2)}</th>`,\n\t\t\t\t\t\t)}<th scope=\"col\">Total</th></tr></thead><tbody>${rows.map(\n\t\t\t\t\t\t(row) => html`<tr><td>${row.planet}</td>${row.bindus.map(\n\t\t\t\t\t\t\t(count) =>\n\t\t\t\t\t\t\t\thtml`<td class=\"${`bindu-cell ${this.bhinnaTier(count)}`}\">${count}</td>`,\n\t\t\t\t\t\t)}<td>${row.total}</td></tr>`,\n\t\t\t\t\t)}</tbody>${\n\t\t\t\t\ttotals\n\t\t\t\t\t\t? html`<tfoot><tr class=\"total-row\"><td>Reduced SAV</td>${signs.map((_, i) => html`<td>${totals.bindus[i] ?? 0}</td>`)}<td>${totals.total}</td></tr></tfoot>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</table></div>`;\n\t}\n\n\tprivate renderPinda() {\n\t\tconst pinda = this.data?.shodhyaPinda;\n\t\tif (!pinda?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No shodhya pinda data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table><caption class=\"roxy-sr-only\">Shodhya Pinda: each planet with its Rashi Pinda, Graha Pinda and Shodhya Pinda strength scores.</caption><thead><tr><th scope=\"col\">Planet</th><th scope=\"col\">Rashi Pinda</th><th scope=\"col\">Graha Pinda</th><th scope=\"col\">Shodhya Pinda</th></tr></thead><tbody>${pinda.map(\n\t\t\t\t\t\t(row) => html`<tr><td>${row.planet}</td><td>${row.rashiPinda}</td><td>${row.grahaPinda}</td><td>${row.shodhyaPinda}</td></tr>`,\n\t\t\t\t\t)}</tbody></table></div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-ashtakavarga-grid': RoxyAshtakavargaGrid;\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. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\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", "import type { TemplateResult } from 'lit';\nimport { css, html, nothing } from 'lit';\n\n/** A single tab in a {@link renderTablist} strip. */\nexport interface TablistItem<T extends string = string> {\n\tid: T;\n\tlabel: string;\n}\n\n/**\n * Shared styling for every horizontal tab strip in the library (natal chart\n * views, transits, kundli styles). Keeping one rule set means the tabs look\n * identical everywhere and theme through the same --roxy-* tokens.\n */\nexport const tablistStyles = css`.roxy-tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);scrollbar-width:thin;gap:2px;min-width:0;display:flex;overflow-x:auto}.roxy-tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;flex-shrink:0;margin-bottom:-2px;font-family:inherit}.roxy-tab[aria-selected=true]{color:var(--roxy-accent-ink,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.roxy-tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.roxy-tab:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:4px}`;\n\n/**\n * Render a WAI-ARIA tablist. The host component owns the active-tab state; this\n * helper draws the buttons, wires click plus Left/Right arrow navigation with a\n * roving tabindex, and moves focus to the newly selected tab. Pair with\n * {@link tablistStyles}.\n *\n * Pass `controls: true` when each tab governs a sibling\n * `<div role=\"tabpanel\" id=\"${idPrefix}-panel-${id}\">` so the buttons advertise\n * `aria-controls`. Omit it for tablists that swap a single rendered view in\n * place with no separate panel element (the kundli style switch).\n *\n * @example\n * ```ts\n * renderTablist({\n * items: [{ id: 'wheel', label: 'Wheel' }, { id: 'grid', label: 'Aspect grid' }],\n * active: this.view,\n * onSelect: (v) => { this.view = v; },\n * label: 'Natal chart views',\n * idPrefix: 'natal',\n * controls: true,\n * })\n * ```\n */\nexport function renderTablist<T extends string>(opts: {\n\titems: ReadonlyArray<TablistItem<T>>;\n\tactive: T;\n\tonSelect: (id: T) => void;\n\tlabel: string;\n\tidPrefix: string;\n\tcontrols?: boolean;\n}): TemplateResult {\n\tconst { items, active, onSelect, label, idPrefix, controls = false } = opts;\n\tconst onKeyDown = (e: KeyboardEvent) => {\n\t\tif (e.key !== 'ArrowRight' && e.key !== 'ArrowLeft') return;\n\t\te.preventDefault();\n\t\tconst idx = items.findIndex((it) => it.id === active);\n\t\tif (idx === -1) return;\n\t\tconst delta = e.key === 'ArrowRight' ? 1 : -1;\n\t\tconst next = items[(idx + delta + items.length) % items.length];\n\t\tif (!next) return;\n\t\tonSelect(next.id);\n\t\tconst root = (e.currentTarget as HTMLElement).getRootNode() as\n\t\t\t| ShadowRoot\n\t\t\t| Document;\n\t\trequestAnimationFrame(() => {\n\t\t\troot\n\t\t\t\t.querySelector<HTMLButtonElement>(`#${idPrefix}-tab-${next.id}`)\n\t\t\t\t?.focus();\n\t\t});\n\t};\n\treturn html`<div class=\"roxy-tablist\" role=\"tablist\" aria-label=\"${label}\" @keydown=\"${onKeyDown}\">${items.map(\n\t\t\t(it) => html`<button type=\"button\" class=\"roxy-tab\" role=\"tab\" id=\"${idPrefix}-tab-${it.id}\" aria-selected=\"${active === it.id ? 'true' : 'false'}\" aria-controls=\"${\n\t\t\t\t\t// Only the active panel is rendered, so only the active tab points\n\t\t\t\t\t// at a live element; otherwise aria-controls would dangle.\n\t\t\t\t\tcontrols && active === it.id ? `${idPrefix}-panel-${it.id}` : nothing\n\t\t\t\t}\" tabindex=\"${active === it.id ? '0' : '-1'}\" @click=\"${() => onSelect(it.id)}\">${it.label}</button>`,\n\t\t)}</div>`;\n}\n"],
|
|
5
|
-
"mappings": "wMAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,WAAAC,MAAe,MACnC,OAAS,iBAAAC,EAAe,SAAAC,MAAa,oBC+C9B,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,CAAoB,EACtE,QAAS,GACT,SAAU,EACX,CAAC,CACF,CACD,CCdA,IAAMC,EAAmB,6BAqBZC,EAAN,KAAiE,CAavE,YAAYC,EAAoB,CANhC,aAAUF,EAOT,KAAK,KAAOE,EACZA,EAAK,cAAc,IAAI,CACxB,CAEA,kBAAmB,CAClB,KAAK,OAAO,MAAM,EAClB,KAAK,MAAQ,MACd,CAOA,MAAM,IAAIC,EAAiC,CAE1C,GAAI,CAAC,KAAK,WAAa,KAAK,iBAAiB,EAAG,OAChD,KAAK,OAAO,M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CNjB,EAiCrB,wBAIAgB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,CAAC,GApChCjB,EAqCrB,2BAIAgB,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GAxCLjB,EAyCrB,2BAIAgB,EAAA,CADCE,EAAM,GA5CclB,EA6CrB,uBAIAgB,EAAA,CADCE,EAAM,GAhDclB,EAiDrB,qBAMQgB,EAAA,CADPE,EAAM,GAtDclB,EAuDb,2BAIAgB,EAAA,CADPE,EAAM,GA1DclB,EA2Db,uBAIAgB,EAAA,CADPE,EAAM,GA9DclB,EA+Db,sBKrGT,OAAS,OAAAmB,EAAK,QAAAC,EAAM,WAAAC,MAAe,MAa5B,IAAMC,EAAgBH,
|
|
4
|
+
"sourcesContent": ["import { css, html, nothing } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\nimport { SIGN_GLYPH } from '../tokens/index.js';\nimport type { AshtakavargaResponse } from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport {\n\trenderTablist,\n\ttype TablistItem,\n\ttablistStyles,\n} from '../utils/tablist.js';\n\ntype Tab = 'sarva' | 'bhinna' | 'reduced' | 'pinda';\n\nconst TABS: ReadonlyArray<TablistItem<Tab>> = [\n\t{ id: 'sarva', label: 'Sarvashtakavarga' },\n\t{ id: 'bhinna', label: 'Bhinnashtakavarga' },\n\t{ id: 'reduced', label: 'Reduced' },\n\t{ id: 'pinda', label: 'Shodhya Pinda' },\n];\n\ntype Signs = AshtakavargaResponse['signs'];\ntype BhinnaRow = AshtakavargaResponse['bhinnashtakavarga'][number];\ntype SarvaRow = AshtakavargaResponse['sarvashtakavarga'];\n\n/**\n * Ashtakavarga grid: Sarvashtakavarga, Bhinnashtakavarga, the Shodhana-reduced\n * grid, and Shodhya Pinda. Pass `data` from /vedic-astrology/ashtakavarga.\n *\n * @remarks\n * Bindus are benefic points, so MORE is better in every view here. The colour\n * ramp is therefore diverging, not a single hot hue: a weak count tints toward\n * --roxy-heat (which resolves to the danger token), the classical average stays\n * neutral, a strong count tints toward --roxy-success, and each tab states its\n * own scale in a legend. The previous single-hue ramp painted the best signs the\n * most alarming shade, the exact opposite of what the numbers mean.\n */\n@customElement('roxy-ashtakavarga-grid')\nexport class RoxyAshtakavargaGrid extends RoxyDataElement<AshtakavargaResponse> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\ttablistStyles,\n\t\tcss`.wrap{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);grid-template-columns:minmax(0,1fr);display:grid}.head{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0}.overflow-scroll{-webkit-overflow-scrolling:touch;min-width:0;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:var(--roxy-text-sm,.875rem)}th,td{padding:var(--roxy-space-sm,.5rem);border-bottom:1px solid var(--roxy-border,#e4e4e7);text-align:center}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:.06em}td:first-child,th:first-child{text-align:left}.glyph{margin-right:3px;font-size:1.1em;line-height:1}.planet-cell{white-space:nowrap;align-items:center;gap:4px;display:flex}.total-row td{font-weight:var(--roxy-weight-bold,600);border-top:2px solid var(--roxy-border,#e4e4e7);border-bottom:none}.bindu-cell{border-radius:var(--roxy-radius-sm,4px);font-weight:var(--roxy-weight-bold,600);font-variant-numeric:tabular-nums;min-width:2rem;color:var(--roxy-fg,currentColor)}.tier-1{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 30%, transparent)}.tier-2{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 17%, transparent)}.tier-3{background:color-mix(in srgb, var(--roxy-heat,#ef4444) 7%, transparent)}.tier-4{background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 45%, transparent)}.tier-5{background:color-mix(in srgb, var(--roxy-success,#16a34a) 16%, transparent)}.tier-6{background:color-mix(in srgb, var(--roxy-success,#16a34a) 32%, transparent)}.tier-7{background:color-mix(in srgb, var(--roxy-success,#16a34a) 50%, transparent)}.legend{align-items:center;gap:var(--roxy-space-xs,.25rem) var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);flex-wrap:wrap;display:flex}.legend-scale{gap:2px;display:flex}.legend-swatch{border-radius:2px;width:16px;height:10px}.legend-note{flex:12rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:5rem}@container (width<=480px){.bhinna-table th,.bhinna-table td{font-size:var(--roxy-text-xs,.75rem);padding:.3rem .35rem}.bhinna-table th:first-child,.bhinna-table td:first-child{min-width:3.5rem}.bindu-cell{min-width:1.5rem}}.overflow-scroll{-webkit-mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%);mask-image:linear-gradient(90deg,#0000 0,#000 .5rem calc(100% - 1rem),#0000 100%)}`,\n\t];\n\n\t@state()\n\tactiveTab: Tab = 'sarva';\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No ashtakavarga data</div>`;\n\t}\n\n\tprotected renderData(d: AshtakavargaResponse) {\n\t\tconst signs = d.signs ?? [];\n\n\t\treturn html`<div class=\"wrap\" aria-label=\"Ashtakavarga grid\"><div class=\"head\"><h2 class=\"title\">Ashtakavarga</h2>${\n\t\t\t\t\tsigns.length\n\t\t\t\t\t\t? html`<p class=\"subtitle\">${signs.length} signs</p>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</div>${renderTablist({\n\t\t\t\titems: TABS,\n\t\t\t\tactive: this.activeTab,\n\t\t\t\tonSelect: (id) => {\n\t\t\t\t\tthis.activeTab = id;\n\t\t\t\t},\n\t\t\t\tlabel: 'Ashtakavarga views',\n\t\t\t\tidPrefix: 'ashtakavarga',\n\t\t\t\tcontrols: true,\n\t\t\t})}<div id=\"ashtakavarga-panel-${this.activeTab}\" role=\"tabpanel\" aria-labelledby=\"ashtakavarga-tab-${this.activeTab}\">${\n\t\t\t\t\tthis.activeTab === 'sarva'\n\t\t\t\t\t\t? this.renderSarva(signs)\n\t\t\t\t\t\t: this.activeTab === 'bhinna'\n\t\t\t\t\t\t\t? this.renderBhinna(signs)\n\t\t\t\t\t\t\t: this.activeTab === 'reduced'\n\t\t\t\t\t\t\t\t? this.renderReduced(signs)\n\t\t\t\t\t\t\t\t: this.renderPinda()\n\t\t\t\t}</div></div>`;\n\t}\n\n\t/**\n\t * Bhinna bindus per planet per sign run 0..8 (one 0/1 contribution from each\n\t * of the 8 reference points). 4 is the mid, so it holds the neutral tier and\n\t * anything above it reads as support. The reduced grid uses the same 0..8\n\t * units, so it shares this scale.\n\t */\n\tprivate bhinnaTier(count: number): string {\n\t\tif (count <= 1) return 'tier-1';\n\t\tif (count <= 2) return 'tier-2';\n\t\tif (count <= 3) return 'tier-3';\n\t\tif (count <= 4) return 'tier-4';\n\t\tif (count <= 5) return 'tier-5';\n\t\tif (count <= 6) return 'tier-6';\n\t\treturn 'tier-7';\n\t}\n\n\t/**\n\t * Sarva bindus per sign are the column total across the 7 planets. The grand\n\t * total is always 337, so the classical average is 337/12 = 28.08 and the\n\t * bands used by readers are: under 25 weak, 25 to 29 average, 30 and above\n\t * strong, with the highest signs carrying transits best. The tiers follow\n\t * those bands rather than an even split, so 28 sits on the neutral tier.\n\t */\n\tprivate sarvaTier(count: number): string {\n\t\tif (count <= 20) return 'tier-1';\n\t\tif (count <= 24) return 'tier-2';\n\t\tif (count <= 27) return 'tier-3';\n\t\tif (count <= 29) return 'tier-4';\n\t\tif (count <= 32) return 'tier-5';\n\t\tif (count <= 36) return 'tier-6';\n\t\treturn 'tier-7';\n\t}\n\n\t/**\n\t * The scale, stated. Without this a reader has to guess whether a saturated\n\t * cell is good or bad, and in a bindu grid the answer is always \"good\".\n\t */\n\tprivate renderLegend(note: string) {\n\t\treturn html`<div class=\"legend\"><span>Fewer bindus</span> <span class=\"legend-scale\" aria-hidden=\"true\">${[1, 2, 3, 4, 5, 6, 7].map(\n\t\t\t\t\t(t) => html`<span class=\"legend-swatch tier-${t}\"></span>`,\n\t\t\t\t)} </span><span>More bindus</span> <span class=\"legend-note\">${note}</span></div>`;\n\t}\n\n\tprivate renderSarva(signs: Signs) {\n\t\tconst sav = this.data?.sarvashtakavarga;\n\t\tif (!sav) return html`<p class=\"roxy-empty\">No sarvashtakavarga data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table><caption class=\"roxy-sr-only\">Sarvashtakavarga: each of the twelve signs and the bindus all planets contribute to it, with a grand total.</caption><thead><tr><th scope=\"col\">Sign</th><th scope=\"col\">Bindus</th></tr></thead><tbody>${signs.map((sign, i) => {\n\t\t\t\t\t\t\tconst count = sav.bindus[i] ?? 0;\n\t\t\t\t\t\t\treturn html`<tr><td><div class=\"planet-cell\"><span class=\"glyph\" aria-hidden=\"true\">${SIGN_GLYPH[sign] ?? ''}</span> ${sign}</div></td><td class=\"${`bindu-cell ${this.sarvaTier(count)}`}\">${count}</td></tr>`;\n\t\t\t\t\t\t})}</tbody><tfoot><tr class=\"total-row\"><td>Total</td><td>${sav.total}</td></tr></tfoot></table></div>${this.renderLegend(\n\t\t\t\t'Under 25 is a weak sign, 25 to 29 average, 30 and above strong. The 12 signs always total 337.',\n\t\t\t)}`;\n\t}\n\n\tprivate renderBhinna(signs: Signs) {\n\t\tconst bhinna = this.data?.bhinnashtakavarga;\n\t\tif (!bhinna?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No bhinnashtakavarga data</p>`;\n\n\t\treturn html`${this.renderBinduGrid(\n\t\t\tsigns,\n\t\t\tbhinna,\n\t\t\t'Bhinnashtakavarga: the bindus each planet scores in every one of the twelve signs, with a row total.',\n\t\t)} ${this.renderLegend(\n\t\t\t'Each planet scores 0 to 8 bindus per sign. 4 is the mid, 5 and above is strong support for that planet in that sign.',\n\t\t)}`;\n\t}\n\n\t/**\n\t * The Shodhana-purified grid (Trikona then Ekadipati), which is what Shodhya\n\t * Pinda is computed from. The column totals are the Reduced Sarvashtakavarga,\n\t * so they are shown as the total row rather than as a second table.\n\t */\n\tprivate renderReduced(signs: Signs) {\n\t\tconst reduced = this.data?.reducedBhinnashtakavarga;\n\t\tconst rsav = this.data?.reducedSarvashtakavarga;\n\t\tif (!reduced?.length && !rsav)\n\t\t\treturn html`<p class=\"roxy-empty\">No reduced ashtakavarga data</p>`;\n\n\t\treturn html`${this.renderBinduGrid(\n\t\t\tsigns,\n\t\t\treduced ?? [],\n\t\t\t'Reduced Bhinnashtakavarga after Shodhana: the bindus each planet keeps in every one of the twelve signs, with a row total and a Reduced Sarvashtakavarga totals row.',\n\t\t\trsav,\n\t\t)} ${this.renderLegend(\n\t\t\t'Bindus left after Trikona and Ekadipati Shodhana, the input to Shodhya Pinda. The Reduced SAV row totals the seven planets only, so it does not include the Lagna row above it.',\n\t\t)}`;\n\t}\n\n\t/**\n\t * The planet-by-sign grid both the bhinna and the reduced tabs draw. The rows\n\t * are the 7 planets plus Lagna, but a Sarva total counts the 7 planets only\n\t * (which is why the classical SAV grand total is 337), so the totals row is\n\t * named for what it is rather than left to read as a column sum.\n\t */\n\tprivate renderBinduGrid(\n\t\tsigns: Signs,\n\t\trows: BhinnaRow[],\n\t\tcaption: string,\n\t\ttotals?: SarvaRow,\n\t) {\n\t\tif (!rows.length) return html`<p class=\"roxy-empty\">No bindu data</p>`;\n\t\treturn html`<div class=\"overflow-scroll\"><table class=\"bhinna-table\"><caption class=\"roxy-sr-only\">${caption}</caption><thead><tr><th scope=\"col\">Planet</th>${signs.map(\n\t\t\t\t\t\t\t(s) =>\n\t\t\t\t\t\t\t\thtml`<th scope=\"col\" title=\"${s}\">${SIGN_GLYPH[s] ?? s.slice(0, 2)}</th>`,\n\t\t\t\t\t\t)}<th scope=\"col\">Total</th></tr></thead><tbody>${rows.map(\n\t\t\t\t\t\t(row) => html`<tr><td>${row.planet}</td>${row.bindus.map(\n\t\t\t\t\t\t\t(count) =>\n\t\t\t\t\t\t\t\thtml`<td class=\"${`bindu-cell ${this.bhinnaTier(count)}`}\">${count}</td>`,\n\t\t\t\t\t\t)}<td>${row.total}</td></tr>`,\n\t\t\t\t\t)}</tbody>${\n\t\t\t\t\ttotals\n\t\t\t\t\t\t? html`<tfoot><tr class=\"total-row\"><td>Reduced SAV</td>${signs.map((_, i) => html`<td>${totals.bindus[i] ?? 0}</td>`)}<td>${totals.total}</td></tr></tfoot>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</table></div>`;\n\t}\n\n\tprivate renderPinda() {\n\t\tconst pinda = this.data?.shodhyaPinda;\n\t\tif (!pinda?.length)\n\t\t\treturn html`<p class=\"roxy-empty\">No shodhya pinda data</p>`;\n\n\t\treturn html`<div class=\"overflow-scroll\"><table><caption class=\"roxy-sr-only\">Shodhya Pinda: each planet with its Rashi Pinda, Graha Pinda and Shodhya Pinda strength scores.</caption><thead><tr><th scope=\"col\">Planet</th><th scope=\"col\">Rashi Pinda</th><th scope=\"col\">Graha Pinda</th><th scope=\"col\">Shodhya Pinda</th></tr></thead><tbody>${pinda.map(\n\t\t\t\t\t\t(row) => html`<tr><td>${row.planet}</td><td>${row.rashiPinda}</td><td>${row.grahaPinda}</td><td>${row.shodhyaPinda}</td></tr>`,\n\t\t\t\t\t)}</tbody></table></div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-ashtakavarga-grid': RoxyAshtakavargaGrid;\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. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\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", "import type { TemplateResult } from 'lit';\nimport { css, html, nothing } from 'lit';\n\n/** A single tab in a {@link renderTablist} strip. */\nexport interface TablistItem<T extends string = string> {\n\tid: T;\n\tlabel: string;\n}\n\n/**\n * Shared styling for every horizontal tab strip in the library (natal chart\n * views, transits, kundli styles). Keeping one rule set means the tabs look\n * identical everywhere and theme through the same --roxy-* tokens.\n */\nexport const tablistStyles = css`.roxy-tablist{border-bottom:2px solid var(--roxy-border,#e4e4e7);scrollbar-width:thin;gap:2px;min-width:0;display:flex;overflow-x:auto}.roxy-tab{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-sm,.875rem);cursor:pointer;color:var(--roxy-muted,#71717a);transition:color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);background:0 0;border:none;border-bottom:2px solid #0000;flex-shrink:0;margin-bottom:-2px;font-family:inherit}.roxy-tab[aria-selected=true]{color:var(--roxy-accent-ink,#b45309);border-bottom-color:var(--roxy-accent,#f59e0b);font-weight:var(--roxy-weight-bold,600)}.roxy-tab:hover:not([aria-selected=true]){color:var(--roxy-fg,#0a0a0a)}.roxy-tab:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:-2px;border-radius:4px}`;\n\n/**\n * Render a WAI-ARIA tablist. The host component owns the active-tab state; this\n * helper draws the buttons, wires click plus Left/Right arrow navigation with a\n * roving tabindex, and moves focus to the newly selected tab. Pair with\n * {@link tablistStyles}.\n *\n * Pass `controls: true` when each tab governs a sibling\n * `<div role=\"tabpanel\" id=\"${idPrefix}-panel-${id}\">` so the buttons advertise\n * `aria-controls`. Omit it for tablists that swap a single rendered view in\n * place with no separate panel element (the kundli style switch).\n *\n * @example\n * ```ts\n * renderTablist({\n * items: [{ id: 'wheel', label: 'Wheel' }, { id: 'grid', label: 'Aspect grid' }],\n * active: this.view,\n * onSelect: (v) => { this.view = v; },\n * label: 'Natal chart views',\n * idPrefix: 'natal',\n * controls: true,\n * })\n * ```\n */\nexport function renderTablist<T extends string>(opts: {\n\titems: ReadonlyArray<TablistItem<T>>;\n\tactive: T;\n\tonSelect: (id: T) => void;\n\tlabel: string;\n\tidPrefix: string;\n\tcontrols?: boolean;\n}): TemplateResult {\n\tconst { items, active, onSelect, label, idPrefix, controls = false } = opts;\n\tconst onKeyDown = (e: KeyboardEvent) => {\n\t\tif (e.key !== 'ArrowRight' && e.key !== 'ArrowLeft') return;\n\t\te.preventDefault();\n\t\tconst idx = items.findIndex((it) => it.id === active);\n\t\tif (idx === -1) return;\n\t\tconst delta = e.key === 'ArrowRight' ? 1 : -1;\n\t\tconst next = items[(idx + delta + items.length) % items.length];\n\t\tif (!next) return;\n\t\tonSelect(next.id);\n\t\tconst root = (e.currentTarget as HTMLElement).getRootNode() as\n\t\t\t| ShadowRoot\n\t\t\t| Document;\n\t\trequestAnimationFrame(() => {\n\t\t\troot\n\t\t\t\t.querySelector<HTMLButtonElement>(`#${idPrefix}-tab-${next.id}`)\n\t\t\t\t?.focus();\n\t\t});\n\t};\n\treturn html`<div class=\"roxy-tablist\" role=\"tablist\" aria-label=\"${label}\" @keydown=\"${onKeyDown}\">${items.map(\n\t\t\t(it) => html`<button type=\"button\" class=\"roxy-tab\" role=\"tab\" id=\"${idPrefix}-tab-${it.id}\" aria-selected=\"${active === it.id ? 'true' : 'false'}\" aria-controls=\"${\n\t\t\t\t\t// Only the active panel is rendered, so only the active tab points\n\t\t\t\t\t// at a live element; otherwise aria-controls would dangle.\n\t\t\t\t\tcontrols && active === it.id ? `${idPrefix}-panel-${it.id}` : nothing\n\t\t\t\t}\" tabindex=\"${active === it.id ? '0' : '-1'}\" @click=\"${() => onSelect(it.id)}\">${it.label}</button>`,\n\t\t)}</div>`;\n}\n"],
|
|
5
|
+
"mappings": "wMAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,WAAAC,MAAe,MACnC,OAAS,iBAAAC,EAAe,SAAAC,MAAa,oBC+C9B,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,CAAoB,EACtE,QAAS,GACT,SAAU,EACX,CAAC,CACF,CACD,CCdA,IAAMC,EAAmB,6BAqBZC,EAAN,KAAiE,CAavE,YAAYC,EAAoB,CANhC,aAAUF,EAOT,KAAK,KAAOE,EACZA,EAAK,cAAc,IAAI,CACxB,CAEA,kBAAmB,CAClB,KAAK,OAAO,MAAM,EAClB,KAAK,MAAQ,MACd,CAOA,MAAM,IAAIC,EAAiC,CAE1C,GAAI,CAAC,KAAK,WAAa,KAAK,iBAAiB,EAA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b,GACAN,eAAkB,cAAc,KAAK,WAAWM,CAAK,CAAC,EAAE,KAAKA,CAAK,OACpE,CAAC,OAAOa,EAAI,KAAK,YAClB,CAAC,WACDF,EACGjB,qDAAwDE,EAAM,IAAI,CAACkB,EAAGV,IAAMV,QAAWiB,EAAO,OAAOP,CAAC,GAAK,CAAC,OAAO,CAAC,OAAOO,EAAO,KAAK,qBACvId,CACJ,iBAbuBH,0CAc1B,CAEQ,aAAc,CACrB,IAAMqB,EAAQ,KAAK,MAAM,aACzB,OAAKA,GAAO,OAGLrB,2UAA8UqB,EAAM,IACtVF,GAAQnB,YAAemB,EAAI,MAAM,YAAYA,EAAI,UAAU,YAAYA,EAAI,UAAU,YAAYA,EAAI,YAAY,YACnH,CAAC,yBAJInB,kDAKT,CACD,EAxKaF,EACL,OAAS,CACfwB,EACAC,EACAC,2yFACD,EAGAC,EAAA,CADCC,EAAM,GAPK5B,EAQZ,yBARYA,EAAN2B,EAAA,CADNE,EAAc,wBAAwB,GAC1B7B",
|
|
6
6
|
"names": ["css", "html", "nothing", "customElement", "state", "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", "css", "html", "nothing", "tablistStyles", "renderTablist", "opts", "items", "active", "onSelect", "label", "idPrefix", "controls", "e", "idx", "it", "delta", "next", "root", "TABS", "RoxyAshtakavargaGrid", "RoxyDataElement", "html", "d", "signs", "nothing", "renderTablist", "id", "count", "note", "sav", "sign", "i", "SIGN_GLYPH", "bhinna", "reduced", "rsav", "rows", "caption", "totals", "s", "row", "_", "pinda", "baseStyles", "tablistStyles", "css", "__decorateClass", "state", "customElement"]
|
|
7
7
|
}
|