assisted-review 1.0.0 → 1.0.1

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 CHANGED
@@ -28,20 +28,14 @@ It is a standalone CLI: it fetches the PR with `gh`, parses the diff into chunks
28
28
 
29
29
  ### Global install
30
30
 
31
- Install directly from GitHub. No clone or pnpm required. Builds on install.
31
+ Install from npm. No clone or pnpm required.
32
32
 
33
33
  ```bash
34
- npm i -g github:moui72/assisted-review
34
+ npm i -g assisted-review
35
35
  assisted-review <owner/repo#N | PR URL>
36
36
  ```
37
37
 
38
- To update, re-run the same `npm i -g …` command. To remove, `npm uninstall -g assisted-review`.
39
-
40
- > The install builds itself from source, which needs the dev toolchain (`vite`, `tsc`).
41
- > npm installs those automatically for the build and prunes them afterward. If you've
42
- > globally set `npm config set omit=dev`, that build step can't fetch them and the
43
- > install fails with e.g. `vite: not found`. In that case, install with:
44
- > `npm i -g --include=dev github:moui72/assisted-review`
38
+ To update: `npm update -g assisted-review`. To remove: `npm uninstall -g assisted-review`.
45
39
 
46
40
  ### From a checkout
47
41
 
@@ -54,7 +54,7 @@ Error generating stack: `+s.message+`
54
54
  ${I}px !important;
55
55
  ${L}px !important;
56
56
  }
