@workflow/web 4.0.1-beta.21 → 4.0.1-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/server-reference-manifest.json +36 -21
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page/server-reference-manifest.json +37 -22
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/run/[runId]/page/server-reference-manifest.json +37 -22
- package/.next/server/app/run/[runId]/page.js.nft.json +1 -1
- package/.next/server/app/run/[runId]/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1365a866._.js +3 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1365a866._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__2168651f._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__2168651f._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__25c4ca9a._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__25c4ca9a._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__d416fa5e._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__d416fa5e._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__e576a2e1._.js +7 -7
- package/.next/server/chunks/ssr/[root-of-the-server]__e576a2e1._.js.map +1 -1
- package/.next/server/chunks/ssr/_af28dabd._.js +1 -1
- package/.next/server/chunks/ssr/_af28dabd._.js.map +1 -1
- package/.next/server/chunks/ssr/_bff7cae2._.js +1 -1
- package/.next/server/chunks/ssr/_bff7cae2._.js.map +1 -1
- package/.next/server/chunks/ssr/_c8bf1458._.js +1 -1
- package/.next/server/chunks/ssr/_c8bf1458._.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web_src_19bb3951._.js +3 -0
- package/.next/server/chunks/ssr/packages_web_src_19bb3951._.js.map +1 -0
- package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js +2 -2
- package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web_src_app_run_[runId]_page_tsx_c7d0b139._.js +1 -1
- package/.next/server/chunks/ssr/packages_web_src_app_run_[runId]_page_tsx_c7d0b139._.js.map +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +56 -27
- package/.next/static/chunks/{1633a4677cb7eacd.js → 30b98d965a129331.js} +1 -1
- package/.next/static/chunks/{a2fdd31ef7d1ed50.js → 31d3eed44663a2d8.js} +3 -3
- package/.next/static/chunks/4b98d98ef7601f2c.js +1 -0
- package/.next/static/chunks/50691ade475383ae.js +5 -0
- package/.next/static/chunks/837b0d5cc6ee8f87.js +60 -0
- package/.next/static/chunks/8f6413f9323a44e5.js +14 -0
- package/.next/static/chunks/{d3781b000675e89a.js → ce42d7684243cb43.js} +1 -1
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/package.json +4 -3
- package/.next/server/chunks/ssr/packages_web_src_components_ui_select_tsx_7c5238ef._.js +0 -3
- package/.next/server/chunks/ssr/packages_web_src_components_ui_select_tsx_7c5238ef._.js.map +0 -1
- package/.next/static/chunks/7993564ea9cd3862.js +0 -60
- package/.next/static/chunks/915c48af605695f8.js +0 -5
- package/.next/static/chunks/ebaf4c277606b4fc.js +0 -14
- /package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → Ven1ulyDX7wtUfVstJodR}/_buildManifest.js +0 -0
- /package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → Ven1ulyDX7wtUfVstJodR}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → Ven1ulyDX7wtUfVstJodR}/_ssgManifest.js +0 -0
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51379,e=>{"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var r=t(),n={exec:()=>null};function s(e,t=""){let r="string"==typeof e?e:e.source,n={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(l.caret,"$1"),r=r.replace(e,s),n},getRegex:()=>new RegExp(r,t)};return n}var l={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},a=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,i=/(?:[*+-]|\d{1,9}[.)])/,o=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,c=s(o).replace(/bull/g,i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),u=s(o).replace(/bull/g,i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),d=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,p=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,h=s(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",p).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),f=s(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,i).getRegex(),m="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",g=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,x=s("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",g).replace("tag",m).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),k=s(d).replace("hr",a).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m).getRegex(),b={blockquote:s(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",k).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:h,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:a,html:x,lheading:c,list:f,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:k,table:n,text:/^[^\n]+/},v=s("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",a).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m).getRegex(),w={...b,lheading:u,table:v,paragraph:s(d).replace("hr",a).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",v).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",m).getRegex()},y={...b,html:s(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",g).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:n,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:s(d).replace("hr",a).replace("heading",` *#{1,6} *[^
|
|
2
|
-
]`).replace("lheading",c).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},S=/^( {2,}|\\)\n(?!\s*$)/,C=/[\p{P}\p{S}]/u,j=/[\s\p{P}\p{S}]/u,R=/[^\s\p{P}\p{S}]/u,T=s(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,j).getRegex(),N=/(?!~)[\p{P}\p{S}]/u,E=s(/link|code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code",/(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),L=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,P=s(L,"u").replace(/punct/g,C).getRegex(),$=s(L,"u").replace(/punct/g,N).getRegex(),A="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",I=s(A,"gu").replace(/notPunctSpace/g,R).replace(/punctSpace/g,j).replace(/punct/g,C).getRegex(),z=s(A,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,N).getRegex(),M=s("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,R).replace(/punctSpace/g,j).replace(/punct/g,C).getRegex(),H=s(/\\(punct)/,"gu").replace(/punct/g,C).getRegex(),_=s(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),D=s(g).replace("(?:-->|$)","-->").getRegex(),q=s("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",D).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),B=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,V=s(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",B).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),F=s(/^!?\[(label)\]\[(ref)\]/).replace("label",B).replace("ref",p).getRegex(),O=s(/^!?\[(ref)\](?:\[\])?/).replace("ref",p).getRegex(),U=s("reflink|nolink(?!\\()","g").replace("reflink",F).replace("nolink",O).getRegex(),Z=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,W={_backpedal:n,anyPunctuation:H,autolink:_,blockSkip:E,br:S,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:n,emStrongLDelim:P,emStrongRDelimAst:I,emStrongRDelimUnd:M,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:V,nolink:O,punctuation:T,reflink:F,reflinkSearch:U,tag:q,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:n},K={...W,link:s(/^!?\[(label)\]\((.*?)\)/).replace("label",B).getRegex(),reflink:s(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B).getRegex()},Q={...W,emStrongRDelimAst:z,emStrongLDelim:$,url:s(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Z).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:s(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Z).getRegex()},G={...Q,br:s(S).replace("{2,}","*").getRegex(),text:s(Q.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},X={normal:b,gfm:w,pedantic:y},Y={normal:W,gfm:Q,breaks:G,pedantic:K},J={"&":"&","<":"<",">":">",'"':""","'":"'"},ee=e=>J[e];function et(e,t){if(t){if(l.escapeTest.test(e))return e.replace(l.escapeReplace,ee)}else if(l.escapeTestNoEncode.test(e))return e.replace(l.escapeReplaceNoEncode,ee);return e}function er(e){try{e=encodeURI(e).replace(l.percentDecode,"%")}catch{return null}return e}function en(e,t){let r=e.replace(l.findPipe,(e,t,r)=>{let n=!1,s=t;for(;--s>=0&&"\\"===r[s];)n=!n;return n?"|":" |"}).split(l.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(l.slashPipe,"|");return r}function es(e,t,r){let n=e.length;if(0===n)return"";let s=0;for(;s<n;){let l=e.charAt(n-s-1);if(l!==t||r)if(l!==t&&r)s++;else break;else s++}return e.slice(0,n-s)}function el(e,t,r,n,s){let l=t.href,a=t.title||null,i=e[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;let o={type:"!"===e[0].charAt(0)?"image":"link",raw:r,href:l,title:a,text:i,tokens:n.inlineTokens(i)};return n.state.inLink=!1,o}var ea=class{options;rules;lexer;constructor(e){this.options=e||r}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:es(e,`
|
|
3
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],r=function(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(null===n)return t;let s=n[1];return t.split(`
|
|
4
|
-
`).map(e=>{let t=e.match(r.other.beginningSpace);if(null===t)return e;let[n]=t;return n.length>=s.length?e.slice(s.length):e}).join(`
|
|
5
|
-
`)}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=es(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:es(t[0],`
|
|
6
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=es(t[0],`
|
|
7
|
-
`).split(`
|
|
8
|
-
`),r="",n="",s=[];for(;e.length>0;){let t=!1,l=[],a;for(a=0;a<e.length;a++)if(this.rules.other.blockquoteStart.test(e[a]))l.push(e[a]),t=!0;else if(t)break;else l.push(e[a]);e=e.slice(a);let i=l.join(`
|
|
9
|
-
`),o=i.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
11
|
-
${i}`:i,n=n?`${n}
|
|
12
|
-
${o}`:o;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,s,!0),this.lexer.state.top=c,0===e.length)break;let u=s.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let t=u.raw+`
|
|
13
|
-
`+e.join(`
|
|
14
|
-
`),l=this.blockquote(t);s[s.length-1]=l,r=r.substring(0,r.length-u.raw.length)+l.raw,n=n.substring(0,n.length-u.text.length)+l.text;break}if(u?.type==="list"){let t=u.raw+`
|
|
15
|
-
`+e.join(`
|
|
16
|
-
`),l=this.list(t);s[s.length-1]=l,r=r.substring(0,r.length-u.raw.length)+l.raw,n=n.substring(0,n.length-u.raw.length)+l.raw,e=t.substring(s.at(-1).raw.length).split(`
|
|
17
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),n=r.length>1,s={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let l=this.rules.other.listItemRegex(r),a=!1;for(;e;){let r=!1,n="",i="";if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;n=t[0],e=e.substring(n.length);let o=t[2].split(`
|
|
18
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split(`
|
|
19
|
-
`,1)[0],u=!o.trim(),d=0;if(this.options.pedantic?(d=2,i=o.trimStart()):u?d=t[1].length+1:(d=(d=t[2].search(this.rules.other.nonSpaceChar))>4?1:d,i=o.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(n+=c+`
|
|
20
|
-
`,e=e.substring(c.length+1),r=!0),!r){let t=this.rules.other.nextBulletRegex(d),r=this.rules.other.hrRegex(d),s=this.rules.other.fencesBeginRegex(d),l=this.rules.other.headingBeginRegex(d),a=this.rules.other.htmlBeginRegex(d);for(;e;){let p=e.split(`
|
|
21
|
-
`,1)[0],h;if(c=p,h=this.options.pedantic?c=c.replace(this.rules.other.listReplaceNesting," "):c.replace(this.rules.other.tabCharGlobal," "),s.test(c)||l.test(c)||a.test(c)||t.test(c)||r.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())i+=`
|
|
22
|
-
`+h.slice(d);else{if(u||o.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||s.test(o)||l.test(o)||r.test(o))break;i+=`
|
|
23
|
-
`+c}u||c.trim()||(u=!0),n+=p+`
|
|
24
|
-
`,e=e.substring(p.length+1),o=h.slice(d)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(n)&&(a=!0));let p=null,h;this.options.gfm&&(p=this.rules.other.listIsTask.exec(i))&&(h="[ ] "!==p[0],i=i.replace(this.rules.other.listReplaceTask,"")),s.items.push({type:"list_item",raw:n,task:!!p,checked:h,loose:!1,text:i,tokens:[]}),s.raw+=n}let i=s.items.at(-1);if(!i)return;i.raw=i.raw.trimEnd(),i.text=i.text.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e<s.items.length;e++)if(this.lexer.state.top=!1,s.items[e].tokens=this.lexer.blockTokens(s.items[e].text,[]),!s.loose){let t=s.items[e].tokens.filter(e=>"space"===e.type);s.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(s.loose)for(let e=0;e<s.items.length;e++)s.items[e].loose=!0;return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=en(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
-
`):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let e of n)this.rules.other.tableAlignRight.test(e)?l.align.push("right"):this.rules.other.tableAlignCenter.test(e)?l.align.push("center"):this.rules.other.tableAlignLeft.test(e)?l.align.push("left"):l.align.push(null);for(let e=0;e<r.length;e++)l.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:l.align[e]});for(let e of s)l.rows.push(en(e,l.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:l.align[t]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
26
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=es(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(")"))return -1;let r=0;for(let t=0;t<e.length;t++)if("\\"===e[t])t++;else if("("===e[t])r++;else if(")"===e[t]&&--r<0)return t;return r>0?-2:-1}(t[2],0);if(-2===e)return;if(e>-1){let r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r.slice(1):r.slice(1,-1)),el(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=t[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return el(r,e,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){let r=[...n[0]].length-1,s,l,a=r,i=0,o="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=o.exec(t));){if(!(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6]))continue;if(l=[...s].length,n[3]||n[4]){a+=l;continue}if((n[5]||n[6])&&r%3&&!((r+l)%3)){i+=l;continue}if((a-=l)>0)continue;l=Math.min(l,l+a+i);let t=[...n[0]][0].length,o=e.slice(0,r+n.index+t+l);if(Math.min(r,l)%2){let e=o.slice(1,-1);return{type:"em",raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}let c=o.slice(2,-2);return{type:"strong",raw:o,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,r;return r="@"===t[2]?"mailto:"+(e=t[1]):e=t[1],{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])r="mailto:"+(e=t[0]);else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0])e=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},ei=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.options.tokenizer=this.options.tokenizer||new ea,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:l,block:X.normal,inline:Y.normal};this.options.pedantic?(t.block=X.pedantic,t.inline=Y.pedantic):this.options.gfm&&(t.block=X.gfm,this.options.breaks?t.inline=Y.breaks:t.inline=Y.gfm),this.tokenizer.rules=t}static get rules(){return{block:X,inline:Y}}static lex(t,r){return new e(r).lex(t)}static lexInline(t,r){return new e(r).inlineTokens(t)}lex(e){e=e.replace(l.carriageReturn,`
|
|
27
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(l.tabCharGlobal," ").replace(l.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let r=t.at(-1);1===n.raw.length&&void 0!==r?r.raw+=`
|
|
28
|
-
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
|
|
29
|
-
`)?"":`
|
|
30
|
-
`)+n.raw,r.text+=`
|
|
31
|
-
`+n.text,this.inlineQueue.at(-1).src=r.text):t.push(n);continue}if((n=this.tokenizer.fences(e))||(n=this.tokenizer.heading(e))||(n=this.tokenizer.hr(e))||(n=this.tokenizer.blockquote(e))||(n=this.tokenizer.list(e))||(n=this.tokenizer.html(e))){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
|
|
32
|
-
`)?"":`
|
|
33
|
-
`)+n.raw,r.text+=`
|
|
34
|
-
`+n.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if((n=this.tokenizer.table(e))||(n=this.tokenizer.lheading(e))){e=e.substring(n.raw.length),t.push(n);continue}let s=e;if(this.options.extensions?.startBlock){let t=1/0,r=e.slice(1),n;this.options.extensions.startBlock.forEach(e=>{"number"==typeof(n=e.call({lexer:this},r))&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){let l=t.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
35
|
-
`)?"":`
|
|
36
|
-
`)+n.raw,l.text+=`
|
|
37
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(n),r=s.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let r=t.at(-1);r?.type==="text"?(r.raw+=(r.raw.endsWith(`
|
|
38
|
-
`)?"":`
|
|
39
|
-
`)+n.raw,r.text+=`
|
|
40
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,n=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(r));)e.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(r));)r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let s=!1,l="";for(;e;){let n;if(s||(l=""),s=!1,this.options.extensions?.inline?.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))continue;if((n=this.tokenizer.escape(e))||(n=this.tokenizer.tag(e))||(n=this.tokenizer.link(e))){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length);let r=t.at(-1);"text"===n.type&&r?.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if((n=this.tokenizer.emStrong(e,r,l))||(n=this.tokenizer.codespan(e))||(n=this.tokenizer.br(e))||(n=this.tokenizer.del(e))||(n=this.tokenizer.autolink(e))||!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}let a=e;if(this.options.extensions?.startInline){let t=1/0,r=e.slice(1),n;this.options.extensions.startInline.forEach(e=>{"number"==typeof(n=e.call({lexer:this},r))&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(a)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(l=n.raw.slice(-1)),s=!0;let r=t.at(-1);r?.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},eo=class{options;parser;constructor(e){this.options=e||r}space(e){return""}code({text:e,lang:t,escaped:r}){let n=(t||"").match(l.notSpaceStart)?.[0],s=e.replace(l.endingNewline,"")+`
|
|
41
|
-
`;return n?'<pre><code class="language-'+et(n)+'">'+(r?s:et(s,!0))+`</code></pre>
|
|
42
|
-
`:"<pre><code>"+(r?s:et(s,!0))+`</code></pre>
|
|
43
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
44
|
-
${this.parser.parse(e)}</blockquote>
|
|
45
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
46
|
-
`}hr(e){return`<hr>
|
|
47
|
-
`}list(e){let t=e.ordered,r=e.start,n="";for(let t=0;t<e.items.length;t++){let r=e.items[t];n+=this.listitem(r)}let s=t?"ol":"ul";return"<"+s+(t&&1!==r?' start="'+r+'"':"")+`>
|
|
48
|
-
`+n+"</"+s+`>
|
|
49
|
-
`}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+et(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
50
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
51
|
-
`}table(e){let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.tablecell(e.header[t]);t+=this.tablerow({text:r});let n="";for(let t=0;t<e.rows.length;t++){let s=e.rows[t];r="";for(let e=0;e<s.length;e++)r+=this.tablecell(s[e]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
52
|
-
<thead>
|
|
53
|
-
`+t+`</thead>
|
|
54
|
-
`+n+`</table>
|
|
55
|
-
`}tablerow({text:e}){return`<tr>
|
|
56
|
-
${e}</tr>
|
|
57
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
|
58
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${et(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=er(e);if(null===s)return n;let l='<a href="'+(e=s)+'"';return t&&(l+=' title="'+et(t)+'"'),l+=">"+n+"</a>"}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let s=er(e);if(null===s)return et(r);e=s;let l=`<img src="${e}" alt="${r}"`;return t&&(l+=` title="${et(t)}"`),l+=">"}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:et(e.text)}},ec=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},eu=class e{options;renderer;textRenderer;constructor(e){this.options=e||r,this.options.renderer=this.options.renderer||new eo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ec}static parse(t,r){return new e(r).parse(t)}static parseInline(t,r){return new e(r).parseInline(t)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){r+=e||"";continue}}switch(s.type){case"space":r+=this.renderer.space(s);continue;case"hr":r+=this.renderer.hr(s);continue;case"heading":r+=this.renderer.heading(s);continue;case"code":r+=this.renderer.code(s);continue;case"table":r+=this.renderer.table(s);continue;case"blockquote":r+=this.renderer.blockquote(s);continue;case"list":r+=this.renderer.list(s);continue;case"html":r+=this.renderer.html(s);continue;case"def":r+=this.renderer.def(s);continue;case"paragraph":r+=this.renderer.paragraph(s);continue;case"text":{let l=s,a=this.renderer.text(l);for(;n+1<e.length&&"text"===e[n+1].type;)l=e[++n],a+=`
|
|
59
|
-
`+this.renderer.text(l);t?r+=this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a,escaped:!0}]}):r+=a;continue}default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}parseInline(e,t=this.renderer){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=e||"";continue}}switch(s.type){case"escape":case"text":r+=t.text(s);break;case"html":r+=t.html(s);break;case"link":r+=t.link(s);break;case"image":r+=t.image(s);break;case"strong":r+=t.strong(s);break;case"em":r+=t.em(s);break;case"codespan":r+=t.codespan(s);break;case"br":r+=t.br(s);break;case"del":r+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}},ed=class{options;block;constructor(e){this.options=e||r}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?ei.lex:ei.lexInline}provideParser(){return this.block?eu.parse:eu.parseInline}},ep=new class{defaults=t();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=eu;Renderer=eo;TextRenderer=ec;Lexer=ei;Tokenizer=ea;Hooks=ed;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":for(let e of n.header)r=r.concat(this.walkTokens(e.tokens,t));for(let e of n.rows)for(let n of e)r=r.concat(this.walkTokens(n.tokens,t));break;case"list":r=r.concat(this.walkTokens(n.items,t));break;default:{let e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{let s=e[n].flat(1/0);r=r.concat(this.walkTokens(s,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let r=t.renderers[e.name];r?t.renderers[e.name]=function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){let t=this.defaults.renderer||new eo(this.defaults);for(let r in e.renderer){if(!(r in t))throw Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let n=e.renderer[r],s=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=s.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ea(this.defaults);for(let r in e.tokenizer){if(!(r in t))throw Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let n=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=s.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ed;for(let r in e.hooks){if(!(r in t))throw Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let n=e.hooks[r],s=t[r];ed.passThroughHooks.has(r)?t[r]=e=>{if(this.defaults.async&&ed.passThroughHooksRespectAsync.has(r))return(async()=>{let r=await n.call(t,e);return s.call(t,r)})();let l=n.call(t,e);return s.call(t,l)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let r=await n.apply(t,e);return!1===r&&(r=await s.apply(t,e)),r})();let r=n.apply(t,e);return!1===r&&(r=s.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ei.lex(e,t??this.defaults)}parser(e,t){return eu.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},s={...this.defaults,...n},l=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===n.async)return l(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return l(Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return l(Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let r=s.hooks?await s.hooks.preprocess(t):t,n=await (s.hooks?await s.hooks.provideLexer():e?ei.lex:ei.lexInline)(r,s),l=s.hooks?await s.hooks.processAllTokens(n):n;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let a=await (s.hooks?await s.hooks.provideParser():e?eu.parse:eu.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(a):a})().catch(l);try{s.hooks&&(t=s.hooks.preprocess(t));let r=(s.hooks?s.hooks.provideLexer():e?ei.lex:ei.lexInline)(t,s);s.hooks&&(r=s.hooks.processAllTokens(r)),s.walkTokens&&this.walkTokens(r,s.walkTokens);let n=(s.hooks?s.hooks.provideParser():e?eu.parse:eu.parseInline)(r,s);return s.hooks&&(n=s.hooks.postprocess(n)),n}catch(e){return l(e)}}}onError(e,t){return r=>{if(r.message+=`
|
|
60
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error occurred:</p><pre>"+et(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function eh(e,t){return ep.parse(e,t)}eh.options=eh.setOptions=function(e){return ep.setOptions(e),eh.defaults=ep.defaults,r=eh.defaults,eh},eh.getDefaults=t,eh.defaults=r,eh.use=function(...e){return ep.use(...e),eh.defaults=ep.defaults,r=eh.defaults,eh},eh.walkTokens=function(e,t){return ep.walkTokens(e,t)},eh.parseInline=ep.parseInline,eh.Parser=eu,eh.parser=eu.parse,eh.Renderer=eo,eh.TextRenderer=ec,eh.Lexer=ei,eh.lexer=ei.lex,eh.Tokenizer=ea,eh.Hooks=ed,eh.parse=eh,eh.options,eh.setOptions,eh.use,eh.walkTokens,eh.parseInline,eu.parse,ei.lex,e.s(["Lexer",()=>ei,"marked",()=>eh])},170349,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},809737,e=>{e.v("/_next/static/media/worker.e575ad4f.js")},346131,345594,376268,e=>{"use strict";let t;var r=e.i(666426),n=e.i(686107),s=e.i(571577);function l(e,[t,r]){return Math.min(r,Math.max(t,e))}var a=e.i(291967),i=e.i(177779),o=e.i(221588),c=e.i(810096),u=e.i(92581),d=e.i(975287),p=0;function h(){n.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??f()),document.body.insertAdjacentElement("beforeend",e[1]??f()),p++,()=>{1===p&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),p--}},[])}function f(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}e.s(["useFocusGuards",()=>h],345594);var m=e.i(692792),g=e.i(852947),x="focusScope.autoFocusOnMount",k="focusScope.autoFocusOnUnmount",b={bubbles:!1,cancelable:!0},v=n.forwardRef((e,t)=>{let{loop:s=!1,trapped:l=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...c}=e,[u,d]=n.useState(null),p=(0,g.useCallbackRef)(a),h=(0,g.useCallbackRef)(i),f=n.useRef(null),v=(0,o.useComposedRefs)(t,e=>d(e)),j=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect(()=>{if(l){let e=function(e){if(j.paused||!u)return;let t=e.target;u.contains(t)?f.current=t:S(f.current,{select:!0})},t=function(e){if(j.paused||!u)return;let t=e.relatedTarget;null!==t&&(u.contains(t)||S(f.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&S(u)});return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[l,u,j.paused]),n.useEffect(()=>{if(u){C.add(j);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(x,b);u.addEventListener(x,p),u.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(S(n,{select:t}),document.activeElement!==r)return}(w(u).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&S(u))}return()=>{u.removeEventListener(x,p),setTimeout(()=>{let t=new CustomEvent(k,b);u.addEventListener(k,h),u.dispatchEvent(t),t.defaultPrevented||S(e??document.body,{select:!0}),u.removeEventListener(k,h),C.remove(j)},0)}}},[u,p,h,j]);let R=n.useCallback(e=>{if(!s&&!l||j.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){var n;let t,l=e.currentTarget,[a,i]=[y(t=w(n=l),n),y(t.reverse(),n)];a&&i?e.shiftKey||r!==i?e.shiftKey&&r===a&&(e.preventDefault(),s&&S(i,{select:!0})):(e.preventDefault(),s&&S(a,{select:!0})):r===l&&e.preventDefault()}},[s,l,j.paused]);return(0,r.jsx)(m.Primitive.div,{tabIndex:-1,...c,ref:v,onKeyDown:R})});function w(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function y(e,t){for(let r of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function S(e,{select:t=!1}={}){if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}v.displayName="FocusScope";var C=(t=[],{add(e){let r=t[0];e!==r&&r?.pause(),(t=j(t,e)).unshift(e)},remove(e){t=j(t,e),t[0]?.resume()}});function j(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}e.s(["FocusScope",()=>v],376268);var R=e.i(244107),T=e.i(509377),N=e.i(153840),E=e.i(545136),L=e.i(802313),P=e.i(225088),$=e.i(962687),A=e.i(73772),I=e.i(891246),z=[" ","Enter","ArrowUp","ArrowDown"],M=[" ","Enter"],H="Select",[_,D,q]=(0,i.createCollection)(H),[B,V]=(0,c.createContextScope)(H,[q,T.createPopperScope]),F=(0,T.createPopperScope)(),[O,U]=B(H),[Z,W]=B(H),K=e=>{let{__scopeSelect:t,children:s,open:l,defaultOpen:a,onOpenChange:i,value:o,defaultValue:c,onValueChange:d,dir:p,name:h,autoComplete:f,disabled:m,required:g,form:x}=e,k=F(t),[b,v]=n.useState(null),[w,y]=n.useState(null),[S,C]=n.useState(!1),j=(0,u.useDirection)(p),[N,E]=(0,L.useControllableState)({prop:l,defaultProp:a??!1,onChange:i,caller:H}),[P,$]=(0,L.useControllableState)({prop:o,defaultProp:c,onChange:d,caller:H}),A=n.useRef(null),I=!b||x||!!b.closest("form"),[z,M]=n.useState(new Set),D=Array.from(z).map(e=>e.props.value).join(";");return(0,r.jsx)(T.Root,{...k,children:(0,r.jsxs)(O,{required:g,scope:t,trigger:b,onTriggerChange:v,valueNode:w,onValueNodeChange:y,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:(0,R.useId)(),value:P,onValueChange:$,open:N,onOpenChange:E,dir:j,triggerPointerDownPosRef:A,disabled:m,children:[(0,r.jsx)(_.Provider,{scope:t,children:(0,r.jsx)(Z,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:n.useCallback(e=>{M(t=>{let r=new Set(t);return r.delete(e),r})},[]),children:s})}),I?(0,r.jsxs)(eA,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:f,value:P,onChange:e=>$(e.target.value),disabled:m,form:x,children:[void 0===P?(0,r.jsx)("option",{value:""}):null,Array.from(z)]},D):null]})})};K.displayName=H;var Q="SelectTrigger",G=n.forwardRef((e,t)=>{let{__scopeSelect:s,disabled:l=!1,...i}=e,c=F(s),u=U(Q,s),d=u.disabled||l,p=(0,o.useComposedRefs)(t,u.onTriggerChange),h=D(s),f=n.useRef("touch"),[g,x,k]=ez(e=>{let t=h().filter(e=>!e.disabled),r=t.find(e=>e.value===u.value),n=eM(t,e,r);void 0!==n&&u.onValueChange(n.value)}),b=e=>{d||(u.onOpenChange(!0),k()),e&&(u.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,r.jsx)(T.Anchor,{asChild:!0,...c,children:(0,r.jsx)(m.Primitive.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":eI(u.value)?"":void 0,...i,ref:p,onClick:(0,a.composeEventHandlers)(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&b(e)}),onPointerDown:(0,a.composeEventHandlers)(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(b(e),e.preventDefault())}),onKeyDown:(0,a.composeEventHandlers)(i.onKeyDown,e=>{let t=""!==g.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||x(e.key),(!t||" "!==e.key)&&z.includes(e.key)&&(b(),e.preventDefault())})})})});G.displayName=Q;var X="SelectValue",Y=n.forwardRef((e,t)=>{let{__scopeSelect:n,className:s,style:l,children:a,placeholder:i="",...c}=e,u=U(X,n),{onValueNodeHasChildrenChange:d}=u,p=void 0!==a,h=(0,o.useComposedRefs)(t,u.onValueNodeChange);return(0,P.useLayoutEffect)(()=>{d(p)},[d,p]),(0,r.jsx)(m.Primitive.span,{...c,ref:h,style:{pointerEvents:"none"},children:eI(u.value)?(0,r.jsx)(r.Fragment,{children:i}):a})});Y.displayName=X;var J=n.forwardRef((e,t)=>{let{__scopeSelect:n,children:s,...l}=e;return(0,r.jsx)(m.Primitive.span,{"aria-hidden":!0,...l,ref:t,children:s||"▼"})});J.displayName="SelectIcon";var ee=e=>(0,r.jsx)(N.Portal,{asChild:!0,...e});ee.displayName="SelectPortal";var et="SelectContent",er=n.forwardRef((e,t)=>{let l=U(et,e.__scopeSelect),[a,i]=n.useState();return((0,P.useLayoutEffect)(()=>{i(new DocumentFragment)},[]),l.open)?(0,r.jsx)(ea,{...e,ref:t}):a?s.createPortal((0,r.jsx)(en,{scope:e.__scopeSelect,children:(0,r.jsx)(_.Slot,{scope:e.__scopeSelect,children:(0,r.jsx)("div",{children:e.children})})}),a):null});er.displayName=et;var[en,es]=B(et),el=(0,E.createSlot)("SelectContent.RemoveScroll"),ea=n.forwardRef((e,t)=>{let{__scopeSelect:s,position:l="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:c,onPointerDownOutside:u,side:p,sideOffset:f,align:m,alignOffset:g,arrowPadding:x,collisionBoundary:k,collisionPadding:b,sticky:w,hideWhenDetached:y,avoidCollisions:S,...C}=e,j=U(et,s),[R,T]=n.useState(null),[N,E]=n.useState(null),L=(0,o.useComposedRefs)(t,e=>T(e)),[P,$]=n.useState(null),[z,M]=n.useState(null),H=D(s),[_,q]=n.useState(!1),B=n.useRef(!1);n.useEffect(()=>{if(R)return(0,A.hideOthers)(R)},[R]),h();let V=n.useCallback(e=>{let[t,...r]=H().map(e=>e.ref.current),[n]=r.slice(-1),s=document.activeElement;for(let r of e)if(r===s||(r?.scrollIntoView({block:"nearest"}),r===t&&N&&(N.scrollTop=0),r===n&&N&&(N.scrollTop=N.scrollHeight),r?.focus(),document.activeElement!==s))return},[H,N]),F=n.useCallback(()=>V([P,R]),[V,P,R]);n.useEffect(()=>{_&&F()},[_,F]);let{onOpenChange:O,triggerPointerDownPosRef:Z}=j;n.useEffect(()=>{if(R){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(Z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(Z.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():R.contains(r.target)||O(!1),document.removeEventListener("pointermove",t),Z.current=null};return null!==Z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[R,O,Z]),n.useEffect(()=>{let e=()=>O(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[O]);let[W,K]=ez(e=>{let t=H().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=eM(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),Q=n.useCallback((e,t,r)=>{let n=!B.current&&!r;(void 0!==j.value&&j.value===t||n)&&($(e),n&&(B.current=!0))},[j.value]),G=n.useCallback(()=>R?.focus(),[R]),X=n.useCallback((e,t,r)=>{let n=!B.current&&!r;(void 0!==j.value&&j.value===t||n)&&M(e)},[j.value]),Y="popper"===l?eo:ei,J=Y===eo?{side:p,sideOffset:f,align:m,alignOffset:g,arrowPadding:x,collisionBoundary:k,collisionPadding:b,sticky:w,hideWhenDetached:y,avoidCollisions:S}:{};return(0,r.jsx)(en,{scope:s,content:R,viewport:N,onViewportChange:E,itemRefCallback:Q,selectedItem:P,onItemLeave:G,itemTextRefCallback:X,focusSelectedItem:F,selectedItemText:z,position:l,isPositioned:_,searchRef:W,children:(0,r.jsx)(I.RemoveScroll,{as:el,allowPinchZoom:!0,children:(0,r.jsx)(v,{asChild:!0,trapped:j.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,a.composeEventHandlers)(i,e=>{j.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,r.jsx)(d.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:(0,r.jsx)(Y,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:e=>e.preventDefault(),...C,...J,onPlaced:()=>q(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:(0,a.composeEventHandlers)(C.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||K(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=H().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>V(t)),e.preventDefault()}})})})})})})});ea.displayName="SelectContentImpl";var ei=n.forwardRef((e,t)=>{let{__scopeSelect:s,onPlaced:a,...i}=e,c=U(et,s),u=es(et,s),[d,p]=n.useState(null),[h,f]=n.useState(null),g=(0,o.useComposedRefs)(t,e=>f(e)),x=D(s),k=n.useRef(!1),b=n.useRef(!0),{viewport:v,selectedItem:w,selectedItemText:y,focusSelectedItem:S}=u,C=n.useCallback(()=>{if(c.trigger&&c.valueNode&&d&&h&&v&&w&&y){let e=c.trigger.getBoundingClientRect(),t=h.getBoundingClientRect(),r=c.valueNode.getBoundingClientRect(),n=y.getBoundingClientRect();if("rtl"!==c.dir){let s=n.left-t.left,a=r.left-s,i=e.left-a,o=e.width+i,c=Math.max(o,t.width),u=l(a,[10,Math.max(10,window.innerWidth-10-c)]);d.style.minWidth=o+"px",d.style.left=u+"px"}else{let s=t.right-n.right,a=window.innerWidth-r.right-s,i=window.innerWidth-e.right-a,o=e.width+i,c=Math.max(o,t.width),u=l(a,[10,Math.max(10,window.innerWidth-10-c)]);d.style.minWidth=o+"px",d.style.right=u+"px"}let s=x(),i=window.innerHeight-20,o=v.scrollHeight,u=window.getComputedStyle(h),p=parseInt(u.borderTopWidth,10),f=parseInt(u.paddingTop,10),m=parseInt(u.borderBottomWidth,10),g=p+f+o+parseInt(u.paddingBottom,10)+m,b=Math.min(5*w.offsetHeight,g),S=window.getComputedStyle(v),C=parseInt(S.paddingTop,10),j=parseInt(S.paddingBottom,10),R=e.top+e.height/2-10,T=w.offsetHeight/2,N=p+f+(w.offsetTop+T);if(N<=R){let e=s.length>0&&w===s[s.length-1].ref.current;d.style.bottom="0px";let t=Math.max(i-R,T+(e?j:0)+(h.clientHeight-v.offsetTop-v.offsetHeight)+m);d.style.height=N+t+"px"}else{let e=s.length>0&&w===s[0].ref.current;d.style.top="0px";let t=Math.max(R,p+v.offsetTop+(e?C:0)+T);d.style.height=t+(g-N)+"px",v.scrollTop=N-R+v.offsetTop}d.style.margin="10px 0",d.style.minHeight=b+"px",d.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>k.current=!0)}},[x,c.trigger,c.valueNode,d,h,v,w,y,c.dir,a]);(0,P.useLayoutEffect)(()=>C(),[C]);let[j,R]=n.useState();(0,P.useLayoutEffect)(()=>{h&&R(window.getComputedStyle(h).zIndex)},[h]);let T=n.useCallback(e=>{e&&!0===b.current&&(C(),S?.(),b.current=!1)},[C,S]);return(0,r.jsx)(ec,{scope:s,contentWrapper:d,shouldExpandOnScrollRef:k,onScrollButtonChange:T,children:(0,r.jsx)("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:(0,r.jsx)(m.Primitive.div,{...i,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});ei.displayName="SelectItemAlignedPosition";var eo=n.forwardRef((e,t)=>{let{__scopeSelect:n,align:s="start",collisionPadding:l=10,...a}=e,i=F(n);return(0,r.jsx)(T.Content,{...i,...a,ref:t,align:s,collisionPadding:l,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});eo.displayName="SelectPopperPosition";var[ec,eu]=B(et,{}),ed="SelectViewport",ep=n.forwardRef((e,t)=>{let{__scopeSelect:s,nonce:l,...i}=e,c=es(ed,s),u=eu(ed,s),d=(0,o.useComposedRefs)(t,c.onViewportChange),p=n.useRef(0);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),(0,r.jsx)(_.Slot,{scope:s,children:(0,r.jsx)(m.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:(0,a.composeEventHandlers)(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=u;if(n?.current&&r){let e=Math.abs(p.current-t.scrollTop);if(e>0){let n=window.innerHeight-20,s=Math.max(parseFloat(r.style.minHeight),parseFloat(r.style.height));if(s<n){let l=s+e,a=Math.min(n,l),i=l-a;r.style.height=a+"px","0px"===r.style.bottom&&(t.scrollTop=i>0?i:0,r.style.justifyContent="flex-end")}}}p.current=t.scrollTop})})})]})});ep.displayName=ed;var eh="SelectGroup",[ef,em]=B(eh);n.forwardRef((e,t)=>{let{__scopeSelect:n,...s}=e,l=(0,R.useId)();return(0,r.jsx)(ef,{scope:n,id:l,children:(0,r.jsx)(m.Primitive.div,{role:"group","aria-labelledby":l,...s,ref:t})})}).displayName=eh;var eg="SelectLabel",ex=n.forwardRef((e,t)=>{let{__scopeSelect:n,...s}=e,l=em(eg,n);return(0,r.jsx)(m.Primitive.div,{id:l.id,...s,ref:t})});ex.displayName=eg;var ek="SelectItem",[eb,ev]=B(ek),ew=n.forwardRef((e,t)=>{let{__scopeSelect:s,value:l,disabled:i=!1,textValue:c,...u}=e,d=U(ek,s),p=es(ek,s),h=d.value===l,[f,g]=n.useState(c??""),[x,k]=n.useState(!1),b=(0,o.useComposedRefs)(t,e=>p.itemRefCallback?.(e,l,i)),v=(0,R.useId)(),w=n.useRef("touch"),y=()=>{i||(d.onValueChange(l),d.onOpenChange(!1))};if(""===l)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,r.jsx)(eb,{scope:s,value:l,disabled:i,textId:v,isSelected:h,onItemTextChange:n.useCallback(e=>{g(t=>t||(e?.textContent??"").trim())},[]),children:(0,r.jsx)(_.ItemSlot,{scope:s,value:l,disabled:i,textValue:f,children:(0,r.jsx)(m.Primitive.div,{role:"option","aria-labelledby":v,"data-highlighted":x?"":void 0,"aria-selected":h&&x,"data-state":h?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:b,onFocus:(0,a.composeEventHandlers)(u.onFocus,()=>k(!0)),onBlur:(0,a.composeEventHandlers)(u.onBlur,()=>k(!1)),onClick:(0,a.composeEventHandlers)(u.onClick,()=>{"mouse"!==w.current&&y()}),onPointerUp:(0,a.composeEventHandlers)(u.onPointerUp,()=>{"mouse"===w.current&&y()}),onPointerDown:(0,a.composeEventHandlers)(u.onPointerDown,e=>{w.current=e.pointerType}),onPointerMove:(0,a.composeEventHandlers)(u.onPointerMove,e=>{w.current=e.pointerType,i?p.onItemLeave?.():"mouse"===w.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,a.composeEventHandlers)(u.onPointerLeave,e=>{e.currentTarget===document.activeElement&&p.onItemLeave?.()}),onKeyDown:(0,a.composeEventHandlers)(u.onKeyDown,e=>{(p.searchRef?.current===""||" "!==e.key)&&(M.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});ew.displayName=ek;var ey="SelectItemText",eS=n.forwardRef((e,t)=>{let{__scopeSelect:l,className:a,style:i,...c}=e,u=U(ey,l),d=es(ey,l),p=ev(ey,l),h=W(ey,l),[f,g]=n.useState(null),x=(0,o.useComposedRefs)(t,e=>g(e),p.onItemTextChange,e=>d.itemTextRefCallback?.(e,p.value,p.disabled)),k=f?.textContent,b=n.useMemo(()=>(0,r.jsx)("option",{value:p.value,disabled:p.disabled,children:k},p.value),[p.disabled,p.value,k]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=h;return(0,P.useLayoutEffect)(()=>(v(b),()=>w(b)),[v,w,b]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.Primitive.span,{id:p.textId,...c,ref:x}),p.isSelected&&u.valueNode&&!u.valueNodeHasChildren?s.createPortal(c.children,u.valueNode):null]})});eS.displayName=ey;var eC="SelectItemIndicator",ej=n.forwardRef((e,t)=>{let{__scopeSelect:n,...s}=e;return ev(eC,n).isSelected?(0,r.jsx)(m.Primitive.span,{"aria-hidden":!0,...s,ref:t}):null});ej.displayName=eC;var eR="SelectScrollUpButton",eT=n.forwardRef((e,t)=>{let s=es(eR,e.__scopeSelect),l=eu(eR,e.__scopeSelect),[a,i]=n.useState(!1),c=(0,o.useComposedRefs)(t,l.onScrollButtonChange);return(0,P.useLayoutEffect)(()=>{if(s.viewport&&s.isPositioned){let e=function(){i(t.scrollTop>0)},t=s.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[s.viewport,s.isPositioned]),a?(0,r.jsx)(eL,{...e,ref:c,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=s;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});eT.displayName=eR;var eN="SelectScrollDownButton",eE=n.forwardRef((e,t)=>{let s=es(eN,e.__scopeSelect),l=eu(eN,e.__scopeSelect),[a,i]=n.useState(!1),c=(0,o.useComposedRefs)(t,l.onScrollButtonChange);return(0,P.useLayoutEffect)(()=>{if(s.viewport&&s.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;i(Math.ceil(t.scrollTop)<e)},t=s.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[s.viewport,s.isPositioned]),a?(0,r.jsx)(eL,{...e,ref:c,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=s;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});eE.displayName=eN;var eL=n.forwardRef((e,t)=>{let{__scopeSelect:s,onAutoScroll:l,...i}=e,o=es("SelectScrollButton",s),c=n.useRef(null),u=D(s),d=n.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return n.useEffect(()=>()=>d(),[d]),(0,P.useLayoutEffect)(()=>{let e=u().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[u]),(0,r.jsx)(m.Primitive.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:(0,a.composeEventHandlers)(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(l,50))}),onPointerMove:(0,a.composeEventHandlers)(i.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(l,50))}),onPointerLeave:(0,a.composeEventHandlers)(i.onPointerLeave,()=>{d()})})}),eP=n.forwardRef((e,t)=>{let{__scopeSelect:n,...s}=e;return(0,r.jsx)(m.Primitive.div,{"aria-hidden":!0,...s,ref:t})});eP.displayName="SelectSeparator";var e$="SelectArrow";n.forwardRef((e,t)=>{let{__scopeSelect:n,...s}=e,l=F(n),a=U(e$,n),i=es(e$,n);return a.open&&"popper"===i.position?(0,r.jsx)(T.Arrow,{...l,...s,ref:t}):null}).displayName=e$;var eA=n.forwardRef(({__scopeSelect:e,value:t,...s},l)=>{let a,i=n.useRef(null),c=(0,o.useComposedRefs)(l,i),u=(a=n.useRef({value:t,previous:t}),n.useMemo(()=>(a.current.value!==t&&(a.current.previous=a.current.value,a.current.value=t),a.current.previous),[t]));return n.useEffect(()=>{let e=i.current;if(!e)return;let r=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(u!==t&&r){let n=new Event("change",{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[u,t]),(0,r.jsx)(m.Primitive.select,{...s,style:{...$.VISUALLY_HIDDEN_STYLES,...s.style},ref:c,defaultValue:t})});function eI(e){return""===e||void 0===e}function ez(e){let t=(0,g.useCallbackRef)(e),r=n.useRef(""),s=n.useRef(0),l=n.useCallback(e=>{let n=r.current+e;t(n),function e(t){r.current=t,window.clearTimeout(s.current),""!==t&&(s.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),a=n.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,l,a]}function eM(e,t,r){var n,s;let l=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1,i=(n=e,s=Math.max(a,0),n.map((e,t)=>n[(s+t)%n.length]));1===l.length&&(i=i.filter(e=>e!==r));let o=i.find(e=>e.textValue.toLowerCase().startsWith(l.toLowerCase()));return o!==r?o:void 0}eA.displayName="SelectBubbleInput";var eH=e.i(613671),e_=e.i(886288);let eD=(0,e_.default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),eq=(0,e_.default)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var eB=e.i(949245);let eV=n.forwardRef(({className:e,children:t,...n},s)=>(0,r.jsxs)(G,{ref:s,className:(0,eB.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,(0,r.jsx)(J,{asChild:!0,children:(0,r.jsx)(eD,{className:"h-4 w-4 opacity-50"})})]}));eV.displayName=G.displayName;let eF=n.forwardRef(({className:e,...t},n)=>(0,r.jsx)(eT,{ref:n,className:(0,eB.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,r.jsx)(eq,{className:"h-4 w-4"})}));eF.displayName=eT.displayName;let eO=n.forwardRef(({className:e,...t},n)=>(0,r.jsx)(eE,{ref:n,className:(0,eB.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,r.jsx)(eD,{className:"h-4 w-4"})}));eO.displayName=eE.displayName;let eU=n.forwardRef(({className:e,children:t,position:n="popper",...s},l)=>(0,r.jsx)(ee,{children:(0,r.jsxs)(er,{ref:l,className:(0,eB.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[(0,r.jsx)(eF,{}),(0,r.jsx)(ep,{className:(0,eB.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),(0,r.jsx)(eO,{})]})}));eU.displayName=er.displayName,n.forwardRef(({className:e,...t},n)=>(0,r.jsx)(ex,{ref:n,className:(0,eB.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t})).displayName=ex.displayName;let eZ=n.forwardRef(({className:e,children:t,...n},s)=>(0,r.jsxs)(ew,{ref:s,className:(0,eB.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(ej,{children:(0,r.jsx)(eH.Check,{className:"h-4 w-4"})})}),(0,r.jsx)(eS,{children:t})]}));eZ.displayName=ew.displayName,n.forwardRef(({className:e,...t},n)=>(0,r.jsx)(eP,{ref:n,className:(0,eB.cn)("-mx-1 my-1 h-px bg-muted",e),...t})).displayName=eP.displayName,e.s(["Select",()=>K,"SelectContent",()=>eU,"SelectItem",()=>eZ,"SelectTrigger",()=>eV,"SelectValue",()=>Y],346131)},693144,e=>{"use strict";var t=e.i(349011),r=e.i(610062);function n(){(0,t.c)("[nuqs] Aborting queues"),r.t.abortAll(),r.n.abort().forEach(e=>r.t.queuedQuerySync.emit(e))}var s=e.i(686107),l=e.i(868924);let a=0;function i(){a=0,n()}function o(){--a<=0&&(a=0,queueMicrotask(n))}function c(){return(0,s.useEffect)(()=>(!function(){var e;if(e="next/app","undefined"==typeof history||(history.nuqs?.version&&"2.8.3"!==history.nuqs.version?(console.error((0,t.s)(409),history.nuqs.version,"2.8.3",e),!0):!!history.nuqs?.adapters?.includes(e)))return;let r=history.replaceState,n=history.pushState;history.replaceState=function(e,t,n){return o(),r.call(history,e,t,n)},history.pushState=function(e,t,r){return o(),n.call(history,e,t,r)},history.nuqs=history.nuqs??{version:"2.8.3",adapters:[]},history.nuqs.adapters.push("next/app")}(),window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)),[]),null}let u=(0,t.n)(function(){let e=(0,l.useRouter)(),[r,n]=(0,s.useOptimistic)((0,l.useSearchParams)());return{searchParams:r,updateUrl:(0,s.useCallback)((r,l)=>{(0,s.startTransition)(()=>{l.shallow||n(r);let s=function(e){let{origin:r,pathname:n,hash:s}=location;return r+n+(0,t.o)(e)+s}(r);(0,t.c)("[nuqs next/app] Updating url: %s",s);let i="push"===l.history?history.pushState:history.replaceState;a=3,i.call(history,null,"",s),l.scroll&&window.scrollTo(0,0),l.shallow||e.replace(s,{scroll:!1})})},[]),rateLimitFactor:3,autoResetQueueOnUpdate:!1}});function d({children:e,...t}){return(0,s.createElement)(u,{...t,children:[(0,s.createElement)(s.Suspense,{key:"nuqs-adapter-suspense-navspy",children:(0,s.createElement)(c)}),e]})}e.s(["NuqsAdapter",()=>d],693144)},608576,e=>{"use strict";var t=e.i(666426),r=e.i(912738),n=e.i(414576),s=e.i(868924),l=e.i(686107),a=(e,t,r,n,s,l,a,i)=>{let o=document.documentElement,c=["light","dark"];function u(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,n=r&&l?s.map(e=>l[e]||e):s;r?(o.classList.remove(...n),o.classList.add(l&&l[t]?l[t]:t)):o.setAttribute(e,t)}),r=t,i&&c.includes(r)&&(o.style.colorScheme=r)}if(n)u(n);else try{let e=localStorage.getItem(t)||r,n=a&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;u(n)}catch(e){}},i=["light","dark"],o="(prefers-color-scheme: dark)",c="undefined"==typeof window,u=l.createContext(void 0),d={setTheme:e=>{},themes:[]},p=()=>{var e;return null!=(e=l.useContext(u))?e:d},h=e=>l.useContext(u)?l.createElement(l.Fragment,null,e.children):l.createElement(m,{...e}),f=["light","dark"],m=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:n=!0,storageKey:s="theme",themes:a=f,defaultTheme:c=r?"system":"light",attribute:d="data-theme",value:p,children:h,nonce:m,scriptProps:v})=>{let[w,y]=l.useState(()=>x(s,c)),[S,C]=l.useState(()=>"system"===w?b():w),j=p?Object.values(p):a,R=l.useCallback(e=>{let s=e;if(!s)return;"system"===e&&r&&(s=b());let l=p?p[s]:s,a=t?k(m):null,o=document.documentElement,u=e=>{"class"===e?(o.classList.remove(...j),l&&o.classList.add(l)):e.startsWith("data-")&&(l?o.setAttribute(e,l):o.removeAttribute(e))};if(Array.isArray(d)?d.forEach(u):u(d),n){let e=i.includes(c)?c:null,t=i.includes(s)?s:e;o.style.colorScheme=t}null==a||a()},[m]),T=l.useCallback(e=>{let t="function"==typeof e?e(w):e;y(t);try{localStorage.setItem(s,t)}catch(e){}},[w]),N=l.useCallback(t=>{C(b(t)),"system"===w&&r&&!e&&R("system")},[w,e]);l.useEffect(()=>{let e=window.matchMedia(o);return e.addListener(N),N(e),()=>e.removeListener(N)},[N]),l.useEffect(()=>{let e=e=>{e.key===s&&(e.newValue?y(e.newValue):T(c))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[T]),l.useEffect(()=>{R(null!=e?e:w)},[e,w]);let E=l.useMemo(()=>({theme:w,setTheme:T,forcedTheme:e,resolvedTheme:"system"===w?S:w,themes:r?[...a,"system"]:a,systemTheme:r?S:void 0}),[w,T,e,S,r,a]);return l.createElement(u.Provider,{value:E},l.createElement(g,{forcedTheme:e,storageKey:s,attribute:d,enableSystem:r,enableColorScheme:n,defaultTheme:c,value:p,themes:a,nonce:m,scriptProps:v}),h)},g=l.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:i,value:o,themes:c,nonce:u,scriptProps:d})=>{let p=JSON.stringify([r,t,i,e,c,o,n,s]).slice(1,-1);return l.createElement("script",{...d,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?u:"",dangerouslySetInnerHTML:{__html:`(${a.toString()})(${p})`}})}),x=(e,t)=>{let r;if(!c){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},k=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},b=e=>(e||(e=window.matchMedia(o)),e.matches?"dark":"light"),v=e.i(886288);let w=(0,v.default)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var y=e.i(638322);function S({config:e}){let{provider:r,parts:n}=((e,t)=>{if("vercel"===e){let e=[];return t.env&&e.push(`env: ${t.env}`),t.project&&e.push(`project: ${t.project}`),t.team&&e.push(`team: ${t.team}`),{provider:"Vercel",parts:e}}if("local"===e){let e=[];return t.dataDir&&e.push(`dir: ${t.dataDir}`),t.port&&e.push(`port: ${t.port}`),{provider:"Local",parts:e}}return{provider:t.backend||"unknown",parts:[]}})(e.backend||"local",e);return(0,t.jsxs)("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"font-medium",children:["Connected to: ",r]}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(w,{className:"w-4 h-4"})}),(0,t.jsx)(y.TooltipContent,{children:(0,t.jsx)("div",{className:"flex flex-col gap-1",children:n.map(e=>(0,t.jsx)("span",{children:e},e))})})]})]})}let C=(0,v.default)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),j=(0,v.default)("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),R=(0,v.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),T=(0,v.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),N=(0,v.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);var E=e.i(260218),L=e.i(917955),P=e.i(949245);function $({value:e,onValueChange:r,options:n,className:s}){return(0,t.jsx)("div",{className:(0,P.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),children:n.map(n=>(0,t.jsxs)("button",{type:"button",onClick:()=>r(n.value),className:(0,P.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e===n.value?"bg-background text-foreground shadow":"hover:bg-background/50"),children:[n.icon,n.label&&(0,t.jsx)("span",{className:"ml-2",children:n.label})]},n.value))})}var A=e.i(687602);let I=(0,v.default)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var z=e.i(259280),M=e.i(456944);let H=l.forwardRef(({className:e,type:r,...n},s)=>(0,t.jsx)("input",{type:r,className:(0,P.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...n}));H.displayName="Input";var _=e.i(692792),D=l.forwardRef((e,r)=>(0,t.jsx)(_.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));D.displayName="Label";let q=(0,e.i(294237).cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),B=l.forwardRef(({className:e,...r},n)=>(0,t.jsx)(D,{ref:n,className:(0,P.cn)(q(),e),...r}));B.displayName=D.displayName;var V=e.i(346131),F=e.i(620486),O=e.i(202311),U=(0,O.createServerReference)("4092d8711f2d282bbab98f4435fd260f49c4d5106a",O.callServer,void 0,O.findSourceMapURL,"validateWorldConfig"),Z=e.i(335468),W=(0,O.createServerReference)("00d3f19c68ddef480c9481b99f05ac7baa954b04d9",O.callServer,void 0,O.findSourceMapURL,"checkWorldsAvailability");function K({open:e,onOpenChange:r}={}){let n,s=(0,F.useQueryParamConfig)(),a=(0,F.useUpdateConfigQueryParams)(),[i,o]=(0,l.useState)(!1),c=r||o,[u,d]=(0,l.useState)(s),[p,h]=(0,l.useState)([]),[f,m]=(0,l.useState)(!1),{data:g=[],isLoading:x}=(0,Z.default)("worlds-availability",W,{revalidateOnFocus:!1}),k=u.backend||"local",b="local"===k,v="postgres"===k;(0,l.useEffect)(()=>{d(s)},[s]);let w=async()=>{m(!0);try{let e=await U(u);h(e),0===e.length&&(a(u),c(!1))}catch(e){console.error("Validation error:",e),h([{field:"general",message:e instanceof Error?e.message:"Unknown error"}])}finally{m(!1)}},y=(e,t)=>{d(r=>({...r,[e]:t})),h(t=>t.filter(t=>t.field!==e))},S=e=>p.find(t=>t.field===e)?.message,C=JSON.stringify(u)!==JSON.stringify(s)||p.length>0;return(0,t.jsxs)(t.Fragment,{children:[void 0===e&&(0,t.jsx)("button",{type:"button",onClick:()=>c(!0),className:"p-2 rounded-full hover:bg-accent transition-colors",title:"Configuration",children:(0,t.jsx)(T,{className:"h-6 w-6"})}),(void 0!==e?e:i)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"fixed inset-0 bg-black/50 z-40 cursor-default",onClick:()=>c(!1),"aria-label":"Close configuration panel"}),(0,t.jsx)("div",{className:"fixed top-0 right-0 h-full w-96 bg-background border-l shadow-lg z-50 overflow-y-auto",children:(0,t.jsxs)("div",{className:"p-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:"Configuration"}),(0,t.jsx)(E.Button,{type:"button",onClick:()=>c(!1),variant:"outline",size:"icon",children:(0,t.jsx)(z.X,{className:"h-5 w-5"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(B,{htmlFor:"backend",children:"Backend"}),(0,t.jsxs)(V.Select,{value:u.backend||"local",onValueChange:e=>y("backend",e),children:[(0,t.jsx)(V.SelectTrigger,{id:"backend",children:(0,t.jsx)(V.SelectValue,{placeholder:"Select backend"})}),(0,t.jsx)(V.SelectContent,{children:x?(0,t.jsx)(V.SelectItem,{value:"loading",disabled:!0,children:"Loading worlds..."}):g.length>0?g.map(e=>(0,t.jsx)(V.SelectItem,{value:e.id,children:e.displayName},e.id)):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V.SelectItem,{value:"local",children:"Local"}),(0,t.jsx)(V.SelectItem,{value:"vercel",children:"Vercel"}),(0,t.jsx)(V.SelectItem,{value:"postgres",children:"PostgreSQL"})]})})]}),(n=g.find(e=>e.id===k))&&!n.isInstalled?(0,t.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-md bg-amber-500/10 border border-amber-500/20 text-amber-600 dark:text-amber-400",children:[(0,t.jsx)(I,{className:"h-4 w-4 mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("p",{className:"font-medium",children:"Package not installed"}),(0,t.jsxs)("p",{className:"mt-1 text-muted-foreground",children:["Run:"," ",(0,t.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded",children:n.installCommand})]})]})]}):null]}),b&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(B,{htmlFor:"port",children:"Port"}),(0,t.jsx)(H,{id:"port",value:u.port||"",onChange:e=>y("port",e.target.value),placeholder:"3001",className:S("port")?"border-destructive":""}),S("port")&&(0,t.jsx)("p",{className:"text-sm text-destructive break-words",children:S("port")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(B,{htmlFor:"dataDir",children:"Data Directory"}),(0,t.jsx)(H,{id:"dataDir",value:u.dataDir||"",onChange:e=>y("dataDir",e.target.value),placeholder:".workflow-data or .next/workflow-data",className:S("dataDir")?"border-destructive":""}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Path to the workflow data directory. Can be relative or absolute."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(B,{htmlFor:"manifestPath",children:"Manifest Path"}),(0,t.jsx)(H,{id:"manifestPath",value:u.manifestPath||"",onChange:e=>y("manifestPath",e.target.value),placeholder:"app/.well-known/workflow/v1/manifest.json",className:S("manifestPath")?"border-destructive":""}),S("manifestPath")&&(0,t.jsx)("p",{className:"text-sm text-destructive break-words",children:S("manifestPath")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Path to the workflow manifest file. Leave empty to use default locations."})]})]}),v&&(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(B,{htmlFor:"postgresUrl",children:"Connection URL"}),(0,t.jsx)(H,{id:"postgresUrl",value:u.postgresUrl||"",onChange:e=>y("postgresUrl",e.target.value),placeholder:"postgres://user:pass@host:5432/db",className:S("postgresUrl")?"border-destructive":""}),S("postgresUrl")&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:S("postgresUrl")})]})}),!b&&!v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(B,{htmlFor:"env",children:"Environment"}),(0,t.jsx)(H,{id:"env",value:u.env||"production",onChange:e=>y("env",e.target.value),placeholder:"production or preview"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(B,{htmlFor:"authToken",children:"Auth Token"}),(0,t.jsx)(H,{id:"authToken",type:"password",value:u.authToken||"",onChange:e=>y("authToken",e.target.value),placeholder:"Vercel auth token"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(B,{htmlFor:"project",children:"Project ID"}),(0,t.jsx)(H,{id:"project",value:u.project||"",onChange:e=>y("project",e.target.value),placeholder:"prj_..."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(B,{htmlFor:"team",children:"Team ID"}),(0,t.jsx)(H,{id:"team",value:u.team||"",onChange:e=>y("team",e.target.value),placeholder:"team_..."})]})]}),p.length>0&&(0,t.jsxs)(M.Alert,{variant:"destructive",className:"!bg-destructive/10 !border-destructive",children:[(0,t.jsx)(A.AlertCircle,{className:"h-4 w-4"}),(0,t.jsx)(M.AlertTitle,{children:"Configuration Error"}),(0,t.jsx)(M.AlertDescription,{children:(0,t.jsx)("ul",{className:"list-disc list-inside space-y-1",children:p.map((e,r)=>(0,t.jsxs)("li",{className:"break-words",children:["general"!==e.field&&(0,t.jsxs)("strong",{children:[e.field,":"]})," ",e.message]},`error-${r}`))})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 pt-4",children:[(0,t.jsx)(E.Button,{onClick:w,disabled:f||!C||g.some(e=>e.id===k&&!e.isInstalled),className:"w-full",children:f?"Validating...":"Apply Configuration"}),(0,t.jsx)(E.Button,{variant:"outline",onClick:()=>{d(s),h([]),c(!1)},className:"w-full",children:"Cancel"})]})]})]})})]})]})}function Q({open:e,onOpenChange:r}){return(0,t.jsx)(K,{open:e,onOpenChange:r})}function G(){let[e,r]=(0,l.useState)(!1),{theme:n,setTheme:s}=p();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(L.DropdownMenu,{children:[(0,t.jsx)(L.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(E.Button,{variant:"outline",size:"icon",children:[(0,t.jsx)(T,{className:"h-[1.2rem] w-[1.2rem]"}),(0,t.jsx)("span",{className:"sr-only",children:"Settings"})]})}),(0,t.jsxs)(L.DropdownMenuContent,{align:"end",className:"w-56",children:[(0,t.jsxs)("div",{className:"px-2 py-1.5 flex items-center gap-3",children:[(0,t.jsx)(L.DropdownMenuLabel,{className:"px-0 mb-0",children:"Theme"}),(0,t.jsx)($,{value:n||"system",onValueChange:s,options:[{value:"system",icon:(0,t.jsx)(j,{className:"h-4 w-4"})},{value:"light",icon:(0,t.jsx)(N,{className:"h-4 w-4"})},{value:"dark",icon:(0,t.jsx)(R,{className:"h-4 w-4"})}]})]}),(0,t.jsx)(L.DropdownMenuSeparator,{}),(0,t.jsxs)(L.DropdownMenuItem,{onSelect:()=>r(!0),children:[(0,t.jsx)("span",{children:"Configuration"}),(0,t.jsx)(T,{className:"ml-auto h-4 w-4"})]}),(0,t.jsx)(L.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)("a",{href:"https://useworkflow.dev/docs/getting-started",target:"_blank",rel:"noopener noreferrer",children:[(0,t.jsx)("span",{children:"Docs"}),(0,t.jsx)(C,{className:"ml-auto h-4 w-4"})]})})]})]}),(0,t.jsx)(Q,{open:e,onOpenChange:r})]})}var X=e.i(806746);let Y=({...e})=>{let{theme:r="system"}=p();return(0,t.jsx)(X.Toaster,{theme:r,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",error:"group-[.toaster]:bg-destructive group-[.toaster]:text-destructive-foreground group-[.toaster]:border-destructive",success:"group-[.toaster]:bg-green-600 group-[.toaster]:text-white group-[.toaster]:border-green-600"}},...e})};function J({className:e}={}){return(0,t.jsxs)("svg",{viewBox:"0 0 1792 240",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e||"h-6 w-auto",role:"img","aria-label":"Workflow Logo",children:[(0,t.jsx)("title",{children:"Workflow Logo"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M753.933 55.627C806.249 55.627 840.685 91.718 840.685 147.345C840.685 202.971 806.249 239.062 753.933 239.062C701.286 239.062 666.851 202.971 666.851 147.345C666.851 91.7181 701.286 55.6271 753.933 55.627ZM753.933 90.0625C726.451 90.0626 710.889 111.254 710.889 147.345C710.889 183.436 726.451 204.627 753.933 204.627C781.084 204.627 796.978 183.436 796.978 147.345C796.978 111.254 781.084 90.0625 753.933 90.0625Z",className:"fill-foreground"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1445.65 55.627C1497.96 55.627 1532.4 91.718 1532.4 147.345C1532.4 202.971 1497.96 239.062 1445.65 239.062C1393 239.062 1358.56 202.971 1358.56 147.345C1358.56 91.718 1393 55.627 1445.65 55.627ZM1445.65 90.0625C1418.16 90.0625 1402.6 111.254 1402.6 147.345C1402.6 183.436 1418.16 204.627 1445.65 204.627C1472.8 204.627 1488.69 183.436 1488.69 147.345C1488.69 111.254 1472.8 90.0626 1445.65 90.0625Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M902.473 94.0361C909.095 70.8584 922.34 59.5997 944.855 59.5996H961.079V92.3799H944.524C916.38 92.38 904.128 106.949 904.128 135.094V235.089H861.746V59.5996H901.48L902.473 94.0361Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1019.25 138.735L1091.11 59.5996H1143.09L1074.55 132.113L1146.4 235.089H1098.72L1046.74 157.609L1019.25 187.078V235.089H976.872V0H1019.25V138.735Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1263.63 32.7803H1235.82C1224.89 32.7803 1217.28 41.3893 1217.28 54.9648V59.5996H1260.98V92.3799H1217.28V235.089H1174.56V92.3799H1149.4V59.5996H1174.56V54.9648C1174.56 19.5359 1191.78 0 1230.85 0H1263.63V32.7803Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1322.58 189.396C1322.58 197.673 1327.22 202.309 1335.5 202.31H1348.74V235.089H1324.57C1298.08 235.089 1280.2 218.534 1280.2 191.052V0H1322.58V189.396Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1604.59 186.416L1641.02 59.5996H1677.77L1713.86 186.416L1749.95 59.5996H1791.34L1737.7 235.089H1694.32L1659.56 116.883L1624.79 235.089H1581.42L1527.77 59.5996H1568.83L1604.59 186.416Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M472.173 174.847L514.895 0.671875H554.66L598.038 174.847L640.432 0.671875H685.454L623.015 234H575.692L534.942 77.5713L493.863 234H446.869L384.1 0.671875H429.122L472.173 174.847Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M125.776 0C120.929 1.64945e-05 117 3.9291 117 8.77539V61.4248C117 66.2711 120.929 70.2002 125.776 70.2002H160.875L161.253 70.2051C169.032 70.4023 175.301 76.6734 175.495 84.4531L175.5 84.8252V143.325C175.5 148.171 179.429 152.101 184.276 152.101H219.375L219.753 152.105C227.53 152.303 233.798 158.571 233.995 166.348L234 166.726V225.225C234 230.071 237.929 234 242.776 234H295.425C300.271 234 304.2 230.071 304.2 225.225V172.575C304.2 167.729 300.271 163.8 295.425 163.8H260.25C252.334 163.76 245.905 157.43 245.705 149.553L245.7 149.176V90.6758C245.7 85.8295 241.771 81.9004 236.925 81.9004H201.825C193.874 81.9004 187.405 75.5551 187.205 67.6523L187.2 67.2754V8.77539C187.2 3.9291 183.271 1.64951e-05 178.425 0H125.776Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M67.2755 81.9004C62.4293 81.9004 58.5002 85.8295 58.5002 90.6758V143.325C58.5004 148.171 62.4294 152.101 67.2755 152.101H102.375L102.753 152.105C110.53 152.303 116.798 158.571 116.995 166.348L117 166.726V225.225C117 230.071 120.929 234 125.776 234H178.425C183.271 234 187.2 230.071 187.2 225.225V172.575C187.2 167.729 183.271 163.8 178.425 163.8H143.25C135.334 163.76 128.905 157.43 128.705 149.553L128.7 149.176V90.6758C128.7 85.8295 124.771 81.9004 119.925 81.9004H67.2755Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M8.77454 163.8C3.92844 163.8 0.00012207 167.729 0.00012207 172.575V225.225C0.00012207 230.071 3.92844 234 8.77454 234H61.4249C66.2712 234 70.2003 230.071 70.2003 225.225V172.575C70.2003 167.729 66.2712 163.8 61.4249 163.8H8.77454Z",className:"fill-foreground"})]})}function ee({children:e}){let a=(0,s.useRouter)(),i=(0,s.usePathname)(),o=(0,s.useSearchParams)(),c=(0,F.useQueryParamConfig)(),{setTheme:u}=p(),d=o.get("id"),h=o.get("runId"),f=o.get("stepId"),m=o.get("hookId"),g=o.get("resource"),x=o.get("theme"),k=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{x&&("light"===x||"dark"===x||"system"===x)&&u(x)},[x,u]),(0,l.useEffect)(()=>{let e;if("/"===i||!k.current){if(i.startsWith("/run/")){k.current=!0;return}if(!g){if(h){let e;e=f?(0,F.buildUrlWithConfig)(`/run/${h}`,c,{sidebar:"step",stepId:f}):m?(0,F.buildUrlWithConfig)(`/run/${h}`,c,{sidebar:"hook",hookId:m}):(0,F.buildUrlWithConfig)(`/run/${h}`,c),k.current=!0,a.push(e)}return}if(d){if("run"===g)e=(0,F.buildUrlWithConfig)(`/run/${d}`,c);else if("step"===g&&h)e=(0,F.buildUrlWithConfig)(`/run/${h}`,c,{sidebar:"step",stepId:d});else if("stream"===g&&h)e=(0,F.buildUrlWithConfig)(`/run/${h}`,c,{sidebar:"stream",streamId:d});else if("event"===g&&h)e=(0,F.buildUrlWithConfig)(`/run/${h}`,c,{sidebar:"event",eventId:d});else if("hook"===g&&h)e=(0,F.buildUrlWithConfig)(`/run/${h}`,c,{sidebar:"hook",hookId:d});else{if("hook"!==g||h)return void console.warn(`Can't deep-link to ${g} ${d}.`);e=(0,F.buildUrlWithConfig)("/",c,{sidebar:"hook",hookId:d})}k.current=!0,a.push(e)}}},[g,d,h,f,m,a,c,i]),(0,t.jsxs)("div",{className:"min-h-screen flex flex-col",children:[(0,t.jsxs)(r.TooltipProvider,{delayDuration:0,children:[(0,t.jsx)("div",{className:"sticky top-0 z-50 bg-background border-b px-6 py-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)(n.default,{href:(0,F.buildUrlWithConfig)("/",c),children:(0,t.jsx)("h1",{className:"flex items-center gap-2",title:"Workflow Observability",children:(0,t.jsx)(J,{})})}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,t.jsx)(S,{config:c}),(0,t.jsx)(G,{})]})]})}),(0,t.jsx)("div",{className:"flex-1 px-6 pt-6",children:e})]}),(0,t.jsx)(Y,{})]})}function et({children:e}){return(0,t.jsx)(h,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"workflow-theme",children:(0,t.jsx)(ee,{children:e})})}e.s(["LayoutClient",()=>et],608576)}]);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,330997,e=>{"use strict";var s=e.i(666426);e.i(169764);var t=e.i(545030),r=e.i(868924),a=e.i(531875),o=e.i(932671),l=e.i(504295),n=e.i(687602),i=e.i(886288);let d=(0,i.default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var c=e.i(524914),u=e.i(495566);let h=(0,i.default)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var m=e.i(846220),x=e.i(811735),f=e.i(686107),p=e.i(806746),g=e.i(456944),j=e.i(260218),w=e.i(949245);let b=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));b.displayName="Card",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("flex flex-col space-y-1.5 p-6",e),...t})).displayName="CardHeader",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("text-2xl font-semibold leading-none tracking-tight",e),...t})).displayName="CardTitle",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("text-sm text-muted-foreground",e),...t})).displayName="CardDescription";let k=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("p-6 pt-0",e),...t}));k.displayName="CardContent",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{ref:r,className:(0,w.cn)("flex items-center p-6 pt-0",e),...t})).displayName="CardFooter";var N=e.i(414576);let v=f.forwardRef(({className:e,href:t,children:r,...a},o)=>{let l=t.startsWith("http")?t:`https://useworkflow.dev/docs/${t.replace(/^\//,"")}`;return(0,s.jsx)(N.default,{href:l,className:(0,w.cn)("font-medium underline underline-offset-4 transition-colors",e),style:{color:"var(--ds-blue-600)"},target:"_blank",rel:"noopener noreferrer",ref:o,...a,children:r})});v.displayName="DocsLink";var y=e.i(917955);let C=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:r,className:(0,w.cn)("w-full caption-bottom text-sm",e),...t})}));C.displayName="Table";let S=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("thead",{ref:r,className:(0,w.cn)("[&_tr]:border-b",e),...t}));S.displayName="TableHeader";let R=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("tbody",{ref:r,className:(0,w.cn)("[&_tr:last-child]:border-0",e),...t}));R.displayName="TableBody",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("tfoot",{ref:r,className:(0,w.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t})).displayName="TableFooter";let T=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("tr",{ref:r,className:(0,w.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));T.displayName="TableRow";let I=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("th",{ref:r,className:(0,w.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));I.displayName="TableHead";let D=f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("td",{ref:r,className:(0,w.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));D.displayName="TableCell",f.forwardRef(({className:e,...t},r)=>(0,s.jsx)("caption",{ref:r,className:(0,w.cn)("mt-4 text-sm text-muted-foreground",e),...t})).displayName="TableCaption";var M=e.i(638322),A=e.i(620486),P=e.i(241245),E=e.i(719402),_=e.i(613087);function F({rows:e=w.DEFAULT_PAGE_SIZE,variant:t="runs"}){return(0,s.jsx)(b,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsxs)(k,{className:"p-0",children:[(()=>{switch(t){case"runs":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.8fr_1fr_1fr_40px] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-12"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)("div",{className:"w-6"})]});case"hooks":return(0,s.jsxs)("div",{className:"grid grid-cols-[1.2fr_1.2fr_0.8fr_1fr_0.5fr_40px] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-16"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-12"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)("div",{className:"w-6"})]});case"workflows":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.5fr] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-10"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-12 mx-auto"})]});default:return null}})(),Array.from({length:e},(e,r)=>(e=>{switch(t){case"runs":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.8fr_1fr_1fr_40px] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(_.Skeleton,{className:"h-3 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-2 w-8"})]}),(0,s.jsx)(_.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-6 w-6 rounded"})]},`skeleton-row-${e}`);case"hooks":return(0,s.jsxs)("div",{className:"grid grid-cols-[1.2fr_1.2fr_0.8fr_1fr_0.5fr_40px] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-8"}),(0,s.jsx)(_.Skeleton,{className:"h-6 w-6 rounded"})]},`skeleton-row-${e}`);case"workflows":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.5fr] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(_.Skeleton,{className:"h-5 w-16 rounded-full mx-auto"})]},`skeleton-row-${e}`);default:return null}})(r))]})})}function z({config:e,runId:t,onHookClick:r,selectedHookId:i}){let[w,N]=(0,f.useState)(()=>new Date),_=(0,f.useMemo)(()=>(0,A.worldConfigToEnvMap)(e),[e]),{data:z,error:O,nextPage:W,previousPage:B,hasNextPage:H,hasPreviousPage:$,reload:L,pageInfo:U}=(0,a.useWorkflowHooks)(_,{runId:t,sortOrder:"desc"}),V=(0,o.useHookActions)({env:_,callbacks:{onSuccess:L}}),G=z.isLoading,K=z.data??[],[Z,q]=(0,f.useState)(new Map);return(0,f.useEffect)(()=>{K.length&&(async()=>{let e=new Map;for(let s of K)e.set(s.hookId,{count:0,hasMore:!1,loading:!0});q(e);let s=await Promise.allSettled(K.map(async e=>{try{let s=await (0,l.fetchEventsByCorrelationId)(_,e.hookId,{sortOrder:"asc",limit:100});if(!s.success)return{hookId:e.hookId,count:Error(s.error?.message||"Failed to fetch events"),hasMore:!1};let t=s.data,r=t.data.filter(e=>"hook_received"===e.eventType).length;return{hookId:e.hookId,count:r,hasMore:t.hasMore}}catch(s){return{hookId:e.hookId,count:s,hasMore:!1}}}));q(e=>{let t=new Map(e);for(let e=0;e<s.length;e++){let r=s[e],a=K[e].hookId;"fulfilled"===r.status?t.set(r.value.hookId,{count:r.value.count,hasMore:r.value.hasMore,loading:!1}):t.set(a,{count:0,hasMore:!1,loading:!1})}return t})})()},[K,_]),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.HookResolveModalWrapper,{hookActions:V}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Last refreshed"}),w&&(0,s.jsx)(E.RelativeTime,{date:w,className:"text-sm text-muted-foreground",type:"distance"})]}),(0,s.jsx)("div",{className:"flex items-center gap-4",children:(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:()=>{N(()=>new Date),L()},disabled:G,children:[(0,s.jsx)(h,{className:G?"animate-spin":""}),"Refresh"]})}),(0,s.jsx)(M.TooltipContent,{children:"Note that this resets pages"})]})})]}),O?(0,s.jsxs)(g.Alert,{variant:"destructive",children:[(0,s.jsx)(n.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(g.AlertTitle,{children:"Error loading hooks"}),(0,s.jsx)(g.AlertDescription,{children:(0,a.getErrorMessage)(O)})]}):G||K&&0!==K.length?G&&!z?.data?(0,s.jsx)(F,{variant:"hooks"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsx)(k,{className:"p-0 max-h-[calc(100vh-280px)] overflow-auto",children:(0,s.jsxs)(C,{children:[(0,s.jsx)(S,{children:(0,s.jsxs)(T,{children:[(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Hook ID"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Run ID"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Token"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Created"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Invocations"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10 w-10"})]})}),(0,s.jsx)(R,{children:K.map(e=>(0,s.jsxs)(T,{className:"cursor-pointer group relative",onClick:()=>r(e.hookId,e.runId),"data-selected":e.hookId===i,children:[(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.hookId,overlay:!0,children:e.hookId})}),(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.runId,overlay:!0,children:e.runId})}),(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.token,overlay:!0,children:(0,s.jsx)("span",{className:"text-muted-foreground",children:"••••••••••••"})})}),(0,s.jsx)(D,{className:"py-2 text-muted-foreground text-xs",children:e.createdAt?(0,s.jsx)(E.RelativeTime,{date:e.createdAt}):"-"}),(0,s.jsx)(D,{className:"py-2",children:(e=>{let t=Z.get(e.hookId);if(!t||t.loading)return(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:"..."});if(t.count instanceof Error)return(0,s.jsx)("span",{className:"text-muted-foreground",children:"Error"});if(0===t.count)return(0,s.jsx)("span",{className:"text-muted-foreground",children:"0"});let r=t.hasMore?`${t.count}+`:`${t.count}`;return t.hasMore?(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("span",{className:"font-semibold cursor-help",children:r})}),(0,s.jsx)(M.TooltipContent,{className:"max-w-xs",children:(0,s.jsx)("div",{className:"text-xs",children:"Showing first 100 invocations. There may be more."})})]}):(0,s.jsx)("span",{className:"font-semibold",children:r})})(e)}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsxs)(y.DropdownMenu,{children:[(0,s.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(u.MoreHorizontal,{className:"h-4 w-4"})})}),(0,s.jsxs)(y.DropdownMenuContent,{align:"end",children:[(0,s.jsx)(o.ResolveHookDropdownItem,{hook:e,stopPropagation:!0,onResolveClick:V.openResolveModal,DropdownMenuItem:y.DropdownMenuItem}),(0,s.jsxs)(y.DropdownMenuItem,{onClick:async s=>{s.stopPropagation();try{let s=await (0,a.recreateRun)(_,e.runId);p.toast.success("New run started",{description:`Run ID: ${s}`}),L()}catch(e){p.toast.error("Failed to re-run",{description:e instanceof Error?e.message:"Unknown error"})}},children:[(0,s.jsx)(m.RotateCw,{className:"h-4 w-4 mr-2"}),"Replay Run"]}),(0,s.jsxs)(y.DropdownMenuItem,{onClick:async s=>{s.stopPropagation();try{await (0,a.cancelRun)(_,e.runId),p.toast.success("Run cancelled"),L()}catch(e){p.toast.error("Failed to cancel",{description:e instanceof Error?e.message:"Unknown error"})}},children:[(0,s.jsx)(x.XCircle,{className:"h-4 w-4 mr-2"}),"Cancel"]})]})]})})]},e.hookId))})]})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:U}),(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:B,disabled:!$,children:[(0,s.jsx)(d,{}),"Previous"]}),(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:W,disabled:!H,children:["Next",(0,s.jsx)(c.ChevronRight,{})]})]})]})]}):(0,s.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:["No active hooks found. ",(0,s.jsx)("br",{}),(0,s.jsx)(v,{href:"https://useworkflow.dev/docs/api-reference/workflow/create-hook",children:"Learn how to create a hook"})]})]})}var O=e.i(360088),W=e.i(413862),B=e.i(384405);let H=(0,i.default)("ArrowDownAZ",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]),$=(0,i.default)("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);var L=e.i(346131),U=e.i(451675),V=e.i(708341);function G({env:e,runId:t,runStatus:r,onSuccess:a,showDebugActions:o}){let[l,n]=(0,f.useState)(void 0),[i,d]=(0,f.useState)(!0),[c,u]=(0,f.useState)(void 0),h=c?.status||r;return(0,f.useEffect)(()=>{d(!0),Promise.all([(0,B.fetchRun)(e,t,"none"),(0,W.fetchEvents)(e,t,{limit:1e3,sortOrder:"desc"})]).then(([e,s])=>{e.success&&u(e.data),s.success&&n(s.data.data)}).catch(e=>{console.error("Failed to fetch run or events:",e)}).finally(()=>{d(!1)})},[e,t]),(0,s.jsx)(V.RunActionsDropdownItems,{env:e,runId:t,runStatus:h,events:l,eventsLoading:i,stopPropagation:!0,callbacks:{onSuccess:a},showDebugActions:o})}function K({env:e,runId:t,runStatus:r,onSuccess:a,showDebugActions:o}){let[l,n]=(0,f.useState)(!1);return(0,s.jsxs)(y.DropdownMenu,{open:l,onOpenChange:n,children:[(0,s.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(u.MoreHorizontal,{className:"h-4 w-4"})})}),l&&(0,s.jsx)(y.DropdownMenuContent,{align:"end",children:(0,s.jsx)(G,{env:e,runId:t,runStatus:r,onSuccess:a,showDebugActions:o})})]})}let Z={pending:{label:"Pending",color:"bg-neutral-600 dark:bg-neutral-400"},running:{label:"Running",color:"bg-blue-600 dark:bg-blue-400"},completed:{label:"Completed",color:"bg-green-600 dark:bg-green-400"},failed:{label:"Failed",color:"bg-red-600 dark:bg-red-400"},paused:{label:"Paused",color:"bg-yellow-600 dark:bg-yellow-400"},cancelled:{label:"Cancelled",color:"bg-gray-600 dark:bg-gray-400"}};function q({workflowNameFilter:e,status:t,seenWorkflowNames:r,sortOrder:a,loading:o,statusFilterRequiresWorkflowNameFilter:l,onWorkflowChange:n,onStatusChange:i,onSortToggle:d,onRefresh:c,lastRefreshTime:u}){return(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Last refreshed"}),u&&(0,s.jsx)(E.RelativeTime,{date:u,className:"text-sm text-muted-foreground",type:"distance"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)(L.Select,{value:e??"all",onValueChange:n,disabled:o,children:[(0,s.jsx)(L.SelectTrigger,{className:"w-[180px] h-9",children:(0,s.jsx)(L.SelectValue,{placeholder:"Filter by workflow"})}),(0,s.jsxs)(L.SelectContent,{children:[(0,s.jsx)(L.SelectItem,{value:"all",children:"All Workflows"}),Array.from(r).sort().map(e=>(0,s.jsx)(L.SelectItem,{value:e,children:(0,O.parseWorkflowName)(e)?.shortName||e},e))]})]}),(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("div",{children:(0,s.jsxs)(L.Select,{value:t||"all",onValueChange:i,disabled:o||l&&!e,children:[(0,s.jsx)(L.SelectTrigger,{className:"w-[140px] h-9",children:(0,s.jsx)(L.SelectValue,{placeholder:"Filter by status"})}),(0,s.jsxs)(L.SelectContent,{children:[(0,s.jsx)(L.SelectItem,{value:"all",children:"Any status"}),Object.entries(Z).map(([e,{label:t,color:r}])=>(0,s.jsx)(L.SelectItem,{value:e,children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("span",{className:`${r} size-1.5 rounded-full mr-2`}),t]})},e))]})]})})}),(0,s.jsx)(M.TooltipContent,{children:l&&"all"===e?"Select a workflow first to filter by status":"Filter runs by status"})]}),(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:d,disabled:o,children:["desc"===a?(0,s.jsx)(H,{className:"h-4 w-4"}):(0,s.jsx)($,{className:"h-4 w-4"}),"desc"===a?"Newest":"Oldest"]})}),(0,s.jsx)(M.TooltipContent,{children:"desc"===a?"Showing newest first":"Showing oldest first"})]}),(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:c,disabled:o,children:[(0,s.jsx)(h,{className:o?"animate-spin":""}),"Refresh"]})}),(0,s.jsx)(M.TooltipContent,{children:"Note that this resets pages"})]})]})]})}function Q({config:e,onRunClick:t}){let o,l,i,u,h,m,x=(0,r.useSearchParams)(),p=(o=(0,r.useRouter)(),l=(0,r.usePathname)(),i=(0,r.useSearchParams)(),(0,f.useCallback)(e=>{let s=new URLSearchParams(i.toString());"all"===e?(s.delete("workflow"),s.delete("status")):s.set("workflow",e),o.push(`${l}?${s.toString()}`)},[o,l,i])),w=(u=(0,r.useRouter)(),h=(0,r.usePathname)(),m=(0,r.useSearchParams)(),(0,f.useCallback)(e=>{let s=new URLSearchParams(m.toString());"all"===e?s.delete("status"):s.set("status",e),u.push(`${h}?${s.toString()}`)},[u,h,m])),N=x.get("status"),y=Object.keys(Z),M="all"===N||N&&y.includes(N)?N:void 0,_=x.get("workflow"),z="1"===x.get("debug"),[W,B]=(0,f.useState)("desc"),[H,$]=(0,f.useState)(()=>new Date),L=(0,f.useMemo)(()=>(0,A.worldConfigToEnvMap)(e),[e]),V=e.backend?.includes("vercel")||!1,[G,Q]=(0,f.useState)(new Set),{data:X,error:J,nextPage:Y,previousPage:ee,hasNextPage:es,hasPreviousPage:et,reload:er,pageInfo:ea}=(0,a.useWorkflowRuns)(L,{sortOrder:W,workflowName:"all"===_?void 0:_,status:"all"===M?void 0:M});(0,f.useEffect)(()=>{if(X.data&&X.data.length>0){let e=new Set(X.data.map(e=>e.workflowName));Q(s=>{let t=new Set(s);for(let s of e)t.add(s);return t})}},[X.data]);let eo=X.isLoading;return(0,s.jsxs)("div",{children:[(0,s.jsx)(q,{workflowNameFilter:_,status:M,seenWorkflowNames:G,sortOrder:W,loading:eo,statusFilterRequiresWorkflowNameFilter:V,onWorkflowChange:p,onStatusChange:w,onSortToggle:()=>{B(e=>"desc"===e?"asc":"desc")},onRefresh:()=>{$(()=>new Date),er()},lastRefreshTime:H}),J?(0,s.jsxs)(g.Alert,{variant:"destructive",children:[(0,s.jsx)(n.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(g.AlertTitle,{children:"Error loading runs"}),(0,s.jsx)(g.AlertDescription,{children:(0,a.getErrorMessage)(J)})]}):eo&&!X?.data?(0,s.jsx)(F,{}):eo||X.data&&0!==X.data.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsx)(k,{className:"p-0 max-h-[calc(100vh-280px)] overflow-auto",children:(0,s.jsxs)(C,{children:[(0,s.jsx)(S,{children:(0,s.jsxs)(T,{children:[(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Workflow"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Run ID"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Status"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Started"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Completed"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10 w-10"})]})}),(0,s.jsx)(R,{children:X.data?.map(e=>(0,s.jsxs)(T,{className:"cursor-pointer group relative",onClick:()=>t(e.runId),children:[(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)(P.CopyableText,{text:e.workflowName,overlay:!0,children:(0,O.parseWorkflowName)(e.workflowName)?.shortName||"?"})}),(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.runId,overlay:!0,children:e.runId})}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)(U.StatusBadge,{status:e.status,context:e,durationMs:e.startedAt?(e.completedAt?new Date(e.completedAt).getTime():Date.now())-new Date(e.startedAt).getTime():void 0})}),(0,s.jsx)(D,{className:"py-2 text-muted-foreground text-xs",children:e.startedAt?(0,s.jsx)(E.RelativeTime,{date:e.startedAt}):"-"}),(0,s.jsx)(D,{className:"py-2 text-muted-foreground text-xs",children:e.completedAt?(0,s.jsx)(E.RelativeTime,{date:e.completedAt}):"-"}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)(K,{env:L,runId:e.runId,runStatus:e.status,onSuccess:er,showDebugActions:z})})]},e.runId))})]})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:ea}),(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:ee,disabled:!et,children:[(0,s.jsx)(d,{}),"Previous"]}),(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:Y,disabled:!es,children:["Next",(0,s.jsx)(c.ChevronRight,{})]})]})]})]}):(0,s.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:["No workflow runs found. ",(0,s.jsx)("br",{}),(0,s.jsx)(v,{href:"https://useworkflow.dev/docs/foundations/workflows-and-steps",children:"Learn how to create a workflow"})]})]})}var X=e.i(889840),J=e.i(400138);let Y=(0,i.default)("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);var ee=e.i(93698),es=e.i(562918),et=e.i(291967),er=e.i(221588),ea=e.i(810096),eo=e.i(244107),el=e.i(802313),en=e.i(975287),ei=e.i(376268),ed=e.i(153840),ec=e.i(110515),eu=e.i(692792),eh=e.i(345594),em=e.i(891246),ex=e.i(73772),ef=e.i(545136),ep="Dialog",[eg,ej]=(0,ea.createContextScope)(ep),[ew,eb]=eg(ep),ek=e=>{let{__scopeDialog:t,children:r,open:a,defaultOpen:o,onOpenChange:l,modal:n=!0}=e,i=f.useRef(null),d=f.useRef(null),[c,u]=(0,el.useControllableState)({prop:a,defaultProp:o??!1,onChange:l,caller:ep});return(0,s.jsx)(ew,{scope:t,triggerRef:i,contentRef:d,contentId:(0,eo.useId)(),titleId:(0,eo.useId)(),descriptionId:(0,eo.useId)(),open:c,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(e=>!e),[u]),modal:n,children:r})};ek.displayName=ep;var eN="DialogTrigger";f.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=eb(eN,r),l=(0,er.useComposedRefs)(t,o.triggerRef);return(0,s.jsx)(eu.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":e$(o.open),...a,ref:l,onClick:(0,et.composeEventHandlers)(e.onClick,o.onOpenToggle)})}).displayName=eN;var ev="DialogPortal",[ey,eC]=eg(ev,{forceMount:void 0}),eS=e=>{let{__scopeDialog:t,forceMount:r,children:a,container:o}=e,l=eb(ev,t);return(0,s.jsx)(ey,{scope:t,forceMount:r,children:f.Children.map(a,e=>(0,s.jsx)(ec.Presence,{present:r||l.open,children:(0,s.jsx)(ed.Portal,{asChild:!0,container:o,children:e})}))})};eS.displayName=ev;var eR="DialogOverlay",eT=f.forwardRef((e,t)=>{let r=eC(eR,e.__scopeDialog),{forceMount:a=r.forceMount,...o}=e,l=eb(eR,e.__scopeDialog);return l.modal?(0,s.jsx)(ec.Presence,{present:a||l.open,children:(0,s.jsx)(eD,{...o,ref:t})}):null});eT.displayName=eR;var eI=(0,ef.createSlot)("DialogOverlay.RemoveScroll"),eD=f.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=eb(eR,r);return(0,s.jsx)(em.RemoveScroll,{as:eI,allowPinchZoom:!0,shards:[o.contentRef],children:(0,s.jsx)(eu.Primitive.div,{"data-state":e$(o.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),eM="DialogContent",eA=f.forwardRef((e,t)=>{let r=eC(eM,e.__scopeDialog),{forceMount:a=r.forceMount,...o}=e,l=eb(eM,e.__scopeDialog);return(0,s.jsx)(ec.Presence,{present:a||l.open,children:l.modal?(0,s.jsx)(eP,{...o,ref:t}):(0,s.jsx)(eE,{...o,ref:t})})});eA.displayName=eM;var eP=f.forwardRef((e,t)=>{let r=eb(eM,e.__scopeDialog),a=f.useRef(null),o=(0,er.useComposedRefs)(t,r.contentRef,a);return f.useEffect(()=>{let e=a.current;if(e)return(0,ex.hideOthers)(e)},[]),(0,s.jsx)(e_,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,et.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,et.composeEventHandlers)(e.onPointerDownOutside,e=>{let s=e.detail.originalEvent,t=0===s.button&&!0===s.ctrlKey;(2===s.button||t)&&e.preventDefault()}),onFocusOutside:(0,et.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),eE=f.forwardRef((e,t)=>{let r=eb(eM,e.__scopeDialog),a=f.useRef(!1),o=f.useRef(!1);return(0,s.jsx)(e_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(a.current||r.triggerRef.current?.focus(),s.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(a.current=!0,"pointerdown"===s.detail.originalEvent.type&&(o.current=!0));let t=s.target;r.triggerRef.current?.contains(t)&&s.preventDefault(),"focusin"===s.detail.originalEvent.type&&o.current&&s.preventDefault()}})}),e_=f.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:l,...n}=e,i=eb(eM,r),d=f.useRef(null),c=(0,er.useComposedRefs)(t,d);return(0,eh.useFocusGuards)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ei.FocusScope,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:l,children:(0,s.jsx)(en.DismissableLayer,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":e$(i.open),...n,ref:c,onDismiss:()=>i.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eG,{titleId:i.titleId}),(0,s.jsx)(eK,{contentRef:d,descriptionId:i.descriptionId})]})]})}),eF="DialogTitle",ez=f.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=eb(eF,r);return(0,s.jsx)(eu.Primitive.h2,{id:o.titleId,...a,ref:t})});ez.displayName=eF;var eO="DialogDescription",eW=f.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=eb(eO,r);return(0,s.jsx)(eu.Primitive.p,{id:o.descriptionId,...a,ref:t})});eW.displayName=eO;var eB="DialogClose",eH=f.forwardRef((e,t)=>{let{__scopeDialog:r,...a}=e,o=eb(eB,r);return(0,s.jsx)(eu.Primitive.button,{type:"button",...a,ref:t,onClick:(0,et.composeEventHandlers)(e.onClick,()=>o.onOpenChange(!1))})});function e$(e){return e?"open":"closed"}eH.displayName=eB;var eL="DialogTitleWarning",[eU,eV]=(0,ea.createContext)(eL,{contentName:eM,titleName:eF,docsSlug:"dialog"}),eG=({titleId:e})=>{let s=eV(eL),t=`\`${s.contentName}\` requires a \`${s.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
-
|
|
5
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(t))},[t,e]),null},eK=({contentRef:e,descriptionId:s})=>{let t=eV("DialogDescriptionWarning"),r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t.contentName}}.`;return f.useEffect(()=>{let t=e.current?.getAttribute("aria-describedby");s&&t&&(document.getElementById(s)||console.warn(r))},[r,e,s]),null},eZ=e.i(897884),eZ=eZ;function eq({...e}){return(0,s.jsx)(ek,{"data-slot":"sheet",...e})}function eQ({...e}){return(0,s.jsx)(eS,{"data-slot":"sheet-portal",...e})}function eX({className:e,...t}){return(0,s.jsx)(eT,{"data-slot":"sheet-overlay",className:(0,w.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function eJ({className:e,children:t,side:r="right",...a}){return(0,s.jsxs)(eQ,{children:[(0,s.jsx)(eX,{}),(0,s.jsxs)(eA,{"data-slot":"sheet-content",className:(0,w.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===r&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","left"===r&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","top"===r&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b","bottom"===r&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...a,children:[t,(0,s.jsxs)(eH,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,s.jsx)(eZ.default,{className:"size-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function eY({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"sheet-header",className:(0,w.cn)("flex flex-col gap-1.5 p-4",e),...t})}function e0({className:e,...t}){return(0,s.jsx)(ez,{"data-slot":"sheet-title",className:(0,w.cn)("text-foreground font-semibold",e),...t})}function e1({className:e,...t}){return(0,s.jsx)(eW,{"data-slot":"sheet-description",className:(0,w.cn)("text-muted-foreground text-sm",e),...t})}var e4=e.i(479823);function e2({config:e,onWorkflowSelect:t}){let[r,a]=(0,f.useState)(!1),[o,l]=(0,f.useState)(null),{manifest:i,loading:d,error:c}=(0,e4.useWorkflowGraphManifest)(e),u=i?Object.values(i.workflows):[],h=(0,f.useMemo)(()=>[...u].sort((e,s)=>e.workflowName.localeCompare(s.workflowName)),[u]);return d?(0,s.jsx)(F,{variant:"workflows",rows:6}):c?(0,s.jsxs)(g.Alert,{variant:"destructive",children:[(0,s.jsx)(n.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(g.AlertTitle,{children:"Error Loading Workflows"}),(0,s.jsx)(g.AlertDescription,{children:c.message})]}):0===u.length?(0,s.jsx)(b,{children:(0,s.jsxs)(k,{className:"p-12 text-center",children:[(0,s.jsx)(Y,{className:"mx-auto h-12 w-12 text-muted-foreground mb-4"}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No Workflows Found"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No workflow definitions were found in the graph manifest."})]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{className:"overflow-hidden bg-background",children:(0,s.jsx)(k,{className:"p-0 max-h-[calc(100vh-200px)] overflow-auto",children:(0,s.jsxs)(C,{children:[(0,s.jsx)(S,{children:(0,s.jsxs)(T,{children:[(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Workflow"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"File"}),(0,s.jsx)(I,{className:"text-center sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Steps"})]})}),(0,s.jsx)(R,{children:h.map(e=>{let r=e.nodes.filter(e=>"step"===e.data.nodeKind).length;return(0,s.jsxs)(T,{className:"cursor-pointer",onClick:()=>{l(e),a(!0),t?.(e.workflowName)},children:[(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)("span",{className:"font-medium",children:e.workflowName})}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.filePath})}),(0,s.jsx)(D,{className:"text-center py-2",children:(0,s.jsxs)(es.Badge,{variant:"secondary",className:"gap-1",children:[(0,s.jsx)(J.GitBranch,{className:"h-3 w-3"}),r," ",1===r?"step":"steps"]})})]},e.workflowId)})})]})})}),(0,s.jsx)(eq,{open:r,onOpenChange:a,children:(0,s.jsxs)(eJ,{side:"right",className:"w-[75vw] max-w-[75vw] sm:max-w-[75vw]",children:[(0,s.jsxs)(eY,{children:[(0,s.jsxs)(e0,{className:"flex items-center gap-2",children:[(0,s.jsx)(Y,{className:"h-5 w-5"}),o?.workflowName]}),o&&(0,s.jsx)(e1,{asChild:!0,children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("code",{className:"text-xs",children:o.filePath}),(0,s.jsx)("div",{children:(0,s.jsxs)(es.Badge,{variant:"outline",className:"gap-1",children:[(0,s.jsx)(J.GitBranch,{className:"h-3 w-3"}),o.nodes.filter(e=>"step"===e.data.nodeKind).length," ",1===o.nodes.filter(e=>"step"===e.data.nodeKind).length?"step":"steps"]})})]})})]}),(0,s.jsx)("div",{className:"mt-6 h-[calc(100vh-180px)]",children:o&&(0,s.jsx)(ee.WorkflowGraphViewer,{workflow:o})})]})})]})}var e5=e.i(480462);function e6(){let e=(0,r.useRouter)(),a=(0,A.useQueryParamConfig)(),[o]=(0,e5.useSidebarState)(),[l]=(0,e5.useHookIdState)(),[n,i]=(0,e5.useTabState)(),d="local"===a.backend;return(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4",children:(0,s.jsxs)(X.Tabs,{value:n,onValueChange:i,className:"w-full",children:[(0,s.jsxs)(X.TabsList,{className:"mb-4",children:[(0,s.jsx)(X.TabsTrigger,{value:"runs",children:"Runs"}),(0,s.jsx)(X.TabsTrigger,{value:"hooks",children:"Hooks"}),d&&(0,s.jsx)(X.TabsTrigger,{value:"workflows",children:"Workflows"})]}),(0,s.jsx)(X.TabsContent,{value:"runs",children:(0,s.jsx)(t.ErrorBoundary,{title:"Runs Error",description:"Failed to load workflow runs. Please try refreshing the page.",children:(0,s.jsx)(Q,{config:a,onRunClick:(s,t)=>{t?e.push((0,A.buildUrlWithConfig)(`/run/${s}/streams/${t}`,a)):e.push((0,A.buildUrlWithConfig)(`/run/${s}`,a))}})})}),(0,s.jsx)(X.TabsContent,{value:"hooks",children:(0,s.jsx)(t.ErrorBoundary,{title:"Hooks Error",description:"Failed to load hooks. Please try refreshing the page.",children:(0,s.jsx)(z,{config:a,onHookClick:(s,t)=>{s?e.push((0,A.buildUrlWithConfig)(`/run/${t}`,a,{sidebar:"hook",hookId:s})):e.push((0,A.buildUrlWithConfig)(`/run/${t}`,a))},selectedHookId:"hook"===o&&l?l:void 0})})}),d&&(0,s.jsx)(X.TabsContent,{value:"workflows",children:(0,s.jsx)(t.ErrorBoundary,{title:"Workflows Error",description:"Failed to load workflow graph data. Please try refreshing the page.",children:(0,s.jsx)(e2,{config:a})})})]})})}e.s(["default",()=>e6],330997)}]);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,721969,e=>{"use strict";let t;var a,s=e.i(666426);e.i(169764);var r=e.i(545030),n=e.i(868924),o=e.i(360088),l=e.i(531875),d=e.i(742334),i=e.i(195547),c=e.i(687602),u=e.i(400138),p=e.i(886288);let m=(0,p.default)("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),f=(0,p.default)("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var x=e.i(857812),h=e.i(414576),g=e.i(686107),b=e.i(806746),v=e.i(456944),j=e.i(961612),y=e.i(652773),N=e.i(178896),w=e.i(873350),k=e.i(676977),S=e.i(571577),A=e.i(68206),C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let a=g.forwardRef((e,a)=>{let{asChild:r,...n}=e,o=r?A.Slot:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(o,{...n,ref:a})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{}),I=e.i(448297),E=e.i(25749),D="dismissableLayer.update",T=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),R=g.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:d,onDismiss:i,...c}=e,u=g.useContext(T),[p,m]=g.useState(null),f=p?.ownerDocument??globalThis?.document,[,x]=g.useState({}),h=(0,y.useComposedRefs)(t,e=>m(e)),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),j=b.indexOf(v),w=p?b.indexOf(p):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=j,A=function(e,t=globalThis?.document){let a=(0,I.useCallbackRef)(e),s=g.useRef(!1),r=g.useRef(()=>{});return g.useEffect(()=>{let e=e=>{if(e.target&&!s.current){let s=function(){P("dismissableLayer.pointerDownOutside",a,n,{discrete:!0})},n={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",r.current),r.current=s,t.addEventListener("click",r.current,{once:!0})):s()}else t.removeEventListener("click",r.current);s.current=!1},n=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",r.current)}},[t,a]),{onPointerDownCapture:()=>s.current=!0}}(e=>{let t=e.target,a=[...u.branches].some(e=>e.contains(t));S&&!a&&(o?.(e),d?.(e),e.defaultPrevented||i?.())},f),R=function(e,t=globalThis?.document){let a=(0,I.useCallbackRef)(e),s=g.useRef(!1);return g.useEffect(()=>{let e=e=>{e.target&&!s.current&&P("dismissableLayer.focusOutside",a,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}(e=>{let t=e.target;![...u.branches].some(e=>e.contains(t))&&(l?.(e),d?.(e),e.defaultPrevented||i?.())},f);return(0,E.useEscapeKeydown)(e=>{w===u.layers.size-1&&(n?.(e),!e.defaultPrevented&&i&&(e.preventDefault(),i()))},f),g.useEffect(()=>{if(p)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(a=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),O(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=a)}},[p,f,r,u]),g.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),O())},[p,u]),g.useEffect(()=>{let e=()=>x({});return document.addEventListener(D,e),()=>document.removeEventListener(D,e)},[]),(0,s.jsx)(C.div,{...c,ref:h,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:(0,N.composeEventHandlers)(e.onFocusCapture,R.onFocusCapture),onBlurCapture:(0,N.composeEventHandlers)(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:(0,N.composeEventHandlers)(e.onPointerDownCapture,A.onPointerDownCapture)})});function O(){let e=new CustomEvent(D);document.dispatchEvent(e)}function P(e,t,a,{discrete:s}){let r=a.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});if(t&&r.addEventListener(e,t,{once:!0}),s)r&&S.flushSync(()=>r.dispatchEvent(n));else r.dispatchEvent(n)}R.displayName="DismissableLayer",g.forwardRef((e,t)=>{let a=g.useContext(T),r=g.useRef(null),n=(0,y.useComposedRefs)(t,r);return g.useEffect(()=>{let e=r.current;if(e)return a.branches.add(e),()=>{a.branches.delete(e)}},[a.branches]),(0,s.jsx)(C.div,{...e,ref:n})}).displayName="DismissableLayerBranch";var L="focusScope.autoFocusOnMount",M="focusScope.autoFocusOnUnmount",F={bubbles:!1,cancelable:!0},_=g.forwardRef((e,t)=>{let{loop:a=!1,trapped:r=!1,onMountAutoFocus:n,onUnmountAutoFocus:o,...l}=e,[d,i]=g.useState(null),c=(0,I.useCallbackRef)(n),u=(0,I.useCallbackRef)(o),p=g.useRef(null),m=(0,y.useComposedRefs)(t,e=>i(e)),f=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let e=function(e){if(f.paused||!d)return;let t=e.target;d.contains(t)?p.current=t:$(p.current,{select:!0})},t=function(e){if(f.paused||!d)return;let t=e.relatedTarget;null!==t&&(d.contains(t)||$(p.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let a=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&$(d)});return d&&a.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),a.disconnect()}}},[r,d,f.paused]),g.useEffect(()=>{if(d){H.add(f);let e=document.activeElement;if(!d.contains(e)){let t=new CustomEvent(L,F);d.addEventListener(L,c),d.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let a=document.activeElement;for(let s of e)if($(s,{select:t}),document.activeElement!==a)return}(W(d).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&$(d))}return()=>{d.removeEventListener(L,c),setTimeout(()=>{let t=new CustomEvent(M,F);d.addEventListener(M,u),d.dispatchEvent(t),t.defaultPrevented||$(e??document.body,{select:!0}),d.removeEventListener(M,u),H.remove(f)},0)}}},[d,c,u,f]);let x=g.useCallback(e=>{if(!a&&!r||f.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,s=document.activeElement;if(t&&s){var n;let t,r=e.currentTarget,[o,l]=[B(t=W(n=r),n),B(t.reverse(),n)];o&&l?e.shiftKey||s!==l?e.shiftKey&&s===o&&(e.preventDefault(),a&&$(l,{select:!0})):(e.preventDefault(),a&&$(o,{select:!0})):s===r&&e.preventDefault()}},[a,r,f.paused]);return(0,s.jsx)(C.div,{tabIndex:-1,...l,ref:m,onKeyDown:x})});function W(e){let t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function B(e,t){for(let a of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(a,{upTo:t}))return a}function $(e,{select:t=!1}={}){if(e&&e.focus){var a;let s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&(a=e)instanceof HTMLInputElement&&"select"in a&&t&&e.select()}}_.displayName="FocusScope";var H=(t=[],{add(e){let a=t[0];e!==a&&a?.pause(),(t=K(t,e)).unshift(e)},remove(e){t=K(t,e),t[0]?.resume()}});function K(e,t){let a=[...e],s=a.indexOf(t);return -1!==s&&a.splice(s,1),a}var z=e.i(664019),G=g.forwardRef((e,t)=>{let{container:a,...r}=e,[n,o]=g.useState(!1);(0,z.useLayoutEffect)(()=>o(!0),[]);let l=a||n&&globalThis?.document?.body;return l?S.default.createPortal((0,s.jsx)(C.div,{...r,ref:t}),l):null});G.displayName="Portal";var V=e.i(224285),U=e.i(648502),q=e.i(891246),J=e.i(73772),Z="Dialog",[Q,Y]=(0,j.createContextScope)(Z),[X,ee]=Q(Z),et=e=>{let{__scopeDialog:t,children:a,open:r,defaultOpen:n,onOpenChange:o,modal:l=!0}=e,d=g.useRef(null),i=g.useRef(null),[c=!1,u]=(0,k.useControllableState)({prop:r,defaultProp:n,onChange:o});return(0,s.jsx)(X,{scope:t,triggerRef:d,contentRef:i,contentId:(0,w.useId)(),titleId:(0,w.useId)(),descriptionId:(0,w.useId)(),open:c,onOpenChange:u,onOpenToggle:g.useCallback(()=>u(e=>!e),[u]),modal:l,children:a})};et.displayName=Z;var ea="DialogTrigger",es=g.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,n=ee(ea,a),o=(0,y.useComposedRefs)(t,n.triggerRef);return(0,s.jsx)(C.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":eN(n.open),...r,ref:o,onClick:(0,N.composeEventHandlers)(e.onClick,n.onOpenToggle)})});es.displayName=ea;var er="DialogPortal",[en,eo]=Q(er,{forceMount:void 0}),el=e=>{let{__scopeDialog:t,forceMount:a,children:r,container:n}=e,o=ee(er,t);return(0,s.jsx)(en,{scope:t,forceMount:a,children:g.Children.map(r,e=>(0,s.jsx)(V.Presence,{present:a||o.open,children:(0,s.jsx)(G,{asChild:!0,container:n,children:e})}))})};el.displayName=er;var ed="DialogOverlay",ei=g.forwardRef((e,t)=>{let a=eo(ed,e.__scopeDialog),{forceMount:r=a.forceMount,...n}=e,o=ee(ed,e.__scopeDialog);return o.modal?(0,s.jsx)(V.Presence,{present:r||o.open,children:(0,s.jsx)(ec,{...n,ref:t})}):null});ei.displayName=ed;var ec=g.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,n=ee(ed,a);return(0,s.jsx)(q.RemoveScroll,{as:A.Slot,allowPinchZoom:!0,shards:[n.contentRef],children:(0,s.jsx)(C.div,{"data-state":eN(n.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),eu="DialogContent",ep=g.forwardRef((e,t)=>{let a=eo(eu,e.__scopeDialog),{forceMount:r=a.forceMount,...n}=e,o=ee(eu,e.__scopeDialog);return(0,s.jsx)(V.Presence,{present:r||o.open,children:o.modal?(0,s.jsx)(em,{...n,ref:t}):(0,s.jsx)(ef,{...n,ref:t})})});ep.displayName=eu;var em=g.forwardRef((e,t)=>{let a=ee(eu,e.__scopeDialog),r=g.useRef(null),n=(0,y.useComposedRefs)(t,a.contentRef,r);return g.useEffect(()=>{let e=r.current;if(e)return(0,J.hideOthers)(e)},[]),(0,s.jsx)(ex,{...e,ref:n,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,N.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:(0,N.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,a=0===t.button&&!0===t.ctrlKey;(2===t.button||a)&&e.preventDefault()}),onFocusOutside:(0,N.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),ef=g.forwardRef((e,t)=>{let a=ee(eu,e.__scopeDialog),r=g.useRef(!1),n=g.useRef(!1);return(0,s.jsx)(ex,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||a.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let s=t.target;a.triggerRef.current?.contains(s)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),ex=g.forwardRef((e,t)=>{let{__scopeDialog:a,trapFocus:r,onOpenAutoFocus:n,onCloseAutoFocus:o,...l}=e,d=ee(eu,a),i=g.useRef(null),c=(0,y.useComposedRefs)(t,i);return(0,U.useFocusGuards)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:n,onUnmountAutoFocus:o,children:(0,s.jsx)(R,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":eN(d.open),...l,ref:c,onDismiss:()=>d.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eA,{titleId:d.titleId}),(0,s.jsx)(eC,{contentRef:i,descriptionId:d.descriptionId})]})]})}),eh="DialogTitle",eg=g.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,n=ee(eh,a);return(0,s.jsx)(C.h2,{id:n.titleId,...r,ref:t})});eg.displayName=eh;var eb="DialogDescription",ev=g.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,n=ee(eb,a);return(0,s.jsx)(C.p,{id:n.descriptionId,...r,ref:t})});ev.displayName=eb;var ej="DialogClose",ey=g.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,n=ee(ej,a);return(0,s.jsx)(C.button,{type:"button",...r,ref:t,onClick:(0,N.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});function eN(e){return e?"open":"closed"}ey.displayName=ej;var ew="DialogTitleWarning",[ek,eS]=(0,j.createContext)(ew,{contentName:eu,titleName:eh,docsSlug:"dialog"}),eA=({titleId:e})=>{let t=eS(ew),a=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
-
|
|
5
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return g.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},eC=({contentRef:e,descriptionId:t})=>{let a=eS("DialogDescriptionWarning"),s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${a.contentName}}.`;return g.useEffect(()=>{let a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},eI="AlertDialog",[eE,eD]=(0,j.createContextScope)(eI,[Y]),eT=Y(),eR=e=>{let{__scopeAlertDialog:t,...a}=e,r=eT(t);return(0,s.jsx)(et,{...r,...a,modal:!0})};eR.displayName=eI,g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,n=eT(a);return(0,s.jsx)(es,{...n,...r,ref:t})}).displayName="AlertDialogTrigger";var eO=e=>{let{__scopeAlertDialog:t,...a}=e,r=eT(t);return(0,s.jsx)(el,{...r,...a})};eO.displayName="AlertDialogPortal";var eP=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,n=eT(a);return(0,s.jsx)(ei,{...n,...r,ref:t})});eP.displayName="AlertDialogOverlay";var eL="AlertDialogContent",[eM,eF]=eE(eL),e_=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,children:r,...n}=e,o=eT(a),l=g.useRef(null),d=(0,y.useComposedRefs)(t,l),i=g.useRef(null);return(0,s.jsx)(ek,{contentName:eL,titleName:eW,docsSlug:"alert-dialog",children:(0,s.jsx)(eM,{scope:a,cancelRef:i,children:(0,s.jsxs)(ep,{role:"alertdialog",...o,...n,ref:d,onOpenAutoFocus:(0,N.composeEventHandlers)(n.onOpenAutoFocus,e=>{e.preventDefault(),i.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,s.jsx)(A.Slottable,{children:r}),(0,s.jsx)(eV,{contentRef:l})]})})})});e_.displayName=eL;var eW="AlertDialogTitle",eB=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,n=eT(a);return(0,s.jsx)(eg,{...n,...r,ref:t})});eB.displayName=eW;var e$="AlertDialogDescription",eH=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,n=eT(a);return(0,s.jsx)(ev,{...n,...r,ref:t})});eH.displayName=e$;var eK=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,n=eT(a);return(0,s.jsx)(ey,{...n,...r,ref:t})});eK.displayName="AlertDialogAction";var ez="AlertDialogCancel",eG=g.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...r}=e,{cancelRef:n}=eF(ez,a),o=eT(a),l=(0,y.useComposedRefs)(t,n);return(0,s.jsx)(ey,{...o,...r,ref:l})});eG.displayName=ez;var eV=({contentRef:e})=>{let t=`\`${eL}\` requires a description for the component to be accessible for screen reader users.
|
|
6
|
-
|
|
7
|
-
You can add a description to the \`${eL}\` by passing a \`${e$}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
8
|
-
|
|
9
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${eL}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
10
|
-
|
|
11
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return g.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},eU=e.i(260218),eq=e.i(949245);function eJ({...e}){return(0,s.jsx)(eR,{"data-slot":"alert-dialog",...e})}function eZ({...e}){return(0,s.jsx)(eO,{"data-slot":"alert-dialog-portal",...e})}function eQ({className:e,...t}){return(0,s.jsx)(eP,{"data-slot":"alert-dialog-overlay",className:(0,eq.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function eY({className:e,...t}){return(0,s.jsxs)(eZ,{children:[(0,s.jsx)(eQ,{}),(0,s.jsx)(e_,{"data-slot":"alert-dialog-content",className:(0,eq.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function eX({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,eq.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function e0({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,eq.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function e1({className:e,...t}){return(0,s.jsx)(eB,{"data-slot":"alert-dialog-title",className:(0,eq.cn)("text-lg font-semibold",e),...t})}function e2({className:e,...t}){return(0,s.jsx)(eH,{"data-slot":"alert-dialog-description",className:(0,eq.cn)("text-muted-foreground text-sm",e),...t})}function e5({className:e,...t}){return(0,s.jsx)(eK,{className:(0,eq.cn)((0,eU.buttonVariants)(),e),...t})}function e3({className:e,...t}){return(0,s.jsx)(eG,{className:(0,eq.cn)((0,eU.buttonVariants)({variant:"outline"}),e),...t})}var e4=e.i(524914);function e6({...e}){return(0,s.jsx)("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function e8({className:e,...t}){return(0,s.jsx)("ol",{"data-slot":"breadcrumb-list",className:(0,eq.cn)("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function e9({className:e,...t}){return(0,s.jsx)("li",{"data-slot":"breadcrumb-item",className:(0,eq.cn)("inline-flex items-center gap-1.5",e),...t})}function e7({asChild:e,className:t,...a}){let r=e?A.Slot:"a";return(0,s.jsx)(r,{"data-slot":"breadcrumb-link",className:(0,eq.cn)("hover:text-foreground transition-colors",t),...a})}function te({className:e,...t}){return(0,s.jsx)("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:(0,eq.cn)("text-foreground font-normal",e),...t})}function tt({children:e,className:t,...a}){return(0,s.jsx)("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:(0,eq.cn)("[&>svg]:size-3.5",t),...a,children:e??(0,s.jsx)(e4.ChevronRight,{})})}e.i(495566);var ta=e.i(889840),ts=e.i(638322),tr=e.i(620486);let tn="sleep";function to(e){return e.replace(/\/\/\.\.\//g,"//")}function tl(e){let t=e.split("//");return t.length>=3?t[t.length-1]:null}var td=e.i(479823),ti=e.i(241245);function tc({hasError:e,errorMessage:t}){return(0,s.jsx)("div",{className:"flex items-center gap-2",children:(0,s.jsxs)(ts.Tooltip,{children:[(0,s.jsx)(ts.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("div",{className:`w-2 h-2 rounded-full ${e?"bg-red-500":"bg-green-500 animate-pulse"}`}),(0,s.jsx)("span",{className:`text-xs $
|
|
12
|
-
hasError
|
|
13
|
-
? 'text-red-600 dark:text-red-400'
|
|
14
|
-
: 'text-muted-foreground'`,children:e?"Error":"Live"})]})}),(0,s.jsx)(ts.TooltipContent,{children:(0,s.jsx)("p",{children:e?`Error updating data: ${t}`:`Content updates every ${eq.LIVE_UPDATE_INTERVAL_MS/1e3} seconds`})})]})})}var tu=e.i(719402),tp=e.i(451675),tm=e.i(330974),tf=e.i(280998),tx=e.i(259280),th=e.i(356089),tg=e.i(562918),tb=e.i(93698);function tv(e){return"retrying"===e?"running":e}let tj={loopNode:function({data:e,selected:t}){return(0,s.jsxs)("div",{className:`relative ${e.className||""}`,style:{borderWidth:e.nodeStyle?.borderWidth??2,borderRadius:8,padding:12,width:220,borderStyle:"solid",backgroundColor:e.nodeStyle?.backgroundColor,borderColor:e.nodeStyle?.borderColor??"#9ca3af",opacity:e.nodeStyle?.opacity,boxShadow:t?"0 0 0 2px rgba(168, 85, 247, 0.5)":void 0},children:[e.label,(0,s.jsx)(tm.Handle,{type:"target",position:tf.Position.Top,className:"!bg-purple-500"}),(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Bottom,className:"!bg-purple-500"}),(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Left,id:"loop-out",className:"!bg-purple-500 !-left-1 !w-[6px] !h-[6px] !min-w-0 !min-h-0",style:{top:"30%"}}),(0,s.jsx)(tm.Handle,{type:"target",position:tf.Position.Left,id:"loop-in",className:"!bg-purple-500 !-left-1 !w-[6px] !h-[6px] !min-w-0 !min-h-0",style:{top:"70%"}})]})},parallelGroup:tb.ParallelGroupComponent,executionNode:function({data:e,selected:t}){let a="workflow_start"===e.nodeKind,r="workflow_end"===e.nodeKind;return(0,s.jsxs)("div",{className:`relative ${e.className||""}`,style:{borderWidth:e.nodeStyle?.borderWidth??2,borderRadius:8,padding:12,width:220,borderStyle:"solid",backgroundColor:e.nodeStyle?.backgroundColor,borderColor:e.nodeStyle?.borderColor??"#9ca3af",opacity:e.nodeStyle?.opacity,boxShadow:t?"0 0 0 2px rgba(59, 130, 246, 0.35)":void 0},children:[e.label,!a&&(0,s.jsx)(tm.Handle,{type:"target",position:tf.Position.Top,className:"!bg-muted"}),!r&&(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Bottom,className:"!bg-muted"})]})},diamondNode:function({data:e,selected:t}){return(0,s.jsxs)("div",{className:`relative flex items-center justify-center ${e.className||""}`,style:{width:160,height:160},children:[(0,s.jsx)("div",{style:{width:112,height:112,transform:"rotate(45deg)",borderWidth:2,borderStyle:"solid",borderRadius:4,backgroundColor:e.nodeStyle?.backgroundColor,borderColor:e.nodeStyle?.borderColor??"#ef4444",opacity:e.nodeStyle?.opacity,boxShadow:t?"0 0 0 2px rgba(239, 68, 68, 0.5)":void 0}}),(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-auto",style:{fontSize:11,fontWeight:600,padding:40},title:"string"==typeof e.label?e.label:void 0,children:(0,s.jsx)("span",{className:"text-center line-clamp-3 overflow-hidden",children:e.label})}),(0,s.jsx)(tm.Handle,{type:"target",position:tf.Position.Top,className:"!bg-red-500"}),(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Bottom,id:"bottom",className:"!bg-red-500"}),(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Left,id:"left",className:"!bg-red-500"}),(0,s.jsx)(tm.Handle,{type:"source",position:tf.Position.Right,id:"right",className:"!bg-red-500"})]})}},ty=(0,tb.createEdgeTypes)(tb.executionSelfLoopStyle);function tN(e,t,a){let r=(0,s.jsxs)("div",{className:"flex items-start gap-2 w-full overflow-hidden",children:[(0,s.jsx)("div",{className:"flex-shrink-0",children:(0,tb.getNodeIcon)(e.nodeKind,e.label)}),(0,s.jsx)("span",{className:"text-sm font-medium break-words whitespace-normal leading-tight flex-1 min-w-0",children:e.label})]});if(!a||0===a.length)return r;let n=a[a.length-1],o=a.length,l=o>1;return l||n.duration&&n.duration>0?(0,s.jsxs)("div",{className:"flex flex-col gap-1.5 w-full",children:[r,(0,s.jsxs)("div",{className:"flex flex-wrap gap-1 text-xs",children:[l&&(0,s.jsxs)(tg.Badge,{variant:"outline",className:"text-xs px-1.5 py-0 border-orange-500 text-orange-700 dark:text-orange-300",children:["↻ ",o,"x"]}),n.duration&&n.duration>0&&(0,s.jsxs)(tg.Badge,{variant:"secondary",className:"text-xs px-1.5 py-0 bg-black/10 dark:bg-white/15 border-0",children:["⏱ ",(0,th.formatDuration)(n.duration,!0)]})]})]}):r}let tw={...tb.LAYOUT,VERTICAL_SPACING:320};function tk(e,t){let{nodes:a,groupNodes:s}=(0,tb.calculateEnhancedLayout)(e,tw),r=new Map,n=new Map;for(let e of s)e.id.startsWith("group_")&&n.set(e.id,e.position);for(let e of a){let t=e.metadata?.parallelGroupId?`group_${e.metadata.parallelGroupId}`:null;t&&n.has(t)&&r.set(e.id,t)}let o=[];for(let e of s.filter(e=>e.id.startsWith("group_")))o.push({id:e.id,type:"parallelGroup",position:e.position,style:{...e.style,cursor:"grab",zIndex:-1},data:e.data,selectable:!0,draggable:!0});for(let e of a){let a=t?.nodeExecutions.get(e.id),s=function(e,t){let a=(0,tb.getNodeBackgroundColor)(e);if(!t||0===t.length)return{color:"hsl(var(--card-foreground))",backgroundColor:a,borderColor:"#9ca3af",opacity:.4};let s=t[t.length-1],r="#9ca3af",n=2;switch(s.status){case"completed":r="#22c55e";break;case"failed":r="#ef4444",n=3;break;case"running":r="#3b82f6",n=2;break;case"retrying":r="#f97316";break;case"cancelled":r="#eab308";break;case"pending":r="#9ca3af"}return{color:"hsl(var(--card-foreground))",backgroundColor:a,borderColor:r,borderWidth:n}}(e.data.nodeKind,a),l=t?.currentNode===e.id,d=!!e.metadata?.loopId,i=!!e.metadata?.loopIsAwait,c="conditional"===e.data.nodeKind,u=c?"diamondNode":d?"loopNode":"executionNode",p=r.get(e.id),m=e.position;if(p){let t=n.get(p);t&&(m={x:e.position.x-t.x,y:e.position.y-t.y})}let f=l?"animate-pulse-subtle":"";d?o.push({id:e.id,type:u,position:m,parentId:p,extent:p?"parent":void 0,expandParent:!0,data:{...e.data,label:tN(e.data,e.metadata,a),executions:a,isLoopNode:!0,isAwaitLoop:i,nodeStyle:s,className:f}}):c?o.push({id:e.id,type:u,position:m,parentId:p,extent:p?"parent":void 0,expandParent:!0,data:{...e.data,label:e.data.label,executions:a,nodeStyle:s,className:f}}):o.push({id:e.id,type:u,position:m,parentId:p,extent:p?"parent":void 0,expandParent:!0,data:{...e.data,label:tN(e.data,e.metadata,a),executions:a,nodeStyle:s,className:f},style:{width:220}})}return o}function tS(e,t){let{additionalEdges:a}=(0,tb.calculateEnhancedLayout)(e,tw),r=[...e.edges.map(e=>"loop"===e.type?{...e,id:`loop_back_${e.source}_${e.target}`,isOriginal:!0}:{...e,isOriginal:!0}),...a.map(e=>({...e,isOriginal:!1}))];return(0,tb.consolidateEdges)(r,e.nodes).map(e=>{let a;if("selfLoop"===e.type)return{id:e.id,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle,type:"selfLoop",label:e.label,markerEnd:{type:tf.MarkerType.ArrowClosed,width:12,height:12,color:"#a855f7"}};let r=t?.edgeTraversals.get(e.id);if(!r&&e.isConsolidated&&e.originalEdgeIds)for(let a of e.originalEdgeIds){let e=t?.edgeTraversals.get(a);if(e&&e.traversalCount>0){r=e;break}}let n=r&&r.traversalCount>0,o=!!t,l=r?.timings.length?r.timings.reduce((e,t)=>e+t,0)/r.timings.length:void 0,d="bezier",i=e.label,c=!1;switch(e.type){case"parallel":d="smoothstep",a="4,4",i=void 0;break;case"loop":d="step",a="8,4";break;case"conditional":d="smoothstep",a="8,4",c=!0;break;default:d="bezier"}let u=n?"#22c55e":"#6b7280",p=n?void 0:a,m=c?"#ffffff":"#6b7280",f=c?"#374151":"#f3f4f6",x=c?"#4b5563":"#d1d5db";return{id:e.id,source:e.source,target:e.target,type:d,animated:n&&t?.status==="running",label:r&&r.traversalCount>1?(0,s.jsxs)("div",{className:"flex flex-col items-center gap-0.5",children:[(0,s.jsxs)(tg.Badge,{variant:"secondary",className:"text-xs px-1.5 py-0",children:[r.traversalCount,"×"]}),l&&l>0&&(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["~",(0,th.formatDuration)(l,!0)]})]}):i,labelStyle:{fill:m,fontWeight:500,fontSize:"11px"},labelBgStyle:{fill:f,fillOpacity:.95,stroke:x,strokeWidth:1},labelBgPadding:[4,6],labelBgBorderRadius:4,markerEnd:{type:tf.MarkerType.ArrowClosed,width:n?14:10,height:n?14:10,color:u},style:{strokeWidth:n?2.5:1,stroke:u,opacity:o&&!n?.35:1,strokeDasharray:p}}})}function tA({selectedNode:e,env:t,onClose:a}){let{node:r,executions:n,stepId:o,runId:d}=e,i=n[n.length-1],c=n.length>1,{data:u,loading:p}=(0,l.useWorkflowResourceData)(t??{},"step",o??"",{runId:d}),m=u?.input??i?.input,f=u?.output??i?.output,h=u?.error??i?.error;return(0,s.jsxs)("div",{className:"h-full flex flex-col bg-background border-l",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b flex-none",children:[(0,s.jsx)("span",{className:"text-xs font-medium truncate flex-1",title:r.data.label,children:r.data.label}),(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-none",children:[i?.duration!==void 0&&i.duration>0&&(0,s.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:(0,th.formatDuration)(i.duration)}),(0,s.jsx)("div",{className:"w-px h-4 bg-border"}),(0,s.jsx)("button",{type:"button",onClick:a,className:"p-1 rounded hover:bg-muted transition-colors","aria-label":"Close panel",children:(0,s.jsx)(tx.X,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto p-3 min-h-0",children:[(0,s.jsxs)("div",{className:"flex flex-col divide-y rounded-lg border overflow-hidden mb-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"type"}),(0,s.jsx)("span",{className:"text-[11px] font-mono",children:r.data.nodeKind})]}),i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"status"}),(0,s.jsx)(tp.StatusBadge,{status:tv(i.status)})]}),void 0!==i.duration&&i.duration>0&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"duration"}),(0,s.jsx)("span",{className:"text-[11px] font-mono",children:(0,th.formatDuration)(i.duration)})]}),c&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"attempts"}),(0,s.jsx)("span",{className:"text-[11px] font-mono",children:n.length})]}),i.startedAt&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"startedAt"}),(0,s.jsx)("span",{className:"text-[11px] font-mono",children:new Date(i.startedAt).toLocaleString()})]}),i.completedAt&&(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"completedAt"}),(0,s.jsx)("span",{className:"text-[11px] font-mono",children:new Date(i.completedAt).toLocaleString()})]})]})]}),p&&o&&(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-3",children:[(0,s.jsx)(x.Loader2,{className:"h-3 w-3 animate-spin"}),(0,s.jsx)("span",{children:"Loading step data..."})]}),void 0!==m&&(0,s.jsxs)("details",{className:"group mb-3",children:[(0,s.jsxs)("summary",{className:"cursor-pointer rounded-md border px-2.5 py-1.5 text-xs hover:brightness-95 bg-muted/50",children:[(0,s.jsx)("span",{className:"font-medium",children:"Input"}),(0,s.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",Array.isArray(m)?m.length:1," args)"]})]}),(0,s.jsxs)("div",{className:"relative pl-6 mt-3",children:[(0,s.jsx)("div",{className:"absolute left-3 -top-3 w-px h-3 bg-border"}),(0,s.jsx)("div",{className:"absolute left-3 top-0 w-3 h-3 border-l border-b rounded-bl-lg border-border"}),(0,s.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border p-2.5 bg-muted/30 max-h-64 overflow-y-auto",children:(0,s.jsx)("code",{children:JSON.stringify(m,null,2)})})]})]}),void 0!==f&&(0,s.jsxs)("details",{className:"group mb-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer rounded-md border px-2.5 py-1.5 text-xs hover:brightness-95 bg-muted/50",children:(0,s.jsx)("span",{className:"font-medium",children:"Output"})}),(0,s.jsxs)("div",{className:"relative pl-6 mt-3",children:[(0,s.jsx)("div",{className:"absolute left-3 -top-3 w-px h-3 bg-border"}),(0,s.jsx)("div",{className:"absolute left-3 top-0 w-3 h-3 border-l border-b rounded-bl-lg border-border"}),(0,s.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border p-2.5 bg-muted/30 max-h-64 overflow-y-auto",children:(0,s.jsx)("code",{children:JSON.stringify(f,null,2)})})]})]}),h&&(0,s.jsxs)("details",{className:"group mb-3",open:!0,children:[(0,s.jsx)("summary",{className:"cursor-pointer rounded-md border border-red-300 bg-red-50 dark:bg-red-950/20 px-2.5 py-1.5 text-xs hover:brightness-95",children:(0,s.jsx)("span",{className:"font-medium text-red-600 dark:text-red-400",children:"Error"})}),(0,s.jsxs)("div",{className:"relative pl-6 mt-3",children:[(0,s.jsx)("div",{className:"absolute left-3 -top-3 w-px h-3 bg-red-300"}),(0,s.jsx)("div",{className:"absolute left-3 top-0 w-3 h-3 border-l border-b rounded-bl-lg border-red-300"}),(0,s.jsx)("pre",{className:"text-[11px] overflow-x-auto rounded-md border border-red-200 p-2.5 bg-red-50 dark:bg-red-950/20 text-red-700 dark:text-red-300 whitespace-pre-wrap max-h-64 overflow-y-auto",children:(0,s.jsx)("code",{children:"object"==typeof h?JSON.stringify(h,null,2):String(h)})})]})]}),c&&(0,s.jsxs)("details",{className:"group",children:[(0,s.jsxs)("summary",{className:"cursor-pointer rounded-md border px-2.5 py-1.5 text-xs hover:brightness-95 bg-muted/50",children:[(0,s.jsx)("span",{className:"font-medium",children:"Attempt History"}),(0,s.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",n.length," attempts)"]})]}),(0,s.jsxs)("div",{className:"relative pl-6 mt-3",children:[(0,s.jsx)("div",{className:"absolute left-3 -top-3 w-px h-3 bg-border"}),(0,s.jsx)("div",{className:"absolute left-3 top-0 w-3 h-3 border-l border-b rounded-bl-lg border-border"}),(0,s.jsx)("div",{className:"flex flex-col divide-y rounded-md border overflow-hidden",children:n.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5 text-[11px]",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:["Attempt ",e.attemptNumber]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(tp.StatusBadge,{status:tv(e.status)}),void 0!==e.duration&&e.duration>0&&(0,s.jsx)("span",{className:"font-mono text-muted-foreground",children:(0,th.formatDuration)(e.duration)})]})]},e.attemptNumber))})]})]})]})]})}function tC({workflow:e,execution:t,env:a,onNodeClick:r}){let[n,o]=(0,g.useState)(null),l=(0,g.useMemo)(()=>tk(e,t),[e,t]),d=(0,g.useMemo)(()=>tS(e,t),[e,t]),[i,c,u]=(0,tm.useNodesState)(l),[p,m,f]=(0,tm.useEdgesState)(d);(0,g.useEffect)(()=>{c(a=>{let s=tk(e,t),r=new Map(a.map(e=>[e.id,e.position]));return s.map(e=>({...e,position:r.get(e.id)??e.position}))}),m(tS(e,t))},[e,t,c,m]);let x=(0,g.useCallback)((a,s)=>{let n=e.nodes.find(e=>e.id===s.id);if(n){let e=s.data.executions||[],a=e[e.length-1];o({nodeId:s.id,node:n,executions:e,stepId:a?.stepId,runId:t?.runId}),r&&e.length>0&&r(s.id,e)}},[e.nodes,t?.runId,r]),h=(0,g.useCallback)(()=>{o(null)},[]);return(0,s.jsxs)("div",{className:"h-full w-full border rounded-lg bg-background relative overflow-hidden flex",children:[(0,s.jsx)("div",{className:"h-full flex-1 min-w-0",style:{width:n?"calc(100% - 320px)":"100%"},children:(0,s.jsxs)(tm.ReactFlow,{nodes:i,edges:p,onNodesChange:u,onEdgesChange:f,onNodeClick:x,nodeTypes:tj,edgeTypes:ty,fitView:!0,minZoom:.1,maxZoom:2,defaultViewport:{x:0,y:0,zoom:1},proOptions:{hideAttribution:!0},children:[(0,s.jsx)(tm.Background,{}),(0,s.jsx)(tm.Controls,{}),(0,s.jsx)(tm.Panel,{position:"top-left",className:"bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 border rounded-lg p-2 text-xs",children:(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("div",{className:"font-semibold text-[10px] text-muted-foreground mb-1",children:"Status"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-6 h-4 rounded border-2 border-green-500 bg-background"}),(0,s.jsx)("span",{children:"Completed"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-6 h-4 rounded border-2 border-red-500 bg-background"}),(0,s.jsx)("span",{children:"Failed"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-6 h-4 rounded border-2 border-blue-500 bg-background"}),(0,s.jsx)("span",{children:"Running"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-6 h-4 rounded border-2 border-yellow-500 bg-background"}),(0,s.jsx)("span",{children:"Cancelled"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 opacity-50",children:[(0,s.jsx)("div",{className:"w-6 h-4 rounded border-2 border-gray-400 bg-background"}),(0,s.jsx)("span",{children:"Pending"})]})]})}),t&&(0,s.jsxs)(tm.Panel,{position:"top-right",className:"bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 border rounded-lg p-3 text-xs space-y-1.5",children:[(0,s.jsx)("div",{className:"font-semibold text-sm",children:"Execution"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Status:"}),(0,s.jsx)(tg.Badge,{variant:"completed"===t.status?"default":"failed"===t.status?"destructive":"cancelled"===t.status?"outline":"secondary",className:"text-xs",children:t.status})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Progress:"}),(0,s.jsxs)("span",{className:"font-mono",children:[t.executionPath.length," / ",e.nodes.length]})]})]})]})}),n&&(0,s.jsx)("div",{className:"h-full flex-none",style:{width:320},children:(0,s.jsx)(tA,{selectedNode:n,env:a,onClose:h})})]})}var tI=e.i(708341),tE=e.i(613087);function tD({config:e,run:t,allSteps:a,allEvents:r,env:n}){let{manifest:o,loading:l,error:d}=(0,td.useWorkflowGraphManifest)(e),i=(0,g.useMemo)(()=>o&&t.workflowName?o.workflows[t.workflowName]??null:null,[o,t.workflowName]),u=(0,g.useMemo)(()=>i&&t.runId?function(e,t,a,s){let r,n,o=new Map,l=[];console.log("[Graph Mapper] Mapping run to execution:",{runId:e.runId,workflowName:e.workflowName,graphNodes:s.nodes.length,stepsCount:t.length}),(n=s.nodes.find(e=>"workflow_start"===e.data.nodeKind))&&(l.push(n.id),o.set(n.id,[{nodeId:n.id,attemptNumber:1,status:"completed",startedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0,completedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0}]));let d=[...t].sort((e,t)=>new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime());console.log("[Graph Mapper] Sorted steps:",d.map(e=>({stepId:e.stepId,stepName:e.stepName,attempt:e.attempt,status:e.status,createdAt:e.createdAt})));let{byStepId:i,byFunctionName:c,primitivesByLabel:u,agentNodes:p,toolNodes:m}=function(e){let t=new Map,a=new Map,s=new Map,r=[],n=new Map;for(let o of e){if(o.data.stepId){let e=to(o.data.stepId),s=t.get(e)||[];s.push(o),t.set(e,s);let r=tl(e);if(r){let e=a.get(r)||[];e.push(o),a.set(r,e)}}if("primitive"===o.data.nodeKind){let e=o.data.label,t=s.get(e)||[];t.push(o),s.set(e,t)}if("agent"===o.data.nodeKind&&r.push(o),"tool"===o.data.nodeKind){let e=o.data.label.replace(/ \(tool\)$/,""),t=n.get(e)||[];if(t.push(o),n.set(e,t),o.data.stepId){let e=tl(to(o.data.stepId));if(e){let t=n.get(e)||[];t.includes(o)||(t.push(o),n.set(e,t))}}}}return{byStepId:t,byFunctionName:a,primitivesByLabel:s,agentNodes:r,toolNodes:n}}(s.nodes);console.log("[Graph Mapper] Graph nodes by stepId:",{allGraphNodes:s.nodes.map(e=>({id:e.id,stepId:e.data.stepId,normalizedStepId:e.data.stepId?to(e.data.stepId):void 0,nodeKind:e.data.nodeKind})),nodesByStepId:Array.from(i.entries()).map(([e,t])=>({stepId:e,nodeIds:t.map(e=>e.id)}))});let f=new Map,x=[],h=null,g=null;for(let e=0;e<=d.length;e++){let t=d[e];if(t&&t.stepId===h)x.push(t);else{if(x.length>0&&g){let e=function(e,t,a,s,r,n,o){let l=to(t),d=r.get(l)||0;r.set(l,d+1);let i=a.get(l)||[],c="step-id";if(0===i.length){let e=tl(l);e&&(i=s.get(e)||[],c="function-name")}let u=1===i.length?i[0]:i[d];if(console.log("[Graph Mapper] Processing step group:",{stepName:t,normalizedStepName:l,attempts:e.length,occurrenceIndex:d,totalNodesWithStepId:i.length,selectedNode:u?.id,allNodesWithStepId:i.map(e=>e.id),matchStrategy:c,strategy:1===i.length?"single-node-multiple-invocations":"occurrence-based"}),!u)return;let p=e.map((t,a)=>(function(e,t,a,s){let r;switch(e.status){case"completed":r="completed";break;case"failed":r=a<s-1?"retrying":"failed";break;case"running":r="running";break;case"cancelled":r="cancelled";break;default:r="pending"}let n=e.completedAt&&e.startedAt?new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime():void 0;return{nodeId:t,stepId:e.stepId,attemptNumber:e.attempt,status:r,startedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0,completedAt:e.completedAt?new Date(e.completedAt).toISOString():void 0,duration:n,input:e.input,output:e.output,error:e.error?{message:e.error.message,stack:e.error.stack||""}:void 0}})(t,u.id,a,e.length));if(1===i.length){let e=n.get(u.id)||[];n.set(u.id,[...e,...p])}else n.set(u.id,p);return o.includes(u.id)||o.push(u.id),"running"===p[p.length-1].status?u.id:void 0}(x,g,i,c,f,o,l);e&&(r=e)}t&&(x=[t],h=t.stepId,g=t.stepName)}}let b=function(e,t,a,s){let r,n=new Map,o=new Map;for(let t of e){if(!t.correlationId)continue;let e=o.get(t.correlationId)||[];e.push(t),o.set(t.correlationId,e)}let l=t.get(tn)||[],d=new Set;for(let t of e)"wait_created"===t.eventType&&t.correlationId&&d.add(t.correlationId);for(let e of Array.from(d).sort((e,t)=>{let a=o.get(e)||[],s=o.get(t)||[],r=a.find(e=>"wait_created"===e.eventType)?.createdAt,n=s.find(e=>"wait_created"===e.eventType)?.createdAt;return r&&n?new Date(r).getTime()-new Date(n).getTime():0})){let t=o.get(e)||[],d=t.find(e=>"wait_created"===e.eventType),i=t.find(e=>"wait_completed"===e.eventType);if(!d)continue;let c=n.get(tn)||0;n.set(tn,c+1);let u=1===l.length?l[0]:l[c];if(!u)continue;let p="running";i&&(p="completed");let m=new Date(d.createdAt).toISOString(),f=i?new Date(i.createdAt).toISOString():void 0,x=i?new Date(i.createdAt).getTime()-new Date(d.createdAt).getTime():void 0,h={nodeId:u.id,attemptNumber:1,status:p,startedAt:m,completedAt:f,duration:x},g=a.get(u.id)||[];a.set(u.id,[...g,h]),s.includes(u.id)||s.push(u.id),"running"===p&&(r=u.id)}let i=[...t.get("createHook")||[],...t.get("createWebhook")||[]],c=new Set;for(let t of e)"hook_created"===t.eventType&&t.correlationId&&c.add(t.correlationId);let u=Array.from(c).sort((e,t)=>{let a=o.get(e)||[],s=o.get(t)||[],r=a.find(e=>"hook_created"===e.eventType)?.createdAt,n=s.find(e=>"hook_created"===e.eventType)?.createdAt;return r&&n?new Date(r).getTime()-new Date(n).getTime():0}),p=0;for(let e of u){let t=(o.get(e)||[]).find(e=>"hook_created"===e.eventType);if(!t)continue;let r=1===i.length?i[0]:i[p];if(p++,!r)continue;let n=new Date(t.createdAt).toISOString(),l=new Date(t.createdAt).toISOString(),d={nodeId:r.id,attemptNumber:1,status:"completed",startedAt:n,completedAt:l,duration:0},c=a.get(r.id)||[];a.set(r.id,[...c,d]),s.includes(r.id)||s.push(r.id)}let m=t.get("awaitWebhook")||[],f=new Set;for(let t of e)"hook_received"===t.eventType&&t.correlationId&&f.add(t.correlationId);let x=0;for(let e of u){let t,r,n,l=1===m.length?m[0]:m[x];if(x++,!l)continue;let d=o.get(e)||[],i=d.find(e=>"hook_created"===e.eventType),c=d.find(e=>"hook_received"===e.eventType),u=0;c?(t="completed",r=i?new Date(i.createdAt).toISOString():new Date(c.createdAt).toISOString(),u=new Date(n=new Date(c.createdAt).toISOString()).getTime()-new Date(r).getTime()):i?(t="running",r=new Date(i.createdAt).toISOString()):t="pending";let p={nodeId:l.id,attemptNumber:1,status:t,startedAt:r,completedAt:n,duration:u},f=a.get(l.id)||[];a.set(l.id,[...f,p]),s.includes(l.id)||s.push(l.id)}return r}(a,u,o,l);b&&(r=b),function(e,t,a,s,r,n,o){let l="pending";for(let t of("completed"===e.status?l="completed":"failed"===e.status?l="failed":"running"===e.status&&(l="running"),a)){let a={nodeId:t.id,attemptNumber:1,status:l,startedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0,completedAt:e.completedAt&&("completed"===l||"failed"===l)?new Date(e.completedAt).toISOString():void 0};r.set(t.id,[a]),n.includes(t.id)||n.push(t.id)}for(let e of t){let t,a=tl(e.stepName);if(!a)continue;let o=s.get(a);if(!o||0===o.length)continue;let l=o[0];switch(e.status){case"completed":t="completed";break;case"failed":t="failed";break;case"running":t="running";break;case"cancelled":t="cancelled";break;default:t="pending"}let d=e.completedAt&&e.startedAt?new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime():void 0,i={nodeId:l.id,stepId:e.stepId,attemptNumber:e.attempt,status:t,startedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0,completedAt:e.completedAt?new Date(e.completedAt).toISOString():void 0,duration:d,input:e.input,output:e.output,error:e.error},c=r.get(l.id)||[];r.set(l.id,[...c,i]),n.includes(l.id)||n.push(l.id)}for(let t of o){let a=t.metadata?.isToolsCollection===!0;if("tool"===t.data.nodeKind&&a&&!r.has(t.id)){let a={nodeId:t.id,attemptNumber:1,status:l,startedAt:e.startedAt?new Date(e.startedAt).toISOString():void 0,completedAt:e.completedAt&&("completed"===l||"failed"===l)?new Date(e.completedAt).toISOString():void 0};r.set(t.id,[a]),n.includes(t.id)||n.push(t.id)}}}(e,d,p,m,o,l,s.nodes),function(e,t,a,s){let r=e.nodes.filter(e=>"conditional"===e.data.nodeKind),n=new Map;for(let t of e.nodes){let e=t.metadata?.conditionalId;if(e){let a=n.get(e)||{thenNodes:[],elseNodes:[]};t.metadata?.conditionalBranch==="Then"?a.thenNodes.push(t):t.metadata?.conditionalBranch==="Else"&&a.elseNodes.push(t),n.set(e,a)}}for(let e of r){let r=e.id.match(/^(cond_\d+)_node$/);if(!r)continue;let o=r[1],l=n.get(o);if(!l)continue;let d=l.thenNodes.some(e=>t.has(e.id)),i=l.elseNodes.some(e=>t.has(e.id));if(d||i){let r=[...l.thenNodes,...l.elseNodes];if(!t.has(e.id)){let a;for(let e of r){let s=t.get(e.id);if(s&&s.length>0){let e=s[0];e.startedAt&&(!a||e.startedAt<a)&&(a=e.startedAt)}}let n=s.startedAt?new Date(s.startedAt).toISOString():void 0,o={nodeId:e.id,attemptNumber:1,status:"completed",startedAt:a||n,completedAt:a||n};t.set(e.id,[o])}if(!a.includes(e.id)){let t=r.map(e=>a.indexOf(e.id)).filter(e=>e>=0);if(t.length>0){let s=Math.min(...t);s>=0&&s<a.length?a.splice(s,0,e.id):a.push(e.id)}else a.push(e.id)}}}}(s,o,l,e),function(e,t,a,s){let r,n=t.nodes.find(e=>"workflow_end"===e.data.nodeKind);if(!(!n||a.includes(n.id))){switch(e.status){case"completed":r="completed";break;case"failed":r="failed";break;case"cancelled":r="cancelled";break;case"running":r="running";break;case"paused":r="pending";break;default:return}a.push(n.id),s.set(n.id,[{nodeId:n.id,attemptNumber:1,status:r,startedAt:e.completedAt?new Date(e.completedAt).toISOString():void 0,completedAt:e.completedAt?new Date(e.completedAt).toISOString():void 0}])}}(e,s,l,o);let v=function(e,t,a){let s=new Map,r=new Set(e),n=new Map;for(let e of t.nodes){let t=e.metadata?.parallelGroupId;if(t){let a=n.get(t)||{nodes:[]};a.nodes.push(e),a.method=e.metadata?.parallelMethod,n.set(t,a)}}let o=new Map;for(let[e,t]of n)if("race"===t.method){let s,r;for(let e of t.nodes){let t=a.get(e.id);if(t){for(let a of t)if("completed"===a.status&&a.completedAt){let t=new Date(a.completedAt);(!r||t<r)&&(r=t,s=e.id)}}}s&&o.set(e,s)}let l=e=>{let t=s.get(e.id);t?t.traversalCount++:s.set(e.id,{edgeId:e.id,traversalCount:1,timings:[]})};for(let e of t.edges){let a=t.nodes.find(t=>t.id===e.source),s=t.nodes.find(t=>t.id===e.target);if(!a||!s)continue;let n=r.has(e.source),d=r.has(e.target);if(!n&&!d)continue;if("conditional"===e.type){n&&d&&l(e);continue}let i=a.metadata?.parallelGroupId,c=a.metadata?.parallelMethod;i&&"race"===c?o.get(i)===e.source&&d&&l(e):n&&d?l(e):n&&"parallel"===e.type&&d&&l(e)}return s}(l,s,o),j={runId:e.runId,status:e.status,nodeExecutions:o,edgeTraversals:v,currentNode:r,executionPath:l};return console.log("[Graph Mapper] Mapping complete:",{executionPath:l,nodeExecutionsCount:o.size,nodeExecutions:Array.from(o.entries()).map(([e,t])=>({nodeId:e,executionCount:t.length,latestStatus:t[t.length-1]?.status}))}),j}(t,a||[],r||[],i):null,[i,t,a,r]);return l?(0,s.jsxs)("div",{className:"flex items-center justify-center w-full h-full",children:[(0,s.jsx)(x.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,s.jsx)("span",{className:"ml-4 text-muted-foreground",children:"Loading workflow graph..."})]}):d?(0,s.jsx)("div",{className:"flex items-center justify-center w-full h-full p-4",children:(0,s.jsxs)(v.Alert,{variant:"destructive",className:"max-w-lg",children:[(0,s.jsx)(c.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(v.AlertTitle,{children:"Error Loading Workflow Graph"}),(0,s.jsx)(v.AlertDescription,{children:d.message})]})}):i?(0,s.jsx)(tC,{workflow:i,execution:u||void 0,env:n}):(0,s.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,s.jsxs)(v.Alert,{className:"max-w-lg",children:[(0,s.jsx)(c.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(v.AlertTitle,{children:"Workflow Graph Not Found"}),(0,s.jsx)(v.AlertDescription,{children:"Could not find the workflow graph for this run. The workflow may have been deleted or the graph manifest may need to be regenerated."})]})})}function tT({config:e,runId:t,selectedId:a}){let r=(0,n.useRouter)(),p=(0,n.useSearchParams)(),[j,y]=(0,g.useState)(!1),[N,w]=(0,g.useState)(!1),[k,S]=(0,g.useState)(!1),[A,C]=(0,g.useState)(!1),I=(0,g.useMemo)(()=>(0,tr.worldConfigToEnvMap)(e),[e]),E=p.get("tab")||"trace",D=p.get("streamId"),T="1"===p.get("debug"),R=(0,g.useCallback)(e=>{let t=new URLSearchParams(p.toString());for(let[a,s]of Object.entries(e))null===s?t.delete(a):t.set(a,s);r.push(`?${t.toString()}`,{scroll:!1})},[r,p]),O=(0,g.useCallback)(e=>{"trace"===e||"graph"===e?R({tab:e,streamId:null}):R({tab:e})},[R]),P=(0,g.useCallback)(e=>{R({streamId:e})},[R]),L=(0,g.useCallback)(e=>{R({tab:"streams",streamId:e})},[R]),M="local"===e.backend,{run:F,steps:_,hooks:W,events:B,loading:$,auxiliaryDataLoading:H,error:K,update:z}=(0,l.useWorkflowTraceViewerData)(I,t,{live:!0}),G=F??{},{streams:V,loading:U,error:q}=(0,l.useWorkflowStreams)(I,t),J=async()=>{if(!j)try{y(!0),S(!1),await (0,l.cancelRun)(I,t),await z(),b.toast.success("Run cancelled successfully")}catch(e){console.error("Failed to cancel run:",e),b.toast.error("Failed to cancel run",{description:e instanceof Error?e.message:"An unknown error occurred"})}finally{y(!1)}},Z=async()=>{if(!N)try{w(!0),C(!1);let t=await (0,l.recreateRun)(I,G.runId);b.toast.success("New run started successfully",{description:`Run ID: ${t}`}),r.push((0,tr.buildUrlWithConfig)(`/run/${t}`,e))}catch(e){console.error("Failed to re-run workflow:",e),b.toast.error("Failed to start new run",{description:e instanceof Error?e.message:"An unknown error occurred"})}finally{w(!1),C(!1)}};if(K&&!F)return(0,s.jsxs)(v.Alert,{variant:"destructive",className:"m-4",children:[(0,s.jsx)(c.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(v.AlertTitle,{children:"Error loading workflow run"}),(0,s.jsx)(v.AlertDescription,{children:K.message})]});let Q=(0,o.parseWorkflowName)(G.workflowName)?.shortName;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eJ,{open:k,onOpenChange:S,children:(0,s.jsxs)(eY,{children:[(0,s.jsxs)(eX,{children:[(0,s.jsx)(e1,{children:"Cancel Workflow Run?"}),(0,s.jsx)(e2,{children:"This will stop the workflow execution immediately, and no further steps will be executed. Partial workflow execution may occur. Are you sure you want to cancel the run?"})]}),(0,s.jsxs)(e0,{children:[(0,s.jsx)(e3,{children:"Keep Running"}),(0,s.jsx)(e5,{onClick:J,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Run"})]})]})}),(0,s.jsx)(eJ,{open:A,onOpenChange:C,children:(0,s.jsxs)(eY,{children:[(0,s.jsxs)(eX,{children:[(0,s.jsx)(e1,{children:"Replay Run?"}),(0,s.jsx)(e2,{children:"This can potentially re-run code that is meant to only execute once. Are you sure you want to replay the workflow run?"})]}),(0,s.jsxs)(e0,{children:[(0,s.jsx)(e3,{children:"Cancel"}),(0,s.jsx)(e5,{onClick:Z,children:"Replay Run"})]})]})}),(0,s.jsxs)("div",{className:"flex flex-col h-[calc(100vh-97px)]",children:[(0,s.jsxs)("div",{className:"flex-none space-y-4",children:[(0,s.jsx)(e6,{children:(0,s.jsxs)(e8,{children:[(0,s.jsx)(e9,{children:(0,s.jsx)(e7,{asChild:!0,children:(0,s.jsx)(h.default,{href:(0,tr.buildUrlWithConfig)("/",e),children:"Runs"})})}),(0,s.jsx)(tt,{}),(0,s.jsx)(e9,{children:(0,s.jsx)(te,{className:"font-mono text-xs",children:t})})]})}),(0,s.jsxs)("div",{className:"space-y-4 p-6 border rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("h1",{className:"text-xl font-semibold",children:Q||(0,s.jsx)(tE.Skeleton,{className:"w-[260px] h-[28px]"})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)(tc,{hasError:!1,errorMessage:""}),(0,s.jsx)(tI.RunActionsButtons,{env:I,runId:t,runStatus:G.status,events:B,eventsLoading:H,loading:$,onRerunClick:()=>{C(!0)},onCancelClick:()=>{S(!0)},callbacks:{onSuccess:z},showDebugActions:T})]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-8",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Status"}),G.status?(0,s.jsx)(tp.StatusBadge,{status:G.status,context:G}):(0,s.jsx)(tE.Skeleton,{className:"w-[55px] h-[24px]"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Duration"}),(0,s.jsx)("div",{className:"text-xs",children:G.runId?G.startedAt?(()=>{let e=Math.floor(((G.completedAt?new Date(G.completedAt).getTime():Date.now())-new Date(G.startedAt).getTime())/1e3);if(e<60)return`${e}s`;let t=Math.floor(e/60),a=e%60;if(t<60)return a>0?`${t}m ${a}s`:`${t}m`;let s=Math.floor(t/60),r=t%60;return r>0?`${s}h ${r}m`:`${s}h`})():"-":(0,s.jsx)(tE.Skeleton,{className:"w-[60px] h-[20px]"})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Run ID"}),G.runId?(0,s.jsx)(ti.CopyableText,{text:G.runId,children:(0,s.jsx)("div",{className:"text-xs mt-0.5 font-mono",children:G.runId})}):(0,s.jsx)(tE.Skeleton,{className:"w-[280px] h-[20px]"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Queued"}),G.createdAt?(0,s.jsx)("div",{className:"text-xs",children:(0,s.jsx)(tu.RelativeTime,{date:G.createdAt})}):(0,s.jsx)(tE.Skeleton,{className:"w-[110px] h-[20px]"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Started"}),(0,s.jsx)("div",{className:"text-xs",children:G.runId?G.startedAt?(0,s.jsx)(tu.RelativeTime,{date:G.startedAt}):"-":(0,s.jsx)(tE.Skeleton,{className:"w-[110px] h-[20px]"})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Completed"}),(0,s.jsx)("div",{className:"text-xs",children:G.runId?G.completedAt?(0,s.jsx)(tu.RelativeTime,{date:G.completedAt}):"-":(0,s.jsx)(tE.Skeleton,{className:"w-[110px] h-[20px]"})})]}),null!=G.expiredAt&&(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)(ts.Tooltip,{children:[(0,s.jsx)(ts.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)("div",{className:"text-xs text-muted-foreground cursor-help flex items-center gap-1",children:["Expired",(0,s.jsx)(m,{className:"w-3 h-3"})]})}),(0,s.jsx)(ts.TooltipContent,{children:(0,s.jsx)("p",{children:"The storage data for this run has expired and is no longer available."})})]}),(0,s.jsx)("div",{className:"text-xs",children:(0,s.jsx)(tu.RelativeTime,{date:G.expiredAt})})]})]})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex-1 flex flex-col min-h-0",children:[(0,s.jsxs)(ta.Tabs,{value:E,onValueChange:e=>O(e),className:"flex-1 flex flex-col min-h-0",children:[(0,s.jsxs)(ta.TabsList,{className:"mb-4 flex-none",children:[(0,s.jsxs)(ta.TabsTrigger,{value:"trace",className:"gap-2",children:[(0,s.jsx)(f,{className:"h-4 w-4"}),"Trace"]}),M&&(0,s.jsxs)(ta.TabsTrigger,{value:"graph",className:"gap-2",children:[(0,s.jsx)(u.GitBranch,{className:"h-4 w-4"}),"Graph"]}),(0,s.jsxs)(ta.TabsTrigger,{value:"streams",className:"gap-2",children:[(0,s.jsx)(f,{className:"h-4 w-4"}),"Streams"]})]}),(0,s.jsx)(ta.TabsContent,{value:"trace",className:"mt-0 flex-1 min-h-0",children:(0,s.jsx)("div",{className:"h-full",children:(0,s.jsx)(i.WorkflowTraceViewer,{error:K,steps:_,events:B,hooks:W,env:I,run:G,isLoading:$,onStreamClick:L})})}),(0,s.jsx)(ta.TabsContent,{value:"streams",className:"mt-0 flex-1 min-h-0",children:(0,s.jsxs)("div",{className:"h-full flex gap-4",children:[(0,s.jsxs)("div",{className:"w-64 flex-shrink-0 border rounded-lg overflow-hidden",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-background-100)"},children:[(0,s.jsxs)("div",{className:"px-3 py-2 border-b text-xs font-medium",style:{borderColor:"var(--ds-gray-300)",color:"var(--ds-gray-900)"},children:["Streams (",V.length,")"]}),(0,s.jsx)("div",{className:"overflow-auto max-h-[calc(100vh-400px)]",children:U?(0,s.jsx)("div",{className:"p-4 flex items-center justify-center",children:(0,s.jsx)(x.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):q?(0,s.jsx)("div",{className:"p-4 text-xs text-destructive",children:q.message}):0===V.length?(0,s.jsx)("div",{className:"p-4 text-xs",style:{color:"var(--ds-gray-600)"},children:"No streams found for this run"}):V.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>P(e),className:"w-full text-left px-3 py-2 text-xs font-mono truncate hover:bg-accent transition-colors",style:{backgroundColor:D===e?"var(--ds-gray-200)":"transparent",color:"var(--ds-gray-1000)"},title:e,children:e},e))})]}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:D?(0,s.jsx)(d.StreamViewer,{env:I,streamId:D}):(0,s.jsx)("div",{className:"h-full flex items-center justify-center rounded-lg border",style:{borderColor:"var(--ds-gray-300)",backgroundColor:"var(--ds-gray-100)"},children:(0,s.jsx)("div",{className:"text-sm",style:{color:"var(--ds-gray-600)"},children:V.length>0?"Select a stream to view its data":"No streams available"})})})]})}),M&&(0,s.jsx)(ta.TabsContent,{value:"graph",className:"mt-0 flex-1 min-h-0",children:(0,s.jsx)("div",{className:"h-full min-h-[500px]",children:(0,s.jsx)(tD,{config:e,run:G,allSteps:_,allEvents:B,env:I})})})]}),H&&(0,s.jsxs)("div",{className:"fixed flex items-center gap-2 left-8 bottom-8 bg-background border rounded-md px-4 py-2 shadow-lg",children:[(0,s.jsx)(x.Loader2,{className:"size-4 animate-spin"}),(0,s.jsx)("span",{className:"text-sm",children:"Fetching data..."})]})]})]})]})}var tR=e.i(480462);function tO(){let e=(0,n.useParams)(),t=(0,tr.useQueryParamConfig)(),[a]=(0,tR.useStepIdState)(),[o]=(0,tR.useEventIdState)(),[l]=(0,tR.useHookIdState)(),d=e.runId;return(0,s.jsx)(r.ErrorBoundary,{title:"Run Detail Error",description:"Failed to load run details. Please try navigating back to the home page.",children:(0,s.jsx)(tT,{config:t,runId:d,selectedId:a||o||l||void 0})})}e.s(["default",()=>tO],721969)}]);
|
|
File without changes
|
/package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → Ven1ulyDX7wtUfVstJodR}/_clientMiddlewareManifest.json
RENAMED
|
File without changes
|
|
File without changes
|