tide-commander 1.32.2 → 1.35.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/assets/{BossLogsModal-2lqGyuCD.js → BossLogsModal-B_dgVF7L.js} +1 -1
- package/dist/assets/{BossSpawnModal-CR-ofDeB.js → BossSpawnModal-CSO1bYxA.js} +1 -1
- package/dist/assets/{ControlsModal-DQ8QVshA.js → ControlsModal-WMTTqbca.js} +1 -1
- package/dist/assets/{DockerLogsModal-D6yQTHy7.js → DockerLogsModal-THzhLHch.js} +1 -1
- package/dist/assets/{EmbeddedEditor-wechGxGl.js → EmbeddedEditor-DWLKJYav.js} +1 -1
- package/dist/assets/GmailOAuthSetup-DN9ceaS6.js +270 -0
- package/dist/assets/{GoogleOAuthSetup-BcpJEydM.js → GoogleOAuthSetup-bVST2EOB.js} +1 -1
- package/dist/assets/{IframeModal-E2E7NR08.js → IframeModal-BELsjvgi.js} +1 -1
- package/dist/assets/{IntegrationsPanel-CrS2QOFR.js → IntegrationsPanel-DwDr4BRt.js} +2 -2
- package/dist/assets/{LogViewerModal-BpIPZeFr.js → LogViewerModal-CMe04PO5.js} +1 -1
- package/dist/assets/MonitoringModal-CqSalNeY.js +1 -0
- package/dist/assets/{PM2LogsModal-CDk_2mi1.js → PM2LogsModal-CCmCDxVt.js} +1 -1
- package/dist/assets/{RestoreArchivedAreaModal-BmgBrk9J.js → RestoreArchivedAreaModal-IfzPidIv.js} +1 -1
- package/dist/assets/{SaveSnapshotModal-DWta9pcx.js → SaveSnapshotModal-DUhrVD5l.js} +1 -1
- package/dist/assets/{Scene2DCanvas-C3CcFsjU.js → Scene2DCanvas-Bl5DUC7w.js} +1 -1
- package/dist/assets/{SceneManager-mFUakRNl.js → SceneManager-BGO9tiaI.js} +1 -1
- package/dist/assets/{SkillsPanel-Br3h8GNh.js → SkillsPanel-CPFOI4Tl.js} +1 -1
- package/dist/assets/{SnapshotManager-CPYWfnPR.js → SnapshotManager-Cbu0tJBz.js} +1 -1
- package/dist/assets/{SpawnModal-DSDirR0j.js → SpawnModal-BqDbsYLY.js} +1 -1
- package/dist/assets/{SubordinateAssignmentModal-Daz67phV.js → SubordinateAssignmentModal-DOqkhL_L.js} +1 -1
- package/dist/assets/{SupervisorPanel-DoAl5e8W.js → SupervisorPanel-BvX-dlk_.js} +1 -1
- package/dist/assets/{TriggerManagerPanel-CVIHbqDt.js → TriggerManagerPanel-RUVFmKmf.js} +1 -1
- package/dist/assets/WorkflowEditorPanel-CwZpEqzM.js +42 -0
- package/dist/assets/browser-ponyfill-DZOWXZ4K.js +2 -0
- package/dist/assets/camera-D_KeL_pz.js +1 -0
- package/dist/assets/{index-I-I3pPPW.js → index-B-wV06cR.js} +1 -1
- package/dist/assets/index-BFguOWBW.js +2 -0
- package/dist/assets/{index-uXOqPsuU.js → index-C7gqY2AA.js} +1 -1
- package/dist/assets/{index-CE_GbjZ6.js → index-CiD1Rwaq.js} +1 -1
- package/dist/assets/index-D4nfDvz4.js +49 -0
- package/dist/assets/{index-CvMf5n2v.js → index-DDPUtz8-.js} +1 -1
- package/dist/assets/{index-Chrxgrys.js → index-EH8IBvSU.js} +1 -1
- package/dist/assets/{index-DWVQ48nQ.js → index-H0PzHVFw.js} +1 -1
- package/dist/assets/main-Cjm0d8dZ.js +152 -0
- package/dist/assets/main-DqC9_fF4.css +1 -0
- package/dist/assets/{prism-cpp-CcQnz8LL.js → prism-cpp-CK2Ly5dS.js} +1 -1
- package/dist/assets/{prism-csharp-DFIAaw4Y.js → prism-csharp-ByDDDiWW.js} +1 -1
- package/dist/assets/{prism-elixir-jP4m4T-8.js → prism-elixir-df27OMMQ.js} +1 -1
- package/dist/assets/{prism-haskell-BrMZM7_F.js → prism-haskell-Ce8aBmia.js} +1 -1
- package/dist/assets/{prism-java-BEsh8u4L.js → prism-java-CK6tws4L.js} +1 -1
- package/dist/assets/{prism-perl-ecHKp0bZ.js → prism-perl-UZfqnD51.js} +1 -1
- package/dist/assets/{prism-php-Ch-kk89U.js → prism-php-Dt9698bA.js} +1 -1
- package/dist/assets/{prism-ruby-zNpGDk6v.js → prism-ruby-CQBUuZIF.js} +1 -1
- package/dist/assets/{prism-scss-BeuXx0O0.js → prism-scss-CeN16CFC.js} +1 -1
- package/dist/assets/{vendor-react-uS-d4TUT.js → vendor-react--Eh9ivFN.js} +2 -2
- package/dist/assets/{web-IWJRtE3-.js → web-D1vWYL8u.js} +1 -1
- package/dist/assets/{web-DdRt5c0R.js → web-DUq3Undh.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/src/packages/server/data/builtin-skills/boss-instructions.js +57 -66
- package/dist/src/packages/server/data/builtin-skills/index.js +2 -0
- package/dist/src/packages/server/data/builtin-skills/workflow-builder.js +253 -0
- package/dist/src/packages/server/data/builtin-skills/workflow-designer.js +157 -0
- package/dist/src/packages/server/data/event-queries.js +24 -0
- package/dist/src/packages/server/data/migrations/002_workflow_agent_binding.sql +14 -0
- package/dist/src/packages/server/data/migrations/003_matcher_executions.sql +19 -0
- package/dist/src/packages/server/data/migrations/004_matcher_message_source.sql +8 -0
- package/dist/src/packages/server/integrations/gmail/gmail-client.js +75 -15
- package/dist/src/packages/server/integrations/gmail/gmail-config.js +32 -2
- package/dist/src/packages/server/integrations/gmail/gmail-routes.js +5 -0
- package/dist/src/packages/server/integrations/gmail/index.js +23 -1
- package/dist/src/packages/server/integrations/jira/jira-client.js +11 -5
- package/dist/src/packages/server/integrations/jira/jira-routes.js +20 -3
- package/dist/src/packages/server/integrations/jira/jira-skill.js +110 -58
- package/dist/src/packages/server/routes/trigger-routes.js +22 -0
- package/dist/src/packages/server/routes/workflow-routes.js +86 -2
- package/dist/src/packages/server/services/boss-message-service.js +1 -1
- package/dist/src/packages/server/services/llm-matcher-service.js +50 -81
- package/dist/src/packages/server/services/trigger-service.js +195 -6
- package/dist/src/packages/server/services/workflow-executor.js +230 -0
- package/dist/src/packages/server/services/workflow-service.js +59 -13
- package/package.json +7 -7
- package/dist/assets/GmailOAuthSetup-B2GDjROU.js +0 -222
- package/dist/assets/MonitoringModal-CIF9MUm9.js +0 -1
- package/dist/assets/WorkflowEditorPanel-C4BRfmDM.js +0 -42
- package/dist/assets/browser-ponyfill-DIm4hKhx.js +0 -2
- package/dist/assets/camera-8crtHeRa.js +0 -1
- package/dist/assets/index--PCy0J0f.js +0 -49
- package/dist/assets/index-DOzx4Y9b.js +0 -2
- package/dist/assets/main-DQpuQfqS.css +0 -1
- package/dist/assets/main-DahZb6P4.js +0 -152
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import{r as C,L as z,p as B,j as e,y as O}from"./main-DahZb6P4.js";import"./modulepreload-polyfill-B5Qt9EMX.js";import"./vendor-react-uS-d4TUT.js";import"./vendor-three-Chj50gSY.js";const F=[{id:"intake",name:"Intake",type:"action",description:"Gather CC details from the developer via Slack",action:{type:"agent_task",agentId:"",promptTemplate:`A developer has requested a new CC (Control de Cambios). Here is their message:
|
|
2
|
-
{{trigger.slack.message}}
|
|
3
|
-
From: {{trigger.slack.user}} (Slack ID: {{trigger.slack.userId}})
|
|
4
|
-
|
|
5
|
-
You need to ask them the following questions via Slack (in channel {{trigger.slack.channel}}, thread {{trigger.slack.threadTs}}):
|
|
6
|
-
1. Release name/version
|
|
7
|
-
2. Brief description of what is being released
|
|
8
|
-
3. Which systems are affected
|
|
9
|
-
4. Desired release date and time
|
|
10
|
-
5. Is this an urgent release? (less than 2 working days)
|
|
11
|
-
6. Who else should be invited to the release event? (email addresses)
|
|
12
|
-
|
|
13
|
-
Use the slack wait-for-reply endpoint to get their answers.
|
|
14
|
-
Once you have all answers, update the workflow variables.`,skills:["slack-messaging"]},transitions:[{id:"t-intake",name:"Intake Complete",targetStateId:"create-jira",condition:{type:"agent_complete"}}],position:{x:100,y:60}},{id:"create-jira",name:"Create Jira Ticket",type:"action",description:"Create a Jira Service Desk ticket for the CC",action:{type:"agent_task",agentId:"",promptTemplate:`Create a Jira Service Desk ticket for this CC:
|
|
15
|
-
- Project: SD
|
|
16
|
-
- Issue Type: Change Request
|
|
17
|
-
- Summary: "CC - {{release_name}} - {{release_date}}"
|
|
18
|
-
- Description: Include all CC details.
|
|
19
|
-
- Labels: ["cc", "release"]
|
|
20
|
-
|
|
21
|
-
Save the returned ticket key to workflow variable jira_ticket_key.`,skills:["jira-service-desk"]},transitions:[{id:"t-jira",name:"Ticket Created",targetStateId:"generate-doc",condition:{type:"agent_complete"}}],position:{x:100,y:160}},{id:"generate-doc",name:"Generate Document",type:"action",description:"Generate the CC document from template",action:{type:"agent_task",agentId:"",promptTemplate:`Generate the CC document using template "CC Template" with the workflow variables.
|
|
22
|
-
Save the returned file path to workflow variable cc_file_path.`,skills:["document-generator"]},transitions:[{id:"t-doc",name:"Document Generated",targetStateId:"validate-date",condition:{type:"agent_complete"}}],position:{x:100,y:260}},{id:"validate-date",name:"Validate Date",type:"decision",description:"Validate release date and classify as normal or urgent",action:{type:"agent_task",agentId:"",promptTemplate:`Validate the release date {{release_date}} {{release_time}}.
|
|
23
|
-
A normal release requires at least 2 working days from now.
|
|
24
|
-
If the date is less than 2 working days away and is_urgent is not set, warn the requester.`,skills:["google-calendar"]},transitions:[{id:"t-validate",name:"Date Validated",targetStateId:"calendar-event",condition:{type:"agent_complete"}}],position:{x:100,y:360}},{id:"calendar-event",name:"Calendar Event",type:"action",description:"Create a Google Calendar event for the release",action:{type:"agent_task",agentId:"",promptTemplate:`Create a Google Calendar event:
|
|
25
|
-
- Title: "Release {{release_name}} ({{jira_ticket_key}})"
|
|
26
|
-
- Date/Time: {{release_date}} {{release_time}} (1 hour duration)
|
|
27
|
-
- Attendees: {{requester_email}}, {{additional_attendees}}
|
|
28
|
-
|
|
29
|
-
Save the event ID to workflow variable calendar_event_id.`,skills:["google-calendar"]},transitions:[{id:"t-cal",name:"Event Created",targetStateId:"send-approval",condition:{type:"agent_complete"}}],position:{x:100,y:460}},{id:"send-approval",name:"Send for Approval",type:"action",description:"Email the CC document to approvers",action:{type:"agent_task",agentId:"",promptTemplate:`Send the CC email for approval:
|
|
30
|
-
- To: [configured approver emails]
|
|
31
|
-
- Subject: "Control de Cambios - {{jira_ticket_key}} - {{release_name}} - {{release_date}}"
|
|
32
|
-
- Attachment: {{cc_file_path}}
|
|
33
|
-
|
|
34
|
-
Save the returned threadId to workflow variable email_thread_id.`,skills:["email-gmail"]},transitions:[{id:"t-email",name:"Email Sent",targetStateId:"await-approvals",condition:{type:"agent_complete"}}],position:{x:100,y:560}},{id:"await-approvals",name:"Awaiting Approvals",type:"wait",description:"Wait for 3+ email approvals from client approvers",action:{type:"wait_for_trigger",timeoutMs:2880*60*1e3},transitions:[{id:"t-approved",name:"Approvals Received",targetStateId:"notify-approved",condition:{type:"trigger_fired"}},{id:"t-timeout",name:"Timeout (48h)",targetStateId:"end",condition:{type:"timeout",afterMs:2880*60*1e3}}],position:{x:100,y:660}},{id:"notify-approved",name:"Approved - Notify",type:"action",description:"Notify team of approval via Slack and update Jira",action:{type:"agent_task",agentId:"",promptTemplate:`The CC for {{release_name}} ({{jira_ticket_key}}) has been approved.
|
|
35
|
-
1. Send Slack message announcing green light for release on {{release_date}} at {{release_time}}.
|
|
36
|
-
2. Add comment to Jira ticket: "CC approved."
|
|
37
|
-
3. Transition Jira ticket to "Approved" status.`,skills:["slack-messaging","jira-service-desk"]},transitions:[{id:"t-notified",name:"Team Notified",targetStateId:"release-reminder",condition:{type:"agent_complete"}}],position:{x:100,y:760}},{id:"release-reminder",name:"Release Reminder (T-10min)",type:"wait",description:"Wait until 10 minutes before release time",action:{type:"wait_for_trigger",timeoutMs:10080*60*1e3},transitions:[{id:"t-reminder",name:"Reminder Time",targetStateId:"dev-confirm",condition:{type:"trigger_fired"}}],position:{x:100,y:860}},{id:"dev-confirm",name:"Dev Ready Confirmation",type:"action",description:"Send reminder and wait for developer confirmation",action:{type:"agent_task",agentId:"",promptTemplate:`It is 10 minutes before the release of {{release_name}} ({{jira_ticket_key}}).
|
|
38
|
-
Send a Slack reminder and ask {{requester_name}} to confirm they are ready.
|
|
39
|
-
Wait for their confirmation reply.`,skills:["slack-messaging"]},transitions:[{id:"t-confirmed",name:"Dev Confirmed",targetStateId:"release-started",condition:{type:"agent_complete"}}],position:{x:100,y:960}},{id:"release-started",name:"Release Started",type:"action",description:"Announce release start via email, Slack, and Jira",action:{type:"agent_task",agentId:"",promptTemplate:`The developer has confirmed ready.
|
|
40
|
-
1. Reply in approval email thread: release is starting now.
|
|
41
|
-
2. Send Slack message confirming release started.
|
|
42
|
-
3. Update Jira ticket status to "In Progress" or "Done".`,skills:["email-gmail","slack-messaging","jira-service-desk"]},transitions:[{id:"t-done",name:"Release Complete",targetStateId:"end",condition:{type:"agent_complete"}}],position:{x:100,y:1060}},{id:"end",name:"End",type:"end",description:"CC process complete",transitions:[],position:{x:100,y:1160}}],$=[{name:"requester_name",type:"string",description:"Developer requesting the release",required:!0},{name:"requester_email",type:"email",description:"Requester email",required:!0},{name:"requester_slack_id",type:"string",description:"Requester Slack user ID"},{name:"release_name",type:"string",description:"Release version/name",required:!0},{name:"release_description",type:"string",description:"What is being released"},{name:"affected_systems",type:"string",description:"Systems impacted"},{name:"release_date",type:"date",description:"Scheduled release date",required:!0},{name:"release_time",type:"string",description:"Scheduled release time",required:!0},{name:"is_urgent",type:"boolean",description:"Whether this is an urgent release"},{name:"additional_attendees",type:"string",description:"Other people to invite (comma-separated emails)"},{name:"jira_ticket_key",type:"string",description:"Jira ticket key (e.g. SD-1234)"},{name:"jira_ticket_url",type:"string",description:"Full Jira ticket URL"},{name:"cc_file_path",type:"string",description:"Path to generated CC document"},{name:"email_thread_id",type:"string",description:"Gmail thread ID for approval chain"},{name:"calendar_event_id",type:"string",description:"Google Calendar event ID"},{name:"approval_status",type:"json",description:"Current approval status"}],E=200,q=60,R=20,M={action:"#89b4fa",decision:"#f9e2af",wait:"#cba6f7",end:"#a6e3a1"},L={action:"Action",decision:"Decision",wait:"Wait",end:"End"},J={agent_complete:"Agent Complete",trigger_fired:"Trigger Fired",variable_check:"Variable Check",timeout:"Timeout",manual:"Manual",cron:"Cron"};function ae({isOpen:n,onClose:m}){const[v,r]=C.useState([]),[l,y]=C.useState(null),[d,s]=C.useState("list"),[i,u]=C.useState(!0),[o,j]=C.useState(null),T=C.useCallback(async()=>{u(!0);try{const p=await z(B("/api/workflows/definitions"));p.ok&&r(await p.json())}catch{j("Failed to load workflows")}finally{u(!1)}},[]);C.useEffect(()=>{n&&T()},[n,T]);const c=()=>{const p={id:`wf-${Date.now()}`,name:"New Workflow",description:"",version:1,variables:[],states:[{id:"start",name:"Start",type:"action",transitions:[],position:{x:300,y:60}},{id:"end",name:"End",type:"end",transitions:[],position:{x:300,y:260}}],initialStateId:"start",createdAt:Date.now(),updatedAt:Date.now()};y(p),s("editor")},g=()=>{const p={id:`wf-cc-${Date.now()}`,name:"CC (Control de Cambios)",description:"Full CC process: intake, Jira ticket, document, approval, release",version:1,variables:[...$],states:F.map(S=>({...S,transitions:[...S.transitions]})),initialStateId:"intake",createdAt:Date.now(),updatedAt:Date.now()};y(p),s("editor")},k=async p=>{try{v.find(f=>f.id===p.id)?await z(B(`/api/workflows/definitions/${p.id}`),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}):await z(B("/api/workflows/definitions"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)}),await T()}catch{j("Failed to save workflow")}};return n?e.jsx("div",{style:t.overlay,children:e.jsxs("div",{style:t.panel,children:[e.jsxs("div",{style:t.header,children:[e.jsx("h2",{style:t.title,children:d==="list"?"Workflow Definitions":(l==null?void 0:l.name)||"Editor"}),e.jsxs("div",{style:{display:"flex",gap:8},children:[d==="editor"&&e.jsx("button",{style:t.btnSecondary,onClick:()=>s("list"),children:"Back to List"}),e.jsx("button",{style:t.btnClose,onClick:m,children:"Close"})]})]}),d==="list"&&e.jsx(Y,{workflows:v,loading:i,error:o,onSelect:p=>{y(p),s("editor")},onCreate:c,onLoadCC:g}),d==="editor"&&l&&e.jsx(H,{workflow:l,onChange:y,onSave:k})]})}):null}function Y({workflows:n,loading:m,error:v,onSelect:r,onCreate:l,onLoadCC:y}){return e.jsxs("div",{style:t.content,children:[e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:16},children:[e.jsx("button",{style:t.btnPrimary,onClick:l,children:"New Workflow"}),e.jsx("button",{style:t.btnSecondary,onClick:y,children:"Load CC Template"})]}),m&&e.jsx("div",{style:{color:"#a6adc8"},children:"Loading..."}),v&&e.jsx("div",{style:{color:"#f38ba8"},children:v}),n.map(d=>e.jsxs("div",{style:t.card,onClick:()=>r(d),children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{color:"#cdd6f4",fontWeight:600,fontSize:14},children:d.name}),e.jsxs("span",{style:{color:"#a6adc8",fontSize:11},children:["v",d.version," | ",d.states.length," states"]})]}),d.description&&e.jsx("div",{style:{color:"#a6adc8",fontSize:12,marginTop:4},children:d.description})]},d.id)),!m&&n.length===0&&e.jsx("div",{style:{color:"#6c7086",textAlign:"center",padding:40},children:"No workflows yet. Create one or load the CC template."})]})}function H({workflow:n,onChange:m,onSave:v}){const[r,l]=C.useState(null),[y,d]=C.useState(null),[s,i]=C.useState("none"),[u,o]=C.useState(null),[j,T]=C.useState(!1),c=C.useRef(null),g=O(),k=C.useMemo(()=>Array.from(g.values()).map(a=>({id:a.id,name:a.name})),[g]),p=n.states.find(a=>a.id===r),S=C.useCallback(()=>{for(const a of n.states){const x=a.transitions.find(h=>h.id===y);if(x)return{state:a,transition:x}}return null},[n,y]),f=a=>{m({...n,states:a,updatedAt:Date.now()})},_=(a,x)=>{f(n.states.map(h=>h.id===a?{...h,...x}:h))},I=a=>{const x=`state-${Date.now()}`,h={id:x,name:`New ${L[a]}`,type:a,transitions:[],position:{x:300,y:n.states.length*100+60}};f([...n.states,h]),l(x),i("state")},D=a=>{const x=n.states.filter(h=>h.id!==a).map(h=>({...h,transitions:h.transitions.filter(b=>b.targetStateId!==a)}));f(x),l(null),i("none")},A=(a,x)=>{const h=`t-${Date.now()}`;f(n.states.map(b=>b.id!==a?b:{...b,transitions:[...b.transitions,{id:h,name:"New Transition",targetStateId:x,condition:{type:"agent_complete"}}]})),d(h),i("transition")},W=(a,x,h)=>{f(n.states.map(b=>b.id!==a?b:{...b,transitions:b.transitions.map(w=>w.id===x?{...w,...h}:w)}))},G=(a,x)=>{f(n.states.map(h=>h.id!==a?h:{...h,transitions:h.transitions.filter(b=>b.id!==x)})),d(null),i("none")},P=(a,x,h)=>{f(n.states.map(b=>{if(b.id!==a)return b;const w=b.position||{x:0,y:0};return{...b,position:{x:Math.round((w.x+x)/R)*R,y:Math.round((w.y+h)/R)*R}}}))},N=a=>{u?(u!==a&&A(u,a),o(null)):(l(a),d(null),i("state"))},V=async()=>{T(!0);try{await v(n)}finally{T(!1)}};return e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[e.jsxs("div",{style:t.toolbar,children:[e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("div",{style:{color:"#a6adc8",fontSize:10,textTransform:"uppercase",marginBottom:6,letterSpacing:1},children:"Add State"}),["action","decision","wait","end"].map(a=>e.jsx("button",{style:{...t.toolBtn,borderLeft:`3px solid ${M[a]}`},onClick:()=>I(a),children:L[a]},a))]}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("div",{style:{color:"#a6adc8",fontSize:10,textTransform:"uppercase",marginBottom:6,letterSpacing:1},children:"Tools"}),e.jsx("button",{style:{...t.toolBtn,background:u?"#45475a":"transparent"},onClick:()=>o(u?null:r||null),title:"Click a source state, then click a target state",children:u?"Drawing... (click target)":"Draw Transition"})]}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("div",{style:{color:"#a6adc8",fontSize:10,textTransform:"uppercase",marginBottom:6,letterSpacing:1},children:"Panels"}),e.jsxs("button",{style:t.toolBtn,onClick:()=>i(s==="variables"?"none":"variables"),children:["Variables (",n.variables.length,")"]}),e.jsx("button",{style:t.toolBtn,onClick:()=>i(s==="settings"?"none":"settings"),children:"Settings"})]}),e.jsx("div",{style:{marginTop:"auto"},children:e.jsx("button",{style:t.btnPrimary,onClick:V,disabled:j,children:j?"Saving...":"Save"})})]}),e.jsx("div",{style:t.canvas,ref:c,children:e.jsx(X,{states:n.states,initialStateId:n.initialStateId,selectedStateId:r,drawingFrom:u,onStateClick:N,onStateDrag:P,onTransitionClick:a=>{d(a),i("transition")},selectedTransitionId:y})}),s!=="none"&&e.jsxs("div",{style:t.sidePanel,children:[s==="state"&&p&&e.jsx(K,{state:p,agents:k,isInitial:n.initialStateId===p.id,onUpdate:a=>_(p.id,a),onDelete:()=>D(p.id),onSetInitial:()=>m({...n,initialStateId:p.id}),onStartDrawing:()=>o(p.id),onClose:()=>i("none")}),s==="transition"&&y&&(()=>{const a=S();return a?e.jsx(Q,{transition:a.transition,parentState:a.state,allStates:n.states,variables:n.variables,onUpdate:x=>W(a.state.id,a.transition.id,x),onDelete:()=>G(a.state.id,a.transition.id),onClose:()=>i("none")}):null})(),s==="variables"&&e.jsx(Z,{variables:n.variables,onChange:a=>m({...n,variables:a}),onClose:()=>i("none")}),s==="settings"&&e.jsx(U,{workflow:n,onChange:m,onClose:()=>i("none")})]})]})}function X({states:n,initialStateId:m,selectedStateId:v,drawingFrom:r,onStateClick:l,onStateDrag:y,onTransitionClick:d,selectedTransitionId:s}){const i=C.useRef(null),u=(c,g)=>{if(c.button!==0)return;c.stopPropagation(),i.current={id:g,startX:c.clientX,startY:c.clientY};const k=S=>{if(!i.current)return;const f=S.clientX-i.current.startX,_=S.clientY-i.current.startY;(Math.abs(f)>3||Math.abs(_)>3)&&(y(i.current.id,f,_),i.current.startX=S.clientX,i.current.startY=S.clientY)},p=()=>{i.current=null,window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",p)};window.addEventListener("mousemove",k),window.addEventListener("mouseup",p)},o=Math.max(...n.map(c=>{var g;return(((g=c.position)==null?void 0:g.x)??0)+E}),600)+100,j=Math.max(...n.map(c=>{var g;return(((g=c.position)==null?void 0:g.y)??0)+q}),400)+100,T=c=>{var g;return(((g=c.position)==null?void 0:g.x)??0)+E/2};return e.jsxs("div",{style:{position:"relative",width:o,height:j,minWidth:"100%",minHeight:"100%"},children:[e.jsxs("svg",{style:{position:"absolute",top:0,left:0,width:o,height:j,pointerEvents:"none"},children:[e.jsxs("defs",{children:[e.jsx("marker",{id:"arrow",markerWidth:"10",markerHeight:"7",refX:"10",refY:"3.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#6c7086"})}),e.jsx("marker",{id:"arrow-selected",markerWidth:"10",markerHeight:"7",refX:"10",refY:"3.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#89b4fa"})})]}),n.flatMap(c=>c.transitions.map(g=>{var A,W;const k=n.find(G=>G.id===g.targetStateId);if(!k)return null;const p=T(c),S=(((A=c.position)==null?void 0:A.y)??0)+q,f=T(k),_=((W=k.position)==null?void 0:W.y)??0,I=g.id===s,D=(S+_)/2;return e.jsxs("g",{style:{pointerEvents:"stroke",cursor:"pointer"},onClick:()=>d(g.id),children:[e.jsx("path",{d:`M ${p} ${S} C ${p} ${D}, ${f} ${D}, ${f} ${_}`,fill:"none",stroke:I?"#89b4fa":"#6c7086",strokeWidth:I?2.5:1.5,markerEnd:`url(#${I?"arrow-selected":"arrow"})`}),e.jsx("text",{x:(p+f)/2+8,y:D,fill:I?"#89b4fa":"#6c7086",fontSize:10,dominantBaseline:"middle",children:g.name})]},g.id)}))]}),n.map(c=>{var f,_;const g=c.id===v,k=c.id===m,p=r&&r!==c.id,S=M[c.type];return e.jsxs("div",{style:{position:"absolute",left:((f=c.position)==null?void 0:f.x)??0,top:((_=c.position)==null?void 0:_.y)??0,width:E,height:q,borderRadius:c.type==="decision"?8:c.type==="end"?30:8,background:g?"rgba(137,180,250,0.12)":"#313244",border:`2px solid ${g?"#89b4fa":p?"#a6e3a1":S}`,cursor:r?"crosshair":"grab",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",userSelect:"none",boxShadow:g?"0 0 12px rgba(137,180,250,0.2)":"none",transition:"box-shadow 0.15s"},onMouseDown:I=>u(I,c.id),onClick:I=>{I.stopPropagation(),l(c.id)},children:[k&&e.jsx("div",{style:{position:"absolute",top:-8,left:8,fontSize:9,color:"#a6e3a1",fontWeight:600,background:"#1e1e2e",padding:"0 4px",borderRadius:3},children:"START"}),e.jsx("div",{style:{color:S,fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:.5},children:L[c.type]}),e.jsx("div",{style:{color:"#cdd6f4",fontSize:12,fontWeight:600,textAlign:"center",padding:"0 8px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",maxWidth:E-16},children:c.name})]},c.id)})]})}function K({state:n,agents:m,isInitial:v,onUpdate:r,onDelete:l,onSetInitial:y,onStartDrawing:d,onClose:s}){const i=n.action,u=o=>{r({action:{...i,...o}})};return e.jsxs("div",{children:[e.jsxs("div",{style:t.sidePanelHeader,children:[e.jsxs("span",{style:{color:M[n.type],fontWeight:600},children:[L[n.type]," State"]}),e.jsx("button",{style:t.btnClose,onClick:s,children:"x"})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Name"}),e.jsx("input",{style:t.fieldInput,value:n.name,onChange:o=>r({name:o.target.value})})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Description"}),e.jsx("textarea",{style:{...t.fieldInput,height:60,resize:"vertical"},value:n.description||"",onChange:o=>r({description:o.target.value})})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Type"}),e.jsx("select",{style:t.fieldInput,value:n.type,onChange:o=>r({type:o.target.value}),children:Object.entries(L).map(([o,j])=>e.jsx("option",{value:o,children:j},o))})]}),n.type!=="end"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{...t.fieldLabel,marginTop:12,marginBottom:8,fontSize:11,color:"#a6adc8",textTransform:"uppercase",letterSpacing:1},children:"Action"}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Action Type"}),e.jsxs("select",{style:t.fieldInput,value:(i==null?void 0:i.type)||"agent_task",onChange:o=>{const j=o.target.value;j==="agent_task"?r({action:{type:"agent_task",agentId:"",promptTemplate:"",skills:[]}}):j==="wait_for_trigger"?r({action:{type:"wait_for_trigger",timeoutMs:36e5}}):j==="set_variables"?r({action:{type:"set_variables",assignments:{}}}):j==="trigger_setup"&&r({action:{type:"trigger_setup",triggerConfig:{}}})},children:[e.jsx("option",{value:"agent_task",children:"Agent Task"}),e.jsx("option",{value:"wait_for_trigger",children:"Wait for Trigger"}),e.jsx("option",{value:"set_variables",children:"Set Variables"}),e.jsx("option",{value:"trigger_setup",children:"Trigger Setup"})]})]}),(i==null?void 0:i.type)==="agent_task"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Agent"}),e.jsxs("select",{style:t.fieldInput,value:i.agentId,onChange:o=>u({agentId:o.target.value}),children:[e.jsx("option",{value:"",children:"Select agent..."}),m.map(o=>e.jsx("option",{value:o.id,children:o.name},o.id))]})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Prompt Template"}),e.jsx("textarea",{style:{...t.fieldInput,height:120,fontFamily:"monospace",fontSize:11,resize:"vertical"},value:i.promptTemplate,onChange:o=>u({promptTemplate:o.target.value}),placeholder:"Use {{variable}} for interpolation"})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Skills (comma-separated)"}),e.jsx("input",{style:t.fieldInput,value:(i.skills||[]).join(", "),onChange:o=>u({skills:o.target.value.split(",").map(j=>j.trim()).filter(Boolean)}),placeholder:"slack-messaging, jira-service-desk"})]})]}),(i==null?void 0:i.type)==="wait_for_trigger"&&e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Timeout (ms)"}),e.jsx("input",{type:"number",style:t.fieldInput,value:i.timeoutMs||"",onChange:o=>u({timeoutMs:o.target.value?Number(o.target.value):void 0})})]}),(i==null?void 0:i.type)==="set_variables"&&e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Assignments (JSON)"}),e.jsx("textarea",{style:{...t.fieldInput,height:80,fontFamily:"monospace",fontSize:11},value:JSON.stringify(i.assignments||{},null,2),onChange:o=>{try{u({assignments:JSON.parse(o.target.value)})}catch{}}})]})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:16,flexWrap:"wrap"},children:[!v&&e.jsx("button",{style:t.btnSecondary,onClick:y,children:"Set as Start"}),e.jsx("button",{style:t.btnSecondary,onClick:d,children:"Add Transition From Here"}),n.type!=="end"&&!v&&e.jsx("button",{style:{...t.btnSecondary,color:"#f38ba8",borderColor:"#f38ba8"},onClick:l,children:"Delete"})]})]})}function Q({transition:n,parentState:m,allStates:v,variables:r,onUpdate:l,onDelete:y,onClose:d}){const s=n.condition;return e.jsxs("div",{children:[e.jsxs("div",{style:t.sidePanelHeader,children:[e.jsx("span",{style:{color:"#89b4fa",fontWeight:600},children:"Transition"}),e.jsx("button",{style:t.btnClose,onClick:d,children:"x"})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Name"}),e.jsx("input",{style:t.fieldInput,value:n.name,onChange:i=>l({name:i.target.value})})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"From"}),e.jsx("div",{style:{color:"#cdd6f4",fontSize:12,padding:"6px 0"},children:m.name})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Target State"}),e.jsx("select",{style:t.fieldInput,value:n.targetStateId,onChange:i=>l({targetStateId:i.target.value}),children:v.filter(i=>i.id!==m.id).map(i=>e.jsx("option",{value:i.id,children:i.name},i.id))})]}),e.jsx("div",{style:{...t.fieldLabel,marginTop:12,marginBottom:8,fontSize:11,color:"#a6adc8",textTransform:"uppercase",letterSpacing:1},children:"Condition"}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Condition Type"}),e.jsx("select",{style:t.fieldInput,value:s.type,onChange:i=>{const u=i.target.value;u==="agent_complete"?l({condition:{type:"agent_complete"}}):u==="trigger_fired"?l({condition:{type:"trigger_fired"}}):u==="variable_check"?l({condition:{type:"variable_check",variable:"",operator:"equals",value:""}}):u==="timeout"?l({condition:{type:"timeout",afterMs:36e5}}):u==="manual"?l({condition:{type:"manual"}}):u==="cron"&&l({condition:{type:"cron",expression:"* * * * *"}})},children:Object.entries(J).map(([i,u])=>e.jsx("option",{value:i,children:u},i))})]}),s.type==="variable_check"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Variable"}),e.jsxs("select",{style:t.fieldInput,value:s.variable,onChange:i=>l({condition:{...s,variable:i.target.value}}),children:[e.jsx("option",{value:"",children:"Select..."}),r.map(i=>e.jsx("option",{value:i.name,children:i.name},i.name))]})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Operator"}),e.jsxs("select",{style:t.fieldInput,value:s.operator,onChange:i=>l({condition:{...s,operator:i.target.value}}),children:[e.jsx("option",{value:"equals",children:"Equals"}),e.jsx("option",{value:"not_equals",children:"Not Equals"}),e.jsx("option",{value:"contains",children:"Contains"}),e.jsx("option",{value:"greater_than",children:"Greater Than"}),e.jsx("option",{value:"less_than",children:"Less Than"}),e.jsx("option",{value:"is_true",children:"Is True"})]})]}),s.operator!=="is_true"&&e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Value"}),e.jsx("input",{style:t.fieldInput,value:String(s.value??""),onChange:i=>l({condition:{...s,value:i.target.value}})})]})]}),s.type==="timeout"&&e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Timeout (ms)"}),e.jsx("input",{type:"number",style:t.fieldInput,value:s.afterMs,onChange:i=>l({condition:{...s,afterMs:Number(i.target.value)}})})]}),s.type==="cron"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Cron Expression"}),e.jsx("input",{style:t.fieldInput,value:s.expression,onChange:i=>l({condition:{...s,expression:i.target.value}}),placeholder:"*/5 * * * *"})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Timezone"}),e.jsx("input",{style:t.fieldInput,value:s.timezone||"",onChange:i=>l({condition:{...s,timezone:i.target.value}}),placeholder:"UTC"})]})]}),s.type==="trigger_fired"&&e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Trigger ID (optional)"}),e.jsx("input",{style:t.fieldInput,value:s.triggerId||"",onChange:i=>l({condition:{...s,triggerId:i.target.value||void 0}})})]}),e.jsx("div",{style:{marginTop:16},children:e.jsx("button",{style:{...t.btnSecondary,color:"#f38ba8",borderColor:"#f38ba8"},onClick:y,children:"Delete Transition"})})]})}function Z({variables:n,onChange:m,onClose:v}){const r=()=>{m([...n,{name:"",type:"string",description:""}])},l=(d,s)=>{m(n.map((i,u)=>u===d?{...i,...s}:i))},y=d=>{m(n.filter((s,i)=>i!==d))};return e.jsxs("div",{children:[e.jsxs("div",{style:t.sidePanelHeader,children:[e.jsxs("span",{style:{color:"#cba6f7",fontWeight:600},children:["Variables (",n.length,")"]}),e.jsx("button",{style:t.btnClose,onClick:v,children:"x"})]}),n.map((d,s)=>e.jsxs("div",{style:{marginBottom:12,padding:8,background:"#313244",borderRadius:6},children:[e.jsxs("div",{style:{display:"flex",gap:6,marginBottom:4},children:[e.jsx("input",{style:{...t.fieldInput,flex:1},value:d.name,onChange:i=>l(s,{name:i.target.value}),placeholder:"Variable name"}),e.jsxs("select",{style:{...t.fieldInput,width:80},value:d.type,onChange:i=>l(s,{type:i.target.value}),children:[e.jsx("option",{value:"string",children:"string"}),e.jsx("option",{value:"number",children:"number"}),e.jsx("option",{value:"boolean",children:"boolean"}),e.jsx("option",{value:"date",children:"date"}),e.jsx("option",{value:"email",children:"email"}),e.jsx("option",{value:"json",children:"json"})]}),e.jsx("button",{style:{...t.btnClose,padding:"2px 6px"},onClick:()=>y(s),children:"x"})]}),e.jsx("input",{style:{...t.fieldInput,fontSize:11},value:d.description||"",onChange:i=>l(s,{description:i.target.value}),placeholder:"Description"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,marginTop:4,color:"#a6adc8",fontSize:11},children:[e.jsx("input",{type:"checkbox",checked:!!d.required,onChange:i=>l(s,{required:i.target.checked})}),"Required"]})]},s)),e.jsx("button",{style:t.btnSecondary,onClick:r,children:"Add Variable"})]})}function U({workflow:n,onChange:m,onClose:v}){return e.jsxs("div",{children:[e.jsxs("div",{style:t.sidePanelHeader,children:[e.jsx("span",{style:{color:"#cdd6f4",fontWeight:600},children:"Settings"}),e.jsx("button",{style:t.btnClose,onClick:v,children:"x"})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Name"}),e.jsx("input",{style:t.fieldInput,value:n.name,onChange:r=>m({...n,name:r.target.value})})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Description"}),e.jsx("textarea",{style:{...t.fieldInput,height:60,resize:"vertical"},value:n.description||"",onChange:r=>m({...n,description:r.target.value})})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Initial State"}),e.jsx("select",{style:t.fieldInput,value:n.initialStateId,onChange:r=>m({...n,initialStateId:r.target.value}),children:n.states.map(r=>e.jsx("option",{value:r.id,children:r.name},r.id))})]}),e.jsxs("div",{style:t.fieldGroup,children:[e.jsx("label",{style:t.fieldLabel,children:"Color"}),e.jsx("input",{type:"color",value:n.color||"#89b4fa",onChange:r=>m({...n,color:r.target.value}),style:{width:40,height:30,padding:0,border:"none",cursor:"pointer"}})]}),e.jsxs("div",{style:{color:"#6c7086",fontSize:11,marginTop:16},children:["Version: ",n.version," | States: ",n.states.length," | Transitions: ",n.states.reduce((r,l)=>r+l.transitions.length,0)]})]})}const t={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.6)",zIndex:1e3,display:"flex",justifyContent:"center",alignItems:"center"},panel:{background:"#1e1e2e",borderRadius:12,border:"1px solid #313244",width:"95vw",height:"90vh",display:"flex",flexDirection:"column",overflow:"hidden"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 20px",borderBottom:"1px solid #313244",flexShrink:0},title:{color:"#cdd6f4",fontSize:16,fontWeight:600,margin:0},content:{padding:20,flex:1,overflow:"auto"},card:{background:"#313244",borderRadius:8,padding:"12px 16px",marginBottom:8,cursor:"pointer",border:"1px solid transparent",transition:"border-color 0.15s"},toolbar:{width:180,borderRight:"1px solid #313244",padding:12,display:"flex",flexDirection:"column",flexShrink:0,overflow:"auto"},toolBtn:{display:"block",width:"100%",background:"transparent",border:"1px solid #45475a",borderRadius:6,padding:"6px 10px",color:"#cdd6f4",fontSize:11,cursor:"pointer",textAlign:"left",marginBottom:4},canvas:{flex:1,overflow:"auto",background:"#181825",position:"relative",backgroundImage:"radial-gradient(circle, #313244 1px, transparent 1px)",backgroundSize:"20px 20px"},sidePanel:{width:300,borderLeft:"1px solid #313244",padding:12,overflow:"auto",flexShrink:0},sidePanelHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12,paddingBottom:8,borderBottom:"1px solid #313244"},fieldGroup:{marginBottom:10},fieldLabel:{display:"block",color:"#a6adc8",fontSize:11,marginBottom:4},fieldInput:{display:"block",width:"100%",background:"#313244",border:"1px solid #45475a",borderRadius:6,padding:"6px 8px",color:"#cdd6f4",fontSize:12,outline:"none",boxSizing:"border-box"},btnPrimary:{background:"#89b4fa",border:"none",borderRadius:6,padding:"8px 16px",color:"#1e1e2e",fontWeight:600,cursor:"pointer",fontSize:12,width:"100%"},btnSecondary:{background:"transparent",border:"1px solid #45475a",borderRadius:6,padding:"6px 12px",color:"#cdd6f4",cursor:"pointer",fontSize:11},btnClose:{background:"transparent",border:"none",color:"#6c7086",cursor:"pointer",fontSize:14,padding:"4px 8px"}};export{ae as WorkflowEditorPanel};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as R,g as z}from"./vendor-react-uS-d4TUT.js";function X(w,d){for(var b=0;b<d.length;b++){const y=d[b];if(typeof y!="string"&&!Array.isArray(y)){for(const h in y)if(h!=="default"&&!(h in w)){const p=Object.getOwnPropertyDescriptor(y,h);p&&Object.defineProperty(w,h,p.get?p:{enumerable:!0,get:()=>y[h]})}}}return Object.freeze(Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}))}var A={exports:{}},U;function J(){return U||(U=1,(function(w,d){var b=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof R<"u"&&R,y=(function(){function p(){this.fetch=!1,this.DOMException=b.DOMException}return p.prototype=b,new p})();(function(p){(function(u){var a=typeof p<"u"&&p||typeof self<"u"&&self||typeof a<"u"&&a,f={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function S(e){return e&&DataView.prototype.isPrototypeOf(e)}if(f.arrayBuffer)var F=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],I=ArrayBuffer.isView||function(e){return e&&F.indexOf(Object.prototype.toString.call(e))>-1};function v(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function E(e){return typeof e!="string"&&(e=String(e)),e}function T(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return f.iterable&&(t[Symbol.iterator]=function(){return t}),t}function s(e){this.map={},e instanceof s?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}s.prototype.append=function(e,t){e=v(e),t=E(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},s.prototype.delete=function(e){delete this.map[v(e)]},s.prototype.get=function(e){return e=v(e),this.has(e)?this.map[e]:null},s.prototype.has=function(e){return this.map.hasOwnProperty(v(e))},s.prototype.set=function(e,t){this.map[v(e)]=E(t)},s.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},s.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),T(e)},s.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),T(e)},s.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),T(e)},f.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);function B(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function P(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function M(e){var t=new FileReader,r=P(t);return t.readAsArrayBuffer(e),r}function q(e){var t=new FileReader,r=P(t);return t.readAsText(e),r}function H(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function D(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:f.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:f.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():f.arrayBuffer&&f.blob&&S(e)?(this._bodyArrayBuffer=D(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):f.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||I(e))?this._bodyArrayBuffer=D(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var e=B(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=B(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(M)}),this.text=function(){var e=B(this);if(e)return e;if(this._bodyBlob)return q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(H(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function C(e){var t=e.toUpperCase();return L.indexOf(t)>-1?t:e}function m(e,t){if(!(this instanceof m))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new s(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new s(t.headers)),this.method=C(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})};function k(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),i=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function N(e){var t=new s,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
|
|
2
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),o=i.shift().trim();if(o){var _=i.join(":").trim();t.append(o,_)}}),t}x.call(m.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new s(t.headers),this.url=t.url||"",this._initBody(e)}x.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:0,statusText:""});return e.type="error",e};var G=[301,302,303,307,308];c.redirect=function(e,t){if(G.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},u.DOMException=a.DOMException;try{new u.DOMException}catch{u.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function O(e,t){return new Promise(function(r,n){var i=new m(e,t);if(i.signal&&i.signal.aborted)return n(new u.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function _(){o.abort()}o.onload=function(){var l={status:o.status,statusText:o.statusText,headers:N(o.getAllResponseHeaders()||"")};l.url="responseURL"in o?o.responseURL:l.headers.get("X-Request-URL");var g="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(g,l))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){n(new u.DOMException("Aborted","AbortError"))},0)};function V(l){try{return l===""&&a.location.href?a.location.href:l}catch{return l}}o.open(i.method,V(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(f.blob?o.responseType="blob":f.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof s)?Object.getOwnPropertyNames(t.headers).forEach(function(l){o.setRequestHeader(l,E(t.headers[l]))}):i.headers.forEach(function(l,g){o.setRequestHeader(g,l)}),i.signal&&(i.signal.addEventListener("abort",_),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",_)}),o.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}return O.polyfill=!0,a.fetch||(a.fetch=O,a.Headers=s,a.Request=m,a.Response=c),u.Headers=s,u.Request=m,u.Response=c,u.fetch=O,u})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var h=b.fetch?b:y;d=h.fetch,d.default=h.fetch,d.fetch=h.fetch,d.Headers=h.Headers,d.Request=h.Request,d.Response=h.Response,w.exports=d})(A,A.exports)),A.exports}var j=J();const K=z(j),W=X({__proto__:null,default:K},[j]);export{W as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as s,S as a,bn as o}from"./main-DahZb6P4.js";function S(t,e){const n={position:t,target:e};o(a.CAMERA_STATE,n)}function E(){return s(a.CAMERA_STATE,null)}function T(t,e,n){const r={posX:t,posZ:e,zoom:n};o(a.CAMERA_STATE_2D,r)}function l(){return s(a.CAMERA_STATE_2D,null)}export{S as a,E as b,l,T as s};
|