57
- `),()=>{var F;(F=d.current)==null||F.removeAttribute("data-motion-pop-id"),$.contains(X)&&$.removeChild(X)}},[i]),T.jsx(l_,{isPresent:i,childRef:d,sizeRef:h,pop:c,children:c===!1?e:Q.cloneElement(e,{ref:y})})}const o_=({children:e,initial:i,isPresent:a,onExitComplete:l,custom:o,presenceAffectsLayout:c,mode:u,anchorX:d,anchorY:h,root:m})=>{const g=hh(u_),y=Q.useId();let b=!0,x=Q.useMemo(()=>(b=!1,{id:y,initial:i,isPresent:a,custom:o,onExitComplete:S=>{g.set(S,!0);for(const k of g.values())if(!k)return;l&&l()},register:S=>(g.set(S,!1),()=>g.delete(S))}),[a,g,l]);return c&&b&&(x={...x}),Q.useMemo(()=>{g.forEach((S,k)=>g.set(k,!1))},[a]),Q.useEffect(()=>{!a&&!g.size&&l&&l()},[a]),e=T.jsx(s_,{pop:u==="popLayout",isPresent:a,anchorX:d,anchorY:h,root:m,children:e}),T.jsx(Au.Provider,{value:x,children:e})};function u_(){return new Map}function Dv(e=!0){const i=Q.useContext(Au);if(i===null)return[!0,null];const{isPresent:a,onExitComplete:l,register:o}=i,c=Q.useId();Q.useEffect(()=>{if(e)return o(c)},[e]);const u=Q.useCallback(()=>e&&l&&l(c),[c,l,e]);return!a&&l?[!1,u]:[!0]}const Xo=e=>e.key||"";function Xb(e){const i=[];return Q.Children.forEach(e,a=>{Q.isValidElement(a)&&i.push(a)}),i}const c_=({children:e,custom:i,initial:a=!0,onExitComplete:l,presenceAffectsLayout:o=!0,mode:c="sync",propagate:u=!1,anchorX:d="left",anchorY:h="top",root:m})=>{const[g,y]=Dv(u),b=Q.useMemo(()=>Xb(e),[e]),x=u&&!g?[]:b.map(Xo),S=Q.useRef(!0),k=Q.useRef(b),C=hh(()=>new Map),A=Q.useRef(new Set),[z,D]=Q.useState(b),[q,I]=Q.useState(b);s0(()=>{S.current=!1,k.current=b;for(let $=0;$<q.length;$++){const F=Xo(q[$]);x.includes(F)?(C.delete(F),A.current.delete(F)):C.get(F)!==!0&&C.set(F,!1)}},[q,x.length,x.join("-")]);const L=[];if(b!==z){let $=[...b];for(let F=0;F<q.length;F++){const R=q[F],ie=Xo(R);x.includes(ie)||($.splice(F,0,R),L.push(R))}return c==="wait"&&L.length&&($=L),I(Xb($)),D(b),null}const{forceRender:X}=Q.useContext(dh);return T.jsx(T.Fragment,{children:q.map($=>{const F=Xo($),R=u&&!g?!1:b===q||x.includes(F),ie=()=>{if(A.current.has(F))return;if(C.has(F))A.current.add(F),C.set(F,!0);else return;let re=!0;C.forEach(ve=>{ve||(re=!1)}),re&&(X==null||X(),I(k.current),u&&(y==null||y()),l&&l())};return T.jsx(o_,{isPresent:R,initial:!S.current||a?void 0:!1,custom:i,presenceAffectsLayout:o,mode:c,root:m,onExitComplete:R?void 0:ie,anchorX:d,anchorY:h,children:$},F)})})},zv=Q.createContext({strict:!1}),Kb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Zb=!1;function f_(){if(Zb)return;const e={};for(const i in Kb)e[i]={isEnabled:a=>Kb[i].some(l=>!!a[l])};uv(e),Zb=!0}function Lv(){return f_(),KA()}function d_(e){const i=Lv();for(const a in e)i[a]={...i[a],...e[a]};uv(i)}const h_=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function xu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||h_.has(e)}let Bv=e=>!xu(e);function m_(e){typeof e=="function"&&(Bv=i=>i.startsWith("on")?!xu(i):e(i))}try{m_(require("@emotion/is-prop-valid").default)}catch{}function p_(e,i,a){const l={};for(const o in e)o==="values"&&typeof e.values=="object"||Jt(e[o])||(Bv(o)||a===!0&&xu(o)||!i&&!xu(o)||e.draggable&&o.startsWith("onDrag"))&&(l[o]=e[o]);return l}const Nu=Q.createContext({});function g_(e,i){if(Cu(e)){const{initial:a,animate:l}=e;return{initial:a===!1||ys(a)?a:void 0,animate:ys(l)?l:void 0}}return e.inherit!==!1?i:{}}function y_(e){const{initial:i,animate:a}=g_(e,Q.useContext(Nu));return Q.useMemo(()=>({initial:i,animate:a}),[Qb(i),Qb(a)])}function Qb(e){return Array.isArray(e)?e.join(" "):e}const Uh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jv(e,i,a){for(const l in i)!Jt(i[l])&&!gv(l,a)&&(e[l]=i[l])}function b_({transformTemplate:e},i){return Q.useMemo(()=>{const a=Uh();return Lh(a,i,e),Object.assign({},a.vars,a.style)},[i])}function x_(e,i){const a=e.style||{},l={};return jv(l,a,e),Object.assign(l,b_(e,i)),l}function v_(e,i){const a={},l=x_(e,i);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=l,a}const Uv=()=>({...Uh(),attrs:{}});function S_(e,i,a,l){const o=Q.useMemo(()=>{const c=Uv();return yv(c,i,xv(l),e.transformTemplate,e.style),{...c.attrs,style:{...c.style}}},[i]);if(e.style){const c={};jv(c,e.style,e),o.style={...c,...o.style}}return o}const E_=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Vh(e){return typeof e!="string"||e.includes("-")?!1:!!(E_.indexOf(e)>-1||/[A-Z]/u.test(e))}function T_(e,i,a,{latestValues:l},o,c=!1,u){const h=(u??Vh(e)?S_:v_)(i,l,o,e),m=p_(i,typeof e=="string",c),g=e!==Q.Fragment?{...m,...h,ref:a}:{},{children:y}=i,b=Q.useMemo(()=>Jt(y)?y.get():y,[y]);return Q.createElement(e,{...g,children:b})}function w_({scrapeMotionValuesFromProps:e,createRenderState:i},a,l,o){return{latestValues:A_(a,l,o,e),renderState:i()}}function A_(e,i,a,l){const o={},c=l(e,{});for(const b in c)o[b]=lu(c[b]);let{initial:u,animate:d}=e;const h=Cu(e),m=sv(e);i&&m&&!h&&e.inherit!==!1&&(u===void 0&&(u=i.initial),d===void 0&&(d=i.animate));let g=a?a.initial===!1:!1;g=g||u===!1;const y=g?d:u;if(y&&typeof y!="boolean"&&!_u(y)){const b=Array.isArray(y)?y:[y];for(let x=0;x<b.length;x++){const S=Ch(e,b[x]);if(S){const{transitionEnd:k,transition:C,...A}=S;for(const z in A){let D=A[z];if(Array.isArray(D)){const q=g?D.length-1:0;D=D[q]}D!==null&&(o[z]=D)}for(const z in k)o[z]=k[z]}}}return o}const Vv=e=>(i,a)=>{const l=Q.useContext(Nu),o=Q.useContext(Au),c=()=>w_(e,i,l,o);return a?c():hh(c)},k_=Vv({scrapeMotionValuesFromProps:Bh,createRenderState:Uh}),__=Vv({scrapeMotionValuesFromProps:vv,createRenderState:Uv}),C_=Symbol.for("motionComponentSymbol");function N_(e,i,a){const l=Q.useRef(a);Q.useInsertionEffect(()=>{l.current=a});const o=Q.useRef(null);return Q.useCallback(c=>{var d;c&&((d=e.onMount)==null||d.call(e,c)),i&&(c?i.mount(c):i.unmount());const u=l.current;if(typeof u=="function")if(c){const h=u(c);typeof h=="function"&&(o.current=h)}else o.current?(o.current(),o.current=null):u(c);else u&&(u.current=c)},[i])}const Hv=Q.createContext({});function Xr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function M_(e,i,a,l,o,c){var D,q;const{visualElement:u}=Q.useContext(Nu),d=Q.useContext(zv),h=Q.useContext(Au),m=Q.useContext(jh),g=m.reducedMotion,y=m.skipAnimations,b=Q.useRef(null),x=Q.useRef(!1);l=l||d.renderer,!b.current&&l&&(b.current=l(e,{visualState:i,parent:u,props:a,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:g,skipAnimations:y,isSVG:c}),x.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,k=Q.useContext(Hv);S&&!S.projection&&o&&(S.type==="html"||S.type==="svg")&&R_(b.current,a,o,k);const C=Q.useRef(!1);Q.useInsertionEffect(()=>{S&&C.current&&S.update(a,h)});const A=a[Z0],z=Q.useRef(!!A&&typeof window<"u"&&!((D=window.MotionHandoffIsComplete)!=null&&D.call(window,A))&&((q=window.MotionHasOptimisedAnimation)==null?void 0:q.call(window,A)));return s0(()=>{x.current=!0,S&&(C.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),z.current&&S.animationState&&S.animationState.animateChanges())}),Q.useEffect(()=>{S&&(!z.current&&S.animationState&&S.animationState.animateChanges(),z.current&&(queueMicrotask(()=>{var I;(I=window.MotionHandoffMarkAsComplete)==null||I.call(window,A)}),z.current=!1),S.enteringChildren=void 0)}),S}function R_(e,i,a,l){const{layoutId:o,layout:c,drag:u,dragConstraints:d,layoutScroll:h,layoutRoot:m,layoutAnchor:g,layoutCrossfade:y}=i;e.projection=new a(e.latestValues,i["data-framer-portal-id"]?void 0:Iv(e.parent)),e.projection.setOptions({layoutId:o,layout:c,alwaysMeasureLayout:!!u||d&&Xr(d),visualElement:e,animationType:typeof c=="string"?c:"both",initialPromotionConfig:l,crossfade:y,layoutScroll:h,layoutRoot:m,layoutAnchor:g})}function Iv(e){if(e)return e.options.allowProjection!==!1?e.projection:Iv(e.parent)}function ed(e,{forwardMotionProps:i=!1,type:a}={},l,o){l&&d_(l);const c=a?a==="svg":Vh(e),u=c?__:k_;function d(m,g){let y;const b={...Q.useContext(jh),...m,layoutId:O_(m)},{isStatic:x}=b,S=y_(m),k=u(m,x);if(!x&&typeof window<"u"){D_();const C=z_(b);y=C.MeasureLayout,S.visualElement=M_(e,k,b,o,C.ProjectionNode,c)}return T.jsxs(Nu.Provider,{value:S,children:[y&&S.visualElement?T.jsx(y,{visualElement:S.visualElement,...b}):null,T_(e,m,N_(k,S.visualElement,g),k,x,i,c)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=Q.forwardRef(d);return h[C_]=e,h}function O_({layoutId:e}){const i=Q.useContext(dh).id;return i&&e!==void 0?i+"-"+e:e}function D_(e,i){Q.useContext(zv).strict}function z_(e){const i=Lv(),{drag:a,layout:l}=i;if(!a&&!l)return{};const o={...a,...l};return{MeasureLayout:a!=null&&a.isEnabled(e)||l!=null&&l.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function L_(e,i){if(typeof Proxy>"u")return ed;const a=new Map,l=(c,u)=>ed(c,u,e,i),o=(c,u)=>l(c,u);return new Proxy(o,{get:(c,u)=>u==="create"?l:(a.has(u)||a.set(u,ed(u,void 0,e,i)),a.get(u))})}const B_=(e,i)=>i.isSVG??Vh(e)?new fk(i):new rk(i,{allowProjection:e!==Q.Fragment});class j_ extends wa{constructor(i){super(i),i.animationState||(i.animationState=gk(i))}updateAnimationControlsSubscription(){const{animate:i}=this.node.getProps();_u(i)&&(this.unmountControls=i.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:i}=this.node.getProps(),{animate:a}=this.node.prevProps||{};i!==a&&this.updateAnimationControlsSubscription()}unmount(){var i;this.node.animationState.reset(),(i=this.unmountControls)==null||i.call(this)}}let U_=0;class V_ extends wa{constructor(){super(...arguments),this.id=U_++,this.isExitComplete=!1}update(){var c;if(!this.node.presenceContext)return;const{isPresent:i,onExitComplete:a}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||i===l)return;if(i&&l===!1){if(this.isExitComplete){const{initial:u,custom:d}=this.node.getProps();if(typeof u=="string"||typeof u=="object"&&u!==null&&!Array.isArray(u)){const h=tr(this.node,u,d);if(h){const{transition:m,transitionEnd:g,...y}=h;for(const b in y)(c=this.node.getValue(b))==null||c.jump(y[b])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!i);a&&!i&&o.then(()=>{this.isExitComplete=!0,a(this.id)})}mount(){const{register:i,onExitComplete:a}=this.node.presenceContext||{};a&&a(this.id),i&&(this.unmount=i(this.id))}unmount(){}}const H_={animation:{Feature:j_},exit:{Feature:V_}};function ws(e){return{point:{x:e.pageX,y:e.pageY}}}const I_=e=>i=>Rh(i)&&e(i,ws(i));function fs(e,i,a,l){return bs(e,i,I_(a),l)}const Pv=({current:e})=>e?e.ownerDocument.defaultView:null,$b=(e,i)=>Math.abs(e-i);function P_(e,i){const a=$b(e.x,i.x),l=$b(e.y,i.y);return Math.sqrt(a**2+l**2)}const Jb=new Set(["auto","scroll"]);class qv{constructor(i,a,{transformPagePoint:l,contextWindow:o=window,dragSnapToOrigin:c=!1,distanceThreshold:u=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ko(this.lastRawMoveEventInfo,this.transformPagePoint));const x=td(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,k=P_(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!k)return;const{point:C}=x,{timestamp:A}=$t;this.history.push({...C,timestamp:A});const{onStart:z,onMove:D}=this.handlers;S||(z&&z(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),D&&D(this.lastMoveEvent,x)},this.handlePointerMove=(x,S)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=S,this.lastMoveEventInfo=Ko(S,this.transformPagePoint),mt.update(this.updatePoint,!0)},this.handlePointerUp=(x,S)=>{this.end();const{onEnd:k,onSessionEnd:C,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const z=td(x.type==="pointercancel"?this.lastMoveEventInfo:Ko(S,this.transformPagePoint),this.history);this.startEvent&&k&&k(x,z),C&&C(x,z)},!Rh(i))return;this.dragSnapToOrigin=c,this.handlers=a,this.transformPagePoint=l,this.distanceThreshold=u,this.contextWindow=o||window;const h=ws(i),m=Ko(h,this.transformPagePoint),{point:g}=m,{timestamp:y}=$t;this.history=[{...g,timestamp:y}];const{onSessionStart:b}=a;b&&b(i,td(m,this.history)),this.removeListeners=Ss(fs(this.contextWindow,"pointermove",this.handlePointerMove),fs(this.contextWindow,"pointerup",this.handlePointerUp),fs(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(i){let a=i.parentElement;for(;a;){const l=getComputedStyle(a);(Jb.has(l.overflowX)||Jb.has(l.overflowY))&&this.scrollPositions.set(a,{x:a.scrollLeft,y:a.scrollTop}),a=a.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(i){const a=this.scrollPositions.get(i);if(!a)return;const l=i===window,o=l?{x:window.scrollX,y:window.scrollY}:{x:i.scrollLeft,y:i.scrollTop},c={x:o.x-a.x,y:o.y-a.y};c.x===0&&c.y===0||(l?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(i,o),mt.update(this.updatePoint,!0))}updateHandlers(i){this.handlers=i}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ta(this.updatePoint)}}function Ko(e,i){return i?{point:i(e.point)}:e}function Wb(e,i){return{x:e.x-i.x,y:e.y-i.y}}function td({point:e},i){return{point:e,delta:Wb(e,Fv(i)),offset:Wb(e,q_(i)),velocity:F_(i,.1)}}function q_(e){return e[0]}function Fv(e){return e[e.length-1]}function F_(e,i){if(e.length<2)return{x:0,y:0};let a=e.length-1,l=null;const o=Fv(e);for(;a>=0&&(l=e[a],!(o.timestamp-l.timestamp>Bn(i)));)a--;if(!l)return{x:0,y:0};l===e[0]&&e.length>2&&o.timestamp-l.timestamp>Bn(i)*2&&(l=e[1]);const c=Zn(o.timestamp-l.timestamp);if(c===0)return{x:0,y:0};const u={x:(o.x-l.x)/c,y:(o.y-l.y)/c};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function G_(e,{min:i,max:a},l){return i!==void 0&&e<i?e=l?ht(i,e,l.min):Math.max(e,i):a!==void 0&&e>a&&(e=l?ht(a,e,l.max):Math.min(e,a)),e}function ex(e,i,a){return{min:i!==void 0?e.min+i:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function Y_(e,{top:i,left:a,bottom:l,right:o}){return{x:ex(e.x,a,o),y:ex(e.y,i,l)}}function tx(e,i){let a=i.min-e.min,l=i.max-e.max;return i.max-i.min<e.max-e.min&&([a,l]=[l,a]),{min:a,max:l}}function X_(e,i){return{x:tx(e.x,i.x),y:tx(e.y,i.y)}}function K_(e,i){let a=.5;const l=mn(e),o=mn(i);return o>l?a=ps(i.min,i.max-l,e.min):l>o&&(a=ps(e.min,e.max-o,i.min)),bi(0,1,a)}function Z_(e,i){const a={};return i.min!==void 0&&(a.min=i.min-e.min),i.max!==void 0&&(a.max=i.max-e.min),a}const Qd=.35;function Q_(e=Qd){return e===!1?e=0:e===!0&&(e=Qd),{x:nx(e,"left","right"),y:nx(e,"top","bottom")}}function nx(e,i,a){return{min:ix(e,i),max:ix(e,a)}}function ix(e,i){return typeof e=="number"?e:e[i]||0}const $_=new WeakMap;class J_{constructor(i){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=qt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=i}start(i,{snapToCursor:a=!1,distanceThreshold:l}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const c=y=>{a&&this.snapToCursor(ws(y).point),this.stopAnimation()},u=(y,b)=>{const{drag:x,dragPropagation:S,onDragStart:k}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wA(x),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),mi(A=>{let z=this.getAxisMotionValue(A).get()||0;if(yi.test(z)){const{projection:D}=this.visualElement;if(D&&D.layout){const q=D.layout.layoutBox[A];q&&(z=mn(q)*(parseFloat(z)/100))}}this.originPoint[A]=z}),k&&mt.update(()=>k(y,b),!1,!0),Hd(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},d=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b;const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:k,onDrag:C}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:A}=b;if(S&&this.currentDirection===null){this.currentDirection=eC(A),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",b.point,A),this.updateAxis("y",b.point,A),this.visualElement.render(),C&&mt.update(()=>C(y,b),!1,!0)},h=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b,this.stop(y,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:g}=this.getProps();this.panSession=new qv(i,{onSessionStart:c,onStart:u,onMove:d,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:l,contextWindow:Pv(this.visualElement),element:this.visualElement.current})}stop(i,a){const l=i||this.latestPointerEvent,o=a||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!o||!l)return;const{velocity:u}=o;this.startAnimation(u);const{onDragEnd:d}=this.getProps();d&&mt.postRender(()=>d(l,o))}cancel(){this.isDragging=!1;const{projection:i,animationState:a}=this.visualElement;i&&(i.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(i,a,l){const{drag:o}=this.getProps();if(!l||!Zo(i,o,this.currentDirection))return;const c=this.getAxisMotionValue(i);let u=this.originPoint[i]+l[i];this.constraints&&this.constraints[i]&&(u=G_(u,this.constraints[i],this.elastic[i])),c.set(u)}resolveConstraints(){var c;const{dragConstraints:i,dragElastic:a}=this.getProps(),l=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(c=this.visualElement.projection)==null?void 0:c.layout,o=this.constraints;i&&Xr(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&l?this.constraints=Y_(l.layoutBox,i):this.constraints=!1,this.elastic=Q_(a),o!==this.constraints&&!Xr(i)&&l&&this.constraints&&!this.hasMutatedConstraints&&mi(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=Z_(l.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:i,onMeasureDragConstraints:a}=this.getProps();if(!i||!Xr(i))return!1;const l=i.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const c=WA(l,o.root,this.visualElement.getTransformPagePoint());let u=X_(o.layout.layoutBox,c);if(a){const d=a(QA(u));this.hasMutatedConstraints=!!d,d&&(u=fv(d))}return u}startAnimation(i){const{drag:a,dragMomentum:l,dragElastic:o,dragTransition:c,dragSnapToOrigin:u,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},m=mi(g=>{if(!Zo(g,a,this.currentDirection))return;let y=h&&h[g]||{};(u===!0||u===g)&&(y={min:0,max:0});const b=o?200:1e6,x=o?40:1e7,S={type:"inertia",velocity:l?i[g]:0,bounceStiffness:b,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...c,...y};return this.startAxisValueAnimation(g,S)});return Promise.all(m).then(d)}startAxisValueAnimation(i,a){const l=this.getAxisMotionValue(i);return Hd(this.visualElement,i),l.start(_h(i,l,0,a,this.visualElement,!1))}stopAnimation(){mi(i=>this.getAxisMotionValue(i).stop())}getAxisMotionValue(i){const a=`_drag${i.toUpperCase()}`,o=this.visualElement.getProps()[a];return o||this.visualElement.getValue(i,this.visualElement.latestValues[i]??0)}snapToCursor(i){mi(a=>{const{drag:l}=this.getProps();if(!Zo(a,l,this.currentDirection))return;const{projection:o}=this.visualElement,c=this.getAxisMotionValue(a);if(o&&o.layout){const{min:u,max:d}=o.layout.layoutBox[a],h=c.get()||0;c.set(i[a]-ht(u,d,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:i,dragConstraints:a}=this.getProps(),{projection:l}=this.visualElement;if(!Xr(a)||!l||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};mi(u=>{const d=this.getAxisMotionValue(u);if(d&&this.constraints!==!1){const h=d.get();o[u]=K_({min:h,max:h},this.constraints[u])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.constraints=!1,this.resolveConstraints(),mi(u=>{if(!Zo(u,i,null))return;const d=this.getAxisMotionValue(u),{min:h,max:m}=this.constraints[u];d.set(ht(h,m,o[u]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;$_.set(this.visualElement,this);const i=this.visualElement.current,a=fs(i,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps(),b=m.target,x=b!==i&&MA(b);g&&y&&!x&&this.start(m)});let l;const o=()=>{const{dragConstraints:m}=this.getProps();Xr(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),l||(l=W_(i,m.current,()=>this.scalePositionWithinConstraints())))},{projection:c}=this.visualElement,u=c.addEventListener("measure",o);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),mt.read(o);const d=bs(window,"resize",()=>this.scalePositionWithinConstraints()),h=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(mi(y=>{const b=this.getAxisMotionValue(y);b&&(this.originPoint[y]+=m[y].translate,b.set(b.get()+m[y].translate))}),this.visualElement.render())}));return()=>{d(),a(),u(),h&&h(),l&&l()}}getProps(){const i=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:l=!1,dragPropagation:o=!1,dragConstraints:c=!1,dragElastic:u=Qd,dragMomentum:d=!0}=i;return{...i,drag:a,dragDirectionLock:l,dragPropagation:o,dragConstraints:c,dragElastic:u,dragMomentum:d}}}function ax(e){let i=!0;return()=>{if(i){i=!1;return}e()}}function W_(e,i,a){const l=fb(e,ax(a)),o=fb(i,ax(a));return()=>{l(),o()}}function Zo(e,i,a){return(i===!0||i===e)&&(a===null||a===e)}function eC(e,i=10){let a=null;return Math.abs(e.y)>i?a="y":Math.abs(e.x)>i&&(a="x"),a}class tC extends wa{constructor(i){super(i),this.removeGroupControls=Qn,this.removeListeners=Qn,this.controls=new J_(i)}mount(){const{dragControls:i}=this.node.getProps();i&&(this.removeGroupControls=i.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qn}update(){const{dragControls:i}=this.node.getProps(),{dragControls:a}=this.node.prevProps||{};i!==a&&(this.removeGroupControls(),i&&(this.removeGroupControls=i.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const nd=e=>(i,a)=>{e&&mt.update(()=>e(i,a),!1,!0)};class nC extends wa{constructor(){super(...arguments),this.removePointerDownListener=Qn}onPointerDown(i){this.session=new qv(i,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Pv(this.node)})}createPanHandlers(){const{onPanSessionStart:i,onPanStart:a,onPan:l,onPanEnd:o}=this.node.getProps();return{onSessionStart:nd(i),onStart:nd(a),onMove:nd(l),onEnd:(c,u)=>{delete this.session,o&&mt.postRender(()=>o(c,u))}}}mount(){this.removePointerDownListener=fs(this.node.current,"pointerdown",i=>this.onPointerDown(i))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let id=!1;class iC extends Q.Component{componentDidMount(){const{visualElement:i,layoutGroup:a,switchLayoutGroup:l,layoutId:o}=this.props,{projection:c}=i;c&&(a.group&&a.group.add(c),l&&l.register&&o&&l.register(c),id&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),su.hasEverUpdated=!0}getSnapshotBeforeUpdate(i){const{layoutDependency:a,visualElement:l,drag:o,isPresent:c}=this.props,{projection:u}=l;return u&&(u.isPresent=c,i.layoutDependency!==a&&u.setOptions({...u.options,layoutDependency:a}),id=!0,o||i.layoutDependency!==a||a===void 0||i.isPresent!==c?u.willUpdate():this.safeToRemove(),i.isPresent!==c&&(c?u.promote():u.relegate()||mt.postRender(()=>{const d=u.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:i,layoutAnchor:a}=this.props,{projection:l}=i;l&&(l.options.layoutAnchor=a,l.root.didUpdate(),Mh.postRender(()=>{!l.currentAnimation&&l.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:i,layoutGroup:a,switchLayoutGroup:l}=this.props,{projection:o}=i;id=!0,o&&(o.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(o),l&&l.deregister&&l.deregister(o))}safeToRemove(){const{safeToRemove:i}=this.props;i&&i()}render(){return null}}function Gv(e){const[i,a]=Dv(),l=Q.useContext(dh);return T.jsx(iC,{...e,layoutGroup:l,switchLayoutGroup:Q.useContext(Hv),isPresent:i,safeToRemove:a})}const aC={pan:{Feature:nC},drag:{Feature:tC,ProjectionNode:Ov,MeasureLayout:Gv}};function rx(e,i,a){const{props:l}=e;e.animationState&&l.whileHover&&e.animationState.setActive("whileHover",a==="Start");const o="onHover"+a,c=l[o];c&&mt.postRender(()=>c(i,ws(i)))}class rC extends wa{mount(){const{current:i}=this.node;i&&(this.unmount=kA(i,(a,l)=>(rx(this.node,l,"Start"),o=>rx(this.node,o,"End"))))}unmount(){}}class lC extends wa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let i=!1;try{i=this.node.current.matches(":focus-visible")}catch{i=!0}!i||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ss(bs(this.node.current,"focus",()=>this.onFocus()),bs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function lx(e,i,a){const{props:l}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&l.whileTap&&e.animationState.setActive("whileTap",a==="Start");const o="onTap"+(a==="End"?"":a),c=l[o];c&&mt.postRender(()=>c(i,ws(i)))}class sC extends wa{mount(){const{current:i}=this.node;if(!i)return;const{globalTapTarget:a,propagate:l}=this.node.props;this.unmount=OA(i,(o,c)=>(lx(this.node,c,"Start"),(u,{success:d})=>lx(this.node,u,d?"End":"Cancel")),{useGlobalTarget:a,stopPropagation:(l==null?void 0:l.tap)===!1})}unmount(){}}const $d=new WeakMap,ad=new WeakMap,oC=e=>{const i=$d.get(e.target);i&&i(e)},uC=e=>{e.forEach(oC)};function cC({root:e,...i}){const a=e||document;ad.has(a)||ad.set(a,{});const l=ad.get(a),o=JSON.stringify(i);return l[o]||(l[o]=new IntersectionObserver(uC,{root:e,...i})),l[o]}function fC(e,i,a){const l=cC(i);return $d.set(e,a),l.observe(e),()=>{$d.delete(e),l.unobserve(e)}}const dC={some:0,all:1};class hC extends wa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var h;(h=this.stopObserver)==null||h.call(this);const{viewport:i={}}=this.node.getProps(),{root:a,margin:l,amount:o="some",once:c}=i,u={root:a?a.current:void 0,rootMargin:l,threshold:typeof o=="number"?o:dC[o]},d=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,c&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:b}=this.node.getProps(),x=g?y:b;x&&x(m)};this.stopObserver=fC(this.node.current,u,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:i,prevProps:a}=this.node;["amount","margin","root"].some(mC(i,a))&&this.startObserver()}unmount(){var i;(i=this.stopObserver)==null||i.call(this),this.hasEnteredView=!1,this.isInView=!1}}function mC({viewport:e={}},{viewport:i={}}={}){return a=>e[a]!==i[a]}const pC={inView:{Feature:hC},tap:{Feature:sC},focus:{Feature:lC},hover:{Feature:rC}},gC={layout:{ProjectionNode:Ov,MeasureLayout:Gv}},yC={...H_,...pC,...aC,...gC},bC=L_(yC,B_),sx="__overview__",xC=["APPROVE","COMMENT","REQUEST_CHANGES"];async function vC(){const e=await fetch("/api/review");if(e.status===204)return null;if(!e.ok)throw new Error(`/api/review returned ${e.status}`);return await e.json()}async function SC(){const e=await fetch("/api/state");if(e.status===204)return null;if(!e.ok)throw new Error(`/api/state returned ${e.status}`);return await e.json()}async function EC(){const e=await fetch("/api/review",{method:"DELETE"});if(!e.ok)throw new Error(`DELETE /api/review returned ${e.status}`)}async function TC(e){const i=await fetch("/api/action",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!i.ok)throw new Error(`/api/action returned ${i.status}`);return await i.json()}async function wC(e,i){return await(await fetch("/api/submit",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({verdict:e,body:i})})).json()}function AC(e,i){const a=new URL("/api/claude",location.origin);a.searchParams.set("chunk_id",e.chunkId),e.question.trim()&&a.searchParams.set("q",e.question.trim());const l=new EventSource(a.toString());let o=!1;const c=()=>{o=!0,l.close()};return l.addEventListener("delta",u=>{o||i.onDelta(JSON.parse(u.data).text)}),l.addEventListener("done",u=>{o||(i.onDone(JSON.parse(u.data).state),c())}),l.addEventListener("error",u=>{if(o)return;const d=u.data;let h="Claude request failed (connection lost)";if(d)try{h=JSON.parse(d).message}catch{}i.onError(h),c()}),c}async function kC(){const e=await fetch("/api/reviews");if(!e.ok)throw new Error(`/api/reviews returned ${e.status}`);return await e.json()}async function ox(e){const i=await fetch(`/api/reviews/${e.owner}/${e.repo}/${e.number}`,{method:"DELETE"});if(!i.ok)throw new Error(`DELETE /api/reviews returned ${i.status}`)}async function Jd(e){const i=await fetch("/api/reviews/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ref:e})}),a=await i.json();if(!i.ok)throw new Error(a.error??`/api/reviews/open returned ${i.status}`);return a}function nr({children:e,className:i=""}){return T.jsx("div",{className:`rounded-md border border-[var(--del-fg)]/30 bg-[var(--del-bg)] px-3 py-1.5 font-sans text-[12px] text-[var(--del-fg)] ${i}`,children:e})}function va(e){return`${e.owner}/${e.repo}#${e.number}`}function rd(e){var i;return((i=e.meta)==null?void 0:i.title)??va(e.pr)}function _C({s:e}){const i=[];return e.viewed_count>0&&i.push(`${e.viewed_count} viewed`),e.comment_count>0&&i.push(`${e.comment_count} comment${e.comment_count===1?"":"s"}`),e.flagged_count>0&&i.push(`${e.flagged_count} flagged`),e.submitted&&i.push("submitted"),T.jsx("span",{className:"font-mono text-[11px] text-faint",children:i.length?i.join(" · "):"not started"})}function CC({open:e,currentPr:i,onClose:a,onSwitched:l,onCleared:o}){const[c,u]=Q.useState(null),[d,h]=Q.useState(null),[m,g]=Q.useState(!1),[y,b]=Q.useState(null),[x,S]=Q.useState(""),[k,C]=Q.useState(!1),A=Q.useRef(null);if(Q.useEffect(()=>{e&&(h(null),kC().then(u).catch(F=>h(F instanceof Error?F.message:String(F))),setTimeout(()=>{var F;return(F=A.current)==null?void 0:F.focus()},0))},[e]),!e)return null;const z=va(i),D=(c==null?void 0:c.find(F=>va(F.pr)===z))??null,q=D?rd(D):z,I=(c==null?void 0:c.find(F=>va(F.pr)!==z))??null,L=async F=>{if(!(!F.trim()||m)){g(!0),b(null);try{const R=await Jd(F.trim());R.review&&R.state?(l(R.review,R.state),a()):b(R.error??"Failed to open review")}catch(R){b(R instanceof Error?R.message:String(R))}finally{g(!1)}}},X=async F=>{try{await ox(F),u(R=>(R==null?void 0:R.filter(ie=>va(ie.pr)!==va(F)))??null)}catch{}},$=async()=>{if(C(!1),I){g(!0),b(null);try{const F=await Jd(va(I.pr));F.review&&F.state?(await ox(i).catch(()=>{}),l(F.review,F.state),a()):b("Failed to switch reviews")}catch(F){b(F instanceof Error?F.message:String(F))}finally{g(!1)}}else await EC().catch(()=>{}),o()};return T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-[1px]",onClick:m?void 0:a,children:T.jsxs("div",{onClick:F=>F.stopPropagation(),className:"flex max-h-[85vh] w-[540px] flex-col rounded-xl border border-edge bg-surface shadow-2xl",children:[T.jsxs("div",{className:"flex items-center justify-between border-b border-edge px-5 py-3",children:[T.jsx("h2",{className:"text-[13px] font-semibold tracking-wide text-fg",children:"Reviews"}),T.jsx("button",{onClick:a,disabled:m,className:"rounded border border-edge-strong px-1.5 py-0.5 font-mono text-[11px] text-muted transition hover:text-fg disabled:opacity-40",children:"esc"})]}),T.jsxs("div",{className:"thin-scroll min-h-0 flex-1 overflow-auto px-5 py-4",children:[T.jsxs("div",{className:"mb-4",children:[T.jsx("label",{className:"mb-1.5 block font-sans text-[10px] font-semibold tracking-[0.18em] text-faint uppercase",children:"Open a review"}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx("input",{ref:A,type:"text",value:x,onChange:F=>S(F.target.value),onKeyDown:F=>{F.key==="Enter"&&L(x),F.key==="Escape"&&a()},placeholder:"owner/repo#123 or PR URL",disabled:m,className:"min-w-0 flex-1 rounded-md border border-edge bg-bg px-3 py-1.5 font-mono text-[12.5px] text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none disabled:opacity-50"}),T.jsx("button",{onClick:()=>void L(x),disabled:m||!x.trim(),className:"rounded-md bg-accent px-3 py-1.5 text-[12.5px] font-semibold text-bg transition hover:brightness-110 disabled:opacity-50",children:m?"Opening…":"Open"})]}),y&&T.jsx(nr,{className:"mt-2 text-[12px] py-1.5",children:y})]}),T.jsxs("div",{children:[T.jsx("div",{className:"mb-1.5 font-sans text-[10px] font-semibold tracking-[0.18em] text-faint uppercase",children:"Ongoing reviews"}),d?T.jsx(nr,{className:"text-[12px] py-1.5",children:d}):c===null?T.jsx("p",{className:"font-mono text-[12px] text-faint",children:"Loading…"}):c.length===0?T.jsx("p",{className:"font-sans text-[12.5px] text-faint italic",children:"No saved reviews yet."}):T.jsx("ul",{className:"space-y-1.5",children:c.map(F=>{const R=va(F.pr),ie=R===z;return T.jsxs("li",{className:`flex items-start gap-2 rounded-md border px-3 py-2 ${ie?"border-accent/40 bg-accent/[0.06]":"border-edge hover:border-edge-strong"}`,children:[T.jsxs("div",{className:"min-w-0 flex-1",children:[T.jsxs("div",{className:"truncate text-[13px] font-medium text-fg",children:[rd(F),ie&&T.jsx("span",{className:"ml-2 rounded-full bg-accent/20 px-1.5 font-mono text-[10px] text-accent",children:"current"})]}),T.jsxs("div",{className:"mt-0.5 flex items-center gap-2",children:[T.jsx("span",{className:"font-mono text-[11px] text-faint/70",children:R}),T.jsx("span",{className:"text-edge-strong",children:"·"}),T.jsx(_C,{s:F})]})]}),T.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[!ie&&T.jsx("button",{onClick:()=>void L(R),disabled:m,className:"rounded border border-edge-strong px-2 py-0.5 text-[11.5px] text-muted transition hover:border-fg/40 hover:text-fg disabled:opacity-40",children:"Switch"}),T.jsx("button",{onClick:()=>ie?C(!0):void X(F.pr),disabled:m||ie&&k,title:"Remove from list",className:"rounded border border-edge-strong px-2 py-0.5 text-[11.5px] text-muted transition hover:border-red-400/40 hover:text-red-300 disabled:opacity-40",children:"✕"})]})]},R)})})]})]}),k&&T.jsxs("div",{className:"border-t border-edge px-5 py-4",children:[T.jsxs("p",{className:"text-[13px] font-medium text-fg",children:["Delete"," ",T.jsxs("span",{className:"text-red-300",children:['"',q,'"']}),"?"]}),T.jsx("p",{className:"mt-0.5 text-[12px] text-muted",children:I?`You'll be switched to "${rd(I)}".`:"No other reviews. Your current session will end."}),y&&T.jsx(nr,{className:"mt-2 py-1.5 text-[12px]",children:y}),T.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[T.jsx("button",{onClick:()=>C(!1),disabled:m,className:"rounded border border-edge-strong px-3 py-1 text-[12px] text-muted transition hover:text-fg disabled:opacity-40",children:"Cancel"}),T.jsx("button",{onClick:()=>void $(),disabled:m,className:"rounded border border-red-400/40 bg-red-400/10 px-3 py-1 text-[12px] text-red-300 transition hover:bg-red-400/20 disabled:opacity-40",children:m?I?"Switching…":"Deleting…":"Delete"})]})]})]})})}const Yv=Q.createContext({theme:"dark",toggle:()=>{}});function NC(){try{const e=localStorage.getItem("ar-theme"),i=e==="light"?"light":e==="dark"?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";return i==="light"&&(document.documentElement.dataset.theme="light"),i}catch{return"dark"}}function MC({children:e}){const[i,a]=Q.useState(NC);Q.useEffect(()=>{document.documentElement.dataset.theme=i,localStorage.setItem("ar-theme",i)},[i]);const l=()=>a(o=>o==="dark"?"light":"dark");return T.jsx(Yv.Provider,{value:{theme:i,toggle:l},children:e})}function Xv(){return Q.useContext(Yv)}function Hh({className:e}){const{theme:i}=Xv();return T.jsx("img",{className:e,src:i==="light"?"/logo.svg":"/logo-dark.svg",alt:"assisted-review"})}function RC({onOpened:e}){const[i,a]=Q.useState(""),[l,o]=Q.useState(!1),[c,u]=Q.useState(null),d=async()=>{if(!(!i.trim()||l)){o(!0),u(null);try{const h=await Jd(i.trim());h.review&&h.state?e(h.review,h.state):u(h.error??"Failed to open review")}catch(h){u(h instanceof Error?h.message:String(h))}finally{o(!1)}}};return T.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-8 bg-bg px-4",children:[T.jsx(Hh,{className:"h-16 w-auto text-fg/80"}),T.jsxs("div",{className:"w-full max-w-sm",children:[T.jsx("p",{className:"mb-4 text-center font-sans text-[13px] text-muted",children:"Open a pull request to begin reviewing"}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx("input",{type:"text",value:i,onChange:h=>a(h.target.value),onKeyDown:h=>{h.key==="Enter"&&d()},placeholder:"owner/repo#123 or PR URL",disabled:l,autoFocus:!0,className:"min-w-0 flex-1 rounded-md border border-edge bg-surface px-3 py-2 font-mono text-[12.5px] text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none disabled:opacity-50"}),T.jsx("button",{onClick:()=>void d(),disabled:l||!i.trim(),className:"rounded-md bg-accent px-4 py-2 text-[12.5px] font-semibold text-bg transition hover:brightness-110 disabled:opacity-50",children:l?"Opening…":"Open"})]}),c&&T.jsx(nr,{className:"mt-3 text-[12px]",children:c})]})]})}function ux(e){return String(e).padStart(2,"0")}function OC({pr:e,meta:i,chunks:a,index:l,viewed:o,flagged:c,commented:u,commentCount:d,submitted:h,onJump:m,onOpenHelp:g,onOpenReviews:y,onSubmit:b}){const{theme:x,toggle:S}=Xv();return T.jsxs("header",{className:"shrink-0 border-b border-edge bg-surface",children:[T.jsxs("div",{className:"shell flex items-center justify-between gap-6 pt-3",children:[T.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[T.jsx(Hh,{className:"h-8 w-auto shrink-0 text-fg"}),T.jsx("span",{className:"h-8 w-px shrink-0 bg-edge","aria-hidden":!0}),T.jsxs("div",{className:"min-w-0",children:[T.jsx("div",{className:"truncate text-[14px] font-medium text-fg",children:i.title}),T.jsxs("div",{className:"mt-0.5 font-mono text-[11px] text-faint",children:[e.owner,"/",e.repo,"#",e.number,T.jsx("span",{className:"text-edge-strong",children:" · "}),i.base_ref," ← ",i.head_ref,i.is_draft&&T.jsx("span",{className:"ml-2 text-accent",children:"draft"})]})]})]}),T.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[T.jsx("div",{className:"font-mono text-[13px] tabular-nums",children:l<0?T.jsx("span",{className:"text-accent",children:"Overview"}):T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"text-accent",children:ux(l+1)}),T.jsxs("span",{className:"text-faint",children:[" / ",ux(a.length)]})]})}),h?T.jsx("span",{title:"Review submitted to GitHub",className:"rounded-md border border-emerald-400/40 bg-emerald-400/[0.08] px-2.5 py-1 font-sans text-[11.5px] font-semibold text-emerald-300",children:"✓ Submitted"}):T.jsxs("button",{onClick:b,title:"Submit review to GitHub",className:"flex items-center gap-1.5 rounded-md bg-accent px-3 py-1 text-[12px] font-semibold text-bg transition hover:brightness-110",children:["Submit",d>0&&T.jsx("span",{className:"rounded-full bg-bg/25 px-1.5 font-mono text-[11px] tabular-nums",children:d})]}),T.jsx("button",{onClick:y,"aria-label":"Reviews",title:"View / switch reviews",className:"rounded border border-edge-strong px-2 py-0.5 font-sans text-[11.5px] text-muted transition hover:border-fg/40 hover:text-fg",children:"Reviews"}),T.jsx("button",{onClick:S,"aria-label":x==="dark"?"Switch to light mode":"Switch to dark mode",title:x==="dark"?"Switch to light mode":"Switch to dark mode",className:"rounded border border-edge-strong p-1 text-muted transition hover:border-fg/40 hover:text-fg",children:x==="dark"?T.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[T.jsx("circle",{cx:"12",cy:"12",r:"4"}),T.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"5"}),T.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),T.jsx("line",{x1:"2",y1:"12",x2:"5",y2:"12"}),T.jsx("line",{x1:"19",y1:"12",x2:"22",y2:"12"}),T.jsx("line",{x1:"4.93",y1:"4.93",x2:"7.07",y2:"7.07"}),T.jsx("line",{x1:"16.93",y1:"16.93",x2:"19.07",y2:"19.07"}),T.jsx("line",{x1:"4.93",y1:"19.07",x2:"7.07",y2:"16.93"}),T.jsx("line",{x1:"16.93",y1:"7.07",x2:"19.07",y2:"4.93"})]}):T.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:T.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}),T.jsx("button",{onClick:g,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts (?)",className:"rounded border border-edge-strong px-1.5 font-mono text-[12px] text-muted transition hover:border-fg/40 hover:text-fg",children:"?"})]})]}),T.jsxs("div",{className:"shell flex h-[18px] items-end gap-[3px] pb-2",children:[T.jsx("button",{onClick:()=>m(-1),title:"Overview","aria-label":"Overview",className:`mr-1 h-[11px] w-[11px] shrink-0 rounded-sm transition-all ${l<0?"bg-accent":"bg-edge-strong hover:bg-fg/40"}`}),a.map((k,C)=>{const A=C===l,z=c.includes(k.id)?"flagged":u.includes(k.id)?"commented":o.includes(k.id)?"viewed":"unviewed",D=A?"bg-accent":z==="flagged"?"bg-orange-400/75":z==="commented"?"bg-violet-400/75":z==="viewed"?"bg-emerald-400/40":"bg-edge-strong hover:bg-fg/40";return T.jsx("button",{onClick:()=>m(C),title:`${k.id} · ${k.file}${A?"":` · ${z}`}`,"aria-label":`Go to chunk ${C+1}: ${k.file} (${z})`,className:`flex-1 rounded-full transition-all ${D} ${A?"h-[11px]":"h-[5px]"}`},k.id)})]})]})}const DC=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function zC(e){const i=[];let a=0,l=0;for(const o of e.split(`
57
+ `),()=>{var F;(F=d.current)==null||F.removeAttribute("data-motion-pop-id"),$.contains(X)&&$.removeChild(X)}},[i]),T.jsx(l_,{isPresent:i,childRef:d,sizeRef:h,pop:c,children:c===!1?e:Q.cloneElement(e,{ref:y})})}const o_=({children:e,initial:i,isPresent:a,onExitComplete:l,custom:o,presenceAffectsLayout:c,mode:u,anchorX:d,anchorY:h,root:m})=>{const g=hh(u_),y=Q.useId();let b=!0,x=Q.useMemo(()=>(b=!1,{id:y,initial:i,isPresent:a,custom:o,onExitComplete:S=>{g.set(S,!0);for(const k of g.values())if(!k)return;l&&l()},register:S=>(g.set(S,!1),()=>g.delete(S))}),[a,g,l]);return c&&b&&(x={...x}),Q.useMemo(()=>{g.forEach((S,k)=>g.set(k,!1))},[a]),Q.useEffect(()=>{!a&&!g.size&&l&&l()},[a]),e=T.jsx(s_,{pop:u==="popLayout",isPresent:a,anchorX:d,anchorY:h,root:m,children:e}),T.jsx(Au.Provider,{value:x,children:e})};function u_(){return new Map}function Dv(e=!0){const i=Q.useContext(Au);if(i===null)return[!0,null];const{isPresent:a,onExitComplete:l,register:o}=i,c=Q.useId();Q.useEffect(()=>{if(e)return o(c)},[e]);const u=Q.useCallback(()=>e&&l&&l(c),[c,l,e]);return!a&&l?[!1,u]:[!0]}const Xo=e=>e.key||"";function Xb(e){const i=[];return Q.Children.forEach(e,a=>{Q.isValidElement(a)&&i.push(a)}),i}const c_=({children:e,custom:i,initial:a=!0,onExitComplete:l,presenceAffectsLayout:o=!0,mode:c="sync",propagate:u=!1,anchorX:d="left",anchorY:h="top",root:m})=>{const[g,y]=Dv(u),b=Q.useMemo(()=>Xb(e),[e]),x=u&&!g?[]:b.map(Xo),S=Q.useRef(!0),k=Q.useRef(b),C=hh(()=>new Map),A=Q.useRef(new Set),[z,D]=Q.useState(b),[q,I]=Q.useState(b);s0(()=>{S.current=!1,k.current=b;for(let $=0;$<q.length;$++){const F=Xo(q[$]);x.includes(F)?(C.delete(F),A.current.delete(F)):C.get(F)!==!0&&C.set(F,!1)}},[q,x.length,x.join("-")]);const L=[];if(b!==z){let $=[...b];for(let F=0;F<q.length;F++){const R=q[F],ie=Xo(R);x.includes(ie)||($.splice(F,0,R),L.push(R))}return c==="wait"&&L.length&&($=L),I(Xb($)),D(b),null}const{forceRender:X}=Q.useContext(dh);return T.jsx(T.Fragment,{children:q.map($=>{const F=Xo($),R=u&&!g?!1:b===q||x.includes(F),ie=()=>{if(A.current.has(F))return;if(C.has(F))A.current.add(F),C.set(F,!0);else return;let re=!0;C.forEach(ve=>{ve||(re=!1)}),re&&(X==null||X(),I(k.current),u&&(y==null||y()),l&&l())};return T.jsx(o_,{isPresent:R,initial:!S.current||a?void 0:!1,custom:i,presenceAffectsLayout:o,mode:c,root:m,onExitComplete:R?void 0:ie,anchorX:d,anchorY:h,children:$},F)})})},zv=Q.createContext({strict:!1}),Kb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Zb=!1;function f_(){if(Zb)return;const e={};for(const i in Kb)e[i]={isEnabled:a=>Kb[i].some(l=>!!a[l])};uv(e),Zb=!0}function Lv(){return f_(),KA()}function d_(e){const i=Lv();for(const a in e)i[a]={...i[a],...e[a]};uv(i)}const h_=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function xu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||h_.has(e)}let Bv=e=>!xu(e);function m_(e){typeof e=="function"&&(Bv=i=>i.startsWith("on")?!xu(i):e(i))}try{m_(require("@emotion/is-prop-valid").default)}catch{}function p_(e,i,a){const l={};for(const o in e)o==="values"&&typeof e.values=="object"||Jt(e[o])||(Bv(o)||a===!0&&xu(o)||!i&&!xu(o)||e.draggable&&o.startsWith("onDrag"))&&(l[o]=e[o]);return l}const Nu=Q.createContext({});function g_(e,i){if(Cu(e)){const{initial:a,animate:l}=e;return{initial:a===!1||ys(a)?a:void 0,animate:ys(l)?l:void 0}}return e.inherit!==!1?i:{}}function y_(e){const{initial:i,animate:a}=g_(e,Q.useContext(Nu));return Q.useMemo(()=>({initial:i,animate:a}),[Qb(i),Qb(a)])}function Qb(e){return Array.isArray(e)?e.join(" "):e}const Uh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jv(e,i,a){for(const l in i)!Jt(i[l])&&!gv(l,a)&&(e[l]=i[l])}function b_({transformTemplate:e},i){return Q.useMemo(()=>{const a=Uh();return Lh(a,i,e),Object.assign({},a.vars,a.style)},[i])}function x_(e,i){const a=e.style||{},l={};return jv(l,a,e),Object.assign(l,b_(e,i)),l}function v_(e,i){const a={},l=x_(e,i);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,l.userSelect=l.WebkitUserSelect=l.WebkitTouchCallout="none",l.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=l,a}const Uv=()=>({...Uh(),attrs:{}});function S_(e,i,a,l){const o=Q.useMemo(()=>{const c=Uv();return yv(c,i,xv(l),e.transformTemplate,e.style),{...c.attrs,style:{...c.style}}},[i]);if(e.style){const c={};jv(c,e.style,e),o.style={...c,...o.style}}return o}const E_=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Vh(e){return typeof e!="string"||e.includes("-")?!1:!!(E_.indexOf(e)>-1||/[A-Z]/u.test(e))}function T_(e,i,a,{latestValues:l},o,c=!1,u){const h=(u??Vh(e)?S_:v_)(i,l,o,e),m=p_(i,typeof e=="string",c),g=e!==Q.Fragment?{...m,...h,ref:a}:{},{children:y}=i,b=Q.useMemo(()=>Jt(y)?y.get():y,[y]);return Q.createElement(e,{...g,children:b})}function w_({scrapeMotionValuesFromProps:e,createRenderState:i},a,l,o){return{latestValues:A_(a,l,o,e),renderState:i()}}function A_(e,i,a,l){const o={},c=l(e,{});for(const b in c)o[b]=lu(c[b]);let{initial:u,animate:d}=e;const h=Cu(e),m=sv(e);i&&m&&!h&&e.inherit!==!1&&(u===void 0&&(u=i.initial),d===void 0&&(d=i.animate));let g=a?a.initial===!1:!1;g=g||u===!1;const y=g?d:u;if(y&&typeof y!="boolean"&&!_u(y)){const b=Array.isArray(y)?y:[y];for(let x=0;x<b.length;x++){const S=Ch(e,b[x]);if(S){const{transitionEnd:k,transition:C,...A}=S;for(const z in A){let D=A[z];if(Array.isArray(D)){const q=g?D.length-1:0;D=D[q]}D!==null&&(o[z]=D)}for(const z in k)o[z]=k[z]}}}return o}const Vv=e=>(i,a)=>{const l=Q.useContext(Nu),o=Q.useContext(Au),c=()=>w_(e,i,l,o);return a?c():hh(c)},k_=Vv({scrapeMotionValuesFromProps:Bh,createRenderState:Uh}),__=Vv({scrapeMotionValuesFromProps:vv,createRenderState:Uv}),C_=Symbol.for("motionComponentSymbol");function N_(e,i,a){const l=Q.useRef(a);Q.useInsertionEffect(()=>{l.current=a});const o=Q.useRef(null);return Q.useCallback(c=>{var d;c&&((d=e.onMount)==null||d.call(e,c)),i&&(c?i.mount(c):i.unmount());const u=l.current;if(typeof u=="function")if(c){const h=u(c);typeof h=="function"&&(o.current=h)}else o.current?(o.current(),o.current=null):u(c);else u&&(u.current=c)},[i])}const Hv=Q.createContext({});function Xr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function M_(e,i,a,l,o,c){var D,q;const{visualElement:u}=Q.useContext(Nu),d=Q.useContext(zv),h=Q.useContext(Au),m=Q.useContext(jh),g=m.reducedMotion,y=m.skipAnimations,b=Q.useRef(null),x=Q.useRef(!1);l=l||d.renderer,!b.current&&l&&(b.current=l(e,{visualState:i,parent:u,props:a,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:g,skipAnimations:y,isSVG:c}),x.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const S=b.current,k=Q.useContext(Hv);S&&!S.projection&&o&&(S.type==="html"||S.type==="svg")&&R_(b.current,a,o,k);const C=Q.useRef(!1);Q.useInsertionEffect(()=>{S&&C.current&&S.update(a,h)});const A=a[Z0],z=Q.useRef(!!A&&typeof window<"u"&&!((D=window.MotionHandoffIsComplete)!=null&&D.call(window,A))&&((q=window.MotionHasOptimisedAnimation)==null?void 0:q.call(window,A)));return s0(()=>{x.current=!0,S&&(C.current=!0,window.MotionIsMounted=!0,S.updateFeatures(),S.scheduleRenderMicrotask(),z.current&&S.animationState&&S.animationState.animateChanges())}),Q.useEffect(()=>{S&&(!z.current&&S.animationState&&S.animationState.animateChanges(),z.current&&(queueMicrotask(()=>{var I;(I=window.MotionHandoffMarkAsComplete)==null||I.call(window,A)}),z.current=!1),S.enteringChildren=void 0)}),S}function R_(e,i,a,l){const{layoutId:o,layout:c,drag:u,dragConstraints:d,layoutScroll:h,layoutRoot:m,layoutAnchor:g,layoutCrossfade:y}=i;e.projection=new a(e.latestValues,i["data-framer-portal-id"]?void 0:Iv(e.parent)),e.projection.setOptions({layoutId:o,layout:c,alwaysMeasureLayout:!!u||d&&Xr(d),visualElement:e,animationType:typeof c=="string"?c:"both",initialPromotionConfig:l,crossfade:y,layoutScroll:h,layoutRoot:m,layoutAnchor:g})}function Iv(e){if(e)return e.options.allowProjection!==!1?e.projection:Iv(e.parent)}function ed(e,{forwardMotionProps:i=!1,type:a}={},l,o){l&&d_(l);const c=a?a==="svg":Vh(e),u=c?__:k_;function d(m,g){let y;const b={...Q.useContext(jh),...m,layoutId:O_(m)},{isStatic:x}=b,S=y_(m),k=u(m,x);if(!x&&typeof window<"u"){D_();const C=z_(b);y=C.MeasureLayout,S.visualElement=M_(e,k,b,o,C.ProjectionNode,c)}return T.jsxs(Nu.Provider,{value:S,children:[y&&S.visualElement?T.jsx(y,{visualElement:S.visualElement,...b}):null,T_(e,m,N_(k,S.visualElement,g),k,x,i,c)]})}d.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=Q.forwardRef(d);return h[C_]=e,h}function O_({layoutId:e}){const i=Q.useContext(dh).id;return i&&e!==void 0?i+"-"+e:e}function D_(e,i){Q.useContext(zv).strict}function z_(e){const i=Lv(),{drag:a,layout:l}=i;if(!a&&!l)return{};const o={...a,...l};return{MeasureLayout:a!=null&&a.isEnabled(e)||l!=null&&l.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function L_(e,i){if(typeof Proxy>"u")return ed;const a=new Map,l=(c,u)=>ed(c,u,e,i),o=(c,u)=>l(c,u);return new Proxy(o,{get:(c,u)=>u==="create"?l:(a.has(u)||a.set(u,ed(u,void 0,e,i)),a.get(u))})}const B_=(e,i)=>i.isSVG??Vh(e)?new fk(i):new rk(i,{allowProjection:e!==Q.Fragment});class j_ extends wa{constructor(i){super(i),i.animationState||(i.animationState=gk(i))}updateAnimationControlsSubscription(){const{animate:i}=this.node.getProps();_u(i)&&(this.unmountControls=i.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:i}=this.node.getProps(),{animate:a}=this.node.prevProps||{};i!==a&&this.updateAnimationControlsSubscription()}unmount(){var i;this.node.animationState.reset(),(i=this.unmountControls)==null||i.call(this)}}let U_=0;class V_ extends wa{constructor(){super(...arguments),this.id=U_++,this.isExitComplete=!1}update(){var c;if(!this.node.presenceContext)return;const{isPresent:i,onExitComplete:a}=this.node.presenceContext,{isPresent:l}=this.node.prevPresenceContext||{};if(!this.node.animationState||i===l)return;if(i&&l===!1){if(this.isExitComplete){const{initial:u,custom:d}=this.node.getProps();if(typeof u=="string"||typeof u=="object"&&u!==null&&!Array.isArray(u)){const h=tr(this.node,u,d);if(h){const{transition:m,transitionEnd:g,...y}=h;for(const b in y)(c=this.node.getValue(b))==null||c.jump(y[b])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!i);a&&!i&&o.then(()=>{this.isExitComplete=!0,a(this.id)})}mount(){const{register:i,onExitComplete:a}=this.node.presenceContext||{};a&&a(this.id),i&&(this.unmount=i(this.id))}unmount(){}}const H_={animation:{Feature:j_},exit:{Feature:V_}};function ws(e){return{point:{x:e.pageX,y:e.pageY}}}const I_=e=>i=>Rh(i)&&e(i,ws(i));function fs(e,i,a,l){return bs(e,i,I_(a),l)}const Pv=({current:e})=>e?e.ownerDocument.defaultView:null,$b=(e,i)=>Math.abs(e-i);function P_(e,i){const a=$b(e.x,i.x),l=$b(e.y,i.y);return Math.sqrt(a**2+l**2)}const Jb=new Set(["auto","scroll"]);class qv{constructor(i,a,{transformPagePoint:l,contextWindow:o=window,dragSnapToOrigin:c=!1,distanceThreshold:u=3,element:d}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ko(this.lastRawMoveEventInfo,this.transformPagePoint));const x=td(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,k=P_(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!k)return;const{point:C}=x,{timestamp:A}=$t;this.history.push({...C,timestamp:A});const{onStart:z,onMove:D}=this.handlers;S||(z&&z(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),D&&D(this.lastMoveEvent,x)},this.handlePointerMove=(x,S)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=S,this.lastMoveEventInfo=Ko(S,this.transformPagePoint),mt.update(this.updatePoint,!0)},this.handlePointerUp=(x,S)=>{this.end();const{onEnd:k,onSessionEnd:C,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const z=td(x.type==="pointercancel"?this.lastMoveEventInfo:Ko(S,this.transformPagePoint),this.history);this.startEvent&&k&&k(x,z),C&&C(x,z)},!Rh(i))return;this.dragSnapToOrigin=c,this.handlers=a,this.transformPagePoint=l,this.distanceThreshold=u,this.contextWindow=o||window;const h=ws(i),m=Ko(h,this.transformPagePoint),{point:g}=m,{timestamp:y}=$t;this.history=[{...g,timestamp:y}];const{onSessionStart:b}=a;b&&b(i,td(m,this.history)),this.removeListeners=Ss(fs(this.contextWindow,"pointermove",this.handlePointerMove),fs(this.contextWindow,"pointerup",this.handlePointerUp),fs(this.contextWindow,"pointercancel",this.handlePointerUp)),d&&this.startScrollTracking(d)}startScrollTracking(i){let a=i.parentElement;for(;a;){const l=getComputedStyle(a);(Jb.has(l.overflowX)||Jb.has(l.overflowY))&&this.scrollPositions.set(a,{x:a.scrollLeft,y:a.scrollTop}),a=a.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(i){const a=this.scrollPositions.get(i);if(!a)return;const l=i===window,o=l?{x:window.scrollX,y:window.scrollY}:{x:i.scrollLeft,y:i.scrollTop},c={x:o.x-a.x,y:o.y-a.y};c.x===0&&c.y===0||(l?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=c.x,this.lastMoveEventInfo.point.y+=c.y):this.history.length>0&&(this.history[0].x-=c.x,this.history[0].y-=c.y),this.scrollPositions.set(i,o),mt.update(this.updatePoint,!0))}updateHandlers(i){this.handlers=i}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ta(this.updatePoint)}}function Ko(e,i){return i?{point:i(e.point)}:e}function Wb(e,i){return{x:e.x-i.x,y:e.y-i.y}}function td({point:e},i){return{point:e,delta:Wb(e,Fv(i)),offset:Wb(e,q_(i)),velocity:F_(i,.1)}}function q_(e){return e[0]}function Fv(e){return e[e.length-1]}function F_(e,i){if(e.length<2)return{x:0,y:0};let a=e.length-1,l=null;const o=Fv(e);for(;a>=0&&(l=e[a],!(o.timestamp-l.timestamp>Bn(i)));)a--;if(!l)return{x:0,y:0};l===e[0]&&e.length>2&&o.timestamp-l.timestamp>Bn(i)*2&&(l=e[1]);const c=Zn(o.timestamp-l.timestamp);if(c===0)return{x:0,y:0};const u={x:(o.x-l.x)/c,y:(o.y-l.y)/c};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function G_(e,{min:i,max:a},l){return i!==void 0&&e<i?e=l?ht(i,e,l.min):Math.max(e,i):a!==void 0&&e>a&&(e=l?ht(a,e,l.max):Math.min(e,a)),e}function ex(e,i,a){return{min:i!==void 0?e.min+i:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function Y_(e,{top:i,left:a,bottom:l,right:o}){return{x:ex(e.x,a,o),y:ex(e.y,i,l)}}function tx(e,i){let a=i.min-e.min,l=i.max-e.max;return i.max-i.min<e.max-e.min&&([a,l]=[l,a]),{min:a,max:l}}function X_(e,i){return{x:tx(e.x,i.x),y:tx(e.y,i.y)}}function K_(e,i){let a=.5;const l=mn(e),o=mn(i);return o>l?a=ps(i.min,i.max-l,e.min):l>o&&(a=ps(e.min,e.max-o,i.min)),bi(0,1,a)}function Z_(e,i){const a={};return i.min!==void 0&&(a.min=i.min-e.min),i.max!==void 0&&(a.max=i.max-e.min),a}const Qd=.35;function Q_(e=Qd){return e===!1?e=0:e===!0&&(e=Qd),{x:nx(e,"left","right"),y:nx(e,"top","bottom")}}function nx(e,i,a){return{min:ix(e,i),max:ix(e,a)}}function ix(e,i){return typeof e=="number"?e:e[i]||0}const $_=new WeakMap;class J_{constructor(i){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=qt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=i}start(i,{snapToCursor:a=!1,distanceThreshold:l}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const c=y=>{a&&this.snapToCursor(ws(y).point),this.stopAnimation()},u=(y,b)=>{const{drag:x,dragPropagation:S,onDragStart:k}=this.getProps();if(x&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wA(x),!this.openDragLock))return;this.latestPointerEvent=y,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),mi(A=>{let z=this.getAxisMotionValue(A).get()||0;if(yi.test(z)){const{projection:D}=this.visualElement;if(D&&D.layout){const q=D.layout.layoutBox[A];q&&(z=mn(q)*(parseFloat(z)/100))}}this.originPoint[A]=z}),k&&mt.update(()=>k(y,b),!1,!0),Hd(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},d=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b;const{dragPropagation:x,dragDirectionLock:S,onDirectionLock:k,onDrag:C}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:A}=b;if(S&&this.currentDirection===null){this.currentDirection=eC(A),this.currentDirection!==null&&k&&k(this.currentDirection);return}this.updateAxis("x",b.point,A),this.updateAxis("y",b.point,A),this.visualElement.render(),C&&mt.update(()=>C(y,b),!1,!0)},h=(y,b)=>{this.latestPointerEvent=y,this.latestPanInfo=b,this.stop(y,b),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>{const{dragSnapToOrigin:y}=this.getProps();(y||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:g}=this.getProps();this.panSession=new qv(i,{onSessionStart:c,onStart:u,onMove:d,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:l,contextWindow:Pv(this.visualElement),element:this.visualElement.current})}stop(i,a){const l=i||this.latestPointerEvent,o=a||this.latestPanInfo,c=this.isDragging;if(this.cancel(),!c||!o||!l)return;const{velocity:u}=o;this.startAnimation(u);const{onDragEnd:d}=this.getProps();d&&mt.postRender(()=>d(l,o))}cancel(){this.isDragging=!1;const{projection:i,animationState:a}=this.visualElement;i&&(i.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:l}=this.getProps();!l&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(i,a,l){const{drag:o}=this.getProps();if(!l||!Zo(i,o,this.currentDirection))return;const c=this.getAxisMotionValue(i);let u=this.originPoint[i]+l[i];this.constraints&&this.constraints[i]&&(u=G_(u,this.constraints[i],this.elastic[i])),c.set(u)}resolveConstraints(){var c;const{dragConstraints:i,dragElastic:a}=this.getProps(),l=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(c=this.visualElement.projection)==null?void 0:c.layout,o=this.constraints;i&&Xr(i)?this.constraints||(this.constraints=this.resolveRefConstraints()):i&&l?this.constraints=Y_(l.layoutBox,i):this.constraints=!1,this.elastic=Q_(a),o!==this.constraints&&!Xr(i)&&l&&this.constraints&&!this.hasMutatedConstraints&&mi(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=Z_(l.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:i,onMeasureDragConstraints:a}=this.getProps();if(!i||!Xr(i))return!1;const l=i.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;o.root&&(o.root.scroll=void 0,o.root.updateScroll());const c=WA(l,o.root,this.visualElement.getTransformPagePoint());let u=X_(o.layout.layoutBox,c);if(a){const d=a(QA(u));this.hasMutatedConstraints=!!d,d&&(u=fv(d))}return u}startAnimation(i){const{drag:a,dragMomentum:l,dragElastic:o,dragTransition:c,dragSnapToOrigin:u,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},m=mi(g=>{if(!Zo(g,a,this.currentDirection))return;let y=h&&h[g]||{};(u===!0||u===g)&&(y={min:0,max:0});const b=o?200:1e6,x=o?40:1e7,S={type:"inertia",velocity:l?i[g]:0,bounceStiffness:b,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...c,...y};return this.startAxisValueAnimation(g,S)});return Promise.all(m).then(d)}startAxisValueAnimation(i,a){const l=this.getAxisMotionValue(i);return Hd(this.visualElement,i),l.start(_h(i,l,0,a,this.visualElement,!1))}stopAnimation(){mi(i=>this.getAxisMotionValue(i).stop())}getAxisMotionValue(i){const a=`_drag${i.toUpperCase()}`,o=this.visualElement.getProps()[a];return o||this.visualElement.getValue(i,this.visualElement.latestValues[i]??0)}snapToCursor(i){mi(a=>{const{drag:l}=this.getProps();if(!Zo(a,l,this.currentDirection))return;const{projection:o}=this.visualElement,c=this.getAxisMotionValue(a);if(o&&o.layout){const{min:u,max:d}=o.layout.layoutBox[a],h=c.get()||0;c.set(i[a]-ht(u,d,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:i,dragConstraints:a}=this.getProps(),{projection:l}=this.visualElement;if(!Xr(a)||!l||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};mi(u=>{const d=this.getAxisMotionValue(u);if(d&&this.constraints!==!1){const h=d.get();o[u]=K_({min:h,max:h},this.constraints[u])}});const{transformTemplate:c}=this.visualElement.getProps();this.visualElement.current.style.transform=c?c({},""):"none",l.root&&l.root.updateScroll(),l.updateLayout(),this.constraints=!1,this.resolveConstraints(),mi(u=>{if(!Zo(u,i,null))return;const d=this.getAxisMotionValue(u),{min:h,max:m}=this.constraints[u];d.set(ht(h,m,o[u]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;$_.set(this.visualElement,this);const i=this.visualElement.current,a=fs(i,"pointerdown",m=>{const{drag:g,dragListener:y=!0}=this.getProps(),b=m.target,x=b!==i&&MA(b);g&&y&&!x&&this.start(m)});let l;const o=()=>{const{dragConstraints:m}=this.getProps();Xr(m)&&m.current&&(this.constraints=this.resolveRefConstraints(),l||(l=W_(i,m.current,()=>this.scalePositionWithinConstraints())))},{projection:c}=this.visualElement,u=c.addEventListener("measure",o);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),mt.read(o);const d=bs(window,"resize",()=>this.scalePositionWithinConstraints()),h=c.addEventListener("didUpdate",(({delta:m,hasLayoutChanged:g})=>{this.isDragging&&g&&(mi(y=>{const b=this.getAxisMotionValue(y);b&&(this.originPoint[y]+=m[y].translate,b.set(b.get()+m[y].translate))}),this.visualElement.render())}));return()=>{d(),a(),u(),h&&h(),l&&l()}}getProps(){const i=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:l=!1,dragPropagation:o=!1,dragConstraints:c=!1,dragElastic:u=Qd,dragMomentum:d=!0}=i;return{...i,drag:a,dragDirectionLock:l,dragPropagation:o,dragConstraints:c,dragElastic:u,dragMomentum:d}}}function ax(e){let i=!0;return()=>{if(i){i=!1;return}e()}}function W_(e,i,a){const l=fb(e,ax(a)),o=fb(i,ax(a));return()=>{l(),o()}}function Zo(e,i,a){return(i===!0||i===e)&&(a===null||a===e)}function eC(e,i=10){let a=null;return Math.abs(e.y)>i?a="y":Math.abs(e.x)>i&&(a="x"),a}class tC extends wa{constructor(i){super(i),this.removeGroupControls=Qn,this.removeListeners=Qn,this.controls=new J_(i)}mount(){const{dragControls:i}=this.node.getProps();i&&(this.removeGroupControls=i.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qn}update(){const{dragControls:i}=this.node.getProps(),{dragControls:a}=this.node.prevProps||{};i!==a&&(this.removeGroupControls(),i&&(this.removeGroupControls=i.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const nd=e=>(i,a)=>{e&&mt.update(()=>e(i,a),!1,!0)};class nC extends wa{constructor(){super(...arguments),this.removePointerDownListener=Qn}onPointerDown(i){this.session=new qv(i,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Pv(this.node)})}createPanHandlers(){const{onPanSessionStart:i,onPanStart:a,onPan:l,onPanEnd:o}=this.node.getProps();return{onSessionStart:nd(i),onStart:nd(a),onMove:nd(l),onEnd:(c,u)=>{delete this.session,o&&mt.postRender(()=>o(c,u))}}}mount(){this.removePointerDownListener=fs(this.node.current,"pointerdown",i=>this.onPointerDown(i))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let id=!1;class iC extends Q.Component{componentDidMount(){const{visualElement:i,layoutGroup:a,switchLayoutGroup:l,layoutId:o}=this.props,{projection:c}=i;c&&(a.group&&a.group.add(c),l&&l.register&&o&&l.register(c),id&&c.root.didUpdate(),c.addEventListener("animationComplete",()=>{this.safeToRemove()}),c.setOptions({...c.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),su.hasEverUpdated=!0}getSnapshotBeforeUpdate(i){const{layoutDependency:a,visualElement:l,drag:o,isPresent:c}=this.props,{projection:u}=l;return u&&(u.isPresent=c,i.layoutDependency!==a&&u.setOptions({...u.options,layoutDependency:a}),id=!0,o||i.layoutDependency!==a||a===void 0||i.isPresent!==c?u.willUpdate():this.safeToRemove(),i.isPresent!==c&&(c?u.promote():u.relegate()||mt.postRender(()=>{const d=u.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:i,layoutAnchor:a}=this.props,{projection:l}=i;l&&(l.options.layoutAnchor=a,l.root.didUpdate(),Mh.postRender(()=>{!l.currentAnimation&&l.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:i,layoutGroup:a,switchLayoutGroup:l}=this.props,{projection:o}=i;id=!0,o&&(o.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(o),l&&l.deregister&&l.deregister(o))}safeToRemove(){const{safeToRemove:i}=this.props;i&&i()}render(){return null}}function Gv(e){const[i,a]=Dv(),l=Q.useContext(dh);return T.jsx(iC,{...e,layoutGroup:l,switchLayoutGroup:Q.useContext(Hv),isPresent:i,safeToRemove:a})}const aC={pan:{Feature:nC},drag:{Feature:tC,ProjectionNode:Ov,MeasureLayout:Gv}};function rx(e,i,a){const{props:l}=e;e.animationState&&l.whileHover&&e.animationState.setActive("whileHover",a==="Start");const o="onHover"+a,c=l[o];c&&mt.postRender(()=>c(i,ws(i)))}class rC extends wa{mount(){const{current:i}=this.node;i&&(this.unmount=kA(i,(a,l)=>(rx(this.node,l,"Start"),o=>rx(this.node,o,"End"))))}unmount(){}}class lC extends wa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let i=!1;try{i=this.node.current.matches(":focus-visible")}catch{i=!0}!i||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ss(bs(this.node.current,"focus",()=>this.onFocus()),bs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function lx(e,i,a){const{props:l}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&l.whileTap&&e.animationState.setActive("whileTap",a==="Start");const o="onTap"+(a==="End"?"":a),c=l[o];c&&mt.postRender(()=>c(i,ws(i)))}class sC extends wa{mount(){const{current:i}=this.node;if(!i)return;const{globalTapTarget:a,propagate:l}=this.node.props;this.unmount=OA(i,(o,c)=>(lx(this.node,c,"Start"),(u,{success:d})=>lx(this.node,u,d?"End":"Cancel")),{useGlobalTarget:a,stopPropagation:(l==null?void 0:l.tap)===!1})}unmount(){}}const $d=new WeakMap,ad=new WeakMap,oC=e=>{const i=$d.get(e.target);i&&i(e)},uC=e=>{e.forEach(oC)};function cC({root:e,...i}){const a=e||document;ad.has(a)||ad.set(a,{});const l=ad.get(a),o=JSON.stringify(i);return l[o]||(l[o]=new IntersectionObserver(uC,{root:e,...i})),l[o]}function fC(e,i,a){const l=cC(i);return $d.set(e,a),l.observe(e),()=>{$d.delete(e),l.unobserve(e)}}const dC={some:0,all:1};class hC extends wa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var h;(h=this.stopObserver)==null||h.call(this);const{viewport:i={}}=this.node.getProps(),{root:a,margin:l,amount:o="some",once:c}=i,u={root:a?a.current:void 0,rootMargin:l,threshold:typeof o=="number"?o:dC[o]},d=m=>{const{isIntersecting:g}=m;if(this.isInView===g||(this.isInView=g,c&&!g&&this.hasEnteredView))return;g&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",g);const{onViewportEnter:y,onViewportLeave:b}=this.node.getProps(),x=g?y:b;x&&x(m)};this.stopObserver=fC(this.node.current,u,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:i,prevProps:a}=this.node;["amount","margin","root"].some(mC(i,a))&&this.startObserver()}unmount(){var i;(i=this.stopObserver)==null||i.call(this),this.hasEnteredView=!1,this.isInView=!1}}function mC({viewport:e={}},{viewport:i={}}={}){return a=>e[a]!==i[a]}const pC={inView:{Feature:hC},tap:{Feature:sC},focus:{Feature:lC},hover:{Feature:rC}},gC={layout:{ProjectionNode:Ov,MeasureLayout:Gv}},yC={...H_,...pC,...aC,...gC},bC=L_(yC,B_),sx="__overview__",xC=["APPROVE","COMMENT","REQUEST_CHANGES"];async function vC(){const e=await fetch("/api/review");if(e.status===204)return null;if(!e.ok)throw new Error(`/api/review returned ${e.status}`);return await e.json()}async function SC(){const e=await fetch("/api/state");if(e.status===204)return null;if(!e.ok)throw new Error(`/api/state returned ${e.status}`);return await e.json()}async function EC(){const e=await fetch("/api/review",{method:"DELETE"});if(!e.ok)throw new Error(`DELETE /api/review returned ${e.status}`)}async function TC(e){const i=await fetch("/api/action",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!i.ok)throw new Error(`/api/action returned ${i.status}`);return await i.json()}async function wC(e,i){return await(await fetch("/api/submit",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({verdict:e,body:i})})).json()}function AC(e,i){const a=new URL("/api/claude",location.origin);a.searchParams.set("chunk_id",e.chunkId),e.question.trim()&&a.searchParams.set("q",e.question.trim());const l=new EventSource(a.toString());let o=!1;const c=()=>{o=!0,l.close()};return l.addEventListener("delta",u=>{o||i.onDelta(JSON.parse(u.data).text)}),l.addEventListener("done",u=>{o||(i.onDone(JSON.parse(u.data).state),c())}),l.addEventListener("error",u=>{if(o)return;const d=u.data;let h="Claude request failed (connection lost)";if(d)try{h=JSON.parse(d).message}catch{}i.onError(h),c()}),c}async function kC(){const e=await fetch("/api/reviews");if(!e.ok)throw new Error(`/api/reviews returned ${e.status}`);return await e.json()}async function ox(e){const i=await fetch(`/api/reviews/${e.owner}/${e.repo}/${e.number}`,{method:"DELETE"});if(!i.ok)throw new Error(`DELETE /api/reviews returned ${i.status}`)}async function Jd(e){const i=await fetch("/api/reviews/open",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({ref:e})}),a=await i.json();if(!i.ok)throw new Error(a.error??`/api/reviews/open returned ${i.status}`);return a}function nr({children:e,className:i=""}){return T.jsx("div",{className:`rounded-md border border-[var(--del-fg)]/30 bg-[var(--del-bg)] px-3 py-1.5 font-sans text-[12px] text-[var(--del-fg)] ${i}`,children:e})}function va(e){return`${e.owner}/${e.repo}#${e.number}`}function rd(e){var i;return((i=e.meta)==null?void 0:i.title)??va(e.pr)}function _C({s:e}){const i=[];return e.viewed_count>0&&i.push(`${e.viewed_count} viewed`),e.comment_count>0&&i.push(`${e.comment_count} comment${e.comment_count===1?"":"s"}`),e.flagged_count>0&&i.push(`${e.flagged_count} flagged`),e.submitted&&i.push("submitted"),T.jsx("span",{className:"font-mono text-[11px] text-faint",children:i.length?i.join(" · "):"not started"})}function CC({open:e,currentPr:i,onClose:a,onSwitched:l,onCleared:o}){const[c,u]=Q.useState(null),[d,h]=Q.useState(null),[m,g]=Q.useState(!1),[y,b]=Q.useState(null),[x,S]=Q.useState(""),[k,C]=Q.useState(!1),A=Q.useRef(null);if(Q.useEffect(()=>{e&&(h(null),kC().then(u).catch(F=>h(F instanceof Error?F.message:String(F))),setTimeout(()=>{var F;return(F=A.current)==null?void 0:F.focus()},0))},[e]),!e)return null;const z=va(i),D=(c==null?void 0:c.find(F=>va(F.pr)===z))??null,q=D?rd(D):z,I=(c==null?void 0:c.find(F=>va(F.pr)!==z))??null,L=async F=>{if(!(!F.trim()||m)){g(!0),b(null);try{const R=await Jd(F.trim());R.review&&R.state?(l(R.review,R.state),a()):b(R.error??"Failed to open review")}catch(R){b(R instanceof Error?R.message:String(R))}finally{g(!1)}}},X=async F=>{try{await ox(F),u(R=>(R==null?void 0:R.filter(ie=>va(ie.pr)!==va(F)))??null)}catch{}},$=async()=>{if(C(!1),I){g(!0),b(null);try{const F=await Jd(va(I.pr));F.review&&F.state?(await ox(i).catch(()=>{}),l(F.review,F.state),a()):b("Failed to switch reviews")}catch(F){b(F instanceof Error?F.message:String(F))}finally{g(!1)}}else await EC().catch(()=>{}),o()};return T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-[1px]",onClick:m?void 0:a,children:T.jsxs("div",{onClick:F=>F.stopPropagation(),className:"flex max-h-[85vh] w-[540px] flex-col rounded-xl border border-edge bg-surface shadow-2xl",children:[T.jsxs("div",{className:"flex items-center justify-between border-b border-edge px-5 py-3",children:[T.jsx("h2",{className:"text-[13px] font-semibold tracking-wide text-fg",children:"Reviews"}),T.jsx("button",{onClick:a,disabled:m,className:"rounded border border-edge-strong px-1.5 py-0.5 font-mono text-[11px] text-muted transition hover:text-fg disabled:opacity-40",children:"esc"})]}),T.jsxs("div",{className:"thin-scroll min-h-0 flex-1 overflow-auto px-5 py-4",children:[T.jsxs("div",{className:"mb-4",children:[T.jsx("label",{className:"mb-1.5 block font-sans text-[10px] font-semibold tracking-[0.18em] text-faint uppercase",children:"Open a review"}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx("input",{ref:A,type:"text",value:x,onChange:F=>S(F.target.value),onKeyDown:F=>{F.key==="Enter"&&L(x),F.key==="Escape"&&a()},placeholder:"owner/repo#123 or PR URL",disabled:m,className:"min-w-0 flex-1 rounded-md border border-edge bg-bg px-3 py-1.5 font-mono text-[12.5px] text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none disabled:opacity-50"}),T.jsx("button",{onClick:()=>void L(x),disabled:m||!x.trim(),className:"rounded-md bg-accent px-3 py-1.5 text-[12.5px] font-semibold text-bg transition hover:brightness-110 disabled:opacity-50",children:m?"Opening…":"Open"})]}),y&&T.jsx(nr,{className:"mt-2 text-[12px] py-1.5",children:y})]}),T.jsxs("div",{children:[T.jsx("div",{className:"mb-1.5 font-sans text-[10px] font-semibold tracking-[0.18em] text-faint uppercase",children:"Ongoing reviews"}),d?T.jsx(nr,{className:"text-[12px] py-1.5",children:d}):c===null?T.jsx("p",{className:"font-mono text-[12px] text-faint",children:"Loading…"}):c.length===0?T.jsx("p",{className:"font-sans text-[12.5px] text-faint italic",children:"No saved reviews yet."}):T.jsx("ul",{className:"space-y-1.5",children:c.map(F=>{const R=va(F.pr),ie=R===z;return T.jsxs("li",{className:`flex items-start gap-2 rounded-md border px-3 py-2 ${ie?"border-accent/40 bg-accent/[0.06]":"border-edge hover:border-edge-strong"}`,children:[T.jsxs("div",{className:"min-w-0 flex-1",children:[T.jsxs("div",{className:"truncate text-[13px] font-medium text-fg",children:[rd(F),ie&&T.jsx("span",{className:"ml-2 rounded-full bg-accent/20 px-1.5 font-mono text-[10px] text-accent",children:"current"})]}),T.jsxs("div",{className:"mt-0.5 flex items-center gap-2",children:[T.jsx("span",{className:"font-mono text-[11px] text-faint/70",children:R}),T.jsx("span",{className:"text-edge-strong",children:"·"}),T.jsx(_C,{s:F})]})]}),T.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[!ie&&T.jsx("button",{onClick:()=>void L(R),disabled:m,className:"rounded border border-edge-strong px-2 py-0.5 text-[11.5px] text-muted transition hover:border-fg/40 hover:text-fg disabled:opacity-40",children:"Switch"}),T.jsx("button",{onClick:()=>ie?C(!0):void X(F.pr),disabled:m||ie&&k,title:"Remove from list",className:"rounded border border-edge-strong px-2 py-0.5 text-[11.5px] text-muted transition hover:border-red-400/40 hover:text-red-300 disabled:opacity-40",children:"✕"})]})]},R)})})]})]}),k&&T.jsxs("div",{className:"border-t border-edge px-5 py-4",children:[T.jsxs("p",{className:"text-[13px] font-medium text-fg",children:["Delete"," ",T.jsxs("span",{className:"text-red-300",children:['"',q,'"']}),"?"]}),T.jsx("p",{className:"mt-0.5 text-[12px] text-muted",children:I?`You'll be switched to "${rd(I)}".`:"No other reviews. Your current session will end."}),y&&T.jsx(nr,{className:"mt-2 py-1.5 text-[12px]",children:y}),T.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[T.jsx("button",{onClick:()=>C(!1),disabled:m,className:"rounded border border-edge-strong px-3 py-1 text-[12px] text-muted transition hover:text-fg disabled:opacity-40",children:"Cancel"}),T.jsx("button",{onClick:()=>void $(),disabled:m,className:"rounded border border-red-400/40 bg-red-400/10 px-3 py-1 text-[12px] text-red-300 transition hover:bg-red-400/20 disabled:opacity-40",children:m?I?"Switching…":"Deleting…":"Delete"})]})]})]})})}const Yv=Q.createContext({theme:"dark",toggle:()=>{}});function NC(){try{const e=localStorage.getItem("ar-theme"),i=e==="light"?"light":e==="dark"?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";return i==="light"&&(document.documentElement.dataset.theme="light"),i}catch{return"dark"}}function MC({children:e}){const[i,a]=Q.useState(NC);Q.useEffect(()=>{document.documentElement.dataset.theme=i,localStorage.setItem("ar-theme",i)},[i]);const l=()=>a(o=>o==="dark"?"light":"dark");return T.jsx(Yv.Provider,{value:{theme:i,toggle:l},children:e})}function Xv(){return Q.useContext(Yv)}function Hh({className:e,variant:i="full"}){const{theme:a}=Xv(),l=i==="icon"?"/icon.svg":"/logo.svg",o=i==="icon"?"/icon-dark.svg":"/logo-dark.svg";return T.jsx("img",{className:e,src:a==="light"?l:o,alt:"assisted-review"})}function RC({onOpened:e}){const[i,a]=Q.useState(""),[l,o]=Q.useState(!1),[c,u]=Q.useState(null),d=async()=>{if(!(!i.trim()||l)){o(!0),u(null);try{const h=await Jd(i.trim());h.review&&h.state?e(h.review,h.state):u(h.error??"Failed to open review")}catch(h){u(h instanceof Error?h.message:String(h))}finally{o(!1)}}};return T.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-8 bg-bg px-4",children:[T.jsx(Hh,{className:"h-16 w-auto text-fg/80"}),T.jsxs("div",{className:"w-full max-w-sm",children:[T.jsx("p",{className:"mb-4 text-center font-sans text-[13px] text-muted",children:"Open a pull request to begin reviewing"}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx("input",{type:"text",value:i,onChange:h=>a(h.target.value),onKeyDown:h=>{h.key==="Enter"&&d()},placeholder:"owner/repo#123 or PR URL",disabled:l,autoFocus:!0,className:"min-w-0 flex-1 rounded-md border border-edge bg-surface px-3 py-2 font-mono text-[12.5px] text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none disabled:opacity-50"}),T.jsx("button",{onClick:()=>void d(),disabled:l||!i.trim(),className:"rounded-md bg-accent px-4 py-2 text-[12.5px] font-semibold text-bg transition hover:brightness-110 disabled:opacity-50",children:l?"Opening…":"Open"})]}),c&&T.jsx(nr,{className:"mt-3 text-[12px]",children:c})]})]})}function ux(e){return String(e).padStart(2,"0")}function OC({pr:e,meta:i,chunks:a,index:l,viewed:o,flagged:c,commented:u,commentCount:d,submitted:h,onJump:m,onOpenHelp:g,onOpenReviews:y,onSubmit:b}){const{theme:x,toggle:S}=Xv();return T.jsxs("header",{className:"shrink-0 border-b border-edge bg-surface",children:[T.jsxs("div",{className:"shell flex items-center justify-between gap-6 pt-3",children:[T.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[T.jsx(Hh,{className:"h-8 w-auto shrink-0 text-fg",variant:"icon"}),T.jsx("span",{className:"h-8 w-px shrink-0 bg-edge","aria-hidden":!0}),T.jsxs("div",{className:"min-w-0",children:[T.jsx("div",{className:"truncate text-[14px] font-medium text-fg",children:i.title}),T.jsxs("div",{className:"mt-0.5 font-mono text-[11px] text-faint",children:[e.owner,"/",e.repo,"#",e.number,T.jsx("span",{className:"text-edge-strong",children:" · "}),i.base_ref," ← ",i.head_ref,i.is_draft&&T.jsx("span",{className:"ml-2 text-accent",children:"draft"})]})]})]}),T.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[T.jsx("div",{className:"font-mono text-[13px] tabular-nums",children:l<0?T.jsx("span",{className:"text-accent",children:"Overview"}):T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"text-accent",children:ux(l+1)}),T.jsxs("span",{className:"text-faint",children:[" / ",ux(a.length)]})]})}),h?T.jsx("span",{title:"Review submitted to GitHub",className:"rounded-md border border-emerald-400/40 bg-emerald-400/[0.08] px-2.5 py-1 font-sans text-[11.5px] font-semibold text-emerald-300",children:"✓ Submitted"}):T.jsxs("button",{onClick:b,title:"Submit review to GitHub",className:"flex items-center gap-1.5 rounded-md bg-accent px-3 py-1 text-[12px] font-semibold text-bg transition hover:brightness-110",children:["Submit",d>0&&T.jsx("span",{className:"rounded-full bg-bg/25 px-1.5 font-mono text-[11px] tabular-nums",children:d})]}),T.jsx("button",{onClick:y,"aria-label":"Reviews",title:"View / switch reviews",className:"rounded border border-edge-strong px-2 py-0.5 font-sans text-[11.5px] text-muted transition hover:border-fg/40 hover:text-fg",children:"Reviews"}),T.jsx("button",{onClick:S,"aria-label":x==="dark"?"Switch to light mode":"Switch to dark mode",title:x==="dark"?"Switch to light mode":"Switch to dark mode",className:"rounded border border-edge-strong p-1 text-muted transition hover:border-fg/40 hover:text-fg",children:x==="dark"?T.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[T.jsx("circle",{cx:"12",cy:"12",r:"4"}),T.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"5"}),T.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),T.jsx("line",{x1:"2",y1:"12",x2:"5",y2:"12"}),T.jsx("line",{x1:"19",y1:"12",x2:"22",y2:"12"}),T.jsx("line",{x1:"4.93",y1:"4.93",x2:"7.07",y2:"7.07"}),T.jsx("line",{x1:"16.93",y1:"16.93",x2:"19.07",y2:"19.07"}),T.jsx("line",{x1:"4.93",y1:"19.07",x2:"7.07",y2:"16.93"}),T.jsx("line",{x1:"16.93",y1:"7.07",x2:"19.07",y2:"4.93"})]}):T.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:T.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}),T.jsx("button",{onClick:g,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts (?)",className:"rounded border border-edge-strong px-1.5 font-mono text-[12px] text-muted transition hover:border-fg/40 hover:text-fg",children:"?"})]})]}),T.jsxs("div",{className:"shell flex h-[18px] items-end gap-[3px] pb-2",children:[T.jsx("button",{onClick:()=>m(-1),title:"Overview","aria-label":"Overview",className:`mr-1 h-[11px] w-[11px] shrink-0 rounded-sm transition-all ${l<0?"bg-accent":"bg-edge-strong hover:bg-fg/40"}`}),a.map((k,C)=>{const A=C===l,z=c.includes(k.id)?"flagged":u.includes(k.id)?"commented":o.includes(k.id)?"viewed":"unviewed",D=A?"bg-accent":z==="flagged"?"bg-orange-400/75":z==="commented"?"bg-violet-400/75":z==="viewed"?"bg-emerald-400/40":"bg-edge-strong hover:bg-fg/40";return T.jsx("button",{onClick:()=>m(C),title:`${k.id} · ${k.file}${A?"":` · ${z}`}`,"aria-label":`Go to chunk ${C+1}: ${k.file} (${z})`,className:`flex-1 rounded-full transition-all ${D} ${A?"h-[11px]":"h-[5px]"}`},k.id)})]})]})}const DC=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/;function zC(e){const i=[];let a=0,l=0;for(const o of e.split(`
58
58
  `)){const c=o.match(DC);if(c){a=Number(c[1]),l=Number(c[2]),i.push({type:"hunk",text:o});continue}const u=o[0],d=o.slice(1);u==="+"?(i.push({type:"add",newLn:l,text:d,sign:"+"}),l++):u==="-"?(i.push({type:"del",oldLn:a,text:d,sign:"-"}),a++):u==="\\"?i.push({type:"meta",text:o}):(i.push({type:"ctx",oldLn:a,newLn:l,text:d,sign:" "}),a++,l++)}return i}function LC(e){const[i,a]=e.new_range;return i===a?`+${i}`:`+${i}–${a}`}var ld,cx;function BC(){if(cx)return ld;cx=1;function e(O){return O instanceof Map?O.clear=O.delete=O.set=function(){throw new Error("map is read-only")}:O instanceof Set&&(O.add=O.clear=O.delete=function(){throw new Error("set is read-only")}),Object.freeze(O),Object.getOwnPropertyNames(O).forEach(W=>{const de=O[W],Oe=typeof de;(Oe==="object"||Oe==="function")&&!Object.isFrozen(de)&&e(de)}),O}class i{constructor(W){W.data===void 0&&(W.data={}),this.data=W.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(O){return O.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function l(O,...W){const de=Object.create(null);for(const Oe in O)de[Oe]=O[Oe];return W.forEach(function(Oe){for(const yt in Oe)de[yt]=Oe[yt]}),de}const o="</span>",c=O=>!!O.scope,u=(O,{prefix:W})=>{if(O.startsWith("language:"))return O.replace("language:","language-");if(O.includes(".")){const de=O.split(".");return[`${W}${de.shift()}`,...de.map((Oe,yt)=>`${Oe}${"_".repeat(yt+1)}`)].join(" ")}return`${W}${O}`};class d{constructor(W,de){this.buffer="",this.classPrefix=de.classPrefix,W.walk(this)}addText(W){this.buffer+=a(W)}openNode(W){if(!c(W))return;const de=u(W.scope,{prefix:this.classPrefix});this.span(de)}closeNode(W){c(W)&&(this.buffer+=o)}value(){return this.buffer}span(W){this.buffer+=`<span class="${W}">`}}const h=(O={})=>{const W={children:[]};return Object.assign(W,O),W};class m{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(W){this.top.children.push(W)}openNode(W){const de=h({scope:W});this.add(de),this.stack.push(de)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(W){return this.constructor._walk(W,this.rootNode)}static _walk(W,de){return typeof de=="string"?W.addText(de):de.children&&(W.openNode(de),de.children.forEach(Oe=>this._walk(W,Oe)),W.closeNode(de)),W}static _collapse(W){typeof W!="string"&&W.children&&(W.children.every(de=>typeof de=="string")?W.children=[W.children.join("")]:W.children.forEach(de=>{m._collapse(de)}))}}class g extends m{constructor(W){super(),this.options=W}addText(W){W!==""&&this.add(W)}startScope(W){this.openNode(W)}endScope(){this.closeNode()}__addSublanguage(W,de){const Oe=W.root;de&&(Oe.scope=`language:${de}`),this.add(Oe)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function y(O){return O?typeof O=="string"?O:O.source:null}function b(O){return k("(?=",O,")")}function x(O){return k("(?:",O,")*")}function S(O){return k("(?:",O,")?")}function k(...O){return O.map(de=>y(de)).join("")}function C(O){const W=O[O.length-1];return typeof W=="object"&&W.constructor===Object?(O.splice(O.length-1,1),W):{}}function A(...O){return"("+(C(O).capture?"":"?:")+O.map(Oe=>y(Oe)).join("|")+")"}function z(O){return new RegExp(O.toString()+"|").exec("").length-1}function D(O,W){const de=O&&O.exec(W);return de&&de.index===0}const q=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function I(O,{joinWith:W}){let de=0;return O.map(Oe=>{de+=1;const yt=de;let ct=y(Oe),xe="";for(;ct.length>0;){const me=q.exec(ct);if(!me){xe+=ct;break}xe+=ct.substring(0,me.index),ct=ct.substring(me.index+me[0].length),me[0][0]==="\\"&&me[1]?xe+="\\"+String(Number(me[1])+yt):(xe+=me[0],me[0]==="("&&de++)}return xe}).map(Oe=>`(${Oe})`).join(W)}const L=/\b\B/,X="[a-zA-Z]\\w*",$="[a-zA-Z_]\\w*",F="\\b\\d+(\\.\\d+)?",R="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ie="\\b(0b[01]+)",re="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ve=(O={})=>{const W=/^#![ ]*\//;return O.binary&&(O.begin=k(W,/.*\b/,O.binary,/\b.*/)),l({scope:"meta",begin:W,end:/$/,relevance:0,"on:begin":(de,Oe)=>{de.index!==0&&Oe.ignoreMatch()}},O)},ne={begin:"\\\\[\\s\\S]",relevance:0},le={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ne]},j={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ne]},ae={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},J=function(O,W,de={}){const Oe=l({scope:"comment",begin:O,end:W,contains:[]},de);Oe.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const yt=A("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Oe.contains.push({begin:k(/[ ]+/,"(",yt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Oe},he=J("//","$"),_=J("/\\*","\\*/"),N=J("#","$"),Y={scope:"number",begin:F,relevance:0},w={scope:"number",begin:R,relevance:0},fe={scope:"number",begin:ie,relevance:0},ke={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ne,{begin:/\[/,end:/\]/,relevance:0,contains:[ne]}]},Te={scope:"title",begin:X,relevance:0},Ue={scope:"title",begin:$,relevance:0},tt={begin:"\\.\\s*"+$,relevance:0};var Dt=Object.freeze({__proto__:null,APOS_STRING_MODE:le,BACKSLASH_ESCAPE:ne,BINARY_NUMBER_MODE:fe,BINARY_NUMBER_RE:ie,COMMENT:J,C_BLOCK_COMMENT_MODE:_,C_LINE_COMMENT_MODE:he,C_NUMBER_MODE:w,C_NUMBER_RE:R,END_SAME_AS_BEGIN:function(O){return Object.assign(O,{"on:begin":(W,de)=>{de.data._beginMatch=W[1]},"on:end":(W,de)=>{de.data._beginMatch!==W[1]&&de.ignoreMatch()}})},HASH_COMMENT_MODE:N,IDENT_RE:X,MATCH_NOTHING_RE:L,METHOD_GUARD:tt,NUMBER_MODE:Y,NUMBER_RE:F,PHRASAL_WORDS_MODE:ae,QUOTE_STRING_MODE:j,REGEXP_MODE:ke,RE_STARTERS_RE:re,SHEBANG:ve,TITLE_MODE:Te,UNDERSCORE_IDENT_RE:$,UNDERSCORE_TITLE_MODE:Ue});function Un(O,W){O.input[O.index-1]==="."&&W.ignoreMatch()}function si(O,W){O.className!==void 0&&(O.scope=O.className,delete O.className)}function be(O,W){W&&O.beginKeywords&&(O.begin="\\b("+O.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",O.__beforeBegin=Un,O.keywords=O.keywords||O.beginKeywords,delete O.beginKeywords,O.relevance===void 0&&(O.relevance=0))}function pe(O,W){Array.isArray(O.illegal)&&(O.illegal=A(...O.illegal))}function Ve(O,W){if(O.match){if(O.begin||O.end)throw new Error("begin & end are not supported with match");O.begin=O.match,delete O.match}}function Wt(O,W){O.relevance===void 0&&(O.relevance=1)}const vi=(O,W)=>{if(!O.beforeMatch)return;if(O.starts)throw new Error("beforeMatch cannot be used with starts");const de=Object.assign({},O);Object.keys(O).forEach(Oe=>{delete O[Oe]}),O.keywords=de.keywords,O.begin=k(de.beforeMatch,b(de.begin)),O.starts={relevance:0,contains:[Object.assign(de,{endsParent:!0})]},O.relevance=0,delete de.beforeMatch},Si=["of","and","for","in","not","or","if","then","parent","list","value"],$n="keyword";function Jn(O,W,de=$n){const Oe=Object.create(null);return typeof O=="string"?yt(de,O.split(" ")):Array.isArray(O)?yt(de,O):Object.keys(O).forEach(function(ct){Object.assign(Oe,Jn(O[ct],W,ct))}),Oe;function yt(ct,xe){W&&(xe=xe.map(me=>me.toLowerCase())),xe.forEach(function(me){const Re=me.split("|");Oe[Re[0]]=[ct,ka(Re[0],Re[1])]})}}function ka(O,W){return W?Number(W):ll(O)?0:1}function ll(O){return Si.includes(O.toLowerCase())}const lr={},Et=O=>{console.error(O)},sr=(O,...W)=>{console.log(`WARN: ${O}`,...W)},K=(O,W)=>{lr[`${O}/${W}`]||(console.log(`Deprecated as of ${O}. ${W}`),lr[`${O}/${W}`]=!0)},ue=new Error;function Ce(O,W,{key:de}){let Oe=0;const yt=O[de],ct={},xe={};for(let me=1;me<=W.length;me++)xe[me+Oe]=yt[me],ct[me+Oe]=!0,Oe+=z(W[me-1]);O[de]=xe,O[de]._emit=ct,O[de]._multi=!0}function He(O){if(Array.isArray(O.begin)){if(O.skip||O.excludeBegin||O.returnBegin)throw Et("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ue;if(typeof O.beginScope!="object"||O.beginScope===null)throw Et("beginScope must be object"),ue;Ce(O,O.begin,{key:"beginScope"}),O.begin=I(O.begin,{joinWith:""})}}function Qe(O){if(Array.isArray(O.end)){if(O.skip||O.excludeEnd||O.returnEnd)throw Et("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ue;if(typeof O.endScope!="object"||O.endScope===null)throw Et("endScope must be object"),ue;Ce(O,O.end,{key:"endScope"}),O.end=I(O.end,{joinWith:""})}}function on(O){O.scope&&typeof O.scope=="object"&&O.scope!==null&&(O.beginScope=O.scope,delete O.scope)}function Wn(O){on(O),typeof O.beginScope=="string"&&(O.beginScope={_wrap:O.beginScope}),typeof O.endScope=="string"&&(O.endScope={_wrap:O.endScope}),He(O),Qe(O)}function Gt(O){function W(xe,me){return new RegExp(y(xe),"m"+(O.case_insensitive?"i":"")+(O.unicodeRegex?"u":"")+(me?"g":""))}class de{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(me,Re){Re.position=this.position++,this.matchIndexes[this.matchAt]=Re,this.regexes.push([Re,me]),this.matchAt+=z(me)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const me=this.regexes.map(Re=>Re[1]);this.matcherRe=W(I(me,{joinWith:"|"}),!0),this.lastIndex=0}exec(me){this.matcherRe.lastIndex=this.lastIndex;const Re=this.matcherRe.exec(me);if(!Re)return null;const Ct=Re.findIndex((Ei,ur)=>ur>0&&Ei!==void 0),vt=this.matchIndexes[Ct];return Re.splice(0,Ct),Object.assign(Re,vt)}}class Oe{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(me){if(this.multiRegexes[me])return this.multiRegexes[me];const Re=new de;return this.rules.slice(me).forEach(([Ct,vt])=>Re.addRule(Ct,vt)),Re.compile(),this.multiRegexes[me]=Re,Re}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(me,Re){this.rules.push([me,Re]),Re.type==="begin"&&this.count++}exec(me){const Re=this.getMatcher(this.regexIndex);Re.lastIndex=this.lastIndex;let Ct=Re.exec(me);if(this.resumingScanAtSamePosition()&&!(Ct&&Ct.index===this.lastIndex)){const vt=this.getMatcher(0);vt.lastIndex=this.lastIndex+1,Ct=vt.exec(me)}return Ct&&(this.regexIndex+=Ct.position+1,this.regexIndex===this.count&&this.considerAll()),Ct}}function yt(xe){const me=new Oe;return xe.contains.forEach(Re=>me.addRule(Re.begin,{rule:Re,type:"begin"})),xe.terminatorEnd&&me.addRule(xe.terminatorEnd,{type:"end"}),xe.illegal&&me.addRule(xe.illegal,{type:"illegal"}),me}function ct(xe,me){const Re=xe;if(xe.isCompiled)return Re;[si,Ve,Wn,vi].forEach(vt=>vt(xe,me)),O.compilerExtensions.forEach(vt=>vt(xe,me)),xe.__beforeBegin=null,[be,pe,Wt].forEach(vt=>vt(xe,me)),xe.isCompiled=!0;let Ct=null;return typeof xe.keywords=="object"&&xe.keywords.$pattern&&(xe.keywords=Object.assign({},xe.keywords),Ct=xe.keywords.$pattern,delete xe.keywords.$pattern),Ct=Ct||/\w+/,xe.keywords&&(xe.keywords=Jn(xe.keywords,O.case_insensitive)),Re.keywordPatternRe=W(Ct,!0),me&&(xe.begin||(xe.begin=/\B|\b/),Re.beginRe=W(Re.begin),!xe.end&&!xe.endsWithParent&&(xe.end=/\B|\b/),xe.end&&(Re.endRe=W(Re.end)),Re.terminatorEnd=y(Re.end)||"",xe.endsWithParent&&me.terminatorEnd&&(Re.terminatorEnd+=(xe.end?"|":"")+me.terminatorEnd)),xe.illegal&&(Re.illegalRe=W(xe.illegal)),xe.contains||(xe.contains=[]),xe.contains=[].concat(...xe.contains.map(function(vt){return en(vt==="self"?xe:vt)})),xe.contains.forEach(function(vt){ct(vt,Re)}),xe.starts&&ct(xe.starts,me),Re.matcher=yt(Re),Re}if(O.compilerExtensions||(O.compilerExtensions=[]),O.contains&&O.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return O.classNameAliases=l(O.classNameAliases||{}),ct(O)}function wt(O){return O?O.endsWithParent||wt(O.starts):!1}function en(O){return O.variants&&!O.cachedVariants&&(O.cachedVariants=O.variants.map(function(W){return l(O,{variants:null},W)})),O.cachedVariants?O.cachedVariants:wt(O)?l(O,{starts:O.starts?l(O.starts):null}):Object.isFrozen(O)?l(O):O}var nt="11.11.1";class oi extends Error{constructor(W,de){super(W),this.name="HTMLInjectionError",this.html=de}}const un=a,Cs=l,_a=Symbol("nomatch"),or=7,Ca=function(O){const W=Object.create(null),de=Object.create(null),Oe=[];let yt=!0;const ct="Could not find the language '{}', did you forget to load/include a language module?",xe={disableAutodetect:!0,name:"Plain text",contains:[]};let me={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function Re(se){return me.noHighlightRe.test(se)}function Ct(se){let we=se.className+" ";we+=se.parentNode?se.parentNode.className:"";const Ie=me.languageDetectRe.exec(we);if(Ie){const it=cn(Ie[1]);return it||(sr(ct.replace("{}",Ie[1])),sr("Falling back to no-highlight mode for this block.",se)),it?Ie[1]:"no-highlight"}return we.split(/\s+/).find(it=>Re(it)||cn(it))}function vt(se,we,Ie){let it="",Mt="";typeof we=="object"?(it=se,Ie=we.ignoreIllegals,Mt=we.language):(K("10.7.0","highlight(lang, code, ...args) has been deprecated."),K("10.7.0",`Please use highlight(code, options) instead.
