limixbot 0.3.101 → 0.3.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActivityPanel-DZZgXWgd.js → ActivityPanel-C2Cl2jTl.js} +1 -1
- package/dist/assets/{App-D24ELMyP.js → App-D19QFJed.js} +109 -109
- package/dist/assets/{AppEventEditor-BFkEZazQ.js → AppEventEditor-DDT3F9L_.js} +1 -1
- package/dist/assets/{BotSettingsDialog-BNDFheN0.js → BotSettingsDialog-CvzVPzcO.js} +1 -1
- package/dist/assets/{BrowserPanel-BVvlCdxG.js → BrowserPanel-DEM-W63m.js} +1 -1
- package/dist/assets/{BrowserProfilesManager-CQVN08cF.js → BrowserProfilesManager-hBmo6d_g.js} +1 -1
- package/dist/assets/{CloudAddDialog-BqehN1pz.js → CloudAddDialog-DaNbSVwD.js} +1 -1
- package/dist/assets/{ComputerFilesPane-C8Xj3lsj.js → ComputerFilesPane-CnWxeVGZ.js} +1 -1
- package/dist/assets/{ComputerPanel-BfyIIg7u.js → ComputerPanel-Cc8yiCLe.js} +2 -2
- package/dist/assets/{DataPanel-CkOWtMCr.js → DataPanel-BvWkaAdQ.js} +1 -1
- package/dist/assets/{GrokMoveDialog-B3PuFwiJ.js → GrokMoveDialog-B6UGJUMK.js} +1 -1
- package/dist/assets/{InspectorPanel-BCiZLdqU.js → InspectorPanel-wIVziMZN.js} +1 -1
- package/dist/assets/{KeyboardShortcutsModal-ffycwWVV.js → KeyboardShortcutsModal-mCYGqr7E.js} +1 -1
- package/dist/assets/{LimixResizeHandles-CtazDkY7.js → LimixResizeHandles-o2O_Or0r.js} +1 -1
- package/dist/assets/{LiveDesktop-CJWerWq1.js → LiveDesktop-mR-T2RF6.js} +1 -1
- package/dist/assets/{LocalVmWorkspace-CrdC3MmK.js → LocalVmWorkspace-DNCErB3Y.js} +1 -1
- package/dist/assets/{MacLocalControl-Bcdg_u2n.js → MacLocalControl-bs1yDd1K.js} +1 -1
- package/dist/assets/{MarkdownFilePreview-C-XNLE3e.js → MarkdownFilePreview-f4zmKhJ7.js} +1 -1
- package/dist/assets/{NewBotDialog-CI3c7n9d.js → NewBotDialog-DWIR2UbB.js} +1 -1
- package/dist/assets/{PhoneAppDialog-CR-LtOHi.js → PhoneAppDialog-CqasrSYT.js} +1 -1
- package/dist/assets/{PluginsPanel-79V2kP_5.js → PluginsPanel-ZfoIaFp9.js} +1 -1
- package/dist/assets/{ProIntroduction-BgEaTCd1.js → ProIntroduction-Dfj-Bvcm.js} +1 -1
- package/dist/assets/{RemoteAgentSettingsPanel-CpJDLN6F.js → RemoteAgentSettingsPanel-BXzq5ZPK.js} +1 -1
- package/dist/assets/{RoomPanel-ByAT8CqS.js → RoomPanel-xD6A1XTL.js} +1 -1
- package/dist/assets/{RoutinesPage-CA1__NjC.js → RoutinesPage-Ebk_GO7p.js} +2 -2
- package/dist/assets/{SettingsModal-DAymc03s.js → SettingsModal-MqvTSjjb.js} +1 -1
- package/dist/assets/{ShareTeamDialog-Dr7BcuEX.js → ShareTeamDialog-BzoKwVa3.js} +1 -1
- package/dist/assets/{SignedInSites-C-DP_jaP.js → SignedInSites-D7ldK6GO.js} +1 -1
- package/dist/assets/TeamLibraryPanel-B4r-AOrt.js +3 -0
- package/dist/assets/{TeamMapPage-DZlNjWAA.js → TeamMapPage-B5fJM5qJ.js} +1 -1
- package/dist/assets/{TriggersPage-CF1DnXkj.js → TriggersPage-AhCCyPfR.js} +1 -1
- package/dist/assets/{VisibilitySection-DnGXDssr.js → VisibilitySection-CsJ0IbTV.js} +1 -1
- package/dist/assets/{WebhookTrigger-CyF3M1mk.js → WebhookTrigger-4w1WLP-_.js} +1 -1
- package/dist/assets/{WorksOnGrid-D195VW8K.js → WorksOnGrid--l9pu37B.js} +1 -1
- package/dist/assets/{core-D0gGNfT3.js → core-CCOmUTd-.js} +1 -1
- package/dist/assets/{import-name-CdyBVR45.js → import-name-B7Do-JDx.js} +1 -1
- package/dist/assets/{index-DwYETevf.js → index-CJtPXUE4.js} +2 -2
- package/dist/assets/{index-ShhUWigV.js → index-CXTkkn4L.js} +1 -1
- package/dist/assets/{mcp-servers-scq4KvN-.js → mcp-servers-CAJBEPpM.js} +1 -1
- package/dist/assets/{new-bot-CNLntcgn.js → new-bot-CQ9YWyiC.js} +1 -1
- package/dist/assets/{org-library-CyWov7QW.js → org-library-DKT7NXTB.js} +1 -1
- package/dist/assets/{package-format-Dx-xCjWb.js → package-format-BLTn6eID.js} +1 -1
- package/dist/assets/{remote-desktop-panel-BrVUx9qj.js → remote-desktop-panel-B-H6RmM2.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-server/index.js +27 -27
- package/dist-server/package.json +1 -1
- package/dist-server/server/industry-care.js +4 -3
- package/dist-server/server/industry-teams.js +3 -3
- package/dist-server/server/limix-skill-store.js +6 -1
- package/dist-server/server/package-import.js +1 -1
- package/dist-server/server/routes/bots-create.js +1 -1
- package/dist-server/shared/industry-templates.js +4 -0
- package/package.json +1 -1
- package/skills/industry-auto-repair/SKILL.md +32 -0
- package/skills/industry-auto-repair/assets/hybrid-policy.json +10 -0
- package/skills/industry-auto-repair/manifest.json +18 -0
- package/skills/industry-auto-repair/references/vi.md +17 -0
- package/skills/industry-beauty-spa/SKILL.md +32 -0
- package/skills/industry-beauty-spa/assets/hybrid-policy.json +10 -0
- package/skills/industry-beauty-spa/manifest.json +18 -0
- package/skills/industry-beauty-spa/references/vi.md +17 -0
- package/skills/industry-education/SKILL.md +32 -0
- package/skills/industry-education/assets/hybrid-policy.json +10 -0
- package/skills/industry-education/manifest.json +18 -0
- package/skills/industry-education/references/vi.md +17 -0
- package/skills/industry-food-beverage/SKILL.md +32 -0
- package/skills/industry-food-beverage/assets/hybrid-policy.json +10 -0
- package/skills/industry-food-beverage/manifest.json +18 -0
- package/skills/industry-food-beverage/references/vi.md +17 -0
- package/skills/industry-home-services/SKILL.md +32 -0
- package/skills/industry-home-services/assets/hybrid-policy.json +10 -0
- package/skills/industry-home-services/manifest.json +18 -0
- package/skills/industry-home-services/references/vi.md +17 -0
- package/skills/industry-hospitality-travel/SKILL.md +32 -0
- package/skills/industry-hospitality-travel/assets/hybrid-policy.json +10 -0
- package/skills/industry-hospitality-travel/manifest.json +18 -0
- package/skills/industry-hospitality-travel/references/vi.md +17 -0
- package/skills/industry-logistics/SKILL.md +32 -0
- package/skills/industry-logistics/assets/hybrid-policy.json +10 -0
- package/skills/industry-logistics/manifest.json +18 -0
- package/skills/industry-logistics/references/vi.md +17 -0
- package/skills/industry-real-estate/SKILL.md +32 -0
- package/skills/industry-real-estate/assets/hybrid-policy.json +10 -0
- package/skills/industry-real-estate/manifest.json +18 -0
- package/skills/industry-real-estate/references/vi.md +17 -0
- package/skills/industry-retail-ecommerce/SKILL.md +32 -0
- package/skills/industry-retail-ecommerce/assets/hybrid-policy.json +10 -0
- package/skills/industry-retail-ecommerce/manifest.json +18 -0
- package/skills/industry-retail-ecommerce/references/vi.md +17 -0
- package/skills/industry-wholesale-distribution/SKILL.md +32 -0
- package/skills/industry-wholesale-distribution/assets/hybrid-policy.json +10 -0
- package/skills/industry-wholesale-distribution/manifest.json +18 -0
- package/skills/industry-wholesale-distribution/references/vi.md +17 -0
- package/dist/assets/TeamLibraryPanel-CI8JZtpN.js +0 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: industry-real-estate
|
|
3
|
+
description: Match listings, schedule viewings and track transaction documents.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Real estate
|
|
7
|
+
|
|
8
|
+
## English Core
|
|
9
|
+
|
|
10
|
+
Match listing ID, status date, floor area and measurement units before comparing properties. Keep access instructions and owner details within the verified viewing workflow.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
Use the procedure for the assigned role. The intake coordinator selects the responsible role and records the missing evidence. Use the customer's language for replies.
|
|
15
|
+
|
|
16
|
+
- Property advisor. Ask whether the customer wants to buy or rent. Use published listings, dated availability and approved fees. Confirm stale details with the listing owner. Required evidence: Published inventory, specifications, permitted fees and update schedule. Handoff: Send listing ID to viewings. Reserve negotiations and owner information for authorized staff.
|
|
17
|
+
- Viewing coordinator. Offer available times. Send private access instructions only through a verified channel after management confirms. Track cancellations and conflicts. Required evidence: Agent calendar, opening hours, building rules and property manager confirmation. Handoff: Route deposits and document requests to transaction support with listing ID.
|
|
18
|
+
- Property transaction desk. Share approved documents with eligible recipients. Identify missing items and the responsible person. Check access before disclosing private records. Required evidence: Document index, sharing approvals, verified transaction ID and company procedures. Handoff: Refer contracts, legal checks, holds and deposits to the responsible specialist.
|
|
19
|
+
|
|
20
|
+
## Safety Boundaries
|
|
21
|
+
|
|
22
|
+
Use approved business records. A reference below informs the workflow and does not establish local law, inventory, eligibility or permission. Keep private identifiers in the verified channel. Obtain the business system's acknowledgement before confirming a change.
|
|
23
|
+
|
|
24
|
+
## Verification
|
|
25
|
+
|
|
26
|
+
Two listings have similar addresses and different areas. Confirm listing IDs, units and current status before arranging a viewing.
|
|
27
|
+
|
|
28
|
+
The handoff should identify the case reference, observed evidence, pending decision and responsible department. Mark missing evidence explicitly.
|
|
29
|
+
|
|
30
|
+
[RESO Data Dictionary](https://www.reso.org/data-dictionary/)
|
|
31
|
+
|
|
32
|
+
Vietnamese usage examples are in `references/vi.md`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "hybrid-en-core-vi-layer/v1",
|
|
3
|
+
"core_locale": "en",
|
|
4
|
+
"user_locale": "vi",
|
|
5
|
+
"core_entrypoint": "SKILL.md",
|
|
6
|
+
"vietnamese_layer": "references/vi.md",
|
|
7
|
+
"core_authoritative": true,
|
|
8
|
+
"load_mode": "progressive",
|
|
9
|
+
"external_skill_policy": "reviewed_only"
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "industry-real-estate",
|
|
3
|
+
"name": "Real estate",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Match listings, schedule viewings and track transaction documents.",
|
|
6
|
+
"defaultEnabled": true,
|
|
7
|
+
"triggerTerms": [
|
|
8
|
+
"Real estate",
|
|
9
|
+
"Bất động sản",
|
|
10
|
+
"Property advisor",
|
|
11
|
+
"Viewing coordinator",
|
|
12
|
+
"Property transaction desk",
|
|
13
|
+
"Tư vấn bất động sản",
|
|
14
|
+
"Điều phối lịch xem",
|
|
15
|
+
"Điều phối hồ sơ nhà đất"
|
|
16
|
+
],
|
|
17
|
+
"requiredCapabilities": []
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Bất động sản
|
|
2
|
+
|
|
3
|
+
## Mục đích
|
|
4
|
+
|
|
5
|
+
Sàng lọc nhu cầu, tổ chức lịch xem và tiếp nhận yêu cầu về hồ sơ giao dịch.
|
|
6
|
+
|
|
7
|
+
## Cách dùng
|
|
8
|
+
|
|
9
|
+
Hai tin có địa chỉ gần giống nhưng diện tích khác nhau. Đối chiếu mã tin, đơn vị đo và tình trạng còn hiệu lực trước khi đặt lịch xem.
|
|
10
|
+
|
|
11
|
+
- Tư vấn bất động sản. Tìm tin theo khu vực, ngân sách, diện tích và tình trạng công bố.
|
|
12
|
+
- Điều phối lịch xem. Ghép lịch khách, người dẫn xem và quyền tiếp cận địa điểm.
|
|
13
|
+
- Điều phối hồ sơ nhà đất. Đối chiếu danh mục giấy tờ được phép chia sẻ và trạng thái tiếp nhận.
|
|
14
|
+
|
|
15
|
+
## Giới hạn
|
|
16
|
+
|
|
17
|
+
Quy trình xử lý nằm trong `SKILL.md`. Khi chuyển yêu cầu, ghi nguồn đã kiểm tra, thông tin còn thiếu và bộ phận tiếp nhận. Chỉ xác nhận hoàn tất khi hệ thống nghiệp vụ đã ghi nhận.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: industry-retail-ecommerce
|
|
3
|
+
description: Help customers choose products, track orders and arrange returns.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Retail and e-commerce
|
|
7
|
+
|
|
8
|
+
## English Core
|
|
9
|
+
|
|
10
|
+
Capture the sellable variant, branch and timestamp. Treat a product identifier, an order number and a parcel reference as separate fields. Compare the sale unit with the requested size and quantity before quoting.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
Use the procedure for the assigned role. The intake coordinator selects the responsible role and records the missing evidence. Use the customer's language for replies.
|
|
15
|
+
|
|
16
|
+
- Product advisor. Ask which variant the customer needs. Check the SKU, branch, price and offer expiry. Confirm availability only against sellable stock and give the lookup time for volatile quantities. Required evidence: Published catalog, manufacturer size chart, channel prices and branch inventory. Handoff: Send SKU, quantity and branch to order coordination. Keep cost and margin internal.
|
|
17
|
+
- Order coordinator. Verify the customer in private before reading orders. Separate estimates, drafts and confirmations. Check packing status and approval before changing an address or packed items. Required evidence: Customer order, delivery method, fees, packing milestones and carrier receipt. Handoff: Send missing parcels or returns to the returns desk with order ID, parcel ID and last delivery event.
|
|
18
|
+
- Returns advisor. Check item, delivery date and reason against the policy in effect on the purchase date. Explain verified fees and options. Confirm refunds only against a receipt. Required evidence: Verified order, versioned policy, warranty catalog and return intake status. Handoff: Refer fee exceptions, compensation and refunds to an authorized reviewer with case ID and evidence.
|
|
19
|
+
|
|
20
|
+
## Safety Boundaries
|
|
21
|
+
|
|
22
|
+
Use approved business records. A reference below informs the workflow and does not establish local law, inventory, eligibility or permission. Keep private identifiers in the verified channel. Obtain the business system's acknowledgement before confirming a change.
|
|
23
|
+
|
|
24
|
+
## Verification
|
|
25
|
+
|
|
26
|
+
A customer wants a blue size M item at a second store. Recheck that store and variant before promising pickup.
|
|
27
|
+
|
|
28
|
+
The handoff should identify the case reference, observed evidence, pending decision and responsible department. Mark missing evidence explicitly.
|
|
29
|
+
|
|
30
|
+
[GS1 product and logistics identifiers](https://www.gs1us.org/industries-and-insights)
|
|
31
|
+
|
|
32
|
+
Vietnamese usage examples are in `references/vi.md`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "hybrid-en-core-vi-layer/v1",
|
|
3
|
+
"core_locale": "en",
|
|
4
|
+
"user_locale": "vi",
|
|
5
|
+
"core_entrypoint": "SKILL.md",
|
|
6
|
+
"vietnamese_layer": "references/vi.md",
|
|
7
|
+
"core_authoritative": true,
|
|
8
|
+
"load_mode": "progressive",
|
|
9
|
+
"external_skill_policy": "reviewed_only"
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "industry-retail-ecommerce",
|
|
3
|
+
"name": "Retail and e-commerce",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Help customers choose products, track orders and arrange returns.",
|
|
6
|
+
"defaultEnabled": true,
|
|
7
|
+
"triggerTerms": [
|
|
8
|
+
"Retail and e-commerce",
|
|
9
|
+
"Bán lẻ và thương mại điện tử",
|
|
10
|
+
"Product advisor",
|
|
11
|
+
"Order coordinator",
|
|
12
|
+
"Returns advisor",
|
|
13
|
+
"Tư vấn sản phẩm",
|
|
14
|
+
"Điều phối đơn hàng",
|
|
15
|
+
"Chăm sóc đổi trả"
|
|
16
|
+
],
|
|
17
|
+
"requiredCapabilities": []
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Bán lẻ và thương mại điện tử
|
|
2
|
+
|
|
3
|
+
## Mục đích
|
|
4
|
+
|
|
5
|
+
Từ chọn đúng biến thể sản phẩm, theo dõi kiện hàng đến tiếp nhận đổi trả.
|
|
6
|
+
|
|
7
|
+
## Cách dùng
|
|
8
|
+
|
|
9
|
+
Khách muốn nhận áo xanh cỡ M tại cửa hàng khác. Hãy kiểm tra đúng cửa hàng, màu và kích cỡ trước khi báo có hàng.
|
|
10
|
+
|
|
11
|
+
- Tư vấn sản phẩm. Tra kích cỡ, màu, giá và tồn theo mã sản phẩm (SKU) tại đúng cửa hàng.
|
|
12
|
+
- Điều phối đơn hàng. Lập nháp đơn, kiểm tra trạng thái giao và chuyển yêu cầu sửa đơn.
|
|
13
|
+
- Chăm sóc đổi trả. Đối chiếu thời hạn, điều kiện và bằng chứng cho từng yêu cầu.
|
|
14
|
+
|
|
15
|
+
## Giới hạn
|
|
16
|
+
|
|
17
|
+
Quy trình xử lý nằm trong `SKILL.md`. Khi chuyển yêu cầu, ghi nguồn đã kiểm tra, thông tin còn thiếu và bộ phận tiếp nhận. Chỉ xác nhận hoàn tất khi hệ thống nghiệp vụ đã ghi nhận.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: industry-wholesale-distribution
|
|
3
|
+
description: Quote dealer prices, coordinate bulk orders and reconcile accounts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Wholesale and distribution
|
|
7
|
+
|
|
8
|
+
## English Core
|
|
9
|
+
|
|
10
|
+
Reconcile the order unit, trade-item packaging level, quantity tier and shipping unit before promising stock or calculating a total. Confirm contract version and dealer identity before revealing private pricing.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
Use the procedure for the assigned role. The intake coordinator selects the responsible role and records the missing evidence. Use the customer's language for replies.
|
|
15
|
+
|
|
16
|
+
- Dealer sales advisor. Verify the business account before reading contract rates. Check SKU, case or unit quantity, tier and quote validity. Keep dealer-specific prices in that dealer's channel. Required evidence: Distribution catalog, authorized contract, pack specifications and quantity pricing. Handoff: Refer noncontract discounts to sales management and confirmed quantities to fulfillment.
|
|
17
|
+
- Wholesale fulfillment. Verify warehouse quantities, units, lot expiry and transport schedule. Explain planned quantities per trip. Confirm order identity and authorization before release. Required evidence: Approved order, stock by lot and warehouse, partial delivery rules and receipt status. Handoff: Send delivery reference to dealer accounts. Return shortfall options to sales for the customer's choice.
|
|
18
|
+
- Dealer accounts. Verify recipient access before sharing documents. Match order, receipt, payments and billing period. Flag discrepancies for accounting to resolve. Required evidence: Invoices, delivery receipts, credit policy and the correct dealer ledger. Handoff: Refer credit limits, extensions, offsets and write-offs to the accounting lead with document references.
|
|
19
|
+
|
|
20
|
+
## Safety Boundaries
|
|
21
|
+
|
|
22
|
+
Use approved business records. A reference below informs the workflow and does not establish local law, inventory, eligibility or permission. Keep private identifiers in the verified channel. Obtain the business system's acknowledgement before confirming a change.
|
|
23
|
+
|
|
24
|
+
## Verification
|
|
25
|
+
|
|
26
|
+
A dealer orders twelve cases at a per-piece price. Confirm pieces per case and the contracted price tier before drafting fulfillment.
|
|
27
|
+
|
|
28
|
+
The handoff should identify the case reference, observed evidence, pending decision and responsible department. Mark missing evidence explicitly.
|
|
29
|
+
|
|
30
|
+
[GS1 packaging levels](https://www.gs1us.org/small-business/the-power-of-the-prefix)
|
|
31
|
+
|
|
32
|
+
Vietnamese usage examples are in `references/vi.md`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "hybrid-en-core-vi-layer/v1",
|
|
3
|
+
"core_locale": "en",
|
|
4
|
+
"user_locale": "vi",
|
|
5
|
+
"core_entrypoint": "SKILL.md",
|
|
6
|
+
"vietnamese_layer": "references/vi.md",
|
|
7
|
+
"core_authoritative": true,
|
|
8
|
+
"load_mode": "progressive",
|
|
9
|
+
"external_skill_policy": "reviewed_only"
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "industry-wholesale-distribution",
|
|
3
|
+
"name": "Wholesale and distribution",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Quote dealer prices, coordinate bulk orders and reconcile accounts.",
|
|
6
|
+
"defaultEnabled": true,
|
|
7
|
+
"triggerTerms": [
|
|
8
|
+
"Wholesale and distribution",
|
|
9
|
+
"Bán buôn và phân phối",
|
|
10
|
+
"Dealer sales advisor",
|
|
11
|
+
"Wholesale fulfillment",
|
|
12
|
+
"Dealer accounts",
|
|
13
|
+
"Kinh doanh đại lý",
|
|
14
|
+
"Vận hành đơn sỉ",
|
|
15
|
+
"Đối soát đại lý"
|
|
16
|
+
],
|
|
17
|
+
"requiredCapabilities": []
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Bán buôn và phân phối
|
|
2
|
+
|
|
3
|
+
## Mục đích
|
|
4
|
+
|
|
5
|
+
Báo giá theo đại lý, xử lý đơn số lượng lớn và đối soát chứng từ.
|
|
6
|
+
|
|
7
|
+
## Cách dùng
|
|
8
|
+
|
|
9
|
+
Đại lý đặt mười hai thùng theo báo giá từng chiếc. Đối chiếu số chiếc mỗi thùng và bậc giá hợp đồng trước khi lập phiếu giao.
|
|
10
|
+
|
|
11
|
+
- Kinh doanh đại lý. Tra quy cách, số lượng đặt tối thiểu và mức giá của đúng đại lý.
|
|
12
|
+
- Vận hành đơn sỉ. Đối chiếu lượng khả dụng, lô hàng, lịch giao và các đợt giao.
|
|
13
|
+
- Đối soát đại lý. Khớp phiếu giao, hóa đơn và kỳ công nợ theo tài khoản.
|
|
14
|
+
|
|
15
|
+
## Giới hạn
|
|
16
|
+
|
|
17
|
+
Quy trình xử lý nằm trong `SKILL.md`. Khi chuyển yêu cầu, ghi nguồn đã kiểm tra, thông tin còn thiếu và bộ phận tiếp nhận. Chỉ xác nhận hoàn tất khi hệ thống nghiệp vụ đã ghi nhận.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{l as F,b as Be,t as a,r as i,j as e,X as ht,a as S,d as Ie,S as Pt}from"./styles-DOwrpvZY.js";import{r as ze,L as z,P as gt,Q as nt,R as Mt,v as rt,U as Ft,t as he}from"./PlacesRail-DyYA64do.js";import{a$ as A,cd as it,ce as bt,cf as _t,j as C,x as p,cg as Ut,ch as Gt,ci as Kt,C as Yt,cj as lt,ck as Ht,aQ as ft,u as yt,cl as ge,cm as qt,cn as Jt,co as Wt,cp as Xt,cq as Qt,cr as Zt,c5 as Vt,cs as es,ct as ts,cu as ot,cv as ss,af as as,cw as ns}from"./App-D24ELMyP.js";import{t as be,o as kt,a as rs,b as is,c as ls,d as os,e as cs,M as ds}from"./org-library-CyWov7QW.js";import{t as ms,a as xs}from"./import-name-CdyBVR45.js";import{L as ps}from"./LimixResizeHandles-CtazDkY7.js";import{ShareTeamDialog as us}from"./ShareTeamDialog-Dr7BcuEX.js";import{R as hs}from"./MenuMotion-BclWiAVe.js";import"./monitor-B9eyPPw6.js";import"./index-DwYETevf.js";import"./package-format-Dx-xCjWb.js";import"./team-share-CS8lXIGF.js";function gs(t){const m=A(t.id,F());if(m)return it(m);const c=it(t),u=`readyBots.bot.${t.id}`;return{title:Be(`${u}.title`,c.title),description:Be(`${u}.description`,c.description),tryAsking:Be(`${u}.try`,c.tryAsking)}}const bs={"seo growth team":"seoGrowth","engineering team":"engineering","100x marketing team":"marketing100x","reddit lead miner":"redditLeadMiner","competitor watch":"competitorWatch","inbox follow-up":"inboxFollowup"};function $e(t){const m=t.builtIn&&bt.find(u=>`industry-${u.slug}`===t.slug);if(m)return{...t,..._t(m,F())};const c=bs[t.name.trim().toLowerCase()];return c?{...t,name:a(`templates.catalog.${c}.name`),summary:a(`templates.catalog.${c}.summary`),outcome:t.outcome?a(`templates.catalog.${c}.outcome`):void 0}:t}function fs(t,m){const c=$e(t);return`${c.name} ${c.summary} ${t.name} ${t.summary} ${t.category} ${t.skills.join(" ")} ${t.requires.apps.join(" ")}`.toLowerCase().includes(m)}function jt({title:t,subtitle:m,icon:c,loading:u,error:o,sections:k,useLabel:j,onUse:v,onClose:w}){const d=i.useRef(null);i.useEffect(()=>{d.current?.querySelector("[data-details-close]")?.focus();const g=B=>{B.key==="Escape"&&(B.preventDefault(),B.stopPropagation(),w())};return window.addEventListener("keydown",g,!0),()=>window.removeEventListener("keydown",g,!0)},[w]);const N=k.filter(g=>typeof g.body=="string"?g.body.trim():g.body.length);return ze.createPortal(e.jsx("div",{className:"ui-scrim fixed inset-0 z-[90] flex items-center justify-center p-4",onMouseDown:g=>{g.target===g.currentTarget&&w()},children:e.jsxs("div",{ref:d,role:"dialog","aria-modal":"true","aria-labelledby":"template-details-title","data-template-details":"",className:"ui-modal relative flex max-h-[min(720px,calc(100dvh-32px))] w-[min(560px,calc(100vw-32px))] flex-col border-0 p-0 text-ink",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-hairline/40 px-5 py-4 pe-12",children:[c,e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{id:"template-details-title",className:"break-words text-[17px] font-semibold",children:t}),m&&e.jsx("p",{className:"break-words text-[13px] text-ink-secondary",children:m})]})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-4",children:[u&&e.jsxs("p",{className:"flex items-center gap-2 py-2 text-[13px] text-ink-secondary",children:[e.jsx(z,{size:14,className:"animate-spin","aria-hidden":"true"}),p("Đang tải chi tiết…","Loading details…")]}),o&&e.jsx("p",{role:"alert",className:"mb-3 rounded-xl bg-danger/10 px-3 py-2 text-[13px] text-danger",children:o}),N.map(g=>e.jsxs("section",{className:"mb-4 last:mb-0",children:[e.jsx("h3",{className:"mb-1 text-[12px] font-medium uppercase tracking-wide text-ink-tertiary",children:g.label}),typeof g.body=="string"?e.jsx("p",{className:"whitespace-pre-line break-words text-[13px] leading-[1.5] text-ink-secondary",children:g.body}):e.jsx("ul",{className:"list-disc space-y-0.5 ps-5 text-[13px] leading-[1.5] text-ink-secondary",children:g.body.map((B,$)=>e.jsx("li",{className:"break-words",children:B},$))})]},g.label))]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-hairline/40 px-5 py-3",children:[e.jsx("button",{type:"button",onClick:w,className:"rounded-full px-4 py-2 text-[13px] text-ink-secondary hover:text-ink",children:p("Đóng","Close")}),v&&e.jsxs("button",{type:"button",onClick:v,className:"flex items-center gap-1 rounded-full bg-raised px-4 py-2 text-[13px] font-medium text-ink hover:bg-raised-hover",children:[e.jsx(gt,{size:14,"aria-hidden":"true"}),j]})]}),e.jsx("button",{type:"button","data-details-close":"",onClick:w,"aria-label":p("Đóng","Close"),className:"ui-icon-button absolute end-3 top-3",children:e.jsx(ht,{size:16})})]})}),document.body)}function ys({entry:t,onUse:m,onClose:c}){const u=$e(t),[o,k]=i.useState(null),[j,v]=i.useState("");i.useEffect(()=>{let d=!0;return C(`/api/team-library/teams/${t.slug}${t.builtIn?`?locale=${F()}`:""}`).then(N=>{d&&k(be(N))},N=>{d&&v(N instanceof Error?N.message:String(N))}),()=>{d=!1}},[t.slug]);const w=[a("templates.botCount",{count:o?.members.length??t.members}),...o?[p(`${o.rooms} phòng`,`${o.rooms} rooms`),p(`${o.routines} lịch định kỳ`,`${o.routines} routines`)]:[],...t.setupMinutes?[a("templates.minutes",{count:t.setupMinutes})]:[]];return e.jsx(jt,{title:u.name,subtitle:u.category,loading:!o&&!j,error:j,sections:[{label:p("Nhóm này làm gì","What the team does"),body:[u.summary,u.outcome].filter(Boolean).join(`
|
|
2
|
-
|
|
3
|
-
`)},{label:p("Tổng quan","At a glance"),body:w},{label:p("Thành viên","Members"),body:(o?.members??[]).map(d=>d.title?`${d.name} — ${d.title}`:d.name)},{label:p("Kỹ năng đi kèm","Skills included"),body:o?.skills?.length?o.skills:t.skills},{label:p("Ứng dụng cần kết nối","Apps needed"),body:o?.apps.length?o.apps.map(d=>d.optional?p(`${d.label} (không bắt buộc)`,`${d.label} (optional)`):d.label):t.requires.apps},{label:p("Lưu ý","Notes"),body:o?.warnings??[]}],useLabel:a("templates.load"),onUse:m,onClose:c})}const q=["bg-purple-500/15 text-purple-300","bg-cyan-500/15 text-cyan-300","bg-orange-500/15 text-orange-300","bg-emerald-500/15 text-emerald-300"];function ks({pending:t,importedNames:m,org:c=!1}){return e.jsxs(e.Fragment,{children:[t.description&&e.jsx("p",{className:"max-w-2xl text-[14px] leading-relaxed text-ink-secondary",children:t.description}),t.brief&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:a("teamImport.brief")}),e.jsx("p",{className:"mt-1 line-clamp-4 whitespace-pre-wrap break-words",children:t.brief})]}),!!t.warnings?.length&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"mb-2 font-medium text-ink",children:a("templates.backupNotes")}),t.warnings?.map((u,o)=>e.jsx("p",{children:u},o))]}),(t.kind==="package"||t.kind==="backup")&&e.jsxs("div",{className:"mt-5 flex flex-wrap gap-2 text-[12px] text-ink-secondary",children:[t.chiefOfStaff&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(Ut,{size:13}),a("templates.leads",{name:t.chiefOfStaff})]}),!t.library&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(Gt,{size:13}),a("templates.groupChats",{count:t.rooms})]}),!(t.library&&!t.playbooks)&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(Kt,{size:13}),a("templates.playbooks",{count:t.playbooks})]}),!t.library&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(Yt,{size:13}),t.version===2?a("teamImport.routinesPaused",{count:t.routines}):a("templates.pausedRoutines",{count:t.routines})]}),t.kind==="package"&&t.version!==2&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(lt,{size:13}),a("templates.connections",{count:t.apps.length})]}),!!t.connections?.length&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(lt,{size:13}),a("teamImport.connections",{count:t.connections?.length??0})]}),!!t.notes&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(Ht,{size:13}),a("teamImport.notes",{count:t.notes??0})]}),!!t.presets?.length&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(ft,{size:13}),a("teamImport.presets",{count:t.presets?.length??0})]})]}),!!t.skills?.length&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:c?a("orgLibrary.skillsOn"):t.version===2?a("teamImport.skillsOff"):a("templates.skillsDisabled")}),e.jsx("p",{className:"mt-1 break-words",children:t.skills?.join(", ")}),!c&&e.jsx("p",{className:"mt-1",children:t.version===2?a("teamImport.skillsReview"):a("templates.skillsReview")})]}),t.library&&!!t.presets?.length&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:a("teamImport.presetList")}),e.jsx("p",{className:"mt-1 break-words",children:t.presets?.join(", ")})]}),!!t.offeredSkills?.length&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:a("teamImport.offeredSkills")}),e.jsx("p",{className:"mt-1 break-words",children:t.offeredSkills?.join(", ")})]}),!!t.connections?.length&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:a("teamImport.connections",{count:t.connections?.length??0})}),e.jsx("ul",{className:"mt-1",children:t.connections?.map((u,o)=>e.jsxs("li",{className:"truncate",children:[u.label," · ",u.url]},`${u.label}-${o}`))})]}),t.members.length>0&&e.jsx("div",{className:"mt-6 text-[12px] font-medium text-ink-secondary",children:a("templates.teamMembers")}),e.jsx("div",{className:"mt-2 grid grid-cols-1 gap-x-10 md:grid-cols-2",children:t.members.map((u,o)=>e.jsxs("div",{className:"flex min-h-[72px] items-center gap-3 border-b border-hairline/35 px-1 py-3",children:[t.pictures?.[o]?e.jsx("img",{src:t.pictures[o],alt:"",className:"size-9 shrink-0 rounded-lg object-cover"}):e.jsx("div",{className:S("flex size-9 shrink-0 items-center justify-center rounded-lg text-[13px] font-semibold",q[o%q.length]),children:u.name.slice(0,1).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-[14px] font-medium text-ink",children:m[o]}),m[o]!==u.name&&e.jsx("div",{className:"text-[12px] text-ink-secondary",children:a("templates.newCopyOf",{name:u.name})}),e.jsx("div",{className:"mt-0.5 truncate text-[13px] text-ink-secondary",children:u.title||a("templates.generalAssistant")})]})]},`${u.name}-${o}`))}),e.jsxs("div",{className:"mt-6 flex items-start gap-2.5 rounded-xl bg-raised/45 px-4 py-3 text-[13px] leading-relaxed text-ink-secondary",children:[e.jsx(Ie,{size:15,className:"mt-0.5 shrink-0 text-success"}),e.jsx("p",{children:t.kind==="backup"?a("templates.backupSafety",{archived:t.archivedBots?a("templates.archivedBots",{count:t.archivedBots}):""}):c?t.members.length?a("orgLibrary.teamSafety"):a("orgLibrary.librarySafety"):t.library?a("teamImport.librarySafety"):t.version===2?a("teamImport.sharedTeamSafety"):t.kind==="package"?a("templates.packageSafety"):a("templates.legacySafety")})]})]})}async function js(t,m){for(const c of m??[])await fetch(`/api/limix/skill-store/${encodeURIComponent(t)}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:c,add:!0})}).catch(()=>{})}const ct={gmail:"Gmail",github:"GitHub",discord:"Discord",slack:"Slack",googlecalendar:"Google Calendar",notion:"Notion",linear:"Linear",figma:"Figma",gong:"Gong",hubspot:"HubSpot",postiz:"Postiz"},Ee={everyday:"readyBots.category.everyday",work:"readyBots.category.work",writing:"readyBots.category.writing",design:"readyBots.category.design",sales:"readyBots.category.sales",personal:"readyBots.category.personal"};function Te(t){t=A(t.id,F())??t;const m=gs(t);return{id:t.id,name:t.name,title:m.title,category:t.category,description:m.description,try:m.tryAsking,look:t.look,apps:t.apps,routines:t.routines?.length??0,builtIn:!0}}function H(t){const m=t.length?t.filter(c=>!A(c.id)).map(c=>({...c,builtIn:!1})):Qt.map(Te);return[...Zt.map(Te),...m]}let M=null;async function Ns(){const{bots:t}=await C("/api/limix/bots/refresh",{method:"POST"});return M=t.length?H(t):null,(M??H([])).length}const dt=(t,m)=>{const c=m.trim().toLowerCase();return!c||[t.name,t.title,t.description,t.category].some(u=>u.toLowerCase().includes(c))};function vs({search:t,onDialog:m,onAdded:c,revision:u=0,suggestion:o}){const{state:k,dispatch:j}=yt(),[v,w]=i.useState(null),[d,N]=i.useState(""),[g,B]=i.useState(()=>M??H([])),[$,J]=i.useState(!1),[R,W]=i.useState(null),[X,_]=i.useState(""),[O,U]=i.useState(null);i.useEffect(()=>{if(u>0){B(M??H([])),J(!1);return}let n=!0;return C("/api/limix/bots").then(({bots:b})=>{if(!n)return;const x=H(b);M=b.length?x:null,B(x),J(!1)}).catch(()=>{n&&(B(M??H([])),J(!M))}),()=>{n=!1}},[u]);const V=()=>{U(null),m(!1)},[h,E]=i.useState(null),ee=n=>{if(m(!0),n.builtIn){E({card:n,bot:A(n.id,F())??Vt(n.id)});return}E({card:n}),C(`/api/limix/bots/${n.id}`).then(({bot:b})=>E(x=>x?.card.id===n.id?{card:n,bot:b}:x),b=>E(x=>x?.card.id===n.id?{card:n,error:b instanceof Error?b.message:String(b)}:x))},fe=()=>{E(null),m(!1)},te=async n=>{if(!(R||es(k))){if(_(""),window.ogb?.remoteClient?.active){A(n.id)?(m(!1),_(p("Hãy mở mẫu này trên máy chủ Limix Bot để cài bộ công cụ CSKH.","Open this template on the Limix Bot host to install its customer care tools."))):j({type:"newBot",onCreated:c});return}if(n.builtIn){U({id:n.id}),m(!0);return}W(n.id);try{const{bot:b}=await C(`/api/limix/bots/${n.id}`);U({id:n.id,data:b,skills:b.skills}),m(!0)}catch(b){_(b instanceof Error?b.message:String(b))}finally{W(null)}}},P=g.map(n=>{const b=n.builtIn&&A(n.id);return b?Te(b):n}).filter(n=>o==="support"?n.builtIn&&n.id===ge&&dt(n,t):o==="department"&&(!n.builtIn||n.id===ge||!A(n.id))?!1:(!v||n.category===v)&&dt(n,t)&&(!d||n.builtIn&&(n.id===ge||n.id.startsWith(`industry-${d}-`))));return!d&&t.trim()&&P.length===0?null:e.jsxs("section",{className:"mb-8","aria-labelledby":"ready-bots-title",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("h3",{id:"ready-bots-title",className:"text-[12px] font-medium text-ink-secondary",children:a("readyBots.title")}),e.jsx("div",{className:"flex flex-wrap items-center gap-3",children:e.jsx("p",{className:"text-[12px] text-ink-tertiary",role:"status","aria-live":"polite",children:$?p("Đang dùng bản có sẵn trong ứng dụng (chưa tải được kho mẫu).","Showing the bots built into the app (the template library could not be loaded)."):a("readyBots.subtitle")})})]}),e.jsxs("div",{className:"mb-3 mt-2 flex flex-wrap gap-1.5",role:"group","aria-label":a("readyBots.categories"),children:[!o&&[null,...qt].map(n=>e.jsx("button",{type:"button","aria-pressed":v===n,onClick:()=>{w(n),N("")},className:S("rounded-full px-3 py-1 text-[13px] transition-colors",v===n?"bg-ink text-panel":"bg-raised/70 text-ink-secondary hover:text-ink"),children:n?a(Ee[n]):a("readyBots.all")},n??"all")),o!=="support"&&e.jsxs("select",{value:d,"aria-label":p("Lọc mẫu bot theo ngành","Filter bot templates by industry"),className:"rounded-full border border-hairline bg-panel px-3 py-1 text-[13px] text-ink",onChange:n=>{N(n.target.value),w(null)},children:[e.jsx("option",{value:"",children:p("Tất cả ngành","All industries")}),bt.map(n=>e.jsx("option",{value:n.slug,children:Jt(n,F()).name},n.slug))]})]}),X&&e.jsx("p",{role:"alert",className:"mb-3 rounded-xl bg-danger/10 px-3 py-2 text-[13px] text-danger",children:X}),e.jsx("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,280px),1fr))] gap-3",children:P.map(n=>e.jsxs("article",{"data-ready-bot":n.id,className:"flex min-w-0 flex-col rounded-2xl border border-hairline/40 bg-card p-4 [overflow-wrap:anywhere]",children:[e.jsxs("div",{className:"grid grid-cols-[auto_minmax(0,1fr)] items-center gap-3",children:[e.jsx(nt,{color:n.look.color,bodyId:n.look.mascotBody,state:n.look.mascotExpression??"idle",size:40,animated:!1,label:n.name}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"text-[14px] font-medium text-ink",children:n.name}),e.jsxs("p",{className:"text-[12px] text-ink-secondary",children:[n.title," · ",a(Ee[n.category])]})]})]}),e.jsx("p",{className:"mt-3 text-[13px] leading-[1.45] text-ink-secondary",children:n.description}),e.jsx("p",{className:"mt-2 text-[12px] italic text-ink-tertiary",children:a("readyBots.try",{prompt:n.try})}),e.jsxs("div",{className:"mt-auto flex flex-wrap items-center justify-between gap-2 pt-3",children:[e.jsxs("button",{type:"button","data-ready-bot-details":n.id,onClick:()=>ee(n),"aria-label":p(`Xem thêm về ${n.name}`,`More about ${n.name}`),className:"flex w-fit items-center gap-1 text-[12px] font-medium text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-accent",children:[e.jsx(Wt,{size:13,"aria-hidden":"true"}),p("Xem thêm","See more")]}),e.jsxs("button",{type:"button",onClick:()=>{te(n)},disabled:R!==null,"aria-label":p(`Dùng mẫu ${n.name}, ${n.title}`,`Use template ${n.name}, ${n.title}`),className:"flex h-8 shrink-0 items-center gap-1 rounded-full bg-raised px-3 text-[13px] font-medium text-ink hover:bg-raised-hover disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-accent",children:[R===n.id?e.jsx(z,{size:14,className:"animate-spin","aria-hidden":"true"}):e.jsx(gt,{size:14,"aria-hidden":"true"}),p("Dùng mẫu","Use template")]})]}),(n.apps.length>0||n.routines>0)&&e.jsx("p",{className:"pt-2 text-[12px] text-ink-tertiary",children:[n.apps.length>0&&a("readyBots.worksWith",{apps:n.apps.map(b=>ct[b]??b).join(", ")}),n.routines>0&&a("readyBots.pausedRoutine")].filter(Boolean).join(" · ")})]},n.id))}),h&&e.jsx(jt,{title:h.card.name,subtitle:`${h.card.title} · ${a(Ee[h.card.category])}`,icon:e.jsx(nt,{color:h.card.look.color,bodyId:h.card.look.mascotBody,state:h.card.look.mascotExpression??"idle",size:44,animated:!1,label:h.card.name}),loading:!h.bot&&!h.error,error:h.error,sections:[{label:p("Bot này làm gì","What it does"),body:h.bot?.description??h.card.description},{label:p("Cách bot làm việc","How it works"),body:h.bot?.soul??""},{label:p("Bạn có thể hỏi","Things to ask"),body:h.bot?.tryAsking??[h.card.try]},{label:p("Kỹ năng đi kèm","Skills included"),body:A(h.card.id)?[ge]:h.bot?.skills??[]},{label:p("Kênh chăm sóc khách hàng","Customer service channels"),body:A(h.card.id)?p("Sau khi tạo bot, mở Cài đặt của bot để kết nối Zalo, Facebook Page, Messenger hoặc Telegram.","After creating the bot, open its settings to connect Zalo, a Facebook Page, Messenger or Telegram."):""},{label:p("Ứng dụng nên kết nối","Apps it works with"),body:(h.bot?.apps??h.card.apps).map(n=>ct[n]??n)},{label:p("Lịch định kỳ (tạo ở trạng thái tạm dừng)","Routines (created paused)"),body:(h.bot?.routines??[]).map(n=>n.schedule&&"time"in n.schedule&&n.schedule.time?`${n.name} · ${n.schedule.time}`:n.name)}],useLabel:p("Dùng mẫu","Use template"),onUse:()=>{const n=h.card;E(null),te(n)},onClose:fe}),O&&ze.createPortal(e.jsx(Xt,{readyBotId:O.id,readyBotData:O.data,onClose:V,onCreated:n=>{m(!1),js(n.id,O.skills),c(n)}}),document.body)]})}const mt=["bg-cyan-500/15 text-cyan-300","bg-purple-500/15 text-purple-300","bg-emerald-500/15 text-emerald-300","bg-orange-500/15 text-orange-300"];function ws({listing:t,busy:m,notice:c,error:u,onAdd:o,onDetails:k}){const j=t.organization.name;return e.jsxs("div",{children:[e.jsx("p",{className:"max-w-2xl text-[13px] leading-relaxed text-ink-secondary",children:a("orgLibrary.intro",{name:j})}),t.packages.length===0?e.jsx("p",{className:"mt-6 text-[13px] text-ink-secondary",children:a("orgLibrary.empty",{name:j})}):e.jsx("div",{className:"mt-4 grid grid-cols-1 gap-x-10 md:grid-cols-2",children:t.packages.map((v,w)=>e.jsx(Ss,{entry:v,index:w,busy:m,onAdd:o,onDetails:k},v.packageId))}),c&&e.jsx("div",{role:"status",className:"mt-4 rounded-lg bg-raised/60 px-3 py-2 text-[13px] text-ink-secondary",children:c}),u&&e.jsx("div",{role:"alert",className:"mt-4 rounded-lg bg-danger/10 px-3 py-2 text-[13px] text-danger",children:u})]})}function Ss({entry:t,index:m,busy:c,onAdd:u,onDetails:o}){const k=kt(t),j=rs(t),v=is(t),w=c===t.packageId;return e.jsxs("article",{className:"flex min-h-[104px] items-center gap-3 border-b border-hairline/35 px-1 py-4",children:[e.jsx("div",{className:S("flex size-11 shrink-0 items-center justify-center rounded-xl",mt[m%mt.length]),children:e.jsx(Mt,{size:20})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"truncate text-[14px] font-medium text-ink",children:t.name}),e.jsx("p",{className:"mt-0.5 truncate text-[13px] text-ink-secondary",children:t.tagline}),e.jsxs("p",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-[12px] text-ink-tertiary",children:[e.jsx("span",{children:ls(t)}),j&&e.jsx("span",{className:"rounded-full bg-accent/10 px-2 py-0.5 text-accent-text",children:j}),t.release&&e.jsx("span",{children:t.release.version})]}),e.jsx("p",{className:"mt-0.5 truncate text-[12px] text-ink-tertiary",children:os(t.contents)}),v.map(d=>e.jsx("p",{className:"mt-0.5 text-[12px] text-warning",children:d},d))]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1.5",children:[k==="add"&&e.jsxs("button",{onClick:()=>u(t),disabled:c!==null,"aria-label":a("orgLibrary.addAria",{name:t.name}),className:"flex min-w-[72px] items-center justify-center gap-1.5 rounded-full bg-accent px-3.5 py-2 text-[13px] font-medium text-white hover:bg-accent/90 disabled:opacity-40",children:[w&&e.jsx(z,{size:13,className:"animate-spin"}),w?a("orgLibrary.adding"):a("orgLibrary.add")]}),k==="added"&&e.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-raised px-3 py-1.5 text-[12px] text-ink-secondary",children:[e.jsx(Ie,{size:13,className:"text-success"}),a("orgLibrary.added")]}),k==="updateApp"&&e.jsx("span",{className:"max-w-[140px] text-right text-[12px] text-ink-secondary",children:a("orgLibrary.updateApp")}),k==="notReady"&&e.jsx("span",{className:"text-[12px] text-ink-secondary",children:a("orgLibrary.notReady")}),k==="noRelease"&&e.jsx("span",{className:"text-[12px] text-ink-secondary",children:a("orgLibrary.noRelease")}),t.blob==="ready"&&e.jsx("button",{onClick:()=>o(t),disabled:c!==null,"aria-label":a("orgLibrary.detailsAria",{name:t.name}),className:"rounded-full px-2.5 py-1 text-[12px] text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-40",children:a("orgLibrary.details")})]})]})}const Cs="https://github.com/leomieo/limix-bot-teams",xt=["cyan","red","purple","green","orange"];async function pt(t){if(window.ogb?.openExternal){await window.ogb.openExternal(t);return}const m=window.open(t,"_blank","noopener,noreferrer");m&&(m.opener=null)}function Ls(t,m){const c=new Map;for(const o of m){if(o.hidden)continue;const k=o.section?.trim()??"";c.set(k,(c.get(k)??0)+1)}return[...[...new Set([...t.map(o=>o.trim()).filter(Boolean),...c.keys()])].filter(o=>o!==""),""].flatMap(o=>c.get(o)?[{name:o,bots:c.get(o)}]:[])}function ut({index:t}){return e.jsx("div",{className:S("flex size-11 shrink-0 items-center justify-center rounded-xl",q[t%q.length]),children:e.jsx(ft,{size:20})})}function Fs({onClose:t,onImported:m,returnFocusRef:c,initialUrl:u,initialIndustrySuggestion:o}){const{state:k,dispatch:j}=yt(),v=i.useRef(null),w=i.useRef(null),[d,N]=i.useState(o==="team"?"teams":"explore"),[g,B]=i.useState(o),[$,J]=i.useState(null),[R,W]=i.useState(!0),[X,_]=i.useState(""),[O,U]=i.useState(!1),[V,h]=i.useState(""),[E,ee]=i.useState(""),[fe,te]=i.useState(0),P=i.useRef(0),[n,b]=i.useState(null),[x,Q]=i.useState(null),[Nt,vt]=i.useState("file"),[ye,Re]=i.useState(""),[Oe,Ae]=i.useState(!1),[I,se]=i.useState(!1),[wt,ke]=i.useState(!1),[je,St]=i.useState(""),[G,f]=i.useState(""),[De,Pe]=i.useState(""),[ae,Me]=i.useState(!1),[L,Fe]=i.useState(null),[Ct,Lt]=i.useState(""),[ne,Ne]=i.useState(null),[_e,Ue]=i.useState(new Set),[Ge,Ke]=i.useState(""),[re,Ye]=i.useState(!1),[ie,He]=i.useState(null),[qe,le]=i.useState(!1),[ve,we]=i.useState(null),[oe,Je]=i.useState(null),[Bt,ce]=i.useState(null),[Et,We]=i.useState(""),[Tt,de]=i.useState(""),[K,me]=i.useState(null),D=i.useRef(!!o),Y=i.useRef(0),Se=k.bots.filter(s=>!s.hidden).length,Xe=Ls(k.sections??[],k.bots),It=new Set(k.bots.map(s=>s.name.trim().toLowerCase())),zt=x?.members.map(s=>ms(s.name,It))??[],xe=i.useCallback(async(s=!1)=>{const r=++P.current;W(!0),_("");try{const l=await C(`/api/team-library/catalog${s?"?fresh=1":""}`);return r===P.current&&J(l),l.communityAvailable!==!1}catch(l){return r===P.current&&_(l instanceof Error?l.message:String(l)),!1}finally{r===P.current&&W(!1)}},[]),$t=async()=>{if(!O){U(!0),h(""),ee("");try{const[s,r]=await Promise.allSettled([Ns(),xe(!0)]);if(s.status==="fulfilled"&&te(l=>l+1),s.status==="fulfilled"&&r.status==="fulfilled"&&r.value)h(p("Đã cập nhật mẫu Bot và mẫu nhóm Bot.","Bot and team templates updated."));else{const l=[...s.status==="rejected"?[p("mẫu Bot","bot templates")]:[],...r.status==="rejected"||!r.value?[p("mẫu nhóm Bot","team templates")]:[]];ee(p(`Chưa cập nhật được ${l.join(", ")}. Hãy thử lại.`,`Could not update ${l.join(", ")}. Please retry.`))}}finally{U(!1)}}};i.useEffect(()=>{xe()},[xe]);const pe=i.useCallback(async()=>{try{const s=await C("/api/org-library");Je(s),s.organization&&!D.current&&N("org")}catch{Je({organization:null,packages:[]})}},[]);i.useEffect(()=>{pe()},[pe]),i.useEffect(()=>(v.current?.focus(),()=>c.current?.focus()),[c]),i.useEffect(()=>{const s=r=>{if(ie!==null||qe)return;if(r.key==="Escape"&&!I){r.preventDefault(),r.stopPropagation(),x?(Q(null),me(null)):t();return}if(r.key!=="Tab")return;const l=v.current,y=Array.from(l?.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), [tabindex]:not([tabindex="-1"])')??[]);if(!l||y.length===0)return;const T=y[0],ue=y.at(-1);r.shiftKey&&(document.activeElement===T||!l.contains(document.activeElement))?(r.preventDefault(),ue.focus()):!r.shiftKey&&document.activeElement===ue&&(r.preventDefault(),T.focus())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[I,t,x,ie,qe]);const Ce=(s,r)=>{Q(s),vt(r),f("")},Qe=async s=>{if(s.size>ds)throw new Error(a("templates.fileTooLarge"));const r=await s.text();let l=r;if(!s.name.toLowerCase().endsWith(".md"))try{l=JSON.parse(r)}catch(y){throw y instanceof SyntaxError?new Error(a("teamLibrary.invalidJson")):y}Ce(be(l),"file")},Ze=async s=>{b(s.slug),f("");try{const r=be(await C(`/api/team-library/teams/${s.slug}${s.builtIn?`?locale=${F()}`:""}`));Ce(s.builtIn?{...r,builtInTeam:s.slug}:r,"library")}catch(r){f(r instanceof Error?r.message:String(r))}finally{b(null)}},Ve=async()=>{await et(ye)},et=async s=>{if(s.trim()){Ae(!0),f("");try{const r=await C("/api/team-library/github",{method:"POST",body:JSON.stringify({url:s.trim()})});Ce(be(r),"github")}catch(r){f(r instanceof Error?r.message:String(r))}finally{Ae(!1)}}};i.useEffect(()=>{u&&(D.current=!0,N("import"),Re(u),et(u))},[u]);const Rt=async()=>{if(x){se(!0),f("");try{const s=await xs(x.manifest,j,x.builtInTeam);he("team_imported",{members:s.bots.length,source:Nt,mode:"add",format:x.kind}),m({name:x.name,members:s.bots.length,...s.connections?.length?{connections:s.connections.length}:{},...s.presets?.length?{presets:s.presets.length}:{}})}catch(s){f(s instanceof Error?s.message:String(s))}finally{se(!1)}}},Ot=async s=>{ce(s.packageId),de("");try{const r=await C(`/api/org-library/packages/${s.packageId}`);Q(cs(r.document)),me(s),f("")}catch(r){de(r instanceof Error?r.message:String(r))}finally{ce(null)}},tt=async s=>{ce(s.packageId),se(!0),de(""),We(""),f("");try{const r=await C("/api/org-library/add",{method:"POST",body:JSON.stringify({packageId:s.packageId})});for(const y of r.bots??[])j({type:"botAdded",bot:y});for(const y of r.groups??[])j({type:"groupPatched",group:y});for(const y of r.routines??[])j({type:"routinePatched",routine:y});const l=r.bots?.find(y=>!y.hidden);if(he("team_imported",{members:r.bots?.length??0,source:"organization",mode:"add",format:"package"}),l){j({type:"select",id:l.id}),m({name:s.name,members:r.bots.length,...r.connections?.length?{connections:r.connections.length}:{}});return}Q(null),me(null),r.alreadyAdded||We(a("orgLibrary.addedSkills",{name:s.name})),await pe()}catch(r){const l=r instanceof Error?r.message:String(r);K?f(l):de(l),await pe()}finally{ce(null),se(!1)}},Z=De.trim(),Le=async s=>{const r=++Y.current;Me(!0),f(""),Fe(null),Ne(null),Ue(new Set);try{const l=await C(`/api/teams/scout?cwd=${encodeURIComponent(s)}`);if(r!==Y.current)return;Fe(l),Lt(s),Ke(l.suggestion.roomName),he("team_scouted",{signals:l.suggestion.manifest.team.members.length-1}),C(`/api/teams/scout/directory?cwd=${encodeURIComponent(s)}`).then(y=>{r===Y.current&&Ne(y.directory)}).catch(()=>{r===Y.current&&Ne([])})}catch(l){if(r!==Y.current)return;f(l instanceof Error?l.message:String(l))}finally{r===Y.current&&Me(!1)}},At=async()=>{const s=await window.ogb?.pickFolder?.(Z||void 0);s&&(Pe(s),await Le(s))},Dt=async()=>{if(!(!L||re)){Ye(!0),f("");try{const s=(ne??[]).filter(T=>_e.has(T.slug)).map((T,ue)=>({key:`dir-${T.slug}`,name:T.name,title:T.category||a("templates.communityBot"),description:T.prompt,appearance:{color:xt[ue%xt.length]}})),r={...L.suggestion.manifest,team:{...L.suggestion.manifest.team,members:[...L.suggestion.manifest.team.members,...s]}},l=Ge.trim()||L.suggestion.roomName,y=await C(`/api/teams/import?mode=project&cwd=${encodeURIComponent(Ct)}&room=${encodeURIComponent(l)}`,{method:"POST",body:JSON.stringify(r)});for(const T of y.bots)j({type:"botAdded",bot:T});y.group&&(j({type:"groupPatched",group:{...y.group,messages:[]}}),j({type:"select",id:y.group.id})),he("team_imported",{members:y.bots.length,source:"scout",mode:"project"}),m({name:l,members:y.bots.length})}catch(s){f(s instanceof Error?s.message:String(s))}finally{Ye(!1)}}},st=je.trim().toLowerCase(),at=($?.teams??[]).filter(s=>(g!=="team"||s.builtIn)&&(!st||fs(s,st)));return ze.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/55 p-4 sm:p-6",onMouseDown:s=>s.stopPropagation(),children:[e.jsxs("div",{ref:v,role:"dialog","aria-modal":"true","aria-labelledby":"team-library-title",tabIndex:-1,className:"animate-pop-in relative flex h-[min(780px,calc(100dvh-2rem))] max-h-full w-[min(100%,1040px)] flex-col overflow-hidden rounded-2xl border border-hairline/50 bg-panel shadow-2xl shadow-black/50 outline-none",children:[e.jsxs("header",{className:"flex items-start justify-between gap-4 px-6 pb-3 pt-6 sm:px-8 sm:pt-7",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[x&&e.jsx("button",{onClick:()=>{Q(null),me(null),f("")},disabled:I,className:"rounded-lg p-1.5 text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-50","aria-label":a("templates.back"),children:e.jsx(ts,{size:18})}),e.jsx("h2",{id:"team-library-title",className:"[overflow-wrap:anywhere] text-[22px] font-semibold tracking-[-0.01em] text-ink",children:x?x.name:a("templates.title")})]}),e.jsx("p",{className:S("mt-1 text-[13px] text-ink-secondary",x&&"ml-9"),children:x?x.kind==="backup"?a("templates.backupSummary",{bots:x.members.length,conversations:x.conversations??0}):x.kind==="package"?x.library?a("teamImport.library"):x.version===2?a("teamImport.sharedTeam",{count:x.members.length}):a("templates.playbookSummary",{count:x.members.length}):a("templates.readyBots",{count:x.members.length}):a("templates.subtitle")})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[!x&&e.jsxs("button",{onClick:()=>{pt($?.repositoryUrl??Cs)},className:"flex items-center gap-1.5 rounded-lg px-2.5 py-2 text-[13px] text-ink-secondary hover:bg-raised hover:text-ink",title:a("templates.openRepository"),children:[e.jsx(ot,{size:16}),e.jsx("span",{className:"max-sm:hidden",children:a("templates.communityRepo")}),e.jsx(rt,{size:12})]}),e.jsx("button",{onClick:t,disabled:I,className:"rounded-lg p-2 text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-50","aria-label":a("templates.close"),children:e.jsx(ht,{size:21})})]})]}),x?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 pb-6 pt-6 sm:px-8",children:[e.jsx(ks,{pending:x,importedNames:zt,org:K!==null}),x.builtInTeam&&e.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:p("Mỗi thành viên có kỹ năng CSKH, công cụ phân loại yêu cầu và tra danh mục công khai riêng. Kết nối kênh và nạp dữ liệu của doanh nghiệp sau khi tạo.","Each member gets the customer-care skill, ticket triage and its own public catalog lookup. Set up your business data and channels after creation.")}),G&&e.jsx("div",{role:"alert",className:"mt-4 rounded-lg bg-danger/10 px-3 py-2 text-[13px] text-danger",children:G})]}),e.jsxs("footer",{className:"flex flex-col gap-3 border-t border-hairline/35 px-6 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-8",children:[e.jsxs("div",{className:"text-[13px] text-ink-secondary",children:[a(Se===0?"templates.existingNone":Se===1?"templates.existingOne":"templates.existingMany",{count:Se})," ",x.kind==="backup"?a("teamImport.backupCopies"):x.library?a("teamImport.libraryAdds"):x.members.length===0?"":a("teamImport.newSection",{name:x.teamName??x.name})]}),K?kt(K)==="add"?e.jsxs("button",{onClick:()=>{tt(K)},disabled:I,"aria-label":a("orgLibrary.addAria",{name:K.name}),className:"flex shrink-0 items-center justify-center gap-2 rounded-full bg-accent px-5 py-2.5 text-[14px] font-medium text-white hover:bg-accent/90 disabled:opacity-60",children:[I&&e.jsx(z,{size:15,className:"animate-spin"}),I?a("orgLibrary.adding"):a("orgLibrary.add")]}):e.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded-full bg-raised px-4 py-2 text-[13px] text-ink-secondary",children:[e.jsx(Ie,{size:14,className:"text-success"}),a("orgLibrary.added")]}):e.jsxs("button",{onClick:()=>{Rt()},disabled:I,className:"flex shrink-0 items-center justify-center gap-2 rounded-full bg-accent px-5 py-2.5 text-[14px] font-medium text-white hover:bg-accent/90 disabled:opacity-60",children:[I&&e.jsx(z,{size:15,className:"animate-spin"}),I?a("templates.importing"):x.kind==="backup"?a("templates.importBackup"):x.library?a("teamImport.addPresets"):a("templates.addTeam")]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-6 pb-4 pt-5 sm:px-8",children:[e.jsxs("div",{className:"flex max-w-full flex-wrap rounded-xl bg-raised/70 p-1",role:"tablist","aria-label":a("templates.source"),children:[oe?.organization&&e.jsx("button",{role:"tab","aria-selected":d==="org",onClick:()=>{D.current=!0,N("org"),f("")},className:S("max-w-[220px] truncate rounded-lg px-4 py-2 text-[14px] transition-colors",d==="org"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:a("orgLibrary.tab",{name:oe.organization.name})}),e.jsx("button",{role:"tab","aria-selected":d==="explore",onClick:()=>{D.current=!0,N("explore"),f("")},className:S("rounded-lg px-4 py-2 text-[14px] transition-colors",d==="explore"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:a("templates.explore")}),e.jsx("button",{role:"tab","aria-selected":d==="import",onClick:()=>{D.current=!0,N("import"),f("")},className:S("rounded-lg px-4 py-2 text-[14px] transition-colors",d==="import"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:a("templates.import")}),e.jsx("button",{role:"tab","aria-selected":d==="scout",onClick:()=>{D.current=!0,N("scout"),f("")},className:S("rounded-lg px-4 py-2 text-[14px] transition-colors",d==="scout"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:a("templates.fromFolder")}),e.jsx("button",{role:"tab","aria-selected":d==="share",onClick:()=>{D.current=!0,N("share"),f("")},className:S("rounded-lg px-4 py-2 text-[14px] transition-colors",d==="share"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:a("teamLibrary.shareTab")}),e.jsx("button",{role:"tab","aria-selected":d==="teams",onClick:()=>{D.current=!0,N("teams"),f("")},className:S("rounded-lg px-4 py-2 text-[14px] transition-colors",d==="teams"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:p("Bản mẫu Nhóm","Team templates")})]}),e.jsxs("button",{type:"button",onClick:()=>{$t()},disabled:O,title:p("Tải lại mẫu Bot và mẫu nhóm Bot mới nhất từ kho","Reload the latest bot and team templates"),className:"flex h-10 shrink-0 items-center gap-1.5 rounded-xl bg-raised/70 px-3 text-[13px] font-medium text-ink hover:bg-raised-hover disabled:opacity-60",children:[e.jsx(hs,{size:14,"aria-hidden":"true",className:O?"animate-spin":void 0}),O?p("Đang cập nhật","Updating"):p("Cập nhật","Update")]}),(d==="explore"||d==="teams")&&e.jsxs("label",{className:"flex h-11 w-full items-center gap-2.5 rounded-xl bg-raised/70 px-3.5 sm:ml-auto sm:w-[240px]",children:[e.jsx(Pt,{size:17,className:"shrink-0 text-ink-secondary"}),e.jsx("input",{value:je,onChange:s=>St(s.target.value),placeholder:a("templates.search"),"aria-label":a("templates.search"),className:"min-w-0 flex-1 bg-transparent text-[14px] text-ink placeholder:text-ink-secondary focus:outline-none"})]})]}),(V||E)&&e.jsx("p",{role:E?"alert":"status",className:S("px-6 pb-2 text-[13px] sm:px-8",E?"text-danger":"text-ink-secondary"),children:E||V}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 pb-7 pt-5 sm:px-8",children:[g&&(g==="team"&&d==="teams"||g!=="team"&&d==="explore")&&e.jsx("button",{type:"button",onClick:()=>B(void 0),className:"mb-3 text-[13px] text-ink-secondary underline hover:text-ink",children:p("Xem tất cả mẫu","Browse all templates")}),d==="org"&&oe?.organization&&e.jsx(ws,{listing:oe,busy:Bt,notice:Et,error:Tt,onAdd:s=>{tt(s)},onDetails:s=>{Ot(s)}}),d==="explore"&&e.jsx(vs,{revision:fe,search:je,suggestion:g==="team"?void 0:g,onDialog:le,onAdded:t}),d==="teams"&&e.jsxs("div",{children:[ve&&e.jsx(ys,{entry:ve,onClose:()=>{we(null),le(!1)},onUse:()=>{const s=ve;we(null),le(!1),Ze(s)}}),R&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-24 text-[13px] text-ink-secondary",children:[e.jsx(z,{size:16,className:"animate-spin"})," ",a("templates.loading")]}),!R&&X&&e.jsxs("div",{className:"rounded-xl bg-danger/10 p-4 text-[13px] text-danger",children:[e.jsx("p",{children:X}),e.jsx("button",{onClick:()=>{xe()},className:"mt-3 rounded-full bg-raised px-3.5 py-2 text-ink hover:bg-raised-hover",children:a("common.tryAgain")})]}),!R&&$?.communityAvailable===!1&&e.jsx("p",{role:"status",className:"mb-4 text-[13px] text-ink-secondary",children:p("Đang hiển thị các nhóm có sẵn trong Limix Bot. Thư viện cộng đồng chưa kết nối được.","Showing built-in Limix Bot teams. The community library is currently unavailable.")}),!R&&$&&e.jsx("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(min(100%,360px),1fr))] gap-x-10",children:at.map((s,r)=>{const l=$e(s);return e.jsxs("article",{className:"grid grid-cols-[auto_minmax(0,1fr)] items-start gap-3 border-b border-hairline/35 px-1 py-4",children:[e.jsx(ut,{index:r}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"[overflow-wrap:anywhere] text-[14px] font-medium text-ink",children:l.name}),e.jsx("p",{className:"mt-0.5 [overflow-wrap:anywhere] text-[13px] text-ink-secondary",children:l.outcome??l.summary}),e.jsxs("p",{className:"mt-1 [overflow-wrap:anywhere] text-[12px] text-ink-tertiary",children:[a("templates.botCount",{count:s.members})," · ",a("templates.playbookCount",{count:s.skills.length}),s.requires.apps.length>0&&` · ${s.requires.apps.join(", ")}`,s.setupMinutes&&` · ${a("templates.minutes",{count:s.setupMinutes})}`]})]}),e.jsxs("div",{className:"col-span-2 flex flex-wrap justify-end gap-2",children:[e.jsx("button",{type:"button","data-team-details":s.slug,onClick:()=>{we(s),le(!0)},className:"shrink-0 rounded-full px-2.5 py-2 text-[13px] text-accent-text hover:underline",children:p("Xem thêm","See more")}),e.jsxs("button",{onClick:()=>{Ze(s)},disabled:n!==null,className:"flex min-w-[72px] items-center justify-center gap-1.5 rounded-full bg-raised px-3.5 py-2 text-[13px] text-ink hover:bg-raised-hover disabled:opacity-40",children:[n===s.slug&&e.jsx(z,{size:13,className:"animate-spin"}),n===s.slug?a("templates.loadingShort"):a("templates.load")]})]})]},s.slug)})}),!R&&$&&at.length===0&&e.jsxs("div",{className:"flex min-h-56 flex-col items-center justify-center text-center",children:[e.jsx("div",{className:"text-[14px] font-medium text-ink",children:a("templates.noneFound")}),e.jsx("div",{className:"mt-1 text-[13px] text-ink-secondary",children:a("templates.tryDifferentSearch")})]})]}),d==="import"&&e.jsxs("div",{children:[e.jsx("input",{ref:w,type:"file",accept:".md,.json,.mausbackup.json,.mausteam.json,text/markdown,application/json",className:"hidden",onChange:s=>{const r=s.currentTarget.files?.[0];s.currentTarget.value="",r&&Qe(r).catch(l=>f(l instanceof Error?l.message:String(l)))}}),e.jsx("div",{className:"mb-3 text-[12px] font-medium text-ink-secondary",children:a("templates.bringYourOwn")}),e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsxs("button",{onClick:()=>w.current?.click(),onDragEnter:s=>{s.preventDefault(),ke(!0)},onDragOver:s=>s.preventDefault(),onDragLeave:()=>ke(!1),onDrop:s=>{s.preventDefault(),ke(!1);const r=s.dataTransfer.files[0];r&&Qe(r).catch(l=>f(l instanceof Error?l.message:String(l)))},className:S("flex min-h-56 flex-col items-center justify-center rounded-2xl border border-dashed px-6 text-center transition-colors",wt?"border-accent bg-accent/5":"border-hairline/60 bg-raised/20 hover:bg-raised/35"),children:[e.jsx(Ft,{size:27,className:"text-accent"}),e.jsx("span",{className:"mt-3 text-[14px] font-medium text-ink",children:a("templates.chooseFile")}),e.jsx("span",{className:"mt-1 text-[13px] text-ink-secondary",children:a("templates.dropFile")})]}),e.jsxs("div",{className:"flex min-h-56 flex-col justify-center rounded-2xl bg-raised/25 px-6",children:[e.jsx(ot,{size:25,className:"text-ink-secondary"}),e.jsx("h3",{className:"mt-3 text-[14px] font-medium text-ink",children:a("templates.loadGithub")}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:a("templates.githubHint")}),e.jsxs("div",{className:"mt-4 flex gap-2",children:[e.jsx("input",{value:ye,onChange:s=>Re(s.target.value),onKeyDown:s=>s.key==="Enter"&&void Ve(),placeholder:a("templates.githubPlaceholder"),"aria-label":a("templates.githubUrl"),className:"min-w-0 flex-1 rounded-xl bg-raised/80 px-3 py-2.5 text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none"}),e.jsxs("button",{onClick:()=>{Ve()},disabled:!ye.trim()||Oe,className:"flex items-center gap-1.5 rounded-full bg-accent px-4 py-2.5 text-[13px] font-medium text-white hover:bg-accent/90 disabled:opacity-40",children:[Oe&&e.jsx(z,{size:13,className:"animate-spin"}),a("templates.load")]})]})]})]}),G&&e.jsx("div",{role:"alert",className:"mt-4 rounded-lg bg-danger/10 px-3 py-2 text-[13px] text-danger",children:G})]}),d==="share"&&e.jsxs("div",{children:[e.jsx("p",{className:"max-w-2xl text-[13px] leading-relaxed text-ink-secondary",children:a("teamLibrary.shareIntro")}),Xe.length===0?e.jsx("p",{className:"mt-6 text-[13px] text-ink-secondary",children:a("teamLibrary.shareEmpty")}):e.jsx("div",{className:"mt-4 grid grid-cols-1 gap-x-10 md:grid-cols-2",children:Xe.map((s,r)=>e.jsxs("article",{className:"flex min-h-[84px] items-center gap-3 border-b border-hairline/35 px-1 py-4",children:[e.jsx(ut,{index:r}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"truncate text-[14px] font-medium text-ink",children:s.name||a("teamLibrary.general")}),e.jsx("p",{className:"mt-0.5 text-[13px] text-ink-secondary",children:a("teamLibrary.shareBots",{count:s.bots})})]}),e.jsxs("button",{onClick:()=>He(s.name),"aria-label":a("teamLibrary.shareTeamAria",{name:s.name||a("teamLibrary.general")}),className:"flex items-center gap-1.5 rounded-full bg-raised px-3.5 py-2 text-[13px] text-ink hover:bg-raised-hover",children:[e.jsx(ss,{size:13}),a("teamLibrary.shareTeam")]})]},s.name||"general"))})]}),d==="scout"&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-3 text-[12px] font-medium text-ink-secondary",children:a("templates.startFolder")}),e.jsx("p",{className:"max-w-2xl text-[13px] leading-relaxed text-ink-secondary",children:a("templates.scoutHint")}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{value:De,onChange:s=>Pe(s.target.value),onKeyDown:s=>s.key==="Enter"&&Z&&void Le(Z),placeholder:"/path/to/your/project","aria-label":a("templates.projectFolder"),className:"min-w-0 flex-1 rounded-xl bg-raised/80 px-3 py-2.5 text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none"}),!!window.ogb?.pickFolder&&e.jsxs("button",{onClick:()=>{At()},disabled:ae,className:"flex items-center justify-center gap-1.5 rounded-full bg-raised px-4 py-2.5 text-[13px] text-ink hover:bg-raised-hover disabled:opacity-40",children:[e.jsx(as,{size:14}),a("templates.browse")]}),e.jsxs("button",{onClick:()=>{Le(Z)},disabled:!Z||ae,className:"flex items-center justify-center gap-1.5 rounded-full bg-accent px-4 py-2.5 text-[13px] font-medium text-white hover:bg-accent/90 disabled:opacity-40",children:[ae?e.jsx(z,{size:14,className:"animate-spin"}):e.jsx(ns,{size:14}),ae?a("templates.scouting"):a("templates.scout")]})]}),L&&e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"rounded-2xl bg-raised/25 px-5 py-4",children:[e.jsx("div",{className:"text-[15px] font-semibold text-ink",children:L.profile.name}),L.profile.summary&&e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:L.profile.summary}),L.profile.stacks.length>0&&e.jsx("div",{className:"mt-2.5 flex flex-wrap gap-1.5",children:L.profile.stacks.map(s=>e.jsx("span",{className:"rounded-full bg-raised px-2.5 py-1 text-[12px] text-ink-secondary",children:s},s))})]}),e.jsx("div",{className:"mt-5 text-[12px] font-medium text-ink-secondary",children:a("templates.suggestedTeam")}),e.jsx("div",{className:"mt-1 grid grid-cols-1 gap-x-10 md:grid-cols-2",children:L.suggestion.manifest.team.members.map((s,r)=>e.jsxs("div",{className:"flex min-h-[64px] items-center gap-3 border-b border-hairline/35 px-1 py-3",children:[e.jsx("div",{className:S("flex size-9 shrink-0 items-center justify-center rounded-lg text-[13px] font-semibold",q[r%q.length]),children:s.name.slice(0,1).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"truncate text-[14px] font-medium text-ink",children:[s.name," ",e.jsxs("span",{className:"font-normal text-ink-secondary",children:["· ",s.title]})]}),e.jsx("div",{className:"mt-0.5 truncate text-[12px] text-ink-secondary",children:L.suggestion.reasons[s.key]??""})]})]},s.key))}),ne&&ne.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-5 text-[12px] font-medium text-ink-secondary",children:a("templates.communityDirectory")}),e.jsx("div",{className:"mt-1 flex flex-col",children:ne.map(s=>e.jsxs("div",{className:"flex items-center gap-3 border-b border-hairline/35 px-1 py-3",children:[e.jsxs("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:_e.has(s.slug),onChange:()=>Ue(r=>{const l=new Set(r);return l.has(s.slug)?l.delete(s.slug):l.add(s.slug),l}),className:"size-4 accent-accent"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"truncate text-[14px] font-medium text-ink",children:[s.name,s.category&&e.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",s.category]})]}),e.jsx("div",{className:"mt-0.5 truncate text-[12px] text-ink-secondary",children:a("templates.matches",{values:s.matched.join(", ")})})]})]}),e.jsx("button",{onClick:()=>{pt(s.detailUrl)},"aria-label":a("templates.openDirectory",{name:s.name}),title:a("templates.readBeforeAdding"),className:"rounded-lg p-1.5 text-ink-secondary hover:bg-raised hover:text-ink",children:e.jsx(rt,{size:14})})]},s.slug))})]}),e.jsxs("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsx("input",{value:Ge,onChange:s=>Ke(s.target.value),"aria-label":a("templates.groupChatName"),className:"min-w-0 flex-1 rounded-xl bg-raised/80 px-3 py-2.5 text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none"}),e.jsxs("button",{onClick:()=>{Dt()},disabled:re,className:"flex shrink-0 items-center justify-center gap-2 rounded-full bg-accent px-5 py-2.5 text-[14px] font-medium text-white hover:bg-accent/90 disabled:opacity-60",children:[re&&e.jsx(z,{size:15,className:"animate-spin"}),re?a("templates.creating"):a("templates.createGroupChat")]})]}),e.jsx("p",{className:"mt-2 text-[12px] text-ink-secondary",children:a("templates.createGroupHint")})]}),G&&e.jsx("div",{role:"alert",className:"mt-4 rounded-lg bg-danger/10 px-3 py-2 text-[13px] text-danger",children:G})]})]})]}),e.jsx(ps,{storageKey:"limix.templates.size",widthInset:48,heightInset:48,showGrip:!0})]}),ie!==null&&e.jsx(us,{team:ie,onClose:()=>He(null)})]}),document.body)}export{ks as TeamImportDetails,Fs as TeamLibraryPanel,Ls as shareableTeamList};
|