md-runbook 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cli.js +272 -225
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
`}return
|
|
4
|
-
`}return Qe.substring(0,Qe.length-1)},G.renderTo2dContext=function(F,N){N=N||2;for(var R=G.getModuleCount(),H=0;H<R;H++)for(var M=0;M<R;M++)F.fillStyle=G.isDark(H,M)?"black":"white",F.fillRect(M*N,H*N,N,N)},G};r.stringToBytesFuncs={default:function(E){for(var b=[],D=0;D<E.length;D+=1){var O=E.charCodeAt(D);b.push(O&255)}return b}},r.stringToBytes=r.stringToBytesFuncs.default,r.createStringToBytes=function(E,b){var D=(function(){for(var v=h(E),I=function(){var ie=v.read();if(ie==-1)throw"eof";return ie},k=0,m={};;){var L=v.read();if(L==-1)break;var A=I(),G=I(),z=I(),Y=String.fromCharCode(L<<8|A),X=G<<8|z;m[Y]=X,k+=1}if(k!=b)throw k+" != "+b;return m})(),O=63;return function(v){for(var I=[],k=0;k<v.length;k+=1){var m=v.charCodeAt(k);if(m<128)I.push(m);else{var L=D[v.charAt(k)];typeof L=="number"?(L&255)==L?I.push(L):(I.push(L>>>8),I.push(L&255)):I.push(O)}}return I}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},n={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=(function(){var E=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],b=1335,D=7973,O=21522,v={},I=function(k){for(var m=0;k!=0;)m+=1,k>>>=1;return m};return v.getBCHTypeInfo=function(k){for(var m=k<<10;I(m)-I(b)>=0;)m^=b<<I(m)-I(b);return(k<<10|m)^O},v.getBCHTypeNumber=function(k){for(var m=k<<12;I(m)-I(D)>=0;)m^=D<<I(m)-I(D);return k<<12|m},v.getPatternPosition=function(k){return E[k-1]},v.getMaskFunction=function(k){switch(k){case n.PATTERN000:return function(m,L){return(m+L)%2==0};case n.PATTERN001:return function(m,L){return m%2==0};case n.PATTERN010:return function(m,L){return L%3==0};case n.PATTERN011:return function(m,L){return(m+L)%3==0};case n.PATTERN100:return function(m,L){return(Math.floor(m/2)+Math.floor(L/3))%2==0};case n.PATTERN101:return function(m,L){return m*L%2+m*L%3==0};case n.PATTERN110:return function(m,L){return(m*L%2+m*L%3)%2==0};case n.PATTERN111:return function(m,L){return(m*L%3+(m+L)%2)%2==0};default:throw"bad maskPattern:"+k}},v.getErrorCorrectPolynomial=function(k){for(var m=B([1],0),L=0;L<k;L+=1)m=m.multiply(B([1,i.gexp(L)],0));return m},v.getLengthInBits=function(k,m){if(1<=m&&m<10)switch(k){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw"mode:"+k}else if(m<27)switch(k){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw"mode:"+k}else if(m<41)switch(k){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw"mode:"+k}else throw"type:"+m},v.getLostPoint=function(k){for(var m=k.getModuleCount(),L=0,A=0;A<m;A+=1)for(var G=0;G<m;G+=1){for(var z=0,Y=k.isDark(A,G),X=-1;X<=1;X+=1)if(!(A+X<0||m<=A+X))for(var ie=-1;ie<=1;ie+=1)G+ie<0||m<=G+ie||X==0&&ie==0||Y==k.isDark(A+X,G+ie)&&(z+=1);z>5&&(L+=3+z-5)}for(var A=0;A<m-1;A+=1)for(var G=0;G<m-1;G+=1){var ee=0;k.isDark(A,G)&&(ee+=1),k.isDark(A+1,G)&&(ee+=1),k.isDark(A,G+1)&&(ee+=1),k.isDark(A+1,G+1)&&(ee+=1),(ee==0||ee==4)&&(L+=3)}for(var A=0;A<m;A+=1)for(var G=0;G<m-6;G+=1)k.isDark(A,G)&&!k.isDark(A,G+1)&&k.isDark(A,G+2)&&k.isDark(A,G+3)&&k.isDark(A,G+4)&&!k.isDark(A,G+5)&&k.isDark(A,G+6)&&(L+=40);for(var G=0;G<m;G+=1)for(var A=0;A<m-6;A+=1)k.isDark(A,G)&&!k.isDark(A+1,G)&&k.isDark(A+2,G)&&k.isDark(A+3,G)&&k.isDark(A+4,G)&&!k.isDark(A+5,G)&&k.isDark(A+6,G)&&(L+=40);for(var te=0,G=0;G<m;G+=1)for(var A=0;A<m;A+=1)k.isDark(A,G)&&(te+=1);var Be=Math.abs(100*te/m/m-50)/5;return L+=Be*10,L},v})(),i=(function(){for(var E=new Array(256),b=new Array(256),D=0;D<8;D+=1)E[D]=1<<D;for(var D=8;D<256;D+=1)E[D]=E[D-4]^E[D-5]^E[D-6]^E[D-8];for(var D=0;D<255;D+=1)b[E[D]]=D;var O={};return O.glog=function(v){if(v<1)throw"glog("+v+")";return b[v]},O.gexp=function(v){for(;v<0;)v+=255;for(;v>=256;)v-=255;return E[v]},O})();function B(E,b){if(typeof E.length>"u")throw E.length+"/"+b;var D=(function(){for(var v=0;v<E.length&&E[v]==0;)v+=1;for(var I=new Array(E.length-v+b),k=0;k<E.length-v;k+=1)I[k]=E[k+v];return I})(),O={};return O.getAt=function(v){return D[v]},O.getLength=function(){return D.length},O.multiply=function(v){for(var I=new Array(O.getLength()+v.getLength()-1),k=0;k<O.getLength();k+=1)for(var m=0;m<v.getLength();m+=1)I[k+m]^=i.gexp(i.glog(O.getAt(k))+i.glog(v.getAt(m)));return B(I,0)},O.mod=function(v){if(O.getLength()-v.getLength()<0)return O;for(var I=i.glog(O.getAt(0))-i.glog(v.getAt(0)),k=new Array(O.getLength()),m=0;m<O.getLength();m+=1)k[m]=O.getAt(m);for(var m=0;m<v.getLength();m+=1)k[m]^=i.gexp(i.glog(v.getAt(m))+I);return B(k,0).mod(v)},O}var o=(function(){var E=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],b=function(v,I){var k={};return k.totalCount=v,k.dataCount=I,k},D={},O=function(v,I){switch(I){case t.L:return E[(v-1)*4+0];case t.M:return E[(v-1)*4+1];case t.Q:return E[(v-1)*4+2];case t.H:return E[(v-1)*4+3];default:return}};return D.getRSBlocks=function(v,I){var k=O(v,I);if(typeof k>"u")throw"bad rs block @ typeNumber:"+v+"/errorCorrectionLevel:"+I;for(var m=k.length/3,L=[],A=0;A<m;A+=1)for(var G=k[A*3+0],z=k[A*3+1],Y=k[A*3+2],X=0;X<G;X+=1)L.push(b(z,Y));return L},D})(),a=function(){var E=[],b=0,D={};return D.getBuffer=function(){return E},D.getAt=function(O){var v=Math.floor(O/8);return(E[v]>>>7-O%8&1)==1},D.put=function(O,v){for(var I=0;I<v;I+=1)D.putBit((O>>>v-I-1&1)==1)},D.getLengthInBits=function(){return b},D.putBit=function(O){var v=Math.floor(b/8);E.length<=v&&E.push(0),O&&(E[v]|=128>>>b%8),b+=1},D},c=function(E){var b=e.MODE_NUMBER,D=E,O={};O.getMode=function(){return b},O.getLength=function(k){return D.length},O.write=function(k){for(var m=D,L=0;L+2<m.length;)k.put(v(m.substring(L,L+3)),10),L+=3;L<m.length&&(m.length-L==1?k.put(v(m.substring(L,L+1)),4):m.length-L==2&&k.put(v(m.substring(L,L+2)),7))};var v=function(k){for(var m=0,L=0;L<k.length;L+=1)m=m*10+I(k.charAt(L));return m},I=function(k){if("0"<=k&&k<="9")return k.charCodeAt(0)-48;throw"illegal char :"+k};return O},u=function(E){var b=e.MODE_ALPHA_NUM,D=E,O={};O.getMode=function(){return b},O.getLength=function(I){return D.length},O.write=function(I){for(var k=D,m=0;m+1<k.length;)I.put(v(k.charAt(m))*45+v(k.charAt(m+1)),11),m+=2;m<k.length&&I.put(v(k.charAt(m)),6)};var v=function(I){if("0"<=I&&I<="9")return I.charCodeAt(0)-48;if("A"<=I&&I<="Z")return I.charCodeAt(0)-65+10;switch(I){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+I}};return O},l=function(E){var b=e.MODE_8BIT_BYTE,D=E,O=r.stringToBytes(E),v={};return v.getMode=function(){return b},v.getLength=function(I){return O.length},v.write=function(I){for(var k=0;k<O.length;k+=1)I.put(O[k],8)},v},f=function(E){var b=e.MODE_KANJI,D=E,O=r.stringToBytesFuncs.SJIS;if(!O)throw"sjis not supported.";(function(k,m){var L=O(k);if(L.length!=2||(L[0]<<8|L[1])!=m)throw"sjis not supported."})("\u53CB",38726);var v=O(E),I={};return I.getMode=function(){return b},I.getLength=function(k){return~~(v.length/2)},I.write=function(k){for(var m=v,L=0;L+1<m.length;){var A=(255&m[L])<<8|255&m[L+1];if(33088<=A&&A<=40956)A-=33088;else if(57408<=A&&A<=60351)A-=49472;else throw"illegal char at "+(L+1)+"/"+A;A=(A>>>8&255)*192+(A&255),k.put(A,13),L+=2}if(L<m.length)throw"illegal char at "+(L+1)},I},C=function(){var E=[],b={};return b.writeByte=function(D){E.push(D&255)},b.writeShort=function(D){b.writeByte(D),b.writeByte(D>>>8)},b.writeBytes=function(D,O,v){O=O||0,v=v||D.length;for(var I=0;I<v;I+=1)b.writeByte(D[I+O])},b.writeString=function(D){for(var O=0;O<D.length;O+=1)b.writeByte(D.charCodeAt(O))},b.toByteArray=function(){return E},b.toString=function(){var D="";D+="[";for(var O=0;O<E.length;O+=1)O>0&&(D+=","),D+=E[O];return D+="]",D},b},d=function(){var E=0,b=0,D=0,O="",v={},I=function(m){O+=String.fromCharCode(k(m&63))},k=function(m){if(!(m<0)){if(m<26)return 65+m;if(m<52)return 97+(m-26);if(m<62)return 48+(m-52);if(m==62)return 43;if(m==63)return 47}throw"n:"+m};return v.writeByte=function(m){for(E=E<<8|m&255,b+=8,D+=1;b>=6;)I(E>>>b-6),b-=6},v.flush=function(){if(b>0&&(I(E<<6-b),E=0,b=0),D%3!=0)for(var m=3-D%3,L=0;L<m;L+=1)O+="="},v.toString=function(){return O},v},h=function(E){var b=E,D=0,O=0,v=0,I={};I.read=function(){for(;v<8;){if(D>=b.length){if(v==0)return-1;throw"unexpected end of file./"+v}var m=b.charAt(D);if(D+=1,m=="=")return v=0,-1;if(m.match(/^\s$/))continue;O=O<<6|k(m.charCodeAt(0)),v+=6}var L=O>>>v-8&255;return v-=8,L};var k=function(m){if(65<=m&&m<=90)return m-65;if(97<=m&&m<=122)return m-97+26;if(48<=m&&m<=57)return m-48+52;if(m==43)return 62;if(m==47)return 63;throw"c:"+m};return I},x=function(E,b){var D=E,O=b,v=new Array(E*b),I={};I.setPixel=function(A,G,z){v[G*D+A]=z},I.write=function(A){A.writeString("GIF87a"),A.writeShort(D),A.writeShort(O),A.writeByte(128),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(255),A.writeByte(255),A.writeByte(255),A.writeString(","),A.writeShort(0),A.writeShort(0),A.writeShort(D),A.writeShort(O),A.writeByte(0);var G=2,z=m(G);A.writeByte(G);for(var Y=0;z.length-Y>255;)A.writeByte(255),A.writeBytes(z,Y,255),Y+=255;A.writeByte(z.length-Y),A.writeBytes(z,Y,z.length-Y),A.writeByte(0),A.writeString(";")};var k=function(A){var G=A,z=0,Y=0,X={};return X.write=function(ie,ee){if(ie>>>ee)throw"length over";for(;z+ee>=8;)G.writeByte(255&(ie<<z|Y)),ee-=8-z,ie>>>=8-z,Y=0,z=0;Y=ie<<z|Y,z=z+ee},X.flush=function(){z>0&&G.writeByte(Y)},X},m=function(A){for(var G=1<<A,z=(1<<A)+1,Y=A+1,X=L(),ie=0;ie<G;ie+=1)X.add(String.fromCharCode(ie));X.add(String.fromCharCode(G)),X.add(String.fromCharCode(z));var ee=C(),te=k(ee);te.write(G,Y);var Be=0,ke=String.fromCharCode(v[Be]);for(Be+=1;Be<v.length;){var Ce=String.fromCharCode(v[Be]);Be+=1,X.contains(ke+Ce)?ke=ke+Ce:(te.write(X.indexOf(ke),Y),X.size()<4095&&(X.size()==1<<Y&&(Y+=1),X.add(ke+Ce)),ke=Ce)}return te.write(X.indexOf(ke),Y),te.write(z,Y),te.flush(),ee.toByteArray()},L=function(){var A={},G=0,z={};return z.add=function(Y){if(z.contains(Y))throw"dup key:"+Y;A[Y]=G,G+=1},z.size=function(){return G},z.indexOf=function(Y){return A[Y]},z.contains=function(Y){return typeof A[Y]<"u"},z};return I},S=function(E,b,D){for(var O=x(E,b),v=0;v<b;v+=1)for(var I=0;I<E;I+=1)O.setPixel(I,v,D(I,v));var k=C();O.write(k);for(var m=d(),L=k.toByteArray(),A=0;A<L.length;A+=1)m.writeByte(L[A]);return m.flush(),"data:image/gif;base64,"+m};return r})();(function(){gc.stringToBytesFuncs["UTF-8"]=function(r){function e(t){for(var n=[],s=0;s<t.length;s++){var i=t.charCodeAt(s);i<128?n.push(i):i<2048?n.push(192|i>>6,128|i&63):i<55296||i>=57344?n.push(224|i>>12,128|i>>6&63,128|i&63):(s++,i=65536+((i&1023)<<10|t.charCodeAt(s)&1023),n.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63))}return n}return e(r)}})();(function(r){typeof define=="function"&&define.amd?define([],r):typeof mc=="object"&&(Ec.exports=r())})(function(){return gc})});var ed={};Qc(ed,{estimate:()=>Mc,lint:()=>Nc,main:()=>Gc,parseArgs:()=>$c});module.exports=qc(ed);var Ze=he(require("node:fs")),bt=he(require("node:path"));var Vo={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0};function ye(r){return typeof r=="string"}function Zo(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="markup"&&ye(e.lead)&&ye(e.content)&&ye(e.trail)&&(e.eol===`
|
|
2
|
+
"use strict";var Zf=Object.create;var Gs=Object.defineProperty;var Xf=Object.getOwnPropertyDescriptor;var ed=Object.getOwnPropertyNames;var td=Object.getPrototypeOf,nd=Object.prototype.hasOwnProperty;var rd=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},sd=(r,e)=>{for(var t in e)Gs(r,t,{get:e[t],enumerable:!0})},$a=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ed(e))!nd.call(r,s)&&s!==t&&Gs(r,s,{get:()=>e[s],enumerable:!(n=Xf(e,s))||n.enumerable});return r};var le=(r,e,t)=>(t=r!=null?Zf(td(r)):{},$a(e||!r||!r.__esModule?Gs(t,"default",{value:r,enumerable:!0}):t,r)),id=r=>$a(Gs({},"__esModule",{value:!0}),r);var Ef=rd((gf,mf)=>{var Cf=(function(){var r=function(m,b){var v=236,R=17,S=m,I=t[b],x=null,E=0,y=null,O=[],P={},X=function($,M){E=S*4+17,x=(function(A){for(var G=new Array(A),H=0;H<A;H+=1){G[H]=new Array(A);for(var U=0;U<A;U+=1)G[H][U]=null}return G})(E),q(0,0),q(E-7,0),q(0,E-7),Y(),ee(),te($,M),S>=7&&se($),y==null&&(y=Ue(S,I,O)),Se(y,M)},q=function($,M){for(var A=-1;A<=7;A+=1)if(!($+A<=-1||E<=$+A))for(var G=-1;G<=7;G+=1)M+G<=-1||E<=M+G||(0<=A&&A<=6&&(G==0||G==6)||0<=G&&G<=6&&(A==0||A==6)||2<=A&&A<=4&&2<=G&&G<=4?x[$+A][M+G]=!0:x[$+A][M+G]=!1)},W=function(){for(var $=0,M=0,A=0;A<8;A+=1){X(!0,A);var G=s.getLostPoint(P);(A==0||$>G)&&($=G,M=A)}return M},ee=function(){for(var $=8;$<E-8;$+=1)x[$][6]==null&&(x[$][6]=$%2==0);for(var M=8;M<E-8;M+=1)x[6][M]==null&&(x[6][M]=M%2==0)},Y=function(){for(var $=s.getPatternPosition(S),M=0;M<$.length;M+=1)for(var A=0;A<$.length;A+=1){var G=$[M],H=$[A];if(x[G][H]==null)for(var U=-2;U<=2;U+=1)for(var Q=-2;Q<=2;Q+=1)U==-2||U==2||Q==-2||Q==2||U==0&&Q==0?x[G+U][H+Q]=!0:x[G+U][H+Q]=!1}},se=function($){for(var M=s.getBCHTypeNumber(S),A=0;A<18;A+=1){var G=!$&&(M>>A&1)==1;x[Math.floor(A/3)][A%3+E-8-3]=G}for(var A=0;A<18;A+=1){var G=!$&&(M>>A&1)==1;x[A%3+E-8-3][Math.floor(A/3)]=G}},te=function($,M){for(var A=I<<3|M,G=s.getBCHTypeInfo(A),H=0;H<15;H+=1){var U=!$&&(G>>H&1)==1;H<6?x[H][8]=U:H<8?x[H+1][8]=U:x[E-15+H][8]=U}for(var H=0;H<15;H+=1){var U=!$&&(G>>H&1)==1;H<8?x[8][E-H-1]=U:H<9?x[8][15-H-1+1]=U:x[8][15-H-1]=U}x[E-8][8]=!$},Se=function($,M){for(var A=-1,G=E-1,H=7,U=0,Q=s.getMaskFunction(M),z=E-1;z>0;z-=2)for(z==6&&(z-=1);;){for(var ue=0;ue<2;ue+=1)if(x[G][z-ue]==null){var ke=!1;U<$.length&&(ke=($[U]>>>H&1)==1);var V=Q(G,z-ue);V&&(ke=!ke),x[G][z-ue]=ke,H-=1,H==-1&&(U+=1,H=7)}if(G+=A,G<0||E<=G){G-=A,A=-A;break}}},ge=function($,M){for(var A=0,G=0,H=0,U=new Array(M.length),Q=new Array(M.length),z=0;z<M.length;z+=1){var ue=M[z].dataCount,ke=M[z].totalCount-ue;G=Math.max(G,ue),H=Math.max(H,ke),U[z]=new Array(ue);for(var V=0;V<U[z].length;V+=1)U[z][V]=255&$.getBuffer()[V+A];A+=ue;var Me=s.getErrorCorrectPolynomial(ke),tt=o(U[z],Me.getLength()-1),Wn=tt.mod(Me);Q[z]=new Array(Me.getLength()-1);for(var V=0;V<Q[z].length;V+=1){var Zt=V+Wn.getLength()-Q[z].length;Q[z][V]=Zt>=0?Wn.getAt(Zt):0}}for(var Cn=0,V=0;V<M.length;V+=1)Cn+=M[V].totalCount;for(var Xt=new Array(Cn),en=0,V=0;V<G;V+=1)for(var z=0;z<M.length;z+=1)V<U[z].length&&(Xt[en]=U[z][V],en+=1);for(var V=0;V<H;V+=1)for(var z=0;z<M.length;z+=1)V<Q[z].length&&(Xt[en]=Q[z][V],en+=1);return Xt},Ue=function($,M,A){for(var G=B.getRSBlocks($,M),H=a(),U=0;U<A.length;U+=1){var Q=A[U];H.put(Q.getMode(),4),H.put(Q.getLength(),s.getLengthInBits(Q.getMode(),$)),Q.write(H)}for(var z=0,U=0;U<G.length;U+=1)z+=G[U].dataCount;if(H.getLengthInBits()>z*8)throw"code length overflow. ("+H.getLengthInBits()+">"+z*8+")";for(H.getLengthInBits()+4<=z*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=z*8||(H.put(v,8),H.getLengthInBits()>=z*8));)H.put(R,8);return ge(H,G)};P.addData=function($,M){M=M||"Byte";var A=null;switch(M){case"Numeric":A=c($);break;case"Alphanumeric":A=l($);break;case"Byte":A=u($);break;case"Kanji":A=f($);break;default:throw"mode:"+M}O.push(A),y=null},P.isDark=function($,M){if($<0||E<=$||M<0||E<=M)throw $+","+M;return x[$][M]},P.getModuleCount=function(){return E},P.make=function(){if(S<1){for(var $=1;$<40;$++){for(var M=B.getRSBlocks($,I),A=a(),G=0;G<O.length;G++){var H=O[G];A.put(H.getMode(),4),A.put(H.getLength(),s.getLengthInBits(H.getMode(),$)),H.write(A)}for(var U=0,G=0;G<M.length;G++)U+=M[G].dataCount;if(A.getLengthInBits()<=U*8)break}S=$}X(!1,W())},P.createTableTag=function($,M){$=$||2,M=typeof M>"u"?$*4:M;var A="";A+='<table style="',A+=" border-width: 0px; border-style: none;",A+=" border-collapse: collapse;",A+=" padding: 0px; margin: "+M+"px;",A+='">',A+="<tbody>";for(var G=0;G<P.getModuleCount();G+=1){A+="<tr>";for(var H=0;H<P.getModuleCount();H+=1)A+='<td style="',A+=" border-width: 0px; border-style: none;",A+=" border-collapse: collapse;",A+=" padding: 0px; margin: 0px;",A+=" width: "+$+"px;",A+=" height: "+$+"px;",A+=" background-color: ",A+=P.isDark(G,H)?"#000000":"#ffffff",A+=";",A+='"/>';A+="</tr>"}return A+="</tbody>",A+="</table>",A},P.createSvgTag=function($,M,A,G){var H={};typeof arguments[0]=="object"&&(H=arguments[0],$=H.cellSize,M=H.margin,A=H.alt,G=H.title),$=$||2,M=typeof M>"u"?$*4:M,A=typeof A=="string"?{text:A}:A||{},A.text=A.text||null,A.id=A.text?A.id||"qrcode-description":null,G=typeof G=="string"?{text:G}:G||{},G.text=G.text||null,G.id=G.text?G.id||"qrcode-title":null;var U=P.getModuleCount()*$+M*2,Q,z,ue,ke,V="",Me;for(Me="l"+$+",0 0,"+$+" -"+$+",0 0,-"+$+"z ",V+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',V+=H.scalable?"":' width="'+U+'px" height="'+U+'px"',V+=' viewBox="0 0 '+U+" "+U+'" ',V+=' preserveAspectRatio="xMinYMin meet"',V+=G.text||A.text?' role="img" aria-labelledby="'+De([G.id,A.id].join(" ").trim())+'"':"",V+=">",V+=G.text?'<title id="'+De(G.id)+'">'+De(G.text)+"</title>":"",V+=A.text?'<description id="'+De(A.id)+'">'+De(A.text)+"</description>":"",V+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',V+='<path d="',ue=0;ue<P.getModuleCount();ue+=1)for(ke=ue*$+M,Q=0;Q<P.getModuleCount();Q+=1)P.isDark(ue,Q)&&(z=Q*$+M,V+="M"+z+","+ke+Me);return V+='" stroke="transparent" fill="black"/>',V+="</svg>",V},P.createDataURL=function($,M){$=$||2,M=typeof M>"u"?$*4:M;var A=P.getModuleCount()*$+M*2,G=M,H=A-M;return D(A,A,function(U,Q){if(G<=U&&U<H&&G<=Q&&Q<H){var z=Math.floor((U-G)/$),ue=Math.floor((Q-G)/$);return P.isDark(ue,z)?0:1}else return 1})},P.createImgTag=function($,M,A){$=$||2,M=typeof M>"u"?$*4:M;var G=P.getModuleCount()*$+M*2,H="";return H+="<img",H+=' src="',H+=P.createDataURL($,M),H+='"',H+=' width="',H+=G,H+='"',H+=' height="',H+=G,H+='"',A&&(H+=' alt="',H+=De(A),H+='"'),H+="/>",H};var De=function($){for(var M="",A=0;A<$.length;A+=1){var G=$.charAt(A);switch(G){case"<":M+="<";break;case">":M+=">";break;case"&":M+="&";break;case'"':M+=""";break;default:M+=G;break}}return M},be=function($){var M=1;$=typeof $>"u"?M*2:$;var A=P.getModuleCount()*M+$*2,G=$,H=A-$,U,Q,z,ue,ke,V={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},Me={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},tt="";for(U=0;U<A;U+=2){for(z=Math.floor((U-G)/M),ue=Math.floor((U+1-G)/M),Q=0;Q<A;Q+=1)ke="\u2588",G<=Q&&Q<H&&G<=U&&U<H&&P.isDark(z,Math.floor((Q-G)/M))&&(ke=" "),G<=Q&&Q<H&&G<=U+1&&U+1<H&&P.isDark(ue,Math.floor((Q-G)/M))?ke+=" ":ke+="\u2588",tt+=$<1&&U+1>=H?Me[ke]:V[ke];tt+=`
|
|
3
|
+
`}return A%2&&$>0?tt.substring(0,tt.length-A-1)+Array(A+1).join("\u2580"):tt.substring(0,tt.length-1)};return P.createASCII=function($,M){if($=$||1,$<2)return be(M);$-=1,M=typeof M>"u"?$*2:M;var A=P.getModuleCount()*$+M*2,G=M,H=A-M,U,Q,z,ue,ke=Array($+1).join("\u2588\u2588"),V=Array($+1).join(" "),Me="",tt="";for(U=0;U<A;U+=1){for(z=Math.floor((U-G)/$),tt="",Q=0;Q<A;Q+=1)ue=1,G<=Q&&Q<H&&G<=U&&U<H&&P.isDark(z,Math.floor((Q-G)/$))&&(ue=0),tt+=ue?ke:V;for(z=0;z<$;z+=1)Me+=tt+`
|
|
4
|
+
`}return Me.substring(0,Me.length-1)},P.renderTo2dContext=function($,M){M=M||2;for(var A=P.getModuleCount(),G=0;G<A;G++)for(var H=0;H<A;H++)$.fillStyle=P.isDark(G,H)?"black":"white",$.fillRect(H*M,G*M,M,M)},P};r.stringToBytesFuncs={default:function(m){for(var b=[],v=0;v<m.length;v+=1){var R=m.charCodeAt(v);b.push(R&255)}return b}},r.stringToBytes=r.stringToBytesFuncs.default,r.createStringToBytes=function(m,b){var v=(function(){for(var S=p(m),I=function(){var ee=S.read();if(ee==-1)throw"eof";return ee},x=0,E={};;){var y=S.read();if(y==-1)break;var O=I(),P=I(),X=I(),q=String.fromCharCode(y<<8|O),W=P<<8|X;E[q]=W,x+=1}if(x!=b)throw x+" != "+b;return E})(),R=63;return function(S){for(var I=[],x=0;x<S.length;x+=1){var E=S.charCodeAt(x);if(E<128)I.push(E);else{var y=v[S.charAt(x)];typeof y=="number"?(y&255)==y?I.push(y):(I.push(y>>>8),I.push(y&255)):I.push(R)}}return I}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},t={L:1,M:0,Q:3,H:2},n={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=(function(){var m=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],b=1335,v=7973,R=21522,S={},I=function(x){for(var E=0;x!=0;)E+=1,x>>>=1;return E};return S.getBCHTypeInfo=function(x){for(var E=x<<10;I(E)-I(b)>=0;)E^=b<<I(E)-I(b);return(x<<10|E)^R},S.getBCHTypeNumber=function(x){for(var E=x<<12;I(E)-I(v)>=0;)E^=v<<I(E)-I(v);return x<<12|E},S.getPatternPosition=function(x){return m[x-1]},S.getMaskFunction=function(x){switch(x){case n.PATTERN000:return function(E,y){return(E+y)%2==0};case n.PATTERN001:return function(E,y){return E%2==0};case n.PATTERN010:return function(E,y){return y%3==0};case n.PATTERN011:return function(E,y){return(E+y)%3==0};case n.PATTERN100:return function(E,y){return(Math.floor(E/2)+Math.floor(y/3))%2==0};case n.PATTERN101:return function(E,y){return E*y%2+E*y%3==0};case n.PATTERN110:return function(E,y){return(E*y%2+E*y%3)%2==0};case n.PATTERN111:return function(E,y){return(E*y%3+(E+y)%2)%2==0};default:throw"bad maskPattern:"+x}},S.getErrorCorrectPolynomial=function(x){for(var E=o([1],0),y=0;y<x;y+=1)E=E.multiply(o([1,i.gexp(y)],0));return E},S.getLengthInBits=function(x,E){if(1<=E&&E<10)switch(x){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw"mode:"+x}else if(E<27)switch(x){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw"mode:"+x}else if(E<41)switch(x){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw"mode:"+x}else throw"type:"+E},S.getLostPoint=function(x){for(var E=x.getModuleCount(),y=0,O=0;O<E;O+=1)for(var P=0;P<E;P+=1){for(var X=0,q=x.isDark(O,P),W=-1;W<=1;W+=1)if(!(O+W<0||E<=O+W))for(var ee=-1;ee<=1;ee+=1)P+ee<0||E<=P+ee||W==0&&ee==0||q==x.isDark(O+W,P+ee)&&(X+=1);X>5&&(y+=3+X-5)}for(var O=0;O<E-1;O+=1)for(var P=0;P<E-1;P+=1){var Y=0;x.isDark(O,P)&&(Y+=1),x.isDark(O+1,P)&&(Y+=1),x.isDark(O,P+1)&&(Y+=1),x.isDark(O+1,P+1)&&(Y+=1),(Y==0||Y==4)&&(y+=3)}for(var O=0;O<E;O+=1)for(var P=0;P<E-6;P+=1)x.isDark(O,P)&&!x.isDark(O,P+1)&&x.isDark(O,P+2)&&x.isDark(O,P+3)&&x.isDark(O,P+4)&&!x.isDark(O,P+5)&&x.isDark(O,P+6)&&(y+=40);for(var P=0;P<E;P+=1)for(var O=0;O<E-6;O+=1)x.isDark(O,P)&&!x.isDark(O+1,P)&&x.isDark(O+2,P)&&x.isDark(O+3,P)&&x.isDark(O+4,P)&&!x.isDark(O+5,P)&&x.isDark(O+6,P)&&(y+=40);for(var se=0,P=0;P<E;P+=1)for(var O=0;O<E;O+=1)x.isDark(O,P)&&(se+=1);var te=Math.abs(100*se/E/E-50)/5;return y+=te*10,y},S})(),i=(function(){for(var m=new Array(256),b=new Array(256),v=0;v<8;v+=1)m[v]=1<<v;for(var v=8;v<256;v+=1)m[v]=m[v-4]^m[v-5]^m[v-6]^m[v-8];for(var v=0;v<255;v+=1)b[m[v]]=v;var R={};return R.glog=function(S){if(S<1)throw"glog("+S+")";return b[S]},R.gexp=function(S){for(;S<0;)S+=255;for(;S>=256;)S-=255;return m[S]},R})();function o(m,b){if(typeof m.length>"u")throw m.length+"/"+b;var v=(function(){for(var S=0;S<m.length&&m[S]==0;)S+=1;for(var I=new Array(m.length-S+b),x=0;x<m.length-S;x+=1)I[x]=m[x+S];return I})(),R={};return R.getAt=function(S){return v[S]},R.getLength=function(){return v.length},R.multiply=function(S){for(var I=new Array(R.getLength()+S.getLength()-1),x=0;x<R.getLength();x+=1)for(var E=0;E<S.getLength();E+=1)I[x+E]^=i.gexp(i.glog(R.getAt(x))+i.glog(S.getAt(E)));return o(I,0)},R.mod=function(S){if(R.getLength()-S.getLength()<0)return R;for(var I=i.glog(R.getAt(0))-i.glog(S.getAt(0)),x=new Array(R.getLength()),E=0;E<R.getLength();E+=1)x[E]=R.getAt(E);for(var E=0;E<S.getLength();E+=1)x[E]^=i.gexp(i.glog(S.getAt(E))+I);return o(x,0).mod(S)},R}var B=(function(){var m=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],b=function(S,I){var x={};return x.totalCount=S,x.dataCount=I,x},v={},R=function(S,I){switch(I){case t.L:return m[(S-1)*4+0];case t.M:return m[(S-1)*4+1];case t.Q:return m[(S-1)*4+2];case t.H:return m[(S-1)*4+3];default:return}};return v.getRSBlocks=function(S,I){var x=R(S,I);if(typeof x>"u")throw"bad rs block @ typeNumber:"+S+"/errorCorrectionLevel:"+I;for(var E=x.length/3,y=[],O=0;O<E;O+=1)for(var P=x[O*3+0],X=x[O*3+1],q=x[O*3+2],W=0;W<P;W+=1)y.push(b(X,q));return y},v})(),a=function(){var m=[],b=0,v={};return v.getBuffer=function(){return m},v.getAt=function(R){var S=Math.floor(R/8);return(m[S]>>>7-R%8&1)==1},v.put=function(R,S){for(var I=0;I<S;I+=1)v.putBit((R>>>S-I-1&1)==1)},v.getLengthInBits=function(){return b},v.putBit=function(R){var S=Math.floor(b/8);m.length<=S&&m.push(0),R&&(m[S]|=128>>>b%8),b+=1},v},c=function(m){var b=e.MODE_NUMBER,v=m,R={};R.getMode=function(){return b},R.getLength=function(x){return v.length},R.write=function(x){for(var E=v,y=0;y+2<E.length;)x.put(S(E.substring(y,y+3)),10),y+=3;y<E.length&&(E.length-y==1?x.put(S(E.substring(y,y+1)),4):E.length-y==2&&x.put(S(E.substring(y,y+2)),7))};var S=function(x){for(var E=0,y=0;y<x.length;y+=1)E=E*10+I(x.charAt(y));return E},I=function(x){if("0"<=x&&x<="9")return x.charCodeAt(0)-48;throw"illegal char :"+x};return R},l=function(m){var b=e.MODE_ALPHA_NUM,v=m,R={};R.getMode=function(){return b},R.getLength=function(I){return v.length},R.write=function(I){for(var x=v,E=0;E+1<x.length;)I.put(S(x.charAt(E))*45+S(x.charAt(E+1)),11),E+=2;E<x.length&&I.put(S(x.charAt(E)),6)};var S=function(I){if("0"<=I&&I<="9")return I.charCodeAt(0)-48;if("A"<=I&&I<="Z")return I.charCodeAt(0)-65+10;switch(I){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+I}};return R},u=function(m){var b=e.MODE_8BIT_BYTE,v=m,R=r.stringToBytes(m),S={};return S.getMode=function(){return b},S.getLength=function(I){return R.length},S.write=function(I){for(var x=0;x<R.length;x+=1)I.put(R[x],8)},S},f=function(m){var b=e.MODE_KANJI,v=m,R=r.stringToBytesFuncs.SJIS;if(!R)throw"sjis not supported.";(function(x,E){var y=R(x);if(y.length!=2||(y[0]<<8|y[1])!=E)throw"sjis not supported."})("\u53CB",38726);var S=R(m),I={};return I.getMode=function(){return b},I.getLength=function(x){return~~(S.length/2)},I.write=function(x){for(var E=S,y=0;y+1<E.length;){var O=(255&E[y])<<8|255&E[y+1];if(33088<=O&&O<=40956)O-=33088;else if(57408<=O&&O<=60351)O-=49472;else throw"illegal char at "+(y+1)+"/"+O;O=(O>>>8&255)*192+(O&255),x.put(O,13),y+=2}if(y<E.length)throw"illegal char at "+(y+1)},I},d=function(){var m=[],b={};return b.writeByte=function(v){m.push(v&255)},b.writeShort=function(v){b.writeByte(v),b.writeByte(v>>>8)},b.writeBytes=function(v,R,S){R=R||0,S=S||v.length;for(var I=0;I<S;I+=1)b.writeByte(v[I+R])},b.writeString=function(v){for(var R=0;R<v.length;R+=1)b.writeByte(v.charCodeAt(R))},b.toByteArray=function(){return m},b.toString=function(){var v="";v+="[";for(var R=0;R<m.length;R+=1)R>0&&(v+=","),v+=m[R];return v+="]",v},b},h=function(){var m=0,b=0,v=0,R="",S={},I=function(E){R+=String.fromCharCode(x(E&63))},x=function(E){if(!(E<0)){if(E<26)return 65+E;if(E<52)return 97+(E-26);if(E<62)return 48+(E-52);if(E==62)return 43;if(E==63)return 47}throw"n:"+E};return S.writeByte=function(E){for(m=m<<8|E&255,b+=8,v+=1;b>=6;)I(m>>>b-6),b-=6},S.flush=function(){if(b>0&&(I(m<<6-b),m=0,b=0),v%3!=0)for(var E=3-v%3,y=0;y<E;y+=1)R+="="},S.toString=function(){return R},S},p=function(m){var b=m,v=0,R=0,S=0,I={};I.read=function(){for(;S<8;){if(v>=b.length){if(S==0)return-1;throw"unexpected end of file./"+S}var E=b.charAt(v);if(v+=1,E=="=")return S=0,-1;if(E.match(/^\s$/))continue;R=R<<6|x(E.charCodeAt(0)),S+=6}var y=R>>>S-8&255;return S-=8,y};var x=function(E){if(65<=E&&E<=90)return E-65;if(97<=E&&E<=122)return E-97+26;if(48<=E&&E<=57)return E-48+52;if(E==43)return 62;if(E==47)return 63;throw"c:"+E};return I},w=function(m,b){var v=m,R=b,S=new Array(m*b),I={};I.setPixel=function(O,P,X){S[P*v+O]=X},I.write=function(O){O.writeString("GIF87a"),O.writeShort(v),O.writeShort(R),O.writeByte(128),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(0),O.writeByte(255),O.writeByte(255),O.writeByte(255),O.writeString(","),O.writeShort(0),O.writeShort(0),O.writeShort(v),O.writeShort(R),O.writeByte(0);var P=2,X=E(P);O.writeByte(P);for(var q=0;X.length-q>255;)O.writeByte(255),O.writeBytes(X,q,255),q+=255;O.writeByte(X.length-q),O.writeBytes(X,q,X.length-q),O.writeByte(0),O.writeString(";")};var x=function(O){var P=O,X=0,q=0,W={};return W.write=function(ee,Y){if(ee>>>Y)throw"length over";for(;X+Y>=8;)P.writeByte(255&(ee<<X|q)),Y-=8-X,ee>>>=8-X,q=0,X=0;q=ee<<X|q,X=X+Y},W.flush=function(){X>0&&P.writeByte(q)},W},E=function(O){for(var P=1<<O,X=(1<<O)+1,q=O+1,W=y(),ee=0;ee<P;ee+=1)W.add(String.fromCharCode(ee));W.add(String.fromCharCode(P)),W.add(String.fromCharCode(X));var Y=d(),se=x(Y);se.write(P,q);var te=0,Se=String.fromCharCode(S[te]);for(te+=1;te<S.length;){var ge=String.fromCharCode(S[te]);te+=1,W.contains(Se+ge)?Se=Se+ge:(se.write(W.indexOf(Se),q),W.size()<4095&&(W.size()==1<<q&&(q+=1),W.add(Se+ge)),Se=ge)}return se.write(W.indexOf(Se),q),se.write(X,q),se.flush(),Y.toByteArray()},y=function(){var O={},P=0,X={};return X.add=function(q){if(X.contains(q))throw"dup key:"+q;O[q]=P,P+=1},X.size=function(){return P},X.indexOf=function(q){return O[q]},X.contains=function(q){return typeof O[q]<"u"},X};return I},D=function(m,b,v){for(var R=w(m,b),S=0;S<b;S+=1)for(var I=0;I<m;I+=1)R.setPixel(I,S,v(I,S));var x=d();R.write(x);for(var E=h(),y=x.toByteArray(),O=0;O<y.length;O+=1)E.writeByte(y[O]);return E.flush(),"data:image/gif;base64,"+E};return r})();(function(){Cf.stringToBytesFuncs["UTF-8"]=function(r){function e(t){for(var n=[],s=0;s<t.length;s++){var i=t.charCodeAt(s);i<128?n.push(i):i<2048?n.push(192|i>>6,128|i&63):i<55296||i>=57344?n.push(224|i>>12,128|i>>6&63,128|i&63):(s++,i=65536+((i&1023)<<10|t.charCodeAt(s)&1023),n.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|i&63))}return n}return e(r)}})();(function(r){typeof define=="function"&&define.amd?define([],r):typeof gf=="object"&&(mf.exports=r())})(function(){return Cf})});var IC={};sd(IC,{estimate:()=>Jf,lint:()=>_f,main:()=>Uf,parseArgs:()=>Hf});module.exports=id(IC);var Ve=le(require("node:fs")),vt=le(require("node:path"));var Ia={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0};function Fe(r){return typeof r=="string"}function Ta(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="markup"&&Fe(e.lead)&&Fe(e.content)&&Fe(e.trail)&&(e.eol===`
|
|
5
5
|
`||e.eol===`\r
|
|
6
|
-
`)&&
|
|
6
|
+
`)&&Fe(e.finalEol)&&Fe(e.value)}function La(r){if(typeof r!="object"||r===null)return!1;let e=r;return(e.raw===void 0||Fe(e.raw))&&Fe(e.text)&&typeof e.attrs=="object"&&e.attrs!==null&&Object.values(e.attrs).every(Fe)}function od(r){if(typeof r!="object"||r===null)return!1;let e=r;return Fe(e.raw)&&Fe(e.gap)&&Array.isArray(e.entries)&&e.entries.every(La)}function Bd(r){if(typeof r!="object"||r===null)return!1;let e=r;return Fe(e.raw)&&Fe(e.gap)}function ce(r){if(typeof r!="object"||r===null)return!1;let e=r;return e.kind==="code"&&Fe(e.lead)&&Fe(e.open)&&Fe(e.body)&&Fe(e.close)&&Fe(e.trail)&&Fe(e.indent)&&(e.fenceChar==="`"||e.fenceChar==="~")&&typeof e.fenceLen=="number"&&Fe(e.info)&&Fe(e.lang)&&(e.eol===`
|
|
7
7
|
`||e.eol===`\r
|
|
8
|
-
`)&&
|
|
8
|
+
`)&&Fe(e.value)&&(e.output===void 0||Bd(e.output))&&(e.history===void 0||od(e.history))}function Na(r){if(typeof r!="object"||r===null)return!1;let e=r;return typeof e.bom=="boolean"&&(e.eol===`
|
|
9
9
|
`||e.eol===`\r
|
|
10
|
-
`)}function
|
|
10
|
+
`)}function xn(r){let e=[],t=/\r\n|\n|\r/g,n=0,s;for(;(s=t.exec(r))!==null;)e.push({text:r.slice(n,s.index),eol:s[0]}),n=t.lastIndex;return n<r.length&&e.push({text:r.slice(n),eol:""}),e}function Nt(r){let e="";for(let t of r)e+=t.text+t.eol;return e}function Ps(r,e){let t=0,n=0;for(let s of r)s.eol===`\r
|
|
11
11
|
`?t++:s.eol===`
|
|
12
12
|
`&&n++;return t===0&&n===0?e:t>n?`\r
|
|
13
13
|
`:`
|
|
14
|
-
`}function
|
|
14
|
+
`}function Hs(r){return r.endsWith(`\r
|
|
15
15
|
`)?`\r
|
|
16
16
|
`:r.endsWith(`
|
|
17
17
|
`)?`
|
|
18
|
-
`:r.endsWith("\r")?"\r":""}function
|
|
19
|
-
`)}var
|
|
20
|
-
`)s[
|
|
21
|
-
`)}var
|
|
22
|
-
`).map((n,s)=>n.includes(
|
|
23
|
-
`),stderr:e}}function
|
|
24
|
-
`);if(t.length<=e)return r;let n=Math.ceil(e/2),s=e-n,i=t.length-e;return[...t.slice(0,n),
|
|
25
|
-
`)}function
|
|
26
|
-
`),
|
|
27
|
-
`),i="`".repeat(Math.max(3,
|
|
28
|
-
`),i=[],
|
|
29
|
-
`),
|
|
30
|
-
`),
|
|
31
|
-
`);return{meta:{raw:
|
|
32
|
-
`},s=n.eol,i="",
|
|
33
|
-
`).map(n=>
|
|
34
|
-
`))e?
|
|
35
|
-
`),f)+1),
|
|
36
|
-
`);if(t>=0&&(this.held+=this.pending.slice(0,t+1),this.pending=this.pending.slice(t+1),(
|
|
37
|
-
`);if(
|
|
38
|
-
`).forEach((s,i)=>{let
|
|
39
|
-
`}var
|
|
40
|
-
`))}finally{
|
|
41
|
-
`)),
|
|
42
|
-
`,t++;continue}if(
|
|
43
|
-
`,t++;continue}if(
|
|
44
|
-
${
|
|
45
|
-
`;continue}if(
|
|
18
|
+
`:r.endsWith("\r")?"\r":""}function Tr(r){return Hs(r)!==""}function sr(r){return r.replace(/\r\n?/g,`
|
|
19
|
+
`)}var ir=/^[ \t]*$/;var ad=new Set(["sh","bash","pwsh","powershell","cmd","runbook"]),ud={sh:"shellscript",bash:"shellscript",pwsh:"powershell",powershell:"powershell",cmd:"bat"},Ma={shellscript:"bash",powershell:"pwsh",bat:"cmd",runbook:"runbook"},PC=Object.keys(Ma);function lo(r){return ad.has(r)}function _s(r){return ud[r]??r}function Ga(r){return Ma[r]??r}var ld=/^([ \t]*)(`{3,}|~{3,})(.*)$/,Pa=/^[ \t]*(`{3,}|~{3,})[ \t]*$/;function _e(r){let e=ld.exec(r);if(!e)return null;let t=e[1]??"",n=e[2]??"",s=e[3]??"",i=n[0];return i==="`"&&s.includes("`")?null:{indent:t,char:i,len:n.length,info:s}}function Ke(r,e){let t=Pa.exec(r);if(!t)return!1;let n=t[1]??"";return n[0]===e.char&&n.length>=e.len}var Ha=/^(\s*)([^\s{]+)/;function nn(r){let e=Ha.exec(r);return e?(e[2]??"").toLowerCase():""}function _a(r,e){let t=Ha.exec(r);return t?(t[1]??"")+e+r.slice(t[0].length):e+r}function Ja(r,e){let t=0;for(let n of r){let i=Pa.exec(n)?.[1];i&&i[0]===e&&(t=Math.max(t,i.length))}return t}function co(r,e){if(e==="")return r;if(r.startsWith(e))return r.slice(e.length);let t=0;for(;t<e.length&&t<r.length&&(r[t]===" "||r[t]===" ");)t++;return r.slice(t)}function vn(r,e){return r===""?r:e+r}var cd=new RegExp(["(?:\\u001B\\]|\\u009D)[^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C)","[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"),"g");function Rt(r){return r.replace(cd,"")}var fd=/^\u001b\[([0-9;?]*)([ -/]*)([@-~])/,dd=/^\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)?/,pd=/[\r\b\u0000-\u0008\u000b-\u001a\u001c-\u001f\u007f]|\u001b\[[0-9;?]*[ -/]*[A-GJKsu]|\u001b[78]/;function Lr(r,e=""){if(!pd.test(r))return r;let t=[[]],n=[!1],s=[""],i="",o=0,B=0,a=[0,0],c=f=>{for(;t.length<=f;)t.push([]),n.push(!1),s.push("")},l=f=>{let d=t[o];for(;d.length<B;)d.push(" ");d[B]=i+f,i="",B++},u=(f,d)=>{let h=parseInt(f.split(";")[0]??"",10);return Number.isFinite(h)&&h>0?h:d};for(let f=0;f<r.length;){let d=r[f];if(d==="\x1B"){let h=r.slice(f,f+256),p=fd.exec(h);if(p){let[m,b,v,R]=p;if(f+=m.length,v!==""||b.startsWith("?")){R==="m"&&(i+=m);continue}let S=u(b,1);switch(R){case"A":o=Math.max(0,o-S);break;case"B":o+=S,c(o);break;case"C":B+=S;break;case"D":B=Math.max(0,B-S);break;case"E":o+=S,c(o),B=0;break;case"F":o=Math.max(0,o-S),B=0;break;case"G":B=S-1;break;case"K":{let I=u(b,0),x=t[o];if(I===0)x.length=Math.min(x.length,B);else if(I===1)for(let E=0;E<=B&&E<x.length;E++)x[E]=" ";else x.length=0;break}case"J":{let I=u(b,0);if(I===0)t[o].length=Math.min(t[o].length,B),t.length=o+1,n.length=o+1,s.length=o+1;else if(I===1){for(let x=0;x<o;x++)t[x]=[];for(let x=0;x<=B&&x<t[o].length;x++)t[o][x]=" "}break}case"s":a=[o,B];break;case"u":[o,B]=a,c(o);break;default:i+=m}continue}let w=dd.exec(h);if(w&&w[0].length>2){i+=w[0],f+=w[0].length;continue}let D=r[f+1];D==="7"?a=[o,B]:D==="8"&&([o,B]=a,c(o)),f+=D===void 0?1:2;continue}if(f++,d===`
|
|
20
|
+
`)s[o]+=i,i="",o++,c(o),B=0;else if(d==="\r")B=0;else if(d==="\b")B=Math.max(0,B-1);else if(e!==""&&d===e)n[o]=!0;else if(d===" ")l(d);else{if(d<" "||d==="\x7F")continue;d>="\uD800"&&d<="\uDBFF"&&f<r.length?l(d+r[f++]):l(d)}}return s[o]+=i,t.map((f,d)=>(n[d]?e:"")+f.join("")+s[d]).join(`
|
|
21
|
+
`)}var ja=[{level:"critical",words:["EMERGENCY","EMERG","ALERT","CRITICAL","CRIT","FATAL","PANIC"],capitalized:!0,colon:["fatal","panic","critical"],brackets:["fatal","fatl","ftl","crit","critical","emerg","alert"],klog:"F"},{level:"error",words:["ERROR","ERR","EROR","FAIL","FAILED","FAILURE","EE"],capitalized:!0,colon:["error","err"],brackets:["error","eror","err","er","e","fail","failed"],klog:"E",extra:["\\b[A-Za-z.]*Exception\\b","[\u2717\u2718]"]},{level:"warning",words:["WARNING","WARN","WRN","WW"],capitalized:!0,colon:["warning","warn"],brackets:["warning","warn","wrn","wn","w"],klog:"W"},{level:"info",words:["INFORMATIONAL","INFORMATION","INFO","NOTICE","HINT","II"],capitalized:!0,colon:["info","notice","hint"],brackets:["information","info","inf","in","i","notice"],klog:"I"},{level:"debug",words:["DEBUG_LOW","DEBUG_MED","DEBUG_HIGH","DEBUG_MAX","DBG_LOW","DBG_MED","DBG_HIGH","DBG_MAX","DEBUG","DBUG","DBG"],capitalized:!0,colon:["debug"],brackets:["debug","dbug","dbg","de","d"]},{level:"trace",words:["TRACE","VERBOSE","VRB"],capitalized:!0,colon:["trace","verbose"],brackets:["trace","verbose","verb","vrb","vb","v"]},{level:"success",words:["SUCCESSFUL","SUCCEEDED","SUCCESS","COMPLETED","PASSED","PASS","DONE","OK"],capitalized:!0,colon:["success","ok","done"],brackets:["success","ok","pass","passed","done"],extra:["[\u2713\u2714]"]}],hd=new Set(["ALERT","NOTICE","HINT","PASS","DONE","OK","EE","WW","II","ERR","EROR","CRIT","EMERG","WRN","DBUG","DBG","VRB"]),Ua=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Cd=r=>r[0]+r.slice(1).toLowerCase(),zC=new RegExp(ja.map(r=>{let e=[],t=[...r.words,...r.capitalized?r.words.filter(n=>!hd.has(n)&&!n.includes("_")).map(Cd):[]];return e.push(`\\b(?:${t.map(Ua).join("|")})\\b`),r.colon?.length&&e.push(`\\b(?:${r.colon.map(Ua).join("|")})(?=:)`),r.brackets?.length&&e.push(`\\[(?:${r.brackets.map(n=>n.split("").map(s=>`[${s.toLowerCase()}${s.toUpperCase()}]`).join("")).join("|")})\\]`),r.klog&&e.push(`^${r.klog}\\d{4} \\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?`),r.extra&&e.push(...r.extra),`(${e.join("|")})`}).join("|"),"gu");var or="\uE000";function fo(r){if(!r.includes(or))return{text:r,stderr:[]};let e=[];return{text:r.split(`
|
|
22
|
+
`).map((n,s)=>n.includes(or)?(e.push(s),n.split(or).join("")):n).join(`
|
|
23
|
+
`),stderr:e}}function po(r){let e=[...new Set(r)].sort((n,s)=>n-s),t=[];for(let n=0;n<e.length;){let s=n;for(;s+1<e.length&&e[s+1]===e[s]+1;)s++;t.push(n===s?`${e[n]+1}`:`${e[n]+1}-${e[s]+1}`),n=s+1}return t.join(",")}var Js=/^[ \t]*<!--[ \t]*md-runbook:output start\b(.*?)-->[ \t]*$/,ho=/^[ \t]*<!--[ \t]*md-runbook:output end[ \t]*-->[ \t]*$/,Ka=/^[ \t]*<details>[ \t]*<summary>[ \t]*md-runbook:[^<]*<\/summary>[ \t]*$/,za=/^[ \t]*<\/details>[ \t]*$/,gd=/([\w-]+)=(?:"([^"]*)"|(\S+))/g;function Nr(r){let e={};for(let t of r.matchAll(gd)){let n=t[1];n&&(e[n]=t[2]??t[3]??"")}return e}function qa(r){let e="";for(let[t,n]of Object.entries(r)){if(!/^[\w-]+$/.test(t))continue;let s=n.replace(/["\r\n]/g,"").replace(/-->/g,"--");e+=" "+t+"="+(s===""||/\s/.test(s)?`"${s}"`:s)}return e}function md(r){return`\u2026 [md-runbook: ${r} line${r===1?"":"s"} truncated] \u2026`}function Ya(r,e){if(e<=0)return r;let t=r.split(`
|
|
24
|
+
`);if(t.length<=e)return r;let n=Math.ceil(e/2),s=e-n,i=t.length-e;return[...t.slice(0,n),md(i),...t.slice(t.length-s)].join(`
|
|
25
|
+
`)}function Qa(r,e){let t=Lr(r.replace(/\r\n/g,`
|
|
26
|
+
`),or);e.stripAnsi&&(t=Rt(t)),e.redact&&(t=e.redact(t)),t=t.replace(/\n+$/,"");let n=fo(Ya(t,e.maxOutputLines));return{text:n.text,stderr:po(n.stderr)}}function Mr(r,e,t,n){let s=r===""?[]:sr(r).split(`
|
|
27
|
+
`),i="`".repeat(Math.max(3,Ed(s)+1));return[`<!-- md-runbook:output start${qa(e)} -->`,i+"text",...s,i,"<!-- md-runbook:output end -->"].map(B=>vn(B,t)).join(n)+n}function Ed(r){let e=0;for(let t of r){let n=/^[ \t]*(`+)/.exec(t);n?.[1]&&(e=Math.max(e,n[1].length))}return e}function Us(r){return`${(Math.max(0,r)/1e3).toFixed(3)}s`}function Ie(r){let e=s=>String(Math.abs(s)).padStart(2,"0"),t=-r.getTimezoneOffset(),n=t>=0?"+":"-";return`${r.getFullYear()}-${e(r.getMonth()+1)}-${e(r.getDate())}T${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}${n}${e(Math.trunc(t/60))}:${e(t%60)}`}function he(r){let e=r,t=!1;e.charCodeAt(0)===65279&&(t=!0,e=e.slice(1));let n=xn(e),s=Ps(n,`
|
|
28
|
+
`),i=[],o="",B=l=>{if(l.length===0)return;let u=0,f=l.length;for(;u<f&&ir.test(l[u].text);)u++;for(;f>u&&ir.test(l[f-1].text);)f--;if(u===f){let w=Nt(l),D=i[i.length-1];D?D.meta.trail+=w:o+=w;return}let d=l.slice(u,f),h=d.map(w=>w.text).join(`
|
|
29
|
+
`),p={kind:"markup",lead:o+Nt(l.slice(0,u)),content:Nt(d),trail:Nt(l.slice(f)),eol:Ps(d,s),finalEol:d[d.length-1].eol,value:h};o="",i.push({kind:"markup",value:h,languageId:"markdown",meta:p})},a=0,c=0;for(;c<n.length;){let l=_e(n[c].text);if(!l){c++;continue}let u=c+1;for(;u<n.length&&!Ke(n[u].text,l);)u++;if(u>=n.length)break;let f=nn(l.info);if(!lo(f)){c=u+1;continue}B(n.slice(a,c));let d=n[c],h=n.slice(c+1,u),p=h.map(v=>co(v.text,l.indent)).join(`
|
|
30
|
+
`),w={kind:"code",lead:o,open:d.text+d.eol,body:Nt(h),close:n[u].text+n[u].eol,trail:"",indent:l.indent,fenceChar:l.char,fenceLen:l.len,info:l.info,lang:f,eol:Ps([d,...h],s),value:p};o="";let D={kind:"code",value:p,languageId:_s(f),meta:w},m=u+1,b=Co(n,m);if(b){w.output=b.meta,D.output=b.output,m=b.end;let v=bd(n,m);v&&(w.history=v.meta,m=v.end)}i.push(D),c=m,a=m}return B(n.slice(a)),o!==""&&i.push({kind:"markup",value:"",languageId:"markdown",meta:{kind:"markup",lead:o,content:"",trail:"",eol:s,finalEol:"",value:""}}),{meta:{bom:t,eol:s},cells:i}}function Co(r,e){let t=e;for(;t<r.length&&ir.test(r[t].text);)t++;let n=r[t]?Js.exec(r[t].text):null;if(!n)return null;let s=t+1,i=r[s]?_e(r[s].text):null;if(!i)return null;let o=s+1;for(;o<r.length&&!Ke(r[o].text,i);)o++;let B=o+1;if(B>=r.length||!ho.test(r[B].text))return null;let a=r.slice(s+1,o).map(c=>co(c.text,i.indent)).join(`
|
|
31
|
+
`);return{meta:{raw:Nt(r.slice(e,B+1)),gap:Nt(r.slice(e,t))},output:{text:a,attrs:Nr(n[1]??"")},end:B+1}}function bd(r,e){let t=e;for(;t<r.length&&ir.test(r[t].text);)t++;if(!r[t]||!Ka.test(r[t].text))return null;let n=[],s=t+1;for(;;){let i=Co(r,s);if(!i)break;n.push({raw:i.meta.raw.slice(i.meta.gap.length),...i.output}),s=i.end}for(;s<r.length&&ir.test(r[s].text);)s++;return n.length===0||!r[s]||!za.test(r[s].text)?null:{meta:{raw:Nt(r.slice(e,s+1)),gap:Nt(r.slice(e,t)),entries:n},end:s+1}}function go(r){let e=xn(r),t=Co(e,0);return t&&t.end===e.length?t.output:null}function js(r){if(!r.output)return;let e=r.output.raw.slice(r.output.gap.length),t=go(e);return t?{raw:e,...t}:void 0}function Ks(r,e,t){return!r||t<=0?[]:[r,...e].slice(0,t)}function Dd(r){return`md-runbook: ${r} previous run${r===1?"":"s"}`}function mo(r,e,t){let n=vn(`<details><summary>${Dd(r.length)}</summary>`,e)+t;for(let s of r)n+=t,s.raw!==void 0?n+=Tr(s.raw)?s.raw:s.raw+t:n+=Mr(s.text,s.attrs,e,t);return n+t+vn("</details>",e)+t}var Gr=r=>String(r).padStart(2,"0");function Eo(r,e){let t=r.replace(/\.md$/i,""),n=`${e.getFullYear()}${Gr(e.getMonth()+1)}${Gr(e.getDate())}-${Gr(e.getHours())}${Gr(e.getMinutes())}${Gr(e.getSeconds())}`;return`${t}.${n}.md`}function zs(r,e,t){let n=Na(r)?r:{bom:!1,eol:`
|
|
32
|
+
`},s=n.eol,i="",o=!1,B=!1;for(let a of e){let c=sr(a.value),l=a.kind==="markup"?Ta(a.meta)?a.meta:void 0:ce(a.meta)?a.meta:void 0,u=l===void 0;i!==""&&!Tr(i)&&(i+=s);let f=B&&i!=="",d=a.kind==="markup"?vd(c,l,s,f):Sd(c,a.languageId,l,a.output,s,t,f);i!==""&&(u||o)&&!kd(i)&&!wd(d)&&(i+=s),i+=d,o=u,B=l!==void 0&&l.trail!==""}return(n.bom?"\uFEFF":"")+i}function wd(r){return/^[ \t]*(?:\r\n|\n|\r)/.test(r)}function kd(r){return/(?:\r\n|\n|\r)[ \t]*(?:\r\n|\n|\r)$/.test(r)||/^[ \t]*(?:\r\n|\n|\r)$/.test(r)}function Va(r,e,t=""){return r===""?"":r.split(`
|
|
33
|
+
`).map(n=>vn(n,t)).join(e)}function xd(r){let e=null;for(let t of r.split(`
|
|
34
|
+
`))e?Ke(t,e)&&(e=null):e=_e(t);return e?e.indent+e.char.repeat(e.len):""}function Wa(r,e,t){let n=xd(r);return Va(r,e)+(n===""?"":e+n)+t}function vd(r,e,t,n){if(!e)return r===""?"":Wa(r,t,t);let s=n?"":e.lead;if(r===e.value)return s+e.content+e.trail;let i=r===""?"":Wa(r,e.eol,e.finalEol);return s+i+e.trail}function Sd(r,e,t,n,s,i,o){let B=t!==void 0&&e!==void 0&&_s(t.lang)!==e,a=o?"":t?.lead??"";if(t&&!B&&r===t.value)a+=t.open+t.body+t.close;else{let l=t?.eol??s,u=t?.indent??"",f=t?.fenceChar??"`",d=t?.fenceLen??3,h=Math.max(d,Ja(r.split(`
|
|
35
|
+
`),f)+1),p=Ga(e??"shellscript"),w=u+f.repeat(h),D,m;if(t){let v=B?_a(t.info,p):t.info,R=Hs(t.open);D=h===d&&!B&&R!=="\r"?t.open:w+v+(R==="\r"?l:R||l),m=h===d?t.close:w+Hs(t.close)}else D=w+p+l,m=w+l;let b=r===""?"":Va(r,l,u)+l;a+=D+b+m}let c=yd(n,t,s,i);return c!==""&&(Tr(a)||(a+=t?.eol??s),a+=c),a+(t?.trail??"")}function yd(r,e,t,n){if(!r)return"";if(r.kind==="preserved")return e?.output?e.output.raw+(e.history?.raw??""):"";if(!n.persistOutputs)return"";let{text:s,stderr:i}=Qa(r.text,n),o=e?.eol??t,B=e?.indent??"",{stderr:a,...c}=r.attrs,l=i?{...c,stderr:i}:c,u=r.previous?{...l,changed:r.previous.text===s?"no":"yes"}:l,f=(e?.output?.gap??"")+Mr(s,u,B,o);return r.history?.length&&(f+=(e?.history?.gap??"")+mo(r.history,B,o)),f}function qs(r,e=!0){return r.cells.map(t=>({kind:t.kind,value:t.value,languageId:t.languageId,meta:t.meta,output:e&&t.output?{kind:"preserved"}:void 0}))}function Kt(r){let e=he(r);return zs(e.meta,qs(e,!1),Ia)}var Br="[REDACTED]",bo="password|passwd|pwd|secret|token|api[_-]?key|access[_-]?key|private[_-]?key|privatekey|client[_-]?key|credentials?|\\.key",Rd=`(?:\\$\\{[^}\\s]*\\}|\\$\\([^)\\r\\n]*\\)|\\$env:\\w+|%[A-Za-z_]\\w*%)(?![^\\s"',;&])`,Ys=`(?<!\\$\\{(?:secret|secretFile|input|param):)(?!(?:Bearer|Basic|Negotiate|true|false|null|none)\\b)(?!${Rd})`,Za="k8s-secret-data",Do=[{name:"pem-private-key",pattern:"(?<=-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----)[\\s\\S]+?(?=-----END [A-Z0-9 ]*PRIVATE KEY-----|$)"},{name:Za,pattern:"(?!)"},{name:"authorization-header",pattern:`(?<=\\b(?:Proxy-)?Authorization["']?[ \\t]*:[ \\t]*)[^\\s"'][^\\r\\n"']*|(?<=\\b(?:Proxy-)?Authorization["']?[ \\t]*=[ \\t]*)[^\\s"'][^\\r\\n"',;}&]*`,flags:"i"},{name:"cookie-header",pattern:`(?<=\\b(?:Set-)?Cookie["']?[ \\t]*[:=][ \\t]*)[^\\s"'][^\\r\\n"']*`,flags:"i"},{name:"bearer-token",pattern:"(?<=\\bBearer[ \\t]+)(?=[A-Za-z0-9\\-._~+/]*[0-9._~+/-])[A-Za-z0-9\\-._~+/]{8,}=*",flags:"i"},{name:"jwt",pattern:"\\beyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]{5,}(?:\\.[A-Za-z0-9_-]*)*"},{name:"secret-key-value-quoted",pattern:`(?<=\\b[\\w.-]*(?:${bo})[\\w.-]*["']?[ \\t]*[:=][ \\t]*")${Ys}[^"\\r\\n]+(?=")|(?<=\\b[\\w.-]*(?:${bo})[\\w.-]*["']?[ \\t]*[:=][ \\t]*')${Ys}[^'\\r\\n]+(?=')`,flags:"i"},{name:"secret-key-value",pattern:`(?<=\\b[\\w.-]*(?:${bo})[\\w.-]*["']?[ \\t]*[:=][ \\t]*["']?)${Ys}[^\\s"',;&}]+`,flags:"i"},{name:"pass-key-value",pattern:`(?<=(?:^|[^A-Za-z0-9])(?:[\\w.-]*[_.-])?pass["']?[ \\t]*[:=][ \\t]*["']?)${Ys}[^\\s"',;&}]+`,flags:"i"},{name:"secret-flag-value",pattern:`(?<=(?:^|\\s)--?(?:password|passwd|pass|secret|client-secret|token|api-key|apikey|access-key|secret-key)[ \\t]+)(?:"(?![$%])[^"\\r\\n]*"|'(?![$%])[^'\\r\\n]*'|(?![-$%])[^\\s"']+)|(?<=\\blogin\\b[^\\r\\n]*?\\s-p[ \\t]*)(?!-)[^\\s"']+|(?<=\\bmysql\\b[^\\r\\n]*?\\s-p)[^\\s"']+|(?<=(?:^|\\s)(?:-u|--user)[ \\t]+[^\\s:"']+:)[^\\s"']+`,flags:"i"},{name:"keycloak-client-secret",pattern:'(?<="type"[ \\t]*:[ \\t]*"secret"[ \\t]*,[ \\t]*"value"[ \\t]*:[ \\t]*")[^"]+|(?<=\\bsecret\\b[^\\r\\n]{0,40}?)\\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\b',flags:"i"},{name:"url-credentials",pattern:"(?<=\\b[a-z][a-z0-9+.-]*://[^/\\s:@]+:)[^/\\s@]+(?=@)",flags:"i"},{name:"base64-pem",pattern:"\\bLS0tLS1CRUdJTi[A-Za-z0-9+/=]+"},{name:"base64-dockerconfig",pattern:"\\beyJhdXRocyI6[A-Za-z0-9+/=]+"},{name:"openshift-token",pattern:"\\bsha256~[A-Za-z0-9_-]{20,}"},{name:"github-token",pattern:"\\bgh[pousr]_[A-Za-z0-9]{30,}"},{name:"gitlab-token",pattern:"\\bglpat-[A-Za-z0-9_-]{20,}"},{name:"npm-token",pattern:"\\bnpm_[A-Za-z0-9]{36}\\b"},{name:"anthropic-openai-key",pattern:"\\bsk-(?:ant-)?[A-Za-z0-9_-]{20,}"},{name:"slack-token",pattern:"\\bxox[abposr]-[A-Za-z0-9-]{10,}"},{name:"gcp-api-key",pattern:"\\bAIza[0-9A-Za-z_-]{35}\\b"},{name:"gcp-oauth-token",pattern:"\\bya29\\.[0-9A-Za-z_-]{20,}"},{name:"azure-storage-key",pattern:"(?<=\\b(?:AccountKey|SharedAccessKey)=)[A-Za-z0-9+/=]{20,}",flags:"i"},{name:"azure-sas-signature",pattern:"(?<=[?&]sig=)[A-Za-z0-9%+/=]{20,}"},{name:"aws-access-key-id",pattern:"\\b(?:AKIA|ASIA)[0-9A-Z]{16}\\b"}];function Od(r){if(!/["']?kind["']?[ \t]*:[ \t]*["']?Secret\b/.test(r))return r;let e=r.replace(/^([ \t]*)(data|stringData):[ \t]*(\r?\n)((?:\1[ \t]+[^\r\n]*(?:\r?\n|$))+)/gm,(t,n,s,i,o)=>{let B=o.replace(/^([ \t]+[^\s:#][^:\r\n]*:[ \t]*)(?:\|[-+]?|>[-+]?)?[ \t]*(\S[^\r\n]*)?$/gm,(a,c,l)=>l===void 0||l.startsWith("[REDACTED]")?a:`${c}${Br}`);return`${n}${s}:${i}${B}`});return e=e.replace(/("(?:data|stringData)"[ \t]*:[ \t]*\{)([^{}]*)(\})/g,(t,n,s,i)=>n+s.replace(/("[^"\r\n]+"[ \t]*:[ \t]*)"[^"]*"/g,`$1"${Br}"`)+i),e}function Ad(r){let e=new Set((r??"").replace(/[gy]/g,"").split(""));return e.add("g"),[...e].join("")}function Fd(r){let e=typeof r=="string"?{pattern:r}:r;return new RegExp(e.pattern,Ad(e.flags))}function wo(r){let e=[],t=[],n=!1;for(let s of r){if(typeof s!="string"&&s.name===Za){n=!0;continue}try{e.push(Fd(s))}catch(i){let o=typeof s=="string"?s:s.name??s.pattern;t.push(`${o}: ${i instanceof Error?i.message:String(i)}`)}}return{errors:t,redact(s){let i=n?Od(s):s;for(let o of e)o.lastIndex=0,i=i.replace(o,B=>B===""?B:Br);return i}}}var $d=/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----(?![\s\S]*-----END [A-Z0-9 ]*PRIVATE KEY-----)/,Sn=class{constructor(e,t=i=>i,n=64*1024,s=256*1024){this.emit=e;this.transform=t;this.maxPending=n;this.maxHeld=s}emit;transform;maxPending;maxHeld;pending="";held="";write(e){this.pending+=e;let t=this.pending.lastIndexOf(`
|
|
36
|
+
`);if(t>=0&&(this.held+=this.pending.slice(0,t+1),this.pending=this.pending.slice(t+1),(!$d.test(this.held)||this.held.length>this.maxHeld)&&this.release(this.held)),this.pending.length>this.maxPending){let n=Math.max(this.pending.lastIndexOf(" "),this.pending.lastIndexOf(" ")),s=n>0?n+1:this.pending.length,i=this.pending.slice(0,s);this.pending=this.pending.slice(s),this.release(this.held+i)}}flush(){this.release(this.held+this.pending),this.pending=""}release(e){this.held="",e!==""&&this.emit(this.transform(e))}};function $e(r){switch(r.toLowerCase()){case"sh":case"bash":case"shellscript":return"bash";case"pwsh":case"powershell":return"pwsh";case"cmd":case"bat":return"cmd";default:return}}var Pr=["bash","zsh","sh"],Hr=["pwsh","windows-powershell"];function _r(r){let e={},t=[],n=[],s=r.replace(/^\s*\[|\]\s*$/g,"").split(/[\s,]+/).map(i=>i.replace(/^["']|["']$/g,"")).filter(Boolean);for(let i of s){let o=i.toLowerCase();Pr.includes(o)?e.unix?n.push(i):e.unix=o:Hr.includes(o)?e.powershell?n.push(i):e.powershell=o:t.push(i)}return{shells:e,unknown:t,twice:n}}function Jr(r){return r.timedOut?"timeout":r.cancelled?"cancelled":r.error!==void 0?"error":r.exitCode!==null?String(r.exitCode):r.signal??"unknown"}function ar(r){return!r.timedOut&&!r.cancelled&&r.error===void 0&&r.exitCode===0}var yn=class{constructor(e,t){this.emit=t;this.needle=""+e+" "}emit;pending="";needle;code;get done(){return this.code!==void 0}write(e){if(this.done)return;let t=this.pending+e,n=t.indexOf(this.needle);if(n>=0){this.send(t.slice(0,n)),t=t.slice(n);let o=t.indexOf(`
|
|
37
|
+
`);if(o>=0){let B=Number.parseInt(t.slice(this.needle.length,o),10);this.code=Number.isNaN(B)?1:B,t=""}this.pending=t;return}let s=t.lastIndexOf(""),i=s>=0&&this.needle.startsWith(t.slice(s))?s:t.length;this.send(t.slice(0,i)),this.pending=t.slice(i)}flush(){this.send(this.pending),this.pending=""}send(e){e!==""&&this.emit(e)}};function Qs(r,e=!1,t){return r===void 0||r==="running"||r==="declined"||r==="unanswered"||r==="proposed"?"pending":t==="failed"?"failed":t==="ok"||r==="0"||r==="done"?e?"pending":"done":r==="skipped"?"skipped":"failed"}var Id=/^[ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]+\[([ xX])\](?=[ \t]|$)/;function Ur(r){let e=[],t=null,n=0;return r.split(`
|
|
38
|
+
`).forEach((s,i)=>{let o=s.endsWith("\r")?s.slice(0,-1):s;if(t)Ke(o,t)&&(t=null);else if((t=_e(o))===null){let B=Id.exec(o);B&&e.push({line:i,offset:n+B[0].length-2,checked:B[1]!==" "})}n+=s.length+1}),e}function Ws(r){return r.match(/\r\n|\n|\r/g)?.length??0}function ft(r){let e=[],t=0;return r.cells.forEach((n,s)=>{let i=n.meta;if(ce(i)){let o=t+Ws(i.lead);e.push({cellIndex:s,line:o,closeLine:o+1+Ws(i.body),language:i.lang,info:i.info,source:n.value,outputAttrs:n.output?.attrs}),t+=Ws(i.lead+i.open+i.body+i.close+(i.output?.raw??"")+(i.history?.raw??"")+i.trail)}else t+=Ws(i.lead+i.content+i.trail)}),e}function Rn(r,e,t,n){let s=he(r);if(s.cells[e]?.kind!=="code")return;let i=qs(s);return i[e].output=t,zs(s.meta,i,n)}function Xa(r){let e=r.exit??"?";return r.check==="failed"?"failed":e==="0"||e==="done"||r.check==="ok"&&/^-?\d+$/.test(e)?"ok":["skipped","declined","proposed","running"].includes(e)?"neutral":"failed"}function ko(r,e=new Date){let t=r.exit??"?",s=[`${{ok:"\u2713",failed:"\u2717",neutral:"\u2013"}[Xa(r)]} ${/^-?\d+$/.test(t)?`exit ${t}`:t}`];r.ready!==void 0&&s.push(r.ready==="up"?"ready: already up":"ready: not up"),r.check==="failed"&&s.push("check failed"),r.attempts&&s.push(`${r.attempts} attempts`),r.lines&&s.push(`lines ${r.lines}`);let i=r.duration?parseFloat(r.duration):NaN;isNaN(i)||s.push(i<60?`${i.toFixed(1)}s`:`${Math.floor(i/60)}m${Math.round(i%60)}s`);let o=Date.parse(r.ended??r.ran??"");return isNaN(o)||s.push(Td(e.getTime()-o)),s.join(" \xB7 ")}function Td(r){let e=Math.max(0,Math.round(r/1e3));return e<60?"just now":e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}function re(r){return r.replace(/[&<>"']/g,e=>`&${{"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#39"}[e]};`)}function tu(r){if(/[\x00-\x20\x7f]/.test(r)||/^[\\/]{2}/.test(r))return;let e=/^([^/?#]*?):/.exec(r);if(!(e&&!/^(https?|mailto)$/i.test(e[1])))return r}var nu=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/,ru=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,Kr=/^([ \t]*)([-*+]|(\d{1,9})[.)])([ \t]+|$)(.*)$/,xo=/^ {0,3}> ?(.*)$/,Ld=/^[ \t]*\|?[ \t]*:?-+:?[ \t]*(\|[ \t]*:?-+:?[ \t]*)*\|?[ \t]*$/,ur=/^[ \t]*$/;function jr(r){let e=0;for(let t of r)e+=t===" "?4-e%4:1;return e}function Zs(r,e){return`<div class="code">${e?`<span class="lang">${re(e)}</span>`:""}<pre><code>${re(r)}</code></pre></div>
|
|
39
|
+
`}var Vs=r=>r;function vo(r,e){let t=Vs;Vs=e??(n=>n);try{return So(sr(r).split(`
|
|
40
|
+
`))}finally{Vs=t}}function su(r){return nu.test(r)||ru.test(r)||xo.test(r)||_e(r)!==null||/^[ \t]*<!--/.test(r)}function So(r){let e="",t=0;for(;t<r.length;){let n=r[t];if(ur.test(n)){t++;continue}if(/^[ \t]*<!--/.test(n)){for(;t<r.length&&!r[t].includes("-->");)t++;t++;continue}let s=_e(n);if(s){let c=t+1;for(;c<r.length&&!Ke(r[c],s);)c++;let l=u=>u.replace(new RegExp(`^[ \\t]{0,${s.indent.length}}`),"");e+=Zs(Vs(r.slice(t+1,c).map(l).join(`
|
|
41
|
+
`)),nn(s.info)),t=c+1;continue}let i=nu.exec(n);if(i){let c=i[1].length;e+=`<h${c}>${rn(i[2]??"")}</h${c}>
|
|
42
|
+
`,t++;continue}if(ru.test(n)){e+=`<hr>
|
|
43
|
+
`,t++;continue}if(xo.test(n)){let c=[];for(;t<r.length&&!ur.test(r[t]);){let l=xo.exec(r[t]);c.push(l?l[1]:r[t]),t++}e+=`<blockquote>
|
|
44
|
+
${So(c)}</blockquote>
|
|
45
|
+
`;continue}if(Kr.test(n)){let c=Nd(r,t);e+=c.html,t=c.end;continue}if(n.includes("|")&&t+1<r.length&&Ld.test(r[t+1])&&r[t+1].includes("-")){let c=[n],l=t+2;for(;l<r.length&&!ur.test(r[l])&&r[l].includes("|");)c.push(r[l++]);e+=Gd(c),t=l;continue}let o=[];for(;t<r.length&&!ur.test(r[t])&&(o.length===0||!su(r[t])&&!Kr.test(r[t]));)o.push(r[t]),t++;let B=c=>/ {2,}$|\\$/.test(c),a=o.map((c,l)=>rn(c.trim().replace(/\\$/,""))+(l===o.length-1?"":B(c)?`<br>
|
|
46
46
|
`:`
|
|
47
47
|
`));e+=`<p>${a.join("")}</p>
|
|
48
|
-
`}return e}function
|
|
49
|
-
`;for(let
|
|
50
|
-
`);c+=`<li${
|
|
51
|
-
`}return{html:c+`</${
|
|
52
|
-
`,end:
|
|
53
|
-
<thead><tr>`+e(t).map(i=>`<th>${
|
|
48
|
+
`}return e}function Nd(r,e){let t=Kr.exec(r[e]),n=jr(t[1]),s=t[3]!==void 0,i=[],o=e;for(;o<r.length;){let l=Kr.exec(r[o]);if(l&&jr(l[1])<=n+1&&l[3]!==void 0===s){let u=jr(l[1]+l[2]+(l[4]||" ")),f=[l[5]];for(o++;o<r.length;){let d=r[o];if(ur.test(d)){let p=o;for(;p<r.length&&ur.test(r[p]);)p++;if(p<r.length&&jr(/^[ \t]*/.exec(r[p])[0])>=u){for(;o<p;)f.push(r[o++].trim());continue}break}if(jr(/^[ \t]*/.exec(d)[0])>=u)f.push(Md(d,u));else if(!Kr.test(d)&&!su(d))f.push(d.trim());else break;o++}i.push(f);continue}break}let B=s?"ol":"ul",a=s&&t[3]!=="1"?` start="${parseInt(t[3],10)}"`:"",c=`<${B}${a}>
|
|
49
|
+
`;for(let l of i){let u=/^\[([ xX])\][ \t]+/.exec(l[0]);u&&(l[0]=l[0].slice(u[0].length));let f=u?`<input type="checkbox" disabled${u[1]===" "?"":" checked"}> `:"",d=l.length===1?rn(l[0]):So(l).replace(/^<p>([\s\S]*?)<\/p>\n/,`$1
|
|
50
|
+
`);c+=`<li${u?' class="task"':""}>${f}${d}</li>
|
|
51
|
+
`}return{html:c+`</${B}>
|
|
52
|
+
`,end:o}}function Md(r,e){let t=0,n=0;for(;n<r.length&&t<e&&(r[n]===" "||r[n]===" ");)t+=r[n]===" "?4-t%4:1,n++;return r.slice(n)}function Gd(r){let e=i=>i.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,"").split(/(?<!\\)\|/).map(o=>o.trim().replace(/\\\|/g,"|")),[t,...n]=r,s=`<table>
|
|
53
|
+
<thead><tr>`+e(t).map(i=>`<th>${rn(i)}</th>`).join("")+`</tr></thead>
|
|
54
54
|
<tbody>
|
|
55
|
-
`;for(let i of n)s+="<tr>"+e(i).map(
|
|
55
|
+
`;for(let i of n)s+="<tr>"+e(i).map(o=>`<td>${rn(o)}</td>`).join("")+`</tr>
|
|
56
56
|
`;return s+`</tbody>
|
|
57
57
|
</table>
|
|
58
|
-
`}function
|
|
59
|
-
`,10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["'",39],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["`",96],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]]);static toUpperCase(r){if(r<Fr)return oB[r];let e=String.fromCodePoint(r).toUpperCase(),t=e.codePointAt(0)>Ls?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),s=n.codePointAt(0)>Ls?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}static toLowerCase(r){if(r<Fr)return aB[r];let e=String.fromCodePoint(r).toLowerCase(),t=e.codePointAt(0)>Ls?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),s=n.codePointAt(0)>Ls?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}},p=class{constructor(r,e=!1){this.data=r,this.isStride1=e,this.SIZE=e?2:3}getLo(r){return this.data[r*this.SIZE]}getHi(r){return this.data[r*this.SIZE+1]}getStride(r){return this.isStride1?1:this.data[r*this.SIZE+2]}get length(){return this.data.length/this.SIZE}},qa=new Uint8Array(256);for(let r=0,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";r<64;r++)qa[e.charCodeAt(r)]=r;var Wa=r=>{let e=[],t=0,n=0;for(let s=0;s<r.length;s++){let i=qa[r.charCodeAt(s)];t|=(i&31)<<n,(i&32)===0?(e.push(t),t=0,n=0):n+=5}return e},g=(r,e)=>{let t=Wa(r),n=e?t.length/2:t.length/3,s=new Uint32Array(n*3),i=0,B=0;for(let o=0;o<n;o++)i+=t[B++],s[o*3]=i,i+=t[B++],s[o*3+1]=i,s[o*3+2]=e?1:t[B++];return s},Rf=r=>{let e=Wa(r),t=new Map,n=0;for(let s=0;s<e.length;s+=2){n+=e[s];let i=e[s+1],B=i>>>1^-(i&1);t.set(n,n+B)}return t},$s=class{constructor(r){this.initializer=r,this.cache=new Map}has(r){return r in this.initializer}get(r){if(this.cache.has(r))return this.cache.get(r);let e=this.initializer[r],t=e?e():null;return this.cache.set(r,t),t}},tt=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=Rf("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-B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Uppercase:()=>new p(g("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBGbbBOBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new p(g("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static get Upper(){return this.CATEGORIES.get("Lu")}static SCRIPTS=new $s({Adlam:()=>new p(g("go6DrCFJFB",!0)),Ahom:()=>new p(g("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new p(g("ggxCmS",!0)),Arabic:()=>new p(g("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new p(g("xpBlBDxBDCks9BE",!0)),Avestan:()=>new p(g("g4iC1BEG",!0)),Balinese:()=>new p(g("g4GsCCxB",!0)),Bamum:()=>new p(g("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new p(g("w26CdDF",!0)),Batak:()=>new p(g("g+GzBJD",!0)),Bengali:()=>new p(g("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new p(g("g17CYDY",!0)),Bhaiksuki:()=>new p(g("ggnCICsBCNLc",!0)),Bopomofo:()=>new p(g("qXB6wLqBxDf",!0)),Brahmi:()=>new p(g("ggkCtCFjBKA",!0)),Braille:()=>new p(g("ggK-H",!0)),Buginese:()=>new p(g("gwGbDB",!0)),Buhid:()=>new p(g("g6FT",!0)),Canadian_Aboriginal:()=>new p(g("ggF-TxRlC7tgCP",!0)),Carian:()=>new p(g("g1gCwB",!0)),Caucasian_Albanian:()=>new p(g("wphCzBMA",!0)),Chakma:()=>new p(g("gokC0BCR",!0)),Cham:()=>new p(g("gwqB2BKNDJDD",!0)),Cherokee:()=>new p(g("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new p(g("w9jCb",!0)),Common:()=>new p(g("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new p(g("ifNxkKzDGG",!0)),Cuneiform:()=>new p(g("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new p(g("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new p(g("w8rCiD",!0)),Cyrillic:()=>new p(g("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new p(g("gghCvC",!0)),Devanagari:()=>new p(g("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new p(g("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new p(g("ggmC7B",!0)),Duployan:()=>new p(g("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new p(g("ggsC1iBL68D",!0)),Elbasan:()=>new p(g("gohCnB",!0)),Elymaic:()=>new p(g("g-jCW",!0)),Ethiopic:()=>new p(g("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new p(g("gqjClBEcJB",!0)),Georgian:()=>new p(g("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new p(g("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new p(g("w5gCa",!0)),Grantha:()=>new p(g("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new p(g("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new p(g("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new p(g("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new p(g("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new p(g("go4C5B",!0)),Han:()=>new p(g("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new p(g("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new p(g("gojCnBJJ",!0)),Hanunoo:()=>new p(g("g5FU",!0)),Hatran:()=>new p(g("gniCSCBGE",!0)),Hebrew:()=>new p(g("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new p(g("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new p(g("giiCVCI",!0)),Inherited:()=>new p(g("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new p(g("g7iCSGH",!0)),Inscriptional_Parthian:()=>new p(g("g6iCVDH",!0)),Javanese:()=>new p(g("gsqBtCDJFB",!0)),Kaithi:()=>new p(g("gkkCiCLA",!0)),Kannada:()=>new p(g("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new p(g("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new p(g("g4nCQCoBEc",!0)),Kayah_Li:()=>new p(g("goqBtBCA",!0)),Kharoshthi:()=>new p(g("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new p(g("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new p(g("g8F9CDJHJnPf",!0)),Khojki:()=>new p(g("gwkCRCuB",!0)),Khudawadi:()=>new p(g("w1kC6BGJ",!0)),Kirat_Rai:()=>new p(g("gq7C5B",!0)),Lao:()=>new p(g("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new p(g("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new p(g("ggH3BEOEC",!0)),Limbu:()=>new p(g("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new p(g("gwhC2JKVLH",!0)),Linear_B:()=>new p(g("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new p(g("wmpBvBx1eA",!0)),Lycian:()=>new p(g("g0gCc",!0)),Lydian:()=>new p(g("gpiCZGA",!0)),Mahajani:()=>new p(g("wqkCmB",!0)),Makasar:()=>new p(g("g3nCY",!0)),Malayalam:()=>new p(g("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new p(g("giCbDA",!0)),Manichaean:()=>new p(g("g2iCmBFL",!0)),Marchen:()=>new p(g("wjnCfDVCN",!0)),Masaram_Gondi:()=>new p(g("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new p(g("gy7C6C",!0)),Meetei_Mayek:()=>new p(g("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new p(g("gg6DkGDP",!0)),Meroitic_Cursive:()=>new p(g("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new p(g("gsiCf",!0)),Miao:()=>new p(g("g47CqCF4BIQ",!0)),Modi:()=>new p(g("gwlCkCMJ",!0)),Mongolian:()=>new p(g("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new p(g("gy6CeCJFB",!0)),Multani:()=>new p(g("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new p(g("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new p(g("gkiCeJI",!0)),Nag_Mundari:()=>new p(g("wm5DpB",!0)),Nandinagari:()=>new p(g("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new p(g("gsGrBFZHKEB",!0)),Newa:()=>new p(g("gglC7CCE",!0)),Nko:()=>new p(g("g+B6BDC",!0)),Nushu:()=>new p(g("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new p(g("go4DsBENDJFB",!0)),Ogham:()=>new p(g("g0Fc",!0)),Ol_Chiki:()=>new p(g("wiHvB",!0)),Ol_Onal:()=>new p(g("wu5DqBFA",!0)),Old_Hungarian:()=>new p(g("gkjCyBOyBIF",!0)),Old_Italic:()=>new p(g("g4gCjBKC",!0)),Old_North_Arabian:()=>new p(g("g0iCf",!0)),Old_Permic:()=>new p(g("w6gCqB",!0)),Old_Persian:()=>new p(g("g9gCjBFN",!0)),Old_Sogdian:()=>new p(g("g4jCnB",!0)),Old_South_Arabian:()=>new p(g("gziCf",!0)),Old_Turkic:()=>new p(g("ggjCoC",!0)),Old_Uyghur:()=>new p(g("w7jCZ",!0)),Oriya:()=>new p(g("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new p(g("wlhCjBFjB",!0)),Osmanya:()=>new p(g("gkhCdDJ",!0)),Pahawh_Hmong:()=>new p(g("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new p(g("gjiCf",!0)),Pau_Cin_Hau:()=>new p(g("g2mC4B",!0)),Phags_Pa:()=>new p(g("giqB3B",!0)),Phoenician:()=>new p(g("goiCbEA",!0)),Psalter_Pahlavi:()=>new p(g("g8iCRIDNG",!0)),Rejang:()=>new p(g("wpqBjBMA",!0)),Runic:()=>new p(g("g1FqCEK",!0)),Samaritan:()=>new p(g("ggCtBDO",!0)),Saurashtra:()=>new p(g("gkqBlCJL",!0)),Sharada:()=>new p(g("gskC-ChsCH",!0)),Shavian:()=>new p(g("wihCvB",!0)),Siddham:()=>new p(g("gslC1BDlB",!0)),Sidetic:()=>new p(g("gqiCZ",!0)),SignWriting:()=>new p(g("gg2DrUQECO",!0)),Sinhala:()=>new p(g("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new p(g("w5jCpB",!0)),Sora_Sompeng:()=>new p(g("wmkCYIJ",!0)),Soyombo:()=>new p(g("wymCyC",!0)),Sundanese:()=>new p(g("g8G-BhIH",!0)),Sunuwar:()=>new p(g("g+mChBPJ",!0)),Syloti_Nagri:()=>new p(g("ggqBsB",!0)),Syriac:()=>new p(g("g4BNC7BDCxIK",!0)),Tagalog:()=>new p(g("g4FVKA",!0)),Tagbanwa:()=>new p(g("g7FMCCCB",!0)),Tai_Le:()=>new p(g("wqGdDE",!0)),Tai_Tham:()=>new p(g("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new p(g("g0qBiCZE",!0)),Tai_Yo:()=>new p(g("g25DeCVJB",!0)),Takri:()=>new p(g("g0lC5BHJ",!0)),Tamil:()=>new p(g("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new p(g("wz6CuCCJ",!0)),Tangut:()=>new p(g("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new p(g("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new p(g("g8BxB",!0)),Thai:()=>new p(g("hwD5BGb",!0)),Tibetan:()=>new p(g("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new p(g("wpL3BIBPA",!0)),Tirhuta:()=>new p(g("gklCnCJJ",!0)),Todhri:()=>new p(g("guhCzB",!0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GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new p(g("gopBrJ",!0)),Vithkuqi:()=>new p(g("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new p(g("g24D5BGA",!0)),Warang_Citi:()=>new p(g("glmCyCNA",!0)),Yezidi:()=>new p(g("g0jCpBCCDB",!0)),Yi:()=>new p(g("ggoBskBE2B",!0)),Zanabazar_Square:()=>new p(g("gwmCnC",!0))});static FOLD_CATEGORIES=new $s({L:()=>new p(g("laA",!0)),LC:()=>new p(g("laA",!0)),Ll:()=>new p(g("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Lt:()=>new p(g("kOCCBCCBCClBCCtsHH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B",!1)),Uppercase:()=>new p(g("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new $s({Common:()=>new p(g("8cgBgB",!1)),Greek:()=>new p(g("1FwUwU",!1)),Inherited:()=>new p(g("5cgBgBlgHAB",!1))})},j=class je{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(e){return e===je.RUNE_ERROR||e>=je.MIN_HIGH_SURROGATE&&e<=je.MAX_LOW_SURROGATE}static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static MIN_HIGH_SURROGATE=55296;static MAX_HIGH_SURROGATE=56319;static MIN_LOW_SURROGATE=56320;static MAX_LOW_SURROGATE=57343;static MIN_SUPPLEMENTARY_CODE_POINT=65536;static is32(e,t){let n=0,s=e.length;for(;n<s;){let i=n+Math.floor((s-n)/2),B=e.getLo(i),o=e.getHi(i);if(B<=t&&t<=o){let a=e.getStride(i);return(t-B)%a===0}t<B?s=i:n=i+1}return!1}static is(e,t){if(t<=je.MAX_LATIN1){for(let n=0;n<e.length;n++){if(t>e.getHi(n))continue;let s=e.getLo(n);if(t<s)return!1;let i=e.getStride(n);return(t-s)%i===0}return!1}return e.length>0&&t>=e.getLo(0)&&je.is32(e,t)}static isUpper(e){if(e<=je.MAX_LATIN1){let t=String.fromCodePoint(e);return t.toUpperCase()===t&&t.toLowerCase()!==t}return je.is(tt.Upper,e)}static isPrint(e){return e<=je.MAX_LATIN1?e>=32&&e<je.MAX_ASCII||e>=161&&e!==173:je.is(tt.Print,e)}static simpleFold(e){if(tt.CASE_ORBIT.has(e))return tt.CASE_ORBIT.get(e);if(e<=je.MAX_ASCII){let t=T.toLowerCase(e);return t!==e?t:T.toUpperCase(e)}return e}static equalsIgnoreCase(e,t){if(e===t)return!0;if(e<0||t<0)return!1;if(e<=je.MAX_ASCII&&t<=je.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=t&&t<=90&&(t|=32),e===t;for(let n=je.simpleFold(e);n!==e;n=je.simpleFold(n))if(n===t)return!0;return!1}},cB=256,Va=new Uint8Array(cB);for(let r=0;r<cB;r++)Va[r]=97<=r&&r<=122||65<=r&&r<=90||48<=r&&r<=57||r===95?1:0;var rB=null,sB=null,U=class Bt{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isByteArray(e){return Array.isArray(e)||Object.prototype.toString.call(e)==="[object Uint8Array]"}static isalnum(e){return T.CODES.get("0")<=e&&e<=T.CODES.get("9")||T.CODES.get("a")<=e&&e<=T.CODES.get("z")||T.CODES.get("A")<=e&&e<=T.CODES.get("Z")}static unhex(e){return T.CODES.get("0")<=e&&e<=T.CODES.get("9")?e-T.CODES.get("0"):T.CODES.get("a")<=e&&e<=T.CODES.get("f")?e-T.CODES.get("a")+10:T.CODES.get("A")<=e&&e<=T.CODES.get("F")?e-T.CODES.get("A")+10:-1}static escapeRune(e){let t="";if(j.isPrint(e))Bt.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(t+="\\"),t+=String.fromCodePoint(e);else switch(e){case T.CODES.get('"'):t+='\\"';break;case T.CODES.get("\\"):t+="\\\\";break;case T.CODES.get(" "):t+="\\t";break;case T.CODES.get(`
|
|
60
|
-
`):t+="\\n";break;case T.CODES.get("\r"):t+="\\r";break;case T.CODES.get("\b"):t+="\\b";break;case T.CODES.get("\f"):t+="\\f";break;default:{let n=e.toString(16);e<256?(t+="\\x",n.length===1&&(t+="0"),t+=n):t+=`\\x{${n}}`;break}}return t}static stringToRunes(e){let t=String(e),n=[],s=0;for(;s<t.length;){let i=t.codePointAt(s);n.push(i),s+=i>j.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<cB?Va[e]===1:!1}static emptyOpContext(e,t){let n=0;return e<0&&(n|=Bt.EMPTY_BEGIN_TEXT|Bt.EMPTY_BEGIN_LINE),e===10&&(n|=Bt.EMPTY_BEGIN_LINE),t<0&&(n|=Bt.EMPTY_END_TEXT|Bt.EMPTY_END_LINE),t===10&&(n|=Bt.EMPTY_END_LINE),Bt.isWordRune(e)!==Bt.isWordRune(t)?n|=Bt.EMPTY_WORD_BOUNDARY:n|=Bt.EMPTY_NO_WORD_BOUNDARY,n}static quoteMeta(e){return e.split("").map(t=>Bt.METACHARACTERS.indexOf(t)>=0?`\\${t}`:t).join("")}static charCount(e){return e>j.MAX_BMP?2:1}static toArray(e){let t=e.length,n=new Array(t);for(let s=0;s<t;s++)n[s]=e[s];return n}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return rB||(rB=new TextEncoder),rB.encode(e);{let t=[],n=0;for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===j.MIN_HIGH_SURROGATE&&s+1<e.length&&(e.charCodeAt(s+1)&64512)===j.MIN_LOW_SURROGATE?(i=j.MIN_SUPPLEMENTARY_CODE_POINT+((i&1023)<<10)+(e.charCodeAt(++s)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){sB||(sB=new TextDecoder("utf-8"));let t=e instanceof Uint8Array?e:new Uint8Array(e);return sB.decode(t)}else{let t=[],n=0,s=0;for(;n<e.length;){let i=e[n++];if(i<128)t[s++]=String.fromCharCode(i);else if(i>191&&i<224){let B=e[n++];t[s++]=String.fromCharCode((i&31)<<6|B&63)}else if(i>239&&i<365){let B=e[n++],o=e[n++],a=e[n++],c=((i&7)<<18|(B&63)<<12|(o&63)<<6|a&63)-j.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(j.MIN_HIGH_SURROGATE+(c>>10)),t[s++]=String.fromCharCode(j.MIN_LOW_SURROGATE+(c&1023))}else{let B=e[n++],o=e[n++];t[s++]=String.fromCharCode((i&15)<<12|(B&63)<<6|o&63)}}return t.join("")}}},Za=(r=[],e=0)=>{let t=Object.create(null);for(let n=0;n<r.length;n++){let s=r[n],i=e+n;t[s]=i,t[i]=s}return Object.freeze(t)},gn=class lB{static Encoding=Za(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===lB.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===lB.Encoding.UTF_16}},wa=class extends gn{constructor(r=null){super(),this.bytes=r}getEncoding(){return gn.Encoding.UTF_8}asCharSequence(){return U.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},Ff=class extends gn{constructor(r=null){super(),this.charSequence=r}getEncoding(){return gn.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return U.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},pn=class{static utf16(r){return new Ff(r)}static utf8(r){return U.isByteArray(r)?new wa(r):new wa(U.stringToUtf8ByteArray(r))}},We=class{static EOF(){return-8}constructor(){this.end=0}canCheckPrefix(){return!0}endPos(){return this.end}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},If=class _n extends We{static RUNE_ERROR_STEP=j.RUNE_ERROR<<3|1;constructor(e,t=0,n=e.length){super(),this.bytes=e,this.start=t,this.end=n}hasString(e,t){let n=e.bytes;if(n.length===0)return!0;let s=this.indexOf(this.bytes,n,this.start+t);return s!==-1&&s<=this.end-n.length}hasAnyString(e,t){return e.automaton8().searchUTF8(this.bytes,this.start+t,this.end)}step(e){if(e+=this.start,e>=this.end)return We.EOF();let t=this.bytes[e]&255;if(t<128)return t<<3|1;let n,s,i=128,B=191;if(t>=194&&t<=223)n=2,s=t&31;else if(t>=224&&t<=239)n=3,s=t&15,t===224?i=160:t===237&&(B=159);else if(t>=240&&t<=244)n=4,s=t&7,t===240?i=144:t===244&&(B=143);else return _n.RUNE_ERROR_STEP;if(e+n>this.end)return _n.RUNE_ERROR_STEP;let o=this.bytes[e+1]&255;if(o<i||o>B)return _n.RUNE_ERROR_STEP;if(s=s<<6|o&63,n>2){let a=this.bytes[e+2]&255;if((a&192)!==128)return _n.RUNE_ERROR_STEP;if(s=s<<6|a&63,n>3){let c=this.bytes[e+3]&255;if((c&192)!==128)return _n.RUNE_ERROR_STEP;s=s<<6|c&63}}return s<<3|n}index(e,t){t+=this.start;let n=this.indexOf(this.bytes,e.prefixUTF8,t);return n<0?n:n-t}context(e){e+=this.start;let t=-1;if(e>this.start&&e<=this.end){let s=e-1;if(t=this.bytes[s--],t>=128){let i=e-4;for(i<this.start&&(i=this.start);s>=i&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start);let B=this.step(s-this.start);t=s+(B&7)===e?B>>3:j.RUNE_ERROR}}let n=e<this.end?this.step(e-this.start)>>3:-1;return U.emptyOpContext(t,n)}indexOf(e,t,n=0){let s=t.length;if(s===0)return n<=this.end?n:-1;let i=t[0],B=this.end-s,o=typeof e.indexOf=="function",a=n;for(;a<=B;){if(o){if(a=e.indexOf(i,a),a===-1||a>B)return-1}else{for(;a<=B&&e[a]!==i;)a++;if(a>B)return-1}let c=!0;for(let u=1;u<s;u++)if(e[a+u]!==t[u]){c=!1;break}if(c)return a;a++}return-1}prefixLength(e){return e.prefixUTF8.length}},Tf=class extends We{constructor(r,e=0,t=r.length){super(),this.charSequence=r,this.start=e,this.end=t}hasString(r,e){let t=this.charSequence.indexOf(r.str,this.start+e);return t!==-1&&t<=this.end-r.str.length}hasAnyString(r,e){return r.automaton16().searchUTF16(this.charSequence,this.start+e,this.end)}step(r){if(r+=this.start,r>=this.end)return We.EOF();let e=this.charSequence.charCodeAt(r);if(e<j.MIN_HIGH_SURROGATE||e>j.MAX_HIGH_SURROGATE||r+1>=this.end)return e<<3|1;let t=this.charSequence.charCodeAt(r+1);return t>=j.MIN_LOW_SURROGATE&&t<=j.MAX_LOW_SURROGATE?(e-j.MIN_HIGH_SURROGATE)*1024+(t-j.MIN_LOW_SURROGATE)+j.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:e<<3|1}index(r,e){e+=this.start;let t=this.charSequence.indexOf(r.prefix,e);return t<0||t>this.end-r.prefix.length?-1:t-e}context(r){r+=this.start;let e=r>this.start&&r<=this.end?this.charSequence.charCodeAt(r-1):-1,t=r<this.end?this.charSequence.charCodeAt(r):-1;return U.emptyOpContext(e,t)}prefixLength(r){return r.prefix.length}},be=class{static fromUTF8(r,e=0,t=r.length){return new If(r,e,t)}static fromUTF16(r,e=0,t=r.length){return new Tf(r,e,t)}},Ir=class extends Error{constructor(r){super(r),this.name="RE2JSException"}},we=class extends Ir{constructor(r,e=null){let t=`error parsing regexp: ${r}`;e&&(t+=`: \`${e}\``),super(t),this.name="RE2JSSyntaxException",this.message=t,this.error=r,this.input=e}getDescription(){return this.error}getPattern(){return this.input}},Ar=class extends Ir{constructor(r){super(r),this.name="RE2JSCompileException"}},et=class extends Ir{constructor(r){super(r),this.name="RE2JSGroupException"}},Lf=class extends Ir{constructor(r){super(r),this.name="RE2JSFlagsException"}},Rr=class extends Ir{constructor(r){super(r),this.name="RE2JSInternalException"}},ka=class Xa{static MAX_REPLACER_ARGS=65535;static quoteReplacement(e,t=!1){return t?e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(n=>{let s=n.codePointAt(0);return s===T.CODES.get("\\")||s===T.CODES.get("$")?`\\${n}`:n}).join(""):e.indexOf("$")<0?e:e.split("").map(n=>n.codePointAt(0)===T.CODES.get("$")?"$$":n).join("")}constructor(e,t){if(e===null)throw new Error("pattern is null");this.patternInput=e;let n=this.patternInput.re2();this.patternGroupCount=n.numberOfCapturingGroups(),this.groups=[],this.namedGroups=n.namedGroups,this.numberOfInstructions=n.numberOfInstructions(),this.lookbehindState=null,t instanceof gn?this.resetMatcherInput(t):U.isByteArray(t)?this.resetMatcherInput(pn.utf8(t)):this.resetMatcherInput(pn.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(e===null)throw new Error("input is null");return e instanceof gn||(U.isByteArray(e)?e=pn.utf8(e):e=pn.utf16(e)),this.matcherInput=e,this.lookbehindState!==null?this.lookbehindState.reset():this.lookbehindState=this.patternInput.re2().createLookbehindState(),this.reset(),this}start(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new et(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e]}end(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new et(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if(typeof e=="string"){let s=this.namedGroups[e];if(!Number.isFinite(s))throw new et(`group '${e}' not found`);e=s}let t=this.start(e),n=this.end(e);return t<0&&n<0?null:this.substring(t,n)}getNamedGroups(){if(!this.hasMatch)throw new et("perhaps no match attempted");let e=Object.create(null);for(let t of Object.keys(this.namedGroups))e[t]=this.group(t);return e}groupCount(){return this.patternGroupCount}loadGroup(e){if(!Number.isInteger(e)||e<0||e>this.patternGroupCount)throw new et(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new et("perhaps no match attempted");if(e===0||this.hasGroups)return;let t=this.matcherInputLength,n=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount,this.lookbehindState);if(!n[0])throw new et("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,$.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,$.ANCHOR_START)}find(e=null){if(e!==null){if(!Number.isInteger(e)||e<0||e>this.matcherInputLength)throw new et(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}if(e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1])){let t=(this.matcherInput.isUTF16Encoding()?be.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):be.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=t&7}return this.genMatch(e,$.UNANCHORED)}genMatch(e,t){let n=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1,this.lookbehindState);return n[0]?(this.groups=n[1],this.hasMatch=!0,this.hasGroups=this.patternGroupCount===0,this.anchorFlag=t,!0):(this.hasMatch=!1,!1)}substring(e,t){return this.matcherInput.isUTF8Encoding()?U.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,t=!1){let n="",s=this.start(),i=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=i,n+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),n}appendReplacementInternalJava(e){let t="",n=0,s=e.length,i=0;for(;i<s;){let B=e.codePointAt(i);if(B===T.CODES.get("\\")){if(n<i&&(t+=e.substring(n,i)),i++,i>=s)throw new et("character to be escaped is missing");n=i,i++;continue}if(B===T.CODES.get("$")){if(n<i&&(t+=e.substring(n,i)),i+1>=s)throw new et("Illegal group reference: group index is missing");let o=e.codePointAt(i+1);if(T.CODES.get("0")<=o&&o<=T.CODES.get("9")){let a=o-T.CODES.get("0"),c=i+2;for(;c<s;c++){let l=e.codePointAt(c);if(l<T.CODES.get("0")||l>T.CODES.get("9")||a*10+l-T.CODES.get("0")>this.patternGroupCount)break;a=a*10+l-T.CODES.get("0")}if(a>this.patternGroupCount)throw new et(`n > number of groups: ${a}`);let u=this.group(a);u!==null&&(t+=u),i=c,n=i}else if(o===T.CODES.get("{")){let a=i+2;for(;a<s&&e.codePointAt(a)!==T.CODES.get("}");)a++;if(a>=s)throw new et("named capture group is missing trailing '}'");let c=e.substring(i+2,a),u=this.group(c);u!==null&&(t+=u),i=a+1,n=i}else throw new et("Illegal group reference");continue}i++}return n<s&&(t+=e.substring(n,s)),t}appendReplacementInternalJs(e){let t="",n=0,s=e.length;for(let i=0;i<s-1;i++)if(e.codePointAt(i)===T.CODES.get("$")){let B=e.codePointAt(i+1);if(T.CODES.get("$")===B){n<i&&(t+=e.substring(n,i)),t+="$",i++,n=i+1;continue}else if(T.CODES.get("&")===B){n<i&&(t+=e.substring(n,i));let o=this.group(0);o!==null?t+=o:t+="$&",i++,n=i+1;continue}else if(T.CODES.get("`")===B){n<i&&(t+=e.substring(n,i)),t+=this.substring(0,this.start(0)),i++,n=i+1;continue}else if(T.CODES.get("'")===B){n<i&&(t+=e.substring(n,i)),t+=this.substring(this.end(0),this.matcherInputLength),i++,n=i+1;continue}else if(T.CODES.get("1")<=B&&B<=T.CODES.get("9")){let o=B-T.CODES.get("0");for(n<i&&(t+=e.substring(n,i)),i+=2;i<s&&(B=e.codePointAt(i),!(B<T.CODES.get("0")||B>T.CODES.get("9")||o*10+B-T.CODES.get("0")>this.patternGroupCount));i++)o=o*10+B-T.CODES.get("0");if(o>this.patternGroupCount){t+=`$${o}`,n=i,i--;continue}let a=this.group(o);a!==null&&(t+=a),n=i,i--;continue}else if(B===T.CODES.get("<")){n<i&&(t+=e.substring(n,i)),i++;let o=i+1;for(;o<e.length&&e.codePointAt(o)!==T.CODES.get(">")&&e.codePointAt(o)!==T.CODES.get(" ");)o++;if(o===e.length||e.codePointAt(o)!==T.CODES.get(">")){t+=e.substring(i-1,o+1),n=o+1,i=o;continue}let a=e.substring(i+1,o);if(Object.prototype.hasOwnProperty.call(this.namedGroups,a)){let c=this.group(a);c!==null&&(t+=c)}else t+=`$<${a}>`;n=o+1,i=o;continue}}return n<s&&(t+=e.substring(n,s)),t}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,t=!1){return this.replace(e,!0,t)}replaceFirst(e,t=!1){return this.replace(e,!1,t)}replace(e,t=!0,n=!1){let s="";this.reset();let i=typeof e=="function",B=Object.keys(this.namedGroups).length>0,o=null;if(i){if(this.groupCount()>=Xa.MAX_REPLACER_ARGS)throw new et("Too many capture groups to safely invoke replacer function");o=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(s+=i?this.appendReplacementFunc(e,B,o):this.appendReplacement(e,n),!!t););return s+=this.appendTail(),s}appendReplacementFunc(e,t,n){let s="",i=this.start(),B=this.end();this.appendPos<i&&(s+=this.substring(this.appendPos,i)),this.appendPos=B;let o=this.buildReplacerArgs(i,t,n);return s+=String(e(...o)),s}buildReplacerArgs(e,t,n){let s=[this.group(0)],i=this.groupCount();for(let B=1;B<=i;B++){let o=this.start(B);o<0?s.push(void 0):s.push(this.substring(o,this.end(B)))}if(s.push(e),s.push(n),t){let B=this.getNamedGroups();for(let o in B)B[o]===null&&(B[o]=void 0);s.push(B)}return s}},y=class Ge{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static LB_WRITE=12;static LB_CHECK=13;static isRuneOp(e){return Ge.RUNE<=e&&e<=Ge.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let n of e)t+=U.escapeRune(n);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=new Int32Array(0),this.next=null}matchRune(e){if(this.runes.length===1){let B=this.runes[0];return(this.arg&$.FOLD_CASE)!==0?j.equalsIgnoreCase(B,e):e===B}let t=this.runes.length;if(t===0)return!1;if(t===2||t===4||t===6||t===8){for(let B=0;B<t;B+=2){if(e<this.runes[B])return!1;if(e<=this.runes[B+1])return!0}return!1}let n=0,s=t>>1;for(;s>1;){let B=s>>1;n+=this.runes[n+B<<1]<=e?B:0,s-=B}n+=this.runes[n<<1]<=e?1:0;let i=n-1;return i>=0&&e<=this.runes[i<<1|1]}matchRunePos(e){if(this.runes.length===1){let B=this.runes[0];return(this.arg&$.FOLD_CASE)!==0?j.equalsIgnoreCase(B,e)?0:-1:e===B?0:-1}let t=this.runes.length;if(t===0)return-1;if(t===2||t===4||t===6||t===8){for(let B=0;B<t;B+=2){if(e<this.runes[B])return-1;if(e<=this.runes[B+1])return Math.floor(B/2)}return-1}let n=0,s=t>>1;for(;s>1;){let B=s>>1;n+=this.runes[n+B<<1]<=e?B:0,s-=B}n+=this.runes[n<<1]<=e?1:0;let i=n-1;return i>=0&&e<=this.runes[i<<1|1]?i:-1}toString(){switch(this.op){case Ge.ALT:return`alt -> ${this.out}, ${this.arg}`;case Ge.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case Ge.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case Ge.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case Ge.MATCH:return`match${this.arg!==0?` ${this.arg}`:""}`;case Ge.FAIL:return"fail";case Ge.NOP:return`nop -> ${this.out}`;case Ge.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case Ge.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case Ge.RUNE:return this.runes===null?"rune <null>":["rune ",Ge.escapeRunes(this.runes),(this.arg&$.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case Ge.RUNE1:return`rune1 ${Ge.escapeRunes(this.runes)} -> ${this.out}`;case Ge.RUNE_ANY:return`any -> ${this.out}`;case Ge.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},xa=class el{constructor(e){this.sparse=new Int32Array(e),this.densePcs=new Int32Array(e),this.denseCaps=null,this.size=0,this.ncap=0,this.mainThreads=0}static INITIAL_THREADS=32;init(e){this.ncap=e;let t=Math.min(this.densePcs.length,el.INITIAL_THREADS)*e;(!this.denseCaps||this.denseCaps.length<t)&&(this.denseCaps=new Int32Array(t))}growCaps(e){let t=this.densePcs.length*this.ncap,n=new Int32Array(Math.min(t,Math.max(e,2*this.denseCaps.length)));n.set(this.denseCaps),this.denseCaps=n}contains(e){let t=this.sparse[e];return t<this.size&&this.densePcs[t]===e}isEmpty(){return this.size===0}add(e){let t=this.size++;return this.sparse[e]=t,this.densePcs[t]=e,t}clear(){this.size=0,this.mainThreads=0}toString(){let e="{";for(let t=0;t<this.size;t++)t!==0&&(e+=", "),e+=this.densePcs[t];return e+="}",e}},$f=class{constructor(r){this.pos=-1,this.pcs=new Int32Array(r.numInst()),this.size=0,this.lbTable=new Int32Array(r.numLb+1)}reset(){this.pos=-1,this.size=0}},tl=class nl{static fromRE2(e){let t=new nl;return t.prog=e.prog,t.re2=e,t.q0=new xa(t.prog.numInst()),t.q1=new xa(t.prog.numInst()),t.addStack=new Int32Array(2*(t.prog.numInst()+1)),t.matched=!1,t.matchcap=new Int32Array(t.prog.numCap<2?2:t.prog.numCap),t.ncap=0,t}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.addStack=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(e){this.ncap=e,e>this.matchcap.length?this.matchcap=new Int32Array(e).fill(-1):this.matchcap.fill(-1),this.q0.init(e),this.q1.init(e),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return this.ncap===0?U.emptyInts():U.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,n,s=null){let i=this.re2.cond;if(i===U.EMPTY_ALL||(n===$.ANCHOR_START||n===$.ANCHOR_BOTH)&&t!==0)return!1;this.matched=!1,this.matchcap.fill(-1);let B=this.prog.numLb>0,o=t,a=t,c=!1;B&&(s!==null&&s.pos>=0&&s.pos<=t?(a=s.pos,c=!0):a=0);let u=B&&s!==null,l=this.q0,f=this.q1,C=e.step(a),d=C>>3,h=C&7,x=-1,S=0;C!==We.EOF()&&(C=e.step(a+h),x=C>>3,S=C&7);let E;for(a===0?E=U.emptyOpContext(-1,d):E=e.context(a),B&&(c?this.restoreLookbehinds(s,l,E):this.spawnLookbehinds(l,a,E));;){if(l.mainThreads===0){if((i&U.EMPTY_BEGIN_TEXT)!==0&&a!==0||(n===$.ANCHOR_START||n===$.ANCHOR_BOTH)&&a!==0||this.matched)break;if(this.prog.numLb===0&&l.isEmpty()&&this.re2.prefix.length!==0&&x!==this.re2.prefixRune&&e.canCheckPrefix()){let O=e.index(this.re2,a);if(O<0)break;a+=O,C=e.step(a),d=C>>3,h=C&7,C=e.step(a+h),x=C>>3,S=C&7,E=e.context(a)}}a>=o&&(u&&(this.saveLookbehinds(s,l,a),u=!1),!this.matched&&(a===0||n===$.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=a),this.add(l,this.prog.start,a,this.matchcap,0,E)));let b=a+h;if(E=e.context(b),this.step(l,f,a,b,d,E,n,a===e.endPos()),h===0||this.ncap===0&&this.matched)break;a+=h,d=x,h=S,d!==-1&&(C=e.step(a+h),x=C>>3,S=C&7);let D=l;l=f,f=D}return l.clear(),f.clear(),this.matched}matchSet(e,t,n){let s=this.re2.cond;if(s===U.EMPTY_ALL)return[];if((n===$.ANCHOR_START||n===$.ANCHOR_BOTH)&&t!==0)return[];let i=this.prog.numLb>0?0:t,B=t,o=this.q0,a=this.q1,c=e.step(i),u=c>>3,l=c&7,f=-1,C=0;c!==We.EOF()&&(c=e.step(i+l),f=c>>3,C=c&7);let d=i===0?U.emptyOpContext(-1,u):e.context(i),h=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(o,i,d);!(o.mainThreads===0&&((s&U.EMPTY_BEGIN_TEXT)!==0&&i!==0||(n===$.ANCHOR_START||n===$.ANCHOR_BOTH)&&i!==0));){(i===0||n===$.UNANCHORED)&&i>=B&&this.add(o,this.prog.start,i,this.matchcap,0,d);let x=i+l;d=e.context(x);for(let E=0;E<o.size;E++){let b=o.densePcs[E],D=this.prog.inst[b],O=E*this.ncap,v=!1;switch(D.op){case y.MATCH:if(n===$.ANCHOR_BOTH&&i!==e.endPos())break;h.add(D.arg);break;case y.RUNE:v=D.matchRune(u);break;case y.RUNE1:v=u===D.runes[0];break;case y.RUNE_ANY:v=!0;break;case y.RUNE_ANY_NOT_NL:v=u!==10;break;default:continue}v&&this.add(a,D.out,x,o.denseCaps,O,d)}if(o.clear(),l===0)break;i+=l,u=f,l=C,u!==-1&&(c=e.step(i+l),f=c>>3,C=c&7);let S=o;o=a,a=S}return a.clear(),Array.from(h).sort((x,S)=>x-S)}step(e,t,n,s,i,B,o,a){let c=this.re2.longest;for(let u=0;u<e.size;u++){let l=e.densePcs[u],f=u*this.ncap;if(c&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[f])continue;let C=this.prog.inst[l],d=!1;switch(C.op){case y.MATCH:if(o===$.ANCHOR_BOTH&&!a)break;if(this.ncap>0&&(!c||!this.matched||this.matchcap[1]<n)){e.denseCaps[f+1]=n;for(let h=0;h<this.ncap;h++)this.matchcap[h]=e.denseCaps[f+h]}c||(e.size=0),this.matched=!0;break;case y.RUNE:d=C.matchRune(i);break;case y.RUNE1:d=i===C.runes[0];break;case y.RUNE_ANY:d=!0;break;case y.RUNE_ANY_NOT_NL:d=i!==10;break;default:continue}d&&this.add(t,C.out,s,e.denseCaps,f,B)}e.clear()}spawnLookbehinds(e,t,n){for(let s=0;s<this.prog.lbStarts.length;s++)this.add(e,this.prog.lbStarts[s],t,this.matchcap,0,n)}restoreLookbehinds(e,t,n){this.lbTable.set(e.lbTable);for(let s=0;s<e.size;s++)this.add(t,e.pcs[s],e.pos,this.matchcap,0,n)}saveLookbehinds(e,t,n){let s=0;for(let i=0;i<t.size;i++){let B=t.densePcs[i];this.prog.lbInst[B]===1&&y.isRuneOp(this.prog.inst[B].op)&&(e.pcs[s++]=B)}e.size=s,e.pos=n,e.lbTable.set(this.lbTable)}add(e,t,n,s,i,B){let o=this.addStack,a=0;for(;;){for(;t!==0&&!e.contains(t);){let u=e.add(t),l=this.prog.inst[t];switch(l.op){case y.FAIL:t=0;break;case y.ALT:case y.ALT_MATCH:o[a++]=l.arg,o[a++]=0,t=l.out;break;case y.EMPTY_WIDTH:t=(l.arg&~B)===0?l.out:0;break;case y.NOP:t=l.out;break;case y.CAPTURE:l.arg<this.ncap&&(o[a++]=-l.arg-1,o[a++]=s[i+l.arg],s[i+l.arg]=n),t=l.out;break;case y.LB_WRITE:this.lbTable[Math.abs(l.arg)]=n,t=l.out;break;case y.LB_CHECK:l.arg>0?t=this.lbTable[l.arg]===n?l.out:0:t=this.lbTable[-l.arg]!==n?l.out:0;break;case y.MATCH:case y.RUNE:case y.RUNE1:case y.RUNE_ANY:case y.RUNE_ANY_NOT_NL:if(this.prog.lbInst[t]===0&&e.mainThreads++,this.ncap>0){let f=u*this.ncap;f+this.ncap>e.denseCaps.length&&e.growCaps(f+this.ncap);for(let C=0;C<this.ncap;C++)e.denseCaps[f+C]=s[i+C]}t=0;break;default:throw new Rr("unhandled")}}if(a===0)return;a-=2;let c=o[a];c<0?(s[i-c-1]=o[a+1],t=0):t=c}}},Nf=(r,e,t)=>{let n=-2128831035;for(let s=0;s<r.length;s++)n^=r[s],n=Math.imul(n,16777619);n^=e,n=Math.imul(n,16777619);for(let s=0;s<t.length;s++)n^=t[s],n=Math.imul(n,16777619);return n},va=(r,e)=>{if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0},iB=[],Or=-1,Mf=class{constructor(r,e,t){this.nfaStates=r,this.flag=e,this.isMatch=(e&fB.FLAG_MATCH)!==0,this.matchIDs=t,this.next=null,this.nextAnchored=null}},fB=class ot{static FLAG_EMPTY_MASK=255;static FLAG_MATCH=256;static FLAG_LAST_WORD=512;static FLAG_NEED_SHIFT=16;static STATE_OVERHEAD=160;static TABLE_OVERHEAD=16;static PROGRESS_PER_STATE=10;constructor(e,t=8388608){this.prog=e,this.maxMem=t,this.stateCache=new Map,this.stateCount=0,this.startStates=new Map,this.failed=!1;for(let n=0;n<e.numInst();n++){let s=e.getInst(n).op;if(s===y.LB_WRITE||s===y.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=t,this.memBudget=t}computeRuneClasses(){let e=new Set,t=(s,i)=>{e.add(s),e.add(i+1)};for(let s=0;s<this.prog.numInst();s++){let i=this.prog.getInst(s);switch(i.op){case y.RUNE:case y.RUNE1:if(i.runes.length===1){if(t(i.runes[0],i.runes[0]),(i.arg&$.FOLD_CASE)!==0)for(let B=j.simpleFold(i.runes[0]);B!==i.runes[0];B=j.simpleFold(B))t(B,B)}else for(let B=0;B<i.runes.length;B+=2)t(i.runes[B],i.runes[B+1]);break;case y.RUNE_ANY_NOT_NL:t(10,10);break;case y.EMPTY_WIDTH:(i.arg&(U.EMPTY_BEGIN_LINE|U.EMPTY_END_LINE))!==0&&t(10,10),(i.arg&(U.EMPTY_WORD_BOUNDARY|U.EMPTY_NO_WORD_BOUNDARY))!==0&&(t(48,57),t(65,90),t(95,95),t(97,122))}}e.delete(0),this.classBounds=Int32Array.from(e).sort(),this.numClasses=this.classBounds.length+1;let n=new Int32Array(j.MAX_LATIN1+1);for(let s=0;s<=j.MAX_LATIN1;s++)n[s]=this.searchClass(s);this.latin1Class=n}runeClass(e){return e<=j.MAX_LATIN1?this.latin1Class[e]:this.searchClass(e)}searchClass(e){let t=this.classBounds,n=0,s=t.length;for(;n<s;){let i=n+s>>1;t[i]<=e?n=i+1:s=i}return n}closure(e,t){let n=new Set,s=Array.from(e),i=0;for(;s.length>0;){let B=s.pop();if(B===0||n.has(B))continue;n.add(B);let o=this.prog.getInst(B);switch(o.op){case y.ALT:case y.ALT_MATCH:s.push(o.out),s.push(o.arg);break;case y.NOP:case y.CAPTURE:s.push(o.out);break;case y.EMPTY_WIDTH:i|=o.arg,(o.arg&~t)===0&&s.push(o.out)}}return{pcs:Int32Array.from(n).sort(),needflags:i}}getState(e,t,n){let s=Nf(e,t,n),i=this.stateCache.get(s);if(i)for(let a=0;a<i.length;a++){let c=i[a];if(c.flag===t&&va(c.nfaStates,e)&&va(c.matchIDs,n))return c}let B=ot.STATE_OVERHEAD+4*e.length+8*n.length;if(this.memBudget<B)return null;this.memBudget-=B,i||(i=[],this.stateCache.set(s,i));let o=new Mf(e,t,n);return i.push(o),this.stateCount++,o}makeState(e,t,n){let s=this.closure(e,t&ot.FLAG_EMPTY_MASK),i=t;return s.needflags===0&&(i&=ot.FLAG_MATCH),i|=s.needflags<<ot.FLAG_NEED_SHIFT,this.getState(s.pcs,i,n)}allocTable(e,t){let n=this.numClasses+1,s=ot.TABLE_OVERHEAD+8*n;if(this.memBudget<s)return null;this.memBudget-=s;let i=new Array(n).fill(null);return t===$.UNANCHORED?e.next=i:e.nextAnchored=i,i}clearCache(){this.stateCache.clear(),this.stateCount=0,this.startStates.clear(),this.memBudget=this.stateBudget}resetCache(e){return this.clearCache(),this.getState(e.nfaStates,e.flag,e.matchIDs)}step(e,t,n,s){let i=s===$.UNANCHORED?e.next:e.nextAnchored;if(i!==null){let E=i[t];if(E!==null)return E}else if(i=this.allocTable(e,s),i===null)return null;let B=e.flag>>>ot.FLAG_NEED_SHIFT,o=e.flag&ot.FLAG_EMPTY_MASK,a=o,c=0;n===10&&(a|=U.EMPTY_END_LINE,c|=U.EMPTY_BEGIN_LINE),n===Or&&(a|=U.EMPTY_END_LINE|U.EMPTY_END_TEXT);let u=(e.flag&ot.FLAG_LAST_WORD)!==0,l=n!==Or&&U.isWordRune(n);a|=l===u?U.EMPTY_NO_WORD_BOUNDARY:U.EMPTY_WORD_BOUNDARY;let f=e.nfaStates;(a&~o&B)!==0&&(f=this.closure(f,a).pcs);let C=[],d=!1,h=iB;for(let E=0;E<f.length;E++){let b=this.prog.getInst(f[E]);b.op===y.MATCH?(d||(d=!0,h=[]),h.push(b.arg)):n!==Or&&y.isRuneOp(b.op)&&b.matchRune(n)&&C.push(b.out)}h.length>1&&h.sort((E,b)=>E-b),s===$.UNANCHORED&&n!==Or&&C.push(this.prog.start);let x=c;d&&(x|=ot.FLAG_MATCH),l&&(x|=ot.FLAG_LAST_WORD);let S=this.makeState(C,x,h);return S===null?null:(i[t]=S,S)}start(e,t){let n=e.context(t),s;if((n&U.EMPTY_BEGIN_TEXT)!==0)s=U.EMPTY_BEGIN_TEXT|U.EMPTY_BEGIN_LINE;else if((n&U.EMPTY_BEGIN_LINE)!==0)s=U.EMPTY_BEGIN_LINE;else{let B=e.step(t),o=B>=0&&U.isWordRune(B>>3);s=(n&U.EMPTY_WORD_BOUNDARY)!==0!==o?ot.FLAG_LAST_WORD:0}let i=this.startStates.get(s);if(i===void 0){if(i=this.makeState([this.prog.start],s,iB),i===null&&(this.clearCache(),i=this.makeState([this.prog.start],s,iB),i===null))return null;this.startStates.set(s,i)}return i}stepOrReset(e,t,n,s,i,B){let o=this.step(e,t,n,s);if(o!==null)return o;if(B.resetPos>=0&&i-B.resetPos<ot.PROGRESS_PER_STATE*this.stateCount)return null;B.resetPos=i;let a=this.resetCache(e);return a===null?null:(o=this.step(a,t,n,s),o)}run(e,t,n,s,i){let B=e.endPos(),o=this.latin1Class,a=n===$.UNANCHORED,c={resetPos:-1},u=t;for(;u<B;){let l=e.step(u),f=l>>3,C=l&7;if(C===0)break;let d=f<=j.MAX_LATIN1?o[f]:this.runeClass(f),h=a&&s.next!==null?s.next[d]:null;if(h===null&&(h=this.stepOrReset(s,d,f,n,u,c),h===null))return null;if(s=h,s.isMatch&&i(s,!1))return!0;if(!a&&s.nfaStates.length===0)return!1;u+=C}return s=this.stepOrReset(s,this.numClasses,Or,n,u,c),s===null?null:s.isMatch&&i(s,!0)}match(e,t,n){if(this.failed)return null;if((n===$.ANCHOR_START||n===$.ANCHOR_BOTH)&&t!==0)return!1;let s=this.start(e,t);return s===null?null:this.run(e,t,n,s,(i,B)=>n!==$.ANCHOR_BOTH||B)}matchSet(e,t,n){if(this.failed)return null;if((n===$.ANCHOR_START||n===$.ANCHOR_BOTH)&&t!==0)return[];let s=this.start(e,t);if(s===null)return null;let i=new Set,B=(o,a)=>{if(n!==$.ANCHOR_BOTH||a)for(let c=0;c<o.matchIDs.length;c++)i.add(o.matchIDs[c]);return!1};return this.run(e,t,n,s,B)===null?null:Array.from(i).sort((o,a)=>o-a)}},Gf=32,Hf=500,BB=256,Pf=262144,_f=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(BB),this.jobArg=new Uint8Array(BB),this.jobPos=new Int32Array(BB),this.jobLen=0,this.visited=new Uint32Array(0)}reset(r,e,t){this.end=e,this.jobLen=0,this.ncap=t;let n=r.numInst()*(e+1)+Gf-1>>>5;this.visited.length<n?this.visited=new Uint32Array(n):this.visited.fill(0,0,n),this.cap.length<t?this.cap=new Int32Array(t).fill(-1):this.cap.fill(-1,0,t),this.matchcap.length<t?this.matchcap=new Int32Array(t).fill(-1):this.matchcap.fill(-1,0,t)}shouldVisit(r,e){let t=r*(this.end+1)+e,n=t>>>5,s=1<<(t&31);return(this.visited[n]&s)!==0?!1:(this.visited[n]|=s,!0)}push(r,e,t,n){if(r.prog.getInst(e).op!==y.FAIL&&(n||this.shouldVisit(e,t))){if(this.jobLen>=this.jobPc.length){let s=this.jobPc.length*2,i=new Int32Array(s);i.set(this.jobPc),this.jobPc=i;let B=new Uint8Array(s);B.set(this.jobArg),this.jobArg=B;let o=new Int32Array(s);o.set(this.jobPos),this.jobPos=o}this.jobPc[this.jobLen]=e,this.jobArg[this.jobLen]=n?1:0,this.jobPos[this.jobLen]=t,this.jobLen++}}tryBacktrack(r,e,t,n,s){let i=r.longest;for(this.push(r,t,n,!1);this.jobLen>0;){this.jobLen--;let B=this.jobPc[this.jobLen],o=this.jobArg[this.jobLen]===1,a=this.jobPos[this.jobLen],c=!0;for(;!(!c&&!this.shouldVisit(B,a));){c=!1;let u=r.prog.getInst(B);switch(u.op){case y.FAIL:throw new Rr("unexpected InstFail");case y.ALT:if(o){o=!1,B=u.arg;continue}else{this.push(r,B,a,!0),B=u.out;continue}case y.ALT_MATCH:{let l=r.prog.getInst(u.out);if(y.isRuneOp(l.op)){this.push(r,u.arg,a,!1),B=u.arg,a=this.end;continue}this.push(r,u.out,this.end,!1),B=u.out;continue}case y.RUNE:{let l=e.step(a);if(l===We.EOF()||!u.matchRune(l>>3))break;a+=l&7,B=u.out;continue}case y.RUNE1:{let l=e.step(a);if(l===We.EOF()||l>>3!==u.runes[0])break;a+=l&7,B=u.out;continue}case y.RUNE_ANY_NOT_NL:{let l=e.step(a);if(l===We.EOF()||l>>3===10)break;a+=l&7,B=u.out;continue}case y.RUNE_ANY:{let l=e.step(a);if(l===We.EOF())break;a+=l&7,B=u.out;continue}case y.CAPTURE:if(o){this.cap[u.arg]=a;break}else{u.arg<this.ncap&&(this.push(r,B,this.cap[u.arg],!0),this.cap[u.arg]=a),B=u.out;continue}case y.EMPTY_WIDTH:{let l=e.context(a);if((u.arg&~l)!==0)break;B=u.out;continue}case y.NOP:B=u.out;continue;case y.MATCH:{if(s===$.ANCHOR_BOTH&&a!==this.end)break;if(this.ncap===0)return!0;this.ncap>1&&(this.cap[1]=a);let l=this.matchcap[1];if((l===-1||i&&a>0&&a>l)&&this.matchcap.set(this.cap),!i||a===this.end)return!0;break}case y.LB_WRITE:case y.LB_CHECK:throw new Rr("Backtracker cannot evaluate Lookbehind instructions");default:throw new Rr("bad inst")}break}}return i&&this.matchcap.length>1&&this.matchcap[1]>=0}},Ns=[],Ms=class rl{static shouldBacktrack(e){return e.numInst()<=Hf}static maxBitStateLen(e){return rl.shouldBacktrack(e)?Math.floor(Pf/e.numInst()):0}static execute(e,t,n,s,i){let B=e.cond;if(B===U.EMPTY_ALL||(s===$.ANCHOR_START||s===$.ANCHOR_BOTH)&&n!==0||(B&U.EMPTY_BEGIN_TEXT)!==0&&n!==0)return null;let o=Ns.length>0?Ns.pop():new _f,a=t.endPos();o.reset(e.prog,a,i);let c=!1;if((B&U.EMPTY_BEGIN_TEXT)!==0||s===$.ANCHOR_START||s===$.ANCHOR_BOTH)o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(e,t,e.prog.start,n,s)&&(c=!0);else{let l=-1;for(;n<=a&&l!==0;n+=l){if(e.prefix.length>0){let C=t.index(e,n);if(C<0)break;n+=C}if(o.ncap>0&&(o.cap[0]=n),o.tryBacktrack(e,t,e.prog.start,n,s)){c=!0;break}let f=t.step(n);l=f===We.EOF()?0:f&7}}if(!c)return Ns.push(o),null;let u=i===0?[]:U.toArray(o.matchcap.subarray(0,i));return Ns.push(o),u}},Sa=class{constructor(r){this.sparse=new Uint32Array(r),this.dense=new Uint32Array(r),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(r){return r<this.sparse.length&&this.sparse[r]<this.size&&this.dense[this.sparse[r]]===r}insert(r){this.contains(r)||this.insertNew(r)}insertNew(r){r>=this.sparse.length||(this.sparse[r]=this.size,this.dense[this.size]=r,this.size++)}},Jf=(r,e,t,n)=>{let s=r.length,i=e.length,B=0,o=0,a=[],c=[],u=!0,l=-1,f=C=>{let d=C?r:e,h=C?B:o,x=C?t:n;return l>0&&d[h]<=a[l]?!1:(a.push(d[h],d[h+1]),C?B+=2:o+=2,l+=2,c.push(x),!0)};for(;B<s||o<i;)if(o>=i?u=f(!0):B>=s||e[o]<r[B]?u=f(!1):u=f(!0),!u)return null;return{merged:a,next:c}},Uf=class{constructor(r){this.start=r.start,this.numCap=r.numCap,this.inst=new Array(r.inst.length);for(let e=0;e<r.inst.length;e++){let t=r.inst[e],n=new y(t.op);n.out=t.out,n.arg=t.arg,n.runes=t.runes?new Int32Array(t.runes):new Int32Array(0),n.next=null,this.inst[e]=n}}},jf=r=>{let e=new Uf(r);for(let t=0;t<e.inst.length;t++){let n=e.inst[t];if(n.op!==y.ALT&&n.op!==y.ALT_MATCH)continue;let s="out",i="arg",B=e.inst[n[i]];if(B.op!==y.ALT&&B.op!==y.ALT_MATCH&&(s="arg",i="out",B=e.inst[n[i]],B.op!==y.ALT&&B.op!==y.ALT_MATCH))continue;let o=e.inst[n[s]];if(o.op===y.ALT||o.op===y.ALT_MATCH)continue;let a="out",c="arg",u=!1;B.out===t?u=!0:B.arg===t&&(u=!0,a="arg",c="out"),u&&(B[a]=n[s]),n[s]===B[a]&&(n[i]=B[c])}return e},Kf=r=>{if(r.inst.length>=1e3)return null;let e=new Sa(r.inst.length),t=new Sa(r.inst.length),n=new Array(r.inst.length),s=new Array(r.inst.length).fill(!1),i=B=>{let o=!0,a=r.inst[B];if(t.contains(B))return!0;switch(t.insert(B),a.op){case y.ALT:case y.ALT_MATCH:{o=i(a.out)&&i(a.arg);let c=s[a.out],u=s[a.arg];if(c&&u)return!1;if(u){let d=a.out;a.out=a.arg,a.arg=d;let h=c;c=u,u=h}c&&(s[B]=!0,a.op=y.ALT_MATCH);let l=n[a.out]||[],f=n[a.arg]||[],C=Jf(l,f,a.out,a.arg);if(!C)return!1;n[B]=new Int32Array(C.merged),a.next=new Uint32Array(C.next);break}case y.CAPTURE:case y.EMPTY_WIDTH:case y.NOP:o=i(a.out),s[B]=s[a.out],n[B]=n[a.out]?new Int32Array(n[a.out]):new Int32Array(0),a.next=new Uint32Array(Math.floor(n[B].length/2)+1).fill(a.out);break;case y.MATCH:case y.FAIL:s[B]=a.op===y.MATCH;break;case y.RUNE:{if(s[B]=!1,a.next&&a.next.length>0)break;if(e.insert(a.out),!a.runes||a.runes.length===0){n[B]=new Int32Array(0),a.next=new Uint32Array([a.out]);break}let c=[];if(a.runes.length===1&&(a.arg&$.FOLD_CASE)!==0){let u=a.runes[0];c.push(u,u);for(let l=j.simpleFold(u);l!==u;l=j.simpleFold(l))c.push(l,l);c.sort((l,f)=>l-f)}else for(let u=0;u<a.runes.length;u++)c.push(a.runes[u]);n[B]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=y.RUNE;break}case y.RUNE1:{if(s[B]=!1,a.next&&a.next.length>0)break;e.insert(a.out);let c=[];if((a.arg&$.FOLD_CASE)!==0){let u=a.runes[0];c.push(u,u);for(let l=j.simpleFold(u);l!==u;l=j.simpleFold(l))c.push(l,l);c.sort((l,f)=>l-f)}else c.push(a.runes[0],a.runes[0]);n[B]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=y.RUNE;break}case y.RUNE_ANY:if(s[B]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[B]=new Int32Array([0,j.MAX_RUNE]),a.next=new Uint32Array([a.out]);break;case y.RUNE_ANY_NOT_NL:if(s[B]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[B]=new Int32Array([0,9,11,j.MAX_RUNE]),a.next=new Uint32Array(Math.floor(n[B].length/2)+1).fill(a.out)}return o};for(e.clear(),e.insert(r.start);!e.empty();)if(t.clear(),!i(e.next()))return null;for(let B=0;B<r.inst.length;B++)n[B]&&(r.inst[B].runes=n[B]);return r},zf=(r,e)=>{for(let t=0;t<e.inst.length;t++){let n=e.inst[t];switch(n.op){case y.ALT:case y.ALT_MATCH:case y.RUNE:break;case y.CAPTURE:case y.EMPTY_WIDTH:case y.NOP:case y.MATCH:case y.FAIL:r.inst[t].next=null;break;case y.RUNE1:case y.RUNE_ANY:case y.RUNE_ANY_NOT_NL:r.inst[t].next=null,r.inst[t].op=n.op,r.inst[t].runes=n.runes?new Int32Array(n.runes):new Int32Array(0)}}},Oa=class sl{static compile(e){if(e.start===0||e.numLb>0)return null;let t=e.inst[e.start];if(t.op!==y.EMPTY_WIDTH||(t.arg&U.EMPTY_BEGIN_TEXT)===0)return null;let n=!1;for(let i=0;i<e.inst.length;i++)if(e.inst[i].op===y.ALT||e.inst[i].op===y.ALT_MATCH){n=!0;break}for(let i=0;i<e.inst.length;i++){let B=e.inst[i],o=e.inst[B.out].op;switch(B.op){case y.ALT:case y.ALT_MATCH:if(o===y.MATCH||e.inst[B.arg].op===y.MATCH)return null;break;case y.EMPTY_WIDTH:if(o===y.MATCH){if((B.arg&U.EMPTY_END_TEXT)===U.EMPTY_END_TEXT)continue;return null}break;default:if(o===y.MATCH&&n)return null}}let s=jf(e);return s=Kf(s),s!==null&&zf(s,e),s}static next(e,t){let n=e.matchRunePos(t);return n>=0?e.next[n]:e.op===y.ALT_MATCH?e.out:0}static execute(e,t,n,s,i){let B=e.onepass;if(!B)return null;let o=new Int32Array(i).fill(-1),a=!1,c=t.step(n),u=c>>3,l=c&7,f=We.EOF(),C=-1,d=0;c!==We.EOF()&&(f=t.step(n+l),f!==We.EOF()&&(C=f>>3,d=f&7));let h=n===0?U.emptyOpContext(-1,u):t.context(n),x=B.start,S;for(;;){switch(S=B.inst[x],x=S.out,S.op){case y.MATCH:return s===$.ANCHOR_BOTH&&n!==t.endPos()?null:(a=!0,o.length>0&&(o[0]=0,o[1]=n),i===0?[]:U.toArray(o));case y.RUNE:if(!S.matchRune(u))return null;break;case y.RUNE1:if(u!==S.runes[0])return null;break;case y.RUNE_ANY:break;case y.RUNE_ANY_NOT_NL:if(u===10)return null;break;case y.ALT:case y.ALT_MATCH:x=sl.next(S,u);continue;case y.FAIL:return null;case y.NOP:continue;case y.EMPTY_WIDTH:if((S.arg&~h)!==0)return null;continue;case y.CAPTURE:S.arg<o.length&&(o[S.arg]=n);continue;default:throw new Rr("bad inst")}if(l===0)break;h=U.emptyOpContext(u,C),n+=l,u=C,l=d,u!==-1&&(f=t.step(n+l),f!==We.EOF()?(C=f>>3,d=f&7):(C=-1,d=0))}return a?i===0?[]:U.toArray(o):null}},w=class ne{static Op=Za(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(e){return e>=ne.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===T.CODES.get("-")?"\\":""}static fromRegexp(e){let t=new ne(e.op);return t.flags=e.flags,t.subs=e.subs,t.runes=e.runes,t.cap=e.cap,t.min=e.min,t.max=e.max,t.name=e.name,t.namedGroups=e.namedGroups,t.lb=e.lb,t}constructor(e){this.op=e,this.flags=0,this.subs=ne.emptySubs(),this.runes=new Int32Array(0),this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=ne.emptySubs(),this.runes=new Int32Array(0),this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case ne.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case ne.Op.EMPTY_MATCH:e+="(?:)";break;case ne.Op.STAR:case ne.Op.PLUS:case ne.Op.QUEST:case ne.Op.REPEAT:{let t=this.subs[0];switch(t.op>ne.Op.CAPTURE||t.op===ne.Op.LITERAL&&t.runes.length>1?e+=`(?:${t.appendTo()})`:e+=t.appendTo(),this.op){case ne.Op.STAR:e+="*";break;case ne.Op.PLUS:e+="+";break;case ne.Op.QUEST:e+="?";break;case ne.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}"}(this.flags&$.NON_GREEDY)!==0&&(e+="?");break}case ne.Op.CONCAT:for(let t of this.subs)t.op===ne.Op.ALTERNATE?e+=`(?:${t.appendTo()})`:e+=t.appendTo();break;case ne.Op.ALTERNATE:{let t="";for(let n of this.subs)e+=t,t="|",e+=n.appendTo();break}case ne.Op.LITERAL:(this.flags&$.FOLD_CASE)!==0&&(e+="(?i:");for(let t of this.runes)e+=U.escapeRune(t);(this.flags&$.FOLD_CASE)!==0&&(e+=")");break;case ne.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case ne.Op.ANY_CHAR:e+="(?s:.)";break;case ne.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case ne.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case ne.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==ne.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case ne.Op.BEGIN_TEXT:e+="\\A";break;case ne.Op.END_TEXT:(this.flags&$.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case ne.Op.BEGIN_LINE:e+="^";break;case ne.Op.END_LINE:e+="$";break;case ne.Op.WORD_BOUNDARY:e+="\\b";break;case ne.Op.NO_WORD_BOUNDARY:e+="\\B";break;case ne.Op.CHAR_CLASS:if(this.runes.length%2!==0){e+="[invalid char class]";break}if(e+="[",this.runes.length===0)e+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===j.MAX_RUNE){e+="^";for(let t=1;t<this.runes.length-1;t+=2){let n=this.runes[t]+1,s=this.runes[t+1]-1;e+=ne.quoteIfHyphen(n),e+=U.escapeRune(n),n!==s&&(e+="-",e+=ne.quoteIfHyphen(s),e+=U.escapeRune(s))}}else for(let t=0;t<this.runes.length;t+=2){let n=this.runes[t],s=this.runes[t+1];e+=ne.quoteIfHyphen(n),e+=U.escapeRune(n),n!==s&&(e+="-",e+=ne.quoteIfHyphen(s),e+=U.escapeRune(s))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===ne.Op.CAPTURE&&(e=this.cap),this.subs!==null)for(let t of this.subs){let n=t.maxCap();e<n&&(e=n)}return e}equals(e){if(!(e!==null&&e instanceof ne)||this.op!==e.op)return!1;switch(this.op){case ne.Op.END_TEXT:if((this.flags&$.WAS_DOLLAR)!==(e.flags&$.WAS_DOLLAR))return!1;break;case ne.Op.LITERAL:case ne.Op.CHAR_CLASS:if((this.flags&$.FOLD_CASE)!==(e.flags&$.FOLD_CASE))return!1;if(this.runes===null&&e.runes===null)break;if(this.runes===null||e.runes===null||this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case ne.Op.ALTERNATE:case ne.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case ne.Op.STAR:case ne.Op.PLUS:case ne.Op.QUEST:if((this.flags&$.NON_GREEDY)!==(e.flags&$.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case ne.Op.REPEAT:if((this.flags&$.NON_GREEDY)!==(e.flags&$.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case ne.Op.CAPTURE:if(this.cap!==e.cap||(this.name===null?e.name!==null:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break;case ne.Op.PLB:case ne.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1}return!0}},CB=class{static walk(r,e){let t=[],n=r,s;for(;;){if(n.subs.length===0)s=e.leaf(n);else{let i=e.enter(n);if(i.result===void 0){t.push({re:n,state:i,i:0}),n=n.subs[0];continue}s=i.result}for(;;){if(t.length===0)return s;let i=t[t.length-1];if(e.child(i.re,i.state,s,i.i),i.i++,i.state.result===void 0&&i.i<i.re.subs.length){n=i.re.subs[i.i];break}t.pop(),s=i.state.result!==void 0?i.state.result:e.leave(i.re,i.state)}}}},ya=class{constructor(r,e){let t=new Map,n=[0],s=[0],i=[0],B=[0];for(let d of r){let h=0;for(let x=0;x<d.length;x++){let S=h*e+d[x],E=t.get(S);E===void 0&&(E=n.length,t.set(S,E),n.push(h),s.push(d[x]),i.push(i[h]+1),B.push(0)),h=E}B[h]=1}let o=n.length,a=new Int32Array(o-1);for(let d=1;d<o;d++)a[d-1]=d;a.sort((d,h)=>n[d]-n[h]||s[d]-s[h]);let c=new Int32Array(o+1);for(let d=1;d<o;d++)c[n[d]+1]++;for(let d=0;d<o;d++)c[d+1]+=c[d];let u=new Int32Array(o-1);for(let d=0;d<a.length;d++)u[d]=s[a[d]];this.childStart=c,this.childUnit=u,this.childNode=a;let l=new Int32Array(o);for(let d=0;d<o;d++)l[d]=d;l.sort((d,h)=>i[d]-i[h]);let f=new Int32Array(o),C=Uint8Array.from(B);for(let d=1;d<o;d++){let h=l[d],x=n[h];if(x!==0){let S=f[x],E=this.next(S,s[h]);for(;E<0&&S!==0;)S=f[S],E=this.next(S,s[h]);f[h]=E>=0?E:0}C[h]|=C[f[h]]}this.fail=f,this.match=C}next(r,e){let t=this.childStart[r],n=this.childStart[r+1],s=this.childUnit;for(;t<n;){let i=t+n>>1,B=s[i];if(B===e)return this.childNode[i];B<e?t=i+1:n=i}return-1}advance(r,e){for(;;){let t=this.next(r,e);if(t>=0)return t;if(r===0)return 0;r=this.fail[r]}}searchUTF16(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r.charCodeAt(s)),this.match[n]===1)return!0;return!1}searchUTF8(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r[s]),this.match[n]===1)return!0;return!1}},oe=class Jn{static Type={NONE:0,EXACT:1,AND:2,OR:3};static MAX_SCANS=32;static MAX_AC_UNITS=1<<18;constructor(e){this.type=e,this.subs=[],this.str="",this.bytes=null,this.cost=e===Jn.Type.EXACT?1:0,this.allExact=!1,this.ac16=null,this.ac8=null}automaton16(){if(this.ac16===null){let e=this.subs.map(t=>{let n=new Array(t.str.length);for(let s=0;s<t.str.length;s++)n[s]=t.str.charCodeAt(s);return n});this.ac16=new ya(e,65536)}return this.ac16}automaton8(){return this.ac8===null&&(this.ac8=new ya(this.subs.map(e=>e.bytes),256)),this.ac8}eval(e,t){switch(this.type){case Jn.Type.NONE:return!0;case Jn.Type.EXACT:return e.hasString(this,t);case Jn.Type.AND:for(let n=0;n<this.subs.length;n++)if(!this.subs[n].eval(e,t))return!1;return!0;case Jn.Type.OR:if(this.allExact)return e.hasAnyString(this,t);for(let n=0;n<this.subs.length;n++)if(this.subs[n].eval(e,t))return!0;return!1;default:return!0}}},Yf=class Un{static build(e){return e?CB.walk(e,Un.WALKER):new oe(oe.Type.NONE)}static WALKER={leaf:e=>Un.leaf(e),enter:e=>Un.enter(e),child:(e,t,n)=>Un.child(e,t,n),leave:(e,t)=>Un.leave(e,t)};static leaf(e){if(e.op!==w.Op.LITERAL)return new oe(oe.Type.NONE);if(e.runes.length===0||(e.flags&$.FOLD_CASE)!==0)return new oe(oe.Type.NONE);let t="";for(let s=0;s<e.runes.length;s++){if(j.isUnsearchable(e.runes[s]))return new oe(oe.Type.NONE);t+=String.fromCodePoint(e.runes[s])}let n=new oe(oe.Type.EXACT);return n.str=t,n.bytes=U.stringToUtf8ByteArray(n.str),n}static enter(e){switch(e.op){case w.Op.CAPTURE:case w.Op.PLUS:return{sub:null};case w.Op.REPEAT:return e.min>=1?{sub:null}:{result:new oe(oe.Type.NONE)};case w.Op.CONCAT:return{pf:new oe(oe.Type.AND),subs:[]};case w.Op.ALTERNATE:return{pf:new oe(oe.Type.OR),subs:[]};default:return{result:new oe(oe.Type.NONE)}}}static child(e,t,n){if(t.subs===void 0){t.sub=n;return}if(t.pf.type===oe.Type.AND){if(n.type===oe.Type.NONE)return;if(n.type===oe.Type.AND){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n);return}if(n.type===oe.Type.NONE){t.result=new oe(oe.Type.NONE);return}if(n.type===oe.Type.OR){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n)}static leave(e,t){if(t.subs===void 0)return t.sub;let n=t.pf,s=new Set,i=[];for(let c of t.subs){if(c.type===oe.Type.EXACT){if(s.has(c.str))continue;s.add(c.str)}i.push(c)}if(n.type===oe.Type.AND){let c=[],u=0;for(let l of i)u+l.cost>oe.MAX_SCANS||(c.push(l),u+=l.cost);return c.length===0?new oe(oe.Type.NONE):c.length===1?c[0]:(n.subs=c,n.cost=u,n)}if(i.length===0)return new oe(oe.Type.NONE);if(i.length===1)return i[0];n.subs=i;let B=!0,o=0,a=0;for(let c of i)c.type!==oe.Type.EXACT?B=!1:a+=c.bytes.length,o+=c.cost;return B?a>oe.MAX_AC_UNITS?new oe(oe.Type.NONE):(n.allExact=!0,n.cost=1,n):o>oe.MAX_SCANS?new oe(oe.Type.NONE):(n.cost=o,n)}},dt=class{constructor(r=0,e=0){this.head=r,this.tail=e}},Qf=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0,this.lbInst=null}getInst(r){return this.inst[r]}numInst(){return this.inst.length}addInst(r){this.inst.push(new y(r))}markLookbehindInsts(){let r=new Uint8Array(this.inst.length),e=this.lbStarts.slice();for(;e.length>0;){let t=e.pop();if(t===0||r[t]===1)continue;r[t]=1;let n=this.inst[t];switch(n.op){case y.ALT:case y.ALT_MATCH:e.push(n.out,n.arg);break;case y.MATCH:case y.FAIL:break;default:e.push(n.out)}}this.lbInst=r}skipNop(r){let e=this.inst[r];for(;e.op===y.NOP||e.op===y.CAPTURE;)e=this.inst[r],r=e.out;return e}prefix(){let r="",e=this.skipNop(this.start);if(!y.isRuneOp(e.op)||e.runes.length!==1)return[e.op===y.MATCH,r];for(;y.isRuneOp(e.op)&&e.runes.length===1&&(e.arg&$.FOLD_CASE)===0&&!j.isUnsearchable(e.runes[0]);)r+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===y.MATCH,r]}startCond(){let r=0,e=this.start;e:for(;;){let t=this.inst[e];switch(t.op){case y.EMPTY_WIDTH:r|=t.arg;break;case y.FAIL:return-1;case y.CAPTURE:case y.NOP:break;default:break e}e=t.out}return r}patch(r,e){let t=r.head;for(;t!==0;){let n=this.inst[t>>1];(t&1)===0?(t=n.out,n.out=e):(t=n.arg,n.arg=e)}}append(r,e){if(r.head===0)return e;if(e.head===0)return r;let t=this.inst[r.tail>>1];return(r.tail&1)===0?t.out=e.head:t.arg=e.head,new dt(r.head,e.tail)}toString(){let r="";for(let e=0;e<this.inst.length;e++){let t=r.length;r+=e,e===this.start&&(r+="*"),r+=" ".substring(r.length-t),r+=this.inst[e],r+=`
|
|
61
|
-
`}return r}},
|
|
62
|
-
`)-1,
|
|
63
|
-
`)+1,j.MAX_RUNE]),
|
|
64
|
-
`)-1&&e[2]===
|
|
65
|
-
`)+1&&e[3]===j.MAX_RUNE&&(s.op=
|
|
66
|
-
`)-1&&e.runes[2]===
|
|
67
|
-
`)+1&&e.runes[3]===j.MAX_RUNE)return new w(w.Op.ANY_CHAR_NOT_NL)}return e}static enter(e){switch(e.op){case w.Op.PLB:case w.Op.NLB:case w.Op.CAPTURE:case w.Op.STAR:case w.Op.PLUS:case w.Op.QUEST:return{sub:null};case w.Op.CONCAT:case w.Op.ALTERNATE:return{subs:[],changed:!1};case w.Op.REPEAT:return e.min===0&&e.max===0?{result:new w(w.Op.EMPTY_MATCH)}:{sub:null};default:return{result:e}}}static child(e,t,n,s){if(t.subs===void 0){t.sub=n;return}if(n!==e.subs[s]&&(t.changed=!0),e.op===w.Op.CONCAT){if(n.op===w.Op.NO_MATCH){t.result=new w(w.Op.NO_MATCH);return}if(n.op===w.Op.EMPTY_MATCH){t.changed=!0;return}if(n.op===w.Op.CONCAT){t.changed=!0;for(let i=0;i<n.subs.length;i++)t.subs.push(n.subs[i]);return}}else{if(n.op===w.Op.NO_MATCH){t.changed=!0;return}if(n.op===w.Op.ALTERNATE){t.changed=!0;for(let i=0;i<n.subs.length;i++)t.subs.push(n.subs[i]);return}}t.subs.push(n)}static leave(e,t){switch(e.op){case w.Op.PLB:case w.Op.NLB:case w.Op.CAPTURE:{let n=t.sub;if(n!==e.subs[0]){let s=w.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=[n],s}return e}case w.Op.CONCAT:case w.Op.ALTERNATE:if(t.changed){let n=t.subs;if(n.length===0)return new w(e.op===w.Op.CONCAT?w.Op.EMPTY_MATCH:w.Op.NO_MATCH);if(n.length===1)return n[0];let s=w.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=n,s}return e;case w.Op.STAR:case w.Op.PLUS:case w.Op.QUEST:return Ke.simplify1(e.op,e.flags,t.sub,e);case w.Op.REPEAT:return Ke.simplifyRepeat(e,t.sub);default:return e}}static simplifyRepeat(e,t){if(e.max===-1){if(e.min===0)return Ke.simplify1(w.Op.STAR,e.flags,t,null);if(e.min===1)return Ke.simplify1(w.Op.PLUS,e.flags,t,null);let s=[];for(let i=0;i<e.min-1;i++)s.push(t);return s.push(Ke.simplify1(w.Op.PLUS,e.flags,t,null)),Ke.concat(s)}if(e.min===1&&e.max===1)return t;let n=null;if(e.min>0){n=[];for(let s=0;s<e.min;s++)n.push(t)}if(e.max>e.min){let s=Ke.simplify1(w.Op.QUEST,e.flags,t,null);for(let i=e.min+1;i<e.max;i++)s=Ke.simplify1(w.Op.QUEST,e.flags,Ke.concat([t,s]),null);if(n===null)return s;n.push(s)}return n!==null?Ke.concat(n):new w(w.Op.NO_MATCH)}static concat(e){let t=[];for(let s=0;s<e.length;s++){let i=e[s];if(i.op===w.Op.NO_MATCH)return new w(w.Op.NO_MATCH);if(i.op!==w.Op.EMPTY_MATCH){if(i.op===w.Op.CONCAT){for(let B=0;B<i.subs.length;B++)t.push(i.subs[B]);continue}t.push(i)}}if(t.length===0)return new w(w.Op.EMPTY_MATCH);if(t.length===1)return t[0];let n=new w(w.Op.CONCAT);return n.subs=t,n}static simplify1(e,t,n,s){if(n.op===w.Op.EMPTY_MATCH)return n;if(n.op===w.Op.NO_MATCH)return e===w.Op.PLUS?n:new w(w.Op.EMPTY_MATCH);if(e===n.op&&(t&$.NON_GREEDY)===(n.flags&$.NON_GREEDY))return n;if(s!==null&&s.op===e&&(s.flags&$.NON_GREEDY)===(t&$.NON_GREEDY)&&n===s.subs[0])return s;let i=new w(e);return i.flags=t,i.subs=[n],i}},fe=class{constructor(r,e){this.sign=r,this.cls=e}},Ra=[48,57],Fa=[9,10,12,13,32,32],Ia=[48,57,65,90,95,95,97,122],Ta=new Map([["\\d",new fe(1,Ra)],["\\D",new fe(-1,Ra)],["\\s",new fe(1,Fa)],["\\S",new fe(-1,Fa)],["\\w",new fe(1,Ia)],["\\W",new fe(-1,Ia)]]),La=[48,57,65,90,97,122],$a=[65,90,97,122],Na=[0,127],Ma=[9,9,32,32],Ga=[0,31,127,127],Ha=[48,57],Pa=[33,126],_a=[97,122],Ja=[32,126],Ua=[33,47,58,64,91,96,123,126],ja=[9,13,32,32],Ka=[65,90],za=[48,57,65,90,95,95,97,122],Ya=[48,57,65,70,97,102],Qa=new Map([["[:alnum:]",new fe(1,La)],["[:^alnum:]",new fe(-1,La)],["[:alpha:]",new fe(1,$a)],["[:^alpha:]",new fe(-1,$a)],["[:ascii:]",new fe(1,Na)],["[:^ascii:]",new fe(-1,Na)],["[:blank:]",new fe(1,Ma)],["[:^blank:]",new fe(-1,Ma)],["[:cntrl:]",new fe(1,Ga)],["[:^cntrl:]",new fe(-1,Ga)],["[:digit:]",new fe(1,Ha)],["[:^digit:]",new fe(-1,Ha)],["[:graph:]",new fe(1,Pa)],["[:^graph:]",new fe(-1,Pa)],["[:lower:]",new fe(1,_a)],["[:^lower:]",new fe(-1,_a)],["[:print:]",new fe(1,Ja)],["[:^print:]",new fe(-1,Ja)],["[:punct:]",new fe(1,Ua)],["[:^punct:]",new fe(-1,Ua)],["[:space:]",new fe(1,ja)],["[:^space:]",new fe(-1,ja)],["[:upper:]",new fe(1,Ka)],["[:^upper:]",new fe(-1,Ka)],["[:word:]",new fe(1,za)],["[:^word:]",new fe(-1,za)],["[:xdigit:]",new fe(1,Ya)],["[:^xdigit:]",new fe(-1,Ya)]]),Cn=class Hs{static charClassToString(e,t){let n="[";for(let s=0;s<t;s+=2){s>0&&(n+=" ");let i=e[s],B=e[s+1];i===B?n+=`0x${i.toString(16)}`:n+=`0x${i.toString(16)}-0x${B.toString(16)}`}return n+="]",n}static sortRanges(e,t){let n=t>>1,s=new Array(n);for(let B=0;B<n;B++)s[B]=B;s.sort((B,o)=>e[2*B]-e[2*o]||e[2*o+1]-e[2*B+1]);let i=e.slice(0,t);for(let B=0;B<n;B++)e[2*B]=i[2*s[B]],e[2*B+1]=i[2*s[B]+1]}constructor(e=U.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.r instanceof Int32Array?this.len===this.r.length?this.r:this.r.subarray(0,this.len):new Int32Array(this.len===this.r.length?this.r:this.r.slice(0,this.len))}toGrowableArray(){return Array.isArray(this.r)?(this.r.length=this.len,this.r):Array.from(this.r.subarray(0,this.len))}cleanClass(){if(this.len<4)return this;Hs.sortRanges(this.r,this.len);let e=2;for(let t=2;t<this.len;t+=2){let n=this.r[t],s=this.r[t+1];if(n<=this.r[e-1]+1){s>this.r[e-1]&&(this.r[e-1]=s);continue}this.r[e]=n,this.r[e+1]=s,e+=2}return this.len=e,this}appendLiteral(e,t){return(t&$.FOLD_CASE)!==0?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0){for(let n=2;n<=4;n+=2)if(this.len>=n){let s=this.r[this.len-n],i=this.r[this.len-n+1];if(e<=i+1&&s<=t+1)return e<s&&(this.r[this.len-n]=e),t>i&&(this.r[this.len-n+1]=t),this}}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=j.MIN_FOLD&&t>=j.MAX_FOLD)return this.appendRange(e,t);if(t<j.MIN_FOLD||e>j.MAX_FOLD)return this.appendRange(e,t);e<j.MIN_FOLD&&(this.appendRange(e,j.MIN_FOLD-1),e=j.MIN_FOLD),t>j.MAX_FOLD&&(this.appendRange(j.MAX_FOLD+1,t),t=j.MAX_FOLD);for(let n=e;n<=t;n++){this.appendRange(n,n);for(let s=j.simpleFold(n);s!==n;s=j.simpleFold(s))this.appendRange(s,s)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let n=0;n<e.length;n+=2){let s=e[n],i=e[n+1];t<=s-1&&this.appendRange(t,s-1),t=i+1}return t<=j.MAX_RUNE&&this.appendRange(t,j.MAX_RUNE),this}appendTable(e){for(let t=0;t<e.length;++t){let n=e.getLo(t),s=e.getHi(t),i=e.getStride(t);if(i===1){this.appendRange(n,s);continue}for(let B=n;B<=s;B+=i)this.appendRange(B,B)}return this}appendNegatedTable(e){let t=0;for(let n=0;n<e.length;++n){let s=e.getLo(n),i=e.getHi(n),B=e.getStride(n);if(B===1){t<=s-1&&this.appendRange(t,s-1),t=i+1;continue}for(let o=s;o<=i;o+=B)t<=o-1&&this.appendRange(t,o-1),t=o+1}return t<=j.MAX_RUNE&&this.appendRange(t,j.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let n=0;n<this.len;n+=2){let s=this.r[n],i=this.r[n+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=i+1}return this.len=t,e<=j.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=j.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(e,t){let n=e.cls;return t&&(n=new Hs().appendFoldedClass(n).cleanClass().toArray()),this.appendClassWithSign(n,e.sign)}toString(){return Hs.charClassToString(this.r,this.len)}},Wf=class{constructor(r){this.str=r,this.position=0}pos(){return this.position}rewindTo(r){this.position=r}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(r){this.position+=r}skipString(r){this.position+=r.length}pop(){let r=this.str.codePointAt(this.position);return this.position+=U.charCount(r),r}lookingAt(r){return this.str.startsWith(r,this.position)}rest(){return this.str.substring(this.position)}from(r){return this.str.substring(r,this.position)}toString(){return this.rest()}},yr=class Q{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static ERR_INVALID_CAPTURE_IN_LOOKBEHIND="invalid capture in lookbehind";static MAX_HEIGHT=1e3;static MAX_SIZE=1398101;static MAX_RUNES=33554432;static ANY_TABLE=new p(new Uint32Array([0,j.MAX_RUNE,1]));static ASCII_TABLE=new p(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new p(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(e){return e==="Any"?{tab:Q.ANY_TABLE,fold:Q.ANY_TABLE,sign:1}:e==="Ascii"?{tab:Q.ASCII_TABLE,fold:Q.ASCII_FOLD_TABLE,sign:1}:e==="Assigned"?{tab:tt.CATEGORIES.get("Cn"),fold:tt.CATEGORIES.get("Cn"),sign:-1}:e==="Lc"?{tab:tt.CATEGORIES.get("LC"),fold:tt.FOLD_CATEGORIES.get("LC"),sign:1}:tt.CATEGORIES.has(e)?{tab:tt.CATEGORIES.get(e),fold:tt.FOLD_CATEGORIES.get(e),sign:1}:tt.SCRIPTS.has(e)?{tab:tt.SCRIPTS.get(e),fold:tt.FOLD_SCRIPT.get(e),sign:1}:null}static minFoldRune(e){if(e<j.MIN_FOLD||e>j.MAX_FOLD)return e;let t=e,n=e;for(e=j.simpleFold(e);e!==n;e=j.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===w.Op.EMPTY_MATCH)return null;if(e.op===w.Op.CONCAT&&e.subs.length>0){let t=e.subs[0];return t.op===w.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){let n=new w(w.Op.LITERAL);return n.flags=t,n.runes=U.stringToRunes(e),n}static parse(e,t){return new Q(e,t).parseInternal()}static parseRepeat(e){let t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);let n=Q.parseInt(e);if(n===-1||!e.more())return-1;let s;if(!e.lookingAt(","))s=n;else{if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))s=-1;else if((s=Q.parseInt(e))===-1)return-1}if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),n<0||n>1e3||s===-2||s>1e3||s>=0&&n>s)throw new we(Q.ERR_INVALID_REPEAT_SIZE,e.from(t));return n<<16|s&j.MAX_BMP}static isValidCaptureName(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n!==T.CODES.get("_")&&!U.isalnum(n))return!1}return!0}static parseInt(e){let t=e.pos();for(;e.more()&&e.peek()>=T.CODES.get("0")&&e.peek()<=T.CODES.get("9");)e.skip(1);let n=e.from(t);return n.length===0||n.length>1&&n.codePointAt(0)===T.CODES.get("0")?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(e){return e.op===w.Op.LITERAL&&e.runes.length===1||e.op===w.Op.CHAR_CLASS||e.op===w.Op.ANY_CHAR_NOT_NL||e.op===w.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case w.Op.LITERAL:return e.runes.length===1&&e.runes[0]===t;case w.Op.CHAR_CLASS:for(let n=0;n<e.runes.length;n+=2)if(e.runes[n]<=t&&t<=e.runes[n+1])return!0;return!1;case w.Op.ANY_CHAR_NOT_NL:return t!==T.CODES.get(`
|
|
68
|
-
`);case
|
|
69
|
-
`))&&(e.op=
|
|
70
|
-
`);case
|
|
71
|
-
`)-1&&e.runes[2]===
|
|
72
|
-
`)+1&&e.runes[3]===j.MAX_RUNE&&(e.runes=new Int32Array(0),e.op=
|
|
73
|
-
`),
|
|
74
|
-
`)));let B=!0;for(;!e.more()||e.peek()!==T.CODES.get("]")||B;){if(e.more()&&e.lookingAt("-")&&(this.flags&$.PERL_X)===0&&!B){let u=e.rest();if(u==="-"||!u.startsWith("-]"))throw e.rewindTo(t),new we(Q.ERR_INVALID_CHAR_RANGE,e.rest())}B=!1;let o=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,s))continue;e.rewindTo(o)}if(this.parseUnicodeClass(e,s)||this.parsePerlClassEscape(e,s))continue;e.rewindTo(o);let a=Q.parseClassChar(e,t),c=a;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(c=Q.parseClassChar(e,t),c<a)throw new we(Q.ERR_INVALID_CHAR_RANGE,e.from(o))}(this.flags&$.FOLD_CASE)===0?s.appendRange(a,c):s.appendFoldedRange(a,c)}e.skip(1),s.cleanClass(),i<0&&s.negateClass(),n.runes=s.toArray(),this.push(n)}},Vf=class dn{static initTest(e){let t=dn.compile(e),n=new dn(t.expr,t.prog,t.numSubexp,t.longest);return n.cond=t.cond,n.prefix=t.prefix,n.prefixUTF8=t.prefixUTF8,n.prefixComplete=t.prefixComplete,n.prefixRune=t.prefixRune,n.prefilter=t.prefilter,n}static compile(e){return dn.compileImpl(e,$.PERL,!1)}static compilePOSIX(e){return dn.compileImpl(e,$.POSIX,!0)}static compileImpl(e,t,n){let s=yr.parse(e,t),i=s.maxCap(),B=s.namedGroups;s=Bl.simplify(s);let o=Yf.build(s),a=il.compileRegexp(s),c=new dn(e,a,i,n);c.prefilter=o.type===oe.Type.NONE?null:o;let[u,l]=a.prefix();return c.prefixComplete=u,c.prefix=l,c.prefixUTF8=U.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=B,c}static match(e,t){return dn.compile(e).match(t)}constructor(e,t,n=0,s=0){this.expr=e,this.prog=t,this.numSubexp=n,this.longest=s,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.machinePool=[],this.dfa=new fB(this.prog),this.onepass=Oa.compile(this.prog),this.prefilter=null}matchPrefixComplete(e,t,n,s){if((n===$.ANCHOR_START||n===$.ANCHOR_BOTH)&&t!==0)return null;let i=-1,B=-1,o=e.prefixLength(this);if(n===$.UNANCHORED){let a=e.index(this,t);if(a<0)return null;i=t+a,B=i+o}else if(n===$.ANCHOR_BOTH){if(e.endPos()!==o||e.index(this,0)!==0)return null;i=0,B=o}else if(n===$.ANCHOR_START){if(e.index(this,0)!==0)return null;i=0,B=o}if(i<0)return null;if(s>0){let a=new Int32Array(s).fill(-1);return a[0]=i,a[1]=B,Array.from(a)}return[]}createLookbehindState(){return this.prog.numLb>0?new $f(this.prog):null}executeEngine(e,t,n,s,i=null){if(this.prefixComplete&&(s===0||this.numSubexp===0))return this.matchPrefixComplete(e,t,n,s);if(this.prefilter!==null&&n===$.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(this.onepass!==null)return Oa.execute(this,e,t,n,s);if(s>0)return this.prog.numLb===0&&e.endPos()<=Ms.maxBitStateLen(this.prog)?Ms.execute(this,e,t,n,s):this.doExecuteNFA(e,t,n,s,i);if(this.prog.numLb===0){let B=this.dfa.match(e,t,n);if(B!==null)return B?[]:null;if(e.endPos()<=Ms.maxBitStateLen(this.prog))return Ms.execute(this,e,t,n,s)}return this.doExecuteNFA(e,t,n,s,i)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(e){this.machinePool.push(e)}toString(){return this.expr}doExecuteNFA(e,t,n,s,i=null){let B=this.get();B||(B=tl.fromRE2(this)),B.init(s);let o=B.match(e,t,n,i)?B.submatches():null;return this.put(B),o}match(e){return this.executeEngine(be.fromUTF16(e),0,$.UNANCHORED,0)!==null}matchWithGroup(e,t,n,s,i,B=null){return e instanceof gn||(U.isByteArray(e)?e=pn.utf8(e):e=pn.utf16(e)),this.matchMachineInput(e,t,n,s,i,B)}matchMachineInput(e,t,n,s,i,B=null){if(t>n)return[!1,null];let o=e.isUTF16Encoding()?be.fromUTF16(e.asCharSequence(),0,n):be.fromUTF8(e.asBytes(),0,n),a=this.executeEngine(o,t,s,2*i,B);return a===null?[!1,null]:[!0,a]}matchUTF8(e){return this.executeEngine(be.fromUTF8(e),0,$.UNANCHORED,0)!==null}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,n){let s=0,i=0,B="",o=be.fromUTF16(e),a=this.createLookbehindState(),c=0;for(;i<=e.length;){let u=this.executeEngine(o,i,$.UNANCHORED,2,a);if(u===null||u.length===0)break;B+=e.substring(s,u[0]),(u[1]>s||u[0]===0)&&(B+=t(e.substring(u[0],u[1])),c++),s=u[1];let l=o.step(i)&7;if(i+l>u[1]?i+=l:i+1>u[1]?i++:i=u[1],c>=n)break}return B+=e.substring(s),B}pad(e){if(e===null)return null;let t=(1+this.numSubexp)*2;if(e.length<t){let n=new Array(t).fill(-1);for(let s=0;s<e.length;s++)n[s]=e[s];e=n}return e}allMatches(e,t,n=s=>s){let s=[],i=e.endPos();t<0&&(t=i+1);let B=0,o=0,a=-1,c=this.createLookbehindState();for(;o<t&&B<=i;){let u=this.executeEngine(e,B,$.UNANCHORED,this.prog.numCap,c);if(u===null||u.length===0)break;let l=!0;if(u[1]===B){u[0]===a&&(l=!1);let f=e.step(B);f<0?B=i+1:B+=f&7}else B=u[1];a=u[1],l&&(s.push(n(this.pad(u))),o++)}return s}findUTF8(e){let t=this.executeEngine(be.fromUTF8(e),0,$.UNANCHORED,2);return t===null?null:e.slice(t[0],t[1])}findUTF8Index(e){let t=this.executeEngine(be.fromUTF8(e),0,$.UNANCHORED,2);return t===null?null:t.slice(0,2)}find(e){let t=this.executeEngine(be.fromUTF16(e),0,$.UNANCHORED,2);return t===null?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(be.fromUTF16(e),0,$.UNANCHORED,2)}findUTF8Submatch(e){let t=this.executeEngine(be.fromUTF8(e),0,$.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.slice(t[2*s],t[2*s+1]));return n}findUTF8SubmatchIndex(e){return this.pad(this.executeEngine(be.fromUTF8(e),0,$.UNANCHORED,this.prog.numCap))}findSubmatch(e){let t=this.executeEngine(be.fromUTF16(e),0,$.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.substring(t[2*s],t[2*s+1]));return n}findSubmatchIndex(e){return this.pad(this.executeEngine(be.fromUTF16(e),0,$.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){let n=this.allMatches(be.fromUTF8(e),t,s=>e.slice(s[0],s[1]));return n.length===0?null:n}findAllUTF8Index(e,t){let n=this.allMatches(be.fromUTF8(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAll(e,t){let n=this.allMatches(be.fromUTF16(e),t,s=>e.substring(s[0],s[1]));return n.length===0?null:n}findAllIndex(e,t){let n=this.allMatches(be.fromUTF16(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAllUTF8Submatch(e,t){let n=this.allMatches(be.fromUTF8(e),t,s=>{let i=new Array(s.length/2|0).fill(null);for(let B=0;B<i.length;B++)s[2*B]>=0&&(i[B]=e.slice(s[2*B],s[2*B+1]));return i});return n.length===0?null:n}findAllUTF8SubmatchIndex(e,t){let n=this.allMatches(be.fromUTF8(e),t);return n.length===0?null:n}findAllSubmatch(e,t){let n=this.allMatches(be.fromUTF16(e),t,s=>{let i=new Array(s.length/2|0).fill(null);for(let B=0;B<i.length;B++)s[2*B]>=0&&(i[B]=e.substring(s[2*B],s[2*B+1]));return i});return n.length===0?null:n}findAllSubmatchIndex(e,t){let n=this.allMatches(be.fromUTF16(e),t);return n.length===0?null:n}},pp=class Ps{static UNANCHORED=$.UNANCHORED;static ANCHOR_START=$.ANCHOR_START;static ANCHOR_BOTH=$.ANCHOR_BOTH;constructor(e=Ps.UNANCHORED,t=0,n=8388608){this.anchor=e,this.jsFlags=t,this.maxMem=n;let s=$.PERL;(t&kt.DISABLE_UNICODE_GROUPS)!==0&&(s&=~$.UNICODE_GROUPS),(t&kt.LOOKBEHINDS)!==0&&(s|=$.LOOKBEHIND),this.re2Flags=s,this.regexps=[],this.prog=null,this.dfa=null,this.dummyRe2=null}add(e){if(this.prog)throw new Ar("Cannot add patterns after compile");let t=e;(this.jsFlags&kt.CASE_INSENSITIVE)!==0&&(t=`(?i)${t}`),(this.jsFlags&kt.DOTALL)!==0&&(t=`(?s)${t}`),(this.jsFlags&kt.MULTILINE)!==0&&(t=`(?m)${t}`);let n=yr.parse(t,this.re2Flags);return this.regexps.push(Bl.simplify(n)),this.regexps.length-1}compile(){if(this.prog)return;let e=il.compileSet(this.regexps);if(e.numInst()>yr.MAX_SIZE)throw new Ar(`${yr.ERR_LARGE}: the set compiles to ${e.numInst()} instructions, more than ${yr.MAX_SIZE}`);this.prog=e,this.dfa=new fB(this.prog,this.maxMem),this.dummyRe2={prog:this.prog,cond:this.prog.startCond(),prefix:"",prefixRune:0,longest:!1}}match(e){this.prog||this.compile();let t=U.isByteArray(e)?be.fromUTF8(e):be.fromUTF16(e),n=$.UNANCHORED;this.anchor===Ps.ANCHOR_START?n=$.ANCHOR_START:this.anchor===Ps.ANCHOR_BOTH&&(n=$.ANCHOR_BOTH);let s=this.dfa.matchSet(t,0,n);if(s!==null)return s;let i=tl.fromRE2(this.dummyRe2);return i.init(0),i.matchSet(t,0,n)}},Zf=class jn{static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static translate(e){let t="";if(e instanceof RegExp&&(e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e=e.source),typeof e!="string")return e;let n="",s=!1,i=e.length;i===0&&(n="(?:)",s=!0);let B=!1,o=0;for(;o<i;){let c=e[o];if(c==="\\"){if(o+1<i)switch(c=e[o+1],c){case"\\":n+="\\\\",o+=2;continue;case"c":if(o+2<i){let f=e[o+2].charCodeAt(0);if(f>=65&&f<=90||f>=97&&f<=122){let C=f%32;n+="\\x",n+=(C>>4).toString(16).toUpperCase(),n+=(C&15).toString(16).toUpperCase(),o+=3,s=!0;continue}}n+="c",o+=2,s=!0;continue;case"u":if(o+2<i){if(e[o+2]==="{"){let f=o+3,C=!1,d=!1;for(;f<i;){let h=e[f];if(h==="}"){d=!0;break}if(!jn.isHexadecimal(h))break;C=!0,f++}if(d&&C){n+="\\x",o+=2,s=!0;continue}}else if(o+5<i){let f=!0;for(let C=0;C<4;C++)if(!jn.isHexadecimal(e[o+2+C])){f=!1;break}if(f){n+="\\x{"+e.substring(o+2,o+6)+"}",o+=6,s=!0;continue}}}n+="u",o+=2,s=!0;continue;case"x":{let f=!1;if(o+2<i&&e[o+2]==="{"){let C=o+3,d=!1,h=!1;for(;C<i;){let x=e[C];if(x==="}"){h=!0;break}if(!jn.isHexadecimal(x))break;d=!0,C++}h&&d&&(f=!0)}else o+3<i&&jn.isHexadecimal(e[o+2])&&jn.isHexadecimal(e[o+3])&&(f=!0);f?(n+="\\x",o+=2):(n+="x",o+=2,s=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":n+="\\"+c,o+=2;continue;default:{let f=e.codePointAt(o+1);if(f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122){let C=U.charCount(f);n+=e.substring(o+1,o+1+C),o+=C+1,s=!0}else{n+="\\";let C=U.charCount(f);n+=e.substring(o+1,o+1+C),o+=C+1}continue}}}else if(c==="/"){n+="\\/",o+=1,s=!0;continue}else if(c==="[")B=!0;else if(c==="]")B=!1;else if(!B&&c==="("&&o+2<i&&e[o+1]==="?"&&e[o+2]==="<"&&o+3<i&&!"=!>)".includes(e[o+3])){n+="(?P<",o+=3,s=!0;continue}let u=e.codePointAt(o),l=U.charCount(u);n+=e.substring(o,o+l),o+=l}let a=s?n:e;return t.length>0?`(?${t})${a}`:a}},Kn=class ze{static CASE_INSENSITIVE=kt.CASE_INSENSITIVE;static DOTALL=kt.DOTALL;static MULTILINE=kt.MULTILINE;static DISABLE_UNICODE_GROUPS=kt.DISABLE_UNICODE_GROUPS;static LONGEST_MATCH=kt.LONGEST_MATCH;static LOOKBEHINDS=kt.LOOKBEHINDS;static quote(e){return U.quoteMeta(e)}static quoteReplacement(e,t=!1){return ka.quoteReplacement(e,t)}static translateRegExp(e){return Zf.translate(e)}static compile(e,t=0){let n=e;if((t&ze.CASE_INSENSITIVE)!==0&&(n=`(?i)${n}`),(t&ze.DOTALL)!==0&&(n=`(?s)${n}`),(t&ze.MULTILINE)!==0&&(n=`(?m)${n}`),(t&~(ze.MULTILINE|ze.DOTALL|ze.CASE_INSENSITIVE|ze.DISABLE_UNICODE_GROUPS|ze.LONGEST_MATCH|ze.LOOKBEHINDS))!==0)throw new Lf("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let s=$.PERL;(t&ze.DISABLE_UNICODE_GROUPS)!==0&&(s&=~$.UNICODE_GROUPS),(t&ze.LOOKBEHINDS)!==0&&(s|=$.LOOKBEHIND);let i=new ze(e,t);return i.re2Input=Vf.compileImpl(n,s,(t&ze.LONGEST_MATCH)!==0),i}static matches(e,t){return ze.compile(e).testExact(t)}static initTest(e,t,n){if(e==null)throw new Error("pattern is null");if(n==null)throw new Error("re2 is null");let s=new ze(e,t);return s.re2Input=n,s}constructor(e,t){this.patternInput=e,this.flagsInput=t,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.testExact(e)}matcher(e){return U.isByteArray(e)&&(e=pn.utf8(e)),new ka(this,e)}test(e){return U.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){let t=U.isByteArray(e)?be.fromUTF8(e):be.fromUTF16(e);return this.re2Input.executeEngine(t,0,$.ANCHOR_BOTH,0)!==null}exec(e){let t=this.matcher(e);if(!t.find())return null;let n=[t.group(0)];for(let i=1;i<=t.groupCount();i++){let B=t.group(i);n.push(B===null?void 0:B)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let i=t.getNamedGroups();for(let B in i)i[B]===null&&(i[B]=void 0);n.groups=i}else n.groups=void 0;return n}split(e,t=0){let n=this.matcher(e),s=[],i=0,B=0;for(;n.find();){if(B===0&&n.end()===0){B=n.end();continue}if(t>0&&s.length===t-1)break;if(B===n.start()){if(t===0){i+=1,B=n.end();continue}}else for(;i>0;)s.push(""),i-=1;s.push(n.substring(B,n.start())),B=n.end()}if(t===0&&B!==n.inputLength()){for(;i>0;)s.push(""),i-=1;s.push(n.substring(B,n.inputLength()))}return(t!==0||s.length===0&&!(B===n.inputLength()&&B>0))&&s.push(n.substring(B,n.inputLength())),s}*matchAll(e){let t=this.matcher(e);for(;t.find();){let n=[t.group(0)];for(let i=1;i<=t.groupCount();i++){let B=t.group(i);n.push(B===null?void 0:B)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let i=t.getNamedGroups();for(let B in i)i[B]===null&&(i[B]=void 0);n.groups=i}else n.groups=void 0;yield n}}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e?!0:e===null||this.constructor!==e.constructor?!1:this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput}};var ol="kubectl config current-context",Xf=/^[A-Za-z0-9][A-Za-z0-9._:@/+-]*$/;function al(r){return r.length<=253&&Xf.test(r)}var eC=/^\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}$/;function mn(r){return r===void 0?void 0:eC.exec(r)?.[1]}function _s(r){return al(r)||mn(r)!==void 0}function Tr(r,e){return r.kubeContext??e?.kubeContext}function Js(r,e){let t=mn(r);if(t===void 0)return r;let n=e(t);if(n===void 0)throw new Error(`md-runbook: kube-context \${param:${t}} has no value: nothing ran`);if(!al(n))throw new Error(`md-runbook: kube-context \${param:${t}} is ${JSON.stringify(n)}, which is not a Kubernetes context name: nothing ran`);return n}function ll(r){let e=mn(r);return e===void 0?"":`\${param:${e}}`}function tC(r,e){let t=e.stdout.split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");if(e.exitCode===0&&t===r)return;let n=`md-runbook: this runbook is for the Kubernetes context ${r}`;if(e.exitCode===0&&t!==void 0)return`${n}, and kubectl's current context is ${t}: nothing ran. Switch with \`kubectl config use-context ${r}\`, or open the runbook meant for ${t}.`;let s=(e.stderr??"").split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");return`${n}, and \`${ol}\` ${s?`failed (${s})`:"named no context"}: nothing ran.`}async function ul(r,e,t=!1){if(r===void 0)return;let n;try{n=await e(t?hl(r):ol)}catch(s){n={exitCode:null,stdout:"",stderr:s instanceof Error?s.message:String(s)}}return t?nC(r,n):tC(r,n)}var cl=["check","pin"];function fl(r){return`# md-runbook: the Kubernetes context of a runbook with kube-context-mode: pin.
|
|
58
|
+
`}function rn(r){let e=[],t=s=>`\0${e.push(s)-1}\0`,n=r.replace(/\u0000/g,"");for(n=n.replace(/(`+)([\s\S]*?[^`])\1(?!`)/g,(s,i,o)=>t(`<code>${re(o.replace(/^ (.*) $/,"$1"))}</code>`)),n=n.replace(/\\([!-/:-@[-`{-~])/g,(s,i)=>t(re(i))),n=re(n),n=n.replace(/!?\[([^\]]*)\]\(([^)\s]*)(?:\s+"[^)]*?")?\)/g,(s,i,o)=>{let B=tu(o.replace(/&/g,"&")),a=eu(i)||o;return t(B===void 0?a:`<a href="${re(B)}">${a}</a>`)}),n=n.replace(/<((?:https?:\/\/|mailto:)[^\s&]+(?:&[^\s&]+)*)>/g,(s,i)=>t(`<a href="${i}">${i}</a>`)),n=eu(n);/\u0000\d+\u0000/.test(n);)n=n.replace(/\u0000(\d+)\u0000/g,(s,i)=>e[Number(i)]);return n}function eu(r){return r.replace(/\*\*(?=\S)([\s\S]*?\S)\*\*/g,"<strong>$1</strong>").replace(/(^|[^\w])__(?=\S)([\s\S]*?\S)__(?!\w)/g,"$1<strong>$2</strong>").replace(/\*(?=[^\s*])([\s\S]*?[^\s*])\*/g,"<em>$1</em>").replace(/(^|[^\w])_(?=[^\s_])([\s\S]*?[^\s_])_(?!\w)/g,"$1<em>$2</em>").replace(/~~(?=\S)([\s\S]*?\S)~~/g,"<del>$1</del>")}var N=class An{static FOLD_CASE=1;static LITERAL=2;static CLASS_NL=4;static DOT_NL=8;static ONE_LINE=16;static NON_GREEDY=32;static PERL_X=64;static UNICODE_GROUPS=128;static WAS_DOLLAR=256;static LOOKBEHIND=512;static MATCH_NL=An.CLASS_NL|An.DOT_NL;static PERL=An.CLASS_NL|An.ONE_LINE|An.PERL_X|An.UNICODE_GROUPS;static POSIX=0;static UNANCHORED=0;static ANCHOR_START=1;static ANCHOR_BOTH=2},Ot={CASE_INSENSITIVE:1,DOTALL:2,MULTILINE:4,DISABLE_UNICODE_GROUPS:8,LONGEST_MATCH:16,LOOKBEHINDS:512},Wr=128,Fo=new Int32Array(Wr),$o=new Int32Array(Wr),Xs=65535;for(let r=0;r<Wr;r++)r>=97&&r<=122?Fo[r]=r-32:Fo[r]=r,r>=65&&r<=90?$o[r]=r+32:$o[r]=r;var L=class{static CODES=new Map([["\x07",7],["\b",8],[" ",9],[`
|
|
59
|
+
`,10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["'",39],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["`",96],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]]);static toUpperCase(r){if(r<Wr)return Fo[r];let e=String.fromCodePoint(r).toUpperCase(),t=e.codePointAt(0)>Xs?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),s=n.codePointAt(0)>Xs?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}static toLowerCase(r){if(r<Wr)return $o[r];let e=String.fromCodePoint(r).toLowerCase(),t=e.codePointAt(0)>Xs?2:1;if(e.length>t)return r;let n=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),s=n.codePointAt(0)>Xs?2:1;return n.length>s||n.codePointAt(0)!==r?r:e.codePointAt(0)}},C=class{constructor(r,e=!1){this.data=r,this.isStride1=e,this.SIZE=e?2:3}getLo(r){return this.data[r*this.SIZE]}getHi(r){return this.data[r*this.SIZE+1]}getStride(r){return this.isStride1?1:this.data[r*this.SIZE+2]}get length(){return this.data.length/this.SIZE}},$u=new Uint8Array(256);for(let r=0,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";r<64;r++)$u[e.charCodeAt(r)]=r;var Iu=r=>{let e=[],t=0,n=0;for(let s=0;s<r.length;s++){let i=$u[r.charCodeAt(s)];t|=(i&31)<<n,(i&32)===0?(e.push(t),t=0,n=0):n+=5}return e},g=(r,e)=>{let t=Iu(r),n=e?t.length/2:t.length/3,s=new Uint32Array(n*3),i=0,o=0;for(let B=0;B<n;B++)i+=t[o++],s[B*3]=i,i+=t[o++],s[B*3+1]=i,s[B*3+2]=e?1:t[o++];return s},Pd=r=>{let e=Iu(r),t=new Map,n=0;for(let s=0;s<e.length;s+=2){n+=e[s];let i=e[s+1],o=i>>>1^-(i&1);t.set(n,n+o)}return t},ei=class{constructor(r){this.initializer=r,this.cache=new Map}has(r){return r in this.initializer}get(r){if(this.cache.has(r))return this.cache.get(r);let e=this.initializer[r],t=e?e():null;return this.cache.set(r,t),t}},st=class{static _CASE_ORBIT=null;static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=Pd("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BC-BB-BB-BB-BB-BB-BB-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBC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DCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBGbbBOBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new C(g("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))});static get Upper(){return this.CATEGORIES.get("Lu")}static SCRIPTS=new ei({Adlam:()=>new C(g("go6DrCFJFB",!0)),Ahom:()=>new C(g("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new C(g("ggxCmS",!0)),Arabic:()=>new C(g("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new C(g("xpBlBDxBDCks9BE",!0)),Avestan:()=>new C(g("g4iC1BEG",!0)),Balinese:()=>new C(g("g4GsCCxB",!0)),Bamum:()=>new C(g("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new C(g("w26CdDF",!0)),Batak:()=>new C(g("g+GzBJD",!0)),Bengali:()=>new C(g("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new C(g("g17CYDY",!0)),Bhaiksuki:()=>new C(g("ggnCICsBCNLc",!0)),Bopomofo:()=>new C(g("qXB6wLqBxDf",!0)),Brahmi:()=>new C(g("ggkCtCFjBKA",!0)),Braille:()=>new C(g("ggK-H",!0)),Buginese:()=>new C(g("gwGbDB",!0)),Buhid:()=>new C(g("g6FT",!0)),Canadian_Aboriginal:()=>new C(g("ggF-TxRlC7tgCP",!0)),Carian:()=>new C(g("g1gCwB",!0)),Caucasian_Albanian:()=>new C(g("wphCzBMA",!0)),Chakma:()=>new C(g("gokC0BCR",!0)),Cham:()=>new C(g("gwqB2BKNDJDD",!0)),Cherokee:()=>new C(g("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new C(g("w9jCb",!0)),Common:()=>new C(g("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new C(g("ifNxkKzDGG",!0)),Cuneiform:()=>new C(g("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new C(g("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new C(g("w8rCiD",!0)),Cyrillic:()=>new C(g("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new C(g("gghCvC",!0)),Devanagari:()=>new C(g("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new C(g("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new C(g("ggmC7B",!0)),Duployan:()=>new C(g("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new C(g("ggsC1iBL68D",!0)),Elbasan:()=>new C(g("gohCnB",!0)),Elymaic:()=>new C(g("g-jCW",!0)),Ethiopic:()=>new C(g("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCDBCBBCOB",!1)),Garay:()=>new C(g("gqjClBEcJB",!0)),Georgian:()=>new C(g("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new C(g("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new C(g("w5gCa",!0)),Grantha:()=>new C(g("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new C(g("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new C(g("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new C(g("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new C(g("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new C(g("go4C5B",!0)),Han:()=>new C(g("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new C(g("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new C(g("gojCnBJJ",!0)),Hanunoo:()=>new C(g("g5FU",!0)),Hatran:()=>new C(g("gniCSCBGE",!0)),Hebrew:()=>new C(g("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new C(g("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new C(g("giiCVCI",!0)),Inherited:()=>new C(g("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new C(g("g7iCSGH",!0)),Inscriptional_Parthian:()=>new C(g("g6iCVDH",!0)),Javanese:()=>new C(g("gsqBtCDJFB",!0)),Kaithi:()=>new C(g("gkkCiCLA",!0)),Kannada:()=>new C(g("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new C(g("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new C(g("g4nCQCoBEc",!0)),Kayah_Li:()=>new C(g("goqBtBCA",!0)),Kharoshthi:()=>new C(g("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new C(g("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new C(g("g8F9CDJHJnPf",!0)),Khojki:()=>new C(g("gwkCRCuB",!0)),Khudawadi:()=>new C(g("w1kC6BGJ",!0)),Kirat_Rai:()=>new C(g("gq7C5B",!0)),Lao:()=>new C(g("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new C(g("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new C(g("ggH3BEOEC",!0)),Limbu:()=>new C(g("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new C(g("gwhC2JKVLH",!0)),Linear_B:()=>new C(g("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new C(g("wmpBvBx1eA",!0)),Lycian:()=>new C(g("g0gCc",!0)),Lydian:()=>new C(g("gpiCZGA",!0)),Mahajani:()=>new C(g("wqkCmB",!0)),Makasar:()=>new C(g("g3nCY",!0)),Malayalam:()=>new C(g("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new C(g("giCbDA",!0)),Manichaean:()=>new C(g("g2iCmBFL",!0)),Marchen:()=>new C(g("wjnCfDVCN",!0)),Masaram_Gondi:()=>new C(g("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new C(g("gy7C6C",!0)),Meetei_Mayek:()=>new C(g("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new C(g("gg6DkGDP",!0)),Meroitic_Cursive:()=>new C(g("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new C(g("gsiCf",!0)),Miao:()=>new C(g("g47CqCF4BIQ",!0)),Modi:()=>new C(g("gwlCkCMJ",!0)),Mongolian:()=>new C(g("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new C(g("gy6CeCJFB",!0)),Multani:()=>new C(g("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>new C(g("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new C(g("gkiCeJI",!0)),Nag_Mundari:()=>new C(g("wm5DpB",!0)),Nandinagari:()=>new C(g("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new C(g("gsGrBFZHKEB",!0)),Newa:()=>new C(g("gglC7CCE",!0)),Nko:()=>new C(g("g+B6BDC",!0)),Nushu:()=>new C(g("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new C(g("go4DsBENDJFB",!0)),Ogham:()=>new C(g("g0Fc",!0)),Ol_Chiki:()=>new C(g("wiHvB",!0)),Ol_Onal:()=>new C(g("wu5DqBFA",!0)),Old_Hungarian:()=>new C(g("gkjCyBOyBIF",!0)),Old_Italic:()=>new C(g("g4gCjBKC",!0)),Old_North_Arabian:()=>new C(g("g0iCf",!0)),Old_Permic:()=>new C(g("w6gCqB",!0)),Old_Persian:()=>new C(g("g9gCjBFN",!0)),Old_Sogdian:()=>new C(g("g4jCnB",!0)),Old_South_Arabian:()=>new C(g("gziCf",!0)),Old_Turkic:()=>new C(g("ggjCoC",!0)),Old_Uyghur:()=>new C(g("w7jCZ",!0)),Oriya:()=>new C(g("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new C(g("wlhCjBFjB",!0)),Osmanya:()=>new C(g("gkhCdDJ",!0)),Pahawh_Hmong:()=>new C(g("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new C(g("gjiCf",!0)),Pau_Cin_Hau:()=>new C(g("g2mC4B",!0)),Phags_Pa:()=>new C(g("giqB3B",!0)),Phoenician:()=>new C(g("goiCbEA",!0)),Psalter_Pahlavi:()=>new C(g("g8iCRIDNG",!0)),Rejang:()=>new C(g("wpqBjBMA",!0)),Runic:()=>new C(g("g1FqCEK",!0)),Samaritan:()=>new C(g("ggCtBDO",!0)),Saurashtra:()=>new C(g("gkqBlCJL",!0)),Sharada:()=>new C(g("gskC-ChsCH",!0)),Shavian:()=>new C(g("wihCvB",!0)),Siddham:()=>new C(g("gslC1BDlB",!0)),Sidetic:()=>new C(g("gqiCZ",!0)),SignWriting:()=>new C(g("gg2DrUQECO",!0)),Sinhala:()=>new C(g("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new C(g("w5jCpB",!0)),Sora_Sompeng:()=>new C(g("wmkCYIJ",!0)),Soyombo:()=>new C(g("wymCyC",!0)),Sundanese:()=>new C(g("g8G-BhIH",!0)),Sunuwar:()=>new C(g("g+mChBPJ",!0)),Syloti_Nagri:()=>new C(g("ggqBsB",!0)),Syriac:()=>new C(g("g4BNC7BDCxIK",!0)),Tagalog:()=>new C(g("g4FVKA",!0)),Tagbanwa:()=>new C(g("g7FMCCCB",!0)),Tai_Le:()=>new C(g("wqGdDE",!0)),Tai_Tham:()=>new C(g("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new C(g("g0qBiCZE",!0)),Tai_Yo:()=>new C(g("g25DeCVJB",!0)),Takri:()=>new C(g("g0lC5BHJ",!0)),Tamil:()=>new C(g("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new C(g("wz6CuCCJ",!0)),Tangut:()=>new C(g("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new C(g("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new C(g("g8BxB",!0)),Thai:()=>new C(g("hwD5BGb",!0)),Tibetan:()=>new C(g("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new C(g("wpL3BIBPA",!0)),Tirhuta:()=>new C(g("gklCnCJJ",!0)),Todhri:()=>new C(g("guhCzB",!0)),Tolong_Siki:()=>new C(g("wtnCrBFJ",!0)),Toto:()=>new C(g("w04De",!0)),Tulu_Tigalari:()=>new C(g("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),Ugaritic:()=>new C(g("g8gCdCA",!0)),Unknown:()=>new C(g("4bBBHDBICCV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CBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new C(g("gopBrJ",!0)),Vithkuqi:()=>new C(g("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new C(g("g24D5BGA",!0)),Warang_Citi:()=>new C(g("glmCyCNA",!0)),Yezidi:()=>new C(g("g0jCpBCCDB",!0)),Yi:()=>new C(g("ggoBskBE2B",!0)),Zanabazar_Square:()=>new C(g("gwmCnC",!0))});static FOLD_CATEGORIES=new ei({L:()=>new C(g("laA",!0)),LC:()=>new C(g("laA",!0)),Ll:()=>new C(g("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Lt:()=>new C(g("kOCCBCCBCClBCCtsHHBJHBJHBMQQwBAB",!1)),Lu:()=>new C(g("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDD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FnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))});static FOLD_SCRIPT=new ei({Common:()=>new C(g("8cgBgB",!1)),Greek:()=>new C(g("1FwUwU",!1)),Inherited:()=>new C(g("5cgBgBlgHAB",!1))})},j=class qe{static MAX_RUNE=1114111;static RUNE_ERROR=65533;static isUnsearchable(e){return e===qe.RUNE_ERROR||e>=qe.MIN_HIGH_SURROGATE&&e<=qe.MAX_LOW_SURROGATE}static MAX_ASCII=127;static MAX_LATIN1=255;static MAX_BMP=65535;static MIN_FOLD=65;static MAX_FOLD=125251;static MIN_HIGH_SURROGATE=55296;static MAX_HIGH_SURROGATE=56319;static MIN_LOW_SURROGATE=56320;static MAX_LOW_SURROGATE=57343;static MIN_SUPPLEMENTARY_CODE_POINT=65536;static is32(e,t){let n=0,s=e.length;for(;n<s;){let i=n+Math.floor((s-n)/2),o=e.getLo(i),B=e.getHi(i);if(o<=t&&t<=B){let a=e.getStride(i);return(t-o)%a===0}t<o?s=i:n=i+1}return!1}static is(e,t){if(t<=qe.MAX_LATIN1){for(let n=0;n<e.length;n++){if(t>e.getHi(n))continue;let s=e.getLo(n);if(t<s)return!1;let i=e.getStride(n);return(t-s)%i===0}return!1}return e.length>0&&t>=e.getLo(0)&&qe.is32(e,t)}static isUpper(e){if(e<=qe.MAX_LATIN1){let t=String.fromCodePoint(e);return t.toUpperCase()===t&&t.toLowerCase()!==t}return qe.is(st.Upper,e)}static isPrint(e){return e<=qe.MAX_LATIN1?e>=32&&e<qe.MAX_ASCII||e>=161&&e!==173:qe.is(st.Print,e)}static simpleFold(e){if(st.CASE_ORBIT.has(e))return st.CASE_ORBIT.get(e);if(e<=qe.MAX_ASCII){let t=L.toLowerCase(e);return t!==e?t:L.toUpperCase(e)}return e}static equalsIgnoreCase(e,t){if(e===t)return!0;if(e<0||t<0)return!1;if(e<=qe.MAX_ASCII&&t<=qe.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=t&&t<=90&&(t|=32),e===t;for(let n=qe.simpleFold(e);n!==e;n=qe.simpleFold(n))if(n===t)return!0;return!1}},Lo=256,Tu=new Uint8Array(Lo);for(let r=0;r<Lo;r++)Tu[r]=97<=r&&r<=122||65<=r&&r<=90||48<=r&&r<=57||r===95?1:0;var yo=null,Ro=null,J=class dt{static METACHARACTERS="\\.+*?()|[]{}^$";static EMPTY_BEGIN_LINE=1;static EMPTY_END_LINE=2;static EMPTY_BEGIN_TEXT=4;static EMPTY_END_TEXT=8;static EMPTY_WORD_BOUNDARY=16;static EMPTY_NO_WORD_BOUNDARY=32;static EMPTY_ALL=-1;static emptyInts(){return[]}static isByteArray(e){return Array.isArray(e)||Object.prototype.toString.call(e)==="[object Uint8Array]"}static isalnum(e){return L.CODES.get("0")<=e&&e<=L.CODES.get("9")||L.CODES.get("a")<=e&&e<=L.CODES.get("z")||L.CODES.get("A")<=e&&e<=L.CODES.get("Z")}static unhex(e){return L.CODES.get("0")<=e&&e<=L.CODES.get("9")?e-L.CODES.get("0"):L.CODES.get("a")<=e&&e<=L.CODES.get("f")?e-L.CODES.get("a")+10:L.CODES.get("A")<=e&&e<=L.CODES.get("F")?e-L.CODES.get("A")+10:-1}static escapeRune(e){let t="";if(j.isPrint(e))dt.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(t+="\\"),t+=String.fromCodePoint(e);else switch(e){case L.CODES.get('"'):t+='\\"';break;case L.CODES.get("\\"):t+="\\\\";break;case L.CODES.get(" "):t+="\\t";break;case L.CODES.get(`
|
|
60
|
+
`):t+="\\n";break;case L.CODES.get("\r"):t+="\\r";break;case L.CODES.get("\b"):t+="\\b";break;case L.CODES.get("\f"):t+="\\f";break;default:{let n=e.toString(16);e<256?(t+="\\x",n.length===1&&(t+="0"),t+=n):t+=`\\x{${n}}`;break}}return t}static stringToRunes(e){let t=String(e),n=[],s=0;for(;s<t.length;){let i=t.codePointAt(s);n.push(i),s+=i>j.MAX_BMP?2:1}return new Int32Array(n)}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<Lo?Tu[e]===1:!1}static emptyOpContext(e,t){let n=0;return e<0&&(n|=dt.EMPTY_BEGIN_TEXT|dt.EMPTY_BEGIN_LINE),e===10&&(n|=dt.EMPTY_BEGIN_LINE),t<0&&(n|=dt.EMPTY_END_TEXT|dt.EMPTY_END_LINE),t===10&&(n|=dt.EMPTY_END_LINE),dt.isWordRune(e)!==dt.isWordRune(t)?n|=dt.EMPTY_WORD_BOUNDARY:n|=dt.EMPTY_NO_WORD_BOUNDARY,n}static quoteMeta(e){return e.split("").map(t=>dt.METACHARACTERS.indexOf(t)>=0?`\\${t}`:t).join("")}static charCount(e){return e>j.MAX_BMP?2:1}static toArray(e){let t=e.length,n=new Array(t);for(let s=0;s<t;s++)n[s]=e[s];return n}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return yo||(yo=new TextEncoder),yo.encode(e);{let t=[],n=0;for(let s=0;s<e.length;s++){let i=e.charCodeAt(s);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===j.MIN_HIGH_SURROGATE&&s+1<e.length&&(e.charCodeAt(s+1)&64512)===j.MIN_LOW_SURROGATE?(i=j.MIN_SUPPLEMENTARY_CODE_POINT+((i&1023)<<10)+(e.charCodeAt(++s)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){Ro||(Ro=new TextDecoder("utf-8"));let t=e instanceof Uint8Array?e:new Uint8Array(e);return Ro.decode(t)}else{let t=[],n=0,s=0;for(;n<e.length;){let i=e[n++];if(i<128)t[s++]=String.fromCharCode(i);else if(i>191&&i<224){let o=e[n++];t[s++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){let o=e[n++],B=e[n++],a=e[n++],c=((i&7)<<18|(o&63)<<12|(B&63)<<6|a&63)-j.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(j.MIN_HIGH_SURROGATE+(c>>10)),t[s++]=String.fromCharCode(j.MIN_LOW_SURROGATE+(c&1023))}else{let o=e[n++],B=e[n++];t[s++]=String.fromCharCode((i&15)<<12|(o&63)<<6|B&63)}}return t.join("")}}},Lu=(r=[],e=0)=>{let t=Object.create(null);for(let n=0;n<r.length;n++){let s=r[n],i=e+n;t[s]=i,t[i]=s}return Object.freeze(t)},In=class Io{static Encoding=Lu(["UTF_16","UTF_8"]);getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===Io.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===Io.Encoding.UTF_16}},iu=class extends In{constructor(r=null){super(),this.bytes=r}getEncoding(){return In.Encoding.UTF_8}asCharSequence(){return J.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},Hd=class extends In{constructor(r=null){super(),this.charSequence=r}getEncoding(){return In.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return J.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},$n=class{static utf16(r){return new Hd(r)}static utf8(r){return J.isByteArray(r)?new iu(r):new iu(J.stringToUtf8ByteArray(r))}},Ze=class{static EOF(){return-8}constructor(){this.end=0}canCheckPrefix(){return!0}endPos(){return this.end}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},_d=class lr extends Ze{static RUNE_ERROR_STEP=j.RUNE_ERROR<<3|1;constructor(e,t=0,n=e.length){super(),this.bytes=e,this.start=t,this.end=n}hasString(e,t){let n=e.bytes;if(n.length===0)return!0;let s=this.indexOf(this.bytes,n,this.start+t);return s!==-1&&s<=this.end-n.length}hasAnyString(e,t){return e.automaton8().searchUTF8(this.bytes,this.start+t,this.end)}step(e){if(e+=this.start,e>=this.end)return Ze.EOF();let t=this.bytes[e]&255;if(t<128)return t<<3|1;let n,s,i=128,o=191;if(t>=194&&t<=223)n=2,s=t&31;else if(t>=224&&t<=239)n=3,s=t&15,t===224?i=160:t===237&&(o=159);else if(t>=240&&t<=244)n=4,s=t&7,t===240?i=144:t===244&&(o=143);else return lr.RUNE_ERROR_STEP;if(e+n>this.end)return lr.RUNE_ERROR_STEP;let B=this.bytes[e+1]&255;if(B<i||B>o)return lr.RUNE_ERROR_STEP;if(s=s<<6|B&63,n>2){let a=this.bytes[e+2]&255;if((a&192)!==128)return lr.RUNE_ERROR_STEP;if(s=s<<6|a&63,n>3){let c=this.bytes[e+3]&255;if((c&192)!==128)return lr.RUNE_ERROR_STEP;s=s<<6|c&63}}return s<<3|n}index(e,t){t+=this.start;let n=this.indexOf(this.bytes,e.prefixUTF8,t);return n<0?n:n-t}context(e){e+=this.start;let t=-1;if(e>this.start&&e<=this.end){let s=e-1;if(t=this.bytes[s--],t>=128){let i=e-4;for(i<this.start&&(i=this.start);s>=i&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start);let o=this.step(s-this.start);t=s+(o&7)===e?o>>3:j.RUNE_ERROR}}let n=e<this.end?this.step(e-this.start)>>3:-1;return J.emptyOpContext(t,n)}indexOf(e,t,n=0){let s=t.length;if(s===0)return n<=this.end?n:-1;let i=t[0],o=this.end-s,B=typeof e.indexOf=="function",a=n;for(;a<=o;){if(B){if(a=e.indexOf(i,a),a===-1||a>o)return-1}else{for(;a<=o&&e[a]!==i;)a++;if(a>o)return-1}let c=!0;for(let l=1;l<s;l++)if(e[a+l]!==t[l]){c=!1;break}if(c)return a;a++}return-1}prefixLength(e){return e.prefixUTF8.length}},Jd=class extends Ze{constructor(r,e=0,t=r.length){super(),this.charSequence=r,this.start=e,this.end=t}hasString(r,e){let t=this.charSequence.indexOf(r.str,this.start+e);return t!==-1&&t<=this.end-r.str.length}hasAnyString(r,e){return r.automaton16().searchUTF16(this.charSequence,this.start+e,this.end)}step(r){if(r+=this.start,r>=this.end)return Ze.EOF();let e=this.charSequence.charCodeAt(r);if(e<j.MIN_HIGH_SURROGATE||e>j.MAX_HIGH_SURROGATE||r+1>=this.end)return e<<3|1;let t=this.charSequence.charCodeAt(r+1);return t>=j.MIN_LOW_SURROGATE&&t<=j.MAX_LOW_SURROGATE?(e-j.MIN_HIGH_SURROGATE)*1024+(t-j.MIN_LOW_SURROGATE)+j.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:e<<3|1}index(r,e){e+=this.start;let t=this.charSequence.indexOf(r.prefix,e);return t<0||t>this.end-r.prefix.length?-1:t-e}context(r){r+=this.start;let e=r>this.start&&r<=this.end?this.charSequence.charCodeAt(r-1):-1,t=r<this.end?this.charSequence.charCodeAt(r):-1;return J.emptyOpContext(e,t)}prefixLength(r){return r.prefix.length}},we=class{static fromUTF8(r,e=0,t=r.length){return new _d(r,e,t)}static fromUTF16(r,e=0,t=r.length){return new Jd(r,e,t)}},Vr=class extends Error{constructor(r){super(r),this.name="RE2JSException"}},xe=class extends Vr{constructor(r,e=null){let t=`error parsing regexp: ${r}`;e&&(t+=`: \`${e}\``),super(t),this.name="RE2JSSyntaxException",this.message=t,this.error=r,this.input=e}getDescription(){return this.error}getPattern(){return this.input}},Yr=class extends Vr{constructor(r){super(r),this.name="RE2JSCompileException"}},rt=class extends Vr{constructor(r){super(r),this.name="RE2JSGroupException"}},Ud=class extends Vr{constructor(r){super(r),this.name="RE2JSFlagsException"}},Qr=class extends Vr{constructor(r){super(r),this.name="RE2JSInternalException"}},ou=class Nu{static MAX_REPLACER_ARGS=65535;static quoteReplacement(e,t=!1){return t?e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(n=>{let s=n.codePointAt(0);return s===L.CODES.get("\\")||s===L.CODES.get("$")?`\\${n}`:n}).join(""):e.indexOf("$")<0?e:e.split("").map(n=>n.codePointAt(0)===L.CODES.get("$")?"$$":n).join("")}constructor(e,t){if(e===null)throw new Error("pattern is null");this.patternInput=e;let n=this.patternInput.re2();this.patternGroupCount=n.numberOfCapturingGroups(),this.groups=[],this.namedGroups=n.namedGroups,this.numberOfInstructions=n.numberOfInstructions(),this.lookbehindState=null,t instanceof In?this.resetMatcherInput(t):J.isByteArray(t)?this.resetMatcherInput($n.utf8(t)):this.resetMatcherInput($n.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(e===null)throw new Error("input is null");return e instanceof In||(J.isByteArray(e)?e=$n.utf8(e):e=$n.utf16(e)),this.matcherInput=e,this.lookbehindState!==null?this.lookbehindState.reset():this.lookbehindState=this.patternInput.re2().createLookbehindState(),this.reset(),this}start(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new rt(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e]}end(e=0){if(typeof e=="string"){let t=this.namedGroups[e];if(!Number.isFinite(t))throw new rt(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if(typeof e=="string"){let s=this.namedGroups[e];if(!Number.isFinite(s))throw new rt(`group '${e}' not found`);e=s}let t=this.start(e),n=this.end(e);return t<0&&n<0?null:this.substring(t,n)}getNamedGroups(){if(!this.hasMatch)throw new rt("perhaps no match attempted");let e=Object.create(null);for(let t of Object.keys(this.namedGroups))e[t]=this.group(t);return e}groupCount(){return this.patternGroupCount}loadGroup(e){if(!Number.isInteger(e)||e<0||e>this.patternGroupCount)throw new rt(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new rt("perhaps no match attempted");if(e===0||this.hasGroups)return;let t=this.matcherInputLength,n=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount,this.lookbehindState);if(!n[0])throw new rt("inconsistency in matching group data");this.groups=n[1],this.hasGroups=!0}matches(){return this.genMatch(0,N.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,N.ANCHOR_START)}find(e=null){if(e!==null){if(!Number.isInteger(e)||e<0||e>this.matcherInputLength)throw new rt(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}if(e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1])){let t=(this.matcherInput.isUTF16Encoding()?we.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):we.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=t&7}return this.genMatch(e,N.UNANCHORED)}genMatch(e,t){let n=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1,this.lookbehindState);return n[0]?(this.groups=n[1],this.hasMatch=!0,this.hasGroups=this.patternGroupCount===0,this.anchorFlag=t,!0):(this.hasMatch=!1,!1)}substring(e,t){return this.matcherInput.isUTF8Encoding()?J.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,t=!1){let n="",s=this.start(),i=this.end();return this.appendPos<s&&(n+=this.substring(this.appendPos,s)),this.appendPos=i,n+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),n}appendReplacementInternalJava(e){let t="",n=0,s=e.length,i=0;for(;i<s;){let o=e.codePointAt(i);if(o===L.CODES.get("\\")){if(n<i&&(t+=e.substring(n,i)),i++,i>=s)throw new rt("character to be escaped is missing");n=i,i++;continue}if(o===L.CODES.get("$")){if(n<i&&(t+=e.substring(n,i)),i+1>=s)throw new rt("Illegal group reference: group index is missing");let B=e.codePointAt(i+1);if(L.CODES.get("0")<=B&&B<=L.CODES.get("9")){let a=B-L.CODES.get("0"),c=i+2;for(;c<s;c++){let u=e.codePointAt(c);if(u<L.CODES.get("0")||u>L.CODES.get("9")||a*10+u-L.CODES.get("0")>this.patternGroupCount)break;a=a*10+u-L.CODES.get("0")}if(a>this.patternGroupCount)throw new rt(`n > number of groups: ${a}`);let l=this.group(a);l!==null&&(t+=l),i=c,n=i}else if(B===L.CODES.get("{")){let a=i+2;for(;a<s&&e.codePointAt(a)!==L.CODES.get("}");)a++;if(a>=s)throw new rt("named capture group is missing trailing '}'");let c=e.substring(i+2,a),l=this.group(c);l!==null&&(t+=l),i=a+1,n=i}else throw new rt("Illegal group reference");continue}i++}return n<s&&(t+=e.substring(n,s)),t}appendReplacementInternalJs(e){let t="",n=0,s=e.length;for(let i=0;i<s-1;i++)if(e.codePointAt(i)===L.CODES.get("$")){let o=e.codePointAt(i+1);if(L.CODES.get("$")===o){n<i&&(t+=e.substring(n,i)),t+="$",i++,n=i+1;continue}else if(L.CODES.get("&")===o){n<i&&(t+=e.substring(n,i));let B=this.group(0);B!==null?t+=B:t+="$&",i++,n=i+1;continue}else if(L.CODES.get("`")===o){n<i&&(t+=e.substring(n,i)),t+=this.substring(0,this.start(0)),i++,n=i+1;continue}else if(L.CODES.get("'")===o){n<i&&(t+=e.substring(n,i)),t+=this.substring(this.end(0),this.matcherInputLength),i++,n=i+1;continue}else if(L.CODES.get("1")<=o&&o<=L.CODES.get("9")){let B=o-L.CODES.get("0");for(n<i&&(t+=e.substring(n,i)),i+=2;i<s&&(o=e.codePointAt(i),!(o<L.CODES.get("0")||o>L.CODES.get("9")||B*10+o-L.CODES.get("0")>this.patternGroupCount));i++)B=B*10+o-L.CODES.get("0");if(B>this.patternGroupCount){t+=`$${B}`,n=i,i--;continue}let a=this.group(B);a!==null&&(t+=a),n=i,i--;continue}else if(o===L.CODES.get("<")){n<i&&(t+=e.substring(n,i)),i++;let B=i+1;for(;B<e.length&&e.codePointAt(B)!==L.CODES.get(">")&&e.codePointAt(B)!==L.CODES.get(" ");)B++;if(B===e.length||e.codePointAt(B)!==L.CODES.get(">")){t+=e.substring(i-1,B+1),n=B+1,i=B;continue}let a=e.substring(i+1,B);if(Object.prototype.hasOwnProperty.call(this.namedGroups,a)){let c=this.group(a);c!==null&&(t+=c)}else t+=`$<${a}>`;n=B+1,i=B;continue}}return n<s&&(t+=e.substring(n,s)),t}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,t=!1){return this.replace(e,!0,t)}replaceFirst(e,t=!1){return this.replace(e,!1,t)}replace(e,t=!0,n=!1){let s="";this.reset();let i=typeof e=="function",o=Object.keys(this.namedGroups).length>0,B=null;if(i){if(this.groupCount()>=Nu.MAX_REPLACER_ARGS)throw new rt("Too many capture groups to safely invoke replacer function");B=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(s+=i?this.appendReplacementFunc(e,o,B):this.appendReplacement(e,n),!!t););return s+=this.appendTail(),s}appendReplacementFunc(e,t,n){let s="",i=this.start(),o=this.end();this.appendPos<i&&(s+=this.substring(this.appendPos,i)),this.appendPos=o;let B=this.buildReplacerArgs(i,t,n);return s+=String(e(...B)),s}buildReplacerArgs(e,t,n){let s=[this.group(0)],i=this.groupCount();for(let o=1;o<=i;o++){let B=this.start(o);B<0?s.push(void 0):s.push(this.substring(B,this.end(o)))}if(s.push(e),s.push(n),t){let o=this.getNamedGroups();for(let B in o)o[B]===null&&(o[B]=void 0);s.push(o)}return s}},F=class Je{static ALT=1;static ALT_MATCH=2;static CAPTURE=3;static EMPTY_WIDTH=4;static FAIL=5;static MATCH=6;static NOP=7;static RUNE=8;static RUNE1=9;static RUNE_ANY=10;static RUNE_ANY_NOT_NL=11;static LB_WRITE=12;static LB_CHECK=13;static isRuneOp(e){return Je.RUNE<=e&&e<=Je.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let n of e)t+=J.escapeRune(n);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=new Int32Array(0),this.next=null}matchRune(e){if(this.runes.length===1){let o=this.runes[0];return(this.arg&N.FOLD_CASE)!==0?j.equalsIgnoreCase(o,e):e===o}let t=this.runes.length;if(t===0)return!1;if(t===2||t===4||t===6||t===8){for(let o=0;o<t;o+=2){if(e<this.runes[o])return!1;if(e<=this.runes[o+1])return!0}return!1}let n=0,s=t>>1;for(;s>1;){let o=s>>1;n+=this.runes[n+o<<1]<=e?o:0,s-=o}n+=this.runes[n<<1]<=e?1:0;let i=n-1;return i>=0&&e<=this.runes[i<<1|1]}matchRunePos(e){if(this.runes.length===1){let o=this.runes[0];return(this.arg&N.FOLD_CASE)!==0?j.equalsIgnoreCase(o,e)?0:-1:e===o?0:-1}let t=this.runes.length;if(t===0)return-1;if(t===2||t===4||t===6||t===8){for(let o=0;o<t;o+=2){if(e<this.runes[o])return-1;if(e<=this.runes[o+1])return Math.floor(o/2)}return-1}let n=0,s=t>>1;for(;s>1;){let o=s>>1;n+=this.runes[n+o<<1]<=e?o:0,s-=o}n+=this.runes[n<<1]<=e?1:0;let i=n-1;return i>=0&&e<=this.runes[i<<1|1]?i:-1}toString(){switch(this.op){case Je.ALT:return`alt -> ${this.out}, ${this.arg}`;case Je.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case Je.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case Je.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case Je.MATCH:return`match${this.arg!==0?` ${this.arg}`:""}`;case Je.FAIL:return"fail";case Je.NOP:return`nop -> ${this.out}`;case Je.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case Je.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case Je.RUNE:return this.runes===null?"rune <null>":["rune ",Je.escapeRunes(this.runes),(this.arg&N.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case Je.RUNE1:return`rune1 ${Je.escapeRunes(this.runes)} -> ${this.out}`;case Je.RUNE_ANY:return`any -> ${this.out}`;case Je.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},Bu=class Mu{constructor(e){this.sparse=new Int32Array(e),this.densePcs=new Int32Array(e),this.denseCaps=null,this.size=0,this.ncap=0,this.mainThreads=0}static INITIAL_THREADS=32;init(e){this.ncap=e;let t=Math.min(this.densePcs.length,Mu.INITIAL_THREADS)*e;(!this.denseCaps||this.denseCaps.length<t)&&(this.denseCaps=new Int32Array(t))}growCaps(e){let t=this.densePcs.length*this.ncap,n=new Int32Array(Math.min(t,Math.max(e,2*this.denseCaps.length)));n.set(this.denseCaps),this.denseCaps=n}contains(e){let t=this.sparse[e];return t<this.size&&this.densePcs[t]===e}isEmpty(){return this.size===0}add(e){let t=this.size++;return this.sparse[e]=t,this.densePcs[t]=e,t}clear(){this.size=0,this.mainThreads=0}toString(){let e="{";for(let t=0;t<this.size;t++)t!==0&&(e+=", "),e+=this.densePcs[t];return e+="}",e}},jd=class{constructor(r){this.pos=-1,this.pcs=new Int32Array(r.numInst()),this.size=0,this.lbTable=new Int32Array(r.numLb+1)}reset(){this.pos=-1,this.size=0}},Gu=class Pu{static fromRE2(e){let t=new Pu;return t.prog=e.prog,t.re2=e,t.q0=new Bu(t.prog.numInst()),t.q1=new Bu(t.prog.numInst()),t.addStack=new Int32Array(2*(t.prog.numInst()+1)),t.matched=!1,t.matchcap=new Int32Array(t.prog.numCap<2?2:t.prog.numCap),t.ncap=0,t}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.addStack=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(e){this.ncap=e,e>this.matchcap.length?this.matchcap=new Int32Array(e).fill(-1):this.matchcap.fill(-1),this.q0.init(e),this.q1.init(e),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return this.ncap===0?J.emptyInts():J.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,n,s=null){let i=this.re2.cond;if(i===J.EMPTY_ALL||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return!1;this.matched=!1,this.matchcap.fill(-1);let o=this.prog.numLb>0,B=t,a=t,c=!1;o&&(s!==null&&s.pos>=0&&s.pos<=t?(a=s.pos,c=!0):a=0);let l=o&&s!==null,u=this.q0,f=this.q1,d=e.step(a),h=d>>3,p=d&7,w=-1,D=0;d!==Ze.EOF()&&(d=e.step(a+p),w=d>>3,D=d&7);let m;for(a===0?m=J.emptyOpContext(-1,h):m=e.context(a),o&&(c?this.restoreLookbehinds(s,u,m):this.spawnLookbehinds(u,a,m));;){if(u.mainThreads===0){if((i&J.EMPTY_BEGIN_TEXT)!==0&&a!==0||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&a!==0||this.matched)break;if(this.prog.numLb===0&&u.isEmpty()&&this.re2.prefix.length!==0&&w!==this.re2.prefixRune&&e.canCheckPrefix()){let R=e.index(this.re2,a);if(R<0)break;a+=R,d=e.step(a),h=d>>3,p=d&7,d=e.step(a+p),w=d>>3,D=d&7,m=e.context(a)}}a>=B&&(l&&(this.saveLookbehinds(s,u,a),l=!1),!this.matched&&(a===0||n===N.UNANCHORED)&&(this.ncap>0&&(this.matchcap[0]=a),this.add(u,this.prog.start,a,this.matchcap,0,m)));let b=a+p;if(m=e.context(b),this.step(u,f,a,b,h,m,n,a===e.endPos()),p===0||this.ncap===0&&this.matched)break;a+=p,h=w,p=D,h!==-1&&(d=e.step(a+p),w=d>>3,D=d&7);let v=u;u=f,f=v}return u.clear(),f.clear(),this.matched}matchSet(e,t,n){let s=this.re2.cond;if(s===J.EMPTY_ALL)return[];if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return[];let i=this.prog.numLb>0?0:t,o=t,B=this.q0,a=this.q1,c=e.step(i),l=c>>3,u=c&7,f=-1,d=0;c!==Ze.EOF()&&(c=e.step(i+u),f=c>>3,d=c&7);let h=i===0?J.emptyOpContext(-1,l):e.context(i),p=new Set;for(this.prog.numLb>0&&this.spawnLookbehinds(B,i,h);!(B.mainThreads===0&&((s&J.EMPTY_BEGIN_TEXT)!==0&&i!==0||(n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&i!==0));){(i===0||n===N.UNANCHORED)&&i>=o&&this.add(B,this.prog.start,i,this.matchcap,0,h);let w=i+u;h=e.context(w);for(let m=0;m<B.size;m++){let b=B.densePcs[m],v=this.prog.inst[b],R=m*this.ncap,S=!1;switch(v.op){case F.MATCH:if(n===N.ANCHOR_BOTH&&i!==e.endPos())break;p.add(v.arg);break;case F.RUNE:S=v.matchRune(l);break;case F.RUNE1:S=l===v.runes[0];break;case F.RUNE_ANY:S=!0;break;case F.RUNE_ANY_NOT_NL:S=l!==10;break;default:continue}S&&this.add(a,v.out,w,B.denseCaps,R,h)}if(B.clear(),u===0)break;i+=u,l=f,u=d,l!==-1&&(c=e.step(i+u),f=c>>3,d=c&7);let D=B;B=a,a=D}return a.clear(),Array.from(p).sort((w,D)=>w-D)}step(e,t,n,s,i,o,B,a){let c=this.re2.longest;for(let l=0;l<e.size;l++){let u=e.densePcs[l],f=l*this.ncap;if(c&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[f])continue;let d=this.prog.inst[u],h=!1;switch(d.op){case F.MATCH:if(B===N.ANCHOR_BOTH&&!a)break;if(this.ncap>0&&(!c||!this.matched||this.matchcap[1]<n)){e.denseCaps[f+1]=n;for(let p=0;p<this.ncap;p++)this.matchcap[p]=e.denseCaps[f+p]}c||(e.size=0),this.matched=!0;break;case F.RUNE:h=d.matchRune(i);break;case F.RUNE1:h=i===d.runes[0];break;case F.RUNE_ANY:h=!0;break;case F.RUNE_ANY_NOT_NL:h=i!==10;break;default:continue}h&&this.add(t,d.out,s,e.denseCaps,f,o)}e.clear()}spawnLookbehinds(e,t,n){for(let s=0;s<this.prog.lbStarts.length;s++)this.add(e,this.prog.lbStarts[s],t,this.matchcap,0,n)}restoreLookbehinds(e,t,n){this.lbTable.set(e.lbTable);for(let s=0;s<e.size;s++)this.add(t,e.pcs[s],e.pos,this.matchcap,0,n)}saveLookbehinds(e,t,n){let s=0;for(let i=0;i<t.size;i++){let o=t.densePcs[i];this.prog.lbInst[o]===1&&F.isRuneOp(this.prog.inst[o].op)&&(e.pcs[s++]=o)}e.size=s,e.pos=n,e.lbTable.set(this.lbTable)}add(e,t,n,s,i,o){let B=this.addStack,a=0;for(;;){for(;t!==0&&!e.contains(t);){let l=e.add(t),u=this.prog.inst[t];switch(u.op){case F.FAIL:t=0;break;case F.ALT:case F.ALT_MATCH:B[a++]=u.arg,B[a++]=0,t=u.out;break;case F.EMPTY_WIDTH:t=(u.arg&~o)===0?u.out:0;break;case F.NOP:t=u.out;break;case F.CAPTURE:u.arg<this.ncap&&(B[a++]=-u.arg-1,B[a++]=s[i+u.arg],s[i+u.arg]=n),t=u.out;break;case F.LB_WRITE:this.lbTable[Math.abs(u.arg)]=n,t=u.out;break;case F.LB_CHECK:u.arg>0?t=this.lbTable[u.arg]===n?u.out:0:t=this.lbTable[-u.arg]!==n?u.out:0;break;case F.MATCH:case F.RUNE:case F.RUNE1:case F.RUNE_ANY:case F.RUNE_ANY_NOT_NL:if(this.prog.lbInst[t]===0&&e.mainThreads++,this.ncap>0){let f=l*this.ncap;f+this.ncap>e.denseCaps.length&&e.growCaps(f+this.ncap);for(let d=0;d<this.ncap;d++)e.denseCaps[f+d]=s[i+d]}t=0;break;default:throw new Qr("unhandled")}}if(a===0)return;a-=2;let c=B[a];c<0?(s[i-c-1]=B[a+1],t=0):t=c}}},Kd=(r,e,t)=>{let n=-2128831035;for(let s=0;s<r.length;s++)n^=r[s],n=Math.imul(n,16777619);n^=e,n=Math.imul(n,16777619);for(let s=0;s<t.length;s++)n^=t[s],n=Math.imul(n,16777619);return n},au=(r,e)=>{if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0},Oo=[],zr=-1,zd=class{constructor(r,e,t){this.nfaStates=r,this.flag=e,this.isMatch=(e&No.FLAG_MATCH)!==0,this.matchIDs=t,this.next=null,this.nextAnchored=null}},No=class pt{static FLAG_EMPTY_MASK=255;static FLAG_MATCH=256;static FLAG_LAST_WORD=512;static FLAG_NEED_SHIFT=16;static STATE_OVERHEAD=160;static TABLE_OVERHEAD=16;static PROGRESS_PER_STATE=10;constructor(e,t=8388608){this.prog=e,this.maxMem=t,this.stateCache=new Map,this.stateCount=0,this.startStates=new Map,this.failed=!1;for(let n=0;n<e.numInst();n++){let s=e.getInst(n).op;if(s===F.LB_WRITE||s===F.LB_CHECK){this.failed=!0;break}}this.computeRuneClasses(),this.stateBudget=t,this.memBudget=t}computeRuneClasses(){let e=new Set,t=(s,i)=>{e.add(s),e.add(i+1)};for(let s=0;s<this.prog.numInst();s++){let i=this.prog.getInst(s);switch(i.op){case F.RUNE:case F.RUNE1:if(i.runes.length===1){if(t(i.runes[0],i.runes[0]),(i.arg&N.FOLD_CASE)!==0)for(let o=j.simpleFold(i.runes[0]);o!==i.runes[0];o=j.simpleFold(o))t(o,o)}else for(let o=0;o<i.runes.length;o+=2)t(i.runes[o],i.runes[o+1]);break;case F.RUNE_ANY_NOT_NL:t(10,10);break;case F.EMPTY_WIDTH:(i.arg&(J.EMPTY_BEGIN_LINE|J.EMPTY_END_LINE))!==0&&t(10,10),(i.arg&(J.EMPTY_WORD_BOUNDARY|J.EMPTY_NO_WORD_BOUNDARY))!==0&&(t(48,57),t(65,90),t(95,95),t(97,122))}}e.delete(0),this.classBounds=Int32Array.from(e).sort(),this.numClasses=this.classBounds.length+1;let n=new Int32Array(j.MAX_LATIN1+1);for(let s=0;s<=j.MAX_LATIN1;s++)n[s]=this.searchClass(s);this.latin1Class=n}runeClass(e){return e<=j.MAX_LATIN1?this.latin1Class[e]:this.searchClass(e)}searchClass(e){let t=this.classBounds,n=0,s=t.length;for(;n<s;){let i=n+s>>1;t[i]<=e?n=i+1:s=i}return n}closure(e,t){let n=new Set,s=Array.from(e),i=0;for(;s.length>0;){let o=s.pop();if(o===0||n.has(o))continue;n.add(o);let B=this.prog.getInst(o);switch(B.op){case F.ALT:case F.ALT_MATCH:s.push(B.out),s.push(B.arg);break;case F.NOP:case F.CAPTURE:s.push(B.out);break;case F.EMPTY_WIDTH:i|=B.arg,(B.arg&~t)===0&&s.push(B.out)}}return{pcs:Int32Array.from(n).sort(),needflags:i}}getState(e,t,n){let s=Kd(e,t,n),i=this.stateCache.get(s);if(i)for(let a=0;a<i.length;a++){let c=i[a];if(c.flag===t&&au(c.nfaStates,e)&&au(c.matchIDs,n))return c}let o=pt.STATE_OVERHEAD+4*e.length+8*n.length;if(this.memBudget<o)return null;this.memBudget-=o,i||(i=[],this.stateCache.set(s,i));let B=new zd(e,t,n);return i.push(B),this.stateCount++,B}makeState(e,t,n){let s=this.closure(e,t&pt.FLAG_EMPTY_MASK),i=t;return s.needflags===0&&(i&=pt.FLAG_MATCH),i|=s.needflags<<pt.FLAG_NEED_SHIFT,this.getState(s.pcs,i,n)}allocTable(e,t){let n=this.numClasses+1,s=pt.TABLE_OVERHEAD+8*n;if(this.memBudget<s)return null;this.memBudget-=s;let i=new Array(n).fill(null);return t===N.UNANCHORED?e.next=i:e.nextAnchored=i,i}clearCache(){this.stateCache.clear(),this.stateCount=0,this.startStates.clear(),this.memBudget=this.stateBudget}resetCache(e){return this.clearCache(),this.getState(e.nfaStates,e.flag,e.matchIDs)}step(e,t,n,s){let i=s===N.UNANCHORED?e.next:e.nextAnchored;if(i!==null){let m=i[t];if(m!==null)return m}else if(i=this.allocTable(e,s),i===null)return null;let o=e.flag>>>pt.FLAG_NEED_SHIFT,B=e.flag&pt.FLAG_EMPTY_MASK,a=B,c=0;n===10&&(a|=J.EMPTY_END_LINE,c|=J.EMPTY_BEGIN_LINE),n===zr&&(a|=J.EMPTY_END_LINE|J.EMPTY_END_TEXT);let l=(e.flag&pt.FLAG_LAST_WORD)!==0,u=n!==zr&&J.isWordRune(n);a|=u===l?J.EMPTY_NO_WORD_BOUNDARY:J.EMPTY_WORD_BOUNDARY;let f=e.nfaStates;(a&~B&o)!==0&&(f=this.closure(f,a).pcs);let d=[],h=!1,p=Oo;for(let m=0;m<f.length;m++){let b=this.prog.getInst(f[m]);b.op===F.MATCH?(h||(h=!0,p=[]),p.push(b.arg)):n!==zr&&F.isRuneOp(b.op)&&b.matchRune(n)&&d.push(b.out)}p.length>1&&p.sort((m,b)=>m-b),s===N.UNANCHORED&&n!==zr&&d.push(this.prog.start);let w=c;h&&(w|=pt.FLAG_MATCH),u&&(w|=pt.FLAG_LAST_WORD);let D=this.makeState(d,w,p);return D===null?null:(i[t]=D,D)}start(e,t){let n=e.context(t),s;if((n&J.EMPTY_BEGIN_TEXT)!==0)s=J.EMPTY_BEGIN_TEXT|J.EMPTY_BEGIN_LINE;else if((n&J.EMPTY_BEGIN_LINE)!==0)s=J.EMPTY_BEGIN_LINE;else{let o=e.step(t),B=o>=0&&J.isWordRune(o>>3);s=(n&J.EMPTY_WORD_BOUNDARY)!==0!==B?pt.FLAG_LAST_WORD:0}let i=this.startStates.get(s);if(i===void 0){if(i=this.makeState([this.prog.start],s,Oo),i===null&&(this.clearCache(),i=this.makeState([this.prog.start],s,Oo),i===null))return null;this.startStates.set(s,i)}return i}stepOrReset(e,t,n,s,i,o){let B=this.step(e,t,n,s);if(B!==null)return B;if(o.resetPos>=0&&i-o.resetPos<pt.PROGRESS_PER_STATE*this.stateCount)return null;o.resetPos=i;let a=this.resetCache(e);return a===null?null:(B=this.step(a,t,n,s),B)}run(e,t,n,s,i){let o=e.endPos(),B=this.latin1Class,a=n===N.UNANCHORED,c={resetPos:-1},l=t;for(;l<o;){let u=e.step(l),f=u>>3,d=u&7;if(d===0)break;let h=f<=j.MAX_LATIN1?B[f]:this.runeClass(f),p=a&&s.next!==null?s.next[h]:null;if(p===null&&(p=this.stepOrReset(s,h,f,n,l,c),p===null))return null;if(s=p,s.isMatch&&i(s,!1))return!0;if(!a&&s.nfaStates.length===0)return!1;l+=d}return s=this.stepOrReset(s,this.numClasses,zr,n,l,c),s===null?null:s.isMatch&&i(s,!0)}match(e,t,n){if(this.failed)return null;if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return!1;let s=this.start(e,t);return s===null?null:this.run(e,t,n,s,(i,o)=>n!==N.ANCHOR_BOTH||o)}matchSet(e,t,n){if(this.failed)return null;if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return[];let s=this.start(e,t);if(s===null)return null;let i=new Set,o=(B,a)=>{if(n!==N.ANCHOR_BOTH||a)for(let c=0;c<B.matchIDs.length;c++)i.add(B.matchIDs[c]);return!1};return this.run(e,t,n,s,o)===null?null:Array.from(i).sort((B,a)=>B-a)}},qd=32,Yd=500,Ao=256,Qd=262144,Wd=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(Ao),this.jobArg=new Uint8Array(Ao),this.jobPos=new Int32Array(Ao),this.jobLen=0,this.visited=new Uint32Array(0)}reset(r,e,t){this.end=e,this.jobLen=0,this.ncap=t;let n=r.numInst()*(e+1)+qd-1>>>5;this.visited.length<n?this.visited=new Uint32Array(n):this.visited.fill(0,0,n),this.cap.length<t?this.cap=new Int32Array(t).fill(-1):this.cap.fill(-1,0,t),this.matchcap.length<t?this.matchcap=new Int32Array(t).fill(-1):this.matchcap.fill(-1,0,t)}shouldVisit(r,e){let t=r*(this.end+1)+e,n=t>>>5,s=1<<(t&31);return(this.visited[n]&s)!==0?!1:(this.visited[n]|=s,!0)}push(r,e,t,n){if(r.prog.getInst(e).op!==F.FAIL&&(n||this.shouldVisit(e,t))){if(this.jobLen>=this.jobPc.length){let s=this.jobPc.length*2,i=new Int32Array(s);i.set(this.jobPc),this.jobPc=i;let o=new Uint8Array(s);o.set(this.jobArg),this.jobArg=o;let B=new Int32Array(s);B.set(this.jobPos),this.jobPos=B}this.jobPc[this.jobLen]=e,this.jobArg[this.jobLen]=n?1:0,this.jobPos[this.jobLen]=t,this.jobLen++}}tryBacktrack(r,e,t,n,s){let i=r.longest;for(this.push(r,t,n,!1);this.jobLen>0;){this.jobLen--;let o=this.jobPc[this.jobLen],B=this.jobArg[this.jobLen]===1,a=this.jobPos[this.jobLen],c=!0;for(;!(!c&&!this.shouldVisit(o,a));){c=!1;let l=r.prog.getInst(o);switch(l.op){case F.FAIL:throw new Qr("unexpected InstFail");case F.ALT:if(B){B=!1,o=l.arg;continue}else{this.push(r,o,a,!0),o=l.out;continue}case F.ALT_MATCH:{let u=r.prog.getInst(l.out);if(F.isRuneOp(u.op)){this.push(r,l.arg,a,!1),o=l.arg,a=this.end;continue}this.push(r,l.out,this.end,!1),o=l.out;continue}case F.RUNE:{let u=e.step(a);if(u===Ze.EOF()||!l.matchRune(u>>3))break;a+=u&7,o=l.out;continue}case F.RUNE1:{let u=e.step(a);if(u===Ze.EOF()||u>>3!==l.runes[0])break;a+=u&7,o=l.out;continue}case F.RUNE_ANY_NOT_NL:{let u=e.step(a);if(u===Ze.EOF()||u>>3===10)break;a+=u&7,o=l.out;continue}case F.RUNE_ANY:{let u=e.step(a);if(u===Ze.EOF())break;a+=u&7,o=l.out;continue}case F.CAPTURE:if(B){this.cap[l.arg]=a;break}else{l.arg<this.ncap&&(this.push(r,o,this.cap[l.arg],!0),this.cap[l.arg]=a),o=l.out;continue}case F.EMPTY_WIDTH:{let u=e.context(a);if((l.arg&~u)!==0)break;o=l.out;continue}case F.NOP:o=l.out;continue;case F.MATCH:{if(s===N.ANCHOR_BOTH&&a!==this.end)break;if(this.ncap===0)return!0;this.ncap>1&&(this.cap[1]=a);let u=this.matchcap[1];if((u===-1||i&&a>0&&a>u)&&this.matchcap.set(this.cap),!i||a===this.end)return!0;break}case F.LB_WRITE:case F.LB_CHECK:throw new Qr("Backtracker cannot evaluate Lookbehind instructions");default:throw new Qr("bad inst")}break}}return i&&this.matchcap.length>1&&this.matchcap[1]>=0}},ti=[],ni=class Hu{static shouldBacktrack(e){return e.numInst()<=Yd}static maxBitStateLen(e){return Hu.shouldBacktrack(e)?Math.floor(Qd/e.numInst()):0}static execute(e,t,n,s,i){let o=e.cond;if(o===J.EMPTY_ALL||(s===N.ANCHOR_START||s===N.ANCHOR_BOTH)&&n!==0||(o&J.EMPTY_BEGIN_TEXT)!==0&&n!==0)return null;let B=ti.length>0?ti.pop():new Wd,a=t.endPos();B.reset(e.prog,a,i);let c=!1;if((o&J.EMPTY_BEGIN_TEXT)!==0||s===N.ANCHOR_START||s===N.ANCHOR_BOTH)B.ncap>0&&(B.cap[0]=n),B.tryBacktrack(e,t,e.prog.start,n,s)&&(c=!0);else{let u=-1;for(;n<=a&&u!==0;n+=u){if(e.prefix.length>0){let d=t.index(e,n);if(d<0)break;n+=d}if(B.ncap>0&&(B.cap[0]=n),B.tryBacktrack(e,t,e.prog.start,n,s)){c=!0;break}let f=t.step(n);u=f===Ze.EOF()?0:f&7}}if(!c)return ti.push(B),null;let l=i===0?[]:J.toArray(B.matchcap.subarray(0,i));return ti.push(B),l}},uu=class{constructor(r){this.sparse=new Uint32Array(r),this.dense=new Uint32Array(r),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(r){return r<this.sparse.length&&this.sparse[r]<this.size&&this.dense[this.sparse[r]]===r}insert(r){this.contains(r)||this.insertNew(r)}insertNew(r){r>=this.sparse.length||(this.sparse[r]=this.size,this.dense[this.size]=r,this.size++)}},Vd=(r,e,t,n)=>{let s=r.length,i=e.length,o=0,B=0,a=[],c=[],l=!0,u=-1,f=d=>{let h=d?r:e,p=d?o:B,w=d?t:n;return u>0&&h[p]<=a[u]?!1:(a.push(h[p],h[p+1]),d?o+=2:B+=2,u+=2,c.push(w),!0)};for(;o<s||B<i;)if(B>=i?l=f(!0):o>=s||e[B]<r[o]?l=f(!1):l=f(!0),!l)return null;return{merged:a,next:c}},Zd=class{constructor(r){this.start=r.start,this.numCap=r.numCap,this.inst=new Array(r.inst.length);for(let e=0;e<r.inst.length;e++){let t=r.inst[e],n=new F(t.op);n.out=t.out,n.arg=t.arg,n.runes=t.runes?new Int32Array(t.runes):new Int32Array(0),n.next=null,this.inst[e]=n}}},Xd=r=>{let e=new Zd(r);for(let t=0;t<e.inst.length;t++){let n=e.inst[t];if(n.op!==F.ALT&&n.op!==F.ALT_MATCH)continue;let s="out",i="arg",o=e.inst[n[i]];if(o.op!==F.ALT&&o.op!==F.ALT_MATCH&&(s="arg",i="out",o=e.inst[n[i]],o.op!==F.ALT&&o.op!==F.ALT_MATCH))continue;let B=e.inst[n[s]];if(B.op===F.ALT||B.op===F.ALT_MATCH)continue;let a="out",c="arg",l=!1;o.out===t?l=!0:o.arg===t&&(l=!0,a="arg",c="out"),l&&(o[a]=n[s]),n[s]===o[a]&&(n[i]=o[c])}return e},ep=r=>{if(r.inst.length>=1e3)return null;let e=new uu(r.inst.length),t=new uu(r.inst.length),n=new Array(r.inst.length),s=new Array(r.inst.length).fill(!1),i=o=>{let B=!0,a=r.inst[o];if(t.contains(o))return!0;switch(t.insert(o),a.op){case F.ALT:case F.ALT_MATCH:{B=i(a.out)&&i(a.arg);let c=s[a.out],l=s[a.arg];if(c&&l)return!1;if(l){let h=a.out;a.out=a.arg,a.arg=h;let p=c;c=l,l=p}c&&(s[o]=!0,a.op=F.ALT_MATCH);let u=n[a.out]||[],f=n[a.arg]||[],d=Vd(u,f,a.out,a.arg);if(!d)return!1;n[o]=new Int32Array(d.merged),a.next=new Uint32Array(d.next);break}case F.CAPTURE:case F.EMPTY_WIDTH:case F.NOP:B=i(a.out),s[o]=s[a.out],n[o]=n[a.out]?new Int32Array(n[a.out]):new Int32Array(0),a.next=new Uint32Array(Math.floor(n[o].length/2)+1).fill(a.out);break;case F.MATCH:case F.FAIL:s[o]=a.op===F.MATCH;break;case F.RUNE:{if(s[o]=!1,a.next&&a.next.length>0)break;if(e.insert(a.out),!a.runes||a.runes.length===0){n[o]=new Int32Array(0),a.next=new Uint32Array([a.out]);break}let c=[];if(a.runes.length===1&&(a.arg&N.FOLD_CASE)!==0){let l=a.runes[0];c.push(l,l);for(let u=j.simpleFold(l);u!==l;u=j.simpleFold(u))c.push(u,u);c.sort((u,f)=>u-f)}else for(let l=0;l<a.runes.length;l++)c.push(a.runes[l]);n[o]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=F.RUNE;break}case F.RUNE1:{if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out);let c=[];if((a.arg&N.FOLD_CASE)!==0){let l=a.runes[0];c.push(l,l);for(let u=j.simpleFold(l);u!==l;u=j.simpleFold(u))c.push(u,u);c.sort((u,f)=>u-f)}else c.push(a.runes[0],a.runes[0]);n[o]=new Int32Array(c),a.next=new Uint32Array(Math.floor(c.length/2)+1).fill(a.out),a.op=F.RUNE;break}case F.RUNE_ANY:if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[o]=new Int32Array([0,j.MAX_RUNE]),a.next=new Uint32Array([a.out]);break;case F.RUNE_ANY_NOT_NL:if(s[o]=!1,a.next&&a.next.length>0)break;e.insert(a.out),n[o]=new Int32Array([0,9,11,j.MAX_RUNE]),a.next=new Uint32Array(Math.floor(n[o].length/2)+1).fill(a.out)}return B};for(e.clear(),e.insert(r.start);!e.empty();)if(t.clear(),!i(e.next()))return null;for(let o=0;o<r.inst.length;o++)n[o]&&(r.inst[o].runes=n[o]);return r},tp=(r,e)=>{for(let t=0;t<e.inst.length;t++){let n=e.inst[t];switch(n.op){case F.ALT:case F.ALT_MATCH:case F.RUNE:break;case F.CAPTURE:case F.EMPTY_WIDTH:case F.NOP:case F.MATCH:case F.FAIL:r.inst[t].next=null;break;case F.RUNE1:case F.RUNE_ANY:case F.RUNE_ANY_NOT_NL:r.inst[t].next=null,r.inst[t].op=n.op,r.inst[t].runes=n.runes?new Int32Array(n.runes):new Int32Array(0)}}},lu=class _u{static compile(e){if(e.start===0||e.numLb>0)return null;let t=e.inst[e.start];if(t.op!==F.EMPTY_WIDTH||(t.arg&J.EMPTY_BEGIN_TEXT)===0)return null;let n=!1;for(let i=0;i<e.inst.length;i++)if(e.inst[i].op===F.ALT||e.inst[i].op===F.ALT_MATCH){n=!0;break}for(let i=0;i<e.inst.length;i++){let o=e.inst[i],B=e.inst[o.out].op;switch(o.op){case F.ALT:case F.ALT_MATCH:if(B===F.MATCH||e.inst[o.arg].op===F.MATCH)return null;break;case F.EMPTY_WIDTH:if(B===F.MATCH){if((o.arg&J.EMPTY_END_TEXT)===J.EMPTY_END_TEXT)continue;return null}break;default:if(B===F.MATCH&&n)return null}}let s=Xd(e);return s=ep(s),s!==null&&tp(s,e),s}static next(e,t){let n=e.matchRunePos(t);return n>=0?e.next[n]:e.op===F.ALT_MATCH?e.out:0}static execute(e,t,n,s,i){let o=e.onepass;if(!o)return null;let B=new Int32Array(i).fill(-1),a=!1,c=t.step(n),l=c>>3,u=c&7,f=Ze.EOF(),d=-1,h=0;c!==Ze.EOF()&&(f=t.step(n+u),f!==Ze.EOF()&&(d=f>>3,h=f&7));let p=n===0?J.emptyOpContext(-1,l):t.context(n),w=o.start,D;for(;;){switch(D=o.inst[w],w=D.out,D.op){case F.MATCH:return s===N.ANCHOR_BOTH&&n!==t.endPos()?null:(a=!0,B.length>0&&(B[0]=0,B[1]=n),i===0?[]:J.toArray(B));case F.RUNE:if(!D.matchRune(l))return null;break;case F.RUNE1:if(l!==D.runes[0])return null;break;case F.RUNE_ANY:break;case F.RUNE_ANY_NOT_NL:if(l===10)return null;break;case F.ALT:case F.ALT_MATCH:w=_u.next(D,l);continue;case F.FAIL:return null;case F.NOP:continue;case F.EMPTY_WIDTH:if((D.arg&~p)!==0)return null;continue;case F.CAPTURE:D.arg<B.length&&(B[D.arg]=n);continue;default:throw new Qr("bad inst")}if(u===0)break;p=J.emptyOpContext(l,d),n+=u,l=d,u=h,l!==-1&&(f=t.step(n+u),f!==Ze.EOF()?(d=f>>3,h=f&7):(d=-1,h=0))}return a?i===0?[]:J.toArray(B):null}},k=class ie{static Op=Lu(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"]);static isPseudoOp(e){return e>=ie.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===L.CODES.get("-")?"\\":""}static fromRegexp(e){let t=new ie(e.op);return t.flags=e.flags,t.subs=e.subs,t.runes=e.runes,t.cap=e.cap,t.min=e.min,t.max=e.max,t.name=e.name,t.namedGroups=e.namedGroups,t.lb=e.lb,t}constructor(e){this.op=e,this.flags=0,this.subs=ie.emptySubs(),this.runes=new Int32Array(0),this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=ie.emptySubs(),this.runes=new Int32Array(0),this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case ie.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case ie.Op.EMPTY_MATCH:e+="(?:)";break;case ie.Op.STAR:case ie.Op.PLUS:case ie.Op.QUEST:case ie.Op.REPEAT:{let t=this.subs[0];switch(t.op>ie.Op.CAPTURE||t.op===ie.Op.LITERAL&&t.runes.length>1?e+=`(?:${t.appendTo()})`:e+=t.appendTo(),this.op){case ie.Op.STAR:e+="*";break;case ie.Op.PLUS:e+="+";break;case ie.Op.QUEST:e+="?";break;case ie.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}"}(this.flags&N.NON_GREEDY)!==0&&(e+="?");break}case ie.Op.CONCAT:for(let t of this.subs)t.op===ie.Op.ALTERNATE?e+=`(?:${t.appendTo()})`:e+=t.appendTo();break;case ie.Op.ALTERNATE:{let t="";for(let n of this.subs)e+=t,t="|",e+=n.appendTo();break}case ie.Op.LITERAL:(this.flags&N.FOLD_CASE)!==0&&(e+="(?i:");for(let t of this.runes)e+=J.escapeRune(t);(this.flags&N.FOLD_CASE)!==0&&(e+=")");break;case ie.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case ie.Op.ANY_CHAR:e+="(?s:.)";break;case ie.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case ie.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case ie.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==ie.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case ie.Op.BEGIN_TEXT:e+="\\A";break;case ie.Op.END_TEXT:(this.flags&N.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case ie.Op.BEGIN_LINE:e+="^";break;case ie.Op.END_LINE:e+="$";break;case ie.Op.WORD_BOUNDARY:e+="\\b";break;case ie.Op.NO_WORD_BOUNDARY:e+="\\B";break;case ie.Op.CHAR_CLASS:if(this.runes.length%2!==0){e+="[invalid char class]";break}if(e+="[",this.runes.length===0)e+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===j.MAX_RUNE){e+="^";for(let t=1;t<this.runes.length-1;t+=2){let n=this.runes[t]+1,s=this.runes[t+1]-1;e+=ie.quoteIfHyphen(n),e+=J.escapeRune(n),n!==s&&(e+="-",e+=ie.quoteIfHyphen(s),e+=J.escapeRune(s))}}else for(let t=0;t<this.runes.length;t+=2){let n=this.runes[t],s=this.runes[t+1];e+=ie.quoteIfHyphen(n),e+=J.escapeRune(n),n!==s&&(e+="-",e+=ie.quoteIfHyphen(s),e+=J.escapeRune(s))}e+="]";break;default:e+=this.op}return e}maxCap(){let e=0;if(this.op===ie.Op.CAPTURE&&(e=this.cap),this.subs!==null)for(let t of this.subs){let n=t.maxCap();e<n&&(e=n)}return e}equals(e){if(!(e!==null&&e instanceof ie)||this.op!==e.op)return!1;switch(this.op){case ie.Op.END_TEXT:if((this.flags&N.WAS_DOLLAR)!==(e.flags&N.WAS_DOLLAR))return!1;break;case ie.Op.LITERAL:case ie.Op.CHAR_CLASS:if((this.flags&N.FOLD_CASE)!==(e.flags&N.FOLD_CASE))return!1;if(this.runes===null&&e.runes===null)break;if(this.runes===null||e.runes===null||this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case ie.Op.ALTERNATE:case ie.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case ie.Op.STAR:case ie.Op.PLUS:case ie.Op.QUEST:if((this.flags&N.NON_GREEDY)!==(e.flags&N.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case ie.Op.REPEAT:if((this.flags&N.NON_GREEDY)!==(e.flags&N.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case ie.Op.CAPTURE:if(this.cap!==e.cap||(this.name===null?e.name!==null:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break;case ie.Op.PLB:case ie.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1}return!0}},Mo=class{static walk(r,e){let t=[],n=r,s;for(;;){if(n.subs.length===0)s=e.leaf(n);else{let i=e.enter(n);if(i.result===void 0){t.push({re:n,state:i,i:0}),n=n.subs[0];continue}s=i.result}for(;;){if(t.length===0)return s;let i=t[t.length-1];if(e.child(i.re,i.state,s,i.i),i.i++,i.state.result===void 0&&i.i<i.re.subs.length){n=i.re.subs[i.i];break}t.pop(),s=i.state.result!==void 0?i.state.result:e.leave(i.re,i.state)}}}},cu=class{constructor(r,e){let t=new Map,n=[0],s=[0],i=[0],o=[0];for(let h of r){let p=0;for(let w=0;w<h.length;w++){let D=p*e+h[w],m=t.get(D);m===void 0&&(m=n.length,t.set(D,m),n.push(p),s.push(h[w]),i.push(i[p]+1),o.push(0)),p=m}o[p]=1}let B=n.length,a=new Int32Array(B-1);for(let h=1;h<B;h++)a[h-1]=h;a.sort((h,p)=>n[h]-n[p]||s[h]-s[p]);let c=new Int32Array(B+1);for(let h=1;h<B;h++)c[n[h]+1]++;for(let h=0;h<B;h++)c[h+1]+=c[h];let l=new Int32Array(B-1);for(let h=0;h<a.length;h++)l[h]=s[a[h]];this.childStart=c,this.childUnit=l,this.childNode=a;let u=new Int32Array(B);for(let h=0;h<B;h++)u[h]=h;u.sort((h,p)=>i[h]-i[p]);let f=new Int32Array(B),d=Uint8Array.from(o);for(let h=1;h<B;h++){let p=u[h],w=n[p];if(w!==0){let D=f[w],m=this.next(D,s[p]);for(;m<0&&D!==0;)D=f[D],m=this.next(D,s[p]);f[p]=m>=0?m:0}d[p]|=d[f[p]]}this.fail=f,this.match=d}next(r,e){let t=this.childStart[r],n=this.childStart[r+1],s=this.childUnit;for(;t<n;){let i=t+n>>1,o=s[i];if(o===e)return this.childNode[i];o<e?t=i+1:n=i}return-1}advance(r,e){for(;;){let t=this.next(r,e);if(t>=0)return t;if(r===0)return 0;r=this.fail[r]}}searchUTF16(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r.charCodeAt(s)),this.match[n]===1)return!0;return!1}searchUTF8(r,e,t){let n=0;for(let s=e;s<t;s++)if(n=this.advance(n,r[s]),this.match[n]===1)return!0;return!1}},ae=class cr{static Type={NONE:0,EXACT:1,AND:2,OR:3};static MAX_SCANS=32;static MAX_AC_UNITS=1<<18;constructor(e){this.type=e,this.subs=[],this.str="",this.bytes=null,this.cost=e===cr.Type.EXACT?1:0,this.allExact=!1,this.ac16=null,this.ac8=null}automaton16(){if(this.ac16===null){let e=this.subs.map(t=>{let n=new Array(t.str.length);for(let s=0;s<t.str.length;s++)n[s]=t.str.charCodeAt(s);return n});this.ac16=new cu(e,65536)}return this.ac16}automaton8(){return this.ac8===null&&(this.ac8=new cu(this.subs.map(e=>e.bytes),256)),this.ac8}eval(e,t){switch(this.type){case cr.Type.NONE:return!0;case cr.Type.EXACT:return e.hasString(this,t);case cr.Type.AND:for(let n=0;n<this.subs.length;n++)if(!this.subs[n].eval(e,t))return!1;return!0;case cr.Type.OR:if(this.allExact)return e.hasAnyString(this,t);for(let n=0;n<this.subs.length;n++)if(this.subs[n].eval(e,t))return!0;return!1;default:return!0}}},np=class fr{static build(e){return e?Mo.walk(e,fr.WALKER):new ae(ae.Type.NONE)}static WALKER={leaf:e=>fr.leaf(e),enter:e=>fr.enter(e),child:(e,t,n)=>fr.child(e,t,n),leave:(e,t)=>fr.leave(e,t)};static leaf(e){if(e.op!==k.Op.LITERAL)return new ae(ae.Type.NONE);if(e.runes.length===0||(e.flags&N.FOLD_CASE)!==0)return new ae(ae.Type.NONE);let t="";for(let s=0;s<e.runes.length;s++){if(j.isUnsearchable(e.runes[s]))return new ae(ae.Type.NONE);t+=String.fromCodePoint(e.runes[s])}let n=new ae(ae.Type.EXACT);return n.str=t,n.bytes=J.stringToUtf8ByteArray(n.str),n}static enter(e){switch(e.op){case k.Op.CAPTURE:case k.Op.PLUS:return{sub:null};case k.Op.REPEAT:return e.min>=1?{sub:null}:{result:new ae(ae.Type.NONE)};case k.Op.CONCAT:return{pf:new ae(ae.Type.AND),subs:[]};case k.Op.ALTERNATE:return{pf:new ae(ae.Type.OR),subs:[]};default:return{result:new ae(ae.Type.NONE)}}}static child(e,t,n){if(t.subs===void 0){t.sub=n;return}if(t.pf.type===ae.Type.AND){if(n.type===ae.Type.NONE)return;if(n.type===ae.Type.AND){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n);return}if(n.type===ae.Type.NONE){t.result=new ae(ae.Type.NONE);return}if(n.type===ae.Type.OR){for(let s=0;s<n.subs.length;s++)t.subs.push(n.subs[s]);return}t.subs.push(n)}static leave(e,t){if(t.subs===void 0)return t.sub;let n=t.pf,s=new Set,i=[];for(let c of t.subs){if(c.type===ae.Type.EXACT){if(s.has(c.str))continue;s.add(c.str)}i.push(c)}if(n.type===ae.Type.AND){let c=[],l=0;for(let u of i)l+u.cost>ae.MAX_SCANS||(c.push(u),l+=u.cost);return c.length===0?new ae(ae.Type.NONE):c.length===1?c[0]:(n.subs=c,n.cost=l,n)}if(i.length===0)return new ae(ae.Type.NONE);if(i.length===1)return i[0];n.subs=i;let o=!0,B=0,a=0;for(let c of i)c.type!==ae.Type.EXACT?o=!1:a+=c.bytes.length,B+=c.cost;return o?a>ae.MAX_AC_UNITS?new ae(ae.Type.NONE):(n.allExact=!0,n.cost=1,n):B>ae.MAX_SCANS?new ae(ae.Type.NONE):(n.cost=B,n)}},bt=class{constructor(r=0,e=0){this.head=r,this.tail=e}},rp=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0,this.lbInst=null}getInst(r){return this.inst[r]}numInst(){return this.inst.length}addInst(r){this.inst.push(new F(r))}markLookbehindInsts(){let r=new Uint8Array(this.inst.length),e=this.lbStarts.slice();for(;e.length>0;){let t=e.pop();if(t===0||r[t]===1)continue;r[t]=1;let n=this.inst[t];switch(n.op){case F.ALT:case F.ALT_MATCH:e.push(n.out,n.arg);break;case F.MATCH:case F.FAIL:break;default:e.push(n.out)}}this.lbInst=r}skipNop(r){let e=this.inst[r];for(;e.op===F.NOP||e.op===F.CAPTURE;)e=this.inst[r],r=e.out;return e}prefix(){let r="",e=this.skipNop(this.start);if(!F.isRuneOp(e.op)||e.runes.length!==1)return[e.op===F.MATCH,r];for(;F.isRuneOp(e.op)&&e.runes.length===1&&(e.arg&N.FOLD_CASE)===0&&!j.isUnsearchable(e.runes[0]);)r+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===F.MATCH,r]}startCond(){let r=0,e=this.start;e:for(;;){let t=this.inst[e];switch(t.op){case F.EMPTY_WIDTH:r|=t.arg;break;case F.FAIL:return-1;case F.CAPTURE:case F.NOP:break;default:break e}e=t.out}return r}patch(r,e){let t=r.head;for(;t!==0;){let n=this.inst[t>>1];(t&1)===0?(t=n.out,n.out=e):(t=n.arg,n.arg=e)}}append(r,e){if(r.head===0)return e;if(e.head===0)return r;let t=this.inst[r.tail>>1];return(r.tail&1)===0?t.out=e.head:t.arg=e.head,new bt(r.head,e.tail)}toString(){let r="";for(let e=0;e<this.inst.length;e++){let t=r.length;r+=e,e===this.start&&(r+="*"),r+=" ".substring(r.length-t),r+=this.inst[e],r+=`
|
|
61
|
+
`}return r}},sp=new Int32Array([0,L.CODES.get(`
|
|
62
|
+
`)-1,L.CODES.get(`
|
|
63
|
+
`)+1,j.MAX_RUNE]),fu=new Int32Array([0,j.MAX_RUNE]),ri=class{constructor(r=0,e=new bt,t=!1){this.i=r,this.out=e,this.nullable=t}},Ju=class To{static compileRegexp(e){let t=new To,n=t.compile(e);return t.prog.patch(n.out,t.newInst(F.MATCH).i),t.prog.start=n.i,t.prog.markLookbehindInsts(),t.prog}static compileSet(e){let t=new To;if(e.length===0)return t.prog.start=t.newInst(F.FAIL).i,t.prog.markLookbehindInsts(),t.prog;let n=[];for(let i=0;i<e.length;i++){let o=t.compile(e[i]),B=t.newInst(F.MATCH);t.prog.getInst(B.i).arg=i,t.prog.patch(o.out,B.i),n.push(o.i)}let s=n[0];for(let i=1;i<n.length;i++){let o=t.newInst(F.ALT),B=t.prog.getInst(o.i);B.out=s,B.arg=n[i],s=o.i}return t.prog.start=s,t.prog.markLookbehindInsts(),t.prog}constructor(){this.prog=new rp,this.newInst(F.FAIL),this.runeCache=new Map,this.walker={leaf:e=>this.leaf(e),enter:e=>this.enter(e),child:(e,t,n)=>this.child(e,t,n),leave:(e,t)=>this.leave(e,t)}}newInst(e){return this.prog.addInst(e),new ri(this.prog.numInst()-1,new bt,!0)}nop(){let e=this.newInst(F.NOP);return e.out=new bt(e.i<<1,e.i<<1),e}fail(){return new ri}cap(e){let t=this.newInst(F.CAPTURE);return t.out=new bt(t.i<<1,t.i<<1),this.prog.getInst(t.i).arg=e,this.prog.numCap<e+1&&(this.prog.numCap=e+1),t}cat(e,t){return e.i===0||t.i===0?this.fail():(this.prog.patch(e.out,t.i),new ri(e.i,t.out,e.nullable&&t.nullable))}alt(e,t){if(e.i===0)return t;if(t.i===0)return e;let n=this.newInst(F.ALT),s=this.prog.getInst(n.i);return s.out=e.i,s.arg=t.i,n.out=this.prog.append(e.out,t.out),n.nullable=e.nullable||t.nullable,n}loop(e,t){let n=this.newInst(F.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new bt(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new bt(n.i<<1|1,n.i<<1|1)),this.prog.patch(e.out,n.i),n}quest(e,t){let n=this.newInst(F.ALT),s=this.prog.getInst(n.i);return t?(s.arg=e.i,n.out=new bt(n.i<<1,n.i<<1)):(s.out=e.i,n.out=new bt(n.i<<1|1,n.i<<1|1)),n.out=this.prog.append(n.out,e.out),n}star(e,t){return e.nullable?this.quest(this.plus(e,t),t):this.loop(e,t)}plus(e,t){return new ri(e.i,this.loop(e,t).out,e.nullable)}empty(e){let t=this.newInst(F.EMPTY_WIDTH);return this.prog.getInst(t.i).arg=e,t.out=new bt(t.i<<1,t.i<<1),t}rune(e,t){let n=this.newInst(F.RUNE);n.nullable=!1;let s=this.prog.getInst(n.i);return s.runes=e,t&=N.FOLD_CASE,(e.length!==1||j.simpleFold(e[0])===e[0])&&(t&=~N.FOLD_CASE),s.arg=t,n.out=new bt(n.i<<1,n.i<<1),(t&N.FOLD_CASE)===0&&e.length===1||e.length===2&&e[0]===e[1]?s.op=F.RUNE1:e.length===2&&e[0]===0&&e[1]===j.MAX_RUNE?s.op=F.RUNE_ANY:e.length===4&&e[0]===0&&e[1]===L.CODES.get(`
|
|
64
|
+
`)-1&&e[2]===L.CODES.get(`
|
|
65
|
+
`)+1&&e[3]===j.MAX_RUNE&&(s.op=F.RUNE_ANY_NOT_NL),n}lookBehind(e,t){let n=this.newInst(F.LB_WRITE);this.prog.getInst(n.i).arg=t;let s=this.rune(fu,0),i=this.star(s,!0),o=this.cat(i,e);this.prog.patch(o.out,n.i);let B=this.newInst(F.LB_CHECK);return this.prog.getInst(B.i).arg=t,this.prog.lbStarts.push(o.i),Math.abs(t)>this.prog.numLb&&(this.prog.numLb=Math.abs(t)),B.out=new bt(B.i<<1,B.i<<1),B}compile(e){return Mo.walk(e,this.walker)}leaf(e){switch(e.op){case k.Op.NO_MATCH:return this.fail();case k.Op.EMPTY_MATCH:return this.nop();case k.Op.LITERAL:{if(e.runes.length===0)return this.nop();let t=null;for(let n of e.runes){let s=this.runeCache.get(n);s===void 0&&(s=new Int32Array([n]),this.runeCache.set(n,s));let i=this.rune(s,e.flags);t=t===null?i:this.cat(t,i)}return t}case k.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case k.Op.ANY_CHAR_NOT_NL:return this.rune(sp,0);case k.Op.ANY_CHAR:return this.rune(fu,0);case k.Op.BEGIN_LINE:return this.empty(J.EMPTY_BEGIN_LINE);case k.Op.END_LINE:return this.empty(J.EMPTY_END_LINE);case k.Op.BEGIN_TEXT:return this.empty(J.EMPTY_BEGIN_TEXT);case k.Op.END_TEXT:return this.empty(J.EMPTY_END_TEXT);case k.Op.WORD_BOUNDARY:return this.empty(J.EMPTY_WORD_BOUNDARY);case k.Op.NO_WORD_BOUNDARY:return this.empty(J.EMPTY_NO_WORD_BOUNDARY);case k.Op.CONCAT:case k.Op.ALTERNATE:return this.nop();default:throw new Yr("regexp: unhandled case in compile")}}enter(e){switch(e.op){case k.Op.PLB:case k.Op.NLB:case k.Op.STAR:case k.Op.PLUS:case k.Op.QUEST:return{sub:null};case k.Op.CAPTURE:return{bra:this.cap(e.cap<<1),sub:null};case k.Op.CONCAT:case k.Op.ALTERNATE:return{f:null};default:throw new Yr("regexp: unhandled case in compile")}}child(e,t,n){e.op===k.Op.CONCAT?t.f=t.f===null?n:this.cat(t.f,n):e.op===k.Op.ALTERNATE?t.f=t.f===null?n:this.alt(t.f,n):t.sub=n}leave(e,t){switch(e.op){case k.Op.PLB:case k.Op.NLB:return this.lookBehind(t.sub,e.lb);case k.Op.CAPTURE:{let n=this.cap(e.cap<<1|1);return this.cat(this.cat(t.bra,t.sub),n)}case k.Op.STAR:return this.star(t.sub,(e.flags&N.NON_GREEDY)!==0);case k.Op.PLUS:return this.plus(t.sub,(e.flags&N.NON_GREEDY)!==0);case k.Op.QUEST:return this.quest(t.sub,(e.flags&N.NON_GREEDY)!==0);case k.Op.CONCAT:case k.Op.ALTERNATE:return t.f;default:throw new Yr("regexp: unhandled case in compile")}}},Uu=class Ye{static simplify(e){return e===null?null:Mo.walk(e,Ye.WALKER)}static WALKER={leaf:e=>Ye.leaf(e),enter:e=>Ye.enter(e),child:(e,t,n,s)=>Ye.child(e,t,n,s),leave:(e,t)=>Ye.leave(e,t)};static leaf(e){if(e.op===k.Op.CHAR_CLASS){if(e.runes===null)return e;if(e.runes.length===0)return new k(k.Op.NO_MATCH);if(e.runes.length===2&&e.runes[0]===0&&e.runes[1]===j.MAX_RUNE)return new k(k.Op.ANY_CHAR);if(e.runes.length===4&&e.runes[0]===0&&e.runes[1]===L.CODES.get(`
|
|
66
|
+
`)-1&&e.runes[2]===L.CODES.get(`
|
|
67
|
+
`)+1&&e.runes[3]===j.MAX_RUNE)return new k(k.Op.ANY_CHAR_NOT_NL)}return e}static enter(e){switch(e.op){case k.Op.PLB:case k.Op.NLB:case k.Op.CAPTURE:case k.Op.STAR:case k.Op.PLUS:case k.Op.QUEST:return{sub:null};case k.Op.CONCAT:case k.Op.ALTERNATE:return{subs:[],changed:!1};case k.Op.REPEAT:return e.min===0&&e.max===0?{result:new k(k.Op.EMPTY_MATCH)}:{sub:null};default:return{result:e}}}static child(e,t,n,s){if(t.subs===void 0){t.sub=n;return}if(n!==e.subs[s]&&(t.changed=!0),e.op===k.Op.CONCAT){if(n.op===k.Op.NO_MATCH){t.result=new k(k.Op.NO_MATCH);return}if(n.op===k.Op.EMPTY_MATCH){t.changed=!0;return}if(n.op===k.Op.CONCAT){t.changed=!0;for(let i=0;i<n.subs.length;i++)t.subs.push(n.subs[i]);return}}else{if(n.op===k.Op.NO_MATCH){t.changed=!0;return}if(n.op===k.Op.ALTERNATE){t.changed=!0;for(let i=0;i<n.subs.length;i++)t.subs.push(n.subs[i]);return}}t.subs.push(n)}static leave(e,t){switch(e.op){case k.Op.PLB:case k.Op.NLB:case k.Op.CAPTURE:{let n=t.sub;if(n!==e.subs[0]){let s=k.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=[n],s}return e}case k.Op.CONCAT:case k.Op.ALTERNATE:if(t.changed){let n=t.subs;if(n.length===0)return new k(e.op===k.Op.CONCAT?k.Op.EMPTY_MATCH:k.Op.NO_MATCH);if(n.length===1)return n[0];let s=k.fromRegexp(e);return s.runes=new Int32Array(0),s.subs=n,s}return e;case k.Op.STAR:case k.Op.PLUS:case k.Op.QUEST:return Ye.simplify1(e.op,e.flags,t.sub,e);case k.Op.REPEAT:return Ye.simplifyRepeat(e,t.sub);default:return e}}static simplifyRepeat(e,t){if(e.max===-1){if(e.min===0)return Ye.simplify1(k.Op.STAR,e.flags,t,null);if(e.min===1)return Ye.simplify1(k.Op.PLUS,e.flags,t,null);let s=[];for(let i=0;i<e.min-1;i++)s.push(t);return s.push(Ye.simplify1(k.Op.PLUS,e.flags,t,null)),Ye.concat(s)}if(e.min===1&&e.max===1)return t;let n=null;if(e.min>0){n=[];for(let s=0;s<e.min;s++)n.push(t)}if(e.max>e.min){let s=Ye.simplify1(k.Op.QUEST,e.flags,t,null);for(let i=e.min+1;i<e.max;i++)s=Ye.simplify1(k.Op.QUEST,e.flags,Ye.concat([t,s]),null);if(n===null)return s;n.push(s)}return n!==null?Ye.concat(n):new k(k.Op.NO_MATCH)}static concat(e){let t=[];for(let s=0;s<e.length;s++){let i=e[s];if(i.op===k.Op.NO_MATCH)return new k(k.Op.NO_MATCH);if(i.op!==k.Op.EMPTY_MATCH){if(i.op===k.Op.CONCAT){for(let o=0;o<i.subs.length;o++)t.push(i.subs[o]);continue}t.push(i)}}if(t.length===0)return new k(k.Op.EMPTY_MATCH);if(t.length===1)return t[0];let n=new k(k.Op.CONCAT);return n.subs=t,n}static simplify1(e,t,n,s){if(n.op===k.Op.EMPTY_MATCH)return n;if(n.op===k.Op.NO_MATCH)return e===k.Op.PLUS?n:new k(k.Op.EMPTY_MATCH);if(e===n.op&&(t&N.NON_GREEDY)===(n.flags&N.NON_GREEDY))return n;if(s!==null&&s.op===e&&(s.flags&N.NON_GREEDY)===(t&N.NON_GREEDY)&&n===s.subs[0])return s;let i=new k(e);return i.flags=t,i.subs=[n],i}},pe=class{constructor(r,e){this.sign=r,this.cls=e}},du=[48,57],pu=[9,10,12,13,32,32],hu=[48,57,65,90,95,95,97,122],Cu=new Map([["\\d",new pe(1,du)],["\\D",new pe(-1,du)],["\\s",new pe(1,pu)],["\\S",new pe(-1,pu)],["\\w",new pe(1,hu)],["\\W",new pe(-1,hu)]]),gu=[48,57,65,90,97,122],mu=[65,90,97,122],Eu=[0,127],bu=[9,9,32,32],Du=[0,31,127,127],wu=[48,57],ku=[33,126],xu=[97,122],vu=[32,126],Su=[33,47,58,64,91,96,123,126],yu=[9,13,32,32],Ru=[65,90],Ou=[48,57,65,90,95,95,97,122],Au=[48,57,65,70,97,102],Fu=new Map([["[:alnum:]",new pe(1,gu)],["[:^alnum:]",new pe(-1,gu)],["[:alpha:]",new pe(1,mu)],["[:^alpha:]",new pe(-1,mu)],["[:ascii:]",new pe(1,Eu)],["[:^ascii:]",new pe(-1,Eu)],["[:blank:]",new pe(1,bu)],["[:^blank:]",new pe(-1,bu)],["[:cntrl:]",new pe(1,Du)],["[:^cntrl:]",new pe(-1,Du)],["[:digit:]",new pe(1,wu)],["[:^digit:]",new pe(-1,wu)],["[:graph:]",new pe(1,ku)],["[:^graph:]",new pe(-1,ku)],["[:lower:]",new pe(1,xu)],["[:^lower:]",new pe(-1,xu)],["[:print:]",new pe(1,vu)],["[:^print:]",new pe(-1,vu)],["[:punct:]",new pe(1,Su)],["[:^punct:]",new pe(-1,Su)],["[:space:]",new pe(1,yu)],["[:^space:]",new pe(-1,yu)],["[:upper:]",new pe(1,Ru)],["[:^upper:]",new pe(-1,Ru)],["[:word:]",new pe(1,Ou)],["[:^word:]",new pe(-1,Ou)],["[:xdigit:]",new pe(1,Au)],["[:^xdigit:]",new pe(-1,Au)]]),On=class si{static charClassToString(e,t){let n="[";for(let s=0;s<t;s+=2){s>0&&(n+=" ");let i=e[s],o=e[s+1];i===o?n+=`0x${i.toString(16)}`:n+=`0x${i.toString(16)}-0x${o.toString(16)}`}return n+="]",n}static sortRanges(e,t){let n=t>>1,s=new Array(n);for(let o=0;o<n;o++)s[o]=o;s.sort((o,B)=>e[2*o]-e[2*B]||e[2*B+1]-e[2*o+1]);let i=e.slice(0,t);for(let o=0;o<n;o++)e[2*o]=i[2*s[o]],e[2*o+1]=i[2*s[o]+1]}constructor(e=J.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.r instanceof Int32Array?this.len===this.r.length?this.r:this.r.subarray(0,this.len):new Int32Array(this.len===this.r.length?this.r:this.r.slice(0,this.len))}toGrowableArray(){return Array.isArray(this.r)?(this.r.length=this.len,this.r):Array.from(this.r.subarray(0,this.len))}cleanClass(){if(this.len<4)return this;si.sortRanges(this.r,this.len);let e=2;for(let t=2;t<this.len;t+=2){let n=this.r[t],s=this.r[t+1];if(n<=this.r[e-1]+1){s>this.r[e-1]&&(this.r[e-1]=s);continue}this.r[e]=n,this.r[e+1]=s,e+=2}return this.len=e,this}appendLiteral(e,t){return(t&N.FOLD_CASE)!==0?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0){for(let n=2;n<=4;n+=2)if(this.len>=n){let s=this.r[this.len-n],i=this.r[this.len-n+1];if(e<=i+1&&s<=t+1)return e<s&&(this.r[this.len-n]=e),t>i&&(this.r[this.len-n+1]=t),this}}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=j.MIN_FOLD&&t>=j.MAX_FOLD)return this.appendRange(e,t);if(t<j.MIN_FOLD||e>j.MAX_FOLD)return this.appendRange(e,t);e<j.MIN_FOLD&&(this.appendRange(e,j.MIN_FOLD-1),e=j.MIN_FOLD),t>j.MAX_FOLD&&(this.appendRange(j.MAX_FOLD+1,t),t=j.MAX_FOLD);for(let n=e;n<=t;n++){this.appendRange(n,n);for(let s=j.simpleFold(n);s!==n;s=j.simpleFold(s))this.appendRange(s,s)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let n=0;n<e.length;n+=2){let s=e[n],i=e[n+1];t<=s-1&&this.appendRange(t,s-1),t=i+1}return t<=j.MAX_RUNE&&this.appendRange(t,j.MAX_RUNE),this}appendTable(e){for(let t=0;t<e.length;++t){let n=e.getLo(t),s=e.getHi(t),i=e.getStride(t);if(i===1){this.appendRange(n,s);continue}for(let o=n;o<=s;o+=i)this.appendRange(o,o)}return this}appendNegatedTable(e){let t=0;for(let n=0;n<e.length;++n){let s=e.getLo(n),i=e.getHi(n),o=e.getStride(n);if(o===1){t<=s-1&&this.appendRange(t,s-1),t=i+1;continue}for(let B=s;B<=i;B+=o)t<=B-1&&this.appendRange(t,B-1),t=B+1}return t<=j.MAX_RUNE&&this.appendRange(t,j.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let n=0;n<this.len;n+=2){let s=this.r[n],i=this.r[n+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=i+1}return this.len=t,e<=j.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=j.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(e,t){let n=e.cls;return t&&(n=new si().appendFoldedClass(n).cleanClass().toArray()),this.appendClassWithSign(n,e.sign)}toString(){return si.charClassToString(this.r,this.len)}},ip=class{constructor(r){this.str=r,this.position=0}pos(){return this.position}rewindTo(r){this.position=r}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(r){this.position+=r}skipString(r){this.position+=r.length}pop(){let r=this.str.codePointAt(this.position);return this.position+=J.charCount(r),r}lookingAt(r){return this.str.startsWith(r,this.position)}rest(){return this.str.substring(this.position)}from(r){return this.str.substring(r,this.position)}toString(){return this.rest()}},qr=class Z{static ERR_INTERNAL_ERROR="regexp/syntax: internal error";static ERR_INVALID_CHAR_RANGE="invalid character class range";static ERR_INVALID_ESCAPE="invalid escape sequence";static ERR_INVALID_NAMED_CAPTURE="invalid named capture";static ERR_INVALID_PERL_OP="invalid or unsupported Perl syntax";static ERR_INVALID_REPEAT_OP="invalid nested repetition operator";static ERR_INVALID_REPEAT_SIZE="invalid repeat count";static ERR_MISSING_BRACKET="missing closing ]";static ERR_MISSING_PAREN="missing closing )";static ERR_MISSING_REPEAT_ARGUMENT="missing argument to repetition operator";static ERR_TRAILING_BACKSLASH="trailing backslash at end of expression";static ERR_DUPLICATE_NAMED_CAPTURE="duplicate capture group name";static ERR_UNEXPECTED_PAREN="unexpected )";static ERR_NESTING_DEPTH="expression nests too deeply";static ERR_LARGE="expression too large";static ERR_INVALID_CAPTURE_IN_LOOKBEHIND="invalid capture in lookbehind";static MAX_HEIGHT=1e3;static MAX_SIZE=1398101;static MAX_RUNES=33554432;static ANY_TABLE=new C(new Uint32Array([0,j.MAX_RUNE,1]));static ASCII_TABLE=new C(new Uint32Array([0,127,1]));static ASCII_FOLD_TABLE=new C(new Uint32Array([0,127,1,383,383,1,8490,8490,1]));static unicodeTable(e){return e==="Any"?{tab:Z.ANY_TABLE,fold:Z.ANY_TABLE,sign:1}:e==="Ascii"?{tab:Z.ASCII_TABLE,fold:Z.ASCII_FOLD_TABLE,sign:1}:e==="Assigned"?{tab:st.CATEGORIES.get("Cn"),fold:st.CATEGORIES.get("Cn"),sign:-1}:e==="Lc"?{tab:st.CATEGORIES.get("LC"),fold:st.FOLD_CATEGORIES.get("LC"),sign:1}:st.CATEGORIES.has(e)?{tab:st.CATEGORIES.get(e),fold:st.FOLD_CATEGORIES.get(e),sign:1}:st.SCRIPTS.has(e)?{tab:st.SCRIPTS.get(e),fold:st.FOLD_SCRIPT.get(e),sign:1}:null}static minFoldRune(e){if(e<j.MIN_FOLD||e>j.MAX_FOLD)return e;let t=e,n=e;for(e=j.simpleFold(e);e!==n;e=j.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===k.Op.EMPTY_MATCH)return null;if(e.op===k.Op.CONCAT&&e.subs.length>0){let t=e.subs[0];return t.op===k.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){let n=new k(k.Op.LITERAL);return n.flags=t,n.runes=J.stringToRunes(e),n}static parse(e,t){return new Z(e,t).parseInternal()}static parseRepeat(e){let t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);let n=Z.parseInt(e);if(n===-1||!e.more())return-1;let s;if(!e.lookingAt(","))s=n;else{if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))s=-1;else if((s=Z.parseInt(e))===-1)return-1}if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),n<0||n>1e3||s===-2||s>1e3||s>=0&&n>s)throw new xe(Z.ERR_INVALID_REPEAT_SIZE,e.from(t));return n<<16|s&j.MAX_BMP}static isValidCaptureName(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n!==L.CODES.get("_")&&!J.isalnum(n))return!1}return!0}static parseInt(e){let t=e.pos();for(;e.more()&&e.peek()>=L.CODES.get("0")&&e.peek()<=L.CODES.get("9");)e.skip(1);let n=e.from(t);return n.length===0||n.length>1&&n.codePointAt(0)===L.CODES.get("0")?-1:n.length>8?-2:parseInt(n,10)}static isCharClass(e){return e.op===k.Op.LITERAL&&e.runes.length===1||e.op===k.Op.CHAR_CLASS||e.op===k.Op.ANY_CHAR_NOT_NL||e.op===k.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case k.Op.LITERAL:return e.runes.length===1&&e.runes[0]===t;case k.Op.CHAR_CLASS:for(let n=0;n<e.runes.length;n+=2)if(e.runes[n]<=t&&t<=e.runes[n+1])return!0;return!1;case k.Op.ANY_CHAR_NOT_NL:return t!==L.CODES.get(`
|
|
68
|
+
`);case k.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,t){switch(e.op){case k.Op.ANY_CHAR:break;case k.Op.ANY_CHAR_NOT_NL:Z.matchRune(t,L.CODES.get(`
|
|
69
|
+
`))&&(e.op=k.Op.ANY_CHAR);break;case k.Op.CHAR_CLASS:{let n=new On(Array.isArray(e.runes)?e.runes:Array.from(e.runes));t.op===k.Op.LITERAL?n.appendLiteral(t.runes[0],t.flags):n.appendClass(t.runes),e.runes=n.toGrowableArray();break}case k.Op.LITERAL:if(t.runes[0]===e.runes[0]&&t.flags===e.flags)break;e.op=k.Op.CHAR_CLASS,e.runes=new On().appendLiteral(e.runes[0],e.flags).appendLiteral(t.runes[0],t.flags).toGrowableArray()}}static parseEscape(e){let t=e.pos();if(e.skip(1),!e.more())throw new xe(Z.ERR_TRAILING_BACKSLASH);let n=e.pop();e:switch(n){case L.CODES.get("1"):case L.CODES.get("2"):case L.CODES.get("3"):case L.CODES.get("4"):case L.CODES.get("5"):case L.CODES.get("6"):case L.CODES.get("7"):if(!e.more()||e.peek()<L.CODES.get("0")||e.peek()>L.CODES.get("7"))break;case L.CODES.get("0"):{let s=n-L.CODES.get("0");for(let i=1;i<3&&!(!e.more()||e.peek()<L.CODES.get("0")||e.peek()>L.CODES.get("7"));i++)s=s*8+e.peek()-L.CODES.get("0"),e.skip(1);return s}case L.CODES.get("x"):{if(!e.more())break;if(n=e.pop(),n===L.CODES.get("{")){let o=0,B=0;for(;;){if(!e.more())break e;if(n=e.pop(),n===L.CODES.get("}"))break;let a=J.unhex(n);if(a<0||(B=B*16+a,B>j.MAX_RUNE))break e;o++}if(o===0)break e;return B}let s=J.unhex(n);if(!e.more())break;n=e.pop();let i=J.unhex(n);if(s<0||i<0)break;return s*16+i}case L.CODES.get("a"):return L.CODES.get("\x07");case L.CODES.get("f"):return L.CODES.get("\f");case L.CODES.get("n"):return L.CODES.get(`
|
|
70
|
+
`);case L.CODES.get("r"):return L.CODES.get("\r");case L.CODES.get("t"):return L.CODES.get(" ");case L.CODES.get("v"):return L.CODES.get("\v");default:if(n<=j.MAX_ASCII&&!J.isalnum(n))return n}throw new xe(Z.ERR_INVALID_ESCAPE,e.from(t))}static parseClassChar(e,t){if(!e.more())throw new xe(Z.ERR_MISSING_BRACKET,e.from(t));return e.lookingAt("\\")?Z.parseEscape(e):e.pop()}static hasCapture(e){if(e===null)return!1;if(e.op===k.Op.CAPTURE)return!0;if(e.subs){for(let t of e.subs)if(Z.hasCapture(t))return!0}return!1}constructor(e,t=0){this.wholeRegexp=e,this.flags=t,this.numCap=0,this.namedGroups=Object.create(null),this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null,this.nlb=0}newRegexp(e){let t=this.free;return t!==null&&t.subs!==null&&t.subs.length>0?(this.free=t.subs[0],t.reinit(),t.op=e):(t=new k(e),this.numRegexp+=1),t}reuse(e){this.height!==null&&this.height.has(e)&&this.height.delete(e),e.subs!==null&&e.subs.length>0&&(e.subs[0]=this.free),this.free=e}checkLimits(e){if(this.numRunes>Z.MAX_RUNES)throw new xe(Z.ERR_LARGE);this.checkSize(e),this.checkHeight(e)}checkSize(e){if(this.size===null){if(this.repeats===0&&(this.repeats=1),e.op===k.Op.REPEAT){let t=e.max;t===-1&&(t=e.min),t<=0&&(t=1),t>Math.floor(Z.MAX_SIZE/this.repeats)?this.repeats=Z.MAX_SIZE:this.repeats*=t}if(this.numRegexp<Math.floor(Z.MAX_SIZE/this.repeats))return;this.size=new Map;for(let t of this.stack)this.checkSize(t)}if(this.calcSize(e,!0)>Z.MAX_SIZE)throw new xe(Z.ERR_LARGE)}calcSize(e,t=!1){if(!t&&this.size!==null&&this.size.has(e))return this.size.get(e);let n=0;switch(e.op){case k.Op.LITERAL:n=e.runes.length;break;case k.Op.PLB:case k.Op.NLB:case k.Op.CAPTURE:case k.Op.STAR:n=2+this.calcSize(e.subs[0]);break;case k.Op.PLUS:case k.Op.QUEST:n=1+this.calcSize(e.subs[0]);break;case k.Op.CONCAT:for(let s of e.subs)n=n+this.calcSize(s);break;case k.Op.ALTERNATE:for(let s of e.subs)n=n+this.calcSize(s);e.subs.length>1&&(n=n+e.subs.length-1);break;case k.Op.REPEAT:{let s=this.calcSize(e.subs[0]);if(e.max===-1){e.min===0?n=2+s:n=1+e.min*s;break}n=e.max*s+(e.max-e.min);break}}return n=Math.max(1,n),this.size===null&&(this.size=new Map),this.size.set(e,n),n}checkHeight(e){if(!(this.numRegexp<Z.MAX_HEIGHT)){if(this.height===null){this.height=new Map;for(let t of this.stack)this.checkHeight(t)}if(this.calcHeight(e,!0)>Z.MAX_HEIGHT)throw new xe(Z.ERR_NESTING_DEPTH)}}calcHeight(e,t=!1){if(!t&&this.height!==null&&this.height.has(e))return this.height.get(e);let n=1;for(let s of e.subs){let i=this.calcHeight(s);n<1+i&&(n=1+i)}return this.height===null&&(this.height=new Map),this.height.set(e,n),n}pop(){return this.stack.pop()}popToPseudo(){let e=this.stack.length,t=e;for(;t>0&&!k.isPseudoOp(this.stack[t-1].op);)t--;return this.stack.splice(t,e-t)}push(e){if(this.numRunes+=e.runes.length,e.op===k.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],this.flags&~N.FOLD_CASE))return null;e.op=k.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags&~N.FOLD_CASE}else if(e.op===k.Op.CHAR_CLASS&&e.runes.length===4&&e.runes[0]===e.runes[1]&&e.runes[2]===e.runes[3]&&j.simpleFold(e.runes[0])===e.runes[2]&&j.simpleFold(e.runes[2])===e.runes[0]||e.op===k.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]+1===e.runes[1]&&j.simpleFold(e.runes[0])===e.runes[1]&&j.simpleFold(e.runes[1])===e.runes[0]){if(this.maybeConcat(e.runes[0],this.flags|N.FOLD_CASE))return null;e.op=k.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|N.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(e),this.checkLimits(e),e}maybeConcat(e,t){let n=this.stack.length;if(n<2)return!1;let s=this.stack[n-1],i=this.stack[n-2];if(s.op!==k.Op.LITERAL||i.op!==k.Op.LITERAL||(s.flags&N.FOLD_CASE)!==(i.flags&N.FOLD_CASE))return!1;Array.isArray(i.runes)||(i.runes=Array.from(i.runes));for(let o=0;o<s.runes.length;o++)i.runes.push(s.runes[o]);return e>=0?(s.runes=[e],s.flags=t,!0):(this.pop(),this.reuse(s),!1)}newLiteral(e,t){let n=this.newRegexp(k.Op.LITERAL);return n.flags=t,(t&N.FOLD_CASE)!==0&&(e=Z.minFoldRune(e)),n.runes=[e],n}literal(e){this.push(this.newLiteral(e,this.flags))}op(e){let t=this.newRegexp(e);return t.flags=this.flags,this.push(t)}repeat(e,t,n,s,i,o){let B=this.flags;if((B&N.PERL_X)!==0&&(i.more()&&i.lookingAt("?")&&(i.skip(1),B^=N.NON_GREEDY),o!==-1))throw new xe(Z.ERR_INVALID_REPEAT_OP,i.from(o));let a=this.stack.length;if(a===0)throw new xe(Z.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let c=this.stack[a-1];if(k.isPseudoOp(c.op))throw new xe(Z.ERR_MISSING_REPEAT_ARGUMENT,i.from(s));let l=this.newRegexp(e);if(l.min=t,l.max=n,l.flags=B,l.subs=[c],this.stack[a-1]=l,this.checkLimits(l),e===k.Op.REPEAT&&(t>=2||n>=2)&&!this.repeatIsValid(l,1e3))throw new xe(Z.ERR_INVALID_REPEAT_SIZE,i.from(s))}repeatIsValid(e,t){if(e.op===k.Op.REPEAT){let n=e.max;if(n===0)return!0;if(n<0&&(n=e.min),n>t)return!1;n>0&&(t=Math.trunc(t/n))}for(let n of e.subs)if(!this.repeatIsValid(n,t))return!1;return!0}concat(){this.maybeConcat(-1,0);let e=this.popToPseudo();return e.length===0?this.push(this.newRegexp(k.Op.EMPTY_MATCH)):this.push(this.collapse(e,k.Op.CONCAT))}alternate(){let e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),e.length===0?this.push(this.newRegexp(k.Op.NO_MATCH)):this.push(this.collapse(e,k.Op.ALTERNATE))}cleanAlt(e){e.op===k.Op.CHAR_CLASS&&(e.runes=new On(Array.from(e.runes)).cleanClass().toArray(),e.runes.length===2&&e.runes[0]===0&&e.runes[1]===j.MAX_RUNE?(e.runes=new Int32Array(0),e.op=k.Op.ANY_CHAR):e.runes.length===4&&e.runes[0]===0&&e.runes[1]===L.CODES.get(`
|
|
71
|
+
`)-1&&e.runes[2]===L.CODES.get(`
|
|
72
|
+
`)+1&&e.runes[3]===j.MAX_RUNE&&(e.runes=new Int32Array(0),e.op=k.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(e.length===1)return e[0];let n=0;for(let B of e)n+=B.op===t?B.subs.length:1;let s=new Array(n).fill(null),i=0;for(let B of e)if(B.op===t){for(let a=0;a<B.subs.length;a++)s[i++]=B.subs[a];this.reuse(B)}else s[i++]=B;let o=this.newRegexp(t);if(o.subs=s,t===k.Op.ALTERNATE&&(o.subs=this.factor(o.subs),o.subs.length===1)){let B=o;o=o.subs[0],this.reuse(B)}return o}factor(e){if(e.length<2)return e;let t=0,n=e.length,s=0,i=null,o=0,B=0,a=0;for(let l=0;l<=n;l++){let u=null,f=0,d=0;if(l<n){let h=e[t+l];if(h.op===k.Op.CONCAT&&h.subs.length>0&&(h=h.subs[0]),h.op===k.Op.LITERAL&&(u=h.runes,f=h.runes.length,d=h.flags&N.FOLD_CASE),d===B){let p=0;for(;p<o&&p<f&&i[p]===u[p];)p++;if(p>0){o=p;continue}}}if(l!==a)if(l===a+1)e[s++]=e[t+a];else{let h=this.newRegexp(k.Op.LITERAL);h.flags=B,h.runes=i.slice(0,o);for(let D=a;D<l;D++)e[t+D]=this.removeLeadingString(e[t+D],o),this.checkLimits(e[t+D]);let p=this.collapse(e.slice(t+a,t+l),k.Op.ALTERNATE),w=this.newRegexp(k.Op.CONCAT);w.subs=[h,p],e[s++]=w}a=l,i=u,o=f,B=d}n=s,t=0,a=0,s=0;let c=null;for(let l=0;l<=n;l++){let u=null;if(!(l<n&&(u=Z.leadingRegexp(e[t+l]),c!==null&&c.equals(u)&&(Z.isCharClass(c)||c.op===k.Op.REPEAT&&c.min===c.max&&Z.isCharClass(c.subs[0]))))){if(l!==a)if(l===a+1)e[s++]=e[t+a];else{let f=c;for(let p=a;p<l;p++){let w=p!==a;e[t+p]=this.removeLeadingRegexp(e[t+p],w),this.checkLimits(e[t+p])}let d=this.collapse(e.slice(t+a,t+l),k.Op.ALTERNATE),h=this.newRegexp(k.Op.CONCAT);h.subs=[f,d],e[s++]=h}a=l,c=u}}n=s,t=0,a=0,s=0;for(let l=0;l<=n;l++)if(!(l<n&&Z.isCharClass(e[t+l]))){if(l!==a)if(l===a+1)e[s++]=e[t+a];else{let u=a;for(let d=a+1;d<l;d++){let h=e[t+u],p=e[t+d];(h.op<p.op||h.op===p.op&&(h.runes!==null?h.runes.length:0)<(p.runes!==null?p.runes.length:0))&&(u=d)}let f=e[t+a];e[t+a]=e[t+u],e[t+u]=f;for(let d=a+1;d<l;d++)Z.mergeCharClass(e[t+a],e[t+d]),this.reuse(e[t+d]);this.cleanAlt(e[t+a]),e[s++]=e[t+a]}l<n&&(e[s++]=e[t+l]),a=l+1}n=s,t=0,a=0,s=0;for(let l=0;l<n;++l)l+1<n&&e[t+l].op===k.Op.EMPTY_MATCH&&e[t+l+1].op===k.Op.EMPTY_MATCH||(e[s++]=e[t+l]);return n=s,t=0,e.slice(t,n)}removeLeadingString(e,t){if(e.op===k.Op.CONCAT&&e.subs.length>0){let n=this.removeLeadingString(e.subs[0],t);if(e.subs[0]=n,n.op===k.Op.EMPTY_MATCH)switch(this.reuse(n),e.subs.length){case 0:case 1:e.op=k.Op.EMPTY_MATCH,e.subs=k.emptySubs();break;case 2:{let s=e;e=e.subs[1],this.reuse(s);break}default:e.subs=e.subs.slice(1,e.subs.length)}return e}return e.op===k.Op.LITERAL&&(e.runes=e.runes.slice(t,e.runes.length),e.runes.length===0&&(e.op=k.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,t){if(e.op===k.Op.CONCAT&&e.subs.length>0){switch(t&&this.reuse(e.subs[0]),e.subs=e.subs.slice(1,e.subs.length),e.subs.length){case 0:e.op=k.Op.EMPTY_MATCH,e.subs=k.emptySubs();break;case 1:{let n=e;e=e.subs[0],this.reuse(n);break}}return e}return t&&this.reuse(e),this.newRegexp(k.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&N.LITERAL)!==0)return Z.literalRegexp(this.wholeRegexp,this.flags);let e=-1,t=-1,n=-1,s=new ip(this.wholeRegexp);for(;s.more();){let i=-1;e:switch(s.peek()){case L.CODES.get("("):if((this.flags&N.LOOKBEHIND)!==0){if(s.lookingAt("(?<=")){this.parsePosLookBehind(),s.skip(4);break}if(s.lookingAt("(?<!")){this.parseNegLookBehind(),s.skip(4);break}}if((this.flags&N.PERL_X)!==0&&s.lookingAt("(?")){this.parsePerlFlags(s);break}this.op(k.Op.LEFT_PAREN).cap=++this.numCap,s.skip(1);break;case L.CODES.get("|"):this.parseVerticalBar(),s.skip(1);break;case L.CODES.get(")"):this.parseRightParen(),s.skip(1);break;case L.CODES.get("^"):(this.flags&N.ONE_LINE)!==0?this.op(k.Op.BEGIN_TEXT):this.op(k.Op.BEGIN_LINE),s.skip(1);break;case L.CODES.get("$"):(this.flags&N.ONE_LINE)!==0?this.op(k.Op.END_TEXT).flags|=N.WAS_DOLLAR:this.op(k.Op.END_LINE),s.skip(1);break;case L.CODES.get("."):(this.flags&N.DOT_NL)!==0?this.op(k.Op.ANY_CHAR):this.op(k.Op.ANY_CHAR_NOT_NL),s.skip(1);break;case L.CODES.get("["):this.parseClass(s);break;case L.CODES.get("*"):case L.CODES.get("+"):case L.CODES.get("?"):{i=s.pos();let o=null;switch(s.pop()){case L.CODES.get("*"):o=k.Op.STAR;break;case L.CODES.get("+"):o=k.Op.PLUS;break;case L.CODES.get("?"):o=k.Op.QUEST}this.repeat(o,t,n,i,s,e);break}case L.CODES.get("{"):{let o=s.pos(),B=Z.parseRepeat(s);if(B<0){s.rewindTo(o),this.literal(s.pop());break}i=o,t=B>>16,n=(B&j.MAX_BMP)<<16>>16,this.repeat(k.Op.REPEAT,t,n,i,s,e);break}case L.CODES.get("\\"):{let o=s.pos();if(s.skip(1),(this.flags&N.PERL_X)!==0&&s.more())switch(s.pop()){case L.CODES.get("A"):this.op(k.Op.BEGIN_TEXT);break e;case L.CODES.get("b"):this.op(k.Op.WORD_BOUNDARY);break e;case L.CODES.get("B"):this.op(k.Op.NO_WORD_BOUNDARY);break e;case L.CODES.get("C"):throw new xe(Z.ERR_INVALID_ESCAPE,"\\C");case L.CODES.get("Q"):{let c=s.rest(),l=c.indexOf("\\E");l>=0?(c=c.substring(0,l),s.skipString(c),s.skipString("\\E")):s.skipString(c);let u=0;for(;u<c.length;){let f=c.codePointAt(u);this.literal(f),u+=J.charCount(f)}break e}case L.CODES.get("z"):this.op(k.Op.END_TEXT);break e;default:s.rewindTo(o)}else s.rewindTo(o);let B=this.newRegexp(k.Op.CHAR_CLASS);if(B.flags=this.flags,s.lookingAt("\\p")||s.lookingAt("\\P")){let c=new On;if(this.parseUnicodeClass(s,c)){B.runes=c.toArray(),this.push(B);break e}}let a=new On;if(this.parsePerlClassEscape(s,a)){B.runes=a.toArray(),this.push(B);break e}s.rewindTo(o),this.reuse(B),this.literal(Z.parseEscape(s));break}default:this.literal(s.pop())}e=i}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new xe(Z.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(e){let t=e.pos(),n=e.rest();if(n.startsWith("(?P<")||n.startsWith("(?<")){let B=n.charAt(2)==="P"?4:3,a=n.indexOf(">");if(a<0)throw new xe(Z.ERR_INVALID_NAMED_CAPTURE,n);let c=n.substring(B,a);if(e.skipString(c),e.skip(B+1),!Z.isValidCaptureName(c))throw new xe(Z.ERR_INVALID_NAMED_CAPTURE,n.substring(0,a+1));let l=this.op(k.Op.LEFT_PAREN);if(l.cap=++this.numCap,this.namedGroups[c])throw new xe(Z.ERR_DUPLICATE_NAMED_CAPTURE,c);this.namedGroups[c]=this.numCap,l.name=c;return}e.skip(2);let s=this.flags,i=1,o=!1;e:for(;e.more();){let B=e.pop();switch(B){case L.CODES.get("i"):s|=N.FOLD_CASE,o=!0;break;case L.CODES.get("m"):s&=~N.ONE_LINE,o=!0;break;case L.CODES.get("s"):s|=N.DOT_NL,o=!0;break;case L.CODES.get("U"):s|=N.NON_GREEDY,o=!0;break;case L.CODES.get("-"):if(i<0)break e;i=-1,s=~s,o=!1;break;case L.CODES.get(":"):case L.CODES.get(")"):if(i<0){if(!o)break e;s=~s}B===L.CODES.get(":")&&this.op(k.Op.LEFT_PAREN),this.flags=s;return;default:break e}}throw new xe(Z.ERR_INVALID_PERL_OP,e.from(t))}parsePosLookBehind(){let e=this.newRegexp(k.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=++this.nlb,this.push(e)}parseNegLookBehind(){let e=this.newRegexp(k.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=-++this.nlb,this.push(e)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(k.Op.VERTICAL_BAR)}swapVerticalBar(){let e=this.stack.length;if(e>=3&&this.stack[e-2].op===k.Op.VERTICAL_BAR&&Z.isCharClass(this.stack[e-1])&&Z.isCharClass(this.stack[e-3])){let t=this.stack[e-1],n=this.stack[e-3];if(t.op>n.op){let s=n;n=t,t=s,this.stack[e-3]=n}return Z.mergeCharClass(n,t),this.reuse(t),this.pop(),!0}if(e>=2){let t=this.stack[e-1],n=this.stack[e-2];if(n.op===k.Op.VERTICAL_BAR)return e>=3&&this.cleanAlt(this.stack[e-3]),this.stack[e-2]=t,this.stack[e-1]=n,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new xe(Z.ERR_UNEXPECTED_PAREN,this.wholeRegexp);let e=this.pop(),t=this.pop();if(t.op!==k.Op.LEFT_PAREN)throw new xe(Z.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=t.flags,t.lb!==0){if(Z.hasCapture(e))throw new xe(Z.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);t.lb>0?t.op=k.Op.PLB:t.op=k.Op.NLB,t.subs=[e],this.push(t);return}t.cap===0?this.push(e):(t.op=k.Op.CAPTURE,t.subs=[e],this.push(t))}parsePerlClassEscape(e,t){let n=e.pos();if((this.flags&N.PERL_X)===0||!e.more()||e.pop()!==L.CODES.get("\\")||!e.more())return!1;e.pop();let s=e.from(n),i=Cu.has(s)?Cu.get(s):null;return i===null?!1:(t.appendGroup(i,(this.flags&N.FOLD_CASE)!==0),!0)}parseNamedClass(e,t){let n=e.rest(),s=n.indexOf(":]");if(s<0)return!1;let i=n.substring(0,s+2);e.skipString(i);let o=Fu.has(i)?Fu.get(i):null;if(o===null)throw new xe(Z.ERR_INVALID_CHAR_RANGE,i);return t.appendGroup(o,(this.flags&N.FOLD_CASE)!==0),!0}parseUnicodeClass(e,t){let n=e.pos();if((this.flags&N.UNICODE_GROUPS)===0||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let s=1,i=e.pop();if(i===L.CODES.get("P")&&(s=-1),!e.more())throw e.rewindTo(n),new xe(Z.ERR_INVALID_CHAR_RANGE,e.rest());i=e.pop();let o;if(i!==L.CODES.get("{"))o=J.runeToString(i);else{let l=e.rest(),u=l.indexOf("}");if(u<0)throw e.rewindTo(n),new xe(Z.ERR_INVALID_CHAR_RANGE,e.rest());o=l.substring(0,u),e.skipString(o),e.skip(1)}o.length!==0&&o.codePointAt(0)===L.CODES.get("^")&&(s=0-s,o=o.substring(1));let B=Z.unicodeTable(o);if(B===null)throw new xe(Z.ERR_INVALID_CHAR_RANGE,e.from(n));B.sign<0&&(s=0-s);let a=B.tab,c=B.fold;if((this.flags&N.FOLD_CASE)===0||c===null)t.appendTableWithSign(a,s);else{let l=new On().appendTable(a).appendTable(c).cleanClass().toArray();t.appendClassWithSign(Array.from(l),s)}return!0}parseClass(e){let t=e.pos();e.skip(1);let n=this.newRegexp(k.Op.CHAR_CLASS);n.flags=this.flags;let s=new On,i=1;e.more()&&e.lookingAt("^")&&(i=-1,e.skip(1),(this.flags&N.CLASS_NL)===0&&s.appendRange(L.CODES.get(`
|
|
73
|
+
`),L.CODES.get(`
|
|
74
|
+
`)));let o=!0;for(;!e.more()||e.peek()!==L.CODES.get("]")||o;){if(e.more()&&e.lookingAt("-")&&(this.flags&N.PERL_X)===0&&!o){let l=e.rest();if(l==="-"||!l.startsWith("-]"))throw e.rewindTo(t),new xe(Z.ERR_INVALID_CHAR_RANGE,e.rest())}o=!1;let B=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,s))continue;e.rewindTo(B)}if(this.parseUnicodeClass(e,s)||this.parsePerlClassEscape(e,s))continue;e.rewindTo(B);let a=Z.parseClassChar(e,t),c=a;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(c=Z.parseClassChar(e,t),c<a)throw new xe(Z.ERR_INVALID_CHAR_RANGE,e.from(B))}(this.flags&N.FOLD_CASE)===0?s.appendRange(a,c):s.appendFoldedRange(a,c)}e.skip(1),s.cleanClass(),i<0&&s.negateClass(),n.runes=s.toArray(),this.push(n)}},op=class Fn{static initTest(e){let t=Fn.compile(e),n=new Fn(t.expr,t.prog,t.numSubexp,t.longest);return n.cond=t.cond,n.prefix=t.prefix,n.prefixUTF8=t.prefixUTF8,n.prefixComplete=t.prefixComplete,n.prefixRune=t.prefixRune,n.prefilter=t.prefilter,n}static compile(e){return Fn.compileImpl(e,N.PERL,!1)}static compilePOSIX(e){return Fn.compileImpl(e,N.POSIX,!0)}static compileImpl(e,t,n){let s=qr.parse(e,t),i=s.maxCap(),o=s.namedGroups;s=Uu.simplify(s);let B=np.build(s),a=Ju.compileRegexp(s),c=new Fn(e,a,i,n);c.prefilter=B.type===ae.Type.NONE?null:B;let[l,u]=a.prefix();return c.prefixComplete=l,c.prefix=u,c.prefixUTF8=J.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=o,c}static match(e,t){return Fn.compile(e).match(t)}constructor(e,t,n=0,s=0){this.expr=e,this.prog=t,this.numSubexp=n,this.longest=s,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.machinePool=[],this.dfa=new No(this.prog),this.onepass=lu.compile(this.prog),this.prefilter=null}matchPrefixComplete(e,t,n,s){if((n===N.ANCHOR_START||n===N.ANCHOR_BOTH)&&t!==0)return null;let i=-1,o=-1,B=e.prefixLength(this);if(n===N.UNANCHORED){let a=e.index(this,t);if(a<0)return null;i=t+a,o=i+B}else if(n===N.ANCHOR_BOTH){if(e.endPos()!==B||e.index(this,0)!==0)return null;i=0,o=B}else if(n===N.ANCHOR_START){if(e.index(this,0)!==0)return null;i=0,o=B}if(i<0)return null;if(s>0){let a=new Int32Array(s).fill(-1);return a[0]=i,a[1]=o,Array.from(a)}return[]}createLookbehindState(){return this.prog.numLb>0?new jd(this.prog):null}executeEngine(e,t,n,s,i=null){if(this.prefixComplete&&(s===0||this.numSubexp===0))return this.matchPrefixComplete(e,t,n,s);if(this.prefilter!==null&&n===N.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(this.onepass!==null)return lu.execute(this,e,t,n,s);if(s>0)return this.prog.numLb===0&&e.endPos()<=ni.maxBitStateLen(this.prog)?ni.execute(this,e,t,n,s):this.doExecuteNFA(e,t,n,s,i);if(this.prog.numLb===0){let o=this.dfa.match(e,t,n);if(o!==null)return o?[]:null;if(e.endPos()<=ni.maxBitStateLen(this.prog))return ni.execute(this,e,t,n,s)}return this.doExecuteNFA(e,t,n,s,i)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(e){this.machinePool.push(e)}toString(){return this.expr}doExecuteNFA(e,t,n,s,i=null){let o=this.get();o||(o=Gu.fromRE2(this)),o.init(s);let B=o.match(e,t,n,i)?o.submatches():null;return this.put(o),B}match(e){return this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,0)!==null}matchWithGroup(e,t,n,s,i,o=null){return e instanceof In||(J.isByteArray(e)?e=$n.utf8(e):e=$n.utf16(e)),this.matchMachineInput(e,t,n,s,i,o)}matchMachineInput(e,t,n,s,i,o=null){if(t>n)return[!1,null];let B=e.isUTF16Encoding()?we.fromUTF16(e.asCharSequence(),0,n):we.fromUTF8(e.asBytes(),0,n),a=this.executeEngine(B,t,s,2*i,o);return a===null?[!1,null]:[!0,a]}matchUTF8(e){return this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,0)!==null}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,n){let s=0,i=0,o="",B=we.fromUTF16(e),a=this.createLookbehindState(),c=0;for(;i<=e.length;){let l=this.executeEngine(B,i,N.UNANCHORED,2,a);if(l===null||l.length===0)break;o+=e.substring(s,l[0]),(l[1]>s||l[0]===0)&&(o+=t(e.substring(l[0],l[1])),c++),s=l[1];let u=B.step(i)&7;if(i+u>l[1]?i+=u:i+1>l[1]?i++:i=l[1],c>=n)break}return o+=e.substring(s),o}pad(e){if(e===null)return null;let t=(1+this.numSubexp)*2;if(e.length<t){let n=new Array(t).fill(-1);for(let s=0;s<e.length;s++)n[s]=e[s];e=n}return e}allMatches(e,t,n=s=>s){let s=[],i=e.endPos();t<0&&(t=i+1);let o=0,B=0,a=-1,c=this.createLookbehindState();for(;B<t&&o<=i;){let l=this.executeEngine(e,o,N.UNANCHORED,this.prog.numCap,c);if(l===null||l.length===0)break;let u=!0;if(l[1]===o){l[0]===a&&(u=!1);let f=e.step(o);f<0?o=i+1:o+=f&7}else o=l[1];a=l[1],u&&(s.push(n(this.pad(l))),B++)}return s}findUTF8(e){let t=this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,2);return t===null?null:e.slice(t[0],t[1])}findUTF8Index(e){let t=this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,2);return t===null?null:t.slice(0,2)}find(e){let t=this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,2);return t===null?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,2)}findUTF8Submatch(e){let t=this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.slice(t[2*s],t[2*s+1]));return n}findUTF8SubmatchIndex(e){return this.pad(this.executeEngine(we.fromUTF8(e),0,N.UNANCHORED,this.prog.numCap))}findSubmatch(e){let t=this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,this.prog.numCap);if(t===null)return null;let n=new Array(1+this.numSubexp).fill(null);for(let s=0;s<n.length;s++)2*s<t.length&&t[2*s]>=0&&(n[s]=e.substring(t[2*s],t[2*s+1]));return n}findSubmatchIndex(e){return this.pad(this.executeEngine(we.fromUTF16(e),0,N.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){let n=this.allMatches(we.fromUTF8(e),t,s=>e.slice(s[0],s[1]));return n.length===0?null:n}findAllUTF8Index(e,t){let n=this.allMatches(we.fromUTF8(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAll(e,t){let n=this.allMatches(we.fromUTF16(e),t,s=>e.substring(s[0],s[1]));return n.length===0?null:n}findAllIndex(e,t){let n=this.allMatches(we.fromUTF16(e),t,s=>s.slice(0,2));return n.length===0?null:n}findAllUTF8Submatch(e,t){let n=this.allMatches(we.fromUTF8(e),t,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=e.slice(s[2*o],s[2*o+1]));return i});return n.length===0?null:n}findAllUTF8SubmatchIndex(e,t){let n=this.allMatches(we.fromUTF8(e),t);return n.length===0?null:n}findAllSubmatch(e,t){let n=this.allMatches(we.fromUTF16(e),t,s=>{let i=new Array(s.length/2|0).fill(null);for(let o=0;o<i.length;o++)s[2*o]>=0&&(i[o]=e.substring(s[2*o],s[2*o+1]));return i});return n.length===0?null:n}findAllSubmatchIndex(e,t){let n=this.allMatches(we.fromUTF16(e),t);return n.length===0?null:n}},Qg=class ii{static UNANCHORED=N.UNANCHORED;static ANCHOR_START=N.ANCHOR_START;static ANCHOR_BOTH=N.ANCHOR_BOTH;constructor(e=ii.UNANCHORED,t=0,n=8388608){this.anchor=e,this.jsFlags=t,this.maxMem=n;let s=N.PERL;(t&Ot.DISABLE_UNICODE_GROUPS)!==0&&(s&=~N.UNICODE_GROUPS),(t&Ot.LOOKBEHINDS)!==0&&(s|=N.LOOKBEHIND),this.re2Flags=s,this.regexps=[],this.prog=null,this.dfa=null,this.dummyRe2=null}add(e){if(this.prog)throw new Yr("Cannot add patterns after compile");let t=e;(this.jsFlags&Ot.CASE_INSENSITIVE)!==0&&(t=`(?i)${t}`),(this.jsFlags&Ot.DOTALL)!==0&&(t=`(?s)${t}`),(this.jsFlags&Ot.MULTILINE)!==0&&(t=`(?m)${t}`);let n=qr.parse(t,this.re2Flags);return this.regexps.push(Uu.simplify(n)),this.regexps.length-1}compile(){if(this.prog)return;let e=Ju.compileSet(this.regexps);if(e.numInst()>qr.MAX_SIZE)throw new Yr(`${qr.ERR_LARGE}: the set compiles to ${e.numInst()} instructions, more than ${qr.MAX_SIZE}`);this.prog=e,this.dfa=new No(this.prog,this.maxMem),this.dummyRe2={prog:this.prog,cond:this.prog.startCond(),prefix:"",prefixRune:0,longest:!1}}match(e){this.prog||this.compile();let t=J.isByteArray(e)?we.fromUTF8(e):we.fromUTF16(e),n=N.UNANCHORED;this.anchor===ii.ANCHOR_START?n=N.ANCHOR_START:this.anchor===ii.ANCHOR_BOTH&&(n=N.ANCHOR_BOTH);let s=this.dfa.matchSet(t,0,n);if(s!==null)return s;let i=Gu.fromRE2(this.dummyRe2);return i.init(0),i.matchSet(t,0,n)}},Bp=class dr{static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static translate(e){let t="";if(e instanceof RegExp&&(e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e=e.source),typeof e!="string")return e;let n="",s=!1,i=e.length;i===0&&(n="(?:)",s=!0);let o=!1,B=0;for(;B<i;){let c=e[B];if(c==="\\"){if(B+1<i)switch(c=e[B+1],c){case"\\":n+="\\\\",B+=2;continue;case"c":if(B+2<i){let f=e[B+2].charCodeAt(0);if(f>=65&&f<=90||f>=97&&f<=122){let d=f%32;n+="\\x",n+=(d>>4).toString(16).toUpperCase(),n+=(d&15).toString(16).toUpperCase(),B+=3,s=!0;continue}}n+="c",B+=2,s=!0;continue;case"u":if(B+2<i){if(e[B+2]==="{"){let f=B+3,d=!1,h=!1;for(;f<i;){let p=e[f];if(p==="}"){h=!0;break}if(!dr.isHexadecimal(p))break;d=!0,f++}if(h&&d){n+="\\x",B+=2,s=!0;continue}}else if(B+5<i){let f=!0;for(let d=0;d<4;d++)if(!dr.isHexadecimal(e[B+2+d])){f=!1;break}if(f){n+="\\x{"+e.substring(B+2,B+6)+"}",B+=6,s=!0;continue}}}n+="u",B+=2,s=!0;continue;case"x":{let f=!1;if(B+2<i&&e[B+2]==="{"){let d=B+3,h=!1,p=!1;for(;d<i;){let w=e[d];if(w==="}"){p=!0;break}if(!dr.isHexadecimal(w))break;h=!0,d++}p&&h&&(f=!0)}else B+3<i&&dr.isHexadecimal(e[B+2])&&dr.isHexadecimal(e[B+3])&&(f=!0);f?(n+="\\x",B+=2):(n+="x",B+=2,s=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":n+="\\"+c,B+=2;continue;default:{let f=e.codePointAt(B+1);if(f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122){let d=J.charCount(f);n+=e.substring(B+1,B+1+d),B+=d+1,s=!0}else{n+="\\";let d=J.charCount(f);n+=e.substring(B+1,B+1+d),B+=d+1}continue}}}else if(c==="/"){n+="\\/",B+=1,s=!0;continue}else if(c==="[")o=!0;else if(c==="]")o=!1;else if(!o&&c==="("&&B+2<i&&e[B+1]==="?"&&e[B+2]==="<"&&B+3<i&&!"=!>)".includes(e[B+3])){n+="(?P<",B+=3,s=!0;continue}let l=e.codePointAt(B),u=J.charCount(l);n+=e.substring(B,B+u),B+=u}let a=s?n:e;return t.length>0?`(?${t})${a}`:a}},pr=class Qe{static CASE_INSENSITIVE=Ot.CASE_INSENSITIVE;static DOTALL=Ot.DOTALL;static MULTILINE=Ot.MULTILINE;static DISABLE_UNICODE_GROUPS=Ot.DISABLE_UNICODE_GROUPS;static LONGEST_MATCH=Ot.LONGEST_MATCH;static LOOKBEHINDS=Ot.LOOKBEHINDS;static quote(e){return J.quoteMeta(e)}static quoteReplacement(e,t=!1){return ou.quoteReplacement(e,t)}static translateRegExp(e){return Bp.translate(e)}static compile(e,t=0){let n=e;if((t&Qe.CASE_INSENSITIVE)!==0&&(n=`(?i)${n}`),(t&Qe.DOTALL)!==0&&(n=`(?s)${n}`),(t&Qe.MULTILINE)!==0&&(n=`(?m)${n}`),(t&~(Qe.MULTILINE|Qe.DOTALL|Qe.CASE_INSENSITIVE|Qe.DISABLE_UNICODE_GROUPS|Qe.LONGEST_MATCH|Qe.LOOKBEHINDS))!==0)throw new Ud("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let s=N.PERL;(t&Qe.DISABLE_UNICODE_GROUPS)!==0&&(s&=~N.UNICODE_GROUPS),(t&Qe.LOOKBEHINDS)!==0&&(s|=N.LOOKBEHIND);let i=new Qe(e,t);return i.re2Input=op.compileImpl(n,s,(t&Qe.LONGEST_MATCH)!==0),i}static matches(e,t){return Qe.compile(e).testExact(t)}static initTest(e,t,n){if(e==null)throw new Error("pattern is null");if(n==null)throw new Error("re2 is null");let s=new Qe(e,t);return s.re2Input=n,s}constructor(e,t){this.patternInput=e,this.flagsInput=t,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.testExact(e)}matcher(e){return J.isByteArray(e)&&(e=$n.utf8(e)),new ou(this,e)}test(e){return J.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){let t=J.isByteArray(e)?we.fromUTF8(e):we.fromUTF16(e);return this.re2Input.executeEngine(t,0,N.ANCHOR_BOTH,0)!==null}exec(e){let t=this.matcher(e);if(!t.find())return null;let n=[t.group(0)];for(let i=1;i<=t.groupCount();i++){let o=t.group(i);n.push(o===null?void 0:o)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let i=t.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);n.groups=i}else n.groups=void 0;return n}split(e,t=0){let n=this.matcher(e),s=[],i=0,o=0;for(;n.find();){if(o===0&&n.end()===0){o=n.end();continue}if(t>0&&s.length===t-1)break;if(o===n.start()){if(t===0){i+=1,o=n.end();continue}}else for(;i>0;)s.push(""),i-=1;s.push(n.substring(o,n.start())),o=n.end()}if(t===0&&o!==n.inputLength()){for(;i>0;)s.push(""),i-=1;s.push(n.substring(o,n.inputLength()))}return(t!==0||s.length===0&&!(o===n.inputLength()&&o>0))&&s.push(n.substring(o,n.inputLength())),s}*matchAll(e){let t=this.matcher(e);for(;t.find();){let n=[t.group(0)];for(let i=1;i<=t.groupCount();i++){let o=t.group(i);n.push(o===null?void 0:o)}n.index=t.start(0),n.input=e;let s=this.namedGroups();if(Object.keys(s).length>0){let i=t.getNamedGroups();for(let o in i)i[o]===null&&(i[o]=void 0);n.groups=i}else n.groups=void 0;yield n}}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e?!0:e===null||this.constructor!==e.constructor?!1:this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput}};var ju="kubectl config current-context",ap=/^[A-Za-z0-9][A-Za-z0-9._:@/+-]*$/;function Ku(r){return r.length<=253&&ap.test(r)}var up=/^\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}$/;function Tn(r){return r===void 0?void 0:up.exec(r)?.[1]}function oi(r){return Ku(r)||Tn(r)!==void 0}function Zr(r,e){return r.kubeContext??e?.kubeContext}function Bi(r,e){let t=Tn(r);if(t===void 0)return r;let n=e(t);if(n===void 0)throw new Error(`md-runbook: kube-context \${param:${t}} has no value: nothing ran`);if(!Ku(n))throw new Error(`md-runbook: kube-context \${param:${t}} is ${JSON.stringify(n)}, which is not a Kubernetes context name: nothing ran`);return n}function zu(r){let e=Tn(r);return e===void 0?"":`\${param:${e}}`}function lp(r,e){let t=e.stdout.split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");if(e.exitCode===0&&t===r)return;let n=`md-runbook: this runbook is for the Kubernetes context ${r}`;if(e.exitCode===0&&t!==void 0)return`${n}, and kubectl's current context is ${t}: nothing ran. Switch with \`kubectl config use-context ${r}\`, or open the runbook meant for ${t}.`;let s=(e.stderr??"").split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");return`${n}, and \`${ju}\` ${s?`failed (${s})`:"named no context"}: nothing ran.`}async function qu(r,e,t=!1){if(r===void 0)return;let n;try{n=await e(t?Vu(r):ju)}catch(s){n={exitCode:null,stdout:"",stderr:s instanceof Error?s.message:String(s)}}return t?cp(r,n):lp(r,n)}var Yu=["check","pin"];function Qu(r){return`# md-runbook: the Kubernetes context of a runbook with kube-context-mode: pin.
|
|
75
75
|
# Only the current context is here; clusters, users and credentials come from your own kubeconfig.
|
|
76
76
|
apiVersion: v1
|
|
77
77
|
kind: Config
|
|
@@ -80,75 +80,79 @@ clusters: []
|
|
|
80
80
|
contexts: []
|
|
81
81
|
users: []
|
|
82
82
|
current-context: ${JSON.stringify(r)}
|
|
83
|
-
`}function
|
|
83
|
+
`}function Wu(r,e,t){return r+(t==="win32"?";":":")+e}function Vu(r){return`kubectl config get-contexts ${r}`}function cp(r,e){let t=e.stdout.split(/\r?\n/).map(i=>i.trim().split(/\s+/));if(e.exitCode===0&&t.some(i=>i[0]==="*"&&i[1]===r))return;let n=`md-runbook: this runbook pins the Kubernetes context ${r}`;if(e.exitCode===0&&t.some(i=>i[0]===r))return`${n}, and kubectl's current context in the cell is another one (does KUBECONFIG change before kubectl runs?): nothing ran.`;let s=(e.stderr??"").split(/\r?\n/).map(i=>i.trim()).find(i=>i!=="");return s!==void 0&&/\bcontext\b.*\bnot found\b/i.test(s)?`${n}, and your kubeconfig has no context ${r} (${s}): nothing ran. \`kubectl config get-contexts\` lists the ones you have.`:`${n}, and \`${Vu(r)}\` ${s?`failed (${s})`:"did not list it"}: nothing ran.`}var At=/^[A-Za-z_][A-Za-z0-9_]*$/,Go=/\$\{(secret|input|param|out):([A-Za-z_][A-Za-z0-9_]*)(:secret)?\}/g;function fp(r){return/_(PASSWORD|TOKEN|SECRET)$/i.test(r)}function Xe(r){let e=new Map;for(let t of r.matchAll(Go)){let n=t[1],s=t[2];if(t[3]&&n!=="input")continue;let i=n==="secret"||n==="input"&&(!!t[3]||fp(s)),o=e.get(s);if(o&&o.kind!==n)throw new Error(`${s} is referenced as both ${o.kind} and ${n}`);o?o.secret||=i:e.set(s,{kind:n,name:s,secret:i})}return[...e.values()]}function Ln(r,e){return r.replace(Go,(t,n,s,i)=>i&&n!=="input"?t:e(n,s))}function dp(r,e){switch(e){case"bash":return"${"+r+"}";case"pwsh":return"${env:"+r+"}";case"cmd":return"!"+r+"!"}}var pp="@setlocal EnableDelayedExpansion";function hr(r,e){let t=!1,n=r.replace(Go,(i,o,B,a)=>a&&o!=="input"?i:(t=!0,dp(B,e)));if(e!=="cmd"||!t)return n;let s=/\r\n/.test(r)?`\r
|
|
84
84
|
`:`
|
|
85
|
-
`;return
|
|
86
|
-
`)}function
|
|
87
|
-
`);function
|
|
88
|
-
`))}function
|
|
89
|
-
`))}function
|
|
90
|
-
[md-runbook] ${
|
|
91
|
-
`}function
|
|
92
|
-
`).trim().replace(/^\*\*[^*]*:\*\*\s*/,""),i=
|
|
85
|
+
`;return pp+s+n}function hp(r){let e=r.trim(),t=/(?:^|\s|\()one of:\s*((?:[^.()]|\.(?=\S))*?)\s*\)?\s*\.?\s*$/i.exec(e),n=t?[...new Set(t[1].split(/\s*,\s*(?:or\s+)?|\s+or\s+/i).map(i=>ai(i.trim())).filter(i=>i!==""))]:[];if(!t||n.length===0)return e!==""?{description:e}:{};let s=e.slice(0,t.index).replace(/[\s,;:(-]+$/,"");return{...s!==""?{description:s}:{},choices:n}}function ai(r){return r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))?r.startsWith('"')?r.slice(1,-1).replace(/\\(["\\])/g,"$1"):r.slice(1,-1).replace(/''/g,"'"):r}function Nn(r){let e=/^([a-z]+):\/\/([^/?#\s]*)([/?#][^\s]*)?$/i.exec(r);if(!e)return"not an address (expected https://host/path)";let t=e[1].toLowerCase(),n=e[2];if(n.includes("@"))return"no user name or password in the address (use report-runs-token: ${secret:NAME})";let s=/^(\[[0-9A-Fa-f:.]+\]|[A-Za-z0-9.-]+)(?::(\d{1,5}))?$/.exec(n);if(!s||s[1]===""||s[1].startsWith(".")||s[1].endsWith("-"))return`"${n}" is not a host name`;if(t!=="https")return t==="http"?Cp(s[1])?void 0:"http is only for localhost: use https":`${t}: is not https`}var Cp=r=>/^(localhost|127(\.\d{1,3}){3}|\[::1\])$/i.test(r);function Zu(r){let e=r.trim(),t=/^("(?:[^"\\]|\\.)*"|'(?:[^']|'')*')\s*(?:#(.*))?$/.exec(e);if(t)return{value:ai(t[1]),...t[2]!==void 0?{comment:t[2].trim()}:{}};if(e.startsWith("#"))return{value:"",comment:e.slice(1).trim()};let n=/\s+#(.*)$/.exec(e);return n?{value:e.slice(0,n.index),comment:n[1].trim()}:{value:e}}function gp(r){return Zu(r).value}var Po=/^\s+([A-Za-z_][A-Za-z0-9_]*)\s*:(?:\s+(.*?))?\s*$/;function mp(r){let e=r.trim().toLowerCase();if(/^\d+(?:\.\d+)?$/.test(e))return Number(e);let t=/^(?:(\d+)h)?\s*(?:(\d+)m)?\s*(?:(\d+)s)?$/.exec(e);if(!(!t||!t[1]&&!t[2]&&!t[3]))return Number(t[1]??0)*3600+Number(t[2]??0)*60+Number(t[3]??0)}function ve(r){let e=r.replace(/^\uFEFF/,"").split(/\r?\n/);if(e[0]?.trimEnd()!=="---")return;let t=[],n,s,i,o,B,a,c,l,u,f,d,h,p,w,D,m,b,v,R=Object.create(null),S=!1,I=!1;for(let x=1;x<e.length;x++){let E=e[x];if(/^(---|\.\.\.)\s*$/.test(E))return{params:t,...n?{mode:n}:{},...s!==void 0?{timeoutSeconds:s}:{},...i!==void 0?{cwd:i}:{},...o?{shell:o}:{},...B?{incident:B}:{},...a?{severity:a}:{},...c||B?{evidence:!0}:{},...l!==void 0?{rtoSeconds:l}:{},...u?{practice:u}:{},...f?{drill:f}:{},...d?{kubeContext:d}:{},...h?{kubeContextMode:h}:{},...p?{gitBashPathConversion:p}:{},...w?{manualSteps:w}:{},...Object.keys(R).length>0?{env:R}:{},...D?{reportRuns:D}:{},...m?{reportRunsRequired:m}:{},...b?{reportRunsSigned:b}:{},...v?{reportRunsToken:v}:{}};if(E.trim()===""||E.trim().startsWith("#"))continue;if(!/^\s/.test(E)&&!E.startsWith("-")){S=/^params\s*:\s*$/.test(E),I=/^env\s*:\s*(#.*)?$/i.test(E);let W=/^mode\s*:\s*["']?(session|isolated)["']?\s*(#.*)?$/i.exec(E);W&&(n=W[1].toLowerCase());let ee=/^timeout\s*:\s*["']?(\d+(?:\.\d+)?)s?["']?\s*(#.*)?$/i.exec(E);ee&&(s=Number(ee[1]));let Y=/^cwd\s*:\s*(.*?)\s*$/i.exec(E);Y&&Y[1]!==""&&(i=ai(Y[1].replace(/\s+#.*$/,"")));let se=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(E);if(se){let{shells:Q}=_r(se[1]);(Q.unix||Q.powershell)&&(o={...Q,...o})}let te=Q=>{let z=new RegExp(`^${Q}\\s*:\\s*(.*?)\\s*$`,"i").exec(E)?.[1];return z===void 0||z===""?void 0:ai(z.replace(/\s+#.*$/,""))};B=te("incident")??B,a=te("severity")??a,u=te("practice")??u;let Se=te("drill");Se!==void 0&&(f=/^(true|yes|on)$/i.test(Se));let ge=te("evidence");ge!==void 0&&(c=/^(true|yes|on)$/i.test(ge));let Ue=te("rto");Ue!==void 0&&(l=mp(Ue)??l);let De=te("kube-context");De!==void 0&&oi(De)&&(d=De);let be=te("kube-context-mode")?.toLowerCase();be!==void 0&&Yu.includes(be)&&(h=be);let $=te("git-bash-path-conversion")?.toLowerCase();($==="on"||$==="off")&&(p=$);let M=te("manual-steps")?.toLowerCase();(M==="pause"||M==="continue")&&(w=M);let A=te("report-runs");A!==void 0&&D===void 0&&Nn(A)===void 0&&(D=A);let G=te("report-runs-required");G!==void 0&&(m=/^(true|yes|on)$/i.test(G));let H=te("report-runs-signed");H!==void 0&&(b=/^(true|yes|on)$/i.test(H));let U=/^report-runs-token\s*:\s*["']?\$\{secret:([A-Za-z_][A-Za-z0-9_]*)\}["']?\s*(#.*)?$/i.exec(E);U&&(v=U[1]);continue}if(I){let W=Po.exec(E);W&&!(W[1]in R)&&(R[W[1]]=gp(W[2]??""));continue}if(!S)continue;let y=/^\s*-\s+([A-Za-z_][A-Za-z0-9_]*)(?:\s*:(?:\s+(.*?)|\s*)|\s+(#.*)|)\s*$/.exec(E);if(!y)continue;let O=y[1];if(t.some(W=>W.name===O))continue;let{value:P,comment:X}=Zu(y[2]??y[3]??""),q=/^["']/.test(y[2]?.trim()??"");t.push({name:O,...P!==""||q?{default:P}:{},...X!==void 0?hp(X):{}})}}var Ho=100,tl=36e5,Xr=class{constructor(e,t){this.source=e;this.flags=t;let n=0;t.includes("i")&&(n|=pr.CASE_INSENSITIVE),t.includes("m")&&(n|=pr.MULTILINE),t.includes("s")&&(n|=pr.DOTALL);try{this.re=pr.compile(e,n)}catch(s){let i=s instanceof Error?s.message:String(s);throw new Error(`invalid regular expression /${e}/${t}: ${i} (look-around and back-references are not supported)`)}}source;flags;re;exec(e){let t=this.re.matcher(e);if(!t.find())return null;let n=[];for(let s=0;s<=t.groupCount();s++)n.push(t.group(s)??void 0);return n}toString(){return`/${this.source}/${this.flags}`}},Ep=/^\/([\s\S]*)\/([imsu]*)$/;function _o(r){let e=Xe(r).find(n=>n.secret);if(e)throw new Error(`a check can't use the secret ${e.kind==="secret"?`\${secret:${e.name}}`:`\${input:${e.name}}`}: its text is shown when it fails`);let t=Ep.exec(r);return t?(Xe(t[1]).length>0&&new Xr(Ln(t[1],()=>"(?:x)"),t[2]),{kind:"regex",re:new Xr(t[1],t[2])}):{kind:"text",text:r}}function Jo(r){return[r?.expect,r?.expectNot].filter(e=>e!==void 0).map(e=>e.kind==="text"?e.text:e.re.source).join(`
|
|
86
|
+
`)}function bp(r){return Xe(Jo(r))}function nl(r,e,t=()=>!1){let n=(B,a,c)=>{let l=e[a];if(l===void 0)throw new Error(`\${${B}:${a}} in a check has no value`);if(t(a))throw new Error(`a check can't use \${${B}:${a}}: it is a secret value, and a check's text is shown when it fails`);return c(l)},s=B=>{if(B===void 0)return;if(B.kind==="text")return{kind:"text",text:Ln(B.text,(c,l)=>n(c,l,u=>u))};let a=Ln(B.re.source,(c,l)=>n(c,l,u=>`(?:${pr.quote(u)})`));return a===B.re.source?B:{kind:"regex",re:new Xr(a,B.re.flags)}};if(bp(r).length===0)return r;let i=s(r.expect),o=s(r.expectNot);return{...r,...i?{expect:i}:{},...o?{expectNot:o}:{}}}function ui(r){return r.kind==="text"?JSON.stringify(r.text):String(r.re)}function rl(r,e){let t=r.indexOf(":"),n=t<0?r:r.slice(0,t);if(!At.test(n))throw new Error("expected a variable name (letters, digits, _)");if(t<0)return{name:n,secret:e};let s=_o(r.slice(t+1));if(s.kind!=="regex")throw new Error("expected NAME or NAME:/regex/");return{name:n,pattern:s.re,secret:e}}function sl(r){return!!r&&(r.expect!==void 0||r.expectNot!==void 0||r.expectExit!==void 0||r.captures.length>0)}var Xu=r=>Rt(r).replace(/\r\n?/g,`
|
|
87
|
+
`);function el(r,e){return r.kind==="text"?e.includes(r.text):r.re.exec(e)!==null}function il(r,e,t,n){let s=[],i=r.expectExit??0,o=e===i;!o&&r.expectExit!==void 0&&s.push(`exit code ${e}, expected ${i}`);let B=Xu(t);r.expect&&!el(r.expect,B)&&(o=!1,s.push(r.expect.kind==="text"?`the output does not contain ${ui(r.expect)}`:`the output does not match ${ui(r.expect)}`)),r.expectNot&&el(r.expectNot,B)&&(o=!1,s.push(r.expectNot.kind==="text"?`the output contains ${ui(r.expectNot)}`:`the output matches ${ui(r.expectNot)}`));let a=[],c=[];if(o){let l=Xu(n);for(let u of r.captures){let f;if(u.pattern){let d=u.pattern.exec(l);f=d?d[1]??d[0]:void 0,f===void 0&&s.push(`capture ${u.name}: nothing in the output matches ${String(u.pattern)}`)}else f=l.trim(),f===""&&(s.push(`capture ${u.name}: the cell printed nothing`),f=void 0);f!==void 0&&a.push({name:u.name,value:f,secret:u.secret}),f!==void 0&&u.secret&&c.push(f)}a.length<r.captures.length&&(o=!1,a.length=0)}return{ok:o,failures:s,captured:a,secretValues:c}}var Dp={h:36e5,m:6e4,s:1e3,ms:1};function Uo(r){let e=r.trim();if(/^\d+(?:\.\d+)?$/.test(e))return Math.round(Number(e)*1e3);if(!/^(?:\d+(?:\.\d+)?(?:ms|h|m|s))+$/i.test(e))return;let t=0,n=1/0;for(let[,s,i]of e.matchAll(/(\d+(?:\.\d+)?)(ms|h|m|s)/gi)){let o=Dp[i.toLowerCase()];if(o>=n)return;n=o,t+=Number(s)*o}return Math.round(t)}var wp={windows:"windows",win:"windows",win32:"windows",linux:"linux",macos:"macos",mac:"macos",osx:"macos",darwin:"macos"},kp={windows:"Windows",linux:"Linux",macos:"macOS"};function ol(r){let e=[];for(let t of r.split(",").map(n=>n.trim().toLowerCase())){let n=wp[t];if(!n)return`unknown OS "${t}" (expected windows, linux or macos)`;e.includes(n)||e.push(n)}return e.length>0?e:"expected windows, linux or macos"}function Mn(r=process.platform){return r==="win32"?"windows":r==="darwin"?"macos":"linux"}function Cr(r){return r.map(e=>kp[e]).join(", ")}function Gn(r,e=Mn()){let t=-1,n=new Set,s=!1;return r.map((i,o)=>{if(i.kind!=="markup"){if(!i.os){s=!1;return}(!s||i.os.some(B=>n.has(B)))&&(t=o,n=new Set),s=!0;for(let B of i.os)n.add(B);return{group:t,active:i.os.includes(e)}}})}function sn(r){let e=Gn(r),t=new Map,n=0;return r.map((s,i)=>{if(s.kind!=="code")return;let o=e[i];return o&&t.has(o.group)?t.get(o.group):(n++,o&&t.set(o.group,n),n)})}var jo=r=>r===" "||r===" ";function on(r){let e=[],t=r.length,n=0;for(;n<t;){for(;n<t&&jo(r[n]);)n++;if(n>=t)break;if(r[n]==="{"){let a=r.indexOf("}",n);n=a<0?t:a+1;continue}let s=n;for(;n<t&&!jo(r[n])&&r[n]!=="=";)n++;let i=r.slice(s,n);if(r[n]!=="="){e.push({key:i,start:s,end:n});continue}n++;let o=r[n],B;if(o==='"'||o==="'"){let a=r.indexOf(o,n+1);B=r.slice(n+1,a<0?t:a),n=a<0?t:a+1}else{let a=n;for(;n<t&&!jo(r[n]);)n++;B=r.slice(a,n)}i!==""&&e.push({key:i,value:B,start:s,end:n})}return e}var xp=/^\s*[^\s{]*/;function gr(r,e,t){let n=me(e),s=[Jo(n.checks),zu(Zr(n,t))].filter(i=>i!=="");return Xe([r,...s].join(`
|
|
88
|
+
`))}function me(r){let e={env:{},errors:[]},t=()=>e.checks??={captures:[]},n;for(let{key:s,value:i}of on(r.replace(xp,""))){let o=s.toLowerCase();if(i===void 0)o==="continue-on-error"?e.continueOnError=!0:o==="skip"?e.skip=!0:o==="confirm"?e.confirm=!0:o==="no-confirm"?e.confirm=!1:o==="terminal"?e.terminal=!0:(o==="setup"||o==="teardown"||o==="ready")&&(e.part!==void 0&&e.part!==o?e.errors.push(`${o}: a block is only one of setup, teardown and ready (it is already ${e.part})`):e.part=o);else if(o==="timeout"){let B=Number(i.replace(/s$/i,""));i.trim()===""||!Number.isFinite(B)||B<0?e.errors.push(`timeout=${i}: expected seconds (0 = none)`):e.timeoutSeconds=B}else if(o==="estimate"){let B=Uo(i);B===void 0?e.errors.push(`estimate=${i}: expected a duration such as 2m30s, 45s or 90 (seconds)`):e.estimateSeconds=B/1e3}else if(o==="cwd")i===""?e.errors.push("cwd: empty path"):e.cwd=i;else if(o==="name")e.name=i;else if(o==="on-failure")i.trim()===""?e.errors.push("on-failure: empty step name"):e.onFailure=i.trim();else if(o==="expect"||o==="expect-not")try{t()[o==="expect"?"expect":"expectNot"]=_o(i)}catch(B){e.errors.push(`${o}=${i}: ${B instanceof Error?B.message:String(B)}`)}else if(o==="expect-exit")/^-?\d+$/.test(i.trim())?t().expectExit=Number(i):e.errors.push(`expect-exit=${i}: expected an exit code`);else if(o==="capture"||o==="capture-secret")try{t().captures.push(rl(i,o==="capture-secret"))}catch(B){e.errors.push(`${o}=${i}: ${B instanceof Error?B.message:String(B)}`)}else if(o==="os"){let B=ol(i);typeof B=="string"?e.errors.push(`os=${i}: ${B}`):e.os=B}else if(o==="host")i.trim()===""?e.errors.push("host: empty name"):e.host=i.trim();else if(o==="kube-context")oi(i.trim())?e.kubeContext=i.trim():e.errors.push(`kube-context=${i}: expected a Kubernetes context name or \${param:NAME}`);else if(o==="lines")i.toLowerCase()!=="any"?e.errors.push(`lines=${i}: expected lines=any`):e.lines="any";else if(o==="retry"){let B=Number(i);!Number.isInteger(B)||B<1||B>Ho?e.errors.push(`retry=${i}: expected the number of attempts (1 to ${Ho})`):e.retry={attempts:B,everyMs:5e3}}else o==="every"?(n=Uo(i),n===void 0?e.errors.push(`every=${i}: expected a duration such as 15s, 500ms or 2m`):n>tl&&e.errors.push(`every=${i}: at most 1h`)):o.startsWith("env.")&&s.length>4&&(e.env[s.slice(4)]=i)}return e.retry&&n!==void 0&&(e.retry.everyMs=n),e}var vp=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/;function Pn(r){let e=xn(r.replace(/^/,"")).map(s=>s.text),t=[],n=0;if(e[0]?.trimEnd()==="---"){let s=e.findIndex((i,o)=>o>0&&/^(---|\.\.\.)\s*$/.test(i));s>0&&(n=s+1)}for(;n<e.length;n++){let s=_e(e[n]);if(s){for(;n+1<e.length&&!Ke(e[n+1],s);)n++;n++;continue}let i=vp.exec(e[n]);if(!i)continue;let o=(i[2]??"").replace(/(^|[ \t]+)#+$/,"").trim();t.push({line:n,level:i[1].length,text:o})}return t}function li(r,e){return e.filter(t=>!r.some(n=>n.text.startsWith(t)))}function ci(r,e){if(r.length<2)return;let t=Math.min(...r.map(B=>B.level)),n=r.filter(B=>B.level===t);if(n.length!==1)return;let s=n[0],i=e.find(B=>s.text.startsWith(B));if(i===void 0)return;let o=r.find(B=>B!==s&&B.text.startsWith(i))?.text;return{section:i,title:s.text,...o!==void 0?{other:o}:{}}}function Hn(r,e){return t=>{let n=[];for(let s of r){if(s.line>=t)break;for(;n.length>0&&n[n.length-1].level>=s.level;)n.pop();n.push(s)}return n.some(s=>e.some(i=>s.text.startsWith(i)))}}var Sp="runbook",mr=3,Bl=new Set(["src","section"]),al=new Set(["cwd","expect","expect-not","expect-exit","capture","capture-secret","retry","every","terminal","host","lines","os"]);function Ge(r){return r===Sp}function yp(r){return r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))?r.slice(1,-1):r}function et(r,e){let t={sections:[],args:[],problems:[]};for(let n of on(r.replace(/^\s*[^\s{]*/,""))){let s=n.key.toLowerCase();s==="src"?n.value===void 0||n.value.trim()===""?t.problems.push({message:"src= is empty: give the runbook to run, relative to this file"}):t.src=n.value.trim():s==="section"&&(n.value===void 0||n.value.trim()===""?t.problems.push({message:"section= is empty: give the start of a heading of the runbook called"}):t.sections.push(n.value.trim()))}if(t.src===void 0&&!t.problems.some(n=>n.message.startsWith("src="))&&t.problems.push({message:"a runbook call needs src=, the runbook to run (relative to this file)"}),t.src!==void 0)try{for(let n of Xe(t.src))(n.kind==="input"||n.kind==="secret")&&t.problems.push({message:`src= can't use \${${n.kind}:${n.name}}: use \${param:NAME} or \${out:NAME}`})}catch(n){t.problems.push({message:`src=: ${n instanceof Error?n.message:String(n)}`})}return e.split(/\r?\n/).forEach((n,s)=>{let i=n.trim();if(i===""||i.startsWith("#"))return;let o=i.indexOf("="),B=o<0?i:i.slice(0,o).trim();if(o<0||!At.test(B)){t.problems.push({line:s,message:`"${i}": expected NAME=value, a parameter of the runbook called (NAME letters, digits and _)`});return}if(t.args.some(a=>a.name===B)){t.problems.push({line:s,message:`${B} is passed twice: the first one counts`});return}t.args.push({name:B,value:yp(i.slice(o+1).trim()),line:s})}),t}function Mt(r){return Xe([r.src??"",...r.args.map(e=>e.value)].join(`
|
|
89
|
+
`))}function fi(r,e){let t,n=Ln(r,(s,i)=>{let o=e(s,i);return o===void 0&&(t??={kind:s,name:i}),o??""});return t?{missing:t}:{text:n}}function Er(r){return/\$\{(param|out|input|secret):/.test(r)}function ul(r){return Ln(r,()=>"*")}function Rp(r){let e=ve(r)?.params??[],t=new Set;for(let n of r.matchAll(/\$\{param:([A-Za-z_][A-Za-z0-9_]*)\}/g))t.add(n[1]);return{declared:e,used:t}}function di(r,e){let{declared:t,used:n}=Rp(e),s=new Set([...t.map(d=>d.name),...n]),i=new Set(r.args.map(d=>d.name)),o=new Set(t.filter(d=>d.default!==void 0).map(d=>d.name)),B=Pn(e),a=li(B,r.sections),c=ci(B,r.sections),l=ft(he(e)).map(d=>d.line),u=Ur(e);return{manualOnly:r.sections.filter(d=>{if(a.includes(d))return!1;let h=Hn(B,[d]);return!l.some(h)&&u.some(p=>h(p.line))}),unknown:r.args.filter(d=>!s.has(d.name)),notPassed:[...s].filter(d=>!i.has(d)&&!o.has(d)),sections:[...a.map(d=>`section="${d}": no heading of the runbook called starts with it`),...c?[`section="${c.section}" matches the title "${c.title}", which holds every step${c.other?`; for "${c.other}", give more of it`:""}`]:[]]}}function Ko(r){let e=ve(r);return e?{...e.incident?{incident:e.incident}:{},...e.severity?{severity:e.severity}:{},...e.evidence?{evidence:"true"}:{},...e.drill?{drill:"true"}:{},...e.rtoSeconds!==void 0?{rto:`${e.rtoSeconds}s`}:{}}:{}}function es(r){let e=[`${r.done} done`];return r.skipped&&e.push(`${r.skipped} skipped`),r.failed&&e.push(`${r.failed} failed`),r.notRun&&e.push(`${r.notRun} not run`),r.manual&&e.push(`${r.manual} manual not ticked`),e.join(", ")}function ll(r){return{runbook:r.runbook,copy:r.copy,sha256:r.sha256,steps:es(r)}}function cl(r,e){let t=e.length?` (section${e.length===1?"":"s"} ${e.map(n=>`"${n}"`).join(", ")})`:"";return`[md-runbook] ran ${r.runbook}${t} as ${r.copy}
|
|
90
|
+
[md-runbook] ${es(r)} \xB7 sha256 ${r.sha256}
|
|
91
|
+
`}function pi(r){if(!(!r?.copy||!r.runbook))return{runbook:r.runbook,copy:r.copy,...r.sha256?{sha256:r.sha256}:{},...r.exit?{exit:r.exit}:{}}}function fl(r,e,t=(n,s)=>n===s){let n=r.findIndex(s=>t(s,e));if(n>=0)return`a runbook call cycle: ${[...r.slice(n),e].join(" \u2192 ")}`;if(r.length>mr)return`runbook calls nest more than ${mr} deep: ${[...r,e].join(" \u2192 ")}`}function hi(r){let e=/^?---[ \t]*\r?\n(?:[\s\S]*?\r?\n)?(?:---|\.\.\.)[ \t]*(?:\r?\n|$)/.exec(r);return e?r.slice(e[0].length):r}function Ci(r){let e=[],t;return r.split(/\r?\n/).forEach((n,s)=>{let i=/^ {0,3}(`{3,}|~{3,})/.exec(n)?.[1];if(t!==void 0){i&&i[0]===t[0]&&i.length>=t.length&&n.trim()===i&&(t=void 0);return}if(i){t=i;return}let o=/^ {0,3}(#{1,6})[ \t]+(.+?)(?:[ \t]+#+)?[ \t]*$/.exec(n),B=o?.[2]?.trim();o&&B&&e.push({level:o[1].length,text:B,line:s})}),e}function Bn(r){return Ci(hi(r)).find(e=>e.level===1)?.text}function it(r){let e=Math.max(0,r);if(e<1)return`${Math.round(e*1e3)/1e3}s`;let t=Math.round(e),n=Math.floor(t/3600),s=Math.floor(t%3600/60),i=t%60;return[n?`${n}h`:"",s?`${s}m`:"",i||!n&&!s?`${i}s`:""].join("")}function zo(r){let e=Math.round(Math.max(0,r)/60);return e<1?"under a minute":e<60?`about ${e} min`:`about ${Math.floor(e/60)} h${e%60?` ${e%60} min`:""}`}function pl(r){let e=Math.max(0,Math.round(r));if(e<60)return`${e}s`;if(e<120)return e===60?"1m":`1m ${e-60}s`;let t=Math.round(e/60);return t<60?`${t} min`:`${Math.floor(t/60)} h${t%60?` ${t%60} min`:""}`}function qo(r,e){return r>2*e&&r-e>60}function hl(r,e=10){let t=Math.min(1,Math.max(0,Number.isFinite(r)?r:0)),n=Math.round(t*e);return`[${"#".repeat(n)}${".".repeat(e-n)}]`}function Yo(r,e){return r?Math.max(10,Math.min(30,r-e-4)):20}function dl(r,e){return e.estimateSeconds===void 0?(r.unestimated++,e.state!=="done"):(r.totalSeconds+=e.estimateSeconds,e.state==="done"?r.doneSeconds+=e.estimateSeconds:e.state==="running"?r.leftSeconds+=Math.max(0,e.estimateSeconds-(e.elapsedSeconds??0)):r.leftSeconds+=e.estimateSeconds,!1)}function Qo(r,e={}){let t={setup:e.setup??"run",teardown:e.teardown??"offered"},n=r.some(a=>a.part!==void 0),s=a=>a.part===void 0||(a.part==="setup"?t.setup==="run":t.teardown==="chosen"),i={totalSeconds:0,doneSeconds:0,leftSeconds:0,blocks:0,unestimated:0,unestimatedLeft:0},o=()=>({totalSeconds:0,doneSeconds:0,leftSeconds:0,blocks:0,unestimated:0}),B={setup:o(),body:o(),teardown:o()};for(let a of r){let c=B[a.part??"body"];c.blocks++,dl(c,a),!(n&&!s(a))&&(i.blocks++,dl(i,a)&&i.unestimatedLeft++)}return i.totalSeconds>0&&(i.fraction=(i.totalSeconds-i.leftSeconds)/i.totalSeconds),n&&(i.parts={...B,states:t}),i}function Op(r){let e=r.parts;if(!e)return;let t=[],n=s=>s.unestimated===s.blocks?"":` ${it(s.totalSeconds)}`;return e.setup.blocks>0&&(e.states.setup==="up"?t.push("setup \u2713 already up"):e.states.setup==="unchecked"?t.push(e.setup.unestimated===e.setup.blocks?"setup unless already up":`+${it(e.setup.totalSeconds)} if the setup runs`):e.setup.leftSeconds===0&&e.setup.doneSeconds>0&&t.push("setup \u2713")),e.teardown.blocks>0&&t.push(e.states.teardown==="chosen"?`teardown${n(e.teardown)}`:`teardown${n(e.teardown)}, offered`),t.length?t.join(" \xB7 "):void 0}function gi(r,e=10){if(r.fraction===void 0)return;let t=[`${hl(r.fraction,e)} ${Math.floor(r.fraction*100)}%`,r.leftSeconds>0?`${pl(r.leftSeconds)} left`:"nothing left"];r.unestimatedLeft>0&&t.push(mi(r.unestimatedLeft));let n=Op(r);return n&&t.push(n),t.join(" \xB7 ")}function mi(r){return`${r} block${r===1?"":"s"} without an estimate`}function Ei(r,e,t){let n=he(r).cells,s=n.map(h=>h.kind==="code"&&ce(h.meta)?me(h.meta.info):void 0);n.forEach((h,p)=>{let w=s[p];if(!t||!w||w.estimateSeconds!==void 0||!ce(h.meta)||!Ge(h.languageId))return;let D=t(h.meta.info,h.value);D!==void 0&&(s[p]={...w,estimateSeconds:D})});let i=Gn(n.map((h,p)=>({kind:h.kind,...s[p]?.os?{os:s[p].os}:{}})),e),o=new Map,B=new Map;i.forEach((h,p)=>{h&&B.set(h.group,[...B.get(h.group)??[],{active:h.active,e:s[p]?.estimateSeconds}])});for(let[h,p]of B){let w=e!==void 0?p.find(m=>m.active):void 0,D=p.flatMap(m=>m.e===void 0?[]:[m.e]);o.set(h,w?w.e:D.length?Math.max(...D):void 0)}let a=new Set,c=[],l=[],u=[],f={setup:{seconds:0,blocks:0,unestimated:0},teardown:{seconds:0,blocks:0,unestimated:0}},d;return n.forEach((h,p)=>{if(h.kind!=="code"){c.push(void 0),l.push(!1);for(let v of Ci(p===0?hi(h.value):h.value))v.level>2||(d={heading:v.text,level:v.level,cell:p,seconds:0,blocks:0,unestimated:0},u.push(d));return}let w=s[p],D=i[p],m=w!==void 0&&!w.skip&&w.part!=="ready",b=w?.estimateSeconds;if(m&&D&&(a.has(D.group)?m=!1:(a.add(D.group),b=o.get(D.group))),c.push(w?.estimateSeconds),l.push(m),!!m&&(d||(d={level:0,cell:-1,seconds:0,blocks:0,unestimated:0},u.unshift(d)),d.blocks++,b===void 0?d.unestimated++:d.seconds+=b,w?.part==="setup"||w?.part==="teardown")){let v=f[w.part];v.blocks++,b===void 0?v.unestimated++:v.seconds+=b}}),{sections:u,totalSeconds:u.reduce((h,p)=>h+p.seconds,0),blocks:u.reduce((h,p)=>h+p.blocks,0),unestimated:u.reduce((h,p)=>h+p.unestimated,0),perCell:c,counts:l,parts:f,guarded:s.some((h,p)=>h?.part==="ready"||h?.part==="setup"&&Ge(n[p].languageId))}}function Wo(r,e,t,n,s=0,i){let o=me(r).estimateSeconds;if(o!==void 0)return o;let B=et(r,e);if(B.src===void 0||Er(B.src)||s>=mr)return;let a=t(B.src,i);if(!a)return;let c=Ei(a.text,n,(f,d)=>a.at===void 0?void 0:Wo(f,d,t,n,s+1,a.at));if(B.sections.length===0)return c.blocks>c.unestimated?c.totalSeconds:void 0;let l=Hn(Pn(a.text),B.sections),u;for(let f of ft(he(a.text))){let d=c.perCell[f.cellIndex];c.counts[f.cellIndex]&&d!==void 0&&l(f.line)&&(u=(u??0)+d)}return u}function Cl(r){return/(^|[\s;|&(])md-runbook-probe(\s|$)/m.test(r)}var Ap=/^(OK|FAIL) {2,}(\S+) {2,}(.+)$/;function gl(r){let e=[];for(let t of r.split(/\r?\n/)){let n=Ap.exec(t.trimEnd());if(!n)continue;let s=n[3],i={target:n[2],ok:n[1]==="OK",detail:s},o=/(\d+) days left \((\d{4}-\d\d-\d\d)\)/.exec(s),B=/expires in (-?\d+) days \((\d{4}-\d\d-\d\d)\)/.exec(s),a=/expires (\d{4}-\d\d-\d\d) \((-?\d+) days\)/.exec(s),c=/EXPIRED on (\d{4}-\d\d-\d\d) \((\d+) days ago\)/.exec(s);if(o||B){let l=o??B;i.daysLeft=Number(l[1]),i.expires=l[2]}else a?(i.daysLeft=Number(a[2]),i.expires=a[1]):c&&(i.daysLeft=-Number(c[2]),i.expires=c[1]);e.push(i)}return e}var Vo=["detected","mitigated","resolved"],Fp=/^[ \t]*<!--[ \t]*md-runbook:note\b(.*?)-->[ \t]*\r?\n((?:[ \t]*>.*(?:\r?\n|$))*)/gm;function $p(r){let e=[];for(let t of r.matchAll(Fp)){let n=Nr(t[1]??"");if(!n.at||Number.isNaN(Date.parse(n.at)))continue;let s=(t[2]??"").split(/\r?\n/).map(o=>o.replace(/^[ \t]*>[ \t]?/,"")).join(`
|
|
92
|
+
`).trim().replace(/^\*\*[^*]*:\*\*\s*/,""),i=Vo.includes(n.milestone??"")?n.milestone:void 0;e.push({at:n.at,kind:"note",text:s,...n.by?{by:n.by}:{},...i?{milestone:i}:{}})}return e}var Ip=(r,e)=>e==="failed"||r!==void 0&&!["0","done","skipped","running","proposed","declined"].includes(r)&&e!=="ok";function ml(r,e,t,n,s){if(!r.ran||Number.isNaN(Date.parse(r.ran)))return;let i=r.exit==="done"||r.exit==="skipped",o=s===void 0?[]:gl(s);return{at:r.ran,kind:i&&r.duration===void 0?"mark":"run",step:e,label:t,...r.by?{by:r.by}:{},...r.on?{on:r.on}:{},...r.exit!==void 0?{exit:r.exit}:{},...r.check?{check:r.check}:{},ok:!Ip(r.exit,r.check),...r.duration?{duration:r.duration}:{},...n?{earlier:!0}:{},...o.length?{checks:o}:{}}}var bi=(r,e)=>Math.max(0,Math.round((Date.parse(e)-Date.parse(r))/1e3));function Di(r){let e=ve(r),t=[],n=he(r),s=n.cells.map(d=>ce(d.meta)?me(d.meta.info):void 0),i=sn(n.cells.map((d,h)=>ce(d.meta)?{kind:"code",os:s[h]?.os}:{kind:"markup"}));for(let[d,h]of n.cells.entries()){let p=i[d];if(p===void 0||!ce(h.meta))continue;let w=s[d]?.name??h.value.split(/\r?\n/).find(m=>m.trim()!=="")?.trim()??`step ${p}`,D=Cl(h.value);if(h.output){let m=ml(h.output.attrs,p,w,!1,D?h.output.text:void 0);m&&t.push(m)}for(let m of h.meta.history?.entries??[]){let b=ml(m.attrs,p,w,!0,D?m.text:void 0);b&&t.push(b)}}t.push(...$p(r)),t.sort((d,h)=>Date.parse(d.at)-Date.parse(h.at)||(d.step??0)-(h.step??0));let o={};for(let d of t)d.milestone&&!o[d.milestone]&&(o[d.milestone]=d.at);let B=t.filter(d=>d.kind==="run"),a=t[0]?.at,c=t[t.length-1]?.at,l=o.detected??a,u={...e?.incident?{incident:e.incident}:{},...e?.severity?{severity:e.severity}:{},...e?.drill?{drill:!0}:{},...a?{start:a}:{},...c?{end:c}:{},...a&&c?{durationSeconds:bi(a,c)}:{},runs:B.length,failedAttempts:B.filter(d=>!d.ok).length,milestones:o,...l&&o.mitigated?{timeToMitigateSeconds:bi(l,o.mitigated)}:{},...l&&o.resolved?{timeToResolveSeconds:bi(l,o.resolved)}:{},people:[...new Set(t.flatMap(d=>d.by?[d.by]:[]))],places:[...new Set(t.flatMap(d=>d.on?[d.on]:[]))]},f=t.flatMap(d=>d.earlier?[]:d.checks??[]);if(f.length&&(u.endpointChecks={total:f.length,failed:f.filter(d=>!d.ok).length}),e?.rtoSeconds!==void 0){u.rtoSeconds=e.rtoSeconds;let d=o.resolved??c;a&&d&&(u.rtoMet=bi(a,d)<=e.rtoSeconds)}return{events:t,summary:u}}function ts(r){let e=Math.floor(r/3600),t=Math.floor(r%3600/60),n=r%60;return[e?`${e} h`:"",t?`${t} min`:"",n||!e&&!t?`${n} s`:""].filter(Boolean).join(" ")}var Tp=100;function Zo(r,e,t=!1){return!t&&!ve(r)?.evidence?{}:{...e.by?{by:e.by}:{},...e.on?{on:e.on}:{}}}function Xo(r,e){return ve(r)?.evidence?Math.max(e,Tp):e}function El(r,e){let t=/\r\n/.test(r)?`\r
|
|
93
93
|
`:`
|
|
94
|
-
`,n=r.startsWith("\uFEFF")?"\uFEFF":"",s=n?r.slice(1):r,i=c=>/^[\w.@:/+ -]*$/.test(c)&&!/^\s|\s$|: /.test(c)?c:JSON.stringify(c),B=s.split(/\r?\n/),o=B[0]?.trimEnd()==="---"?B.findIndex((c,u)=>u>0&&/^(---|\.\.\.)\s*$/.test(c)):-1;if(o<0){let c=["---",...Object.entries(e).map(([u,l])=>`${u}: ${i(l)}`),"---",""];return n+c.join(t)+t+s}let a=B.slice(1,o);for(let[c,u]of Object.entries(e)){let l=a.findIndex(f=>new RegExp(`^${c}\\s*:`).test(f));l>=0?a[l]=`${c}: ${i(u)}`:a.push(`${c}: ${i(u)}`)}return n+["---",...a,...B.slice(o)].join(t)}var Hl=require("module"),wC=(0,Hl.createRequire)("/"),kC;try{kC=wC("worker_threads").Worker}catch{}var Le=Uint8Array,at=Uint16Array,NB=Int32Array,ei=new Le([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ti=new Le([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),IB=new Le([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pl=function(r,e){for(var t=new at(31),n=0;n<31;++n)t[n]=e+=1<<r[n-1];for(var s=new NB(t[30]),n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)s[i]=i-t[n]<<5|n;return{b:t,r:s}},_l=Pl(ei,2),Jl=_l.b,TB=_l.r;Jl[28]=258,TB[258]=28;var Ul=Pl(ti,0),xC=Ul.b,Nl=Ul.r,LB=new at(32768);for(ge=0;ge<32768;++ge)Jt=(ge&43690)>>1|(ge&21845)<<1,Jt=(Jt&52428)>>2|(Jt&13107)<<2,Jt=(Jt&61680)>>4|(Jt&3855)<<4,LB[ge]=((Jt&65280)>>8|(Jt&255)<<8)>>1;var Jt,ge,$t=(function(r,e,t){for(var n=r.length,s=0,i=new at(e);s<n;++s)r[s]&&++i[r[s]-1];var B=new at(e);for(s=1;s<e;++s)B[s]=B[s-1]+i[s-1]<<1;var o;if(t){o=new at(1<<e);var a=15-e;for(s=0;s<n;++s)if(r[s])for(var c=s<<4|r[s],u=e-r[s],l=B[r[s]-1]++<<u,f=l|(1<<u)-1;l<=f;++l)o[LB[l]>>a]=c}else for(o=new at(n),s=0;s<n;++s)r[s]&&(o[s]=LB[B[r[s]-1]++]>>15-r[s]);return o}),Vt=new Le(288);for(ge=0;ge<144;++ge)Vt[ge]=8;var ge;for(ge=144;ge<256;++ge)Vt[ge]=9;var ge;for(ge=256;ge<280;++ge)Vt[ge]=7;var ge;for(ge=280;ge<288;++ge)Vt[ge]=8;var ge,_r=new Le(32);for(ge=0;ge<32;++ge)_r[ge]=5;var ge,vC=$t(Vt,9,0),SC=$t(Vt,9,1),OC=$t(_r,5,0),yC=$t(_r,5,1),AB=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},vt=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&t},RB=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},MB=function(r){return(r+7)/8|0},Pr=function(r,e,t){return(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length),new Le(r.subarray(e,t))};var AC=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],St=function(r,e,t){var n=new Error(e||AC[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,St),!t)throw n;return n},RC=function(r,e,t,n){var s=r.length,i=n?n.length:0;if(!s||e.f&&!e.l)return t||new Le(0);var B=!t,o=B||e.i!=2,a=e.i;B&&(t=new Le(s*3));var c=function(V){var q=t.length;if(V>q){var le=new Le(Math.max(q*2,V));le.set(t),t=le}},u=e.f||0,l=e.p||0,f=e.b||0,C=e.l,d=e.d,h=e.m,x=e.n,S=s*8;do{if(!C){u=vt(r,l,1);var E=vt(r,l+1,3);if(l+=3,E)if(E==1)C=SC,d=yC,h=9,x=5;else if(E==2){var v=vt(r,l,31)+257,I=vt(r,l+10,15)+4,k=v+vt(r,l+5,31)+1;l+=14;for(var m=new Le(k),L=new Le(19),A=0;A<I;++A)L[IB[A]]=vt(r,l+A*3,7);l+=I*3;for(var G=AB(L),z=(1<<G)-1,Y=$t(L,G,1),A=0;A<k;){var X=Y[vt(r,l,z)];l+=X&15;var b=X>>4;if(b<16)m[A++]=b;else{var ie=0,ee=0;for(b==16?(ee=3+vt(r,l,3),l+=2,ie=m[A-1]):b==17?(ee=3+vt(r,l,7),l+=3):b==18&&(ee=11+vt(r,l,127),l+=7);ee--;)m[A++]=ie}}var te=m.subarray(0,v),Be=m.subarray(v);h=AB(te),x=AB(Be),C=$t(te,h,1),d=$t(Be,x,1)}else St(1);else{var b=MB(l)+4,D=r[b-4]|r[b-3]<<8,O=b+D;if(O>s){a&&St(0);break}o&&c(f+D),t.set(r.subarray(b,O),f),e.b=f+=D,e.p=l=O*8,e.f=u;continue}if(l>S){a&&St(0);break}}o&&c(f+131072);for(var ke=(1<<h)-1,Ce=(1<<x)-1,$e=l;;$e=l){var ie=C[RB(r,l)&ke],De=ie>>4;if(l+=ie&15,l>S){a&&St(0);break}if(ie||St(2),De<256)t[f++]=De;else if(De==256){$e=l,C=null;break}else{var Pe=De-254;if(De>264){var A=De-257,F=ei[A];Pe=vt(r,l,(1<<F)-1)+Jl[A],l+=F}var N=d[RB(r,l)&Ce],R=N>>4;N||St(3),l+=N&15;var Be=xC[R];if(R>3){var F=ti[R];Be+=RB(r,l)&(1<<F)-1,l+=F}if(l>S){a&&St(0);break}o&&c(f+131072);var H=f+Pe;if(f<Be){var M=i-Be,J=Math.min(Be,H);for(M+f<0&&St(3);f<J;++f)t[f]=n[M+f]}for(;f<H;++f)t[f]=t[f-Be]}}e.l=C,e.p=$e,e.b=f,e.f=u,C&&(u=1,e.m=h,e.d=d,e.n=x)}while(!u);return f!=t.length&&B?Pr(t,0,f):t.subarray(0,f)},Ut=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8},Gr=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8,r[n+2]|=t>>16},FB=function(r,e){for(var t=[],n=0;n<r.length;++n)r[n]&&t.push({s:n,f:r[n]});var s=t.length,i=t.slice();if(!s)return{t:Kl,l:0};if(s==1){var B=new Le(t[0].s+1);return B[t[0].s]=1,{t:B,l:1}}t.sort(function(O,v){return O.f-v.f}),t.push({s:-1,f:25001});var o=t[0],a=t[1],c=0,u=1,l=2;for(t[0]={s:-1,f:o.f+a.f,l:o,r:a};u!=s-1;)o=t[t[c].f<t[l].f?c++:l++],a=t[c!=u&&t[c].f<t[l].f?c++:l++],t[u++]={s:-1,f:o.f+a.f,l:o,r:a};for(var f=i[0].s,n=1;n<s;++n)i[n].s>f&&(f=i[n].s);var C=new at(f+1),d=$B(t[u-1],C,0);if(d>e){var n=0,h=0,x=d-e,S=1<<x;for(i.sort(function(v,I){return C[I.s]-C[v.s]||v.f-I.f});n<s;++n){var E=i[n].s;if(C[E]>e)h+=S-(1<<d-C[E]),C[E]=e;else break}for(h>>=x;h>0;){var b=i[n].s;C[b]<e?h-=1<<e-C[b]++-1:++n}for(;n>=0&&h;--n){var D=i[n].s;C[D]==e&&(--C[D],++h)}d=e}return{t:new Le(C),l:d}},$B=function(r,e,t){return r.s==-1?Math.max($B(r.l,e,t+1),$B(r.r,e,t+1)):e[r.s]=t},Ml=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new at(++e),n=0,s=r[0],i=1,B=function(a){t[n++]=a},o=1;o<=e;++o)if(r[o]==s&&o!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)B(32754);i>2&&(B(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(B(s),--i;i>6;i-=6)B(8304);i>2&&(B(i-3<<5|8208),i=0)}for(;i--;)B(s);i=1,s=r[o]}return{c:t.subarray(0,n),n:e}},Hr=function(r,e){for(var t=0,n=0;n<e.length;++n)t+=r[n]*e[n];return t},jl=function(r,e,t){var n=t.length,s=MB(e+2);r[s]=n&255,r[s+1]=n>>8,r[s+2]=r[s]^255,r[s+3]=r[s+1]^255;for(var i=0;i<n;++i)r[s+i+4]=t[i];return(s+4+n)*8},Gl=function(r,e,t,n,s,i,B,o,a,c,u){Ut(e,u++,t),++s[256];for(var l=FB(s,15),f=l.t,C=l.l,d=FB(i,15),h=d.t,x=d.l,S=Ml(f),E=S.c,b=S.n,D=Ml(h),O=D.c,v=D.n,I=new at(19),k=0;k<E.length;++k)++I[E[k]&31];for(var k=0;k<O.length;++k)++I[O[k]&31];for(var m=FB(I,7),L=m.t,A=m.l,G=19;G>4&&!L[IB[G-1]];--G);var z=c+5<<3,Y=Hr(s,Vt)+Hr(i,_r)+B,X=Hr(s,f)+Hr(i,h)+B+14+3*G+Hr(I,L)+2*I[16]+3*I[17]+7*I[18];if(a>=0&&z<=Y&&z<=X)return jl(e,u,r.subarray(a,a+c));var ie,ee,te,Be;if(Ut(e,u,1+(X<Y)),u+=2,X<Y){ie=$t(f,C,0),ee=f,te=$t(h,x,0),Be=h;var ke=$t(L,A,0);Ut(e,u,b-257),Ut(e,u+5,v-1),Ut(e,u+10,G-4),u+=14;for(var k=0;k<G;++k)Ut(e,u+3*k,L[IB[k]]);u+=3*G;for(var Ce=[E,O],$e=0;$e<2;++$e)for(var De=Ce[$e],k=0;k<De.length;++k){var Pe=De[k]&31;Ut(e,u,ke[Pe]),u+=L[Pe],Pe>15&&(Ut(e,u,De[k]>>5&127),u+=De[k]>>12)}}else ie=vC,ee=Vt,te=OC,Be=_r;for(var k=0;k<o;++k){var F=n[k];if(F>255){var Pe=F>>18&31;Gr(e,u,ie[Pe+257]),u+=ee[Pe+257],Pe>7&&(Ut(e,u,F>>23&31),u+=ei[Pe]);var N=F&31;Gr(e,u,te[N]),u+=Be[N],N>3&&(Gr(e,u,F>>5&8191),u+=ti[N])}else Gr(e,u,ie[F]),u+=ee[F]}return Gr(e,u,ie[256]),u+ee[256]},FC=new NB([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Kl=new Le(0),IC=function(r,e,t,n,s,i){var B=i.z||r.length,o=new Le(n+B+5*(1+Math.ceil(B/7e3))+s),a=o.subarray(n,o.length-s),c=i.l,u=(i.r||0)&7;if(e){u&&(a[0]=i.r>>3);for(var l=FC[e-1],f=l>>13,C=l&8191,d=(1<<t)-1,h=i.p||new at(32768),x=i.h||new at(d+1),S=Math.ceil(t/3),E=2*S,b=function(xe){return(r[xe]^r[xe+1]<<S^r[xe+2]<<E)&d},D=new NB(25e3),O=new at(288),v=new at(32),I=0,k=0,m=i.i||0,L=0,A=i.w||0,G=0;m+2<B;++m){var z=b(m),Y=m&32767,X=x[z];if(h[Y]=X,x[z]=Y,A<=m){var ie=B-m;if((I>7e3||L>24576)&&(ie>423||!c)){u=Gl(r,a,0,D,O,v,k,L,G,m-G,u),L=I=k=0,G=m;for(var ee=0;ee<286;++ee)O[ee]=0;for(var ee=0;ee<30;++ee)v[ee]=0}var te=2,Be=0,ke=C,Ce=Y-X&32767;if(ie>2&&z==b(m-Ce))for(var $e=Math.min(f,ie)-1,De=Math.min(32767,m),Pe=Math.min(258,ie);Ce<=De&&--ke&&Y!=X;){if(r[m+te]==r[m+te-Ce]){for(var F=0;F<Pe&&r[m+F]==r[m+F-Ce];++F);if(F>te){if(te=F,Be=Ce,F>$e)break;for(var N=Math.min(Ce,F-2),R=0,ee=0;ee<N;++ee){var H=m-Ce+ee&32767,M=h[H],J=H-M&32767;J>R&&(R=J,X=H)}}}Y=X,X=h[Y],Ce+=Y-X&32767}if(Be){D[L++]=268435456|TB[te]<<18|Nl[Be];var V=TB[te]&31,q=Nl[Be]&31;k+=ei[V]+ti[q],++O[257+V],++v[q],A=m+te,++I}else D[L++]=r[m],++O[r[m]]}}for(m=Math.max(m,A);m<B;++m)D[L++]=r[m],++O[r[m]];u=Gl(r,a,c,D,O,v,k,L,G,m-G,u),c||(i.r=u&7|a[u/8|0]<<3,u-=7,i.h=x,i.p=h,i.i=m,i.w=A)}else{for(var m=i.w||0;m<B+c;m+=65535){var le=m+65535;le>=B&&(a[u/8|0]=c,le=B),u=jl(a,u+1,r.subarray(m,le))}i.i=B}return Pr(o,0,n+MB(u)+s)};var TC=function(r,e,t,n,s){if(!s&&(s={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),B=new Le(i.length+r.length);B.set(i),B.set(r,i.length),r=B,s.w=i.length}return IC(r,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,n,s)};function zl(r,e){return TC(r,e||{},0,0)}var Yl=(function(){function r(e,t){typeof e=="function"&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new Le(32768),this.p=new Le(0),n&&this.o.set(n)}return r.prototype.e=function(e){if(this.ondata||St(5),this.d&&St(4),!this.p.length)this.p=e;else if(e.length){var t=new Le(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},r.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=RC(this.p,this.s,this.o);this.ondata(Pr(n,t,this.s.b),this.d),this.o=Pr(n,this.s.b-32768),this.s.b=this.o.length,this.p=Pr(this.p,this.s.p/8|0),this.s.p&=7},r.prototype.push=function(e,t){this.e(e),this.c(t)},r})();var LC=typeof TextDecoder<"u"&&new TextDecoder,$C=0;try{LC.decode(Kl,{stream:!0}),$C=1}catch{}var NC=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Nt=(r,e)=>r>>>e|r<<32-e;function ni(r){return Array.from(MC(new TextEncoder().encode(r)),e=>e.toString(16).padStart(8,"0")).join("")}function MC(r){let e=r.length*8,t=new Uint8Array(r.length+9+63>>6<<6);t.set(r),t[r.length]=128;let n=new DataView(t.buffer);n.setUint32(t.length-8,Math.floor(e/4294967296)),n.setUint32(t.length-4,e>>>0);let s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);for(let B=0;B<t.length;B+=64){for(let h=0;h<16;h++)i[h]=n.getUint32(B+h*4);for(let h=16;h<64;h++){let x=Nt(i[h-15],7)^Nt(i[h-15],18)^i[h-15]>>>3,S=Nt(i[h-2],17)^Nt(i[h-2],19)^i[h-2]>>>10;i[h]=i[h-16]+x+i[h-7]+S>>>0}let[o,a,c,u,l,f,C,d]=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];for(let h=0;h<64;h++){let x=Nt(l,6)^Nt(l,11)^Nt(l,25),S=l&f^~l&C,E=d+x+S+NC[h]+i[h]>>>0,b=Nt(o,2)^Nt(o,13)^Nt(o,22),D=o&a^o&c^a&c,O=b+D>>>0;d=C,C=f,f=l,l=u+E>>>0,u=c,c=a,a=o,o=E+O>>>0}s[0]=s[0]+o>>>0,s[1]=s[1]+a>>>0,s[2]=s[2]+c>>>0,s[3]=s[3]+u>>>0,s[4]=s[4]+l>>>0,s[5]=s[5]+f>>>0,s[6]=s[6]+C>>>0,s[7]=s[7]+d>>>0}return s}var ri=/[ \t]/,Ql=/[A-Za-z0-9_]/,GC=/^[ \t]*(function[ \t]+[^\s()]+([ \t]*\([ \t]*\))?|[^\s()=;&|<>]+[ \t]*\([ \t]*\))[ \t]*$/;function HC(r,e){let t=e,n=r[t]==="-";for(n&&t++;t<r.length&&ri.test(r[t]);)t++;let s="";for(;t<r.length&&!/[\s;&|<>()]/.test(r[t]);){let i=r[t];if(i==="'"||i==='"'){let B=r.indexOf(i,t+1);if(B<0)return;let o=r.slice(t+1,B);s+=i==='"'?o.replace(/\\([\\"$`])/g,"$1"):o,t=B+1}else i==="\\"?(s+=r[t+1]??"",t+=2):(s+=i,t++)}return s===""?void 0:{word:s,strip:n,end:t}}var GB=class{quote="";stack=[];heredocs=[];inHeredoc=!1;cont=!1;open(){return this.quote!==""||this.stack.length>0||this.heredocs.length>0||this.cont}line(e){if(this.inHeredoc){let o=this.heredocs[0];return(o.strip?e.replace(/^\t+/,""):e)===o.word&&this.heredocs.shift(),this.inHeredoc=this.heredocs.length>0,!0}this.cont=!1;let t=this.quote!=="",n=this.quote==="",s="",i=e.length,B=0;for(;B<i;){let o=e[B];if(this.quote==="'"||this.quote==="$'"){o==="\\"&&this.quote==="$'"?B++:o==="'"&&(this.quote=""),B++;continue}if(this.quote==='"'||this.quote==="`"){o==="\\"?(B===i-1&&(this.cont=!0),B++):o===this.quote&&(this.quote=""),B++;continue}if(ri.test(o)){B++;continue}if(o==="#"&&(B===0||/[\s;&|()]/.test(e[B-1])))break;if(t=!0,o==="\\"){B===i-1&&(this.cont=!0),s="",n=!1,B+=2;continue}if(o==="'"||o==='"'||o==="`")this.quote=o;else if(o==="$"&&e[B+1]==="'")this.quote="$'",B++;else if(o==="<"&&e.startsWith("<<",B)&&e[B+2]!=="<"){let a=HC(e,B+2);if(a){this.heredocs.push({word:a.word,strip:a.strip}),B=a.end,s="x",n=!1;continue}}else if(o==="("||o===")")this.top()!=="case"&&(o==="("?this.stack.push("("):this.top()==="("&&this.stack.pop());else if(o==="{")this.stack.push("{");else if(o==="}")this.top()==="{"&&this.stack.pop();else if(n&&Ql.test(o)){let a=B;for(;a<i&&Ql.test(e[a]);)a++;let c=e.slice(B,a);if((a===i||/[\s;&|()<>]/.test(e[a]))&&this.keyword(c)){B=a,s=c;continue}B=a,s=c,n=!1;continue}n=o===";"||o==="&"||o==="|"||o==="("||o==="{"||o==="}"||o==="!",s=(s+o).slice(-2),B++}return this.quote===""&&(s.endsWith("|")||s.endsWith("&&"))&&(this.cont=!0),this.quote===""&&GC.test(e.replace(/[ \t]+#.*$/,""))&&(this.cont=!0),this.inHeredoc=this.heredocs.length>0,t}top(){return this.stack[this.stack.length-1]}keyword(e){switch(e){case"if":case"case":return this.stack.push(e),!0;case"for":case"while":case"until":case"select":return this.stack.push("loop"),!0;case"fi":case"esac":case"done":{let t=e==="fi"?"if":e==="esac"?"case":"loop";return this.top()===t&&this.stack.pop(),!0}case"then":case"do":case"else":case"elif":case"in":case"function":case"time":return!0;default:return!1}}},HB=class{quote="";blockComment=!1;depth=0;cont=!1;open(){return this.quote!==""||this.blockComment||this.depth>0||this.cont}line(e){if(this.cont=!1,this.quote==="@'"||this.quote==='@"')return e.startsWith(this.quote[1]+"@")&&(this.quote=""),!0;let t=this.quote!=="",n="",s=e.length,i=0;for(;i<s;){let B=e[i];if(this.blockComment){e.startsWith("#>",i)?(this.blockComment=!1,i+=2):i++;continue}if(this.quote==="'"){(B==="'"||B==="\u2018"||B==="\u2019")&&(e[i+1]===B?i++:this.quote=""),i++;continue}if(this.quote==='"'){B==="`"?i++:B==='"'&&(e[i+1]==='"'?i++:this.quote=""),i++;continue}if(ri.test(B)){i++;continue}if(e.startsWith("<#",i)){this.blockComment=!0,i+=2;continue}if(B==="#")break;if(t=!0,B==="`"){i===s-1&&(this.cont=!0),n="`",i+=2;continue}if(B==="@"&&(e[i+1]==="'"||e[i+1]==='"')&&e.slice(i+2).trim()==="")return this.quote=e[i+1]==="'"?"@'":'@"',!0;B==="'"||B==='"'||B==="\u2018"||B==="\u2019"?this.quote=B==='"'?'"':"'":B==="("||B==="{"||B==="["?this.depth++:(B===")"||B==="}"||B==="]")&&this.depth>0&&this.depth--,n=(n+B).slice(-4),i++}return this.quote===""&&!this.blockComment&&/(\||,|(?<![=!<>+\-*/%])=|&&|\|\||-and|-or)$/i.test(n)&&(this.cont=!0),t}},PB=class{depth=0;cont=!1;open(){return this.depth>0||this.cont}line(e){if(this.cont=!1,this.depth===0&&/^[ \t]*(@?rem([ \t].*)?$|:)/i.test(e))return!1;let t=!1,n=!1;for(let s=0;s<e.length;s++){let i=e[s];if(ri.test(i)||(n=!0),i==='"')t=!t;else{if(t)continue;i==="^"?(s===e.length-1&&(this.cont=!0),s++):i==="("?this.depth++:i===")"&&this.depth>0&&this.depth--}}return n}};function PC(r){return r==="pwsh"?new HB:r==="cmd"?new PB:new GB}function _C(r,e){return r==="pwsh"&&/^[ \t]*(\||(else|elseif|catch|finally)\b)/i.test(e)}function ql(r,e){let t=ln(r),n=PC(e),s=[],i,B=a=>{s.push({start:i,end:a,text:t.slice(i,a+1).map((c,u,l)=>c.text+(u<l.length-1?c.eol:"")).join("")}),i=void 0},o=a=>t.slice(a+1).find(c=>c.text.trim()!=="")?.text;for(let a=0;a<t.length;a++){let c=n.line(t[a].text);if(i===void 0){if(!c)continue;i=a}if(n.open())continue;let u=o(a);u!==void 0&&_C(e,u)||B(a)}if(i!==void 0){let a=t.length-1;for(;a>i&&t[a].text.trim()==="";)a--;B(a)}return s}var JB="md-runbook",Vl="md-runbook-manifest 1",Zl=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,99}$/,JC=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,UC=/^\d{4}-\d{2}-\d{2}$/,jC=r=>UC.test(r)&&new Date(`${r}T00:00:00Z`).toISOString().slice(0,10)===r;function Wl(r){return/^(PATH|IFS|ENV|BASH_ENV|CDPATH|GLOBIGNORE|HOME|SHELL|SHELLOPTS|BASHOPTS|PS[1-4]|PROMPT_COMMAND|PWD|OLDPWD|TMPDIR|LANG|LANGUAGE)$/.test(r)||/^(LC_|LD_|DYLD_|BASH_FUNC_|__mdrb_|MD_RUNBOOK_GATE_)/.test(r)}var KC=/\\[dDwWsSbB1-9]|\(\?|[*+?}]\?/,Jr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Mt(r){let e=new TextEncoder().encode(r),t="";for(let n=0;n<e.length;n+=3){let s=e[n],i=e[n+1],B=e[n+2];t+=Jr[s>>2]+Jr[(s&3)<<4|(i??0)>>4],t+=i===void 0?"=":Jr[(i&15)<<2|(B??0)>>6],t+=B===void 0?"=":Jr[B&63]}return t}function Xl(r){if(r.length%4!==0||!/^[A-Za-z0-9+/]*={0,2}$/.test(r))return;let e=r.endsWith("==")?2:r.endsWith("=")?1:0,t=new Uint8Array(r.length/4*3-e),n=0;for(let i=0;i<r.length;i+=4){let B=[0,1,2,3].map(a=>r[i+a]==="="?0:Jr.indexOf(r[i+a])),o=B[0]<<18|B[1]<<12|B[2]<<6|B[3];for(let a of[o>>16,o>>8&255,o&255])n<t.length&&(t[n++]=a)}let s=new TextDecoder().decode(t);return Mt(s)===r?s:void 0}function eu(r){let e=[];return de(r).cells.forEach((t,n)=>{t.kind==="code"&&ce(t.meta)&&rt(t.languageId)&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function _B(r){let e=[];return de(r).cells.forEach((t,n)=>{t.kind!=="code"||!ce(t.meta)||Me(t.languageId)==="bash"&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function zC(r){let e=[],t=null,n=!1;return r.split(/\r?\n/).forEach((s,i)=>{if(t){Ue(s,t)&&(/^( {4}|\t| {0,3}\t)/.test(s)&&e.push(`line ${i+1}: a closing fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),t=null);return}let B=_e(s);if(B){/^( {4}|\t| {0,3}\t)/.test(B.indent)&&e.push(`line ${i+1}: a fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),n&&Me(Yt(B.info))==="bash"&&e.push(`line ${i+1}: a bash block inside an HTML comment (<!-- \u2026 -->) is hidden on GitHub but would be signed`),t=B;return}for(let o of s.matchAll(/<!--|-->/g))n=o[0]==="<!--"}),e}function UB(r,e){let t=[];Zl.test(e.name)||t.push(`name "${e.name}": use letters, digits and . _ / - (at most 100)`),(!Number.isInteger(e.version)||e.version<1)&&t.push(`version ${e.version}: expected a positive whole number`),e.expires!==void 0&&!jC(e.expires)&&t.push(`expires ${e.expires}: expected a date, YYYY-MM-DD`);for(let c of e.scopes)JC.test(c)||t.push(`scope "${c}": use letters, digits and . _ - (at most 64)`);for(let[c,u]of Object.entries(e.patterns))xt.test(c)?Wl(c)&&t.push(`\${param:${c}}: ${c} can't be a parameter of a signed runbook (it changes how the shell runs the code)`):t.push(`pattern for "${c}": not a parameter name`),u===""||/[\r\n]/.test(u)?t.push(`pattern for ${c}: empty or more than one line`):KC.test(u)&&t.push(`pattern for ${c}: ${u} uses JavaScript-only syntax (\\d, \\w, (?\u2026), lazy *?, back-references); servers check it with grep -E: use [0-9], [A-Za-z0-9_], \u2026`);t.push(...zC(ru(r)));let n=He(r)?.shell?.unix;n&&n!=="bash"&&t.push(`front matter shell: ${n}: servers run signed runbooks in bash; remove it, or write shell: bash`);let s=new Set;for(let c of _B(r))for(let u of Ee(c.info).checks?.captures??[])u.secret&&s.add(u.name);let i=[];for(let c of _B(r)){let u=i.length+1,l=`cell ${u} (${c.value.split(`
|
|
95
|
-
`)
|
|
94
|
+
`,n=r.startsWith("\uFEFF")?"\uFEFF":"",s=n?r.slice(1):r,i=c=>/^[\w.@:/+ -]*$/.test(c)&&!/^\s|\s$|: /.test(c)?c:JSON.stringify(c),o=s.split(/\r?\n/),B=o[0]?.trimEnd()==="---"?o.findIndex((c,l)=>l>0&&/^(---|\.\.\.)\s*$/.test(c)):-1;if(B<0){let c=["---",...Object.entries(e).map(([l,u])=>`${l}: ${i(u)}`),"---",""];return n+c.join(t)+t+s}let a=o.slice(1,B);for(let[c,l]of Object.entries(e)){let u=a.findIndex(f=>new RegExp(`^${c}\\s*:`).test(f));u>=0?a[u]=`${c}: ${i(l)}`:a.push(`${c}: ${i(l)}`)}return n+["---",...a,...o.slice(B)].join(t)}var kl=require("module"),Lp=(0,kl.createRequire)("/"),Np;try{Np=Lp("worker_threads").Worker}catch{}var Pe=Uint8Array,ht=Uint16Array,BB=Int32Array,wi=new Pe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ki=new Pe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),rB=new Pe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xl=function(r,e){for(var t=new ht(31),n=0;n<31;++n)t[n]=e+=1<<r[n-1];for(var s=new BB(t[30]),n=1;n<30;++n)for(var i=t[n];i<t[n+1];++i)s[i]=i-t[n]<<5|n;return{b:t,r:s}},vl=xl(wi,2),Sl=vl.b,sB=vl.r;Sl[28]=258,sB[258]=28;var yl=xl(ki,0),Mp=yl.b,bl=yl.r,iB=new ht(32768);for(Ce=0;Ce<32768;++Ce)zt=(Ce&43690)>>1|(Ce&21845)<<1,zt=(zt&52428)>>2|(zt&13107)<<2,zt=(zt&61680)>>4|(zt&3855)<<4,iB[Ce]=((zt&65280)>>8|(zt&255)<<8)>>1;var zt,Ce,Gt=(function(r,e,t){for(var n=r.length,s=0,i=new ht(e);s<n;++s)r[s]&&++i[r[s]-1];var o=new ht(e);for(s=1;s<e;++s)o[s]=o[s-1]+i[s-1]<<1;var B;if(t){B=new ht(1<<e);var a=15-e;for(s=0;s<n;++s)if(r[s])for(var c=s<<4|r[s],l=e-r[s],u=o[r[s]-1]++<<l,f=u|(1<<l)-1;u<=f;++u)B[iB[u]>>a]=c}else for(B=new ht(n),s=0;s<n;++s)r[s]&&(B[s]=iB[o[r[s]-1]++]>>15-r[s]);return B}),an=new Pe(288);for(Ce=0;Ce<144;++Ce)an[Ce]=8;var Ce;for(Ce=144;Ce<256;++Ce)an[Ce]=9;var Ce;for(Ce=256;Ce<280;++Ce)an[Ce]=7;var Ce;for(Ce=280;Ce<288;++Ce)an[Ce]=8;var Ce,is=new Pe(32);for(Ce=0;Ce<32;++Ce)is[Ce]=5;var Ce,Gp=Gt(an,9,0),Pp=Gt(an,9,1),Hp=Gt(is,5,0),_p=Gt(is,5,1),eB=function(r){for(var e=r[0],t=1;t<r.length;++t)r[t]>e&&(e=r[t]);return e},Ft=function(r,e,t){var n=e/8|0;return(r[n]|r[n+1]<<8)>>(e&7)&t},tB=function(r,e){var t=e/8|0;return(r[t]|r[t+1]<<8|r[t+2]<<16)>>(e&7)},aB=function(r){return(r+7)/8|0},ss=function(r,e,t){return(e==null||e<0)&&(e=0),(t==null||t>r.length)&&(t=r.length),new Pe(r.subarray(e,t))};var Jp=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],$t=function(r,e,t){var n=new Error(e||Jp[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,$t),!t)throw n;return n},Up=function(r,e,t,n){var s=r.length,i=n?n.length:0;if(!s||e.f&&!e.l)return t||new Pe(0);var o=!t,B=o||e.i!=2,a=e.i;o&&(t=new Pe(s*3));var c=function(Q){var z=t.length;if(Q>z){var ue=new Pe(Math.max(z*2,Q));ue.set(t),t=ue}},l=e.f||0,u=e.p||0,f=e.b||0,d=e.l,h=e.d,p=e.m,w=e.n,D=s*8;do{if(!d){l=Ft(r,u,1);var m=Ft(r,u+1,3);if(u+=3,m)if(m==1)d=Pp,h=_p,p=9,w=5;else if(m==2){var S=Ft(r,u,31)+257,I=Ft(r,u+10,15)+4,x=S+Ft(r,u+5,31)+1;u+=14;for(var E=new Pe(x),y=new Pe(19),O=0;O<I;++O)y[rB[O]]=Ft(r,u+O*3,7);u+=I*3;for(var P=eB(y),X=(1<<P)-1,q=Gt(y,P,1),O=0;O<x;){var W=q[Ft(r,u,X)];u+=W&15;var b=W>>4;if(b<16)E[O++]=b;else{var ee=0,Y=0;for(b==16?(Y=3+Ft(r,u,3),u+=2,ee=E[O-1]):b==17?(Y=3+Ft(r,u,7),u+=3):b==18&&(Y=11+Ft(r,u,127),u+=7);Y--;)E[O++]=ee}}var se=E.subarray(0,S),te=E.subarray(S);p=eB(se),w=eB(te),d=Gt(se,p,1),h=Gt(te,w,1)}else $t(1);else{var b=aB(u)+4,v=r[b-4]|r[b-3]<<8,R=b+v;if(R>s){a&&$t(0);break}B&&c(f+v),t.set(r.subarray(b,R),f),e.b=f+=v,e.p=u=R*8,e.f=l;continue}if(u>D){a&&$t(0);break}}B&&c(f+131072);for(var Se=(1<<p)-1,ge=(1<<w)-1,Ue=u;;Ue=u){var ee=d[tB(r,u)&Se],De=ee>>4;if(u+=ee&15,u>D){a&&$t(0);break}if(ee||$t(2),De<256)t[f++]=De;else if(De==256){Ue=u,d=null;break}else{var be=De-254;if(De>264){var O=De-257,$=wi[O];be=Ft(r,u,(1<<$)-1)+Sl[O],u+=$}var M=h[tB(r,u)&ge],A=M>>4;M||$t(3),u+=M&15;var te=Mp[A];if(A>3){var $=ki[A];te+=tB(r,u)&(1<<$)-1,u+=$}if(u>D){a&&$t(0);break}B&&c(f+131072);var G=f+be;if(f<te){var H=i-te,U=Math.min(te,G);for(H+f<0&&$t(3);f<U;++f)t[f]=n[H+f]}for(;f<G;++f)t[f]=t[f-te]}}e.l=d,e.p=Ue,e.b=f,e.f=l,d&&(l=1,e.m=p,e.d=h,e.n=w)}while(!l);return f!=t.length&&o?ss(t,0,f):t.subarray(0,f)},qt=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8},ns=function(r,e,t){t<<=e&7;var n=e/8|0;r[n]|=t,r[n+1]|=t>>8,r[n+2]|=t>>16},nB=function(r,e){for(var t=[],n=0;n<r.length;++n)r[n]&&t.push({s:n,f:r[n]});var s=t.length,i=t.slice();if(!s)return{t:Ol,l:0};if(s==1){var o=new Pe(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(R,S){return R.f-S.f}),t.push({s:-1,f:25001});var B=t[0],a=t[1],c=0,l=1,u=2;for(t[0]={s:-1,f:B.f+a.f,l:B,r:a};l!=s-1;)B=t[t[c].f<t[u].f?c++:u++],a=t[c!=l&&t[c].f<t[u].f?c++:u++],t[l++]={s:-1,f:B.f+a.f,l:B,r:a};for(var f=i[0].s,n=1;n<s;++n)i[n].s>f&&(f=i[n].s);var d=new ht(f+1),h=oB(t[l-1],d,0);if(h>e){var n=0,p=0,w=h-e,D=1<<w;for(i.sort(function(S,I){return d[I.s]-d[S.s]||S.f-I.f});n<s;++n){var m=i[n].s;if(d[m]>e)p+=D-(1<<h-d[m]),d[m]=e;else break}for(p>>=w;p>0;){var b=i[n].s;d[b]<e?p-=1<<e-d[b]++-1:++n}for(;n>=0&&p;--n){var v=i[n].s;d[v]==e&&(--d[v],++p)}h=e}return{t:new Pe(d),l:h}},oB=function(r,e,t){return r.s==-1?Math.max(oB(r.l,e,t+1),oB(r.r,e,t+1)):e[r.s]=t},Dl=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new ht(++e),n=0,s=r[0],i=1,o=function(a){t[n++]=a},B=1;B<=e;++B)if(r[B]==s&&B!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=r[B]}return{c:t.subarray(0,n),n:e}},rs=function(r,e){for(var t=0,n=0;n<e.length;++n)t+=r[n]*e[n];return t},Rl=function(r,e,t){var n=t.length,s=aB(e+2);r[s]=n&255,r[s+1]=n>>8,r[s+2]=r[s]^255,r[s+3]=r[s+1]^255;for(var i=0;i<n;++i)r[s+i+4]=t[i];return(s+4+n)*8},wl=function(r,e,t,n,s,i,o,B,a,c,l){qt(e,l++,t),++s[256];for(var u=nB(s,15),f=u.t,d=u.l,h=nB(i,15),p=h.t,w=h.l,D=Dl(f),m=D.c,b=D.n,v=Dl(p),R=v.c,S=v.n,I=new ht(19),x=0;x<m.length;++x)++I[m[x]&31];for(var x=0;x<R.length;++x)++I[R[x]&31];for(var E=nB(I,7),y=E.t,O=E.l,P=19;P>4&&!y[rB[P-1]];--P);var X=c+5<<3,q=rs(s,an)+rs(i,is)+o,W=rs(s,f)+rs(i,p)+o+14+3*P+rs(I,y)+2*I[16]+3*I[17]+7*I[18];if(a>=0&&X<=q&&X<=W)return Rl(e,l,r.subarray(a,a+c));var ee,Y,se,te;if(qt(e,l,1+(W<q)),l+=2,W<q){ee=Gt(f,d,0),Y=f,se=Gt(p,w,0),te=p;var Se=Gt(y,O,0);qt(e,l,b-257),qt(e,l+5,S-1),qt(e,l+10,P-4),l+=14;for(var x=0;x<P;++x)qt(e,l+3*x,y[rB[x]]);l+=3*P;for(var ge=[m,R],Ue=0;Ue<2;++Ue)for(var De=ge[Ue],x=0;x<De.length;++x){var be=De[x]&31;qt(e,l,Se[be]),l+=y[be],be>15&&(qt(e,l,De[x]>>5&127),l+=De[x]>>12)}}else ee=Gp,Y=an,se=Hp,te=is;for(var x=0;x<B;++x){var $=n[x];if($>255){var be=$>>18&31;ns(e,l,ee[be+257]),l+=Y[be+257],be>7&&(qt(e,l,$>>23&31),l+=wi[be]);var M=$&31;ns(e,l,se[M]),l+=te[M],M>3&&(ns(e,l,$>>5&8191),l+=ki[M])}else ns(e,l,ee[$]),l+=Y[$]}return ns(e,l,ee[256]),l+Y[256]},jp=new BB([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ol=new Pe(0),Kp=function(r,e,t,n,s,i){var o=i.z||r.length,B=new Pe(n+o+5*(1+Math.ceil(o/7e3))+s),a=B.subarray(n,B.length-s),c=i.l,l=(i.r||0)&7;if(e){l&&(a[0]=i.r>>3);for(var u=jp[e-1],f=u>>13,d=u&8191,h=(1<<t)-1,p=i.p||new ht(32768),w=i.h||new ht(h+1),D=Math.ceil(t/3),m=2*D,b=function(ke){return(r[ke]^r[ke+1]<<D^r[ke+2]<<m)&h},v=new BB(25e3),R=new ht(288),S=new ht(32),I=0,x=0,E=i.i||0,y=0,O=i.w||0,P=0;E+2<o;++E){var X=b(E),q=E&32767,W=w[X];if(p[q]=W,w[X]=q,O<=E){var ee=o-E;if((I>7e3||y>24576)&&(ee>423||!c)){l=wl(r,a,0,v,R,S,x,y,P,E-P,l),y=I=x=0,P=E;for(var Y=0;Y<286;++Y)R[Y]=0;for(var Y=0;Y<30;++Y)S[Y]=0}var se=2,te=0,Se=d,ge=q-W&32767;if(ee>2&&X==b(E-ge))for(var Ue=Math.min(f,ee)-1,De=Math.min(32767,E),be=Math.min(258,ee);ge<=De&&--Se&&q!=W;){if(r[E+se]==r[E+se-ge]){for(var $=0;$<be&&r[E+$]==r[E+$-ge];++$);if($>se){if(se=$,te=ge,$>Ue)break;for(var M=Math.min(ge,$-2),A=0,Y=0;Y<M;++Y){var G=E-ge+Y&32767,H=p[G],U=G-H&32767;U>A&&(A=U,W=G)}}}q=W,W=p[q],ge+=q-W&32767}if(te){v[y++]=268435456|sB[se]<<18|bl[te];var Q=sB[se]&31,z=bl[te]&31;x+=wi[Q]+ki[z],++R[257+Q],++S[z],O=E+se,++I}else v[y++]=r[E],++R[r[E]]}}for(E=Math.max(E,O);E<o;++E)v[y++]=r[E],++R[r[E]];l=wl(r,a,c,v,R,S,x,y,P,E-P,l),c||(i.r=l&7|a[l/8|0]<<3,l-=7,i.h=w,i.p=p,i.i=E,i.w=O)}else{for(var E=i.w||0;E<o+c;E+=65535){var ue=E+65535;ue>=o&&(a[l/8|0]=c,ue=o),l=Rl(a,l+1,r.subarray(E,ue))}i.i=o}return ss(B,0,n+aB(l)+s)};var zp=function(r,e,t,n,s){if(!s&&(s={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new Pe(i.length+r.length);o.set(i),o.set(r,i.length),r=o,s.w=i.length}return Kp(r,e.level==null?6:e.level,e.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+e.mem,t,n,s)};function Al(r,e){return zp(r,e||{},0,0)}var Fl=(function(){function r(e,t){typeof e=="function"&&(t=e,e={}),this.ondata=t;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new Pe(32768),this.p=new Pe(0),n&&this.o.set(n)}return r.prototype.e=function(e){if(this.ondata||$t(5),this.d&&$t(4),!this.p.length)this.p=e;else if(e.length){var t=new Pe(this.p.length+e.length);t.set(this.p),t.set(e,this.p.length),this.p=t}},r.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,n=Up(this.p,this.s,this.o);this.ondata(ss(n,t,this.s.b),this.d),this.o=ss(n,this.s.b-32768),this.s.b=this.o.length,this.p=ss(this.p,this.s.p/8|0),this.s.p&=7},r.prototype.push=function(e,t){this.e(e),this.c(t)},r})();var qp=typeof TextDecoder<"u"&&new TextDecoder,Yp=0;try{qp.decode(Ol,{stream:!0}),Yp=1}catch{}var Qp=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Pt=(r,e)=>r>>>e|r<<32-e;function Yt(r){return Array.from(Wp(new TextEncoder().encode(r)),e=>e.toString(16).padStart(8,"0")).join("")}function Wp(r){let e=r.length*8,t=new Uint8Array(r.length+9+63>>6<<6);t.set(r),t[r.length]=128;let n=new DataView(t.buffer);n.setUint32(t.length-8,Math.floor(e/4294967296)),n.setUint32(t.length-4,e>>>0);let s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64);for(let o=0;o<t.length;o+=64){for(let p=0;p<16;p++)i[p]=n.getUint32(o+p*4);for(let p=16;p<64;p++){let w=Pt(i[p-15],7)^Pt(i[p-15],18)^i[p-15]>>>3,D=Pt(i[p-2],17)^Pt(i[p-2],19)^i[p-2]>>>10;i[p]=i[p-16]+w+i[p-7]+D>>>0}let[B,a,c,l,u,f,d,h]=[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]];for(let p=0;p<64;p++){let w=Pt(u,6)^Pt(u,11)^Pt(u,25),D=u&f^~u&d,m=h+w+D+Qp[p]+i[p]>>>0,b=Pt(B,2)^Pt(B,13)^Pt(B,22),v=B&a^B&c^a&c,R=b+v>>>0;h=d,d=f,f=u,u=l+m>>>0,l=c,c=a,a=B,B=m+R>>>0}s[0]=s[0]+B>>>0,s[1]=s[1]+a>>>0,s[2]=s[2]+c>>>0,s[3]=s[3]+l>>>0,s[4]=s[4]+u>>>0,s[5]=s[5]+f>>>0,s[6]=s[6]+d>>>0,s[7]=s[7]+h>>>0}return s}var xi=/[ \t]/,$l=/[A-Za-z0-9_]/,Vp=/^[ \t]*(function[ \t]+[^\s()]+([ \t]*\([ \t]*\))?|[^\s()=;&|<>]+[ \t]*\([ \t]*\))[ \t]*$/;function Zp(r,e){let t=e,n=r[t]==="-";for(n&&t++;t<r.length&&xi.test(r[t]);)t++;let s="";for(;t<r.length&&!/[\s;&|<>()]/.test(r[t]);){let i=r[t];if(i==="'"||i==='"'){let o=r.indexOf(i,t+1);if(o<0)return;let B=r.slice(t+1,o);s+=i==='"'?B.replace(/\\([\\"$`])/g,"$1"):B,t=o+1}else i==="\\"?(s+=r[t+1]??"",t+=2):(s+=i,t++)}return s===""?void 0:{word:s,strip:n,end:t}}var uB=class{quote="";stack=[];heredocs=[];inHeredoc=!1;cont=!1;open(){return this.quote!==""||this.stack.length>0||this.heredocs.length>0||this.cont}line(e){if(this.inHeredoc){let B=this.heredocs[0];return(B.strip?e.replace(/^\t+/,""):e)===B.word&&this.heredocs.shift(),this.inHeredoc=this.heredocs.length>0,!0}this.cont=!1;let t=this.quote!=="",n=this.quote==="",s="",i=e.length,o=0;for(;o<i;){let B=e[o];if(this.quote==="'"||this.quote==="$'"){B==="\\"&&this.quote==="$'"?o++:B==="'"&&(this.quote=""),o++;continue}if(this.quote==='"'||this.quote==="`"){B==="\\"?(o===i-1&&(this.cont=!0),o++):B===this.quote&&(this.quote=""),o++;continue}if(xi.test(B)){o++;continue}if(B==="#"&&(o===0||/[\s;&|()]/.test(e[o-1])))break;if(t=!0,B==="\\"){o===i-1&&(this.cont=!0),s="",n=!1,o+=2;continue}if(B==="'"||B==='"'||B==="`")this.quote=B;else if(B==="$"&&e[o+1]==="'")this.quote="$'",o++;else if(B==="<"&&e.startsWith("<<",o)&&e[o+2]!=="<"){let a=Zp(e,o+2);if(a){this.heredocs.push({word:a.word,strip:a.strip}),o=a.end,s="x",n=!1;continue}}else if(B==="("||B===")")this.top()!=="case"&&(B==="("?this.stack.push("("):this.top()==="("&&this.stack.pop());else if(B==="{")this.stack.push("{");else if(B==="}")this.top()==="{"&&this.stack.pop();else if(n&&$l.test(B)){let a=o;for(;a<i&&$l.test(e[a]);)a++;let c=e.slice(o,a);if((a===i||/[\s;&|()<>]/.test(e[a]))&&this.keyword(c)){o=a,s=c;continue}o=a,s=c,n=!1;continue}n=B===";"||B==="&"||B==="|"||B==="("||B==="{"||B==="}"||B==="!",s=(s+B).slice(-2),o++}return this.quote===""&&(s.endsWith("|")||s.endsWith("&&"))&&(this.cont=!0),this.quote===""&&Vp.test(e.replace(/[ \t]+#.*$/,""))&&(this.cont=!0),this.inHeredoc=this.heredocs.length>0,t}top(){return this.stack[this.stack.length-1]}keyword(e){switch(e){case"if":case"case":return this.stack.push(e),!0;case"for":case"while":case"until":case"select":return this.stack.push("loop"),!0;case"fi":case"esac":case"done":{let t=e==="fi"?"if":e==="esac"?"case":"loop";return this.top()===t&&this.stack.pop(),!0}case"then":case"do":case"else":case"elif":case"in":case"function":case"time":return!0;default:return!1}}},lB=class{quote="";blockComment=!1;depth=0;cont=!1;open(){return this.quote!==""||this.blockComment||this.depth>0||this.cont}line(e){if(this.cont=!1,this.quote==="@'"||this.quote==='@"')return e.startsWith(this.quote[1]+"@")&&(this.quote=""),!0;let t=this.quote!=="",n="",s=e.length,i=0;for(;i<s;){let o=e[i];if(this.blockComment){e.startsWith("#>",i)?(this.blockComment=!1,i+=2):i++;continue}if(this.quote==="'"){(o==="'"||o==="\u2018"||o==="\u2019")&&(e[i+1]===o?i++:this.quote=""),i++;continue}if(this.quote==='"'){o==="`"?i++:o==='"'&&(e[i+1]==='"'?i++:this.quote=""),i++;continue}if(xi.test(o)){i++;continue}if(e.startsWith("<#",i)){this.blockComment=!0,i+=2;continue}if(o==="#")break;if(t=!0,o==="`"){i===s-1&&(this.cont=!0),n="`",i+=2;continue}if(o==="@"&&(e[i+1]==="'"||e[i+1]==='"')&&e.slice(i+2).trim()==="")return this.quote=e[i+1]==="'"?"@'":'@"',!0;o==="'"||o==='"'||o==="\u2018"||o==="\u2019"?this.quote=o==='"'?'"':"'":o==="("||o==="{"||o==="["?this.depth++:(o===")"||o==="}"||o==="]")&&this.depth>0&&this.depth--,n=(n+o).slice(-4),i++}return this.quote===""&&!this.blockComment&&/(\||,|(?<![=!<>+\-*/%])=|&&|\|\||-and|-or)$/i.test(n)&&(this.cont=!0),t}},cB=class{depth=0;cont=!1;open(){return this.depth>0||this.cont}line(e){if(this.cont=!1,this.depth===0&&/^[ \t]*(@?rem([ \t].*)?$|:)/i.test(e))return!1;let t=!1,n=!1;for(let s=0;s<e.length;s++){let i=e[s];if(xi.test(i)||(n=!0),i==='"')t=!t;else{if(t)continue;i==="^"?(s===e.length-1&&(this.cont=!0),s++):i==="("?this.depth++:i===")"&&this.depth>0&&this.depth--}}return n}};function Xp(r){return r==="pwsh"?new lB:r==="cmd"?new cB:new uB}function eh(r,e){return r==="pwsh"&&/^[ \t]*(\||(else|elseif|catch|finally)\b)/i.test(e)}function Il(r,e){let t=xn(r),n=Xp(e),s=[],i,o=a=>{s.push({start:i,end:a,text:t.slice(i,a+1).map((c,l,u)=>c.text+(l<u.length-1?c.eol:"")).join("")}),i=void 0},B=a=>t.slice(a+1).find(c=>c.text.trim()!=="")?.text;for(let a=0;a<t.length;a++){let c=n.line(t[a].text);if(i===void 0){if(!c)continue;i=a}if(n.open())continue;let l=B(a);l!==void 0&&eh(e,l)||o(a)}if(i!==void 0){let a=t.length-1;for(;a>i&&t[a].text.trim()==="";)a--;o(a)}return s}var dB="md-runbook",Nl="md-runbook-manifest 1",Ml=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,99}$/,th=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,nh=/^\d{4}-\d{2}-\d{2}$/,rh=r=>nh.test(r)&&new Date(`${r}T00:00:00Z`).toISOString().slice(0,10)===r;function Tl(r){return/^(PATH|IFS|ENV|BASH_ENV|CDPATH|GLOBIGNORE|HOME|SHELL|SHELLOPTS|BASHOPTS|PS[1-4]|PROMPT_COMMAND|PWD|OLDPWD|TMPDIR|LANG|LANGUAGE)$/.test(r)||/^(LC_|LD_|DYLD_|BASH_FUNC_|__mdrb_|MD_RUNBOOK_GATE_)/.test(r)}var sh=/\\[dDwWsSbB1-9]|\(\?|[*+?}]\?/,Gl=r=>r.text!==void 0?2:1,ih=/^<!-- md-runbook:record-signature v1 [^\n]*\n(?:[^\n]*\n)*?-->[ \t]*(?:\n|$)/gm,oh=/^[ \t]*<!--[ \t]*md-runbook:note\b.*?-->[ \t]*\n(?:[ \t]*>.*(?:\n|$))*/gm,Bh=/^([ \t]*(?:[-*+]|\d{1,9}[.)])[ \t]+\[)[xX](\](?=[ \t]|$))/;function ah(r){let e=gB(r.replace(/^\uFEFF/,"")).replace(/\r\n?/g,`
|
|
95
|
+
`);e=e.replace(ih,""),e=Kt(e),e=e.replace(oh,"");let t=null;return e=e.split(`
|
|
96
|
+
`).map(n=>{if(t)return Ke(n,t)&&(t=null),n;let s=_e(n);return s?(t=s,n):n.replace(Bh,"$1 $2")}).join(`
|
|
97
|
+
`),e.replace(/\s+$/,"")+`
|
|
98
|
+
`}var Pl=r=>Yt(ah(r)),os="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Ht(r){let e=new TextEncoder().encode(r),t="";for(let n=0;n<e.length;n+=3){let s=e[n],i=e[n+1],o=e[n+2];t+=os[s>>2]+os[(s&3)<<4|(i??0)>>4],t+=i===void 0?"=":os[(i&15)<<2|(o??0)>>6],t+=o===void 0?"=":os[o&63]}return t}function Hl(r){if(r.length%4!==0||!/^[A-Za-z0-9+/]*={0,2}$/.test(r))return;let e=r.endsWith("==")?2:r.endsWith("=")?1:0,t=new Uint8Array(r.length/4*3-e),n=0;for(let i=0;i<r.length;i+=4){let o=[0,1,2,3].map(a=>r[i+a]==="="?0:os.indexOf(r[i+a])),B=o[0]<<18|o[1]<<12|o[2]<<6|o[3];for(let a of[B>>16,B>>8&255,B&255])n<t.length&&(t[n++]=a)}let s=new TextDecoder().decode(t);return Ht(s)===r?s:void 0}function _l(r){let e=[];return he(r).cells.forEach((t,n)=>{t.kind==="code"&&ce(t.meta)&&Ge(t.languageId)&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function fB(r){let e=[];return he(r).cells.forEach((t,n)=>{t.kind!=="code"||!ce(t.meta)||$e(t.languageId)==="bash"&&e.push({index:n,info:t.meta.info.trim(),value:t.value})}),e}function uh(r){let e=[],t=null,n=!1;return r.split(/\r?\n/).forEach((s,i)=>{if(t){Ke(s,t)&&(/^( {4}|\t| {0,3}\t)/.test(s)&&e.push(`line ${i+1}: a closing fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),t=null);return}let o=_e(s);if(o){/^( {4}|\t| {0,3}\t)/.test(o.indent)&&e.push(`line ${i+1}: a fence indented 4 spaces or more (indent fences less, so GitHub shows the same blocks)`),n&&$e(nn(o.info))==="bash"&&e.push(`line ${i+1}: a bash block inside an HTML comment (<!-- \u2026 -->) is hidden on GitHub but would be signed`),t=o;return}for(let B of s.matchAll(/<!--|-->/g))n=B[0]==="<!--"}),e}function pB(r,e,t={}){let n=[];Ml.test(e.name)||n.push(`name "${e.name}": use letters, digits and . _ / - (at most 100)`),(!Number.isInteger(e.version)||e.version<1)&&n.push(`version ${e.version}: expected a positive whole number`),e.expires!==void 0&&!rh(e.expires)&&n.push(`expires ${e.expires}: expected a date, YYYY-MM-DD`);for(let u of e.scopes)th.test(u)||n.push(`scope "${u}": use letters, digits and . _ - (at most 64)`);for(let[u,f]of Object.entries(e.patterns))At.test(u)?Tl(u)&&n.push(`\${param:${u}}: ${u} can't be a parameter of a signed runbook (it changes how the shell runs the code)`):n.push(`pattern for "${u}": not a parameter name`),f===""||/[\r\n]/.test(f)?n.push(`pattern for ${u}: empty or more than one line`):sh.test(f)&&n.push(`pattern for ${u}: ${f} uses JavaScript-only syntax (\\d, \\w, (?\u2026), lazy *?, back-references); servers check it with grep -E: use [0-9], [A-Za-z0-9_], \u2026`);n.push(...uh(gB(r)));let s=ve(r)?.shell?.unix;s&&s!=="bash"&&n.push(`front matter shell: ${s}: servers run signed runbooks in bash; remove it, or write shell: bash`),n.push(...lh(r));let i=new Set;for(let u of fB(r))for(let f of me(u.info).checks?.captures??[])f.secret&&i.add(f.name);let o=[];for(let u of fB(r)){let f=o.length+1,d=`cell ${f} (${u.value.split(`
|
|
99
|
+
`)[0]?.slice(0,40)??""})`,h=me(u.info);for(let D of h.errors)n.push(`${d}: invalid option ${D}`);let p=[];try{for(let D of Xe(u.value)){let m=`\${${D.kind}:${D.name}${D.kind==="input"&&D.secret?":secret":""}}`;D.kind==="secret"?n.push(`${d}: ${m} can't be signed (servers log the values signed cells get)`):D.secret?n.push(`${d}: ${m} can't be signed: a secret input would be in the servers' logs`):D.kind==="out"&&i.has(D.name)?n.push(`${d}: ${m} comes from capture-secret= and can't be signed (servers log the values)`):e.patterns[D.name]===void 0?n.push(`${d}: ${m} needs a pattern (--pattern ${D.name}=REGEX)`):p.includes(D.name)||p.push(D.name)}}catch(D){n.push(`${d}: ${D instanceof Error?D.message:String(D)}`)}for(let D of u.value.matchAll(/\$\{(secret|input|param|out):[^}\s]*/g))/^\$\{((secret|param|out):[A-Za-z_][A-Za-z0-9_]*|input:[A-Za-z_][A-Za-z0-9_]*(:secret)?)$/.test(D[0])||n.push(`${d}: ${D[0]}} is not a plain \${${D[1]}:NAME} and can't be signed`);let w=Tn(h.kubeContext);w!==void 0&&e.patterns[w]===void 0&&n.push(`${d}: kube-context=\${param:${w}} needs a pattern (--pattern ${w}=REGEX)`);for(let[D,m]of Object.entries(h.env))At.test(D)?Tl(D)&&n.push(`${d}: env.${D} can't be set by a signed runbook (it changes how the shell runs the code)`):n.push(`${d}: env.${D} is not a variable name`),/\$\{(secret|input|param|out):/.test(m)&&n.push(`${d}: env.${D} can't use placeholders in a signed runbook`);o.push({n:f,lines:h.lines==="any"?"any":"all",info:u.info,code:hr(u.value,"bash"),needs:p,...h.cwd!==void 0?{cwd:h.cwd}:{},env:h.env,steps:Il(u.value,"bash").map(D=>hr(D.text,"bash"))})}let B=[];for(let u of _l(r)){let f=B.length+1,d=`runbook call ${f} (src=${et(u.info,u.value).src??"?"})`,h=et(u.info,u.value);for(let w of h.problems)n.push(`${d}: ${w.message}`);for(let w of me(u.info).errors)n.push(`${d}: invalid option ${w}`);h.src!==void 0&&/^([A-Za-z]:)?[\\/]/.test(h.src)&&n.push(`${d}: src= must be relative: a signed runbook calls runbooks in its own repository`);let p=[];try{for(let w of Mt(h)){let D=`\${${w.kind}:${w.name}}`;w.kind==="secret"||w.secret?n.push(`${d}: ${D} can't be signed: pass secrets to the runbook called another way`):e.patterns[w.name]===void 0?n.push(`${d}: ${D} needs a pattern (--pattern ${w.name}=REGEX)`):p.includes(w.name)||p.push(w.name)}}catch(w){n.push(`${d}: ${w instanceof Error?w.message:String(w)}`)}B.push({n:f,info:u.info,body:u.value,needs:p})}if(o.length===0&&B.length===0&&n.push("no bash or sh cells to sign"),n.length>0)return{errors:n};let a=new Set([...o.flatMap(u=>u.needs),...B.flatMap(u=>u.needs)]),c=Object.fromEntries(Object.entries(e.patterns).filter(([u])=>a.has(u))),l=t.version===1?{}:{text:Pl(r)};return{manifest:{...e,scopes:[...new Set(e.scopes)],patterns:c,cells:o,calls:B,...l}}}function lh(r){let e=r.replace(/^\uFEFF/,"").split(/\r?\n/);if(e[0]?.trimEnd()!=="---")return[];let t=e.findIndex((o,B)=>B>0&&/^(---|\.\.\.)\s*$/.test(o));if(t<0)return[];let n=[],s=new Set,i=!1;for(let o of e.slice(1,t)){let B=/^(report-runs(?:-required|-signed|-token)?)\s*:\s*(.*?)\s*$/i.exec(o);if(!B)continue;let a=B[1].toLowerCase(),c=B[2].replace(/\s+#.*$/,"").replace(/^(["'])(.*)\1$/,"$2");if(s.has(a)&&n.push(`front matter ${a}: written twice (keep one)`),s.add(a),a==="report-runs"){let l=Nn(c);l&&n.push(`front matter report-runs: ${l}`)}else a==="report-runs-token"?/^\$\{secret:[A-Za-z_][A-Za-z0-9_]*\}$/.test(c)||n.push("front matter report-runs-token: only ${secret:NAME}, never a token in the file"):(/^(true|false|yes|no|on|off)$/i.test(c)||n.push(`front matter ${a}: expected true or false`),/^(true|yes|on)$/i.test(c)&&(i=!0))}return!s.has("report-runs")&&(i||s.has("report-runs-token"))&&n.push("front matter report-runs-required, -signed or -token without report-runs: (the address)"),n}function hB(r){let e=[Nl,`name ${r.name}`,`version ${r.version}`];r.expires&&e.push(`expires ${r.expires}`),r.scopes.length>0&&e.push(`scope ${r.scopes.join(" ")}`),r.text!==void 0&&e.push(`text ${r.text}`);for(let[t,n]of Object.entries(r.patterns))e.push(`param ${t} ${Ht(n)}`);for(let t of r.cells){e.push(`cell ${t.n} ${t.lines}`,`info ${Ht(t.info)}`,`code ${Ht(t.code)}`);for(let n of t.needs)e.push(`needs ${n}`);t.cwd!==void 0&&e.push(`cwd ${Ht(t.cwd)}`);for(let[n,s]of Object.entries(t.env))e.push(`env ${n} ${Ht(s)}`);for(let n of t.steps)e.push(`step ${Ht(n)}`)}for(let t of r.calls){e.push(`call ${t.n}`,`callinfo ${Ht(t.info)}`,`callbody ${Ht(t.body)}`);for(let n of t.needs)e.push(`callneeds ${n}`)}return e.push("end"),e.join(`
|
|
96
100
|
`)+`
|
|
97
|
-
`}function
|
|
98
|
-
`);if(e[0]!==
|
|
99
|
-
`).trimEnd(),
|
|
101
|
+
`}function _n(r){let e=r.split(`
|
|
102
|
+
`);if(e[0]!==Nl)throw new Error("not an md-runbook manifest (or a newer version)");let t={name:"",version:0,scopes:[],patterns:{},cells:[],calls:[]},n,s,i=c=>{if(!s)throw new Error(`manifest: ${c} outside a call`);return s},o=(c,l)=>{let u=c===void 0?void 0:Hl(c);if(u===void 0)throw new Error(`manifest: bad ${l}`);return u},B=c=>{if(!n)throw new Error(`manifest: ${c} outside a cell`);return n},a=!1;for(let c of e.slice(1)){if(a){if(c!=="")throw new Error("manifest: text after end");continue}if(c==="")continue;let[l,u,f,...d]=c.split(" ");if(d.length>0&&l!=="scope")throw new Error(`manifest: bad line "${c.slice(0,40)}"`);switch(l){case"name":t.name=u??"";break;case"version":t.version=Number(u);break;case"expires":t.expires=u;break;case"scope":t.scopes=c.split(" ").slice(1);break;case"text":if(!u||!/^[0-9a-f]{64}$/.test(u)||f!==void 0||t.text!==void 0)throw new Error("manifest: bad text");t.text=u;break;case"param":t.patterns[u??""]=o(f,"pattern");break;case"cell":n={n:Number(u),lines:f==="any"?"any":"all",info:"",code:"",needs:[],env:{},steps:[]},t.cells.push(n);break;case"info":B("info").info=o(u,"info");break;case"code":B("code").code=o(u,"code");break;case"needs":B("needs").needs.push(u??"");break;case"cwd":B("cwd").cwd=o(u,"cwd");break;case"env":B("env").env[u??""]=o(f,"env");break;case"step":B("step").steps.push(o(u,"step"));break;case"call":s={n:Number(u),info:"",body:"",needs:[]},t.calls.push(s);break;case"callinfo":i("callinfo").info=o(u,"callinfo");break;case"callbody":i("callbody").body=o(u,"callbody");break;case"callneeds":i("callneeds").needs.push(u??"");break;case"end":a=!0;break;default:throw new Error(`manifest: unknown item "${l}"`)}}if(!a)throw new Error("manifest: no end");if(!Ml.test(t.name)||!Number.isInteger(t.version)||t.version<1)throw new Error("manifest: bad name or version");return t}var ch=/^<!-- md-runbook:signature v1 signer=(\S+) signed=(\d{4}-\d{2}-\d{2})\r?\nmanifest\r?\n([A-Za-z0-9+/=\r\n]+?)\r?\nsignature\r?\n([A-Za-z0-9+/=\r\n]+?)((?:\r?\ncosign signer=\S+ signed=\d{4}-\d{2}-\d{2}\r?\n[A-Za-z0-9+/=\r\n]+?)*)\r?\n-->[ \t]*$/m,fh=/cosign signer=(\S+) signed=(\d{4}-\d{2}-\d{2})\r?\n([A-Za-z0-9+/=\r\n]+?)(?=\r?\ncosign |$)/g,vi=r=>r.replace(/.{1,76}/g,`$&
|
|
103
|
+
`).trimEnd(),un=r=>r.replace(/[^A-Za-z0-9_@.+-]+/g,"_").replace(/-{2,}/g,"-").replace(/^-+/,"").slice(0,100)||"unknown",Ll=/^[A-Za-z0-9_@.+](?:[A-Za-z0-9_@.+]|-(?!-)){0,99}$/;function dh(r){return`<!-- md-runbook:signature v1 signer=${un(r.signer)} signed=${r.signed}
|
|
100
104
|
manifest
|
|
101
|
-
${
|
|
105
|
+
${vi(Ht(r.manifest))}
|
|
102
106
|
signature
|
|
103
|
-
${
|
|
104
|
-
`+(r.cosigners??[]).map(e=>`cosign signer=${
|
|
105
|
-
${
|
|
106
|
-
`).join("")+"-->"}function
|
|
107
|
-
`)){let o
|
|
107
|
+
${vi(r.signature)}
|
|
108
|
+
`+(r.cosigners??[]).map(e=>`cosign signer=${un(e.signer)} signed=${e.signed}
|
|
109
|
+
${vi(e.signature)}
|
|
110
|
+
`).join("")+"-->"}function Jl(r){let e=new Set,t=null,n=0;for(let o of r.split(`
|
|
111
|
+
`)){let B=o.replace(/\r$/,"");t?(e.add(n),Ke(B,t)&&(t=null)):t=_e(B),n+=o.length+1}let s=new RegExp(ch.source,"gm"),i;for(let o=s.exec(r);o;o=s.exec(r))e.has(o.index)||(i=o);return i}function _t(r){let e=Jl(r);if(!e||!Ll.test(e[1]))return;let t=Hl(e[3].replace(/\s+/g,""));if(t===void 0)return;let n=[...(e[5]??"").trim().matchAll(fh)].map(s=>({signer:s[1],signed:s[2],signature:s[3].replace(/\s+/g,"")}));if(!n.some(s=>!Ll.test(s.signer)))return{signer:e[1],signed:e[2],manifest:t,signature:e[4].replace(/\s+/g,""),...n.length?{cosigners:n}:{}}}function Ul(r,e){let t;try{t=_n(e.manifest)}catch{return!1}let n=pB(r,{name:t.name,version:t.version,...t.expires?{expires:t.expires}:{},scopes:t.scopes,patterns:t.patterns},{version:Gl(t)});return!("errors"in n)&&hB(n.manifest)===e.manifest}function br(r){return[r.signature,...(r.cosigners??[]).map(e=>e.signature)]}function CB(r){return[r.signer,...(r.cosigners??[]).map(e=>e.signer)]}function gB(r){let e=Jl(r);return e?r.slice(0,e.index).replace(/(\r?\n)[ \t]*(\r?\n)+$/,"$1")+r.slice(e.index+e[0].length).replace(/^\r?\n/,""):r}function mB(r,e){let t=gB(r),n=/\r\n/.test(t)?`\r
|
|
108
112
|
`:`
|
|
109
|
-
`,s=
|
|
110
|
-
${
|
|
113
|
+
`,s=dh(e).replace(/\n/g,n),i=t.replace(/(\r?\n)*$/,"");return(i===""?"":i+n+n)+s+n}function Si(r){return`-----BEGIN SSH SIGNATURE-----
|
|
114
|
+
${vi(r)}
|
|
111
115
|
-----END SSH SIGNATURE-----
|
|
112
|
-
`}function
|
|
113
|
-
`).trimEnd();function
|
|
116
|
+
`}function jl(r){let e=/-----BEGIN SSH SIGNATURE-----([\s\S]*?)-----END SSH SIGNATURE-----/.exec(r);if(!e)throw new Error("not an SSH signature");return e[1].replace(/\s+/g,"")}function ot(r){let e=_t(r);if(!e)return;let t;try{t=_n(e.manifest)}catch{return}let n=[...t.cells],s=new Map,i=[],o=[],B=0;for(let d of fB(r)){let h=hr(d.value,"bash"),p;try{p=Xe(d.value).map(b=>b.name)}catch{p=void 0}let w=b=>!!p&&p.length===b.needs.length&&p.every(v=>b.needs.includes(v)),D=n.findIndex(b=>b.info===d.info&&b.code===h&&w(b));if(D<0){i.push(d.index);continue}let m=n.splice(D,1)[0];s.set(d.index,{n:m.n,lines:m.lines,steps:m.steps,needs:m.needs}),m.n<B&&o.push(d.index),B=Math.max(B,m.n)}let a=[...t.calls],c=new Map;for(let d of _l(r)){let h=a.findIndex(p=>p.info===d.info&&p.body===d.value);h<0?i.push(d.index):c.set(d.index,a.splice(h,1)[0])}let l=Gl(t),u=l===2&&Pl(r)!==t.text,f=[];return he(r).cells.forEach((d,h)=>{if(d.kind!=="code"||!ce(d.meta)||Ge(d.languageId))return;let p=$e(d.languageId);p&&p!=="bash"&&f.push(h)}),{block:e,manifest:t,cells:s,changed:i.sort((d,h)=>d-h),missing:n.map(d=>d.n),moved:o,calls:c,missingCalls:a.map(d=>d.n),version:l,textChanged:u,unsigned:l===2&&!u?[]:f}}var Ri="mdrunbook://open",ph=256*1024,hh=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,Ch=/^[0-9a-f]{64}$/;function yi(r){let e;try{e=new URL(r.trim())}catch{return{ok:!1,problem:"not-a-link"}}let t=e.searchParams;if(!(e.protocol==="mdrunbook:"||e.protocol==="https:"&&/\/open\/?$/.test(e.pathname)&&(t.has("url")||t.has("rb"))))return e.protocol==="https:"?{ok:!0,link:{url:e.toString(),params:{}}}:{ok:!1,problem:"not-a-link"};let s={params:{}},i=t.get("url"),o=t.get("rb");if(i!==null&&o!==null)return{ok:!1,problem:"both"};if(i!==null){try{if(new URL(i).protocol!=="https:")return{ok:!1,problem:"not-https"}}catch{return{ok:!1,problem:"not-https"}}s.url=i}else if(o!==null){let c=mh(o);if(typeof c!="string")return{ok:!1,problem:c.problem};s.text=c}else return{ok:!1,problem:"no-runbook"};let B=t.get("sha256");if(B!==null){if(!Ch.test(B.toLowerCase()))return{ok:!1,problem:"bad-sha256"};s.sha256=B.toLowerCase()}let a=t.get("host");if(a!==null){if(!hh.test(a))return{ok:!1,problem:"bad-host"};s.host=a}for(let[c,l]of t){if(!c.startsWith("p."))continue;let u=c.slice(2);if(!At.test(u)||/[\r\n]/.test(l))return{ok:!1,problem:"bad-param"};s.params[u]=l}return t.get("action")==="cosign"&&(s.action="cosign"),{ok:!0,link:s}}function as(r,e=Ri){let t=[],n=(s,i)=>t.push(`${encodeURIComponent(s)}=${encodeURIComponent(i)}`);r.url!==void 0?n("url",r.url):r.text!==void 0&&n("rb",Yl(r.text)),r.sha256&&n("sha256",r.sha256),r.host&&n("host",r.host);for(let[s,i]of Object.entries(r.params))n(`p.${s}`,i);return r.action&&n("action",r.action),`${e}?${t.join("&")}`}var Kl="vscode://smojon.md-runbook/open",gh=/[&=#+%]/;function zl(r){return[r.url,r.text!==void 0?Yl(r.text):void 0,r.sha256,r.host,...Object.entries(r.params).flat()].some(t=>t!==void 0&&gh.test(t))?`${Kl}?link=${encodeURIComponent(as(r))}`:as(r,Kl)}function ql(r){if(r.startsWith("link="))return yi(r.slice(5));let e=r.split("&").map(t=>{let n=t.indexOf("=");return n<0?encodeURIComponent(t):`${encodeURIComponent(t.slice(0,n))}=${encodeURIComponent(t.slice(n+1))}`});return yi(`${Ri}?${e.join("&")}`)}function us(r){return Yt(r.replace(/^/,""))}function Yl(r){return Eh(Al(new TextEncoder().encode(r),{level:9}))}function mh(r){let e;try{e=bh(r)}catch{return{problem:"bad-text"}}let t=[],n=0,s=!1,i=new Fl(a=>{n+=a.length,n>ph?s=!0:t.push(a)});try{for(let a=0;a<e.length&&!s;a+=4096)i.push(e.subarray(a,a+4096),a+4096>=e.length)}catch{return{problem:"bad-text"}}if(s)return{problem:"too-large"};let o=new Uint8Array(n),B=0;for(let a of t)o.set(a,B),B+=a.length;try{return new TextDecoder().decode(o)}catch{return{problem:"bad-text"}}}var Bs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Eh(r){let e="";for(let t=0;t<r.length;t+=3){let n=r[t]<<16|(r[t+1]??0)<<8|(r[t+2]??0);e+=Bs[n>>18&63]+Bs[n>>12&63],t+1<r.length&&(e+=Bs[n>>6&63]),t+2<r.length&&(e+=Bs[n&63])}return e}function bh(r){let e=r.replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_");if(/[^A-Za-z0-9_-]/.test(e)||e.length%4===1)throw new Error("not base64url");let t=new Uint8Array(Math.floor(e.length*3/4)),n=0,s=0,i=0;for(let o of e)s=s<<6|Bs.indexOf(o),n+=6,n>=8&&(n-=8,t[i++]=s>>n&255);return t}var Ql="[A-Za-z0-9+/=\\r\\n]+?",Vl=new RegExp(`^<!-- md-runbook:record-signature v1 signer=(\\S+) signed=(\\S+) sha256=([0-9a-f]{64})\\r?\\nsignature\\r?\\n(${Ql})((?:\\r?\\ncosign signer=\\S+ signed=\\S+\\r?\\n${Ql})*)\\r?\\n-->[ \\t]*$`,"m"),Dh=/cosign signer=(\S+) signed=(\S+)\r?\n([A-Za-z0-9+/=\r\n]+?)(?=\r?\ncosign |$)/g,Wl=r=>r.replace(/.{1,76}/g,`$&
|
|
117
|
+
`).trimEnd();function EB(r){return`md-runbook run record v1
|
|
114
118
|
sha256 ${r}
|
|
115
|
-
`}function
|
|
119
|
+
`}function wh(r){let e=Vl.exec(r);if(!e)return;let t=[...(e[5]??"").trim().matchAll(Dh)].map(n=>({signer:n[1],signed:n[2],signature:n[3].replace(/\s+/g,"")}));return{signer:e[1],signed:e[2],sha256:e[3],signature:e[4].replace(/\s+/g,""),...t.length?{cosigners:t}:{}}}function Zl(r){let e=Vl.exec(r);return e?r.slice(0,e.index).replace(/(\r?\n)[ \t]*(\r?\n)+$/,"$1")+r.slice(e.index+e[0].length).replace(/^\r?\n/,""):r}function Oi(r){return us(Zl(r))}function kh(r){return`<!-- md-runbook:record-signature v1 signer=${un(r.signer)} signed=${r.signed} sha256=${r.sha256}
|
|
116
120
|
signature
|
|
117
|
-
${
|
|
118
|
-
`+(r.cosigners??[]).map(e=>`cosign signer=${
|
|
119
|
-
${
|
|
120
|
-
`).join("")+"-->"}function
|
|
121
|
+
${Wl(r.signature)}
|
|
122
|
+
`+(r.cosigners??[]).map(e=>`cosign signer=${un(e.signer)} signed=${e.signed}
|
|
123
|
+
${Wl(e.signature)}
|
|
124
|
+
`).join("")+"-->"}function Xl(r,e){let t=Zl(r),n=/\r\n/.test(t)?`\r
|
|
121
125
|
`:`
|
|
122
|
-
`;return`${t.replace(/(\r?\n)*$/,"")}${n}${n}${
|
|
123
|
-
`)){let n=/^ {0,3}(`{3,}|~{3,})/.exec(t)?.[1];if(e!==void 0){n&&n[0]===e[0]&&n.length>=e.length&&t.trim()===n&&(e=void 0);continue}if(n){e=n;continue}let s=/^ {0,3}#{1,6}[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/.exec(t);if(s?.[1])return s[1].replace(/[*_`]/g,"")}}function
|
|
126
|
+
`;return`${t.replace(/(\r?\n)*$/,"")}${n}${n}${kh(e).replace(/\n/g,n)}${n}`}function ls(r){let e=wh(r);return e?{block:e,unchanged:Oi(r)===e.sha256}:void 0}var Dr=r=>[r.signer,...(r.cosigners??[]).map(e=>e.signer)];function ec(r,e){return{...r,cosigners:[...(r.cosigners??[]).filter(t=>t.signer!==un(e.signer)),e]}}function bB(r,e,t){return r===void 0?"none":t==="failed"?"fail":t==="ok"||r==="0"||r==="done"?e===void 0?"ok":"none":r==="running"||r==="declined"||r==="proposed"?"none":r==="skipped"?"skip":"fail"}function xh(r,e,t){if(e!==void 0&&bB(r,e,t)==="none")return`<span class="badge none">${re(`\u2013 lines ${e} ran`)}</span>`;if(t==="failed")return`<span class="badge fail">${re("\u2717 check failed")}</span>`;if(t==="ok")return`<span class="badge ok">${re(`\u2713 ${/^-?\d+$/.test(r??"")?`exit ${r}`:r??""}`)}</span>`;let n=bB(r),s=r!==void 0&&!/^-?\d+$/.test(r),i=n==="none"?s?`\u2013 ${r}`:"not run":n==="ok"?s?`\u2713 ${r}`:"\u2713 exit 0":n==="skip"?"\u2013 skipped":`\u2717 ${/^-?\d+$/.test(r)?`exit ${r}`:r}`;return`<span class="badge ${n}">${re(i)}</span>`}function vh(r){let e;for(let t of r.split(`
|
|
127
|
+
`)){let n=/^ {0,3}(`{3,}|~{3,})/.exec(t)?.[1];if(e!==void 0){n&&n[0]===e[0]&&n.length>=e.length&&t.trim()===n&&(e=void 0);continue}if(n){e=n;continue}let s=/^ {0,3}#{1,6}[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/.exec(t);if(s?.[1])return s[1].replace(/[*_`]/g,"")}}function Sh(r){let e=r.split(`
|
|
124
128
|
`);if(e[0]?.replace(/^\uFEFF/,"").trimEnd()!=="---")return;let t=e.findIndex((n,s)=>s>0&&/^(---|\.\.\.)[ \t]*$/.test(n));if(!(t<0))return{yaml:e.slice(1,t).join(`
|
|
125
129
|
`),rest:e.slice(t+1).join(`
|
|
126
|
-
`)}}function
|
|
127
|
-
`,te
|
|
128
|
-
`).find(
|
|
129
|
-
`,
|
|
130
|
-
<div class="step-head">Step ${
|
|
131
|
-
`,
|
|
132
|
-
`}let
|
|
133
|
-
`;else{let
|
|
134
|
-
`;let
|
|
135
|
-
`}}
|
|
136
|
-
`}return{rows:c,body:
|
|
130
|
+
`)}}function yh(r,e){let t=[];for(let n of[...r.split("/"),...e.split(/[\\/]+/)])n===""||n==="."||(n===".."&&t.length>0&&t[t.length-1]!==".."?t.pop():t.push(n));return t.join("/")}function tc(r,e,t,n,s,i,o=""){let B=he(r),a,c="",l="",u=0,f=0,d=m=>{let b=B.cells[m].meta;return ce(b)?me(b.info).os:void 0},h=Gn(B.cells.map((m,b)=>ce(m.meta)?{kind:"code",os:d(b)}:{kind:"markup"})),p=new Map;h.forEach((m,b)=>{if(!m)return;let v=p.get(m.group);(v===void 0||!B.cells[v].output&&B.cells[b].output)&&p.set(m.group,b)});let w=sn(B.cells.map((m,b)=>ce(m.meta)?{kind:"code",os:d(b)}:{kind:"markup"})),D=new Map;w.forEach((m,b)=>m!==void 0&&D.set(b,m)),u=Math.max(0,...w.filter(m=>m!==void 0));for(let[m,b]of B.cells.entries()){if(!ce(b.meta)){let se=b.value;if(m===0){let te=Sh(se);te&&(l+=`<div class="front-matter">${Zs(n(te.yaml),"front matter")}</div>
|
|
131
|
+
`,se=te.rest)}a??=vh(se),l+=vo(se,n);continue}let v=h[m],R=v!==void 0&&p.get(v.group)!==m,S=D.get(m),I=b.output?.attrs??{},x=R?"skip":bB(I.exit,I.lines,I.check);R||s[x]++;let E=R?`<span class="badge skip">${re(`\u2013 for ${Cr(d(m)??[])}`)}</span>`:xh(I.exit,I.lines,I.check),y=`${e}${S}`,O=R?`step-${y.replace(/\./g,"-")}-${m}`:`step-${y.replace(/\./g,"-")}`,P=b.meta.lang,X=n(b.value),q=X.split(`
|
|
132
|
+
`).find(se=>se.trim()!=="")?.trim()??"",W=me(b.meta.info).estimateSeconds,ee=W!==void 0?`est. ${it(W)}`:void 0;if(c+=`<tr class="${x}${e?" nested":""}"><td><a href="#${O}">${y}</a></td><td><code>${re(q)}</code></td><td>${re(P)}</td><td>${E}</td><td>${re(I.ran??"")}</td><td>${re([I.duration,ee].filter(Boolean).join(" \xB7 "))}</td></tr>
|
|
133
|
+
`,l+=`<section class="step ${x}" id="${O}">
|
|
134
|
+
<div class="step-head">Step ${y}${R?" (alternative)":""}</div>
|
|
135
|
+
`,l+=Zs(X,P),b.output){let se=[I.ran&&`ran ${I.ran}`,I.duration,ee].filter(Boolean).map(te=>re(te));l+=`<div class="output"><div class="output-head">${E} ${se.join(" \xB7 ")}</div><pre>${re(n(Rt(b.output.text)))}</pre></div>
|
|
136
|
+
`}let Y=Ge(b.meta.lang)?pi(I):void 0;if(Y&&t.readCall&&i<mr){let se=yh(o,Y.copy),te=t.readCall(se);if(te===void 0)l+=`<p class="call-note">${re(`The copy ${se} is not there: its steps can't be shown.`)}</p>
|
|
137
|
+
`;else{let Se=Y.sha256===void 0||Yt(te)===Y.sha256;l+=`<div class="call"><p class="call-note">Ran <code>${re(Y.runbook)}</code> as <a href="${re(encodeURI(se))}"><code>${re(se)}</code></a>`+(Se?"":` \xB7 <span class="badge fail">${re("\u2717 the copy changed after the run (its SHA-256 differs)")}</span>`)+`</p>
|
|
138
|
+
`;let ge=tc(te,`${y}.`,t,n,s,i+1,se.includes("/")?se.slice(0,se.lastIndexOf("/")):"");c+=ge.rows,f+=ge.total,l+=ge.body+`</div>
|
|
139
|
+
`}}l+=`</section>
|
|
140
|
+
`}return{rows:c,body:l,...a!==void 0?{title:a}:{},step:u,total:u+f}}function DB(r,e){let t=u=>e.redact?e.redact(u):u,n={ok:0,fail:0,skip:0,none:0},{rows:s,body:i,title:o,total:B}=tc(r,"",e,t,n,0),a=o??e.fallbackTitle??"Runbook report",c=[`${B} step${B===1?"":"s"}`,`${n.ok} passed`,`${n.fail} failed`];n.skip&&c.push(`${n.skip} skipped`),n.none&&c.push(`${n.none} not run`);let l=Rh(Di(r),ls(r),t);return`<!DOCTYPE html>
|
|
137
141
|
<html lang="en">
|
|
138
142
|
<head>
|
|
139
143
|
<meta charset="utf-8">
|
|
140
144
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'">
|
|
141
145
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
142
146
|
<meta name="generator" content="md-runbook">
|
|
143
|
-
<title>${
|
|
144
|
-
<style>${
|
|
147
|
+
<title>${re(a)}</title>
|
|
148
|
+
<style>${wB}${l.pageCss}</style>
|
|
145
149
|
</head>
|
|
146
150
|
<body>
|
|
147
151
|
<header>
|
|
148
|
-
<h1 class="title">${
|
|
149
|
-
<p class="meta">Generated ${
|
|
152
|
+
<h1 class="title">${rn(a)}</h1>
|
|
153
|
+
<p class="meta">Generated ${re(Ie(e.generatedAt))} \xB7 ${c.join(" \xB7 ")}</p>
|
|
150
154
|
</header>
|
|
151
|
-
${
|
|
155
|
+
${l.html}<table class="summary">
|
|
152
156
|
<thead><tr><th>#</th><th>Command</th><th>Shell</th><th>Exit</th><th>Ran</th><th>Duration</th></tr></thead>
|
|
153
157
|
<tbody>
|
|
154
158
|
${s}</tbody>
|
|
@@ -157,7 +161,7 @@ ${s}</tbody>
|
|
|
157
161
|
${i}</main>
|
|
158
162
|
</body>
|
|
159
163
|
</html>
|
|
160
|
-
`}var
|
|
164
|
+
`}var wB=`
|
|
161
165
|
:root{--bg:#fff;--fg:#1f2328;--muted:#656d76;--border:#d0d7de;--code:#f6f8fa;--ok:#1a7f37;--fail:#cf222e;--skip:#9a6700;--link:#0969da}
|
|
162
166
|
@media (prefers-color-scheme:dark){:root{--bg:#0d1117;--fg:#e6edf3;--muted:#8d96a0;--border:#30363d;--code:#161b22;--ok:#3fb950;--fail:#f85149;--skip:#d29922;--link:#4493f8}}
|
|
163
167
|
*{box-sizing:border-box}
|
|
@@ -196,92 +200,96 @@ blockquote{margin:0;padding:0 1em;color:var(--muted);border-left:.25em solid var
|
|
|
196
200
|
.badge.milestone{color:var(--link)}
|
|
197
201
|
.earlier{font-size:12px;color:var(--muted)}
|
|
198
202
|
@media print{.facts div,.timeline tr{break-inside:avoid}.timeline tr.note td{background:none}}
|
|
199
|
-
`,
|
|
200
|
-
`}).join(""),
|
|
203
|
+
`,cs=r=>r.replace("T"," ").replace(/([+-]\d\d:\d\d|Z)$/," $1");function Rh(r,e,t){let n=r.summary;if(r.events.length===0&&!n.incident&&!e)return{html:"",pageCss:""};let s=[];n.incident&&s.push([n.drill?"Drill":"Incident",[n.incident,n.severity].filter(Boolean).join(" \xB7 ")]),n.start&&s.push(["Start",cs(n.start)]),n.end&&s.push(["End",cs(n.end)]),n.durationSeconds!==void 0&&s.push(["Duration",ts(n.durationSeconds)]);for(let u of Vo)n.milestones[u]&&s.push([u[0].toUpperCase()+u.slice(1),cs(n.milestones[u])]);if(n.timeToMitigateSeconds!==void 0&&s.push(["Time to mitigate",ts(n.timeToMitigateSeconds)]),n.timeToResolveSeconds!==void 0&&s.push(["Time to resolve",ts(n.timeToResolveSeconds)]),n.rtoSeconds!==void 0&&s.push(["RTO",`${ts(n.rtoSeconds)}${n.rtoMet===void 0?"":n.rtoMet?" \xB7 met":" \xB7 missed"}`]),s.push(["Runs",`${n.runs}${n.failedAttempts?` \xB7 ${n.failedAttempts} failed`:""}`]),n.endpointChecks&&s.push(["Endpoint checks",`${n.endpointChecks.total}${n.endpointChecks.failed?` \xB7 ${n.endpointChecks.failed} failed`:" \xB7 all up"}`]),n.people.length&&s.push(["People",n.people.join(", ")]),n.places.length&&s.push(["Ran on",n.places.join(", ")]),e){let u=Dr(e.block).join(", ");s.push(["Record signed",e.unchanged?`by ${u} \xB7 unchanged since`:`by ${u} \xB7 CHANGED since signing`])}let i=s.map(([u,f])=>`<div${u==="Record signed"&&e&&!e.unchanged?' class="changed"':""}><dt>${re(u)}</dt><dd>${re(t(f))}</dd></div>`).join(""),o=r.events.map(u=>{let f=u.kind==="note"?`${u.milestone?`<span class="badge milestone">${re(u.milestone)}</span> `:""}${re(t(u.text??"")).replace(/\n/g,"<br>")}`:`<a href="#step-${u.step}">${u.step}</a> <code>${re(t(u.label??""))}</code>${u.earlier?' <span class="earlier">earlier attempt</span>':""}`,d=u.kind==="note"?"":`<span class="badge ${u.ok?u.exit==="skipped"?"skip":"ok":"fail"}">${re(u.check==="failed"?"check failed":u.exit==="0"?"exit 0":/^-?\d+$/.test(u.exit??"")?`exit ${u.exit}`:u.exit??"")}</span>`;return`<tr class="${u.kind}"><td>${re(cs(u.at))}</td><td>${f}</td><td>${re(t(u.by??""))}</td><td>${re(t(u.on??""))}</td><td>${d}</td><td>${re(u.duration??"")}</td></tr>
|
|
204
|
+
`}).join(""),B=r.events.flatMap(u=>(u.checks??[]).map(f=>({e:u,c:f}))).map(({e:u,c:f})=>`<tr><td>${re(cs(u.at))}</td><td><a href="#step-${u.step}">${u.step}</a>${u.earlier?' <span class="earlier">earlier attempt</span>':""}</td><td><code>${re(t(f.target))}</code></td><td><span class="badge ${f.ok?"ok":"fail"}">${f.ok?"up":"failed"}</span></td><td>${f.expires?re(`${f.expires} (${f.daysLeft!==void 0&&f.daysLeft<0?`expired ${-f.daysLeft} days ago`:`${f.daysLeft} days`})`):""}</td><td>${re(t(f.detail))}</td></tr>
|
|
201
205
|
`).join(""),a=`<section class="record">
|
|
202
206
|
<h2>${n.drill?"Drill record":n.incident?"Incident record":"Run record"}</h2>
|
|
203
207
|
<dl class="facts">${i}</dl>
|
|
204
|
-
`+(
|
|
208
|
+
`+(o?`<table class="timeline">
|
|
205
209
|
<thead><tr><th>Time</th><th>What</th><th>By</th><th>On</th><th>Result</th><th>Duration</th></tr></thead>
|
|
206
210
|
<tbody>
|
|
207
|
-
${
|
|
211
|
+
${o}</tbody>
|
|
208
212
|
</table>
|
|
209
|
-
`:"")+(
|
|
213
|
+
`:"")+(B?`<h3>Endpoint checks</h3>
|
|
210
214
|
<table class="timeline">
|
|
211
215
|
<thead><tr><th>Time</th><th>Step</th><th>Endpoint</th><th>Result</th><th>Certificate expires</th><th>Detail</th></tr></thead>
|
|
212
216
|
<tbody>
|
|
213
|
-
${
|
|
217
|
+
${B}</tbody>
|
|
214
218
|
</table>
|
|
215
219
|
`:"")+`</section>
|
|
216
|
-
`,c=n.incident?`${n.incident}${n.severity?` \xB7 ${n.severity}`:""}`:"",u=`@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}${c?`@top-right{content:${JSON.stringify(c)};font:10px sans-serif;color:#656d76}`:""}}`;return{html:a,pageCss:u}}var XB=new Set(["timeout","estimate","cwd","continue-on-error","skip","confirm","no-confirm","terminal","name","expect","expect-not","expect-exit","capture","capture-secret","os","host","kube-context","lines","retry","every","proposed","by","reason","approved","approved-by","approved-at"]),mu=/^\s*[^\s{]*/;function gu(r,e){let t=Array.from({length:r.length+1},(n,s)=>Array.from({length:e.length+1},(i,B)=>s===0?B:B===0?s:0));for(let n=1;n<=r.length;n++)for(let s=1;s<=e.length;s++){let i=r[n-1]===e[s-1]?0:1,B=Math.min(t[n-1][s]+1,t[n][s-1]+1,t[n-1][s-1]+i);n>1&&s>1&&r[n-1]===e[s-2]&&r[n-2]===e[s-1]&&(B=Math.min(B,t[n-2][s-2]+1)),t[n][s]=B}return t[r.length][e.length]}function Eu(r){let e=r.toLowerCase(),t=e.length<=4?1:2,n,s=1/0,i=!1;for(let B of XB){let o=B.endsWith("y")?`${B.slice(0,-1)}ies`:`${B}s`,a=Math.min(gu(e,B),gu(e,o));a<s?(n=B,s=a,i=!1):a===s&&(i=!0)}return n!==void 0&&s<=t&&!i?n:void 0}var fh=/^(PATH|BASH_ENV|ENV|IFS|PROMPT_COMMAND|PS4|SHELLOPTS|BASHOPTS|CDPATH|LD_\w+|DYLD_\w+|NODE_OPTIONS|PYTHONPATH|PYTHONSTARTUP|PERL5OPT|PERL5LIB|RUBYOPT|GIT_SSH_COMMAND|GIT_EXEC_PATH)$/i;function Ch(r,e,t){let n=[],s=r.findIndex((B,o)=>o>0&&o<e&&/^env\s*:/i.test(B));if(s<0)return n;if(!/^env\s*:\s*(#.*)?$/i.test(r[s]))return n.push({severity:"warning",line:s,message:"front matter env: is ignored: write each variable on its own indented line below it ( NAME: value)"}),n;let i=new Set;for(let B=s+1;B<e;B++){let o=r[B];if(o.trim()===""||o.trim().startsWith("#"))continue;if(!/^\s/.test(o))break;let a=pB.exec(o);if(!a){n.push({severity:"warning",line:B,message:`front matter env: "${o.trim()}" is ignored (expected NAME: value, the name letters, digits and _)`});continue}let c=a[1];if(i.has(c)){n.push({severity:"warning",line:B,message:`front matter env: ${c} is set twice: the first one counts`});continue}i.add(c),fh.test(c)&&n.push({severity:"warning",line:B,message:`front matter env: ${c} changes what every cell runs, and the front matter isn't signed: set it on the cells that need it (env.${c}=)`})}return t&&i.size>0&&n.push({severity:"warning",line:s,message:"front matter env: is used in VS Code and the command line only: the md-runbook app doesn't use it for a signed runbook's cells (the front matter isn't signed); put what a host needs on the cells (env.NAME=)"}),n}function Du(r,e={}){let t=[],n=de(r),s=it(n),i=He(r);if(i){let l=r.replace(/^/,"").split(/\r?\n/),f=l.findIndex((d,h)=>h>0&&/^(---|\.\.\.)\s*$/.test(d));for(let d=1;d<f;d++){let h=/^(mode|timeout|cwd|kube-context|kube-context-mode|git-bash-path-conversion)\s*:\s*(.*?)\s*(#.*)?$/i.exec(l[d]);if(!h)continue;let x=h[1].toLowerCase();if(x==="mode"&&i.mode===void 0||x==="timeout"&&i.timeoutSeconds===void 0||x==="cwd"&&i.cwd===void 0||x==="kube-context"&&i.kubeContext===void 0||x==="kube-context-mode"&&i.kubeContextMode===void 0||x==="git-bash-path-conversion"&&i.gitBashPathConversion===void 0){let E={mode:"session or isolated",timeout:"seconds, e.g. 300",cwd:"a folder","kube-context":"a Kubernetes context name, e.g. prod-eu, or ${param:NAME}","kube-context-mode":"check or pin","git-bash-path-conversion":"on or off"};t.push({severity:"warning",line:d,message:`front matter ${x}: "${h[2]}" is ignored (expected ${E[x]})`})}}let C={};for(let d=1;d<f;d++){let h=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(l[d]);if(!h)continue;if(h[1]===""){t.push({severity:"warning",line:d,message:"front matter shell: is empty: write the names on the same line (shell: zsh, pwsh), not as a list below it"});continue}let{shells:x,unknown:S,twice:E}=br(h[1]);for(let b of["unix","powershell"]){let D=x[b];D&&(C[b]?E.push(D):C[b]=D)}for(let b of S){let D=/[\\/]/.test(b)?`front matter shell: "${b}" is ignored: name a shell (${[...Er,...Dr].join(", ")}), never a path`:`front matter shell: "${b}" is ignored (expected ${Er.join(", ")} for sh/bash cells, ${Dr.join(" or ")} for PowerShell cells)`;t.push({severity:"warning",line:d,message:D})}for(let b of E)t.push({severity:"warning",line:d,message:`front matter shell: "${b}" is ignored: one shell per kind of cell, the first one counts`})}t.push(...Ch(l,f,Ot(r)!==void 0))}let B=i?.kubeContextMode==="pin",o=()=>Math.max(0,r.replace(/^/,"").split(/\r?\n/).findIndex(l=>/^kube-context-mode\s*:/i.test(l)));B&&!i?.kubeContext&&!s.some(l=>Ee(l.info).kubeContext!==void 0)&&t.push({severity:"warning",line:o(),message:"front matter kube-context-mode: pin has no effect: no kube-context: in the front matter and no kube-context= on a block"}),B&&i?.practice&&t.push({severity:"warning",line:o(),message:`front matter kube-context-mode: pin doesn't apply on the practice host ${i.practice}: there the Kubernetes context is only checked`});let a=new Set((i?.params??[]).map(l=>l.name)),c=new Set;for(let l of s){let f=n.cells[l.cellIndex];if(ce(f.meta)&&rt(l.language)){t.push(...hh(l,a,c,e));for(let D of Ee(l.info).checks?.captures??[])c.add(D.name);continue}if(!ce(f.meta)||!Me(l.language))continue;let C=(D,O,v,I)=>{t.push({severity:D,message:O,line:v===void 0?l.line:l.line+1+v,cell:{index:l.cellIndex,...v!==void 0?{sourceLine:v}:{}},...I?{fix:I}:{}})},d=Ee(l.info);for(let D of d.errors)C("error",`invalid cell option ${D}`);let h=l.info.replace(mu,"");for(let D of Wt(h)){let O=D.key.toLowerCase();if(XB.has(O)||O.startsWith("env.")&&O.length>4)continue;let v=Eu(O);v?C("warning",`unknown cell option "${D.key}" (ignored): did you mean "${v}"?`,void 0,{option:D.key,to:v}):C("warning",`unknown cell option "${D.key}" (ignored)`)}/(^|\s)every=/i.test(h)&&!d.retry&&C("warning","every= has no effect without retry="),d.host&&i?.env&&C("warning",`front matter env: doesn't apply on the host ${d.host}: there the cell gets only its own env.NAME= variables`);let x=d.kubeContext??i?.kubeContext;B&&d.host&&x&&C("warning",`kube-context-mode: pin doesn't apply on the host ${d.host}: there kubectl's current context must already be ${x} (only checked)`);let S=[];try{S=Qn(l.source,l.info,i)}catch(D){C("error",D instanceof Error?D.message:String(D))}let E=l.source.split(/\r?\n/),b=D=>{let O=E.findIndex(v=>v.includes(D));return O<0?void 0:O};for(let D of S){let O="${"+D.kind+":"+D.name;D.kind==="out"&&!c.has(D.name)&&C("error",`\${out:${D.name}} is not captured by an earlier block (add capture=${D.name} to the block that prints it)`,b(O)),D.kind==="param"&&!a.has(D.name)&&C("warning",`\${param:${D.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${D.name}=\u2026)`,b(O))}for(let D of d.checks?.captures??[])c.add(D.name)}let u=Ot(r);if(u){let l=i?.shell?.unix;if(l&&l!=="bash"){let f=r.replace(/^/,"").split(/\r?\n/).findIndex(C=>/^shell\s*:/i.test(C));t.push({severity:"warning",line:Math.max(0,f),message:`front matter shell: ${l} in a signed runbook: servers run its signed blocks in bash, and without the gate they would run in ${l}`})}for(let f of s.filter(C=>u.changed.includes(C.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:"block changed since the runbook was signed: servers that only run signed runbooks refuse it (sign the runbook again)"});for(let f of s.filter(C=>u.moved.includes(C.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:`block moved since the runbook was signed: it was signed as block ${u.cells.get(f.cellIndex).n}, after blocks that now come later`});u.missingCalls.length>0&&t.push({severity:"warning",line:Math.max(0,ZB(r)),message:`signed runbook call${u.missingCalls.length===1?"":"s"} ${u.missingCalls.join(", ")} of ${u.manifest.calls.length} not in the file as signed (deleted or changed since signing)`}),u.missing.length>0&&t.push({severity:"warning",line:Math.max(0,ZB(r)),message:`signed block${u.missing.length===1?"":"s"} ${u.missing.join(", ")} of ${u.manifest.cells.length} not in the file as signed (deleted or changed since signing)`})}else{let l=ZB(r);l>=0&&t.push({severity:"error",line:l,message:"the signature block is damaged (sign the runbook again)"})}return t.sort((l,f)=>l.line-f.line)}function hh(r,e,t,n){let s=[],i=(f,C,d,h)=>{s.push({severity:f,message:C,line:d===void 0?r.line:r.line+1+d,cell:{index:r.cellIndex,...d!==void 0?{sourceLine:d}:{}},...h?{fix:h}:{}})},B=Ee(r.info);for(let f of B.errors)i("error",`invalid cell option ${f}`);for(let f of Wt(r.info.replace(mu,""))){let C=f.key.toLowerCase();if(vl.has(C)||C.startsWith("env.")){i("warning",`${f.key}= has no effect on a runbook call (ignored): it runs no shell of its own; put it on the blocks of the runbook called`);continue}if(XB.has(C)||xl.has(C))continue;let d=Eu(C)??(["source","file","path","srcs"].includes(C)?"src":["sections","part"].includes(C)?"section":void 0);d?i("warning",`unknown cell option "${f.key}" (ignored): did you mean "${d}"?`,void 0,{option:f.key,to:d}):i("warning",`unknown cell option "${f.key}" (ignored)`)}let o=Ve(r.info,r.source);for(let f of o.problems)i("error",f.message,f.line);let a=[];try{a=Lt(o)}catch(f){i("error",f instanceof Error?f.message:String(f))}let c=f=>o.args.find(C=>C.value.includes(f))?.line;for(let f of a){let C="${"+f.kind+":"+f.name;f.kind==="out"&&!t.has(f.name)&&i("error",`\${out:${f.name}} is not captured by an earlier block (add capture=${f.name} to the block that prints it)`,c(C)),f.kind==="param"&&!e.has(f.name)&&i("warning",`\${param:${f.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${f.name}=\u2026)`,c(C))}if(o.src===void 0)return s;if(Wn(o.src)){let f=Sl(o.src),C=n.matchRunbooks?.(f);return C&&C.length===0&&i("warning",`src="${o.src}": no runbook matches ${f} yet`),s}if(!n.readRunbook)return s;let u=n.readRunbook(o.src);if(u===void 0)return i("error",`src="${o.src}": no such runbook (relative to this file)`),s;let l=Ys(o,u);for(let f of l.unknown)i("error",`${f.name}: the runbook called (${o.src}) has no parameter ${f.name}`,f.line);for(let f of l.notPassed)i("warning",`${o.src} needs \${param:${f}}, which this call doesn't pass and which has no default: it will be asked (on the command line: an error)`);for(let f of l.sections)i("error",f);for(let f of l.manualOnly)i("warning",`section="${f}" holds manual steps only (task-list items): the command line runs none of it, and a runbook that keeps evidence fails until they are ticked`);return s}function ZB(r){let e=null,t=-1;return r.split(/\r?\n/).forEach((n,s)=>{e?Ue(n,e)&&(e=null):(e=_e(n),e===null&&n.startsWith("<!-- md-runbook:signature")&&(t=s))}),t}function bu(r,e){return`${r}:${e.line+1}: ${e.severity}: ${e.message}`}var to=require("node:child_process"),eo=require("node:string_decoder");function li(r,e=process.platform){if(e==="win32"){(0,to.spawn)("taskkill",["/PID",String(r),"/T","/F"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>{});return}let t=n=>{try{process.kill(-r,n)}catch{try{process.kill(r,n)}catch{}}};t("SIGTERM"),setTimeout(()=>t("SIGKILL"),2e3).unref()}var dh=1e3;function no(r){let e=Date.now();return new Promise(t=>{let n=!1,s=!1,i=!1,B,o=d=>{i||(i=!0,clearTimeout(B),r.signal?.removeEventListener("abort",a),t({...d,timedOut:n,cancelled:s,durationMs:Date.now()-e}))},a=()=>{s=!0,u()};if(r.signal?.aborted){s=!0,o({exitCode:null,signal:null});return}let c=(0,to.spawn)(r.command,r.args,{cwd:r.cwd,env:r.env??process.env,stdio:["ignore","pipe","pipe"],windowsHide:!0,detached:process.platform!=="win32",windowsVerbatimArguments:r.windowsVerbatimArguments}),u=()=>{c.pid!==void 0&&c.exitCode===null&&li(c.pid)};r.signal?.addEventListener("abort",a),r.timeoutMs>0&&(B=setTimeout(()=>{n=!0,u()},r.timeoutMs));let l=new eo.StringDecoder("utf8"),f=new eo.StringDecoder("utf8");c.stdout?.on("data",d=>r.onStdout(l.write(d))),c.stderr?.on("data",d=>r.onStderr(f.write(d)));let C=(d,h)=>{if(i)return;let x=l.end(),S=f.end();x&&r.onStdout(x),S&&r.onStderr(S),o({exitCode:d,signal:h})};c.on("error",d=>o({exitCode:null,signal:null,error:d.message})),c.on("close",C),c.on("exit",(d,h)=>{setTimeout(()=>{i||(c.stdout?.destroy(),c.stderr?.destroy(),C(d,h))},dh)})})}var jt=he(require("node:fs")),io=he(require("node:os")),Xn=he(require("node:path"));var ku=require("node:child_process"),ph=["HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","HKCU\\Environment"];function xu(r){let e=/^\s*Path\s+REG_(?:EXPAND_)?SZ\s+(.*)$/im.exec(r);return e?e[1].trim():""}function vu(r,e){return r.replace(/%([^%;]+)%/g,(t,n)=>{let s=Object.keys(e).find(B=>B.toUpperCase()===n.toUpperCase()),i=s===void 0?void 0:e[s];return i===void 0?t:i})}function wu(r){return r.trim().replace(/[\\/]+$/,"").toLowerCase()}function Su(r,e){let t=new Set(r.split(";").map(wu).filter(Boolean)),n=[];for(let s of e){let i=wu(s);!i||t.has(i)||(t.add(i),n.push(s.trim()))}return n.length===0?r:[r.replace(/;+$/,""),...n].filter(Boolean).join(";")}var gh=r=>new Promise(e=>{(0,ku.execFile)("reg",["query",r,"/v","Path"],{windowsHide:!0,timeout:5e3},(t,n)=>e(t?"":String(n)))}),ui,mh=3e3;async function Ou(r,e=Date.now(),t=gh){if(!ui||e-ui.at>=mh){let n=await Promise.all(ph.map(async s=>xu(await t(s))));ui={at:e,values:n}}return ui.values.flatMap(n=>vu(n,r).split(";").filter(s=>s.trim()))}async function ro(r,e=process.platform,t=Ou){if(e!=="win32")return r;let n=Object.keys(r).find(B=>B.toUpperCase()==="PATH")??"Path",s=r[n]??"",i=Su(s,await t(r));return i!==s&&(r[n]=i),r}var Zn=he(require("node:path"));function xn(r,e,t){switch(r){case"pwsh":return Eh(e,t);case"cmd":return Dh(t);case"bash":return wh(e,t)}}function yu(r){let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows",t=Zn.win32.join(e,"System32","WindowsPowerShell","v1.0","powershell.exe");return r.which("powershell.exe")??(r.exists(t)?t:void 0)}function Eh(r,e){let t=e.platform==="win32",n=r.runbook?.powershell,s;if(n==="windows-powershell"){if(!t)return{ok:!1,error:"Windows PowerShell 5.1 runs only on Windows (the runbook's shell: windows-powershell)."};if(s=yu(e),!s)return{ok:!1,error:"Windows PowerShell 5.1 not found (the runbook's shell: windows-powershell)."}}else{if(s=r.pwshPath?.trim()||e.which("pwsh"),!s&&n==="pwsh")return{ok:!1,error:"PowerShell 7 (pwsh) not found (the runbook's shell: pwsh): install it or set mdRunbook.shell.pwshPath."};!s&&t&&(s=yu(e)),s||(s=e.which("powershell"))}if(!s)return{ok:!1,error:"PowerShell not found: install PowerShell 7 (pwsh) or set mdRunbook.shell.pwshPath."};let i=/powershell(\.exe)?$/i.test(s)?"powershell":"pwsh";return{ok:!0,shell:{kind:"pwsh",command:s,label:i,extension:".ps1",args:B=>["-NoLogo","-NoProfile","-NonInteractive",...t?["-ExecutionPolicy","Bypass"]:[],"-Command",Ru(B)],script:B=>"\uFEFF"+B.replace(/\r?\n/g,t?`\r
|
|
220
|
+
`,c=n.incident?`${n.incident}${n.severity?` \xB7 ${n.severity}`:""}`:"",l=`@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}${c?`@top-right{content:${JSON.stringify(c)};font:10px sans-serif;color:#656d76}`:""}}`;return{html:a,pageCss:l}}function Ah(r){return me(r).part??"body"}function Fh(r){return Ge(r.language)||$e(r.language)!==void 0}function kB(r){let e=r.map(n=>Fh(n)?Ah(n.info):void 0),t=e.indexOf("ready");return{parts:e,...t>=0?{ready:t}:{},any:e.some(n=>n!==void 0&&n!=="body")}}function nc(r){let e=[],{parts:t}=kB(r),n=a=>r[a].line+1,s,i,o,B;return t.forEach((a,c)=>{if(a!==void 0){if(a==="ready"){Ge(r[c].language)?e.push({at:c,message:"ready: the ready check is a shell block (exit 0 = up), not a runbook call"}):s!==void 0?e.push({at:c,message:`ready: a runbook has one ready check (the first one is on line ${n(s)})`}):B!==void 0&&e.push({at:c,message:`ready: the ready check comes before the setup steps it guards (a setup step is on line ${n(B)})`}),s??=c;return}if(a==="setup"){B??=c;let l=i??o;l!==void 0&&e.push({at:c,message:`setup: setup steps come before the runbook's own steps (one is on line ${n(l)})`});return}if(a==="body"){i??=c,o!==void 0&&e.push({at:c,message:`a step after the teardown (line ${n(o)}): teardown steps come last; mark this one teardown, or move it up`});return}o??=c}}),e}var xB=new Set(["timeout","estimate","cwd","continue-on-error","skip","confirm","no-confirm","terminal","name","on-failure","expect","expect-not","expect-exit","capture","capture-secret","os","host","kube-context","lines","retry","every","setup","teardown","ready","proposed","by","reason","approved","approved-by","approved-at"]),sc=/^\s*[^\s{]*/;function rc(r,e){let t=Array.from({length:r.length+1},(n,s)=>Array.from({length:e.length+1},(i,o)=>s===0?o:o===0?s:0));for(let n=1;n<=r.length;n++)for(let s=1;s<=e.length;s++){let i=r[n-1]===e[s-1]?0:1,o=Math.min(t[n-1][s]+1,t[n][s-1]+1,t[n-1][s-1]+i);n>1&&s>1&&r[n-1]===e[s-2]&&r[n-2]===e[s-1]&&(o=Math.min(o,t[n-2][s-2]+1)),t[n][s]=o}return t[r.length][e.length]}function ic(r){let e=r.toLowerCase(),t=e.length<=4?1:2,n,s=1/0,i=!1;for(let o of xB){let B=o.endsWith("y")?`${o.slice(0,-1)}ies`:`${o}s`,a=Math.min(rc(e,o),rc(e,B));a<s?(n=o,s=a,i=!1):a===s&&(i=!0)}return n!==void 0&&s<=t&&!i?n:void 0}var $h=/^(PATH|BASH_ENV|ENV|IFS|PROMPT_COMMAND|PS4|SHELLOPTS|BASHOPTS|CDPATH|LD_\w+|DYLD_\w+|NODE_OPTIONS|PYTHONPATH|PYTHONSTARTUP|PERL5OPT|PERL5LIB|RUBYOPT|GIT_SSH_COMMAND|GIT_EXEC_PATH)$/i;function Ih(r,e,t){let n=[],s=r.findIndex((o,B)=>B>0&&B<e&&/^env\s*:/i.test(o));if(s<0)return n;if(!/^env\s*:\s*(#.*)?$/i.test(r[s]))return n.push({severity:"warning",line:s,message:"front matter env: is ignored: write each variable on its own indented line below it ( NAME: value)"}),n;let i=new Set;for(let o=s+1;o<e;o++){let B=r[o];if(B.trim()===""||B.trim().startsWith("#"))continue;if(!/^\s/.test(B))break;let a=Po.exec(B);if(!a){n.push({severity:"warning",line:o,message:`front matter env: "${B.trim()}" is ignored (expected NAME: value, the name letters, digits and _)`});continue}let c=a[1];if(i.has(c)){n.push({severity:"warning",line:o,message:`front matter env: ${c} is set twice: the first one counts`});continue}i.add(c),$h.test(c)&&n.push({severity:"warning",line:o,message:`front matter env: ${c} changes what every cell runs, and the front matter isn't signed: set it on the cells that need it (env.${c}=)`})}return t&&i.size>0&&n.push({severity:"warning",line:s,message:"front matter env: is used in VS Code and the command line only: the md-runbook app doesn't use it for a signed runbook's cells (the front matter isn't signed); put what a host needs on the cells (env.NAME=)"}),n}function Th(r,e,t){let n=[],s={};for(let c=1;c<t;c++){let l=/^(report-runs(?:-required|-signed|-token)?)\s*:\s*(.*?)\s*$/i.exec(e[c]);if(!l)continue;let u=l[1].toLowerCase(),f=l[2].replace(/\s+#.*$/,"").replace(/^(["'])(.*)\1$/,"$2");if(s[u]!==void 0){n.push({severity:"warning",line:c,message:`front matter ${u}: written twice: the first one counts`});continue}if(s[u]=c,u==="report-runs"){let d=Nn(f);d&&n.push({severity:"warning",line:c,message:`front matter report-runs: "${f}" is ignored: ${d}`})}else if(u==="report-runs-token"){if(/^\$\{secret:[A-Za-z_][A-Za-z0-9_]*\}$/.test(f))continue;n.push({severity:"error",line:c,message:"front matter report-runs-token: never write a token in the file (anyone who reads it can send reports): use ${secret:NAME}, kept in your secret store"})}else/^(true|false|yes|no|on|off)$/i.test(f)||n.push({severity:"warning",line:c,message:`front matter ${u}: "${f}" is ignored (expected true or false)`})}let i=ve(r),o=[i?.reportRunsRequired?"report-runs-required":void 0,i?.reportRunsSigned?"report-runs-signed":void 0].filter(c=>!!c);if(!i?.reportRuns){for(let c of[...o,...i?.reportRunsToken?["report-runs-token"]:[]])n.push({severity:"warning",line:s[c]??0,message:`front matter ${c}: has no effect without report-runs: (the address)`});return n}if(o.length===0)return n;let B=ot(r),a;return _t(r)?B?B.version!==2?a="the signature covers only its blocks, not the front matter: sign the runbook again":B.textChanged&&(a="the runbook changed since signing: sign it again"):a="the signature block is damaged":a="the runbook is not signed",a&&n.push({severity:"warning",line:s[o[0]]??0,message:`front matter ${o.join(" and ")}: ignored, ${a}. Until then clients ask before reporting (they honour these only in a runbook signed by a signer they trust)`}),n}function oc(r,e={}){let t=[],n=he(r),s=ft(n),i=ve(r);if(i){let u=r.replace(/^/,"").split(/\r?\n/),f=u.findIndex((h,p)=>p>0&&/^(---|\.\.\.)\s*$/.test(h));for(let h=1;h<f;h++){let p=/^(mode|timeout|cwd|kube-context|kube-context-mode|git-bash-path-conversion|manual-steps)\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[h]);if(!p)continue;let w=p[1].toLowerCase();if(w==="mode"&&i.mode===void 0||w==="timeout"&&i.timeoutSeconds===void 0||w==="cwd"&&i.cwd===void 0||w==="kube-context"&&i.kubeContext===void 0||w==="kube-context-mode"&&i.kubeContextMode===void 0||w==="git-bash-path-conversion"&&i.gitBashPathConversion===void 0||w==="manual-steps"&&i.manualSteps===void 0){let m={mode:"session or isolated",timeout:"seconds, e.g. 300",cwd:"a folder","kube-context":"a Kubernetes context name, e.g. prod-eu, or ${param:NAME}","kube-context-mode":"check or pin","git-bash-path-conversion":"on or off","manual-steps":"pause or continue"};t.push({severity:"warning",line:h,message:`front matter ${w}: "${p[2]}" is ignored (expected ${m[w]})`})}}let d={};for(let h=1;h<f;h++){let p=/^shell\s*:\s*(.*?)\s*(#.*)?$/i.exec(u[h]);if(!p)continue;if(p[1]===""){t.push({severity:"warning",line:h,message:"front matter shell: is empty: write the names on the same line (shell: zsh, pwsh), not as a list below it"});continue}let{shells:w,unknown:D,twice:m}=_r(p[1]);for(let b of["unix","powershell"]){let v=w[b];v&&(d[b]?m.push(v):d[b]=v)}for(let b of D){let v=/[\\/]/.test(b)?`front matter shell: "${b}" is ignored: name a shell (${[...Pr,...Hr].join(", ")}), never a path`:`front matter shell: "${b}" is ignored (expected ${Pr.join(", ")} for sh/bash cells, ${Hr.join(" or ")} for PowerShell cells)`;t.push({severity:"warning",line:h,message:v})}for(let b of m)t.push({severity:"warning",line:h,message:`front matter shell: "${b}" is ignored: one shell per kind of cell, the first one counts`})}t.push(...Ih(u,f,ot(r)!==void 0)),t.push(...Th(r,u,f));for(let h of i.params){if(!h.choices||h.default===void 0||h.choices.includes(h.default))continue;let p=u.findIndex((w,D)=>D>0&&D<f&&new RegExp(`^\\s*-\\s+${h.name}\\b`).test(w));t.push({severity:"warning",line:Math.max(0,p),message:`front matter params: the default of ${h.name}, "${h.default}", is not one of its choices (${h.choices.join(", ")})`})}}let o=i?.kubeContextMode==="pin",B=()=>Math.max(0,r.replace(/^/,"").split(/\r?\n/).findIndex(u=>/^kube-context-mode\s*:/i.test(u)));o&&!i?.kubeContext&&!s.some(u=>me(u.info).kubeContext!==void 0)&&t.push({severity:"warning",line:B(),message:"front matter kube-context-mode: pin has no effect: no kube-context: in the front matter and no kube-context= on a block"}),o&&i?.practice&&t.push({severity:"warning",line:B(),message:`front matter kube-context-mode: pin doesn't apply on the practice host ${i.practice}: there the Kubernetes context is only checked`});let a=new Set((i?.params??[]).map(u=>u.name)),c=new Set;for(let u of s){let f=n.cells[u.cellIndex];if(ce(f.meta)&&Ge(u.language)){t.push(...Lh(u,a,c,e));for(let v of me(u.info).checks?.captures??[])c.add(v.name);continue}if(!ce(f.meta)||!$e(u.language))continue;let d=(v,R,S,I)=>{t.push({severity:v,message:R,line:S===void 0?u.line:u.line+1+S,cell:{index:u.cellIndex,...S!==void 0?{sourceLine:S}:{}},...I?{fix:I}:{}})},h=me(u.info);for(let v of h.errors)d("error",`invalid cell option ${v}`);let p=u.info.replace(sc,"");for(let v of on(p)){let R=v.key.toLowerCase();if(xB.has(R)||R.startsWith("env.")&&R.length>4)continue;let S=ic(R);S?d("warning",`unknown cell option "${v.key}" (ignored): did you mean "${S}"?`,void 0,{option:v.key,to:S}):d("warning",`unknown cell option "${v.key}" (ignored)`)}/(^|\s)every=/i.test(p)&&!h.retry&&d("warning","every= has no effect without retry="),h.host&&i?.env&&d("warning",`front matter env: doesn't apply on the host ${h.host}: there the cell gets only its own env.NAME= variables`);let w=h.kubeContext??i?.kubeContext;o&&h.host&&w&&d("warning",`kube-context-mode: pin doesn't apply on the host ${h.host}: there kubectl's current context must already be ${w} (only checked)`);let D=[];try{D=gr(u.source,u.info,i)}catch(v){d("error",v instanceof Error?v.message:String(v))}let m=u.source.split(/\r?\n/),b=v=>{let R=m.findIndex(S=>S.includes(v));return R<0?void 0:R};for(let v of D){let R="${"+v.kind+":"+v.name;v.kind==="out"&&!c.has(v.name)&&d("error",`\${out:${v.name}} is not captured by an earlier block (add capture=${v.name} to the block that prints it)`,b(R)),v.kind==="param"&&!a.has(v.name)&&d("warning",`\${param:${v.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${v.name}=\u2026)`,b(R))}for(let v of h.checks?.captures??[])c.add(v.name)}for(let u of nc(s)){let f=s[u.at];t.push({severity:"error",message:u.message,line:f.line,cell:{index:f.cellIndex}})}let l=ot(r);if(l){let u=i?.shell?.unix;if(u&&u!=="bash"){let f=r.replace(/^/,"").split(/\r?\n/).findIndex(d=>/^shell\s*:/i.test(d));t.push({severity:"warning",line:Math.max(0,f),message:`front matter shell: ${u} in a signed runbook: servers run its signed blocks in bash, and without the gate they would run in ${u}`})}for(let f of s.filter(d=>l.changed.includes(d.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:"block changed since the runbook was signed: servers that only run signed runbooks refuse it (sign the runbook again)"});for(let f of s.filter(d=>l.moved.includes(d.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:`block moved since the runbook was signed: it was signed as block ${l.cells.get(f.cellIndex).n}, after blocks that now come later`});l.textChanged&&t.push({severity:"warning",line:Math.max(0,Ai(r)),message:"the runbook changed since signing (its prose, front matter, checklists or other blocks): clients no longer show it as signed as a whole (sign it again)"});for(let f of s.filter(d=>l.unsigned.includes(d.cellIndex)))t.push({severity:"warning",line:f.line,cell:{index:f.cellIndex},message:l.version===1?"block not covered by the signature: it was signed before manifest version 2, which signs only bash/sh blocks (sign the runbook again to cover the whole runbook)":"block not covered by the signature any more: the runbook changed since signing (sign it again)"});l.missingCalls.length>0&&t.push({severity:"warning",line:Math.max(0,Ai(r)),message:`signed runbook call${l.missingCalls.length===1?"":"s"} ${l.missingCalls.join(", ")} of ${l.manifest.calls.length} not in the file as signed (deleted or changed since signing)`}),l.missing.length>0&&t.push({severity:"warning",line:Math.max(0,Ai(r)),message:`signed block${l.missing.length===1?"":"s"} ${l.missing.join(", ")} of ${l.manifest.cells.length} not in the file as signed (deleted or changed since signing)`})}else{let u=Ai(r);u>=0&&t.push({severity:"error",line:u,message:"the signature block is damaged (sign the runbook again)"})}return t.sort((u,f)=>u.line-f.line)}function Lh(r,e,t,n){let s=[],i=(f,d,h,p)=>{s.push({severity:f,message:d,line:h===void 0?r.line:r.line+1+h,cell:{index:r.cellIndex,...h!==void 0?{sourceLine:h}:{}},...p?{fix:p}:{}})},o=me(r.info);for(let f of o.errors)i("error",`invalid cell option ${f}`);for(let f of on(r.info.replace(sc,""))){let d=f.key.toLowerCase();if(al.has(d)||d.startsWith("env.")){i("warning",`${f.key}= has no effect on a runbook call (ignored): it runs no shell of its own; put it on the blocks of the runbook called`);continue}if(xB.has(d)||Bl.has(d))continue;let h=ic(d)??(["source","file","path","srcs"].includes(d)?"src":["sections","part"].includes(d)?"section":void 0);h?i("warning",`unknown cell option "${f.key}" (ignored): did you mean "${h}"?`,void 0,{option:f.key,to:h}):i("warning",`unknown cell option "${f.key}" (ignored)`)}let B=et(r.info,r.source);for(let f of B.problems)i("error",f.message,f.line);let a=[];try{a=Mt(B)}catch(f){i("error",f instanceof Error?f.message:String(f))}let c=f=>B.args.find(d=>d.value.includes(f))?.line;for(let f of a){let d="${"+f.kind+":"+f.name;f.kind==="out"&&!t.has(f.name)&&i("error",`\${out:${f.name}} is not captured by an earlier block (add capture=${f.name} to the block that prints it)`,c(d)),f.kind==="param"&&!e.has(f.name)&&i("warning",`\${param:${f.name}} is not declared in the front matter params: (it has no default, and the command line needs --param ${f.name}=\u2026)`,c(d))}if(B.src===void 0)return s;if(Er(B.src)){let f=ul(B.src),d=n.matchRunbooks?.(f);return d&&d.length===0&&i("warning",`src="${B.src}": no runbook matches ${f} yet`),s}if(!n.readRunbook)return s;let l=n.readRunbook(B.src);if(l===null)return s;if(l===void 0)return i("error",`src="${B.src}": no such runbook (relative to this file)`),s;let u=di(B,l);for(let f of u.unknown)i("error",`${f.name}: the runbook called (${B.src}) has no parameter ${f.name}`,f.line);for(let f of u.notPassed)i("warning",`${B.src} needs \${param:${f}}, which this call doesn't pass and which has no default: it will be asked (on the command line: an error)`);for(let f of u.sections)i("error",f);for(let f of u.manualOnly)i("warning",`section="${f}" holds manual steps only (task-list items): the command line runs none of it, and a runbook that keeps evidence fails until they are ticked`);return s}function Ai(r){let e=null,t=-1;return r.split(/\r?\n/).forEach((n,s)=>{e?Ke(n,e)&&(e=null):(e=_e(n),e===null&&n.startsWith("<!-- md-runbook:signature")&&(t=s))}),t}function Bc(r,e){return`${r}:${e.line+1}: ${e.severity}: ${e.message}`}var SB=require("node:child_process"),vB=require("node:string_decoder");function Fi(r,e=process.platform){if(e==="win32"){(0,SB.spawn)("taskkill",["/PID",String(r),"/T","/F"],{windowsHide:!0,stdio:"ignore"}).on("error",()=>{});return}let t=n=>{try{process.kill(-r,n)}catch{try{process.kill(r,n)}catch{}}};t("SIGTERM"),setTimeout(()=>t("SIGKILL"),2e3).unref()}var Nh=1e3;function yB(r){let e=Date.now();return new Promise(t=>{let n=!1,s=!1,i=!1,o,B=h=>{i||(i=!0,clearTimeout(o),r.signal?.removeEventListener("abort",a),t({...h,timedOut:n,cancelled:s,durationMs:Date.now()-e}))},a=()=>{s=!0,l()};if(r.signal?.aborted){s=!0,B({exitCode:null,signal:null});return}let c=(0,SB.spawn)(r.command,r.args,{cwd:r.cwd,env:r.env??process.env,stdio:["ignore","pipe","pipe"],windowsHide:!0,detached:process.platform!=="win32",windowsVerbatimArguments:r.windowsVerbatimArguments}),l=()=>{c.pid!==void 0&&c.exitCode===null&&Fi(c.pid)};r.signal?.addEventListener("abort",a),r.timeoutMs>0&&(o=setTimeout(()=>{n=!0,l()},r.timeoutMs));let u=new vB.StringDecoder("utf8"),f=new vB.StringDecoder("utf8");c.stdout?.on("data",h=>r.onStdout(u.write(h))),c.stderr?.on("data",h=>r.onStderr(f.write(h)));let d=(h,p)=>{if(i)return;let w=u.end(),D=f.end();w&&r.onStdout(w),D&&r.onStderr(D),B({exitCode:h,signal:p})};c.on("error",h=>B({exitCode:null,signal:null,error:h.message})),c.on("close",d),c.on("exit",(h,p)=>{setTimeout(()=>{i||(c.stdout?.destroy(),c.stderr?.destroy(),d(h,p))},Nh)})})}var Qt=le(require("node:fs")),AB=le(require("node:os")),kr=le(require("node:path"));var uc=require("node:child_process"),Mh=["HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment","HKCU\\Environment"];function lc(r){let e=/^\s*Path\s+REG_(?:EXPAND_)?SZ\s+(.*)$/im.exec(r);return e?e[1].trim():""}function cc(r,e){return r.replace(/%([^%;]+)%/g,(t,n)=>{let s=Object.keys(e).find(o=>o.toUpperCase()===n.toUpperCase()),i=s===void 0?void 0:e[s];return i===void 0?t:i})}function ac(r){return r.trim().replace(/[\\/]+$/,"").toLowerCase()}function fc(r,e){let t=new Set(r.split(";").map(ac).filter(Boolean)),n=[];for(let s of e){let i=ac(s);!i||t.has(i)||(t.add(i),n.push(s.trim()))}return n.length===0?r:[r.replace(/;+$/,""),...n].filter(Boolean).join(";")}var Gh=r=>new Promise(e=>{(0,uc.execFile)("reg",["query",r,"/v","Path"],{windowsHide:!0,timeout:5e3},(t,n)=>e(t?"":String(n)))}),$i,Ph=3e3;async function dc(r,e=Date.now(),t=Gh){if(!$i||e-$i.at>=Ph){let n=await Promise.all(Mh.map(async s=>lc(await t(s))));$i={at:e,values:n}}return $i.values.flatMap(n=>cc(n,r).split(";").filter(s=>s.trim()))}async function RB(r,e=process.platform,t=dc){if(e!=="win32")return r;let n=Object.keys(r).find(o=>o.toUpperCase()==="PATH")??"Path",s=r[n]??"",i=fc(s,await t(r));return i!==s&&(r[n]=i),r}var wr=le(require("node:path"));function Jn(r,e,t){switch(r){case"pwsh":return Hh(e,t);case"cmd":return _h(t);case"bash":return Uh(e,t)}}function pc(r){let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows",t=wr.win32.join(e,"System32","WindowsPowerShell","v1.0","powershell.exe");return r.which("powershell.exe")??(r.exists(t)?t:void 0)}function Hh(r,e){let t=e.platform==="win32",n=r.runbook?.powershell,s;if(n==="windows-powershell"){if(!t)return{ok:!1,error:"Windows PowerShell 5.1 runs only on Windows (the runbook's shell: windows-powershell)."};if(s=pc(e),!s)return{ok:!1,error:"Windows PowerShell 5.1 not found (the runbook's shell: windows-powershell)."}}else{if(s=r.pwshPath?.trim()||e.which("pwsh"),!s&&n==="pwsh")return{ok:!1,error:"PowerShell 7 (pwsh) not found (the runbook's shell: pwsh): install it or set mdRunbook.shell.pwshPath."};!s&&t&&(s=pc(e)),s||(s=e.which("powershell"))}if(!s)return{ok:!1,error:"PowerShell not found: install PowerShell 7 (pwsh) or set mdRunbook.shell.pwshPath."};let i=/powershell(\.exe)?$/i.test(s)?"powershell":"pwsh";return{ok:!0,shell:{kind:"pwsh",command:s,label:i,extension:".ps1",args:o=>["-NoLogo","-NoProfile","-NonInteractive",...t?["-ExecutionPolicy","Bypass"]:[],"-Command",Cc(o)],script:o=>"\uFEFF"+o.replace(/\r?\n/g,t?`\r
|
|
217
221
|
`:`
|
|
218
222
|
`)+(t?`\r
|
|
219
223
|
`:`
|
|
220
|
-
`)}}}function
|
|
224
|
+
`)}}}function Cc(r){return["[Console]::OutputEncoding = [System.Text.Encoding]::UTF8","$OutputEncoding = New-Object System.Text.UTF8Encoding $false","$global:LASTEXITCODE = 0",`& ${"'"+r.replace(/['\u2018\u2019\u201A\u201B]/g,t=>t+t)+"'"}`,"$mdRunbookOk = $?","if ($LASTEXITCODE) { exit $LASTEXITCODE } elseif (-not $mdRunbookOk) { exit 1 } else { exit 0 }"].join("; ")}function _h(r){if(r.platform!=="win32")return{ok:!1,error:"cmd blocks can only run on Windows."};let e=r.env.SystemRoot??r.env.SYSTEMROOT??"C:\\Windows";return{ok:!0,shell:{kind:"cmd",command:r.env.ComSpec??r.env.COMSPEC??wr.win32.join(e,"System32","cmd.exe"),label:"cmd",extension:".cmd",args:n=>["/d","/s","/c",`""${n}""`],windowsVerbatimArguments:!0,script:n=>["@echo off","@chcp 65001 >nul",...n.split(/\r?\n/)].join(`\r
|
|
221
225
|
`)+`\r
|
|
222
|
-
`}}}function
|
|
226
|
+
`}}}function OB(r){let e=wr.win32,t=[];for(let s of[r.env.ProgramFiles,r.env.ProgramW6432,r.env["ProgramFiles(x86)"]])s&&t.push(e.join(s,"Git","bin","bash.exe"));r.env.LOCALAPPDATA&&t.push(e.join(r.env.LOCALAPPDATA,"Programs","Git","bin","bash.exe")),r.env.USERPROFILE&&t.push(e.join(r.env.USERPROFILE,"scoop","apps","git","current","bin","bash.exe"));let n=r.which("git.exe")??r.which("git");if(n){let s=e.dirname(n);t.push(e.join(s,"..","bin","bash.exe"),e.join(s,"..","..","bin","bash.exe"))}return[...new Set(t.map(s=>e.normalize(s)))]}function gc(r){return/\\(System32|Sysnative)\\bash\.exe$/i.test(r)||/\\WindowsApps\\/i.test(r)}function hc(r,e){let t=r.which(e);return t&&!gc(t)?t:void 0}var mc=(r,e,t)=>({kind:"bash",command:r,label:e,extension:".sh",args:n=>[t?n.replace(/\\/g,"/"):n],script:n=>n.replace(/\r\n/g,`
|
|
223
227
|
`)+`
|
|
224
|
-
`});function
|
|
228
|
+
`});function Jh(r,e,t){let n=t.platform==="win32",s;if(r==="zsh")s=n?hc(t,"zsh.exe"):t.which("zsh");else if(!n)s=t.exists("/bin/sh")?"/bin/sh":t.which("sh");else{let i=e.bashPath?.trim();s=[...i?[i]:[],...OB(t)].map(o=>wr.win32.join(wr.win32.dirname(o),"sh.exe")).find(o=>t.exists(o)),s??=hc(t,"sh.exe")}return s?{ok:!0,shell:mc(s,r,n)}:{ok:!1,error:`${r} not found${n&&r==="sh"?": install Git for Windows":n?" on PATH (WSL's is not used)":" on PATH"} (the runbook's shell: ${r}).`}}function Uh(r,e){let t=r.runbook?.unix;if(t==="zsh"||t==="sh")return Jh(t,r,e);let n=e.platform==="win32",s=r.bashPath?.trim()||void 0;if(!s&&n){if(s=OB(e).find(i=>e.exists(i)),!s){let i=e.which("bash.exe");i&&!gc(i)&&(s=i)}if(!s)return{ok:!1,error:"Git Bash not found: install Git for Windows or set mdRunbook.shell.bashPath to bash.exe."}}return s||(s=e.which("bash")??(t==="bash"?void 0:e.which("sh"))),s?{ok:!0,shell:mc(s,/(^|[\\/])sh$/.test(s)?"sh":"bash",n)}:{ok:!1,error:`bash not found on PATH${t==="bash"?" (the runbook's shell: bash)":""}: set mdRunbook.shell.bashPath.`}}function Ec(r,e=process.env){let t=(e.PATH??e.Path??"").split(kr.delimiter).filter(Boolean),n=process.platform==="win32"?["",...(e.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")]:[""];for(let s of t)for(let i of n){let o=kr.join(s,r.toLowerCase().endsWith(i.toLowerCase())?r:r+i);try{if(Qt.statSync(o).isFile())return o}catch{}}}function ln(r=process.env){return{platform:process.platform,env:r,exists:e=>{try{return Qt.statSync(e).isFile()}catch{return!1}},which:e=>Ec(e,r)}}async function fs(r,e,t){let n={...process.env,...e};return r.refreshPath!==!1&&await RB(n,t),bc(n,t)}function bc(r,e){return e!=="win32"||Object.keys(r).some(n=>/^(PYTHONIOENCODING|PYTHONUTF8)$/i.test(n))||(r.PYTHONIOENCODING="utf-8"),r}function Ii(r,e){return r.env===process.env?{...r,env:e,which:t=>Ec(t,e)}:r}async function Un(r,e=ln()){let t=f=>({exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:f,durationMs:0}),n=$e(r.language);if(!n)return t(`No shell for language '${r.language}'.`);let s=await fs(r.settings,r.env,e.platform),i=Jn(n,r.settings,Ii(e,s));if(!i.ok)return t(i.error);let o=i.shell,B=Qt.mkdtempSync(kr.join(AB.tmpdir(),"md-runbook-")),a=kr.join(B,"cell"+o.extension),c=r.source,l=r.cwd,u=o.args(a);o.kind==="cmd"&&/^[\\/]{2}/.test(l)&&(c=`pushd "${l}" >nul 2>&1 || (echo md-runbook: cannot open ${l} 1>&2 & exit /b 1)\r
|
|
225
229
|
${c}\r
|
|
226
|
-
popd`,
|
|
227
|
-
`)[0]}): ${
|
|
228
|
-
|
|
229
|
-
`}
|
|
230
|
+
popd`,l=AB.tmpdir()),o.kind==="bash"&&e.platform==="win32"&&/['"\[\]*?{}$`]/.test(a)&&(s.MDRB_SCRIPT=u[0]??a,u=["-c",'. "$MDRB_SCRIPT"']);try{return Qt.writeFileSync(a,o.script(c),"utf8"),{...await yB({command:o.command,args:u,cwd:l,env:s,timeoutMs:r.timeoutMs,signal:r.signal,windowsVerbatimArguments:o.windowsVerbatimArguments,onStdout:r.onStdout,onStderr:r.onStderr}),shell:o}}finally{try{Qt.rmSync(B,{recursive:!0,force:!0})}catch{}}}var cn=le(require("node:fs")),ds=le(require("node:os")),jn=le(require("node:path"));var Dc={MSYS_NO_PATHCONV:"1",MSYS2_ARG_CONV_EXCL:"*"};function xr(r,e,t){if(t!=="win32")return r[e];let n=Object.keys(r).find(s=>s.toUpperCase()===e);return n===void 0?void 0:r[n]}var jh=r=>{try{return cn.statSync(r).isFile()}catch{return!1}};function wc(r,e=process.platform,t=jh){let n=xr(r,"KUBECONFIG",e);if(n)return n;let s=e==="win32"?jn.win32.join:jn.posix.join;if(e!=="win32")return s(r.HOME||ds.homedir(),".kube","config");let i=xr(r,"HOMEDRIVE",e),o=xr(r,"HOMEPATH",e);return[xr(r,"HOME",e),i&&o?i+o:void 0,xr(r,"USERPROFILE",e)].filter(c=>!!c).map(c=>s(c,".kube","config")).find(t)??s(xr(r,"USERPROFILE",e)||ds.homedir(),".kube","config")}var ps=class{constructor(e=ds.tmpdir()){this.tmp=e}tmp;dir;files=new Map;file(e){let t=this.files.get(e);t===void 0&&this.files.set(e,t=`pin-${this.files.size+1}.kubeconfig`);let n=()=>{this.dir??=cn.mkdtempSync(jn.join(this.tmp,"md-runbook-kube-"));let s=jn.join(this.dir,t);return cn.writeFileSync(s,Qu(e),{mode:384}),s};try{return n()}catch(s){if(s.code!=="ENOENT")throw s;return this.dir=void 0,n()}}dispose(){if(this.dir!==void 0){try{cn.rmSync(this.dir,{recursive:!0,force:!0})}catch{}this.dir=void 0}}};function FB(r){let e=r.platform??process.platform,t=r.frontMatter,n={...t?.env},s={},i=!1;if(t?.kubeContextMode==="pin"&&r.pins){let o=wc(r.env,e);r.kubeContext!==void 0?(s.KUBECONFIG=Wu(r.pins.file(r.kubeContext),o,e),i=!0):s.KUBECONFIG=o}return t?.gitBashPathConversion==="off"&&e==="win32"&&$e(r.language)==="bash"&&Object.assign(s,Dc),{env:s,defaults:n,pinned:i}}function $B(r,e){return{...e.defaults,...r,...e.env}}var kc=require("node:child_process"),xc=require("node:crypto"),Ct=le(require("node:fs")),vc=le(require("node:os")),Li=le(require("node:path"));function Ni(r){return(0,xc.createHash)("sha256").update(r,"utf8").digest("hex")}function Ti(r,e,t){return new Promise((n,s)=>{let i=(0,kc.spawn)(r,e,{stdio:[t==="inherit"?"inherit":"pipe","pipe","pipe"],windowsHide:!0}),o="",B="";i.stdout.on("data",a=>o+=a.toString("utf8")),i.stderr.on("data",a=>B+=a.toString("utf8")),i.on("error",a=>s(new Error(`${r}: ${a.message} (OpenSSH's ssh-keygen is needed)`))),i.on("close",a=>n({code:a,stdout:o,stderr:B})),t!=="inherit"&&(i.stdin.on("error",()=>{}),i.stdin.end(t))})}function Sc(){return Ct.mkdtempSync(Li.join(vc.tmpdir(),"md-runbook-sign-"))}async function Kn(r,e,t={}){let n=Sc();try{let s=Li.join(n,"manifest");Ct.writeFileSync(s,r,"utf8");let i=await Ti(t.sshKeygen??"ssh-keygen",["-Y","sign","-q","-f",e,"-n",t.namespace??dB,s],t.interactive===!1?"":"inherit");if(i.code!==0||!Ct.existsSync(s+".sig"))throw new Error(`ssh-keygen could not sign: ${i.stderr.trim()||`exit ${i.code}`}`);return jl(Ct.readFileSync(s+".sig","utf8"))}finally{Ct.rmSync(n,{recursive:!0,force:!0})}}async function Wt(r,e,t,n="ssh-keygen",s=dB){let i=Sc();try{let o=Li.join(i,"manifest.sig");Ct.writeFileSync(o,Si(e),"utf8");let B=await Ti(n,["-Y","find-principals","-s",o,"-f",t],""),a=B.code===0?B.stdout.split(/[\r\n,]+/).filter(Boolean):[];if(a.length===0)throw new Error(`no key in ${t} made this signature`);let c="";for(let l of a){let u=await Ti(n,["-Y","verify","-f",t,"-I",l,"-n",s,"-s",o],r);if(u.code===0)return l;c=(u.stderr||u.stdout).trim()}throw new Error(`the signature does not verify: ${c}`)}finally{Ct.rmSync(i,{recursive:!0,force:!0})}}async function IB(r,e){let t=[];for(let n of r.cells)if(!(n.steps.length<2))for(let s=0;s<n.steps.length;s++){let i;try{i=await Ti(e,["--norc","--noprofile","-n"],n.steps[s])}catch{return}let o=i.stderr.trim().split(/\r?\n/)[0];(i.code!==0||o)&&t.push(`cell ${n.n}, command ${s+1} (${n.steps[s].split(`
|
|
231
|
+
`)[0]}): ${o||`bash -n exit ${i.code}`}`)}return t}function hs(r){let e=r.endsWith(".pub")?r:r+".pub";try{let t=Ct.readFileSync(e,"utf8").trim().split(/\s+/);return t.length>=3?t.slice(2).join(" "):void 0}catch{return}}var TB=1,GB="md-runbook-run",yc=["vscode","app-ios","app-android","app-web","cli"],Rc=["passed","failed","skipped","not-run","by-hand"],LB=120;var NB=20,Fc=/^[A-Za-z0-9._:-]{1,128}$/,$c=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/,Ic=/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?(Z|[+-]\d{2}:?\d{2})?$/i;function Kh(r){let e=Cs(r.ALERT??"");if(e==="")return;let t=r.ALERT_FINGERPRINT?.trim(),n={};for(let i of(r.ALERT_LABELS??"").split(",")){let o=i.indexOf("=");if(o<=0)continue;let B=i.slice(0,o).trim(),a=Cs(i.slice(o+1));$c.test(B)&&a!==""&&Object.keys(n).length<NB&&!(B in n)&&(n[B]=a)}let s=r.ALERT_STARTS_AT?.trim();return{name:e,...t&&Fc.test(t)?{fingerprint:t}:{},...s&&Ic.test(s)?{startsAt:s}:{},...Object.keys(n).length>0?{labels:n}:{}}}var Oc=r=>new Date(typeof r=="number"?r:r.getTime()).toISOString();function Cs(r){let e=r.replace(/\s+/g," ").trim();return e.length>LB?e.slice(0,LB-1)+"\u2026":e}function zh(r,e,t){let n=r.split(/[\\/]/).pop()||"runbook.md",s=Bn(e),i=_t(e),o;if(i)try{let B=_n(i.manifest);o={name:B.name,version:B.version,manifest:Yt(i.manifest),signer:t??i.signer,trusted:t!==void 0}}catch{o=void 0}return{file:n,...s?{title:Cs(s)}:{},sha256:Yt(Kt(e.replace(/^/,""))),...o?{signed:o}:{}}}function Tc(r){let e=typeof r.started=="number"?r.started:r.started.getTime(),t=Math.max(e,typeof r.ended=="number"?r.ended:r.ended.getTime()),n=r.steps.map((B,a)=>({n:a+1,label:Cs(B.label)||`Step ${a+1}`,state:B.state,...B.ms!==void 0&&Number.isFinite(B.ms)?{ms:Math.max(0,Math.round(B.ms))}:{}})),s=B=>n.filter(a=>a.state===B).length,i=r.alertParams?Kh(r.alertParams):void 0,o={steps:n.length,passed:s("passed"),failed:s("failed"),skipped:s("skipped"),notRun:s("not-run"),byHand:s("by-hand")};return{v:TB,runbook:zh(r.file,r.text,r.trustedSigner),who:Cs(r.who)||"unknown",client:r.client,started:Oc(e),ended:Oc(t),steps:n,ran:r.steps.flatMap((B,a)=>B.ran?[a+1]:[]),totals:o,green:n.length>0&&o.failed===0&&o.notRun===0,...r.stopped?{stopped:!0}:{},...i?{alert:i}:{}}}function qn(r){if(r===null||typeof r=="boolean"||typeof r=="string")return JSON.stringify(r);if(typeof r=="number"){if(!Number.isFinite(r))throw new Error("canonical JSON: not a finite number");return JSON.stringify(r)}if(Array.isArray(r))return"["+r.map(e=>e===void 0?"null":qn(e)).join(",")+"]";if(typeof r=="object"){let e=r;return"{"+Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>JSON.stringify(n)+":"+qn(e[n])).join(",")+"}"}throw new Error(`canonical JSON: can't write a ${typeof r}`)}var fn=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),Ac=/^[0-9a-f]{64}$/,qh=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?Z$/;function zn(r,e,t,n){for(let s of Object.keys(r))e.includes(s)||n.push(`${t}: unknown field "${s}"`)}function Yh(r){let e=[];if(!fn(r))return["not a JSON object"];if(r.v!==TB)return[`v: ${JSON.stringify(r.v)} is not a summary version this reads (${TB})`];zn(r,["v","runbook","who","client","started","ended","steps","ran","totals","green","stopped","alert"],"summary",e);let t=(o,B,a=LB)=>{(typeof o!="string"||o===""||o.length>a||/[\r\n]/.test(o))&&e.push(`${B}: expected one line of text (at most ${a})`)},n=r.runbook;if(!fn(n))e.push("runbook: missing");else if(zn(n,["file","title","sha256","signed"],"runbook",e),t(n.file,"runbook.file",255),typeof n.file=="string"&&/[\\/]/.test(n.file)&&e.push("runbook.file: a file name, without folders"),n.title!==void 0&&t(n.title,"runbook.title"),(typeof n.sha256!="string"||!Ac.test(n.sha256))&&e.push("runbook.sha256: expected 64 hex digits"),n.signed!==void 0){let o=n.signed;fn(o)?(zn(o,["name","version","manifest","signer","trusted"],"runbook.signed",e),t(o.name,"runbook.signed.name"),(!Number.isInteger(o.version)||o.version<1)&&e.push("runbook.signed.version: expected a positive whole number"),(typeof o.manifest!="string"||!Ac.test(o.manifest))&&e.push("runbook.signed.manifest: expected 64 hex digits"),t(o.signer,"runbook.signed.signer"),typeof o.trusted!="boolean"&&e.push("runbook.signed.trusted: expected true or false")):e.push("runbook.signed: expected an object")}t(r.who,"who"),yc.includes(r.client)||e.push(`client: expected one of ${yc.join(", ")}`);for(let o of["started","ended"])(typeof r[o]!="string"||!qh.test(r[o]))&&e.push(`${o}: expected an ISO 8601 UTC time`);Array.isArray(r.steps)?r.steps.forEach((o,B)=>{let a=`steps[${B}]`;if(!fn(o))return void e.push(`${a}: expected an object`);zn(o,["n","label","state","ms"],a,e),o.n!==B+1&&e.push(`${a}.n: expected ${B+1}`),t(o.label,`${a}.label`),Rc.includes(o.state)||e.push(`${a}.state: expected one of ${Rc.join(", ")}`),o.ms!==void 0&&(!Number.isInteger(o.ms)||o.ms<0)&&e.push(`${a}.ms: expected milliseconds`)}):e.push("steps: expected a list");let s=Array.isArray(r.steps)?r.steps.length:0;(!Array.isArray(r.ran)||!r.ran.every(o=>Number.isInteger(o)&&o>=1&&o<=s))&&e.push("ran: expected step numbers");let i=r.totals;if(!fn(i))e.push("totals: missing");else{zn(i,["steps","passed","failed","skipped","notRun","byHand"],"totals",e);for(let o of["steps","passed","failed","skipped","notRun","byHand"])(!Number.isInteger(i[o])||i[o]<0)&&e.push(`totals.${o}: expected a count`)}if(typeof r.green!="boolean"&&e.push("green: expected true or false"),r.stopped!==void 0&&r.stopped!==!0&&e.push("stopped: expected true, or absent"),r.alert!==void 0){let o=r.alert;if(!fn(o))e.push("alert: expected an object");else if(zn(o,["name","fingerprint","startsAt","labels"],"alert",e),o.startsAt!==void 0&&(typeof o.startsAt!="string"||!Ic.test(o.startsAt))&&e.push("alert.startsAt: expected a time (RFC 3339)"),t(o.name,"alert.name"),o.fingerprint!==void 0&&(typeof o.fingerprint!="string"||!Fc.test(o.fingerprint))&&e.push("alert.fingerprint: expected letters, digits and . _ : -"),o.labels!==void 0)if(!fn(o.labels)||Object.keys(o.labels).length>NB)e.push(`alert.labels: expected at most ${NB} name: value pairs`);else for(let[B,a]of Object.entries(o.labels))$c.test(B)||e.push(`alert.labels: "${B.slice(0,40)}" is not a label name`),t(a,`alert.labels.${B.slice(0,40)}`)}return e}function Mi(r,e){return qn(e?{summary:r,signature:e.signature,...e.signer?{signer:e.signer}:{}}:r)}function Lc(r){let e;try{e=JSON.parse(r)}catch(n){return{problems:[`not JSON: ${n instanceof Error?n.message:String(n)}`]}}if(!fn(e))return{problems:["not a JSON object"]};let t=[];return zn(e,["summary","signature","signer"],"envelope",t),(typeof e.signature!="string"||!/-----BEGIN SSH SIGNATURE-----[\s\S]+-----END SSH SIGNATURE-----/.test(e.signature))&&t.push("signature: expected an SSH signature (-----BEGIN SSH SIGNATURE-----)"),e.signer!==void 0&&typeof e.signer!="string"&&t.push("signer: expected text"),t.push(...Yh(e.summary).map(n=>`summary: ${n}`)),t.length>0?{problems:t}:{envelope:e}}function PB(r){let e=/^([a-z]+:\/\/[^/?#]+)/i.exec(r);return(e?e[1]:r).toLowerCase()}var MB=r=>PB(r).replace(/^[a-z]+:\/\//,"");function Qh(r){let e=ve(r);if(e?.reportRuns)return{url:e.reportRuns,required:e.reportRunsRequired===!0,signed:e.reportRunsSigned===!0,...e.reportRunsToken?{token:e.reportRunsToken}:{}}}function Wh(r,e,t=new Date){if(!_t(r))return"the runbook is not signed";let n=ot(r);if(!n)return"the signature block is damaged";if(n.version!==2)return"the signature covers only its blocks, not the front matter (signed before manifest version 2): sign the runbook again";if(n.textChanged)return"the runbook changed since signing: sign it again";let s=n.manifest.expires;if(s&&t.toISOString().slice(0,10)>s)return`the signature expired on ${s}`;if(e===void 0)return"the signature is not checked against signers this client trusts"}function Nc(r,e,t=new Date){let n=Qh(r);if(!n||Nn(n.url)!==void 0)return;let s=n.required||n.signed,i=s?Wh(r,e,t):void 0,o=s&&i===void 0;return{url:n.url,origin:PB(n.url),host:MB(n.url),required:o&&n.required,signed:o&&n.signed,...n.token?{token:n.token}:{},...i?{ignored:i}:{}}}var Mc="the runbook's file name, title and hash, your user name, this client, when the run started and ended, and each step's label, result and duration. Never outputs, parameter or input values, or secrets.";function Gc(r,e){let t=PB(r),n=MB(r).replace(/:\d+$/,"");return e.some(s=>{let i=s.trim().toLowerCase();return i===""?!1:i.includes("://")?i===t||i===t+"/"?!0:r.toLowerCase().startsWith(i.endsWith("/")?i:i+"/")||r.toLowerCase()===i:i===n||i===MB(r)})}var PD=168*36e5,Vh=1e4;async function Pc(r){let e=r.fetch??globalThis.fetch;if(!e)return{ok:!1,retry:!1,why:"no fetch here"};let t=new AbortController,n=setTimeout(()=>t.abort(),r.timeoutMs??Vh);try{let s=await e(r.url,{method:"POST",headers:{"content-type":"application/json",...r.token?{authorization:`Bearer ${r.token}`}:{}},body:r.body,signal:t.signal,redirect:"error"});return s.ok?{ok:!0}:{ok:!1,retry:s.status===408||s.status===429||s.status>=500||s.status<400,why:`the server answered ${s.status}`}}catch(s){return{ok:!1,retry:!0,why:t.signal.aborted?"no answer in time":s instanceof Error?s.message:String(s)}}finally{clearTimeout(n)}}async function HB(r,e,t="ssh-keygen"){let n=_t(r);if(n)for(let s of br(n))try{return await Wt(n.manifest,s,e,t)}catch{}}async function _B(r,e,t={}){return Si(await Kn(qn(r),e,{...t,namespace:GB}))}async function JB(r,e,t="ssh-keygen"){let n=Lc(r);if("problems"in n)throw new Error(`not a signed run summary:
|
|
232
|
+
${n.problems.map(o=>` ${o}`).join(`
|
|
233
|
+
`)}`);let s=n.envelope.signature.replace(/-----(BEGIN|END) SSH SIGNATURE-----/g,"").replace(/\s+/g,"");return{signer:await Wt(qn(n.envelope.summary),s,e,t,GB),envelope:n.envelope}}var dn=le(require("node:fs")),Hc=le(require("node:path")),_c=10*1024*1024,Zh=100,gs=class{constructor(e,t,n=_c,s=Zh){this.file=e;this.onError=t;this.maxBytes=n;this.batchMs=s}file;onError;maxBytes;batchMs;pending="";timer;failed=!1;append(e){this.failed||e===""||(this.pending+=e,this.timer===void 0&&(this.timer=setTimeout(()=>this.flush(),this.batchMs),this.timer.unref?.()))}flush(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0;let e=this.pending;if(this.pending="",!(this.failed||e===""))try{dn.mkdirSync(Hc.dirname(this.file),{recursive:!0});let t=0;try{t=dn.statSync(this.file).size}catch{}t>0&&t+Buffer.byteLength(e)>this.maxBytes&&dn.renameSync(this.file,`${this.file}.1`),dn.appendFileSync(this.file,e,"utf8")}catch(t){this.failed=!0,this.onError?.(t instanceof Error?t:new Error(String(t)))}}};var Te=le(require("node:fs")),Re=le(require("node:path")),Jc=require("node:crypto");function Jt(r,e){return Re.resolve(Re.dirname(Re.resolve(r)),e)}function ms(r,e){return Re.relative(Re.dirname(Re.resolve(r)),e).split(Re.sep).join("/")}function vr(r,e){let t=n=>{let s=Re.resolve(n);try{s=Te.realpathSync.native(s)}catch{}return process.platform==="linux"?s:s.toLowerCase()};return t(r)===t(e)}function UB(r){return e=>{try{let t=Jt(r,e);return Te.statSync(t).isFile()?Te.readFileSync(t,"utf8"):void 0}catch{return}}}function jB(r,e){let t=e.split(/[\\/]+/).filter(o=>o!==""&&o!=="."),n=o=>new RegExp(`^${o.replace(/[.+^${}()|[\]\\?]/g,"\\$&").replace(/\*/g,".*")}$`,process.platform==="linux"?"":"i"),s=[Re.dirname(Re.resolve(r))],i=[];return t.forEach((o,B)=>{let a=B===t.length-1,c=[];for(let l of s){if(!o.includes("*")){let f=Re.join(l,o);Te.existsSync(f)&&c.push(f);continue}let u=[];try{u=Te.readdirSync(l)}catch{continue}for(let f of u)n(o).test(f)&&!/\.\d{8}-\d{6}(?:-\d+)?\.md$/i.test(f)&&c.push(Re.join(l,f))}a?i.push(...c.filter(l=>Te.statSync(l).isFile())):s=c.filter(l=>Te.statSync(l).isDirectory())}),i.map(o=>ms(r,o)).sort()}function KB(r,e,t,n=new Date){let s=t?Re.resolve(Re.dirname(r),t):Re.dirname(r);Te.mkdirSync(s,{recursive:!0});let i=Eo(Re.basename(r),n),o=Re.join(s,i);for(let c=2;Te.existsSync(o);c++)o=Re.join(s,i.replace(/\.md$/i,`-${c}.md`));let B=Ko(e),a=Kt(Te.readFileSync(r,"utf8"));return Te.writeFileSync(o,Object.keys(B).length?El(a,B):a,"utf8"),o}function Es(r,e,t){return Wo(e,t,(s,i)=>{let o=Jt(i??r,s);try{return{text:Te.readFileSync(o,"utf8"),at:o}}catch{return}},Mn())}function zB(r){return(0,Jc.createHash)("sha256").update(Te.readFileSync(r)).digest("hex")}var Dt=le(require("node:fs")),vs=le(require("node:os")),We=le(require("node:path"));var Uc=["\\b(delete|drain|cordon|scale\\s+.*--replicas=0)\\b","\\brm\\s+-[a-z]*r[a-z]*f","--force\\b","\\bRemove-Item\\b.*-Recurse","\\bdrop\\s+(table|database)\\b","\\brollout\\s+(restart|undo)\\b","(?<![-.])\\bpatch\\b","(?<![-.])\\bapply\\b","(?<![-.])\\breplace\\b","\\badm\\s+policy\\s+(add|remove)","\\bset\\s+(env|image|resources)\\b","\\bhelm\\s+(upgrade|rollback|uninstall)\\b","\\bcurl\\b.*(-X\\s*|--request[\\s=]+)(PUT|POST|PATCH|DELETE)\\b","\\bInvoke-(RestMethod|WebRequest)\\b.*-Method\\s+(Put|Post|Patch|Delete)\\b"];function jc(r){let e=[],t=[];for(let n of r)try{e.push(new RegExp(n,"i"))}catch(s){t.push(`${n}: ${s instanceof Error?s.message:String(s)}`)}return{regexes:e,errors:t}}function Xh(r,e){let t;for(let n of e){let s=n.exec(r);s&&(!t||s.index<t.index)&&(t=s)}return t?.[0]}function qB(r,e,t,n){if(n===!1||n===void 0&&e==="never")return;let s=Xh(r,t);return s!==void 0?s:n===!0||e==="always"?"":void 0}function YB(r){let e=nn(r),t=r.slice(r.toLowerCase().indexOf(e)+e.length),n={state:"none"},s=!1;for(let i of on(t)){let o=i.key.toLowerCase();o==="proposed"&&i.value===void 0?s=!0:o==="by"&&i.value?n.by=i.value:o==="reason"&&i.value!==void 0?n.reason=i.value:o==="approved-by"&&i.value?n.approvedBy=i.value:o==="approved-at"&&i.value&&(n.approvedAt=i.value)}return n.state=s?"proposed":n.approvedBy?"approved":n.by?"proposed":"none",n}var zc=require("node:child_process"),qc=require("node:crypto"),Vt=le(require("node:fs")),Yc=le(require("node:os")),Yn=le(require("node:path")),WB=require("node:string_decoder");var eC=1e3,bs="MD_RUNBOOK_SESSION_DIR",Gi="MD_RUNBOOK_TERM",Qc="__mdrbCellCwd",Kc=r=>"'"+r.replace(/'/g,"'\\''")+"'",QB=r=>"'"+r.replace(/['‘’‚‛]/g,"$&$&")+"'";function tC(r,e){return r.kind==="bash"?["-s"]:["-NoLogo","-NoProfile","-NonInteractive",...e==="win32"?["-ExecutionPolicy","Bypass"]:[],"-Command","-"]}function nC(r){return r==="bash"?`__mdrb_dir=$${bs}; unset ${bs}
|
|
234
|
+
`:`$__mdrbDir = $env:${bs}; Remove-Item Env:${bs} -ErrorAction Ignore; if ($env:${Gi}) { $env:TERM = $env:${Gi} } else { Remove-Item Env:TERM -ErrorAction Ignore }; Remove-Item Env:${Gi} -ErrorAction Ignore; [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; $OutputEncoding = New-Object System.Text.UTF8Encoding $false
|
|
235
|
+
`}function rC(r,e,t,n){let s=`__MDRB_${e}__`;if(r==="bash"){let B=`"$__mdrb_dir/${e}.pre${t}"`,a=`. "$__mdrb_dir/${e}${t}" </dev/null; __mdrb_rc=$?`;return(n?`__mdrb_cd=; if . ${B} </dev/null; then rm -f ${B} 2>/dev/null; ${a}; else __mdrb_rc=$?; rm -f ${B} 2>/dev/null; fi; if [ -n "$__mdrb_cd" ]; then cd -- "$__mdrb_cd" 2>/dev/null; __mdrb_cd=; fi; `:`${a}; `)+`printf '\\036%s %s\\n' ${s} "$__mdrb_rc"; printf '\\036%s %s\\n' ${s} "$__mdrb_rc" >&2
|
|
230
236
|
`}let i=`"$__mdrbDir/${e}.pre${t}"`;return`$global:LASTEXITCODE = 0; $__mdrbOk = $false; $__mdrbPushed = $false; ${n?`. ${i}; Remove-Item -LiteralPath ${i} -Force -ErrorAction Ignore; `:""}. "$__mdrbDir/${e}${t}"; $__mdrbOk = $?
|
|
231
|
-
if ($__mdrbPushed) { Pop-Location -StackName ${
|
|
232
|
-
`}function
|
|
233
|
-
`)}var
|
|
234
|
-
`),i=this.start(s.shell,e.baseCwd??e.cwd,n));let
|
|
235
|
-
`);let{ended:a,...c}=
|
|
236
|
-
`;if(r.command!==void 0&&r.command.trim()!==""){let
|
|
237
|
+
if ($__mdrbPushed) { Pop-Location -StackName ${Qc} -ErrorAction Ignore; $__mdrbPushed = $false }; $__mdrbRc = if ($LASTEXITCODE) { $LASTEXITCODE } elseif (-not $__mdrbOk) { 1 } else { 0 }; $__mdrbS = [string][char]30 + "${s} $__mdrbRc\`n"; [Console]::Out.Write($__mdrbS); [Console]::Error.Write($__mdrbS)
|
|
238
|
+
`}function sC(r,e,t,n=process.platform){let s=[];for(let[i,o]of Object.entries(e))r==="pwsh"?s.push(`[Environment]::SetEnvironmentVariable(${QB(i)}, ${QB(o)})`):/^[A-Za-z_][A-Za-z0-9_]*$/.test(i)&&s.push(`export ${i}=${Kc(o)}`);return t!==void 0&&(r==="pwsh"?s.push(`Push-Location -LiteralPath ${QB(t)} -StackName ${Qc} -ErrorAction Stop`,"$__mdrbPushed = $true"):s.push("__mdrb_cd=$PWD",`cd -- ${Kc(n==="win32"?t.replace(/\\/g,"/"):t)} || return 1`)),s.join(`
|
|
239
|
+
`)}var VB=class{constructor(e,t,n=process.platform,s=process.env){this.shell=e;this.cwd=t;this.platform=n;this.dir=Vt.mkdtempSync(Yn.join(Yc.tmpdir(),"md-runbook-session-"));let i=n==="win32"&&e.kind==="bash"?this.dir.replace(/\\/g,"/"):this.dir,o={...s,[bs]:i};e.kind==="pwsh"&&(o[Gi]=o.TERM??"",o.TERM="dumb"),this.child=(0,zc.spawn)(e.command,tC(e,n),{cwd:t,env:o,stdio:["pipe","pipe","pipe"],windowsHide:!0,detached:n!=="win32"}),this.child.stdout.on("data",B=>this.deliver("out",this.outDec.write(B))),this.child.stderr.on("data",B=>this.deliver("err",this.errDec.write(B))),this.child.stdin.on("error",()=>{}),this.child.on("error",B=>{this.startError=B.message,this.end(null,null)}),this.child.on("close",(B,a)=>this.end(B,a)),this.child.on("exit",(B,a)=>setTimeout(()=>this.end(B,a),eC).unref()),this.child.stdin.write(nC(e.kind))}shell;cwd;platform;child;dir;ended=!1;killed=!1;startError;current;outDec=new WB.StringDecoder("utf8");errDec=new WB.StringDecoder("utf8");onDidEnd=()=>{};get alive(){return!this.ended&&!this.killed}get pid(){return this.child.pid}run(e){let t=Date.now();return new Promise(n=>{let s=!1,i=!1,o=!1,B,a=[],c=(D,m)=>{if(!o){o=!0,clearTimeout(B),e.signal?.removeEventListener("abort",l),this.current=void 0;for(let b of a)try{Vt.rmSync(b,{force:!0})}catch{}n({...D,timedOut:s,cancelled:i,ended:m,durationMs:Date.now()-t})}},l=()=>{i=!0,this.kill()};if(!this.alive)return c({exitCode:null,signal:null,error:this.startError??"The session has ended."},!0);if(this.current)return c({exitCode:null,signal:null,error:"The session is busy."},!1);if(e.signal?.aborted)return i=!0,c({exitCode:null,signal:null},!1);let u=(0,qc.randomBytes)(12).toString("hex"),f=this.shell.extension,d=e.env??{},h=Object.keys(d).length>0||e.cwd!==void 0;try{let D=Yn.join(this.dir,u+f);if(a.push(D),Vt.writeFileSync(D,this.shell.script(e.source),"utf8"),h){let m=Yn.join(this.dir,`${u}.pre${f}`);a.push(m),Vt.writeFileSync(m,this.shell.script(sC(this.shell.kind,d,e.cwd,this.platform)),{encoding:"utf8",mode:384})}}catch(D){return c({exitCode:null,signal:null,error:D instanceof Error?D.message:String(D)},!1)}let p=new yn(`__MDRB_${u}__`,e.onStdout),w=new yn(`__MDRB_${u}__`,e.onStderr);this.current={out:p,err:w,check:()=>{p.done&&w.done&&c({exitCode:p.code,signal:null},!1)},onExit:(D,m)=>{p.flush(),w.flush(),c({exitCode:D,signal:m,error:this.startError},!0)}},e.signal?.addEventListener("abort",l),e.timeoutMs>0&&(B=setTimeout(()=>{s=!0,this.kill()},e.timeoutMs)),this.child.stdin.write(rC(this.shell.kind,u,f,h))})}kill(){this.killed||this.ended||(this.killed=!0,this.child.pid!==void 0&&Fi(this.child.pid,this.platform))}dispose(){this.kill(),this.ended&&this.cleanup()}deliver(e,t){let n=this.current;!n||t===""||(n[e].write(t),n.check())}end(e,t){this.ended||(this.ended=!0,this.deliver("out",this.outDec.end()),this.deliver("err",this.errDec.end()),this.current?.onExit(e,t),this.cleanup(),this.onDidEnd())}cleanup(){Vt.rm(this.dir,{recursive:!0,force:!0},()=>{})}},Pi=class{constructor(e=()=>{},t=ln(),n=" session"){this.onChange=e;this.shellEnv=t;this.labelSuffix=n}onChange;shellEnv;labelSuffix;sessions=new Map;started=new Set;settings={};labels(){return[...this.sessions.values()].filter(e=>e.alive).map(e=>e.shell.label)}session(e){let t=this.sessions.get(e);return t?.alive?t:void 0}async execute(e){let t=$e(e.language);if(t===void 0||t==="cmd")return Un(e,this.shellEnv);this.settings=e.settings;let n=await fs(e.settings,void 0,this.shellEnv.platform),s=Jn(t,e.settings,Ii(this.shellEnv,n));if(!s.ok)return Un(e,this.shellEnv);let i=this.sessions.get(t);i&&(!i.alive||i.shell.command!==s.shell.command)&&(i.dispose(),i=void 0),i||(this.started.has(t)&&e.onStdout(`[md-runbook] new session started
|
|
240
|
+
`),i=this.start(s.shell,e.baseCwd??e.cwd,n));let o=Yn.resolve(e.cwd)===Yn.resolve(i.cwd)?void 0:e.cwd,B=await i.run({source:e.source,env:e.env,cwd:o,timeoutMs:e.timeoutMs,signal:e.signal,onStdout:e.onStdout,onStderr:e.onStderr});B.ended&&!B.cancelled&&!B.timedOut&&B.error===void 0&&e.onStderr(`[md-runbook] session ended (exit ${B.exitCode??B.signal}); the next cell starts a new session
|
|
241
|
+
`);let{ended:a,...c}=B;return{...c,shell:{...s.shell,label:s.shell.label+this.labelSuffix}}}async restart(){let e=[...this.sessions.values()].filter(n=>n.alive);if(e.length===0)return[];let t=await fs(this.settings,void 0,this.shellEnv.platform);for(let n of e)n.dispose(),this.start(n.shell,n.cwd,t);return e.map(n=>n.shell.label)}stop(){let e=this.labels();for(let t of this.sessions.values())t.dispose();return this.sessions.clear(),this.onChange(),e}dispose(){this.stop()}start(e,t,n){let s=new VB(e,t,this.shellEnv.platform,n);return s.onDidEnd=()=>{this.sessions.get(e.kind)===s&&this.sessions.delete(e.kind),this.onChange()},this.sessions.set(e.kind,s),this.started.add(e.kind),this.onChange(),s}};function iC(r){let e=Math.max(0,Math.round(r));return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m${Math.round(e%6e4/1e3)}s`}var Wc=r=>r.replace(/\s*[\r\n]+\s*/g," ").trim();function oC(r,e){let t=r.step!==void 0?`Step ${r.step}`:void 0,n=r.line!==void 0?`${r.runbook}:${r.line}`:r.runbook,s=[Ie(r.at),n,t,r.section,r.title].filter(o=>o!==void 0&&o.trim()!==""),i=`===== ${e(s.map(Wc).join(" \xB7 "))}
|
|
242
|
+
`;if(r.command!==void 0&&r.command.trim()!==""){let o=e(Rt(r.command).replace(/\r\n?/g,`
|
|
237
243
|
`).replace(/\n+$/,"")).split(`
|
|
238
|
-
`);i+=
|
|
244
|
+
`);i+=o.map(B=>`$ ${B}`).join(`
|
|
239
245
|
`)+`
|
|
240
|
-
`}return i}function
|
|
246
|
+
`}return i}function BC(r){return`===== ${[`exit=${r.exit}`,iC(r.durationMs),r.check&&`check ${r.check==="ok"?"passed":"failed"}`,r.attempt!==void 0&&r.attempts!==void 0&&r.attempts>1&&`attempt ${r.attempt}/${r.attempts}`,r.lines&&`lines ${r.lines}`].filter(Boolean).join(" \xB7 ")}
|
|
241
247
|
|
|
242
|
-
`}function
|
|
248
|
+
`}function Vc(r,e,t,n){return`===== ${n(Wc(`${Ie(r)} \xB7 ${e} \xB7 ${t}`))}
|
|
243
249
|
|
|
244
|
-
`}var
|
|
245
|
-
`)))),i=
|
|
246
|
-
`))}end(e){this.ended||(this.release(),this.ended=!0,this.write(
|
|
250
|
+
`}var aC={stdout:"| ",stderr:"! "},Hi=class{constructor(e,t,n=!1){this.write=e;this.redact=t;this.hold=n;let s=o=>this.redact(Rt(Lr(o.replace(/\r\n/g,`
|
|
251
|
+
`)))),i=o=>new Sn(B=>this.lines(o,B),s);this.buffers={stdout:i("stdout"),stderr:i("stderr")}}write;redact;hold;buffers;carry={stdout:"",stderr:""};held=[];ended=!1;start(e){this.write(oC(e,this.redact))}out(e,t){this.ended||t===""||(this.hold?this.held.push({stream:e,text:t}):this.buffers[e].write(t))}attempt(e,t,n){this.ended||(this.release(),this.write(`----- attempt ${e}/${t} \xB7 ${Ie(n)}
|
|
252
|
+
`))}end(e){this.ended||(this.release(),this.ended=!0,this.write(BC(e)))}release(){for(let e of this.held.splice(0))this.buffers[e.stream].write(e.text);for(let e of["stdout","stderr"])this.buffers[e].flush(),this.carry[e]!==""&&this.lines(e,`
|
|
247
253
|
`)}lines(e,t){let n=(this.carry[e]+t).split(`
|
|
248
|
-
`);this.carry[e]=n.pop(),n.length>0&&this.write(n.map(s=>
|
|
254
|
+
`);this.carry[e]=n.pop(),n.length>0&&this.write(n.map(s=>aC[e]+s).join(`
|
|
249
255
|
`)+`
|
|
250
|
-
`)}};var
|
|
251
|
-
${
|
|
252
|
-
`)}`);e.log(`\u2713 signed${
|
|
256
|
+
`)}};var gt=class extends Error{},ZB=Pn;function Zc(r){let e=[...r].sort((n,s)=>n-s),t=[];for(let n=0;n<e.length;){let s=n;for(;s+1<e.length&&e[s+1]===e[s]+1;)s++;t.push(s===n?`${e[n]}`:`${e[n]}\u2013${e[s]}`),n=s+1}return t.join(", ")}function Ds(r){return[...r.from!==void 0?[`--from ${r.from}`]:[],...r.to!==void 0?[`--to ${r.to}`]:[],...(r.sections??[]).map(e=>`--section ${JSON.stringify(e)}`)].join(" ")}function Xc(r,e,t,n,s=[]){let i=tf(r,t,n);if(!i)return;let o=new Set;if(e.forEach((B,a)=>{let c=t[a];i(c,B.line)&&o.add(c)}),o.size===0&&!s.some(B=>i(Math.max(B.step,1),B.line)))throw new gt(`${Ds(n)} selects no step`);return o}function ef(r,e,t,n){let s=tf(r,e,t);return s?n.filter(i=>s(Math.max(i.step,1),i.line)):[...n]}function tf(r,e,t){let n=t.sections??[];if(t.from===void 0&&t.to===void 0&&n.length===0)return;let s=Math.max(0,...e);for(let[a,c]of[["--from",t.from],["--to",t.to]])if(c!==void 0&&(c<1||c>s))throw new gt(`${a} ${c} is outside the runbook: it has ${s===0?"no steps":s===1?"one step":`steps 1 to ${s}`}`);if(t.from!==void 0&&t.to!==void 0&&t.from>t.to)throw new gt(`--from ${t.from} is after --to ${t.to}`);let i=t.from??1,o=t.to??s,B=()=>!0;if(n.length>0){let a=ZB(r),c=li(a,n);if(c.length>0)throw new gt(`no heading starts with ${c.map(u=>JSON.stringify(u)).join(", ")} (--section matches the heading text after the #s, case-sensitive)`);let l=ci(a,n);if(l){let u=l.other!==void 0?`; for ${JSON.stringify(l.other)}, give more of it, e.g. --section ${JSON.stringify(l.other.split(/\s+/).slice(0,2).join(" "))}`:"";throw new gt(`--section ${JSON.stringify(l.section)} matches the runbook's title ${JSON.stringify(l.title)}, which holds every step${u}`)}B=Hn(a,n)}return(a,c)=>a>=i&&a<=o&&B(c)}function nf(r,e){let t=[];return r.forEach((n,s)=>{if(n.runs)for(let i of new Set(n.uses)){let o=r.slice(0,s).filter(a=>a.captures.includes(i));if(o.length===0||o.some(a=>a.selected))continue;let B=o[o.length-1];t.push(`step ${n.n} (${e}:${n.loc.line+1}) uses \${out:${i}}, captured by step ${B.n} (${e}:${B.loc.line+1}), which is not selected`)}}),t}var ws=le(require("node:fs")),Le=le(require("node:path"));function _i(r){let e=Le.dirname(Le.resolve(r));for(;;){if(ws.existsSync(Le.join(e,".git")))return e;let t=Le.dirname(e);if(t===e)return Le.dirname(Le.resolve(r));e=t}}function ks(r,e){let t=Le.relative(r,Le.resolve(e));return t!==""&&!t.startsWith("..")&&!Le.isAbsolute(t)}function uC(r,e){try{return new RegExp(`^(?:${e})$`).test(r)&&!/[\r\n]/.test(r)}catch{return!1}}var lC=()=>new Date().toISOString().slice(0,10);async function xs(r,e,t,n,s={}){let i=s.shown??Le.basename(r),o=[],B=D=>{o.push(`${i}: ${D}`)},a=ws.readFileSync(r,"utf8"),c=ot(a);if(!c)return B(/<!-- md-runbook:signature/.test(a)?"the signature block is damaged":"not signed (md-runbook sign)"),{problems:o};let l=c.manifest,u,f=[];for(let D of br(c.block))try{u=await Wt(c.block.manifest,D,t,s.sshKeygen);break}catch(m){f.push(m instanceof Error?m.message:String(m))}u||B(`its signature is not good: ${f.join("; ")}`),l.expires&&l.expires<lC()&&B(`its signature expired on ${l.expires}`);let d=new Map(ft(he(a)).map(D=>[D.cellIndex,D.line+1]));for(let D of c.changed)B(`line ${d.get(D)??"?"}: changed since signing (or never signed)`);for(let D of c.moved)B(`line ${d.get(D)??"?"}: moved since signing`);c.missing.length&&B(`signed block${c.missing.length===1?"":"s"} ${c.missing.join(", ")} not in the file as signed`),c.missingCalls.length&&B(`signed runbook call${c.missingCalls.length===1?"":"s"} ${c.missingCalls.join(", ")} not in the file as signed`),he(a).cells.forEach((D,m)=>{if(D.kind!=="code"||!ce(D.meta))return;let b=me(D.meta.info);if(b.skip||b.host||b.os&&!b.os.includes(Mn()))return;let v=$e(D.languageId);v&&v!=="bash"&&B(`line ${d.get(m)??"?"}: a ${D.meta.lang} block is never signed (only bash/sh blocks are): it can't run in a signed run`)});let p=ve(a),w=D=>e[D]??p?.params.find(m=>m.name===D)?.default;for(let[D,m]of Object.entries(l.patterns)){let b=w(D);b!==void 0&&!uC(b,m)&&B(`${D}=${JSON.stringify(b)} doesn't match its signed pattern ${m}`)}if((s.depth??0)<3)for(let[D,m]of c.calls){let b=et(m.info,m.body);if(b.src===void 0||!Mt(b).every(y=>y.kind==="param"&&w(y.name)!==void 0))continue;let R=y=>{let O=fi(y,(P,X)=>w(X));return"text"in O?O.text:y},S=Jt(r,R(b.src)),I=`line ${d.get(D)??"?"}: the runbook call of ${R(b.src)}`;if(!ks(n,S)){B(`${I} leaves the repository (${n}): a signed runbook calls runbooks in its own repository`);continue}if(!ws.existsSync(S)){B(`${I}: no such runbook`);continue}if(vr(S,r))continue;let x={};for(let y of b.args)x[y.name]=R(y.value);let E=await xs(S,x,t,n,{...s,shown:Le.relative(Le.dirname(r),S).split(Le.sep).join("/"),depth:(s.depth??0)+1});o.push(...E.problems)}return{problems:o,...u?{signer:u}:{}}}var cC=4,fC=(r,e)=>new Promise(t=>{if(e?.aborted)return t(!1);let n=setTimeout(()=>t(!0),r);e?.addEventListener("abort",()=>(clearTimeout(n),t(!1)),{once:!0})});async function XB(r,e){let t=Dt.readFileSync(r.file,"utf8"),n=r.allowedSigners?r.signedRoot??_i(r.file):void 0;if(r.allowedSigners&&n){let T=await xs(r.file,r.params,r.allowedSigners,n);if(T.problems.length>0)throw new gt(`not run as signed (--allowed-signers ${r.allowedSigners}); nothing ran:
|
|
257
|
+
${T.problems.map(_=>` ${_}`).join(`
|
|
258
|
+
`)}`);e.log(`\u2713 signed${T.signer?` by ${T.signer}`:""}, unchanged, parameters as signed`)}let s=We.basename(r.file),i=We.dirname(We.resolve(r.file)),o=ve(t),B=r.inheritKubeContext,a=B&&!o?.kubeContext?{params:[],...o,kubeContext:B.context,...B.mode&&!o?.kubeContextMode?{kubeContextMode:B.mode}:{}}:o,c=a?.cwd?We.resolve(i,a.cwd):i,l=r.session??a?.mode==="session",u=new ps,f=new Set,d=wo(Do),h=T=>{let _=d.redact(T);for(let fe of[...f].sort((de,ne)=>ne.length-de.length))_=_.split(fe).join(Br);return _},p=T=>{T.length>=cC&&f.add(T)},w={persistOutputs:!0,maxOutputLines:2e3,stripAnsi:!0,redact:h},{regexes:D}=jc(Uc),m=new Map,b=t,v=he(t),R=ft(v);for(let T of r.extraSecrets??[])p(T);for(let T of R){let _=Ge(T.language);if(!$e(T.language)&&!_)continue;let fe=[];try{fe=_?Mt(et(T.info,T.source)):Xe(T.source)}catch{continue}for(let de of fe){if(!de.secret)continue;let ne=de.kind==="secret"?r.env[de.name]:de.kind==="input"?r.inputs[de.name]??r.env[de.name]:void 0;ne!==void 0&&p(ne)}}let S=v.cells.map(T=>T.kind==="code"?{kind:"code",os:me(T.meta.kind==="code"?T.meta.info:"").os}:{kind:"markup"}),I=Gn(S),x=new Set(I.filter(T=>T?.active).map(T=>T.group)),E=sn(S),y=R.map(T=>E[T.cellIndex]),O={...r.from!==void 0?{from:r.from}:{},...r.to!==void 0?{to:r.to}:{},...r.sections?.length?{sections:r.sections}:{}},P=t.split(/\r?\n/),X=Ur(t).map(T=>{let _=-1;return R.forEach((fe,de)=>{fe.line<T.line&&(_=de)}),{line:T.line,step:_>=0?y[_]:0,after:_,text:(P[T.line]??"").replace(/^.*?\[[ xX]\][ \t]*/,"").trim(),ticked:T.checked}}),q=Xc(t,R,y,O,X),W=kB(R),ee=W.ready,Y=T=>W.parts[T]??"body",se=r.setup??"auto",te=r.teardown??"no",Se=T=>ee!==void 0&&T!==ee&&se==="auto"&&(r.readyFirst?!0:Y(T)==="setup");q&&(r.addSetup&&R.forEach((T,_)=>{(Y(_)==="setup"||_===ee)&&q.add(y[_])}),r.readyFirst&&ee!==void 0&&q.add(y[ee]));let ge=ef(t,y,O,X),Ue=new Set,De=T=>{for(let _ of ge)_.after!==T||_.ticked||Ue.has(_.line)||(Ue.add(_.line),e.log(`\u2610 manual, not ticked \xB7 ${s}:${_.line+1} \xB7 ${h(_.text)}`))},be=R.map((T,_)=>{let fe=me(T.info),de=I[T.cellIndex],ne=YB(T.info),at=[];try{at=(Ge(T.language)?Mt(et(T.info,T.source)):gr(T.source,T.info,a)).filter(St=>St.kind==="out").map(St=>St.name)}catch{}let gn=!q||q.has(y[_]);return{n:y[_],loc:T,selected:gn,runs:gn&&(!de||de.active)&&!fe.host&&!fe.skip&&fe.errors.length===0&&ne.state!=="proposed"&&ne.by===void 0&&!(Y(_)==="teardown"&&te==="no")&&!(Y(_)==="setup"&&se==="never")&&!(_===ee&&se!=="auto"),uses:at,captures:(fe.checks?.captures??[]).map(St=>St.name)}}),$=nf(be,s);if($.length>0)throw new gt(`${$.join(`
|
|
253
259
|
`)}
|
|
254
|
-
select the step that captures it too (a run starts without captured values); nothing ran`);if(!r.yes&&!r.keepGoing){let
|
|
255
|
-
${
|
|
260
|
+
select the step that captures it too (a run starts without captured values); nothing ran`);if(!r.yes&&!r.keepGoing){let T=be.flatMap(_=>{if(!_.runs)return[];let fe=me(_.loc.info),de=qB(Ge(_.loc.language)?"":_.loc.source,"patterns",D,fe.confirm===!0?!0:void 0);if(de===void 0)return[];let ne=_.loc.source.split(/\r?\n/).find(at=>at.trim()!=="")?.trim()??"";return[` Step ${_.n} \xB7 ${s}:${_.loc.line+1} \xB7 ${h(fe.name??ne)}: ${de===""?"confirm option":`risky command \u201C${de.trim()}\u201D`}`]});if(T.length>0){let _=T.length===1;throw new gt(`${_?"a step asks":`${T.length} steps ask`} for confirmation in VS Code and ${_?"needs":"need"} --yes here; nothing ran:
|
|
261
|
+
${T.join(`
|
|
256
262
|
`)}
|
|
257
|
-
pass --yes to run ${_?"it":"them"}`)}}
|
|
258
|
-
`,attrs:{exit:"skipped",ran:
|
|
259
|
-
`,attrs:{exit:"
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
`),
|
|
263
|
-
`)
|
|
264
|
-
`)
|
|
265
|
-
|
|
263
|
+
pass --yes to run ${_?"it":"them"}`)}}q&&e.log(q.size===0?`No block selected (${Ds(O)}): manual steps only`:`Step${q.size===1?"":"s"} ${Zc([...q])} of ${Math.max(0,...y)} (${Ds(O)})`);let M=`not selected (${Ds(O)})`,A=l?new Pi:void 0,G=r.transcript?new gs(We.resolve(r.transcript),T=>e.log(`! the transcript ${r.transcript} can't be written, so it stops: ${T.message}`)):void 0,H=r.stepPrefix??"",U=ZB(t),Q=T=>[...U].reverse().find(_=>_.line<T)?.text,z=(T,_,fe)=>{G?.append(Vc(new Date,s,`Step ${H}${T} \xB7 ${_}: ${fe}`,h)),G?.flush()},ue=T=>{let _,fe=T.secret;if(T.kind==="secret")_=r.env[T.name];else if(T.kind==="input")_=r.inputs[T.name]??r.env[T.name];else if(T.kind==="param")_=r.params[T.name]??a?.params.find(de=>de.name===T.name)?.default;else{let de=m.get(T.name);_=de?.value,fe=de?.secret??!1}return _!==void 0?{value:_,secret:fe}:{missing:T.kind==="secret"?`\${secret:${T.name}}: set the environment variable ${T.name}`:T.kind==="input"?`\${input:${T.name}}: pass --input ${T.name}=\u2026 or set the environment variable ${T.name}`:T.kind==="param"?r.callers?`\${param:${T.name}}: the runbook call doesn't pass ${T.name} (${T.name}=\u2026 in its block), and it has no default`:`\${param:${T.name}}: pass --param ${T.name}=\u2026 (it has no default)`:`\${out:${T.name}} has no value yet; run the cell with capture=${T.name} first`}},ke=new Set,V=[],Me=!1,tt=be.flatMap((T,_)=>T.runs||Y(_)==="teardown"&&T.selected?[_]:[]),Wn=R.map(T=>Ge(T.language)?Es(r.file,T.info,T.source):me(T.info).estimateSeconds),Zt=new Set,Cn,Xt=[],en=0,jf=T=>{let _=Y(T);return _==="setup"||_==="teardown"?{part:_}:{}},Kf=()=>{let T=Qo(tt.filter(fe=>fe!==ee).map(fe=>({estimateSeconds:Wn[fe],state:Zt.has(fe)?"done":"pending",...jf(fe)})),{setup:ee===void 0||se!=="auto"?"run":Cn===void 0?"unchecked":Cn?"up":"run",teardown:te==="no"?"offered":"chosen"}),_=gi(T,0);if(_!==void 0)return gi(T,Yo(process.stdout.isTTY?process.stdout.columns:void 0,_.length))},Or=[...R.keys()];ee!==void 0&&be.some((T,_)=>_<ee&&T.runs&&Se(_))&&(Or.splice(Or.indexOf(ee),1),Or.unshift(ee));let oa=T=>h(r.readyFirst?Bn(t)??s:T.name??Bn(t)??s);try{for(let T of Or){let _=R[T];De(T-1);let fe=I[_.cellIndex];if(fe&&ke.has(fe.group)){if(!fe.active)continue}else fe&&ke.add(fe.group);let de=y[T],ne=me(_.info),at=Y(T),gn=T===ee,St=_.source.split(/\r?\n/).find(K=>K.trim()!=="")?.trim()??"",ut=(K,Oe,nt={})=>({step:de,line:_.line+1,language:_.language,title:h(ne.name??St),status:K,exit:Oe,durationMs:0,...ne.estimateSeconds!==void 0?{estimateSeconds:ne.estimateSeconds}:{},output:"",...W.any?{part:at}:{},...nt}),Yf=at==="body"?"":at==="ready"?" [ready check]":` [${at}]`,yt=`Step ${H}${de}${Yf} \xB7 ${s}:${_.line+1} \xB7 ${_.language}`;if(fe&&!fe.active){x.has(fe.group)||(e.log(`\u2013 ${yt}: for ${Cr(ne.os??[])}, skipped on ${Cr([Mn()])}`),V.push(ut("skipped","skipped",{message:`for ${Cr(ne.os??[])}`})));continue}if(r.skipDone&&be[T].selected){let K=_.outputAttrs,Oe=Qs(K?.exit,K?.lines!==void 0,K?.check);if(Oe==="done"||Oe==="skipped"){e.log(`\u2013 ${yt}: done in an earlier run, kept`),V.push(ut("skipped","skipped",{message:"done in an earlier run"})),Zt.add(T);continue}}if(!be[T].selected){V.push(ut("skipped","skipped",{message:M}));continue}if(ne.host){e.log(`\u2013 ${yt}: runs on the host ${ne.host} (md-runbook app), skipped here`),V.push(ut("skipped","skipped",{message:`runs on the host ${ne.host}`}));continue}if(gn&&se!=="auto"){let K=se==="never"?"--no-setup":"--setup-always";e.log(`\u2013 ${yt}: not run (${K})`),V.push(ut("skipped","skipped",{message:`not run (${K})`}));continue}if(at==="setup"&&se==="never"){e.log(`\u2013 ${yt}: setup, not run (--no-setup)`),V.push(ut("skipped","skipped",{message:"setup, not run (--no-setup)"}));continue}if(at==="teardown"&&te==="no"){e.log(`\u2013 ${yt}: teardown, not run (--teardown runs it)`),V.push(ut("skipped","skipped",{message:"teardown, not chosen (--teardown runs it)"}));continue}if(Me&&!(at==="teardown"&&te==="always")){V.push(ut("not run","not run",{message:"an earlier step failed"}));continue}if(Se(T)&&Cn===!0){e.log(`\u2013 ${yt}: already up (the ready check passed), skipped`),b=Rn(b,_.cellIndex,{kind:"new",text:`[md-runbook] skipped: already up (the ready check passed)
|
|
264
|
+
`,attrs:{exit:"skipped",ready:"up",ran:Ie(new Date)}},w)??b,V.push(ut("skipped","skipped",{message:"already up"})),Zt.add(T);continue}let ze=(K,Oe="not run")=>{e.log(`\u2717 ${yt}: not run: ${K}`),z(de,h(ne.name??St),`not run: ${K}`),V.push(ut("not run",Oe,{message:K})),r.keepGoing||(Me=!0)};if(ne.errors.length>0){ze(`invalid cell option ${ne.errors.join("; ")}`,"error");continue}let aa=YB(_.info);if(aa.state==="proposed"){ze("proposed by an assistant and not approved; approve it in VS Code first");continue}if(aa.by!==void 0){ze("written by an assistant; such cells only run in VS Code (approval, read-only credentials)");continue}let Yi=$e(_.language),Qi=Ge(_.language);if(!Yi&&!Qi)continue;if(ne.skip){e.log(`\u2013 ${yt}: skipped (skip option)`),b=Rn(b,_.cellIndex,{kind:"new",text:`[md-runbook] skipped: skip option
|
|
265
|
+
`,attrs:{exit:"skipped",ran:Ie(new Date)}},w)??b,V.push(ut("skipped","skipped"));continue}let Wi=qB(Qi?"":_.source,"patterns",D,ne.confirm===!0?!0:void 0);if(Wi!==void 0&&!r.yes){let K=Wi===""?"this block asks for confirmation (confirm option)":`risky command \u201C${Wi.trim()}\u201D`;b=Rn(b,_.cellIndex,{kind:"new",text:`[md-runbook] not confirmed: ${K}; pass --yes to run it
|
|
266
|
+
`,attrs:{exit:"declined",ran:Ie(new Date)}},w)??b,ze(`${K}; pass --yes to run it`,"declined");continue}if(Qi){let K=et(_.info,_.source);if(K.problems.length>0||K.src===void 0){ze(K.problems.map(oe=>oe.message).join("; "),"error");continue}let Oe;try{Oe=Mt(K)}catch(oe){ze(oe instanceof Error?oe.message:String(oe),"error");continue}let nt=new Map,lt;for(let oe of Oe){let Ee=ue(oe);if("missing"in Ee){lt=Ee.missing;break}nt.set(oe.name,Ee),Ee.secret&&p(Ee.value)}if(lt){ze(lt,"error");continue}let jt=oe=>{let Ee=fi(oe,(Ir,kn)=>nt.get(kn)?.value);return"text"in Ee?Ee.text:oe},He=Jt(r.file,jt(K.src)),Ae=ms(r.file,He);if(!Dt.existsSync(He)||!Dt.statSync(He).isFile()){ze(`src="${h(K.src)}": no such runbook: ${h(Ae)}`,"error");continue}if(n&&!ks(n,He)){ze(`${h(Ae)} is outside the repository (${n}): a signed runbook calls runbooks in its own repository`,"error");continue}let Dn=r.callers??[We.resolve(r.file)],Da=fl(Dn.map(oe=>We.relative(process.cwd(),oe)||oe),We.relative(process.cwd(),He)||He,(oe,Ee)=>vr(oe,Ee));if(Da){ze(Da,"error");continue}let wa=Dt.readFileSync(He,"utf8"),ro=di(K,wa),ka=[...ro.unknown.map(oe=>`${Ae} has no parameter ${oe.name}`),...ro.notPassed.map(oe=>`${Ae} needs \${param:${oe}}: pass it in the call (${oe}=\u2026), it has no default`),...ro.sections];if(ka.length>0){ze(ka.join("; "),"error");continue}let so={};for(let oe of K.args)so[oe.name]=jt(oe.value);let xa=ve(wa),va;try{let oe=kn=>r.params[kn]??a?.params.find(uo=>uo.name===kn)?.default,Ee=Bi(Zr(ne,a),oe),Ir=Bi(xa?.kubeContext,kn=>so[kn]??xa?.params.find(uo=>uo.name===kn)?.default);if(Ee!==void 0&&Ir!==void 0&&Ee!==Ir){ze(`${Ae} runs against the Kubernetes context ${Ir}, this runbook against ${Ee}: nothing ran`,"error");continue}Ee!==void 0&&Ir===void 0&&(va={context:Ee,...a?.kubeContextMode?{mode:a.kubeContextMode}:{}})}catch(oe){ze(oe instanceof Error?oe.message:String(oe),"error");continue}let er,io=!1,tr=pi(_.outputAttrs);if(tr&&!r.freshCopy&&tr.exit!==void 0&&tr.exit!=="0"&&tr.exit!=="skipped"){let oe=We.resolve(We.dirname(We.resolve(r.file)),tr.copy);Dt.existsSync(oe)&&vr(Jt(r.file,tr.runbook),He)&&(er=oe,io=!0)}er??=KB(He,t,r.copyFolder);let nr=ms(r.file,er),Sa=h(ne.name??St),ya=K.sections.length?` (section${K.sections.length===1?"":"s"} ${K.sections.map(oe=>JSON.stringify(oe)).join(", ")})`:"";e.log(`\u25B6 ${yt}${ne.name?` \xB7 ${ne.name}`:""} \xB7 ${h(Ae)}${ya} \xB7 ${io?`continuing ${nr} (steps done there are kept)`:`copy ${nr}`}`),z(de,Sa,`runs ${h(Ae)}${ya} as ${nr}`);let Ts=new Date,oo=new AbortController,Ra=()=>oo.abort();r.signal?.addEventListener("abort",Ra,{once:!0});let Bo=!1,Vf=ne.timeoutSeconds?setTimeout(()=>(Bo=!0,oo.abort()),ne.timeoutSeconds*1e3):void 0,ct,Et;try{ct=await XB({...r,file:er,params:so,from:void 0,to:void 0,skipDone:io,sections:K.sections.length?K.sections:void 0,session:void 0,signal:oo.signal,progress:!1,extraSecrets:[...f],callers:[...Dn,He],stepPrefix:`${H}${de}.`,inheritKubeContext:va,...n?{signedRoot:n}:{},setup:"auto",addSetup:!1,teardown:te==="always"?"always":"success",readyFirst:Y(T)==="setup"},{out:e.out,log:Ee=>e.log(` ${Ee}`)}),Dt.writeFileSync(er,ct.text,"utf8");for(let Ee of ct.steps)(Ee.status==="failed"||Ee.status==="not run")&&(Et??=`step ${H}${de}.${Ee.step} ${Ee.status==="failed"?"failed":"not run"}: ${Ee.message??Ee.exit}`);let oe=ct.manual.filter(Ee=>!Ee.ticked).length;!ct.ok&&Et===void 0&&oe>0&&(Et=`${oe} manual step${oe===1?"":"s"} not ticked in ${nr}, which keeps evidence: tick ${oe===1?"it":"them"} there and run the call again`)}catch(oe){Et=oe instanceof Error?oe.message:String(oe)}finally{clearTimeout(Vf),r.signal?.removeEventListener("abort",Ra)}Bo&&(Et=`timed out after ${ne.timeoutSeconds}s; the runbook called was stopped`);let ao=new Date,Ls=oe=>ct?.steps.filter(Ee=>Ee.status===oe).length??0,$r={runbook:Ae,copy:nr,sha256:zB(er),done:Ls("passed"),skipped:Ls("skipped"),failed:Ls("failed"),notRun:Ls("not run"),manual:ct?.manual.filter(oe=>!oe.ticked).length??0},wn=ct?.ok===!0&&!Bo,rr=wn&&Y(T)==="setup"&&ct?.setup?.ready===!0;Y(T)==="setup"&&ct?.setup?.ready!==void 0&&Xt.push(ct.setup.ready),Y(T)==="setup"&&!rr&&(en+=Date.now()-Ts.getTime());let Oa=cl($r,K.sections)+(rr?`[md-runbook] already up: the ready check of ${Ae} passed, so its setup was skipped
|
|
267
|
+
`:"")+(Et?`[md-runbook] ${Et}
|
|
268
|
+
`:""),Aa={exit:rr?"skipped":wn?"0":"1",...rr?{ready:"up"}:{},ran:Ie(Ts),ended:Ie(ao),duration:Us(ao.getTime()-Ts.getTime()),...ne.name!==void 0?{name:ne.name}:{},...ll($r),...Zo(b,{by:Ji(),on:`${Ji()}@${vs.hostname()}`})},Ns=he(b).cells[_.cellIndex]?.meta,Ms=ce(Ns)?js(Ns):void 0,Fa=Ms?Ks(Ms,ce(Ns)?Ns.history?.entries??[]:[],Xo(b,0)):[];b=Rn(b,_.cellIndex,{kind:"new",text:h(Oa),attrs:Aa,...Ms&&Fa.length?{previous:Ms,history:Fa}:{}},w)??b,z(de,Sa,`${wn?"done":"failed"}: ${es($r)}${Et?` (${h(Et)})`:""}`),e.log(`${wn?"\u2713":"\u2717"} Step ${H}${de} \xB7 ${h(Ae)}: ${es($r)}${Et?` \xB7 ${h(Et)}`:""}`),Zt.add(T),V.push(ut(rr?"skipped":wn?"passed":"failed",Aa.exit,{durationMs:ao.getTime()-Ts.getTime(),output:h(Oa),call:{runbook:Ae,copy:nr,sha256:$r.sha256,steps:ct?.steps??[],manual:ct?.manual??[]},...rr?{message:"already up"}:wn?{}:{message:h(Et??"the runbook called failed")}})),!wn&&!ne.continueOnError&&!r.keepGoing&&(Me=!0),r.signal?.aborted&&(Me=!0);continue}if(!Yi)continue;let tn={...ne.env},Vi,ua=new Set,la,ca;try{ca=Xe(_.source).length,la=gr(_.source,_.info,a)}catch(K){ze(K instanceof Error?K.message:String(K),"error");continue}for(let K of la){let Oe=ue(K);if("missing"in Oe){Vi=Oe.missing;break}tn[K.name]=Oe.value,Oe.secret&&(p(Oe.value),ua.add(K.name))}if(Vi){ze(Vi,"error");continue}let Ar=ne.checks,Rs,fa=Zr(ne,a);try{Ar&&(Ar=nl(Ar,tn,K=>ua.has(K))),Rs=Bi(fa,K=>tn[K])}catch(K){ze(K instanceof Error?K.message:String(K),"error");continue}let Os=Tn(fa)!==void 0?Rs:void 0,da=FB({language:_.language,frontMatter:a,kubeContext:Rs,env:{...process.env,...a?.env,...tn},pins:u});tn=$B(tn,da);let pa=ca>0?hr(_.source,Yi):_.source,Zi=(ne.checks?.captures??[]).some(K=>K.secret),Xi="",Fr=ne.cwd!==void 0?We.resolve(i,ne.cwd):c,ha=ne.timeoutSeconds??a?.timeoutSeconds??r.timeoutSeconds??0,mn=ne.retry?.attempts??1,Qf=ne.estimateSeconds!==void 0?` \xB7 est. ${it(ne.estimateSeconds)}`:"";e.log(`\u25B6 ${yt}${Qf}${ne.name?` \xB7 ${ne.name}`:""}${Os?` \xB7 Kubernetes context ${Os}`:""}`);let En=new Date,Vn=G?new Hi(K=>G.append(K),h,Zi):void 0;Vn?.start({at:En,runbook:s,step:de,line:_.line+1,section:Q(_.line),title:ne.name??St,command:pa});let Zn="",eo="",ye,je,Ut=0,Ca=Dt.existsSync(Fr)?await qu(Rs,async K=>{let Oe="",nt="",lt={language:_.language,source:K,cwd:Fr,settings:a?.shell?{...r.shell,runbook:a.shell}:r.shell,timeoutMs:15e3,env:tn,signal:r.signal,onStdout:He=>Oe+=He,onStderr:He=>nt+=He},jt=A?await A.execute({...lt,baseCwd:c}):await Un(lt);return{exitCode:jt.exitCode,stdout:Oe,stderr:jt.error??(jt.timedOut?"timed out":nt)}},da.pinned):void 0;if(Ca!==void 0)Ut=1,ye={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:Ca,durationMs:0};else for(;;){Ut++,Ut>1&&Vn?.attempt(Ut,mn,new Date),Zn="",eo="",Xi="";let K=new Sn(Ae=>Zi?Xi+=Ae:e.out(Ae),h),Oe=Ae=>Dn=>{Zn+=Dn,Ae&&(eo+=Dn),K.write(Dn),Vn?.out(Ae?"stdout":"stderr",Dn)},nt={language:_.language,source:pa,cwd:Fr,settings:a?.shell?{...r.shell,runbook:a.shell}:r.shell,timeoutMs:ha*1e3,env:tn,signal:r.signal,onStdout:Oe(!0),onStderr:Oe(!1)};if(!Dt.existsSync(Fr))ye={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:`Working directory not found: ${Fr}`,durationMs:0};else try{ye=A?await A.execute({...nt,baseCwd:c}):await Un(nt)}catch(Ae){ye={exitCode:null,signal:null,timedOut:!1,cancelled:!1,error:Ae instanceof Error?Ae.message:String(Ae),durationMs:0}}if(K.flush(),je=sl(Ar)&&ye.exitCode!==null&&ye.error===void 0&&!ye.timedOut&&!ye.cancelled?il(Ar,ye.exitCode,Zn,eo):void 0,(je?je.ok:ar(ye))||Ut>=mn||ye.cancelled||r.signal?.aborted)break;let jt=je?.failures[0]??(ye.timedOut?"timed out":ye.error??`exit code ${Jr(ye)}`),He=ne.retry?.everyMs??0;if(e.log(` attempt ${Ut}/${mn} failed (${h(jt)}); trying again in ${He/1e3}s`),Vn?.out("stderr",`[md-runbook] attempt ${Ut}/${mn} failed (${jt}); trying again in ${He/1e3}s
|
|
269
|
+
`),!await fC(He,r.signal))break}for(let K of je?.secretValues??[])p(K);Zi&&e.out(h(Xi));let to=K=>{Zn+=K,e.out(h(K)),Vn?.out("stderr",K)};ye.error!==void 0&&to(ye.error+`
|
|
270
|
+
`),ye.timedOut&&to(`[md-runbook] timed out after ${ha}s; process tree killed
|
|
271
|
+
`);for(let K of je&&!je.ok?je.failures:[])to(`[md-runbook] check failed: ${K}
|
|
272
|
+
`);if(je?.ok)for(let K of je.captured)m.set(K.name,{value:K.value,secret:K.secret});let Xn=new Date,As=Jr(ye),bn=gn?(je?je.ok:ar(ye))&&!ye.cancelled:void 0,Fs=gn?"ok":je?je.ok?"ok":"failed":void 0,ga={exit:As,ran:Ie(En),ended:Ie(Xn),duration:Us(Xn.getTime()-En.getTime()),...Fs?{check:Fs}:{},...bn!==void 0?{ready:bn?"up":"down"}:{},...mn>1?{attempts:String(Ut)}:{},...ne.name!==void 0?{name:ne.name}:{},...Os?{"kube-context":Os}:{},...Zo(b,{by:Ji(),on:`${Ji()}@${vs.hostname()}`})},$s=he(b).cells[_.cellIndex]?.meta,Is=ce($s)?js($s):void 0,ma=Is?Ks(Is,ce($s)?$s.history?.entries??[]:[],Xo(b,0)):[];b=Rn(b,_.cellIndex,{kind:"new",text:Zn,attrs:ga,...Is&&ma.length?{previous:Is,history:ma}:{}},w)??b;let no=gn?!ye.cancelled:je?je.ok:ar(ye);if(bn!==void 0){Cn=bn,Xt.push(bn);let K=be.flatMap((nt,lt)=>nt.runs&&Se(lt)&&Wn[lt]!==void 0?[Wn[lt]]:[]),Oe=K.length?` - ${zo(K.reduce((nt,lt)=>nt+lt,0))} to set it up`:"";e.log(bn?`Setup: ${oa(ne)} is already up - setup skipped`:`Setup: ${oa(ne)} is not up${Oe}`),z(de,h(ne.name??St),bn?"ready check: up, setup skipped":"ready check: not up, the setup runs")}at==="setup"&&(en+=Xn.getTime()-En.getTime()),Vn?.end({exit:As,durationMs:Xn.getTime()-En.getTime(),...Fs?{check:Fs}:{},...mn>1?{attempt:Ut,attempts:mn}:{}}),G?.flush();let{ran:TC,ended:LC,...Wf}=ga;e.log(`${ko(Wf)}${ye.shell?` \xB7 ${ye.shell.label}`:""}`);let Ea=(Xn.getTime()-En.getTime())/1e3;ne.estimateSeconds!==void 0&&qo(Ea,ne.estimateSeconds)&&e.log(`! Step ${H}${de} took ${it(Ea)}, more than twice its estimate of ${it(ne.estimateSeconds)}`),Zt.add(T);let ba=r.progress?Kf():void 0;ba&&e.log(` ${ba}`),V.push(ut(no?"passed":"failed",As,{durationMs:Xn.getTime()-En.getTime(),output:h(Zn),...no?{}:{message:je?.failures[0]??`exit ${As}`}})),!no&&!ne.continueOnError&&!r.keepGoing&&(Me=!0),r.signal?.aborted&&(Me=!0)}}finally{G?.flush(),A?.dispose(),u.dispose()}De(R.length-1);let qi=ge.filter(T=>!T.ticked),Ba=o?.evidence===!0;if(qi.length>0){let T=qi.length;e.log(Ba?`\u2717 ${T} manual step${T===1?"":"s"} not ticked, and this runbook keeps evidence: tick ${T===1?"it":"them"} (- [x]) once done, and run again`:`\u2610 ${T} manual step${T===1?"":"s"} not ticked`)}let zf=V.every(T=>T.status==="passed"||T.status==="skipped")&&!(Ba&&qi.length>0);Or[0]!==0&&V.sort((T,_)=>T.step-_.step),W.any&&te==="no"&&be.some((T,_)=>Y(_)==="teardown"&&T.selected)&&e.log("\u2610 teardown not run: run again with --teardown (or --from with its step) when you stop for the day");let qf=W.any?{setup:{...Xt.length?{ready:Xt.every(Boolean)}:{},seconds:Math.round(en/100)/10}}:{};return{steps:V,manual:ge.map(({after:T,..._})=>({..._,text:h(_.text)})),text:b,ok:zf,redact:h,...qf}}var pn=r=>r.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]).replace(/[\x00-\x08\x0b\x0c\x0e-\x1f]/g,"");function ea(r,e=""){return r.flatMap(t=>[{...t,number:`${e}${t.step}`},...t.call?ea(t.call.steps,`${e}${t.step}.`).map(n=>({...n,file:n.file??t.call.copy})):[]])}function ta(r,e,t){return[...t.map(n=>({...n,file:r})),...e.flatMap(n=>n.call?ta(n.call.copy,n.call.steps,n.call.manual):[])]}function rf(r,e,t=[]){let n=ea(e),s=ta(r,e,t).map(l=>{let u=` <testcase classname="${pn(l.file)}" name="${pn(`Manual (line ${l.line+1}): ${l.text}`)}" time="0.000">`;return l.ticked?`${u}</testcase>`:`${u}<skipped message="manual step, not ticked"/></testcase>`}),i=n.filter(l=>l.status==="failed"||l.status==="not run").length,o=n.filter(l=>l.status==="skipped").length+s.filter(l=>l.includes("<skipped")).length,B=l=>(l/1e3).toFixed(3),a=e.reduce((l,u)=>l+u.durationMs,0),c=n.map(l=>{let u=pn(`Step ${l.number}: ${l.title}`),f=l.estimateSeconds!==void 0?`<properties><property name="estimate" value="${l.estimateSeconds}"/></properties>`:"",d=` <testcase classname="${pn(l.file??r)}" name="${u}" time="${B(l.durationMs)}">${f}`;return l.status==="passed"?`${d}</testcase>`:l.status==="skipped"?`${d}<skipped message="${pn(l.message??"skipped")}"/></testcase>`:`${d}
|
|
273
|
+
<failure message="${pn(l.message??l.exit)}">${pn(l.output)}</failure>
|
|
266
274
|
</testcase>`});return`<?xml version="1.0" encoding="UTF-8"?>
|
|
267
275
|
<testsuites>
|
|
268
|
-
<testsuite name="${
|
|
276
|
+
<testsuite name="${pn(r)}" tests="${n.length+s.length}" failures="${i}" skipped="${o}" time="${B(a)}">
|
|
269
277
|
`+[...c,...s].join(`
|
|
270
278
|
`)+`
|
|
271
279
|
</testsuite>
|
|
272
280
|
</testsuites>
|
|
273
|
-
`}function
|
|
281
|
+
`}function sf(r,e,t=[]){let n=ea(e),s={passed:"\u2705",failed:"\u274C",skipped:"\u23ED\uFE0F","not run":"\u26D4"},i=u=>u.replace(/\|/g,"\\|").replace(/\r?\n/g," "),o=n.map(u=>`| ${u.number} | ${s[u.status]} ${u.status} | \`${i(u.title).slice(0,80)}\` | ${i(u.exit)} | ${(u.durationMs/1e3).toFixed(1)}s${u.estimateSeconds!==void 0?` (est. ${it(u.estimateSeconds)})`:""} | ${i(u.message??"")} |`),B=n.filter(u=>u.status==="passed").length,a=ta(r,e,t),c=a.map(u=>`| \u2013 | ${u.ticked?"\u2611 ticked":"\u2610 not ticked"} | ${i(u.text).slice(0,80)} | manual | \u2013 | ${i(u.file)}:${u.line+1} |`),l=a.filter(u=>!u.ticked).length;return`### ${i(r)}: ${B}/${n.length} steps passed${l?`, ${l} manual step${l===1?"":"s"} not ticked`:""}
|
|
274
282
|
|
|
275
283
|
| Step | Result | Command | Exit | Time | Note |
|
|
276
284
|
|---|---|---|---|---|---|
|
|
277
|
-
${[...
|
|
285
|
+
${[...o,...c].join(`
|
|
278
286
|
`)}
|
|
279
|
-
`}function
|
|
280
|
-
`)}function
|
|
281
|
-
`).map((n,s)=>({type:"TextBlock",text:n,wrap:!0,...s===0?{weight:"Bolder"}:{}}))}}]}:{text:e}}async function
|
|
282
|
-
${
|
|
287
|
+
`}function Ji(){try{return vs.userInfo().username}catch{return process.env.USER??process.env.USERNAME??"unknown"}}function of(r,e){let t=r?.trim();if(!t)return;let n=(e?.trim()||"failure").toLowerCase();if(n!=="failure"&&n!=="always")return`notify-on must be "failure" or "always", not "${e}"`;let s;try{s=new URL(t)}catch{return"the notification URL is not a valid URL"}let i=s.hostname==="localhost"||s.hostname==="127.0.0.1"||s.hostname==="[::1]";return s.protocol!=="https:"&&!(s.protocol==="http:"&&i)?"the notification URL must use https":{url:t,on:n}}function Ui(r){let{GITHUB_SERVER_URL:e,GITHUB_REPOSITORY:t,GITHUB_RUN_ID:n}=r;return e&&t&&n?`${e}/${t}/actions/runs/${n}`:void 0}var dC=r=>`Step ${r.step} (line ${r.line}) ${r.status==="failed"?"failed":"was not run"}${r.message?`: ${r.message}`:""}`;function Bf(r,e,t){let n=e.steps.length,s=e.steps.filter(B=>B.status==="failed"||B.status==="not run"),o=[e.ok?`\u2713 ${r}: all ${n} step${n===1?"":"s"} passed`:`\u2717 ${r}: ${s.length} of ${n} steps failed or did not run`,...s.filter(B=>B.status==="failed"||B.message!=="an earlier step failed").slice(0,5).map(B=>`\u2022 ${dC(B)}`)];return t&&o.push(t),o.join(`
|
|
288
|
+
`)}function pC(r,e){let t=new URL(r).hostname.toLowerCase();return t==="discord.com"||t.endsWith(".discord.com")||t==="discordapp.com"?{content:e.slice(0,2e3)}:t.endsWith(".logic.azure.com")||t.endsWith(".powerplatform.com")||t.endsWith(".webhook.office.com")?{type:"message",attachments:[{contentType:"application/vnd.microsoft.card.adaptive",content:{$schema:"http://adaptivecards.io/schemas/adaptive-card.json",type:"AdaptiveCard",version:"1.4",body:e.split(`
|
|
289
|
+
`).map((n,s)=>({type:"TextBlock",text:n,wrap:!0,...s===0?{weight:"Bolder"}:{}}))}}]}:{text:e}}async function af(r,e,t=fetch){let n;try{n=await t(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(pC(r,e)),signal:AbortSignal.timeout(15e3)})}catch(s){let i=s instanceof Error&&s.name==="TimeoutError"?"no answer within 15 s":"the request failed";throw new Error(`could not send the notification (${i})`)}if(!n.ok)throw new Error(`could not send the notification (HTTP ${n.status})`)}var uf=require("node:child_process"),kt=le(require("node:fs")),lf=le(require("node:os")),wt=le(require("node:path")),cf=require("node:url");function hC(r){let e=r.env;return r.platform==="win32"?[e.ProgramFiles,e["ProgramFiles(x86)"],e.LOCALAPPDATA].filter(n=>!!n).flatMap(n=>[wt.win32.join(n,"Google","Chrome","Application","chrome.exe"),wt.win32.join(n,"Microsoft","Edge","Application","msedge.exe"),wt.win32.join(n,"Chromium","Application","chrome.exe")]):r.platform==="darwin"?["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Chromium.app/Contents/MacOS/Chromium"]:["google-chrome","google-chrome-stable","chromium","chromium-browser","microsoft-edge"].map(t=>r.which(t)).filter(t=>t!==void 0)}function Sr(r,e=ln()){return r||hC(e).find(t=>e.exists(t))}async function yr(r,e,t){let n=kt.mkdtempSync(wt.join(lf.tmpdir(),"md-runbook-pdf-")),s=wt.join(n,"report.html"),i=wt.resolve(e);kt.writeFileSync(s,r,"utf8");try{kt.rmSync(i,{force:!0});let o=["--headless=new","--disable-gpu","--no-first-run","--no-default-browser-check",`--user-data-dir=${wt.join(n,"profile")}`,...process.platform==="linux"&&process.getuid?.()===0?["--no-sandbox"]:[],"--no-pdf-header-footer",`--print-to-pdf=${i}`,(0,cf.pathToFileURL)(s).href];await new Promise((B,a)=>{(0,uf.execFile)(t,o,{timeout:12e4,windowsHide:!0},(c,l,u)=>{if(kt.existsSync(i)&&kt.statSync(i).size>0)return B();a(new Error(`${wt.basename(t)} did not write the PDF${c?`: ${c.message}`:""}${u.trim()?`
|
|
290
|
+
${u.trim().split(`
|
|
283
291
|
`).slice(-3).join(`
|
|
284
|
-
`)}`:""}`))})})}finally{
|
|
292
|
+
`)}`:""}`))})})}finally{kt.rm(n,{recursive:!0,force:!0,maxRetries:3},()=>{})}}var mt=le(require("node:fs")),ff=le(require("node:path"));var Ss=`Usage: md-runbook sign <file.md> --key KEY [options]
|
|
285
293
|
md-runbook verify <file.md> [--allowed-signers FILE]
|
|
286
294
|
|
|
287
295
|
sign writes a signature block at the end of the runbook: its bash blocks as servers with
|
|
@@ -307,22 +315,22 @@ verify shows what a runbook's signature covers and which blocks changed since si
|
|
|
307
315
|
with --allowed-signers (a server's allowed_signers file) does it check the signature as the gate
|
|
308
316
|
would; without it, the signer's name is just what the file says. Exit code 0 when everything is
|
|
309
317
|
signed (and, with --allowed-signers, the signature verifies).
|
|
310
|
-
`,
|
|
311
|
-
`)};async function
|
|
318
|
+
`,It=class extends Error{},ys=(r=0)=>new Date(Date.now()+r*864e5).toISOString().slice(0,10);function CC(r){return ff.basename(r).replace(/(\.runbook)?\.md$/i,"").replace(/[^A-Za-z0-9._/-]+/g,"-").replace(/^[^A-Za-z0-9]+/,"")||"runbook"}function gC(r){let e=[...r],t={patterns:{}},n=s=>{let i=e.shift();if(i===void 0||i.startsWith("--"))throw new It(`${s} needs a value`);return i};for(;e.length>0;){let s=e.shift();switch(s){case"--key":t.key=n(s);break;case"--signer":t.signer=n(s);break;case"--name":t.name=n(s);break;case"--out":t.out=n(s);break;case"--cosign":t.cosign=!0;break;case"--record":t.record=!0;break;case"--version":{let i=Number(n(s));if(!Number.isInteger(i)||i<1)throw new It("--version expects a positive whole number");t.version=i;break}case"--expires":t.expires=n(s);break;case"--expires-in":{let i=Number(n(s));if(!Number.isInteger(i)||i<0)throw new It("--expires-in expects days");t.expires=ys(i);break}case"--scope":(t.scopes??=[]).push(n(s));break;case"--pattern":{let i=n(s),o=i.indexOf("=");if(o<=0)throw new It(`--pattern expects NAME=REGEX, got "${i}"`);t.patterns[i.slice(0,o)]=i.slice(o+1);break}default:if(s.startsWith("-"))throw new It(`unknown option ${s}`);if(t.file)throw new It(`one runbook at a time (got "${t.file}" and "${s}")`);t.file=s}}if(!t.file)throw new It("missing the runbook file");if(!t.key)throw new It("missing --key");return t}var df=r=>{process.stdout.write(r+`
|
|
319
|
+
`)};async function pf(r,e=df,t){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(Ss),0;let n;try{n=gC(r)}catch(p){if(!(p instanceof It))throw p;return process.stderr.write(`md-runbook: ${p.message}
|
|
312
320
|
|
|
313
|
-
${
|
|
314
|
-
`),2;let s=
|
|
315
|
-
`),1;if(r.cosign&&s&&!s.unchanged)return process.stderr.write(`md-runbook: ${r.file}: the run record changed since ${
|
|
316
|
-
`),1;let i=
|
|
317
|
-
`),1}let
|
|
321
|
+
${Ss}`),2}if(!mt.existsSync(n.file))return process.stderr.write(`md-runbook: no such file: ${n.file}
|
|
322
|
+
`),2;let s=mt.readFileSync(n.file,"utf8"),i=(()=>{let p=_t(s);try{return p?{block:p,manifest:_n(p.manifest)}:void 0}catch{return}})();if(n.record)return EC(n,s,e,t);if(n.cosign)return mC(n,s,i?.block,e,t);let o={name:n.name??i?.manifest.name??CC(n.file),version:n.version??(i?i.manifest.version+1:1),...n.expires?{expires:n.expires}:{},scopes:n.scopes??i?.manifest.scopes??[],patterns:{...i?.manifest.patterns??{},...n.patterns}},B=pB(s,o);if("errors"in B){for(let p of B.errors)e(`${n.file}: error: ${p}`);return e("\u2717 not signed"),1}let a=Jn("bash",{},ln()),c=a.ok?await IB(B.manifest,a.shell.command):void 0;if(c?.length){for(let p of c)e(`${n.file}: error: ${p}`);return e("\u2717 not signed: a server runs these commands one by one; make each a whole command (or end the cell differently)"),1}c||e(" note: bash not found, so the commands were not checked one by one (bash -n)");let l=hB(B.manifest),u;try{u=await Kn(l,n.key,{sshKeygen:t})}catch(p){return e(`\u2717 ${p instanceof Error?p.message:String(p)}`),1}let f=n.signer??hs(n.key)??i?.block.signer??"unknown",d=n.out??n.file;mt.writeFileSync(d,mB(s,{signer:f,signed:ys(),manifest:l,signature:u}),"utf8");let h=B.manifest;return e(`\u2713 ${h.name} version ${h.version} signed by ${f}: ${h.cells.length} block${h.cells.length===1?"":"s"}${h.scopes.length?`, scopes ${h.scopes.join(" ")}`:""}${h.expires?`, until ${h.expires}`:""} \xB7 written to ${d}`),e(` manifest sha256 ${Ni(l)} (list it in a server's revoked file to withdraw this version)`),0}async function mC(r,e,t,n,s){if(!t)return n(`\u2717 ${r.file} is not signed yet: sign it first, then a second signer adds --cosign`),1;if(r.name||r.version||r.expires||r.scopes||Object.keys(r.patterns).length)return n("\u2717 --cosign signs the manifest as it is: --name, --version, --expires, --scope and --pattern belong to signing"),1;if(!Ul(e,t))return n(`\u2717 ${r.file} changed since ${t.signer} signed it: sign it again (a new version), then co-sign that`),1;let i;try{i=await Kn(t.manifest,r.key,{sshKeygen:s})}catch(u){return n(`\u2717 ${u instanceof Error?u.message:String(u)}`),1}let o=r.signer??hs(r.key)??"unknown",B=[...(t.cosigners??[]).filter(u=>u.signer!==un(o)),{signer:o,signed:ys(),signature:i}],a=r.out??r.file,c={...t,cosigners:B};mt.writeFileSync(a,mB(e,c),"utf8");let l=_n(t.manifest);return n(`\u2713 ${l.name} version ${l.version} co-signed by ${o}: signed by ${CB(c).join(", ")} \xB7 written to ${a}`),0}async function EC(r,e,t,n){let s=ls(e);if(r.cosign&&!s)return process.stderr.write(`md-runbook: ${r.file}: the run record is not signed yet (sign it first, then a second person co-signs)
|
|
323
|
+
`),1;if(r.cosign&&s&&!s.unchanged)return process.stderr.write(`md-runbook: ${r.file}: the run record changed since ${Dr(s.block).join(", ")} signed it: sign it again first
|
|
324
|
+
`),1;let i=Oi(e),o;try{o=await Kn(EB(i),r.key,{sshKeygen:n})}catch(u){return process.stderr.write(`md-runbook: ${u instanceof Error?u.message:String(u)}
|
|
325
|
+
`),1}let B=r.signer??hs(r.key)??"unknown",a=Ie(new Date),c=r.cosign&&s?ec(s.block,{signer:B,signed:a,signature:o}):{signer:B,signed:a,sha256:i,signature:o},l=r.out??r.file;return mt.writeFileSync(l,Xl(e,c),"utf8"),t(`\u2713 ${l}: run record signed by ${Dr(c).join(", ")} (sha256 ${i})`),0}async function bC(r,e,t,n,s){let i=ls(r);if(!i)return;let o=i.block,B=(o.cosigners??[]).map(c=>`, co-signed by ${c.signer} at ${c.signed}`).join("");n(`${e}: run record signed by ${o.signer} at ${o.signed}${B} (as the file says)`),n(` record sha256 ${o.sha256}: ${i.unchanged?"unchanged since signing":`CHANGED since signing (now ${Oi(r)})`}`);let a=i.unchanged;if(t){let c=[o.signature,...(o.cosigners??[]).map(u=>u.signature)],l=Dr(o);for(let u=0;u<c.length;u++)try{n(` record signature ${u+1} (${l[u]}): good, by ${await Wt(EB(o.sha256),c[u],t,s)} (${t})`)}catch(f){n(` record signature ${u+1} (${l[u]}): ${f instanceof Error?f.message:String(f)}`),a=!1}}else n(" record signature: NOT checked: add --allowed-signers FILE");return a}async function hf(r,e=df,t){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(Ss),0;let n=[...r],s,i;for(;n.length>0;){let h=n.shift();if(h==="--allowed-signers")i=n.shift();else{if(h.startsWith("-")||s)return process.stderr.write(`md-runbook: ${h.startsWith("-")?`unknown option ${h}`:"one runbook at a time"}
|
|
318
326
|
|
|
319
|
-
${
|
|
327
|
+
${Ss}`),2;s=h}}if(!s||r.includes("--allowed-signers")&&!i)return process.stderr.write(`md-runbook: ${s?"--allowed-signers needs a file":"missing the runbook file"}
|
|
320
328
|
|
|
321
|
-
${
|
|
322
|
-
`),2;let
|
|
329
|
+
${Ss}`),2;if(!mt.existsSync(s))return process.stderr.write(`md-runbook: no such file: ${s}
|
|
330
|
+
`),2;let o=mt.readFileSync(s,"utf8"),B=ot(o),a=await bC(o,s,i,e,t);if(!B)return a!==void 0?(e(`${a?"\u2713":"\u2717"} run record${i?"":", signature not checked"} (the runbook itself is not signed)`),a?0:1):(e(`\u2717 ${s}: ${/<!-- md-runbook:signature/.test(o)?"the signature block is damaged":"not signed"}`),1);a===!1&&e(" (the run record above does not verify)");let c=B.manifest,l=(B.block.cosigners??[]).map(h=>`, co-signed by ${h.signer} on ${h.signed}`).join("");e(`${s}: ${c.name} version ${c.version}, signed by ${B.block.signer} on ${B.block.signed}${l} (as the file says)`),e(` scopes: ${c.scopes.length?c.scopes.join(" "):"none (only servers that accept any scope)"}`),c.expires&&e(` expires: ${c.expires}${c.expires<ys()?" (expired)":""}`);for(let[h,p]of Object.entries(c.patterns))e(` parameter ${h}: ${p}`);e(` manifest sha256 ${Ni(B.block.manifest)}`);let u=!0,f=new Map(ft(he(o)).map(h=>[h.cellIndex,h.line]));for(let h of B.changed)e(`${s}:${(f.get(h)??0)+1}: changed since signing: servers that only run signed runbooks refuse this block`),u=!1;for(let h of B.moved)e(`${s}:${(f.get(h)??0)+1}: moved since signing: signed as block ${B.cells.get(h).n}, after blocks that now come later`),u=!1;if(B.missing.length>0&&(e(` signed block${B.missing.length===1?"":"s"} ${B.missing.join(", ")} of ${c.cells.length} not in the file as signed (deleted or changed)`),u=!1),c.expires&&c.expires<ys()&&(u=!1),i){let h=br(B.block),p=CB(B.block),w=new Set;for(let D=0;D<h.length;D++){let m=h.length>1?`signature ${D+1} (${p[D]})`:"signature";try{let b=await Wt(B.block.manifest,h[D],i,t);w.add(b),e(` ${m}: good, by ${b} (${i})`)}catch(b){e(` ${m}: ${b instanceof Error?b.message:String(b)}`),u=!1}}h.length>1&&e(` signers: ${w.size} distinct (${[...w].join(", ")||"none"})`)}else e(" signature: NOT checked (anyone can write a signer name): add --allowed-signers FILE to check it as the gate does");B.missingCalls.length>0&&(e(` signed runbook call${B.missingCalls.length===1?"":"s"} ${B.missingCalls.join(", ")} of ${c.calls.length} not in the file as signed (deleted or changed)`),u=!1);let d=_i(s);for(let h of B.calls.values()){let p=et(h.info,h.body).src??"";if(Er(p)){e(` runbook call: ${p}: has placeholders, checked when it runs (md-runbook run --allowed-signers)`);continue}let w=Jt(s,p);if(!ks(d,w)){e(` runbook call: ${p}: outside the repository (${d})`),u=!1;continue}if(!i){e(` runbook call: ${p}: ${ot(mt.existsSync(w)?mt.readFileSync(w,"utf8"):"")?"signed (not checked)":"NOT signed"}`);continue}let D=mt.existsSync(w)?await xs(w,{},i,d,{shown:p,...t?{sshKeygen:t}:{}}):{problems:[`${p}: no such runbook`]};e(` runbook call: ${p}: ${D.problems.length===0?"signed, good":D.problems.join("; ")}`),D.problems.length>0&&(u=!1)}return e(`${u?"\u2713":"\u2717"} ${B.cells.size} signed block${B.cells.size===1?"":"s"}${B.calls.size?`, ${B.calls.size} signed runbook call${B.calls.size===1?"":"s"}`:""}, ${B.changed.length} changed`+(i?"":", signature not checked")),u&&a!==!1?0:1}var vf=require("node:child_process"),Tt=le(require("node:fs")),Ne=le(require("node:path"));var DC=Ef(),bf={M:2331,L:2953};function na(r){let e=new TextEncoder().encode(r).length,t=e<=bf.M?"M":e<=bf.L?"L":void 0;if(!t)return;let n=DC(0,t);n.addData(r,"Byte"),n.make();let s=n.getModuleCount(),i=Array.from({length:s},(o,B)=>Array.from({length:s},(a,c)=>n.isDark(B,c)));return{size:s,dark:i,level:t}}function ra(r,e={}){let t=e.scale??4,n=e.margin??4,s=(r.size+n*2)*t,i=e.caption?Math.max(14,t*4)+t*2:0,o=[];for(let a=0;a<r.size;a++){let c=0;for(;c<r.size;){if(!r.dark[a][c]){c++;continue}let l=c;for(;c<r.size&&r.dark[a][c];)c++;o.push(`M${(l+n)*t} ${(a+n)*t}h${(c-l)*t}v${t}h-${(c-l)*t}z`)}}let B=e.caption?`<text x="${s/2}" y="${s+i/2}" text-anchor="middle" dominant-baseline="middle" font-family="system-ui, sans-serif" font-size="${Math.max(12,t*3.5)}" fill="#000">${re(e.caption)}</text>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${s} ${s+i}" width="${s}" height="${s+i}" shape-rendering="crispEdges"><rect width="100%" height="100%" fill="#fff"/><path fill="#000" d="${o.join("")}"/>${B}</svg>`}function Df(r,e){let t=[],n=e.map(i=>{let o=na(i.link);return o?`<figure class="label">${ra(o,{scale:3})}<figcaption><strong>${re(i.title)}</strong>${i.subtitle?`<span>${re(i.subtitle)}</span>`:""}</figcaption></figure>`:(t.push(i.title),"")});return{html:`<!doctype html>
|
|
323
331
|
<html lang="en"><head><meta charset="utf-8">
|
|
324
332
|
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:">
|
|
325
|
-
<title>${
|
|
333
|
+
<title>${re(r)}</title>
|
|
326
334
|
<style>
|
|
327
335
|
@page{size:A4;margin:12mm}
|
|
328
336
|
body{font-family:system-ui,sans-serif;margin:0;color:#000;background:#fff}
|
|
@@ -333,15 +341,15 @@ h1{font-size:14px;font-weight:600;margin:0 0 8mm}
|
|
|
333
341
|
figcaption{font-size:11px;line-height:1.35;margin-top:2mm;overflow-wrap:anywhere}
|
|
334
342
|
figcaption span{display:block;color:#333}
|
|
335
343
|
</style></head><body>
|
|
336
|
-
<h1>${
|
|
344
|
+
<h1>${re(r)}</h1>
|
|
337
345
|
<div class="sheet">
|
|
338
346
|
${n.filter(Boolean).join(`
|
|
339
347
|
`)}
|
|
340
348
|
</div>
|
|
341
349
|
</body></html>
|
|
342
|
-
`,tooLong:t}}function
|
|
343
|
-
`||
|
|
344
|
-
`&&c++,t.push(n),e.push(t),t=[],n=""):n+=
|
|
350
|
+
`,tooLong:t}}function wf(r){let e=[],t=[],n="",s=!1,i=r.replace(/^/,"");for(let c=0;c<i.length;c++){let l=i[c];s?l==='"'&&i[c+1]==='"'?(n+='"',c++):l==='"'?s=!1:n+=l:l==='"'?s=!0:l===","?(t.push(n),n=""):l===`
|
|
351
|
+
`||l==="\r"?(l==="\r"&&i[c+1]===`
|
|
352
|
+
`&&c++,t.push(n),e.push(t),t=[],n=""):n+=l}(n!==""||t.length>0)&&(t.push(n),e.push(t));let[o,...B]=e.filter(c=>c.some(l=>l.trim()!==""));if(!o)return[];let a=o.map(c=>c.trim());return B.map(c=>Object.fromEntries(a.map((l,u)=>[l,(c[u]??"").trim()])))}function kf(r,e,t){let n=r.trim().replace(/\.git$/,""),s=/^(?:git@([^:]+):|ssh:\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?\/|https:\/\/(?:[^@/]+@)?([^/]+)\/)(.+)$/.exec(n);if(!s)return;let i=(s[1]??s[2]??s[3]).toLowerCase(),o=s[4],B=c=>c.split(/[\\/]/).map(encodeURIComponent).join("/"),a=B(t);if(i==="github.com")return`https://github.com/${o}/blob/${B(e)}/${a}`;if(i.includes("gitlab"))return`https://${i}/${o}/-/blob/${B(e)}/${a}`}var xf=`Usage: md-runbook qr <file.md> [options]
|
|
345
353
|
md-runbook link <file.md> [options] (prints the link: a pager alert, a chat)
|
|
346
354
|
md-runbook qr <file.md> --labels hosts.csv [options]
|
|
347
355
|
|
|
@@ -365,29 +373,32 @@ says who approved it.
|
|
|
365
373
|
--out FILE .svg (one code), .html or .pdf (labels). Default: next to the runbook
|
|
366
374
|
--browser PATH Browser for a .pdf (default: CHROME_PATH, else one found on this machine)
|
|
367
375
|
--link Print the link too
|
|
368
|
-
`,
|
|
369
|
-
`)};function
|
|
376
|
+
`,xt=class extends Error{},wC=r=>{process.stdout.write(r+`
|
|
377
|
+
`)};function kC(r){let e=[...r],t={file:"",embed:!1,pin:!1,params:{},cosign:!1,vscode:!1,printLink:!1},n=s=>{let i=e.shift();if(i===void 0||i.startsWith("--"))throw new xt(`${s} needs a value`);return i};for(;e.length>0;){let s=e.shift();switch(s){case"--embed":t.embed=!0;break;case"--url":t.url=n(s);break;case"--pin":t.pin=!0;break;case"--host":t.host=n(s);break;case"--param":{let i=n(s),o=i.indexOf("=");if(o<=0||!At.test(i.slice(0,o)))throw new xt(`--param expects NAME=VALUE, got "${i}"`);t.params[i.slice(0,o)]=i.slice(o+1);break}case"--cosign":t.cosign=!0;break;case"--web-app":t.webApp=n(s);break;case"--vscode":t.vscode=!0;break;case"--labels":t.labels=n(s);break;case"--out":t.out=n(s);break;case"--browser":t.browser=n(s);break;case"--link":t.printLink=!0;break;default:if(s.startsWith("-"))throw new xt(`unknown option ${s}`);if(t.file)throw new xt(`one runbook at a time (got ${t.file} and ${s})`);t.file=s}}if(!t.file)throw new xt("missing the runbook file");if(t.embed&&t.url)throw new xt("--embed and --url: choose one");if(t.pin&&!t.url)throw new xt("--pin goes with --url (the Git address is pinned anyway)");if(t.webApp&&!/^https:\/\/[^/]+\/(?:.*\/)?open$/.test(t.webApp))throw new xt("--web-app expects https://<web app>/open");if(t.webApp&&t.vscode)throw new xt("--web-app and --vscode: choose one");return t}var ji=(r,e)=>(0,vf.execFileSync)("git",e,{cwd:r,encoding:"utf8",windowsHide:!0,timeout:1e4,stdio:["ignore","pipe","ignore"],maxBuffer:8*1024*1024});function xC(r){let e=Ne.dirname(Ne.resolve(r)),t,n,s;try{t=ji(e,["rev-parse","--show-toplevel"]).trim(),n=ji(e,["remote","get-url","origin"]).trim(),s=ji(e,["rev-parse","--abbrev-ref","HEAD"]).trim()}catch{return"not in a Git repository with a remote: use --embed, or --url"}let i=Ne.relative(t,Ne.resolve(r)).split(Ne.sep).join("/"),o=kf(n,s,i);if(!o)return`the app opens GitHub and GitLab addresses; this repository's remote is ${n}: use --embed, or --url`;try{return{web:o,sha256:us(ji(t,["show",`origin/${s}:${i}`]))}}catch{return{web:o}}}async function sa(r,e=wC,t=!1){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(xf),0;let n;try{n=kC(r)}catch(p){if(!(p instanceof xt))throw p;return process.stderr.write(`md-runbook: ${p.message}
|
|
370
378
|
|
|
371
|
-
${
|
|
379
|
+
${xf}`),2}if(!Tt.existsSync(n.file))return process.stderr.write(`md-runbook: no such file: ${n.file}
|
|
372
380
|
`),2;if(n.vscode&&!t)return process.stderr.write(`md-runbook: --vscode is for md-runbook link (a phone camera does not open VS Code links)
|
|
373
|
-
`),2;let s=
|
|
374
|
-
`),2;i.url=
|
|
375
|
-
`)}let
|
|
376
|
-
`),2;if(t)return e(
|
|
377
|
-
`),1;let
|
|
378
|
-
`,"utf8"),n.printLink&&e(
|
|
379
|
-
`),2;let
|
|
380
|
-
`),2;let
|
|
381
|
-
`),2;t?e(`${
|
|
382
|
-
`),1;let
|
|
383
|
-
`),1;await
|
|
384
|
-
${
|
|
385
|
-
${
|
|
386
|
-
|
|
387
|
-
`)
|
|
388
|
-
`).
|
|
389
|
-
`).join(""),
|
|
390
|
-
|
|
381
|
+
`),2;let s=Tt.readFileSync(n.file,"utf8"),i={params:{...n.params},...n.cosign?{action:"cosign"}:{}};if(n.embed)i.text=Kt(s);else if(n.url)i.url=n.url,n.pin&&(i.sha256=us(s));else{let p=xC(n.file);if(typeof p=="string")return process.stderr.write(`md-runbook: ${p}
|
|
382
|
+
`),2;i.url=p.web,p.sha256?i.sha256=p.sha256:process.stderr.write(`md-runbook: the file is not pushed yet (no origin version): the link is not pinned
|
|
383
|
+
`)}let o=p=>n.vscode?zl(p):as(p,n.webApp??Ri),B=p=>{let w=n.vscode?ql(decodeURIComponent(p.slice(p.indexOf("?")+1))):yi(p);return w.ok?void 0:w.problem},a=Ne.basename(n.file).replace(/\.md$/i,""),c=Bn(s)??a;if(!n.labels){n.host&&(i.host=n.host);let p=o(i),w=B(p);if(w)return process.stderr.write(`md-runbook: the app would refuse this link (${w})
|
|
384
|
+
`),2;if(t)return e(p),0;let D=na(p);if(!D)return process.stderr.write(`md-runbook: too much for a QR code (${Buffer.byteLength(p)} bytes; 2953 at most): use its address instead of --embed
|
|
385
|
+
`),1;let m=n.out??Ne.join(Ne.dirname(n.file),`${a}.qr.svg`);return Tt.mkdirSync(Ne.dirname(Ne.resolve(m)),{recursive:!0}),Tt.writeFileSync(m,ra(D,{scale:8,caption:n.host??c})+`
|
|
386
|
+
`,"utf8"),n.printLink&&e(p),e(`\u2713 ${m}: QR code (${D.size}\xD7${D.size}, level ${D.level}) for ${n.host?`${c} on ${n.host}`:c}`),0}if(n.host)return process.stderr.write(`md-runbook: --host and --labels: the hosts come from the CSV
|
|
387
|
+
`),2;let l=wf(Tt.readFileSync(n.labels,"utf8"));if(l.length===0||!("host"in l[0]))return process.stderr.write(`md-runbook: ${n.labels}: expected a header row with a host column (and optional label, p.NAME columns)
|
|
388
|
+
`),2;let u=[];for(let[p,w]of l.entries()){let D={...i.params};for(let[v,R]of Object.entries(w))v.startsWith("p.")&&R!==""&&(D[v.slice(2)]=R);let m=o({...i,...w.host?{host:w.host}:{},params:D}),b=B(m);if(b)return process.stderr.write(`md-runbook: ${n.labels} row ${p+2}: the app would refuse its link (${b})
|
|
389
|
+
`),2;t?e(`${w.host} ${m}`):n.printLink&&e(m),u.push({link:m,title:w.host||c,subtitle:w.label||(w.host?c:void 0)})}if(t)return 0;let{html:f,tooLong:d}=Df(c,u);if(d.length>0)return process.stderr.write(`md-runbook: too much for a QR code: ${d.join(", ")} (use its address instead of --embed)
|
|
390
|
+
`),1;let h=n.out??Ne.join(Ne.dirname(n.file),`${a}.labels.html`);if(Tt.mkdirSync(Ne.dirname(Ne.resolve(h)),{recursive:!0}),/\.pdf$/i.test(h)){let p=Sr(n.browser??process.env.CHROME_PATH);if(!p)return process.stderr.write(`md-runbook: a .pdf needs Chrome, Edge or Chromium; none was found (use --browser PATH or CHROME_PATH), or write .html
|
|
391
|
+
`),1;await yr(f,h,p)}else Tt.writeFileSync(h,f,"utf8");return e(`\u2713 ${h}: ${u.length} label${u.length===1?"":"s"}`),0}var Lt=le(require("node:fs")),Qn=le(require("node:path"));function Sf(r){let e=[],t=0;for(let n of r.split(/\r?\n/)){if(n.trim()==="")continue;let s=n.indexOf("{");if(s<0){t++;continue}try{let i=JSON.parse(n.slice(s));typeof i.time=="string"&&typeof i.event=="string"?e.push(i):t++}catch{t++}}return{events:e,skipped:t}}var Be=r=>typeof r=="string"?r:r===void 0?"":String(r);function yf(r,e=0){let t=[...r].sort((d,h)=>Date.parse(d.time)-Date.parse(h.time)),n=[],s=[],i=[],o=new Map,B=new Map,a=new Map,c=0,l=d=>`${Be(d.account)}
|
|
392
|
+
${Be(d.who)}
|
|
393
|
+
${Be(d.client)}`,u=new Map,f=new Map;for(let d of t){let h=l(d);switch(d.event){case"session":c++,o.set(h,new Map);break;case"load":o.has(h)||o.set(h,new Map),o.get(h).set(Be(d.runbook),{}),u.set(Be(d.hash),{runbook:Be(d.runbook),version:Be(d.version)}),typeof d["called-by"]=="string"?f.set(`${h}
|
|
394
|
+
${Be(d.runbook)}`,{hash:d["called-by"],call:Be(d.call)}):f.delete(`${h}
|
|
395
|
+
${Be(d.runbook)}`);break;case"param":{let p=o.get(h)??new Map;o.set(h,p);let w=p.get(Be(d.runbook))??{};w[Be(d.name)]=Be(d.value),p.set(Be(d.runbook),w);break}case"run":{let p={time:d.time,account:Be(d.account),who:Be(d.who),client:Be(d.client),runbook:Be(d.runbook),version:Be(d.version),hash:Be(d.hash),signer:Be(d.signer),cell:Be(d.cell),step:Be(d.step),params:{...o.get(h)?.get(Be(d.runbook))??{}}},w=f.get(`${h}
|
|
396
|
+
${Be(d.runbook)}`);w&&(p.calledBy={...w}),n.push(p),B.set(Be(d.id),p),a.set(Be(d.id),p);break}case"probe":{let p=Number(Be(d.days_left)),w=d.run===void 0?void 0:a.get(Be(d.run));i.push({time:d.time,account:Be(d.account),who:Be(d.who),client:Be(d.client),target:Be(d.target),address:Be(d.address),ok:d.result==="ok",detail:Be(d.detail),...Be(d.days_left)!==""&&Number.isFinite(p)?{daysLeft:p}:{},...d.not_after?{notAfter:Be(d.not_after)}:{},...d.cert_sha256?{certSha256:Be(d.cert_sha256)}:{},...w?{run:w}:{}});break}case"end":{let p=B.get(Be(d.id));if(!p)break;B.delete(Be(d.id)),p.ended=d.time,p.durationSeconds=Math.max(0,Math.round((Date.parse(d.time)-Date.parse(p.time))/1e3)),typeof d.exit=="number"&&(p.exit=d.exit);break}case"refused":case"unsigned":case"stop":s.push({time:d.time,kind:d.event,account:Be(d.account),who:Be(d.who),client:Be(d.client),detail:d.event==="refused"?Be(d.reason):d.event==="unsigned"?`unsigned code, sha256 ${Be(d.hash)}`:`stopped (${Be(d.signal)})`});break}}for(let d of n)d.calledBy&&Object.assign(d.calledBy,u.get(d.calledBy.hash)??{});return{runs:n,findings:s,probes:i,sessions:c,skipped:e}}function Rf(r,e){let t=n=>(!e.since||Date.parse(n)>=e.since.getTime())&&(!e.until||Date.parse(n)<=e.until.getTime());return{...r,runs:r.runs.filter(n=>t(n.time)&&(!e.runbook||n.runbook===e.runbook)&&(!e.who||n.who===e.who)),findings:r.findings.filter(n=>t(n.time)&&(!e.who||n.who===e.who)),probes:r.probes.filter(n=>t(n.time)&&(!e.who||n.who===e.who)&&(!e.runbook||n.run?.runbook===e.runbook))}}function Of(r,e,t,n=120){let s=ot(t),i=s?.manifest.name??"",o=he(t),B=o.cells.map(f=>ce(f.meta)?me(f.meta.info):void 0),a=sn(o.cells.map((f,d)=>ce(f.meta)?{kind:"code",os:B[d]?.os}:{kind:"markup"})),c=[],l=[],u=new Set;for(let[f,d]of o.cells.entries()){let h=a[f];if(h===void 0||!ce(d.meta))continue;let p=d.output?.attrs.ran;if(!p||Number.isNaN(Date.parse(p)))continue;let w=s?.cells.get(f)?.n;if(w===void 0)continue;let D=r.runs.find(m=>!u.has(m)&&m.runbook===i&&m.cell===String(w)&&Math.abs(Date.parse(m.time)-Date.parse(p))<=n*1e3);D?(u.add(D),D.matched={file:e,step:h},c.push({step:h,ran:p})):l.push({step:h,ran:p})}return{file:e,runbook:i,confirmed:c,missing:l}}var Rr=r=>r.replace("T"," ").replace(/Z$/," UTC");function Af(r,e,t){let n=r.runs,s=n.filter(p=>p.exit!==void 0&&p.exit!==0).length,i=new Set(n.map(p=>p.who)),o=n.length?`${Rr(n[0].time)} \u2013 ${Rr(n[n.length-1].time)}`:"no runs",B=new Map;for(let p of n){let w=`${p.runbook} v${p.version}`,D=B.get(w)??{version:p.version,signer:p.signer,runs:0,failed:0};D.runs++,p.exit!==void 0&&p.exit!==0&&D.failed++,B.set(w,D)}let a=p=>`<td>${re(p)}</td>`,c=p=>p.exit===void 0?'<span class="badge none">no end logged</span>':`<span class="badge ${p.exit===0?"ok":"fail"}">exit ${p.exit}</span>`,l=n.map(p=>`<tr>${a(Rr(p.time))}${a(p.who)}${a(`${p.account} from ${p.client}`)}${a(`${p.runbook} v${p.version}${vC(p)}`)}${a(`${p.cell}${p.step?`.${p.step}`:""}`)}${a(Object.entries(p.params).map(([w,D])=>`${w}=${D}`).join(" "))}<td>${c(p)}</td>${a(p.durationSeconds===void 0?"":`${p.durationSeconds} s`)}${a(p.matched?`${p.matched.file}, step ${p.matched.step}`:"")}</tr>
|
|
397
|
+
`).join(""),u=r.findings.map(p=>`<tr>${a(Rr(p.time))}${a(p.kind)}${a(p.who)}${a(`${p.account} from ${p.client}`)}${a(p.detail)}</tr>
|
|
398
|
+
`).join(""),f=r.probes.map(p=>`<tr>${a(Rr(p.time))}${a(p.who)}${a(p.target)}${a(p.address)}<td><span class="badge ${p.ok?"ok":"fail"}">${p.ok?"up":"failed"}</span></td>${a(p.notAfter?`${Rr(p.notAfter)}${p.daysLeft===void 0?"":` (${p.daysLeft} days)`}`:"")}${a(p.certSha256?`sha256 ${p.certSha256}`:"")}${a(p.run?`${p.run.runbook} v${p.run.version}, block ${p.run.cell}`:"unsigned or by hand")}${a(p.detail)}</tr>
|
|
399
|
+
`).join(""),d=[...B.entries()].map(([p,w])=>`<tr>${a(p)}${a(w.signer)}${a(String(w.runs))}${a(String(w.failed))}</tr>
|
|
400
|
+
`).join(""),h=e.map(p=>`<h3>${re(p.file)}${p.runbook?` (${re(p.runbook)})`:""}</h3>
|
|
401
|
+
<p>${p.confirmed.length} recorded run${p.confirmed.length===1?"":"s"} of signed blocks confirmed by the log`+(p.missing.length?`; <strong>not in the log</strong>: ${p.missing.map(w=>`step ${w.step} at ${re(w.ran)}`).join(", ")} (ran elsewhere, unsigned, or the log is incomplete)`:"")+`.</p>
|
|
391
402
|
`).join("");return`<!DOCTYPE html>
|
|
392
403
|
<html lang="en">
|
|
393
404
|
<head>
|
|
@@ -396,32 +407,32 @@ ${ae(l.client)}`;for(let l of t){let f=u(l);switch(l.event){case"session":c++,B.
|
|
|
396
407
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
397
408
|
<meta name="generator" content="md-runbook audit">
|
|
398
409
|
<title>Gate audit</title>
|
|
399
|
-
<style>${
|
|
410
|
+
<style>${wB}@page{@bottom-right{content:"Page " counter(page) " of " counter(pages);font:10px sans-serif;color:#656d76}}</style>
|
|
400
411
|
</head>
|
|
401
412
|
<body>
|
|
402
413
|
<header>
|
|
403
414
|
<h1 class="title">Gate audit</h1>
|
|
404
|
-
<p class="meta">Generated ${
|
|
415
|
+
<p class="meta">Generated ${re(Ie(t.generatedAt))} from ${re(t.sources.join(", "))} \xB7 ${r.sessions} session${r.sessions===1?"":"s"} \xB7 ${n.length} run${n.length===1?"":"s"} by ${i.size} ${i.size===1?"key":"keys"} \xB7 ${s} failed \xB7 ${r.findings.length} finding${r.findings.length===1?"":"s"}</p>
|
|
405
416
|
</header>
|
|
406
417
|
<section class="record">
|
|
407
|
-
<dl class="facts"><div><dt>Period</dt><dd>${
|
|
418
|
+
<dl class="facts"><div><dt>Period</dt><dd>${re(o)}</dd></div><div><dt>Runs</dt><dd>${n.length}${s?` \xB7 ${s} failed`:""}</dd></div><div><dt>Findings</dt><dd>${r.findings.length}</dd></div>${r.skipped?`<div><dt>Other log lines</dt><dd>${r.skipped} skipped</dd></div>`:""}</dl>
|
|
408
419
|
</section>
|
|
409
420
|
<h2>Runbooks</h2>
|
|
410
421
|
<table class="timeline"><thead><tr><th>Runbook</th><th>Signer (as the gate accepted)</th><th>Runs</th><th>Failed</th></tr></thead><tbody>
|
|
411
|
-
${
|
|
422
|
+
${d}</tbody></table>
|
|
412
423
|
<h2>Runs</h2>
|
|
413
424
|
<table class="timeline"><thead><tr><th>Time</th><th>Who (key)</th><th>Account, client</th><th>Runbook</th><th>Block</th><th>Parameters</th><th>Result</th><th>Duration</th><th>In run record</th></tr></thead><tbody>
|
|
414
|
-
${
|
|
425
|
+
${l}</tbody></table>
|
|
415
426
|
<h2>Findings</h2>
|
|
416
|
-
${
|
|
417
|
-
${
|
|
427
|
+
${u?`<table class="timeline"><thead><tr><th>Time</th><th>What</th><th>Who (key)</th><th>Account, client</th><th>Detail</th></tr></thead><tbody>
|
|
428
|
+
${u}</tbody></table>`:"<p>None: no refusals, no unsigned code, no stopped runs.</p>"}
|
|
418
429
|
${f?`<h2>Endpoint checks</h2>
|
|
419
430
|
<table class="timeline"><thead><tr><th>Time</th><th>Who (key)</th><th>Endpoint</th><th>Address</th><th>Result</th><th>Certificate expires</th><th>Certificate</th><th>Signed run</th><th>Detail</th></tr></thead><tbody>
|
|
420
431
|
${f}</tbody></table>
|
|
421
432
|
`:""}${e.length?`<h2>Run records</h2>
|
|
422
|
-
${
|
|
433
|
+
${h}`:""}</body>
|
|
423
434
|
</html>
|
|
424
|
-
`}var
|
|
435
|
+
`}function vC(r){let e=r.calledBy;return e?` \xB7 called by ${e.runbook?`${e.runbook} v${e.version}`:`sha256 ${e.hash.slice(0,12)}\u2026`} (call ${e.call})`:""}var Ff=`Usage: md-runbook audit <gate log>... [options]
|
|
425
436
|
|
|
426
437
|
Reads md-runbook-gate's log (its log file, or syslog: journalctl -t md-runbook-gate -o cat, or
|
|
427
438
|
/var/log/syslog lines with the tag) and reports every run of a signed runbook: when, the key
|
|
@@ -442,17 +453,31 @@ that checked it). "-" reads standard input.
|
|
|
442
453
|
--browser PATH Browser for a .pdf (default: CHROME_PATH, else one found on this machine)
|
|
443
454
|
|
|
444
455
|
Exit code 0: nothing to flag; 1: findings, or recorded runs the log doesn't show; 2: usage.
|
|
445
|
-
`,
|
|
446
|
-
`)};function
|
|
456
|
+
`,hn=class extends Error{},SC=r=>{process.stdout.write(r+`
|
|
457
|
+
`)};function $f(r,e){let t=new Date(/^\d{4}-\d{2}-\d{2}$/.test(e)?`${e}T00:00:00Z`:e);if(Number.isNaN(t.getTime()))throw new hn(`${r} expects a date or time, got "${e}"`);return t}function yC(r){let e=[...r],t={logs:[],records:[],out:"gate-audit.html"},n=s=>{let i=e.shift();if(i===void 0||i.startsWith("--"))throw new hn(`${s} needs a value`);return i};for(;e.length>0;){let s=e.shift();switch(s){case"--record":t.records.push(n(s));break;case"--since":t.since=$f(s,n(s));break;case"--until":t.until=$f(s,n(s));break;case"--runbook":t.runbook=n(s);break;case"--who":t.who=n(s);break;case"--out":t.out=n(s);break;case"--browser":t.browser=n(s);break;default:if(s.startsWith("--"))throw new hn(`unknown option ${s}`);t.logs.push(s)}}if(t.logs.length===0)throw new hn("missing the gate log (a file, or - for standard input)");if(!/\.(html?|pdf|json)$/i.test(t.out))throw new hn("--out must end in .html, .pdf or .json");return t}async function If(r,e=SC,t=()=>Lt.readFileSync(0,"utf8")){if(r.includes("-h")||r.includes("--help"))return process.stdout.write(Ff),0;let n;try{n=yC(r)}catch(u){if(!(u instanceof hn))throw u;return process.stderr.write(`md-runbook: ${u.message}
|
|
447
458
|
|
|
448
|
-
${
|
|
449
|
-
`),2;let s=0,i=n.logs.flatMap(
|
|
450
|
-
`,"utf8")}else{let
|
|
451
|
-
`),2;await
|
|
459
|
+
${Ff}`),2}for(let u of[...n.logs.filter(f=>f!=="-"),...n.records])if(!Lt.existsSync(u))return process.stderr.write(`md-runbook: no such file: ${u}
|
|
460
|
+
`),2;let s=0,i=n.logs.flatMap(u=>{let f=Sf(u==="-"?t():Lt.readFileSync(u,"utf8"));return s+=f.skipped,f.events}),o=Rf(yf(i,s),n),B=n.records.map(u=>Of(o,Qn.basename(u),Lt.readFileSync(u,"utf8")));if(Lt.mkdirSync(Qn.dirname(Qn.resolve(n.out)),{recursive:!0}),/\.json$/i.test(n.out)){let u=o.probes.map(({run:f,...d})=>({...d,...f?{run:{time:f.time,runbook:f.runbook,version:f.version,cell:f.cell}}:{}}));Lt.writeFileSync(n.out,JSON.stringify({format:"md-runbook gate audit v1",sources:n.logs,...o,probes:u,records:B},null,2)+`
|
|
461
|
+
`,"utf8")}else{let u=Af(o,B,{generatedAt:new Date,sources:n.logs.map(f=>f==="-"?"standard input":Qn.basename(f))});if(/\.pdf$/i.test(n.out)){let f=Sr(n.browser??process.env.CHROME_PATH);if(!f)return process.stderr.write(`md-runbook: a .pdf needs Chrome, Edge or Chromium; none was found (use --browser PATH or CHROME_PATH), or write .html
|
|
462
|
+
`),2;await yr(u,n.out,f)}else Lt.writeFileSync(n.out,u,"utf8")}let a=o.runs.filter(u=>u.exit!==void 0&&u.exit!==0).length,c=B.reduce((u,f)=>u+f.missing.length,0);e(`${o.runs.length} run${o.runs.length===1?"":"s"} in ${o.sessions} session${o.sessions===1?"":"s"}, ${a} failed, ${o.findings.length} finding${o.findings.length===1?"":"s"}`);for(let u of o.findings)e(` ${u.time} ${u.kind}: ${u.who} (${u.account} from ${u.client}): ${u.detail}`);if(o.probes.length){let u=o.probes.filter(f=>!f.ok);e(`${o.probes.length} endpoint check${o.probes.length===1?"":"s"} (md-runbook-probe), ${u.length} failed`);for(let f of u)e(` ${f.time} ${f.target}: ${f.detail}`)}for(let u of B)e(` ${u.file}: ${u.confirmed.length} recorded run${u.confirmed.length===1?"":"s"} confirmed by the log${u.missing.length?`, ${u.missing.length} not in it (steps ${u.missing.map(f=>f.step).join(", ")})`:""}`);let l=o.findings.length>0||c>0;return e(`${l?"\u2717":"\u2713"} ${n.out}`),l?1:0}var Tf=le(require("node:fs")),Lf=le(require("node:os"));var RC=r=>new Promise(e=>setTimeout(e,r));function Nf(r,e){return[...r,e.MD_RUNBOOK_REPORT_ALLOWED??""].flatMap(t=>t.split(",")).map(t=>t.trim()).filter(t=>t!=="")}async function Mf(r,e,t){if(!ve(r)?.reportRuns)return;let n=e.allowedSigners?await HB(r,e.allowedSigners):void 0,s=Nc(r,n);if(!s)return;let i=Gc(s.url,e.allowed);return s.required&&!i?`this signed runbook runs only if its run is reported to ${s.host} (${Mc}) Allow it with --report-to-allowed ${s.host}.`:s.signed&&!e.key?"this signed runbook runs only if its run summary is signed with your SSH key: add --key KEY (a key file, or a .pub whose key is in the agent), and give your server's allowed runners file its line (namespace md-runbook-run).":(i?s.ignored&&(ve(r)?.reportRunsRequired||ve(r)?.reportRunsSigned)&&t(`\u2139 report-runs-required/-signed ignored: ${s.ignored}`):t(`\u2139 the runbook reports its runs to ${s.host}: not sent (allow it with --report-to-allowed ${s.host})`),{plan:s,...n?{signer:n}:{},send:i})}function OC(){try{return Lf.userInfo().username}catch{return process.env.USER??process.env.USERNAME??"unknown"}}var AC={passed:"passed",failed:"failed",skipped:"skipped","not run":"not-run"};function FC(r,e){return[...r.map(n=>{let s=n.status==="passed"||n.status==="failed";return{at:n.line-1,label:n.title,state:AC[n.status],...s?{ms:n.durationMs,ran:s}:{}}}),...e.map(n=>({at:n.line,label:n.text,state:n.ticked?"by-hand":"not-run"}))].sort((n,s)=>n.at-s.at).map(({at:n,...s})=>s)}async function Gf(r,e,t,n,s,i=[1e3,3e3]){if(!r.send)return!0;let o=Tc({file:e.file,text:e.text,who:OC(),client:"cli",started:e.started,ended:e.ended,steps:FC(e.steps,e.manual),...r.signer?{trustedSigner:r.signer}:{},alertParams:e.params}),B;try{B=t.key?Mi(o,{signature:await _B(o,t.key)}):Mi(o)}catch(l){if(s(`run report to ${r.plan.host}: signing failed: ${l instanceof Error?l.message:String(l)}`),r.plan.signed)return!1;B=Mi(o)}let a=r.plan.token?n[r.plan.token]:void 0;if(r.plan.token&&a===void 0)return s(`run report to ${r.plan.host}: not sent: the environment variable ${r.plan.token} (report-runs-token) is not set`),!1;let c="";for(let l=0;l<=i.length;l++){l>0&&await RC(i[l-1]);let u=await Pc({url:r.plan.url,body:B,...a?{token:a}:{}});if(u.ok)return!0;if(c=u.why,!u.retry)break}return s(`run report to ${r.plan.host}: not sent (${c})`),!1}var ia=`Usage: md-runbook verify-run <envelope.json> --allowed-runners FILE
|
|
463
|
+
|
|
464
|
+
Checks a signed run summary as a server would: the signature (namespace md-runbook-run) is good
|
|
465
|
+
by a key in FILE (OpenSSH allowed_signers format, e.g.
|
|
466
|
+
ana@example.net namespaces="md-runbook-run" ssh-ed25519 AAAA\u2026)
|
|
467
|
+
and covers the summary as it is. Prints the runner and the summary; exit 0 when good, 1 when not,
|
|
468
|
+
2 for a usage error. "-" reads the envelope from standard input.
|
|
469
|
+
`;async function Pf(r,e=t=>{process.stdout.write(t+`
|
|
470
|
+
`)}){let t=[...r],n,s;for(;t.length>0;){let o=t.shift();if(o==="-h"||o==="--help")return process.stdout.write(ia),0;if(o==="--allowed-runners")s=t.shift();else{if(o.startsWith("-")&&o!=="-")return process.stderr.write(`md-runbook: unknown option ${o}
|
|
471
|
+
|
|
472
|
+
${ia}`),2;n=o}}if(!n||!s)return process.stderr.write(`md-runbook: ${n?"--allowed-runners needs a file":"missing the envelope file"}
|
|
473
|
+
|
|
474
|
+
${ia}`),2;let i;try{i=Tf.readFileSync(n==="-"?0:n,"utf8")}catch(o){return process.stderr.write(`md-runbook: ${o instanceof Error?o.message:String(o)}
|
|
475
|
+
`),2}try{let{signer:o,envelope:B}=await JB(i,s);return e(`\u2713 signed by ${o} (${s})`),e(JSON.stringify(B.summary,null,2)),0}catch(o){return e(`\u2717 ${o instanceof Error?o.message:String(o)}`),1}}var zi=`Usage: md-runbook run <file.md> [options]
|
|
452
476
|
md-runbook lint <file.md>... [--strict]
|
|
453
477
|
md-runbook estimate <file.md>... (how long each section takes, by estimate=)
|
|
454
478
|
md-runbook sign <file.md> --key KEY [options] (see md-runbook sign --help)
|
|
455
479
|
md-runbook verify <file.md> [--allowed-signers FILE]
|
|
480
|
+
md-runbook verify-run <envelope.json> --allowed-runners FILE (a signed run report)
|
|
456
481
|
md-runbook qr <file.md> [options] (see md-runbook qr --help)
|
|
457
482
|
md-runbook link <file.md> [options] (the qr options; prints the link)
|
|
458
483
|
md-runbook audit <gate log>... [options] (see md-runbook audit --help)
|
|
@@ -481,6 +506,13 @@ Options:
|
|
|
481
506
|
--section TEXT Run only the steps under headings that start with TEXT, e.g. "3." or
|
|
482
507
|
"Rollback" (repeatable; with --from/--to, both must hold)
|
|
483
508
|
--keep-going Carry on after a failed step
|
|
509
|
+
--teardown Also run the teardown steps (teardown option) after a run that passed;
|
|
510
|
+
without it they are listed, not run (you may go on to the next runbook)
|
|
511
|
+
--teardown=always Run the teardown steps after a failure too (CI that must clean up)
|
|
512
|
+
--setup With --from/--to/--section: also run the setup steps (setup option), and
|
|
513
|
+
the ready check first, so a resumed run brings back what is down
|
|
514
|
+
--setup-always Run the setup steps even when the ready check (ready option) says up
|
|
515
|
+
--no-setup Run neither the setup steps nor the ready check
|
|
484
516
|
--copy-folder DIR Where runbook calls (\`\`\`runbook blocks) write the copies of the runbooks
|
|
485
517
|
they run, relative to each one (default: next to it)
|
|
486
518
|
--allowed-signers FILE
|
|
@@ -498,6 +530,14 @@ Options:
|
|
|
498
530
|
--notify URL Post a summary to a chat webhook (Slack, Teams Workflows, Discord, Google
|
|
499
531
|
Chat); better: the environment variable MD_RUNBOOK_NOTIFY_URL
|
|
500
532
|
--notify-on WHEN failure (default) or always; or MD_RUNBOOK_NOTIFY_ON
|
|
533
|
+
--report-to-allowed ADDRESS
|
|
534
|
+
Send the run summary to the runbook's report-runs: address when it is
|
|
535
|
+
ADDRESS (a host, or an address prefix; repeatable, comma-separated; or
|
|
536
|
+
MD_RUNBOOK_REPORT_ALLOWED). Without it nothing is sent, and a signed
|
|
537
|
+
runbook that requires its report doesn't run (exit 2). Only names, step
|
|
538
|
+
results and times are sent: never outputs, values or secrets
|
|
539
|
+
--key KEY Sign the run summary with this SSH key (namespace md-runbook-run); needed
|
|
540
|
+
for a signed runbook with report-runs-signed: true
|
|
501
541
|
--quiet Only print the summary
|
|
502
542
|
-h, --help Show this help
|
|
503
543
|
--version Show the version
|
|
@@ -506,35 +546,42 @@ lint checks runbooks without running them (invalid or unknown cell options, \${o
|
|
|
506
546
|
without an earlier capture=NAME, undeclared \${param:NAME}, ignored front matter values) and
|
|
507
547
|
exits with 1 when it finds an error (with --strict: also a warning).
|
|
508
548
|
|
|
549
|
+
A run report that can't be sent is tried 3 times, then a warning; the exit code is 3 only when
|
|
550
|
+
the runbook required it (signed as a whole by a signer of --allowed-signers) and the run passed.
|
|
551
|
+
|
|
509
552
|
estimate adds up the blocks' estimate= options (e.g. estimate=2m30s): one line per # and ##
|
|
510
553
|
section with its time and the blocks without an estimate, then the runbook's total. A run
|
|
511
554
|
prints a step's estimate on its "\u25B6 Step N" line, warns when the step took more than twice it,
|
|
512
|
-
and in a terminal shows after each step how far the run is and about how long is left.
|
|
555
|
+
and in a terminal shows after each step how far the run is and about how long is left. With
|
|
556
|
+
setup or teardown steps, a "Parts:" line says how long each part takes.
|
|
513
557
|
|
|
514
558
|
\${secret:NAME} values come from the environment variable NAME and are redacted from output.
|
|
515
559
|
On GitHub Actions, a summary table is added to the job summary.
|
|
516
|
-
`,
|
|
560
|
+
`,Bt=class extends Error{};function $C(r,e){try{return Ve.readFileSync(vt.resolve(vt.dirname(vt.resolve(r)),e),"utf8")}catch{return}}function Ki(r,e){Ve.mkdirSync(vt.dirname(vt.resolve(r)),{recursive:!0}),Ve.writeFileSync(r,e,"utf8")}function Hf(r){let e=[...r];if(e.length===0||e[0]==="-h"||e[0]==="--help")return"help";if(e[0]==="--version")return"version";if(e[0]!=="run")throw new Bt(`unknown command "${e[0]}" (expected run, lint, estimate, sign, verify, verify-run, qr, link or audit)`);e.shift();let t={file:"",write:!0,params:{},inputs:{},yes:!1,keepGoing:!1,shell:{}},n,s,i,o,B=!1,a=[],c,l=f=>{let d=e.shift();if(d===void 0||d.startsWith("--"))throw new Bt(`${f} needs a value`);return d},u=(f,d)=>{let h=l(f),p=h.indexOf("=");if(p<=0)throw new Bt(`${f} expects NAME=VALUE, got "${h}"`);d[h.slice(0,p)]=h.slice(p+1)};for(;e.length>0;){let f=e.shift();switch(f){case"--check":t.write=!1;break;case"--out":t.out=l(f);break;case"--report":t.report=l(f);break;case"--pdf":n=l(f);break;case"--browser":s=l(f);break;case"--notify":i=l(f);break;case"--notify-on":o=l(f);break;case"--junit":t.junit=l(f);break;case"--json":t.json=l(f);break;case"--transcript":t.transcript=l(f);break;case"--param":u(f,t.params);break;case"--input":u(f,t.inputs);break;case"--yes":t.yes=!0;break;case"--keep-going":t.keepGoing=!0;break;case"--teardown":t.teardown="success";break;case"--teardown=always":t.teardown="always";break;case"--setup":t.addSetup=!0;break;case"--setup-always":case"--no-setup":{let d=f==="--no-setup"?"never":"always";if(t.setup&&t.setup!==d)throw new Bt("--setup-always and --no-setup exclude each other");t.setup=d;break}case"--from":case"--to":{let d=l(f);if(!/^[1-9]\d*$/.test(d))throw new Bt(`${f} expects a step number (1, 2, \u2026), got "${d}"`);t[f==="--from"?"from":"to"]=Number(d);break}case"--section":{let d=l(f);if(d.trim()==="")throw new Bt("--section needs the start of a heading");(t.sections??=[]).push(d);break}case"--session":t.session=!0;break;case"--isolated":t.session=!1;break;case"--timeout":{let d=Number(l(f));if(!Number.isFinite(d)||d<0)throw new Bt("--timeout expects seconds (0 = none)");t.timeoutSeconds=d;break}case"--bash":t.shell.bashPath=l(f);break;case"--pwsh":t.shell.pwshPath=l(f);break;case"--quiet":B=!0;break;case"--copy-folder":t.copyFolder=l(f);break;case"--fresh-copy":t.freshCopy=!0;break;case"--allowed-signers":t.allowedSigners=l(f);break;case"--report-to-allowed":a.push(l(f));break;case"--key":c=l(f);break;default:if(f.startsWith("-"))throw new Bt(`unknown option ${f}`);if(t.file)throw new Bt(`only one runbook per run (got "${t.file}" and "${f}")`);t.file=f}}if(!t.file)throw new Bt("missing the runbook file");if(t.from!==void 0&&t.to!==void 0&&t.from>t.to)throw new Bt(`--from ${t.from} is after --to ${t.to}`);return{options:t,reportAllowed:a,...c?{key:c}:{},...n?{pdf:n}:{},...s?{browser:s}:{},...i?{notify:i}:{},...o?{notifyOn:o}:{},quiet:B}}function _f(r,e=t=>{process.stdout.write(t+`
|
|
517
561
|
`)}){let t=r.includes("--strict"),n=r.filter(a=>a!=="--strict"),s=n.find(a=>a.startsWith("-"));if(s||n.length===0)return process.stderr.write(`md-runbook: ${s?`unknown option ${s}`:"missing the runbook file(s)"}
|
|
518
562
|
|
|
519
|
-
${
|
|
563
|
+
${zi}`),2;let i=process.env.GITHUB_ACTIONS==="true",o=!1,B=0;for(let a of n){if(!Ve.existsSync(a)){e(`${a}: error: no such file`),o=!0;continue}for(let c of oc(Ve.readFileSync(a,"utf8"),{readRunbook:UB(a),matchRunbooks:l=>jB(a,l)}))B++,e(Bc(a,c)),i&&e(`::${c.severity} file=${a},line=${c.line+1}::${c.message.replace(/\r?\n/g," ")}`),(c.severity==="error"||t)&&(o=!0)}return e(`${o?"\u2717":"\u2713"} ${n.length} runbook${n.length===1?"":"s"} checked, ${B} problem${B===1?"":"s"}`),o?1:0}function Jf(r,e=t=>{process.stdout.write(t+`
|
|
520
564
|
`)}){let t=r.find(s=>s.startsWith("-"));if(t||r.length===0)return process.stderr.write(`md-runbook: ${t?`unknown option ${t}`:"missing the runbook file(s)"}
|
|
521
565
|
|
|
522
|
-
${
|
|
566
|
+
${zi}`),2;let n=!1;return r.forEach((s,i)=>{if(i>0&&e(""),!Ve.existsSync(s)){e(`${s}: error: no such file`),n=!0;return}let o=Ei(Ve.readFileSync(s,"utf8"),void 0,(f,d)=>Es(s,f,d)),B=(f,d,h)=>d===0?"\u2013":`${h===d?"?":it(f)}${h>0?` (${mi(h)})`:""}`,a=o.sections.map(f=>[f.level===0?"(before the first heading)":`${"#".repeat(f.level)} ${f.heading}`,B(f.seconds,f.blocks,f.unestimated)]),c=Math.min(60,Math.max(0,...a.map(([f])=>f.length)));e(s);for(let[f,d]of a)e(` ${f.length>c?f.slice(0,c-1)+"\u2026":f.padEnd(c)} ${d}`);e(` Total: ${B(o.totalSeconds,o.blocks,o.unestimated)} for ${o.blocks} block${o.blocks===1?"":"s"}`);let{setup:l,teardown:u}=o.parts;if(l.blocks>0||u.blocks>0){let f={seconds:o.totalSeconds-l.seconds-u.seconds,blocks:o.blocks-l.blocks-u.blocks,unestimated:o.unestimated-l.unestimated-u.unestimated};e(` Parts: ${[...l.blocks>0?[`setup ${B(l.seconds,l.blocks,l.unestimated)}${o.guarded?" (skipped when already up)":""}`]:[],`runbook ${B(f.seconds,f.blocks,f.unestimated)}`,...u.blocks>0?[`teardown ${B(u.seconds,u.blocks,u.unestimated)} (offered)`]:[]].join(" \xB7 ")}`)}}),n?1:0}async function Uf(r){if(r[0]==="lint")return _f(r.slice(1));if(r[0]==="estimate")return Jf(r.slice(1));if(r[0]==="sign")return pf(r.slice(1));if(r[0]==="verify")return hf(r.slice(1));if(r[0]==="verify-run")return Pf(r.slice(1));if(r[0]==="qr")return sa(r.slice(1));if(r[0]==="link")return sa(r.slice(1),void 0,!0);if(r[0]==="audit")return If(r.slice(1));let e;try{e=Hf(r)}catch(y){if(!(y instanceof Bt))throw y;return process.stderr.write(`md-runbook: ${y.message}
|
|
523
567
|
|
|
524
|
-
${
|
|
525
|
-
`),0;let{options:t,quiet:n}=e;if(!
|
|
526
|
-
`),2;let s=
|
|
527
|
-
`),2;delete process.env.MD_RUNBOOK_NOTIFY_URL;let i=async
|
|
528
|
-
`)}},
|
|
529
|
-
`)}
|
|
530
|
-
`),2;
|
|
531
|
-
|
|
532
|
-
`);
|
|
533
|
-
`);let
|
|
534
|
-
`)
|
|
535
|
-
`)
|
|
536
|
-
|
|
537
|
-
`),
|
|
568
|
+
${zi}`),2}if(e==="help")return process.stdout.write(zi),0;if(e==="version")return process.stdout.write(`0.23.0
|
|
569
|
+
`),0;let{options:t,quiet:n}=e;if(!Ve.existsSync(t.file))return process.stderr.write(`md-runbook: no such file: ${t.file}
|
|
570
|
+
`),2;let s=of(e.notify??process.env.MD_RUNBOOK_NOTIFY_URL,e.notifyOn??process.env.MD_RUNBOOK_NOTIFY_ON);if(typeof s=="string")return process.stderr.write(`md-runbook: ${s}
|
|
571
|
+
`),2;delete process.env.MD_RUNBOOK_NOTIFY_URL;let i=async y=>{if(s)try{await af(s.url,y)}catch(O){process.stderr.write(`md-runbook: ${O instanceof Error?O.message:String(O)}
|
|
572
|
+
`)}},o=Ve.readFileSync(t.file,"utf8"),B={allowed:Nf(e.reportAllowed,process.env),...e.key?{key:e.key}:{},...t.allowedSigners?{allowedSigners:t.allowedSigners}:{}},a=await Mf(o,B,y=>{n||process.stdout.write(y+`
|
|
573
|
+
`)});if(typeof a=="string")return process.stderr.write(`md-runbook: not run: ${a}
|
|
574
|
+
`),2;let c=Date.now(),l=new AbortController,u=()=>l.abort();process.once("SIGINT",u),process.once("SIGTERM",u);let f;try{f=await XB({...t,env:process.env,signal:l.signal,progress:process.stdout.isTTY===!0&&!n,...s?{extraSecrets:[s.url]}:{}},{out:y=>{n||process.stdout.write(y)},log:y=>{n||process.stdout.write(y+`
|
|
575
|
+
`)}})}catch(y){if(y instanceof gt)return process.off("SIGINT",u),process.off("SIGTERM",u),process.stderr.write(`md-runbook: ${y.message}
|
|
576
|
+
`),2;throw await i(`\u2717 ${vt.basename(t.file)}: the run stopped with an error${Ui(process.env)?`
|
|
577
|
+
${Ui(process.env)}`:""}`),y}process.off("SIGINT",u),process.off("SIGTERM",u);let d=vt.basename(t.file),h=t.out??t.file;t.write&&Ki(h,f.text);let p=()=>DB(f.text,{generatedAt:new Date,fallbackTitle:d,redact:f.redact,readCall:y=>$C(t.file,y)});if(t.report&&Ki(t.report,p()),t.junit&&Ki(t.junit,rf(d,f.steps,f.manual)),t.json){let y=f.setup?{setup:f.setup}:{};Ki(t.json,JSON.stringify({file:d,ok:f.ok,...y,steps:f.steps,manual:f.manual,record:Di(f.text)},null,2)+`
|
|
578
|
+
`)}let w=process.env.GITHUB_STEP_SUMMARY;w&&Ve.appendFileSync(w,sf(d,f.steps,f.manual)+`
|
|
579
|
+
`);let D=!1;if(e.pdf){let y=Sr(e.browser??process.env.CHROME_PATH);if(!y)process.stderr.write(`md-runbook: --pdf needs Chrome, Edge or Chromium; none was found (use --browser PATH or CHROME_PATH)
|
|
580
|
+
`),D=!0;else try{Ve.mkdirSync(vt.dirname(vt.resolve(e.pdf)),{recursive:!0}),await yr(p(),e.pdf,y)}catch(O){process.stderr.write(`md-runbook: PDF export failed: ${O instanceof Error?O.message:String(O)}
|
|
581
|
+
`),D=!0}}s&&(s.on==="always"||!f.ok)&&await i(Bf(d,f,Ui(process.env)));let m=Object.fromEntries((ve(o)?.params??[]).flatMap(y=>y.default!==void 0?[[y.name,y.default]]:[])),b=a?await Gf(a,{file:t.file,text:o,started:c,ended:Date.now(),steps:f.steps,manual:f.manual,params:{...m,...t.params}},B,process.env,y=>{process.stderr.write(`md-runbook: ${y}
|
|
582
|
+
`)}):!0,v=y=>f.steps.filter(O=>O.status===y).length,R=[`${v("passed")} passed`,`${v("failed")} failed`];v("skipped")&&R.push(`${v("skipped")} skipped`),v("not run")&&R.push(`${v("not run")} not run`);let S=f.steps.filter(y=>y.status==="passed"||y.status==="failed"),I=S.reduce((y,O)=>y+(O.estimateSeconds??0),0),x=S.filter(y=>y.estimateSeconds===void 0).length,E=I>0?` \xB7 took ${it(S.reduce((y,O)=>y+O.durationMs,0)/1e3)}, estimated ${it(I)}`+(x>0?` (${x} step${x===1?"":"s"} without an estimate)`:""):"";return process.stdout.write(`
|
|
583
|
+
${f.ok?"\u2713":"\u2717"} ${d}: ${f.steps.length} step${f.steps.length===1?"":"s"}, ${R.join(", ")}${E}${t.write?` \xB7 outputs written to ${h}`:""}
|
|
584
|
+
`),f.ok&&!D?!b&&a?.plan.required?3:0:1}require.main===module&&Uf(process.argv.slice(2)).then(r=>process.exitCode=r,r=>{process.stderr.write(`md-runbook: ${r instanceof Error?r.stack??r.message:String(r)}
|
|
538
585
|
`),process.exitCode=1});0&&(module.exports={estimate,lint,main,parseArgs});
|
|
539
586
|
/*! Bundled license information:
|
|
540
587
|
|