@kizenapps/cli 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1374 -605
- package/dist/index.js.map +1 -1
- package/dist/viewer/assets/AppDetailPage-Bh4FLKqJ.js +1 -0
- package/dist/viewer/assets/AppDetailPage-BoFB93TE.js +1 -0
- package/dist/viewer/assets/AppDetailPage-Ck_VyLCS.js +1 -0
- package/dist/viewer/assets/BootstrapContext-CL_onTG7.js +1 -0
- package/dist/viewer/assets/BootstrapContext-c_1rWAfc.js +1 -0
- package/dist/viewer/assets/Card-BpDJPrPZ.js +1 -0
- package/dist/viewer/assets/Card-C7KVwKfm.js +1 -0
- package/dist/viewer/assets/CodeStepsPage-BHbbvjvr.js +1 -0
- package/dist/viewer/assets/CodeStepsPage-DnjVkPGB.js +1 -0
- package/dist/viewer/assets/CodeStepsPage-vHoGY4qA.js +1 -0
- package/dist/viewer/assets/CodeViewer--wbTev7Q.js +4 -0
- package/dist/viewer/assets/CodeViewer-Cm7Th9pG.js +4 -0
- package/dist/viewer/assets/ConfigurationPage-DAVSSfuO.js +1 -0
- package/dist/viewer/assets/ConfigurationPage-_PScSEXP.js +1 -0
- package/dist/viewer/assets/ConfigurationPage-zSJDg1f4.js +1 -0
- package/dist/viewer/assets/CredentialsContext-Rkt9WDIb.js +1 -0
- package/dist/viewer/assets/CredentialsContext-k-q4M-VC.js +1 -0
- package/dist/viewer/assets/{DevSidebar-BhTD2bBO.js → DevSidebar-CKdTotWS.js} +1 -1
- package/dist/viewer/assets/DevSidebar-CcSTChgY.js +1 -0
- package/dist/viewer/assets/IconReferencePage-BhQv3kD4.js +1 -0
- package/dist/viewer/assets/IconReferencePage-C_I2Fxnr.js +1 -0
- package/dist/viewer/assets/PluginIcon-CWkWM-Eu.js +1 -0
- package/dist/viewer/assets/SandboxPage-BMz04QVs.js +1 -0
- package/dist/viewer/assets/SandboxPage-BWtQb8kY.js +1 -0
- package/dist/viewer/assets/SandboxPage-DOBUc8VL.js +1 -0
- package/dist/viewer/assets/SidebarContext-Cn8QRb77.js +1 -0
- package/dist/viewer/assets/SidebarContext-DMhpPBf_.js +1 -0
- package/dist/viewer/assets/SourceBrowserPage-C-IhTiL0.js +1 -0
- package/dist/viewer/assets/SourceBrowserPage-Cr6XOIdV.js +1 -0
- package/dist/viewer/assets/VersionsPage-Bpj4_jPC.js +1 -0
- package/dist/viewer/assets/VersionsPage-DAm4Ozs0.js +1 -0
- package/dist/viewer/assets/VersionsPage-T8tsqgQx.js +1 -0
- package/dist/viewer/assets/{api-BOqcXygX.js → api-DFDquUsn.js} +1 -1
- package/dist/viewer/assets/{api-DqAiw0w9.js → api-bszpvP9L.js} +1 -1
- package/dist/viewer/assets/bundleQuery-BQLpZ06V.js +1 -0
- package/dist/viewer/assets/bundleQuery-CjbA01rb.js +1 -0
- package/dist/viewer/assets/fa-core-BoBqCOD3.js +558 -0
- package/dist/viewer/assets/{fa-core-wsCxaNB7.js → fa-core-C4eeAd4v.js} +1 -1
- package/dist/viewer/assets/formatBytes-BCP0hIUu.js +1 -0
- package/dist/viewer/assets/index-7CwR8Ogd.js +5 -0
- package/dist/viewer/assets/index-CCB9tECd.css +2 -0
- package/dist/viewer/assets/index-FEIsXxbf.js +5 -0
- package/dist/viewer/assets/index-fU82pXSW.js +5 -0
- package/dist/viewer/assets/{react-CyWK9rg5.js → react-CmC5kGa_.js} +1 -1
- package/dist/viewer/assets/{react-CkuOm_dq.js → react-csXWLXSE.js} +1 -1
- package/dist/viewer/assets/{recordDetail.worker-BIHPFt8Y.js → recordDetail.worker-C0-mQTaj.js} +1 -1
- package/dist/viewer/assets/useCriticalExceptionDialog-BeVl0uaO.js +14 -0
- package/dist/viewer/assets/useCriticalExceptionDialog-DseJ_u9B.js +14 -0
- package/dist/viewer/assets/useCurrentApp-CWtSEVC4.js +1 -0
- package/dist/viewer/assets/useCurrentApp-x1p8URhM.js +1 -0
- package/dist/viewer/assets/{useLocalStorage-BWwvt0nG.js → useLocalStorage-HYhrPUxS.js} +1 -1
- package/dist/viewer/assets/{useLocalStorage-BlZWItfY.js → useLocalStorage-eJ1PxgAP.js} +1 -1
- package/dist/viewer/assets/{useNavigate-9J1ZzN1J.js → useNavigate-BblEmQ3O.js} +1 -1
- package/dist/viewer/assets/{useNavigate-V8wjv5GQ.js → useNavigate-Ci7hClRo.js} +1 -1
- package/dist/viewer/assets/useQuery-5OkVbV1s.js +1 -0
- package/dist/viewer/assets/useQuery-B3Ek2Yet.js +1 -0
- package/dist/viewer/assets/{validIcons-UmfwFGTT.js → validIcons-BzGQ4tWD.js} +1 -1
- package/dist/viewer/assets/{validIcons-Dqgxgpv-.js → validIcons-CzxkK9y8.js} +1 -1
- package/dist/viewer/index.html +12 -10
- package/package.json +3 -6
- package/dist/viewer/assets/AppDetailPage-BPvWscWJ.js +0 -1
- package/dist/viewer/assets/AppDetailPage-DIuYKCTQ.js +0 -1
- package/dist/viewer/assets/AppDetailPage-r3jzO9Kf.js +0 -1
- package/dist/viewer/assets/BootstrapContext-CExPp3R2.js +0 -1
- package/dist/viewer/assets/BootstrapContext-CTQMWXf-.js +0 -1
- package/dist/viewer/assets/BootstrapContext-DbnbWmQT.js +0 -1
- package/dist/viewer/assets/Card-Bmn1HMWl.js +0 -1
- package/dist/viewer/assets/Card-DMz6T3VL.js +0 -1
- package/dist/viewer/assets/Card-DsqKctyM.js +0 -1
- package/dist/viewer/assets/CodeStepsPage-BHqLfCdV.js +0 -4
- package/dist/viewer/assets/CodeStepsPage-BymhEfzO.js +0 -4
- package/dist/viewer/assets/CodeStepsPage-CD_MhDwY.js +0 -4
- package/dist/viewer/assets/CodeStepsPage-CgI-LqEx.js +0 -4
- package/dist/viewer/assets/CodeStepsPage-Dak3saZE.js +0 -5
- package/dist/viewer/assets/CodeStepsPage-Zj6DscGd.js +0 -4
- package/dist/viewer/assets/ConfigurationPage-Cjy9TH3N.js +0 -1
- package/dist/viewer/assets/ConfigurationPage-DmX-6MM-.js +0 -1
- package/dist/viewer/assets/ConfigurationPage-J56kCD_e.js +0 -1
- package/dist/viewer/assets/CredentialsContext-Xbse1T0q.js +0 -1
- package/dist/viewer/assets/CredentialsContext-zl2e9kpM.js +0 -1
- package/dist/viewer/assets/DevSidebar-B30mgxSn.js +0 -1
- package/dist/viewer/assets/DevSidebar-CsEdCTej.js +0 -1
- package/dist/viewer/assets/IconReferencePage-B6j9wlte.js +0 -1
- package/dist/viewer/assets/IconReferencePage-CJa9yg9Z.js +0 -1
- package/dist/viewer/assets/IconReferencePage-Q5I-lMFQ.js +0 -1
- package/dist/viewer/assets/SandboxPage-C0h7GUkw.js +0 -1
- package/dist/viewer/assets/SandboxPage-GDcydJnJ.js +0 -1
- package/dist/viewer/assets/SandboxPage-JREBQ4id.js +0 -1
- package/dist/viewer/assets/SidebarContext-BPkYyxET.js +0 -1
- package/dist/viewer/assets/SidebarContext-DVDXFWJI.js +0 -1
- package/dist/viewer/assets/SidebarContext-HucmR353.js +0 -1
- package/dist/viewer/assets/VersionsPage-B76eugMm.js +0 -1
- package/dist/viewer/assets/VersionsPage-BIpB0iBz.js +0 -1
- package/dist/viewer/assets/VersionsPage-D0qenxK5.js +0 -1
- package/dist/viewer/assets/bundleQuery-206rQR6g.js +0 -1
- package/dist/viewer/assets/bundleQuery-L4H4wq5q.js +0 -1
- package/dist/viewer/assets/fa-core-DaD7O-yO.js +0 -558
- package/dist/viewer/assets/index-BPiwld5D.js +0 -5
- package/dist/viewer/assets/index-BiyeMU_r.css +0 -2
- package/dist/viewer/assets/index-BlJv_543.js +0 -5
- package/dist/viewer/assets/index-CAYNux5J.js +0 -5
- package/dist/viewer/assets/index-D4AnoAXz.js +0 -5
- package/dist/viewer/assets/index-D8Koqlb-.js +0 -5
- package/dist/viewer/assets/index-DKrC0qkC.js +0 -5
- package/dist/viewer/assets/useLocalStorage-CQO0VGQ6.js +0 -1
- package/dist/viewer/assets/useObjectLookups-BAqe9wvu.js +0 -14
- package/dist/viewer/assets/useObjectLookups-C65zm-bM.js +0 -14
- package/dist/viewer/assets/useObjectLookups-CslM2vSA.js +0 -14
- /package/dist/viewer/assets/{CodeStepsPage-DdKuH37F.css → CodeViewer-DdKuH37F.css} +0 -0
- /package/dist/viewer/assets/{fa-pro-icons-CiTC899m.js → fa-pro-icons-Dr3O0gTt.js} +0 -0
- /package/dist/viewer/assets/{fa-pro-icons-Dzkwxnip.js → fa-pro-icons-j8-_MCQ7.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e}from"./fa-core-C4eeAd4v.js";import{t}from"./bundleQuery-BQLpZ06V.js";import{t as n}from"./useQuery-B3Ek2Yet.js";import{t as r}from"./Card-C7KVwKfm.js";import{n as i,t as a}from"./useCurrentApp-x1p8URhM.js";import{t as o}from"./PluginIcon-CWkWM-Eu.js";import{t as s}from"./formatBytes-BCP0hIUu.js";var c=e(),l=()=>{let e=a(),{data:l}=n(t);if(e.status!==`ok`)return(0,c.jsx)(i,{state:e});let{app:u}=e,{floating_frames:d,data_adornments:f,routable_pages:p,toolbar_items:m,js_action_templates:h,route_scripts:g,object_settings_menu_items:_,automation_action_configs:v,calendar_sources:y}=u.artifacts,b=d.length>0||f.length>0||p.length>0||m.length>0||h.length>0||g.length>0||_.length>0||v.length>0||y.length>0,x=l?new TextEncoder().encode(JSON.stringify(l,null,2)).length:null,S=u.base_config,C=S?.setup_assistant?.fields??[],w=S?.user_setup_assistant?.fields??[];return(0,c.jsxs)(`div`,{className:`space-y-4 text-[13px]`,children:[(0,c.jsx)(r,{children:(0,c.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`h1`,{className:`text-lg font-bold leading-tight text-neutral-900`,children:u.name}),(0,c.jsx)(`p`,{className:`mt-0.5 font-mono text-[11px] text-neutral-400`,children:u.api_name})]}),u.description&&(0,c.jsx)(`p`,{className:`text-[13px] leading-relaxed text-neutral-600`,children:u.description}),(0,c.jsxs)(`div`,{className:`divide-y divide-black/5`,children:[u.version&&(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-neutral-600`,children:[`v`,u.version]}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`App version`})]}),u.engine&&(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-blue-50 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-blue-600`,children:[`engine: `,u.engine]}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Plugin engine version`})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsx)(`span`,{className:`shrink-0 rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${u.published?`bg-green-100 text-green-700`:`bg-neutral-100 text-neutral-500`}`,children:u.published?`published`:`unpublished`}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Whether this app is publicly available`})]}),u.release_environments?.map(e=>(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-violet-50 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-violet-600`,children:e}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Release environment`})]},e)),u.block_loading_for_setup&&(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-amber-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-amber-700`,children:`blocks app loading`}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Whether this app blocks loading of Kizen UI until resources are fetched and processed`})]}),u.developer_business_id&&(typeof u.developer_business_id==`string`?(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 font-mono text-[11px] tracking-wide text-neutral-500`,children:[`biz: `,u.developer_business_id]}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Developer business ID`})]}):Object.entries(u.developer_business_id).map(([e,t])=>(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 font-mono text-[11px] tracking-wide text-neutral-500`,children:[`biz (`,e,`): `,t]}),(0,c.jsxs)(`span`,{className:`text-[12px] text-neutral-500`,children:[`Developer business ID (`,e,`)`]})]},e))),x!==null&&(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-neutral-600`,children:[`bundle: `,s(x)]}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Total size of bundle.json`})]})]})]})}),b||C.length>0||w.length>0||u.releaseNotes?(0,c.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3`,children:[d.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Floating Frames`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:d.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Position`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:d.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.default_position&&(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:e.default_position})]},t))})]}),f.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Data Adornments`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:f.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Field`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:f.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[e.config.color&&(0,c.jsx)(`span`,{className:`h-3 w-4 shrink-0 rounded-sm border border-black/10`,style:{backgroundColor:e.config.color}}),(0,c.jsx)(o,{name:e.config.icon,className:`shrink-0 text-[12px] text-neutral-500`,fallbackClassName:`shrink-0 rounded px-1 font-mono text-[10px] bg-neutral-100 text-neutral-400`,unknownClassName:`shrink-0 rounded px-1 font-mono text-[10px] bg-amber-100 text-amber-600`}),(0,c.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:e.config.tooltip||e.field_type}),(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.field_type})]},t))})]}),p.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Routable Pages`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:p.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Page`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:p.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.iframe_url&&(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-purple-100 px-1.5 py-0.5 text-[10px] font-semibold text-purple-600`,children:`iframe`})]},t))})]}),m.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Toolbar Items`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:m.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Label`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Icon`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:m.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[e.color&&(0,c.jsx)(`span`,{className:`h-3 w-4 shrink-0 rounded-sm border border-black/10`,style:{backgroundColor:e.color}}),(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.label}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),(0,c.jsx)(o,{name:e.icon,className:`shrink-0 text-[12px] text-neutral-400`,fallbackClassName:`shrink-0 rounded px-1 font-mono text-[10px] bg-neutral-100 text-neutral-400`,unknownClassName:`shrink-0 rounded px-1 font-mono text-[10px] bg-amber-100 text-amber-600`})]},t))})]}),h.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`JS Action Templates`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:h.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Object`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:h.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.hint_object_name&&(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:e.hint_object_name})]},t))})]}),g.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Route Scripts`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:g.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Routes`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:g.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name||e.api_name}),e.name&&(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.routes.length>0&&(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:[e.routes.length,` route`,e.routes.length===1?``:`s`]})]},t))})]}),_.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Object Settings`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:_.length})]}),(0,c.jsx)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Label`})}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:_.map((e,t)=>(0,c.jsx)(`div`,{className:`flex items-center gap-2 py-1.5`,children:(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.label}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]})},t))})]}),v.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Automation Actions`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:v.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:v.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.action_step_api_name})]}),e.action_type&&(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600`,children:e.action_type})]},t))})]}),y.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Calendar Sources`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:y.length})]}),(0,c.jsx)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`})}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:y.map((e,t)=>(0,c.jsx)(`div`,{className:`flex items-center gap-2 py-1.5`,children:(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]})},t))})]}),C.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Setup Assistant`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:C.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Field`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:C.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:`label`in e?e.label??e.key:e.type}),(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.type})]},t))})]}),w.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`User Setup Assistant`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:w.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Field`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:w.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:`label`in e?e.label??e.key:e.type}),(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.type})]},t))})]}),u.releaseNotes&&(0,c.jsxs)(r,{children:[(0,c.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Release Notes`}),(0,c.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-[12px] leading-relaxed text-neutral-700`,children:u.releaseNotes})]})]}):(0,c.jsx)(r,{children:(0,c.jsx)(`p`,{className:`text-[13px] text-neutral-400`,children:`No plugin assets defined.`})})]})};export{l as AppDetailPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e}from"./fa-core-C4eeAd4v.js";import{t}from"./bundleQuery-BQLpZ06V.js";import{t as n}from"./useQuery-B3Ek2Yet.js";import{t as r}from"./Card-C7KVwKfm.js";import{n as i,t as a}from"./useCurrentApp-CWtSEVC4.js";import{t as o}from"./PluginIcon-CWkWM-Eu.js";import{t as s}from"./formatBytes-BCP0hIUu.js";var c=e(),l=()=>{let e=a(),{data:l}=n(t);if(e.status!==`ok`)return(0,c.jsx)(i,{state:e});let{app:u}=e,{floating_frames:d,data_adornments:f,routable_pages:p,toolbar_items:m,js_action_templates:h,route_scripts:g,object_settings_menu_items:_,automation_action_configs:v,calendar_sources:y}=u.artifacts,b=d.length>0||f.length>0||p.length>0||m.length>0||h.length>0||g.length>0||_.length>0||v.length>0||y.length>0,x=l?new TextEncoder().encode(JSON.stringify(l,null,2)).length:null,S=u.base_config,C=S?.setup_assistant?.fields??[],w=S?.user_setup_assistant?.fields??[];return(0,c.jsxs)(`div`,{className:`space-y-4 text-[13px]`,children:[(0,c.jsx)(r,{children:(0,c.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`h1`,{className:`text-lg font-bold leading-tight text-neutral-900`,children:u.name}),(0,c.jsx)(`p`,{className:`mt-0.5 font-mono text-[11px] text-neutral-400`,children:u.api_name})]}),u.description&&(0,c.jsx)(`p`,{className:`text-[13px] leading-relaxed text-neutral-600`,children:u.description}),(0,c.jsxs)(`div`,{className:`divide-y divide-black/5`,children:[u.version&&(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-neutral-600`,children:[`v`,u.version]}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`App version`})]}),u.engine&&(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-blue-50 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-blue-600`,children:[`engine: `,u.engine]}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Plugin engine version`})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsx)(`span`,{className:`shrink-0 rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${u.published?`bg-green-100 text-green-700`:`bg-neutral-100 text-neutral-500`}`,children:u.published?`published`:`unpublished`}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Whether this app is publicly available`})]}),u.release_environments?.map(e=>(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-violet-50 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-violet-600`,children:e}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Release environment`})]},e)),u.block_loading_for_setup&&(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-amber-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-amber-700`,children:`blocks app loading`}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Whether this app blocks loading of Kizen UI until resources are fetched and processed`})]}),u.developer_business_id&&(typeof u.developer_business_id==`string`?(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 font-mono text-[11px] tracking-wide text-neutral-500`,children:[`biz: `,u.developer_business_id]}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Developer business ID`})]}):Object.entries(u.developer_business_id).map(([e,t])=>(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 font-mono text-[11px] tracking-wide text-neutral-500`,children:[`biz (`,e,`): `,t]}),(0,c.jsxs)(`span`,{className:`text-[12px] text-neutral-500`,children:[`Developer business ID (`,e,`)`]})]},e))),x!==null&&(0,c.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-neutral-600`,children:[`bundle: `,s(x)]}),(0,c.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Total size of bundle.json`})]})]})]})}),b||C.length>0||w.length>0||u.releaseNotes?(0,c.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3`,children:[d.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Floating Frames`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:d.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Position`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:d.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.default_position&&(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:e.default_position})]},t))})]}),f.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Data Adornments`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:f.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Field`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:f.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[e.config.color&&(0,c.jsx)(`span`,{className:`h-3 w-4 shrink-0 rounded-sm border border-black/10`,style:{backgroundColor:e.config.color}}),(0,c.jsx)(o,{name:e.config.icon,className:`shrink-0 text-[12px] text-neutral-500`,fallbackClassName:`shrink-0 rounded px-1 font-mono text-[10px] bg-neutral-100 text-neutral-400`,unknownClassName:`shrink-0 rounded px-1 font-mono text-[10px] bg-amber-100 text-amber-600`}),(0,c.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:e.config.tooltip||e.field_type}),(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.field_type})]},t))})]}),p.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Routable Pages`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:p.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Page`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:p.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.iframe_url&&(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-purple-100 px-1.5 py-0.5 text-[10px] font-semibold text-purple-600`,children:`iframe`})]},t))})]}),m.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Toolbar Items`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:m.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Label`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Icon`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:m.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[e.color&&(0,c.jsx)(`span`,{className:`h-3 w-4 shrink-0 rounded-sm border border-black/10`,style:{backgroundColor:e.color}}),(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.label}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),(0,c.jsx)(o,{name:e.icon,className:`shrink-0 text-[12px] text-neutral-400`,fallbackClassName:`shrink-0 rounded px-1 font-mono text-[10px] bg-neutral-100 text-neutral-400`,unknownClassName:`shrink-0 rounded px-1 font-mono text-[10px] bg-amber-100 text-amber-600`})]},t))})]}),h.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`JS Action Templates`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:h.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Object`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:h.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.hint_object_name&&(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:e.hint_object_name})]},t))})]}),g.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Route Scripts`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:g.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Routes`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:g.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name||e.api_name}),e.name&&(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.routes.length>0&&(0,c.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:[e.routes.length,` route`,e.routes.length===1?``:`s`]})]},t))})]}),_.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Object Settings`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:_.length})]}),(0,c.jsx)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Label`})}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:_.map((e,t)=>(0,c.jsx)(`div`,{className:`flex items-center gap-2 py-1.5`,children:(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.label}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]})},t))})]}),v.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Automation Actions`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:v.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:v.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.action_step_api_name})]}),e.action_type&&(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600`,children:e.action_type})]},t))})]}),y.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Calendar Sources`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:y.length})]}),(0,c.jsx)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`})}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:y.map((e,t)=>(0,c.jsx)(`div`,{className:`flex items-center gap-2 py-1.5`,children:(0,c.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,c.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,c.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]})},t))})]}),C.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Setup Assistant`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:C.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Field`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:C.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:`label`in e?e.label??e.key:e.type}),(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.type})]},t))})]}),w.length>0&&(0,c.jsxs)(r,{children:[(0,c.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`User Setup Assistant`}),(0,c.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:w.length})]}),(0,c.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Field`}),(0,c.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,c.jsx)(`div`,{className:`divide-y divide-black/5`,children:w.map((e,t)=>(0,c.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,c.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:`label`in e?e.label??e.key:e.type}),(0,c.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.type})]},t))})]}),u.releaseNotes&&(0,c.jsxs)(r,{children:[(0,c.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Release Notes`}),(0,c.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-[12px] leading-relaxed text-neutral-700`,children:u.releaseNotes})]})]}):(0,c.jsx)(r,{children:(0,c.jsx)(`p`,{className:`text-[13px] text-neutral-400`,children:`No plugin assets defined.`})})]})};export{l as AppDetailPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,k as t}from"./fa-core-BoBqCOD3.js";import{n,t as r}from"./bundleQuery-CjbA01rb.js";import{t as i}from"./useQuery-5OkVbV1s.js";import{t as a}from"./Card-BpDJPrPZ.js";import{i as o,r as s,t as c}from"./validIcons-CzxkK9y8.js";var l=e();function u(e){return e<1024?`${String(e)} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}var d=()=>{let{apiName:e}=n({strict:!1}),{data:d,isLoading:f,isError:p}=i(r);if(f)return(0,l.jsx)(a,{children:(0,l.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})});if(p)return(0,l.jsx)(a,{children:(0,l.jsx)(`p`,{className:`m-0 text-[13px] text-red-700`,children:`Could not load bundle.json.`})});let m=d?.find(t=>t.api_name===e);if(!m)return(0,l.jsx)(a,{children:(0,l.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`No app found with api_name`,` `,(0,l.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:e}),`.`]})});let{floating_frames:h,data_adornments:g,routable_pages:_,toolbar_items:v,js_action_templates:y,route_scripts:b,object_settings_menu_items:x,automation_action_configs:S,calendar_sources:C}=m.artifacts,w=h.length>0||g.length>0||_.length>0||v.length>0||y.length>0||b.length>0||x.length>0||S.length>0||C.length>0,T=d?new TextEncoder().encode(JSON.stringify(d,null,2)).length:null,E=m.base_config,D=E?.setup_assistant?.fields??[],O=E?.user_setup_assistant?.fields??[];return(0,l.jsxs)(`div`,{className:`space-y-4 text-[13px]`,children:[(0,l.jsx)(a,{children:(0,l.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{className:`text-lg font-bold leading-tight text-neutral-900`,children:m.name}),(0,l.jsx)(`p`,{className:`mt-0.5 font-mono text-[11px] text-neutral-400`,children:m.api_name})]}),m.description&&(0,l.jsx)(`p`,{className:`text-[13px] leading-relaxed text-neutral-600`,children:m.description}),(0,l.jsxs)(`div`,{className:`divide-y divide-black/5`,children:[m.version&&(0,l.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,l.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-neutral-600`,children:[`v`,m.version]}),(0,l.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`App version`})]}),m.engine&&(0,l.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,l.jsxs)(`span`,{className:`shrink-0 rounded bg-blue-50 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-blue-600`,children:[`engine: `,m.engine]}),(0,l.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Plugin engine version`})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,l.jsx)(`span`,{className:`shrink-0 rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${m.published?`bg-green-100 text-green-700`:`bg-neutral-100 text-neutral-500`}`,children:m.published?`published`:`unpublished`}),(0,l.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Whether this app is publicly available`})]}),m.release_environments?.map(e=>(0,l.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,l.jsx)(`span`,{className:`shrink-0 rounded bg-violet-50 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-violet-600`,children:e}),(0,l.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Release environment`})]},e)),m.block_loading_for_setup&&(0,l.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,l.jsx)(`span`,{className:`shrink-0 rounded bg-amber-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-amber-700`,children:`blocks app loading`}),(0,l.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Whether this app blocks loading of Kizen UI until resources are fetched and processed`})]}),m.developer_business_id&&(typeof m.developer_business_id==`string`?(0,l.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,l.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 font-mono text-[11px] tracking-wide text-neutral-500`,children:[`biz: `,m.developer_business_id]}),(0,l.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Developer business ID`})]}):Object.entries(m.developer_business_id).map(([e,t])=>(0,l.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,l.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 font-mono text-[11px] tracking-wide text-neutral-500`,children:[`biz (`,e,`): `,t]}),(0,l.jsxs)(`span`,{className:`text-[12px] text-neutral-500`,children:[`Developer business ID (`,e,`)`]})]},e))),T!==null&&(0,l.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,l.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-neutral-600`,children:[`bundle: `,u(T)]}),(0,l.jsx)(`span`,{className:`text-[12px] text-neutral-500`,children:`Total size of bundle.json`})]})]})]})}),w||D.length>0||O.length>0||m.releaseNotes?(0,l.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3`,children:[h.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Floating Frames`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:h.length})]}),(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,l.jsx)(`span`,{className:`shrink-0`,children:`Position`})]}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:h.map((e,t)=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,l.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.default_position&&(0,l.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:e.default_position})]},t))})]}),g.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Data Adornments`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:g.length})]}),(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Field`}),(0,l.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:g.map((e,n)=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[e.config.color&&(0,l.jsx)(`span`,{className:`h-3 w-4 shrink-0 rounded-sm border border-black/10`,style:{backgroundColor:e.config.color}}),e.config.icon&&(o[e.config.icon]?(0,l.jsx)(t,{icon:o[e.config.icon],className:`shrink-0 text-[12px] text-neutral-500`}):(0,l.jsx)(`span`,{className:`shrink-0 rounded px-1 font-mono text-[10px] ${c.has(e.config.icon)||s.has(e.config.icon)?`bg-neutral-100 text-neutral-400`:`bg-amber-100 text-amber-600`}`,children:e.config.icon})),(0,l.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:e.config.tooltip||e.field_type}),(0,l.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.field_type})]},n))})]}),_.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Routable Pages`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:_.length})]}),(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Page`}),(0,l.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:_.map((e,t)=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,l.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.iframe_url&&(0,l.jsx)(`span`,{className:`shrink-0 rounded bg-purple-100 px-1.5 py-0.5 text-[10px] font-semibold text-purple-600`,children:`iframe`})]},t))})]}),v.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Toolbar Items`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:v.length})]}),(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Label`}),(0,l.jsx)(`span`,{className:`shrink-0`,children:`Icon`})]}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:v.map((e,n)=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[e.color&&(0,l.jsx)(`span`,{className:`h-3 w-4 shrink-0 rounded-sm border border-black/10`,style:{backgroundColor:e.color}}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.label}),(0,l.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.icon&&(o[e.icon]?(0,l.jsx)(t,{icon:o[e.icon],className:`shrink-0 text-[12px] text-neutral-400`}):(0,l.jsx)(`span`,{className:`shrink-0 rounded px-1 font-mono text-[10px] ${c.has(e.icon)||s.has(e.icon)?`bg-neutral-100 text-neutral-400`:`bg-amber-100 text-amber-600`}`,children:e.icon}))]},n))})]}),y.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`JS Action Templates`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:y.length})]}),(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,l.jsx)(`span`,{className:`shrink-0`,children:`Object`})]}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:y.map((e,t)=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,l.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.hint_object_name&&(0,l.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:e.hint_object_name})]},t))})]}),b.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Route Scripts`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:b.length})]}),(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,l.jsx)(`span`,{className:`shrink-0`,children:`Routes`})]}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:b.map((e,t)=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name||e.api_name}),e.name&&(0,l.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.routes.length>0&&(0,l.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:[e.routes.length,` route`,e.routes.length===1?``:`s`]})]},t))})]}),x.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Object Settings`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:x.length})]}),(0,l.jsx)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Label`})}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:x.map((e,t)=>(0,l.jsx)(`div`,{className:`flex items-center gap-2 py-1.5`,children:(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.label}),(0,l.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]})},t))})]}),S.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Automation Actions`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:S.length})]}),(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`}),(0,l.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:S.map((e,t)=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,l.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.action_step_api_name})]}),e.action_type&&(0,l.jsx)(`span`,{className:`shrink-0 rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600`,children:e.action_type})]},t))})]}),C.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Calendar Sources`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:C.length})]}),(0,l.jsx)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Name`})}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:C.map((e,t)=>(0,l.jsx)(`div`,{className:`flex items-center gap-2 py-1.5`,children:(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,l.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]})},t))})]}),D.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Setup Assistant`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:D.length})]}),(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Field`}),(0,l.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:D.map((e,t)=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:`label`in e?e.label??e.key:e.type}),(0,l.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.type})]},t))})]}),O.length>0&&(0,l.jsxs)(a,{children:[(0,l.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`User Setup Assistant`}),(0,l.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:O.length})]}),(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[10px] text-neutral-400`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Field`}),(0,l.jsx)(`span`,{className:`shrink-0`,children:`Type`})]}),(0,l.jsx)(`div`,{className:`divide-y divide-black/5`,children:O.map((e,t)=>(0,l.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,l.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:`label`in e?e.label??e.key:e.type}),(0,l.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.type})]},t))})]}),m.releaseNotes&&(0,l.jsxs)(a,{children:[(0,l.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Release Notes`}),(0,l.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-[12px] leading-relaxed text-neutral-700`,children:m.releaseNotes})]})]}):(0,l.jsx)(a,{children:(0,l.jsx)(`p`,{className:`text-[13px] text-neutral-400`,children:`No plugin assets defined.`})})]})};export{d as AppDetailPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{A as t,O as n,j as r,k as i}from"./fa-core-BoBqCOD3.js";import{n as a}from"./react-csXWLXSE.js";import{C as o,D as s,E as c,F as l,I as u,O as d,P as f,S as p,T as m,_ as h,b as g,g as _,h as v,j as y,k as b,m as x,v as S,w as C,x as w,y as T}from"./useQuery-5OkVbV1s.js";function E(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{T(e,()=>t.signal,()=>n=!0)},u=p(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?w:g;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?O:D,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:D(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function D(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function O(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var k=class extends v{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||A(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=_({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),S.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function A(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var j=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new k({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=M(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=M(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=M(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=M(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){S.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>c(t,e))}findAll(e={}){return this.getAll().filter(t=>c(e,t))}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return S.batch(()=>Promise.all(e.map(e=>e.continue().catch(d))))}};function M(e){return e.options.scope?.id}var N=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??m(r,t),a=this.get(i);return a||(a=new x({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){S.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>s(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>s(e,t)):t}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){S.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){S.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},P=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new N,this.#t=e.mutationCache||new j,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=l.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=h.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(y(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=o(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return S.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;S.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return S.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=S.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(d).catch(d)}invalidateQueries(e,t={}){return S.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=S.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(d)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(d)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(y(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(d).catch(d)}fetchInfiniteQuery(e){return e.behavior=E(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(d).catch(d)}ensureInfiniteQueryData(e){return e.behavior=E(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(C(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{b(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(C(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{b(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=m(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===f&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},F=e(r(),1),I=t(),L={sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-xl`,xl:`max-w-2xl`},R=({open:e,onBackdropClick:t,size:n=`md`,ariaModal:r=!1,fontMono:i=!0,header:a,footer:o,children:s})=>e?(0,I.jsx)(`div`,{role:`dialog`,"aria-modal":r||void 0,className:`fixed inset-0 z-[99999] flex items-start justify-center overflow-y-auto bg-black/30 px-4 py-12`,onClick:t,children:(0,I.jsxs)(`div`,{className:`w-full ${L[n]} rounded-lg border border-black/10 bg-white ${i?`font-mono`:``} shadow-xl`,onClick:e=>{e.stopPropagation()},children:[a,s,o!=null&&(0,I.jsx)(`div`,{className:`flex justify-end gap-2 border-t border-black/8 px-5 py-3`,children:o})]})}):null,z={red:`bg-red-500`,green:`bg-green-500`,"blue-pulse":`bg-blue-500 animate-pulse`},B=({title:e,statusDot:t,onClose:r})=>{let a=t!==void 0,o=r!==void 0;return(0,I.jsxs)(`div`,{className:`${o?`flex items-center justify-between`:a?`flex items-center gap-2`:``} border-b border-black/8 px-5 py-3`,children:[a&&(0,I.jsx)(`span`,{className:`h-2 w-2 rounded-full ${z[t]}`}),(0,I.jsx)(`span`,{className:`text-[13px] font-semibold text-neutral-900`,children:e}),o&&(0,I.jsx)(`button`,{onClick:r,className:`text-[12px] text-neutral-400 hover:text-neutral-700`,"aria-label":`Close`,children:(0,I.jsx)(i,{icon:n})})]})},V=a(),H=({anchorRef:e,open:t,children:n,className:r})=>{let[i,a]=(0,F.useState)({});return(0,F.useEffect)(()=>{if(!t||!e.current)return;let n=()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect(),r=window.innerHeight-n.bottom;r<196&&n.top>r?a({position:`fixed`,zIndex:999999,left:n.left,width:n.width,bottom:window.innerHeight-n.top+4,maxHeight:192}):a({position:`fixed`,zIndex:999999,left:n.left,width:n.width,top:n.bottom+4,maxHeight:192})};return n(),window.addEventListener(`scroll`,n,!0),window.addEventListener(`resize`,n),()=>{window.removeEventListener(`scroll`,n,!0),window.removeEventListener(`resize`,n)}},[t,e]),t?(0,V.createPortal)((0,I.jsx)(`div`,{style:i,className:`overflow-auto rounded border border-black/10 bg-white font-mono shadow-lg ${r??``}`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},children:n}),document.body):null},U=(0,F.createContext)(void 0),W=()=>(0,F.useContext)(U);export{B as a,R as i,W as n,P as o,H as r,A as s,U as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{A as t,O as n,j as r,k as i}from"./fa-core-C4eeAd4v.js";import{n as a}from"./react-CmC5kGa_.js";import{C as o,D as s,E as c,F as l,I as u,O as d,P as f,S as p,T as m,_ as h,b as g,g as _,h as v,j as y,k as b,m as x,v as S,w as C,x as w,y as T}from"./useQuery-B3Ek2Yet.js";function E(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{T(e,()=>t.signal,()=>n=!0)},u=p(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?w:g;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?O:D,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:D(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function D(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function O(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var k=class extends v{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||A(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=_({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),S.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function A(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var j=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new k({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=M(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=M(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=M(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=M(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){S.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>c(t,e))}findAll(e={}){return this.getAll().filter(t=>c(e,t))}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return S.batch(()=>Promise.all(e.map(e=>e.continue().catch(d))))}};function M(e){return e.options.scope?.id}var N=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??m(r,t),a=this.get(i);return a||(a=new x({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){S.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>s(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>s(e,t)):t}notify(e){S.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){S.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){S.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},P=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new N,this.#t=e.mutationCache||new j,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=l.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=h.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(y(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=o(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return S.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;S.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return S.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=S.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(d).catch(d)}invalidateQueries(e,t={}){return S.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=S.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(d)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(d)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(y(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(d).catch(d)}fetchInfiniteQuery(e){return e.behavior=E(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(d).catch(d)}ensureInfiniteQueryData(e){return e.behavior=E(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(C(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{b(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(C(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{b(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=m(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===f&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},F=e(r(),1),I=t(),L={sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-xl`,xl:`max-w-2xl`},R=({open:e,onBackdropClick:t,size:n=`md`,ariaModal:r=!1,fontMono:i=!0,header:a,footer:o,children:s})=>e?(0,I.jsx)(`div`,{role:`dialog`,"aria-modal":r||void 0,className:`fixed inset-0 z-[99999] flex items-start justify-center overflow-y-auto bg-black/30 px-4 py-12`,onClick:t,children:(0,I.jsxs)(`div`,{className:`w-full ${L[n]} rounded-lg border border-black/10 bg-white ${i?`font-mono`:``} shadow-xl`,onClick:e=>{e.stopPropagation()},children:[a,s,o!=null&&(0,I.jsx)(`div`,{className:`flex justify-end gap-2 border-t border-black/8 px-5 py-3`,children:o})]})}):null,z={red:`bg-red-500`,green:`bg-green-500`,"blue-pulse":`bg-blue-500 animate-pulse`},B=({title:e,statusDot:t,onClose:r})=>{let a=t!==void 0,o=r!==void 0;return(0,I.jsxs)(`div`,{className:`${o?`flex items-center justify-between`:a?`flex items-center gap-2`:``} border-b border-black/8 px-5 py-3`,children:[a&&(0,I.jsx)(`span`,{className:`h-2 w-2 rounded-full ${z[t]}`}),(0,I.jsx)(`span`,{className:`text-[13px] font-semibold text-neutral-900`,children:e}),o&&(0,I.jsx)(`button`,{onClick:r,className:`text-[12px] text-neutral-400 hover:text-neutral-700`,"aria-label":`Close`,children:(0,I.jsx)(i,{icon:n})})]})},V=a(),H=({anchorRef:e,open:t,children:n,className:r})=>{let[i,a]=(0,F.useState)({});return(0,F.useEffect)(()=>{if(!t||!e.current)return;let n=()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect(),r=window.innerHeight-n.bottom;r<196&&n.top>r?a({position:`fixed`,zIndex:999999,left:n.left,width:n.width,bottom:window.innerHeight-n.top+4,maxHeight:192}):a({position:`fixed`,zIndex:999999,left:n.left,width:n.width,top:n.bottom+4,maxHeight:192})};return n(),window.addEventListener(`scroll`,n,!0),window.addEventListener(`resize`,n),()=>{window.removeEventListener(`scroll`,n,!0),window.removeEventListener(`resize`,n)}},[t,e]),t?(0,V.createPortal)((0,I.jsx)(`div`,{style:i,className:`overflow-auto rounded border border-black/10 bg-white font-mono shadow-lg ${r??``}`,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},children:n}),document.body):null},U=(0,F.createContext)(void 0),W=()=>(0,F.useContext)(U);export{B as a,R as i,W as n,P as o,H as r,A as s,U as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e}from"./fa-core-BoBqCOD3.js";var t=e(),n=({children:e,className:n=``})=>(0,t.jsx)(`div`,{className:`rounded-xl bg-white p-5 shadow-sm ${n}`,children:e});export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e}from"./fa-core-C4eeAd4v.js";var t=e(),n=({children:e,className:n=``})=>(0,t.jsx)(`div`,{className:`rounded-xl bg-white p-5 shadow-sm ${n}`,children:e});export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{A as t,i as n,j as r,k as i,o as a}from"./fa-core-C4eeAd4v.js";import{t as o}from"./useNavigate-Ci7hClRo.js";import{n as s}from"./bundleQuery-BQLpZ06V.js";import{r as c}from"./api-bszpvP9L.js";import{t as l}from"./Card-C7KVwKfm.js";import{n as u,t as d}from"./useCurrentApp-x1p8URhM.js";import{t as f}from"./CodeViewer--wbTev7Q.js";import{t as p}from"./useLocalStorage-HYhrPUxS.js";var m=e(r(),1),h=t(),g=({title:e,defaultOpen:t=!1,children:r})=>{let[o,s]=(0,m.useState)(t);return(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`button`,{onClick:()=>{s(e=>!e)},className:`flex w-full items-center gap-1.5 py-1 text-[11px] font-semibold uppercase tracking-widest text-neutral-400 hover:text-neutral-600`,children:[(0,h.jsx)(i,{icon:o?n:a,className:`w-2.5`}),e]}),o&&(0,h.jsx)(`div`,{className:`pb-2`,children:r})]})},_=({result:e})=>{let t=Object.entries(e.outputValues);return(0,h.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-black/10 bg-white p-4`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold ${e.success?`bg-green-100 text-green-700`:`bg-red-100 text-red-700`}`,children:e.success?`Success`:`Error`}),(0,h.jsxs)(`span`,{className:`text-[11px] text-neutral-400`,children:[String(e.durationMs),`ms`]}),e.exitCode!==0&&(0,h.jsxs)(`span`,{className:`text-[11px] text-neutral-400`,children:[`exit code `,String(e.exitCode)]})]}),e.error&&(0,h.jsx)(`pre`,{className:`overflow-auto rounded bg-red-50 p-3 font-mono text-[12px] text-red-800`,children:e.error}),t.length>0&&(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Outputs`}),(0,h.jsx)(`div`,{className:`divide-y divide-black/5`,children:t.map(([e,t])=>(0,h.jsxs)(`div`,{className:`flex items-start gap-2 py-1.5`,children:[(0,h.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] text-neutral-600`,children:e}),(0,h.jsx)(`span`,{className:`text-[11px] text-neutral-300`,children:`=`}),(0,h.jsx)(`pre`,{className:`min-w-0 flex-1 overflow-auto font-mono text-[12px] text-neutral-800`,children:typeof t==`string`?t:JSON.stringify(t,null,2)})]},e))})]}),e.logs.length>0&&(0,h.jsx)(g,{title:`Logs (${String(e.logs.length)})`,children:(0,h.jsx)(`div`,{className:`space-y-0.5`,children:e.logs.map((e,t)=>(0,h.jsx)(`div`,{className:`font-mono text-[12px] text-neutral-600`,children:e},t))})}),e.stdout&&(0,h.jsx)(g,{title:`Stdout`,children:(0,h.jsx)(`pre`,{className:`overflow-auto rounded bg-neutral-50 p-3 font-mono text-[12px] text-neutral-700`,children:e.stdout})}),e.stderr&&(0,h.jsx)(g,{title:`Stderr`,children:(0,h.jsx)(`pre`,{className:`overflow-auto rounded bg-neutral-50 p-3 font-mono text-[12px] text-neutral-700`,children:e.stderr})}),e.httpRequests&&e.httpRequests.count>0&&(0,h.jsx)(g,{title:`Network (${String(e.httpRequests.count)}${e.httpRequests.notLogged>0?`, ${String(e.httpRequests.notLogged)} not logged`:``})`,children:(0,h.jsx)(`div`,{className:`space-y-1.5`,children:e.httpRequests.requests.map((e,t)=>(0,h.jsx)(b,{request:e},t))})})]})},v=e=>{switch(e.toUpperCase()){case`GET`:return`bg-blue-100 text-blue-700`;case`POST`:return`bg-green-100 text-green-700`;case`PUT`:case`PATCH`:return`bg-amber-100 text-amber-700`;case`DELETE`:return`bg-red-100 text-red-700`;default:return`bg-neutral-100 text-neutral-700`}},y=(e,t)=>t||e>=500?`text-red-700`:e>=400?`text-amber-700`:e>=200?`text-green-700`:`text-neutral-600`,b=({request:e})=>{let[t,r]=(0,m.useState)(!1),o=e.requestErrorType!==null;return(0,h.jsxs)(`div`,{className:`rounded border border-black/5 bg-neutral-50`,children:[(0,h.jsxs)(`button`,{onClick:()=>{r(e=>!e)},className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left hover:bg-neutral-100`,children:[(0,h.jsx)(i,{icon:t?n:a,className:`w-2.5 text-neutral-400`}),(0,h.jsx)(`span`,{className:`rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold ${v(e.method)}`,children:e.method}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[12px] text-neutral-700`,children:e.url}),(0,h.jsx)(`span`,{className:`font-mono text-[11px] font-semibold ${y(e.responseStatusCode,o)}`,children:o?e.requestErrorType:e.responseStatusCode}),(0,h.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:[(e.duration*1e3).toFixed(0),`ms`]})]}),t&&(0,h.jsxs)(`div`,{className:`space-y-2 border-t border-black/5 p-2.5`,children:[(0,h.jsx)(x,{title:`Request Headers`,data:e.headers}),e.body&&(0,h.jsx)(S,{title:`Request Body`,body:e.body}),(0,h.jsx)(x,{title:`Response Headers`,data:e.responseHeaders}),e.responseBody&&(0,h.jsx)(S,{title:`Response Body`,body:e.responseBody})]})]})},x=({title:e,data:t})=>{let n=Object.entries(t);return n.length===0?null:(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-widest text-neutral-400`,children:e}),(0,h.jsx)(`div`,{className:`divide-y divide-black/5 rounded border border-black/5 bg-white`,children:n.map(([e,t])=>(0,h.jsxs)(`div`,{className:`flex gap-2 px-2 py-1 font-mono text-[11px]`,children:[(0,h.jsxs)(`span`,{className:`shrink-0 text-neutral-500`,children:[e,`:`]}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 break-all text-neutral-800`,children:t})]},e))})]})},S=({title:e,body:t})=>(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-widest text-neutral-400`,children:e}),(0,h.jsx)(`pre`,{className:`overflow-auto rounded border border-black/5 bg-white p-2 font-mono text-[11px] text-neutral-800`,children:t})]}),C=[`python-3-13`,`python-3-12`],w=`python-3-12`,T={text:`s`,string:`s`,number:`n`,integer:`n`,boolean:`b`,date:`d`,datetime:`dt`,phone:`p`,phonenumber:`p`,uuid:`u`,file:`f`,list:`l`};function E(e){return T[e.toLowerCase()]??`s`}function D(e){return C.includes(e)?e:w}function O(e,t){let n=Object.keys(e);if(n.length===0)return null;let r={};for(let i of n)r[i]={t:E(t[i]??`string`),v:e[i]};return r}function k(e){let t=Object.keys(e);if(t.length===0)return null;let n={};for(let r of t)n[r]=E(e[r]??`string`);return n}function A(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e))t[n]=r.v;return t}function j(e){if(!e)return;let t=e.requests.map(e=>({method:e.method,url:e.url,headers:e.headers,body:e.body,requestSubmittedAt:e.requestSubmittedAt,session:e.session,responseStatusCode:e.responseStatusCode,responseHeaders:e.responseHeaders,responseBody:e.responseBody,requestErrorType:e.requestErrorType,duration:e.duration}));return{count:e.count,notLogged:e.not_logged,requests:t}}async function M(e,t){let n=Date.now(),r={user_script:t.script,runtime:D(t.scriptRuntime),secrets:t.secretNames.length>0?t.secretNames:void 0,inputs:O(t.inputs,t.inputTypes),output_types:k(t.outputTypes)};try{let t=await e(`/coderunner/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)}),i=Date.now()-n;if(!t.ok){let e=await t.text();return{success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:`Remote runner returned ${String(t.status)}: ${e}`,exitCode:1,durationMs:i}}let a=await t.json(),o=a.error!==null,s=j(a.http_requests),c={success:!o,outputValues:A(a.values),logs:a.logs??[],stdout:``,stderr:``,exitCode:+!!o,durationMs:a.duration_ms??i,...s&&{httpRequests:s}};return o&&a.error&&(c.error=a.error.detail?`${a.error.error}\n${a.error.detail}`:a.error.error),c}catch(e){return{success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:`Remote execution failed: ${e instanceof Error?e.message:String(e)}`,exitCode:1,durationMs:Date.now()-n}}}var N=()=>{let{stepApiName:e}=s({strict:!1}),t=o(),n=d(),r=c(),[i,a]=(0,m.useState)(!1),[g,v]=(0,m.useState)(null),y=`${n.apiName??``}:${e??``}`,[b,x]=p(`kizen-step-inputs:${y}`,{}),[S,C]=p(`kizen-step-secrets:${y}`,{}),[w,T]=p(`kizen-code-runner-mode`,`local`),E=(0,m.useMemo)(()=>n.status===`ok`?n.app.artifacts.automation_action_configs:[],[n]),D=E.find(t=>t.action_step_api_name===e)??E[0],O=n.apiName;if((0,m.useEffect)(()=>{if(!e&&E.length>0&&O!==void 0){let e=E[0];e&&t({to:`/$apiName/code-steps/$stepApiName`,params:{apiName:O,stepApiName:e.action_step_api_name},replace:!0})}},[e,E,O,t]),(0,m.useEffect)(()=>{v(null)},[e]),n.status!==`ok`)return(0,h.jsx)(u,{state:n});let{apiName:k}=n;if(E.length===0)return(0,h.jsx)(l,{children:(0,h.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:`This app has no automation code steps.`})});if(!D)return(0,h.jsx)(l,{children:(0,h.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`Step not found: `,(0,h.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:e}),`.`]})});let A=async()=>{a(!0),v(null);try{let e=Object.fromEntries(D.inputs.map(e=>[e.name,b[e.name]??``])),t;t=w===`remote`?await M(r,{script:D.script,scriptRuntime:D.script_runtime,inputs:e,inputTypes:Object.fromEntries(D.inputs.map(e=>[e.name,e.data_type])),outputTypes:Object.fromEntries(D.outputs.map(e=>[e.name,e.data_type])),secretNames:D.secrets.map(e=>`${k}__${e}`)}):await(await fetch(`/api/execute-step`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({script:D.script,scriptRuntime:D.script_runtime,inputs:e,secrets:Object.fromEntries(D.secrets.map(e=>[`${k}__${e}`,S[e]??``]))})})).json(),v(t)}catch(e){v({success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:e instanceof Error?e.message:String(e),exitCode:1,durationMs:0})}finally{a(!1)}};return(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsxs)(l,{children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Code Step`}),(0,h.jsx)(`select`,{value:D.action_step_api_name,onChange:e=>{k&&t({to:`/$apiName/code-steps/$stepApiName`,params:{apiName:k,stepApiName:e.target.value}})},className:`rounded border border-black/10 bg-transparent px-2 py-0.5 text-[13px] font-mono text-neutral-700 focus:outline-none`,children:E.map(e=>(0,h.jsx)(`option`,{value:e.action_step_api_name,children:e.name},e.action_step_api_name))}),(0,h.jsx)(`div`,{className:`flex-1`}),(0,h.jsx)(`span`,{className:`rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600`,children:D.script_runtime})]}),D.overall_description&&(0,h.jsx)(`p`,{className:`mt-2 text-[12px] text-neutral-500`,children:D.overall_description})]}),(0,h.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-3`,children:[(0,h.jsxs)(l,{children:[(0,h.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Inputs`}),D.inputs.length>0?(0,h.jsx)(`div`,{className:`space-y-3`,children:D.inputs.map(e=>(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`label`,{className:`mb-1 block text-[12px] text-neutral-700`,children:[e.label,e.required&&(0,h.jsx)(`span`,{className:`ml-0.5 text-red-500`,children:`*`})]}),(0,h.jsx)(`input`,{type:`text`,value:b[e.name]??``,onChange:t=>{x({...b,[e.name]:t.target.value})},placeholder:e.name,className:`w-full rounded border border-black/10 bg-white px-2.5 py-1.5 font-mono text-[13px] text-neutral-800 placeholder:text-neutral-300 focus:border-blue-300 focus:outline-none`}),(0,h.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-neutral-400`,children:e.name})]},e.name))}):(0,h.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]}),(0,h.jsxs)(l,{children:[(0,h.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Outputs`}),D.outputs.length>0?(0,h.jsx)(`div`,{className:`space-y-2`,children:D.outputs.map(e=>(0,h.jsxs)(`div`,{className:`flex items-baseline gap-2 rounded border border-black/5 bg-neutral-50 px-2.5 py-1.5`,children:[(0,h.jsx)(`span`,{className:`text-[13px] text-neutral-700`,children:e.label}),(0,h.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:e.name}),(0,h.jsx)(`span`,{className:`ml-auto rounded bg-white px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.data_type})]},e.name))}):(0,h.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]}),(0,h.jsxs)(l,{children:[(0,h.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Secrets`}),w===`remote`&&(0,h.jsx)(`p`,{className:`mb-3 rounded border border-blue-100 bg-blue-50 px-2.5 py-1.5 text-[12px] text-blue-700`,children:`Remote runner uses secrets from your business context.`}),D.secrets.length>0?(0,h.jsx)(`div`,{className:`space-y-3`,children:D.secrets.map(e=>(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`label`,{className:`mb-1 block text-[12px] text-neutral-700`,children:e}),(0,h.jsx)(`input`,{type:`password`,value:S[e]??``,onChange:t=>{C({...S,[e]:t.target.value})},placeholder:e,disabled:w===`remote`,className:`w-full rounded border border-black/10 bg-white px-2.5 py-1.5 font-mono text-[13px] text-neutral-800 placeholder:text-neutral-300 focus:border-blue-300 focus:outline-none disabled:cursor-not-allowed disabled:bg-neutral-50 disabled:text-neutral-400`})]},e))}):(0,h.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]})]}),(0,h.jsx)(f,{code:D.script,language:`python`,onRun:()=>void A(),isRunning:i,executionMode:w,onModeChange:T}),g&&(0,h.jsx)(_,{result:g})]})};export{N as CodeStepsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{A as t,i as n,j as r,k as i,o as a}from"./fa-core-C4eeAd4v.js";import{t as o}from"./useNavigate-Ci7hClRo.js";import{n as s}from"./bundleQuery-BQLpZ06V.js";import{r as c}from"./api-bszpvP9L.js";import{t as l}from"./Card-C7KVwKfm.js";import{n as u,t as d}from"./useCurrentApp-CWtSEVC4.js";import{t as f}from"./CodeViewer--wbTev7Q.js";import{t as p}from"./useLocalStorage-HYhrPUxS.js";var m=e(r(),1),h=t(),g=({title:e,defaultOpen:t=!1,children:r})=>{let[o,s]=(0,m.useState)(t);return(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`button`,{onClick:()=>{s(e=>!e)},className:`flex w-full items-center gap-1.5 py-1 text-[11px] font-semibold uppercase tracking-widest text-neutral-400 hover:text-neutral-600`,children:[(0,h.jsx)(i,{icon:o?n:a,className:`w-2.5`}),e]}),o&&(0,h.jsx)(`div`,{className:`pb-2`,children:r})]})},_=({result:e})=>{let t=Object.entries(e.outputValues);return(0,h.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-black/10 bg-white p-4`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold ${e.success?`bg-green-100 text-green-700`:`bg-red-100 text-red-700`}`,children:e.success?`Success`:`Error`}),(0,h.jsxs)(`span`,{className:`text-[11px] text-neutral-400`,children:[String(e.durationMs),`ms`]}),e.exitCode!==0&&(0,h.jsxs)(`span`,{className:`text-[11px] text-neutral-400`,children:[`exit code `,String(e.exitCode)]})]}),e.error&&(0,h.jsx)(`pre`,{className:`overflow-auto rounded bg-red-50 p-3 font-mono text-[12px] text-red-800`,children:e.error}),t.length>0&&(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Outputs`}),(0,h.jsx)(`div`,{className:`divide-y divide-black/5`,children:t.map(([e,t])=>(0,h.jsxs)(`div`,{className:`flex items-start gap-2 py-1.5`,children:[(0,h.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] text-neutral-600`,children:e}),(0,h.jsx)(`span`,{className:`text-[11px] text-neutral-300`,children:`=`}),(0,h.jsx)(`pre`,{className:`min-w-0 flex-1 overflow-auto font-mono text-[12px] text-neutral-800`,children:typeof t==`string`?t:JSON.stringify(t,null,2)})]},e))})]}),e.logs.length>0&&(0,h.jsx)(g,{title:`Logs (${String(e.logs.length)})`,children:(0,h.jsx)(`div`,{className:`space-y-0.5`,children:e.logs.map((e,t)=>(0,h.jsx)(`div`,{className:`font-mono text-[12px] text-neutral-600`,children:e},t))})}),e.stdout&&(0,h.jsx)(g,{title:`Stdout`,children:(0,h.jsx)(`pre`,{className:`overflow-auto rounded bg-neutral-50 p-3 font-mono text-[12px] text-neutral-700`,children:e.stdout})}),e.stderr&&(0,h.jsx)(g,{title:`Stderr`,children:(0,h.jsx)(`pre`,{className:`overflow-auto rounded bg-neutral-50 p-3 font-mono text-[12px] text-neutral-700`,children:e.stderr})}),e.httpRequests&&e.httpRequests.count>0&&(0,h.jsx)(g,{title:`Network (${String(e.httpRequests.count)}${e.httpRequests.notLogged>0?`, ${String(e.httpRequests.notLogged)} not logged`:``})`,children:(0,h.jsx)(`div`,{className:`space-y-1.5`,children:e.httpRequests.requests.map((e,t)=>(0,h.jsx)(b,{request:e},t))})})]})},v=e=>{switch(e.toUpperCase()){case`GET`:return`bg-blue-100 text-blue-700`;case`POST`:return`bg-green-100 text-green-700`;case`PUT`:case`PATCH`:return`bg-amber-100 text-amber-700`;case`DELETE`:return`bg-red-100 text-red-700`;default:return`bg-neutral-100 text-neutral-700`}},y=(e,t)=>t||e>=500?`text-red-700`:e>=400?`text-amber-700`:e>=200?`text-green-700`:`text-neutral-600`,b=({request:e})=>{let[t,r]=(0,m.useState)(!1),o=e.requestErrorType!==null;return(0,h.jsxs)(`div`,{className:`rounded border border-black/5 bg-neutral-50`,children:[(0,h.jsxs)(`button`,{onClick:()=>{r(e=>!e)},className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left hover:bg-neutral-100`,children:[(0,h.jsx)(i,{icon:t?n:a,className:`w-2.5 text-neutral-400`}),(0,h.jsx)(`span`,{className:`rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold ${v(e.method)}`,children:e.method}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[12px] text-neutral-700`,children:e.url}),(0,h.jsx)(`span`,{className:`font-mono text-[11px] font-semibold ${y(e.responseStatusCode,o)}`,children:o?e.requestErrorType:e.responseStatusCode}),(0,h.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:[(e.duration*1e3).toFixed(0),`ms`]})]}),t&&(0,h.jsxs)(`div`,{className:`space-y-2 border-t border-black/5 p-2.5`,children:[(0,h.jsx)(x,{title:`Request Headers`,data:e.headers}),e.body&&(0,h.jsx)(S,{title:`Request Body`,body:e.body}),(0,h.jsx)(x,{title:`Response Headers`,data:e.responseHeaders}),e.responseBody&&(0,h.jsx)(S,{title:`Response Body`,body:e.responseBody})]})]})},x=({title:e,data:t})=>{let n=Object.entries(t);return n.length===0?null:(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-widest text-neutral-400`,children:e}),(0,h.jsx)(`div`,{className:`divide-y divide-black/5 rounded border border-black/5 bg-white`,children:n.map(([e,t])=>(0,h.jsxs)(`div`,{className:`flex gap-2 px-2 py-1 font-mono text-[11px]`,children:[(0,h.jsxs)(`span`,{className:`shrink-0 text-neutral-500`,children:[e,`:`]}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 break-all text-neutral-800`,children:t})]},e))})]})},S=({title:e,body:t})=>(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-widest text-neutral-400`,children:e}),(0,h.jsx)(`pre`,{className:`overflow-auto rounded border border-black/5 bg-white p-2 font-mono text-[11px] text-neutral-800`,children:t})]}),C=[`python-3-13`,`python-3-12`],w=`python-3-12`,T={text:`s`,string:`s`,number:`n`,integer:`n`,boolean:`b`,date:`d`,datetime:`dt`,phone:`p`,phonenumber:`p`,uuid:`u`,file:`f`,list:`l`};function E(e){return T[e.toLowerCase()]??`s`}function D(e){return C.includes(e)?e:w}function O(e,t){let n=Object.keys(e);if(n.length===0)return null;let r={};for(let i of n)r[i]={t:E(t[i]??`string`),v:e[i]};return r}function k(e){let t=Object.keys(e);if(t.length===0)return null;let n={};for(let r of t)n[r]=E(e[r]??`string`);return n}function A(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e))t[n]=r.v;return t}function j(e){if(!e)return;let t=e.requests.map(e=>({method:e.method,url:e.url,headers:e.headers,body:e.body,requestSubmittedAt:e.requestSubmittedAt,session:e.session,responseStatusCode:e.responseStatusCode,responseHeaders:e.responseHeaders,responseBody:e.responseBody,requestErrorType:e.requestErrorType,duration:e.duration}));return{count:e.count,notLogged:e.not_logged,requests:t}}async function M(e,t){let n=Date.now(),r={user_script:t.script,runtime:D(t.scriptRuntime),secrets:t.secretNames.length>0?t.secretNames:void 0,inputs:O(t.inputs,t.inputTypes),output_types:k(t.outputTypes)};try{let t=await e(`/coderunner/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)}),i=Date.now()-n;if(!t.ok){let e=await t.text();return{success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:`Remote runner returned ${String(t.status)}: ${e}`,exitCode:1,durationMs:i}}let a=await t.json(),o=a.error!==null,s=j(a.http_requests),c={success:!o,outputValues:A(a.values),logs:a.logs??[],stdout:``,stderr:``,exitCode:+!!o,durationMs:a.duration_ms??i,...s&&{httpRequests:s}};return o&&a.error&&(c.error=a.error.detail?`${a.error.error}\n${a.error.detail}`:a.error.error),c}catch(e){return{success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:`Remote execution failed: ${e instanceof Error?e.message:String(e)}`,exitCode:1,durationMs:Date.now()-n}}}var N=()=>{let{stepApiName:e}=s({strict:!1}),t=o(),n=d(),r=c(),[i,a]=(0,m.useState)(!1),[g,v]=(0,m.useState)(null),y=`${n.apiName??``}:${e??``}`,[b,x]=p(`kizen-step-inputs:${y}`,{}),[S,C]=p(`kizen-step-secrets:${y}`,{}),[w,T]=p(`kizen-code-runner-mode`,`local`),E=(0,m.useMemo)(()=>n.status===`ok`?n.app.artifacts.automation_action_configs:[],[n]),D=E.find(t=>t.action_step_api_name===e)??E[0],O=n.apiName;if((0,m.useEffect)(()=>{if(!e&&E.length>0&&O!==void 0){let e=E[0];e&&t({to:`/$apiName/code-steps/$stepApiName`,params:{apiName:O,stepApiName:e.action_step_api_name},replace:!0})}},[e,E,O,t]),(0,m.useEffect)(()=>{v(null)},[e]),n.status!==`ok`)return(0,h.jsx)(u,{state:n});let{apiName:k}=n;if(E.length===0)return(0,h.jsx)(l,{children:(0,h.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:`This app has no automation code steps.`})});if(!D)return(0,h.jsx)(l,{children:(0,h.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`Step not found: `,(0,h.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:e}),`.`]})});let A=async()=>{a(!0),v(null);try{let e=Object.fromEntries(D.inputs.map(e=>[e.name,b[e.name]??``])),t;t=w===`remote`?await M(r,{script:D.script,scriptRuntime:D.script_runtime,inputs:e,inputTypes:Object.fromEntries(D.inputs.map(e=>[e.name,e.data_type])),outputTypes:Object.fromEntries(D.outputs.map(e=>[e.name,e.data_type])),secretNames:D.secrets.map(e=>`${k}__${e}`)}):await(await fetch(`/api/execute-step`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({script:D.script,scriptRuntime:D.script_runtime,inputs:e,secrets:Object.fromEntries(D.secrets.map(e=>[`${k}__${e}`,S[e]??``]))})})).json(),v(t)}catch(e){v({success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:e instanceof Error?e.message:String(e),exitCode:1,durationMs:0})}finally{a(!1)}};return(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsxs)(l,{children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Code Step`}),(0,h.jsx)(`select`,{value:D.action_step_api_name,onChange:e=>{k&&t({to:`/$apiName/code-steps/$stepApiName`,params:{apiName:k,stepApiName:e.target.value}})},className:`rounded border border-black/10 bg-transparent px-2 py-0.5 text-[13px] font-mono text-neutral-700 focus:outline-none`,children:E.map(e=>(0,h.jsx)(`option`,{value:e.action_step_api_name,children:e.name},e.action_step_api_name))}),(0,h.jsx)(`div`,{className:`flex-1`}),(0,h.jsx)(`span`,{className:`rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600`,children:D.script_runtime})]}),D.overall_description&&(0,h.jsx)(`p`,{className:`mt-2 text-[12px] text-neutral-500`,children:D.overall_description})]}),(0,h.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-3`,children:[(0,h.jsxs)(l,{children:[(0,h.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Inputs`}),D.inputs.length>0?(0,h.jsx)(`div`,{className:`space-y-3`,children:D.inputs.map(e=>(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`label`,{className:`mb-1 block text-[12px] text-neutral-700`,children:[e.label,e.required&&(0,h.jsx)(`span`,{className:`ml-0.5 text-red-500`,children:`*`})]}),(0,h.jsx)(`input`,{type:`text`,value:b[e.name]??``,onChange:t=>{x({...b,[e.name]:t.target.value})},placeholder:e.name,className:`w-full rounded border border-black/10 bg-white px-2.5 py-1.5 font-mono text-[13px] text-neutral-800 placeholder:text-neutral-300 focus:border-blue-300 focus:outline-none`}),(0,h.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-neutral-400`,children:e.name})]},e.name))}):(0,h.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]}),(0,h.jsxs)(l,{children:[(0,h.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Outputs`}),D.outputs.length>0?(0,h.jsx)(`div`,{className:`space-y-2`,children:D.outputs.map(e=>(0,h.jsxs)(`div`,{className:`flex items-baseline gap-2 rounded border border-black/5 bg-neutral-50 px-2.5 py-1.5`,children:[(0,h.jsx)(`span`,{className:`text-[13px] text-neutral-700`,children:e.label}),(0,h.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:e.name}),(0,h.jsx)(`span`,{className:`ml-auto rounded bg-white px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.data_type})]},e.name))}):(0,h.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]}),(0,h.jsxs)(l,{children:[(0,h.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Secrets`}),w===`remote`&&(0,h.jsx)(`p`,{className:`mb-3 rounded border border-blue-100 bg-blue-50 px-2.5 py-1.5 text-[12px] text-blue-700`,children:`Remote runner uses secrets from your business context.`}),D.secrets.length>0?(0,h.jsx)(`div`,{className:`space-y-3`,children:D.secrets.map(e=>(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`label`,{className:`mb-1 block text-[12px] text-neutral-700`,children:e}),(0,h.jsx)(`input`,{type:`password`,value:S[e]??``,onChange:t=>{C({...S,[e]:t.target.value})},placeholder:e,disabled:w===`remote`,className:`w-full rounded border border-black/10 bg-white px-2.5 py-1.5 font-mono text-[13px] text-neutral-800 placeholder:text-neutral-300 focus:border-blue-300 focus:outline-none disabled:cursor-not-allowed disabled:bg-neutral-50 disabled:text-neutral-400`})]},e))}):(0,h.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]})]}),(0,h.jsx)(f,{code:D.script,language:`python`,onRun:()=>void A(),isRunning:i,executionMode:w,onModeChange:T}),g&&(0,h.jsx)(_,{result:g})]})};export{N as CodeStepsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{A as t,a as n,j as r,k as i,r as a}from"./fa-core-BoBqCOD3.js";import{t as o}from"./useNavigate-BblEmQ3O.js";import{n as s,t as c}from"./bundleQuery-CjbA01rb.js";import{t as l}from"./useQuery-5OkVbV1s.js";import{r as u}from"./api-DFDquUsn.js";import{t as d}from"./Card-BpDJPrPZ.js";import{t as f}from"./CodeViewer-Cm7Th9pG.js";import{t as p}from"./useLocalStorage-eJ1PxgAP.js";var m=e(r(),1),h=t(),g=({title:e,defaultOpen:t=!1,children:r})=>{let[o,s]=(0,m.useState)(t);return(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`button`,{onClick:()=>{s(e=>!e)},className:`flex w-full items-center gap-1.5 py-1 text-[11px] font-semibold uppercase tracking-widest text-neutral-400 hover:text-neutral-600`,children:[(0,h.jsx)(i,{icon:o?a:n,className:`w-2.5`}),e]}),o&&(0,h.jsx)(`div`,{className:`pb-2`,children:r})]})},_=({result:e})=>{let t=Object.entries(e.outputValues);return(0,h.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-black/10 bg-white p-4`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold ${e.success?`bg-green-100 text-green-700`:`bg-red-100 text-red-700`}`,children:e.success?`Success`:`Error`}),(0,h.jsxs)(`span`,{className:`text-[11px] text-neutral-400`,children:[String(e.durationMs),`ms`]}),e.exitCode!==0&&(0,h.jsxs)(`span`,{className:`text-[11px] text-neutral-400`,children:[`exit code `,String(e.exitCode)]})]}),e.error&&(0,h.jsx)(`pre`,{className:`overflow-auto rounded bg-red-50 p-3 font-mono text-[12px] text-red-800`,children:e.error}),t.length>0&&(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Outputs`}),(0,h.jsx)(`div`,{className:`divide-y divide-black/5`,children:t.map(([e,t])=>(0,h.jsxs)(`div`,{className:`flex items-start gap-2 py-1.5`,children:[(0,h.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] text-neutral-600`,children:e}),(0,h.jsx)(`span`,{className:`text-[11px] text-neutral-300`,children:`=`}),(0,h.jsx)(`pre`,{className:`min-w-0 flex-1 overflow-auto font-mono text-[12px] text-neutral-800`,children:typeof t==`string`?t:JSON.stringify(t,null,2)})]},e))})]}),e.logs.length>0&&(0,h.jsx)(g,{title:`Logs (${String(e.logs.length)})`,children:(0,h.jsx)(`div`,{className:`space-y-0.5`,children:e.logs.map((e,t)=>(0,h.jsx)(`div`,{className:`font-mono text-[12px] text-neutral-600`,children:e},t))})}),e.stdout&&(0,h.jsx)(g,{title:`Stdout`,children:(0,h.jsx)(`pre`,{className:`overflow-auto rounded bg-neutral-50 p-3 font-mono text-[12px] text-neutral-700`,children:e.stdout})}),e.stderr&&(0,h.jsx)(g,{title:`Stderr`,children:(0,h.jsx)(`pre`,{className:`overflow-auto rounded bg-neutral-50 p-3 font-mono text-[12px] text-neutral-700`,children:e.stderr})}),e.httpRequests&&e.httpRequests.count>0&&(0,h.jsx)(g,{title:`Network (${String(e.httpRequests.count)}${e.httpRequests.notLogged>0?`, ${String(e.httpRequests.notLogged)} not logged`:``})`,children:(0,h.jsx)(`div`,{className:`space-y-1.5`,children:e.httpRequests.requests.map((e,t)=>(0,h.jsx)(b,{request:e},t))})})]})},v=e=>{switch(e.toUpperCase()){case`GET`:return`bg-blue-100 text-blue-700`;case`POST`:return`bg-green-100 text-green-700`;case`PUT`:case`PATCH`:return`bg-amber-100 text-amber-700`;case`DELETE`:return`bg-red-100 text-red-700`;default:return`bg-neutral-100 text-neutral-700`}},y=(e,t)=>t||e>=500?`text-red-700`:e>=400?`text-amber-700`:e>=200?`text-green-700`:`text-neutral-600`,b=({request:e})=>{let[t,r]=(0,m.useState)(!1),o=e.requestErrorType!==null;return(0,h.jsxs)(`div`,{className:`rounded border border-black/5 bg-neutral-50`,children:[(0,h.jsxs)(`button`,{onClick:()=>{r(e=>!e)},className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left hover:bg-neutral-100`,children:[(0,h.jsx)(i,{icon:t?a:n,className:`w-2.5 text-neutral-400`}),(0,h.jsx)(`span`,{className:`rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold ${v(e.method)}`,children:e.method}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[12px] text-neutral-700`,children:e.url}),(0,h.jsx)(`span`,{className:`font-mono text-[11px] font-semibold ${y(e.responseStatusCode,o)}`,children:o?e.requestErrorType:e.responseStatusCode}),(0,h.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:[(e.duration*1e3).toFixed(0),`ms`]})]}),t&&(0,h.jsxs)(`div`,{className:`space-y-2 border-t border-black/5 p-2.5`,children:[(0,h.jsx)(x,{title:`Request Headers`,data:e.headers}),e.body&&(0,h.jsx)(S,{title:`Request Body`,body:e.body}),(0,h.jsx)(x,{title:`Response Headers`,data:e.responseHeaders}),e.responseBody&&(0,h.jsx)(S,{title:`Response Body`,body:e.responseBody})]})]})},x=({title:e,data:t})=>{let n=Object.entries(t);return n.length===0?null:(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-widest text-neutral-400`,children:e}),(0,h.jsx)(`div`,{className:`divide-y divide-black/5 rounded border border-black/5 bg-white`,children:n.map(([e,t])=>(0,h.jsxs)(`div`,{className:`flex gap-2 px-2 py-1 font-mono text-[11px]`,children:[(0,h.jsxs)(`span`,{className:`shrink-0 text-neutral-500`,children:[e,`:`]}),(0,h.jsx)(`span`,{className:`min-w-0 flex-1 break-all text-neutral-800`,children:t})]},e))})]})},S=({title:e,body:t})=>(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-widest text-neutral-400`,children:e}),(0,h.jsx)(`pre`,{className:`overflow-auto rounded border border-black/5 bg-white p-2 font-mono text-[11px] text-neutral-800`,children:t})]}),C=[`python-3-13`,`python-3-12`],w=`python-3-12`,T={text:`s`,string:`s`,number:`n`,integer:`n`,boolean:`b`,date:`d`,datetime:`dt`,phone:`p`,phonenumber:`p`,uuid:`u`,file:`f`,list:`l`};function E(e){return T[e.toLowerCase()]??`s`}function D(e){return C.includes(e)?e:w}function O(e,t){let n=Object.keys(e);if(n.length===0)return null;let r={};for(let i of n)r[i]={t:E(t[i]??`string`),v:e[i]};return r}function k(e){let t=Object.keys(e);if(t.length===0)return null;let n={};for(let r of t)n[r]=E(e[r]??`string`);return n}function A(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e))t[n]=r.v;return t}function j(e){if(!e)return;let t=e.requests.map(e=>({method:e.method,url:e.url,headers:e.headers,body:e.body,requestSubmittedAt:e.requestSubmittedAt,session:e.session,responseStatusCode:e.responseStatusCode,responseHeaders:e.responseHeaders,responseBody:e.responseBody,requestErrorType:e.requestErrorType,duration:e.duration}));return{count:e.count,notLogged:e.not_logged,requests:t}}async function M(e,t){let n=Date.now(),r={user_script:t.script,runtime:D(t.scriptRuntime),secrets:t.secretNames.length>0?t.secretNames:void 0,inputs:O(t.inputs,t.inputTypes),output_types:k(t.outputTypes)};try{let t=await e(`/coderunner/run`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)}),i=Date.now()-n;if(!t.ok){let e=await t.text();return{success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:`Remote runner returned ${String(t.status)}: ${e}`,exitCode:1,durationMs:i}}let a=await t.json(),o=a.error!==null,s=j(a.http_requests),c={success:!o,outputValues:A(a.values),logs:a.logs??[],stdout:``,stderr:``,exitCode:+!!o,durationMs:a.duration_ms??i,...s&&{httpRequests:s}};return o&&a.error&&(c.error=a.error.detail?`${a.error.error}\n${a.error.detail}`:a.error.error),c}catch(e){return{success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:`Remote execution failed: ${e instanceof Error?e.message:String(e)}`,exitCode:1,durationMs:Date.now()-n}}}var N=()=>{let{apiName:e,stepApiName:t}=s({strict:!1}),n=o(),{data:r,isLoading:i,isError:a}=l(c),g=u(),[v,y]=(0,m.useState)(!1),[b,x]=(0,m.useState)(null),[S,C]=p(`kizen-step-inputs:${e??``}:${t??``}`,{}),[w,T]=p(`kizen-step-secrets:${e??``}:${t??``}`,{}),[E,D]=p(`kizen-code-runner-mode`,`local`),O=r?.find(t=>t.api_name===e),k=(0,m.useMemo)(()=>O?.artifacts.automation_action_configs??[],[O]),A=k.find(e=>e.action_step_api_name===t)??k[0];if((0,m.useEffect)(()=>{if(!t&&k.length>0&&e){let t=k[0];t&&n({to:`/$apiName/code-steps/$stepApiName`,params:{apiName:e,stepApiName:t.action_step_api_name},replace:!0})}},[t,k,e,n]),(0,m.useEffect)(()=>{x(null)},[t]),i)return(0,h.jsx)(d,{children:(0,h.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})});if(a)return(0,h.jsx)(d,{children:(0,h.jsx)(`p`,{className:`m-0 text-[13px] text-red-700`,children:`Could not load bundle.json.`})});if(!O)return(0,h.jsx)(d,{children:(0,h.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`No app found with api_name`,` `,(0,h.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:e}),`.`]})});if(k.length===0)return(0,h.jsx)(d,{children:(0,h.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:`This app has no automation code steps.`})});if(!A)return(0,h.jsx)(d,{children:(0,h.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`Step not found: `,(0,h.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:t}),`.`]})});let j=async()=>{y(!0),x(null);try{let t=Object.fromEntries(A.inputs.map(e=>[e.name,S[e.name]??``])),n;n=E===`remote`?await M(g,{script:A.script,scriptRuntime:A.script_runtime,inputs:t,inputTypes:Object.fromEntries(A.inputs.map(e=>[e.name,e.data_type])),outputTypes:Object.fromEntries(A.outputs.map(e=>[e.name,e.data_type])),secretNames:A.secrets.map(t=>`${e??``}__${t}`)}):await(await fetch(`/api/execute-step`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({script:A.script,scriptRuntime:A.script_runtime,inputs:t,secrets:Object.fromEntries(A.secrets.map(t=>[`${e??``}__${t}`,w[t]??``]))})})).json(),x(n)}catch(e){x({success:!1,outputValues:{},logs:[],stdout:``,stderr:``,error:e instanceof Error?e.message:String(e),exitCode:1,durationMs:0})}finally{y(!1)}};return(0,h.jsxs)(`div`,{className:`space-y-4`,children:[(0,h.jsxs)(d,{children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,h.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Code Step`}),(0,h.jsx)(`select`,{value:A.action_step_api_name,onChange:t=>{e&&n({to:`/$apiName/code-steps/$stepApiName`,params:{apiName:e,stepApiName:t.target.value}})},className:`rounded border border-black/10 bg-transparent px-2 py-0.5 text-[13px] font-mono text-neutral-700 focus:outline-none`,children:k.map(e=>(0,h.jsx)(`option`,{value:e.action_step_api_name,children:e.name},e.action_step_api_name))}),(0,h.jsx)(`div`,{className:`flex-1`}),(0,h.jsx)(`span`,{className:`rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600`,children:A.script_runtime})]}),A.overall_description&&(0,h.jsx)(`p`,{className:`mt-2 text-[12px] text-neutral-500`,children:A.overall_description})]}),(0,h.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-3`,children:[(0,h.jsxs)(d,{children:[(0,h.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Inputs`}),A.inputs.length>0?(0,h.jsx)(`div`,{className:`space-y-3`,children:A.inputs.map(e=>(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`label`,{className:`mb-1 block text-[12px] text-neutral-700`,children:[e.label,e.required&&(0,h.jsx)(`span`,{className:`ml-0.5 text-red-500`,children:`*`})]}),(0,h.jsx)(`input`,{type:`text`,value:S[e.name]??``,onChange:t=>{C({...S,[e.name]:t.target.value})},placeholder:e.name,className:`w-full rounded border border-black/10 bg-white px-2.5 py-1.5 font-mono text-[13px] text-neutral-800 placeholder:text-neutral-300 focus:border-blue-300 focus:outline-none`}),(0,h.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-neutral-400`,children:e.name})]},e.name))}):(0,h.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]}),(0,h.jsxs)(d,{children:[(0,h.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Outputs`}),A.outputs.length>0?(0,h.jsx)(`div`,{className:`space-y-2`,children:A.outputs.map(e=>(0,h.jsxs)(`div`,{className:`flex items-baseline gap-2 rounded border border-black/5 bg-neutral-50 px-2.5 py-1.5`,children:[(0,h.jsx)(`span`,{className:`text-[13px] text-neutral-700`,children:e.label}),(0,h.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:e.name}),(0,h.jsx)(`span`,{className:`ml-auto rounded bg-white px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.data_type})]},e.name))}):(0,h.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]}),(0,h.jsxs)(d,{children:[(0,h.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Secrets`}),E===`remote`&&(0,h.jsx)(`p`,{className:`mb-3 rounded border border-blue-100 bg-blue-50 px-2.5 py-1.5 text-[12px] text-blue-700`,children:`Remote runner uses secrets from your business context.`}),A.secrets.length>0?(0,h.jsx)(`div`,{className:`space-y-3`,children:A.secrets.map(e=>(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`label`,{className:`mb-1 block text-[12px] text-neutral-700`,children:e}),(0,h.jsx)(`input`,{type:`password`,value:w[e]??``,onChange:t=>{T({...w,[e]:t.target.value})},placeholder:e,disabled:E===`remote`,className:`w-full rounded border border-black/10 bg-white px-2.5 py-1.5 font-mono text-[13px] text-neutral-800 placeholder:text-neutral-300 focus:border-blue-300 focus:outline-none disabled:cursor-not-allowed disabled:bg-neutral-50 disabled:text-neutral-400`})]},e))}):(0,h.jsx)(`p`,{className:`m-0 text-[12px] text-neutral-400`,children:`None defined.`})]})]}),(0,h.jsx)(f,{code:A.script,language:`python`,onRun:()=>void j(),isRunning:v,executionMode:E,onModeChange:D}),b&&(0,h.jsx)(_,{result:b})]})};export{N as CodeStepsPage};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{n as e,t}from"./rolldown-runtime-DF2fYuay.js";import{A as n,T as r,j as i,k as a,x as o}from"./fa-core-C4eeAd4v.js";var s=t(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),R=I(`/\\*`,`\\*/`),z=I(`#`,`$`),B={scope:`number`,begin:D,relevance:0},V={scope:`number`,begin:O,relevance:0},H={scope:`number`,begin:k,relevance:0},ee={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},U={scope:`title`,begin:T,relevance:0},W={scope:`title`,begin:E,relevance:0},te={begin:`\\.\\s*`+E,relevance:0},G=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:H,BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:R,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:V,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:te,NUMBER_MODE:B,NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:ee,RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:U,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:W});function ne(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function re(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ie(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ne,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ae(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function oe(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function se(e,t){e.relevance===void 0&&(e.relevance=1)}var ce=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},le=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ue=`keyword`;function K(e,t,n=ue){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,K(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,de(n[0],n[1])]})}}function de(e,t){return t?Number(t):+!fe(e)}function fe(e){return le.includes(e.toLowerCase())}var q={},J=e=>{console.error(e)},Y=(e,...t)=>{console.log(`WARN: ${e}`,...t)},X=(e,t)=>{q[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),q[`${e}/${t}`]=!0)},Z=Error();function pe(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function me(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw J(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),Z;if(typeof e.beginScope!=`object`||e.beginScope===null)throw J(`beginScope must be object`),Z;pe(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function he(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw J(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),Z;if(typeof e.endScope!=`object`||e.endScope===null)throw J(`endScope must be object`),Z;pe(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function ge(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function _e(e){ge(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),me(e),he(e)}function ve(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null),this.matcherRe=t(C(this.regexes.map(e=>e[1]),{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[re,oe,_e,ce].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ie,ae,se].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=K(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return be(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function ye(e){return e?e.endsWithParent||ye(e.starts):!1}function be(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:ye(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var xe=`11.11.1`,Se=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Q=i,Ce=a,we=Symbol(`nomatch`),Te=7,Ee=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(Y(s.replace(`{}`,n[1])),Y(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(X(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),X(`10.7.0`,`Please use highlight(code, options) instead.
|
|
2
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};z(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,z(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Te&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(R=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return we;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==we)return e}if(r.type===`illegal`&&a===``)return P+=`
|
|
3
|
+
`,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw J(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=ve(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,R=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,R?R=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Q(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:Q(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:Q(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(z(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Se(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),z(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Ce(l,e)}let E=()=>{k(),X(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),X(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(J(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)J(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function R(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function z(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function B(e){return X(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),X(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:B,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Ce,addPlugin:L,removePlugin:R}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=xe,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in G)typeof G[e]==`object`&&n(G[e]);return Object.assign(e,G),e},$=Ee({});$.newInstance=()=>Ee({}),t.exports=$,$.HighlightJS=$,$.default=$})),c=e(i(),1),l=e(s()).default;function u(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}var d=`[A-Za-z$_][0-9A-Za-z$_]*`,f=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),p=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],m=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),h=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],g=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],_=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],v=[].concat(g,m,h);function y(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=d,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:d,keyword:f,literal:p,built_in:v,"variable.language":_},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,y={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},b={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},x={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`xml`}},S={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`css`}},C={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:`graphql`}},w={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},T={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,C,w,{match:/\$\d+/},y];b.contains=E.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(E)});let D=[].concat(T,b.contains),O=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(D)}]),k={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:O},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...m,...h]}},M={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},N={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[k],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function F(e){return t.concat(`(?!`,e.join(`|`),`)`)}let I={match:t.concat(/\b/,F([...g,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},R={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},k]},z=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,B={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[k]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:j},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),M,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,S,C,w,T,{match:/\$\d+/},y,j,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},B,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[T,e.REGEXP_MODE,{className:`function`,begin:z,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},N,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[k,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},L,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[k]},I,P,A,R,{match:/\$[(.]/}]}}function b(e){let t=e.regex,n=y(e),r=d,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:d,keyword:f.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:p,built_in:v.concat(i),"variable.language":_},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let m=n.contains.find(e=>e.scope===`attr`),h=Object.assign({},m,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,m,h]),n.contains=n.contains.concat([l,a,o,h]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let g=n.contains.find(e=>e.label===`func.def`);return g.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}var x=`[A-Za-z$_][0-9A-Za-z$_]*`,S=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),C=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],w=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),T=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],E=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],D=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],O=[].concat(E,w,T);function k(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=x,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:x,keyword:S,literal:C,built_in:O,"variable.language":D},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),k={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},j={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...w,...T]}},M={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},N={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[k],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function F(e){return t.concat(`(?!`,e.join(`|`),`)`)}let I={match:t.concat(/\b/,F([...E,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},R={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},k]},z=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,B={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(z)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[k]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:j},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),M,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,j,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},B,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:z,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},N,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[k,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},L,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[k]},I,P,A,R,{match:/\$[(.]/}]}}function A(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function j(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function M(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}function N(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}var P=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),F=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),I=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),L=[...F,...I],R=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),z=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),B=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),V=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function H(e){let t=e.regex,n=P(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+z.join(`|`)+`)`},{begin:`:(:)?(`+B.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+V.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:R.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+L.join(`|`)+`)\\b`}]}}function ee(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function U(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}var W=n();l.registerLanguage(`python`,u),l.registerLanguage(`typescript`,b),l.registerLanguage(`javascript`,k),l.registerLanguage(`json`,A),l.registerLanguage(`xml`,j),l.registerLanguage(`yaml`,M),l.registerLanguage(`markdown`,N),l.registerLanguage(`css`,H),l.registerLanguage(`bash`,ee),l.registerLanguage(`plaintext`,U);var te={".ts":`typescript`,".tsx":`typescript`,".js":`javascript`,".jsx":`javascript`,".mjs":`javascript`,".cjs":`javascript`,".json":`json`,".svg":`xml`,".xml":`xml`,".html":`xml`,".htm":`xml`,".yml":`yaml`,".yaml":`yaml`,".md":`markdown`,".mdx":`markdown`,".css":`css`,".scss":`css`,".sh":`bash`,".py":`python`};function G(e){return te[e.toLowerCase()]??`plaintext`}var ne=({code:e,language:t=`python`,onRun:n,isRunning:i=!1,executionMode:s,onModeChange:u})=>{let d=(0,c.useMemo)(()=>l.highlight(e,{language:t}).value.split(`
|
|
4
|
+
`),[e,t]);return(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-black/10 bg-white`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-black/10 bg-neutral-50 px-4 py-2`,children:[(0,W.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:t}),(0,W.jsx)(`div`,{className:`flex-1`}),s&&u&&(0,W.jsx)(`div`,{className:`flex overflow-hidden rounded border border-black/10 text-[11px] font-medium`,children:[`local`,`remote`].map(e=>(0,W.jsx)(`button`,{onClick:()=>{u(e)},className:`px-2.5 py-0.5 transition-colors ${s===e?`bg-neutral-700 text-white`:`bg-white text-neutral-500 hover:bg-neutral-100`}`,children:e===`local`?`Local`:`Remote`},e))}),n&&(0,W.jsxs)(`button`,{onClick:n,disabled:i,className:`flex items-center gap-1.5 rounded-full border border-black/10 bg-white px-3 py-1 text-[11px] font-medium text-neutral-600 transition-colors hover:border-green-300 hover:text-green-700 disabled:cursor-wait disabled:opacity-50`,children:[(0,W.jsx)(a,{icon:i?r:o,className:i?`animate-spin`:``}),(0,W.jsx)(`span`,{children:i?`Running…`:`Run`})]})]}),(0,W.jsxs)(`div`,{className:`flex overflow-auto bg-white font-mono text-[13px] leading-[20px]`,children:[(0,W.jsx)(`div`,{className:`shrink-0 select-none border-r border-black/5 bg-neutral-50 px-3 py-3 text-right text-neutral-300`,children:d.map((e,t)=>(0,W.jsx)(`div`,{children:String(t+1)},t))}),(0,W.jsx)(`div`,{className:`flex-1 overflow-auto py-3 pl-4 pr-4`,children:d.map((e,t)=>(0,W.jsx)(`div`,{className:`hljs whitespace-pre`,dangerouslySetInnerHTML:{__html:e||`\xA0`}},t))})]})]})};export{G as n,ne as t};
|