ripplo 0.10.0 → 0.11.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.
Files changed (99) hide show
  1. package/README.md +105 -47
  2. package/dist/assets/rrweb-replay.js +1 -1
  3. package/dist/assets/rrweb.js +1 -1
  4. package/dist/capture-worker.js +20 -14
  5. package/dist/chunk-3HAQCJRK.js +4 -0
  6. package/dist/{chunk-5E62BCS7.js → chunk-47LLHHJH.js} +2 -2
  7. package/dist/chunk-4YAC72LW.js +7 -0
  8. package/dist/chunk-5HFJIZLI.js +4 -0
  9. package/dist/chunk-6U2LNGSV.js +51 -0
  10. package/dist/{chunk-LL4HUOJP.js → chunk-6WFJZ5L6.js} +1 -1
  11. package/dist/chunk-7JKCHASU.js +4 -0
  12. package/dist/{chunk-CEVQ5RNC.js → chunk-7RREARGA.js} +2 -2
  13. package/dist/{chunk-WNAVYV4P.js → chunk-AXROBTLA.js} +1 -1
  14. package/dist/chunk-BGY5F3IU.js +5 -0
  15. package/dist/{chunk-IPSXNIXC.js → chunk-C7SV6AR2.js} +4 -4
  16. package/dist/chunk-CI6273ZU.js +107 -0
  17. package/dist/chunk-DY7ZW6QZ.js +9 -0
  18. package/dist/chunk-E6ZBZIIS.js +4 -0
  19. package/dist/chunk-G6J2WIHJ.js +4 -0
  20. package/dist/{chunk-4OSYMIH6.js → chunk-GYBY7EOO.js} +1 -1
  21. package/dist/{chunk-LOEAZGYO.js → chunk-HEOMRXZE.js} +1 -1
  22. package/dist/chunk-IK3ROREL.js +6 -0
  23. package/dist/{chunk-7W237JFM.js → chunk-JS3DLVVI.js} +1 -1
  24. package/dist/{chunk-TPHOSZAK.js → chunk-KH4QH23U.js} +1 -1
  25. package/dist/{chunk-QAR7FZO3.js → chunk-LEFODI2H.js} +1 -1
  26. package/dist/{chunk-43C7VPGA.js → chunk-LWMXGWS2.js} +1 -1
  27. package/dist/chunk-O45YB6YY.js +354 -0
  28. package/dist/{chunk-YQ2RBEOJ.js → chunk-PXXURBGC.js} +2 -2
  29. package/dist/{chunk-OAU4HUD2.js → chunk-PYDYI3AA.js} +2 -2
  30. package/dist/{chunk-R3DZ6JPY.js → chunk-RIASQHPG.js} +1 -1
  31. package/dist/chunk-S2K5KILQ.js +8 -0
  32. package/dist/chunk-SXVWB7TZ.js +6 -0
  33. package/dist/{chunk-5X4M4MTG.js → chunk-UH5CQF5R.js} +3 -3
  34. package/dist/{chunk-UDPKOYZT.js → chunk-VKAZQPJJ.js} +1 -1
  35. package/dist/chunk-WAGXAEB4.js +13 -0
  36. package/dist/chunk-WBKSJU63.js +83 -0
  37. package/dist/{chunk-AGK6XOX2.js → chunk-XAMVRZJH.js} +2 -2
  38. package/dist/chunk-ZHDR7LXB.js +56 -0
  39. package/dist/{cli-error-AHNJULLG.js → cli-error-6PUIWNIT.js} +1 -1
  40. package/dist/{compile-write-OLQOR3OK.js → compile-write-KUUFWSI4.js} +1 -1
  41. package/dist/daemon-2ZTZXQW6.js +4 -0
  42. package/dist/daemon-GP3EIISA.js +152 -0
  43. package/dist/{daemon-lock-OAARBZ4O.js → daemon-lock-RPKO5SNE.js} +1 -1
  44. package/dist/dsl-loader-WPAKMON7.js +4 -0
  45. package/dist/dsl-typecheck-worker.js +6 -0
  46. package/dist/{exit-plan-gate-CJ3IXWTN.js → exit-plan-gate-44YWEKYS.js} +1 -1
  47. package/dist/hook.js +1 -1
  48. package/dist/index.js +207 -260
  49. package/dist/{plan-reminder-EPCNBFY3.js → plan-reminder-PP5DQAQZ.js} +1 -1
  50. package/dist/post-edit-R7KN424T.js +4 -0
  51. package/dist/post-edit-analyze-UURDL3AH.js +4 -0
  52. package/dist/post-edit-flag-stubs-I7AUGN4D.js +4 -0
  53. package/dist/pre-bash-run-gate-MIEM2DBB.js +4 -0
  54. package/dist/pre-edit-C4MGURNO.js +4 -0
  55. package/dist/pre-edit-ripplo-skill-gate-A6ETC3QN.js +4 -0
  56. package/dist/pre-edit-scope-gate-M5IQSVGF.js +4 -0
  57. package/dist/{pre-edit-watch-gate-BUFWLXR3.js → pre-edit-watch-gate-ORQP7MSW.js} +1 -1
  58. package/dist/prompt-submit-6KNOFK4W.js +4 -0
  59. package/dist/scope-reminder-A6GVTTVE.js +4 -0
  60. package/dist/session-preamble-IZQPIWST.js +4 -0
  61. package/dist/status-PG4EBZRM.js +4 -0
  62. package/dist/{stop-enforce-4XV6LK7Z.js → stop-enforce-CO5GYI3G.js} +9 -9
  63. package/dist/tasks-reminder-TDWPD3KV.js +4 -0
  64. package/dist/{track-skill-load-CJ74GD3Q.js → track-skill-load-SXSDMHFO.js} +1 -1
  65. package/dist/{track-skill-prompt-YSB6OOQN.js → track-skill-prompt-7N4TQAD2.js} +1 -1
  66. package/package.json +2 -4
  67. package/dist/chunk-26A42N75.js +0 -55
  68. package/dist/chunk-44GHUVW6.js +0 -8
  69. package/dist/chunk-67YR3QHA.js +0 -6
  70. package/dist/chunk-6NKSEWP6.js +0 -224
  71. package/dist/chunk-6TCK75ER.js +0 -83
  72. package/dist/chunk-73TKORK6.js +0 -8
  73. package/dist/chunk-CB74TAUC.js +0 -5
  74. package/dist/chunk-FXCBWBN5.js +0 -4
  75. package/dist/chunk-GOZWOCTE.js +0 -7
  76. package/dist/chunk-IONMYZ3K.js +0 -4
  77. package/dist/chunk-LB65USNP.js +0 -73
  78. package/dist/chunk-M3CXHDFV.js +0 -9
  79. package/dist/chunk-MOI4L3EX.js +0 -4
  80. package/dist/chunk-N2OBRCPQ.js +0 -6
  81. package/dist/chunk-OWN4P2K7.js +0 -4
  82. package/dist/chunk-SNU66GSR.js +0 -4
  83. package/dist/chunk-VDAFHS7J.js +0 -7
  84. package/dist/chunk-VOZOP7MQ.js +0 -55
  85. package/dist/daemon-BJAGK2Q3.js +0 -152
  86. package/dist/daemon-H4P5PCVH.js +0 -4
  87. package/dist/dsl-loader-LXH6PUY5.js +0 -4
  88. package/dist/post-edit-ZVCYZ62V.js +0 -4
  89. package/dist/post-edit-analyze-J2H3I3IO.js +0 -4
  90. package/dist/post-edit-flag-stubs-E22KT2LD.js +0 -4
  91. package/dist/pre-bash-run-gate-B42YNDQF.js +0 -4
  92. package/dist/pre-edit-TEN3AFRK.js +0 -4
  93. package/dist/pre-edit-ripplo-skill-gate-QHUD7QGU.js +0 -4
  94. package/dist/pre-edit-scope-gate-2YIFSEDY.js +0 -4
  95. package/dist/prompt-submit-DJFWNGYC.js +0 -4
  96. package/dist/scope-reminder-DIDCHDAA.js +0 -4
  97. package/dist/session-preamble-ZYVRDSGA.js +0 -4
  98. package/dist/status-FDM2RK37.js +0 -4
  99. package/dist/tasks-reminder-SDS6RNLP.js +0 -4
