tencil 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/cli.mjs +19 -467
- package/dist/{cloud-jOobzTY9.d.mts → cloud-DPNrsIER.d.mts} +1 -1
- package/dist/{index-BRcZL2Ov.d.mts → index-C4SmNUQW.d.mts} +22 -1
- package/dist/index.d.mts +53 -5
- package/dist/index.mjs +1 -1
- package/dist/{loader-BevujQ44.mjs → loader-th3V-C7L.mjs} +7 -2
- package/dist/next.d.mts +6 -3
- package/dist/next.mjs +17 -3
- package/dist/overlay.global.js +44 -23
- package/dist/react.d.mts +1 -1
- package/dist/react.mjs +2 -2
- package/dist/{server-1L4Fi2wN.mjs → server-Cbvie3Om.mjs} +882 -13
- package/dist/source-attributes-Cs2NvuxG.mjs +151 -0
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +3 -151
- package/package.json +5 -5
package/dist/overlay.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n,r,i,a,o,s,c,l,u,d,f,p,m,h={},g=[],_=/^m(i|n|o|s|text|space)$/,v=Array.isArray,y=g.slice,b=Object.assign;function ee(e){e&&e.parentNode&&e.remove()}function te(e,t,n){var r,i,a,o={},s=arguments.length;for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return s>2&&(o.children=s>3?y.call(arguments,2):n),x(e,o,r,i,null)}function x(e,t,i,a,o){var s={type:e,props:t,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o||++r,__i:-1,__u:0};return!o&&n.vnode&&n.vnode(s),s}function S(e){return e.children}function C(e,t){this.props=e,this.context=t,this.__g=0}function ne(e,t){if(t==null)return e.__?ne(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!=`function`||e.props.__P?null:ne(e)}function w(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),w(e)}function T(e){(8&e.__g||!(e.__g|=8)||!a.push(e)||s++)&&o==n.debounceRendering||((o=n.debounceRendering)||queueMicrotask)(re)}function re(){var e,t,r,i,o,l,u,d,f;try{for(t=1;a.length;)a.length>t&&a.sort(c),e=a.shift(),t=a.length,8&e.__g&&(i=void 0,o=void 0,l=(o=(r=e).__v).__e,u=[],d=[],(f=r.__P)&&((i=b({constructor:void 0},o)).__v=o.__v+1,n.vnode&&n.vnode(i),E(f,i,o,r.__n,f.namespaceURI,32&o.__u?[l]:null,u,l||ne(o),32&o.__u,d),i.__v=o.__v,i.__.__k[i.__i]=i,fe(u,i,d),o.__=o.__e=null,i.__e!=l&&w(i)))}finally{a.length=s=0}}function ie(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,_,v,y=r.__k||g,b=t.length;for(c=ae(n,t,y,c,b),d=0;d<b;d++)(p=n.__k[d])!=null&&(f=~p.__i&&y[p.__i]||h,p.__i=d,v=E(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&(f.ref!=p.ref||8&f.__u)&&(f.ref!=p.ref&&f.ref&&D(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_||=m,4&p.__u?(c=oe(p,c,e,!f.__v),f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function ae(e,t,n,r,i){var a,o,s,c,l,u,d,f,p,m,h=n.length,g=h,_=0,y=!1,b=e.__k=Array(i);for(a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o!=`object`||o.constructor==String?o=b[a]=x(null,o):v(o)?o=b[a]=x(S,{children:o}):o.constructor===void 0&&o.__b?o=b[a]=x(o.type,o.props,o.key,o.ref,o.__v):b[a]=o,c=a+_,o.__=e,o.__b=e.__b+1,s=null,~(l=o.__i=se(o,n,c,g))&&(g--,(s=n[l])&&(s.__u|=2)),s&&s.__v?(o.__u|=2,l==c-1?_--:l==c+1?_++:l!=c&&(l>c?_--:_++,y=!0)):(~l||(i>h?_--:i<h&&_++),typeof o.type!=`function`&&(o.__u|=4))):b[a]=null;if(y){for(u=[],d=[],a=0;a<i;a++)if((o=b[a])&&2&o.__u){for(f=0,p=u.length;f<p;)u[m=f+p>>1]<o.__i?f=m+1:p=m;u[f]=o.__i,d[a]=f+1}for(_=u.length;a--;)d[a]&&(d[a]==_?_--:b[a].__u|=4)}if(g)for(a=0;a<h;a++)!(s=n[a])||2&s.__u||(s.__e==r&&(r=ne(s)),me(s,s));return r}function oe(e,t,n,r){var i,a;if(typeof e.type==`function`){if(e.props.__P)return t;if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&(i[a].__=e,t=oe(i[a],t,n,!1));return t}for(t&&!t.parentNode&&(t=ne(e))&&!t.parentNode&&(t=null),e.__e!=t&&(!r&&n.moveBefore&&e.__e.parentNode?n.moveBefore(e.__e,t):n.insertBefore(e.__e,t||null)),t=e.__e;(t&&=t.nextSibling)&&t.nodeType==8;);return t}function se(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l&&!(2&l.__u);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++])&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ce(e,t,n){n??=``,t[0]==`-`?e.setProperty(t,n):e[t]=n}function le(e,t,n,r,i){var a;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||ce(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ce(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(d,`$1`)),(t=t.slice(2))[0]<`a`&&(t=t.toLowerCase()),(e.__e||={})[t+a]=n,n?r?n[u]=r[u]:(n[u]=f,e.addEventListener(t,a?m:p,a)):e.removeEventListener(t,a?m:p,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 ue(e){return function(t){if(this.__e){var r=this.__e[t.type+e];if(t[l]==null)t[l]=f++;else if(t[l]<r[u])return;return r(n.event?n.event(t):t)}}}function E(e,t,r,i,a,o,s,c,l,u){var d,f,p,m,h,_,y,te,x,w,T,re,ae,oe,se,ce,le,ue,E,fe,D=t.type;if(t.constructor!==void 0)return null;if(128&r.__u&&(l=32&r.__u,d=r.__c.__z)){if(t.__u|=l,f=o=[],d.nodeType==8)for(p=1,m=d.nextSibling;m;m=m.nextSibling){if(m.nodeType==8){if(m.data.startsWith(`$s`))p++;else if(m.data.startsWith(`/$s`)&&!--p)break}o.push(m)}else o.push(d);c=o[0]}(d=n.__b)&&d(t);n:if(typeof D==`function`){h=s.length;try{if(w=t.props,T=(d=D.prototype)&&d.render,re=(d=D.contextType)&&i[d.__c],ae=d?re?re.props.value:d.__:i,r.__c?2&(_=t.__c=r.__c).__g&&(_.__g|=1):(T?t.__c=_=new D(w,ae):(t.__c=_=new C(w,ae),_.constructor=D,_.render=he),re&&re.sub(_),_.state||(_.state={}),_.__n=i,_.__g|=8,_.__h=[],_.__k=[]),T&&(_.__s||(_.__s=_.state),D.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=b({},_.__s)),b(_.__s,D.getDerivedStateFromProps(w,_.__s)))),y=_.props,te=_.state,_.__v=t,r.__c){if(T&&!D.getDerivedStateFromProps&&w!==y&&_.componentWillReceiveProps&&_.componentWillReceiveProps(w,ae),t.__v==r.__v&&!(8&_.__g)||!(4&_.__g)&&_.shouldComponentUpdate&&!1===_.shouldComponentUpdate(w,_.__s,ae)){t.__v!=r.__v&&(_.props=w,_.state=_.__s,_.__g&=-9),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(_.__h,_.__k),_.__k=[],_.__h.length&&s.push(_),c=ne(r);break n}_.componentWillUpdate&&_.componentWillUpdate(w,_.__s,ae),T&&_.componentDidUpdate&&_.__h.push(function(){_.componentDidUpdate(y,te,x)})}else T&&!D.getDerivedStateFromProps&&_.componentWillMount&&_.componentWillMount(),T&&_.componentDidMount&&_.__h.push(_.componentDidMount);if(_.context=ae,_.props=w,_.__P=e,_.__g&=-5,oe=n.__r,se=0,T)_.state=_.__s,_.__g&=-9,oe&&oe(t),d=_.render(_.props,_.state,_.context),g.push.apply(_.__h,_.__k),_.__k=[];else do _.__g&=-9,oe&&oe(t),d=_.render(_.props,_.state,_.context),_.state=_.__s;while(8&_.__g&&++se<25);_.state=_.__s,_.getChildContext&&(i=b({},i,_.getChildContext())),T&&r.__c&&_.getSnapshotBeforeUpdate&&(x=_.getSnapshotBeforeUpdate(y,te)),ce=d&&d.type===S&&d.key==null?d.props.children:d,w.__P&&(d=c,a=(e=w.__P).namespaceURI,l=o=null,r.props&&r.props.__P!=e&&(r.__k.some(function(e){e&&me(e,e)}),r.__k=null),c=r.__k?ne(r,0):null),c=ie(e,v(ce)?ce:[ce],t,r,i,a,o,s,c,l,u),w.__P&&(t.__e=null,c=d),t.__u&=-161,128&r.__u&&(_.__z=null),f&&f.some(ee),_.__h.length&&s.push(_),1&_.__g&&(_.__g&=-4)}catch(e){if(s.length=h,t.__v=null,l||o){if(e.then){if(le=0,t.__u|=l?160:128,o){for(E=0;E<o.length;E++)if(fe=o[E]){if(fe.nodeType==8){if(o[E]=null,fe.data.startsWith(`$s`))le++||(ue=fe);else if(fe.data.startsWith(`/$s`)&&!--le){c=fe;break}}else le&&(o[E]=null)}}if(!ue){for(;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o&&(o[o.indexOf(c)]=null),ue=c}t.__c.__z||(t.__c.__z=ue),t.__e=c}else o&&o.some(ee)}else t.__e=r.__e;t.__k||=r.__k||[],e.then||de(t),n.__e(e,t,r)}}else c=t.__e=pe(r.__e,t,r,i,a,o,s,l,u,e);return(d=n.diffed)&&d(t),128&t.__u?void 0:c}function de(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(de))}function fe(e,t,r){for(var i=0;i<r.length;)D(r[i++],r[i++],r[i++]);n.__c&&n.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){n.__e(e,t.__v)}})}function pe(e,t,r,i,a,o,s,c,l,u){var d,f,p,m,g,b,te,x,S,C=r.props||h,w=t.props,T=t.type;if(T==`svg`?a=`http://www.w3.org/2000/svg`:T==`math`?a=`http://www.w3.org/1998/Math/MathML`:a||=`http://www.w3.org/1999/xhtml`,o){for(d=0;d<o.length;d++)if((g=o[d])&&(T?g.localName==T:g.nodeType==3)){e=g,o[d]=null;break}}if(!e){if(x=u.ownerDocument||document,!T)return x.createTextNode(w);e=x.createElementNS(a,T,w.is&&w),c&&=(n.__m&&n.__m(t,o),!1),o=null}if(T){if(u=T==`template`?e.content:e,o=T==`textarea`&&w.defaultValue!=null?null:o&&y.call(u.childNodes),!c&&o)for(C={},d=0;d<e.attributes.length;d++)C[(g=e.attributes[d]).name]=g.value;for(d in C)g=C[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in w||d==`value`&&`defaultValue`in w||d==`checked`&&`defaultChecked`in w||le(e,d,null,g,a);for(d in S=1&r.__u,w)g=w[d],d==`children`?m=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?b=g:d==`checked`?te=g:c&&typeof g!=`function`||!(C[d]!==g||S&&g!=null)||le(e,d,g,C[d],a);f?(c||p&&(f.__html==p.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[]):(p&&(e.textContent=``),(T==`foreignObject`||a==`http://www.w3.org/1998/Math/MathML`&&_.test(T))&&(a=`http://www.w3.org/1999/xhtml`),ie(u,v(m)?m:[m],t,r,i,a,o,s,o?o[0]:r.__k&&ne(r,0),c,l),o&&o.some(ee)),c&&T!=`textarea`||(d=`value`,T==`progress`&&b==null?e.removeAttribute(d):b==null||b===e[d]&&(T!=`progress`||b)||le(e,d,b,C[d],a),d=`checked`,te!=null&&te!=e[d]&&le(e,d,te,C[d],a))}else C===w||c&&e.data==w||(e.data=w);return e}function D(e,t,r){try{typeof e==`function`?(typeof e.__u==`function`&&e.__u(),(typeof e.__u!=`function`||t)&&(e.__u=e(t))):e.current=t}catch(e){n.__e(e,r)}}function me(e,t,r){var i,a;if(n.unmount&&n.unmount(e),!(i=e.ref)||i.current&&i.current!=e.__e||D(i,null,t),i=e.__c){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){n.__e(e,t)}i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&me(i[a],t,typeof e.type!=`function`||r&&!e.props.__P);(i=e.__e)&&(r||ee(i),i.__e&&(i.__e=null)),e.__e=e.__c=e.__=null}function he(e,t,n){return this.constructor(e,n)}function ge(e,t){var r,i,a,o;n.__&&n.__(e,t),t.nodeType==9&&(t=t.documentElement),i=(r=e&&32&e.__u)?null:t.__k,t.__k=x(S,{children:[e]}),a=[],o=[],E(t,t.__k,i||h,h,t.namespaceURI,i?null:t.firstChild?y.call(t.childNodes):null,a,i?i.__e:t.firstChild,r,o),fe(a,t.__k,o),t.__k.props.children=null}n={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t,o=0}}throw s=0,e}},r=0,i=function(e){return e!=null&&e.constructor===void 0},C.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=b({},this.state)),typeof e==`function`&&(e=e(b({},n),this.props)),e&&(b(n,e),this.__v&&(t&&this.__k.push(t),T(this)))},C.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),T(this))},C.prototype.render=S,a=[],s=0,c=function(e,t){return e.__v.__b-t.__v.__b},l=Symbol(),u=Symbol(),d=/(PointerCapture)$|Capture$/i,f=0,p=ue(!1),m=ue(!0);var _e,O,ve,ye,be=Object.is,xe=0,Se=[],Ce=[],k=n,we=k.__b,Te=k.__r,Ee=k.diffed,De=k.__c,Oe=k.unmount,ke=k.__;function Ae(e,t){k.__h&&k.__h(O,e,xe||t),xe=0;var n=O.__H||(O.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function A(e){return xe=1,je(He,e)}function je(e,t,n){var r=Ae(_e++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):He(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);be(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=O,!O.__f)){O.__f=!0;var i=O.shouldComponentUpdate;O.shouldComponentUpdate=function(e,t,n){var r=this.__H;if(!r)return!0;var a=!1,o=this.props!=e;if(r.__.some(function(e){e.__N&&(a=!0,be(e.__[0],e.__N[0])||(o=!0))}),i){var s=i.call(this,e,t,n);return a?s||o:s}return!a||o}}return r.__}function Me(e,t){var n=Ae(_e++,3);!k.__s&&Ve(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,O.__H.__h.push(n))}function Ne(e,t){var n=Ae(_e++,4);!k.__s&&Ve(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,O.__h.push(n))}function j(e){return xe=5,Pe(function(){return{current:e}},[])}function Pe(e,t){var n=Ae(_e++,7);return Ve(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function Fe(){var e;do{for(;e=Ce.shift();)try{ze(e)}catch(t){k.__e(t,{__:(e=e.__P)&&e.__v})}for(;e=Se.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ze),t.__h.some(Be),t.__h=[]}catch(n){t.__h=[],k.__e(n,e.__v)}}}while(Ce.length)}k.__b=function(e){O=null,we&&we(e)},k.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ke&&ke(e,t)},k.__r=function(e){Te&&Te(e),_e=0;var t=(O=e.__c).__H;t&&(ve==O?O.__h=[]:(t.__h.some(ze),t.__h.some(Be),_e=0),t.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})),ve=O},k.diffed=function(e){Ee&&Ee(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Re(Se.push(t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u)})),ve=O=null},k.__c=function(e,t){t.some(function(e){try{e.__h.some(ze),e.__h=e.__h.filter(function(e){return!e.__||Be(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],k.__e(n,e.__v)}}),De&&De(e,t)},k.unmount=function(e){Oe&&Oe(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(r){try{if(r.__P&&r.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n&&=n.__c}r.__P=n,Re(Ce.push(r))}else ze(r)}catch(e){t=e}}),r.__H=void 0,t&&k.__e(t,r.__v))};var Ie=typeof requestAnimationFrame==`function`;function Le(e){var t,n=function(){clearTimeout(r),Ie&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ie&&(t=requestAnimationFrame(n))}function Re(e){e!=1&&ye==k.requestAnimationFrame||((ye=k.requestAnimationFrame)||Le)(Fe)}function ze(e){var t=O,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),O=t}function Be(e){var t=O;e.__c=e.__(),O=t}function Ve(e,t){return!e||e.length!=t.length||t.some(function(t,n){return!be(t,e[n])})}function He(e,t){return typeof t==`function`?t(e):t}var Ue=Symbol.for(`preact-signals`);function We(){if(Ye>1)Ye--;else{var e,t=!1;for((function(){var e=$e;for($e=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();Je!==void 0;){var n=Je;for(Je=void 0,Xe++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&nt(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Xe=0,Ye--,t)throw e}}function Ge(e){if(Ye>0)return e();Qe=++Ze,Ye++;try{return e()}finally{We()}}var Ke,M=void 0;function qe(e){var t=M,n=Ke;M=void 0,Ke=void 0;try{return e()}finally{M=t,Ke=n}}var Je=void 0,Ye=0,Xe=0,Ze=0,Qe=0,$e=void 0,et=0;function tt(e){if(M!==void 0){var t=e.n;if(t===void 0||t.t!==M)return t={i:0,S:e,p:M.s,n:void 0,t:M,e:void 0,x:void 0,r:t},M.s!==void 0&&(M.s.n=t),M.s=t,e.n=t,32&M.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=M.s,t.n=void 0,M.s.n=t,M.s=t),t}}function N(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}N.prototype.brand=Ue,N.prototype.h=function(){return!0},N.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?qe(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},N.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&qe(function(){var e;(e=t.Z)==null||e.call(t)}))}},N.prototype.subscribe=function(e){var t=this;return ut(function(){var n=t.value;qe(function(){return e(n)})},{name:`sub`})},N.prototype.valueOf=function(){return this.value},N.prototype.toString=function(){return this.value+``},N.prototype.toJSON=function(){return this.value},N.prototype.peek=function(){var e=this;return qe(function(){return e.value})},Object.defineProperty(N.prototype,"value",{get:function(){var e=tt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Xe>100)throw Error(`Cycle detected`);(function(e){Ye!==0&&Xe===0&&e.l!==Qe&&(e.l=Qe,$e={S:e,v:e.v,i:e.i,o:$e})})(this),this.v=e,this.i++,et++,Ye++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{We()}}}});function P(e,t){return new N(e,t)}function nt(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function rt(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function it(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function at(e,t){N.call(this,void 0,t),this.x=e,this.s=void 0,this.g=et-1,this.f=4}at.prototype=new N,at.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===et))return!0;if(this.g=et,this.f|=1,this.i>0&&!nt(this))return this.f&=-2,!0;var e=M;try{rt(this),M=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return M=e,it(this),this.f&=-2,!0},at.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}N.prototype.S.call(this,e)},at.prototype.U=function(e){if(this.t!==void 0&&(N.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},at.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(at.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=tt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function F(e,t){return new at(e,t)}function ot(e){var t=e.m;if(e.m=void 0,typeof t==`function`){Ye++;var n=M;M=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,st(e),t}finally{M=n,We()}}}function st(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ot(e)}function ct(e){if(M!==this)throw Error(`Out-of-order effect`);it(this),M=e,this.f&=-2,8&this.f&&st(this),We()}function lt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Ke&&Ke.push(this)}lt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.m=t)}finally{e()}},lt.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,ot(this),rt(this),Ye++;var e=M;return M=this,ct.bind(this,e)},lt.prototype.N=function(){2&this.f||(this.f|=2,this.u=Je,Je=this)},lt.prototype.d=function(){this.f|=8,1&this.f||st(this)},lt.prototype.dispose=function(){this.d()};function ut(e,t){var n=new lt(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var dt,ft,pt=typeof window<`u`&&!!window.__PREACT_SIGNALS_DEVTOOLS__,mt=[];ut(function(){dt=this.N})();function ht(e,t){n[e]=t.bind(null,n[e]||function(){})}function gt(e){if(ft){var t=ft;ft=void 0,t()}ft=e&&e.S()}function _t(e){var t=this,n=e.data,r=yt(n);r.name=`ReactiveDom`,r.value=n;var a=Pe(function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var a=F(function(){var e=r.value.value;return e===0?0:!0===e?``:e||``}),o=F(function(){return!Array.isArray(a.value)&&!i(a.value)}),s=ut(function(){if(this.N=St,o.value){var t=a.value;e.__v&&e.__v.__e&&e.__v.__e.nodeType===3&&(e.__v.__e.data=t)}}),c=t.__$u.d;return t.__$u.d=function(){s(),c.call(this)},[o,a]},[]),o=a[0],s=a[1];return o.value?s.peek():s.value}_t.displayName=`ReactiveTextNode`,Object.defineProperties(N.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:_t},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}}),ht(`__b`,function(e,t){if(gt(),typeof t.type==`string`){var n,r=t.props;for(var i in r)if(i!==`children`){var a=r[i];a instanceof N&&(n||(t.__np=n={}),n[i]=a,r[i]=a.peek())}}e(t)}),ht(`__r`,function(e,t){if(e(t),t.type!==S){gt();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(e,t){var n;return ut(function(){n=this},{name:t}),n.c=e,n}(function(e){return function(){var t;pt&&((t=this.y)==null||t.call(this)),e.__$f|=1,e.setState({})}}(r),typeof t.type==`function`?t.type.displayName||t.type.name:``))),gt(n)}}),ht(`__e`,function(e,t,n,r){gt(),e(t,n,r)}),ht(`diffed`,function(e,t){gt();var n;if(typeof t.type==`string`&&(n=t.__e)){var r=t.__np,i=t.props,a=n.U;if(a)for(var o in a){var s=a[o];s===void 0||r&&o in r||(s.d(),a[o]=void 0)}if(r)for(var c in a||(a={},n.U=a),r){var l=a[c],u=r[c];l===void 0?(l=vt(n,c,u,i),a[c]=l):l.o(u,i)}}e(t)});function vt(e,t,n,r){var i=t in e&&e.ownerSVGElement===void 0,a=P(n);return{o:function(e,t){a.value=e,r=t},d:ut(function(){this.N=St;var n=a.value.value;r[t]!==n&&(r[t]=n,i?e[t]=n:n!=null&&(!1!==n||t[4]===`-`)?e.setAttribute(t,n):e.removeAttribute(t))})}}ht(`unmount`,function(e,t){if(typeof t.type==`string`){var n=t.__e;if(n){var r=n.U;if(r)for(var i in n.U=void 0,r){var a=r[i];a&&a.d()}}var o=t.__np;if(o){var s=t.props;for(var c in o)s[c]=o[c]}t.__np=void 0}else{var l=t.__c;if(l){l.__$f|=8;var u=l.__$u;u&&(l.__$u=void 0,u.d())}}e(t)}),ht(`__h`,function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)}),C.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u==`boolean`&&!0===this.u){var a=2&this.__$f;if(!(r||a||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!==`__source`&&e[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function yt(e,t){return Pe(function(){return P(e,t)},[])}var bt=function(e){queueMicrotask(function(){queueMicrotask(e)})};function xt(){Ge(function(){for(var e;e=mt.shift();)dt.call(e)})}function St(){mt.push(this)===1&&(n.requestAnimationFrame||bt)(xt)}let Ct=P(null),I=P(null),wt=P(!1),Tt=F(()=>Ct.value?`Sign in to Tencil Cloud to pin`:I.value?.access===`read`?`View only: you need write access to the repository to pin`:null),Et=6e4;function Dt(e){return`tencil-cloud-token:${new URL(e).host}`}function Ot(e,t=Date.now()){try{let n=localStorage.getItem(Dt(e));if(!n)return;let r=JSON.parse(n);if(typeof r.token==`string`&&r.expiresAt-Et>t)return r.token;localStorage.removeItem(Dt(e))}catch{}return kt?.bridgeUrl===e&&kt.expiresAt-Et>t?kt.token:void 0}let kt;function At(e,t){kt={...t,bridgeUrl:e};try{localStorage.setItem(Dt(e),JSON.stringify(t))}catch{}}function jt(e){kt=void 0;try{localStorage.removeItem(Dt(e))}catch{}}async function Mt(e,t){let n=window.open(`about:blank`,`tencil-sign-in`,`popup,width=520,height=680`);if(!n)throw Error(`The sign-in window was blocked. Allow popups for this page.`);let r=Ft(64),i=`${Ft(32)}.${It(new TextEncoder().encode(location.origin))}`,a=new URL(t.authorizeUrl);a.search=new URLSearchParams({response_type:`code`,client_id:t.clientId,redirect_uri:t.redirectUri,code_challenge:await Pt(r),code_challenge_method:`S256`,state:i,...t.scope?{scope:t.scope}:{}}).toString(),n.location.href=a.toString(),wt.value=!0;try{let a=await Nt(n,new URL(t.redirectUri).origin,i),o=await fetch(t.tokenUrl,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({grant_type:`authorization_code`,client_id:t.clientId,redirect_uri:t.redirectUri,code_verifier:r,code:a})});if(!o.ok)throw Error(`Tencil Cloud refused the sign-in (${o.status})`);let s=await o.json();if(!s.access_token)throw Error(`Tencil Cloud sent no token`);At(e,{token:s.access_token,expiresAt:Date.now()+(s.expires_in??3600)*1e3})}finally{wt.value=!1}}function Nt(e,t,n){return new Promise((r,i)=>{let a=setInterval(()=>{e.closed&&(s(),i(/* @__PURE__ */ Error(`Sign-in was cancelled`)))},500),o=a=>{if(a.origin!==t||a.source!==e)return;let o=a.data;o?.type===`tencil:oauth`&&o.state===n&&(s(),e.close(),o.code?r(o.code):i(Error(o.error??`Sign-in failed`)))},s=()=>{clearInterval(a),window.removeEventListener(`message`,o)};window.addEventListener(`message`,o)})}async function Pt(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return It(new Uint8Array(t))}function Ft(e){return It(crypto.getRandomValues(new Uint8Array(e)))}function It(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Lt(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16));e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}let L=P(`connecting`),R=P(null),z=P(null),Rt=P(null),zt=P(null),B=P(/* @__PURE__ */ new Map),Bt=P(null),Vt=P(null),Ht=P(null),Ut=P(null),Wt=P(void 0),Gt=P(null),V,Kt=500,qt=``,Jt;function Yt(e,t){qt=e,Jt=t,nn()}function Xt(){return Jt!==void 0}function Zt(){return qt}function Qt(){let e=V;V=void 0,e?.close(),Kt=500,nn()}let $t;function en(){try{return new URL(qt).host}catch{return qt}}function H(e){return V?.readyState===WebSocket.OPEN?(V.send(JSON.stringify(e)),!0):(Gt.value={message:`Not connected to the Tencil bridge`,at:Date.now()},!1)}function tn(e){let t=new Map(B.value);t.set(e.id,e),B.value=t}function nn(){let e=new URL(`/ws`,qt);e.protocol=e.protocol===`https:`?`wss:`:`ws:`,L.value=`connecting`;let t=new WebSocket(e);V=t,$t=Jt?Ot(qt):void 0,t.addEventListener(`open`,()=>{Kt=500,t.send(JSON.stringify({type:`hello`,protocol:1,pageUrl:location.href,...Jt&&{build:Jt},...$t&&{token:$t}}))}),t.addEventListener(`message`,e=>{try{rn(JSON.parse(String(e.data)))}catch(e){console.warn(`[tencil] bad message`,e)}}),t.addEventListener(`close`,()=>{V===t&&(L.value=`closed`,setTimeout(nn,Kt),Kt=Math.min(Kt*2,1e4))})}function rn(e){switch(e.type){case`ready`:Ge(()=>{L.value=`open`,Ct.value=null,I.value=e.viewer??null,Ut.value=null,R.value=e.provider,z.value=e.settings,Rt.value=e.project,zt.value=e.version,B.value=new Map(e.threads.map(e=>[e.id,e]))});return;case`project.unknown`:Ge(()=>{L.value=`open`,Ut.value=e.choices,Wt.value=e.emptyHint});return;case`auth.required`:$t&&jt(qt),Ge(()=>{L.value=`open`,I.value=null,Ct.value={signIn:e.signIn,reason:e.reason}});return;case`provider.status`:R.value=e.provider;return;case`settings`:Ge(()=>{let t=z.value?.provider!==e.settings.provider;z.value=e.settings,t&&(Bt.value=null,Vt.value=null,Ht.value=null)});return;case`thread.upsert`:tn(e.thread);return;case`thread.removed`:{let t=new Map(B.value);t.delete(e.threadId),B.value=t;return}case`provider.models`:Ht.value={provider:e.provider,models:e.models,defaultModel:e.defaultModel};return;case`provider.threads`:Ge(()=>{Bt.value=e.threads,Vt.value=e.project});return;case`error`:Gt.value={message:e.message,threadId:e.threadId,at:Date.now()};return}}function an(e){return z.value?.providers.find(t=>t.id===e)?.label??e}function on(){V?.readyState===WebSocket.OPEN&&V.send(JSON.stringify({type:`provider.threads`}))}function sn(){V?.readyState===WebSocket.OPEN&&V.send(JSON.stringify({type:`provider.models`}))}function cn(e){for(let t of B.value.values())if(t.provider.threadId===e.id&&!t.anchor)return t.id;let t=Lt();return H({type:`thread.open`,id:t,providerThreadId:e.id,title:e.title})?t:null}let U=P(`idle`),ln=P(null),W=P(!1),G=P(null),K=P(null),q=P(null),J=P(!1),un=P(!1),dn=P(!1),fn=P(!1),pn=F(()=>z.value?.batch??!1),mn=P(!1),hn=F(()=>pn.value&&mn.value);function gn(e){let t=z.value;t&&H({type:`settings.update`,batch:e})&&(z.value={...t,batch:e})}let _n=`tencil:ruler`,vn=F(()=>{let e=z.value;return e!==null&&e.ruler!==!1}),yn=P(Cn()),bn=F(()=>vn.value&&yn.value);function xn(e){let t=z.value;t&&H({type:`settings.update`,ruler:e})&&(z.value={...t,ruler:e})}function Sn(){yn.value=!yn.value,G.value=null;try{localStorage.setItem(_n,yn.value?`on`:`off`)}catch{}}function Cn(){try{return localStorage.getItem(_n)===`on`}catch{return!1}}let wn=P(null),Tn=P(0),En=P(Dn(location.href));function Dn(e){try{let t=new URL(e);return`${t.origin}${t.pathname.replace(/\/$/,``)||`/`}`}catch{return e}}let On=F(()=>[...B.value.values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt))),kn=F(()=>On.value.filter(e=>e.anchor&&e.pageUrl&&Dn(e.pageUrl)===En.value).filter(e=>dn.value||!e.resolved).reverse()),An=F(()=>On.value.filter(e=>!e.resolved).length),jn=F(()=>[...On.value].reverse().filter(e=>e.status===`draft`)),Mn=F(()=>On.value.filter(e=>e.status===`working`||e.status===`starting`).length);function Nn(){Tt.value||(K.value=null,G.value=null,q.value=null,U.value=`picking`)}function Pn(){U.value=`idle`,ln.value=null}
|
|
1
|
+
(function(){var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n,r,i,a,o,s,c,l,u,d,f,p,m,h={},g=[],_=/^m(i|n|o|s|text|space)$/,v=Array.isArray,y=g.slice,b=Object.assign;function ee(e){e&&e.parentNode&&e.remove()}function te(e,t,n){var r,i,a,o={},s=arguments.length;for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return s>2&&(o.children=s>3?y.call(arguments,2):n),x(e,o,r,i,null)}function x(e,t,i,a,o){var s={type:e,props:t,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o||++r,__i:-1,__u:0};return!o&&n.vnode&&n.vnode(s),s}function S(e){return e.children}function C(e,t){this.props=e,this.context=t,this.__g=0}function ne(e,t){if(t==null)return e.__?ne(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!=`function`||e.props.__P?null:ne(e)}function w(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),w(e)}function T(e){(8&e.__g||!(e.__g|=8)||!a.push(e)||s++)&&o==n.debounceRendering||((o=n.debounceRendering)||queueMicrotask)(re)}function re(){var e,t,r,i,o,l,u,d,f;try{for(t=1;a.length;)a.length>t&&a.sort(c),e=a.shift(),t=a.length,8&e.__g&&(i=void 0,o=void 0,l=(o=(r=e).__v).__e,u=[],d=[],(f=r.__P)&&((i=b({constructor:void 0},o)).__v=o.__v+1,n.vnode&&n.vnode(i),E(f,i,o,r.__n,f.namespaceURI,32&o.__u?[l]:null,u,l||ne(o),32&o.__u,d),i.__v=o.__v,i.__.__k[i.__i]=i,fe(u,i,d),o.__=o.__e=null,i.__e!=l&&w(i)))}finally{a.length=s=0}}function ie(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,_,v,y=r.__k||g,b=t.length;for(c=ae(n,t,y,c,b),d=0;d<b;d++)(p=n.__k[d])!=null&&(f=~p.__i&&y[p.__i]||h,p.__i=d,v=E(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&(f.ref!=p.ref||8&f.__u)&&(f.ref!=p.ref&&f.ref&&D(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_||=m,4&p.__u?(c=oe(p,c,e,!f.__v),f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function ae(e,t,n,r,i){var a,o,s,c,l,u,d,f,p,m,h=n.length,g=h,_=0,y=!1,b=e.__k=Array(i);for(a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o!=`object`||o.constructor==String?o=b[a]=x(null,o):v(o)?o=b[a]=x(S,{children:o}):o.constructor===void 0&&o.__b?o=b[a]=x(o.type,o.props,o.key,o.ref,o.__v):b[a]=o,c=a+_,o.__=e,o.__b=e.__b+1,s=null,~(l=o.__i=se(o,n,c,g))&&(g--,(s=n[l])&&(s.__u|=2)),s&&s.__v?(o.__u|=2,l==c-1?_--:l==c+1?_++:l!=c&&(l>c?_--:_++,y=!0)):(~l||(i>h?_--:i<h&&_++),typeof o.type!=`function`&&(o.__u|=4))):b[a]=null;if(y){for(u=[],d=[],a=0;a<i;a++)if((o=b[a])&&2&o.__u){for(f=0,p=u.length;f<p;)u[m=f+p>>1]<o.__i?f=m+1:p=m;u[f]=o.__i,d[a]=f+1}for(_=u.length;a--;)d[a]&&(d[a]==_?_--:b[a].__u|=4)}if(g)for(a=0;a<h;a++)!(s=n[a])||2&s.__u||(s.__e==r&&(r=ne(s)),me(s,s));return r}function oe(e,t,n,r){var i,a;if(typeof e.type==`function`){if(e.props.__P)return t;if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&(i[a].__=e,t=oe(i[a],t,n,!1));return t}for(t&&!t.parentNode&&(t=ne(e))&&!t.parentNode&&(t=null),e.__e!=t&&(!r&&n.moveBefore&&e.__e.parentNode?n.moveBefore(e.__e,t):n.insertBefore(e.__e,t||null)),t=e.__e;(t&&=t.nextSibling)&&t.nodeType==8;);return t}function se(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l&&!(2&l.__u);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++])&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ce(e,t,n){n??=``,t[0]==`-`?e.setProperty(t,n):e[t]=n}function le(e,t,n,r,i){var a;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||ce(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ce(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(d,`$1`)),(t=t.slice(2))[0]<`a`&&(t=t.toLowerCase()),(e.__e||={})[t+a]=n,n?r?n[u]=r[u]:(n[u]=f,e.addEventListener(t,a?m:p,a)):e.removeEventListener(t,a?m:p,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 ue(e){return function(t){if(this.__e){var r=this.__e[t.type+e];if(t[l]==null)t[l]=f++;else if(t[l]<r[u])return;return r(n.event?n.event(t):t)}}}function E(e,t,r,i,a,o,s,c,l,u){var d,f,p,m,h,_,y,te,x,w,T,re,ae,oe,se,ce,le,ue,E,fe,D=t.type;if(t.constructor!==void 0)return null;if(128&r.__u&&(l=32&r.__u,d=r.__c.__z)){if(t.__u|=l,f=o=[],d.nodeType==8)for(p=1,m=d.nextSibling;m;m=m.nextSibling){if(m.nodeType==8){if(m.data.startsWith(`$s`))p++;else if(m.data.startsWith(`/$s`)&&!--p)break}o.push(m)}else o.push(d);c=o[0]}(d=n.__b)&&d(t);n:if(typeof D==`function`){h=s.length;try{if(w=t.props,T=(d=D.prototype)&&d.render,re=(d=D.contextType)&&i[d.__c],ae=d?re?re.props.value:d.__:i,r.__c?2&(_=t.__c=r.__c).__g&&(_.__g|=1):(T?t.__c=_=new D(w,ae):(t.__c=_=new C(w,ae),_.constructor=D,_.render=he),re&&re.sub(_),_.state||(_.state={}),_.__n=i,_.__g|=8,_.__h=[],_.__k=[]),T&&(_.__s||(_.__s=_.state),D.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=b({},_.__s)),b(_.__s,D.getDerivedStateFromProps(w,_.__s)))),y=_.props,te=_.state,_.__v=t,r.__c){if(T&&!D.getDerivedStateFromProps&&w!==y&&_.componentWillReceiveProps&&_.componentWillReceiveProps(w,ae),t.__v==r.__v&&!(8&_.__g)||!(4&_.__g)&&_.shouldComponentUpdate&&!1===_.shouldComponentUpdate(w,_.__s,ae)){t.__v!=r.__v&&(_.props=w,_.state=_.__s,_.__g&=-9),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(_.__h,_.__k),_.__k=[],_.__h.length&&s.push(_),c=ne(r);break n}_.componentWillUpdate&&_.componentWillUpdate(w,_.__s,ae),T&&_.componentDidUpdate&&_.__h.push(function(){_.componentDidUpdate(y,te,x)})}else T&&!D.getDerivedStateFromProps&&_.componentWillMount&&_.componentWillMount(),T&&_.componentDidMount&&_.__h.push(_.componentDidMount);if(_.context=ae,_.props=w,_.__P=e,_.__g&=-5,oe=n.__r,se=0,T)_.state=_.__s,_.__g&=-9,oe&&oe(t),d=_.render(_.props,_.state,_.context),g.push.apply(_.__h,_.__k),_.__k=[];else do _.__g&=-9,oe&&oe(t),d=_.render(_.props,_.state,_.context),_.state=_.__s;while(8&_.__g&&++se<25);_.state=_.__s,_.getChildContext&&(i=b({},i,_.getChildContext())),T&&r.__c&&_.getSnapshotBeforeUpdate&&(x=_.getSnapshotBeforeUpdate(y,te)),ce=d&&d.type===S&&d.key==null?d.props.children:d,w.__P&&(d=c,a=(e=w.__P).namespaceURI,l=o=null,r.props&&r.props.__P!=e&&(r.__k.some(function(e){e&&me(e,e)}),r.__k=null),c=r.__k?ne(r,0):null),c=ie(e,v(ce)?ce:[ce],t,r,i,a,o,s,c,l,u),w.__P&&(t.__e=null,c=d),t.__u&=-161,128&r.__u&&(_.__z=null),f&&f.some(ee),_.__h.length&&s.push(_),1&_.__g&&(_.__g&=-4)}catch(e){if(s.length=h,t.__v=null,l||o){if(e.then){if(le=0,t.__u|=l?160:128,o){for(E=0;E<o.length;E++)if(fe=o[E]){if(fe.nodeType==8){if(o[E]=null,fe.data.startsWith(`$s`))le++||(ue=fe);else if(fe.data.startsWith(`/$s`)&&!--le){c=fe;break}}else le&&(o[E]=null)}}if(!ue){for(;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o&&(o[o.indexOf(c)]=null),ue=c}t.__c.__z||(t.__c.__z=ue),t.__e=c}else o&&o.some(ee)}else t.__e=r.__e;t.__k||=r.__k||[],e.then||de(t),n.__e(e,t,r)}}else c=t.__e=pe(r.__e,t,r,i,a,o,s,l,u,e);return(d=n.diffed)&&d(t),128&t.__u?void 0:c}function de(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(de))}function fe(e,t,r){for(var i=0;i<r.length;)D(r[i++],r[i++],r[i++]);n.__c&&n.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){n.__e(e,t.__v)}})}function pe(e,t,r,i,a,o,s,c,l,u){var d,f,p,m,g,b,te,x,S,C=r.props||h,w=t.props,T=t.type;if(T==`svg`?a=`http://www.w3.org/2000/svg`:T==`math`?a=`http://www.w3.org/1998/Math/MathML`:a||=`http://www.w3.org/1999/xhtml`,o){for(d=0;d<o.length;d++)if((g=o[d])&&(T?g.localName==T:g.nodeType==3)){e=g,o[d]=null;break}}if(!e){if(x=u.ownerDocument||document,!T)return x.createTextNode(w);e=x.createElementNS(a,T,w.is&&w),c&&=(n.__m&&n.__m(t,o),!1),o=null}if(T){if(u=T==`template`?e.content:e,o=T==`textarea`&&w.defaultValue!=null?null:o&&y.call(u.childNodes),!c&&o)for(C={},d=0;d<e.attributes.length;d++)C[(g=e.attributes[d]).name]=g.value;for(d in C)g=C[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in w||d==`value`&&`defaultValue`in w||d==`checked`&&`defaultChecked`in w||le(e,d,null,g,a);for(d in S=1&r.__u,w)g=w[d],d==`children`?m=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?b=g:d==`checked`?te=g:c&&typeof g!=`function`||!(C[d]!==g||S&&g!=null)||le(e,d,g,C[d],a);f?(c||p&&(f.__html==p.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[]):(p&&(e.textContent=``),(T==`foreignObject`||a==`http://www.w3.org/1998/Math/MathML`&&_.test(T))&&(a=`http://www.w3.org/1999/xhtml`),ie(u,v(m)?m:[m],t,r,i,a,o,s,o?o[0]:r.__k&&ne(r,0),c,l),o&&o.some(ee)),c&&T!=`textarea`||(d=`value`,T==`progress`&&b==null?e.removeAttribute(d):b==null||b===e[d]&&(T!=`progress`||b)||le(e,d,b,C[d],a),d=`checked`,te!=null&&te!=e[d]&&le(e,d,te,C[d],a))}else C===w||c&&e.data==w||(e.data=w);return e}function D(e,t,r){try{typeof e==`function`?(typeof e.__u==`function`&&e.__u(),(typeof e.__u!=`function`||t)&&(e.__u=e(t))):e.current=t}catch(e){n.__e(e,r)}}function me(e,t,r){var i,a;if(n.unmount&&n.unmount(e),!(i=e.ref)||i.current&&i.current!=e.__e||D(i,null,t),i=e.__c){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){n.__e(e,t)}i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&me(i[a],t,typeof e.type!=`function`||r&&!e.props.__P);(i=e.__e)&&(r||ee(i),i.__e&&(i.__e=null)),e.__e=e.__c=e.__=null}function he(e,t,n){return this.constructor(e,n)}function ge(e,t){var r,i,a,o;n.__&&n.__(e,t),t.nodeType==9&&(t=t.documentElement),i=(r=e&&32&e.__u)?null:t.__k,t.__k=x(S,{children:[e]}),a=[],o=[],E(t,t.__k,i||h,h,t.namespaceURI,i?null:t.firstChild?y.call(t.childNodes):null,a,i?i.__e:t.firstChild,r,o),fe(a,t.__k,o),t.__k.props.children=null}n={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t,o=0}}throw s=0,e}},r=0,i=function(e){return e!=null&&e.constructor===void 0},C.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=b({},this.state)),typeof e==`function`&&(e=e(b({},n),this.props)),e&&(b(n,e),this.__v&&(t&&this.__k.push(t),T(this)))},C.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),T(this))},C.prototype.render=S,a=[],s=0,c=function(e,t){return e.__v.__b-t.__v.__b},l=Symbol(),u=Symbol(),d=/(PointerCapture)$|Capture$/i,f=0,p=ue(!1),m=ue(!0);var _e,O,ve,ye,be=Object.is,xe=0,Se=[],Ce=[],k=n,we=k.__b,Te=k.__r,Ee=k.diffed,De=k.__c,Oe=k.unmount,ke=k.__;function Ae(e,t){k.__h&&k.__h(O,e,xe||t),xe=0;var n=O.__H||(O.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function A(e){return xe=1,je(He,e)}function je(e,t,n){var r=Ae(_e++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):He(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);be(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=O,!O.__f)){O.__f=!0;var i=O.shouldComponentUpdate;O.shouldComponentUpdate=function(e,t,n){var r=this.__H;if(!r)return!0;var a=!1,o=this.props!=e;if(r.__.some(function(e){e.__N&&(a=!0,be(e.__[0],e.__N[0])||(o=!0))}),i){var s=i.call(this,e,t,n);return a?s||o:s}return!a||o}}return r.__}function Me(e,t){var n=Ae(_e++,3);!k.__s&&Ve(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,O.__H.__h.push(n))}function Ne(e,t){var n=Ae(_e++,4);!k.__s&&Ve(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,O.__h.push(n))}function j(e){return xe=5,Pe(function(){return{current:e}},[])}function Pe(e,t){var n=Ae(_e++,7);return Ve(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function Fe(){var e;do{for(;e=Ce.shift();)try{ze(e)}catch(t){k.__e(t,{__:(e=e.__P)&&e.__v})}for(;e=Se.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(ze),t.__h.some(Be),t.__h=[]}catch(n){t.__h=[],k.__e(n,e.__v)}}}while(Ce.length)}k.__b=function(e){O=null,we&&we(e)},k.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ke&&ke(e,t)},k.__r=function(e){Te&&Te(e),_e=0;var t=(O=e.__c).__H;t&&(ve==O?O.__h=[]:(t.__h.some(ze),t.__h.some(Be),_e=0),t.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})),ve=O},k.diffed=function(e){Ee&&Ee(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Re(Se.push(t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u)})),ve=O=null},k.__c=function(e,t){t.some(function(e){try{e.__h.some(ze),e.__h=e.__h.filter(function(e){return!e.__||Be(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],k.__e(n,e.__v)}}),De&&De(e,t)},k.unmount=function(e){Oe&&Oe(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(r){try{if(r.__P&&r.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n&&=n.__c}r.__P=n,Re(Ce.push(r))}else ze(r)}catch(e){t=e}}),r.__H=void 0,t&&k.__e(t,r.__v))};var Ie=typeof requestAnimationFrame==`function`;function Le(e){var t,n=function(){clearTimeout(r),Ie&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ie&&(t=requestAnimationFrame(n))}function Re(e){e!=1&&ye==k.requestAnimationFrame||((ye=k.requestAnimationFrame)||Le)(Fe)}function ze(e){var t=O,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),O=t}function Be(e){var t=O;e.__c=e.__(),O=t}function Ve(e,t){return!e||e.length!=t.length||t.some(function(t,n){return!be(t,e[n])})}function He(e,t){return typeof t==`function`?t(e):t}var Ue=Symbol.for(`preact-signals`);function We(){if(Ye>1)Ye--;else{var e,t=!1;for((function(){var e=$e;for($e=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();Je!==void 0;){var n=Je;for(Je=void 0,Xe++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&nt(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Xe=0,Ye--,t)throw e}}function Ge(e){if(Ye>0)return e();Qe=++Ze,Ye++;try{return e()}finally{We()}}var Ke,M=void 0;function qe(e){var t=M,n=Ke;M=void 0,Ke=void 0;try{return e()}finally{M=t,Ke=n}}var Je=void 0,Ye=0,Xe=0,Ze=0,Qe=0,$e=void 0,et=0;function tt(e){if(M!==void 0){var t=e.n;if(t===void 0||t.t!==M)return t={i:0,S:e,p:M.s,n:void 0,t:M,e:void 0,x:void 0,r:t},M.s!==void 0&&(M.s.n=t),M.s=t,e.n=t,32&M.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=M.s,t.n=void 0,M.s.n=t,M.s=t),t}}function N(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}N.prototype.brand=Ue,N.prototype.h=function(){return!0},N.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?qe(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},N.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&qe(function(){var e;(e=t.Z)==null||e.call(t)}))}},N.prototype.subscribe=function(e){var t=this;return ut(function(){var n=t.value;qe(function(){return e(n)})},{name:`sub`})},N.prototype.valueOf=function(){return this.value},N.prototype.toString=function(){return this.value+``},N.prototype.toJSON=function(){return this.value},N.prototype.peek=function(){var e=this;return qe(function(){return e.value})},Object.defineProperty(N.prototype,"value",{get:function(){var e=tt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Xe>100)throw Error(`Cycle detected`);(function(e){Ye!==0&&Xe===0&&e.l!==Qe&&(e.l=Qe,$e={S:e,v:e.v,i:e.i,o:$e})})(this),this.v=e,this.i++,et++,Ye++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{We()}}}});function P(e,t){return new N(e,t)}function nt(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function rt(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function it(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function at(e,t){N.call(this,void 0,t),this.x=e,this.s=void 0,this.g=et-1,this.f=4}at.prototype=new N,at.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===et))return!0;if(this.g=et,this.f|=1,this.i>0&&!nt(this))return this.f&=-2,!0;var e=M;try{rt(this),M=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return M=e,it(this),this.f&=-2,!0},at.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}N.prototype.S.call(this,e)},at.prototype.U=function(e){if(this.t!==void 0&&(N.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},at.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(at.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=tt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function F(e,t){return new at(e,t)}function ot(e){var t=e.m;if(e.m=void 0,typeof t==`function`){Ye++;var n=M;M=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,st(e),t}finally{M=n,We()}}}function st(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,ot(e)}function ct(e){if(M!==this)throw Error(`Out-of-order effect`);it(this),M=e,this.f&=-2,8&this.f&&st(this),We()}function lt(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Ke&&Ke.push(this)}lt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.m=t)}finally{e()}},lt.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,ot(this),rt(this),Ye++;var e=M;return M=this,ct.bind(this,e)},lt.prototype.N=function(){2&this.f||(this.f|=2,this.u=Je,Je=this)},lt.prototype.d=function(){this.f|=8,1&this.f||st(this)},lt.prototype.dispose=function(){this.d()};function ut(e,t){var n=new lt(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var dt,ft,pt=typeof window<`u`&&!!window.__PREACT_SIGNALS_DEVTOOLS__,mt=[];ut(function(){dt=this.N})();function ht(e,t){n[e]=t.bind(null,n[e]||function(){})}function gt(e){if(ft){var t=ft;ft=void 0,t()}ft=e&&e.S()}function _t(e){var t=this,n=e.data,r=yt(n);r.name=`ReactiveDom`,r.value=n;var a=Pe(function(){for(var e=t,n=t.__v;n=n.__;)if(n.__c){n.__c.__$f|=4;break}var a=F(function(){var e=r.value.value;return e===0?0:!0===e?``:e||``}),o=F(function(){return!Array.isArray(a.value)&&!i(a.value)}),s=ut(function(){if(this.N=St,o.value){var t=a.value;e.__v&&e.__v.__e&&e.__v.__e.nodeType===3&&(e.__v.__e.data=t)}}),c=t.__$u.d;return t.__$u.d=function(){s(),c.call(this)},[o,a]},[]),o=a[0],s=a[1];return o.value?s.peek():s.value}_t.displayName=`ReactiveTextNode`,Object.defineProperties(N.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:_t},props:{configurable:!0,get:function(){var e=this;return{data:{get value(){return e.value}}}}},__b:{configurable:!0,value:1}}),ht(`__b`,function(e,t){if(gt(),typeof t.type==`string`){var n,r=t.props;for(var i in r)if(i!==`children`){var a=r[i];a instanceof N&&(n||(t.__np=n={}),n[i]=a,r[i]=a.peek())}}e(t)}),ht(`__r`,function(e,t){if(e(t),t.type!==S){gt();var n,r=t.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(e,t){var n;return ut(function(){n=this},{name:t}),n.c=e,n}(function(e){return function(){var t;pt&&((t=this.y)==null||t.call(this)),e.__$f|=1,e.setState({})}}(r),typeof t.type==`function`?t.type.displayName||t.type.name:``))),gt(n)}}),ht(`__e`,function(e,t,n,r){gt(),e(t,n,r)}),ht(`diffed`,function(e,t){gt();var n;if(typeof t.type==`string`&&(n=t.__e)){var r=t.__np,i=t.props,a=n.U;if(a)for(var o in a){var s=a[o];s===void 0||r&&o in r||(s.d(),a[o]=void 0)}if(r)for(var c in a||(a={},n.U=a),r){var l=a[c],u=r[c];l===void 0?(l=vt(n,c,u,i),a[c]=l):l.o(u,i)}}e(t)});function vt(e,t,n,r){var i=t in e&&e.ownerSVGElement===void 0,a=P(n);return{o:function(e,t){a.value=e,r=t},d:ut(function(){this.N=St;var n=a.value.value;r[t]!==n&&(r[t]=n,i?e[t]=n:n!=null&&(!1!==n||t[4]===`-`)?e.setAttribute(t,n):e.removeAttribute(t))})}}ht(`unmount`,function(e,t){if(typeof t.type==`string`){var n=t.__e;if(n){var r=n.U;if(r)for(var i in n.U=void 0,r){var a=r[i];a&&a.d()}}var o=t.__np;if(o){var s=t.props;for(var c in o)s[c]=o[c]}t.__np=void 0}else{var l=t.__c;if(l){l.__$f|=8;var u=l.__$u;u&&(l.__$u=void 0,u.d())}}e(t)}),ht(`__h`,function(e,t,n,r){r<3&&(t.__$f|=2),e(t,n,r)}),C.prototype.shouldComponentUpdate=function(e,t){if(this.__R)return!0;var n=this.__$u,r=n&&n.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u==`boolean`&&!0===this.u){var a=2&this.__$f;if(!(r||a||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in e)if(o!==`__source`&&e[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in e))return!0;return!1};function yt(e,t){return Pe(function(){return P(e,t)},[])}var bt=function(e){queueMicrotask(function(){queueMicrotask(e)})};function xt(){Ge(function(){for(var e;e=mt.shift();)dt.call(e)})}function St(){mt.push(this)===1&&(n.requestAnimationFrame||bt)(xt)}let Ct=P(null),I=P(null),wt=P(!1),Tt=F(()=>Ct.value?`Sign in to Tencil Cloud to pin`:I.value?.access===`read`?`View only: you need write access to the repository to pin`:null),Et=6e4;function Dt(e){return`tencil-cloud-token:${new URL(e).host}`}function Ot(e,t=Date.now()){try{let n=localStorage.getItem(Dt(e));if(!n)return;let r=JSON.parse(n);if(typeof r.token==`string`&&r.expiresAt-Et>t)return r.token;localStorage.removeItem(Dt(e))}catch{}return kt?.bridgeUrl===e&&kt.expiresAt-Et>t?kt.token:void 0}let kt;function At(e,t){kt={...t,bridgeUrl:e};try{localStorage.setItem(Dt(e),JSON.stringify(t))}catch{}}function jt(e){kt=void 0;try{localStorage.removeItem(Dt(e))}catch{}}async function Mt(e,t){let n=window.open(`about:blank`,`tencil-sign-in`,`popup,width=520,height=680`);if(!n)throw Error(`The sign-in window was blocked. Allow popups for this page.`);let r=Ft(64),i=`${Ft(32)}.${It(new TextEncoder().encode(location.origin))}`,a=new URL(t.authorizeUrl);a.search=new URLSearchParams({response_type:`code`,client_id:t.clientId,redirect_uri:t.redirectUri,code_challenge:await Pt(r),code_challenge_method:`S256`,state:i,...t.scope?{scope:t.scope}:{}}).toString(),n.location.href=a.toString(),wt.value=!0;try{let a=await Nt(n,new URL(t.redirectUri).origin,i),o=await fetch(t.tokenUrl,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:new URLSearchParams({grant_type:`authorization_code`,client_id:t.clientId,redirect_uri:t.redirectUri,code_verifier:r,code:a})});if(!o.ok)throw Error(`Tencil Cloud refused the sign-in (${o.status})`);let s=await o.json();if(!s.access_token)throw Error(`Tencil Cloud sent no token`);At(e,{token:s.access_token,expiresAt:Date.now()+(s.expires_in??3600)*1e3})}finally{wt.value=!1}}function Nt(e,t,n){return new Promise((r,i)=>{let a=setInterval(()=>{e.closed&&(s(),i(/* @__PURE__ */ Error(`Sign-in was cancelled`)))},500),o=a=>{if(a.origin!==t||a.source!==e)return;let o=a.data;o?.type===`tencil:oauth`&&o.state===n&&(s(),e.close(),o.code?r(o.code):i(Error(o.error??`Sign-in failed`)))},s=()=>{clearInterval(a),window.removeEventListener(`message`,o)};window.addEventListener(`message`,o)})}async function Pt(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return It(new Uint8Array(t))}function Ft(e){return It(crypto.getRandomValues(new Uint8Array(e)))}function It(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Lt(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16));e[6]=(e[6]??0)&15|64,e[8]=(e[8]??0)&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}let L=P(`connecting`),R=P(null),z=P(null),Rt=P(null),zt=P(null),Bt=P(null),Vt=P(null),B=P(/* @__PURE__ */ new Map),Ht=P(null),Ut=P(null),Wt=P(null),Gt=P(null),Kt=P(void 0),qt=P(null),V,Jt=500,Yt=``,Xt,Zt;function Qt(e,t,n){Yt=e,Xt=t,Zt=n,on()}function $t(){return Xt!==void 0}function en(){return Yt}function tn(){let e=V;V=void 0,e?.close(),Jt=500,on()}let nn;function rn(){try{return new URL(Yt).host}catch{return Yt}}function H(e){return V?.readyState===WebSocket.OPEN?(V.send(JSON.stringify(e)),!0):(qt.value={message:`Not connected to the Tencil bridge`,at:Date.now()},!1)}function an(e){let t=new Map(B.value);t.set(e.id,e),B.value=t}function on(){let e=new URL(`/ws`,Yt);e.protocol=e.protocol===`https:`?`wss:`:`ws:`,L.value=`connecting`;let t=new WebSocket(e);V=t,nn=Xt?Ot(Yt):void 0,t.addEventListener(`open`,()=>{Jt=500,t.send(JSON.stringify({type:`hello`,protocol:1,pageUrl:location.href,...Zt&&{root:Zt},...Xt&&{build:Xt},...nn&&{token:nn}}))}),t.addEventListener(`message`,e=>{try{sn(JSON.parse(String(e.data)))}catch(e){console.warn(`[tencil] bad message`,e)}}),t.addEventListener(`close`,()=>{if(V!==t)return;L.value=`closed`;let e=Bt.value?.state===`restarting`;setTimeout(on,e?500:Jt),e||(Jt=Math.min(Jt*2,1e4))})}function sn(e){switch(e.type){case`ready`:Ge(()=>{L.value=`open`,Ct.value=null,I.value=e.viewer??null,Gt.value=null,R.value=e.provider,z.value=e.settings,Rt.value=e.project,Bt.value?.state===`restarting`&&(Vt.value=zt.value),zt.value=e.version,Bt.value=e.update??null,B.value=new Map(e.threads.map(e=>[e.id,e]))});return;case`project.unknown`:Ge(()=>{L.value=`open`,Gt.value=e.choices,Kt.value=e.emptyHint});return;case`auth.required`:nn&&jt(Yt),Ge(()=>{L.value=`open`,I.value=null,Ct.value={signIn:e.signIn,reason:e.reason}});return;case`provider.status`:R.value=e.provider;return;case`update`:Bt.value=e.update;return;case`settings`:Ge(()=>{let t=z.value?.provider!==e.settings.provider;z.value=e.settings,t&&(Ht.value=null,Ut.value=null,Wt.value=null)});return;case`thread.upsert`:an(e.thread);return;case`thread.removed`:{let t=new Map(B.value);t.delete(e.threadId),B.value=t;return}case`provider.models`:Wt.value={provider:e.provider,models:e.models,defaultModel:e.defaultModel};return;case`provider.threads`:Ge(()=>{Ht.value=e.threads,Ut.value=e.project});return;case`error`:qt.value={message:e.message,threadId:e.threadId,at:Date.now()};return}}function cn(e){return z.value?.providers.find(t=>t.id===e)?.label??e}function ln(){V?.readyState===WebSocket.OPEN&&V.send(JSON.stringify({type:`provider.threads`}))}function un(){V?.readyState===WebSocket.OPEN&&V.send(JSON.stringify({type:`provider.models`}))}function dn(e){for(let t of B.value.values())if(t.provider.threadId===e.id&&!t.anchor)return t.id;let t=Lt();return H({type:`thread.open`,id:t,providerThreadId:e.id,title:e.title})?t:null}let U=P(`idle`),fn=P(null),W=P(!1),G=P(null),K=P(null),q=P(null),J=P(!1),pn=P(!1),mn=P(!1),hn=P(!1),gn=F(()=>z.value?.batch??!1),_n=P(!1),vn=F(()=>gn.value&&_n.value);function yn(e){let t=z.value;t&&H({type:`settings.update`,batch:e})&&(z.value={...t,batch:e})}let bn=`tencil:ruler`,xn=F(()=>{let e=z.value;return e!==null&&e.ruler!==!1}),Sn=P(En()),Cn=F(()=>xn.value&&Sn.value);function wn(e){let t=z.value;t&&H({type:`settings.update`,ruler:e})&&(z.value={...t,ruler:e})}function Tn(){Sn.value=!Sn.value,G.value=null;try{localStorage.setItem(bn,Sn.value?`on`:`off`)}catch{}}function En(){try{return localStorage.getItem(bn)===`on`}catch{return!1}}let Dn=P(null),On=P(0),kn=P(An(location.href));function An(e){try{let t=new URL(e);return`${t.origin}${t.pathname.replace(/\/$/,``)||`/`}`}catch{return e}}let jn=F(()=>[...B.value.values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt))),Mn=F(()=>jn.value.filter(e=>e.anchor&&e.pageUrl&&An(e.pageUrl)===kn.value).filter(e=>mn.value||!e.resolved).reverse()),Nn=F(()=>jn.value.filter(e=>!e.resolved).length),Pn=F(()=>[...jn.value].reverse().filter(e=>e.status===`draft`)),Fn=F(()=>jn.value.filter(e=>e.status===`working`||e.status===`starting`).length);function In(){Tt.value||(K.value=null,G.value=null,q.value=null,U.value=`picking`)}function Ln(){U.value=`idle`,fn.value=null}
|
|
2
2
|
/**
|
|
3
3
|
* @license bippy
|
|
4
4
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
let
|
|
10
|
+
let Rn=`bippy-0.7.3`,zn=Object.defineProperty,Bn=()=>{},Vn=e=>e.__REACT_DEVTOOLS_GLOBAL_HOOK__,Hn=e=>Object.assign(e,{[Symbol.dispose]:e}),Un=e=>{let t=e.current.memoizedState;return t===null||t!==void 0&&(t.element===null||t.element===void 0)},Wn=e=>{try{Function.prototype.toString.call(e).indexOf(`^_^`)>-1&&setTimeout(()=>{throw Error(`React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://react.dev/link/perf-use-production-build`)})}catch{}},Gn=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e&&e._isBippyHook!==!0),Kn=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>{if(!e||typeof e.inject!=`function`||Gn(e))return!1;try{return Function.prototype.toString.call(e.inject).includes(`(injected)`)}catch{return!1}},qn=/* @__PURE__ */ new Set,Jn=/* @__PURE__ */ new Set,Yn=/* @__PURE__ */ new WeakMap,Xn=/* @__PURE__ */ new Set,Zn=/* @__PURE__ */ new Set,Qn=/* @__PURE__ */ new WeakMap,$n=(e,t)=>{qn.add(e);let n=Yn.get(e)??/* @__PURE__ */ new Set;n.add(t),Yn.set(e,n)},er=e=>{for(let t of qn)Yn.get(t)?.has(e)&&t()},tr=(e,t)=>{for(let n of Xn)n.target===e&&n.listener(t)},nr=(e,t)=>{for(let n of Zn)n(e,t)},rr=e=>(Zn.add(e),Hn(()=>{Zn.delete(e)})),ir=e=>Object.prototype.toString.call(e)===`[object Map]`,ar=e=>(ir(e.renderers)||(e.renderers=/* @__PURE__ */ new Map),e.renderers),or=(e,t,n,r,i)=>{n.set(r,i),Jn.add(i),e._instrumentationIsActive||(e._instrumentationIsActive=!0,er(t));let a=Qn.get(t)??/* @__PURE__ */ new WeakSet;Qn.set(t,a),!a.has(i)&&(a.add(i),tr(t,i))},sr=(e,t=globalThis)=>{e&&$n(e,t);let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i=e=>{let t=r.get(e)??/* @__PURE__ */ new Set;return r.set(e,t),t},a=0,o={_instrumentationIsActive:!1,_instrumentationSource:Rn,_isBippyHook:!0,checkDCE:Wn,getFiberRoots:i,hasUnsupportedRendererAttached:!1,inject:e=>{let r=++a;return or(o,t,n,r,e),r},on:Bn,onCommitFiberRoot:(e,t)=>{let n=i(e);Un(t)?n.delete(t):n.add(t)},onCommitFiberUnmount:Bn,onPostCommitFiberRoot:Bn,renderers:n,supportsFiber:!0,supportsFlight:!0};try{if(zn(t,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get:()=>o,set:n=>{if(n&&typeof n==`object`){let r=o.renderers;o=n;let i=ar(o);r.forEach((e,t)=>{Jn.add(e),i.set(t,e)}),(r.size>0||Zn.size>0)&&cr(e,t),nr(o,t)}}}),t===globalThis&&typeof window<`u`){let e=window.hasOwnProperty.bind(window),t=Object.getOwnPropertyDescriptor(window,`hasOwnProperty`),n=!1,r=()=>{t?zn(window,`hasOwnProperty`,t):Reflect.deleteProperty(window,`hasOwnProperty`)};zn(window,`hasOwnProperty`,{configurable:!0,value:t=>!n&&t===`__REACT_DEVTOOLS_GLOBAL_HOOK__`?(n=!0,r(),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,!1):e(t),writable:!0})}}catch{cr(e,t)}return o},cr=(e,t=globalThis)=>{e&&$n(e,t);let n=!1,r=Vn(t);if(!r)return;let i=ar(r);if(!r._instrumentationSource){r.checkDCE=Wn,r.supportsFiber=!0,r.supportsFlight=!0,r.hasUnsupportedRendererAttached=!1,r._instrumentationSource=Rn,r._instrumentationIsActive=!1;let e=Gn(r);e||(r.on=Bn),i.size?(i.forEach(e=>Jn.add(e)),r._instrumentationIsActive=!0,er(t),n=!0):!e&&Kn(r)&&(r._instrumentationIsActive=!0,er(t),n=!0);let a=r.inject;r.inject=e=>{let n=a.call(r,e);return or(r,t,i,n,e),n}}!n&&(i.size||r._instrumentationIsActive)&&e?.()},lr=(e=globalThis)=>Object.hasOwn(e,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),ur=(e,t=globalThis)=>lr(t)?(cr(e,t),Vn(t)??sr(e,t)):sr(e,t);
|
|
11
11
|
/**
|
|
12
12
|
* @license bippy
|
|
13
13
|
*
|
|
@@ -16,7 +16,7 @@ let Fn=`bippy-0.7.3`,In=Object.defineProperty,Ln=()=>{},Rn=e=>e.__REACT_DEVTOOLS
|
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
18
|
*/
|
|
19
|
-
try{
|
|
19
|
+
try{ur()}catch{}
|
|
20
20
|
/**
|
|
21
21
|
* @license bippy
|
|
22
22
|
*
|
|
@@ -25,7 +25,7 @@ try{sr()}catch{}
|
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/
|
|
28
|
-
let cr=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,lr=/^\d+$/,ur=e=>dr(e)!==null,dr=e=>{let t=cr.exec(e);if(!t)return null;let n=t[4]?.split(`.`)??[];return n.some(e=>lr.test(e)&&e.length>1&&e.startsWith(`0`))?null:{major:t[1],minor:t[2],patch:t[3],prerelease:n}},fr=(e,t)=>e.length===t.length?e===t?0:e<t?-1:1:e.length<t.length?-1:1,pr=(e,t)=>{let n=lr.test(e),r=lr.test(t);return n&&r?fr(e,t):n===r?e===t?0:e<t?-1:1:n?-1:1},mr=(e,t)=>{if(e.length===0||t.length===0)return e.length===t.length?0:e.length===0?1:-1;let n=Math.max(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===void 0||i===void 0)return n===void 0?-1:1;let a=pr(n,i);if(a!==0)return a}return 0},hr=(e,t)=>{let n=dr(e),r=dr(t);if(!n||!r)return null;let i=fr(n.major,r.major);if(i!==0)return i;let a=fr(n.minor,r.minor);if(a!==0)return a;let o=fr(n.patch,r.patch);return o===0?mr(n.prerelease,r.prerelease):o},gr={ChildDeletion:16,Cloned:8,ContentReset:32,Hydrating:4096,PerformedWork:1,Placement:2,Snapshot:1024,Update:4,Visibility:8192},_r=(e=>e)({"16.0.0":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:2,ContextConsumer:12,ContextProvider:13,CoroutineComponent:7,CoroutineHandlerPhase:8,DehydratedSuspenseComponent:-1,ForwardRef:14,Fragment:10,FunctionComponent:1,HostComponent:5,HostHoistable:-1,HostPortal:4,HostRoot:3,HostSingleton:-1,HostText:6,IncompleteClassComponent:-1,IncompleteFunctionComponent:-1,IndeterminateComponent:0,LazyComponent:-1,LegacyHiddenComponent:-1,MemoComponent:-1,Mode:11,OffscreenComponent:-1,Profiler:15,ScopeComponent:-1,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:9},"16.4.3-alpha":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:2,ContextConsumer:11,ContextProvider:12,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:-1,ForwardRef:13,Fragment:9,FunctionComponent:0,HostComponent:7,HostHoistable:-1,HostPortal:6,HostRoot:5,HostSingleton:-1,HostText:8,IncompleteClassComponent:-1,IncompleteFunctionComponent:-1,IndeterminateComponent:4,LazyComponent:-1,LegacyHiddenComponent:-1,MemoComponent:-1,Mode:10,OffscreenComponent:-1,Profiler:15,ScopeComponent:-1,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:-1},"16.6.0-beta.0":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostHoistable:-1,HostPortal:4,HostRoot:3,HostSingleton:-1,HostText:6,IncompleteClassComponent:17,IncompleteFunctionComponent:-1,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:-1,MemoComponent:14,Mode:8,OffscreenComponent:-1,Profiler:12,ScopeComponent:-1,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:-1},"17.0.0-alpha":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostHoistable:-1,HostPortal:4,HostRoot:3,HostSingleton:-1,HostText:6,IncompleteClassComponent:17,IncompleteFunctionComponent:-1,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:24,MemoComponent:14,Mode:8,OffscreenComponent:23,Profiler:12,ScopeComponent:21,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:-1},"17.0.2":{ActivityComponent:31,CacheComponent:24,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostHoistable:26,HostPortal:4,HostRoot:3,HostSingleton:27,HostText:6,IncompleteClassComponent:17,IncompleteFunctionComponent:28,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:23,MemoComponent:14,Mode:8,OffscreenComponent:22,Profiler:12,ScopeComponent:21,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,Throw:29,TracingMarkerComponent:25,ViewTransitionComponent:30,YieldComponent:-1}}),vr=[{isMinimumExcluded:!0,minimumVersion:`17.0.1`,workTags:_r[`17.0.2`]},{isMinimumExcluded:!1,minimumVersion:`17.0.0-alpha`,workTags:_r[`17.0.0-alpha`]},{isMinimumExcluded:!1,minimumVersion:`16.6.0-beta.0`,workTags:_r[`16.6.0-beta.0`]},{isMinimumExcluded:!1,minimumVersion:`16.4.3-alpha`,workTags:_r[`16.4.3-alpha`]}],yr=_r[`17.0.2`],br=e=>{if(e===void 0)return yr;for(let t of vr){let n=hr(e,t.minimumVersion);if(n===null)return yr;if(n===1||n===0&&!t.isMinimumExcluded)return t.workTags}return _r[`16.0.0`]},xr=br(),Sr=/* @__PURE__ */ new WeakMap,Cr=e=>e.startsWith(`0.0.0-`)?xr:br(e),wr=e=>{let t=e?.reconcilerVersion;return t&&ur(t)?Cr(t):e?.version?Cr(e.version):xr},Tr=(e,t)=>{let n=wr(t);Sr.set(e,n),e.alternate&&Sr.set(e.alternate,n)},Er=e=>{let t=Sr.get(e);if(t)return t;let n=[e],r=e;for(;r.return;)r=r.return,n.push(r);let i=Sr.get(r)??xr;for(let e of n)Sr.set(e,i),e.alternate&&Sr.set(e.alternate,i);return i};gr.Placement|gr.Update|gr.ChildDeletion|gr.ContentReset|gr.Hydrating|gr.Visibility|gr.Snapshot;var Dr=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`BippyError`}},Or=class extends Dr{constructor(e,t){super(e,t),this.name=`BippyHookInspectionError`}},kr=class extends Or{constructor(e,t){super(e,t),this.name=`BippyUnsupportedHookError`}},Ar=class extends Dr{constructor(e,t){super(e,t),this.name=`BippySourceMapError`}};let jr=e=>typeof e==`function`,Mr=e=>{let t=`displayName`in e?e.displayName:null;if(typeof t==`string`&&t)return t;let n=`name`in e?e.name:null;return typeof n==`string`&&n?n:null},Nr=e=>typeof e==`object`&&!!e&&`tag`in e&&`stateNode`in e&&`return`in e&&`child`in e&&`sibling`in e&&`flags`in e,Pr=e=>{let t=Er(e);switch(e.tag){case t.HostComponent:case t.HostText:case t.HostHoistable:case t.HostSingleton:return!0;default:return!1}},Fr=e=>{let t=Er(e);switch(e.tag){case t.ClassComponent:case t.ForwardRef:case t.FunctionComponent:case t.MemoComponent:case t.SimpleMemoComponent:return!0;default:return!1}};function Ir(e,t,n=!1){if(!e)return null;let r=t(e);return Lr(r)?Promise.resolve(r).then(r=>r===!0?e:Rr(e,t,n)):r===!0?e:Rr(e,t,n)}let Lr=e=>(typeof e==`object`||typeof e==`function`)&&e!==null&&`then`in e&&typeof e.then==`function`,Rr=(e,t,n)=>{let r=n?e.return:e.child;return zr(r,t,n)},zr=(e,t,n)=>{if(!e)return null;let r=n?null:e.sibling,i=Ir(e,t,n);return Lr(i)?Promise.resolve(i).then(e=>e??zr(r,t,n)):i??zr(r,t,n)},Br=e=>jr(e)?e:typeof e!=`object`||!e?null:Br(Reflect.get(e,`type`)??Reflect.get(e,`render`)),Vr=e=>{if(typeof e==`string`)return e;if(typeof e!=`function`&&typeof e!=`object`||e===null)return null;let t=Mr(e);if(t)return t;let n=Br(e);return n?Mr(n):null},Hr=/* @__PURE__ */ new Set,Ur=/* @__PURE__ */ new WeakMap,Wr=/* @__PURE__ */ new WeakMap,Gr=/* @__PURE__ */ new WeakMap,Kr=/* @__PURE__ */ new Map;typeof FinalizationRegistry==`function`&&new FinalizationRegistry(e=>{Kr.get(e)?.deref()||Kr.delete(e)});let qr=e=>{let t=e.alternate?[e,e.alternate]:[e],n=/* @__PURE__ */ new Set;for(let e of t){let t=Gr.get(e);t!==void 0&&n.add(t),Gr.delete(e)}for(let e of n){let n=Kr.get(e)?.deref();(!n||t.includes(n))&&Kr.delete(e)}},Jr=/* @__PURE__ */ new Set,Yr=/* @__PURE__ */ new WeakMap,Xr=/* @__PURE__ */ new WeakMap,Zr=!1,Qr=e=>{let t=Yr.get(e)??{};if(Yr.set(e,t),!t.onCommitFiberRoot||e.onCommitFiberRoot!==t.onCommitFiberRoot){let n=e.onCommitFiberRoot,r=(t,i,a,o)=>{if(n&&n.call(e,t,i,a,o),Yr.get(e)?.onCommitFiberRoot===r){Tr(i.current,e.renderers.get(t)),Bn(i)?(Hr.delete(i),Ur.delete(i),Wr.delete(i)):(Hr.add(i),Ur.set(i,t),Wr.set(i,e));for(let{options:n,target:r}of Jr)r===Xr.get(e)&&n.onCommitFiberRoot&&n.onCommitFiberRoot(t,i,a,o)}};t.onCommitFiberRoot=r,e.onCommitFiberRoot=r}if(!t.onCommitFiberUnmount||e.onCommitFiberUnmount!==t.onCommitFiberUnmount){let n=e.onCommitFiberUnmount,r=(t,i)=>{if(Tr(i,e.renderers.get(t)),n&&n.call(e,t,i),Yr.get(e)?.onCommitFiberUnmount===r)try{for(let{options:n,target:r}of Jr)r===Xr.get(e)&&n.onCommitFiberUnmount&&n.onCommitFiberUnmount(t,i)}finally{qr(i)}};t.onCommitFiberUnmount=r,e.onCommitFiberUnmount=r}if(!t.onPostCommitFiberRoot||e.onPostCommitFiberRoot!==t.onPostCommitFiberRoot){let n=e.onPostCommitFiberRoot,r=(t,i)=>{if(n&&n.call(e,t,i),Yr.get(e)?.onPostCommitFiberRoot===r)for(let{options:n,target:r}of Jr)r===Xr.get(e)&&n.onPostCommitFiberRoot&&n.onPostCommitFiberRoot(t,i)};t.onPostCommitFiberRoot=r,e.onPostCommitFiberRoot=r}if(!t.onScheduleFiberRoot||e.onScheduleFiberRoot!==t.onScheduleFiberRoot){let n=e.onScheduleFiberRoot,r=(t,i,a)=>{if(n&&n.call(e,t,i,a),Yr.get(e)?.onScheduleFiberRoot===r)for(let{options:n,target:r}of Jr)r===Xr.get(e)&&n.onScheduleFiberRoot&&n.onScheduleFiberRoot(t,i,a)};t.onScheduleFiberRoot=r,e.onScheduleFiberRoot=r}},$r=(e,t)=>{Xr.set(e,t),Qr(e)},ei=(e,t=globalThis)=>{Zr||=(er($r),!0),Xr.set(e,t),Qr(e)};try{or()&&ei(sr())}catch{}let ti=/* @__PURE__ */ new Set,ni=e=>e.startsWith(`__reactContainer$`)||e.startsWith(`__reactInternalInstance$`)||e.startsWith(`__reactFiber`),ri=e=>{let t=Reflect.get(e,`_reactRootContainer`);if(typeof t!=`object`||!t)return null;let n=Reflect.get(t,`_internalRoot`);if(typeof n!=`object`||!n)return null;let r=Reflect.get(n,`current`);if(typeof r!=`object`||!r)return null;let i=Reflect.get(r,`child`);return Nr(i)?i:null},ii=e=>{let t=Reflect.get(e,`__internalInstanceHandle`)??Reflect.get(e,`_internalInstanceHandle`);return Nr(t)?t:null},ai=e=>{if(typeof e!=`object`||!e)return e;let t=Reflect.get(e,`canonical`);if(typeof t==`object`&&t){let e=Reflect.get(t,`publicInstance`);if(typeof e==`object`&&e)return e}let n=Reflect.get(e,`_nativeTag`);return typeof n==`number`?n:e},oi=(e,t=globalThis)=>{let n=t.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n)for(let t of n.renderers.values())try{let n=t.findFiberByHostInstance?.(e);if(n)return n}catch{}if(typeof e==`object`&&e){let t=ri(e);if(t)return t;let n=ii(e);if(n)return n;for(let t of ti){let n=Reflect.get(e,t);if(Nr(n))return n}for(let t of Object.keys(e))if(ni(t)){ti.add(t);let n=Reflect.get(e,t);if(Nr(n))return n}}if(e!=null&&(typeof e==`object`||typeof e==`number`)){let t=/* @__PURE__ */ new Set;if(n?.getFiberRoots)for(let e of n.renderers.keys())for(let r of n.getFiberRoots(e))t.add(r);for(let e of Hr)Wr.get(e)===n&&t.add(e);for(let n of t){let t=Ir(n.current,t=>Pr(t)&&ai(t.stateNode)===e);if(t)return t}}return null};Reflect.get(/* @__PURE__ */ t({useEffect:()=>void 0,useReducer:()=>void 0,useRef:()=>void 0}),`useSyncExternalStore`);
|
|
28
|
+
let dr=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,fr=/^\d+$/,pr=e=>mr(e)!==null,mr=e=>{let t=dr.exec(e);if(!t)return null;let n=t[4]?.split(`.`)??[];return n.some(e=>fr.test(e)&&e.length>1&&e.startsWith(`0`))?null:{major:t[1],minor:t[2],patch:t[3],prerelease:n}},hr=(e,t)=>e.length===t.length?e===t?0:e<t?-1:1:e.length<t.length?-1:1,gr=(e,t)=>{let n=fr.test(e),r=fr.test(t);return n&&r?hr(e,t):n===r?e===t?0:e<t?-1:1:n?-1:1},_r=(e,t)=>{if(e.length===0||t.length===0)return e.length===t.length?0:e.length===0?1:-1;let n=Math.max(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===void 0||i===void 0)return n===void 0?-1:1;let a=gr(n,i);if(a!==0)return a}return 0},vr=(e,t)=>{let n=mr(e),r=mr(t);if(!n||!r)return null;let i=hr(n.major,r.major);if(i!==0)return i;let a=hr(n.minor,r.minor);if(a!==0)return a;let o=hr(n.patch,r.patch);return o===0?_r(n.prerelease,r.prerelease):o},yr={ChildDeletion:16,Cloned:8,ContentReset:32,Hydrating:4096,PerformedWork:1,Placement:2,Snapshot:1024,Update:4,Visibility:8192},br=(e=>e)({"16.0.0":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:2,ContextConsumer:12,ContextProvider:13,CoroutineComponent:7,CoroutineHandlerPhase:8,DehydratedSuspenseComponent:-1,ForwardRef:14,Fragment:10,FunctionComponent:1,HostComponent:5,HostHoistable:-1,HostPortal:4,HostRoot:3,HostSingleton:-1,HostText:6,IncompleteClassComponent:-1,IncompleteFunctionComponent:-1,IndeterminateComponent:0,LazyComponent:-1,LegacyHiddenComponent:-1,MemoComponent:-1,Mode:11,OffscreenComponent:-1,Profiler:15,ScopeComponent:-1,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:9},"16.4.3-alpha":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:2,ContextConsumer:11,ContextProvider:12,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:-1,ForwardRef:13,Fragment:9,FunctionComponent:0,HostComponent:7,HostHoistable:-1,HostPortal:6,HostRoot:5,HostSingleton:-1,HostText:8,IncompleteClassComponent:-1,IncompleteFunctionComponent:-1,IndeterminateComponent:4,LazyComponent:-1,LegacyHiddenComponent:-1,MemoComponent:-1,Mode:10,OffscreenComponent:-1,Profiler:15,ScopeComponent:-1,SimpleMemoComponent:-1,SuspenseComponent:16,SuspenseListComponent:-1,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:-1},"16.6.0-beta.0":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostHoistable:-1,HostPortal:4,HostRoot:3,HostSingleton:-1,HostText:6,IncompleteClassComponent:17,IncompleteFunctionComponent:-1,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:-1,MemoComponent:14,Mode:8,OffscreenComponent:-1,Profiler:12,ScopeComponent:-1,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:-1},"17.0.0-alpha":{ActivityComponent:-1,CacheComponent:-1,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostHoistable:-1,HostPortal:4,HostRoot:3,HostSingleton:-1,HostText:6,IncompleteClassComponent:17,IncompleteFunctionComponent:-1,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:24,MemoComponent:14,Mode:8,OffscreenComponent:23,Profiler:12,ScopeComponent:21,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,Throw:-1,TracingMarkerComponent:-1,ViewTransitionComponent:-1,YieldComponent:-1},"17.0.2":{ActivityComponent:31,CacheComponent:24,ClassComponent:1,ContextConsumer:9,ContextProvider:10,CoroutineComponent:-1,CoroutineHandlerPhase:-1,DehydratedSuspenseComponent:18,ForwardRef:11,Fragment:7,FunctionComponent:0,HostComponent:5,HostHoistable:26,HostPortal:4,HostRoot:3,HostSingleton:27,HostText:6,IncompleteClassComponent:17,IncompleteFunctionComponent:28,IndeterminateComponent:2,LazyComponent:16,LegacyHiddenComponent:23,MemoComponent:14,Mode:8,OffscreenComponent:22,Profiler:12,ScopeComponent:21,SimpleMemoComponent:15,SuspenseComponent:13,SuspenseListComponent:19,Throw:29,TracingMarkerComponent:25,ViewTransitionComponent:30,YieldComponent:-1}}),xr=[{isMinimumExcluded:!0,minimumVersion:`17.0.1`,workTags:br[`17.0.2`]},{isMinimumExcluded:!1,minimumVersion:`17.0.0-alpha`,workTags:br[`17.0.0-alpha`]},{isMinimumExcluded:!1,minimumVersion:`16.6.0-beta.0`,workTags:br[`16.6.0-beta.0`]},{isMinimumExcluded:!1,minimumVersion:`16.4.3-alpha`,workTags:br[`16.4.3-alpha`]}],Sr=br[`17.0.2`],Cr=e=>{if(e===void 0)return Sr;for(let t of xr){let n=vr(e,t.minimumVersion);if(n===null)return Sr;if(n===1||n===0&&!t.isMinimumExcluded)return t.workTags}return br[`16.0.0`]},wr=Cr(),Tr=/* @__PURE__ */ new WeakMap,Er=e=>e.startsWith(`0.0.0-`)?wr:Cr(e),Dr=e=>{let t=e?.reconcilerVersion;return t&&pr(t)?Er(t):e?.version?Er(e.version):wr},Or=(e,t)=>{let n=Dr(t);Tr.set(e,n),e.alternate&&Tr.set(e.alternate,n)},kr=e=>{let t=Tr.get(e);if(t)return t;let n=[e],r=e;for(;r.return;)r=r.return,n.push(r);let i=Tr.get(r)??wr;for(let e of n)Tr.set(e,i),e.alternate&&Tr.set(e.alternate,i);return i};yr.Placement|yr.Update|yr.ChildDeletion|yr.ContentReset|yr.Hydrating|yr.Visibility|yr.Snapshot;var Ar=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`BippyError`}},jr=class extends Ar{constructor(e,t){super(e,t),this.name=`BippyHookInspectionError`}},Mr=class extends jr{constructor(e,t){super(e,t),this.name=`BippyUnsupportedHookError`}},Nr=class extends Ar{constructor(e,t){super(e,t),this.name=`BippySourceMapError`}};let Pr=e=>typeof e==`function`,Fr=e=>{let t=`displayName`in e?e.displayName:null;if(typeof t==`string`&&t)return t;let n=`name`in e?e.name:null;return typeof n==`string`&&n?n:null},Ir=e=>typeof e==`object`&&!!e&&`tag`in e&&`stateNode`in e&&`return`in e&&`child`in e&&`sibling`in e&&`flags`in e,Lr=e=>{let t=kr(e);switch(e.tag){case t.HostComponent:case t.HostText:case t.HostHoistable:case t.HostSingleton:return!0;default:return!1}},Rr=e=>{let t=kr(e);switch(e.tag){case t.ClassComponent:case t.ForwardRef:case t.FunctionComponent:case t.MemoComponent:case t.SimpleMemoComponent:return!0;default:return!1}};function zr(e,t,n=!1){if(!e)return null;let r=t(e);return Br(r)?Promise.resolve(r).then(r=>r===!0?e:Vr(e,t,n)):r===!0?e:Vr(e,t,n)}let Br=e=>(typeof e==`object`||typeof e==`function`)&&e!==null&&`then`in e&&typeof e.then==`function`,Vr=(e,t,n)=>{let r=n?e.return:e.child;return Hr(r,t,n)},Hr=(e,t,n)=>{if(!e)return null;let r=n?null:e.sibling,i=zr(e,t,n);return Br(i)?Promise.resolve(i).then(e=>e??Hr(r,t,n)):i??Hr(r,t,n)},Ur=e=>Pr(e)?e:typeof e!=`object`||!e?null:Ur(Reflect.get(e,`type`)??Reflect.get(e,`render`)),Wr=e=>{if(typeof e==`string`)return e;if(typeof e!=`function`&&typeof e!=`object`||e===null)return null;let t=Fr(e);if(t)return t;let n=Ur(e);return n?Fr(n):null},Gr=/* @__PURE__ */ new Set,Kr=/* @__PURE__ */ new WeakMap,qr=/* @__PURE__ */ new WeakMap,Jr=/* @__PURE__ */ new WeakMap,Yr=/* @__PURE__ */ new Map;typeof FinalizationRegistry==`function`&&new FinalizationRegistry(e=>{Yr.get(e)?.deref()||Yr.delete(e)});let Xr=e=>{let t=e.alternate?[e,e.alternate]:[e],n=/* @__PURE__ */ new Set;for(let e of t){let t=Jr.get(e);t!==void 0&&n.add(t),Jr.delete(e)}for(let e of n){let n=Yr.get(e)?.deref();(!n||t.includes(n))&&Yr.delete(e)}},Zr=/* @__PURE__ */ new Set,Qr=/* @__PURE__ */ new WeakMap,$r=/* @__PURE__ */ new WeakMap,ei=!1,ti=e=>{let t=Qr.get(e)??{};if(Qr.set(e,t),!t.onCommitFiberRoot||e.onCommitFiberRoot!==t.onCommitFiberRoot){let n=e.onCommitFiberRoot,r=(t,i,a,o)=>{if(n&&n.call(e,t,i,a,o),Qr.get(e)?.onCommitFiberRoot===r){Or(i.current,e.renderers.get(t)),Un(i)?(Gr.delete(i),Kr.delete(i),qr.delete(i)):(Gr.add(i),Kr.set(i,t),qr.set(i,e));for(let{options:n,target:r}of Zr)r===$r.get(e)&&n.onCommitFiberRoot&&n.onCommitFiberRoot(t,i,a,o)}};t.onCommitFiberRoot=r,e.onCommitFiberRoot=r}if(!t.onCommitFiberUnmount||e.onCommitFiberUnmount!==t.onCommitFiberUnmount){let n=e.onCommitFiberUnmount,r=(t,i)=>{if(Or(i,e.renderers.get(t)),n&&n.call(e,t,i),Qr.get(e)?.onCommitFiberUnmount===r)try{for(let{options:n,target:r}of Zr)r===$r.get(e)&&n.onCommitFiberUnmount&&n.onCommitFiberUnmount(t,i)}finally{Xr(i)}};t.onCommitFiberUnmount=r,e.onCommitFiberUnmount=r}if(!t.onPostCommitFiberRoot||e.onPostCommitFiberRoot!==t.onPostCommitFiberRoot){let n=e.onPostCommitFiberRoot,r=(t,i)=>{if(n&&n.call(e,t,i),Qr.get(e)?.onPostCommitFiberRoot===r)for(let{options:n,target:r}of Zr)r===$r.get(e)&&n.onPostCommitFiberRoot&&n.onPostCommitFiberRoot(t,i)};t.onPostCommitFiberRoot=r,e.onPostCommitFiberRoot=r}if(!t.onScheduleFiberRoot||e.onScheduleFiberRoot!==t.onScheduleFiberRoot){let n=e.onScheduleFiberRoot,r=(t,i,a)=>{if(n&&n.call(e,t,i,a),Qr.get(e)?.onScheduleFiberRoot===r)for(let{options:n,target:r}of Zr)r===$r.get(e)&&n.onScheduleFiberRoot&&n.onScheduleFiberRoot(t,i,a)};t.onScheduleFiberRoot=r,e.onScheduleFiberRoot=r}},ni=(e,t)=>{$r.set(e,t),ti(e)},ri=(e,t=globalThis)=>{ei||=(rr(ni),!0),$r.set(e,t),ti(e)};try{lr()&&ri(ur())}catch{}let ii=/* @__PURE__ */ new Set,ai=e=>e.startsWith(`__reactContainer$`)||e.startsWith(`__reactInternalInstance$`)||e.startsWith(`__reactFiber`),oi=e=>{let t=Reflect.get(e,`_reactRootContainer`);if(typeof t!=`object`||!t)return null;let n=Reflect.get(t,`_internalRoot`);if(typeof n!=`object`||!n)return null;let r=Reflect.get(n,`current`);if(typeof r!=`object`||!r)return null;let i=Reflect.get(r,`child`);return Ir(i)?i:null},si=e=>{let t=Reflect.get(e,`__internalInstanceHandle`)??Reflect.get(e,`_internalInstanceHandle`);return Ir(t)?t:null},ci=e=>{if(typeof e!=`object`||!e)return e;let t=Reflect.get(e,`canonical`);if(typeof t==`object`&&t){let e=Reflect.get(t,`publicInstance`);if(typeof e==`object`&&e)return e}let n=Reflect.get(e,`_nativeTag`);return typeof n==`number`?n:e},li=(e,t=globalThis)=>{let n=t.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n)for(let t of n.renderers.values())try{let n=t.findFiberByHostInstance?.(e);if(n)return n}catch{}if(typeof e==`object`&&e){let t=oi(e);if(t)return t;let n=si(e);if(n)return n;for(let t of ii){let n=Reflect.get(e,t);if(Ir(n))return n}for(let t of Object.keys(e))if(ai(t)){ii.add(t);let n=Reflect.get(e,t);if(Ir(n))return n}}if(e!=null&&(typeof e==`object`||typeof e==`number`)){let t=/* @__PURE__ */ new Set;if(n?.getFiberRoots)for(let e of n.renderers.keys())for(let r of n.getFiberRoots(e))t.add(r);for(let e of Gr)qr.get(e)===n&&t.add(e);for(let n of t){let t=zr(n.current,t=>Lr(t)&&ci(t.stateNode)===e);if(t)return t}}return null};Reflect.get(/* @__PURE__ */ t({useEffect:()=>void 0,useReducer:()=>void 0,useRef:()=>void 0}),`useSyncExternalStore`);
|
|
29
29
|
/**
|
|
30
30
|
* @license bippy
|
|
31
31
|
*
|
|
@@ -42,35 +42,35 @@ let cr=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za
|
|
|
42
42
|
* This source code is licensed under the MIT license found in the
|
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
|
44
44
|
*/
|
|
45
|
-
let
|
|
46
|
-
`),n=[];for(let e of t)if(/^\s*at\s+/.test(e)){let t=
|
|
47
|
-
`).filter(e=>!!e.match(
|
|
48
|
-
`).filter(e=>!e.match(
|
|
49
|
-
`,t));return{frames:
|
|
50
|
-
`,a-1)+1,n=t.slice(e,a).match(
|
|
51
|
-
`),i=r===-1?t:t.slice(r+1);if(i.includes(e))return`\n${i}`}return
|
|
45
|
+
let ui=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,di=[`rsc://`,`file:///`,`webpack-internal://`,`webpack://`,`node:`,`turbopack://`,`metro://`,`/app-pages-browser/`,`/(app-pages-browser)/`],fi=[`rsc://`,`about://React/`],pi=[`<anonymous>`,`eval`,``],mi=/\.(cjs|cts|js|jsx|mdx|mjs|mts|ts|tsx)$/,hi=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,gi=/^\?[\w~.-]+(?:=[^&#]*)?(?:&[\w~.-]+(?:=[^&#]*)?)*$/,_i=/\[[^\]]+\]$/,vi=[`react_stack_bottom_frame`,`react-stack-bottom-frame`],yi=Error,bi=()=>yi.prepareStackTrace,xi=e=>{yi.prepareStackTrace=e},Si=/(^|@)\S+:\d+/,Ci=/^\s*at .*(\S+:\d+|\(native\))/m,wi=/^(eval@)?(\[native code\])?$/,Ti=(e,t)=>{if(t?.includeInElement!==!1){let t=e.split(`
|
|
46
|
+
`),n=[];for(let e of t)if(/^\s*at\s+/.test(e)){let t=Di(e)[0];t&&n.push(t)}else if(/^\s*in\s+/.test(e)){let t=e.replace(/^\s*in\s+/,``).replace(/\s*(?:\(at .*\)|\[[^\]]+\])$/,``);n.push({functionName:t,source:e})}else if(e.match(Si)){let t=Oi(e)[0];t&&n.push(t)}return n}return e.match(Ci)?Di(e):Oi(e)},Ei=e=>{if(!e.includes(`:`))return[e,void 0,void 0];let t=e.startsWith(`(`)&&/:\d+\)$/.test(e)?e.slice(1,-1):e,n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t);return n?[n[1],n[2]||void 0,n[3]||void 0]:[t,void 0,void 0]},Di=e=>e.split(`
|
|
47
|
+
`).filter(e=>!!e.match(Ci)).map(e=>{let t=e;t.includes(`(eval `)&&(t=t.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(,.*$)/g,``));let n=t.replace(/^\s+/,``).replace(/\(eval code/g,`(`).replace(/^.*?\s+/,``),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],``):n;let i=Ei(r?r[1]:n);return{functionName:r&&n||void 0,fileName:[`eval`,`<anonymous>`,`(native)`].includes(i[0])?void 0:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}),Oi=e=>e.split(`
|
|
48
|
+
`).filter(e=>!e.match(wi)).map(e=>{let t=e;if(t.includes(` > eval`)&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),!t.includes(`@`)&&!t.includes(`:`))return{functionName:t};{let e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=Ei(t.replace(e,``));return{functionName:r,fileName:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}}),ki=/* @__PURE__ */ new WeakMap,Ai=e=>vi.some(t=>e.includes(t)),ji=e=>{let t=e.getFunctionName?.()??``;if(t)return t;let n=e.getTypeName?.()??``,r=e.getMethodName?.()??``;return n&&r?`${n}.${r}`:r},Mi=e=>{let t=[];for(let n=1;n<e.length;n++){let r=e[n],i=ji(r);if(Ai(i))return{frames:t,isTrusted:!0};if(r.isNative?.()){t.push({functionName:i||void 0});continue}let a=r.getScriptNameOrSourceURL?.()??``;!a&&r.isEval?.()&&(a=r.getEvalOrigin?.()??``),t.push({functionName:i&&i!==`<anonymous>`?i:void 0,fileName:a&&a!==`<anonymous>`?a:void 0,lineNumber:r.getLineNumber?.()??void 0,columnNumber:r.getColumnNumber?.()??void 0,enclosingLineNumber:r.getEnclosingLineNumber?.()??void 0,enclosingColumnNumber:r.getEnclosingColumnNumber?.()??void 0,source:` at ${r.toString()}`})}return{frames:t,isTrusted:!1}},Ni=e=>{let t=-1;for(let n of vi)if(t=e.indexOf(n),t!==-1)break;let n=t===-1?e:e.slice(0,e.lastIndexOf(`
|
|
49
|
+
`,t));return{frames:Ti(n).slice(1),isTrusted:t!==-1}},Pi=e=>{let t=ki.get(e);if(t)return t;let n=null,r=(e,t)=>{n=Mi(t);let r=`${e.name||`Error`}: ${e.message||``}`;for(let e of t)r+=`\n at ${e.toString()}`;return r},i=bi();xi(r);let a;try{a=String(e.stack)}finally{xi(i)}let o=n??Ni(a);return ki.set(e,o),o},Fi=(e=globalThis)=>{let t=ur(void 0,e),n=ir(t.renderers)?t.renderers.values():[],r=e===globalThis?/* @__PURE__ */ new Set([...Jn,...n]):new Set(n),i=[],a=/* @__PURE__ */ new Set;for(let e of r){let t=e.currentDispatcherRef;!t||a.has(t)||(a.add(t),i.push(t))}return i},Ii=e=>`H`in e?e.H:e.current,Li=(e,t)=>{`H`in e?e.H=t:e.current=t};var Ri=44,zi=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Bi=/* @__PURE__ */ new Uint8Array(64),Vi=/* @__PURE__ */ new Uint8Array(128);for(let e=0;e<zi.length;e++){let t=zi.charCodeAt(e);Bi[e]=t,Vi[t]=e}function Hi(e,t){let n=0,r=0,i=0;do i=Vi[e.next()],n|=(i&31)<<r,r+=5;while(i&32);let a=n&1;return n>>>=1,a&&(n=-2147483648|-n),t+n}function Ui(e,t){return e.pos>=t?!1:e.peek()!==Ri}var Wi=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function Gi(e){let{length:t}=e,n=new Wi(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i=Hi(n,i),i<u&&(l=!1),u=i,Ui(n,e)?(a=Hi(n,a),o=Hi(n,o),s=Hi(n,s),Ui(n,e)?(c=Hi(n,c),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||Ki(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function Ki(e){e.sort(qi)}function qi(e,t){return e[0]-t[0]}let Ji=/^data:application\/json(?:;[^,]*)?,/i,Yi=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,Xi=/* @__PURE__ */ new Map,Zi=/* @__PURE__ */ new WeakMap;var Qi=class extends Error{};let $i=/* @__PURE__ */ new Map,ea=/* @__PURE__ */ new WeakMap,ta=/* @__PURE__ */ new Set([`chrome-extension:`,`moz-extension:`,`safari-web-extension:`]),na=/* @__PURE__ */ new Set([`http:`,`https:`,...ta]),ra=(e,t,n,r)=>{let[,i,a,o,s]=e;if(i===void 0||a===void 0||o===void 0)return null;let c=t[i];return c?{columnNumber:o,fileName:c,functionName:s===void 0?void 0:r?.[s]||void 0,isIgnoreListed:n?.has(i)??!1,lineNumber:a+1}:null},ia=(e,t,n,r,i,a)=>{if(n<0||n>=e.length)return null;let o=e[n];if(!o||o.length===0)return null;let s=null,c=0,l=o.length-1;for(;c<=l;){let e=c+l>>1;o[e][0]<=r?(s=o[e],c=e+1):l=e-1}return!s||s.length<4?null:ra(s,t,i,a)},aa=(e,t,n)=>{if(e.sections){let r=t-1,i=null;for(let t of e.sections)if(r>t.offset.line||r===t.offset.line&&n>=t.offset.column)i=t;else break;if(!i)return null;let a=r-i.offset.line,o=r===i.offset.line?n-i.offset.column:n;return ia(i.map.mappings,i.map.sources,a,o,i.map.ignoredSourceIndices,i.map.names)}return ia(e.mappings,e.sources,t-1,n,e.ignoredSourceIndices,e.names)},oa=(e,t)=>{if(Ji.test(e))return e;try{return new URL(e,t).toString()}catch{try{return new URL(e).toString()}catch{try{let n=new URL(e,new URL(t,`https://bippy.invalid/`));return`${n.pathname}${n.search}${n.hash}`}catch{return null}}}},sa=e=>{try{let t=new URL(e),n=t.pathname.lastIndexOf(`.bundle`);if(n===-1)return null;let r=t.pathname.slice(n+7);if(r&&!r.startsWith(`//&`))return null;if(t.pathname=`${t.pathname.slice(0,n)}.map`,r){let e=new URLSearchParams(r.slice(3));for(let[n,r]of e)t.searchParams.set(n,r)}return t.hash=``,t.toString()}catch{return null}},ca=(e,t,n)=>{let r=n.headers.get(`sourcemap`)??n.headers.get(`x-sourcemap`);if(r)return oa(r.trim(),e);let i,a=t.length;for(;a>0&&!i;){let e=t.lastIndexOf(`
|
|
50
|
+
`,a-1)+1,n=t.slice(e,a).match(Yi);n&&(i=n[1]||n[2]),a=e-1}return i?oa(i,e):sa(e)},la=e=>{if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`version`),n=Reflect.get(e,`mappings`),r=Reflect.get(e,`file`),i=Reflect.get(e,`names`),a=Reflect.get(e,`sourceRoot`),o=Reflect.get(e,`sources`),s=Reflect.get(e,`sourcesContent`),c=Reflect.get(e,`ignoreList`),l=Reflect.get(e,`x_google_ignoreList`);if(t!==3||typeof n!=`string`||r!==void 0&&typeof r!=`string`||i!==void 0&&(!Array.isArray(i)||i.some(e=>typeof e!=`string`))||a!==void 0&&typeof a!=`string`||s!==void 0&&(!Array.isArray(s)||s.some(e=>typeof e!=`string`&&e!==null))||c!==void 0&&(!Array.isArray(c)||c.some(e=>!Number.isInteger(e)||e<0))||l!==void 0&&(!Array.isArray(l)||l.some(e=>!Number.isInteger(e)||e<0))||!Array.isArray(o)||o.some(e=>typeof e!=`string`)||s&&s.length!==o.length)return!1;let u=o.length;return[...c??[],...l??[]].every(e=>e<u)},ua=e=>{if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`version`),n=Reflect.get(e,`sections`);return t!==3||!Array.isArray(n)?!1:n.every(e=>{if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`map`),n=Reflect.get(e,`url`),r=Reflect.get(e,`offset`);if(typeof r!=`object`||!r)return!1;let i=Reflect.get(r,`column`),a=Reflect.get(r,`line`);return la(t)!==(typeof n==`string`&&n.length>0)&&typeof i==`number`&&Number.isInteger(i)&&i>=0&&typeof a==`number`&&Number.isInteger(a)&&a>=0})},da=e=>{let t=e.ignoreList??e.x_google_ignoreList;return t?.length?new Set(t):void 0},fa=(e,t,n)=>{if(!e||ui.test(t)||t.startsWith(`/`))return t;let r=e.endsWith(`/`)?e:`${e}/`,i=t.replace(/^\.\//,``);try{let e=ui.test(r)?r:new URL(r,n).toString();return new URL(i,e).toString()}catch{let e=`${r}${i}`.split(`/`),t=[];for(let n of e)n===`..`?t.pop():n!==`.`&&t.push(n);return t.join(`/`)}},pa=(e,t)=>e.sources.map(n=>fa(e.sourceRoot,n,t)),ma=e=>Ji.test(e)?void 0:e,ha=(e,t)=>{try{return{file:e.file,ignoredSourceIndices:da(e),mappings:Gi(e.mappings),names:e.names,sourceMapUrl:ma(t),sourceRoot:e.sourceRoot,sources:pa(e,t),sourcesContent:e.sourcesContent,version:3}}catch{return null}},ga=async(e,t,n)=>{let r=[],i=-1,a=-1;for(let o of e.sections){if(o.offset.line<i||o.offset.line===i&&o.offset.column<=a)return null;i=o.offset.line,a=o.offset.column;let e=o.url?oa(o.url,t):null,s=o.map??(e?await n(e):null);if(!s)return null;let c=e??t;try{r.push({map:{...s,ignoredSourceIndices:da(s),mappings:Gi(s.mappings),sources:pa(s,c)},offset:o.offset})}catch{return null}}let o=/* @__PURE__ */ new Set;for(let e of r)for(let t of e.map.sources)o.add(t);return{file:e.file,mappings:[],names:[],sections:r,sourceMapUrl:ma(t),sourceRoot:void 0,sources:Array.from(o),sourcesContent:void 0,version:3}},_a=(e,t=!1)=>{if(!e)return!1;let n=e.trim();if(!n)return!1;let r=n.match(ui);if(!r)return!0;let i=r[0].toLowerCase();return t||na.has(i)},va=()=>typeof window>`u`&&typeof process<`u`&&typeof process.versions?.node==`string`,ya=e=>{try{let t=new URL(e);return(t.protocol===`http:`||t.protocol===`https:`)&&!t.username&&!t.password}catch{return!1}},ba=e=>{try{return new URL(e).protocol}catch{return null}},xa=e=>{let t=ba(e);return t!==null&&ta.has(t)},Sa=(e,t)=>{try{let n=new URL(e),r=new URL(t);return n.protocol===r.protocol&&n.host===r.host}catch{return!1}},Ca=(e,t,n,r)=>{if(Ji.test(t))return!0;if(!_a(t,r))return!1;let i=ba(e),a=ba(t),o=i!==null&&!na.has(i)||a!==null&&!na.has(a);return!(n||o||xa(e)||xa(t))||Sa(e,t)},wa=e=>e===408||e===425||e===429||e>=500,Ta=e=>{if(e.ok)return!0;if(wa(e.status))throw new Qi;return!1},Ea=(e,t,n)=>!n||t.url.length===0||Sa(e,t.url),Da=e=>{if(e.timeoutMs===void 0||e.timeoutMs<0)return{cleanup:()=>{},signal:e.signal};let t=new AbortController,n=()=>t.abort(e.signal?.reason);e.signal?.aborted?n():e.signal?.addEventListener(`abort`,n,{once:!0});let r=setTimeout(()=>t.abort(new Nr(`Source map request timed out`)),e.timeoutMs);return{cleanup:()=>{clearTimeout(r),e.signal?.removeEventListener(`abort`,n)},signal:t.signal}},Oa=async(e,t)=>{let n=Number(e.headers.get(`content-length`));if(Number.isFinite(n)&&n>t)return null;if(!e.body){let n=await e.text();return new TextEncoder().encode(n).byteLength>t?null:n}let r=e.body.getReader(),i=new TextDecoder,a=[],o=0;try{for(;;){let{done:e,value:n}=await r.read();if(e)break;if(o+=n.byteLength,o>t)return await r.cancel(),null;a.push(i.decode(n,{stream:!0}))}return a.push(i.decode()),a.join(``)}finally{r.releaseLock()}},ka=e=>{try{if(typeof globalThis.atob==`function`)return new TextDecoder().decode(Uint8Array.from(globalThis.atob(e),e=>e.charCodeAt(0)))}catch{return null}let t=e.replace(/\s/g,``).replace(/=+$/,``),n=[],r=0,i=0;for(let e of t){let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.indexOf(e);if(t===-1)return null;r=r*64+t,i+=6,i>=8&&(i-=8,n.push(Math.floor(r/2**i)&255),r%=2**i)}return new TextDecoder().decode(Uint8Array.from(n))},Aa=(e,t)=>{let n=e.indexOf(`,`);if(n===-1)return null;let r=e.slice(0,n),i=e.slice(n+1);if(i.length>t*2)return null;try{let e=r.toLowerCase().includes(`;base64`)?ka(i):decodeURIComponent(i);return e===null||new TextEncoder().encode(e).byteLength>t?null:JSON.parse(e)}catch{return null}},ja=async(e,t,n,r,i)=>{if(Ji.test(e))return Aa(e,r);let a=await t(e,{redirect:i?`error`:`follow`,signal:n});if(!Ta(a)||!Ea(e,a,i))return null;let o=await Oa(a,r);if(o===null)return null;try{return JSON.parse(o)}catch{return null}},Ma=async(e,t,n={})=>{let r=t!==void 0;if(!_a(e,r))return null;let i=va(),a=(i||xa(e))&&!n.allowCrossOriginSourceMap;if(i&&!t&&(!n.allowUnsafeServerFetch||!ya(e)))return null;let o=t??(typeof globalThis.fetch==`function`?globalThis.fetch.bind(globalThis):void 0);if(!o)return null;let s=n.maxBundleSizeBytes??26214400,c=n.maxSourceMapSizeBytes??104857600;if(s<0||c<0)return null;let l=Da(n);try{let t=await o(e,{redirect:a?`error`:`follow`,signal:l.signal});if(!Ta(t)||!Ea(e,t,a))return null;let n=await Oa(t,s);if(n===null)return null;let i=ca(e,n,t);if(!i||!Ca(e,i,a,r))return null;let u=await ja(i,o,l.signal,c,a);return la(u)?ha(u,i):ua(u)?ga(u,i,async t=>{if(!Ca(e,t,a,r))return null;let n=await ja(t,o,l.signal,c,a);return la(n)?n:null}):null}finally{l.cleanup()}},Na=(e,t,n)=>{if(!n)return t;let r=e.get(n);return r||(r=/* @__PURE__ */ new Map,e.set(n,r)),r},Pa=e=>Na(Zi,Xi,e),Fa=e=>Na(ea,$i,e),Ia=(e,t)=>t.allowCrossOriginSourceMap===void 0&&t.allowUnsafeServerFetch===void 0&&t.maxBundleSizeBytes===void 0&&t.maxSourceMapSizeBytes===void 0&&t.timeoutMs===void 0?e:`${e}\0${t.allowCrossOriginSourceMap??``}\0${t.allowUnsafeServerFetch??``}\0${t.maxBundleSizeBytes??``}\0${t.maxSourceMapSizeBytes??``}\0${t.timeoutMs??``}`,La=async(e,t=!0,n,r={})=>{let i=t&&r.signal===void 0,a=Pa(n),o=Fa(n),s=Ia(e,r);if(i&&a.has(s))return a.get(s)??null;let c=i?o.get(s):void 0;if(c)return(await c).sourceMap;let l=Ma(e,n,r).then(e=>({sourceMap:e,isTransientFailure:!1}),()=>({sourceMap:null,isTransientFailure:!0}));i&&o.set(s,l);let{sourceMap:u,isTransientFailure:d}=await l;return i&&(o.delete(s),d||a.set(s,u)),u},Ra=async(e,t=!0,n,r={})=>Promise.all(e.map(async e=>{if(!e.fileName)return e;let i=await La(e.fileName,t,n,r);if(!i||typeof e.lineNumber!=`number`||typeof e.columnNumber!=`number`)return e;let a=aa(i,e.lineNumber,e.columnNumber);return a?{...e,source:a.fileName&&e.source?e.source.replace(e.fileName,a.fileName):e.source,fileName:a.fileName,functionName:a.functionName??e.functionName,lineNumber:a.lineNumber,columnNumber:a.columnNumber,isIgnoreListed:a.isIgnoreListed,isSymbolicated:!0}:e})),za=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack==`string`,Ba=e=>`tag`in e&&typeof e.tag==`number`,Va=e=>{let t=null;if(zr(e,n=>{if(n===e)return!1;let r=n._debugOwner;return(r===e||e.alternate!==null&&r===e.alternate)&&n._debugStack instanceof Error&&(t=n._debugStack,!0)}),!t)return null;let{frames:n,isTrusted:r}=Pi(t);if(!r)return null;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t.fileName)return{...t,lineNumber:t.enclosingLineNumber||t.lineNumber,columnNumber:t.enclosingColumnNumber||t.columnNumber}}return null},Ha=()=>{let e=[];for(let t of Fi())e.push({currentDispatcherRef:t,value:Ii(t)}),Li(t,null);return e},Ua=e=>{for(let{currentDispatcherRef:t,value:n}of e)Li(t,n)},Wa=e=>`\n in ${e}`,Ga=(e,t,n)=>{if(n){let t=Za(n.stack??``),r=t.lastIndexOf(`
|
|
51
|
+
`),i=r===-1?t:t.slice(r+1);if(i.includes(e))return`\n${i}`}return Wa(`${e}${t?` [${t}]`:``}`)},Ka=!1,qa=/* @__PURE__ */ new WeakMap,Ja=(e,t)=>{if(!e||Ka)return``;let n=qa.get(e);if(n!==void 0)return n;let r=bi();xi(void 0),Ka=!0;let i=Ha(),a=console.error,o=console.warn;console.error=()=>{},console.warn=()=>{};try{let n={DetermineComponentFrameRoot(){let n;try{if(t){let t=function(){throw Error()};Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}});try{Reflect.construct(t,[])}catch(e){n=e}Reflect.construct(e,[],t)}else{try{throw Error()}catch(e){n=e}let t=Function.prototype.apply.call(e,void 0,[]);typeof t==`object`&&t&&`catch`in t&&typeof t.catch==`function`&&t.catch(()=>void 0)}}catch(e){if(e instanceof Error&&n instanceof Error&&typeof e.stack==`string`)return[e.stack,n.stack]}return[null,null]}};Object.defineProperty(n.DetermineComponentFrameRoot,"displayName",{value:`DetermineComponentFrameRoot`}),Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,`name`)?.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});let[r,i]=n.DetermineComponentFrameRoot();if(r&&i){let t=r.split(`
|
|
52
52
|
`),n=i.split(`
|
|
53
|
-
`),a=0,o=0;for(;a<t.length&&!t[a].includes(`DetermineComponentFrameRoot`);)a++;for(;o<n.length&&!n[o].includes(`DetermineComponentFrameRoot`);)o++;if(a===t.length||o===n.length)for(a=t.length-1,o=n.length-1;a>=1&&o>=0&&t[a]!==n[o];)o--;for(;a>=1&&o>=0;a--,o--)if(t[a]!==n[o]){if(a!==1||o!==1)do if(a--,o--,o<0||t[a]!==n[o]){let n=`\n${t[a].replace(` at new `,` at `)}`,[r]=
|
|
53
|
+
`),a=0,o=0;for(;a<t.length&&!t[a].includes(`DetermineComponentFrameRoot`);)a++;for(;o<n.length&&!n[o].includes(`DetermineComponentFrameRoot`);)o++;if(a===t.length||o===n.length)for(a=t.length-1,o=n.length-1;a>=1&&o>=0&&t[a]!==n[o];)o--;for(;a>=1&&o>=0;a--,o--)if(t[a]!==n[o]){if(a!==1||o!==1)do if(a--,o--,o<0||t[a]!==n[o]){let n=`\n${t[a].replace(` at new `,` at `)}`,[r]=Ti(n);if(!r?.fileName)break;let i=Wr(e);return i&&n.includes(`<anonymous>`)&&(n=n.replace(`<anonymous>`,i)),qa.set(e,n),n}while(a>=1&&o>=0);break}}}finally{Ka=!1,xi(r),Ua(i),console.error=a,console.warn=o}let s=Wr(e),c=s?Wa(s):``;return qa.set(e,c),c},Ya=(e,t)=>{let n=``,r=kr(e);switch(e.tag){case r.ActivityComponent:n=Wa(`Activity`);break;case r.ClassComponent:n=Ja(e.type,!0);break;case r.ForwardRef:n=Ja(Ur(e.type)??e.type,!1);break;case r.FunctionComponent:case r.SimpleMemoComponent:n=Ja(Ur(e.type)??e.type,!1);break;case r.HostComponent:case r.HostHoistable:case r.HostSingleton:typeof e.type==`string`&&(n=Wa(e.type));break;case r.LazyComponent:n=Wa(`Lazy`);break;case r.SuspenseComponent:n=e.child!==t&&t!==null?Wa(`Suspense Fallback`):Wa(`Suspense`);break;case r.SuspenseListComponent:n=Wa(`SuspenseList`);break;case r.ViewTransitionComponent:n=Wa(`ViewTransition`);break;default:return``}return n},Xa=e=>{try{let t=``,n=e,r=null;do{t+=Ya(n,r);let e=n._debugInfo;if(e&&Array.isArray(e))for(let n=e.length-1;n>=0;n--){let r=e[n];typeof r.name==`string`&&(t+=Ga(r.name,r.env,r.debugLocation))}r=n,n=n.return}while(n);return t}catch(e){return e instanceof Error?`\nBippy couldn’t generate the stack: ${e.message}\n${e.stack}`:``}},Za=e=>{let t=e;if(!t)return``;t.startsWith(`Error: react-stack-top-frame
|
|
54
54
|
`)&&(t=t.slice(29));let n=t.indexOf(`
|
|
55
|
-
`);n!==-1&&(t=t.slice(n+1));let r=Math.max(...
|
|
56
|
-
`,r)),r!==-1)t=t.slice(0,r);else return``;return t},Ya=e=>!!(e.functionName&&e.fileName&&$a(e.fileName)),Xa=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,Za=e=>{let t=/* @__PURE__ */ new Map;for(let n of e){if(!Ya(n))continue;let e=n.functionName,r=t.get(e)??[];r.some(e=>Xa(e,n))||(r.push(n),t.set(e,r))}return t},Qa=(e,t,n)=>{if(!e.functionName)return{...e,isServer:!0};let r=t.get(e.functionName);if(!r||r.length===0)return{...e,isServer:!0};let i=n.get(e.functionName)??0,a=r[i%r.length];return n.set(e.functionName,i+1),{...e,isServer:!0,fileName:a.fileName,lineNumber:a.lineNumber,columnNumber:a.columnNumber,source:e.source?.replace(mi,`(${a.fileName}:${a.lineNumber}:${a.columnNumber})`)}},$a=e=>li.some(t=>e.startsWith(t)),eo=e=>!e.isServer&&e.fileName&&$a(e.fileName)?{...e,isServer:!0}:e,to=e=>{let t=[],n=e;for(;n;)if(La(n)){let e=n;if(n=e._debugOwner,n&&Ia(e)){let{frames:n,isTrusted:r}=ji(e._debugStack);if(r)for(let e of n)t.push(eo(e))}}else{let e=n;if(n=e.owner,n&&e.debugStack instanceof Error)for(let n of ji(e.debugStack).frames)t.push({...n,isServer:!0})}return t},no=e=>{let t=[];return Ir(e,e=>{if(!Ia(e))return;let{frames:n,isTrusted:r}=ji(e._debugStack);r&&t.push(...n)},!0),t},ro=e=>{let t=no(e),n=Si(qa(e)),r=Za(t),i=/* @__PURE__ */ new Map;return n.map(e=>e.source!==void 0&&mi.test(e.source)?Qa(e,r,i):e).filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return e.functionName!==r.functionName})},io=async(e,t=!0,n,r={})=>Fa(ro(e),t,n,r),ao=e=>!!e.fileName&&!e.isIgnoreListed,oo=async(e,t=!0,n,r={})=>{let i=to(e);if(i.length>0){let a=Ra(e)??{};a.functionName=Vr(e.type)??a.functionName;let o=await Fa([a,...i],t,n,r);if(o.some((e,t)=>t>0&&ao(e)))return o}return io(e,t,n,r)},so=e=>e.split(`/`).filter(Boolean).length,co=e=>{let t=e.indexOf(`/`,1);if(t===-1)return e;let n=e.slice(0,t);if(so(n)!==1)return e;let r=e.slice(t);if(!di.test(r))return e;let i=r.split(`/`).filter(Boolean);if(i.length<2)return e;let a=i[0];return a.startsWith(`@`)||a.length>4?e:r},lo=e=>{if(!e||ui.some(t=>t===e))return``;let t=e,n=/^[a-zA-Z]:[\\/]/.test(t);if(t.startsWith(`http://`)||t.startsWith(`https://`)){try{t=new URL(t).pathname}catch{}t=co(t)}if(t.startsWith(`about://React/`)){let e=t.slice(14),n=e.indexOf(`/`),r=e.indexOf(`:`);t=n!==-1&&(r===-1||n<r)?e.slice(n+1):e}let r=!0;for(;r;){r=!1;for(let e of ci)if(t.startsWith(e)){t=t.slice(e.length),e===`file:///`&&(t=`/${t.replace(/^\/+/,``)}`),r=!0;break}}if(!n){let e=t.match(si);e&&(t=t.slice(e[0].length))}if(t.startsWith(`//`)){let e=t.indexOf(`/`,2);t=e===-1?``:t.slice(e)}let i=t.indexOf(`?`);if(i!==-1){let e=t.slice(i);pi.test(e)&&(t=t.slice(0,i))}return t},uo=e=>{let t=lo(e);return!(!t||!di.test(t)||fi.test(t))},fo=Symbol.for(`react.context`),po=Symbol.for(`react.recoverable`),mo=[],ho=null,go=Error("Suspense interrupted this render. This error is an internal implementation detail of `use`."),Y=()=>{let e=ho;return e!==null&&(ho=e.next),e},_o=e=>typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`,vo=e=>typeof e==`object`&&!!e&&`current`in e,yo=e=>typeof e==`object`&&!!e&&`_currentValue`in e,bo=e=>e._currentValue,X=(e,t,n,r=null,i=null)=>{mo.push({displayName:r,primitive:e,stackError:Error(),value:t,debugInfo:i,dispatcherHookName:n})},xo=e=>{if(typeof e==`object`&&e){if(_o(e)){let t=e,n=_o(t)?t:e;switch(n.status){case`fulfilled`:return X(`Promise`,n.value,`Use`,null,n._debugInfo??null),n.value;case`rejected`:throw n.reason}throw X(`Unresolved`,n,`Use`,null,n._debugInfo??null),go}if(`$$typeof`in e&&e.$$typeof===po){X(`Recoverable`,void 0,`Use`);return}if(`$$typeof`in e&&e.$$typeof===fo&&yo(e)){let t={_currentValue:e._currentValue,displayName:typeof e.displayName==`string`?e.displayName:void 0},n=bo(t);return X(`Context (use)`,n,`Use`,t.displayName||`Context`),n}}throw new Or(`use() received an unsupported value: `+String(e))},So=e=>{let t=bo(e);return X(`Context`,t,`Context`,e.displayName||null),t},Co=e=>{let t=Y(),n=t===null?typeof e==`function`?e():e:t.memoizedState;return X(`State`,n,`State`),[n,()=>{}]},wo=(e,t,n)=>{let r=Y(),i=r===null?n===void 0?t:n(t):r.memoizedState;return X(`Reducer`,i,`Reducer`),[i,()=>{}]},To=e=>{let t=Y(),n=vo(t?.memoizedState)?t.memoizedState:{current:e};return X(`Ref`,n.current,`Ref`),n},Eo=()=>{let e=Y();return X(`CacheRefresh`,e===null?()=>{}:e.memoizedState,`CacheRefresh`),()=>{}},Do=e=>{Y(),X(`LayoutEffect`,e,`LayoutEffect`)},Oo=e=>{Y(),X(`InsertionEffect`,e,`InsertionEffect`)},ko=e=>{Y(),X(`Effect`,e,`Effect`)},Ao=e=>{Y();let t=vo(e)?e.current:void 0;X(`ImperativeHandle`,t,`ImperativeHandle`)},jo=(e,t)=>{X(`DebugValue`,typeof t==`function`?t(e):e,`DebugValue`)},Mo=e=>{let t=Y();return X(`Callback`,Array.isArray(t?.memoizedState)?t.memoizedState[0]:e,`Callback`),e},No=e=>{let t=Y(),n=Array.isArray(t?.memoizedState)?t.memoizedState[0]:e();return X(`Memo`,n,`Memo`),n},Po=(e,t)=>{let n=Y();Y();let r=n===null?t():n.memoizedState;return X(`SyncExternalStore`,r,`SyncExternalStore`),r},Fo=()=>{let e=Y();Y();let t=e?.memoizedState===!0;return X(`Transition`,t,`Transition`),[t,()=>{}]},Io=e=>{let t=Y(),n=t===null?e:t.memoizedState;return X(`DeferredValue`,n,`DeferredValue`),n},Lo=()=>{let e=Y(),t=typeof e?.memoizedState==`string`?e.memoizedState:``;return X(`Id`,t,`Id`),t},Ro=e=>[],zo=e=>{let t=Y(),n=t===null?e:t.memoizedState;return X(`Optimistic`,n,`Optimistic`),[n,()=>{}]},Bo=(e,t)=>{let n,r=null,i=null;if(e!==null){let t=e.memoizedState;if(_o(t))switch(t.status){case`fulfilled`:n=t.value,r=t._debugInfo??null;break;case`rejected`:i=t.reason;break;default:i=go,n=t,r=t._debugInfo??null}else n=t}else n=t;return{value:n,debugInfo:r,error:i}},Vo=e=>(t,n)=>{let r=Y();Y(),Y();let{value:i,debugInfo:a,error:o}=Bo(r,n);if(X(e,i,e,null,a),o!==null)throw o;return[i,()=>{},!1]},Ho=Vo(`ActionState`),Uo={readContext:bo,use:xo,useCallback:Mo,useContext:So,useEffect:ko,useImperativeHandle:Ao,useLayoutEffect:Do,useInsertionEffect:Oo,useMemo:No,useReducer:wo,useRef:To,useState:Co,useDebugValue:jo,useDeferredValue:Io,useTransition:Fo,useSyncExternalStore:Po,useId:Lo,useHostTransitionStatus:()=>{let e=bo({_currentValue:null});return X(`HostTransitionStatus`,e,`HostTransitionStatus`),e},useFormState:Vo(`FormState`),useActionState:Ho,useOptimistic:zo,useMemoCache:Ro,useCacheRefresh:Eo,useEffectEvent:e=>(Y(),X(`EffectEvent`,e,`EffectEvent`),e)};new Proxy(Uo,{get(e,t){if(Object.hasOwn(e,t))return Reflect.get(e,t);throw new kr(`The React dispatcher is missing method `+t)}});let Wo=e=>{if(!e)return``;let t=e.lastIndexOf(`[as `);if(t!==-1)return Wo(e.slice(t+4,-1));if(t=e.lastIndexOf(`.`),t=t===-1?0:t+1,e.slice(t).startsWith(`unstable_`)&&(t+=9),e.slice(t).startsWith(`experimental_`)&&(t+=13),e.slice(t,t+3)===`use`){if(e.length-t===3)return`Use`;t+=3}return e.slice(t)};new Set([X,...Object.values(Uo)].map(e=>Wo(e.name)));let Go=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform)?`⌥ Option`:`Alt`,Ko=[`top`,`right`,`bottom`,`left`];function qo(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Jo(e){return Math.round(e*10)/10}function Yo(e,t){let n=t.right<=e.left||t.left>=e.right,r=t.bottom<=e.top||t.top>=e.bottom,i=$o(e.left,e.right,t.left,t.right),a=$o(e.top,e.bottom,t.top,t.bottom),o=[];if(n||r)return t.bottom<=e.top?o.push(Zo(`top`,i,t.bottom,e.top,t)):t.top>=e.bottom&&o.push(Zo(`bottom`,i,e.bottom,t.top,t)),t.right<=e.left?o.push(Qo(`left`,a,t.right,e.left,t)):t.left>=e.right&&o.push(Qo(`right`,a,e.right,t.left,t)),o;let s=[[`top`,e.top,t.top],[`right`,e.right,t.right],[`bottom`,e.bottom,t.bottom],[`left`,e.left,t.left]];for(let[e,t,n]of s){let r=Jo(Math.abs(t-n));if(r===0)continue;let[s,c]=t<n?[t,n]:[n,t];o.push(e===`top`||e===`bottom`?{side:e,value:r,from:{x:i,y:s},to:{x:i,y:c}}:{side:e,value:r,from:{x:s,y:a},to:{x:c,y:a}})}return o}function Xo(e,t){let n={...t};for(let t of e)n[t.side]=t.value;return n}function Zo(e,t,n,r,i){let a={side:e,value:Jo(r-n),from:{x:t,y:n},to:{x:t,y:r}};if(t<i.left||t>i.right){let n=e===`top`?i.bottom:i.top;a.extension={from:{x:t<i.left?i.left:i.right,y:n},to:{x:t,y:n}}}return a}function Qo(e,t,n,r,i){let a={side:e,value:Jo(r-n),from:{x:n,y:t},to:{x:r,y:t}};if(t<i.top||t>i.bottom){let n=e===`left`?i.right:i.left;a.extension={from:{x:n,y:t<i.top?i.top:i.bottom},to:{x:n,y:t}}}return a}function $o(e,t,n,r){let i=Math.max(e,n),a=Math.min(t,r);return i<=a?(i+a)/2:(e+t)/2}function es(e){let t=getComputedStyle(e),n=e=>Ko.map(n=>Jo(ns(t.getPropertyValue(e(n))))),r={margin:n(e=>`margin-${e}`),padding:n(e=>`padding-${e}`),border:n(e=>`border-${e}-width`)};if(/flex|grid/.test(t.display)){let e=Jo(ns(t.rowGap)),n=Jo(ns(t.columnGap));(e>0||n>0)&&(r.gap={row:e,column:n})}return r}function ts(e,t,n){let r=[...e.children].slice(0,100).map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0),i=[];for(let e=1;e<r.length;e++){let a=r[e-1],o=r[e];t.column>0&&o.left>=a.right-.5&&o.top<a.bottom?i.push({axis:`column`,left:a.right,right:o.left,top:Math.max(a.top,o.top),bottom:Math.min(a.bottom,o.bottom)}):t.row>0&&o.top>=a.bottom-.5&&i.push({axis:`row`,left:n.left,right:n.right,top:a.bottom,bottom:o.top})}return i.filter(e=>e.right-e.left>.5&&e.bottom-e.top>.5)}function ns(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}let rs={top:`t`,right:`r`,bottom:`b`,left:`l`},is={top:`y`,right:`x`,bottom:`y`,left:`x`};function as(e,t,n,r){let i=new Set(e.classList),a=t===`gap`?[`gap-${n===`row`?`y`:`x`}`,`gap`]:[`${t[0]}${rs[n]}`,`${t[0]}${is[n]}`,t[0]];for(let e of a){let t=[...i].find(t=>t.startsWith(`${e}-`));if(!t)continue;let n=os(t.slice(e.length+1));return n!==void 0&&Math.abs(n-r)<.5?t:void 0}}function os(e){if(e===`px`)return 1;let t=e.match(/^\[(-?[\d.]+)(px|rem)\]$/);if(t)return Number(t[1])*(t[2]===`rem`?ss():1);if(/^\d+(?:\.\d+)?$/.test(e))return Number(e)*.25*ss()}function ss(){return ns(getComputedStyle(document.documentElement).fontSize)||16}async function cs(e){let t=e.getBoundingClientRect(),n=window.getSelection()?.toString().trim(),r=es(e);return{tagName:e.tagName.toLowerCase(),selector:us(e),html:hs(e),text:_s(e),components:await vs(e),box:r,rect:{x:t.x,y:t.y,width:t.width,height:t.height},viewport:{width:window.innerWidth,height:window.innerHeight,dpr:Math.round(window.devicePixelRatio*100)/100},...n&&e.contains(window.getSelection()?.anchorNode??null)?{selection:n}:{}}}function ls(e){let t=e.tagName.toLowerCase(),n=ws(e);if(!n)return t;let r=null;return Ir(n,e=>Fr(e)?(r=Vr(e.type),!(!r||Ts(r))):!1,!0),r?`${r} · ${t}`:t}function us(e){let t=[],n=e;for(;n&&n!==document.documentElement;){let r=ds(n);if(r){t.unshift(r);let n=t.join(` > `);if(ps(n,e))return n}else{t.unshift(fs(n));let r=t.join(` > `);if(t.length>=2&&ps(r,e))return r}n=n.parentElement}return t.join(` > `)}function ds(e){for(let t of[`data-testid`,`data-test`,`data-cy`,`data-tencil-id`]){let n=e.getAttribute(t);if(n)return`${e.tagName.toLowerCase()}[${t}="${CSS.escape(n)}"]`}let t=e.id;return t&&!/[:«»]|\d{3,}/.test(t)?`#${CSS.escape(t)}`:null}function fs(e){let t=e.tagName.toLowerCase(),n=e.parentElement;if(!n)return t;let r=[...n.children].filter(t=>t.tagName===e.tagName);return r.length===1?t:`${t}:nth-of-type(${r.indexOf(e)+1})`}function ps(e,t){try{let n=document.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}let ms=[`id`,`class`,`href`,`src`,`alt`,`type`,`name`,`role`,`aria-label`];function hs(e){let t=e.tagName.toLowerCase(),n=`<${[t,...[...e.attributes].filter(e=>!e.name.startsWith(`data-tencil`)).sort((e,t)=>gs(e.name)-gs(t.name)).slice(0,8).map(e=>{let t=e.name===`class`?80:120;return e.value?`${e.name}="${ks(e.value,t)}"`:e.name})].join(` `)}>`,r=e.children.length;return`${n}${r>0?`…${r} element${r===1?``:`s`}…`:ks(e.textContent?.trim()??``,100)}</${t}>`}function gs(e){let t=ms.indexOf(e);return t===-1?ms.length:t}function _s(e){let t=e.innerText?.replace(/\s+/g,` `).trim();return t?ks(t,200):void 0}async function vs(e){let t=ys(e);if(t.length>0)return t;let n=ws(e);if(!n)return[];try{let e=await As(oo(n),1500),t=xs(n),r=e.filter(e=>e.functionName&&!/^[a-z]/.test(e.functionName)&&!Ts(e.functionName)).slice(0,6).map(e=>Ss(e,t.get(e.functionName)));if(r.length>0)return r}catch{}return Cs(n)}function ys(e){let t=[],n;for(let r=e;r&&t.length<6;r=r.parentElement){let e=r.getAttribute(`data-tencil-src`)?.match(/^(.+):(\d+):(\d+)$/);if(!e)continue;let[,i=``,a,o]=e,s=r.getAttribute(`data-tencil-component`)??bs(i);s!==n&&(n=s,t.push({name:s,source:{file:i,line:Number(a),column:Number(o)}}))}return t}function bs(e){return e.slice(e.lastIndexOf(`/`)+1)}function xs(e){let t=/* @__PURE__ */ new Map;try{for(let n of to(e))n.functionName&&n.fileName&&!t.has(n.functionName)&&t.set(n.functionName,Ds(n.fileName))}catch{}return t}function Ss(e,t){let n=e.functionName??`Anonymous`;if(!e.fileName)return{name:n};let r=Os(e.fileName);return r?{name:n,library:r}:uo(e.fileName)?{name:n,source:{file:Es(Ds(e.fileName),t),...e.lineNumber==null?{}:{line:e.lineNumber},...e.columnNumber==null?{}:{column:e.columnNumber}}}:{name:n}}function Cs(e){let t=[];return Ir(e,e=>{if(Fr(e)){let n=Vr(e.type);n&&!Ts(n)&&t.push({name:n})}return t.length>=6},!0),t}function ws(e){try{return oi(e)}catch{return null}}function Ts(e){return/^(?:Anonymous|Fragment|Suspense|StrictMode|Profiler|Provider|Consumer|ErrorBoundary|InnerLayoutRouter|OuterLayoutRouter|RedirectBoundary|NotFoundBoundary|LoadingBoundary|HotReload|Router|AppRouter|ServerRoot|ScrollAndFocusHandler|RenderFromTemplateContext)$/.test(e)||/(?:Provider|Context|Boundary)$/.test(e)}function Es(e,t){return e.includes(`/`)||!t?e:t.endsWith(`/${e}`)?t:e}function Ds(e){let t=e;if(/^https?:\/\//.test(e))try{t=decodeURIComponent(new URL(e).pathname)}catch{}return t.replace(/[?#].*$/,``).replace(/^\/@fs/,``).replace(/^(?:webpack-internal:\/\/\/|webpack:\/\/[^/]*\/|turbopack:\/\/\/|rsc:\/\/React\/[^/]+\/|file:\/\/)/,``).replace(/^\/?\((?:app-pages-browser|ssr|rsc)\)\//,``).replace(/^\.\//,``).replace(/^\/(?=(?:src|app|pages|components|lib)\/)/,``)}function Os(e){return e.match(/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?((?:@[^/]+\/)?[^/]+)/)?.[1]}function ks(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function As(e,t){return Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(/* @__PURE__ */ Error(`timeout`)),t))])}let js;function Ms(e){js=e}function Ns(){if(!js)throw Error(`Tencil overlay is not mounted`);return js}let Ps=/* @__PURE__ */ new Map;function Fs(e,t){let n=t??Ls(e.selector);if(!n?.isConnected)return null;let r=n.getBoundingClientRect();return r.width===0&&r.height===0?null:{x:r.left+r.width*e.offsetX,y:r.top+r.height*e.offsetY}}function Is(e,t){let n=e.getBoundingClientRect(),r=(e,t)=>t>0?zs(e/t,0,1):.5;return{offsetX:r(t.x-n.left,n.width),offsetY:r(t.y-n.top,n.height)}}function Ls(e){if(!e)return null;let t=Ps.get(e)?.deref();if(t?.isConnected&&t.matches(e))return t;try{let t=document.querySelector(e);return t&&Ps.set(e,new WeakRef(t)),t}catch{return null}}function Rs(e,t,n=16){let r=window.innerWidth,i=window.innerHeight,a=e.x+n;a+t.width>r-12&&(a=e.x-n-t.width),a=zs(a,12,r-t.width-12);let o=zs(e.y-24,12,i-t.height-12),s=`${zs(e.x-a,0,t.width)}px ${zs(e.y-o,0,t.height)}px`;return{left:a,top:o,origin:s}}function zs(e,t,n){return Math.max(t,Math.min(n,e))}function Bs(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}let Vs;function Hs(){let e=/* @__PURE__ */ new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function Us(e){let t=-1;Vs||=Hs();for(let n=0;n<e.length;n++)t=Vs[(t^e[n])&255]^t>>>8;return t^-1}function Ws(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===112&&e[n-2]===72&&e[n-1]===89&&e[n]===115)return n-3;return 0}function Gs(e,t,n=!1){let r=/* @__PURE__ */ new Uint8Array(13);t*=39.3701,r[0]=112,r[1]=72,r[2]=89,r[3]=115,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let i=Us(r),a=/* @__PURE__ */ new Uint8Array(4);if(a[0]=i>>>24,a[1]=i>>>16,a[2]=i>>>8,a[3]=i&255,n){let t=Ws(e);return e.set(r,t),e.set(a,t+13),e}{let t=/* @__PURE__ */ new Uint8Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=9;let n=/* @__PURE__ */ new Uint8Array(54);return n.set(e,0),n.set(t,33),n.set(r,37),n.set(a,50),n}}function Ks(e){let t=e.indexOf(`AAlwSFlz`);return t===-1&&(t=e.indexOf(`AAAJcEhZ`)),t===-1&&(t=e.indexOf(`AAAACXBI`)),t}let qs=`[modern-screenshot]`,Js=typeof window<`u`,Ys=Js&&`Worker`in window,Xs=Js&&`atob`in window,Zs=Js&&`btoa`in window,Qs=Js?window.navigator?.userAgent:``,$s=Qs.includes(`Chrome`),ec=Qs.includes(`AppleWebKit`)&&!$s,tc=Qs.includes(`Firefox`),nc=e=>e&&`__CONTEXT__`in e,rc=e=>e.constructor.name===`CSSFontFaceRule`,ic=e=>e.constructor.name===`CSSImportRule`,ac=e=>e.constructor.name===`CSSLayerBlockRule`,Z=e=>e.nodeType===1,oc=e=>typeof e.className==`object`,sc=e=>e.tagName===`image`,cc=e=>e.tagName===`use`,lc=e=>Z(e)&&e.style!==void 0&&!oc(e),uc=e=>e.nodeType===8,dc=e=>e.nodeType===3,fc=e=>e.tagName===`IMG`,pc=e=>e.tagName===`VIDEO`,mc=e=>e.tagName===`CANVAS`,hc=e=>e.tagName===`TEXTAREA`,gc=e=>e.tagName===`INPUT`,_c=e=>e.tagName===`STYLE`,vc=e=>e.tagName===`SCRIPT`,yc=e=>e.tagName===`SELECT`,bc=e=>e.tagName===`SLOT`,xc=e=>e.tagName===`IFRAME`,Sc=(...e)=>console.warn(qs,...e);function Cc(e){let t=e?.createElement?.(`canvas`);return t&&(t.height=t.width=1),!!t&&`toDataURL`in t&&!!t.toDataURL(`image/webp`).includes(`image/webp`)}let wc=e=>e.startsWith(`data:`);function Tc(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Js&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!Js)return e;let n=Ec().implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}function Ec(e){return(e&&Z(e)?e?.ownerDocument:e)??window.document}let Dc=`http://www.w3.org/2000/svg`;function Oc(e,t,n){let r=Ec(n).createElementNS(Dc,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function kc(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,``)),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function Ac(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>r(i.error),i.onabort=()=>r(/* @__PURE__ */ Error(`Failed read blob to ${t}`)),t===`dataUrl`?i.readAsDataURL(e):t===`arrayBuffer`&&i.readAsArrayBuffer(e)})}let jc=e=>Ac(e,`dataUrl`);function Mc(e,t){let n=Ec(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function Nc(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?Mc(e,Ec(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),pc(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?Nc(s.poster,t).then(n):u();if(s.readyState>=2)return u();let r=u,i=t=>{o?.(`Failed video load`,e,t),a?.(t),u()};l=()=>{s.removeEventListener(`loadeddata`,r),s.removeEventListener(`error`,i)},s.addEventListener(`loadeddata`,r,{once:!0}),s.addEventListener(`error`,i,{once:!0})}else{let e=sc(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(fc(s)&&`decode`in s)try{await s.decode()}catch(t){o?.(`Failed to decode image, trying to render anyway`,s.dataset.originalSrc||e,t)}u()},n=t=>{o?.(`Failed image load`,s.dataset.originalSrc||e,t),u()};if(fc(s)&&s.complete)return t();l=()=>{s.removeEventListener(`load`,t),s.removeEventListener(`error`,n)},s.addEventListener(`load`,t,{once:!0}),s.addEventListener(`error`,n,{once:!0})}})}async function Pc(e,t){lc(e)&&(fc(e)||pc(e)?await Nc(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>Nc(e,t)))))}let Fc=/* @__PURE__ */ function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}();function Ic(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}let Lc=0;function Rc(e){let t=`${qs}[#${Lc}]`;return Lc++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&Sc(...t)}}function zc(e){return{cache:e?`no-cache`:`force-cache`}}async function Bc(e,t){return nc(e)?e:Vc(e,{...t,autoDestruct:!0})}async function Vc(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(Js?window.document:void 0),c=e.ownerDocument?.defaultView??(Js?window:void 0),l=/* @__PURE__ */ new Map,u={width:0,height:0,quality:1,type:`image/png`,scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:zc(t?.fetch?.bypassingCache),placeholderImage:`data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:Rc(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:Hc(s),svgDefsElement:s?.createElementNS(Dc,`defs`),svgStyles:/* @__PURE__ */ new Map,defaultComputedStyles:/* @__PURE__ */ new Map,workers:[...Array.from({length:Ys&&r&&i?i:0})].map(()=>{try{let e=new Worker(r);return e.onmessage=async e=>{let{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(/* @__PURE__ */ Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{let{url:t}=e.data;l.get(t)?.reject?.(/* @__PURE__ */ Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn(`Failed to new Worker`,e),null}}).filter(Boolean),fontFamilies:/* @__PURE__ */ new Map,fontCssTexts:/* @__PURE__ */ new Map,acceptOfImage:`${[Cc(s)&&`image/webp`,`image/svg+xml`,`image/*`,`*/*`].filter(Boolean).join(`,`)};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:o,isEnable:e=>e===`restoreScrollPosition`?typeof o==`boolean`?!1:o[e]??!1:typeof o==`boolean`?o:o[e]??!0,shadowRoots:[]};u.log.time(`wait until load`),await Pc(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=Uc(e,u);return u.width=d,u.height=f,u}function Hc(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
|
|
55
|
+
`);n!==-1&&(t=t.slice(n+1));let r=Math.max(...vi.map(e=>t.indexOf(e)));if(r!==-1&&(r=t.lastIndexOf(`
|
|
56
|
+
`,r)),r!==-1)t=t.slice(0,r);else return``;return t},Qa=e=>!!(e.functionName&&e.fileName&&no(e.fileName)),$a=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,eo=e=>{let t=/* @__PURE__ */ new Map;for(let n of e){if(!Qa(n))continue;let e=n.functionName,r=t.get(e)??[];r.some(e=>$a(e,n))||(r.push(n),t.set(e,r))}return t},to=(e,t,n)=>{if(!e.functionName)return{...e,isServer:!0};let r=t.get(e.functionName);if(!r||r.length===0)return{...e,isServer:!0};let i=n.get(e.functionName)??0,a=r[i%r.length];return n.set(e.functionName,i+1),{...e,isServer:!0,fileName:a.fileName,lineNumber:a.lineNumber,columnNumber:a.columnNumber,source:e.source?.replace(_i,`(${a.fileName}:${a.lineNumber}:${a.columnNumber})`)}},no=e=>fi.some(t=>e.startsWith(t)),ro=e=>!e.isServer&&e.fileName&&no(e.fileName)?{...e,isServer:!0}:e,io=e=>{let t=[],n=e;for(;n;)if(Ba(n)){let e=n;if(n=e._debugOwner,n&&za(e)){let{frames:n,isTrusted:r}=Pi(e._debugStack);if(r)for(let e of n)t.push(ro(e))}}else{let e=n;if(n=e.owner,n&&e.debugStack instanceof Error)for(let n of Pi(e.debugStack).frames)t.push({...n,isServer:!0})}return t},ao=e=>{let t=[];return zr(e,e=>{if(!za(e))return;let{frames:n,isTrusted:r}=Pi(e._debugStack);r&&t.push(...n)},!0),t},oo=e=>{let t=ao(e),n=Ti(Xa(e)),r=eo(t),i=/* @__PURE__ */ new Map;return n.map(e=>e.source!==void 0&&_i.test(e.source)?to(e,r,i):e).filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return e.functionName!==r.functionName})},so=async(e,t=!0,n,r={})=>Ra(oo(e),t,n,r),co=e=>!!e.fileName&&!e.isIgnoreListed,lo=async(e,t=!0,n,r={})=>{let i=io(e);if(i.length>0){let a=Va(e)??{};a.functionName=Wr(e.type)??a.functionName;let o=await Ra([a,...i],t,n,r);if(o.some((e,t)=>t>0&&co(e)))return o}return so(e,t,n,r)},uo=e=>e.split(`/`).filter(Boolean).length,fo=e=>{let t=e.indexOf(`/`,1);if(t===-1)return e;let n=e.slice(0,t);if(uo(n)!==1)return e;let r=e.slice(t);if(!mi.test(r))return e;let i=r.split(`/`).filter(Boolean);if(i.length<2)return e;let a=i[0];return a.startsWith(`@`)||a.length>4?e:r},po=e=>{if(!e||pi.some(t=>t===e))return``;let t=e,n=/^[a-zA-Z]:[\\/]/.test(t);if(t.startsWith(`http://`)||t.startsWith(`https://`)){try{t=new URL(t).pathname}catch{}t=fo(t)}if(t.startsWith(`about://React/`)){let e=t.slice(14),n=e.indexOf(`/`),r=e.indexOf(`:`);t=n!==-1&&(r===-1||n<r)?e.slice(n+1):e}let r=!0;for(;r;){r=!1;for(let e of di)if(t.startsWith(e)){t=t.slice(e.length),e===`file:///`&&(t=`/${t.replace(/^\/+/,``)}`),r=!0;break}}if(!n){let e=t.match(ui);e&&(t=t.slice(e[0].length))}if(t.startsWith(`//`)){let e=t.indexOf(`/`,2);t=e===-1?``:t.slice(e)}let i=t.indexOf(`?`);if(i!==-1){let e=t.slice(i);gi.test(e)&&(t=t.slice(0,i))}return t},mo=e=>{let t=po(e);return!(!t||!mi.test(t)||hi.test(t))},ho=Symbol.for(`react.context`),go=Symbol.for(`react.recoverable`),_o=[],vo=null,yo=Error("Suspense interrupted this render. This error is an internal implementation detail of `use`."),Y=()=>{let e=vo;return e!==null&&(vo=e.next),e},bo=e=>typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`,xo=e=>typeof e==`object`&&!!e&&`current`in e,So=e=>typeof e==`object`&&!!e&&`_currentValue`in e,Co=e=>e._currentValue,X=(e,t,n,r=null,i=null)=>{_o.push({displayName:r,primitive:e,stackError:Error(),value:t,debugInfo:i,dispatcherHookName:n})},wo=e=>{if(typeof e==`object`&&e){if(bo(e)){let t=e,n=bo(t)?t:e;switch(n.status){case`fulfilled`:return X(`Promise`,n.value,`Use`,null,n._debugInfo??null),n.value;case`rejected`:throw n.reason}throw X(`Unresolved`,n,`Use`,null,n._debugInfo??null),yo}if(`$$typeof`in e&&e.$$typeof===go){X(`Recoverable`,void 0,`Use`);return}if(`$$typeof`in e&&e.$$typeof===ho&&So(e)){let t={_currentValue:e._currentValue,displayName:typeof e.displayName==`string`?e.displayName:void 0},n=Co(t);return X(`Context (use)`,n,`Use`,t.displayName||`Context`),n}}throw new jr(`use() received an unsupported value: `+String(e))},To=e=>{let t=Co(e);return X(`Context`,t,`Context`,e.displayName||null),t},Eo=e=>{let t=Y(),n=t===null?typeof e==`function`?e():e:t.memoizedState;return X(`State`,n,`State`),[n,()=>{}]},Do=(e,t,n)=>{let r=Y(),i=r===null?n===void 0?t:n(t):r.memoizedState;return X(`Reducer`,i,`Reducer`),[i,()=>{}]},Oo=e=>{let t=Y(),n=xo(t?.memoizedState)?t.memoizedState:{current:e};return X(`Ref`,n.current,`Ref`),n},ko=()=>{let e=Y();return X(`CacheRefresh`,e===null?()=>{}:e.memoizedState,`CacheRefresh`),()=>{}},Ao=e=>{Y(),X(`LayoutEffect`,e,`LayoutEffect`)},jo=e=>{Y(),X(`InsertionEffect`,e,`InsertionEffect`)},Mo=e=>{Y(),X(`Effect`,e,`Effect`)},No=e=>{Y();let t=xo(e)?e.current:void 0;X(`ImperativeHandle`,t,`ImperativeHandle`)},Po=(e,t)=>{X(`DebugValue`,typeof t==`function`?t(e):e,`DebugValue`)},Fo=e=>{let t=Y();return X(`Callback`,Array.isArray(t?.memoizedState)?t.memoizedState[0]:e,`Callback`),e},Io=e=>{let t=Y(),n=Array.isArray(t?.memoizedState)?t.memoizedState[0]:e();return X(`Memo`,n,`Memo`),n},Lo=(e,t)=>{let n=Y();Y();let r=n===null?t():n.memoizedState;return X(`SyncExternalStore`,r,`SyncExternalStore`),r},Ro=()=>{let e=Y();Y();let t=e?.memoizedState===!0;return X(`Transition`,t,`Transition`),[t,()=>{}]},zo=e=>{let t=Y(),n=t===null?e:t.memoizedState;return X(`DeferredValue`,n,`DeferredValue`),n},Bo=()=>{let e=Y(),t=typeof e?.memoizedState==`string`?e.memoizedState:``;return X(`Id`,t,`Id`),t},Vo=e=>[],Ho=e=>{let t=Y(),n=t===null?e:t.memoizedState;return X(`Optimistic`,n,`Optimistic`),[n,()=>{}]},Uo=(e,t)=>{let n,r=null,i=null;if(e!==null){let t=e.memoizedState;if(bo(t))switch(t.status){case`fulfilled`:n=t.value,r=t._debugInfo??null;break;case`rejected`:i=t.reason;break;default:i=yo,n=t,r=t._debugInfo??null}else n=t}else n=t;return{value:n,debugInfo:r,error:i}},Wo=e=>(t,n)=>{let r=Y();Y(),Y();let{value:i,debugInfo:a,error:o}=Uo(r,n);if(X(e,i,e,null,a),o!==null)throw o;return[i,()=>{},!1]},Go=Wo(`ActionState`),Ko={readContext:Co,use:wo,useCallback:Fo,useContext:To,useEffect:Mo,useImperativeHandle:No,useLayoutEffect:Ao,useInsertionEffect:jo,useMemo:Io,useReducer:Do,useRef:Oo,useState:Eo,useDebugValue:Po,useDeferredValue:zo,useTransition:Ro,useSyncExternalStore:Lo,useId:Bo,useHostTransitionStatus:()=>{let e=Co({_currentValue:null});return X(`HostTransitionStatus`,e,`HostTransitionStatus`),e},useFormState:Wo(`FormState`),useActionState:Go,useOptimistic:Ho,useMemoCache:Vo,useCacheRefresh:ko,useEffectEvent:e=>(Y(),X(`EffectEvent`,e,`EffectEvent`),e)};new Proxy(Ko,{get(e,t){if(Object.hasOwn(e,t))return Reflect.get(e,t);throw new Mr(`The React dispatcher is missing method `+t)}});let qo=e=>{if(!e)return``;let t=e.lastIndexOf(`[as `);if(t!==-1)return qo(e.slice(t+4,-1));if(t=e.lastIndexOf(`.`),t=t===-1?0:t+1,e.slice(t).startsWith(`unstable_`)&&(t+=9),e.slice(t).startsWith(`experimental_`)&&(t+=13),e.slice(t,t+3)===`use`){if(e.length-t===3)return`Use`;t+=3}return e.slice(t)};new Set([X,...Object.values(Ko)].map(e=>qo(e.name)));let Jo=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform)?`⌥ Option`:`Alt`,Yo=[`top`,`right`,`bottom`,`left`];function Xo(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Zo(e){return Math.round(e*10)/10}function Qo(e,t){let n=t.right<=e.left||t.left>=e.right,r=t.bottom<=e.top||t.top>=e.bottom,i=ns(e.left,e.right,t.left,t.right),a=ns(e.top,e.bottom,t.top,t.bottom),o=[];if(n||r)return t.bottom<=e.top?o.push(es(`top`,i,t.bottom,e.top,t)):t.top>=e.bottom&&o.push(es(`bottom`,i,e.bottom,t.top,t)),t.right<=e.left?o.push(ts(`left`,a,t.right,e.left,t)):t.left>=e.right&&o.push(ts(`right`,a,e.right,t.left,t)),o;let s=[[`top`,e.top,t.top],[`right`,e.right,t.right],[`bottom`,e.bottom,t.bottom],[`left`,e.left,t.left]];for(let[e,t,n]of s){let r=Zo(Math.abs(t-n));if(r===0)continue;let[s,c]=t<n?[t,n]:[n,t];o.push(e===`top`||e===`bottom`?{side:e,value:r,from:{x:i,y:s},to:{x:i,y:c}}:{side:e,value:r,from:{x:s,y:a},to:{x:c,y:a}})}return o}function $o(e,t){let n={...t};for(let t of e)n[t.side]=t.value;return n}function es(e,t,n,r,i){let a={side:e,value:Zo(r-n),from:{x:t,y:n},to:{x:t,y:r}};if(t<i.left||t>i.right){let n=e===`top`?i.bottom:i.top;a.extension={from:{x:t<i.left?i.left:i.right,y:n},to:{x:t,y:n}}}return a}function ts(e,t,n,r,i){let a={side:e,value:Zo(r-n),from:{x:n,y:t},to:{x:r,y:t}};if(t<i.top||t>i.bottom){let n=e===`left`?i.right:i.left;a.extension={from:{x:n,y:t<i.top?i.top:i.bottom},to:{x:n,y:t}}}return a}function ns(e,t,n,r){let i=Math.max(e,n),a=Math.min(t,r);return i<=a?(i+a)/2:(e+t)/2}function rs(e){let t=getComputedStyle(e),n=e=>Yo.map(n=>Zo(as(t.getPropertyValue(e(n))))),r={margin:n(e=>`margin-${e}`),padding:n(e=>`padding-${e}`),border:n(e=>`border-${e}-width`)};if(/flex|grid/.test(t.display)){let e=Zo(as(t.rowGap)),n=Zo(as(t.columnGap));(e>0||n>0)&&(r.gap={row:e,column:n})}return r}function is(e,t,n){let r=[...e.children].slice(0,100).map(e=>e.getBoundingClientRect()).filter(e=>e.width>0||e.height>0),i=[];for(let e=1;e<r.length;e++){let a=r[e-1],o=r[e];t.column>0&&o.left>=a.right-.5&&o.top<a.bottom?i.push({axis:`column`,left:a.right,right:o.left,top:Math.max(a.top,o.top),bottom:Math.min(a.bottom,o.bottom)}):t.row>0&&o.top>=a.bottom-.5&&i.push({axis:`row`,left:n.left,right:n.right,top:a.bottom,bottom:o.top})}return i.filter(e=>e.right-e.left>.5&&e.bottom-e.top>.5)}function as(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}let os={top:`t`,right:`r`,bottom:`b`,left:`l`},ss={top:`y`,right:`x`,bottom:`y`,left:`x`};function cs(e,t,n,r){let i=new Set(e.classList),a=t===`gap`?[`gap-${n===`row`?`y`:`x`}`,`gap`]:[`${t[0]}${os[n]}`,`${t[0]}${ss[n]}`,t[0]];for(let e of a){let t=[...i].find(t=>t.startsWith(`${e}-`));if(!t)continue;let n=ls(t.slice(e.length+1));return n!==void 0&&Math.abs(n-r)<.5?t:void 0}}function ls(e){if(e===`px`)return 1;let t=e.match(/^\[(-?[\d.]+)(px|rem)\]$/);if(t)return Number(t[1])*(t[2]===`rem`?us():1);if(/^\d+(?:\.\d+)?$/.test(e))return Number(e)*.25*us()}function us(){return as(getComputedStyle(document.documentElement).fontSize)||16}async function ds(e){let t=e.getBoundingClientRect(),n=window.getSelection()?.toString().trim(),r=rs(e);return{tagName:e.tagName.toLowerCase(),selector:ps(e),html:vs(e),text:bs(e),components:await xs(e),box:r,rect:{x:t.x,y:t.y,width:t.width,height:t.height},viewport:{width:window.innerWidth,height:window.innerHeight,dpr:Math.round(window.devicePixelRatio*100)/100},...n&&e.contains(window.getSelection()?.anchorNode??null)?{selection:n}:{}}}function fs(e){let t=e.tagName.toLowerCase(),n=Ds(e);if(!n)return t;let r=null;return zr(n,e=>Rr(e)?(r=Wr(e.type),!(!r||Os(r))):!1,!0),r?`${r} · ${t}`:t}function ps(e){let t=[],n=e;for(;n&&n!==document.documentElement;){let r=ms(n);if(r){t.unshift(r);let n=t.join(` > `);if(gs(n,e))return n}else{t.unshift(hs(n));let r=t.join(` > `);if(t.length>=2&&gs(r,e))return r}n=n.parentElement}return t.join(` > `)}function ms(e){for(let t of[`data-testid`,`data-test`,`data-cy`,`data-tencil-id`]){let n=e.getAttribute(t);if(n)return`${e.tagName.toLowerCase()}[${t}="${CSS.escape(n)}"]`}let t=e.id;return t&&!/[:«»]|\d{3,}/.test(t)?`#${CSS.escape(t)}`:null}function hs(e){let t=e.tagName.toLowerCase(),n=e.parentElement;if(!n)return t;let r=[...n.children].filter(t=>t.tagName===e.tagName);return r.length===1?t:`${t}:nth-of-type(${r.indexOf(e)+1})`}function gs(e,t){try{let n=document.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}let _s=[`id`,`class`,`href`,`src`,`alt`,`type`,`name`,`role`,`aria-label`];function vs(e){let t=e.tagName.toLowerCase(),n=`<${[t,...[...e.attributes].filter(e=>!e.name.startsWith(`data-tencil`)).sort((e,t)=>ys(e.name)-ys(t.name)).slice(0,8).map(e=>{let t=e.name===`class`?80:120;return e.value?`${e.name}="${Ms(e.value,t)}"`:e.name})].join(` `)}>`,r=e.children.length;return`${n}${r>0?`…${r} element${r===1?``:`s`}…`:Ms(e.textContent?.trim()??``,100)}</${t}>`}function ys(e){let t=_s.indexOf(e);return t===-1?_s.length:t}function bs(e){let t=e.innerText?.replace(/\s+/g,` `).trim();return t?Ms(t,200):void 0}async function xs(e){let t=Ss(e);if(t.length>0)return t;let n=Ds(e);if(!n)return[];try{let e=await Ns(lo(n),1500),t=ws(n),r=e.filter(e=>e.functionName&&!/^[a-z]/.test(e.functionName)&&!Os(e.functionName)).slice(0,6).map(e=>Ts(e,t.get(e.functionName)));if(r.length>0)return r}catch{}return Es(n)}function Ss(e){let t=[],n;for(let r=e;r&&t.length<6;r=r.parentElement){let e=r.getAttribute(`data-tencil-src`)?.match(/^(.+):(\d+):(\d+)$/);if(!e)continue;let[,i=``,a,o]=e,s=r.getAttribute(`data-tencil-component`)??Cs(i);s!==n&&(n=s,t.push({name:s,source:{file:i,line:Number(a),column:Number(o)}}))}return t}function Cs(e){return e.slice(e.lastIndexOf(`/`)+1)}function ws(e){let t=/* @__PURE__ */ new Map;try{for(let n of io(e))n.functionName&&n.fileName&&!t.has(n.functionName)&&t.set(n.functionName,As(n.fileName))}catch{}return t}function Ts(e,t){let n=e.functionName??`Anonymous`;if(!e.fileName)return{name:n};let r=js(e.fileName);return r?{name:n,library:r}:mo(e.fileName)?{name:n,source:{file:ks(As(e.fileName),t),...e.lineNumber==null?{}:{line:e.lineNumber},...e.columnNumber==null?{}:{column:e.columnNumber}}}:{name:n}}function Es(e){let t=[];return zr(e,e=>{if(Rr(e)){let n=Wr(e.type);n&&!Os(n)&&t.push({name:n})}return t.length>=6},!0),t}function Ds(e){try{return li(e)}catch{return null}}function Os(e){return/^(?:Anonymous|Fragment|Suspense|StrictMode|Profiler|Provider|Consumer|ErrorBoundary|InnerLayoutRouter|OuterLayoutRouter|RedirectBoundary|NotFoundBoundary|LoadingBoundary|HotReload|Router|AppRouter|ServerRoot|ScrollAndFocusHandler|RenderFromTemplateContext)$/.test(e)||/(?:Provider|Context|Boundary)$/.test(e)}function ks(e,t){return e.includes(`/`)||!t?e:t.endsWith(`/${e}`)?t:e}function As(e){let t=e;if(/^https?:\/\//.test(e))try{t=decodeURIComponent(new URL(e).pathname)}catch{}return t.replace(/[?#].*$/,``).replace(/^\/@fs/,``).replace(/^(?:webpack-internal:\/\/\/|webpack:\/\/[^/]*\/|turbopack:\/\/\/|rsc:\/\/React\/[^/]+\/|file:\/\/)/,``).replace(/^\/?\((?:app-pages-browser|ssr|rsc)\)\//,``).replace(/^\.\//,``).replace(/^\/(?=(?:src|app|pages|components|lib)\/)/,``)}function js(e){return e.match(/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?((?:@[^/]+\/)?[^/]+)/)?.[1]}function Ms(e,t){return e.length>t?`${e.slice(0,t-1)}…`:e}function Ns(e,t){return Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(/* @__PURE__ */ Error(`timeout`)),t))])}let Ps;function Fs(e){Ps=e}function Is(){if(!Ps)throw Error(`Tencil overlay is not mounted`);return Ps}let Ls=/* @__PURE__ */ new Map;function Rs(e,t){let n=t??Bs(e.selector);if(!n?.isConnected)return null;let r=n.getBoundingClientRect();return r.width===0&&r.height===0?null:{x:r.left+r.width*e.offsetX,y:r.top+r.height*e.offsetY}}function zs(e,t){let n=e.getBoundingClientRect(),r=(e,t)=>t>0?Hs(e/t,0,1):.5;return{offsetX:r(t.x-n.left,n.width),offsetY:r(t.y-n.top,n.height)}}function Bs(e){if(!e)return null;let t=Ls.get(e)?.deref();if(t?.isConnected&&t.matches(e))return t;try{let t=document.querySelector(e);return t&&Ls.set(e,new WeakRef(t)),t}catch{return null}}function Vs(e,t,n=16){let r=window.innerWidth,i=window.innerHeight,a=e.x+n;a+t.width>r-12&&(a=e.x-n-t.width),a=Hs(a,12,r-t.width-12);let o=Hs(e.y-24,12,i-t.height-12),s=`${Hs(e.x-a,0,t.width)}px ${Hs(e.y-o,0,t.height)}px`;return{left:a,top:o,origin:s}}function Hs(e,t,n){return Math.max(t,Math.min(n,e))}function Us(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}let Ws;function Gs(){let e=/* @__PURE__ */ new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function Ks(e){let t=-1;Ws||=Gs();for(let n=0;n<e.length;n++)t=Ws[(t^e[n])&255]^t>>>8;return t^-1}function qs(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===112&&e[n-2]===72&&e[n-1]===89&&e[n]===115)return n-3;return 0}function Js(e,t,n=!1){let r=/* @__PURE__ */ new Uint8Array(13);t*=39.3701,r[0]=112,r[1]=72,r[2]=89,r[3]=115,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let i=Ks(r),a=/* @__PURE__ */ new Uint8Array(4);if(a[0]=i>>>24,a[1]=i>>>16,a[2]=i>>>8,a[3]=i&255,n){let t=qs(e);return e.set(r,t),e.set(a,t+13),e}{let t=/* @__PURE__ */ new Uint8Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=9;let n=/* @__PURE__ */ new Uint8Array(54);return n.set(e,0),n.set(t,33),n.set(r,37),n.set(a,50),n}}function Ys(e){let t=e.indexOf(`AAlwSFlz`);return t===-1&&(t=e.indexOf(`AAAJcEhZ`)),t===-1&&(t=e.indexOf(`AAAACXBI`)),t}let Xs=`[modern-screenshot]`,Zs=typeof window<`u`,Qs=Zs&&`Worker`in window,$s=Zs&&`atob`in window,ec=Zs&&`btoa`in window,tc=Zs?window.navigator?.userAgent:``,nc=tc.includes(`Chrome`),rc=tc.includes(`AppleWebKit`)&&!nc,ic=tc.includes(`Firefox`),ac=e=>e&&`__CONTEXT__`in e,oc=e=>e.constructor.name===`CSSFontFaceRule`,sc=e=>e.constructor.name===`CSSImportRule`,cc=e=>e.constructor.name===`CSSLayerBlockRule`,Z=e=>e.nodeType===1,lc=e=>typeof e.className==`object`,uc=e=>e.tagName===`image`,dc=e=>e.tagName===`use`,fc=e=>Z(e)&&e.style!==void 0&&!lc(e),pc=e=>e.nodeType===8,mc=e=>e.nodeType===3,hc=e=>e.tagName===`IMG`,gc=e=>e.tagName===`VIDEO`,_c=e=>e.tagName===`CANVAS`,vc=e=>e.tagName===`TEXTAREA`,yc=e=>e.tagName===`INPUT`,bc=e=>e.tagName===`STYLE`,xc=e=>e.tagName===`SCRIPT`,Sc=e=>e.tagName===`SELECT`,Cc=e=>e.tagName===`SLOT`,wc=e=>e.tagName===`IFRAME`,Tc=(...e)=>console.warn(Xs,...e);function Ec(e){let t=e?.createElement?.(`canvas`);return t&&(t.height=t.width=1),!!t&&`toDataURL`in t&&!!t.toDataURL(`image/webp`).includes(`image/webp`)}let Dc=e=>e.startsWith(`data:`);function Oc(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Zs&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!Zs)return e;let n=kc().implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}function kc(e){return(e&&Z(e)?e?.ownerDocument:e)??window.document}let Ac=`http://www.w3.org/2000/svg`;function jc(e,t,n){let r=kc(n).createElementNS(Ac,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function Mc(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,``)),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function Nc(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>r(i.error),i.onabort=()=>r(/* @__PURE__ */ Error(`Failed read blob to ${t}`)),t===`dataUrl`?i.readAsDataURL(e):t===`arrayBuffer`&&i.readAsArrayBuffer(e)})}let Pc=e=>Nc(e,`dataUrl`);function Fc(e,t){let n=kc(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function Ic(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?Fc(e,kc(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),gc(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?Ic(s.poster,t).then(n):u();if(s.readyState>=2)return u();let r=u,i=t=>{o?.(`Failed video load`,e,t),a?.(t),u()};l=()=>{s.removeEventListener(`loadeddata`,r),s.removeEventListener(`error`,i)},s.addEventListener(`loadeddata`,r,{once:!0}),s.addEventListener(`error`,i,{once:!0})}else{let e=uc(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(hc(s)&&`decode`in s)try{await s.decode()}catch(t){o?.(`Failed to decode image, trying to render anyway`,s.dataset.originalSrc||e,t)}u()},n=t=>{o?.(`Failed image load`,s.dataset.originalSrc||e,t),u()};if(hc(s)&&s.complete)return t();l=()=>{s.removeEventListener(`load`,t),s.removeEventListener(`error`,n)},s.addEventListener(`load`,t,{once:!0}),s.addEventListener(`error`,n,{once:!0})}})}async function Lc(e,t){fc(e)&&(hc(e)||gc(e)?await Ic(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>Ic(e,t)))))}let Rc=/* @__PURE__ */ function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}();function zc(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}let Bc=0;function Vc(e){let t=`${Xs}[#${Bc}]`;return Bc++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&Tc(...t)}}function Hc(e){return{cache:e?`no-cache`:`force-cache`}}async function Uc(e,t){return ac(e)?e:Wc(e,{...t,autoDestruct:!0})}async function Wc(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(Zs?window.document:void 0),c=e.ownerDocument?.defaultView??(Zs?window:void 0),l=/* @__PURE__ */ new Map,u={width:0,height:0,quality:1,type:`image/png`,scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:Hc(t?.fetch?.bypassingCache),placeholderImage:`data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:Vc(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:Gc(s),svgDefsElement:s?.createElementNS(Ac,`defs`),svgStyles:/* @__PURE__ */ new Map,defaultComputedStyles:/* @__PURE__ */ new Map,workers:[...Array.from({length:Qs&&r&&i?i:0})].map(()=>{try{let e=new Worker(r);return e.onmessage=async e=>{let{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(/* @__PURE__ */ Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{let{url:t}=e.data;l.get(t)?.reject?.(/* @__PURE__ */ Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn(`Failed to new Worker`,e),null}}).filter(Boolean),fontFamilies:/* @__PURE__ */ new Map,fontCssTexts:/* @__PURE__ */ new Map,acceptOfImage:`${[Ec(s)&&`image/webp`,`image/svg+xml`,`image/*`,`*/*`].filter(Boolean).join(`,`)};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:o,isEnable:e=>e===`restoreScrollPosition`?typeof o==`boolean`?!1:o[e]??!1:typeof o==`boolean`?o:o[e]??!0,shadowRoots:[]};u.log.time(`wait until load`),await Lc(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=Kc(e,u);return u.width=d,u.height=f,u}function Gc(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
|
|
57
57
|
.______background-clip--text {
|
|
58
58
|
background-clip: text;
|
|
59
59
|
-webkit-background-clip: text;
|
|
60
60
|
}
|
|
61
|
-
`);return t.appendChild(n),t}function
|
|
62
|
-
`),h=s.get(m);h||(h=[],s.set(m,h)),h.push(`.${u[0]}${n}`)}
|
|
63
|
-
`))}else{let e=Array.from(n.styleSheets).filter(e=>{try{return`cssRules`in e&&!!e.cssRules.length}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}}),s=n.implementation.createHTMLDocument(``),c=s.createElement(`style`);s.head.appendChild(c);let l=c.sheet;await Promise.all(e.flatMap(e=>Array.from(e.cssRules).map(async e=>{if(
|
|
64
|
-
`)):o.push(
|
|
65
|
-
`))}))})}}}let
|
|
61
|
+
`);return t.appendChild(n),t}function Kc(e,t){let{width:n,height:r}=t;if(Z(e)&&(!n||!r)){let t=e.getBoundingClientRect();n=n||t.width||Number(e.getAttribute(`width`))||0,r=r||t.height||Number(e.getAttribute(`height`))||0}return{width:n,height:r}}async function qc(e,t){let{log:n,timeout:r,drawImageCount:i,drawImageInterval:a}=t;n.time(`image to canvas`);let o=await Ic(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:c}=Jc(e.ownerDocument,t),l=()=>{try{c?.drawImage(o,0,0,s.width,s.height)}catch(e){t.log.warn(`Failed to drawImage`,e)}};if(l(),t.isEnable(`fixSvgXmlDecode`))for(let e=0;e<i;e++)await new Promise(t=>{setTimeout(()=>{c?.clearRect(0,0,s.width,s.height),l(),t()},e+a)});return t.drawImageCount=0,n.timeEnd(`image to canvas`),s}function Jc(e,t){let{width:n,height:r,scale:i,backgroundColor:a,maximumCanvasSize:o}=t,s=e.createElement(`canvas`);s.width=Math.floor(n*i),s.height=Math.floor(r*i),s.style.width=`${n}px`,s.style.height=`${r}px`,o&&(s.width>o||s.height>o)&&(s.width>o&&s.height>o?s.width>s.height?(s.height*=o/s.width,s.width=o):(s.width*=o/s.height,s.height=o):s.width>o?(s.height*=o/s.width,s.width=o):(s.width*=o/s.height,s.height=o));let c=s.getContext(`2d`);return c&&a&&(c.fillStyle=a,c.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:c}}function Yc(e,t){if(e.ownerDocument)try{let t=e.toDataURL();if(t!==`data:,`)return Fc(t,e.ownerDocument)}catch(e){t.log.warn(`Failed to clone canvas`,e)}let n=e.cloneNode(!1),r=e.getContext(`2d`),i=n.getContext(`2d`);try{return r&&i&&i.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(e){t.log.warn(`Failed to clone canvas`,e)}return n}function Xc(e,t){try{if(e?.contentDocument?.documentElement)return gl(e.contentDocument.documentElement,t)}catch(e){t.log.warn(`Failed to clone iframe`,e)}return e.cloneNode(!1)}function Zc(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=``),t.loading===`lazy`&&(t.loading=`eager`),t}async function Qc(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Fc(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin=`anonymous`,e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let r=n.ownerDocument;if(r){let i=!0;if(await Ic(n,{onError:()=>i=!1,onWarn:t.log.warn}),!i)return e.poster?Fc(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(e=>{n.addEventListener(`seeked`,e,{once:!0})});let a=r.createElement(`canvas`);a.width=e.offsetWidth,a.height=e.offsetHeight;try{let e=a.getContext(`2d`);e&&e.drawImage(n,0,0,a.width,a.height)}catch(r){return t.log.warn(`Failed to clone video`,r),e.poster?Fc(e.poster,e.ownerDocument):n}return Yc(a,t)}return n}function $c(e,t){return _c(e)?Yc(e,t):wc(e)?Xc(e,t):hc(e)?Zc(e):gc(e)?Qc(e,t):e.cloneNode(!1)}function el(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement(`iframe`),t.id=`__SANDBOX__${Rc()}`,t.width=`0`,t.height=`0`,t.style.visibility=`hidden`,t.style.position=`fixed`,n.body.appendChild(t),t.srcdoc=`<!DOCTYPE html><meta charset="UTF-8"><title></title><body>`,e.sandbox=t)}catch(t){e.log.warn(`Failed to getSandBox`,t)}}return t}let tl=[`width`,`height`,`-webkit-text-fill-color`],nl=[`stroke`,`fill`];function rl(e,t,n){let{defaultComputedStyles:r}=n,i=e.nodeName.toLowerCase(),a=lc(e)&&i!==`svg`,o=a?nl.map(t=>[t,e.getAttribute(t)]).filter(([,e])=>e!==null):[],s=[a&&`svg`,i,o.map((e,t)=>`${e}=${t}`).join(`,`),t].filter(Boolean).join(`:`);if(r.has(s))return r.get(s);let c=el(n)?.contentWindow;if(!c)return/* @__PURE__ */ new Map;let l=c?.document,u,d;a?(u=l.createElementNS(Ac,`svg`),d=u.ownerDocument.createElementNS(u.namespaceURI,i),o.forEach(([e,t])=>{d.setAttributeNS(null,e,t)}),u.appendChild(d)):u=d=l.createElement(i),d.textContent=` `,l.body.appendChild(u);let f=c.getComputedStyle(d,t),p=/* @__PURE__ */ new Map;for(let e=f.length,t=0;t<e;t++){let e=f.item(t);tl.includes(e)||p.set(e,f.getPropertyValue(e))}return l.body.removeChild(u),r.set(s,p),p}function il(e,t,n){let r=/* @__PURE__ */ new Map,i=[],a=/* @__PURE__ */ new Map;if(n)for(let e of n)o(e);else for(let t=e.length,n=0;n<t;n++)o(e.item(n));for(let e=i.length,t=0;t<e;t++)a.get(i[t])?.forEach((e,t)=>r.set(t,e));function o(n){let o=e.getPropertyValue(n),s=e.getPropertyPriority(n),c=n.lastIndexOf(`-`),l=c>-1?n.substring(0,c):void 0;if(l){let e=a.get(l);e||(e=/* @__PURE__ */ new Map,a.set(l,e)),e.set(n,[o,s])}(t.get(n)!==o||s)&&(l?i.push(l):r.set(n,[o,s]))}return r}function al(e,t,n,r){let{ownerWindow:i,includeStyleProperties:a,currentParentNodeStyle:o}=r,s=t.style,c=i.getComputedStyle(e),l=rl(e,null,r);o?.forEach((e,t)=>{l.delete(t)});let u=il(c,l,a);u.delete(`transition-property`),u.delete(`all`),u.delete(`d`),u.delete(`content`),n&&(u.delete(`position`),u.delete(`margin-top`),u.delete(`margin-right`),u.delete(`margin-bottom`),u.delete(`margin-left`),u.delete(`margin-block-start`),u.delete(`margin-block-end`),u.delete(`margin-inline-start`),u.delete(`margin-inline-end`),u.set(`box-sizing`,[`border-box`,``])),u.get(`background-clip`)?.[0]===`text`&&t.classList.add(`______background-clip--text`),nc&&(u.has(`font-kerning`)||u.set(`font-kerning`,[`normal`,``]),(u.get(`overflow-x`)?.[0]===`hidden`||u.get(`overflow-y`)?.[0]===`hidden`)&&u.get(`text-overflow`)?.[0]===`ellipsis`&&e.scrollWidth===e.clientWidth&&u.set(`text-overflow`,[`clip`,``]));for(let e=s.length,t=0;t<e;t++)s.removeProperty(s.item(t));return u.forEach(([e,t],n)=>{s.setProperty(n,e,t)}),u}function ol(e,t){(vc(e)||yc(e)||Sc(e))&&t.setAttribute(`value`,e.value)}let sl=[`::before`,`::after`],cl=[`::-webkit-scrollbar`,`::-webkit-scrollbar-button`,`::-webkit-scrollbar-thumb`,`::-webkit-scrollbar-track`,`::-webkit-scrollbar-track-piece`,`::-webkit-scrollbar-corner`,`::-webkit-resizer`];function ll(e,t,n,r,i){let{ownerWindow:a,svgStyleElement:o,svgStyles:s,currentNodeStyle:c}=r;if(!o||!a)return;function l(n){let o=a.getComputedStyle(e,n),l=o.getPropertyValue(`content`);if(!l||l===`none`)return;i?.(l),l=l.replace(/(')|(")|(counter\(.+\))/g,``);let u=[Rc()],d=rl(e,n,r);c?.forEach((e,t)=>{d.delete(t)});let f=il(o,d,r.includeStyleProperties);f.delete(`content`),f.delete(`-webkit-locale`),f.get(`background-clip`)?.[0]===`text`&&t.classList.add(`______background-clip--text`);let p=[`content: '${l}';`];if(f.forEach(([e,t],n)=>{p.push(`${n}: ${e}${t?` !important`:``};`)}),p.length===1)return;try{t.className=[t.className,...u].join(` `)}catch(e){r.log.warn(`Failed to copyPseudoClass`,e);return}let m=p.join(`
|
|
62
|
+
`),h=s.get(m);h||(h=[],s.set(m,h)),h.push(`.${u[0]}${n}`)}sl.forEach(l),n&&cl.forEach(l)}let ul=/* @__PURE__ */ new Set([`symbol`]);async function dl(e,t,n,r,i){if(Z(n)&&(bc(n)||xc(n))||r.filter&&!r.filter(n))return;r.currentParentNodeStyle=ul.has(t.nodeName)||ul.has(n.nodeName)?void 0:r.currentNodeStyle;let a=await gl(n,r,!1,i);r.isEnable(`restoreScrollPosition`)&&pl(e,a),t.appendChild(a)}async function fl(e,t,n,r){let i=e.firstChild;Z(e)&&e.shadowRoot&&(i=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let a=i;a;a=a.nextSibling)if(!pc(a)){if(Z(a)&&Cc(a)&&typeof a.assignedNodes==`function`){let i=a.assignedNodes();for(let a=0;a<i.length;a++)await dl(e,t,i[a],n,r)}else await dl(e,t,a,n,r)}}function pl(e,t){if(!fc(e)||!fc(t))return;let{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;let{transform:i}=t.style,a=new DOMMatrix(i),{a:o,b:s,c,d:l}=a;a.a=1,a.b=0,a.c=0,a.d=1,a.translateSelf(-r,-n),a.a=o,a.b=s,a.c=c,a.d=l,t.style.transform=a.toString()}function ml(e,t){let{backgroundColor:n,width:r,height:i,style:a}=t,o=e.style;if(n&&o.setProperty(`background-color`,n,`important`),r&&o.setProperty(`width`,`${r}px`,`important`),i&&o.setProperty(`height`,`${i}px`,`important`),a)for(let e in a)o[e]=a[e]}let hl=/^[\w-:]+$/;async function gl(e,t,n=!1,r){let{ownerDocument:i,ownerWindow:a,fontFamilies:o,onCloneEachNode:s}=t;if(i&&mc(e))return r&&/\S/.test(e.data)&&r(e.data),i.createTextNode(e.data);if(i&&a&&Z(e)&&(fc(e)||lc(e))){let r=await $c(e,t);if(t.isEnable(`removeAbnormalAttributes`)){let e=r.getAttributeNames();for(let t=e.length,n=0;n<t;n++){let t=e[n];hl.test(t)||r.removeAttribute(t)}}let i=t.currentNodeStyle=al(e,r,n,t);n&&ml(r,t);let a=!1;if(t.isEnable(`copyScrollbar`)){let t=[i.get(`overflow-x`)?.[0],i.get(`overflow-y`)?.[0]];a=t.includes(`scroll`)||(t.includes(`auto`)||t.includes(`overlay`))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let c=i.get(`text-transform`)?.[0],l=zc(i.get(`font-family`)?.[0]),u=l?e=>{c===`uppercase`?e=e.toUpperCase():c===`lowercase`?e=e.toLowerCase():c===`capitalize`&&(e=e[0].toUpperCase()+e.substring(1)),l.forEach(t=>{let n=o.get(t);n||o.set(t,n=/* @__PURE__ */ new Set),e.split(``).forEach(e=>n.add(e))})}:void 0;return ll(e,r,a,t,u),ol(e,r),gc(e)||await fl(e,r,t,u),await s?.(r),r}let c=e.cloneNode(!1);return await fl(e,c,t),await s?.(c),c}function _l(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn(`Failed to destroyContext`,t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function vl(e){let{url:t,timeout:n,responseType:r,...i}=e,a=new AbortController,o=n?setTimeout(()=>a.abort(),n):void 0;return fetch(t,{signal:a.signal,...i}).then(e=>{if(!e.ok)throw Error(`Failed fetch, not 2xx response`,{cause:e});switch(r){case`arrayBuffer`:return e.arrayBuffer();case`dataUrl`:return e.blob().then(Pc);default:return e.text()}}).finally(()=>clearTimeout(o))}function yl(e,t){let{url:n,requestType:r=`text`,responseType:i=`text`,imageDom:a}=t,o=n,{timeout:s,acceptOfImage:c,requests:l,fetchFn:u,fetch:{requestInit:d,bypassingCache:f,placeholderImage:p},font:m,workers:h,fontFamilies:g}=e;r===`image`&&(rc||ic)&&e.drawImageCount++;let _=l.get(n);if(!_){f&&f instanceof RegExp&&f.test(o)&&(o+=(/\?/.test(o)?`&`:`?`)+(/* @__PURE__ */ new Date()).getTime());let t=r.startsWith(`font`)&&m&&m.minify,v=/* @__PURE__ */ new Set;t&&r.split(`;`)[1].split(`,`).forEach(e=>{g.has(e)&&g.get(e).forEach(e=>v.add(e))});let y=t&&v.size,b={url:o,timeout:s,responseType:y?`arrayBuffer`:i,headers:r===`image`?{accept:c}:void 0,...d};_={type:r,resolve:void 0,reject:void 0,response:null},_.response=(async()=>{if(u&&r===`image`){let e=await u(n);if(e)return e}return!rc&&n.startsWith(`http`)&&h.length?new Promise((e,t)=>{h[l.size&h.length-1].postMessage({rawUrl:n,...b}),_.resolve=e,_.reject=t}):vl(b)})().catch(t=>{if(l.delete(n),r===`image`&&p)return e.log.warn(`Failed to fetch image base64, trying to use placeholder image`,o),typeof p==`string`?p:p(a);throw t}),l.set(n,_)}return _.response}async function bl(e,t,n,r){if(!xl(e))return e;for(let[i,a]of Cl(e,t))try{let t=await yl(n,{url:a,requestType:r?`image`:`text`,responseType:`dataUrl`});e=e.replace(wl(i),`$1${t}$3`)}catch(e){n.log.warn(`Failed to fetch css data url`,i,e)}return e}function xl(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}let Sl=/url\((['"]?)([^'"]+?)\1\)/g;function Cl(e,t){let n=[];return e.replace(Sl,(e,r,i)=>(n.push([i,Oc(i,t)]),e)),n.filter(([e])=>!Dc(e))}function wl(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,`\\$1`);return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,`g`)}let Tl=[`background-image`,`border-image-source`,`-webkit-border-image`,`-webkit-mask-image`,`list-style-image`];function El(e,t){return Tl.map(n=>{let r=e.getPropertyValue(n);return!r||r===`none`?null:((rc||ic)&&t.drawImageCount++,bl(r,null,t,!0).then(t=>{t&&r!==t&&e.setProperty(n,t,e.getPropertyPriority(n))}))}).filter(Boolean)}function Dl(e,t){if(hc(e)){let n=e.currentSrc||e.src;if(!Dc(n))return[yl(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.srcset=``,e.dataset.originalSrc=n,e.src=t||``)})];(rc||ic)&&t.drawImageCount++}else if(lc(e)&&!Dc(e.href.baseVal)){let n=e.href.baseVal;return[yl(t,{url:n,imageDom:e,requestType:`image`,responseType:`dataUrl`}).then(t=>{t&&(e.dataset.originalSrc=n,e.href.baseVal=t||``)})]}return[]}function Ol(e,t){let{ownerDocument:n,svgDefsElement:r}=t,i=e.getAttribute(`href`)??e.getAttribute(`xlink:href`);if(!i)return[];let[a,o]=i.split(`#`);if(o){let i=`#${o}`,s=t.shadowRoots.reduce((e,t)=>e??t.querySelector(`svg ${i}`),n?.querySelector(`svg ${i}`));if(a&&e.setAttribute(`href`,i),r?.querySelector(i))return[];if(s)return r?.appendChild(s.cloneNode(!0)),[];if(a)return[yl(t,{url:a,responseType:`text`}).then(e=>{r?.insertAdjacentHTML(`beforeend`,e)})]}return[]}function kl(e,t){let{tasks:n}=t;Z(e)&&((hc(e)||uc(e))&&n.push(...Dl(e,t)),dc(e)&&n.push(...Ol(e,t))),fc(e)&&n.push(...El(e.style,t)),e.childNodes.forEach(e=>{kl(e,t)})}async function Al(e,t){let{ownerDocument:n,svgStyleElement:r,fontFamilies:i,fontCssTexts:a,tasks:o,font:s}=t;if(n&&r&&i.size){if(s&&s.cssText){let e=Il(s.cssText,t);r.appendChild(n.createTextNode(`${e}
|
|
63
|
+
`))}else{let e=Array.from(n.styleSheets).filter(e=>{try{return`cssRules`in e&&!!e.cssRules.length}catch(n){return t.log.warn(`Error while reading CSS rules from ${e.href}`,n),!1}}),s=n.implementation.createHTMLDocument(``),c=s.createElement(`style`);s.head.appendChild(c);let l=c.sheet;await Promise.all(e.flatMap(e=>Array.from(e.cssRules).map(async e=>{if(sc(e)){let n=e.href,r=``;try{r=await yl(t,{url:n,requestType:`text`,responseType:`text`})}catch(e){t.log.warn(`Error fetch remote css import from ${n}`,e)}let i=r.replace(Sl,(e,t,r)=>e.replace(r,Oc(r,n)));for(let e of Nl(i))try{l.insertRule(e,l.cssRules.length)}catch(n){t.log.warn(`Error inserting rule from remote css import`,{rule:e,error:n})}}}))),l.cssRules.length&&e.push(l);let u=[];e.forEach(e=>{Ll(e.cssRules,u)}),u.filter(e=>oc(e)&&xl(e.style.getPropertyValue(`src`))&&zc(e.style.getPropertyValue(`font-family`))?.some(e=>i.has(e))).forEach(e=>{let i=e,s=a.get(i.cssText);s?r.appendChild(n.createTextNode(`${s}
|
|
64
|
+
`)):o.push(bl(i.cssText,i.parentStyleSheet?i.parentStyleSheet.href:null,t).then(e=>{e=Il(e,t),a.set(i.cssText,e),r.appendChild(n.createTextNode(`${e}
|
|
65
|
+
`))}))})}}}let jl=/(\/\*[\s\S]*?\*\/)/g,Ml=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Nl(e){if(e==null)return[];let t=[],n=e.replace(jl,``);for(;;){let e=Ml.exec(n);if(!e)break;t.push(e[0])}n=n.replace(Ml,``);let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,i=/* @__PURE__ */ RegExp(`((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})`,`gi`);for(;;){let e=r.exec(n);if(e)i.lastIndex=r.lastIndex;else if(e=i.exec(n),e)r.lastIndex=i.lastIndex;else break;t.push(e[0])}return t}let Pl=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Fl=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Il(e,t){let{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(Fl,e=>{for(;;){let[t,,n]=Pl.exec(e)||[];if(!n)return``;if(n===r)return`src: ${t};`}}):e}function Ll(e,t=[]){for(let n of Array.from(e))cc(n)?t.push(...Ll(n.cssRules)):`cssRules`in n?Ll(n.cssRules,t):t.push(n);return t}let Rl=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function zl(e){return Rl.test(e.innerHTML)}async function Bl(e,t){let n=await Uc(e,t);if(Z(n.node)&&lc(n.node)&&!zl(n.node))return n.node;let{ownerDocument:r,log:i,tasks:a,svgStyleElement:o,svgDefsElement:s,svgStyles:c,font:l,progress:u,autoDestruct:d,onCloneNode:f,onEmbedNode:p,onCreateForeignObjectSvg:m}=n;i.time(`clone node`);let h=await gl(n.node,n,!0);if(o&&r){let e=``;c.forEach((t,n)=>{e+=`${t.join(`,
|
|
66
66
|
`)} {
|
|
67
67
|
${n}
|
|
68
68
|
}
|
|
69
|
-
`}),o.appendChild(r.createTextNode(e))}i.timeEnd(`clone node`),await f?.(h),l!==!1&&Z(h)&&(i.time(`embed web font`),await Dl(h,n),i.timeEnd(`embed web font`)),i.time(`embed node`),El(h,n);let g=a.length,_=0,v=async()=>{for(;;){let e=a.pop();if(!e)break;try{await e}catch(e){n.log.warn(`Failed to run task`,e)}u?.(++_,g)}};u?.(_,g),await Promise.all([...Array.from({length:4})].map(v)),i.timeEnd(`embed node`),await p?.(h);let y=Rl(h,n);return s&&y.insertBefore(s,y.children[0]),o&&y.insertBefore(o,y.children[0]),d&&ml(n),await m?.(y),y}function Rl(e,t){let{width:n,height:r}=t,i=Oc(n,r,e.ownerDocument),a=i.ownerDocument.createElementNS(i.namespaceURI,`foreignObject`);return a.setAttributeNS(null,`x`,`0%`),a.setAttributeNS(null,`y`,`0%`),a.setAttributeNS(null,`width`,`100%`),a.setAttributeNS(null,`height`,`100%`),a.append(e),i.appendChild(a),i}async function zl(e,t){let n=await Bc(e,t),r=await Ll(n),i=kc(r,n.isEnable(`removeControlCharacter`));return n.autoDestruct||(n.svgStyleElement=Hc(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(Dc,`defs`),n.svgStyles.clear()),await Wc(Mc(i,r.ownerDocument),n)}async function Bl(e,t){let n=await Bc(e,t),{log:r,quality:i,type:a,dpi:o}=n,s=await zl(n);r.time(`canvas to data url`);let c=s.toDataURL(a,i);if([`image/png`,`image/jpeg`].includes(a)&&o&&Xs&&Zs){let[e,t]=c.split(`,`),n=0,r=!1;if(a===`image/png`){let e=Ks(t);e>=0?(n=Math.ceil((e+28)/3)*4,r=!0):n=44}else a===`image/jpeg`&&(n=24);let i=t.substring(0,n),s=t.substring(n),l=window.atob(i),u=new Uint8Array(l.length);for(let e=0;e<u.length;e++)u[e]=l.charCodeAt(e);let d=a===`image/png`?Gs(u,o,r):Bs(u,o);c=[e,`,`,window.btoa(String.fromCharCode(...d)),s].join(``)}return r.timeEnd(`canvas to data url`),c}async function Vl(e,t){return Bl(await Bc(e,{...t,type:`image/jpeg`}))}async function Hl(e,t){let n=e.getBoundingClientRect(),r=n.width*n.height<4800&&e.parentElement?e.parentElement:e,i=r.getBoundingClientRect(),a=Math.min(window.devicePixelRatio||1,1600/Math.max(i.width+48,i.height+48,1));try{let e=await Vl(r,{scale:a,quality:.85,backgroundColor:Ul(r),filter:e=>e!==t,timeout:4e3});return e.startsWith(`data:image/jpeg`)?{name:`tencil-element.jpg`,mimeType:`image/jpeg`,dataUrl:e}:null}catch(e){return console.warn(`[tencil] screenshot failed`,e),null}}function Ul(e){let t=e;for(;t;){let e=getComputedStyle(t).backgroundColor;if(e&&e!==`transparent`&&!/rgba\(.*,\s*0\)$/.test(e))return e;t=t.parentElement}return`#ffffff`}var Wl=0;Array.isArray;function Q(e,t,r,i,a,o){t||={};var s,c,l=t;if(`ref`in l&&typeof e!=`function`)for(c in l={},t)c==`ref`?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Wl,__i:-1,__u:0};return(a||o)&&(u.__source=a,u.__self=o),n.vnode&&n.vnode(u),u}let Gl={t3code:{viewBox:`15.5309 37 94.3941 56.96`,path:`M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z`,className:`agent-mono`,label:`T3 Code`},codex:{viewBox:`0 0 256 260`,path:`M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87 51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921 51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58 28.138-16.217 28.188 16.218v32.434l-28.086 16.218-28.188-16.218-.052-32.434Z`,className:`agent-mono`,label:`Codex`},claudeAgent:{viewBox:`0 0 256 257`,path:`m50.228 170.321 50.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0 125.796l.583-3.759 5.12-3.434 7.324.648 16.202 1.101 24.304 1.685 17.629 1.037 26.118 2.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758 7-7.713 9.397.649 2.398.648 9.527 7.323 20.35 15.75L94.817 91.9l3.889 3.24 1.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0 82.05 1.426l4.472 3.888 6.61 15.101 10.694 23.786 16.591 32.34 4.861 9.592 2.592 8.879.973 2.722h1.685v-1.556l1.36-18.211 2.528-22.36 2.463-28.776.843-8.1 4.018-9.722 7.971-5.25 6.222 2.981 5.12 7.324-.713 4.73-3.046 19.768-5.962 30.98-3.889 20.739h2.268l2.593-2.593 10.499-13.934 17.628-22.036 7.778-8.749 9.073-9.657 5.833-4.601h11.018l8.1 12.055-3.628 12.443-11.342 14.388-9.398 12.184-13.48 18.147-8.426 14.518.778 1.166 2.01-.194 30.46-6.481 16.462-2.982 19.637-3.37 8.88 4.148.971 4.213-3.5 8.62-20.998 5.184-24.628 4.926-36.682 8.685-.454.324.519.648 16.526 1.555 7.065.389h17.304l32.21 2.398 8.426 5.574 5.055 6.805-.843 5.184-12.962 6.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666 11.406 21.387 19.314 26.767 24.887 1.36 6.157-3.434 4.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73 6.935 25.017 37.59 1.296 11.536-1.814 3.76-6.481 2.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194 77.448-3.37 3.953-7.778 2.981-6.48-4.925-3.436-7.972 3.435-15.749 4.148-20.544 3.37-16.333 3.046-20.285 1.815-6.74-.13-.454-1.49.194-15.295 20.999-23.267 31.433-18.406 19.702-4.407 1.75-7.648-3.954.713-7.064 4.277-6.286 25.47-32.405 15.36-20.092 9.917-11.6-.065-1.686h-.583L44.07 198.125l-12.055 1.555-5.185-4.86.648-7.972 2.463-2.593 20.35-13.999-.064.065Z`,className:`agent-claude`,label:`Claude`},cursor:{viewBox:`0 0 466.73 532.09`,path:`M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z`,className:`agent-mono`,label:`Cursor`}};function Kl(e){if(Gl[e])return Gl[e];let t=e.toLowerCase();if(t.includes(`claude`))return Gl.claudeAgent;if(t.includes(`codex`)||t.includes(`openai`))return Gl.codex;if(t.includes(`cursor`))return Gl.cursor}function ql({agent:e,size:t=13,decorative:n=!1}){if(!e)return null;let r=Kl(e);return r?/* @__PURE__ */ Q(`svg`,{class:`agent-icon ${r.className}`,width:t,height:t,viewBox:r.viewBox,role:n?void 0:`img`,"aria-label":n?void 0:r.label,"aria-hidden":n?`true`:void 0,children:/* @__PURE__ */ Q(`path`,{d:r.path})}):null}function $({children:e,size:t=16}){return/* @__PURE__ */ Q(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:e})}let Jl=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`}),/* @__PURE__ */ Q(`path`,{d:`M12 8v8M8 12h8`})]}),Yl=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M22 12h-6l-2 3h-4l-2-3H2`}),/* @__PURE__ */ Q(`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`})]}),Xl=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M10.7 5.1A10.8 10.8 0 0 1 12 5c7 0 10 7 10 7a13.2 13.2 0 0 1-1.7 2.7`}),/* @__PURE__ */ Q(`path`,{d:`M6.6 6.6A13.5 13.5 0 0 0 2 12s3 7 10 7a9.7 9.7 0 0 0 5.4-1.6`}),/* @__PURE__ */ Q(`path`,{d:`M9.9 9.9a3 3 0 1 0 4.2 4.2M2 2l20 20`})]}),Zl=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z`}),/* @__PURE__ */ Q(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),Ql=()=>/* @__PURE__ */ Q($,{children:/* @__PURE__ */ Q(`path`,{d:`m5 12 7-7 7 7M12 19V5`})}),$l=()=>/* @__PURE__ */ Q($,{size:12,children:/* @__PURE__ */ Q(`rect`,{x:`5`,y:`5`,width:`14`,height:`14`,rx:`2`,fill:`currentColor`})}),eu=()=>/* @__PURE__ */ Q($,{children:/* @__PURE__ */ Q(`path`,{d:`M20 6 9 17l-5-5`})}),tu=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M9 14 4 9l5-5`}),/* @__PURE__ */ Q(`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 0 11H11`})]}),nu=()=>/* @__PURE__ */ Q($,{children:/* @__PURE__ */ Q(`path`,{d:`M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),ru=()=>/* @__PURE__ */ Q($,{size:14,children:/* @__PURE__ */ Q(`path`,{d:`M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})}),iu=()=>/* @__PURE__ */ Q($,{children:/* @__PURE__ */ Q(`path`,{d:`M18 6 6 18M6 6l12 12`})}),au=()=>/* @__PURE__ */ Q($,{size:14,children:[/* @__PURE__ */ Q(`path`,{d:`M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z`}),/* @__PURE__ */ Q(`circle`,{cx:`12`,cy:`13`,r:`3`})]}),ou=()=>/* @__PURE__ */ Q($,{size:12,children:/* @__PURE__ */ Q(`path`,{d:`m16 18 6-6-6-6M8 6l-6 6 6 6`})}),su=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}),/* @__PURE__ */ Q(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),cu=({size:e=16})=>/* @__PURE__ */ Q(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,class:`tencil-logo`,children:[/* @__PURE__ */ Q(`path`,{d:`M3 21V9a6 6 0 0 1 6-6h6a6 6 0 0 1 6 6v6a6 6 0 0 1-6 6Z`,fill:`#3b8dff`}),/* @__PURE__ */ Q(`path`,{d:`M9.25 7.5 16.5 12.6l-3.55.75-1.75 3.4Z`,fill:`#fff`,stroke:`#fff`,"stroke-linejoin":`round`})]}),lu=()=>/* @__PURE__ */ Q($,{size:14,children:[/* @__PURE__ */ Q(`path`,{d:`m12 2 10 5-10 5L2 7Z`}),/* @__PURE__ */ Q(`path`,{d:`m2 17 10 5 10-5M2 12l10 5 10-5`})]}),uu=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`rect`,{x:`2`,y:`7`,width:`20`,height:`10`,rx:`2`}),/* @__PURE__ */ Q(`path`,{d:`M6 7v3M10 7v4M14 7v3M18 7v4`})]}),du=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`rect`,{x:`2`,y:`7`,width:`20`,height:`10`,rx:`2`}),/* @__PURE__ */ Q(`path`,{d:`M6 7v3M10 7v4M14 7v3M18 7v4M3 3l18 18`})]}),fu=()=>/* @__PURE__ */ Q($,{size:12,children:/* @__PURE__ */ Q(`path`,{d:`m6 9 6 6 6-6`})}),pu=F(()=>{let e=/* @__PURE__ */ new Map,t=[...On.value].reverse().filter(e=>e.anchor);for(let[n,r]of t.entries())e.set(r.id,n+1);return e});function mu(){let e=jn.value.flatMap(e=>{let t=pu.value.get(e.id);return t?[{threadId:e.id,number:t}]:[]});e.length!==0&&H({type:`drafts.send`,drafts:e})&&(q.value=e[0]?.threadId??null)}function hu(){let e=gu();if(fn.value)return null;let t=K.value;return/* @__PURE__ */ Q(S,{children:[kn.value.map(e=>/* @__PURE__ */ Q(vu,{thread:e},e.id)),e.map(e=>/* @__PURE__ */ Q(_u,{pin:e},`leaving:${e.thread.id}`)),t&&/* @__PURE__ */ Q(Tu,{})]})}function gu(){let e=kn.value,t=En.value,n=j({page:t,pins:[]}),[r,i]=A([]);return Ne(()=>{let r=n.current;n.current={page:t,pins:e.map(e=>({thread:e,number:pu.value.get(e.id),variant:Eu(e),resolved:!1}))};let a=new Set(e.map(e=>e.id)),o=r.page===t?r.pins.filter(e=>!a.has(e.thread.id)).map(e=>({...e,resolved:B.value.get(e.thread.id)?.resolved===!0})):[];i(e=>{let t=e.filter(e=>!a.has(e.thread.id)&&!o.some(t=>t.thread.id===e.thread.id));return t.length===e.length&&o.length===0?e:[...t,...o]});for(let e of o)setTimeout(()=>i(t=>t.filter(t=>t!==e)),1e3)},[e,t]),r}function _u({pin:e}){Tn.value;let t=e.thread.anchor?Fs(e.thread.anchor):null;return t?/* @__PURE__ */ Q(`div`,{class:`pin pin-${e.variant} pin-leaving${e.resolved?` pin-resolving`:``}`,style:{transform:`translate(${t.x}px, ${t.y}px)`},"aria-hidden":`true`,children:/* @__PURE__ */ Q(`span`,{class:`pin-body`,children:[/* @__PURE__ */ Q(`span`,{class:`pin-glyph`,children:e.number??`•`}),e.resolved&&/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`span`,{class:`pin-glyph pin-check`,children:/* @__PURE__ */ Q(eu,{})}),/* @__PURE__ */ Q(`span`,{class:`pin-shine`})]})]})}):null}function vu({thread:e}){if(Tn.value,!e.anchor)return null;let t=wn.value,n=t?.threadId===e.id,r=n?t.point:Fs(e.anchor);if(!r)return null;let i=q.value===e.id;return/* @__PURE__ */ Q(`button`,{type:`button`,class:`pin pin-${Eu(e)}${i?` pin-open`:``}${n?` pin-dragging`:``}`,style:{transform:`translate(${r.x}px, ${r.y}px)`},title:e.title,onPointerDown:t=>bu(t,e,r),onClick:()=>{if(yu===e.id){yu=null;return}K.value=null,q.value=i?null:e.id},children:/* @__PURE__ */ Q(`span`,{class:`pin-body`,children:pu.value.get(e.id)??`•`})})}let yu=null;function bu(e,t,n){if(e.button!==0)return;e.preventDefault();let r=e.currentTarget;try{r.setPointerCapture(e.pointerId)}catch{}yu=null;let i=e.clientX,a=e.clientY,o=e=>{let r=e.clientX-i,o=e.clientY-a;!wn.value&&Math.hypot(r,o)<4||(wn.value={threadId:t.id,point:xu({x:n.x+r,y:n.y+o})})},s=e=>{r.removeEventListener(`pointermove`,o),r.removeEventListener(`pointerup`,s),r.removeEventListener(`pointercancel`,s),r.removeEventListener(`lostpointercapture`,s),window.removeEventListener(`dragstart`,Su,!0);let n=wn.value;n&&(wn.value=null,yu=t.id,e.type===`pointerup`&&Cu(t,n.point))};r.addEventListener(`pointermove`,o),r.addEventListener(`pointerup`,s),r.addEventListener(`pointercancel`,s),r.addEventListener(`lostpointercapture`,s),window.addEventListener(`dragstart`,Su,!0)}function xu(e){let{clientWidth:t,clientHeight:n}=document.documentElement;return{x:Math.max(0,Math.min(e.x,t-1)),y:Math.max(0,Math.min(e.y,n-1))}}function Su(e){e.preventDefault()}function Cu(e,t){let n=wu(t);if(!n)return;let r={selector:us(n),...Is(n,t)};H({type:`thread.move`,threadId:e.id,anchor:r})&&tn({...e,anchor:r})}function wu(e){let t=Ns();return document.elementsFromPoint(e.x,e.y).find(e=>e!==t&&e!==document.documentElement)??document.body}function Tu(){Tn.value;let e=K.value,t=Fs(e.anchor,e.element);return t?/* @__PURE__ */ Q(`div`,{class:`pin pin-draft pin-open`,style:{transform:`translate(${t.x}px, ${t.y}px)`},children:/* @__PURE__ */ Q(`span`,{class:`pin-body`,children:`+`})}):null}function Eu(e){if(e.resolved)return`resolved`;let t=e.delivery?.status;if(t&&(e.status===`idle`||e.status===`error`))return t===`queued`||t===`deploying`?`working`:t===`failed`||t===`deploy-failed`?`error`:`done`;switch(e.status){case`draft`:return`queued`;case`starting`:case`working`:return`working`;case`waiting`:return`waiting`;case`error`:return`error`;default:return`done`}}let Du=`tencil:open`;function Ou(){let[e,t]=A(`page`),n=R.value?.label??`Agent`,r=L.value===`open`&&R.value?.state===`ready`,i=R.value?.id;return Me(()=>{r&&J.value&&e===`provider`&&on()},[e,J.value,r,i]),J.value?/* @__PURE__ */ Q(`aside`,{class:`inbox`,children:[/* @__PURE__ */ Q(`header`,{class:`inbox-header`,children:[/* @__PURE__ */ Q(`div`,{class:`segmented`,children:[/* @__PURE__ */ Q(`button`,{type:`button`,class:e===`page`?`active`:``,onClick:()=>t(`page`),children:`This page`}),/* @__PURE__ */ Q(`button`,{type:`button`,class:e===`all`?`active`:``,onClick:()=>t(`all`),children:`All pins`}),/* @__PURE__ */ Q(`button`,{type:`button`,class:e===`provider`?`active`:``,onClick:()=>t(`provider`),children:n})]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:`Close`,onClick:()=>{J.value=!1},children:/* @__PURE__ */ Q(iu,{})})]}),e===`provider`?/* @__PURE__ */ Q(Au,{label:n}):/* @__PURE__ */ Q(ku,{scope:e})]}):null}function ku({scope:e}){let t=On.value.filter(e=>dn.value||!e.resolved).filter(t=>e===`all`||t.anchor&&t.pageUrl&&Dn(t.pageUrl)===En.value);return/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`label`,{class:`inbox-filter`,children:[/* @__PURE__ */ Q(`span`,{class:`checkbox`,children:[/* @__PURE__ */ Q(`input`,{type:`checkbox`,class:`checkbox-input`,checked:dn.value,onChange:e=>{dn.value=e.target.checked}}),/* @__PURE__ */ Q(eu,{})]}),`Show resolved`]}),/* @__PURE__ */ Q(`div`,{class:`inbox-list`,children:t.length===0?/* @__PURE__ */ Q(`p`,{class:`empty`,children:[`No pins yet. Press `,/* @__PURE__ */ Q(`kbd`,{children:`C`}),` and click anything on the page.`]}):t.map(e=>/* @__PURE__ */ Q(Nu,{thread:e},e.id))})]})}function Au({label:e}){let t=Bt.value;return t?t.length===0?/* @__PURE__ */ Q(`p`,{class:`empty`,children:[`No `,e,` threads in this project yet.`]}):/* @__PURE__ */ Q(`div`,{class:`inbox-list inbox-list-provider`,children:t.map(e=>/* @__PURE__ */ Q(ju,{summary:e},e.id))}):/* @__PURE__ */ Q(`p`,{class:`empty`,children:[`Loading `,e,` threads…`]})}function ju({summary:e}){let t=Vt.value,n=[...B.value.values()].filter(t=>t.provider.threadId===e.id&&t.anchor).length;return/* @__PURE__ */ Q(`button`,{type:`button`,class:`inbox-item provider-item`,onClick:()=>{let t=cn(e);t&&(q.value=t)},children:[/* @__PURE__ */ Q(`span`,{class:`provider-item-project`,children:[t&&/* @__PURE__ */ Q(Mu,{project:t}),/* @__PURE__ */ Q(`span`,{class:`provider-item-project-name`,children:t?.name}),e.status===`working`||e.status===`waiting`?/* @__PURE__ */ Q(`span`,{class:`provider-item-state state-${e.status}`,children:Iu(e.status)}):e.background===`monitoring`?/* @__PURE__ */ Q(`span`,{class:`provider-item-state state-monitoring`,children:`Monitoring`}):/* @__PURE__ */ Q(`span`,{class:`provider-item-time`,children:Lu(e.updatedAt)})]}),/* @__PURE__ */ Q(`span`,{class:`provider-item-title`,children:e.title}),(e.branch||e.pullRequest||e.agent||n>0)&&/* @__PURE__ */ Q(`span`,{class:`provider-item-meta`,children:[e.branch&&/* @__PURE__ */ Q(`span`,{class:`provider-item-branch`,children:e.branch}),e.pullRequest&&/* @__PURE__ */ Q(`span`,{class:`provider-item-pr`,children:[`#`,e.pullRequest.number]}),n>0&&/* @__PURE__ */ Q(`span`,{class:`provider-item-pins`,children:[n,` pin`,n===1?``:`s`]}),/* @__PURE__ */ Q(ql,{agent:e.agent})]})]})}function Mu({project:e}){return e.emoji?/* @__PURE__ */ Q(`span`,{class:`project-icon project-icon-emoji`,children:e.emoji}):e.iconUrl?/* @__PURE__ */ Q(`img`,{class:`project-icon`,src:e.iconUrl,alt:``}):/* @__PURE__ */ Q(`span`,{class:`project-icon project-icon-letter`,children:e.name.slice(0,1)})}function Nu({thread:e}){let t=!!(e.anchor&&e.pageUrl),n=!t||Dn(e.pageUrl)===En.value,r=[...e.messages].reverse().find(e=>e.role===`assistant`);return/* @__PURE__ */ Q(`button`,{type:`button`,class:`inbox-item${q.value===e.id?` active`:``}`,onClick:()=>{if(!n){sessionStorage.setItem(Du,e.id),location.href=e.pageUrl;return}q.value=e.id,Pu(e)},children:[t?/* @__PURE__ */ Q(`span`,{class:`pin pin-static pin-${Eu(e)}`,children:/* @__PURE__ */ Q(`span`,{class:`pin-body`,children:pu.value.get(e.id)})}):/* @__PURE__ */ Q(`span`,{class:`thread-dot thread-dot-${e.status}`}),/* @__PURE__ */ Q(`span`,{class:`inbox-item-body`,children:[/* @__PURE__ */ Q(`span`,{class:`inbox-item-title`,children:e.title}),/* @__PURE__ */ Q(`span`,{class:`inbox-item-meta`,children:[!t&&/* @__PURE__ */ Q(`span`,{children:`Not pinned · `}),t&&!n&&/* @__PURE__ */ Q(`span`,{children:[new URL(e.pageUrl).pathname,` · `]}),Fu(e),` · `,Lu(e.updatedAt)]}),r&&/* @__PURE__ */ Q(`span`,{class:`inbox-item-preview`,children:r.text.slice(0,140)})]})]})}function Pu(e){if(e.anchor)try{document.querySelector(e.anchor.selector)?.scrollIntoView({block:`center`,behavior:`smooth`})}catch{}}function Fu(e){if(e.resolved)return`Resolved`;switch(e.status){case`draft`:return`Queued`;case`starting`:return`Starting`;case`working`:return`Working`;case`waiting`:return`Needs input`;case`error`:return`Error`;default:return`Done`}}function Iu(e){switch(e){case`working`:return`Working`;case`waiting`:return`Needs input`;case`error`:return`Error`;default:return`Idle`}}function Lu(e){let t=Math.max(0,(Date.now()-Date.parse(e))/1e3);return t<60?`just now`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Ru({placeholder:e,initialText:t=``,autoFocus:n,disabled:r,busy:i,onSubmit:a,onCancel:o,children:s}){let[c,l]=A(t),u=j(null);Me(()=>{n&&u.current?.focus({preventScroll:!0})},[n]),Me(()=>{let e=u.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,200)}px`)},[c]);let d=c.trim().length>0&&!r&&!i,f=async()=>{d&&(await a(c.trim()),l(``))};return/* @__PURE__ */ Q(`div`,{class:`prompt-input`,children:[/* @__PURE__ */ Q(`textarea`,{ref:u,rows:1,value:c,placeholder:e,disabled:r,onInput:e=>l(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&!e.shiftKey&&!e.isComposing?(e.preventDefault(),f()):e.key===`Escape`&&(e.preventDefault(),o?.())}}),/* @__PURE__ */ Q(`div`,{class:`prompt-actions`,children:[/* @__PURE__ */ Q(`div`,{class:`prompt-extras`,children:s}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`send`,disabled:!d,onClick:()=>void f(),"aria-label":`Send`,title:`Send (Enter)`,children:i?/* @__PURE__ */ Q(`span`,{class:`spinner`}):/* @__PURE__ */ Q(Ql,{})})]})]})}let zu=P(null);function Bu(){Tn.value;let e=K.value,t=j(null),[n,r]=A(140),[i,a]=A(!1),[o,s]=A(!1),[c,l]=A(null),u=R.value?.state===`ready`,d=R.value?.id;if(Me(()=>{e&&u&&(on(),sn())},[e,u,d]),Me(()=>{zu.value=null},[d]),Ne(()=>{t.current&&r(t.current.offsetHeight)}),!e)return null;let f=Fs(e.anchor,e.element);if(!f)return null;let{left:p,top:m,origin:h}=Rs(f,{width:340,height:n}),g=R.value,_=g?.state===`ready`,v=hn.value,y=v?null:zu.value,b=y?void 0:Gu(g?.id);return/* @__PURE__ */ Q(`div`,{ref:t,class:`popover composer`,style:{left:`${p}px`,top:`${m}px`,width:`340px`,transformOrigin:h},children:[/* @__PURE__ */ Q(`div`,{class:`composer-target`,children:[/* @__PURE__ */ Q(`span`,{class:`chip`,children:[/* @__PURE__ */ Q(ou,{}),e.label]}),g&&v&&/* @__PURE__ */ Q(`span`,{class:`composer-provider composer-batch`,children:[`→ Batch · `,jn.value.length,` queued`]}),g&&!v&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`composer-provider${c===`target`?` open`:``}`,onClick:()=>l(c===`target`?null:`target`),title:`Send to a new thread or continue an existing one`,children:[/* @__PURE__ */ Q(`span`,{class:`composer-provider-label`,children:[`→ `,y?y.title:`New ${g.label} thread`]}),/* @__PURE__ */ Q(fu,{})]})]}),e.measuredTo&&bn.value&&/* @__PURE__ */ Q(Hu,{pending:e}),c===`target`&&!v&&/* @__PURE__ */ Q(qu,{onPick:e=>{zu.value=e,l(null)}}),c===`model`&&b&&/* @__PURE__ */ Q(Ku,{choices:b,onPick:e=>{H({type:`model.select`,model:e}),l(null)}}),/* @__PURE__ */ Q(Ru,{placeholder:v?`Add a comment to the batch…`:_?y?`Continue the thread with this element…`:`What should change here?`:`Waiting for the agent connection…`,autoFocus:!0,busy:o,disabled:!_&&!v,onSubmit:async t=>{s(!0);try{let n=Wu(await e.context,e),r=[];if(i){let t=await Hl(e.element,Ns());t&&r.push(t)}let a=Lt(),o={...e.anchor,selector:n.selector};if(!H({type:`thread.create`,id:a,pageUrl:location.href,prompt:t,anchor:o,context:n,attachments:r,...y?{providerThreadId:y.id}:{},...v?{draft:!0}:{}}))return;let s=(/* @__PURE__ */ new Date()).toISOString();tn({id:a,title:t,pageUrl:location.href,anchor:o,context:n,status:v?`draft`:y?`working`:`starting`,resolved:!1,messages:[{id:`local:${a}`,role:`user`,text:t,streaming:!1,createdAt:s}],provider:{id:g?.id??`unknown`,...y?{threadId:y.id,url:y.url}:{}},createdAt:s,updatedAt:s}),K.value=null,v?Nn():q.value=a}finally{s(!1)}},onCancel:()=>{K.value=null},children:[/* @__PURE__ */ Q(`button`,{type:`button`,class:`toggle${i?` toggle-on`:``}`,onClick:()=>a(!i),title:i?`Screenshot attached`:`No screenshot`,"aria-pressed":i,children:/* @__PURE__ */ Q(au,{})}),pn.value&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`toggle${v?` toggle-on`:``}`,onClick:()=>{mn.value=!v,l(null)},title:v?`Batch on: comments are queued and sent together`:`Queue comments and send them together`,"aria-label":`Batch`,"aria-pressed":v,children:/* @__PURE__ */ Q(lu,{})}),b&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`toggle model-toggle${c===`model`?` open`:``}`,onClick:()=>l(c===`model`?null:`model`),title:`Agent and model for the new thread`,children:[/* @__PURE__ */ Q(ql,{agent:b.current?.agent,size:12}),/* @__PURE__ */ Q(`span`,{class:`model-toggle-label`,children:b.current?.label??`Default model`}),/* @__PURE__ */ Q(fu,{})]})]}),!_&&g?.detail&&/* @__PURE__ */ Q(`p`,{class:`hint`,children:g.detail})]})}let Vu={top:`above`,right:`right`,bottom:`below`,left:`left`};function Hu({pending:e}){let t=e.measuredTo,n=Uu(e),r=[`top`,`right`,`bottom`,`left`].filter(e=>n?.[e]!==void 0).map(e=>`${n[e]} ${Vu[e]}`);return/* @__PURE__ */ Q(`div`,{class:`composer-measure`,children:[/* @__PURE__ */ Q(`span`,{class:`composer-measure-label`,title:`Spacing to ${t.label}: ${r.join(`, `)||`none`}`,children:[`↔ `,t.parent?`Parent `:``,/* @__PURE__ */ Q(`span`,{class:`composer-measure-target`,children:t.label}),r.length>0&&` · ${r.join(`, `)}`]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:`Don't send the spacing`,"aria-label":`Remove spacing`,onClick:()=>{K.value&&={...K.value,measuredTo:void 0}},children:/* @__PURE__ */ Q(iu,{})})]})}function Uu(e){let t=e.measuredTo;return!t||!bn.value||!e.element.isConnected||!t.element.isConnected?void 0:Xo(Yo(qo(e.element.getBoundingClientRect()),qo(t.element.getBoundingClientRect())),{to:t.label,selector:us(t.element),...t.parent?{parent:!0}:{}})}function Wu(e,t){let n=Uu(t);return n?{...e,spacing:n}:e}function Gu(e){let t=Ht.value;if(!t||t.provider!==e||t.models.length===0)return;let n=e=>t.models.find(t=>t.id===e),r=n(z.value?.model),i=n(t.defaultModel);return{models:t.models,current:r??i,picked:r?.id??null,fallback:i}}function Ku({choices:e,onPick:t}){let n=/* @__PURE__ */ new Map;for(let t of e.models)n.set(t.group,[...n.get(t.group)??[],t]);return/* @__PURE__ */ Q(`div`,{class:`target-menu`,role:`listbox`,children:[/* @__PURE__ */ Q(`button`,{type:`button`,role:`option`,"aria-selected":e.picked===null,class:`target-option${e.picked===null?` selected`:``}`,onClick:()=>t(null),children:[/* @__PURE__ */ Q(`span`,{class:`target-option-title`,children:`Default`}),e.fallback&&/* @__PURE__ */ Q(`span`,{class:`target-option-meta`,children:e.fallback.label})]}),[...n].map(([n,r])=>/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`p`,{class:`menu-group`,children:[/* @__PURE__ */ Q(ql,{agent:r[0]?.agent,size:11}),n]}),r.map(n=>/* @__PURE__ */ Q(`button`,{type:`button`,role:`option`,"aria-selected":e.picked===n.id,class:`target-option${e.picked===n.id?` selected`:``}`,onClick:()=>t(n.id),children:/* @__PURE__ */ Q(`span`,{class:`target-option-title`,children:n.label})},n.id))]},n))]})}function qu({onPick:e}){let t=Bt.value,n=zu.value?.id??null;return/* @__PURE__ */ Q(`div`,{class:`target-menu`,role:`listbox`,children:[/* @__PURE__ */ Q(`button`,{type:`button`,role:`option`,"aria-selected":n===null,class:`target-option${n===null?` selected`:``}`,onClick:()=>e(null),children:/* @__PURE__ */ Q(`span`,{class:`target-option-title`,children:`New thread`})}),t===null&&/* @__PURE__ */ Q(`p`,{class:`target-empty`,children:`Loading threads…`}),t?.map(t=>/* @__PURE__ */ Q(`button`,{type:`button`,role:`option`,"aria-selected":n===t.id,class:`target-option${n===t.id?` selected`:``}`,onClick:()=>e(t),children:[/* @__PURE__ */ Q(`span`,{class:`thread-dot thread-dot-${t.status}`}),/* @__PURE__ */ Q(`span`,{class:`target-option-title`,children:t.title}),/* @__PURE__ */ Q(ql,{agent:t.agent,size:12}),/* @__PURE__ */ Q(`span`,{class:`target-option-meta`,children:Lu(t.updatedAt)})]},t.id))]})}function Ju(){Tn.value;let e=ln.value;if(!e)return null;let t=U.value===`picking`,n=!t&&!K.value&&bn.value&&W.value&&!G.value;if(!t&&!n)return null;let r=qo(e.getBoundingClientRect());return/* @__PURE__ */ Q(S,{children:[bn.value&&(n||!W.value)&&/* @__PURE__ */ Q(Xu,{element:e,box:r}),/* @__PURE__ */ Q(`div`,{class:`highlight`,style:td(r)}),/* @__PURE__ */ Q(Yu,{element:e,box:r})]})}function Yu({element:e,box:t}){let n=t.top<28;return/* @__PURE__ */ Q(`div`,{class:`highlight-label`,style:{transform:`translate(${Math.max(4,t.left)}px, ${n?t.bottom+6:t.top-26}px)`},children:[ls(e),/* @__PURE__ */ Q(`span`,{class:`highlight-size`,children:[Jo(t.right-t.left),`×`,Jo(t.bottom-t.top)]})]})}function Xu({element:e,box:t}){let n=es(e),r=[...Zu(e,t,n),...Qu(e,t,n),...ed(e,t,n)];return/* @__PURE__ */ Q(S,{children:[r.map((e,t)=>/* @__PURE__ */ Q(`div`,{class:`band band-${e.kind}`,style:td(e.box)},`band-${t}`)),r.filter(e=>e.labelled).map((e,t)=>/* @__PURE__ */ Q(`span`,{class:`band-value band-value-${e.kind}`,style:{transform:nd(e.box)},children:[e.value,e.utility&&/* @__PURE__ */ Q(`span`,{class:`band-utility`,children:e.utility})]},`value-${t}`))]})}function Zu(e,t,{margin:n}){let[r,i,a,o]=n.map(e=>Math.max(0,e)),s={left:t.left-o,top:t.top-r,right:t.right+i,bottom:t.bottom+a};return $u(e,`margin`,[[`top`,r,{...s,bottom:t.top}],[`right`,i,{left:t.right,right:s.right,top:t.top,bottom:t.bottom}],[`bottom`,a,{...s,top:t.bottom}],[`left`,o,{left:s.left,right:t.left,top:t.top,bottom:t.bottom}]])}function Qu(e,t,{padding:n,border:r}){let[i,a,o,s]=n,c={left:t.left+r[3],top:t.top+r[0],right:t.right-r[1],bottom:t.bottom-r[2]},l={top:c.top+i,bottom:c.bottom-o};return $u(e,`padding`,[[`top`,i,{...c,bottom:l.top}],[`right`,a,{...l,left:c.right-a,right:c.right}],[`bottom`,o,{...c,top:l.bottom}],[`left`,s,{...l,left:c.left,right:c.left+s}]])}function $u(e,t,n){return n.filter(([,e,t])=>e>0&&t.right>t.left&&t.bottom>t.top).map(([n,r,i])=>({kind:t,box:i,value:r,labelled:!0,utility:as(e,t,n,r)}))}function ed(e,t,{gap:n,padding:r,border:i}){if(!n)return[];let a={left:t.left+i[3]+r[3],top:t.top+i[0]+r[0],right:t.right-i[1]-r[1],bottom:t.bottom-i[2]-r[2]},o=/* @__PURE__ */ new Set;return ts(e,n,a).map(t=>{let{axis:r,...i}=t,a=!o.has(r);return o.add(r),{kind:`gap`,box:i,value:n[r],labelled:a,utility:a?as(e,`gap`,r,n[r]):void 0}})}function td(e){return{transform:`translate(${e.left}px, ${e.top}px)`,width:`${e.right-e.left}px`,height:`${e.bottom-e.top}px`}}function nd(e){return`translate(${(e.left+e.right)/2}px, ${(e.top+e.bottom)/2}px) translate(-50%, -50%)`}function rd(){if(Tn.value,!bn.value)return null;let e=U.value===`idle`&&!K.value?G.value?.element:void 0,t=ad(e),n=e?.isConnected?qo(e.getBoundingClientRect()):null;return/* @__PURE__ */ Q(S,{children:[e&&n&&/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`div`,{class:`measure-box`,style:td(n)}),/* @__PURE__ */ Q(Yu,{element:e,box:n})]}),t&&/* @__PURE__ */ Q(id,{pair:t})]})}function id({pair:[e,t]}){if(!e.isConnected||!t.isConnected)return null;let n=qo(e.getBoundingClientRect()),r=qo(t.getBoundingClientRect()),i=K.value;return/* @__PURE__ */ Q(S,{children:[i?.element===e&&/* @__PURE__ */ Q(`div`,{class:`measure-box`,style:td(n)}),/* @__PURE__ */ Q(`div`,{class:`measure-target`,style:td(r)}),Yo(n,r).map(e=>/* @__PURE__ */ Q(od,{guide:e},e.side))]})}function ad(e){let t=ln.value,n=K.value;if(U.value===`picking`||!n&&!e){let e=t?.parentElement;return!W.value||!t||!e||e===document.documentElement?null:[t,e]}return e?W.value&&t&&t!==e?[e,t]:null:n?W.value&&t&&t!==n.element?[n.element,t]:n.measuredTo?[n.element,n.measuredTo.element]:null:null}function od({guide:e}){return/* @__PURE__ */ Q(S,{children:[e.extension&&/* @__PURE__ */ Q(`div`,{class:`guide guide-extension`,style:sd(e.extension)}),/* @__PURE__ */ Q(`div`,{class:`guide`,style:sd(e)}),/* @__PURE__ */ Q(`span`,{class:`guide-value`,style:{transform:nd(cd(e))},children:e.value})]})}function sd(e){let t=cd(e);return td(t.left===t.right?{...t,left:t.left-.5,right:t.left+.5}:{...t,top:t.top-.5,bottom:t.top+.5})}function cd({from:e,to:t}){return{left:Math.min(e.x,t.x),right:Math.max(e.x,t.x),top:Math.min(e.y,t.y),bottom:Math.max(e.y,t.y)}}function ld({text:e,animate:t=!1}){let n=t?md(e):0;return/* @__PURE__ */ Q(`div`,{class:`md`,children:ud(e,{index:0,animateFrom:t?n-48:1/0})})}function ud(e,t){let n=[],r=e.replace(/\r\n/g,`
|
|
69
|
+
`}),o.appendChild(r.createTextNode(e))}i.timeEnd(`clone node`),await f?.(h),l!==!1&&Z(h)&&(i.time(`embed web font`),await Al(h,n),i.timeEnd(`embed web font`)),i.time(`embed node`),kl(h,n);let g=a.length,_=0,v=async()=>{for(;;){let e=a.pop();if(!e)break;try{await e}catch(e){n.log.warn(`Failed to run task`,e)}u?.(++_,g)}};u?.(_,g),await Promise.all([...Array.from({length:4})].map(v)),i.timeEnd(`embed node`),await p?.(h);let y=Vl(h,n);return s&&y.insertBefore(s,y.children[0]),o&&y.insertBefore(o,y.children[0]),d&&_l(n),await m?.(y),y}function Vl(e,t){let{width:n,height:r}=t,i=jc(n,r,e.ownerDocument),a=i.ownerDocument.createElementNS(i.namespaceURI,`foreignObject`);return a.setAttributeNS(null,`x`,`0%`),a.setAttributeNS(null,`y`,`0%`),a.setAttributeNS(null,`width`,`100%`),a.setAttributeNS(null,`height`,`100%`),a.append(e),i.appendChild(a),i}async function Hl(e,t){let n=await Uc(e,t),r=await Bl(n),i=Mc(r,n.isEnable(`removeControlCharacter`));return n.autoDestruct||(n.svgStyleElement=Gc(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(Ac,`defs`),n.svgStyles.clear()),await qc(Fc(i,r.ownerDocument),n)}async function Ul(e,t){let n=await Uc(e,t),{log:r,quality:i,type:a,dpi:o}=n,s=await Hl(n);r.time(`canvas to data url`);let c=s.toDataURL(a,i);if([`image/png`,`image/jpeg`].includes(a)&&o&&$s&&ec){let[e,t]=c.split(`,`),n=0,r=!1;if(a===`image/png`){let e=Ys(t);e>=0?(n=Math.ceil((e+28)/3)*4,r=!0):n=44}else a===`image/jpeg`&&(n=24);let i=t.substring(0,n),s=t.substring(n),l=window.atob(i),u=new Uint8Array(l.length);for(let e=0;e<u.length;e++)u[e]=l.charCodeAt(e);let d=a===`image/png`?Js(u,o,r):Us(u,o);c=[e,`,`,window.btoa(String.fromCharCode(...d)),s].join(``)}return r.timeEnd(`canvas to data url`),c}async function Wl(e,t){return Ul(await Uc(e,{...t,type:`image/jpeg`}))}async function Gl(e,t){let n=e.getBoundingClientRect(),r=n.width*n.height<4800&&e.parentElement?e.parentElement:e,i=r.getBoundingClientRect(),a=Math.min(window.devicePixelRatio||1,1600/Math.max(i.width+48,i.height+48,1));try{let e=await Wl(r,{scale:a,quality:.85,backgroundColor:Kl(r),filter:e=>e!==t,timeout:4e3});return e.startsWith(`data:image/jpeg`)?{name:`tencil-element.jpg`,mimeType:`image/jpeg`,dataUrl:e}:null}catch(e){return console.warn(`[tencil] screenshot failed`,e),null}}function Kl(e){let t=e;for(;t;){let e=getComputedStyle(t).backgroundColor;if(e&&e!==`transparent`&&!/rgba\(.*,\s*0\)$/.test(e))return e;t=t.parentElement}return`#ffffff`}var ql=0;Array.isArray;function Q(e,t,r,i,a,o){t||={};var s,c,l=t;if(`ref`in l&&typeof e!=`function`)for(c in l={},t)c==`ref`?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ql,__i:-1,__u:0};return(a||o)&&(u.__source=a,u.__self=o),n.vnode&&n.vnode(u),u}let Jl={t3code:{viewBox:`15.5309 37 94.3941 56.96`,path:`M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z`,className:`agent-mono`,label:`T3 Code`},codex:{viewBox:`0 0 256 260`,path:`M239.184 106.203a64.716 64.716 0 0 0-5.576-53.103C219.452 28.459 191 15.784 163.213 21.74A65.586 65.586 0 0 0 52.096 45.22a64.716 64.716 0 0 0-43.23 31.36c-14.31 24.602-11.061 55.634 8.033 76.74a64.665 64.665 0 0 0 5.525 53.102c14.174 24.65 42.644 37.324 70.446 31.36a64.72 64.72 0 0 0 48.754 21.744c28.481.025 53.714-18.361 62.414-45.481a64.767 64.767 0 0 0 43.229-31.36c14.137-24.558 10.875-55.423-8.083-76.483Zm-97.56 136.338a48.397 48.397 0 0 1-31.105-11.255l1.535-.87 51.67-29.825a8.595 8.595 0 0 0 4.247-7.367v-72.85l21.845 12.636c.218.111.37.32.409.563v60.367c-.056 26.818-21.783 48.545-48.601 48.601Zm-104.466-44.61a48.345 48.345 0 0 1-5.781-32.589l1.534.921 51.722 29.826a8.339 8.339 0 0 0 8.441 0l63.181-36.425v25.221a.87.87 0 0 1-.358.665l-52.335 30.184c-23.257 13.398-52.97 5.431-66.404-17.803ZM23.549 85.38a48.499 48.499 0 0 1 25.58-21.333v61.39a8.288 8.288 0 0 0 4.195 7.316l62.874 36.272-21.845 12.636a.819.819 0 0 1-.767 0L41.353 151.53c-23.211-13.454-31.171-43.144-17.804-66.405v.256Zm179.466 41.695-63.08-36.63L161.73 77.86a.819.819 0 0 1 .768 0l52.233 30.184a48.6 48.6 0 0 1-7.316 87.635v-61.391a8.544 8.544 0 0 0-4.4-7.213Zm21.742-32.69-1.535-.922-51.619-30.081a8.39 8.39 0 0 0-8.492 0L99.98 99.808V74.587a.716.716 0 0 1 .307-.665l52.233-30.133a48.652 48.652 0 0 1 72.236 50.391v.205ZM88.061 139.097l-21.845-12.585a.87.87 0 0 1-.41-.614V65.685a48.652 48.652 0 0 1 79.757-37.346l-1.535.87-51.67 29.825a8.595 8.595 0 0 0-4.246 7.367l-.051 72.697Zm11.868-25.58 28.138-16.217 28.188 16.218v32.434l-28.086 16.218-28.188-16.218-.052-32.434Z`,className:`agent-mono`,label:`Codex`},claudeAgent:{viewBox:`0 0 256 257`,path:`m50.228 170.321 50.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0 125.796l.583-3.759 5.12-3.434 7.324.648 16.202 1.101 24.304 1.685 17.629 1.037 26.118 2.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758 7-7.713 9.397.649 2.398.648 9.527 7.323 20.35 15.75L94.817 91.9l3.889 3.24 1.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0 82.05 1.426l4.472 3.888 6.61 15.101 10.694 23.786 16.591 32.34 4.861 9.592 2.592 8.879.973 2.722h1.685v-1.556l1.36-18.211 2.528-22.36 2.463-28.776.843-8.1 4.018-9.722 7.971-5.25 6.222 2.981 5.12 7.324-.713 4.73-3.046 19.768-5.962 30.98-3.889 20.739h2.268l2.593-2.593 10.499-13.934 17.628-22.036 7.778-8.749 9.073-9.657 5.833-4.601h11.018l8.1 12.055-3.628 12.443-11.342 14.388-9.398 12.184-13.48 18.147-8.426 14.518.778 1.166 2.01-.194 30.46-6.481 16.462-2.982 19.637-3.37 8.88 4.148.971 4.213-3.5 8.62-20.998 5.184-24.628 4.926-36.682 8.685-.454.324.519.648 16.526 1.555 7.065.389h17.304l32.21 2.398 8.426 5.574 5.055 6.805-.843 5.184-12.962 6.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666 11.406 21.387 19.314 26.767 24.887 1.36 6.157-3.434 4.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73 6.935 25.017 37.59 1.296 11.536-1.814 3.76-6.481 2.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194 77.448-3.37 3.953-7.778 2.981-6.48-4.925-3.436-7.972 3.435-15.749 4.148-20.544 3.37-16.333 3.046-20.285 1.815-6.74-.13-.454-1.49.194-15.295 20.999-23.267 31.433-18.406 19.702-4.407 1.75-7.648-3.954.713-7.064 4.277-6.286 25.47-32.405 15.36-20.092 9.917-11.6-.065-1.686h-.583L44.07 198.125l-12.055 1.555-5.185-4.86.648-7.972 2.463-2.593 20.35-13.999-.064.065Z`,className:`agent-claude`,label:`Claude`},cursor:{viewBox:`0 0 466.73 532.09`,path:`M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z`,className:`agent-mono`,label:`Cursor`}};function Yl(e){if(Jl[e])return Jl[e];let t=e.toLowerCase();if(t.includes(`claude`))return Jl.claudeAgent;if(t.includes(`codex`)||t.includes(`openai`))return Jl.codex;if(t.includes(`cursor`))return Jl.cursor}function Xl({agent:e,size:t=13,decorative:n=!1}){if(!e)return null;let r=Yl(e);return r?/* @__PURE__ */ Q(`svg`,{class:`agent-icon ${r.className}`,width:t,height:t,viewBox:r.viewBox,role:n?void 0:`img`,"aria-label":n?void 0:r.label,"aria-hidden":n?`true`:void 0,children:/* @__PURE__ */ Q(`path`,{d:r.path})}):null}function $({children:e,size:t=16}){return/* @__PURE__ */ Q(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:e})}let Zl=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`}),/* @__PURE__ */ Q(`path`,{d:`M12 8v8M8 12h8`})]}),Ql=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M22 12h-6l-2 3h-4l-2-3H2`}),/* @__PURE__ */ Q(`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`})]}),$l=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M10.7 5.1A10.8 10.8 0 0 1 12 5c7 0 10 7 10 7a13.2 13.2 0 0 1-1.7 2.7`}),/* @__PURE__ */ Q(`path`,{d:`M6.6 6.6A13.5 13.5 0 0 0 2 12s3 7 10 7a9.7 9.7 0 0 0 5.4-1.6`}),/* @__PURE__ */ Q(`path`,{d:`M9.9 9.9a3 3 0 1 0 4.2 4.2M2 2l20 20`})]}),eu=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z`}),/* @__PURE__ */ Q(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),tu=()=>/* @__PURE__ */ Q($,{children:/* @__PURE__ */ Q(`path`,{d:`m5 12 7-7 7 7M12 19V5`})}),nu=()=>/* @__PURE__ */ Q($,{size:12,children:/* @__PURE__ */ Q(`rect`,{x:`5`,y:`5`,width:`14`,height:`14`,rx:`2`,fill:`currentColor`})}),ru=()=>/* @__PURE__ */ Q($,{children:/* @__PURE__ */ Q(`path`,{d:`M20 6 9 17l-5-5`})}),iu=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M9 14 4 9l5-5`}),/* @__PURE__ */ Q(`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 0 11H11`})]}),au=()=>/* @__PURE__ */ Q($,{children:/* @__PURE__ */ Q(`path`,{d:`M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})}),ou=()=>/* @__PURE__ */ Q($,{size:14,children:/* @__PURE__ */ Q(`path`,{d:`M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})}),su=()=>/* @__PURE__ */ Q($,{children:/* @__PURE__ */ Q(`path`,{d:`M18 6 6 18M6 6l12 12`})}),cu=()=>/* @__PURE__ */ Q($,{size:14,children:[/* @__PURE__ */ Q(`path`,{d:`M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z`}),/* @__PURE__ */ Q(`circle`,{cx:`12`,cy:`13`,r:`3`})]}),lu=()=>/* @__PURE__ */ Q($,{size:12,children:/* @__PURE__ */ Q(`path`,{d:`m16 18 6-6-6-6M8 6l-6 6 6 6`})}),uu=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`}),/* @__PURE__ */ Q(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),du=({size:e=16})=>/* @__PURE__ */ Q(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,class:`tencil-logo`,children:[/* @__PURE__ */ Q(`path`,{d:`M3 21V9a6 6 0 0 1 6-6h6a6 6 0 0 1 6 6v6a6 6 0 0 1-6 6Z`,fill:`#3b8dff`}),/* @__PURE__ */ Q(`path`,{d:`M9.25 7.5 16.5 12.6l-3.55.75-1.75 3.4Z`,fill:`#fff`,stroke:`#fff`,"stroke-linejoin":`round`})]}),fu=()=>/* @__PURE__ */ Q($,{size:14,children:[/* @__PURE__ */ Q(`path`,{d:`m12 2 10 5-10 5L2 7Z`}),/* @__PURE__ */ Q(`path`,{d:`m2 17 10 5 10-5M2 12l10 5 10-5`})]}),pu=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`rect`,{x:`2`,y:`7`,width:`20`,height:`10`,rx:`2`}),/* @__PURE__ */ Q(`path`,{d:`M6 7v3M10 7v4M14 7v3M18 7v4`})]}),mu=()=>/* @__PURE__ */ Q($,{children:[/* @__PURE__ */ Q(`rect`,{x:`2`,y:`7`,width:`20`,height:`10`,rx:`2`}),/* @__PURE__ */ Q(`path`,{d:`M6 7v3M10 7v4M14 7v3M18 7v4M3 3l18 18`})]}),hu=()=>/* @__PURE__ */ Q($,{size:12,children:/* @__PURE__ */ Q(`path`,{d:`m6 9 6 6 6-6`})}),gu=F(()=>{let e=/* @__PURE__ */ new Map,t=[...jn.value].reverse().filter(e=>e.anchor);for(let[n,r]of t.entries())e.set(r.id,n+1);return e});function _u(){let e=Pn.value.flatMap(e=>{let t=gu.value.get(e.id);return t?[{threadId:e.id,number:t}]:[]});e.length!==0&&H({type:`drafts.send`,drafts:e})&&(q.value=e[0]?.threadId??null)}function vu(){let e=yu();if(hn.value)return null;let t=K.value;return/* @__PURE__ */ Q(S,{children:[Mn.value.map(e=>/* @__PURE__ */ Q(xu,{thread:e},e.id)),e.map(e=>/* @__PURE__ */ Q(bu,{pin:e},`leaving:${e.thread.id}`)),t&&/* @__PURE__ */ Q(Ou,{})]})}function yu(){let e=Mn.value,t=kn.value,n=j({page:t,pins:[]}),[r,i]=A([]);return Ne(()=>{let r=n.current;n.current={page:t,pins:e.map(e=>({thread:e,number:gu.value.get(e.id),variant:ku(e),resolved:!1}))};let a=new Set(e.map(e=>e.id)),o=r.page===t?r.pins.filter(e=>!a.has(e.thread.id)).map(e=>({...e,resolved:B.value.get(e.thread.id)?.resolved===!0})):[];i(e=>{let t=e.filter(e=>!a.has(e.thread.id)&&!o.some(t=>t.thread.id===e.thread.id));return t.length===e.length&&o.length===0?e:[...t,...o]});for(let e of o)setTimeout(()=>i(t=>t.filter(t=>t!==e)),1e3)},[e,t]),r}function bu({pin:e}){On.value;let t=e.thread.anchor?Rs(e.thread.anchor):null;return t?/* @__PURE__ */ Q(`div`,{class:`pin pin-${e.variant} pin-leaving${e.resolved?` pin-resolving`:``}`,style:{transform:`translate(${t.x}px, ${t.y}px)`},"aria-hidden":`true`,children:/* @__PURE__ */ Q(`span`,{class:`pin-body`,children:[/* @__PURE__ */ Q(`span`,{class:`pin-glyph`,children:e.number??`•`}),e.resolved&&/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`span`,{class:`pin-glyph pin-check`,children:/* @__PURE__ */ Q(ru,{})}),/* @__PURE__ */ Q(`span`,{class:`pin-shine`})]})]})}):null}function xu({thread:e}){if(On.value,!e.anchor)return null;let t=Dn.value,n=t?.threadId===e.id,r=n?t.point:Rs(e.anchor);if(!r)return null;let i=q.value===e.id;return/* @__PURE__ */ Q(`button`,{type:`button`,class:`pin pin-${ku(e)}${i?` pin-open`:``}${n?` pin-dragging`:``}`,style:{transform:`translate(${r.x}px, ${r.y}px)`},title:e.title,onPointerDown:t=>Cu(t,e,r),onClick:()=>{if(Su===e.id){Su=null;return}K.value=null,q.value=i?null:e.id},children:/* @__PURE__ */ Q(`span`,{class:`pin-body`,children:gu.value.get(e.id)??`•`})})}let Su=null;function Cu(e,t,n){if(e.button!==0)return;e.preventDefault();let r=e.currentTarget;try{r.setPointerCapture(e.pointerId)}catch{}Su=null;let i=e.clientX,a=e.clientY,o=e=>{let r=e.clientX-i,o=e.clientY-a;!Dn.value&&Math.hypot(r,o)<4||(Dn.value={threadId:t.id,point:wu({x:n.x+r,y:n.y+o})})},s=e=>{r.removeEventListener(`pointermove`,o),r.removeEventListener(`pointerup`,s),r.removeEventListener(`pointercancel`,s),r.removeEventListener(`lostpointercapture`,s),window.removeEventListener(`dragstart`,Tu,!0);let n=Dn.value;n&&(Dn.value=null,Su=t.id,e.type===`pointerup`&&Eu(t,n.point))};r.addEventListener(`pointermove`,o),r.addEventListener(`pointerup`,s),r.addEventListener(`pointercancel`,s),r.addEventListener(`lostpointercapture`,s),window.addEventListener(`dragstart`,Tu,!0)}function wu(e){let{clientWidth:t,clientHeight:n}=document.documentElement;return{x:Math.max(0,Math.min(e.x,t-1)),y:Math.max(0,Math.min(e.y,n-1))}}function Tu(e){e.preventDefault()}function Eu(e,t){let n=Du(t);if(!n)return;let r={selector:ps(n),...zs(n,t)};H({type:`thread.move`,threadId:e.id,anchor:r})&&an({...e,anchor:r})}function Du(e){let t=Is();return document.elementsFromPoint(e.x,e.y).find(e=>e!==t&&e!==document.documentElement)??document.body}function Ou(){On.value;let e=K.value,t=Rs(e.anchor,e.element);return t?/* @__PURE__ */ Q(`div`,{class:`pin pin-draft pin-open`,style:{transform:`translate(${t.x}px, ${t.y}px)`},children:/* @__PURE__ */ Q(`span`,{class:`pin-body`,children:`+`})}):null}function ku(e){if(e.resolved)return`resolved`;let t=e.delivery?.status;if(t&&(e.status===`idle`||e.status===`error`))return t===`queued`||t===`deploying`?`working`:t===`failed`||t===`deploy-failed`?`error`:`done`;switch(e.status){case`draft`:return`queued`;case`starting`:case`working`:return`working`;case`waiting`:return`waiting`;case`error`:return`error`;default:return`done`}}let Au=`tencil:open`;function ju(){let[e,t]=A(`page`),n=R.value?.label??`Agent`,r=L.value===`open`&&R.value?.state===`ready`,i=R.value?.id;return Me(()=>{r&&J.value&&e===`provider`&&ln()},[e,J.value,r,i]),J.value?/* @__PURE__ */ Q(`aside`,{class:`inbox`,children:[/* @__PURE__ */ Q(`header`,{class:`inbox-header`,children:[/* @__PURE__ */ Q(`div`,{class:`segmented`,children:[/* @__PURE__ */ Q(`button`,{type:`button`,class:e===`page`?`active`:``,onClick:()=>t(`page`),children:`This page`}),/* @__PURE__ */ Q(`button`,{type:`button`,class:e===`all`?`active`:``,onClick:()=>t(`all`),children:`All pins`}),/* @__PURE__ */ Q(`button`,{type:`button`,class:e===`provider`?`active`:``,onClick:()=>t(`provider`),children:n})]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:`Close`,onClick:()=>{J.value=!1},children:/* @__PURE__ */ Q(su,{})})]}),e===`provider`?/* @__PURE__ */ Q(Nu,{label:n}):/* @__PURE__ */ Q(Mu,{scope:e})]}):null}function Mu({scope:e}){let t=jn.value.filter(e=>mn.value||!e.resolved).filter(t=>e===`all`||t.anchor&&t.pageUrl&&An(t.pageUrl)===kn.value);return/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`label`,{class:`inbox-filter`,children:[/* @__PURE__ */ Q(`span`,{class:`checkbox`,children:[/* @__PURE__ */ Q(`input`,{type:`checkbox`,class:`checkbox-input`,checked:mn.value,onChange:e=>{mn.value=e.target.checked}}),/* @__PURE__ */ Q(ru,{})]}),`Show resolved`]}),/* @__PURE__ */ Q(`div`,{class:`inbox-list`,children:t.length===0?/* @__PURE__ */ Q(`p`,{class:`empty`,children:[`No pins yet. Press `,/* @__PURE__ */ Q(`kbd`,{children:`C`}),` and click anything on the page.`]}):t.map(e=>/* @__PURE__ */ Q(Iu,{thread:e},e.id))})]})}function Nu({label:e}){let t=Ht.value;return t?t.length===0?/* @__PURE__ */ Q(`p`,{class:`empty`,children:[`No `,e,` threads in this project yet.`]}):/* @__PURE__ */ Q(`div`,{class:`inbox-list inbox-list-provider`,children:t.map(e=>/* @__PURE__ */ Q(Pu,{summary:e},e.id))}):/* @__PURE__ */ Q(`p`,{class:`empty`,children:[`Loading `,e,` threads…`]})}function Pu({summary:e}){let t=Ut.value,n=[...B.value.values()].filter(t=>t.provider.threadId===e.id&&t.anchor).length;return/* @__PURE__ */ Q(`button`,{type:`button`,class:`inbox-item provider-item`,onClick:()=>{let t=dn(e);t&&(q.value=t)},children:[/* @__PURE__ */ Q(`span`,{class:`provider-item-project`,children:[t&&/* @__PURE__ */ Q(Fu,{project:t}),/* @__PURE__ */ Q(`span`,{class:`provider-item-project-name`,children:t?.name}),e.status===`working`||e.status===`waiting`?/* @__PURE__ */ Q(`span`,{class:`provider-item-state state-${e.status}`,children:zu(e.status)}):e.background===`monitoring`?/* @__PURE__ */ Q(`span`,{class:`provider-item-state state-monitoring`,children:`Monitoring`}):/* @__PURE__ */ Q(`span`,{class:`provider-item-time`,children:Bu(e.updatedAt)})]}),/* @__PURE__ */ Q(`span`,{class:`provider-item-title`,children:e.title}),(e.branch||e.pullRequest||e.agent||n>0)&&/* @__PURE__ */ Q(`span`,{class:`provider-item-meta`,children:[e.branch&&/* @__PURE__ */ Q(`span`,{class:`provider-item-branch`,children:e.branch}),e.pullRequest&&/* @__PURE__ */ Q(`span`,{class:`provider-item-pr`,children:[`#`,e.pullRequest.number]}),n>0&&/* @__PURE__ */ Q(`span`,{class:`provider-item-pins`,children:[n,` pin`,n===1?``:`s`]}),/* @__PURE__ */ Q(Xl,{agent:e.agent})]})]})}function Fu({project:e}){return e.emoji?/* @__PURE__ */ Q(`span`,{class:`project-icon project-icon-emoji`,children:e.emoji}):e.iconUrl?/* @__PURE__ */ Q(`img`,{class:`project-icon`,src:e.iconUrl,alt:``}):/* @__PURE__ */ Q(`span`,{class:`project-icon project-icon-letter`,children:e.name.slice(0,1)})}function Iu({thread:e}){let t=!!(e.anchor&&e.pageUrl),n=!t||An(e.pageUrl)===kn.value,r=[...e.messages].reverse().find(e=>e.role===`assistant`);return/* @__PURE__ */ Q(`button`,{type:`button`,class:`inbox-item${q.value===e.id?` active`:``}`,onClick:()=>{if(!n){sessionStorage.setItem(Au,e.id),location.href=e.pageUrl;return}q.value=e.id,Lu(e)},children:[t?/* @__PURE__ */ Q(`span`,{class:`pin pin-static pin-${ku(e)}`,children:/* @__PURE__ */ Q(`span`,{class:`pin-body`,children:gu.value.get(e.id)})}):/* @__PURE__ */ Q(`span`,{class:`thread-dot thread-dot-${e.status}`}),/* @__PURE__ */ Q(`span`,{class:`inbox-item-body`,children:[/* @__PURE__ */ Q(`span`,{class:`inbox-item-title`,children:e.title}),/* @__PURE__ */ Q(`span`,{class:`inbox-item-meta`,children:[!t&&/* @__PURE__ */ Q(`span`,{children:`Not pinned · `}),t&&!n&&/* @__PURE__ */ Q(`span`,{children:[new URL(e.pageUrl).pathname,` · `]}),Ru(e),` · `,Bu(e.updatedAt)]}),r&&/* @__PURE__ */ Q(`span`,{class:`inbox-item-preview`,children:r.text.slice(0,140)})]})]})}function Lu(e){if(e.anchor)try{document.querySelector(e.anchor.selector)?.scrollIntoView({block:`center`,behavior:`smooth`})}catch{}}function Ru(e){if(e.resolved)return`Resolved`;switch(e.status){case`draft`:return`Queued`;case`starting`:return`Starting`;case`working`:return`Working`;case`waiting`:return`Needs input`;case`error`:return`Error`;default:return`Done`}}function zu(e){switch(e){case`working`:return`Working`;case`waiting`:return`Needs input`;case`error`:return`Error`;default:return`Idle`}}function Bu(e){let t=Math.max(0,(Date.now()-Date.parse(e))/1e3);return t<60?`just now`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function Vu({placeholder:e,initialText:t=``,autoFocus:n,disabled:r,busy:i,onSubmit:a,onCancel:o,children:s}){let[c,l]=A(t),u=j(null);Me(()=>{n&&u.current?.focus({preventScroll:!0})},[n]),Me(()=>{let e=u.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,200)}px`)},[c]);let d=c.trim().length>0&&!r&&!i,f=async()=>{d&&(await a(c.trim()),l(``))};return/* @__PURE__ */ Q(`div`,{class:`prompt-input`,children:[/* @__PURE__ */ Q(`textarea`,{ref:u,rows:1,value:c,placeholder:e,disabled:r,onInput:e=>l(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&!e.shiftKey&&!e.isComposing?(e.preventDefault(),f()):e.key===`Escape`&&(e.preventDefault(),o?.())}}),/* @__PURE__ */ Q(`div`,{class:`prompt-actions`,children:[/* @__PURE__ */ Q(`div`,{class:`prompt-extras`,children:s}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`send`,disabled:!d,onClick:()=>void f(),"aria-label":`Send`,title:`Send (Enter)`,children:i?/* @__PURE__ */ Q(`span`,{class:`spinner`}):/* @__PURE__ */ Q(tu,{})})]})]})}let Hu=P(null);function Uu(){On.value;let e=K.value,t=j(null),[n,r]=A(140),[i,a]=A(!1),[o,s]=A(!1),[c,l]=A(null),u=R.value?.state===`ready`,d=R.value?.id;if(Me(()=>{e&&u&&(ln(),un())},[e,u,d]),Me(()=>{Hu.value=null},[d]),Ne(()=>{t.current&&r(t.current.offsetHeight)}),!e)return null;let f=Rs(e.anchor,e.element);if(!f)return null;let{left:p,top:m,origin:h}=Vs(f,{width:340,height:n}),g=R.value,_=g?.state===`ready`,v=vn.value,y=v?null:Hu.value,b=y?void 0:Ju(g?.id);return/* @__PURE__ */ Q(`div`,{ref:t,class:`popover composer`,style:{left:`${p}px`,top:`${m}px`,width:`340px`,transformOrigin:h},children:[/* @__PURE__ */ Q(`div`,{class:`composer-target`,children:[/* @__PURE__ */ Q(`span`,{class:`chip`,children:[/* @__PURE__ */ Q(lu,{}),e.label]}),g&&v&&/* @__PURE__ */ Q(`span`,{class:`composer-provider composer-batch`,children:[`→ Batch · `,Pn.value.length,` queued`]}),g&&!v&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`composer-provider${c===`target`?` open`:``}`,onClick:()=>l(c===`target`?null:`target`),title:`Send to a new thread or continue an existing one`,children:[/* @__PURE__ */ Q(`span`,{class:`composer-provider-label`,children:[`→ `,y?y.title:`New ${g.label} thread`]}),/* @__PURE__ */ Q(hu,{})]})]}),e.measuredTo&&Cn.value&&/* @__PURE__ */ Q(Gu,{pending:e}),c===`target`&&!v&&/* @__PURE__ */ Q(Xu,{onPick:e=>{Hu.value=e,l(null)}}),c===`model`&&b&&/* @__PURE__ */ Q(Yu,{choices:b,onPick:e=>{H({type:`model.select`,model:e}),l(null)}}),/* @__PURE__ */ Q(Vu,{placeholder:v?`Add a comment to the batch…`:_?y?`Continue the thread with this element…`:`What should change here?`:`Waiting for the agent connection…`,autoFocus:!0,busy:o,disabled:!_&&!v,onSubmit:async t=>{s(!0);try{let n=qu(await e.context,e),r=[];if(i){let t=await Gl(e.element,Is());t&&r.push(t)}let a=Lt(),o={...e.anchor,selector:n.selector};if(!H({type:`thread.create`,id:a,pageUrl:location.href,prompt:t,anchor:o,context:n,attachments:r,...y?{providerThreadId:y.id}:{},...v?{draft:!0}:{}}))return;let s=(/* @__PURE__ */ new Date()).toISOString();an({id:a,title:t,pageUrl:location.href,anchor:o,context:n,status:v?`draft`:y?`working`:`starting`,resolved:!1,messages:[{id:`local:${a}`,role:`user`,text:t,streaming:!1,createdAt:s}],provider:{id:g?.id??`unknown`,...y?{threadId:y.id,url:y.url}:{}},createdAt:s,updatedAt:s}),K.value=null,v?In():q.value=a}finally{s(!1)}},onCancel:()=>{K.value=null},children:[/* @__PURE__ */ Q(`button`,{type:`button`,class:`toggle${i?` toggle-on`:``}`,onClick:()=>a(!i),title:i?`Screenshot attached`:`No screenshot`,"aria-pressed":i,children:/* @__PURE__ */ Q(cu,{})}),gn.value&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`toggle${v?` toggle-on`:``}`,onClick:()=>{_n.value=!v,l(null)},title:v?`Batch on: comments are queued and sent together`:`Queue comments and send them together`,"aria-label":`Batch`,"aria-pressed":v,children:/* @__PURE__ */ Q(fu,{})}),b&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`toggle model-toggle${c===`model`?` open`:``}`,onClick:()=>l(c===`model`?null:`model`),title:`Agent and model for the new thread`,children:[/* @__PURE__ */ Q(Xl,{agent:b.current?.agent,size:12}),/* @__PURE__ */ Q(`span`,{class:`model-toggle-label`,children:b.current?.label??`Default model`}),/* @__PURE__ */ Q(hu,{})]})]}),!_&&g?.detail&&/* @__PURE__ */ Q(`p`,{class:`hint`,children:g.detail})]})}let Wu={top:`above`,right:`right`,bottom:`below`,left:`left`};function Gu({pending:e}){let t=e.measuredTo,n=Ku(e),r=[`top`,`right`,`bottom`,`left`].filter(e=>n?.[e]!==void 0).map(e=>`${n[e]} ${Wu[e]}`);return/* @__PURE__ */ Q(`div`,{class:`composer-measure`,children:[/* @__PURE__ */ Q(`span`,{class:`composer-measure-label`,title:`Spacing to ${t.label}: ${r.join(`, `)||`none`}`,children:[`↔ `,t.parent?`Parent `:``,/* @__PURE__ */ Q(`span`,{class:`composer-measure-target`,children:t.label}),r.length>0&&` · ${r.join(`, `)}`]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:`Don't send the spacing`,"aria-label":`Remove spacing`,onClick:()=>{K.value&&={...K.value,measuredTo:void 0}},children:/* @__PURE__ */ Q(su,{})})]})}function Ku(e){let t=e.measuredTo;return!t||!Cn.value||!e.element.isConnected||!t.element.isConnected?void 0:$o(Qo(Xo(e.element.getBoundingClientRect()),Xo(t.element.getBoundingClientRect())),{to:t.label,selector:ps(t.element),...t.parent?{parent:!0}:{}})}function qu(e,t){let n=Ku(t);return n?{...e,spacing:n}:e}function Ju(e){let t=Wt.value;if(!t||t.provider!==e||t.models.length===0)return;let n=e=>t.models.find(t=>t.id===e),r=n(z.value?.model),i=n(t.defaultModel);return{models:t.models,current:r??i,picked:r?.id??null,fallback:i}}function Yu({choices:e,onPick:t}){let n=/* @__PURE__ */ new Map;for(let t of e.models)n.set(t.group,[...n.get(t.group)??[],t]);return/* @__PURE__ */ Q(`div`,{class:`target-menu`,role:`listbox`,children:[/* @__PURE__ */ Q(`button`,{type:`button`,role:`option`,"aria-selected":e.picked===null,class:`target-option${e.picked===null?` selected`:``}`,onClick:()=>t(null),children:[/* @__PURE__ */ Q(`span`,{class:`target-option-title`,children:`Default`}),e.fallback&&/* @__PURE__ */ Q(`span`,{class:`target-option-meta`,children:e.fallback.label})]}),[...n].map(([n,r])=>/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`p`,{class:`menu-group`,children:[/* @__PURE__ */ Q(Xl,{agent:r[0]?.agent,size:11}),n]}),r.map(n=>/* @__PURE__ */ Q(`button`,{type:`button`,role:`option`,"aria-selected":e.picked===n.id,class:`target-option${e.picked===n.id?` selected`:``}`,onClick:()=>t(n.id),children:/* @__PURE__ */ Q(`span`,{class:`target-option-title`,children:n.label})},n.id))]},n))]})}function Xu({onPick:e}){let t=Ht.value,n=Hu.value?.id??null;return/* @__PURE__ */ Q(`div`,{class:`target-menu`,role:`listbox`,children:[/* @__PURE__ */ Q(`button`,{type:`button`,role:`option`,"aria-selected":n===null,class:`target-option${n===null?` selected`:``}`,onClick:()=>e(null),children:/* @__PURE__ */ Q(`span`,{class:`target-option-title`,children:`New thread`})}),t===null&&/* @__PURE__ */ Q(`p`,{class:`target-empty`,children:`Loading threads…`}),t?.map(t=>/* @__PURE__ */ Q(`button`,{type:`button`,role:`option`,"aria-selected":n===t.id,class:`target-option${n===t.id?` selected`:``}`,onClick:()=>e(t),children:[/* @__PURE__ */ Q(`span`,{class:`thread-dot thread-dot-${t.status}`}),/* @__PURE__ */ Q(`span`,{class:`target-option-title`,children:t.title}),/* @__PURE__ */ Q(Xl,{agent:t.agent,size:12}),/* @__PURE__ */ Q(`span`,{class:`target-option-meta`,children:Bu(t.updatedAt)})]},t.id))]})}function Zu(){On.value;let e=fn.value;if(!e)return null;let t=U.value===`picking`,n=!t&&!K.value&&Cn.value&&W.value&&!G.value;if(!t&&!n)return null;let r=Xo(e.getBoundingClientRect());return/* @__PURE__ */ Q(S,{children:[Cn.value&&(n||!W.value)&&/* @__PURE__ */ Q($u,{element:e,box:r}),/* @__PURE__ */ Q(`div`,{class:`highlight`,style:id(r)}),/* @__PURE__ */ Q(Qu,{element:e,box:r})]})}function Qu({element:e,box:t}){let n=t.top<28;return/* @__PURE__ */ Q(`div`,{class:`highlight-label`,style:{transform:`translate(${Math.max(4,t.left)}px, ${n?t.bottom+6:t.top-26}px)`},children:[fs(e),/* @__PURE__ */ Q(`span`,{class:`highlight-size`,children:[Zo(t.right-t.left),`×`,Zo(t.bottom-t.top)]})]})}function $u({element:e,box:t}){let n=rs(e),r=[...ed(e,t,n),...td(e,t,n),...rd(e,t,n)];return/* @__PURE__ */ Q(S,{children:[r.map((e,t)=>/* @__PURE__ */ Q(`div`,{class:`band band-${e.kind}`,style:id(e.box)},`band-${t}`)),r.filter(e=>e.labelled).map((e,t)=>/* @__PURE__ */ Q(`span`,{class:`band-value band-value-${e.kind}`,style:{transform:ad(e.box)},children:[e.value,e.utility&&/* @__PURE__ */ Q(`span`,{class:`band-utility`,children:e.utility})]},`value-${t}`))]})}function ed(e,t,{margin:n}){let[r,i,a,o]=n.map(e=>Math.max(0,e)),s={left:t.left-o,top:t.top-r,right:t.right+i,bottom:t.bottom+a};return nd(e,`margin`,[[`top`,r,{...s,bottom:t.top}],[`right`,i,{left:t.right,right:s.right,top:t.top,bottom:t.bottom}],[`bottom`,a,{...s,top:t.bottom}],[`left`,o,{left:s.left,right:t.left,top:t.top,bottom:t.bottom}]])}function td(e,t,{padding:n,border:r}){let[i,a,o,s]=n,c={left:t.left+r[3],top:t.top+r[0],right:t.right-r[1],bottom:t.bottom-r[2]},l={top:c.top+i,bottom:c.bottom-o};return nd(e,`padding`,[[`top`,i,{...c,bottom:l.top}],[`right`,a,{...l,left:c.right-a,right:c.right}],[`bottom`,o,{...c,top:l.bottom}],[`left`,s,{...l,left:c.left,right:c.left+s}]])}function nd(e,t,n){return n.filter(([,e,t])=>e>0&&t.right>t.left&&t.bottom>t.top).map(([n,r,i])=>({kind:t,box:i,value:r,labelled:!0,utility:cs(e,t,n,r)}))}function rd(e,t,{gap:n,padding:r,border:i}){if(!n)return[];let a={left:t.left+i[3]+r[3],top:t.top+i[0]+r[0],right:t.right-i[1]-r[1],bottom:t.bottom-i[2]-r[2]},o=/* @__PURE__ */ new Set;return is(e,n,a).map(t=>{let{axis:r,...i}=t,a=!o.has(r);return o.add(r),{kind:`gap`,box:i,value:n[r],labelled:a,utility:a?cs(e,`gap`,r,n[r]):void 0}})}function id(e){return{transform:`translate(${e.left}px, ${e.top}px)`,width:`${e.right-e.left}px`,height:`${e.bottom-e.top}px`}}function ad(e){return`translate(${(e.left+e.right)/2}px, ${(e.top+e.bottom)/2}px) translate(-50%, -50%)`}function od(){if(On.value,!Cn.value)return null;let e=U.value===`idle`&&!K.value?G.value?.element:void 0,t=cd(e),n=e?.isConnected?Xo(e.getBoundingClientRect()):null;return/* @__PURE__ */ Q(S,{children:[e&&n&&/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`div`,{class:`measure-box`,style:id(n)}),/* @__PURE__ */ Q(Qu,{element:e,box:n})]}),t&&/* @__PURE__ */ Q(sd,{pair:t})]})}function sd({pair:[e,t]}){if(!e.isConnected||!t.isConnected)return null;let n=Xo(e.getBoundingClientRect()),r=Xo(t.getBoundingClientRect()),i=K.value;return/* @__PURE__ */ Q(S,{children:[i?.element===e&&/* @__PURE__ */ Q(`div`,{class:`measure-box`,style:id(n)}),/* @__PURE__ */ Q(`div`,{class:`measure-target`,style:id(r)}),Qo(n,r).map(e=>/* @__PURE__ */ Q(ld,{guide:e},e.side))]})}function cd(e){let t=fn.value,n=K.value;if(U.value===`picking`||!n&&!e){let e=t?.parentElement;return!W.value||!t||!e||e===document.documentElement?null:[t,e]}return e?W.value&&t&&t!==e?[e,t]:null:n?W.value&&t&&t!==n.element?[n.element,t]:n.measuredTo?[n.element,n.measuredTo.element]:null:null}function ld({guide:e}){return/* @__PURE__ */ Q(S,{children:[e.extension&&/* @__PURE__ */ Q(`div`,{class:`guide guide-extension`,style:ud(e.extension)}),/* @__PURE__ */ Q(`div`,{class:`guide`,style:ud(e)}),/* @__PURE__ */ Q(`span`,{class:`guide-value`,style:{transform:ad(dd(e))},children:e.value})]})}function ud(e){let t=dd(e);return id(t.left===t.right?{...t,left:t.left-.5,right:t.left+.5}:{...t,top:t.top-.5,bottom:t.top+.5})}function dd({from:e,to:t}){return{left:Math.min(e.x,t.x),right:Math.max(e.x,t.x),top:Math.min(e.y,t.y),bottom:Math.max(e.y,t.y)}}function fd({text:e,animate:t=!1}){let n=t?_d(e):0;return/* @__PURE__ */ Q(`div`,{class:`md`,children:pd(e,{index:0,animateFrom:t?n-48:1/0})})}function pd(e,t){let n=[],r=e.replace(/\r\n/g,`
|
|
70
70
|
`).split(`
|
|
71
|
-
`),i=0,a=0;for(;i<r.length;){let e=r[i];if(e.match(/^\s*```(\w*)/)){let e=[];for(i++;i<r.length&&!/^\s*```/.test(r[i]);)e.push(r[i++]);i++,t.index+=
|
|
71
|
+
`),i=0,a=0;for(;i<r.length;){let e=r[i];if(e.match(/^\s*```(\w*)/)){let e=[];for(i++;i<r.length&&!/^\s*```/.test(r[i]);)e.push(r[i++]);i++,t.index+=_d(e.join(`
|
|
72
72
|
`)),n.push(/* @__PURE__ */ Q(`pre`,{children:/* @__PURE__ */ Q(`code`,{children:e.join(`
|
|
73
|
-
`)})},a++));continue}if(/^\s*([-*]|\d+\.)\s+/.test(e)){let o=/^\s*\d+\./.test(e),s=[];for(;i<r.length&&/^\s*([-*]|\d+\.)\s+/.test(r[i]);)s.push(r[i++].replace(/^\s*([-*]|\d+\.)\s+/,``));let c=s.map((e,n)=>/* @__PURE__ */ Q(`li`,{children:fd(e,t)},n));n.push(Q(o?`ol`:`ul`,{children:c},a++));continue}let o=e.match(/^#{1,6}\s+(.*)/);if(o){n.push(/* @__PURE__ */ Q(`p`,{class:`md-heading`,children:fd(o[1],t)},a++)),i++;continue}if(!e.trim()){i++;continue}let s=[];for(;i<r.length&&r[i].trim()&&!/^\s*(```|[-*]\s|\d+\.\s|#{1,6}\s)/.test(r[i]);)s.push(r[i++]);n.push(/* @__PURE__ */ Q(`p`,{children:fd(s.join(` `),t)},a++))}return n}let dd=/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)\s]+\))/g;function fd(e,t){return e.split(dd).map((e,n)=>{if(e.startsWith("`")&&e.endsWith("`")&&e.length>1)return t.index+=md(e),/* @__PURE__ */ Q(`code`,{children:e.slice(1,-1)},n);if(e.startsWith(`**`)&&e.endsWith(`**`)&&e.length>3)return/* @__PURE__ */ Q(`strong`,{children:pd(e.slice(2,-2),t)},n);let r=e.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);return r&&/^https?:\/\//.test(r[2])?/* @__PURE__ */ Q(`a`,{href:r[2],target:`_blank`,rel:`noreferrer`,children:pd(r[1],t)},n):pd(e,t)})}function pd(e,t){return t.animateFrom===1/0?(t.index+=md(e),e):e.split(/(\s+)/).map(e=>{if(!e||/^\s+$/.test(e))return e;let n=t.index++;return n>=t.animateFrom?/* @__PURE__ */ Q(`span`,{class:`w`,children:e},`w${n}`):e})}function md(e){let t=e.match(/\S+/g);return t?t.length:0}function hd(){Tn.value;let e=q.value,t=e?B.value.get(e):void 0,n=j(null),[r,i]=A(320);if(Ne(()=>{n.current&&i(n.current.offsetHeight)}),!t)return null;let a=wn.value,o=a?.threadId===t.id?a.point:t.anchor?Fs(t.anchor):null,{left:s,top:c,origin:l}=o?Rs(o,{width:380,height:r}):{left:window.innerWidth-380-(J.value?372:16),top:16,origin:`top right`};return/* @__PURE__ */ Q(`div`,{ref:n,class:`popover thread${o?``:` thread-docked`}`,style:{left:`${s}px`,top:`${c}px`,width:`380px`,transformOrigin:l},children:[/* @__PURE__ */ Q(_d,{thread:t}),t.status===`draft`?/* @__PURE__ */ Q(gd,{thread:t}):/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(vd,{thread:t},t.id),/* @__PURE__ */ Q(xd,{thread:t},t.id),/* @__PURE__ */ Q(Ru,{placeholder:Tt.value??(t.provider.threadId?`Reply…`:`Waiting for the agent…`),disabled:!t.provider.threadId||Tt.value!==null,onSubmit:e=>{H({type:`thread.reply`,threadId:t.id,text:e})},onCancel:()=>{q.value=null}})]})]})}function gd({thread:e}){let t=e.messages[0]?.text??``,n=jn.value.length;return/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`div`,{class:`status-line status-queued`,children:[e.statusDetail?/* @__PURE__ */ Q(`span`,{class:`status-error`,children:[`Couldn't send: `,e.statusDetail]}):`Queued with ${n===1?`no other comments`:`${n-1} other ${n===2?`comment`:`comments`}`}`,/* @__PURE__ */ Q(`button`,{type:`button`,class:`stop`,onClick:mu,children:[`Send `,n===1?`it`:`all ${n}`,` now`]})]}),/* @__PURE__ */ Q(Ru,{initialText:t,placeholder:`What should change here?`,onSubmit:n=>{n!==t&&H({type:`thread.edit`,threadId:e.id,prompt:n}),q.value=null},onCancel:()=>{q.value=null}},`${e.id}:${t}`)]})}function _d({thread:e}){let t=e.context,n=t?.components[0],r=n?.source;return/* @__PURE__ */ Q(`div`,{class:`thread-header`,children:[/* @__PURE__ */ Q(`div`,{class:`thread-heading`,children:t?/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`span`,{class:`thread-number`,children:[`#`,pu.value.get(e.id)]}),/* @__PURE__ */ Q(`span`,{class:`chip`,title:t.selector,children:[/* @__PURE__ */ Q(ou,{}),n?.name??`<${t.tagName}>`]}),r&&/* @__PURE__ */ Q(`span`,{class:`thread-source`,title:r.file,children:[r.file.split(`/`).pop(),r.line?`:${r.line}`:``]})]}):/* @__PURE__ */ Q(`span`,{class:`thread-title`,title:e.title,children:e.title})}),/* @__PURE__ */ Q(`div`,{class:`thread-tools`,children:[e.provider.url&&/* @__PURE__ */ Q(`a`,{class:`icon-button`,href:e.provider.url,target:`_blank`,rel:`noreferrer`,title:`Open in ${an(e.provider.id)}`,children:/* @__PURE__ */ Q(ru,{})}),e.status!==`draft`&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:e.resolved?`Reopen`:`Resolve`,onClick:()=>{H({type:`thread.resolve`,threadId:e.id,resolved:!e.resolved}),e.resolved||(q.value=null)},children:e.resolved?/* @__PURE__ */ Q(tu,{}):/* @__PURE__ */ Q(eu,{})}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:`Delete pin (keeps the agent thread)`,onClick:()=>{H({type:`thread.delete`,threadId:e.id}),q.value=null},children:/* @__PURE__ */ Q(nu,{})}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:`Close (Esc)`,onClick:()=>{q.value=null},children:/* @__PURE__ */ Q(iu,{})})]})]})}function vd({thread:e}){let t=j(null),n=j(null),r=j(!0),[i,a]=A(!1),o=e.messages[e.messages.length-1];return Ne(()=>{o?.role===`user`&&(r.current=!0)},[o?.id]),Ne(()=>{let e=t.current,i=n.current;if(!e||!i)return;let a=()=>{r.current&&(e.scrollTop=e.scrollHeight)};a();let o=new ResizeObserver(a);return o.observe(e),o.observe(i),()=>o.disconnect()},[]),/* @__PURE__ */ Q(`div`,{ref:t,class:`messages`,"data-scrolled":i||void 0,onScroll:e=>{let t=e.currentTarget;r.current=t.scrollHeight-t.scrollTop-t.clientHeight<24,a(t.scrollTop>4)},children:/* @__PURE__ */ Q(`div`,{ref:n,class:`messages-list`,children:e.messages.map(e=>e.role===`user`?/* @__PURE__ */ Q(`div`,{class:`message message-user`,children:e.text},e.id):/* @__PURE__ */ Q(yd,{message:e},e.id))})})}function yd({message:e}){let[t]=A(e.streaming);return/* @__PURE__ */ Q(`div`,{class:`message message-assistant`,children:/* @__PURE__ */ Q(ld,{text:e.text,animate:t})})}function bd({text:e}){let t=[...e];return/* @__PURE__ */ Q(`span`,{class:`shimmer`,children:[/* @__PURE__ */ Q(`span`,{class:`sr-only`,children:e}),t.map((e,n)=>/* @__PURE__ */ Q(`span`,{"aria-hidden":`true`,style:{"--i":n,"--n":t.length},children:e},n))]})}function xd({thread:e}){let[t,n]=A(!1),r=e.steps??[],i=r.length>0?{open:t,onToggle:()=>n(!t)}:void 0,a=e.status===`working`;return/* @__PURE__ */ Q(S,{children:[t&&r.length>0&&/* @__PURE__ */ Q(Cd,{steps:r,follow:a}),/* @__PURE__ */ Q(Od,{thread:e,steps:i}),i&&!a&&/* @__PURE__ */ Q(`div`,{class:`status-line`,children:/* @__PURE__ */ Q(Sd,{...i,children:[r.filter(e=>!e.parentId).length,` steps`,Ed(r)?` · ${Ed(r)}`:``]})}),e.delivery&&!a&&/* @__PURE__ */ Q(kd,{delivery:e.delivery})]})}function Sd({open:e,onToggle:t,children:n}){return/* @__PURE__ */ Q(`button`,{type:`button`,class:`steps-toggle${e?` open`:``}`,"aria-expanded":e,title:e?`Hide steps`:`Show steps`,onClick:t,children:[n,/* @__PURE__ */ Q(fu,{})]})}function Cd({steps:e,follow:t}){let n=j(null),r=j(!0);return Ne(()=>{let e=n.current;e&&t&&r.current&&(e.scrollTop=e.scrollHeight)}),/* @__PURE__ */ Q(`ol`,{ref:n,class:`steps`,onScroll:e=>{let t=e.currentTarget;r.current=t.scrollHeight-t.scrollTop-t.clientHeight<16},children:e.map(e=>/* @__PURE__ */ Q(`li`,{class:`step step-${e.status}${e.parentId?` step-child`:``}`,title:e.detail?`${e.label}\n${e.detail}`:e.label,children:[/* @__PURE__ */ Q(`span`,{class:`step-mark`,children:e.status===`running`?/* @__PURE__ */ Q(`span`,{class:`live-dot`}):e.status===`done`?/* @__PURE__ */ Q(eu,{}):e.status===`failed`?/* @__PURE__ */ Q(iu,{}):`–`}),/* @__PURE__ */ Q(`span`,{class:`step-label`,children:[e.label,e.detail&&/* @__PURE__ */ Q(`span`,{class:`step-detail`,children:e.detail})]}),e.endedAt&&/* @__PURE__ */ Q(`span`,{class:`step-time`,children:Td(e)})]},e.id))})}function wd(e){return e.findLast(e=>e.status===`running`)}function Td(e){return e.endedAt?Dd((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3):``}function Ed(e){let t=e[0],n=e.map(e=>e.endedAt).filter(e=>!!e);if(!t||n.length===0)return``;let r=n.reduce((e,t)=>e>t?e:t);return Dd((Date.parse(r)-Date.parse(t.startedAt))/1e3)}function Dd(e){return!Number.isFinite(e)||e<1?``:e<60?`${Math.round(e)}s`:`${Math.floor(e/60)}m ${String(Math.round(e%60)).padStart(2,`0`)}s`}function Od({thread:e,steps:t}){return e.status===`starting`?/* @__PURE__ */ Q(`div`,{class:`status-line`,children:[/* @__PURE__ */ Q(`span`,{class:`live-dot`}),/* @__PURE__ */ Q(bd,{text:`Starting a thread in ${an(e.provider.id)}…`})]}):e.status===`working`?/* @__PURE__ */ Q(`div`,{class:`status-line`,children:[/* @__PURE__ */ Q(`span`,{class:`live-dot`}),t?/* @__PURE__ */ Q(Sd,{...t,children:/* @__PURE__ */ Q(bd,{text:`${wd(e.steps??[])?.label??`Working`}…`})}):/* @__PURE__ */ Q(bd,{text:`Working…`}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`stop`,onClick:()=>H({type:`thread.interrupt`,threadId:e.id}),children:[/* @__PURE__ */ Q($l,{}),` Stop`]})]}):e.status===`waiting`?/* @__PURE__ */ Q(`div`,{class:`status-line status-waiting`,children:[e.statusDetail??`Waiting for input`,e.provider.url&&/* @__PURE__ */ Q(`a`,{href:e.provider.url,target:`_blank`,rel:`noreferrer`,children:`Open`})]}):e.status===`error`?/* @__PURE__ */ Q(`div`,{class:`status-line status-error`,children:e.statusDetail??`Something went wrong`}):null}function kd({delivery:e}){let t=e.pullRequest,n=t&&/* @__PURE__ */ Q(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,children:t.opened?`Opened #${t.number}`:`#${t.number}`}),r=e.commit&&/* @__PURE__ */ Q(`a`,{class:`delivery-commit`,href:e.commit.url,target:`_blank`,rel:`noreferrer`,children:e.commit.sha.slice(0,7)});switch(e.status){case`queued`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery`,children:[/* @__PURE__ */ Q(`span`,{class:`live-dot`}),/* @__PURE__ */ Q(bd,{text:e.queuePosition?`Waiting, ${e.queuePosition} ahead on this branch`:`Waiting for the branch…`})]});case`pushed`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery`,children:[/* @__PURE__ */ Q(`span`,{children:[`Pushed `,r]}),n]});case`deploying`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery`,children:[/* @__PURE__ */ Q(`span`,{class:`live-dot`}),/* @__PURE__ */ Q(bd,{text:`Deploying the preview…`}),n]});case`live`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery delivery-live`,children:[/* @__PURE__ */ Q(`span`,{children:[`Live `,r]}),e.previewUrl?/* @__PURE__ */ Q(`a`,{href:e.previewUrl,children:`Open the new preview`}):n]});case`deploy-failed`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery status-error`,children:[/* @__PURE__ */ Q(`span`,{children:[`Preview deploy failed `,r]}),e.logsUrl?/* @__PURE__ */ Q(`a`,{href:e.logsUrl,target:`_blank`,rel:`noreferrer`,children:`Logs`}):n]});case`no-changes`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery`,children:`No changes needed, nothing pushed`});case`failed`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery status-error`,children:[/* @__PURE__ */ Q(`span`,{class:`delivery-detail`,title:e.detail,children:[`Couldn't push`,e.detail?`: ${e.detail}`:``]}),n]})}}let Ad=`tencil:dock`,jd=[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`],Md,Nd=P(Pd());function Pd(){try{let e=localStorage.getItem(Ad);return e&&jd.includes(e)?e:`bottom-center`}catch{return`bottom-center`}}function Fd(e){Nd.value=e;try{localStorage.setItem(Ad,e)}catch{}}function Id(e,t,n,r){let i=e<n/3?`left`:e>n*2/3?`right`:`center`;return`${t<r/2?`top`:`bottom`}-${i}`}function Ld(e,t){if(e.button!==0)return;e.preventDefault();let n=e.currentTarget;try{n.setPointerCapture(e.pointerId)}catch{}let[r,i]=Vd(t);Md?.(),t.style.transition=`none`,t.style.translate=`${r}px ${i}px`;let a=e.clientX,o=e.clientY,s=r!==0||i!==0,c=[],l=e=>{let n=e.clientX-a,l=e.clientY-o;!s&&Math.hypot(n,l)<3||(s=!0,t.dataset.dragging=``,t.style.translate=`${r+n}px ${i+l}px`,c=[...c.filter(t=>e.timeStamp-t.t<80),{x:e.clientX,y:e.clientY,t:e.timeStamp}])},u=e=>{if(n.removeEventListener(`pointermove`,l),n.removeEventListener(`pointerup`,u),n.removeEventListener(`pointercancel`,u),n.removeEventListener(`lostpointercapture`,u),window.removeEventListener(`dragstart`,Rd,!0),delete t.dataset.dragging,!s){t.style.translate=``,t.style.transition=``;return}c=c.filter(t=>e.timeStamp-t.t<80);let r=c[0],i=c[c.length-1],a=r&&i?Math.max(1,i.t-r.t):1,o=e=>Math.max(-2.5,Math.min(2.5,e/a)),d=r&&i?o(i.x-r.x):0,f=r&&i?o(i.y-r.y):0,p=Hd(t);Bd(t,p,Id(p.left+p.width/2+d*120,p.top+p.height/2+f*120,window.innerWidth,window.innerHeight))};n.addEventListener(`pointermove`,l),n.addEventListener(`pointerup`,u),n.addEventListener(`pointercancel`,u),n.addEventListener(`lostpointercapture`,u),window.addEventListener(`dragstart`,Rd,!0)}function Rd(e){e.preventDefault()}function zd(e,t){let[n,r]=Nd.value.split(`-`),i=[`left`,`center`,`right`],a=i.indexOf(r),o;return e===`ArrowLeft`&&a>0&&(o=`${n}-${i[a-1]}`),e===`ArrowRight`&&a<2&&(o=`${n}-${i[a+1]}`),e===`ArrowUp`&&n===`bottom`&&(o=`top-${r}`),e===`ArrowDown`&&n===`top`&&(o=`bottom-${r}`),o?(Fd(o),t.style.translate=``,!0):!1}function Bd(e,t,n){Fd(n);let r=0,i,a=()=>{cancelAnimationFrame(r),clearTimeout(i),e.removeEventListener(`transitionend`,o),Md=void 0,e.style.transition=``,e.style.translate=``},o=t=>{t.target===e&&t.propertyName===`translate`&&a()};Md=()=>{cancelAnimationFrame(r),clearTimeout(i),e.removeEventListener(`transitionend`,o),Md=void 0},r=requestAnimationFrame(()=>{e.style.translate=``;let n=Hd(e);if(e.style.translate=`${t.left-n.left}px ${t.top-n.top}px`,matchMedia(`(prefers-reduced-motion: reduce)`).matches){a();return}r=requestAnimationFrame(()=>{e.style.transition=`translate 340ms cubic-bezier(0.32, 0.72, 0, 1)`,e.style.translate=`0px 0px`,e.addEventListener(`transitionend`,o),i=setTimeout(a,440)})})}function Vd(e){let t=getComputedStyle(e).translate;if(!t||t===`none`)return[0,0];let[n=`0`,r=`0`]=t.split(` `);return[Number.parseFloat(n)||0,Number.parseFloat(r)||0]}function Hd(e){return(e.querySelector(`.toolbar`)??e).getBoundingClientRect()}let Ud=P(null);function Wd(){let e=()=>{let e=Kd(),t=Ud.value;qd(e,t)||(Ud.value=e)};e();let t=setInterval(e,500);return window.addEventListener(`resize`,e,{passive:!0}),()=>{clearInterval(t),window.removeEventListener(`resize`,e)}}function Gd(e,t){return!t||e.endsWith(`center`)||Id((t.left+t.right)/2,(t.top+t.bottom)/2,window.innerWidth,window.innerHeight)!==e?{}:e.endsWith(`left`)?{left:`${t.right+8}px`}:{right:`${window.innerWidth-t.left+8}px`}}function Kd(){for(let e of document.querySelectorAll(`nextjs-portal`)){let t=e.shadowRoot?.getElementById(`devtools-indicator`);if(!t)continue;let n=t.getBoundingClientRect();if(n.width!==0&&n.height!==0)return{left:n.left,top:n.top,right:n.right,bottom:n.bottom}}return null}function qd(e,t){return!e||!t?e===t:Math.round(e.left)===Math.round(t.left)&&Math.round(e.top)===Math.round(t.top)&&Math.round(e.right)===Math.round(t.right)&&Math.round(e.bottom)===Math.round(t.bottom)}function Jd(){let[e,t]=A(``),n=Ut.value??[],r=e.trim().toLowerCase(),i=r?n.filter(e=>e.title.toLowerCase().includes(r)||e.root.toLowerCase().includes(r)):n,a=e=>H({type:`project.select`,root:e});return/* @__PURE__ */ Q(`div`,{class:`project-picker`,children:[/* @__PURE__ */ Q(`p`,{class:`project-picker-title`,children:`Which project is this page?`}),n.length===0?/* @__PURE__ */ Q(`p`,{class:`project-picker-empty`,children:Wt.value??`No projects found.`}):/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`input`,{class:`project-picker-search`,type:`search`,placeholder:`Search projects`,"aria-label":`Search projects`,autoFocus:!0,value:e,onInput:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i[0]&&a(i[0].root)}}),/* @__PURE__ */ Q(`div`,{class:`project-picker-list`,children:[i.length===0&&/* @__PURE__ */ Q(`p`,{class:`project-picker-empty`,children:[`No project matches “`,e.trim(),`”.`]}),i.map(e=>/* @__PURE__ */ Q(`button`,{type:`button`,class:`project-picker-option`,title:e.root,onClick:()=>a(e.root),children:[/* @__PURE__ */ Q(`span`,{class:`project-picker-name`,children:e.title}),/* @__PURE__ */ Q(`span`,{class:`project-picker-root`,children:e.root})]},e.root))]})]})]})}function Yd(){if(!un.value)return null;let e=z.value,t=R.value,n=()=>{un.value=!1};return/* @__PURE__ */ Q(`section`,{class:`settings-panel`,role:`dialog`,"aria-label":`Project settings`,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},children:[/* @__PURE__ */ Q(`header`,{class:`settings-header`,children:[/* @__PURE__ */ Q(`div`,{class:`settings-heading`,children:[/* @__PURE__ */ Q(`strong`,{children:`Settings`}),Rt.value&&/* @__PURE__ */ Q(`span`,{class:`settings-project`,children:Rt.value.name})]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:`Close (Esc)`,onClick:n,children:/* @__PURE__ */ Q(iu,{})})]}),e?/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`div`,{class:`settings-section`,children:[/* @__PURE__ */ Q(`p`,{class:`settings-label`,id:`tencil-provider-label`,children:`Agent for new pins`}),/* @__PURE__ */ Q(`fieldset`,{class:`settings-options`,"aria-labelledby":`tencil-provider-label`,children:e.providers.map(n=>{let r=n.id===e.provider;return/* @__PURE__ */ Q(`label`,{class:`target-option${r?` selected`:``}`,children:[/* @__PURE__ */ Q(`input`,{type:`radio`,name:`tencil-provider`,class:`settings-radio`,checked:r,onChange:()=>H({type:`settings.update`,provider:n.id})}),/* @__PURE__ */ Q(ql,{agent:n.id,size:14,decorative:!0}),/* @__PURE__ */ Q(`span`,{class:`target-option-title`,children:n.label}),r&&t?.id===n.id&&/* @__PURE__ */ Q(`span`,{class:`target-option-meta`,children:Xd(t)})]},n.id)})}),t&&t.id===e.provider&&t.state!==`ready`&&t.detail&&/* @__PURE__ */ Q(`p`,{class:`settings-status`,children:t.detail}),/* @__PURE__ */ Q(`p`,{class:`settings-help`,children:`Pins you already made keep their agent.`})]}),/* @__PURE__ */ Q(`label`,{class:`settings-section settings-switch-row`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-switch-text`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-label`,children:`Batch mode`}),/* @__PURE__ */ Q(`span`,{class:`settings-help`,children:[`Adds `,/* @__PURE__ */ Q(lu,{}),` to the comment box to queue comments and send them together.`]})]}),/* @__PURE__ */ Q(`input`,{type:`checkbox`,role:`switch`,class:`settings-switch`,checked:e.batch,"aria-checked":e.batch,onChange:e=>gn(e.currentTarget.checked)})]}),/* @__PURE__ */ Q(`label`,{class:`settings-section settings-switch-row`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-switch-text`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-label`,children:`Ruler`}),/* @__PURE__ */ Q(`span`,{class:`settings-help`,children:[`Adds `,/* @__PURE__ */ Q(uu,{}),` to the toolbar. With it on, hold `,Go,` to measure spacing on the page.`]})]}),/* @__PURE__ */ Q(`input`,{type:`checkbox`,role:`switch`,class:`settings-switch`,checked:e.ruler,"aria-checked":e.ruler,onChange:e=>xn(e.currentTarget.checked)})]})]}):/* @__PURE__ */ Q(`p`,{class:`empty`,children:`Connecting…`}),I.value&&/* @__PURE__ */ Q(`div`,{class:`settings-section settings-account`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-help`,children:[`Signed in to Tencil Cloud as`,` `,/* @__PURE__ */ Q(`strong`,{children:I.value.login?`@${I.value.login}`:I.value.name})]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`hint-action`,onClick:()=>{jt(Zt()),Qt()},children:`Sign out`})]})]})}function Xd(e){switch(e.state){case`ready`:return`Ready`;case`unauthorized`:return e.canPair?`Not paired`:`Not signed in`;case`unavailable`:return`Unavailable`;default:return`Connecting…`}}function Zd({tone:e,label:t}){let[n,r]=A(!1),i=j(void 0);Me(()=>()=>clearTimeout(i.current),[]);let a=e=>{clearTimeout(i.current),i.current=setTimeout(()=>r(!0),e)},o=()=>{clearTimeout(i.current),r(!1)};return/* @__PURE__ */ Q(`span`,{class:`status`,onPointerEnter:()=>a(250),onPointerLeave:o,children:[/* @__PURE__ */ Q(`button`,{type:`button`,class:`status-button`,"aria-label":`Tencil status: ${t}`,"aria-expanded":n,"aria-describedby":n?`tencil-status-card`:void 0,onFocus:()=>a(0),onBlur:o,onClick:()=>n?o():a(0),children:/* @__PURE__ */ Q(`span`,{class:`status-dot status-${e}`,children:Mn.value>0&&/* @__PURE__ */ Q(`span`,{class:`status-ping`})})}),n&&/* @__PURE__ */ Q(Qd,{tone:e})]})}function Qd({tone:e}){let t=R.value,n=L.value,r=jn.value.length,i=Mn.value;return/* @__PURE__ */ Q(`div`,{class:`status-card`,role:`tooltip`,id:`tencil-status-card`,children:[/* @__PURE__ */ Q(`div`,{class:`status-card-head`,children:[/* @__PURE__ */ Q(cu,{size:18}),/* @__PURE__ */ Q(`strong`,{children:`Tencil`}),zt.value&&/* @__PURE__ */ Q(`span`,{class:`status-card-muted`,children:[`v`,zt.value]})]}),/* @__PURE__ */ Q(`dl`,{class:`status-card-rows`,children:[/* @__PURE__ */ Q($d,{label:Xt()?`Tencil Cloud`:`Daemon`,children:[/* @__PURE__ */ Q(`span`,{class:`status-card-tone tone-${n===`open`?`ok`:e}`}),n===`open`?`Connected`:n===`connecting`?`Connecting…`:`Offline`]}),/* @__PURE__ */ Q($d,{label:`Address`,children:en()}),/* @__PURE__ */ Q($d,{label:`Project`,children:Ut.value?`Not picked yet`:Rt.value?/* @__PURE__ */ Q(`span`,{title:Rt.value.root,children:Rt.value.name}):`…`}),/* @__PURE__ */ Q($d,{label:`Agent`,children:t?/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`span`,{class:`status-card-tone tone-${t.state===`ready`?`ok`:e}`}),t.label,/* @__PURE__ */ Q(`span`,{class:`status-card-muted`,children:Xd(t)})]}):`…`}),t?.target&&/* @__PURE__ */ Q($d,{label:`Workspace`,children:t.target}),I.value&&/* @__PURE__ */ Q($d,{label:`Signed in`,children:[I.value.login?`@${I.value.login}`:I.value.name,I.value.access===`read`&&/* @__PURE__ */ Q(`span`,{class:`status-card-muted`,children:`view only`})]}),(i>0||r>0)&&/* @__PURE__ */ Q($d,{label:`Pins`,children:[i>0&&`${i} working`,r>0&&`${r} queued`].filter(Boolean).join(` · `)})]}),t&&t.state!==`ready`&&t.detail&&/* @__PURE__ */ Q(`p`,{class:`status-card-detail`,children:t.detail})]})}function $d({label:e,children:t}){return/* @__PURE__ */ Q(`div`,{class:`status-card-row`,children:[/* @__PURE__ */ Q(`dt`,{children:e}),/* @__PURE__ */ Q(`dd`,{children:t})]})}function ef(){let e=nf(),t=U.value===`picking`,n=j(null);return/* @__PURE__ */ Q(`div`,{ref:n,class:`toolbar-wrap dock-${Nd.value}`,style:Gd(Nd.value,Ud.value),children:[t&&/* @__PURE__ */ Q(`div`,{class:`toolbar-hint`,children:[`Click any element to pin a prompt`,bn.value&&` · ${Go} to measure`,` · Esc to cancel`]}),!t&&/* @__PURE__ */ Q(Yd,{}),!t&&Ut.value&&/* @__PURE__ */ Q(Jd,{}),!t&&!Ut.value&&e.hint&&/* @__PURE__ */ Q(`div`,{class:`toolbar-hint hint-${e.tone}`,children:[e.hint,e.action&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`hint-action`,onClick:e.action.run,children:e.action.label})]}),!t&&!e.hint&&G.value&&!K.value&&/* @__PURE__ */ Q(`div`,{class:`toolbar-hint`,children:[`Hold `,Go,` and hover to measure · C to comment · Esc to clear`]}),/* @__PURE__ */ Q(`div`,{class:`toolbar`,children:[/* @__PURE__ */ Q(Zd,{tone:e.tone,label:e.title}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`divider`,"aria-label":`Move toolbar (drag, or use arrow keys)`,title:`Drag to move`,onPointerDown:e=>n.current&&Ld(e,n.current),onKeyDown:e=>{n.current&&zd(e.key,n.current)&&e.preventDefault()}}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool${t?` tool-active`:``}`,title:Tt.value??`Comment (C)`,disabled:Tt.value!==null,onClick:()=>t?Pn():Nn(),children:[/* @__PURE__ */ Q(Jl,{}),/* @__PURE__ */ Q(`span`,{class:`tool-label`,children:`Comment`}),/* @__PURE__ */ Q(`kbd`,{children:`C`})]}),vn.value&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool${yn.value?``:` tool-off`}`,title:yn.value?`Ruler on (R): hold ${Go} to measure`:`Ruler off (R)`,"aria-label":`Ruler`,"aria-pressed":yn.value,onClick:Sn,children:yn.value?/* @__PURE__ */ Q(uu,{}):/* @__PURE__ */ Q(du,{})}),jn.value.length>0&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool tool-send`,title:`Send the queued comments to the agent as one thread`,disabled:R.value?.state!==`ready`,onClick:mu,children:[/* @__PURE__ */ Q(Ql,{}),/* @__PURE__ */ Q(`span`,{class:`tool-label`,children:[`Send `,jn.value.length]})]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool${J.value?` tool-active`:``}`,title:`Pins`,onClick:()=>{J.value=!J.value,un.value=!1},children:[/* @__PURE__ */ Q(Yl,{}),An.value>0&&/* @__PURE__ */ Q(`span`,{class:`badge`,children:An.value})]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool`,title:fn.value?`Show pins`:`Hide pins`,onClick:()=>{fn.value=!fn.value,fn.value&&Pn()},children:fn.value?/* @__PURE__ */ Q(Xl,{}):/* @__PURE__ */ Q(Zl,{})}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool${un.value?` tool-active`:``}`,title:`Project settings`,disabled:!Rt.value,onClick:()=>{un.value=!un.value,J.value=!1},children:/* @__PURE__ */ Q(su,{})})]})]})}let tf={label:`Switch agent`,run:()=>{un.value=!0,J.value=!1}};function nf(){if(L.value!==`open`)return Xt()?{tone:`error`,title:`Tencil Cloud unreachable`,hint:L.value===`connecting`?void 0:`Can't reach Tencil Cloud. Retrying…`}:{tone:`error`,title:`Tencil daemon offline`,hint:L.value===`connecting`?void 0:`The Tencil daemon stopped. Start it again with npx tencil start.`};let e=Ct.value;if(e)return{tone:`warn`,title:`Sign in to Tencil Cloud`,hint:e.reason??`Sign in with GitHub to pin on this preview`,action:wt.value?void 0:{label:`Sign in`,run:()=>rf(e.signIn)}};if(Ut.value)return{tone:`warn`,title:`Pick this page's project`};let t=R.value;if(!t)return{tone:`warn`,title:`Connecting…`};switch(t.state){case`ready`:return{tone:`ok`,title:`${t.label}${t.target?` · ${t.target}`:``}`};case`unauthorized`:return t.canPair?{tone:`warn`,title:`${t.label}: not paired`,hint:`Not paired with ${t.label}`,action:{label:`Pair`,run:()=>H({type:`provider.pair`})}}:{tone:`warn`,title:`${t.label}: not signed in`,hint:t.detail??`Sign in to ${t.label}`,action:tf};case`unavailable`:return{tone:`error`,title:t.detail??`${t.label} unavailable`,hint:t.detail??`${t.label} is unavailable`,action:tf};default:return{tone:`warn`,title:`Connecting to ${t.label}…`}}}function rf(e){Mt(Zt(),e).then(Qt,e=>{Gt.value={message:e instanceof Error?e.message:String(e),at:Date.now()}})}function af(){return sf(),/* @__PURE__ */ Q(`div`,{class:`root${U.value===`picking`?` picking`:``}`,children:[/* @__PURE__ */ Q(Ju,{}),/* @__PURE__ */ Q(rd,{}),/* @__PURE__ */ Q(hu,{}),/* @__PURE__ */ Q(Bu,{}),/* @__PURE__ */ Q(hd,{}),/* @__PURE__ */ Q(Ou,{}),/* @__PURE__ */ Q(of,{}),/* @__PURE__ */ Q(ef,{})]})}function of(){let e=Gt.value,[t,n]=A(!1);return Me(()=>{if(!e)return;n(!0);let t=setTimeout(()=>n(!1),5e3);return()=>clearTimeout(t)},[e?.at]),!e||!t?null:/* @__PURE__ */ Q(`div`,{class:`toast`,children:e.message})}function sf(){let e=B.value;Me(()=>{let t=sessionStorage.getItem(Du);if(!t)return;let n=e.get(t);n&&(sessionStorage.removeItem(Du),q.value=t,Pu(n))},[e])}let cf=[`pointerdown`,`pointerup`,`mousedown`,`mouseup`,`dblclick`,`contextmenu`,`auxclick`];function lf(e){let t=t=>t.composedPath().includes(e),n=(t,n)=>{for(let r of document.elementsFromPoint(t,n)){if(r===e||e.contains(r))return null;if(r!==document.documentElement)return r}return null},r=()=>U.value===`picking`||W.value&&bn.value,i=null,a=null,o=()=>{if(!r()){ln.value&&=null;return}ln.value=!i||i.ours?null:n(i.x,i.y);let e=G.value?.element;e&&ln.value&&ln.value!==e&&(a=ln.value)},s=(e,t,n)=>{Pn(),G.value=null,K.value={element:e,label:ls(e),anchor:{selector:``,...t},context:cs(e),...n?{measuredTo:{...n,label:ls(n.element)}}:{}}},c=e=>{i={x:e.clientX,y:e.clientY,ours:t(e)},W.value=e.altKey,o()},l=e=>{e.key===`Alt`&&(W.value=e.type===`keydown`,bn.value&&e.preventDefault(),o())},u=()=>{W.value=!1,o()},d=e=>{if(!r()&&e.type===`pointerdown`&&!t(e)){un.value=!1,(q.value?B.value.get(q.value):void 0)?.anchor&&(q.value=null);return}r()&&!t(e)&&(e.preventDefault(),e.stopImmediatePropagation())},f=i=>{if(!r()||t(i))return;i.preventDefault(),i.stopImmediatePropagation();let o=n(i.clientX,i.clientY);if(!o)return;let c=Is(o,{x:i.clientX,y:i.clientY});if(U.value!==`picking`){let t=K.value;if(t)K.value={...t,measuredTo:o===t.element?void 0:{element:o,label:ls(o),parent:!1}};else{let t=G.value?.element===o;G.value=t?null:{element:o,offsets:c},a=null;let n=e.shadowRoot?.activeElement;n instanceof HTMLElement&&n.blur()}return}let l=o.parentElement,u=i.altKey&&bn.value&&l&&l!==document.documentElement;s(o,c,u?{element:l,parent:!0}:void 0)},p=e=>{if(t(e))return;if(e.key===`Escape`){if(U.value===`picking`)Pn();else if(K.value)K.value=null;else if(G.value)G.value=null;else if(q.value)q.value=null;else if(J.value)J.value=!1;else return;e.preventDefault();return}if(uf(e))return;let n=!e.metaKey&&!e.ctrlKey&&!e.altKey;if(e.key.toLowerCase()===`r`&&n&&vn.value){e.preventDefault(),Sn();return}if(e.key.toLowerCase()===`c`&&n){e.preventDefault(),fn.value=!1;let t=G.value;if(U.value===`picking`)Pn();else if(t?.element.isConnected&&!K.value){let e=a?.isConnected?a:null;s(t.element,t.offsets,e?{element:e,parent:!1}:void 0)}else Nn()}},m=0,h=()=>{m||=requestAnimationFrame(()=>{m=0,Tn.value++})},g=new MutationObserver(t=>{t.every(t=>e.contains(t.target)||t.target===e)||h()});g.observe(document.body,{childList:!0,subtree:!0,attributes:!0});let _=setInterval(()=>{let e=Dn(location.href);e!==En.value&&(En.value=e,K.value=null,G.value=null,q.value=null)},400);window.addEventListener(`pointermove`,c,{capture:!0,passive:!0});for(let e of cf)window.addEventListener(e,d,!0);return window.addEventListener(`click`,f,!0),window.addEventListener(`keydown`,p,!0),window.addEventListener(`keydown`,l,!0),window.addEventListener(`keyup`,l,!0),window.addEventListener(`blur`,u),window.addEventListener(`scroll`,h,{capture:!0,passive:!0}),window.addEventListener(`resize`,h,{passive:!0}),()=>{window.removeEventListener(`pointermove`,c,!0);for(let e of cf)window.removeEventListener(e,d,!0);window.removeEventListener(`click`,f,!0),window.removeEventListener(`keydown`,p,!0),window.removeEventListener(`keydown`,l,!0),window.removeEventListener(`keyup`,l,!0),window.removeEventListener(`blur`,u),window.removeEventListener(`scroll`,h,!0),window.removeEventListener(`resize`,h),g.disconnect(),clearInterval(_),cancelAnimationFrame(m)}}function uf(e){let t=e.composedPath()[0];return t instanceof HTMLElement?t.isContentEditable||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement:!1}function df(){let e=document.currentScript;return e?.dataset.bridge?e.dataset.bridge:e?.src?new URL(e.src).origin:`http://localhost:4747`}function ff(){let e=document.currentScript?.dataset;if(e?.tencilProject&&e.tencilRepo&&e.tencilBranch&&e.tencilSha)return{projectKey:e.tencilProject,repo:e.tencilRepo,branch:e.tencilBranch,sha:e.tencilSha}}function pf(){try{CSS.registerProperty({name:`--tencil-rim`,syntax:`<angle>`,inherits:!1,initialValue:`0deg`})}catch{}}function mf(e,t){pf();let n=document.createElement(`tencil-overlay`);n.setAttribute(`data-tencil`,``),n.style.cssText=`position:fixed;inset:0;pointer-events:none;z-index:2147483646;display:block;contain:layout style;`;let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`);i.textContent=`
|
|
73
|
+
`)})},a++));continue}if(/^\s*([-*]|\d+\.)\s+/.test(e)){let o=/^\s*\d+\./.test(e),s=[];for(;i<r.length&&/^\s*([-*]|\d+\.)\s+/.test(r[i]);)s.push(r[i++].replace(/^\s*([-*]|\d+\.)\s+/,``));let c=s.map((e,n)=>/* @__PURE__ */ Q(`li`,{children:hd(e,t)},n));n.push(Q(o?`ol`:`ul`,{children:c},a++));continue}let o=e.match(/^#{1,6}\s+(.*)/);if(o){n.push(/* @__PURE__ */ Q(`p`,{class:`md-heading`,children:hd(o[1],t)},a++)),i++;continue}if(!e.trim()){i++;continue}let s=[];for(;i<r.length&&r[i].trim()&&!/^\s*(```|[-*]\s|\d+\.\s|#{1,6}\s)/.test(r[i]);)s.push(r[i++]);n.push(/* @__PURE__ */ Q(`p`,{children:hd(s.join(` `),t)},a++))}return n}let md=/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)\s]+\))/g;function hd(e,t){return e.split(md).map((e,n)=>{if(e.startsWith("`")&&e.endsWith("`")&&e.length>1)return t.index+=_d(e),/* @__PURE__ */ Q(`code`,{children:e.slice(1,-1)},n);if(e.startsWith(`**`)&&e.endsWith(`**`)&&e.length>3)return/* @__PURE__ */ Q(`strong`,{children:gd(e.slice(2,-2),t)},n);let r=e.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);return r&&/^https?:\/\//.test(r[2])?/* @__PURE__ */ Q(`a`,{href:r[2],target:`_blank`,rel:`noreferrer`,children:gd(r[1],t)},n):gd(e,t)})}function gd(e,t){return t.animateFrom===1/0?(t.index+=_d(e),e):e.split(/(\s+)/).map(e=>{if(!e||/^\s+$/.test(e))return e;let n=t.index++;return n>=t.animateFrom?/* @__PURE__ */ Q(`span`,{class:`w`,children:e},`w${n}`):e})}function _d(e){let t=e.match(/\S+/g);return t?t.length:0}function vd(){On.value;let e=q.value,t=e?B.value.get(e):void 0,n=j(null),[r,i]=A(320);if(Ne(()=>{n.current&&i(n.current.offsetHeight)}),!t)return null;let a=Dn.value,o=a?.threadId===t.id?a.point:t.anchor?Rs(t.anchor):null,{left:s,top:c,origin:l}=o?Vs(o,{width:380,height:r}):{left:window.innerWidth-380-(J.value?372:16),top:16,origin:`top right`};return/* @__PURE__ */ Q(`div`,{ref:n,class:`popover thread${o?``:` thread-docked`}`,style:{left:`${s}px`,top:`${c}px`,width:`380px`,transformOrigin:l},children:[/* @__PURE__ */ Q(bd,{thread:t}),t.status===`draft`?/* @__PURE__ */ Q(yd,{thread:t}):/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(xd,{thread:t},t.id),/* @__PURE__ */ Q(wd,{thread:t},t.id),/* @__PURE__ */ Q(Vu,{placeholder:Tt.value??(t.provider.threadId?`Reply…`:`Waiting for the agent…`),disabled:!t.provider.threadId||Tt.value!==null,onSubmit:e=>{H({type:`thread.reply`,threadId:t.id,text:e})},onCancel:()=>{q.value=null}})]})]})}function yd({thread:e}){let t=e.messages[0]?.text??``,n=Pn.value.length;return/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`div`,{class:`status-line status-queued`,children:[e.statusDetail?/* @__PURE__ */ Q(`span`,{class:`status-error`,children:[`Couldn't send: `,e.statusDetail]}):`Queued with ${n===1?`no other comments`:`${n-1} other ${n===2?`comment`:`comments`}`}`,/* @__PURE__ */ Q(`button`,{type:`button`,class:`stop`,onClick:_u,children:[`Send `,n===1?`it`:`all ${n}`,` now`]})]}),/* @__PURE__ */ Q(Vu,{initialText:t,placeholder:`What should change here?`,onSubmit:n=>{n!==t&&H({type:`thread.edit`,threadId:e.id,prompt:n}),q.value=null},onCancel:()=>{q.value=null}},`${e.id}:${t}`)]})}function bd({thread:e}){let t=e.context,n=t?.components[0],r=n?.source;return/* @__PURE__ */ Q(`div`,{class:`thread-header`,children:[/* @__PURE__ */ Q(`div`,{class:`thread-heading`,children:t?/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`span`,{class:`thread-number`,children:[`#`,gu.value.get(e.id)]}),/* @__PURE__ */ Q(`span`,{class:`chip`,title:t.selector,children:[/* @__PURE__ */ Q(lu,{}),n?.name??`<${t.tagName}>`]}),r&&/* @__PURE__ */ Q(`span`,{class:`thread-source`,title:r.file,children:[r.file.split(`/`).pop(),r.line?`:${r.line}`:``]})]}):/* @__PURE__ */ Q(`span`,{class:`thread-title`,title:e.title,children:e.title})}),/* @__PURE__ */ Q(`div`,{class:`thread-tools`,children:[e.provider.url&&/* @__PURE__ */ Q(`a`,{class:`icon-button`,href:e.provider.url,target:`_blank`,rel:`noreferrer`,title:`Open in ${cn(e.provider.id)}`,children:/* @__PURE__ */ Q(ou,{})}),e.status!==`draft`&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:e.resolved?`Reopen`:`Resolve`,onClick:()=>{H({type:`thread.resolve`,threadId:e.id,resolved:!e.resolved}),e.resolved||(q.value=null)},children:e.resolved?/* @__PURE__ */ Q(iu,{}):/* @__PURE__ */ Q(ru,{})}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:`Delete pin (keeps the agent thread)`,onClick:()=>{H({type:`thread.delete`,threadId:e.id}),q.value=null},children:/* @__PURE__ */ Q(au,{})}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:`Close (Esc)`,onClick:()=>{q.value=null},children:/* @__PURE__ */ Q(su,{})})]})]})}function xd({thread:e}){let t=j(null),n=j(null),r=j(!0),[i,a]=A(!1),o=e.messages[e.messages.length-1];return Ne(()=>{o?.role===`user`&&(r.current=!0)},[o?.id]),Ne(()=>{let e=t.current,i=n.current;if(!e||!i)return;let a=()=>{r.current&&(e.scrollTop=e.scrollHeight)};a();let o=new ResizeObserver(a);return o.observe(e),o.observe(i),()=>o.disconnect()},[]),/* @__PURE__ */ Q(`div`,{ref:t,class:`messages`,"data-scrolled":i||void 0,onScroll:e=>{let t=e.currentTarget;r.current=t.scrollHeight-t.scrollTop-t.clientHeight<24,a(t.scrollTop>4)},children:/* @__PURE__ */ Q(`div`,{ref:n,class:`messages-list`,children:e.messages.map(e=>e.role===`user`?/* @__PURE__ */ Q(`div`,{class:`message message-user`,children:e.text},e.id):/* @__PURE__ */ Q(Sd,{message:e},e.id))})})}function Sd({message:e}){let[t]=A(e.streaming);return/* @__PURE__ */ Q(`div`,{class:`message message-assistant`,children:/* @__PURE__ */ Q(fd,{text:e.text,animate:t})})}function Cd({text:e}){let t=[...e];return/* @__PURE__ */ Q(`span`,{class:`shimmer`,children:[/* @__PURE__ */ Q(`span`,{class:`sr-only`,children:e}),t.map((e,n)=>/* @__PURE__ */ Q(`span`,{"aria-hidden":`true`,style:{"--i":n,"--n":t.length},children:e},n))]})}function wd({thread:e}){let[t,n]=A(!1),r=e.steps??[],i=r.length>0?{open:t,onToggle:()=>n(!t)}:void 0,a=e.status===`working`;return/* @__PURE__ */ Q(S,{children:[t&&r.length>0&&/* @__PURE__ */ Q(Ed,{steps:r,follow:a}),/* @__PURE__ */ Q(jd,{thread:e,steps:i}),i&&!a&&/* @__PURE__ */ Q(`div`,{class:`status-line`,children:/* @__PURE__ */ Q(Td,{...i,children:[r.filter(e=>!e.parentId).length,` steps`,kd(r)?` · ${kd(r)}`:``]})}),e.delivery&&!a&&/* @__PURE__ */ Q(Md,{delivery:e.delivery})]})}function Td({open:e,onToggle:t,children:n}){return/* @__PURE__ */ Q(`button`,{type:`button`,class:`steps-toggle${e?` open`:``}`,"aria-expanded":e,title:e?`Hide steps`:`Show steps`,onClick:t,children:[n,/* @__PURE__ */ Q(hu,{})]})}function Ed({steps:e,follow:t}){let n=j(null),r=j(!0);return Ne(()=>{let e=n.current;e&&t&&r.current&&(e.scrollTop=e.scrollHeight)}),/* @__PURE__ */ Q(`ol`,{ref:n,class:`steps`,onScroll:e=>{let t=e.currentTarget;r.current=t.scrollHeight-t.scrollTop-t.clientHeight<16},children:e.map(e=>/* @__PURE__ */ Q(`li`,{class:`step step-${e.status}${e.parentId?` step-child`:``}`,title:e.detail?`${e.label}\n${e.detail}`:e.label,children:[/* @__PURE__ */ Q(`span`,{class:`step-mark`,children:e.status===`running`?/* @__PURE__ */ Q(`span`,{class:`live-dot`}):e.status===`done`?/* @__PURE__ */ Q(ru,{}):e.status===`failed`?/* @__PURE__ */ Q(su,{}):`–`}),/* @__PURE__ */ Q(`span`,{class:`step-label`,children:[e.label,e.detail&&/* @__PURE__ */ Q(`span`,{class:`step-detail`,children:e.detail})]}),e.endedAt&&/* @__PURE__ */ Q(`span`,{class:`step-time`,children:Od(e)})]},e.id))})}function Dd(e){return e.findLast(e=>e.status===`running`)}function Od(e){return e.endedAt?Ad((Date.parse(e.endedAt)-Date.parse(e.startedAt))/1e3):``}function kd(e){let t=e[0],n=e.map(e=>e.endedAt).filter(e=>!!e);if(!t||n.length===0)return``;let r=n.reduce((e,t)=>e>t?e:t);return Ad((Date.parse(r)-Date.parse(t.startedAt))/1e3)}function Ad(e){return!Number.isFinite(e)||e<1?``:e<60?`${Math.round(e)}s`:`${Math.floor(e/60)}m ${String(Math.round(e%60)).padStart(2,`0`)}s`}function jd({thread:e,steps:t}){return e.status===`starting`?/* @__PURE__ */ Q(`div`,{class:`status-line`,children:[/* @__PURE__ */ Q(`span`,{class:`live-dot`}),/* @__PURE__ */ Q(Cd,{text:`Starting a thread in ${cn(e.provider.id)}…`})]}):e.status===`working`?/* @__PURE__ */ Q(`div`,{class:`status-line`,children:[/* @__PURE__ */ Q(`span`,{class:`live-dot`}),t?/* @__PURE__ */ Q(Td,{...t,children:/* @__PURE__ */ Q(Cd,{text:`${Dd(e.steps??[])?.label??`Working`}…`})}):/* @__PURE__ */ Q(Cd,{text:`Working…`}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`stop`,onClick:()=>H({type:`thread.interrupt`,threadId:e.id}),children:[/* @__PURE__ */ Q(nu,{}),` Stop`]})]}):e.status===`waiting`?/* @__PURE__ */ Q(`div`,{class:`status-line status-waiting`,children:[e.statusDetail??`Waiting for input`,e.provider.url&&/* @__PURE__ */ Q(`a`,{href:e.provider.url,target:`_blank`,rel:`noreferrer`,children:`Open`})]}):e.status===`error`?/* @__PURE__ */ Q(`div`,{class:`status-line status-error`,children:e.statusDetail??`Something went wrong`}):null}function Md({delivery:e}){let t=e.pullRequest,n=t&&/* @__PURE__ */ Q(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,children:t.opened?`Opened #${t.number}`:`#${t.number}`}),r=e.commit&&/* @__PURE__ */ Q(`a`,{class:`delivery-commit`,href:e.commit.url,target:`_blank`,rel:`noreferrer`,children:e.commit.sha.slice(0,7)});switch(e.status){case`queued`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery`,children:[/* @__PURE__ */ Q(`span`,{class:`live-dot`}),/* @__PURE__ */ Q(Cd,{text:e.queuePosition?`Waiting, ${e.queuePosition} ahead on this branch`:`Waiting for the branch…`})]});case`pushed`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery`,children:[/* @__PURE__ */ Q(`span`,{children:[`Pushed `,r]}),n]});case`deploying`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery`,children:[/* @__PURE__ */ Q(`span`,{class:`live-dot`}),/* @__PURE__ */ Q(Cd,{text:`Deploying the preview…`}),n]});case`live`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery delivery-live`,children:[/* @__PURE__ */ Q(`span`,{children:[`Live `,r]}),e.previewUrl?/* @__PURE__ */ Q(`a`,{href:e.previewUrl,children:`Open the new preview`}):n]});case`deploy-failed`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery status-error`,children:[/* @__PURE__ */ Q(`span`,{children:[`Preview deploy failed `,r]}),e.logsUrl?/* @__PURE__ */ Q(`a`,{href:e.logsUrl,target:`_blank`,rel:`noreferrer`,children:`Logs`}):n]});case`no-changes`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery`,children:`No changes needed, nothing pushed`});case`failed`:return/* @__PURE__ */ Q(`div`,{class:`status-line delivery status-error`,children:[/* @__PURE__ */ Q(`span`,{class:`delivery-detail`,title:e.detail,children:[`Couldn't push`,e.detail?`: ${e.detail}`:``]}),n]})}}let Nd=`tencil:dock`,Pd=[`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`],Fd,Id=P(Ld());function Ld(){try{let e=localStorage.getItem(Nd);return e&&Pd.includes(e)?e:`bottom-center`}catch{return`bottom-center`}}function Rd(e){Id.value=e;try{localStorage.setItem(Nd,e)}catch{}}function zd(e,t,n,r){let i=e<n/3?`left`:e>n*2/3?`right`:`center`;return`${t<r/2?`top`:`bottom`}-${i}`}function Bd(e,t){if(e.button!==0)return;e.preventDefault();let n=e.currentTarget;try{n.setPointerCapture(e.pointerId)}catch{}let[r,i]=Wd(t);Fd?.(),t.style.transition=`none`,t.style.translate=`${r}px ${i}px`;let a=e.clientX,o=e.clientY,s=r!==0||i!==0,c=[],l=e=>{let n=e.clientX-a,l=e.clientY-o;!s&&Math.hypot(n,l)<3||(s=!0,t.dataset.dragging=``,t.style.translate=`${r+n}px ${i+l}px`,c=[...c.filter(t=>e.timeStamp-t.t<80),{x:e.clientX,y:e.clientY,t:e.timeStamp}])},u=e=>{if(n.removeEventListener(`pointermove`,l),n.removeEventListener(`pointerup`,u),n.removeEventListener(`pointercancel`,u),n.removeEventListener(`lostpointercapture`,u),window.removeEventListener(`dragstart`,Vd,!0),delete t.dataset.dragging,!s){t.style.translate=``,t.style.transition=``;return}c=c.filter(t=>e.timeStamp-t.t<80);let r=c[0],i=c[c.length-1],a=r&&i?Math.max(1,i.t-r.t):1,o=e=>Math.max(-2.5,Math.min(2.5,e/a)),d=r&&i?o(i.x-r.x):0,f=r&&i?o(i.y-r.y):0,p=Gd(t);Ud(t,p,zd(p.left+p.width/2+d*120,p.top+p.height/2+f*120,window.innerWidth,window.innerHeight))};n.addEventListener(`pointermove`,l),n.addEventListener(`pointerup`,u),n.addEventListener(`pointercancel`,u),n.addEventListener(`lostpointercapture`,u),window.addEventListener(`dragstart`,Vd,!0)}function Vd(e){e.preventDefault()}function Hd(e,t){let[n,r]=Id.value.split(`-`),i=[`left`,`center`,`right`],a=i.indexOf(r),o;return e===`ArrowLeft`&&a>0&&(o=`${n}-${i[a-1]}`),e===`ArrowRight`&&a<2&&(o=`${n}-${i[a+1]}`),e===`ArrowUp`&&n===`bottom`&&(o=`top-${r}`),e===`ArrowDown`&&n===`top`&&(o=`bottom-${r}`),o?(Rd(o),t.style.translate=``,!0):!1}function Ud(e,t,n){Rd(n);let r=0,i,a=()=>{cancelAnimationFrame(r),clearTimeout(i),e.removeEventListener(`transitionend`,o),Fd=void 0,e.style.transition=``,e.style.translate=``},o=t=>{t.target===e&&t.propertyName===`translate`&&a()};Fd=()=>{cancelAnimationFrame(r),clearTimeout(i),e.removeEventListener(`transitionend`,o),Fd=void 0},r=requestAnimationFrame(()=>{e.style.translate=``;let n=Gd(e);if(e.style.translate=`${t.left-n.left}px ${t.top-n.top}px`,matchMedia(`(prefers-reduced-motion: reduce)`).matches){a();return}r=requestAnimationFrame(()=>{e.style.transition=`translate 340ms cubic-bezier(0.32, 0.72, 0, 1)`,e.style.translate=`0px 0px`,e.addEventListener(`transitionend`,o),i=setTimeout(a,440)})})}function Wd(e){let t=getComputedStyle(e).translate;if(!t||t===`none`)return[0,0];let[n=`0`,r=`0`]=t.split(` `);return[Number.parseFloat(n)||0,Number.parseFloat(r)||0]}function Gd(e){return(e.querySelector(`.toolbar`)??e).getBoundingClientRect()}let Kd=P(null);function qd(){let e=()=>{let e=Yd(),t=Kd.value;Xd(e,t)||(Kd.value=e)};e();let t=setInterval(e,500);return window.addEventListener(`resize`,e,{passive:!0}),()=>{clearInterval(t),window.removeEventListener(`resize`,e)}}function Jd(e,t){return!t||e.endsWith(`center`)||zd((t.left+t.right)/2,(t.top+t.bottom)/2,window.innerWidth,window.innerHeight)!==e?{}:e.endsWith(`left`)?{left:`${t.right+8}px`}:{right:`${window.innerWidth-t.left+8}px`}}function Yd(){for(let e of document.querySelectorAll(`nextjs-portal`)){let t=e.shadowRoot?.getElementById(`devtools-indicator`);if(!t)continue;let n=t.getBoundingClientRect();if(n.width!==0&&n.height!==0)return{left:n.left,top:n.top,right:n.right,bottom:n.bottom}}return null}function Xd(e,t){return!e||!t?e===t:Math.round(e.left)===Math.round(t.left)&&Math.round(e.top)===Math.round(t.top)&&Math.round(e.right)===Math.round(t.right)&&Math.round(e.bottom)===Math.round(t.bottom)}let Zd=`npx tencil@latest setup`,Qd=F(()=>!$t()&&!!Bt.value?.latest&&Bt.value.state===`idle`),$d=P(!1);function ef(){let e=zt.value;if($t()||!e)return null;let t=Bt.value,n=t?.state===`installing`||t?.state===`waiting`||t?.state===`restarting`,r=Vt.value;return/* @__PURE__ */ Q(`section`,{class:`settings-section settings-about`,"aria-label":`About Tencil`,children:[/* @__PURE__ */ Q(`div`,{class:`settings-about-row`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-label`,children:`Tencil`}),/* @__PURE__ */ Q(`span`,{class:`settings-version`,children:[`v`,e]})]}),r&&r!==e&&!t?.latest&&/* @__PURE__ */ Q(`p`,{class:`settings-help`,children:[`Updated from v`,r,`.`]}),t?.latest&&/* @__PURE__ */ Q(`div`,{class:`settings-update`,children:[/* @__PURE__ */ Q(`p`,{class:`settings-help`,children:[/* @__PURE__ */ Q(`strong`,{children:[`Tencil `,t.latest,` is available.`]}),` `,/* @__PURE__ */ Q(`a`,{href:`https://github.com/tencildev/tencil/blob/master/packages/tencil/CHANGELOG.md`,target:`_blank`,rel:`noreferrer`,children:`What's new`})]}),n&&/* @__PURE__ */ Q(`p`,{class:`settings-help settings-progress`,children:tf(t)}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`hint-action settings-update-button`,disabled:n,onClick:()=>H({type:`update.start`}),children:n?`Updating…`:t.state===`failed`?`Try again`:`Update`})]}),t?.state===`failed`&&/* @__PURE__ */ Q(`div`,{class:`settings-update-error`,role:`alert`,children:[/* @__PURE__ */ Q(`p`,{class:`settings-help`,children:[`Couldn't update`,t.error?`: ${t.error}`:`.`,` Tencil `,e,` `,`is still running. Update from a terminal instead:`]}),/* @__PURE__ */ Q(`div`,{class:`settings-command`,children:[/* @__PURE__ */ Q(`code`,{children:Zd}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`settings-copy`,onClick:()=>{navigator.clipboard?.writeText(Zd).then(()=>{$d.value=!0,setTimeout(()=>{$d.value=!1},1500)})},children:$d.value?`Copied`:`Copy`})]})]})]})}function tf(e){switch(e.state){case`installing`:return`Installing Tencil ${e.latest}…`;case`waiting`:{let t=e.running??1;return`Waiting for ${t} running ${t===1?`thread`:`threads`} to finish…`}default:return`Restarting on Tencil ${e.latest}…`}}function nf(){let[e,t]=A(``),n=Gt.value??[],r=e.trim().toLowerCase(),i=r?n.filter(e=>e.title.toLowerCase().includes(r)||e.root.toLowerCase().includes(r)):n,a=e=>H({type:`project.select`,root:e});return/* @__PURE__ */ Q(`div`,{class:`project-picker`,children:[/* @__PURE__ */ Q(`p`,{class:`project-picker-title`,children:`Which project is this page?`}),n.length===0?/* @__PURE__ */ Q(`p`,{class:`project-picker-empty`,children:Kt.value??`No projects found.`}):/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`input`,{class:`project-picker-search`,type:`search`,placeholder:`Search projects`,"aria-label":`Search projects`,autoFocus:!0,value:e,onInput:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i[0]&&a(i[0].root)}}),/* @__PURE__ */ Q(`div`,{class:`project-picker-list`,children:[i.length===0&&/* @__PURE__ */ Q(`p`,{class:`project-picker-empty`,children:[`No project matches “`,e.trim(),`”.`]}),i.map(e=>/* @__PURE__ */ Q(`button`,{type:`button`,class:`project-picker-option`,title:e.root,onClick:()=>a(e.root),children:[/* @__PURE__ */ Q(`span`,{class:`project-picker-name`,children:e.title}),/* @__PURE__ */ Q(`span`,{class:`project-picker-root`,children:e.root})]},e.root))]})]})]})}function rf(){if(!pn.value)return null;let e=z.value,t=R.value,n=()=>{pn.value=!1};return/* @__PURE__ */ Q(`section`,{class:`settings-panel`,role:`dialog`,"aria-label":`Project settings`,onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),n())},children:[/* @__PURE__ */ Q(`header`,{class:`settings-header`,children:[/* @__PURE__ */ Q(`div`,{class:`settings-heading`,children:[/* @__PURE__ */ Q(`strong`,{children:`Settings`}),Rt.value&&/* @__PURE__ */ Q(`span`,{class:`settings-project`,children:Rt.value.name})]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`icon-button`,title:`Close (Esc)`,onClick:n,children:/* @__PURE__ */ Q(su,{})})]}),e?/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`div`,{class:`settings-section`,children:[/* @__PURE__ */ Q(`p`,{class:`settings-label`,id:`tencil-provider-label`,children:`Agent for new pins`}),/* @__PURE__ */ Q(`fieldset`,{class:`settings-options`,"aria-labelledby":`tencil-provider-label`,children:e.providers.map(n=>{let r=n.id===e.provider;return/* @__PURE__ */ Q(`label`,{class:`target-option${r?` selected`:``}`,children:[/* @__PURE__ */ Q(`input`,{type:`radio`,name:`tencil-provider`,class:`settings-radio`,checked:r,onChange:()=>H({type:`settings.update`,provider:n.id})}),/* @__PURE__ */ Q(Xl,{agent:n.id,size:14,decorative:!0}),/* @__PURE__ */ Q(`span`,{class:`target-option-title`,children:n.label}),r&&t?.id===n.id&&/* @__PURE__ */ Q(`span`,{class:`target-option-meta`,children:af(t)})]},n.id)})}),t&&t.id===e.provider&&t.state!==`ready`&&t.detail&&/* @__PURE__ */ Q(`p`,{class:`settings-status`,children:t.detail}),/* @__PURE__ */ Q(`p`,{class:`settings-help`,children:`Pins you already made keep their agent.`})]}),/* @__PURE__ */ Q(`label`,{class:`settings-section settings-switch-row`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-switch-text`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-label`,children:`Batch mode`}),/* @__PURE__ */ Q(`span`,{class:`settings-help`,children:[`Adds `,/* @__PURE__ */ Q(fu,{}),` to the comment box to queue comments and send them together.`]})]}),/* @__PURE__ */ Q(`input`,{type:`checkbox`,role:`switch`,class:`settings-switch`,checked:e.batch,"aria-checked":e.batch,onChange:e=>yn(e.currentTarget.checked)})]}),/* @__PURE__ */ Q(`label`,{class:`settings-section settings-switch-row`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-switch-text`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-label`,children:`Ruler`}),/* @__PURE__ */ Q(`span`,{class:`settings-help`,children:[`Adds `,/* @__PURE__ */ Q(pu,{}),` to the toolbar. With it on, hold `,Jo,` to measure spacing on the page.`]})]}),/* @__PURE__ */ Q(`input`,{type:`checkbox`,role:`switch`,class:`settings-switch`,checked:e.ruler,"aria-checked":e.ruler,onChange:e=>wn(e.currentTarget.checked)})]})]}):/* @__PURE__ */ Q(`p`,{class:`empty`,children:`Connecting…`}),/* @__PURE__ */ Q(ef,{}),I.value&&/* @__PURE__ */ Q(`div`,{class:`settings-section settings-account`,children:[/* @__PURE__ */ Q(`span`,{class:`settings-help`,children:[`Signed in to Tencil Cloud as`,` `,/* @__PURE__ */ Q(`strong`,{children:I.value.login?`@${I.value.login}`:I.value.name})]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`hint-action`,onClick:()=>{jt(en()),tn()},children:`Sign out`})]})]})}function af(e){switch(e.state){case`ready`:return`Ready`;case`unauthorized`:return e.canPair?`Not paired`:`Not signed in`;case`unavailable`:return`Unavailable`;default:return`Connecting…`}}function of({tone:e,label:t}){let[n,r]=A(!1),i=j(void 0);Me(()=>()=>clearTimeout(i.current),[]);let a=e=>{clearTimeout(i.current),i.current=setTimeout(()=>r(!0),e)},o=()=>{clearTimeout(i.current),r(!1)};return/* @__PURE__ */ Q(`span`,{class:`status`,onPointerEnter:()=>a(250),onPointerLeave:o,children:[/* @__PURE__ */ Q(`button`,{type:`button`,class:`status-button`,"aria-label":`Tencil status: ${t}`,"aria-expanded":n,"aria-describedby":n?`tencil-status-card`:void 0,onFocus:()=>a(0),onBlur:o,onClick:()=>n?o():a(0),children:/* @__PURE__ */ Q(`span`,{class:`status-dot status-${e}`,children:Fn.value>0&&/* @__PURE__ */ Q(`span`,{class:`status-ping`})})}),n&&/* @__PURE__ */ Q(sf,{tone:e})]})}function sf({tone:e}){let t=R.value,n=L.value,r=Pn.value.length,i=Fn.value;return/* @__PURE__ */ Q(`div`,{class:`status-card`,role:`tooltip`,id:`tencil-status-card`,children:[/* @__PURE__ */ Q(`div`,{class:`status-card-head`,children:[/* @__PURE__ */ Q(du,{size:18}),/* @__PURE__ */ Q(`strong`,{children:`Tencil`}),zt.value&&/* @__PURE__ */ Q(`span`,{class:`status-card-muted`,children:[`v`,zt.value]})]}),/* @__PURE__ */ Q(`dl`,{class:`status-card-rows`,children:[/* @__PURE__ */ Q(cf,{label:$t()?`Tencil Cloud`:`Daemon`,children:[/* @__PURE__ */ Q(`span`,{class:`status-card-tone tone-${n===`open`?`ok`:e}`}),n===`open`?`Connected`:n===`connecting`?`Connecting…`:`Offline`]}),/* @__PURE__ */ Q(cf,{label:`Address`,children:rn()}),/* @__PURE__ */ Q(cf,{label:`Project`,children:Gt.value?`Not picked yet`:Rt.value?/* @__PURE__ */ Q(`span`,{title:Rt.value.root,children:Rt.value.name}):`…`}),/* @__PURE__ */ Q(cf,{label:`Agent`,children:t?/* @__PURE__ */ Q(S,{children:[/* @__PURE__ */ Q(`span`,{class:`status-card-tone tone-${t.state===`ready`?`ok`:e}`}),t.label,/* @__PURE__ */ Q(`span`,{class:`status-card-muted`,children:af(t)})]}):`…`}),t?.target&&/* @__PURE__ */ Q(cf,{label:`Workspace`,children:t.target}),I.value&&/* @__PURE__ */ Q(cf,{label:`Signed in`,children:[I.value.login?`@${I.value.login}`:I.value.name,I.value.access===`read`&&/* @__PURE__ */ Q(`span`,{class:`status-card-muted`,children:`view only`})]}),(i>0||r>0)&&/* @__PURE__ */ Q(cf,{label:`Pins`,children:[i>0&&`${i} working`,r>0&&`${r} queued`].filter(Boolean).join(` · `)})]}),t&&t.state!==`ready`&&t.detail&&/* @__PURE__ */ Q(`p`,{class:`status-card-detail`,children:t.detail})]})}function cf({label:e,children:t}){return/* @__PURE__ */ Q(`div`,{class:`status-card-row`,children:[/* @__PURE__ */ Q(`dt`,{children:e}),/* @__PURE__ */ Q(`dd`,{children:t})]})}function lf(){let e=df(),t=U.value===`picking`,n=j(null);return/* @__PURE__ */ Q(`div`,{ref:n,class:`toolbar-wrap dock-${Id.value}`,style:Jd(Id.value,Kd.value),children:[t&&/* @__PURE__ */ Q(`div`,{class:`toolbar-hint`,children:[`Click any element to pin a prompt`,Cn.value&&` · ${Jo} to measure`,` · Esc to cancel`]}),!t&&/* @__PURE__ */ Q(rf,{}),!t&&Gt.value&&/* @__PURE__ */ Q(nf,{}),!t&&!Gt.value&&e.hint&&/* @__PURE__ */ Q(`div`,{class:`toolbar-hint hint-${e.tone}`,children:[e.hint,e.action&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`hint-action`,onClick:e.action.run,children:e.action.label})]}),!t&&!e.hint&&G.value&&!K.value&&/* @__PURE__ */ Q(`div`,{class:`toolbar-hint`,children:[`Hold `,Jo,` and hover to measure · C to comment · Esc to clear`]}),/* @__PURE__ */ Q(`div`,{class:`toolbar`,children:[/* @__PURE__ */ Q(of,{tone:e.tone,label:e.title}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`divider`,"aria-label":`Move toolbar (drag, or use arrow keys)`,title:`Drag to move`,onPointerDown:e=>n.current&&Bd(e,n.current),onKeyDown:e=>{n.current&&Hd(e.key,n.current)&&e.preventDefault()}}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool${t?` tool-active`:``}`,title:Tt.value??`Comment (C)`,disabled:Tt.value!==null,onClick:()=>t?Ln():In(),children:[/* @__PURE__ */ Q(Zl,{}),/* @__PURE__ */ Q(`span`,{class:`tool-label`,children:`Comment`}),/* @__PURE__ */ Q(`kbd`,{children:`C`})]}),xn.value&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool${Sn.value?``:` tool-off`}`,title:Sn.value?`Ruler on (R): hold ${Jo} to measure`:`Ruler off (R)`,"aria-label":`Ruler`,"aria-pressed":Sn.value,onClick:Tn,children:Sn.value?/* @__PURE__ */ Q(pu,{}):/* @__PURE__ */ Q(mu,{})}),Pn.value.length>0&&/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool tool-send`,title:`Send the queued comments to the agent as one thread`,disabled:R.value?.state!==`ready`,onClick:_u,children:[/* @__PURE__ */ Q(tu,{}),/* @__PURE__ */ Q(`span`,{class:`tool-label`,children:[`Send `,Pn.value.length]})]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool${J.value?` tool-active`:``}`,title:`Pins`,onClick:()=>{J.value=!J.value,pn.value=!1},children:[/* @__PURE__ */ Q(Ql,{}),Nn.value>0&&/* @__PURE__ */ Q(`span`,{class:`badge`,children:Nn.value})]}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool`,title:hn.value?`Show pins`:`Hide pins`,onClick:()=>{hn.value=!hn.value,hn.value&&Ln()},children:hn.value?/* @__PURE__ */ Q($l,{}):/* @__PURE__ */ Q(eu,{})}),/* @__PURE__ */ Q(`button`,{type:`button`,class:`tool${pn.value?` tool-active`:``}`,title:`Project settings`,"aria-label":Qd.value?`Project settings (update available)`:void 0,disabled:!Rt.value,onClick:()=>{pn.value=!pn.value,J.value=!1},children:[/* @__PURE__ */ Q(uu,{}),Qd.value&&/* @__PURE__ */ Q(`span`,{class:`tool-dot`})]})]})]})}let uf={label:`Switch agent`,run:()=>{pn.value=!0,J.value=!1}};function df(){if(L.value!==`open`)return $t()?{tone:`error`,title:`Tencil Cloud unreachable`,hint:L.value===`connecting`?void 0:`Can't reach Tencil Cloud. Retrying…`}:{tone:`error`,title:`Tencil daemon offline`,hint:L.value===`connecting`?void 0:`The Tencil daemon stopped. Start it again with npx tencil start.`};let e=Ct.value;if(e)return{tone:`warn`,title:`Sign in to Tencil Cloud`,hint:e.reason??`Sign in with GitHub to pin on this preview`,action:wt.value?void 0:{label:`Sign in`,run:()=>ff(e.signIn)}};if(Gt.value)return{tone:`warn`,title:`Pick this page's project`};let t=R.value;if(!t)return{tone:`warn`,title:`Connecting…`};switch(t.state){case`ready`:return{tone:`ok`,title:`${t.label}${t.target?` · ${t.target}`:``}`};case`unauthorized`:return t.canPair?{tone:`warn`,title:`${t.label}: not paired`,hint:`Not paired with ${t.label}`,action:{label:`Pair`,run:()=>H({type:`provider.pair`})}}:{tone:`warn`,title:`${t.label}: not signed in`,hint:t.detail??`Sign in to ${t.label}`,action:uf};case`unavailable`:return{tone:`error`,title:t.detail??`${t.label} unavailable`,hint:t.detail??`${t.label} is unavailable`,action:uf};default:return{tone:`warn`,title:`Connecting to ${t.label}…`}}}function ff(e){Mt(en(),e).then(tn,e=>{qt.value={message:e instanceof Error?e.message:String(e),at:Date.now()}})}function pf(){return hf(),/* @__PURE__ */ Q(`div`,{class:`root${U.value===`picking`?` picking`:``}`,children:[/* @__PURE__ */ Q(Zu,{}),/* @__PURE__ */ Q(od,{}),/* @__PURE__ */ Q(vu,{}),/* @__PURE__ */ Q(Uu,{}),/* @__PURE__ */ Q(vd,{}),/* @__PURE__ */ Q(ju,{}),/* @__PURE__ */ Q(mf,{}),/* @__PURE__ */ Q(lf,{})]})}function mf(){let e=qt.value,[t,n]=A(!1);return Me(()=>{if(!e)return;n(!0);let t=setTimeout(()=>n(!1),5e3);return()=>clearTimeout(t)},[e?.at]),!e||!t?null:/* @__PURE__ */ Q(`div`,{class:`toast`,children:e.message})}function hf(){let e=B.value;Me(()=>{let t=sessionStorage.getItem(Au);if(!t)return;let n=e.get(t);n&&(sessionStorage.removeItem(Au),q.value=t,Lu(n))},[e])}let gf=[`pointerdown`,`pointerup`,`mousedown`,`mouseup`,`dblclick`,`contextmenu`,`auxclick`];function _f(e){let t=t=>t.composedPath().includes(e),n=(t,n)=>{for(let r of document.elementsFromPoint(t,n)){if(r===e||e.contains(r))return null;if(r!==document.documentElement)return r}return null},r=()=>U.value===`picking`||W.value&&Cn.value,i=null,a=null,o=()=>{if(!r()){fn.value&&=null;return}fn.value=!i||i.ours?null:n(i.x,i.y);let e=G.value?.element;e&&fn.value&&fn.value!==e&&(a=fn.value)},s=(e,t,n)=>{Ln(),G.value=null,K.value={element:e,label:fs(e),anchor:{selector:``,...t},context:ds(e),...n?{measuredTo:{...n,label:fs(n.element)}}:{}}},c=e=>{i={x:e.clientX,y:e.clientY,ours:t(e)},W.value=e.altKey,o()},l=e=>{e.key===`Alt`&&(W.value=e.type===`keydown`,Cn.value&&e.preventDefault(),o())},u=()=>{W.value=!1,o()},d=e=>{if(!r()&&e.type===`pointerdown`&&!t(e)){pn.value=!1,(q.value?B.value.get(q.value):void 0)?.anchor&&(q.value=null);return}r()&&!t(e)&&(e.preventDefault(),e.stopImmediatePropagation())},f=i=>{if(!r()||t(i))return;i.preventDefault(),i.stopImmediatePropagation();let o=n(i.clientX,i.clientY);if(!o)return;let c=zs(o,{x:i.clientX,y:i.clientY});if(U.value!==`picking`){let t=K.value;if(t)K.value={...t,measuredTo:o===t.element?void 0:{element:o,label:fs(o),parent:!1}};else{let t=G.value?.element===o;G.value=t?null:{element:o,offsets:c},a=null;let n=e.shadowRoot?.activeElement;n instanceof HTMLElement&&n.blur()}return}let l=o.parentElement,u=i.altKey&&Cn.value&&l&&l!==document.documentElement;s(o,c,u?{element:l,parent:!0}:void 0)},p=e=>{if(t(e))return;if(e.key===`Escape`){if(U.value===`picking`)Ln();else if(K.value)K.value=null;else if(G.value)G.value=null;else if(q.value)q.value=null;else if(J.value)J.value=!1;else return;e.preventDefault();return}if(vf(e))return;let n=!e.metaKey&&!e.ctrlKey&&!e.altKey;if(e.key.toLowerCase()===`r`&&n&&xn.value){e.preventDefault(),Tn();return}if(e.key.toLowerCase()===`c`&&n){e.preventDefault(),hn.value=!1;let t=G.value;if(U.value===`picking`)Ln();else if(t?.element.isConnected&&!K.value){let e=a?.isConnected?a:null;s(t.element,t.offsets,e?{element:e,parent:!1}:void 0)}else In()}},m=0,h=()=>{m||=requestAnimationFrame(()=>{m=0,On.value++})},g=new MutationObserver(t=>{t.every(t=>e.contains(t.target)||t.target===e)||h()});g.observe(document.body,{childList:!0,subtree:!0,attributes:!0});let _=setInterval(()=>{let e=An(location.href);e!==kn.value&&(kn.value=e,K.value=null,G.value=null,q.value=null)},400);window.addEventListener(`pointermove`,c,{capture:!0,passive:!0});for(let e of gf)window.addEventListener(e,d,!0);return window.addEventListener(`click`,f,!0),window.addEventListener(`keydown`,p,!0),window.addEventListener(`keydown`,l,!0),window.addEventListener(`keyup`,l,!0),window.addEventListener(`blur`,u),window.addEventListener(`scroll`,h,{capture:!0,passive:!0}),window.addEventListener(`resize`,h,{passive:!0}),()=>{window.removeEventListener(`pointermove`,c,!0);for(let e of gf)window.removeEventListener(e,d,!0);window.removeEventListener(`click`,f,!0),window.removeEventListener(`keydown`,p,!0),window.removeEventListener(`keydown`,l,!0),window.removeEventListener(`keyup`,l,!0),window.removeEventListener(`blur`,u),window.removeEventListener(`scroll`,h,!0),window.removeEventListener(`resize`,h),g.disconnect(),clearInterval(_),cancelAnimationFrame(m)}}function vf(e){let t=e.composedPath()[0];return t instanceof HTMLElement?t.isContentEditable||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement:!1}function yf(){let e=document.currentScript;return e?.dataset.bridge?e.dataset.bridge:e?.src?new URL(e.src).origin:`http://localhost:4747`}function bf(){let e=document.currentScript;if(e?.src)return new URL(e.src).searchParams.get(`root`)??void 0}function xf(){let e=document.currentScript?.dataset;if(e?.tencilProject&&e.tencilRepo&&e.tencilBranch&&e.tencilSha)return{projectKey:e.tencilProject,repo:e.tencilRepo,branch:e.tencilBranch,sha:e.tencilSha}}function Sf(){try{CSS.registerProperty({name:`--tencil-rim`,syntax:`<angle>`,inherits:!1,initialValue:`0deg`})}catch{}}function Cf(e,t,n){Sf();let r=document.createElement(`tencil-overlay`);r.setAttribute(`data-tencil`,``),r.style.cssText=`position:fixed;inset:0;pointer-events:none;z-index:2147483646;display:block;contain:layout style;`;let i=r.attachShadow({mode:`open`}),a=document.createElement(`style`);a.textContent=`
|
|
74
74
|
:host { all: initial; }
|
|
75
75
|
* { box-sizing: border-box; }
|
|
76
76
|
|
|
@@ -700,6 +700,23 @@ kbd {
|
|
|
700
700
|
.settings-radio:checked { box-shadow: inset 0 0 0 4px var(--accent); }
|
|
701
701
|
.settings-radio:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
702
702
|
.settings-status { margin: 2px 2px 0; color: var(--n-600); font-size: 12px; }
|
|
703
|
+
.settings-about-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
|
|
704
|
+
.settings-version { color: var(--n-600); font-size: 12px; font-variant-numeric: tabular-nums; }
|
|
705
|
+
.settings-update { display: grid; gap: 8px; justify-items: start; }
|
|
706
|
+
.settings-help a { color: var(--accent); text-decoration: none; }
|
|
707
|
+
.settings-help a:hover { text-decoration: underline; }
|
|
708
|
+
.settings-update-button:disabled { opacity: 0.6; cursor: default; }
|
|
709
|
+
.settings-update-error { display: grid; gap: 6px; }
|
|
710
|
+
.settings-update-error .settings-help { color: var(--error); }
|
|
711
|
+
.settings-command {
|
|
712
|
+
display: flex; align-items: center; justify-content: space-between; gap: 8px;
|
|
713
|
+
padding: 4px 4px 4px 10px; border-radius: 10px; background: var(--n-100);
|
|
714
|
+
}
|
|
715
|
+
.settings-command code { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
716
|
+
.settings-copy {
|
|
717
|
+
flex: none; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
|
|
718
|
+
background: var(--surface); box-shadow: 0 0 0 1px var(--n-200);
|
|
719
|
+
}
|
|
703
720
|
|
|
704
721
|
/* --------------------------------- toolbar -------------------------------- */
|
|
705
722
|
.toolbar-wrap {
|
|
@@ -840,6 +857,10 @@ kbd {
|
|
|
840
857
|
.tool-send { background: var(--accent); color: white; }
|
|
841
858
|
.tool-send:disabled { opacity: 0.5; cursor: default; }
|
|
842
859
|
.tool:disabled { opacity: 0.45; cursor: default; }
|
|
860
|
+
.tool-dot {
|
|
861
|
+
position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 999px;
|
|
862
|
+
background: var(--accent);
|
|
863
|
+
}
|
|
843
864
|
.badge {
|
|
844
865
|
position: absolute; top: 2px; right: 0;
|
|
845
866
|
min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
|
|
@@ -889,4 +910,4 @@ kbd {
|
|
|
889
910
|
@keyframes pin-dissolve { to { opacity: 0; } }
|
|
890
911
|
.shimmer > span[aria-hidden], .status-ping, .live-dot { animation: none; }
|
|
891
912
|
}
|
|
892
|
-
`;let
|
|
913
|
+
`;let o=document.querySelector(`script[nonce]`)?.nonce;o&&(a.nonce=o),i.append(a);let s=document.createElement(`div`);i.append(s),Fs(r),document.body.append(r);let c=new MutationObserver(()=>{r.isConnected||document.body.append(r)});c.observe(document.body,{childList:!0});let l=_f(r),u=qd();ge(te(pf,{}),s),Qt(e,t,n),window.__TENCIL__={version:1,bridgeUrl:e,destroy(){c.disconnect(),l(),u(),ge(null,s),r.remove(),window.__TENCIL__=void 0}}}if(typeof window<`u`&&!window.__TENCIL__){let e=yf(),t=xf(),n=bf();document.body?Cf(e,t,n):document.addEventListener(`DOMContentLoaded`,()=>Cf(e,t,n),{once:!0})}})();
|