mcp-zenskar 2.2.1 → 2.2.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 (2) hide show
  1. package/dist/ui/app.html +1 -1
  2. package/package.json +1 -1
package/dist/ui/app.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>app</title>
7
- <script type="module" crossorigin>(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m={},h=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function y(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return x(t,s,i,a,null)}function x(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function S(e){return e.children}function C(e,t){this.props=e,this.context=t}function w(e,t){if(t==null)return e.__?w(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?w(e):null}function T(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=v({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),ae(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??w(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,se(i,o,a),n.__e=n.__=null,o.__e!=r&&E(o)}}function E(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),E(e)}function D(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!O.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||a)(O)}function O(){try{for(var e,t=1;r.length;)r.length>t&&r.sort(o),e=r.shift(),t=r.length,T(e)}finally{r.length=O.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,g,_,v,y,b=r&&r.__k||h,x=t.length;for(c=te(n,t,b,c,x),d=0;d<x;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&b[p.__i]||m,p.__i=d,v=ae(e,p,f,i,a,o,s,c,l,u),g=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&ue(f.ref,null,p),u.push(p.ref,p.__c||g,p)),_==null&&g!=null&&(_=g),(y=!!(4&p.__u))||f.__k===p.__k?(c=k(p,c,e,y),y&&f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:g&&(c=g.nextSibling),p.__u&=-7);return n.__e=_,c}function te(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=x(null,o,null,null,null):_(o)?o=e.__k[a]=x(S,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=j(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=w(s)),de(s,s));return r}function k(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=k(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=w(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function A(e,t){return t||=[],e==null||typeof e==`boolean`||(_(e)?e.some(function(e){A(e,t)}):t.push(e)),t}function j(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ne(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||g.test(t)?n:n+`px`}function re(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ne(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ne(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(u,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[l]=r[l]:(n[l]=d,e.addEventListener(t,a?p:f,a)):e.removeEventListener(t,a?p:f,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function ie(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[c]==null)n[c]=d++;else if(n[c]<r[l])return;return r(t.event?t.event(n):n)}}}function ae(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,g,b,x,w,T,E,D,O,te,k,A,j=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof j==`function`)try{if(w=n.props,T=j.prototype&&j.prototype.render,E=(d=j.contextType)&&i[d.__c],D=d?E?E.props.value:d.__:i,r.__c?x=(f=n.__c=r.__c).__=f.__E:(T?n.__c=f=new j(w,D):(n.__c=f=new C(w,D),f.constructor=j,f.render=fe),E&&E.sub(f),f.state||={},f.__n=i,p=f.__d=!0,f.__h=[],f._sb=[]),T&&f.__s==null&&(f.__s=f.state),T&&j.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=v({},f.__s)),v(f.__s,j.getDerivedStateFromProps(w,f.__s))),m=f.props,g=f.state,f.__v=n,p)T&&j.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),T&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(T&&j.getDerivedStateFromProps==null&&w!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(w,D),n.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(w,f.__s,D)){n.__v!=r.__v&&(f.props=w,f.state=f.__s,f.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),h.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(w,f.__s,D),T&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,g,b)})}if(f.context=D,f.props=w,f.__P=e,f.__e=!1,O=t.__r,te=0,T)f.state=f.__s,f.__d=!1,O&&O(n),d=f.render(f.props,f.state,f.context),h.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,O&&O(n),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++te<25);f.state=f.__s,f.getChildContext!=null&&(i=v(v({},i),f.getChildContext())),T&&!p&&f.getSnapshotBeforeUpdate!=null&&(b=f.getSnapshotBeforeUpdate(m,g)),k=d!=null&&d.type===S&&d.key==null?ce(d.props.children):d,c=ee(e,_(k)?k:[k],n,r,i,a,o,s,c,l,u),f.base=n.__e,n.__u&=-161,f.__h.length&&s.push(f),x&&(f.__E=f.__=null)}catch(e){if(n.__v=null,l||o!=null)if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,n.__e=c}else{for(A=o.length;A--;)y(o[A]);oe(n)}else n.__e=r.__e,n.__k=r.__k,e.then||oe(n);t.__e(e,n,r)}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=le(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function oe(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(oe))}function se(e,n,r){for(var i=0;i<r.length;i++)ue(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function ce(e){return typeof e!=`object`||!e||e.__b>0?e:_(e)?e.map(ce):e.constructor===void 0?v({},e):null}function le(n,r,i,a,o,s,c,l,u){var d,f,p,h,g,v,b,x=i.props||m,S=r.props,C=r.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!C&&(C?g.localName==C:g.nodeType==3)){n=g,s[d]=null;break}}if(n==null){if(C==null)return document.createTextNode(S);n=document.createElementNS(o,C,S.is&&S),l&&=(t.__m&&t.__m(r,s),!1),s=null}if(C==null)x===S||l&&n.data==S||(n.data=S);else{if(s=C==`textarea`&&S.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(x={},d=0;d<n.attributes.length;d++)x[(g=n.attributes[d]).name]=g.value;for(d in x)g=x[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||re(n,d,null,g,o);for(d in S)g=S[d],d==`children`?h=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?v=g:d==`checked`?b=g:l&&typeof g!=`function`||x[d]===g||re(n,d,g,x[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),ee(r.type==`template`?n.content:n,_(h)?h:[h],r,i,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&w(i,0),l,u),s!=null)for(d=s.length;d--;)y(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&v==null?n.removeAttribute(`value`):v!=null&&(v!==n[d]||C==`progress`&&!v||C==`option`&&v!=x[d])&&re(n,d,v,x[d],o),d=`checked`,b!=null&&b!=n[d]&&re(n,d,b,x[d],o))}return n}function ue(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function de(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||ue(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&de(i[a],n,r||typeof e.type!=`function`);r||y(e.__e),e.__c=e.__=e.__e=void 0}function fe(e,t,n){return this.constructor(e,n)}function pe(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],ae(r,n=(!a&&i||r).__k=b(S,null,[n]),o||m,m,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),se(s,n,c)}e=h.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,C.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=v({},this.state);typeof e==`function`&&(e=e(v({},n),this.props)),e&&v(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),D(this))},C.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),D(this))},C.prototype.render=S,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,s=Math.random().toString(8),c=`__d`+s,l=`__a`+s,u=/(PointerCapture)$|Capture$/i,d=0,f=ie(!1),p=ie(!0);var M,N,me,he,ge=0,_e=[],P=t,ve=P.__b,ye=P.__r,be=P.diffed,xe=P.__c,Se=P.unmount,Ce=P.__;function we(e,t){P.__h&&P.__h(N,e,ge||t),ge=0;var n=N.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function F(e){return ge=1,Te(Pe,e)}function Te(e,t,n){var r=we(M++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Pe(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=N,!N.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a&&a.call(this,e,t,n)||o};N.__f=!0;var a=N.shouldComponentUpdate,o=N.componentWillUpdate;N.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},N.shouldComponentUpdate=i}return r.__N||r.__}function Ee(e,t){var n=we(M++,3);!P.__s&&Ne(n.__H,t)&&(n.__=e,n.u=t,N.__H.__h.push(n))}function De(e){return ge=5,I(function(){return{current:e}},[])}function I(e,t){var n=we(M++,7);return Ne(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Oe(){for(var e;e=_e.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(je),t.__h.some(Me),t.__h=[]}catch(n){t.__h=[],P.__e(n,e.__v)}}}P.__b=function(e){N=null,ve&&ve(e)},P.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ce&&Ce(e,t)},P.__r=function(e){ye&&ye(e),M=0;var t=(N=e.__c).__H;t&&(me===N?(t.__h=[],N.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(je),t.__h.some(Me),t.__h=[],M=0)),me=N},P.diffed=function(e){be&&be(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(_e.push(t)!==1&&he===P.requestAnimationFrame||((he=P.requestAnimationFrame)||Ae)(Oe)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),me=N=null},P.__c=function(e,t){t.some(function(e){try{e.__h.some(je),e.__h=e.__h.filter(function(e){return!e.__||Me(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],P.__e(n,e.__v)}}),xe&&xe(e,t)},P.unmount=function(e){Se&&Se(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{je(e)}catch(e){t=e}}),n.__H=void 0,t&&P.__e(t,n.__v))};var ke=typeof requestAnimationFrame==`function`;function Ae(e){var t,n=function(){clearTimeout(r),ke&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ke&&(t=requestAnimationFrame(n))}function je(e){var t=N,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),N=t}function Me(e){var t=N;e.__c=e.__(),N=t}function Ne(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Pe(e,t){return typeof t==`function`?t(e):t}function Fe(e,t){for(var n in t)e[n]=t[n];return e}function Ie(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function Le(e,t){this.props=e,this.context=t}(Le.prototype=new C).isPureReactComponent=!0,Le.prototype.shouldComponentUpdate=function(e,t){return Ie(this.props,e)||Ie(this.state,t)};var Re=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Re&&Re(e)},typeof Symbol<`u`&&Symbol.for;var ze=t.__e;t.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}ze(e,t,n,r)};var Be=t.unmount;function Ve(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=Fe({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Ve(e,t,n)})),e}function He(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return He(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ue(){this.__u=0,this.o=null,this.__b=null}function We(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Ge(){this.i=null,this.l=null}t.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Be&&Be(e)},(Ue.prototype=new C).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=We(r.__v),a=!1,o=function(){a||r.__z||(a=!0,n.__R=null,i?i(c):c())};n.__R=o;var s=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=He(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},Ue.prototype.componentWillUnmount=function(){this.o=[]},Ue.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=Ve(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&b(S,null,e.fallback);return i&&(i.__u&=-33),[b(S,null,t.__a?null:e.children),i]};var Ke=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Ge.prototype=new C).__a=function(e){var t=this,n=We(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),Ke(t,e,r)):i()};n?n(a):a()}},Ge.prototype.render=function(e){this.i=null,this.l=new Map;var t=A(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ge.prototype.componentDidUpdate=Ge.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Ke(e,n,t)})};var qe=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,Je=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ye=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xe=/[A-Z0-9]/g,Ze=typeof document<`u`,Qe=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};function $e(e,t,n){return t.__k??(t.textContent=``),pe(e,t),typeof n==`function`&&n(),e?e.__c:null}C.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(C.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var et=t.event;t.event=function(e){return et&&(e=et(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var tt={configurable:!0,get:function(){return this.class}},nt=t.vnode;t.vnode=function(e){typeof e.type==`string`&&function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)==-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||Ze&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){var s=a.toLowerCase();a===`defaultValue`&&`value`in t&&t.value==null?a=`value`:a===`download`&&!0===o?o=``:s===`translate`&&o===`no`?o=!1:s[0]===`o`&&s[1]===`n`?s===`ondoubleclick`?a=`ondblclick`:s!==`onchange`||n!==`input`&&n!==`textarea`||Qe(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:Ye.test(a)&&(a=s):s=a=`oninput`:i&&Je.test(a)?a=a.replace(Xe,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&(r.multiple&&Array.isArray(r.value)&&(r.value=A(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=A(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,`className`,tt)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=qe,nt&&nt(e)};var rt=t.__r;t.__r=function(e){rt&&rt(e),e.__c};var it=t.diffed;t.diffed=function(e){it&&it(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value)};function at(e){return!!e.__k&&(pe(null,e),!0)}function ot(e){return{render:function(t){$e(t,e)},unmount:function(){at(e)}}}var L=new Map,st=1,ct=new Set;typeof window<`u`&&window.addEventListener(`message`,e=>{let t=e.data;if(!t||typeof t!=`object`||t.jsonrpc!==`2.0`)return;let n=t;if(n.id!=null&&L.has(n.id)){let e=L.get(n.id);L.delete(n.id),n.error?e.reject(n.error):e.resolve(n.result);return}if(n.method){let e={jsonrpc:`2.0`,method:n.method,params:n.params};ct.forEach(t=>{try{t(e)}catch{}})}});function lt(e,t,n=3e4){if(typeof window>`u`||!window.parent)return Promise.reject(Error(`no host`));let r=st++;return new Promise((i,a)=>{let o=setTimeout(()=>{L.has(r)&&(L.delete(r),a(Error(`callHost timeout: ${e}`)))},n);L.set(r,{resolve:e=>{clearTimeout(o),i(e)},reject:e=>{clearTimeout(o),a(e)}}),window.parent.postMessage({jsonrpc:`2.0`,id:r,method:e,params:t},`*`)})}function ut(e,t){typeof window>`u`||!window.parent||window.parent.postMessage({jsonrpc:`2.0`,method:e,params:t},`*`)}var dt=`https://app.zenskar.com`;function ft(e){let t=`${dt}${e.startsWith(`/`)?e:`/${e}`}`;lt(`ui/open-link`,{url:t}).catch(()=>{try{window.open(t,`_blank`,`noopener,noreferrer`)}catch{ut(`ui/message`,{text:`Open: ${t}`})}})}function pt(e,t){let n=n=>{n.method===e&&t(n.params)};return ct.add(n),()=>ct.delete(n)}var mt=0;Array.isArray;function R(e,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mt,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}function z({children:e}){return R(`span`,{className:`text-muted-foreground`,children:e})}var ht=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function gt(e){if(!e)return null;let t=e.replace(` `,`T`);/^\d{4}-\d{2}-\d{2}$/.test(t)?t+=`T00:00:00Z`:/[zZ]|[+-]\d{2}:?\d{2}$/.test(t)||(t+=`Z`);let n=new Date(t);return Number.isNaN(n.getTime())?null:n}function _t(e){return e<10?`0`+e:String(e)}function B(e){let t=gt(e);return t?`${ht[t.getUTCMonth()]} ${_t(t.getUTCDate())}, ${t.getUTCFullYear()}`:R(z,{children:`—`})}function V(e){let t=gt(e);if(!t)return R(z,{children:`—`});let n=t.getUTCHours(),r=n>=12?`PM`:`AM`,i=n%12||12;return`${ht[t.getUTCMonth()]} ${_t(t.getUTCDate())}, ${t.getUTCFullYear()} ${_t(i)}:${_t(t.getUTCMinutes())} ${r}`}function vt(e,t=new Date){let n=gt(e);return n?Math.floor((t.getTime()-n.getTime())/864e5):null}function H(e,t=`USD`){if(e==null||!Number.isFinite(e))return R(z,{children:`—`});let n=e/100;try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t,maximumFractionDigits:2}).format(n)}catch{return`${t} ${n.toLocaleString()}`}}function yt(e){return e?e.display?e.display:e.value==null?R(z,{children:`—`}):H(e.value,e.unit||`USD`):R(z,{children:`—`})}function U(e,t=8){return e?e.length<=t?e:e.slice(0,t)+`…`:R(z,{children:`—`})}var bt=`bg-secondary/20 text-secondary ring-1 ring-secondary/30`,xt=`bg-primary/20 text-primary ring-1 ring-primary/30`,St=`bg-destructive/20 text-destructive ring-1 ring-destructive/30`,W=`bg-muted text-muted-foreground ring-1 ring-border`,Ct=`bg-accent text-accent-foreground ring-1 ring-border`,wt=`bg-secondary/12 text-secondary ring-1 ring-secondary/20`,Tt={paid:bt,approved:bt,active:bt,success:bt,posted:bt,upcoming:xt,partially_paid:xt,in_progress:xt,paused:xt,failed:St,disputed:St,draft:W,void:W,voided:W,expired:W,archived:W,issued:wt,scheduled:wt,refunded:Ct},Et=W;function G({status:e}){if(!e)return R(z,{children:`—`});let t=Tt[e.toLowerCase()]||Et,n=Dt(e);return R(`span`,{className:`inline-block whitespace-nowrap rounded-md px-2 py-0.5 text-xs ${t}`,children:n})}function Dt(e){let t=e.replace(/_/g,` `);return t.charAt(0).toUpperCase()+t.slice(1)}function Ot({payload:e}){let t=e.addresses||[];return R(`div`,{className:`space-y-3`,children:[R(`header`,{className:`flex items-baseline justify-between gap-3`,children:R(`h2`,{className:`m-0 text-lg font-semibold`,children:[`Addresses`,` `,R(`span`,{className:`text-muted-foreground text-sm font-normal`,children:[`(`,t.length,`)`]}),e.customer_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:[` `,`· `,e.customer_id]}):null]})}),t.length===0?R(`div`,{className:`text-muted-foreground border-border rounded-md border py-8 text-center`,children:`No addresses on file.`}):R(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:t.map((e,t)=>R(kt,{addr:e},e.id||t))})]})}function kt({addr:e}){return R(`article`,{className:`space-y-1 rounded-md border p-3 ${e.is_primary?`border-ring ring-ring ring-1`:`border-border`}`,children:[R(`header`,{className:`flex items-baseline justify-between gap-2`,children:[R(`div`,{className:`text-sm font-medium`,children:e.label||R(z,{children:`Untitled`})}),e.is_primary?R(`span`,{className:`bg-secondary/20 text-secondary ring-secondary/30 rounded-full px-2 py-0.5 text-xs ring-1`,children:`primary`}):null]}),R(`div`,{className:`text-sm`,children:[e.line1?R(`div`,{children:e.line1}):null,e.line2?R(`div`,{children:e.line2}):null,e.line3?R(`div`,{children:e.line3}):null,R(`div`,{children:[e.city,e.state,e.zip_code].filter(Boolean).join(`, `)||R(z,{children:`—`})}),e.country?R(`div`,{className:`text-muted-foreground mt-0.5 text-xs uppercase`,children:e.country}):null,e.validation_status?R(`span`,{className:`mt-1 inline-block rounded-full px-2 py-0.5 text-[10px] ring-1 ${e.validation_status===`valid`?`bg-secondary/20 text-secondary ring-secondary/30`:`bg-muted text-muted-foreground ring-border`}`,children:e.validation_status}):null]})]})}function K({title:e,count:t,scope:n,rightHint:r,columns:i,rows:a,sortKey:o,sortDir:s,onSort:c,emptyMessage:l=`Nothing to show.`,showIndex:u=!0,rowKey:d,rowClassName:f,hoverRows:p=!0}){let m=i.length+ +!!u,h=r===void 0&&c?`click headers to sort`:r;return R(`div`,{className:`space-y-3`,children:[R(`header`,{className:`flex items-baseline justify-between gap-3`,children:[R(`h2`,{className:`m-0 text-lg font-semibold`,children:[e,t==null?null:R(`span`,{className:`text-muted-foreground text-sm font-normal`,children:[` `,`(`,t.toLocaleString(),`)`]}),n?R(`span`,{className:`text-muted-foreground text-sm font-normal`,children:[` `,`· `,n]}):null]}),h==null?null:R(`span`,{className:`text-muted-foreground text-xs`,children:h})]}),R(`div`,{className:`border-border overflow-auto rounded-md border`,children:R(`table`,{className:`w-full text-sm`,children:[R(`thead`,{className:`bg-muted text-muted-foreground border-b-2 border-border text-xs tracking-wide uppercase`,children:R(`tr`,{children:[u?R(At,{children:`#`}):null,i.map(e=>R(At,{align:e.align,sortable:e.sortable,active:e.sortable&&o===e.key,dir:s,onClick:e.sortable&&c?()=>c(e.key):void 0,children:e.header},e.key))]})}),R(`tbody`,{children:a.length===0?R(`tr`,{children:R(`td`,{colSpan:m,className:`text-muted-foreground py-8 text-center`,children:l})}):a.map((e,t)=>R(`tr`,{className:`border-border border-t ${p?`hover:bg-muted/60`:``} ${f?f(e,t):``}`.trim().replace(/\s+/g,` `),children:[u?R(`td`,{className:`text-muted-foreground px-3 py-2 tabular-nums`,children:t+1}):null,i.map(n=>R(`td`,{className:`px-3 py-2 ${n.align===`right`?`text-right tabular-nums`:``} ${n.className??``}`.trim(),children:n.render(e,t)},n.key))]},d?d(e,t):t))})]})})]})}function At({children:e,sortable:t,active:n,dir:r,onClick:i,align:a=`left`}){return R(`th`,{className:[`px-3 py-2 font-semibold`,a===`right`?`text-right`:`text-left`,t?`cursor-pointer select-none hover:text-foreground`:``,n?`text-foreground`:``].filter(Boolean).join(` `),onClick:i,children:[e,t&&n?r===`asc`?` ↑`:` ↓`:null]})}function q({href:e,label:t=`View`}){return R(`button`,{type:`button`,className:`text-secondary hover:text-secondary/80 text-xs underline`,onClick:()=>ft(e),children:t})}function J(e,t,n){let r=n===`asc`?1:-1;return[...e].sort((e,n)=>{let i=t(e),a=t(n);return i==null&&a==null?0:i==null?1:a==null?-1:i<a?-1*r:i>a?1*r:0})}function jt({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.aggregates,e=>t===`name`?e.name:e.created_at,r),[e.aggregates,t,r]);return R(K,{title:`Aggregates`,count:e.total,scope:e.scope,rightHint:`aka billable metrics`,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/meters/${e.id}/edit`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No aggregates match.`,rowKey:(e,t)=>e.id||t})}function Mt({payload:e}){let[t,n]=F(`name`),[r,i]=F(`asc`),a=I(()=>J(e.contacts,e=>t===`name`?e.name:e.email,r),[e.contacts,t,r]);return R(K,{title:`Contacts`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`email`,header:`Email`,sortable:!0,className:`text-secondary`,render:e=>e.email||R(z,{children:`—`})},{key:`customer`,header:`Customer`,className:`text-secondary font-mono text-xs`,render:e=>U(e.customer_id,10)},{key:`send_invoice`,header:`Send Invoice`,className:`text-xs`,render:e=>e.send_invoice==null?R(z,{children:`—`}):e.send_invoice?`yes`:`no`},{key:`send_contract`,header:`Send Contract`,className:`text-xs`,render:e=>e.send_contract==null?R(z,{children:`—`}):e.send_contract?`yes`:`no`},{key:`view`,header:`View`,render:e=>R(q,{href:`/contacts/${e.id}/edit`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`asc`))},emptyMessage:`No contacts match.`,rightHint:null,rowKey:(e,t)=>e.id||t})}var Nt=`text-muted-foreground text-[11px] tracking-wide uppercase`;function Y({label:e,value:t,tone:n}){return R(`div`,{children:[R(`div`,{className:Nt,children:e}),R(`div`,{className:n===`warn`?`text-2xl font-bold tabular-nums text-destructive`:`text-2xl font-bold tabular-nums`,children:t})]})}function X({title:e,children:t}){return R(`section`,{className:`space-y-1`,children:[R(`div`,{className:Nt,children:e}),t]})}function Z({label:e,children:t}){return R(`div`,{children:[R(`div`,{className:Nt,children:e}),R(`div`,{className:`text-sm`,children:t})]})}function Pt({payload:e}){let t=e.contract,n=e.phases||[],r=new Date;return R(`div`,{className:`space-y-4`,children:[R(`header`,{className:`flex items-start justify-between gap-3`,children:[R(`div`,{children:[R(`h2`,{className:`m-0 flex min-w-0 items-center gap-2 text-lg font-semibold`,children:[R(`span`,{className:`min-w-0 truncate`,children:t.name||R(z,{children:`—`})}),t.status?R(G,{status:t.status}):null]}),R(`div`,{className:`text-secondary mt-0.5 font-mono text-xs`,children:t.id})]}),R(`div`,{className:`flex gap-2`,children:t.contract_link?R(`a`,{href:t.contract_link,target:`_blank`,rel:`noreferrer`,className:`border-border bg-accent text-accent-foreground hover:bg-primary hover:text-primary-foreground rounded border px-3 py-1 text-xs transition-colors`,children:`Open`}):null})]}),R(`div`,{className:`border-border grid grid-cols-1 gap-3 rounded-md border p-3 sm:grid-cols-2`,children:[R(Z,{label:`Customer`,children:t.customer_name?R(`div`,{children:[R(`div`,{className:`truncate text-sm`,children:t.customer_name}),t.customer_id?R(`div`,{className:`text-muted-foreground font-mono text-xs break-all`,children:t.customer_id}):null]}):t.customer_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.customer_id}):R(z,{children:`—`})}),R(Z,{label:`Currency`,children:t.currency?R(`span`,{className:`font-mono text-xs`,children:t.currency}):R(z,{children:`—`})}),R(Z,{label:`Type`,children:t.contract_type||R(z,{children:`—`})}),R(Z,{label:`Term`,children:t.start_date&&t.end_date?R(`span`,{className:`text-sm`,children:[t.start_date.slice(0,10),` → `,t.end_date.slice(0,10)]}):R(z,{children:`—`})}),R(Z,{label:`Anchor Date`,children:B(t.anchor_date)}),R(Z,{label:`Renewal Policy`,children:t.renewal_policy||R(z,{children:`—`})}),R(Z,{label:`Plan`,children:t.plan_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.plan_id}):R(z,{children:`—`})}),R(Z,{label:`Created`,children:B(t.created_at)})]}),t.description?R(X,{title:`Description`,children:R(`div`,{className:`text-sm`,children:t.description})}):null,t.tags&&t.tags.length>0?R(X,{title:`Tags`,children:R(`div`,{className:`flex flex-wrap gap-2`,children:t.tags.map((e,t)=>R(`span`,{className:`bg-muted text-muted-foreground rounded-full px-2 py-0.5 text-xs`,children:e},t))})}):null,n.length>0?R(X,{title:`Phases (${n.length})`,children:R(`div`,{className:`space-y-2`,children:n.map((e,t)=>R(Ft,{phase:e,index:t,today:r},e.id||t))})}):null,t.custom_attributes&&Object.keys(t.custom_attributes).length>0?R(X,{title:`Custom Attributes`,children:R(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:Object.entries(t.custom_attributes).map(([e,t])=>R(`div`,{className:`border-border rounded border px-2 py-1`,children:[R(`div`,{className:`text-muted-foreground`,children:e}),R(`div`,{className:`line-clamp-2 break-all font-mono`,children:typeof t==`object`?JSON.stringify(t):String(t??``)})]},e))})}):null]})}function Ft({phase:e,index:t,today:n}){let r=e.start_date?new Date(e.start_date):null,i=e.end_date?new Date(e.end_date):null,a=r&&i&&r<=n&&n<=i,o=a?`ring-2 ring-ring`:``,s=e.pricings||[];return R(`div`,{className:`border-border rounded-md border p-3 ${o}`,children:[R(`div`,{className:`flex items-baseline justify-between gap-2`,children:[R(`div`,{className:`min-w-0 text-sm font-medium`,children:[R(`span`,{className:`text-muted-foreground mr-2`,children:[`#`,t+1]}),R(`span`,{className:`wrap-break-word`,children:e.name||R(z,{children:`Untitled phase`})}),a?R(`span`,{className:`bg-secondary/20 text-secondary ring-secondary/30 ml-2 rounded-full px-2 py-0.5 text-xs ring-1`,children:`current`}):null]}),R(`div`,{className:`text-muted-foreground text-xs whitespace-nowrap`,children:[e.start_date?e.start_date.slice(0,10):`—`,` →`,` `,e.end_date?e.end_date.slice(0,10):`—`]})]}),s.length>0?R(`div`,{className:`mt-2 space-y-2`,children:s.map((e,t)=>R(Lt,{p:e},e.id||t))}):R(`div`,{className:`mt-1 grid grid-cols-2 gap-2 text-xs sm:grid-cols-3`,children:[R(`div`,{children:[R(`span`,{className:`text-muted-foreground`,children:`Products:`}),` `,R(`span`,{className:`tabular-nums`,children:e.product_count??`—`})]}),e.pricing_summary?R(`div`,{className:`text-muted-foreground col-span-full sm:col-span-2`,children:e.pricing_summary}):null]})]})}function It(e){let t=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!t)return e;let n=Number(t[1]||0),r=Number(t[2]||0),i=Number(t[3]||0),a=Number(t[4]||0),o=[];return n&&o.push(`${n} year${n>1?`s`:``}`),r&&o.push(`${r} month${r>1?`s`:``}`),i&&o.push(`${i} week${i>1?`s`:``}`),a&&o.push(`${a} day${a>1?`s`:``}`),o.join(` `)||e}function Q(e,t){if(Array.isArray(e)||e==null||!Number.isFinite(e))return`—`;try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t||`USD`,maximumFractionDigits:2}).format(e)}catch{return`${t||`USD`} ${e}`}}function Lt({p:e}){e.currency;let t=e.features&&e.features.length>0;return R(`div`,{className:`border-border rounded-md border bg-card px-3 py-2.5`,children:R(`div`,{className:`flex w-full flex-col gap-2.5`,children:[R(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:R(`div`,{className:`flex min-w-0 items-center gap-2`,children:[R(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:e.product_name||R(z,{children:`Unnamed product`})}),e.product_type?R(`span`,{className:`bg-accent text-accent-foreground rounded px-1.5 py-0.5 text-xs font-medium uppercase`,children:e.product_type}):null]})}),e.description?R(`div`,{className:`text-muted-foreground line-clamp-3 text-xs leading-relaxed`,children:e.description}):null,R(`hr`,{className:`border-border m-0`}),R(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2.5`,children:[R(zt,{p:e}),e.pricing_model===`flat_fee`?null:R($,{label:e.quantity_type===`metered`?`Billable Metric${e.quantity_unit?` (${e.quantity_unit})`:``}`:`Quantity`,children:e.quantity_type===`fixed`&&e.quantity_value!=null?R(`span`,{children:[e.quantity_value,e.quantity_unit?` ${e.quantity_unit}`:``]}):e.quantity_type===`metered`?R(`span`,{className:`truncate`,children:e.meter_name||R(z,{children:`No metric`})}):R(z,{children:`—`})}),e.billing_cadence?R($,{label:`Billing Cadence (${e.is_recurring?`Recurring`:`One Time`})`,children:[e.billing_timing?`${e.billing_timing} - `:``,`Every`,` `,It(e.billing_cadence)]}):null,e.start_date?R($,{label:`Product Period`,children:[e.start_date.slice(0,10),` →`,` `,e.end_date?e.end_date.slice(0,10):`Forever`]}):null]}),t?R(Ht,{features:e.features}):null]})})}function $({label:e,children:t}){return R(`div`,{className:`min-w-0`,children:[R(`div`,{className:`text-muted-foreground text-xs font-medium`,children:e}),R(`div`,{className:`text-xs`,children:t})]})}function Rt(e){return e?e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase()):`Unknown`}function zt({p:e}){let t=e.currency,n=t?` (${t})`:``;switch(e.pricing_model){case`flat_fee`:return R($,{label:`Flat Fee${n}`,children:R(`span`,{className:`font-semibold tabular-nums`,children:Q(e.unit_amount,t)})});case`per_unit`:case`per_unit_pricing`:return R($,{label:`Per Unit Price${n}`,children:R(`span`,{className:`font-semibold tabular-nums`,children:Q(e.unit_amount,t)})});case`percent`:case`percent_pricing`:return R($,{label:`Percent Pricing${n}`,children:R(`span`,{className:`font-semibold tabular-nums`,children:e.unit_amount==null?`—`:`${e.unit_amount}%`})});case`package`:case`package_pricing`:return R(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2.5`,children:[R($,{label:`Package Price${n}`,children:R(`span`,{className:`font-semibold tabular-nums`,children:Q(e.unit_amount,t)})}),e.package_size?R($,{label:`Package Size`,children:R(`span`,{children:e.package_size})}):null]});case`volume`:case`volume_pricing`:case`tiered`:case`tiered_pricing`:case`step`:case`step_pricing`:return R(`div`,{className:`w-full`,children:[R(`div`,{className:`text-muted-foreground mb-1 text-xs font-medium`,children:[Rt(e.pricing_model),` Price`,n]}),R(Bt,{tiers:e.tiers,currency:t})]});case`volume_with_flat_fee`:case`tiered_with_flat_fee`:return R(`div`,{className:`w-full`,children:[R(`div`,{className:`text-muted-foreground mb-1 text-xs font-medium`,children:[Rt(e.pricing_model),` Price`,n]}),R(Bt,{tiers:e.tiers,currency:t,showFlatFee:!0})]});case`matrix`:case`matrix_pricing`:return R(`div`,{className:`w-full`,children:[R(`div`,{className:`text-muted-foreground mb-1 text-xs font-medium`,children:[`Matrix Pricing`,n]}),R(Vt,{matrix:e.matrix,currency:t}),e.unit_amount==null?null:R(`div`,{className:`text-muted-foreground mt-1.5 text-xs`,children:[`Default price:`,` `,R(`span`,{className:`font-semibold`,children:Q(e.unit_amount,t)})]})]});case`custom`:case`custom_pricing`:return R($,{label:`Custom Pricing`,children:R(`span`,{className:`text-muted-foreground`,children:`Custom script`})});default:return e.unit_amount==null?R(z,{children:`—`}):R($,{label:`Price${n}`,children:R(`span`,{className:`font-semibold tabular-nums`,children:Q(e.unit_amount,t)})})}}function Bt({tiers:e,currency:t,showFlatFee:n}){return!e||e.length===0?R(`span`,{className:`text-muted-foreground text-xs`,children:`No tiers`}):R(`div`,{className:`max-h-48 overflow-auto`,children:R(`table`,{className:`w-full text-xs`,children:[R(`caption`,{className:`sr-only`,children:`Pricing tiers`}),R(`thead`,{children:R(`tr`,{className:`text-muted-foreground border-border border-b text-left`,children:[R(`th`,{scope:`col`,className:`py-0.5 pr-2 font-medium`,children:`Min`}),R(`th`,{scope:`col`,className:`py-0.5 pr-2 font-medium`,children:`Max`}),R(`th`,{scope:`col`,className:`py-0.5 pr-2 text-right font-medium`,children:`Unit Price`}),n?R(`th`,{scope:`col`,className:`py-0.5 text-right font-medium`,children:`Flat Fee`}):null]})}),R(`tbody`,{children:e.map((e,r)=>R(`tr`,{className:`border-border/50 border-b last:border-0`,children:[R(`td`,{className:`py-0.5 pr-2 tabular-nums`,children:e.min_quantity??0}),R(`td`,{className:`py-0.5 pr-2 tabular-nums`,children:e.max_quantity??`∞`}),R(`td`,{className:`py-0.5 pr-2 text-right tabular-nums`,children:Q(e.unit_amount,t)}),n?R(`td`,{className:`py-0.5 text-right tabular-nums`,children:e.flat_fee==null?`—`:Q(e.flat_fee,t)}):null]},r))})]})})}function Vt({matrix:e,currency:t}){return!e||e.length===0?R(`span`,{className:`text-muted-foreground text-xs`,children:`Matrix pricing (no data)`}):R(`div`,{className:`max-h-48 overflow-auto`,children:R(`table`,{className:`w-full text-xs`,children:[R(`caption`,{className:`sr-only`,children:`Matrix pricing dimensions`}),R(`thead`,{children:R(`tr`,{className:`text-muted-foreground border-border border-b text-left`,children:[R(`th`,{scope:`col`,className:`py-0.5 pr-2 font-medium`,children:`Dimension`}),R(`th`,{scope:`col`,className:`py-0.5 pr-2 font-medium`,children:`Alias`}),R(`th`,{scope:`col`,className:`py-0.5 text-right font-medium`,children:`Price`})]})}),R(`tbody`,{children:e.map((e,n)=>R(`tr`,{className:`border-border/50 border-b last:border-0`,children:[R(`td`,{className:`py-0.5 pr-2`,children:e.dimension??`—`}),R(`td`,{className:`py-0.5 pr-2`,children:e.display_alias??`—`}),R(`td`,{className:`py-0.5 text-right tabular-nums`,children:Q(e.price,t)})]},n))})]})})}function Ht({features:e}){let t=new Map;for(let n of e){let e=t.get(n.type)||[];e.push(n),t.set(n.type,e)}return R(`div`,{className:`mt-1 space-y-2`,children:[R(`div`,{className:`text-muted-foreground text-xs font-medium uppercase`,children:`Features`}),Array.from(t.entries()).map(([e,t])=>R(`div`,{className:`flex flex-wrap items-start gap-2`,children:[R(`span`,{className:`bg-muted text-muted-foreground shrink-0 rounded px-1.5 py-0.5 text-xs`,children:e}),R(`div`,{className:`flex flex-col gap-0.5`,children:t.map((e,t)=>R(`div`,{className:`text-muted-foreground break-words text-xs`,children:[e.label?R(`span`,{className:`mr-2 font-medium`,children:e.label}):null,e.summary]},t))})]},e))]})}function Ut({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.contracts,e=>{switch(t){case`name`:return e.name;case`start_date`:return e.start_date;case`end_date`:return e.end_date;case`created_at`:return e.created_at??null}},r),[e.contracts,t,r]);return R(K,{title:`Contracts`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`customer`,header:`Customer`,className:`text-xs`,render:e=>e.customer_name?e.customer_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.customer_id,10)})},{key:`status`,header:`Status`,render:e=>R(G,{status:e.status})},{key:`currency`,header:`Currency`,className:`font-mono text-xs`,render:e=>e.currency||R(z,{children:`—`})},{key:`start_date`,header:`Start`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.start_date)},{key:`end_date`,header:`End`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.end_date)},{key:`days_left`,header:`Days Left`,align:`right`,render:e=>{let t=e.end_date?-1*(vt(e.end_date)??0):null;if(t==null)return R(z,{children:`—`});let n=t<0;return R(`span`,{className:n?`text-destructive font-medium`:!n&&t<=30?`text-primary font-medium`:`text-muted-foreground`,children:n?`${Math.abs(t)}d ago`:`${t}d`})}},{key:`view`,header:`View`,render:e=>R(q,{href:`/contractsv2/${e.id}/edit`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No contracts match.`,rowKey:(e,t)=>e.id||t})}function Wt({payload:e}){let t=e.credit_note,n=t.currency||`USD`;return R(`div`,{className:`space-y-4`,children:[R(`header`,{className:`flex items-start justify-between gap-3`,children:R(`div`,{children:[R(`h2`,{className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[R(`span`,{className:`font-mono`,children:t.credit_note_number||t.id}),t.status?R(G,{status:t.status}):null]}),R(`div`,{className:`text-secondary mt-0.5 font-mono text-xs`,children:t.id})]})}),R(`div`,{className:`border-border grid grid-cols-2 gap-3 rounded-md border p-3 sm:grid-cols-4`,children:[R(Y,{label:`Amount`,value:t.amount==null?R(z,{children:`—`}):H(t.amount,n)}),R(Y,{label:`Currency`,value:n}),R(Y,{label:`Credits Returned`,value:t.credits_returned==null?R(z,{children:`—`}):t.credits_returned.toLocaleString()}),R(Y,{label:`Created`,value:B(t.created_at)})]}),R(`div`,{className:`border-border grid grid-cols-1 gap-3 rounded-md border p-3 sm:grid-cols-2`,children:[R(Z,{label:`Customer`,children:t.customer_name?R(`div`,{children:[R(`div`,{className:`text-sm`,children:t.customer_name}),t.customer_id?R(`div`,{className:`text-muted-foreground font-mono text-[11px] break-all`,children:t.customer_id}):null]}):t.customer_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.customer_id}):R(z,{children:`—`})}),R(Z,{label:`Invoice`,children:t.invoice_number?R(`div`,{children:[R(`div`,{className:`font-mono text-sm`,children:t.invoice_number}),t.invoice_id?R(`div`,{className:`text-muted-foreground font-mono text-[11px] break-all`,children:t.invoice_id}):null]}):t.invoice_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.invoice_id}):R(z,{children:`—`})}),R(Z,{label:`Repayment Method`,children:t.repayment_method||R(z,{children:`—`})})]}),t.custom_data&&Object.keys(t.custom_data).length>0?R(X,{title:`Custom Data`,children:R(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:Object.entries(t.custom_data).map(([e,t])=>R(`div`,{className:`border-border rounded border px-2 py-1`,children:[R(`div`,{className:`text-muted-foreground`,children:e}),R(`div`,{className:`font-mono`,children:typeof t==`object`?JSON.stringify(t):String(t??``)})]},e))})}):null]})}function Gt({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=e.default_currency||`USD`,o=I(()=>J(e.credit_notes,e=>{switch(t){case`amount`:return e.amount;case`created_at`:return e.created_at;case`status`:return e.status}},r),[e.credit_notes,t,r]);return R(K,{title:`Credit Notes`,count:e.total,scope:e.scope,columns:[{key:`number`,header:`Number`,className:`font-mono text-xs`,render:e=>e.credit_note_number||R(z,{children:`—`})},{key:`customer`,header:`Customer`,className:`text-xs`,render:e=>e.customer_name?e.customer_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.customer_id,10)})},{key:`invoice`,header:`Invoice`,className:`text-xs`,render:e=>e.invoice_name?e.invoice_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.invoice_id,10)})},{key:`status`,header:`Status`,sortable:!0,render:e=>R(G,{status:e.status})},{key:`amount`,header:`Amount`,sortable:!0,align:`right`,className:`text-destructive`,render:e=>H(e.amount,e.currency||a)},{key:`repayment`,header:`Repayment`,className:`text-xs`,render:e=>e.repayment_method||R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)}],rows:o,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`desc`))},emptyMessage:`No credit notes match.`,rowKey:(e,t)=>e.id||t,hoverRows:!1})}function Kt({payload:e}){let t=e.customer,n=t.address||{},r=[n.line1,n.line2,n.city,n.state,n.zipCode||n.zip_code,n.country].filter(Boolean).join(`, `),i=t.ship_to_address||{},a=[i.line1,i.line2,i.city,i.state,i.zipCode||i.zip_code,i.country].filter(Boolean).join(`, `);return R(`div`,{className:`space-y-4`,children:[R(`header`,{className:`flex items-start justify-between gap-3`,children:R(`div`,{children:[R(`h2`,{className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:t.name||R(z,{children:`—`})}),R(`div`,{className:`text-secondary mt-0.5 font-mono text-xs`,children:t.id})]})}),R(qt,{children:[R(Z,{label:`External ID`,children:t.external_id?R(`span`,{className:`font-mono text-xs`,children:t.external_id}):R(z,{children:`—`})}),R(Z,{label:`Email`,children:t.email||R(z,{children:`—`})}),R(Z,{label:`Phone`,children:t.phone||R(z,{children:`—`})}),R(Z,{label:`Business Entity`,children:t.business_entity_name?R(`div`,{children:[R(`div`,{children:t.business_entity_name}),t.business_entity_id?R(`div`,{className:`text-muted-foreground font-mono text-[11px] break-all`,children:t.business_entity_id}):null]}):t.business_entity_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.business_entity_id}):R(z,{children:`—`})}),R(Z,{label:`Created`,children:B(t.created_at)}),R(Z,{label:`Updated`,children:B(t.updated_at)})]}),r?R(X,{title:`Primary Address`,children:R(`div`,{className:`text-sm`,children:r})}):null,a&&a!==r?R(X,{title:`Ship-to Address`,children:R(`div`,{className:`text-sm`,children:a})}):null,t.communications_enabled!=null||t.auto_charge_enabled!=null?R(X,{title:`Settings`,children:R(`div`,{className:`flex flex-wrap gap-3 text-sm`,children:[R(Jt,{label:`Communications`,on:t.communications_enabled??null}),R(Jt,{label:`Auto-charge`,on:t.auto_charge_enabled??null})]})}):null,t.default_payment_method?R(X,{title:`Payment Method`,children:R(`div`,{className:`flex items-center gap-2 text-sm`,children:[R(`span`,{className:`bg-muted rounded px-2 py-0.5 text-xs`,children:(t.default_payment_method.type||`unknown`).replace(/_/g,` `)}),t.default_payment_method.brand?R(`span`,{children:t.default_payment_method.brand}):null,t.default_payment_method.last4?R(`span`,{className:`font-mono`,children:[`•••• `,t.default_payment_method.last4]}):null,t.default_payment_method.connector_name?R(`span`,{className:`text-muted-foreground text-xs`,children:[`via `,t.default_payment_method.connector_name]}):null]})}):null,t.tax_info&&t.tax_info.length>0?R(X,{title:`Tax Info`,children:R(`div`,{className:`space-y-1`,children:t.tax_info.map((e,t)=>R(`div`,{className:`flex gap-3 text-sm`,children:[e.tax_code?R(`span`,{className:`bg-muted rounded px-2 py-0.5 text-xs`,children:e.tax_code}):null,e.tax_id?R(`span`,{className:`font-mono text-xs`,children:e.tax_id}):null,e.country_code?R(`span`,{className:`text-muted-foreground text-xs`,children:e.country_code}):null]},t))})}):null,t.contacts&&t.contacts.length>0?R(X,{title:`Contacts (${t.contacts.length})`,children:R(`div`,{className:`space-y-2`,children:t.contacts.map((e,t)=>R(`div`,{className:`border-border flex items-center justify-between rounded border px-3 py-2`,children:[R(`div`,{children:[R(`div`,{className:`text-sm font-medium`,children:e.name||R(z,{children:`—`})}),e.email?R(`div`,{className:`text-muted-foreground text-xs`,children:e.email}):null]}),R(`div`,{className:`flex gap-2`,children:[e.send_invoice?R(`span`,{className:`bg-secondary/20 text-secondary ring-secondary/30 rounded-full px-2 py-0.5 text-xs ring-1`,children:`invoice`}):null,e.send_contract?R(`span`,{className:`bg-secondary/20 text-secondary ring-secondary/30 rounded-full px-2 py-0.5 text-xs ring-1`,children:`contract`}):null]})]},t))})}):null,t.custom_data&&Object.keys(t.custom_data).length>0?R(X,{title:`Custom Data`,children:R(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:Object.entries(t.custom_data).map(([e,t])=>R(`div`,{className:`border-border rounded border px-2 py-1`,children:[R(`div`,{className:`text-muted-foreground`,children:e}),R(`div`,{className:`font-mono`,children:typeof t==`object`?JSON.stringify(t):String(t??``)})]},e))})}):null]})}function qt({children:e}){return R(`div`,{className:`border-border grid grid-cols-1 gap-3 rounded-md border p-3 sm:grid-cols-2`,children:e})}function Jt({label:e,on:t}){return t===null?null:R(`span`,{className:`rounded-full px-2 py-0.5 text-xs ${t?`bg-secondary/20 text-secondary ring-1 ring-secondary/30`:`bg-muted text-muted-foreground ring-1 ring-border`}`,children:[e,`: `,t?`on`:`off`]})}function Yt({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.customers,e=>t===`name`?e.name:e.created_at??null,r),[e.customers,t,r]);return R(K,{title:`Customers`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`external_id`,header:`External ID`,className:`font-mono text-xs`,render:e=>e.external_id||R(z,{children:`—`})},{key:`email`,header:`Email`,className:`text-secondary`,render:e=>e.email||R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/customers/${e.id}/view`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No customers match.`,rowKey:(e,t)=>e.id||t})}function Xt({payload:e}){return R(K,{title:`Entitlements`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Entitlement`,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`entitlement_type`,header:`Type`,className:`text-xs`,render:e=>e.entitlement_type||R(z,{children:`—`})},{key:`units`,header:`Units`,className:`font-mono text-xs`,render:e=>e.units||R(z,{children:`—`})},{key:`product_name`,header:`Product`,className:`text-xs`,render:e=>e.product_name||R(z,{children:`—`})},{key:`is_active`,header:`Status`,className:`text-xs`,render:e=>e.is_active==null?R(z,{children:`—`}):e.is_active?`active`:`inactive`},{key:`created_at`,header:`Created`,className:`whitespace-nowrap`,render:e=>B(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/entitlements/${e.id}/edit`})}],rows:e.entitlements,emptyMessage:`No entitlements match.`,rowKey:(e,t)=>e.id||t})}function Zt({payload:e}){return R(K,{title:`Business Entities`,count:e.total,columns:[{key:`name`,header:`Name`,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`email`,header:`Email`,className:`text-secondary text-xs`,render:e=>e.email||R(z,{children:`—`})},{key:`phone`,header:`Phone`,className:`font-mono text-xs`,render:e=>e.phone_number||R(z,{children:`—`})},{key:`country`,header:`Country`,className:`text-xs`,render:e=>e.country||R(z,{children:`—`})},{key:`default`,header:`Default`,className:`text-xs`,render:e=>e.is_default==null?R(z,{children:`—`}):e.is_default?`yes`:`no`},{key:`view`,header:`View`,render:e=>R(q,{href:`/settings/tax-configuration/entity/${e.id}`})}],rows:e.entities,emptyMessage:`No business entities to show.`,rightHint:null,rowKey:(e,t)=>e.id||t})}function Qt({payload:e}){let t=e.invoice,n=t.currency||`USD`,r=t.due_date&&t.amount_due&&t.amount_due>0?vt(t.due_date):null,i=r!=null&&r>0;return R(`div`,{className:`space-y-4`,children:[R(`header`,{className:`flex items-start justify-between gap-3`,children:[R(`div`,{children:[R(`h2`,{className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[R(`span`,{className:`font-mono`,children:t.invoice_number||t.id}),t.status?R(G,{status:t.status}):null,i?R(`span`,{className:`bg-destructive/20 text-destructive ring-destructive/30 rounded-full px-2 py-0.5 text-xs ring-1`,children:[r,`d overdue`]}):null]}),R(`div`,{className:`text-secondary mt-0.5 font-mono text-xs`,children:t.id})]}),R(`div`,{className:`flex gap-2`,children:[t.invoice_pdf?R($t,{href:t.invoice_pdf,children:`PDF`}):null,t.payment_url?R($t,{href:t.payment_url,children:`Payment link`}):null]})]}),R(`div`,{className:`border-border grid grid-cols-2 gap-3 rounded-md border p-3 sm:grid-cols-4`,children:[R(Y,{label:`Total`,value:H(t.invoice_total,n)}),R(Y,{label:`Paid`,value:H(t.paid_amount,n)}),R(Y,{label:`Due`,value:H(t.amount_due,n),tone:i?`warn`:void 0}),R(Y,{label:`Period`,value:t.invoice_period_begin&&t.invoice_period_end?R(`span`,{className:`text-sm`,children:[t.invoice_period_begin.slice(0,10),` →`,` `,t.invoice_period_end.slice(0,10)]}):R(z,{children:`—`})})]}),R(`div`,{className:`border-border grid grid-cols-1 gap-3 rounded-md border p-3 sm:grid-cols-2`,children:[R(Z,{label:`Customer`,children:t.customer_name?R(`div`,{children:[R(`div`,{className:`text-sm`,children:t.customer_name}),t.customer_id?R(`div`,{className:`text-muted-foreground font-mono text-[11px] break-all`,children:t.customer_id}):null]}):t.customer_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.customer_id}):R(z,{children:`—`})}),R(Z,{label:`Business Entity`,children:t.business_entity_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.business_entity_id}):R(z,{children:`—`})}),R(Z,{label:`Contract`,children:t.contract_name?R(`div`,{children:[R(`div`,{className:`text-sm`,children:t.contract_name}),t.contract_id?R(`div`,{className:`text-muted-foreground font-mono text-[11px] break-all`,children:t.contract_id}):null]}):t.contract_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.contract_id}):R(z,{children:`—`})}),R(Z,{label:`External ID`,children:t.external_id?R(`span`,{className:`font-mono text-xs`,children:t.external_id}):R(z,{children:`—`})}),R(Z,{label:`Created`,children:V(t.created_at)}),R(Z,{label:`Due Date`,children:B(t.due_date)}),R(Z,{label:`Currency`,children:n})]}),t.notes?R(X,{title:`Notes`,children:R(`div`,{className:`max-w-prose text-sm`,children:t.notes})}):null,t.approved_at||t.sent_at||t.paid_at?R(X,{title:`Timeline`,children:R(`div`,{className:`flex flex-wrap gap-4 text-sm`,children:[t.sent_at?R(`div`,{children:[R(`span`,{className:`text-muted-foreground text-xs`,children:`Sent `}),R(`span`,{className:`tabular-nums`,children:V(t.sent_at)})]}):null,t.approved_at?R(`div`,{children:[R(`span`,{className:`text-muted-foreground text-xs`,children:`Approved `}),R(`span`,{className:`tabular-nums`,children:V(t.approved_at)})]}):null,t.paid_at?R(`div`,{children:[R(`span`,{className:`text-muted-foreground text-xs`,children:`Paid `}),R(`span`,{className:`tabular-nums`,children:V(t.paid_at)})]}):null]})}):null,t.custom_data&&Object.keys(t.custom_data).length>0?R(X,{title:`Custom Data`,children:R(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:Object.entries(t.custom_data).map(([e,t])=>R(`div`,{className:`border-border rounded border px-2 py-1`,children:[R(`div`,{className:`text-muted-foreground`,children:e}),R(`div`,{className:`font-mono`,children:typeof t==`object`?JSON.stringify(t):String(t??``)})]},e))})}):null]})}function $t({children:e,href:t}){return R(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`border-border bg-accent text-accent-foreground hover:bg-primary hover:text-primary-foreground rounded border px-3 py-1 text-xs transition-colors`,children:e})}function en({payload:e}){let t=De(null),[n,r]=F(400),[i,a]=F(!1);return Ee(()=>{if(!(!t.current||!i))try{let e=t.current.contentDocument;if(e?.documentElement){let t=e.documentElement.scrollHeight;t>0&&r(Math.min(t+16,2e3))}}catch{}},[i,e.html]),e.html?R(`div`,{className:`space-y-2`,children:[e.invoice_id?R(`header`,{className:`flex items-baseline gap-2`,children:[R(`h2`,{className:`m-0 text-lg font-semibold`,children:`Invoice Preview`}),R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:e.invoice_id})]}):null,R(`div`,{className:`border-border overflow-hidden rounded-md border`,children:R(`iframe`,{ref:t,title:`Invoice preview`,srcDoc:e.html,onLoad:()=>a(!0),style:{width:`100%`,height:`${n}px`,border:`none`,background:`#fff`},sandbox:`allow-same-origin`})})]}):R(`div`,{className:`text-muted-foreground border-border rounded-md border py-8 text-center`,children:`No preview generated for this invoice yet.`})}function tn({payload:e}){let t=e.currency||`USD`,n=e.lines||[];return R(K,{title:R(S,{children:[`Line Items`,` `,R(`span`,{className:`text-muted-foreground font-normal`,children:[`(`,n.length,`)`]}),e.invoice_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:[` `,`· `,e.invoice_id]}):null]}),rightHint:e.total==null?null:R(`span`,{className:`text-sm`,children:[`Total:`,` `,R(`span`,{className:`font-medium tabular-nums`,children:H(e.total,t)})]}),columns:[{key:`type`,header:`Type`,className:`text-muted-foreground text-xs`,render:e=>R(`div`,{className:`flex items-center gap-1`,children:[e.line_item_type?e.line_item_type.replace(/_/g,` `):R(z,{children:`—`}),e.is_adjustment?R(`span`,{className:`bg-warning/15 text-warning ring-warning/30 rounded-full px-1.5 py-0.5 text-[10px] ring-1`,children:e.adjustment_type||`adj`}):null]})},{key:`item`,header:`Item`,render:e=>R(S,{children:[R(`div`,{className:`font-medium`,children:e.name||R(z,{children:`—`})}),e.description?R(`div`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{key:`pricing_model`,header:`Pricing Model`,className:`text-muted-foreground text-xs`,render:e=>e.pricing_model||R(z,{children:`—`})},{key:`qty`,header:`Qty`,align:`right`,render:e=>e.quantity?.display||(e.quantity?.value??R(z,{children:`—`}))},{key:`price`,header:`Price`,align:`right`,render:e=>e.price?yt(e.price):R(z,{children:`—`})},{key:`subtotal`,header:`Subtotal`,align:`right`,render:e=>R(`span`,{className:e.subtotal?.value!=null&&e.subtotal.value<0?`text-destructive`:``,children:yt(e.subtotal)})},{key:`period`,header:`Service Period`,className:`text-xs whitespace-nowrap`,render:e=>e.service_start_date&&e.service_end_date?R(S,{children:[B(e.service_start_date),` → `,B(e.service_end_date)]}):R(z,{children:`—`})},{key:`billed`,header:`Billed`,className:`text-xs`,render:e=>e.is_billed===!0?`✓`:e.is_billed===!1?`—`:R(z,{children:`?`})}],rows:n,emptyMessage:`No line items on this invoice.`,hoverRows:!1})}function nn({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=e.default_currency||`USD`,o=I(()=>J(e.invoices,e=>{switch(t){case`invoice_number`:return e.invoice_number;case`invoice_total`:return e.invoice_total;case`amount_due`:return e.amount_due;case`due_date`:return e.due_date;case`created_at`:return e.created_at}},r),[e.invoices,t,r]),s=e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`desc`))},c=e=>{if(!e.due_date||!e.amount_due||e.amount_due<=0)return null;let t=vt(e.due_date);return t!=null&&t>0?t:null};return R(K,{title:`Invoices`,count:e.total,scope:e.scope,columns:[{key:`invoice_number`,header:`Invoice`,sortable:!0,className:`font-mono text-xs`,render:e=>e.invoice_number||R(z,{children:`—`})},{key:`customer`,header:`Customer`,className:`text-xs`,render:e=>e.customer_name?e.customer_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.customer_id,10)})},{key:`period`,header:`Period`,className:`text-xs whitespace-nowrap`,render:e=>e.invoice_period_begin&&e.invoice_period_end?`${e.invoice_period_begin.slice(0,10)} → ${e.invoice_period_end.slice(0,10)}`:R(z,{children:`—`})},{key:`status`,header:`Status`,render:e=>R(G,{status:e.status})},{key:`invoice_total`,header:`Total`,sortable:!0,align:`right`,render:e=>H(e.invoice_total,a)},{key:`amount_due`,header:`Due`,sortable:!0,align:`right`,render:e=>R(`span`,{className:c(e)==null?``:`text-destructive font-medium`,children:H(e.amount_due,a)})},{key:`due_date`,header:`Due Date`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.due_date)},{key:`overdue`,header:`Overdue`,align:`right`,render:e=>{let t=c(e);return t==null?R(`span`,{className:`text-muted-foreground`,children:R(z,{children:`—`})}):R(`span`,{className:`text-destructive font-medium`,children:[t,`d`]})}},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/invoices/${e.id}/view`})}],rows:o,sortKey:t,sortDir:r,onSort:s,emptyMessage:`No invoices match.`,rowKey:(e,t)=>e.id||t})}function rn({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.jobs,e=>{switch(t){case`name`:return e.name;case`created_at`:return e.created_at;case`status`:return e.status}},r),[e.jobs,t,r]),o=e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`desc`))},s=e.status_counts||{},c=R(`div`,{className:`flex flex-wrap gap-1.5 text-xs`,children:Object.entries(s).map(([e,t])=>R(`span`,{className:`bg-muted rounded-full px-2 py-0.5`,children:[e,`: `,R(`span`,{className:`font-medium tabular-nums`,children:t})]},e))});return R(K,{title:`Jobs`,count:e.total,rightHint:c,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`type`,header:`Type`,className:`text-xs`,render:e=>e.job_type||R(z,{children:`—`})},{key:`resource`,header:`Resource`,className:`text-xs`,render:e=>e.resource||R(z,{children:`—`})},{key:`status`,header:`Status`,sortable:!0,render:e=>R(G,{status:e.status})},{key:`description`,header:`Description`,className:`text-muted-foreground max-w-xs truncate text-xs`,render:e=>e.description||R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`text-xs whitespace-nowrap`,render:e=>V(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/jobs/${e.id}/view`})}],rows:a,sortKey:t,sortDir:r,onSort:o,emptyMessage:`No jobs match.`,rowKey:(e,t)=>e.id||t})}function an({payload:e}){let t=e.default_currency||`USD`,n=e.entries,r=I(()=>{let e=0,t=0;for(let r of n)Number.isFinite(r.total_debit)&&(e+=r.total_debit),Number.isFinite(r.total_credit)&&(t+=r.total_credit);return{d:e,c:t}},[n]),i=R(S,{children:[`Σ debit `,H(r.d,t),` · Σ credit `,H(r.c,t)]});return R(K,{title:`Journal Entries`,count:e.total,scope:e.scope,rightHint:i,columns:[{key:`posted_at`,header:`Posted`,className:`whitespace-nowrap`,render:e=>V(e.posted_at)},{key:`event`,header:`Event`,className:`text-xs`,render:e=>e.event||R(z,{children:`—`})},{key:`status`,header:`Status`,render:e=>R(G,{status:e.status_type})},{key:`lines`,header:`Lines`,align:`right`,render:e=>e.line_count??R(z,{children:`—`})},{key:`total_debit`,header:`Σ Debit`,align:`right`,render:e=>e.total_debit==null?R(z,{children:`—`}):H(e.total_debit,e.currency||t)},{key:`total_credit`,header:`Σ Credit`,align:`right`,render:e=>e.total_credit==null?R(z,{children:`—`}):H(e.total_credit,e.currency||t)},{key:`description`,header:`Description`,className:`text-muted-foreground max-w-xs truncate text-xs`,render:e=>e.description||R(z,{children:`—`})}],rows:n,emptyMessage:`No entries match.`,rowKey:(e,t)=>e.id||t,hoverRows:!1})}function on({payload:e}){let t=e.payment_methods||[];return R(`div`,{className:`space-y-3`,children:[R(`header`,{className:`flex items-baseline justify-between gap-3`,children:R(`h2`,{className:`m-0 text-lg font-semibold`,children:[`Payment Methods`,` `,R(`span`,{className:`text-muted-foreground text-sm font-normal`,children:[`(`,t.length,`)`]}),e.customer_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:[` `,`· `,e.customer_id]}):null]})}),t.length===0?R(`div`,{className:`text-muted-foreground border-border rounded-md border py-8 text-center`,children:`No payment methods saved.`}):R(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:t.map((e,t)=>R(sn,{method:e},e.id||t))})]})}function sn({method:e}){let t=(e.type||``).toLowerCase().includes(`card`);return R(`article`,{className:`space-y-1 rounded-md border p-3 ${e.is_default?`border-ring ring-ring ring-1`:`border-border`}`,children:[R(`header`,{className:`flex items-baseline justify-between gap-2`,children:[R(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[R(`span`,{className:`bg-muted rounded px-2 py-0.5 text-xs`,children:(e.type||`unknown`).replace(/_/g,` `)}),e.brand?R(`span`,{className:`text-muted-foreground`,children:e.brand}):null,e.connector_name?R(`span`,{className:`text-muted-foreground text-xs`,children:[`via `,e.connector_name]}):null]}),e.is_default?R(`span`,{className:`bg-secondary/20 text-secondary ring-secondary/30 rounded-full px-2 py-0.5 text-xs ring-1`,children:`default`}):null]}),R(`div`,{className:`font-mono text-sm`,children:e.last4?`•••• ${e.last4}`:R(z,{children:`—`})}),R(`div`,{className:`text-muted-foreground flex gap-3 text-xs`,children:[e.status?R(`span`,{className:`rounded-full px-2 py-0.5 text-xs ring-1 ${e.status===`valid`?`bg-secondary/20 text-secondary ring-secondary/30`:`bg-destructive/20 text-destructive ring-destructive/30`}`,children:e.status}):null,t&&e.exp_month&&e.exp_year?R(`span`,{children:[`exp `,String(e.exp_month).padStart(2,`0`),`/`,String(e.exp_year).slice(-2)]}):null,e.created_at?R(`span`,{children:[`added `,B(e.created_at)]}):null]})]})}var cn={payment:`bg-secondary/20 text-secondary ring-1 ring-secondary/30`,refund:`bg-accent text-accent-foreground ring-1 ring-border`,payment_reversal:`bg-destructive/20 text-destructive ring-1 ring-destructive/30`,authorization:`bg-primary/20 text-primary ring-1 ring-primary/30`,tax_withheld:`bg-muted text-muted-foreground ring-1 ring-border`},ln=`bg-muted text-muted-foreground ring-1 ring-border`;function un({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=e.default_currency||`USD`,o=I(()=>J(e.payments,e=>{switch(t){case`amount`:return e.amount;case`payment_date`:return e.payment_date;case`created_at`:return e.created_at;case`type`:return e.type}},r),[e.payments,t,r]);return R(K,{title:`Payments`,count:e.total,scope:e.scope,columns:[{key:`external_id`,header:`External ID`,className:`font-mono text-xs`,render:e=>e.external_id||R(z,{children:`—`})},{key:`customer`,header:`Customer`,className:`text-xs`,render:e=>e.customer_name?e.customer_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.customer_id,10)})},{key:`invoice`,header:`Invoice`,className:`text-xs`,render:e=>e.invoice_name?e.invoice_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.invoice_id,10)})},{key:`type`,header:`Type`,sortable:!0,render:e=>e.type?R(`span`,{className:`inline-block rounded-full px-2 py-0.5 text-xs ${cn[e.type]||ln}`,children:e.type}):R(z,{children:`—`})},{key:`method`,header:`Method`,className:`text-xs`,render:e=>e.payment_method||R(z,{children:`—`})},{key:`status`,header:`Status`,render:e=>R(G,{status:e.status})},{key:`amount`,header:`Amount`,sortable:!0,align:`right`,render:e=>{let t=e.amount!=null&&e.amount<0,n=e.type===`refund`||e.type===`payment_reversal`;return R(`span`,{className:t||n?`text-destructive`:``,children:H(e.amount,e.currency||a)})}},{key:`payment_date`,header:`Date`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.payment_date)},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)}],rows:o,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`desc`))},emptyMessage:`No payments match.`,rowKey:(e,t)=>e.id||t,hoverRows:!1})}function dn({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.plans,e=>t===`name`?e.name:e.created_at,r),[e.plans,t,r]);return R(K,{title:`Plans`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`description`,header:`Description`,className:`text-muted-foreground text-xs`,render:e=>e.description||R(z,{children:`—`})},{key:`status`,header:`Status`,render:e=>R(G,{status:e.status})},{key:`plan_version`,header:`Version`,align:`right`,render:e=>e.plan_version??R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/plansv2/${e.id}/edit`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No plans match.`,rowKey:(e,t)=>e.id||t})}function fn({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.products,e=>t===`name`?e.name:e.created_at,r),[e.products,t,r]);return R(K,{title:`Products`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`sku`,header:`SKU`,className:`font-mono text-xs`,render:e=>e.sku||R(z,{children:`—`})},{key:`type`,header:`Type`,className:`text-xs`,render:e=>e.product_type||R(z,{children:`—`})},{key:`active`,header:`Active`,className:`text-xs`,render:e=>e.is_active==null?R(z,{children:`—`}):e.is_active?`yes`:`no`},{key:`description`,header:`Description`,className:`text-muted-foreground text-xs`,render:e=>e.description||R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/products/${e.id}/edit`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No products match.`,rowKey:(e,t)=>e.id||t})}function pn({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.raw_metrics,e=>t===`name`?e.name:e.created_at,r),[e.raw_metrics,t,r]);return R(K,{title:`Raw Metrics`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`api_slug`,header:`API Slug`,className:`font-mono text-xs`,render:e=>e.api_slug||R(z,{children:`—`})},{key:`upload`,header:`Upload Enabled`,className:`text-xs`,render:e=>e.usage_upload_enabled==null?R(z,{children:`—`}):e.usage_upload_enabled?`yes`:`no`},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/meters/raw-metrics/${e.id}/view`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No raw metrics match.`,rowKey:(e,t)=>e.id||t})}var mn={name:`Zenskar`,version:`1.0.0`},hn=`2026-01-26`,gn={listCustomers:{fallback:{customers:[],total:0},marker:`customer-table:mounted`,render:e=>R(Yt,{payload:e})},listInvoices:{fallback:{invoices:[],total:0},marker:`invoice-table:mounted`,render:e=>R(nn,{payload:e})},getInvoiceLineItems:{fallback:{lines:[]},marker:`invoice-line-items:mounted`,render:e=>R(tn,{payload:e})},listAllPayments:{fallback:{payments:[],total:0},marker:`payment-table:mounted`,render:e=>R(un,{payload:e})},listCreditNotes:{fallback:{credit_notes:[],total:0},marker:`credit-note-table:mounted`,render:e=>R(Gt,{payload:e})},listContracts:{fallback:{contracts:[],total:0},marker:`contract-table:mounted`,render:e=>R(Ut,{payload:e})},getCustomerById:{fallback:{customer:{id:``}},marker:`customer-detail:mounted`,render:e=>R(Kt,{payload:e})},getInvoiceById:{fallback:{invoice:{id:``}},marker:`invoice-detail:mounted`,render:e=>R(Qt,{payload:e})},getContractById:{fallback:{contract:{id:``},phases:[]},marker:`contract-detail:mounted`,render:e=>R(Pt,{payload:e})},getCreditNoteById:{fallback:{credit_note:{id:``}},marker:`credit-note-detail:mounted`,render:e=>R(Wt,{payload:e})},listProducts:{fallback:{products:[],total:0},marker:`product-table:mounted`,render:e=>R(fn,{payload:e})},listPlans:{fallback:{plans:[],total:0},marker:`plan-table:mounted`,render:e=>R(dn,{payload:e})},listJournalEntries:{fallback:{entries:[],total:0},marker:`journal-table:mounted`,render:e=>R(an,{payload:e})},listJobs:{fallback:{jobs:[],total:0},marker:`job-table:mounted`,render:e=>R(rn,{payload:e})},listContacts:{fallback:{contacts:[],total:0},marker:`contact-table:mounted`,render:e=>R(Mt,{payload:e})},listRawMetrics:{fallback:{raw_metrics:[],total:0},marker:`raw-metric-table:mounted`,render:e=>R(pn,{payload:e})},listAggregates:{fallback:{aggregates:[],total:0},marker:`aggregate-table:mounted`,render:e=>R(jt,{payload:e})},listCustomerAddresses:{fallback:{addresses:[]},marker:`address-list:mounted`,render:e=>R(Ot,{payload:e})},listPaymentMethods:{fallback:{payment_methods:[]},marker:`payment-method-list:mounted`,render:e=>R(on,{payload:e})},listBusinessEntities:{fallback:{entities:[]},marker:`entity-table:mounted`,render:e=>R(Zt,{payload:e})},listEntitlements:{fallback:{entitlements:[],total:0},marker:`entitlement-table:mounted`,render:e=>R(Xt,{payload:e})},getInvoicePreviewHtml:{fallback:{html:``},marker:`invoice-preview:mounted`,render:e=>R(en,{payload:e})}};function _n(){return typeof window>`u`?null:window.openai??null}function vn(){let e=_n(),[t,n]=F(e?.toolInput?.toolName??null),[r,i]=F(e?.toolOutput??null),a=De(null);if(Ee(()=>{let e=pt(`ui/notifications/tool-result`,e=>{let t=e;t&&Object.prototype.hasOwnProperty.call(t,`structuredContent`)&&i(t.structuredContent??null)}),t=pt(`ui/notifications/host-context-changed`,e=>{let t=e?.toolInfo?.tool?.name;typeof t==`string`&&n(t)});return lt(`ui/initialize`,{appCapabilities:{},appInfo:mn,protocolVersion:hn}).then(e=>{let t=e?.hostContext?.toolInfo?.tool?.name;typeof t==`string`&&n(t),ut(`ui/notifications/initialized`)}).catch(()=>{}),()=>{e(),t()}},[]),Ee(()=>{let e=e=>{let t=e?.detail?.globals;t&&(t.toolInput?.toolName&&n(t.toolInput.toolName),Object.prototype.hasOwnProperty.call(t,`toolOutput`)&&i(t.toolOutput??null))};return window.addEventListener(`openai:set_globals`,e,{passive:!0}),()=>{window.removeEventListener(`openai:set_globals`,e)}},[]),Ee(()=>{if(r===null||!t)return;let e=gn[t];if(e?.marker&&ut(`ui/message`,{hidden:!0,marker:e.marker}),!a.current)return;let n=()=>{let e=a.current.getBoundingClientRect();ut(`ui/notifications/size-changed`,{width:Math.round(e.width),height:Math.round(e.height)})};n();let i=new ResizeObserver(n);return i.observe(a.current),()=>i.disconnect()},[r,t]),!t||!gn[t])return R(`div`,{"data-app-loading":!0,style:{visibility:`hidden`,minHeight:1}});let o=gn[t];if(r===null&&!e?.toolOutput)return R(`div`,{"data-app-loading":!0,style:{visibility:`hidden`,minHeight:1}});let s=r??o.fallback;return R(`div`,{ref:a,className:`text-foreground bg-background p-4 font-sans text-[14px]`,children:o.render(s)})}var yn=document.getElementById(`root`);yn&&ot(yn).render(R(S,{children:R(vn,{})}));</script>
7
+ <script type="module" crossorigin>(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m={},h=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function y(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return x(t,s,i,a,null)}function x(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function S(e){return e.children}function C(e,t){this.props=e,this.context=t}function w(e,t){if(t==null)return e.__?w(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?w(e):null}function T(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=v({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),ae(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??w(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,se(i,o,a),n.__e=n.__=null,o.__e!=r&&E(o)}}function E(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),E(e)}function D(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!O.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||a)(O)}function O(){try{for(var e,t=1;r.length;)r.length>t&&r.sort(o),e=r.shift(),t=r.length,T(e)}finally{r.length=O.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,g,_,v,y,b=r&&r.__k||h,x=t.length;for(c=te(n,t,b,c,x),d=0;d<x;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&b[p.__i]||m,p.__i=d,v=ae(e,p,f,i,a,o,s,c,l,u),g=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&ue(f.ref,null,p),u.push(p.ref,p.__c||g,p)),_==null&&g!=null&&(_=g),(y=!!(4&p.__u))||f.__k===p.__k?(c=k(p,c,e,y),y&&f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:g&&(c=g.nextSibling),p.__u&=-7);return n.__e=_,c}function te(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=x(null,o,null,null,null):_(o)?o=e.__k[a]=x(S,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=j(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=w(s)),de(s,s));return r}function k(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=k(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=w(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function A(e,t){return t||=[],e==null||typeof e==`boolean`||(_(e)?e.some(function(e){A(e,t)}):t.push(e)),t}function j(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ne(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||g.test(t)?n:n+`px`}function re(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ne(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ne(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(u,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[l]=r[l]:(n[l]=d,e.addEventListener(t,a?p:f,a)):e.removeEventListener(t,a?p:f,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function ie(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[c]==null)n[c]=d++;else if(n[c]<r[l])return;return r(t.event?t.event(n):n)}}}function ae(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,g,b,x,w,T,E,D,O,te,k,A,j=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof j==`function`)try{if(w=n.props,T=j.prototype&&j.prototype.render,E=(d=j.contextType)&&i[d.__c],D=d?E?E.props.value:d.__:i,r.__c?x=(f=n.__c=r.__c).__=f.__E:(T?n.__c=f=new j(w,D):(n.__c=f=new C(w,D),f.constructor=j,f.render=fe),E&&E.sub(f),f.state||={},f.__n=i,p=f.__d=!0,f.__h=[],f._sb=[]),T&&f.__s==null&&(f.__s=f.state),T&&j.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=v({},f.__s)),v(f.__s,j.getDerivedStateFromProps(w,f.__s))),m=f.props,g=f.state,f.__v=n,p)T&&j.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),T&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(T&&j.getDerivedStateFromProps==null&&w!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(w,D),n.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(w,f.__s,D)){n.__v!=r.__v&&(f.props=w,f.state=f.__s,f.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),h.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(w,f.__s,D),T&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,g,b)})}if(f.context=D,f.props=w,f.__P=e,f.__e=!1,O=t.__r,te=0,T)f.state=f.__s,f.__d=!1,O&&O(n),d=f.render(f.props,f.state,f.context),h.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,O&&O(n),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++te<25);f.state=f.__s,f.getChildContext!=null&&(i=v(v({},i),f.getChildContext())),T&&!p&&f.getSnapshotBeforeUpdate!=null&&(b=f.getSnapshotBeforeUpdate(m,g)),k=d!=null&&d.type===S&&d.key==null?ce(d.props.children):d,c=ee(e,_(k)?k:[k],n,r,i,a,o,s,c,l,u),f.base=n.__e,n.__u&=-161,f.__h.length&&s.push(f),x&&(f.__E=f.__=null)}catch(e){if(n.__v=null,l||o!=null)if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,n.__e=c}else{for(A=o.length;A--;)y(o[A]);oe(n)}else n.__e=r.__e,n.__k=r.__k,e.then||oe(n);t.__e(e,n,r)}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=le(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function oe(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(oe))}function se(e,n,r){for(var i=0;i<r.length;i++)ue(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function ce(e){return typeof e!=`object`||!e||e.__b>0?e:_(e)?e.map(ce):e.constructor===void 0?v({},e):null}function le(n,r,i,a,o,s,c,l,u){var d,f,p,h,g,v,b,x=i.props||m,S=r.props,C=r.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!C&&(C?g.localName==C:g.nodeType==3)){n=g,s[d]=null;break}}if(n==null){if(C==null)return document.createTextNode(S);n=document.createElementNS(o,C,S.is&&S),l&&=(t.__m&&t.__m(r,s),!1),s=null}if(C==null)x===S||l&&n.data==S||(n.data=S);else{if(s=C==`textarea`&&S.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(x={},d=0;d<n.attributes.length;d++)x[(g=n.attributes[d]).name]=g.value;for(d in x)g=x[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||re(n,d,null,g,o);for(d in S)g=S[d],d==`children`?h=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?v=g:d==`checked`?b=g:l&&typeof g!=`function`||x[d]===g||re(n,d,g,x[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),ee(r.type==`template`?n.content:n,_(h)?h:[h],r,i,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&w(i,0),l,u),s!=null)for(d=s.length;d--;)y(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&v==null?n.removeAttribute(`value`):v!=null&&(v!==n[d]||C==`progress`&&!v||C==`option`&&v!=x[d])&&re(n,d,v,x[d],o),d=`checked`,b!=null&&b!=n[d]&&re(n,d,b,x[d],o))}return n}function ue(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function de(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||ue(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&de(i[a],n,r||typeof e.type!=`function`);r||y(e.__e),e.__c=e.__=e.__e=void 0}function fe(e,t,n){return this.constructor(e,n)}function pe(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],ae(r,n=(!a&&i||r).__k=b(S,null,[n]),o||m,m,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),se(s,n,c)}e=h.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,C.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=v({},this.state);typeof e==`function`&&(e=e(v({},n),this.props)),e&&v(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),D(this))},C.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),D(this))},C.prototype.render=S,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,s=Math.random().toString(8),c=`__d`+s,l=`__a`+s,u=/(PointerCapture)$|Capture$/i,d=0,f=ie(!1),p=ie(!0);var M,N,me,he,ge=0,_e=[],P=t,ve=P.__b,ye=P.__r,be=P.diffed,xe=P.__c,Se=P.unmount,Ce=P.__;function we(e,t){P.__h&&P.__h(N,e,ge||t),ge=0;var n=N.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function F(e){return ge=1,Te(Pe,e)}function Te(e,t,n){var r=we(M++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Pe(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=N,!N.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a&&a.call(this,e,t,n)||o};N.__f=!0;var a=N.shouldComponentUpdate,o=N.componentWillUpdate;N.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},N.shouldComponentUpdate=i}return r.__N||r.__}function Ee(e,t){var n=we(M++,3);!P.__s&&Ne(n.__H,t)&&(n.__=e,n.u=t,N.__H.__h.push(n))}function De(e){return ge=5,I(function(){return{current:e}},[])}function I(e,t){var n=we(M++,7);return Ne(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Oe(){for(var e;e=_e.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(je),t.__h.some(Me),t.__h=[]}catch(n){t.__h=[],P.__e(n,e.__v)}}}P.__b=function(e){N=null,ve&&ve(e)},P.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ce&&Ce(e,t)},P.__r=function(e){ye&&ye(e),M=0;var t=(N=e.__c).__H;t&&(me===N?(t.__h=[],N.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(je),t.__h.some(Me),t.__h=[],M=0)),me=N},P.diffed=function(e){be&&be(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(_e.push(t)!==1&&he===P.requestAnimationFrame||((he=P.requestAnimationFrame)||Ae)(Oe)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),me=N=null},P.__c=function(e,t){t.some(function(e){try{e.__h.some(je),e.__h=e.__h.filter(function(e){return!e.__||Me(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],P.__e(n,e.__v)}}),xe&&xe(e,t)},P.unmount=function(e){Se&&Se(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{je(e)}catch(e){t=e}}),n.__H=void 0,t&&P.__e(t,n.__v))};var ke=typeof requestAnimationFrame==`function`;function Ae(e){var t,n=function(){clearTimeout(r),ke&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ke&&(t=requestAnimationFrame(n))}function je(e){var t=N,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),N=t}function Me(e){var t=N;e.__c=e.__(),N=t}function Ne(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Pe(e,t){return typeof t==`function`?t(e):t}function Fe(e,t){for(var n in t)e[n]=t[n];return e}function Ie(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function Le(e,t){this.props=e,this.context=t}(Le.prototype=new C).isPureReactComponent=!0,Le.prototype.shouldComponentUpdate=function(e,t){return Ie(this.props,e)||Ie(this.state,t)};var Re=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Re&&Re(e)},typeof Symbol<`u`&&Symbol.for;var ze=t.__e;t.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}ze(e,t,n,r)};var Be=t.unmount;function Ve(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=Fe({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Ve(e,t,n)})),e}function He(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return He(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ue(){this.__u=0,this.o=null,this.__b=null}function We(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Ge(){this.i=null,this.l=null}t.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Be&&Be(e)},(Ue.prototype=new C).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=We(r.__v),a=!1,o=function(){a||r.__z||(a=!0,n.__R=null,i?i(c):c())};n.__R=o;var s=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=He(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},Ue.prototype.componentWillUnmount=function(){this.o=[]},Ue.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=Ve(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&b(S,null,e.fallback);return i&&(i.__u&=-33),[b(S,null,t.__a?null:e.children),i]};var Ke=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Ge.prototype=new C).__a=function(e){var t=this,n=We(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),Ke(t,e,r)):i()};n?n(a):a()}},Ge.prototype.render=function(e){this.i=null,this.l=new Map;var t=A(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ge.prototype.componentDidUpdate=Ge.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Ke(e,n,t)})};var qe=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,Je=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ye=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xe=/[A-Z0-9]/g,Ze=typeof document<`u`,Qe=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};function $e(e,t,n){return t.__k??(t.textContent=``),pe(e,t),typeof n==`function`&&n(),e?e.__c:null}C.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(C.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var et=t.event;t.event=function(e){return et&&(e=et(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var tt={configurable:!0,get:function(){return this.class}},nt=t.vnode;t.vnode=function(e){typeof e.type==`string`&&function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)==-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||Ze&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){var s=a.toLowerCase();a===`defaultValue`&&`value`in t&&t.value==null?a=`value`:a===`download`&&!0===o?o=``:s===`translate`&&o===`no`?o=!1:s[0]===`o`&&s[1]===`n`?s===`ondoubleclick`?a=`ondblclick`:s!==`onchange`||n!==`input`&&n!==`textarea`||Qe(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:Ye.test(a)&&(a=s):s=a=`oninput`:i&&Je.test(a)?a=a.replace(Xe,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&(r.multiple&&Array.isArray(r.value)&&(r.value=A(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=A(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,`className`,tt)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=qe,nt&&nt(e)};var rt=t.__r;t.__r=function(e){rt&&rt(e),e.__c};var it=t.diffed;t.diffed=function(e){it&&it(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value)};function at(e){return!!e.__k&&(pe(null,e),!0)}function ot(e){return{render:function(t){$e(t,e)},unmount:function(){at(e)}}}var L=new Map,st=1,ct=new Set;typeof window<`u`&&window.addEventListener(`message`,e=>{let t=e.data;if(!t||typeof t!=`object`||t.jsonrpc!==`2.0`)return;let n=t;if(n.id!=null&&L.has(n.id)){let e=L.get(n.id);L.delete(n.id),n.error?e.reject(n.error):e.resolve(n.result);return}if(n.method){let e={jsonrpc:`2.0`,method:n.method,params:n.params};ct.forEach(t=>{try{t(e)}catch{}})}});function lt(e,t,n=3e4){if(typeof window>`u`||!window.parent)return Promise.reject(Error(`no host`));let r=st++;return new Promise((i,a)=>{let o=setTimeout(()=>{L.has(r)&&(L.delete(r),a(Error(`callHost timeout: ${e}`)))},n);L.set(r,{resolve:e=>{clearTimeout(o),i(e)},reject:e=>{clearTimeout(o),a(e)}}),window.parent.postMessage({jsonrpc:`2.0`,id:r,method:e,params:t},`*`)})}function ut(e,t){typeof window>`u`||!window.parent||window.parent.postMessage({jsonrpc:`2.0`,method:e,params:t},`*`)}var dt=`https://app.zenskar.com`;function ft(e){let t=`${dt}${e.startsWith(`/`)?e:`/${e}`}`;lt(`ui/open-link`,{url:t}).catch(()=>{try{window.open(t,`_blank`,`noopener,noreferrer`)}catch{ut(`ui/message`,{text:`Open: ${t}`})}})}function pt(e,t){let n=n=>{n.method===e&&t(n.params)};return ct.add(n),()=>ct.delete(n)}var mt=0;Array.isArray;function R(e,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mt,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}function z({children:e}){return R(`span`,{className:`text-muted-foreground`,children:e})}var ht=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function gt(e){if(!e)return null;let t=e.replace(` `,`T`);/^\d{4}-\d{2}-\d{2}$/.test(t)?t+=`T00:00:00Z`:/[zZ]|[+-]\d{2}:?\d{2}$/.test(t)||(t+=`Z`);let n=new Date(t);return Number.isNaN(n.getTime())?null:n}function _t(e){return e<10?`0`+e:String(e)}function B(e){let t=gt(e);return t?`${ht[t.getUTCMonth()]} ${_t(t.getUTCDate())}, ${t.getUTCFullYear()}`:R(z,{children:`—`})}function V(e){let t=gt(e);if(!t)return R(z,{children:`—`});let n=t.getUTCHours(),r=n>=12?`PM`:`AM`,i=n%12||12;return`${ht[t.getUTCMonth()]} ${_t(t.getUTCDate())}, ${t.getUTCFullYear()} ${_t(i)}:${_t(t.getUTCMinutes())} ${r}`}function vt(e,t=new Date){let n=gt(e);return n?Math.floor((t.getTime()-n.getTime())/864e5):null}function H(e,t=`USD`){if(e==null||!Number.isFinite(e))return R(z,{children:`—`});let n=e/100;try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t,maximumFractionDigits:2}).format(n)}catch{return`${t} ${n.toLocaleString()}`}}function yt(e){return e?e.display?e.display:e.value==null?R(z,{children:`—`}):H(e.value,e.unit||`USD`):R(z,{children:`—`})}function U(e,t=8){return e?e.length<=t?e:e.slice(0,t)+`…`:R(z,{children:`—`})}var bt=`bg-secondary/20 text-secondary ring-1 ring-secondary/30`,xt=`bg-primary/20 text-primary ring-1 ring-primary/30`,St=`bg-destructive/20 text-destructive ring-1 ring-destructive/30`,W=`bg-muted text-muted-foreground ring-1 ring-border`,Ct=`bg-accent text-accent-foreground ring-1 ring-border`,wt=`bg-secondary/12 text-secondary ring-1 ring-secondary/20`,Tt={paid:bt,approved:bt,active:bt,success:bt,posted:bt,upcoming:xt,partially_paid:xt,in_progress:xt,paused:xt,failed:St,disputed:St,draft:W,void:W,voided:W,expired:W,archived:W,issued:wt,scheduled:wt,refunded:Ct},Et=W;function G({status:e}){if(!e)return R(z,{children:`—`});let t=Tt[e.toLowerCase()]||Et,n=Dt(e);return R(`span`,{className:`inline-block whitespace-nowrap rounded-md px-2 py-0.5 text-xs ${t}`,children:n})}function Dt(e){let t=e.replace(/_/g,` `);return t.charAt(0).toUpperCase()+t.slice(1)}function Ot({payload:e}){let t=e.addresses||[];return R(`div`,{className:`space-y-3`,children:[R(`header`,{className:`flex items-baseline justify-between gap-3`,children:R(`h2`,{className:`m-0 text-lg font-semibold`,children:[`Addresses`,` `,R(`span`,{className:`text-muted-foreground text-sm font-normal`,children:[`(`,t.length,`)`]}),e.customer_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:[` `,`· `,e.customer_id]}):null]})}),t.length===0?R(`div`,{className:`text-muted-foreground border-border rounded-md border py-8 text-center`,children:`No addresses on file.`}):R(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:t.map((e,t)=>R(kt,{addr:e},e.id||t))})]})}function kt({addr:e}){return R(`article`,{className:`space-y-1 rounded-md border p-3 ${e.is_primary?`border-ring ring-ring ring-1`:`border-border`}`,children:[R(`header`,{className:`flex items-baseline justify-between gap-2`,children:[R(`div`,{className:`text-sm font-medium`,children:e.label||R(z,{children:`Untitled`})}),e.is_primary?R(`span`,{className:`bg-secondary/20 text-secondary ring-secondary/30 rounded-full px-2 py-0.5 text-xs ring-1`,children:`primary`}):null]}),R(`div`,{className:`text-sm`,children:[e.line1?R(`div`,{children:e.line1}):null,e.line2?R(`div`,{children:e.line2}):null,e.line3?R(`div`,{children:e.line3}):null,R(`div`,{children:[e.city,e.state,e.zip_code].filter(Boolean).join(`, `)||R(z,{children:`—`})}),e.country?R(`div`,{className:`text-muted-foreground mt-0.5 text-xs uppercase`,children:e.country}):null,e.validation_status?R(`span`,{className:`mt-1 inline-block rounded-full px-2 py-0.5 text-[10px] ring-1 ${e.validation_status===`valid`?`bg-secondary/20 text-secondary ring-secondary/30`:`bg-muted text-muted-foreground ring-border`}`,children:e.validation_status}):null]})]})}function K({title:e,count:t,scope:n,rightHint:r,columns:i,rows:a,sortKey:o,sortDir:s,onSort:c,emptyMessage:l=`Nothing to show.`,showIndex:u=!0,rowKey:d,rowClassName:f,hoverRows:p=!0}){let m=i.length+ +!!u,h=r===void 0&&c?`click headers to sort`:r;return R(`div`,{className:`space-y-3`,children:[R(`header`,{className:`flex items-baseline justify-between gap-3`,children:[R(`h2`,{className:`m-0 text-lg font-semibold`,children:[e,t==null?null:R(`span`,{className:`text-muted-foreground text-sm font-normal`,children:[` `,`(`,t.toLocaleString(),`)`]}),n?R(`span`,{className:`text-muted-foreground text-sm font-normal`,children:[` `,`· `,n]}):null]}),h==null?null:R(`span`,{className:`text-muted-foreground text-xs`,children:h})]}),R(`div`,{className:`border-border overflow-auto rounded-md border`,children:R(`table`,{className:`w-full text-sm`,children:[R(`thead`,{className:`bg-muted text-muted-foreground border-b-2 border-border text-xs tracking-wide uppercase`,children:R(`tr`,{children:[u?R(At,{children:`#`}):null,i.map(e=>R(At,{align:e.align,sortable:e.sortable,active:e.sortable&&o===e.key,dir:s,onClick:e.sortable&&c?()=>c(e.key):void 0,children:e.header},e.key))]})}),R(`tbody`,{children:a.length===0?R(`tr`,{children:R(`td`,{colSpan:m,className:`text-muted-foreground py-8 text-center`,children:l})}):a.map((e,t)=>R(`tr`,{className:`border-border border-t ${p?`hover:bg-muted/60`:``} ${f?f(e,t):``}`.trim().replace(/\s+/g,` `),children:[u?R(`td`,{className:`text-muted-foreground px-3 py-2 tabular-nums`,children:t+1}):null,i.map(n=>R(`td`,{className:`px-3 py-2 ${n.align===`right`?`text-right tabular-nums`:``} ${n.className??``}`.trim(),children:n.render(e,t)},n.key))]},d?d(e,t):t))})]})})]})}function At({children:e,sortable:t,active:n,dir:r,onClick:i,align:a=`left`}){return R(`th`,{className:[`px-3 py-2 font-semibold`,a===`right`?`text-right`:`text-left`,t?`cursor-pointer select-none hover:text-foreground`:``,n?`text-foreground`:``].filter(Boolean).join(` `),onClick:i,children:[e,t&&n?r===`asc`?` ↑`:` ↓`:null]})}function q({href:e,label:t=`View`}){return R(`button`,{type:`button`,className:`text-secondary hover:text-secondary/80 text-xs underline`,onClick:()=>ft(e),children:t})}function J(e,t,n){let r=n===`asc`?1:-1;return[...e].sort((e,n)=>{let i=t(e),a=t(n);return i==null&&a==null?0:i==null?1:a==null?-1:i<a?-1*r:i>a?1*r:0})}function jt({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.aggregates,e=>t===`name`?e.name:e.created_at,r),[e.aggregates,t,r]);return R(K,{title:`Aggregates`,count:e.total,scope:e.scope,rightHint:`aka billable metrics`,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/meters/${e.id}/edit`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No aggregates match.`,rowKey:(e,t)=>e.id||t})}function Mt({payload:e}){let[t,n]=F(`name`),[r,i]=F(`asc`),a=I(()=>J(e.contacts,e=>t===`name`?e.name:e.email,r),[e.contacts,t,r]);return R(K,{title:`Contacts`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`email`,header:`Email`,sortable:!0,className:`text-secondary`,render:e=>e.email||R(z,{children:`—`})},{key:`customer`,header:`Customer`,className:`text-secondary font-mono text-xs`,render:e=>U(e.customer_id,10)},{key:`send_invoice`,header:`Send Invoice`,className:`text-xs`,render:e=>e.send_invoice==null?R(z,{children:`—`}):e.send_invoice?`yes`:`no`},{key:`send_contract`,header:`Send Contract`,className:`text-xs`,render:e=>e.send_contract==null?R(z,{children:`—`}):e.send_contract?`yes`:`no`},{key:`view`,header:`View`,render:e=>R(q,{href:`/contacts/${e.id}/edit`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`asc`))},emptyMessage:`No contacts match.`,rightHint:null,rowKey:(e,t)=>e.id||t})}var Nt=`text-muted-foreground text-[11px] tracking-wide uppercase`;function Y({label:e,value:t,tone:n}){return R(`div`,{children:[R(`div`,{className:Nt,children:e}),R(`div`,{className:n===`warn`?`text-2xl font-bold tabular-nums text-destructive`:`text-2xl font-bold tabular-nums`,children:t})]})}function X({title:e,children:t}){return R(`section`,{className:`space-y-1`,children:[R(`div`,{className:Nt,children:e}),t]})}function Z({label:e,children:t}){return R(`div`,{children:[R(`div`,{className:Nt,children:e}),R(`div`,{className:`text-sm`,children:t})]})}function Pt({payload:e}){let t=e.contract,n=e.phases||[],r=new Date;return R(`div`,{className:`space-y-4`,children:[R(`header`,{className:`flex items-start justify-between gap-3`,children:[R(`div`,{children:[R(`h2`,{className:`m-0 flex min-w-0 items-center gap-2 text-lg font-semibold`,children:[R(`span`,{className:`min-w-0 truncate`,children:t.name||R(z,{children:`—`})}),t.status?R(G,{status:t.status}):null]}),R(`div`,{className:`text-secondary mt-0.5 font-mono text-xs`,children:t.id})]}),R(`div`,{className:`flex gap-2`,children:t.contract_link?R(`a`,{href:t.contract_link,target:`_blank`,rel:`noreferrer`,className:`border-border bg-accent text-accent-foreground hover:bg-primary hover:text-primary-foreground rounded border px-3 py-1 text-xs transition-colors`,children:`Open`}):null})]}),R(`div`,{className:`border-border grid grid-cols-1 gap-3 rounded-md border p-3 sm:grid-cols-2`,children:[R(Z,{label:`Customer`,children:t.customer_name?R(`div`,{children:[R(`div`,{className:`truncate text-sm`,children:t.customer_name}),t.customer_id?R(`div`,{className:`text-muted-foreground font-mono text-xs break-all`,children:t.customer_id}):null]}):t.customer_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.customer_id}):R(z,{children:`—`})}),R(Z,{label:`Currency`,children:t.currency?R(`span`,{className:`font-mono text-xs`,children:t.currency}):R(z,{children:`—`})}),R(Z,{label:`Type`,children:t.contract_type||R(z,{children:`—`})}),R(Z,{label:`Term`,children:t.start_date&&t.end_date?R(`span`,{className:`text-sm`,children:[t.start_date.slice(0,10),` → `,t.end_date.slice(0,10)]}):R(z,{children:`—`})}),R(Z,{label:`Anchor Date`,children:B(t.anchor_date)}),R(Z,{label:`Renewal Policy`,children:t.renewal_policy||R(z,{children:`—`})}),R(Z,{label:`Plan`,children:t.plan_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.plan_id}):R(z,{children:`—`})}),R(Z,{label:`Created`,children:B(t.created_at)})]}),t.description?R(X,{title:`Description`,children:R(`div`,{className:`text-sm`,children:t.description})}):null,t.tags&&t.tags.length>0?R(X,{title:`Tags`,children:R(`div`,{className:`flex flex-wrap gap-2`,children:t.tags.map((e,t)=>R(`span`,{className:`bg-muted text-muted-foreground rounded-full px-2 py-0.5 text-xs`,children:e},t))})}):null,n.length>0?R(X,{title:`Phases (${n.length})`,children:R(`div`,{className:`space-y-2`,children:n.map((e,t)=>R(Ft,{phase:e,index:t,today:r},e.id||t))})}):null,t.custom_attributes&&Object.keys(t.custom_attributes).length>0?R(X,{title:`Custom Attributes`,children:R(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:Object.entries(t.custom_attributes).map(([e,t])=>R(`div`,{className:`border-border rounded border px-2 py-1`,children:[R(`div`,{className:`text-muted-foreground`,children:e}),R(`div`,{className:`line-clamp-2 break-all font-mono`,children:typeof t==`object`?JSON.stringify(t):String(t??``)})]},e))})}):null]})}function Ft({phase:e,index:t,today:n}){let r=e.start_date?new Date(e.start_date):null,i=e.end_date?new Date(e.end_date):null,a=r&&i&&r<=n&&n<=i,o=a?`ring-2 ring-ring`:``,s=e.pricings||[];return R(`div`,{className:`border-border rounded-md border p-3 ${o}`,children:[R(`div`,{className:`flex items-baseline justify-between gap-2`,children:[R(`div`,{className:`min-w-0 text-sm font-medium`,children:[R(`span`,{className:`text-muted-foreground mr-2`,children:[`#`,t+1]}),R(`span`,{className:`wrap-break-word`,children:e.name||R(z,{children:`Untitled phase`})}),a?R(`span`,{className:`bg-secondary/20 text-secondary ring-secondary/30 ml-2 rounded-full px-2 py-0.5 text-xs ring-1`,children:`current`}):null]}),R(`div`,{className:`text-muted-foreground text-xs whitespace-nowrap`,children:[e.start_date?e.start_date.slice(0,10):`—`,` →`,` `,e.end_date?e.end_date.slice(0,10):`—`]})]}),s.length>0?R(`div`,{className:`mt-2 space-y-2`,children:s.map((e,t)=>R(Lt,{p:e},e.id||t))}):R(`div`,{className:`mt-1 grid grid-cols-2 gap-2 text-xs sm:grid-cols-3`,children:[R(`div`,{children:[R(`span`,{className:`text-muted-foreground`,children:`Products:`}),` `,R(`span`,{className:`tabular-nums`,children:e.product_count??`—`})]}),e.pricing_summary?R(`div`,{className:`text-muted-foreground col-span-full sm:col-span-2`,children:e.pricing_summary}):null]})]})}function It(e){let t=e.match(/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?/);if(!t)return e;let n=Number(t[1]||0),r=Number(t[2]||0),i=Number(t[3]||0),a=Number(t[4]||0),o=[];return n&&o.push(`${n} year${n>1?`s`:``}`),r&&o.push(`${r} month${r>1?`s`:``}`),i&&o.push(`${i} week${i>1?`s`:``}`),a&&o.push(`${a} day${a>1?`s`:``}`),o.join(` `)||e}function Q(e,t){if(Array.isArray(e)||e==null||!Number.isFinite(e))return`—`;try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t||`USD`,maximumFractionDigits:2}).format(e)}catch{return`${t||`USD`} ${e}`}}function Lt({p:e}){e.currency;let t=e.features&&e.features.length>0;return R(`div`,{className:`border-border rounded-md border bg-card px-3 py-2.5`,children:R(`div`,{className:`flex w-full flex-col gap-2.5`,children:[R(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:R(`div`,{className:`flex min-w-0 items-center gap-2`,children:[R(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:e.product_name||R(z,{children:`Unnamed product`})}),e.product_type?R(`span`,{className:`bg-accent text-accent-foreground rounded px-1.5 py-0.5 text-xs font-medium uppercase`,children:e.product_type}):null]})}),e.description?R(`div`,{className:`text-muted-foreground line-clamp-3 text-xs leading-relaxed`,children:e.description}):null,R(`hr`,{className:`border-border m-0`}),R(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2.5`,children:[R(zt,{p:e}),e.pricing_model===`flat_fee`?null:R($,{label:e.quantity_type===`metered`?`Billable Metric${e.quantity_unit?` (${e.quantity_unit})`:``}`:`Quantity`,children:e.quantity_type===`fixed`&&e.quantity_value!=null?R(`span`,{children:[e.quantity_value,e.quantity_unit?` ${e.quantity_unit}`:``]}):e.quantity_type===`metered`?R(`span`,{className:`truncate`,children:e.meter_name||R(z,{children:`No metric`})}):R(z,{children:`—`})}),e.billing_cadence?R($,{label:`Billing Cadence (${e.is_recurring?`Recurring`:`One Time`})`,children:[e.billing_timing?`${e.billing_timing} - `:``,`Every`,` `,It(e.billing_cadence)]}):null,e.start_date?R($,{label:`Product Period`,children:[e.start_date.slice(0,10),` →`,` `,e.end_date?e.end_date.slice(0,10):`Forever`]}):null]}),t?R(Ht,{features:e.features}):null]})})}function $({label:e,children:t}){return R(`div`,{className:`min-w-0`,children:[R(`div`,{className:`text-muted-foreground text-xs font-medium`,children:e}),R(`div`,{className:`text-xs`,children:t})]})}function Rt(e){return e?e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase()):`Unknown`}function zt({p:e}){let t=e.currency,n=t?` (${t})`:``;switch(e.pricing_model){case`flat_fee`:return R($,{label:`Flat Fee${n}`,children:R(`span`,{className:`font-semibold tabular-nums`,children:Q(e.unit_amount,t)})});case`per_unit`:case`per_unit_pricing`:return R($,{label:`Per Unit Price${n}`,children:R(`span`,{className:`font-semibold tabular-nums`,children:Q(e.unit_amount,t)})});case`percent`:case`percent_pricing`:return R($,{label:`Percent Pricing${n}`,children:R(`span`,{className:`font-semibold tabular-nums`,children:e.unit_amount==null?`—`:`${e.unit_amount}%`})});case`package`:case`package_pricing`:return R(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2.5`,children:[R($,{label:`Package Price${n}`,children:R(`span`,{className:`font-semibold tabular-nums`,children:Q(e.unit_amount,t)})}),e.package_size?R($,{label:`Package Size`,children:R(`span`,{children:e.package_size})}):null]});case`volume`:case`volume_pricing`:case`tiered`:case`tiered_pricing`:case`step`:case`step_pricing`:return R(`div`,{className:`w-full`,children:[R(`div`,{className:`text-muted-foreground mb-1 text-xs font-medium`,children:[Rt(e.pricing_model),` Price`,n]}),R(Bt,{tiers:e.tiers,currency:t})]});case`volume_with_flat_fee`:case`tiered_with_flat_fee`:return R(`div`,{className:`w-full`,children:[R(`div`,{className:`text-muted-foreground mb-1 text-xs font-medium`,children:[Rt(e.pricing_model),` Price`,n]}),R(Bt,{tiers:e.tiers,currency:t,showFlatFee:!0})]});case`matrix`:case`matrix_pricing`:return R(`div`,{className:`w-full`,children:[R(`div`,{className:`text-muted-foreground mb-1 text-xs font-medium`,children:[`Matrix Pricing`,n]}),R(Vt,{matrix:e.matrix,currency:t}),e.unit_amount==null?null:R(`div`,{className:`text-muted-foreground mt-1.5 text-xs`,children:[`Default price:`,` `,R(`span`,{className:`font-semibold`,children:Q(e.unit_amount,t)})]})]});case`custom`:case`custom_pricing`:return R($,{label:`Custom Pricing`,children:R(`span`,{className:`text-muted-foreground`,children:`Custom script`})});default:return e.unit_amount==null?R(z,{children:`—`}):R($,{label:`Price${n}`,children:R(`span`,{className:`font-semibold tabular-nums`,children:Q(e.unit_amount,t)})})}}function Bt({tiers:e,currency:t,showFlatFee:n}){return!e||e.length===0?R(`span`,{className:`text-muted-foreground text-xs`,children:`No tiers`}):R(`div`,{className:`max-h-48 overflow-auto`,children:R(`table`,{className:`w-full text-xs`,children:[R(`caption`,{className:`sr-only`,children:`Pricing tiers`}),R(`thead`,{children:R(`tr`,{className:`text-muted-foreground border-border border-b text-left`,children:[R(`th`,{scope:`col`,className:`py-0.5 pr-2 font-medium`,children:`Min`}),R(`th`,{scope:`col`,className:`py-0.5 pr-2 font-medium`,children:`Max`}),R(`th`,{scope:`col`,className:`py-0.5 pr-2 text-right font-medium`,children:`Unit Price`}),n?R(`th`,{scope:`col`,className:`py-0.5 text-right font-medium`,children:`Flat Fee`}):null]})}),R(`tbody`,{children:e.map((e,r)=>R(`tr`,{className:`border-border/50 border-b last:border-0`,children:[R(`td`,{className:`py-0.5 pr-2 tabular-nums`,children:e.min_quantity??0}),R(`td`,{className:`py-0.5 pr-2 tabular-nums`,children:e.max_quantity??`∞`}),R(`td`,{className:`py-0.5 pr-2 text-right tabular-nums`,children:Q(e.unit_amount,t)}),n?R(`td`,{className:`py-0.5 text-right tabular-nums`,children:e.flat_fee==null?`—`:Q(e.flat_fee,t)}):null]},r))})]})})}function Vt({matrix:e,currency:t}){return!e||e.length===0?R(`span`,{className:`text-muted-foreground text-xs`,children:`Matrix pricing (no data)`}):R(`div`,{className:`max-h-48 overflow-auto`,children:R(`table`,{className:`w-full text-xs`,children:[R(`caption`,{className:`sr-only`,children:`Matrix pricing dimensions`}),R(`thead`,{children:R(`tr`,{className:`text-muted-foreground border-border border-b text-left`,children:[R(`th`,{scope:`col`,className:`py-0.5 pr-2 font-medium`,children:`Dimension`}),R(`th`,{scope:`col`,className:`py-0.5 pr-2 font-medium`,children:`Alias`}),R(`th`,{scope:`col`,className:`py-0.5 text-right font-medium`,children:`Price`})]})}),R(`tbody`,{children:e.map((e,n)=>R(`tr`,{className:`border-border/50 border-b last:border-0`,children:[R(`td`,{className:`py-0.5 pr-2`,children:e.dimension??`—`}),R(`td`,{className:`py-0.5 pr-2`,children:e.display_alias??`—`}),R(`td`,{className:`py-0.5 text-right tabular-nums`,children:Q(e.price,t)})]},n))})]})})}function Ht({features:e}){let t=new Map;for(let n of e){let e=t.get(n.type)||[];e.push(n),t.set(n.type,e)}return R(`div`,{className:`mt-1 space-y-2`,children:[R(`div`,{className:`text-muted-foreground text-xs font-medium uppercase`,children:`Features`}),Array.from(t.entries()).map(([e,t])=>R(`div`,{className:`flex flex-wrap items-start gap-2`,children:[R(`span`,{className:`bg-muted text-muted-foreground shrink-0 rounded px-1.5 py-0.5 text-xs`,children:e}),R(`div`,{className:`flex flex-col gap-0.5`,children:t.map((e,t)=>R(`div`,{className:`text-muted-foreground break-words text-xs`,children:[e.label?R(`span`,{className:`mr-2 font-medium`,children:e.label}):null,e.summary]},t))})]},e))]})}function Ut({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.contracts,e=>{switch(t){case`name`:return e.name;case`start_date`:return e.start_date;case`end_date`:return e.end_date;case`created_at`:return e.created_at??null}},r),[e.contracts,t,r]);return R(K,{title:`Contracts`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`customer`,header:`Customer`,className:`text-xs`,render:e=>e.customer_name?e.customer_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.customer_id,10)})},{key:`status`,header:`Status`,render:e=>R(G,{status:e.status})},{key:`currency`,header:`Currency`,className:`font-mono text-xs`,render:e=>e.currency||R(z,{children:`—`})},{key:`start_date`,header:`Start`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.start_date)},{key:`end_date`,header:`End`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.end_date)},{key:`days_left`,header:`Days Left`,align:`right`,render:e=>{let t=e.end_date?-1*(vt(e.end_date)??0):null;if(t==null)return R(z,{children:`—`});let n=t<0;return R(`span`,{className:n?`text-destructive font-medium`:!n&&t<=30?`text-primary font-medium`:`text-muted-foreground`,children:n?`${Math.abs(t)}d ago`:`${t}d`})}},{key:`view`,header:`View`,render:e=>R(q,{href:`/contractsv2/${e.id}/edit`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No contracts match.`,rowKey:(e,t)=>e.id||t})}function Wt({payload:e}){let t=e.credit_note,n=t.currency||`USD`;return R(`div`,{className:`space-y-4`,children:[R(`header`,{className:`flex items-start justify-between gap-3`,children:R(`div`,{children:[R(`h2`,{className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[R(`span`,{className:`font-mono`,children:t.credit_note_number||t.id}),t.status?R(G,{status:t.status}):null]}),R(`div`,{className:`text-secondary mt-0.5 font-mono text-xs`,children:t.id})]})}),R(`div`,{className:`border-border grid grid-cols-2 gap-3 rounded-md border p-3 sm:grid-cols-4`,children:[R(Y,{label:`Amount`,value:t.amount==null?R(z,{children:`—`}):H(t.amount,n)}),R(Y,{label:`Currency`,value:n}),R(Y,{label:`Credits Returned`,value:t.credits_returned==null?R(z,{children:`—`}):t.credits_returned.toLocaleString()}),R(Y,{label:`Created`,value:B(t.created_at)})]}),R(`div`,{className:`border-border grid grid-cols-1 gap-3 rounded-md border p-3 sm:grid-cols-2`,children:[R(Z,{label:`Customer`,children:t.customer_name?R(`div`,{children:[R(`div`,{className:`text-sm`,children:t.customer_name}),t.customer_id?R(`div`,{className:`text-muted-foreground font-mono text-[11px] break-all`,children:t.customer_id}):null]}):t.customer_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.customer_id}):R(z,{children:`—`})}),R(Z,{label:`Invoice`,children:t.invoice_number?R(`div`,{children:[R(`div`,{className:`font-mono text-sm`,children:t.invoice_number}),t.invoice_id?R(`div`,{className:`text-muted-foreground font-mono text-[11px] break-all`,children:t.invoice_id}):null]}):t.invoice_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.invoice_id}):R(z,{children:`—`})}),R(Z,{label:`Repayment Method`,children:t.repayment_method||R(z,{children:`—`})})]}),t.custom_data&&Object.keys(t.custom_data).length>0?R(X,{title:`Custom Data`,children:R(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:Object.entries(t.custom_data).map(([e,t])=>R(`div`,{className:`border-border rounded border px-2 py-1`,children:[R(`div`,{className:`text-muted-foreground`,children:e}),R(`div`,{className:`font-mono`,children:typeof t==`object`?JSON.stringify(t):String(t??``)})]},e))})}):null]})}function Gt({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=e.default_currency||`USD`,o=I(()=>J(e.credit_notes,e=>{switch(t){case`amount`:return e.amount;case`created_at`:return e.created_at;case`status`:return e.status}},r),[e.credit_notes,t,r]);return R(K,{title:`Credit Notes`,count:e.total,scope:e.scope,columns:[{key:`number`,header:`Number`,className:`font-mono text-xs`,render:e=>e.credit_note_number||R(z,{children:`—`})},{key:`customer`,header:`Customer`,className:`text-xs`,render:e=>e.customer_name?e.customer_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.customer_id,10)})},{key:`invoice`,header:`Invoice`,className:`text-xs`,render:e=>e.invoice_name?e.invoice_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.invoice_id,10)})},{key:`status`,header:`Status`,sortable:!0,render:e=>R(G,{status:e.status})},{key:`amount`,header:`Amount`,sortable:!0,align:`right`,className:`text-destructive`,render:e=>H(e.amount,e.currency||a)},{key:`repayment`,header:`Repayment`,className:`text-xs`,render:e=>e.repayment_method||R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)}],rows:o,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`desc`))},emptyMessage:`No credit notes match.`,rowKey:(e,t)=>e.id||t,hoverRows:!1})}function Kt({payload:e}){let t=e.customer,n=t.address||{},r=[n.line1,n.line2,n.city,n.state,n.zipCode||n.zip_code,n.country].filter(Boolean).join(`, `),i=t.ship_to_address||{},a=[i.line1,i.line2,i.city,i.state,i.zipCode||i.zip_code,i.country].filter(Boolean).join(`, `);return R(`div`,{className:`space-y-4`,children:[R(`header`,{className:`flex items-start justify-between gap-3`,children:R(`div`,{children:[R(`h2`,{className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:t.name||R(z,{children:`—`})}),R(`div`,{className:`text-secondary mt-0.5 font-mono text-xs`,children:t.id})]})}),R(qt,{children:[R(Z,{label:`External ID`,children:t.external_id?R(`span`,{className:`font-mono text-xs`,children:t.external_id}):R(z,{children:`—`})}),R(Z,{label:`Email`,children:t.email||R(z,{children:`—`})}),R(Z,{label:`Phone`,children:t.phone||R(z,{children:`—`})}),R(Z,{label:`Business Entity`,children:t.business_entity_name?R(`div`,{children:[R(`div`,{children:t.business_entity_name}),t.business_entity_id?R(`div`,{className:`text-muted-foreground font-mono text-[11px] break-all`,children:t.business_entity_id}):null]}):t.business_entity_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.business_entity_id}):R(z,{children:`—`})}),R(Z,{label:`Created`,children:B(t.created_at)}),R(Z,{label:`Updated`,children:B(t.updated_at)})]}),r?R(X,{title:`Primary Address`,children:R(`div`,{className:`text-sm`,children:r})}):null,a&&a!==r?R(X,{title:`Ship-to Address`,children:R(`div`,{className:`text-sm`,children:a})}):null,t.communications_enabled!=null||t.auto_charge_enabled!=null?R(X,{title:`Settings`,children:R(`div`,{className:`flex flex-wrap gap-3 text-sm`,children:[R(Jt,{label:`Communications`,on:t.communications_enabled??null}),R(Jt,{label:`Auto-charge`,on:t.auto_charge_enabled??null})]})}):null,t.default_payment_method?R(X,{title:`Payment Method`,children:R(`div`,{className:`flex items-center gap-2 text-sm`,children:[R(`span`,{className:`bg-muted rounded px-2 py-0.5 text-xs`,children:(t.default_payment_method.type||`unknown`).replace(/_/g,` `)}),t.default_payment_method.brand?R(`span`,{children:t.default_payment_method.brand}):null,t.default_payment_method.last4?R(`span`,{className:`font-mono`,children:[`•••• `,t.default_payment_method.last4]}):null,t.default_payment_method.connector_name?R(`span`,{className:`text-muted-foreground text-xs`,children:[`via `,t.default_payment_method.connector_name]}):null]})}):null,t.tax_info&&t.tax_info.length>0?R(X,{title:`Tax Info`,children:R(`div`,{className:`space-y-1`,children:t.tax_info.map((e,t)=>R(`div`,{className:`flex gap-3 text-sm`,children:[e.tax_code?R(`span`,{className:`bg-muted rounded px-2 py-0.5 text-xs`,children:e.tax_code}):null,e.tax_id?R(`span`,{className:`font-mono text-xs`,children:e.tax_id}):null,e.country_code?R(`span`,{className:`text-muted-foreground text-xs`,children:e.country_code}):null]},t))})}):null,t.contacts&&t.contacts.length>0?R(X,{title:`Contacts (${t.contacts.length})`,children:R(`div`,{className:`space-y-2`,children:t.contacts.map((e,t)=>R(`div`,{className:`border-border flex items-center justify-between rounded border px-3 py-2`,children:[R(`div`,{children:[R(`div`,{className:`text-sm font-medium`,children:e.name||R(z,{children:`—`})}),e.email?R(`div`,{className:`text-muted-foreground text-xs`,children:e.email}):null]}),R(`div`,{className:`flex gap-2`,children:[e.send_invoice?R(`span`,{className:`bg-secondary/20 text-secondary ring-secondary/30 rounded-full px-2 py-0.5 text-xs ring-1`,children:`invoice`}):null,e.send_contract?R(`span`,{className:`bg-secondary/20 text-secondary ring-secondary/30 rounded-full px-2 py-0.5 text-xs ring-1`,children:`contract`}):null]})]},t))})}):null,t.custom_data&&Object.keys(t.custom_data).length>0?R(X,{title:`Custom Data`,children:R(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:Object.entries(t.custom_data).map(([e,t])=>R(`div`,{className:`border-border rounded border px-2 py-1`,children:[R(`div`,{className:`text-muted-foreground`,children:e}),R(`div`,{className:`font-mono`,children:typeof t==`object`?JSON.stringify(t):String(t??``)})]},e))})}):null]})}function qt({children:e}){return R(`div`,{className:`border-border grid grid-cols-1 gap-3 rounded-md border p-3 sm:grid-cols-2`,children:e})}function Jt({label:e,on:t}){return t===null?null:R(`span`,{className:`rounded-full px-2 py-0.5 text-xs ${t?`bg-secondary/20 text-secondary ring-1 ring-secondary/30`:`bg-muted text-muted-foreground ring-1 ring-border`}`,children:[e,`: `,t?`on`:`off`]})}function Yt({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.customers,e=>t===`name`?e.name:e.created_at??null,r),[e.customers,t,r]);return R(K,{title:`Customers`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`external_id`,header:`External ID`,className:`font-mono text-xs`,render:e=>e.external_id||R(z,{children:`—`})},{key:`email`,header:`Email`,className:`text-secondary`,render:e=>e.email||R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/customers/${e.id}/view`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No customers match.`,rowKey:(e,t)=>e.id||t})}function Xt({payload:e}){return R(K,{title:`Entitlements`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Entitlement`,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`entitlement_type`,header:`Type`,className:`text-xs`,render:e=>e.entitlement_type||R(z,{children:`—`})},{key:`units`,header:`Units`,className:`font-mono text-xs`,render:e=>e.units||R(z,{children:`—`})},{key:`product_name`,header:`Product`,className:`text-xs`,render:e=>e.product_name||R(z,{children:`—`})},{key:`is_active`,header:`Status`,className:`text-xs`,render:e=>e.is_active==null?R(z,{children:`—`}):e.is_active?`active`:`inactive`},{key:`created_at`,header:`Created`,className:`whitespace-nowrap`,render:e=>B(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/entitlements/${e.id}/edit`})}],rows:e.entitlements,emptyMessage:`No entitlements match.`,rowKey:(e,t)=>e.id||t})}function Zt({payload:e}){return R(K,{title:`Business Entities`,count:e.total,columns:[{key:`name`,header:`Name`,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`email`,header:`Email`,className:`text-secondary text-xs`,render:e=>e.email||R(z,{children:`—`})},{key:`phone`,header:`Phone`,className:`font-mono text-xs`,render:e=>e.phone_number||R(z,{children:`—`})},{key:`country`,header:`Country`,className:`text-xs`,render:e=>e.country||R(z,{children:`—`})},{key:`default`,header:`Default`,className:`text-xs`,render:e=>e.is_default==null?R(z,{children:`—`}):e.is_default?`yes`:`no`},{key:`view`,header:`View`,render:e=>R(q,{href:`/settings/tax-configuration/entity/${e.id}`})}],rows:e.entities,emptyMessage:`No business entities to show.`,rightHint:null,rowKey:(e,t)=>e.id||t})}function Qt({payload:e}){let t=e.invoice,n=t.currency||`USD`,r=t.due_date&&t.amount_due&&t.amount_due>0?vt(t.due_date):null,i=r!=null&&r>0;return R(`div`,{className:`space-y-4`,children:[R(`header`,{className:`flex items-start justify-between gap-3`,children:[R(`div`,{children:[R(`h2`,{className:`m-0 flex items-center gap-2 text-lg font-semibold`,children:[R(`span`,{className:`font-mono`,children:t.invoice_number||t.id}),t.status?R(G,{status:t.status}):null,i?R(`span`,{className:`bg-destructive/20 text-destructive ring-destructive/30 rounded-full px-2 py-0.5 text-xs ring-1`,children:[r,`d overdue`]}):null]}),R(`div`,{className:`text-secondary mt-0.5 font-mono text-xs`,children:t.id})]}),R(`div`,{className:`flex gap-2`,children:[t.invoice_pdf?R(en,{href:t.invoice_pdf,children:`PDF`}):null,t.payment_url?R(en,{href:t.payment_url,children:`Payment link`}):null]})]}),R(`div`,{className:`border-border grid grid-cols-2 gap-3 rounded-md border p-3 sm:grid-cols-4`,children:[R(Y,{label:`Total`,value:$t(t.invoice_total,n)}),R(Y,{label:`Paid`,value:$t(t.paid_amount,n)}),R(Y,{label:`Due`,value:$t(t.amount_due,n),tone:i?`warn`:void 0}),R(Y,{label:`Period`,value:t.invoice_period_begin&&t.invoice_period_end?R(`span`,{className:`text-sm`,children:[t.invoice_period_begin.slice(0,10),` →`,` `,t.invoice_period_end.slice(0,10)]}):R(z,{children:`—`})})]}),R(`div`,{className:`border-border grid grid-cols-1 gap-3 rounded-md border p-3 sm:grid-cols-2`,children:[R(Z,{label:`Customer`,children:t.customer_name?R(`div`,{children:[R(`div`,{className:`text-sm`,children:t.customer_name}),t.customer_id?R(`div`,{className:`text-muted-foreground font-mono text-[11px] break-all`,children:t.customer_id}):null]}):t.customer_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.customer_id}):R(z,{children:`—`})}),R(Z,{label:`Business Entity`,children:t.business_entity_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.business_entity_id}):R(z,{children:`—`})}),R(Z,{label:`Contract`,children:t.contract_name?R(`div`,{children:[R(`div`,{className:`text-sm`,children:t.contract_name}),t.contract_id?R(`div`,{className:`text-muted-foreground font-mono text-[11px] break-all`,children:t.contract_id}):null]}):t.contract_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:t.contract_id}):R(z,{children:`—`})}),R(Z,{label:`External ID`,children:t.external_id?R(`span`,{className:`font-mono text-xs`,children:t.external_id}):R(z,{children:`—`})}),R(Z,{label:`Created`,children:V(t.created_at)}),R(Z,{label:`Due Date`,children:B(t.due_date)}),R(Z,{label:`Currency`,children:n})]}),t.notes?R(X,{title:`Notes`,children:R(`div`,{className:`max-w-prose text-sm`,children:t.notes})}):null,t.approved_at||t.sent_at||t.paid_at?R(X,{title:`Timeline`,children:R(`div`,{className:`flex flex-wrap gap-4 text-sm`,children:[t.sent_at?R(`div`,{children:[R(`span`,{className:`text-muted-foreground text-xs`,children:`Sent `}),R(`span`,{className:`tabular-nums`,children:V(t.sent_at)})]}):null,t.approved_at?R(`div`,{children:[R(`span`,{className:`text-muted-foreground text-xs`,children:`Approved `}),R(`span`,{className:`tabular-nums`,children:V(t.approved_at)})]}):null,t.paid_at?R(`div`,{children:[R(`span`,{className:`text-muted-foreground text-xs`,children:`Paid `}),R(`span`,{className:`tabular-nums`,children:V(t.paid_at)})]}):null]})}):null,t.custom_data&&Object.keys(t.custom_data).length>0?R(X,{title:`Custom Data`,children:R(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:Object.entries(t.custom_data).map(([e,t])=>R(`div`,{className:`border-border rounded border px-2 py-1`,children:[R(`div`,{className:`text-muted-foreground`,children:e}),R(`div`,{className:`font-mono`,children:typeof t==`object`?JSON.stringify(t):String(t??``)})]},e))})}):null]})}function $t(e,t=`USD`){if(e==null||!Number.isFinite(e))return R(z,{children:`—`});try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:t,maximumFractionDigits:2}).format(e)}catch{return`${t} ${e.toLocaleString()}`}}function en({children:e,href:t}){return R(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`border-border bg-accent text-accent-foreground hover:bg-primary hover:text-primary-foreground rounded border px-3 py-1 text-xs transition-colors`,children:e})}function tn({payload:e}){let t=De(null),[n,r]=F(400),[i,a]=F(!1);return Ee(()=>{if(!(!t.current||!i))try{let e=t.current.contentDocument;if(e?.documentElement){let t=e.documentElement.scrollHeight;t>0&&r(Math.min(t+16,2e3))}}catch{}},[i,e.html]),e.html?R(`div`,{className:`space-y-2`,children:[e.invoice_id?R(`header`,{className:`flex items-baseline gap-2`,children:[R(`h2`,{className:`m-0 text-lg font-semibold`,children:`Invoice Preview`}),R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:e.invoice_id})]}):null,R(`div`,{className:`border-border overflow-hidden rounded-md border`,children:R(`iframe`,{ref:t,title:`Invoice preview`,srcDoc:e.html,onLoad:()=>a(!0),style:{width:`100%`,height:`${n}px`,border:`none`,background:`#fff`},sandbox:`allow-same-origin`})})]}):R(`div`,{className:`text-muted-foreground border-border rounded-md border py-8 text-center`,children:`No preview generated for this invoice yet.`})}function nn({payload:e}){let t=e.currency||`USD`,n=e.lines||[];return R(K,{title:R(S,{children:[`Line Items`,` `,R(`span`,{className:`text-muted-foreground font-normal`,children:[`(`,n.length,`)`]}),e.invoice_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:[` `,`· `,e.invoice_id]}):null]}),rightHint:e.total==null?null:R(`span`,{className:`text-sm`,children:[`Total:`,` `,R(`span`,{className:`font-medium tabular-nums`,children:H(e.total,t)})]}),columns:[{key:`type`,header:`Type`,className:`text-muted-foreground text-xs`,render:e=>R(`div`,{className:`flex items-center gap-1`,children:[e.line_item_type?e.line_item_type.replace(/_/g,` `):R(z,{children:`—`}),e.is_adjustment?R(`span`,{className:`bg-warning/15 text-warning ring-warning/30 rounded-full px-1.5 py-0.5 text-[10px] ring-1`,children:e.adjustment_type||`adj`}):null]})},{key:`item`,header:`Item`,render:e=>R(S,{children:[R(`div`,{className:`font-medium`,children:e.name||R(z,{children:`—`})}),e.description?R(`div`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{key:`pricing_model`,header:`Pricing Model`,className:`text-muted-foreground text-xs`,render:e=>e.pricing_model||R(z,{children:`—`})},{key:`qty`,header:`Qty`,align:`right`,render:e=>e.quantity?.display||(e.quantity?.value??R(z,{children:`—`}))},{key:`price`,header:`Price`,align:`right`,render:e=>e.price?yt(e.price):R(z,{children:`—`})},{key:`subtotal`,header:`Subtotal`,align:`right`,render:e=>R(`span`,{className:e.subtotal?.value!=null&&e.subtotal.value<0?`text-destructive`:``,children:yt(e.subtotal)})},{key:`period`,header:`Service Period`,className:`text-xs whitespace-nowrap`,render:e=>e.service_start_date&&e.service_end_date?R(S,{children:[B(e.service_start_date),` → `,B(e.service_end_date)]}):R(z,{children:`—`})},{key:`billed`,header:`Billed`,className:`text-xs`,render:e=>e.is_billed===!0?`✓`:e.is_billed===!1?`—`:R(z,{children:`?`})}],rows:n,emptyMessage:`No line items on this invoice.`,hoverRows:!1})}function rn({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=e.default_currency||`USD`,o=I(()=>J(e.invoices,e=>{switch(t){case`invoice_number`:return e.invoice_number;case`invoice_total`:return e.invoice_total;case`amount_due`:return e.amount_due;case`due_date`:return e.due_date;case`created_at`:return e.created_at}},r),[e.invoices,t,r]),s=e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`desc`))},c=e=>{if(!e.due_date||!e.amount_due||e.amount_due<=0)return null;let t=vt(e.due_date);return t!=null&&t>0?t:null};return R(K,{title:`Invoices`,count:e.total,scope:e.scope,columns:[{key:`invoice_number`,header:`Invoice`,sortable:!0,className:`font-mono text-xs`,render:e=>e.invoice_number||R(z,{children:`—`})},{key:`customer`,header:`Customer`,className:`text-xs`,render:e=>e.customer_name?e.customer_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.customer_id,10)})},{key:`period`,header:`Period`,className:`text-xs whitespace-nowrap`,render:e=>e.invoice_period_begin&&e.invoice_period_end?`${e.invoice_period_begin.slice(0,10)} → ${e.invoice_period_end.slice(0,10)}`:R(z,{children:`—`})},{key:`status`,header:`Status`,render:e=>R(G,{status:e.status})},{key:`invoice_total`,header:`Total`,sortable:!0,align:`right`,render:e=>H(e.invoice_total,a)},{key:`amount_due`,header:`Due`,sortable:!0,align:`right`,render:e=>R(`span`,{className:c(e)==null?``:`text-destructive font-medium`,children:H(e.amount_due,a)})},{key:`due_date`,header:`Due Date`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.due_date)},{key:`overdue`,header:`Overdue`,align:`right`,render:e=>{let t=c(e);return t==null?R(`span`,{className:`text-muted-foreground`,children:R(z,{children:`—`})}):R(`span`,{className:`text-destructive font-medium`,children:[t,`d`]})}},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/invoices/${e.id}/view`})}],rows:o,sortKey:t,sortDir:r,onSort:s,emptyMessage:`No invoices match.`,rowKey:(e,t)=>e.id||t})}function an({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.jobs,e=>{switch(t){case`name`:return e.name;case`created_at`:return e.created_at;case`status`:return e.status}},r),[e.jobs,t,r]),o=e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`desc`))},s=e.status_counts||{},c=R(`div`,{className:`flex flex-wrap gap-1.5 text-xs`,children:Object.entries(s).map(([e,t])=>R(`span`,{className:`bg-muted rounded-full px-2 py-0.5`,children:[e,`: `,R(`span`,{className:`font-medium tabular-nums`,children:t})]},e))});return R(K,{title:`Jobs`,count:e.total,rightHint:c,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`type`,header:`Type`,className:`text-xs`,render:e=>e.job_type||R(z,{children:`—`})},{key:`resource`,header:`Resource`,className:`text-xs`,render:e=>e.resource||R(z,{children:`—`})},{key:`status`,header:`Status`,sortable:!0,render:e=>R(G,{status:e.status})},{key:`description`,header:`Description`,className:`text-muted-foreground max-w-xs truncate text-xs`,render:e=>e.description||R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`text-xs whitespace-nowrap`,render:e=>V(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/jobs/${e.id}/view`})}],rows:a,sortKey:t,sortDir:r,onSort:o,emptyMessage:`No jobs match.`,rowKey:(e,t)=>e.id||t})}function on({payload:e}){let t=e.default_currency||`USD`,n=e.entries,r=I(()=>{let e=0,t=0;for(let r of n)Number.isFinite(r.total_debit)&&(e+=r.total_debit),Number.isFinite(r.total_credit)&&(t+=r.total_credit);return{d:e,c:t}},[n]),i=R(S,{children:[`Σ debit `,H(r.d,t),` · Σ credit `,H(r.c,t)]});return R(K,{title:`Journal Entries`,count:e.total,scope:e.scope,rightHint:i,columns:[{key:`posted_at`,header:`Posted`,className:`whitespace-nowrap`,render:e=>V(e.posted_at)},{key:`event`,header:`Event`,className:`text-xs`,render:e=>e.event||R(z,{children:`—`})},{key:`status`,header:`Status`,render:e=>R(G,{status:e.status_type})},{key:`lines`,header:`Lines`,align:`right`,render:e=>e.line_count??R(z,{children:`—`})},{key:`total_debit`,header:`Σ Debit`,align:`right`,render:e=>e.total_debit==null?R(z,{children:`—`}):H(e.total_debit,e.currency||t)},{key:`total_credit`,header:`Σ Credit`,align:`right`,render:e=>e.total_credit==null?R(z,{children:`—`}):H(e.total_credit,e.currency||t)},{key:`description`,header:`Description`,className:`text-muted-foreground max-w-xs truncate text-xs`,render:e=>e.description||R(z,{children:`—`})}],rows:n,emptyMessage:`No entries match.`,rowKey:(e,t)=>e.id||t,hoverRows:!1})}function sn({payload:e}){let t=e.payment_methods||[];return R(`div`,{className:`space-y-3`,children:[R(`header`,{className:`flex items-baseline justify-between gap-3`,children:R(`h2`,{className:`m-0 text-lg font-semibold`,children:[`Payment Methods`,` `,R(`span`,{className:`text-muted-foreground text-sm font-normal`,children:[`(`,t.length,`)`]}),e.customer_id?R(`span`,{className:`text-secondary font-mono text-xs break-all`,children:[` `,`· `,e.customer_id]}):null]})}),t.length===0?R(`div`,{className:`text-muted-foreground border-border rounded-md border py-8 text-center`,children:`No payment methods saved.`}):R(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:t.map((e,t)=>R(cn,{method:e},e.id||t))})]})}function cn({method:e}){let t=(e.type||``).toLowerCase().includes(`card`);return R(`article`,{className:`space-y-1 rounded-md border p-3 ${e.is_default?`border-ring ring-ring ring-1`:`border-border`}`,children:[R(`header`,{className:`flex items-baseline justify-between gap-2`,children:[R(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[R(`span`,{className:`bg-muted rounded px-2 py-0.5 text-xs`,children:(e.type||`unknown`).replace(/_/g,` `)}),e.brand?R(`span`,{className:`text-muted-foreground`,children:e.brand}):null,e.connector_name?R(`span`,{className:`text-muted-foreground text-xs`,children:[`via `,e.connector_name]}):null]}),e.is_default?R(`span`,{className:`bg-secondary/20 text-secondary ring-secondary/30 rounded-full px-2 py-0.5 text-xs ring-1`,children:`default`}):null]}),R(`div`,{className:`font-mono text-sm`,children:e.last4?`•••• ${e.last4}`:R(z,{children:`—`})}),R(`div`,{className:`text-muted-foreground flex gap-3 text-xs`,children:[e.status?R(`span`,{className:`rounded-full px-2 py-0.5 text-xs ring-1 ${e.status===`valid`?`bg-secondary/20 text-secondary ring-secondary/30`:`bg-destructive/20 text-destructive ring-destructive/30`}`,children:e.status}):null,t&&e.exp_month&&e.exp_year?R(`span`,{children:[`exp `,String(e.exp_month).padStart(2,`0`),`/`,String(e.exp_year).slice(-2)]}):null,e.created_at?R(`span`,{children:[`added `,B(e.created_at)]}):null]})]})}var ln={payment:`bg-secondary/20 text-secondary ring-1 ring-secondary/30`,refund:`bg-accent text-accent-foreground ring-1 ring-border`,payment_reversal:`bg-destructive/20 text-destructive ring-1 ring-destructive/30`,authorization:`bg-primary/20 text-primary ring-1 ring-primary/30`,tax_withheld:`bg-muted text-muted-foreground ring-1 ring-border`},un=`bg-muted text-muted-foreground ring-1 ring-border`;function dn({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=e.default_currency||`USD`,o=I(()=>J(e.payments,e=>{switch(t){case`amount`:return e.amount;case`payment_date`:return e.payment_date;case`created_at`:return e.created_at;case`type`:return e.type}},r),[e.payments,t,r]);return R(K,{title:`Payments`,count:e.total,scope:e.scope,columns:[{key:`external_id`,header:`External ID`,className:`font-mono text-xs`,render:e=>e.external_id||R(z,{children:`—`})},{key:`customer`,header:`Customer`,className:`text-xs`,render:e=>e.customer_name?e.customer_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.customer_id,10)})},{key:`invoice`,header:`Invoice`,className:`text-xs`,render:e=>e.invoice_name?e.invoice_name:R(`span`,{className:`text-secondary font-mono`,children:U(e.invoice_id,10)})},{key:`type`,header:`Type`,sortable:!0,render:e=>e.type?R(`span`,{className:`inline-block rounded-full px-2 py-0.5 text-xs ${ln[e.type]||un}`,children:e.type}):R(z,{children:`—`})},{key:`method`,header:`Method`,className:`text-xs`,render:e=>e.payment_method||R(z,{children:`—`})},{key:`status`,header:`Status`,render:e=>R(G,{status:e.status})},{key:`amount`,header:`Amount`,sortable:!0,align:`right`,render:e=>{let t=e.amount!=null&&e.amount<0,n=e.type===`refund`||e.type===`payment_reversal`;return R(`span`,{className:t||n?`text-destructive`:``,children:H(e.amount,e.currency||a)})}},{key:`payment_date`,header:`Date`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.payment_date)},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)}],rows:o,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(`desc`))},emptyMessage:`No payments match.`,rowKey:(e,t)=>e.id||t,hoverRows:!1})}function fn({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.plans,e=>t===`name`?e.name:e.created_at,r),[e.plans,t,r]);return R(K,{title:`Plans`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`description`,header:`Description`,className:`text-muted-foreground text-xs`,render:e=>e.description||R(z,{children:`—`})},{key:`status`,header:`Status`,render:e=>R(G,{status:e.status})},{key:`plan_version`,header:`Version`,align:`right`,render:e=>e.plan_version??R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/plansv2/${e.id}/edit`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No plans match.`,rowKey:(e,t)=>e.id||t})}function pn({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.products,e=>t===`name`?e.name:e.created_at,r),[e.products,t,r]);return R(K,{title:`Products`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`sku`,header:`SKU`,className:`font-mono text-xs`,render:e=>e.sku||R(z,{children:`—`})},{key:`type`,header:`Type`,className:`text-xs`,render:e=>e.product_type||R(z,{children:`—`})},{key:`active`,header:`Active`,className:`text-xs`,render:e=>e.is_active==null?R(z,{children:`—`}):e.is_active?`yes`:`no`},{key:`description`,header:`Description`,className:`text-muted-foreground text-xs`,render:e=>e.description||R(z,{children:`—`})},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>V(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/products/${e.id}/edit`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No products match.`,rowKey:(e,t)=>e.id||t})}function mn({payload:e}){let[t,n]=F(`created_at`),[r,i]=F(`desc`),a=I(()=>J(e.raw_metrics,e=>t===`name`?e.name:e.created_at,r),[e.raw_metrics,t,r]);return R(K,{title:`Raw Metrics`,count:e.total,scope:e.scope,columns:[{key:`name`,header:`Name`,sortable:!0,className:`font-medium`,render:e=>e.name||R(z,{children:`—`})},{key:`api_slug`,header:`API Slug`,className:`font-mono text-xs`,render:e=>e.api_slug||R(z,{children:`—`})},{key:`upload`,header:`Upload Enabled`,className:`text-xs`,render:e=>e.usage_upload_enabled==null?R(z,{children:`—`}):e.usage_upload_enabled?`yes`:`no`},{key:`created_at`,header:`Created`,sortable:!0,className:`whitespace-nowrap`,render:e=>B(e.created_at)},{key:`view`,header:`View`,render:e=>R(q,{href:`/meters/raw-metrics/${e.id}/view`})}],rows:a,sortKey:t,sortDir:r,onSort:e=>{e===t?i(e=>e===`asc`?`desc`:`asc`):(n(e),i(e===`name`?`asc`:`desc`))},emptyMessage:`No raw metrics match.`,rowKey:(e,t)=>e.id||t})}var hn={name:`Zenskar`,version:`1.0.0`},gn=`2026-01-26`,_n={listCustomers:{fallback:{customers:[],total:0},marker:`customer-table:mounted`,render:e=>R(Yt,{payload:e})},listInvoices:{fallback:{invoices:[],total:0},marker:`invoice-table:mounted`,render:e=>R(rn,{payload:e})},getInvoiceLineItems:{fallback:{lines:[]},marker:`invoice-line-items:mounted`,render:e=>R(nn,{payload:e})},listAllPayments:{fallback:{payments:[],total:0},marker:`payment-table:mounted`,render:e=>R(dn,{payload:e})},listCreditNotes:{fallback:{credit_notes:[],total:0},marker:`credit-note-table:mounted`,render:e=>R(Gt,{payload:e})},listContracts:{fallback:{contracts:[],total:0},marker:`contract-table:mounted`,render:e=>R(Ut,{payload:e})},getCustomerById:{fallback:{customer:{id:``}},marker:`customer-detail:mounted`,render:e=>R(Kt,{payload:e})},getInvoiceById:{fallback:{invoice:{id:``}},marker:`invoice-detail:mounted`,render:e=>R(Qt,{payload:e})},getContractById:{fallback:{contract:{id:``},phases:[]},marker:`contract-detail:mounted`,render:e=>R(Pt,{payload:e})},getCreditNoteById:{fallback:{credit_note:{id:``}},marker:`credit-note-detail:mounted`,render:e=>R(Wt,{payload:e})},listProducts:{fallback:{products:[],total:0},marker:`product-table:mounted`,render:e=>R(pn,{payload:e})},listPlans:{fallback:{plans:[],total:0},marker:`plan-table:mounted`,render:e=>R(fn,{payload:e})},listJournalEntries:{fallback:{entries:[],total:0},marker:`journal-table:mounted`,render:e=>R(on,{payload:e})},listJobs:{fallback:{jobs:[],total:0},marker:`job-table:mounted`,render:e=>R(an,{payload:e})},listContacts:{fallback:{contacts:[],total:0},marker:`contact-table:mounted`,render:e=>R(Mt,{payload:e})},listRawMetrics:{fallback:{raw_metrics:[],total:0},marker:`raw-metric-table:mounted`,render:e=>R(mn,{payload:e})},listAggregates:{fallback:{aggregates:[],total:0},marker:`aggregate-table:mounted`,render:e=>R(jt,{payload:e})},listCustomerAddresses:{fallback:{addresses:[]},marker:`address-list:mounted`,render:e=>R(Ot,{payload:e})},listPaymentMethods:{fallback:{payment_methods:[]},marker:`payment-method-list:mounted`,render:e=>R(sn,{payload:e})},listBusinessEntities:{fallback:{entities:[]},marker:`entity-table:mounted`,render:e=>R(Zt,{payload:e})},listEntitlements:{fallback:{entitlements:[],total:0},marker:`entitlement-table:mounted`,render:e=>R(Xt,{payload:e})},getInvoicePreviewHtml:{fallback:{html:``},marker:`invoice-preview:mounted`,render:e=>R(tn,{payload:e})}};function vn(){return typeof window>`u`?null:window.openai??null}function yn(){let e=vn(),[t,n]=F(e?.toolInput?.toolName??null),[r,i]=F(e?.toolOutput??null),a=De(null);if(Ee(()=>{let e=pt(`ui/notifications/tool-result`,e=>{let t=e;t&&Object.prototype.hasOwnProperty.call(t,`structuredContent`)&&i(t.structuredContent??null)}),t=pt(`ui/notifications/host-context-changed`,e=>{let t=e?.toolInfo?.tool?.name;typeof t==`string`&&n(t)});return lt(`ui/initialize`,{appCapabilities:{},appInfo:hn,protocolVersion:gn}).then(e=>{let t=e?.hostContext?.toolInfo?.tool?.name;typeof t==`string`&&n(t),ut(`ui/notifications/initialized`)}).catch(()=>{}),()=>{e(),t()}},[]),Ee(()=>{let e=e=>{let t=e?.detail?.globals;t&&(t.toolInput?.toolName&&n(t.toolInput.toolName),Object.prototype.hasOwnProperty.call(t,`toolOutput`)&&i(t.toolOutput??null))};return window.addEventListener(`openai:set_globals`,e,{passive:!0}),()=>{window.removeEventListener(`openai:set_globals`,e)}},[]),Ee(()=>{if(r===null||!t)return;let e=_n[t];if(e?.marker&&ut(`ui/message`,{hidden:!0,marker:e.marker}),!a.current)return;let n=()=>{let e=a.current.getBoundingClientRect();ut(`ui/notifications/size-changed`,{width:Math.round(e.width),height:Math.round(e.height)})};n();let i=new ResizeObserver(n);return i.observe(a.current),()=>i.disconnect()},[r,t]),!t||!_n[t])return R(`div`,{"data-app-loading":!0,style:{visibility:`hidden`,minHeight:1}});let o=_n[t];if(r===null&&!e?.toolOutput)return R(`div`,{"data-app-loading":!0,style:{visibility:`hidden`,minHeight:1}});let s=r??o.fallback;return R(`div`,{ref:a,className:`text-foreground bg-background p-4 font-sans text-[14px]`,children:o.render(s)})}var bn=document.getElementById(`root`);bn&&ot(bn).render(R(S,{children:R(yn,{})}));</script>
8
8
  <style rel="stylesheet" crossorigin>/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
9
9
  @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:var(--font-sans);--font-serif:var(--font-serif);--font-mono:var(--font-mono);--spacing:.25rem;--container-xs:20rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:var(--tracking-normal);--leading-relaxed:1.625;--shadow-2xs:var(--shadow-2xs);--shadow-xs:var(--shadow-xs);--shadow-sm:var(--shadow-sm);--shadow-md:var(--shadow-md);--shadow-lg:var(--shadow-lg);--shadow-xl:var(--shadow-xl);--shadow-2xl:var(--shadow-2xl);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow:var(--shadow)}}@layer base{*,:after,:before{box-sizing:border-box;border:0 solid;margin:0;padding:0}::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}body{background-color:var(--background);color:var(--foreground);letter-spacing:var(--tracking-normal)}h1,h2,h3{letter-spacing:-.005em;line-height:1.2}}@layer components;@layer utilities{.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.fixed{position:fixed}.sticky{position:sticky}.top-0{top:calc(var(--spacing) * 0)}.z-10{z-index:10}.col-span-full{grid-column:1/-1}.m-0{margin:calc(var(--spacing) * 0)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.max-h-48{max-height:calc(var(--spacing) * 48)}.min-h-screen{min-height:100vh}.w-12{width:calc(var(--spacing) * 12)}.w-full{width:100%}.max-w-\[1100px\]{max-width:1100px}.max-w-prose{max-width:65ch}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-2\.5{row-gap:calc(var(--spacing) * 2.5)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-border,.border-border\/50{border-color:var(--border)}@supports (color:color-mix(in lab, red, red)){.border-border\/50{border-color:color-mix(in oklab, var(--border) 50%, transparent)}}.border-ring{border-color:var(--ring)}.bg-accent{background-color:var(--accent)}.bg-background{background-color:var(--background)}.bg-card{background-color:var(--card)}.bg-destructive\/20{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\/20{background-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-primary\/20{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\/20{background-color:color-mix(in oklab, var(--primary) 20%, transparent)}}.bg-secondary\/12{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.bg-secondary\/12{background-color:color-mix(in oklab, var(--secondary) 12%, transparent)}}.bg-secondary\/20{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.bg-secondary\/20{background-color:color-mix(in oklab, var(--secondary) 20%, transparent)}}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-8{padding-block:calc(var(--spacing) * 8)}.pr-2{padding-right:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[14px\]{font-size:14px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:calc(var(--tracking-normal) + .025em);letter-spacing:calc(var(--tracking-normal) + .025em)}.break-words,.wrap-break-word{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-accent-foreground{color:var(--accent-foreground)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-primary{color:var(--primary)}.text-secondary{color:var(--secondary)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-border{--tw-ring-color:var(--border)}.ring-destructive\/30{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.ring-destructive\/30{--tw-ring-color:color-mix(in oklab, var(--destructive) 30%, transparent)}}.ring-primary\/30{--tw-ring-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.ring-primary\/30{--tw-ring-color:color-mix(in oklab, var(--primary) 30%, transparent)}}.ring-ring{--tw-ring-color:var(--ring)}.ring-secondary\/20{--tw-ring-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.ring-secondary\/20{--tw-ring-color:color-mix(in oklab, var(--secondary) 20%, transparent)}}.ring-secondary\/30{--tw-ring-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.ring-secondary\/30{--tw-ring-color:color-mix(in oklab, var(--secondary) 30%, transparent)}}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.select-none{-webkit-user-select:none;user-select:none}.\[mock-host\:postMessage\]{mock-host:postMessage}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}@media (hover:hover){.hover\:bg-muted\/60:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-muted\/60:hover{background-color:color-mix(in oklab, var(--muted) 60%, transparent)}}.hover\:bg-primary:hover{background-color:var(--primary)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-primary-foreground:hover{color:var(--primary-foreground)}.hover\:text-secondary\/80:hover{color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:text-secondary\/80:hover{color:color-mix(in oklab, var(--secondary) 80%, transparent)}}}@media (min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}:root{--background:#fff;--foreground:#111827;--card:#fff;--card-foreground:#111827;--popover:#fff;--popover-foreground:#111827;--primary:#d87943;--primary-foreground:#fff;--secondary:#527575;--secondary-foreground:#fff;--muted:#f3f4f6;--muted-foreground:#6b7280;--accent:#eee;--accent-foreground:#111827;--destructive:#ef4444;--destructive-foreground:#fafafa;--border:#e5e7eb;--input:#e5e7eb;--ring:#d87943;--chart-1:#5f8787;--chart-2:#e78a53;--chart-3:#fbcb97;--chart-4:#888;--chart-5:#999;--sidebar:#f3f4f6;--sidebar-foreground:#111827;--sidebar-primary:#d87943;--sidebar-primary-foreground:#fff;--sidebar-accent:#fff;--sidebar-accent-foreground:#111827;--sidebar-border:#e5e7eb;--sidebar-ring:#d87943;--font-sans:Figtree, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--font-serif:serif;--font-mono:JetBrains Mono, monospace;--radius:.75rem;--shadow-x:0px;--shadow-y:1px;--shadow-blur:4px;--shadow-spread:0px;--shadow-opacity:.05;--shadow-color:#000;--shadow-2xs:0px 1px 4px 0px #00000008;--shadow-xs:0px 1px 4px 0px #00000008;--shadow-sm:0px 1px 4px 0px #0000000d, 0px 1px 2px -1px #0000000d;--shadow:0px 1px 4px 0px #0000000d, 0px 1px 2px -1px #0000000d;--shadow-md:0px 1px 4px 0px #0000000d, 0px 2px 4px -1px #0000000d;--shadow-lg:0px 1px 4px 0px #0000000d, 0px 4px 6px -1px #0000000d;--shadow-xl:0px 1px 4px 0px #0000000d, 0px 8px 10px -1px #0000000d;--shadow-2xl:0px 1px 4px 0px #00000021;--tracking-normal:0rem;--spacing:.25rem}.dark{--background:#121113;--foreground:#c1c1c1;--card:#121212;--card-foreground:#c1c1c1;--popover:#121113;--popover-foreground:#c1c1c1;--primary:#e78a53;--primary-foreground:#121113;--secondary:#5f8787;--secondary-foreground:#121113;--muted:#222;--muted-foreground:#888;--accent:#333;--accent-foreground:#c1c1c1;--destructive:#5f8787;--destructive-foreground:#121113;--border:#222;--input:#222;--ring:#e78a53;--chart-1:#5f8787;--chart-2:#e78a53;--chart-3:#fbcb97;--chart-4:#888;--chart-5:#999;--sidebar:#121212;--sidebar-foreground:#c1c1c1;--sidebar-primary:#e78a53;--sidebar-primary-foreground:#121113;--sidebar-accent:#333;--sidebar-accent-foreground:#c1c1c1;--sidebar-border:#222;--sidebar-ring:#e78a53;--font-sans:Figtree, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--font-serif:serif;--font-mono:JetBrains Mono, monospace;--radius:.75rem;--shadow-x:0px;--shadow-y:1px;--shadow-blur:4px;--shadow-spread:0px;--shadow-opacity:.05;--shadow-color:#000;--shadow-2xs:0px 1px 4px 0px #00000008;--shadow-xs:0px 1px 4px 0px #00000008;--shadow-sm:0px 1px 4px 0px #0000000d, 0px 1px 2px -1px #0000000d;--shadow:0px 1px 4px 0px #0000000d, 0px 1px 2px -1px #0000000d;--shadow-md:0px 1px 4px 0px #0000000d, 0px 2px 4px -1px #0000000d;--shadow-lg:0px 1px 4px 0px #0000000d, 0px 4px 6px -1px #0000000d;--shadow-xl:0px 1px 4px 0px #0000000d, 0px 8px 10px -1px #0000000d;--shadow-2xl:0px 1px 4px 0px #00000021}:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial}:root:not(.light){--background:#121113;--foreground:#c1c1c1;--card:#121212;--card-foreground:#c1c1c1;--popover:#121113;--popover-foreground:#c1c1c1;--primary:#e78a53;--primary-foreground:#121113;--secondary:#5f8787;--secondary-foreground:#121113;--muted:#222;--muted-foreground:#888;--accent:#333;--accent-foreground:#c1c1c1;--destructive:#5f8787;--destructive-foreground:#121113;--border:#222;--input:#222;--ring:#e78a53;--chart-1:#5f8787;--chart-2:#e78a53;--chart-3:#fbcb97;--chart-4:#888;--chart-5:#999;--sidebar:#121212;--sidebar-foreground:#c1c1c1;--sidebar-primary:#e78a53;--sidebar-primary-foreground:#121113;--sidebar-accent:#333;--sidebar-accent-foreground:#c1c1c1;--sidebar-border:#222;--sidebar-ring:#e78a53}}html,body{font-family:var(--font-sans);margin:0;font-size:14px;line-height:1.5}table{border-collapse:collapse}.tabular-nums{font-variant-numeric:tabular-nums}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
10
10
  /*$vite$:1*/</style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-zenskar",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Model Context Protocol (MCP) server for Zenskar API - customer management, invoicing, and billing operations",
5
5
  "type": "module",
6
6
  "main": "dist/server.mjs",