@@ -51,4 +51,4 @@ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LAN
51
51
  https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new Gs().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return A([i(a)]).process(o,l)},i};A.stringify=dh;A.parse=wh;A.fromJSON=ph;A.list=bh;A.comment=s=>new So(s);A.atRule=s=>new vo(s);A.decl=s=>new wo(s);A.rule=s=>new Co(s);A.root=s=>new Io(s);A.document=s=>new bo(s);A.CssSyntaxError=ch;A.Declaration=wo;A.Container=fh;A.Processor=Gs;A.Document=bo;A.Comment=So;A.Warning=mh;A.AtRule=vo;A.Result=gh;A.Input=yh;A.Rule=Co;A.Root=Io;A.Node=Sh;hh.registerPostcss(A);var vh=A;A.default=A;var F=_u(vh);F.stringify;F.fromJSON;F.plugin;F.parse;F.list;F.document;F.comment;F.atRule;F.rule;F.decl;F.root;F.CssSyntaxError;F.Declaration;F.Container;F.Processor;F.Document;F.Comment;F.Warning;F.AtRule;F.Result;F.Input;F.Rule;F.Root;F.Node;var hs=class s{constructor(...e){ee(this,"parentElement",null),ee(this,"parentNode",null),ee(this,"ownerDocument"),ee(this,"firstChild",null),ee(this,"lastChild",null),ee(this,"previousSibling",null),ee(this,"nextSibling",null),ee(this,"ELEMENT_NODE",1),ee(this,"TEXT_NODE",3),ee(this,"nodeType"),ee(this,"nodeName"),ee(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof s){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};var Pi={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Li={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Dt={},Ch=()=>!!globalThis.Zone;function js(s){if(Dt[s])return Dt[s];let e=globalThis[s],t=e.prototype,r=s in Pi?Pi[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in Li?Li[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!Ch())return Dt[s]=e.prototype,e.prototype;try{let l=document.createElement("iframe");document.body.appendChild(l);let a=l.contentWindow;if(!a)return e.prototype;let u=a[s].prototype;return document.body.removeChild(l),u?Dt[s]=u:t}catch{return t}}var Or={};function pe(s,e,t){var r;let i=`${s}.${String(t)}`;if(Or[i])return Or[i].call(e);let n=js(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Or[i]=o,o.call(e)):e[t]}var Dr={};function Eo(s,e,t){let r=`${s}.${String(t)}`;if(Dr[r])return Dr[r].bind(e);let n=js(s)[t];return typeof n!="function"?e[t]:(Dr[r]=n,n.bind(e))}function Ih(s){return pe("Node",s,"ownerDocument")}function Eh(s){return pe("Node",s,"childNodes")}function xh(s){return pe("Node",s,"parentNode")}function Mh(s){return pe("Node",s,"parentElement")}function Nh(s){return pe("Node",s,"textContent")}function Rh(s,e){return Eo("Node",s,"contains")(e)}function Ah(s){return Eo("Node",s,"getRootNode")()}function Oh(s){return!s||!("host"in s)?null:pe("ShadowRoot",s,"host")}function Dh(s){return s.styleSheets}function Th(s){return!s||!("shadowRoot"in s)?null:pe("Element",s,"shadowRoot")}function _h(s,e){return pe("Element",s,"querySelector")(e)}function kh(s,e){return pe("Element",s,"querySelectorAll")(e)}function xo(){return js("MutationObserver").constructor}function Ie(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}var C={ownerDocument:Ih,childNodes:Eh,parentNode:xh,parentElement:Mh,textContent:Nh,contains:Rh,getRootNode:Ah,host:Oh,styleSheets:Dh,shadowRoot:Th,querySelector:_h,querySelectorAll:kh,mutationObserver:xo,patch:Ie};function Z(s,e,t=document){let r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}var xe=`Please stop import mirror directly. Instead of that,\r
52
52
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
53
53
  or you can use record.mirror to access the mirror instance during recording.`,Fi={map:{},getId(){return console.error(xe),-1},getNode(){return console.error(xe),null},removeNodeFromMap(){console.error(xe)},has(){return console.error(xe),!1},reset(){console.error(xe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Fi=new Proxy(Fi,{get(s,e,t){return e==="map"&&console.error(xe),Reflect.get(s,e,t)}}));function rt(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===!1&&(i=o);let l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function dr(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>dr(s,e,n||{},!0)}var qt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(qt=()=>new Date().getTime());function Mo(s){var e,t,r,i;let n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||n?.body&&((e=C.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n?.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:n?.documentElement.scrollTop||n?.body&&((r=C.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n?.body)==null?void 0:i.scrollTop)||0}}function No(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ro(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ao(s){return s?s.nodeType===s.ELEMENT_NODE?s:C.parentElement(s):null}function X(s,e,t,r){if(!s)return!1;let i=Ao(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Gt(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function $h(s,e){return e.getId(s)!==-1}function Tr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===Ye}function Oo(s,e){if(Ge(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=C.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Oo(r,e):!0}function fs(s){return!!s.changedTouches}function Ph(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Do(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function To(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function ds(s){return s?s instanceof hs&&"shadowRoot"in s?!!s.shadowRoot:!!C.shadowRoot(s):!1}var ps=class{constructor(){w(this,"id",1),w(this,"styleIDMap",new WeakMap),w(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function _o(s){var e;let t=null;return"getRootNode"in s&&((e=C.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&C.host(C.getRootNode(s))&&(t=C.host(C.getRootNode(s))),t}function Lh(s){let e=s,t;for(;t=_o(e);)e=t;return e}function Fh(s){let e=C.ownerDocument(s);if(!e)return!1;let t=Lh(s);return C.contains(e,t)}function ko(s){let e=C.ownerDocument(s);return e?C.contains(e,s)||Fh(s):!1}var x=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(x||{}),I=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(I||{}),J=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(J||{}),ce=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(ce||{}),Pe=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Pe||{}),Me=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Me||{});var $o=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))($o||{});function Ui(s){return"__ln"in s}var ms=class{constructor(){w(this,"length",0),w(this,"head",null),w(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ui(e.previousSibling)){let r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Ui(e.nextSibling)&&e.nextSibling.__ln.previous){let r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Bi=(s,e)=>`${s}@${e}`,gs=class{constructor(){w(this,"frozen",!1),w(this,"locked",!1),w(this,"texts",[]),w(this,"attributes",[]),w(this,"attributeMap",new WeakMap),w(this,"removes",[]),w(this,"mapRemoves",[]),w(this,"movedMap",{}),w(this,"addedSet",new Set),w(this,"movedSet",new Set),w(this,"droppedSet",new Set),w(this,"removesSubTreeCache",new Set),w(this,"mutationCb"),w(this,"blockClass"),w(this,"blockSelector"),w(this,"maskTextClass"),w(this,"maskTextSelector"),w(this,"inlineStylesheet"),w(this,"maskInputOptions"),w(this,"maskTextFn"),w(this,"maskInputFn"),w(this,"keepIframeSrcFn"),w(this,"recordCanvas"),w(this,"inlineImages"),w(this,"slimDOMOptions"),w(this,"dataURLOptions"),w(this,"doc"),w(this,"mirror"),w(this,"iframeManager"),w(this,"stylesheetManager"),w(this,"shadowDomManager"),w(this,"canvasManager"),w(this,"processedNodeManager"),w(this,"unattachedDoc"),w(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),w(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new ms,i=a=>{let u=a,c=Ye;for(;c===Ye;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=a=>{let u=C.parentNode(a);if(!u||!ko(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){let m=u.tagName;if(m==="TEXTAREA")return;m==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let h=Ge(u)?this.mirror.getId(_o(a)):this.mirror.getId(u),p=i(a);if(h===-1||p===-1)return r.addNode(a);let g=Re(a,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:m=>{Do(m,this.mirror)&&this.iframeManager.addIframe(m),To(m,this.mirror)&&this.stylesheetManager.trackLinkElement(m),ds(a)&&this.shadowDomManager.addShadowRoot(C.shadowRoot(a),this.doc)},onIframeLoad:(m,d)=>{this.iframeManager.attachIframe(m,d),this.shadowDomManager.observeAttachShadow(m)},onStylesheetLoad:(m,d)=>{this.stylesheetManager.attachLinkElement(m,d)},cssCaptured:c});g&&(e.push({parentId:h,nextId:p,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let a of this.movedSet)Wi(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(C.parentNode(a))||n(a);for(let a of this.addedSet)!zi(this.droppedSet,a)&&!Wi(this.removesSubTreeCache,a,this.mirror)||zi(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){let u=this.mirror.getId(C.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let h=this.mirror.getId(C.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){a=c;break}else{let g=c.value,m=C.parentNode(g);if(m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=C.host(m);if(this.mirror.getId(d)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}let l={texts:this.texts.map(a=>{let u=a.node,c=C.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{let{attributes:u}=a;if(typeof u.style=="string"){let c=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),w(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let r=Array.from(C.childNodes(e),i=>C.textContent(i)||"").join("");t.attributes.value=Wt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:zt(e),value:r,maskInputFn:this.maskInputFn})}),w(this,"processMutation",e=>{if(!Tr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=C.textContent(e.target);!X(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:rn(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ao(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=zt(t);i=Wt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(X(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!tn(t.tagName,r))if(n.attributes[r]=en(this.doc,Se(t.tagName),Se(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let l of Array.from(t.style)){let a=t.style.getPropertyValue(l),u=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,u]:n._unchangedStyles[l]=[a,u]}for(let l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(X(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=Ge(e.target)?this.mirror.getId(C.host(e.target)):this.mirror.getId(e.target);X(e.target,this.blockClass,this.blockSelector,!1)||Tr(t,this.mirror,this.slimDOMOptions)||!$h(t,this.mirror)||(this.addedSet.has(t)?(ys(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Oo(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Bi(r,i)]?ys(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Ge(e.target)&&je(e.target)?!0:void 0}),Uh(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),w(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Tr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[Bi(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);X(e,this.blockClass,this.blockSelector,!1)||(C.childNodes(e).forEach(r=>this.genAdds(r)),ds(e)&&C.childNodes(C.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function ys(s,e){s.delete(e),C.childNodes(e).forEach(t=>ys(s,t))}function Uh(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),C.childNodes(r).forEach(i=>t.push(i)))}}function Wi(s,e,t){return s.size===0?!1:Bh(s,e)}function Bh(s,e,t){let r=C.parentNode(e);return r?s.has(r):!1}function zi(s,e){return s.size===0?!1:Po(s,e)}function Po(s,e){let t=C.parentNode(e);return t?s.has(t)?!0:Po(s,t):!1}var He;function Wh(s){He=s}function zh(){He=void 0}var E=s=>He?(...t)=>{try{return s(...t)}catch(r){if(He&&He(r)===!0)return;throw r}}:s,be=[];function at(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function Lo(s,e){let t=new gs;be.push(t),t.init(s);let r=new(xo())(E(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Vh({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],l,a=rt(E(h=>{let p=Date.now()-l;s(o.map(g=>(g.timeOffset-=p,g)),h),o=[],l=null}),n),u=E(rt(E(h=>{let p=at(h),{clientX:g,clientY:m}=fs(h)?h.changedTouches[0]:h;l||(l=qt()),o.push({x:g,y:m,id:r.getId(p),timeOffset:qt()-l}),a(typeof DragEvent<"u"&&h instanceof DragEvent?I.Drag:h instanceof MouseEvent?I.MouseMove:I.TouchMove)}),i,{trailing:!1})),c=[Z("mousemove",u,t),Z("touchmove",u,t),Z("drag",u,t)];return E(()=>{c.forEach(h=>h())})}function Gh({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[],a=null,u=c=>h=>{let p=at(h);if(X(p,r,i,!0))return;let g=null,m=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=ce.Mouse;break;case"touch":g=ce.Touch;break;case"pen":g=ce.Pen;break}g===ce.Touch?J[c]===J.MouseDown?m="TouchStart":J[c]===J.MouseUp&&(m="TouchEnd"):ce.Pen}else fs(h)&&(g=ce.Touch);g!==null?(a=g,(m.startsWith("Touch")&&g===ce.Touch||m.startsWith("Mouse")&&g===ce.Mouse)&&(g=null)):J[c]===J.Click&&(g=a,a=null);let d=fs(h)?h.changedTouches[0]:h;if(!d)return;let f=t.getId(p),{clientX:b,clientY:S}=d;E(s)({type:J[m],id:f,x:b,y:S,...g!==null&&{pointerType:g}})};return Object.keys(J).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=Se(c),p=u(c);if(window.PointerEvent)switch(J[c]){case J.MouseDown:case J.MouseUp:h=h.replace("mouse","pointer");break;case J.TouchStart:case J.TouchEnd:return}l.push(Z(h,p,e))}),E(()=>{l.forEach(c=>c())})}function Fo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=E(rt(E(l=>{let a=at(l);if(!a||X(a,r,i,!0))return;let u=t.getId(a);if(a===e&&e.defaultView){let c=Mo(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return Z("scroll",o,e)}function jh({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=E(rt(E(()=>{let n=No(),o=Ro();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return Z("resize",i,e)}var Hh=["INPUT","TEXTAREA","SELECT"],Vi=new WeakMap;function Yh({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function h(S){let y=at(S),v=S.isTrusted,O=y&&y.tagName;if(y&&O==="OPTION"&&(y=C.parentElement(y)),!y||!O||Hh.indexOf(O)<0||X(y,r,i,!0)||y.classList.contains(n)||o&&y.matches(o))return;let T=y.value,V=!1,P=zt(y)||"";P==="radio"||P==="checkbox"?V=y.checked:(l[O.toLowerCase()]||l[P])&&(T=Wt({element:y,maskInputOptions:l,tagName:O,type:P,value:T,maskInputFn:a})),p(y,c?{text:T,isChecked:V,userTriggered:v}:{text:T,isChecked:V});let z=y.name;P==="radio"&&z&&V&&e.querySelectorAll(`input[type="radio"][name="${z}"]`).forEach(H=>{if(H!==y){let Q=H.value;p(H,c?{text:Q,isChecked:!V,userTriggered:!1}:{text:Q,isChecked:!V})}})}function p(S,y){let v=Vi.get(S);if(!v||v.text!==y.text||v.isChecked!==y.isChecked){Vi.set(S,y);let O=t.getId(S);E(s)({...y,id:O})}}let m=(u.input==="last"?["change"]:["input","change"]).map(S=>Z(S,E(h),e)),d=e.defaultView;if(!d)return()=>{m.forEach(S=>S())};let f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),b=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&m.push(...b.map(S=>dr(S[0],S[1],{set(){E(h)({target:this,isTrusted:!1})}},!1,d))),E(()=>{m.forEach(S=>S())})}function er(s){let e=[];function t(r,i){if(Tt("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Tt("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Tt("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Tt("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function me(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Zh({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:E((c,h,p)=>{let[g,m]=p,{id:d,styleId:f}=me(h,e,t.styleMirror);return(d&&d!==-1||f&&f!==-1)&&s({id:d,styleId:f,adds:[{rule:g,index:m}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,p=this.cssRules.length){let g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,p])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:E((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,removes:[{index:g}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:E((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replace:g}),c.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:E((c,h,p)=>{let[g]=p,{id:m,styleId:d}=me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,replaceSync:g}),c.apply(h,p)})}));let a={};_t("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(_t("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),_t("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),_t("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(a).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:E((p,g,m)=>{let[d,f]=m,{id:b,styleId:S}=me(g.parentStyleSheet,e,t.styleMirror);return(b&&b!==-1||S&&S!==-1)&&s({id:b,styleId:S,adds:[{rule:d,index:[...er(g),f||0]}]}),p.apply(g,m)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:E((p,g,m)=>{let[d]=m,{id:f,styleId:b}=me(g.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||b&&b!==-1)&&s({id:f,styleId:b,removes:[{index:[...er(g),d]}]}),p.apply(g,m)})})}),E(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Uo({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(C.host(t));let l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l?.prototype?Object.getOwnPropertyDescriptor(l?.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;let h=(c=a.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return h}}),E(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Xh({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:E((l,a,u)=>{var c;let[h,p,g]=u;if(t.has(h))return n.apply(a,[h,p,g]);let{id:m,styleId:d}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,set:{property:h,value:p,priority:g},index:er(a.parentRule)}),l.apply(a,u)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:E((l,a,u)=>{var c;let[h]=u;if(t.has(h))return o.apply(a,[h]);let{id:p,styleId:g}=me((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&s({id:p,styleId:g,remove:{property:h},index:er(a.parentRule)}),l.apply(a,u)})}),E(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Jh({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=E(a=>rt(E(u=>{let c=at(u);if(!c||X(c,e,t,!0))return;let{currentTime:h,volume:p,muted:g,playbackRate:m,loop:d}=c;s({type:a,id:r.getId(c),currentTime:h,volume:p,muted:g,playbackRate:m,loop:d})}),i.media||500)),l=[Z("play",o(Me.Play),n),Z("pause",o(Me.Pause),n),Z("seeked",o(Me.Seeked),n),Z("volumechange",o(Me.VolumeChange),n),Z("ratechange",o(Me.RateChange),n)];return E(()=>{l.forEach(a=>a())})}function Kh({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,u,c){let h=new n(a,u,c);return i.set(h,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};let o=Ie(e.fonts,"add",function(l){return function(a){return setTimeout(E(()=>{let u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),E(()=>{r.forEach(l=>l())})}function Qh(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=!0,l=E(()=>{let a=e.getSelection();if(!a||o&&a?.isCollapsed)return;o=a.isCollapsed||!1;let u=[],c=a.rangeCount||0;for(let h=0;h<c;h++){let p=a.getRangeAt(h),{startContainer:g,startOffset:m,endContainer:d,endOffset:f}=p;X(g,r,i,!0)||X(d,r,i,!0)||u.push({start:t.getId(g),startOffset:m,end:t.getId(d),endOffset:f})}n({ranges:u})});return l(),Z("selectionchange",l)}function qh({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:Ie(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function ef(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:p,selectionCb:g,customElementCb:m}=s;s.mutationCb=(...d)=>{e.mutation&&e.mutation(...d),t(...d)},s.mousemoveCb=(...d)=>{e.mousemove&&e.mousemove(...d),r(...d)},s.mouseInteractionCb=(...d)=>{e.mouseInteraction&&e.mouseInteraction(...d),i(...d)},s.scrollCb=(...d)=>{e.scroll&&e.scroll(...d),n(...d)},s.viewportResizeCb=(...d)=>{e.viewportResize&&e.viewportResize(...d),o(...d)},s.inputCb=(...d)=>{e.input&&e.input(...d),l(...d)},s.mediaInteractionCb=(...d)=>{e.mediaInteaction&&e.mediaInteaction(...d),a(...d)},s.styleSheetRuleCb=(...d)=>{e.styleSheetRule&&e.styleSheetRule(...d),u(...d)},s.styleDeclarationCb=(...d)=>{e.styleDeclaration&&e.styleDeclaration(...d),c(...d)},s.canvasMutationCb=(...d)=>{e.canvasMutation&&e.canvasMutation(...d),h(...d)},s.fontCb=(...d)=>{e.font&&e.font(...d),p(...d)},s.selectionCb=(...d)=>{e.selection&&e.selection(...d),g(...d)},s.customElementCb=(...d)=>{e.customElement&&e.customElement(...d),m(...d)}}function tf(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};ef(s,e);let r;s.recordDOM&&(r=Lo(s,s.doc));let i=Vh(s),n=Gh(s),o=Fo(s),l=jh(s,{win:t}),a=Yh(s),u=Jh(s),c=()=>{},h=()=>{},p=()=>{},g=()=>{};s.recordDOM&&(c=Zh(s,{win:t}),h=Uo(s,s.doc),p=Xh(s,{win:t}),s.collectFonts&&(g=Kh(s)));let m=Qh(s),d=qh(s),f=[];for(let b of s.plugins)f.push(b.observer(b.callback,t,b.options));return E(()=>{be.forEach(b=>b.reset()),r?.disconnect(),i(),n(),o(),l(),a(),u(),c(),h(),p(),g(),m(),d(),f.forEach(b=>b())})}function Tt(s){return typeof window[s]<"u"}function _t(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}var tr=class{constructor(e){w(this,"iframeIdToRemoteIdMap",new WeakMap),w(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},ws=class{constructor(e){w(this,"iframes",new WeakMap),w(this,"crossOriginIframeMap",new WeakMap),w(this,"crossOriginIframeMirror",new tr(qi)),w(this,"crossOriginIframeStyleMirror"),w(this,"crossOriginIframeRootIdMap",new WeakMap),w(this,"mirror"),w(this,"mutationCb"),w(this,"wrappedEmit"),w(this,"loadListener"),w(this,"stylesheetManager"),w(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new tr(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:x.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case x.Meta:case x.Load:case x.DomContentLoaded:return!1;case x.Plugin:return t;case x.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case x.IncrementalSnapshot:switch(t.data.source){case I.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.Drag:case I.TouchMove:case I.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(t.data,e,["id"]),t;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case I.Font:return t;case I.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case I.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==$o.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},bs=class{constructor(e){w(this,"shadowDoms",new WeakSet),w(this,"mutationCb"),w(this,"scrollCb"),w(this,"bypassOptions"),w(this,"mirror"),w(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!je(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=Lo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Fo({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(C.host(e))),this.restoreHandlers.push(Uo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Ie(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),l=C.shadowRoot(this);return l&&ko(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rf=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(Ve=0;Ve<Ae.length;Ve++)rf[Ae.charCodeAt(Ve)]=Ve;var Ve,sf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Ae[e[t]>>2],i+=Ae[(e[t]&3)<<4|e[t+1]>>4],i+=Ae[(e[t+1]&15)<<2|e[t+2]>>6],i+=Ae[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};var Gi=new Map;function nf(s,e){let t=Gi.get(s);return t||(t=new Map,Gi.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}var Bo=(s,e,t)=>{if(!s||!(zo(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=nf(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function Ft(s,e,t){if(s instanceof Array)return s.map(r=>Ft(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=sf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Ft(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Ft(s.data,e,t),s.width,s.height]};if(zo(s,e)||typeof s=="object"){let r=s.constructor.name,i=Bo(s,e,t);return{rr_type:r,index:i}}}}return s}var Wo=(s,e,t)=>s.map(r=>Ft(r,e,t)),zo=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function of(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let l=Ie(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...u){return X(this.canvas,t,r,!0)||setTimeout(()=>{let c=Wo(u,e,this);s(this.canvas,{type:Pe["2D"],property:o,args:c})},0),a.apply(this,u)}});i.push(l)}catch{let l=dr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Pe["2D"],property:o,args:[a],setter:!0})}});i.push(l)}return()=>{i.forEach(o=>o())}}function af(s){return s==="experimental-webgl"?"webgl":s}function ji(s,e,t,r){let i=[];try{let n=Ie(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!X(this,e,t,!0)){let u=af(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){let c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function Hi(s,e,t,r,i,n){let o=[],l=Object.getOwnPropertyNames(s);for(let a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;let u=Ie(s,a,function(c){return function(...h){let p=c.apply(this,h);if(Bo(p,n,this),"tagName"in this.canvas&&!X(this.canvas,r,i,!0)){let g=Wo(h,n,this),m={type:e,property:a,args:g};t(this.canvas,m)}return p}});o.push(u)}catch{let u=dr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});o.push(u)}return o}function lf(s,e,t,r){let i=[];return i.push(...Hi(e.WebGLRenderingContext.prototype,Pe.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...Hi(e.WebGL2RenderingContext.prototype,Pe.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}var Vo="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",uf=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),Yi=typeof window<"u"&&window.Blob&&new Blob([uf(Vo)],{type:"text/javascript;charset=utf-8"});function cf(s){let e;try{if(e=Yi&&(window.URL||window.webkitURL).createObjectURL(Yi),!e)throw"";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+Vo,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}var Ss=class{constructor(e){w(this,"pendingCanvasMutations",new Map),w(this,"rafStamps",{latestId:0,invokeId:null}),w(this,"mirror"),w(this,"mutationCb"),w(this,"resetObservers"),w(this,"frozen",!1),w(this,"locked",!1),w(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){let o=ji(t,r,i,!0),l=new Map,a=new cf;a.onmessage=m=>{let{id:d}=m.data;if(l.set(d,!1),!("base64"in m.data))return;let{base64:f,type:b,width:S,height:y}=m.data;this.mutationCb({id:d,type:Pe["2D"],commands:[{property:"clearRect",args:[0,0,S,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:b}]},0,0]}]})};let u=1e3/e,c=0,h,p=()=>{let m=[];return t.document.querySelectorAll("canvas").forEach(d=>{X(d,r,i,!0)||m.push(d)}),m},g=m=>{if(c&&m-c<u){h=requestAnimationFrame(g);return}c=m,p().forEach(async d=>{var f;let b=this.mirror.getId(d);if(l.get(b)||d.width===0||d.height===0)return;if(l.set(b,!0),["webgl","webgl2"].includes(d.__context)){let y=d.getContext(d.__context);((f=y?.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}let S=await createImageBitmap(d);a.postMessage({id:b,bitmap:S,width:d.width,height:d.height,dataURLOptions:n.dataURLOptions},[S])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=ji(e,t,r,!1),n=of(this.processMutation.bind(this),e,t,r),o=lf(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(o=>{let{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}},vs=class{constructor(e){w(this,"trackedLinkElements",new WeakSet),w(this,"mutationCb"),w(this,"adoptedStyleSheetCb"),w(this,"styleMirror",new ps),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:Ki(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},Cs=class{constructor(){w(this,"nodeMap",new WeakMap),w(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},W,Ut,_r,rr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Ks=s.contentWindow)==null?void 0:Ks.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}var re=ga();function ue(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:g,maskInputFn:m,maskTextFn:d,hooks:f,packFn:b,sampling:S={},dataURLOptions:y={},mousemoveWait:v,recordDOM:O=!0,recordCanvas:T=!1,recordCrossOriginIframes:V=!1,recordAfter:P=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:H=!1,inlineImages:Q=!1,plugins:ne,keepIframeSrcFn:M=()=>!1,ignoreCSSAttributes:Le=new Set([]),errorHandler:Fe}=s;Wh(Fe);let G=V?window.parent===window:!0,q=!1;if(!G)try{window.parent.document&&(q=!1)}catch{q=!0}if(G&&!e)throw new Error("emit function is required");if(!G&&!q)return()=>{};v!==void 0&&S.mousemove===void 0&&(S.mousemove=v),re.reset();let ge=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},oe=sn(g);Ph();let Ys,yr=0,Zs=N=>{for(let te of ne||[])te.eventProcessor&&(N=te.eventProcessor(N));return b&&!q&&(N=b(N)),N};W=(N,te)=>{var U;let B=N;if(B.timestamp=qt(),(U=be[0])!=null&&U.isFrozen()&&B.type!==x.FullSnapshot&&!(B.type===x.IncrementalSnapshot&&B.data.source===I.Mutation)&&be.forEach(K=>K.unfreeze()),G)e?.(Zs(B),te);else if(q){let K={type:"rrweb",event:Zs(B),origin:window.location.origin,isCheckout:te};window.parent.postMessage(K,"*")}if(B.type===x.FullSnapshot)Ys=B,yr=0;else if(B.type===x.IncrementalSnapshot){if(B.data.source===I.Mutation&&B.data.isAttachIframe)return;yr++;let K=r&&yr>=r,D=t&&B.timestamp-Ys.timestamp>t;(K||D)&&Ut(!0)}};let ut=N=>{W({type:x.IncrementalSnapshot,data:{source:I.Mutation,...N}})},Xs=N=>W({type:x.IncrementalSnapshot,data:{source:I.Scroll,...N}}),Js=N=>W({type:x.IncrementalSnapshot,data:{source:I.CanvasMutation,...N}}),jo=N=>W({type:x.IncrementalSnapshot,data:{source:I.AdoptedStyleSheet,...N}}),ye=new vs({mutationCb:ut,adoptedStyleSheetCb:jo}),we=new ws({mirror:re,mutationCb:ut,stylesheetManager:ye,recordCrossOriginIframes:V,wrappedEmit:W});for(let N of ne||[])N.getMirror&&N.getMirror({nodeMirror:re,crossOriginIframeMirror:we.crossOriginIframeMirror,crossOriginIframeStyleMirror:we.crossOriginIframeStyleMirror});let wr=new Cs;_r=new Ss({recordCanvas:T,mutationCb:Js,win:window,blockClass:i,blockSelector:n,mirror:re,sampling:S.canvas,dataURLOptions:y});let ct=new bs({mutationCb:ut,scrollCb:Xs,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ge,dataURLOptions:y,maskTextFn:d,maskInputFn:m,recordCanvas:T,inlineImages:Q,sampling:S,slimDOMOptions:oe,iframeManager:we,stylesheetManager:ye,canvasManager:_r,keepIframeSrcFn:M,processedNodeManager:wr},mirror:re});Ut=(N=!1)=>{if(!O)return;W({type:x.Meta,data:{href:window.location.href,width:Ro(),height:No()}},N),ye.reset(),ct.init(),be.forEach(U=>U.lock());let te=Ba(document,{mirror:re,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ge,maskTextFn:d,maskInputFn:m,slimDOM:oe,dataURLOptions:y,recordCanvas:T,inlineImages:Q,onSerialize:U=>{Do(U,re)&&we.addIframe(U),To(U,re)&&ye.trackLinkElement(U),ds(U)&&ct.addShadowRoot(C.shadowRoot(U),document)},onIframeLoad:(U,B)=>{we.attachIframe(U,B),ct.observeAttachShadow(U)},onStylesheetLoad:(U,B)=>{ye.attachLinkElement(U,B)},keepIframeSrcFn:M});if(!te)return console.warn("Failed to snapshot the document");W({type:x.FullSnapshot,data:{node:te,initialOffset:Mo(window)}},N),be.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ye.adoptStyleSheets(document.adoptedStyleSheets,re.getId(document))};try{let N=[],te=B=>{var K;return E(tf)({mutationCb:ut,mousemoveCb:(D,br)=>W({type:x.IncrementalSnapshot,data:{source:br,positions:D}}),mouseInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.MouseInteraction,...D}}),scrollCb:Xs,viewportResizeCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.ViewportResize,...D}}),inputCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.Input,...D}}),mediaInteractionCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.MediaInteraction,...D}}),styleSheetRuleCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.StyleSheetRule,...D}}),styleDeclarationCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.StyleDeclaration,...D}}),canvasMutationCb:Js,fontCb:D=>W({type:x.IncrementalSnapshot,data:{source:I.Font,...D}}),selectionCb:D=>{W({type:x.IncrementalSnapshot,data:{source:I.Selection,...D}})},customElementCb:D=>{W({type:x.IncrementalSnapshot,data:{source:I.CustomElement,...D}})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:ge,inlineStylesheet:c,sampling:S,recordDOM:O,recordCanvas:T,inlineImages:Q,userTriggeredOnInput:z,collectFonts:H,doc:B,maskInputFn:m,maskTextFn:d,keepIframeSrcFn:M,blockSelector:n,slimDOMOptions:oe,dataURLOptions:y,mirror:re,iframeManager:we,stylesheetManager:ye,shadowDomManager:ct,processedNodeManager:wr,canvasManager:_r,ignoreCSSAttributes:Le,plugins:((K=ne?.filter(D=>D.observer))==null?void 0:K.map(D=>({observer:D.observer,options:D.options,callback:br=>W({type:x.Plugin,data:{plugin:D.name,payload:br}})})))||[]},f)};we.addLoadListener(B=>{try{N.push(te(B.contentDocument))}catch(K){console.warn(K)}});let U=()=>{Ut(),N.push(te(document)),rr=!0};return["interactive","complete"].includes(document.readyState)?U():(N.push(Z("DOMContentLoaded",()=>{W({type:x.DomContentLoaded,data:{}}),P==="DOMContentLoaded"&&U()})),N.push(Z("load",()=>{W({type:x.Load,data:{}}),P==="load"&&U()},window))),()=>{N.forEach(B=>{try{B()}catch(K){String(K).toLowerCase().includes("cross-origin")||console.warn(K)}}),wr.destroy(),rr=!1,zh()}}catch(N){console.warn(N)}}ue.addCustomEvent=(s,e)=>{if(!rr)throw new Error("please add custom event after start recording");W({type:x.Custom,data:{tag:s,payload:e}})};ue.freezePage=()=>{be.forEach(s=>s.freeze())};ue.takeFullSnapshot=s=>{if(!rr)throw new Error("please take full snapshot after start recording");Ut(s)};ue.mirror=re;var Zi;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Zi||(Zi={}));var qf=5*1e3;var{addCustomEvent:ed}=ue,{freezePage:td}=ue,{takeFullSnapshot:rd}=ue;var hf=150,ff=1e6,pr=[],Hs=0,lt;function df(){let s=globalThis.__ripploCapturePort,e=globalThis.__ripploRunId;if(!(typeof s!="number"||typeof e!="string"))return`http://127.0.0.1:${String(s)}/rrweb/${encodeURIComponent(e)}`}function Go(s){let e=globalThis.__ripploEmitRrwebEvent;e?.(s)}function pf(s){let e=df();return e==null?(Go(s),Promise.resolve()):fetch(e,{body:s,method:"POST",mode:"no-cors"}).then(()=>{},()=>{Go(s)})}function gr(){if(lt!=null&&(clearTimeout(lt),lt=void 0),pr.length===0)return Promise.resolve();let s=pr.join(`
54
- `);return pr.length=0,Hs=0,pf(s)}async function mf(){await new Promise(s=>setTimeout(s,0)),await gr()}globalThis.__ripploFlushRrweb=mf;function gf(s){if(pr.push(s),Hs+=s.length,Hs>=ff){gr();return}lt??=setTimeout(()=>{lt=void 0,gr()},hf)}var yf=100,mr=new WeakSet;function wf(){document.getAnimations().forEach(s=>{if(!(s instanceof CSSAnimation||s instanceof CSSTransition)&&!mr.has(s)&&(mr.add(s),bf(s),s.playState==="finished"))try{s.commitStyles(),s.cancel()}catch{mr.add(s)}})}function bf(s){try{s.finish()}catch{mr.add(s)}}globalThis.__ripploRrwebRecording!==!0&&(globalThis.__ripploRrwebRecording=!0,globalThis.__ripploRrwebMirror=ue.mirror,addEventListener("pagehide",()=>{gr()}),setInterval(wf,yf),ue({inlineImages:!0,recordCanvas:!1,recordCrossOriginIframes:!1,sampling:{mousemove:!1,scroll:150},slimDOMOptions:!0,emit:s=>{gf(JSON.stringify(s))}}));})();
54
+ `);return pr.length=0,Hs=0,pf(s)}async function mf(){await new Promise(s=>setTimeout(s,0)),await gr()}function gf(s){if(pr.push(s),Hs+=s.length,Hs>=ff){gr();return}lt??=setTimeout(()=>{lt=void 0,gr()},hf)}var yf=100,mr=new WeakSet;function wf(){document.getAnimations().forEach(s=>{if(!(s instanceof CSSAnimation||s instanceof CSSTransition)&&!mr.has(s)&&(mr.add(s),bf(s),s.playState==="finished"))try{s.commitStyles(),s.cancel()}catch{mr.add(s)}})}function bf(s){try{s.finish()}catch{mr.add(s)}}globalThis.parent===globalThis.window&&globalThis.__ripploRrwebRecording!==!0&&(globalThis.__ripploFlushRrweb=mf,globalThis.__ripploRrwebRecording=!0,globalThis.__ripploRrwebMirror=ue.mirror,addEventListener("pagehide",()=>{gr()}),setInterval(wf,yf),ue({inlineImages:!0,recordCanvas:!1,recordCrossOriginIframes:!1,sampling:{mousemove:!1,scroll:150},slimDOMOptions:!0,emit:s=>{gf(JSON.stringify(s))}}));})();
@@ -584,7 +584,7 @@ function $constructor(name, initializer3, params) {
584
584
  Object.defineProperty(_, "name", { value: name });
585
585
  return _;
586
586
  }
587
- var $brand = Symbol("zod_brand");
587
+ var $brand = /* @__PURE__ */ Symbol("zod_brand");
588
588
  var $ZodAsyncError = class extends Error {
589
589
  constructor() {
590
590
  super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
@@ -731,7 +731,7 @@ function floatSafeRemainder(val, step) {
731
731
  const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
732
732
  return valInt % stepInt / 10 ** decCount;
733
733
  }
734
- var EVALUATING = Symbol("evaluating");
734
+ var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
735
735
  function defineLazy(object2, key, getter) {
736
736
  let value = void 0;
737
737
  Object.defineProperty(object2, key, {
@@ -9804,8 +9804,8 @@ function yo_default() {
9804
9804
 
9805
9805
  // ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js
9806
9806
  var _a;
9807
- var $output = Symbol("ZodOutput");
9808
- var $input = Symbol("ZodInput");
9807
+ var $output = /* @__PURE__ */ Symbol("ZodOutput");
9808
+ var $input = /* @__PURE__ */ Symbol("ZodInput");
9809
9809
  var $ZodRegistry = class {
9810
9810
  constructor() {
9811
9811
  this._map = /* @__PURE__ */ new WeakMap();
@@ -10842,7 +10842,7 @@ function _stringbool(Classes, _params) {
10842
10842
  type: "pipe",
10843
10843
  in: stringSchema,
10844
10844
  out: booleanSchema,
10845
- transform: (input, payload) => {
10845
+ transform: ((input, payload) => {
10846
10846
  let data = input;
10847
10847
  if (params.case !== "sensitive")
10848
10848
  data = data.toLowerCase();
@@ -10861,14 +10861,14 @@ function _stringbool(Classes, _params) {
10861
10861
  });
10862
10862
  return {};
10863
10863
  }
10864
- },
10865
- reverseTransform: (input, _payload) => {
10864
+ }),
10865
+ reverseTransform: ((input, _payload) => {
10866
10866
  if (input === true) {
10867
10867
  return truthyArray[0] || "true";
10868
10868
  } else {
10869
10869
  return falsyArray[0] || "false";
10870
10870
  }
10871
- },
10871
+ }),
10872
10872
  error: params.error
10873
10873
  });
10874
10874
  return codec2;
@@ -12196,10 +12196,10 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
12196
12196
  inst.with = inst.check;
12197
12197
  inst.clone = (def2, params) => clone(inst, def2, params);
12198
12198
  inst.brand = () => inst;
12199
- inst.register = (reg, meta3) => {
12199
+ inst.register = ((reg, meta3) => {
12200
12200
  reg.add(inst, meta3);
12201
12201
  return inst;
12202
- };
12202
+ });
12203
12203
  inst.parse = (data, params) => parse2(inst, data, params, { callee: inst.parse });
12204
12204
  inst.safeParse = (data, params) => safeParse2(inst, data, params);
12205
12205
  inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
@@ -13795,7 +13795,7 @@ var tables = nameTablesSchema.parse(workerData);
13795
13795
  var runs = /* @__PURE__ */ new Map();
13796
13796
  port.on("message", (msg) => {
13797
13797
  if (msg.t === "open") {
13798
- runs.set(msg.runId, openRun(msg.file));
13798
+ runs.set(msg.runId, openRun({ file: msg.file, headerLine: msg.headerLine }));
13799
13799
  return;
13800
13800
  }
13801
13801
  const run = runs.get(msg.runId);
@@ -13821,11 +13821,16 @@ port.on("message", (msg) => {
13821
13821
  function reply(message) {
13822
13822
  port?.postMessage(message);
13823
13823
  }
13824
- function openRun(file2) {
13824
+ function openRun({ file: file2, headerLine }) {
13825
13825
  return {
13826
13826
  entries: [],
13827
13827
  file: file2,
13828
- handlePromise: mkdir(path.dirname(file2), { recursive: true }).then(() => open(file2, "w")),
13828
+ handlePromise: mkdir(path.dirname(file2), { recursive: true }).then(() => open(file2, "w")).then(async (handle) => {
13829
+ await handle.write(`${headerLine}
13830
+ `);
13831
+ return handle;
13832
+ }),
13833
+ headerLine,
13829
13834
  pending: Promise.resolve(),
13830
13835
  rrwebCount: 0
13831
13836
  };
@@ -13875,7 +13880,8 @@ async function closeRun(run, noticeLineIfNoRrweb) {
13875
13880
  const handle = await run.handlePromise;
13876
13881
  await handle.close();
13877
13882
  const body = run.entries.toSorted((a, b) => byTime(a.t, b.t)).map((entry) => entry.line).join("\n");
13878
- await writeFile(run.file, `${body}
13883
+ await writeFile(run.file, `${run.headerLine}
13884
+ ${body}
13879
13885
  `);
13880
13886
  }
13881
13887
  function byTime(a, b) {
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{U as d}from"./chunk-ZHDR7LXB.js";import{j as p}from"./chunk-C7SV6AR2.js";import{spawnSync as y}from"child_process";import{existsSync as a,readdirSync as u,readFileSync as h,realpathSync as m,statSync as f}from"fs";import r from"path";var k=2e3;function W(t){if(t!=null)try{return f(m(t)).mtimeMs}catch{return}}function T(t){return y("pnpm",["turbo","run","build","--filter=ripplo..."],{cwd:t,stdio:"inherit"}).status===0}function F(){let t=process.argv[1];if(t==null)return{kind:"fresh"};let o=m(t),i=o.includes(`${r.sep}src${r.sep}`),s=c(r.dirname(o));if(s!=null)return i?{kind:"fresh"}:j(s);let n=c(process.cwd());return n!=null&&S(n)?{kind:"foreign-binary",workspaceRoot:n}:{kind:"fresh"}}function c(t){let o=r.dirname(t);return a(r.join(t,"pnpm-workspace.yaml"))?t:o===t?void 0:c(o)}function j(t){let o=r.join(t,"packages");if(!a(o))return{kind:"fresh"};let i=r.join(o,"cli","dist"),s=u(o).map(n=>({dist:r.join(o,n,"dist"),name:n,src:r.join(o,n,"src")})).filter(n=>a(n.src)).map(n=>({...n,output:a(n.dist)?n.dist:i})).filter(n=>l(n.src)>l(n.output)+k).map(n=>n.name);return s.length===0?{kind:"fresh"}:{kind:"stale",packages:s,workspaceRoot:t}}function l(t){let o=f(t);if(!o.isDirectory())return o.mtimeMs;let i=u(t).map(s=>l(r.join(t,s)));return Math.max(o.mtimeMs,...i)}function S(t){let o=r.join(t,"packages","cli","package.json");if(!a(o))return!1;let i=JSON.parse(h(o,"utf8"));return typeof i=="object"&&i!=null&&"name"in i&&i.name==="ripplo"}import{createHash as x}from"crypto";import R from"os";import E from"path";import{createMessageConnection as w,NotificationType as b,RequestType as P,RequestType0 as g,SocketMessageReader as M,SocketMessageWriter as I}from"vscode-jsonrpc/node";import{z as e}from"zod";var q="daemon.log";function Q(t){let o=x("sha256").update(t).digest("hex").slice(0,16);return E.join(R.tmpdir(),`ripplo-${o}.sock`)}function Y(t){return p(t,q)}function Z(t){return w(new M(t),new I(t))}var ee=e.object({all:e.boolean(),headed:e.boolean(),tests:e.array(e.string())}),te=e.object({jobId:e.string(),total:e.number()}),N=e.enum(["no-lockfile","unstamped","dsl-drift","load-failed","model-empty"]),v=e.discriminatedUnion("kind",[e.object({kind:e.literal("off")}),e.object({kind:e.literal("on")}),e.object({kind:e.literal("paused")}),e.object({kind:e.literal("waiting")}),e.object({kind:e.literal("blocked"),reason:N})]),C=e.object({attempts:e.number(),findings:e.number()}),oe=e.object({active:e.number(),bundleMtimeMs:e.number().optional(),explorer:v,exploring:e.number(),progress:C,queued:e.number(),sseHealth:e.object({detail:e.string().optional(),ok:e.boolean()}).optional(),version:e.string().optional()}),z=e.enum(["MAX_RUNS","OVERAGE_CAP","MAX_AGENTS","MAX_CONCURRENT_RUNS","MAX_PROJECTS","CLOUD_EXECUTOR","REVIEW_QUOTA","MEMBER_CEILING"]),A=e.discriminatedUnion("type",[e.object({code:z,type:e.literal("limit")}),e.object({detail:e.string(),type:e.literal("generic")})]),O=e.discriminatedUnion("kind",[e.object({kind:e.literal("pass")}),e.object({findingLines:e.array(e.string()),kind:e.literal("findings")}),e.object({detail:e.string(),kind:e.literal("error")}),e.object({kind:e.literal("dispatch-error"),reason:A}),e.object({detail:e.string(),kind:e.literal("dispatch-timeout")}),e.object({detail:e.string(),kind:e.literal("infra-error")})]),L=e.discriminatedUnion("kind",[e.object({kind:e.literal("run-progress"),runId:e.string(),signal:d,testName:e.string(),workflowName:e.string()}),e.object({kind:e.literal("test-started"),runId:e.string(),testName:e.string(),workflowName:e.string()}),e.object({kind:e.literal("test-outcome"),outcome:O,runId:e.string(),testName:e.string(),workflowName:e.string()})]),ne=e.object({event:L,jobId:e.string()}),re=e.object({failed:e.number(),jobId:e.string(),notRun:e.number(),passed:e.number()}),ie=e.discriminatedUnion("code",[e.object({code:e.literal("compile-failed"),detail:e.string(),diagnostics:e.array(e.string()).default([])}),e.object({code:e.literal("selection-conflicting-flags")}),e.object({code:e.literal("selection-nothing-selected")}),e.object({code:e.literal("selection-unknown-ids"),known:e.array(e.string()),unknown:e.array(e.string())}),e.object({code:e.literal("scope-failed"),detail:e.string()}),e.object({code:e.literal("app-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("engine-unreachable"),detail:e.string(),url:e.string()}),e.object({code:e.literal("sync-failed"),detail:e.string()}),e.object({code:e.literal("bad-message")})]),se=new P("ripplo/enqueue"),ae=new g("ripplo/status"),ce=new g("ripplo/shutdownIfIdle"),le=new b("ripplo/jobEvent"),pe=new b("ripplo/jobDone");export{W as a,T as b,F as c,Q as d,Y as e,Z as f,ee as g,te as h,oe as i,O as j,ne as k,re as l,ie as m,se as n,ae as o,ce as p,le as q,pe as r};
@@ -4,6 +4,6 @@ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
4
  import{a as o}from"./chunk-OQ6KNYPG.js";import{a as i}from"./chunk-MHNGR6M7.js";function y(n){if(n.length===0)return"No open tasks.";let e=n.map(r=>` [${a(r.status)}] [${r.kind}] (${r.id}) ${l(r)}`);return[`${o(n.length,"open task")}:`,...e].join(`
5
5
  `)}function m(n){let e=`[${a(n.status)}] [${n.kind}] (${n.id}) ${n.title??""}`.trim(),r=n.messages.flatMap(t=>u(t));return[e,...r,"",$()].join(`
6
6
  `)}function x(n){let e=n.map(r=>` [${a(r.status)}] [${r.kind}] (${r.id}) ${l(r)}`);return[`New or updated Ripplo tasks (${o(n.length,"open task")}):`,...e,i("tasks","picking each up")].join(`
7
- `)}function T(n){let{task:e}=n,r=e.title??e.latestMessage??"(no description)",t=i("tasks");return n.type==="new"?`New task [${e.kind}] (${e.id}) ${r} \u2014 ${t}`:n.type==="reopened"?`Reopened task (${e.id}) ${r} \u2014 earlier resolution didn't hold. ${t}`:`User replied on task (${e.id}): ${e.latestMessage??r} \u2014 ${t}`}function b(n){return`No task with id ${n}. List them with \`npx ripplo tasks list\`.`}function w(n){return`Commented on task ${n}.`}function S(){return"Clarification needs a message \u2014 say what's ambiguous and what you need."}function N(n,e){let r=e==null?"an element node's id":`its parent element id ${String(e)}`;return`rrweb id ${String(n)} is a text node \u2014 no box to highlight. Anchor to ${r}.`}function M(n,e){return`rrweb id ${String(n)} is not in run ${e}. Pick an element id from .ripplo/debug/${e}/behavior.jsonl.`}function A(n){return`rrweb id ${String(n)} is not an element node. Anchor to an element so it can be highlighted.`}function R(n){return`Resolved task ${n}.`}function C(n){return`Started task ${n} \u2014 in progress until resolved, dismissed, or sent back for clarification.`}function I(n){return`Marked task ${n} as needing clarification \u2014 the user will follow up.`}function v(n){return`Dismissed task ${n}.`}function a(n){return n==="needsClarification"?"needs clarification":n}function l(n){return n.title??n.lastMessage??"(no description)"}function u(n){let e=n.authorName??n.author;return n.runId==null?[` ${e}: ${n.body}`]:[` ${e} @ ${n.runId}${p(n.frameMs)}: ${n.body}`,...c(n,n.runId)]}function p(n){return n==null?"":` (${String(n)}ms)`}function c(n,e){let r=f(n),t=n.frameMs==null?null:` see it: npx ripplo snapshot ${e} --offset ${String(n.frameMs)}`;return[r,t].filter(s=>s!=null)}function f(n){return n.element!=null?` element: ${g(n.element)}`:n.rrwebId==null?null:` element: rrweb id ${String(n.rrwebId)}`}function g(n){let e=n.role==null?"":`[role=${n.role}]`,r=n.testId==null?"":` testid=${n.testId}`,t=n.ariaName==null?"":` aria="${n.ariaName}"`,s=n.text==null?"":` "${n.text}"`,d=n.selector==null?"":`
8
- selector: ${n.selector}`;return`${n.tagName??"element"}${e}${r}${t}${s}${d}`}function $(){return["Snapshot the frame above and Read the PNG \u2014 the rendered frame is the evidence, not the thread text.","Read the whole run with `npx ripplo explain <runId>` \u2014 auto-pulls a cloud run's stream if not on disk.","Add `--full` for the world the model set up plus a step-by-step timeline of what happened.",i("tasks","picking this up")].join(`
7
+ `)}function T(n){let{task:e}=n,r=e.title??e.latestMessage??"(no description)",t=i("tasks");return n.type==="new"?`New task [${e.kind}] (${e.id}) ${r} \u2014 ${t}`:n.type==="reopened"?`Reopened task (${e.id}) ${r} \u2014 earlier resolution didn't hold. ${t}`:`User replied on task (${e.id}): ${e.latestMessage??r} \u2014 ${t}`}function b(n){return`No task with id ${n}. List them with \`npx ripplo tasks list\`.`}function w(n){return`Commented on task ${n}.`}function S(){return"Clarification needs a message \u2014 say what's ambiguous and what you need."}function N(n,e){let r=e==null?"an element node's id":`its parent element id ${String(e)}`;return`rrweb id ${String(n)} is a text node \u2014 no box to highlight. Anchor to ${r}.`}function M(n,e){return`rrweb id ${String(n)} is not in run ${e}. Pick an element id from .ripplo/debug/${e}/behavior.jsonl.`}function A(n){return`rrweb id ${String(n)} is not an element node. Anchor to an element so it can be highlighted.`}function R(n){return`Resolved task ${n}.`}function C(n){return`Started task ${n} \u2014 in progress until resolved, dismissed, or sent back for clarification.`}function I(n){return`Marked task ${n} as needing clarification \u2014 the user will follow up.`}function v(n){return`Dismissed task ${n}.`}function a(n){return n==="needsClarification"?"needs clarification":n}function l(n){return n.title??n.lastMessage??"(no description)"}function u(n){let e=n.authorName??n.author;return n.runId==null?[` ${e}: ${n.body}`]:[` ${e} @ ${n.runId}${c(n.frameMs)}: ${n.body}`,...p(n,n.runId)]}function c(n){return n==null?"":` (${String(n)}ms)`}function p(n,e){let r=f(n),t=n.frameMs==null?null:` see it: npx ripplo snapshot ${e} --offset ${String(n.frameMs)}`;return[r,t].filter(s=>s!=null)}function f(n){return n.element!=null?` element: ${g(n.element)}`:n.rrwebId==null?null:` element: rrweb id ${String(n.rrwebId)}`}function g(n){let e=n.role==null?"":`[role=${n.role}]`,r=n.testId==null?"":` testid=${n.testId}`,t=n.ariaName==null?"":` aria="${n.ariaName}"`,s=n.text==null?"":` "${n.text}"`,d=n.selector==null?"":`
8
+ selector: ${n.selector}`;return`${n.tagName??"element"}${e}${r}${t}${s}${d}`}function $(){return["Snapshot the frame above and Read the PNG \u2014 the rendered frame is the evidence, not the thread text.","Read the whole run with `npx ripplo explain <runId>` \u2014 auto-pulls a cloud run's stream if not on disk.","Add `--full` for the synthesized starting state and a step-by-step timeline.",i("tasks","picking this up")].join(`
9
9
  `)}export{y as a,m as b,x as c,T as d,b as e,w as f,S as g,N as h,M as i,A as j,R as k,C as l,I as m,v as n};
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{a as p,c as t}from"./chunk-KOKEEAEF.js";import{a as s}from"./chunk-HEOMRXZE.js";function l(){let o=process.cwd(),e=s(o);e!=null&&e!==o&&(process.chdir(e),process.stderr.write(`ripplo: resolved .ripplo/ at ${e}
5
+ `))}var d={"exit-plan-gate":()=>import("./exit-plan-gate-44YWEKYS.js").then(o=>o.exitPlanGateHook),"plan-reminder":()=>import("./plan-reminder-PP5DQAQZ.js").then(o=>t("UserPromptSubmit",o.planReminder)),"post-edit":()=>import("./post-edit-R7KN424T.js").then(o=>o.postEditHook),"post-edit-analyze":()=>import("./post-edit-analyze-UURDL3AH.js").then(o=>t("PostToolUse",o.postEditAnalyze)),"post-edit-flag-stubs":()=>import("./post-edit-flag-stubs-I7AUGN4D.js").then(o=>t("PostToolUse",o.postEditFlagStubs)),"pre-bash-run-gate":()=>import("./pre-bash-run-gate-MIEM2DBB.js").then(o=>o.preBashRunGateHook),"pre-edit":()=>import("./pre-edit-C4MGURNO.js").then(o=>o.preEditHook),"pre-edit-ripplo-skill-gate":()=>import("./pre-edit-ripplo-skill-gate-A6ETC3QN.js").then(o=>t("PreToolUse",o.preEditRipploSkillGate)),"pre-edit-scope-gate":()=>import("./pre-edit-scope-gate-M5IQSVGF.js").then(o=>t("PreToolUse",o.preEditScopeGate)),"pre-edit-watch-gate":()=>import("./pre-edit-watch-gate-ORQP7MSW.js").then(o=>t("PreToolUse",o.preEditWatchGate)),"prompt-submit":()=>import("./prompt-submit-6KNOFK4W.js").then(o=>o.promptSubmitHook),"scope-reminder":()=>import("./scope-reminder-A6GVTTVE.js").then(o=>t("UserPromptSubmit",o.scopeReminder)),"session-preamble":()=>import("./session-preamble-IZQPIWST.js").then(o=>o.sessionPreambleHook),"stop-enforce":()=>import("./stop-enforce-CO5GYI3G.js").then(o=>o.stopEnforceHook),"tasks-reminder":()=>import("./tasks-reminder-TDWPD3KV.js").then(o=>t("UserPromptSubmit",o.tasksReminder)),"tasks-reminder-tool":()=>Promise.resolve(t("PostToolUse",()=>{})),"track-skill-load":()=>import("./track-skill-load-SXSDMHFO.js").then(o=>o.trackSkillLoadHook),"track-skill-prompt":()=>import("./track-skill-prompt-7N4TQAD2.js").then(o=>t("UserPromptSubmit",o.trackSkillPrompt))},n=d;async function P(o){let e=n[o];e==null&&(process.stderr.write(`Unknown hook: ${o}
6
+ `),process.exit(1));let i=await m(),r=await p(await e(),i);if(r.kind==="crash"){let{renderHookCrash:a}=await import("./cli-error-6PUIWNIT.js");process.stderr.write(`${a(o,r.error)}
7
+ `),process.exit(0)}r.stdout!=null&&process.stdout.write(r.stdout),process.exit(0)}function m(){return new Promise((o,e)=>{if(process.stdin.isTTY){o("");return}let i=[];process.stdin.on("data",r=>i.push(r)),process.stdin.on("end",()=>{o(Buffer.concat(i).toString("utf8"))}),process.stdin.on("error",e)})}export{l as a,n as b,P as c};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{b as n}from"./chunk-G6J2WIHJ.js";import{a}from"./chunk-7WZ3VIUU.js";import{f as s}from"./chunk-KH4QH23U.js";import l from"path";import*as r from"zod/mini";var p=new Set(["Edit","Write","NotebookEdit"]),c=r.looseObject({file_path:r.string()}),d="create",k=o=>{if(!p.has(o.tool_name))return;let i=c.safeParse(o.tool_input);if(!i.success)return;let{cwd:e}=o;if(!a(e)||!s(e))return;let t=l.relative(e,i.data.file_path);if(!(t.startsWith("..")||t!==".ripplo"&&!t.startsWith(".ripplo/"))&&!n(e,o.session_id,d))return{hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Editing \`.ripplo/\` files (${t}) requires the \`/ripplo:create\` skill loaded first. Load \`/ripplo:create\` and retry. It contains the current state model, workflow authoring model, and DSL rules.`}}};export{k as a};
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{c as R}from"./chunk-JS3DLVVI.js";import{f as I,j as v,m as x}from"./chunk-7JKCHASU.js";import{Ba as P,S as h,oa as w,za as k}from"./chunk-ZHDR7LXB.js";import{a as S,f as m}from"./chunk-KH4QH23U.js";import{d as a,f}from"./chunk-C7SV6AR2.js";import y from"fs";import p from"path";function D(e){try{let n=C(e);if(n==null)return;let t=p.join(n,"HEAD"),o=y.readFileSync(t,"utf8").trim(),r="ref: refs/heads/";return o.startsWith(r)?o.slice(r.length):o.length===0?void 0:o.slice(0,7)}catch{return}}function C(e){let n=p.join(e,".git");if(y.statSync(n).isDirectory())return n;let o=y.readFileSync(n,"utf8").trim(),r="gitdir:";if(!o.startsWith(r))return;let i=o.slice(r.length).trim();if(i.length!==0)return p.resolve(e,i)}import T from"crypto";import{readFile as j}from"fs/promises";import $ from"path";import{graphql as g}from"gql.tada";import{err as F,ok as W}from"neverthrow";var O=g(`
5
+ mutation SyncDevSession(
6
+ $projectId: String!
7
+ $cwd: String!
8
+ $branch: String
9
+ $lockfileContent: String
10
+ $fixtures: [SyncDevFixtureInput!]
11
+ $workflows: [SyncDevWorkflowInput!]!
12
+ ) {
13
+ syncDevSession(
14
+ projectId: $projectId
15
+ cwd: $cwd
16
+ branch: $branch
17
+ lockfileContent: $lockfileContent
18
+ fixtures: $fixtures
19
+ workflows: $workflows
20
+ ) {
21
+ id
22
+ hooksPaused
23
+ }
24
+ }
25
+ `);async function ae(e,n){let t=await x(e);if(t.isErr())return F({error:t.error,kind:"compilation-failed"});let o=await u({config:n,cwd:e,lockfile:t.value});return W({devSessionId:o.devSessionId,lockfile:t.value})}async function u(e){let n=k(e.lockfile);return B({config:e.config,cwd:e.cwd,fixtures:e.lockfile.fixtures,payload:n})}var H=g(`
26
+ query DevSessionSyncState($projectId: String!, $cwd: String!) {
27
+ project(id: $projectId) {
28
+ devSession(cwd: $cwd) {
29
+ id
30
+ hooksPaused
31
+ lockfileHash
32
+ }
33
+ }
34
+ }
35
+ `),_=g(`
36
+ mutation AnnounceDevSessionActive($projectId: String!, $cwd: String!) {
37
+ announceDevSessionActive(projectId: $projectId, cwd: $cwd)
38
+ }
39
+ `);async function le(e){let n=await q(e.cwd);if(n!=null){let o=(await a({config:e.config,document:H,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null))?.project?.devSession;if(o!=null&&o.lockfileHash===n)return await a({config:e.config,document:_,variables:{cwd:e.cwd,projectId:e.config.projectId}}).catch(()=>null),{devSessionId:o.id,hooksPaused:o.hooksPaused}}return u(e)}async function q(e){let n=await A(e);return n==null?null:b(n)}function de(e){return b(h(w,e))}function b(e){return T.createHash("sha256").update(e).digest("hex")}async function B({config:e,cwd:n,fixtures:t,payload:o}){let r=D(n),i=await A(n),l=await M(n,t),s=await a({config:e,document:O,variables:{branch:r??null,cwd:n,fixtures:l,lockfileContent:i,projectId:e.projectId,workflows:o.workflows.map(c=>({expectedOutcome:c.expectedOutcome,name:c.name,slug:c.slug,sourcePath:c.sourcePath,spec:JSON.stringify(c.spec)}))}});if(s.syncDevSession==null)throw new Error("syncDevSession returned null");return{devSessionId:s.syncDevSession.id,hooksPaused:s.syncDevSession.hooksPaused}}async function M(e,n){let t=Object.entries(n);return Promise.all(t.map(async([o,r])=>({contentBase64:(await j($.join(e,I,o))).toString("base64"),sha256:r.sha256})))}async function A(e){try{return await j($.join(e,v),"utf8")}catch{return null}}import{graphql as G}from"gql.tada";var X=G(`
40
+ mutation AutoScopeAddDirty($projectId: String!, $cwd: String!, $workflowSlugs: [String!]!) {
41
+ addDirtyTestsToScope(projectId: $projectId, cwd: $cwd, workflowSlugs: $workflowSlugs) {
42
+ __typename
43
+ ... on MutationAddDirtyTestsToScopeSuccess {
44
+ data {
45
+ id
46
+ }
47
+ }
48
+ }
49
+ }
50
+ `);async function we({cwd:e,editedPath:n,lockfile:t,requireHooks:o,syncFirst:r}){if(o&&!m(e))return{addedSlugs:[]};let i=new Set(U(e)),l=t.workflows.filter(d=>d.sourcePath!=null&&N({dirtySet:i,editedPath:n,sourcePath:d.sourcePath})).map(d=>P(d.name));if(l.length===0)return{addedSlugs:[]};let s=R(e).unwrapOr(void 0);return s==null?{addedSlugs:[]}:r&&!await J({cfg:s,cwd:e,lockfile:t})?{addedSlugs:[]}:{addedSlugs:await K({cfg:s,slugs:l})?l:[]}}async function J({cfg:e,cwd:n,lockfile:t}){return await u({config:e,cwd:n,lockfile:t}).catch(r=>(f.warn("auto-sync failed: %s",r instanceof Error?r.message:String(r)),null))!=null}async function K({cfg:e,slugs:n}){let o=(await a({config:e,document:X,variables:{cwd:e.cwd,projectId:e.projectId,workflowSlugs:[...n]}}).catch(r=>(f.warn("auto-scope failed: %s",r instanceof Error?r.message:String(r)),null)))?.addDirtyTestsToScope;return o?.__typename!=="MutationAddDirtyTestsToScopeSuccess"?!1:o.data.length>0}function N({dirtySet:e,editedPath:n,sourcePath:t}){return e.has(t)||n!=null&&n.endsWith(t)}var E=".ripplo/workflows/",L=" -> ";function U(e){let n;try{n=S(["status","--porcelain","-uall","--",".ripplo/workflows"],e)}catch{return[]}return n.split(`
51
+ `).map(t=>t.slice(3).trim()).map(t=>t.includes(L)?t.split(L)[1]:t).filter(t=>t!=null).filter(t=>t.startsWith(E)&&t.endsWith(".ts")).map(t=>t.slice(E.length)).filter(t=>t!=="index.ts"&&!t.endsWith("/index.ts"))}export{D as a,ae as b,u as c,le as d,q as e,de as f,we as g};
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as o}from"./chunk-73TKORK6.js";import{a as t}from"./chunk-MHNGR6M7.js";var r=class extends Error{failure;constructor(i){super(i.kind),this.name="CliError",this.failure=i}};function u(e){return e instanceof r?a(e.failure):e instanceof Error?e.message:String(e)}function a(e){switch(e.kind){case"project-file-missing":return[`Missing ${e.path} \u2014 this directory is not a Ripplo project.`,"Run `npx ripplo init` to create it (or cd into the project root).",t("setup")].join(`
4
+ import{a as o}from"./chunk-WAGXAEB4.js";import{a as t}from"./chunk-MHNGR6M7.js";var r=class extends Error{failure;constructor(i){super(i.kind),this.name="CliError",this.failure=i}};function u(e){return e instanceof r?a(e.failure):e instanceof Error?e.message:String(e)}function a(e){switch(e.kind){case"project-file-missing":return[`Missing ${e.path} \u2014 this directory is not a Ripplo project.`,"Run `npx ripplo init` to create it (or cd into the project root).",t("setup")].join(`
5
5
  `);case"project-file-invalid":return[`${e.path} is invalid:`,...e.issues.map(i=>` ${i}`),"Fix the file by hand or re-run `npx ripplo init`."].join(`
6
6
  `);case"not-authenticated":return["Not signed in. Run `npx ripplo auth login`.","(Claude Code: run it yourself in the background \u2014 the user just approves in the browser.)"].join(`
7
7
  `);case"env-invalid":return s(e);case"playwright-install-failed":return["Playwright browser install failed \u2014 Chromium is still missing.","Run `npx playwright install chromium` and check its output for network, proxy, or disk-space errors."].join(`
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{Ca as $,S as M,T as _,ma as z,na as I,oa as h}from"./chunk-ZHDR7LXB.js";import l from"fs";import s from"path";import{createHash as We}from"crypto";import{pathToFileURL as ve}from"url";import{build as Me}from"esbuild";import{err as d,ok as F,ResultAsync as _e}from"neverthrow";import b from"fs";import{execFile as ie}from"child_process";import{promisify as se}from"util";import{fileURLToPath as C}from"url";import{z as L}from"zod";var ae=se(ie),ce=L.object({diagnostics:L.array(L.string()),ok:L.boolean()});async function H(e){let r=le(),{stdout:n}=await ae(process.execPath,[...r.args,e],{maxBuffer:10*1024*1024}),t=JSON.parse(n);return ce.parse(t)}function le(){let e=C(new URL("dsl-typecheck-worker.js",import.meta.url));if(b.existsSync(e))return{args:[e]};let r=C(new URL("../../dist/dsl-typecheck-worker.js",import.meta.url));if(b.existsSync(r))return{args:[r]};let n=C(new URL("../dsl-typecheck-worker.ts",import.meta.url));if(b.existsSync(n))return{args:["--experimental-strip-types",n]};throw new Error("DSL typecheck worker missing")}import me from"safe-stable-stringify";import{err as ge,ok as K,Result as he}from"neverthrow";import{z as ke}from"zod";import x from"fs";import U from"path";import{z as f}from"zod";import{createHash as de}from"crypto";function c(e){return de("sha256").update(e).digest("base64")}var ue="fd3",fe="fold2";function T(){return`${String(h.currentVersion)}:${ue}:${fe}`}function w(e){return c([T(),...e].join("\0"))}function R({cwd:e,key:r,kind:n}){return B(e,n)?.entries.find(([o])=>o===r)?.[1]}function P({cwd:e,keep:r,key:n,kind:t,value:o}){let y=(B(e,t)?.entries??[]).filter(([a])=>a!==n),S=[n,o],v=[...y,S].slice(-r),m=N(e,t),u={entries:v,epoch:T()};x.mkdirSync(U.dirname(m),{recursive:!0}),x.writeFileSync(m,JSON.stringify(u)),k=new Map([...k,[m,{signature:D(m),store:u}]])}var pe=f.object({entries:f.array(f.tuple([f.string(),f.unknown()])),epoch:f.string()}),k=new Map;function B(e,r){let n=N(e,r),t=D(n),o=k.get(n);if(o!=null&&o.signature===t)return o.store;let i=ye({signature:t,storePath:n});return k=new Map([...k,[n,{signature:t,store:i}]]),i}function ye({signature:e,storePath:r}){if(e!=null)try{let n=pe.safeParse(JSON.parse(x.readFileSync(r,"utf8")));return!n.success||n.data.epoch!==T()?void 0:n.data}catch{return}}function D(e){if(!x.existsSync(e))return;let r=x.statSync(e);return`${String(r.mtimeMs)}:${String(r.size)}`}function N(e,r){return U.join(e,".ripplo",".local","cache",`${r}.json`)}async function J(e,r){let n=await V({cwd:r,workflows:e.workflows});return he.combine(n).map(t=>({...e,workflows:[...t]}))}var xe=ke.array(z),X=4;async function V({cwd:e,workflows:r}){if(r.length===0)return[];let n=r.slice(0,X),t=await Promise.all(n.map(i=>we({cwd:e,workflow:i}))),o=await V({cwd:e,workflows:r.slice(X)});return[...t,...o]}async function we({cwd:e,workflow:r}){let n=w(["expand",Ee(r)]),t=xe.safeParse(R({cwd:e,key:n,kind:"expand"}));if(t.success)return K({...r,tests:t.data});try{let o=await $({workflow:r});return P({cwd:e,keep:2e3,key:n,kind:"expand",value:o.tests}),K(o)}catch(o){let i=o instanceof Error?o.message:String(o);return ge({kind:"expand-failed",message:i,workflow:r.name})}}function Ee(e){let r=me({...e,tests:[]});if(r==null)throw new Error("solver: workflow is not serializable");return r}import{createHash as Se}from"crypto";import Y from"fs/promises";import j from"path";import{err as p,ok as A,Result as Le}from"neverthrow";var Re=".ripplo/fixtures",Pe=10*1024*1024,Fe=50*1024*1024;async function Z(e,r){let n=be(r);if(n.length===0)return A({});let t=j.join(e,Re),o=await Promise.all(n.map(i=>Ce({fixturesRoot:t,name:i})));return Le.combine(o).andThen(Te)}function be(e){let n=e.workflows.flatMap(t=>[...t.steps,...t.tests.flatMap(o=>o.steps)]).flatMap(t=>t.action.kind==="upload"?t.action.files:[]);return[...new Set(n)].toSorted((t,o)=>t.localeCompare(o))}async function Ce({fixturesRoot:e,name:r}){if(r.includes("..")||j.isAbsolute(r))return p({kind:"fixture-invalid-name",name:r});let n=j.join(e,r),t=await Y.lstat(n).catch(()=>null);if(t==null)return p({kind:"fixture-missing",name:r,path:n});if(t.isSymbolicLink())return p({kind:"fixture-symlink",name:r});if(!t.isFile())return p({kind:"fixture-not-file",name:r});let o=await Y.readFile(n);if(o.byteLength>Pe)return p({kind:"fixture-too-large",name:r,size:o.byteLength});let i=Se("sha256").update(o).digest("hex");return A([r,{sha256:i,size:o.byteLength}])}function Te(e){let r=e.reduce((n,[,t])=>n+t.size,0);return r>Fe?p({kind:"fixtures-total-too-large",total:r}):A(Object.fromEntries(e))}import G from"fs";import je from"path";import{z as O}from"zod";function q({cwd:e,fingerprint:r}){let n=ee(e);if(n==null||n.fingerprint!==c(r))return;let t=je.join(e,".ripplo","ripplo.lock");if(!G.existsSync(t))return;let o=G.readFileSync(t,"utf8");if(c(o)===n.lockfileHash)try{let i=_(h,o);return Ae(i)?void 0:i}catch{return}}function Ae(e){return e.workflows.some(({sourcePath:r})=>r?.startsWith(".local/")===!0)}function Q({cwd:e,fingerprint:r,lockfile:n}){re(e,{fingerprint:c(r),lockfileHash:c(M(h,n))})}function Cr(e,r){let n=ee(e);n!=null&&re(e,{...n,lockfileHash:c(r)})}var Oe=O.object({fingerprint:O.string(),lockfileHash:O.string()});function ee(e){let r=Oe.safeParse(R({cwd:e,key:w(["load"]),kind:"load"}));return r.success?r.data:void 0}function re(e,r){P({cwd:e,keep:1,key:w(["load"]),kind:"load",value:r})}var Ur=".ripplo/ripplo.lock",E;async function Br(e){let{result:r}=await ze(e);return r}async function ze(e){let r=te(s.join(e,".ripplo"));if(E!=null&&E.fingerprint===r&&E.result.isOk())return{fingerprint:r,result:E.result};let n=await Ie(e);return E={fingerprint:r,result:n},{fingerprint:r,result:n}}async function Ie(e){let r=s.join(e,".ripplo"),n=s.join(r,"index.ts"),t=te(r),o=q({cwd:e,fingerprint:t});if(o!=null)return F(o);let i=Ne(n);i.catch(()=>{});let y=await $e(r);if(y.isErr())return d(y.error);let S=y.value;if(!S.ok)return d({diagnostics:S.diagnostics,kind:"typecheck-failed"});let u=await(await Ke(n,i)).andThen(a=>Ve({entryPath:n,exported:a})).match(async a=>(await Z(e,a)).map(g=>({...a,fixtures:g})).mapErr(g=>({error:g,kind:"fixture-failed"})).asyncAndThen(g=>new _e(J(g,e)).mapErr(oe=>oe)),a=>Promise.resolve(d(a)));return u.isOk()&&Q({cwd:e,fingerprint:t,lockfile:u.value}),u}async function $e(e){try{return F(await H(e))}catch(r){return d(ne(r))}}function ne(e){return He(e)?{kind:"authoring-error",message:e.message}:{kind:"load-threw",message:Je(e)}}function He(e){return e instanceof Error&&e.name==="RipploAuthoringError"}var Ue=new Set([".local",".turbo","debug","node_modules","ripplo.lock"]);function te(e){let r=s.join(e,"..","node_modules","@ripplo","testing");return[...W(e),...Be(s.join(r,"package.json")),...De(r)].toSorted((n,t)=>n.localeCompare(t)).join("|")}function W(e){return(l.existsSync(e)?l.readdirSync(e,{withFileTypes:!0}):[]).flatMap(n=>{if(Ue.has(n.name))return[];let t=s.join(e,n.name);if(n.isDirectory())return W(t);let o=l.statSync(t);return[`${t}:${String(o.mtimeMs)}:${String(o.size)}`]})}function Be(e){if(!l.existsSync(e))return[];let r=l.statSync(e);return[`${e}:${String(r.mtimeMs)}:${String(r.size)}`]}function De(e){let r=s.join(e,"src");return l.existsSync(r)?W(r):[]}async function Ne(e){let n=(await Me({bundle:!0,entryPoints:[e],format:"esm",logLevel:"silent",platform:"node",sourcemap:"inline",target:"node22",write:!1})).outputFiles[0];if(n==null)throw new Error("dsl bundle produced no output");return n.text}async function Ke(e,r){try{let n=await r;process.setSourceMapsEnabled(!0);let t=await import(Xe(e,n)),o=t!=null&&typeof t=="object"&&"default"in t?Reflect.get(t,"default"):t;return F(o)}catch(n){return d(ne(n))}}function Xe(e,r){let n=s.join(s.dirname(e),".local");l.mkdirSync(n,{recursive:!0});let t=We("sha256").update(r).digest("hex").slice(0,16),o=s.join(n,`dsl-bundle-${t}.mjs`);return l.writeFileSync(o,r),ve(o).href}function Je(e){return e instanceof Error?e.message:String(e)}function Ve({entryPath:e,exported:r}){if(r==null||typeof r!="object"||!("lockfile"in r))return d({entryPath:e,kind:"not-ripplo"});let n=I.safeParse(Reflect.get(r,"lockfile"));return n.success?F(n.data):d({issues:n.error.issues.map(t=>`${t.path.join(".")}: ${t.message}`),kind:"invalid-lockfile"})}export{c as a,T as b,w as c,R as d,P as e,Re as f,Pe as g,Fe as h,Cr as i,Ur as j,Br as k,ze as l,Ie as m,te as n};
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{f as a}from"./chunk-QAR7FZO3.js";import{a as n}from"./chunk-73TKORK6.js";import{l as i}from"./chunk-FXCBWBN5.js";import{n as e}from"./chunk-67YR3QHA.js";import{i as u}from"./chunk-5X4M4MTG.js";async function x(m){let o=process.cwd(),r=await e(o);r.isErr()&&(process.stderr.write(`${n(r.error)}
5
- `),process.exit(1));let s=i(r.value),t=await a(o);if(m.format==="summary"){s.length>0&&process.stdout.write(`stub workflows: ${s.join(", ")}
4
+ import{h as u}from"./chunk-UH5CQF5R.js";import{f as a}from"./chunk-LEFODI2H.js";import{a as i}from"./chunk-WAGXAEB4.js";import{l as n}from"./chunk-E6ZBZIIS.js";import{m as e}from"./chunk-7JKCHASU.js";async function x(m){let o=process.cwd(),r=await e(o);r.isErr()&&(process.stderr.write(`${i(r.error)}
5
+ `),process.exit(1));let s=n(r.value),t=await a(o);if(m.format==="summary"){s.length>0&&process.stdout.write(`stub workflows: ${s.join(", ")}
6
6
  `),process.stdout.write(`${u(t)}
7
7
  `);return}let p={daemon:t.kind==="running"?{active:t.status.active,explorer:t.status.explorer,exploring:t.status.exploring,progress:t.status.progress,queued:t.status.queued,running:!0}:{running:t.kind==="unresponsive",state:t.kind},tests:s.map(d=>({id:d,implemented:!1}))};process.stdout.write(`${JSON.stringify(p,null,2)}
8
8
  `)}export{x as a};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{a as l}from"./chunk-LB65USNP.js";import{a as i}from"./chunk-OWN4P2K7.js";import{a as m}from"./chunk-7WZ3VIUU.js";var s=/(?:^|\s)\/ripplo:([a-z][a-z0-9-]*)\b/gi,c=o=>{if(!m(o.cwd))return;let t=[...o.prompt.matchAll(s)].map(r=>r[1]).filter(r=>r!=null);if(t.forEach(r=>{i(o.cwd,o.session_id,r)}),t.length===0)return;let e=l(o.cwd,o.session_id);if(e!=null)return{hookSpecificOutput:{additionalContext:e,hookEventName:"UserPromptSubmit"}}};export{c as a};
4
+ import{a as l}from"./chunk-CI6273ZU.js";import{a as i}from"./chunk-G6J2WIHJ.js";import{a as m}from"./chunk-7WZ3VIUU.js";var s=/(?:^|\s)\/ripplo:([a-z][a-z0-9-]*)\b/gi,c=o=>{if(!m(o.cwd))return;let t=[...o.prompt.matchAll(s)].map(r=>r[1]).filter(r=>r!=null);if(t.forEach(r=>{i(o.cwd,o.session_id,r)}),t.length===0)return;let e=l(o.cwd,o.session_id);if(e!=null)return{hookSpecificOutput:{additionalContext:e,hookEventName:"UserPromptSubmit"}}};export{c as a};
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{b as s,c as u}from"./chunk-KH4QH23U.js";import{createHash as d}from"crypto";import{mkdirSync as g,readdirSync as h,readFileSync as p,writeFileSync as m}from"fs";import n from"path";var f=[".ts",".tsx",".js",".jsx"],y=new Set([".local","debug"]);function A(r){let t=d("sha256");return u(r)?(t.update(s(["rev-parse","HEAD"],r)),t.update("\0"),t.update(s(["diff","HEAD"],r)),t.update("\0"),s(["ls-files","--others","--exclude-standard"],r).split(`
5
+ `).filter(e=>e.length>0).filter(e=>f.some(i=>e.endsWith(i))).toSorted((e,i)=>e.localeCompare(i)).forEach(e=>{t.update(e),t.update("\0"),t.update(l(n.join(r,e))),t.update("\0")}),t.digest("hex")):S(r,t)}function D(r,t){try{return p(c(r,t),"utf8").trim()}catch{return null}}function F(r,t,o){let e=c(r,t);g(n.dirname(e),{recursive:!0}),m(e,o)}function S(r,t){let o=n.join(r,".ripplo");return x(o).filter(i=>f.some(a=>i.endsWith(a))).filter(i=>!y.has(i.split(n.sep)[0]??"")).toSorted((i,a)=>i.localeCompare(a)).forEach(i=>{t.update(i),t.update("\0"),t.update(l(n.join(o,i))),t.update("\0")}),t.digest("hex")}function x(r){try{return h(r,{recursive:!0}).filter(t=>typeof t=="string")}catch{return[]}}function l(r){try{return p(r)}catch{return Buffer.alloc(0)}}function c(r,t){return n.join(r,".ripplo",".local",`${t}.hash`)}export{A as a,D as b,F as c};
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __ripploCreateRequire } from "node:module";
3
3
  const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
- import{b as E}from"./chunk-LOEAZGYO.js";import{a as U}from"./chunk-NNH3YVVO.js";import{b as $}from"./chunk-KMZ3L5YA.js";var F=15e3,G=3,L=300,f=class extends Error{detail;serverUrl;constructor({detail:r,serverUrl:t}){super(`Failed to connect to Ripplo server at ${t}. Check the server is running and reachable. Details: ${r}`),this.name="GqlConnectionError",this.detail=r,this.serverUrl=t}},u=class extends Error{errors;constructor(r){super(r.map(t=>t.message).join(", ")),this.name="GqlRequestError",this.errors=r}};function N(e){if(e instanceof u)return e.errors[0]?.extensions?.code}var j={attempts:G,timeoutMs:F},V={attempts:1,timeoutMs:3e3};async function x(e){return T(e,j)}async function W(e){return T(e,V)}async function T(e,r){let{print:t}=await import("graphql"),n=t(e.document),o=JSON.stringify({query:n,variables:e.variables}),a=`${e.config.ripploServerUrl}/graphql`,s=await B({init:{body:o,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json",...E()},method:"POST"},policy:r,serverUrl:e.config.ripploServerUrl,url:a}),l=await J({res:s,url:a});if(!Q(l))throw new Error("Invalid GraphQL response");if(X(l))throw new u(l.errors);if(l.data==null)throw new Error("No data returned from server");return l.data}async function B({init:e,policy:r,serverUrl:t,url:n}){let o=1,a=await b({init:e,timeoutMs:r.timeoutMs,url:n});for(;a.retryable&&o<r.attempts;)await K(H(o)),o+=1,a=await b({init:e,timeoutMs:r.timeoutMs,url:n});let{response:s}=a;if(s!=null&&s.status<500)return s;throw new f({detail:s==null?a.detail:`server returned status ${String(s.status)}`,serverUrl:t})}async function b({init:e,timeoutMs:r,url:t}){try{let n=await fetch(t,{...e,signal:AbortSignal.timeout(r)});return{detail:"",response:n,retryable:n.status>=500}}catch(n){return{detail:n instanceof Error?n.message:String(n),response:void 0,retryable:!0}}}function H(e){return L*3**(e-1)*(.5+Math.random())}function K(e){return new Promise(r=>{setTimeout(r,e)})}async function J({res:e,url:r}){let t=await e.text();if(t.length===0)throw new Error(`Empty response from Ripplo server at ${r} (status ${String(e.status)}). The server may have restarted or the request was rejected before a body was sent.`);try{return JSON.parse(t)}catch{throw new Error(`Non-JSON response from Ripplo server at ${r} (status ${String(e.status)}): ${t.slice(0,200)}`)}}function Q(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function X(e){return Array.isArray(e.errors)&&e.errors.length>0}import Y from"pino";import z from"pino-pretty";var y=Y({level:process.env.LOG_LEVEL??"info"},z({ignore:"pid,hostname"}));import{readdir as Z,rm as ee,stat as re}from"fs/promises";import{existsSync as k}from"fs";import w from"path";var v=".uploaded";var C=w.join(process.cwd(),".ripplo","debug"),D=360*60*1e3;async function te({maxRuns:e}){try{let t=(await Z(C,{withFileTypes:!0})).filter(i=>i.isDirectory()),n=Date.now(),o=await Promise.all(t.map(async i=>{let m=w.join(C,i.name),O=await re(m);return{dirPath:m,mtime:O.mtimeMs,pendingUpload:ne(m)}})),a=o.filter(i=>n-i.mtime>D),s=o.filter(i=>n-i.mtime<=D&&!i.pendingUpload).toSorted((i,m)=>m.mtime-i.mtime).slice(e),l=[...a,...s];if(l.length===0)return;await Promise.allSettled(l.map(i=>ee(i.dirPath,{force:!0,recursive:!0}))),y.debug("Pruned %d old debug run(s)",l.length)}catch{y.warn("Debug run pruning failed, ignoring")}}function ne(e){return k(w.join(e,"behavior.jsonl"))&&!k(w.join(e,v))}import d from"fs";import oe from"os";import g from"path";var ie=".local",ae=".ripplo";function h(e){return g.join(e,".ripplo",ie)}function se(e){let r=h(e);d.existsSync(r)||d.mkdirSync(r,{recursive:!0});let t=g.join(r,".gitignore");return d.existsSync(t)||d.writeFileSync(t,`*
5
- `),r}function le(e,r){return g.join(h(e),r)}function P(){return g.join(oe.homedir(),ae)}function S(){let e=P();return d.existsSync(e)?d.chmodSync(e,448):d.mkdirSync(e,{mode:448,recursive:!0}),e}function A(e){return g.join(P(),e)}import{Agent as de,RetryAgent as ce,setGlobalDispatcher as me}from"undici";var ue=1500,ge=4e3,pe=3,fe=50,ye=100,I=!1;function we(){if(I)return;I=!0;let e=new de({connections:ye,keepAliveMaxTimeout:ge,keepAliveTimeout:ue}),r=new ce(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_REQ_CONTENT_LENGTH_MISMATCH","UND_ERR_SOCKET"],maxRetries:pe,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:fe});me(r)}import{graphql as p}from"gql.tada";var We=p(`
4
+ import{c as b}from"./chunk-HEOMRXZE.js";import{a as F}from"./chunk-NNH3YVVO.js";import{b as O}from"./chunk-KMZ3L5YA.js";var U=15e3,G=3,L=300,f=class extends Error{detail;serverUrl;constructor({detail:r,serverUrl:t}){super(`Failed to connect to Ripplo server at ${t}. Check the server is running and reachable. Details: ${r}`),this.name="GqlConnectionError",this.detail=r,this.serverUrl=t}},u=class extends Error{errors;constructor(r){super(r.map(t=>t.message).join(", ")),this.name="GqlRequestError",this.errors=r}};function N(e){if(e instanceof u)return e.errors[0]?.extensions?.code}var j={attempts:G,timeoutMs:U},V={attempts:1,timeoutMs:3e3};async function E(e){return T(e,j)}async function W(e){return T(e,V)}async function T(e,r){let{print:t}=await import("graphql"),n=t(e.document),o=JSON.stringify({query:n,variables:e.variables}),a=`${e.config.ripploServerUrl}/graphql`,s=await B({init:{body:o,headers:{Authorization:`Bearer ${e.config.token}`,"Content-Type":"application/json",...b()},method:"POST"},policy:r,serverUrl:e.config.ripploServerUrl,url:a}),l=await J({res:s,url:a});if(!Q(l))throw new Error("Invalid GraphQL response");if(X(l))throw new u(l.errors);if(l.data==null)throw new Error("No data returned from server");return l.data}async function B({init:e,policy:r,serverUrl:t,url:n}){let o=1,a=await x({init:e,timeoutMs:r.timeoutMs,url:n});for(;a.retryable&&o<r.attempts;)await K(H(o)),o+=1,a=await x({init:e,timeoutMs:r.timeoutMs,url:n});let{response:s}=a;if(s!=null&&s.status<500)return s;throw new f({detail:s==null?a.detail:`server returned status ${String(s.status)}`,serverUrl:t})}async function x({init:e,timeoutMs:r,url:t}){try{let n=await fetch(t,{...e,signal:AbortSignal.timeout(r)});return{detail:"",response:n,retryable:n.status>=500}}catch(n){return{detail:n instanceof Error?n.message:String(n),response:void 0,retryable:!0}}}function H(e){return L*3**(e-1)*(.5+Math.random())}function K(e){return new Promise(r=>{setTimeout(r,e)})}async function J({res:e,url:r}){let t=await e.text();if(t.length===0)throw new Error(`Empty response from Ripplo server at ${r} (status ${String(e.status)}). The server may have restarted or the request was rejected before a body was sent.`);try{return JSON.parse(t)}catch{throw new Error(`Non-JSON response from Ripplo server at ${r} (status ${String(e.status)}): ${t.slice(0,200)}`)}}function Q(e){return typeof e=="object"&&e!=null&&("data"in e||"errors"in e)}function X(e){return Array.isArray(e.errors)&&e.errors.length>0}import Y from"pino";import z from"pino-pretty";var y=Y({level:process.env.LOG_LEVEL??"info"},z({ignore:"pid,hostname"}));import{readdir as Z,rm as ee,stat as re}from"fs/promises";import{existsSync as k}from"fs";import w from"path";var v=".uploaded";var C=w.join(process.cwd(),".ripplo","debug"),D=360*60*1e3;async function te({maxRuns:e}){try{let t=(await Z(C,{withFileTypes:!0})).filter(i=>i.isDirectory()),n=Date.now(),o=await Promise.all(t.map(async i=>{let m=w.join(C,i.name),$=await re(m);return{dirPath:m,mtime:$.mtimeMs,pendingUpload:ne(m)}})),a=o.filter(i=>n-i.mtime>D),s=o.filter(i=>n-i.mtime<=D&&!i.pendingUpload).toSorted((i,m)=>m.mtime-i.mtime).slice(e),l=[...a,...s];if(l.length===0)return;await Promise.allSettled(l.map(i=>ee(i.dirPath,{force:!0,recursive:!0}))),y.debug("Pruned %d old debug run(s)",l.length)}catch{y.warn("Debug run pruning failed, ignoring")}}function ne(e){return k(w.join(e,"behavior.jsonl"))&&!k(w.join(e,v))}import d from"fs";import oe from"os";import g from"path";var ie=".local",ae=".ripplo";function h(e){return g.join(e,".ripplo",ie)}function se(e){let r=h(e);d.existsSync(r)||d.mkdirSync(r,{recursive:!0});let t=g.join(r,".gitignore");return d.existsSync(t)||d.writeFileSync(t,`*
5
+ `),r}function le(e,r){return g.join(h(e),r)}function P(){return g.join(oe.homedir(),ae)}function S(){let e=P();return d.existsSync(e)?d.chmodSync(e,448):d.mkdirSync(e,{mode:448,recursive:!0}),e}function A(e){return g.join(P(),e)}import{Agent as de,RetryAgent as ce,setGlobalDispatcher as me}from"undici";var ue=1500,ge=4e3,pe=3,fe=50,ye=100,I=!1;function we(){if(I)return;I=!0;let e=new de({connections:ye,keepAliveMaxTimeout:ge,keepAliveTimeout:ue}),r=new ce(e,{errorCodes:["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT","UND_ERR_SOCKET"],maxRetries:pe,methods:["GET","POST","HEAD","OPTIONS","PUT","DELETE"],minTimeout:fe,statusCodes:[]});me(r)}import{graphql as p}from"gql.tada";var We=p(`
6
6
  query AgentReviewContextWorker($reviewId: String!) {
7
7
  agentReview(id: $reviewId) {
8
8
  id
@@ -44,5 +44,5 @@ import{b as E}from"./chunk-LOEAZGYO.js";import{a as U}from"./chunk-NNH3YVVO.js";
44
44
  mutation FailAgentReviewWorker($reviewId: String!, $reason: String!) {
45
45
  failAgentReview(reviewId: $reviewId, reason: $reason)
46
46
  }
47
- `);import c from"fs";import _ from"path";function Re(e){let r=process.env.RIPPLO_TOKEN;if(r!=null&&r.trim().length>0)return r.trim();let t=R(e);if(!c.existsSync(t))return null;let n=c.readFileSync(t,"utf8").trim();return n.length===0?null:n}function ve({serverUrl:e,token:r}){S();let t=R(e);c.mkdirSync(_.dirname(t),{mode:448,recursive:!0}),c.writeFileSync(t,r+`
48
- `,{mode:384})}function he(e){let r=R(e);return c.existsSync(r)?(c.unlinkSync(r),!0):!1}function R(e){return A(_.join("tokens",Pe(e)))}function Pe(e){return new URL(e).host.replaceAll(/[^a-zA-Z0-9.]/g,"_")}var M=$(U(),1);import q from"crypto";function Se({body:e,secret:r}){let t=new M.Webhook(r),n=`msg_${q.randomUUID()}`,o=new Date,a=t.sign(n,o,e),s=Math.floor(o.getTime()/1e3);return{"webhook-id":n,"webhook-signature":a,"webhook-timestamp":String(s)}}function Ae(){return`whsec_${q.randomBytes(24).toString("base64")}`}export{f as a,u as b,N as c,x as d,W as e,y as f,v as g,te as h,se as i,le as j,Re as k,ve as l,he as m,R as n,we as o,Se as p,Ae as q};
47
+ `);import c from"fs";import q from"path";function Re(e){let r=process.env.RIPPLO_TOKEN;if(r!=null&&r.trim().length>0)return r.trim();let t=R(e);if(!c.existsSync(t))return null;let n=c.readFileSync(t,"utf8").trim();return n.length===0?null:n}function ve({serverUrl:e,token:r}){S();let t=R(e);c.mkdirSync(q.dirname(t),{mode:448,recursive:!0}),c.writeFileSync(t,r+`
48
+ `,{mode:384})}function he(e){let r=R(e);return c.existsSync(r)?(c.unlinkSync(r),!0):!1}function R(e){return A(q.join("tokens",Pe(e)))}function Pe(e){return new URL(e).host.replaceAll(/[^a-zA-Z0-9.]/g,"_")}var M=O(F(),1);import _ from"crypto";function Se({body:e,secret:r}){let t=new M.Webhook(r),n=`msg_${_.randomUUID()}`,o=new Date,a=t.sign(n,o,e),s=Math.floor(o.getTime()/1e3);return{"webhook-id":n,"webhook-signature":a,"webhook-timestamp":String(s)}}function Ae(){return`whsec_${_.randomBytes(24).toString("base64")}`}export{f as a,u as b,N as c,E as d,W as e,y as f,v as g,te as h,se as i,le as j,Re as k,ve as l,he as m,R as n,we as o,Se as p,Ae as q};
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __ripploCreateRequire } from "node:module";
3
+ const require = globalThis.require ?? __ripploCreateRequire(import.meta.url);
4
+ import{c as o,d as r}from"./chunk-G6J2WIHJ.js";import{a}from"./chunk-7WZ3VIUU.js";var n=`# How Ripplo thinks
5
+
6
+ This model drives compile errors, run failures, and explorer findings.
7
+
8
+ **Done has two halves.** The app delivers the behavior, and a passing workflow proves the complete
9
+ user journey. Neither half is optional.
10
+
11
+ ## Workflow, test, and run
12
+
13
+ A **workflow** is the authored model of one critical user intent. It follows the real multi-step
14
+ click path from a natural entry point and declares what each action makes true.
15
+
16
+ A **test** is one concrete state synthesized from that workflow for a reachable named \`when\`
17
+ branch. A workflow without branches has one \`main\` test. A **run** executes one test. Authors edit
18
+ workflows, not concrete test state.
19
+
20
+ ## One typed application-state model
21
+
22
+ One root Zod schema defines application state. Each top-level key is a source that returns one
23
+ validated state blob. Sources can be served over HTTP or from the browser without changing workflow
24
+ selectors. Authentication is separate because signing in creates a browser session.
25
+
26
+ Use \`setup.value\`, \`setup.generated\`, and \`setup.record\` only where workflows may create
27
+ starting state. Plain Zod fields remain observable. TypeScript derives each source's setup and read
28
+ contract from the schema.
29
+
30
+ ## Start wide and stay connected
31
+
32
+ \`given\` is not a fixture. It describes the widest set of starting states compatible with the
33
+ entire journey. Add only structural presence, absence, relations, permissions, actor, viewport, and
34
+ other preconditions every step truly needs.
35
+
36
+ Omit irrelevant record fields. Setup generates them from the schema, and returned record handles
37
+ expose their values. Use \`arbitrary(field)\` for a workflow input that can be any schema-valid
38
+ value. Reuse that binding in actions and effects. Use \`exact(value)\` only when the concrete string
39
+ or number drives behavior.
40
+
41
+ State-rendered names, ids, slugs, counts, amounts, inputs, and URLs come from handles or expressions.
42
+ Repeating a setup literal in a locator or action creates drift and narrows the journey.
43
+
44
+ When starting state changes an outcome but the intent and click path stay the same, use
45
+ \`optional()\` and named \`when\` branches. Branch conditions constrain synthesis directly. Use
46
+ another workflow only when the intent or path differs.
47
+
48
+ ## Steps declare complete transitions
49
+
50
+ A step declares the user action, its page result, and every application-state effect. A toast or
51
+ closed dialog does not prove a write persisted. Declare \`created\`, \`updated\`, \`deleted\`,
52
+ \`set\`, or \`transform\` alongside visible evidence.
53
+
54
+ Every effect must definitely change state from what \`given\`, its branch, and earlier steps
55
+ establish. A possible no-op is invalid. Use a before/after relation that excludes equality or model
56
+ the real precondition. Do not hardcode a convenient previous value solely to satisfy the proof.
57
+
58
+ Ripplo applies a frame rule: state persists until a declared effect changes it. Any observed change
59
+ outside the declared effects is a frame violation. Cascades must be declared completely.
60
+
61
+ ## Reachability and page state
62
+
63
+ An action can touch only an element an earlier durable \`visible(...)\` established. Assert the
64
+ surface or control when it first appears. Use semantic roles such as \`button\`, \`textbox\`,
65
+ \`heading\`, and \`link\`. Add an accessible name to the app when one is missing.
66
+
67
+ \`text(locator, "x")\` and \`value(locator, "x")\` are exact. Use \`contains("x")\` or
68
+ \`startsWith("x")\` only when that broader relationship is intended.
69
+
70
+ ## Facts keep their conditions
71
+
72
+ Workflow assertions become facts under the complete application and page state declared at that
73
+ step. They are not generalized beyond those conditions. The explorer reuses those exact facts on
74
+ compatible composed paths.
75
+
76
+ Two facts that disagree on overlapping state are a compile error. Add the missing distinguishing
77
+ state or split the outcome with \`when\`.
78
+
79
+ Use \`fact()\` only for a true app-wide invariant or permission boundary that no journey owns. Do
80
+ not replace a journey, branch, or missing effect with a broad fact.
81
+
82
+ ## What each gate proves
83
+
84
+ - \`npx ripplo compile\` validates authoring, branch reachability, definite effects, fact
85
+ consistency, interaction reachability, and the lockfile.
86
+ - \`npx ripplo run\` compares every declared page and application-state expectation with the live
87
+ app after each step.
88
+ - The explorer composes declared steps and reports contradictions on paths no workflow wrote.
89
+
90
+ On failure, run \`npx ripplo explain <runId>\` and inspect \`behavior.jsonl\` before re-running.
91
+ Form one evidence-backed hypothesis, make one change, then run once.
92
+
93
+ \`.wait("slow")\` gives a page predicate more time. \`consistency.eventual(schema)\` marks a state
94
+ field whose source may legitimately expose intermediate values before converging. A longer wait
95
+ must not hide a wrong value.
96
+
97
+ ## Scope and the prime directive
98
+
99
+ Testing Scope is the set of workflows this session must leave green. Add every affected journey.
100
+ A stub \`workflow("Intent")\` is a promise that must be implemented before finishing.
101
+
102
+ Fix broken behavior in the app. Strengthen an incomplete model in the workflow. Never weaken a
103
+ declaration, replace state-derived values with literals, or narrow starting state merely to turn a
104
+ failure green.
105
+
106
+ \`.ripplo/ripplo.lock\` is committed, regenerated by \`npx ripplo compile\`, and never hand-edited.
107
+ `;function l(e,t){return!a(e)||r(e,t)?null:(o(e,t),n)}export{l as a};