revyse 0.1.0 → 0.2.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 +7 -6
- package/dist/agent.js +11 -0
- package/dist/chunk-FVZWKW32.js +24339 -0
- package/dist/headless.js +706 -210
- package/dist/index.js +212 -24043
- package/dist/overlay.js +130 -61
- package/package.json +7 -3
package/dist/overlay.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
`});
|
|
3
|
-
`?
|
|
4
|
-
`&&(
|
|
5
|
-
`);P.push(N)}if(w.length>0)throw new Error("missing closing tag: "+w.pop().n);return P}function u(v,y){for(var w=0,A=y.length;w<A;w++)if(y[w].o==v.n)return v.tag="#",!0}function b(v,y,w){for(var A=0,P=w.length;A<P;A++)if(w[A].c==v&&w[A].o==y)return!0}function f(v){var y=[];for(var w in v)y.push('"'+m(w)+'": function(c,p,t,i) {'+v[w]+"}");return"{ "+y.join(",")+" }"}function g(v){var y=[];for(var w in v.partials)y.push('"'+m(w)+'":{name:"'+m(v.partials[w].name)+'", '+g(v.partials[w])+"}");return"partials: {"+y.join(",")+"}, subs: "+f(v.subs)}e.stringify=function(v,y,w){return"{code: function (c,p,i) { "+e.wrapMain(v.code)+" },"+g(v)+"}"};var k=0;e.generate=function(v,y,w){k=0;var A={code:"",subs:{},partials:{}};return e.walk(v,A),w.asString?this.stringify(A,y,w):this.makeTemplate(A,y,w)},e.wrapMain=function(v){return'var t=this;t.b(i=i||"");'+v+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(v,y,w){var A=this.makePartials(v);return A.code=new Function("c","p","i",this.wrapMain(v.code)),new this.template(A,y,this,w)},e.makePartials=function(v){var y,w={subs:{},partials:v.partials,name:v.name};for(y in w.partials)w.partials[y]=this.makePartials(w.partials[y]);for(y in v.subs)w.subs[y]=new Function("c","p","t","i",v.subs[y]);return w};function m(v){return v.replace(o,"\\\\").replace(i,'\\"').replace(t,"\\n").replace(r,"\\r").replace(s,"\\u2028").replace(d,"\\u2029")}function S(v){return~v.indexOf(".")?"d":"f"}function _(v,y){var w="<"+(y.prefix||""),A=w+v.n+k++;return y.partials[A]={name:v.n,partials:{}},y.code+='t.b(t.rp("'+m(A)+'",c,p,"'+(v.indent||"")+'"));',A}e.codegen={"#":function(v,y){y.code+="if(t.s(t."+S(v.n)+'("'+m(v.n)+'",c,p,1),c,p,0,'+v.i+","+v.end+',"'+v.otag+" "+v.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(v.nodes,y),y.code+="});c.pop();}"},"^":function(v,y){y.code+="if(!t.s(t."+S(v.n)+'("'+m(v.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(v.nodes,y),y.code+="};"},">":_,"<":function(v,y){var w={partials:{},code:"",subs:{},inPartial:!0};e.walk(v.nodes,w);var A=y.partials[_(v,y)];A.subs=w.subs,A.partials=w.partials},$:function(v,y){var w={subs:{},code:"",partials:y.partials,prefix:v.n};e.walk(v.nodes,w),y.subs[v.n]=w.code,y.inPartial||(y.code+='t.sub("'+m(v.n)+'",c,p,i);')},"\n":function(v,y){y.code+=M('"\\n"'+(v.last?"":" + i"))},_v:function(v,y){y.code+="t.b(t.v(t."+S(v.n)+'("'+m(v.n)+'",c,p,0)));'},_t:function(v,y){y.code+=M('"'+m(v.text)+'"')},"{":F,"&":F};function F(v,y){y.code+="t.b(t.t(t."+S(v.n)+'("'+m(v.n)+'",c,p,0)));'}function M(v){return"t.b("+v+");"}e.walk=function(v,y){for(var w,A=0,P=v.length;A<P;A++)w=e.codegen[v[A].tag],w&&w(v[A],y);return y},e.parse=function(v,y,w){return w=w||{},l(v,"",[],w.sectionTags||[])},e.cache={},e.cacheKey=function(v,y){return[v,!!y.asString,!!y.disableLambda,y.delimiters,!!y.modelGet].join("||")},e.compile=function(v,y){y=y||{};var w=e.cacheKey(v,y),A=this.cache[w];if(A){var P=A.partials;for(var q in P)delete P[q].instance;return A}return A=this.generate(this.parse(this.scan(v,y.delimiters),v,y),v,y),this.cache[w]=A}})(typeof $t<"u"?$t:Hogan)});var ri=gt(Vt=>{"use strict";var Ar={};(function(e){e.Template=function(l,u,b,f){l=l||{},this.r=l.code||this.r,this.c=b,this.options=f||{},this.text=u||"",this.partials=l.partials||{},this.subs=l.subs||{},this.buf=""},e.Template.prototype={r:function(l,u,b){return""},v:h,t:c,render:function(u,b,f){return this.ri([u],b||{},f)},ri:function(l,u,b){return this.r(l,u,b)},ep:function(l,u){var b=this.partials[l],f=u[b.name];if(b.instance&&b.base==f)return b.instance;if(typeof f=="string"){if(!this.c)throw new Error("No compiler available.");f=this.c.compile(f,this.options)}if(!f)return null;if(this.partials[l].base=f,b.subs){u.stackText||(u.stackText={});for(key in b.subs)u.stackText[key]||(u.stackText[key]=this.activeSub!==void 0&&u.stackText[this.activeSub]?u.stackText[this.activeSub]:this.text);f=i(f,b.subs,b.partials,this.stackSubs,this.stackPartials,u.stackText)}return this.partials[l].instance=f,f},rp:function(l,u,b,f){var g=this.ep(l,b);return g?g.ri(u,b,f):""},rs:function(l,u,b){var f=l[l.length-1];if(!x(f)){b(l,u,this);return}for(var g=0;g<f.length;g++)l.push(f[g]),b(l,u,this),l.pop()},s:function(l,u,b,f,g,k,m){var S;return x(l)&&l.length===0?!1:(typeof l=="function"&&(l=this.ms(l,u,b,f,g,k,m)),S=!!l,!f&&S&&u&&u.push(typeof l=="object"?l:u[u.length-1]),S)},d:function(l,u,b,f){var g,k=l.split("."),m=this.f(k[0],u,b,f),S=this.options.modelGet,_=null;if(l==="."&&x(u[u.length-2]))m=u[u.length-1];else for(var F=1;F<k.length;F++)g=n(k[F],m,S),g!==void 0?(_=m,m=g):m="";return f&&!m?!1:(!f&&typeof m=="function"&&(u.push(_),m=this.mv(m,u,b),u.pop()),m)},f:function(l,u,b,f){for(var g=!1,k=null,m=!1,S=this.options.modelGet,_=u.length-1;_>=0;_--)if(k=u[_],g=n(l,k,S),g!==void 0){m=!0;break}return m?(!f&&typeof g=="function"&&(g=this.mv(g,u,b)),g):f?!1:""},ls:function(l,u,b,f,g,k){var m=this.options.delimiters;return this.options.delimiters=k,this.b(this.ct(c(l.call(u,g,b)),u,f)),this.options.delimiters=m,!1},ct:function(l,u,b){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(l,this.options).render(u,b)},b:function(l){this.buf+=l},fl:function(){var l=this.buf;return this.buf="",l},ms:function(l,u,b,f,g,k,m){var S,_=u[u.length-1],F=l.call(_);return typeof F=="function"?f?!0:(S=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(F,_,u,b,S.substring(g,k),m)):F},mv:function(l,u,b){var f=u[u.length-1],g=l.call(f);return typeof g=="function"?this.ct(c(g.call(f)),f,b):g},sub:function(l,u,b,f){var g=this.subs[l];g&&(this.activeSub=l,g(u,b,this,f),this.activeSub=!1)}};function n(l,u,b){var f;return u&&typeof u=="object"&&(u[l]!==void 0?f=u[l]:b&&u.get&&typeof u.get=="function"&&(f=u.get(l))),f}function i(l,u,b,f,g,k){function m(){}m.prototype=l;function S(){}S.prototype=l.subs;var _,F=new m;F.subs=new S,F.subsText={},F.buf="",f=f||{},F.stackSubs=f,F.subsText=k;for(_ in u)f[_]||(f[_]=u[_]);for(_ in f)F.subs[_]=f[_];g=g||{},F.stackPartials=g;for(_ in b)g[_]||(g[_]=b[_]);for(_ in g)F.partials[_]=g[_];return F}var t=/&/g,r=/</g,o=/>/g,s=/\'/g,d=/\"/g,p=/[&<>\"\']/;function c(l){return String(l??"")}function h(l){return l=c(l),p.test(l)?l.replace(t,"&").replace(r,"<").replace(o,">").replace(s,"'").replace(d,"""):l}var x=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"}})(typeof Vt<"u"?Vt:Ar)});var qt=gt(($o,oi)=>{"use strict";var pt=ii();pt.Template=ri().Template;pt.template=pt.Template;oi.exports=pt});var an={unauthorized:4401,handshakeTimeout:4408,badMessage:4400},X=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),T=e=>typeof e=="string",on=e=>typeof e=="number"&&Number.isFinite(e),Oe=e=>Number.isInteger(e),Ce=e=>typeof e=="boolean",W=e=>n=>n===void 0||e(n),G=e=>n=>Array.isArray(n)&&n.every(e),K=e=>n=>T(n)&&e.includes(n),ji=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,ne=e=>T(e)&&ji.test(e);function ln(e){return X(e)&&e.type==="welcome"&&e.protocol===1&&T(e.agentVersion)&&X(e.project)&&T(e.project.framework)&&T(e.project.root)}function cn(e){return!X(e)||e.type!=="response"||!T(e.id)||!Ce(e.ok)||e.error!==void 0&&(!X(e.error)||!T(e.error.code)||!T(e.error.message))?null:e}function dn(e){return!X(e)||e.type!=="event"||!T(e.event)?null:e}var un=["typecheck","lint","test","build","browser","visual"],pn=["passed","failed","skipped","not_run","running"],fn=["draft","planning","awaiting_clarification","applying","verifying","preview_ready","awaiting_approval","approved","released","rejected","failed","cancelled"],Bi=["starting","planning","patching","applying","checking","reporting","reverting","accepting"],zi=["replan","revise","revert","reload","login"],$i=["changed_since_plan","changed_while_applying","changed_since_apply"],Vi=e=>X(e)&&K(["proceed","clarify","out_of_scope"])(e.decision)&&T(e.summary)&&G(n=>X(n)&&T(n.description)&&G(T)(n.files))(e.steps)&&W(T)(e.clarifyingQuestion)&&W(T)(e.outOfScopeReason)&&W(G(T))(e.notDoing)&&W(G(T))(e.envVars)&&W(G(T))(e.sensitive),qi=e=>X(e)&&K(un)(e.kind)&&K(pn)(e.status)&&W(T)(e.command)&&W(T)(e.reason)&&W(Ce)(e.preExisting)&&(e.baseline===void 0||K(["passed","failed"])(e.baseline))&&(e.evidence===void 0||X(e.evidence)&&W(Oe)(e.evidence.exitCode)&&W(T)(e.evidence.summary)&&W(G(T))(e.evidence.artifactKeys))&&(e.durationMs===void 0||Oe(e.durationMs)&&e.durationMs>=0);function hn(e){return!X(e)||!T(e.type)?null:(()=>{switch(e.type){case"planning":case"reverted":case"accepted":case"cancelled":return ne(e.changeId)&&(e.type!=="reverted"||G(T)(e.files));case"plan":return ne(e.changeId)&&Vi(e.plan)&&T(e.model)&&(e.cost===void 0||on(e.cost)&&e.cost>=0);case"clarification":return ne(e.changeId)&&T(e.question)&&(e.integration===void 0||X(e.integration)&&T(e.integration.capability)&&G(T)(e.integration.providers)&&T(e.integration.reason)&&W(T)(e.integration.connectUrl));case"applying":return ne(e.changeId)&&Oe(e.files);case"checking":return ne(e.changeId)&&G(i=>X(i)&&K(un)(i.kind)&&K(pn)(i.status))(e.checks);case"result":return ne(e.changeId)&&K(fn)(e.state)&&G(i=>X(i)&&T(i.path)&&Oe(i.additions)&&Oe(i.deletions)&&W(T)(i.explanation)&&W(K(["create","modify","delete"]))(i.kind))(e.files)&&T(e.diff)&&G(qi)(e.checks)&&(e.cost===void 0||on(e.cost)&&e.cost>=0)&&W(T)(e.summary)&&W(G(T))(e.envVars)&&W(G(T))(e.notDone)&&W(G(T))(e.sensitive);case"activity":return ne(e.changeId)&&K(["plan","apply"])(e.phase)&&T(e.tool)&&T(e.text);case"conflict":return ne(e.changeId)&&G(T)(e.files)&&K($i)(e.reason)&&T(e.message);case"failed":return W(ne)(e.changeId)&&T(e.code)&&T(e.message)&&Ce(e.retryable)&&(e.stage===void 0||K(Bi)(e.stage))&&W(Ce)(e.filesChanged)&&(e.next===void 0||G(K(zi))(e.next));case"permission_denied":return W(ne)(e.changeId)&&T(e.message);default:return!1}})()?e:null}function gn(e){if(!X(e)||!T(e.defaultModel))return null;let n=t=>typeof t=="number"&&Number.isFinite(t)&&t>=0;return G(t=>X(t)&&T(t.id)&&K(["anthropic","openai","google"])(t.provider)&&T(t.label)&&T(t.description)&&n(t.creditWeight)&&t.creditWeight>0&&n(t.typicalCredits)&&Ce(t.allowed)&&Ce(t.available))(e.models)?e:null}var Gi=["queued","building","ready","error","canceled"],mt=e=>{if(!T(e))return!1;try{return new URL(e),!0}catch{return!1}},sn=e=>n=>n===null||e(n);function mn(e){if(!X(e))return null;let n=e.preview;return ne(e.changeId)&&K(fn)(e.state)&&mt(e.changeUrl)&&sn(mt)(e.pullRequestUrl)&&(n===null||X(n)&&K(Gi)(n.status)&&sn(mt)(n.url))?e:null}var et,D,_n,Xi,ce,bn,wn,kn,bt,Xe,Ie,Cn,xt,vt,yt,Yi,Je={},Qe=[],Ki=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,tt=Array.isArray;function le(e,n){for(var i in n)e[i]=n[i];return e}function _t(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ji(e,n,i){var t,r,o,s={};for(o in n)o=="key"?t=n[o]:o=="ref"?r=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?et.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return Ye(e,s,t,r,null)}function Ye(e,n,i,t,r){var o={type:e,props:n,key:i,ref:t,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++_n,__i:-1,__u:0};return r==null&&D.vnode!=null&&D.vnode(o),o}function Z(e){return e.children}function Ke(e,n){this.props=e,this.context=n}function me(e,n){if(n==null)return e.__?me(e.__,e.__i+1):null;for(var i;n<e.__k.length;n++)if((i=e.__k[n])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?me(e):null}function Qi(e){if(e.__P&&e.__d){var n=e.__v,i=n.__e,t=[],r=[],o=le({},n);o.__v=n.__v+1,D.vnode&&D.vnode(o),wt(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,t,i??me(n),!!(32&n.__u),r),o.__v=n.__v,o.__.__k[o.__i]=o,Fn(t,o,r),n.__e=n.__=null,o.__e!=i&&Sn(o)}}function Sn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Sn(e)}function vn(e){(!e.__d&&(e.__d=!0)&&ce.push(e)&&!Ze.__r++||bn!=D.debounceRendering)&&((bn=D.debounceRendering)||wn)(Ze)}function Ze(){try{for(var e,n=1;ce.length;)ce.length>n&&ce.sort(kn),e=ce.shift(),n=ce.length,Qi(e)}finally{ce.length=Ze.__r=0}}function En(e,n,i,t,r,o,s,d,p,c,h){var x,l,u,b,f,g,k=t&&t.__k||Qe,m=n.length;for(p=Zi(i,n,k,p,m),x=0;x<m;x++)(u=i.__k[x])!=null&&(l=u.__i!=-1&&k[u.__i]||Je,u.__i=x,g=wt(e,u,l,r,o,s,d,p,c,h),b=u.__e,u.ref&&l.ref!=u.ref&&(l.ref&&kt(l.ref,null,u),h.push(u.ref,u.__c||b,u)),f==null&&b!=null&&(f=b),4&u.__u?(p=An(u,p,e),l.__e&&(l.__e=null)):typeof u.type=="function"&&g!==void 0?p=g:b&&(p=b.nextSibling),u.__u&=-7);return i.__e=f,p}function Zi(e,n,i,t,r){var o,s,d,p,c,h=i.length,x=h,l=0;for(e.__k=new Array(r),o=0;o<r;o++)(s=n[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[o]=Ye(null,s,null,null,null):tt(s)?s=e.__k[o]=Ye(Z,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[o]=Ye(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,p=o+l,s.__=e,s.__b=e.__b+1,d=null,(c=s.__i=er(s,i,p,x))!=-1&&(x--,(d=i[c])&&(d.__u|=2)),d==null||d.__v==null?(c==-1&&(r>h?l--:r<h&&l++),typeof s.type!="function"&&(s.__u|=4)):c!=p&&(c==p-1?l--:c==p+1?l++:(c>p?l--:l++,s.__u|=4))):e.__k[o]=null;if(x)for(o=0;o<h;o++)(d=i[o])!=null&&(2&d.__u)==0&&(d.__e==t&&(t=me(d)),Nn(d,d));return t}function An(e,n,i){var t,r;if(typeof e.type=="function"){for(t=e.__k,r=0;t&&r<t.length;r++)t[r]&&(t[r].__=e,n=An(t[r],n,i));return n}e.__e!=n&&(n&&e.type&&!n.parentNode&&(n=me(e)),n=i.insertBefore(e.__e,n||null));do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function er(e,n,i,t){var r,o,s,d=e.key,p=e.type,c=n[i],h=c!=null&&(2&c.__u)==0;if(c===null&&d==null||h&&d==c.key&&p==c.type)return i;if(t>(h?1:0)){for(r=i-1,o=i+1;r>=0||o<n.length;)if((c=n[s=r>=0?r--:o++])!=null&&(2&c.__u)==0&&d==c.key&&p==c.type)return s}return-1}function yn(e,n,i){n[0]=="-"?e.setProperty(n,i??""):e[n]=i==null?"":typeof i!="number"||Ki.test(n)?i:i+"px"}function Ge(e,n,i,t,r){var o,s;e:if(n=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof t=="string"&&(e.style.cssText=t=""),t)for(n in t)i&&n in i||yn(e.style,n,"");if(i)for(n in i)t&&i[n]==t[n]||yn(e.style,n,i[n])}else if(n[0]=="o"&&n[1]=="n")o=n!=(n=n.replace(Cn,"$1")),s=n.toLowerCase(),n=s in e||n=="onFocusOut"||n=="onFocusIn"?s.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+o]=i,i?t?i[Ie]=t[Ie]:(i[Ie]=xt,e.addEventListener(n,o?yt:vt,o)):e.removeEventListener(n,o?yt:vt,o);else{if(r=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=i??"";break e}catch{}typeof i=="function"||(i==null||i===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&i==1?"":i))}}function xn(e){return function(n){if(this.l){var i=this.l[n.type+e];if(n[Xe]==null)n[Xe]=xt++;else if(n[Xe]<i[Ie])return;return i(D.event?D.event(n):n)}}}function wt(e,n,i,t,r,o,s,d,p,c){var h,x,l,u,b,f,g,k,m,S,_,F,M,v,y,w,A=n.type;if(n.constructor!==void 0)return null;128&i.__u&&(p=!!(32&i.__u),o=[d=n.__e=i.__e]),(h=D.__b)&&h(n);e:if(typeof A=="function"){x=s.length;try{if(m=n.props,S=A.prototype&&A.prototype.render,_=(h=A.contextType)&&t[h.__c],F=h?_?_.props.value:h.__:t,i.__c?k=(l=n.__c=i.__c).__=l.__E:(S?n.__c=l=new A(m,F):(n.__c=l=new Ke(m,F),l.constructor=A,l.render=nr),_&&_.sub(l),l.state||(l.state={}),l.__n=t,u=l.__d=!0,l.__h=[],l._sb=[]),S&&l.__s==null&&(l.__s=l.state),S&&A.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=le({},l.__s)),le(l.__s,A.getDerivedStateFromProps(m,l.__s))),b=l.props,f=l.state,l.__v=n,u)S&&A.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),S&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(S&&A.getDerivedStateFromProps==null&&m!==b&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(m,F),n.__v==i.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(m,l.__s,F)===!1){n.__v!=i.__v&&(l.props=m,l.state=l.__s,l.__d=!1),n.__e=i.__e,n.__k=i.__k,n.__k.some(function(P){P&&(P.__=n)}),Qe.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&s.push(l),d=me(i);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(m,l.__s,F),S&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(b,f,g)})}if(l.context=F,l.props=m,l.__P=e,l.__e=!1,M=D.__r,v=0,S)l.state=l.__s,l.__d=!1,M&&M(n),h=l.render(l.props,l.state,l.context),Qe.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,M&&M(n),h=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++v<25);l.state=l.__s,l.getChildContext!=null&&(t=le(le({},t),l.getChildContext())),S&&!u&&l.getSnapshotBeforeUpdate!=null&&(g=l.getSnapshotBeforeUpdate(b,f)),y=h!=null&&h.type===Z&&h.key==null?Ln(h.props.children):h,d=En(e,tt(y)?y:[y],n,i,t,r,o,s,d,p,c),l.base=n.__e,n.__u&=-161,l.__h.length&&s.push(l),k&&(l.__E=l.__=null)}catch(P){if(s.length=x,n.__v=null,p||o!=null){if(P.then){for(n.__u|=p?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;o!=null&&(o[o.indexOf(d)]=null),n.__e=d}else if(o!=null)for(w=o.length;w--;)_t(o[w])}else n.__e=i.__e;n.__k==null&&(n.__k=i.__k||[]),P.then||Tn(n),D.__e(P,n,i)}}else o==null&&n.__v==i.__v?(n.__k=i.__k,n.__e=i.__e):d=n.__e=tr(i.__e,n,i,t,r,o,s,p,c);return(h=D.diffed)&&h(n),128&n.__u?void 0:d}function Tn(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Tn))}function Fn(e,n,i){for(var t=0;t<i.length;t++)kt(i[t],i[++t],i[++t]);D.__c&&D.__c(n,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(o){o.call(r)})}catch(o){D.__e(o,r.__v)}})}function Ln(e){return typeof e!="object"||e==null||e.__b>0?e:tt(e)?e.map(Ln):e.constructor!==void 0?null:le({},e)}function tr(e,n,i,t,r,o,s,d,p){var c,h,x,l,u,b,f,g=i.props||Je,k=n.props,m=n.type;if(m=="svg"?r="http://www.w3.org/2000/svg":m=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((u=o[c])&&"setAttribute"in u==!!m&&(m?u.localName==m:u.nodeType==3)){e=u,o[c]=null;break}}if(e==null){if(m==null)return document.createTextNode(k);e=document.createElementNS(r,m,k.is&&k),d&&(D.__m&&D.__m(n,o),d=!1),o=null}if(m==null)g===k||d&&e.data==k||(e.data=k);else{if(o=m=="textarea"&&k.defaultValue!=null?null:o&&et.call(e.childNodes),!d&&o!=null)for(g={},c=0;c<e.attributes.length;c++)g[(u=e.attributes[c]).name]=u.value;for(c in g)u=g[c],c=="dangerouslySetInnerHTML"?x=u:c=="children"||c in k||c=="value"&&"defaultValue"in k||c=="checked"&&"defaultChecked"in k||Ge(e,c,null,u,r);for(c in k)u=k[c],c=="children"?l=u:c=="dangerouslySetInnerHTML"?h=u:c=="value"?b=u:c=="checked"?f=u:d&&typeof u!="function"||g[c]===u||Ge(e,c,u,g[c],r);if(h)d||x&&(h.__html==x.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(x&&(e.innerHTML=""),En(n.type=="template"?e.content:e,tt(l)?l:[l],n,i,t,m=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:i.__k&&me(i,0),d,p),o!=null)for(c=o.length;c--;)_t(o[c]);d&&m!="textarea"||(c="value",m=="progress"&&b==null?e.removeAttribute("value"):b!=null&&(b!==e[c]||m=="progress"&&!b||m=="option"&&b!=g[c])&&Ge(e,c,b,g[c],r),c="checked",f!=null&&f!=e[c]&&Ge(e,c,f,g[c],r))}return e}function kt(e,n,i){try{if(typeof e=="function"){var t=typeof e.__u=="function";t&&e.__u(),t&&n==null||(e.__u=e(n))}else e.current=n}catch(r){D.__e(r,i)}}function Nn(e,n,i){var t,r;if(D.unmount&&D.unmount(e),(t=e.ref)&&(t.current&&t.current!=e.__e||kt(t,null,n)),(t=e.__c)!=null){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(o){D.__e(o,n)}t.base=t.__P=t.__n=null}if(t=e.__k)for(r=0;r<t.length;r++)t[r]&&Nn(t[r],n,i||typeof e.type!="function");i||_t(e.__e),e.__c=e.__=e.__e=void 0}function nr(e,n,i){return this.constructor(e,i)}function Ct(e,n,i){var t,r,o,s;n==document&&(n=document.documentElement),D.__&&D.__(e,n),r=(t=typeof i=="function")?null:i&&i.__k||n.__k,o=[],s=[],wt(n,e=(!t&&i||n).__k=Ji(Z,null,[e]),r||Je,Je,n.namespaceURI,!t&&i?[i]:r?null:n.firstChild?et.call(n.childNodes):null,o,!t&&i?i:r?r.__e:n.firstChild,t,s),Fn(o,e,s),e.props.children=null}et=Qe.slice,D={__e:function(e,n,i,t){for(var r,o,s;n=n.__;)if((r=n.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,t||{}),s=r.__d),s)return r.__E=r}catch(d){e=d}throw e}},_n=0,Xi=function(e){return e!=null&&e.constructor===void 0},Ke.prototype.setState=function(e,n){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=le({},this.state),typeof e=="function"&&(e=e(le({},i),this.props)),e&&le(i,e),e!=null&&this.__v&&(n&&this._sb.push(n),vn(this))},Ke.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),vn(this))},Ke.prototype.render=Z,ce=[],wn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,kn=function(e,n){return e.__v.__b-n.__v.__b},Ze.__r=0,bt=Math.random().toString(8),Xe="__d"+bt,Ie="__a"+bt,Cn=/(PointerCapture)$|Capture$/i,xt=0,vt=xn(!1),yt=xn(!0),Yi=0;var Se,U,St,Pn,it=0,Wn=[],j=D,Rn=j.__b,Dn=j.__r,Mn=j.diffed,On=j.__c,In=j.unmount,Hn=j.__;function rt(e,n){j.__h&&j.__h(U,e,it||n),it=0;var i=U.__H||(U.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function V(e){return it=1,ir(jn,e)}function ir(e,n,i){var t=rt(Se++,2);if(t.t=e,!t.__c&&(t.__=[i?i(n):jn(void 0,n),function(d){var p=t.__N?t.__N[0]:t.__[0],c=t.t(p,d);p!==c&&(t.__N=[c,t.__[1]],t.__c.setState({}))}],t.__c=U,!U.__f)){var r=function(d,p,c){if(!t.__c.__H)return!0;var h=!1,x=t.__c.props!==d;if(t.__c.__H.__.some(function(u){if(u.__N){h=!0;var b=u.__[0];u.__=u.__N,u.__N=void 0,b!==u.__[0]&&(x=!0)}}),o){var l=o.call(this,d,p,c);return h?l||x:l}return!h||x};U.__f=!0;var o=U.shouldComponentUpdate,s=U.componentWillUpdate;U.componentWillUpdate=function(d,p,c){if(this.__e){var h=o;o=void 0,r(d,p,c),o=h}s&&s.call(this,d,p,c)},U.shouldComponentUpdate=r}return t.__N||t.__}function Ee(e,n){var i=rt(Se++,3);!j.__s&&Tt(i.__H,n)&&(i.__=e,i.u=n,U.__H.__h.push(i))}function He(e,n){var i=rt(Se++,4);!j.__s&&Tt(i.__H,n)&&(i.__=e,i.u=n,U.__h.push(i))}function de(e){return it=5,At(function(){return{current:e}},[])}function At(e,n){var i=rt(Se++,7);return Tt(i.__H,n)&&(i.__=e(),i.__H=n,i.__h=e),i.__}function rr(){for(var e;e=Wn.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(nt),n.__h.some(Et),n.__h=[]}catch(i){n.__h=[],j.__e(i,e.__v)}}}j.__b=function(e){U=null,Rn&&Rn(e)},j.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),Hn&&Hn(e,n)},j.__r=function(e){Dn&&Dn(e),Se=0;var n=(U=e.__c).__H;n&&(St===U?(n.__h=[],U.__h=[],n.__.some(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(n.__h.some(nt),n.__h.some(Et),n.__h=[],Se=0)),St=U},j.diffed=function(e){Mn&&Mn(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(Wn.push(n)!==1&&Pn===j.requestAnimationFrame||((Pn=j.requestAnimationFrame)||or)(rr)),n.__H.__.some(function(i){i.u&&(i.__H=i.u,i.u=void 0)})),St=U=null},j.__c=function(e,n){n.some(function(i){try{i.__h.some(nt),i.__h=i.__h.filter(function(t){return!t.__||Et(t)})}catch(t){n.some(function(r){r.__h&&(r.__h=[])}),n=[],j.__e(t,i.__v)}}),On&&On(e,n)},j.unmount=function(e){In&&In(e);var n,i=e.__c;i&&i.__H&&(i.__H.__.some(function(t){try{nt(t)}catch(r){n=r}}),i.__H=void 0,n&&j.__e(n,i.__v))};var Un=typeof requestAnimationFrame=="function";function or(e){var n,i=function(){clearTimeout(t),Un&&cancelAnimationFrame(n),setTimeout(e)},t=setTimeout(i,35);Un&&(n=requestAnimationFrame(i))}function nt(e){var n=U,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),U=n}function Et(e){var n=U;e.__c=e.__(),U=n}function Tt(e,n){return!e||e.length!==n.length||n.some(function(i,t){return i!==e[t]})}function jn(e,n){return typeof n=="function"?n(e):n}var I;(function(e){e.INSERT="insert",e.DELETE="delete",e.CONTEXT="context"})(I||(I={}));var Bn={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},zn={LINES:"lines",WORDS:"words",NONE:"none"},$n={WORD:"word",CHAR:"char"},be;(function(e){e.AUTO="auto",e.DARK="dark",e.LIGHT="light"})(be||(be={}));var sr=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],ar=RegExp("["+sr.join("\\")+"]","g");function Vn(e){return e.replace(ar,"\\$&")}function Ft(e){return e&&e.replace(/\\/g,"/")}function qn(e){let n,i,t,r=0;for(n=0,t=e.length;n<t;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}function ot(e){let n=e.length,i=-1/0;for(let t=0;t<n;t++)i=Math.max(i,e[t]);return i}function Gn(e,n){let i=e.split(".");return i.length>1?i[i.length-1]:n}function Xn(e,n){return n.reduce((i,t)=>i||e.startsWith(t),!1)}var Yn=["a/","b/","i/","w/","c/","o/"];function ue(e,n,i){let t=i!==void 0?[...Yn,i]:Yn,r=n?new RegExp(`^${Vn(n)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,o=""]=r.exec(e)||[],s=t.find(p=>o.indexOf(p)===0);return(s?o.slice(s.length):o).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function lr(e,n){return ue(e,"---",n)}function cr(e,n){return ue(e,"+++",n)}function Kn(e,n={}){let i=[],t=null,r=null,o=null,s=null,d=null,p=null,c=null,h="--- ",x="+++ ",l="@@",u=/^old mode (\d{6})/,b=/^new mode (\d{6})/,f=/^deleted file mode (\d{6})/,g=/^new file mode (\d{6})/,k=/^copy from "?(.+)"?/,m=/^copy to "?(.+)"?/,S=/^rename from "?(.+)"?/,_=/^rename to "?(.+)"?/,F=/^similarity index (\d+)%/,M=/^dissimilarity index (\d+)%/,v=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,y=/^Binary files (.*) and (.*) differ/,w=/^GIT binary patch/,A=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,P=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,q=/^new file mode (\d{6})/,ie=/^deleted file mode (\d{6}),(\d{6})/,N=e.replace(/\/g,"").replace(/\r\n?/g,`
|
|
1
|
+
var Ui=Object.create;var nn=Object.defineProperty;var Wi=Object.getOwnPropertyDescriptor;var ji=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty;var mt=(e,n)=>()=>{try{return n||e((n={exports:{}}).exports,n),n.exports}catch(i){throw n=0,i}};var $i=(e,n,i,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ji(n))!zi.call(e,r)&&r!==i&&nn(e,r,{get:()=>n[r],enumerable:!(t=Wi(n,r))||t.enumerable});return e};var rn=(e,n,i)=>(i=e!=null?Ui(Bi(e)):{},$i(n||!e||!e.__esModule?nn(i,"default",{value:e,enumerable:!0}):i,e));var ii=mt(Vt=>{"use strict";(function(e){var n=/\S/,i=/\"/g,t=/\n/g,r=/\r/g,o=/\\/g,s=/\u2028/,c=/\u2029/;e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(y,k){var A=y.length,R=0,z=1,re=2,P=R,te=null,ae=null,J="",O=[],ne=!1,I=0,S=0,N="{{",C="}}";function le(){J.length>0&&(O.push({tag:"_t",text:new String(J)}),J="")}function qe(){for(var Q=!0,oe=S;oe<O.length;oe++)if(Q=e.tags[O[oe].tag]<e.tags._v||O[oe].tag=="_t"&&O[oe].text.match(n)===null,!Q)return!1;return Q}function Ge(Q,oe){if(le(),Q&&qe())for(var ce=S,Se;ce<O.length;ce++)O[ce].text&&((Se=O[ce+1])&&Se.tag==">"&&(Se.indent=O[ce].text.toString()),O.splice(ce,1));else oe||O.push({tag:`
|
|
2
|
+
`});ne=!1,S=O.length}function Ce(Q,oe){var ce="="+C,Se=Q.indexOf(ce,oe),gt=d(Q.substring(Q.indexOf("=",oe)+1,Se)).split(" ");return N=gt[0],C=gt[gt.length-1],Se+ce.length-1}for(k&&(k=k.split(" "),N=k[0],C=k[1]),I=0;I<A;I++)P==R?h(N,y,I)?(--I,le(),P=z):y.charAt(I)==`
|
|
3
|
+
`?Ge(ne):J+=y.charAt(I):P==z?(I+=N.length-1,ae=e.tags[y.charAt(I+1)],te=ae?y.charAt(I+1):"_v",te=="="?(I=Ce(y,I),P=R):(ae&&I++,P=re),ne=I):h(C,y,I)?(O.push({tag:te,n:d(J),otag:N,ctag:C,i:te=="/"?ne-N.length:I+C.length}),J="",I+=C.length-1,P=R,te=="{"&&(C=="}}"?I++:p(O[O.length-1]))):J+=y.charAt(I);return Ge(ne,!0),O};function p(m){m.n.substr(m.n.length-1)==="}"&&(m.n=m.n.substring(0,m.n.length-1))}function d(m){return m.trim?m.trim():m.replace(/^\s*|\s*$/g,"")}function h(m,y,k){if(y.charAt(k)!=m.charAt(0))return!1;for(var A=1,R=m.length;A<R;A++)if(y.charAt(k+A)!=m.charAt(A))return!1;return!0}var x={_t:!0,"\n":!0,$:!0,"/":!0};function l(m,y,k,A){var R=[],z=null,re=null,P=null;for(re=k[k.length-1];m.length>0;){if(P=m.shift(),re&&re.tag=="<"&&!(P.tag in x))throw new Error("Illegal content in < super tag.");if(e.tags[P.tag]<=e.tags.$||u(P,A))k.push(P),P.nodes=l(m,P.tag,k,A);else if(P.tag=="/"){if(k.length===0)throw new Error("Closing tag without opener: /"+P.n);if(z=k.pop(),P.n!=z.n&&!g(P.n,z.n,A))throw new Error("Nesting error: "+z.n+" vs. "+P.n);return z.end=P.i,R}else P.tag==`
|
|
4
|
+
`&&(P.last=m.length==0||m[0].tag==`
|
|
5
|
+
`);R.push(P)}if(k.length>0)throw new Error("missing closing tag: "+k.pop().n);return R}function u(m,y){for(var k=0,A=y.length;k<A;k++)if(y[k].o==m.n)return m.tag="#",!0}function g(m,y,k){for(var A=0,R=k.length;A<R;A++)if(k[A].c==m&&k[A].o==y)return!0}function f(m){var y=[];for(var k in m)y.push('"'+v(k)+'": function(c,p,t,i) {'+m[k]+"}");return"{ "+y.join(",")+" }"}function b(m){var y=[];for(var k in m.partials)y.push('"'+v(k)+'":{name:"'+v(m.partials[k].name)+'", '+b(m.partials[k])+"}");return"partials: {"+y.join(",")+"}, subs: "+f(m.subs)}e.stringify=function(m,y,k){return"{code: function (c,p,i) { "+e.wrapMain(m.code)+" },"+b(m)+"}"};var w=0;e.generate=function(m,y,k){w=0;var A={code:"",subs:{},partials:{}};return e.walk(m,A),k.asString?this.stringify(A,y,k):this.makeTemplate(A,y,k)},e.wrapMain=function(m){return'var t=this;t.b(i=i||"");'+m+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(m,y,k){var A=this.makePartials(m);return A.code=new Function("c","p","i",this.wrapMain(m.code)),new this.template(A,y,this,k)},e.makePartials=function(m){var y,k={subs:{},partials:m.partials,name:m.name};for(y in k.partials)k.partials[y]=this.makePartials(k.partials[y]);for(y in m.subs)k.subs[y]=new Function("c","p","t","i",m.subs[y]);return k};function v(m){return m.replace(o,"\\\\").replace(i,'\\"').replace(t,"\\n").replace(r,"\\r").replace(s,"\\u2028").replace(c,"\\u2029")}function _(m){return~m.indexOf(".")?"d":"f"}function E(m,y){var k="<"+(y.prefix||""),A=k+m.n+w++;return y.partials[A]={name:m.n,partials:{}},y.code+='t.b(t.rp("'+v(A)+'",c,p,"'+(m.indent||"")+'"));',A}e.codegen={"#":function(m,y){y.code+="if(t.s(t."+_(m.n)+'("'+v(m.n)+'",c,p,1),c,p,0,'+m.i+","+m.end+',"'+m.otag+" "+m.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(m.nodes,y),y.code+="});c.pop();}"},"^":function(m,y){y.code+="if(!t.s(t."+_(m.n)+'("'+v(m.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(m.nodes,y),y.code+="};"},">":E,"<":function(m,y){var k={partials:{},code:"",subs:{},inPartial:!0};e.walk(m.nodes,k);var A=y.partials[E(m,y)];A.subs=k.subs,A.partials=k.partials},$:function(m,y){var k={subs:{},code:"",partials:y.partials,prefix:m.n};e.walk(m.nodes,k),y.subs[m.n]=k.code,y.inPartial||(y.code+='t.sub("'+v(m.n)+'",c,p,i);')},"\n":function(m,y){y.code+=L('"\\n"'+(m.last?"":" + i"))},_v:function(m,y){y.code+="t.b(t.v(t."+_(m.n)+'("'+v(m.n)+'",c,p,0)));'},_t:function(m,y){y.code+=L('"'+v(m.text)+'"')},"{":T,"&":T};function T(m,y){y.code+="t.b(t.t(t."+_(m.n)+'("'+v(m.n)+'",c,p,0)));'}function L(m){return"t.b("+m+");"}e.walk=function(m,y){for(var k,A=0,R=m.length;A<R;A++)k=e.codegen[m[A].tag],k&&k(m[A],y);return y},e.parse=function(m,y,k){return k=k||{},l(m,"",[],k.sectionTags||[])},e.cache={},e.cacheKey=function(m,y){return[m,!!y.asString,!!y.disableLambda,y.delimiters,!!y.modelGet].join("||")},e.compile=function(m,y){y=y||{};var k=e.cacheKey(m,y),A=this.cache[k];if(A){var R=A.partials;for(var z in R)delete R[z].instance;return A}return A=this.generate(this.parse(this.scan(m,y.delimiters),m,y),m,y),this.cache[k]=A}})(typeof Vt<"u"?Vt:Hogan)});var ri=mt(qt=>{"use strict";var Nr={};(function(e){e.Template=function(l,u,g,f){l=l||{},this.r=l.code||this.r,this.c=g,this.options=f||{},this.text=u||"",this.partials=l.partials||{},this.subs=l.subs||{},this.buf=""},e.Template.prototype={r:function(l,u,g){return""},v:h,t:d,render:function(u,g,f){return this.ri([u],g||{},f)},ri:function(l,u,g){return this.r(l,u,g)},ep:function(l,u){var g=this.partials[l],f=u[g.name];if(g.instance&&g.base==f)return g.instance;if(typeof f=="string"){if(!this.c)throw new Error("No compiler available.");f=this.c.compile(f,this.options)}if(!f)return null;if(this.partials[l].base=f,g.subs){u.stackText||(u.stackText={});for(key in g.subs)u.stackText[key]||(u.stackText[key]=this.activeSub!==void 0&&u.stackText[this.activeSub]?u.stackText[this.activeSub]:this.text);f=i(f,g.subs,g.partials,this.stackSubs,this.stackPartials,u.stackText)}return this.partials[l].instance=f,f},rp:function(l,u,g,f){var b=this.ep(l,g);return b?b.ri(u,g,f):""},rs:function(l,u,g){var f=l[l.length-1];if(!x(f)){g(l,u,this);return}for(var b=0;b<f.length;b++)l.push(f[b]),g(l,u,this),l.pop()},s:function(l,u,g,f,b,w,v){var _;return x(l)&&l.length===0?!1:(typeof l=="function"&&(l=this.ms(l,u,g,f,b,w,v)),_=!!l,!f&&_&&u&&u.push(typeof l=="object"?l:u[u.length-1]),_)},d:function(l,u,g,f){var b,w=l.split("."),v=this.f(w[0],u,g,f),_=this.options.modelGet,E=null;if(l==="."&&x(u[u.length-2]))v=u[u.length-1];else for(var T=1;T<w.length;T++)b=n(w[T],v,_),b!==void 0?(E=v,v=b):v="";return f&&!v?!1:(!f&&typeof v=="function"&&(u.push(E),v=this.mv(v,u,g),u.pop()),v)},f:function(l,u,g,f){for(var b=!1,w=null,v=!1,_=this.options.modelGet,E=u.length-1;E>=0;E--)if(w=u[E],b=n(l,w,_),b!==void 0){v=!0;break}return v?(!f&&typeof b=="function"&&(b=this.mv(b,u,g)),b):f?!1:""},ls:function(l,u,g,f,b,w){var v=this.options.delimiters;return this.options.delimiters=w,this.b(this.ct(d(l.call(u,b,g)),u,f)),this.options.delimiters=v,!1},ct:function(l,u,g){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(l,this.options).render(u,g)},b:function(l){this.buf+=l},fl:function(){var l=this.buf;return this.buf="",l},ms:function(l,u,g,f,b,w,v){var _,E=u[u.length-1],T=l.call(E);return typeof T=="function"?f?!0:(_=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(T,E,u,g,_.substring(b,w),v)):T},mv:function(l,u,g){var f=u[u.length-1],b=l.call(f);return typeof b=="function"?this.ct(d(b.call(f)),f,g):b},sub:function(l,u,g,f){var b=this.subs[l];b&&(this.activeSub=l,b(u,g,this,f),this.activeSub=!1)}};function n(l,u,g){var f;return u&&typeof u=="object"&&(u[l]!==void 0?f=u[l]:g&&u.get&&typeof u.get=="function"&&(f=u.get(l))),f}function i(l,u,g,f,b,w){function v(){}v.prototype=l;function _(){}_.prototype=l.subs;var E,T=new v;T.subs=new _,T.subsText={},T.buf="",f=f||{},T.stackSubs=f,T.subsText=w;for(E in u)f[E]||(f[E]=u[E]);for(E in f)T.subs[E]=f[E];b=b||{},T.stackPartials=b;for(E in g)b[E]||(b[E]=g[E]);for(E in b)T.partials[E]=b[E];return T}var t=/&/g,r=/</g,o=/>/g,s=/\'/g,c=/\"/g,p=/[&<>\"\']/;function d(l){return String(l??"")}function h(l){return l=d(l),p.test(l)?l.replace(t,"&").replace(r,"<").replace(o,">").replace(s,"'").replace(c,"""):l}var x=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"}})(typeof qt<"u"?qt:Nr)});var Gt=mt((Qo,oi)=>{"use strict";var ft=ii();ft.Template=ri().Template;ft.template=ft.Template;oi.exports=ft});var an={unauthorized:4401,handshakeTimeout:4408,badMessage:4400},G=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),F=e=>typeof e=="string",on=e=>typeof e=="number"&&Number.isFinite(e),Ie=e=>Number.isInteger(e),Ee=e=>typeof e=="boolean",U=e=>n=>n===void 0||e(n),q=e=>n=>Array.isArray(n)&&n.every(e),Y=e=>n=>F(n)&&e.includes(n),Vi=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,ie=e=>F(e)&&Vi.test(e);function ln(e){return G(e)&&e.type==="welcome"&&e.protocol===1&&F(e.agentVersion)&&G(e.project)&&F(e.project.framework)&&F(e.project.root)}function cn(e){return!G(e)||e.type!=="response"||!F(e.id)||!Ee(e.ok)||e.error!==void 0&&(!G(e.error)||!F(e.error.code)||!F(e.error.message))?null:e}function dn(e){return!G(e)||e.type!=="event"||!F(e.event)?null:e}var un=["typecheck","lint","test","build","browser","visual"],pn=["passed","failed","skipped","not_run","running"],fn=["draft","planning","awaiting_clarification","applying","verifying","preview_ready","awaiting_approval","approved","released","rejected","failed","cancelled"],qi=["starting","planning","patching","applying","checking","reporting","reverting","accepting"],Gi=["replan","revise","revert","reload","login"],Xi=["changed_since_plan","changed_while_applying","changed_since_apply"],Yi=e=>G(e)&&Y(["proceed","clarify","out_of_scope"])(e.decision)&&F(e.summary)&&q(n=>G(n)&&F(n.description)&&q(F)(n.files))(e.steps)&&U(F)(e.clarifyingQuestion)&&U(F)(e.outOfScopeReason)&&U(q(F))(e.notDoing)&&U(q(F))(e.envVars)&&U(q(F))(e.sensitive),Ki=e=>G(e)&&Y(un)(e.kind)&&Y(pn)(e.status)&&U(F)(e.command)&&U(F)(e.reason)&&U(Ee)(e.preExisting)&&(e.baseline===void 0||Y(["passed","failed"])(e.baseline))&&(e.evidence===void 0||G(e.evidence)&&U(Ie)(e.evidence.exitCode)&&U(F)(e.evidence.summary)&&U(q(F))(e.evidence.artifactKeys))&&(e.durationMs===void 0||Ie(e.durationMs)&&e.durationMs>=0);function hn(e){return!G(e)||!F(e.type)?null:(()=>{switch(e.type){case"planning":case"reverted":case"accepted":case"cancelled":return ie(e.changeId)&&(e.type!=="reverted"||q(F)(e.files));case"plan":return ie(e.changeId)&&Yi(e.plan)&&F(e.model)&&(e.cost===void 0||on(e.cost)&&e.cost>=0);case"clarification":return ie(e.changeId)&&F(e.question)&&(e.integration===void 0||G(e.integration)&&F(e.integration.capability)&&q(F)(e.integration.providers)&&F(e.integration.reason)&&U(F)(e.integration.connectUrl));case"applying":return ie(e.changeId)&&Ie(e.files);case"checking":return ie(e.changeId)&&q(i=>G(i)&&Y(un)(i.kind)&&Y(pn)(i.status))(e.checks);case"result":return ie(e.changeId)&&Y(fn)(e.state)&&q(i=>G(i)&&F(i.path)&&Ie(i.additions)&&Ie(i.deletions)&&U(F)(i.explanation)&&U(Y(["create","modify","delete"]))(i.kind))(e.files)&&F(e.diff)&&q(Ki)(e.checks)&&(e.cost===void 0||on(e.cost)&&e.cost>=0)&&U(F)(e.summary)&&U(q(F))(e.envVars)&&U(q(F))(e.notDone)&&U(q(F))(e.sensitive);case"activity":return ie(e.changeId)&&Y(["plan","apply"])(e.phase)&&F(e.tool)&&F(e.text);case"conflict":return ie(e.changeId)&&q(F)(e.files)&&Y(Xi)(e.reason)&&F(e.message);case"failed":return U(ie)(e.changeId)&&F(e.code)&&F(e.message)&&Ee(e.retryable)&&(e.stage===void 0||Y(qi)(e.stage))&&U(Ee)(e.filesChanged)&&(e.next===void 0||q(Y(Gi))(e.next));case"permission_denied":return U(ie)(e.changeId)&&F(e.message);default:return!1}})()?e:null}function gn(e){if(!G(e)||!F(e.defaultModel))return null;let n=t=>typeof t=="number"&&Number.isFinite(t)&&t>=0;return q(t=>G(t)&&F(t.id)&&Y(["anthropic","openai","google"])(t.provider)&&F(t.label)&&F(t.description)&&n(t.creditWeight)&&t.creditWeight>0&&n(t.typicalCredits)&&Ee(t.allowed)&&Ee(t.available))(e.models)?e:null}var Ji=["queued","building","ready","error","canceled"],bt=e=>{if(!F(e))return!1;try{return new URL(e),!0}catch{return!1}},sn=e=>n=>n===null||e(n);function mn(e){if(!G(e))return null;let n=e.preview;return ie(e.changeId)&&Y(fn)(e.state)&&bt(e.changeUrl)&&sn(bt)(e.pullRequestUrl)&&(n===null||G(n)&&Y(Ji)(n.status)&&sn(bt)(n.url))?e:null}var tt,D,_n,Qi,pe,bn,wn,kn,vt,Ye,He,Cn,_t,yt,xt,Zi,Qe={},Ze=[],er=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,nt=Array.isArray;function de(e,n){for(var i in n)e[i]=n[i];return e}function wt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function tr(e,n,i){var t,r,o,s={};for(o in n)o=="key"?t=n[o]:o=="ref"?r=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?tt.call(arguments,2):i),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return Ke(e,s,t,r,null)}function Ke(e,n,i,t,r){var o={type:e,props:n,key:i,ref:t,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++_n,__i:-1,__u:0};return r==null&&D.vnode!=null&&D.vnode(o),o}function K(e){return e.children}function Je(e,n){this.props=e,this.context=n}function ve(e,n){if(n==null)return e.__?ve(e.__,e.__i+1):null;for(var i;n<e.__k.length;n++)if((i=e.__k[n])!=null&&i.__e!=null)return i.__e;return typeof e.type=="function"?ve(e):null}function nr(e){if(e.__P&&e.__d){var n=e.__v,i=n.__e,t=[],r=[],o=de({},n);o.__v=n.__v+1,D.vnode&&D.vnode(o),kt(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[i]:null,t,i??ve(n),!!(32&n.__u),r),o.__v=n.__v,o.__.__k[o.__i]=o,Fn(t,o,r),n.__e=n.__=null,o.__e!=i&&Sn(o)}}function Sn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(n){if(n!=null&&n.__e!=null)return e.__e=e.__c.base=n.__e}),Sn(e)}function vn(e){(!e.__d&&(e.__d=!0)&&pe.push(e)&&!et.__r++||bn!=D.debounceRendering)&&((bn=D.debounceRendering)||wn)(et)}function et(){try{for(var e,n=1;pe.length;)pe.length>n&&pe.sort(kn),e=pe.shift(),n=pe.length,nr(e)}finally{pe.length=et.__r=0}}function En(e,n,i,t,r,o,s,c,p,d,h){var x,l,u,g,f,b,w=t&&t.__k||Ze,v=n.length;for(p=ir(i,n,w,p,v),x=0;x<v;x++)(u=i.__k[x])!=null&&(l=u.__i!=-1&&w[u.__i]||Qe,u.__i=x,b=kt(e,u,l,r,o,s,c,p,d,h),g=u.__e,u.ref&&l.ref!=u.ref&&(l.ref&&Ct(l.ref,null,u),h.push(u.ref,u.__c||g,u)),f==null&&g!=null&&(f=g),4&u.__u?(p=An(u,p,e),l.__e&&(l.__e=null)):typeof u.type=="function"&&b!==void 0?p=b:g&&(p=g.nextSibling),u.__u&=-7);return i.__e=f,p}function ir(e,n,i,t,r){var o,s,c,p,d,h=i.length,x=h,l=0;for(e.__k=new Array(r),o=0;o<r;o++)(s=n[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=e.__k[o]=Ke(null,s,null,null,null):nt(s)?s=e.__k[o]=Ke(K,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=e.__k[o]=Ke(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[o]=s,p=o+l,s.__=e,s.__b=e.__b+1,c=null,(d=s.__i=rr(s,i,p,x))!=-1&&(x--,(c=i[d])&&(c.__u|=2)),c==null||c.__v==null?(d==-1&&(r>h?l--:r<h&&l++),typeof s.type!="function"&&(s.__u|=4)):d!=p&&(d==p-1?l--:d==p+1?l++:(d>p?l--:l++,s.__u|=4))):e.__k[o]=null;if(x)for(o=0;o<h;o++)(c=i[o])!=null&&(2&c.__u)==0&&(c.__e==t&&(t=ve(c)),Nn(c,c));return t}function An(e,n,i){var t,r;if(typeof e.type=="function"){for(t=e.__k,r=0;t&&r<t.length;r++)t[r]&&(t[r].__=e,n=An(t[r],n,i));return n}e.__e!=n&&(n&&e.type&&!n.parentNode&&(n=ve(e)),n=i.insertBefore(e.__e,n||null));do n=n&&n.nextSibling;while(n!=null&&n.nodeType==8);return n}function rr(e,n,i,t){var r,o,s,c=e.key,p=e.type,d=n[i],h=d!=null&&(2&d.__u)==0;if(d===null&&c==null||h&&c==d.key&&p==d.type)return i;if(t>(h?1:0)){for(r=i-1,o=i+1;r>=0||o<n.length;)if((d=n[s=r>=0?r--:o++])!=null&&(2&d.__u)==0&&c==d.key&&p==d.type)return s}return-1}function yn(e,n,i){n[0]=="-"?e.setProperty(n,i??""):e[n]=i==null?"":typeof i!="number"||er.test(n)?i:i+"px"}function Xe(e,n,i,t,r){var o,s;e:if(n=="style")if(typeof i=="string")e.style.cssText=i;else{if(typeof t=="string"&&(e.style.cssText=t=""),t)for(n in t)i&&n in i||yn(e.style,n,"");if(i)for(n in i)t&&i[n]==t[n]||yn(e.style,n,i[n])}else if(n[0]=="o"&&n[1]=="n")o=n!=(n=n.replace(Cn,"$1")),s=n.toLowerCase(),n=s in e||n=="onFocusOut"||n=="onFocusIn"?s.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+o]=i,i?t?i[He]=t[He]:(i[He]=_t,e.addEventListener(n,o?xt:yt,o)):e.removeEventListener(n,o?xt:yt,o);else{if(r=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=i??"";break e}catch{}typeof i=="function"||(i==null||i===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&i==1?"":i))}}function xn(e){return function(n){if(this.l){var i=this.l[n.type+e];if(n[Ye]==null)n[Ye]=_t++;else if(n[Ye]<i[He])return;return i(D.event?D.event(n):n)}}}function kt(e,n,i,t,r,o,s,c,p,d){var h,x,l,u,g,f,b,w,v,_,E,T,L,m,y,k,A=n.type;if(n.constructor!==void 0)return null;128&i.__u&&(p=!!(32&i.__u),o=[c=n.__e=i.__e]),(h=D.__b)&&h(n);e:if(typeof A=="function"){x=s.length;try{if(v=n.props,_=A.prototype&&A.prototype.render,E=(h=A.contextType)&&t[h.__c],T=h?E?E.props.value:h.__:t,i.__c?w=(l=n.__c=i.__c).__=l.__E:(_?n.__c=l=new A(v,T):(n.__c=l=new Je(v,T),l.constructor=A,l.render=sr),E&&E.sub(l),l.state||(l.state={}),l.__n=t,u=l.__d=!0,l.__h=[],l._sb=[]),_&&l.__s==null&&(l.__s=l.state),_&&A.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=de({},l.__s)),de(l.__s,A.getDerivedStateFromProps(v,l.__s))),g=l.props,f=l.state,l.__v=n,u)_&&A.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),_&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(_&&A.getDerivedStateFromProps==null&&v!==g&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(v,T),n.__v==i.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(v,l.__s,T)===!1){n.__v!=i.__v&&(l.props=v,l.state=l.__s,l.__d=!1),n.__e=i.__e,n.__k=i.__k,n.__k.some(function(R){R&&(R.__=n)}),Ze.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&s.push(l),c=ve(i);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(v,l.__s,T),_&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(g,f,b)})}if(l.context=T,l.props=v,l.__P=e,l.__e=!1,L=D.__r,m=0,_)l.state=l.__s,l.__d=!1,L&&L(n),h=l.render(l.props,l.state,l.context),Ze.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,L&&L(n),h=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++m<25);l.state=l.__s,l.getChildContext!=null&&(t=de(de({},t),l.getChildContext())),_&&!u&&l.getSnapshotBeforeUpdate!=null&&(b=l.getSnapshotBeforeUpdate(g,f)),y=h!=null&&h.type===K&&h.key==null?Ln(h.props.children):h,c=En(e,nt(y)?y:[y],n,i,t,r,o,s,c,p,d),l.base=n.__e,n.__u&=-161,l.__h.length&&s.push(l),w&&(l.__E=l.__=null)}catch(R){if(s.length=x,n.__v=null,p||o!=null){if(R.then){for(n.__u|=p?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),n.__e=c}else if(o!=null)for(k=o.length;k--;)wt(o[k])}else n.__e=i.__e;n.__k==null&&(n.__k=i.__k||[]),R.then||Tn(n),D.__e(R,n,i)}}else o==null&&n.__v==i.__v?(n.__k=i.__k,n.__e=i.__e):c=n.__e=or(i.__e,n,i,t,r,o,s,p,d);return(h=D.diffed)&&h(n),128&n.__u?void 0:c}function Tn(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Tn))}function Fn(e,n,i){for(var t=0;t<i.length;t++)Ct(i[t],i[++t],i[++t]);D.__c&&D.__c(n,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(o){o.call(r)})}catch(o){D.__e(o,r.__v)}})}function Ln(e){return typeof e!="object"||e==null||e.__b>0?e:nt(e)?e.map(Ln):e.constructor!==void 0?null:de({},e)}function or(e,n,i,t,r,o,s,c,p){var d,h,x,l,u,g,f,b=i.props||Qe,w=n.props,v=n.type;if(v=="svg"?r="http://www.w3.org/2000/svg":v=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((u=o[d])&&"setAttribute"in u==!!v&&(v?u.localName==v:u.nodeType==3)){e=u,o[d]=null;break}}if(e==null){if(v==null)return document.createTextNode(w);e=document.createElementNS(r,v,w.is&&w),c&&(D.__m&&D.__m(n,o),c=!1),o=null}if(v==null)b===w||c&&e.data==w||(e.data=w);else{if(o=v=="textarea"&&w.defaultValue!=null?null:o&&tt.call(e.childNodes),!c&&o!=null)for(b={},d=0;d<e.attributes.length;d++)b[(u=e.attributes[d]).name]=u.value;for(d in b)u=b[d],d=="dangerouslySetInnerHTML"?x=u:d=="children"||d in w||d=="value"&&"defaultValue"in w||d=="checked"&&"defaultChecked"in w||Xe(e,d,null,u,r);for(d in w)u=w[d],d=="children"?l=u:d=="dangerouslySetInnerHTML"?h=u:d=="value"?g=u:d=="checked"?f=u:c&&typeof u!="function"||b[d]===u||Xe(e,d,u,b[d],r);if(h)c||x&&(h.__html==x.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),n.__k=[];else if(x&&(e.innerHTML=""),En(n.type=="template"?e.content:e,nt(l)?l:[l],n,i,t,v=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:i.__k&&ve(i,0),c,p),o!=null)for(d=o.length;d--;)wt(o[d]);c&&v!="textarea"||(d="value",v=="progress"&&g==null?e.removeAttribute("value"):g!=null&&(g!==e[d]||v=="progress"&&!g||v=="option"&&g!=b[d])&&Xe(e,d,g,b[d],r),d="checked",f!=null&&f!=e[d]&&Xe(e,d,f,b[d],r))}return e}function Ct(e,n,i){try{if(typeof e=="function"){var t=typeof e.__u=="function";t&&e.__u(),t&&n==null||(e.__u=e(n))}else e.current=n}catch(r){D.__e(r,i)}}function Nn(e,n,i){var t,r;if(D.unmount&&D.unmount(e),(t=e.ref)&&(t.current&&t.current!=e.__e||Ct(t,null,n)),(t=e.__c)!=null){if(t.componentWillUnmount)try{t.componentWillUnmount()}catch(o){D.__e(o,n)}t.base=t.__P=t.__n=null}if(t=e.__k)for(r=0;r<t.length;r++)t[r]&&Nn(t[r],n,i||typeof e.type!="function");i||wt(e.__e),e.__c=e.__=e.__e=void 0}function sr(e,n,i){return this.constructor(e,i)}function St(e,n,i){var t,r,o,s;n==document&&(n=document.documentElement),D.__&&D.__(e,n),r=(t=typeof i=="function")?null:i&&i.__k||n.__k,o=[],s=[],kt(n,e=(!t&&i||n).__k=tr(K,null,[e]),r||Qe,Qe,n.namespaceURI,!t&&i?[i]:r?null:n.firstChild?tt.call(n.childNodes):null,o,!t&&i?i:r?r.__e:n.firstChild,t,s),Fn(o,e,s),e.props.children=null}tt=Ze.slice,D={__e:function(e,n,i,t){for(var r,o,s;n=n.__;)if((r=n.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(e)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,t||{}),s=r.__d),s)return r.__E=r}catch(c){e=c}throw e}},_n=0,Qi=function(e){return e!=null&&e.constructor===void 0},Je.prototype.setState=function(e,n){var i;i=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=de({},this.state),typeof e=="function"&&(e=e(de({},i),this.props)),e&&de(i,e),e!=null&&this.__v&&(n&&this._sb.push(n),vn(this))},Je.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),vn(this))},Je.prototype.render=K,pe=[],wn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,kn=function(e,n){return e.__v.__b-n.__v.__b},et.__r=0,vt=Math.random().toString(8),Ye="__d"+vt,He="__a"+vt,Cn=/(PointerCapture)$|Capture$/i,_t=0,yt=xn(!1),xt=xn(!0),Zi=0;var Ae,H,Et,Pn,rt=0,Wn=[],W=D,Rn=W.__b,Dn=W.__r,Mn=W.diffed,On=W.__c,In=W.unmount,Hn=W.__;function ot(e,n){W.__h&&W.__h(H,e,rt||n),rt=0;var i=H.__H||(H.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function $(e){return rt=1,ar(jn,e)}function ar(e,n,i){var t=ot(Ae++,2);if(t.t=e,!t.__c&&(t.__=[i?i(n):jn(void 0,n),function(c){var p=t.__N?t.__N[0]:t.__[0],d=t.t(p,c);p!==d&&(t.__N=[d,t.__[1]],t.__c.setState({}))}],t.__c=H,!H.__f)){var r=function(c,p,d){if(!t.__c.__H)return!0;var h=!1,x=t.__c.props!==c;if(t.__c.__H.__.some(function(u){if(u.__N){h=!0;var g=u.__[0];u.__=u.__N,u.__N=void 0,g!==u.__[0]&&(x=!0)}}),o){var l=o.call(this,c,p,d);return h?l||x:l}return!h||x};H.__f=!0;var o=H.shouldComponentUpdate,s=H.componentWillUpdate;H.componentWillUpdate=function(c,p,d){if(this.__e){var h=o;o=void 0,r(c,p,d),o=h}s&&s.call(this,c,p,d)},H.shouldComponentUpdate=r}return t.__N||t.__}function ye(e,n){var i=ot(Ae++,3);!W.__s&&Ft(i.__H,n)&&(i.__=e,i.u=n,H.__H.__h.push(i))}function ue(e,n){var i=ot(Ae++,4);!W.__s&&Ft(i.__H,n)&&(i.__=e,i.u=n,H.__h.push(i))}function Z(e){return rt=5,Tt(function(){return{current:e}},[])}function Tt(e,n){var i=ot(Ae++,7);return Ft(i.__H,n)&&(i.__=e(),i.__H=n,i.__h=e),i.__}function lr(){for(var e;e=Wn.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(it),n.__h.some(At),n.__h=[]}catch(i){n.__h=[],W.__e(i,e.__v)}}}W.__b=function(e){H=null,Rn&&Rn(e)},W.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),Hn&&Hn(e,n)},W.__r=function(e){Dn&&Dn(e),Ae=0;var n=(H=e.__c).__H;n&&(Et===H?(n.__h=[],H.__h=[],n.__.some(function(i){i.__N&&(i.__=i.__N),i.u=i.__N=void 0})):(n.__h.some(it),n.__h.some(At),n.__h=[],Ae=0)),Et=H},W.diffed=function(e){Mn&&Mn(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(Wn.push(n)!==1&&Pn===W.requestAnimationFrame||((Pn=W.requestAnimationFrame)||cr)(lr)),n.__H.__.some(function(i){i.u&&(i.__H=i.u,i.u=void 0)})),Et=H=null},W.__c=function(e,n){n.some(function(i){try{i.__h.some(it),i.__h=i.__h.filter(function(t){return!t.__||At(t)})}catch(t){n.some(function(r){r.__h&&(r.__h=[])}),n=[],W.__e(t,i.__v)}}),On&&On(e,n)},W.unmount=function(e){In&&In(e);var n,i=e.__c;i&&i.__H&&(i.__H.__.some(function(t){try{it(t)}catch(r){n=r}}),i.__H=void 0,n&&W.__e(n,i.__v))};var Un=typeof requestAnimationFrame=="function";function cr(e){var n,i=function(){clearTimeout(t),Un&&cancelAnimationFrame(n),setTimeout(e)},t=setTimeout(i,35);Un&&(n=requestAnimationFrame(i))}function it(e){var n=H,i=e.__c;typeof i=="function"&&(e.__c=void 0,i()),H=n}function At(e){var n=H;e.__c=e.__(),H=n}function Ft(e,n){return!e||e.length!==n.length||n.some(function(i,t){return i!==e[t]})}function jn(e,n){return typeof n=="function"?n(e):n}var M;(function(e){e.INSERT="insert",e.DELETE="delete",e.CONTEXT="context"})(M||(M={}));var Bn={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},zn={LINES:"lines",WORDS:"words",NONE:"none"},$n={WORD:"word",CHAR:"char"},xe;(function(e){e.AUTO="auto",e.DARK="dark",e.LIGHT="light"})(xe||(xe={}));var dr=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],ur=RegExp("["+dr.join("\\")+"]","g");function Vn(e){return e.replace(ur,"\\$&")}function Lt(e){return e&&e.replace(/\\/g,"/")}function qn(e){let n,i,t,r=0;for(n=0,t=e.length;n<t;n++)i=e.charCodeAt(n),r=(r<<5)-r+i,r|=0;return r}function st(e){let n=e.length,i=-1/0;for(let t=0;t<n;t++)i=Math.max(i,e[t]);return i}function Gn(e,n){let i=e.split(".");return i.length>1?i[i.length-1]:n}function Xn(e,n){return n.reduce((i,t)=>i||e.startsWith(t),!1)}var Yn=["a/","b/","i/","w/","c/","o/"];function fe(e,n,i){let t=i!==void 0?[...Yn,i]:Yn,r=n?new RegExp(`^${Vn(n)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,o=""]=r.exec(e)||[],s=t.find(p=>o.indexOf(p)===0);return(s?o.slice(s.length):o).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function pr(e,n){return fe(e,"---",n)}function fr(e,n){return fe(e,"+++",n)}function Kn(e,n={}){let i=[],t=null,r=null,o=null,s=null,c=null,p=null,d=null,h="--- ",x="+++ ",l="@@",u=/^old mode (\d{6})/,g=/^new mode (\d{6})/,f=/^deleted file mode (\d{6})/,b=/^new file mode (\d{6})/,w=/^copy from "?(.+)"?/,v=/^copy to "?(.+)"?/,_=/^rename from "?(.+)"?/,E=/^rename to "?(.+)"?/,T=/^similarity index (\d+)%/,L=/^dissimilarity index (\d+)%/,m=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,y=/^Binary files (.*) and (.*) differ/,k=/^GIT binary patch/,A=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,R=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,z=/^new file mode (\d{6})/,re=/^deleted file mode (\d{6}),(\d{6})/,P=e.replace(/\/g,"").replace(/\r\n?/g,`
|
|
6
6
|
`).split(`
|
|
7
|
-
`);function te(){r!==null&&t!==null&&(t.blocks.push(r),r=null)}function se(){t!==null&&(!t.oldName&&p!==null&&(t.oldName=p),!t.newName&&c!==null&&(t.newName=c),t.newName&&(i.push(t),t=null)),p=null,c=null}function J(){te(),se(),t={blocks:[],deletedLines:0,addedLines:0}}function H(E){te();let L;t!==null&&((L=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(E))?(t.isCombined=!1,o=parseInt(L[1],10),d=parseInt(L[2],10)):(L=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(E))?(t.isCombined=!0,o=parseInt(L[1],10),s=parseInt(L[2],10),d=parseInt(L[3],10)):(E.startsWith(l)&&console.error("Failed to parse lines, starting in 0!"),o=0,d=0,t.isCombined=!1)),r={lines:[],oldStartLine:o,oldStartLine2:s,newStartLine:d,header:E}}function O(E){if(t===null||r===null||o===null||d===null)return;let L={content:E},C=t.isCombined?["+ "," +","++"]:["+"],_e=t.isCombined?["- "," -","--"]:["-"];Xn(E,C)?(t.addedLines++,L.type=I.INSERT,L.oldNumber=void 0,L.newNumber=d++):Xn(E,_e)?(t.deletedLines++,L.type=I.DELETE,L.oldNumber=o++,L.newNumber=void 0):(L.type=I.CONTEXT,L.oldNumber=o++,L.newNumber=d++),r.lines.push(L)}function R(E,L){let C=L;for(;C<N.length-3;){if(E.startsWith("diff"))return!1;if(N[C].startsWith(h)&&N[C+1].startsWith(x)&&N[C+2].startsWith(l))return!0;C++}return!1}return N.forEach((E,L)=>{if(!E||E.startsWith("*"))return;let C,_e=N[L-1],Ve=N[L+1],qe=N[L+2];if(E.startsWith("diff --git")||E.startsWith("diff --combined")){if(J(),(C=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(E))&&(p=ue(C[1],void 0,n.dstPrefix),c=ue(C[2],void 0,n.srcPrefix)),t===null)throw new Error("Where is my file !!!");t.isGitDiff=!0;return}if(E.startsWith("Binary files")&&!t?.isGitDiff){if(J(),(C=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(E))&&(p=ue(C[1],void 0,n.dstPrefix),c=ue(C[2],void 0,n.srcPrefix)),t===null)throw new Error("Where is my file !!!");t.isBinary=!0;return}if((!t||!t.isGitDiff&&t&&E.startsWith(h)&&Ve.startsWith(x)&&qe.startsWith(l))&&J(),t?.isTooBig)return;if(t&&(typeof n.diffMaxChanges=="number"&&t.addedLines+t.deletedLines>n.diffMaxChanges||typeof n.diffMaxLineLength=="number"&&E.length>n.diffMaxLineLength)){t.isTooBig=!0,t.addedLines=0,t.deletedLines=0,t.blocks=[],r=null;let Q=typeof n.diffTooBigMessage=="function"?n.diffTooBigMessage(i.length):"Diff too big to be displayed";H(Q);return}if(E.startsWith(h)&&Ve.startsWith(x)||E.startsWith(x)&&_e.startsWith(h)){if(t&&!t.oldName&&E.startsWith("--- ")&&(C=lr(E,n.srcPrefix))){t.oldName=C,t.language=Gn(t.oldName,t.language);return}if(t&&!t.newName&&E.startsWith("+++ ")&&(C=cr(E,n.dstPrefix))){t.newName=C,t.language=Gn(t.newName,t.language);return}}if(t&&(E.startsWith(l)||t.isGitDiff&&t.oldName&&t.newName&&!r)){H(E);return}if(r&&(E.startsWith("+")||E.startsWith("-")||E.startsWith(" "))){O(E);return}let we=!R(E,L);if(t===null)throw new Error("Where is my file !!!");(C=u.exec(E))?t.oldMode=C[1]:(C=b.exec(E))?t.newMode=C[1]:(C=f.exec(E))?(t.deletedFileMode=C[1],t.isDeleted=!0):(C=g.exec(E))?(t.newFileMode=C[1],t.isNew=!0):(C=k.exec(E))?(we&&(t.oldName=C[1]),t.isCopy=!0):(C=m.exec(E))?(we&&(t.newName=C[1]),t.isCopy=!0):(C=S.exec(E))?(we&&(t.oldName=C[1]),t.isRename=!0):(C=_.exec(E))?(we&&(t.newName=C[1]),t.isRename=!0):(C=y.exec(E))?(t.isBinary=!0,t.oldName=ue(C[1],void 0,n.srcPrefix),t.newName=ue(C[2],void 0,n.dstPrefix),H("Binary file")):w.test(E)?(t.isBinary=!0,H(E)):(C=F.exec(E))?t.unchangedPercentage=parseInt(C[1],10):(C=M.exec(E))?t.changedPercentage=parseInt(C[1],10):(C=v.exec(E))?(t.checksumBefore=C[1],t.checksumAfter=C[2],C[3]&&(t.mode=C[3])):(C=A.exec(E))?(t.checksumBefore=[C[2],C[3]],t.checksumAfter=C[1]):(C=P.exec(E))?(t.oldMode=[C[2],C[3]],t.newMode=C[1]):(C=q.exec(E))?(t.newFileMode=C[1],t.isNew=!0):(C=ie.exec(E))&&(t.deletedFileMode=C[1],t.isDeleted=!0)}),te(),se(),i}var pe=class{diff(n,i,t={}){let r;typeof t=="function"?(r=t,t={}):"callback"in t&&(r=t.callback);let o=this.castInput(n,t),s=this.castInput(i,t),d=this.removeEmpty(this.tokenize(o,t)),p=this.removeEmpty(this.tokenize(s,t));return this.diffWithOptionsObj(d,p,t,r)}diffWithOptionsObj(n,i,t,r){var o;let s=m=>{if(m=this.postProcess(m,t),r){setTimeout(function(){r(m)},0);return}else return m},d=i.length,p=n.length,c=1,h=d+p;t.maxEditLength!=null&&(h=Math.min(h,t.maxEditLength));let x=(o=t.timeout)!==null&&o!==void 0?o:1/0,l=Date.now()+x,u=[{oldPos:-1,lastComponent:void 0}],b=this.extractCommon(u[0],i,n,0,t);if(u[0].oldPos+1>=p&&b+1>=d)return s(this.buildValues(u[0].lastComponent,i,n));let f=-1/0,g=1/0,k=()=>{for(let m=Math.max(f,-c);m<=Math.min(g,c);m+=2){let S,_=u[m-1],F=u[m+1];_&&(u[m-1]=void 0);let M=!1;if(F){let y=F.oldPos-m;M=F&&0<=y&&y<d}let v=_&&_.oldPos+1<p;if(!M&&!v){u[m]=void 0;continue}if(!v||M&&_.oldPos<F.oldPos?S=this.addToPath(F,!0,!1,0,t):S=this.addToPath(_,!1,!0,1,t),b=this.extractCommon(S,i,n,m,t),S.oldPos+1>=p&&b+1>=d)return s(this.buildValues(S.lastComponent,i,n))||!0;u[m]=S,S.oldPos+1>=p&&(g=Math.min(g,m-1)),b+1>=d&&(f=Math.max(f,m+1))}c++};if(r)(function m(){setTimeout(function(){if(c>h||Date.now()>l)return r(void 0);k()||m()},0)})();else for(;c<=h&&Date.now()<=l;){let m=k();if(m)return m}}addToPath(n,i,t,r,o){let s=n.lastComponent;return s&&!o.oneChangePerToken&&s.added===i&&s.removed===t?{oldPos:n.oldPos+r,lastComponent:{count:s.count+1,added:i,removed:t,previousComponent:s.previousComponent}}:{oldPos:n.oldPos+r,lastComponent:{count:1,added:i,removed:t,previousComponent:s}}}extractCommon(n,i,t,r,o){let s=i.length,d=t.length,p=n.oldPos,c=p-r,h=0;for(;c+1<s&&p+1<d&&this.equals(t[p+1],i[c+1],o);)c++,p++,h++,o.oneChangePerToken&&(n.lastComponent={count:1,previousComponent:n.lastComponent,added:!1,removed:!1});return h&&!o.oneChangePerToken&&(n.lastComponent={count:h,previousComponent:n.lastComponent,added:!1,removed:!1}),n.oldPos=p,c}equals(n,i,t){return t.comparator?t.comparator(n,i):n===i||!!t.ignoreCase&&n.toLowerCase()===i.toLowerCase()}removeEmpty(n){let i=[];for(let t=0;t<n.length;t++)n[t]&&i.push(n[t]);return i}castInput(n,i){return n}tokenize(n,i){return Array.from(n)}join(n){return n.join("")}postProcess(n,i){return n}get useLongestToken(){return!1}buildValues(n,i,t){let r=[],o;for(;n;)r.push(n),o=n.previousComponent,delete n.previousComponent,n=o;r.reverse();let s=r.length,d=0,p=0,c=0;for(;d<s;d++){let h=r[d];if(h.removed)h.value=this.join(t.slice(c,c+h.count)),c+=h.count;else{if(!h.added&&this.useLongestToken){let x=i.slice(p,p+h.count);x=x.map(function(l,u){let b=t[c+u];return b.length>l.length?b:l}),h.value=this.join(x)}else h.value=this.join(i.slice(p,p+h.count));p+=h.count,h.added||(c+=h.count)}}return r}};var Lt=class extends pe{},Jn=new Lt;function Nt(e,n,i){return Jn.diff(e,n,i)}function Pt(e,n){let i;for(i=0;i<e.length&&i<n.length;i++)if(e[i]!=n[i])return e.slice(0,i);return e.slice(0,i)}function Rt(e,n){let i;if(!e||!n||e[e.length-1]!=n[n.length-1])return"";for(i=0;i<e.length&&i<n.length;i++)if(e[e.length-(i+1)]!=n[n.length-(i+1)])return e.slice(-i);return e.slice(-i)}function st(e,n,i){if(e.slice(0,n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(n)}; this is a bug`);return i+e.slice(n.length)}function at(e,n,i){if(!n)return e+i;if(e.slice(-n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(n)}; this is a bug`);return e.slice(0,-n.length)+i}function Ae(e,n){return st(e,n,"")}function Ue(e,n){return at(e,n,"")}function Dt(e,n){return n.slice(0,ur(e,n))}function ur(e,n){let i=0;e.length>n.length&&(i=e.length-n.length);let t=n.length;e.length<n.length&&(t=e.length);let r=Array(t),o=0;r[0]=0;for(let s=1;s<t;s++){for(n[s]==n[o]?r[s]=r[o]:r[s]=o;o>0&&n[s]!=n[o];)o=r[o];n[s]==n[o]&&o++}o=0;for(let s=i;s<e.length;s++){for(;o>0&&e[s]!=n[o];)o=r[o];e[s]==n[o]&&o++}return o}function Mt(e,n){let i=[];for(let t of Array.from(n.segment(e))){let r=t.segment;i.length&&/\s/.test(i[i.length-1])&&/\s/.test(r)?i[i.length-1]+=r:i.push(r)}return i}function lt(e,n){if(n)return Te(e,n)[1];let i;for(i=e.length-1;i>=0&&e[i].match(/\s/);i--);return e.substring(i+1)}function ve(e,n){if(n)return Te(e,n)[0];let i=e.match(/^\s*/);return i?i[0]:""}function Te(e,n){if(!n)return[ve(e),lt(e)];if(n.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');let i=Mt(e,n),t=i[0],r=i[i.length-1],o=/\s/.test(t)?t:"",s=/\s/.test(r)?r:"";return[o,s]}var ct="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",pr=new RegExp(`[${ct}]+|\\s+|[^${ct}]`,"ug"),Ot=class extends pe{equals(n,i,t){return t.ignoreCase&&(n=n.toLowerCase(),i=i.toLowerCase()),n.trim()===i.trim()}tokenize(n,i={}){let t;if(i.intlSegmenter){let s=i.intlSegmenter;if(s.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');t=Mt(n,s)}else t=n.match(pr)||[];let r=[],o=null;return t.forEach(s=>{/\s/.test(s)?o==null?r.push(s):r.push(r.pop()+s):o!=null&&/\s/.test(o)?r[r.length-1]==o?r.push(r.pop()+s):r.push(o+s):r.push(s),o=s}),r}join(n){return n.map((i,t)=>t==0?i:i.replace(/^\s+/,"")).join("")}postProcess(n,i){if(!n||i.oneChangePerToken)return n;let t=null,r=null,o=null;return n.forEach(s=>{s.added?r=s:s.removed?o=s:((r||o)&&Qn(t,o,r,s,i.intlSegmenter),t=s,r=null,o=null)}),(r||o)&&Qn(t,o,r,null,i.intlSegmenter),n}},fr=new Ot;function Qn(e,n,i,t,r){if(n&&i){let[o,s]=Te(n.value,r),[d,p]=Te(i.value,r);if(e){let c=Pt(o,d);e.value=at(e.value,d,c),n.value=Ae(n.value,c),i.value=Ae(i.value,c)}if(t){let c=Rt(s,p);t.value=st(t.value,p,c),n.value=Ue(n.value,c),i.value=Ue(i.value,c)}}else if(i){if(e){let o=ve(i.value,r);i.value=i.value.substring(o.length)}if(t){let o=ve(t.value,r);t.value=t.value.substring(o.length)}}else if(e&&t){let o=ve(t.value,r),[s,d]=Te(n.value,r),p=Pt(o,s);n.value=Ae(n.value,p);let c=Rt(Ae(o,p),d);n.value=Ue(n.value,c),t.value=st(t.value,o,c),e.value=at(e.value,o,o.slice(0,o.length-c.length))}else if(t){let o=ve(t.value,r),s=lt(n.value,r),d=Dt(s,o);n.value=Ue(n.value,d)}else if(e){let o=lt(e.value,r),s=ve(n.value,r),d=Dt(o,s);n.value=Ae(n.value,d)}}var It=class extends pe{tokenize(n){let i=new RegExp(`(\\r?\\n)|[${ct}]+|[^\\S\\n\\r]+|[^${ct}]`,"ug");return n.match(i)||[]}},Zn=new It;function Ht(e,n,i){return Zn.diff(e,n,i)}function gr(e,n){if(e.length===0)return n.length;if(n.length===0)return e.length;let i=[],t;for(t=0;t<=n.length;t++)i[t]=[t];let r;for(r=0;r<=e.length;r++)i[0][r]=r;for(t=1;t<=n.length;t++)for(r=1;r<=e.length;r++)n.charAt(t-1)===e.charAt(r-1)?i[t][r]=i[t-1][r-1]:i[t][r]=Math.min(i[t-1][r-1]+1,Math.min(i[t][r-1]+1,i[t-1][r]+1));return i[n.length][e.length]}function Fe(e){return(n,i)=>{let t=e(n).trim(),r=e(i).trim();return gr(t,r)/(t.length+r.length)}}function Le(e){function n(t,r,o=new Map){let s=1/0,d;for(let p=0;p<t.length;++p)for(let c=0;c<r.length;++c){let h=JSON.stringify([t[p],r[c]]),x;o.has(h)&&(x=o.get(h))||(x=e(t[p],r[c]),o.set(h,x)),x<s&&(s=x,d={indexA:p,indexB:c,score:s})}return d}function i(t,r,o=0,s=new Map){let d=n(t,r,s);if(!d||t.length+r.length<3)return[[t,r]];let p=t.slice(0,d.indexA),c=r.slice(0,d.indexB),h=[t[d.indexA]],x=[r[d.indexB]],l=d.indexA+1,u=d.indexB+1,b=t.slice(l),f=r.slice(u),g=i(p,c,o+1,s),k=i(h,x,o+1,s),m=i(b,f,o+1,s),S=k;return(d.indexA>0||d.indexB>0)&&(S=g.concat(S)),(t.length>l||r.length>u)&&(S=S.concat(m)),S}return i}var Y={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},ye={matching:zn.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:$n.WORD,colorScheme:be.LIGHT},oe="/",ei=Fe(e=>e.value),mr=Le(ei);function Wt(e){return e.indexOf("dev/null")!==-1}function br(e){return e.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,"")}function vr(e){return e.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function Ne(e){switch(e){case I.CONTEXT:return Y.CONTEXT;case I.INSERT:return Y.INSERTS;case I.DELETE:return Y.DELETES}}function Pe(e){switch(e){case be.DARK:return"d2h-dark-color-scheme";case be.AUTO:return"d2h-auto-color-scheme";case be.LIGHT:default:return"d2h-light-color-scheme"}}function yr(e){return e?2:1}function fe(e){return e.slice(0).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function ee(e,n,i=!0){let t=yr(n);return{prefix:e.substring(0,t),content:i?fe(e.substring(t)):e.substring(t)}}function xe(e){let n=Ft(e.oldName),i=Ft(e.newName);if(n!==i&&!Wt(n)&&!Wt(i)){let t=[],r=[],o=n.split(oe),s=i.split(oe),d=o.length,p=s.length,c=0,h=d-1,x=p-1;for(;c<h&&c<x&&o[c]===s[c];)t.push(s[c]),c+=1;for(;h>c&&x>c&&o[h]===s[x];)r.unshift(s[x]),h-=1,x-=1;let l=t.join(oe),u=r.join(oe),b=o.slice(c,h+1).join(oe),f=s.slice(c,x+1).join(oe);return l.length&&u.length?l+oe+"{"+b+" \u2192 "+f+"}"+oe+u:l.length?l+oe+"{"+b+" \u2192 "+f+"}":u.length?"{"+b+" \u2192 "+f+"}"+oe+u:n+" \u2192 "+i}else return Wt(i)?n:i}function Re(e){return`d2h-${qn(xe(e)).toString().slice(-6)}`}function De(e){let n="file-changed";return e.isRename||e.isCopy?n="file-renamed":e.isNew?n="file-added":e.isDeleted?n="file-deleted":e.newName!==e.oldName&&(n="file-renamed"),n}function dt(e,n,i,t={}){let{matching:r,maxLineLengthHighlight:o,matchWordsThreshold:s,diffStyle:d}=Object.assign(Object.assign({},ye),t),p=ee(e,i,!1),c=ee(n,i,!1);if(p.content.length>o||c.content.length>o)return{oldLine:{prefix:p.prefix,content:fe(p.content)},newLine:{prefix:c.prefix,content:fe(c.content)}};let h=d==="char"?Nt(p.content,c.content):Ht(p.content,c.content),x=[];if(d==="word"&&r==="words"){let u=h.filter(g=>g.removed),b=h.filter(g=>g.added);mr(b,u).forEach(g=>{g[0].length===1&&g[1].length===1&&ei(g[0][0],g[1][0])<s&&(x.push(g[0][0]),x.push(g[1][0]))})}let l=h.reduce((u,b)=>{let f=b.added?"ins":b.removed?"del":null,g=x.indexOf(b)>-1?' class="d2h-change"':"",k=fe(b.value);return f!==null?`${u}<${f}${g}>${k}</${f}>`:`${u}${k}`},"");return{oldLine:{prefix:p.prefix,content:br(l)},newLine:{prefix:c.prefix,content:vr(l)}}}var ti="file-summary",xr="icon",_r={colorScheme:ye.colorScheme},ut=class{constructor(n,i={}){this.hoganUtils=n,this.config=Object.assign(Object.assign({},_r),i)}render(n){let i=n.map(t=>this.hoganUtils.render(ti,"line",{fileHtmlId:Re(t),oldName:t.oldName,newName:t.newName,fileName:xe(t),deletedLines:"-"+t.deletedLines,addedLines:"+"+t.addedLines},{fileIcon:this.hoganUtils.template(xr,De(t))})).join(`
|
|
8
|
-
`);return this.hoganUtils.render(ti,"wrapper",{colorScheme:
|
|
9
|
-
`);return this.hoganUtils.render(We,"wrapper",{colorScheme:
|
|
10
|
-
`)}applyLineGroupping(n){let i=[],t=[],r=[];for(let o=0;o<n.lines.length;o++){let s=n.lines[o];(s.type!==
|
|
11
|
-
`);return this.hoganUtils.render(Be,"wrapper",{colorScheme:
|
|
7
|
+
`);function te(){r!==null&&t!==null&&(t.blocks.push(r),r=null)}function ae(){t!==null&&(!t.oldName&&p!==null&&(t.oldName=p),!t.newName&&d!==null&&(t.newName=d),t.newName&&(i.push(t),t=null)),p=null,d=null}function J(){te(),ae(),t={blocks:[],deletedLines:0,addedLines:0}}function O(S){te();let N;t!==null&&((N=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(S))?(t.isCombined=!1,o=parseInt(N[1],10),c=parseInt(N[2],10)):(N=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(S))?(t.isCombined=!0,o=parseInt(N[1],10),s=parseInt(N[2],10),c=parseInt(N[3],10)):(S.startsWith(l)&&console.error("Failed to parse lines, starting in 0!"),o=0,c=0,t.isCombined=!1)),r={lines:[],oldStartLine:o,oldStartLine2:s,newStartLine:c,header:S}}function ne(S){if(t===null||r===null||o===null||c===null)return;let N={content:S},C=t.isCombined?["+ "," +","++"]:["+"],le=t.isCombined?["- "," -","--"]:["-"];Xn(S,C)?(t.addedLines++,N.type=M.INSERT,N.oldNumber=void 0,N.newNumber=c++):Xn(S,le)?(t.deletedLines++,N.type=M.DELETE,N.oldNumber=o++,N.newNumber=void 0):(N.type=M.CONTEXT,N.oldNumber=o++,N.newNumber=c++),r.lines.push(N)}function I(S,N){let C=N;for(;C<P.length-3;){if(S.startsWith("diff"))return!1;if(P[C].startsWith(h)&&P[C+1].startsWith(x)&&P[C+2].startsWith(l))return!0;C++}return!1}return P.forEach((S,N)=>{if(!S||S.startsWith("*"))return;let C,le=P[N-1],qe=P[N+1],Ge=P[N+2];if(S.startsWith("diff --git")||S.startsWith("diff --combined")){if(J(),(C=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(S))&&(p=fe(C[1],void 0,n.dstPrefix),d=fe(C[2],void 0,n.srcPrefix)),t===null)throw new Error("Where is my file !!!");t.isGitDiff=!0;return}if(S.startsWith("Binary files")&&!t?.isGitDiff){if(J(),(C=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(S))&&(p=fe(C[1],void 0,n.dstPrefix),d=fe(C[2],void 0,n.srcPrefix)),t===null)throw new Error("Where is my file !!!");t.isBinary=!0;return}if((!t||!t.isGitDiff&&t&&S.startsWith(h)&&qe.startsWith(x)&&Ge.startsWith(l))&&J(),t?.isTooBig)return;if(t&&(typeof n.diffMaxChanges=="number"&&t.addedLines+t.deletedLines>n.diffMaxChanges||typeof n.diffMaxLineLength=="number"&&S.length>n.diffMaxLineLength)){t.isTooBig=!0,t.addedLines=0,t.deletedLines=0,t.blocks=[],r=null;let Q=typeof n.diffTooBigMessage=="function"?n.diffTooBigMessage(i.length):"Diff too big to be displayed";O(Q);return}if(S.startsWith(h)&&qe.startsWith(x)||S.startsWith(x)&&le.startsWith(h)){if(t&&!t.oldName&&S.startsWith("--- ")&&(C=pr(S,n.srcPrefix))){t.oldName=C,t.language=Gn(t.oldName,t.language);return}if(t&&!t.newName&&S.startsWith("+++ ")&&(C=fr(S,n.dstPrefix))){t.newName=C,t.language=Gn(t.newName,t.language);return}}if(t&&(S.startsWith(l)||t.isGitDiff&&t.oldName&&t.newName&&!r)){O(S);return}if(r&&(S.startsWith("+")||S.startsWith("-")||S.startsWith(" "))){ne(S);return}let Ce=!I(S,N);if(t===null)throw new Error("Where is my file !!!");(C=u.exec(S))?t.oldMode=C[1]:(C=g.exec(S))?t.newMode=C[1]:(C=f.exec(S))?(t.deletedFileMode=C[1],t.isDeleted=!0):(C=b.exec(S))?(t.newFileMode=C[1],t.isNew=!0):(C=w.exec(S))?(Ce&&(t.oldName=C[1]),t.isCopy=!0):(C=v.exec(S))?(Ce&&(t.newName=C[1]),t.isCopy=!0):(C=_.exec(S))?(Ce&&(t.oldName=C[1]),t.isRename=!0):(C=E.exec(S))?(Ce&&(t.newName=C[1]),t.isRename=!0):(C=y.exec(S))?(t.isBinary=!0,t.oldName=fe(C[1],void 0,n.srcPrefix),t.newName=fe(C[2],void 0,n.dstPrefix),O("Binary file")):k.test(S)?(t.isBinary=!0,O(S)):(C=T.exec(S))?t.unchangedPercentage=parseInt(C[1],10):(C=L.exec(S))?t.changedPercentage=parseInt(C[1],10):(C=m.exec(S))?(t.checksumBefore=C[1],t.checksumAfter=C[2],C[3]&&(t.mode=C[3])):(C=A.exec(S))?(t.checksumBefore=[C[2],C[3]],t.checksumAfter=C[1]):(C=R.exec(S))?(t.oldMode=[C[2],C[3]],t.newMode=C[1]):(C=z.exec(S))?(t.newFileMode=C[1],t.isNew=!0):(C=re.exec(S))&&(t.deletedFileMode=C[1],t.isDeleted=!0)}),te(),ae(),i}var he=class{diff(n,i,t={}){let r;typeof t=="function"?(r=t,t={}):"callback"in t&&(r=t.callback);let o=this.castInput(n,t),s=this.castInput(i,t),c=this.removeEmpty(this.tokenize(o,t)),p=this.removeEmpty(this.tokenize(s,t));return this.diffWithOptionsObj(c,p,t,r)}diffWithOptionsObj(n,i,t,r){var o;let s=v=>{if(v=this.postProcess(v,t),r){setTimeout(function(){r(v)},0);return}else return v},c=i.length,p=n.length,d=1,h=c+p;t.maxEditLength!=null&&(h=Math.min(h,t.maxEditLength));let x=(o=t.timeout)!==null&&o!==void 0?o:1/0,l=Date.now()+x,u=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(u[0],i,n,0,t);if(u[0].oldPos+1>=p&&g+1>=c)return s(this.buildValues(u[0].lastComponent,i,n));let f=-1/0,b=1/0,w=()=>{for(let v=Math.max(f,-d);v<=Math.min(b,d);v+=2){let _,E=u[v-1],T=u[v+1];E&&(u[v-1]=void 0);let L=!1;if(T){let y=T.oldPos-v;L=T&&0<=y&&y<c}let m=E&&E.oldPos+1<p;if(!L&&!m){u[v]=void 0;continue}if(!m||L&&E.oldPos<T.oldPos?_=this.addToPath(T,!0,!1,0,t):_=this.addToPath(E,!1,!0,1,t),g=this.extractCommon(_,i,n,v,t),_.oldPos+1>=p&&g+1>=c)return s(this.buildValues(_.lastComponent,i,n))||!0;u[v]=_,_.oldPos+1>=p&&(b=Math.min(b,v-1)),g+1>=c&&(f=Math.max(f,v+1))}d++};if(r)(function v(){setTimeout(function(){if(d>h||Date.now()>l)return r(void 0);w()||v()},0)})();else for(;d<=h&&Date.now()<=l;){let v=w();if(v)return v}}addToPath(n,i,t,r,o){let s=n.lastComponent;return s&&!o.oneChangePerToken&&s.added===i&&s.removed===t?{oldPos:n.oldPos+r,lastComponent:{count:s.count+1,added:i,removed:t,previousComponent:s.previousComponent}}:{oldPos:n.oldPos+r,lastComponent:{count:1,added:i,removed:t,previousComponent:s}}}extractCommon(n,i,t,r,o){let s=i.length,c=t.length,p=n.oldPos,d=p-r,h=0;for(;d+1<s&&p+1<c&&this.equals(t[p+1],i[d+1],o);)d++,p++,h++,o.oneChangePerToken&&(n.lastComponent={count:1,previousComponent:n.lastComponent,added:!1,removed:!1});return h&&!o.oneChangePerToken&&(n.lastComponent={count:h,previousComponent:n.lastComponent,added:!1,removed:!1}),n.oldPos=p,d}equals(n,i,t){return t.comparator?t.comparator(n,i):n===i||!!t.ignoreCase&&n.toLowerCase()===i.toLowerCase()}removeEmpty(n){let i=[];for(let t=0;t<n.length;t++)n[t]&&i.push(n[t]);return i}castInput(n,i){return n}tokenize(n,i){return Array.from(n)}join(n){return n.join("")}postProcess(n,i){return n}get useLongestToken(){return!1}buildValues(n,i,t){let r=[],o;for(;n;)r.push(n),o=n.previousComponent,delete n.previousComponent,n=o;r.reverse();let s=r.length,c=0,p=0,d=0;for(;c<s;c++){let h=r[c];if(h.removed)h.value=this.join(t.slice(d,d+h.count)),d+=h.count;else{if(!h.added&&this.useLongestToken){let x=i.slice(p,p+h.count);x=x.map(function(l,u){let g=t[d+u];return g.length>l.length?g:l}),h.value=this.join(x)}else h.value=this.join(i.slice(p,p+h.count));p+=h.count,h.added||(d+=h.count)}}return r}};var Nt=class extends he{},Jn=new Nt;function Pt(e,n,i){return Jn.diff(e,n,i)}function Rt(e,n){let i;for(i=0;i<e.length&&i<n.length;i++)if(e[i]!=n[i])return e.slice(0,i);return e.slice(0,i)}function Dt(e,n){let i;if(!e||!n||e[e.length-1]!=n[n.length-1])return"";for(i=0;i<e.length&&i<n.length;i++)if(e[e.length-(i+1)]!=n[n.length-(i+1)])return e.slice(-i);return e.slice(-i)}function at(e,n,i){if(e.slice(0,n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(n)}; this is a bug`);return i+e.slice(n.length)}function lt(e,n,i){if(!n)return e+i;if(e.slice(-n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(n)}; this is a bug`);return e.slice(0,-n.length)+i}function Te(e,n){return at(e,n,"")}function Ue(e,n){return lt(e,n,"")}function Mt(e,n){return n.slice(0,gr(e,n))}function gr(e,n){let i=0;e.length>n.length&&(i=e.length-n.length);let t=n.length;e.length<n.length&&(t=e.length);let r=Array(t),o=0;r[0]=0;for(let s=1;s<t;s++){for(n[s]==n[o]?r[s]=r[o]:r[s]=o;o>0&&n[s]!=n[o];)o=r[o];n[s]==n[o]&&o++}o=0;for(let s=i;s<e.length;s++){for(;o>0&&e[s]!=n[o];)o=r[o];e[s]==n[o]&&o++}return o}function Ot(e,n){let i=[];for(let t of Array.from(n.segment(e))){let r=t.segment;i.length&&/\s/.test(i[i.length-1])&&/\s/.test(r)?i[i.length-1]+=r:i.push(r)}return i}function ct(e,n){if(n)return Fe(e,n)[1];let i;for(i=e.length-1;i>=0&&e[i].match(/\s/);i--);return e.substring(i+1)}function _e(e,n){if(n)return Fe(e,n)[0];let i=e.match(/^\s*/);return i?i[0]:""}function Fe(e,n){if(!n)return[_e(e),ct(e)];if(n.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');let i=Ot(e,n),t=i[0],r=i[i.length-1],o=/\s/.test(t)?t:"",s=/\s/.test(r)?r:"";return[o,s]}var dt="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",mr=new RegExp(`[${dt}]+|\\s+|[^${dt}]`,"ug"),It=class extends he{equals(n,i,t){return t.ignoreCase&&(n=n.toLowerCase(),i=i.toLowerCase()),n.trim()===i.trim()}tokenize(n,i={}){let t;if(i.intlSegmenter){let s=i.intlSegmenter;if(s.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');t=Ot(n,s)}else t=n.match(mr)||[];let r=[],o=null;return t.forEach(s=>{/\s/.test(s)?o==null?r.push(s):r.push(r.pop()+s):o!=null&&/\s/.test(o)?r[r.length-1]==o?r.push(r.pop()+s):r.push(o+s):r.push(s),o=s}),r}join(n){return n.map((i,t)=>t==0?i:i.replace(/^\s+/,"")).join("")}postProcess(n,i){if(!n||i.oneChangePerToken)return n;let t=null,r=null,o=null;return n.forEach(s=>{s.added?r=s:s.removed?o=s:((r||o)&&Qn(t,o,r,s,i.intlSegmenter),t=s,r=null,o=null)}),(r||o)&&Qn(t,o,r,null,i.intlSegmenter),n}},br=new It;function Qn(e,n,i,t,r){if(n&&i){let[o,s]=Fe(n.value,r),[c,p]=Fe(i.value,r);if(e){let d=Rt(o,c);e.value=lt(e.value,c,d),n.value=Te(n.value,d),i.value=Te(i.value,d)}if(t){let d=Dt(s,p);t.value=at(t.value,p,d),n.value=Ue(n.value,d),i.value=Ue(i.value,d)}}else if(i){if(e){let o=_e(i.value,r);i.value=i.value.substring(o.length)}if(t){let o=_e(t.value,r);t.value=t.value.substring(o.length)}}else if(e&&t){let o=_e(t.value,r),[s,c]=Fe(n.value,r),p=Rt(o,s);n.value=Te(n.value,p);let d=Dt(Te(o,p),c);n.value=Ue(n.value,d),t.value=at(t.value,o,d),e.value=lt(e.value,o,o.slice(0,o.length-d.length))}else if(t){let o=_e(t.value,r),s=ct(n.value,r),c=Mt(s,o);n.value=Ue(n.value,c)}else if(e){let o=ct(e.value,r),s=_e(n.value,r),c=Mt(o,s);n.value=Te(n.value,c)}}var Ht=class extends he{tokenize(n){let i=new RegExp(`(\\r?\\n)|[${dt}]+|[^\\S\\n\\r]+|[^${dt}]`,"ug");return n.match(i)||[]}},Zn=new Ht;function Ut(e,n,i){return Zn.diff(e,n,i)}function yr(e,n){if(e.length===0)return n.length;if(n.length===0)return e.length;let i=[],t;for(t=0;t<=n.length;t++)i[t]=[t];let r;for(r=0;r<=e.length;r++)i[0][r]=r;for(t=1;t<=n.length;t++)for(r=1;r<=e.length;r++)n.charAt(t-1)===e.charAt(r-1)?i[t][r]=i[t-1][r-1]:i[t][r]=Math.min(i[t-1][r-1]+1,Math.min(i[t][r-1]+1,i[t-1][r]+1));return i[n.length][e.length]}function Le(e){return(n,i)=>{let t=e(n).trim(),r=e(i).trim();return yr(t,r)/(t.length+r.length)}}function Ne(e){function n(t,r,o=new Map){let s=1/0,c;for(let p=0;p<t.length;++p)for(let d=0;d<r.length;++d){let h=JSON.stringify([t[p],r[d]]),x;o.has(h)&&(x=o.get(h))||(x=e(t[p],r[d]),o.set(h,x)),x<s&&(s=x,c={indexA:p,indexB:d,score:s})}return c}function i(t,r,o=0,s=new Map){let c=n(t,r,s);if(!c||t.length+r.length<3)return[[t,r]];let p=t.slice(0,c.indexA),d=r.slice(0,c.indexB),h=[t[c.indexA]],x=[r[c.indexB]],l=c.indexA+1,u=c.indexB+1,g=t.slice(l),f=r.slice(u),b=i(p,d,o+1,s),w=i(h,x,o+1,s),v=i(g,f,o+1,s),_=w;return(c.indexA>0||c.indexB>0)&&(_=b.concat(_)),(t.length>l||r.length>u)&&(_=_.concat(v)),_}return i}var X={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},we={matching:zn.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:$n.WORD,colorScheme:xe.LIGHT},se="/",ei=Le(e=>e.value),xr=Ne(ei);function jt(e){return e.indexOf("dev/null")!==-1}function _r(e){return e.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,"")}function wr(e){return e.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function Pe(e){switch(e){case M.CONTEXT:return X.CONTEXT;case M.INSERT:return X.INSERTS;case M.DELETE:return X.DELETES}}function Re(e){switch(e){case xe.DARK:return"d2h-dark-color-scheme";case xe.AUTO:return"d2h-auto-color-scheme";case xe.LIGHT:default:return"d2h-light-color-scheme"}}function kr(e){return e?2:1}function ge(e){return e.slice(0).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function ee(e,n,i=!0){let t=kr(n);return{prefix:e.substring(0,t),content:i?ge(e.substring(t)):e.substring(t)}}function ke(e){let n=Lt(e.oldName),i=Lt(e.newName);if(n!==i&&!jt(n)&&!jt(i)){let t=[],r=[],o=n.split(se),s=i.split(se),c=o.length,p=s.length,d=0,h=c-1,x=p-1;for(;d<h&&d<x&&o[d]===s[d];)t.push(s[d]),d+=1;for(;h>d&&x>d&&o[h]===s[x];)r.unshift(s[x]),h-=1,x-=1;let l=t.join(se),u=r.join(se),g=o.slice(d,h+1).join(se),f=s.slice(d,x+1).join(se);return l.length&&u.length?l+se+"{"+g+" \u2192 "+f+"}"+se+u:l.length?l+se+"{"+g+" \u2192 "+f+"}":u.length?"{"+g+" \u2192 "+f+"}"+se+u:n+" \u2192 "+i}else return jt(i)?n:i}function De(e){return`d2h-${qn(ke(e)).toString().slice(-6)}`}function Me(e){let n="file-changed";return e.isRename||e.isCopy?n="file-renamed":e.isNew?n="file-added":e.isDeleted?n="file-deleted":e.newName!==e.oldName&&(n="file-renamed"),n}function ut(e,n,i,t={}){let{matching:r,maxLineLengthHighlight:o,matchWordsThreshold:s,diffStyle:c}=Object.assign(Object.assign({},we),t),p=ee(e,i,!1),d=ee(n,i,!1);if(p.content.length>o||d.content.length>o)return{oldLine:{prefix:p.prefix,content:ge(p.content)},newLine:{prefix:d.prefix,content:ge(d.content)}};let h=c==="char"?Pt(p.content,d.content):Ut(p.content,d.content),x=[];if(c==="word"&&r==="words"){let u=h.filter(b=>b.removed),g=h.filter(b=>b.added);xr(g,u).forEach(b=>{b[0].length===1&&b[1].length===1&&ei(b[0][0],b[1][0])<s&&(x.push(b[0][0]),x.push(b[1][0]))})}let l=h.reduce((u,g)=>{let f=g.added?"ins":g.removed?"del":null,b=x.indexOf(g)>-1?' class="d2h-change"':"",w=ge(g.value);return f!==null?`${u}<${f}${b}>${w}</${f}>`:`${u}${w}`},"");return{oldLine:{prefix:p.prefix,content:_r(l)},newLine:{prefix:d.prefix,content:wr(l)}}}var ti="file-summary",Cr="icon",Sr={colorScheme:we.colorScheme},pt=class{constructor(n,i={}){this.hoganUtils=n,this.config=Object.assign(Object.assign({},Sr),i)}render(n){let i=n.map(t=>this.hoganUtils.render(ti,"line",{fileHtmlId:De(t),oldName:t.oldName,newName:t.newName,fileName:ke(t),deletedLines:"-"+t.deletedLines,addedLines:"+"+t.addedLines},{fileIcon:this.hoganUtils.template(Cr,Me(t))})).join(`
|
|
8
|
+
`);return this.hoganUtils.render(ti,"wrapper",{colorScheme:Re(this.config.colorScheme),filesNumber:n.length,files:i})}};var zt=Object.assign(Object.assign({},we),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),We="generic",ni="line-by-line",Er="icon",Ar="tag",je=class{constructor(n,i={}){this.hoganUtils=n,this.config=Object.assign(Object.assign({},zt),i)}render(n){let i=n.map(t=>{let r;return t.blocks.length?r=this.generateFileHtml(t):r=this.generateEmptyDiff(),this.makeFileDiffHtml(t,r)}).join(`
|
|
9
|
+
`);return this.hoganUtils.render(We,"wrapper",{colorScheme:Re(this.config.colorScheme),content:i})}makeFileDiffHtml(n,i){if(this.config.renderNothingWhenEmpty&&Array.isArray(n.blocks)&&n.blocks.length===0)return"";let t=this.hoganUtils.template(ni,"file-diff"),r=this.hoganUtils.template(We,"file-path"),o=this.hoganUtils.template(Er,"file"),s=this.hoganUtils.template(Ar,Me(n));return t.render({file:n,fileHtmlId:De(n),diffs:i,filePath:r.render({fileDiffName:ke(n)},{fileIcon:o,fileTag:s})})}generateEmptyDiff(){return this.hoganUtils.render(We,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:X})}generateFileHtml(n){let i=Ne(Le(t=>ee(t.content,n.isCombined).content));return n.blocks.map(t=>{let r=this.hoganUtils.render(We,"block-header",{CSSLineClass:X,blockHeader:n.isTooBig?t.header:ge(t.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(t).forEach(([o,s,c])=>{if(s.length&&c.length&&!o.length)this.applyRematchMatching(s,c,i).map(([p,d])=>{let{left:h,right:x}=this.processChangedLines(n,n.isCombined,p,d);r+=h,r+=x});else if(o.length)o.forEach(p=>{let{prefix:d,content:h}=ee(p.content,n.isCombined);r+=this.generateSingleLineHtml(n,{type:X.CONTEXT,prefix:d,content:h,oldNumber:p.oldNumber,newNumber:p.newNumber})});else if(s.length||c.length){let{left:p,right:d}=this.processChangedLines(n,n.isCombined,s,c);r+=p,r+=d}else console.error("Unknown state reached while processing groups of lines",o,s,c)}),r}).join(`
|
|
10
|
+
`)}applyLineGroupping(n){let i=[],t=[],r=[];for(let o=0;o<n.lines.length;o++){let s=n.lines[o];(s.type!==M.INSERT&&r.length||s.type===M.CONTEXT&&t.length>0)&&(i.push([[],t,r]),t=[],r=[]),s.type===M.CONTEXT?i.push([[s],[],[]]):s.type===M.INSERT&&t.length===0?i.push([[],[],[s]]):s.type===M.INSERT&&t.length>0?r.push(s):s.type===M.DELETE&&t.push(s)}return(t.length||r.length)&&(i.push([[],t,r]),t=[],r=[]),i}applyRematchMatching(n,i,t){let r=n.length*i.length,o=st(n.concat(i).map(c=>c.content.length));return r<this.config.matchingMaxComparisons&&o<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?t(n,i):[[n,i]]}processChangedLines(n,i,t,r){let o={right:"",left:""},s=Math.max(t.length,r.length);for(let c=0;c<s;c++){let p=t[c],d=r[c],h=p!==void 0&&d!==void 0?ut(p.content,d.content,i,this.config):void 0,x=p!==void 0&&p.oldNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.oldLine.prefix,content:h.oldLine.content,type:X.DELETE_CHANGES}:Object.assign(Object.assign({},ee(p.content,i)),{type:Pe(p.type)})),{oldNumber:p.oldNumber,newNumber:p.newNumber}):void 0,l=d!==void 0&&d.newNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.newLine.prefix,content:h.newLine.content,type:X.INSERT_CHANGES}:Object.assign(Object.assign({},ee(d.content,i)),{type:Pe(d.type)})),{oldNumber:d.oldNumber,newNumber:d.newNumber}):void 0,{left:u,right:g}=this.generateLineHtml(n,x,l);o.left+=u,o.right+=g}return o}generateLineHtml(n,i,t){return{left:this.generateSingleLineHtml(n,i),right:this.generateSingleLineHtml(n,t)}}generateSingleLineHtml(n,i){if(i===void 0)return"";let t=this.hoganUtils.render(ni,"numbers",{oldNumber:i.oldNumber||"",newNumber:i.newNumber||""});return this.hoganUtils.render(We,"line",{type:i.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:i.prefix===" "?" ":i.prefix,content:i.content,lineNumber:t,line:i,file:n})}};var $t=Object.assign(Object.assign({},we),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Be="generic",Tr="side-by-side",Fr="icon",Lr="tag",ze=class{constructor(n,i={}){this.hoganUtils=n,this.config=Object.assign(Object.assign({},$t),i)}render(n){let i=n.map(t=>{let r;return t.blocks.length?r=this.generateFileHtml(t):r=this.generateEmptyDiff(),this.makeFileDiffHtml(t,r)}).join(`
|
|
11
|
+
`);return this.hoganUtils.render(Be,"wrapper",{colorScheme:Re(this.config.colorScheme),content:i})}makeFileDiffHtml(n,i){if(this.config.renderNothingWhenEmpty&&Array.isArray(n.blocks)&&n.blocks.length===0)return"";let t=this.hoganUtils.template(Tr,"file-diff"),r=this.hoganUtils.template(Be,"file-path"),o=this.hoganUtils.template(Fr,"file"),s=this.hoganUtils.template(Lr,Me(n));return t.render({file:n,fileHtmlId:De(n),diffs:i,filePath:r.render({fileDiffName:ke(n)},{fileIcon:o,fileTag:s})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Be,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:X})}}generateFileHtml(n){let i=Ne(Le(t=>ee(t.content,n.isCombined).content));return n.blocks.map(t=>{let r={left:this.makeHeaderHtml(t.header,n),right:this.makeHeaderHtml("")};return this.applyLineGroupping(t).forEach(([o,s,c])=>{if(s.length&&c.length&&!o.length)this.applyRematchMatching(s,c,i).map(([p,d])=>{let{left:h,right:x}=this.processChangedLines(n.isCombined,p,d);r.left+=h,r.right+=x});else if(o.length)o.forEach(p=>{let{prefix:d,content:h}=ee(p.content,n.isCombined),{left:x,right:l}=this.generateLineHtml({type:X.CONTEXT,prefix:d,content:h,number:p.oldNumber},{type:X.CONTEXT,prefix:d,content:h,number:p.newNumber});r.left+=x,r.right+=l});else if(s.length||c.length){let{left:p,right:d}=this.processChangedLines(n.isCombined,s,c);r.left+=p,r.right+=d}else console.error("Unknown state reached while processing groups of lines",o,s,c)}),r}).reduce((t,r)=>({left:t.left+r.left,right:t.right+r.right}),{left:"",right:""})}applyLineGroupping(n){let i=[],t=[],r=[];for(let o=0;o<n.lines.length;o++){let s=n.lines[o];(s.type!==M.INSERT&&r.length||s.type===M.CONTEXT&&t.length>0)&&(i.push([[],t,r]),t=[],r=[]),s.type===M.CONTEXT?i.push([[s],[],[]]):s.type===M.INSERT&&t.length===0?i.push([[],[],[s]]):s.type===M.INSERT&&t.length>0?r.push(s):s.type===M.DELETE&&t.push(s)}return(t.length||r.length)&&(i.push([[],t,r]),t=[],r=[]),i}applyRematchMatching(n,i,t){let r=n.length*i.length,o=st(n.concat(i).map(c=>c.content.length));return r<this.config.matchingMaxComparisons&&o<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?t(n,i):[[n,i]]}makeHeaderHtml(n,i){return this.hoganUtils.render(Be,"block-header",{CSSLineClass:X,blockHeader:i?.isTooBig?n:ge(n),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(n,i,t){let r={right:"",left:""},o=Math.max(i.length,t.length);for(let s=0;s<o;s++){let c=i[s],p=t[s],d=c!==void 0&&p!==void 0?ut(c.content,p.content,n,this.config):void 0,h=c!==void 0&&c.oldNumber!==void 0?Object.assign(Object.assign({},d!==void 0?{prefix:d.oldLine.prefix,content:d.oldLine.content,type:X.DELETE_CHANGES}:Object.assign(Object.assign({},ee(c.content,n)),{type:Pe(c.type)})),{number:c.oldNumber}):void 0,x=p!==void 0&&p.newNumber!==void 0?Object.assign(Object.assign({},d!==void 0?{prefix:d.newLine.prefix,content:d.newLine.content,type:X.INSERT_CHANGES}:Object.assign(Object.assign({},ee(p.content,n)),{type:Pe(p.type)})),{number:p.newNumber}):void 0,{left:l,right:u}=this.generateLineHtml(h,x);r.left+=l,r.right+=u}return r}generateLineHtml(n,i){return{left:this.generateSingleHtml(n),right:this.generateSingleHtml(i)}}generateSingleHtml(n){let i="d2h-code-side-linenumber",t="d2h-code-side-line";return this.hoganUtils.render(Be,"line",{type:n?.type||`${X.CONTEXT} d2h-emptyplaceholder`,lineClass:n!==void 0?i:`${i} d2h-code-side-emptyplaceholder`,contentClass:n!==void 0?t:`${t} d2h-code-side-emptyplaceholder`,prefix:n?.prefix===" "?" ":n?.prefix,content:n?.content,lineNumber:n?.number})}};var Xt=rn(Gt());var V=rn(Gt()),j={};j["file-summary-line"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<li class="d2h-file-list-line">'),t.b(`
|
|
12
12
|
`+i),t.b(' <span class="d2h-file-name-wrapper">'),t.b(`
|
|
13
13
|
`+i),t.b(t.rp("<fileIcon0",e,n," ")),t.b(' <a href="#'),t.b(t.v(t.f("fileHtmlId",e,n,0))),t.b('" class="d2h-file-name">'),t.b(t.v(t.f("fileName",e,n,0))),t.b("</a>"),t.b(`
|
|
14
14
|
`+i),t.b(' <span class="d2h-file-stats">'),t.b(`
|
|
@@ -16,7 +16,7 @@ var Mi=Object.create;var nn=Object.defineProperty;var Oi=Object.getOwnPropertyDe
|
|
|
16
16
|
`+i),t.b(' <span class="d2h-lines-deleted">'),t.b(t.v(t.f("deletedLines",e,n,0))),t.b("</span>"),t.b(`
|
|
17
17
|
`+i),t.b(" </span>"),t.b(`
|
|
18
18
|
`+i),t.b(" </span>"),t.b(`
|
|
19
|
-
`+i),t.b("</li>"),t.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});
|
|
19
|
+
`+i),t.b("</li>"),t.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});j["file-summary-wrapper"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<div class="d2h-file-list-wrapper '),t.b(t.v(t.f("colorScheme",e,n,0))),t.b('">'),t.b(`
|
|
20
20
|
`+i),t.b(' <div class="d2h-file-list-header">'),t.b(`
|
|
21
21
|
`+i),t.b(' <span class="d2h-file-list-title">Files changed ('),t.b(t.v(t.f("filesNumber",e,n,0))),t.b(")</span>"),t.b(`
|
|
22
22
|
`+i),t.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),t.b(`
|
|
@@ -25,24 +25,24 @@ var Mi=Object.create;var nn=Object.defineProperty;var Oi=Object.getOwnPropertyDe
|
|
|
25
25
|
`+i),t.b(' <ol class="d2h-file-list">'),t.b(`
|
|
26
26
|
`+i),t.b(" "),t.b(t.t(t.f("files",e,n,0))),t.b(`
|
|
27
27
|
`+i),t.b(" </ol>"),t.b(`
|
|
28
|
-
`+i),t.b("</div>"),t.fl()},partials:{},subs:{}});
|
|
28
|
+
`+i),t.b("</div>"),t.fl()},partials:{},subs:{}});j["generic-block-header"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b("<tr>"),t.b(`
|
|
29
29
|
`+i),t.b(' <td class="'),t.b(t.v(t.f("lineClass",e,n,0))),t.b(" "),t.b(t.v(t.d("CSSLineClass.INFO",e,n,0))),t.b('"></td>'),t.b(`
|
|
30
30
|
`+i),t.b(' <td class="'),t.b(t.v(t.d("CSSLineClass.INFO",e,n,0))),t.b('">'),t.b(`
|
|
31
31
|
`+i),t.b(' <div class="'),t.b(t.v(t.f("contentClass",e,n,0))),t.b('">'),t.s(t.f("blockHeader",e,n,1),e,n,0,156,173,"{{ }}")&&(t.rs(e,n,function(r,o,s){s.b(s.t(s.f("blockHeader",r,o,0)))}),e.pop()),t.s(t.f("blockHeader",e,n,1),e,n,1,0,0,"")||t.b(" "),t.b("</div>"),t.b(`
|
|
32
32
|
`+i),t.b(" </td>"),t.b(`
|
|
33
|
-
`+i),t.b("</tr>"),t.fl()},partials:{},subs:{}});
|
|
33
|
+
`+i),t.b("</tr>"),t.fl()},partials:{},subs:{}});j["generic-empty-diff"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b("<tr>"),t.b(`
|
|
34
34
|
`+i),t.b(' <td class="'),t.b(t.v(t.d("CSSLineClass.INFO",e,n,0))),t.b('">'),t.b(`
|
|
35
35
|
`+i),t.b(' <div class="'),t.b(t.v(t.f("contentClass",e,n,0))),t.b('">'),t.b(`
|
|
36
36
|
`+i),t.b(" File without changes"),t.b(`
|
|
37
37
|
`+i),t.b(" </div>"),t.b(`
|
|
38
38
|
`+i),t.b(" </td>"),t.b(`
|
|
39
|
-
`+i),t.b("</tr>"),t.fl()},partials:{},subs:{}});
|
|
39
|
+
`+i),t.b("</tr>"),t.fl()},partials:{},subs:{}});j["generic-file-path"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<span class="d2h-file-name-wrapper">'),t.b(`
|
|
40
40
|
`+i),t.b(t.rp("<fileIcon0",e,n," ")),t.b(' <span class="d2h-file-name">'),t.b(t.v(t.f("fileDiffName",e,n,0))),t.b("</span>"),t.b(`
|
|
41
41
|
`+i),t.b(t.rp("<fileTag1",e,n," ")),t.b("</span>"),t.b(`
|
|
42
42
|
`+i),t.b('<label class="d2h-file-collapse">'),t.b(`
|
|
43
43
|
`+i),t.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),t.b(`
|
|
44
44
|
`+i),t.b(" Viewed"),t.b(`
|
|
45
|
-
`+i),t.b("</label>"),t.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});
|
|
45
|
+
`+i),t.b("</label>"),t.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});j["generic-line"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b("<tr>"),t.b(`
|
|
46
46
|
`+i),t.b(' <td class="'),t.b(t.v(t.f("lineClass",e,n,0))),t.b(" "),t.b(t.v(t.f("type",e,n,0))),t.b('">'),t.b(`
|
|
47
47
|
`+i),t.b(" "),t.b(t.t(t.f("lineNumber",e,n,0))),t.b(`
|
|
48
48
|
`+i),t.b(" </td>"),t.b(`
|
|
@@ -54,23 +54,23 @@ var Mi=Object.create;var nn=Object.defineProperty;var Oi=Object.getOwnPropertyDe
|
|
|
54
54
|
`+i)}),e.pop()),t.s(t.f("content",e,n,1),e,n,1,0,0,"")||(t.b(' <span class="d2h-code-line-ctn"><br></span>'),t.b(`
|
|
55
55
|
`+i)),t.b(" </div>"),t.b(`
|
|
56
56
|
`+i),t.b(" </td>"),t.b(`
|
|
57
|
-
`+i),t.b("</tr>"),t.fl()},partials:{},subs:{}});
|
|
57
|
+
`+i),t.b("</tr>"),t.fl()},partials:{},subs:{}});j["generic-wrapper"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<div class="d2h-wrapper '),t.b(t.v(t.f("colorScheme",e,n,0))),t.b('">'),t.b(`
|
|
58
58
|
`+i),t.b(" "),t.b(t.t(t.f("content",e,n,0))),t.b(`
|
|
59
|
-
`+i),t.b("</div>"),t.fl()},partials:{},subs:{}});
|
|
59
|
+
`+i),t.b("</div>"),t.fl()},partials:{},subs:{}});j["icon-file-added"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),t.b(`
|
|
60
60
|
`+i),t.b(' width="14">'),t.b(`
|
|
61
61
|
`+i),t.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),t.b(`
|
|
62
|
-
`+i),t.b("</svg>"),t.fl()},partials:{},subs:{}});
|
|
62
|
+
`+i),t.b("</svg>"),t.fl()},partials:{},subs:{}});j["icon-file-changed"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),t.b(`
|
|
63
63
|
`+i),t.b(' viewBox="0 0 14 16" width="14">'),t.b(`
|
|
64
64
|
`+i),t.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),t.b(`
|
|
65
|
-
`+i),t.b("</svg>"),t.fl()},partials:{},subs:{}});
|
|
65
|
+
`+i),t.b("</svg>"),t.fl()},partials:{},subs:{}});j["icon-file-deleted"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),t.b(`
|
|
66
66
|
`+i),t.b(' viewBox="0 0 14 16" width="14">'),t.b(`
|
|
67
67
|
`+i),t.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),t.b(`
|
|
68
|
-
`+i),t.b("</svg>"),t.fl()},partials:{},subs:{}});
|
|
68
|
+
`+i),t.b("</svg>"),t.fl()},partials:{},subs:{}});j["icon-file-renamed"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),t.b(`
|
|
69
69
|
`+i),t.b(' viewBox="0 0 14 16" width="14">'),t.b(`
|
|
70
70
|
`+i),t.b(' <path d="M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z"></path>'),t.b(`
|
|
71
|
-
`+i),t.b("</svg>"),t.fl()},partials:{},subs:{}});
|
|
71
|
+
`+i),t.b("</svg>"),t.fl()},partials:{},subs:{}});j["icon-file"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),t.b(`
|
|
72
72
|
`+i),t.b(' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>'),t.b(`
|
|
73
|
-
`+i),t.b("</svg>"),t.fl()},partials:{},subs:{}});
|
|
73
|
+
`+i),t.b("</svg>"),t.fl()},partials:{},subs:{}});j["line-by-line-file-diff"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<div id="'),t.b(t.v(t.f("fileHtmlId",e,n,0))),t.b('" class="d2h-file-wrapper" data-lang="'),t.b(t.v(t.d("file.language",e,n,0))),t.b('">'),t.b(`
|
|
74
74
|
`+i),t.b(' <div class="d2h-file-header">'),t.b(`
|
|
75
75
|
`+i),t.b(" "),t.b(t.t(t.f("filePath",e,n,0))),t.b(`
|
|
76
76
|
`+i),t.b(" </div>"),t.b(`
|
|
@@ -83,8 +83,8 @@ var Mi=Object.create;var nn=Object.defineProperty;var Oi=Object.getOwnPropertyDe
|
|
|
83
83
|
`+i),t.b(" </table>"),t.b(`
|
|
84
84
|
`+i),t.b(" </div>"),t.b(`
|
|
85
85
|
`+i),t.b(" </div>"),t.b(`
|
|
86
|
-
`+i),t.b("</div>"),t.fl()},partials:{},subs:{}});
|
|
87
|
-
`+i),t.b('<div class="line-num2">'),t.b(t.v(t.f("newNumber",e,n,0))),t.b("</div>"),t.fl()},partials:{},subs:{}});
|
|
86
|
+
`+i),t.b("</div>"),t.fl()},partials:{},subs:{}});j["line-by-line-numbers"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<div class="line-num1">'),t.b(t.v(t.f("oldNumber",e,n,0))),t.b("</div>"),t.b(`
|
|
87
|
+
`+i),t.b('<div class="line-num2">'),t.b(t.v(t.f("newNumber",e,n,0))),t.b("</div>"),t.fl()},partials:{},subs:{}});j["side-by-side-file-diff"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<div id="'),t.b(t.v(t.f("fileHtmlId",e,n,0))),t.b('" class="d2h-file-wrapper" data-lang="'),t.b(t.v(t.d("file.language",e,n,0))),t.b('">'),t.b(`
|
|
88
88
|
`+i),t.b(' <div class="d2h-file-header">'),t.b(`
|
|
89
89
|
`+i),t.b(" "),t.b(t.t(t.f("filePath",e,n,0))),t.b(`
|
|
90
90
|
`+i),t.b(" </div>"),t.b(`
|
|
@@ -108,7 +108,7 @@ var Mi=Object.create;var nn=Object.defineProperty;var Oi=Object.getOwnPropertyDe
|
|
|
108
108
|
`+i),t.b(" </div>"),t.b(`
|
|
109
109
|
`+i),t.b(" </div>"),t.b(`
|
|
110
110
|
`+i),t.b(" </div>"),t.b(`
|
|
111
|
-
`+i),t.b("</div>"),t.fl()},partials:{},subs:{}});B["tag-file-added"]=new $.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),t.fl()},partials:{},subs:{}});B["tag-file-changed"]=new $.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),t.fl()},partials:{},subs:{}});B["tag-file-deleted"]=new $.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),t.fl()},partials:{},subs:{}});B["tag-file-renamed"]=new $.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),t.fl()},partials:{},subs:{}});var $e=class{constructor({compiledTemplates:n={},rawTemplates:i={}}){let t=Object.entries(i).reduce((r,[o,s])=>{let d=Gt.compile(s,{asString:!1});return Object.assign(Object.assign({},r),{[o]:d})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},B),n),t)}static compile(n){return Gt.compile(n,{asString:!1})}render(n,i,t,r,o){let s=this.templateKey(n,i);try{return this.preCompiledTemplates[s].render(t,r,o)}catch{throw new Error(`Could not find template to render '${s}'`)}}template(n,i){return this.preCompiledTemplates[this.templateKey(n,i)]}templateKey(n,i){return`${n}-${i}`}};var Tr=Object.assign(Object.assign(Object.assign({},Bt),zt),{outputFormat:Bn.LINE_BY_LINE,drawFileList:!0});function si(e,n={}){let i=Object.assign(Object.assign({},Tr),n),t=typeof e=="string"?Kn(e,i):e,r=new $e(i),{colorScheme:o}=i,s={colorScheme:o},d=i.drawFileList?new ut(r,s).render(t):"",p=i.outputFormat==="side-by-side"?new ze(r,i).render(t):new je(r,i).render(t);return d+p}var Fr=0;function a(e,n,i,t,r,o){n||(n={});var s,d,p=n;if("ref"in p)for(d in p={},n)d=="ref"?s=n[d]:p[d]=n[d];var c={type:e,props:p,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Fr,__i:-1,__u:0,__source:r,__self:o};if(typeof e=="function"&&(s=e.defaultProps))for(d in s)p[d]===void 0&&(p[d]=s[d]);return D.vnode&&D.vnode(c),c}function Lr(e){return si(e,{outputFormat:"line-by-line",drawFileList:!1,matching:"none",diffStyle:"word"})}function Xt({diff:e}){let n=At(()=>e.trim()?Lr(e):"",[e]);return n?a("div",{class:"diff",role:"region","aria-label":"Diff",tabIndex:0,dangerouslySetInnerHTML:{__html:n}}):null}var Nr={starting:["The change didn't start","starting the change"],planning:["Revyse couldn't plan the change","planning the change"],patching:["Revyse couldn't write the change","writing the change"],applying:["The change couldn't be applied","applying the change to your files"],checking:["The checks didn't finish","running your project's checks"],reporting:["The result wasn't saved","saving the result to Revyse"],reverting:["The change couldn't be reverted","reverting the change"],accepting:["The change wasn't kept","keeping the change"]},Yt=e=>{let n=Math.round(e*10)/10;return`${n.toFixed(1)} ${n===1?"credit":"credits"}`},ci={running:["\u2026","Running"],passed:["\u2713","Passed"],failed:["\u2715","Failed"],skipped:["\u2013","Skipped"],not_run:["\u2013","Not run"]},Kt={typecheck:"Typecheck",lint:"Lint",test:"Tests",build:"Build",browser:"Browser",visual:"Visual"},Me=(e,n)=>`${e} ${n}${e===1?"":"s"}`,Pr=e=>e.source?`${e.source.file}${e.source.line?`:${e.source.line}`:""}`:void 0;function Rr({status:e}){return a("p",{class:"status","data-status":e,role:"status",children:[a("span",{class:"dot","aria-hidden":"true"}),a("span",{children:"Connected to revyse dev"})]})}function Dr({live:e,onAction:n}){return a("div",{class:"live-status",role:"group","aria-label":"Live session",children:[a("span",{class:"live-chip",title:"Signed in to Revyse as",children:[a("span",{class:"dot","aria-hidden":"true"}),e.email]}),a("span",{class:"live-chip",title:"Revyse project",children:e.project}),a("button",{type:"button",class:"signout",onClick:()=>n({type:"signout"}),children:"Sign out"})]})}var Mr={queued:["\u2026","Preview queued"],building:["\u2026","Preview building"],ready:["\u2713","Preview ready"],error:["\u2715","Preview failed to build"],canceled:["\u2013","Preview cancelled"]},Or={awaiting_approval:["\u2026","Waiting for approval","running"],approved:["\u2713","Approved","passed"],released:["\u2713","Merged and released","passed"],rejected:["\u2715","Rejected","failed"]};function Ir({cloud:e}){let n=e.preview?Mr[e.preview.status]:null,i=e.pullRequestUrl?Or[e.state]:void 0;return a("div",{class:"cloud","data-cloud-state":e.state,children:[e.pullRequestUrl&&a("ul",{class:"checks","aria-label":"Where the change is",children:[a("li",{"data-check":"passed","data-step":"pull_request",children:[a("span",{class:"check-icon","aria-hidden":"true",children:"\u2713"}),a("span",{class:"check-name",children:"Pull request open"}),a("a",{class:"link",href:e.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:"View"})]}),a("li",{"data-check":e.preview?.status==="ready"?"passed":e.preview?.status==="error"?"failed":"running","data-step":"preview",children:[a("span",{class:"check-icon","aria-hidden":"true",children:n?.[0]??"\u2026"}),a("span",{class:"check-name",children:n?.[1]??"Waiting for the preview"}),e.preview?.status==="ready"&&e.preview.url&&a("a",{class:"link",href:e.preview.url,target:"_blank",rel:"noopener noreferrer",children:"Open"})]}),i&&a("li",{"data-check":i[2],"data-step":"approval",children:[a("span",{class:"check-icon","aria-hidden":"true",children:i[0]}),a("span",{class:"check-name",children:i[1]})]})]}),a("p",{class:"meta",children:a("a",{class:"link",href:e.changeUrl,target:"_blank",rel:"noopener noreferrer",children:"Open this change on Revyse"})})]})}function Hr({context:e,onClear:n}){return a("div",{class:"chip",role:"group","aria-label":"Selected element",children:[a("div",{class:"chip-main",children:[a("code",{children:["<",e.tagName,">"]}),e.text&&a("span",{class:"chip-text",children:e.text.slice(0,60)})]}),a("div",{class:"chip-where",children:Pr(e)??"Source not found \u2014 Revyse will search for it"}),a("button",{type:"button",class:"chip-clear","aria-label":"Clear selection",onClick:n,children:"\xD7"})]})}function ai({text:e}){return a(Z,{children:e.split("`").map((n,i)=>i%2?a("code",{children:n},i):n)})}function z({kind:e,icon:n,title:i,tone:t,children:r}){return a("div",{class:"state","data-state":e,"data-tone":t,role:t==="error"?"alert":"status","aria-busy":t==="progress"?"true":void 0,children:[a("span",{class:"state-icon","aria-hidden":"true",children:t==="progress"?a("span",{class:"spinner"}):n}),a("div",{class:"state-main",children:[a("h3",{class:"state-title",children:i}),r]})]})}function he({items:e,onAction:n}){return a("div",{class:"actions",children:e.map(i=>a("button",{type:"button",class:i.primary?"primary":"secondary",onClick:()=>n(i.action),children:i.label},i.label))})}function Ur({onAction:e}){let[n,i]=V("");return a("form",{class:"answer",onSubmit:t=>{t.preventDefault(),n.trim()&&e({type:"answer",text:n.trim()})},children:[a("label",{class:"field-label",for:"revyse-answer",children:"Your answer"}),a("textarea",{id:"revyse-answer",rows:3,value:n,onInput:t=>i(t.target.value)}),a("div",{class:"actions",children:[a("button",{type:"submit",class:"primary",disabled:!n.trim(),children:"Send answer"}),a("button",{type:"button",class:"secondary",onClick:()=>e({type:"cancel"}),children:"Cancel"})]})]})}var Wr=e=>`${e.label} \xB7 \xD7${e.creditWeight}${e.allowed?e.available?"":" (not set up)":" (turned off)"}`;function jr(){return a("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:a("path",{d:"M8 13V3M3.5 7.5 8 3l4.5 4.5",fill:"none",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"})})}function Br(){return a("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:[a("circle",{cx:"8",cy:"8",r:"4.5",fill:"none",stroke:"currentColor","stroke-width":"1.5"}),a("path",{d:"M8 1v3M8 12v3M1 8h3M12 8h3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})]})}var zr="image/png,image/jpeg,image/webp",$r=5*1024*1024;function Vr({context:e,models:n,selecting:i,selectButtonRef:t,onToggleSelect:r,onClearSelection:o,onAction:s,live:d=!1}){let[p,c]=V(""),[h,x]=V(null),[l,u]=V(null),[b,f]=V(""),g=n?.models.find(_=>_.id===n.defaultModel)?.label,k=n?.models.find(_=>_.id===b),m=!!(e&&p.trim()),S=()=>{e&&p.trim()&&s({type:"start",prompt:p.trim(),element:e,...b?{model:b}:{},...h?{screenshot:h}:{}})};return a("form",{class:"composer",onSubmit:_=>{_.preventDefault(),S()},children:[a("div",{class:"box",children:[e&&!i&&a(Hr,{context:e,onClear:o}),a("label",{class:"visually-hidden",for:"revyse-prompt",children:"Describe the change"}),a("textarea",{id:"revyse-prompt",class:"prompt",rows:2,maxLength:4e3,"data-autofocus":!0,placeholder:e?"What should change? e.g. Make this heading say \u201CFresh bread daily\u201D":"What should change on this page?",value:p,onInput:_=>c(_.target.value),onKeyDown:_=>{_.key==="Enter"&&!_.shiftKey&&!_.isComposing&&(_.preventDefault(),S())}}),a("div",{class:"toolbar",children:[a("button",{ref:t,type:"button",class:"select-toggle tool","aria-pressed":i,onClick:r,children:[a(Br,{}),i?"Cancel selection":e?"Select another element":"Select an element"]}),d&&a("label",{class:"tool attach",children:[a("input",{type:"file",class:"visually-hidden",accept:zr,onChange:_=>{let F=_.target,M=F.files?.[0]??null;if(F.value="",M&&M.size>$r){u("Screenshots are limited to 5 MB.");return}u(null),x(M)}}),h?"Change screenshot":"Attach a screenshot"]}),a("span",{class:"toolbar-end",children:[n&&a(Z,{children:[a("label",{class:"visually-hidden",for:"revyse-model",children:"Model"}),a("select",{id:"revyse-model",class:"tier",title:k?`${k.description}. About ${k.typicalCredits} credits a change.`:"The organization's default model",value:b,onChange:_=>f(_.target.value),children:[a("option",{value:"",children:["Default",g?` \xB7 ${g}`:""]}),n.models.map(_=>a("option",{value:_.id,disabled:!_.allowed||!_.available,children:Wr(_)},_.id))]})]}),a("button",{type:"submit",class:"send","aria-label":"Plan the change",disabled:!m,children:a(jr,{})})]})]})]}),(h||l)&&a("p",{class:"meta attachment",role:l?"alert":void 0,children:l??a(Z,{children:["Screenshot: ",h.name," ",a("button",{type:"button",class:"signout",onClick:()=>x(null),children:"Remove"})]})})]})}function di({turns:e}){return e.length===0?null:a("ol",{class:"conversation","aria-label":"Conversation",children:e.map((n,i)=>a("li",{"data-role":n.role,children:[a("span",{class:"who",children:n.role==="user"?"You":"Revyse"}),a("span",{class:"said",children:n.text})]},i))})}function ft({items:e,onAction:n}){let[i,t]=V(!1),[r,o]=V("");return i?a("form",{class:"answer",onSubmit:s=>{s.preventDefault(),r.trim()&&n({type:"revise",text:r.trim()})},children:[a("label",{class:"field-label",for:"revyse-revision",children:"What should be different?"}),a("textarea",{id:"revyse-revision",rows:3,maxLength:2e3,value:r,onInput:s=>o(s.target.value)}),a("div",{class:"actions",children:[a("button",{type:"submit",class:"primary",disabled:!r.trim(),children:"Send revision"}),a("button",{type:"button",class:"secondary",onClick:()=>t(!1),children:"Back"})]})]}):a("div",{class:"actions",children:e.map(s=>a("button",{type:"button",class:s.primary?"primary":"secondary",onClick:()=>s.action==="revise"?t(!0):n(s.action),children:s.label},s.label))})}var qr=e=>e<1e3?"<1 s":`${(e/1e3).toFixed(1)} s`;function li({items:e}){if(!e||e.length===0)return null;let n=e.slice(-6);return a("ol",{class:"activity","aria-label":"What Revyse is doing","aria-live":"polite",children:[e.length>n.length&&a("li",{class:"meta",children:Me(e.length-n.length,"earlier step")}),n.map((i,t)=>a("li",{"data-done":i.ms!==void 0,children:[a("span",{children:i.text}),a("span",{class:"took",children:i.ms!==void 0?qr(i.ms):"\u2026"})]},e.length-n.length+t))]})}function Jt({envVars:e,notDone:n,sensitive:i}){return a(Z,{children:[i&&i.length>0&&a("p",{class:"note sensitive",children:["Touches sensitive areas: ",i.join(", "),". Review these parts carefully."]}),e&&e.length>0&&a("p",{class:"note",children:["Needs ",e.length===1?"this variable":"these variables"," set where the app runs:"," ",e.map(t=>a("code",{children:t},t))]}),n&&n.length>0&&a("div",{class:"note",children:[a("p",{children:"Not part of this change:"}),a("ul",{children:n.map(t=>a("li",{children:t},t))})]})]})}function Gr({state:e,onAction:n,live:i=!1}){return a(z,{kind:"plan",icon:"\u270E",title:"Here's the plan",tone:"info",children:[a(di,{turns:e.conversation}),a("p",{class:"state-text plan-summary",children:e.plan.summary}),e.plan.steps.length>0&&a("ol",{class:"steps",children:e.plan.steps.map((t,r)=>a("li",{children:[a("span",{children:t.description}),t.files.map(o=>a("code",{children:o},o))]},r))}),a(Jt,{envVars:e.plan.envVars,notDone:e.plan.notDoing,sensitive:e.plan.sensitive}),a("p",{class:"meta",children:["Planned with ",e.model,e.cost!==void 0&&` for ${Yt(e.cost)}`,"."," ",i?"Applying makes the change on a branch, runs your checks and opens a pull request with a preview. Your site stays as it is.":"Nothing is changed until you apply it."]}),a(ft,{items:[{label:"Apply the change",action:{type:"approve"},primary:!0},{label:"Revise",action:"revise"},{label:"Cancel",action:{type:"cancel"}}],onAction:n})]})}function Xr({keys:e,artifactUrl:n}){let[i,t]=V([]);return Ee(()=>{let r=!0,o=[];return Promise.all(e.map(async s=>{let d=n(s);if(!d)return null;let p=await fetch(d,{mode:"cors"}).catch(()=>null);if(!p?.ok)return null;let c=URL.createObjectURL(await p.blob());return o.push(c),{label:/before\.png$/.test(s)?"Before":"After",src:c}})).then(s=>r&&t(s.filter(d=>d!==null))),()=>{r=!1;for(let s of o)URL.revokeObjectURL(s)}},[e.join("|"),n]),i.length===0?null:a("div",{class:"shots",role:"group","aria-label":"Browser check screenshots",children:i.map(r=>a("figure",{children:[a("img",{src:r.src,alt:`${r.label} the change`}),a("figcaption",{children:r.label})]},r.label))})}function ui({checks:e,artifactUrl:n}){if(e.length===0)return a("p",{class:"meta",children:"No checks are configured for this project, so none ran."});let i=e.find(r=>r.kind==="browser"),t=e.find(r=>r.kind==="browser"&&r.status==="failed");return a(Z,{children:[a("ul",{class:"badges","aria-label":"Checks",children:e.map(r=>{let[o,s]=ci[r.status],d=r.evidence?.summary??r.reason;return a("li",{class:"badge","data-check":r.status,title:d,children:[a("span",{"aria-hidden":"true",children:o})," ",Kt[r.kind],": ",s]},r.kind)})}),t?.evidence?.summary&&a("pre",{class:"check-output",children:t.evidence.summary}),e.some(r=>r.preExisting)&&a("p",{class:"meta",children:"A check was already failing before this change, with the same errors, so it doesn't count against it."}),n&&i?.evidence?.artifactKeys?.length?a(Xr,{keys:i.evidence.artifactKeys,artifactUrl:n}):null]})}function Yr({state:e,onAction:n,artifactUrl:i}){let{result:t}=e,r=t.state==="failed";return a(z,{kind:"result",icon:r?"\u2715":"\u2713",title:r?"Applied, but checks failed":"Ready for review",tone:r?"error":"info",children:[a("p",{class:"state-text",children:r?"The change is in your files, but some checks failed. Revise it or revert it.":"The change is in your files. Check it on the page and in the diff below."}),t.summary&&a("p",{class:"state-text summary",children:t.summary}),a("ul",{class:"files changed",children:t.files.map(o=>a("li",{children:[a("code",{children:o.path})," ",o.kind==="create"&&a("span",{class:"kind",children:"new"}),o.kind==="delete"&&a("span",{class:"kind deleted",children:"deleted"}),a("span",{class:"counts","aria-label":`${Me(o.additions,"line")} added, ${Me(o.deletions,"line")} removed`,children:[a("span",{class:"add",children:["+",o.additions]})," ",a("span",{class:"del",children:["\u2212",o.deletions]})]}),o.explanation&&a("span",{class:"explanation",children:o.explanation})]},o.path))}),a(Jt,{envVars:t.envVars,notDone:t.notDone,sensitive:t.sensitive}),a(ui,{checks:t.checks,artifactUrl:i}),t.cost!==void 0&&a("p",{class:"meta cost",children:["This change has cost ",Yt(t.cost),"."]}),a(Xt,{diff:t.diff}),e.conversation.length>0&&a("details",{class:"history",children:[a("summary",{children:["Conversation (",e.conversation.length,")"]}),a(di,{turns:e.conversation})]}),a(ft,{items:[{label:"Keep the change",action:{type:"accept"},primary:!r},{label:"Revise",action:"revise",primary:r},{label:"Revert",action:{type:"revert"}}],onAction:n})]})}function Kr({state:e,cloud:n,onAction:i}){let{result:t}=e,r=t.state==="failed",o=n?.state==="released";return a(z,{kind:"result",icon:r?"\u2715":"\u2713",title:r?"Checks failed":o?"Merged and released":n?.pullRequestUrl?"Pull request open":"Ready for review",tone:r?"error":"info",children:[a("p",{class:"state-text",children:r?"Some checks failed, so no pull request was opened. Revise the change, or start another.":o?"The pull request was merged, so the change is on its way to your site.":"An approver reviews it on Revyse and it is merged on GitHub; your site changes only then. Open the preview to see it."}),t.summary&&a("p",{class:"state-text summary",children:t.summary}),a("ul",{class:"files changed",children:t.files.map(s=>a("li",{children:[a("code",{children:s.path})," ",s.kind==="create"&&a("span",{class:"kind",children:"new"}),s.kind==="delete"&&a("span",{class:"kind deleted",children:"deleted"}),a("span",{class:"counts","aria-label":`${Me(s.additions,"line")} added, ${Me(s.deletions,"line")} removed`,children:[a("span",{class:"add",children:["+",s.additions]})," ",a("span",{class:"del",children:["\u2212",s.deletions]})]})]},s.path))}),a(Jt,{envVars:t.envVars,notDone:t.notDone,sensitive:t.sensitive}),a(ui,{checks:t.checks}),t.cost!==void 0&&a("p",{class:"meta cost",children:["This change has cost ",Yt(t.cost),"."]}),a("details",{class:"history",children:[a("summary",{children:"The diff"}),a(Xt,{diff:t.diff})]}),a(ft,{items:[...o?[]:[{label:"Revise",action:"revise",primary:r}],{label:"Start another change",action:{type:"dismiss"},primary:!r}],onAction:i})]})}var Jr={accepted:["\u2713","Change kept",()=>"It's in your working tree. Review and commit it as you normally would."],reverted:["\u21BA","Change reverted",e=>e&&e.length>0?`Restored ${Me(e.length,"file")} to how ${e.length===1?"it was":"they were"} before Revyse changed ${e.length===1?"it":"them"}.`:"Your files are as they were before this change."],cancelled:["\u2013","Change cancelled",()=>"Revyse stopped working on it."]},Qr=new Set(["queued","planning","clarification","plan","applying","checking","result","failed","finished"]);function pi(e){let n=e.live?.cloud;return a(Z,{children:[a(Zr,{...e}),n&&Qr.has(e.state.kind)&&a(Ir,{cloud:n})]})}function Zr({state:e,models:n,artifactUrl:i,selecting:t=!1,selectButtonRef:r,onToggleSelect:o=()=>{},onClearSelection:s=()=>{},onAction:d=()=>{},live:p,touch:c=!1}){switch(e.kind){case"connecting":return p?a(z,{kind:"connecting",icon:"\u2026",title:"Connecting to Revyse\u2026",tone:"progress"}):a(z,{kind:"connecting",icon:"\u2026",title:"Connecting to revyse dev\u2026",tone:"progress",children:a("p",{class:"state-text",children:"This takes a moment after the dev server starts."})});case"disconnected":return p?e.reason==="not_running"?a(z,{kind:"disconnected",icon:"!",title:"Reconnecting to Revyse\u2026",tone:"error",children:a("p",{class:"state-text",children:"The connection dropped. Revyse keeps trying, and your change carries on in the cloud meanwhile."})}):a(z,{kind:"disconnected",icon:"!",title:"Your live session has ended",tone:"error",children:[a("p",{class:"state-text",children:"Sign in again to keep requesting changes on this site. Changes you already asked for carry on; they are on the Revyse dashboard."}),a(he,{items:[{label:"Sign in again",action:{type:"signin"},primary:!0}],onAction:d})]}):e.reason==="not_running"?a(z,{kind:"disconnected",icon:"!",title:"Not connected",tone:"error",children:a("p",{class:"state-text",children:a(ai,{text:"Run `npx revyse dev` in your project. This page reconnects on its own."})})}):a(z,{kind:"disconnected",icon:"!",title:"This page isn't connected",tone:"error",children:[a("p",{class:"state-text",children:"The Revyse agent didn't accept this page. Reload it from the address revyse dev printed."}),a(he,{items:[{label:"Reload page",action:{type:"reload"}}],onAction:d})]});case"unsupported":return a(z,{kind:"unsupported",icon:"\u2298",title:"Revyse can't run here",tone:"info",children:a("p",{class:"state-text",children:e.reason})});case"ready":case"selected":{let h=e.kind==="selected"?e.context:null;return a("div",{class:"state","data-state":e.kind,children:[p?a(Dr,{live:p,onAction:d}):a(Rr,{status:"connected"}),a(Vr,{live:!!p,context:h,models:n,selecting:t,selectButtonRef:r,onToggleSelect:o,onClearSelection:s,onAction:d}),a("p",{class:"hint","aria-live":"polite",children:t?c?"Tap the element you want to change.":"Click an element, or use the arrow keys to move and Enter to choose. Esc cancels.":h?p?"Revyse plans the change first. Your site changes only when its pull request is merged.":"Revyse plans the change first; nothing is written until you apply it.":"Select the element you want to change, then send your request."})]})}case"queued":return a(z,{kind:"queued",icon:"\u2026",title:"Waiting for a cloud workspace\u2026",tone:"progress",children:[a("p",{class:"state-text",children:"Revyse picks the change up in a moment, then plans it from your repository."}),a(he,{items:[{label:"Cancel",action:{type:"cancel"}}],onAction:d})]});case"planning":return a(z,{kind:"planning",icon:"\u2026",title:"Planning the change\u2026",tone:"progress",children:[a("blockquote",{class:"quote",children:e.prompt}),a(li,{items:e.activity}),a(he,{items:[{label:"Cancel",action:{type:"cancel"}}],onAction:d})]});case"clarification":{let h=e.integration;if(h){let x=h.providers[0]??"a provider";return a(z,{kind:"clarification",icon:"\u2699",title:`This needs ${h.capability==="email"?"an email":"a"} service`,tone:"info",children:[a("p",{class:"state-text question",children:h.reason}),a("p",{class:"note",children:["Connect ",h.providers.join(" or ")," on the Revyse dashboard. Keys are entered there, never here."]}),h.connectUrl&&a("p",{children:a("a",{href:h.connectUrl,target:"_blank",rel:"noopener noreferrer",class:"link",children:["Connect ",x," on the dashboard"]})}),a(he,{items:[{label:"I've connected it: plan again",action:{type:"answer",text:`I connected ${x} in Revyse. Plan the change again with it.`},primary:!0},{label:"Cancel",action:{type:"cancel"}}],onAction:d})]})}return a(z,{kind:"clarification",icon:"?",title:"Revyse has a question",tone:"info",children:[a("p",{class:"state-text question",children:e.question}),a(Ur,{onAction:d})]})}case"applying":return a(z,{kind:"applying",icon:"\u2026",title:"Applying the change\u2026",tone:"progress",children:e.activity&&e.activity.length>0?a(li,{items:e.activity}):a("p",{class:"state-text",children:p?"Writing the change on a branch of your repository, in a cloud workspace.":e.files?`Writing ${e.files} ${e.files===1?"file":"files"} in your project.`:"Writing the change to your project."})});case"checking":return a(z,{kind:"checking",icon:"\u2026",title:"Checking the change\u2026",tone:"progress",children:a("ul",{class:"checks",children:e.checks.map(h=>{let[x,l]=ci[h.status];return a("li",{"data-check":h.status,children:[a("span",{class:"check-icon","aria-hidden":"true",children:x}),a("span",{class:"check-name",children:h.name}),a("span",{class:"check-status",children:l})]},h.name)})})});case"conflict":{let h=e.reason==="changed_since_apply";return a(z,{kind:"conflict",icon:"\u26A0",title:h?"Files changed after Revyse's edit":"Files changed while Revyse was working",tone:"error",children:[a("p",{class:"state-text",children:e.message??"Nothing was written. These files changed after Revyse read them:"}),a("ul",{class:"files",children:e.files.map(x=>a("li",{children:a("code",{children:x})},x))}),a(he,{items:h?[{label:"Dismiss",action:{type:"dismiss"},primary:!0}]:[{label:"Re-plan with the latest files",action:{type:"refresh"},primary:!0},{label:"Cancel",action:{type:"cancel"}}],onAction:d})]})}case"failed":{let[h,x]=e.stage?Nr[e.stage]:["The change didn't go through",void 0],l=e.next,u=[];return l?(l.includes("replan")&&u.push({label:"Try again",action:{type:"refresh"},primary:!0}),l.includes("revise")&&u.push({label:"Revise",action:"revise",primary:u.length===0}),l.includes("revert")&&u.push({label:"Revert Revyse's edits",action:{type:"revert"}}),l.includes("reload")&&u.push({label:"Reload page",action:{type:"reload"},primary:!0})):e.retryable&&u.push({label:"Try again",action:{type:"retry"},primary:!0}),u.push({label:"Dismiss",action:{type:"dismiss"}}),a(z,{kind:"failed",icon:"\u2715",title:h,tone:"error",children:[x&&a("p",{class:"meta",children:["While ",x,"."," ",e.filesChanged?"Revyse's edits are in your files.":"Your files weren't changed."]}),a("p",{class:"state-text",children:a(ai,{text:e.message})}),a(ft,{items:u,onAction:d})]})}case"plan":return a(Gr,{state:e,onAction:d,live:!!p});case"result":return p?a(Kr,{state:e,cloud:p.cloud,onAction:d}):a(Yr,{state:e,onAction:d,artifactUrl:i});case"reverting":return a(z,{kind:"reverting",icon:"\u2026",title:"Reverting the change\u2026",tone:"progress",children:a("p",{class:"state-text",children:"Restoring your files to how they were before Revyse changed them."})});case"finished":{let[h,x,l]=Jr[e.outcome];return a(z,{kind:"finished",icon:h,title:x,tone:"info",children:[a("p",{class:"state-text",children:l(e.files)}),e.files&&e.files.length>0&&a("ul",{class:"files",children:e.files.map(u=>a("li",{children:a("code",{children:u})},u))}),a(he,{items:[{label:"Start another change",action:{type:"dismiss"},primary:!0}],onAction:d})]})}case"permission_denied":return a(z,{kind:"permission_denied",icon:"\u2298",title:"You don't have permission",tone:"error",children:[a("p",{class:"state-text",children:[e.message??"Your role in this project can't request changes."," Ask a project owner to give you the editor role."]}),a(he,{items:[{label:"Dismiss",action:{type:"dismiss"}}],onAction:d})]});default:return e}}function fi(e){return e.unsupported?{kind:"unsupported",reason:e.unsupported}:e.status==="connecting"?{kind:"connecting"}:e.status==="disconnected"?{kind:"disconnected",reason:"not_running"}:e.status==="rejected"?{kind:"disconnected",reason:"rejected"}:e.flow?e.flow:e.selected?{kind:"selected",context:e.selected}:{kind:"ready"}}function hi(e){return["localhost","127.0.0.1","[::1]","::1"].includes(e.hostname)||e.hostname.endsWith(".localhost")?null:"Revyse local mode only works on your own machine (localhost). Open the app from the address your dev server printed."}var eo={"change.start":e=>({kind:"planning",prompt:e}),"change.answer":e=>({kind:"planning",prompt:e}),"change.revise":e=>({kind:"planning",prompt:e}),"change.refresh":e=>({kind:"planning",prompt:e}),"change.approve":()=>({kind:"applying"}),"change.revert":()=>({kind:"reverting"})};function gi(e){let n=e.now??(()=>Date.now()),i=[],t=0,r,o=null,s=!1,d=[],p=null,c="",h=null,x=()=>[...d];function l(g){p&&d.push(p),p=null,d.push({role:"user",text:g}),c=g}function u(){o=null,s=!1,d=[],p=null,h=null,e.setCloud?.(null)}function b(g){h=g;let k=eo[g.type];k&&e.setFlow(k(c)),g.type==="change.start"&&(s=!0),e.connection.request(g.type,g.payload).then(m=>{g.type!=="change.start"||!s||(s=!1,o=m?.changeId??o)},m=>{g.type==="change.start"&&(s=!1),e.setFlow({kind:"failed",message:m.message,retryable:!0})})}let f=e.connection.onEvent((g,k)=>{if(g==="cloud"){let S=mn(k);if(!S||(!o&&s&&(o=S.changeId),S.changeId!==o))return;e.setCloud?.(S),S.state==="draft"&&e.setFlow({kind:"queued"});return}if(g!=="change")return;let m=hn(k);if(m){if(m.changeId){if(!o&&s&&(o=m.changeId),m.changeId!==o)return}else if(!s)return;switch(m.type){case"planning":return i=[],e.setFlow({kind:"planning",prompt:c});case"plan":return p={role:"revyse",text:m.plan.summary},e.setFlow({kind:"plan",plan:m.plan,model:m.model,cost:m.cost,conversation:x()});case"clarification":return p={role:"revyse",text:m.question},e.setFlow({kind:"clarification",question:m.question,...m.integration?{integration:m.integration}:{}});case"applying":return i=[],r=m.files,e.setFlow({kind:"applying",files:m.files});case"activity":{let S=n(),_=i.at(-1);return _&&_.ms===void 0&&(i=[...i.slice(0,-1),{..._,ms:S-t}]),i=[...i,{text:m.text}],t=S,e.setFlow(m.phase==="plan"?{kind:"planning",prompt:c,activity:i}:{kind:"applying",files:r,activity:i})}case"checking":return e.setFlow({kind:"checking",checks:m.checks.map(S=>({name:Kt[S.kind],status:S.status}))});case"result":{let{state:S,files:_,diff:F,checks:M,cost:v,summary:y,envVars:w,notDone:A,sensitive:P}=m;return e.setFlow({kind:"result",result:{state:S,files:_,diff:F,checks:M,cost:v,summary:y,envVars:w,notDone:A,sensitive:P},conversation:x()})}case"conflict":return e.setFlow({kind:"conflict",files:m.files,reason:m.reason,message:m.message});case"reverted":return e.setFlow({kind:"finished",outcome:"reverted",files:m.files});case"accepted":return e.setFlow({kind:"finished",outcome:"accepted"});case"cancelled":return e.setFlow({kind:"finished",outcome:"cancelled"});case"failed":return e.setFlow({kind:"failed",message:m.message,retryable:m.retryable,stage:m.stage,filesChanged:m.filesChanged,next:m.next});case"permission_denied":return e.setFlow({kind:"permission_denied",message:m.message})}}});return{handle(g){let k=o;switch(g.type){case"start":return u(),l(g.prompt),b({type:"change.start",payload:{prompt:g.prompt,element:g.element,...g.model?{model:g.model}:{},origin:globalThis.location?.origin,...g.screenshot?{screenshot:g.screenshot}:{}}});case"answer":case"revise":return k?(l(g.text),b({type:`change.${g.type}`,payload:{changeId:k,text:g.text}})):void 0;case"approve":case"revert":case"accept":case"refresh":return k?b({type:`change.${g.type}`,payload:{changeId:k}}):void 0;case"cancel":return k?b({type:"change.cancel",payload:{changeId:k}}):(u(),e.setFlow(null));case"retry":h&&b(h);return;case"dismiss":return u(),e.setFlow(null);case"reload":return}},dispose(){f()}}}function mi(e,n=6){let i=[],t=e;for(;t&&t.nodeType===1&&i.length<n;){let r=t.getAttribute("data-testid");if(r){i.unshift(`[data-testid="${CSS.escape(r)}"]`);break}if(t.id){i.unshift(`#${CSS.escape(t.id)}`);break}let o=t.tagName.toLowerCase(),s=t.parentElement;if(s){let d=Array.from(s.children).filter(p=>p.tagName===t.tagName);d.length>1&&(o+=`:nth-of-type(${d.indexOf(t)+1})`)}i.unshift(o),t=s}return i.join(" > ")}var bi=500;function xi(e){return e.closest("[data-revyse-ignore]")?!0:e instanceof HTMLInputElement?["password","hidden"].includes(e.type)||/cc-|card|cvc|cvv/i.test(e.autocomplete):!1}var to="input, textarea, select, option, optgroup, datalist, [contenteditable]:not([contenteditable=false])",Qt=e=>e.matches(to)||!!e.closest("[contenteditable]:not([contenteditable=false])");function _i(e){let n="",i=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:t=>{if(t.nodeType===Node.TEXT_NODE)return NodeFilter.FILTER_ACCEPT;let r=t;return r.matches("script, style, template, noscript, [data-revyse-ignore]")||Qt(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});for(let t=i.nextNode();t&&n.length<=bi*2;t=i.nextNode())n+=` ${t.nodeValue??""}`;return n.replace(/\s+/g," ").trim().slice(0,bi)}var vi=["header","nav","main","footer","aside","section","article","form","dialog",...["banner","navigation","main","contentinfo","complementary","region","dialog"].map(e=>`[role=${e}]`)].join(", ");function no(e){let n=[],i=e.ownerDocument;for(let t=e.parentElement;t&&n.length<6&&!(t===i.body||t===i.documentElement);t=t.parentElement)n.push({tagName:t.tagName.toLowerCase(),...t.id?{id:t.id.slice(0,256)}:{},classList:Array.from(t.classList).slice(0,20)});return n}function io(e){let n=[];for(let i=e.parentElement?.closest(vi)??null;i&&n.length<4;i=i.parentElement?.closest(vi)??null){let t=i.querySelector("h1, h2, h3, h4, h5, h6"),r=i.getAttribute("aria-label")??(t&&!xi(t)?_i(t):void 0),o=i.getAttribute("role");n.push({tagName:i.tagName.toLowerCase(),...o?{role:o}:{},...r?{label:r.slice(0,120)}:{}})}return n}function wi(e,n=location.pathname){let i=e.getBoundingClientRect(),t=xi(e)||Qt(e)?void 0:_i(e)||void 0;return{route:n,selector:mi(e),tagName:e.tagName.toLowerCase(),text:t,role:e.getAttribute("role")??void 0,ariaLabel:Qt(e)?void 0:e.getAttribute("aria-label")??void 0,classList:Array.from(e.classList).slice(0,100),boundingBox:{x:i.x,y:i.y,width:i.width,height:i.height},ancestors:no(e),landmarks:io(e),...e.ownerDocument.defaultView?{viewport:{width:e.ownerDocument.defaultView.innerWidth,height:e.ownerDocument.defaultView.innerHeight}}:{},...yi(e)?{rv:yi(e)}:{},source:Zt(e)}}function yi(e){let n=e.closest("[data-rv]")?.getAttribute("data-rv");return n&&/^[0-9a-f]{12}$/.test(n)?n:void 0}function Zt(e){let i=e.closest("[data-revyse-loc]")?.getAttribute("data-revyse-loc")?.match(/^(.+):(\d+):(\d+)$/);if(i)return{file:i[1],line:Number(i[2]),column:Number(i[3])}}var ro="[data-revyse-ignore], script, style, template, noscript, head, meta, link, title";function ge(e){return!e||e.nodeType!==Node.ELEMENT_NODE||e.closest(ro)||e===e.ownerDocument.documentElement?!1:e.checkVisibility?.()??!0}var en=e=>Array.from(e.children).filter(ge);function oo(e,n){if(n==="ArrowUp"){let r=e.parentElement;return r&&r!==e.ownerDocument.documentElement&&ge(r)?r:null}if(n==="ArrowDown")return en(e)[0]??null;let i=e.parentElement?en(e.parentElement):[],t=i.indexOf(e);return i[n==="ArrowLeft"?t-1:t+1]??null}function ki(e){let n=e.activeElement;if(ge(n)&&n!==e.body)return n;let i=e.querySelector("main, [role=main]");return ge(i)?i:en(e.body)[0]??null}var Ci=["pointerdown","mousedown","pointerup","mouseup","click","dblclick","auxclick"];function Si(e,n,i){let t=e.defaultView,r=null,o=f=>f.composedPath().includes(n),s=f=>{f!==r&&(r=f,i.onCandidate(f))},d=f=>{if(o(f))return;let g=f.composedPath()[0];g instanceof Element&&ge(g)&&s(g)},p=f=>{if(o(f)||(f.preventDefault(),f.stopImmediatePropagation(),f.type!=="click"))return;let g=f.composedPath()[0];g instanceof Element&&ge(g)&&i.onSelect(g)},c=null,h=10,x=f=>{if(o(f))return;f.stopImmediatePropagation();let g=f.touches[0];c=g?{x:g.clientX,y:g.clientY}:null;let k=f.composedPath()[0];k instanceof Element&&ge(k)&&s(k)},l=f=>{if(o(f))return;f.stopImmediatePropagation();let g=f.changedTouches[0],k=c;if(c=null,!k||!g||Math.hypot(g.clientX-k.x,g.clientY-k.y)>h)return;f.preventDefault();let m=f.composedPath()[0];m instanceof Element&&ge(m)&&i.onSelect(m)},u=f=>{if(!f.isComposing){if(f.key==="Escape"){f.preventDefault(),f.stopImmediatePropagation(),i.onExit();return}if(f.key==="Enter"&&r){f.preventDefault(),f.stopImmediatePropagation(),i.onSelect(r);return}if(f.key==="ArrowUp"||f.key==="ArrowDown"||f.key==="ArrowLeft"||f.key==="ArrowRight"){f.preventDefault(),f.stopImmediatePropagation();let g=r?oo(r,f.key):ki(e);g&&(s(g),g.scrollIntoView?.({block:"nearest",inline:"nearest"}))}}};t.addEventListener("pointermove",d,!0);for(let f of Ci)t.addEventListener(f,p,!0);t.addEventListener("touchstart",x,{capture:!0,passive:!0}),t.addEventListener("touchend",l,{capture:!0,passive:!1}),t.addEventListener("keydown",u,!0),s(ki(e));let b=!1;return{get candidate(){return r},stop(){if(!b){b=!0,t.removeEventListener("pointermove",d,!0);for(let f of Ci)t.removeEventListener(f,p,!0);t.removeEventListener("touchstart",x,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("keydown",u,!0),s(null)}}}}var Ei=`
|
|
111
|
+
`+i),t.b("</div>"),t.fl()},partials:{},subs:{}});j["tag-file-added"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),t.fl()},partials:{},subs:{}});j["tag-file-changed"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),t.fl()},partials:{},subs:{}});j["tag-file-deleted"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),t.fl()},partials:{},subs:{}});j["tag-file-renamed"]=new V.Template({code:function(e,n,i){var t=this;return t.b(i=i||""),t.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),t.fl()},partials:{},subs:{}});var $e=class{constructor({compiledTemplates:n={},rawTemplates:i={}}){let t=Object.entries(i).reduce((r,[o,s])=>{let c=Xt.compile(s,{asString:!1});return Object.assign(Object.assign({},r),{[o]:c})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},j),n),t)}static compile(n){return Xt.compile(n,{asString:!1})}render(n,i,t,r,o){let s=this.templateKey(n,i);try{return this.preCompiledTemplates[s].render(t,r,o)}catch{throw new Error(`Could not find template to render '${s}'`)}}template(n,i){return this.preCompiledTemplates[this.templateKey(n,i)]}templateKey(n,i){return`${n}-${i}`}};var Pr=Object.assign(Object.assign(Object.assign({},zt),$t),{outputFormat:Bn.LINE_BY_LINE,drawFileList:!0});function si(e,n={}){let i=Object.assign(Object.assign({},Pr),n),t=typeof e=="string"?Kn(e,i):e,r=new $e(i),{colorScheme:o}=i,s={colorScheme:o},c=i.drawFileList?new pt(r,s).render(t):"",p=i.outputFormat==="side-by-side"?new ze(r,i).render(t):new je(r,i).render(t);return c+p}var Rr=0;function a(e,n,i,t,r,o){n||(n={});var s,c,p=n;if("ref"in p)for(c in p={},n)c=="ref"?s=n[c]:p[c]=n[c];var d={type:e,props:p,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Rr,__i:-1,__u:0,__source:r,__self:o};if(typeof e=="function"&&(s=e.defaultProps))for(c in s)p[c]===void 0&&(p[c]=s[c]);return D.vnode&&D.vnode(d),d}function Dr(e){return si(e,{outputFormat:"line-by-line",drawFileList:!1,matching:"none",diffStyle:"word"})}function ht({diff:e}){let n=Tt(()=>e.trim()?Dr(e):"",[e]);return n?a("div",{class:"diff",role:"region","aria-label":"Diff",tabIndex:0,dangerouslySetInnerHTML:{__html:n}}):null}var Mr={starting:["The change didn't start","starting the change"],planning:["Revyse couldn't plan the change","planning the change"],patching:["Revyse couldn't write the change","writing the change"],applying:["The change couldn't be applied","applying the change to your files"],checking:["The checks didn't finish","running your project's checks"],reporting:["The result wasn't saved","saving the result to Revyse"],reverting:["The change couldn't be reverted","reverting the change"],accepting:["The change wasn't kept","keeping the change"]},Yt=e=>{let n=Math.round(e*10)/10;return`${n.toFixed(1)} ${n===1?"credit":"credits"}`},di={running:["\u2026","Running"],passed:["\u2713","Passed"],failed:["\u2715","Failed"],skipped:["\u2013","Skipped"],not_run:["\u2013","Not run"]},Kt={typecheck:"Typecheck",lint:"Lint",test:"Tests",build:"Build",browser:"Browser",visual:"Visual"},Oe=(e,n)=>`${e} ${n}${e===1?"":"s"}`,Or=e=>e.source?`${e.source.file}${e.source.line?`:${e.source.line}`:""}`:void 0;function Ir({status:e}){return a("p",{class:"status","data-status":e,role:"status",children:[a("span",{class:"dot","aria-hidden":"true"}),a("span",{children:"Connected"})]})}function Hr({live:e,onAction:n}){return a("div",{class:"live-status",role:"group","aria-label":"Live session",children:[a("span",{class:"live-chip",title:"Signed in to Revyse as",children:[a("span",{class:"dot","aria-hidden":"true"}),e.email]}),a("span",{class:"live-chip",title:"Revyse project",children:e.project}),a("button",{type:"button",class:"signout",onClick:()=>n({type:"signout"}),children:"Sign out"})]})}var Ur={queued:["\u2026","Preview queued"],building:["\u2026","Preview building"],ready:["\u2713","Preview ready"],error:["\u2715","Preview failed to build"],canceled:["\u2013","Preview cancelled"]},Wr={awaiting_approval:["\u2026","Waiting for approval","running"],approved:["\u2713","Approved","passed"],released:["\u2713","Merged and released","passed"],rejected:["\u2715","Rejected","failed"]};function jr({cloud:e}){let n=e.preview?Ur[e.preview.status]:null,i=e.pullRequestUrl?Wr[e.state]:void 0;return a("div",{class:"cloud","data-cloud-state":e.state,children:[e.pullRequestUrl&&a("ul",{class:"checks","aria-label":"Where the change is",children:[a("li",{"data-check":"passed","data-step":"pull_request",children:[a("span",{class:"check-icon","aria-hidden":"true",children:"\u2713"}),a("span",{class:"check-name",children:"Pull request open"}),a("a",{class:"link",href:e.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:"View"})]}),a("li",{"data-check":e.preview?.status==="ready"?"passed":e.preview?.status==="error"?"failed":"running","data-step":"preview",children:[a("span",{class:"check-icon","aria-hidden":"true",children:n?.[0]??"\u2026"}),a("span",{class:"check-name",children:n?.[1]??"Waiting for the preview"}),e.preview?.status==="ready"&&e.preview.url&&a("a",{class:"link",href:e.preview.url,target:"_blank",rel:"noopener noreferrer",children:"Open"})]}),i&&a("li",{"data-check":i[2],"data-step":"approval",children:[a("span",{class:"check-icon","aria-hidden":"true",children:i[0]}),a("span",{class:"check-name",children:i[1]})]})]}),a("p",{class:"meta",children:a("a",{class:"link",href:e.changeUrl,target:"_blank",rel:"noopener noreferrer",children:"Open this change on Revyse"})})]})}function Br({context:e,onClear:n}){return a("div",{class:"chip",role:"group","aria-label":"Selected element",children:[a("div",{class:"chip-main",children:[a("code",{children:["<",e.tagName,">"]}),e.text&&a("span",{class:"chip-text",children:e.text.slice(0,60)})]}),a("div",{class:"chip-where",children:Or(e)??"Source not found \u2014 Revyse will search for it"}),a("button",{type:"button",class:"chip-clear","aria-label":"Clear selection",onClick:n,children:"\xD7"})]})}function ai({text:e}){return a(K,{children:e.split("`").map((n,i)=>i%2?a("code",{children:n},i):n)})}function B({kind:e,icon:n,title:i,tone:t,children:r}){return a("div",{class:"state","data-state":e,"data-tone":t,role:t==="error"?"alert":"status","aria-busy":t==="progress"?"true":void 0,children:[a("span",{class:"state-icon","aria-hidden":"true",children:t==="progress"?a("span",{class:"spinner"}):n}),a("div",{class:"state-main",children:[a("h3",{class:"state-title",children:i}),r]})]})}function me({items:e,onAction:n}){return a("div",{class:"actions",children:e.map(i=>a("button",{type:"button",class:i.primary?"primary":"secondary",onClick:()=>n(i.action),children:i.label},i.label))})}function zr({onAction:e}){let[n,i]=$("");return a("form",{class:"answer",onSubmit:t=>{t.preventDefault(),n.trim()&&e({type:"answer",text:n.trim()})},children:[a("label",{class:"field-label",for:"revyse-answer",children:"Your answer"}),a("textarea",{id:"revyse-answer",rows:3,value:n,onInput:t=>i(t.target.value)}),a("div",{class:"actions",children:[a("button",{type:"submit",class:"primary",disabled:!n.trim(),children:"Send answer"}),a("button",{type:"button",class:"secondary",onClick:()=>e({type:"cancel"}),children:"Cancel"})]})]})}var $r=e=>`${e.label} \xB7 \xD7${e.creditWeight}${e.allowed?e.available?"":" (not set up)":" (turned off)"}`;function Vr(){return a("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:a("path",{d:"M8 13V3M3.5 7.5 8 3l4.5 4.5",fill:"none",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round"})})}function qr(){return a("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true",children:[a("circle",{cx:"8",cy:"8",r:"4.5",fill:"none",stroke:"currentColor","stroke-width":"1.5"}),a("path",{d:"M8 1v3M8 12v3M1 8h3M12 8h3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})]})}function Gr(){return a("svg",{viewBox:"0 0 16 16",width:"15",height:"15","aria-hidden":"true",children:a("path",{d:"M10.5 4.5 5.8 9.2a1.3 1.3 0 0 0 1.8 1.8l4.9-4.9a2.6 2.6 0 0 0-3.7-3.7L3.9 7.3a3.9 3.9 0 0 0 5.5 5.5L13 9.2",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})}var li=200;function Xr(e){let n=Z(null);return ue(()=>{let i=n.current;if(!i)return;let t=i.offsetHeight;i.style.transition="none",i.style.height="0px";let r=i.scrollHeight;if(i.style.height=t?`${t}px`:"",!r||!t){i.style.height="",i.style.transition="";return}i.offsetHeight,i.style.transition="",i.style.height=`${Math.min(r,li)}px`,i.style.overflowY=r>li?"auto":"hidden"},[e]),n}var Yr="image/png,image/jpeg,image/webp",Kr=5*1024*1024;function Jr({context:e,models:n,selecting:i,selectButtonRef:t,onToggleSelect:r,onClearSelection:o,onAction:s,live:c=!1}){let[p,d]=$(""),[h,x]=$(null),[l,u]=$(null),[g,f]=$(""),b=n?.models.find(L=>L.id===n.defaultModel)?.label,w=n?.models.find(L=>L.id===g),v=!!(e&&p.trim()),_=Xr(p),E=i?"Cancel selection":e?"Select another element":"Select an element",T=()=>{e&&p.trim()&&s({type:"start",prompt:p.trim(),element:e,...g?{model:g}:{},...h?{screenshot:h}:{}})};return a("form",{class:"composer",onSubmit:L=>{L.preventDefault(),T()},children:[a("div",{class:"box",children:[e&&!i&&a(Br,{context:e,onClear:o}),a("div",{class:"line",children:[a("label",{class:"visually-hidden",for:"revyse-prompt",children:"Describe the change"}),a("textarea",{ref:_,id:"revyse-prompt",class:"prompt",rows:1,maxLength:4e3,"data-autofocus":!0,placeholder:e?"What should change about it?":"Select an element, then say what should change",value:p,onInput:L=>d(L.target.value),onKeyDown:L=>{L.key==="Enter"&&!L.shiftKey&&!L.isComposing&&(L.preventDefault(),T())}}),a("button",{ref:t,type:"button",class:"select-toggle tool",title:E,"aria-pressed":i,onClick:r,children:[a(qr,{}),a("span",{class:"tool-label",children:E})]}),c&&a("label",{class:"tool attach",title:h?"Change screenshot":"Attach a screenshot",children:[a("input",{type:"file",class:"visually-hidden",accept:Yr,onChange:L=>{let m=L.target,y=m.files?.[0]??null;if(m.value="",y&&y.size>Kr){u("Screenshots are limited to 5 MB.");return}u(null),x(y)}}),a(Gr,{}),a("span",{class:"tool-label",children:h?"Change screenshot":"Attach a screenshot"})]}),a("span",{class:"toolbar-end",children:[n&&a(K,{children:[a("label",{class:"visually-hidden",for:"revyse-model",children:"Model"}),a("select",{id:"revyse-model",class:"tier",title:w?`${w.description}. About ${w.typicalCredits} credits a change.`:"The organization's default model",value:g,onChange:L=>f(L.target.value),children:[a("option",{value:"",children:["Default",b?` \xB7 ${b}`:""]}),n.models.map(L=>a("option",{value:L.id,disabled:!L.allowed||!L.available,children:$r(L)},L.id))]})]}),a("button",{type:"submit",class:"send","aria-label":"Plan the change",disabled:!v,children:a(Vr,{})})]})]})]}),(h||l)&&a("p",{class:"meta attachment",role:l?"alert":void 0,children:l??a(K,{children:["Screenshot: ",h.name," ",a("button",{type:"button",class:"signout",onClick:()=>x(null),children:"Remove"})]})})]})}function ui({turns:e}){return e.length===0?null:a("ol",{class:"conversation","aria-label":"Conversation",children:e.map((n,i)=>a("li",{"data-role":n.role,children:[a("span",{class:"who",children:n.role==="user"?"You":"Revyse"}),a("span",{class:"said",children:n.text})]},i))})}function Ve({items:e,onAction:n}){let[i,t]=$(!1),[r,o]=$("");return i?a("form",{class:"answer",onSubmit:s=>{s.preventDefault(),r.trim()&&n({type:"revise",text:r.trim()})},children:[a("label",{class:"field-label",for:"revyse-revision",children:"What should be different?"}),a("textarea",{id:"revyse-revision",rows:3,maxLength:2e3,value:r,onInput:s=>o(s.target.value)}),a("div",{class:"actions",children:[a("button",{type:"submit",class:"primary",disabled:!r.trim(),children:"Send revision"}),a("button",{type:"button",class:"secondary",onClick:()=>t(!1),children:"Back"})]})]}):a("div",{class:"actions",children:e.map(s=>a("button",{type:"button",class:s.primary?"primary":"secondary",onClick:()=>s.action==="revise"?t(!0):n(s.action),children:s.label},s.label))})}var pi=e=>e<1e3?"<1 s":`${(e/1e3).toFixed(1)} s`;function ci({items:e}){if(!e||e.length===0)return null;let n=e.slice(-6);return a("ol",{class:"activity","aria-label":"What Revyse is doing","aria-live":"polite",children:[e.length>n.length&&a("li",{class:"meta",children:Oe(e.length-n.length,"earlier step")}),n.map((i,t)=>a("li",{"data-done":i.ms!==void 0,children:[a("span",{children:i.text}),a("span",{class:"took",children:i.ms!==void 0?pi(i.ms):"\u2026"})]},e.length-n.length+t))]})}function Jt({envVars:e,notDone:n,sensitive:i}){return a(K,{children:[i&&i.length>0&&a("p",{class:"note sensitive",children:["Touches sensitive areas: ",i.join(", "),". Review these parts carefully."]}),e&&e.length>0&&a("p",{class:"note",children:["Needs ",e.length===1?"this variable":"these variables"," set where the app runs:"," ",e.map(t=>a("code",{children:t},t))]}),n&&n.length>0&&a("div",{class:"note",children:[a("p",{children:"Not part of this change:"}),a("ul",{children:n.map(t=>a("li",{children:t},t))})]})]})}function Qr({state:e,onAction:n,live:i=!1,models:t}){let r=o=>t?.models.find(s=>s.id===o)?.label??o;return a(B,{kind:"plan",icon:"\u270E",title:"Here's the plan",tone:"info",children:[a(ui,{turns:e.conversation}),a("p",{class:"state-text plan-summary",children:e.plan.summary}),e.plan.steps.length>0&&a("ol",{class:"steps",children:e.plan.steps.map((o,s)=>a("li",{children:[a("span",{children:o.description}),o.files.map(c=>a("code",{children:c},c))]},s))}),a(Jt,{envVars:e.plan.envVars,notDone:e.plan.notDoing,sensitive:e.plan.sensitive}),a("p",{class:"meta",children:["Planned with ",r(e.model),e.cost!==void 0&&` for ${Yt(e.cost)}`,"."," ",e.fellBackFrom&&e.fellBackFrom.length>0?`${e.fellBackFrom.map(r).join(" and ")} wasn't available, so Revyse used ${r(e.model)}. `:null,i?"Applying makes the change on a branch, runs your checks and opens a pull request with a preview. Your site stays as it is.":"Nothing is changed until you apply it."]}),a(Ve,{items:[{label:"Apply the change",action:{type:"approve"},primary:!0},{label:"Revise",action:"revise"},{label:"Cancel",action:{type:"cancel"}}],onAction:n})]})}function Zr({keys:e,artifactUrl:n}){let[i,t]=$([]);return ye(()=>{let r=!0,o=[];return Promise.all(e.map(async s=>{let c=n(s);if(!c)return null;let p=await fetch(c,{mode:"cors"}).catch(()=>null);if(!p?.ok)return null;let d=URL.createObjectURL(await p.blob());return o.push(d),{label:/before\.png$/.test(s)?"Before":"After",src:d}})).then(s=>r&&t(s.filter(c=>c!==null))),()=>{r=!1;for(let s of o)URL.revokeObjectURL(s)}},[e.join("|"),n]),i.length===0?null:a("div",{class:"shots",role:"group","aria-label":"Browser check screenshots",children:i.map(r=>a("figure",{children:[a("img",{src:r.src,alt:`${r.label} the change`}),a("figcaption",{children:r.label})]},r.label))})}function fi({checks:e,artifactUrl:n}){if(e.length===0)return a("p",{class:"meta",children:"No checks are configured for this project, so none ran."});let i=e.find(r=>r.kind==="browser"),t=e.find(r=>r.kind==="browser"&&r.status==="failed");return a(K,{children:[a("ul",{class:"badges","aria-label":"Checks",children:e.map(r=>{let[o,s]=di[r.status],c=r.evidence?.summary??r.reason;return a("li",{class:"badge","data-check":r.status,title:c,children:[a("span",{"aria-hidden":"true",children:o})," ",Kt[r.kind],": ",s]},r.kind)})}),t?.evidence?.summary&&a("pre",{class:"check-output",children:t.evidence.summary}),e.some(r=>r.preExisting)&&a("p",{class:"meta",children:"A check was already failing before this change, with the same errors, so it doesn't count against it."}),n&&i?.evidence?.artifactKeys?.length?a(Zr,{keys:i.evidence.artifactKeys,artifactUrl:n}):null]})}function hi({files:e}){return a("ul",{class:"files changed",children:e.map(n=>a("li",{children:[a("code",{children:n.path})," ",n.kind==="create"&&a("span",{class:"kind",children:"new"}),n.kind==="delete"&&a("span",{class:"kind deleted",children:"deleted"}),a("span",{class:"counts","aria-label":`${Oe(n.additions,"line")} added, ${Oe(n.deletions,"line")} removed`,children:[a("span",{class:"add",children:["+",n.additions]})," ",a("span",{class:"del",children:["\u2212",n.deletions]})]}),n.explanation&&a("span",{class:"explanation",children:n.explanation})]},n.path))})}function eo({since:e}){let[n,i]=$(()=>Date.now());return ye(()=>{let t=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(t)},[]),a(K,{children:[Math.max(0,Math.round((n-e)/1e3))," s"]})}function to({state:e,onAction:n}){let i=e.files&&e.files.length>0;return a(B,{kind:"checking",icon:"\u2026",title:i?"Change made. Checking it\u2026":"Checking the change\u2026",tone:"progress",children:[i&&a("p",{class:"state-text",children:"The change is in your files and on the page. Checks are running."}),a("ul",{class:"checks",children:e.checks.map(t=>{let[r,o]=di[t.status];return a("li",{"data-check":t.status,children:[a("span",{class:"check-icon","aria-hidden":"true",children:r}),a("span",{class:"check-name",children:t.name}),a("span",{class:"check-status",children:[o,t.status==="running"&&e.startedAt!==void 0&&a(K,{children:[" \xB7 ",a(eo,{since:e.startedAt})]}),t.status!=="running"&&t.ms!==void 0&&` \xB7 ${pi(t.ms)}`]})]},t.name)})}),i&&a(hi,{files:e.files}),e.diff&&a(ht,{diff:e.diff}),i&&a(Ve,{items:[{label:"Revert",action:{type:"revert"}}],onAction:n})]})}function no({state:e,onAction:n,artifactUrl:i}){let{result:t}=e,r=t.state==="failed";return a(B,{kind:"result",icon:r?"\u2715":"\u2713",title:r?"Applied, but checks failed":"Ready for review",tone:r?"error":"info",children:[a("p",{class:"state-text",children:r?"The change is in your files, but some checks failed. Revise it or revert it.":"The change is in your files. Check it on the page and in the diff below."}),t.summary&&a("p",{class:"state-text summary",children:t.summary}),a(hi,{files:t.files}),a(Jt,{envVars:t.envVars,notDone:t.notDone,sensitive:t.sensitive}),a(fi,{checks:t.checks,artifactUrl:i}),t.cost!==void 0&&a("p",{class:"meta cost",children:["This change has cost ",Yt(t.cost),"."]}),a(ht,{diff:t.diff}),e.conversation.length>0&&a("details",{class:"history",children:[a("summary",{children:["Conversation (",e.conversation.length,")"]}),a(ui,{turns:e.conversation})]}),a(Ve,{items:[{label:"Keep the change",action:{type:"accept"},primary:!r},{label:"Revise",action:"revise",primary:r},{label:"Revert",action:{type:"revert"}}],onAction:n})]})}function io({state:e,cloud:n,onAction:i}){let{result:t}=e,r=t.state==="failed",o=n?.state==="released";return a(B,{kind:"result",icon:r?"\u2715":"\u2713",title:r?"Checks failed":o?"Merged and released":n?.pullRequestUrl?"Pull request open":"Ready for review",tone:r?"error":"info",children:[a("p",{class:"state-text",children:r?"Some checks failed, so no pull request was opened. Revise the change, or start another.":o?"The pull request was merged, so the change is on its way to your site.":"An approver reviews it on Revyse and it is merged on GitHub; your site changes only then. Open the preview to see it."}),t.summary&&a("p",{class:"state-text summary",children:t.summary}),a("ul",{class:"files changed",children:t.files.map(s=>a("li",{children:[a("code",{children:s.path})," ",s.kind==="create"&&a("span",{class:"kind",children:"new"}),s.kind==="delete"&&a("span",{class:"kind deleted",children:"deleted"}),a("span",{class:"counts","aria-label":`${Oe(s.additions,"line")} added, ${Oe(s.deletions,"line")} removed`,children:[a("span",{class:"add",children:["+",s.additions]})," ",a("span",{class:"del",children:["\u2212",s.deletions]})]})]},s.path))}),a(Jt,{envVars:t.envVars,notDone:t.notDone,sensitive:t.sensitive}),a(fi,{checks:t.checks}),t.cost!==void 0&&a("p",{class:"meta cost",children:["This change has cost ",Yt(t.cost),"."]}),a("details",{class:"history",children:[a("summary",{children:"The diff"}),a(ht,{diff:t.diff})]}),a(Ve,{items:[...o?[]:[{label:"Revise",action:"revise",primary:r}],{label:"Start another change",action:{type:"dismiss"},primary:!r}],onAction:i})]})}var ro={accepted:["\u2713","Change kept",()=>"It's in your working tree. Review and commit it as you normally would."],reverted:["\u21BA","Change reverted",e=>e&&e.length>0?`Restored ${Oe(e.length,"file")} to how ${e.length===1?"it was":"they were"} before Revyse changed ${e.length===1?"it":"them"}.`:"Your files are as they were before this change."],cancelled:["\u2013","Change cancelled",()=>"Revyse stopped working on it."]},oo=new Set(["queued","planning","clarification","plan","applying","checking","result","failed","finished"]);function gi(e){let n=e.live?.cloud;return a(K,{children:[a(so,{...e}),n&&oo.has(e.state.kind)&&a(jr,{cloud:n})]})}function so({state:e,models:n,artifactUrl:i,selecting:t=!1,selectButtonRef:r,onToggleSelect:o=()=>{},onClearSelection:s=()=>{},onAction:c=()=>{},live:p,touch:d=!1}){switch(e.kind){case"connecting":return p?a(B,{kind:"connecting",icon:"\u2026",title:"Connecting to Revyse\u2026",tone:"progress"}):a(B,{kind:"connecting",icon:"\u2026",title:"Connecting to Revyse\u2026",tone:"progress",children:a("p",{class:"state-text",children:"This takes a moment after the dev server starts."})});case"disconnected":return p?e.reason==="not_running"?a(B,{kind:"disconnected",icon:"!",title:"Reconnecting to Revyse\u2026",tone:"error",children:a("p",{class:"state-text",children:"The connection dropped. Revyse keeps trying, and your change carries on in the cloud meanwhile."})}):a(B,{kind:"disconnected",icon:"!",title:"Your live session has ended",tone:"error",children:[a("p",{class:"state-text",children:"Sign in again to keep requesting changes on this site. Changes you already asked for carry on; they are on the Revyse dashboard."}),a(me,{items:[{label:"Sign in again",action:{type:"signin"},primary:!0}],onAction:c})]}):e.reason==="not_running"?a(B,{kind:"disconnected",icon:"!",title:"Not connected",tone:"error",children:a("p",{class:"state-text",children:a(ai,{text:"Revyse runs with your dev server. Start it again (`npm run dev`) and this page reconnects on its own."})})}):a(B,{kind:"disconnected",icon:"!",title:"This page isn't connected",tone:"error",children:[a("p",{class:"state-text",children:"Revyse didn't accept this page's address. Open your app at an address listed under appOrigins in revyse.config.json."}),a(me,{items:[{label:"Reload page",action:{type:"reload"}}],onAction:c})]});case"unsupported":return a(B,{kind:"unsupported",icon:"\u2298",title:"Revyse can't run here",tone:"info",children:a("p",{class:"state-text",children:e.reason})});case"ready":case"selected":{let h=e.kind==="selected"?e.context:null;return a("div",{class:"state","data-state":e.kind,children:[p?a(Hr,{live:p,onAction:c}):a(Ir,{status:"connected"}),a(Jr,{live:!!p,context:h,models:n,selecting:t,selectButtonRef:r,onToggleSelect:o,onClearSelection:s,onAction:c}),a("p",{class:"hint","aria-live":"polite",children:t?d?"Tap the element you want to change.":"Click an element, or use the arrow keys to move and Enter to choose. Esc cancels.":h?p?"Revyse plans the change first. Your site changes only when its pull request is merged.":"Revyse plans the change first; nothing is written until you apply it.":"Select the element you want to change, then send your request."})]})}case"queued":return a(B,{kind:"queued",icon:"\u2026",title:"Waiting for a cloud workspace\u2026",tone:"progress",children:[a("p",{class:"state-text",children:"Revyse picks the change up in a moment, then plans it from your repository."}),a(me,{items:[{label:"Cancel",action:{type:"cancel"}}],onAction:c})]});case"planning":return a(B,{kind:"planning",icon:"\u2026",title:"Planning the change\u2026",tone:"progress",children:[a("blockquote",{class:"quote",children:e.prompt}),a(ci,{items:e.activity}),a(me,{items:[{label:"Cancel",action:{type:"cancel"}}],onAction:c})]});case"clarification":{let h=e.integration;if(h){let x=h.providers[0]??"a provider";return a(B,{kind:"clarification",icon:"\u2699",title:`This needs ${h.capability==="email"?"an email":"a"} service`,tone:"info",children:[a("p",{class:"state-text question",children:h.reason}),a("p",{class:"note",children:["Connect ",h.providers.join(" or ")," on the Revyse dashboard. Keys are entered there, never here."]}),h.connectUrl&&a("p",{children:a("a",{href:h.connectUrl,target:"_blank",rel:"noopener noreferrer",class:"link",children:["Connect ",x," on the dashboard"]})}),a(me,{items:[{label:"I've connected it: plan again",action:{type:"answer",text:`I connected ${x} in Revyse. Plan the change again with it.`},primary:!0},{label:"Cancel",action:{type:"cancel"}}],onAction:c})]})}return a(B,{kind:"clarification",icon:"?",title:"Revyse has a question",tone:"info",children:[a("p",{class:"state-text question",children:e.question}),a(zr,{onAction:c})]})}case"applying":return a(B,{kind:"applying",icon:"\u2026",title:"Applying the change\u2026",tone:"progress",children:e.activity&&e.activity.length>0?a(ci,{items:e.activity}):a("p",{class:"state-text",children:p?"Writing the change on a branch of your repository, in a cloud workspace.":e.files?`Writing ${e.files} ${e.files===1?"file":"files"} in your project.`:"Writing the change to your project."})});case"checking":return a(to,{state:e,onAction:c});case"conflict":{let h=e.reason==="changed_since_apply";return a(B,{kind:"conflict",icon:"\u26A0",title:h?"Files changed after Revyse's edit":"Files changed while Revyse was working",tone:"error",children:[a("p",{class:"state-text",children:e.message??"Nothing was written. These files changed after Revyse read them:"}),a("ul",{class:"files",children:e.files.map(x=>a("li",{children:a("code",{children:x})},x))}),a(me,{items:h?[{label:"Dismiss",action:{type:"dismiss"},primary:!0}]:[{label:"Re-plan with the latest files",action:{type:"refresh"},primary:!0},{label:"Cancel",action:{type:"cancel"}}],onAction:c})]})}case"failed":{let[h,x]=e.stage?Mr[e.stage]:["The change didn't go through",void 0],l=e.next,u=[];return l?(l.includes("replan")&&u.push({label:"Try again",action:{type:"refresh"},primary:!0}),l.includes("revise")&&u.push({label:"Revise",action:"revise",primary:u.length===0}),l.includes("revert")&&u.push({label:"Revert Revyse's edits",action:{type:"revert"}}),l.includes("reload")&&u.push({label:"Reload page",action:{type:"reload"},primary:!0})):e.retryable&&u.push({label:"Try again",action:{type:"retry"},primary:!0}),u.push({label:"Dismiss",action:{type:"dismiss"}}),a(B,{kind:"failed",icon:"\u2715",title:h,tone:"error",children:[x&&a("p",{class:"meta",children:["While ",x,"."," ",e.filesChanged?"Revyse's edits are in your files.":"Your files weren't changed."]}),a("p",{class:"state-text",children:a(ai,{text:e.message})}),a(Ve,{items:u,onAction:c})]})}case"plan":return a(Qr,{state:e,onAction:c,live:!!p,models:n});case"result":return p?a(io,{state:e,cloud:p.cloud,onAction:c}):a(no,{state:e,onAction:c,artifactUrl:i});case"reverting":return a(B,{kind:"reverting",icon:"\u2026",title:"Reverting the change\u2026",tone:"progress",children:a("p",{class:"state-text",children:"Restoring your files to how they were before Revyse changed them."})});case"finished":{let[h,x,l]=ro[e.outcome];return a(B,{kind:"finished",icon:h,title:x,tone:"info",children:[a("p",{class:"state-text",children:l(e.files)}),e.files&&e.files.length>0&&a("ul",{class:"files",children:e.files.map(u=>a("li",{children:a("code",{children:u})},u))}),a(me,{items:[{label:"Start another change",action:{type:"dismiss"},primary:!0}],onAction:c})]})}case"permission_denied":return a(B,{kind:"permission_denied",icon:"\u2298",title:"You don't have permission",tone:"error",children:[a("p",{class:"state-text",children:[e.message??"Your role in this project can't request changes."," Ask a project owner to give you the editor role."]}),a(me,{items:[{label:"Dismiss",action:{type:"dismiss"}}],onAction:c})]});default:return e}}function mi(e){return e.unsupported?{kind:"unsupported",reason:e.unsupported}:e.status==="connecting"?{kind:"connecting"}:e.status==="disconnected"?{kind:"disconnected",reason:"not_running"}:e.status==="rejected"?{kind:"disconnected",reason:"rejected"}:e.flow?e.flow:e.selected?{kind:"selected",context:e.selected}:{kind:"ready"}}function bi(e){return["localhost","127.0.0.1","[::1]","::1"].includes(e.hostname)||e.hostname.endsWith(".localhost")?null:"Revyse local mode only works on your own machine (localhost). Open the app from the address your dev server printed."}var ao={"change.start":e=>({kind:"planning",prompt:e}),"change.answer":e=>({kind:"planning",prompt:e}),"change.revise":e=>({kind:"planning",prompt:e}),"change.refresh":e=>({kind:"planning",prompt:e}),"change.approve":()=>({kind:"applying"}),"change.revert":()=>({kind:"reverting"})};function vi(e){let n=e.now??(()=>Date.now()),i=[],t,r=0,o,s=null,c=!1,p=[],d=null,h="",x=null,l=()=>[...p];function u(w){d&&p.push(d),d=null,p.push({role:"user",text:w}),h=w}function g(){s=null,c=!1,p=[],d=null,x=null,e.setCloud?.(null)}function f(w){x=w;let v=ao[w.type];v&&e.setFlow(v(h)),w.type==="change.start"&&(c=!0),e.connection.request(w.type,w.payload).then(_=>{w.type!=="change.start"||!c||(c=!1,s=_?.changeId??s)},_=>{w.type==="change.start"&&(c=!1),e.setFlow({kind:"failed",message:_.message,retryable:!0})})}let b=e.connection.onEvent((w,v)=>{if(w==="cloud"){let E=mn(v);if(!E||(!s&&c&&(s=E.changeId),E.changeId!==s))return;e.setCloud?.(E),E.state==="draft"&&e.setFlow({kind:"queued"});return}if(w!=="change")return;let _=hn(v);if(_){if(_.changeId){if(!s&&c&&(s=_.changeId),_.changeId!==s)return}else if(!c)return;switch(_.type){case"planning":return i=[],e.setFlow({kind:"planning",prompt:h});case"plan":return d={role:"revyse",text:_.plan.summary},e.setFlow({kind:"plan",plan:_.plan,model:_.model,..._.fellBackFrom?.length?{fellBackFrom:_.fellBackFrom}:{},cost:_.cost,conversation:l()});case"clarification":return d={role:"revyse",text:_.question},e.setFlow({kind:"clarification",question:_.question,..._.integration?{integration:_.integration}:{}});case"applying":return i=[],t=void 0,o=_.files,e.setFlow({kind:"applying",files:_.files});case"activity":{let E=n(),T=i.at(-1);return T&&T.ms===void 0&&(i=[...i.slice(0,-1),{...T,ms:E-r}]),i=[...i,{text:_.text}],r=E,e.setFlow(_.phase==="plan"?{kind:"planning",prompt:h,activity:i}:{kind:"applying",files:o,activity:i})}case"checking":return t??=n(),e.setFlow({kind:"checking",checks:_.checks.map(E=>({name:Kt[E.kind],status:E.status,...E.durationMs!==void 0?{ms:E.durationMs}:{}})),startedAt:t,..._.files?{files:_.files}:{},..._.diff!==void 0?{diff:_.diff}:{}});case"result":{let{state:E,files:T,diff:L,checks:m,cost:y,summary:k,envVars:A,notDone:R,sensitive:z}=_;return e.setFlow({kind:"result",result:{state:E,files:T,diff:L,checks:m,cost:y,summary:k,envVars:A,notDone:R,sensitive:z},conversation:l()})}case"conflict":return e.setFlow({kind:"conflict",files:_.files,reason:_.reason,message:_.message});case"reverted":return e.setFlow({kind:"finished",outcome:"reverted",files:_.files});case"accepted":return e.setFlow({kind:"finished",outcome:"accepted"});case"cancelled":return e.setFlow({kind:"finished",outcome:"cancelled"});case"failed":return e.setFlow({kind:"failed",message:_.message,retryable:_.retryable,stage:_.stage,filesChanged:_.filesChanged,next:_.next});case"permission_denied":return e.setFlow({kind:"permission_denied",message:_.message})}}});return{handle(w){let v=s;switch(w.type){case"start":return g(),u(w.prompt),f({type:"change.start",payload:{prompt:w.prompt,element:w.element,...w.model?{model:w.model}:{},origin:globalThis.location?.origin,...w.screenshot?{screenshot:w.screenshot}:{}}});case"answer":case"revise":return v?(u(w.text),f({type:`change.${w.type}`,payload:{changeId:v,text:w.text}})):void 0;case"approve":case"revert":case"accept":case"refresh":return v?f({type:`change.${w.type}`,payload:{changeId:v}}):void 0;case"cancel":return v?f({type:"change.cancel",payload:{changeId:v}}):(g(),e.setFlow(null));case"retry":x&&f(x);return;case"dismiss":return g(),e.setFlow(null);case"reload":return}},dispose(){b()}}}function yi(e,n=6){let i=[],t=e;for(;t&&t.nodeType===1&&i.length<n;){let r=t.getAttribute("data-testid");if(r){i.unshift(`[data-testid="${CSS.escape(r)}"]`);break}if(t.id){i.unshift(`#${CSS.escape(t.id)}`);break}let o=t.tagName.toLowerCase(),s=t.parentElement;if(s){let c=Array.from(s.children).filter(p=>p.tagName===t.tagName);c.length>1&&(o+=`:nth-of-type(${c.indexOf(t)+1})`)}i.unshift(o),t=s}return i.join(" > ")}var xi=500;function ki(e){return e.closest("[data-revyse-ignore]")?!0:e instanceof HTMLInputElement?["password","hidden"].includes(e.type)||/cc-|card|cvc|cvv/i.test(e.autocomplete):!1}var lo="input, textarea, select, option, optgroup, datalist, [contenteditable]:not([contenteditable=false])",Qt=e=>e.matches(lo)||!!e.closest("[contenteditable]:not([contenteditable=false])");function Ci(e){let n="",i=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:t=>{if(t.nodeType===Node.TEXT_NODE)return NodeFilter.FILTER_ACCEPT;let r=t;return r.matches("script, style, template, noscript, [data-revyse-ignore]")||Qt(r)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});for(let t=i.nextNode();t&&n.length<=xi*2;t=i.nextNode())n+=` ${t.nodeValue??""}`;return n.replace(/\s+/g," ").trim().slice(0,xi)}var _i=["header","nav","main","footer","aside","section","article","form","dialog",...["banner","navigation","main","contentinfo","complementary","region","dialog"].map(e=>`[role=${e}]`)].join(", ");function co(e){let n=[],i=e.ownerDocument;for(let t=e.parentElement;t&&n.length<6&&!(t===i.body||t===i.documentElement);t=t.parentElement)n.push({tagName:t.tagName.toLowerCase(),...t.id?{id:t.id.slice(0,256)}:{},classList:Array.from(t.classList).slice(0,20)});return n}function uo(e){let n=[];for(let i=e.parentElement?.closest(_i)??null;i&&n.length<4;i=i.parentElement?.closest(_i)??null){let t=i.querySelector("h1, h2, h3, h4, h5, h6"),r=i.getAttribute("aria-label")??(t&&!ki(t)?Ci(t):void 0),o=i.getAttribute("role");n.push({tagName:i.tagName.toLowerCase(),...o?{role:o}:{},...r?{label:r.slice(0,120)}:{}})}return n}function Si(e,n=location.pathname){let i=e.getBoundingClientRect(),t=ki(e)||Qt(e)?void 0:Ci(e)||void 0;return{route:n,selector:yi(e),tagName:e.tagName.toLowerCase(),text:t,role:e.getAttribute("role")??void 0,ariaLabel:Qt(e)?void 0:e.getAttribute("aria-label")??void 0,classList:Array.from(e.classList).slice(0,100),boundingBox:{x:i.x,y:i.y,width:i.width,height:i.height},ancestors:co(e),landmarks:uo(e),...e.ownerDocument.defaultView?{viewport:{width:e.ownerDocument.defaultView.innerWidth,height:e.ownerDocument.defaultView.innerHeight}}:{},...wi(e)?{rv:wi(e)}:{},source:Zt(e)}}function wi(e){let n=e.closest("[data-rv]")?.getAttribute("data-rv");return n&&/^[0-9a-f]{12}$/.test(n)?n:void 0}function Zt(e){let i=e.closest("[data-revyse-loc]")?.getAttribute("data-revyse-loc")?.match(/^(.+):(\d+):(\d+)$/);if(i)return{file:i[1],line:Number(i[2]),column:Number(i[3])}}var po="[data-revyse-ignore], script, style, template, noscript, head, meta, link, title";function be(e){return!e||e.nodeType!==Node.ELEMENT_NODE||e.closest(po)||e===e.ownerDocument.documentElement?!1:e.checkVisibility?.()??!0}var en=e=>Array.from(e.children).filter(be);function fo(e,n){if(n==="ArrowUp"){let r=e.parentElement;return r&&r!==e.ownerDocument.documentElement&&be(r)?r:null}if(n==="ArrowDown")return en(e)[0]??null;let i=e.parentElement?en(e.parentElement):[],t=i.indexOf(e);return i[n==="ArrowLeft"?t-1:t+1]??null}function Ei(e){let n=e.activeElement;if(be(n)&&n!==e.body)return n;let i=e.querySelector("main, [role=main]");return be(i)?i:en(e.body)[0]??null}var Ai=["pointerdown","mousedown","pointerup","mouseup","click","dblclick","auxclick"];function Ti(e,n,i){let t=e.defaultView,r=null,o=f=>f.composedPath().includes(n),s=f=>{f!==r&&(r=f,i.onCandidate(f))},c=f=>{if(o(f))return;let b=f.composedPath()[0];b instanceof Element&&be(b)&&s(b)},p=f=>{if(o(f)||(f.preventDefault(),f.stopImmediatePropagation(),f.type!=="click"))return;let b=f.composedPath()[0];b instanceof Element&&be(b)&&i.onSelect(b)},d=null,h=10,x=f=>{if(o(f))return;f.stopImmediatePropagation();let b=f.touches[0];d=b?{x:b.clientX,y:b.clientY}:null;let w=f.composedPath()[0];w instanceof Element&&be(w)&&s(w)},l=f=>{if(o(f))return;f.stopImmediatePropagation();let b=f.changedTouches[0],w=d;if(d=null,!w||!b||Math.hypot(b.clientX-w.x,b.clientY-w.y)>h)return;f.preventDefault();let v=f.composedPath()[0];v instanceof Element&&be(v)&&i.onSelect(v)},u=f=>{if(!f.isComposing){if(f.key==="Escape"){f.preventDefault(),f.stopImmediatePropagation(),i.onExit();return}if(f.key==="Enter"&&r){f.preventDefault(),f.stopImmediatePropagation(),i.onSelect(r);return}if(f.key==="ArrowUp"||f.key==="ArrowDown"||f.key==="ArrowLeft"||f.key==="ArrowRight"){f.preventDefault(),f.stopImmediatePropagation();let b=r?fo(r,f.key):Ei(e);b&&(s(b),b.scrollIntoView?.({block:"nearest",inline:"nearest"}))}}};t.addEventListener("pointermove",c,!0);for(let f of Ai)t.addEventListener(f,p,!0);t.addEventListener("touchstart",x,{capture:!0,passive:!0}),t.addEventListener("touchend",l,{capture:!0,passive:!1}),t.addEventListener("keydown",u,!0),s(Ei(e));let g=!1;return{get candidate(){return r},stop(){if(!g){g=!0,t.removeEventListener("pointermove",c,!0);for(let f of Ai)t.removeEventListener(f,p,!0);t.removeEventListener("touchstart",x,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("keydown",u,!0),s(null)}}}}var Fi=`
|
|
112
112
|
:host {
|
|
113
113
|
all: initial !important;
|
|
114
114
|
display: block !important;
|
|
@@ -174,29 +174,62 @@ button:focus-visible { outline: 2px solid #0A0A0A; outline-offset: 2px; }
|
|
|
174
174
|
.launcher:hover, .launcher[aria-expanded="true"] { background: #333333; }
|
|
175
175
|
.mark { display: block; flex: none; }
|
|
176
176
|
|
|
177
|
-
/*
|
|
178
|
-
transform or filter, so it is placed against the viewport. No backdrop: the
|
|
179
|
-
usable around it. */
|
|
177
|
+
/* A chat at the bottom centre (O8, ADR 0041), growing upwards. Fixed inside the fixed host,
|
|
178
|
+
which has no transform or filter, so it is placed against the viewport. No backdrop: the
|
|
179
|
+
page stays usable around it, and the launcher steps aside while it is open. */
|
|
180
180
|
.panel {
|
|
181
181
|
position: fixed;
|
|
182
182
|
left: 50%;
|
|
183
|
-
|
|
184
|
-
transform:
|
|
183
|
+
bottom: 16px;
|
|
184
|
+
transform: translateX(-50%);
|
|
185
185
|
width: min(680px, calc(100vw - 32px));
|
|
186
186
|
max-height: min(640px, calc(100vh - 32px));
|
|
187
187
|
display: flex;
|
|
188
188
|
flex-direction: column;
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
/* Glass like iOS's (O9): almost clear, the page behind softened by a light blur with its
|
|
190
|
+
colour lifted, a sheen across the surface, a rim of light along the edge, and a hairline
|
|
191
|
+
outside it so it still reads on a white page. Nothing inside the panel is fixed-position,
|
|
192
|
+
so the backdrop filter can't trap anything. */
|
|
193
|
+
background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.16) 100%);
|
|
194
|
+
-webkit-backdrop-filter: blur(14px) saturate(180%) brightness(1.06);
|
|
195
|
+
backdrop-filter: blur(14px) saturate(180%) brightness(1.06);
|
|
196
|
+
border: 1px solid rgba(255, 255, 255, 0.55);
|
|
191
197
|
border-radius: 20px;
|
|
192
|
-
box-shadow: 0
|
|
198
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(255, 255, 255, 0.3), inset 0 0 24px rgba(255, 255, 255, 0.14), 0 0 0 0.5px rgba(10, 10, 10, 0.12), 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05);
|
|
193
199
|
overflow: hidden;
|
|
194
200
|
pointer-events: auto;
|
|
195
201
|
}
|
|
202
|
+
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
203
|
+
.panel { background: #FFFFFF; border-color: #EAEAEA; }
|
|
204
|
+
.panel .chip { background: #F2F2F2; }
|
|
205
|
+
}
|
|
196
206
|
.panel[hidden] { display: none; }
|
|
197
207
|
/* While picking an element the panel steps aside; it keeps its state. */
|
|
198
208
|
.panel[data-picking] { visibility: hidden; }
|
|
199
209
|
.panel:focus { outline: none; }
|
|
210
|
+
.panel:not([hidden]):not([data-picking]):not([data-compact]) ~ .launcher { display: none; }
|
|
211
|
+
/* The compact bar (O10): until a change starts, one glass line like a chat's input. The
|
|
212
|
+
launcher stays beside it to close it, so on narrow screens it leaves the launcher room. The
|
|
213
|
+
status and hint stay for screen readers. */
|
|
214
|
+
.panel[data-compact] { width: min(680px, calc(100vw - 144px)); border-radius: 28px; }
|
|
215
|
+
.panel[data-compact] .header { display: none; }
|
|
216
|
+
.panel[data-compact] .body { padding: 6px; gap: 6px; }
|
|
217
|
+
.panel[data-compact] .state { gap: 6px; }
|
|
218
|
+
.panel[data-compact] .status,
|
|
219
|
+
.panel[data-compact] .hint {
|
|
220
|
+
position: absolute;
|
|
221
|
+
width: 1px;
|
|
222
|
+
height: 1px;
|
|
223
|
+
margin: -1px;
|
|
224
|
+
padding: 0;
|
|
225
|
+
overflow: hidden;
|
|
226
|
+
clip: rect(0 0 0 0);
|
|
227
|
+
white-space: nowrap;
|
|
228
|
+
border: 0;
|
|
229
|
+
}
|
|
230
|
+
.panel[data-compact]:focus-within {
|
|
231
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -1px 0 rgba(255, 255, 255, 0.3), inset 0 0 24px rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(10, 10, 10, 0.24), 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.05);
|
|
232
|
+
}
|
|
200
233
|
|
|
201
234
|
.header {
|
|
202
235
|
display: flex;
|
|
@@ -276,9 +309,10 @@ code {
|
|
|
276
309
|
grid-template-columns: 1fr auto;
|
|
277
310
|
gap: 2px 8px;
|
|
278
311
|
padding: 8px 8px 8px 12px;
|
|
279
|
-
border: 1px solid
|
|
280
|
-
|
|
281
|
-
|
|
312
|
+
border: 1px solid rgba(255, 255, 255, 0.6);
|
|
313
|
+
/* A lighter pane on the glass (O9). */
|
|
314
|
+
background: rgba(255, 255, 255, 0.45);
|
|
315
|
+
border-radius: 12px;
|
|
282
316
|
}
|
|
283
317
|
.chip-main { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
|
|
284
318
|
.chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333333; }
|
|
@@ -510,34 +544,52 @@ select:focus-visible { outline: 2px solid #0A0A0A; outline-offset: 1px; }
|
|
|
510
544
|
border: 0;
|
|
511
545
|
}
|
|
512
546
|
|
|
513
|
-
/* The request box (O7):
|
|
547
|
+
/* The request box (O7, O10): one line that grows with its text. The text is first for the
|
|
548
|
+
keyboard; the select-element and screenshot buttons show on its left, the model and send on
|
|
549
|
+
its right, and the selected element as a chip above it. */
|
|
514
550
|
.composer { display: flex; flex-direction: column; gap: 0; }
|
|
515
|
-
.box {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
551
|
+
.box { display: flex; flex-direction: column; gap: 6px; }
|
|
552
|
+
.box .chip { margin: 0 2px; }
|
|
553
|
+
.line { display: flex; align-items: flex-end; gap: 4px; }
|
|
554
|
+
.line .select-toggle, .line .attach { order: -1; }
|
|
555
|
+
.line .tool {
|
|
556
|
+
flex: none;
|
|
557
|
+
width: 40px;
|
|
558
|
+
height: 40px;
|
|
559
|
+
padding: 0;
|
|
560
|
+
justify-content: center;
|
|
561
|
+
border-color: transparent;
|
|
562
|
+
background: transparent;
|
|
524
563
|
}
|
|
525
|
-
.
|
|
526
|
-
.
|
|
527
|
-
|
|
564
|
+
.line .tool:hover { background: rgba(10, 10, 10, 0.06); }
|
|
565
|
+
.line .tool[aria-pressed="true"] { background: #0A0A0A; border-color: #0A0A0A; color: #FFFFFF; }
|
|
566
|
+
.tool-label {
|
|
567
|
+
position: absolute;
|
|
568
|
+
width: 1px;
|
|
569
|
+
height: 1px;
|
|
570
|
+
margin: -1px;
|
|
571
|
+
padding: 0;
|
|
572
|
+
overflow: hidden;
|
|
573
|
+
clip: rect(0 0 0 0);
|
|
574
|
+
white-space: nowrap;
|
|
528
575
|
border: 0;
|
|
529
|
-
|
|
530
|
-
|
|
576
|
+
}
|
|
577
|
+
textarea.prompt {
|
|
578
|
+
flex: 1;
|
|
579
|
+
min-width: 0;
|
|
580
|
+
min-height: 40px;
|
|
531
581
|
max-height: 200px;
|
|
582
|
+
border: 0;
|
|
583
|
+
padding: 9px 4px;
|
|
532
584
|
resize: none;
|
|
585
|
+
overflow-y: hidden;
|
|
533
586
|
font-size: 15px;
|
|
534
587
|
line-height: 22px;
|
|
535
588
|
background: transparent;
|
|
536
589
|
}
|
|
537
590
|
textarea.prompt:focus-visible { outline: none; }
|
|
538
591
|
textarea.prompt::placeholder { color: #737373; }
|
|
539
|
-
.toolbar { display: flex; align-items: center;
|
|
540
|
-
.toolbar-end { display: flex; align-items: center; gap: 8px; }
|
|
592
|
+
.toolbar-end { flex: none; display: flex; align-items: center; gap: 4px; height: 40px; }
|
|
541
593
|
.tool {
|
|
542
594
|
display: inline-flex;
|
|
543
595
|
align-items: center;
|
|
@@ -559,6 +611,8 @@ textarea.prompt::placeholder { color: #737373; }
|
|
|
559
611
|
.tool[aria-pressed="true"] { background: #0A0A0A; border-color: #0A0A0A; color: #FFFFFF; }
|
|
560
612
|
select.tier {
|
|
561
613
|
width: auto;
|
|
614
|
+
max-width: 200px;
|
|
615
|
+
text-overflow: ellipsis;
|
|
562
616
|
border: 0;
|
|
563
617
|
border-radius: 9999px;
|
|
564
618
|
padding: 5px 8px;
|
|
@@ -569,10 +623,11 @@ select.tier {
|
|
|
569
623
|
}
|
|
570
624
|
select.tier:hover { background: #F2F2F2; }
|
|
571
625
|
.send {
|
|
572
|
-
width:
|
|
573
|
-
height:
|
|
626
|
+
width: 36px;
|
|
627
|
+
height: 36px;
|
|
628
|
+
margin-right: 2px;
|
|
574
629
|
border: 0;
|
|
575
|
-
border-radius:
|
|
630
|
+
border-radius: 18px;
|
|
576
631
|
padding: 0;
|
|
577
632
|
display: flex;
|
|
578
633
|
align-items: center;
|
|
@@ -648,13 +703,12 @@ select.tier:hover { background: #F2F2F2; }
|
|
|
648
703
|
.cloud .meta { margin: 0; }
|
|
649
704
|
.cloud .checks .link { margin-left: auto; }
|
|
650
705
|
|
|
651
|
-
/* Phones (W6): a bottom sheet across the full width, above the browser's own bars
|
|
652
|
-
|
|
706
|
+
/* Phones (W6): a bottom sheet across the full width, above the browser's own bars; the
|
|
707
|
+
sheet's \xD7 closes it. */
|
|
653
708
|
@media (max-width: 640px) {
|
|
654
709
|
.panel {
|
|
655
710
|
left: 0;
|
|
656
711
|
right: 0;
|
|
657
|
-
top: auto;
|
|
658
712
|
bottom: 0;
|
|
659
713
|
transform: none;
|
|
660
714
|
width: 100%;
|
|
@@ -663,14 +717,29 @@ select.tier:hover { background: #F2F2F2; }
|
|
|
663
717
|
border-radius: 20px 20px 0 0;
|
|
664
718
|
padding-bottom: env(safe-area-inset-bottom, 0px);
|
|
665
719
|
}
|
|
666
|
-
.panel:not([hidden]):not([data-picking]) ~ .launcher { display: none; }
|
|
667
720
|
.close { width: 40px; height: 40px; }
|
|
668
721
|
.picking { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
|
|
722
|
+
/* The compact bar sits beside the launcher, which closes it. */
|
|
723
|
+
.panel[data-compact] {
|
|
724
|
+
left: 12px;
|
|
725
|
+
right: 64px;
|
|
726
|
+
bottom: calc(12px + env(safe-area-inset-bottom, 0px));
|
|
727
|
+
width: auto;
|
|
728
|
+
border-width: 1px;
|
|
729
|
+
border-radius: 28px;
|
|
730
|
+
padding-bottom: 0;
|
|
731
|
+
}
|
|
669
732
|
}
|
|
670
733
|
|
|
671
734
|
@media (prefers-reduced-motion: no-preference) {
|
|
672
735
|
.launcher, .send, .tool { transition: background-color 120ms ease; }
|
|
736
|
+
/* O10: the bar widens into the panel and the request box grows, rather than jumping. */
|
|
737
|
+
.panel {
|
|
738
|
+
transition: width 260ms cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
|
|
739
|
+
left 260ms cubic-bezier(0.2, 0.8, 0.2, 1), right 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
740
|
+
}
|
|
741
|
+
textarea.prompt { transition: height 160ms cubic-bezier(0.2, 0.8, 0.2, 1); }
|
|
673
742
|
.spinner { animation: revyse-spin 800ms linear infinite; }
|
|
674
743
|
@keyframes revyse-spin { to { transform: rotate(360deg); } }
|
|
675
744
|
}
|
|
676
|
-
`;var
|
|
745
|
+
`;var ho="revyse-overlay",Li="revyse:panel-open";function Ni({size:e}){return a("svg",{class:"mark",viewBox:"0 0 64 64",width:e,height:e,"aria-hidden":"true",children:[a("path",{d:"M12 53V32.5A21.5 21.5 0 0 1 33.5 11V24A8.5 8.5 0 0 0 25 32.5V53Z",fill:"currentColor"}),a("circle",{cx:"44.5",cy:"17.5",r:"7.5",fill:"currentColor"})]})}var Pi={get:()=>{try{return sessionStorage.getItem(Li)==="1"}catch{return!1}},set:e=>{try{sessionStorage.setItem(Li,e?"1":"0")}catch{}}};function go(e){let n=Zt(e);return{tag:e.tagName.toLowerCase(),where:n?`${n.file}${n.line?`:${n.line}`:""}`:void 0}}function mo({el:e}){let[n,i]=$(()=>e.getBoundingClientRect());ue(()=>i(e.getBoundingClientRect()),[e]),ye(()=>{let s=0,c=()=>{i(e.getBoundingClientRect()),s=requestAnimationFrame(c)};return s=requestAnimationFrame(c),()=>cancelAnimationFrame(s)},[e]);let{tag:t,where:r}=go(e),o=n.top>28;return a("div",{class:"highlight","aria-hidden":"true",children:[a("div",{class:"outline",style:{left:n.left,top:n.top,width:n.width,height:n.height}}),a("div",{class:"label",style:{left:Math.max(n.left,0),top:o?n.top-26:n.bottom+4},children:[t,r&&a("span",{class:"where",children:[" \xB7 ",r]})]})]})}function Mi(e){let n=new URL(e);return n.protocol=n.protocol==="wss:"?"https:":"http:",i=>{let t=i.match(/^\.revyse\/changes\/([0-9a-f-]{36})\/(before|after)\.png$/);return t?new URL(`/artifacts/${t[1]}/${t[2]}.png`,n).toString():void 0}}function bo(){return Oi()}function Oi(){let e=null,n=new Set;return{get:()=>e,set(i){e=i;for(let t of n)t(i)},subscribe(i){return n.add(i),()=>{n.delete(i)}}}}function Ri(e){let[n,i]=$(e?.get()??null);return ue(()=>{if(e)return i(e.get()),e.subscribe(i)},[e]),n}var vo=e=>{try{return!!e?.matchMedia?.("(pointer: coarse)").matches}catch{return!1}},Di="cubic-bezier(0.2, 0.8, 0.2, 1)";function yo(e,n){let i=Z(0),t=Z(null),r=Z(!1);ue(()=>{let o=e.current,s=o?.ownerDocument.defaultView;if(!o||!s||typeof s.ResizeObserver>"u")return;let c=new s.ResizeObserver(()=>{i.current=o.offsetHeight});return c.observe(o),()=>c.disconnect()},[e]),ue(()=>{let o=e.current,s=n&&!r.current;r.current=n;let c=o?.ownerDocument.defaultView;if(!o||!n||!o.animate||c?.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;if(s){o.animate([{opacity:0,translate:"0 8px"},{opacity:1,translate:"0 0"}],{duration:200,easing:Di});return}let p=i.current;t.current?.playState==="running"&&(p=o.offsetHeight,t.current.cancel());let d=o.offsetHeight;p&&d&&Math.abs(p-d)>1&&(t.current=o.animate([{height:`${p}px`},{height:`${d}px`}],{duration:260,easing:Di}))})}function xo({connection:e,host:n,onSelect:i,flow:t,onAction:r,artifactUrl:o,mode:s="local",live:c,cloud:p}){let[d,h]=$(Pi.get),[x,l]=$(e?.status??"disconnected"),[u,g]=$(!1),[f,b]=$(null),[w,v]=$(null),_=Z(null),E=Z(null),T=Z(null),L=Z(null),m=Z(!1),y=Z(d),k=Z(i);k.current=i;let A=Ri(t),R=Ri(p),z=n.ownerDocument,[re]=$(()=>vo(z.defaultView)),P=s==="local"&&z.defaultView?bi(z.defaultView.location):null;ye(()=>{if(!e)return;l(e.status);let S=e.onStatus(l);return()=>{S()}},[e]);let[te,ae]=$(null);ye(()=>{if(!e||x!=="connected")return;let S=!0;return e.request("models.list").then(N=>{S&&ae(gn(N))},()=>S&&ae(null)),()=>{S=!1}},[e,x]),ue(()=>{Pi.set(d),d&&!y.current&&(E.current?.querySelector("[data-autofocus]")??E.current)?.focus(),!d&&y.current&&_.current?.focus(),y.current=d},[d]),ue(()=>{if(!u)return;let S=n.ownerDocument,N=()=>{L.current?.stop(),g(!1)};return L.current=Ti(S,n,{onCandidate:b,onSelect:C=>{let le={element:C,context:Si(C)};v(le),k.current?.(le),m.current=!0,N()},onExit:N}),()=>{L.current?.stop(),L.current=null,b(null);let C=E.current?.querySelector("[data-autofocus]");E.current&&!E.current.hidden&&(m.current&&C?C:T.current)?.focus(),m.current=!1}},[u,n]);let J=S=>{S.key==="Escape"&&d&&!u&&(S.stopPropagation(),h(!1))},O=()=>{v(null),k.current?.(null),T.current?.focus()},ne=mi({status:x,selected:w?.context??null,flow:A,unsupported:P}),I=ne.kind==="ready"||ne.kind==="selected";return yo(E,d),a("div",{class:"root",onKeyDown:J,children:[u&&f&&a(mo,{el:f}),u&&a("div",{class:"picking",role:"status",children:[a("span",{children:re?"Tap an element to change it.":"Click an element to change it. Arrow keys move, Enter chooses."}),a("button",{type:"button",class:"picking-cancel",onClick:()=>g(!1),children:"Cancel"})]}),a("div",{ref:E,id:"revyse-panel",class:"panel",role:"dialog","aria-label":"Revyse",tabIndex:-1,hidden:!d,"data-picking":u?"":void 0,"data-compact":I?"":void 0,children:[a("div",{class:"header",children:[a("h2",{class:"title",children:[a(Ni,{size:16}),"Revyse"]}),a("button",{type:"button",class:"close","aria-label":"Close Revyse",onClick:()=>{g(!1),h(!1)},children:"\xD7"})]}),a("div",{class:"body",children:a(gi,{state:ne,models:te,artifactUrl:o,live:c?{email:c.email,project:c.project,cloud:R}:void 0,touch:re,selecting:u,selectButtonRef:T,onToggleSelect:()=>g(!u),onClearSelection:O,onAction:S=>{if(S.type==="reload"&&z.defaultView?.location.reload(),S.type==="signout")return c?.onSignOut();if(S.type==="signin"){let N=z.defaultView?.location;N&&(N.hash="revyse",N.reload());return}r?.(S)}})})]}),a("button",{ref:_,type:"button",class:"launcher","aria-label":d?"Close Revyse":"Open Revyse","aria-expanded":d,"aria-controls":"revyse-panel",onClick:()=>h(!d),children:a(Ni,{size:20})})]})}function Ii(e,n={}){let i=bo(),t=Oi(),r=e.createElement(ho);r.setAttribute("data-revyse-ignore","");let o=r.attachShadow({mode:"open"}),s=e.createElement("style");s.textContent=Fi,o.append(s);let c=e.createElement("div");return o.append(c),e.documentElement.append(r),St(a(xo,{connection:n.connection,onSelect:n.onSelect,onAction:n.onAction,artifactUrl:n.artifactUrl,mode:n.mode,live:n.live,flow:i,cloud:t,host:r}),c),{host:r,shadow:o,setFlow:i.set,setCloud:t.set,unmount(){St(null,c),r.remove()}}}function Hi(e){let n=e.WebSocketImpl??WebSocket,i=new Set,t=new Set,r=new Map,o="connecting",s=null,c=0,p=1,d=!1,h=l=>{o=l;for(let u of i)u(l)};function x(){h("connecting");let l=new n(e.url);s=l,l.onopen=()=>l.send(JSON.stringify({type:"hello",token:e.token,protocol:1})),l.onmessage=u=>{let g=JSON.parse(String(u.data));if(g.type==="welcome"&&ln(g))c=0,h("connected");else if(g.type==="response"){let f=cn(g);if(!f)return;let b=r.get(f.id);r.delete(f.id),f.ok?b?.resolve(f.result):b?.reject(new Error(f.error?.message??"Request failed"))}else if(g.type==="event"){let f=dn(g);if(!f)return;for(let b of t)b(f.event,f.data)}},l.onclose=u=>{for(let f of r.values())f.reject(new Error("Disconnected from the Revyse agent"));if(r.clear(),u.code===an.unauthorized)return h("rejected");if(h("disconnected"),d)return;let g=Math.min((e.retryMs??500)*2**c++,1e4);setTimeout(()=>!d&&x(),g)}}return x(),{get status(){return o},onStatus(l){return i.add(l),()=>i.delete(l)},onEvent(l){return t.add(l),()=>t.delete(l)},request(l,u){if(!s||o!=="connected")return Promise.reject(new Error("Not connected"));let g=String(p++);return s.send(JSON.stringify({id:g,type:l,payload:u})),new Promise((f,b)=>r.set(g,{resolve:f,reject:b}))},close(){d=!0,s?.close()}}}var tn=globalThis.__REVYSE_AGENT__;if(tn&&!window.__revyse){let e=Hi(tn),n={connection:e};window.__revyse=n;let i=()=>{let t=Ii(document,{connection:e,onAction:r=>n.flow?.handle(r),artifactUrl:Mi(tn.url)});n.overlay=t,n.flow=vi({connection:e,setFlow:t.setFlow})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i,{once:!0}):i(),e.onStatus(t=>{t==="rejected"&&console.warn("[revyse] the local agent rejected this page")})}
|