@roxyapi/ui 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/AGENTS.md +5 -5
  2. package/README.md +3 -3
  3. package/THEMING.md +3 -3
  4. package/components-catalog.json +258 -158
  5. package/dist/cdn/components/almanac-day.js +3 -205
  6. package/dist/cdn/components/angel-number-card.js +3 -205
  7. package/dist/cdn/components/angel-number-lookup.js +3 -205
  8. package/dist/cdn/components/arudha-padas.js +3 -205
  9. package/dist/cdn/components/ashtakavarga-grid.js +3 -205
  10. package/dist/cdn/components/aspects-table.js +3 -205
  11. package/dist/cdn/components/astrocartography-map.js +3 -205
  12. package/dist/cdn/components/bazi-chart.js +3 -205
  13. package/dist/cdn/components/bhav-chalit-table.js +2 -204
  14. package/dist/cdn/components/bhava-bala-table.js +3 -205
  15. package/dist/cdn/components/biorhythm-chart.js +3 -205
  16. package/dist/cdn/components/bodygraph.js +7 -209
  17. package/dist/cdn/components/chara-karakas.js +3 -205
  18. package/dist/cdn/components/choghadiya-grid.js +3 -205
  19. package/dist/cdn/components/compatibility-card.js +2 -204
  20. package/dist/cdn/components/compound-number.js +3 -205
  21. package/dist/cdn/components/crystal-card.js +3 -205
  22. package/dist/cdn/components/crystal-grid.js +3 -205
  23. package/dist/cdn/components/dasha-timeline.js +3 -205
  24. package/dist/cdn/components/data.js +3 -205
  25. package/dist/cdn/components/divisional-chart.js +13 -215
  26. package/dist/cdn/components/dosha-card.js +3 -205
  27. package/dist/cdn/components/dosha-constitution.js +3 -205
  28. package/dist/cdn/components/dream-card.js +3 -205
  29. package/dist/cdn/components/dream-search.js +3 -205
  30. package/dist/cdn/components/endpoint-form.js +3 -205
  31. package/dist/cdn/components/ephemeris-table.js +2 -204
  32. package/dist/cdn/components/fixed-stars.js +2 -204
  33. package/dist/cdn/components/flying-star-chart.js +2 -204
  34. package/dist/cdn/components/forecast-digest.js +3 -205
  35. package/dist/cdn/components/forecast-timeline.js +3 -205
  36. package/dist/cdn/components/gematria.js +3 -205
  37. package/dist/cdn/components/gochara-table.js +3 -205
  38. package/dist/cdn/components/guna-milan.js +3 -205
  39. package/dist/cdn/components/hd-connection.js +5 -207
  40. package/dist/cdn/components/hd-penta.js +5 -207
  41. package/dist/cdn/components/hd-type-card.js +3 -205
  42. package/dist/cdn/components/hd-variables.js +3 -205
  43. package/dist/cdn/components/heliacal-table.js +3 -205
  44. package/dist/cdn/components/hexagram.js +3 -205
  45. package/dist/cdn/components/hora-table.js +3 -205
  46. package/dist/cdn/components/horoscope-card.js +3 -205
  47. package/dist/cdn/components/kp-chart.js +3 -205
  48. package/dist/cdn/components/kp-finance-card.js +3 -205
  49. package/dist/cdn/components/kp-planets-table.js +3 -205
  50. package/dist/cdn/components/kp-ruling-planets.js +3 -205
  51. package/dist/cdn/components/kua-card.js +3 -205
  52. package/dist/cdn/components/local-space-compass.js +8 -210
  53. package/dist/cdn/components/location-search.js +3 -205
  54. package/dist/cdn/components/luck-pillars.js +3 -205
  55. package/dist/cdn/components/mayan-day-sign.js +3 -205
  56. package/dist/cdn/components/moon-phase.js +3 -205
  57. package/dist/cdn/components/nakshatra-card.js +3 -205
  58. package/dist/cdn/components/natal-chart.js +6 -208
  59. package/dist/cdn/components/numerology-card.js +3 -205
  60. package/dist/cdn/components/panchang-table.js +3 -205
  61. package/dist/cdn/components/positions-table.js +3 -205
  62. package/dist/cdn/components/profection-card.js +3 -205
  63. package/dist/cdn/components/reference-card.js +3 -205
  64. package/dist/cdn/components/relocation-wheel.js +6 -208
  65. package/dist/cdn/components/shadbala-table.js +3 -205
  66. package/dist/cdn/components/synastry-chart.js +7 -209
  67. package/dist/cdn/components/tarot-card.js +3 -205
  68. package/dist/cdn/components/tarot-catalog.js +3 -205
  69. package/dist/cdn/components/tarot-spread.js +3 -205
  70. package/dist/cdn/components/transit-wheel.js +8 -210
  71. package/dist/cdn/components/transits-table.js +3 -205
  72. package/dist/cdn/components/upagraha-table.js +2 -204
  73. package/dist/cdn/components/vastu-mandala.js +4 -206
  74. package/dist/cdn/components/vedic-aspects.js +2 -204
  75. package/dist/cdn/components/vedic-daily.js +3 -205
  76. package/dist/cdn/components/vedic-kundli.js +10 -212
  77. package/dist/cdn/components/vedic-planets-table.js +3 -205
  78. package/dist/cdn/components/western-planets-table.js +2 -204
  79. package/dist/cdn/components/yoga-list.js +3 -205
  80. package/dist/cdn/components/zodiac-card.js +2 -204
  81. package/dist/cdn/locales/de.js +1 -1
  82. package/dist/cdn/roxy-ui.js +49 -251
  83. package/dist/components/almanac-day.js +1 -203
  84. package/dist/components/angel-number-card.js +1 -203
  85. package/dist/components/angel-number-lookup.js +1 -203
  86. package/dist/components/arudha-padas.js +1 -203
  87. package/dist/components/ashtakavarga-grid.js +1 -203
  88. package/dist/components/aspects-table.js +1 -203
  89. package/dist/components/astrocartography-map.js +6 -208
  90. package/dist/components/bazi-chart.js +1 -203
  91. package/dist/components/bhav-chalit-table.js +1 -203
  92. package/dist/components/bhava-bala-table.js +1 -203
  93. package/dist/components/biorhythm-chart.js +1 -203
  94. package/dist/components/bodygraph.js +3 -205
  95. package/dist/components/chara-karakas.js +1 -203
  96. package/dist/components/choghadiya-grid.js +1 -203
  97. package/dist/components/compatibility-card.js +1 -203
  98. package/dist/components/compound-number.js +1 -203
  99. package/dist/components/crystal-card.js +1 -203
  100. package/dist/components/crystal-grid.js +1 -203
  101. package/dist/components/dasha-timeline.js +1 -203
  102. package/dist/components/data.js +1 -203
  103. package/dist/components/divisional-chart.js +45 -247
  104. package/dist/components/dosha-card.js +1 -203
  105. package/dist/components/dosha-constitution.js +1 -203
  106. package/dist/components/dream-card.js +1 -203
  107. package/dist/components/dream-search.js +1 -203
  108. package/dist/components/endpoint-form.js +1 -203
  109. package/dist/components/ephemeris-table.js +1 -203
  110. package/dist/components/fixed-stars.js +1 -203
  111. package/dist/components/flying-star-chart.js +1 -203
  112. package/dist/components/forecast-digest.js +1 -203
  113. package/dist/components/forecast-timeline.js +1 -203
  114. package/dist/components/gematria.js +1 -203
  115. package/dist/components/gochara-table.js +1 -203
  116. package/dist/components/guna-milan.js +1 -203
  117. package/dist/components/hd-connection.js +3 -205
  118. package/dist/components/hd-penta.js +5 -207
  119. package/dist/components/hd-type-card.js +1 -203
  120. package/dist/components/hd-variables.js +1 -203
  121. package/dist/components/heliacal-table.js +1 -203
  122. package/dist/components/hexagram.d.ts +1 -1
  123. package/dist/components/hexagram.js +1 -203
  124. package/dist/components/hora-table.js +1 -203
  125. package/dist/components/horoscope-card.js +1 -203
  126. package/dist/components/kp-chart.js +1 -203
  127. package/dist/components/kp-finance-card.js +1 -203
  128. package/dist/components/kp-planets-table.js +1 -203
  129. package/dist/components/kp-ruling-planets.js +1 -203
  130. package/dist/components/kua-card.js +1 -203
  131. package/dist/components/local-space-compass.js +4 -206
  132. package/dist/components/location-search.js +1 -203
  133. package/dist/components/luck-pillars.js +1 -203
  134. package/dist/components/mayan-day-sign.js +1 -203
  135. package/dist/components/moon-phase.js +1 -203
  136. package/dist/components/nakshatra-card.js +1 -203
  137. package/dist/components/natal-chart.d.ts +1 -1
  138. package/dist/components/natal-chart.js +5 -207
  139. package/dist/components/numerology-card.js +1 -203
  140. package/dist/components/panchang-table.js +1 -203
  141. package/dist/components/positions-table.js +1 -203
  142. package/dist/components/profection-card.js +1 -203
  143. package/dist/components/reference-card.js +1 -203
  144. package/dist/components/relocation-wheel.js +3 -205
  145. package/dist/components/shadbala-table.js +1 -203
  146. package/dist/components/synastry-chart.js +6 -208
  147. package/dist/components/tarot-card.js +1 -203
  148. package/dist/components/tarot-catalog.js +1 -203
  149. package/dist/components/tarot-spread.js +1 -203
  150. package/dist/components/transit-wheel.js +8 -210
  151. package/dist/components/transits-table.js +1 -203
  152. package/dist/components/upagraha-table.js +1 -203
  153. package/dist/components/vastu-mandala.js +6 -208
  154. package/dist/components/vedic-aspects.js +1 -203
  155. package/dist/components/vedic-daily.js +1 -203
  156. package/dist/components/vedic-kundli.js +15 -217
  157. package/dist/components/vedic-planets-table.js +1 -203
  158. package/dist/components/western-planets-table.js +1 -203
  159. package/dist/components/yoga-list.js +1 -203
  160. package/dist/components/zodiac-card.js +1 -203
  161. package/dist/forms.json +1 -1
  162. package/dist/index.cjs +49 -251
  163. package/dist/index.js +50 -252
  164. package/dist/locales/de.js +1 -1
  165. package/dist/schemas/post--astrology-lilith.json +1 -1
  166. package/dist/schemas/post--astrology-progressions.json +1 -1
  167. package/dist/schemas/post--kabbalah-birth-profile.json +1 -1
  168. package/dist/schemas/post--numerology-chart.json +1 -1
  169. package/dist/schemas/post--vedic-astrology-daily.json +1 -1
  170. package/dist/schemas/post--vedic-astrology-dasha-current.json +1 -1
  171. package/dist/schemas/post--vedic-astrology-dasha-major.json +1 -1
  172. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha-pratyantardasha-sookshma.json +1 -1
  173. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha-pratyantardasha.json +1 -1
  174. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha-antardasha.json +1 -1
  175. package/dist/schemas/post--vedic-astrology-dasha-sub-mahadasha.json +1 -1
  176. package/dist/schemas/post--vedic-astrology-kp-chart.json +1 -1
  177. package/dist/schemas/post--vedic-astrology-kp-cusps.json +1 -1
  178. package/dist/schemas/post--vedic-astrology-kp-daily-finance.json +1 -1
  179. package/dist/schemas/post--vedic-astrology-kp-horary.json +1 -1
  180. package/dist/schemas/post--vedic-astrology-kp-planets.json +1 -1
  181. package/dist/schemas/post--vedic-astrology-kp-ruling-planets-interval.json +1 -1
  182. package/dist/schemas/post--vedic-astrology-kp-ruling-planets.json +1 -1
  183. package/dist/schemas/post--vedic-astrology-transit.json +1 -1
  184. package/dist/styles/palettes.d.ts +4 -0
  185. package/dist/styles/themes/celeste.css +1 -115
  186. package/dist/styles/themes/eucalyptus.css +1 -121
  187. package/dist/styles/themes/kiln.css +1 -121
  188. package/dist/styles/themes/moonlit.css +1 -121
  189. package/dist/styles/themes/practitioner.css +1 -170
  190. package/dist/styles/tokens-css.d.ts +1 -1
  191. package/dist/styles/tokens.css +1 -202
  192. package/dist/types/types.gen.d.ts +48 -36
  193. package/dist/utils/string.d.ts +2 -0
  194. package/dist/version.d.ts +1 -1
  195. package/package.json +1 -1