59
59
  https://github.com/highlightjs/highlight.js/issues/2277`),Mt=se,it=we),Ie===void 0&&(Ie=!0);const nn={code:it,language:Mt};Ma("before:highlight",nn);const kn=nn.result?nn.result:Ei(nn.language,nn.code,Ie);return kn.code=nn.code,Ma("after:highlight",kn),kn}function Ei(se,we,Ie,it){const Mt=Object.create(null);function nn(ce,Se){return ce.keywords[Se]}function kn(){if(!Me.keywords){Lt.addText(at);return}let ce=0;Me.keywordPatternRe.lastIndex=0;let Se=Me.keywordPatternRe.exec(at),Le="";for(;Se;){Le+=at.substring(ce,Se.index);const Ge=Yt.case_insensitive?Se[0].toLowerCase():Se[0],Tt=nn(Me,Ge);if(Tt){const[Vn,dl]=Tt;if(Lt.addText(Le),Le="",Mt[Ge]=(Mt[Ge]||0)+1,Mt[Ge]<=or&&(Xi+=dl),Vn.startsWith("_"))Le+=Se[0];else{const Ls=Yt.classNameAliases[Vn]||Vn;_n(Se[0],Ls)}}else Le+=Se[0];ce=Me.keywordPatternRe.lastIndex,Se=Me.keywordPatternRe.exec(at)}Le+=at.substring(ce),Lt.addText(Le)}function gn(){if(at==="")return;let ce=null;if(typeof Me.subLanguage=="string"){if(!W[Me.subLanguage]){Lt.addText(at);return}ce=Ei(Me.subLanguage,at,!0,zs[Me.subLanguage]),zs[Me.subLanguage]=ce._top}else ce=cr(at,Me.subLanguage.length?Me.subLanguage:null);Me.relevance>0&&(Xi+=ce.relevance),Lt.__addSublanguage(ce._emitter,ce.language)}function gt(){Me.subLanguage!=null?gn():kn(),at=""}function _n(ce,Se){ce!==""&&(Lt.startScope(Se),Lt.addText(ce),Lt.endScope())}function Os(ce,Se){let Le=1;const Ge=Se.length-1;for(;Le<=Ge;){if(!ce._emit[Le]){Le++;continue}const Tt=Yt.classNameAliases[ce[Le]]||ce[Le],Vn=Se[Le];Tt?_n(Vn,Tt):(at=Vn,kn(),at=""),Le++}}function dr(ce,Se){return ce.scope&&typeof ce.scope=="string"&&Lt.openNode(Yt.classNameAliases[ce.scope]||ce.scope),ce.beginScope&&(ce.beginScope._wrap?(_n(at,Yt.classNameAliases[ce.beginScope._wrap]||ce.beginScope._wrap),at=""):ce.beginScope._multi&&(Os(ce.beginScope,Se),at="")),Me=Object.create(ce,{parent:{value:Me}}),Me}function ul(ce,Se,Le){let Ge=D(ce.endRe,Le);if(Ge){if(ce["on:end"]){const Tt=new i(ce);ce["on:end"](Se,Tt),Tt.isMatchIgnored&&(Ge=!1)}if(Ge){for(;ce.endsParent&&ce.parent;)ce=ce.parent;return ce}}if(ce.endsWithParent)return ul(ce.parent,Se,Le)}function hr(ce){return Me.matcher.regexIndex===0?(at+=ce[0],1):(Ki=!0,0)}function Lu(ce){const Se=ce[0],Le=ce.rule,Ge=new i(Le),Tt=[Le.__beforeBegin,Le["on:begin"]];for(const Vn of Tt)if(Vn&&(Vn(ce,Ge),Ge.isMatchIgnored))return hr(Se);return Le.skip?at+=Se:(Le.excludeBegin&&(at+=Se),gt(),!Le.returnBegin&&!Le.excludeBegin&&(at=Se)),dr(Le,ce),Le.returnBegin?0:Se.length}function yn(ce){const Se=ce[0],Le=we.substring(ce.index),Ge=ul(Me,ce,Le);if(!Ge)return _a;const Tt=Me;Me.endScope&&Me.endScope._wrap?(gt(),_n(Se,Me.endScope._wrap)):Me.endScope&&Me.endScope._multi?(gt(),Os(Me.endScope,ce)):Tt.skip?at+=Se:(Tt.returnEnd||Tt.excludeEnd||(at+=Se),gt(),Tt.excludeEnd&&(at=Se));do Me.scope&&Lt.closeNode(),!Me.skip&&!Me.subLanguage&&(Xi+=Me.relevance),Me=Me.parent;while(Me!==Ge.parent);return Ge.starts&&dr(Ge.starts,ce),Tt.returnEnd?0:Se.length}function cl(){const ce=[];for(let Se=Me;Se!==Yt;Se=Se.parent)Se.scope&&ce.unshift(Se.scope);ce.forEach(Se=>Lt.openNode(Se))}let Ra={};function mr(ce,Se){const Le=Se&&Se[0];if(at+=ce,Le==null)return gt(),0;if(Ra.type==="begin"&&Se.type==="end"&&Ra.index===Se.index&&Le===""){if(at+=we.slice(Se.index,Se.index+1),!yt){const Ge=new Error(`0 width match regex (${se})`);throw Ge.languageName=se,Ge.badRule=Ra.rule,Ge}return 1}if(Ra=Se,Se.type==="begin")return Lu(Se);if(Se.type==="illegal"&&!Ie){const Ge=new Error('Illegal lexeme "'+Le+'" for mode "'+(Me.scope||"<unnamed>")+'"');throw Ge.mode=Me,Ge}else if(Se.type==="end"){const Ge=yn(Se);if(Ge!==_a)return Ge}if(Se.type==="illegal"&&Le==="")return at+=`
