trxa-tool 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/MANUAL.md +376 -368
  2. package/README.md +75 -51
  3. package/SETUP.md +401 -0
  4. package/STUDIO.md +417 -309
  5. package/dist/fixture-schema.d.ts +45 -5
  6. package/dist/fixture-schema.js +97 -13
  7. package/dist/fixture-store.d.ts +37 -0
  8. package/dist/fixture-store.js +75 -0
  9. package/dist/index.js +76 -40
  10. package/dist/mapping.js +4 -1
  11. package/dist/mcp-bridge.d.ts +52 -0
  12. package/dist/mcp-bridge.js +290 -0
  13. package/dist/planrun-schema.d.ts +14 -6
  14. package/dist/planrun-schema.js +31 -7
  15. package/dist/planrun.d.ts +1 -1
  16. package/dist/planrun.js +2 -2
  17. package/dist/report-schema.d.ts +10 -1
  18. package/dist/report-schema.js +31 -5
  19. package/dist/report.d.ts +4 -1
  20. package/dist/report.js +9 -2
  21. package/dist/suite-runner.js +8 -2
  22. package/media/studio/fixtures-test-cases.png +0 -0
  23. package/media/studio/plans-editor.png +0 -0
  24. package/media/studio/recordings-create-test-case.png +0 -0
  25. package/media/studio/run-dialog.png +0 -0
  26. package/media/studio/settings-agent-runs.png +0 -0
  27. package/media/studio/settings-working-folder.png +0 -0
  28. package/media/studio/studio-recordings.png +0 -0
  29. package/media/studio/suites-canvas.png +0 -0
  30. package/media/studio/suites-inspector.png +0 -0
  31. package/media/studio/testcases-expectations.png +0 -0
  32. package/media/studio/testcases-outputs.png +0 -0
  33. package/media/studio/testrun-details.png +0 -0
  34. package/media/studio/testruns-list.png +0 -0
  35. package/package.json +6 -2
  36. package/studio/client-dist/assets/CreatePanel-C5bb5OIs.js +6 -0
  37. package/studio/client-dist/assets/FactTile-G1pURLys.js +1 -0
  38. package/studio/client-dist/assets/FieldLabel-DPmIEQ08.js +1 -0
  39. package/studio/client-dist/assets/FixtureNamePicker-137AAgwZ.js +1 -0
  40. package/studio/client-dist/assets/Fixtures-D0t-soph.js +1 -0
  41. package/studio/client-dist/assets/GeneralSection-CWkTeSX2.js +1 -0
  42. package/studio/client-dist/assets/ListPaneHeader-DXKqX36N.js +1 -0
  43. package/studio/client-dist/assets/Plans-C70evkGc.js +1 -0
  44. package/studio/client-dist/assets/Recordings-BT0dyVLs.js +1 -0
  45. package/studio/client-dist/assets/Settings-k-J3u5lH.js +1 -0
  46. package/studio/client-dist/assets/Suites-DLioOiRN.css +1 -0
  47. package/studio/client-dist/assets/Suites-DQhhMxjT.js +7 -0
  48. package/studio/client-dist/assets/TestCases-BdiopVGI.js +1 -0
  49. package/studio/client-dist/assets/TestRuns-CylAe-3t.js +9 -0
  50. package/studio/client-dist/assets/api-DJZ703_F.js +24 -0
  51. package/studio/client-dist/assets/bucket-18-viuwGcaj.js +1 -0
  52. package/studio/client-dist/assets/fixtureName-CTZT_jKu.js +1 -0
  53. package/studio/client-dist/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  54. package/studio/client-dist/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  55. package/studio/client-dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  56. package/studio/client-dist/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  57. package/studio/client-dist/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  58. package/studio/client-dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  59. package/studio/client-dist/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  60. package/studio/client-dist/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  61. package/studio/client-dist/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  62. package/studio/client-dist/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  63. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-300-normal-LoaTnByX.woff +0 -0
  64. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-300-normal-RhT0Ayi3.woff2 +0 -0
  65. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-400-italic-Bf1n82Tb.woff +0 -0
  66. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-400-italic-D9J6q4_O.woff2 +0 -0
  67. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-400-normal-BTotfTJu.woff +0 -0
  68. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-400-normal-DZqxrq2p.woff2 +0 -0
  69. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-600-normal-71GNu3SW.woff2 +0 -0
  70. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-600-normal-BGq0mW3O.woff +0 -0
  71. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-300-normal-Bbd5v1xK.woff +0 -0
  72. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-300-normal-DqmgDkIN.woff2 +0 -0
  73. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-400-italic-BELOEI8R.woff2 +0 -0
  74. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-400-italic-CfSXsIbO.woff +0 -0
  75. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-400-normal-Dsrv2Tcn.woff +0 -0
  76. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-400-normal-g30qAdWV.woff2 +0 -0
  77. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-600-normal-Bz0x94Yp.woff +0 -0
  78. package/studio/client-dist/assets/ibm-plex-sans-cyrillic-ext-600-normal-DUMzJB7m.woff2 +0 -0
  79. package/studio/client-dist/assets/ibm-plex-sans-greek-300-normal-J-CBqZoJ.woff2 +0 -0
  80. package/studio/client-dist/assets/ibm-plex-sans-greek-300-normal-STc8XiDr.woff +0 -0
  81. package/studio/client-dist/assets/ibm-plex-sans-greek-400-italic-BEZwmy7D.woff2 +0 -0
  82. package/studio/client-dist/assets/ibm-plex-sans-greek-400-italic-CTYLy0lX.woff +0 -0
  83. package/studio/client-dist/assets/ibm-plex-sans-greek-400-normal-D9ESIMu3.woff +0 -0
  84. package/studio/client-dist/assets/ibm-plex-sans-greek-400-normal-_efipK4i.woff2 +0 -0
  85. package/studio/client-dist/assets/ibm-plex-sans-greek-600-normal-D-CqTdkO.woff +0 -0
  86. package/studio/client-dist/assets/ibm-plex-sans-greek-600-normal-DzTrcv_p.woff2 +0 -0
  87. package/studio/client-dist/assets/ibm-plex-sans-latin-300-normal-C9Of02-5.woff +0 -0
  88. package/studio/client-dist/assets/ibm-plex-sans-latin-300-normal-b4i7YzLG.woff2 +0 -0
  89. package/studio/client-dist/assets/ibm-plex-sans-latin-400-italic-CZTNEAuW.woff2 +0 -0
  90. package/studio/client-dist/assets/ibm-plex-sans-latin-400-italic-CsGl1sm0.woff +0 -0
  91. package/studio/client-dist/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
  92. package/studio/client-dist/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
  93. package/studio/client-dist/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
  94. package/studio/client-dist/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
  95. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-300-normal-B8Zgwjh3.woff +0 -0
  96. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-300-normal-BLFuR0P1.woff2 +0 -0
  97. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-400-italic-Du9zzoL2.woff2 +0 -0
  98. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-400-italic-V_9i1P_m.woff +0 -0
  99. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-400-normal-C5H60-Va.woff2 +0 -0
  100. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-400-normal-RBey6euL.woff +0 -0
  101. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-600-normal-DIrixKbi.woff +0 -0
  102. package/studio/client-dist/assets/ibm-plex-sans-latin-ext-600-normal-DOrvGEcy.woff2 +0 -0
  103. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-300-normal-CkYRZD2a.woff +0 -0
  104. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-300-normal-SDfX6ktj.woff2 +0 -0
  105. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-400-italic-78jqtfZH.woff +0 -0
  106. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-400-italic-BbRnwouv.woff2 +0 -0
  107. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-400-normal-DG4YqDda.woff2 +0 -0
  108. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-400-normal-fK1oJ5dG.woff +0 -0
  109. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-600-normal-DgdngZtN.woff +0 -0
  110. package/studio/client-dist/assets/ibm-plex-sans-vietnamese-600-normal-DpPYBSTl.woff2 +0 -0
  111. package/studio/client-dist/assets/index-cxBc2iRv.js +10 -0
  112. package/studio/client-dist/assets/index-wjWuVHXN.css +1 -0
  113. package/studio/client-dist/assets/status-DUGxC7G7.js +1 -0
  114. package/studio/client-dist/assets/testCaseTree-Cl1-bc5O.js +1 -0
  115. package/studio/client-dist/axtr-icon.svg +2 -5
  116. package/studio/client-dist/favicon.svg +2 -5
  117. package/studio/client-dist/index.html +5 -4
  118. package/studio/server/dist/index.js +1530 -292
  119. package/studio/client-dist/assets/index-CgWhGkEn.js +0 -24
  120. package/studio/client-dist/assets/index-CwAUMVCL.css +0 -1
