@runcontext/ui 0.5.10 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/static/uxd.css CHANGED
@@ -91,7 +91,10 @@
91
91
  justify-content: center;
92
92
  gap: var(--rc-space-2);
93
93
  font-family: var(--rc-font-sans);
94
+ font-size: var(--rc-text-sm);
94
95
  font-weight: var(--rc-font-weight-semibold);
96
+ padding: var(--rc-space-2) var(--rc-space-4);
97
+ height: 2.5rem;
95
98
  border-radius: var(--rc-radius-md);
96
99
  border: 1px solid transparent;
97
100
  cursor: pointer;
@@ -238,7 +241,7 @@
238
241
  gap: var(--rc-space-1);
239
242
  font-size: var(--rc-text-xs);
240
243
  font-weight: var(--rc-font-weight-medium);
241
- padding: var(--rc-space-0_5) var(--rc-space-2);
244
+ padding: var(--rc-space-1) var(--rc-space-3);
242
245
  border-radius: var(--rc-radius-full);
243
246
  border: 1px solid transparent;
244
247
  line-height: var(--rc-leading-normal);
@@ -618,6 +621,288 @@
618
621
  font-size: var(--rc-text-sm);
619
622
  line-height: var(--rc-leading-normal);
620
623
  }
624
+ /* ── Toast ── */
625
+ .rc-toast-container {
626
+ position: fixed;
627
+ bottom: var(--rc-space-4);
628
+ right: var(--rc-space-4);
629
+ z-index: 9999;
630
+ display: flex;
631
+ flex-direction: column;
632
+ gap: var(--rc-space-2);
633
+ pointer-events: none;
634
+ }
635
+
636
+ .rc-toast {
637
+ display: flex;
638
+ align-items: flex-start;
639
+ gap: var(--rc-space-3);
640
+ padding: var(--rc-space-3) var(--rc-space-4);
641
+ border-radius: var(--rc-radius-lg);
642
+ background: var(--rc-color-surface-card);
643
+ border: 1px solid var(--rc-color-surface-border);
644
+ color: var(--rc-color-text-primary);
645
+ font-family: var(--rc-font-sans);
646
+ font-size: var(--rc-text-sm);
647
+ line-height: var(--rc-line-height);
648
+ box-shadow: var(--rc-shadow-lg);
649
+ pointer-events: auto;
650
+ min-width: 300px;
651
+ max-width: 420px;
652
+ animation: rc-toast-in 0.2s ease-out;
653
+ }
654
+
655
+ .rc-toast--exiting {
656
+ animation: rc-toast-out 0.15s ease-in forwards;
657
+ }
658
+
659
+ .rc-toast__icon {
660
+ flex-shrink: 0;
661
+ width: 18px;
662
+ height: 18px;
663
+ margin-top: 1px;
664
+ }
665
+
666
+ .rc-toast--success .rc-toast__icon { color: var(--rc-color-status-success); }
667
+ .rc-toast--error .rc-toast__icon { color: var(--rc-color-status-error); }
668
+ .rc-toast--warning .rc-toast__icon { color: var(--rc-color-status-warning); }
669
+ .rc-toast--info .rc-toast__icon { color: var(--rc-color-status-info); }
670
+
671
+ .rc-toast--success { border-left: 3px solid var(--rc-color-status-success); }
672
+ .rc-toast--error { border-left: 3px solid var(--rc-color-status-error); }
673
+ .rc-toast--warning { border-left: 3px solid var(--rc-color-status-warning); }
674
+ .rc-toast--info { border-left: 3px solid var(--rc-color-status-info); }
675
+
676
+ .rc-toast__content {
677
+ flex: 1;
678
+ min-width: 0;
679
+ }
680
+
681
+ .rc-toast__dismiss {
682
+ flex-shrink: 0;
683
+ background: none;
684
+ border: none;
685
+ color: var(--rc-color-text-muted);
686
+ cursor: pointer;
687
+ padding: 2px;
688
+ line-height: 1;
689
+ transition: color 0.15s ease;
690
+ }
691
+
692
+ .rc-toast__dismiss:hover {
693
+ color: var(--rc-color-text-primary);
694
+ }
695
+
696
+ @keyframes rc-toast-in {
697
+ from { opacity: 0; transform: translateX(20px); }
698
+ to { opacity: 1; transform: translateX(0); }
699
+ }
700
+
701
+ @keyframes rc-toast-out {
702
+ from { opacity: 1; transform: translateX(0); }
703
+ to { opacity: 0; transform: translateX(20px); }
704
+ }
705
+
706
+ /* ── Tooltip ── */
707
+ .rc-tooltip-wrapper {
708
+ position: relative;
709
+ display: inline-flex;
710
+ }
711
+
712
+ .rc-tooltip {
713
+ position: fixed;
714
+ z-index: 9999;
715
+ padding: var(--rc-space-2) var(--rc-space-3);
716
+ border-radius: var(--rc-radius-md);
717
+ background: #f8f6f1;
718
+ border: 1px solid #d4cfc5;
719
+ color: #1e1e1e;
720
+ font-family: var(--rc-font-sans);
721
+ font-size: var(--rc-text-xs);
722
+ line-height: var(--rc-line-height);
723
+ max-width: 280px;
724
+ white-space: normal;
725
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
726
+ pointer-events: none;
727
+ animation: rc-tooltip-in 0.12s ease-out;
728
+ }
729
+
730
+ .rc-tooltip--info {
731
+ border-left: 3px solid var(--rc-color-brand-gold);
732
+ }
733
+
734
+ @keyframes rc-tooltip-in {
735
+ from { opacity: 0; }
736
+ to { opacity: 1; }
737
+ }
738
+
739
+ /* ── InfoCard ── */
740
+ .rc-info-card {
741
+ display: flex;
742
+ align-items: flex-start;
743
+ gap: var(--rc-space-3);
744
+ padding: var(--rc-space-4);
745
+ border-radius: var(--rc-radius-lg);
746
+ background: var(--rc-color-surface-card);
747
+ border: 1px solid var(--rc-color-surface-border);
748
+ border-left: 3px solid var(--rc-color-brand-gold);
749
+ font-family: var(--rc-font-sans);
750
+ animation: rc-tooltip-in 0.2s ease-out;
751
+ margin-bottom: var(--rc-space-4, 16px);
752
+ overflow: visible;
753
+ }
754
+
755
+ .rc-info-card__icon {
756
+ flex-shrink: 0;
757
+ color: var(--rc-color-brand-gold);
758
+ width: 20px;
759
+ height: 20px;
760
+ margin-top: 1px;
761
+ }
762
+
763
+ .rc-info-card__content {
764
+ flex: 1;
765
+ min-width: 0;
766
+ }
767
+
768
+ .rc-info-card__title {
769
+ font-size: var(--rc-text-sm);
770
+ font-weight: var(--rc-weight-semibold);
771
+ color: var(--rc-color-text-primary);
772
+ margin: 0 0 var(--rc-space-1) 0;
773
+ word-wrap: break-word;
774
+ overflow-wrap: break-word;
775
+ }
776
+
777
+ .rc-info-card__body {
778
+ font-size: var(--rc-text-sm);
779
+ color: var(--rc-color-text-secondary);
780
+ line-height: var(--rc-line-height);
781
+ margin: 0;
782
+ }
783
+
784
+ .rc-info-card__dismiss {
785
+ flex-shrink: 0;
786
+ background: none;
787
+ border: none;
788
+ color: var(--rc-color-text-muted);
789
+ cursor: pointer;
790
+ padding: 2px;
791
+ transition: color 0.15s ease;
792
+ }
793
+
794
+ .rc-info-card__dismiss:hover {
795
+ color: var(--rc-color-text-primary);
796
+ }
797
+
798
+ /* ── Skeleton ── */
799
+ .rc-skeleton {
800
+ background: var(--rc-color-surface-card);
801
+ border-radius: var(--rc-radius-md);
802
+ animation: rc-skeleton-pulse 1.5s ease-in-out infinite;
803
+ }
804
+
805
+ .rc-skeleton--text {
806
+ height: 14px;
807
+ border-radius: var(--rc-radius-sm);
808
+ }
809
+
810
+ .rc-skeleton--card {
811
+ border-radius: var(--rc-radius-lg);
812
+ }
813
+
814
+ .rc-skeleton--circle {
815
+ border-radius: var(--rc-radius-full);
816
+ }
817
+
818
+ .rc-skeleton--stat {
819
+ border-radius: var(--rc-radius-lg);
820
+ height: 96px;
821
+ }
822
+
823
+ .rc-skeleton--table {
824
+ border-radius: var(--rc-radius-md);
825
+ height: 36px;
826
+ width: 100%;
827
+ }
828
+
829
+ @keyframes rc-skeleton-pulse {
830
+ 0%, 100% { opacity: 0.4; }
831
+ 50% { opacity: 0.8; }
832
+ }
833
+
834
+ /* ── ConfirmModal ── */
835
+ .rc-modal-overlay {
836
+ position: fixed;
837
+ inset: 0;
838
+ z-index: 9998;
839
+ background: rgba(0, 0, 0, 0.6);
840
+ display: flex;
841
+ align-items: center;
842
+ justify-content: center;
843
+ animation: rc-tooltip-in 0.12s ease-out;
844
+ }
845
+
846
+ .rc-modal {
847
+ background: var(--rc-color-surface-card);
848
+ border: 1px solid var(--rc-color-surface-border);
849
+ border-radius: var(--rc-radius-lg);
850
+ padding: var(--rc-space-6);
851
+ max-width: 440px;
852
+ width: 100%;
853
+ font-family: var(--rc-font-sans);
854
+ box-shadow: var(--rc-shadow-lg);
855
+ }
856
+
857
+ .rc-modal__title {
858
+ font-size: var(--rc-text-lg);
859
+ font-weight: var(--rc-weight-semibold);
860
+ color: var(--rc-color-text-primary);
861
+ margin: 0 0 var(--rc-space-2) 0;
862
+ }
863
+
864
+ .rc-modal__description {
865
+ font-size: var(--rc-text-sm);
866
+ color: var(--rc-color-text-secondary);
867
+ line-height: var(--rc-line-height);
868
+ margin: 0 0 var(--rc-space-4) 0;
869
+ }
870
+
871
+ .rc-modal__typing-label {
872
+ font-size: var(--rc-text-sm);
873
+ color: var(--rc-color-text-secondary);
874
+ margin: 0 0 var(--rc-space-2) 0;
875
+ }
876
+
877
+ .rc-modal__typing-label strong {
878
+ color: var(--rc-color-text-primary);
879
+ font-weight: var(--rc-weight-semibold);
880
+ }
881
+
882
+ .rc-modal__actions {
883
+ display: flex;
884
+ justify-content: flex-end;
885
+ gap: var(--rc-space-3);
886
+ margin-top: var(--rc-space-4);
887
+ }
888
+
889
+ /* ── ConceptTerm ── */
890
+ .rc-concept-term {
891
+ text-decoration: underline;
892
+ text-decoration-style: dotted;
893
+ text-underline-offset: 3px;
894
+ text-decoration-color: var(--rc-color-text-muted);
895
+ cursor: help;
896
+ display: inline-flex;
897
+ align-items: center;
898
+ gap: 4px;
899
+ }
900
+
901
+ .rc-concept-term__icon {
902
+ width: 14px;
903
+ height: 14px;
904
+ color: var(--rc-color-text-muted);
905
+ }
621
906
  /* ============================================================
622
907
  RunContext UXD — Utility Classes
623
908
  All values reference CSS custom properties from tokens.css.
package/static/setup.js DELETED
@@ -1 +0,0 @@
1
- (function(){"use strict";var _e,h,tt,nt,O,it,rt,at,st,Le,De,Oe,ve={},he=[],nn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pe=Array.isArray;function A(t,e){for(var n in e)t[n]=e[n];return t}function Ue(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function rn(t,e,n){var r,i,s,o={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?_e.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return me(t,o,r,i,null)}function me(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++tt,__i:-1,__u:0};return i==null&&h.vnode!=null&&h.vnode(s),s}function U(t){return t.children}function te(t,e){this.props=t,this.context=e}function Y(t,e){if(e==null)return t.__?Y(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Y(t):null}function an(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,r=[],i=[],s=A({},e);s.__v=e.__v+1,h.vnode&&h.vnode(s),Me(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,r,n??Y(e),!!(32&e.__u),i),s.__v=e.__v,s.__.__k[s.__i]=s,_t(r,s,i),e.__e=e.__=null,s.__e!=n&&ot(s)}}function ot(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),ot(t)}function lt(t){(!t.__d&&(t.__d=!0)&&O.push(t)&&!ye.__r++||it!=h.debounceRendering)&&((it=h.debounceRendering)||rt)(ye)}function ye(){try{for(var t,e=1;O.length;)O.length>e&&O.sort(at),t=O.shift(),e=O.length,an(t)}finally{O.length=ye.__r=0}}function ct(t,e,n,r,i,s,o,c,d,u,_){var l,y,f,k,I,$,g,m=r&&r.__k||he,q=e.length;for(d=sn(n,e,m,d,q),l=0;l<q;l++)(f=n.__k[l])!=null&&(y=f.__i!=-1&&m[f.__i]||ve,f.__i=l,$=Me(t,f,y,i,s,o,c,d,u,_),k=f.__e,f.ref&&y.ref!=f.ref&&(y.ref&&je(y.ref,null,f),_.push(f.ref,f.__c||k,f)),I==null&&k!=null&&(I=k),(g=!!(4&f.__u))||y.__k===f.__k?d=ut(f,d,t,g):typeof f.type=="function"&&$!==void 0?d=$:k&&(d=k.nextSibling),f.__u&=-7);return n.__e=I,d}function sn(t,e,n,r,i){var s,o,c,d,u,_=n.length,l=_,y=0;for(t.__k=new Array(i),s=0;s<i;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[s]=me(null,o,null,null,null):pe(o)?o=t.__k[s]=me(U,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[s]=me(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,d=s+y,o.__=t,o.__b=t.__b+1,c=null,(u=o.__i=on(o,n,d,l))!=-1&&(l--,(c=n[u])&&(c.__u|=2)),c==null||c.__v==null?(u==-1&&(i>_?y--:i<_&&y++),typeof o.type!="function"&&(o.__u|=4)):u!=d&&(u==d-1?y--:u==d+1?y++:(u>d?y--:y++,o.__u|=4))):t.__k[s]=null;if(l)for(s=0;s<_;s++)(c=n[s])!=null&&(2&c.__u)==0&&(c.__e==r&&(r=Y(c)),ht(c,c));return r}function ut(t,e,n,r){var i,s;if(typeof t.type=="function"){for(i=t.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=t,e=ut(i[s],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Y(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function on(t,e,n,r){var i,s,o,c=t.key,d=t.type,u=e[n],_=u!=null&&(2&u.__u)==0;if(u===null&&c==null||_&&c==u.key&&d==u.type)return n;if(r>(_?1:0)){for(i=n-1,s=n+1;i>=0||s<e.length;)if((u=e[o=i>=0?i--:s++])!=null&&(2&u.__u)==0&&c==u.key&&d==u.type)return o}return-1}function dt(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||nn.test(e)?n:n+"px"}function ge(t,e,n,r,i){var s,o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||dt(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||dt(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(st,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r?n.u=r.u:(n.u=Le,t.addEventListener(e,s?Oe:De,s)):t.removeEventListener(e,s?Oe:De,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ft(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Le++;else if(e.t<n.u)return;return n(h.event?h.event(e):e)}}}function Me(t,e,n,r,i,s,o,c,d,u){var _,l,y,f,k,I,$,g,m,q,V,fe,tn,Be,et,N=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(d=!!(32&n.__u),s=[c=e.__e=n.__e]),(_=h.__b)&&_(e);e:if(typeof N=="function")try{if(g=e.props,m=N.prototype&&N.prototype.render,q=(_=N.contextType)&&r[_.__c],V=_?q?q.props.value:_.__:r,n.__c?$=(l=e.__c=n.__c).__=l.__E:(m?e.__c=l=new N(g,V):(e.__c=l=new te(g,V),l.constructor=N,l.render=cn),q&&q.sub(l),l.state||(l.state={}),l.__n=r,y=l.__d=!0,l.__h=[],l._sb=[]),m&&l.__s==null&&(l.__s=l.state),m&&N.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=A({},l.__s)),A(l.__s,N.getDerivedStateFromProps(g,l.__s))),f=l.props,k=l.state,l.__v=e,y)m&&N.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),m&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(m&&N.getDerivedStateFromProps==null&&g!==f&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,V),e.__v==n.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,V)===!1){e.__v!=n.__v&&(l.props=g,l.state=l.__s,l.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(ee){ee&&(ee.__=e)}),he.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&o.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,V),m&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(f,k,I)})}if(l.context=V,l.props=g,l.__P=t,l.__e=!1,fe=h.__r,tn=0,m)l.state=l.__s,l.__d=!1,fe&&fe(e),_=l.render(l.props,l.state,l.context),he.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,fe&&fe(e),_=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++tn<25);l.state=l.__s,l.getChildContext!=null&&(r=A(A({},r),l.getChildContext())),m&&!y&&l.getSnapshotBeforeUpdate!=null&&(I=l.getSnapshotBeforeUpdate(f,k)),Be=_!=null&&_.type===U&&_.key==null?vt(_.props.children):_,c=ct(t,pe(Be)?Be:[Be],e,n,r,i,s,o,c,d,u),l.base=e.__e,e.__u&=-161,l.__h.length&&o.push(l),$&&(l.__E=l.__=null)}catch(ee){if(e.__v=null,d||s!=null)if(ee.then){for(e.__u|=d?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,e.__e=c}else{for(et=s.length;et--;)Ue(s[et]);Re(e)}else e.__e=n.__e,e.__k=n.__k,ee.then||Re(e);h.__e(ee,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):c=e.__e=ln(n.__e,e,n,r,i,s,o,d,u);return(_=h.diffed)&&_(e),128&e.__u?void 0:c}function Re(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Re))}function _t(t,e,n){for(var r=0;r<n.length;r++)je(n[r],n[++r],n[++r]);h.__c&&h.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){h.__e(s,i.__v)}})}function vt(t){return typeof t!="object"||t==null||t.__b>0?t:pe(t)?t.map(vt):A({},t)}function ln(t,e,n,r,i,s,o,c,d){var u,_,l,y,f,k,I,$=n.props||ve,g=e.props,m=e.type;if(m=="svg"?i="http://www.w3.org/2000/svg":m=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(u=0;u<s.length;u++)if((f=s[u])&&"setAttribute"in f==!!m&&(m?f.localName==m:f.nodeType==3)){t=f,s[u]=null;break}}if(t==null){if(m==null)return document.createTextNode(g);t=document.createElementNS(i,m,g.is&&g),c&&(h.__m&&h.__m(e,s),c=!1),s=null}if(m==null)$===g||c&&t.data==g||(t.data=g);else{if(s=s&&_e.call(t.childNodes),!c&&s!=null)for($={},u=0;u<t.attributes.length;u++)$[(f=t.attributes[u]).name]=f.value;for(u in $)f=$[u],u=="dangerouslySetInnerHTML"?l=f:u=="children"||u in g||u=="value"&&"defaultValue"in g||u=="checked"&&"defaultChecked"in g||ge(t,u,null,f,i);for(u in g)f=g[u],u=="children"?y=f:u=="dangerouslySetInnerHTML"?_=f:u=="value"?k=f:u=="checked"?I=f:c&&typeof f!="function"||$[u]===f||ge(t,u,f,$[u],i);if(_)c||l&&(_.__html==l.__html||_.__html==t.innerHTML)||(t.innerHTML=_.__html),e.__k=[];else if(l&&(t.innerHTML=""),ct(e.type=="template"?t.content:t,pe(y)?y:[y],e,n,r,m=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,o,s?s[0]:n.__k&&Y(n,0),c,d),s!=null)for(u=s.length;u--;)Ue(s[u]);c||(u="value",m=="progress"&&k==null?t.removeAttribute("value"):k!=null&&(k!==t[u]||m=="progress"&&!k||m=="option"&&k!=$[u])&&ge(t,u,k,$[u],i),u="checked",I!=null&&I!=t[u]&&ge(t,u,I,$[u],i))}return t}function je(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){h.__e(i,n)}}function ht(t,e,n){var r,i;if(h.unmount&&h.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||je(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){h.__e(s,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&ht(r[i],e,n||typeof t.type!="function");n||Ue(t.__e),t.__c=t.__=t.__e=void 0}function cn(t,e,n){return this.constructor(t,n)}function Fe(t,e,n){var r,i,s,o;e==document&&(e=document.documentElement),h.__&&h.__(t,e),i=(r=!1)?null:e.__k,s=[],o=[],Me(e,t=e.__k=rn(U,null,[t]),i||ve,ve,e.namespaceURI,i?null:e.firstChild?_e.call(e.childNodes):null,s,i?i.__e:e.firstChild,r,o),_t(s,t,o)}_e=he.slice,h={__e:function(t,e,n,r){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),o=i.__d),o)return i.__E=i}catch(c){t=c}throw t}},tt=0,nt=function(t){return t!=null&&t.constructor===void 0},te.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=A({},this.state),typeof t=="function"&&(t=t(A({},n),this.props)),t&&A(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),lt(this))},te.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),lt(this))},te.prototype.render=U,O=[],rt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,at=function(t,e){return t.__v.__b-e.__v.__b},ye.__r=0,st=/(PointerCapture)$|Capture$/i,Le=0,De=ft(!1),Oe=ft(!0);var un=0;function a(t,e,n,r,i,s){e||(e={});var o,c,d=e;if("ref"in d)for(c in d={},e)c=="ref"?o=e[c]:d[c]=e[c];var u={type:t,props:d,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--un,__i:-1,__u:0,__source:i,__self:s};if(typeof t=="function"&&(o=t.defaultProps))for(c in o)d[c]===void 0&&(d[c]=o[c]);return h.vnode&&h.vnode(u),u}var qe,P,ze,pt,mt=0,yt=[],w=h,gt=w.__b,bt=w.__r,wt=w.diffed,kt=w.__c,St=w.unmount,Ct=w.__;function dn(t,e){w.__h&&w.__h(P,t,mt||e),mt=0;var n=P.__H||(P.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function $t(t,e){var n=dn(qe++,7);return vn(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function fn(){for(var t;t=yt.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(be),e.__h.some(Ge),e.__h=[]}catch(n){e.__h=[],w.__e(n,t.__v)}}}w.__b=function(t){P=null,gt&&gt(t)},w.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ct&&Ct(t,e)},w.__r=function(t){bt&&bt(t),qe=0;var e=(P=t.__c).__H;e&&(ze===P?(e.__h=[],P.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(be),e.__h.some(Ge),e.__h=[],qe=0)),ze=P},w.diffed=function(t){wt&&wt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(yt.push(e)!==1&&pt===w.requestAnimationFrame||((pt=w.requestAnimationFrame)||_n)(fn)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),ze=P=null},w.__c=function(t,e){e.some(function(n){try{n.__h.some(be),n.__h=n.__h.filter(function(r){return!r.__||Ge(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],w.__e(r,n.__v)}}),kt&&kt(t,e)},w.unmount=function(t){St&&St(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(r){try{be(r)}catch(i){e=i}}),n.__H=void 0,e&&w.__e(e,n.__v))};var xt=typeof requestAnimationFrame=="function";function _n(t){var e,n=function(){clearTimeout(r),xt&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);xt&&(e=requestAnimationFrame(n))}function be(t){var e=P,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),P=e}function Ge(t){var e=P;t.__c=t.__(),P=e}function vn(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}var hn=Symbol.for("preact-signals");function we(){if(B>1)B--;else{var t,e=!1;for((function(){var i=Se;for(Se=void 0;i!==void 0;)i.S.v===i.v&&(i.S.i=i.i),i=i.o})();ne!==void 0;){var n=ne;for(ne=void 0,ke++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Pt(n))try{n.c()}catch(i){e||(t=i,e=!0)}n=r}}if(ke=0,B--,e)throw t}}function pn(t){if(B>0)return t();He=++mn,B++;try{return t()}finally{we()}}var p=void 0;function Et(t){var e=p;p=void 0;try{return t()}finally{p=e}}var ne=void 0,B=0,ke=0,mn=0,He=0,Se=void 0,Ce=0;function Tt(t){if(p!==void 0){var e=t.n;if(e===void 0||e.t!==p)return e={i:0,S:t,p:p.s,n:void 0,t:p,e:void 0,x:void 0,r:e},p.s!==void 0&&(p.s.n=e),p.s=e,t.n=e,32&p.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=p.s,e.n=void 0,p.s.n=e,p.s=e),e}}function S(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}S.prototype.brand=hn,S.prototype.h=function(){return!0},S.prototype.S=function(t){var e=this,n=this.t;n!==t&&t.e===void 0&&(t.x=n,this.t=t,n!==void 0?n.e=t:Et(function(){var r;(r=e.W)==null||r.call(e)}))},S.prototype.U=function(t){var e=this;if(this.t!==void 0){var n=t.e,r=t.x;n!==void 0&&(n.x=r,t.e=void 0),r!==void 0&&(r.e=n,t.x=void 0),t===this.t&&(this.t=r,r===void 0&&Et(function(){var i;(i=e.Z)==null||i.call(e)}))}},S.prototype.subscribe=function(t){var e=this;return K(function(){var n=e.value,r=p;p=void 0;try{t(n)}finally{p=r}},{name:"sub"})},S.prototype.valueOf=function(){return this.value},S.prototype.toString=function(){return this.value+""},S.prototype.toJSON=function(){return this.value},S.prototype.peek=function(){var t=p;p=void 0;try{return this.value}finally{p=t}},Object.defineProperty(S.prototype,"value",{get:function(){var t=Tt(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(ke>100)throw new Error("Cycle detected");(function(n){B!==0&&ke===0&&n.l!==He&&(n.l=He,Se={S:n,v:n.v,i:n.i,o:Se})})(this),this.v=t,this.i++,Ce++,B++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{we()}}}});function v(t,e){return new S(t,e)}function Pt(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function It(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Nt(t){for(var e=t.s,n=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}t.s=n}function z(t,e){S.call(this,void 0),this.x=t,this.s=void 0,this.g=Ce-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}z.prototype=new S,z.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ce))return!0;if(this.g=Ce,this.f|=1,this.i>0&&!Pt(this))return this.f&=-2,!0;var t=p;try{It(this),p=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return p=t,Nt(this),this.f&=-2,!0},z.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}S.prototype.S.call(this,t)},z.prototype.U=function(t){if(this.t!==void 0&&(S.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}},z.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}},Object.defineProperty(z.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=Tt(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function At(t,e){return new z(t,e)}function Bt(t){var e=t.m;if(t.m=void 0,typeof e=="function"){B++;var n=p;p=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,We(t),r}finally{p=n,we()}}}function We(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Bt(t)}function yn(t){if(p!==this)throw new Error("Out-of-order effect");Nt(this),p=t,this.f&=-2,8&this.f&&We(this),we()}function Z(t,e){this.x=t,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=e?.name}Z.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.m=e)}finally{t()}},Z.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Bt(this),It(this),B++;var t=p;return p=this,yn.bind(this,t)},Z.prototype.N=function(){2&this.f||(this.f|=2,this.u=ne,ne=this)},Z.prototype.d=function(){this.f|=8,1&this.f||We(this)},Z.prototype.dispose=function(){this.d()};function K(t,e){var n=new Z(t,e);try{n.c()}catch(i){throw n.d(),i}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Lt,$e,gn=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__,Dt=[];K(function(){Lt=this.N})();function Q(t,e){h[t]=e.bind(null,h[t]||function(){})}function xe(t){if($e){var e=$e;$e=void 0,e()}$e=t&&t.S()}function Ot(t){var e=this,n=t.data,r=wn(n);r.value=n;var i=$t(function(){for(var c=e,d=e.__v;d=d.__;)if(d.__c){d.__c.__$f|=4;break}var u=At(function(){var f=r.value.value;return f===0?0:f===!0?"":f||""}),_=At(function(){return!Array.isArray(u.value)&&!nt(u.value)}),l=K(function(){if(this.N=Ut,_.value){var f=u.value;c.__v&&c.__v.__e&&c.__v.__e.nodeType===3&&(c.__v.__e.data=f)}}),y=e.__$u.d;return e.__$u.d=function(){l(),y.call(this)},[_,u]},[]),s=i[0],o=i[1];return s.value?o.peek():o.value}Ot.displayName="ReactiveTextNode",Object.defineProperties(S.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ot},props:{configurable:!0,get:function(){var t=this;return{data:{get value(){return t.value}}}}},__b:{configurable:!0,value:1}}),Q("__b",function(t,e){if(typeof e.type=="string"){var n,r=e.props;for(var i in r)if(i!=="children"){var s=r[i];s instanceof S&&(n||(e.__np=n={}),n[i]=s,r[i]=s.peek())}}t(e)}),Q("__r",function(t,e){if(t(e),e.type!==U){xe();var n,r=e.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=(function(i,s){var o;return K(function(){o=this},{name:s}),o.c=i,o})(function(){var i;gn&&((i=n.y)==null||i.call(n)),r.__$f|=1,r.setState({})},typeof e.type=="function"?e.type.displayName||e.type.name:""))),xe(n)}}),Q("__e",function(t,e,n,r){xe(),t(e,n,r)}),Q("diffed",function(t,e){xe();var n;if(typeof e.type=="string"&&(n=e.__e)){var r=e.__np,i=e.props;if(r){var s=n.U;if(s)for(var o in s){var c=s[o];c!==void 0&&!(o in r)&&(c.d(),s[o]=void 0)}else s={},n.U=s;for(var d in r){var u=s[d],_=r[d];u===void 0?(u=bn(n,d,_),s[d]=u):u.o(_,i)}for(var l in r)i[l]=r[l]}}t(e)});function bn(t,e,n,r){var i=e in t&&t.ownerSVGElement===void 0,s=v(n),o=n.peek();return{o:function(c,d){s.value=c,o=c.peek()},d:K(function(){this.N=Ut;var c=s.value.value;o!==c?(o=void 0,i?t[e]=c:c!=null&&(c!==!1||e[4]==="-")?t.setAttribute(e,c):t.removeAttribute(e)):o=void 0})}}Q("unmount",function(t,e){if(typeof e.type=="string"){var n=e.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var i in r){var s=r[i];s&&s.d()}}}e.__np=void 0}else{var o=e.__c;if(o){var c=o.__$u;c&&(o.__$u=void 0,c.d())}}t(e)}),Q("__h",function(t,e,n,r){(r<3||r===9)&&(e.__$f|=2),t(e,n,r)}),te.prototype.shouldComponentUpdate=function(t,e){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var i in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var s=2&this.__$f;if(!(r||s||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in t)if(o!=="__source"&&t[o]!==this.props[o])return!0;for(var c in this.props)if(!(c in t))return!0;return!1};function wn(t,e){return $t(function(){return v(t,e)},[])}var kn=function(t){queueMicrotask(function(){queueMicrotask(t)})};function Sn(){pn(function(){for(var t;t=Dt.shift();)Lt.call(t)})}function Ut(){Dt.push(this)===1&&(h.requestAnimationFrame||kn)(Sn)}const Mt="runcontext_wizard_state",Rt=["Connect","Define","Scaffold","Checkpoint","Enrich","Serve"],b=v(1),L=v({product_name:"",description:"",owner:{name:"",team:"",email:""},sensitivity:"internal",docs:[]}),x=v([]),T=v(null),Je=v(null),X=v({}),ie=v({}),G=v([]);function Cn(){try{const t=sessionStorage.getItem(Mt);if(!t)return;const e=JSON.parse(t);e.step&&(b.value=e.step),e.brief&&(L.value=e.brief),e.sources&&(x.value=e.sources),e.pipelineId&&(T.value=e.pipelineId)}catch{}}Cn(),K(()=>{const t={step:b.value,brief:L.value,sources:x.value,pipelineId:T.value};try{sessionStorage.setItem(Mt,JSON.stringify(t))}catch{}});function C({variant:t="primary",size:e="md",className:n,children:r,...i}){const s=["rc-btn",`rc-btn--${t}`,`rc-btn--${e}`,n].filter(Boolean).join(" ");return a("button",{className:s,...i,children:r})}function M({interactive:t=!1,className:e,children:n,...r}){const i=["rc-card",t&&"rc-card--interactive",e].filter(Boolean).join(" ");return a("div",{className:i,...r,children:n})}function $n({variant:t,className:e,children:n,...r}){const i=["rc-badge",`rc-badge--${t}`,e].filter(Boolean).join(" ");return a("span",{className:i,...r,children:n})}var xn={gold:"AI-Ready",silver:"Trusted",bronze:"Discoverable"};function jt({tier:t,...e}){return a($n,{variant:t,...e,children:xn[t]})}function re({error:t=!1,className:e,...n}){const r=["rc-input",t&&"rc-input--error",e].filter(Boolean).join(" ");return a("input",{className:r,...n})}function En({error:t=!1,className:e,...n}){const r=["rc-textarea",t&&"rc-textarea--error",e].filter(Boolean).join(" ");return a("textarea",{className:r,...n})}function Tn({error:t=!1,className:e,children:n,...r}){const i=["rc-select",t&&"rc-select--error",e].filter(Boolean).join(" ");return a("select",{className:i,...r,children:n})}function Pn({events:t,className:e,...n}){const r=["rc-activity-feed",e].filter(Boolean).join(" ");return t.length===0?a("div",{className:r,...n,children:a("p",{className:"rc-activity-feed__message",children:"No recent activity."})}):a("div",{className:r,...n,children:t.map(i=>a("div",{className:"rc-activity-feed__item",children:[a("span",{className:"rc-activity-feed__dot"}),a("span",{className:"rc-activity-feed__message",children:i.message}),a("span",{className:"rc-activity-feed__meta",children:i.timestamp})]},i.id))})}function Ft({message:t,action:e,className:n,...r}){const i=["rc-error-card",n].filter(Boolean).join(" ");return a("div",{className:i,...r,children:[a("p",{className:"rc-error-card__message",children:t}),e]})}function In({code:t,className:e,...n}){const r=["rc-code",e].filter(Boolean).join(" ");return a("pre",{className:r,...n,children:a("code",{children:t})})}function Nn(){return a(M,{className:"checkpoint-card",children:[a("h2",{children:"Bronze Tier Achieved"}),a("div",{class:"tier-scorecard",children:[a("div",{class:"tier-row achieved",children:[a(jt,{tier:"bronze"}),a("span",{class:"tier-desc",children:"Schema metadata, table/column names, types, row counts"})]}),a("div",{class:"tier-row",children:[a("span",{class:"tier-label",children:"Silver"}),a("span",{class:"tier-desc",children:"Column descriptions, sample values, trust tags"})]}),a("div",{class:"tier-row",children:[a("span",{class:"tier-label",children:"Gold"}),a("span",{class:"tier-desc",children:"Join rules, grain statements, semantic roles, golden queries, guardrail filters"})]})]}),a("p",{class:"checkpoint-explain",children:"Your semantic plane has basic schema metadata. AI tools can use this now, but with Gold tier they will understand join relationships, business descriptions, and query patterns."}),a("div",{class:"checkpoint-ctas",children:[a(C,{variant:"secondary",onClick:()=>{b.value=6},children:"Start MCP Server"}),a(C,{onClick:()=>{b.value=5},children:"Continue to Gold"})]})]})}async function E(t,e,n){const r={method:t,headers:{}};n&&!(n instanceof FormData)?(r.headers["Content-Type"]="application/json",r.body=JSON.stringify(n)):n&&(r.body=n);const i=await fetch(e,r);if(!i.ok){const o=await i.text();throw new Error(o||i.statusText)}return(i.headers.get("content-type")||"").includes("json")?i.json():i.text()}const qt={postgres:"neon",mysql:"planetscale",duckdb:null,sqlite:null,snowflake:"snowflake",bigquery:"gcp",clickhouse:"clickhouse",databricks:"databricks",mssql:"azure-sql",mongodb:"mongodb"};function An(t,e){if(!t)return e?qt[e]??null:null;const n=t.toLowerCase();return n.includes("neon")?"neon":n.includes("supabase")?"supabase":n.includes("planetscale")?"planetscale":n.includes("snowflake")?"snowflake":n.includes("bigquery")||n.includes("gcp")?"gcp":n.includes("clickhouse")?"clickhouse":n.includes("databricks")?"databricks":n.includes("azure")?"azure-sql":n.includes("mongodb")||n.includes("atlas")?"mongodb":e?qt[e]??null:null}const Ve=v([]),zt=v([]),Gt=v(new Set),ae=v([]),se=v(null),R=v(!1),D=v(null),oe=v(""),le=v(!1),ce=v(null),Ht=v(!1);function Ye(t){const e=document.getElementById("db-status-dot"),n=document.getElementById("db-status-text");e&&(e.classList.remove("error"),e.classList.add("success")),n&&(n.textContent=(t.name||t.adapter||"database")+" connected")}async function Bn(){try{const t=await E("GET","/api/auth/providers");Ve.value=t}catch{}}async function Ln(){try{const e=(await E("GET","/api/sources")).sources||[];zt.value=e;const n=new Set;for(const r of e){const i=An(r.origin,r.adapter);i&&n.add(i)}Gt.value=n}catch{}}async function Wt(t){R.value=!0,D.value=null,se.value=t;try{const e=await E("POST","/api/auth/start",{provider:t});e.databases&&(ae.value=e.databases)}catch(e){D.value=e.message||"OAuth failed"}finally{R.value=!1}}async function Dn(t){R.value=!0,D.value=null;try{if((await E("POST","/api/auth/select-db",{provider:se.value,database:t})).ok){const n={name:t.name||t.database,adapter:t.adapter,host:t.host,database:t.database||t.name,metadata:t.metadata};x.value=[n,...x.value],Ye(n),ae.value=[],se.value=null,b.value=2}}catch(e){D.value=e.message||"Failed to select database"}finally{R.value=!1}}async function On(t){const e={name:t.name,adapter:t.adapter,host:t.host,database:t.database||t.name,metadata:t.metadata};x.value=[e,...x.value],Ye(e),b.value=2}async function Un(){const t=oe.value.trim();if(t){le.value=!0,ce.value=null;try{const e=await E("POST","/api/sources",{connection:t});e.source&&(x.value=[e.source,...x.value],Ye(e.source),oe.value="",b.value=2)}catch(e){ce.value=e.message||"Connection failed"}finally{le.value=!1}}}function Mn(){ae.value=[],se.value=null,D.value=null}function Rn(){if(Ht.value||(Ht.value=!0,Bn(),Ln()),ae.value.length>0)return a("div",{children:[a("div",{class:"oauth-result-header",children:[a("h2",{class:"connect-heading",children:"Select a database"}),a("a",{href:"#",class:"muted",onClick:i=>{i.preventDefault(),Mn()},children:"← Back to providers"})]}),D.value&&a("p",{class:"field-error",children:D.value}),a("div",{class:"source-cards",children:ae.value.map(i=>a(M,{interactive:!0,children:a("div",{class:"source-card",children:[a("div",{class:"source-card-name",children:i.name||i.database}),i.host&&a("div",{class:"source-card-host",children:i.host}),i.adapter&&a("div",{class:"source-card-meta",children:i.adapter}),a(C,{size:"sm",disabled:R.value,onClick:()=>Dn(i),children:"Use This"})]})},i.id||i.name))})]});const t=Gt.value,e=zt.value.filter(i=>i.adapter==="duckdb"||i.adapter==="sqlite"),n=Ve.value.filter(i=>t.has(i.id)),r=Ve.value.filter(i=>!t.has(i.id));return a("div",{children:[a("h2",{class:"connect-heading",children:"Connect a database"}),a("p",{class:"connect-subheading",children:"Choose a cloud provider, use a local file, or paste a connection string."}),D.value&&a("p",{class:"field-error",children:D.value}),t.size>0&&a("p",{class:"detected-hint",children:"We detected database configurations in your project."}),e.length>0&&a("div",{class:"source-cards",children:e.map(i=>a(M,{interactive:!0,children:a("div",{class:"source-card source-card-local",children:[a("span",{class:"source-card-badge",children:i.adapter}),a("div",{class:"source-card-name",children:i.name||i.database}),i.host&&a("div",{class:"source-card-host",children:i.host}),a(C,{size:"sm",onClick:()=>On(i),children:"Use This"})]})},i.name||i.database))}),n.length>0&&a("div",{class:"source-cards",children:n.map(i=>a(M,{interactive:!0,children:a("div",{class:"source-card source-card-detected",children:[a("span",{class:"source-card-badge",children:"detected"}),a("div",{class:"source-card-name",children:i.displayName||i.display_name||i.id}),a(C,{size:"sm",disabled:R.value,onClick:()=>Wt(i.id),children:R.value&&se.value===i.id?"Connecting...":"Connect"})]})},i.id))}),(e.length>0||n.length>0)&&r.length>0&&a("div",{class:"section-divider"}),r.length>0&&a("div",{class:"platform-grid",children:r.map(i=>a("button",{class:"platform-btn",disabled:R.value,onClick:()=>Wt(i.id),children:i.displayName||i.display_name||i.id},i.id))}),a("div",{class:"manual-connect",children:[a("label",{class:"label-uppercase",children:"Or paste a connection string"}),a("div",{class:"manual-connect-row",children:[a(re,{placeholder:"postgres://user:pass@host:5432/dbname",value:oe.value,onInput:i=>{oe.value=i.target.value},error:!!ce.value,disabled:le.value}),a(C,{variant:"secondary",disabled:le.value||!oe.value.trim(),onClick:()=>Un(),children:le.value?"Connecting...":"Connect"})]}),ce.value&&a("p",{class:"field-error",children:ce.value})]})]})}const Ee=v(!1),Te=v(""),Jt=v({}),Pe=v(!1);function jn(){const t=L.value;function e(i,s){if(i.startsWith("owner.")){const o=i.split(".")[1];L.value={...t,owner:{...t.owner,[o]:s}}}else L.value={...t,[i]:s}}async function n(){const i={};if(t.product_name.trim()?/^[a-zA-Z0-9_-]+$/.test(t.product_name.trim())||(i.product_name="Only letters, numbers, hyphens, and underscores allowed."):i.product_name="Product name is required.",t.description.trim()||(i.description="Description is required."),Jt.value=i,!(Object.keys(i).length>0)){Ee.value=!0,Te.value="";try{await E("POST","/api/brief",t),b.value=3}catch(s){Te.value=s.message||"Failed to save. Please try again."}finally{Ee.value=!1}}}!Pe.value&&!t.product_name&&!t.description&&!t.owner.name&&x.value.length>0&&(Pe.value=!0,E("POST","/api/suggest-brief",{source:x.value[0]}).then(i=>{const s=L.value;L.value={product_name:s.product_name||i.product_name||"",description:s.description||i.description||"",owner:{name:s.owner.name||i.owner?.name||"",team:s.owner.team||i.owner?.team||"",email:s.owner.email||i.owner?.email||""},sensitivity:s.sensitivity||i.sensitivity||"internal",docs:s.docs}}).catch(()=>{}).finally(()=>{Pe.value=!1}));const r=Jt.value;return a(M,{children:[a("h2",{children:"Define Your Data Product"}),a("p",{class:"muted",children:"Tell us about your data product. This metadata helps AI agents understand what they are working with."}),Pe.value&&a("p",{class:"muted suggest-loading",children:"Auto-filling from your database..."}),a("div",{class:"define-form",children:[a("div",{class:"field full-width",children:[a("label",{for:"product_name",children:"Product Name *"}),a(re,{id:"product_name",value:t.product_name,onInput:i=>e("product_name",i.currentTarget.value),placeholder:"my-data-product",error:!!r.product_name}),r.product_name&&a("p",{class:"field-error",children:r.product_name}),a("p",{class:"hint",children:"Alphanumeric, hyphens, and underscores only."})]}),a("div",{class:"field full-width",children:[a("label",{for:"description",children:"Description *"}),a(En,{id:"description",value:t.description,onInput:i=>e("description",i.currentTarget.value),placeholder:"What does this data product provide?",error:!!r.description}),r.description&&a("p",{class:"field-error",children:r.description})]}),a("div",{class:"field",children:[a("label",{for:"owner_name",children:"Owner Name"}),a(re,{id:"owner_name",value:t.owner.name,onInput:i=>e("owner.name",i.currentTarget.value),placeholder:"Jane Doe"})]}),a("div",{class:"field",children:[a("label",{for:"owner_team",children:"Team"}),a(re,{id:"owner_team",value:t.owner.team,onInput:i=>e("owner.team",i.currentTarget.value),placeholder:"Data Engineering"})]}),a("div",{class:"field",children:[a("label",{for:"owner_email",children:"Email"}),a(re,{id:"owner_email",value:t.owner.email,onInput:i=>e("owner.email",i.currentTarget.value),placeholder:"jane@example.com"})]}),a("div",{class:"field",children:[a("label",{for:"sensitivity",children:"Sensitivity"}),a(Tn,{id:"sensitivity",value:t.sensitivity,onChange:i=>e("sensitivity",i.currentTarget.value),children:[a("option",{value:"public",children:"Public"}),a("option",{value:"internal",children:"Internal"}),a("option",{value:"confidential",children:"Confidential"}),a("option",{value:"restricted",children:"Restricted"})]})]}),a("div",{class:"define-actions",children:[a(C,{variant:"secondary",onClick:()=>{b.value=1},children:"Back"}),a(C,{onClick:n,disabled:Ee.value,children:Ee.value?"Saving...":"Continue"})]}),Te.value&&a("p",{class:"field-error",children:Te.value})]})]})}const Fn=[{key:"column-descriptions",label:"Column descriptions",initial:"0/45 columns"},{key:"sample-values",label:"Sample values",initial:"0/45 columns"},{key:"join-rules",label:"Join rules",initial:"0/0"},{key:"grain-statements",label:"Grain statements",initial:"0/0"},{key:"semantic-roles",label:"Semantic roles",initial:"0/0"},{key:"golden-queries",label:"Golden queries",initial:"0/0"},{key:"guardrail-filters",label:"Guardrail filters",initial:"0/0"}],ue=v(!1),H=v(""),Ze=v(new Set);let Ie=null;function Ke(){Ie&&(clearInterval(Ie),Ie=null)}async function Vt(){ue.value=!0,H.value="",ie.value={},G.value=[{message:"Enrichment pipeline started.",timestamp:new Date().toISOString()}];const t={productName:L.value.product_name,targetTier:"gold"};if(x.value[0]){const e=x.value[0];t.dataSource=(typeof e=="string"?e:e.name||e.database||"").replace(/[^a-zA-Z0-9_-]/g,"_")}try{const e=await E("POST","/api/pipeline/start",t);T.value=e.id,qn()}catch(e){ue.value=!1,H.value=e.message||"Failed to start enrichment."}}function qn(){Ke();async function t(){if(T.value)try{const e=await E("GET","/api/pipeline/status/"+T.value),n=e.stages||[];let r=!1,i=!1,s=!1;for(const o of n)(o.name==="enrich-silver"||o.stage==="enrich-silver")&&o.status==="done"&&(i=!0),(o.name==="enrich-gold"||o.stage==="enrich-gold")&&o.status==="done"&&(s=!0),o.status==="error"&&(r=!0);r?(Ke(),ue.value=!1,H.value=e.error||"An enrichment stage failed."):i&&s&&(Ke(),ue.value=!1,G.value=[...G.value,{message:"Gold enrichment complete! Advancing...",timestamp:new Date().toISOString()}],b.value=6)}catch{}}t(),Ie=setInterval(t,3e3)}function zn(){T.value=null,ie.value={},G.value=[],H.value="",Vt()}function Gn(t){const e=new Set(Ze.value);e.has(t)?e.delete(t):e.add(t),Ze.value=e}function Hn(){const t=ie.value,e=Ze.value,n=G.value.map((r,i)=>({id:String(i),type:"log",message:r.message,timestamp:new Date(r.timestamp).toLocaleTimeString()}));return a(M,{children:[a("h2",{children:"Enriching to Gold"}),a("p",{class:"muted",children:"RunContext is analyzing your schema to add descriptions, join rules, and query patterns."}),!ue.value&&!H.value&&a("div",{class:"step-actions",children:[a(C,{variant:"secondary",onClick:()=>{b.value=4},children:"Back"}),a(C,{onClick:Vt,children:"Start Enrichment"})]}),a("div",{class:"enrich-dashboard",children:[a("div",{class:"enrich-checklist",children:Fn.map(r=>{const i=t[r.key],s=i?.status||"",o=["stage-dot",s==="working"?"running":s==="done"?"done":""].filter(Boolean).join(" ");return a("div",{class:`enrich-row${e.has(r.key)?" expanded":""}`,children:[a("div",{class:"enrich-row-header",onClick:()=>Gn(r.key),children:[a("span",{class:o}),a("span",{class:"enrich-req-name",children:r.label}),a("span",{class:"enrich-progress",children:i?.progress||r.initial}),a("span",{class:"enrich-arrow",children:"▶"})]}),a("div",{class:"enrich-row-detail",children:"Details will appear as enrichment progresses."})]})})}),a("div",{class:"activity-log",children:[a("div",{class:"activity-log-title",children:"Activity Log"}),a(Pn,{events:n})]})]}),H.value&&a(Ft,{message:H.value,action:a(C,{onClick:zn,children:"Retry"})})]})}function Wn({stageKey:t,label:e,status:n,summary:r,error:i}){const s=["stage-dot",n==="running"?"running":n==="done"?"done":n==="error"?"error":""].filter(Boolean).join(" ");return a("div",{class:"stage-row","data-stage":t,children:[a("span",{class:s}),a("span",{class:"stage-name",children:e}),r&&a("span",{class:"stage-summary",children:r}),i&&a("span",{class:"stage-error",children:i})]})}const Yt=[{key:"introspect",label:"Extracting schema from database..."},{key:"scaffold",label:"Building semantic plane files..."},{key:"verify",label:"Validating semantic plane..."},{key:"autofix",label:"Fixing any issues..."},{key:"agent-instructions",label:"Generating agent instructions..."}],W=v(!1),j=v("");let de=null;function Ne(){de&&(clearInterval(de),de=null)}async function Zt(){W.value=!0,j.value="",X.value={};const t={productName:L.value.product_name,targetTier:"bronze"};if(x.value[0]){const e=x.value[0];t.dataSource=(typeof e=="string"?e:e.name||e.database||"").replace(/[^a-zA-Z0-9_-]/g,"_")}try{const e=await E("POST","/api/pipeline/start",t);T.value=e.id,Kt()}catch(e){W.value=!1,j.value=e.message||"Failed to start build."}}function Kt(){Ne();async function t(){if(T.value)try{const e=await E("GET","/api/pipeline/status/"+T.value),n=e.stages||[],r={};let i=!1,s=!0;for(const o of Yt){const c=n.find(d=>d.stage===o.key||d.name===o.key);!c||c.status==="pending"?(s=!1,r[o.key]={status:"pending"}):(r[o.key]={status:c.status,summary:c.summary,error:c.error},c.status==="running"&&(s=!1),c.status==="error"&&(i=!0,s=!1))}X.value=r,i?(Ne(),W.value=!1,j.value=e.error||"A pipeline stage failed."):s&&n.length>0&&(Ne(),W.value=!1,b.value=4)}catch{}}t(),de=setInterval(t,2e3)}function Jn(){T.value=null,X.value={},j.value="",Zt()}function Vn(){T.value&&!de&&!j.value&&(W.value=!0,Kt());const t=X.value;return a(M,{children:[a("h2",{children:"Building Your Semantic Plane"}),a("p",{class:"muted",children:"Connecting to your database and extracting schema metadata. This creates a Bronze-tier semantic plane."}),a("div",{class:"scaffold-stages",children:Yt.map(e=>a(Wn,{stageKey:e.key,label:e.label,status:t[e.key]?.status,summary:t[e.key]?.summary,error:t[e.key]?.error},e.key))}),j.value&&a(Ft,{message:j.value,action:a(C,{onClick:Jn,children:"Retry"})}),a("div",{class:"step-actions",children:[a(C,{variant:"secondary",onClick:()=>{Ne(),b.value=2},children:"Back"}),!W.value&&!T.value&&!j.value&&a(C,{onClick:Zt,children:"Start Build"}),W.value&&a("span",{class:"muted",children:"Build in progress..."})]})]})}const J=v("bronze"),Qe=v(null),Ae=v(!1),Qt=v(!1);function Yn(){!Qt.value&&T.value&&(Qt.value=!0,E("GET","/api/pipeline/status/"+T.value).then(n=>{const r=n.stages||[];let i=!1,s=!1;for(const o of r)(o.name==="enrich-gold"||o.stage==="enrich-gold")&&o.status==="done"&&(s=!0),(o.name==="enrich-silver"||o.stage==="enrich-silver")&&o.status==="done"&&(i=!0);s?J.value="gold":i&&(J.value="silver")}).catch(()=>{}));async function t(){Ae.value=!0;try{const n=await E("GET","/api/mcp-config");Qe.value=JSON.stringify(n,null,2)}catch{}finally{Ae.value=!1}}const e=J.value.charAt(0).toUpperCase()+J.value.slice(1);return a(M,{className:"serve-card",children:[a("h2",{children:"Your Semantic Plane is Ready"}),a(jt,{tier:J.value}),a("p",{class:"muted",children:["Your ",e," tier semantic plane is ready for AI agents."]}),J.value!=="gold"&&a("p",{class:"muted",style:{marginTop:"8px"},children:["To reach Gold, run enrichment with ",a("code",{children:"context enrich --target gold"}),"."]}),a("div",{class:"serve-ctas",children:[a(C,{onClick:t,disabled:Ae.value,children:Ae.value?"Loading...":"Start MCP Server"}),a(C,{variant:"secondary",disabled:!0,title:"Coming soon",children:"Publish to Cloud"})]}),Qe.value&&a(U,{children:[a(In,{code:Qe.value}),a("p",{class:"muted",style:{marginTop:"8px",fontSize:"0.85rem"},children:["Copy the JSON above into your IDE's MCP settings, or run: ",a("code",{children:"context serve"})]})]}),a("div",{class:"serve-commands",children:[a("div",{class:"serve-commands-title",children:"CLI Commands"}),[["context serve","Start the MCP server"],["context tier","Check your current tier"],["context enrich --target gold","Enrich to Gold tier"],["context verify","Validate your semantic plane"]].map(([n,r])=>a("div",{class:"serve-cmd-row",children:[a("span",{class:"serve-cmd",children:n}),a("span",{class:"serve-cmd-desc",children:r})]}))]}),J.value!=="gold"&&a("p",{style:{marginTop:"16px"},children:a("a",{style:{color:"var(--rc-color-accent, #c9a55a)",cursor:"pointer",fontSize:"0.875rem"},onClick:()=>{b.value=5},children:"Continue Enrichment"})}),a("div",{class:"step-actions",children:a(C,{variant:"secondary",onClick:()=>{b.value=b.value-1},children:"Back"})})]})}function Zn(){switch(b.value){case 1:return a(Rn,{});case 2:return a(jn,{});case 3:return a(Vn,{});case 4:return a(Nn,{});case 5:return a(Hn,{});case 6:return a(Yn,{});default:return null}}function Kn(){return a(Zn,{})}function Qn(){const t=b.value;return a(U,{children:Rt.map((e,n)=>{const r=n+1,i=r<t?"step-completed":r===t?"step-active":"step-future";return a(U,{children:[a("span",{class:i,onClick:r<t?()=>{b.value=r}:void 0,style:r<t?{cursor:"pointer"}:void 0,children:e}),r<Rt.length&&a("span",{class:"step-separator",children:">"})]},e)})})}let F=null;function Xe(t){Je.value=t,F&&(F.onclose=null,F.close(),F=null);const e=location.protocol==="https:"?"wss:":"ws:";F=new WebSocket(`${e}//${location.host}/ws?session=${encodeURIComponent(t)}&role=wizard`),F.onmessage=n=>{try{const r=JSON.parse(n.data);Xn(r)}catch{}},F.onclose=()=>{setTimeout(()=>{Je.value&&Xe(Je.value)},2e3)},F.onerror=()=>{}}function Xn(t){const e=t.payload||{};switch(t.type){case"setup:step":e.step&&(b.value=e.step);break;case"setup:field":{const n=document.getElementById(e.fieldId);n&&(n.value=e.value||"",n.dispatchEvent(new Event("input")));break}case"pipeline:stage":X.value={...X.value,[e.stage]:{status:e.status,summary:e.summary,error:e.error}};break;case"enrich:progress":ie.value={...ie.value,[e.requirement]:{status:e.status,progress:e.progress}};break;case"enrich:log":G.value=[...G.value,{message:e.message,timestamp:e.timestamp||new Date().toISOString()}];break}}const Xt=document.getElementById("wizard-content");Xt&&Fe(a(Kn,{}),Xt);const en=document.getElementById("stepper");en&&Fe(a(Qn,{}),en);function ei(){const t=document.getElementById("locked-tooltip");t&&(document.querySelectorAll(".nav-item.locked").forEach(e=>{e.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation();const r=e.getBoundingClientRect();t.style.display="block",t.style.left=r.left+"px",t.style.top=r.bottom+6+"px"})}),document.addEventListener("click",e=>{if(t.style.display!=="none"){let n=!1;document.querySelectorAll(".nav-item.locked").forEach(r=>{r.contains(e.target)&&(n=!0)}),n||(t.style.display="none")}}))}function ti(){async function t(){const e=document.getElementById("mcp-status-dot"),n=document.getElementById("mcp-status-text"),r=document.getElementById("mcp-server-dot"),i=document.getElementById("mcp-server-text");if(!(!e||!n))try{const s=new AbortController,o=setTimeout(()=>s.abort(),2e3);await fetch("http://localhost:3333/health",{method:"GET",mode:"no-cors",signal:s.signal}),clearTimeout(o),e.classList.remove("error"),e.classList.add("success"),n.textContent="connected",r&&(r.classList.remove("error"),r.classList.add("success")),i&&(i.textContent="MCP running")}catch{e.classList.remove("success"),n.textContent="offline",r&&r.classList.remove("success"),i&&(i.textContent="MCP stopped")}}t(),setInterval(t,1e4)}function ni(){if(ei(),ti(),x.value.length>0){const n=x.value[0],r=document.getElementById("db-status-dot"),i=document.getElementById("db-status-text");r&&i&&(r.classList.remove("error"),r.classList.add("success"),i.textContent=(n.name||n.adapter)+" connected")}E("GET","/api/products").then(n=>{if(n.length>0){const r=document.getElementById("wizard-content");if(!r)return;const i=document.createElement("div");r.insertBefore(i,r.firstChild),Fe(a("div",{class:"existing-products-banner",children:[a("p",{class:"banner-title",children:["Your semantic plane has ",n.length," data product",n.length===1?"":"s",". Adding another."]}),a("div",{class:"product-chips",children:n.map(s=>a("span",{class:"product-chip",children:s.name}))})]}),i)}}).catch(()=>{});const e=new URLSearchParams(window.location.search).get("session");e?Xe(e):E("POST","/api/session").then(n=>{if(n.sessionId){Xe(n.sessionId);const r=window.location.pathname+"?session="+encodeURIComponent(n.sessionId);window.history.replaceState({},"",r)}}).catch(()=>{})}document.addEventListener("DOMContentLoaded",ni)})();