@@ -1,208 +1,6 @@
1
- var RoxyUI_hexagram=(()=>{var j=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var pt=Object.prototype.hasOwnProperty;var ht=(n,e)=>{for(var t in e)j(n,t,{get:e[t],enumerable:!0})},ut=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ct(e))!pt.call(n,o)&&o!==t&&j(n,o,{get:()=>e[o],enumerable:!(r=we(e,o))||r.enumerable});return n};var mt=n=>ut(j({},"__esModule",{value:!0}),n),g=(n,e,t,r)=>{for(var o=r>1?void 0:r?we(e,t):e,i=n.length-1,s;i>=0;i--)(s=n[i])&&(o=(r?s(e,t,o):s(o))||o);return r&&o&&j(e,t,o),o};var Jt={};ht(Jt,{ROXY_UI_TOKENS_STYLE_ID:()=>W,RoxyHexagram:()=>R,injectRoxyTokens:()=>J});var z=globalThis,q=z.ShadowRoot&&(z.ShadyCSS===void 0||z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ie=Symbol(),Ee=new WeakMap,F=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==ie)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(q&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=Ee.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Ee.set(t,e))}return e}toString(){return this.cssText}},$e=n=>new F(typeof n=="string"?n:n+"",void 0,ie),x=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((r,o,i)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+n[i+1],n[0]);return new F(t,n,ie)},ke=(n,e)=>{if(q)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),o=z.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=t.cssText,n.appendChild(r)}},se=q?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return $e(t)})(n):n;var{is:gt,defineProperty:yt,getOwnPropertyDescriptor:ft,getOwnPropertyNames:xt,getOwnPropertySymbols:bt,getPrototypeOf:vt}=Object,K=globalThis,Te=K.trustedTypes,St=Te?Te.emptyScript:"",wt=K.reactiveElementPolyfillSupport,U=(n,e)=>n,N={toAttribute(n,e){switch(e){case Boolean:n=n?St:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},B=(n,e)=>!gt(n,e),Ae={attribute:!0,type:String,converter:N,reflect:!1,useDefault:!1,hasChanged:B};Symbol.metadata??=Symbol("metadata"),K.litPropertyMetadata??=new WeakMap;var S=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Ae){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),o=this.getPropertyDescriptor(e,r,t);o!==void 0&&yt(this.prototype,e,o)}}static getPropertyDescriptor(e,t,r){let{get:o,set:i}=ft(this.prototype,e)??{get(){return this[t]},set(s){this[t]=s}};return{get:o,set(s){let l=o?.call(this);i?.call(this,s),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ae}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;let e=vt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){let t=this.properties,r=[...xt(t),...bt(t)];for(let o of r)this.createProperty(o,t[o])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,o]of t)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let o=this._$Eu(t,r);o!==void 0&&this._$Eh.set(o,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let o of r)t.unshift(se(o))}else e!==void 0&&t.push(se(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ke(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){let i=(r.converter?.toAttribute!==void 0?r.converter:N).toAttribute(t,r.type);this._$Em=e,i==null?this.removeAttribute(o):this.setAttribute(o,i),this._$Em=null}}_$AK(e,t){let r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){let i=r.getPropertyOptions(o),s=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:N;this._$Em=o;let l=s.fromAttribute(t,i.type);this[o]=l??this._$Ej?.get(o)??l,this._$Em=null}}requestUpdate(e,t,r,o=!1,i){if(e!==void 0){let s=this.constructor;if(o===!1&&(i=this[e]),r??=s.getPropertyOptions(e),!((r.hasChanged??B)(i,t)||r.useDefault&&r.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:o,wrapped:i},s){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),i!==!0||s!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),o===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,i]of this._$Ep)this[o]=i;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[o,i]of r){let{wrapped:s}=i,l=this[o];s!==!0||this._$AL.has(o)||l===void 0||this.C(o,void 0,i,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[U("elementProperties")]=new Map,S[U("finalized")]=new Map,wt?.({ReactiveElement:S}),(K.reactiveElementVersions??=[]).push("2.1.2");var ue=globalThis,_e=n=>n,Y=ue.trustedTypes,Re=Y?Y.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ue="$lit$",w=`lit$${Math.random().toFixed(9).slice(2)}$`,Ne="?"+w,Et=`<${Ne}>`,T=document,I=()=>T.createComment(""),G=n=>n===null||typeof n!="object"&&typeof n!="function",me=Array.isArray,$t=n=>me(n)||typeof n?.[Symbol.iterator]=="function",ae=`[
2
- \f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ce=/-->/g,Pe=/>/g,$=RegExp(`>|${ae}(?:([^\\s"'>=/]+)(${ae}*=${ae}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Oe=/'/g,Le=/"/g,He=/^(?:script|style|textarea|title)$/i,ge=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),c=ge(1),or=ge(2),ir=ge(3),A=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Fe=new WeakMap,k=T.createTreeWalker(T,129);function Ie(n,e){if(!me(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Re!==void 0?Re.createHTML(e):e}var kt=(n,e)=>{let t=n.length-1,r=[],o,i=e===2?"<svg>":e===3?"<math>":"",s=H;for(let l=0;l<t;l++){let a=n[l],m,h,p=-1,f=0;for(;f<a.length&&(s.lastIndex=f,h=s.exec(a),h!==null);)f=s.lastIndex,s===H?h[1]==="!--"?s=Ce:h[1]!==void 0?s=Pe:h[2]!==void 0?(He.test(h[2])&&(o=RegExp("</"+h[2],"g")),s=$):h[3]!==void 0&&(s=$):s===$?h[0]===">"?(s=o??H,p=-1):h[1]===void 0?p=-2:(p=s.lastIndex-h[2].length,m=h[1],s=h[3]===void 0?$:h[3]==='"'?Le:Oe):s===Le||s===Oe?s=$:s===Ce||s===Pe?s=H:(s=$,o=void 0);let v=s===$&&n[l+1].startsWith("/>")?" ":"";i+=s===H?a+Et:p>=0?(r.push(m),a.slice(0,p)+Ue+a.slice(p)+w+v):a+w+(p===-2?l:v)}return[Ie(n,i+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},D=class n{constructor({strings:e,_$litType$:t},r){let o;this.parts=[];let i=0,s=0,l=e.length-1,a=this.parts,[m,h]=kt(e,t);if(this.el=n.createElement(m,r),k.currentNode=this.el.content,t===2||t===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=k.nextNode())!==null&&a.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(Ue)){let f=h[s++],v=o.getAttribute(p).split(w),C=/([.?@])?(.*)/.exec(f);a.push({type:1,index:i,name:C[2],strings:v,ctor:C[1]==="."?le:C[1]==="?"?ce:C[1]==="@"?pe:O}),o.removeAttribute(p)}else p.startsWith(w)&&(a.push({type:6,index:i}),o.removeAttribute(p));if(He.test(o.tagName)){let p=o.textContent.split(w),f=p.length-1;if(f>0){o.textContent=Y?Y.emptyScript:"";for(let v=0;v<f;v++)o.append(p[v],I()),k.nextNode(),a.push({type:2,index:++i});o.append(p[f],I())}}}else if(o.nodeType===8)if(o.data===Ne)a.push({type:2,index:i});else{let p=-1;for(;(p=o.data.indexOf(w,p+1))!==-1;)a.push({type:7,index:i}),p+=w.length-1}i++}}static createElement(e,t){let r=T.createElement("template");return r.innerHTML=e,r}};function P(n,e,t=n,r){if(e===A)return e;let o=r!==void 0?t._$Co?.[r]:t._$Cl,i=G(e)?void 0:e._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(n),o._$AT(n,t,r)),r!==void 0?(t._$Co??=[])[r]=o:t._$Cl=o),o!==void 0&&(e=P(n,o._$AS(n,e.values),o,r)),e}var de=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,o=(e?.creationScope??T).importNode(t,!0);k.currentNode=o;let i=k.nextNode(),s=0,l=0,a=r[0];for(;a!==void 0;){if(s===a.index){let m;a.type===2?m=new M(i,i.nextSibling,this,e):a.type===1?m=new a.ctor(i,a.name,a.strings,this,e):a.type===6&&(m=new he(i,this,e)),this._$AV.push(m),a=r[++l]}s!==a?.index&&(i=k.nextNode(),s++)}return k.currentNode=T,o}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},M=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,o){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=P(this,e,t),G(e)?e===d||e==null||e===""?(this._$AH!==d&&this._$AR(),this._$AH=d):e!==this._$AH&&e!==A&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):$t(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==d&&G(this._$AH)?this._$AA.nextSibling.data=e:this.T(T.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=D.createElement(Ie(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(t);else{let i=new de(o,this),s=i.u(this.options);i.p(t),this.T(s),this._$AH=i}}_$AC(e){let t=Fe.get(e.strings);return t===void 0&&Fe.set(e.strings,t=new D(e)),t}k(e){me(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,o=0;for(let i of e)o===t.length?t.push(r=new n(this.O(I()),this.O(I()),this,this.options)):r=t[o],r._$AI(i),o++;o<t.length&&(this._$AR(r&&r._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=_e(e).nextSibling;_e(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},O=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,o,i){this.type=1,this._$AH=d,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=i,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=d}_$AI(e,t=this,r,o){let i=this.strings,s=!1;if(i===void 0)e=P(this,e,t,0),s=!G(e)||e!==this._$AH&&e!==A,s&&(this._$AH=e);else{let l=e,a,m;for(e=i[0],a=0;a<i.length-1;a++)m=P(this,l[r+a],t,a),m===A&&(m=this._$AH[a]),s||=!G(m)||m!==this._$AH[a],m===d?e=d:e!==d&&(e+=(m??"")+i[a+1]),this._$AH[a]=m}s&&!o&&this.j(e)}j(e){e===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},le=class extends O{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===d?void 0:e}},ce=class extends O{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==d)}},pe=class extends O{constructor(e,t,r,o,i){super(e,t,r,o,i),this.type=5}_$AI(e,t=this){if((e=P(this,e,t,0)??d)===A)return;let r=this._$AH,o=e===d&&r!==d||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,i=e!==d&&(r===d||o);o&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},he=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){P(this,e)}};var Tt=ue.litHtmlPolyfillSupport;Tt?.(D,M),(ue.litHtmlVersions??=[]).push("3.3.3");var Ge=(n,e,t)=>{let r=t?.renderBefore??e,o=r._$litPart$;if(o===void 0){let i=t?.renderBefore??null;r._$litPart$=o=new M(e.insertBefore(I(),i),i,void 0,t??{})}return o._$AI(n),o};var ye=globalThis,E=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ge(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return A}};E._$litElement$=!0,E.finalized=!0,ye.litElementHydrateSupport?.({LitElement:E});var At=ye.litElementPolyfillSupport;At?.({LitElement:E});(ye.litElementVersions??=[]).push("4.2.2");var De=[{endpoint:"iching/hexagrams/random",method:"GET"},{endpoint:"iching/hexagrams/{number}",method:"GET"},{endpoint:"iching/hexagrams/lookup",method:"GET"},{endpoint:"iching/cast",method:"GET"},{endpoint:"iching/daily",method:"POST"},{endpoint:"iching/daily/cast",method:"POST"}];function V(n){return n.toLowerCase().replace(/[\s_-]+/g," ").trim()}var _t=(n,e)=>e?n[V(e)]:void 0;var Rt={heaven:"☰",lake:"☱",fire:"☲",thunder:"☳",wind:"☴",water:"☵",mountain:"☶",earth:"☷"},fe=n=>_t(Rt,n);var Ct={attribute:!0,type:String,converter:N,reflect:!1,hasChanged:B},Pt=(n=Ct,e,t)=>{let{kind:r,metadata:o}=t,i=globalThis.litPropertyMetadata.get(o);if(i===void 0&&globalThis.litPropertyMetadata.set(o,i=new Map),r==="setter"&&((n=Object.create(n)).wrapped=!0),i.set(t.name,n),r==="accessor"){let{name:s}=t;return{set(l){let a=e.get.call(this);e.set.call(this,l),this.requestUpdate(s,a,n,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,n,l),l}}}if(r==="setter"){let{name:s}=t;return function(l){let a=this[s];e.call(this,l),this.requestUpdate(s,a,n,!0,l)}}throw Error("Unsupported decorator location: "+r)};function y(n){return(e,t)=>typeof t=="object"?Pt(n,e,t):((r,o,i)=>{let s=o.hasOwnProperty(i);return o.constructor.createProperty(i,r),s?Object.getOwnPropertyDescriptor(o,i):void 0})(n,e,t)}function b(n){return y({...n,state:!0,attribute:!1})}var _=n=>n??d;var Me=["de","en","es","fr","hi","pt","ru","tr","zh-Hans","zh-Hant"];function be(n){if(n.lang)return n.lang;if(typeof document>"u")return;let e=n.closest?.("[lang]")?.getAttribute("lang");return e||document.documentElement.lang||void 0}var Ot={tw:"hant",hk:"hant",mo:"hant",cn:"hans",sg:"hans",my:"hans"};function xe(n){let e=n.toLowerCase();return Me.find(t=>t.toLowerCase()===e)}function je(n){let e=be(n);if(!e)return;let t=xe(e);if(t)return t;let r=e.toLowerCase().split("-"),o=r[0];if(o==="zh"){let i=r.find(s=>s==="hans"||s==="hant")??Ot[r[1]??""];return i?xe(`zh-${i}`):void 0}return xe(o)}var ze=`/**
4
- * Roxy UI design tokens: every colour, size, space, radius, font and duration a component reads.
5
- *
6
- * Two tiers. BASES are the few values a host tunes: fonts, base text size and its scale ratio, the
7
- * space unit, the base radius, motion, and the colour bases (bg, fg, accent and the four status
8
- * colours). Every other token DERIVES from them with calc() or color-mix(), so dark mode reassigns
9
- * the colour bases only and one font token restyles every heading. A host may still set any
10
- * derived token directly, and its value wins.
11
- *
12
- * Delivery: a global light-DOM stylesheet (linked, or injected by the CDN bundle). Custom properties
13
- * inherit through the shadow boundary, so a token set on any light-DOM ancestor reaches every
14
- * component. The :host selectors apply only if this sheet is adopted into a shadow root.
15
- *
16
- * Light is the default. Dark applies under prefers-color-scheme: dark, or [data-theme="dark"] or
17
- * .dark on the element or any ancestor; [data-theme="light"] or .light opts back into light. An
18
- * explicit choice wins over the OS because those blocks come later in source order.
19
- *
20
- * A derivation is computed where it is declared, so the derived block also matches every theme
21
- * trigger: a base reassigned on :root or on an element carrying data-theme, .light or .dark
22
- * re-derives everything below it.
23
- *
24
- * Font: --roxy-font-sans is unset by default, so every component inherits the host page font; any
25
- * value set by the host or a preset replaces it, and --roxy-font-display follows it until set.
26
- *
27
- * Motion: --roxy-motion-duration defaults to 200ms and prefers-reduced-motion forces 0ms.
28
- */
29
-
30
- /*
31
- * Two mechanisms keep the host page in charge of every token, and both are load bearing.
32
- *
33
- * Every rule sits in the roxy.tokens cascade layer, and an unlayered declaration beats a layered
34
- * one at ANY specificity, so a plain \`:root { --roxy-accent: #8b5cf6 }\` on the host page wins, and
35
- * so does the same line inside a layer of its own, because this statement registers ours first
36
- * and the CDN bundle injects this sheet at the top of <head>. A host that links this file after its
37
- * own CSS orders the layers itself: \`@layer roxy, base, components, utilities;\` before either sheet.
38
- *
39
- * Every selector is ALSO wrapped in :where(), which has ZERO specificity, so a host declaration
40
- * still wins wherever a layer cannot decide it, under every dark signal alike.
41
- *
42
- * The theme presets in styles/themes/*.css write into roxy.theme; both files declare this order,
43
- * so either one loading alone still ranks a preset above these defaults.
44
- */
45
- @layer roxy.tokens, roxy.theme;
46
-
47
- @layer roxy.tokens {
48
- /* Bases, light. Also the mode-specific derivations: accent ink and status inks mix toward black. */
49
- :where(:root, :host) {
50
- /* A real inherited property: native controls, popups and scrollbars follow it. */
51
- color-scheme: light;
52
-
53
- --roxy-bg: #ffffff;
54
- --roxy-fg: #0a0a0a;
55
- --roxy-accent: #4a6297;
56
- --roxy-success: #16a34a;
57
- --roxy-warning: #ea580c;
58
- --roxy-danger: #dc2626;
59
- --roxy-info: #0284c7;
60
-
61
- /* Accent and status inks: 70 percent toward black reads at AA on the card and on a tint of the base. */
62
- --roxy-accent-ink: color-mix(in oklab, var(--roxy-accent) 70%, black);
63
- --roxy-success-fg: color-mix(in oklab, var(--roxy-success) 70%, black);
64
- --roxy-warning-fg: color-mix(in oklab, var(--roxy-warning) 70%, black);
65
- --roxy-danger-fg: color-mix(in oklab, var(--roxy-danger) 70%, black);
66
- --roxy-info-fg: color-mix(in oklab, var(--roxy-info) 70%, black);
67
-
68
- /* Unset on purpose: a component inherits the host page font until a host or preset sets one. */
69
- --roxy-font-sans: initial;
70
- --roxy-font-mono:
71
- ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas,
72
- "Liberation Mono", monospace;
73
-
74
- --roxy-text-base: 1rem;
75
- --roxy-text-scale: 1.15;
76
- --roxy-weight-normal: 400;
77
- --roxy-weight-bold: 600;
78
- --roxy-leading-tight: 1.25;
79
- --roxy-leading-normal: 1.5;
80
- --roxy-tracking-tight: -0.01em;
81
- --roxy-tracking-normal: 0em;
82
-
83
- --roxy-space-unit: 0.25rem;
84
- --roxy-radius: 6px;
85
-
86
- --roxy-motion-duration: 200ms;
87
- --roxy-motion-easing: cubic-bezier(0.4, 0, 0.2, 1);
88
- }
89
-
90
- /* Derived roles, identical in every mode, restated on every theme trigger so they follow its bases. */
91
- :where(:root, :host, [data-theme], .light, .dark) {
92
- /* Flat: the card is the page colour, separated by a hairline. */
93
- --roxy-surface: var(--roxy-bg);
94
- --roxy-primary: var(--roxy-fg);
95
- --roxy-secondary: color-mix(in oklab, var(--roxy-fg) 78%, var(--roxy-bg));
96
- --roxy-muted: color-mix(in oklab, var(--roxy-fg) 60%, var(--roxy-bg));
97
- --roxy-border: color-mix(in oklab, var(--roxy-fg) 14%, var(--roxy-bg));
98
- --roxy-ring: color-mix(in srgb, var(--roxy-accent) 40%, transparent);
99
- --roxy-heat: var(--roxy-danger);
100
-
101
- --roxy-font-display: var(--roxy-font-sans);
102
-
103
- --roxy-text-sm: calc(var(--roxy-text-base) / var(--roxy-text-scale));
104
- --roxy-text-xs: calc(var(--roxy-text-sm) / var(--roxy-text-scale));
105
- --roxy-text-lg: calc(var(--roxy-text-base) * var(--roxy-text-scale));
106
- --roxy-text-xl: calc(
107
- var(--roxy-text-lg) *
108
- var(--roxy-text-scale) *
109
- var(--roxy-text-scale)
110
- );
111
-
112
- --roxy-space-xs: var(--roxy-space-unit);
113
- --roxy-space-sm: calc(var(--roxy-space-unit) * 2);
114
- --roxy-space-md: calc(var(--roxy-space-unit) * 4);
115
- --roxy-space-lg: calc(var(--roxy-space-unit) * 6);
116
- --roxy-space-xl: calc(var(--roxy-space-unit) * 10);
117
- --roxy-line-thick: calc(var(--roxy-space-unit) / 2);
118
- --roxy-touch: calc(var(--roxy-space-unit) * 11);
119
-
120
- --roxy-radius-sm: calc(var(--roxy-radius) / 2);
121
- --roxy-radius-md: var(--roxy-radius);
122
- --roxy-radius-lg: calc(var(--roxy-radius) * 5 / 3);
123
- --roxy-radius-full: 9999px;
124
-
125
- /* Flat surfaces cast nothing; only a floating layer (a popup, an enlarged chart) lifts. */
126
- --roxy-shadow-sm: none;
127
- --roxy-shadow-md: 0 4px 12px color-mix(in srgb, black 10%, transparent);
128
- --roxy-shadow-lg: 0 12px 32px color-mix(in srgb, black 18%, transparent);
129
- }
130
-
131
- /* Bases, dark, by system preference. Inks mix toward white so they read on a dark card. */
132
- @media (prefers-color-scheme: dark) {
133
- :where(:root, :host) {
134
- color-scheme: dark;
135
- --roxy-bg: #0a0a0a;
136
- --roxy-fg: #fafafa;
137
- --roxy-accent: #92aade;
138
- --roxy-success: #22c55e;
139
- --roxy-warning: #fb923c;
140
- --roxy-danger: #ef4444;
141
- --roxy-info: #38bdf8;
142
-
143
- --roxy-accent-ink: var(--roxy-accent);
144
- --roxy-success-fg: color-mix(in oklab, var(--roxy-success) 70%, white);
145
- --roxy-warning-fg: color-mix(in oklab, var(--roxy-warning) 70%, white);
146
- --roxy-danger-fg: color-mix(in oklab, var(--roxy-danger) 70%, white);
147
- --roxy-info-fg: color-mix(in oklab, var(--roxy-info) 70%, white);
148
- }
149
- }
150
-
151
- /* Explicit light: beats the OS dark block when the host chooses light. */
152
- :where(
153
- :root[data-theme="light"],
154
- [data-theme="light"],
155
- :root.light,
156
- .light,
157
- :host([data-theme="light"])
158
- ) {
159
- color-scheme: light;
160
- --roxy-bg: #ffffff;
161
- --roxy-fg: #0a0a0a;
162
- --roxy-accent: #4a6297;
163
- --roxy-success: #16a34a;
164
- --roxy-warning: #ea580c;
165
- --roxy-danger: #dc2626;
166
- --roxy-info: #0284c7;
167
-
168
- --roxy-accent-ink: color-mix(in oklab, var(--roxy-accent) 70%, black);
169
- --roxy-success-fg: color-mix(in oklab, var(--roxy-success) 70%, black);
170
- --roxy-warning-fg: color-mix(in oklab, var(--roxy-warning) 70%, black);
171
- --roxy-danger-fg: color-mix(in oklab, var(--roxy-danger) 70%, black);
172
- --roxy-info-fg: color-mix(in oklab, var(--roxy-info) 70%, black);
173
- }
174
-
175
- /* Explicit dark: a .dark class or data-theme="dark" on any ancestor themes every component below it. */
176
- :where(
177
- :root[data-theme="dark"],
178
- [data-theme="dark"],
179
- :root.dark,
180
- .dark,
181
- :host([data-theme="dark"])
182
- ) {
183
- color-scheme: dark;
184
- --roxy-bg: #0a0a0a;
185
- --roxy-fg: #fafafa;
186
- --roxy-accent: #92aade;
187
- --roxy-success: #22c55e;
188
- --roxy-warning: #fb923c;
189
- --roxy-danger: #ef4444;
190
- --roxy-info: #38bdf8;
191
-
192
- --roxy-accent-ink: var(--roxy-accent);
193
- --roxy-success-fg: color-mix(in oklab, var(--roxy-success) 70%, white);
194
- --roxy-warning-fg: color-mix(in oklab, var(--roxy-warning) 70%, white);
195
- --roxy-danger-fg: color-mix(in oklab, var(--roxy-danger) 70%, white);
196
- --roxy-info-fg: color-mix(in oklab, var(--roxy-info) 70%, white);
197
- }
198
-
199
- @media (prefers-reduced-motion: reduce) {
200
- :where(:root, :host) {
201
- --roxy-motion-duration: 0ms;
202
- }
203
- }
204
- }
205
- `;var W="roxy-ui-tokens";function J(){if(typeof document>"u")return null;let n=document.getElementById(W);if(n)return n;let e=document.createElement("style");return e.id=W,e.textContent=ze,document.head.prepend(e),e}var qe="__ROXY_UI_I18N__";function Ke(){let n=globalThis,e=n[qe];if(e)return e;let t={catalogs:{},fieldLabels:{},requested:new Set,listeners:new Set};return n[qe]=t,t}function Lt(n,e){return e?n.replace(/\{\{(\w+)\}\}/g,(t,r)=>r in e?String(e[r]??""):t):n}function Be(n,e,t){return Lt(Ft(n,e)??e,t)}function Ft(n,e){if(!n)return;let{catalogs:t}=Ke(),r=n.toLowerCase();return(t[r]??t[r.split("-")[0]])?.[V(e)]}function Ye(n){let{listeners:e}=Ke();return e.add(n),()=>{e.delete(n)}}var X=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){this.unsubscribe=Ye(()=>this.host.requestUpdate())}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=void 0}};var Q=class extends E{constructor(){super();this.translator=(t,r)=>this.t(t,r);new X(this)}connectedCallback(){super.connectedCallback(),J()}t(t,r){return Be(this.effectiveLang(),t,r)}effectiveLang(){return be(this)}};var Ve=x`:where([part~=card]){background:var(--roxy-surface);color:var(--roxy-fg);border:1px solid var(--roxy-border);border-radius:var(--roxy-radius-lg);box-shadow:var(--roxy-shadow-sm)}:where([part~=card] [part~=card],[part~=card] [part~=reading],[part~=card] .roxy-card){border:0;border-block-start:1px solid var(--roxy-border);box-shadow:none;background:0 0;border-radius:0;padding-inline:0}:host([bare]) [part~=card]{box-shadow:none;background:0 0;border:0;border-radius:0;padding:0}:where(h1,h2){color:var(--roxy-fg);font-size:var(--roxy-text-lg);font-weight:var(--roxy-weight-bold);line-height:var(--roxy-leading-tight);letter-spacing:var(--roxy-tracking-tight);text-wrap:balance}:where(h3,h4,h5,h6){color:var(--roxy-fg);font-size:var(--roxy-text-base);font-weight:var(--roxy-weight-bold);line-height:var(--roxy-leading-tight);letter-spacing:var(--roxy-tracking-normal);text-transform:none}:where(.roxy-label,th,dt){color:var(--roxy-muted);font-size:var(--roxy-text-sm);font-weight:var(--roxy-weight-normal);letter-spacing:var(--roxy-tracking-normal);text-transform:none}:where(.roxy-chips){gap:var(--roxy-space-xs);flex-wrap:wrap;margin:0;padding:0;list-style:none;display:flex}:where(.roxy-chip,.roxy-chips>li){align-items:center;gap:var(--roxy-space-xs);padding:calc(var(--roxy-space-unit) / 2) var(--roxy-space-sm);border:1px solid var(--roxy-border);border-radius:var(--roxy-radius-sm);color:var(--roxy-secondary);font-size:var(--roxy-text-xs);line-height:var(--roxy-leading-tight);overflow-wrap:anywhere;background:0 0;max-inline-size:100%;display:inline-flex}:where(.roxy-chip[data-tone=success],.roxy-chips>li[data-tone=success]){color:var(--roxy-success-fg)}:where(.roxy-chip[data-tone=warning],.roxy-chips>li[data-tone=warning]){color:var(--roxy-warning-fg)}:where(.roxy-chip[data-tone=danger],.roxy-chips>li[data-tone=danger]){color:var(--roxy-danger-fg)}:where(.roxy-chip[data-tone=info],.roxy-chips>li[data-tone=info]){color:var(--roxy-info-fg)}:where(table){border-collapse:collapse;font-size:var(--roxy-text-sm);font-variant-numeric:tabular-nums}:where(th,td){padding:var(--roxy-space-xs) var(--roxy-space-sm);border-block-end:1px solid var(--roxy-border);text-align:start;vertical-align:top}:where(summary){cursor:pointer}:where(a,button,summary,input,select,textarea,[tabindex]):focus-visible{outline:var(--roxy-line-thick) solid var(--roxy-ring);outline-offset:var(--roxy-line-thick)}:where(summary:focus-visible){border-radius:var(--roxy-radius-sm)}:where(input,select,textarea,button){font:inherit}:where(input:not([type=checkbox],[type=radio],[type=range]),select,textarea){padding:var(--roxy-space-xs) var(--roxy-space-sm);background:var(--roxy-bg);color:var(--roxy-fg);border:1px solid var(--roxy-border);border-radius:var(--roxy-radius-md)}`;var Ut=x`:host{--roxy-label-col:minmax(0, 25%);--_mask:var(--roxy-surface);font-family:var(--roxy-font-sans);color:var(--roxy-fg);font-size:var(--roxy-text-base);line-height:var(--roxy-leading-normal);animation:roxy-fade-in var(--roxy-motion-duration) var(--roxy-motion-easing) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--_mask:var(--roxy-bg)}:host([hidden]){display:none}: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)}@keyframes roxy-fade-in{0%{transform:translateY(calc(var(--roxy-space-unit) / 2))}to{transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border) 0%, color-mix(in srgb, var(--roxy-border) 60%, transparent) 50%, var(--roxy-border) 100%);border-radius:var(--roxy-radius-md);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);color:var(--roxy-muted);text-align:center;font-size:var(--roxy-text-sm)}.roxy-error{gap:var(--roxy-space-sm);padding:var(--roxy-space-lg);background:var(--roxy-surface);border:1px solid var(--roxy-danger);border-radius:var(--roxy-radius-md);color:var(--roxy-danger-fg);font-size:var(--roxy-text-sm);justify-items:start;display:grid}:host(:focus-within) .roxy-card{outline:var(--roxy-line-thick) solid var(--roxy-ring);outline-offset:var(--roxy-line-thick)}.roxy-attribution{margin-top:var(--roxy-space-sm);font-size:var(--roxy-text-xs);color:var(--roxy-muted);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink);text-decoration:underline}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs) var(--roxy-space-md);border:1px solid var(--roxy-border);border-radius:var(--roxy-radius-md);color:var(--roxy-fg);font-family:inherit;font-size:var(--roxy-text-sm);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent);color:var(--roxy-accent-ink)}.roxy-edit:disabled{cursor:progress;color:var(--roxy-muted)}roxy-endpoint-form+*{margin-top:var(--roxy-space-md)}.roxy-more{justify-items:center;gap:var(--roxy-space-sm);margin-top:var(--roxy-space-md);display:grid}.roxy-more .roxy-edit{min-height:var(--roxy-touch)}:host{font-variant-emoji:text}`,ee=[Ut,Ve];var Nt="__cols",Ht="__rows";function It(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function te(n){if(Array.isArray(n)){let i=!1,s=n.map(l=>{let a=te(l);return a!==l&&(i=!0),a});return i?s:n}if(!It(n))return n;let e=n[Nt],t=n[Ht];if(Array.isArray(e)&&Array.isArray(t)&&Object.keys(n).length===2)return t.map(i=>{let s={};return e.forEach((l,a)=>{s[l]=te(i[a])}),s});let r=!1,o={};for(let[i,s]of Object.entries(n)){let l=te(s);l!==s&&(r=!0),o[i]=l}return r?o:n}function Ze(n){return te(n)}function We(n,e){return n.find(t=>t.attrs&&Object.entries(t.attrs).every(([r,o])=>e[r]===o))??n[0]}var Gt="pk_live_YOUR_KEY",Je={secret:{reason:"possible-secret-key",message:"Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side."},sample:{reason:"sample-key",message:"Replace the sample key with your own publishable key from your RoxyAPI account."}};function Xe(n){if(n)return n===Gt?Je.sample:n.startsWith("pk_")?void 0:Je.secret}function Qe(n,e,t={}){t.warn&&console.warn(e.message),n.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:e.reason,message:e.message},bubbles:!0,composed:!0}))}var et="https://roxyapi.com/api/v2";async function Dt(n){try{let e=await n.json();if(e?.error){let t=e.code==="validation_error"&&Array.isArray(e.issues)?e.issues.filter(r=>typeof r.path=="string"&&typeof r.message=="string").map(r=>({path:r.path,message:r.message})):null;return{message:e.error,issues:t?.length?t:null,worded:!0}}}catch{}return{message:`Request failed (${n.status})`,issues:null,worded:!1}}var tt={fromAttribute:n=>{if(n!=null){try{let e=JSON.parse(n);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}console.warn("[roxy-ui] submit-context must be a JSON object; sending the request without it.")}}},L=class extends Error{constructor(t,r=null,o=!0){super(t);this.issues=r;this.worded=o}};function rt(n){return n.submitUrl?void 0:Xe(n.publishableKey)}async function ve(n,e,t){let r=rt(n);if(r)throw new L(r.message);let o=n.submitUrl?await fetch(n.submitUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:Mt(e,n.submitContext),signal:t}):await jt(n,e,t);if(!o.ok){let i=await Dt(o);throw new L(i.message,i.issues,i.worded)}return await o.json()}function Mt(n,e){return JSON.stringify(e?{...n,context:e}:n)}function jt(n,e,t){let r=new URL(`${n.baseUrl??et}${e.path}`,document.baseURI);for(let[i,s]of Object.entries(e.query??{}))s!=null&&r.searchParams.set(i,String(s));let o={Accept:"application/json"};return n.publishableKey&&(o["X-API-Key"]=n.publishableKey),e.body!=null&&(o["Content-Type"]="application/json"),fetch(r,{method:e.method??"GET",headers:o,body:e.body!=null?JSON.stringify(e.body):void 0,signal:t})}var re=class{constructor(e){this.baseUrl=et;this.worded=!0;this.host=e,e.addController(this)}hostDisconnected(){this.abort?.abort(),this.abort=void 0}async run(e){this.worded=!0;let t=rt(this);if(t){this.host.error=t.message,Qe(this.host,t);return}this.abort?.abort();let r=new AbortController;this.abort=r,this.host.loading=!0,this.host.error=null,this.host.issues=null;try{let o=await ve(this,e,r.signal);if(r.signal.aborted)return;this.host.data=o}catch(o){if(r.signal.aborted||o?.name==="AbortError")return;o instanceof L&&(this.host.issues=o.issues),this.worded=o instanceof L&&o.worded,this.host.error=o instanceof Error?o.message:String(o)}finally{this.abort===r&&(this.abort=void 0),r.signal.aborted||(this.host.loading=!1)}}};function nt(n,e,t,r=[]){let o={...t},i=`/${n.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(m,h)=>{let p=o[h];return delete o[h],encodeURIComponent(String(p??""))}),s=new Set(r),l={},a={};for(let[m,h]of Object.entries(o))h===void 0||h===""||(e==="GET"||s.has(m)?l[m]=h:a[m]=h);return{path:i,method:e,query:l,body:e==="POST"?a:void 0}}function ne(){return c`<svg class="roxy-chevron" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`}var ot=x`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:.7lh;height:.7lh;color:var(--roxy-muted);transition:transform var(--roxy-motion-duration) var(--roxy-motion-easing);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;var it=x`.block{border-top:1px solid var(--roxy-border);padding-top:var(--roxy-space-md)}.block h3{margin:0 0 var(--roxy-space-sm)}.interp-card{padding-block:var(--roxy-space-sm)}.interp-card summary{font-weight:var(--roxy-weight-bold);color:var(--roxy-fg);align-items:center;gap:var(--roxy-space-sm);font-size:var(--roxy-text-sm);display:flex}.interp-lead{align-items:baseline;gap:var(--roxy-space-sm);flex-wrap:wrap;flex:auto;order:1;min-width:0;display:inline-flex}.interp-aside{align-items:center;gap:var(--roxy-space-sm);flex-shrink:0;order:2;display:inline-flex}.roxy-chevron{order:3}.interp-aside small{color:var(--roxy-muted);font-weight:var(--roxy-weight-normal);white-space:nowrap}@container (width<=26rem){.interp-card summary{flex-wrap:wrap}.roxy-chevron{order:2}.interp-aside{flex-basis:100%;order:3;justify-content:flex-end}}.interp-body{margin-top:var(--roxy-space-sm);gap:var(--roxy-space-sm);color:var(--roxy-fg);font-size:var(--roxy-text-sm);line-height:var(--roxy-leading-normal);overflow-wrap:anywhere;display:grid}.interp-body p{margin:0}`;function st(n,e,t){let r=n.filter(o=>!!o.body);return r.length===0?d:c`<section class="block" part="section readings"><h3>${t}</h3>${r.map((o,i)=>c`<details class="interp-card" part="reading" name="${e}" ?open="${i===0}"><summary><span class="interp-lead">${o.label}</span> ${ne()} ${o.aside?c`<span class="interp-aside"><small>${o.aside}</small></span>`:d}</summary><div class="interp-body"><p>${o.body}</p>${o.extra??d}</div></details>`)}</section>`}var zt="roxy-data";function qt(n){return n.nodeName==="SCRIPT"&&n.getAttribute("type")==="application/json"}var oe=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(qt(e)&&e.classList.contains(zt))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};var u=class extends Q{constructor(){super();this.data=null;this.endpoint="";this.remember=!1;this.hideReadings=!1;this.hideSections="";this.loading=!1;this.error=null;this.issues=null;this.selfFetched=!1;this.editing=!1;this.sticky=!1;this.hostLoaded=!1;this.moreLoading=!1;this.moreError=null;this.onMore=async()=>{let t=this.lastRequest,r=this.listKey,o=this.listRows();if(!(!t||!r||!o)){this.moreLoading=!0,this.moreError=null;try{let i=await ve(this.fetcher,{...t,query:{...t.query,offset:o.length}});if(this.lastRequest!==t)return;let s=i[r];this.data={...this.data,...i,[r]:[...o,...Array.isArray(s)?s:[]]}}catch(i){this.lastRequest===t&&(this.moreError=i instanceof Error?i.message:String(i))}finally{this.moreLoading=!1}}};this.onEdit=()=>{this.editing=!0};this.onFormSubmit=t=>{let r=this.selfFetch();if(!r)return;let o=t.detail;this.lastValues=o.values,this.sticky=!!o.sticky,this.selfFetched=!0,this.editing=!1,this.remember&&this.writeRemembered(o.values),this.fetchFresh(nt(r.endpoint,r.method,o.values,o.queryKeys??[]))};new oe(this),this.fetcher=new re(this)}static{this.styles=[ee]}static{this.endpoints=[]}willUpdate(t){if(t.has("data")&&this.data!=null){let r=Ze(this.data);r!==this.data&&(this.data=r)}(t.has("publishableKey")||t.has("baseUrl")||t.has("submitUrl")||t.has("submitContext"))&&this.syncFetcher()}syncFetcher(){this.fetcher.publishableKey=this.publishableKey,this.baseUrl&&(this.fetcher.baseUrl=this.baseUrl),this.fetcher.submitUrl=this.submitUrl,this.fetcher.submitContext=this.submitContext}selfFetch(){let t=this.endpoint?{endpoint:this.endpoint,method:"POST"}:this.hostLoaded||!(this.publishableKey||this.submitUrl)?void 0:We(this.constructor.endpoints,this);return t&&{endpoint:t.endpoint,method:this.method??t.method}}render(){return c`${this.hiddenSectionsStyle()}${this.renderState()}`}drawn(t){try{return this.renderData(t)}catch(r){return console.warn(`[roxy-ui] ${this.localName} could not draw its response`,r),this.dispatchEvent(new CustomEvent("roxy-render-error",{detail:{error:r},bubbles:!0,composed:!0})),customElements.get("roxy-data")?c`<roxy-data .data="${t}" lang="${_(this.effectiveLang())}"></roxy-data>`:this.renderEmpty()}}hiddenSectionsStyle(){let t=this.hideSections.split(",").map(o=>o.trim().toLowerCase()).filter(o=>/^[a-z][a-z0-9-]*$/.test(o));if(t.length===0)return d;let r=t.map(o=>`[part~="${o}"],roxy-endpoint-form::part(${o}){display:none!important}`).join("");return c`<style>${r}</style>`}renderState(){return this.selfFetch()&&this.sticky&&this.selfFetched&&!this.editing?this.renderWithForm(this.stickyBody()):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()?c`${this.drawn(this.data)}${this.renderAttribution()}`:this.drawn(this.data):this.renderNoData()}renderInterpretation(t,r,o){return this.hideReadings?d:st(t,r,this.t(o??"Reading"))}renderResult(t){let r=c`<div class="roxy-edit-bar" part="edit-bar"><button type="button" class="roxy-edit" @click="${this.onEdit}">${this.t("Edit query")}</button></div>${this.drawn(t)}`;return this.showAttribution()?c`${r}${this.renderAttribution()}`:r}renderWithForm(t){return c`${this.renderForm()}${t}`}stickyBody(){return this.loading?this.renderLoading():this.error!=null?this.issues?d:this.renderErrorBanner(this.error):this.data==null?d:this.showAttribution()?c`${this.drawn(this.data)}${this.renderAttribution()}`:this.drawn(this.data)}renderMore(){let t=this.listRows(),r=this.data?.total;return!this.lastRequest||!t||typeof r!="number"?d:t.length>=r?d:c`<div class="roxy-more" part="more"><button type="button" class="roxy-edit" ?disabled="${this.moreLoading}" aria-busy="${this.moreLoading?"true":"false"}" @click="${this.onMore}">${this.t("Show more")}</button> ${this.moreError?c`<p class="roxy-error" role="alert">${this.t(this.moreError)}</p>`:d}</div>`}listRows(){let t=this.listKey?this.data?.[this.listKey]:void 0;return Array.isArray(t)?t:void 0}fetchFresh(t){return this.lastRequest=t,this.openedRow=void 0,this.openedRowId=void 0,this.moreError=null,this.fetcher.run(t)}load(t){return this.hostLoaded=!0,this.syncFetcher(),this.fetchFresh(t)}pickRow(t){this.dispatchEvent(new CustomEvent("roxy-symbol-select",{detail:t,bubbles:!0,composed:!0})),this.openRow(t.id)}openRow(t){if(!this.rowDetail||!(this.publishableKey||this.submitUrl))return;let r=this.openedRow??document.createElement(this.rowDetail.tag);r.publishableKey=this.publishableKey,r.baseUrl=this.baseUrl,r.submitUrl=this.submitUrl,r.submitContext=this.submitContext,r.hideReadings=this.hideReadings,r.hideSections=this.hideSections;let o=this.effectiveLang();o&&r.setAttribute("lang",o),this.openedRow=r,this.openedRowId=t,r.load({path:`/${this.rowDetail.path.replace("{id}",encodeURIComponent(t))}`,method:"GET",query:{lang:je(this)}}).then(()=>r.scrollIntoView?.({block:"nearest"}))}showAttribution(){return this.attribution!=null&&this.attribution!=="off"&&this.attribution!=="false"}renderAttribution(){return c`<div class="roxy-attribution" part="attribution"><a href="https://roxyapi.com/?utm_source=widget&utm_medium=embed" target="_blank" rel="noopener">${this.t("Spiritual data by RoxyAPI")}</a></div>`}renderNoData(){return this.selfFetch()?this.renderWithForm(d):this.renderEmpty()}renderForm(){let t=this.selfFetch();return c`<roxy-endpoint-form part="form" exportparts="hint" data-endpoint="${t?.endpoint??""}" method="${t?.method??"POST"}" spec-url="${_(this.specUrl)}" publishable-key="${_(this.publishableKey)}" location-url="${_(this.locationUrl)}" submit-label="${_(this.submitLabel)}" lang="${_(this.effectiveLang())}" .initialValues="${this.formInitialValues()}" .serverIssues="${this.issues}" .apiRoute="${this.fetcher}" .autoload="${!this.selfFetched}" .fullPages="${!!this.listKey}" @roxy-submit="${this.onFormSubmit}"></roxy-endpoint-form>`}formInitialValues(){return this.lastValues??(this.remember?this.readRemembered():void 0)}rememberKey(){return`roxy-ui:form:${this.selfFetch()?.endpoint??""}`}readRemembered(){try{let t=sessionStorage.getItem(this.rememberKey());return t?JSON.parse(t):void 0}catch{return}}writeRemembered(t){try{sessionStorage.setItem(this.rememberKey(),JSON.stringify(t))}catch{}}renderEmpty(){return c`<div class="roxy-empty" role="status" part="empty">${this.t("No data")}</div>`}renderLoading(){return c`<div class="roxy-skeleton" style="height:5lh" role="status" aria-label="${this.t("Loading")}" part="loading"></div>`}renderError(t){let r=!!this.selfFetch();if(r&&this.issues)return this.renderForm();let o=this.renderErrorBanner(t);return r?c`${o}${this.renderForm()}`:o}renderErrorBanner(t){return c`<div class="roxy-error" role="alert" part="error">${!this.fetcher.worded&&this.errorMessage||this.t(t)}</div>`}};g([y({attribute:!1})],u.prototype,"data",2),g([y({type:String,attribute:"data-endpoint"})],u.prototype,"endpoint",2),g([y({type:String})],u.prototype,"method",2),g([y({type:String,attribute:"publishable-key"})],u.prototype,"publishableKey",2),g([y({type:String,attribute:"base-url"})],u.prototype,"baseUrl",2),g([y({type:String,attribute:"spec-url"})],u.prototype,"specUrl",2),g([y({type:String,attribute:"submit-url"})],u.prototype,"submitUrl",2),g([y({attribute:"submit-context",converter:tt})],u.prototype,"submitContext",2),g([y({type:String,attribute:"location-url"})],u.prototype,"locationUrl",2),g([y({type:Boolean})],u.prototype,"remember",2),g([y({type:Boolean,attribute:"hide-readings",reflect:!0})],u.prototype,"hideReadings",2),g([y({type:String,attribute:"hide-sections",reflect:!0})],u.prototype,"hideSections",2),g([y({type:String,attribute:"submit-label"})],u.prototype,"submitLabel",2),g([y({type:String,attribute:"error-message"})],u.prototype,"errorMessage",2),g([y({type:String})],u.prototype,"attribution",2),g([b()],u.prototype,"loading",2),g([b()],u.prototype,"error",2),g([b()],u.prototype,"issues",2),g([b()],u.prototype,"selfFetched",2),g([b()],u.prototype,"editing",2),g([b()],u.prototype,"sticky",2),g([b()],u.prototype,"openedRow",2),g([b()],u.prototype,"openedRowId",2),g([b()],u.prototype,"moreLoading",2),g([b()],u.prototype,"moreError",2);var at=n=>e=>{customElements.get(n)||customElements.define(n,e)};var Kt=/^\d{4}-\d{2}-\d{2}$/,Bt=/^\d{4}-\d{2}$/,Yt=/^\d{2}:\d{2}(:\d{2})?$/,Vt=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/,dt=new Map;function Zt(n){if(!n)return["en"];let e=dt.get(n);if(e)return[e,"en"];let t="en";try{t=Intl.getCanonicalLocales(n)[0]??"en"}catch{t="en"}return dt.set(n,t),[t,"en"]}function Wt(n){let e=Yt.test(n)?`1970-01-01T${n}`:Kt.test(n)?`${n}T00:00:00`:Bt.test(n)?`${n}-01T00:00:00`:Vt.test(n)?n.replace(" ","T"):null;return e?{d:new Date(`${e}Z`),timeZone:"UTC"}:{d:new Date(n)}}function lt(n,e){if(typeof e!="string"||e.length===0)return"";let{d:t,timeZone:r}=Wt(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(Zt(n),{month:"short",day:"numeric",year:"numeric",timeZone:r})}var R=class extends u{resolveHexagram(){let e=this.data;if(!e)return null;if("hexagram"in e&&e.hexagram){if("lines"in e){let i=e,s=i.hexagram;return{hex:s,lines:i.lines,date:i.date,changingLinePositions:i.changingLinePositions,changingLines:i.changingLines??s.changingLines,resultingHexagram:i.resultingHexagram}}let r=e,o=r.hexagram;return{hex:o,changingLines:o.changingLines,dailyMessage:r.dailyMessage,date:r.date}}let t=e;return{hex:t,changingLines:t.changingLines}}renderData(){let e=this.resolveHexagram();if(!e)return this.renderEmpty();let{hex:t,lines:r,changingLinePositions:o,changingLines:i,dailyMessage:s,date:l,resultingHexagram:a}=e;return c`<article class="card" part="card" aria-label="${this.t("I Ching hexagram")}">${this.renderHexagram("hexagram",t,r,o,i,s,l)} ${a?c`<details class="result" part="section resulting-hexagram"><summary>${this.t("Becomes hexagram {{number}} {{name}}.",{number:a.number,name:a.english??a.chinese??""})}${ne()}</summary><div class="result-chart">${this.renderHexagram("result",a)}</div></details>`:d}</article>`}renderHexagram(e,t,r,o,i,s,l){let a=r??this.derivedLines(t),m=new Set(o??[]),h=!this.hideReadings;return c`<div class="glyphs" part="chart">${t.symbol?c`<div class="symbol">${t.symbol}</div>`:d} ${a.length>0?c`<div class="lines" aria-hidden="true">${a.slice().reverse().map((p,f)=>{let v=a.length-1-f+1,C=m.has(v),Se=p===6||p===8;return c`<div class="line ${`${Se?"broken":"solid"}${C?" changing":""}`}">${Se?c`<span class="seg"></span><span class="seg"></span>`:c`<span class="seg"></span>`}</div>`})}</div>`:d}</div><div part="header"><h2>${[t.number!=null?`${t.number}.`:"",t.english??t.chinese??this.t("I Ching hexagram")].filter(Boolean).join(" ")}</h2>${l?c`<time class="daily-date" part="details" datetime="${l}">${lt(this.effectiveLang(),l)}</time>`:d}<p class="subtitle">${t.chinese?c`${t.chinese}`:d} ${t.pinyin?c`· ${t.pinyin}`:d}</p><div class="trigrams roxy-label" part="details">${t.upperTrigram?c`<div>${this.t("Upper")} <span class="tri-glyph">${fe(t.upperTrigram)??""}</span>${t.upperTrigram}</div>`:d} ${t.lowerTrigram?c`<div>${this.t("Lower")} <span class="tri-glyph">${fe(t.lowerTrigram)??""}</span>${t.lowerTrigram}</div>`:d}</div>${t.judgment&&h?c`<p class="judgment">${t.judgment}</p>`:d} ${t.image&&h?c`<p class="image">${t.image}</p>`:d} ${s&&h?c`<p class="message">${s}</p>`:d} ${t.interpretation?.general&&h?c`<p>${t.interpretation.general}</p>`:d} ${m.size>0?c`<div class="changes" part="section changing-lines">${this.t("Changing lines: {{lines}}.",{lines:Array.from(m).sort((p,f)=>p-f).join(", ")})}</div>`:d} ${this.renderTopics(t,e)} ${this.renderLines(i??t.changingLines,m,`${e}-lines`)}</div>`}renderTopics(e,t){let r=e.interpretation;return r?this.renderInterpretation([{label:this.t("Love"),body:r.love??""},{label:this.t("Career"),body:r.career??""},{label:this.t("Decision"),body:r.decision??""},{label:this.t("Advice"),body:r.advice??""}].filter(o=>o.body),`${t}-topics`,"Readings"):d}renderLines(e,t,r){let o=e??[];if(o.length===0)return d;let i=t.size>0,s=i?o.filter(a=>t.has(a.position)):o;if(s.length===0)return d;let l=s.map(a=>({label:`Line ${a.position}`,body:a.text??"",extra:a.meaning?c`<p class="line-meaning">${a.meaning}</p>`:d}));return this.renderInterpretation(l,r,i?"Changing lines":"Lines")}derivedLines(e){let t=e.binary??"";return/^[01]{6}$/.test(t)?Array.from(t,r=>r==="1"?7:8):[]}};R.endpoints=De,R.styles=[ee,ot,it,x`.card{gap:var(--roxy-space-lg);padding:var(--roxy-space-lg);grid-template-columns:minmax(0,4lh) minmax(0,1fr);display:grid}.result-chart{gap:var(--roxy-space-lg);grid-template-columns:minmax(0,4lh) minmax(0,1fr);padding-block-start:var(--roxy-space-md);display:grid}.result{border-block-start:1px solid var(--roxy-border);grid-column:1/-1;padding-block-start:var(--roxy-space-md)}.result>summary{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm);display:flex}@container (width<=480px){.card,.result-chart{grid-template-columns:minmax(0,1fr)}}h2,p{margin:0}.glyphs{align-content:start;align-self:start;justify-items:center;gap:var(--roxy-space-md);display:grid}.symbol{color:var(--roxy-accent-ink);font-size:calc(var(--roxy-text-xl) * 2);line-height:1}.lines{gap:calc(var(--roxy-space-unit) * 1.5);inline-size:2lh;display:grid}.line{gap:var(--roxy-space-xs);grid-template-columns:1fr 1fr;display:grid}.seg{block-size:calc(var(--roxy-line-thick) * 3);background:var(--roxy-fg);display:block}.line.solid .seg{grid-column:1/-1}.line.changing .seg{background:var(--roxy-accent)}.subtitle{color:var(--roxy-muted);font-size:var(--roxy-text-sm);margin-block-end:var(--roxy-space-sm)}.daily-date{color:var(--roxy-secondary);font-size:var(--roxy-text-sm);margin-block-end:var(--roxy-space-sm);display:block}.trigrams{gap:var(--roxy-space-md);flex-wrap:wrap;margin-block-end:var(--roxy-space-sm);display:flex}.tri-glyph{color:var(--roxy-accent-ink);font-size:var(--roxy-text-xl);vertical-align:middle;margin-inline-end:var(--roxy-space-xs)}.judgment,.image,.message{font-size:var(--roxy-text-sm);margin-block-end:var(--roxy-space-sm)}.judgment:before{content:"Judgment. ";color:var(--roxy-secondary);font-weight:var(--roxy-weight-bold)}.image:before{content:"Image. ";color:var(--roxy-secondary);font-weight:var(--roxy-weight-bold)}.line-meaning{border-inline-start:var(--roxy-line-thick) solid var(--roxy-border);color:var(--roxy-muted);padding-inline-start:var(--roxy-space-sm)}.changes{border-block-start:1px solid var(--roxy-border);color:var(--roxy-accent-ink);font-size:var(--roxy-text-sm);margin-block-start:var(--roxy-space-md);padding-block-start:var(--roxy-space-md)}`],R=g([at("roxy-hexagram")],R);return mt(Jt);})();
1
+ var RoxyUI_hexagram=(()=>{var j=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var he=(n,t)=>{for(var e in t)j(n,e,{get:t[e],enumerable:!0})},ue=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ce(t))!pe.call(n,o)&&o!==e&&j(n,o,{get:()=>t[o],enumerable:!(r=wt(t,o))||r.enumerable});return n};var me=n=>ue(j({},"__esModule",{value:!0}),n),g=(n,t,e,r)=>{for(var o=r>1?void 0:r?wt(t,e):t,i=n.length-1,s;i>=0;i--)(s=n[i])&&(o=(r?s(t,e,o):s(o))||o);return r&&o&&j(t,e,o),o};var Je={};he(Je,{ROXY_UI_TOKENS_STYLE_ID:()=>W,RoxyHexagram:()=>R,injectRoxyTokens:()=>J});var z=globalThis,q=z.ShadowRoot&&(z.ShadyCSS===void 0||z.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,it=Symbol(),Et=new WeakMap,F=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==it)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(q&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=Et.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Et.set(e,t))}return t}toString(){return this.cssText}},$t=n=>new F(typeof n=="string"?n:n+"",void 0,it),x=(n,...t)=>{let e=n.length===1?n[0]:t.reduce((r,o,i)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+n[i+1],n[0]);return new F(e,n,it)},Tt=(n,t)=>{if(q)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),o=z.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=e.cssText,n.appendChild(r)}},st=q?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return $t(e)})(n):n;var{is:ge,defineProperty:ye,getOwnPropertyDescriptor:fe,getOwnPropertyNames:xe,getOwnPropertySymbols:be,getPrototypeOf:ve}=Object,K=globalThis,kt=K.trustedTypes,Se=kt?kt.emptyScript:"",we=K.reactiveElementPolyfillSupport,U=(n,t)=>n,N={toAttribute(n,t){switch(t){case Boolean:n=n?Se:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},B=(n,t)=>!ge(n,t),At={attribute:!0,type:String,converter:N,reflect:!1,useDefault:!1,hasChanged:B};Symbol.metadata??=Symbol("metadata"),K.litPropertyMetadata??=new WeakMap;var S=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=At){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),o=this.getPropertyDescriptor(t,r,e);o!==void 0&&ye(this.prototype,t,o)}}static getPropertyDescriptor(t,e,r){let{get:o,set:i}=fe(this.prototype,t)??{get(){return this[e]},set(s){this[e]=s}};return{get:o,set(s){let l=o?.call(this);i?.call(this,s),this.requestUpdate(t,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??At}static _$Ei(){if(this.hasOwnProperty(U("elementProperties")))return;let t=ve(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(U("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(U("properties"))){let e=this.properties,r=[...xe(e),...be(e)];for(let o of r)this.createProperty(o,e[o])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,o]of e)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let o=this._$Eu(e,r);o!==void 0&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let o of r)e.unshift(st(o))}else t!==void 0&&e.push(st(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Tt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){let r=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,r);if(o!==void 0&&r.reflect===!0){let i=(r.converter?.toAttribute!==void 0?r.converter:N).toAttribute(e,r.type);this._$Em=t,i==null?this.removeAttribute(o):this.setAttribute(o,i),this._$Em=null}}_$AK(t,e){let r=this.constructor,o=r._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let i=r.getPropertyOptions(o),s=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:N;this._$Em=o;let l=s.fromAttribute(e,i.type);this[o]=l??this._$Ej?.get(o)??l,this._$Em=null}}requestUpdate(t,e,r,o=!1,i){if(t!==void 0){let s=this.constructor;if(o===!1&&(i=this[t]),r??=s.getPropertyOptions(t),!((r.hasChanged??B)(i,e)||r.useDefault&&r.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,r))))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:o,wrapped:i},s){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,s??e??this[t]),i!==!0||s!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,i]of this._$Ep)this[o]=i;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[o,i]of r){let{wrapped:s}=i,l=this[o];s!==!0||this._$AL.has(o)||l===void 0||this.C(o,void 0,i,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[U("elementProperties")]=new Map,S[U("finalized")]=new Map,we?.({ReactiveElement:S}),(K.reactiveElementVersions??=[]).push("2.1.2");var ut=globalThis,_t=n=>n,Y=ut.trustedTypes,Rt=Y?Y.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ut="$lit$",w=`lit$${Math.random().toFixed(9).slice(2)}$`,Nt="?"+w,Ee=`<${Nt}>`,k=document,G=()=>k.createComment(""),I=n=>n===null||typeof n!="object"&&typeof n!="function",mt=Array.isArray,$e=n=>mt(n)||typeof n?.[Symbol.iterator]=="function",at=`[
2
+ \f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Pt=/-->/g,Ct=/>/g,$=RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ot=/'/g,Lt=/"/g,Ht=/^(?:script|style|textarea|title)$/i,gt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),c=gt(1),or=gt(2),ir=gt(3),A=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Ft=new WeakMap,T=k.createTreeWalker(k,129);function Gt(n,t){if(!mt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Rt!==void 0?Rt.createHTML(t):t}var Te=(n,t)=>{let e=n.length-1,r=[],o,i=t===2?"<svg>":t===3?"<math>":"",s=H;for(let l=0;l<e;l++){let a=n[l],m,h,p=-1,f=0;for(;f<a.length&&(s.lastIndex=f,h=s.exec(a),h!==null);)f=s.lastIndex,s===H?h[1]==="!--"?s=Pt:h[1]!==void 0?s=Ct:h[2]!==void 0?(Ht.test(h[2])&&(o=RegExp("</"+h[2],"g")),s=$):h[3]!==void 0&&(s=$):s===$?h[0]===">"?(s=o??H,p=-1):h[1]===void 0?p=-2:(p=s.lastIndex-h[2].length,m=h[1],s=h[3]===void 0?$:h[3]==='"'?Lt:Ot):s===Lt||s===Ot?s=$:s===Pt||s===Ct?s=H:(s=$,o=void 0);let v=s===$&&n[l+1].startsWith("/>")?" ":"";i+=s===H?a+Ee:p>=0?(r.push(m),a.slice(0,p)+Ut+a.slice(p)+w+v):a+w+(p===-2?l:v)}return[Gt(n,i+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},M=class n{constructor({strings:t,_$litType$:e},r){let o;this.parts=[];let i=0,s=0,l=t.length-1,a=this.parts,[m,h]=Te(t,e);if(this.el=n.createElement(m,r),T.currentNode=this.el.content,e===2||e===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=T.nextNode())!==null&&a.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(Ut)){let f=h[s++],v=o.getAttribute(p).split(w),P=/([.?@])?(.*)/.exec(f);a.push({type:1,index:i,name:P[2],strings:v,ctor:P[1]==="."?lt:P[1]==="?"?ct:P[1]==="@"?pt:O}),o.removeAttribute(p)}else p.startsWith(w)&&(a.push({type:6,index:i}),o.removeAttribute(p));if(Ht.test(o.tagName)){let p=o.textContent.split(w),f=p.length-1;if(f>0){o.textContent=Y?Y.emptyScript:"";for(let v=0;v<f;v++)o.append(p[v],G()),T.nextNode(),a.push({type:2,index:++i});o.append(p[f],G())}}}else if(o.nodeType===8)if(o.data===Nt)a.push({type:2,index:i});else{let p=-1;for(;(p=o.data.indexOf(w,p+1))!==-1;)a.push({type:7,index:i}),p+=w.length-1}i++}}static createElement(t,e){let r=k.createElement("template");return r.innerHTML=t,r}};function C(n,t,e=n,r){if(t===A)return t;let o=r!==void 0?e._$Co?.[r]:e._$Cl,i=I(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(n),o._$AT(n,e,r)),r!==void 0?(e._$Co??=[])[r]=o:e._$Cl=o),o!==void 0&&(t=C(n,o._$AS(n,t.values),o,r)),t}var dt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:r}=this._$AD,o=(t?.creationScope??k).importNode(e,!0);T.currentNode=o;let i=T.nextNode(),s=0,l=0,a=r[0];for(;a!==void 0;){if(s===a.index){let m;a.type===2?m=new D(i,i.nextSibling,this,t):a.type===1?m=new a.ctor(i,a.name,a.strings,this,t):a.type===6&&(m=new ht(i,this,t)),this._$AV.push(m),a=r[++l]}s!==a?.index&&(i=T.nextNode(),s++)}return T.currentNode=k,o}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},D=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,o){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=C(this,t,e),I(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==A&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):$e(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(k.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:r}=t,o=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=M.createElement(Gt(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(e);else{let i=new dt(o,this),s=i.u(this.options);i.p(e),this.T(s),this._$AH=i}}_$AC(t){let e=Ft.get(t.strings);return e===void 0&&Ft.set(t.strings,e=new M(t)),e}k(t){mt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,o=0;for(let i of t)o===e.length?e.push(r=new n(this.O(G()),this.O(G()),this,this.options)):r=e[o],r._$AI(i),o++;o<e.length&&(this._$AR(r&&r._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let r=_t(t).nextSibling;_t(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},O=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,o,i){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=i,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=d}_$AI(t,e=this,r,o){let i=this.strings,s=!1;if(i===void 0)t=C(this,t,e,0),s=!I(t)||t!==this._$AH&&t!==A,s&&(this._$AH=t);else{let l=t,a,m;for(t=i[0],a=0;a<i.length-1;a++)m=C(this,l[r+a],e,a),m===A&&(m=this._$AH[a]),s||=!I(m)||m!==this._$AH[a],m===d?t=d:t!==d&&(t+=(m??"")+i[a+1]),this._$AH[a]=m}s&&!o&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},lt=class extends O{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},ct=class extends O{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},pt=class extends O{constructor(t,e,r,o,i){super(t,e,r,o,i),this.type=5}_$AI(t,e=this){if((t=C(this,t,e,0)??d)===A)return;let r=this._$AH,o=t===d&&r!==d||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,i=t!==d&&(r===d||o);o&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ht=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){C(this,t)}};var ke=ut.litHtmlPolyfillSupport;ke?.(M,D),(ut.litHtmlVersions??=[]).push("3.3.3");var It=(n,t,e)=>{let r=e?.renderBefore??t,o=r._$litPart$;if(o===void 0){let i=e?.renderBefore??null;r._$litPart$=o=new D(t.insertBefore(G(),i),i,void 0,e??{})}return o._$AI(n),o};var yt=globalThis,E=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=It(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return A}};E._$litElement$=!0,E.finalized=!0,yt.litElementHydrateSupport?.({LitElement:E});var Ae=yt.litElementPolyfillSupport;Ae?.({LitElement:E});(yt.litElementVersions??=[]).push("4.2.2");var Mt=[{endpoint:"iching/hexagrams/random",method:"GET"},{endpoint:"iching/hexagrams/{number}",method:"GET"},{endpoint:"iching/hexagrams/lookup",method:"GET"},{endpoint:"iching/cast",method:"GET"},{endpoint:"iching/daily",method:"POST"},{endpoint:"iching/daily/cast",method:"POST"}];function V(n){return n.toLowerCase().replace(/[\s_-]+/g," ").trim()}var _e=(n,t)=>t?n[V(t)]:void 0;var Re={heaven:"☰",lake:"☱",fire:"☲",thunder:"☳",wind:"☴",water:"☵",mountain:"☶",earth:"☷"},ft=n=>_e(Re,n);var Pe={attribute:!0,type:String,converter:N,reflect:!1,hasChanged:B},Ce=(n=Pe,t,e)=>{let{kind:r,metadata:o}=e,i=globalThis.litPropertyMetadata.get(o);if(i===void 0&&globalThis.litPropertyMetadata.set(o,i=new Map),r==="setter"&&((n=Object.create(n)).wrapped=!0),i.set(e.name,n),r==="accessor"){let{name:s}=e;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(s,a,n,!0,l)},init(l){return l!==void 0&&this.C(s,void 0,n,l),l}}}if(r==="setter"){let{name:s}=e;return function(l){let a=this[s];t.call(this,l),this.requestUpdate(s,a,n,!0,l)}}throw Error("Unsupported decorator location: "+r)};function y(n){return(t,e)=>typeof e=="object"?Ce(n,t,e):((r,o,i)=>{let s=o.hasOwnProperty(i);return o.constructor.createProperty(i,r),s?Object.getOwnPropertyDescriptor(o,i):void 0})(n,t,e)}function b(n){return y({...n,state:!0,attribute:!1})}var _=n=>n??d;var Dt=["de","en","es","fr","hi","pt","ru","tr","zh-Hans","zh-Hant"];function bt(n){if(n.lang)return n.lang;if(typeof document>"u")return;let t=n.closest?.("[lang]")?.getAttribute("lang");return t||document.documentElement.lang||void 0}var Oe={tw:"hant",hk:"hant",mo:"hant",cn:"hans",sg:"hans",my:"hans"};function xt(n){let t=n.toLowerCase();return Dt.find(e=>e.toLowerCase()===t)}function jt(n){let t=bt(n);if(!t)return;let e=xt(t);if(e)return e;let r=t.toLowerCase().split("-"),o=r[0];if(o==="zh"){let i=r.find(s=>s==="hans"||s==="hant")??Oe[r[1]??""];return i?xt(`zh-${i}`):void 0}return xt(o)}var zt='@layer roxy.tokens,roxy.theme;@layer roxy.tokens{:where(:root,:host){color-scheme:light;--roxy-bg: #ffffff;--roxy-fg: #0a0a0a;--roxy-accent: #4a6297;--roxy-success: #16a34a;--roxy-warning: #ea580c;--roxy-danger: #dc2626;--roxy-info: #0284c7;--roxy-accent-ink: color-mix(in oklab, var(--roxy-accent) 70%, black);--roxy-success-fg: color-mix(in oklab, var(--roxy-success) 70%, black);--roxy-warning-fg: color-mix(in oklab, var(--roxy-warning) 70%, black);--roxy-danger-fg: color-mix(in oklab, var(--roxy-danger) 70%, black);--roxy-info-fg: color-mix(in oklab, var(--roxy-info) 70%, black);--roxy-font-sans: initial;--roxy-font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;--roxy-text-base: 1rem;--roxy-text-scale: 1.15;--roxy-weight-normal: 400;--roxy-weight-bold: 600;--roxy-leading-tight: 1.25;--roxy-leading-normal: 1.5;--roxy-tracking-tight: -0.01em;--roxy-tracking-normal: 0em;--roxy-space-unit: 0.25rem;--roxy-radius: 6px;--roxy-motion-duration: 200ms;--roxy-motion-easing: cubic-bezier(0.4, 0, 0.2, 1)}:where(:root,:host,[data-theme],.light,.dark){--roxy-surface: var(--roxy-bg);--roxy-primary: var(--roxy-fg);--roxy-secondary: color-mix(in oklab, var(--roxy-fg) 78%, var(--roxy-bg));--roxy-muted: color-mix(in oklab, var(--roxy-fg) 60%, var(--roxy-bg));--roxy-border: color-mix(in oklab, var(--roxy-fg) 14%, var(--roxy-bg));--roxy-ring: color-mix(in srgb, var(--roxy-accent) 40%, transparent);--roxy-heat: var(--roxy-danger);--roxy-font-display: var(--roxy-font-sans);--roxy-text-sm: calc(var(--roxy-text-base) / var(--roxy-text-scale));--roxy-text-xs: calc(var(--roxy-text-sm) / var(--roxy-text-scale));--roxy-text-lg: calc(var(--roxy-text-base) * var(--roxy-text-scale));--roxy-text-xl: calc( var(--roxy-text-lg) * var(--roxy-text-scale) * var(--roxy-text-scale) );--roxy-space-xs: var(--roxy-space-unit);--roxy-space-sm: calc(var(--roxy-space-unit) * 2);--roxy-space-md: calc(var(--roxy-space-unit) * 4);--roxy-space-lg: calc(var(--roxy-space-unit) * 6);--roxy-space-xl: calc(var(--roxy-space-unit) * 10);--roxy-line-thick: calc(var(--roxy-space-unit) / 2);--roxy-touch: calc(var(--roxy-space-unit) * 11);--roxy-radius-sm: calc(var(--roxy-radius) / 2);--roxy-radius-md: var(--roxy-radius);--roxy-radius-lg: calc(var(--roxy-radius) * 5 / 3);--roxy-radius-full: 9999px;--roxy-shadow-sm: none;--roxy-shadow-md: 0 4px 12px color-mix(in srgb, black 10%, transparent);--roxy-shadow-lg: 0 12px 32px color-mix(in srgb, black 18%, transparent)}@media(prefers-color-scheme:dark){:where(:root,:host){color-scheme:dark;--roxy-bg: #0a0a0a;--roxy-fg: #fafafa;--roxy-accent: #92aade;--roxy-success: #22c55e;--roxy-warning: #fb923c;--roxy-danger: #ef4444;--roxy-info: #38bdf8;--roxy-accent-ink: var(--roxy-accent);--roxy-success-fg: color-mix(in oklab, var(--roxy-success) 70%, white);--roxy-warning-fg: color-mix(in oklab, var(--roxy-warning) 70%, white);--roxy-danger-fg: color-mix(in oklab, var(--roxy-danger) 70%, white);--roxy-info-fg: color-mix(in oklab, var(--roxy-info) 70%, white)}}:where(:root[data-theme=light],[data-theme=light],:root.light,.light,:host([data-theme="light"])){color-scheme:light;--roxy-bg: #ffffff;--roxy-fg: #0a0a0a;--roxy-accent: #4a6297;--roxy-success: #16a34a;--roxy-warning: #ea580c;--roxy-danger: #dc2626;--roxy-info: #0284c7;--roxy-accent-ink: color-mix(in oklab, var(--roxy-accent) 70%, black);--roxy-success-fg: color-mix(in oklab, var(--roxy-success) 70%, black);--roxy-warning-fg: color-mix(in oklab, var(--roxy-warning) 70%, black);--roxy-danger-fg: color-mix(in oklab, var(--roxy-danger) 70%, black);--roxy-info-fg: color-mix(in oklab, var(--roxy-info) 70%, black)}:where(:root[data-theme=dark],[data-theme=dark],:root.dark,.dark,:host([data-theme="dark"])){color-scheme:dark;--roxy-bg: #0a0a0a;--roxy-fg: #fafafa;--roxy-accent: #92aade;--roxy-success: #22c55e;--roxy-warning: #fb923c;--roxy-danger: #ef4444;--roxy-info: #38bdf8;--roxy-accent-ink: var(--roxy-accent);--roxy-success-fg: color-mix(in oklab, var(--roxy-success) 70%, white);--roxy-warning-fg: color-mix(in oklab, var(--roxy-warning) 70%, white);--roxy-danger-fg: color-mix(in oklab, var(--roxy-danger) 70%, white);--roxy-info-fg: color-mix(in oklab, var(--roxy-info) 70%, white)}@media(prefers-reduced-motion:reduce){:where(:root,:host){--roxy-motion-duration: 0ms}}}';var W="roxy-ui-tokens";function J(){if(typeof document>"u")return null;let n=document.getElementById(W);if(n)return n;let t=document.createElement("style");return t.id=W,t.textContent=zt,document.head.prepend(t),t}var qt="__ROXY_UI_I18N__";function Kt(){let n=globalThis,t=n[qt];if(t)return t;let e={catalogs:{},fieldLabels:{},requested:new Set,listeners:new Set};return n[qt]=e,e}function Le(n,t){return t?n.replace(/\{\{(\w+)\}\}/g,(e,r)=>r in t?String(t[r]??""):e):n}function Bt(n,t,e){return Le(Fe(n,t)??t,e)}function Fe(n,t){if(!n)return;let{catalogs:e}=Kt(),r=n.toLowerCase();return(e[r]??e[r.split("-")[0]])?.[V(t)]}function Yt(n){let{listeners:t}=Kt();return t.add(n),()=>{t.delete(n)}}var X=class{constructor(t){this.host=t,t.addController(this)}hostConnected(){this.unsubscribe=Yt(()=>this.host.requestUpdate())}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=void 0}};var Q=class extends E{constructor(){super();this.translator=(e,r)=>this.t(e,r);new X(this)}connectedCallback(){super.connectedCallback(),J()}t(e,r){return Bt(this.effectiveLang(),e,r)}effectiveLang(){return bt(this)}};var Vt=x`:where([part~=card]){background:var(--roxy-surface);color:var(--roxy-fg);border:1px solid var(--roxy-border);border-radius:var(--roxy-radius-lg);box-shadow:var(--roxy-shadow-sm)}:where([part~=card] [part~=card],[part~=card] [part~=reading],[part~=card] .roxy-card){border:0;border-block-start:1px solid var(--roxy-border);box-shadow:none;background:0 0;border-radius:0;padding-inline:0}:host([bare]) [part~=card]{box-shadow:none;background:0 0;border:0;border-radius:0;padding:0}:where(h1,h2){color:var(--roxy-fg);font-size:var(--roxy-text-lg);font-weight:var(--roxy-weight-bold);line-height:var(--roxy-leading-tight);letter-spacing:var(--roxy-tracking-tight);text-wrap:balance}:where(h3,h4,h5,h6){color:var(--roxy-fg);font-size:var(--roxy-text-base);font-weight:var(--roxy-weight-bold);line-height:var(--roxy-leading-tight);letter-spacing:var(--roxy-tracking-normal);text-transform:none}:where(.roxy-label,th,dt){color:var(--roxy-muted);font-size:var(--roxy-text-sm);font-weight:var(--roxy-weight-normal);letter-spacing:var(--roxy-tracking-normal);text-transform:none}:where(.roxy-chips){gap:var(--roxy-space-xs);flex-wrap:wrap;margin:0;padding:0;list-style:none;display:flex}:where(.roxy-chip,.roxy-chips>li){align-items:center;gap:var(--roxy-space-xs);padding:calc(var(--roxy-space-unit) / 2) var(--roxy-space-sm);border:1px solid var(--roxy-border);border-radius:var(--roxy-radius-sm);color:var(--roxy-secondary);font-size:var(--roxy-text-xs);line-height:var(--roxy-leading-tight);overflow-wrap:anywhere;background:0 0;max-inline-size:100%;display:inline-flex}:where(.roxy-chip[data-tone=success],.roxy-chips>li[data-tone=success]){color:var(--roxy-success-fg)}:where(.roxy-chip[data-tone=warning],.roxy-chips>li[data-tone=warning]){color:var(--roxy-warning-fg)}:where(.roxy-chip[data-tone=danger],.roxy-chips>li[data-tone=danger]){color:var(--roxy-danger-fg)}:where(.roxy-chip[data-tone=info],.roxy-chips>li[data-tone=info]){color:var(--roxy-info-fg)}:where(table){border-collapse:collapse;font-size:var(--roxy-text-sm);font-variant-numeric:tabular-nums}:where(th,td){padding:var(--roxy-space-xs) var(--roxy-space-sm);border-block-end:1px solid var(--roxy-border);text-align:start;vertical-align:top}:where(summary){cursor:pointer}:where(a,button,summary,input,select,textarea,[tabindex]):focus-visible{outline:var(--roxy-line-thick) solid var(--roxy-ring);outline-offset:var(--roxy-line-thick)}:where(summary:focus-visible){border-radius:var(--roxy-radius-sm)}:where(input,select,textarea,button){font:inherit}:where(input:not([type=checkbox],[type=radio],[type=range]),select,textarea){padding:var(--roxy-space-xs) var(--roxy-space-sm);background:var(--roxy-bg);color:var(--roxy-fg);border:1px solid var(--roxy-border);border-radius:var(--roxy-radius-md)}`;var Ue=x`:host{--roxy-label-col:minmax(0, 25%);--_mask:var(--roxy-surface);font-family:var(--roxy-font-sans);color:var(--roxy-fg);font-size:var(--roxy-text-base);line-height:var(--roxy-leading-normal);animation:roxy-fade-in var(--roxy-motion-duration) var(--roxy-motion-easing) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--_mask:var(--roxy-bg)}:host([hidden]){display:none}: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)}@keyframes roxy-fade-in{0%{transform:translateY(calc(var(--roxy-space-unit) / 2))}to{transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border) 0%, color-mix(in srgb, var(--roxy-border) 60%, transparent) 50%, var(--roxy-border) 100%);border-radius:var(--roxy-radius-md);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);color:var(--roxy-muted);text-align:center;font-size:var(--roxy-text-sm)}.roxy-error{gap:var(--roxy-space-sm);padding:var(--roxy-space-lg);background:var(--roxy-surface);border:1px solid var(--roxy-danger);border-radius:var(--roxy-radius-md);color:var(--roxy-danger-fg);font-size:var(--roxy-text-sm);justify-items:start;display:grid}:host(:focus-within) .roxy-card{outline:var(--roxy-line-thick) solid var(--roxy-ring);outline-offset:var(--roxy-line-thick)}.roxy-attribution{margin-top:var(--roxy-space-sm);font-size:var(--roxy-text-xs);color:var(--roxy-muted);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink);text-decoration:underline}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs) var(--roxy-space-md);border:1px solid var(--roxy-border);border-radius:var(--roxy-radius-md);color:var(--roxy-fg);font-family:inherit;font-size:var(--roxy-text-sm);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent);color:var(--roxy-accent-ink)}.roxy-edit:disabled{cursor:progress;color:var(--roxy-muted)}roxy-endpoint-form+*{margin-top:var(--roxy-space-md)}.roxy-more{justify-items:center;gap:var(--roxy-space-sm);margin-top:var(--roxy-space-md);display:grid}.roxy-more .roxy-edit{min-height:var(--roxy-touch)}:host{font-variant-emoji:text}`,tt=[Ue,Vt];var Ne="__cols",He="__rows";function Ge(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function et(n){if(Array.isArray(n)){let i=!1,s=n.map(l=>{let a=et(l);return a!==l&&(i=!0),a});return i?s:n}if(!Ge(n))return n;let t=n[Ne],e=n[He];if(Array.isArray(t)&&Array.isArray(e)&&Object.keys(n).length===2)return e.map(i=>{let s={};return t.forEach((l,a)=>{s[l]=et(i[a])}),s});let r=!1,o={};for(let[i,s]of Object.entries(n)){let l=et(s);l!==s&&(r=!0),o[i]=l}return r?o:n}function Zt(n){return et(n)}function Wt(n,t){return n.find(e=>e.attrs&&Object.entries(e.attrs).every(([r,o])=>t[r]===o))??n[0]}var Ie="pk_live_YOUR_KEY",Jt={secret:{reason:"possible-secret-key",message:"Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side."},sample:{reason:"sample-key",message:"Replace the sample key with your own publishable key from your RoxyAPI account."}};function Xt(n){if(n)return n===Ie?Jt.sample:n.startsWith("pk_")?void 0:Jt.secret}function Qt(n,t,e={}){e.warn&&console.warn(t.message),n.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:t.reason,message:t.message},bubbles:!0,composed:!0}))}var te="https://roxyapi.com/api/v2";async function Me(n){try{let t=await n.json();if(t?.error){let e=t.code==="validation_error"&&Array.isArray(t.issues)?t.issues.filter(r=>typeof r.path=="string"&&typeof r.message=="string").map(r=>({path:r.path,message:r.message})):null;return{message:t.error,issues:e?.length?e:null,worded:!0}}}catch{}return{message:`Request failed (${n.status})`,issues:null,worded:!1}}var ee={fromAttribute:n=>{if(n!=null){try{let t=JSON.parse(n);if(t&&typeof t=="object"&&!Array.isArray(t))return t}catch{}console.warn("[roxy-ui] submit-context must be a JSON object; sending the request without it.")}}},L=class extends Error{constructor(e,r=null,o=!0){super(e);this.issues=r;this.worded=o}};function re(n){return n.submitUrl?void 0:Xt(n.publishableKey)}async function vt(n,t,e){let r=re(n);if(r)throw new L(r.message);let o=n.submitUrl?await fetch(n.submitUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:De(t,n.submitContext),signal:e}):await je(n,t,e);if(!o.ok){let i=await Me(o);throw new L(i.message,i.issues,i.worded)}return await o.json()}function De(n,t){return JSON.stringify(t?{...n,context:t}:n)}function je(n,t,e){let r=new URL(`${n.baseUrl??te}${t.path}`,document.baseURI);for(let[i,s]of Object.entries(t.query??{}))s!=null&&r.searchParams.set(i,String(s));let o={Accept:"application/json"};return n.publishableKey&&(o["X-API-Key"]=n.publishableKey),t.body!=null&&(o["Content-Type"]="application/json"),fetch(r,{method:t.method??"GET",headers:o,body:t.body!=null?JSON.stringify(t.body):void 0,signal:e})}var rt=class{constructor(t){this.baseUrl=te;this.worded=!0;this.host=t,t.addController(this)}hostDisconnected(){this.abort?.abort(),this.abort=void 0}async run(t){this.worded=!0;let e=re(this);if(e){this.host.error=e.message,Qt(this.host,e);return}this.abort?.abort();let r=new AbortController;this.abort=r,this.host.loading=!0,this.host.error=null,this.host.issues=null;try{let o=await vt(this,t,r.signal);if(r.signal.aborted)return;this.host.data=o}catch(o){if(r.signal.aborted||o?.name==="AbortError")return;o instanceof L&&(this.host.issues=o.issues),this.worded=o instanceof L&&o.worded,this.host.error=o instanceof Error?o.message:String(o)}finally{this.abort===r&&(this.abort=void 0),r.signal.aborted||(this.host.loading=!1)}}};function ne(n,t,e,r=[]){let o={...e},i=`/${n.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(m,h)=>{let p=o[h];return delete o[h],encodeURIComponent(String(p??""))}),s=new Set(r),l={},a={};for(let[m,h]of Object.entries(o))h===void 0||h===""||(t==="GET"||s.has(m)?l[m]=h:a[m]=h);return{path:i,method:t,query:l,body:t==="POST"?a:void 0}}function nt(){return c`<svg class="roxy-chevron" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`}var oe=x`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:.7lh;height:.7lh;color:var(--roxy-muted);transition:transform var(--roxy-motion-duration) var(--roxy-motion-easing);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;var ie=x`.block{border-top:1px solid var(--roxy-border);padding-top:var(--roxy-space-md)}.block h3{margin:0 0 var(--roxy-space-sm)}.interp-card{padding-block:var(--roxy-space-sm)}.interp-card summary{font-weight:var(--roxy-weight-bold);color:var(--roxy-fg);align-items:center;gap:var(--roxy-space-sm);font-size:var(--roxy-text-sm);display:flex}.interp-lead{align-items:baseline;gap:var(--roxy-space-sm);flex-wrap:wrap;flex:auto;order:1;min-width:0;display:inline-flex}.interp-aside{align-items:center;gap:var(--roxy-space-sm);flex-shrink:0;order:2;display:inline-flex}.roxy-chevron{order:3}.interp-aside small{color:var(--roxy-muted);font-weight:var(--roxy-weight-normal);white-space:nowrap}@container (width<=26rem){.interp-card summary{flex-wrap:wrap}.roxy-chevron{order:2}.interp-aside{flex-basis:100%;order:3;justify-content:flex-end}}.interp-body{margin-top:var(--roxy-space-sm);gap:var(--roxy-space-sm);color:var(--roxy-fg);font-size:var(--roxy-text-sm);line-height:var(--roxy-leading-normal);overflow-wrap:anywhere;display:grid}.interp-body p{margin:0}`;function se(n,t,e){let r=n.filter(o=>!!o.body);return r.length===0?d:c`<section class="block" part="section readings"><h3>${e}</h3>${r.map((o,i)=>c`<details class="interp-card" part="reading" name="${t}" ?open="${i===0}"><summary><span class="interp-lead">${o.label}</span> ${nt()} ${o.aside?c`<span class="interp-aside"><small>${o.aside}</small></span>`:d}</summary><div class="interp-body"><p>${o.body}</p>${o.extra??d}</div></details>`)}</section>`}var ze="roxy-data";function qe(n){return n.nodeName==="SCRIPT"&&n.getAttribute("type")==="application/json"}var ot=class{constructor(t){this.host=t,t.addController(this)}hostConnected(){if(this.host.data!=null)return;let t=this.read();t!==void 0&&(this.host.data=t,this.host.requestUpdate())}read(){let t=this.findInlineScript();return t?this.parse(t.textContent):void 0}findInlineScript(){for(let t of Array.from(this.host.children))if(qe(t)&&t.classList.contains(ze))return t;return null}parse(t){if(t?.trim())try{return JSON.parse(t)}catch{return}}};var u=class extends Q{constructor(){super();this.data=null;this.endpoint="";this.remember=!1;this.hideReadings=!1;this.hideSections="";this.loading=!1;this.error=null;this.issues=null;this.selfFetched=!1;this.editing=!1;this.sticky=!1;this.hostLoaded=!1;this.moreLoading=!1;this.moreError=null;this.onMore=async()=>{let e=this.lastRequest,r=this.listKey,o=this.listRows();if(!(!e||!r||!o)){this.moreLoading=!0,this.moreError=null;try{let i=await vt(this.fetcher,{...e,query:{...e.query,offset:o.length}});if(this.lastRequest!==e)return;let s=i[r];this.data={...this.data,...i,[r]:[...o,...Array.isArray(s)?s:[]]}}catch(i){this.lastRequest===e&&(this.moreError=i instanceof Error?i.message:String(i))}finally{this.moreLoading=!1}}};this.onEdit=()=>{this.editing=!0};this.onFormSubmit=e=>{let r=this.selfFetch();if(!r)return;let o=e.detail;this.lastValues=o.values,this.sticky=!!o.sticky,this.selfFetched=!0,this.editing=!1,this.remember&&this.writeRemembered(o.values),this.fetchFresh(ne(r.endpoint,r.method,o.values,o.queryKeys??[]))};new ot(this),this.fetcher=new rt(this)}static{this.styles=[tt]}static{this.endpoints=[]}willUpdate(e){if(e.has("data")&&this.data!=null){let r=Zt(this.data);r!==this.data&&(this.data=r)}(e.has("publishableKey")||e.has("baseUrl")||e.has("submitUrl")||e.has("submitContext"))&&this.syncFetcher()}syncFetcher(){this.fetcher.publishableKey=this.publishableKey,this.baseUrl&&(this.fetcher.baseUrl=this.baseUrl),this.fetcher.submitUrl=this.submitUrl,this.fetcher.submitContext=this.submitContext}selfFetch(){let e=this.endpoint?{endpoint:this.endpoint,method:"POST"}:this.hostLoaded||!(this.publishableKey||this.submitUrl)?void 0:Wt(this.constructor.endpoints,this);return e&&{endpoint:e.endpoint,method:this.method??e.method}}render(){return c`${this.hiddenSectionsStyle()}${this.renderState()}`}drawn(e){try{return this.renderData(e)}catch(r){return console.warn(`[roxy-ui] ${this.localName} could not draw its response`,r),this.dispatchEvent(new CustomEvent("roxy-render-error",{detail:{error:r},bubbles:!0,composed:!0})),customElements.get("roxy-data")?c`<roxy-data .data="${e}" lang="${_(this.effectiveLang())}"></roxy-data>`:this.renderEmpty()}}hiddenSectionsStyle(){let e=this.hideSections.split(",").map(o=>o.trim().toLowerCase()).filter(o=>/^[a-z][a-z0-9-]*$/.test(o));if(e.length===0)return d;let r=e.map(o=>`[part~="${o}"],roxy-endpoint-form::part(${o}){display:none!important}`).join("");return c`<style>${r}</style>`}renderState(){return this.selfFetch()&&this.sticky&&this.selfFetched&&!this.editing?this.renderWithForm(this.stickyBody()):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()?c`${this.drawn(this.data)}${this.renderAttribution()}`:this.drawn(this.data):this.renderNoData()}renderInterpretation(e,r,o){return this.hideReadings?d:se(e,r,this.t(o??"Reading"))}renderResult(e){let r=c`<div class="roxy-edit-bar" part="edit-bar"><button type="button" class="roxy-edit" @click="${this.onEdit}">${this.t("Edit query")}</button></div>${this.drawn(e)}`;return this.showAttribution()?c`${r}${this.renderAttribution()}`:r}renderWithForm(e){return c`${this.renderForm()}${e}`}stickyBody(){return this.loading?this.renderLoading():this.error!=null?this.issues?d:this.renderErrorBanner(this.error):this.data==null?d:this.showAttribution()?c`${this.drawn(this.data)}${this.renderAttribution()}`:this.drawn(this.data)}renderMore(){let e=this.listRows(),r=this.data?.total;return!this.lastRequest||!e||typeof r!="number"?d:e.length>=r?d:c`<div class="roxy-more" part="more"><button type="button" class="roxy-edit" ?disabled="${this.moreLoading}" aria-busy="${this.moreLoading?"true":"false"}" @click="${this.onMore}">${this.t("Show more")}</button> ${this.moreError?c`<p class="roxy-error" role="alert">${this.t(this.moreError)}</p>`:d}</div>`}listRows(){let e=this.listKey?this.data?.[this.listKey]:void 0;return Array.isArray(e)?e:void 0}fetchFresh(e){return this.lastRequest=e,this.openedRow=void 0,this.openedRowId=void 0,this.moreError=null,this.fetcher.run(e)}load(e){return this.hostLoaded=!0,this.syncFetcher(),this.fetchFresh(e)}pickRow(e){this.dispatchEvent(new CustomEvent("roxy-symbol-select",{detail:e,bubbles:!0,composed:!0})),this.openRow(e.id)}openRow(e){if(!this.rowDetail||!(this.publishableKey||this.submitUrl))return;let r=this.openedRow??document.createElement(this.rowDetail.tag);r.publishableKey=this.publishableKey,r.baseUrl=this.baseUrl,r.submitUrl=this.submitUrl,r.submitContext=this.submitContext,r.hideReadings=this.hideReadings,r.hideSections=this.hideSections;let o=this.effectiveLang();o&&r.setAttribute("lang",o),this.openedRow=r,this.openedRowId=e,r.load({path:`/${this.rowDetail.path.replace("{id}",encodeURIComponent(e))}`,method:"GET",query:{lang:jt(this)}}).then(()=>r.scrollIntoView?.({block:"nearest"}))}showAttribution(){return this.attribution!=null&&this.attribution!=="off"&&this.attribution!=="false"}renderAttribution(){return c`<div class="roxy-attribution" part="attribution"><a href="https://roxyapi.com/?utm_source=widget&utm_medium=embed" target="_blank" rel="noopener">${this.t("Spiritual data by RoxyAPI")}</a></div>`}renderNoData(){return this.selfFetch()?this.renderWithForm(d):this.renderEmpty()}renderForm(){let e=this.selfFetch();return c`<roxy-endpoint-form part="form" exportparts="hint" data-endpoint="${e?.endpoint??""}" method="${e?.method??"POST"}" spec-url="${_(this.specUrl)}" publishable-key="${_(this.publishableKey)}" location-url="${_(this.locationUrl)}" submit-label="${_(this.submitLabel)}" lang="${_(this.effectiveLang())}" .initialValues="${this.formInitialValues()}" .serverIssues="${this.issues}" .apiRoute="${this.fetcher}" .autoload="${!this.selfFetched}" .fullPages="${!!this.listKey}" @roxy-submit="${this.onFormSubmit}"></roxy-endpoint-form>`}formInitialValues(){return this.lastValues??(this.remember?this.readRemembered():void 0)}rememberKey(){return`roxy-ui:form:${this.selfFetch()?.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 c`<div class="roxy-empty" role="status" part="empty">${this.t("No data")}</div>`}renderLoading(){return c`<div class="roxy-skeleton" style="height:5lh" role="status" aria-label="${this.t("Loading")}" part="loading"></div>`}renderError(e){let r=!!this.selfFetch();if(r&&this.issues)return this.renderForm();let o=this.renderErrorBanner(e);return r?c`${o}${this.renderForm()}`:o}renderErrorBanner(e){return c`<div class="roxy-error" role="alert" part="error">${!this.fetcher.worded&&this.errorMessage||this.t(e)}</div>`}};g([y({attribute:!1})],u.prototype,"data",2),g([y({type:String,attribute:"data-endpoint"})],u.prototype,"endpoint",2),g([y({type:String})],u.prototype,"method",2),g([y({type:String,attribute:"publishable-key"})],u.prototype,"publishableKey",2),g([y({type:String,attribute:"base-url"})],u.prototype,"baseUrl",2),g([y({type:String,attribute:"spec-url"})],u.prototype,"specUrl",2),g([y({type:String,attribute:"submit-url"})],u.prototype,"submitUrl",2),g([y({attribute:"submit-context",converter:ee})],u.prototype,"submitContext",2),g([y({type:String,attribute:"location-url"})],u.prototype,"locationUrl",2),g([y({type:Boolean})],u.prototype,"remember",2),g([y({type:Boolean,attribute:"hide-readings",reflect:!0})],u.prototype,"hideReadings",2),g([y({type:String,attribute:"hide-sections",reflect:!0})],u.prototype,"hideSections",2),g([y({type:String,attribute:"submit-label"})],u.prototype,"submitLabel",2),g([y({type:String,attribute:"error-message"})],u.prototype,"errorMessage",2),g([y({type:String})],u.prototype,"attribution",2),g([b()],u.prototype,"loading",2),g([b()],u.prototype,"error",2),g([b()],u.prototype,"issues",2),g([b()],u.prototype,"selfFetched",2),g([b()],u.prototype,"editing",2),g([b()],u.prototype,"sticky",2),g([b()],u.prototype,"openedRow",2),g([b()],u.prototype,"openedRowId",2),g([b()],u.prototype,"moreLoading",2),g([b()],u.prototype,"moreError",2);var ae=n=>t=>{customElements.get(n)||customElements.define(n,t)};var Ke=/^\d{4}-\d{2}-\d{2}$/,Be=/^\d{4}-\d{2}$/,Ye=/^\d{2}:\d{2}(:\d{2})?$/,Ve=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/,de=new Map;function Ze(n){if(!n)return["en"];let t=de.get(n);if(t)return[t,"en"];let e="en";try{e=Intl.getCanonicalLocales(n)[0]??"en"}catch{e="en"}return de.set(n,e),[e,"en"]}function We(n){let t=Ye.test(n)?`1970-01-01T${n}`:Ke.test(n)?`${n}T00:00:00`:Be.test(n)?`${n}-01T00:00:00`:Ve.test(n)?n.replace(" ","T"):null;return t?{d:new Date(`${t}Z`),timeZone:"UTC"}:{d:new Date(n)}}function le(n,t){if(typeof t!="string"||t.length===0)return"";let{d:e,timeZone:r}=We(t);return Number.isNaN(e.getTime())?t:e.toLocaleDateString(Ze(n),{month:"short",day:"numeric",year:"numeric",timeZone:r})}var R=class extends u{resolveHexagram(){let t=this.data;if(!t)return null;if("hexagram"in t&&t.hexagram){if("lines"in t){let i=t,s=i.hexagram;return{hex:s,lines:i.lines,date:i.date,changingLinePositions:i.changingLinePositions,changingLines:i.changingLines??s.changingLines,resultingHexagram:i.resultingHexagram}}let r=t,o=r.hexagram;return{hex:o,changingLines:o.changingLines,dailyMessage:r.dailyMessage,date:r.date}}let e=t;return{hex:e,changingLines:e.changingLines}}renderData(){let t=this.resolveHexagram();if(!t)return this.renderEmpty();let{hex:e,lines:r,changingLinePositions:o,changingLines:i,dailyMessage:s,date:l,resultingHexagram:a}=t;return c`<article class="card" part="card" aria-label="${this.t("I Ching hexagram")}">${this.renderHexagram("hexagram",e,r,o,i,s,l)} ${a?c`<details class="result" part="section resulting-hexagram"><summary>${this.t("Becomes hexagram {{number}} {{name}}.",{number:a.number,name:a.english??a.chinese??""})}${nt()}</summary><div class="result-chart">${this.renderHexagram("result",a)}</div></details>`:d}</article>`}renderHexagram(t,e,r,o,i,s,l){let a=r??this.derivedLines(e),m=new Set(o??[]),h=!this.hideReadings;return c`<div class="glyphs" part="chart">${e.symbol?c`<div class="symbol">${e.symbol}</div>`:d} ${a.length>0?c`<div class="lines" aria-hidden="true">${a.slice().reverse().map((p,f)=>{let v=a.length-1-f+1,P=m.has(v),St=p===6||p===8;return c`<div class="line ${`${St?"broken":"solid"}${P?" changing":""}`}">${St?c`<span class="seg"></span><span class="seg"></span>`:c`<span class="seg"></span>`}</div>`})}</div>`:d}</div><div part="header"><h2>${[e.number!=null?`${e.number}.`:"",e.english??e.chinese??this.t("I Ching hexagram")].filter(Boolean).join(" ")}</h2>${l?c`<time class="daily-date" part="details" datetime="${l}">${le(this.effectiveLang(),l)}</time>`:d}<p class="subtitle">${e.chinese?c`${e.chinese}`:d} ${e.pinyin?c`· ${e.pinyin}`:d}</p><div class="trigrams roxy-label" part="details">${e.upperTrigram?c`<div>${this.t("Upper")} <span class="tri-glyph">${ft(e.upperTrigram)??""}</span>${e.upperTrigram}</div>`:d} ${e.lowerTrigram?c`<div>${this.t("Lower")} <span class="tri-glyph">${ft(e.lowerTrigram)??""}</span>${e.lowerTrigram}</div>`:d}</div>${e.judgment&&h?c`<p class="judgment">${e.judgment}</p>`:d} ${e.image&&h?c`<p class="image">${e.image}</p>`:d} ${s&&h?c`<p class="message">${s}</p>`:d} ${e.interpretation?.general&&h?c`<p>${e.interpretation.general}</p>`:d} ${m.size>0?c`<div class="changes" part="section changing-lines">${this.t("Changing lines: {{lines}}.",{lines:Array.from(m).sort((p,f)=>p-f).join(", ")})}</div>`:d} ${this.renderTopics(e,t)} ${this.renderLines(i??e.changingLines,m,`${t}-lines`)}</div>`}renderTopics(t,e){let r=t.interpretation;return r?this.renderInterpretation([{label:this.t("Love"),body:r.love??""},{label:this.t("Career"),body:r.career??""},{label:this.t("Decision"),body:r.decision??""},{label:this.t("Advice"),body:r.advice??""}].filter(o=>o.body),`${e}-topics`,"Readings"):d}renderLines(t,e,r){let o=t??[];if(o.length===0)return d;let i=e.size>0,s=i?o.filter(a=>e.has(a.position)):o;if(s.length===0)return d;let l=s.map(a=>({label:`Line ${a.position}`,body:a.text??"",extra:a.meaning?c`<p class="line-meaning">${a.meaning}</p>`:d}));return this.renderInterpretation(l,r,i?"Changing lines":"Lines")}derivedLines(t){let e=t.binary??"";return/^[01]{6}$/.test(e)?Array.from(e,r=>r==="1"?7:8):[]}};R.endpoints=Mt,R.styles=[tt,oe,ie,x`.card{gap:var(--roxy-space-lg);padding:var(--roxy-space-lg);grid-template-columns:minmax(0,4lh) minmax(0,1fr);display:grid}.result-chart{gap:var(--roxy-space-lg);grid-template-columns:minmax(0,4lh) minmax(0,1fr);padding-block-start:var(--roxy-space-md);display:grid}.result{border-block-start:1px solid var(--roxy-border);grid-column:1/-1;padding-block-start:var(--roxy-space-md)}.result>summary{justify-content:space-between;align-items:center;gap:var(--roxy-space-sm);display:flex}@container (width<=480px){.card,.result-chart{grid-template-columns:minmax(0,1fr)}}h2,p{margin:0}.glyphs{align-content:start;align-self:start;justify-items:center;gap:var(--roxy-space-md);display:grid}.symbol{color:var(--roxy-accent-ink);font-size:calc(var(--roxy-text-xl) * 2);line-height:1}.lines{gap:calc(var(--roxy-space-unit) * 1.5);inline-size:2lh;display:grid}.line{gap:var(--roxy-space-xs);grid-template-columns:1fr 1fr;display:grid}.seg{block-size:calc(var(--roxy-line-thick) * 3);background:var(--roxy-fg);display:block}.line.solid .seg{grid-column:1/-1}.line.changing .seg{background:var(--roxy-accent)}.subtitle{color:var(--roxy-muted);font-size:var(--roxy-text-sm);margin-block-end:var(--roxy-space-sm)}.daily-date{color:var(--roxy-secondary);font-size:var(--roxy-text-sm);margin-block-end:var(--roxy-space-sm);display:block}.trigrams{gap:var(--roxy-space-md);flex-wrap:wrap;margin-block-end:var(--roxy-space-sm);display:flex}.tri-glyph{color:var(--roxy-accent-ink);font-size:var(--roxy-text-xl);vertical-align:middle;margin-inline-end:var(--roxy-space-xs)}.judgment,.image,.message{font-size:var(--roxy-text-sm);margin-block-end:var(--roxy-space-sm)}.judgment:before{content:"Judgment. ";color:var(--roxy-secondary);font-weight:var(--roxy-weight-bold)}.image:before{content:"Image. ";color:var(--roxy-secondary);font-weight:var(--roxy-weight-bold)}.line-meaning{border-inline-start:var(--roxy-line-thick) solid var(--roxy-border);color:var(--roxy-muted);padding-inline-start:var(--roxy-space-sm)}.changes{border-block-start:1px solid var(--roxy-border);color:var(--roxy-accent-ink);font-size:var(--roxy-text-sm);margin-block-start:var(--roxy-space-md);padding-block-start:var(--roxy-space-md)}`],R=g([ae("roxy-hexagram")],R);return me(Je);})();
206
4
  /*! Bundled license information:
207
5
 
208
6
  @lit/reactive-element/css-tag.js: