@plaso-infi/whiteboard-sdk 0.9.10-alpha1.2 → 0.9.10-alpha2.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/esm/arc-bf33507a-003d6dbd.js +1 -0
- package/dist/esm/{blockDiagram-38ab4fdb-5054d111-916200b0.js → blockDiagram-38ab4fdb-50e67167-12d0eb90.js} +1 -1
- package/dist/esm/c4Diagram-3d4e48cf-e0dbde6d-d89b1290.js +1 -0
- package/dist/esm/channel-11ef6ee8-7d77e12c.js +1 -0
- package/dist/esm/classDiagram-70f12bd4-c2989d6c-f42b2a78.js +1 -0
- package/dist/esm/classDiagram-v2-f2320105-b3956685-cc0b87e2.js +1 -0
- package/dist/esm/clone-fb3a37d9-3fbe4231.js +1 -0
- package/dist/esm/createText-2e5e7dd3-60b0c17f-63adc7a9.js +1 -0
- package/dist/esm/edges-e0da2a9e-86f7fdcb-e2836714.js +1 -0
- package/dist/esm/{erDiagram-9861fffd-20c9cea5-06108c89.js → erDiagram-9861fffd-7d48fa5c-b6f51faf.js} +1 -1
- package/dist/esm/export_as_markdown-4a944eb2-a2386489.js +1 -0
- package/dist/esm/{flowDb-956e92f1-3b9320a7-67f62d02.js → flowDb-956e92f1-6adf9e40-0940ff89.js} +1 -1
- package/dist/esm/flowDiagram-66a62f08-a2dae0a8-f4039521.js +1 -0
- package/dist/esm/flowDiagram-v2-96b9c2cf-8cbd0630-cd6452a8.js +1 -0
- package/dist/esm/flowchart-elk-definition-4a651766-296ff1f2-8bc79726.js +1 -0
- package/dist/esm/ganttDiagram-c361ad54-b4560d42-f2288dab.js +1 -0
- package/dist/esm/{gitGraphDiagram-72cf32ee-a0e338f3-fedb2c3a.js → gitGraphDiagram-72cf32ee-2a7e2504-074f611d.js} +1 -1
- package/dist/esm/graph-faeaf8aa-2860c59a.js +1 -0
- package/dist/esm/hls-252cc123-804dfa86.js +1 -0
- package/dist/esm/index-3862675e-ec58b8cb-8035fd39.js +1 -0
- package/dist/esm/{index-167f08a0.js → index-6d583942.js} +10 -10
- package/dist/esm/index-db2d1fd7-f259a894.js +7 -0
- package/dist/esm/index.css +31471 -27148
- package/dist/esm/index.d.ts +287 -109
- package/dist/esm/index.js +1 -1
- package/dist/esm/{infoDiagram-f8f76790-4379e779-22c1733f.js → infoDiagram-f8f76790-c0e1246c-4bc46396.js} +1 -1
- package/dist/esm/journeyDiagram-49397b02-f8af5b8e-22bceed7.js +1 -0
- package/dist/esm/layout-d23cf2f7-c569836b.js +1 -0
- package/dist/esm/line-7e481ae4-69dca096.js +1 -0
- package/dist/esm/linear-99c27ca9-3fc4723c.js +1 -0
- package/dist/esm/lottie-4efef517-5cd227e2.js +1 -0
- package/dist/esm/mindmap-definition-fc14e90a-a182a561-4bbd3f89.js +9 -0
- package/dist/esm/{ordinal-03018387-faf5bec3.js → ordinal-1bbb8034-16d7f7f6.js} +1 -1
- package/dist/esm/pdf_lib-fe5a668b-3743276a.js +1 -0
- package/dist/esm/{pieDiagram-8a3498a8-6c705dfb-ac29777a.js → pieDiagram-8a3498a8-6d325ef5-a91650e5.js} +1 -1
- package/dist/esm/{quadrantDiagram-120e2f19-ce717132-2ca6a80f.js → quadrantDiagram-120e2f19-fc0de2f3-584b6a87.js} +1 -1
- package/dist/esm/{requirementDiagram-deff3bca-94ff9b49-53ba3062.js → requirementDiagram-deff3bca-ce307d91-a25dba77.js} +1 -1
- package/dist/esm/sankeyDiagram-04a897e0-c7dc811c-27564db3.js +1 -0
- package/dist/esm/sequenceDiagram-704730f1-d6e5319b-4fadb8b7.js +1 -0
- package/dist/esm/stateDiagram-587899a1-f38c163e-2edf6670.js +1 -0
- package/dist/esm/stateDiagram-v2-d93cdb3a-879f1936-e669d6ad.js +1 -0
- package/dist/esm/{styles-6aaf32cf-9dfc64a7-73ae2457.js → styles-6aaf32cf-0d83b4a6-cfed2719.js} +1 -1
- package/dist/esm/styles-9a916d00-5f7be915-87b6ee5b.js +1 -0
- package/dist/esm/styles-c10674c1-b8dde677-30cee619.js +1 -0
- package/dist/esm/{svgDrawCommon-08f97a94-6a32c869-fc129345.js → svgDrawCommon-08f97a94-2aa41d50-7487ac68.js} +1 -1
- package/dist/esm/{timeline-definition-85554ec2-0d0b57da-737d18f2.js → timeline-definition-85554ec2-ec090c0d-53227e35.js} +1 -1
- package/dist/esm/web-pinyin-8348bf0d.js +1 -0
- package/dist/esm/xychartDiagram-e933f94c-409bfa73-6434fb6b.js +1 -0
- package/package.json +2 -2
- package/dist/esm/arc-f453aa24-001bbdd5.js +0 -1
- package/dist/esm/c4Diagram-3d4e48cf-5c418a03-d69b6a9c.js +0 -1
- package/dist/esm/channel-d0c23f49-f259a6d1.js +0 -1
- package/dist/esm/classDiagram-70f12bd4-491ee226-467aef5f.js +0 -1
- package/dist/esm/classDiagram-v2-f2320105-e90ceb2f-abf81ed0.js +0 -1
- package/dist/esm/clone-f55b0cc7-e67cd753.js +0 -1
- package/dist/esm/createText-2e5e7dd3-dcc34ae8-3c64ca2d.js +0 -1
- package/dist/esm/edges-e0da2a9e-8abaed90-a3e3f930.js +0 -1
- package/dist/esm/flowDiagram-66a62f08-08a6f0e7-acbc8998.js +0 -1
- package/dist/esm/flowDiagram-v2-96b9c2cf-6b10acd5-d6f5b177.js +0 -1
- package/dist/esm/flowchart-elk-definition-4a651766-e5b3ba00-a86e3534.js +0 -1
- package/dist/esm/ganttDiagram-c361ad54-be9f4bb3-9fd6d707.js +0 -1
- package/dist/esm/graph-afe27007-8e18cc75.js +0 -1
- package/dist/esm/hls-8060cc31-cbc4e4b4.js +0 -1
- package/dist/esm/index-3862675e-87ca6a66-f6d07d04.js +0 -1
- package/dist/esm/index-43b715ff-0a40eb86.js +0 -7
- package/dist/esm/journeyDiagram-49397b02-2cca535b-67946860.js +0 -1
- package/dist/esm/layout-ae3a065f-6e640144.js +0 -1
- package/dist/esm/line-7161536c-1eab81ab.js +0 -1
- package/dist/esm/linear-5dc481fe-05c0f51e.js +0 -1
- package/dist/esm/lottie-e933e82b-ded8d0d3.js +0 -1
- package/dist/esm/mindmap-definition-fc14e90a-5dcd2e6e-eef8a18b.js +0 -9
- package/dist/esm/pdf_lib-55fc68be-7c552411.js +0 -1
- package/dist/esm/sankeyDiagram-04a897e0-7f5565ac-73d22dce.js +0 -1
- package/dist/esm/sequenceDiagram-704730f1-65919a25-99547f7a.js +0 -1
- package/dist/esm/stateDiagram-587899a1-2d298c91-69f94d43.js +0 -1
- package/dist/esm/stateDiagram-v2-d93cdb3a-d0d0a3cb-c5f54ac0.js +0 -1
- package/dist/esm/styles-9a916d00-f70df3fd-82031337.js +0 -1
- package/dist/esm/styles-c10674c1-9ccf4241-d16c7c7b.js +0 -1
- package/dist/esm/web-pinyin-dbdcf553.js +0 -1
- package/dist/esm/xychartDiagram-e933f94c-d01b914a-f5a15a41.js +0 -1
- /package/dist/esm/{Tableau10-e8b1eccc-4cef513c.js → Tableau10-2e6de463-24e63ed7.js} +0 -0
- /package/dist/esm/{array-5c028890-e9486e2e.js → array-1a5ff9ff-38e50aba.js} +0 -0
- /package/dist/esm/{init-426b8023-e9aac3aa.js → init-abf7794c-a9c466c5.js} +0 -0
- /package/dist/esm/{path-a3e377ce-ded30e71.js → path-0fb51fa8-bd99a70c.js} +0 -0
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IWordsMap, AiThinkerStatus, AiThinkerHandlerT, classifyFiles } from '@plasosdk/upime-sdk';
|
|
1
|
+
import { element_type, IWordsMap, AiThinkerStatus, AiThinkerHandlerT, classifyFiles } from '@plasosdk/upime-sdk';
|
|
3
2
|
export { SUPPORT_FILE_EXT } from '@plasosdk/upime-sdk';
|
|
3
|
+
import React$1, { FC, CSSProperties, ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
/** 智能体的类别
|
|
6
|
+
* todo: 知识库
|
|
7
|
+
*/
|
|
8
|
+
declare enum AIInstructionType {
|
|
9
|
+
/** 正常智能体 */
|
|
10
|
+
default = "default",
|
|
11
|
+
/** 拥有预设提示词的智能体,它的行为跟正常智能体是一样的*/
|
|
12
|
+
defaultPrompt = "defaultPrompt",
|
|
13
|
+
/** 预设行为的智能体,行为是sdk内枚举出来的 */
|
|
14
|
+
preset = "preset",
|
|
15
|
+
controlled = "controlled",
|
|
16
|
+
agentFlow = "agentFlow",
|
|
17
|
+
start = "start",
|
|
18
|
+
agenticApi = "agenticApi"
|
|
19
|
+
}
|
|
20
|
+
declare enum AIInstructionPresetType {
|
|
21
|
+
genPPT = "genPPT",
|
|
22
|
+
genMindmap = "genMindmap",
|
|
23
|
+
genFlowChat = "genFlowChat",
|
|
24
|
+
webpageVideoHelper = "webpageVideoHelper"
|
|
25
|
+
}
|
|
4
26
|
|
|
5
27
|
type PositionLike = {
|
|
6
28
|
x: number;
|
|
@@ -129,6 +151,88 @@ declare enum ExportFileTypeT {
|
|
|
129
151
|
Pptx = "pptx",
|
|
130
152
|
Image = "image"
|
|
131
153
|
}
|
|
154
|
+
declare enum AgentStitchType {
|
|
155
|
+
IN = "in",
|
|
156
|
+
OUT = "out"
|
|
157
|
+
}
|
|
158
|
+
declare enum AgentStitchValueType {
|
|
159
|
+
Text = "text",
|
|
160
|
+
Number = "number",
|
|
161
|
+
/** 这里跟sdk内的定义略有不同,这里需要把array和object区分开来 */
|
|
162
|
+
Array = "array",
|
|
163
|
+
Object = "object",
|
|
164
|
+
Document = "document",
|
|
165
|
+
Image = "image",
|
|
166
|
+
Audio = "audio",
|
|
167
|
+
Video = "video"
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* 针脚(业务定义)
|
|
171
|
+
*/
|
|
172
|
+
type AgentStitch = {
|
|
173
|
+
type: AgentStitchType;
|
|
174
|
+
valueType?: AgentStitchValueType | AgentStitchValueType[];
|
|
175
|
+
name: string;
|
|
176
|
+
description: string;
|
|
177
|
+
/** 对于out:
|
|
178
|
+
* 针脚的取值路径
|
|
179
|
+
* 1. name
|
|
180
|
+
* 2. obj.name
|
|
181
|
+
* 对于in:就是参数名
|
|
182
|
+
*/
|
|
183
|
+
path?: string;
|
|
184
|
+
/** 是否为预设的 */
|
|
185
|
+
isPreset?: boolean;
|
|
186
|
+
/** 是否是隐藏针脚 */
|
|
187
|
+
hidden?: boolean;
|
|
188
|
+
};
|
|
189
|
+
type AIInstructionBaseInfo = {
|
|
190
|
+
id?: string | number;
|
|
191
|
+
name: string;
|
|
192
|
+
keywords: string[];
|
|
193
|
+
coverFileUrl: string;
|
|
194
|
+
defaultPrompt?: string;
|
|
195
|
+
supportNetwork?: boolean;
|
|
196
|
+
supportReasoning?: boolean;
|
|
197
|
+
categoryId: string;
|
|
198
|
+
categoryName: string;
|
|
199
|
+
extraInfo?: {
|
|
200
|
+
/** 自动创建一些出口元素 */
|
|
201
|
+
autoCreateOutElements?: element_type[];
|
|
202
|
+
};
|
|
203
|
+
stitchList?: AgentStitch[];
|
|
204
|
+
agentVersion?: number;
|
|
205
|
+
tags?: string[];
|
|
206
|
+
};
|
|
207
|
+
type AIInstructionDefault = AIInstructionBaseInfo & {
|
|
208
|
+
type: AIInstructionType.default;
|
|
209
|
+
};
|
|
210
|
+
type AIInstructionDefaultPrompt = AIInstructionBaseInfo & {
|
|
211
|
+
type: AIInstructionType.defaultPrompt;
|
|
212
|
+
defaultPrompt: string;
|
|
213
|
+
};
|
|
214
|
+
type AIInstructionPreset = AIInstructionBaseInfo & {
|
|
215
|
+
type: AIInstructionType.preset;
|
|
216
|
+
presetType: AIInstructionPresetType;
|
|
217
|
+
presetExtraInfo?: any;
|
|
218
|
+
};
|
|
219
|
+
type AIInstructionControlled = AIInstructionBaseInfo & {
|
|
220
|
+
type: AIInstructionType.controlled;
|
|
221
|
+
presetExtraInfo: any;
|
|
222
|
+
};
|
|
223
|
+
type AIInstructionAgentFlow = AIInstructionBaseInfo & {
|
|
224
|
+
type: AIInstructionType.agentFlow;
|
|
225
|
+
agentFlowTemplateId: string;
|
|
226
|
+
};
|
|
227
|
+
type AIInstructionStart = AIInstructionBaseInfo & {
|
|
228
|
+
type: AIInstructionType.start;
|
|
229
|
+
};
|
|
230
|
+
type AIInstructionAgenticApi = AIInstructionBaseInfo & {
|
|
231
|
+
type: AIInstructionType.agenticApi;
|
|
232
|
+
/** agenticApi的Id */
|
|
233
|
+
agenticApiId: string;
|
|
234
|
+
};
|
|
235
|
+
type AIInstructionInfo = AIInstructionDefault | AIInstructionDefaultPrompt | AIInstructionPreset | AIInstructionControlled | AIInstructionAgentFlow | AIInstructionStart | AIInstructionAgenticApi;
|
|
132
236
|
|
|
133
237
|
type DocumentType = 'ppt' | 'pdf' | 'excel' | 'word';
|
|
134
238
|
type FileType = 'image' | 'document' | 'video' | 'audio';
|
|
@@ -822,6 +926,8 @@ interface GetSdkInstanceConfigs extends GetSdkInstanceAuthT {
|
|
|
822
926
|
aiConfig?: {
|
|
823
927
|
/** 是否支持 AI 智能生成音视频,默认关闭 */
|
|
824
928
|
enableAgentGenVideo?: boolean;
|
|
929
|
+
/** 是否支持 AI 智能生成音频,默认关闭 */
|
|
930
|
+
enableAgentGenAudio?: boolean;
|
|
825
931
|
/** 是否支持 AI 智能生成网页,默认关闭 */
|
|
826
932
|
enableAIInstructionGenWebpage?: boolean;
|
|
827
933
|
/** 是否支持 AI 生成 PPT,默认关闭 */
|
|
@@ -832,6 +938,10 @@ interface GetSdkInstanceConfigs extends GetSdkInstanceAuthT {
|
|
|
832
938
|
hideRecommendationList?: boolean;
|
|
833
939
|
/** 是否暂时剩余 AI Creds 信息,默认隐藏 */
|
|
834
940
|
showRemainTip?: boolean;
|
|
941
|
+
/** 是否启用批量上传作业智能批改 */
|
|
942
|
+
enableBatchUploadAgentFlow?: boolean;
|
|
943
|
+
/** 是否支持开启 AI 智能转写 */
|
|
944
|
+
enableAIAsr?: boolean;
|
|
835
945
|
};
|
|
836
946
|
/** 智能体配置 */
|
|
837
947
|
agentConfig?: {
|
|
@@ -847,6 +957,18 @@ interface GetSdkInstanceConfigs extends GetSdkInstanceAuthT {
|
|
|
847
957
|
};
|
|
848
958
|
/** 是否显示智能体标签 */
|
|
849
959
|
enableTagAtElement?: boolean;
|
|
960
|
+
/** 查看详情 */
|
|
961
|
+
viewAgentDetail?: (id: Exclude<AIInstructionInfo['id'], undefined>) => void;
|
|
962
|
+
predictGenerationTime?: {
|
|
963
|
+
image: number;
|
|
964
|
+
video: number;
|
|
965
|
+
audio: number;
|
|
966
|
+
webpage: number;
|
|
967
|
+
};
|
|
968
|
+
getAgenticApiEnv?: () => Promise<Record<string, any>>;
|
|
969
|
+
getAIInstructionLatestVersion?: (agentIds: Exclude<AIInstructionInfo['id'], undefined>[]) => Promise<number[]>;
|
|
970
|
+
getAgentDetail?: (id: Exclude<AIInstructionInfo['id'], undefined>) => Promise<AIInstructionInfo>;
|
|
971
|
+
showBaseOrchestration?: boolean;
|
|
850
972
|
};
|
|
851
973
|
/** 是否开启远端板书实时渲染配置,开启该配置能一定程度上优化板书性能*/
|
|
852
974
|
enableSyncRemoteDrawing?: boolean;
|
|
@@ -860,6 +982,8 @@ interface GetSdkInstanceConfigs extends GetSdkInstanceAuthT {
|
|
|
860
982
|
/** AI 思想家 初始化的时候回调 */
|
|
861
983
|
onCreate?: (handler: AiThinkerHandlerT) => void;
|
|
862
984
|
};
|
|
985
|
+
/** 是否开启帧框重排功能 */
|
|
986
|
+
enableSortFrame?: boolean;
|
|
863
987
|
/** 链接跳转,返回值为string表示跳转元素id */
|
|
864
988
|
gotoLink?: (link: string) => string | undefined;
|
|
865
989
|
/** 判断链接是普通链接还是画布内跳转链接 */
|
|
@@ -894,6 +1018,31 @@ interface GetSdkInstanceConfigs extends GetSdkInstanceAuthT {
|
|
|
894
1018
|
* - 为避免 api 调用无效,需要在监听到 sdk_dom_ready 或 resource_ready 消息后执行
|
|
895
1019
|
*/
|
|
896
1020
|
initPortal?: (portal: ReactNode) => void;
|
|
1021
|
+
customTemplate?: {
|
|
1022
|
+
templateMode: 1 | 0;
|
|
1023
|
+
/** 当前是否为agentflow模板模式 */
|
|
1024
|
+
isAgentTemplate?: boolean;
|
|
1025
|
+
title: string;
|
|
1026
|
+
description: string;
|
|
1027
|
+
sdkTemplateRecordId?: string;
|
|
1028
|
+
type?: 1 | 2 | 3 | 4;
|
|
1029
|
+
subjectId: string;
|
|
1030
|
+
boardId: string;
|
|
1031
|
+
categoryIds?: number[];
|
|
1032
|
+
tagIds?: number[];
|
|
1033
|
+
successToast?: string;
|
|
1034
|
+
failedToast?: string;
|
|
1035
|
+
/** 其他透传数据 */
|
|
1036
|
+
extInfo?: Record<string, any>;
|
|
1037
|
+
};
|
|
1038
|
+
/** 修改用户名配置 */
|
|
1039
|
+
modifyUserNameConfig?: {
|
|
1040
|
+
canModifyUserName?: boolean;
|
|
1041
|
+
userNameMaxLength?: number;
|
|
1042
|
+
sanitizeUserName?: (userName: string) => string;
|
|
1043
|
+
modifyUserName?: (newUserName: string) => Promise<ModifyUserNameResultT>;
|
|
1044
|
+
onModifyUserName?: () => Promise<ModifyUserNameResultT>;
|
|
1045
|
+
};
|
|
897
1046
|
}
|
|
898
1047
|
/** 自定义文件上传类型声明,*/
|
|
899
1048
|
type CustomizeUploader = {
|
|
@@ -960,6 +1109,129 @@ type GetBoardEleDataType = {
|
|
|
960
1109
|
borderBox: BorderBox;
|
|
961
1110
|
};
|
|
962
1111
|
|
|
1112
|
+
declare enum UploadErrorStatusCode {
|
|
1113
|
+
MISSING_TOKEN = 1,
|
|
1114
|
+
/** token 已经过期 */
|
|
1115
|
+
TOKEN_EXPIRED = 2,
|
|
1116
|
+
/** 无效 token */
|
|
1117
|
+
INVALID_TOKEN = 3,
|
|
1118
|
+
/** app 文件容量已经超过限制 */
|
|
1119
|
+
SPACE_EXCEEDED = 4,
|
|
1120
|
+
/** 上传过程中 Upload 网络链接出现问题 */
|
|
1121
|
+
UPLOAD_TASK_CONNECTION_DROPPED = 5
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
type UploadFileParamsT = {
|
|
1125
|
+
files: File[];
|
|
1126
|
+
watchProgress?: ((id: number, result: boolean) => void) | undefined;
|
|
1127
|
+
/**
|
|
1128
|
+
* 指定 taskId,以方便处理 onUploaderError API 执行时,
|
|
1129
|
+
* 给出的 UploadErrorStatusCode.UPLOAD_TASK_CONNECTION_DROPPED 错误
|
|
1130
|
+
* 该错误的第二个参数值,为此处指定的 taskId
|
|
1131
|
+
**/
|
|
1132
|
+
taskId?: string | number;
|
|
1133
|
+
};
|
|
1134
|
+
type UploadStickerParamsT = {
|
|
1135
|
+
bgColor: number;
|
|
1136
|
+
text: string;
|
|
1137
|
+
/**
|
|
1138
|
+
* 指定 taskId,以方便处理 onUploaderError API 执行时,
|
|
1139
|
+
* 给出的 UploadErrorStatusCode.UPLOAD_TASK_CONNECTION_DROPPED 错误
|
|
1140
|
+
* 该错误的第二个参数值,为此处指定的 taskId
|
|
1141
|
+
**/
|
|
1142
|
+
taskId?: string | number;
|
|
1143
|
+
};
|
|
1144
|
+
interface HeicConvertResult {
|
|
1145
|
+
width: number;
|
|
1146
|
+
height: number;
|
|
1147
|
+
file: File;
|
|
1148
|
+
ext: 'jpg';
|
|
1149
|
+
}
|
|
1150
|
+
type UploadErrorMsgType = {
|
|
1151
|
+
[UploadErrorStatusCode.MISSING_TOKEN]: void;
|
|
1152
|
+
[UploadErrorStatusCode.TOKEN_EXPIRED]: void;
|
|
1153
|
+
[UploadErrorStatusCode.INVALID_TOKEN]: void;
|
|
1154
|
+
[UploadErrorStatusCode.SPACE_EXCEEDED]: void;
|
|
1155
|
+
[UploadErrorStatusCode.UPLOAD_TASK_CONNECTION_DROPPED]: number | string;
|
|
1156
|
+
};
|
|
1157
|
+
interface InfiUploaderType {
|
|
1158
|
+
/** 当前进行 Uploader task 的用户名,可以通过 updateUploaderName 进行更新,默认为“访客” */
|
|
1159
|
+
readonly curUserName: string;
|
|
1160
|
+
/**
|
|
1161
|
+
* 待上传画布名称,如果使用 InfiWebSdk 时有设置 title 字段,
|
|
1162
|
+
* 在使用该画布生成 token,并初始化成功 InfiUploader 后,则可以获取到该值
|
|
1163
|
+
**/
|
|
1164
|
+
readonly boardTitle: string;
|
|
1165
|
+
/** 初始化 Uploader ,返回 true 表初始化成功 */
|
|
1166
|
+
init: (token: string) => Promise<boolean>;
|
|
1167
|
+
/**
|
|
1168
|
+
* 验证待上传文件的有效性,如果 init 未完成,则会直接返回 null
|
|
1169
|
+
* 建议于 uploadFiles 之前使用,在获取到 validFiles 数组后基于 uploadFiles API 进行上传
|
|
1170
|
+
**/
|
|
1171
|
+
validateFilesToUpload: (files: File[]) => ReturnType<typeof classifyFiles> | null;
|
|
1172
|
+
/** 上传文件 */
|
|
1173
|
+
uploadFiles: (params: UploadFileParamsT) => Promise<boolean[]>;
|
|
1174
|
+
/** 上传贴纸 */
|
|
1175
|
+
uploadSticker: (params: UploadStickerParamsT) => Promise<boolean>;
|
|
1176
|
+
/** 将 helc 文件转化为 jpg 格式 */
|
|
1177
|
+
convertHeicFile(file: File): Promise<HeicConvertResult>;
|
|
1178
|
+
/** 销毁 Uploader 实例 */
|
|
1179
|
+
destroy: () => void;
|
|
1180
|
+
/** 更新上传者用户名称,该数据将于画布中展示,如果不执行该 API,用户名称会默认显示 “访客” */
|
|
1181
|
+
updateUploaderName: (name: string) => void;
|
|
1182
|
+
/** 如果需要监听 Uploader 错误信息,可以在 InfiUploader 实例上挂载这个方法 */
|
|
1183
|
+
onUploaderError?: <C extends UploadErrorStatusCode>(code: C, value: UploadErrorMsgType[C]) => unknown;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
declare class InfiUploader implements InfiUploaderType {
|
|
1187
|
+
private token;
|
|
1188
|
+
private initialized;
|
|
1189
|
+
private userName;
|
|
1190
|
+
private uploadFileKey;
|
|
1191
|
+
private uploadSizeLimit;
|
|
1192
|
+
private viewScale;
|
|
1193
|
+
private connectionId;
|
|
1194
|
+
private fileIndex;
|
|
1195
|
+
private stickerIndex;
|
|
1196
|
+
private canvasPosition;
|
|
1197
|
+
private _boardTitle;
|
|
1198
|
+
private hideState;
|
|
1199
|
+
onUploaderError?: InfiUploaderType['onUploaderError'];
|
|
1200
|
+
get curUserName(): string;
|
|
1201
|
+
get boardTitle(): string;
|
|
1202
|
+
/**
|
|
1203
|
+
* 只为提供 convertHeicFile 能力,upimesdk 把这个 API 跟 uploader 写成强相关了,
|
|
1204
|
+
* 实际上二者不应该有任何关联。这里搞一个无意义的 uploader 来支持该 API 的正常调用
|
|
1205
|
+
**/
|
|
1206
|
+
private dummyUploader;
|
|
1207
|
+
constructor(token: string);
|
|
1208
|
+
updateUploaderName: (name: string) => void;
|
|
1209
|
+
init(): Promise<boolean>;
|
|
1210
|
+
private prepareUploader;
|
|
1211
|
+
private getBoardQuery;
|
|
1212
|
+
validateFilesToUpload(files: File[]): any;
|
|
1213
|
+
uploadFiles: (params: UploadFileParamsT) => Promise<boolean[]>;
|
|
1214
|
+
uploadSticker: (params: UploadStickerParamsT) => Promise<boolean>;
|
|
1215
|
+
convertHeicFile: (file: File) => Promise<HeicConvertResult>;
|
|
1216
|
+
destroy(): void;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
type UpdateFileUploadConfigParamsT = {
|
|
1220
|
+
key: string;
|
|
1221
|
+
extraConfig: {
|
|
1222
|
+
hideState: boolean;
|
|
1223
|
+
} & Record<string, any>;
|
|
1224
|
+
};
|
|
1225
|
+
type UploadInfoT = {
|
|
1226
|
+
boardTitle: string;
|
|
1227
|
+
uploadFileKey: string;
|
|
1228
|
+
uploadSizeLimit: number;
|
|
1229
|
+
extraConfig?: {
|
|
1230
|
+
hideState?: boolean;
|
|
1231
|
+
[key: string]: any;
|
|
1232
|
+
};
|
|
1233
|
+
};
|
|
1234
|
+
|
|
963
1235
|
declare enum GridType {
|
|
964
1236
|
NONE = 0,
|
|
965
1237
|
LINE = 1,
|
|
@@ -1003,6 +1275,14 @@ type InsertImageType = {
|
|
|
1003
1275
|
autoSize?: boolean;
|
|
1004
1276
|
};
|
|
1005
1277
|
type DisplayModeT = 'normal' | 'phone' | 'bigScreen';
|
|
1278
|
+
type ModifyUserNameResultT = {
|
|
1279
|
+
isSuccess: true;
|
|
1280
|
+
userName: string;
|
|
1281
|
+
resultTip?: string;
|
|
1282
|
+
} | {
|
|
1283
|
+
isSuccess: false;
|
|
1284
|
+
resultTip?: string;
|
|
1285
|
+
};
|
|
1006
1286
|
/** websdk 实例类型声明接口 */
|
|
1007
1287
|
interface InfiWebsdkInstanceType {
|
|
1008
1288
|
userPreference: PreferencesType;
|
|
@@ -1199,6 +1479,9 @@ interface InfiWebsdkInstanceType {
|
|
|
1199
1479
|
stopRemoteControl: (controlId: string) => void;
|
|
1200
1480
|
/** 申请向画布中上传内容所需要的 token,可以结合 InfiUploader 实现在脱离画布的情况下,向画布中插入内容(比如扫码上传场景) */
|
|
1201
1481
|
getUploaderSessionToken: () => Promise<string | null>;
|
|
1482
|
+
getUploaderInfo: (key: string) => Promise<API.ResponseT<STATUS_CODE, UploadInfoT> | null>;
|
|
1483
|
+
/** 更新扫码上传二维码配置(扩展配置) */
|
|
1484
|
+
updateFileUploadConfig: (params: UpdateFileUploadConfigParamsT) => Promise<object | null>;
|
|
1202
1485
|
/**
|
|
1203
1486
|
* 获取同机构下指定 recordId 画布内的元素数据及包围盒大小
|
|
1204
1487
|
* 会过滤看板、卡片、评论等用户敏感数据。
|
|
@@ -1321,80 +1604,6 @@ type BoardHooksT = {
|
|
|
1321
1604
|
|
|
1322
1605
|
type QuickUserAccessType = 'owner' | 'editor' | 'visitor' | 'comment';
|
|
1323
1606
|
|
|
1324
|
-
declare enum UploadErrorStatusCode {
|
|
1325
|
-
MISSING_TOKEN = 1,
|
|
1326
|
-
/** token 已经过期 */
|
|
1327
|
-
TOKEN_EXPIRED = 2,
|
|
1328
|
-
/** 无效 token */
|
|
1329
|
-
INVALID_TOKEN = 3,
|
|
1330
|
-
/** app 文件容量已经超过限制 */
|
|
1331
|
-
SPACE_EXCEEDED = 4,
|
|
1332
|
-
/** 上传过程中 Upload 网络链接出现问题 */
|
|
1333
|
-
UPLOAD_TASK_CONNECTION_DROPPED = 5
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
type UploadFileParamsT = {
|
|
1337
|
-
files: File[];
|
|
1338
|
-
watchProgress?: ((id: number, result: boolean) => void) | undefined;
|
|
1339
|
-
/**
|
|
1340
|
-
* 指定 taskId,以方便处理 onUploaderError API 执行时,
|
|
1341
|
-
* 给出的 UploadErrorStatusCode.UPLOAD_TASK_CONNECTION_DROPPED 错误
|
|
1342
|
-
* 该错误的第二个参数值,为此处指定的 taskId
|
|
1343
|
-
**/
|
|
1344
|
-
taskId?: string | number;
|
|
1345
|
-
};
|
|
1346
|
-
type UploadStickerParamsT = {
|
|
1347
|
-
bgColor: number;
|
|
1348
|
-
text: string;
|
|
1349
|
-
/**
|
|
1350
|
-
* 指定 taskId,以方便处理 onUploaderError API 执行时,
|
|
1351
|
-
* 给出的 UploadErrorStatusCode.UPLOAD_TASK_CONNECTION_DROPPED 错误
|
|
1352
|
-
* 该错误的第二个参数值,为此处指定的 taskId
|
|
1353
|
-
**/
|
|
1354
|
-
taskId?: string | number;
|
|
1355
|
-
};
|
|
1356
|
-
interface HeicConvertResult {
|
|
1357
|
-
width: number;
|
|
1358
|
-
height: number;
|
|
1359
|
-
file: File;
|
|
1360
|
-
ext: 'jpg';
|
|
1361
|
-
}
|
|
1362
|
-
type UploadErrorMsgType = {
|
|
1363
|
-
[UploadErrorStatusCode.MISSING_TOKEN]: void;
|
|
1364
|
-
[UploadErrorStatusCode.TOKEN_EXPIRED]: void;
|
|
1365
|
-
[UploadErrorStatusCode.INVALID_TOKEN]: void;
|
|
1366
|
-
[UploadErrorStatusCode.SPACE_EXCEEDED]: void;
|
|
1367
|
-
[UploadErrorStatusCode.UPLOAD_TASK_CONNECTION_DROPPED]: number | string;
|
|
1368
|
-
};
|
|
1369
|
-
interface InfiUploaderType {
|
|
1370
|
-
/** 当前进行 Uploader task 的用户名,可以通过 updateUploaderName 进行更新,默认为“访客” */
|
|
1371
|
-
readonly curUserName: string;
|
|
1372
|
-
/**
|
|
1373
|
-
* 待上传画布名称,如果使用 InfiWebSdk 时有设置 title 字段,
|
|
1374
|
-
* 在使用该画布生成 token,并初始化成功 InfiUploader 后,则可以获取到该值
|
|
1375
|
-
**/
|
|
1376
|
-
readonly boardTitle: string;
|
|
1377
|
-
/** 初始化 Uploader ,返回 true 表初始化成功 */
|
|
1378
|
-
init: (token: string) => Promise<boolean>;
|
|
1379
|
-
/**
|
|
1380
|
-
* 验证待上传文件的有效性,如果 init 未完成,则会直接返回 null
|
|
1381
|
-
* 建议于 uploadFiles 之前使用,在获取到 validFiles 数组后基于 uploadFiles API 进行上传
|
|
1382
|
-
**/
|
|
1383
|
-
validateFilesToUpload: (files: File[]) => ReturnType<typeof classifyFiles> | null;
|
|
1384
|
-
/** 上传文件 */
|
|
1385
|
-
uploadFiles: (params: UploadFileParamsT) => Promise<boolean[]>;
|
|
1386
|
-
/** 上传贴纸 */
|
|
1387
|
-
uploadSticker: (params: UploadStickerParamsT) => Promise<boolean>;
|
|
1388
|
-
/** 将 helc 文件转化为 jpg 格式 */
|
|
1389
|
-
convertHeicFile(file: File): Promise<HeicConvertResult>;
|
|
1390
|
-
/** 销毁 Uploader 实例 */
|
|
1391
|
-
destroy: () => void;
|
|
1392
|
-
/** 更新上传者用户名称,该数据将于画布中展示,如果不执行该 API,用户名称会默认显示 “访客” */
|
|
1393
|
-
updateUploaderName: (name: string) => void;
|
|
1394
|
-
/** 如果需要监听 Uploader 错误信息,可以在 InfiUploader 实例上挂载这个方法 */
|
|
1395
|
-
onUploaderError?: <C extends UploadErrorStatusCode>(code: C, value: UploadErrorMsgType[C]) => unknown;
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
1607
|
/**
|
|
1399
1608
|
* 根据文件后缀获取文件类型
|
|
1400
1609
|
* @param ext
|
|
@@ -1477,41 +1686,10 @@ declare class SvgManager {
|
|
|
1477
1686
|
|
|
1478
1687
|
declare function useInfiWebSDK(): BoardHooksT;
|
|
1479
1688
|
|
|
1480
|
-
declare class InfiUploader implements InfiUploaderType {
|
|
1481
|
-
private token;
|
|
1482
|
-
private initialized;
|
|
1483
|
-
private userName;
|
|
1484
|
-
private uploadFileKey;
|
|
1485
|
-
private uploadSizeLimit;
|
|
1486
|
-
private viewScale;
|
|
1487
|
-
private connectionId;
|
|
1488
|
-
private fileIndex;
|
|
1489
|
-
private stickerIndex;
|
|
1490
|
-
private canvasPosition;
|
|
1491
|
-
private _boardTitle;
|
|
1492
|
-
onUploaderError?: InfiUploaderType['onUploaderError'];
|
|
1493
|
-
get curUserName(): string;
|
|
1494
|
-
get boardTitle(): string;
|
|
1495
|
-
/**
|
|
1496
|
-
* 只为提供 convertHeicFile 能力,upimesdk 把这个 API 跟 uploader 写成强相关了,
|
|
1497
|
-
* 实际上二者不应该有任何关联。这里搞一个无意义的 uploader 来支持该 API 的正常调用
|
|
1498
|
-
**/
|
|
1499
|
-
private dummyUploader;
|
|
1500
|
-
constructor(token: string);
|
|
1501
|
-
updateUploaderName: (name: string) => void;
|
|
1502
|
-
init(): Promise<boolean>;
|
|
1503
|
-
private prepareUploader;
|
|
1504
|
-
private getBoardQuery;
|
|
1505
|
-
validateFilesToUpload(files: File[]): any;
|
|
1506
|
-
uploadFiles: (params: UploadFileParamsT) => Promise<boolean[]>;
|
|
1507
|
-
uploadSticker: (params: UploadStickerParamsT) => Promise<boolean>;
|
|
1508
|
-
convertHeicFile: (file: File) => Promise<HeicConvertResult>;
|
|
1509
|
-
destroy(): void;
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
1689
|
declare const GroupTalkPlugin: ISdkPluginConstructor<InfiSdkPluginConfig>;
|
|
1513
1690
|
declare const VotingPlugin: ISdkPluginConstructor<InfiSdkPluginConfig>;
|
|
1514
1691
|
|
|
1515
1692
|
declare const _default: InfiWebSdkType;
|
|
1516
1693
|
|
|
1517
|
-
export {
|
|
1694
|
+
export { AIInstructionType, DefaultPerm, ExitMeetingStatus, ExportFileTypeT, FULL_TOOLBAR_CONFIG, FULL_USER_ACCESS, GridType, GroupTalkPlugin, HoverTip, InfiUploader, QUICK_USER_ACCESS, RemoteControlClientRole, RemoteControlEndReason, RemoteControlKickedOutReason, SvgIcon, SvgManager, USER_ACCESS, UploadErrorStatusCode, VotingPlugin, _default as default, getDocumentType, getFileType, useInfiWebSDK };
|
|
1695
|
+
export type { CanUploadInfo, ComponentProps, CustomizeUploader, EditMeetingCmpProp, ExternalFileAppend, FileMetaType, FollowGroupConfigT, GetSdkInstanceConfigs, GroupTalkConfig, IFollowGroupOperation, InfiSdkPluginType, InfiUploaderType, InfiUserInfoT, InfiWebSdkCustomPlugin, InfiWebSdkPlugin, InfiWebsdkInstanceType, InviteMemberCmpProp, MeetingConfigs, RemoteControlEndReasonT, SdkBottomRightPluginSlotType, SdkMeetingToolSlotType, SdkPluginSlotType, SelectRectCtrl, SelectRectCtrlConfigT, TemplateDataT, TemplateType, ToolBarType, ToolBarWidgetsConfigsT, UploadErrorMsgType, UploadRejectInfo, WebsdkEngineType };
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{bC as AIInstructionType,bq as DefaultPerm,bu as ExitMeetingStatus,bv as ExportFileTypeT,by as FULL_TOOLBAR_CONFIG,bz as FULL_USER_ACCESS,bp as GridType,bm as GroupTalkPlugin,bE as HoverTip,bH as InfiUploader,bB as QUICK_USER_ACCESS,br as RemoteControlClientRole,bs as RemoteControlEndReason,bt as RemoteControlKickedOutReason,bJ as SUPPORT_FILE_EXT,bD as SvgIcon,bF as SvgManager,bA as USER_ACCESS,bI as UploadErrorStatusCode,bn as VotingPlugin,bo as default,bx as getDocumentType,bw as getFileType,bG as useInfiWebSDK}from"./index-6d583942.js";import"react";import"react-dom";import"stream";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,
|
|
1
|
+
import{b as t,Q as i,P as n}from"./index-6d583942.js";import"react";import"react-dom";import"stream";var s=function(){var t=function(t,i,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=i);return n},i=[6,9,10],n={trace:function(){},yy:{},symbols_:{error:2,start:3,info:4,document:5,EOF:6,line:7,statement:8,NL:9,showInfo:10,$accept:0,$end:1},terminals_:{2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],performAction:function(t,i,n,s,e,r,o){switch(r.length,e){case 1:return s;case 4:break;case 6:s.setInfo(!0)}},table:[{3:1,4:[1,2]},{1:[3]},t(i,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},t(i,[2,3]),t(i,[2,4]),t(i,[2,5]),t(i,[2,6])],defaultActions:{4:[2,1]},parseError:function(t,i){if(!i.recoverable){var n=new Error(t);throw n.hash=i,n}this.trace(t)},parse:function(t){var i=[0],n=[],s=[null],e=[],r=this.table,o="",h=0,l=0,c=e.slice.call(arguments,1),a=Object.create(this.lexer),y={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(y.yy[u]=this.yy[u]);a.setInput(t,y.yy),y.yy.lexer=a,y.yy.parser=this,void 0===a.yylloc&&(a.yylloc={});var p=a.yylloc;e.push(p);var f=a.options&&a.options.ranges;"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var g,m,_,d,k,x,b,v,I,w={};;){if(m=i[i.length-1],this.defaultActions[m]?_=this.defaultActions[m]:(null==g&&(I=void 0,"number"!=typeof(I=n.pop()||a.lex()||1)&&(I instanceof Array&&(I=(n=I).pop()),I=this.symbols_[I]||I),g=I),_=r[m]&&r[m][g]),void 0===_||!_.length||!_[0]){var S;for(k in v=[],r[m])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");S=a.showPosition?"Parse error on line "+(h+1)+":\n"+a.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==g?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(S,{text:a.match,token:this.terminals_[g]||g,line:a.yylineno,loc:p,expected:v})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+g);switch(_[0]){case 1:i.push(g),s.push(a.yytext),e.push(a.yylloc),i.push(_[1]),g=null,l=a.yyleng,o=a.yytext,h=a.yylineno,p=a.yylloc;break;case 2:if(x=this.productions_[_[1]][1],w.$=s[s.length-x],w._$={first_line:e[e.length-(x||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(x||1)].first_column,last_column:e[e.length-1].last_column},f&&(w._$.range=[e[e.length-(x||1)].range[0],e[e.length-1].range[1]]),void 0!==(d=this.performAction.apply(w,[o,l,h,y.yy,_[1],s,e].concat(c))))return d;x&&(i=i.slice(0,-1*x*2),s=s.slice(0,-1*x),e=e.slice(0,-1*x)),i.push(this.productions_[_[1]][0]),s.push(w.$),e.push(w._$),b=r[i[i.length-2]][i[i.length-1]],i.push(b);break;case 3:return!0}}return!0}},s={EOF:1,parseError:function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},setInput:function(t,i){return this.yy=i||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var i=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},test_match:function(t,i){var n,s,e;if(this.options.backtrack_lexer&&(e={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(e.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in e)this[r]=e[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,i,n,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),r=0;r<e.length;r++)if((n=this._input.match(this.rules[e[r]]))&&(!i||n[0].length>i[0].length)){if(i=n,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,e[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,e[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,i,n,s){switch(n){case 0:return 4;case 1:return 9;case 2:return"space";case 3:return 10;case 4:return 6;case 5:return"TXT"}},rules:[/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5],inclusive:!0}}};function e(){this.yy={}}return n.lexer=s,e.prototype=n,n.Parser=e,new e}();s.parser=s;const e=!1;let r=e;const o={parser:s,db:{clear:()=>{r=e},setInfo:t=>{r=t},getInfo:()=>r},renderer:{draw:(s,e,r)=>{t.debug("rendering info diagram\n"+s);const o=i(e);n(o,100,400,!0),o.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)}}};export{o as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{X as t,H as e,s as n,K as i,V as s,W as r,G as a,j as o,M as l,P as c}from"./index-6d583942.js";import{e as h,r as u,o as y}from"./svgDrawCommon-08f97a94-2aa41d50-7487ac68.js";import{T as p}from"./arc-bf33507a-003d6dbd.js";import"react";import"react-dom";import"stream";import"./path-0fb51fa8-bd99a70c.js";var d=function(){var t=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],s=[1,11],r=[1,12],a=[1,13],o=[1,14],l={trace:function(){},yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:function(t,e,n,i,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[o]),this.$="task"}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:i,14:s,16:r,17:a,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:s,16:r,17:a,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},parse:function(t){var e=[0],n=[],i=[null],s=[],r=this.table,a="",o=0,l=0,c=s.slice.call(arguments,1),h=Object.create(this.lexer),u={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(u.yy[y]=this.yy[y]);h.setInput(t,u.yy),u.yy.lexer=h,u.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var p=h.yylloc;s.push(p);var d=h.options&&h.options.ranges;"function"==typeof u.yy.parseError?this.parseError=u.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,g,m,x,k,_,b,v,$,w={};;){if(g=e[e.length-1],this.defaultActions[g]?m=this.defaultActions[g]:(null==f&&($=void 0,"number"!=typeof($=n.pop()||h.lex()||1)&&($ instanceof Array&&($=(n=$).pop()),$=this.symbols_[$]||$),f=$),m=r[g]&&r[g][f]),void 0===m||!m.length||!m[0]){var M;for(k in v=[],r[g])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");M=h.showPosition?"Parse error on line "+(o+1)+":\n"+h.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(M,{text:h.match,token:this.terminals_[f]||f,line:h.yylineno,loc:p,expected:v})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+f);switch(m[0]){case 1:e.push(f),i.push(h.yytext),s.push(h.yylloc),e.push(m[1]),f=null,l=h.yyleng,a=h.yytext,o=h.yylineno,p=h.yylloc;break;case 2:if(_=this.productions_[m[1]][1],w.$=i[i.length-_],w._$={first_line:s[s.length-(_||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(_||1)].first_column,last_column:s[s.length-1].last_column},d&&(w._$.range=[s[s.length-(_||1)].range[0],s[s.length-1].range[1]]),void 0!==(x=this.performAction.apply(w,[a,l,o,u.yy,m[1],i,s].concat(c))))return x;_&&(e=e.slice(0,-1*_*2),i=i.slice(0,-1*_),s=s.slice(0,-1*_)),e.push(this.productions_[m[1]][0]),i.push(w.$),s.push(w._$),b=r[e[e.length-2]][e[e.length-1]],e.push(b);break;case 3:return!0}}return!0}},c={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,i,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};function h(){this.yy={}}return l.lexer=c,h.prototype=l,l.Parser=h,new h}();d.parser=d;const f=d;let g="";const m=[],x=[],k=[],_=function(){let t=!0;for(const[e,n]of k.entries())k[e].processed,t=t&&n.processed;return t},b={getConfig:()=>t().journey,clear:function(){m.length=0,x.length=0,g="",k.length=0,e()},setDiagramTitle:n,getDiagramTitle:i,setAccTitle:s,getAccTitle:r,setAccDescription:a,getAccDescription:o,addSection:function(t){g=t,m.push(t)},getSections:function(){return m},getTasks:function(){let t=_(),e=0;for(;!t&&e<100;)t=_(),e++;return x.push(...k),x},addTask:function(t,e){const n=e.substr(1).split(":");let i=0,s=[];1===n.length?(i=Number(n[0]),s=[]):(i=Number(n[0]),s=n[1].split(","));const r=s.map(t=>t.trim()),a={section:g,type:g,people:r,task:t,score:i};k.push(a)},addTaskOrg:function(t){const e={section:g,type:g,description:t,task:t,classes:[]};x.push(e)},getActors:function(){return function(){const t=[];return x.forEach(e=>{e.people&&t.push(...e.people)}),[...new Set(t)].sort()}()}},v=function(t,e){return u(t,e)},$=function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n};let w=-1;const M=function(){function t(t,e,n,s,r,a,o,l){i(e.append("text").attr("x",n+r/2).attr("y",s+a/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,s,r,a,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,y=t.split(/<br\s*\/?>/gi);for(let t=0;t<y.length;t++){const l=t*h-h*(y.length-1)/2,p=e.append("text").attr("x",n+r/2).attr("y",s).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);p.append("tspan").attr("x",n+r/2).attr("dy",l).text(y[t]),p.attr("y",s+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(p,o)}}function n(t,n,s,r,a,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",s).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,s,r,a,o,l,c),i(u,l)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),T=$,E=function(t,e,n){const i=t.append("g"),s=y();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=n.width*e.taskCount+n.diagramMarginX*(e.taskCount-1),s.height=n.height,s.class="journey-section section-type-"+e.num,s.rx=3,s.ry=3,v(i,s),M(n)(e.text,i,s.x,s.y,s.width,s.height,{class:"journey-section section-type-"+e.num},n,e.colour)},S=function(t,e){return h(t,e)},A=function(t,e,n){const i=e.x+n.width/2,s=t.append("g");w++,s.append("line").attr("id","task"+w).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),function(t,e){t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible");const n=t.append("g");n.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),n.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),e.score>3?function(t){const n=p().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}(n):e.score<3?function(t){const n=p().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(15/2.2);t.append("path").attr("class","mouth").attr("d",n).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}(n):n.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}(s,{cx:i,cy:300+30*(5-e.score),score:e.score});const r=y();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=n.width,r.height=n.height,r.class="task task-type-"+e.num,r.rx=3,r.ry=3,v(s,r);let a=e.x+14;e.people.forEach(t=>{const n=e.actors[t].color,i={cx:a,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};$(s,i),a+=10}),M(n)(e.task,s,r.x,r.y,r.width,r.height,{class:"task"},n,e.colour)},I={},P=t().journey,j=P.leftMargin,C={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},updateBounds:function(e,n,i,s){const r=t().journey,a=this;let o=0;this.sequenceItems.forEach(function(t){o++;const l=a.sequenceItems.length-o+1;a.updateVal(t,"starty",n-l*r.boxMargin,Math.min),a.updateVal(t,"stopy",s+l*r.boxMargin,Math.max),a.updateVal(C.data,"startx",e-l*r.boxMargin,Math.min),a.updateVal(C.data,"stopx",i+l*r.boxMargin,Math.max),a.updateVal(t,"startx",e-l*r.boxMargin,Math.min),a.updateVal(t,"stopx",i+l*r.boxMargin,Math.max),a.updateVal(C.data,"starty",n-l*r.boxMargin,Math.min),a.updateVal(C.data,"stopy",s+l*r.boxMargin,Math.max)})},insert:function(t,e,n,i){const s=Math.min(t,n),r=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(C.data,"startx",s,Math.min),this.updateVal(C.data,"starty",a,Math.min),this.updateVal(C.data,"stopx",r,Math.max),this.updateVal(C.data,"stopy",o,Math.max),this.updateBounds(s,a,r,o)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},V=P.sectionFills,D=P.sectionColours,O={setConf:function(t){Object.keys(t).forEach(function(e){P[e]=t[e]})},draw:function(e,n,i,s){const r=t().journey,a=t().securityLevel;let o;"sandbox"===a&&(o=l("#i"+n));const h=l("sandbox"===a?o.nodes()[0].contentDocument.body:"body");C.init();const u=h.select("#"+n);u.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z");const y=s.db.getTasks(),p=s.db.getDiagramTitle(),d=s.db.getActors();for(const t in I)delete I[t];let f=0;d.forEach(t=>{I[t]={color:r.actorColours[f%r.actorColours.length],position:f},f++}),function(e){const n=t().journey;let i=60;Object.keys(I).forEach(t=>{const s=I[t].color,r={cx:20,cy:i,r:7,fill:s,stroke:"#000",pos:I[t].position};T(e,r);const a={x:40,y:i+7,fill:"#666",text:t,textMargin:5|n.boxTextMargin};S(e,a),i+=20})}(u),C.insert(0,0,j,50*Object.keys(I).length),function(e,n,i){const s=t().journey;let r="";const a=i+(2*s.height+s.diagramMarginY);let o=0,l="#CCC",c="black",h=0;for(const[t,i]of n.entries()){if(r!==i.section){l=V[o%V.length],h=o%V.length,c=D[o%D.length];let a=0;const u=i.section;for(let e=t;e<n.length&&n[e].section==u;e++)a+=1;const y={x:t*s.taskMargin+t*s.width+j,y:50,text:i.section,fill:l,num:h,colour:c,taskCount:a};E(e,y,s),r=i.section,o++}const u=i.people.reduce((t,e)=>(I[e]&&(t[e]=I[e]),t),{});i.x=t*s.taskMargin+t*s.width+j,i.y=a,i.width=s.diagramMarginX,i.height=s.diagramMarginY,i.colour=c,i.fill=l,i.num=h,i.actors=u,A(e,i,s),C.insert(i.x,i.y,i.x+i.width+s.taskMargin,450)}}(u,y,0);const g=C.getBounds();p&&u.append("text").text(p).attr("x",j).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const m=g.stopy-g.starty+2*r.diagramMarginY,x=j+g.stopx+2*r.diagramMarginX;c(u,m,x,r.useMaxWidth),u.append("line").attr("x1",j).attr("y1",4*r.height).attr("x2",x-j-4).attr("y2",4*r.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const k=p?70:0;u.attr("viewBox",`${g.startx} -25 ${x} ${m+k}`),u.attr("preserveAspectRatio","xMinYMin meet"),u.attr("height",m+k+25)}},F={parser:f,db:b,renderer:O,styles:t=>`.label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`,init:t=>{O.setConf(t.journey),b.clear()}};export{F as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as n,B as e,u as r,s as t,n as o,f as i,o as u,z as a,a as d,N as c,d as f,y as s,g,b as h,j as v,w as l,c as p,I as w,i as m,l as b,T as y,W as x}from"./graph-faeaf8aa-2860c59a.js";import{ac as k,ad as E,ae as N,af as _,ag as I,ah as R,ai as M,aj as T,ak as L,al as C,am as O,an as P,ao as S,ap as j,aq as V,ar as F,as as G,at as B}from"./index-6d583942.js";var q=/\s/,Y=/^\s+/;var z=/^[-+]0x[0-9a-f]+$/i,A=/^0b[01]+$/i,D=/^0o[0-7]+$/i,$=parseInt,J=1/0;function W(n){return n?(n=function(n){if("number"==typeof n)return n;if(a(n))return NaN;if(L(n)){var e="function"==typeof n.valueOf?n.valueOf():n;n=L(e)?e+"":e}if("string"!=typeof n)return 0===n?n:+n;var r;n=(r=n)?r.slice(0,function(n){for(var e=n.length;e--&&q.test(n.charAt(e)););return e}(r)+1).replace(Y,""):r;var t=A.test(n);return t||D.test(n)?$(n.slice(2),t?2:8):z.test(n)?NaN:+n}(n))===J||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function H(e){return null!=e&&e.length?n(e,1):[]}var K=Object.prototype,Q=K.hasOwnProperty,U=k(function(n,e){n=Object(n);var r=-1,t=e.length,o=t>2?e[2]:void 0;for(o&&E(e[0],e[1],o)&&(t=1);++r<t;)for(var i=e[r],u=N(i),a=-1,d=u.length;++a<d;){var c=u[a],f=n[c];(void 0===f||_(f,K[c])&&!Q.call(n,c))&&(n[c]=i[c])}return n});function X(n){var e=null==n?0:n.length;return e?n[e-1]:void 0}var Z,nn=Math.max,en=(Z=function(n,e,r){var t=null==n?0:n.length;if(!t)return-1;var o,i,u=null==r?0:(i=(o=W(r))%1,o==o?i?o-i:o:0);return u<0&&(u=nn(t+u,0)),x(n,d(e),u)},function(n,e,r){var t=Object(n);if(!T(n)){var o=d(e);n=y(n),e=function(n){return o(t[n],n,t)}}var i=Z(n,e,r);return i>-1?t[o?n[i]:i]:void 0});function rn(n,e){var r=-1,t=T(n)?Array(n.length):[];return i(n,function(n,o,i){t[++r]=e(n,o,i)}),t}function tn(n,r){return(P(n)?e:rn)(n,d(r))}function on(n,e){return n>e}function un(n,e){return n<e}function an(n,e){var r={};return e=d(e),h(n,function(n,t,o){F(r,t,e(n,t,o))}),r}function dn(n,e,r){for(var t=-1,o=n.length;++t<o;){var i=n[t],u=e(i);if(null!=u&&(void 0===d?u==u&&!a(u):r(u,d)))var d=u,c=i}return c}function cn(n){return n&&n.length?dn(n,M,on):void 0}function fn(n){return n&&n.length?dn(n,M,un):void 0}function sn(n,e){return n&&n.length?dn(n,d(e),un):void 0}function gn(n,e,r,o){if(!L(n))return n;for(var i=-1,a=(e=t(e,n)).length,d=a-1,c=n;null!=c&&++i<a;){var f=u(e[i]),s=r;if("__proto__"===f||"constructor"===f||"prototype"===f)return n;if(i!=d){var g=c[f];void 0===(s=o?o(g,f,c):void 0)&&(s=L(g)?g:C(e[i+1])?[]:{})}O(c,f,s),c=c[f]}return n}function hn(n,e){if(n!==e){var r=void 0!==n,t=null===n,o=n==n,i=a(n),u=void 0!==e,d=null===e,c=e==e,f=a(e);if(!d&&!f&&!i&&n>e||i&&u&&c&&!d&&!f||t&&u&&c||!r&&c||!o)return 1;if(!t&&!i&&!f&&n<e||f&&r&&o&&!t&&!i||d&&r&&o||!u&&o||!c)return-1}return 0}var vn,ln=I(R(vn=function(n,e){return null==n?{}:function(n,e){return function(n,e,o){for(var i=-1,u=e.length,a={};++i<u;){var d=e[i],c=r(n,d);o(c,d)&&gn(a,t(d,n),c)}return a}(n,e,function(e,r){return o(n,r)})}(n,e)},void 0,H),vn+""),pn=Math.ceil,wn=Math.max,mn=function(n,e,r){return r&&"number"!=typeof r&&E(n,e,r)&&(e=r=void 0),n=W(n),void 0===e?(e=n,n=0):e=W(e),function(n,e,r){for(var t=-1,o=wn(pn((e-n)/(r||1)),0),i=Array(o);o--;)i[++t]=n,n+=r;return i}(n,e,r=void 0===r?n<e?1:-1:W(r))},bn=k(function(t,o){if(null==t)return[];var i=o.length;return i>1&&E(t,o[0],o[1])?o=[]:i>2&&E(o[0],o[1],o[2])&&(o=[o[0]]),function(n,t,o){t=t.length?e(t,function(n){return P(n)?function(e){return r(e,1===n.length?n[0]:n)}:n}):[M];var i=-1;return t=e(t,S(d)),function(n,e){var r=n.length;for(n.sort(e);r--;)n[r]=n[r].value;return n}(rn(n,function(n,r,o){return{criteria:e(t,function(e){return e(n)}),index:++i,value:n}}),function(n,e){return function(n,e,r){for(var t=-1,o=n.criteria,i=e.criteria,u=o.length,a=r.length;++t<u;){var d=hn(o[t],i[t]);if(d)return t>=a?d:d*("desc"==r[t]?-1:1)}return n.index-e.index}(n,e,o)})}(t,n(o,1),[])}),yn=0;function xn(n){var e=++yn;return m(n)+e}class kn{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,e=n._prev;if(e!==n)return En(e),e}enqueue(n){var e=this._sentinel;n._prev&&n._next&&En(n),n._next=e._next,e._next._prev=n,e._next=n,n._prev=e}toString(){for(var n=[],e=this._sentinel,r=e._prev;r!==e;)n.push(JSON.stringify(r,Nn)),r=r._prev;return"["+n.join(", ")+"]"}}function En(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function Nn(n,e){if("_next"!==n&&"_prev"!==n)return e}var _n=G(1);function In(n,e,r,t,o){var i=o?[]:void 0;return f(n.inEdges(t.v),function(t){var u=n.edge(t),a=n.node(t.v);o&&i.push({v:t.v,w:t.w}),a.out-=u,Rn(e,r,a)}),f(n.outEdges(t.v),function(t){var o=n.edge(t),i=t.w,u=n.node(i);u.in-=o,Rn(e,r,u)}),n.removeNode(t.v),i}function Rn(n,e,r){r.out?r.in?n[r.out-r.in+e].enqueue(r):n[n.length-1].enqueue(r):n[0].enqueue(r)}function Mn(n){var e="greedy"===n.graph().acyclicer?function(n,e){if(n.nodeCount()<=1)return[];var r=function(n,e){var r=new c,t=0,o=0;f(n.nodes(),function(n){r.setNode(n,{v:n,in:0,out:0})}),f(n.edges(),function(n){var i=r.edge(n.v,n.w)||0,u=e(n),a=i+u;r.setEdge(n.v,n.w,a),o=Math.max(o,r.node(n.v).out+=u),t=Math.max(t,r.node(n.w).in+=u)});var i=mn(o+t+3).map(function(){return new kn}),u=t+1;return f(r.nodes(),function(n){Rn(i,u,r.node(n))}),{graph:r,buckets:i,zeroIdx:u}}(n,e||_n),t=function(n,e,r){for(var t,o=[],i=e[e.length-1],u=e[0];n.nodeCount();){for(;t=u.dequeue();)In(n,e,r,t);for(;t=i.dequeue();)In(n,e,r,t);if(n.nodeCount())for(var a=e.length-2;a>0;--a)if(t=e[a].dequeue()){o=o.concat(In(n,e,r,t,!0));break}}return o}(r.graph,r.buckets,r.zeroIdx);return H(tn(t,function(e){return n.outEdges(e.v,e.w)}))}(n,function(n){return function(e){return n.edge(e).weight}}(n)):function(n){var e=[],r={},t={};return f(n.nodes(),function o(i){g(t,i)||(t[i]=!0,r[i]=!0,f(n.outEdges(i),function(n){g(r,n.w)?e.push(n):o(n.w)}),delete r[i])}),e}(n);f(e,function(e){var r=n.edge(e);n.removeEdge(e),r.forwardName=e.name,r.reversed=!0,n.setEdge(e.w,e.v,r,xn("rev"))})}function Tn(n,e,r,t){var o;do{o=xn(t)}while(n.hasNode(o));return r.dummy=e,n.setNode(o,r),o}function Ln(n){var e=new c({multigraph:n.isMultigraph()}).setGraph(n.graph());return f(n.nodes(),function(r){n.children(r).length||e.setNode(r,n.node(r))}),f(n.edges(),function(r){e.setEdge(r,n.edge(r))}),e}function Cn(n,e){var r,t,o=n.x,i=n.y,u=e.x-o,a=e.y-i,d=n.width/2,c=n.height/2;if(!u&&!a)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(a)*d>Math.abs(u)*c?(a<0&&(c=-c),r=c*u/a,t=c):(u<0&&(d=-d),r=d,t=d*a/u),{x:o+r,y:i+t}}function On(n){var e=tn(mn(Sn(n)+1),function(){return[]});return f(n.nodes(),function(r){var t=n.node(r),o=t.rank;s(o)||(e[o][t.order]=r)}),e}function Pn(n,e,r,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=r,o.order=t),Tn(n,"border",o,e)}function Sn(n){return cn(tn(n.nodes(),function(e){var r=n.node(e).rank;if(!s(r))return r}))}function jn(n,e){V.Date.now();try{return e()}finally{}}function Vn(n,e){return e()}function Fn(n,e,r,t,o,i){var u={width:0,height:0,rank:i,borderType:e},a=o[e][i-1],d=Tn(n,"border",u,r);o[e][i]=d,n.setParent(d,t),a&&n.setEdge(a,d,{weight:1})}function Gn(n){f(n.nodes(),function(e){Bn(n.node(e))}),f(n.edges(),function(e){Bn(n.edge(e))})}function Bn(n){var e=n.width;n.width=n.height,n.height=e}function qn(n){n.y=-n.y}function Yn(n){var e=n.x;n.x=n.y,n.y=e}function zn(n){var e={};f(n.sources(),function r(t){var o=n.node(t);if(g(e,t))return o.rank;e[t]=!0;var i=fn(tn(n.outEdges(t),function(e){return r(e.w)-n.edge(e).minlen}));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i})}function An(n,e){return n.node(e.w).rank-n.node(e.v).rank-n.edge(e).minlen}function Dn(n){var e,r,t=new c({directed:!1}),o=n.nodes()[0],i=n.nodeCount();for(t.setNode(o,{});$n(t,n)<i;)e=Jn(t,n),r=t.hasNode(e.v)?An(n,e):-An(n,e),Wn(t,n,r);return t}function $n(n,e){return f(n.nodes(),function r(t){f(e.nodeEdges(t),function(o){var i=o.v,u=t===i?o.w:i;n.hasNode(u)||An(e,o)||(n.setNode(u,{}),n.setEdge(t,u,{}),r(u))})}),n.nodeCount()}function Jn(n,e){return sn(e.edges(),function(r){if(n.hasNode(r.v)!==n.hasNode(r.w))return An(e,r)})}function Wn(n,e,r){f(n.nodes(),function(n){e.node(n).rank+=r})}function Hn(n,e,r){P(e)||(e=[e]);var t=(n.isDirected()?n.successors:n.neighbors).bind(n),o=[],i={};return f(e,function(e){if(!n.hasNode(e))throw new Error("Graph does not have node: "+e);Kn(n,e,"post"===r,i,t,o)}),o}function Kn(n,e,r,t,o,i){g(t,e)||(t[e]=!0,r||i.push(e),f(o(e),function(e){Kn(n,e,r,t,o,i)}),r&&i.push(e))}function Qn(n){n=function(n){var e=(new c).setGraph(n.graph());return f(n.nodes(),function(r){e.setNode(r,n.node(r))}),f(n.edges(),function(r){var t=e.edge(r.v,r.w)||{weight:0,minlen:1},o=n.edge(r);e.setEdge(r.v,r.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),e}(n),zn(n);var e,r=Dn(n);for(Zn(r),Un(r,n);e=ee(r);)te(r,n,e,re(r,n,e))}function Un(n,e){var r=function(n,e){return Hn(n,e,"post")}(n,n.nodes());r=r.slice(0,r.length-1),f(r,function(r){!function(n,e,r){var t=n.node(r).parent;n.edge(r,t).cutvalue=Xn(n,e,r)}(n,e,r)})}function Xn(n,e,r){var t=n.node(r).parent,o=!0,i=e.edge(r,t),u=0;return i||(o=!1,i=e.edge(t,r)),u=i.weight,f(e.nodeEdges(r),function(i){var a,d,c=i.v===r,f=c?i.w:i.v;if(f!==t){var s=c===o,g=e.edge(i).weight;if(u+=s?g:-g,a=r,d=f,n.hasEdge(a,d)){var h=n.edge(r,f).cutvalue;u+=s?-h:h}}}),u}function Zn(n,e){arguments.length<2&&(e=n.nodes()[0]),ne(n,{},1,e)}function ne(n,e,r,t,o){var i=r,u=n.node(t);return e[t]=!0,f(n.neighbors(t),function(o){g(e,o)||(r=ne(n,e,r,o,t))}),u.low=i,u.lim=r++,o?u.parent=o:delete u.parent,r}function ee(n){return en(n.edges(),function(e){return n.edge(e).cutvalue<0})}function re(n,e,r){var t=r.v,o=r.w;e.hasEdge(t,o)||(t=r.w,o=r.v);var i=n.node(t),u=n.node(o),a=i,d=!1;return i.lim>u.lim&&(a=u,d=!0),sn(p(e.edges(),function(e){return d===oe(n,n.node(e.v),a)&&d!==oe(n,n.node(e.w),a)}),function(n){return An(e,n)})}function te(n,e,r,t){var o=r.v,i=r.w;n.removeEdge(o,i),n.setEdge(t.v,t.w,{}),Zn(n),Un(n,e),function(n,e){var r=en(n.nodes(),function(n){return!e.node(n).parent}),t=function(n,e){return Hn(n,e,"pre")}(n,r);t=t.slice(1),f(t,function(r){var t=n.node(r).parent,o=e.edge(r,t),i=!1;o||(o=e.edge(t,r),i=!0),e.node(r).rank=e.node(t).rank+(i?o.minlen:-o.minlen)})}(n,e)}function oe(n,e,r){return r.low<=e.lim&&e.lim<=r.lim}function ie(n){switch(n.graph().ranker){case"network-simplex":default:!function(n){Qn(n)}(n);break;case"tight-tree":!function(n){zn(n),Dn(n)}(n);break;case"longest-path":ue(n)}}Qn.initLowLimValues=Zn,Qn.initCutValues=Un,Qn.calcCutValue=Xn,Qn.leaveEdge=ee,Qn.enterEdge=re,Qn.exchangeEdges=te;var ue=zn;function ae(n){var e=Tn(n,"root",{},"_root"),r=function(n){var e={};function r(t,o){var i=n.children(t);i&&i.length&&f(i,function(n){r(n,o+1)}),e[t]=o}return f(n.children(),function(n){r(n,1)}),e}(n),t=cn(v(r))-1,o=2*t+1;n.graph().nestingRoot=e,f(n.edges(),function(e){n.edge(e).minlen*=o});var i=function(n){return l(n.edges(),function(e,r){return e+n.edge(r).weight},0)}(n)+1;f(n.children(),function(u){de(n,e,o,i,t,r,u)}),n.graph().nodeRankFactor=o}function de(n,e,r,t,o,i,u){var a=n.children(u);if(a.length){var d=Pn(n,"_bt"),c=Pn(n,"_bb"),s=n.node(u);n.setParent(d,u),s.borderTop=d,n.setParent(c,u),s.borderBottom=c,f(a,function(a){de(n,e,r,t,o,i,a);var f=n.node(a),s=f.borderTop?f.borderTop:a,g=f.borderBottom?f.borderBottom:a,h=f.borderTop?t:2*t,v=s!==g?1:o-i[u]+1;n.setEdge(d,s,{weight:h,minlen:v,nestingEdge:!0}),n.setEdge(g,c,{weight:h,minlen:v,nestingEdge:!0})}),n.parent(u)||n.setEdge(e,d,{weight:0,minlen:o+i[u]})}else u!==e&&n.setEdge(e,u,{weight:0,minlen:r})}function ce(n,e){for(var r=0,t=1;t<e.length;++t)r+=fe(n,e[t-1],e[t]);return r}function fe(n,e,r){for(var t=function(n,e){return function(n,e,r){for(var t=-1,o=n.length,i=e.length,u={};++t<o;){var a=t<i?e[t]:void 0;r(u,n[t],a)}return u}(n||[],e||[],O)}(r,tn(r,function(n,e){return e})),o=H(tn(e,function(e){return bn(tn(n.outEdges(e),function(e){return{pos:t[e.w],weight:n.edge(e).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var u=2*i-1;i-=1;var a=tn(new Array(u),function(){return 0}),d=0;return f(o.forEach(function(n){var e=n.pos+i;a[e]+=n.weight;for(var r=0;e>0;)e%2&&(r+=a[e+1]),a[e=e-1>>1]+=n.weight;d+=n.weight*r})),d}function se(n,e){var r,t=function(n){var e={lhs:[],rhs:[]};return f(n,function(n){!function(n){return g(n,"barycenter")}(n)?e.rhs.push(n):e.lhs.push(n)}),e}(n),o=t.lhs,i=bn(t.rhs,function(n){return-n.i}),u=[],a=0,d=0,c=0;o.sort((r=!!e,function(n,e){return n.barycenter<e.barycenter?-1:n.barycenter>e.barycenter?1:r?e.i-n.i:n.i-e.i})),c=ge(u,i,c),f(o,function(n){c+=n.vs.length,u.push(n.vs),a+=n.barycenter*n.weight,d+=n.weight,c=ge(u,i,c)});var s={vs:H(u)};return d&&(s.barycenter=a/d,s.weight=d),s}function ge(n,e,r){for(var t;e.length&&(t=X(e)).i<=r;)e.pop(),n.push(t.vs),r++;return r}function he(n,e,r,t){var o=n.children(e),i=n.node(e),u=i?i.borderLeft:void 0,a=i?i.borderRight:void 0,d={};u&&(o=p(o,function(n){return n!==u&&n!==a}));var c=function(n,e){return tn(e,function(e){var r=n.inEdges(e);if(r.length){var t=l(r,function(e,r){var t=n.edge(r),o=n.node(r.v);return{sum:e.sum+t.weight*o.order,weight:e.weight+t.weight}},{sum:0,weight:0});return{v:e,barycenter:t.sum/t.weight,weight:t.weight}}return{v:e}})}(n,o);f(c,function(e){if(n.children(e.v).length){var o=he(n,e.v,r,t);d[e.v]=o,g(o,"barycenter")&&(u=o,s((i=e).barycenter)?(i.barycenter=u.barycenter,i.weight=u.weight):(i.barycenter=(i.barycenter*i.weight+u.barycenter*u.weight)/(i.weight+u.weight),i.weight+=u.weight))}var i,u});var h=function(n,e){var r={};return f(n,function(n,e){var t=r[n.v]={indegree:0,in:[],out:[],vs:[n.v],i:e};s(n.barycenter)||(t.barycenter=n.barycenter,t.weight=n.weight)}),f(e.edges(),function(n){var e=r[n.v],t=r[n.w];s(e)||s(t)||(t.indegree++,e.out.push(r[n.w]))}),function(n){var e=[];function r(n){return function(e){e.merged||(s(e.barycenter)||s(n.barycenter)||e.barycenter>=n.barycenter)&&function(n,e){var r=0,t=0;n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.vs=e.vs.concat(n.vs),n.barycenter=r/t,n.weight=t,n.i=Math.min(e.i,n.i),e.merged=!0}(n,e)}}function t(e){return function(r){r.in.push(e),0==--r.indegree&&n.push(r)}}for(;n.length;){var o=n.pop();e.push(o),f(o.in.reverse(),r(o)),f(o.out,t(o))}return tn(p(e,function(n){return!n.merged}),function(n){return ln(n,["vs","i","barycenter","weight"])})}(p(r,function(n){return!n.indegree}))}(c,r);!function(n,e){f(n,function(n){n.vs=H(n.vs.map(function(n){return e[n]?e[n].vs:n}))})}(h,d);var v=se(h,t);if(u&&(v.vs=H([u,v.vs,a]),n.predecessors(u).length)){var w=n.node(n.predecessors(u)[0]),m=n.node(n.predecessors(a)[0]);g(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+w.order+m.order)/(v.weight+2),v.weight+=2}return v}function ve(n,e,r){return tn(e,function(e){return function(n,e,r){var t=function(n){for(var e;n.hasNode(e=xn("_root")););return e}(n),o=new c({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(e){return n.node(e)});return f(n.nodes(),function(i){var u=n.node(i),a=n.parent(i);(u.rank===e||u.minRank<=e&&e<=u.maxRank)&&(o.setNode(i),o.setParent(i,a||t),f(n[r](i),function(e){var r=e.v===i?e.w:e.v,t=o.edge(r,i),u=s(t)?0:t.weight;o.setEdge(r,i,{weight:n.edge(e).weight+u})}),g(u,"minRank")&&o.setNode(i,{borderLeft:u.borderLeft[e],borderRight:u.borderRight[e]}))}),o}(n,e,r)})}function le(n,e){var r=new c;f(n,function(n){var t=n.graph().root,o=he(n,t,r,e);f(o.vs,function(e,r){n.node(e).order=r}),function(n,e,r){var t,o={};f(r,function(r){for(var i,u,a=n.parent(r);a;){if((i=n.parent(a))?(u=o[i],o[i]=a):(u=t,t=a),u&&u!==a)return void e.setEdge(u,a);a=i}})}(n,r,o.vs)})}function pe(n,e){f(e,function(e){f(e,function(e,r){n.node(e).order=r})})}function we(n,e,r){if(e>r){var t=e;e=r,r=t}var o=n[e];o||(n[e]=o={}),o[r]=!0}function me(n,e,r){if(e>r){var t=e;e=r,r=t}return g(n[e],r)}function be(n){var e,r=On(n),t=j(function(n,e){var r={};return l(e,function(e,t){var o=0,i=0,u=e.length,a=X(t);return f(t,function(e,d){var c=function(n,e){if(n.node(e).dummy)return en(n.predecessors(e),function(e){return n.node(e).dummy})}(n,e),s=c?n.node(c).order:u;(c||e===a)&&(f(t.slice(i,d+1),function(e){f(n.predecessors(e),function(t){var i=n.node(t),u=i.order;!(u<o||s<u)||i.dummy&&n.node(e).dummy||we(r,t,e)})}),i=d+1,o=s)}),t}),r}(n,r),function(n,e){var r={};function t(e,t,o,i,u){var a;f(mn(t,o),function(t){a=e[t],n.node(a).dummy&&f(n.predecessors(a),function(e){var t=n.node(e);t.dummy&&(t.order<i||t.order>u)&&we(r,e,a)})})}return l(e,function(e,r){var o,i=-1,u=0;return f(r,function(a,d){if("border"===n.node(a).dummy){var c=n.predecessors(a);c.length&&(o=n.node(c[0]).order,t(r,u,d,i,o),u=d,i=o)}t(r,u,r.length,o,e.length)}),r}),r}(n,r)),o={};f(["u","d"],function(i){e="u"===i?r:v(r).reverse(),f(["l","r"],function(r){"r"===r&&(e=tn(e,function(n){return v(n).reverse()}));var u=("u"===i?n.predecessors:n.successors).bind(n),a=function(n,e,r,t){var o={},i={},u={};return f(e,function(n){f(n,function(n,e){o[n]=n,i[n]=n,u[n]=e})}),f(e,function(n){var e=-1;f(n,function(n){var a=t(n);if(a.length){a=bn(a,function(n){return u[n]});for(var d=(a.length-1)/2,c=Math.floor(d),f=Math.ceil(d);c<=f;++c){var s=a[c];i[n]===n&&e<u[s]&&!me(r,n,s)&&(i[s]=n,i[n]=o[n]=o[s],e=u[s])}}})}),{root:o,align:i}}(0,e,t,u),d=function(n,e,r,t,o){var i={},u=function(n,e,r,t){var o=new c,i=n.graph(),u=function(n,e,r){return function(t,o,i){var u,a=t.node(o),d=t.node(i),c=0;if(c+=a.width/2,g(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2}if(u&&(c+=r?u:-u),u=0,c+=(a.dummy?e:n)/2,c+=(d.dummy?e:n)/2,c+=d.width/2,g(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":u=d.width/2;break;case"r":u=-d.width/2}return u&&(c+=r?u:-u),u=0,c}}(i.nodesep,i.edgesep,t);return f(e,function(e){var t;f(e,function(e){var i=r[e];if(o.setNode(i),t){var a=r[t],d=o.edge(a,i);o.setEdge(a,i,Math.max(u(n,e,t),d||0))}t=e})}),o}(n,e,r,o),a=o?"borderLeft":"borderRight";function d(n,e){for(var r=u.nodes(),t=r.pop(),o={};t;)o[t]?n(t):(o[t]=!0,r.push(t),r=r.concat(e(t))),t=r.pop()}return d(function(n){i[n]=u.inEdges(n).reduce(function(n,e){return Math.max(n,i[e.v]+u.edge(e))},0)},u.predecessors.bind(u)),d(function(e){var r=u.outEdges(e).reduce(function(n,e){return Math.min(n,i[e.w]-u.edge(e))},Number.POSITIVE_INFINITY),t=n.node(e);r!==Number.POSITIVE_INFINITY&&t.borderType!==a&&(i[e]=Math.max(i[e],r))},u.successors.bind(u)),f(t,function(n){i[n]=i[r[n]]}),i}(n,e,a.root,a.align,"r"===r);"r"===r&&(d=an(d,function(n){return-n})),o[i+r]=d})});var i=function(n,e){return sn(v(e),function(e){var r,t,o=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return t=function(e,r){var t=function(n,e){return n.node(e).width}(n,r)/2;o=Math.max(e+t,o),i=Math.min(e-t,i)},null==(r=e)||B(r,b(t),N),o-i})}(n,o);return function(n,e){var r=v(e),t=fn(r),o=cn(r);f(["u","d"],function(r){f(["l","r"],function(i){var u,a=r+i,d=n[a];if(d!==e){var c=v(d);(u="l"===i?t-fn(c):o-cn(c))&&(n[a]=an(d,function(n){return n+u}))}})})}(o,i),function(n,e){return an(n.ul,function(r,t){if(e)return n[e.toLowerCase()][t];var o=bn(tn(n,t));return(o[1]+o[2])/2})}(o,n.graph().align)}function ye(n,e){var r=e&&e.debugTiming?jn:Vn;r("layout",function(){var e=r(" buildLayoutGraph",function(){return function(n){var e=new c({multigraph:!0,compound:!0}),r=Le(n.graph());return e.setGraph(j({},ke,Te(r,xe),ln(r,Ee))),f(n.nodes(),function(r){var t=Le(n.node(r));e.setNode(r,U(Te(t,Ne),_e)),e.setParent(r,n.parent(r))}),f(n.edges(),function(r){var t=Le(n.edge(r));e.setEdge(r,j({},Re,Te(t,Ie),ln(t,Me)))}),e}(n)});r(" runLayout",function(){!function(n,e){e(" makeSpaceForEdgeLabels",function(){!function(n){var e=n.graph();e.ranksep/=2,f(n.edges(),function(r){var t=n.edge(r);t.minlen*=2,"c"!==t.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?t.width+=t.labeloffset:t.height+=t.labeloffset)})}(n)}),e(" removeSelfEdges",function(){!function(n){f(n.edges(),function(e){if(e.v===e.w){var r=n.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:n.edge(e)}),n.removeEdge(e)}})}(n)}),e(" acyclic",function(){Mn(n)}),e(" nestingGraph.run",function(){ae(n)}),e(" rank",function(){ie(Ln(n))}),e(" injectEdgeLabelProxies",function(){!function(n){f(n.edges(),function(e){var r=n.edge(e);if(r.width&&r.height){var t=n.node(e.v),o={rank:(n.node(e.w).rank-t.rank)/2+t.rank,e:e};Tn(n,"edge-proxy",o,"_ep")}})}(n)}),e(" removeEmptyRanks",function(){!function(n){var e=fn(tn(n.nodes(),function(e){return n.node(e).rank})),r=[];f(n.nodes(),function(t){var o=n.node(t).rank-e;r[o]||(r[o]=[]),r[o].push(t)});var t=0,o=n.graph().nodeRankFactor;f(r,function(e,r){s(e)&&r%o!=0?--t:t&&f(e,function(e){n.node(e).rank+=t})})}(n)}),e(" nestingGraph.cleanup",function(){!function(n){var e=n.graph();n.removeNode(e.nestingRoot),delete e.nestingRoot,f(n.edges(),function(e){n.edge(e).nestingEdge&&n.removeEdge(e)})}(n)}),e(" normalizeRanks",function(){!function(n){var e=fn(tn(n.nodes(),function(e){return n.node(e).rank}));f(n.nodes(),function(r){var t=n.node(r);g(t,"rank")&&(t.rank-=e)})}(n)}),e(" assignRankMinMax",function(){!function(n){var e=0;f(n.nodes(),function(r){var t=n.node(r);t.borderTop&&(t.minRank=n.node(t.borderTop).rank,t.maxRank=n.node(t.borderBottom).rank,e=cn(e,t.maxRank))}),n.graph().maxRank=e}(n)}),e(" removeEdgeLabelProxies",function(){!function(n){f(n.nodes(),function(e){var r=n.node(e);"edge-proxy"===r.dummy&&(n.edge(r.e).labelRank=r.rank,n.removeNode(e))})}(n)}),e(" normalize.run",function(){!function(n){n.graph().dummyChains=[],f(n.edges(),function(e){!function(n,e){var r,t,o,i=e.v,u=n.node(i).rank,a=e.w,d=n.node(a).rank,c=e.name,f=n.edge(e),s=f.labelRank;if(d!==u+1){for(n.removeEdge(e),o=0,++u;u<d;++o,++u)f.points=[],r=Tn(n,"edge",t={width:0,height:0,edgeLabel:f,edgeObj:e,rank:u},"_d"),u===s&&(t.width=f.width,t.height=f.height,t.dummy="edge-label",t.labelpos=f.labelpos),n.setEdge(i,r,{weight:f.weight},c),0===o&&n.graph().dummyChains.push(r),i=r;n.setEdge(i,a,{weight:f.weight},c)}}(n,e)})}(n)}),e(" parentDummyChains",function(){!function(n){var e=function(n){var e={},r=0;return f(n.children(),function t(o){var i=r;f(n.children(o),t),e[o]={low:i,lim:r++}}),e}(n);f(n.graph().dummyChains,function(r){for(var t=n.node(r),o=t.edgeObj,i=function(n,e,r,t){var o,i,u=[],a=[],d=Math.min(e[r].low,e[t].low),c=Math.max(e[r].lim,e[t].lim);o=r;do{o=n.parent(o),u.push(o)}while(o&&(e[o].low>d||c>e[o].lim));for(i=o,o=t;(o=n.parent(o))!==i;)a.push(o);return{path:u.concat(a.reverse()),lca:i}}(n,e,o.v,o.w),u=i.path,a=i.lca,d=0,c=u[d],f=!0;r!==o.w;){if(t=n.node(r),f){for(;(c=u[d])!==a&&n.node(c).maxRank<t.rank;)d++;c===a&&(f=!1)}if(!f){for(;d<u.length-1&&n.node(c=u[d+1]).minRank<=t.rank;)d++;c=u[d]}n.setParent(r,c),r=n.successors(r)[0]}})}(n)}),e(" addBorderSegments",function(){!function(n){f(n.children(),function e(r){var t=n.children(r),o=n.node(r);if(t.length&&f(t,e),g(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,u=o.maxRank+1;i<u;++i)Fn(n,"borderLeft","_bl",r,o,i),Fn(n,"borderRight","_br",r,o,i)}})}(n)}),e(" order",function(){!function(n){var e=Sn(n),r=ve(n,mn(1,e+1),"inEdges"),t=ve(n,mn(e-1,-1,-1),"outEdges"),o=function(n){var e={},r=p(n.nodes(),function(e){return!n.children(e).length}),t=cn(tn(r,function(e){return n.node(e).rank})),o=tn(mn(t+1),function(){return[]}),i=bn(r,function(e){return n.node(e).rank});return f(i,function r(t){if(!g(e,t)){e[t]=!0;var i=n.node(t);o[i.rank].push(t),f(n.successors(t),r)}}),o}(n);pe(n,o);for(var i,u=Number.POSITIVE_INFINITY,a=0,d=0;d<4;++a,++d){le(a%2?r:t,a%4>=2);var c=ce(n,o=On(n));c<u&&(d=0,i=w(o,5),u=c)}pe(n,i)}(n)}),e(" insertSelfEdges",function(){!function(n){var e=On(n);f(e,function(e){var r=0;f(e,function(e,t){var o=n.node(e);o.order=t+r,f(o.selfEdges,function(e){Tn(n,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:t+ ++r,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}(n)}),e(" adjustCoordinateSystem",function(){!function(n){var e=n.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||Gn(n)}(n)}),e(" position",function(){!function(n){var e,r;(function(n){var e=On(n),r=n.graph().ranksep,t=0;f(e,function(e){var o=cn(tn(e,function(e){return n.node(e).height}));f(e,function(e){n.node(e).y=t+o/2}),t+=o+r})})(n=Ln(n)),r=function(e,r){n.node(r).x=e},(e=be(n))&&h(e,b(r))}(n)}),e(" positionSelfEdges",function(){!function(n){f(n.nodes(),function(e){var r=n.node(e);if("selfedge"===r.dummy){var t=n.node(r.e.v),o=t.x+t.width/2,i=t.y,u=r.x-o,a=t.height/2;n.setEdge(r.e,r.label),n.removeNode(e),r.label.points=[{x:o+2*u/3,y:i-a},{x:o+5*u/6,y:i-a},{x:o+u,y:i},{x:o+5*u/6,y:i+a},{x:o+2*u/3,y:i+a}],r.label.x=r.x,r.label.y=r.y}})}(n)}),e(" removeBorderNodes",function(){!function(n){f(n.nodes(),function(e){if(n.children(e).length){var r=n.node(e),t=n.node(r.borderTop),o=n.node(r.borderBottom),i=n.node(X(r.borderLeft)),u=n.node(X(r.borderRight));r.width=Math.abs(u.x-i.x),r.height=Math.abs(o.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),f(n.nodes(),function(e){"border"===n.node(e).dummy&&n.removeNode(e)})}(n)}),e(" normalize.undo",function(){!function(n){f(n.graph().dummyChains,function(e){var r,t=n.node(e),o=t.edgeLabel;for(n.setEdge(t.edgeObj,o);t.dummy;)r=n.successors(e)[0],n.removeNode(e),o.points.push({x:t.x,y:t.y}),"edge-label"===t.dummy&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),e=r,t=n.node(e)})}(n)}),e(" fixupEdgeLabelCoords",function(){!function(n){f(n.edges(),function(e){var r=n.edge(e);if(g(r,"x"))switch("l"!==r.labelpos&&"r"!==r.labelpos||(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}(n)}),e(" undoCoordinateSystem",function(){!function(n){var e=n.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(n){f(n.nodes(),function(e){qn(n.node(e))}),f(n.edges(),function(e){var r=n.edge(e);f(r.points,qn),g(r,"y")&&qn(r)})}(n),"lr"!==e&&"rl"!==e||(function(n){f(n.nodes(),function(e){Yn(n.node(e))}),f(n.edges(),function(e){var r=n.edge(e);f(r.points,Yn),g(r,"x")&&Yn(r)})}(n),Gn(n))}(n)}),e(" translateGraph",function(){!function(n){var e=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,o=0,i=n.graph(),u=i.marginx||0,a=i.marginy||0;function d(n){var i=n.x,u=n.y,a=n.width,d=n.height;e=Math.min(e,i-a/2),r=Math.max(r,i+a/2),t=Math.min(t,u-d/2),o=Math.max(o,u+d/2)}f(n.nodes(),function(e){d(n.node(e))}),f(n.edges(),function(e){var r=n.edge(e);g(r,"x")&&d(r)}),e-=u,t-=a,f(n.nodes(),function(r){var o=n.node(r);o.x-=e,o.y-=t}),f(n.edges(),function(r){var o=n.edge(r);f(o.points,function(n){n.x-=e,n.y-=t}),g(o,"x")&&(o.x-=e),g(o,"y")&&(o.y-=t)}),i.width=r-e+u,i.height=o-t+a}(n)}),e(" assignNodeIntersects",function(){!function(n){f(n.edges(),function(e){var r,t,o=n.edge(e),i=n.node(e.v),u=n.node(e.w);o.points?(r=o.points[0],t=o.points[o.points.length-1]):(o.points=[],r=u,t=i),o.points.unshift(Cn(i,r)),o.points.push(Cn(u,t))})}(n)}),e(" reversePoints",function(){!function(n){f(n.edges(),function(e){var r=n.edge(e);r.reversed&&r.points.reverse()})}(n)}),e(" acyclic.undo",function(){!function(n){f(n.edges(),function(e){var r=n.edge(e);if(r.reversed){n.removeEdge(e);var t=r.forwardName;delete r.reversed,delete r.forwardName,n.setEdge(e.w,e.v,r,t)}})}(n)})}(e,r)}),r(" updateInputGraph",function(){!function(n,e){f(n.nodes(),function(r){var t=n.node(r),o=e.node(r);t&&(t.x=o.x,t.y=o.y,e.children(r).length&&(t.width=o.width,t.height=o.height))}),f(n.edges(),function(r){var t=n.edge(r),o=e.edge(r);t.points=o.points,g(o,"x")&&(t.x=o.x,t.y=o.y)}),n.graph().width=e.graph().width,n.graph().height=e.graph().height}(n,e)})})}var xe=["nodesep","edgesep","ranksep","marginx","marginy"],ke={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Ee=["acyclicer","ranker","rankdir","align"],Ne=["width","height"],_e={width:0,height:0},Ie=["minlen","weight","width","height","labeloffset"],Re={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Me=["labelpos"];function Te(n,e){return an(ln(n,e),Number)}function Le(n){var e={};return f(n,function(n,r){e[r.toLowerCase()]=n}),e}export{ye as V,tn as u};
|