@wanji_dsh/dsh-sales 0.10.6 → 0.11.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/README.zh.md +3 -1
- package/dist/client.js +351 -163
- package/dist/host.js +903 -602
- package/dist/types/company/host.d.ts +37 -0
- package/dist/types/company/identity.d.ts +23 -0
- package/dist/types/company/remote.d.ts +36 -0
- package/dist/types/generation-runtime.d.ts +9 -1
- package/dist/types/wechat/native.d.ts +3 -0
- package/dist/types/wechat/receiver.d.ts +5 -4
- package/dist/types/wechat/types.d.ts +1 -0
- package/docs/wechat-native-implementation.md +1 -1
- package/docs/wechat-sync.md +1 -1
- package/package.json +1 -1
- package/runtime/wechat-manifest.json +11 -11
package/dist/client.js
CHANGED
|
@@ -158,7 +158,7 @@ var import_react3 = __toESM(require("react"), 1);
|
|
|
158
158
|
// src/reply-content.tsx
|
|
159
159
|
var import_react2 = __toESM(require("react"), 1);
|
|
160
160
|
|
|
161
|
-
//
|
|
161
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/mdast-util-to-string/lib/index.js
|
|
162
162
|
var emptyOptions = {};
|
|
163
163
|
function toString(value, options) {
|
|
164
164
|
const settings = options || emptyOptions;
|
|
@@ -195,7 +195,7 @@ function node(value) {
|
|
|
195
195
|
return Boolean(value && typeof value === "object");
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
//
|
|
198
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/decode-named-character-reference/index.dom.js
|
|
199
199
|
var element = document.createElement("i");
|
|
200
200
|
function decodeNamedCharacterReference(value) {
|
|
201
201
|
const characterReference2 = "&" + value + ";";
|
|
@@ -207,7 +207,7 @@ function decodeNamedCharacterReference(value) {
|
|
|
207
207
|
return character === characterReference2 ? false : character;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
//
|
|
210
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-chunked/index.js
|
|
211
211
|
function splice(list2, start, remove, items) {
|
|
212
212
|
const end = list2.length;
|
|
213
213
|
let chunkStart = 0;
|
|
@@ -241,7 +241,7 @@ function push(list2, items) {
|
|
|
241
241
|
return items;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
//
|
|
244
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-combine-extensions/index.js
|
|
245
245
|
var hasOwnProperty = {}.hasOwnProperty;
|
|
246
246
|
function combineExtensions(extensions) {
|
|
247
247
|
const all2 = {};
|
|
@@ -281,7 +281,7 @@ function constructs(existing, list2) {
|
|
|
281
281
|
splice(existing, 0, 0, before);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
//
|
|
284
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-decode-numeric-character-reference/index.js
|
|
285
285
|
function decodeNumericCharacterReference(value, base) {
|
|
286
286
|
const code2 = Number.parseInt(value, base);
|
|
287
287
|
if (
|
|
@@ -299,12 +299,12 @@ function decodeNumericCharacterReference(value, base) {
|
|
|
299
299
|
return String.fromCodePoint(code2);
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
//
|
|
302
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-normalize-identifier/index.js
|
|
303
303
|
function normalizeIdentifier(value) {
|
|
304
304
|
return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
//
|
|
307
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-character/index.js
|
|
308
308
|
var asciiAlpha = regexCheck(/[A-Za-z]/);
|
|
309
309
|
var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
|
|
310
310
|
var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
|
|
@@ -336,7 +336,7 @@ function regexCheck(regex) {
|
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
//
|
|
339
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-factory-space/index.js
|
|
340
340
|
function factorySpace(effects, ok3, type, max) {
|
|
341
341
|
const limit = max ? max - 1 : Infinity;
|
|
342
342
|
let size = 0;
|
|
@@ -381,7 +381,7 @@ function factorySpaceMinMax(effects, ok3, nok, type, min, max) {
|
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
|
|
384
|
-
//
|
|
384
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark/lib/initialize/content.js
|
|
385
385
|
var content = {
|
|
386
386
|
tokenize: initializeContent
|
|
387
387
|
};
|
|
@@ -431,7 +431,7 @@ function initializeContent(effects) {
|
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
//
|
|
434
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-edit-map/index.js
|
|
435
435
|
var EditMap = class {
|
|
436
436
|
/**
|
|
437
437
|
* Create a new edit map.
|
|
@@ -529,7 +529,7 @@ function addImplementation(editMap, at, remove, add, before) {
|
|
|
529
529
|
editMap.index.set(at, change);
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
-
//
|
|
532
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark/lib/initialize/document.js
|
|
533
533
|
var document2 = {
|
|
534
534
|
tokenize: initializeDocument
|
|
535
535
|
};
|
|
@@ -723,7 +723,7 @@ function tokenizeContainer(effects, ok3, nok) {
|
|
|
723
723
|
return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok3, nok), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
|
|
724
724
|
}
|
|
725
725
|
|
|
726
|
-
//
|
|
726
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-classify-character/index.js
|
|
727
727
|
function classifyCharacter(code2) {
|
|
728
728
|
if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
|
|
729
729
|
return 1;
|
|
@@ -733,7 +733,7 @@ function classifyCharacter(code2) {
|
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
735
|
|
|
736
|
-
//
|
|
736
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-resolve-all/index.js
|
|
737
737
|
function resolveAll(constructs2, events, context) {
|
|
738
738
|
const called = [];
|
|
739
739
|
let index2 = -1;
|
|
@@ -747,7 +747,7 @@ function resolveAll(constructs2, events, context) {
|
|
|
747
747
|
return events;
|
|
748
748
|
}
|
|
749
749
|
|
|
750
|
-
//
|
|
750
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/attention.js
|
|
751
751
|
var attention = {
|
|
752
752
|
name: "attention",
|
|
753
753
|
resolveAll: resolveAllAttention,
|
|
@@ -870,7 +870,7 @@ function movePoint(point3, offset) {
|
|
|
870
870
|
point3._bufferIndex += offset;
|
|
871
871
|
}
|
|
872
872
|
|
|
873
|
-
//
|
|
873
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/autolink.js
|
|
874
874
|
var autolink = {
|
|
875
875
|
name: "autolink",
|
|
876
876
|
tokenize: tokenizeAutolink
|
|
@@ -971,7 +971,7 @@ function tokenizeAutolink(effects, ok3, nok) {
|
|
|
971
971
|
}
|
|
972
972
|
}
|
|
973
973
|
|
|
974
|
-
//
|
|
974
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/blank-line.js
|
|
975
975
|
var blankLine = {
|
|
976
976
|
partial: true,
|
|
977
977
|
tokenize: tokenizeBlankLine
|
|
@@ -986,7 +986,7 @@ function tokenizeBlankLine(effects, ok3, nok) {
|
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
|
|
989
|
-
//
|
|
989
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/block-quote.js
|
|
990
990
|
var blockQuote = {
|
|
991
991
|
continuation: {
|
|
992
992
|
tokenize: tokenizeBlockQuoteContinuation
|
|
@@ -1044,7 +1044,7 @@ function exit(effects) {
|
|
|
1044
1044
|
effects.exit("blockQuote");
|
|
1045
1045
|
}
|
|
1046
1046
|
|
|
1047
|
-
//
|
|
1047
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/character-escape.js
|
|
1048
1048
|
var characterEscape = {
|
|
1049
1049
|
name: "characterEscape",
|
|
1050
1050
|
tokenize: tokenizeCharacterEscape
|
|
@@ -1070,7 +1070,7 @@ function tokenizeCharacterEscape(effects, ok3, nok) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
1073
|
-
//
|
|
1073
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/character-reference.js
|
|
1074
1074
|
var characterReference = {
|
|
1075
1075
|
name: "characterReference",
|
|
1076
1076
|
tokenize: tokenizeCharacterReference
|
|
@@ -1135,7 +1135,7 @@ function tokenizeCharacterReference(effects, ok3, nok) {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
}
|
|
1137
1137
|
|
|
1138
|
-
//
|
|
1138
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js
|
|
1139
1139
|
var nonLazyContinuation = {
|
|
1140
1140
|
partial: true,
|
|
1141
1141
|
tokenize: tokenizeNonLazyContinuation
|
|
@@ -1157,7 +1157,7 @@ function tokenizeNonLazyContinuation(effects, ok3, nok) {
|
|
|
1157
1157
|
}
|
|
1158
1158
|
}
|
|
1159
1159
|
|
|
1160
|
-
//
|
|
1160
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/code-fenced.js
|
|
1161
1161
|
var codeFenced = {
|
|
1162
1162
|
concrete: true,
|
|
1163
1163
|
name: "codeFenced",
|
|
@@ -1320,7 +1320,7 @@ function tokenizeCodeFenced(effects, ok3, nok) {
|
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
|
|
1323
|
-
//
|
|
1323
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/code-indented.js
|
|
1324
1324
|
var codeIndented = {
|
|
1325
1325
|
name: "codeIndented",
|
|
1326
1326
|
tokenize: tokenizeCodeIndented
|
|
@@ -1378,7 +1378,7 @@ function tokenizeFurtherStart(effects, ok3, nok) {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
1381
|
-
//
|
|
1381
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/code-text.js
|
|
1382
1382
|
var codeText = {
|
|
1383
1383
|
name: "codeText",
|
|
1384
1384
|
previous,
|
|
@@ -1493,7 +1493,7 @@ function tokenizeCodeText(effects, ok3, nok) {
|
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
|
|
1496
|
-
//
|
|
1496
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-subtokenize/lib/splice-buffer.js
|
|
1497
1497
|
var SpliceBuffer = class {
|
|
1498
1498
|
/**
|
|
1499
1499
|
* @param {ReadonlyArray<T> | null | undefined} [initial]
|
|
@@ -1686,7 +1686,7 @@ function chunkedPush(list2, right) {
|
|
|
1686
1686
|
}
|
|
1687
1687
|
}
|
|
1688
1688
|
|
|
1689
|
-
//
|
|
1689
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-subtokenize/index.js
|
|
1690
1690
|
function subtokenize(eventsArray) {
|
|
1691
1691
|
const jumps = {};
|
|
1692
1692
|
let index2 = -1;
|
|
@@ -1839,7 +1839,7 @@ function subcontent(events, eventIndex) {
|
|
|
1839
1839
|
return gaps;
|
|
1840
1840
|
}
|
|
1841
1841
|
|
|
1842
|
-
//
|
|
1842
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/content.js
|
|
1843
1843
|
var content2 = {
|
|
1844
1844
|
resolve: resolveContent,
|
|
1845
1845
|
tokenize: tokenizeContent
|
|
@@ -1910,7 +1910,7 @@ function tokenizeContinuation(effects, ok3, nok) {
|
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
1912
|
|
|
1913
|
-
//
|
|
1913
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-factory-destination/index.js
|
|
1914
1914
|
function factoryDestination(effects, ok3, nok, type, literalType, literalMarkerType, rawType, stringType, max) {
|
|
1915
1915
|
const limit = max || Number.POSITIVE_INFINITY;
|
|
1916
1916
|
let balance = 0;
|
|
@@ -2002,7 +2002,7 @@ function factoryDestination(effects, ok3, nok, type, literalType, literalMarkerT
|
|
|
2002
2002
|
}
|
|
2003
2003
|
}
|
|
2004
2004
|
|
|
2005
|
-
//
|
|
2005
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-factory-label/index.js
|
|
2006
2006
|
function factoryLabel(effects, ok3, nok, type, markerType, stringType) {
|
|
2007
2007
|
const self = this;
|
|
2008
2008
|
let size = 0;
|
|
@@ -2063,7 +2063,7 @@ function factoryLabel(effects, ok3, nok, type, markerType, stringType) {
|
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
2065
|
|
|
2066
|
-
//
|
|
2066
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-factory-title/index.js
|
|
2067
2067
|
function factoryTitle(effects, ok3, nok, type, markerType, stringType) {
|
|
2068
2068
|
let marker;
|
|
2069
2069
|
return start;
|
|
@@ -2125,7 +2125,7 @@ function factoryTitle(effects, ok3, nok, type, markerType, stringType) {
|
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
2127
|
|
|
2128
|
-
//
|
|
2128
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-factory-whitespace/index.js
|
|
2129
2129
|
function factoryWhitespace(effects, ok3) {
|
|
2130
2130
|
let seen;
|
|
2131
2131
|
return start;
|
|
@@ -2144,7 +2144,7 @@ function factoryWhitespace(effects, ok3) {
|
|
|
2144
2144
|
}
|
|
2145
2145
|
}
|
|
2146
2146
|
|
|
2147
|
-
//
|
|
2147
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/definition.js
|
|
2148
2148
|
var definition = {
|
|
2149
2149
|
name: "definition",
|
|
2150
2150
|
tokenize: tokenizeDefinition
|
|
@@ -2230,7 +2230,7 @@ function tokenizeTitleBefore(effects, ok3, nok) {
|
|
|
2230
2230
|
}
|
|
2231
2231
|
}
|
|
2232
2232
|
|
|
2233
|
-
//
|
|
2233
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/hard-break-escape.js
|
|
2234
2234
|
var hardBreakEscape = {
|
|
2235
2235
|
name: "hardBreakEscape",
|
|
2236
2236
|
tokenize: tokenizeHardBreakEscape
|
|
@@ -2251,7 +2251,7 @@ function tokenizeHardBreakEscape(effects, ok3, nok) {
|
|
|
2251
2251
|
}
|
|
2252
2252
|
}
|
|
2253
2253
|
|
|
2254
|
-
//
|
|
2254
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/heading-atx.js
|
|
2255
2255
|
var headingAtx = {
|
|
2256
2256
|
name: "headingAtx",
|
|
2257
2257
|
resolve: resolveHeadingAtx,
|
|
@@ -2340,7 +2340,7 @@ function tokenizeHeadingAtx(effects, ok3, nok) {
|
|
|
2340
2340
|
}
|
|
2341
2341
|
}
|
|
2342
2342
|
|
|
2343
|
-
//
|
|
2343
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-html-tag-name/index.js
|
|
2344
2344
|
var htmlBlockNames = [
|
|
2345
2345
|
"address",
|
|
2346
2346
|
"article",
|
|
@@ -2407,7 +2407,7 @@ var htmlBlockNames = [
|
|
|
2407
2407
|
];
|
|
2408
2408
|
var htmlRawNames = ["pre", "script", "style", "textarea"];
|
|
2409
2409
|
|
|
2410
|
-
//
|
|
2410
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/html-flow.js
|
|
2411
2411
|
var htmlFlow = {
|
|
2412
2412
|
concrete: true,
|
|
2413
2413
|
name: "htmlFlow",
|
|
@@ -2766,7 +2766,7 @@ function tokenizeBlankLineBefore(effects, ok3, nok) {
|
|
|
2766
2766
|
}
|
|
2767
2767
|
}
|
|
2768
2768
|
|
|
2769
|
-
//
|
|
2769
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/html-text.js
|
|
2770
2770
|
var htmlText = {
|
|
2771
2771
|
name: "htmlText",
|
|
2772
2772
|
tokenize: tokenizeHtmlText
|
|
@@ -3072,7 +3072,7 @@ function tokenizeHtmlText(effects, ok3, nok) {
|
|
|
3072
3072
|
}
|
|
3073
3073
|
}
|
|
3074
3074
|
|
|
3075
|
-
//
|
|
3075
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/label-end.js
|
|
3076
3076
|
var labelEnd = {
|
|
3077
3077
|
name: "labelEnd",
|
|
3078
3078
|
resolveAll: resolveAllLabelEnd,
|
|
@@ -3298,7 +3298,7 @@ function tokenizeReferenceCollapsed(effects, ok3, nok) {
|
|
|
3298
3298
|
}
|
|
3299
3299
|
}
|
|
3300
3300
|
|
|
3301
|
-
//
|
|
3301
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/label-start-image.js
|
|
3302
3302
|
var labelStartImage = {
|
|
3303
3303
|
name: "labelStartImage",
|
|
3304
3304
|
resolveAll: labelEnd.resolveAll,
|
|
@@ -3335,7 +3335,7 @@ function tokenizeLabelStartImage(effects, ok3, nok) {
|
|
|
3335
3335
|
}
|
|
3336
3336
|
}
|
|
3337
3337
|
|
|
3338
|
-
//
|
|
3338
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/label-start-link.js
|
|
3339
3339
|
var labelStartLink = {
|
|
3340
3340
|
name: "labelStartLink",
|
|
3341
3341
|
resolveAll: labelEnd.resolveAll,
|
|
@@ -3363,7 +3363,7 @@ function tokenizeLabelStartLink(effects, ok3, nok) {
|
|
|
3363
3363
|
}
|
|
3364
3364
|
}
|
|
3365
3365
|
|
|
3366
|
-
//
|
|
3366
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/line-ending.js
|
|
3367
3367
|
var lineEnding = {
|
|
3368
3368
|
name: "lineEnding",
|
|
3369
3369
|
tokenize: tokenizeLineEnding
|
|
@@ -3378,7 +3378,7 @@ function tokenizeLineEnding(effects, ok3) {
|
|
|
3378
3378
|
}
|
|
3379
3379
|
}
|
|
3380
3380
|
|
|
3381
|
-
//
|
|
3381
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/thematic-break.js
|
|
3382
3382
|
var thematicBreak = {
|
|
3383
3383
|
name: "thematicBreak",
|
|
3384
3384
|
tokenize: tokenizeThematicBreak
|
|
@@ -3417,7 +3417,7 @@ function tokenizeThematicBreak(effects, ok3, nok) {
|
|
|
3417
3417
|
}
|
|
3418
3418
|
}
|
|
3419
3419
|
|
|
3420
|
-
//
|
|
3420
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/list.js
|
|
3421
3421
|
var list = {
|
|
3422
3422
|
continuation: {
|
|
3423
3423
|
tokenize: tokenizeListContinuation
|
|
@@ -3547,7 +3547,7 @@ function tokenizeListItemPrefixWhitespace(effects, ok3, nok) {
|
|
|
3547
3547
|
}
|
|
3548
3548
|
}
|
|
3549
3549
|
|
|
3550
|
-
//
|
|
3550
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-core-commonmark/lib/setext-underline.js
|
|
3551
3551
|
var setextUnderline = {
|
|
3552
3552
|
name: "setextUnderline",
|
|
3553
3553
|
resolveTo: resolveToSetextUnderline,
|
|
@@ -3641,7 +3641,7 @@ function tokenizeSetextUnderline(effects, ok3, nok) {
|
|
|
3641
3641
|
}
|
|
3642
3642
|
}
|
|
3643
3643
|
|
|
3644
|
-
//
|
|
3644
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark/lib/initialize/flow.js
|
|
3645
3645
|
var flow = {
|
|
3646
3646
|
tokenize: initializeFlow
|
|
3647
3647
|
};
|
|
@@ -3679,7 +3679,7 @@ function initializeFlow(effects) {
|
|
|
3679
3679
|
}
|
|
3680
3680
|
}
|
|
3681
3681
|
|
|
3682
|
-
//
|
|
3682
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark/lib/initialize/text.js
|
|
3683
3683
|
var resolver = {
|
|
3684
3684
|
resolveAll: createResolver()
|
|
3685
3685
|
};
|
|
@@ -3821,7 +3821,7 @@ function resolveAllLineSuffixes(events, context) {
|
|
|
3821
3821
|
return events;
|
|
3822
3822
|
}
|
|
3823
3823
|
|
|
3824
|
-
//
|
|
3824
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark/lib/constructs.js
|
|
3825
3825
|
var constructs_exports = {};
|
|
3826
3826
|
__export(constructs_exports, {
|
|
3827
3827
|
attentionMarkers: () => attentionMarkers,
|
|
@@ -3896,7 +3896,7 @@ var disable = {
|
|
|
3896
3896
|
null: []
|
|
3897
3897
|
};
|
|
3898
3898
|
|
|
3899
|
-
//
|
|
3899
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark/lib/create-tokenizer.js
|
|
3900
3900
|
function createTokenizer(parser, initialize, from) {
|
|
3901
3901
|
let point3 = {
|
|
3902
3902
|
_bufferIndex: -1,
|
|
@@ -4222,7 +4222,7 @@ function serializeChunks(chunks, expandTabs) {
|
|
|
4222
4222
|
return result.join("");
|
|
4223
4223
|
}
|
|
4224
4224
|
|
|
4225
|
-
//
|
|
4225
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark/lib/parse.js
|
|
4226
4226
|
function parse(options) {
|
|
4227
4227
|
const settings = options || {};
|
|
4228
4228
|
const constructs2 = (
|
|
@@ -4248,14 +4248,14 @@ function parse(options) {
|
|
|
4248
4248
|
}
|
|
4249
4249
|
}
|
|
4250
4250
|
|
|
4251
|
-
//
|
|
4251
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark/lib/postprocess.js
|
|
4252
4252
|
function postprocess(events) {
|
|
4253
4253
|
while (!subtokenize(events)) {
|
|
4254
4254
|
}
|
|
4255
4255
|
return events;
|
|
4256
4256
|
}
|
|
4257
4257
|
|
|
4258
|
-
//
|
|
4258
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark/lib/preprocess.js
|
|
4259
4259
|
var search = /[\0\t\n\r]/g;
|
|
4260
4260
|
function preprocess() {
|
|
4261
4261
|
let column = 1;
|
|
@@ -4335,7 +4335,7 @@ function preprocess() {
|
|
|
4335
4335
|
}
|
|
4336
4336
|
}
|
|
4337
4337
|
|
|
4338
|
-
//
|
|
4338
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-util-decode-string/index.js
|
|
4339
4339
|
var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
|
|
4340
4340
|
function decodeString(value) {
|
|
4341
4341
|
return value.replace(characterEscapeOrReference, decode);
|
|
@@ -4353,7 +4353,7 @@ function decode($0, $1, $2) {
|
|
|
4353
4353
|
return decodeNamedCharacterReference($2) || $0;
|
|
4354
4354
|
}
|
|
4355
4355
|
|
|
4356
|
-
//
|
|
4356
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/unist-util-stringify-position/lib/index.js
|
|
4357
4357
|
function stringifyPosition(value) {
|
|
4358
4358
|
if (!value || typeof value !== "object") {
|
|
4359
4359
|
return "";
|
|
@@ -4379,7 +4379,7 @@ function index(value) {
|
|
|
4379
4379
|
return value && typeof value === "number" ? value : 1;
|
|
4380
4380
|
}
|
|
4381
4381
|
|
|
4382
|
-
//
|
|
4382
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/mdast-util-from-markdown/lib/index.js
|
|
4383
4383
|
var own = {}.hasOwnProperty;
|
|
4384
4384
|
function fromMarkdown(value, encoding, options) {
|
|
4385
4385
|
if (encoding && typeof encoding === "object") {
|
|
@@ -5088,7 +5088,7 @@ function defaultOnError(left, right) {
|
|
|
5088
5088
|
}
|
|
5089
5089
|
}
|
|
5090
5090
|
|
|
5091
|
-
//
|
|
5091
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/ccount/index.js
|
|
5092
5092
|
function ccount(value, character) {
|
|
5093
5093
|
const source = String(value);
|
|
5094
5094
|
if (typeof character !== "string") {
|
|
@@ -5103,11 +5103,11 @@ function ccount(value, character) {
|
|
|
5103
5103
|
return count;
|
|
5104
5104
|
}
|
|
5105
5105
|
|
|
5106
|
-
//
|
|
5106
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/devlop/lib/default.js
|
|
5107
5107
|
function ok() {
|
|
5108
5108
|
}
|
|
5109
5109
|
|
|
5110
|
-
//
|
|
5110
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/escape-string-regexp/index.js
|
|
5111
5111
|
function escapeStringRegexp(string5) {
|
|
5112
5112
|
if (typeof string5 !== "string") {
|
|
5113
5113
|
throw new TypeError("Expected a string");
|
|
@@ -5115,7 +5115,7 @@ function escapeStringRegexp(string5) {
|
|
|
5115
5115
|
return string5.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
5116
5116
|
}
|
|
5117
5117
|
|
|
5118
|
-
//
|
|
5118
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/unist-util-is/lib/index.js
|
|
5119
5119
|
var convert = (
|
|
5120
5120
|
// Note: overloads in JSDoc can’t yet use different `@template`s.
|
|
5121
5121
|
/**
|
|
@@ -5214,12 +5214,12 @@ function looksLikeANode(value) {
|
|
|
5214
5214
|
return value !== null && typeof value === "object" && "type" in value;
|
|
5215
5215
|
}
|
|
5216
5216
|
|
|
5217
|
-
//
|
|
5217
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/unist-util-visit-parents/lib/color.js
|
|
5218
5218
|
function color(d) {
|
|
5219
5219
|
return d;
|
|
5220
5220
|
}
|
|
5221
5221
|
|
|
5222
|
-
//
|
|
5222
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/unist-util-visit-parents/lib/index.js
|
|
5223
5223
|
var empty = [];
|
|
5224
5224
|
var CONTINUE = true;
|
|
5225
5225
|
var EXIT = false;
|
|
@@ -5339,7 +5339,7 @@ function toResult(value) {
|
|
|
5339
5339
|
return value === null || value === void 0 ? empty : [value];
|
|
5340
5340
|
}
|
|
5341
5341
|
|
|
5342
|
-
//
|
|
5342
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/mdast-util-find-and-replace/lib/index.js
|
|
5343
5343
|
function findAndReplace(tree, list2, options) {
|
|
5344
5344
|
const settings = options || {};
|
|
5345
5345
|
const ignored = convert(settings.ignore || []);
|
|
@@ -5440,7 +5440,7 @@ function toFunction(replace2) {
|
|
|
5440
5440
|
};
|
|
5441
5441
|
}
|
|
5442
5442
|
|
|
5443
|
-
//
|
|
5443
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/mdast-util-gfm-autolink-literal/lib/index.js
|
|
5444
5444
|
function gfmAutolinkLiteralFromMarkdown() {
|
|
5445
5445
|
return {
|
|
5446
5446
|
transforms: [transformGfmAutolinkLiterals],
|
|
@@ -5605,7 +5605,7 @@ function previous2(match) {
|
|
|
5605
5605
|
return match.index === 0 || unicodeWhitespace(code2) || unicodePunctuation(code2);
|
|
5606
5606
|
}
|
|
5607
5607
|
|
|
5608
|
-
//
|
|
5608
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/mdast-util-gfm-footnote/lib/index.js
|
|
5609
5609
|
footnoteReference.peek = footnoteReferencePeek;
|
|
5610
5610
|
function enterFootnoteCallString() {
|
|
5611
5611
|
this.buffer();
|
|
@@ -5679,7 +5679,7 @@ function gfmFootnoteFromMarkdown() {
|
|
|
5679
5679
|
};
|
|
5680
5680
|
}
|
|
5681
5681
|
|
|
5682
|
-
//
|
|
5682
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/mdast-util-gfm-strikethrough/lib/index.js
|
|
5683
5683
|
handleDelete.attention = attentionDelete;
|
|
5684
5684
|
handleDelete.peek = peekDelete;
|
|
5685
5685
|
function gfmStrikethroughFromMarkdown() {
|
|
@@ -5716,7 +5716,7 @@ function peekDelete() {
|
|
|
5716
5716
|
return "~";
|
|
5717
5717
|
}
|
|
5718
5718
|
|
|
5719
|
-
//
|
|
5719
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/mdast-util-gfm-table/lib/index.js
|
|
5720
5720
|
function gfmTableFromMarkdown() {
|
|
5721
5721
|
return {
|
|
5722
5722
|
enter: {
|
|
@@ -5777,7 +5777,7 @@ function replace($0, $1) {
|
|
|
5777
5777
|
return $1 === "|" ? $1 : $0;
|
|
5778
5778
|
}
|
|
5779
5779
|
|
|
5780
|
-
//
|
|
5780
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/mdast-util-gfm-task-list-item/lib/index.js
|
|
5781
5781
|
function gfmTaskListItemFromMarkdown() {
|
|
5782
5782
|
return {
|
|
5783
5783
|
exit: {
|
|
@@ -5824,7 +5824,7 @@ function exitParagraphWithTaskListItem(token) {
|
|
|
5824
5824
|
this.exit(token);
|
|
5825
5825
|
}
|
|
5826
5826
|
|
|
5827
|
-
//
|
|
5827
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/mdast-util-gfm/lib/index.js
|
|
5828
5828
|
function gfmFromMarkdown() {
|
|
5829
5829
|
return [
|
|
5830
5830
|
gfmAutolinkLiteralFromMarkdown(),
|
|
@@ -5835,7 +5835,7 @@ function gfmFromMarkdown() {
|
|
|
5835
5835
|
];
|
|
5836
5836
|
}
|
|
5837
5837
|
|
|
5838
|
-
//
|
|
5838
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js
|
|
5839
5839
|
var wwwPrefix = {
|
|
5840
5840
|
tokenize: tokenizeWwwPrefix,
|
|
5841
5841
|
partial: true
|
|
@@ -6177,7 +6177,7 @@ function previousUnbalanced(events) {
|
|
|
6177
6177
|
return result;
|
|
6178
6178
|
}
|
|
6179
6179
|
|
|
6180
|
-
//
|
|
6180
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-extension-gfm-footnote/lib/syntax.js
|
|
6181
6181
|
var indent = {
|
|
6182
6182
|
tokenize: tokenizeIndent2,
|
|
6183
6183
|
partial: true
|
|
@@ -6452,7 +6452,7 @@ function tokenizeIndent2(effects, ok3, nok) {
|
|
|
6452
6452
|
}
|
|
6453
6453
|
}
|
|
6454
6454
|
|
|
6455
|
-
//
|
|
6455
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
|
|
6456
6456
|
function gfmStrikethrough(options) {
|
|
6457
6457
|
const options_ = options || {};
|
|
6458
6458
|
let single = options_.singleTilde;
|
|
@@ -6546,7 +6546,7 @@ function gfmStrikethrough(options) {
|
|
|
6546
6546
|
}
|
|
6547
6547
|
}
|
|
6548
6548
|
|
|
6549
|
-
//
|
|
6549
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-extension-gfm-table/lib/edit-map.js
|
|
6550
6550
|
var EditMap2 = class {
|
|
6551
6551
|
/**
|
|
6552
6552
|
* Create a new edit map.
|
|
@@ -6632,7 +6632,7 @@ function addImplementation2(editMap, at, remove, add) {
|
|
|
6632
6632
|
editMap.index.set(at, change);
|
|
6633
6633
|
}
|
|
6634
6634
|
|
|
6635
|
-
//
|
|
6635
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-extension-gfm-table/lib/infer.js
|
|
6636
6636
|
function gfmTableAlign(events, index2) {
|
|
6637
6637
|
let inDelimiterRow = false;
|
|
6638
6638
|
const align = [];
|
|
@@ -6659,7 +6659,7 @@ function gfmTableAlign(events, index2) {
|
|
|
6659
6659
|
return align;
|
|
6660
6660
|
}
|
|
6661
6661
|
|
|
6662
|
-
//
|
|
6662
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-extension-gfm-table/lib/syntax.js
|
|
6663
6663
|
function gfmTable() {
|
|
6664
6664
|
return {
|
|
6665
6665
|
flow: {
|
|
@@ -7050,7 +7050,7 @@ function getPoint(events, index2) {
|
|
|
7050
7050
|
return event[1][side];
|
|
7051
7051
|
}
|
|
7052
7052
|
|
|
7053
|
-
//
|
|
7053
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js
|
|
7054
7054
|
var tasklistCheck = {
|
|
7055
7055
|
name: "tasklistCheck",
|
|
7056
7056
|
tokenize: tokenizeTasklistCheck
|
|
@@ -7124,7 +7124,7 @@ function spaceThenNonSpace(effects, ok3, nok) {
|
|
|
7124
7124
|
}
|
|
7125
7125
|
}
|
|
7126
7126
|
|
|
7127
|
-
//
|
|
7127
|
+
// ../../../../../../Users/imac/Code/万机/wanji_dazi_dsh/node_modules/micromark-extension-gfm/index.js
|
|
7128
7128
|
function gfm(options) {
|
|
7129
7129
|
return combineExtensions([
|
|
7130
7130
|
gfmAutolinkLiteral(),
|
|
@@ -7424,9 +7424,130 @@ var updateStyles = `
|
|
|
7424
7424
|
.ws-update-trigger .ws-company-update-dot,.ws-company-update-version{color:#237c3d;color:light-dark(#237c3d,#76d68c)}.ws-update-trigger .ws-company-update-dot{width:7px;height:7px;opacity:1}.ws-company-update-hint{margin-top:14px;border-top:1px solid var(--ws-line);padding-top:12px;font-size:12px;line-height:1.6;color:var(--ws-muted)}.ws-company-update-hint p+p{margin-top:3px}
|
|
7425
7425
|
`;
|
|
7426
7426
|
|
|
7427
|
-
// src/
|
|
7427
|
+
// src/company/panel.tsx
|
|
7428
7428
|
var import_react5 = __toESM(require("react"), 1);
|
|
7429
7429
|
|
|
7430
|
+
// src/company/identity.ts
|
|
7431
|
+
var COMPANY_IDENTITY_ENDPOINT = "wanji-sales-company/identity";
|
|
7432
|
+
|
|
7433
|
+
// src/company/panel.tsx
|
|
7434
|
+
function CompanyIdentityPanel({ rpc, t, disabled }) {
|
|
7435
|
+
const id = (0, import_react5.useId)();
|
|
7436
|
+
const trigger = (0, import_react5.useRef)(null);
|
|
7437
|
+
const request = (0, import_react5.useRef)(void 0);
|
|
7438
|
+
const [open, setOpen] = (0, import_react5.useState)(false);
|
|
7439
|
+
const [view, setView] = (0, import_react5.useState)();
|
|
7440
|
+
const [busy, setBusy] = (0, import_react5.useState)(false);
|
|
7441
|
+
const [failed, setFailed] = (0, import_react5.useState)(false);
|
|
7442
|
+
const [alias, setAlias] = (0, import_react5.useState)("");
|
|
7443
|
+
const [phone, setPhone] = (0, import_react5.useState)("");
|
|
7444
|
+
const perform = (0, import_react5.useCallback)(async (payload) => {
|
|
7445
|
+
if (request.current) return;
|
|
7446
|
+
const controller = new AbortController();
|
|
7447
|
+
request.current = controller;
|
|
7448
|
+
setBusy(true);
|
|
7449
|
+
if (payload.operation !== "status") setFailed(false);
|
|
7450
|
+
try {
|
|
7451
|
+
const res = await rpc.call("/api", COMPANY_IDENTITY_ENDPOINT, payload, controller.signal);
|
|
7452
|
+
if (controller.signal.aborted) return;
|
|
7453
|
+
if (!res.ok || !res.value || typeof res.value !== "object" || !("status" in res.value)) throw Error("company identity unavailable");
|
|
7454
|
+
setView(res.value);
|
|
7455
|
+
setFailed(false);
|
|
7456
|
+
if (payload.operation === "bind") {
|
|
7457
|
+
setAlias("");
|
|
7458
|
+
setPhone("");
|
|
7459
|
+
}
|
|
7460
|
+
} catch {
|
|
7461
|
+
if (!controller.signal.aborted) {
|
|
7462
|
+
setView(void 0);
|
|
7463
|
+
setFailed(true);
|
|
7464
|
+
}
|
|
7465
|
+
} finally {
|
|
7466
|
+
if (request.current === controller) {
|
|
7467
|
+
request.current = void 0;
|
|
7468
|
+
setBusy(false);
|
|
7469
|
+
}
|
|
7470
|
+
}
|
|
7471
|
+
}, [rpc]);
|
|
7472
|
+
(0, import_react5.useEffect)(() => {
|
|
7473
|
+
const refresh = () => void perform({ operation: "status" });
|
|
7474
|
+
refresh();
|
|
7475
|
+
window.addEventListener("focus", refresh);
|
|
7476
|
+
return () => {
|
|
7477
|
+
window.removeEventListener("focus", refresh);
|
|
7478
|
+
request.current?.abort();
|
|
7479
|
+
request.current = void 0;
|
|
7480
|
+
};
|
|
7481
|
+
}, [perform]);
|
|
7482
|
+
const awaiting = view?.status === "awaiting";
|
|
7483
|
+
(0, import_react5.useEffect)(() => {
|
|
7484
|
+
if (!open || !awaiting) return;
|
|
7485
|
+
const timer = window.setInterval(() => void perform({ operation: "status" }), 3e3);
|
|
7486
|
+
return () => window.clearInterval(timer);
|
|
7487
|
+
}, [open, awaiting, perform]);
|
|
7488
|
+
const close = () => {
|
|
7489
|
+
setOpen(false);
|
|
7490
|
+
setAlias("");
|
|
7491
|
+
setPhone("");
|
|
7492
|
+
trigger.current?.focus();
|
|
7493
|
+
};
|
|
7494
|
+
const bound = view?.status === "bound" ? view : void 0;
|
|
7495
|
+
const label2 = bound ? [bound.alias, bound.position].filter(Boolean).join(" \xB7 ") : t("companyBind");
|
|
7496
|
+
const unavailable = !view || view.status === "unavailable";
|
|
7497
|
+
const bindable = view?.status === "unbound" || view?.status === "ineligible";
|
|
7498
|
+
const connectDisabled = busy || disabled;
|
|
7499
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", { className: "ws-update ws-company-identity", onKeyDown: (event) => {
|
|
7500
|
+
if (open && event.key === "Escape") close();
|
|
7501
|
+
} }, /* @__PURE__ */ import_react5.default.createElement(
|
|
7502
|
+
"button",
|
|
7503
|
+
{
|
|
7504
|
+
ref: trigger,
|
|
7505
|
+
type: "button",
|
|
7506
|
+
className: "ws-button ws-company-identity-trigger",
|
|
7507
|
+
"aria-expanded": open,
|
|
7508
|
+
"aria-controls": id,
|
|
7509
|
+
title: label2,
|
|
7510
|
+
onClick: () => {
|
|
7511
|
+
if (open) close();
|
|
7512
|
+
else {
|
|
7513
|
+
setOpen(true);
|
|
7514
|
+
void perform({ operation: "status" });
|
|
7515
|
+
}
|
|
7516
|
+
}
|
|
7517
|
+
},
|
|
7518
|
+
label2
|
|
7519
|
+
), open && /* @__PURE__ */ import_react5.default.createElement("section", { id, className: "ws-update-card ws-company-identity-card", "aria-label": t("companyIdentity") }, /* @__PURE__ */ import_react5.default.createElement("div", { className: "ws-update-heading" }, /* @__PURE__ */ import_react5.default.createElement("strong", null, t("companyIdentity")), /* @__PURE__ */ import_react5.default.createElement("button", { type: "button", className: "ws-icon-button", "aria-label": t("updateClose"), onClick: close }, "\xD7")), bound && /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement("dl", { className: "ws-company-identity-data" }, /* @__PURE__ */ import_react5.default.createElement("div", null, /* @__PURE__ */ import_react5.default.createElement("dt", null, t("companyAlias")), /* @__PURE__ */ import_react5.default.createElement("dd", null, bound.alias)), bound.position && /* @__PURE__ */ import_react5.default.createElement("div", null, /* @__PURE__ */ import_react5.default.createElement("dt", null, t("companyPosition")), /* @__PURE__ */ import_react5.default.createElement("dd", null, bound.position)), bound.company && /* @__PURE__ */ import_react5.default.createElement("div", null, /* @__PURE__ */ import_react5.default.createElement("dt", null, t("companyOrganization")), /* @__PURE__ */ import_react5.default.createElement("dd", null, bound.company)), bound.department && /* @__PURE__ */ import_react5.default.createElement("div", null, /* @__PURE__ */ import_react5.default.createElement("dt", null, t("companyDepartment")), /* @__PURE__ */ import_react5.default.createElement("dd", null, bound.department))), /* @__PURE__ */ import_react5.default.createElement("p", { role: "status" }, t(bound.modelReady ? "companyModelReady" : "companyModelUnavailable")), /* @__PURE__ */ import_react5.default.createElement("div", { className: "ws-update-actions" }, /* @__PURE__ */ import_react5.default.createElement("button", { type: "button", className: "ws-button", disabled: connectDisabled, onClick: () => void perform({ operation: "unbind" }) }, t("companyUnbind")))), view?.status === "awaiting" && /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement("p", { role: "status" }, t("companyAwaiting")), view.verificationCode && /* @__PURE__ */ import_react5.default.createElement("p", null, t("companyPairingCode"), " ", /* @__PURE__ */ import_react5.default.createElement("strong", null, view.verificationCode)), /* @__PURE__ */ import_react5.default.createElement("div", { className: "ws-update-actions" }, /* @__PURE__ */ import_react5.default.createElement("button", { className: "ws-button", type: "button", disabled: connectDisabled, onClick: () => void perform({ operation: "unbind" }) }, t("companyCancel")), /* @__PURE__ */ import_react5.default.createElement("a", { className: "ws-button ws-primary", href: view.authorizeUrl, target: "_blank", rel: "noopener noreferrer" }, t("companyVerify")))), bindable && /* @__PURE__ */ import_react5.default.createElement("form", { className: "ws-company-identity-form", onSubmit: (event) => {
|
|
7520
|
+
event.preventDefault();
|
|
7521
|
+
void perform({ operation: "bind", ...alias.trim() ? { alias: alias.trim() } : {}, ...phone.trim() ? { phone: phone.trim() } : {} });
|
|
7522
|
+
} }, /* @__PURE__ */ import_react5.default.createElement("p", { role: "status" }, t(view.status === "ineligible" ? "companyIneligible" : "companyHint")), /* @__PURE__ */ import_react5.default.createElement("label", null, t("companyAliasOptional"), /* @__PURE__ */ import_react5.default.createElement("input", { value: alias, maxLength: 96, onChange: (event) => setAlias(event.target.value) })), /* @__PURE__ */ import_react5.default.createElement("label", null, t("companyPhoneOptional"), /* @__PURE__ */ import_react5.default.createElement(
|
|
7523
|
+
"input",
|
|
7524
|
+
{
|
|
7525
|
+
value: phone,
|
|
7526
|
+
type: "tel",
|
|
7527
|
+
inputMode: "tel",
|
|
7528
|
+
maxLength: 14,
|
|
7529
|
+
pattern: "(?:\\+86)?1[0-9]{10}",
|
|
7530
|
+
autoComplete: "off",
|
|
7531
|
+
onChange: (event) => setPhone(event.target.value)
|
|
7532
|
+
}
|
|
7533
|
+
)), /* @__PURE__ */ import_react5.default.createElement("div", { className: "ws-update-actions" }, /* @__PURE__ */ import_react5.default.createElement("button", { type: "submit", className: "ws-button ws-primary", disabled: connectDisabled }, t("companyContinue")))), unavailable && /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null, /* @__PURE__ */ import_react5.default.createElement("p", { role: "status" }, t(failed ? "companyRetryHint" : busy ? "companyChecking" : "companyUnavailable")), !busy && /* @__PURE__ */ import_react5.default.createElement("div", { className: "ws-update-actions" }, /* @__PURE__ */ import_react5.default.createElement("button", { type: "button", className: "ws-button", onClick: () => void perform({ operation: "status" }) }, t("companyRetry"))))));
|
|
7534
|
+
}
|
|
7535
|
+
var companyIdentityStyles = `
|
|
7536
|
+
.ws-company-identity-trigger{display:block;max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
7537
|
+
.ws-company-identity-card p,.ws-company-identity-form label,.ws-company-identity-data{font-size:13px;line-height:1.6}
|
|
7538
|
+
.ws-company-identity-form,.ws-company-identity-data{display:grid;gap:10px}
|
|
7539
|
+
.ws-company-identity-form label{display:grid;gap:4px;color:var(--ws-muted)}
|
|
7540
|
+
.ws-company-identity-form input{width:100%;min-width:0;padding:7px 9px;border:1px solid var(--ws-line);border-radius:6px;background:var(--ws-bg);color:inherit}
|
|
7541
|
+
.ws-company-identity-card a{text-decoration:none}
|
|
7542
|
+
.ws-company-identity-data>div{display:flex;justify-content:space-between;gap:12px}
|
|
7543
|
+
.ws-company-identity-data dt{color:var(--ws-muted)}
|
|
7544
|
+
.ws-company-identity-data dd{margin:0;text-align:right;overflow-wrap:anywhere}
|
|
7545
|
+
@container(max-width:540px){.ws-company-identity-trigger{max-width:120px}}
|
|
7546
|
+
`;
|
|
7547
|
+
|
|
7548
|
+
// src/wechat/avatar.tsx
|
|
7549
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
7550
|
+
|
|
7430
7551
|
// src/wechat/avatar-cache.ts
|
|
7431
7552
|
function createAvatarCache(load, decode2, now = Date.now, timeoutMs = 15e3) {
|
|
7432
7553
|
const entries = /* @__PURE__ */ new Map(), listeners = /* @__PURE__ */ new Set(), queue = [];
|
|
@@ -7521,12 +7642,12 @@ function cacheFor(client) {
|
|
|
7521
7642
|
return cache;
|
|
7522
7643
|
}
|
|
7523
7644
|
function WechatAvatar({ client, scope, owner, mediaId, fallback, className = "" }) {
|
|
7524
|
-
return client ? /* @__PURE__ */
|
|
7645
|
+
return client ? /* @__PURE__ */ import_react6.default.createElement(LoadedAvatar, { key: JSON.stringify([scope, owner]), client, identity: JSON.stringify([scope, owner]), mediaId, fallback, className }) : /* @__PURE__ */ import_react6.default.createElement("span", { className: `ws-avatar ${className}` }, fallback);
|
|
7525
7646
|
}
|
|
7526
7647
|
function LoadedAvatar({ client, identity, mediaId, fallback, className }) {
|
|
7527
|
-
const cache = cacheFor(client), element2 = (0,
|
|
7528
|
-
const url = (0,
|
|
7529
|
-
(0,
|
|
7648
|
+
const cache = cacheFor(client), element2 = (0, import_react6.useRef)(null);
|
|
7649
|
+
const url = (0, import_react6.useSyncExternalStore)(cache.subscribe, () => cache.peek(identity), () => void 0);
|
|
7650
|
+
(0, import_react6.useEffect)(() => {
|
|
7530
7651
|
if (!mediaId) return;
|
|
7531
7652
|
let visible = false;
|
|
7532
7653
|
const refresh = () => {
|
|
@@ -7547,11 +7668,11 @@ function LoadedAvatar({ client, identity, mediaId, fallback, className }) {
|
|
|
7547
7668
|
clearInterval(timer);
|
|
7548
7669
|
};
|
|
7549
7670
|
}, [cache, identity, mediaId]);
|
|
7550
|
-
return /* @__PURE__ */
|
|
7671
|
+
return /* @__PURE__ */ import_react6.default.createElement("span", { ref: element2, className: `ws-avatar ${className}` }, url ? /* @__PURE__ */ import_react6.default.createElement("img", { className: "ws-avatar-image", src: url, alt: "", draggable: false }) : fallback);
|
|
7551
7672
|
}
|
|
7552
7673
|
|
|
7553
7674
|
// src/wechat/sync-panel.tsx
|
|
7554
|
-
var
|
|
7675
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
7555
7676
|
|
|
7556
7677
|
// src/wechat/types.ts
|
|
7557
7678
|
var WECHAT_METHOD = "wanji-sales-wechat/request";
|
|
@@ -7830,9 +7951,9 @@ function startWechatMediaLoad(mediaId, load, publish) {
|
|
|
7830
7951
|
}
|
|
7831
7952
|
|
|
7832
7953
|
// src/wechat/runtime-panel.tsx
|
|
7833
|
-
var
|
|
7954
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
7834
7955
|
var phases = { idle: "wxRuntimeChecking", checking: "wxRuntimeChecking", waiting: "wxRuntimeWaiting", downloading: "wxRuntimeDownloading", verifying: "wxRuntimeVerifying", extracting: "wxRuntimeExtracting", "self-test": "wxRuntimeTesting", ready: "wxRuntimeReady", error: "wxRuntimeFailed", unsupported: "wxRuntimeUnsupported" };
|
|
7835
|
-
var errors = { WECHAT_RUNTIME_CHECKSUM: "wxRuntimeChecksum", WECHAT_RUNTIME_COMPONENT: "wxRuntimeInvalid", WECHAT_RUNTIME_ARCHIVE: "wxRuntimeInvalid", WECHAT_RUNTIME_SELF_TEST: "wxRuntimeSelfTest", WECHAT_RUNTIME_MANIFEST: "wxRuntimeInvalid", WECHAT_RUNTIME_URL: "wxRuntimeInvalid", WECHAT_RUNTIME_CACHE: "wxRuntimeCache", WECHAT_RUNTIME_TIMEOUT: "wxRuntimeTimeout", WECHAT_RUNTIME_ABORTED: "wxRuntimeAborted" };
|
|
7956
|
+
var errors = { WECHAT_RUNTIME_CHECKSUM: "wxRuntimeChecksum", WECHAT_RUNTIME_COMPONENT: "wxRuntimeInvalid", WECHAT_RUNTIME_ARCHIVE: "wxRuntimeInvalid", WECHAT_RUNTIME_SELF_TEST: "wxRuntimeSelfTest", WECHAT_RUNTIME_SELF_TEST_TIMEOUT: "wxRuntimeSelfTestTimeout", WECHAT_RUNTIME_MANIFEST: "wxRuntimeInvalid", WECHAT_RUNTIME_URL: "wxRuntimeInvalid", WECHAT_RUNTIME_CACHE: "wxRuntimeCache", WECHAT_RUNTIME_TIMEOUT: "wxRuntimeTimeout", WECHAT_RUNTIME_ABORTED: "wxRuntimeAborted" };
|
|
7836
7957
|
function runtimePercent(runtime) {
|
|
7837
7958
|
return runtime.total && runtime.total > 0 ? Math.max(0, Math.min(100, Math.floor(runtime.received / runtime.total * 100))) : void 0;
|
|
7838
7959
|
}
|
|
@@ -7840,11 +7961,11 @@ function RuntimePanel({ runtime, t, retry, disabled }) {
|
|
|
7840
7961
|
const failed = runtime.phase === "error", unsupported = runtime.phase === "unsupported", percent = runtimePercent(runtime);
|
|
7841
7962
|
const number2 = new Intl.NumberFormat(void 0, { minimumFractionDigits: 1, maximumFractionDigits: 1 });
|
|
7842
7963
|
const amount3 = number2.format(runtime.received / 1e6) + (runtime.total ? " / " + number2.format(runtime.total / 1e6) : "") + " " + t("wxRuntimeMB");
|
|
7843
|
-
return /* @__PURE__ */
|
|
7964
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", { className: "ws-runtime-panel", role: failed ? "alert" : "status" }, /* @__PURE__ */ import_react7.default.createElement("div", { className: "ws-runtime-line" }, /* @__PURE__ */ import_react7.default.createElement("span", null, t(phases[runtime.phase])), !failed && !unsupported && runtime.total && /* @__PURE__ */ import_react7.default.createElement("span", null, amount3, percent !== void 0 ? " \xB7 " + percent + "%" : ""), failed && /* @__PURE__ */ import_react7.default.createElement("button", { className: "ws-text-button", disabled, onClick: retry }, t("wxRuntimeRetry"))), failed ? /* @__PURE__ */ import_react7.default.createElement("p", null, t(errors[runtime.errorCode ?? ""] ?? "wxRuntimeNetwork")) : !unsupported && /* @__PURE__ */ import_react7.default.createElement("span", { className: "ws-runtime-track", role: "progressbar", "aria-label": t(phases[runtime.phase]), "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": percent }, /* @__PURE__ */ import_react7.default.createElement("span", { style: { width: (percent ?? 0) + "%" } })));
|
|
7844
7965
|
}
|
|
7845
7966
|
|
|
7846
7967
|
// src/wechat/message-media.tsx
|
|
7847
|
-
var
|
|
7968
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
7848
7969
|
|
|
7849
7970
|
// src/wechat/voice-playback.ts
|
|
7850
7971
|
function voiceDurationLabel(seconds) {
|
|
@@ -7888,16 +8009,16 @@ var voicePlayback = new VoicePlaybackCoordinator();
|
|
|
7888
8009
|
function WechatMessageBody({ message, client, revision: revision2, t }) {
|
|
7889
8010
|
const attachment = message.kind === "image" || message.kind === "voice" || message.kind === "audio" || message.kind === "video";
|
|
7890
8011
|
const text4 = attachment ? /^\[(?:image|图片|video|视频|(?:voice|audio|语音)(?:\s*\d+(?:\.\d+)?\s*(?:秒|s|["″”]))?)\]$/i.test(message.text?.trim() ?? "") ? "" : message.text : message.text || `[${message.kind}]`;
|
|
7891
|
-
return /* @__PURE__ */
|
|
8012
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, text4 && /* @__PURE__ */ import_react8.default.createElement("div", null, text4), message.mediaId ? /* @__PURE__ */ import_react8.default.createElement(NativeMedia, { client, mediaId: message.mediaId, kind: message.kind, revision: revision2, t }) : attachment && (message.kind === "image" || message.kind === "video" ? /* @__PURE__ */ import_react8.default.createElement("span", { className: "ws-media-placeholder" }, t(message.kind === "video" ? "wxVideoPending" : "wxImagePending")) : /* @__PURE__ */ import_react8.default.createElement(VoicePlaceholder, { state: "pending", t })));
|
|
7892
8013
|
}
|
|
7893
8014
|
function NativeMedia(props) {
|
|
7894
|
-
return /* @__PURE__ */
|
|
8015
|
+
return /* @__PURE__ */ import_react8.default.createElement(MediaAttachment, { key: props.mediaId, ...props });
|
|
7895
8016
|
}
|
|
7896
8017
|
function MediaAttachment({ client, mediaId, kind, revision: revision2, t }) {
|
|
7897
|
-
const [result, setResult] = (0,
|
|
7898
|
-
const [requested, setRequested] = (0,
|
|
7899
|
-
const [retry, setRetry] = (0,
|
|
7900
|
-
(0,
|
|
8018
|
+
const [result, setResult] = (0, import_react8.useState)({ mediaId });
|
|
8019
|
+
const [requested, setRequested] = (0, import_react8.useState)(kind !== "video");
|
|
8020
|
+
const [retry, setRetry] = (0, import_react8.useState)(0), element2 = (0, import_react8.useRef)(null), loaded = (0, import_react8.useRef)(false);
|
|
8021
|
+
(0, import_react8.useEffect)(() => {
|
|
7901
8022
|
if (!requested || loaded.current) return;
|
|
7902
8023
|
let cancel, started = false;
|
|
7903
8024
|
const load = () => {
|
|
@@ -7927,24 +8048,24 @@ function MediaAttachment({ client, mediaId, kind, revision: revision2, t }) {
|
|
|
7927
8048
|
setResult({ mediaId, error: "decode" });
|
|
7928
8049
|
};
|
|
7929
8050
|
if (kind === "video") {
|
|
7930
|
-
return /* @__PURE__ */
|
|
8051
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { ref: element2, className: "ws-native-media" }, result.url ? /* @__PURE__ */ import_react8.default.createElement("video", { src: result.url, controls: true, playsInline: true, preload: "metadata", "aria-label": t("wxVideoMessage"), onError: failed }) : result.error ? /* @__PURE__ */ import_react8.default.createElement("span", { role: "status" }, t("wxVideoUnavailable"), " ", /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: "ws-text-button", onClick: () => setRetry((value) => value + 1) }, t("wxMediaRetry"))) : requested ? /* @__PURE__ */ import_react8.default.createElement("span", { className: "ws-media-placeholder", role: "status" }, t("wxVideoLoading")) : /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: "ws-button ws-video-load", onClick: () => setRequested(true) }, t("wxVideoLoad")));
|
|
7931
8052
|
}
|
|
7932
|
-
return /* @__PURE__ */
|
|
8053
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { ref: element2, className: "ws-native-media" }, result.url ? result.url.startsWith("data:image/") ? /* @__PURE__ */ import_react8.default.createElement(ImageAttachment, { src: result.url, t, onError: failed }) : /* @__PURE__ */ import_react8.default.createElement(VoiceAttachment, { key: result.url, src: result.url, t, onError: failed }) : result.error ? kind === "voice" || kind === "audio" ? /* @__PURE__ */ import_react8.default.createElement(VoicePlaceholder, { state: "error", t, retry: () => setRetry((value) => value + 1) }) : /* @__PURE__ */ import_react8.default.createElement("span", { role: "status" }, t(kind === "image" ? "wxImageUnavailable" : "wxAudioUnavailable"), " ", /* @__PURE__ */ import_react8.default.createElement("button", { className: "ws-text-button", onClick: () => setRetry((value) => value + 1) }, t("wxMediaRetry"))) : kind === "voice" || kind === "audio" ? /* @__PURE__ */ import_react8.default.createElement(VoicePlaceholder, { state: "loading", t }) : /* @__PURE__ */ import_react8.default.createElement("span", { className: "ws-media-placeholder", role: "status" }, t("wxImageLoading")));
|
|
7933
8054
|
}
|
|
7934
8055
|
function ImageAttachment({ src, t, onError }) {
|
|
7935
|
-
const [open, setOpen] = (0,
|
|
7936
|
-
return /* @__PURE__ */
|
|
8056
|
+
const [open, setOpen] = (0, import_react8.useState)(false), trigger = (0, import_react8.useRef)(null);
|
|
8057
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement("button", { ref: trigger, type: "button", className: "ws-image-trigger", "aria-label": t("wxImagePreview"), "aria-haspopup": "dialog", onClick: () => setOpen(true) }, /* @__PURE__ */ import_react8.default.createElement("img", { src, alt: t("wxImageAlt"), loading: "lazy", decoding: "async", onError })), open && /* @__PURE__ */ import_react8.default.createElement(ImagePreview, { src, t, onClose: () => setOpen(false), onError, returnFocus: trigger }));
|
|
7937
8058
|
}
|
|
7938
8059
|
function VoiceWaves() {
|
|
7939
|
-
return /* @__PURE__ */
|
|
8060
|
+
return /* @__PURE__ */ import_react8.default.createElement("svg", { className: "ws-voice-waves", width: "24", height: "25", viewBox: "0 0 24 25", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", "aria-hidden": "true" }, /* @__PURE__ */ import_react8.default.createElement("path", { d: "M5 11v3" }), /* @__PURE__ */ import_react8.default.createElement("path", { className: "ws-voice-wave-mid", d: "M10 7.5a9 9 0 0 1 0 10" }), /* @__PURE__ */ import_react8.default.createElement("path", { className: "ws-voice-wave-outer", d: "M15 3.5a15 15 0 0 1 0 18" }));
|
|
7940
8061
|
}
|
|
7941
8062
|
function VoicePlaceholder({ state, t, retry }) {
|
|
7942
|
-
return /* @__PURE__ */
|
|
8063
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: `ws-voice-placeholder is-${state}`, role: "status", title: t(state === "pending" ? "wxAudioPending" : state === "loading" ? "wxAudioLoading" : "wxAudioUnavailable") }, /* @__PURE__ */ import_react8.default.createElement(VoiceWaves, null), /* @__PURE__ */ import_react8.default.createElement("span", { className: "ws-voice-status" }, /* @__PURE__ */ import_react8.default.createElement("strong", null, t("wxVoiceMessage")), /* @__PURE__ */ import_react8.default.createElement("span", null, t(state === "pending" ? "wxVoicePending" : state === "loading" ? "wxAudioLoading" : "wxAudioUnavailable"))), retry && /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: "ws-text-button ws-voice-retry", onClick: retry }, t("wxMediaRetry")));
|
|
7943
8064
|
}
|
|
7944
8065
|
function VoiceAttachment({ src, t, onError }) {
|
|
7945
|
-
const audio = (0,
|
|
7946
|
-
const [playing, setPlaying] = (0,
|
|
7947
|
-
(0,
|
|
8066
|
+
const audio = (0, import_react8.useRef)(null), alive = (0, import_react8.useRef)(true);
|
|
8067
|
+
const [playing, setPlaying] = (0, import_react8.useState)(false), [duration, setDuration] = (0, import_react8.useState)(), [playError, setPlayError] = (0, import_react8.useState)(false);
|
|
8068
|
+
(0, import_react8.useEffect)(() => {
|
|
7948
8069
|
alive.current = true;
|
|
7949
8070
|
const element2 = audio.current;
|
|
7950
8071
|
return () => {
|
|
@@ -7963,43 +8084,43 @@ function VoiceAttachment({ src, t, onError }) {
|
|
|
7963
8084
|
}
|
|
7964
8085
|
};
|
|
7965
8086
|
const durationLabel = voiceDurationLabel(duration);
|
|
7966
|
-
return /* @__PURE__ */
|
|
8087
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: "ws-voice-message" }, /* @__PURE__ */ import_react8.default.createElement("audio", { ref: audio, hidden: true, preload: "metadata", src, onLoadedMetadata: (event) => setDuration(event.currentTarget.duration), onDurationChange: (event) => setDuration(event.currentTarget.duration), onPlaying: () => setPlaying(true), onPause: () => setPlaying(false), onEnded: (event) => {
|
|
7967
8088
|
voicePlayback.stop(event.currentTarget);
|
|
7968
8089
|
setPlaying(false);
|
|
7969
|
-
}, onError }), /* @__PURE__ */
|
|
8090
|
+
}, onError }), /* @__PURE__ */ import_react8.default.createElement("button", { type: "button", className: `ws-voice-button${playing ? " is-playing" : ""}`, style: { width: Math.min(240, 112 + (duration && Number.isFinite(duration) ? duration : 0) * 2) }, onClick: () => void toggle(), "aria-label": `${t(playing ? "wxPauseVoice" : "wxPlayVoice")}${durationLabel ? " \xB7 " + durationLabel : ""}`, "aria-pressed": playing }, /* @__PURE__ */ import_react8.default.createElement(VoiceWaves, null), /* @__PURE__ */ import_react8.default.createElement("span", { className: "ws-voice-duration", "aria-hidden": "true" }, durationLabel)), playError && /* @__PURE__ */ import_react8.default.createElement("span", { className: "ws-voice-error", role: "status" }, t("wxVoicePlaybackFailed")));
|
|
7970
8091
|
}
|
|
7971
8092
|
|
|
7972
8093
|
// src/wechat/sync-panel.tsx
|
|
7973
8094
|
function SyncActivity({ children, compact = false, active = true, percent }) {
|
|
7974
|
-
return /* @__PURE__ */
|
|
8095
|
+
return /* @__PURE__ */ import_react9.default.createElement("span", { className: `ws-sync-activity${compact ? " is-compact" : ""}`, role: "status" }, compact && (active ? /* @__PURE__ */ import_react9.default.createElement("span", { className: "ws-sync-spinner", "aria-hidden": "true" }) : /* @__PURE__ */ import_react9.default.createElement("span", { className: "ws-dot", "aria-hidden": "true" })), /* @__PURE__ */ import_react9.default.createElement("span", { className: active ? "ws-sync-shimmer" : void 0 }, children), percent !== void 0 && /* @__PURE__ */ import_react9.default.createElement("strong", { className: "ws-sync-percent" }, percent, "%"), active && /* @__PURE__ */ import_react9.default.createElement("span", { className: "ws-sync-dots", "aria-hidden": "true" }, /* @__PURE__ */ import_react9.default.createElement("i", null), /* @__PURE__ */ import_react9.default.createElement("i", null), /* @__PURE__ */ import_react9.default.createElement("i", null)));
|
|
7975
8096
|
}
|
|
7976
8097
|
var progressLabels = { preparing: "wxProgressPreparing", collecting: "wxProgressReading", transferring: "wxProgressTransfer", saving: "wxProgressSaving", complete: "wxRoundComplete" };
|
|
7977
8098
|
function SyncProgressTrack({ progress, active, t }) {
|
|
7978
8099
|
const percent = wechatProgressPercent({ progress }), label2 = t(progress ? progressLabels[progress.stage] ?? "wxSyncing" : "wxSyncing");
|
|
7979
|
-
return /* @__PURE__ */
|
|
8100
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement("span", { className: "ws-sync-track", "data-determinate": percent !== void 0, "data-active": active, role: "progressbar", "aria-label": label2, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": percent }, percent !== void 0 && /* @__PURE__ */ import_react9.default.createElement("span", { className: "ws-sync-fill", style: { width: percent + "%" } })), progress && /* @__PURE__ */ import_react9.default.createElement("small", { className: "ws-sync-phase" }, label2, progress.totalParts !== void 0 && /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, " \xB7 ", t("wxProgressSaved"), " ", progress.completedParts, "/", progress.totalParts, " ", t("wxProgressParts"))));
|
|
7980
8101
|
}
|
|
7981
8102
|
function SyncPanel({ client, view, workspaceId, t }) {
|
|
7982
|
-
const [answered, setAnswered] = (0,
|
|
8103
|
+
const [answered, setAnswered] = (0, import_react9.useState)([]), s = view.status, c = s?.capabilities, consent = s?.consent, key = consent ? consent.requestId + ":" + consent.kind : "";
|
|
7983
8104
|
const authorize = (approved) => {
|
|
7984
8105
|
if (!consent) return;
|
|
7985
8106
|
setAnswered((v) => [...v, key]);
|
|
7986
8107
|
void client.control("authorize", { requestId: consent.requestId, approved });
|
|
7987
8108
|
};
|
|
7988
|
-
if (s?.runtime && s.runtime.phase !== "ready") return /* @__PURE__ */
|
|
8109
|
+
if (s?.runtime && s.runtime.phase !== "ready") return /* @__PURE__ */ import_react9.default.createElement(RuntimePanel, { runtime: s.runtime, t, retry: () => void client.control("runtime-retry"), disabled: !workspaceId });
|
|
7989
8110
|
const presentation = wechatPresentation(view), statusText = t(presentation.statusKey);
|
|
7990
8111
|
const message = view.error || (isWechatSyncActive(s, view.error) ? void 0 : s?.message);
|
|
7991
8112
|
const sipIssue = wechatSipIssue(message);
|
|
7992
8113
|
const detail = message && !/^WECHAT_/.test(message) ? message : presentation.hintKey ? t(presentation.hintKey) : void 0;
|
|
7993
|
-
return /* @__PURE__ */
|
|
8114
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", { className: "ws-sync-status" }, /* @__PURE__ */ import_react9.default.createElement("div", { className: "ws-sync-line" }, /* @__PURE__ */ import_react9.default.createElement("span", { className: "ws-dot" }), /* @__PURE__ */ import_react9.default.createElement("span", { role: "status" }, statusText), s?.lastSyncedAt && /* @__PURE__ */ import_react9.default.createElement("time", null, new Date(s.lastSyncedAt).toLocaleTimeString()), canPauseWechat(s) && /* @__PURE__ */ import_react9.default.createElement("button", { className: "ws-text-button", onClick: () => void client.control("pause") }, t("wxPause")), c && !c.ready ? /* @__PURE__ */ import_react9.default.createElement("button", { className: "ws-text-button", disabled: !workspaceId, onClick: () => void client.refresh() }, t("wxCheckConnection")) : !canPauseWechat(s) && (s?.phase === "paused" || s?.phase === "error" || !!view.error || s?.phase === "disconnected" && !presentation.blocked) && /* @__PURE__ */ import_react9.default.createElement("button", { className: "ws-text-button", disabled: !workspaceId || !c?.ready || s?.running, onClick: () => void client.control("start", { automatic: true }) }, t("wxRetry"))), sipIssue ? /* @__PURE__ */ import_react9.default.createElement("p", { role: "status" }, t(sipIssue), " ", /* @__PURE__ */ import_react9.default.createElement("a", { download: t("wxGuideFilename"), href: "data:text/plain;charset=utf-8," + encodeURIComponent(t("wxGuideText")) }, t("wxGuideDownload"))) : detail && /* @__PURE__ */ import_react9.default.createElement("p", { role: "status" }, detail), consent && !answered.includes(key) && /* @__PURE__ */ import_react9.default.createElement("div", { className: "ws-sync-consent", role: "alert" }, /* @__PURE__ */ import_react9.default.createElement("strong", null, t(consent.kind === "restart" ? "wxRestart" : "wxInitialize")), /* @__PURE__ */ import_react9.default.createElement("p", null, consent.message), /* @__PURE__ */ import_react9.default.createElement("button", { className: "ws-button ws-primary", onClick: () => authorize(true) }, t("wxApprove")), /* @__PURE__ */ import_react9.default.createElement("button", { className: "ws-button", onClick: () => authorize(false) }, t("wxCancel"))));
|
|
7994
8115
|
}
|
|
7995
8116
|
|
|
7996
8117
|
// src/wechat/sync-footer.tsx
|
|
7997
|
-
var
|
|
8118
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
7998
8119
|
function SyncFooter({ view, t }) {
|
|
7999
8120
|
const runtime = view.status?.runtime;
|
|
8000
|
-
if (runtime && runtime.phase !== "ready") return /* @__PURE__ */
|
|
8121
|
+
if (runtime && runtime.phase !== "ready") return /* @__PURE__ */ import_react10.default.createElement("div", { className: "ws-sync-mini", role: "status" }, /* @__PURE__ */ import_react10.default.createElement("span", null, t(runtime.phase === "error" ? "wxRuntimeFailed" : runtime.phase === "unsupported" ? "wxRuntimeUnsupported" : "wxRuntimePreparing")), runtimePercent(runtime) !== void 0 && /* @__PURE__ */ import_react10.default.createElement("strong", { className: "ws-sync-mini-value" }, runtimePercent(runtime), "%"));
|
|
8001
8122
|
const presentation = wechatPresentation(view), s = view.status, phase = s?.phase, failed = !!view.error || phase === "error" || presentation.blocked, paused = phase === "paused", authorizing = phase === "authorizing";
|
|
8002
|
-
if (phase === "awaiting-login" && !view.error && !presentation.blocked) return /* @__PURE__ */
|
|
8123
|
+
if (phase === "awaiting-login" && !view.error && !presentation.blocked) return /* @__PURE__ */ import_react10.default.createElement("div", { className: "ws-sync-mini", role: "status", title: t("wxAwaitLoginHint") }, t("wxAwaitLogin"));
|
|
8003
8124
|
const syncing = isWechatSyncActive(s, view.error), media = !!s?.mediaImporting && !syncing && !failed && !paused && !authorizing;
|
|
8004
8125
|
const active = syncing || media, p = wechatProgressPercent(s);
|
|
8005
8126
|
const percent = presentation.blocked ? void 0 : syncing ? p : (failed || paused) && p !== void 0 && p < 100 ? p : void 0;
|
|
@@ -8010,14 +8131,14 @@ function SyncFooter({ view, t }) {
|
|
|
8010
8131
|
const sipIssue = wechatSipIssue(s?.message);
|
|
8011
8132
|
const message = s?.message === "WECHAT_LOGIN_RETRY_REQUIRED" ? t("wxReconnectAfterLogin") : s?.message;
|
|
8012
8133
|
const detail = [sipIssue ? t(sipIssue) : message, p !== void 0 ? p + "%" : "", parts ? `${t("wxProgressSaved")} ${s?.progress?.completedParts}/${parts} ${t("wxProgressParts")}` : "", t("wxLocalHistory")].filter(Boolean).join(" \xB7 ");
|
|
8013
|
-
return /* @__PURE__ */
|
|
8134
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", { className: "ws-sync-mini", role: "status", title: detail }, active ? /* @__PURE__ */ import_react10.default.createElement("span", { className: "ws-sync-spinner", "aria-hidden": "true" }) : /* @__PURE__ */ import_react10.default.createElement("svg", { width: "13", height: "13", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", "aria-hidden": "true" }, /* @__PURE__ */ import_react10.default.createElement("path", { d: paused ? "M5 3v10M11 3v10" : failed ? "M8 3v6M8 12v1" : authorizing ? "M8 3v5l3 2" : "m3 8 3 3 7-7" })), /* @__PURE__ */ import_react10.default.createElement("span", { className: active ? "ws-sync-shimmer" : void 0 }, t(label2)), percent !== void 0 ? /* @__PURE__ */ import_react10.default.createElement("strong", { className: "ws-sync-mini-value" }, percent, "%") : clock && /* @__PURE__ */ import_react10.default.createElement("time", { className: "ws-sync-mini-value", dateTime: s?.lastSyncedAt }, clock), syncing && percent !== void 0 && /* @__PURE__ */ import_react10.default.createElement("span", { className: "ws-sync-mini-track", role: "progressbar", "aria-label": t("wxFooterSyncing"), "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": percent }, /* @__PURE__ */ import_react10.default.createElement("span", { style: { width: percent + "%" } })));
|
|
8014
8135
|
}
|
|
8015
8136
|
|
|
8016
8137
|
// src/client.tsx
|
|
8017
|
-
var
|
|
8138
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
8018
8139
|
|
|
8019
8140
|
// src/wechat/use-chat-scroll.ts
|
|
8020
|
-
var
|
|
8141
|
+
var import_react11 = require("react");
|
|
8021
8142
|
|
|
8022
8143
|
// src/wechat/reading-position.ts
|
|
8023
8144
|
var nodes = (el) => Array.from(el.querySelectorAll("[data-message-id]"));
|
|
@@ -8042,8 +8163,8 @@ function hasNewMessages(position2, lastId) {
|
|
|
8042
8163
|
|
|
8043
8164
|
// src/wechat/use-chat-scroll.ts
|
|
8044
8165
|
function useChatScroll(scope, messageKey) {
|
|
8045
|
-
const viewport = (0,
|
|
8046
|
-
const position2 = (0,
|
|
8166
|
+
const viewport = (0, import_react11.useRef)(null), content3 = (0, import_react11.useRef)(null);
|
|
8167
|
+
const position2 = (0, import_react11.useRef)(), activeScope = (0, import_react11.useRef)(""), [unseen, setUnseen] = (0, import_react11.useState)(false), [expired, setExpired] = (0, import_react11.useState)(false);
|
|
8047
8168
|
const capture = () => {
|
|
8048
8169
|
const el = viewport.current;
|
|
8049
8170
|
if (!el?.clientHeight) return;
|
|
@@ -8071,7 +8192,7 @@ function useChatScroll(scope, messageKey) {
|
|
|
8071
8192
|
} else el.scrollTop = el.scrollHeight;
|
|
8072
8193
|
capture();
|
|
8073
8194
|
};
|
|
8074
|
-
(0,
|
|
8195
|
+
(0, import_react11.useLayoutEffect)(() => {
|
|
8075
8196
|
if (activeScope.current !== scope) {
|
|
8076
8197
|
activeScope.current = scope;
|
|
8077
8198
|
position2.current = void 0;
|
|
@@ -8080,7 +8201,7 @@ function useChatScroll(scope, messageKey) {
|
|
|
8080
8201
|
}
|
|
8081
8202
|
restore();
|
|
8082
8203
|
}, [scope, messageKey]);
|
|
8083
|
-
(0,
|
|
8204
|
+
(0, import_react11.useLayoutEffect)(() => {
|
|
8084
8205
|
const el = viewport.current, inner = content3.current;
|
|
8085
8206
|
if (!el || !inner || typeof ResizeObserver === "undefined") return;
|
|
8086
8207
|
const observer = new ResizeObserver(restore);
|
|
@@ -9706,6 +9827,28 @@ var knowledgeEn = {
|
|
|
9706
9827
|
|
|
9707
9828
|
// src/locales.ts
|
|
9708
9829
|
var zh = {
|
|
9830
|
+
companyIdentity: "\u516C\u53F8\u8EAB\u4EFD",
|
|
9831
|
+
companyBind: "\u7ED1\u5B9A\u9489\u9489",
|
|
9832
|
+
companyAlias: "\u82B1\u540D",
|
|
9833
|
+
companyPosition: "\u5C97\u4F4D",
|
|
9834
|
+
companyOrganization: "\u516C\u53F8",
|
|
9835
|
+
companyDepartment: "\u90E8\u95E8",
|
|
9836
|
+
companyModelReady: "\u5DF2\u5F00\u901A\u516C\u53F8 DeepSeek Flash",
|
|
9837
|
+
companyModelUnavailable: "\u8EAB\u4EFD\u5DF2\u9A8C\u8BC1\uFF0C\u516C\u53F8\u6A21\u578B\u901A\u9053\u6682\u4E0D\u53EF\u7528",
|
|
9838
|
+
companyUnbind: "\u89E3\u9664\u7ED1\u5B9A",
|
|
9839
|
+
companyCancel: "\u53D6\u6D88\u7ED1\u5B9A",
|
|
9840
|
+
companyAwaiting: "\u6253\u5F00\u9A8C\u8BC1\u9875\u9762\uFF0C\u6309\u63D0\u793A\u5B8C\u6210\u9489\u9489\u672C\u4EBA\u9A8C\u8BC1\u3002",
|
|
9841
|
+
companyPairingCode: "\u914D\u5BF9\u7801",
|
|
9842
|
+
companyVerify: "\u6253\u5F00\u9489\u9489\u9A8C\u8BC1",
|
|
9843
|
+
companyHint: "\u4E07\u673A\u4F01\u4E1A\u6210\u5458\u7ED1\u5B9A\u672C\u4EBA\u7684\u9489\u9489\u8D26\u53F7\u540E\uFF0C\u5373\u53EF\u4F7F\u7528\u516C\u53F8\u6A21\u578B\u3002",
|
|
9844
|
+
companyIneligible: "\u672A\u80FD\u9A8C\u8BC1\u5F53\u524D\u8D26\u53F7\u7684\u4E07\u673A\u4F01\u4E1A\u6210\u5458\u8EAB\u4EFD\u3002",
|
|
9845
|
+
companyAliasOptional: "\u82B1\u540D\uFF08\u9009\u586B\uFF09",
|
|
9846
|
+
companyPhoneOptional: "\u624B\u673A\u53F7\uFF08\u9009\u586B\uFF09",
|
|
9847
|
+
companyContinue: "\u53D1\u8D77\u9489\u9489\u9A8C\u8BC1",
|
|
9848
|
+
companyRetryHint: "\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u516C\u53F8\u8EAB\u4EFD\uFF0C\u8BF7\u91CD\u8BD5\u3002",
|
|
9849
|
+
companyChecking: "\u6B63\u5728\u68C0\u67E5\u516C\u53F8\u8EAB\u4EFD\u2026",
|
|
9850
|
+
companyUnavailable: "\u516C\u53F8\u8EAB\u4EFD\u670D\u52A1\u5C1A\u672A\u63A5\u5165\u3002",
|
|
9851
|
+
companyRetry: "\u91CD\u8BD5",
|
|
9709
9852
|
wxImageActualSize: "\u5B9E\u9645\u5927\u5C0F",
|
|
9710
9853
|
wxVideoMessage: "\u5FAE\u4FE1\u89C6\u9891",
|
|
9711
9854
|
wxVideoLoad: "\u52A0\u8F7D\u89C6\u9891",
|
|
@@ -9825,6 +9968,7 @@ var zh = {
|
|
|
9825
9968
|
wxRuntimeTimeout: "\u7EC4\u4EF6\u51C6\u5907\u8D85\u65F6\uFF0C\u53EF\u91CD\u8BD5\u5E76\u7EE7\u7EED\u5DF2\u4E0B\u8F7D\u7684\u5185\u5BB9\u3002",
|
|
9826
9969
|
wxRuntimeAborted: "\u7EC4\u4EF6\u51C6\u5907\u5DF2\u4E2D\u6B62\uFF0C\u53EF\u91CD\u8BD5\u7EE7\u7EED\u4E0B\u8F7D\u3002",
|
|
9827
9970
|
wxRuntimeNetwork: "\u4E0B\u8F7D\u672A\u5B8C\u6210\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\uFF1B\u5DF2\u4E0B\u8F7D\u7684\u5185\u5BB9\u4F1A\u4FDD\u7559\u3002",
|
|
9971
|
+
wxRuntimeSelfTestTimeout: "\u7B49\u5F85\u5FAE\u4FE1\u7EC4\u4EF6\u9996\u6B21\u542F\u52A8\u8D85\u65F6\u3002\u8BF7\u7A0D\u5019\uFF0C\u518D\u91CD\u8BD5\u3002",
|
|
9828
9972
|
wxFooterSyncing: "\u540C\u6B65\u4E2D",
|
|
9829
9973
|
wxFooterDone: "\u5DF2\u540C\u6B65",
|
|
9830
9974
|
wxFooterPartial: "\u90E8\u5206\u540C\u6B65",
|
|
@@ -9916,11 +10060,11 @@ var zh = {
|
|
|
9916
10060
|
replyRunning: "\u6B63\u5728\u751F\u6210",
|
|
9917
10061
|
replyFailed: "\u751F\u6210\u672A\u5B8C\u6210",
|
|
9918
10062
|
replyNoSend: "\u672C\u8F6E\u65E0\u9700\u53D1\u9001",
|
|
9919
|
-
replyManual: "\
|
|
10063
|
+
replyManual: "\u5F85\u751F\u6210",
|
|
9920
10064
|
replyNotNeeded: "\u5F53\u524D\u65E0\u9700\u56DE\u590D",
|
|
9921
10065
|
replyNeedsMedia: "\u9700\u5148\u786E\u8BA4\u56FE\u7247\u6216\u8BED\u97F3\u5185\u5BB9",
|
|
9922
10066
|
replyAutoHint: "\u5DF2\u5F00\u542F\u65B0\u6D88\u606F\u8D77\u8349\uFF1A\u6240\u6709\u5DF2\u540C\u6B65\u4F1A\u8BDD\u7684\u65B0\u6587\u5B57\u3001\u8868\u60C5\u3001\u8BED\u97F3\u548C\u9644\u4EF6\u4F1A\u89E6\u53D1\u8349\u7A3F\u3002\u5386\u53F2\u6D88\u606F\u53EF\u624B\u52A8\u751F\u6210\u3002",
|
|
9923
|
-
replyUnboundHint: "\
|
|
10067
|
+
replyUnboundHint: "\u672A\u7ED1\u5B9A CRM\uFF0C\u672C\u8F6E\u6839\u636E\u5FAE\u4FE1\u804A\u5929\u548C\u53EF\u7528\u4EA7\u54C1\u8D44\u6599\u8D77\u8349\u3002",
|
|
9924
10068
|
replyHandledHint: "\u6700\u8FD1\u4E00\u6761\u4E3A\u5DF1\u65B9\u6D88\u606F\uFF0C\u6216\u6B64\u8F6E\u5DF2\u6807\u8BB0\u5904\u7406\u3002\u9700\u8981\u7EE7\u7EED\u8DDF\u8FDB\u65F6\u53EF\u624B\u52A8\u751F\u6210\u3002",
|
|
9925
10069
|
awaitingDraft: "\u5F85\u751F\u6210\u56DE\u590D",
|
|
9926
10070
|
simulateDelivery: "\u8BB0\u5165\u6A21\u62DF\u5BF9\u8BDD",
|
|
@@ -10005,6 +10149,28 @@ var zh = {
|
|
|
10005
10149
|
contextHint: "\u57FA\u4E8E\u5F53\u524D\u793A\u4F8B\u804A\u5929\u6574\u7406"
|
|
10006
10150
|
};
|
|
10007
10151
|
var en = {
|
|
10152
|
+
companyIdentity: "Company identity",
|
|
10153
|
+
companyBind: "Link DingTalk",
|
|
10154
|
+
companyAlias: "Display name",
|
|
10155
|
+
companyPosition: "Job title",
|
|
10156
|
+
companyOrganization: "Company",
|
|
10157
|
+
companyDepartment: "Department",
|
|
10158
|
+
companyModelReady: "Company DeepSeek Flash is available",
|
|
10159
|
+
companyModelUnavailable: "Identity verified. The company model is temporarily unavailable.",
|
|
10160
|
+
companyUnbind: "Unlink account",
|
|
10161
|
+
companyCancel: "Cancel linking",
|
|
10162
|
+
companyAwaiting: "Open the verification page and follow the DingTalk instructions.",
|
|
10163
|
+
companyPairingCode: "Pairing code",
|
|
10164
|
+
companyVerify: "Open DingTalk verification",
|
|
10165
|
+
companyHint: "Wanji employees can link their own DingTalk account to use the company model.",
|
|
10166
|
+
companyIneligible: "We could not verify this account\u2019s Wanji membership.",
|
|
10167
|
+
companyAliasOptional: "Display name (optional)",
|
|
10168
|
+
companyPhoneOptional: "Mobile number (optional)",
|
|
10169
|
+
companyContinue: "Start DingTalk verification",
|
|
10170
|
+
companyRetryHint: "Company identity could not be verified. Try again.",
|
|
10171
|
+
companyChecking: "Checking company identity\u2026",
|
|
10172
|
+
companyUnavailable: "The company identity service is not connected.",
|
|
10173
|
+
companyRetry: "Try again",
|
|
10008
10174
|
wxImageActualSize: "Actual size",
|
|
10009
10175
|
wxVideoMessage: "WeChat video",
|
|
10010
10176
|
wxVideoLoad: "Load video",
|
|
@@ -10124,6 +10290,7 @@ var en = {
|
|
|
10124
10290
|
wxRuntimeTimeout: "Component preparation timed out. Retry to resume the download.",
|
|
10125
10291
|
wxRuntimeAborted: "Component preparation stopped. Retry to resume the download.",
|
|
10126
10292
|
wxRuntimeNetwork: "The download did not finish. Check your connection and retry; partial data is retained.",
|
|
10293
|
+
wxRuntimeSelfTestTimeout: "Timed out waiting for the WeChat component to start. Wait a moment and try again.",
|
|
10127
10294
|
wxFooterSyncing: "Syncing",
|
|
10128
10295
|
wxFooterDone: "Synced",
|
|
10129
10296
|
wxFooterPartial: "Partial sync",
|
|
@@ -10215,11 +10382,11 @@ var en = {
|
|
|
10215
10382
|
replyRunning: "Generating",
|
|
10216
10383
|
replyFailed: "Generation incomplete",
|
|
10217
10384
|
replyNoSend: "No message needed",
|
|
10218
|
-
replyManual: "
|
|
10385
|
+
replyManual: "Ready to generate",
|
|
10219
10386
|
replyNotNeeded: "No reply needed now",
|
|
10220
10387
|
replyNeedsMedia: "Confirm image or voice content first",
|
|
10221
10388
|
replyAutoHint: "New text, stickers, voice messages and attachments in synced conversations trigger a draft. History remains manual.",
|
|
10222
|
-
replyUnboundHint: "
|
|
10389
|
+
replyUnboundHint: "Drafts use this WeChat conversation and available product references when CRM is unlinked.",
|
|
10223
10390
|
replyHandledHint: "The latest message is outgoing or this turn is handled. Generate manually when further follow-up is needed.",
|
|
10224
10391
|
awaitingDraft: "Ready to draft",
|
|
10225
10392
|
simulateDelivery: "Record as simulated sent message",
|
|
@@ -11913,6 +12080,15 @@ function terminalGenerationFailure(response, afterSeq, throughSeq) {
|
|
|
11913
12080
|
case "QUOTA":
|
|
11914
12081
|
case "ACCOUNT_QUOTA":
|
|
11915
12082
|
return "\u9500\u552E\u6A21\u578B\u989D\u5EA6\u4E0D\u8DB3\uFF0C\u8BF7\u68C0\u67E5\u6A21\u578B\u901A\u9053\u7684\u53EF\u7528\u989D\u5EA6\u540E\u91CD\u8BD5\u3002";
|
|
12083
|
+
case "ACCOUNT_SIGN_IN_REQUIRED":
|
|
12084
|
+
case "ACCOUNT_TOKEN_INVALID":
|
|
12085
|
+
return "\u9500\u552E\u6A21\u578B\u7684\u8D26\u53F7\u9700\u8981\u91CD\u65B0\u767B\u5F55\u3002\u8BF7\u5728\u4E07\u673A\u5927\u8111\u91CD\u65B0\u767B\u5F55\u6A21\u578B\u8D26\u53F7\u540E\u91CD\u8BD5\u3002";
|
|
12086
|
+
case "NO_ADAPTER":
|
|
12087
|
+
case "UNKNOWN_MODEL":
|
|
12088
|
+
case "MODEL_UNSUPPORTED":
|
|
12089
|
+
return "\u9500\u552E\u6A21\u578B\u901A\u9053\u65E0\u6CD5\u4F7F\u7528 DeepSeek Flash\u3002\u8BF7\u68C0\u67E5\u4E07\u673A\u5927\u8111\u4E2D\u8BE5\u6A21\u578B\u548C\u901A\u9053\u7684\u914D\u7F6E\u3002";
|
|
12090
|
+
case "NO_CREDENTIAL_STORE":
|
|
12091
|
+
return "\u5F53\u524D\u4E07\u673A\u5927\u8111\u65E0\u6CD5\u8BFB\u53D6\u6A21\u578B\u51ED\u636E\uFF0C\u8BF7\u68C0\u67E5\u6A21\u578B\u767B\u5F55\u6216 API Key \u8BBE\u7F6E\u3002";
|
|
11916
12092
|
case "MISSING_CREDENTIAL":
|
|
11917
12093
|
return "\u9500\u552E\u6A21\u578B\u901A\u9053\u5C1A\u672A\u914D\u7F6E API Key\uFF0C\u8BF7\u914D\u7F6E\u540E\u91CD\u8BD5\u3002";
|
|
11918
12094
|
case "INVALID_CREDENTIAL":
|
|
@@ -12039,6 +12215,18 @@ async function generateReply(rpc, workspaceId, contact, latest, signal, options
|
|
|
12039
12215
|
let created;
|
|
12040
12216
|
if (knowledge.generationSessionsSupported) {
|
|
12041
12217
|
const result = await invoke("/api", "wanji-sales-generation/session", { operation: "create", workspaceId, title, ...generationLease ? { leaseId: generationLease } : {} });
|
|
12218
|
+
if (object2(result) && result.ok === false && object2(result.error)) {
|
|
12219
|
+
switch (result.error.code) {
|
|
12220
|
+
case "GENERATION_COMPANY_MODEL_UNAVAILABLE":
|
|
12221
|
+
throw Error("\u516C\u53F8\u9500\u552E\u8EAB\u4EFD\u5DF2\u9A8C\u8BC1\uFF0C\u6A21\u578B\u901A\u9053\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6216\u7A0D\u540E\u91CD\u8BD5\u3002");
|
|
12222
|
+
case "GENERATION_MODEL_NOT_CONFIGURED":
|
|
12223
|
+
throw Error("\u9500\u552E\u6A21\u578B\u5C1A\u672A\u914D\u7F6E\u3002\u8BF7\u5728\u4E07\u673A\u5927\u8111\u8BBE\u7F6E\u4E2D\u9009\u7528\u5DF2\u6388\u6743\u7684 DeepSeek Flash\uFF08deepseek-v4.1-flash\uFF09\uFF0C\u518D\u751F\u6210\u56DE\u590D\u3002");
|
|
12224
|
+
case "GENERATION_MODEL_INCOMPATIBLE":
|
|
12225
|
+
throw Error("\u5F53\u524D\u9500\u552E\u6A21\u578B\u65E0\u6CD5\u7528\u4E8E\u8D77\u8349\u3002\u8BF7\u5728\u4E07\u673A\u5927\u8111\u8BBE\u7F6E\u4E2D\u9009\u62E9 DeepSeek Flash\uFF08deepseek-v4.1-flash\uFF09\u3002\u6709\u72EC\u7ACB\u9500\u552E\u6A21\u578B\u914D\u7F6E\u65F6\uFF0C\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5\u8BE5\u914D\u7F6E\u3002");
|
|
12226
|
+
case "GENERATION_WORKSPACE":
|
|
12227
|
+
throw Error("\u9500\u552E\u52A9\u624B\u627E\u4E0D\u5230\u672C\u8F6E\u5DE5\u4F5C\u533A\u3002\u8BF7\u91CD\u65B0\u6253\u5F00\u9500\u552E\u52A9\u624B\uFF0C\u7B49\u5F85\u5DE5\u4F5C\u533A\u8F7D\u5165\u540E\u91CD\u8BD5\u3002");
|
|
12228
|
+
}
|
|
12229
|
+
}
|
|
12042
12230
|
if (!object2(result) || result.ok !== true || !object2(result.value) || typeof result.value.leaseId !== "string" || generationLease && generationLease !== result.value.leaseId) throw Error("\u672C\u8F6E\u4E34\u65F6\u9500\u552E\u4F1A\u8BDD\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u8FDE\u63A5\u3002");
|
|
12043
12231
|
generationLease = result.value.leaseId;
|
|
12044
12232
|
created = result.value;
|
|
@@ -12601,7 +12789,7 @@ function mountSales(ctx, Page, Icon) {
|
|
|
12601
12789
|
name: "main",
|
|
12602
12790
|
key: PANEL_ID,
|
|
12603
12791
|
locale: NS,
|
|
12604
|
-
inject: () => ({ hooks: { sales: store, workspaces, knowledge, wechat, update: updater }, updater, runDelivery, updateFormDirty: (dirty) => updates.form(dirty), knowledge: { refresh: knowledge.refresh, setQuery: knowledge.setQuery, setMaxResults: knowledge.setMaxResults, search: knowledge.search, select: knowledge.select, rate: knowledge.rate, runCases: knowledge.runCases, cancel: knowledge.cancel, loadRuns: knowledge.loadRuns, loadRun: knowledge.loadRun, compareRuns: knowledge.compareRuns, labelRequest: knowledge.labelRequest, loadDatasets: knowledge.loadDatasets, selectDataset: knowledge.selectDataset }, wechat, setMode: (mode, workspaceId) => {
|
|
12792
|
+
inject: () => ({ hooks: { sales: store, workspaces, knowledge, wechat, update: updater }, companyIdentityRpc: ctx.connection.rpc, updater, runDelivery, updateFormDirty: (dirty) => updates.form(dirty), knowledge: { refresh: knowledge.refresh, setQuery: knowledge.setQuery, setMaxResults: knowledge.setMaxResults, search: knowledge.search, select: knowledge.select, rate: knowledge.rate, runCases: knowledge.runCases, cancel: knowledge.cancel, loadRuns: knowledge.loadRuns, loadRun: knowledge.loadRun, compareRuns: knowledge.compareRuns, labelRequest: knowledge.labelRequest, loadDatasets: knowledge.loadDatasets, selectDataset: knowledge.selectDataset }, wechat, setMode: (mode, workspaceId) => {
|
|
12605
12793
|
if (updates.frozen || store.workspace() === workspaceId && store.getSnapshot().mode === mode) return;
|
|
12606
12794
|
cancelWaiting();
|
|
12607
12795
|
autoReply.observe("", []);
|
|
@@ -12819,43 +13007,43 @@ function displayTime(value, detailed = false) {
|
|
|
12819
13007
|
return (date.toDateString() === now.toDateString() ? timeFormats.clock : date.getFullYear() === now.getFullYear() ? timeFormats.date : timeFormats.year).format(date);
|
|
12820
13008
|
}
|
|
12821
13009
|
function Glyph({ name, size = 18 }) {
|
|
12822
|
-
return /* @__PURE__ */
|
|
13010
|
+
return /* @__PURE__ */ import_react12.default.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true" }, /* @__PURE__ */ import_react12.default.createElement("path", { d: paths[name] }));
|
|
12823
13011
|
}
|
|
12824
13012
|
function SalesIcon({ size = 18 }) {
|
|
12825
|
-
return /* @__PURE__ */
|
|
13013
|
+
return /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "chat", size });
|
|
12826
13014
|
}
|
|
12827
13015
|
var EMPTY_CONTACT = { id: "", name: "", initials: "", segment: "", time: "", preview: "", status: "pending", unread: 0, product: "", budget: "", moneyAmounts: [], tags: [], facts: [], messages: [], candidates: [] };
|
|
12828
|
-
function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConversation, refreshWorkspaces, wechat, useWechat, setMode, bindWechat, useUpdate, updater, updateFormDirty, runDelivery }) {
|
|
13016
|
+
function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConversation, refreshWorkspaces, wechat, useWechat, setMode, bindWechat, useUpdate, updater, updateFormDirty, runDelivery, companyIdentityRpc }) {
|
|
12829
13017
|
const update = useUpdate?.((s) => s);
|
|
12830
13018
|
const frozen = update?.preparing ?? false;
|
|
12831
13019
|
const state = useSales((snapshot) => snapshot);
|
|
12832
13020
|
const view = useWechat ? useWechat((s) => s) : { messages: [], hasMore: false };
|
|
12833
13021
|
const workspaceState = useWorkspaces((snapshot) => snapshot);
|
|
12834
13022
|
const workspaces = workspaceState.items;
|
|
12835
|
-
(0,
|
|
13023
|
+
(0, import_react12.useEffect)(() => {
|
|
12836
13024
|
void refreshWorkspaces();
|
|
12837
13025
|
}, [refreshWorkspaces]);
|
|
12838
13026
|
const selectedWorkspace = selectSalesWorkspace(workspaces, view.status?.workspaceId);
|
|
12839
|
-
(0,
|
|
13027
|
+
(0, import_react12.useEffect)(() => {
|
|
12840
13028
|
if (!frozen) setMode?.("real", selectedWorkspace);
|
|
12841
13029
|
}, [selectedWorkspace, setMode, frozen]);
|
|
12842
|
-
const [query, setQuery] = (0,
|
|
12843
|
-
const [sort, setSort] = (0,
|
|
12844
|
-
const [filter, setFilter] = (0,
|
|
12845
|
-
const [showChat, setShowChat] = (0,
|
|
12846
|
-
const [profileVisibility, setProfileVisibility] = (0,
|
|
12847
|
-
const profileId = (0,
|
|
12848
|
-
const openProfileButton = (0,
|
|
12849
|
-
const closeProfileButton = (0,
|
|
12850
|
-
(0,
|
|
13030
|
+
const [query, setQuery] = (0, import_react12.useState)("");
|
|
13031
|
+
const [sort, setSort] = (0, import_react12.useState)("recent");
|
|
13032
|
+
const [filter, setFilter] = (0, import_react12.useState)("all");
|
|
13033
|
+
const [showChat, setShowChat] = (0, import_react12.useState)(false);
|
|
13034
|
+
const [profileVisibility, setProfileVisibility] = (0, import_react12.useState)("default");
|
|
13035
|
+
const profileId = (0, import_react12.useId)();
|
|
13036
|
+
const openProfileButton = (0, import_react12.useRef)(null);
|
|
13037
|
+
const closeProfileButton = (0, import_react12.useRef)(null);
|
|
13038
|
+
(0, import_react12.useEffect)(() => {
|
|
12851
13039
|
if (profileVisibility === "open") closeProfileButton.current?.focus({ preventScroll: true });
|
|
12852
13040
|
if (profileVisibility === "closed") openProfileButton.current?.focus({ preventScroll: true });
|
|
12853
13041
|
}, [profileVisibility]);
|
|
12854
|
-
const [notice, setNotice] = (0,
|
|
12855
|
-
const [copyResult, setCopyResult] = (0,
|
|
13042
|
+
const [notice, setNotice] = (0, import_react12.useState)("");
|
|
13043
|
+
const [copyResult, setCopyResult] = (0, import_react12.useState)(null);
|
|
12856
13044
|
const contact = state.contacts.find((c) => c.id === state.selectedId) ?? state.contacts[0] ?? EMPTY_CONTACT;
|
|
12857
13045
|
const syncRevision = contact.wechat ? view.status?.revision : void 0;
|
|
12858
|
-
(0,
|
|
13046
|
+
(0, import_react12.useEffect)(() => {
|
|
12859
13047
|
if (!frozen && contact.id) void loadConversation(selectedWorkspace, contact.id).catch(() => {
|
|
12860
13048
|
});
|
|
12861
13049
|
}, [loadConversation, selectedWorkspace, contact.id, contact.crm?.conversationId, contact.crm?.customerPhone, contact.crm?.salesName, contact.crm?.salesPhone, contact.wechat?.version, syncRevision, frozen]);
|
|
@@ -12864,16 +13052,16 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
|
|
|
12864
13052
|
const generation = state.generations[contact.id];
|
|
12865
13053
|
const running = generation?.status === "running";
|
|
12866
13054
|
const canCopy = !frozen && Boolean(draft.trim()) && !generation?.result?.no_send;
|
|
12867
|
-
const [delivery, setDelivery] = (0,
|
|
12868
|
-
const activeChat = (0,
|
|
13055
|
+
const [delivery, setDelivery] = (0, import_react12.useState)({ contactId: "", lease: "", enabled: false, available: false, baseline: "", status: "idle" });
|
|
13056
|
+
const activeChat = (0, import_react12.useRef)("");
|
|
12869
13057
|
activeChat.current = JSON.stringify([selectedWorkspace, contact.id]);
|
|
12870
|
-
const latestMessage = (0,
|
|
13058
|
+
const latestMessage = (0, import_react12.useRef)("");
|
|
12871
13059
|
latestMessage.current = contact.wechat?.latestInbound?.id ?? "";
|
|
12872
|
-
const updateFrozen = (0,
|
|
13060
|
+
const updateFrozen = (0, import_react12.useRef)(frozen);
|
|
12873
13061
|
updateFrozen.current = frozen;
|
|
12874
|
-
const [approval, setApproval] = (0,
|
|
12875
|
-
const [answeringApproval, setAnsweringApproval] = (0,
|
|
12876
|
-
const [checkingSend, setCheckingSend] = (0,
|
|
13062
|
+
const [approval, setApproval] = (0, import_react12.useState)();
|
|
13063
|
+
const [answeringApproval, setAnsweringApproval] = (0, import_react12.useState)(false);
|
|
13064
|
+
const [checkingSend, setCheckingSend] = (0, import_react12.useState)(false);
|
|
12877
13065
|
const checkSendingEnvironment = async () => {
|
|
12878
13066
|
if (!wechatSendingEnabled || frozen || !wechat || !runDelivery || checkingSend) return;
|
|
12879
13067
|
const scope = activeChat.current;
|
|
@@ -12888,8 +13076,8 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
|
|
|
12888
13076
|
setCheckingSend(false);
|
|
12889
13077
|
}
|
|
12890
13078
|
};
|
|
12891
|
-
const deliveryAttempts = (0,
|
|
12892
|
-
(0,
|
|
13079
|
+
const deliveryAttempts = (0, import_react12.useRef)(/* @__PURE__ */ new Set());
|
|
13080
|
+
(0, import_react12.useEffect)(() => {
|
|
12893
13081
|
if (!wechatSendingEnabled || !wechat || !contact.wechat) return;
|
|
12894
13082
|
let active = true, lease = "", opened = false;
|
|
12895
13083
|
setApproval(void 0);
|
|
@@ -12934,7 +13122,7 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
|
|
|
12934
13122
|
const result = await wechat.deliveryOpen(contact.id, enabled);
|
|
12935
13123
|
setDelivery({ contactId: contact.id, ...result, enabled, baseline: contact.wechat?.latestInbound?.id ?? "", status: "idle" });
|
|
12936
13124
|
};
|
|
12937
|
-
(0,
|
|
13125
|
+
(0, import_react12.useEffect)(() => {
|
|
12938
13126
|
if (!wechatSendingEnabled || !wechat || !delivery.lease) return;
|
|
12939
13127
|
const timer = setInterval(() => {
|
|
12940
13128
|
void wechat.deliveryTouch(delivery.lease).catch(() => setDelivery((d) => ({ ...d, enabled: false, status: "stopped" })));
|
|
@@ -12979,7 +13167,7 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
|
|
|
12979
13167
|
setNotice(error instanceof Error ? error.message : String(error));
|
|
12980
13168
|
}
|
|
12981
13169
|
};
|
|
12982
|
-
(0,
|
|
13170
|
+
(0, import_react12.useEffect)(() => {
|
|
12983
13171
|
const messageId = contact.wechat?.latestInbound?.id;
|
|
12984
13172
|
if (!wechatSendingEnabled || frozen || !delivery.enabled || delivery.contactId !== contact.id || !messageId || messageId === delivery.baseline || generation?.status !== "done" || generation.result?.no_send || !draft.trim() || state.draftKinds[contact.id] !== "agent" || draft !== generation.result?.wechat || state.stale?.[contact.id]) return;
|
|
12985
13173
|
const key = JSON.stringify([selectedWorkspace, contact.id, messageId]);
|
|
@@ -12990,7 +13178,7 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
|
|
|
12990
13178
|
const replyView = replyPresentation(state, contact);
|
|
12991
13179
|
const shownMessages = contact.wechat ? view.contactId === contact.id ? view.messages : [] : contact.messages;
|
|
12992
13180
|
const reading = useChatScroll(JSON.stringify([selectedWorkspace, contact.wechat?.accountId, contact.id]), JSON.stringify(shownMessages.map((message) => message.id)));
|
|
12993
|
-
(0,
|
|
13181
|
+
(0, import_react12.useEffect)(() => {
|
|
12994
13182
|
if (reading.expired) setNotice(t("wxReadingPositionExpired"));
|
|
12995
13183
|
}, [reading.expired, t]);
|
|
12996
13184
|
const select = (id) => {
|
|
@@ -13014,43 +13202,43 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
|
|
|
13014
13202
|
const syncProgress = presentation.blocked || view.status?.phase === "authorizing" ? void 0 : view.status?.progress;
|
|
13015
13203
|
const syncPercent = wechatProgressPercent({ progress: syncProgress });
|
|
13016
13204
|
const syncLabel = view.error ? "wxProgressUnavailable" : view.status?.phase === "error" ? "wxProgressFailed" : view.status?.phase === "paused" ? "wxPaused" : syncActive ? "wxIncremental" : "wxRoundComplete";
|
|
13017
|
-
return /* @__PURE__ */
|
|
13205
|
+
return /* @__PURE__ */ import_react12.default.createElement("section", { className: "ws-page", "aria-label": t("title") }, /* @__PURE__ */ import_react12.default.createElement("style", null, styles + updateStyles + companyIdentityStyles), /* @__PURE__ */ import_react12.default.createElement("header", { className: "ws-header" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-heading" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-brand" }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "chat", size: 22 })), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-title-line" }, /* @__PURE__ */ import_react12.default.createElement("h1", null, t("title")), /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-demo-label" }, t("wxConnected"))), /* @__PURE__ */ import_react12.default.createElement("p", null, t("subtitle")))), (companyIdentityRpc || updater && update) && /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-header-actions" }, companyIdentityRpc && /* @__PURE__ */ import_react12.default.createElement(CompanyIdentityPanel, { rpc: companyIdentityRpc, t, disabled: frozen }), updater && update && /* @__PURE__ */ import_react12.default.createElement(UpdatePanel, { client: updater, view: update, t }))), frozen && /* @__PURE__ */ import_react12.default.createElement("p", { role: "status", className: "ws-update-freeze" }, t("updateFreeze")), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-inline-sync" }, wechat && /* @__PURE__ */ import_react12.default.createElement(SyncPanel, { client: wechat, t, view, workspaceId: selectedWorkspace }), !contact.id && workspaceState.error && /* @__PURE__ */ import_react12.default.createElement("span", { role: "status" }, workspaceState.error)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-body", "data-empty": !contact.id, "data-show-chat": showChat, "data-profile": profileVisibility }, /* @__PURE__ */ import_react12.default.createElement("aside", { className: "ws-contacts", "aria-label": t("customers") }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-contacts-head" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-intent-sortline" }, /* @__PURE__ */ import_react12.default.createElement("h2", null, t("customers")), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-intent-sort-control" }, /* @__PURE__ */ import_react12.default.createElement("select", { className: "ws-intent-sort", "aria-label": t("intentSort"), value: sort, onChange: (event) => setSort(event.currentTarget.value === "intent" ? "intent" : "recent") }, /* @__PURE__ */ import_react12.default.createElement("option", { value: "recent" }, t("intentSortRecent")), /* @__PURE__ */ import_react12.default.createElement("option", { value: "intent" }, t("intentSortHigh"))), /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "chevron", size: 12 }))), /* @__PURE__ */ import_react12.default.createElement("label", { className: "ws-search" }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "search", size: 15 }), /* @__PURE__ */ import_react12.default.createElement("input", { name: "sales-search", autoComplete: "off", "aria-label": t("search"), placeholder: t("search"), value: query, onChange: (e) => setQuery(e.target.value) })), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-filters", role: "group", "aria-label": t("customers") }, ["all", "pending", "handled"].map((value) => /* @__PURE__ */ import_react12.default.createElement("button", { key: value, type: "button", "aria-pressed": filter === value, onClick: () => setFilter(value) }, t(value), /* @__PURE__ */ import_react12.default.createElement("span", null, value === "all" ? state.contacts.length : value === "pending" ? pending : state.contacts.length - pending))))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-contact-list" }, contacts.map((c) => /* @__PURE__ */ import_react12.default.createElement("button", { key: c.id, className: `ws-contact ${c.id === contact.id ? "is-selected" : ""}`, "aria-pressed": c.id === contact.id, onClick: () => select(c.id) }, /* @__PURE__ */ import_react12.default.createElement(WechatAvatar, { client: wechat, scope: JSON.stringify([selectedWorkspace, c.wechat?.accountId]), owner: c.wechat?.chatKey ?? c.id, mediaId: c.wechat?.avatarId, fallback: c.initials }), /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-contact-content" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-contact-line" }, /* @__PURE__ */ import_react12.default.createElement("strong", { title: c.name }, c.name), /* @__PURE__ */ import_react12.default.createElement("time", { dateTime: c.time, title: c.time }, displayTime(c.time))), /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-preview" }, c.wechat && c.preview === "[image]" ? t("wxImageListPreview") : c.preview), c.wechat && /* @__PURE__ */ import_react12.default.createElement(IntentBadge, { intent: c.intent, t })))), !contacts.length && /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-empty" }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "search", size: 26 }), /* @__PURE__ */ import_react12.default.createElement("p", null, t(state.contacts.length ? "noResults" : presentation.emptyKey)), state.contacts.length > 0 && /* @__PURE__ */ import_react12.default.createElement("button", { className: "ws-text-button", onClick: () => {
|
|
13018
13206
|
setQuery("");
|
|
13019
13207
|
setFilter("all");
|
|
13020
|
-
} }, t("clearSearch")))), /* @__PURE__ */
|
|
13208
|
+
} }, t("clearSearch")))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-sync" }, state.contacts.length > 0 ? /* @__PURE__ */ import_react12.default.createElement(SyncFooter, { view, t }) : /* @__PURE__ */ import_react12.default.createElement("span", null, /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-dot" }), t("wxLocalHistory")))), /* @__PURE__ */ import_react12.default.createElement("main", { className: "ws-conversation" }, !contact.id ? /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-conversation-empty" }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "chat", size: 34 }), /* @__PURE__ */ import_react12.default.createElement("h2", null, t("wxRealTitle")), /* @__PURE__ */ import_react12.default.createElement("p", null, syncActive || syncPercent !== void 0 ? /* @__PURE__ */ import_react12.default.createElement(SyncActivity, { active: syncActive, percent: syncPercent }, t(syncActive ? "wxSyncingHint" : syncLabel)) : t(presentation.blocked ? "wxAwaitConnectionHistory" : presentation.hintKey ?? "wxSelectChat")), (syncActive || syncPercent !== void 0) && /* @__PURE__ */ import_react12.default.createElement(SyncProgressTrack, { progress: syncProgress, active: syncActive, t })) : /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-conversation-head" }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "ws-icon-button ws-mobile-back", "aria-label": t("contactsBack"), onClick: () => setShowChat(false) }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "arrow" })), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-person-title" }, /* @__PURE__ */ import_react12.default.createElement("h2", null, contact.name, !contact.wechat && /* @__PURE__ */ import_react12.default.createElement("span", null, contact.segment)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-person-meta" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-person-source" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-dot", "aria-hidden": "true" }), t("wechat"), /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-separator", "aria-hidden": "true" }, "/"), contact.wechat ? contact.crm ? t("wxBound") : t("wxUnbound") : t("sampleContact")), contact.wechat && /* @__PURE__ */ import_react12.default.createElement(IntentDetails, { key: contact.id, intent: contact.intent, t }))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-conversation-actions" }, /* @__PURE__ */ import_react12.default.createElement("button", { className: "ws-button ws-handle", disabled: frozen || contact.status === "handled", onClick: () => {
|
|
13021
13209
|
dispatch({ type: "handled", id: contact.id });
|
|
13022
13210
|
setNotice(t(contact.wechat ? "wxHandled" : "handledDone"));
|
|
13023
|
-
} }, /* @__PURE__ */
|
|
13211
|
+
} }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "check", size: 15 }), contact.status === "handled" ? t("handled") : t("markHandled")), /* @__PURE__ */ import_react12.default.createElement("button", { type: "button", className: "ws-button ws-profile-toggle", ref: openProfileButton, "aria-label": t("expand"), "aria-controls": profileId, "aria-expanded": profileVisibility === "open", onClick: () => setProfileVisibility("open") }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "user", size: 15 }), /* @__PURE__ */ import_react12.default.createElement("span", null, t("profile"))))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-history-wrap" }, /* @__PURE__ */ import_react12.default.createElement("div", { ref: reading.viewport, onScroll: reading.onScroll, className: "ws-messages", role: "region", tabIndex: 0, "aria-label": t("conversation") }, /* @__PURE__ */ import_react12.default.createElement("div", { ref: reading.content }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-date" }, /* @__PURE__ */ import_react12.default.createElement("span", null, contact.wechat ? t("wxHistory") : t("today"))), contact.wechat && wechat && view.contactId === contact.id ? /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, view.hasMore && /* @__PURE__ */ import_react12.default.createElement("button", { className: "ws-button ws-earlier", onClick: () => void wechat.messages(contact.id, true).catch((e) => setNotice(e.message)) }, t("wxEarlier")), view.messages.map((m) => /* @__PURE__ */ import_react12.default.createElement("div", { key: m.id, "data-message-id": m.id, className: `ws-message ${m.direction === "outbound" ? "ws-out" : ""}` }, /* @__PURE__ */ import_react12.default.createElement(WechatAvatar, { client: wechat, scope: JSON.stringify([selectedWorkspace, contact.wechat.accountId]), owner: m.direction === "outbound" ? contact.wechat.accountId : contact.wechat.chatKey, mediaId: m.direction === "outbound" ? contact.wechat.selfAvatarId : contact.wechat.avatarId, fallback: m.direction === "outbound" ? t("user") : contact.initials, className: "ws-message-avatar" }), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-message-content" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-message-meta" }, /* @__PURE__ */ import_react12.default.createElement("span", null, m.direction === "inbound" ? contact.name : m.direction === "outbound" ? t("user") : t("wxSystem")), /* @__PURE__ */ import_react12.default.createElement("time", { dateTime: m.sentAt, title: m.sentAt }, displayTime(m.sentAt, true))), /* @__PURE__ */ import_react12.default.createElement("div", { className: `ws-bubble${m.kind === "voice" || m.kind === "audio" ? " ws-voice-bubble" : ""}` }, /* @__PURE__ */ import_react12.default.createElement(WechatMessageBody, { message: m, client: wechat, revision: view.status?.revision, t })))))) : contact.messages.map((message) => /* @__PURE__ */ import_react12.default.createElement("div", { key: message.id, "data-message-id": message.id, className: `ws-message ${message.direction === "out" ? "ws-out" : ""}` }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-avatar ws-message-avatar" }, message.direction === "out" ? t("user") : contact.initials), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-message-content" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-message-meta" }, /* @__PURE__ */ import_react12.default.createElement("span", null, message.direction === "out" ? t("user") : contact.name), /* @__PURE__ */ import_react12.default.createElement("time", null, message.time)), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-bubble" }, message.text)))))), reading.unseen && /* @__PURE__ */ import_react12.default.createElement("button", { type: "button", className: "ws-latest-action", onClick: reading.goToLatest }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-latest-dot", "aria-hidden": "true" }), t("wxNewMessagesLatest"), /* @__PURE__ */ import_react12.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", "aria-hidden": "true" }, /* @__PURE__ */ import_react12.default.createElement("path", { d: "m6 9 6 6 6-6" })))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-replies" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-reply-heading" }, /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "spark", size: 16 }), /* @__PURE__ */ import_react12.default.createElement("h3", null, t("reply")), /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-example-badge" }, t(replyView.key))), /* @__PURE__ */ import_react12.default.createElement("button", { className: "ws-text-button", disabled: frozen || running || !selectedWorkspace || !replyView.canGenerate, onClick: () => {
|
|
13024
13212
|
setCopyResult(null);
|
|
13025
13213
|
setNotice("");
|
|
13026
13214
|
void generate(selectedWorkspace, contact.id);
|
|
13027
|
-
} }, /* @__PURE__ */
|
|
13215
|
+
} }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "spark", size: 14 }), running ? t("generating") : t("generate"))), replyView.hint && /* @__PURE__ */ import_react12.default.createElement("p", { className: "ws-draft-hint" }, t(replyView.hint)), workspaceState.error && /* @__PURE__ */ import_react12.default.createElement("p", { role: "status" }, workspaceState.error), state.stale?.[contact.id] && /* @__PURE__ */ import_react12.default.createElement("p", { role: "status" }, t("wxStale")), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-agent-status", role: "status", "aria-live": "polite" }, running ? t(generation.progress ? generationStageLabels[generation.progress.stage] : "generatingNote") : generation?.status === "error" ? generation.error : generation?.result?.no_send ? t("stopNotice") : ""), running && generation.progress?.preview?.trim() && /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-stream-preview", role: "region", "aria-label": t("generationPreview"), "aria-busy": "true" }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-stream-preview-heading" }, /* @__PURE__ */ import_react12.default.createElement("strong", null, t("generationPreview")), /* @__PURE__ */ import_react12.default.createElement("span", null, t("generationPreviewPending"))), /* @__PURE__ */ import_react12.default.createElement("p", { tabIndex: 0 }, generation.progress.preview), /* @__PURE__ */ import_react12.default.createElement("small", null, t("generationPreviewNote"))), contact.customerContext?.state === "unavailable" && contact.customerContext.workspaceId === selectedWorkspace && /* @__PURE__ */ import_react12.default.createElement("p", { role: "status" }, t("customerContextUnavailable")), generation?.result && /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-agent-analysis" }, /* @__PURE__ */ import_react12.default.createElement("strong", null, t("judgment")), /* @__PURE__ */ import_react12.default.createElement("p", null, generation.result.judgment), /* @__PURE__ */ import_react12.default.createElement("strong", null, t("nextStep")), /* @__PURE__ */ import_react12.default.createElement("p", null, generation.result.next_step), !generation.applied && /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement("p", null, t("preservedEdit")), /* @__PURE__ */ import_react12.default.createElement("button", { className: "ws-button", disabled: frozen, onClick: () => dispatch({ type: "apply-generated", id: contact.id }) }, t("applyGenerated")))), wechatSendingEnabled && approval && /* @__PURE__ */ import_react12.default.createElement("div", { role: "region", "aria-label": t("wxAppApproval"), className: "ws-notice" }, /* @__PURE__ */ import_react12.default.createElement("p", null, t("wxAppApprovalNote")), /* @__PURE__ */ import_react12.default.createElement("button", { type: "button", className: "ws-button", disabled: answeringApproval, onClick: () => {
|
|
13028
13216
|
setAnsweringApproval(true);
|
|
13029
13217
|
void wechat?.deliveryApproval(approval.requestId, true).then(() => setApproval(void 0)).catch((e) => setNotice(e.message)).finally(() => setAnsweringApproval(false));
|
|
13030
|
-
} }, t("wxAppAllow")), /* @__PURE__ */
|
|
13218
|
+
} }, t("wxAppAllow")), /* @__PURE__ */ import_react12.default.createElement("button", { type: "button", className: "ws-button", disabled: answeringApproval, onClick: () => {
|
|
13031
13219
|
setAnsweringApproval(true);
|
|
13032
13220
|
void wechat?.deliveryApproval(approval.requestId, false).then(() => setApproval(void 0)).catch((e) => setNotice(e.message)).finally(() => setAnsweringApproval(false));
|
|
13033
|
-
} }, t("wxAppDeny"))), /* @__PURE__ */
|
|
13221
|
+
} }, t("wxAppDeny"))), /* @__PURE__ */ import_react12.default.createElement(ReplyEditor, { key: contact.id, value: draft, t, disabled: frozen, reviewedRequest: generation?.status === "done" && generation.applied ? generation.requestId : void 0, onChange: (text4) => {
|
|
13034
13222
|
dispatch({ type: "edit", id: contact.id, text: text4 });
|
|
13035
13223
|
setCopyResult(null);
|
|
13036
|
-
} }), /* @__PURE__ */
|
|
13224
|
+
} }), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-editor-footer" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "ws-char-count" }, draft.length, " ", t("chars")), /* @__PURE__ */ import_react12.default.createElement("button", { type: "button", className: "ws-button ws-primary", disabled: !canCopy, onClick: () => {
|
|
13037
13225
|
void copy();
|
|
13038
|
-
} }, /* @__PURE__ */
|
|
13226
|
+
} }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: copyResult?.id === contact.id && copyResult.success ? "check" : "copy", size: 15 }), copyResult?.id === contact.id && copyResult.success ? t("copied") : t("copy"))), wechatSendingEnabled && contact.wechat && /* @__PURE__ */ import_react12.default.createElement("p", { role: "status", "aria-live": "polite" }, !delivery.available ? t("wxCuaRequired") : delivery.status === "sending" ? t("wxSending") : delivery.status === "awaiting-receipt" ? t("wxAwaitReceipt") : delivery.status === "sent" ? t("wxSent") : ["unknown", "claimed", "stopped", "blocked"].includes(delivery.status) ? t("wxSendStopped") : t("wxManualNote")), state.historyErrors?.[contact.id] && /* @__PURE__ */ import_react12.default.createElement("p", { role: "status" }, state.historyErrors[contact.id]), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-notice", role: "status" }, copyResult?.id === contact.id && !copyResult.success ? t("copyError") : notice)))), contact.id && /* @__PURE__ */ import_react12.default.createElement("aside", { id: profileId, className: "ws-profile", "aria-label": t("profile") }, /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-profile-head" }, /* @__PURE__ */ import_react12.default.createElement("h2", null, t("profile")), /* @__PURE__ */ import_react12.default.createElement("button", { type: "button", className: "ws-icon-button ws-profile-close", ref: closeProfileButton, "aria-label": t("closeProfile"), title: t("closeProfile"), onClick: () => setProfileVisibility("closed") }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "close", size: 17 }))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-profile-person" }, /* @__PURE__ */ import_react12.default.createElement(WechatAvatar, { client: wechat, scope: JSON.stringify([selectedWorkspace, contact.wechat?.accountId]), owner: contact.wechat?.chatKey ?? contact.id, mediaId: contact.wechat?.avatarId, fallback: contact.initials, className: "ws-profile-avatar" }), /* @__PURE__ */ import_react12.default.createElement("h3", null, contact.name), /* @__PURE__ */ import_react12.default.createElement("p", null, contact.segment), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-tags" }, contact.tags.map((tag) => /* @__PURE__ */ import_react12.default.createElement("span", { key: tag }, tag)))), contact.wechat && bindWechat && /* @__PURE__ */ import_react12.default.createElement(CrmForm, { key: contact.id, contact, t, frozen, dirty: updateFormDirty, bind: (binding) => bindWechat(selectedWorkspace, contact.id, binding) }), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-profile-section" }, /* @__PURE__ */ import_react12.default.createElement("h3", null, t("interest")), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-product" }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "chat", size: 18 }), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("strong", null, contact.product), /* @__PURE__ */ import_react12.default.createElement("p", null, contact.wechat ? t("wxContext") : t("contextHint")))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-budget" }, /* @__PURE__ */ import_react12.default.createElement("span", null, t("budget")), /* @__PURE__ */ import_react12.default.createElement("strong", null, contact.budget))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-profile-section" }, /* @__PURE__ */ import_react12.default.createElement("h3", null, t("facts")), /* @__PURE__ */ import_react12.default.createElement("dl", null, contact.facts.map((fact) => /* @__PURE__ */ import_react12.default.createElement("div", { key: fact.label }, /* @__PURE__ */ import_react12.default.createElement("dt", null, fact.label), /* @__PURE__ */ import_react12.default.createElement("dd", null, fact.value))))), /* @__PURE__ */ import_react12.default.createElement("div", { className: "ws-profile-caption" }, /* @__PURE__ */ import_react12.default.createElement(Glyph, { name: "spark", size: 14 }), /* @__PURE__ */ import_react12.default.createElement("span", null, contact.wechat ? t("wxSources") : t("profileNote"))))));
|
|
13039
13227
|
}
|
|
13040
13228
|
var inject = ["slots", "layout", "locale", "connection", "remote", "remote.session"];
|
|
13041
13229
|
function apply(ctx) {
|
|
13042
13230
|
mountSales(ctx, SalesPage, SalesIcon);
|
|
13043
13231
|
}
|
|
13044
13232
|
function CrmForm({ contact, bind, t, frozen, dirty }) {
|
|
13045
|
-
const [phone, setPhone] = (0,
|
|
13046
|
-
(0,
|
|
13233
|
+
const [phone, setPhone] = (0, import_react12.useState)(""), [sales, setSales] = (0, import_react12.useState)(""), [error, setError] = (0, import_react12.useState)("");
|
|
13234
|
+
(0, import_react12.useEffect)(() => {
|
|
13047
13235
|
dirty?.(!contact.crm && !!(phone || sales));
|
|
13048
13236
|
return () => dirty?.(false);
|
|
13049
13237
|
}, [phone, sales, contact.crm, dirty]);
|
|
13050
|
-
return /* @__PURE__ */
|
|
13238
|
+
return /* @__PURE__ */ import_react12.default.createElement("form", { className: "ws-profile-section", onSubmit: (e) => {
|
|
13051
13239
|
e.preventDefault();
|
|
13052
13240
|
void bind({ conversationId: contact.id, customerPhone: phone.trim(), salesName: sales.trim() }).catch((e2) => setError(e2.message));
|
|
13053
|
-
} }, /* @__PURE__ */
|
|
13241
|
+
} }, /* @__PURE__ */ import_react12.default.createElement("h3", null, t("wxCrmTitle")), contact.crm ? /* @__PURE__ */ import_react12.default.createElement("p", null, t("wxBound"), " ", contact.crm.customerPhone, " \xB7 ", contact.crm.salesName, "\u3002", t("wxCrmImmutable")) : /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement("p", null, t("wxCrmIntro")), /* @__PURE__ */ import_react12.default.createElement("label", null, t("wxPhone"), /* @__PURE__ */ import_react12.default.createElement("input", { disabled: frozen, required: true, inputMode: "tel", value: phone, onChange: (e) => setPhone(e.target.value) })), /* @__PURE__ */ import_react12.default.createElement("label", null, t("wxSales"), /* @__PURE__ */ import_react12.default.createElement("input", { disabled: frozen, required: true, value: sales, onChange: (e) => setSales(e.target.value) })), /* @__PURE__ */ import_react12.default.createElement("button", { disabled: frozen, className: "ws-button", type: "submit" }, t("wxBind"))), error && /* @__PURE__ */ import_react12.default.createElement("p", { role: "status" }, error));
|
|
13054
13242
|
}
|
|
13055
13243
|
|
|
13056
13244
|
return module.exports;}});
|