@@ -0,0 +1,6 @@
1
+ import{Cn as e,N as t,Q as n,Tn as r,Z as i,_n as a,_t as o,an as s,at as c,bn as l,gn as u,ln as d,lt as f,st as p,vn as m,vt as h,xn as g,yn as _,yt as v}from"./api-DJZ703_F.js";var y=Object.create,b=Object.defineProperty,ee=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,S=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty,ne=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),C=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=x(t),a=0,o=i.length,s;a<o;a++)s=i[a],!te.call(e,s)&&s!==n&&b(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ee(t,s))||r.enumerable});return e},w=(e,t,n)=>(n=e==null?{}:y(S(e)),C(t||!e||!e.__esModule?b(n,`default`,{value:e,enumerable:!0}):n,e)),T=ne(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}));T();var E={prefix:`c4p`,component:{AboutModal:!0,APIKeyModal:!0,Cascade:!0,Checklist:!0,CreateModal:!0,CreateFullPage:!0,CreateFullPageStep:!0,CreateSidePanel:!0,CreateTearsheetNarrow:!0,CreateTearsheet:!0,CreateTearsheetStep:!0,CreateTearsheetDivider:!0,Datagrid:!0,EditInPlace:!0,EmptyState:!0,ErrorEmptyState:!0,ExportModal:!0,ExpressiveCard:!0,FullPageError:!0,HTTPError403:!0,HTTPError404:!0,HTTPErrorOther:!0,ImportModal:!0,MultiAddSelect:!0,NotificationsPanel:!0,NoDataEmptyState:!0,NoTagsEmptyState:!0,NotFoundEmptyState:!0,NotificationsEmptyState:!0,OptionsTile:!0,PageHeader:!0,ProductiveCard:!0,RemoveModal:!0,Saving:!0,SidePanel:!0,SingleAddSelect:!0,StatusIcon:!0,TagSet:!0,Tearsheet:!0,TearsheetNarrow:!0,UnauthorizedEmptyState:!0,UserProfileImage:!0,WebTerminal:!0,WebTerminalContentWrapper:!0,WebTerminalProvider:!0,UserAvatar:!0,Toolbar:!1,ToolbarButton:!1,ToolbarGroup:!1,EditSidePanel:!1,CancelableTextEdit:!1,DataSpreadsheet:!1,EditTearsheet:!1,EditTearsheetForm:!1,EditTearsheetNarrow:!1,EditFullPage:!1,EditUpdateCards:!1,Nav:!1,NavItem:!1,NavList:!1,BigNumber:!1,TruncatedList:!1,TruncatedText:!1,DelimitedList:!1,ScrollGradient:!1,StringFormatter:!1,StatusIndicator:!1,StatusIndicatorStep:!1,TagOverflow:!1,ActionBar:!1,FilterPanel:!1,FilterPanelAccordion:!1,FilterPanelAccordionItem:!1,FilterPanelCheckbox:!1,FilterPanelCheckboxWithOverflow:!1,FilterPanelGroup:!1,FilterPanelLabel:!1,FilterPanelSearch:!1,ConditionBuilder:!1,GetStartedCard:!1,Card:!1,CardAction:!1,CardActions:!1,CardBody:!1,CardFooter:!1,CardHeader:!1,CardHeaderMedia:!1,CardMedia:!1,CardTitle:!1,CardTitleMedia:!1,Coachmark:!1,CoachmarkBeacon:!1,CoachmarkButton:!1,CoachmarkFixed:!1,CoachmarkOverlayElement:!1,CoachmarkOverlayElements:!1,CoachmarkStack:!1,CoachmarkTagline:!1,Decorator:!1,DecoratorLink:!1,DecoratorSingleButton:!1,DecoratorDualButton:!1,DescriptionList:!1,DescriptionListBody:!1,DescriptionListCell:!1,DescriptionListRow:!1,SearchBar:!1,EmptyStateV2:!1,Guidebanner:!1,GuidebannerElement:!1,GuidebannerElementButton:!1,GuidebannerElementLink:!1,InlineTip:!1,InlineTipButton:!1,InlineTipLink:!1,InterstitialScreen:!0,NonLinearReading:!1},feature:{"default-portal-target-body":!0,"Datagrid.useInlineEdit":!1,"Datagrid.useEditableCell":!1,"Datagrid.useCustomizeColumns":!1,"ExampleComponent.secondaryIcon":!1,"ExampleComponent.useExample":!1}},re='The component feature flag (canary) mechanism is deprecated and will be removed in a future release. Components are now published with a PDLC status prefix and can be imported directly, e.g. `import { previewCandidate__ComponentName } from "@carbon/ibm-products"`. See https://carbondesignsystem.com/contributing/product-development-lifecycle/',D=e=>`Carbon for IBM Products (WARNING): Component "${e}" enabled via feature flags. This component has not yet completed its review process.\nCarbon for IBM Products (DEPRECATION): ${re}`,ie=e=>`Carbon for IBM Products (WARNING): Feature "${e}" enabled via feature flags.`,O=e=>`Carbon for IBM Products (Error): Feature "${e}" not enabled. To enable see the notes on feature flags in the README.`,k=`Carbon for IBM Products (WARNING): All components enabled through use of setAllComponents. This includes components that have not yet completed their review process.
2
+ Carbon for IBM Products (DEPRECATION): ${re}`,ae=`Carbon for IBM Products (WARNING): All features enabled through use of setAllFeatures`,A={INITIAL:e=>e,ON:()=>!0,OFF:()=>!1},j=A.INITIAL,oe=A.INITIAL,M=!1,N=new Proxy({...E.component},{set(e,t,n){return e[t]!==!0&&!M&&n&&console.warn(D(t)),e[t]=n,!0},get(e,t){return j(e[t]??!1)}}),P=new Proxy({...E.feature},{set(e,t,n){return Object.getOwnPropertyDescriptor(E.feature,t)?(e[t]!==!0&&!M&&n&&console.warn(ie(t)),e[t]=n,!0):!0},get(e,t){return oe(e[t]??!1)}}),se=`data-carbon-devtools-id`;function F(e){return`${E.prefix}--${e}`}var I={devtoolsAttribute:se,getDevtoolsId:F,prefix:E.prefix,component:N,feature:P,isComponentEnabled:(e,t=!1)=>{let n=e?.displayName||e?.name||e;return t?E.component[n]:N[n]},isComponentPublic:(e,t=!1)=>{let n=e?.displayName||e?.name||e;return Object.prototype.hasOwnProperty.call(t?E.component:N,n)},isFeatureEnabled:(e,t=!1)=>t?E.feature[e]:P[e],checkReportFeatureEnabled(e){if(P[e])return!0;console.error(O(e))},isFeaturePublic:(e,t=!1)=>Object.prototype.hasOwnProperty.call(t?E.feature:P,e),setAllComponents:e=>{e===!0&&!M&&console.warn(k),j=e===!0?A.ON:e===!1?A.OFF:A.INITIAL},setAllFeatures:e=>{e===!0&&!M&&console.warn(ae),oe=e===!0?A.ON:e===!1?A.OFF:A.INITIAL},_silenceWarnings:e=>{M=e}},L=r(e()),R=r(u()),ce=w(T()),le=`${I.prefix}--canary`,ue=({className:e,componentName:t,...n})=>{let r=`
3
+ import { pkg } from '@carbon/ibm-products';
4
+ // NOTE: must happen before component is first used
5
+ pkg.component.${t} = true;
6
+ `;return L.createElement(`div`,{...n,className:(0,ce.default)(le,e)},L.createElement(`h2`,null,`This component `,L.createElement(`strong`,null,t),` is not ready yet.`),L.createElement(`p`,null,`To enable it, initialize package flags before the component is first used.`),L.createElement(`br`,null),L.createElement(`p`,null,`e.g. in main.js`),L.createElement(f,{type:`multi`},r),L.createElement(`br`,null),L.createElement(`p`,null,`View a live example on`,` `,L.createElement(`a`,{href:`https://codesandbox.io/s/example-component-olif5?file=/src/config.js`},`codesandbox`),`.`))};ue.propTypes={className:R.default.string,componentName:R.default.string.isRequired};var z=()=>void 0,B=e=>e,V={isProduction:!1,noop:z,shimIfProduction:B,log:B((...e)=>console.log(...e)),warn:B((...e)=>console.warn(...e)),error:B((...e)=>console.error(...e))},de=(e,t)=>`Carbon for IBM Products (WARNING): Component "${e}" is deprecated. ${t}`;I.logDeprecated=(e,t)=>{if(e?.deprecated){let{level:n,details:r}=e.deprecated;(V?.[n]??V.error)(de(t||e.displayName,r))}},I.checkComponentEnabled=(e,t)=>{if(e.render){let n=L.forwardRef((r,i)=>(I.logDeprecated(e,t),(n.render=I.isComponentEnabled(t)||!I.isComponentPublic(t)?e.render:ue.bind(void 0,{componentName:t}))(r,i)));return Object.assign({},e,{displayName:e.displayName},n)}else{let n=r=>(I.logDeprecated(e,t),(n=I.isComponentEnabled(t)||!I.isComponentPublic(t)?e:ue.bind(void 0,{componentName:t}))(r));return Object.assign(e=>n(e),e,{displayName:e.displayName})}};var H=I,fe=(...e)=>{let t=Object.assign({},...e.map(e=>typeof e==`string`?{[e]:null}:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,null])):e));return Object.entries(t).reduce((e,[t,n])=>(n!==null&&(e[t]=n),e),{})},pe=(e,t)=>{let n=e[t]!==null&&e[t]!==void 0;if(n&&t===`children`&&Array.isArray(e[t])){n=!1;for(let r=0;!n&&r<e[t].length;r++)n=e[t][r]!==null&&e[t][r]!==void 0}return n},U=(e,t)=>(n,r,i,a,o,s)=>(pe(n,r)&&V.warn(`The ${a} \`${o||r}\` of \`${i}\` has been deprecated and will soon be removed. ${t}`),e(n,r,i,a,o,s)),me=V.shimIfProduction(e=>{if(!Array.isArray(e))return V.error(`Warning: Invalid argument supplied to allPropTypes, expected an instance of array.`),V.noop;for(let t=0;t<e.length;t++)if(typeof e[t]!=`function`)return V.error(`Invalid argument supplied to allPropTypes. Expected an array of check functions, but received ${e[t]} at index ${t}.`),V.noop;let t=(...t)=>{let n=null;return e.some(e=>n=e(...t)),n};return t.isRequired=(e,n,r,i,a,o)=>{let s=a||n;return e[s]==null?Error(`The ${i} \`${s}\` is marked as required in \`${r||`<<anonymous>>`}\`, but its value is \`${e[s]===null?`null`:`undefined`}\`.`):t(e,s,r,i,a,o)},t});l.merge({"default-portal-target-body":!0,"enable-datagrid-useInlineEdit":!1,"enable-datagrid-useEditableCell":!1,"enable-datagrid-useCustomizeColumns":!1,"ExampleComponent.secondaryIcon":!1,"ExampleComponent.useExample":!1,"enable-test-flag-a":!1,"enable-test-flag-b":!0,enableSidepanelResizer:!1});var he=(0,L.createContext)(l);function ge({children:e,flags:t={},defaultPortalTargetBody:n=!0,enableDatagridUseInlineEdit:r=!1,enableDatagridUseEditableCell:i=!1,enableDatagridUseCustomizeColumns:a=!1,enableSidepanelResizer:o=!1,enableTestFlagA:s=!1,enableTestFlagB:c=!1}){let l=(0,L.useContext)(he),[u,d]=(0,L.useState)(l),f={"default-portal-target-body":n,"enable-datagrid-useInlineEdit":r,"enable-datagrid-useEditableCell":i,"enable-datagrid-useCustomizeColumns":a,enableSidepanelResizer:o,"enable-test-flag-a":s,"enable-test-flag-b":c,...t},[p,m]=(0,L.useState)(()=>{let e=g(f);return e.mergeWithScope(l),e});if(l!==u){let e=g(f);e.mergeWithScope(l),m(e),d(l)}return W(f,ve,e=>{let t=g(e);t.mergeWithScope(l),m(t)}),L.createElement(he.Provider,{value:p},e)}ge.propTypes={children:R.default.node,defaultPortalTargetBody:R.default.bool,enableDatagridUseCustomizeColumns:R.default.bool,enableDatagridUseEditableCell:R.default.bool,enableDatagridUseInlineEdit:R.default.bool,enableSidepanelResizer:R.default.bool,enableTestFlagA:R.default.bool,enableTestFlagB:R.default.bool,flags:U(R.default.objectOf(R.default.bool),"The `flags` prop for `FeatureFlag` has been deprecated. Please pass the flags directly as props in camelCase")};function W(e,t,n){let r=(0,L.useRef)(!1),i=(0,L.useRef)(n),[a,o]=(0,L.useState)(e);t(a,e)||o(e),(0,L.useEffect)(()=>{i.current=n}),(0,L.useEffect)(()=>{r.current&&i.current(a)},[a]),(0,L.useEffect)(()=>{r.current=!0},[])}function _e(e){return(0,L.useContext)(he).enabled(e)}function ve(e,t){if(e===t)return!0;for(let n of Object.keys(e))if(e[n]!==t[n])return!1;for(let n of Object.keys(t))if(t[n]!==e[n])return!1;return!0}var ye=(e,t)=>{let n=e?.querySelector(t);return t&&!n?.disabled?n:null},be=(e,t)=>{let n=_(),r=`${H.prefix}--tearsheet`,i=`${H.prefix}--side-panel`,a=`:not(.${n}--visually-hidden,.${r}__header--no-close-icon,.${n}--btn--disabled,[aria-hidden="true"],[tabindex="-1"],[disabled])`,o=`button${a}`,s=`input${a}`,c=`select${a}`,l=`textarea${a}`,u=`${o},${`[href]${a}`},${`a${a}`},${s},${c},${l},${`[tabindex="0"]${a}`},${`.${i}--scrolls`}`,d=(0,L.useCallback)(()=>{let n=e?.current?.querySelectorAll(`${u}`);return n?.length&&(n=Array.prototype.filter.call(n,e=>window?.getComputedStyle(e)?.display!==`none`)),{first:n?.[0],last:n?.[n?.length-1],all:n,specified:ye(e?.current,t)}},[e,u,t]);(0,L.useEffect)(()=>{d()},[d,e]);let f=async e=>{if(e.key===`Tab`){let{first:t,last:n}=d();e.shiftKey&&document?.activeElement===t?(e.preventDefault(),n?.focus()):!e.shiftKey&&document?.activeElement===n&&(e.preventDefault(),t?.focus())}},p=(0,L.useCallback)(()=>{let{first:e,specified:t}=d();t&&window?.getComputedStyle(t)?.display!==`none`&&t?.tabIndex!==-1?setTimeout(()=>t.focus(),0):setTimeout(()=>e?.focus(),0)},[d]);return{firstElement:d()?.first,lastElement:d()?.last,allElements:d()?.all,specifiedElement:d()?.specified,keyDownListener:f,getFocusable:d,claimFocus:p}};function xe(e){return{[se]:F(e)}}var G=typeof window<`u`?L.useLayoutEffect:L.useEffect,Se=e=>{let t=(0,L.useRef)(void 0);return(0,L.useEffect)(()=>{t.current=e}),t.current},K=w(T()),q=`${H.prefix}--action-set`,J=`ActionSet`,Ce=L.forwardRef(({className:e,disabled:t,kind:n,label:r,loading:i,isExpressive:a=!0,...o},s)=>L.createElement(h,{...o,isExpressive:a,className:(0,K.default)(e,[`${q}__action-button`,{[`${q}__action-button--ghost`]:n===`ghost`||n===`danger--ghost`,[`${q}__action-button--expressive`]:a}]),disabled:t||i||!1,kind:n,ref:s},r,i&&L.createElement(c,null)));Ce.displayName=`ActionSetButton`,Ce.propTypes={...h.PropTypes,kind:R.default.oneOf([`ghost`,`danger--ghost`,`tertiary`,`secondary`,`danger`,`primary`]),label:R.default.string,loading:R.default.bool};var we=`primary`,Te=(e,t)=>e===`sm`||e===`md`&&t>2,Ee={size:`md`},De=({actions:e,size:t})=>{if(e&&e.length){let n=[],r=Te(t,e.length),i=t=>e.filter(e=>(e.kind||we)===t).length,a=i(`primary`),o=i(`secondary`),s=i(`tertiary`),c=i(`danger`),l=i(`ghost`)+i(`danger--ghost`);return r&&e.length>3&&n.push(`you cannot have more than three actions in this size of ${J}`),e.length>4&&n.push(`you cannot have more than four actions in a ${J}`),a>1&&n.push(`you cannot have more than one 'primary' action in a ${J}`),l>1&&n.push(`you cannot have more than one 'ghost' action in a ${J}`),r&&e.length>1&&l>0&&n.push(`you cannot have a 'ghost' button in conjunction with other action types in this size of ${J}`),e.length>a+o+s+c+l&&n.push(`you can only have 'primary', 'danger', 'secondary', 'tertiary', 'ghost' and 'danger--ghost' buttons in a ${J}`),n.length>0?V.error(`Invalid prop \`actions\` supplied to \`${J}\`: ${n.join(`, and `)}.`):null}},Oe=L.forwardRef((e,t)=>{let{actions:n,buttonSize:r,className:i,disableStacking:a=!1,size:s=Ee.size,...c}=e;De({actions:n,size:s});let l=n&&n.slice?.(0)||[],u=a?!1:Te(s,l.length),d=e=>({ghost:1,"danger--ghost":2,tertiary:3,danger:5,primary:6})[e]??4;return l.sort((e,t)=>(d(e.kind||we)-d(t.kind||we))*(u?-1:1)),L.createElement(o,{...c,className:(0,K.default)(q,i,{[`${q}--row-single`]:!u&&l.length===1,[`${q}--row-double`]:!u&&l.length===2,[`${q}--row-triple`]:!u&&l.length===3,[`${q}--row-quadruple`]:!u&&l.length>=4,[`${q}--stacking`]:u},`${q}--${s}`),ref:t,role:`presentation`,stacked:u},l.map((e,t)=>{let n=fe(e,[`key`]);return L.createElement(Ce,{key:e.key||t,...n,size:r})}))});Oe.displayName=J,Oe.propTypes={actions:me([R.default.arrayOf(R.default.shape({...h.propTypes,kind:R.default.oneOf([`ghost`,`danger--ghost`,`tertiary`,`secondary`,`danger`,`primary`]),label:R.default.string,loading:R.default.bool,onClick:h.propTypes.onClick}))]),buttonSize:h.propTypes.size,className:R.default.string,disableStacking:R.default.bool,size:R.default.oneOf([`sm`,`md`,`lg`,`xl`,`2xl`])};function ke(e,t,n){let[r,i]=(0,L.useState)(e);return(0,L.useEffect)(()=>{let r=t=>{!e&&t.animationName===n&&i(!1)};e&&i(!0),t?.current&&t?.current.addEventListener(`animationend`,r);let a=t?.current;return()=>{a&&a.removeEventListener(`animationend`,r)}},[e,i,t,n]),{shouldRender:r}}var Ae=()=>{let[e,t]=(0,L.useState)(!1);return G(()=>{let e=window.matchMedia(`(prefers-reduced-motion: no-preference)`),{matches:n}=window.matchMedia(`(prefers-reduced-motion: no-preference)`);t(!n);let r=e=>{t(!e.matches)};return e.addEventListener(`change`,r),()=>{e.removeEventListener(`change`,r)}},[]),e},je={xs:`16rem`,sm:`20rem`,md:`30rem`,lg:`40rem`,xl:`65rem`,"2xl":`80rem`};function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}var Me=e=>`${e/16}rem`,Ne=L.createContext(`clabs`);function Pe(){return L.useContext(Ne)}var Fe=r(a()),Ie=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function Le(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var Re,ze;function Be(){if(ze)return Re;ze=1;var e=`Expected a function`,t=NaN,n=`[object Symbol]`,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,c=typeof Ie==`object`&&Ie&&Ie.Object===Object&&Ie,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return u.Date.now()};function h(t,n,r){var i,a,o,s,c,l,u=0,d=!1,h=!1,_=!0;if(typeof t!=`function`)throw TypeError(e);n=y(n)||0,g(r)&&(d=!!r.leading,h=`maxWait`in r,o=h?f(y(r.maxWait)||0,n):o,_=`trailing`in r?!!r.trailing:_);function v(e){var n=i,r=a;return i=a=void 0,u=e,s=t.apply(r,n),s}function b(e){return u=e,c=setTimeout(S,n),d?v(e):s}function ee(e){var t=e-l,r=e-u,i=n-t;return h?p(i,o-r):i}function x(e){var t=e-l,r=e-u;return l===void 0||t>=n||t<0||h&&r>=o}function S(){var e=m();if(x(e))return te(e);c=setTimeout(S,ee(e))}function te(e){return c=void 0,_&&i?v(e):(i=a=void 0,s)}function ne(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function C(){return c===void 0?s:te(m())}function w(){var e=m(),t=x(e);if(i=arguments,a=this,l=e,t){if(c===void 0)return b(l);if(h)return c=setTimeout(S,n),v(l)}return c===void 0&&(c=setTimeout(S,n)),s}return w.cancel=ne,w.flush=C,w}function g(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function _(e){return!!e&&typeof e==`object`}function v(e){return typeof e==`symbol`||_(e)&&d.call(e)==n}function y(e){if(typeof e==`number`)return e;if(v(e))return t;if(g(e)){var n=typeof e.valueOf==`function`?e.valueOf():e;e=g(n)?n+``:n}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(r,``);var c=a.test(e);return c||o.test(e)?s(e.slice(2),c?2:8):i.test(e)?t:+e}return Re=h,Re}var Ve=Le(Be()),He,X=e=>!e||!(`current`in e)?null:e.current,Ue=(0,L.forwardRef)(({orientation:e,onResize:t,onResizeEnd:n,onDoubleClick:r,className:i,children:a,thickness:o=4,...s},c)=>{let l=`${Pe()}__resizer`,u=(0,L.useRef)(null),d=c||u,[f,p]=(0,L.useState)(!1),m=(0,L.useRef)({x:0,y:0}),h=(0,L.useRef)({prevSiblingSize:{width:0,height:0},nextSiblingSize:{width:0,height:0}}),g=(0,L.useRef)({prevSiblingSize:{width:0,height:0},nextSiblingSize:{width:0,height:0}}),_=(0,L.useRef)(Ve(e=>{X(d)&&n&&n(e,d)},100));(0,L.useEffect)(()=>{let t=X(d);if(!t)return;t.style[e===`horizontal`?`blockSize`:`inlineSize`]=Me(o);let n=t.previousElementSibling,r=t.nextElementSibling,i=e=>e?.getBoundingClientRect();g.current={prevSiblingSize:n?{width:i(n).width,height:i(n).height}:{width:0,height:0},nextSiblingSize:r?{width:i(r).width,height:i(r).height}:{width:0,height:0}}},[d,o,e]);let v=(0,L.useCallback)((n,r)=>{let i=X(d);if(!i)return;if(t){t(n,r);return}let a=i.previousElementSibling,o=i.nextElementSibling,s=e===`horizontal`?`height`:`width`;if(a){let e=h.current.prevSiblingSize[s]+r;a.style[s]=`${e}px`}if(o){let e=h.current.nextSiblingSize[s]-r;o.style[s]=`${e}px`}},[t,e,d]),y=(0,L.useCallback)(t=>{t.preventDefault(),t.stopPropagation();let n=e===`horizontal`?t.clientY-m.current.y:t.clientX-m.current.x;v(t,n)},[e,v]),b=(0,L.useCallback)(e=>{let t=X(d);if(!t)return;p(!1),n&&n(e,d);let r=t.previousElementSibling,i=t.nextElementSibling;r&&(r.style.transition=``),i&&(i.style.transition=``)},[n,d]);(0,L.useEffect)(()=>{if(f)return window.addEventListener(`mousemove`,y),window.addEventListener(`mouseup`,b),()=>{window.removeEventListener(`mousemove`,y),window.removeEventListener(`mouseup`,b)}},[f,y,b]);let ee=(0,L.useCallback)(e=>{let t=X(d);if(!t||e.button!==0)return;let n=t.previousElementSibling,r=t.nextElementSibling,i=e=>e?.getBoundingClientRect();n&&(n.style.transition=`none`),r&&(r.style.transition=`none`),p(!0),m.current={x:e.clientX,y:e.clientY},h.current={prevSiblingSize:n?{width:i(n).width,height:i(n).height}:{width:0,height:0},nextSiblingSize:r?{width:i(r).width,height:i(r).height}:{width:0,height:0}}},[d]),x=(0,L.useCallback)(t=>{if(![`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`].includes(t.key))return;let n=X(d);if(!n)return;t.preventDefault(),t.stopPropagation();let r=n.previousElementSibling,i=n.nextElementSibling,a=e=>{let t=e?.getBoundingClientRect();return{width:t?.width||0,height:t?.height||0}};h.current={prevSiblingSize:a(r),nextSiblingSize:a(i)};let o=t.shiftKey?25:5,s=0,c=e===`horizontal`;({ArrowUp:()=>c?s=-o:null,ArrowDown:()=>c?s=o:null,ArrowLeft:()=>c?null:s=-o,ArrowRight:()=>c?null:s=o,Home:()=>s=c?-h.current.prevSiblingSize.height:-h.current.prevSiblingSize.width,End:()=>s=c?h.current.nextSiblingSize.height:h.current.nextSiblingSize.width})[t.key]?.(),v(t,s),_?.current(t)},[e,v,_,d]);return L.createElement(`div`,Y({},s,{ref:d,role:`separator`,tabIndex:0,"aria-orientation":e,"aria-live":`assertive`,onMouseDown:ee,onDoubleClick:t=>{t.preventDefault();let n=X(d);if(!n)return;let i=n.previousElementSibling,a=n.nextElementSibling;if(r)r(t);else{let t=e===`horizontal`?`height`:`width`;i&&(i.style[t]=`${g.current.prevSiblingSize[t]}px`),a&&(a.style[t]=`${g.current.nextSiblingSize[t]}px`)}},onKeyDown:x,className:(0,Fe.default)([i,l,`${l}--${e}`])}),He||=L.createElement(`span`,{className:`sr-only`},`Use arrow keys to resize, hold Shift for larger steps. Double-click to reset.`),a)});Ue.displayName=`Resizer`;var We=`240ms`,Z=w(T()),Q=`${H.prefix}--side-panel`,Ge=`SidePanel`,$={animateTitle:!0,closeIconDescription:`Close`,closeIconTooltipAlignment:`left`,currentStep:0,hideCloseButton:!1,navigationBackIconDescription:`Back`,placement:`right`,size:`md`},Ke=L.forwardRef((e,t)=>{let{actionToolbarButtons:r,actions:a,aiLabel:o,animateTitle:c=$.animateTitle,children:l,className:u,closeIconDescription:f=$.closeIconDescription,closeIconTooltipAlignment:m=$.closeIconTooltipAlignment,condensedActions:g,currentStep:_=$.currentStep,decorator:y,hideCloseButton:b=$.hideCloseButton,id:ee=Q,includeOverlay:x,labelText:S,navigationBackIconDescription:te=$.navigationBackIconDescription,onNavigationBack:ne,onRequestClose:C,onUnmount:w,open:T,placement:E=$.placement,preventCloseOnClickOutside:re,selectorPageContent:D,selectorPrimaryFocus:ie,size:O=$.size,slideIn:k,slug:ae,subtitle:A,title:j,launcherButtonRef:oe,...M}=e,[N,P]=(0,L.useState)(!1),se=(0,L.useRef)(null),F=t||se,I=(0,L.useRef)(null),R=(0,L.useRef)(null),ce=(0,L.useRef)(null),le=(0,L.useRef)(null),ue=(0,L.useRef)(null),z=(0,L.useRef)(null),B=(0,L.useRef)(null),de=(0,L.useRef)(null),H=Se({size:O,open:T,currentStep:_}),[fe,pe]=(0,L.useState)(-1),[U,me]=(0,L.useState)(!0),{firstElement:he,keyDownListener:ge}=be(F),W=F.current,ve=Se(T),G=_e(`enableSidepanelResizer`),K=(0,L.useRef)(void 0),q=(0,L.useRef)(0),J=Ae(),{shouldRender:Ce}=ke(T,F,J?`side-panel-exit-reduced`:E===`right`?`side-panel-exit-right`:`side-panel-exit-left`),[we,Te]=(0,L.useState)(0),Ee=(0,L.useCallback)(e=>{e.key===`Escape`&&T&&C?.()},[C,T]);(0,L.useEffect)(()=>{if(T&&!k)return window.addEventListener(`keydown`,Ee),()=>{window.removeEventListener(`keydown`,Ee)}},[Ee,T,k]),(0,L.useEffect)(()=>{if(!G)return;let e=F.current?.parentElement;e&&e.style.removeProperty(`--c4p-side-panel-modified-size`)},[O,G,F]),(0,L.useEffect)(()=>{G&&(K.current=F?.current?.clientWidth)},[F,F?.current?.clientWidth,G]),(0,L.useEffect)(()=>{T&&!z?.current?me(!1):me(c)},[c,T]);let De=(0,L.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation();let n=e=>{let t=F.current?.parentElement;t&&t.style.setProperty(`--c4p-side-panel-modified-size`,typeof e==`number`?`${e}px`:e)};if(e.type===`keydown`){switch(e.key){case`Home`:n(`75vw`);break;case`End`:n(je.xs);break;case`ArrowLeft`:case`ArrowRight`:q.current+=t,n((K.current??0)-(E===`right`?q.current:-q.current));break}return}F.current?.style&&(F.current.style.transition=`none`),n((K.current??0)-(E===`right`?t:-t))},[E,F,K]),Y=(0,L.useCallback)(e=>{if(e){let t=parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize);return Math.round(t/window.innerWidth*100)}return Math.round((F.current?.clientWidth||0)/window.innerWidth*100)},[F]),Me=(0,L.useCallback)((e,t)=>{q.current=0,F.current?.style?.removeProperty(`transition`),t.current.setAttribute(`aria-label`,`side panel is covering ${Y()}% of screen`),t.current.setAttribute(`aria-valuenow`,Y()),K.current=F.current?.clientWidth},[F,Y]),Ne=(0,L.useCallback)(()=>{K.current=Math.min(parseFloat(je[O])*16,window.innerWidth*.75);let e=F.current?.parentElement;e&&e.style.removeProperty(`--c4p-side-panel-modified-size`)},[F,O]),Pe=(0,L.useCallback)(e=>{if(de?.current){let t=de?.current,n=t?.clientHeight*e;t?.style?.setProperty(`margin-top`,`${-n}px`)}if(B?.current){let t=we*e;B?.current?.style?.setProperty(`margin-top`,`${-t}px`)}},[we]);(0,L.useEffect)(()=>{T&&c&&B?.current&&Te(Number(B?.current?.clientHeight||null))},[c,B,T]);let Fe=(0,L.useCallback)(()=>{if(U&&R?.current){let e=R?.current?.scrollTop,t=Math.min(Number(e),fe)/fe;W?.style.setProperty(`--${Q}--scroll-animation-progress`,t.toString()),Pe(t)}},[U,W?.style,fe,Pe]);(0,L.useEffect)(()=>{if(F&&W){let e=le.current??R.current;H&&H.currentStep!==_&&e&&(e.scrollTop=0),H&&H.size!==O&&e&&(e.scrollTop=0)}},[_,F,O,H,ee,W]),(0,L.useEffect)(()=>{!j&&S&&console.warn(`${Ge}: The prop \`labelText\` was provided without a \`title\`. It is required to have a \`title\` when using the \`labelText\` prop.`)},[S,j]),(0,L.useEffect)(()=>{ve&&!T&&oe&&setTimeout(()=>{oe?.current?.focus()},0)},[oe,T,ve]);let Ie=()=>{let e=!1;if(W&&T&&c&&N&&z?.current&&j&&j.length&&!J){let t=z.current,n=B?.current?.offsetHeight??0,i=de?.current?.offsetHeight??0,a=r?t.offsetHeight-t.clientHeight:0,o=n+i+a;pe(o),W?.style.setProperty(`--${Q}--scroll-animation-distance`,o.toString());let s=R.current;if(s){let t=window?.getComputedStyle(R.current),n=t?parseFloat(t?.paddingTop)+parseFloat(t?.paddingBottom):0;e=(!!S||!!r||!!A)&&s.scrollHeight-s.clientHeight>=o+n}}U!==e&&me(e)};(0,L.useEffect)(()=>{!U&&F.current&&W?.style.setProperty(`--${Q}--scroll-animation-progress`,`0`)},[U,Fe,F,R,T,W?.style]),(0,L.useEffect)(()=>{W&&T&&c&&N&&z?.current&&j&&j.length&&!J&&Ie()},[T,U,N,Fe,j,O,J,ee]),(0,L.useEffect)(()=>{let e=e=>{W&&I.current&&I.current.contains(e.target)&&C&&C()},t=document.body;return x&&T?t.style.overflow=`hidden`:x&&!T&&(t.style.overflow=``),x&&!re&&document.addEventListener(`click`,e),()=>{let t=document.body;t.style.overflow=``,document.removeEventListener(`click`,e)}},[x,C,T,re,w,F,W]);let Le=()=>{T||w?.(),P(!N)};(0,L.useEffect)(()=>{J&&P(!0)},[J]);let Re=()=>{P(!1)};(0,L.useEffect)(()=>{if(!T&&k){let e=D?document.querySelector(D):null;E&&E===`right`&&e?e.style.marginInlineEnd=`0`:e&&(e.style.marginInlineStart=`0`)}},[T,E,D,k]),(0,L.useEffect)(()=>{!T&&H&&H.open&&J&&w?.()},[T,w,J,H]),(0,L.useEffect)(()=>{if(T&&k){let e=D?document.querySelector(D):null;e?e.style.inlineSize=`auto`:V.warn("SidePanel prop `selectorPageContent` was not provided a selector that matches any element on your page. If an element is not found, the panel will render as a slide over."),E&&E===`right`&&e?(e.style.marginInlineEnd=`0`,e.style.transition=J?``:`margin-inline-end ${We}`,e.style.marginInlineEnd=je[O]):e&&(e.style.marginInlineStart=`0`,e.style.transition=J?``:`margin-inline-start ${We}`,e.style.marginInlineStart=je[O])}},[k,D,E,O,J,T]),(0,L.useEffect)(()=>{if(T&&N)if(ie&&ye(F?.current,ie)){let e=ye(F?.current,ie);e&&window?.getComputedStyle(e)?.display!==`none`&&setTimeout(()=>e?.focus(),0)}else k||setTimeout(()=>he?.focus(),0)},[N,he,T,ie,F,k]);let ze=(0,Z.default)([`${Q}__actions-container`,{[`${Q}__actions-container--condensed`]:g}]),Be=(0,Z.default)([Q,u,`${Q}`,`${Q}--${O}`,{[`${Q}--right-placement`]:E===`right`,[`${Q}--left-placement`]:E===`left`,[`${Q}--slide-in`]:k,[`${Q}--enable-sidepanel-resizer`]:G&&window.innerWidth>768,[`${Q}--has-decorator`]:y,[`${Q}--has-slug`]:ae,[`${Q}--has-ai-label`]:o,[`${Q}--condensed-actions`]:g,[`${Q}--has-overlay`]:x,[`${Q}--open`]:T,[`${Q}--closing`]:!T,[`${Q}--reduced-motion`]:J}]),Ve=()=>L.createElement(`div`,{className:(0,Z.default)(`${Q}__title`,{[`${Q}__title--no-label`]:!B.current}),ref:z},L.createElement(i,{className:`${Q}__title-text`,"aria-hidden":!1},j),U&&!J&&L.createElement(i,{className:`${Q}__collapsed-title-text`,"aria-hidden":!0},j)),He=()=>{let e=a&&a.length&&/l/.test(O)?`md`:`sm`,t;return ae&&ae.type?.displayName===`AILabel`&&(t=L.cloneElement(ae,{size:`xs`})),o&&o.type?.displayName===`AILabel`&&(t=L.cloneElement(o,{size:`xs`})),y?.type?.displayName===`AILabel`&&(t=L.cloneElement(y,{size:`xs`})),L.createElement(`div`,{className:(0,Z.default)(`${Q}__header`,{[`${Q}__header--on-detail-step`]:_>0,[`${Q}__header--no-title-animation`]:!c,[`${Q}__header--reduced-motion`]:J,[`${Q}__header--has-title`]:j}),ref:ue},_>0&&L.createElement(v,{kind:`ghost`,size:e,align:`bottom`,label:te,className:`${Q}__navigation-back-button`,onClick:ne},L.createElement(d,null)),j&&j.length&&S&&S.length&&L.createElement(`p`,{className:`${Q}__label-text`,ref:B},S),j&&j.length&&Ve(),(t||!b)&&L.createElement(`div`,{className:`${Q}__decorator-and-close`},t,!b&&L.createElement(v,{className:`${Q}__close-button`,label:f,onClick:C,onKeyDown:k?void 0:Ee,ref:ce,align:m},L.createElement(s,{size:16,"aria-hidden":`true`,tabIndex:`-1`,className:`${Q}--btn__icon`}))),A&&L.createElement(`p`,{className:(0,Z.default)(`${Q}__subtitle-text`,{[`${Q}__subtitle-text-no-animation-no-action-toolbar`]:!U&&(!r||!r.length)}),ref:de},A),r&&r.length&&L.createElement(`div`,{className:`${Q}__action-toolbar`},r.map(({label:e,kind:t,hasIconOnly:n=!1,icon:r,renderIcon:i,tooltipPosition:a,tooltipAlignment:o,leading:s,disabled:c,className:l,onClick:u,...d})=>L.createElement(h,{...d,key:e,kind:t||`ghost`,size:`sm`,renderIcon:i||r,iconDescription:e,...n&&{tooltipPosition:a||`bottom`,tooltipAlignment:o||`start`},hasIconOnly:n,disabled:c,className:(0,Z.default)([`${Q}__action-toolbar-button`,l,{[`${Q}__action-toolbar-leading-button`]:s}]),onClick:u},s&&e))))},X=()=>L.createElement(`div`,{ref:R,onScroll:Fe,className:(0,Z.default)(`${Q}__inner-content`,`${Q}--scrolls`,`${!U&&!c?`${Q}__inner-content--no-animated-title`:``}`)},L.createElement(p,null,l)),Ke=e=>{k||(Ee(e),ge(e))};return Ce?L.createElement(L.Fragment,null,L.createElement(n,{...xe(Ge),...M,id:ee,className:Be,ref:F,as:`aside`,"aria-label":j||M[`aria-label`],onAnimationEnd:Le,onAnimationStart:Re,onKeyDown:Ke},!k&&G&&window.innerWidth>768&&L.createElement(Ue,{className:`${Q}__resizer`,orientation:`vertical`,"aria-valuemin":Y(je.xs),"aria-valuemax":75,"aria-valuenow":Y(),onResize:De,onResizeEnd:Me,onDoubleClick:Ne}),He(),X(),L.createElement(Oe,{actions:a??[],className:ze,size:O===`xs`?`sm`:O})),x&&L.createElement(`div`,{ref:I,className:(0,Z.default)(`${Q}__overlay`,{[`${Q}__overlay--closing`]:!T})})):null}),qe={slug:R.default.node,aiLabel:R.default.node};Ke.propTypes={actionToolbarButtons:R.default.arrayOf(R.default.shape({label:R.default.string,leading:R.default.bool,icon:R.default.oneOfType([R.default.object,R.default.func]),onClick:R.default.func,kind:R.default.oneOf([`ghost`,`tertiary`,`secondary`,`primary`]),tooltipAlignment:R.default.oneOf([`top`,`right`,`bottom`,`left`]),tooltipPosition:R.default.oneOf([`start`,`center`,`end`])})),actions:me([R.default.arrayOf(R.default.shape({...h.propTypes,kind:R.default.oneOf([`ghost`,`danger--ghost`,`secondary`,`danger`,`primary`]),tooltipPosition:R.default.oneOf([`top`,`right`,`bottom`,`left`]),tooltipAlignment:R.default.oneOf([`start`,`center`,`end`]),label:R.default.string,loading:R.default.bool,onClick:h.propTypes.onClick}))]),animateTitle:R.default.bool,children:R.default.oneOfType([R.default.arrayOf(R.default.node),R.default.node]).isRequired,className:R.default.string,closeIconDescription:R.default.string,closeIconTooltipAlignment:R.default.string,condensedActions:R.default.bool,currentStep:R.default.number,hideCloseButton:R.default.bool,id:R.default.string,includeOverlay:R.default.bool,labelText:R.default.string,launcherButtonRef:R.default.any,navigationBackIconDescription:R.default.string,onNavigationBack:R.default.func,onRequestClose:R.default.func,onUnmount:R.default.func,open:R.default.bool.isRequired,placement:R.default.oneOf([`left`,`right`]),preventCloseOnClickOutside:R.default.bool,selectorPageContent:R.default.string,selectorPrimaryFocus:R.default.string,size:R.default.oneOf([`xs`,`sm`,`md`,`lg`,`xl`,`2xl`]),slideIn:R.default.bool,subtitle:R.default.node,title:R.default.string,...qe},Ke.displayName=Ge;var Je=m();function Ye({open:e,title:n,focusSelector:r,submitLabel:i=`Create`,submitting:a,error:o,onClose:s,onSubmit:c,children:l}){return(0,Je.jsx)(Ke,{open:e,size:`md`,title:n,onRequestClose:s,includeOverlay:!0,selectorPrimaryFocus:r,actions:[{label:i,kind:`primary`,onClick:c,loading:a},{label:`Cancel`,kind:`secondary`,onClick:s}],children:(0,Je.jsxs)(`div`,{className:`carbon-form`,children:[o&&(0,Je.jsx)(t,{kind:`error`,title:`Create failed`,subtitle:o,lowContrast:!0,hideCloseButton:!0}),l]})})}export{Ke as n,Ye as t};
@@ -0,0 +1 @@
1
+ import{_ as e,vn as t}from"./api-DJZ703_F.js";var n=t();function r({title:e,children:t,action:r}){return(0,n.jsxs)(`div`,{className:`empty-panel`,children:[(0,n.jsx)(`h3`,{children:e}),t&&(0,n.jsx)(`p`,{children:t}),r&&(0,n.jsx)(`div`,{className:`empty-panel-action`,children:r})]})}function i({icon:t,label:r,value:i}){return(0,n.jsxs)(e,{className:`fact-tile`,children:[(0,n.jsxs)(`div`,{className:`fact-label`,children:[(0,n.jsx)(t,{size:16,"aria-hidden":`true`}),(0,n.jsx)(`span`,{children:r})]}),(0,n.jsx)(`div`,{className:`fact-value`,children:i})]})}function a({children:e}){return(0,n.jsx)(`div`,{className:`fact-tiles`,children:e})}export{a as n,r,i as t};
@@ -0,0 +1 @@
1
+ import{Rt as e,gt as t,ht as n,mt as r,pt as i,vn as a}from"./api-DJZ703_F.js";var o=a();function s({text:a,help:s}){return s?(0,o.jsxs)(`span`,{className:`field-label`,children:[(0,o.jsx)(t,{children:a}),(0,o.jsxs)(i,{align:`top-start`,children:[(0,o.jsx)(r,{label:`About ${a}`,children:(0,o.jsx)(e,{})}),(0,o.jsx)(n,{children:s})]})]}):(0,o.jsx)(o.Fragment,{children:a})}export{s as t};
@@ -0,0 +1 @@
1
+ import{Cn as e,Tn as t,ct as n,vn as r}from"./api-DJZ703_F.js";import{t as i}from"./FieldLabel-DPmIEQ08.js";var a=t(e(),1),o=r();function s({value:e,onChange:t,existingNames:r,label:s=`Name`,hint:c,help:l,placeholder:u=`e.g. basic`,id:d,invalid:f,invalidText:p,onBlur:m}){let h=(0,a.useRef)(e),[g,_]=(0,a.useState)(0);(0,a.useEffect)(()=>{e!==h.current&&(h.current=e,_(e=>e+1))},[e]);function v(e){h.current=e,t(e)}let y=(0,a.useRef)(void 0);function b(e){e.key===`Tab`&&y.current?.closeMenu()}return(0,o.jsx)(`div`,{onKeyDownCapture:b,children:(0,o.jsx)(n,{downshiftActions:y,id:d??`name-picker-${s.replace(/\s+/g,`-`).toLowerCase()}`,titleText:l?(0,o.jsx)(i,{text:s,help:l}):s,helperText:c,invalid:f,invalidText:p,onBlur:m,placeholder:u,items:r,itemToString:e=>e??``,initialSelectedItem:e||void 0,allowCustomValue:!0,onInputChange:e=>v(e??``),onChange:({selectedItem:e})=>{e&&v(e)}},g)})}export{s as t};
@@ -0,0 +1 @@
1
+ import{$ as e,B as t,Cn as n,Ct as r,D as i,Dt as a,G as o,H as s,Ht as c,I as l,It as u,J as d,K as f,M as p,N as m,Tn as h,Tt as g,V as ee,W as _,X as v,Y as te,Zt as y,dt as b,et as x,fn as ne,it as S,j as re,q as ie,qt as C,r as ae,t as w,tt as T,ut as E,v as D,vn as O,vt as k,yt as oe}from"./api-DJZ703_F.js";import{t as A}from"./ListPaneHeader-DXKqX36N.js";import{r as se}from"./bucket-18-viuwGcaj.js";import{a as ce,b as j,i as le,r as ue,x as de}from"./index-cxBc2iRv.js";import{t as M}from"./CreatePanel-C5bb5OIs.js";import{n as N,t as fe}from"./GeneralSection-CWkTeSX2.js";import{n as pe,r as P,t as me}from"./FactTile-G1pURLys.js";import{t as F}from"./FieldLabel-DPmIEQ08.js";import{t as he}from"./fixtureName-CTZT_jKu.js";var I=h(n(),1),L=O(),R=e=>e===null?{kind:`list`}:{kind:`edit`,name:e},z=e=>e.kind===`list`?null:e.name,B=e=>!e||e.trim().length===0,V=e=>e instanceof Error?e.message:String(e),H=(e,t)=>e.toLowerCase()===t.toLowerCase();function ge(e){let t=e=>{let t=`${e.testCaseIds.length} test case${e.testCaseIds.length===1?``:`s`}`;return{type:`leaf`,id:e.name,label:e.invalid?`${e.name} (invalid)`:e.needsMigration?`${e.name} (old format)`:e.name,tooltip:e.invalid?`${e.name}: ${e.error}`:`${e.name}: ${e.description?`${e.description}, `:``}${t}`}},n=(e,t)=>e.name.localeCompare(t.name),r=e.filter(e=>!e.invalid).sort(n),i=e.filter(e=>e.invalid).sort(n),a=r.map(t);return i.length>0&&a.push({type:`folder`,name:`Invalid`,path:`invalid`,children:i.map(t)}),a}function _e({sub:e,onNavigate:t}){let[n,r]=(0,I.useState)([]),[i,a]=(0,I.useState)([]),[o,s]=(0,I.useState)([]),c=R(e),[u,d]=(0,I.useState)(null),[f,h]=(0,I.useState)(``),[g,ee]=(0,I.useState)(!1);le(g);let[_,v]=(0,I.useState)(null),[te,y]=(0,I.useState)(!1),[b,x]=(0,I.useState)(!1),[S,re]=(0,I.useState)(0),{showToast:ie}=ae();function C(n){g&&z(n)!==e?v(n):t(z(n))}function T(){return w.listFixtures().then(e=>{r(e.fixtures),a(e.legacyFiles)}).catch(e=>d(V(e)))}(0,I.useEffect)(()=>{T(),w.listTestCases().then(e=>s(e.testCases.filter(e=>!e.invalid))).catch(e=>d(V(e)))},[]);async function E(){x(!1);try{let e=await w.migrateFixtures(),t=e.written.reduce((e,t)=>e+t.from.length,0);ie(`Merged ${t} file${t===1?``:`s`} into ${e.written.length} fixture file${e.written.length===1?``:`s`}.`),await T(),re(e=>e+1)}catch(e){d(V(e))}}let D=(0,I.useMemo)(()=>new Map(o.map(e=>[e.id,e.name])),[o]),O=f.trim().toLowerCase(),k=n.filter(e=>!O||e.name.toLowerCase().includes(O)||e.description.toLowerCase().includes(O)||e.testCaseIds.some(e=>e.toLowerCase().includes(O)||(D.get(e)??``).toLowerCase().includes(O))),se=(0,I.useMemo)(()=>ge(k),[k]),ce=n.filter(e=>!e.invalid).map(e=>e.name),j=n.filter(e=>e.needsMigration).length;return(0,L.jsxs)(`div`,{className:`split`,children:[(0,L.jsxs)(`aside`,{className:`split-list`,children:[(0,L.jsx)(A,{title:`Fixtures`,shown:k.length,total:n.length,search:f,onSearch:h,placeholder:`Search fixtures or test cases`,action:(0,L.jsx)(oe,{kind:`ghost`,size:`sm`,label:`New fixture`,align:`bottom-end`,onClick:()=>y(!0),children:(0,L.jsx)(ne,{})})}),(0,L.jsxs)(`div`,{className:`split-list-items`,children:[(0,L.jsx)(N,{label:`Fixtures`,nodes:se,selected:c.kind===`edit`?c.name:null,onSelect:e=>C({kind:`edit`,name:e}),remountKey:O}),n.length===0&&(0,L.jsx)(P,{title:`No fixtures yet`,children:`Use the New fixture button above, or create one from a recording.`}),n.length>0&&k.length===0&&(0,L.jsx)(P,{title:`No matches`,children:`Try a different search term.`})]})]}),(0,L.jsxs)(`section`,{className:`split-detail`,children:[u&&(0,L.jsx)(m,{kind:`error`,title:`Error`,subtitle:u,lowContrast:!0,onClose:()=>d(null)}),j>0&&(0,L.jsx)(p,{className:`page-notice`,kind:`info`,inline:!0,lowContrast:!0,hideCloseButton:!0,title:`Some fixtures use the old file format`,subtitle:`${j} fixture${j===1?` is`:`s are`} still stored as one file per test case. Merge them into one file per fixture to edit them here.`,actionButtonLabel:`Merge fixture files`,onActionButtonClick:()=>x(!0)}),c.kind===`list`&&(0,L.jsx)(P,{title:`Pick a fixture to get started`,children:`Select a fixture from the list to edit its test cases and values, or create a new one.`}),c.kind===`edit`&&(0,L.jsx)(Te,{name:c.name,testCases:o,existingNames:ce,onSaved:e=>{T(),e!==c.name&&t(e)},onOpen:e=>{T(),C({kind:`edit`,name:e})},onDeleted:()=>{T(),t(null)},onError:d,onDirtyChange:ee},`${c.name}:${S}`)]}),(0,L.jsx)(ve,{open:te,existingNames:ce,onClose:()=>y(!1),onCreated:e=>{y(!1),T(),C({kind:`edit`,name:e})}}),(0,L.jsx)(l,{size:`sm`,open:b,modalHeading:`Merge fixture files?`,primaryButtonText:`Merge`,secondaryButtonText:`Cancel`,onRequestClose:()=>x(!1),onRequestSubmit:E,children:(0,L.jsxs)(`p`,{children:[`Studio writes one `,(0,L.jsx)(`code`,{children:`testdata/<name>.json`}),` file per fixture holding the values of every test case it covers, then removes the `,i.length,` old file`,i.length===1?``:`s`,`. Suites keep working unchanged. If two files hold values for the same test case under the same fixture name, nothing is changed and Studio names them.`]})}),(0,L.jsx)(l,{danger:!0,size:`sm`,open:_!==null,modalHeading:`Discard unsaved changes?`,primaryButtonText:`Discard`,secondaryButtonText:`Keep editing`,onRequestClose:()=>v(null),onRequestSubmit:()=>{let e=_;v(null),ee(!1),e&&t(z(e))},children:(0,L.jsx)(`p`,{children:`This fixture has changes that have not been saved. Switching now discards them.`})})]})}function U(e){let[t,n]=(0,I.useState)(``),[r,i]=(0,I.useState)(!1),a=e.some(e=>H(e,t.trim()));return{name:t,setName:n,touched:r,setTouched:i,problem:he(t.trim())??(a?`A fixture with this name already exists`:null)}}function ve({open:e,existingNames:t,onClose:n,onCreated:r}){let i=U(t),[a,o]=(0,I.useState)(``),[s,c]=(0,I.useState)(!1),[l,u]=(0,I.useState)(null);function d(){i.setName(``),i.setTouched(!1),o(``),u(null),n()}async function f(){if(i.setTouched(!0),!i.problem){c(!0),u(null);try{let e=await w.createFixture({name:i.name.trim(),description:a.trim(),testCases:{}});d(),r(e.name)}catch(e){u(V(e))}finally{c(!1)}}}return(0,L.jsxs)(M,{open:e,title:`New fixture`,focusSelector:`#fx-new-name`,submitting:s,error:l,onClose:d,onSubmit:f,children:[(0,L.jsx)(D,{id:`fx-new-name`,labelText:`Name`,helperText:i.name.trim()&&!i.problem?`Saved as testdata/${i.name.trim()}.json. Suites refer to a fixture by this name.`:`Suites refer to a fixture by this name.`,value:i.name,placeholder:`e.g. USMF`,invalid:i.touched&&i.problem!==null,invalidText:i.problem??void 0,onBlur:()=>i.setTouched(!0),onChange:e=>i.setName(e.target.value)}),(0,L.jsx)(D,{id:`fx-new-description`,labelText:`Description (optional)`,helperText:`Shown in the list, e.g. what company or scenario the values are for.`,value:a,placeholder:`e.g. US company, standard demo data`,onChange:e=>o(e.target.value)})]})}function ye({open:e,source:t,dirty:n,existingNames:r,onClose:i,onDuplicated:a}){let o=U(r),[s,c]=(0,I.useState)(``),[l,u]=(0,I.useState)(!1),[d,f]=(0,I.useState)(null),{setName:p,setTouched:h}=o;(0,I.useEffect)(()=>{if(!e)return;let n=`${t.name} copy`;for(let e=2;r.some(e=>H(e,n));e++)n=`${t.name} copy ${e}`;p(n),h(!1),c(t.description),f(null)},[e]);async function g(){if(h(!0),!o.problem){u(!0),f(null);try{a((await w.duplicateFixture(t.name,{name:o.name.trim(),description:s.trim()})).name)}catch(e){f(V(e))}finally{u(!1)}}}return(0,L.jsxs)(M,{open:e,title:`Duplicate ${t.name}`,submitLabel:`Duplicate`,focusSelector:`#fx-dup-name`,submitting:l,error:d,onClose:i,onSubmit:g,children:[n&&(0,L.jsx)(m,{kind:`warning`,title:`Unsaved changes are not copied`,subtitle:`The copy is made from the saved fixture. Save first to include your changes.`,lowContrast:!0,hideCloseButton:!0}),(0,L.jsx)(D,{id:`fx-dup-name`,labelText:`Name`,helperText:`Every test case and value is copied. Change what differs once the copy opens.`,value:o.name,invalid:o.touched&&o.problem!==null,invalidText:o.problem??void 0,onBlur:()=>h(!0),onChange:e=>p(e.target.value)}),(0,L.jsx)(D,{id:`fx-dup-description`,labelText:`Description (optional)`,value:s,onChange:e=>c(e.target.value)})]})}function be(e,t){return e?{filled:e.filter(e=>!B(t[e.name])).length,total:e.length,missing:e.filter(e=>e.required&&B(t[e.name]))}:{filled:Object.keys(t).length,total:null,missing:[]}}var xe={Icon:y,tone:`success`},Se={Icon:c,tone:`error`},Ce={Icon:g,tone:`caution`},we=[10,25,50,100];function Te({name:n,testCases:c,existingNames:p,onSaved:h,onOpen:g,onDeleted:y,onError:b,onDirtyChange:S}){let[E,O]=(0,I.useState)(!0),[A,le]=(0,I.useState)(!1),[M,N]=(0,I.useState)(``),[F,R]=(0,I.useState)(``),[z,B]=(0,I.useState)({}),[ge,_e]=(0,I.useState)(``),[U,ve]=(0,I.useState)([]),[Te,W]=(0,I.useState)(null),[ke,Ae]=(0,I.useState)(!1),[je,Me]=(0,I.useState)(!1),[Ne,Pe]=(0,I.useState)(!1),[Fe,Ie]=(0,I.useState)(new Set),[Le,G]=(0,I.useState)(new Set),[Re,ze]=(0,I.useState)(``),[Be,Ve]=(0,I.useState)(1),[K,He]=(0,I.useState)(we[0]),[Ue,We]=(0,I.useState)(!1),[q,Ge]=(0,I.useState)(null),[Ke,qe]=(0,I.useState)(!1),[Je,Ye]=(0,I.useState)(!1),{showToast:Xe}=ae(),Ze=(e,t,n)=>JSON.stringify({n:e,d:t,s:n});function Qe(e){w.getFixtureUsage(e).then(e=>ve(e.suites)).catch(()=>ve([]))}(0,I.useEffect)(()=>{O(!0),w.getFixture(n).then(e=>{N(e.name),R(e.description),B(e.testCases),le(!!e.needsMigration),_e(Ze(e.name,e.description,e.testCases)),Qe(e.name)}).catch(e=>b(V(e))).finally(()=>O(!1))},[n]);let J=!E&&Ze(M,F,z)!==ge;(0,I.useEffect)(()=>(S(J),()=>S(!1)),[J]),(0,I.useEffect)(()=>{if(!J)return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[J]);let $e=(0,I.useMemo)(()=>new Map(c.map(e=>[e.id,e])),[c]),Y=(0,I.useMemo)(()=>Object.keys(z).map(e=>({id:e,testCase:$e.get(e)})).sort((e,t)=>(e.testCase?.name??e.id).localeCompare(t.testCase?.name??t.id)),[z,$e]),et=Re.trim().toLowerCase(),X=Y.filter(e=>!et||e.id.toLowerCase().includes(et)||(e.testCase?.name??``).toLowerCase().includes(et)),tt=Math.max(1,Math.ceil(X.length/K)),nt=Math.min(Be,tt),Z=X.slice((nt-1)*K,nt*K),Q=he(M.trim())??(p.some(e=>H(e,M.trim())&&!H(e,n))?`A fixture with this name already exists`:null),$=Y.filter(e=>be(e.testCase?.inputs,z[e.id]).missing.length>0);function rt(e,t,n){B(r=>({...r,[e]:{...r[e],[t]:n}}))}function it(e){G(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})}let at=Z.length>0&&Z.every(e=>Le.has(e.id));function ot(){G(e=>{let t=new Set(e);for(let e of Z)at?t.delete(e.id):t.add(e.id);return t})}function st(e){B(t=>{let n={...t};for(let t of e)n[t]||(n[t]={});return n}),e.length<=3&&G(t=>new Set([...t,...e])),ze(``),We(!1)}function ct(e){B(t=>{let n={...t};return delete n[e],n}),G(t=>{let n=new Set(t);return n.delete(e),n}),Ge(null)}async function lt(){if(Q||$.length>0){Ae(!0),Q&&Me(!0),$.length>0&&G(e=>new Set([...e,...$.map(e=>e.id)])),W(Q?`Fill in the required fields.`:`Enter the required values for: ${$.map(e=>e.testCase?.name??e.id).join(`, `)}.`);return}W(null);let e={name:M.trim(),description:F.trim(),testCases:z};try{let t=await w.updateFixture(n,e);N(t.fixture.name),R(t.fixture.description),_e(Ze(t.fixture.name,t.fixture.description,t.fixture.testCases));let r=t.suitesUpdated.length;Xe(r>0?`Saved. ${r} suite${r===1?``:`s`} now refer to the new name.`:`Saved.`),h(t.fixture.name)}catch(e){W(V(e))}}ue(lt,J&&!A);async function ut(){Ye(!1);try{await w.deleteFixture(n),y()}catch(e){W(V(e))}}if(E)return(0,L.jsxs)(`div`,{"aria-busy":`true`,children:[(0,L.jsx)(r,{heading:!0,width:`40%`}),(0,L.jsx)(r,{paragraph:!0,lineCount:4})]});let dt=Y.reduce((e,t)=>{let n=be(t.testCase?.inputs,z[t.id]);return{filled:e.filled+n.filled,total:e.total+(n.total??n.filled)}},{filled:0,total:0}),ft=c.filter(e=>!z[e.id]),pt=e=>U.filter(t=>t.testCaseIds.includes(e)),mt=q?$e.get(q)?.name??q:``;return(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`detail-header`,children:[(0,L.jsxs)(`div`,{className:`detail-header-top`,children:[(0,L.jsx)(`h2`,{children:M||n}),J&&(0,L.jsx)(re,{type:`warm-gray`,size:`md`,children:`Unsaved changes`})]}),(0,L.jsxs)(`p`,{className:`detail-path`,children:[`testdata/`,n,`.json`]}),(0,L.jsxs)(pe,{children:[(0,L.jsx)(me,{icon:de.testcases,label:`Test cases`,value:Y.length}),(0,L.jsx)(me,{icon:de.inputs,label:`Values set`,value:`${dt.filled} of ${dt.total}`}),(0,L.jsx)(me,{icon:j.suites,label:`Used by suites`,value:U.length})]})]}),A&&(0,L.jsx)(m,{className:`page-notice`,kind:`info`,title:`Read only`,subtitle:`This fixture is still stored as one file per test case. Merge the fixture files (above) to edit it.`,lowContrast:!0,hideCloseButton:!0}),Te&&(0,L.jsx)(m,{kind:`error`,title:`Cannot save`,subtitle:Te,lowContrast:!0,hideCloseButton:!0}),(0,L.jsxs)(fe,{open:je,onToggle:Me,children:[(0,L.jsx)(D,{id:`fx-name`,labelText:`Name`,helperText:`Suites refer to a fixture by this name. Renaming it updates those suites when you save.`,value:M,readOnly:A,invalid:(Ne||ke)&&Q!==null,invalidText:Q??void 0,onBlur:()=>Pe(!0),onChange:e=>N(e.target.value)}),(0,L.jsx)(D,{id:`fx-description`,labelText:`Description (optional)`,helperText:`Shown in the list, e.g. what company or scenario the values are for.`,value:F,readOnly:A,onChange:e=>R(e.target.value)})]}),(0,L.jsxs)(`section`,{className:`detail-section`,children:[(0,L.jsx)(`h4`,{className:`detail-section-heading`,children:`Test cases`}),(0,L.jsx)(`p`,{className:`detail-section-intro`,children:`The test cases this fixture has values for. Expand a row to edit its values.`}),(0,L.jsxs)(v,{children:[(0,L.jsx)(s,{size:`lg`,"aria-label":`Fixture test cases actions`,children:(0,L.jsxs)(ee,{children:[(0,L.jsx)(t,{persistent:!0,placeholder:`Search test cases`,labelText:`Search test cases in this fixture`,value:Re,onChange:e=>{ze(e===``?``:e.target.value),Ve(1)}}),!A&&(0,L.jsx)(k,{kind:`primary`,size:`md`,renderIcon:ne,disabled:ft.length===0,onClick:()=>We(!0),children:`Add test cases`})]})}),Y.length===0?(0,L.jsx)(P,{title:`Add the first test case`,children:`Use Add test cases to choose which test cases this fixture holds values for.`}):X.length===0?(0,L.jsx)(P,{title:`No matches`,children:`No test cases in this fixture match the search.`}):(0,L.jsxs)(T,{size:`md`,"aria-label":`Test cases in ${M||n}`,children:[(0,L.jsx)(f,{children:(0,L.jsxs)(_,{children:[(0,L.jsx)(te,{enableToggle:!0,"aria-label":at?`Collapse all rows`:`Expand all rows`,isExpanded:at,onExpand:ot}),(0,L.jsx)(o,{children:`Test case`}),(0,L.jsx)(o,{children:`Values`}),(0,L.jsx)(o,{children:`Status`}),(0,L.jsx)(o,{"aria-label":`Actions`})]})}),(0,L.jsx)(x,{children:Z.map(({id:t,testCase:n})=>{let r=be(n?.inputs,z[t]),i=Le.has(t),a=n?r.missing.length>0?{view:Se,label:`${r.missing.length} required missing`}:{view:xe,label:`Complete`}:{view:Ce,label:`Test case not found`};return(0,L.jsxs)(I.Fragment,{children:[(0,L.jsxs)(d,{isExpanded:i,"aria-label":`Edit values for ${n?.name??t}`,onExpand:()=>it(t),children:[(0,L.jsxs)(e,{children:[(0,L.jsx)(`span`,{className:`cell-title`,children:n?.name??t}),(0,L.jsx)(`span`,{className:`cell-sub`,children:t})]}),(0,L.jsx)(e,{children:r.total===null?r.filled:`${r.filled} of ${r.total}`}),(0,L.jsx)(e,{children:(0,L.jsx)(ce,{view:a.view,label:a.label})}),(0,L.jsx)(e,{className:`row-actions`,children:!A&&(0,L.jsx)(oe,{kind:`ghost`,size:`sm`,align:`left`,label:`Remove from fixture`,onClick:()=>Ge(t),children:(0,L.jsx)(se,{})})})]}),i&&(0,L.jsx)(ie,{colSpan:5,children:(0,L.jsx)(De,{testCaseId:t,inputs:n?.inputs,values:z[t],readOnly:A,showAll:ke,touched:Fe,onTouch:e=>Ie(t=>t.has(e)?t:new Set(t).add(e)),onChange:(e,n)=>rt(t,e,n),onDropUnused:e=>B(n=>({...n,[t]:Object.fromEntries(Object.entries(n[t]).filter(([t])=>!e.includes(t)))}))})})]},t)})})]}),X.length>we[0]&&(0,L.jsx)(i,{page:nt,pageSize:K,pageSizes:we,totalItems:X.length,onChange:({page:e,pageSize:t})=>{Ve(e),He(t)}})]})]}),(0,L.jsxs)(`div`,{className:`form-actions`,children:[(0,L.jsx)(k,{kind:`primary`,size:`md`,renderIcon:u,onClick:lt,disabled:!J||A,children:`Save`}),(0,L.jsx)(k,{kind:`tertiary`,size:`md`,renderIcon:C,disabled:A,onClick:()=>qe(!0),children:`Duplicate`}),(0,L.jsx)(k,{kind:`danger--tertiary`,size:`md`,renderIcon:a,className:`form-actions-end`,onClick:()=>Ye(!0),children:`Delete`})]}),(0,L.jsx)(Oe,{open:Ue,testCases:ft,onClose:()=>We(!1),onAdd:st}),(0,L.jsx)(ye,{open:Ke,source:{name:n,description:F},dirty:J,existingNames:p,onClose:()=>qe(!1),onDuplicated:e=>{qe(!1),Xe(`Created ${e}.`),g(e)}}),(0,L.jsxs)(l,{danger:!0,size:`sm`,open:q!==null,modalHeading:`Remove "${mt}" from this fixture?`,primaryButtonText:`Remove`,secondaryButtonText:`Cancel`,onRequestClose:()=>Ge(null),onRequestSubmit:()=>q&&ct(q),children:[(0,L.jsx)(`p`,{children:`Its values in this fixture are removed when you save. The test case itself is not changed.`}),q&&(0,L.jsx)(Ee,{usage:pt(q),what:`for ${mt}`})]}),(0,L.jsxs)(l,{danger:!0,size:`sm`,open:Je,modalHeading:`Delete "${n}"?`,primaryButtonText:`Delete`,secondaryButtonText:`Cancel`,onRequestClose:()=>Ye(!1),onRequestSubmit:ut,children:[(0,L.jsxs)(`p`,{children:[`This permanently deletes testdata/`,n,`.json and the values of its `,Y.length,` test case`,Y.length===1?``:`s`,`. This cannot be undone.`]}),(0,L.jsx)(Ee,{usage:U})]})]})}function Ee({usage:e,what:t}){if(e.length===0)return null;let n=e.length===1;return(0,L.jsx)(m,{kind:`warning`,title:`${e.length} suite${n?` uses`:`s use`} this fixture${t?` ${t}`:``} and will stop finding ${n?`its`:`their`} values`,subtitle:e.map(e=>e.name).join(`, `),lowContrast:!0,hideCloseButton:!0})}function De({testCaseId:e,inputs:t,values:n,readOnly:r,showAll:i,touched:o,onTouch:s,onChange:c,onDropUnused:l}){let u=t??[],d=Object.keys(n).filter(e=>!u.some(t=>t.name===e)),f=u.filter(e=>e.required).length*2>=u.length;return t&&u.length===0&&d.length===0?(0,L.jsx)(`p`,{className:`detail-section-intro`,children:`This test case has no inputs, so there is nothing to fill in. Define inputs on the Recordings page with Suggest inputs.`}):(0,L.jsxs)(`div`,{className:`slice-editor`,children:[!t&&(0,L.jsx)(`p`,{className:`detail-section-intro`,children:`This test case no longer exists, so its inputs are unknown. The values stored for it are shown below.`}),(0,L.jsxs)(`div`,{className:`slice-grid`,children:[u.map(t=>{let a=`${e}:${t.name}`,l=t.controlLabel||t.name,u=!t.required&&f?` (optional)`:t.required&&!f?` (required)`:``,d=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`code`,{children:t.name}),t.description?` ${t.description}`:``]});return(0,L.jsx)(D,{id:`fx-${e}-${t.name}`,size:`sm`,labelText:(0,L.jsx)(F,{text:`${l}${u}`,help:d}),value:n[t.name]??``,placeholder:t.example??``,readOnly:r,invalid:t.required&&(i||o.has(a))&&B(n[t.name]),invalidText:`Enter a value`,onBlur:()=>s(a),onChange:e=>c(t.name,e.target.value)},t.name)}),!t&&d.map(t=>(0,L.jsx)(D,{id:`fx-${e}-${t}`,size:`sm`,labelText:t,value:n[t],readOnly:r,onChange:e=>c(t,e.target.value)},t))]}),t&&d.length>0&&(0,L.jsxs)(`div`,{className:`slice-unused`,children:[(0,L.jsxs)(`span`,{children:[`Not used by this test case any more: `,(0,L.jsx)(`code`,{children:d.join(`, `)})]}),!r&&(0,L.jsx)(k,{kind:`ghost`,size:`sm`,renderIcon:a,onClick:()=>l(d),children:`Remove unused values`})]})]})}function Oe({open:e,testCases:t,onClose:n,onAdd:r}){let[i,a]=(0,I.useState)(``),[o,s]=(0,I.useState)([]);function c(){a(``),s([])}let u=i.trim().toLowerCase(),d=t.filter(e=>!u||e.name.toLowerCase().includes(u)||e.id.toLowerCase().includes(u)||(e.sourceRecordingFolder??``).toLowerCase().includes(u)).sort((e,t)=>e.name.localeCompare(t.name));return(0,L.jsx)(l,{size:`sm`,open:e,modalHeading:`Add test cases`,primaryButtonText:o.length>0?`Add ${o.length} test case${o.length===1?``:`s`}`:`Add`,secondaryButtonText:`Cancel`,primaryButtonDisabled:o.length===0,onRequestClose:()=>{c(),n()},onRequestSubmit:()=>{r(o),c()},children:(0,L.jsxs)(`div`,{className:`add-suites`,children:[(0,L.jsx)(S,{size:`md`,labelText:`Search test cases`,placeholder:`Search test cases`,value:i,onChange:e=>a(e.target.value)}),d.length===0?(0,L.jsx)(`p`,{className:`detail-section-intro`,children:`No test cases match.`}):(0,L.jsx)(E,{legendText:`Test cases without values in this fixture`,children:d.map(e=>(0,L.jsx)(b,{id:`add-tc-${e.id}`,labelText:`${e.name} (${e.inputCount} input${e.inputCount===1?``:`s`})`,checked:o.includes(e.id),onChange:(t,{checked:n})=>s(t=>n?[...t,e.id]:t.filter(t=>t!==e.id))},e.id))})]})})}export{_e as FixturesPage};
@@ -0,0 +1 @@
1
+ import{Cn as e,Tn as t,Wt as n,hn as r,m as i,p as a,vn as o,wt as s}from"./api-DJZ703_F.js";import{n as c}from"./ListPaneHeader-DXKqX36N.js";var l=t(e(),1),u=o();function d(e){return e.reduce((e,t)=>e+(t.type===`leaf`?1:d(t.children)),0)}function f(e,t){return e.map(e=>e.type===`folder`?(0,u.jsx)(i,{id:`dir:${e.path}`,label:(0,u.jsx)(`span`,{title:e.name,children:e.name}),renderIcon:c,isExpanded:!0,className:p(e,t)?`tree-has-selected`:void 0,children:f(e.children,t)},`dir:${e.path}`):(0,u.jsx)(i,{id:e.id,value:e.id,label:(0,u.jsx)(`span`,{title:e.tooltip??e.label,children:e.label}),renderIcon:e.icon??n,className:e.tone?`status-${e.tone}`:void 0},e.id))}function p(e,t){return t?e.children.some(e=>e.type===`leaf`?e.id===t:p(e,t)):!1}function m({label:e,nodes:t,selected:n,onSelect:r,remountKey:i}){let o=(0,l.useRef)(null),[s,c]=(0,l.useState)(0),p=d(t);return(0,l.useEffect)(()=>{n!==o.current&&(o.current=n,c(e=>e+1))},[n,p]),(0,u.jsx)(a,{label:e,hideLabel:!0,size:`sm`,selected:n?[n]:[],onSelect:(e,t)=>{t?.id&&!String(t.id).startsWith(`dir:`)&&(o.current=String(t.id),r(String(t.id)))},children:f(t,n)},`${i}|${s}|${p}`)}function h({open:e,onToggle:t,children:n}){return(0,u.jsx)(r,{size:`lg`,className:`general-section`,children:(0,u.jsx)(s,{title:`General`,open:e,onHeadingClick:({isOpen:e})=>t(e),children:(0,u.jsx)(`div`,{className:`carbon-form general-section-form`,children:n})})})}export{m as n,h as t};
@@ -0,0 +1 @@
1
+ import{Cn as e,Tn as t,it as n,mn as r,vn as i}from"./api-DJZ703_F.js";var a=t(e()),o=i(),s=a.forwardRef(function({children:e,size:t=16,...n},i){return a.createElement(r,{width:t,height:t,ref:i,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,fill:`currentColor`,...n},(0,o.jsx)(`path`,{d:`M11.17,6l3.42,3.41.58.59H28V26H4V6h7.17m0-2H4A2,2,0,0,0,2,6V26a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2H16L12.59,4.59A2,2,0,0,0,11.17,4Z`}),e)});function c({title:e,shown:t,total:r,search:i,onSearch:a,placeholder:s,action:c}){return(0,o.jsxs)(`div`,{className:`split-list-header`,children:[(0,o.jsxs)(`div`,{className:`split-list-title-row`,children:[(0,o.jsx)(`h2`,{children:e}),c]}),(0,o.jsx)(`p`,{className:`pane-count`,children:t===r?`${r} total`:`${t} of ${r}`}),(0,o.jsx)(n,{size:`md`,labelText:s,placeholder:s,value:i,onChange:e=>a(e.target.value)})]})}export{s as n,c as t};
@@ -0,0 +1 @@
1
+ import{$ as e,Cn as t,Ct as n,Dt as r,G as i,H as a,I as o,It as s,K as c,N as l,O as u,Tn as d,V as f,W as p,X as m,cn as h,dt as g,et as _,fn as v,it as y,j as b,k as x,r as S,t as C,tt as w,un as T,ut as E,v as D,vn as O,vt as k,yt as A}from"./api-DJZ703_F.js";import{t as ee}from"./ListPaneHeader-DXKqX36N.js";import{r as te}from"./bucket-18-viuwGcaj.js";import{b as ne,c as j,i as M,r as re,u as ie,x as ae}from"./index-cxBc2iRv.js";import{t as N}from"./CreatePanel-C5bb5OIs.js";import{n as P,t as oe}from"./GeneralSection-CWkTeSX2.js";import{n as se,r as F,t as I}from"./FactTile-G1pURLys.js";import{i as L,n as R,r as z,t as B}from"./status-DUGxC7G7.js";var V=d(t(),1),H=O();function U(e){return e===null?{kind:`list`}:{kind:`edit`,file:e}}function W(e){return e.kind===`list`?null:e.file}var G=e=>!e||e.trim().length===0;function K({sub:e,onNavigate:t}){let[n,r]=(0,V.useState)([]),[i,a]=(0,V.useState)([]),s=U(e);function c(e){t(W(e))}let[u,d]=(0,V.useState)(null),[f,p]=(0,V.useState)(``),[m,h]=(0,V.useState)(!1);M(m);let[g,_]=(0,V.useState)(null),[y,b]=(0,V.useState)(!1);function x(t){m&&W(t)!==e?_(t):c(t)}function S(){return C.listPlans().then(e=>r(e.plans)).catch(e=>d(e instanceof Error?e.message:String(e)))}(0,V.useEffect)(()=>{S(),C.listSuites().then(e=>a(e.suites)).catch(e=>d(e instanceof Error?e.message:String(e)))},[]);let w=f.trim().toLowerCase(),T=n.filter(e=>!w||e.name.toLowerCase().includes(w)||e.id.toLowerCase().includes(w)||e.description.toLowerCase().includes(w)),E=(0,V.useMemo)(()=>[...T].sort((e,t)=>(e.invalid?e.file:e.name).localeCompare(t.invalid?t.file:t.name)).map(e=>({type:`leaf`,id:e.file,label:e.invalid?`${e.file} (invalid)`:e.name,tooltip:e.invalid?`${e.file} — ${e.error}`:`${e.name} — ${e.suiteCount} suite${e.suiteCount===1?``:`s`} · ${e.file}.json`})),[T]);return(0,H.jsxs)(`div`,{className:`split`,children:[(0,H.jsxs)(`aside`,{className:`split-list`,children:[(0,H.jsx)(ee,{title:`Plans`,shown:T.length,total:n.length,search:f,onSearch:p,placeholder:`Search plans`,action:(0,H.jsx)(A,{kind:`ghost`,size:`sm`,label:`New plan`,align:`bottom-end`,onClick:()=>b(!0),children:(0,H.jsx)(v,{})})}),(0,H.jsxs)(`div`,{className:`split-list-items`,children:[(0,H.jsx)(P,{label:`Plans`,nodes:E,selected:s.kind===`edit`?s.file:null,onSelect:e=>x({kind:`edit`,file:e}),remountKey:w}),n.length===0&&(0,H.jsx)(F,{title:`No plans yet`,children:`Use the New plan button above to create one.`}),n.length>0&&T.length===0&&(0,H.jsx)(F,{title:`No matches`,children:`Try a different search term.`})]})]}),(0,H.jsxs)(`section`,{className:`split-detail`,children:[u&&(0,H.jsx)(l,{kind:`error`,title:`Error`,subtitle:u,lowContrast:!0,hideCloseButton:!0}),s.kind===`list`&&(0,H.jsx)(F,{title:`Pick a plan to get started`,children:`Select a plan from the list to edit its suites and see its rollup status, or create a new one.`}),s.kind===`edit`&&(0,H.jsx)(J,{file:s.file,suites:i,onSaved:S,onDeleted:()=>{S(),c({kind:`list`})},onError:d,onDirtyChange:h},s.file)]}),(0,H.jsx)(q,{open:y,onClose:()=>b(!1),onCreated:e=>{b(!1),S(),x({kind:`edit`,file:e})}}),(0,H.jsx)(o,{danger:!0,size:`sm`,open:g!==null,modalHeading:`Discard unsaved changes?`,primaryButtonText:`Discard`,secondaryButtonText:`Keep editing`,onRequestClose:()=>_(null),onRequestSubmit:()=>{let e=g;_(null),h(!1),e&&c(e)},children:(0,H.jsx)(`p`,{children:`This plan has changes that have not been saved. Switching now discards them.`})})]})}function q({open:e,onClose:t,onCreated:n}){let[r,i]=(0,V.useState)(``),[a,o]=(0,V.useState)(``),[s,c]=(0,V.useState)(``),[l,u]=(0,V.useState)(``),[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)({slug:!1,id:!1,name:!1}),[h,g]=(0,V.useState)(!1),[_,v]=(0,V.useState)(null);function y(){i(``),o(``),c(``),u(``),f(!1),m({slug:!1,id:!1,name:!1}),v(null)}function b(){y(),t()}async function x(){if(G(r)||G(a)||G(s)){f(!0);return}g(!0),v(null);try{let e=await C.createPlan({file:r,id:a,name:s,description:l,suiteFiles:[]});y(),n(e.file)}catch(e){v(e instanceof Error?e.message:String(e))}finally{g(!1)}}return(0,H.jsxs)(N,{open:e,title:`New plan`,focusSelector:`#pl-slug`,submitting:h,error:_,onClose:b,onSubmit:x,children:[(0,H.jsx)(D,{id:`pl-slug`,labelText:`File name`,helperText:`Written to plans/${r||`<name>`}.json`,placeholder:`e.g. accounts-payable`,value:r,invalid:(p.slug||d)&&G(r),invalidText:`Enter a file name`,onBlur:()=>m(e=>({...e,slug:!0})),onChange:e=>i(e.target.value)}),(0,H.jsx)(D,{id:`pl-id`,labelText:`Plan ID`,helperText:`The stable internal ID for this plan, independent of the file name.`,placeholder:`e.g. accounts-payable`,value:a,invalid:(p.id||d)&&G(a),invalidText:`Enter a plan ID`,onBlur:()=>m(e=>({...e,id:!0})),onChange:e=>o(e.target.value)}),(0,H.jsx)(D,{id:`pl-name`,labelText:`Name`,helperText:`Shown in the Plans list and as the run group heading in Test Runs.`,placeholder:`e.g. Accounts payable`,value:s,invalid:(p.name||d)&&G(s),invalidText:`Enter a name`,onBlur:()=>m(e=>({...e,name:!0})),onChange:e=>c(e.target.value)}),(0,H.jsx)(D,{id:`pl-description`,labelText:`Description (optional)`,helperText:`Notes on what this plan covers.`,value:l,onChange:e=>u(e.target.value)})]})}function J({file:t,suites:u,onSaved:d,onDeleted:g,onError:y,onDirtyChange:x}){let[E,O]=(0,V.useState)(!0),[ee,j]=(0,V.useState)(``),[M,N]=(0,V.useState)(``),[P,L]=(0,V.useState)(``),[R,z]=(0,V.useState)([]),[B,U]=(0,V.useState)(()=>JSON.stringify({name:``,description:``,suiteFiles:[]})),[W,K]=(0,V.useState)(null),[q,J]=(0,V.useState)(!1),[ue,Y]=(0,V.useState)(!1),[de,fe]=(0,V.useState)(!1),[pe,X]=(0,V.useState)(!1),[me,Z]=(0,V.useState)(!1),{showToast:he}=S();(0,V.useEffect)(()=>{O(!0),C.getPlan(t).then(e=>{j(e.id),N(e.name),L(e.description);let t=e.suites.map(e=>u.find(t=>t.id===e.suiteId)?.file??e.suiteId);z(t),U(JSON.stringify({name:e.name,description:e.description,suiteFiles:t}))}).catch(e=>y(e instanceof Error?e.message:String(e))).finally(()=>O(!1))},[t,u]);let Q=!E&&JSON.stringify({name:M,description:P,suiteFiles:R})!==B;(0,V.useEffect)(()=>(x(Q),()=>x(!1)),[Q]),(0,V.useEffect)(()=>{if(!Q)return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[Q]);function ge(e,t){z(n=>{let r=e+t;if(r<0||r>=n.length)return n;let i=[...n];return[i[e],i[r]]=[i[r],i[e]],i})}async function $(){if(G(M)){J(!0),Y(!0),K(`Fill in the required fields.`);return}K(null);try{await C.updatePlan(t,{name:M,description:P,suiteFiles:R}),U(JSON.stringify({name:M,description:P,suiteFiles:R})),he(`Saved.`),d(t)}catch(e){K(e instanceof Error?e.message:String(e))}}re($,Q);async function _e(){Z(!1);try{await C.deletePlan(t),g()}catch(e){K(e instanceof Error?e.message:String(e))}}if(E)return(0,H.jsxs)(`div`,{"aria-busy":`true`,children:[(0,H.jsx)(n,{heading:!0,width:`40%`}),(0,H.jsx)(n,{paragraph:!0,lineCount:4})]});let ve=R.reduce((e,t)=>e+(u.find(e=>e.file===t)?.entryCount??0),0);return(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`detail-header`,children:[(0,H.jsxs)(`div`,{className:`detail-header-top`,children:[(0,H.jsx)(`h2`,{children:M||t}),Q&&(0,H.jsx)(b,{type:`warm-gray`,size:`md`,children:`Unsaved changes`})]}),(0,H.jsxs)(`p`,{className:`detail-path`,children:[t,`.json · `,ee]}),(0,H.jsxs)(se,{children:[(0,H.jsx)(I,{icon:ne.suites,label:`Suites`,value:R.length}),(0,H.jsx)(I,{icon:ae.testcases,label:`Test cases`,value:ve})]})]}),W&&(0,H.jsx)(l,{kind:`error`,title:`Cannot save`,subtitle:W,lowContrast:!0,hideCloseButton:!0}),(0,H.jsxs)(oe,{open:ue,onToggle:Y,children:[(0,H.jsx)(D,{id:`pl-edit-name`,labelText:`Name`,helperText:`Shown in the Plans list and as the run group heading in Test Runs.`,value:M,placeholder:`e.g. Accounts payable`,invalid:(de||q)&&G(M),invalidText:`Enter a name`,onBlur:()=>fe(!0),onChange:e=>N(e.target.value)}),(0,H.jsx)(D,{id:`pl-edit-description`,labelText:`Description (optional)`,helperText:`Notes on what this plan covers.`,value:P,onChange:e=>L(e.target.value)})]}),(0,H.jsxs)(`section`,{className:`plan-section`,children:[(0,H.jsx)(`h4`,{className:`plan-section-heading`,children:`Suites`}),(0,H.jsx)(`p`,{className:`plan-section-intro`,children:`Order is the suggested run order. A plan only groups independently runnable suites for reporting; there are no dependencies or bindings across suites.`}),(0,H.jsxs)(m,{children:[(0,H.jsx)(a,{size:`lg`,"aria-label":`Plan suites actions`,children:(0,H.jsx)(f,{children:(0,H.jsx)(k,{kind:`primary`,size:`md`,renderIcon:v,disabled:u.every(e=>R.includes(e.file)),onClick:()=>X(!0),children:`Add suites`})})}),R.length===0?(0,H.jsx)(F,{title:`No suites in this plan yet`,children:u.length===0?`No suites exist yet. Create one on the Suites screen.`:`Use Add suites to choose which suites this plan runs.`}):(0,H.jsxs)(w,{size:`lg`,"aria-label":`Suites in this plan`,children:[(0,H.jsx)(c,{children:(0,H.jsxs)(p,{children:[(0,H.jsx)(i,{children:`Order`}),(0,H.jsx)(i,{children:`Suite`}),(0,H.jsx)(i,{children:`Test cases`}),(0,H.jsx)(i,{"aria-label":`Actions`})]})}),(0,H.jsx)(_,{children:R.map((t,n)=>{let r=u.find(e=>e.file===t);return(0,H.jsxs)(p,{children:[(0,H.jsx)(e,{children:n+1}),(0,H.jsxs)(e,{children:[r?r.name:t,!r&&(0,H.jsxs)(H.Fragment,{children:[` `,(0,H.jsx)(b,{type:`red`,size:`sm`,children:`Suite not found`})]})]}),(0,H.jsx)(e,{children:r?r.entryCount:`—`}),(0,H.jsxs)(e,{className:`row-actions`,children:[(0,H.jsx)(A,{kind:`ghost`,size:`sm`,align:`left`,label:`Move earlier`,disabled:n===0,onClick:()=>ge(n,-1),children:(0,H.jsx)(T,{})}),(0,H.jsx)(A,{kind:`ghost`,size:`sm`,align:`left`,label:`Move later`,disabled:n===R.length-1,onClick:()=>ge(n,1),children:(0,H.jsx)(h,{})}),(0,H.jsx)(A,{kind:`ghost`,size:`sm`,align:`left`,label:`Remove from plan`,onClick:()=>z(e=>e.filter(e=>e!==t)),children:(0,H.jsx)(te,{})})]})]},t)})})]})]})]}),(0,H.jsx)(le,{file:t,onError:y}),(0,H.jsxs)(`div`,{className:`form-actions`,children:[(0,H.jsx)(k,{kind:`primary`,size:`md`,renderIcon:s,onClick:$,disabled:!Q,children:`Save`}),(0,H.jsx)(ie,{target:{kind:`plan`,id:t,label:`${M||t} (${t}.json)`,name:M||t}}),(0,H.jsx)(k,{kind:`danger--tertiary`,size:`md`,renderIcon:r,className:`form-actions-end`,onClick:()=>Z(!0),children:`Delete`})]}),(0,H.jsx)(ce,{open:pe,suites:u.filter(e=>!R.includes(e.file)),onClose:()=>X(!1),onAdd:e=>{z(t=>[...t,...e.filter(e=>!t.includes(e))]),X(!1)}}),(0,H.jsx)(o,{danger:!0,size:`sm`,open:me,modalHeading:`Delete "${M||t}"?`,primaryButtonText:`Delete`,secondaryButtonText:`Cancel`,onRequestClose:()=>Z(!1),onRequestSubmit:_e,children:(0,H.jsxs)(`p`,{children:[`This permanently deletes `,t,`.json and cannot be undone. Its suites are not deleted.`]})})]})}function ce({open:e,suites:t,onClose:n,onAdd:r}){let[i,a]=(0,V.useState)(``),[s,c]=(0,V.useState)([]);function l(){a(``),c([]),n()}let u=i.trim().toLowerCase(),d=t.filter(e=>!u||e.name.toLowerCase().includes(u)||e.id.toLowerCase().includes(u));return(0,H.jsx)(o,{size:`sm`,open:e,modalHeading:`Add suites`,primaryButtonText:s.length>0?`Add ${s.length} suite${s.length===1?``:`s`}`:`Add`,secondaryButtonText:`Cancel`,primaryButtonDisabled:s.length===0,onRequestClose:l,onRequestSubmit:()=>{r(s),a(``),c([])},children:(0,H.jsxs)(`div`,{className:`add-suites`,children:[(0,H.jsx)(y,{size:`md`,labelText:`Search suites`,placeholder:`Search suites`,value:i,onChange:e=>a(e.target.value)}),d.length===0?(0,H.jsx)(`p`,{className:`plan-section-intro`,children:`No suites match.`}):(0,H.jsx)(E,{legendText:`Available suites`,children:d.map(e=>(0,H.jsx)(g,{id:`add-suite-${e.file}`,labelText:`${e.name} (${e.entryCount} test case${e.entryCount===1?``:`s`})`,checked:s.includes(e.file),onChange:(t,{checked:n})=>c(t=>n?[...t,e.file]:t.filter(t=>t!==e.file))},e.file))})]})})}function le({file:t,onError:r}){let[a,o]=(0,V.useState)([]),[s,l]=(0,V.useState)(``),[d,f]=(0,V.useState)(null),[m,h]=(0,V.useState)(!1);function g(e){C.listPlanRuns(t).then(t=>{o(t.runs);let n=e??(t.runs.length>0?t.runs[0].id:``);l(n),n&&v(n)}).catch(e=>r(e instanceof Error?e.message:String(e)))}(0,V.useEffect)(()=>{f(null),l(``),g()},[t]);function v(e){e&&(h(!0),C.getPlanStatus(t,e).then(f).catch(e=>r(e instanceof Error?e.message:String(e))).finally(()=>h(!1)))}let y=d?L(d):null;return(0,H.jsxs)(`section`,{className:`plan-section`,children:[(0,H.jsx)(`h4`,{className:`plan-section-heading`,children:`Rollup status`}),(0,H.jsx)(`div`,{className:`plan-run-bar`,children:a.length>0&&(0,H.jsx)(x,{id:`pl-run`,labelText:`Run`,value:s,onChange:e=>{l(e.target.value),v(e.target.value)},children:a.map(e=>(0,H.jsx)(u,{value:e.id,text:e.name?`${e.name} · ${j(e.startedAt)}`:j(e.startedAt)},e.id))})}),a.length===0&&(0,H.jsx)(F,{title:`No runs yet`,children:`Use Run below to replay this plan with the AI agent. Its results appear here.`}),m&&(0,H.jsx)(n,{paragraph:!0,lineCount:3}),d&&y&&!m&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`p`,{className:`plan-overall`,children:[`Overall`,` `,(0,H.jsx)(b,{type:B[y.tone],size:`md`,children:y.label})]}),(0,H.jsxs)(w,{size:`lg`,"aria-label":`Suite results for this run`,children:[(0,H.jsx)(c,{children:(0,H.jsxs)(p,{children:[(0,H.jsx)(i,{children:`Suite`}),(0,H.jsx)(i,{children:`Status`})]})}),(0,H.jsx)(_,{children:d.suites.map(t=>(0,H.jsxs)(p,{children:[(0,H.jsx)(e,{children:t.suiteName||t.suiteId}),(0,H.jsx)(e,{children:(0,H.jsx)(b,{type:B[z[t.status]],size:`sm`,children:R[t.status]})})]},t.suiteId))})]})]})]})}export{K as PlansPage};
@@ -0,0 +1 @@
1
+ import{$ as e,Cn as t,Et as n,G as r,Gt as i,J as a,K as o,N as s,Tn as c,Tt as l,W as u,Wt as d,X as f,Y as p,Zt as m,at as ee,et as h,in as g,m as _,p as v,q as y,r as te,t as b,tt as x,v as S,vn as C,vt as w}from"./api-DJZ703_F.js";import{n as T,t as ne}from"./ListPaneHeader-DXKqX36N.js";import{C as re,x as E}from"./index-cxBc2iRv.js";import{t as ie}from"./CreatePanel-C5bb5OIs.js";import{n as ae,r as D,t as O}from"./FactTile-G1pURLys.js";import{t as k}from"./fixtureName-CTZT_jKu.js";import{t as oe}from"./FixtureNamePicker-137AAgwZ.js";var A=c(t(),1),j=C();function M(e){return(e.split(`/`).pop()??e).replace(/\.axtr$/i,``).replace(/^BPM-AXTR-/i,``).trim().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function se(e){let t={type:`folder`,name:``,path:``,children:[]};for(let n of e){let e=n.split(`/`),r=t;e.forEach((t,n)=>{let i=e.slice(0,n+1).join(`/`);if(n===e.length-1){r.children.push({type:`file`,name:t,path:i});return}let a=r.children.find(e=>e.type===`folder`&&e.name===t);a||(a={type:`folder`,name:t,path:i,children:[]},r.children.push(a)),r=a})}function n(e){e.children.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):e.type===`folder`?-1:1);for(let t of e.children)t.type===`folder`&&n(t)}return n(t),t.children}var N=e=>e.replace(/\.axtr$/i,``);function P(e,t){return e.map(e=>e.type===`folder`?(0,j.jsx)(_,{id:`dir:${e.path}`,label:(0,j.jsx)(`span`,{title:e.name,children:e.name}),renderIcon:T,isExpanded:!0,className:t?.startsWith(`${e.path}/`)?`tree-has-selected`:void 0,children:P(e.children,t)},e.path):(0,j.jsx)(_,{id:e.path,value:e.path,label:(0,j.jsx)(`span`,{title:e.path,children:N(e.name)}),renderIcon:d},e.path))}function ce({nodes:e,selected:t,onSelect:n,remountKey:r}){return(0,j.jsx)(v,{label:`Recordings`,hideLabel:!0,size:`sm`,selected:t?[t]:[],onSelect:(e,t)=>{t?.id&&!String(t.id).startsWith(`dir:`)&&n(String(t.id))},children:P(e,t)},r)}function F({sub:e,onNavigate:t}){let[n,r]=(0,A.useState)([]),[a,o]=(0,A.useState)(``),c=e,[l,u]=(0,A.useState)(null),[d,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(null),[h,g]=(0,A.useState)(null),[_,v]=(0,A.useState)(!1),[y,x]=(0,A.useState)(null),[C,T]=(0,A.useState)({}),[N,P]=(0,A.useState)(``),[F,I]=(0,A.useState)(``),[L,R]=(0,A.useState)(``),[z,B]=(0,A.useState)(``),[ue,V]=(0,A.useState)(!1),[de,H]=(0,A.useState)(!1),[U,W]=(0,A.useState)(new Set),G=e=>W(t=>t.has(e)?t:new Set(t).add(e)),[fe,K]=(0,A.useState)(null),[q,J]=(0,A.useState)([]),{showToast:Y}=te(),X=(0,A.useMemo)(()=>n.filter(e=>e.toLowerCase().includes(a.toLowerCase())),[n,a]),pe=(0,A.useMemo)(()=>se(X),[X]);(0,A.useEffect)(()=>{b.listRecordings().then(e=>r(e.files)).catch(e=>m(e instanceof Error?e.message:String(e))),b.listFixtures().then(e=>{let t=[...new Set(e.fixtures.filter(e=>!e.invalid).map(e=>e.name))].sort((e,t)=>e.localeCompare(t));J(e=>e.length===t.length&&e.every((e,n)=>e===t[n])?e:t)}).catch(()=>{})},[]),(0,A.useEffect)(()=>{e&&Z(e)},[]);function Z(e){t(e),u(null),m(null),g(null),x(null),T({}),P(M(e)),I(``),R(``),B(``),K(null),W(new Set),H(!1),f(!0),b.parseRecording(e).then(e=>{u(e),I(e.name)}).catch(e=>m(e instanceof Error?e.message:String(e))).finally(()=>f(!1))}async function me(){if(c){v(!0),x(null);try{let e=await b.suggestInputs(c);g(e.candidates),H(!0);let t={};for(let n of e.candidates)t[n.name]=n.example??``;T(t)}catch(e){x(e instanceof Error?e.message:String(e))}finally{v(!1)}}}function he(e,t){T(n=>({...n,[e]:t}))}let Q=e=>e.trim().length===0,ge=(h?.filter(e=>e.required).length??0)*2>=(h?.length??0),$=(e,t)=>U.has(e)&&Q(t),_e=!!h&&!Q(N)&&!Q(F)&&k(z.trim())===null&&h.every(e=>!e.required||!Q(C[e.name]??``));function ve(e){H(!1),g(null),T({}),P(c?M(c):``),I(l?.name??``),R(``),B(``),W(new Set),K(null),J(t=>e&&!t.includes(e)?[...t,e].sort((e,t)=>e.localeCompare(t)):t)}async function ye(){if(!c||!h)return;if(!_e){W(new Set([`id`,`name`,`fixture`,...h.map(e=>e.name)]));return}V(!0),K(null);let e=N.trim(),t=F.trim(),n=z.trim();try{let r=await b.createTestCase({id:e,name:t,description:L.trim(),sourceRecording:c,inputs:h}),i={label:`Open test case`,onClick:()=>window.location.hash=`#/testcases/${encodeURIComponent(r.id)}`};try{let e=await b.addFixtureTestCase(n,r.id,C,`Values for the ${n} context`);ve(e.name),Y(`Created ${t}`,{subtitle:`Its values are in the ${e.name} fixture.`,action:i})}catch(e){ve(``),Y(`Created ${t}, but its fixture values were not saved`,{kind:`warning`,subtitle:`${e instanceof Error?e.message:String(e)} Add them on the Fixtures screen.`,action:{label:`Open fixtures`,onClick:()=>window.location.hash=`#/fixtures`}})}}catch(e){K(e instanceof Error?e.message:String(e))}finally{V(!1)}}let be=l?.security?new Set(l.security.formsVisited.map(e=>e.aotName)).size:0,xe=h?(0,j.jsx)(w,{kind:`primary`,size:`md`,renderIcon:i,onClick:()=>H(!0),children:`Create test case & fixture`}):(0,j.jsx)(w,{kind:`primary`,size:`md`,renderIcon:re,onClick:me,disabled:_,children:_?`Working…`:`Suggest inputs`});return(0,j.jsxs)(`div`,{className:`split`,children:[(0,j.jsxs)(`aside`,{className:`split-list`,children:[(0,j.jsx)(ne,{title:`Recordings`,shown:X.length,total:n.length,search:a,onSearch:o,placeholder:`Search recordings`}),(0,j.jsxs)(`div`,{className:`split-list-items`,children:[(0,j.jsx)(ce,{nodes:pe,selected:c,onSelect:Z,remountKey:a}),n.length===0&&(0,j.jsx)(D,{title:`No recordings yet`,children:`Add .axtr files to the recordings folder and they will appear here.`}),n.length>0&&X.length===0&&(0,j.jsx)(D,{title:`No matches`,children:`Try a different search term.`})]})]}),(0,j.jsxs)(`section`,{className:`split-detail`,children:[!c&&(0,j.jsx)(D,{title:`Pick a recording to get started`,children:`Select a recording from the list to analyze its steps.`}),c&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`detail-header`,children:[(0,j.jsx)(`div`,{className:`detail-header-top`,children:(0,j.jsx)(`h2`,{children:l?.name??c})}),l&&(0,j.jsxs)(`div`,{className:`detail-metadata`,children:[(0,j.jsx)(`p`,{className:`detail-path`,title:c,children:c}),(0,j.jsxs)(ae,{children:[(0,j.jsx)(O,{icon:E.steps,label:`Steps`,value:l.steps.length}),l.security&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(O,{icon:E.forms,label:`Forms visited`,value:be}),(0,j.jsx)(O,{icon:E.privileges,label:`Required privileges`,value:l.security.requiredPrivileges.length})]})]})]})]}),d&&(0,j.jsx)(ee,{description:`Parsing recording…`}),p&&(0,j.jsx)(s,{kind:`error`,title:`Could not parse recording`,subtitle:p,lowContrast:!0,hideCloseButton:!0}),l&&(0,j.jsxs)(j.Fragment,{children:[y&&(0,j.jsx)(s,{kind:`error`,title:`Suggest inputs failed`,subtitle:y,lowContrast:!0,hideCloseButton:!0}),(0,j.jsx)(le,{steps:l.steps}),(0,j.jsx)(`div`,{className:`toolbar table-actions`,children:xe}),h&&(0,j.jsxs)(ie,{open:de,title:`Create test case & fixture`,focusSelector:`#rec-testcase-id`,submitting:ue,error:fe,onClose:()=>H(!1),onSubmit:ye,children:[(0,j.jsx)(`h4`,{className:`form-subheading`,children:`Test case`}),(0,j.jsx)(S,{id:`rec-testcase-id`,labelText:`Test case ID`,helperText:`Used as the file name`,invalid:$(`id`,N),invalidText:`Enter a test case ID`,value:N,onBlur:()=>G(`id`),onChange:e=>P(e.target.value)}),(0,j.jsx)(S,{id:`rec-testcase-name`,labelText:`Test case name`,invalid:$(`name`,F),invalidText:`Enter a test case name`,value:F,onBlur:()=>G(`name`),onChange:e=>I(e.target.value)}),(0,j.jsx)(S,{id:`rec-testcase-description`,labelText:`Description (optional)`,value:L,onChange:e=>R(e.target.value)}),(0,j.jsx)(`h4`,{className:`form-subheading form-subheading-next`,children:`Fixture`}),(0,j.jsx)(oe,{label:`Fixture name`,value:z,onChange:B,existingNames:q,hint:q.includes(z.trim())?`This test case is added to the existing fixture.`:`Pick an existing fixture to add this test case to it, or enter a new name.`,invalid:U.has(`fixture`)&&k(z)!==null,invalidText:k(z)??void 0,onBlur:()=>G(`fixture`)}),h.map(e=>(0,j.jsx)(S,{id:`rec-input-${e.name}`,labelText:(0,j.jsxs)(j.Fragment,{children:[e.controlLabel?(0,j.jsxs)(j.Fragment,{children:[e.controlLabel,` `,(0,j.jsx)(`code`,{className:`control-name`,children:e.name})]}):(0,j.jsx)(`code`,{children:e.name}),e.required===ge?``:ge?` (optional)`:` (required)`]}),helperText:e.description||`Step ${e.bindTo.stepSequence}`,invalid:!!e.required&&$(e.name,C[e.name]??``),invalidText:`Enter a value`,value:C[e.name]??``,placeholder:e.example??``,onBlur:()=>G(e.name),onChange:t=>he(e.name,t.target.value)},e.name))]})]})]})]})]})}var I={high:{Icon:m,label:`High`,tone:`success`},medium:{Icon:l,label:`Medium`,tone:`warning`},low:{Icon:n,label:`Low`,tone:`caution`},unmapped:{Icon:g,label:`Unmapped`,tone:`neutral`}};function L({confidence:e}){let t=I[e??`unmapped`]??I.unmapped;return(0,j.jsxs)(`span`,{className:`status-indicator status-${t.tone}`,children:[(0,j.jsx)(t.Icon,{size:16,"aria-hidden":`true`}),t.label]})}function le({steps:t}){let[n,i]=(0,A.useState)(new Set),s=e=>i(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n});return(0,j.jsx)(f,{title:`Steps`,description:`Each recorded action and the tool Studio will use to replay it.`,children:(0,j.jsxs)(x,{size:`md`,useZebraStyles:!1,"aria-label":`Recording steps`,children:[(0,j.jsx)(o,{children:(0,j.jsxs)(u,{children:[(0,j.jsx)(p,{"aria-label":`Expand row`}),(0,j.jsx)(r,{className:`col-step`,children:`Step`}),(0,j.jsx)(r,{className:`col-desc`,children:`Description`}),(0,j.jsx)(r,{className:`col-form`,children:`Form`}),(0,j.jsx)(r,{className:`col-node`,children:`Node type`}),(0,j.jsx)(r,{className:`col-conf`,children:`Confidence`}),(0,j.jsx)(r,{children:`Tool`})]})}),(0,j.jsx)(h,{children:t.map(t=>{let r=t.hint?.note??(t.hint?null:`No tool mapped. Resolve with form_find_controls before replaying.`),i=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(e,{children:t.sequence}),(0,j.jsx)(e,{children:t.description||(0,j.jsx)(`span`,{className:`text-secondary`,children:`No description`})}),(0,j.jsx)(e,{children:t.formName??`—`}),(0,j.jsx)(e,{children:(0,j.jsx)(`code`,{children:t.nodeType})}),(0,j.jsx)(e,{children:(0,j.jsx)(L,{confidence:t.hint?.confidence??null})}),(0,j.jsx)(e,{children:t.hint?(0,j.jsx)(`code`,{children:t.hint.tool}):(0,j.jsx)(`span`,{className:`text-secondary`,children:`None`})})]});return r?(0,j.jsxs)(A.Fragment,{children:[(0,j.jsx)(a,{"aria-label":`Show note for step ${t.sequence}`,isExpanded:n.has(t.sequence),onExpand:()=>s(t.sequence),children:i}),n.has(t.sequence)&&(0,j.jsx)(y,{colSpan:7,children:(0,j.jsx)(`p`,{className:`step-note`,children:r})})]},t.sequence):(0,j.jsxs)(u,{children:[(0,j.jsx)(e,{}),i]},t.sequence)})})]})})}export{F as RecordingsPage};
@@ -0,0 +1 @@
1
+ import{Bt as e,Cn as t,Ct as n,E as r,Ht as i,It as a,Kt as o,N as s,Nt as c,Tn as l,Tt as u,U as d,Zt as f,_ as p,j as m,r as h,t as g,v as _,vn as v,vt as y,xt as b}from"./api-DJZ703_F.js";import{i as x,n as S,r as C,t as w}from"./index-cxBc2iRv.js";var T=l(t(),1),E=v(),D={ok:{Icon:f,tone:`success`,label:`Ready`},warn:{Icon:u,tone:`caution`,label:`Warning`},missing:{Icon:i,tone:`error`,label:`Missing`}};function O(){let[e,t]=(0,T.useState)(w);return(0,E.jsxs)(`section`,{className:`settings-section`,"aria-labelledby":`settings-appearance-heading`,children:[(0,E.jsx)(`h3`,{id:`settings-appearance-heading`,children:`Appearance`}),(0,E.jsxs)(r,{legendText:`Theme`,name:`studio-theme`,orientation:`vertical`,valueSelected:e,helperText:`Applies right away and is remembered on this computer. Printed test runs always use the light theme.`,onChange:e=>{let n=e;t(n),S(n)},children:[(0,E.jsx)(d,{id:`theme-dark`,value:`dark`,labelText:`Dark (default)`}),(0,E.jsx)(d,{id:`theme-light`,value:`light`,labelText:`Light`}),(0,E.jsx)(d,{id:`theme-system`,value:`system`,labelText:`Match the operating system`})]})]})}function k(){let{showToast:t}=h(),[r,i]=(0,T.useState)(null),[a,l]=(0,T.useState)(!0),[u,d]=(0,T.useState)(null),[f,m]=(0,T.useState)(!1);function _(){m(!0),d(null),g.installReplaySkill().then(()=>{t(`Replay skill installed in the working folder.`),v()}).catch(e=>d(e instanceof Error?e.message:String(e))).finally(()=>m(!1))}function v(){l(!0),d(null),g.getAgentReadiness().then(i).catch(e=>d(e instanceof Error?e.message:String(e))).finally(()=>l(!1))}return(0,T.useEffect)(v,[]),(0,E.jsxs)(`section`,{className:`settings-section`,"aria-labelledby":`settings-agent-heading`,children:[(0,E.jsx)(`h3`,{id:`settings-agent-heading`,children:`Agent runs`}),(0,E.jsx)(`p`,{className:`settings-intro`,children:`Studio can hand a test to an AI agent to replay it against D365. This is what the agent needs on this computer.`}),u&&(0,E.jsx)(s,{kind:`error`,title:`Could not check`,subtitle:u,lowContrast:!0,hideCloseButton:!0}),a&&!r&&(0,E.jsx)(`div`,{"aria-busy":`true`,children:(0,E.jsx)(n,{paragraph:!0,lineCount:4})}),r&&(0,E.jsx)(`ul`,{className:`readiness-list`,children:r.checks.map(t=>{let{Icon:n,tone:r,label:i}=D[t.status];return(0,E.jsx)(`li`,{children:(0,E.jsxs)(p,{className:`readiness-row status-${r}`,children:[(0,E.jsx)(n,{size:16,"aria-label":i}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`readiness-label`,children:t.label}),(0,E.jsx)(`div`,{className:`readiness-detail`,children:t.detail}),t.status!==`ok`&&t.fix&&(0,E.jsx)(`div`,{className:`readiness-fix`,children:t.fix}),t.status!==`ok`&&t.help&&(0,E.jsx)(b,{className:`readiness-help`,href:t.help,target:`_blank`,rel:`noreferrer`,renderIcon:e,size:`sm`,children:`Setup guide`}),t.status!==`ok`&&t.action===`install-skill`&&(0,E.jsx)(y,{className:`readiness-action`,kind:`tertiary`,size:`sm`,renderIcon:o,disabled:f,onClick:_,children:f?`Installing…`:`Install skill`})]})]})},t.id)})}),r&&(0,E.jsx)(`p`,{className:`settings-intro`,role:`status`,children:r.ready.copilot?`Ready to run with GitHub Copilot.`:r.ready.claude?`Ready to run with Claude Code.`:`Not ready to run yet. Fix the items above.`}),(0,E.jsx)(`div`,{className:`form-actions`,children:(0,E.jsx)(y,{kind:`tertiary`,size:`md`,renderIcon:c,disabled:a,onClick:v,children:a?`Checking…`:`Check again`})})]})}function A(){let{showToast:e}=h(),[t,r]=(0,T.useState)(``),[i,o]=(0,T.useState)(``),[c,l]=(0,T.useState)(!1),[u,d]=(0,T.useState)(!0),[f,p]=(0,T.useState)(!1),[v,b]=(0,T.useState)(null);(0,T.useEffect)(()=>{g.getSettings().then(e=>{r(e.workingFolder),o(e.workingFolder)}).catch(e=>b(e instanceof Error?e.message:String(e))).finally(()=>d(!1))},[]);let S=!u&&t.trim()!==i,w=t.trim()===``,D=S&&!f&&!w;x(S),(0,T.useEffect)(()=>{if(!S)return;let e=e=>e.preventDefault();return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[S]);async function A(){p(!0),b(null);try{let n=await g.updateSettings({workingFolder:t.trim()});r(n.workingFolder),o(n.workingFolder),l(!1),e(`Settings saved. Reload other tabs to see the change.`)}catch(e){b(e instanceof Error?e.message:String(e))}finally{p(!1)}}return C(()=>void A(),D),(0,E.jsxs)(`div`,{className:`split-detail settings-page`,children:[(0,E.jsxs)(`div`,{className:`detail-header`,children:[(0,E.jsxs)(`div`,{className:`detail-header-top`,children:[(0,E.jsx)(`h2`,{children:`Settings`}),S&&(0,E.jsx)(m,{type:`warm-gray`,size:`md`,children:`Unsaved changes`})]}),(0,E.jsx)(`p`,{className:`detail-path`,children:`Studio-wide preferences, not tied to any one record.`})]}),u?(0,E.jsxs)(`div`,{"aria-busy":`true`,children:[(0,E.jsx)(n,{heading:!0,width:`40%`}),(0,E.jsx)(n,{paragraph:!0,lineCount:3})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`section`,{className:`settings-section`,"aria-labelledby":`settings-folder-heading`,children:[(0,E.jsx)(`h3`,{id:`settings-folder-heading`,children:`Working folder`}),(0,E.jsx)(_,{id:`working-folder`,labelText:`Folder path`,helperText:`Where Studio reads and writes recordings, test cases, fixtures, suites, plans and test runs. Change it to point Studio at a different project without restarting the server.`,value:t,onChange:e=>r(e.target.value),onBlur:()=>l(!0),invalid:c&&w,invalidText:`Enter a folder path.`,placeholder:`C:\\path\\to\\your\\trxa-tool\\project`,spellCheck:!1}),v&&(0,E.jsx)(s,{kind:`error`,title:`Could not save`,subtitle:v,lowContrast:!0,hideCloseButton:!0}),(0,E.jsx)(`div`,{className:`form-actions`,children:(0,E.jsx)(y,{kind:`primary`,size:`md`,renderIcon:a,disabled:!D,onClick:A,children:f?`Saving…`:`Save`})})]}),(0,E.jsx)(O,{}),(0,E.jsx)(k,{})]})]})}export{A as SettingsPage};
@@ -0,0 +1 @@
1
+ .react-flow{--xy-edge-stroke-default:#b1b1b7;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#555;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#ffffff80;--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:#f0f0f099;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#e2e2e2;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:transparent;--xy-background-pattern-dots-color-default:#91919a;--xy-background-pattern-lines-color-default:#eee;--xy-background-pattern-cross-color-default:#e2e2e2;background-color:var(--xy-background-color,var(--xy-background-color-default));--xy-node-color-default:inherit;--xy-node-border-default:1px solid #1a192b;--xy-node-background-color-default:#fff;--xy-node-group-background-color-default:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #00000014;--xy-node-boxshadow-selected-default:0 0 0 .5px #1a192b;--xy-node-border-radius-default:3px;--xy-handle-background-color-default:#1a192b;--xy-handle-border-color-default:#fff;--xy-selection-background-color-default:#0059dc14;--xy-selection-border-default:1px dotted #0059dccc;--xy-controls-button-background-color-default:#fefefe;--xy-controls-button-background-color-hover-default:#f4f4f4;--xy-controls-button-color-default:inherit;--xy-controls-button-color-hover-default:inherit;--xy-controls-button-border-color-default:#eee;--xy-controls-box-shadow-default:0 0 2px 1px #00000014;--xy-edge-label-background-color-default:#fff;--xy-edge-label-color-default:inherit;--xy-resize-background-color-default:#3367d9;direction:ltr}.react-flow.dark{--xy-edge-stroke-default:#3e3e3e;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#727272;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:#96969640;--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:#3c3c3c99;--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#2b2b2b;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:#141414;--xy-background-pattern-dots-color-default:#555;--xy-background-pattern-lines-color-default:#333;--xy-background-pattern-cross-color-default:#333;--xy-node-color-default:#f8f8f8;--xy-node-border-default:1px solid #3c3c3c;--xy-node-background-color-default:#1e1e1e;--xy-node-group-background-color-default:#f0f0f040;--xy-node-boxshadow-hover-default:0 1px 4px 1px #ffffff14;--xy-node-boxshadow-selected-default:0 0 0 .5px #999;--xy-handle-background-color-default:#bebebe;--xy-handle-border-color-default:#1e1e1e;--xy-selection-background-color-default:#c8c8dc14;--xy-selection-border-default:1px dotted #c8c8dccc;--xy-controls-button-background-color-default:#2b2b2b;--xy-controls-button-background-color-hover-default:#3e3e3e;--xy-controls-button-color-default:#f8f8f8;--xy-controls-button-color-hover-default:#fff;--xy-controls-button-border-color-default:#5b5b5b;--xy-controls-box-shadow-default:0 0 2px 1px #00000014;--xy-edge-label-background-color-default:#141414;--xy-edge-label-color-default:#f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props,var(--xy-background-color,var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width,var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke,var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width,var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{pointer-events:none;position:absolute;overflow:visible}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected,var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}svg.react-flow__connectionline{z-index:1001;position:absolute;overflow:visible}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.react-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.react-flow__handle{pointer-events:none;background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color,var(--xy-handle-border-color-default));border-radius:100%;width:6px;min-width:5px;height:6px;min-height:5px;position:absolute}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;bottom:0;left:50%;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{z-index:5;margin:15px;position:absolute}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px)translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px)translateY(-50%)}.react-flow__attribution{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));margin:0;padding:2px 3px;font-size:10px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.react-flow__edgelabel-renderer{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__viewport-portal{-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute;top:0;left:0}.react-flow__minimap{background:var(--xy-minimap-background-color-props,var(--xy-minimap-background-color,var(--xy-minimap-background-color-default)))}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var(--xy-minimap-mask-background-color-props,var(--xy-minimap-mask-background-color,var(--xy-minimap-mask-background-color-default)));stroke:var(--xy-minimap-mask-stroke-color-props,var(--xy-minimap-mask-stroke-color,var(--xy-minimap-mask-stroke-color-default)));stroke-width:var(--xy-minimap-mask-stroke-width-props,var(--xy-minimap-mask-stroke-width,var(--xy-minimap-mask-stroke-width-default)))}.react-flow__minimap-node{fill:var(--xy-minimap-node-background-color-props,var(--xy-minimap-node-background-color,var(--xy-minimap-node-background-color-default)));stroke:var(--xy-minimap-node-stroke-color-props,var(--xy-minimap-node-stroke-color,var(--xy-minimap-node-stroke-color-default)));stroke-width:var(--xy-minimap-node-stroke-width-props,var(--xy-minimap-node-stroke-width,var(--xy-minimap-node-stroke-width-default)))}.react-flow__background-pattern.dots{fill:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-dots-color-default)))}.react-flow__background-pattern.lines{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-lines-color-default)))}.react-flow__background-pattern.cross{stroke:var(--xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-cross-color-default)))}.react-flow__controls{box-shadow:var(--xy-controls-box-shadow,var(--xy-controls-box-shadow-default));flex-direction:column;display:flex}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{background:var(--xy-controls-button-background-color,var(--xy-controls-button-background-color-default));border:none;border-bottom:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)));width:26px;height:26px;color:var(--xy-controls-button-color-props,var(--xy-controls-button-color,var(--xy-controls-button-color-default)));cursor:pointer;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;padding:4px;display:flex}.react-flow__controls-button svg{fill:currentColor;width:100%;max-width:12px;max-height:12px}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{border-radius:var(--xy-node-border-radius,var(--xy-node-border-radius-default));width:150px;color:var(--xy-node-color,var(--xy-node-color-default));text-align:center;border:var(--xy-node-border,var(--xy-node-border-default));background-color:var(--xy-node-background-color,var(--xy-node-background-color-default));padding:10px;font-size:12px}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover,var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected,var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color,var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color,var(--xy-selection-background-color-default));border:var(--xy-selection-border,var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var(--xy-controls-button-background-color-hover-props,var(--xy-controls-button-background-color-hover,var(--xy-controls-button-background-color-hover-default)));color:var(--xy-controls-button-color-hover-props,var(--xy-controls-button-color-hover,var(--xy-controls-button-color-hover-default)))}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var(--xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default)))}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;width:5px;height:5px;translate:-50% -50%}.react-flow__resize-control.handle.left{top:50%;left:0}.react-flow__resize-control.handle.right{top:50%;left:100%}.react-flow__resize-control.handle.top{top:0;left:50%}.react-flow__resize-control.handle.bottom{top:100%;left:50%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;height:100%;top:0;transform:translate(-50%)}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{width:100%;height:1px;left:0;transform:translateY(-50%)}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color,var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color,var(--xy-edge-label-color-default))}