60
60
  `,1;if(fl>1e5&&fl>Se.index*3)throw new Error("potential infinite loop, way more iterations than matches");return at+=Le,Le.length}const Yt=cn(se);if(!Yt)throw Et(ct.replace("{}",se)),new Error('Unknown language: "'+se+'"');const Ds=Gt(Yt);let pr="",Me=it||Ds;const zs={},Lt=new me.__emitter(me);cl();let at="",Xi=0,Ai=0,fl=0,Ki=!1;try{if(Yt.__emitTokens)Yt.__emitTokens(we,Lt);else{for(Me.matcher.considerAll();;){fl++,Ki?Ki=!1:Me.matcher.considerAll(),Me.matcher.lastIndex=Ai;const ce=Me.matcher.exec(we);if(!ce)break;const Se=we.substring(Ai,ce.index),Le=mr(Se,ce);Ai=ce.index+Le}mr(we.substring(Ai))}return Lt.finalize(),pr=Lt.toHTML(),{language:se,value:pr,relevance:Xi,illegal:!1,_emitter:Lt,_top:Me}}catch(ce){if(ce.message&&ce.message.includes("Illegal"))return{language:se,value:un(we),illegal:!0,relevance:0,_illegalBy:{message:ce.message,index:Ai,context:we.slice(Ai-100,Ai+100),mode:ce.mode,resultSoFar:pr},_emitter:Lt};if(yt)return{language:se,value:un(we),illegal:!1,relevance:0,errorRaised:ce,_emitter:Lt,_top:Me};throw ce}}function ur(se){const we={value:un(se),illegal:!1,relevance:0,_top:xe,_emitter:new me.__emitter(me)};return we._emitter.addText(se),we}function cr(se,we){we=we||me.languages||Object.keys(W);const Ie=ur(se),it=we.filter(cn).filter(Gi).map(gt=>Ei(gt,se,!1));it.unshift(Ie);const Mt=it.sort((gt,_n)=>{if(gt.relevance!==_n.relevance)return _n.relevance-gt.relevance;if(gt.language&&_n.language){if(cn(gt.language).supersetOf===_n.language)return 1;if(cn(_n.language).supersetOf===gt.language)return-1}return 0}),[nn,kn]=Mt,gn=nn;return gn.secondBest=kn,gn}function ui(se,we,Ie){const it=we&&de[we]||Ie;se.classList.add("hljs"),se.classList.add(`language-${it}`)}function Nt(se){let we=null;const Ie=Ct(se);if(Re(Ie))return;if(Ma("before:highlightElement",{el:se,language:Ie}),se.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",se);return}if(se.children.length>0&&(me.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(se)),me.throwUnescapedHTML))throw new oi("One of your code blocks includes unescaped HTML.",se.innerHTML);we=se;const it=we.textContent,Mt=Ie?vt(it,{language:Ie,ignoreIllegals:!0}):cr(it);se.innerHTML=Mt.value,se.dataset.highlighted="yes",ui(se,Ie,Mt.language),se.result={language:Mt.language,re:Mt.relevance,relevance:Mt.relevance},Mt.secondBest&&(se.secondBest={language:Mt.secondBest.language,relevance:Mt.secondBest.relevance}),Ma("after:highlightElement",{el:se,result:Mt,text:it})}function tn(se){me=Cs(me,se)}const Fi=()=>{fr(),K("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function sl(){fr(),K("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ns=!1;function fr(){function se(){fr()}if(document.readyState==="loading"){Ns||window.addEventListener("DOMContentLoaded",se,!1),Ns=!0;return}document.querySelectorAll(me.cssSelector).forEach(Nt)}function Ms(se,we){let Ie=null;try{Ie=we(O)}catch(it){if(Et("Language definition for '{}' could not be registered.".replace("{}",se)),yt)Et(it);else throw it;Ie=xe}Ie.name||(Ie.name=se),W[se]=Ie,Ie.rawDefinition=we.bind(null,O),Ie.aliases&&Ti(Ie.aliases,{languageName:se})}function Na(se){delete W[se];for(const we of Object.keys(de))de[we]===se&&delete de[we]}function ol(){return Object.keys(W)}function cn(se){return se=(se||"").toLowerCase(),W[se]||W[de[se]]}function Ti(se,{languageName:we}){typeof se=="string"&&(se=[se]),se.forEach(Ie=>{de[Ie.toLowerCase()]=we})}function Gi(se){const we=cn(se);return we&&!we.disableAutodetect}function Yi(se){se["before:highlightBlock"]&&!se["before:highlightElement"]&&(se["before:highlightElement"]=we=>{se["before:highlightBlock"](Object.assign({block:we.el},we))}),se["after:highlightBlock"]&&!se["after:highlightElement"]&&(se["after:highlightElement"]=we=>{se["after:highlightBlock"](Object.assign({block:we.el},we))})}function zt(se){Yi(se),Oe.push(se)}function Rs(se){const we=Oe.indexOf(se);we!==-1&&Oe.splice(we,1)}function Ma(se,we){const Ie=se;Oe.forEach(function(it){it[Ie]&&it[Ie](we)})}function wi(se){return K("10.7.0","highlightBlock will be removed entirely in v12.0"),K("10.7.0","Please use highlightElement now."),Nt(se)}Object.assign(O,{highlight:vt,highlightAuto:cr,highlightAll:fr,highlightElement:Nt,highlightBlock:wi,configure:tn,initHighlighting:Fi,initHighlightingOnLoad:sl,registerLanguage:Ms,unregisterLanguage:Na,listLanguages:ol,getLanguage:cn,registerAliases:Ti,autoDetection:Gi,inherit:Cs,addPlugin:zt,removePlugin:Rs}),O.debugMode=function(){yt=!1},O.safeMode=function(){yt=!0},O.versionString=nt,O.regex={concat:k,lookahead:b,either:A,optional:S,anyNumberOfTimes:x};for(const se in Dt)typeof Dt[se]=="object"&&e(Dt[se]);return Object.assign(O,Dt),O},pn=Ca({});return pn.newInstance=()=>Ca({}),ld=pn,pn.HighlightJS=pn,pn.default=pn,ld}var jC=BC();const ln=ch(jC),fx="[A-Za-z$_][0-9A-Za-z$_]*",UC=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],VC=["true","false","null","undefined","NaN","Infinity"],Kv=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Zv=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Qv=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],HC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],IC=[].concat(Qv,Kv,Zv);function PC(e){const i=e.regex,a=(J,{after:he})=>{const _="</"+J[0].slice(1);return J.input.indexOf(_,he)!==-1},l=fx,o={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(J,he)=>{const _=J[0].length+J.index,N=J.input[_];if(N==="<"||N===","){he.ignoreMatch();return}N===">"&&(a(J,{after:_})||he.ignoreMatch());let Y;const w=J.input.substring(_);if(Y=w.match(/^\s*=/)){he.ignoreMatch();return}if((Y=w.match(/^\s+extends\s+/))&&Y.index===0){he.ignoreMatch();return}}},d={$pattern:fx,keyword:UC,literal:VC,built_in:IC,"variable.language":HC},h="[0-9](_?[0-9])*",m=`\\.(${h})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${g})((${m})|\\.)?|(${m}))[eE][+-]?(${h})\\b`},{begin:`\\b(${g})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},z={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},D=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,k,C,{match:/\$\d+/},y];b.contains=D.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(D)});const q=[].concat(z,b.contains),I=q.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(q)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:I},X={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,i.concat(l,"(",i.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},$={relevance:0,match:i.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Kv,...Zv]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},ie={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(J){return i.concat("(?!",J.join("|"),")")}const ve={match:i.concat(/\b/,re([...Qv,"super","import"].map(J=>`${J}\\s*\\(`)),l,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},ne={begin:i.concat(/\./,i.lookahead(i.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},le={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ae={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,k,C,z,{match:/\$\d+/},y,$,{scope:"attr",match:l+i.lookahead(":"),relevance:0},ae,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[z,e.REGEXP_MODE,{className:"function",begin:j,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:c},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},R,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},ne,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},ve,ie,X,le,{match:/\$[(.]/}]}}const vu="[A-Za-z$_][0-9A-Za-z$_]*",$v=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Jv=["true","false","null","undefined","NaN","Infinity"],Wv=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],e1=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],t1=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],n1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],i1=[].concat(t1,Wv,e1);function qC(e){const i=e.regex,a=(J,{after:he})=>{const _="</"+J[0].slice(1);return J.input.indexOf(_,he)!==-1},l=vu,o={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(J,he)=>{const _=J[0].length+J.index,N=J.input[_];if(N==="<"||N===","){he.ignoreMatch();return}N===">"&&(a(J,{after:_})||he.ignoreMatch());let Y;const w=J.input.substring(_);if(Y=w.match(/^\s*=/)){he.ignoreMatch();return}if((Y=w.match(/^\s+extends\s+/))&&Y.index===0){he.ignoreMatch();return}}},d={$pattern:vu,keyword:$v,literal:Jv,built_in:i1,"variable.language":n1},h="[0-9](_?[0-9])*",m=`\\.(${h})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${g})((${m})|\\.)?|(${m}))[eE][+-]?(${h})\\b`},{begin:`\\b(${g})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},S={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},z={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},D=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,k,C,{match:/\$\d+/},y];b.contains=D.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(D)});const q=[].concat(z,b.contains),I=q.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(q)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:I},X={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,i.concat(l,"(",i.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},$={relevance:0,match:i.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Wv,...e1]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},R={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},ie={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(J){return i.concat("(?!",J.join("|"),")")}const ve={match:i.concat(/\b/,re([...t1,"super","import"].map(J=>`${J}\\s*\\(`)),l,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},ne={begin:i.concat(/\./,i.lookahead(i.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},le={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},j="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ae={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(j)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:I,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,k,C,z,{match:/\$\d+/},y,$,{scope:"attr",match:l+i.lookahead(":"),relevance:0},ae,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[z,e.REGEXP_MODE,{className:"function",begin:j,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:I}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:c},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},R,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},ne,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},ve,ie,X,le,{match:/\$[(.]/}]}}function FC(e){const i=e.regex,a=qC(e),l=vu,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},u={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[a.exports.CLASS_REFERENCE]},d={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:vu,keyword:$v.concat(h),literal:Jv,built_in:i1.concat(o),"variable.language":n1},g={className:"meta",begin:"@"+l},y=(k,C,A)=>{const z=k.contains.findIndex(D=>D.label===C);if(z===-1)throw new Error("can not find mode to replace");k.contains.splice(z,1,A)};Object.assign(a.keywords,m),a.exports.PARAMS_CONTAINS.push(g);const b=a.contains.find(k=>k.scope==="attr"),x=Object.assign({},b,{match:i.concat(l,i.lookahead(/\s*\?:/))});a.exports.PARAMS_CONTAINS.push([a.exports.CLASS_REFERENCE,b,x]),a.contains=a.contains.concat([g,c,u,x]),y(a,"shebang",e.SHEBANG()),y(a,"use_strict",d);const S=a.contains.find(k=>k.label==="func.def");return S.relevance=0,Object.assign(a,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),a}function GC(e){const i={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},l=["true","false","null"],o={scope:"literal",beginKeywords:l.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:l},contains:[i,a,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function YC(e){const i="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",l={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},u={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,o]},d=e.inherit(u,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),b={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},x={end:",",endsWithParent:!0,excludeEnd:!0,keywords:i,relevance:0},S={begin:/\{/,end:/\}/,contains:[x],illegal:"\\n",relevance:0},k={begin:"\\[",end:"\\]",contains:[x],illegal:"\\n",relevance:0},C=[l,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:i,keywords:{literal:i}},b,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},S,k,c,u],A=[...C];return A.pop(),A.push(d),x.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}function XC(e){const i=e.regex,a={},l={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:i.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},l]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},c=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),u={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},d={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,o]};o.contains.push(d);const h={match:/\\"/},m={className:"string",begin:/'/,end:/'/},g={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,a]},b=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=e.SHEBANG({binary:`(${b.join("|")})`,relevance:10}),S={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},k=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],A={match:/(\/[a-z._-]+)+/},z=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],D=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],q=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],I=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:k,literal:C,built_in:[...z,...D,"set","shopt",...q,...I]},contains:[x,e.SHEBANG(),S,y,c,u,A,d,h,m,g,a]}}function KC(e){const i=e.regex,a=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),l=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],d={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:l,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:d,illegal:/#/},g={begin:/\{\{/,relevance:0},y={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h,g,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h,g,m]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,g,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,g,m]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b="[0-9](_?[0-9])*",x=`(\\b(${b}))?\\.(${b})|\\b(${b})\\.`,S=`\\b|${l.join("|")}`,k={className:"number",relevance:0,variants:[{begin:`(\\b(${b})|(${x}))[eE][+-]?(${b})[jJ]?(?=${S})`},{begin:`(${x})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${b})[jJ](?=${S})`}]},C={className:"comment",begin:i.lookahead(/# type:/),end:/$/,keywords:d,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:["self",h,k,y,e.HASH_COMMENT_MODE]}]};return m.contains=[y,k,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:d,illegal:/(<\/|\?)|=>/,contains:[h,k,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,C,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[k,A,y]}]}}function ZC(e){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}function QC(e){const i=e.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",l=i.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=i.concat(l,/(::\w+)*/),u={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},d={className:"doctag",begin:"@[A-Za-z]+"},h={begin:"#<",end:">"},m=[e.COMMENT("#","$",{contains:[d]}),e.COMMENT("^=begin","^=end",{contains:[d],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:u},y={className:"string",contains:[e.BACKSLASH_ESCAPE,g],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:i.concat(/<<[-~]?'?/,i.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,g]})]}]},b="[1-9](_?[0-9])*|0",x="[0-9](_?[0-9])*",S={className:"number",relevance:0,variants:[{begin:`\\b(${b})(\\.(${x}))?([eE][+-]?(${x})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},k={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:u}]},L=[y,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:u},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:u},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:l,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[k]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[y,{begin:a}],relevance:0},S,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:u},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,g],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(h,m),relevance:0}].concat(h,m);g.contains=L,k.contains=L;const R=[{begin:/^\s*=>/,starts:{end:"$",contains:L}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:u,contains:L}}];return m.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:u,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(R).concat(m).concat(L)}}const $C=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),JC=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],WC=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],eN=[...JC,...WC],tN=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),nN=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),iN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),aN=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function rN(e){const i=e.regex,a=$C(e),l={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",c=/@-?\w[\w]*(-\w+)*/,u="[a-zA-Z-][a-zA-Z0-9_-]*",d=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[a.BLOCK_COMMENT,l,a.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+u,relevance:0},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+nN.join("|")+")"},{begin:":(:)?("+iN.join("|")+")"}]},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+aN.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[a.BLOCK_COMMENT,a.HEXCOLOR,a.IMPORTANT,a.CSS_NUMBER_MODE,...d,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...d,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},a.FUNCTION_DISPATCH]},{begin:i.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:tN.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,a.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+eN.join("|")+")\\b"}]}}function lN(e){const i=e.regex,a=i.concat(/[\p{L}_]/u,i.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),l=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},u=e.inherit(c,{begin:/\(/,end:/\)/}),d=e.inherit(e.APOS_STRING_MODE,{className:"string"}),h=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),m={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:l,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,h,d,u,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,u,h,d]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[h]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:i.concat(/</,i.lookahead(i.concat(a,i.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:m}]},{className:"tag",begin:i.concat(/<\//,i.lookahead(i.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function sN(e){const i=e.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},l={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},u={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},d=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:i.concat(/\[.+?\]\(/,d,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=e.inherit(m,{contains:[]}),b=e.inherit(g,{contains:[]});m.contains.push(b),g.contains.push(y);let x=[a,h];return[m,g,y,b].forEach(A=>{A.contains=A.contains.concat(x)}),x=x.concat(m,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},a,c,m,g,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},o,l,h,u,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function oN(e){const i=e.regex,a=e.COMMENT("--","$"),l={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],u=["double precision","large object","with timezone","without timezone"],d=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],h=["add","asc","collation","desc","final","first","last","view"],m=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],g=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],b=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],x=g,S=[...m,...h].filter(I=>!g.includes(I)),k={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:i.concat(/\b/,i.either(...x),/\s*\(/),relevance:0,keywords:{built_in:x}};function z(I){return i.concat(/\b/,i.either(...I.map(L=>L.replace(/\s+/,"\\s+"))),/\b/)}const D={scope:"keyword",match:z(b),relevance:0};function q(I,{exceptions:L,when:X}={}){const $=X;return L=L||[],I.map(F=>F.match(/\|\d+$/)||L.includes(F)?F:$(F)?`${F}|0`:F)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:q(S,{when:I=>I.length<3}),literal:c,type:d,built_in:y},contains:[{scope:"type",match:z(u)},D,A,k,l,o,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,a,C]}}function uN(e){return{name:"Dockerfile",aliases:["docker"],case_insensitive:!0,keywords:["from","maintainer","expose","env","arg","user","onbuild","stopsignal"],contains:[e.HASH_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{beginKeywords:"run cmd entrypoint volume add copy workdir label healthcheck shell",starts:{end:/[^\\]$/,subLanguage:"bash"}}],illegal:"</"}}function cN(e){const i=e.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},l=e.COMMENT();l.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={className:"literal",begin:/\bon|off|true|false|yes|no\b/},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},d={begin:/\[/,end:/\]/,contains:[l,c,o,u,a,"self"],relevance:0},h=/[A-Za-z0-9_-]+/,m=/"(\\"|[^"])*"/,g=/'[^']*'/,y=i.either(h,m,g),b=i.concat(y,"(\\s*\\.\\s*",y,")*",i.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[l,{className:"section",begin:/\[+/,end:/\]+/},{begin:b,className:"attr",starts:{end:/$/,contains:[l,d,c,o,u,a]}}]}}function fN(e){const i={className:"template-variable",begin:/\$\{/,end:/\}/},a={className:"string",begin:'"',end:'"',contains:[e.BACKSLASH_ESCAPE,i]};return{name:"Terraform",aliases:["tf","hcl"],keywords:{keyword:"resource variable module data output provider locals terraform dynamic",built_in:"for_each count depends_on lifecycle source",literal:"true false null"},contains:[e.HASH_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,{className:"number",begin:/\b\d+(\.\d+)?/,relevance:0},{className:"attr",begin:/[A-Za-z_][\w-]*(?=\s*=[^=])/},{className:"title",begin:/[A-Za-z_][\w-]*(?=\s*\()/,relevance:0}]}}ln.registerLanguage("javascript",PC);ln.registerLanguage("typescript",FC);ln.registerLanguage("json",GC);ln.registerLanguage("yaml",YC);ln.registerLanguage("bash",XC);ln.registerLanguage("python",KC);ln.registerLanguage("go",ZC);ln.registerLanguage("ruby",QC);ln.registerLanguage("css",rN);ln.registerLanguage("xml",lN);ln.registerLanguage("markdown",sN);ln.registerLanguage("sql",oN);ln.registerLanguage("dockerfile",uN);ln.registerLanguage("ini",cN);ln.registerLanguage("terraform",fN);const dN={js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",tsx:"typescript",json:"json",yml:"yaml",yaml:"yaml",tftpl:"yaml",sh:"bash",bash:"bash",zsh:"bash",py:"python",go:"go",rb:"ruby",css:"css",scss:"css",html:"xml",xml:"xml",vue:"xml",svg:"xml",md:"markdown",markdown:"markdown",sql:"sql",toml:"ini",ini:"ini",tf:"terraform",hcl:"terraform"};function hN(e){const i=(e.split("/").pop()??e).toLowerCase();if(i==="dockerfile")return"dockerfile";const a=i.includes(".")?i.split(".").pop():"";return dN[a]??null}function dx(e){return e.replace(/[&<>]/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[i])}function mN(e,i){if(!e)return"";if(!i)return dx(e);try{return ln.highlight(e,{language:i,ignoreIllegals:!0}).value}catch{return dx(e)}}const pN={add:"bg-[var(--add-bg)]",del:"bg-[var(--del-bg)]",ctx:""},sd={add:"bg-[var(--add-gutter)] text-[var(--add-fg)]",del:"bg-[var(--del-gutter)] text-[var(--del-fg)]",ctx:"text-faint"};function gN(e){return e.type==="add"?{side:"RIGHT",line:e.newLn}:e.type==="ctx"?{side:"RIGHT",line:e.newLn}:e.type==="del"?{side:"LEFT",line:e.oldLn}:null}function hx({comment:e,onDelete:i,indented:a=!1}){return T.jsxs("div",{className:`my-1 rounded-md border border-edge bg-surface-2 px-3 py-2 font-sans ${a?"ml-[96px]":""}`,children:[T.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[T.jsx("span",{className:"text-[11px] tracking-wide text-faint",children:"you · draft"}),T.jsx("button",{onClick:()=>i(e.id),className:"text-[11px] text-faint transition hover:text-[var(--del-fg)]",children:"delete"})]}),T.jsx("div",{className:"text-[13px] whitespace-pre-wrap text-fg/90",children:e.body})]})}function yN({chunk:e,comments:i,anchor:a,onSelectLine:l,onDeleteComment:o}){const c=hN(e.file),u=zC(e.diff),d=i.filter(h=>h.line===null);return T.jsx("div",{className:"thin-scroll min-h-0 flex-1 overflow-auto bg-bg",children:T.jsxs("div",{className:"shell",children:[T.jsx("table",{className:"w-full border-collapse font-mono text-[12.5px] leading-[1.65]",children:T.jsx("tbody",{children:u.map((h,m)=>{var x;if(h.type==="hunk"||h.type==="meta")return T.jsxs("tr",{className:"bg-[var(--hunk-bg)] text-faint select-none",children:[T.jsx("td",{className:"px-3 text-right"}),T.jsx("td",{className:"px-3 text-right"}),T.jsx("td",{className:"px-2"}),T.jsx("td",{className:"py-0.5 pr-4 text-[11px] tracking-wide whitespace-pre-wrap",children:h.text})]},m);const g=gN(h),y=(a==null?void 0:a.side)===g.side&&(a==null?void 0:a.line)===g.line,b=i.filter(S=>S.side===g.side&&S.line===g.line);return T.jsxs(Q.Fragment,{children:[T.jsxs("tr",{onClick:()=>l(g),className:`cursor-pointer hover:bg-fg/[0.035] ${y?"bg-accent/12 shadow-[inset_2px_0_0_var(--accent)]":pN[h.type]}`,children:[T.jsx("td",{className:`w-[1%] min-w-[44px] border-r border-edge/60 px-3 text-right tabular-nums select-none ${sd[h.type]}`,children:h.oldLn??""}),T.jsx("td",{className:`w-[1%] min-w-[44px] border-r border-edge/60 px-3 text-right tabular-nums select-none ${sd[h.type]}`,children:h.newLn??""}),T.jsx("td",{className:`w-[1%] px-2 text-center select-none ${sd[h.type]}`,children:(x=h.sign)==null?void 0:x.trim()}),T.jsx("td",{className:"pr-4 whitespace-pre-wrap text-fg/90",dangerouslySetInnerHTML:{__html:mN(h.text,c)}})]}),b.map(S=>T.jsx("tr",{children:T.jsx("td",{colSpan:4,children:T.jsx(hx,{comment:S,onDelete:o,indented:!0})})},S.id))]},m)})})}),d.length>0&&T.jsxs("div",{className:"mt-3 mb-1",children:[T.jsx("div",{className:"mb-1.5 font-sans text-[10px] font-semibold tracking-[0.18em] text-faint uppercase",children:"on this chunk"}),T.jsx("div",{className:"space-y-1.5",children:d.map(h=>T.jsx(hx,{comment:h,onDelete:o},h.id))})]})]})})}const bN={context:"context",investigation:"asked",error:"error"};function mx({note:e,onDelete:i,live:a}){const l=bN[e.kind],o=e.kind==="initial"?"text-fg/85":"text-muted";return T.jsxs("div",{className:"group",children:[T.jsxs("p",{className:`font-serif text-[14.5px] leading-[1.7] ${o}`,children:[l&&T.jsxs("span",{className:"mr-2 align-middle font-sans text-[10px] font-medium tracking-[0.14em] text-accent/80 uppercase",children:[l,e.kind==="investigation"&&e.prompt?` · ${e.prompt}`:""]}),e.body,a&&T.jsx("span",{className:"ml-0.5 inline-block animate-pulse text-accent",children:"▍"}),e.id&&i&&T.jsx("button",{onClick:()=>i(e.id),className:"ml-2 align-middle font-sans text-[10px] text-faint opacity-0 transition group-hover:opacity-100 hover:text-[var(--del-fg)]",children:"delete"})]}),e.suggested_action&&T.jsxs("div",{className:"mt-2 flex gap-2 rounded-md border border-accent/25 bg-accent/[0.07] px-3 py-2",children:[T.jsx("span",{className:"select-none text-accent","aria-hidden":!0,children:"→"}),T.jsxs("p",{className:"font-sans text-[12.5px] leading-relaxed text-fg/80",children:[T.jsx("span",{className:"font-semibold tracking-wide text-accent/90",children:"Suggested action "}),e.suggested_action]})]})]})}function xN({notes:e,streaming:i,busy:a,error:l,askRef:o,onAsk:c,onDeleteNote:u,subject:d="chunk"}){const[h,m]=Q.useState(""),g=b=>{b.preventDefault(),!a&&(c(h),m(""))},y=e.length===0&&!i&&!a&&!l;return T.jsx("section",{className:"thin-scroll max-h-[34%] shrink-0 overflow-auto border-t border-edge bg-surface/60",children:T.jsxs("div",{className:"shell py-4",children:[T.jsxs("div",{className:"mb-2.5 flex items-center gap-3",children:[T.jsx("span",{className:"text-accent","aria-hidden":!0,children:"✦"}),T.jsx("span",{className:"font-sans text-[10px] font-semibold tracking-[0.22em] text-muted uppercase",children:"Claude"}),T.jsx("span",{className:"h-px flex-1 bg-edge"}),T.jsxs("form",{onSubmit:g,className:"flex items-center gap-1.5",children:[T.jsx("input",{ref:o,value:h,onChange:b=>m(b.target.value),disabled:a,placeholder:d==="PR"?"Ask about this PR… (a)":"Ask about this chunk… (a)",className:"w-64 rounded-md border border-edge bg-bg px-2.5 py-1 font-sans text-[12.5px] text-fg placeholder:text-faint focus:border-accent/60 focus:outline-none disabled:opacity-50"}),T.jsx("button",{type:"submit",disabled:a,className:"rounded-md border border-edge-strong px-2.5 py-1 text-[12px] font-medium text-muted transition enabled:hover:border-fg/30 enabled:hover:text-fg disabled:opacity-40",children:a?"…":h.trim()?"Ask":"Explain"})]})]}),l&&T.jsx(nr,{className:"mb-2",children:l}),T.jsxs("div",{className:"space-y-2 border-l border-accent/35 pl-4",children:[e.map((b,x)=>T.jsx(mx,{note:b,onDelete:u},b.id??`mock-${x}`)),i&&T.jsx(mx,{note:{kind:i.kind,body:i.text||"…"},live:!0}),y&&T.jsx("p",{className:"font-serif text-[14px] text-faint italic",children:d==="PR"?"No summary yet — hit Explain to summarize this PR.":"No commentary yet — ask a question, or hit Explain."})]})]})})}function vN({chunk:e,flagged:i,comments:a,anchor:l,onSelectLine:o,onDeleteComment:c,ai:u}){const d=e.file.split("/").slice(0,-1).join("/"),h=e.file.split("/").pop()??e.file;return T.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[T.jsx("header",{className:"shrink-0 border-b border-edge bg-surface/40",children:T.jsxs("div",{className:"shell flex items-baseline gap-3 py-3",children:[T.jsxs("div",{className:"min-w-0 font-mono text-[13px]",children:[d&&T.jsxs("span",{className:"text-faint",children:[d,"/"]}),T.jsx("span",{className:"font-medium text-fg",children:h})]}),T.jsx("span",{className:"font-mono text-[12px] text-accent",children:LC(e)}),e.context&&T.jsx("span",{className:"truncate font-mono text-[11px] text-faint",children:e.context}),i&&T.jsx("span",{className:"ml-auto shrink-0 rounded-sm border border-accent/40 px-2 py-0.5 font-sans text-[10px] font-medium tracking-[0.14em] text-accent uppercase",children:"flagged"})]})}),T.jsx(yN,{chunk:e,comments:a,anchor:l,onSelectLine:o,onDeleteComment:c}),T.jsx(xN,{...u})]})}function SN(e,i){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const EN=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TN=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wN={};function px(e,i){return(wN.jsx?TN:EN).test(e)}const AN=/[ \t\n\f\r]/g;function kN(e){return typeof e=="object"?e.type==="text"?gx(e.value):!1:gx(e)}function gx(e){return e.replace(AN,"")===""}class As{constructor(i,a,l){this.normal=a,this.property=i,l&&(this.space=l)}}As.prototype.normal={};As.prototype.property={};As.prototype.space=void 0;function a1(e,i){const a={},l={};for(const o of e)Object.assign(a,o.property),Object.assign(l,o.normal);return new As(a,l,i)}function Wd(e){return e.toLowerCase()}class An{constructor(i,a){this.attribute=a,this.property=i}}An.prototype.attribute="";An.prototype.booleanish=!1;An.prototype.boolean=!1;An.prototype.commaOrSpaceSeparated=!1;An.prototype.commaSeparated=!1;An.prototype.defined=!1;An.prototype.mustUseProperty=!1;An.prototype.number=!1;An.prototype.overloadedBoolean=!1;An.prototype.property="";An.prototype.spaceSeparated=!1;An.prototype.space=void 0;let _N=0;const De=rr(),Ht=rr(),eh=rr(),oe=rr(),dt=rr(),ir=rr(),Ln=rr();function rr(){return 2**++_N}const th=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Ht,commaOrSpaceSeparated:Ln,commaSeparated:ir,number:oe,overloadedBoolean:eh,spaceSeparated:dt},Symbol.toStringTag,{value:"Module"})),od=Object.keys(th);class Ih extends An{constructor(i,a,l,o){let c=-1;if(super(i,a),yx(this,"space",o),typeof l=="number")for(;++c<od.length;){const u=od[c];yx(this,od[c],(l&th[u])===th[u])}}}Ih.prototype.defined=!0;function yx(e,i,a){a&&(e[i]=a)}function al(e){const i={},a={};for(const[l,o]of Object.entries(e.properties)){const c=new Ih(l,e.transform(e.attributes||{},l),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(l)&&(c.mustUseProperty=!0),i[l]=c,a[Wd(l)]=l,a[Wd(c.attribute)]=l}return new As(i,a,e.space)}const r1=al({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControls:dt,ariaCurrent:null,ariaDescribedBy:dt,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:dt,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:dt,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dt,ariaLevel:oe,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:dt,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:dt,ariaRowCount:oe,ariaRowIndex:oe,ariaRowSpan:oe,ariaSelected:Ht,ariaSetSize:oe,ariaSort:null,ariaValueMax:oe,ariaValueMin:oe,ariaValueNow:oe,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function l1(e,i){return i in e?e[i]:i}function s1(e,i){return l1(e,i.toLowerCase())}const CN=al({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ir,acceptCharset:dt,accessKey:dt,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alpha:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:dt,autoFocus:De,autoPlay:De,blocking:dt,capture:null,charSet:null,checked:De,cite:null,className:dt,closedBy:null,colorSpace:null,cols:oe,colSpan:oe,command:null,commandFor:null,content:null,contentEditable:Ht,controls:De,controlsList:dt,coords:oe|ir,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:eh,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:dt,height:oe,hidden:eh,high:oe,href:null,hrefLang:null,htmlFor:dt,httpEquiv:dt,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:dt,itemRef:dt,itemScope:De,itemType:dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:De,optimum:oe,pattern:null,ping:dt,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:dt,required:De,reversed:De,rows:oe,rowSpan:oe,sandbox:dt,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootCustomElementRegistry:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shadowRootSerializable:De,shape:null,size:oe,sizes:null,slot:null,span:oe,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oe,step:null,style:null,tabIndex:oe,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:Ht,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dt,axis:null,background:null,bgColor:null,border:oe,borderColor:null,bottomMargin:oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:oe,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:De,disablePictureInPicture:De,disableRemotePlayback:De,exportParts:ir,part:dt,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:s1}),NN=al({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ln,accentHeight:oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oe,amplitude:oe,arabicForm:null,ascent:oe,attributeName:null,attributeType:null,azimuth:oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oe,by:null,calcMode:null,capHeight:oe,className:dt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:oe,diffuseConstant:oe,direction:null,display:null,dur:null,divisor:oe,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:oe,enableBackground:null,end:null,event:null,exponent:oe,externalResourcesRequired:null,fill:null,fillOpacity:oe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ir,g2:ir,glyphName:ir,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oe,horizOriginX:oe,horizOriginY:oe,id:null,ideographic:oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oe,k:oe,k1:oe,k2:oe,k3:oe,k4:oe,kernelMatrix:Ln,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:oe,overlineThickness:oe,paintOrder:null,panose1:null,path:null,pathLength:oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ln,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ln,rev:Ln,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ln,requiredFeatures:Ln,requiredFonts:Ln,requiredFormats:Ln,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:oe,specularExponent:oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oe,strikethroughThickness:oe,string:null,stroke:null,strokeDashArray:Ln,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oe,strokeOpacity:oe,strokeWidth:null,style:null,surfaceScale:oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ln,tabIndex:oe,tableValues:null,target:null,targetX:oe,targetY:oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ln,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oe,underlineThickness:oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oe,values:null,vAlphabetic:oe,vMathematical:oe,vectorEffect:null,vHanging:oe,vIdeographic:oe,version:null,vertAdvY:oe,vertOriginX:oe,vertOriginY:oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:l1}),o1=al({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),u1=al({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:s1}),c1=al({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),MN={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},RN=/[A-Z]/g,bx=/-[a-z]/g,ON=/^data[-\w.:]+$/i;function DN(e,i){const a=Wd(i);let l=i,o=An;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&ON.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(bx,LN);l="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!bx.test(c)){let u=c.replace(RN,zN);u.charAt(0)!=="-"&&(u="-"+u),i="data"+u}}o=Ih}return new o(l,i)}function zN(e){return"-"+e.toLowerCase()}function LN(e){return e.charAt(1).toUpperCase()}const BN=a1([r1,CN,o1,u1,c1],"html"),Ph=a1([r1,NN,o1,u1,c1],"svg");function jN(e){return e.join(" ").trim()}var Gr={},ud,xx;function UN(){if(xx)return ud;xx=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,d=/^\s+|\s+$/g,h=`
package/dist/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <link rel="icon" type="image/svg+xml" href="/icon.svg" />
7
7
  <title>assisted-review</title>
8
- <script type="module" crossorigin src="/assets/index-vqvS4ppU.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-D4ESfIvh.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-BXdf1Bth.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assisted-review",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Standalone CLI: serve a browser UI to walk a GitHub PR hunk by hunk.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.33.0",